diff --git a/sb8/qa/assets/Address-BygSM5jP.js b/sb8/qa/assets/Address-CEl_99DV.js similarity index 74% rename from sb8/qa/assets/Address-BygSM5jP.js rename to sb8/qa/assets/Address-CEl_99DV.js index 99fd233b07..693400e550 100644 --- a/sb8/qa/assets/Address-BygSM5jP.js +++ b/sb8/qa/assets/Address-CEl_99DV.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-CH7MCt8u.js";import{s as o}from"./Address.stories-CSiyqku0.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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"./formUtils-C-50Qw-d.js";import"./FormFieldText.styled-hkDOkrrs.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-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./index-jWylWF_w.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-Dn-MWZ_m.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-yhdXyTld.js";import"./formats-CDjt32hU.js";import"./Dialog-BlwzXIwM.js";import"./useMediaQuery-CguehUMS.js";import"./SideNav-biYpQHtM.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.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-VPsM0GyV.js";import{s as o}from"./Address.stories-BUQ2dwO_.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-Cf-5vk95.js";import"./theme-DRtZtbPc.js";import"./SideNav-biYpQHtM.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./FormFieldText.styled-hkDOkrrs.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"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./index-DnvaddO_.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-gVxq6Y0Z.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-yhdXyTld.js";import"./formats-CDjt32hU.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-BUQ2dwO_.js b/sb8/qa/assets/Address.stories-BUQ2dwO_.js new file mode 100644 index 0000000000..e570850e49 --- /dev/null +++ b/sb8/qa/assets/Address.stories-BUQ2dwO_.js @@ -0,0 +1,43 @@ +import{j as n}from"./jsx-runtime-nGUw9YhZ.js";import{r as y}from"./index-BP8_t0zE.js";import{r as k}from"./renderButtons-BmHfsf_z.js";import{u as F,F as x}from"./Form-Cf-5vk95.js";import{g as B,a as O}from"./optionGetters-DXvNsMp-.js";const j={title:"FormFields/FormFieldAddress"},o=["undefined",1,2,3,4,5,-1],t={getOptionsCountries:B,getOptionsStates:O,googleMapsApiKey:"AIzaSyArV4f-KFF86Zn9VWAu9wS4hHlG1TXxqac"},V=[{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"}]}],e=({label:a,disabled:u,required:m,skeleton:v,prepopulate:p,amountPerType:i,amountShipping:r,amountPhysical:l,amountBilling:d})=>{const c=F(),{state:M,handleSubmit:A}=c,N=y.useMemo(()=>p?async()=>({address:V}):void 0,[p]),T=y.useMemo(()=>[{disabled:u,label:a,required:m,name:"address",type:"address",inputSettings:{amountPerType:i==="undefined"?void 0:Number(i),amountShipping:r==="undefined"?void 0:Number(r),amountPhysical:l==="undefined"?void 0:Number(l),amountBilling:d==="undefined"?void 0:Number(d),...t}}],[u,a,m,i,r,l,d]);return n.jsxs(n.Fragment,{children:[n.jsx(x,{...c,buttons:k(A),title:"Address field",fields:T,skeleton:v,getFormValues:N}),n.jsx("pre",{children:JSON.stringify(M,null," ")})]})};e.args={label:"Label",disabled:!1,required:!1,skeleton:!1,prepopulate:!1,amountPerType:"undefined",amountShipping:"undefined",amountPhysical:"undefined",amountBilling:"undefined"};e.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:o},amountShipping:{name:"Shipping Maximum",control:{type:"select"},options:o},amountPhysical:{name:"Physical Maximum",control:{type:"select"},options:o},amountBilling:{name:"Billing Maximum",control:{type:"select"},options:o}};const E=[{label:"Provide a physical address",name:"physicalOnly",type:"address",inputSettings:{amountPhysical:1,...t}},{label:"Provide 1 physical address and 1 shipping address",name:"physicalAndShipping",type:"address",inputSettings:{amountPhysical:1,amountShipping:1,...t}},{label:"Provide any combination of addresses with a maximum of 1 each",name:"anyCombinationMax1",type:"address",inputSettings:{...t}},{label:"Provide any combination of addresses with no maximum",name:"anyCombinationNoMax",type:"address",inputSettings:{amountPerType:-1,...t}}],s=()=>{const a=F();return n.jsx(x,{...a,title:"Address Field",fields:E})};var f,g,h;e.parameters={...e.parameters,docs:{...(f=e.parameters)==null?void 0:f.docs,source:{originalSource:`({ + label, + disabled, + required, + skeleton, + prepopulate, + amountPerType, + amountShipping, + amountPhysical, + amountBilling +}: typeof Playground.args): ReactElement => { + const controller = useForm(); + const { + state, + handleSubmit + } = controller; + const getFormValues = useMemo(() => prepopulate ? async () => { + return { + address: addresses + }; + } : undefined, [prepopulate]); + const fields = useMemo((): FieldDef[] => [{ + disabled, + label, + required, + name: "address", + type: "address", + inputSettings: { + amountPerType: amountPerType === "undefined" ? undefined : Number(amountPerType), + amountShipping: amountShipping === "undefined" ? undefined : Number(amountShipping), + amountPhysical: amountPhysical === "undefined" ? undefined : Number(amountPhysical), + amountBilling: amountBilling === "undefined" ? undefined : Number(amountBilling), + ...commonInputSettings + } + }], [disabled, label, required, amountPerType, amountShipping, amountPhysical, amountBilling]); + return <> +
+
{JSON.stringify(state, null, "  ")}
+ ; +}`,...(h=(g=e.parameters)==null?void 0:g.docs)==null?void 0:h.source}}};var b,S,P;s.parameters={...s.parameters,docs:{...(b=s.parameters)==null?void 0:b.docs,source:{originalSource:`(): ReactElement => { + const controller = useForm(); + return ; +}`,...(P=(S=s.parameters)==null?void 0:S.docs)==null?void 0:P.source}}};const _=["Playground","KitchenSink"],U=Object.freeze(Object.defineProperty({__proto__:null,KitchenSink:s,Playground:e,__namedExportsOrder:_,default:j},Symbol.toStringTag,{value:"Module"}));export{U as s}; diff --git a/sb8/qa/assets/Address.stories-CSiyqku0.js b/sb8/qa/assets/Address.stories-CSiyqku0.js deleted file mode 100644 index be4bcc4074..0000000000 --- a/sb8/qa/assets/Address.stories-CSiyqku0.js +++ /dev/null @@ -1,43 +0,0 @@ -import{j as n}from"./jsx-runtime-nGUw9YhZ.js";import{r as y}from"./index-BP8_t0zE.js";import{r as k}from"./renderButtons-BmHfsf_z.js";import{u as F,F as x}from"./formUtils-C-50Qw-d.js";import"./Button-Do5OxnZO.js";import{g as B,a as O}from"./optionGetters-DXvNsMp-.js";const j={title:"FormFields/FormFieldAddress"},o=["undefined",1,2,3,4,5,-1],t={getOptionsCountries:B,getOptionsStates:O,googleMapsApiKey:"AIzaSyArV4f-KFF86Zn9VWAu9wS4hHlG1TXxqac"},V=[{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"}]}],e=({label:a,disabled:u,required:m,skeleton:v,prepopulate:p,amountPerType:i,amountShipping:r,amountPhysical:l,amountBilling:d})=>{const c=F(),{state:M,handleSubmit:A}=c,N=y.useMemo(()=>p?async()=>({address:V}):void 0,[p]),T=y.useMemo(()=>[{disabled:u,label:a,required:m,name:"address",type:"address",inputSettings:{amountPerType:i==="undefined"?void 0:Number(i),amountShipping:r==="undefined"?void 0:Number(r),amountPhysical:l==="undefined"?void 0:Number(l),amountBilling:d==="undefined"?void 0:Number(d),...t}}],[u,a,m,i,r,l,d]);return n.jsxs(n.Fragment,{children:[n.jsx(x,{...c,buttons:k(A),title:"Address field",fields:T,skeleton:v,getFormValues:N}),n.jsx("pre",{children:JSON.stringify(M,null," ")})]})};e.args={label:"Label",disabled:!1,required:!1,skeleton:!1,prepopulate:!1,amountPerType:"undefined",amountShipping:"undefined",amountPhysical:"undefined",amountBilling:"undefined"};e.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:o},amountShipping:{name:"Shipping Maximum",control:{type:"select"},options:o},amountPhysical:{name:"Physical Maximum",control:{type:"select"},options:o},amountBilling:{name:"Billing Maximum",control:{type:"select"},options:o}};const E=[{label:"Provide a physical address",name:"physicalOnly",type:"address",inputSettings:{amountPhysical:1,...t}},{label:"Provide 1 physical address and 1 shipping address",name:"physicalAndShipping",type:"address",inputSettings:{amountPhysical:1,amountShipping:1,...t}},{label:"Provide any combination of addresses with a maximum of 1 each",name:"anyCombinationMax1",type:"address",inputSettings:{...t}},{label:"Provide any combination of addresses with no maximum",name:"anyCombinationNoMax",type:"address",inputSettings:{amountPerType:-1,...t}}],s=()=>{const a=F();return n.jsx(x,{...a,title:"Address Field",fields:E})};var f,g,h;e.parameters={...e.parameters,docs:{...(f=e.parameters)==null?void 0:f.docs,source:{originalSource:`({ - label, - disabled, - required, - skeleton, - prepopulate, - amountPerType, - amountShipping, - amountPhysical, - amountBilling -}: typeof Playground.args): ReactElement => { - const controller = useForm(); - const { - state, - handleSubmit - } = controller; - const getFormValues = useMemo(() => prepopulate ? async () => { - return { - address: addresses - }; - } : undefined, [prepopulate]); - const fields = useMemo((): FieldDef[] => [{ - disabled, - label, - required, - name: "address", - type: "address", - inputSettings: { - amountPerType: amountPerType === "undefined" ? undefined : Number(amountPerType), - amountShipping: amountShipping === "undefined" ? undefined : Number(amountShipping), - amountPhysical: amountPhysical === "undefined" ? undefined : Number(amountPhysical), - amountBilling: amountBilling === "undefined" ? undefined : Number(amountBilling), - ...commonInputSettings - } - }], [disabled, label, required, amountPerType, amountShipping, amountPhysical, amountBilling]); - return <> - -
{JSON.stringify(state, null, "  ")}
- ; -}`,...(h=(g=e.parameters)==null?void 0:g.docs)==null?void 0:h.source}}};var b,S,P;s.parameters={...s.parameters,docs:{...(b=s.parameters)==null?void 0:b.docs,source:{originalSource:`(): ReactElement => { - const controller = useForm(); - return ; -}`,...(P=(S=s.parameters)==null?void 0:S.docs)==null?void 0:P.source}}};const _=["Playground","KitchenSink"],I=Object.freeze(Object.defineProperty({__proto__:null,KitchenSink:s,Playground:e,__namedExportsOrder:_,default:j},Symbol.toStringTag,{value:"Module"}));export{I as s}; diff --git a/sb8/qa/assets/AdvancedSelection-P2PmfS6s.js b/sb8/qa/assets/AdvancedSelection-C6sfwrfd.js similarity index 69% rename from sb8/qa/assets/AdvancedSelection-P2PmfS6s.js rename to sb8/qa/assets/AdvancedSelection-C6sfwrfd.js index 72c8f81c45..07292ba98b 100644 --- a/sb8/qa/assets/AdvancedSelection-P2PmfS6s.js +++ b/sb8/qa/assets/AdvancedSelection-C6sfwrfd.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-CH7MCt8u.js";import{s}from"./AdvancedSelection.stories-BHA2wrRL.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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"./formUtils-C-50Qw-d.js";import"./FormFieldText.styled-hkDOkrrs.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-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./index-jWylWF_w.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-Dn-MWZ_m.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-yhdXyTld.js";import"./formats-CDjt32hU.js";import"./Dialog-BlwzXIwM.js";import"./useMediaQuery-CguehUMS.js";import"./SideNav-biYpQHtM.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./renderButtons-BmHfsf_z.js";import"./options-BIHZJM4G.js";import"./MultiSelectHelper-ficPbA-p.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-VPsM0GyV.js";import{s}from"./AdvancedSelection.stories-BNDxejPb.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-Cf-5vk95.js";import"./theme-DRtZtbPc.js";import"./SideNav-biYpQHtM.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./FormFieldText.styled-hkDOkrrs.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"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./index-DnvaddO_.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-gVxq6Y0Z.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-yhdXyTld.js";import"./formats-CDjt32hU.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-BIHZJM4G.js";import"./MultiSelectHelper-K9Ou7yoP.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-BHA2wrRL.js b/sb8/qa/assets/AdvancedSelection.stories-BNDxejPb.js similarity index 59% rename from sb8/qa/assets/AdvancedSelection.stories-BHA2wrRL.js rename to sb8/qa/assets/AdvancedSelection.stories-BNDxejPb.js index 882fa87b32..19dc9aa9c1 100644 --- a/sb8/qa/assets/AdvancedSelection.stories-BHA2wrRL.js +++ b/sb8/qa/assets/AdvancedSelection.stories-BNDxejPb.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"./formUtils-C-50Qw-d.js";import"./Button-Do5OxnZO.js";import{r as M}from"./renderButtons-BmHfsf_z.js";import{o as s}from"./options-BIHZJM4G.js";import{M as j,J as k,c as B}from"./MultiSelectHelper-ficPbA-p.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-Cf-5vk95.js";import{r as M}from"./renderButtons-BmHfsf_z.js";import{o as s}from"./options-BIHZJM4G.js";import{M as j,J as k,c as B}from"./MultiSelectHelper-K9Ou7yoP.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, @@ -143,4 +143,4 @@ import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{r as _}from"./index-BP8_t0z
{JSON.stringify(state, null, "  ")}
; -}`,...(F=(A=m.parameters)==null?void 0:A.docs)==null?void 0:F.source}}};const I=["Playground","KitchenSink"],Y=Object.freeze(Object.defineProperty({__proto__:null,KitchenSink:m,Playground:i,__namedExportsOrder:I,default:E},Symbol.toStringTag,{value:"Module"}));export{Y as s}; +}`,...(F=(A=m.parameters)==null?void 0:A.docs)==null?void 0:F.source}}};const I=["Playground","KitchenSink"],X=Object.freeze(Object.defineProperty({__proto__:null,KitchenSink:m,Playground:i,__namedExportsOrder:I,default:E},Symbol.toStringTag,{value:"Module"}));export{X as s}; diff --git a/sb8/qa/assets/Button-BwGQnMjz.js b/sb8/qa/assets/Button-sD_gR3w9.js similarity index 94% rename from sb8/qa/assets/Button-BwGQnMjz.js rename to sb8/qa/assets/Button-sD_gR3w9.js index 7582c1c608..c923d10ad9 100644 --- a/sb8/qa/assets/Button-BwGQnMjz.js +++ b/sb8/qa/assets/Button-sD_gR3w9.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-CH7MCt8u.js";import{s,P as m}from"./Button.stories-DCUuQ8-j.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-B3IWj8ab.js";import"./testIds-D6Gx1A0F.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-VPsM0GyV.js";import{s,P as m}from"./Button.stories-DCUuQ8-j.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-B3IWj8ab.js";import"./testIds-D6Gx1A0F.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-l3X8zZkU.js b/sb8/qa/assets/ButtonRow-DzHLLG29.js similarity index 90% rename from sb8/qa/assets/ButtonRow-l3X8zZkU.js rename to sb8/qa/assets/ButtonRow-DzHLLG29.js index d56fe05cbf..6d5ba46a46 100644 --- a/sb8/qa/assets/ButtonRow-l3X8zZkU.js +++ b/sb8/qa/assets/ButtonRow-DzHLLG29.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-CH7MCt8u.js";import{s,P as e}from"./ButtonRow.stories-B4Fdyuo7.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-B3IWj8ab.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-D6Gx1A0F.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-VPsM0GyV.js";import{s,P as e}from"./ButtonRow.stories-B4Fdyuo7.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-B3IWj8ab.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-D6Gx1A0F.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-DHd7J17s.js b/sb8/qa/assets/Card-DBRnwBPs.js similarity index 91% rename from sb8/qa/assets/Card-DHd7J17s.js rename to sb8/qa/assets/Card-DBRnwBPs.js index ab978de0d7..84d971ad3d 100644 --- a/sb8/qa/assets/Card-DHd7J17s.js +++ b/sb8/qa/assets/Card-DBRnwBPs.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-CH7MCt8u.js";import{s as m,P as s,R as c}from"./Card.stories-f9HukW5b.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-D6Gx1A0F.js";import"./ButtonRow-B3IWj8ab.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-CDjt32hU.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-VPsM0GyV.js";import{s as m,P as s,R as c}from"./Card.stories-f9HukW5b.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-D6Gx1A0F.js";import"./ButtonRow-B3IWj8ab.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-CDjt32hU.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-_tnI-ufy.js b/sb8/qa/assets/Checkbox-Bv-xByy4.js similarity index 89% rename from sb8/qa/assets/Checkbox-_tnI-ufy.js rename to sb8/qa/assets/Checkbox-Bv-xByy4.js index 3146ae6109..1e58e0338e 100644 --- a/sb8/qa/assets/Checkbox-_tnI-ufy.js +++ b/sb8/qa/assets/Checkbox-Bv-xByy4.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-CH7MCt8u.js";import{s as p,P as n}from"./Checkbox.stories-DbBzM9S2.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-BN-KUs9r.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-D6Gx1A0F.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-VPsM0GyV.js";import{s as p,P as n}from"./Checkbox.stories-DbBzM9S2.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-BN-KUs9r.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-D6Gx1A0F.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-DtvbyO8j.js b/sb8/qa/assets/CheckboxList-BmT12QDz.js similarity index 99% rename from sb8/qa/assets/CheckboxList-DtvbyO8j.js rename to sb8/qa/assets/CheckboxList-BmT12QDz.js index bf5e27e94d..09a9d7120b 100644 --- a/sb8/qa/assets/CheckboxList-DtvbyO8j.js +++ b/sb8/qa/assets/CheckboxList-BmT12QDz.js @@ -1 +1 @@ -import{j as X}from"./jsx-runtime-nGUw9YhZ.js";import{g as We,r as D}from"./index-BP8_t0zE.js";import{b as G,i as ee,_ as d,c as re,d as P,e as Cr,a as ae}from"./isSymbol-CEVJpixJ.js";import{C as mr}from"./Checkbox-BN-KUs9r.js";import{a as Tr,g as Sr,s as wr,d as Y,u as Or,_ as Ir,e as Pr,f as xr}from"./generateUtilityClasses-DAcHHM0W.js";import{u as Er,f as Mr}from"./formControlState-D52vkf9K.js";function Dr(e,r){for(var a=-1,t=e==null?0:e.length,n=0,s=[];++a-1}var kr=Yr,Zr=N;function Jr(e,r){var a=this.__data__,t=Zr(a,e);return t<0?(++this.size,a.push([e,r])):a[t][1]=r,this}var Qr=Jr,Vr=Fr,ea=Br,ra=Wr,aa=kr,ta=Qr;function T(e){var r=-1,a=e==null?0:e.length;for(this.clear();++ri))return!1;var c=s.get(e),f=s.get(r);if(c&&f)return c==r&&f==e;var l=-1,v=!0,g=a&An?new pn:void 0;for(s.set(e,r),s.set(r,e);++l-1&&e%1==0&&e-1&&e%1==0&&e<=Ts}var ce=Ss,ws=G,Os=ce,Is=P,Ps="[object Arguments]",xs="[object Array]",Es="[object Boolean]",Ms="[object Date]",Ds="[object Error]",Ls="[object Function]",Fs="[object Map]",Rs="[object Number]",Gs="[object Object]",Ns="[object RegExp]",js="[object Set]",Hs="[object String]",Us="[object WeakMap]",Ks="[object ArrayBuffer]",Bs="[object DataView]",qs="[object Float32Array]",zs="[object Float64Array]",Ws="[object Int8Array]",Xs="[object Int16Array]",Ys="[object Int32Array]",ks="[object Uint8Array]",Zs="[object Uint8ClampedArray]",Js="[object Uint16Array]",Qs="[object Uint32Array]",h={};h[qs]=h[zs]=h[Ws]=h[Xs]=h[Ys]=h[ks]=h[Zs]=h[Js]=h[Qs]=!0;h[Ps]=h[xs]=h[Ks]=h[Es]=h[Bs]=h[Ms]=h[Ds]=h[Ls]=h[Fs]=h[Rs]=h[Gs]=h[Ns]=h[js]=h[Hs]=h[Us]=!1;function Vs(e){return Is(e)&&Os(e.length)&&!!h[ws(e)]}var ei=Vs;function ri(e){return function(r){return e(r)}}var tr=ri,R={exports:{}};R.exports;(function(e,r){var a=Cr,t=r&&!r.nodeType&&r,n=t&&!0&&e&&!e.nodeType&&e,s=n&&n.exports===t,o=s&&a.process,i=function(){try{var u=n&&n.require&&n.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}}();e.exports=i})(R,R.exports);var ai=R.exports,ti=ei,ni=tr,Ce=ai,me=Ce&&Ce.isTypedArray,si=me?ni(me):ti,nr=si,ii=cs,oi=ue,ui=p,ci=rr,fi=ar,li=nr,vi=Object.prototype,hi=vi.hasOwnProperty;function _i(e,r){var a=ui(e),t=!a&&oi(e),n=!a&&!t&&ci(e),s=!a&&!t&&!n&&li(e),o=a||t||n||s,i=o?ii(e.length,String):[],u=i.length;for(var c in e)(r||hi.call(e,c))&&!(o&&(c=="length"||n&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||fi(c,u)))&&i.push(c);return i}var $i=_i,gi=Object.prototype;function pi(e){var r=e&&e.constructor,a=typeof r=="function"&&r.prototype||gi;return e===a}var yi=pi;function di(e,r){return function(a){return e(r(a))}}var bi=di,Ai=bi,Ci=Ai(Object.keys,Object),mi=Ci,Ti=yi,Si=mi,wi=Object.prototype,Oi=wi.hasOwnProperty;function Ii(e){if(!Ti(e))return Si(e);var r=[];for(var a in Object(e))Oi.call(e,a)&&a!="constructor"&&r.push(a);return r}var Pi=Ii,xi=ke,Ei=ce;function Mi(e){return e!=null&&Ei(e.length)&&!xi(e)}var sr=Mi,Di=$i,Li=Pi,Fi=sr;function Ri(e){return Fi(e)?Di(e):Li(e)}var ir=Ri,Gi=Vn,Ni=os,ji=ir;function Hi(e){return Gi(e,ji,Ni)}var Ui=Hi,Te=Ui,Ki=1,Bi=Object.prototype,qi=Bi.hasOwnProperty;function zi(e,r,a,t,n,s){var o=a&Ki,i=Te(e),u=i.length,c=Te(r),f=c.length;if(u!=f&&!o)return!1;for(var l=u;l--;){var v=i[l];if(!(o?v in r:qi.call(r,v)))return!1}var g=s.get(e),_=s.get(r);if(g&&_)return g==r&&_==e;var $=!0;s.set(e,r),s.set(r,e);for(var y=o;++l0){if(++r>=Ec)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}var Fc=Lc,Rc=xc,Gc=Fc,Nc=Gc(Rc),jc=Nc,Hc=ve,Uc=Ac,Kc=jc;function Bc(e,r){return Kc(Uc(e,r,Hc),e+"")}var qc=Bc;function zc(e,r,a,t){for(var n=e.length,s=a+(t?1:-1);t?s--:++s-1}var dr=tf;function nf(e,r,a){for(var t=-1,n=e==null?0:e.length;++t=vf&&(s=lf,o=!1,r=new sf(r));e:for(;++n0&&a(i)?r>1?Ar(i,r-1,a,t,n):df(n,i):t||(n[n.length]=i)}return n}var Af=Ar;function Cf(){}var mf=Cf,W=or,Tf=mf,Sf=oe,wf=1/0,Of=W&&1/Sf(new W([,-0]))[1]==wf?function(e){return new W(e)}:Tf,If=Of,Pf=se,xf=dr,Ef=br,Mf=ie,Df=If,Lf=oe,Ff=200;function Rf(e,r,a){var t=-1,n=xf,s=e.length,o=!0,i=[],u=i;if(a)o=!1,n=Ef;else if(s>=Ff){var c=r?null:Df(e);if(c)return Lf(c);o=!1,n=Mf,u=new Pf}else u=r?[]:i;e:for(;++t{const{classes:r,row:a,error:t}=e;return xr({root:["root",a&&"row",t&&"error"]},al,r)},sl=wr("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:a}=e;return[r.root,a.row&&r.row]}})(({ownerState:e})=>Y({display:"flex",flexDirection:"column",flexWrap:"wrap"},e.row&&{flexDirection:"row"})),il=D.forwardRef(function(r,a){const t=Or({props:r,name:"MuiFormGroup"}),{className:n,row:s=!1}=t,o=Ir(t,tl),i=Er(),u=Mr({props:t,muiFormControl:i,states:["error"]}),c=Y({},t,{row:s,error:u.error}),f=nl(c);return X.jsx(sl,Y({className:Pr(f.root,n),ownerState:c,ref:a},o))}),_l=e=>{var s;const r=D.useId(),a=e.id||r,t=D.useCallback(o=>()=>{const i=rl(e.checked,[o],u=>u.value);e.onChange(i),e!=null&&e.onChangeCb&&e.onChangeCb(i)},[e.checked,e.onChange,e.options]),n=D.useMemo(()=>{var o;return(o=e==null?void 0:e.options)==null?void 0:o.map(i=>t(i))},[e.options,t]);return X.jsx(il,{className:`${e.className??""} listItem`,onBlur:e.onBlur,style:e.style,children:(s=e==null?void 0:e.options)==null?void 0:s.map((o,i)=>{var c,f;const u=((c=e==null?void 0:e.checked)==null?void 0:c.length)>0?((f=e.checked)==null?void 0:f.filter(l=>l.value===o.value).length)>0:!1;return X.jsx(mr,{className:u?"checked":"",checked:u,label:o.label,disabled:e.disabled,id:`${a}-${i}`,onClick:n[i],value:o.value},`${o.value}-${i}`)})})};export{bi as A,yi as B,_l as C,$i as D,os as E,Ve as F,rs as G,Vn as H,Sn as I,_o as J,ai as K,Je as L,rr as M,Ui as N,il as O,se as _,_r as a,tr as b,ie as c,dr as d,br as e,qc as f,hl as g,fr as h,zf as i,pr as j,ve as k,p as l,gc as m,Ye as n,sr as o,ar as p,Af as q,ir as r,Xe as s,Uf as t,wc as u,gr as v,K as w,Hu as x,Ac as y,jc as z}; +import{j as X}from"./jsx-runtime-nGUw9YhZ.js";import{g as We,r as D}from"./index-BP8_t0zE.js";import{b as G,i as ee,_ as d,c as re,d as P,e as Cr,a as ae}from"./isSymbol-CEVJpixJ.js";import{C as mr}from"./Checkbox-BN-KUs9r.js";import{a as Tr,g as Sr,s as wr,d as Y,u as Or,_ as Ir,e as Pr,f as xr}from"./generateUtilityClasses-DAcHHM0W.js";import{u as Er,f as Mr}from"./formControlState-D52vkf9K.js";function Dr(e,r){for(var a=-1,t=e==null?0:e.length,n=0,s=[];++a-1}var kr=Yr,Zr=N;function Jr(e,r){var a=this.__data__,t=Zr(a,e);return t<0?(++this.size,a.push([e,r])):a[t][1]=r,this}var Qr=Jr,Vr=Fr,ea=Br,ra=Wr,aa=kr,ta=Qr;function T(e){var r=-1,a=e==null?0:e.length;for(this.clear();++ri))return!1;var c=s.get(e),f=s.get(r);if(c&&f)return c==r&&f==e;var l=-1,v=!0,g=a&An?new pn:void 0;for(s.set(e,r),s.set(r,e);++l-1&&e%1==0&&e-1&&e%1==0&&e<=Ts}var ce=Ss,ws=G,Os=ce,Is=P,Ps="[object Arguments]",xs="[object Array]",Es="[object Boolean]",Ms="[object Date]",Ds="[object Error]",Ls="[object Function]",Fs="[object Map]",Rs="[object Number]",Gs="[object Object]",Ns="[object RegExp]",js="[object Set]",Hs="[object String]",Us="[object WeakMap]",Ks="[object ArrayBuffer]",Bs="[object DataView]",qs="[object Float32Array]",zs="[object Float64Array]",Ws="[object Int8Array]",Xs="[object Int16Array]",Ys="[object Int32Array]",ks="[object Uint8Array]",Zs="[object Uint8ClampedArray]",Js="[object Uint16Array]",Qs="[object Uint32Array]",h={};h[qs]=h[zs]=h[Ws]=h[Xs]=h[Ys]=h[ks]=h[Zs]=h[Js]=h[Qs]=!0;h[Ps]=h[xs]=h[Ks]=h[Es]=h[Bs]=h[Ms]=h[Ds]=h[Ls]=h[Fs]=h[Rs]=h[Gs]=h[Ns]=h[js]=h[Hs]=h[Us]=!1;function Vs(e){return Is(e)&&Os(e.length)&&!!h[ws(e)]}var ei=Vs;function ri(e){return function(r){return e(r)}}var tr=ri,R={exports:{}};R.exports;(function(e,r){var a=Cr,t=r&&!r.nodeType&&r,n=t&&!0&&e&&!e.nodeType&&e,s=n&&n.exports===t,o=s&&a.process,i=function(){try{var u=n&&n.require&&n.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}}();e.exports=i})(R,R.exports);var ai=R.exports,ti=ei,ni=tr,Ce=ai,me=Ce&&Ce.isTypedArray,si=me?ni(me):ti,nr=si,ii=cs,oi=ue,ui=p,ci=rr,fi=ar,li=nr,vi=Object.prototype,hi=vi.hasOwnProperty;function _i(e,r){var a=ui(e),t=!a&&oi(e),n=!a&&!t&&ci(e),s=!a&&!t&&!n&&li(e),o=a||t||n||s,i=o?ii(e.length,String):[],u=i.length;for(var c in e)(r||hi.call(e,c))&&!(o&&(c=="length"||n&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||fi(c,u)))&&i.push(c);return i}var $i=_i,gi=Object.prototype;function pi(e){var r=e&&e.constructor,a=typeof r=="function"&&r.prototype||gi;return e===a}var yi=pi;function di(e,r){return function(a){return e(r(a))}}var bi=di,Ai=bi,Ci=Ai(Object.keys,Object),mi=Ci,Ti=yi,Si=mi,wi=Object.prototype,Oi=wi.hasOwnProperty;function Ii(e){if(!Ti(e))return Si(e);var r=[];for(var a in Object(e))Oi.call(e,a)&&a!="constructor"&&r.push(a);return r}var Pi=Ii,xi=ke,Ei=ce;function Mi(e){return e!=null&&Ei(e.length)&&!xi(e)}var sr=Mi,Di=$i,Li=Pi,Fi=sr;function Ri(e){return Fi(e)?Di(e):Li(e)}var ir=Ri,Gi=Vn,Ni=os,ji=ir;function Hi(e){return Gi(e,ji,Ni)}var Ui=Hi,Te=Ui,Ki=1,Bi=Object.prototype,qi=Bi.hasOwnProperty;function zi(e,r,a,t,n,s){var o=a&Ki,i=Te(e),u=i.length,c=Te(r),f=c.length;if(u!=f&&!o)return!1;for(var l=u;l--;){var v=i[l];if(!(o?v in r:qi.call(r,v)))return!1}var g=s.get(e),_=s.get(r);if(g&&_)return g==r&&_==e;var $=!0;s.set(e,r),s.set(r,e);for(var y=o;++l0){if(++r>=Ec)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}var Fc=Lc,Rc=xc,Gc=Fc,Nc=Gc(Rc),jc=Nc,Hc=ve,Uc=Ac,Kc=jc;function Bc(e,r){return Kc(Uc(e,r,Hc),e+"")}var qc=Bc;function zc(e,r,a,t){for(var n=e.length,s=a+(t?1:-1);t?s--:++s-1}var dr=tf;function nf(e,r,a){for(var t=-1,n=e==null?0:e.length;++t=vf&&(s=lf,o=!1,r=new sf(r));e:for(;++n0&&a(i)?r>1?Ar(i,r-1,a,t,n):df(n,i):t||(n[n.length]=i)}return n}var Af=Ar;function Cf(){}var mf=Cf,W=or,Tf=mf,Sf=oe,wf=1/0,Of=W&&1/Sf(new W([,-0]))[1]==wf?function(e){return new W(e)}:Tf,If=Of,Pf=se,xf=dr,Ef=br,Mf=ie,Df=If,Lf=oe,Ff=200;function Rf(e,r,a){var t=-1,n=xf,s=e.length,o=!0,i=[],u=i;if(a)o=!1,n=Ef;else if(s>=Ff){var c=r?null:Df(e);if(c)return Lf(c);o=!1,n=Mf,u=new Pf}else u=r?[]:i;e:for(;++t{const{classes:r,row:a,error:t}=e;return xr({root:["root",a&&"row",t&&"error"]},al,r)},sl=wr("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:a}=e;return[r.root,a.row&&r.row]}})(({ownerState:e})=>Y({display:"flex",flexDirection:"column",flexWrap:"wrap"},e.row&&{flexDirection:"row"})),il=D.forwardRef(function(r,a){const t=Or({props:r,name:"MuiFormGroup"}),{className:n,row:s=!1}=t,o=Ir(t,tl),i=Er(),u=Mr({props:t,muiFormControl:i,states:["error"]}),c=Y({},t,{row:s,error:u.error}),f=nl(c);return X.jsx(sl,Y({className:Pr(f.root,n),ownerState:c,ref:a},o))}),_l=e=>{var s;const r=D.useId(),a=e.id||r,t=D.useCallback(o=>()=>{const i=rl(e.checked,[o],u=>u.value);e.onChange(i),e!=null&&e.onChangeCb&&e.onChangeCb(i)},[e.checked,e.onChange,e.options]),n=D.useMemo(()=>{var o;return(o=e==null?void 0:e.options)==null?void 0:o.map(i=>t(i))},[e.options,t]);return X.jsx(il,{className:`${e.className??""} listItem`,onBlur:e.onBlur,style:e.style,children:(s=e==null?void 0:e.options)==null?void 0:s.map((o,i)=>{var c,f;const u=((c=e==null?void 0:e.checked)==null?void 0:c.length)>0?((f=e.checked)==null?void 0:f.filter(l=>l.value===o.value).length)>0:!1;return X.jsx(mr,{className:u?"checked":"",checked:u,label:o.label,disabled:e.disabled,id:`${a}-${i}`,onClick:n[i],value:o.value},`${o.value}-${i}`)})})};export{bi as A,yi as B,_l as C,$i as D,os as E,il as F,Ve as G,rs as H,Vn as I,Sn as J,_o as K,ai as L,Je as M,rr as N,Ui as O,se as _,_r as a,tr as b,ie as c,dr as d,br as e,qc as f,hl as g,fr as h,zf as i,pr as j,ve as k,p as l,gc as m,Ye as n,sr as o,ar as p,Af as q,ir as r,Xe as s,Uf as t,wc as u,gr as v,K as w,Hu as x,Ac as y,jc as z}; diff --git a/sb8/qa/assets/CheckboxList-B7AhpT4C.js b/sb8/qa/assets/CheckboxList-DdaRzsL8.js similarity index 88% rename from sb8/qa/assets/CheckboxList-B7AhpT4C.js rename to sb8/qa/assets/CheckboxList-DdaRzsL8.js index 7e876ee20f..4b70cb04ea 100644 --- a/sb8/qa/assets/CheckboxList-B7AhpT4C.js +++ b/sb8/qa/assets/CheckboxList-DdaRzsL8.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-CH7MCt8u.js";import{s as p,P as m}from"./CheckboxList.stories-orY6lNXP.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.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-D6Gx1A0F.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-VPsM0GyV.js";import{s as p,P as m}from"./CheckboxList.stories-Cn0EIFkg.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.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-D6Gx1A0F.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/CheckboxList.stories-orY6lNXP.js b/sb8/qa/assets/CheckboxList.stories-Cn0EIFkg.js similarity index 94% rename from sb8/qa/assets/CheckboxList.stories-orY6lNXP.js rename to sb8/qa/assets/CheckboxList.stories-Cn0EIFkg.js index 312114d844..107116aa40 100644 --- a/sb8/qa/assets/CheckboxList.stories-orY6lNXP.js +++ b/sb8/qa/assets/CheckboxList.stories-Cn0EIFkg.js @@ -1,4 +1,4 @@ -import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{r as d}from"./index-BP8_t0zE.js";import{C as h}from"./CheckboxList-DtvbyO8j.js";import{c as p}from"./FormFieldCheckboxUtils-C4lbz8gc.js";const m={title:"Components/CheckboxList"},e=()=>{const[t,r]=d.useState([]),i=a=>{r(a)};return o.jsxs("div",{children:[o.jsxs("div",{children:["checked:",JSON.stringify(t)]}),o.jsx(h,{checked:t,options:p,onChange:i})]})};var s,c,n;e.parameters={...e.parameters,docs:{...(s=e.parameters)==null?void 0:s.docs,source:{originalSource:`(): ReactElement => { +import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{r as d}from"./index-BP8_t0zE.js";import{C as h}from"./CheckboxList-BmT12QDz.js";import{c as p}from"./FormFieldCheckboxUtils-C4lbz8gc.js";const m={title:"Components/CheckboxList"},e=()=>{const[t,r]=d.useState([]),i=a=>{r(a)};return o.jsxs("div",{children:[o.jsxs("div",{children:["checked:",JSON.stringify(t)]}),o.jsx(h,{checked:t,options:p,onChange:i})]})};var s,c,n;e.parameters={...e.parameters,docs:{...(s=e.parameters)==null?void 0:s.docs,source:{originalSource:`(): ReactElement => { const [checked, setChecked] = useState([]); const onChange = c => { setChecked(c); diff --git a/sb8/qa/assets/Chip-DGGDyN4K.js b/sb8/qa/assets/Chip-CQdhIKln.js similarity index 93% rename from sb8/qa/assets/Chip-DGGDyN4K.js rename to sb8/qa/assets/Chip-CQdhIKln.js index 4e64c4fd6f..ea016401a9 100644 --- a/sb8/qa/assets/Chip-DGGDyN4K.js +++ b/sb8/qa/assets/Chip-CQdhIKln.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-CH7MCt8u.js";import{s as m,P as s}from"./Chip.stories-CezB0ZKO.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-Btt3uSwF.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-D6Gx1A0F.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-VPsM0GyV.js";import{s as m,P as s}from"./Chip.stories-CezB0ZKO.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-Btt3uSwF.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-D6Gx1A0F.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-BULzkcXH.js b/sb8/qa/assets/Color-PRSJMWNM-CPkUZ8l5.js similarity index 99% rename from sb8/qa/assets/Color-PRSJMWNM-BULzkcXH.js rename to sb8/qa/assets/Color-PRSJMWNM-CPkUZ8l5.js index 1adfb6df78..e10a374e83 100644 --- a/sb8/qa/assets/Color-PRSJMWNM-BULzkcXH.js +++ b/sb8/qa/assets/Color-PRSJMWNM-CPkUZ8l5.js @@ -1 +1 @@ -import{n as $,e as ue,T as Me,F as Ce,f as $e,g as Oe}from"./index-CH7MCt8u.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-bbO8NbQM.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-VPsM0GyV.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-DkhhG_xI.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/ColorSelected-Dn-MWZ_m.js b/sb8/qa/assets/ColorSelected-gVxq6Y0Z.js similarity index 99% rename from sb8/qa/assets/ColorSelected-Dn-MWZ_m.js rename to sb8/qa/assets/ColorSelected-gVxq6Y0Z.js index d958c47c89..2e073f3b54 100644 --- a/sb8/qa/assets/ColorSelected-Dn-MWZ_m.js +++ b/sb8/qa/assets/ColorSelected-gVxq6Y0Z.js @@ -1,4 +1,4 @@ -import{r as c,g as Un,a as G}from"./index-BP8_t0zE.js";import{m as qr,a as Xr,l as Gr,u as Kr,n as Qr,v as Yn,p as Jr,w as Zr,j as ea,x as ta,q as na,y as ra,z as aa,C as ia}from"./CheckboxList-DtvbyO8j.js";import{_ as oa,D as sa,l as la}from"./index-jWylWF_w.js";import{_ as Hn,u as Ne,a as ca}from"./useMosaicTranslation-CZCb37QS.js";import{r as ye,j as d}from"./jsx-runtime-nGUw9YhZ.js";import{s as O,t as R,B as Xt}from"./theme-DRtZtbPc.js";import{t as W}from"./testIds-D6Gx1A0F.js";import{T as ua,d as da}from"./TitleWrapper-D2l-_w9e.js";import{B as rt}from"./ButtonRow-B3IWj8ab.js";import{i as fa}from"./isSymbol-CEVJpixJ.js";import{i as De}from"./generateUtilityClasses-DAcHHM0W.js";import{r as ke}from"./createSvgIcon-CcHL1II5.js";import{D as ha}from"./FormFieldText.styled-hkDOkrrs.js";import{B as Y,S as ma,c as ga,P as va}from"./Button-Do5OxnZO.js";import{d as Bt}from"./DataViewPrimaryFilter.styled-CylNlUs-.js";import{r as Ie}from"./index-BxmsGmlx.js";import{C as kt}from"./Checkbox-BN-KUs9r.js";import{d as ba}from"./MoreVert-BbmWEP2K.js";import{u as yn,g as Dn}from"./useToggle-lipGlewK.js";import{T as kn}from"./Typography-Br_RMLnS.js";import{D as wa,a as xa,d as Ca}from"./ChevronRight-CSz705Z0.js";import{P as ya}from"./PageHeader-yhdXyTld.js";function Vt(e,t,n=!0){const r=e!==void 0?e:n;return(Array.isArray(r)?r:[r]).map(i=>i instanceof Function?i(t):i)}function Ft(e,t,n,r=!0){const a=c.useMemo(()=>{const i=Array.isArray(e),s=(i?e:[e]).map(l=>({...l,[n]:Vt(l[n],t,r)}));return i?s:s[0]},[r,e,n,t]);return Array.isArray(a)?yn(a,n):yn(a,n)}var Da=Xr,ka=qr,pa=oa,Sa=Gr;function Aa(e,t){var n=Sa(e)?Da:pa;return n(e,ka(t))}var Ta=Aa;const uu=Un(Ta);function q(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function Ra(e){return q(1,arguments),e instanceof Date||Hn(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ce(e){q(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Hn(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Ea(e){if(q(1,arguments),!Ra(e)&&typeof e!="number")return!1;var t=ce(e);return!isNaN(Number(t))}function Ae(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Ma(e,t){q(2,arguments);var n=ce(e).getTime(),r=Ae(t);return new Date(n+r)}function Oa(e,t){q(2,arguments);var n=Ae(t);return Ma(e,-n)}var _a=864e5;function Pa(e){q(1,arguments);var t=ce(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),a=n-r;return Math.floor(a/_a)+1}function vt(e){q(1,arguments);var t=1,n=ce(e),r=n.getUTCDay(),a=(r=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Ia(e){q(1,arguments);var t=qn(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=vt(n);return r}var ja=6048e5;function $a(e){q(1,arguments);var t=ce(e),n=vt(t).getTime()-Ia(t).getTime();return Math.round(n/ja)+1}var Na={};function pt(){return Na}function bt(e,t){var n,r,a,i,o,s,l,u;q(1,arguments);var f=pt(),h=Ae((n=(r=(a=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&a!==void 0?a:f.weekStartsOn)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=ce(e),m=g.getUTCDay(),x=(m=1&&m<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(h+1,0,m),x.setUTCHours(0,0,0,0);var b=bt(x,t),w=new Date(0);w.setUTCFullYear(h,0,m),w.setUTCHours(0,0,0,0);var v=bt(w,t);return f.getTime()>=b.getTime()?h+1:f.getTime()>=v.getTime()?h:h-1}function La(e,t){var n,r,a,i,o,s,l,u;q(1,arguments);var f=pt(),h=Ae((n=(r=(a=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&a!==void 0?a:f.firstWeekContainsDate)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),g=Xn(e,t),m=new Date(0);m.setUTCFullYear(g,0,h),m.setUTCHours(0,0,0,0);var x=bt(m,t);return x}var Wa=6048e5;function Ba(e,t){q(1,arguments);var n=ce(e),r=bt(n,t).getTime()-La(n,t).getTime();return Math.round(r/Wa)+1}function I(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length0?r:1-r;return I(n==="yy"?a%100:a,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):I(r+1,2)},d:function(t,n){return I(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return I(t.getUTCHours()%12||12,n.length)},H:function(t,n){return I(t.getUTCHours(),n.length)},m:function(t,n){return I(t.getUTCMinutes(),n.length)},s:function(t,n){return I(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,a=t.getUTCMilliseconds(),i=Math.floor(a*Math.pow(10,r-3));return I(i,n.length)}},Pe={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Va={G:function(t,n,r){var a=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var a=t.getUTCFullYear(),i=a>0?a:1-a;return r.ordinalNumber(i,{unit:"year"})}return xe.y(t,n)},Y:function(t,n,r,a){var i=Xn(t,a),o=i>0?i:1-i;if(n==="YY"){var s=o%100;return I(s,2)}return n==="Yo"?r.ordinalNumber(o,{unit:"year"}):I(o,n.length)},R:function(t,n){var r=qn(t);return I(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return I(r,n.length)},Q:function(t,n,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(a);case"QQ":return I(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,n,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(a);case"qq":return I(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,n,r){var a=t.getUTCMonth();switch(n){case"M":case"MM":return xe.M(t,n);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(t,n,r){var a=t.getUTCMonth();switch(n){case"L":return String(a+1);case"LL":return I(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(t,n,r,a){var i=Ba(t,a);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):I(i,n.length)},I:function(t,n,r){var a=$a(t);return n==="Io"?r.ordinalNumber(a,{unit:"week"}):I(a,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):xe.d(t,n)},D:function(t,n,r){var a=Pa(t);return n==="Do"?r.ordinalNumber(a,{unit:"dayOfYear"}):I(a,n.length)},E:function(t,n,r){var a=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});case"EEEE":default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(t,n,r,a){var i=t.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return I(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,a){var i=t.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return I(o,n.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var a=t.getUTCDay(),i=a===0?7:a;switch(n){case"i":return String(i);case"ii":return I(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});case"iiii":default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(t,n,r){var a=t.getUTCHours(),i=a/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var a=t.getUTCHours(),i;switch(a===12?i=Pe.noon:a===0?i=Pe.midnight:i=a/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var a=t.getUTCHours(),i;switch(a>=17?i=Pe.evening:a>=12?i=Pe.afternoon:a>=4?i=Pe.morning:i=Pe.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var a=t.getUTCHours()%12;return a===0&&(a=12),r.ordinalNumber(a,{unit:"hour"})}return xe.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):xe.H(t,n)},K:function(t,n,r){var a=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(a,{unit:"hour"}):I(a,n.length)},k:function(t,n,r){var a=t.getUTCHours();return a===0&&(a=24),n==="ko"?r.ordinalNumber(a,{unit:"hour"}):I(a,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):xe.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):xe.s(t,n)},S:function(t,n){return xe.S(t,n)},X:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Sn(o);case"XXXX":case"XX":return Se(o);case"XXXXX":case"XXX":default:return Se(o,":")}},x:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"x":return Sn(o);case"xxxx":case"xx":return Se(o);case"xxxxx":case"xxx":default:return Se(o,":")}},O:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+pn(o,":");case"OOOO":default:return"GMT"+Se(o,":")}},z:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+pn(o,":");case"zzzz":default:return"GMT"+Se(o,":")}},t:function(t,n,r,a){var i=a._originalDate||t,o=Math.floor(i.getTime()/1e3);return I(o,n.length)},T:function(t,n,r,a){var i=a._originalDate||t,o=i.getTime();return I(o,n.length)}};function pn(e,t){var n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;if(i===0)return n+String(a);var o=t;return n+String(a)+o+I(i,2)}function Sn(e,t){if(e%60===0){var n=e>0?"-":"+";return n+I(Math.abs(e)/60,2)}return Se(e,t)}function Se(e,t){var n=t||"",r=e>0?"-":"+",a=Math.abs(e),i=I(Math.floor(a/60),2),o=I(a%60,2);return r+i+n+o}var An=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},Gn=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Fa=function(t,n){var r=t.match(/(P+)(p+)?/)||[],a=r[1],i=r[2];if(!i)return An(t,n);var o;switch(a){case"P":o=n.dateTime({width:"short"});break;case"PP":o=n.dateTime({width:"medium"});break;case"PPP":o=n.dateTime({width:"long"});break;case"PPPP":default:o=n.dateTime({width:"full"});break}return o.replace("{{date}}",An(a,n)).replace("{{time}}",Gn(i,n))},za={p:Gn,P:Fa};function Ua(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var Ya=["D","DD"],Ha=["YY","YYYY"];function qa(e){return Ya.indexOf(e)!==-1}function Xa(e){return Ha.indexOf(e)!==-1}function Tn(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Ga={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ka=function(t,n,r){var a,i=Ga[t];return typeof i=="string"?a=i:n===1?a=i.one:a=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+a:a+" ago":a};function It(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var Qa={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ja={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Za={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ei={date:It({formats:Qa,defaultWidth:"full"}),time:It({formats:Ja,defaultWidth:"full"}),dateTime:It({formats:Za,defaultWidth:"full"})},ti={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ni=function(t,n,r,a){return ti[t]};function Xe(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",a;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;a=e.formattingValues[o]||e.formattingValues[i]}else{var s=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[s]}var u=e.argumentCallback?e.argumentCallback(t):t;return a[u]}}var ri={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ai={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ii={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},oi={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},si={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},li={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ci=function(t,n){var r=Number(t),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},ui={ordinalNumber:ci,era:Xe({values:ri,defaultWidth:"wide"}),quarter:Xe({values:ai,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Xe({values:ii,defaultWidth:"wide"}),day:Xe({values:oi,defaultWidth:"wide"}),dayPeriod:Xe({values:si,defaultWidth:"wide",formattingValues:li,defaultFormattingWidth:"wide"})};function Ge(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var o=i[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?fi(s,function(h){return h.test(o)}):di(s,function(h){return h.test(o)}),u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;var f=t.slice(o.length);return{value:u,rest:f}}}function di(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function fi(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var a=r[0],i=t.match(e.parsePattern);if(!i)return null;var o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var s=t.slice(a.length);return{value:o,rest:s}}}var mi=/^(\d+)(th|st|nd|rd)?/i,gi=/\d+/i,vi={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},bi={any:[/^b/i,/^(a|c)/i]},wi={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xi={any:[/1/i,/2/i,/3/i,/4/i]},Ci={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},yi={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Di={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ki={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},pi={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Si={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ai={ordinalNumber:hi({matchPattern:mi,parsePattern:gi,valueCallback:function(t){return parseInt(t,10)}}),era:Ge({matchPatterns:vi,defaultMatchWidth:"wide",parsePatterns:bi,defaultParseWidth:"any"}),quarter:Ge({matchPatterns:wi,defaultMatchWidth:"wide",parsePatterns:xi,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Ge({matchPatterns:Ci,defaultMatchWidth:"wide",parsePatterns:yi,defaultParseWidth:"any"}),day:Ge({matchPatterns:Di,defaultMatchWidth:"wide",parsePatterns:ki,defaultParseWidth:"any"}),dayPeriod:Ge({matchPatterns:pi,defaultMatchWidth:"any",parsePatterns:Si,defaultParseWidth:"any"})},Ti={code:"en-US",formatDistance:Ka,formatLong:ei,formatRelative:ni,localize:ui,match:Ai,options:{weekStartsOn:0,firstWeekContainsDate:1}},Ri=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ei=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mi=/^'([^]*?)'?$/,Oi=/''/g,_i=/[a-zA-Z]/;function du(e,t,n){var r,a,i,o,s,l,u,f,h,g,m,x,b,w,v,C,y,D;q(2,arguments);var A=String(t),p=pt(),S=(r=(a=n==null?void 0:n.locale)!==null&&a!==void 0?a:p.locale)!==null&&r!==void 0?r:Ti,T=Ae((i=(o=(s=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(u=n.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&s!==void 0?s:p.firstWeekContainsDate)!==null&&o!==void 0?o:(h=p.locale)===null||h===void 0||(g=h.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var $=Ae((m=(x=(b=(w=n==null?void 0:n.weekStartsOn)!==null&&w!==void 0?w:n==null||(v=n.locale)===null||v===void 0||(C=v.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&b!==void 0?b:p.weekStartsOn)!==null&&x!==void 0?x:(y=p.locale)===null||y===void 0||(D=y.options)===null||D===void 0?void 0:D.weekStartsOn)!==null&&m!==void 0?m:0);if(!($>=0&&$<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var L=ce(e);if(!Ea(L))throw new RangeError("Invalid time value");var P=Ua(L),k=Oa(L,P),_={firstWeekContainsDate:T,weekStartsOn:$,locale:S,_originalDate:L},E=A.match(Ei).map(function(N){var H=N[0];if(H==="p"||H==="P"){var B=za[H];return B(N,S.formatLong)}return N}).join("").match(Ri).map(function(N){if(N==="''")return"'";var H=N[0];if(H==="'")return Pi(N);var B=Va[H];if(B)return!(n!=null&&n.useAdditionalWeekYearTokens)&&Xa(N)&&Tn(N,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&qa(N)&&Tn(N,t,String(e)),B(k,N,S.localize,_);if(H.match(_i))throw new RangeError("Format string contains an unescaped latin alphabet character `"+H+"`");return N}).join("");return E}function Pi(e){var t=e.match(Mi);return t?t[1].replace(Oi,"'"):e}var Rn=Kr;function Ii(e,t,n){t=="__proto__"&&Rn?Rn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var ji=Ii,$i=ji,Ni=Qr,Li=Object.prototype,Wi=Li.hasOwnProperty;function Bi(e,t,n){var r=e[t];(!(Wi.call(e,t)&&Ni(r,n))||n===void 0&&!(t in e))&&$i(e,t,n)}var Vi=Bi,Fi=Vi,zi=Yn,Ui=Jr,En=fa,Yi=Zr;function Hi(e,t,n,r){if(!En(e))return e;t=zi(t,e);for(var a=-1,i=t.length,o=i-1,s=e;s!=null&&++ai instanceof Function?i(t):i)}function Ft(e,t,n,r=!0){const a=c.useMemo(()=>{const i=Array.isArray(e),s=(i?e:[e]).map(l=>({...l,[n]:Vt(l[n],t,r)}));return i?s:s[0]},[r,e,n,t]);return Array.isArray(a)?yn(a,n):yn(a,n)}var Da=Xr,ka=qr,pa=oa,Sa=Gr;function Aa(e,t){var n=Sa(e)?Da:pa;return n(e,ka(t))}var Ta=Aa;const uu=Un(Ta);function q(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function Ra(e){return q(1,arguments),e instanceof Date||Hn(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ce(e){q(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Hn(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Ea(e){if(q(1,arguments),!Ra(e)&&typeof e!="number")return!1;var t=ce(e);return!isNaN(Number(t))}function Ae(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Ma(e,t){q(2,arguments);var n=ce(e).getTime(),r=Ae(t);return new Date(n+r)}function Oa(e,t){q(2,arguments);var n=Ae(t);return Ma(e,-n)}var _a=864e5;function Pa(e){q(1,arguments);var t=ce(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),a=n-r;return Math.floor(a/_a)+1}function vt(e){q(1,arguments);var t=1,n=ce(e),r=n.getUTCDay(),a=(r=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Ia(e){q(1,arguments);var t=qn(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=vt(n);return r}var ja=6048e5;function $a(e){q(1,arguments);var t=ce(e),n=vt(t).getTime()-Ia(t).getTime();return Math.round(n/ja)+1}var Na={};function pt(){return Na}function bt(e,t){var n,r,a,i,o,s,l,u;q(1,arguments);var f=pt(),h=Ae((n=(r=(a=(i=t==null?void 0:t.weekStartsOn)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&a!==void 0?a:f.weekStartsOn)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=ce(e),m=g.getUTCDay(),x=(m=1&&m<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(h+1,0,m),x.setUTCHours(0,0,0,0);var b=bt(x,t),w=new Date(0);w.setUTCFullYear(h,0,m),w.setUTCHours(0,0,0,0);var v=bt(w,t);return f.getTime()>=b.getTime()?h+1:f.getTime()>=v.getTime()?h:h-1}function La(e,t){var n,r,a,i,o,s,l,u;q(1,arguments);var f=pt(),h=Ae((n=(r=(a=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(o=t.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&a!==void 0?a:f.firstWeekContainsDate)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),g=Xn(e,t),m=new Date(0);m.setUTCFullYear(g,0,h),m.setUTCHours(0,0,0,0);var x=bt(m,t);return x}var Wa=6048e5;function Ba(e,t){q(1,arguments);var n=ce(e),r=bt(n,t).getTime()-La(n,t).getTime();return Math.round(r/Wa)+1}function I(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length0?r:1-r;return I(n==="yy"?a%100:a,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):I(r+1,2)},d:function(t,n){return I(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return I(t.getUTCHours()%12||12,n.length)},H:function(t,n){return I(t.getUTCHours(),n.length)},m:function(t,n){return I(t.getUTCMinutes(),n.length)},s:function(t,n){return I(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,a=t.getUTCMilliseconds(),i=Math.floor(a*Math.pow(10,r-3));return I(i,n.length)}},Pe={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Va={G:function(t,n,r){var a=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});case"GGGG":default:return r.era(a,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var a=t.getUTCFullYear(),i=a>0?a:1-a;return r.ordinalNumber(i,{unit:"year"})}return xe.y(t,n)},Y:function(t,n,r,a){var i=Xn(t,a),o=i>0?i:1-i;if(n==="YY"){var s=o%100;return I(s,2)}return n==="Yo"?r.ordinalNumber(o,{unit:"year"}):I(o,n.length)},R:function(t,n){var r=qn(t);return I(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return I(r,n.length)},Q:function(t,n,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(a);case"QQ":return I(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,n,r){var a=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(a);case"qq":return I(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,n,r){var a=t.getUTCMonth();switch(n){case"M":case"MM":return xe.M(t,n);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(t,n,r){var a=t.getUTCMonth();switch(n){case"L":return String(a+1);case"LL":return I(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(t,n,r,a){var i=Ba(t,a);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):I(i,n.length)},I:function(t,n,r){var a=$a(t);return n==="Io"?r.ordinalNumber(a,{unit:"week"}):I(a,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):xe.d(t,n)},D:function(t,n,r){var a=Pa(t);return n==="Do"?r.ordinalNumber(a,{unit:"dayOfYear"}):I(a,n.length)},E:function(t,n,r){var a=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});case"EEEE":default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(t,n,r,a){var i=t.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return I(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,a){var i=t.getUTCDay(),o=(i-a.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return I(o,n.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var a=t.getUTCDay(),i=a===0?7:a;switch(n){case"i":return String(i);case"ii":return I(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});case"iiii":default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(t,n,r){var a=t.getUTCHours(),i=a/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var a=t.getUTCHours(),i;switch(a===12?i=Pe.noon:a===0?i=Pe.midnight:i=a/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var a=t.getUTCHours(),i;switch(a>=17?i=Pe.evening:a>=12?i=Pe.afternoon:a>=4?i=Pe.morning:i=Pe.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var a=t.getUTCHours()%12;return a===0&&(a=12),r.ordinalNumber(a,{unit:"hour"})}return xe.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):xe.H(t,n)},K:function(t,n,r){var a=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(a,{unit:"hour"}):I(a,n.length)},k:function(t,n,r){var a=t.getUTCHours();return a===0&&(a=24),n==="ko"?r.ordinalNumber(a,{unit:"hour"}):I(a,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):xe.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):xe.s(t,n)},S:function(t,n){return xe.S(t,n)},X:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();if(o===0)return"Z";switch(n){case"X":return Sn(o);case"XXXX":case"XX":return Se(o);case"XXXXX":case"XXX":default:return Se(o,":")}},x:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"x":return Sn(o);case"xxxx":case"xx":return Se(o);case"xxxxx":case"xxx":default:return Se(o,":")}},O:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+pn(o,":");case"OOOO":default:return"GMT"+Se(o,":")}},z:function(t,n,r,a){var i=a._originalDate||t,o=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+pn(o,":");case"zzzz":default:return"GMT"+Se(o,":")}},t:function(t,n,r,a){var i=a._originalDate||t,o=Math.floor(i.getTime()/1e3);return I(o,n.length)},T:function(t,n,r,a){var i=a._originalDate||t,o=i.getTime();return I(o,n.length)}};function pn(e,t){var n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;if(i===0)return n+String(a);var o=t;return n+String(a)+o+I(i,2)}function Sn(e,t){if(e%60===0){var n=e>0?"-":"+";return n+I(Math.abs(e)/60,2)}return Se(e,t)}function Se(e,t){var n=t||"",r=e>0?"-":"+",a=Math.abs(e),i=I(Math.floor(a/60),2),o=I(a%60,2);return r+i+n+o}var An=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},Gn=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Fa=function(t,n){var r=t.match(/(P+)(p+)?/)||[],a=r[1],i=r[2];if(!i)return An(t,n);var o;switch(a){case"P":o=n.dateTime({width:"short"});break;case"PP":o=n.dateTime({width:"medium"});break;case"PPP":o=n.dateTime({width:"long"});break;case"PPPP":default:o=n.dateTime({width:"full"});break}return o.replace("{{date}}",An(a,n)).replace("{{time}}",Gn(i,n))},za={p:Gn,P:Fa};function Ua(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var Ya=["D","DD"],Ha=["YY","YYYY"];function qa(e){return Ya.indexOf(e)!==-1}function Xa(e){return Ha.indexOf(e)!==-1}function Tn(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Ga={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ka=function(t,n,r){var a,i=Ga[t];return typeof i=="string"?a=i:n===1?a=i.one:a=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+a:a+" ago":a};function It(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var Qa={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ja={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Za={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ei={date:It({formats:Qa,defaultWidth:"full"}),time:It({formats:Ja,defaultWidth:"full"}),dateTime:It({formats:Za,defaultWidth:"full"})},ti={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ni=function(t,n,r,a){return ti[t]};function Xe(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",a;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;a=e.formattingValues[o]||e.formattingValues[i]}else{var s=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[s]}var u=e.argumentCallback?e.argumentCallback(t):t;return a[u]}}var ri={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ai={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ii={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},oi={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},si={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},li={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ci=function(t,n){var r=Number(t),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},ui={ordinalNumber:ci,era:Xe({values:ri,defaultWidth:"wide"}),quarter:Xe({values:ai,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Xe({values:ii,defaultWidth:"wide"}),day:Xe({values:oi,defaultWidth:"wide"}),dayPeriod:Xe({values:si,defaultWidth:"wide",formattingValues:li,defaultFormattingWidth:"wide"})};function Ge(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var o=i[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?fi(s,function(h){return h.test(o)}):di(s,function(h){return h.test(o)}),u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;var f=t.slice(o.length);return{value:u,rest:f}}}function di(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function fi(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var a=r[0],i=t.match(e.parsePattern);if(!i)return null;var o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;var s=t.slice(a.length);return{value:o,rest:s}}}var mi=/^(\d+)(th|st|nd|rd)?/i,gi=/\d+/i,vi={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},bi={any:[/^b/i,/^(a|c)/i]},wi={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xi={any:[/1/i,/2/i,/3/i,/4/i]},Ci={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},yi={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Di={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ki={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},pi={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Si={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ai={ordinalNumber:hi({matchPattern:mi,parsePattern:gi,valueCallback:function(t){return parseInt(t,10)}}),era:Ge({matchPatterns:vi,defaultMatchWidth:"wide",parsePatterns:bi,defaultParseWidth:"any"}),quarter:Ge({matchPatterns:wi,defaultMatchWidth:"wide",parsePatterns:xi,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Ge({matchPatterns:Ci,defaultMatchWidth:"wide",parsePatterns:yi,defaultParseWidth:"any"}),day:Ge({matchPatterns:Di,defaultMatchWidth:"wide",parsePatterns:ki,defaultParseWidth:"any"}),dayPeriod:Ge({matchPatterns:pi,defaultMatchWidth:"any",parsePatterns:Si,defaultParseWidth:"any"})},Ti={code:"en-US",formatDistance:Ka,formatLong:ei,formatRelative:ni,localize:ui,match:Ai,options:{weekStartsOn:0,firstWeekContainsDate:1}},Ri=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ei=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mi=/^'([^]*?)'?$/,Oi=/''/g,_i=/[a-zA-Z]/;function du(e,t,n){var r,a,i,o,s,l,u,f,h,g,m,x,b,w,v,C,y,D;q(2,arguments);var A=String(t),p=pt(),S=(r=(a=n==null?void 0:n.locale)!==null&&a!==void 0?a:p.locale)!==null&&r!==void 0?r:Ti,T=Ae((i=(o=(s=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(u=n.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&s!==void 0?s:p.firstWeekContainsDate)!==null&&o!==void 0?o:(h=p.locale)===null||h===void 0||(g=h.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var $=Ae((m=(x=(b=(w=n==null?void 0:n.weekStartsOn)!==null&&w!==void 0?w:n==null||(v=n.locale)===null||v===void 0||(C=v.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&b!==void 0?b:p.weekStartsOn)!==null&&x!==void 0?x:(y=p.locale)===null||y===void 0||(D=y.options)===null||D===void 0?void 0:D.weekStartsOn)!==null&&m!==void 0?m:0);if(!($>=0&&$<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var L=ce(e);if(!Ea(L))throw new RangeError("Invalid time value");var P=Ua(L),k=Oa(L,P),_={firstWeekContainsDate:T,weekStartsOn:$,locale:S,_originalDate:L},E=A.match(Ei).map(function(N){var H=N[0];if(H==="p"||H==="P"){var B=za[H];return B(N,S.formatLong)}return N}).join("").match(Ri).map(function(N){if(N==="''")return"'";var H=N[0];if(H==="'")return Pi(N);var B=Va[H];if(B)return!(n!=null&&n.useAdditionalWeekYearTokens)&&Xa(N)&&Tn(N,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&qa(N)&&Tn(N,t,String(e)),B(k,N,S.localize,_);if(H.match(_i))throw new RangeError("Format string contains an unescaped latin alphabet character `"+H+"`");return N}).join("");return E}function Pi(e){var t=e.match(Mi);return t?t[1].replace(Oi,"'"):e}var Rn=Kr;function Ii(e,t,n){t=="__proto__"&&Rn?Rn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var ji=Ii,$i=ji,Ni=Qr,Li=Object.prototype,Wi=Li.hasOwnProperty;function Bi(e,t,n){var r=e[t];(!(Wi.call(e,t)&&Ni(r,n))||n===void 0&&!(t in e))&&$i(e,t,n)}var Vi=Bi,Fi=Vi,zi=Yn,Ui=Jr,En=fa,Yi=Zr;function Hi(e,t,n,r){if(!En(e))return e;t=zi(t,e);for(var a=-1,i=t.length,o=i-1,s=e;s!=null&&++ae?"none":"auto"}; width: 80px; `,hu=O(va)` -`,mu=e=>{const{disabled:t,color:n,onClick:r,displayColorPicker:a,id:i}=e;return d.jsx(Bc,{$disabled:t,$displayColorPicker:a,onClick:r,type:"button",id:i,children:d.jsx(Vc,{"data-testid":"colordiv-test",$disabled:t,$color:n})})};export{zl as A,Ft as B,mu as C,tc as D,hu as P,Vi as _,fu as a,Ta as b,ji as c,vt as d,Ba as e,du as f,Xn as g,Ae as h,$a as i,pt as j,Xa as k,za as l,uu as m,Tn as n,qa as o,Oa as p,Ua as q,q as r,bt as s,ce as t,Ti as u,Ea as v,Ma as w,I as x,Jn as y,Vt as z}; +`,mu=e=>{const{disabled:t,color:n,onClick:r,displayColorPicker:a,id:i}=e;return d.jsx(Bc,{$disabled:t,$displayColorPicker:a,onClick:r,type:"button",id:i,children:d.jsx(Vc,{"data-testid":"colordiv-test",$disabled:t,$color:n})})};export{zl as A,Ft as B,mu as C,tc as D,hu as P,Vi as _,fu as a,vt as b,Ba as c,Ae as d,$a as e,du as f,Xn as g,pt as h,Xa as i,Tn as j,qa as k,za as l,uu as m,Oa as n,Ua as o,Ti as p,Ea as q,q as r,bt as s,ce as t,Ta as u,ji as v,Ma as w,I as x,Vt as y,Jn as z}; diff --git a/sb8/qa/assets/ConditionalFields.stories-BbECUOYQ.js b/sb8/qa/assets/ConditionalFields.stories-BbECUOYQ.js deleted file mode 100644 index f6c72b56e1..0000000000 --- a/sb8/qa/assets/ConditionalFields.stories-BbECUOYQ.js +++ /dev/null @@ -1,41 +0,0 @@ -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"./formUtils-C-50Qw-d.js";import"./Button-Do5OxnZO.js";import{r as h}from"./renderButtons-BmHfsf_z.js";import{O as f}from"./utils-BR2PSRFh.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./theme-DRtZtbPc.js";import"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./useIsFocusVisible-De2ftVE9.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./index-BxmsGmlx.js";import"./index-jWylWF_w.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./ButtonBase-BZmvw3BH.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.js";import"./useToggle-lipGlewK.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-CvnKr_oj.js";import"./ColorSelected-Dn-MWZ_m.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-yhdXyTld.js";import"./formats-CDjt32hU.js";import"./Dialog-BlwzXIwM.js";import"./useMediaQuery-CguehUMS.js";import"./SideNav-biYpQHtM.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.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(); - const { - state, - handleSubmit - } = controller; - const KEY_PHRASE = "SHOW"; - useEffect(() => { - document.body.style.margin = "0px"; - return () => { - document.body.style.margin = ORIGINAL_BODY_MARGIN; - }; - }, []); - const fields = useMemo((): FieldDef[] => [{ - name: "dependency", - label: "Dependency", - type: "text", - instructionText: \`Type "\${KEY_PHRASE}" to show another field\`, - required: true - }, { - name: "dependent", - label: "Dependent", - type: "text", - show: ({ - data - }) => { - return data?.dependency === KEY_PHRASE; - }, - required: true - }], []); - return <> - {showState &&
{JSON.stringify(state, null, "  ")}
} -
- -
- ; -}`,...(s=(p=t.parameters)==null?void 0:p.docs)==null?void 0:s.source}}};const Et=["ConditionalFields"];export{t as ConditionalFields,Et as __namedExportsOrder,bt as default}; diff --git a/sb8/qa/assets/ConditionalFields.stories-BlQ90sqS.js b/sb8/qa/assets/ConditionalFields.stories-BlQ90sqS.js new file mode 100644 index 0000000000..bd37f9267f --- /dev/null +++ b/sb8/qa/assets/ConditionalFields.stories-BlQ90sqS.js @@ -0,0 +1,41 @@ +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-Cf-5vk95.js";import{r as h}from"./renderButtons-BmHfsf_z.js";import{O as f}from"./utils-BR2PSRFh.js";import"./theme-DRtZtbPc.js";import"./SideNav-biYpQHtM.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./FormFieldText.styled-hkDOkrrs.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"./index-BxmsGmlx.js";import"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./index-DnvaddO_.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-gVxq6Y0Z.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-yhdXyTld.js";import"./formats-CDjt32hU.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(); + const { + state, + handleSubmit + } = controller; + const KEY_PHRASE = "SHOW"; + useEffect(() => { + document.body.style.margin = "0px"; + return () => { + document.body.style.margin = ORIGINAL_BODY_MARGIN; + }; + }, []); + const fields = useMemo((): FieldDef[] => [{ + name: "dependency", + label: "Dependency", + type: "text", + instructionText: \`Type "\${KEY_PHRASE}" to show another field\`, + required: true + }, { + name: "dependent", + label: "Dependent", + type: "text", + show: ({ + data + }) => { + return data?.dependency === KEY_PHRASE; + }, + required: true + }], []); + return <> + {showState &&
{JSON.stringify(state, null, "  ")}
} +
+ +
+ ; +}`,...(s=(p=t.parameters)==null?void 0:p.docs)==null?void 0:s.source}}};const Et=["ConditionalFields"];export{t as ConditionalFields,Et as __namedExportsOrder,bt as default}; diff --git a/sb8/qa/assets/ConditionalSections.stories-0QVvgZ1q.js b/sb8/qa/assets/ConditionalSections.stories-0QVvgZ1q.js new file mode 100644 index 0000000000..f182153eca --- /dev/null +++ b/sb8/qa/assets/ConditionalSections.stories-0QVvgZ1q.js @@ -0,0 +1,63 @@ +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-Cf-5vk95.js";import{r as f}from"./renderButtons-BmHfsf_z.js";import{O as S}from"./utils-BR2PSRFh.js";import"./theme-DRtZtbPc.js";import"./SideNav-biYpQHtM.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./FormFieldText.styled-hkDOkrrs.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"./index-BxmsGmlx.js";import"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./index-DnvaddO_.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-gVxq6Y0Z.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-yhdXyTld.js";import"./formats-CDjt32hU.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(); + const { + state, + handleSubmit + } = controller; + const KEY_PHRASE = "SHOW"; + useEffect(() => { + document.body.style.margin = "0px"; + return () => { + document.body.style.margin = ORIGINAL_BODY_MARGIN; + }; + }, []); + const sections = useMemo(() => { + return [{ + title: "Section 1", + description: "Description for section 1", + fields: [ + // row 1 + [["dependency"]], + // row 2 + [["section_show"]]] + }, { + title: "Section 2", + description: "Description for section 2", + fields: [[["dependent"]]], + show: ({ + data + }) => data?.dependency === KEY_PHRASE && data?.section_show + }]; + }, []); + const fields = useMemo((): FieldDef[] => [{ + name: "dependency", + label: "Dependency", + type: "text", + instructionText: \`Type "\${KEY_PHRASE}" to show another field\`, + required: true + }, { + name: "section_show", + label: "Show another section", + type: "toggle", + show: ({ + data + }) => { + return data?.dependency === KEY_PHRASE; + } + }, { + name: "dependent", + label: "Dependent", + type: "text", + required: true + }], []); + return <> + {showState &&
{JSON.stringify(state, null, "  ")}
} +
+ +
+ ; +}`,...(m=(p=t.parameters)==null?void 0:p.docs)==null?void 0:m.source}}};const ge=["ConditionalSections"];export{t as ConditionalSections,ge as __namedExportsOrder,be as default}; diff --git a/sb8/qa/assets/ConditionalSections.stories-CiMjD4SD.js b/sb8/qa/assets/ConditionalSections.stories-CiMjD4SD.js deleted file mode 100644 index 73c8f256a7..0000000000 --- a/sb8/qa/assets/ConditionalSections.stories-CiMjD4SD.js +++ /dev/null @@ -1,63 +0,0 @@ -import{j as n}from"./jsx-runtime-nGUw9YhZ.js";import{r}from"./index-BP8_t0zE.js";import{u as h,F as y}from"./formUtils-C-50Qw-d.js";import"./Button-Do5OxnZO.js";import{r as f}from"./renderButtons-BmHfsf_z.js";import{O as S}from"./utils-BR2PSRFh.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./theme-DRtZtbPc.js";import"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./useIsFocusVisible-De2ftVE9.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./index-BxmsGmlx.js";import"./index-jWylWF_w.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./ButtonBase-BZmvw3BH.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.js";import"./useToggle-lipGlewK.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-CvnKr_oj.js";import"./ColorSelected-Dn-MWZ_m.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-yhdXyTld.js";import"./formats-CDjt32hU.js";import"./Dialog-BlwzXIwM.js";import"./useMediaQuery-CguehUMS.js";import"./SideNav-biYpQHtM.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.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(); - const { - state, - handleSubmit - } = controller; - const KEY_PHRASE = "SHOW"; - useEffect(() => { - document.body.style.margin = "0px"; - return () => { - document.body.style.margin = ORIGINAL_BODY_MARGIN; - }; - }, []); - const sections = useMemo(() => { - return [{ - title: "Section 1", - description: "Description for section 1", - fields: [ - // row 1 - [["dependency"]], - // row 2 - [["section_show"]]] - }, { - title: "Section 2", - description: "Description for section 2", - fields: [[["dependent"]]], - show: ({ - data - }) => data?.dependency === KEY_PHRASE && data?.section_show - }]; - }, []); - const fields = useMemo((): FieldDef[] => [{ - name: "dependency", - label: "Dependency", - type: "text", - instructionText: \`Type "\${KEY_PHRASE}" to show another field\`, - required: true - }, { - name: "section_show", - label: "Show another section", - type: "toggle", - show: ({ - data - }) => { - return data?.dependency === KEY_PHRASE; - } - }, { - name: "dependent", - label: "Dependent", - type: "text", - required: true - }], []); - return <> - {showState &&
{JSON.stringify(state, null, "  ")}
} -
- -
- ; -}`,...(m=(p=t.parameters)==null?void 0:p.docs)==null?void 0:m.source}}};const ge=["ConditionalSections"];export{t as ConditionalSections,ge as __namedExportsOrder,be as default}; diff --git a/sb8/qa/assets/Content-BidqB0zR.js b/sb8/qa/assets/Content-DHgsiLpS.js similarity index 95% rename from sb8/qa/assets/Content-BidqB0zR.js rename to sb8/qa/assets/Content-DHgsiLpS.js index 8caea0ca9c..49ba7b68f0 100644 --- a/sb8/qa/assets/Content-BidqB0zR.js +++ b/sb8/qa/assets/Content-DHgsiLpS.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-CH7MCt8u.js";import{s as l,P as a}from"./Content.stories-B2p1B4P8.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-DFdcEqBi.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.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-D6Gx1A0F.js";import"./ColorSelected-Dn-MWZ_m.js";import"./index-jWylWF_w.js";import"./debounce-C_xMouBr.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-Btt3uSwF.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-B3IWj8ab.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-yhdXyTld.js";import"./Image-DW9YTXUC.js";import"./formats-CDjt32hU.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-VPsM0GyV.js";import{s as l,P as a}from"./Content.stories-BcBKvs4F.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-CU_Ei3Uz.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.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-D6Gx1A0F.js";import"./ColorSelected-gVxq6Y0Z.js";import"./index-DnvaddO_.js";import"./debounce-C_xMouBr.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-Btt3uSwF.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-B3IWj8ab.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-yhdXyTld.js";import"./Image-DW9YTXUC.js";import"./formats-CDjt32hU.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/Content.stories-B2p1B4P8.js b/sb8/qa/assets/Content.stories-BcBKvs4F.js similarity index 99% rename from sb8/qa/assets/Content.stories-B2p1B4P8.js rename to sb8/qa/assets/Content.stories-BcBKvs4F.js index 7d57e7334c..db9dc226e9 100644 --- a/sb8/qa/assets/Content.stories-B2p1B4P8.js +++ b/sb8/qa/assets/Content.stories-BcBKvs4F.js @@ -1,4 +1,4 @@ -import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as p}from"./index-BP8_t0zE.js";import{F as B,d as Z,e as nn,f as en,M as tn,T as on,g as an,C as sn,h as rn,t as I,i as O,b as $,a as U,c as z,j as D}from"./column_transforms-DFdcEqBi.js";import{B as ln}from"./ButtonRow-B3IWj8ab.js";import{T as cn,B as mn}from"./TooltipIcon-CO3K7ssQ.js";import{t as v}from"./testIds-D6Gx1A0F.js";import{u as un,T as dn}from"./Button-Do5OxnZO.js";import"./Typography-Br_RMLnS.js";import{S as fn}from"./SubtitleText-Vdwjg1jD.js";import{g as hn}from"./useToggle-lipGlewK.js";import{C as pn}from"./Chip-Btt3uSwF.js";import{d as K}from"./Edit-hiJ2yy-Y.js";import{a as bn,g as gn,l as M,m as Cn,s as yn,c as H,u as vn,_ as wn,n as _n,b as kn,d as xn}from"./styled-hJgfyZIG.js";import{_ as w}from"./extends-CF3RwP-h.js";import{T as Tn}from"./Typography-aSbaE-Qi.js";import{u as Ln}from"./createSvgIcon-DE5yaevU.js";function Fn({tooltip:n}){const{anchorProps:t,tooltipProps:o}=un();return e.jsxs(e.Fragment,{children:[e.jsx(cn,{...t,"data-testid":v.CONTENT_TOOLTIP_ICON}),e.jsx(dn,{...o,children:n})]})}const jn=({label:n,transforms:t,value:o,tooltip:a})=>{const r=p.useMemo(()=>o===void 0||o===""||Array.isArray(o)&&!o.length?e.jsx(mn,{}):t?t.reduce((l,m)=>m({data:l}),o):o,[t,o]);return e.jsxs(B,{"data-testid":v.CONTENT_FIELD,$margin:!0,children:[e.jsxs(Z,{children:[n,a&&e.jsx(Fn,{tooltip:a})]}),e.jsx(nn,{children:e.jsx(en,{children:r})})]})},_=n=>{const{fields:t,data:o,sections:a,title:r,buttons:l=[],variant:m}=n,u=m==="card",h=p.useMemo(()=>(a||t.map(({name:i,column:s})=>[[s||i]])).map((i,s)=>i.map((c,x)=>c.map(b=>{const g=t.find(({name:T,column:L})=>(L||T)===b);if(!g)throw new Error(`No field declared for field name '${b}'. (section ${s}, row ${x})`);if(hn(g.show,!0))return g}).filter(Boolean))).filter(i=>i.flat().length),[t,a]);return o?e.jsxs(tn,{className:u?"card-wrapper":"content-wrapper","data-testid":v.CONTENT,children:[e.jsxs(on,{className:u?"title-bar":"",children:[e.jsx(fn,{maxLines:1,children:r}),l.length>0&&e.jsx(ln,{buttons:l,separator:!u})]}),e.jsx(an,{className:u?"card-content":"",children:h.map((d,i)=>e.jsx(sn,{className:u?"card-row":"",$columns:d.length,"data-testid":v.CONTENT_ROW,children:d.map(([s],c)=>s?p.createElement(jn,{...s,key:s.name,value:o[s.column||s.name]}):e.jsx(B,{"data-testid":v.CONTENT_FIELD},c))},`${i}-row`))})]}):null};function Sn(n){return gn("MuiLink",n)}const Dn=bn("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),q={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Mn=n=>q[n]||n,Pn=({theme:n,ownerState:t})=>{const o=Mn(t.color),a=M(n,`palette.${o}`,!1)||t.color,r=M(n,`palette.${o}Channel`);return"vars"in n&&r?`rgba(${r} / 0.4)`:Cn(a,.4)},Vn=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],Wn=n=>{const{classes:t,component:o,focusVisible:a,underline:r}=n,l={root:["root",`underline${H(r)}`,o==="button"&&"button",a&&"focusVisible"]};return xn(l,Sn,t)},Rn=yn(Tn,{name:"MuiLink",slot:"Root",overridesResolver:(n,t)=>{const{ownerState:o}=n;return[t.root,t[`underline${H(o.underline)}`],o.component==="button"&&t.button]}})(({theme:n,ownerState:t})=>w({},t.underline==="none"&&{textDecoration:"none"},t.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},t.underline==="always"&&w({textDecoration:"underline"},t.color!=="inherit"&&{textDecorationColor:Pn({theme:n,ownerState:t})},{"&:hover":{textDecorationColor:"inherit"}}),t.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Dn.focusVisible}`]:{outline:"auto"}})),P=p.forwardRef(function(t,o){const a=vn({props:t,name:"MuiLink"}),{className:r,color:l="primary",component:m="a",onBlur:u,onFocus:h,TypographyClasses:d,underline:i="always",variant:s="inherit",sx:c}=a,x=wn(a,Vn),{isFocusVisibleRef:b,onBlur:g,onFocus:T,ref:L}=Ln(),[G,j]=p.useState(!1),J=_n(o,L),Q=C=>{g(C),b.current===!1&&j(!1),u&&u(C)},X=C=>{T(C),b.current===!0&&j(!0),h&&h(C)},S=w({},a,{color:l,component:m,focusVisible:G,underline:i,variant:s}),Y=Wn(S);return e.jsx(Rn,w({color:l,className:kn(Y.root,r),classes:d,component:m,onBlur:Q,onFocus:X,ref:J,ownerState:S,variant:s,sx:[...Object.keys(q).includes(l)?[]:[{color:l}],...Array.isArray(c)?c:[c]]},x))}),An={title:"Components/Content"},F=[{label:"Chip as value 1",value:"chip_value1"},{label:"Chip as value 2",value:"chip_value2"},{label:"Chip as value 3",value:"chip_value3"}],k={tags:[{label:"Chip 1",value:"chip-1"},{label:"Chip 2",value:"chip-2"},{label:"Chip 3",value:"chip-3"},{label:"Chip 4",value:"chip-4"}],date:new Date("December 17, 1995 03:24:00"),toggle:!1,colorPicker:"#a8001791",thumbnail:"https://res.cloudinary.com/simpleview/image/upload/v1542821844/clients/grandrapids/_OD_0354_c78fbb66-c75a-4804-9430-9af38ed8e9d5.jpg",chipsAsValue:e.jsx(rn,{children:F==null?void 0:F.map(n=>e.jsx(pn,{label:n==null?void 0:n.label},`${n==null?void 0:n.label}-${n==null?void 0:n.value}`))}),undefinedValue:void 0,emptyStringValue:"",emptyArrayValue:[],animals:[{id:1,species:"Dog",color:"Brown"},{id:2,species:"Cat",color:"White"}],cars:[{id:1,make:"BMW",model:"M3"},{id:2,make:"Volkswagen",model:"Golf"}],multipleTransforms:"This is some text",fieldWithLongWord:"Pneumonoultramicroscopicsilicovolcanoconiosis",fieldWithLongURL:"https://simpleviewinc.github.io/sv-mosaic/master/?path=/story/components-content--kitchen-sink",fieldWithLongSentence:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mollis diam non imperdiet luctus. Morbi in augue leo. Vestibulum non tellus in elit molestie pretium sollicitudin eget purus. Mauris varius, est sed placerat ornare, nulla libero consequat nisi, id tempor nibh felis non velit."},En={"Single Column":[[["tags"]],[["colorPicker"]],[["toggle"]],[["date"]],[["thumbnail"]],[["chipsAsValue"]],[["animals"]],[["cars"]],[["multipleTransforms"]]],"Two Columns":[[["tags"],["colorPicker"]],[["toggle"],["date"]],[["thumbnail"],["chipsAsValue"]],[["animals"],["cars"]],[["multipleTransforms"]]],"Three Columns":[[["tags"],["colorPicker"],[]],[["toggle"],["date"],["thumbnail"]],[["animals"],["cars"],["chipsAsValue"]],[["multipleTransforms"]]]},f=({title:n,variant:t,sectionConfigKey:o,showButtons:a,showFirstRowItems:r,amountContent:l})=>{const[m,u]=p.useState(!1),h=()=>{u(!m)},d=[{name:"edit",label:"Edit",mIcon:K,color:"gray",variant:"icon",show:[a!=="undefined",Number(a)>=1],onClick:function(){alert("Edit button clicked")}},{name:"showDetails",color:"teal",variant:"text",label:m?"Less Details":"More Details",onClick:h,show:[a!=="undefined",Number(a)>=2]}],i=[{name:"chips",label:"Chips using transform_chips()",tooltip:"This is a list of chips",transforms:[I()],column:"tags",show:r},{name:"toggle",label:"Toggle using transform_boolean()",tooltip:e.jsxs(e.Fragment,{children:["This came in as a boolean, but",e.jsx("br",{}),"will displayed as yes or no"]}),transforms:[O()]},{name:"date",label:"Date using transform_dateFormat()",transforms:[$()]},{name:"color",label:"Color using transform_colorPicker()",transforms:[U()],column:"colorPicker",show:r},{name:"thumbnail",label:"Thumbnail using transform_thumbnail()",transforms:[z({width:150,height:150})]},{name:"chipsAsValue",label:"Chips with no transform only value"},{name:"animals",label:"Animals",transforms:[D({columns:[{name:"species",label:"Species"},{name:"color",label:"Color"}]})]},{name:"cars",label:"Cars",transforms:[D({columns:[{name:"make",label:"Make"},{name:"model",label:"Model"}]})]},{name:"multipleTransforms",label:"Multiple Transforms",transforms:[({data:c})=>e.jsx("div",{style:{color:"red"},children:c}),({data:c})=>e.jsx("div",{style:{fontSize:"2rem"},children:c})]}],s=En[o];return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:n,data:k,fields:i,sections:s.slice(0,m?void 0:2),buttons:d,variant:t}),l===2&&e.jsx(_,{title:"Second content",data:k,fields:i,sections:s,variant:t})]})};f.args={title:"Main Content Title",variant:"standard",sectionConfigKey:"Single Column",showButtons:"2",showFirstRowItems:!0,amountContent:1};f.argTypes={title:{name:"Title"},variant:{name:"Variant",options:["standard","card"],control:{type:"select"}},sectionConfigKey:{name:"Sections",options:["Single Column","Two Columns","Three Columns"],control:{type:"select"}},showButtons:{name:"Buttons",options:["1","2","0","undefined"],control:{type:"select"}},showFirstRowItems:{name:"Show first row"},amountContent:{name:"Amount of contents",options:[1,2],control:{type:"select"}}};const y=()=>{const n=[{name:"edit",label:"Edit",mIcon:K,color:"gray",variant:"icon",onClick:function(){alert("Edit button clicked")}},{name:"showDetails",color:"teal",variant:"text",label:"More Details",onClick:()=>alert("More details")}],t=[{name:"chips",label:"Chips using transform_chips()",transforms:[I()],column:"tags"},{name:"toggle",label:e.jsx(P,{href:"#",children:"Toggle using transform_boolean()"}),transforms:[O()]},{name:"date",label:"Date using transform_dateFormat()",transforms:[$()]},{name:"color",label:"Color using transform_colorPicker()",transforms:[U()],column:"colorPicker"},{name:"thumbnail",label:"Thumbnail using transform_thumbnail()",transforms:[z({width:150,height:150})]},{name:"chipsAsValue",label:"Chips with no transform only value"},{name:"undefinedValue",label:"Field with undefined value"},{name:"emptyStringValue",label:"Field with empty string value"},{name:"emptyArrayValue",label:"Field with empty array value"},{name:"fieldWithLongWord",label:"Long Word"},{name:"fieldWithLongURL",label:"Long URL",transforms:[({data:a})=>e.jsx(P,{href:a,children:a})]},{name:"fieldWithLongSentence",label:"Long Sentence"}],o=[[["tags"],["colorPicker"],[]],[["toggle"],["date"],["colorPicker"]],[["thumbnail"],["chipsAsValue"],[]],[["undefinedValue"],["emptyStringValue"],["emptyArrayValue"]],[["fieldWithLongWord"],["fieldWithLongURL"],["fieldWithLongSentence"]]];return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:"Standard content",data:k,fields:t,sections:o,buttons:n}),e.jsx("br",{}),e.jsx(_,{title:"Card content",data:k,fields:t,sections:o,buttons:n,variant:"card"})]})};var V,W,R;f.parameters={...f.parameters,docs:{...(V=f.parameters)==null?void 0:V.docs,source:{originalSource:`({ +import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as p}from"./index-BP8_t0zE.js";import{F as B,d as Z,e as nn,f as en,M as tn,T as on,g as an,C as sn,h as rn,t as I,i as O,b as $,a as U,c as z,j as D}from"./column_transforms-CU_Ei3Uz.js";import{B as ln}from"./ButtonRow-B3IWj8ab.js";import{T as cn,B as mn}from"./TooltipIcon-CO3K7ssQ.js";import{t as v}from"./testIds-D6Gx1A0F.js";import{u as un,T as dn}from"./Button-Do5OxnZO.js";import"./Typography-Br_RMLnS.js";import{S as fn}from"./SubtitleText-Vdwjg1jD.js";import{g as hn}from"./useToggle-lipGlewK.js";import{C as pn}from"./Chip-Btt3uSwF.js";import{d as K}from"./Edit-hiJ2yy-Y.js";import{a as bn,g as gn,l as M,m as Cn,s as yn,c as H,u as vn,_ as wn,n as _n,b as kn,d as xn}from"./styled-hJgfyZIG.js";import{_ as w}from"./extends-CF3RwP-h.js";import{T as Tn}from"./Typography-aSbaE-Qi.js";import{u as Ln}from"./createSvgIcon-DE5yaevU.js";function Fn({tooltip:n}){const{anchorProps:t,tooltipProps:o}=un();return e.jsxs(e.Fragment,{children:[e.jsx(cn,{...t,"data-testid":v.CONTENT_TOOLTIP_ICON}),e.jsx(dn,{...o,children:n})]})}const jn=({label:n,transforms:t,value:o,tooltip:a})=>{const r=p.useMemo(()=>o===void 0||o===""||Array.isArray(o)&&!o.length?e.jsx(mn,{}):t?t.reduce((l,m)=>m({data:l}),o):o,[t,o]);return e.jsxs(B,{"data-testid":v.CONTENT_FIELD,$margin:!0,children:[e.jsxs(Z,{children:[n,a&&e.jsx(Fn,{tooltip:a})]}),e.jsx(nn,{children:e.jsx(en,{children:r})})]})},_=n=>{const{fields:t,data:o,sections:a,title:r,buttons:l=[],variant:m}=n,u=m==="card",h=p.useMemo(()=>(a||t.map(({name:i,column:s})=>[[s||i]])).map((i,s)=>i.map((c,x)=>c.map(b=>{const g=t.find(({name:T,column:L})=>(L||T)===b);if(!g)throw new Error(`No field declared for field name '${b}'. (section ${s}, row ${x})`);if(hn(g.show,!0))return g}).filter(Boolean))).filter(i=>i.flat().length),[t,a]);return o?e.jsxs(tn,{className:u?"card-wrapper":"content-wrapper","data-testid":v.CONTENT,children:[e.jsxs(on,{className:u?"title-bar":"",children:[e.jsx(fn,{maxLines:1,children:r}),l.length>0&&e.jsx(ln,{buttons:l,separator:!u})]}),e.jsx(an,{className:u?"card-content":"",children:h.map((d,i)=>e.jsx(sn,{className:u?"card-row":"",$columns:d.length,"data-testid":v.CONTENT_ROW,children:d.map(([s],c)=>s?p.createElement(jn,{...s,key:s.name,value:o[s.column||s.name]}):e.jsx(B,{"data-testid":v.CONTENT_FIELD},c))},`${i}-row`))})]}):null};function Sn(n){return gn("MuiLink",n)}const Dn=bn("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),q={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Mn=n=>q[n]||n,Pn=({theme:n,ownerState:t})=>{const o=Mn(t.color),a=M(n,`palette.${o}`,!1)||t.color,r=M(n,`palette.${o}Channel`);return"vars"in n&&r?`rgba(${r} / 0.4)`:Cn(a,.4)},Vn=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],Wn=n=>{const{classes:t,component:o,focusVisible:a,underline:r}=n,l={root:["root",`underline${H(r)}`,o==="button"&&"button",a&&"focusVisible"]};return xn(l,Sn,t)},Rn=yn(Tn,{name:"MuiLink",slot:"Root",overridesResolver:(n,t)=>{const{ownerState:o}=n;return[t.root,t[`underline${H(o.underline)}`],o.component==="button"&&t.button]}})(({theme:n,ownerState:t})=>w({},t.underline==="none"&&{textDecoration:"none"},t.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},t.underline==="always"&&w({textDecoration:"underline"},t.color!=="inherit"&&{textDecorationColor:Pn({theme:n,ownerState:t})},{"&:hover":{textDecorationColor:"inherit"}}),t.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Dn.focusVisible}`]:{outline:"auto"}})),P=p.forwardRef(function(t,o){const a=vn({props:t,name:"MuiLink"}),{className:r,color:l="primary",component:m="a",onBlur:u,onFocus:h,TypographyClasses:d,underline:i="always",variant:s="inherit",sx:c}=a,x=wn(a,Vn),{isFocusVisibleRef:b,onBlur:g,onFocus:T,ref:L}=Ln(),[G,j]=p.useState(!1),J=_n(o,L),Q=C=>{g(C),b.current===!1&&j(!1),u&&u(C)},X=C=>{T(C),b.current===!0&&j(!0),h&&h(C)},S=w({},a,{color:l,component:m,focusVisible:G,underline:i,variant:s}),Y=Wn(S);return e.jsx(Rn,w({color:l,className:kn(Y.root,r),classes:d,component:m,onBlur:Q,onFocus:X,ref:J,ownerState:S,variant:s,sx:[...Object.keys(q).includes(l)?[]:[{color:l}],...Array.isArray(c)?c:[c]]},x))}),An={title:"Components/Content"},F=[{label:"Chip as value 1",value:"chip_value1"},{label:"Chip as value 2",value:"chip_value2"},{label:"Chip as value 3",value:"chip_value3"}],k={tags:[{label:"Chip 1",value:"chip-1"},{label:"Chip 2",value:"chip-2"},{label:"Chip 3",value:"chip-3"},{label:"Chip 4",value:"chip-4"}],date:new Date("December 17, 1995 03:24:00"),toggle:!1,colorPicker:"#a8001791",thumbnail:"https://res.cloudinary.com/simpleview/image/upload/v1542821844/clients/grandrapids/_OD_0354_c78fbb66-c75a-4804-9430-9af38ed8e9d5.jpg",chipsAsValue:e.jsx(rn,{children:F==null?void 0:F.map(n=>e.jsx(pn,{label:n==null?void 0:n.label},`${n==null?void 0:n.label}-${n==null?void 0:n.value}`))}),undefinedValue:void 0,emptyStringValue:"",emptyArrayValue:[],animals:[{id:1,species:"Dog",color:"Brown"},{id:2,species:"Cat",color:"White"}],cars:[{id:1,make:"BMW",model:"M3"},{id:2,make:"Volkswagen",model:"Golf"}],multipleTransforms:"This is some text",fieldWithLongWord:"Pneumonoultramicroscopicsilicovolcanoconiosis",fieldWithLongURL:"https://simpleviewinc.github.io/sv-mosaic/master/?path=/story/components-content--kitchen-sink",fieldWithLongSentence:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mollis diam non imperdiet luctus. Morbi in augue leo. Vestibulum non tellus in elit molestie pretium sollicitudin eget purus. Mauris varius, est sed placerat ornare, nulla libero consequat nisi, id tempor nibh felis non velit."},En={"Single Column":[[["tags"]],[["colorPicker"]],[["toggle"]],[["date"]],[["thumbnail"]],[["chipsAsValue"]],[["animals"]],[["cars"]],[["multipleTransforms"]]],"Two Columns":[[["tags"],["colorPicker"]],[["toggle"],["date"]],[["thumbnail"],["chipsAsValue"]],[["animals"],["cars"]],[["multipleTransforms"]]],"Three Columns":[[["tags"],["colorPicker"],[]],[["toggle"],["date"],["thumbnail"]],[["animals"],["cars"],["chipsAsValue"]],[["multipleTransforms"]]]},f=({title:n,variant:t,sectionConfigKey:o,showButtons:a,showFirstRowItems:r,amountContent:l})=>{const[m,u]=p.useState(!1),h=()=>{u(!m)},d=[{name:"edit",label:"Edit",mIcon:K,color:"gray",variant:"icon",show:[a!=="undefined",Number(a)>=1],onClick:function(){alert("Edit button clicked")}},{name:"showDetails",color:"teal",variant:"text",label:m?"Less Details":"More Details",onClick:h,show:[a!=="undefined",Number(a)>=2]}],i=[{name:"chips",label:"Chips using transform_chips()",tooltip:"This is a list of chips",transforms:[I()],column:"tags",show:r},{name:"toggle",label:"Toggle using transform_boolean()",tooltip:e.jsxs(e.Fragment,{children:["This came in as a boolean, but",e.jsx("br",{}),"will displayed as yes or no"]}),transforms:[O()]},{name:"date",label:"Date using transform_dateFormat()",transforms:[$()]},{name:"color",label:"Color using transform_colorPicker()",transforms:[U()],column:"colorPicker",show:r},{name:"thumbnail",label:"Thumbnail using transform_thumbnail()",transforms:[z({width:150,height:150})]},{name:"chipsAsValue",label:"Chips with no transform only value"},{name:"animals",label:"Animals",transforms:[D({columns:[{name:"species",label:"Species"},{name:"color",label:"Color"}]})]},{name:"cars",label:"Cars",transforms:[D({columns:[{name:"make",label:"Make"},{name:"model",label:"Model"}]})]},{name:"multipleTransforms",label:"Multiple Transforms",transforms:[({data:c})=>e.jsx("div",{style:{color:"red"},children:c}),({data:c})=>e.jsx("div",{style:{fontSize:"2rem"},children:c})]}],s=En[o];return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:n,data:k,fields:i,sections:s.slice(0,m?void 0:2),buttons:d,variant:t}),l===2&&e.jsx(_,{title:"Second content",data:k,fields:i,sections:s,variant:t})]})};f.args={title:"Main Content Title",variant:"standard",sectionConfigKey:"Single Column",showButtons:"2",showFirstRowItems:!0,amountContent:1};f.argTypes={title:{name:"Title"},variant:{name:"Variant",options:["standard","card"],control:{type:"select"}},sectionConfigKey:{name:"Sections",options:["Single Column","Two Columns","Three Columns"],control:{type:"select"}},showButtons:{name:"Buttons",options:["1","2","0","undefined"],control:{type:"select"}},showFirstRowItems:{name:"Show first row"},amountContent:{name:"Amount of contents",options:[1,2],control:{type:"select"}}};const y=()=>{const n=[{name:"edit",label:"Edit",mIcon:K,color:"gray",variant:"icon",onClick:function(){alert("Edit button clicked")}},{name:"showDetails",color:"teal",variant:"text",label:"More Details",onClick:()=>alert("More details")}],t=[{name:"chips",label:"Chips using transform_chips()",transforms:[I()],column:"tags"},{name:"toggle",label:e.jsx(P,{href:"#",children:"Toggle using transform_boolean()"}),transforms:[O()]},{name:"date",label:"Date using transform_dateFormat()",transforms:[$()]},{name:"color",label:"Color using transform_colorPicker()",transforms:[U()],column:"colorPicker"},{name:"thumbnail",label:"Thumbnail using transform_thumbnail()",transforms:[z({width:150,height:150})]},{name:"chipsAsValue",label:"Chips with no transform only value"},{name:"undefinedValue",label:"Field with undefined value"},{name:"emptyStringValue",label:"Field with empty string value"},{name:"emptyArrayValue",label:"Field with empty array value"},{name:"fieldWithLongWord",label:"Long Word"},{name:"fieldWithLongURL",label:"Long URL",transforms:[({data:a})=>e.jsx(P,{href:a,children:a})]},{name:"fieldWithLongSentence",label:"Long Sentence"}],o=[[["tags"],["colorPicker"],[]],[["toggle"],["date"],["colorPicker"]],[["thumbnail"],["chipsAsValue"],[]],[["undefinedValue"],["emptyStringValue"],["emptyArrayValue"]],[["fieldWithLongWord"],["fieldWithLongURL"],["fieldWithLongSentence"]]];return e.jsxs(e.Fragment,{children:[e.jsx(_,{title:"Standard content",data:k,fields:t,sections:o,buttons:n}),e.jsx("br",{}),e.jsx(_,{title:"Card content",data:k,fields:t,sections:o,buttons:n,variant:"card"})]})};var V,W,R;f.parameters={...f.parameters,docs:{...(V=f.parameters)==null?void 0:V.docs,source:{originalSource:`({ title, variant, sectionConfigKey, diff --git a/sb8/qa/assets/CopyField.stories-BHkH7kjQ.js b/sb8/qa/assets/CopyField.stories-BHkH7kjQ.js deleted file mode 100644 index 0c994a5c98..0000000000 --- a/sb8/qa/assets/CopyField.stories-BHkH7kjQ.js +++ /dev/null @@ -1,47 +0,0 @@ -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"./formUtils-C-50Qw-d.js";import"./Button-Do5OxnZO.js";import{r as g}from"./renderButtons-BmHfsf_z.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./theme-DRtZtbPc.js";import"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./useIsFocusVisible-De2ftVE9.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./index-BxmsGmlx.js";import"./index-jWylWF_w.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./ButtonBase-BZmvw3BH.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.js";import"./useToggle-lipGlewK.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-CvnKr_oj.js";import"./ColorSelected-Dn-MWZ_m.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-yhdXyTld.js";import"./formats-CDjt32hU.js";import"./Dialog-BlwzXIwM.js";import"./useMediaQuery-CguehUMS.js";import"./SideNav-biYpQHtM.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.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(); - const { - state, - methods: { - setFieldValue - }, - handleSubmit - } = controller; - useEffect(() => { - document.body.style.margin = "0px"; - return () => { - document.body.style.margin = ORIGINAL_BODY_MARGIN; - }; - }, []); - const fields = useMemo((): FieldDef[] => [{ - name: "name", - label: "Name", - type: "text", - required: true - }, { - name: "slug", - label: "Slug", - type: "text", - required: true, - 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" - }], []); - useEffect(() => { - if (!state.touched.slug) { - const transformedLabel = state.data.name?.trim().toLowerCase().replace(/ {1,}/g, "_").replace(/[^a-z_]/g, ""); - setFieldValue({ - name: "slug", - value: transformedLabel - }); - } - }, [setFieldValue, state.data.name, state.touched]); - return <> - {showState &&
{JSON.stringify(state, null, "  ")}
} -
- -
- ; -}`,...(l=(a=t.parameters)==null?void 0:a.docs)==null?void 0:l.source}}};const Ft=["CopyField"];export{t as CopyField,Ft as __namedExportsOrder,xt as default}; diff --git a/sb8/qa/assets/CopyField.stories-Cf797A3Q.js b/sb8/qa/assets/CopyField.stories-Cf797A3Q.js new file mode 100644 index 0000000000..737e952b68 --- /dev/null +++ b/sb8/qa/assets/CopyField.stories-Cf797A3Q.js @@ -0,0 +1,47 @@ +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-Cf-5vk95.js";import{r as g}from"./renderButtons-BmHfsf_z.js";import"./theme-DRtZtbPc.js";import"./SideNav-biYpQHtM.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./FormFieldText.styled-hkDOkrrs.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"./index-BxmsGmlx.js";import"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./index-DnvaddO_.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-gVxq6Y0Z.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-yhdXyTld.js";import"./formats-CDjt32hU.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(); + const { + state, + methods: { + setFieldValue + }, + handleSubmit + } = controller; + useEffect(() => { + document.body.style.margin = "0px"; + return () => { + document.body.style.margin = ORIGINAL_BODY_MARGIN; + }; + }, []); + const fields = useMemo((): FieldDef[] => [{ + name: "name", + label: "Name", + type: "text", + required: true + }, { + name: "slug", + label: "Slug", + type: "text", + required: true, + 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" + }], []); + useEffect(() => { + if (!state.touched.slug) { + const transformedLabel = state.data.name?.trim().toLowerCase().replace(/ {1,}/g, "_").replace(/[^a-z_]/g, ""); + setFieldValue({ + name: "slug", + value: transformedLabel + }); + } + }, [setFieldValue, state.data.name, state.touched]); + return <> + {showState &&
{JSON.stringify(state, null, "  ")}
} +
+ +
+ ; +}`,...(l=(a=t.parameters)==null?void 0:a.docs)==null?void 0:l.source}}};const Ft=["CopyField"];export{t as CopyField,Ft as __namedExportsOrder,xt as default}; diff --git a/sb8/qa/assets/CustomFields.stories-BwFt3wAc.js b/sb8/qa/assets/CustomFields.stories-CUuyxTTf.js similarity index 63% rename from sb8/qa/assets/CustomFields.stories-BwFt3wAc.js rename to sb8/qa/assets/CustomFields.stories-CUuyxTTf.js index 920ed67288..71d55efbc0 100644 --- a/sb8/qa/assets/CustomFields.stories-BwFt3wAc.js +++ b/sb8/qa/assets/CustomFields.stories-CUuyxTTf.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"./formUtils-C-50Qw-d.js";import"./Button-Do5OxnZO.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"./FormFieldText.styled-hkDOkrrs.js";import"./theme-DRtZtbPc.js";import"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./useIsFocusVisible-De2ftVE9.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./index-BxmsGmlx.js";import"./index-jWylWF_w.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./ButtonBase-BZmvw3BH.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.js";import"./useToggle-lipGlewK.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-CvnKr_oj.js";import"./ColorSelected-Dn-MWZ_m.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-yhdXyTld.js";import"./formats-CDjt32hU.js";import"./Dialog-BlwzXIwM.js";import"./useMediaQuery-CguehUMS.js";import"./SideNav-biYpQHtM.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.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-Cf-5vk95.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-biYpQHtM.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./FormFieldText.styled-hkDOkrrs.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"./index-BxmsGmlx.js";import"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./index-DnvaddO_.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-gVxq6Y0Z.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-yhdXyTld.js";import"./formats-CDjt32hU.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-BuxCM377.js b/sb8/qa/assets/DataView-DcMpqlHx.js similarity index 92% rename from sb8/qa/assets/DataView-BuxCM377.js rename to sb8/qa/assets/DataView-DcMpqlHx.js index 80d6c2576b..9b93549c75 100644 --- a/sb8/qa/assets/DataView-BuxCM377.js +++ b/sb8/qa/assets/DataView-DcMpqlHx.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-CH7MCt8u.js";import{s as o}from"./DataView.stories-BpbRm7sX.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-ficPbA-p.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.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-D6Gx1A0F.js";import"./index-jWylWF_w.js";import"./debounce-C_xMouBr.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-Btt3uSwF.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-B3IWj8ab.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./ColorSelected-Dn-MWZ_m.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-yhdXyTld.js";import"./index-Bi5COUJk.js";import"./formUtils-C-50Qw-d.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-CvnKr_oj.js";import"./formats-CDjt32hU.js";import"./Dialog-BlwzXIwM.js";import"./useMediaQuery-CguehUMS.js";import"./SideNav-biYpQHtM.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./DataViewPrimaryFilter-Ce1Vha94.js";import"./DataViewFilterSingleSelect-WS8OQmCt.js";import"./DataViewFilterText-6z_qbjui.js";import"./useMosaicSettings-BhwODcT2.js";import"./column_transforms-DFdcEqBi.js";import"./Image-DW9YTXUC.js";import"./DataViewFilterNumber-DBSz5NV6.js";import"./DataViewFilterMultiselect-Ghbl7O0R.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-VPsM0GyV.js";import{s as o}from"./DataView.stories-BnTm_4ZN.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-K9Ou7yoP.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.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-D6Gx1A0F.js";import"./index-DnvaddO_.js";import"./debounce-C_xMouBr.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-Btt3uSwF.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-B3IWj8ab.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./ColorSelected-gVxq6Y0Z.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-yhdXyTld.js";import"./index-BP9jMc-q.js";import"./Form-Cf-5vk95.js";import"./SideNav-biYpQHtM.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-CvnKr_oj.js";import"./formats-CDjt32hU.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-Ce1Vha94.js";import"./DataViewFilterSingleSelect-WS8OQmCt.js";import"./DataViewFilterText-6z_qbjui.js";import"./useMosaicSettings-BhwODcT2.js";import"./column_transforms-CU_Ei3Uz.js";import"./Image-DW9YTXUC.js";import"./DataViewFilterNumber-CznyZLDD.js";import"./DataViewFilterMultiselect-GXSQja9F.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-BpbRm7sX.js b/sb8/qa/assets/DataView.stories-BnTm_4ZN.js similarity index 99% rename from sb8/qa/assets/DataView.stories-BpbRm7sX.js rename to sb8/qa/assets/DataView.stories-BnTm_4ZN.js index fb02e91c2a..b60cfa1b37 100644 --- a/sb8/qa/assets/DataView.stories-BpbRm7sX.js +++ b/sb8/qa/assets/DataView.stories-BnTm_4ZN.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-ficPbA-p.js";import{a as fe,D as Ve}from"./ColorSelected-Dn-MWZ_m.js";import{D as $}from"./index-Bi5COUJk.js";import{D as Ze}from"./DataViewFilterSingleSelect-WS8OQmCt.js";import{D as B}from"./DataViewFilterText-6z_qbjui.js";import"./index-jWylWF_w.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"./formUtils-C-50Qw-d.js";import{k as x,c as pe,l as Ue,m as Ne,i as Je,b as Q}from"./column_transforms-DFdcEqBi.js";import{t as ee}from"./testIds-D6Gx1A0F.js";import{D as qe}from"./DataViewFilterNumber-DBSz5NV6.js";import{D as ae}from"./DataViewFilterMultiselect-Ghbl7O0R.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-K9Ou7yoP.js";import{a as fe,D as Ve}from"./ColorSelected-gVxq6Y0Z.js";import{D as $}from"./index-BP9jMc-q.js";import{D as Ze}from"./DataViewFilterSingleSelect-WS8OQmCt.js";import{D as B}from"./DataViewFilterText-6z_qbjui.js";import"./index-DnvaddO_.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-Cf-5vk95.js";import{k as x,c as pe,l as Ue,m as Ne,i as Je,b as Q}from"./column_transforms-CU_Ei3Uz.js";import{t as ee}from"./testIds-D6Gx1A0F.js";import{D as qe}from"./DataViewFilterNumber-CznyZLDD.js";import{D as ae}from"./DataViewFilterMultiselect-GXSQja9F.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-CvGzBqKY.js b/sb8/qa/assets/DataViewFilterDate-BlLjq4fB.js similarity index 74% rename from sb8/qa/assets/DataViewFilterDate-CvGzBqKY.js rename to sb8/qa/assets/DataViewFilterDate-BlLjq4fB.js index 1a4b13b45e..cd42c0de22 100644 --- a/sb8/qa/assets/DataViewFilterDate-CvGzBqKY.js +++ b/sb8/qa/assets/DataViewFilterDate-BlLjq4fB.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-CH7MCt8u.js";import{s as a,P as m}from"./DataViewFilterDate.stories-K__fVLYk.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-Bi5COUJk.js";import"./theme-DRtZtbPc.js";import"./ColorSelected-Dn-MWZ_m.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.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-D6Gx1A0F.js";import"./index-jWylWF_w.js";import"./debounce-C_xMouBr.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-Btt3uSwF.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-B3IWj8ab.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-yhdXyTld.js";import"./formUtils-C-50Qw-d.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-CvnKr_oj.js";import"./formats-CDjt32hU.js";import"./Dialog-BlwzXIwM.js";import"./useMediaQuery-CguehUMS.js";import"./SideNav-biYpQHtM.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./DataViewPrimaryFilter-Ce1Vha94.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-VPsM0GyV.js";import{s as a,P as m}from"./DataViewFilterDate.stories-DBsPYCcY.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-BP9jMc-q.js";import"./theme-DRtZtbPc.js";import"./ColorSelected-gVxq6Y0Z.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.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-D6Gx1A0F.js";import"./index-DnvaddO_.js";import"./debounce-C_xMouBr.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-Btt3uSwF.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-B3IWj8ab.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-yhdXyTld.js";import"./Form-Cf-5vk95.js";import"./SideNav-biYpQHtM.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-CvnKr_oj.js";import"./formats-CDjt32hU.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-Ce1Vha94.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-K__fVLYk.js b/sb8/qa/assets/DataViewFilterDate.stories-DBsPYCcY.js similarity index 98% rename from sb8/qa/assets/DataViewFilterDate.stories-K__fVLYk.js rename to sb8/qa/assets/DataViewFilterDate.stories-DBsPYCcY.js index 2b3bba9f33..dcc4deba65 100644 --- a/sb8/qa/assets/DataViewFilterDate.stories-K__fVLYk.js +++ b/sb8/qa/assets/DataViewFilterDate.stories-DBsPYCcY.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-Bi5COUJk.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-BP9jMc-q.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-3yBTJr01.js b/sb8/qa/assets/DataViewFilterMultiselect-BXhcemH6.js similarity index 86% rename from sb8/qa/assets/DataViewFilterMultiselect-3yBTJr01.js rename to sb8/qa/assets/DataViewFilterMultiselect-BXhcemH6.js index e53587cfe0..b61acb704d 100644 --- a/sb8/qa/assets/DataViewFilterMultiselect-3yBTJr01.js +++ b/sb8/qa/assets/DataViewFilterMultiselect-BXhcemH6.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-CH7MCt8u.js";import{s as n,P as m}from"./DataViewFilterMultiselect.stories-CyXdA4OB.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-jWylWF_w.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.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-D6Gx1A0F.js";import"./debounce-C_xMouBr.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-Btt3uSwF.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-B3IWj8ab.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./MultiSelectHelper-ficPbA-p.js";import"./DataViewFilterMultiselect-Ghbl7O0R.js";import"./DataViewPrimaryFilter-Ce1Vha94.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-VPsM0GyV.js";import{s as n,P as m}from"./DataViewFilterMultiselect.stories-BfGp-_as.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-DnvaddO_.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.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-D6Gx1A0F.js";import"./debounce-C_xMouBr.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-Btt3uSwF.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-B3IWj8ab.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./MultiSelectHelper-K9Ou7yoP.js";import"./DataViewFilterMultiselect-GXSQja9F.js";import"./DataViewPrimaryFilter-Ce1Vha94.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/DataViewFilterMultiselect-Ghbl7O0R.js b/sb8/qa/assets/DataViewFilterMultiselect-GXSQja9F.js similarity index 96% rename from sb8/qa/assets/DataViewFilterMultiselect-Ghbl7O0R.js rename to sb8/qa/assets/DataViewFilterMultiselect-GXSQja9F.js index 4aa88e6853..82dd795522 100644 --- a/sb8/qa/assets/DataViewFilterMultiselect-Ghbl7O0R.js +++ b/sb8/qa/assets/DataViewFilterMultiselect-GXSQja9F.js @@ -1 +1 @@ -import{j as a}from"./jsx-runtime-nGUw9YhZ.js";import{r as u}from"./index-BP8_t0zE.js";import{D as p}from"./DataViewPrimaryFilter-Ce1Vha94.js";import{D as w}from"./index-jWylWF_w.js";import{D}from"./FormFieldText.styled-hkDOkrrs.js";const b=[{label:"In",value:"in"},{label:"Not In",value:"not_in"},{label:"All",value:"all"},{label:"Exists",value:"exists"},{label:"Not Exists",value:"not_exists"}],O={in:"",not_in:"Not In - ",all:"All - "};function F(e){var c,r;const[t,l]=u.useState({anchorEl:null,selected:[],dropdownOpen:!1}),d=e.data.value||[],s=e.data.comparison||"in";u.useEffect(()=>{async function n(){const h=await e.args.getSelected(d);l(E=>({...E,selected:h}))}n()},[e.data]);const m=function(n){l({...t,anchorEl:n.currentTarget})},i=function(){l({...t,anchorEl:null})},f=function(){l({...t,dropdownOpen:!0})},x=function(){l({...t,dropdownOpen:!1})},g=function(n){n.value.length>0||n.comparison==="exists"||n.comparison==="not_exists"?e.onChange(n):e.onChange(void 0),i()};let o;s==="exists"?o="EXISTS":s==="not_exists"?o="NOT EXISTS":t.selected.length>0?o=`${O[s]}${(c=t.selected[0])==null?void 0:c.label}`:o="";const v=e.args&&e.args.comparisons?b.filter(n=>e.args.comparisons.includes(n.value)):void 0;return a.jsxs("span",{children:[a.jsx(p,{label:e.label,value:o,onClick:m,multiselect:t==null?void 0:t.selected}),a.jsx(D,{anchorEl:t.anchorEl,onClose:i,onEntered:f,onExited:x,children:a.jsx(w,{comparison:s,comparisons:v,selected:t.selected,getOptions:e.args.getOptions,isOpen:t.dropdownOpen,onApply:g,placeholder:(r=e.args)==null?void 0:r.placeholder,limit:e.args.limit})})]})}export{F as D}; +import{j as a}from"./jsx-runtime-nGUw9YhZ.js";import{r as u}from"./index-BP8_t0zE.js";import{D as p}from"./DataViewPrimaryFilter-Ce1Vha94.js";import{D as w}from"./index-DnvaddO_.js";import{D}from"./FormFieldText.styled-hkDOkrrs.js";const b=[{label:"In",value:"in"},{label:"Not In",value:"not_in"},{label:"All",value:"all"},{label:"Exists",value:"exists"},{label:"Not Exists",value:"not_exists"}],O={in:"",not_in:"Not In - ",all:"All - "};function F(e){var c,r;const[t,l]=u.useState({anchorEl:null,selected:[],dropdownOpen:!1}),d=e.data.value||[],s=e.data.comparison||"in";u.useEffect(()=>{async function n(){const h=await e.args.getSelected(d);l(E=>({...E,selected:h}))}n()},[e.data]);const m=function(n){l({...t,anchorEl:n.currentTarget})},i=function(){l({...t,anchorEl:null})},f=function(){l({...t,dropdownOpen:!0})},x=function(){l({...t,dropdownOpen:!1})},g=function(n){n.value.length>0||n.comparison==="exists"||n.comparison==="not_exists"?e.onChange(n):e.onChange(void 0),i()};let o;s==="exists"?o="EXISTS":s==="not_exists"?o="NOT EXISTS":t.selected.length>0?o=`${O[s]}${(c=t.selected[0])==null?void 0:c.label}`:o="";const v=e.args&&e.args.comparisons?b.filter(n=>e.args.comparisons.includes(n.value)):void 0;return a.jsxs("span",{children:[a.jsx(p,{label:e.label,value:o,onClick:m,multiselect:t==null?void 0:t.selected}),a.jsx(D,{anchorEl:t.anchorEl,onClose:i,onEntered:f,onExited:x,children:a.jsx(w,{comparison:s,comparisons:v,selected:t.selected,getOptions:e.args.getOptions,isOpen:t.dropdownOpen,onApply:g,placeholder:(r=e.args)==null?void 0:r.placeholder,limit:e.args.limit})})]})}export{F as D}; diff --git a/sb8/qa/assets/DataViewFilterMultiselect.stories-CyXdA4OB.js b/sb8/qa/assets/DataViewFilterMultiselect.stories-BfGp-_as.js similarity index 96% rename from sb8/qa/assets/DataViewFilterMultiselect.stories-CyXdA4OB.js rename to sb8/qa/assets/DataViewFilterMultiselect.stories-BfGp-_as.js index f4face4b59..83b4b9d5e3 100644 --- a/sb8/qa/assets/DataViewFilterMultiselect.stories-CyXdA4OB.js +++ b/sb8/qa/assets/DataViewFilterMultiselect.stories-BfGp-_as.js @@ -1,4 +1,4 @@ -import{j as a}from"./jsx-runtime-nGUw9YhZ.js";import{r as m}from"./index-BP8_t0zE.js";import"./index-jWylWF_w.js";import{M as _,J as f,c as b}from"./MultiSelectHelper-ficPbA-p.js";import{D as u}from"./DataViewFilterMultiselect-Ghbl7O0R.js";const y={title:"Components/DataViewFilterMultiselect"},x=new f(b),e=new _({api:x,labelColumn:"tag",valueColumn:"id",sortColumn:"sort_tag"}),i=({showComparisons:s,limit:c})=>{const[n,r]=m.useState({comparison:"in",value:[]}),p=function(o){if(o===void 0)return r({...n,comparison:"",value:[]});r({...n,comparison:o.comparison||n.comparison,value:o.value})};return a.jsx(a.Fragment,{children:a.jsx(u,{label:"Multi Select Category",args:{getOptions:e.getOptions.bind(e),getSelected:e.getSelected.bind(e),comparisons:s&&["in","not_in","all","exists","not_exists"],limit:c},data:n,onChange:o=>p(o)},"multi_select_category")})};i.args={showComparisons:!1,limit:25};const l=()=>{const[s,c]=m.useState({comparison:"in",value:[]}),[n,r]=m.useState({comparison:"in",value:[]}),p=function(t){if(t===void 0)return c({...s,comparison:"",value:[]});c({...s,comparison:t.comparison||s.comparison,value:t.value})},o=function(t){if(t===void 0)return r({...n,comparison:"",value:[]});r({...n,comparison:t.comparison||n.comparison,value:t.value})};return a.jsxs(a.Fragment,{children:[a.jsx("h2",{children:"Hide comparison selector"}),a.jsx(u,{label:"Multi Select Category Without Comparisons",args:{getOptions:e.getOptions.bind(e),getSelected:e.getSelected.bind(e)},data:s,onChange:t=>p(t)},"multi_select_category"),a.jsx("h2",{children:"Show comparison selector"}),a.jsx(u,{label:"Multi Select Category With Comparisons",args:{getOptions:e.getOptions.bind(e),getSelected:e.getSelected.bind(e),comparisons:["in","not_in","all","exists","not_exists"]},data:n,onChange:t=>o(t)},"multi_select_category_with_comparisons")]})};var g,d,S;i.parameters={...i.parameters,docs:{...(g=i.parameters)==null?void 0:g.docs,source:{originalSource:`({ +import{j as a}from"./jsx-runtime-nGUw9YhZ.js";import{r as m}from"./index-BP8_t0zE.js";import"./index-DnvaddO_.js";import{M as _,J as f,c as b}from"./MultiSelectHelper-K9Ou7yoP.js";import{D as u}from"./DataViewFilterMultiselect-GXSQja9F.js";const y={title:"Components/DataViewFilterMultiselect"},x=new f(b),e=new _({api:x,labelColumn:"tag",valueColumn:"id",sortColumn:"sort_tag"}),i=({showComparisons:s,limit:c})=>{const[n,r]=m.useState({comparison:"in",value:[]}),p=function(o){if(o===void 0)return r({...n,comparison:"",value:[]});r({...n,comparison:o.comparison||n.comparison,value:o.value})};return a.jsx(a.Fragment,{children:a.jsx(u,{label:"Multi Select Category",args:{getOptions:e.getOptions.bind(e),getSelected:e.getSelected.bind(e),comparisons:s&&["in","not_in","all","exists","not_exists"],limit:c},data:n,onChange:o=>p(o)},"multi_select_category")})};i.args={showComparisons:!1,limit:25};const l=()=>{const[s,c]=m.useState({comparison:"in",value:[]}),[n,r]=m.useState({comparison:"in",value:[]}),p=function(t){if(t===void 0)return c({...s,comparison:"",value:[]});c({...s,comparison:t.comparison||s.comparison,value:t.value})},o=function(t){if(t===void 0)return r({...n,comparison:"",value:[]});r({...n,comparison:t.comparison||n.comparison,value:t.value})};return a.jsxs(a.Fragment,{children:[a.jsx("h2",{children:"Hide comparison selector"}),a.jsx(u,{label:"Multi Select Category Without Comparisons",args:{getOptions:e.getOptions.bind(e),getSelected:e.getSelected.bind(e)},data:s,onChange:t=>p(t)},"multi_select_category"),a.jsx("h2",{children:"Show comparison selector"}),a.jsx(u,{label:"Multi Select Category With Comparisons",args:{getOptions:e.getOptions.bind(e),getSelected:e.getSelected.bind(e),comparisons:["in","not_in","all","exists","not_exists"]},data:n,onChange:t=>o(t)},"multi_select_category_with_comparisons")]})};var g,d,S;i.parameters={...i.parameters,docs:{...(g=i.parameters)==null?void 0:g.docs,source:{originalSource:`({ showComparisons, limit }: typeof Playground.args): ReactElement => { diff --git a/sb8/qa/assets/DataViewFilterNumber-COdkeuiE.js b/sb8/qa/assets/DataViewFilterNumber-COdkeuiE.js deleted file mode 100644 index ac17f07a08..0000000000 --- a/sb8/qa/assets/DataViewFilterNumber-COdkeuiE.js +++ /dev/null @@ -1,2 +0,0 @@ -import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as m}from"./index-3-_tf5dF.js";import{M as p}from"./index-CH7MCt8u.js";import{s as e}from"./DataViewFilterNumber.stories-Df2LNp5_.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-DBSz5NV6.js";import"./DataViewPrimaryFilter-Ce1Vha94.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-D6Gx1A0F.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./formUtils-C-50Qw-d.js";import"./index-jWylWF_w.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-Dn-MWZ_m.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-yhdXyTld.js";import"./formats-CDjt32hU.js";import"./Dialog-BlwzXIwM.js";import"./useMediaQuery-CguehUMS.js";import"./SideNav-biYpQHtM.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./FormFieldNumber.stories-BO5WTXmf.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-DBSz5NV6.js b/sb8/qa/assets/DataViewFilterNumber-CznyZLDD.js similarity index 86% rename from sb8/qa/assets/DataViewFilterNumber-DBSz5NV6.js rename to sb8/qa/assets/DataViewFilterNumber-CznyZLDD.js index bd05a717e2..2f9f452ac3 100644 --- a/sb8/qa/assets/DataViewFilterNumber-DBSz5NV6.js +++ b/sb8/qa/assets/DataViewFilterNumber-CznyZLDD.js @@ -1,6 +1,6 @@ -import{j as s}from"./jsx-runtime-nGUw9YhZ.js";import{r as n}from"./index-BP8_t0zE.js";import{D as E}from"./DataViewPrimaryFilter-Ce1Vha94.js";import{a as F,D as j}from"./FormFieldText.styled-hkDOkrrs.js";import{s as w,B as x}from"./theme-DRtZtbPc.js";import{u as V,V as p,F as h}from"./formUtils-C-50Qw-d.js";import"./Button-Do5OxnZO.js";import{t as N}from"./testIds-D6Gx1A0F.js";const y=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-Ce1Vha94.js";import{a as F,D as j}from"./FormFieldText.styled-hkDOkrrs.js";import{s as w,B as x}from"./theme-DRtZtbPc.js";import{u as V,V as p,F as h}from"./Form-Cf-5vk95.js";import{t as N}from"./testIds-D6Gx1A0F.js";const y=w.div` display: flex; flex-direction: column; justify-content: space-between; width: ${x.sm}; -`,A=[{fields:[[["min"],["max"]]],gridMinWidth:x.sm}];function B({args:a,data:{min:o,max:l}={},onChange:i,onClose:u}){const r=V(),{state:{data:{min:t,max:e},errors:c},methods:{setFormValues:m}}=r,d=n.useCallback(async()=>({min:o,max:l}),[o,l]),f=n.useCallback(()=>{m({values:{min:void 0,max:void 0}})},[m]),v=n.useCallback(()=>{i(!t&&!e?void 0:{min:t,max:e}),u()},[e,t,i,u]),D=n.useMemo(()=>[{name:"min",type:"number",label:"Minimum",size:"full",inputSettings:a,validators:[{fn:p,options:{maxName:"max"}}],validates:["max"]},{name:"max",type:"number",label:"Maximum",size:"full",inputSettings:a,validators:[{fn:p,options:{minName:"min"}}],validates:["min"]}],[a]),b=Object.values(c).filter(Boolean).length>0;return s.jsxs(y,{"data-testid":N.DATA_VIEW_FILTER_NUMBER_CONTENT,children:[s.jsx(h,{...r,fields:D,sections:A,fullHeight:!1,spacing:"compact",getFormValues:d}),s.jsx(F,{onApply:v,onClear:f,disableApply:b})]})}function $({args:a,data:o,label:l,onChange:i}){const[u,r]=n.useState(null),{min:t,max:e}=o??{},c=function(f){r(f.currentTarget)},m=function(){r(null)},d=n.useMemo(()=>{if(!(t===void 0&&e===void 0))return t===void 0?`Less than ${e}`:e===void 0?`Greater than ${t}`:`Between ${t} and ${e}`},[t,e]);return s.jsxs(s.Fragment,{children:[s.jsx(E,{label:l,value:d,onClick:c}),s.jsx(j,{anchorEl:u,onClose:m,children:s.jsx(B,{args:a,data:o,onChange:i,onClose:m})})]})}export{$ as D}; +`,A=[{fields:[[["min"],["max"]]],gridMinWidth:x.sm}];function B({args:a,data:{min:o,max:l}={},onChange:i,onClose:u}){const r=V(),{state:{data:{min:t,max:e},errors:c},methods:{setFormValues:m}}=r,d=n.useCallback(async()=>({min:o,max:l}),[o,l]),f=n.useCallback(()=>{m({values:{min:void 0,max:void 0}})},[m]),v=n.useCallback(()=>{i(!t&&!e?void 0:{min:t,max:e}),u()},[e,t,i,u]),D=n.useMemo(()=>[{name:"min",type:"number",label:"Minimum",size:"full",inputSettings:a,validators:[{fn:p,options:{maxName:"max"}}],validates:["max"]},{name:"max",type:"number",label:"Maximum",size:"full",inputSettings:a,validators:[{fn:p,options:{minName:"min"}}],validates:["min"]}],[a]),b=Object.values(c).filter(Boolean).length>0;return s.jsxs(y,{"data-testid":N.DATA_VIEW_FILTER_NUMBER_CONTENT,children:[s.jsx(h,{...r,fields:D,sections:A,fullHeight:!1,spacing:"compact",getFormValues:d}),s.jsx(F,{onApply:v,onClear:f,disableApply:b})]})}function S({args:a,data:o,label:l,onChange:i}){const[u,r]=n.useState(null),{min:t,max:e}=o??{},c=function(f){r(f.currentTarget)},m=function(){r(null)},d=n.useMemo(()=>{if(!(t===void 0&&e===void 0))return t===void 0?`Less than ${e}`:e===void 0?`Greater than ${t}`:`Between ${t} and ${e}`},[t,e]);return s.jsxs(s.Fragment,{children:[s.jsx(E,{label:l,value:d,onClick:c}),s.jsx(j,{anchorEl:u,onClose:m,children:s.jsx(B,{args:a,data:o,onChange:i,onClose:m})})]})}export{S as D}; diff --git a/sb8/qa/assets/DataViewFilterNumber-D4i1abmx.js b/sb8/qa/assets/DataViewFilterNumber-D4i1abmx.js new file mode 100644 index 0000000000..e8b7032f60 --- /dev/null +++ b/sb8/qa/assets/DataViewFilterNumber-D4i1abmx.js @@ -0,0 +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-VPsM0GyV.js";import{s as e}from"./DataViewFilterNumber.stories-Hu81yiPk.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-CznyZLDD.js";import"./DataViewPrimaryFilter-Ce1Vha94.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-D6Gx1A0F.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./Form-Cf-5vk95.js";import"./SideNav-biYpQHtM.js";import"./containerQuery-C0QVV4Kt.js";import"./index-DnvaddO_.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-gVxq6Y0Z.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-yhdXyTld.js";import"./formats-CDjt32hU.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-CetoWszZ.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.stories-Df2LNp5_.js b/sb8/qa/assets/DataViewFilterNumber.stories-Hu81yiPk.js similarity index 90% rename from sb8/qa/assets/DataViewFilterNumber.stories-Df2LNp5_.js rename to sb8/qa/assets/DataViewFilterNumber.stories-Hu81yiPk.js index 1a6327d111..a13af87dbb 100644 --- a/sb8/qa/assets/DataViewFilterNumber.stories-Df2LNp5_.js +++ b/sb8/qa/assets/DataViewFilterNumber.stories-Hu81yiPk.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-DBSz5NV6.js";import{Playground as e}from"./FormFieldNumber.stories-BO5WTXmf.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-CznyZLDD.js";import{Playground as e}from"./FormFieldNumber.stories-CetoWszZ.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-BlAW1UAO.js b/sb8/qa/assets/DataViewFilterSingleSelect-DyS0SQS1.js similarity index 94% rename from sb8/qa/assets/DataViewFilterSingleSelect-BlAW1UAO.js rename to sb8/qa/assets/DataViewFilterSingleSelect-DyS0SQS1.js index 5b2679ca3b..13e4ce3daa 100644 --- a/sb8/qa/assets/DataViewFilterSingleSelect-BlAW1UAO.js +++ b/sb8/qa/assets/DataViewFilterSingleSelect-DyS0SQS1.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-CH7MCt8u.js";import{s as p,P as a}from"./DataViewFilterSingleSelect.stories-CbEa4PcS.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-WS8OQmCt.js";import"./theme-DRtZtbPc.js";import"./DataViewPrimaryFilter-Ce1Vha94.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-D6Gx1A0F.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-VPsM0GyV.js";import{s as p,P as a}from"./DataViewFilterSingleSelect.stories-CbEa4PcS.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-WS8OQmCt.js";import"./theme-DRtZtbPc.js";import"./DataViewPrimaryFilter-Ce1Vha94.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-D6Gx1A0F.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-COKaW6Yz.js b/sb8/qa/assets/DataViewFilterText-BDpRDu8m.js similarity index 95% rename from sb8/qa/assets/DataViewFilterText-COKaW6Yz.js rename to sb8/qa/assets/DataViewFilterText-BDpRDu8m.js index cc10ab4c62..0598ec2938 100644 --- a/sb8/qa/assets/DataViewFilterText-COKaW6Yz.js +++ b/sb8/qa/assets/DataViewFilterText-BDpRDu8m.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-CH7MCt8u.js";import{s as p,P as a}from"./DataViewFilterText.stories-BXW9jrpW.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-6z_qbjui.js";import"./DataViewPrimaryFilter-Ce1Vha94.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-D6Gx1A0F.js";import"./FormFieldText.styled-hkDOkrrs.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-VPsM0GyV.js";import{s as p,P as a}from"./DataViewFilterText.stories-BXW9jrpW.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-6z_qbjui.js";import"./DataViewPrimaryFilter-Ce1Vha94.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-D6Gx1A0F.js";import"./FormFieldText.styled-hkDOkrrs.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-DwoRhm2C.js b/sb8/qa/assets/DateField-C66BK-20.js similarity index 56% rename from sb8/qa/assets/DateField-DwoRhm2C.js rename to sb8/qa/assets/DateField-C66BK-20.js index ebed54bff7..36a86bad1a 100644 --- a/sb8/qa/assets/DateField-DwoRhm2C.js +++ b/sb8/qa/assets/DateField-C66BK-20.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-CH7MCt8u.js";import{s as d}from"./DateField.stories-DmGTKoOW.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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"./formUtils-C-50Qw-d.js";import"./FormFieldText.styled-hkDOkrrs.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-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./index-jWylWF_w.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-Dn-MWZ_m.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-yhdXyTld.js";import"./formats-CDjt32hU.js";import"./Dialog-BlwzXIwM.js";import"./useMediaQuery-CguehUMS.js";import"./SideNav-biYpQHtM.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.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-VPsM0GyV.js";import{s as d}from"./DateField.stories-DnT7uto3.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-Cf-5vk95.js";import"./theme-DRtZtbPc.js";import"./SideNav-biYpQHtM.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./FormFieldText.styled-hkDOkrrs.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"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./index-DnvaddO_.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-gVxq6Y0Z.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-yhdXyTld.js";import"./formats-CDjt32hU.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-DmGTKoOW.js b/sb8/qa/assets/DateField.stories-DnT7uto3.js similarity index 54% rename from sb8/qa/assets/DateField.stories-DmGTKoOW.js rename to sb8/qa/assets/DateField.stories-DnT7uto3.js index badf84e43a..39be4fbbeb 100644 --- a/sb8/qa/assets/DateField.stories-DmGTKoOW.js +++ b/sb8/qa/assets/DateField.stories-DnT7uto3.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,t as _,F as y}from"./formUtils-C-50Qw-d.js";import"./Button-Do5OxnZO.js";import{r as w}from"./renderButtons-BmHfsf_z.js";import{D as M}from"./formats-CDjt32hU.js";const N={title:"FormFields/FormFieldDateField"},V={date:new Date(2024,12,25,11,30)},r=({label:i,required:t,skeleton:m,disabled:n,instructionText:a,prepopulate:d,helperText:s,showTime:u,minDateStr:l,defaultTime:c})=>{const T=F(),{state:q,handleSubmit:j}=T,k=p.useMemo(()=>d?async()=>V:void 0,[d]),f=l&&_(l,M)?new Date(Number(l.split("/")[2]),Number(l.split("/")[1])-1,Number(l.split("/")[0])):void 0,O=p.useMemo(()=>[{name:"date",type:"date",label:i,required:t,disabled:n,helperText:s,instructionText:a,inputSettings:{showTime:u,minDate:f,defaultTime:c}}],[i,t,n,s,a,u,f,c]);return e.jsxs(e.Fragment,{children:[e.jsx("pre",{children:JSON.stringify(q,null," ")}),e.jsx(y,{...T,buttons:w(j),title:"Date Field",fields:O,skeleton:m,getFormValues:k})]})};r.args={label:"Label",disabled:!1,required:!1,skeleton:!1,instructionText:"Instruction text",prepopulate:!1,helperText:"Helper text",showTime:!1,minDateStr:"",defaultTime:""};r.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 v=async()=>({dateTimePrefilled:new Date("2023-07-31T14:00:00.000Z")}),o=()=>{const i=F(),{state:t,handleSubmit:m}=i,n="Helper text",a="Instruction text",d=p.useMemo(()=>[{name:"singleDate",type:"date",label:"Single Date Calendar",required:!1,disabled:!1,helperText:n,instructionText:a,inputSettings:{showTime:!1}},{name:"dateTime",type:"date",label:"Date Time Input",required:!1,disabled:!1,helperText:n,instructionText:a,inputSettings:{showTime:!0}},{name:"dateTimePrefilled",type:"date",label:"Date Time with preset values",required:!1,disabled:!1,helperText:n,instructionText:a,inputSettings:{showTime:!0}},{name:"requiredDateTime",type:"date",label:"Required Single Date Calendar",required:!0,disabled:!1,helperText:n,instructionText:a,inputSettings:{showTime:!0}}],[]);return e.jsxs(e.Fragment,{children:[e.jsx(y,{...i,buttons:w(m),title:"Date Field Calendar",description:"This is a description example",fields:d,getFormValues:v}),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,b;r.parameters={...r.parameters,docs:{...(h=r.parameters)==null?void 0:h.docs,source:{originalSource:`({ +import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as p}from"./index-BP8_t0zE.js";import{u as F,t as _,F as y}from"./Form-Cf-5vk95.js";import{r as w}from"./renderButtons-BmHfsf_z.js";import{D as M}from"./formats-CDjt32hU.js";const N={title:"FormFields/FormFieldDateField"},V={date:new Date(2024,12,25,11,30)},r=({label:i,required:t,skeleton:m,disabled:n,instructionText:a,prepopulate:d,helperText:s,showTime:u,minDateStr:l,defaultTime:c})=>{const T=F(),{state:q,handleSubmit:j}=T,k=p.useMemo(()=>d?async()=>V:void 0,[d]),f=l&&_(l,M)?new Date(Number(l.split("/")[2]),Number(l.split("/")[1])-1,Number(l.split("/")[0])):void 0,O=p.useMemo(()=>[{name:"date",type:"date",label:i,required:t,disabled:n,helperText:s,instructionText:a,inputSettings:{showTime:u,minDate:f,defaultTime:c}}],[i,t,n,s,a,u,f,c]);return e.jsxs(e.Fragment,{children:[e.jsx("pre",{children:JSON.stringify(q,null," ")}),e.jsx(y,{...T,buttons:w(j),title:"Date Field",fields:O,skeleton:m,getFormValues:k})]})};r.args={label:"Label",disabled:!1,required:!1,skeleton:!1,instructionText:"Instruction text",prepopulate:!1,helperText:"Helper text",showTime:!1,minDateStr:"",defaultTime:""};r.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 v=async()=>({dateTimePrefilled:new Date("2023-07-31T14:00:00.000Z")}),o=()=>{const i=F(),{state:t,handleSubmit:m}=i,n="Helper text",a="Instruction text",d=p.useMemo(()=>[{name:"singleDate",type:"date",label:"Single Date Calendar",required:!1,disabled:!1,helperText:n,instructionText:a,inputSettings:{showTime:!1}},{name:"dateTime",type:"date",label:"Date Time Input",required:!1,disabled:!1,helperText:n,instructionText:a,inputSettings:{showTime:!0}},{name:"dateTimePrefilled",type:"date",label:"Date Time with preset values",required:!1,disabled:!1,helperText:n,instructionText:a,inputSettings:{showTime:!0}},{name:"requiredDateTime",type:"date",label:"Required Single Date Calendar",required:!0,disabled:!1,helperText:n,instructionText:a,inputSettings:{showTime:!0}}],[]);return e.jsxs(e.Fragment,{children:[e.jsx(y,{...i,buttons:w(m),title:"Date Field Calendar",description:"This is a description example",fields:d,getFormValues:v}),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,b;r.parameters={...r.parameters,docs:{...(h=r.parameters)==null?void 0:h.docs,source:{originalSource:`({ label, required, skeleton, @@ -102,4 +102,4 @@ import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as p}from"./index-BP8_t0z

State

{JSON.stringify(state, null, "  ")}
; -}`,...(S=(D=o.parameters)==null?void 0:D.docs)==null?void 0:S.source}}};const I=["Playground","KitchenSink"],H=Object.freeze(Object.defineProperty({__proto__:null,KitchenSink:o,Playground:r,__namedExportsOrder:I,default:N},Symbol.toStringTag,{value:"Module"}));export{H as s}; +}`,...(S=(D=o.parameters)==null?void 0:D.docs)==null?void 0:S.source}}};const I=["Playground","KitchenSink"],A=Object.freeze(Object.defineProperty({__proto__:null,KitchenSink:o,Playground:r,__namedExportsOrder:I,default:N},Symbol.toStringTag,{value:"Module"}));export{A as s}; diff --git a/sb8/qa/assets/Dialog-Dp7ZqmKn.js b/sb8/qa/assets/Dialog-B3aKLHkF.js similarity index 91% rename from sb8/qa/assets/Dialog-Dp7ZqmKn.js rename to sb8/qa/assets/Dialog-B3aKLHkF.js index 34f36b0e97..f03cfde532 100644 --- a/sb8/qa/assets/Dialog-Dp7ZqmKn.js +++ b/sb8/qa/assets/Dialog-B3aKLHkF.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-CH7MCt8u.js";import{s as p,P as a}from"./Dialog.stories-BqcE-Bi-.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-BlwzXIwM.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-VPsM0GyV.js";import{s as p,P as a}from"./Dialog.stories-BBjxYkPe.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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/Dialog-BlwzXIwM.js b/sb8/qa/assets/Dialog-BlwzXIwM.js deleted file mode 100644 index d50e67c88b..0000000000 --- a/sb8/qa/assets/Dialog-BlwzXIwM.js +++ /dev/null @@ -1,29 +0,0 @@ -import{j as r}from"./jsx-runtime-nGUw9YhZ.js";import{B as G}from"./Button-Do5OxnZO.js";import{s as T,t as h}from"./theme-DRtZtbPc.js";import{a as b,g as y,s as g,d as t,u as M,_ as $,e as m,f as S,b as d}from"./generateUtilityClasses-DAcHHM0W.js";import{r as u}from"./index-BP8_t0zE.js";import{B as J,M as Q,P as N,u as Z,F as oo}from"./Popper-CPbWUqAP.js";import{u as eo}from"./useId-DLncWxdO.js";function io(o){return y("MuiDialogActions",o)}b("MuiDialogActions",["root","spacing"]);const ao=["className","disableSpacing"],to=o=>{const{classes:e,disableSpacing:i}=o;return S({root:["root",!i&&"spacing"]},io,e)},so=g("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:i}=o;return[e.root,!i.disableSpacing&&e.spacing]}})(({ownerState:o})=>t({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!o.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),ro=u.forwardRef(function(e,i){const a=M({props:e,name:"MuiDialogActions"}),{className:s,disableSpacing:n=!1}=a,l=$(a,ao),c=t({},a,{disableSpacing:n}),x=to(c);return r.jsx(so,t({className:m(x.root,s),ownerState:c,ref:i},l))});function no(o){return y("MuiDialogContent",o)}b("MuiDialogContent",["root","dividers"]);const lo=b("MuiDialogTitle",["root"]),co=["className","dividers"],po=o=>{const{classes:e,dividers:i}=o;return S({root:["root",i&&"dividers"]},no,e)},uo=g("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:i}=o;return[e.root,i.dividers&&e.dividers]}})(({theme:o,ownerState:e})=>t({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(o.vars||o).palette.divider}`,borderBottom:`1px solid ${(o.vars||o).palette.divider}`}:{[`.${lo.root} + &`]:{paddingTop:0}})),go=u.forwardRef(function(e,i){const a=M({props:e,name:"MuiDialogContent"}),{className:s,dividers:n=!1}=a,l=$(a,co),c=t({},a,{dividers:n}),x=po(c);return r.jsx(uo,t({className:m(x.root,s),ownerState:c,ref:i},l))});function xo(o){return y("MuiDialog",o)}const W=b("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),mo=u.createContext({}),fo=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],ho=g(J,{name:"MuiDialog",slot:"Backdrop",overrides:(o,e)=>e.backdrop})({zIndex:-1}),bo=o=>{const{classes:e,scroll:i,maxWidth:a,fullWidth:s,fullScreen:n}=o,l={root:["root"],container:["container",`scroll${d(i)}`],paper:["paper",`paperScroll${d(i)}`,`paperWidth${d(String(a))}`,s&&"paperFullWidth",n&&"paperFullScreen"]};return S(l,xo,e)},Do=g(Q,{name:"MuiDialog",slot:"Root",overridesResolver:(o,e)=>e.root})({"@media print":{position:"absolute !important"}}),Co=g("div",{name:"MuiDialog",slot:"Container",overridesResolver:(o,e)=>{const{ownerState:i}=o;return[e.container,e[`scroll${d(i.scroll)}`]]}})(({ownerState:o})=>t({height:"100%","@media print":{height:"auto"},outline:0},o.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},o.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),vo=g(N,{name:"MuiDialog",slot:"Paper",overridesResolver:(o,e)=>{const{ownerState:i}=o;return[e.paper,e[`scrollPaper${d(i.scroll)}`],e[`paperWidth${d(String(i.maxWidth))}`],i.fullWidth&&e.paperFullWidth,i.fullScreen&&e.paperFullScreen]}})(({theme:o,ownerState:e})=>t({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:o.breakpoints.unit==="px"?Math.max(o.breakpoints.values.xs,444):`max(${o.breakpoints.values.xs}${o.breakpoints.unit}, 444px)`,[`&.${W.paperScrollBody}`]:{[o.breakpoints.down(Math.max(o.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${o.breakpoints.values[e.maxWidth]}${o.breakpoints.unit}`,[`&.${W.paperScrollBody}`]:{[o.breakpoints.down(o.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${W.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),ko=u.forwardRef(function(e,i){const a=M({props:e,name:"MuiDialog"}),s=Z(),n={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{"aria-describedby":l,"aria-labelledby":c,BackdropComponent:x,BackdropProps:F,children:U,className:_,disableEscapeKeyDown:P=!1,fullScreen:I=!1,fullWidth:L=!1,maxWidth:z="sm",onBackdropClick:B,onClick:w,onClose:D,open:j,PaperComponent:E=N,PaperProps:R={},scroll:Y="paper",TransitionComponent:X=oo,transitionDuration:A=n,TransitionProps:H}=a,K=$(a,fo),f=t({},a,{disableEscapeKeyDown:P,fullScreen:I,fullWidth:L,maxWidth:z,scroll:Y}),C=bo(f),v=u.useRef(),O=p=>{v.current=p.target===p.currentTarget},V=p=>{w&&w(p),v.current&&(v.current=null,B&&B(p),D&&D(p,"backdropClick"))},k=eo(c),q=u.useMemo(()=>({titleId:k}),[k]);return r.jsx(Do,t({className:m(C.root,_),closeAfterTransition:!0,components:{Backdrop:ho},componentsProps:{backdrop:t({transitionDuration:A,as:x},F)},disableEscapeKeyDown:P,onClose:D,open:j,ref:i,onClick:V,ownerState:f},K,{children:r.jsx(X,t({appear:!0,in:j,timeout:A,role:"presentation"},H,{children:r.jsx(Co,{className:m(C.container),onMouseDown:O,ownerState:f,children:r.jsx(vo,t({as:E,elevation:24,role:"dialog","aria-describedby":l,"aria-labelledby":k},R,{className:m(C.paper,R.className),ownerState:f,children:r.jsx(mo.Provider,{value:q,children:U})}))})}))}))}),Wo=T(ko)` -z-index: 99999 !important; - font-family: ${h.fontFamily}; - - .MuiDialogContent-root { - border-bottom: 2px solid ${h.newColors.grey2[100]}; - } - - .MuiPaper-rounded { - border-radius: 0; - } - - .MuiDialogContent-root { - padding: 0px 30px 40px 30px; - } - - .MuiDialogActions-root { - padding: 20px 20px; - } - - .MuiDialogActions-spacing > :not(:first-child) { - margin-left: 20px; - } -`,yo=T.div` - color: ${h.newColors.almostBlack[100]}; - font-size: 20px; - font-weight: ${h.fontWeight.medium}; - padding: 40px 30px 24px 30px; -`,Ro=o=>{const{children:e,dialogTitle:i,open:a,buttons:s}=o;return r.jsxs(Wo,{open:a,children:[r.jsx(yo,{children:i}),r.jsx(go,{children:e}),r.jsx(ro,{children:s==null?void 0:s.map((n,l)=>r.jsx(G,{...n},`${n.label}-${l}`))})]})};export{Ro as D,ro as a,ko as b,go as c,W as d}; diff --git a/sb8/qa/assets/Dialog-DXK7hw4q.js b/sb8/qa/assets/Dialog-DXK7hw4q.js new file mode 100644 index 0000000000..2ceccea46c --- /dev/null +++ b/sb8/qa/assets/Dialog-DXK7hw4q.js @@ -0,0 +1,29 @@ +import{j as r}from"./jsx-runtime-nGUw9YhZ.js";import{B as G}from"./Button-Do5OxnZO.js";import{s as T,t as h}from"./theme-DRtZtbPc.js";import{a as b,g as y,s as g,b as d,d as t,u as M,_ as $,e as m,f as S}from"./generateUtilityClasses-DAcHHM0W.js";import{r as u}from"./index-BP8_t0zE.js";import{B as J,M as Q,P as N,u as Z,F as oo}from"./Popper-CPbWUqAP.js";import{u as eo}from"./useId-DLncWxdO.js";function io(o){return y("MuiDialog",o)}const W=b("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),ao=u.createContext({}),to=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],so=g(J,{name:"MuiDialog",slot:"Backdrop",overrides:(o,e)=>e.backdrop})({zIndex:-1}),ro=o=>{const{classes:e,scroll:i,maxWidth:a,fullWidth:s,fullScreen:n}=o,l={root:["root"],container:["container",`scroll${d(i)}`],paper:["paper",`paperScroll${d(i)}`,`paperWidth${d(String(a))}`,s&&"paperFullWidth",n&&"paperFullScreen"]};return S(l,io,e)},no=g(Q,{name:"MuiDialog",slot:"Root",overridesResolver:(o,e)=>e.root})({"@media print":{position:"absolute !important"}}),lo=g("div",{name:"MuiDialog",slot:"Container",overridesResolver:(o,e)=>{const{ownerState:i}=o;return[e.container,e[`scroll${d(i.scroll)}`]]}})(({ownerState:o})=>t({height:"100%","@media print":{height:"auto"},outline:0},o.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},o.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),co=g(N,{name:"MuiDialog",slot:"Paper",overridesResolver:(o,e)=>{const{ownerState:i}=o;return[e.paper,e[`scrollPaper${d(i.scroll)}`],e[`paperWidth${d(String(i.maxWidth))}`],i.fullWidth&&e.paperFullWidth,i.fullScreen&&e.paperFullScreen]}})(({theme:o,ownerState:e})=>t({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:o.breakpoints.unit==="px"?Math.max(o.breakpoints.values.xs,444):`max(${o.breakpoints.values.xs}${o.breakpoints.unit}, 444px)`,[`&.${W.paperScrollBody}`]:{[o.breakpoints.down(Math.max(o.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${o.breakpoints.values[e.maxWidth]}${o.breakpoints.unit}`,[`&.${W.paperScrollBody}`]:{[o.breakpoints.down(o.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${W.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),po=u.forwardRef(function(e,i){const a=M({props:e,name:"MuiDialog"}),s=Z(),n={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{"aria-describedby":l,"aria-labelledby":c,BackdropComponent:x,BackdropProps:F,children:U,className:_,disableEscapeKeyDown:P=!1,fullScreen:I=!1,fullWidth:L=!1,maxWidth:z="sm",onBackdropClick:B,onClick:w,onClose:D,open:j,PaperComponent:E=N,PaperProps:R={},scroll:Y="paper",TransitionComponent:X=oo,transitionDuration:A=n,TransitionProps:H}=a,K=$(a,to),f=t({},a,{disableEscapeKeyDown:P,fullScreen:I,fullWidth:L,maxWidth:z,scroll:Y}),C=ro(f),v=u.useRef(),O=p=>{v.current=p.target===p.currentTarget},V=p=>{w&&w(p),v.current&&(v.current=null,B&&B(p),D&&D(p,"backdropClick"))},k=eo(c),q=u.useMemo(()=>({titleId:k}),[k]);return r.jsx(no,t({className:m(C.root,_),closeAfterTransition:!0,components:{Backdrop:so},componentsProps:{backdrop:t({transitionDuration:A,as:x},F)},disableEscapeKeyDown:P,onClose:D,open:j,ref:i,onClick:V,ownerState:f},K,{children:r.jsx(X,t({appear:!0,in:j,timeout:A,role:"presentation"},H,{children:r.jsx(lo,{className:m(C.container),onMouseDown:O,ownerState:f,children:r.jsx(co,t({as:E,elevation:24,role:"dialog","aria-describedby":l,"aria-labelledby":k},R,{className:m(C.paper,R.className),ownerState:f,children:r.jsx(ao.Provider,{value:q,children:U})}))})}))}))});function uo(o){return y("MuiDialogActions",o)}b("MuiDialogActions",["root","spacing"]);const go=["className","disableSpacing"],xo=o=>{const{classes:e,disableSpacing:i}=o;return S({root:["root",!i&&"spacing"]},uo,e)},mo=g("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:i}=o;return[e.root,!i.disableSpacing&&e.spacing]}})(({ownerState:o})=>t({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!o.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),fo=u.forwardRef(function(e,i){const a=M({props:e,name:"MuiDialogActions"}),{className:s,disableSpacing:n=!1}=a,l=$(a,go),c=t({},a,{disableSpacing:n}),x=xo(c);return r.jsx(mo,t({className:m(x.root,s),ownerState:c,ref:i},l))});function ho(o){return y("MuiDialogContent",o)}b("MuiDialogContent",["root","dividers"]);const bo=b("MuiDialogTitle",["root"]),Do=["className","dividers"],Co=o=>{const{classes:e,dividers:i}=o;return S({root:["root",i&&"dividers"]},ho,e)},vo=g("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:i}=o;return[e.root,i.dividers&&e.dividers]}})(({theme:o,ownerState:e})=>t({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(o.vars||o).palette.divider}`,borderBottom:`1px solid ${(o.vars||o).palette.divider}`}:{[`.${bo.root} + &`]:{paddingTop:0}})),ko=u.forwardRef(function(e,i){const a=M({props:e,name:"MuiDialogContent"}),{className:s,dividers:n=!1}=a,l=$(a,Do),c=t({},a,{dividers:n}),x=Co(c);return r.jsx(vo,t({className:m(x.root,s),ownerState:c,ref:i},l))}),Wo=T(po)` +z-index: 99999 !important; + font-family: ${h.fontFamily}; + + .MuiDialogContent-root { + border-bottom: 2px solid ${h.newColors.grey2[100]}; + } + + .MuiPaper-rounded { + border-radius: 0; + } + + .MuiDialogContent-root { + padding: 0px 30px 40px 30px; + } + + .MuiDialogActions-root { + padding: 20px 20px; + } + + .MuiDialogActions-spacing > :not(:first-child) { + margin-left: 20px; + } +`,yo=T.div` + color: ${h.newColors.almostBlack[100]}; + font-size: 20px; + font-weight: ${h.fontWeight.medium}; + padding: 40px 30px 24px 30px; +`,Ro=o=>{const{children:e,dialogTitle:i,open:a,buttons:s}=o;return r.jsxs(Wo,{open:a,children:[r.jsx(yo,{children:i}),r.jsx(ko,{children:e}),r.jsx(fo,{children:s==null?void 0:s.map((n,l)=>r.jsx(G,{...n},`${n.label}-${l}`))})]})};export{Ro as D,fo as a,po as b,ko as c,W as d}; diff --git a/sb8/qa/assets/Dialog.stories-BqcE-Bi-.js b/sb8/qa/assets/Dialog.stories-BBjxYkPe.js similarity index 97% rename from sb8/qa/assets/Dialog.stories-BqcE-Bi-.js rename to sb8/qa/assets/Dialog.stories-BBjxYkPe.js index d62ab75937..c2c74c9999 100644 --- a/sb8/qa/assets/Dialog.stories-BqcE-Bi-.js +++ b/sb8/qa/assets/Dialog.stories-BBjxYkPe.js @@ -1,4 +1,4 @@ -import{j as n}from"./jsx-runtime-nGUw9YhZ.js";import{r as m}from"./index-BP8_t0zE.js";import{D as g}from"./Dialog-BlwzXIwM.js";import{B as y}from"./Button-Do5OxnZO.js";const b={title:"Components/Dialog"},e=({dialogContent:r,dialogTitle:i,primaryBtnLabel:s,secondaryBtnLabel:c})=>{const[p,t]=m.useState(!1),u=()=>{t(!0)},d=[{label:c,onClick:()=>{t(!1)},color:"gray",variant:"outlined"},{label:s,onClick:()=>{alert("The primary button was clicked"),t(!1)},color:"yellow",variant:"contained"}];return n.jsxs(n.Fragment,{children:[n.jsx(y,{color:"yellow",variant:"contained",onClick:u,label:"Open Dialog",muiAttrs:{disableRipple:!0}}),n.jsx(g,{dialogTitle:i,open:p,buttons:d,children:r})]})};e.args={dialogContent:`Assumenda maiores aut laudantium earum nesciunt. Nihil et deserunt in +import{j as n}from"./jsx-runtime-nGUw9YhZ.js";import{r as m}from"./index-BP8_t0zE.js";import{D as g}from"./Dialog-DXK7hw4q.js";import{B as y}from"./Button-Do5OxnZO.js";const b={title:"Components/Dialog"},e=({dialogContent:r,dialogTitle:i,primaryBtnLabel:s,secondaryBtnLabel:c})=>{const[p,t]=m.useState(!1),u=()=>{t(!0)},d=[{label:c,onClick:()=>{t(!1)},color:"gray",variant:"outlined"},{label:s,onClick:()=>{alert("The primary button was clicked"),t(!1)},color:"yellow",variant:"contained"}];return n.jsxs(n.Fragment,{children:[n.jsx(y,{color:"yellow",variant:"contained",onClick:u,label:"Open Dialog",muiAttrs:{disableRipple:!0}}),n.jsx(g,{dialogTitle:i,open:p,buttons:d,children:r})]})};e.args={dialogContent:`Assumenda maiores aut laudantium earum nesciunt. Nihil et deserunt in sed numquam. Sed ut ex ex et eius sunt nisi eum adipisci. Animi quaerat expedita. Aut quis quas minus sed asperiores dolores asperiores excepturi. Non corporis qui doloremque ea voluptas voluptatem repellat. diff --git a/sb8/qa/assets/DocsRenderer-K4EAMTCU-D3kM3CPU.js b/sb8/qa/assets/DocsRenderer-K4EAMTCU-CP7yVtjF.js similarity index 86% rename from sb8/qa/assets/DocsRenderer-K4EAMTCU-D3kM3CPU.js rename to sb8/qa/assets/DocsRenderer-K4EAMTCU-CP7yVtjF.js index 9f4736a814..328c2eaa4b 100644 --- a/sb8/qa/assets/DocsRenderer-K4EAMTCU-D3kM3CPU.js +++ b/sb8/qa/assets/DocsRenderer-K4EAMTCU-CP7yVtjF.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-bbO8NbQM.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-CH7MCt8u.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-DkhhG_xI.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-VPsM0GyV.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-CbQyQbSm.js b/sb8/qa/assets/DrawerForm.stories-BKCZpnS_.js similarity index 81% rename from sb8/qa/assets/DrawerForm.stories-CbQyQbSm.js rename to sb8/qa/assets/DrawerForm.stories-BKCZpnS_.js index b92f6c98f7..0d3a9fb946 100644 --- a/sb8/qa/assets/DrawerForm.stories-CbQyQbSm.js +++ b/sb8/qa/assets/DrawerForm.stories-BKCZpnS_.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"./formUtils-C-50Qw-d.js";import{B as k}from"./Button-Do5OxnZO.js";import{D as A}from"./ColorSelected-Dn-MWZ_m.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"./FormFieldText.styled-hkDOkrrs.js";import"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./useIsFocusVisible-De2ftVE9.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./index-BxmsGmlx.js";import"./index-jWylWF_w.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./ButtonBase-BZmvw3BH.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.js";import"./useToggle-lipGlewK.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-CvnKr_oj.js";import"./formats-CDjt32hU.js";import"./Dialog-BlwzXIwM.js";import"./useMediaQuery-CguehUMS.js";import"./containerQuery-C0QVV4Kt.js";import"./SideNav-biYpQHtM.js";import"./TooltipIcon-CO3K7ssQ.js";import"./PageHeader-yhdXyTld.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"./MoreVert-BbmWEP2K.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-Cf-5vk95.js";import{B as k}from"./Button-Do5OxnZO.js";import{D as A}from"./ColorSelected-gVxq6Y0Z.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-biYpQHtM.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./useIsFocusVisible-De2ftVE9.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./index-BxmsGmlx.js";import"./index-DnvaddO_.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./ButtonBase-BZmvw3BH.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./formats-CDjt32hU.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-yhdXyTld.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-8MVt-OPV.js b/sb8/qa/assets/Drawers-DqzFA2Di.js similarity index 73% rename from sb8/qa/assets/Drawers-8MVt-OPV.js rename to sb8/qa/assets/Drawers-DqzFA2Di.js index ebb3487b3f..070db3ced6 100644 --- a/sb8/qa/assets/Drawers-8MVt-OPV.js +++ b/sb8/qa/assets/Drawers-DqzFA2Di.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-CH7MCt8u.js";import{s,P as p}from"./Drawers.stories-Zb904J7G.js";import"./index-BP8_t0zE.js";import"./iframe-bbO8NbQM.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-0JjUebaP.js";import"./theme-DRtZtbPc.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"./formUtils-C-50Qw-d.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./Button-Do5OxnZO.js";import"./ButtonBase-BZmvw3BH.js";import"./useToggle-lipGlewK.js";import"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./index-jWylWF_w.js";import"./CheckboxList-DtvbyO8j.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-Dn-MWZ_m.js";import"./TitleWrapper-D2l-_w9e.js";import"./containerQuery-C0QVV4Kt.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./PageHeader-yhdXyTld.js";import"./formats-CDjt32hU.js";import"./Dialog-BlwzXIwM.js";import"./useMediaQuery-CguehUMS.js";import"./SideNav-biYpQHtM.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.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-VPsM0GyV.js";import{s,P as p}from"./Drawers.stories-C7Utxi0Z.js";import"./index-BP8_t0zE.js";import"./iframe-DkhhG_xI.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-0JjUebaP.js";import"./theme-DRtZtbPc.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-Cf-5vk95.js";import"./SideNav-biYpQHtM.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./FormFieldText.styled-hkDOkrrs.js";import"./Button-Do5OxnZO.js";import"./ButtonBase-BZmvw3BH.js";import"./testIds-D6Gx1A0F.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./index-DnvaddO_.js";import"./CheckboxList-BmT12QDz.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-BN-KUs9r.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./debounce-C_xMouBr.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-Btt3uSwF.js";import"./ButtonRow-B3IWj8ab.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-CvnKr_oj.js";import"./ColorSelected-gVxq6Y0Z.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./PageHeader-yhdXyTld.js";import"./formats-CDjt32hU.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-C7Utxi0Z.js b/sb8/qa/assets/Drawers.stories-C7Utxi0Z.js new file mode 100644 index 0000000000..c88654a0c4 --- /dev/null +++ b/sb8/qa/assets/Drawers.stories-C7Utxi0Z.js @@ -0,0 +1,70 @@ +import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as o}from"./index-BP8_t0zE.js";import{D as f}from"./Drawers-0JjUebaP.js";import{u as x,F as b}from"./Form-Cf-5vk95.js";import{P as D}from"./PageHeader-yhdXyTld.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: [] + }); + const addDrawer = useCallback((drawerDef: DrawerDef) => { + setState(state => ({ + ...state, + drawers: [...state.drawers, drawerDef] + })); + }, []); + const removeDrawer = useCallback(() => { + setState(state => ({ + ...state, + drawers: [...state.drawers.slice(0, -1)] + })); + }, []); + const appContext = useMemo(() => ({ + addDrawer, + removeDrawer + }), [addDrawer, removeDrawer]); + return +
+

Drawer Demo

+

+ From Form: + {JSON.stringify(state.content)} +

+ + + {drawerDef => { + return ; + }} + +
+
; +}`,...(w=(p=c.parameters)==null?void 0:p.docs)==null?void 0:w.source}}};const j=["Playground"],A=Object.freeze(Object.defineProperty({__proto__:null,Playground:c,__namedExportsOrder:j,default:F},Symbol.toStringTag,{value:"Module"}));export{c as P,A as s}; diff --git a/sb8/qa/assets/Drawers.stories-Zb904J7G.js b/sb8/qa/assets/Drawers.stories-Zb904J7G.js deleted file mode 100644 index 35e83b2824..0000000000 --- a/sb8/qa/assets/Drawers.stories-Zb904J7G.js +++ /dev/null @@ -1,70 +0,0 @@ -import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as o}from"./index-BP8_t0zE.js";import{D as f}from"./Drawers-0JjUebaP.js";import{u as x,F as b}from"./formUtils-C-50Qw-d.js";import"./Button-Do5OxnZO.js";import{P as D}from"./PageHeader-yhdXyTld.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: [] - }); - const addDrawer = useCallback((drawerDef: DrawerDef) => { - setState(state => ({ - ...state, - drawers: [...state.drawers, drawerDef] - })); - }, []); - const removeDrawer = useCallback(() => { - setState(state => ({ - ...state, - drawers: [...state.drawers.slice(0, -1)] - })); - }, []); - const appContext = useMemo(() => ({ - addDrawer, - removeDrawer - }), [addDrawer, removeDrawer]); - return -
-

Drawer Demo

-

- From Form: - {JSON.stringify(state.content)} -

- - - {drawerDef => { - return ; - }} - -
-
; -}`,...(w=(p=c.parameters)==null?void 0:p.docs)==null?void 0:w.source}}};const j=["Playground"],N=Object.freeze(Object.defineProperty({__proto__:null,Playground:c,__namedExportsOrder:j,default:F},Symbol.toStringTag,{value:"Module"}));export{c as P,N as s}; diff --git a/sb8/qa/assets/formUtils-C-50Qw-d.js b/sb8/qa/assets/Form-Cf-5vk95.js similarity index 62% rename from sb8/qa/assets/formUtils-C-50Qw-d.js rename to sb8/qa/assets/Form-Cf-5vk95.js index 93a0e41f76..4554bd49b8 100644 --- a/sb8/qa/assets/formUtils-C-50Qw-d.js +++ b/sb8/qa/assets/Form-Cf-5vk95.js @@ -1,26 +1,26 @@ -var ok=Object.defineProperty;var ik=(n,e,t)=>e in n?ok(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ya=(n,e,t)=>ik(n,typeof e!="symbol"?e+"":e,t);import{j as v,r as St}from"./jsx-runtime-nGUw9YhZ.js";import{g as ef,a as A,r as h,c as Ja}from"./index-BP8_t0zE.js";import{S as Yc,I as sb,F as ab,i as Du,b as Mo,o as Vm,f as pi,A as sk,T as tf,c as ak}from"./FormFieldText.styled-hkDOkrrs.js";import{D as lk,d as ck,a as uk,I as sa}from"./index-jWylWF_w.js";import{S as Xe,B as Ca,a as _l}from"./ButtonRow-B3IWj8ab.js";import{s as Y,C as lb,t as j,B as dk,n as bo}from"./theme-DRtZtbPc.js";import{C as pk,l as cb,k as fk,A as hk,r as ub,B as db,D as mk,o as gk,E as pb,F as vk,G as yk,H as bk,I as xk,J as nf,K as fb,b as hb,L as wk,M as Ck,N as Sk,O as kk}from"./CheckboxList-DtvbyO8j.js";import{_ as tt,d as K,T as Mk,L as Ek,H as Tk,I as Fd,i as kt,a as At,g as kn,s as Me,u as Qo,M as Ok,e as _n,f as Mn,b as Sa,j as Ru,E as Lk,z as Jc,y as rf,N as Ak}from"./generateUtilityClasses-DAcHHM0W.js";import{r as Mt}from"./createSvgIcon-CcHL1II5.js";import{d as mb,C as jd,a as Pk}from"./Chip-Btt3uSwF.js";import{S as wt}from"./sizes-C6oSOElx.js";import{c as Vr}from"./createSvgIcon-CPgMIgId.js";import{P as Dk,u as of,T as sf,B as ln,I as xo,d as Ts,G as Rk,e as Ik}from"./Button-Do5OxnZO.js";import{f as $k,T as gb,R as Nk,u as cs,g as Um,h as Bk,m as Fk,j as jk,P as ka,a as ei,k as _k,F as vb}from"./Popper-CPbWUqAP.js";import{u as af}from"./useId-DLncWxdO.js";import{u as Yi}from"./useControlled-im5M3O13.js";import{_ as zk,c as De,d as Hk,u as _r,a as Os,s as Vk,b as lf}from"./useIsFocusVisible-De2ftVE9.js";import{d as cf}from"./DataViewPrimaryFilter.styled-CylNlUs-.js";import{a as Uk,R as Wk}from"./RadioButton-CO2cFro8.js";import{T as Gk}from"./Toggle-CvnKr_oj.js";import{b as yb,d as Zc,i as uf,_ as Kk,c as qk}from"./isSymbol-CEVJpixJ.js";import{r as Be,t as Re,f as Hi,D as df,b as Yk,_ as bb,c as Jk,C as Zk,P as Xk,g as Qk,s as _d,d as xb,e as eM,h as Lt,i as tM,j as Xc,l as Wm,k as nM,n as Gm,o as rM,p as oM,q as zd,u as wb,v as Cb,w as pf,x as Jr,a as iM,y as sM,z as wl,A as aM,B as zl}from"./ColorSelected-Dn-MWZ_m.js";import{b as lM,c as Km,e as cM,f as st,g as rt,h as Te,i as ot,_ as uM}from"./useMosaicTranslation-CZCb37QS.js";import{D as Vi,b as Sb,T as ff,c as kb}from"./formats-CDjt32hU.js";import{u as dM,T as mo}from"./FormControlLabel-n1qioM9o.js";import{D as hf,a as pM,b as fM,d as qm,c as hM}from"./Dialog-BlwzXIwM.js";import{o as Iu}from"./ownerWindow-DvT1GKkC.js";import{B as Mb,T as Eb}from"./ButtonBase-BZmvw3BH.js";import{u as mM}from"./useTheme-5hcycNQy.js";import{u as gM}from"./useMediaQuery-CguehUMS.js";import{c as Nt}from"./containerQuery-C0QVV4Kt.js";import{S as vM}from"./SideNav-biYpQHtM.js";import{r as ti,R as yM}from"./index-BxmsGmlx.js";import{g as Cl}from"./useToggle-lipGlewK.js";import{T as bM,F as mf,B as Hd}from"./TooltipIcon-CO3K7ssQ.js";import{P as xM}from"./PageHeader-yhdXyTld.js";import{S as gf}from"./Snackbar-J6gNQC5v.js";import{S as vf}from"./Spinner-DgupAfKo.js";import{T as wM}from"./Typography-Br_RMLnS.js";import{t as Mr}from"./testIds-D6Gx1A0F.js";import{C as CM}from"./ClickAwayListener-DnjBLK-5.js";import{d as SM}from"./MoreVert-BbmWEP2K.js";import{D as Tb,a as kM,b as MM}from"./TitleWrapper-D2l-_w9e.js";import{T as EM}from"./TitleText-C9TlfF_O.js";import{d as TM}from"./debounce-C_xMouBr.js";var Ob={exports:{}},OM="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",LM=OM,AM=LM;function Lb(){}function Ab(){}Ab.resetWarningCache=Lb;var PM=function(){function n(r,o,i,s,a,l){if(l!==AM){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}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Ab,resetWarningCache:Lb};return t.PropTypes=t,t};Ob.exports=PM();var Pb=Ob.exports;const Se=ef(Pb);function DM(n,e){return n.classList?!!e&&n.classList.contains(e):(" "+(n.className.baseVal||n.className)+" ").indexOf(" "+e+" ")!==-1}function RM(n,e){n.classList?n.classList.add(e):DM(n,e)||(typeof n.className=="string"?n.className=n.className+" "+e:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+e))}function Ym(n,e){return n.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function IM(n,e){n.classList?n.classList.remove(e):typeof n.className=="string"?n.className=Ym(n.className,e):n.setAttribute("class",Ym(n.className&&n.className.baseVal||"",e))}var $M=function(e,t){return e&&t&&t.split(" ").forEach(function(r){return RM(e,r)})},$u=function(e,t){return e&&t&&t.split(" ").forEach(function(r){return IM(e,r)})},yf=function(n){zk(e,n);function e(){for(var r,o=arguments.length,i=new Array(o),s=0;s{const e=h.useRef({});return h.useEffect(()=>{e.current=n}),e.current},Db=h.createContext(null);function Rb(){return h.useContext(Db)}const BM=typeof Symbol=="function"&&Symbol.for,FM=BM?Symbol.for("mui.nested"):"__THEME_NESTED__";function jM(n,e){return typeof e=="function"?e(n):K({},n,e)}function _M(n){const{children:e,theme:t}=n,r=Rb(),o=h.useMemo(()=>{const i=r===null?t:jM(r,t);return i!=null&&(i[FM]=r!==null),i},[t,r]);return v.jsx(Db.Provider,{value:o,children:e})}const Jm={};function Zm(n,e,t,r=!1){return h.useMemo(()=>{const o=n&&e[n]||e;if(typeof t=="function"){const i=t(o),s=n?K({},e,{[n]:i}):i;return r?()=>s:s}return n?K({},e,{[n]:t}):K({},e,t)},[n,e,t,r])}function zM(n){const{children:e,theme:t,themeId:r}=n,o=mM(Jm),i=Rb()||Jm,s=Zm(r,o,t),a=Zm(r,i,t,!0),l=s.direction==="rtl";return v.jsx(_M,{theme:a,children:v.jsx(Mk.Provider,{value:s,children:v.jsx(Nk,{value:l,children:v.jsx(Ek,{value:s==null?void 0:s.components,children:e})})})})}function Ur({props:n,name:e}){return dM({props:n,name:e,defaultTheme:Tk,themeId:Fd})}const HM=["theme"];function VM(n){let{theme:e}=n,t=tt(n,HM);const r=e[Fd];return v.jsx(zM,K({},t,{themeId:r?Fd:void 0,theme:r||e}))}function Xi(n){Be(1,arguments);var e=Re(n);return e.setHours(0,0,0,0),e}function UM(n,e){Be(2,arguments);var t=Xi(n),r=Xi(e);return t.getTime()===r.getTime()}const WM=Y.div` +var rk=Object.defineProperty;var ok=(n,e,t)=>e in n?rk(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ya=(n,e,t)=>ok(n,typeof e!="symbol"?e+"":e,t);import{j as v,r as St}from"./jsx-runtime-nGUw9YhZ.js";import{g as ef,a as A,r as h,c as Ja}from"./index-BP8_t0zE.js";import{s as Y,C as ib,t as j,n as bo,B as ik}from"./theme-DRtZtbPc.js";import{S as sk}from"./SideNav-biYpQHtM.js";import{c as Nt}from"./containerQuery-C0QVV4Kt.js";import{S as Yc,F as sb,i as Du,b as Mo,o as Vm,f as pi,A as ak,T as tf,I as ab,c as lk}from"./FormFieldText.styled-hkDOkrrs.js";import{I as sa,a as ck,D as uk,d as dk}from"./index-DnvaddO_.js";import{S as Xe,a as _l,B as Ca}from"./ButtonRow-B3IWj8ab.js";import{C as pk,F as fk,l as lb,k as hk,A as mk,r as cb,B as ub,D as gk,o as vk,E as db,G as yk,H as bk,I as xk,J as wk,K as nf,L as pb,b as fb,M as Ck,N as Sk,O as kk}from"./CheckboxList-BmT12QDz.js";import{_ as tt,d as K,T as Mk,L as Ek,H as Tk,I as Fd,i as kt,g as kn,a as At,s as Me,b as Sa,u as Qo,e as _n,f as Mn,j as Ru,M as Ok,E as Lk,z as Jc,y as rf,N as Ak}from"./generateUtilityClasses-DAcHHM0W.js";import{r as Mt}from"./createSvgIcon-CcHL1II5.js";import{C as jd,a as Pk,d as hb}from"./Chip-Btt3uSwF.js";import{S as wt}from"./sizes-C6oSOElx.js";import{c as Vr}from"./createSvgIcon-CPgMIgId.js";import{I as xo,d as Ts,G as Dk,P as Rk,u as of,T as sf,B as ln,e as Ik}from"./Button-Do5OxnZO.js";import{f as $k,T as mb,R as Nk,a as ei,P as ka,u as cs,g as Um,h as Bk,m as Fk,j as jk,k as _k,F as gb}from"./Popper-CPbWUqAP.js";import{u as af}from"./useId-DLncWxdO.js";import{u as Yi}from"./useControlled-im5M3O13.js";import{_ as zk,c as De,a as Os,s as Hk,u as _r,d as Vk,b as lf}from"./useIsFocusVisible-De2ftVE9.js";import{d as cf}from"./DataViewPrimaryFilter.styled-CylNlUs-.js";import{a as Uk,R as Wk}from"./RadioButton-CO2cFro8.js";import{T as Gk}from"./Toggle-CvnKr_oj.js";import{b as vb,d as Zc,i as uf,_ as Kk,c as qk}from"./isSymbol-CEVJpixJ.js";import{r as Be,t as Re,g as Yk,s as _d,b as yb,c as Jk,d as Lt,e as Zk,h as Xc,l as Wm,i as Xk,j as Gm,k as Qk,n as eM,o as zd,p as bb,q as xb,f as Hi,u as tM,_ as wb,v as nM,C as rM,P as oM,w as df,x as Jr,y as wl,D as pf,z as iM,a as sM,A as aM,B as zl}from"./ColorSelected-gVxq6Y0Z.js";import{b as lM,c as Km,e as cM,f as st,g as rt,h as Te,i as ot,_ as uM}from"./useMosaicTranslation-CZCb37QS.js";import{b as Cb,T as ff,D as Vi,c as Sb}from"./formats-CDjt32hU.js";import{u as dM,T as mo}from"./FormControlLabel-n1qioM9o.js";import{a as pM,b as fM,d as qm,c as hM,D as hf}from"./Dialog-DXK7hw4q.js";import{o as Iu}from"./ownerWindow-DvT1GKkC.js";import{B as kb,T as Mb}from"./ButtonBase-BZmvw3BH.js";import{u as mM}from"./useTheme-5hcycNQy.js";import{u as gM}from"./useMediaQuery-CguehUMS.js";import{D as Eb,a as vM,b as yM}from"./TitleWrapper-D2l-_w9e.js";import{T as bM}from"./Typography-Br_RMLnS.js";import{T as xM}from"./TitleText-C9TlfF_O.js";import{d as wM}from"./debounce-C_xMouBr.js";import{S as mf}from"./Snackbar-J6gNQC5v.js";import{g as Cl}from"./useToggle-lipGlewK.js";import{r as ti,R as CM}from"./index-BxmsGmlx.js";import{T as SM,F as gf,B as Hd}from"./TooltipIcon-CO3K7ssQ.js";import{t as Mr}from"./testIds-D6Gx1A0F.js";import{C as kM}from"./ClickAwayListener-DnjBLK-5.js";import{d as MM}from"./MoreVert-BbmWEP2K.js";import{P as EM}from"./PageHeader-yhdXyTld.js";import{S as vf}from"./Spinner-DgupAfKo.js";var Tb={exports:{}},TM="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",OM=TM,LM=OM;function Ob(){}function Lb(){}Lb.resetWarningCache=Ob;var AM=function(){function n(r,o,i,s,a,l){if(l!==LM){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}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Lb,resetWarningCache:Ob};return t.PropTypes=t,t};Tb.exports=AM();var Ab=Tb.exports;const Se=ef(Ab);function PM(n,e){return n.classList?!!e&&n.classList.contains(e):(" "+(n.className.baseVal||n.className)+" ").indexOf(" "+e+" ")!==-1}function DM(n,e){n.classList?n.classList.add(e):PM(n,e)||(typeof n.className=="string"?n.className=n.className+" "+e:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+e))}function Ym(n,e){return n.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function RM(n,e){n.classList?n.classList.remove(e):typeof n.className=="string"?n.className=Ym(n.className,e):n.setAttribute("class",Ym(n.className&&n.className.baseVal||"",e))}var IM=function(e,t){return e&&t&&t.split(" ").forEach(function(r){return DM(e,r)})},$u=function(e,t){return e&&t&&t.split(" ").forEach(function(r){return RM(e,r)})},yf=function(n){zk(e,n);function e(){for(var r,o=arguments.length,i=new Array(o),s=0;s{const e=h.useRef({});return h.useEffect(()=>{e.current=n}),e.current},Pb=h.createContext(null);function Db(){return h.useContext(Pb)}const NM=typeof Symbol=="function"&&Symbol.for,BM=NM?Symbol.for("mui.nested"):"__THEME_NESTED__";function FM(n,e){return typeof e=="function"?e(n):K({},n,e)}function jM(n){const{children:e,theme:t}=n,r=Db(),o=h.useMemo(()=>{const i=r===null?t:FM(r,t);return i!=null&&(i[BM]=r!==null),i},[t,r]);return v.jsx(Pb.Provider,{value:o,children:e})}const Jm={};function Zm(n,e,t,r=!1){return h.useMemo(()=>{const o=n&&e[n]||e;if(typeof t=="function"){const i=t(o),s=n?K({},e,{[n]:i}):i;return r?()=>s:s}return n?K({},e,{[n]:t}):K({},e,t)},[n,e,t,r])}function _M(n){const{children:e,theme:t,themeId:r}=n,o=mM(Jm),i=Db()||Jm,s=Zm(r,o,t),a=Zm(r,i,t,!0),l=s.direction==="rtl";return v.jsx(jM,{theme:a,children:v.jsx(Mk.Provider,{value:s,children:v.jsx(Nk,{value:l,children:v.jsx(Ek,{value:s==null?void 0:s.components,children:e})})})})}function Ur({props:n,name:e}){return dM({props:n,name:e,defaultTheme:Tk,themeId:Fd})}const zM=["theme"];function HM(n){let{theme:e}=n,t=tt(n,zM);const r=e[Fd];return v.jsx(_M,K({},t,{themeId:r?Fd:void 0,theme:r||e}))}function Xi(n){Be(1,arguments);var e=Re(n);return e.setHours(0,0,0,0),e}function VM(n,e){Be(2,arguments);var t=Xi(n),r=Xi(e);return t.getTime()===r.getTime()}const UM=Y.div` position: relative; display: flex; flex-direction: column; container-type: inline-size; - container-name: ${lb.FORM}; + container-name: ${ib.FORM}; ${({$fullHeight:n=!0})=>n&&` height: 100%; `} -`,GM=Y.form` +`,WM=Y.form` display: flex; flex-direction: column; flex: 1 1 0%; min-height: 0; -`,KM=Y.div` +`,GM=Y.div` overflow-y: auto; flex-grow: 1; min-width: 0; padding: ${({$spacing:n})=>n==="compact"?"16px":"24px"}; position: relative; -`,qM=Y.div` +`,KM=Y.div` flex-grow: 1; min-height: 0; display: flex; @@ -29,7 +29,7 @@ var ok=Object.defineProperty;var ik=(n,e,t)=>e in n?ok(n,e,{enumerable:!0,config ${Nt("xl","FORM")} { flex-direction: row; } -`,YM=Y(vM)` +`,qM=Y(sk)` display: none; margin-top: 10px; @@ -40,11 +40,11 @@ var ok=Object.defineProperty;var ik=(n,e,t)=>e in n?ok(n,e,{enumerable:!0,config ${Nt("xl","FORM")} { margin-top: 0; } -`,JM=Y.div` +`,YM=Y.div` border-top: 2px solid ${j.newColors.grey2[100]}; padding: ${({$spacing:n})=>n==="compact"?"16px":"24px"}; display: flex; -`,ZM=Y.div` +`,JM=Y.div` ${({$columns:n,$gridMinWidth:e,$spacing:t})=>n&&` display: grid; grid-template-columns: repeat(1,minmax(0,1fr)); @@ -63,308 +63,23 @@ var ok=Object.defineProperty;var ik=(n,e,t)=>e in n?ok(n,e,{enumerable:!0,config } `} `} -`,XM=Y.div` +`,ZM=Y.div` display: flex; flex-direction: column; position: relative; gap: 24px; container-type: inline-size; - container-name: ${lb.FORM_COL}; -`,QM={text:wt.md,checkbox:wt.md,chip:wt.md,dropdown:wt.md,phone:wt.sm,radio:wt.sm,toggle:wt.md,color:wt.sm,date:wt.md,time:wt.md,address:wt.full,textEditor:wt.lg,advancedSelection:wt.md,mapCoordinates:wt.sm,matrix:wt.full,upload:wt.md,number:wt.sm,numberTable:wt.full,raw:wt.full};function eE(n,e){return n?wt[n]?wt[n]:String(n):typeof e=="string"?QM[e]:"full"}var lo={},bf={},tE="Expected a function",Xm=NaN,nE="[object Symbol]",rE=/^\s+|\s+$/g,oE=/^[-+]0x[0-9a-f]+$/i,iE=/^0b[01]+$/i,sE=/^0o[0-7]+$/i,aE=parseInt,lE=typeof Ja=="object"&&Ja&&Ja.Object===Object&&Ja,cE=typeof self=="object"&&self&&self.Object===Object&&self,uE=lE||cE||Function("return this")(),dE=Object.prototype,pE=dE.toString,fE=Math.max,hE=Math.min,Nu=function(){return uE.Date.now()};function mE(n,e,t){var r,o,i,s,a,l,c=0,u=!1,d=!1,p=!0;if(typeof n!="function")throw new TypeError(tE);e=Qm(e)||0,Vd(t)&&(u=!!t.leading,d="maxWait"in t,i=d?fE(Qm(t.maxWait)||0,e):i,p="trailing"in t?!!t.trailing:p);function f(x){var C=r,E=o;return r=o=void 0,c=x,s=n.apply(E,C),s}function m(x){return c=x,a=setTimeout(b,e),u?f(x):s}function g(x){var C=x-l,E=x-c,P=e-C;return d?hE(P,i-E):P}function y(x){var C=x-l,E=x-c;return l===void 0||C>=e||C<0||d&&E>=i}function b(){var x=Nu();if(y(x))return w(x);a=setTimeout(b,g(x))}function w(x){return a=void 0,p&&r?f(x):(r=o=void 0,s)}function S(){a!==void 0&&clearTimeout(a),c=0,r=l=o=a=void 0}function T(){return a===void 0?s:w(Nu())}function k(){var x=Nu(),C=y(x);if(r=arguments,o=this,l=x,C){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=T,k}function Vd(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function gE(n){return!!n&&typeof n=="object"}function vE(n){return typeof n=="symbol"||gE(n)&&pE.call(n)==nE}function Qm(n){if(typeof n=="number")return n;if(vE(n))return Xm;if(Vd(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Vd(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=n.replace(rE,"");var t=iE.test(n);return t||sE.test(n)?aE(n.slice(2),t?2:8):oE.test(n)?Xm:+n}var yE=mE,Qc={};Object.defineProperty(Qc,"__esModule",{value:!0});Qc.compose=function(){for(var e=arguments.length,t=Array(e),r=0;r1?t-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 fi({},i,o,{onKeyDown:(0,Rr.compose)(r.handleInputKeyDown,o.onKeyDown),onBlur:(0,Rr.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 fi({},i,{key:o.id,id:r.getActiveSuggestionId(),role:"option",onMouseEnter:(0,Rr.compose)(s,i.onMouseEnter),onMouseLeave:(0,Rr.compose)(r.handleSuggestionMouseLeave,i.onMouseLeave),onMouseDown:(0,Rr.compose)(r.handleSuggestionMouseDown,i.onMouseDown),onMouseUp:(0,Rr.compose)(r.handleSuggestionMouseUp,i.onMouseUp),onTouchStart:(0,Rr.compose)(r.handleSuggestionTouchStart,i.onTouchStart),onTouchEnd:(0,Rr.compose)(r.handleSuggestionMouseUp,i.onTouchEnd),onClick:(0,Rr.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:t.value,ready:!t.googleCallbackName},r.debouncedFetchPredictions=(0,kE.default)(r.fetchPredictions,t.debounce),r}return bE(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}(wE.default.Component);wf.propTypes={onChange:Vt.default.func.isRequired,value:Vt.default.string.isRequired,children:Vt.default.func.isRequired,onError:Vt.default.func,onSelect:Vt.default.func,searchOptions:Vt.default.shape({bounds:Vt.default.object,componentRestrictions:Vt.default.object,location:Vt.default.object,offset:Vt.default.oneOfType([Vt.default.number,Vt.default.string]),radius:Vt.default.oneOfType([Vt.default.number,Vt.default.string]),types:Vt.default.array}),debounce:Vt.default.number,highlightFirstSuggestion:Vt.default.bool,shouldFetchSuggestions:Vt.default.bool,googleCallbackName:Vt.default.string};wf.defaultProps={onError:function(e,t){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};bf.default=wf;var Ma={};Object.defineProperty(Ma,"__esModule",{value:!0});Ma.geocodeByAddress=function(e){var t=new window.google.maps.Geocoder,r=window.google.maps.GeocoderStatus.OK;return new Promise(function(o,i){t.geocode({address:e},function(s,a){a!==r&&i(a),o(s)})})};Ma.getLatLng=function(e){return new Promise(function(t,r){try{var o={lat:e.geometry.location.lat(),lng:e.geometry.location.lng()};t(o)}catch(i){r(i)}})};Ma.geocodeByPlaceId=function(e){var t=new window.google.maps.Geocoder,r=window.google.maps.GeocoderStatus.OK;return new Promise(function(o,i){t.geocode({placeId:e},function(s,a){a!==r&&i(a),o(s)})})};Object.defineProperty(lo,"__esModule",{value:!0});var Ib=lo.getLatLng=lo.geocodeByPlaceId=Sf=lo.geocodeByAddress=void 0,LE=bf,AE=PE(LE),Cf=Ma;function PE(n){return n&&n.__esModule?n:{default:n}}var Sf=lo.geocodeByAddress=Cf.geocodeByAddress;lo.geocodeByPlaceId=Cf.geocodeByPlaceId;Ib=lo.getLatLng=Cf.getLatLng;var DE=lo.default=AE.default;/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -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 Ud=function(n,e){return Ud=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])},Ud(n,e)};function gt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ud(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var je=function(){return je=Object.assign||function(e){for(var t,r=1,o=arguments.length;r0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=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)})},t.injectScript=function(){t.props.preventGoogleFontsLoading&&Fb(),jt(!!t.props.id,'LoadScript requires "id" prop to be a string: %s',t.props.id);var r={id:t.props.id,nonce:t.props.nonce,url:jb(t.props)};Bb(r).then(function(){t.props.onLoad&&t.props.onLoad(),t.setState(function(){return{loaded:!0}})}).catch(function(o){t.props.onError&&t.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(t.props.googleMapsApiKey||"-",") or Client ID (").concat(t.props.googleMapsClientId||"-",`) to - Otherwise it is a Network issue. - `))})},t}return e.prototype.componentDidMount=function(){if(Ro){if(window.google&&window.google.maps&&!vs){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(t){this.props.libraries!==t.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"),Ro&&t.language!==this.props.language&&(this.cleanup(),this.setState(function(){return{loaded:!1}},this.cleanupCallback))},e.prototype.componentWillUnmount=function(){var t=this;if(Ro){this.cleanup();var r=function(){t.check.current||(delete window.google,vs=!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(_b,{})]})},e.defaultProps=Wd,e})(h.PureComponent);var rg;function Mf(n){var e=n.id,t=e===void 0?Wd.id:e,r=n.version,o=r===void 0?Wd.version:r,i=n.nonce,s=n.googleMapsApiKey,a=n.googleMapsClientId,l=n.language,c=n.region,u=n.libraries,d=n.preventGoogleFontsLoading,p=n.channel,f=n.mapIds,m=n.authReferrerPolicy,g=h.useRef(!1),y=h.useState(!1),b=y[0],w=y[1],S=h.useState(void 0),T=S[0],k=S[1];h.useEffect(function(){return g.current=!0,function(){g.current=!1}},[]),h.useEffect(function(){Ro&&d&&Fb()},[d]),h.useEffect(function(){b&&jt(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")},[b]);var x=jb({version:o,googleMapsApiKey:s,googleMapsClientId:a,language:l,region:c,libraries:u,channel:p,mapIds:f,authReferrerPolicy:m});h.useEffect(function(){if(!Ro)return;function P(){g.current&&(w(!0),rg=x)}if(window.google&&window.google.maps&&rg===x){P();return}Bb({id:t,url:x,nonce:i}).then(P).catch(function(F){g.current&&k(F),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(F)})},[t,x,i]);var C=h.useRef();return h.useEffect(function(){C.current&&u!==C.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"),C.current=u},[u]),{isLoaded:b,loadError:T,url:x}}var UE=v.jsx(_b,{});function WE(n){var e=n.loadingElement,t=n.onLoad,r=n.onError,o=n.onUnmount,i=n.children,s=kf(n,["loadingElement","onLoad","onError","onUnmount","children"]),a=Mf(s),l=a.isLoaded,c=a.loadError;return h.useEffect(function(){l&&typeof t=="function"&&t()},[l,t]),h.useEffect(function(){c&&typeof r=="function"&&r(c)},[c,r]),h.useEffect(function(){return function(){o&&o()}},[o]),l?i:e||UE}h.memo(WE);var og;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(og||(og={}));var ig={},sg={options:function(n,e){n.setOptions(e)}};function GE(n){var e=n.options,t=n.onLoad,r=n.onUnmount,o=h.useContext(We),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(je(je({},e||{}),{map:o}));return a(l),t&&t(l),function(){s!==null&&(r&&r(s),s.setMap(null))}},[]),null}h.memo(GE);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={trafficLayer:null},t.setTrafficLayerCallback=function(){t.state.trafficLayer!==null&&t.props.onLoad&&t.props.onLoad(t.state.trafficLayer)},t.registeredEvents=[],t}return e.prototype.componentDidMount=function(){var t=new google.maps.TrafficLayer(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:sg,eventMap:ig,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{trafficLayer:t}},this.setTrafficLayerCallback)},e.prototype.componentDidUpdate=function(t){this.state.trafficLayer!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:sg,eventMap:ig,prevProps:t,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=We,e})(h.PureComponent);function KE(n){var e=n.onLoad,t=n.onUnmount,r=h.useContext(We),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&&(t&&t(a),a.setMap(null))}},[]),null}h.memo(KE);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={bicyclingLayer:null},t.setBicyclingLayerCallback=function(){t.state.bicyclingLayer!==null&&(t.state.bicyclingLayer.setMap(t.context),t.props.onLoad&&t.props.onLoad(t.state.bicyclingLayer))},t}return e.prototype.componentDidMount=function(){var t=new google.maps.BicyclingLayer;this.setState(function(){return{bicyclingLayer:t}},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=We,e})(h.PureComponent);function qE(n){var e=n.onLoad,t=n.onUnmount,r=h.useContext(We),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&&(t&&t(i),i.setMap(null))}},[]),null}h.memo(qE);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={transitLayer:null},t.setTransitLayerCallback=function(){t.state.transitLayer!==null&&(t.state.transitLayer.setMap(t.context),t.props.onLoad&&t.props.onLoad(t.state.transitLayer))},t}return e.prototype.componentDidMount=function(){var t=new google.maps.TransitLayer;this.setState(function(){return{transitLayer:t}},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=We,e})(h.PureComponent);var ag={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},lg={drawingMode:function(n,e){n.setDrawingMode(e)},options:function(n,e){n.setOptions(e)}};function YE(n){var e=n.options,t=n.drawingMode,r=n.onCircleComplete,o=n.onMarkerComplete,i=n.onOverlayComplete,s=n.onPolygonComplete,a=n.onPolylineComplete,l=n.onRectangleComplete,c=n.onLoad,u=n.onUnmount,d=h.useContext(We),p=h.useState(null),f=p[0],m=p[1],g=h.useState(null),y=g[0],b=g[1],w=h.useState(null),S=w[0],T=w[1],k=h.useState(null),x=k[0],C=k[1],E=h.useState(null),P=E[0],O=E[1],F=h.useState(null),D=F[0],U=F[1],N=h.useState(null),z=N[0],_=N[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(t??null)},[f,t]),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),T(google.maps.event.addListener(f,"markercomplete",o)))},[f,o]),h.useEffect(function(){f&&i&&(x!==null&&google.maps.event.removeListener(x),C(google.maps.event.addListener(f,"overlaycomplete",i)))},[f,i]),h.useEffect(function(){f&&s&&(P!==null&&google.maps.event.removeListener(P),O(google.maps.event.addListener(f,"polygoncomplete",s)))},[f,s]),h.useEffect(function(){f&&a&&(D!==null&&google.maps.event.removeListener(D),U(google.maps.event.addListener(f,"polylinecomplete",a)))},[f,a]),h.useEffect(function(){f&&l&&(z!==null&&google.maps.event.removeListener(z),_(google.maps.event.addListener(f,"rectanglecomplete",l)))},[f,l]),h.useEffect(function(){jt(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing);var $=new google.maps.drawing.DrawingManager(je(je({},e||{}),{map:d}));return t&&$.setDrawingMode(t),r&&b(google.maps.event.addListener($,"circlecomplete",r)),o&&T(google.maps.event.addListener($,"markercomplete",o)),i&&C(google.maps.event.addListener($,"overlaycomplete",i)),s&&O(google.maps.event.addListener($,"polygoncomplete",s)),a&&U(google.maps.event.addListener($,"polylinecomplete",a)),l&&_(google.maps.event.addListener($,"rectanglecomplete",l)),m($),c&&c($),function(){f!==null&&(y&&google.maps.event.removeListener(y),S&&google.maps.event.removeListener(S),x&&google.maps.event.removeListener(x),P&&google.maps.event.removeListener(P),D&&google.maps.event.removeListener(D),z&&google.maps.event.removeListener(z),u&&u(f),f.setMap(null))}},[]),null}h.memo(YE);(function(n){gt(e,n);function e(t){var r=n.call(this,t)||this;return r.registeredEvents=[],r.state={drawingManager:null},r.setDrawingManagerCallback=function(){r.state.drawingManager!==null&&r.props.onLoad&&r.props.onLoad(r.state.drawingManager)},jt(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing),r}return e.prototype.componentDidMount=function(){var t=new google.maps.drawing.DrawingManager(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:lg,eventMap:ag,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{drawingManager:t}},this.setDrawingManagerCallback)},e.prototype.componentDidUpdate=function(t){this.state.drawingManager!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:lg,eventMap:ag,prevProps:t,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=We,e})(h.PureComponent);var cg={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"},ug={animation:function(n,e){n.setAnimation(e)},clickable:function(n,e){n.setClickable(e)},cursor:function(n,e){n.setCursor(e)},draggable:function(n,e){n.setDraggable(e)},icon:function(n,e){n.setIcon(e)},label:function(n,e){n.setLabel(e)},map:function(n,e){n.setMap(e)},opacity:function(n,e){n.setOpacity(e)},options:function(n,e){n.setOptions(e)},position:function(n,e){n.setPosition(e)},shape:function(n,e){n.setShape(e)},title:function(n,e){n.setTitle(e)},visible:function(n,e){n.setVisible(e)},zIndex:function(n,e){n.setZIndex(e)}},Hl={};function JE(n){var e=n.position,t=n.options,r=n.clusterer,o=n.noClustererRedraw,i=n.children,s=n.draggable,a=n.visible,l=n.animation,c=n.clickable,u=n.cursor,d=n.icon,p=n.label,f=n.opacity,m=n.shape,g=n.title,y=n.zIndex,b=n.onClick,w=n.onDblClick,S=n.onDrag,T=n.onDragEnd,k=n.onDragStart,x=n.onMouseOut,C=n.onMouseOver,E=n.onMouseUp,P=n.onMouseDown,O=n.onRightClick,F=n.onClickableChanged,D=n.onCursorChanged,U=n.onAnimationChanged,N=n.onDraggableChanged,z=n.onFlatChanged,_=n.onIconChanged,$=n.onPositionChanged,G=n.onShapeChanged,le=n.onTitleChanged,Z=n.onVisibleChanged,V=n.onZindexChanged,J=n.onLoad,ce=n.onUnmount,q=h.useContext(We),M=h.useState(null),I=M[0],ie=M[1],te=h.useState(null),Q=te[0],fe=te[1],pe=h.useState(null),ye=pe[0],Le=pe[1],Oe=h.useState(null),B=Oe[0],R=Oe[1],oe=h.useState(null),ne=oe[0],de=oe[1],he=h.useState(null),we=he[0],ve=he[1],me=h.useState(null),ue=me[0],_e=me[1],Ee=h.useState(null),Ae=Ee[0],He=Ee[1],Pe=h.useState(null),it=Pe[0],zt=Pe[1],Pt=h.useState(null),Wt=Pt[0],Ht=Pt[1],Gt=h.useState(null),lt=Gt[0],yn=Gt[1],Dn=h.useState(null),$t=Dn[0],cn=Dn[1],Kt=h.useState(null),En=Kt[0],Rn=Kt[1],Gn=h.useState(null),un=Gn[0],dn=Gn[1],Lr=h.useState(null),Kn=Lr[0],qn=Lr[1],Dt=h.useState(null),yt=Dt[0],qt=Dt[1],In=h.useState(null),Yn=In[0],Ar=In[1],Pr=h.useState(null),Jt=Pr[0],Jn=Pr[1],$n=h.useState(null),Nn=$n[0],re=$n[1],X=h.useState(null),ke=X[0],be=X[1],ze=h.useState(null),et=ze[0],L=ze[1],W=h.useState(null),ae=W[0],ge=W[1];h.useEffect(function(){I!==null&&I.setMap(q)},[q]),h.useEffect(function(){typeof t<"u"&&I!==null&&I.setOptions(t)},[I,t]),h.useEffect(function(){typeof s<"u"&&I!==null&&I.setDraggable(s)},[I,s]),h.useEffect(function(){e&&I!==null&&I.setPosition(e)},[I,e]),h.useEffect(function(){typeof a<"u"&&I!==null&&I.setVisible(a)},[I,a]),h.useEffect(function(){I==null||I.setAnimation(l)},[I,l]),h.useEffect(function(){I&&c!==void 0&&I.setClickable(c)},[I,c]),h.useEffect(function(){I&&u!==void 0&&I.setCursor(u)},[I,u]),h.useEffect(function(){I&&d!==void 0&&I.setIcon(d)},[I,d]),h.useEffect(function(){I&&p!==void 0&&I.setLabel(p)},[I,p]),h.useEffect(function(){I&&f!==void 0&&I.setOpacity(f)},[I,f]),h.useEffect(function(){I&&m!==void 0&&I.setShape(m)},[I,m]),h.useEffect(function(){I&&g!==void 0&&I.setTitle(g)},[I,g]),h.useEffect(function(){I&&y!==void 0&&I.setZIndex(y)},[I,y]),h.useEffect(function(){I&&w&&(Q!==null&&google.maps.event.removeListener(Q),fe(google.maps.event.addListener(I,"dblclick",w)))},[w]),h.useEffect(function(){I&&T&&(ye!==null&&google.maps.event.removeListener(ye),Le(google.maps.event.addListener(I,"dragend",T)))},[T]),h.useEffect(function(){I&&k&&(B!==null&&google.maps.event.removeListener(B),R(google.maps.event.addListener(I,"dragstart",k)))},[k]),h.useEffect(function(){I&&P&&(ne!==null&&google.maps.event.removeListener(ne),de(google.maps.event.addListener(I,"mousedown",P)))},[P]),h.useEffect(function(){I&&x&&(we!==null&&google.maps.event.removeListener(we),ve(google.maps.event.addListener(I,"mouseout",x)))},[x]),h.useEffect(function(){I&&C&&(ue!==null&&google.maps.event.removeListener(ue),_e(google.maps.event.addListener(I,"mouseover",C)))},[C]),h.useEffect(function(){I&&E&&(Ae!==null&&google.maps.event.removeListener(Ae),He(google.maps.event.addListener(I,"mouseup",E)))},[E]),h.useEffect(function(){I&&O&&(it!==null&&google.maps.event.removeListener(it),zt(google.maps.event.addListener(I,"rightclick",O)))},[O]),h.useEffect(function(){I&&b&&(Wt!==null&&google.maps.event.removeListener(Wt),Ht(google.maps.event.addListener(I,"click",b)))},[b]),h.useEffect(function(){I&&S&&(lt!==null&&google.maps.event.removeListener(lt),yn(google.maps.event.addListener(I,"drag",S)))},[S]),h.useEffect(function(){I&&F&&($t!==null&&google.maps.event.removeListener($t),cn(google.maps.event.addListener(I,"clickable_changed",F)))},[F]),h.useEffect(function(){I&&D&&(En!==null&&google.maps.event.removeListener(En),Rn(google.maps.event.addListener(I,"cursor_changed",D)))},[D]),h.useEffect(function(){I&&U&&(un!==null&&google.maps.event.removeListener(un),dn(google.maps.event.addListener(I,"animation_changed",U)))},[U]),h.useEffect(function(){I&&N&&(Kn!==null&&google.maps.event.removeListener(Kn),qn(google.maps.event.addListener(I,"draggable_changed",N)))},[N]),h.useEffect(function(){I&&z&&(yt!==null&&google.maps.event.removeListener(yt),qt(google.maps.event.addListener(I,"flat_changed",z)))},[z]),h.useEffect(function(){I&&_&&(Yn!==null&&google.maps.event.removeListener(Yn),Ar(google.maps.event.addListener(I,"icon_changed",_)))},[_]),h.useEffect(function(){I&&$&&(Jt!==null&&google.maps.event.removeListener(Jt),Jn(google.maps.event.addListener(I,"position_changed",$)))},[$]),h.useEffect(function(){I&&G&&(Nn!==null&&google.maps.event.removeListener(Nn),re(google.maps.event.addListener(I,"shape_changed",G)))},[G]),h.useEffect(function(){I&&le&&(ke!==null&&google.maps.event.removeListener(ke),be(google.maps.event.addListener(I,"title_changed",le)))},[le]),h.useEffect(function(){I&&Z&&(et!==null&&google.maps.event.removeListener(et),L(google.maps.event.addListener(I,"visible_changed",Z)))},[Z]),h.useEffect(function(){I&&V&&(ae!==null&&google.maps.event.removeListener(ae),ge(google.maps.event.addListener(I,"zindex_changed",V)))},[V]),h.useEffect(function(){var $e=je(je(je({},t||Hl),r?Hl:{map:q}),{position:e}),xe=new google.maps.Marker($e);return r?r.addMarker(xe,!!o):xe.setMap(q),e&&xe.setPosition(e),typeof a<"u"&&xe.setVisible(a),typeof s<"u"&&xe.setDraggable(s),typeof c<"u"&&xe.setClickable(c),typeof u=="string"&&xe.setCursor(u),d&&xe.setIcon(d),typeof p<"u"&&xe.setLabel(p),typeof f<"u"&&xe.setOpacity(f),m&&xe.setShape(m),typeof g=="string"&&xe.setTitle(g),typeof y=="number"&&xe.setZIndex(y),w&&fe(google.maps.event.addListener(xe,"dblclick",w)),T&&Le(google.maps.event.addListener(xe,"dragend",T)),k&&R(google.maps.event.addListener(xe,"dragstart",k)),P&&de(google.maps.event.addListener(xe,"mousedown",P)),x&&ve(google.maps.event.addListener(xe,"mouseout",x)),C&&_e(google.maps.event.addListener(xe,"mouseover",C)),E&&He(google.maps.event.addListener(xe,"mouseup",E)),O&&zt(google.maps.event.addListener(xe,"rightclick",O)),b&&Ht(google.maps.event.addListener(xe,"click",b)),S&&yn(google.maps.event.addListener(xe,"drag",S)),F&&cn(google.maps.event.addListener(xe,"clickable_changed",F)),D&&Rn(google.maps.event.addListener(xe,"cursor_changed",D)),U&&dn(google.maps.event.addListener(xe,"animation_changed",U)),N&&qn(google.maps.event.addListener(xe,"draggable_changed",N)),z&&qt(google.maps.event.addListener(xe,"flat_changed",z)),_&&Ar(google.maps.event.addListener(xe,"icon_changed",_)),$&&Jn(google.maps.event.addListener(xe,"position_changed",$)),G&&re(google.maps.event.addListener(xe,"shape_changed",G)),le&&be(google.maps.event.addListener(xe,"title_changed",le)),Z&&L(google.maps.event.addListener(xe,"visible_changed",Z)),V&&ge(google.maps.event.addListener(xe,"zindex_changed",V)),ie(xe),J&&J(xe),function(){Q!==null&&google.maps.event.removeListener(Q),ye!==null&&google.maps.event.removeListener(ye),B!==null&&google.maps.event.removeListener(B),ne!==null&&google.maps.event.removeListener(ne),we!==null&&google.maps.event.removeListener(we),ue!==null&&google.maps.event.removeListener(ue),Ae!==null&&google.maps.event.removeListener(Ae),it!==null&&google.maps.event.removeListener(it),Wt!==null&&google.maps.event.removeListener(Wt),$t!==null&&google.maps.event.removeListener($t),En!==null&&google.maps.event.removeListener(En),un!==null&&google.maps.event.removeListener(un),Kn!==null&&google.maps.event.removeListener(Kn),yt!==null&&google.maps.event.removeListener(yt),Yn!==null&&google.maps.event.removeListener(Yn),Jt!==null&&google.maps.event.removeListener(Jt),ke!==null&&google.maps.event.removeListener(ke),et!==null&&google.maps.event.removeListener(et),ae!==null&&google.maps.event.removeListener(ae),ce&&ce(xe),r?r.removeMarker(xe,!!o):xe&&xe.setMap(null)}},[]);var Fe=h.useMemo(function(){return i?h.Children.map(i,function($e){if(!h.isValidElement($e))return $e;var xe=$e;return h.cloneElement(xe,{anchor:I})}):null},[i,I]);return v.jsx(v.Fragment,{children:Fe})||null}h.memo(JE);var ZE=function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t}return e.prototype.componentDidMount=function(){var t=je(je(je({},this.props.options||Hl),this.props.clusterer?Hl:{map:this.context}),{position:this.props.position});this.marker=new google.maps.Marker(t),this.props.clusterer?this.props.clusterer.addMarker(this.marker,!!this.props.noClustererRedraw):this.marker.setMap(this.context),this.registeredEvents=Ye({updaterMap:ug,eventMap:cg,prevProps:{},nextProps:this.props,instance:this.marker}),this.props.onLoad&&this.props.onLoad(this.marker)},e.prototype.componentDidUpdate=function(t){this.marker&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:ug,eventMap:cg,prevProps:t,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 t=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:t.marker})})),r||null},e.contextType=We,e}(h.PureComponent),XE=function(){function n(e,t){e.getClusterer().extend(n,google.maps.OverlayView),this.cluster=e,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=t,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 n.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},n.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},n.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var t=this.cluster.getClusterer();if(google.maps.event.trigger(t,"click",this.cluster),google.maps.event.trigger(t,"clusterclick",this.cluster),t.getZoomOnClick()){var r=t.getMaxZoom(),o=this.cluster.getBounds(),i=t.getMap();i!==null&&"fitBounds"in i&&i.fitBounds(o),this.timeOut=window.setTimeout(function(){var s=t.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()}},n.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},n.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},n.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 t=this.getMap();t!==null&&(this.boundsChangedListener=google.maps.event.addListener(t,"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))},n.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)},n.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"}},n.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},n.prototype.show=function(){var e,t,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(((t=l[1])===null||t===void 0?void 0:t.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},n.prototype.useStyle=function(e){this.sums=e;var t=this.cluster.getClusterer().getStyles(),r=t[Math.min(t.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")},n.prototype.setCenter=function(e){this.center=e},n.prototype.getPosFromLatLng=function(e){var t=this.getProjection().fromLatLngToDivPixel(e);return t!==null&&(t.x-=this.anchorIcon[1],t.y-=this.anchorIcon[0]),t},n}(),QE=function(){function n(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 XE(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 n.prototype.getSize=function(){return this.markers.length},n.prototype.getMarkers=function(){return this.markers},n.prototype.getCenter=function(){return this.center},n.prototype.getMap=function(){return this.map},n.prototype.getClusterer=function(){return this.markerClusterer},n.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),t=this.getMarkers(),r=0,o=t;rs)e.getMap()!==this.map&&e.setMap(this.map);else if(ir){this.clusterIcon.hide();return}if(t0))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 n.prototype.createInfoBoxDiv=function(){var e=this,t=function(c){c.returnValue=!1,c.preventDefault&&c.preventDefault(),e.enableEventPropagation||dg(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||t.panBy(r,o)}}},n.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var e=this.boxStyle;for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.div.style[t]=e[t]);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")}},n.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var t=this.div.ownerDocument,r=t&&t.defaultView?t.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},n.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},n.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection(),t=e.fromLatLngToDivPixel(this.position);t!==null&&(this.div.style.left=t.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(t.y+this.pixelOffset.height)+"px":this.div.style.top=t.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},n.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()},n.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")},n.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},n.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},n.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+""),google.maps.event.trigger(this,"zindex_changed")},n.prototype.getContent=function(){return this.content},n.prototype.getPosition=function(){return this.position},n.prototype.getZIndex=function(){return this.zIndex},n.prototype.getVisible=function(){var e=this.getMap();return typeof e>"u"||e===null?!1:!this.isHidden},n.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},n.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},n.prototype.open=function(e,t){var r=this;t&&(this.position=t.getPosition(),this.moveListener=google.maps.event.addListener(t,"position_changed",function(){var o=t.getPosition();r.setPosition(o)}),this.mapListener=google.maps.event.addListener(t,"map_changed",function(){r.setMap(t.map)})),this.setMap(e),this.div&&this.panBox()},n.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,t=this.eventListeners;e."),d&&d(V)}return function(){g!==null&&(w&&google.maps.event.removeListener(w),E&&google.maps.event.removeListener(E),k&&google.maps.event.removeListener(k),F&&google.maps.event.removeListener(F),N&&google.maps.event.removeListener(N),p&&p(g),g.close())}},[]),_.current?ti.createPortal(h.Children.only(e),_.current):null}h.memo(uT);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.containerElement=null,t.state={infoBox:null},t.open=function(r,o){o?t.context!==null&&r.open(t.context,o):r.getPosition()?t.context!==null&&r.open(t.context):jt(!1,"You must provide either an anchor or a position prop for .")},t.setInfoBoxCallback=function(){t.state.infoBox!==null&&t.containerElement!==null&&(t.state.infoBox.setContent(t.containerElement),t.open(t.state.infoBox,t.props.anchor),t.props.onLoad&&t.props.onLoad(t.state.infoBox))},t}return e.prototype.componentDidMount=function(){var t=this.props.options||{},r=t.position,o=kf(t,["position"]),i;r&&!(r instanceof google.maps.LatLng)&&(i=new google.maps.LatLng(r.lat,r.lng));var s=new Hb(je(je({},o),i?{position:i}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=Ye({updaterMap:fg,eventMap:pg,prevProps:{},nextProps:this.props,instance:s}),this.setState({infoBox:s},this.setInfoBoxCallback)},e.prototype.componentDidUpdate=function(t){var r=this.state.infoBox;r!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:fg,eventMap:pg,prevProps:t,nextProps:this.props,instance:r}))},e.prototype.componentWillUnmount=function(){var t=this.props.onUnmount,r=this.state.infoBox;r!==null&&(t&&t(r),Qe(this.registeredEvents),r.close())},e.prototype.render=function(){return this.containerElement?ti.createPortal(h.Children.only(this.props.children),this.containerElement):null},e.contextType=We,e})(h.PureComponent);var dT=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,o,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(!n(e[o],t[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!n(e[s],t[s]))return!1}return!0}return e!==e&&t!==t},hg=$b(dT);const mg=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Bu=1,ys=8;class Ef{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=r>>4;if(o!==Bu)throw new Error(`Got v${o} data when expected v${Bu}.`);const i=mg[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 Ef(a,s,i,e)}constructor(e,t=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(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const i=mg.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,ys,e),this.coords=new this.ArrayType(this.data,ys+a+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(ys+s+a+l),this.ids=new this.IndexArrayType(this.data,ys,e),this.coords=new this.ArrayType(this.data,ys+a+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Bu<<4)+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Gd(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,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],w=s[2*y+1];b>=e&&b<=r&&w>=t&&w<=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>=t&&g<=o&&c.push(i[f]),(u===0?e<=m:t<=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,t,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++)gg(i[2*y],i[2*y+1],e,t)<=c&&l.push(o[y]);continue}const f=p+d>>1,m=i[2*f],g=i[2*f+1];gg(m,g,e,t)<=c&&l.push(o[f]),(u===0?e-r<=m:t-r<=g)&&(a.push(p),a.push(f-1),a.push(1-u)),(u===0?e+r>=m:t+r>=g)&&(a.push(f+1),a.push(d),a.push(1-u))}return l}}function Gd(n,e,t,r,o,i){if(o-r<=t)return;const s=r+o>>1;Vb(n,e,s,r,o,i),Gd(n,e,t,r,s-1,1-i),Gd(n,e,t,s+1,o,1-i)}function Vb(n,e,t,r,o,i){for(;o>r;){if(o-r>600){const c=o-r+1,u=t-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(t-u*p/c+f)),g=Math.min(o,Math.floor(t+(c-u)*p/c+f));Vb(n,e,t,m,g,i)}const s=e[2*t+i];let a=r,l=o;for(bs(n,e,r,t),e[2*o+i]>s&&bs(n,e,r,o);as;)l--}e[2*r+i]===s?bs(n,e,r,l):(l++,bs(n,e,l,o)),l<=t&&(r=l+1),t<=l&&(o=l-1)}}function bs(n,e,t,r){Fu(n,t,r),Fu(e,2*t,2*r),Fu(e,2*t+1,2*r+1)}function Fu(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function gg(n,e,t,r){const o=n-t,i=e-r;return o*o+i*i}const pT={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},vg=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),Eo=2,eo=3,ju=4,Xr=5,Ub=6;class fT{constructor(e){this.options=Object.assign(Object.create(pT),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:o}=this.options;t&&console.time("total time");const i=`prepare ${e.length} points`;t&&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)),t&&console.log("z%d: %d clusters in %dms",l,a.numItems,+Date.now()-c)}return t&&console.timeEnd("total time"),this}getClusters(e,t){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],t),p=this.getClusters([-180,o,i,s],t);return d.concat(p)}const a=this.trees[this._limitZoom(t)],l=a.range(Za(r),Xa(s),Za(i),Xa(o)),c=a.data,u=[];for(const d of l){const p=this.stride*d;u.push(c[p+Xr]>1?yg(c,p,this.clusterProps):this.points[c[p+eo]])}return u}getChildren(e){const t=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(t*this.stride>=s.length)throw new Error(o);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),l=s[t*this.stride],c=s[t*this.stride+1],u=i.within(l,c,a),d=[];for(const p of u){const f=p*this.stride;s[f+ju]===e&&d.push(s[f+Xr]>1?yg(s,f,this.clusterProps):this.points[s[f+eo]])}if(d.length===0)throw new Error(o);return d}getLeaves(e,t,r){t=t||10,r=r||0;const o=[];return this._appendLeaves(o,e,t,r,0),o}getTile(e,t,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((t-l)/i,c,(t+1+l)/i,u),o.data,t,r,i,d),t===0&&this._addTileFeatures(o.range(1-l/i,c,1,u),o.data,i,r,i,d),t===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 t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,o,i){const s=this.getChildren(t);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=Wb(t,l,this.clusterProps),d=t[l],p=t[l+1];else{const g=this.points[t[l+eo]];u=g.properties;const[y,b]=g.geometry.coordinates;d=Za(y),p=Xa(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=t[l+eo]:m=this.points[t[l+eo]].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,t){const{radius:r,extent:o,reduce:i,minPoints:s}=this.options,a=r/(o*Math.pow(2,t)),l=e.data,c=[],u=this.stride;for(let d=0;dt&&(y+=l[w+Xr])}if(y>g&&y>=s){let b=p*g,w=f*g,S,T=-1;const k=((d/u|0)<<5)+(t+1)+this.points.length;for(const x of m){const C=x*u;if(l[C+Eo]<=t)continue;l[C+Eo]=t;const E=l[C+Xr];b+=l[C]*E,w+=l[C+1]*E,l[C+ju]=k,i&&(S||(S=this._map(l,d,!0),T=this.clusterProps.length,this.clusterProps.push(S)),i(S,this._map(l,C)))}l[d+ju]=k,c.push(b/y,w/y,1/0,k,-1,y),i&&c.push(T)}else{for(let b=0;b1)for(const b of m){const w=b*u;if(!(l[w+Eo]<=t)){l[w+Eo]=t;for(let S=0;S>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+Xr]>1){const s=this.clusterProps[e[t+Ub]];return r?Object.assign({},s):s}const o=this.points[e[t+eo]].properties,i=this.options.map(o);return r&&i===o?Object.assign({},i):i}}function yg(n,e,t){return{type:"Feature",id:n[e+eo],properties:Wb(n,e,t),geometry:{type:"Point",coordinates:[hT(n[e]),mT(n[e+1])]}}}function Wb(n,e,t){const r=n[e+Xr],o=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,i=n[e+Ub],s=i===-1?{}:Object.assign({},t[i]);return Object.assign(s,{cluster:!0,cluster_id:n[e+eo],point_count:r,point_count_abbreviated:o})}function Za(n){return n/360+.5}function Xa(n){const e=Math.sin(n*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function hT(n){return(n-.5)*360}function mT(n){const e=(180-n*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 -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -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 gT(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(n);ojn.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(jn.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class vT{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return yT(e)}}const yT=n=>n.map(t=>new Kd({position:jn.getPosition(t),markers:[t]}));class bT extends vT{constructor(e){var{maxZoom:t,radius:r=60}=e,o=gT(e,["maxZoom","radius"]);super({maxZoom:t}),this.state={zoom:-1},this.superCluster=new fT(Object.assign({maxZoom:this.maxZoom,radius:r},o))}calculate(e){let t=!1;const r={zoom:e.map.getZoom()};if(!hg(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const o=this.markers.map(i=>{const s=jn.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[s.lng(),s.lat()]},properties:{marker:i}}});this.superCluster.load(o)}return t||(this.state.zoom<=this.maxZoom||r.zoom<=this.maxZoom)&&(t=!hg(this.state,r)),this.state=r,t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new Kd({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(i=>i.properties.marker),position:{lat:t,lng:e}});const o=r.marker;return new Kd({markers:[o],position:jn.getPosition(o)})}}class xT{constructor(e,t){this.markers={sum:e.length};const r=t.map(i=>i.count),o=r.reduce((i,s)=>i+s,0);this.clusters={count:t.length,markers:{mean:o/t.length,sum:o,min:Math.min(...r),max:Math.max(...r)}}}}class wT{render({count:e,position:t},r,o){const s=` - - - -${e} -`,a=`Cluster of ${e} markers`,l=Number(google.maps.Marker.MAX_ZINDEX)+e;if(jn.isAdvancedMarkerAvailable(o)){const d=new DOMParser().parseFromString(s,"image/svg+xml").documentElement;d.setAttribute("transform","translate(0 25)");const p={map:o,position:t,zIndex:l,title:a,content:d};return new google.maps.marker.AdvancedMarkerElement(p)}const c={position:t,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 CT(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t]}class Tf{constructor(){CT(Tf,google.maps.OverlayView)}}var Ks;(function(n){n.CLUSTERING_BEGIN="clusteringbegin",n.CLUSTERING_END="clusteringend",n.CLUSTER_CLICK="click"})(Ks||(Ks={}));const ST=(n,e,t)=>{t.fitBounds(e.bounds)};class kT extends Tf{constructor({map:e,markers:t=[],algorithmOptions:r={},algorithm:o=new bT(r),renderer:i=new wT,onClusterClick:s=ST}){super(),this.markers=[...t],this.clusters=[],this.algorithm=o,this.renderer=i,this.onClusterClick=s,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(r=>{this.addMarker(r,!0)}),t||this.render()}removeMarker(e,t){const r=this.markers.indexOf(e);return r===-1?!1:(jn.setMap(e,null),this.markers.splice(r,1),t||this.render(),!0)}removeMarkers(e,t){let r=!1;return e.forEach(o=>{r=this.removeMarker(o,!0)||r}),r&&!t&&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,Ks.CLUSTERING_BEGIN,this);const{clusters:t,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 t)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)||jn.setMap(s.marker,null):i.push(s.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>i.forEach(s=>jn.setMap(s,null)))}google.maps.event.trigger(this,Ks.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=>jn.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new xT(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(r=>{r.markers.length===1?r.marker=r.markers[0]:(r.marker=this.renderer.render(r,e,t),r.markers.forEach(o=>jn.setMap(o,null)),this.onClusterClick&&r.marker.addListener("click",o=>{google.maps.event.trigger(this,Ks.CLUSTER_CLICK,r),this.onClusterClick(o,r,t)})),jn.setMap(r.marker,t)})}}function MT(n){var e=Nb(),t=h.useState(null),r=t[0],o=t[1];return h.useEffect(function(){if(e&&r===null){var i=new kT(je(je({},n),{map:e}));o(i)}},[e]),r}function ET(n){var e=n.children,t=n.options,r=MT(t);return r!==null?e(r):null}h.memo(ET);var bg={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},xg={options:function(n,e){n.setOptions(e)},position:function(n,e){n.setPosition(e)},zIndex:function(n,e){n.setZIndex(e)}};function TT(n){var e=n.children,t=n.anchor,r=n.options,o=n.position,i=n.zIndex,s=n.onCloseClick,a=n.onDomReady,l=n.onContentChanged,c=n.onPositionChanged,u=n.onZindexChanged,d=n.onLoad,p=n.onUnmount,f=h.useContext(We),m=h.useState(null),g=m[0],y=m[1],b=h.useState(null),w=b[0],S=b[1],T=h.useState(null),k=T[0],x=T[1],C=h.useState(null),E=C[0],P=C[1],O=h.useState(null),F=O[0],D=O[1],U=h.useState(null),N=U[0],z=U[1],_=h.useRef(null);return h.useEffect(function(){g!==null&&(g.close(),t?g.open(f,t):g.getPosition()&&g.open(f))},[f,g,t]),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&&(w!==null&&google.maps.event.removeListener(w),S(google.maps.event.addListener(g,"closeclick",s)))},[s]),h.useEffect(function(){g&&a&&(k!==null&&google.maps.event.removeListener(k),x(google.maps.event.addListener(g,"domready",a)))},[a]),h.useEffect(function(){g&&l&&(E!==null&&google.maps.event.removeListener(E),P(google.maps.event.addListener(g,"content_changed",l)))},[l]),h.useEffect(function(){g&&c&&(F!==null&&google.maps.event.removeListener(F),D(google.maps.event.addListener(g,"position_changed",c)))},[c]),h.useEffect(function(){g&&u&&(N!==null&&google.maps.event.removeListener(N),z(google.maps.event.addListener(g,"zindex_changed",u)))},[u]),h.useEffect(function(){var $=new google.maps.InfoWindow(je({},r||{}));return y($),_.current=document.createElement("div"),s&&S(google.maps.event.addListener($,"closeclick",s)),a&&x(google.maps.event.addListener($,"domready",a)),l&&P(google.maps.event.addListener($,"content_changed",l)),c&&D(google.maps.event.addListener($,"position_changed",c)),u&&z(google.maps.event.addListener($,"zindex_changed",u)),$.setContent(_.current),o&&$.setPosition(o),i&&$.setZIndex(i),t?$.open(f,t):$.getPosition()?$.open(f):jt(!1,"You must provide either an anchor (typically render it inside a ) or a position props for ."),d&&d($),function(){w&&google.maps.event.removeListener(w),E&&google.maps.event.removeListener(E),k&&google.maps.event.removeListener(k),F&&google.maps.event.removeListener(F),N&&google.maps.event.removeListener(N),p&&p($),$.close()}},[]),_.current?ti.createPortal(h.Children.only(e),_.current):null}h.memo(TT);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.containerElement=null,t.state={infoWindow:null},t.open=function(r,o){o?r.open(t.context,o):r.getPosition()?r.open(t.context):jt(!1,"You must provide either an anchor (typically render it inside a ) or a position props for .")},t.setInfoWindowCallback=function(){t.state.infoWindow!==null&&t.containerElement!==null&&(t.state.infoWindow.setContent(t.containerElement),t.open(t.state.infoWindow,t.props.anchor),t.props.onLoad&&t.props.onLoad(t.state.infoWindow))},t}return e.prototype.componentDidMount=function(){var t=new google.maps.InfoWindow(je({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=Ye({updaterMap:xg,eventMap:bg,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{infoWindow:t}},this.setInfoWindowCallback)},e.prototype.componentDidUpdate=function(t){this.state.infoWindow!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:xg,eventMap:bg,prevProps:t,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?ti.createPortal(h.Children.only(this.props.children),this.containerElement):null},e.contextType=We,e})(h.PureComponent);var wg={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},Cg={draggable:function(n,e){n.setDraggable(e)},editable:function(n,e){n.setEditable(e)},map:function(n,e){n.setMap(e)},options:function(n,e){n.setOptions(e)},path:function(n,e){n.setPath(e)},visible:function(n,e){n.setVisible(e)}},OT={};function LT(n){var e=n.options,t=n.draggable,r=n.editable,o=n.visible,i=n.path,s=n.onDblClick,a=n.onDragEnd,l=n.onDragStart,c=n.onMouseDown,u=n.onMouseMove,d=n.onMouseOut,p=n.onMouseOver,f=n.onMouseUp,m=n.onRightClick,g=n.onClick,y=n.onDrag,b=n.onLoad,w=n.onUnmount,S=h.useContext(We),T=h.useState(null),k=T[0],x=T[1],C=h.useState(null),E=C[0],P=C[1],O=h.useState(null),F=O[0],D=O[1],U=h.useState(null),N=U[0],z=U[1],_=h.useState(null),$=_[0],G=_[1],le=h.useState(null),Z=le[0],V=le[1],J=h.useState(null),ce=J[0],q=J[1],M=h.useState(null),I=M[0],ie=M[1],te=h.useState(null),Q=te[0],fe=te[1],pe=h.useState(null),ye=pe[0],Le=pe[1],Oe=h.useState(null),B=Oe[0],R=Oe[1],oe=h.useState(null),ne=oe[0],de=oe[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 t<"u"&&k!==null&&k.setDraggable(t)},[k,t]),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&&(E!==null&&google.maps.event.removeListener(E),P(google.maps.event.addListener(k,"dblclick",s)))},[s]),h.useEffect(function(){k&&a&&(F!==null&&google.maps.event.removeListener(F),D(google.maps.event.addListener(k,"dragend",a)))},[a]),h.useEffect(function(){k&&l&&(N!==null&&google.maps.event.removeListener(N),z(google.maps.event.addListener(k,"dragstart",l)))},[l]),h.useEffect(function(){k&&c&&($!==null&&google.maps.event.removeListener($),G(google.maps.event.addListener(k,"mousedown",c)))},[c]),h.useEffect(function(){k&&u&&(Z!==null&&google.maps.event.removeListener(Z),V(google.maps.event.addListener(k,"mousemove",u)))},[u]),h.useEffect(function(){k&&d&&(ce!==null&&google.maps.event.removeListener(ce),q(google.maps.event.addListener(k,"mouseout",d)))},[d]),h.useEffect(function(){k&&p&&(I!==null&&google.maps.event.removeListener(I),ie(google.maps.event.addListener(k,"mouseover",p)))},[p]),h.useEffect(function(){k&&f&&(Q!==null&&google.maps.event.removeListener(Q),fe(google.maps.event.addListener(k,"mouseup",f)))},[f]),h.useEffect(function(){k&&m&&(ye!==null&&google.maps.event.removeListener(ye),Le(google.maps.event.addListener(k,"rightclick",m)))},[m]),h.useEffect(function(){k&&g&&(B!==null&&google.maps.event.removeListener(B),R(google.maps.event.addListener(k,"click",g)))},[g]),h.useEffect(function(){k&&y&&(ne!==null&&google.maps.event.removeListener(ne),de(google.maps.event.addListener(k,"drag",y)))},[y]),h.useEffect(function(){var he=new google.maps.Polyline(je(je({},e||OT),{map:S}));return i&&he.setPath(i),typeof o<"u"&&he.setVisible(o),typeof r<"u"&&he.setEditable(r),typeof t<"u"&&he.setDraggable(t),s&&P(google.maps.event.addListener(he,"dblclick",s)),a&&D(google.maps.event.addListener(he,"dragend",a)),l&&z(google.maps.event.addListener(he,"dragstart",l)),c&&G(google.maps.event.addListener(he,"mousedown",c)),u&&V(google.maps.event.addListener(he,"mousemove",u)),d&&q(google.maps.event.addListener(he,"mouseout",d)),p&&ie(google.maps.event.addListener(he,"mouseover",p)),f&&fe(google.maps.event.addListener(he,"mouseup",f)),m&&Le(google.maps.event.addListener(he,"rightclick",m)),g&&R(google.maps.event.addListener(he,"click",g)),y&&de(google.maps.event.addListener(he,"drag",y)),x(he),b&&b(he),function(){E!==null&&google.maps.event.removeListener(E),F!==null&&google.maps.event.removeListener(F),N!==null&&google.maps.event.removeListener(N),$!==null&&google.maps.event.removeListener($),Z!==null&&google.maps.event.removeListener(Z),ce!==null&&google.maps.event.removeListener(ce),I!==null&&google.maps.event.removeListener(I),Q!==null&&google.maps.event.removeListener(Q),ye!==null&&google.maps.event.removeListener(ye),B!==null&&google.maps.event.removeListener(B),w&&w(he),he.setMap(null)}},[]),null}h.memo(LT);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={polyline:null},t.setPolylineCallback=function(){t.state.polyline!==null&&t.props.onLoad&&t.props.onLoad(t.state.polyline)},t}return e.prototype.componentDidMount=function(){var t=new google.maps.Polyline(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:Cg,eventMap:wg,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{polyline:t}},this.setPolylineCallback)},e.prototype.componentDidUpdate=function(t){this.state.polyline!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Cg,eventMap:wg,prevProps:t,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=We,e})(h.PureComponent);var Sg={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},kg={draggable:function(n,e){n.setDraggable(e)},editable:function(n,e){n.setEditable(e)},map:function(n,e){n.setMap(e)},options:function(n,e){n.setOptions(e)},path:function(n,e){n.setPath(e)},paths:function(n,e){n.setPaths(e)},visible:function(n,e){n.setVisible(e)}};function AT(n){var e=n.options,t=n.draggable,r=n.editable,o=n.visible,i=n.path,s=n.paths,a=n.onDblClick,l=n.onDragEnd,c=n.onDragStart,u=n.onMouseDown,d=n.onMouseMove,p=n.onMouseOut,f=n.onMouseOver,m=n.onMouseUp,g=n.onRightClick,y=n.onClick,b=n.onDrag,w=n.onLoad,S=n.onUnmount,T=n.onEdit,k=h.useContext(We),x=h.useState(null),C=x[0],E=x[1],P=h.useState(null),O=P[0],F=P[1],D=h.useState(null),U=D[0],N=D[1],z=h.useState(null),_=z[0],$=z[1],G=h.useState(null),le=G[0],Z=G[1],V=h.useState(null),J=V[0],ce=V[1],q=h.useState(null),M=q[0],I=q[1],ie=h.useState(null),te=ie[0],Q=ie[1],fe=h.useState(null),pe=fe[0],ye=fe[1],Le=h.useState(null),Oe=Le[0],B=Le[1],R=h.useState(null),oe=R[0],ne=R[1],de=h.useState(null),he=de[0],we=de[1];return h.useEffect(function(){C!==null&&C.setMap(k)},[k]),h.useEffect(function(){typeof e<"u"&&C!==null&&C.setOptions(e)},[C,e]),h.useEffect(function(){typeof t<"u"&&C!==null&&C.setDraggable(t)},[C,t]),h.useEffect(function(){typeof r<"u"&&C!==null&&C.setEditable(r)},[C,r]),h.useEffect(function(){typeof o<"u"&&C!==null&&C.setVisible(o)},[C,o]),h.useEffect(function(){typeof i<"u"&&C!==null&&C.setPath(i)},[C,i]),h.useEffect(function(){typeof s<"u"&&C!==null&&C.setPaths(s)},[C,s]),h.useEffect(function(){C&&a&&(O!==null&&google.maps.event.removeListener(O),F(google.maps.event.addListener(C,"dblclick",a)))},[a]),h.useEffect(function(){C&&(google.maps.event.addListener(C.getPath(),"insert_at",function(){T==null||T(C)}),google.maps.event.addListener(C.getPath(),"set_at",function(){T==null||T(C)}))},[C,T]),h.useEffect(function(){C&&l&&(U!==null&&google.maps.event.removeListener(U),N(google.maps.event.addListener(C,"dragend",l)))},[l]),h.useEffect(function(){C&&c&&(_!==null&&google.maps.event.removeListener(_),$(google.maps.event.addListener(C,"dragstart",c)))},[c]),h.useEffect(function(){C&&u&&(le!==null&&google.maps.event.removeListener(le),Z(google.maps.event.addListener(C,"mousedown",u)))},[u]),h.useEffect(function(){C&&d&&(J!==null&&google.maps.event.removeListener(J),ce(google.maps.event.addListener(C,"mousemove",d)))},[d]),h.useEffect(function(){C&&p&&(M!==null&&google.maps.event.removeListener(M),I(google.maps.event.addListener(C,"mouseout",p)))},[p]),h.useEffect(function(){C&&f&&(te!==null&&google.maps.event.removeListener(te),Q(google.maps.event.addListener(C,"mouseover",f)))},[f]),h.useEffect(function(){C&&m&&(pe!==null&&google.maps.event.removeListener(pe),ye(google.maps.event.addListener(C,"mouseup",m)))},[m]),h.useEffect(function(){C&&g&&(Oe!==null&&google.maps.event.removeListener(Oe),B(google.maps.event.addListener(C,"rightclick",g)))},[g]),h.useEffect(function(){C&&y&&(oe!==null&&google.maps.event.removeListener(oe),ne(google.maps.event.addListener(C,"click",y)))},[y]),h.useEffect(function(){C&&b&&(he!==null&&google.maps.event.removeListener(he),we(google.maps.event.addListener(C,"drag",b)))},[b]),h.useEffect(function(){var ve=new google.maps.Polygon(je(je({},e||{}),{map:k}));return i&&ve.setPath(i),s&&ve.setPaths(s),typeof o<"u"&&ve.setVisible(o),typeof r<"u"&&ve.setEditable(r),typeof t<"u"&&ve.setDraggable(t),a&&F(google.maps.event.addListener(ve,"dblclick",a)),l&&N(google.maps.event.addListener(ve,"dragend",l)),c&&$(google.maps.event.addListener(ve,"dragstart",c)),u&&Z(google.maps.event.addListener(ve,"mousedown",u)),d&&ce(google.maps.event.addListener(ve,"mousemove",d)),p&&I(google.maps.event.addListener(ve,"mouseout",p)),f&&Q(google.maps.event.addListener(ve,"mouseover",f)),m&&ye(google.maps.event.addListener(ve,"mouseup",m)),g&&B(google.maps.event.addListener(ve,"rightclick",g)),y&&ne(google.maps.event.addListener(ve,"click",y)),b&&we(google.maps.event.addListener(ve,"drag",b)),E(ve),w&&w(ve),function(){O!==null&&google.maps.event.removeListener(O),U!==null&&google.maps.event.removeListener(U),_!==null&&google.maps.event.removeListener(_),le!==null&&google.maps.event.removeListener(le),J!==null&&google.maps.event.removeListener(J),M!==null&&google.maps.event.removeListener(M),te!==null&&google.maps.event.removeListener(te),pe!==null&&google.maps.event.removeListener(pe),Oe!==null&&google.maps.event.removeListener(Oe),oe!==null&&google.maps.event.removeListener(oe),S&&S(ve),ve.setMap(null)}},[]),null}h.memo(AT);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={polygon:null},t.setPolygonCallback=function(){t.state.polygon!==null&&t.props.onLoad&&t.props.onLoad(t.state.polygon)},t}return e.prototype.componentDidMount=function(){var t=new google.maps.Polygon(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:kg,eventMap:Sg,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{polygon:t}},this.setPolygonCallback)},e.prototype.componentDidUpdate=function(t){this.state.polygon!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:kg,eventMap:Sg,prevProps:t,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=We,e})(h.PureComponent);var Mg={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"},Eg={bounds:function(n,e){n.setBounds(e)},draggable:function(n,e){n.setDraggable(e)},editable:function(n,e){n.setEditable(e)},map:function(n,e){n.setMap(e)},options:function(n,e){n.setOptions(e)},visible:function(n,e){n.setVisible(e)}};function PT(n){var e=n.options,t=n.bounds,r=n.draggable,o=n.editable,i=n.visible,s=n.onDblClick,a=n.onDragEnd,l=n.onDragStart,c=n.onMouseDown,u=n.onMouseMove,d=n.onMouseOut,p=n.onMouseOver,f=n.onMouseUp,m=n.onRightClick,g=n.onClick,y=n.onDrag,b=n.onBoundsChanged,w=n.onLoad,S=n.onUnmount,T=h.useContext(We),k=h.useState(null),x=k[0],C=k[1],E=h.useState(null),P=E[0],O=E[1],F=h.useState(null),D=F[0],U=F[1],N=h.useState(null),z=N[0],_=N[1],$=h.useState(null),G=$[0],le=$[1],Z=h.useState(null),V=Z[0],J=Z[1],ce=h.useState(null),q=ce[0],M=ce[1],I=h.useState(null),ie=I[0],te=I[1],Q=h.useState(null),fe=Q[0],pe=Q[1],ye=h.useState(null),Le=ye[0],Oe=ye[1],B=h.useState(null),R=B[0],oe=B[1],ne=h.useState(null),de=ne[0],he=ne[1],we=h.useState(null),ve=we[0],me=we[1];return h.useEffect(function(){x!==null&&x.setMap(T)},[T]),h.useEffect(function(){typeof e<"u"&&x!==null&&x.setOptions(e)},[x,e]),h.useEffect(function(){typeof r<"u"&&x!==null&&x.setDraggable(r)},[x,r]),h.useEffect(function(){typeof o<"u"&&x!==null&&x.setEditable(o)},[x,o]),h.useEffect(function(){typeof i<"u"&&x!==null&&x.setVisible(i)},[x,i]),h.useEffect(function(){typeof t<"u"&&x!==null&&x.setBounds(t)},[x,t]),h.useEffect(function(){x&&s&&(P!==null&&google.maps.event.removeListener(P),O(google.maps.event.addListener(x,"dblclick",s)))},[s]),h.useEffect(function(){x&&a&&(D!==null&&google.maps.event.removeListener(D),U(google.maps.event.addListener(x,"dragend",a)))},[a]),h.useEffect(function(){x&&l&&(z!==null&&google.maps.event.removeListener(z),_(google.maps.event.addListener(x,"dragstart",l)))},[l]),h.useEffect(function(){x&&c&&(G!==null&&google.maps.event.removeListener(G),le(google.maps.event.addListener(x,"mousedown",c)))},[c]),h.useEffect(function(){x&&u&&(V!==null&&google.maps.event.removeListener(V),J(google.maps.event.addListener(x,"mousemove",u)))},[u]),h.useEffect(function(){x&&d&&(q!==null&&google.maps.event.removeListener(q),M(google.maps.event.addListener(x,"mouseout",d)))},[d]),h.useEffect(function(){x&&p&&(ie!==null&&google.maps.event.removeListener(ie),te(google.maps.event.addListener(x,"mouseover",p)))},[p]),h.useEffect(function(){x&&f&&(fe!==null&&google.maps.event.removeListener(fe),pe(google.maps.event.addListener(x,"mouseup",f)))},[f]),h.useEffect(function(){x&&m&&(Le!==null&&google.maps.event.removeListener(Le),Oe(google.maps.event.addListener(x,"rightclick",m)))},[m]),h.useEffect(function(){x&&g&&(R!==null&&google.maps.event.removeListener(R),oe(google.maps.event.addListener(x,"click",g)))},[g]),h.useEffect(function(){x&&y&&(de!==null&&google.maps.event.removeListener(de),he(google.maps.event.addListener(x,"drag",y)))},[y]),h.useEffect(function(){x&&b&&(ve!==null&&google.maps.event.removeListener(ve),me(google.maps.event.addListener(x,"bounds_changed",b)))},[b]),h.useEffect(function(){var ue=new google.maps.Rectangle(je(je({},e||{}),{map:T}));return typeof i<"u"&&ue.setVisible(i),typeof o<"u"&&ue.setEditable(o),typeof r<"u"&&ue.setDraggable(r),typeof t<"u"&&ue.setBounds(t),s&&O(google.maps.event.addListener(ue,"dblclick",s)),a&&U(google.maps.event.addListener(ue,"dragend",a)),l&&_(google.maps.event.addListener(ue,"dragstart",l)),c&&le(google.maps.event.addListener(ue,"mousedown",c)),u&&J(google.maps.event.addListener(ue,"mousemove",u)),d&&M(google.maps.event.addListener(ue,"mouseout",d)),p&&te(google.maps.event.addListener(ue,"mouseover",p)),f&&pe(google.maps.event.addListener(ue,"mouseup",f)),m&&Oe(google.maps.event.addListener(ue,"rightclick",m)),g&&oe(google.maps.event.addListener(ue,"click",g)),y&&he(google.maps.event.addListener(ue,"drag",y)),b&&me(google.maps.event.addListener(ue,"bounds_changed",b)),C(ue),w&&w(ue),function(){P!==null&&google.maps.event.removeListener(P),D!==null&&google.maps.event.removeListener(D),z!==null&&google.maps.event.removeListener(z),G!==null&&google.maps.event.removeListener(G),V!==null&&google.maps.event.removeListener(V),q!==null&&google.maps.event.removeListener(q),ie!==null&&google.maps.event.removeListener(ie),fe!==null&&google.maps.event.removeListener(fe),Le!==null&&google.maps.event.removeListener(Le),R!==null&&google.maps.event.removeListener(R),de!==null&&google.maps.event.removeListener(de),ve!==null&&google.maps.event.removeListener(ve),S&&S(ue),ue.setMap(null)}},[]),null}h.memo(PT);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={rectangle:null},t.setRectangleCallback=function(){t.state.rectangle!==null&&t.props.onLoad&&t.props.onLoad(t.state.rectangle)},t}return e.prototype.componentDidMount=function(){var t=new google.maps.Rectangle(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:Eg,eventMap:Mg,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{rectangle:t}},this.setRectangleCallback)},e.prototype.componentDidUpdate=function(t){this.state.rectangle!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Eg,eventMap:Mg,prevProps:t,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=We,e})(h.PureComponent);var Tg={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"},Og={center:function(n,e){n.setCenter(e)},draggable:function(n,e){n.setDraggable(e)},editable:function(n,e){n.setEditable(e)},map:function(n,e){n.setMap(e)},options:function(n,e){n.setOptions(e)},radius:function(n,e){n.setRadius(e)},visible:function(n,e){n.setVisible(e)}},DT={};function RT(n){var e=n.options,t=n.center,r=n.radius,o=n.draggable,i=n.editable,s=n.visible,a=n.onDblClick,l=n.onDragEnd,c=n.onDragStart,u=n.onMouseDown,d=n.onMouseMove,p=n.onMouseOut,f=n.onMouseOver,m=n.onMouseUp,g=n.onRightClick,y=n.onClick,b=n.onDrag,w=n.onCenterChanged,S=n.onRadiusChanged,T=n.onLoad,k=n.onUnmount,x=h.useContext(We),C=h.useState(null),E=C[0],P=C[1],O=h.useState(null),F=O[0],D=O[1],U=h.useState(null),N=U[0],z=U[1],_=h.useState(null),$=_[0],G=_[1],le=h.useState(null),Z=le[0],V=le[1],J=h.useState(null),ce=J[0],q=J[1],M=h.useState(null),I=M[0],ie=M[1],te=h.useState(null),Q=te[0],fe=te[1],pe=h.useState(null),ye=pe[0],Le=pe[1],Oe=h.useState(null),B=Oe[0],R=Oe[1],oe=h.useState(null),ne=oe[0],de=oe[1],he=h.useState(null),we=he[0],ve=he[1],me=h.useState(null),ue=me[0],_e=me[1],Ee=h.useState(null),Ae=Ee[0],He=Ee[1];return h.useEffect(function(){E!==null&&E.setMap(x)},[x]),h.useEffect(function(){typeof e<"u"&&E!==null&&E.setOptions(e)},[E,e]),h.useEffect(function(){typeof o<"u"&&E!==null&&E.setDraggable(o)},[E,o]),h.useEffect(function(){typeof i<"u"&&E!==null&&E.setEditable(i)},[E,i]),h.useEffect(function(){typeof s<"u"&&E!==null&&E.setVisible(s)},[E,s]),h.useEffect(function(){typeof r=="number"&&E!==null&&E.setRadius(r)},[E,r]),h.useEffect(function(){typeof t<"u"&&E!==null&&E.setCenter(t)},[E,t]),h.useEffect(function(){E&&a&&(F!==null&&google.maps.event.removeListener(F),D(google.maps.event.addListener(E,"dblclick",a)))},[a]),h.useEffect(function(){E&&l&&(N!==null&&google.maps.event.removeListener(N),z(google.maps.event.addListener(E,"dragend",l)))},[l]),h.useEffect(function(){E&&c&&($!==null&&google.maps.event.removeListener($),G(google.maps.event.addListener(E,"dragstart",c)))},[c]),h.useEffect(function(){E&&u&&(Z!==null&&google.maps.event.removeListener(Z),V(google.maps.event.addListener(E,"mousedown",u)))},[u]),h.useEffect(function(){E&&d&&(ce!==null&&google.maps.event.removeListener(ce),q(google.maps.event.addListener(E,"mousemove",d)))},[d]),h.useEffect(function(){E&&p&&(I!==null&&google.maps.event.removeListener(I),ie(google.maps.event.addListener(E,"mouseout",p)))},[p]),h.useEffect(function(){E&&f&&(Q!==null&&google.maps.event.removeListener(Q),fe(google.maps.event.addListener(E,"mouseover",f)))},[f]),h.useEffect(function(){E&&m&&(ye!==null&&google.maps.event.removeListener(ye),Le(google.maps.event.addListener(E,"mouseup",m)))},[m]),h.useEffect(function(){E&&g&&(B!==null&&google.maps.event.removeListener(B),R(google.maps.event.addListener(E,"rightclick",g)))},[g]),h.useEffect(function(){E&&y&&(ne!==null&&google.maps.event.removeListener(ne),de(google.maps.event.addListener(E,"click",y)))},[y]),h.useEffect(function(){E&&b&&(we!==null&&google.maps.event.removeListener(we),ve(google.maps.event.addListener(E,"drag",b)))},[b]),h.useEffect(function(){E&&w&&(ue!==null&&google.maps.event.removeListener(ue),_e(google.maps.event.addListener(E,"center_changed",w)))},[y]),h.useEffect(function(){E&&S&&(Ae!==null&&google.maps.event.removeListener(Ae),He(google.maps.event.addListener(E,"radius_changed",S)))},[S]),h.useEffect(function(){var Pe=new google.maps.Circle(je(je({},e||DT),{map:x}));return typeof r=="number"&&Pe.setRadius(r),typeof t<"u"&&Pe.setCenter(t),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&&D(google.maps.event.addListener(Pe,"dblclick",a)),l&&z(google.maps.event.addListener(Pe,"dragend",l)),c&&G(google.maps.event.addListener(Pe,"dragstart",c)),u&&V(google.maps.event.addListener(Pe,"mousedown",u)),d&&q(google.maps.event.addListener(Pe,"mousemove",d)),p&&ie(google.maps.event.addListener(Pe,"mouseout",p)),f&&fe(google.maps.event.addListener(Pe,"mouseover",f)),m&&Le(google.maps.event.addListener(Pe,"mouseup",m)),g&&R(google.maps.event.addListener(Pe,"rightclick",g)),y&&de(google.maps.event.addListener(Pe,"click",y)),b&&ve(google.maps.event.addListener(Pe,"drag",b)),w&&_e(google.maps.event.addListener(Pe,"center_changed",w)),S&&He(google.maps.event.addListener(Pe,"radius_changed",S)),P(Pe),T&&T(Pe),function(){F!==null&&google.maps.event.removeListener(F),N!==null&&google.maps.event.removeListener(N),$!==null&&google.maps.event.removeListener($),Z!==null&&google.maps.event.removeListener(Z),ce!==null&&google.maps.event.removeListener(ce),I!==null&&google.maps.event.removeListener(I),Q!==null&&google.maps.event.removeListener(Q),ye!==null&&google.maps.event.removeListener(ye),B!==null&&google.maps.event.removeListener(B),ne!==null&&google.maps.event.removeListener(ne),ue!==null&&google.maps.event.removeListener(ue),Ae!==null&&google.maps.event.removeListener(Ae),k&&k(Pe),Pe.setMap(null)}},[]),null}h.memo(RT);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={circle:null},t.setCircleCallback=function(){t.state.circle!==null&&t.props.onLoad&&t.props.onLoad(t.state.circle)},t}return e.prototype.componentDidMount=function(){var t=new google.maps.Circle(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:Og,eventMap:Tg,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{circle:t}},this.setCircleCallback)},e.prototype.componentDidUpdate=function(t){this.state.circle!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Og,eventMap:Tg,prevProps:t,nextProps:this.props,instance:this.state.circle}))},e.prototype.componentWillUnmount=function(){var t;this.state.circle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),Qe(this.registeredEvents),(t=this.state.circle)===null||t===void 0||t.setMap(null))},e.prototype.render=function(){return null},e.contextType=We,e})(h.PureComponent);var Lg={onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick",onAddFeature:"addfeature",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},Ag={add:function(n,e){n.add(e)},addgeojson:function(n,e,t){n.addGeoJson(e,t)},contains:function(n,e){n.contains(e)},foreach:function(n,e){n.forEach(e)},loadgeojson:function(n,e,t,r){n.loadGeoJson(e,t,r)},overridestyle:function(n,e,t){n.overrideStyle(e,t)},remove:function(n,e){n.remove(e)},revertstyle:function(n,e){n.revertStyle(e)},controlposition:function(n,e){n.setControlPosition(e)},controls:function(n,e){n.setControls(e)},drawingmode:function(n,e){n.setDrawingMode(e)},map:function(n,e){n.setMap(e)},style:function(n,e){n.setStyle(e)},togeojson:function(n,e){n.toGeoJson(e)}};function IT(n){var e=n.options,t=n.onClick,r=n.onDblClick,o=n.onMouseDown,i=n.onMouseMove,s=n.onMouseOut,a=n.onMouseOver,l=n.onMouseUp,c=n.onRightClick,u=n.onAddFeature,d=n.onRemoveFeature,p=n.onRemoveProperty,f=n.onSetGeometry,m=n.onSetProperty,g=n.onLoad,y=n.onUnmount,b=h.useContext(We),w=h.useState(null),S=w[0],T=w[1],k=h.useState(null),x=k[0],C=k[1],E=h.useState(null),P=E[0],O=E[1],F=h.useState(null),D=F[0],U=F[1],N=h.useState(null),z=N[0],_=N[1],$=h.useState(null),G=$[0],le=$[1],Z=h.useState(null),V=Z[0],J=Z[1],ce=h.useState(null),q=ce[0],M=ce[1],I=h.useState(null),ie=I[0],te=I[1],Q=h.useState(null),fe=Q[0],pe=Q[1],ye=h.useState(null),Le=ye[0],Oe=ye[1],B=h.useState(null),R=B[0],oe=B[1],ne=h.useState(null),de=ne[0],he=ne[1],we=h.useState(null),ve=we[0],me=we[1];return h.useEffect(function(){S!==null&&S.setMap(b)},[b]),h.useEffect(function(){S&&r&&(x!==null&&google.maps.event.removeListener(x),C(google.maps.event.addListener(S,"dblclick",r)))},[r]),h.useEffect(function(){S&&o&&(P!==null&&google.maps.event.removeListener(P),O(google.maps.event.addListener(S,"mousedown",o)))},[o]),h.useEffect(function(){S&&i&&(D!==null&&google.maps.event.removeListener(D),U(google.maps.event.addListener(S,"mousemove",i)))},[i]),h.useEffect(function(){S&&s&&(z!==null&&google.maps.event.removeListener(z),_(google.maps.event.addListener(S,"mouseout",s)))},[s]),h.useEffect(function(){S&&a&&(G!==null&&google.maps.event.removeListener(G),le(google.maps.event.addListener(S,"mouseover",a)))},[a]),h.useEffect(function(){S&&l&&(V!==null&&google.maps.event.removeListener(V),J(google.maps.event.addListener(S,"mouseup",l)))},[l]),h.useEffect(function(){S&&c&&(q!==null&&google.maps.event.removeListener(q),M(google.maps.event.addListener(S,"rightclick",c)))},[c]),h.useEffect(function(){S&&t&&(ie!==null&&google.maps.event.removeListener(ie),te(google.maps.event.addListener(S,"click",t)))},[t]),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&&(Le!==null&&google.maps.event.removeListener(Le),Oe(google.maps.event.addListener(S,"removefeature",d)))},[d]),h.useEffect(function(){S&&p&&(R!==null&&google.maps.event.removeListener(R),oe(google.maps.event.addListener(S,"removeproperty",p)))},[p]),h.useEffect(function(){S&&f&&(de!==null&&google.maps.event.removeListener(de),he(google.maps.event.addListener(S,"setgeometry",f)))},[f]),h.useEffect(function(){S&&m&&(ve!==null&&google.maps.event.removeListener(ve),me(google.maps.event.addListener(S,"setproperty",m)))},[m]),h.useEffect(function(){if(b!==null){var ue=new google.maps.Data(je(je({},e||{}),{map:b}));r&&C(google.maps.event.addListener(ue,"dblclick",r)),o&&O(google.maps.event.addListener(ue,"mousedown",o)),i&&U(google.maps.event.addListener(ue,"mousemove",i)),s&&_(google.maps.event.addListener(ue,"mouseout",s)),a&&le(google.maps.event.addListener(ue,"mouseover",a)),l&&J(google.maps.event.addListener(ue,"mouseup",l)),c&&M(google.maps.event.addListener(ue,"rightclick",c)),t&&te(google.maps.event.addListener(ue,"click",t)),u&&pe(google.maps.event.addListener(ue,"addfeature",u)),d&&Oe(google.maps.event.addListener(ue,"removefeature",d)),p&&oe(google.maps.event.addListener(ue,"removeproperty",p)),f&&he(google.maps.event.addListener(ue,"setgeometry",f)),m&&me(google.maps.event.addListener(ue,"setproperty",m)),T(ue),g&&g(ue)}return function(){S&&(x!==null&&google.maps.event.removeListener(x),P!==null&&google.maps.event.removeListener(P),D!==null&&google.maps.event.removeListener(D),z!==null&&google.maps.event.removeListener(z),G!==null&&google.maps.event.removeListener(G),V!==null&&google.maps.event.removeListener(V),q!==null&&google.maps.event.removeListener(q),ie!==null&&google.maps.event.removeListener(ie),fe!==null&&google.maps.event.removeListener(fe),Le!==null&&google.maps.event.removeListener(Le),R!==null&&google.maps.event.removeListener(R),de!==null&&google.maps.event.removeListener(de),ve!==null&&google.maps.event.removeListener(ve),y&&y(S),S.setMap(null))}},[]),null}h.memo(IT);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={data:null},t.setDataCallback=function(){t.state.data!==null&&t.props.onLoad&&t.props.onLoad(t.state.data)},t}return e.prototype.componentDidMount=function(){if(this.context!==null){var t=new google.maps.Data(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:Ag,eventMap:Lg,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{data:t}},this.setDataCallback)}},e.prototype.componentDidUpdate=function(t){this.state.data!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Ag,eventMap:Lg,prevProps:t,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=We,e})(h.PureComponent);var Pg={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},Dg={options:function(n,e){n.setOptions(e)},url:function(n,e){n.setUrl(e)},zIndex:function(n,e){n.setZIndex(e)}};(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={kmlLayer:null},t.setKmlLayerCallback=function(){t.state.kmlLayer!==null&&t.props.onLoad&&t.props.onLoad(t.state.kmlLayer)},t}return e.prototype.componentDidMount=function(){var t=new google.maps.KmlLayer(je(je({},this.props.options),{map:this.context}));this.registeredEvents=Ye({updaterMap:Dg,eventMap:Pg,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{kmlLayer:t}},this.setKmlLayerCallback)},e.prototype.componentDidUpdate=function(t){this.state.kmlLayer!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Dg,eventMap:Pg,prevProps:t,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=We,e})(h.PureComponent);function Gb(n,e){return typeof e=="function"?e(n.offsetWidth,n.offsetHeight):{x:0,y:0}}function $T(n,e){return new e(n.lat,n.lng)}function NT(n,e){return new e(new google.maps.LatLng(n.ne.lat,n.ne.lng),new google.maps.LatLng(n.sw.lat,n.sw.lng))}function BT(n,e,t){return n instanceof e?n:t(n,e)}function FT(n,e,t){return n instanceof e?n:t(n,e)}function jT(n,e,t){var r=n&&n.fromLatLngToDivPixel(t.getNorthEast()),o=n&&n.fromLatLngToDivPixel(t.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 _T(n,e,t){var r=n&&n.fromLatLngToDivPixel(t);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 Kb(n,e,t,r){return t!==void 0?jT(n,e,FT(t,google.maps.LatLngBounds,NT)):_T(n,e,BT(r,google.maps.LatLng,$T))}function zT(n,e){return n.left===e.left&&n.top===e.top&&n.width===e.height&&n.height===e.height}function HT(n,e,t,r,o){var i=function(s){gt(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=je({},this.container?Gb(this.container,o):{x:0,y:0}),u=Kb(l,c,this.bounds,this.position),d=0,p=Object.entries(u);d? %s',google.maps.visualization),jt(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);var t=new google.maps.visualization.HeatmapLayer(je(je({},this.props.options||{}),{data:this.props.data,map:this.context}));this.registeredEvents=Ye({updaterMap:Fg,eventMap:Bg,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{heatmapLayer:t}},this.setHeatmapLayerCallback)},e.prototype.componentDidUpdate=function(t){Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Fg,eventMap:Bg,prevProps:t,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=We,e})(h.PureComponent);var jg={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},_g={register:function(n,e,t){n.registerPanoProvider(e,t)},links:function(n,e){n.setLinks(e)},motionTracking:function(n,e){n.setMotionTracking(e)},options:function(n,e){n.setOptions(e)},pano:function(n,e){n.setPano(e)},position:function(n,e){n.setPosition(e)},pov:function(n,e){n.setPov(e)},visible:function(n,e){n.setVisible(e)},zoom:function(n,e){n.setZoom(e)}};(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={streetViewPanorama:null},t.setStreetViewPanoramaCallback=function(){t.state.streetViewPanorama!==null&&t.props.onLoad&&t.props.onLoad(t.state.streetViewPanorama)},t}return e.prototype.componentDidMount=function(){var t,r,o=(r=(t=this.context)===null||t===void 0?void 0:t.getStreetView())!==null&&r!==void 0?r:null;this.registeredEvents=Ye({updaterMap:_g,eventMap:jg,prevProps:{},nextProps:this.props,instance:o}),this.setState(function(){return{streetViewPanorama:o}},this.setStreetViewPanoramaCallback)},e.prototype.componentDidUpdate=function(t){this.state.streetViewPanorama!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:_g,eventMap:jg,prevProps:t,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=We,e})(h.PureComponent);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={streetViewService:null},t.setStreetViewServiceCallback=function(){t.state.streetViewService!==null&&t.props.onLoad&&t.props.onLoad(t.state.streetViewService)},t}return e.prototype.componentDidMount=function(){var t=new google.maps.StreetViewService;this.setState(function(){return{streetViewService:t}},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=We,e})(h.PureComponent);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={directionsService:null},t.setDirectionsServiceCallback=function(){t.state.directionsService!==null&&t.props.onLoad&&t.props.onLoad(t.state.directionsService)},t}return e.prototype.componentDidMount=function(){jt(!!this.props.options,"DirectionsService expected options object as parameter, but got %s",this.props.options);var t=new google.maps.DirectionsService;this.setState(function(){return{directionsService:t}},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 zg={onDirectionsChanged:"directions_changed"},Hg={directions:function(n,e){n.setDirections(e)},map:function(n,e){n.setMap(e)},options:function(n,e){n.setOptions(e)},panel:function(n,e){n.setPanel(e)},routeIndex:function(n,e){n.setRouteIndex(e)}};(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={directionsRenderer:null},t.setDirectionsRendererCallback=function(){t.state.directionsRenderer!==null&&(t.state.directionsRenderer.setMap(t.context),t.props.onLoad&&t.props.onLoad(t.state.directionsRenderer))},t}return e.prototype.componentDidMount=function(){var t=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=Ye({updaterMap:Hg,eventMap:zg,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{directionsRenderer:t}},this.setDirectionsRendererCallback)},e.prototype.componentDidUpdate=function(t){this.state.directionsRenderer!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Hg,eventMap:zg,prevProps:t,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=We,e})(h.PureComponent);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={distanceMatrixService:null},t.setDistanceMatrixServiceCallback=function(){t.state.distanceMatrixService!==null&&t.props.onLoad&&t.props.onLoad(t.state.distanceMatrixService)},t}return e.prototype.componentDidMount=function(){jt(!!this.props.options,"DistanceMatrixService expected options object as parameter, but go %s",this.props.options);var t=new google.maps.DistanceMatrixService;this.setState(function(){return{distanceMatrixService:t}},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 Vg={onPlacesChanged:"places_changed"},Ug={bounds:function(n,e){n.setBounds(e)}};(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.containerElement=h.createRef(),t.state={searchBox:null},t.setSearchBoxCallback=function(){t.state.searchBox!==null&&t.props.onLoad&&t.props.onLoad(t.state.searchBox)},t}return e.prototype.componentDidMount=function(){if(jt(!!google.maps.places,'You need to provide libraries={["places"]} prop to component %s',google.maps.places),this.containerElement!==null&&this.containerElement.current!==null){var t=this.containerElement.current.querySelector("input");if(t!==null){var r=new google.maps.places.SearchBox(t,this.props.options);this.registeredEvents=Ye({updaterMap:Ug,eventMap:Vg,prevProps:{},nextProps:this.props,instance:r}),this.setState(function(){return{searchBox:r}},this.setSearchBoxCallback)}}},e.prototype.componentDidUpdate=function(t){this.state.searchBox!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Ug,eventMap:Vg,prevProps:t,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=We,e})(h.PureComponent);var Wg={onPlaceChanged:"place_changed"},Gg={bounds:function(n,e){n.setBounds(e)},restrictions:function(n,e){n.setComponentRestrictions(e)},fields:function(n,e){n.setFields(e)},options:function(n,e){n.setOptions(e)},types:function(n,e){n.setTypes(e)}};(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.containerElement=h.createRef(),t.state={autocomplete:null},t.setAutocompleteCallback=function(){t.state.autocomplete!==null&&t.props.onLoad&&t.props.onLoad(t.state.autocomplete)},t}return e.prototype.componentDidMount=function(){var t;jt(!!google.maps.places,'You need to provide libraries={["places"]} prop to component %s',google.maps.places);var r=(t=this.containerElement.current)===null||t===void 0?void 0:t.querySelector("input");if(r){var o=new google.maps.places.Autocomplete(r,this.props.options);this.registeredEvents=Ye({updaterMap:Gg,eventMap:Wg,prevProps:{},nextProps:this.props,instance:o}),this.setState(function(){return{autocomplete:o}},this.setAutocompleteCallback)}},e.prototype.componentDidUpdate=function(t){Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Gg,eventMap:Wg,prevProps:t,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=We,e})(h.PureComponent);var H;(function(n){n.UK="UK",n.GB="GB",n.JE="JE",n.GG="GG",n.IM="IM",n.US="US",n.CA="CA",n.IE="IE",n.DE="DE",n.JP="JP",n.FR="FR",n.AU="AU",n.IT="IT",n.CH="CH",n.AT="AT",n.ES="ES",n.NL="NL",n.BE="BE",n.DK="DK",n.SE="SE",n.NO="NO",n.BR="BR",n.PT="PT",n.FI="FI",n.AX="AX",n.KR="KR",n.CN="CN",n.TW="TW",n.SG="SG",n.DZ="DZ",n.AD="AD",n.AR="AR",n.AM="AM",n.AZ="AZ",n.BH="BH",n.BD="BD",n.BB="BB",n.BY="BY",n.BM="BM",n.BA="BA",n.IO="IO",n.BN="BN",n.BG="BG",n.KH="KH",n.CV="CV",n.CL="CL",n.CR="CR",n.HR="HR",n.CY="CY",n.CZ="CZ",n.DO="DO",n.EC="EC",n.EG="EG",n.EE="EE",n.FO="FO",n.GE="GE",n.GR="GR",n.GL="GL",n.GT="GT",n.HT="HT",n.HN="HN",n.HU="HU",n.IS="IS",n.IN="IN",n.ID="ID",n.IL="IL",n.JO="JO",n.KZ="KZ",n.KE="KE",n.KW="KW",n.KY="KY",n.LA="LA",n.LV="LV",n.LB="LB",n.LI="LI",n.LT="LT",n.LU="LU",n.MK="MK",n.MY="MY",n.MV="MV",n.MT="MT",n.MU="MU",n.MX="MX",n.MD="MD",n.MC="MC",n.MA="MA",n.NP="NP",n.NZ="NZ",n.NI="NI",n.NG="NG",n.OM="OM",n.PA="PA",n.PK="PK",n.PY="PY",n.PH="PH",n.PL="PL",n.PR="PR",n.RO="RO",n.RU="RU",n.SM="SM",n.SA="SA",n.SN="SN",n.SK="SK",n.SI="SI",n.ZA="ZA",n.LK="LK",n.TJ="TJ",n.TH="TH",n.TN="TN",n.TR="TR",n.TM="TM",n.UA="UA",n.UY="UY",n.UZ="UZ",n.VA="VA",n.VE="VE",n.ZM="ZM",n.AS="AS",n.CC="CC",n.CK="CK",n.RS="RS",n.ME="ME",n.CS="CS",n.YU="YU",n.CX="CX",n.ET="ET",n.FK="FK",n.NF="NF",n.FM="FM",n.GF="GF",n.GN="GN",n.GP="GP",n.GS="GS",n.GU="GU",n.GW="GW",n.HM="HM",n.IQ="IQ",n.KG="KG",n.LR="LR",n.LS="LS",n.MG="MG",n.MH="MH",n.MN="MN",n.MP="MP",n.MQ="MQ",n.NC="NC",n.NE="NE",n.VI="VI",n.VN="VN",n.PF="PF",n.PG="PG",n.PM="PM",n.PN="PN",n.PW="PW",n.RE="RE",n.SH="SH",n.SJ="SJ",n.SO="SO",n.SZ="SZ",n.TC="TC",n.WF="WF",n.XK="XK",n.YT="YT",n.PE="PE",n.INTL="INTL",n.CO="CO"})(H||(H={}));const qd=new Map([[H.UK,/^([A-Z]){1}([0-9][0-9]|[0-9]|[A-Z][0-9][A-Z]|[A-Z][0-9][0-9]|[A-Z][0-9]|[0-9][A-Z]){1}([ ])?([0-9][A-z][A-z]){1}$/i],[H.GB,/^([A-Z]){1}([0-9][0-9]|[0-9]|[A-Z][0-9][A-Z]|[A-Z][0-9][0-9]|[A-Z][0-9]|[0-9][A-Z]){1}([ ])?([0-9][A-z][A-z]){1}$/i],[H.JE,/^JE\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/],[H.GG,/^GY\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/],[H.IM,/^IM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/],[H.US,/^([0-9]{5})(?:-([0-9]{4}))?$/],[H.CA,/^([ABCEGHJKLMNPRSTVXY][0-9][ABCEGHJKLMNPRSTVWXYZ])\s*([0-9][ABCEGHJKLMNPRSTVWXYZ][0-9])$/i],[H.IE,/^([AC-FHKNPRTV-Y][0-9]{2}|D6W)[ -]?[0-9AC-FHKNPRTV-Y]{4}$/],[H.DE,/^\d{5}$/],[H.JP,/^\d{3}-\d{4}$/],[H.FR,/^\d{2}[ ]?\d{3}$/],[H.AU,/^\d{4}$/],[H.IT,/^\d{5}$/],[H.CH,/^\d{4}$/],[H.AT,/^(?!0)\d{4}$/],[H.ES,/^(?:0[1-9]|[1-4]\d|5[0-2])\d{3}$/],[H.NL,/^\d{4}[ ]?[A-Z]{2}$/],[H.BE,/^\d{4}$/],[H.DK,/^\d{4}$/],[H.SE,/^(SE-)?\d{3}[ ]?\d{2}$/],[H.NO,/^\d{4}$/],[H.BR,/^\d{5}[\-]?\d{3}$/],[H.PT,/^\d{4}([\-]\d{3})?$/],[H.FI,/^(FI-|AX-)?\d{5}$/],[H.AX,/^22\d{3}$/],[H.KR,/^\d{5}$/],[H.CN,/^\d{6}$/],[H.TW,/^\d{3}(\d{2,3})?$/],[H.SG,/^\d{6}$/],[H.DZ,/^\d{5}$/],[H.AD,/^AD\d{3}$/],[H.AR,/^([A-HJ-NP-Z])?\d{4}([A-Z]{3})?$/],[H.AM,/^(37)?\d{4}$/],[H.AZ,/^\d{4}$/],[H.BH,/^((1[0-2]|[2-9])\d{2})?$/],[H.BD,/^\d{4}$/],[H.BB,/^(BB\d{5})?$/],[H.BY,/^\d{6}$/],[H.BM,/^[A-Z]{2}[ ]?[A-Z0-9]{2}$/],[H.BA,/^\d{5}$/],[H.IO,/^BBND 1ZZ$/],[H.BN,/^[A-Z]{2}[ ]?\d{4}$/],[H.BG,/^\d{4}$/],[H.KH,/^\d{5}$/],[H.CV,/^\d{4}$/],[H.CL,/^\d{7}$/],[H.CR,/^(\d{4,5}|\d{3}-\d{4})$/],[H.HR,/^(HR-)?\d{5}$/],[H.CY,/^\d{4}$/],[H.CZ,/^\d{3}[ ]?\d{2}$/],[H.DO,/^\d{5}$/],[H.EC,/^([A-Z]\d{4}[A-Z]|(?:[A-Z]{2})?\d{6})?$/],[H.EG,/^\d{5}$/],[H.EE,/^\d{5}$/],[H.FO,/^\d{3}$/],[H.GE,/^\d{4}$/],[H.GR,/^\d{3}[ ]?\d{2}$/],[H.GL,/^39\d{2}$/],[H.GT,/^\d{5}$/],[H.HT,/^\d{4}$/],[H.HN,/^(?:\d{5})?$/],[H.HU,/^\d{4}$/],[H.IS,/^\d{3}$/],[H.IN,/^\d{6}$/],[H.ID,/^\d{5}$/],[H.IL,/^\d{5,7}$/],[H.JO,/^\d{5}$/],[H.KZ,/^\d{6}$/],[H.KE,/^\d{5}$/],[H.KW,/^\d{5}$/],[H.KY,/^KY[123]-\d{4}$/],[H.LA,/^\d{5}$/],[H.LV,/^(LV-)?\d{4}$/],[H.LB,/^(\d{4}([ ]?\d{4})?)?$/],[H.LI,/^(948[5-9])|(949[0-7])$/],[H.LT,/^(LT-)?\d{5}$/],[H.LU,/^(L-)?\d{4}$/],[H.MK,/^\d{4}$/],[H.MY,/^\d{5}$/],[H.MV,/^\d{5}$/],[H.MT,/^[A-Z]{3}[ ]?\d{2,4}$/],[H.MU,/^((\d|[A-Z])\d{4})?$/],[H.MX,/^\d{5}$/],[H.MD,/^\d{4}$/],[H.MC,/^980\d{2}$/],[H.MA,/^\d{5}$/],[H.NP,/^\d{5}$/],[H.NZ,/^\d{4}$/],[H.NI,/^((\d{4}-)?\d{3}-\d{3}(-\d{1})?)?$/],[H.NG,/^(\d{6})?$/],[H.OM,/^(PC )?\d{3}$/],[H.PA,/^\d{4}$/],[H.PK,/^\d{5}$/],[H.PY,/^\d{4}$/],[H.PH,/^\d{4}$/],[H.PL,/^\d{2}-\d{3}$/],[H.PR,/^00[679]\d{2}([ \-]\d{4})?$/],[H.RO,/^\d{6}$/],[H.RU,/^\d{6}$/],[H.SM,/^4789\d$/],[H.SA,/^\d{5}$/],[H.SN,/^\d{5}$/],[H.SK,/^\d{3}[ ]?\d{2}$/],[H.SI,/^(SI-)?\d{4}$/],[H.ZA,/^\d{4}$/],[H.LK,/^\d{5}$/],[H.TJ,/^\d{6}$/],[H.TH,/^\d{5}$/],[H.TN,/^\d{4}$/],[H.TR,/^\d{5}$/],[H.TM,/^\d{6}$/],[H.UA,/^\d{5}$/],[H.UY,/^\d{5}$/],[H.UZ,/^\d{6}$/],[H.VA,/^00120$/],[H.VE,/^\d{4}$/],[H.ZM,/^\d{5}$/],[H.AS,/^96799$/],[H.CC,/^6799$/],[H.CK,/^\d{4}$/],[H.RS,/^\d{5,6}$/],[H.ME,/^8\d{4}$/],[H.CS,/^\d{5}$/],[H.YU,/^\d{5}$/],[H.CX,/^6798$/],[H.ET,/^\d{4}$/],[H.FK,/^FIQQ 1ZZ$/],[H.NF,/^2899$/],[H.FM,/^(9694[1-4])([ \-]\d{4})?$/],[H.GF,/^9[78]3\d{2}$/],[H.GN,/^\d{3}$/],[H.GP,/^9[78][01]\d{2}$/],[H.GS,/^SIQQ 1ZZ$/],[H.GU,/^969[123]\d([ \-]\d{4})?$/],[H.GW,/^\d{4}$/],[H.HM,/^\d{4}$/],[H.IQ,/^\d{5}$/],[H.KG,/^\d{6}$/],[H.LR,/^\d{4}$/],[H.LS,/^\d{3}$/],[H.MG,/^\d{3}$/],[H.MH,/^969[67]\d([ \-]\d{4})?$/],[H.MN,/^\d{5}$/],[H.MP,/^9695[012]([ \-]\d{4})?$/],[H.MQ,/^9[78]2\d{2}$/],[H.NC,/^988\d{2}$/],[H.NE,/^\d{4}$/],[H.VI,/^008(([0-4]\d)|(5[01]))([ \-]\d{4})?$/],[H.VN,/^\d{6}$/],[H.PF,/^987\d{2}$/],[H.PG,/^\d{3}$/],[H.PM,/^9[78]5\d{2}$/],[H.PN,/^PCRN 1ZZ$/],[H.PW,/^96940$/],[H.RE,/^9[78]4\d{2}$/],[H.SH,/^(ASCN|STHL) 1ZZ$/],[H.SJ,/^\d{4}$/],[H.SO,/^\d{5}$/],[H.SZ,/^[HLMS]\d{3}$/],[H.TC,/^TKCA 1ZZ$/],[H.WF,/^986\d{2}$/],[H.XK,/^\d{5}$/],[H.YT,/^976\d{2}$/],[H.PE,/^[0-2]\d{4}$/],[H.INTL,/^(?:[A-Z0-9]+([- ]?[A-Z0-9]+)*)?$/i],[H.CO,/^(0[58]|1[135789]|2[0357]|4[147]|5[024]|6[368]|7[036]|8[1568]|9[4579])\d{4}$/]]),KT=(n,e)=>{if(!qd.has(e))throw Error(`Invalid country code: ${e}`);return qd.get(e).test(n)},qT=n=>qd.has(n);function YT(n){return!(n===null||typeof n!="object"||!("value"in n)||!("label"in n))}function qb(n,e=", ",t=" and "){if(n.length<3)return n.join(t);const r=n.slice(0,n.length-1).join(e),o=n[n.length-1];return`${r}${t}${o}`}const Kg="Segmenter"in Intl&&new Intl.Segmenter("en",{granularity:"grapheme"});function Of(n){return Kg?[...Kg.segment(n)].length:Array.from(n).length}const Yb=["https","http"];function qg(n,e=Yb){if(!n)return"";const[t=""]=e;for(const r of e)if(n.substring(0,r.length+3)===`${r}://`)return n;return`${t}://${n}`}const JT=["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 Vl(n){return JT.includes(n.tagName.toLowerCase())}function Jb(n){return n.nodeType===Node.TEXT_NODE}function Ul(n){return n.nodeType===Node.ELEMENT_NODE}function Zb(n,e,t){const r=e&&Ul(e)&&Vl(e),o=t&&Ul(t)&&Vl(t),i=r&&o;return n.textContent&&!i}function Lf(n,e){const t=Array.from(n.childNodes);t.forEach((r,o)=>{const i=Ul(r)?r:void 0,s=Jb(r)?r:void 0;e({node:r,index:o,parent:n,elem:i,text:s,siblings:t}),i&&Lf(i,e)})}function ZT(n,e,t){const o=new DOMParser().parseFromString(n,"text/html");let i=t;return Lf(o.body,s=>{const a=e(i,s);a!==void 0&&(i=a)}),i}function Xb(n){return ZT(n,(e,{index:t,parent:r,siblings:o,text:i,elem:s})=>{if(i&&Zb(i,o[t-1],o[t+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+Of(l.textContent||"")}}if(s){const a=s.tagName.toLowerCase();if(a!=="script"&&a!=="style"&&s!==o[0])return e+(Vl(s)?1:0)}},0)}const QZ="validateDateRange",eX="validateNumberRange";function XT(n){if(!(!n||n.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 QT(n){if(n)return new Promise(function(e){setTimeout(function(){return n.includes("test")?e("String cannot include test"):e()},1e3)})}function Af(n){if(!(isFinite(n)&&Math.abs(n)<=90))return"Latitude should be between -90 and 90"}function Pf(n){if(!(isFinite(n)&&Math.abs(n)<=180))return"Longitude should be between -180 and 180"}function eO(n){if(n===void 0||typeof n=="string"&&(n==null?void 0:n.trim().length)===0||(n==null?void 0:n.length)===0)return"This field is required, please fill it"}function tO(n){if(n&&!(!isNaN(Number(n))&&!isNaN(parseFloat(n))))return"The value is not a number"}function nO(n){if(!n)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(n))return"The value is not a valid URL"}function rO(n,e,t){const r=e[t.startDateName]?e[t.startDateName]:n,o=e[t.endDateName]?e[t.endDateName]:n;if(!r||!o)return;const i=r===n?"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 oO(n,e,{minName:t,maxName:r}){if(n===void 0)return;const o=t&&e[t],i=r&&e[r],s=Number(n);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 iO(n,e,{min:t,max:r}){if(n instanceof Date){if(t&&!r&&nr)return`Date must come on or before ${Hi(r,Vi)}`;if(t&&r&&(nr))return`Date must come between ${Hi(t,Vi)} and ${Hi(r,Vi)}`}}function sO(n,e,t){if(!t.max||typeof n!="string")return;const r="You have exceeded the maximum number of characters";if(t.ignoreHTML&&Xb(n)>t.max||!t.ignoreHTML&&Of(n)>t.max)return r}function aO(n){if(!(!n||n[0]!=="1"||n.length===11))return"Phone number must be exactly 10 numbers excluding the country code"}async function Qb(n,e,{countryField:t}){if(!n)return;const r=e[t];if(!r)return;const o=YT(r)?r.value:r;if(!(!o||!qT(o))&&!KT(n,o))return"This is not a valid postal code in the selected country"}const ex=["places"],Df={lat:0,lng:0};async function lO(n){const e=n.getBounds();if(e)return e;let t;return new Promise(r=>{t=google.maps.event.addListener(n,"bounds_changed",()=>{r(n.getBounds()),google.maps.event.removeListener(t)})})}function Qi(n){return!(!n||n.lat===void 0||n.lng===void 0||Number.isNaN(n.lat)||Number.isNaN(n.lng)||typeof Af(n.lat)=="string"||typeof Pf(n.lng)=="string")}function cO(n){return n?/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/.test(n):!1}function Yg(n,e){return n===e||n&&e&&n.lat===e.lat&&n.lng===e.lng}const uO=Y.div` - &.mapCoordinates { - margin-bottom: 8px; - } -`,Jg=Y(Yc)` - min-width: 684px; - - &.MuiTextField-root { - display: flex; - } -`,dO=Y(mb)` - cursor: pointer; - color: ${j.newColors.almostBlack[100]}; -`,pO=Y.div` - background-color: white; - border: ${j.borders.fieldGray}; - border-top: 0; - font-family: ${j.fontFamily}; - padding: 8px 0; - box-shadow: 0 1px 3px rgba(0,0,0,.05); -`,fO=Y.div` - background-color: ${({$isSuggestionActive:n})=>n?j.colors.gray200:"white"}; - cursor: pointer; - padding: 6px 16px; - width: 100%; -`,hO=Y.p` - font-size: 14px; - margin: 0; - - &:active { - color: ${j.colors.gray800}; - font-weight: ${j.fontWeight.bold}; - } -`,mO=n=>{const{className:e,value:t,onChange:r,onBlur:o,onSelect:i,textField:s,placeholder:a,googleMapsApiKey:l,disabled:c,id:u}=n,[d,p]=h.useState(null),{isLoaded:f,loadError:m}=Mf({googleMapsApiKey:l,libraries:ex}),g=w=>{p(w.target)},y=()=>{p(null),o&&o()},b={...s,inputProps:{"data-testid":"location-search-input"},variant:"outlined",value:t,onFocus:g,onBlur:y};return!f||m?v.jsx(Jg,{...b,fieldSize:"lg",onChange:({target:{value:w}})=>r(w),disabled:c,id:u}):v.jsx(uO,{className:e,children:v.jsx(DE,{value:t,onChange:r,onSelect:i,children:({getInputProps:w,suggestions:S,getSuggestionItemProps:T})=>v.jsxs("div",{style:{position:"relative"},children:[v.jsx(Jg,{...b,...w({placeholder:a}),onFocus:g,onBlur:y,disabled:c,id:u}),v.jsx(Dk,{open:!!d&&(S==null?void 0:S.length)>0,anchorEl:d,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"left"},disableAutoFocus:!0,disableEnforceFocus:!0,children:v.jsx(pO,{children:S==null?void 0:S.map(k=>h.createElement(fO,{...T(k),key:k==null?void 0:k.placeId,$isSuggestionActive:k==null?void 0:k.active},v.jsx(hO,{children:k==null?void 0:k.description})))})})]})})})},tx=h.memo(mO),yr={no:"street_number",street:"route",neighborhood:"neighborhood",locality:"locality",town:"postal_town",area1:"administrative_area_level_1",area2:"administrative_area_level_2",country:"country",postcode:"postal_code"},gO=Y.div` - display: flex; - flex-direction: row; - align-items: start; - gap: 0 20px; - min-width: 0; - - ${Nt("lg","FORM")} { - gap: 0 40px; - } -`,vO=Y.div` - font-family: ${j.fontFamily}; - position: relative; - min-width: 0; - flex-grow: 1; - display: flex; - flex-direction: column; - align-items: start; - - ${({$error:n,$spacing:e})=>n&&` - background-color: ${j.newColors.darkRed[5]}; - margin: ${e==="compact"?"0 -8px -8px":"-4px -12px -8px"}; - padding: ${e==="compact"?"0 8px 8px":"4px 12px 8px"}; - `} -`,yO=Y.div` - max-width: 100%; - - ${({$fullWidth:n})=>n&&` - width: 100%; - `} -`,bO=Y.div` - display: flex; - flex-direction: column; - align-items: stretch; - max-width: 100%; - - ${({$size:n})=>` - width: ${n!=="full"?n:"100%"}; - `} -`,xO=Y.div` - display: flex; - align-items: end; - margin-bottom: 8px; - font-family: ${j.fontFamily}; - gap: 8px; - - .MuiInputLabel-root { - font-family: inherit; - font-size: 16px; - color: ${j.newColors.almostBlack[100]}; - word-wrap: break-word; - text-overflow: clip; - white-space: normal; - } -`,wO=Y.div` - font-family: inherit; - font-size: 16px; - color: ${j.newColors.almostBlack[100]}; - word-wrap: break-word; -`,CO=Y.div` - color: ${({$invalid:n})=>n?j.newColors.darkRed[100]:j.newColors.grey3[100]}; - font-size: 12px; - margin-left: auto; -`,SO=Y(sb)` - font-weight: ${j.fontWeight.semiBold} !important; - align-self: center; - color: ${j.newColors.grey4[100]} !important; -`,kO=Y.span` - color: ${j.newColors.darkRed[100]}; -`,MO=Y.div` - ${({$colsInRow:n=1})=>n===1&&` - ${Nt("sm","FORM_COL")} { - display: none; - } - `} - - svg { - vertical-align: middle; - } -`,EO=n=>{const{children:e,className:t,required:r,name:o,limit:i,instructionText:s,colsInRow:a,as:l="label"}=n,{anchorProps:c,tooltipProps:u}=of();return v.jsxs(xO,{className:t,children:[v.jsxs(SO,{htmlFor:l==="label"&&o?`${o}-input`:void 0,as:l==="label"?sb:wO,"data-testid":o&&`${Mr.FORM_FIELD_LABEL}:${o}`,title:typeof e=="string"?e:void 0,children:[e,r&&v.jsx(kO,{children:"*"})]}),s&&v.jsxs(MO,{$colsInRow:a,children:[v.jsx(bM,{...c}),v.jsx(sf,{...u,children:s})]}),i&&v.jsxs(CO,{$invalid:i[0]>i[1],children:[i[0],"/",i[1]]})]})};var Rf={},TO=kt;Object.defineProperty(Rf,"__esModule",{value:!0});var If=Rf.default=void 0,OO=TO(Mt()),LO=St();If=Rf.default=(0,OO.default)((0,LO.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");const AO=Y.div` - align-items: center; - display: flex; - flex-direction: row; - margin-top: ${j.fieldSpecs.inputSpacing.helperText.marginTop}; -`,PO=Y(If)` - &.MuiSvgIcon-root { - font-size: 16px; - color: ${({$error:n})=>n?j.newColors.darkRed[100]:"transparent"}; - margin-right: 8px; - } -`,Zg=Y(ab)` - &.MuiFormHelperText-root { - color: ${j.newColors.grey3[100]}; - font-family: ${j.fontFamily}; - font-size: 12px; - margin-top: ${j.fieldSpecs.inputSpacing.helperText.marginTop}; - } - - &.MuiFormHelperText-root.Mui-error { - color: ${j.newColors.darkRed[100]}; - margin: 0; - } -`,Yd=({children:n,error:e=!1})=>e?v.jsxs(AO,{children:[v.jsx(PO,{$error:!!n,"data-testid":"error-icon-test-id"}),v.jsx(Zg,{error:e,children:n})]}):v.jsx(Zg,{error:e,children:n}),DO=Y.div` - padding-left: 20px; - border-left: 2px solid ${j.newColors.grey2[100]}; - flex: none; - align-self: stretch; - margin-left: auto; - display: none; - width: 180px; - - ${({$colsInRow:n=1})=>n===1&&` - ${Nt("sm","FORM_COL")} { - display: block; - } - - ${Nt("md","FORM_COL")} { - width: 420px; - } - `} -`,RO=Y.p` - color: ${j.newColors.grey3[100]}; - font-family: ${j.fontFamily}; - font-size: 14px; - margin: 0; -`,nx=n=>{const{children:e,colsInRow:t}=n;return v.jsx(DO,{$colsInRow:t,children:v.jsx(RO,{children:e})})};nx.displayName="InstructionText";function rx(n){const{fieldDef:{name:e}={},skeleton:t,methods:{mountField:r}={},inputRef:o,fieldRef:i}=n;h.useEffect(()=>{if(!r||!e||t)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,t,i])}function IO(n){if(!(!n||!n.inputSettings)){if(n.type==="text"||n.type==="textEditor")return n.inputSettings.maxCharacters;if(n.type==="advancedSelection")return n.inputSettings.selectLimit<2?void 0:n.inputSettings.selectLimit}}function $O(n,e){return typeof n=="string"?e.type==="textEditor"?Xb(n):Of(n):Array.isArray(n)?n.length:0}function NO(n,e){return h.useMemo(()=>{const t=IO(e);return t===void 0?void 0:[$O(n,e),t]},[e,n])}const BO=["color","date","dropdown","number","phone","text","textEditor","time"],FO=n=>{var b;const{children:e,error:t,fieldDef:r,colsInRow:o,value:i,id:s,spacing:a,disabled:l,skeleton:c,useRealLabel:u}=n,d=h.useRef(),p=typeof t=="string"?(t==null?void 0:t.trim().length)>0:!1,f=p||p&&(r==null?void 0:r.required)||typeof t=="boolean"&&t===!0,m=NO(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);rx({...n,fieldRef:d});const y=u||BO.includes(r==null?void 0:r.type);return v.jsxs(gO,{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(vO,{$error:f,$spacing:a,children:[v.jsxs(yO,{$fullWidth:(r==null?void 0:r.size)==="full",children:[g&&(c?v.jsx(Xe,{width:92,height:28,sx:{marginBottom:"8px"}}):v.jsx(EO,{required:r==null?void 0: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(bO,{$size:r==null?void 0:r.size,children:e})]}),f?v.jsx(Yd,{error:!!t,children:typeof t=="string"?t:void 0}):(r==null?void 0:r.helperText)&&v.jsx(Yd,{children:r==null?void 0:r.helperText})]}),(r==null?void 0:r.instructionText)&&v.jsx(nx,{colsInRow:o,children:r.instructionText})]})},ox=h.memo(FO);function jO({children:n,...e}){return rx(e),v.jsx(v.Fragment,{children:n})}const _O=h.memo(jO);function zO(n,e){const t=[];for(const r of n)e.includes(r)&&t.push(r);return t}function $f(n,e){const t=new Set(n),r=new Set(e),o=[...n].filter(a=>!r.has(a)),i=[...e].filter(a=>!t.has(a));return[...o,...i]}function HO(n,e){if(n===e||n===void 0&&Object.values(e).every(r=>r===void 0)||e===void 0&&Object.values(n).every(r=>r===void 0))return!0;if(!n||!e)return!1;const t=n.types===e.types||!$f(n.types||[],e.types||[]).length;return String(n.address1)===String(e.address1)&&String(n.address2)===String(e.address2)&&String(n.address3)===String(e.address3)&&String(n.city)===String(e.city)&&String(n.state)===String(e.state)&&String(n.postalCode)===String(e.postalCode)&&String(n.country)===String(e.country)&&t}const VO=n=>{const{onSave:e,addressToEdit:t,handleClose:r,handleUnsavedChanges:o,dialogOpen:i,handleDialogClose:s,addressTypes:a,getOptionsCountries:l,getOptionsStates:c,googleMapsApiKey:u}=n,d=Lu(),{state:p,methods:{setFieldValue:f,setFormValues:m},handleSubmit:g}=d,[y,b]=h.useState(""),[w,S]=h.useState(""),[T,k]=h.useState(!1);h.useEffect(()=>{o&&o(!HO(t,p.data))},[t,p.data]),h.useEffect(()=>{if(!p.data.country||!p.data.state)return;(async()=>{(await c(p.data.country.value)).find(({label:V})=>V.toLowerCase().includes(p.data.state.label.toLowerCase()))||f({name:"state",value:void 0})})()},[f,p.data.country,p.data.state,c]);const x=g(h.useCallback(async()=>{e({...t||{},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,t,p.data.address1,p.data.address2,p.data.address3,p.data.city,p.data.state,p.data.postalCode,p.data.country,p.data.types])),C=h.useCallback(async G=>{const le=fe=>{const pe=G.find(({types:ye})=>ye.includes(fe));return!pe||!pe.long_name?"":pe.long_name},Z=!!le(yr.town),V=[{label:"Address 1",value:[le(yr.no),le(yr.street)].filter(Boolean).join(" "),dataKey:"address1",emptyWarning:!0},{label:"Address 2",value:Z?le(yr.locality):"",dataKey:"address2"},{label:"City",value:le(Z?yr.town:yr.locality),dataKey:"city",emptyWarning:!0},{label:"Postal Code",value:le(yr.postcode),dataKey:"postalCode",emptyWarning:!0}],J=await l(),ce=le(yr.country),q=J.find(({label:fe})=>fe.toLowerCase().includes(ce.toLowerCase()));V.push({label:"Country",value:q||"",dataKey:"country",emptyWarning:!0});const M=q?await c(q.value):[],I=le(Z?yr.area2:yr.area1),ie=M.find(({label:fe})=>fe.toLowerCase().includes(I.toLowerCase()));V.push({label:"State",value:ie||"",dataKey:"state",emptyWarning:!0});const te=V.reduce((fe,pe)=>({...fe,[pe.dataKey]:pe.value}),{}),Q=V.filter(({emptyWarning:fe,value:pe})=>fe&&!pe);m({values:te}),Q.length&&(console.warn("Some components could not be resolved.",` - -Components received: -`,G,` - -By type they are: -`,G.map(({types:[fe],long_name:pe})=>`${fe}: ${pe}`).join(` -`),` - -Mosaic Result: -`,V),S(Q.map(({label:fe})=>fe).join(", ")),k(!0))},[l,c,m]),E=h.useCallback(async G=>{try{const le=await Sf(G);C(le[0].address_components)}catch(le){console.error(le)}},[C]),P=h.useCallback((G,le)=>{le!=="clickaway"&&k(!1)},[]),O=h.useCallback(G=>{const{fieldDef:le}=G,{inputSettings:Z}=le;return v.jsx(ox,{error:G.error,id:le.name,fieldDef:{name:le.name,type:"autocomplete",label:le.label,required:le.required,size:wt.lg},methods:G.methods,disabled:G.disabled,useRealLabel:!0,children:v.jsx(tx,{onChange:V=>G.onChange(V),onBlur:G.onBlur,value:G.value??"",onSelect:Z.onSelect,googleMapsApiKey:u,disabled:G.disabled,id:`${le.name}-input`})})},[u]),F=h.useMemo(()=>[{fields:[[["address1"]],[["address2"]],[["address3"]],[["country"]],[["city"],["state"],["postalCode"]],...a?[[["types"]]]:[]]}],[a]),D=h.useMemo(()=>a?[{name:"types",type:"checkbox",label:"Type",size:"sm",required:!0,inputSettings:{options:[...a,...t?t.types.filter(G=>!a.find(({value:le})=>le===G.value)):[]]}}]:[],[a,t]),U=h.useMemo(()=>[{name:"address1",required:!0,type:O,label:"Address",inputSettings:{address:y,setAddress:b,onSelect:E}}],[O,y,E]),N=h.useMemo(()=>[{name:"country",type:"dropdown",label:"Country",size:"sm",required:!0,inputSettings:{getOptions:l},validates:[{name:"postalCode",include:[Qb]}]},{name:"address2",type:"text",label:void 0,size:"lg"},{name:"address3",type:"text",label:void 0,size:"lg"},{name:"city",type:"text",label:"City",size:"sm",required:!0},{name:"state",type:"dropdown",label:"State",size:"sm",inputSettings:{getOptions:async()=>p.data.country?c(p.data.country.value):[]}},{name:"postalCode",type:"text",label:"Postal Code",size:"sm",required:!0,inputSettings:{type:"string"},validators:[{fn:"validatePostcode",options:{countryField:"country"}}]},...D],[l,D,c,p.data.country]),z=h.useMemo(()=>[...U,...N,...D],[N,D,U]),_=h.useCallback(async()=>{if(!t)return{};const G={address1:t.address1,address2:t.address2,address3:t.address3,city:t.city,state:t.state,postalCode:t.postalCode,country:t.country};return a&&(G.types=t.types),G},[t,a]),$=h.useMemo(()=>[{label:"Cancel",onClick:()=>r(),color:"gray",variant:"outlined"},{label:"Save",onClick:x,color:"yellow",variant:"contained",type:"submit"}],[r,x]);return v.jsxs(mf,{className:"address",children:[v.jsx(Ou,{...d,onBack:r,backLabel:"Cancel address entry",title:"Address Information",buttons:$,"data-testid":"address-testid",sections:F,fields:z,dialogOpen:i,handleDialogClose:s,getFormValues:_}),v.jsx(gf,{autoHideDuration:4e3,label:`The following fields could not be autocompleted: ${w}.`,open:T,onClose:P})]})},UO=Y.div` - display: flex; - flex-direction: column; - color: ${j.newColors.almostBlack[100]}; - background-color: ${j.newColors.grey1[100]}; - font-family: ${j.fontFamily}; - height: 204px; - padding: 24px 16px 16px 24px; - width: 300px; - - & span { - font-size: 14px; - margin: 0; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - line-height: 20px; - } -`,WO=Y.span` - font-weight: ${j.fontWeight.semiBold}; - margin-bottom: 12px !important; -`,GO=Y(Ca)` - align-self: flex-end; - margin-top: auto; -`,KO=n=>{var s,a;const{address:e,onEdit:t,onRemoveAddress:r,disabled:o}=n,i=e.types.map(l=>l.label);return v.jsxs(UO,{"data-testid":"address-card-test",children:[v.jsx(WO,{children:`${qb(i)} Address`}),v.jsx("span",{children:e==null?void 0:e.address1}),(e==null?void 0:e.address2)&&v.jsx("span",{children:e==null?void 0:e.address2}),(e==null?void 0:e.address3)&&v.jsx("span",{children:e==null?void 0:e.address3}),v.jsx("span",{children:`${e==null?void 0:e.city}, ${(s=e==null?void 0:e.state)!=null&&s.label?e.state.label:""} ${e==null?void 0:e.postalCode}`}),v.jsx("span",{children:(a=e==null?void 0:e.country)==null?void 0:a.label}),v.jsxs(GO,{separator:!0,children:[v.jsx(ln,{label:"Edit",color:"teal",variant:"text",disabled:o,onClick:()=>t(e)}),v.jsx(ln,{color:"red",variant:"text",disabled:o,label:"Remove",onClick:()=>r(e)})]})]})},qO=h.memo(KO);Y.div` - align-items: center; - background-color: ${j.newColors.grey2[100]}; - display: flex; - justify-content: center; - min-height: 204px; - width: 300px; -`;const YO=Y.div` - display: flex; - flex-wrap: wrap; - gap: 16px; -`,JO=Y.div` - margin-bottom: 16px; -`,ZO=Y.div` - display: flex; - gap: 16px; -`;function XO(){return v.jsxs("div",{children:[v.jsx(Xe,{variant:"rectangular",width:143,height:36,sx:{marginBottom:2}}),v.jsxs(ZO,{children:[v.jsx(Xe,{variant:"rectangular",width:300,height:204}),v.jsx(Xe,{variant:"rectangular",width:300,height:204})]})]})}const _u=[{label:"Physical",value:"physical",inputSettingsKey:"amountPhysical"},{label:"Billing",value:"billing",inputSettingsKey:"amountBilling"},{label:"Shipping",value:"shipping",inputSettingsKey:"amountShipping"}],QO=n=>{var E,P,O;const{disabled:e,value:t,onBlur:r,onChange:o,fieldDef:i,skeleton:s}=n,[a,l]=h.useState(!1),[c,u]=h.useState(!1),[d,p]=h.useState(!1),[f,m]=h.useState(null),{singleType:g,limits:y}=h.useMemo(()=>{var _,$;const D=_u.map(G=>{var le;return{...G,limit:(le=i==null?void 0:i.inputSettings)==null?void 0:le[G.inputSettingsKey]}}).filter(G=>G.limit!==void 0),U=D.length===1&&((_=i==null?void 0:i.inputSettings)==null?void 0:_.amountPerType)===void 0?D[0]:!1,N=(($=i==null?void 0:i.inputSettings)==null?void 0:$.amountPerType)??+!D.length;return{limits:_u.reduce((G,le)=>{var Z;return{...G,[le.value]:((Z=i==null?void 0:i.inputSettings)==null?void 0:Z[le.inputSettingsKey])??N}},{}),singleType:U}},[i==null?void 0:i.inputSettings]),b=h.useMemo(()=>_u.filter(D=>{const U=(t||[]).filter(N=>N.types.map(({value:z})=>z).includes(D.value));return!(y[D.value]>-1&&U.length>=y[D.value])}),[y,t]),w=()=>{l(!0)},S=h.useCallback(async F=>{o((t||[]).filter(D=>D!==F)),await r()},[r,o,t]),T=async(F=!1)=>{typeof F=="boolean"&&F?(l(!1),r&&await r()):c?p(!0):(l(!1),r&&await r())},k=async F=>{F&&l(!1),p(!1)},x=F=>{const D=[...t||[]],U={...F,types:g?[{value:g.value,label:g.label}]:F.types};if(typeof a=="object"){const N=t.findIndex(z=>z===a);D.splice(N,1,U)}else D.push(U);o(D)},C=h.useMemo(()=>[{label:"No, keep it",onClick:()=>m(void 0),color:"gray",variant:"outlined"},{label:"Yes, remove it",onClick:()=>{S(f),m(void 0)},color:"yellow",variant:"contained"}],[S,f]);return s?v.jsx(XO,{}):v.jsxs(v.Fragment,{children:[b.length>0&&v.jsx(JO,{children:v.jsx(ln,{disabled:e,color:"gray",variant:"outlined",label:"ADD ADDRESS",onClick:w})}),!!t&&v.jsx(YO,{children:t.map((F,D)=>v.jsx(qO,{address:F,onEdit:l,disabled:e,onRemoveAddress:m},`${D}`))}),v.jsx(df,{open:!!a,onClose:T,children:v.jsx(VO,{googleMapsApiKey:(E=i==null?void 0:i.inputSettings)==null?void 0:E.googleMapsApiKey,handleClose:T,addressToEdit:typeof a=="object"?a:void 0,handleUnsavedChanges:F=>u(F),dialogOpen:d,handleDialogClose:k,addressTypes:g?void 0:b,getOptionsCountries:(P=i==null?void 0:i.inputSettings)==null?void 0:P.getOptionsCountries,getOptionsStates:(O=i==null?void 0:i.inputSettings)==null?void 0:O.getOptionsStates,onSave:x})}),v.jsx(hf,{buttons:C,dialogTitle:"Are you sure you want to remove this address?",open:!!f,children:"All data for this address will be lost. This action is irreversible."})]})},e2=h.memo(QO),t2=n=>{var f,m,g;const{value:e,fieldDef:t,onChange:r,handleClose:o}=n;let i,s;t.inputSettings&&"getOptions"in t.inputSettings&&(i=t.inputSettings),t.inputSettings&&"options"in t.inputSettings&&(s=t.inputSettings);const[a,l]=h.useState((e==null?void 0:e.length)>0?e:[]),c=h.useCallback(async()=>{await r(a),o(!0)},[a]),u=[{label:"Cancel",onClick:()=>o(),color:"gray",variant:"outlined"},{label:"Save",onClick:c,color:"yellow",variant:"contained"}],d=({keyword:y})=>{let b=(s==null?void 0:s.options)||[];const w=new RegExp(y,"i");return y!==void 0&&s.options!==void 0&&(b=s==null?void 0:s.options.filter(S=>w.exec(S.label))),{docs:b,hasMore:!1}},p=(((f=t==null?void 0:t.inputSettings)==null?void 0:f.selectLimit)||0)>0?(m=t==null?void 0:t.inputSettings)==null?void 0:m.selectLimit:-1;return v.jsxs(mf,{className:"advancedSelection",children:[v.jsx(xM,{title:t==null?void 0:t.label,buttons:u,onBack:o,backLabel:"Cancel advanced selection"}),v.jsx(lk,{comparison:"",selected:e,getOptions:(i==null?void 0:i.getOptions)!==void 0?i.getOptions:d,isOpen:!0,onApply:c,placeholder:"Search...",limit:i==null?void 0:i.getOptionsLimit,selectLimit:p,onChange:y=>l(y),hideButtons:!0,createNewOption:(g=t.inputSettings)==null?void 0:g.createNewOption})]})},n2=h.memo(t2);var Nf={},r2=kt;Object.defineProperty(Nf,"__esModule",{value:!0});var ix=Nf.default=void 0,o2=r2(Mt()),i2=St();ix=Nf.default=(0,o2.default)((0,i2.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");const s2=Y.div` - display: flex; - flex-wrap: wrap; - row-gap: 12px; - width: ${({$isMobileView:n})=>n?"":"620px"}; - - & > :not(:last-child) { - margin-right: 12px; - } - - & > * { - margin-top: 8px; - } -`,Xg=Y.span` - color: ${j.newColors.grey3[100]}; - cursor: pointer; - display: flex; - font-family: ${j.fontFamily}; - width: fit-content; - font-weight: ${j.fontWeight.bold}; - font-size: 16px; - margin-top: 16px; -`,a2=Y(cf)` - color: ${j.newColors.grey3[100]}; - margin-left: 14px; -`,l2=Y(ix)` - color: ${j.newColors.grey3[100]}; - margin-left: 14px; -`,c2=Y.div` - max-width: 600px; -`,u2=Y.div` - display: flex; - gap: 16px; - - & .MuiSkeleton-root { - border-radius: 99999em; - } -`,zu=8,sx=h.forwardRef((n,e)=>{var l;const{fieldDef:t,value:r}=n,[o,i]=h.useState(!1),s=c=>{var d;const u=r.filter(p=>p.value!==c);(d=t==null?void 0:t.inputSettings)==null||d.deleteSelectedOption(u)},a=()=>{i(!o)};return(r==null?void 0:r.length)>0&&v.jsxs("div",{ref:e,children:[v.jsx(s2,{$isMobileView:(l=t==null?void 0:t.inputSettings)==null?void 0:l.isMobileView,"data-testid":"as-chiplist",children:o?r==null?void 0:r.map((c,u)=>v.jsx(jd,{disabled:t==null?void 0:t.disabled,label:c==null?void 0:c.label,onDelete:()=>s(c==null?void 0:c.value)},`${c==null?void 0:c.label}-${u}`)):r==null?void 0:r.slice(0,zu).map((c,u)=>v.jsx(jd,{disabled:t==null?void 0:t.disabled,label:c==null?void 0:c.label,onDelete:()=>s(c==null?void 0:c.value)},`${c==null?void 0:c.label}-${u}`))}),r.length>zu&&v.jsx("div",{onClick:a,children:o?v.jsxs(Xg,{children:["Hide"," ",v.jsx(l2,{})]}):v.jsxs(Xg,{children:[`${r.length-zu} more`,v.jsx(a2,{})]})})]})});sx.displayName="ChipList";const d2=h.memo(sx);function p2(){return v.jsxs("div",{children:[v.jsx(Xe,{variant:"rectangular",width:143,height:36,sx:{marginBottom:2}}),v.jsxs(u2,{children:[v.jsx(Xe,{variant:"rounded",width:186,height:32}),v.jsx(Xe,{variant:"rounded",width:78,height:32})]})]})}const f2=n=>{var g,y;const{value:e,onBlur:t,onChange:r,disabled:o,fieldDef:i,skeleton:s}=n,[a,l]=h.useState(!1),[c,u]=h.useState(!1),d=(((g=i==null?void 0:i.inputSettings)==null?void 0:g.selectLimit)||0)>0?(y=i==null?void 0:i.inputSettings)==null?void 0:y.selectLimit:-1;h.useEffect(()=>{const b=()=>{u(window.innerWidth{window.removeEventListener("resize",b)}},[]);const p=()=>{l(!0)},f=async(b=!1)=>{typeof b=="boolean"&&b?(l(!1),t&&await t()):(l(!1),t&&await t())},m=h.useCallback(async b=>{await r(b),await t()},[r]);return s?v.jsx(p2,{}):v.jsxs(v.Fragment,{children:[(e==null?void 0:e.length)>0?v.jsxs(c2,{children:[(d<0||(e==null?void 0:e.length)=n.length?{done:!0}:{done:!1,value:n[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(){t=t.call(n)},n:function(){var c=t.next();return s=c.done,c},e:function(c){a=!0,i=c},f:function(){try{s||t.return==null||t.return()}finally{if(a)throw i}}}}function XM(n,e){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n}function Rb(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Rb=function(){return!!n})()}function at(n){var e=Rb();return function(){var t,r=Km(n);if(e){var o=Km(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return cM(this,t)}}var QM=10,Ib=function(){function n(){rt(this,n),Te(this,"priority",void 0),Te(this,"subPriority",0)}return ot(n,[{key:"validate",value:function(t,r){return!0}}]),n}(),eE=function(n){st(t,n);var e=at(t);function t(r,o,i,s,a){var l;return rt(this,t),l=e.call(this),l.value=r,l.validateValue=o,l.setValue=i,l.priority=s,a&&(l.subPriority=a),l}return ot(t,[{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)}}]),t}(Ib),tE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);for(var o=arguments.length,i=new Array(o),s=0;s0,r=t?e:1-e,o;if(r<=50)o=n||100;else{var i=r+50,s=Math.floor(i/100)*100,a=n>=i%100;o=n+s-(a?100:0)}return t?o:1-o}function Bb(n){return n%400===0||n%4===0&&n%100!==0}var oE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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=Nb(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}}]),t}(dt),iE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);for(var o=arguments.length,i=new Array(o),s=0;s0}},{key:"set",value:function(o,i,s,a){var l=Yk(o,a);if(s.isTwoDigitYear){var c=Nb(s.year,l);return o.setUTCFullYear(c,0,a.firstWeekContainsDate),o.setUTCHours(0,0,0,0),_d(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),_d(o,a)}}]),t}(dt),sE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),cE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),uE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),dE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt);function pE(n,e,t){Be(2,arguments);var r=Re(n),o=Lt(e),i=Jk(r,t)-o;return r.setUTCDate(r.getUTCDate()-i*7),r}var fE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=53}},{key:"set",value:function(o,i,s,a){return _d(pE(o,s,a),a)}}]),t}(dt);function hE(n,e){Be(2,arguments);var t=Re(n),r=Lt(e),o=Zk(t)-r;return t.setUTCDate(t.getUTCDate()-o*7),t}var mE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=53}},{key:"set",value:function(o,i,s){return yb(hE(o,s))}}]),t}(dt),gE=[31,28,31,30,31,30,31,31,30,31,30,31],vE=[31,29,31,30,31,30,31,31,30,31,30,31],yE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=vE[l]:i>=1&&i<=gE[l]}},{key:"set",value:function(o,i,s){return o.setUTCDate(s),o.setUTCHours(0,0,0,0),o}}]),t}(dt),bE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt);function xf(n,e,t){var r,o,i,s,a,l,c,u;Be(2,arguments);var d=Xc(),p=Lt((r=(o=(i=(s=t==null?void 0:t.weekStartsOn)!==null&&s!==void 0?s:t==null||(a=t.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=Re(n),m=Lt(e),g=f.getUTCDay(),y=m%7,b=(y+7)%7,w=(b=0&&i<=6}},{key:"set",value:function(o,i,s,a){return o=xf(o,s,a),o.setUTCHours(0,0,0,0),o}}]),t}(dt),wE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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=xf(o,s,a),o.setUTCHours(0,0,0,0),o}}]),t}(dt),CE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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=xf(o,s,a),o.setUTCHours(0,0,0,0),o}}]),t}(dt);function SE(n,e){Be(2,arguments);var t=Lt(e);t%7===0&&(t=t-7);var r=1,o=Re(n),i=o.getUTCDay(),s=t%7,a=(s+7)%7,l=(a=1&&i<=7}},{key:"set",value:function(o,i,s){return o=SE(o,s),o.setUTCHours(0,0,0,0),o}}]),t}(dt),ME=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),LE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),AE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),PE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),DE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),RE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),IE=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);for(var o=arguments.length,i=new Array(o),s=0;s=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var F=Lt((m=(g=(y=(b=r==null?void 0:r.weekStartsOn)!==null&&b!==void 0?b:r==null||(w=r.locale)===null||w===void 0||(S=w.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&y!==void 0?y:E.weekStartsOn)!==null&&g!==void 0?g:(T=E.locale)===null||T===void 0||(k=T.options)===null||k===void 0?void 0:k.weekStartsOn)!==null&&m!==void 0?m:0);if(!(F>=0&&F<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(C==="")return x===""?Re(t):new Date(NaN);var D={firstWeekContainsDate:O,weekStartsOn:F,locale:P},U=[new tE],N=C.match(zE).map(function(te){var Q=te[0];if(Q in Wm){var fe=Wm[Q];return fe(te,P.formatLong)}return te}).join("").match(_E),z=[],_=Xm(N),$;try{var G=function(){var Q=$.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&Xk(Q)&&Gm(Q,C,n),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Qk(Q)&&Gm(Q,C,n);var fe=Q[0],pe=jE[fe];if(pe){var ye=pe.incompatibleTokens;if(Array.isArray(ye)){var Le=z.find(function(B){return ye.includes(B.token)||B.token===fe});if(Le)throw new RangeError("The format string mustn't contain `".concat(Le.fullToken,"` and `").concat(Q,"` at the same time"))}else if(pe.incompatibleTokens==="*"&&z.length>0)throw new RangeError("The format string mustn't contain `".concat(Q,"` and any other token at the same time"));z.push({token:fe,fullToken:Q});var Oe=pe.run(x,Q,P.match,D);if(!Oe)return{v:new Date(NaN)};U.push(Oe.setter),x=Oe.rest}else{if(fe.match(WE))throw new RangeError("Format string contains an unescaped latin alphabet character `"+fe+"`");if(Q==="''"?Q="'":fe==="'"&&(Q=GE(Q)),x.indexOf(Q)===0)x=x.slice(Q.length);else return{v:new Date(NaN)}}};for(_.s();!($=_.n()).done;){var le=G();if(uM(le)==="object")return le.v}}catch(te){_.e(te)}finally{_.f()}if(x.length>0&&UE.test(x))return new Date(NaN);var Z=U.map(function(te){return te.priority}).sort(function(te,Q){return Q-te}).filter(function(te,Q,fe){return fe.indexOf(te)===Q}).map(function(te){return U.filter(function(Q){return Q.priority===te}).sort(function(Q,fe){return fe.subPriority-Q.subPriority})}).map(function(te){return te[0]}),V=Re(t);if(isNaN(V.getTime()))return new Date(NaN);var J=eM(V,zd(V)),ce={},q=Xm(Z),M;try{for(q.s();!(M=q.n()).done;){var I=M.value;if(!I.validate(J,D))return new Date(NaN);var ie=I.set(J,ce,D);Array.isArray(ie)?(J=ie[0],XM(ce,ie[1])):J=ie}}catch(te){q.e(te)}finally{q.f()}return J}function GE(n){return n.match(HE)[1].replace(VE,"'")}function Ud(n,e){const t=Fb(n,e,new Date);return xb(t)&&Hi(t,e)===n}function KE(n){if(Array.isArray(n))return n;const[e,t]=n.split(":");if(!e||e.length!==2||!t||t.length!==2)throw new Error(`${n} is not a valid 24hr time. It must contain hour and minute components separated by a colon.`);const r=Number(e),o=Number(t);if(r!==r||r<0||r>23||o!==o||o<0||o>59)throw new Error(`${n} is not a valid 24hr time`);return[r,o,0,0]}function Wd(n){return"isPending"in n&&n.isPending}const jb=n=>{if(!(n===""||Array.isArray(n)&&n.length===0))return n};function Xt(n){return{internalValue:n,value:jb(n)}}const qE=n=>{var m,g,y,b,w,S,T,k;const{fieldDef:e,error:t,onChange:r,onBlur:o,value:i,disabled:s,inputRef:a,id:l,skeleton:c}=n,u=(m=e==null?void 0:e.inputSettings)!=null&&m.prefixElement?{startAdornment:v.jsx(sa,{position:"start",children:(g=e==null?void 0:e.inputSettings)==null?void 0:g.prefixElement})}:null,d=x=>{const{value:C}=x.target;r&&r(C===""?void 0:C)},p=x=>{const{value:C}=x.target;o&&o(C===""?void 0:C),e!=null&&e.onBlurCb&&(e==null||e.onBlurCb(C))},f=typeof t=="string"?(t==null?void 0:t.trim().length)>0:!1;return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(Yc,{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:((w=e==null?void 0:e.inputSettings)==null?void 0:w.type)==="number"?"text":(S=e==null?void 0:e.inputSettings)==null?void 0:S.type,minRows:(T=e==null?void 0:e.inputSettings)==null?void 0:T.minRows,maxRows:(k=e==null?void 0:e.inputSettings)==null?void 0:k.maxRows,disabled:s})},YE=h.memo(qE);var wf={},JE=kt;Object.defineProperty(wf,"__esModule",{value:!0});var Cf=wf.default=void 0,ZE=JE(Mt()),XE=St();Cf=wf.default=(0,ZE.default)((0,XE.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");Y.div` display: flex; -`;const m2=Y(pk)` +`;const QE=Y(pk)` &.MuiFormGroup-root { margin-left: -12px; height: fit-content !important; } -`;Y(ab)` +`;Y(sb)` &.MuiFormHelperText-root { color: ${j.newColors.grey3[100]}; font-size: ${n=>n.error?"12px":"14px"}; @@ -381,25 +96,25 @@ Mosaic Result: display: flex; flex-direction: row; margin-top: 8px; -`;Y(If)` +`;Y(Cf)` &.MuiSvgIcon-root { font-size: 16px; margin-right: 8px; } -`;const g2=Y.div` +`;const eT=Y.div` display: flex; flex-flow: column; -`,v2=Y.div` +`,tT=Y.div` display: flex; align-items: center; -`,y2=Y.div` +`,nT=Y.div` display: flex; align-items: center; justify-content: center; width: 18px; height: 40px; margin-right: 14px; -`;function Hu(){return v.jsxs(v2,{children:[v.jsx(y2,{children:v.jsx(Xe,{variant:"rectangular",width:18,height:18})}),v.jsx(Xe,{width:52,height:28})]})}function b2(){return v.jsxs(g2,{children:[v.jsx(Hu,{}),v.jsx(Hu,{}),v.jsx(Hu,{})]})}const x2=n=>{var g,y;const{fieldDef:e,onChange:t,onBlur:r,value:o,disabled:i,skeleton:s,id:a}=n,[l,c]=h.useState([]),[u,d]=h.useState([]),[p,f]=h.useState(void 0);h.useEffect(()=>{(async()=>{var w,S;if((w=e==null?void 0:e.inputSettings)!=null&&w.options)c(e.inputSettings.options),f(!0);else if((S=e==null?void 0:e.inputSettings)!=null&&S.getOptions){const T=await e.inputSettings.getOptions();c(T),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(w=>(w==null?void 0:w.value)===(b==null?void 0:b.value))||c([...l,b])}),d(o)},[l,o,p]);const m=(b,w)=>{const S=b==null?void 0:b.map(T=>l.find(k=>(k==null?void 0:k.value)===T.value));w&&w(S)};return s?v.jsx(b2,{}):v.jsx(m2,{disabled:i,checked:u,options:l,onChange:b=>m(b,t),onChangeCb:b=>m(b,e.onChangeCb),onBlur:r,style:e.style,className:e.className,id:a})},w2=h.memo(x2),C2=Y.div` +`;function Nu(){return v.jsxs(tT,{children:[v.jsx(nT,{children:v.jsx(Xe,{variant:"rectangular",width:18,height:18})}),v.jsx(Xe,{width:52,height:28})]})}function rT(){return v.jsxs(eT,{children:[v.jsx(Nu,{}),v.jsx(Nu,{}),v.jsx(Nu,{})]})}const oT=n=>{var g,y;const{fieldDef:e,onChange:t,onBlur:r,value:o,disabled:i,skeleton:s,id:a}=n,[l,c]=h.useState([]),[u,d]=h.useState([]),[p,f]=h.useState(void 0);h.useEffect(()=>{(async()=>{var w,S;if((w=e==null?void 0:e.inputSettings)!=null&&w.options)c(e.inputSettings.options),f(!0);else if((S=e==null?void 0:e.inputSettings)!=null&&S.getOptions){const T=await e.inputSettings.getOptions();c(T),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(w=>(w==null?void 0:w.value)===(b==null?void 0:b.value))||c([...l,b])}),d(o)},[l,o,p]);const m=(b,w)=>{const S=b==null?void 0:b.map(T=>l.find(k=>(k==null?void 0:k.value)===T.value));w&&w(S)};return s?v.jsx(rT,{}):v.jsx(QE,{disabled:i,checked:u,options:l,onChange:b=>m(b,t),onChangeCb:b=>m(b,e.onChangeCb),onBlur:r,style:e.style,className:e.className,id:a})},iT=h.memo(oT),sT=Y.div` display: flex; flex-wrap: wrap; row-gap: 12px; @@ -412,96 +127,14 @@ Mosaic Result: & .MuiChip-root:last-child { margin-right: 0px; } -`,S2=Y.div` +`,aT=Y.div` display: flex; gap: 12px; & .MuiSkeleton-root { border-radius: 99999em; } -`;function k2(){return v.jsxs(S2,{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=n=>{var w,S;const{fieldDef:e,error:t,onChange:r,onBlur:o,value:i,disabled:s,skeleton:a}=n,{required:l}=e||null,[c,u]=h.useState([]),[d,p]=h.useState(!1),[f,m]=h.useState(void 0);h.useEffect(()=>{(async()=>{var k,x;if((k=e==null?void 0:e.inputSettings)!=null&&k.options)u(e.inputSettings.options),m(!0);else if((x=e==null?void 0:e.inputSettings)!=null&&x.getOptions){const C=await e.inputSettings.getOptions();u(C),m(!1)}p(!1)})()},[(w=e==null?void 0:e.inputSettings)==null?void 0:w.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(T=>T.value===i.value)?g(i):u([...c,{...i,selected:!0}])),p(!0))},[i,d,c,f]);const g=T=>{let k=[...c];k=k.map(C=>(C==null?void 0:C.value)===(T==null?void 0:T.value)?{...C,selected:l&&C.selected?C.selected:!C.selected}:{...C,selected:!1});const x=k.find(C=>C.selected===!0);return u(k),x},y=T=>{const k=g(T);p(!0),r(k?{label:k.label,value:k.value}:void 0)},b=typeof t=="string"?(t==null?void 0:t.trim().length)>0:!1;return a?v.jsx(k2,{}):v.jsx(C2,{$error:b||b&&l,onBlur:o,role:"listbox",children:c.map(T=>v.jsx(jd,{label:T.label,disabled:s,selected:T.selected,onClick:()=>y(T),role:"option"},T.value))})},E2=h.memo(M2);var rr={},Ea={},T2=yb,O2=cb,L2=Zc,A2="[object String]";function P2(n){return typeof n=="string"||!O2(n)&&L2(n)&&T2(n)==A2}var D2=P2,R2=fk;function I2(n){return typeof n=="function"?n:R2}var $2=I2,N2=uk,B2=$2;function F2(n,e){return n&&N2(n,B2(e))}var Bf=F2,j2=hk,_2=j2(Object.getPrototypeOf,Object),Ff=_2,z2=yb,H2=Ff,V2=Zc,U2="[object Object]",W2=Function.prototype,G2=Object.prototype,ax=W2.toString,K2=G2.hasOwnProperty,q2=ax.call(Object);function Y2(n){if(!V2(n)||z2(n)!=U2)return!1;var e=H2(n);if(e===null)return!0;var t=K2.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ax.call(t)==q2}var J2=Y2;Object.defineProperty(Ea,"__esModule",{value:!0});Ea.flattenNames=void 0;var Z2=D2,X2=eu(Z2),Q2=Bf,eL=eu(Q2),tL=J2,nL=eu(tL),rL=Yk,oL=eu(rL);function eu(n){return n&&n.__esModule?n:{default:n}}var iL=Ea.flattenNames=function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[];return(0,oL.default)(e,function(r){Array.isArray(r)?n(r).map(function(o){return t.push(o)}):(0,nL.default)(r)?(0,eL.default)(r,function(o,i){o===!0&&t.push(i),t.push(i+"-"+o)}):(0,X2.default)(r)&&t.push(r)}),t};Ea.default=iL;var Ta={};function sL(n,e){for(var t=-1,r=n==null?0:n.length;++t1&&arguments[1]!==void 0?arguments[1]:[],r=e.default&&(0,vD.default)(e.default)||{};return t.map(function(o){var i=e[o];return i&&(0,mD.default)(i,function(s,a){r[a]||(r[a]={}),r[a]=yD({},r[a],i[a])}),o}),r};Ta.default=bD;var Oa={};Object.defineProperty(Oa,"__esModule",{value:!0});Oa.autoprefix=void 0;var xD=Bf,lv=CD(xD),wD=Object.assign||function(n){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){LD(o,r);function o(){var i,s,a,l;OD(this,o);for(var c=arguments.length,u=Array(c),d=0;d1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){$D(o,r);function o(){var i,s,a,l;ID(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===t-1&&o("last-child"),(e===0||e%2===0)&&o("even"),Math.abs(e%2)===1&&o("odd"),o("nth-child",e),r};zf.default=BD;Object.defineProperty(rr,"__esModule",{value:!0});rr.ReactCSS=rr.loop=rr.handleActive=Hf=rr.handleHover=rr.hover=void 0;var FD=Ea,jD=us(FD),_D=Ta,zD=us(_D),HD=Oa,VD=us(HD),UD=La,fx=us(UD),WD=Aa,GD=us(WD),KD=zf,qD=us(KD);function us(n){return n&&n.__esModule?n:{default:n}}rr.hover=fx.default;var Hf=rr.handleHover=fx.default;rr.handleActive=GD.default;rr.loop=qD.default;var YD=rr.ReactCSS=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;oa?p=1:p=Math.round(d*100/a)/100,t.a!==p)return{h:t.h,s:t.s,l:t.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:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null},Wu={},ZD=function(e,t,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=t,s.fillRect(0,0,r,r),s.translate(r,r),s.fillRect(0,0,r,r),i.toDataURL()):null},XD=function(e,t,r,o){var i=e+"-"+t+"-"+r+(o?"-server":"");if(Wu[i])return Wu[i];var s=ZD(e,t,r,o);return Wu[i]=s,s},dv=Object.assign||function(n){for(var e=1;e-1},pR=function(e){return Number(String(e).replace(/%/g,""))},fR=1,nt=function(n){aR(e,n);function e(t){iR(this,e);var r=sR(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=pR(o.target.value);if(!isNaN(i)&&dR(o.keyCode)){var s=r.getArrowOffset(),a=o.keyCode===hx?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(t.value).toUpperCase(),blurValue:String(t.value).toUpperCase()},r.inputId="rc-editable-input-"+fR++,r}return rR(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 oR({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||lR}},{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=Ue({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 A.createElement("div",{style:o.wrap},A.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?A.createElement("label",{htmlFor:this.inputId,style:o.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(h.PureComponent||h.Component),hR=function(e,t,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(t==="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},mR=function(){function n(e,t){for(var r=0;r-1}function kR(n,e){var t=this.__data__,r=nu(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Wr(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e-1&&n%1==0&&n<=PI}function fs(n){return n!=null&&Kf(n.length)&&!Uf(n)}function DI(n){return vo(n)&&fs(n)}function RI(){return!1}var Cx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xv=Cx&&typeof module=="object"&&module&&!module.nodeType&&module,II=xv&&xv.exports===Cx,wv=II?gr.Buffer:void 0,$I=wv?wv.isBuffer:void 0,Yl=$I||RI,NI="[object Object]",BI=Function.prototype,FI=Object.prototype,Sx=BI.toString,jI=FI.hasOwnProperty,_I=Sx.call(Object);function zI(n){if(!vo(n)||ni(n)!=NI)return!1;var e=xx(n);if(e===null)return!0;var t=jI.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Sx.call(t)==_I}var HI="[object Arguments]",VI="[object Array]",UI="[object Boolean]",WI="[object Date]",GI="[object Error]",KI="[object Function]",qI="[object Map]",YI="[object Number]",JI="[object Object]",ZI="[object RegExp]",XI="[object Set]",QI="[object String]",e$="[object WeakMap]",t$="[object ArrayBuffer]",n$="[object DataView]",r$="[object Float32Array]",o$="[object Float64Array]",i$="[object Int8Array]",s$="[object Int16Array]",a$="[object Int32Array]",l$="[object Uint8Array]",c$="[object Uint8ClampedArray]",u$="[object Uint16Array]",d$="[object Uint32Array]",Ct={};Ct[r$]=Ct[o$]=Ct[i$]=Ct[s$]=Ct[a$]=Ct[l$]=Ct[c$]=Ct[u$]=Ct[d$]=!0;Ct[HI]=Ct[VI]=Ct[t$]=Ct[UI]=Ct[n$]=Ct[WI]=Ct[GI]=Ct[KI]=Ct[qI]=Ct[YI]=Ct[JI]=Ct[ZI]=Ct[XI]=Ct[QI]=Ct[e$]=!1;function p$(n){return vo(n)&&Kf(n.length)&&!!Ct[ni(n)]}function f$(n){return function(e){return n(e)}}var kx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,qs=kx&&typeof module=="object"&&module&&!module.nodeType&&module,h$=qs&&qs.exports===kx,Ku=h$&&mx.process,Cv=function(){try{var n=qs&&qs.require&&qs.require("util").types;return n||Ku&&Ku.binding&&Ku.binding("util")}catch{}}(),Sv=Cv&&Cv.isTypedArray,qf=Sv?f$(Sv):p$;function Zd(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}var m$=Object.prototype,g$=m$.hasOwnProperty;function v$(n,e,t){var r=n[e];(!(g$.call(n,e)&&Pa(r,t))||t===void 0&&!(e in n))&&Wf(n,e,t)}function y$(n,e,t,r){var o=!t;t||(t={});for(var i=-1,s=e.length;++i-1&&n%1==0&&n0){if(++e>=I$)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}var F$=B$(R$);function j$(n,e){return F$(P$(n,e,ou),n+"")}function _$(n,e,t){if(!sr(t))return!1;var r=typeof e;return(r=="number"?fs(t)&&Yf(e,t.length):r=="string"&&e in t)?Pa(t[e],n):!1}function z$(n){return j$(function(e,t){var r=-1,o=t.length,i=o>1?t[o-1]:void 0,s=o>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(o--,i):void 0,s&&_$(t[0],t[1],s)&&(i=o<3?void 0:i,o=1),e=Object(e);++r=e||C<0||d&&E>=i}function b(){var x=qu();if(y(x))return w(x);a=setTimeout(b,g(x))}function w(x){return a=void 0,p&&r?f(x):(r=o=void 0,s)}function S(){a!==void 0&&clearTimeout(a),c=0,r=l=o=a=void 0}function T(){return a===void 0?s:w(qu())}function k(){var x=qu(),C=y(x);if(r=arguments,o=this,l=x,C){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=T,k}var eN="Expected a function";function tN(n,e,t){var r=!0,o=!0;if(typeof n!="function")throw new TypeError(eN);return sr(t)&&(r="leading"in t?!!t.leading:r,o="trailing"in t?!!t.trailing:o),Ox(n,e,{leading:r,maxWait:e,trailing:o})}var nN=function(e,t,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:t.h,s:d,v:p,a:t.a,source:"hsv"}},rN=function(){function n(e,t){for(var r=0;r=0,i=!t&&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,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(EN,arguments)},brighten:function(){return this._applyModification(TN,arguments)},darken:function(){return this._applyModification(ON,arguments)},desaturate:function(){return this._applyModification(SN,arguments)},saturate:function(){return this._applyModification(kN,arguments)},greyscale:function(){return this._applyModification(MN,arguments)},spin:function(){return this._applyModification(LN,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(DN,arguments)},complement:function(){return this._applyCombination(AN,arguments)},monochromatic:function(){return this._applyCombination(RN,arguments)},splitcomplement:function(){return this._applyCombination(PN,arguments)},triad:function(){return this._applyCombination(Pv,[3])},tetrad:function(){return this._applyCombination(Pv,[4])}};Ne.fromRatio=function(n,e){if(Jl(n)=="object"){var t={};for(var r in n)n.hasOwnProperty(r)&&(r==="a"?t[r]=n[r]:t[r]=Ls(n[r]));n=t}return Ne(n,e)};function yN(n){var e={r:0,g:0,b:0},t=1,r=null,o=null,i=null,s=!1,a=!1;return typeof n=="string"&&(n=FN(n)),Jl(n)=="object"&&(Ir(n.r)&&Ir(n.g)&&Ir(n.b)?(e=bN(n.r,n.g,n.b),s=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Ir(n.h)&&Ir(n.s)&&Ir(n.v)?(r=Ls(n.s),o=Ls(n.v),e=wN(n.h,r,o),s=!0,a="hsv"):Ir(n.h)&&Ir(n.s)&&Ir(n.l)&&(r=Ls(n.s),i=Ls(n.l),e=xN(n.h,r,i),s=!0,a="hsl"),n.hasOwnProperty("a")&&(t=n.a)),t=Ax(t),{ok:s,format:n.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:t}}function bN(n,e,t){return{r:Et(n,255)*255,g:Et(e,255)*255,b:Et(t,255)*255}}function Tv(n,e,t){n=Et(n,255),e=Et(e,255),t=Et(t,255);var r=Math.max(n,e,t),o=Math.min(n,e,t),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 n:i=(e-t)/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=t;else{var a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=s(l,a,n+1/3),o=s(l,a,n),i=s(l,a,n-1/3)}return{r:r*255,g:o*255,b:i*255}}function Ov(n,e,t){n=Et(n,255),e=Et(e,255),t=Et(t,255);var r=Math.max(n,e,t),o=Math.min(n,e,t),i,s,a=r,l=r-o;if(s=r===0?0:l/r,r==o)i=0;else{switch(r){case n:i=(e-t)/l+(e>1)+720)%360;--e;)r.h=(r.h+o)%360,i.push(Ne(r));return i}function RN(n,e){e=e||6;for(var t=Ne(n).toHsv(),r=t.h,o=t.s,i=t.v,s=[],a=1/e;e--;)s.push(Ne({h:r,s:o,v:i})),i=(i+a)%1;return s}Ne.mix=function(n,e,t){t=t===0?0:t||50;var r=Ne(n).toRgb(),o=Ne(e).toRgb(),i=t/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(n,e){var t=Ne(n),r=Ne(e);return(Math.max(t.getLuminance(),r.getLuminance())+.05)/(Math.min(t.getLuminance(),r.getLuminance())+.05)};Ne.isReadable=function(n,e,t){var r=Ne.readability(n,e),o,i;switch(i=!1,o=jN(t),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(n,e,t){var r=null,o=0,i,s,a,l;t=t||{},s=t.includeFallbackColors,a=t.level,l=t.size;for(var c=0;co&&(o=i,r=Ne(e[c]));return Ne.isReadable(n,r,{level:a,size:l})||!s?r:(t.includeFallbackColors=!1,Ne.mostReadable(n,["#fff","#000"],t))};var Xd=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"},IN=Ne.hexNames=$N(Xd);function $N(n){var e={};for(var t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function Ax(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Et(n,e){NN(n)&&(n="100%");var t=BN(n);return n=Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(n*e,10)/100),Math.abs(n-e)<1e-6?1:n%e/parseFloat(e)}function au(n){return Math.min(1,Math.max(0,n))}function Fn(n){return parseInt(n,16)}function NN(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function BN(n){return typeof n=="string"&&n.indexOf("%")!=-1}function pr(n){return n.length==1?"0"+n:""+n}function Ls(n){return n<=1&&(n=n*100+"%"),n}function Px(n){return Math.round(parseFloat(n)*255).toString(16)}function Dv(n){return Fn(n)/255}var lr=function(){var n="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+n+")",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",o="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),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 Ir(n){return!!lr.CSS_UNIT.exec(n)}function FN(n){n=n.replace(gN,"").replace(vN,"").toLowerCase();var e=!1;if(Xd[n])n=Xd[n],e=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=lr.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=lr.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=lr.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=lr.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=lr.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=lr.hsva.exec(n))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=lr.hex8.exec(n))?{r:Fn(t[1]),g:Fn(t[2]),b:Fn(t[3]),a:Dv(t[4]),format:e?"name":"hex8"}:(t=lr.hex6.exec(n))?{r:Fn(t[1]),g:Fn(t[2]),b:Fn(t[3]),format:e?"name":"hex"}:(t=lr.hex4.exec(n))?{r:Fn(t[1]+""+t[1]),g:Fn(t[2]+""+t[2]),b:Fn(t[3]+""+t[3]),a:Dv(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=lr.hex3.exec(n))?{r:Fn(t[1]+""+t[1]),g:Fn(t[2]+""+t[2]),b:Fn(t[3]+""+t[3]),format:e?"name":"hex"}:!1}function jN(n){var e,t;return n=n||{level:"AA",size:"small"},e=(n.level||"AA").toUpperCase(),t=(n.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}var Rv=function(e){var t=["r","g","b","a","h","s","l","v"],r=0,o=0;return mN(t,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},As=function(e,t){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=t||0,i.h=t||0);var l=a==="000000"&&s.a===0;return{hsl:o,hex:l?"transparent":"#"+a,rgb:s,hsv:i,oldHue:e.h||t||o.h,source:e.source}},wo=function(e){if(e==="transparent")return!0;var t=String(e).charAt(0)==="#"?1:0;return e.length!==4+t&&e.length<7+t&&Ne(e).isValid()},Zf=function(e){if(!e)return"#fff";var t=As(e);if(t.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(t.rgb.r*299+t.rgb.g*587+t.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},Yu=function(e,t){var r=e.replace("°","");return Ne(t+" ("+r+")")._ok},ws=Object.assign||function(n){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){KN(o,r);function o(){var i,s,a,l;GN(this,o);for(var c=arguments.length,u=Array(c),d=0;da))return!1;var c=i.get(n),u=i.get(e);if(c&&u)return c==e&&u==n;var d=-1,p=!0,f=t&i3?new Zl:void 0;for(i.set(n,e),i.set(e,n);++d=0||Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}var el=24,wB=zx.default=function(n){var e=n.fill,t=e===void 0?"currentColor":e,r=n.width,o=r===void 0?el:r,i=n.height,s=i===void 0?el:i,a=n.style,l=a===void 0?{}:a,c=xB(n,["fill","width","height","style"]);return Zv.default.createElement("svg",Jv({viewBox:"0 0 "+el+" "+el,style:Jv({fill:t,width:o,height:s},l)},c),Zv.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"}))},CB=function(){function n(e,t){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(Yv(o.s)?r.props.hsl.s:o.s),l:Number(Yv(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"},t.hsl.a!==1&&t.view==="hex"?r.state={view:"rgb"}:r.state={view:t.view},r}return CB(e,[{key:"render",value:function(){var r=this,o=Ue({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=A.createElement("div",{style:o.fields,className:"flexbox-fix"},A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?i=A.createElement("div",{style:o.fields,className:"flexbox-fix"},A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),A.createElement("div",{style:o.alpha},A.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=A.createElement("div",{style:o.fields,className:"flexbox-fix"},A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),A.createElement("div",{style:o.alpha},A.createElement(nt,{style:{input:o.input,label:o.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),A.createElement("div",{style:o.wrap,className:"flexbox-fix"},i,A.createElement("div",{style:o.toggle},A.createElement("div",{style:o.icon,onClick:this.toggleViews,ref:function(a){return r.icon=a}},A.createElement(wB,{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}(A.Component);Hx.defaultProps={view:"hex"};var Xv=function(){var e=Ue({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 A.createElement("div",{style:e.picker})},EB=function(){var e=Ue({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return A.createElement("div",{style:e.picker})},rh=function(e){var t=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=Ue(An({default:{picker:{width:t,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 A.createElement("div",{style:g.picker,className:"chrome-picker "+f},A.createElement("div",{style:g.saturation},A.createElement(su,{style:g.Saturation,hsl:s,hsv:a,pointer:EB,onChange:r})),A.createElement("div",{style:g.body},A.createElement("div",{style:g.controls,className:"flexbox-fix"},A.createElement("div",{style:g.color},A.createElement("div",{style:g.swatch},A.createElement("div",{style:g.active}),A.createElement(ds,{renderers:c}))),A.createElement("div",{style:g.toggles},A.createElement("div",{style:g.hue},A.createElement(ps,{style:g.Hue,hsl:s,pointer:Xv,onChange:r})),A.createElement("div",{style:g.alpha},A.createElement(Vf,{style:g.Alpha,rgb:i,hsl:s,pointer:Xv,renderers:c,onChange:r})))),A.createElement(Hx,{rgb:i,hsl:s,hex:l,view:m,onChange:r,disableAlpha:o})))};rh.propTypes={width:Se.oneOfType([Se.string,Se.number]),disableAlpha:Se.bool,styles:Se.object,defaultView:Se.oneOf(["hex","rgb","hsl"])};rh.defaultProps={width:225,disableAlpha:!1,styles:{}};Pn(rh);var TB=function(e){var t=e.color,r=e.onClick,o=r===void 0?function(){}:r,i=e.onSwatchHover,s=e.active,a=Ue({default:{color:{background:t,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:Zf(t),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":t==="#FFFFFF",transparent:t==="transparent"});return A.createElement(ii,{style:a.color,color:t,onClick:o,onHover:i,focusStyle:{boxShadow:"0 0 4px "+t}},A.createElement("div",{style:a.dot}))},OB=function(e){var t=e.hex,r=e.rgb,o=e.onChange,i=Ue({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:t},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 A.createElement("div",{style:i.fields,className:"flexbox-fix"},A.createElement("div",{style:i.active}),A.createElement(nt,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:t,onChange:s}),A.createElement(nt,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:r.r,onChange:s}),A.createElement(nt,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:r.g,onChange:s}),A.createElement(nt,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:r.b,onChange:s}))},oh=function(e){var t=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=Ue(An({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?wo(m.hex)&&t({hex:m.hex,source:"hex"},g):t(m,g)};return A.createElement(Da,{style:d.Compact,styles:l},A.createElement("div",{style:d.compact,className:"compact-picker "+u},A.createElement("div",null,si(o,function(f){return A.createElement(TB,{key:f,color:f,active:f.toLowerCase()===i,onClick:p,onSwatchHover:r})}),A.createElement("div",{style:d.clear})),A.createElement(OB,{hex:i,rgb:s,onChange:p})))};oh.propTypes={colors:Se.arrayOf(Se.string),styles:Se.object};oh.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:{}};Pn(oh);var LB=function(e){var t=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=Ue({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:s}},{hover:t});return A.createElement("div",{style:a.swatch},A.createElement(ii,{color:r,onClick:o,onHover:i,focusStyle:s}))};const AB=Hf(LB);var ih=function(e){var t=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=Ue(An({default:{card:{width:t,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 A.createElement("div",{style:d.card,className:"github-picker "+u},A.createElement("div",{style:d.triangleShadow}),A.createElement("div",{style:d.triangle}),si(r,function(f){return A.createElement(AB,{color:f,key:f,onClick:p,onSwatchHover:i})}))};ih.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};ih.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};Pn(ih);var PB=function(e){var t=e.direction,r=Ue({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:t==="vertical"});return A.createElement("div",{style:r.picker})},DB=Object.assign||function(n){for(var e=1;e.5});return A.createElement("div",{style:r.picker})},NB=function(){var e=Ue({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 A.createElement("div",{style:e.pointer},A.createElement("div",{style:e.left},A.createElement("div",{style:e.leftInside})),A.createElement("div",{style:e.right},A.createElement("div",{style:e.rightInside})))},Qv=function(e){var t=e.onClick,r=e.label,o=e.children,i=e.active,s=Ue({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 A.createElement("div",{style:s.button,onClick:t},r||o)},BB=function(e){var t=e.rgb,r=e.currentColor,o=Ue({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+t.r+","+t.g+", "+t.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 A.createElement("div",null,A.createElement("div",{style:o.label},"new"),A.createElement("div",{style:o.swatches},A.createElement("div",{style:o.new}),A.createElement("div",{style:o.current})),A.createElement("div",{style:o.label},"current"))},FB=function(){function n(e,t){for(var r=0;r100&&(u.a=100),u.a/=100,t({h:o.h,s:o.s,l:o.l,a:u.a,source:"rgb"},d))};return A.createElement("div",{style:a.fields,className:"flexbox-fix"},A.createElement("div",{style:a.double},A.createElement(nt,{style:{input:a.input,label:a.label},label:"hex",value:i.replace("#",""),onChange:l})),A.createElement("div",{style:a.single},A.createElement(nt,{style:{input:a.input,label:a.label},label:"r",value:r.r,onChange:l,dragLabel:"true",dragMax:"255"})),A.createElement("div",{style:a.single},A.createElement(nt,{style:{input:a.input,label:a.label},label:"g",value:r.g,onChange:l,dragLabel:"true",dragMax:"255"})),A.createElement("div",{style:a.single},A.createElement(nt,{style:{input:a.input,label:a.label},label:"b",value:r.b,onChange:l,dragLabel:"true",dragMax:"255"})),A.createElement("div",{style:a.alpha},A.createElement(nt,{style:{input:a.input,label:a.label},label:"a",value:Math.round(r.a*100),onChange:l,dragLabel:"true",dragMax:"100"})))},VB=Object.assign||function(n){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}var tl=24,ZB=Ux.default=function(n){var e=n.fill,t=e===void 0?"currentColor":e,r=n.width,o=r===void 0?tl:r,i=n.height,s=i===void 0?tl:i,a=n.style,l=a===void 0?{}:a,c=JB(n,["fill","width","height","style"]);return t0.default.createElement("svg",e0({viewBox:"0 0 "+tl+" "+tl,style:e0({fill:t,width:o,height:s},l)},c),t0.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},XB=function(e){var t=e.color,r=e.onClick,o=r===void 0?function(){}:r,i=e.onSwatchHover,s=e.first,a=e.last,l=e.active,c=Ue({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:t,marginBottom:"1px"},check:{color:Zf(t),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":t==="#FFFFFF",transparent:t==="transparent"});return A.createElement(ii,{color:t,style:c.color,onClick:o,onHover:i,focusStyle:{boxShadow:"0 0 4px "+t}},A.createElement("div",{style:c.check},A.createElement(ZB,null)))},QB=function(e){var t=e.onClick,r=e.onSwatchHover,o=e.group,i=e.active,s=Ue({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return A.createElement("div",{style:s.group},si(o,function(a,l){return A.createElement(XB,{key:a,color:a,active:a.toLowerCase()===i,first:l===0,last:l===o.length-1,onClick:t,onSwatchHover:r})}))},uh=function(e){var t=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=Ue(An({default:{picker:{width:t,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 A.createElement("div",{style:p.picker,className:"swatches-picker "+d},A.createElement(Da,null,A.createElement("div",{style:p.overflow},A.createElement("div",{style:p.body},si(s,function(m){return A.createElement(QB,{key:m.toString(),group:m,active:a,onClick:f,onSwatchHover:i})}),A.createElement("div",{style:p.clear})))))};uh.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};uh.defaultProps={width:320,height:240,colors:[[xi[900],xi[700],xi[500],xi[300],xi[100]],[wi[900],wi[700],wi[500],wi[300],wi[100]],[Ci[900],Ci[700],Ci[500],Ci[300],Ci[100]],[Si[900],Si[700],Si[500],Si[300],Si[100]],[ki[900],ki[700],ki[500],ki[300],ki[100]],[Mi[900],Mi[700],Mi[500],Mi[300],Mi[100]],[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]],["#194D33",Ps[700],Ps[500],Ps[300],Ps[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]],[Di[900],Di[700],Di[500],Di[300],Di[100]],[Ri[900],Ri[700],Ri[500],Ri[300],Ri[100]],[Ii[900],Ii[700],Ii[500],Ii[300],Ii[100]],[$i[900],$i[700],$i[500],$i[300],$i[100]],[Ni[900],Ni[700],Ni[500],Ni[300],Ni[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};Pn(uh);var dh=function(e){var t=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=Ue(An({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){wo(g)&&t({hex:g,source:"hex"},y)};return A.createElement("div",{style:p.card,className:"twitter-picker "+d},A.createElement("div",{style:p.triangleShadow}),A.createElement("div",{style:p.triangle}),A.createElement("div",{style:p.body},si(i,function(m,g){return A.createElement(ii,{key:g,color:m,hex:m,style:p.swatch,onClick:f,onHover:r,focusStyle:{boxShadow:"0 0 4px "+m}})}),A.createElement("div",{style:p.hash},"#"),A.createElement(nt,{label:null,style:{input:p.input},value:o.replace("#",""),onChange:f}),A.createElement("div",{style:p.clear})))};dh.propTypes={width:Se.oneOfType([Se.string,Se.number]),triangle:Se.oneOf(["hide","top-left","top-right"]),colors:Se.arrayOf(Se.string),styles:Se.object};dh.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};Pn(dh);var ph=function(e){var t=Ue({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 A.createElement("div",{style:t.picker})};ph.propTypes={hsl:Se.shape({h:Se.number,s:Se.number,l:Se.number,a:Se.number})};ph.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var fh=function(e){var t=Ue({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 A.createElement("div",{style:t.picker})};fh.propTypes={hsl:Se.shape({h:Se.number,s:Se.number,l:Se.number,a:Se.number})};fh.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var eF=function(e){var t=e.onChange,r=e.rgb,o=e.hsl,i=e.hex,s=e.hsv,a=function(f,m){if(f.hex)wo(f.hex)&&t({hex:f.hex,source:"hex"},m);else if(f.rgb){var g=f.rgb.split(",");Yu(f.rgb,"rgb")&&t({r:g[0],g:g[1],b:g[2],a:1,source:"rgb"},m)}else if(f.hsv){var y=f.hsv.split(",");Yu(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),t({h:Number(y[0]),s:Number(y[1]),v:Number(y[2]),source:"hsv"},m))}else if(f.hsl){var b=f.hsl.split(",");Yu(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),t({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsl"},m))}},l=Ue({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 A.createElement("div",{style:l.wrap,className:"flexbox-fix"},A.createElement("div",{style:l.fields},A.createElement("div",{style:l.double},A.createElement(nt,{style:{input:l.input,label:l.label},label:"hex",value:i,onChange:a})),A.createElement("div",{style:l.column},A.createElement("div",{style:l.single},A.createElement(nt,{style:{input:l.input2,label:l.label2},label:"rgb",value:c,onChange:a})),A.createElement("div",{style:l.single},A.createElement(nt,{style:{input:l.input2,label:l.label2},label:"hsv",value:d,onChange:a})),A.createElement("div",{style:l.single},A.createElement(nt,{style:{input:l.input2,label:l.label2},label:"hsl",value:u,onChange:a})))))},hh=function(e){var t=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=Ue(An({default:{picker:{width:t,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 A.createElement("div",{style:f.picker,className:"google-picker "+p},A.createElement("div",{style:f.head},l),A.createElement("div",{style:f.swatch}),A.createElement("div",{style:f.saturation},A.createElement(su,{hsl:i,hsv:s,pointer:ph,onChange:r})),A.createElement("div",{style:f.body},A.createElement("div",{style:f.controls,className:"flexbox-fix"},A.createElement("div",{style:f.hue},A.createElement(ps,{style:f.Hue,hsl:i,radius:"4px",pointer:fh,onChange:r}))),A.createElement(eF,{rgb:o,hsl:i,hex:a,hsv:s,onChange:r})))};hh.propTypes={width:Se.oneOfType([Se.string,Se.number]),styles:Se.object,header:Se.string};hh.defaultProps={width:652,styles:{},header:"Color picker"};Pn(hh);const tF=n=>{let e=n.r.toString(16),t=n.g.toString(16),r=n.b.toString(16),o=Math.round(n.a*255).toString(16);return e.length===1&&(e="0"+e),t.length===1&&(t="0"+t),r.length===1&&(r="0"+r),o.length===1&&(o="0"+o),"#"+e+t+r+o},nF=n=>{const[e,t]=h.useState(null),{fieldDef:r,value:o,onChange:i,onBlur:s,disabled:a,skeleton:l,id:c}=n,[u,d]=h.useState(!1),[p,f]=h.useState(null),m=w=>{d(!u),t(w.currentTarget)},g=()=>{d(!1),t(null),s()},y=w=>{f(w),i(tF(w.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(Zk,{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(Xk,{id:b,open:u,anchorEl:e,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:v.jsx(WB,{color:o||j.newColors.realTeal[100],onChange:y})})]})},rF=h.memo(nF);function rp(n,e){const t=new Date(n.getTime()),[r,o,i]=Array.isArray(e)?e:[e.getHours(),e.getMinutes(),e.getSeconds()];return t.setHours(r,o,i,0),t}function n0(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=lM(n))||e){t&&(n=t);var r=0,o=function(){};return{s:o,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[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(){t=t.call(n)},n:function(){var c=t.next();return s=c.done,c},e:function(c){a=!0,i=c},f:function(){try{s||t.return==null||t.return()}finally{if(a)throw i}}}}function oF(n,e){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n}function Wx(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wx=function(){return!!n})()}function at(n){var e=Wx();return function(){var t,r=Km(n);if(e){var o=Km(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return cM(this,t)}}var iF=10,Gx=function(){function n(){rt(this,n),Te(this,"priority",void 0),Te(this,"subPriority",0)}return ot(n,[{key:"validate",value:function(t,r){return!0}}]),n}(),sF=function(n){st(t,n);var e=at(t);function t(r,o,i,s,a){var l;return rt(this,t),l=e.call(this),l.value=r,l.validateValue=o,l.setValue=i,l.priority=s,a&&(l.subPriority=a),l}return ot(t,[{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)}}]),t}(Gx),aF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);for(var o=arguments.length,i=new Array(o),s=0;s0,r=t?e:1-e,o;if(r<=50)o=n||100;else{var i=r+50,s=Math.floor(i/100)*100,a=n>=i%100;o=n+s-(a?100:0)}return t?o:1-o}function Yx(n){return n%400===0||n%4===0&&n%100!==0}var uF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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=qx(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}}]),t}(dt),dF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);for(var o=arguments.length,i=new Array(o),s=0;s0}},{key:"set",value:function(o,i,s,a){var l=Qk(o,a);if(s.isTwoDigitYear){var c=qx(s.year,l);return o.setUTCFullYear(c,0,a.firstWeekContainsDate),o.setUTCHours(0,0,0,0),_d(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),_d(o,a)}}]),t}(dt),pF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),mF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),gF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),vF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt);function yF(n,e,t){Be(2,arguments);var r=Re(n),o=Lt(e),i=eM(r,t)-o;return r.setUTCDate(r.getUTCDate()-i*7),r}var bF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=53}},{key:"set",value:function(o,i,s,a){return _d(yF(o,s,a),a)}}]),t}(dt);function xF(n,e){Be(2,arguments);var t=Re(n),r=Lt(e),o=tM(t)-r;return t.setUTCDate(t.getUTCDate()-o*7),t}var wF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=53}},{key:"set",value:function(o,i,s){return xb(xF(o,s))}}]),t}(dt),CF=[31,28,31,30,31,30,31,31,30,31,30,31],SF=[31,29,31,30,31,30,31,31,30,31,30,31],kF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=SF[l]:i>=1&&i<=CF[l]}},{key:"set",value:function(o,i,s){return o.setUTCDate(s),o.setUTCHours(0,0,0,0),o}}]),t}(dt),MF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt);function gh(n,e,t){var r,o,i,s,a,l,c,u;Be(2,arguments);var d=Xc(),p=Lt((r=(o=(i=(s=t==null?void 0:t.weekStartsOn)!==null&&s!==void 0?s:t==null||(a=t.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=Re(n),m=Lt(e),g=f.getUTCDay(),y=m%7,b=(y+7)%7,w=(b=0&&i<=6}},{key:"set",value:function(o,i,s,a){return o=gh(o,s,a),o.setUTCHours(0,0,0,0),o}}]),t}(dt),TF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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=gh(o,s,a),o.setUTCHours(0,0,0,0),o}}]),t}(dt),OF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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=gh(o,s,a),o.setUTCHours(0,0,0,0),o}}]),t}(dt);function LF(n,e){Be(2,arguments);var t=Lt(e);t%7===0&&(t=t-7);var r=1,o=Re(n),i=o.getUTCDay(),s=t%7,a=(s+7)%7,l=(a=1&&i<=7}},{key:"set",value:function(o,i,s){return o=LF(o,s),o.setUTCHours(0,0,0,0),o}}]),t}(dt),PF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),$F=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),NF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),BF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),FF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),jF=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);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}}]),t}(dt),_F=function(n){st(t,n);var e=at(t);function t(){var r;rt(this,t);for(var o=arguments.length,i=new Array(o),s=0;s=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var F=Lt((m=(g=(y=(b=r==null?void 0:r.weekStartsOn)!==null&&b!==void 0?b:r==null||(w=r.locale)===null||w===void 0||(S=w.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&y!==void 0?y:E.weekStartsOn)!==null&&g!==void 0?g:(T=E.locale)===null||T===void 0||(k=T.options)===null||k===void 0?void 0:k.weekStartsOn)!==null&&m!==void 0?m:0);if(!(F>=0&&F<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(C==="")return x===""?Re(t):new Date(NaN);var D={firstWeekContainsDate:O,weekStartsOn:F,locale:P},U=[new aF],N=C.match(KF).map(function(te){var Q=te[0];if(Q in Wm){var fe=Wm[Q];return fe(te,P.formatLong)}return te}).join("").match(GF),z=[],_=n0(N),$;try{var G=function(){var Q=$.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&nM(Q)&&Gm(Q,C,n),!(r!=null&&r.useAdditionalDayOfYearTokens)&&rM(Q)&&Gm(Q,C,n);var fe=Q[0],pe=WF[fe];if(pe){var ye=pe.incompatibleTokens;if(Array.isArray(ye)){var Le=z.find(function(B){return ye.includes(B.token)||B.token===fe});if(Le)throw new RangeError("The format string mustn't contain `".concat(Le.fullToken,"` and `").concat(Q,"` at the same time"))}else if(pe.incompatibleTokens==="*"&&z.length>0)throw new RangeError("The format string mustn't contain `".concat(Q,"` and any other token at the same time"));z.push({token:fe,fullToken:Q});var Oe=pe.run(x,Q,P.match,D);if(!Oe)return{v:new Date(NaN)};U.push(Oe.setter),x=Oe.rest}else{if(fe.match(ZF))throw new RangeError("Format string contains an unescaped latin alphabet character `"+fe+"`");if(Q==="''"?Q="'":fe==="'"&&(Q=XF(Q)),x.indexOf(Q)===0)x=x.slice(Q.length);else return{v:new Date(NaN)}}};for(_.s();!($=_.n()).done;){var le=G();if(uM(le)==="object")return le.v}}catch(te){_.e(te)}finally{_.f()}if(x.length>0&&JF.test(x))return new Date(NaN);var Z=U.map(function(te){return te.priority}).sort(function(te,Q){return Q-te}).filter(function(te,Q,fe){return fe.indexOf(te)===Q}).map(function(te){return U.filter(function(Q){return Q.priority===te}).sort(function(Q,fe){return fe.subPriority-Q.subPriority})}).map(function(te){return te[0]}),V=Re(t);if(isNaN(V.getTime()))return new Date(NaN);var J=oM(V,zd(V)),ce={},q=n0(Z),M;try{for(q.s();!(M=q.n()).done;){var I=M.value;if(!I.validate(J,D))return new Date(NaN);var ie=I.set(J,ce,D);Array.isArray(ie)?(J=ie[0],oF(ce,ie[1])):J=ie}}catch(te){q.e(te)}finally{q.f()}return J}function XF(n){return n.match(qF)[1].replace(YF,"'")}function op(n,e){const t=Jx(n,e,new Date);return Cb(t)&&Hi(t,e)===n}function QF(n){if(Array.isArray(n))return n;const[e,t]=n.split(":");if(!e||e.length!==2||!t||t.length!==2)throw new Error(`${n} is not a valid 24hr time. It must contain hour and minute components separated by a colon.`);const r=Number(e),o=Number(t);if(r!==r||r<0||r>23||o!==o||o<0||o>59)throw new Error(`${n} is not a valid 24hr time`);return[r,o,0,0]}const Zu={message:`Please enter a valid ${Sb} date`},Ui={message:`Please enter a valid ${ff} time`},hi={message:"Please also provide a time"};function ej(n,{min:e,max:t}){return e!==void 0&&nt?t:n}function tj(n){return n<.5?8*n*n*n*n:1-Math.pow(-2*n+2,4)/2}function nj(n){return 1+2.70158*Math.pow(n-1,3)+1.70158*Math.pow(n-1,2)}function rj(n){return n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2}const oj={easeInOutQuart:tj,easeOutBack:nj,easeInOutCubic:rj};function ij(n={}){const e={fn:()=>null,startTimestamp:0,preventNext:!1,valueStart:0,valueEnd:0,duration:0,easing:"easeInOutCubic",onComplete:()=>null},t=a=>{Object.assign(e,a)};t(n);const r=a=>{if(e.preventNext)return;e.startTimestamp||(e.startTimestamp=a);const l=Math.min((a-e.startTimestamp)/e.duration,1),c=Math.floor(oj[e.easing](l)*(e.valueEnd-e.valueStart)+e.valueStart);if(e.fn(c,e),l<1){window.requestAnimationFrame(r);return}e.onComplete&&e.onComplete(),e.preventNext=!0};return{start:(a={})=>{t(a),e.preventNext=!1,e.startTimestamp=0,window.requestAnimationFrame(r)},stop:()=>{e.preventNext=!0},inProgress:()=>!e.preventNext}}function sj(n){return h.useRef(ij(n)).current}const aj=400,lj=1500;function Zx({container:n,onComplete:e,onStop:t}){const r=sj({onComplete:()=>{e&&e(),t&&t()}});h.useEffect(()=>{const{current:i}=n;if(!i)return;const s=()=>{r.stop(),t&&t()};return i.addEventListener("wheel",s,{passive:!0}),()=>i.removeEventListener("wheel",s)},[r,n,t]);const o=h.useCallback(({target:i,offset:s=0})=>{if(!i)return;const{current:a}=n,{scrollTop:l}=a,c=i.getBoundingClientRect(),u=a.getBoundingClientRect(),d=c.top+l-u.top-s,p=a.scrollHeight-u.height,f=l,m=Math.min(d,p);r.start({fn:g=>typeof a.scrollTo=="function"&&a.scrollTo({top:g}),valueStart:f,valueEnd:m,duration:ej(Math.abs(m-f)*.75,{min:aj,max:lj})})},[r,n]);return{animation:r,scrollTo:o}}function cj({refs:n,container:e,threshold:t=.2}){const r=h.useRef(!1),o=h.useRef(TM(()=>r.current=!1,100)),{current:i}=e,{animation:s,scrollTo:a}=Zx({container:e,onStop:()=>{r.current=!1}}),[l,c]=h.useState(0),[u,d]=h.useState(null),p=u!==null?u:l,f=h.useCallback(()=>{let g=0;if(!i||!n)return g;const y=i.getBoundingClientRect();for(let b=0;by.top+y.height*t);b++)g=b;return g},[i,n,t]);h.useEffect(()=>{const g=f();c(g)},[f,n]),h.useEffect(()=>{if(!i)return;const g=()=>{o.current(),r.current||d(null);const y=f();c(y)};return i.addEventListener("scroll",g,{passive:!0}),()=>i.removeEventListener("scroll",g)},[i,f]);const m=h.useCallback(g=>{const[y]=n,b=n[g];if(!y||!b||!i)return;d(g),r.current=!0;const{scrollTop:w}=i,S=i.getBoundingClientRect(),k=y.getBoundingClientRect().top+w-S.top;a({target:b,offset:k})},[i,n,a]);return{animation:s,activeSection:p,setActiveSection:m}}function uj(n,e){switch(e.type){case"ADD_ERROR":{const t=Array.isArray(e.error)?e.error:[e.error],r=$f(t,n);return r.length?[...n,...r]:n}case"REMOVE_ERROR":{const t=Array.isArray(e.error)?e.error:[e.error],r=zO(t,n);return r.length?n.filter(o=>!r.includes(o)):n}default:throw new Error("useFieldErrors action is not valid")}}function Xx({methods:n,name:e}){const{addValidator:t}=n||{},[r,o]=h.useReducer(uj,[]),i=r[0],s=h.useCallback(l=>{o({type:"ADD_ERROR",error:l})},[o]),a=h.useCallback(l=>{o({type:"REMOVE_ERROR",error:l})},[o]);return h.useEffect(()=>{if(!t)return;const{remove:l}=t({name:e,validator:()=>i&&i.message});return l},[t,i,e]),{addError:s,removeError:a}}function ip(n,e){Be(2,arguments);var t=Re(n),r=Lt(e);return isNaN(r)?new Date(NaN):(r&&t.setDate(t.getDate()+r),t)}function dj(n,e){Be(2,arguments);var t=Lt(e);return pf(n,t*1e3)}var pj=6e4;function fj(n,e){Be(2,arguments);var t=Lt(e);return pf(n,t*pj)}var hj=36e5;function mj(n,e){Be(2,arguments);var t=Lt(e);return pf(n,t*hj)}function gj(n,e){Be(2,arguments);var t=Lt(e),r=t*7;return ip(n,r)}function kl(n,e){Be(2,arguments);var t=Re(n),r=Lt(e);if(isNaN(r))return new Date(NaN);if(!r)return t;var o=t.getDate(),i=new Date(t.getTime());i.setMonth(t.getMonth()+r+1,0);var s=i.getDate();return o>=s?i:(t.setFullYear(i.getFullYear(),i.getMonth(),o),t)}function r0(n,e){Be(2,arguments);var t=Lt(e);return kl(n,t*12)}function vj(n,e){Be(2,arguments);var t=Re(n),r=Re(e);return t.getFullYear()-r.getFullYear()}function Ys(n,e){Be(2,arguments);var t=Re(n),r=Re(e),o=t.getTime()-r.getTime();return o<0?-1:o>0?1:o}function yj(n,e){Be(2,arguments);var t=Re(n),r=Re(e),o=Ys(t,r),i=Math.abs(vj(t,r));t.setFullYear(1584),r.setFullYear(1584);var s=Ys(t,r)===-o,a=o*(i-Number(s));return a===0?0:a}function bj(n,e){Be(2,arguments);var t=Re(n),r=Re(e),o=t.getFullYear()-r.getFullYear(),i=t.getMonth()-r.getMonth();return o*12+i}function sp(n){Be(1,arguments);var e=Re(n);return e.setHours(23,59,59,999),e}function ap(n){Be(1,arguments);var e=Re(n),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function xj(n){Be(1,arguments);var e=Re(n);return sp(e).getTime()===ap(e).getTime()}function Qx(n,e){Be(2,arguments);var t=Re(n),r=Re(e),o=Ys(t,r),i=Math.abs(bj(t,r)),s;if(i<1)s=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-o*i);var a=Ys(t,r)===-o;xj(Re(n))&&i===1&&Ys(n,r)===1&&(a=!1),s=o*(i-Number(a))}return s===0?0:s}var o0={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},wj="trunc";function Ra(n){return n?o0[n]:o0[wj]}function Cj(n,e,t){Be(2,arguments);var r=Qx(n,e)/3;return Ra(void 0)(r)}var Sj=864e5;function kj(n,e){Be(2,arguments);var t=Xi(n),r=Xi(e),o=t.getTime()-zd(t),i=r.getTime()-zd(r);return Math.round((o-i)/Sj)}function i0(n,e){var t=n.getFullYear()-e.getFullYear()||n.getMonth()-e.getMonth()||n.getDate()-e.getDate()||n.getHours()-e.getHours()||n.getMinutes()-e.getMinutes()||n.getSeconds()-e.getSeconds()||n.getMilliseconds()-e.getMilliseconds();return t<0?-1:t>0?1:t}function e1(n,e){Be(2,arguments);var t=Re(n),r=Re(e),o=i0(t,r),i=Math.abs(kj(t,r));t.setDate(t.getDate()-o*i);var s=+(i0(t,r)===-o),a=o*(i-s);return a===0?0:a}function Mj(n,e,t){Be(2,arguments);var r=e1(n,e)/7;return Ra(void 0)(r)}function du(n,e){return Be(2,arguments),Re(n).getTime()-Re(e).getTime()}function Ej(n,e,t){Be(2,arguments);var r=du(n,e)/uu;return Ra(void 0)(r)}function Tj(n,e,t){Be(2,arguments);var r=du(n,e)/cu;return Ra(void 0)(r)}function Oj(n,e,t){Be(2,arguments);var r=du(n,e)/1e3;return Ra(void 0)(r)}function Lj(n,e){var t;Be(1,arguments);var r=n||{},o=Re(r.start),i=Re(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((t=void 0)!==null&&t!==void 0?t:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;l.getTime()<=s;)a.push(Re(l)),l.setDate(l.getDate()+c),l.setHours(0,0,0,0);return a}function Xu(n,e){var t,r,o,i,s,a,l,c;Be(1,arguments);var u=Xc(),d=Lt((t=(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&&t!==void 0?t:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=Re(n),f=p.getDay(),m=(fr.getTime()}function mi(n,e){Be(2,arguments);var t=Re(n),r=Re(e);return t.getTime()=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=Re(n),f=p.getDay(),m=(f2)return e;if(/:/.test(t[0])?r=t[0]:(e.date=t[0],r=t[1],il.timeZoneDelimiter.test(e.date)&&(e.date=n.split(il.timeZoneDelimiter)[0],r=n.substr(e.date.length,n.length))),r){var o=il.timezone.exec(r);o?(e.time=r.replace(o[1],""),e.timezone=o[1]):e.time=r}return e}function Xj(n,e){var t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=n.match(t);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:n.slice((r[1]||r[2]).length)}}function Qj(n,e){if(e===null)return new Date(NaN);var t=n.match(qj);if(!t)return new Date(NaN);var r=!!t[4],o=Ss(t[1]),i=Ss(t[2])-1,s=Ss(t[3]),a=Ss(t[4]),l=Ss(t[5])-1;if(r)return s5(e,a,l)?n5(e,a,l):new Date(NaN);var c=new Date(0);return!o5(e,i,s)||!i5(e,o)?new Date(NaN):(c.setUTCFullYear(e,i,Math.max(o,s)),c)}function Ss(n){return n?parseInt(n):1}function e5(n){var e=n.match(Yj);if(!e)return NaN;var t=td(e[1]),r=td(e[2]),o=td(e[3]);return a5(t,r,o)?t*uu+r*cu+o*1e3:NaN}function td(n){return n&&parseFloat(n.replace(",","."))||0}function t5(n){if(n==="Z")return 0;var e=n.match(Jj);if(!e)return 0;var t=e[1]==="+"?-1:1,r=parseInt(e[2]),o=e[3]&&parseInt(e[3])||0;return l5(r,o)?t*(r*uu+o*cu):NaN}function n5(n,e,t){var r=new Date(0);r.setUTCFullYear(n,0,4);var o=r.getUTCDay()||7,i=(e-1)*7+t+1-o;return r.setUTCDate(r.getUTCDate()+i),r}var r5=[31,null,31,30,31,30,31,31,30,31,30,31];function n1(n){return n%400===0||n%4===0&&n%100!==0}function o5(n,e,t){return e>=0&&e<=11&&t>=1&&t<=(r5[e]||(n1(n)?29:28))}function i5(n,e){return e>=1&&e<=(n1(n)?366:365)}function s5(n,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function a5(n,e,t){return n===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&n>=0&&n<25}function l5(n,e){return e>=0&&e<=59}function c5(n,e){var t,r;Be(1,arguments);var o=Re(n);if(isNaN(o.getTime()))throw new RangeError("Invalid time value");var i=String((t=e==null?void 0:e.format)!==null&&t!==void 0?t:"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=Jr(o.getDate(),2),p=Jr(o.getMonth()+1,2),f=Jr(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=Jr(Math.floor(g/60),2),b=Jr(g%60,2),w=m<0?"+":"-";l="".concat(w).concat(y,":").concat(b)}else l="Z";var S=Jr(o.getHours(),2),T=Jr(o.getMinutes(),2),k=Jr(o.getSeconds(),2),x=a===""?"":"T",C=[S,T,k].join(u);a="".concat(a).concat(x).concat(C).concat(l)}return a}function u5(n,e){Be(2,arguments);var t=Re(n).getTime(),r=Re(e.start).getTime(),o=Re(e.end).getTime();if(!(r<=o))throw new RangeError("Invalid interval");return t>=r&&t<=o}var lp={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=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 t(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}}",t(d,c)).replace("{{time}}",r(p,c))},i={p:r,P:o},s=i;e.default=s,n.exports=e.default})(lp,lp.exports);var d5=lp.exports;const p5=ef(d5),f5={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 r1{constructor({locale:e,formats:t}={}){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||wb;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=p5[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=>Kj(r),this.toISO=r=>c5(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)=>dj(r,o),this.addMinutes=(r,o)=>fj(r,o),this.addHours=(r,o)=>mj(r,o),this.addDays=(r,o)=>ip(r,o),this.addWeeks=(r,o)=>gj(r,o),this.addMonths=(r,o)=>kl(r,o),this.addYears=(r,o)=>r0(r,o),this.isValid=r=>Cb(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 yj(r,a);case"quarters":return Cj(r,a);case"months":return Qx(r,a);case"weeks":return Mj(r,a);case"days":return e1(r,a);case"hours":return Ej(r,a);case"minutes":return Tj(r,a);case"seconds":return Oj(r,a);default:return du(r,a)}},this.isAfter=(r,o)=>nl(r,o),this.isBefore=(r,o)=>mi(r,o),this.startOfDay=r=>Xi(r),this.endOfDay=r=>sp(r),this.getHours=r=>Dj(r),this.setHours=(r,o)=>Hj(r,o),this.setMinutes=(r,o)=>Vj(r,o),this.getSeconds=r=>$j(r),this.setSeconds=(r,o)=>Wj(r,o),this.isSameDay=(r,o)=>UM(r,o),this.isSameMonth=(r,o)=>jj(r,o),this.isSameYear=(r,o)=>Fj(r,o),this.isSameHour=(r,o)=>_j(r,o),this.startOfYear=r=>ol(r),this.endOfYear=r=>Qu(r),this.startOfMonth=r=>rl(r),this.endOfMonth=r=>ap(r),this.startOfWeek=r=>ed(r,{locale:this.locale}),this.endOfWeek=r=>Xu(r,{locale:this.locale}),this.getYear=r=>Nj(r),this.setYear=(r,o)=>Gj(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:Jx(r,o,new Date,{locale:this.locale}),this.format=(r,o)=>this.formatByString(r,this.formats[o]),this.formatByString=(r,o)=>Hi(r,o,{locale:this.locale}),this.isEqual=(r,o)=>r===null&&o===null?!0:Bj(r,o),this.isNull=r=>r===null,this.isAfterDay=(r,o)=>nl(r,sp(o)),this.isBeforeDay=(r,o)=>mi(r,Xi(o)),this.isBeforeYear=(r,o)=>mi(r,ol(o)),this.isAfterYear=(r,o)=>nl(r,Qu(o)),this.isWithinRange=(r,[o,i])=>u5(r,{start:o,end:i}),this.formatNumber=r=>r,this.getMinutes=r=>Rj(r),this.getDate=r=>Aj(r),this.setDate=(r,o)=>zj(r,o),this.getMonth=r=>Ij(r),this.getDaysInMonth=r=>t1(r),this.setMonth=(r,o)=>Uj(r,o),this.getMeridiemText=r=>r==="am"?"AM":"PM",this.getNextMonth=r=>kl(r,1),this.getPreviousMonth=r=>kl(r,-1),this.getMonthArray=r=>{const i=[ol(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 Lj({start:ed(r,{locale:this.locale}),end:Xu(r,{locale:this.locale})}).map(o=>this.formatByString(o,"EEEEEE"))},this.getWeekArray=r=>{const o=ed(rl(r),{locale:this.locale}),i=Xu(ap(r),{locale:this.locale});let s=0,a=o;const l=[];let c=null;for(;mi(a,i);){const u=Math.floor(s/7);l[u]=l[u]||[];const d=Pj(a);c!==d&&(c=d,l[u].push(a),s+=1),a=ip(a,1)}return l},this.getYearRange=(r,o)=>{const i=ol(r),s=Qu(o),a=[];let l=i;for(;mi(l,s);)a.push(l),l=r0(l,1);return a},this.locale=e,this.formats=Object.assign({},f5,t)}isBeforeMonth(e,t){return mi(e,rl(t))}isAfterMonth(e,t){return nl(e,rl(t))}}const h5=n=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:K({},n)}}}}),o1={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"open previous view",openNextView:"open next view",calendarViewSwitchingButtonAriaLabel:n=>n==="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:(n,e,t)=>`Select ${n}. ${e===null?"No time selected":`Selected time is ${t.format(e,"fullTime")}`}`,hoursClockNumberText:n=>`${n} hours`,minutesClockNumberText:n=>`${n} minutes`,secondsClockNumberText:n=>`${n} seconds`,openDatePickerDialogue:(n,e)=>n&&e.isValid(e.date(n))?`Choose date, selected date is ${e.format(e.date(n),"fullDate")}`:"Choose date",openTimePickerDialogue:(n,e)=>n&&e.isValid(e.date(n))?`Choose time, selected time is ${e.format(e.date(n),"fullTime")}`:"Choose time",timeTableLabel:"pick time",dateTableLabel:"pick date"},m5=o1;h5(o1);const i1=h.createContext(null);function s1(n){const e=Ur({props:n,name:"MuiLocalizationProvider"}),{children:t,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:K({},m5,l??{})}),[u,c,l]);return v.jsx(i1.Provider,{value:d,children:t})}const Ia=()=>{const n=h.useContext(i1);if(n===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 n},_t=()=>Ia().utils,pu=()=>Ia().defaultDates,hs=()=>Ia().localeText,$a=()=>{const n=_t();return h.useRef(n.date()).current},nd=({date:n,disableFuture:e,disablePast:t,maxDate:r,minDate:o,isDateDisabled:i,utils:s})=>{const a=s.startOfDay(s.date());t&&s.isBefore(o,a)&&(o=a),e&&s.isAfter(r,a)&&(r=a);let l=n,c=n;for(s.isBefore(n,o)&&(l=s.date(o),c=null),s.isAfter(n,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},a1=(n,e)=>{const t=n.date(e);return n.isValid(t)?t:null},l1=n=>n.length===1&&n[0]==="year",c1=n=>n.length===2&&n.indexOf("month")!==-1&&n.indexOf("year")!==-1,g5=(n,e)=>l1(n)?{inputFormat:e.formats.year}:c1(n)?{disableMaskedInput:!0,inputFormat:e.formats.monthAndYear}:{inputFormat:e.formats.keyboardDate};function v5(n,e){var t;const r=_t(),o=pu(),i=Ur({props:n,name:e}),s=(t=i.views)!=null?t:["year","day"];return K({openTo:"day",minDate:o.minDate,maxDate:o.maxDate},g5(s,r),i,{views:s})}const y5={emptyValue:null,getTodayValue:n=>n.date(),parseInput:a1,areValuesEqual:(n,e,t)=>n.isEqual(e,t)};function b5(n){return kn("MuiCollapse",n)}At("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const x5=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],w5=n=>{const{orientation:e,classes:t}=n,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return Mn(r,b5,t)},C5=Me("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,e[t.orientation],t.state==="entered"&&e.entered,t.state==="exited"&&!t.in&&t.collapsedSize==="0px"&&e.hidden]}})(({theme:n,ownerState:e})=>K({height:0,overflow:"hidden",transition:n.transitions.create("height")},e.orientation==="horizontal"&&{height:"auto",width:0,transition:n.transitions.create("width")},e.state==="entered"&&K({height:"auto",overflow:"visible"},e.orientation==="horizontal"&&{width:"auto"}),e.state==="exited"&&!e.in&&e.collapsedSize==="0px"&&{visibility:"hidden"})),S5=Me("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(n,e)=>e.wrapper})(({ownerState:n})=>K({display:"flex",width:"100%"},n.orientation==="horizontal"&&{width:"auto",height:"100%"})),k5=Me("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(n,e)=>e.wrapperInner})(({ownerState:n})=>K({width:"100%"},n.orientation==="horizontal"&&{width:"auto",height:"100%"})),u1=h.forwardRef(function(e,t){const r=Qo({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:w,timeout:S=Ok.standard,TransitionComponent:T=gb}=r,k=tt(r,x5),x=K({},r,{orientation:b,collapsedSize:a}),C=w5(x),E=cs(),P=Hk(),O=h.useRef(null),F=h.useRef(),D=typeof a=="number"?`${a}px`:a,U=b==="horizontal",N=U?"width":"height",z=h.useRef(null),_=_r(t,z),$=I=>ie=>{if(I){const te=z.current;ie===void 0?I(te):I(te,ie)}},G=()=>O.current?O.current[U?"clientWidth":"clientHeight"]:0,le=$((I,ie)=>{O.current&&U&&(O.current.style.position="absolute"),I.style[N]=D,d&&d(I,ie)}),Z=$((I,ie)=>{const te=G();O.current&&U&&(O.current.style.position="");const{duration:Q,easing:fe}=Um({style:w,timeout:S,easing:c},{mode:"enter"});if(S==="auto"){const pe=E.transitions.getAutoHeightDuration(te);I.style.transitionDuration=`${pe}ms`,F.current=pe}else I.style.transitionDuration=typeof Q=="string"?Q:`${Q}ms`;I.style[N]=`${te}px`,I.style.transitionTimingFunction=fe,f&&f(I,ie)}),V=$((I,ie)=>{I.style[N]="auto",p&&p(I,ie)}),J=$(I=>{I.style[N]=`${G()}px`,m&&m(I)}),ce=$(g),q=$(I=>{const ie=G(),{duration:te,easing:Q}=Um({style:w,timeout:S,easing:c},{mode:"exit"});if(S==="auto"){const fe=E.transitions.getAutoHeightDuration(ie);I.style.transitionDuration=`${fe}ms`,F.current=fe}else I.style.transitionDuration=typeof te=="string"?te:`${te}ms`;I.style[N]=D,I.style.transitionTimingFunction=Q,y&&y(I)}),M=I=>{S==="auto"&&P.start(F.current||0,I),o&&o(z.current,I)};return v.jsx(T,K({in:u,onEnter:le,onEntered:V,onEntering:Z,onExit:J,onExited:ce,onExiting:q,addEndListener:M,nodeRef:z,timeout:S==="auto"?null:S},k,{children:(I,ie)=>v.jsx(C5,K({as:l,className:_n(C.root,s,{entered:C.entered,exited:!u&&D==="0px"&&C.hidden}[I]),style:K({[U?"minWidth":"minHeight"]:D},w),ref:_},ie,{ownerState:K({},x,{state:I}),children:v.jsx(S5,{ownerState:K({},x,{state:I}),className:C.wrapper,ref:O,children:v.jsx(k5,{ownerState:K({},x,{state:I}),className:C.wrapperInner,children:i})})}))}))});u1.muiSupportAuto=!0;const d1=h.createContext({}),M5=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],E5=["component","slots","slotProps"],T5=["component"];function O5(n,e){const{className:t,elementType:r,ownerState:o,externalForwardedProps:i,getSlotOwnerState:s,internalForwardedProps:a}=e,l=tt(e,M5),{component:c,slots:u={[n]:void 0},slotProps:d={[n]:void 0}}=i;tt(i,E5);const p=u[n]||r,f=Bk(d[n],o),m=Fk(K({className:t},l,{externalForwardedProps:void 0,externalSlotProps:f})),{props:{component:g},internalRef:y}=m,b=tt(m.props,T5),w=_r(y,f==null?void 0:f.ref,e.ref),S=s?s(b):{},T=K({},o,S),k=g,x=jk(p,K({},n==="root",!u[n]&&a,b,k&&{as:k},{ref:w}),T);return Object.keys(S).forEach(C=>{delete x[C]}),[p,x]}function L5(n){return kn("MuiAccordion",n)}const sl=At("MuiAccordion",["root","rounded","expanded","disabled","gutters","region"]),A5=["children","className","defaultExpanded","disabled","disableGutters","expanded","onChange","square","slots","slotProps","TransitionComponent","TransitionProps"],P5=n=>{const{classes:e,square:t,expanded:r,disabled:o,disableGutters:i}=n;return Mn({root:["root",!t&&"rounded",r&&"expanded",o&&"disabled",!i&&"gutters"],region:["region"]},L5,e)},D5=Me(ka,{name:"MuiAccordion",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[{[`& .${sl.region}`]:e.region},e.root,!t.square&&e.rounded,!t.disableGutters&&e.gutters]}})(({theme:n})=>{const e={duration:n.transitions.duration.shortest};return{position:"relative",transition:n.transitions.create(["margin"],e),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(n.vars||n).palette.divider,transition:n.transitions.create(["opacity","background-color"],e)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${sl.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${sl.disabled}`]:{backgroundColor:(n.vars||n).palette.action.disabledBackground}}},({theme:n})=>({variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(n.vars||n).shape.borderRadius,borderTopRightRadius:(n.vars||n).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(n.vars||n).shape.borderRadius,borderBottomRightRadius:(n.vars||n).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${sl.expanded}`]:{margin:"16px 0"}}}]})),R5=h.forwardRef(function(e,t){const r=Qo({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,A5),[b,w]=Yi({controlled:c,default:s,name:"Accordion",state:"expanded"}),S=h.useCallback(U=>{w(!b),u&&u(U,!b)},[b,u,w]),[T,...k]=h.Children.toArray(o),x=h.useMemo(()=>({expanded:b,disabled:a,disableGutters:l,toggle:S}),[b,a,l,S]),C=K({},r,{square:d,disabled:a,disableGutters:l,expanded:b}),E=P5(C),P=K({transition:m},p),O=K({transition:g},f),[F,D]=O5("transition",{elementType:u1,externalForwardedProps:{slots:P,slotProps:O},ownerState:C});return v.jsxs(D5,K({className:_n(E.root,i),ref:t,ownerState:C,square:d},y,{children:[v.jsx(d1.Provider,{value:x,children:T}),v.jsx(F,K({in:b,timeout:"auto"},D,{children:v.jsx("div",{"aria-labelledby":T.props.id,id:T.props["aria-controls"],role:"region",className:E.region,children:k})}))]}))});function I5(n){return kn("MuiAccordionDetails",n)}At("MuiAccordionDetails",["root"]);const $5=["className"],N5=n=>{const{classes:e}=n;return Mn({root:["root"]},I5,e)},B5=Me("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(n,e)=>e.root})(({theme:n})=>({padding:n.spacing(1,2,2)})),F5=h.forwardRef(function(e,t){const r=Qo({props:e,name:"MuiAccordionDetails"}),{className:o}=r,i=tt(r,$5),s=r,a=N5(s);return v.jsx(B5,K({className:_n(a.root,o),ref:t,ownerState:s},i))});function j5(n){return kn("MuiAccordionSummary",n)}const Wi=At("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),_5=["children","className","expandIcon","focusVisibleClassName","onClick"],z5=n=>{const{classes:e,expanded:t,disabled:r,disableGutters:o}=n;return Mn({root:["root",t&&"expanded",r&&"disabled",!o&&"gutters"],focusVisible:["focusVisible"],content:["content",t&&"expanded",!o&&"contentGutters"],expandIconWrapper:["expandIconWrapper",t&&"expanded"]},j5,e)},H5=Me(Mb,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(n,e)=>e.root})(({theme:n})=>{const e={duration:n.transitions.duration.shortest};return{display:"flex",minHeight:48,padding:n.spacing(0,2),transition:n.transitions.create(["min-height","background-color"],e),[`&.${Wi.focusVisible}`]:{backgroundColor:(n.vars||n).palette.action.focus},[`&.${Wi.disabled}`]:{opacity:(n.vars||n).palette.action.disabledOpacity},[`&:hover:not(.${Wi.disabled})`]:{cursor:"pointer"},variants:[{props:t=>!t.disableGutters,style:{[`&.${Wi.expanded}`]:{minHeight:64}}}]}}),V5=Me("div",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(n,e)=>e.content})(({theme:n})=>({display:"flex",flexGrow:1,margin:"12px 0",variants:[{props:e=>!e.disableGutters,style:{transition:n.transitions.create(["margin"],{duration:n.transitions.duration.shortest}),[`&.${Wi.expanded}`]:{margin:"20px 0"}}}]})),U5=Me("div",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(n,e)=>e.expandIconWrapper})(({theme:n})=>({display:"flex",color:(n.vars||n).palette.action.active,transform:"rotate(0deg)",transition:n.transitions.create("transform",{duration:n.transitions.duration.shortest}),[`&.${Wi.expanded}`]:{transform:"rotate(180deg)"}})),W5=h.forwardRef(function(e,t){const r=Qo({props:e,name:"MuiAccordionSummary"}),{children:o,className:i,expandIcon:s,focusVisibleClassName:a,onClick:l}=r,c=tt(r,_5),{disabled:u=!1,disableGutters:d,expanded:p,toggle:f}=h.useContext(d1),m=b=>{f&&f(b),l&&l(b)},g=K({},r,{expanded:p,disabled:u,disableGutters:d}),y=z5(g);return v.jsxs(H5,K({focusRipple:!1,disableRipple:!0,disabled:u,component:"div","aria-expanded":p,className:_n(y.root,i),focusVisibleClassName:_n(y.focusVisible,a),onClick:m,ref:t,ownerState:g},c,{children:[v.jsx(V5,{className:y.content,ownerState:g,children:o}),s&&v.jsx(U5,{className:y.expandIconWrapper,ownerState:g,children:s})]}))}),G5=Vr(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 a0(n){return typeof n.normalize<"u"?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n}function K5(n={}){const{ignoreAccents:e=!0,ignoreCase:t=!0,limit:r,matchFrom:o="any",stringify:i,trim:s=!1}=n;return(a,{inputValue:l,getOptionLabel:c})=>{let u=s?l.trim():l;t&&(u=u.toLowerCase()),e&&(u=a0(u));const d=u?a.filter(p=>{let f=(i||c)(p);return t&&(f=f.toLowerCase()),e&&(f=a0(f)),o==="start"?f.indexOf(u)===0:f.indexOf(u)>-1}):a;return typeof r=="number"?d.slice(0,r):d}}function al(n,e){for(let t=0;t{var e;return n.current!==null&&((e=n.current.parentElement)==null?void 0:e.contains(document.activeElement))};function J5(n){const{unstable_isActiveElementInListbox:e=Y5,unstable_classNamePrefix:t="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:i=!1,blurOnSelect:s=!1,clearOnBlur:a=!n.freeSolo,clearOnEscape:l=!1,componentName:c="useAutocomplete",defaultValue:u=n.multiple?[]:null,disableClearable:d=!1,disableCloseOnSelect:p=!1,disabled:f,disabledItemsFocusable:m=!1,disableListWrap:g=!1,filterOptions:y=q5,filterSelectedOptions:b=!1,freeSolo:w=!1,getOptionDisabled:S,getOptionKey:T,getOptionLabel:k=re=>{var X;return(X=re.label)!=null?X:re},groupBy:x,handleHomeEndKeys:C=!n.freeSolo,id:E,includeInputInList:P=!1,inputValue:O,isOptionEqualToValue:F=(re,X)=>re===X,multiple:D=!1,onChange:U,onClose:N,onHighlightChange:z,onInputChange:_,onOpen:$,open:G,openOnFocus:le=!1,options:Z,readOnly:V=!1,selectOnFocus:J=!n.freeSolo,value:ce}=n,q=af(E);let M=k;M=re=>{const X=k(re);return typeof X!="string"?String(X):X};const I=h.useRef(!1),ie=h.useRef(!0),te=h.useRef(null),Q=h.useRef(null),[fe,pe]=h.useState(null),[ye,Le]=h.useState(-1),Oe=o?0:-1,B=h.useRef(Oe),[R,oe]=Yi({controlled:ce,default:u,name:c}),[ne,de]=Yi({controlled:O,default:"",name:c,state:"inputValue"}),[he,we]=h.useState(!1),ve=h.useCallback((re,X)=>{if(!(D?R.length!(b&&(D?R:[R]).some(X=>X!==null&&F(re,X)))),{inputValue:Ae&&_e?"":ne,getOptionLabel:M}):[],it=NM({filteredOptions:Pe,value:R,inputValue:ne});h.useEffect(()=>{const re=R!==it.value;he&&!re||w&&!re||ve(null,R)},[R,ve,he,it.value,w]);const zt=me&&Pe.length>0&&!V,Pt=Os(re=>{re===-1?te.current.focus():fe.querySelector(`[data-tag-index="${re}"]`).focus()});h.useEffect(()=>{D&&ye>R.length-1&&(Le(-1),Pt(-1))},[R,D,ye,Pt]);function Wt(re,X){if(!Q.current||re<0||re>=Pe.length)return-1;let ke=re;for(;;){const be=Q.current.querySelector(`[data-option-index="${ke}"]`),ze=m?!1:!be||be.disabled||be.getAttribute("aria-disabled")==="true";if(be&&be.hasAttribute("tabindex")&&!ze)return ke;if(X==="next"?ke=(ke+1)%Pe.length:ke=(ke-1+Pe.length)%Pe.length,ke===re)return-1}}const Ht=Os(({event:re,index:X,reason:ke="auto"})=>{if(B.current=X,X===-1?te.current.removeAttribute("aria-activedescendant"):te.current.setAttribute("aria-activedescendant",`${q}-option-${X}`),z&&z(re,X===-1?null:Pe[X],ke),!Q.current)return;const be=Q.current.querySelector(`[role="option"].${t}-focused`);be&&(be.classList.remove(`${t}-focused`),be.classList.remove(`${t}-focusVisible`));let ze=Q.current;if(Q.current.getAttribute("role")!=="listbox"&&(ze=Q.current.parentElement.querySelector('[role="listbox"]')),!ze)return;if(X===-1){ze.scrollTop=0;return}const et=Q.current.querySelector(`[data-option-index="${X}"]`);if(et&&(et.classList.add(`${t}-focused`),ke==="keyboard"&&et.classList.add(`${t}-focusVisible`),ze.scrollHeight>ze.clientHeight&&ke!=="mouse"&&ke!=="touch")){const L=et,W=ze.clientHeight+ze.scrollTop,ae=L.offsetTop+L.offsetHeight;ae>W?ze.scrollTop=ae-ze.clientHeight:L.offsetTop-L.offsetHeight*(x?1.3:0){if(!He)return;const et=Wt((()=>{const L=Pe.length-1;if(X==="reset")return Oe;if(X==="start")return 0;if(X==="end")return L;const W=B.current+X;return W<0?W===-1&&P?-1:g&&B.current!==-1||Math.abs(X)>1?0:L:W>L?W===L+1&&P?-1:g||Math.abs(X)>1?L:0:W})(),ke);if(Ht({index:et,reason:be,event:re}),r&&X!=="reset")if(et===-1)te.current.value=ne;else{const L=M(Pe[et]);te.current.value=L,L.toLowerCase().indexOf(ne.toLowerCase())===0&&ne.length>0&&te.current.setSelectionRange(ne.length,L.length)}}),lt=()=>{const re=(X,ke)=>{const be=X?M(X):"",ze=ke?M(ke):"";return be===ze};if(B.current!==-1&&it.filteredOptions&&it.filteredOptions.length!==Pe.length&&it.inputValue===ne&&(D?R.length===it.value.length&&it.value.every((X,ke)=>M(R[ke])===M(X)):re(it.value,R))){const X=it.filteredOptions[B.current];if(X)return al(Pe,ke=>M(ke)===M(X))}return-1},yn=h.useCallback(()=>{if(!He)return;const re=lt();if(re!==-1){B.current=re;return}const X=D?R[0]:R;if(Pe.length===0||X==null){Gt({diff:"reset"});return}if(Q.current){if(X!=null){const ke=Pe[B.current];if(D&&ke&&al(R,ze=>F(ke,ze))!==-1)return;const be=al(Pe,ze=>F(ze,X));be===-1?Gt({diff:"reset"}):Ht({index:be});return}if(B.current>=Pe.length-1){Ht({index:Pe.length-1});return}Ht({index:B.current})}},[Pe.length,D?!1:R,b,Gt,Ht,He,ne,D]),Dn=Os(re=>{Vk(Q,re),re&&yn()});h.useEffect(()=>{yn()},[yn]);const $t=re=>{me||(ue(!0),Ee(!0),$&&$(re))},cn=(re,X)=>{me&&(ue(!1),N&&N(re,X))},Kt=(re,X,ke,be)=>{if(D){if(R.length===X.length&&R.every((ze,et)=>ze===X[et]))return}else if(R===X)return;U&&U(re,X,ke,be),oe(X)},En=h.useRef(!1),Rn=(re,X,ke="selectOption",be="options")=>{let ze=ke,et=X;if(D){et=Array.isArray(R)?R.slice():[];const L=al(et,W=>F(X,W));L===-1?et.push(X):be!=="freeSolo"&&(et.splice(L,1),ze="removeOption")}ve(re,et),Kt(re,et,ze,{option:X}),!p&&(!re||!re.ctrlKey&&!re.metaKey)&&cn(re,ze),(s===!0||s==="touch"&&En.current||s==="mouse"&&!En.current)&&te.current.blur()};function Gn(re,X){if(re===-1)return-1;let ke=re;for(;;){if(X==="next"&&ke===R.length||X==="previous"&&ke===-1)return-1;const be=fe.querySelector(`[data-tag-index="${ke}"]`);if(!be||!be.hasAttribute("tabindex")||be.disabled||be.getAttribute("aria-disabled")==="true")ke+=X==="next"?1:-1;else return ke}}const un=(re,X)=>{if(!D)return;ne===""&&cn(re,"toggleInput");let ke=ye;ye===-1?ne===""&&X==="previous"&&(ke=R.length-1):(ke+=X==="next"?1:-1,ke<0&&(ke=0),ke===R.length&&(ke=-1)),ke=Gn(ke,X),Le(ke),Pt(ke)},dn=re=>{I.current=!0,de(""),_&&_(re,"","clear"),Kt(re,D?[]:null,"clear")},Lr=re=>X=>{if(re.onKeyDown&&re.onKeyDown(X),!X.defaultMuiPrevented&&(ye!==-1&&["ArrowLeft","ArrowRight"].indexOf(X.key)===-1&&(Le(-1),Pt(-1)),X.which!==229))switch(X.key){case"Home":He&&C&&(X.preventDefault(),Gt({diff:"start",direction:"next",reason:"keyboard",event:X}));break;case"End":He&&C&&(X.preventDefault(),Gt({diff:"end",direction:"previous",reason:"keyboard",event:X}));break;case"PageUp":X.preventDefault(),Gt({diff:-l0,direction:"previous",reason:"keyboard",event:X}),$t(X);break;case"PageDown":X.preventDefault(),Gt({diff:l0,direction:"next",reason:"keyboard",event:X}),$t(X);break;case"ArrowDown":X.preventDefault(),Gt({diff:1,direction:"next",reason:"keyboard",event:X}),$t(X);break;case"ArrowUp":X.preventDefault(),Gt({diff:-1,direction:"previous",reason:"keyboard",event:X}),$t(X);break;case"ArrowLeft":un(X,"previous");break;case"ArrowRight":un(X,"next");break;case"Enter":if(B.current!==-1&&He){const ke=Pe[B.current],be=S?S(ke):!1;if(X.preventDefault(),be)return;Rn(X,ke,"selectOption"),r&&te.current.setSelectionRange(te.current.value.length,te.current.value.length)}else w&&ne!==""&&Ae===!1&&(D&&X.preventDefault(),Rn(X,ne,"createOption","freeSolo"));break;case"Escape":He?(X.preventDefault(),X.stopPropagation(),cn(X,"escape")):l&&(ne!==""||D&&R.length>0)&&(X.preventDefault(),X.stopPropagation(),dn(X));break;case"Backspace":if(D&&!V&&ne===""&&R.length>0){const ke=ye===-1?R.length-1:ye,be=R.slice();be.splice(ke,1),Kt(X,be,"removeOption",{option:R[ke]})}break;case"Delete":if(D&&!V&&ne===""&&R.length>0&&ye!==-1){const ke=ye,be=R.slice();be.splice(ke,1),Kt(X,be,"removeOption",{option:R[ke]})}break}},Kn=re=>{we(!0),le&&!I.current&&$t(re)},qn=re=>{if(e(Q)){te.current.focus();return}we(!1),ie.current=!0,I.current=!1,i&&B.current!==-1&&He?Rn(re,Pe[B.current],"blur"):i&&w&&ne!==""?Rn(re,ne,"blur","freeSolo"):a&&ve(re,R),cn(re,"blur")},Dt=re=>{const X=re.target.value;ne!==X&&(de(X),Ee(!1),_&&_(re,X,"input")),X===""?!d&&!D&&Kt(re,null,"clear"):$t(re)},yt=re=>{const X=Number(re.currentTarget.getAttribute("data-option-index"));B.current!==X&&Ht({event:re,index:X,reason:"mouse"})},qt=re=>{Ht({event:re,index:Number(re.currentTarget.getAttribute("data-option-index")),reason:"touch"}),En.current=!0},In=re=>{const X=Number(re.currentTarget.getAttribute("data-option-index"));Rn(re,Pe[X],"selectOption"),En.current=!1},Yn=re=>X=>{const ke=R.slice();ke.splice(re,1),Kt(X,ke,"removeOption",{option:R[re]})},Ar=re=>{me?cn(re,"toggleInput"):$t(re)},Pr=re=>{re.currentTarget.contains(re.target)&&re.target.getAttribute("id")!==q&&re.preventDefault()},Jt=re=>{re.currentTarget.contains(re.target)&&(te.current.focus(),J&&ie.current&&te.current.selectionEnd-te.current.selectionStart===0&&te.current.select(),ie.current=!1)},Jn=re=>{!f&&(ne===""||!me)&&Ar(re)};let $n=w&&ne.length>0;$n=$n||(D?R.length>0:R!==null);let Nn=Pe;return x&&(Nn=Pe.reduce((re,X,ke)=>{const be=x(X);return re.length>0&&re[re.length-1].group===be?re[re.length-1].options.push(X):re.push({key:ke,index:ke,group:be,options:[X]}),re},[])),f&&he&&qn(),{getRootProps:(re={})=>K({"aria-owns":zt?`${q}-listbox`:null},re,{onKeyDown:Lr(re),onMouseDown:Pr,onClick:Jt}),getInputLabelProps:()=>({id:`${q}-label`,htmlFor:q}),getInputProps:()=>({id:q,value:ne,onBlur:qn,onFocus:Kn,onChange:Dt,onMouseDown:Jn,"aria-activedescendant":He?"":null,"aria-autocomplete":r?"both":"list","aria-controls":zt?`${q}-listbox`:void 0,"aria-expanded":zt,autoComplete:"off",ref:te,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:f}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:dn}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Ar}),getTagProps:({index:re})=>K({key:re,"data-tag-index":re,tabIndex:-1},!V&&{onDelete:Yn(re)}),getListboxProps:()=>({role:"listbox",id:`${q}-listbox`,"aria-labelledby":`${q}-label`,ref:Dn,onMouseDown:re=>{re.preventDefault()}}),getOptionProps:({index:re,option:X})=>{var ke;const be=(D?R:[R]).some(et=>et!=null&&F(X,et)),ze=S?S(X):!1;return{key:(ke=T==null?void 0:T(X))!=null?ke:M(X),tabIndex:-1,role:"option",id:`${q}-option-${re}`,onMouseMove:yt,onClick:In,onTouchStart:qt,"data-option-index":re,"aria-disabled":ze,"aria-selected":be}},id:q,inputValue:ne,value:R,dirty:$n,expanded:He&&fe,popupOpen:He,focused:he||ye!==-1,anchorEl:fe,setAnchorEl:pe,focusedTag:ye,groupedOptions:Nn}}function Z5(n){return kn("MuiListSubheader",n)}At("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const X5=["className","color","component","disableGutters","disableSticky","inset"],Q5=n=>{const{classes:e,color:t,disableGutters:r,inset:o,disableSticky:i}=n,s={root:["root",t!=="default"&&`color${Sa(t)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]};return Mn(s,Z5,e)},e_=Me("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.color!=="default"&&e[`color${Sa(t.color)}`],!t.disableGutters&&e.gutters,t.inset&&e.inset,!t.disableSticky&&e.sticky]}})(({theme:n,ownerState:e})=>K({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(n.vars||n).palette.text.secondary,fontFamily:n.typography.fontFamily,fontWeight:n.typography.fontWeightMedium,fontSize:n.typography.pxToRem(14)},e.color==="primary"&&{color:(n.vars||n).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:(n.vars||n).palette.background.paper})),p1=h.forwardRef(function(e,t){const r=Qo({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,X5),d=K({},r,{color:i,component:s,disableGutters:a,disableSticky:l,inset:c}),p=Q5(d);return v.jsx(e_,K({as:s,className:_n(p.root,o),ref:t,ownerState:d},u))});p1.muiSkipListHighlight=!0;function t_(n){return kn("MuiAutocomplete",n)}const Ke=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 c0,u0;const n_=["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"],r_=["ref"],o_=["key"],i_=["key"],s_=n=>{const{classes:e,disablePortal:t,expanded:r,focused:o,fullWidth:i,hasClearIcon:s,hasPopupIcon:a,inputFocused:l,popupOpen:c,size:u}=n,d={root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",s&&"hasClearIcon",a&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${Sa(u)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",c&&"popupIndicatorOpen"],popper:["popper",t&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Mn(d,t_,e)},a_=Me("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:s,size:a}=t;return[{[`& .${Ke.tag}`]:e.tag},{[`& .${Ke.tag}`]:e[`tagSize${Sa(a)}`]},{[`& .${Ke.inputRoot}`]:e.inputRoot},{[`& .${Ke.input}`]:e.input},{[`& .${Ke.input}`]:s&&e.inputFocused},e.root,r&&e.fullWidth,i&&e.hasPopupIcon,o&&e.hasClearIcon]}})({[`&.${Ke.focused} .${Ke.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${Ke.clearIndicator}`]:{visibility:"visible"}},[`& .${Ke.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${Ke.inputRoot}`]:{[`.${Ke.hasPopupIcon}&, .${Ke.hasClearIcon}&`]:{paddingRight:30},[`.${Ke.hasPopupIcon}.${Ke.hasClearIcon}&`]:{paddingRight:56},[`& .${Ke.input}`]:{width:0,minWidth:30}},[`& .${Du.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Du.root}.${Mo.sizeSmall}`]:{[`& .${Du.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Vm.root}`]:{padding:9,[`.${Ke.hasPopupIcon}&, .${Ke.hasClearIcon}&`]:{paddingRight:39},[`.${Ke.hasPopupIcon}.${Ke.hasClearIcon}&`]:{paddingRight:65},[`& .${Ke.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${Ke.endAdornment}`]:{right:9}},[`& .${Vm.root}.${Mo.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${Ke.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${pi.root}`]:{paddingTop:19,paddingLeft:8,[`.${Ke.hasPopupIcon}&, .${Ke.hasClearIcon}&`]:{paddingRight:39},[`.${Ke.hasPopupIcon}.${Ke.hasClearIcon}&`]:{paddingRight:65},[`& .${pi.input}`]:{padding:"7px 4px"},[`& .${Ke.endAdornment}`]:{right:9}},[`& .${pi.root}.${Mo.sizeSmall}`]:{paddingBottom:1,[`& .${pi.input}`]:{padding:"2.5px 4px"}},[`& .${Mo.hiddenLabel}`]:{paddingTop:8},[`& .${pi.root}.${Mo.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${Ke.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${pi.root}.${Mo.hiddenLabel}.${Mo.sizeSmall}`]:{[`& .${Ke.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${Ke.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${Ke.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${Ke.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${Ke.inputRoot}`]:{flexWrap:"wrap"}}}]}),l_=Me("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(n,e)=>e.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),c_=Me(xo,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(n,e)=>e.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),u_=Me(xo,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:n},e)=>K({},e.popupIndicator,n.popupOpen&&e.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),d_=Me(ei,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[{[`& .${Ke.option}`]:e.option},e.popper,t.disablePortal&&e.popperDisablePortal]}})(({theme:n})=>({zIndex:(n.vars||n).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),p_=Me(ka,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(n,e)=>e.paper})(({theme:n})=>K({},n.typography.body1,{overflow:"auto"})),f_=Me("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(n,e)=>e.loading})(({theme:n})=>({color:(n.vars||n).palette.text.secondary,padding:"14px 16px"})),h_=Me("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(n,e)=>e.noOptions})(({theme:n})=>({color:(n.vars||n).palette.text.secondary,padding:"14px 16px"})),m_=Me("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(n,e)=>e.listbox})(({theme:n})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${Ke.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,[n.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${Ke.focused}`]:{backgroundColor:(n.vars||n).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(n.vars||n).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${Ke.focusVisible}`]:{backgroundColor:(n.vars||n).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:n.vars?`rgba(${n.vars.palette.primary.mainChannel} / ${n.vars.palette.action.selectedOpacity})`:Ru(n.palette.primary.main,n.palette.action.selectedOpacity),[`&.${Ke.focused}`]:{backgroundColor:n.vars?`rgba(${n.vars.palette.primary.mainChannel} / calc(${n.vars.palette.action.selectedOpacity} + ${n.vars.palette.action.hoverOpacity}))`:Ru(n.palette.primary.main,n.palette.action.selectedOpacity+n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(n.vars||n).palette.action.selected}},[`&.${Ke.focusVisible}`]:{backgroundColor:n.vars?`rgba(${n.vars.palette.primary.mainChannel} / calc(${n.vars.palette.action.selectedOpacity} + ${n.vars.palette.action.focusOpacity}))`:Ru(n.palette.primary.main,n.palette.action.selectedOpacity+n.palette.action.focusOpacity)}}}})),g_=Me(p1,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(n,e)=>e.groupLabel})(({theme:n})=>({backgroundColor:(n.vars||n).palette.background.paper,top:-8})),v_=Me("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(n,e)=>e.groupUl})({padding:0,[`& .${Ke.option}`]:{paddingLeft:24}}),y_=h.forwardRef(function(e,t){var r,o,i,s;const a=Qo({props:e,name:"MuiAutocomplete"}),{autoComplete:l=!1,autoHighlight:c=!1,autoSelect:u=!1,blurOnSelect:d=!1,ChipProps:p,className:f,clearIcon:m=c0||(c0=v.jsx(G5,{fontSize:"small"})),clearOnBlur:g=!a.freeSolo,clearOnEscape:y=!1,clearText:b="Clear",closeText:w="Close",componentsProps:S={},defaultValue:T=a.multiple?[]:null,disableClearable:k=!1,disableCloseOnSelect:x=!1,disabled:C=!1,disabledItemsFocusable:E=!1,disableListWrap:P=!1,disablePortal:O=!1,filterSelectedOptions:F=!1,forcePopupIcon:D="auto",freeSolo:U=!1,fullWidth:N=!1,getLimitTagsText:z=be=>`+${be}`,getOptionLabel:_,groupBy:$,handleHomeEndKeys:G=!a.freeSolo,includeInputInList:le=!1,limitTags:Z=-1,ListboxComponent:V="ul",ListboxProps:J,loading:ce=!1,loadingText:q="Loading…",multiple:M=!1,noOptionsText:I="No options",openOnFocus:ie=!1,openText:te="Open",PaperComponent:Q=ka,PopperComponent:fe=ei,popupIcon:pe=u0||(u0=v.jsx(sk,{})),readOnly:ye=!1,renderGroup:Le,renderInput:Oe,renderOption:B,renderTags:R,selectOnFocus:oe=!a.freeSolo,size:ne="medium",slotProps:de={}}=a,he=tt(a,n_),{getRootProps:we,getInputProps:ve,getInputLabelProps:me,getPopupIndicatorProps:ue,getClearProps:_e,getTagProps:Ee,getListboxProps:Ae,getOptionProps:He,value:Pe,dirty:it,expanded:zt,id:Pt,popupOpen:Wt,focused:Ht,focusedTag:Gt,anchorEl:lt,setAnchorEl:yn,inputValue:Dn,groupedOptions:$t}=J5(K({},a,{componentName:"Autocomplete"})),cn=!k&&!C&&it&&!ye,Kt=(!U||D===!0)&&D!==!1,{onMouseDown:En}=ve(),{ref:Rn}=J??{},Gn=Ae(),{ref:un}=Gn,dn=tt(Gn,r_),Lr=_r(un,Rn),qn=_||(be=>{var ze;return(ze=be.label)!=null?ze:be}),Dt=K({},a,{disablePortal:O,expanded:zt,focused:Ht,fullWidth:N,getOptionLabel:qn,hasClearIcon:cn,hasPopupIcon:Kt,inputFocused:Gt===-1,popupOpen:Wt,size:ne}),yt=s_(Dt);let qt;if(M&&Pe.length>0){const be=ze=>K({className:yt.tag,disabled:C},Ee(ze));R?qt=R(Pe,be,Dt):qt=Pe.map((ze,et)=>{const L=be({index:et}),{key:W}=L,ae=tt(L,o_);return v.jsx(Pk,K({label:qn(ze),size:ne},ae,p),W)})}if(Z>-1&&Array.isArray(qt)){const be=qt.length-Z;!Ht&&be>0&&(qt=qt.splice(0,Z),qt.push(v.jsx("span",{className:yt.tag,children:z(be)},qt.length)))}const Yn=Le||(be=>v.jsxs("li",{children:[v.jsx(g_,{className:yt.groupLabel,ownerState:Dt,component:"div",children:be.group}),v.jsx(v_,{className:yt.groupUl,ownerState:Dt,children:be.children})]},be.key)),Pr=B||((be,ze)=>{const{key:et}=be,L=tt(be,i_);return v.jsx("li",K({},L,{children:qn(ze)}),et)}),Jt=(be,ze)=>{const et=He({option:be,index:ze});return Pr(K({},et,{className:yt.option}),be,{selected:et["aria-selected"],index:ze,inputValue:Dn},Dt)},Jn=(r=de.clearIndicator)!=null?r:S.clearIndicator,$n=(o=de.paper)!=null?o:S.paper,Nn=(i=de.popper)!=null?i:S.popper,re=(s=de.popupIndicator)!=null?s:S.popupIndicator,X=be=>v.jsx(d_,K({as:fe,disablePortal:O,style:{width:lt?lt.clientWidth:null},ownerState:Dt,role:"presentation",anchorEl:lt,open:Wt},Nn,{className:_n(yt.popper,Nn==null?void 0:Nn.className),children:v.jsx(p_,K({ownerState:Dt,as:Q},$n,{className:_n(yt.paper,$n==null?void 0:$n.className),children:be}))}));let ke=null;return $t.length>0?ke=X(v.jsx(m_,K({as:V,className:yt.listbox,ownerState:Dt},dn,J,{ref:Lr,children:$t.map((be,ze)=>$?Yn({key:be.key,group:be.group,children:be.options.map((et,L)=>Jt(et,be.index+L))}):Jt(be,ze))}))):ce&&$t.length===0?ke=X(v.jsx(f_,{className:yt.loading,ownerState:Dt,children:q})):$t.length===0&&!U&&!ce&&(ke=X(v.jsx(h_,{className:yt.noOptions,ownerState:Dt,role:"presentation",onMouseDown:be=>{be.preventDefault()},children:I}))),v.jsxs(h.Fragment,{children:[v.jsx(a_,K({ref:t,className:_n(yt.root,f),ownerState:Dt},we(he),{children:Oe({id:Pt,disabled:C,fullWidth:!0,size:ne==="small"?"small":void 0,InputLabelProps:me(),InputProps:K({ref:yn,className:yt.inputRoot,startAdornment:qt,onClick:be=>{be.target===be.currentTarget&&En(be)}},(cn||Kt)&&{endAdornment:v.jsxs(l_,{className:yt.endAdornment,ownerState:Dt,children:[cn?v.jsx(c_,K({},_e(),{"aria-label":b,title:b,ownerState:Dt},Jn,{className:_n(yt.clearIndicator,Jn==null?void 0:Jn.className),children:m})):null,Kt?v.jsx(u_,K({},ue(),{disabled:C,"aria-label":Wt?w:te,title:Wt?w:te,ownerState:Dt},re,{className:_n(yt.popupIndicator,re==null?void 0:re.className),children:pe})):null]})}),inputProps:K({className:yt.input,disabled:C,readOnly:ye},ve())})})),lt?ke:null]})}),d0=h.createContext();function b_(n){return kn("MuiGrid",n)}const x_=[0,1,2,3,4,5,6,7,8,9,10],w_=["column-reverse","column","row-reverse","row"],C_=["nowrap","wrap-reverse","wrap"],ks=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],ca=At("MuiGrid",["root","container","item","zeroMinWidth",...x_.map(n=>`spacing-xs-${n}`),...w_.map(n=>`direction-xs-${n}`),...C_.map(n=>`wrap-xs-${n}`),...ks.map(n=>`grid-xs-${n}`),...ks.map(n=>`grid-sm-${n}`),...ks.map(n=>`grid-md-${n}`),...ks.map(n=>`grid-lg-${n}`),...ks.map(n=>`grid-xl-${n}`)]),S_=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function Ji(n){const e=parseFloat(n);return`${e}${String(n).replace(String(e),"")||"px"}`}function k_({theme:n,ownerState:e}){let t;return n.breakpoints.keys.reduce((r,o)=>{let i={};if(e[o]&&(t=e[o]),!t)return r;if(t===!0)i={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(t==="auto")i={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=Jc({values:e.columns,breakpoints:n.breakpoints.values}),a=typeof s=="object"?s[o]:s;if(a==null)return r;const l=`${Math.round(t/a*1e8)/1e6}%`;let c={};if(e.container&&e.item&&e.columnSpacing!==0){const u=n.spacing(e.columnSpacing);if(u!=="0px"){const d=`calc(${l} + ${Ji(u)})`;c={flexBasis:d,maxWidth:d}}}i=K({flexBasis:l,flexGrow:0,maxWidth:l},c)}return n.breakpoints.values[o]===0?Object.assign(r,i):r[n.breakpoints.up(o)]=i,r},{})}function M_({theme:n,ownerState:e}){const t=Jc({values:e.direction,breakpoints:n.breakpoints.values});return rf({theme:n},t,r=>{const o={flexDirection:r};return r.indexOf("column")===0&&(o[`& > .${ca.item}`]={maxWidth:"none"}),o})}function f1({breakpoints:n,values:e}){let t="";Object.keys(e).forEach(o=>{t===""&&e[o]!==0&&(t=o)});const r=Object.keys(n).sort((o,i)=>n[o]-n[i]);return r.slice(0,r.indexOf(t))}function E_({theme:n,ownerState:e}){const{container:t,rowSpacing:r}=e;let o={};if(t&&r!==0){const i=Jc({values:r,breakpoints:n.breakpoints.values});let s;typeof i=="object"&&(s=f1({breakpoints:n.breakpoints.values,values:i})),o=rf({theme:n},i,(a,l)=>{var c;const u=n.spacing(a);return u!=="0px"?{marginTop:`-${Ji(u)}`,[`& > .${ca.item}`]:{paddingTop:Ji(u)}}:(c=s)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${ca.item}`]:{paddingTop:0}}})}return o}function T_({theme:n,ownerState:e}){const{container:t,columnSpacing:r}=e;let o={};if(t&&r!==0){const i=Jc({values:r,breakpoints:n.breakpoints.values});let s;typeof i=="object"&&(s=f1({breakpoints:n.breakpoints.values,values:i})),o=rf({theme:n},i,(a,l)=>{var c;const u=n.spacing(a);return u!=="0px"?{width:`calc(100% + ${Ji(u)})`,marginLeft:`-${Ji(u)}`,[`& > .${ca.item}`]:{paddingLeft:Ji(u)}}:(c=s)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${ca.item}`]:{paddingLeft:0}}})}return o}function O_(n,e,t={}){if(!n||n<=0)return[];if(typeof n=="string"&&!Number.isNaN(Number(n))||typeof n=="number")return[t[`spacing-xs-${String(n)}`]];const r=[];return e.forEach(o=>{const i=n[o];Number(i)>0&&r.push(t[`spacing-${o}-${String(i)}`])}),r}const L_=Me("div",{name:"MuiGrid",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n,{container:r,direction:o,item:i,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=t;let u=[];r&&(u=O_(s,c,e));const d=[];return c.forEach(p=>{const f=t[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:n})=>K({boxSizing:"border-box"},n.container&&{display:"flex",flexWrap:"wrap",width:"100%"},n.item&&{margin:0},n.zeroMinWidth&&{minWidth:0},n.wrap!=="wrap"&&{flexWrap:n.wrap}),M_,E_,T_,k_);function A_(n,e){if(!n||n<=0)return[];if(typeof n=="string"&&!Number.isNaN(Number(n))||typeof n=="number")return[`spacing-xs-${String(n)}`];const t=[];return e.forEach(r=>{const o=n[r];if(Number(o)>0){const i=`spacing-${r}-${String(o)}`;t.push(i)}}),t}const P_=n=>{const{classes:e,container:t,direction:r,item:o,spacing:i,wrap:s,zeroMinWidth:a,breakpoints:l}=n;let c=[];t&&(c=A_(i,l));const u=[];l.forEach(p=>{const f=n[p];f&&u.push(`grid-${p}-${String(f)}`)});const d={root:["root",t&&"container",o&&"item",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return Mn(d,b_,e)},D_=h.forwardRef(function(e,t){const r=Qo({props:e,name:"MuiGrid"}),{breakpoints:o}=cs(),i=Lk(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,S_),w=f||m,S=l||m,T=h.useContext(d0),k=u?a||12:T,x={},C=K({},b);o.keys.forEach(O=>{b[O]!=null&&(x[O]=b[O],delete C[O])});const E=K({},i,{columns:k,container:u,direction:d,item:p,rowSpacing:w,columnSpacing:S,wrap:g,zeroMinWidth:y,spacing:m},x,{breakpoints:o.keys}),P=P_(E);return v.jsx(d0.Provider,{value:k,children:v.jsx(L_,K({ownerState:E,className:_n(P.root,s),as:c,ref:t},C))})});function R_(n){return kn("MuiRadioGroup",n)}At("MuiRadioGroup",["root","row","error"]);const I_=["actions","children","className","defaultValue","name","onChange","value"],$_=n=>{const{classes:e,row:t,error:r}=n;return Mn({root:["root",t&&"row",r&&"error"]},R_,e)},N_=h.forwardRef(function(e,t){const{actions:r,children:o,className:i,defaultValue:s,name:a,onChange:l,value:c}=e,u=tt(e,I_),d=h.useRef(null),p=$_(e),[f,m]=Yi({controlled:c,default:s,name:"RadioGroup"});h.useImperativeHandle(r,()=>({focus:()=>{let w=d.current.querySelector("input:not(:disabled):checked");w||(w=d.current.querySelector("input:not(:disabled)")),w&&w.focus()}}),[]);const g=_r(t,d),y=af(a),b=h.useMemo(()=>({name:y,onChange(w){m(w.target.value),l&&l(w,w.target.value)},value:f}),[y,l,m,f]);return v.jsx(Uk.Provider,{value:b,children:v.jsx(kk,K({role:"radiogroup",ref:g,className:_n(p.root,i)},u,{children:o}))})});function h1(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n))for(e=0;ee.root})(({theme:n,ownerState:e})=>K({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:n.spacing(2,3)},e.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"})),H_=Me(D_,{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(n,e)=>e.content})({flex:1}),V_=Me(xo,{name:"MuiPickersToolbar",slot:"PenIconButton",overridesResolver:(n,e)=>e.penIconButton})({}),U_=n=>n==="clock"?v.jsx(g1,{color:"inherit"}):v.jsx(m1,{color:"inherit"});function W_(n,e){return n?`text input view is open, go to ${e} view`:`${e} view is open, go to text input view`}const v1=h.forwardRef(function(e,t){const{children:r,className:o,getMobileKeyboardInputViewButtonText:i=W_,isLandscape:s,isMobileKeyboardViewOpen:a,landscapeDirection:l="column",toggleMobileKeyboardView:c,toolbarTitle:u,viewType:d="calendar"}=e,p=e;return v.jsxs(z_,{ref:t,className:Qt(Gi.root,o),ownerState:p,children:[v.jsx(mo,{color:"text.secondary",variant:"overline",children:u}),v.jsxs(H_,{container:!0,justifyContent:"space-between",className:Gi.content,ownerState:p,direction:s?l:"row",alignItems:s?"flex-start":"flex-end",children:[r,v.jsx(V_,{onClick:c,className:Qt(Gi.penIconButton,s&&Gi.penIconButtonLandscape),ownerState:p,color:"inherit","aria-label":i(a,d),children:a?U_(d):v.jsx(__,{color:"inherit"})})]})]})}),G_=["parsedValue","isLandscape","isMobileKeyboardViewOpen","onChange","toggleMobileKeyboardView","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],p0=At("MuiDatePickerToolbar",["root","title"]),K_=Me(v1,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(n,e)=>e.root})({[`& .${Gi.penIconButton}`]:{position:"relative",top:4}}),q_=Me(mo,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(n,e)=>e.title})(({ownerState:n})=>K({},n.isLandscape&&{margin:"auto 16px auto auto"})),Y_=h.forwardRef(function(e,t){const{parsedValue:r,isLandscape:o,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,toolbarFormat:a,toolbarPlaceholder:l="––",toolbarTitle:c="Select date",views:u}=e,d=tt(e,G_),p=_t(),f=h.useMemo(()=>r?a?p.formatByString(r,a):l1(u)?p.format(r,"year"):c1(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(K_,K({ref:t,toolbarTitle:c,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,isLandscape:o,ownerState:m,className:p0.root},d,{children:v.jsx(q_,{variant:"h4",align:o?"left":"center",ownerState:m,className:p0.title,children:f})}))}),ai=h.createContext(null),y1=n=>{const{onAccept:e,onClear:t,onCancel:r,onSetToday:o,actions:i}=n,s=h.useContext(ai),a=hs(),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(Ts,{onClick:t,children:a.clearButtonLabel},u);case"cancel":return v.jsx(Ts,{onClick:r,children:a.cancelButtonLabel},u);case"accept":return v.jsx(Ts,{onClick:e,children:a.okButtonLabel},u);case"today":return v.jsx(Ts,{onClick:o,children:a.todayButtonLabel},u);default:return null}});return v.jsx(pM,{children:c})},J_=["onClick","onTouchStart"],Z_=Me(ei)(({theme:n})=>({zIndex:n.zIndex.modal})),X_=Me(ka)(({ownerState:n})=>K({transformOrigin:"top center",outline:0},n.placement==="top"&&{transformOrigin:"bottom center"}));function Q_(n,e){return e.documentElement.clientWidth{if(!n)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}},[n]);const s=Os(l=>{if(!i.current)return;const c=r.current;r.current=!1;const u=Iu(o.current);if(!o.current||"clientX"in l&&Q_(l,u))return;if(t.current){t.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(n){const l=Iu(o.current),c=()=>{t.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",c)}}},[n,s]),h.useEffect(()=>{if(n){const l=Iu(o.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[n,s]),[o,a,a]}const t4=n=>{var e;const{anchorEl:t,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=Rk,TrapFocusProps:g,PaperProps:y={},components:b,componentsProps:w}=n;h.useEffect(()=>{function _($){d&&($.key==="Escape"||$.key==="Esc")&&s()}return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[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[T,k,x]=e4(d,i??s),C=h.useRef(null),E=_r(C,o),P=_r(E,T),O=n,{onClick:F,onTouchStart:D}=y,U=tt(y,J_),N=_=>{_.key==="Escape"&&(_.stopPropagation(),s())},z=(e=b==null?void 0:b.ActionBar)!=null?e:y1;return v.jsx(Z_,K({transition:!0,role:f,open:d,anchorEl:t,ownerState:O,onKeyDown:N},p,{children:({TransitionProps:_,placement:$})=>v.jsx(_k,K({open:d,disableAutoFocus:!0,disableEnforceFocus:f==="tooltip",isEnabled:()=>!0},g,{children:v.jsx(m,K({},_,{children:v.jsxs(X_,K({tabIndex:-1,elevation:8,ref:P,onClick:G=>{k(G),F&&F(G)},onTouchStart:G=>{x(G),D&&D(G)},ownerState:K({},O,{placement:$})},U,{children:[r,v.jsx(z,K({onAccept:l,onClear:a,onCancel:c,onSetToday:u,actions:[]},w==null?void 0:w.actionBar))]}))}))}))}))};function b1(n){const{children:e,DateInputProps:t,KeyboardDateInputComponent:r,onClear:o,onDismiss:i,onCancel:s,onAccept:a,onSetToday:l,open:c,PopperProps:u,PaperProps:d,TransitionComponent:p,components:f,componentsProps:m}=n,g=h.useRef(null),y=_r(t.inputRef,g);return v.jsxs(ai.Provider,{value:"desktop",children:[v.jsx(r,K({},t,{inputRef:y})),v.jsx(t4,{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 Ao(n,e){return Array.isArray(e)?e.every(t=>n.indexOf(t)!==-1):n.indexOf(e)!==-1}const x1=(n,e)=>t=>{(t.key==="Enter"||t.key===" ")&&(n(),t.preventDefault(),t.stopPropagation())};function vh({onChange:n,onViewChange:e,openTo:t,view:r,views:o}){var i,s;const[a,l]=Yi({name:"Picker",state:"view",controlled:r,default:t&&Ao(o,t)?t: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";n(m,y&&u?"partial":g),y&&p()},[u,n,p]),nextView:u,previousView:c,openNext:p,openView:a,setOpenView:d}}const es=220,co=36,ua={x:es/2,y:es/2},w1={x:ua.x,y:0},n4=w1.x-ua.x,r4=w1.y-ua.y,o4=n=>n*(180/Math.PI),C1=(n,e,t)=>{const r=e-ua.x,o=t-ua.y,i=Math.atan2(n4,r4)-Math.atan2(r,o);let s=o4(i);s=Math.round(s/n)*n,s%=360;const a=Math.floor(s/n)||0,l=r**2+o**2,c=Math.sqrt(l);return{value:a,distance:c}},i4=(n,e,t=1)=>{const r=t*6;let{value:o}=C1(r,n,e);return o=o*t%60,o},s4=(n,e,t)=>{const{value:r,distance:o}=C1(30,n,e);let i=r||12;return t?i%=12:oK({width:2,backgroundColor:n.palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},e.toAnimateTransform&&{transition:n.transitions.create(["transform","height"])})),c4=Me("div")(({theme:n,ownerState:e})=>K({width:4,height:4,backgroundColor:n.palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${co/2}px)`,border:`${(co-4)/2}px solid ${n.palette.primary.main}`,boxSizing:"content-box"},e.hasSelected&&{backgroundColor:n.palette.primary.main}));class S1 extends h.Component{constructor(...e){super(...e),this.state={toAnimateTransform:!1,previousType:void 0}}render(){const e=this.props,{className:t,isInner:r,type:o,value:i}=e,s=tt(e,a4),a=K({},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)*es),transform:`rotateZ(${u}deg)`}};return v.jsx(l4,K({style:l(),className:t,ownerState:a},s,{children:v.jsx(c4,{ownerState:a})}))}}S1.getDerivedStateFromProps=(n,e)=>n.type!==e.previousType?{toAnimateTransform:!0,previousType:n.type}:{toAnimateTransform:!1,previousType:n.type};const u4=Me("div")(({theme:n})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:n.spacing(2)})),d4=Me("div")({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),p4=Me("div")(({ownerState:n})=>K({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none"},n.disabled?{}:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}})),f4=Me("div")(({theme:n})=>({width:6,height:6,borderRadius:"50%",backgroundColor:n.palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),h4=Me(xo)(({theme:n,ownerState:e})=>K({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,left:8},e.meridiemMode==="am"&&{backgroundColor:n.palette.primary.main,color:n.palette.primary.contrastText,"&:hover":{backgroundColor:n.palette.primary.light}})),m4=Me(xo)(({theme:n,ownerState:e})=>K({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,right:8},e.meridiemMode==="pm"&&{backgroundColor:n.palette.primary.main,color:n.palette.primary.contrastText,"&:hover":{backgroundColor:n.palette.primary.light}}));function g4(n){const{ampm:e,ampmInClock:t,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}=n,b=n,w=_t(),S=h.useContext(ai),T=h.useRef(!1),k=l(m,f),x=!e&&f==="hours"&&(m<1||m>12),C=($,G)=>{g||y||l($,f)||d($,G)},E=($,G)=>{let{offsetX:le,offsetY:Z}=$;if(le===void 0){const J=$.target.getBoundingClientRect();le=$.changedTouches[0].clientX-J.left,Z=$.changedTouches[0].clientY-J.top}const V=f==="seconds"||f==="minutes"?i4(le,Z,u):s4(le,Z,!!e);C(V,G)},P=$=>{T.current=!0,E($,"shallow")},O=$=>{T.current&&(E($,"finish"),T.current=!1)},F=$=>{$.buttons>0&&E($.nativeEvent,"shallow")},D=$=>{T.current&&(T.current=!1),E($.nativeEvent,"finish")},U=h.useMemo(()=>f==="hours"?!0:m%5===0,[f,m]),N=f==="minutes"?u:1,z=h.useRef(null);lf(()=>{r&&z.current.focus()},[r]);const _=$=>{if(!T.current)switch($.key){case"Home":C(0,"partial"),$.preventDefault();break;case"End":C(f==="minutes"?59:23,"partial"),$.preventDefault();break;case"ArrowUp":C(m+N,"partial"),$.preventDefault();break;case"ArrowDown":C(m-N,"partial"),$.preventDefault();break}};return v.jsxs(u4,{children:[v.jsxs(d4,{children:[v.jsx(p4,{onTouchMove:P,onTouchEnd:O,onMouseUp:D,onMouseMove:F,ownerState:{disabled:g}}),!k&&v.jsxs(h.Fragment,{children:[v.jsx(f4,{}),i&&v.jsx(S1,{type:f,value:m,isInner:x,hasSelected:U})]}),v.jsx("div",{"aria-activedescendant":p,"aria-label":s(f,i,w),ref:z,role:"listbox",onKeyDown:_,tabIndex:0,children:o})]}),e&&(S==="desktop"||t)&&v.jsxs(h.Fragment,{children:[v.jsx(h4,{onClick:y?void 0:()=>a("am"),disabled:g||c===null,ownerState:b,children:v.jsx(mo,{variant:"caption",children:"AM"})}),v.jsx(m4,{disabled:g||c===null,onClick:y?void 0:()=>a("pm"),ownerState:b,children:v.jsx(mo,{variant:"caption",children:"PM"})})]})]})}const k1=n=>()=>{},v4=["className","disabled","index","inner","label","selected"],Ql=At("PrivateClockNumber",["selected","disabled"]),y4=Me("span")(({theme:n,ownerState:e})=>K({height:co,width:co,position:"absolute",left:`calc((100% - ${co}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:n.palette.text.primary,fontFamily:n.typography.fontFamily,"&:focused":{backgroundColor:n.palette.background.paper},[`&.${Ql.selected}`]:{color:n.palette.primary.contrastText},[`&.${Ql.disabled}`]:{pointerEvents:"none",color:n.palette.text.disabled}},e.inner&&K({},n.typography.body2,{color:n.palette.text.secondary})));function M1(n){const{className:e,disabled:t,index:r,inner:o,label:i,selected:s}=n,a=tt(n,v4),l=n,c=r%12/12*Math.PI*2-Math.PI/2,u=(es-co-2)/2*(o?.65:1),d=Math.round(Math.cos(c)*u),p=Math.round(Math.sin(c)*u);return v.jsx(y4,K({className:Qt(e,s&&Ql.selected,t&&Ql.disabled),"aria-disabled":t?!0:void 0,"aria-selected":s?!0:void 0,role:"option",style:{transform:`translate(${d}px, ${p+(es-co)/2}px`},ownerState:l},a,{children:i}))}const b4=({ampm:n,date:e,getClockNumberText:t,isDisabled:r,selectedId:o,utils:i})=>{const s=e?i.getHours(e):null,a=[],l=n?1:0,c=n?12:23,u=d=>s===null?!1:n?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=!n&&(d===0||d>12);p=i.formatNumber(p);const m=u(d);a.push(v.jsx(M1,{id:m?o:void 0,index:d,inner:f,selected:m,disabled:r(d),label:p,"aria-label":t(p)},d))}return a},f0=({utils:n,value:e,isDisabled:t,getClockNumberText:r,selectedId:o})=>{const i=n.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(M1,{label:a,id:c?o:void 0,index:l+1,inner:!1,disabled:t(s),selected:c,"aria-label":r(a)},s)})},x4=["children","className","components","componentsProps","isLeftDisabled","isLeftHidden","isRightDisabled","isRightHidden","leftArrowButtonText","onLeftClick","onRightClick","rightArrowButtonText"],ll=At("MuiPickersArrowSwitcher",["root","spacer","button"]),w4=Me("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(n,e)=>e.root})({display:"flex"}),C4=Me("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(n,e)=>e.spacer})(({theme:n})=>({width:n.spacing(3)})),h0=Me(xo,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(n,e)=>e.button})(({ownerState:n})=>K({},n.hidden&&{visibility:"hidden"})),E1=h.forwardRef(function(e,t){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,x4),b=cs().direction==="rtl",w=(s==null?void 0:s.leftArrowButton)||{},S=(i==null?void 0:i.LeftArrowIcon)||F_,T=(s==null?void 0:s.rightArrowButton)||{},k=(i==null?void 0:i.RightArrowIcon)||j_,x=e;return v.jsxs(w4,K({ref:t,className:Qt(ll.root,o),ownerState:x},g,{children:[v.jsx(h0,K({as:i==null?void 0:i.LeftArrowButton,size:"small","aria-label":d,title:d,disabled:a,edge:"end",onClick:p},w,{className:Qt(ll.button,w.className),ownerState:K({},x,w,{hidden:l}),children:b?v.jsx(k,{}):v.jsx(S,{})})),r?v.jsx(mo,{variant:"subtitle1",component:"span",children:r}):v.jsx(C4,{className:ll.spacer,ownerState:x}),v.jsx(h0,K({as:i==null?void 0:i.RightArrowButton,size:"small","aria-label":m,title:m,edge:"start",disabled:c,onClick:f},T,{className:Qt(ll.button,T.className),ownerState:K({},x,T,{hidden:u}),children:b?v.jsx(S,{}):v.jsx(k,{})}))]}))}),S4=(n,e)=>n?e.getHours(n)>=12?"pm":"am":null,cp=(n,e,t)=>t&&(n>=12?"pm":"am")!==e?e==="am"?n-12:n+12:n,k4=(n,e,t,r)=>{const o=cp(r.getHours(n),e,t);return r.setHours(n,o)},m0=(n,e)=>e.getHours(n)*3600+e.getMinutes(n)*60+e.getSeconds(n),T1=(n=!1,e)=>(t,r)=>n?e.isAfter(t,r):m0(t,e)>m0(r,e);function M4(n,{disableFuture:e,maxDate:t}){const r=_t();return h.useMemo(()=>{const o=r.date(),i=r.startOfMonth(e&&r.isBefore(o,t)?o:t);return!r.isAfter(i,n)},[e,t,n,r])}function E4(n,{disablePast:e,minDate:t}){const r=_t();return h.useMemo(()=>{const o=r.date(),i=r.startOfMonth(e&&r.isAfter(o,t)?o:t);return!r.isBefore(i,n)},[e,t,n,r])}function O1(n,e,t){const r=_t(),o=S4(n,r),i=h.useCallback(s=>{const a=n==null?null:k4(n,s,!!e,r);t(a,"partial")},[e,n,t,r]);return{meridiemMode:o,handleMeridiemChange:i}}function T4(n){return kn("MuiClockPicker",n)}At("MuiClockPicker",["root","arrowSwitcher"]);const up=36,yh=2,L1=320,O4=358,bh=Me("div")({overflowX:"hidden",width:L1,maxHeight:O4,display:"flex",flexDirection:"column",margin:"0 auto"}),L4=n=>{const{classes:e}=n;return Mn({root:["root"],arrowSwitcher:["arrowSwitcher"]},T4,e)},A4=Me(bh,{name:"MuiClockPicker",slot:"Root",overridesResolver:(n,e)=>e.root})({display:"flex",flexDirection:"column"}),P4=Me(E1,{name:"MuiClockPicker",slot:"ArrowSwitcher",overridesResolver:(n,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),D4=k1(),R4=h.forwardRef(function(e,t){const r=Ur({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:w=1,rightArrowButtonText:S,shouldDisableTime:T,showViewSwitcher:k,onChange:x,view:C,views:E=["hours","minutes"],openTo:P,onViewChange:O,className:F,disabled:D,readOnly:U}=r;D4({leftArrowButtonText:g,rightArrowButtonText:S,getClockLabelText:d,getHoursClockNumberText:p,getMinutesClockNumberText:f,getSecondsClockNumberText:m});const N=hs(),z=g??N.openPreviousView,_=S??N.openNextView,$=d??N.clockLabelText,G=p??N.hoursClockNumberText,le=f??N.minutesClockNumberText,Z=m??N.secondsClockNumberText,{openView:V,setOpenView:J,nextView:ce,previousView:q,handleChangeAndOpenNext:M}=vh({view:C,views:E,openTo:P,onViewChange:O,onChange:x}),I=$a(),ie=_t(),te=h.useMemo(()=>c||ie.setSeconds(ie.setMinutes(ie.setHours(I,0),0),0),[c,I,ie]),{meridiemMode:Q,handleMeridiemChange:fe}=O1(te,o,M),pe=h.useCallback((R,oe)=>{const ne=T1(u,ie),de=({start:we,end:ve})=>!(b&&ne(b,ve)||y&&ne(we,y)),he=(we,ve=1)=>we%ve!==0?!1:T?!T(we,oe):!0;switch(oe){case"hours":{const we=cp(R,Q,o),ve=ie.setHours(te,we),me=ie.setSeconds(ie.setMinutes(ve,0),0),ue=ie.setSeconds(ie.setMinutes(ve,59),59);return!de({start:me,end:ue})||!he(we)}case"minutes":{const we=ie.setMinutes(te,R),ve=ie.setSeconds(we,0),me=ie.setSeconds(we,59);return!de({start:ve,end:me})||!he(R,w)}case"seconds":{const we=ie.setSeconds(te,R);return!de({start:we,end:we})||!he(R)}default:throw new Error("not supported")}},[o,te,u,y,Q,b,w,T,ie]),ye=af(),Le=h.useMemo(()=>{switch(V){case"hours":{const R=(oe,ne)=>{const de=cp(oe,Q,o);M(ie.setHours(te,de),ne)};return{onChange:R,value:ie.getHours(te),children:b4({date:c,utils:ie,ampm:o,onChange:R,getClockNumberText:G,isDisabled:oe=>D||pe(oe,"hours"),selectedId:ye})}}case"minutes":{const R=ie.getMinutes(te),oe=(ne,de)=>{M(ie.setMinutes(te,ne),de)};return{value:R,onChange:oe,children:f0({utils:ie,value:R,onChange:oe,getClockNumberText:le,isDisabled:ne=>D||pe(ne,"minutes"),selectedId:ye})}}case"seconds":{const R=ie.getSeconds(te),oe=(ne,de)=>{M(ie.setSeconds(te,ne),de)};return{value:R,onChange:oe,children:f0({utils:ie,value:R,onChange:oe,getClockNumberText:Z,isDisabled:ne=>D||pe(ne,"seconds"),selectedId:ye})}}default:throw new Error("You must provide the type for ClockView")}},[V,ie,c,o,G,le,Z,Q,M,te,pe,ye,D]),Oe=r,B=L4(Oe);return v.jsxs(A4,{ref:t,className:Qt(B.root,F),ownerState:Oe,children:[k&&v.jsx(P4,{className:B.arrowSwitcher,leftArrowButtonText:z,rightArrowButtonText:_,components:a,componentsProps:l,onLeftClick:()=>J(q),onRightClick:()=>J(ce),isLeftDisabled:!q,isRightDisabled:!ce,ownerState:Oe}),v.jsx(g4,K({autoFocus:s,date:c,ampmInClock:i,type:V,ampm:o,getClockLabelText:$,minutesStep:w,isTimeDisabled:pe,meridiemMode:Q,handleMeridiemChange:fe,selectedId:ye,disabled:D,readOnly:U},Le))]})}),I4=["disabled","onSelect","selected","value"],dp=At("PrivatePickersMonth",["root","selected"]),$4=Me(mo)(({theme:n})=>K({flex:"1 0 33.33%",display:"flex",alignItems:"center",justifyContent:"center",color:"unset",backgroundColor:"transparent",border:0,outline:0},n.typography.subtitle1,{margin:"8px 0",height:36,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:_l(n.palette.action.active,n.palette.action.hoverOpacity)},"&:disabled":{pointerEvents:"none",color:n.palette.text.secondary},[`&.${dp.selected}`]:{color:n.palette.primary.contrastText,backgroundColor:n.palette.primary.main,"&:focus, &:hover":{backgroundColor:n.palette.primary.dark}}})),N4=n=>{const{disabled:e,onSelect:t,selected:r,value:o}=n,i=tt(n,I4),s=()=>{t(o)};return v.jsx($4,K({component:"button",type:"button",className:Qt(dp.root,r&&dp.selected),tabIndex:e?-1:0,onClick:s,onKeyDown:x1(s),color:r?"primary":void 0,variant:r?"h5":"subtitle1",disabled:e},i))};function B4(n){return kn("MuiMonthPicker",n)}At("MuiMonthPicker",["root"]);const F4=["className","date","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly"],j4=n=>{const{classes:e}=n;return Mn({root:["root"]},B4,e)},_4=Me("div",{name:"MuiMonthPicker",slot:"Root",overridesResolver:(n,e)=>e.root})({width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch",margin:"0 4px"}),z4=h.forwardRef(function(e,t){const r=_t(),o=$a(),i=pu(),s=Ur({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,F4),w=s,S=j4(w),T=l??o,k=r.getMonth(T),x=E=>{const P=r.startOfMonth(d&&r.isAfter(o,f)?o:f),O=r.startOfMonth(u&&r.isBefore(o,p)?o:p);return r.isBefore(E,P)||r.isAfter(E,O)?!0:g?g(E):!1},C=E=>{if(y)return;const P=r.setMonth(T,E);m(P,"finish")};return v.jsx(_4,K({ref:t,className:Qt(S.root,a),ownerState:w},b,{children:r.getMonthArray(T).map(E=>{const P=r.getMonth(E),O=r.format(E,"monthShort");return v.jsx(N4,{value:P,selected:P===k,onSelect:C,disabled:c||x(E),children:O},O)})}))});function A1(n,e,t){const{value:r,onError:o}=n,i=Ia(),s=h.useRef(null),a=e({adapter:i,value:r,props:n});return h.useEffect(()=>{o&&!t(a,s.current)&&o(a,r),s.current=a},[t,o,s,a,r]),a}const P1=({props:n,value:e,adapter:t})=>{const r=t.utils.date(),o=t.utils.date(e),{shouldDisableDate:i,minDate:s=t.defaultDates.minDate,maxDate:a=t.defaultDates.maxDate,disableFuture:l,disablePast:c}=n;if(o===null)return null;switch(!0){case!t.utils.isValid(e):return"invalidDate";case!!(i&&i(o)):return"shouldDisableDate";case!!(l&&t.utils.isAfterDay(o,r)):return"disableFuture";case!!(c&&t.utils.isBeforeDay(o,r)):return"disablePast";case!!(s&&t.utils.isBeforeDay(o,s)):return"minDate";case!!(a&&t.utils.isAfterDay(o,a)):return"maxDate";default:return null}},D1=({shouldDisableDate:n,minDate:e,maxDate:t,disableFuture:r,disablePast:o})=>{const i=Ia();return h.useCallback(s=>P1({adapter:i,value:s,props:{shouldDisableDate:n,minDate:e,maxDate:t,disableFuture:r,disablePast:o}})!==null,[i,n,e,t,r,o])},H4=(n,e)=>n===e,V4=n=>A1(n,P1,H4),U4=(n,e,t)=>(r,o)=>{switch(o.type){case"changeMonth":return K({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!n});case"finishMonthSwitchingAnimation":return K({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&o.focusedDay!=null&&t.isSameDay(o.focusedDay,r.focusedDay))return r;const i=o.focusedDay!=null&&!e&&!t.isSameMonth(r.currentMonth,o.focusedDay);return K({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:i&&!n,currentMonth:i?t.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:o.focusedDay!=null&&t.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},W4=({date:n,defaultCalendarMonth:e,disableFuture:t,disablePast:r,disableSwitchToMonthOnDayFocus:o=!1,maxDate:i,minDate:s,onMonthChange:a,reduceAnimations:l,shouldDisableDate:c})=>{var u;const d=$a(),p=_t(),f=h.useRef(U4(!!l,o,p)).current,[m,g]=h.useReducer(f,{isMonthSwitchingAnimating:!1,focusedDay:n||d,currentMonth:p.startOfMonth((u=n??e)!=null?u:d),slideDirection:"left"}),y=h.useCallback(k=>{g(K({type:"changeMonth"},k)),a&&a(k.newMonth)},[a]),b=h.useCallback(k=>{const x=k??d;p.isSameMonth(x,m.currentMonth)||y({newMonth:p.startOfMonth(x),direction:p.isAfterDay(x,m.currentMonth)?"left":"right"})},[m.currentMonth,y,d,p]),w=D1({shouldDisableDate:c,minDate:s,maxDate:i,disableFuture:t,disablePast:r}),S=h.useCallback(()=>{g({type:"finishMonthSwitchingAnimation"})},[]),T=h.useCallback(k=>{w(k)||g({type:"changeFocusedDay",focusedDay:k})},[w]);return{calendarState:m,changeMonth:b,changeFocusedDay:T,isDateDisabled:w,onMonthSwitchingAnimationEnd:S,handleChangeMonth:y}},G4=At("PrivatePickersFadeTransitionGroup",["root"]),g0=500,K4=Me(Eb)({display:"block",position:"relative"}),R1=({children:n,className:e,reduceAnimations:t,transKey:r})=>t?n:v.jsx(K4,{className:Qt(G4.root,e),children:v.jsx(vb,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:g0,enter:g0/2,exit:0},children:n},r)});function q4(n){return kn("MuiPickersDay",n)}const cl=At("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),Y4=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDayFocus","onDaySelect","onFocus","onKeyDown","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today"],J4=n=>{const{selected:e,disableMargin:t,disableHighlightToday:r,today:o,outsideCurrentMonth:i,showDaysOutsideCurrentMonth:s,classes:a}=n;return Mn({root:["root",e&&"selected",!t&&"dayWithMargin",!r&&o&&"today",i&&s&&"dayOutsideMonth"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},q4,a)},I1=({theme:n,ownerState:e})=>K({},n.typography.caption,{width:up,height:up,borderRadius:"50%",padding:0,backgroundColor:n.palette.background.paper,color:n.palette.text.primary,"&:hover":{backgroundColor:_l(n.palette.action.active,n.palette.action.hoverOpacity)},"&:focus":{backgroundColor:_l(n.palette.action.active,n.palette.action.hoverOpacity),[`&.${cl.selected}`]:{willChange:"background-color",backgroundColor:n.palette.primary.dark}},[`&.${cl.selected}`]:{color:n.palette.primary.contrastText,backgroundColor:n.palette.primary.main,fontWeight:n.typography.fontWeightMedium,transition:n.transitions.create("background-color",{duration:n.transitions.duration.short}),"&:hover":{willChange:"background-color",backgroundColor:n.palette.primary.dark}},[`&.${cl.disabled}`]:{color:n.palette.text.disabled}},!e.disableMargin&&{margin:`0 ${yh}px`},e.outsideCurrentMonth&&e.showDaysOutsideCurrentMonth&&{color:n.palette.text.secondary},!e.disableHighlightToday&&e.today&&{[`&:not(.${cl.selected})`]:{border:`1px solid ${n.palette.text.secondary}`}}),$1=(n,e)=>{const{ownerState:t}=n;return[e.root,!t.disableMargin&&e.dayWithMargin,!t.disableHighlightToday&&t.today&&e.today,!t.outsideCurrentMonth&&t.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,t.outsideCurrentMonth&&!t.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},Z4=Me(Mb,{name:"MuiPickersDay",slot:"Root",overridesResolver:$1})(I1),X4=Me("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:$1})(({theme:n,ownerState:e})=>K({},I1({theme:n,ownerState:e}),{visibility:"hidden"})),Q4=()=>{},e6=h.forwardRef(function(e,t){const r=Ur({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=Q4,onDaySelect:f,onFocus:m,onKeyDown:g,outsideCurrentMonth:y,selected:b=!1,showDaysOutsideCurrentMonth:w=!1,children:S,today:T=!1}=r,k=tt(r,Y4),x=K({},r,{autoFocus:o,disabled:a,disableHighlightToday:l,disableMargin:c,selected:b,showDaysOutsideCurrentMonth:w,today:T}),C=J4(x),E=_t(),P=h.useRef(null),O=_r(P,t);lf(()=>{o&&!a&&!u&&!y&&P.current.focus()},[o,a,u,y]);const F=z=>{p&&p(s),m&&m(z)},D=z=>{a||f(s,"finish"),d&&d(z)},U=cs();function N(z){switch(g!==void 0&&g(z),z.key){case"ArrowUp":p(E.addDays(s,-7)),z.preventDefault();break;case"ArrowDown":p(E.addDays(s,7)),z.preventDefault();break;case"ArrowLeft":p(E.addDays(s,U.direction==="ltr"?-1:1)),z.preventDefault();break;case"ArrowRight":p(E.addDays(s,U.direction==="ltr"?1:-1)),z.preventDefault();break;case"Home":p(E.startOfWeek(s)),z.preventDefault();break;case"End":p(E.endOfWeek(s)),z.preventDefault();break;case"PageUp":p(E.getNextMonth(s)),z.preventDefault();break;case"PageDown":p(E.getPreviousMonth(s)),z.preventDefault();break}}return y&&!w?v.jsx(X4,{className:Qt(C.root,C.hiddenDaySpacingFiller,i),ownerState:x}):v.jsx(Z4,K({className:Qt(C.root,i),ownerState:x,ref:O,centerRipple:!0,disabled:a,"aria-label":S?void 0:E.format(s,"fullDate"),tabIndex:b?0:-1,onFocus:F,onKeyDown:N,onClick:D},k,{children:S||E.format(s,"dayOfMonth")}))}),t6=(n,e)=>n.autoFocus===e.autoFocus&&n.isAnimating===e.isAnimating&&n.today===e.today&&n.disabled===e.disabled&&n.selected===e.selected&&n.disableMargin===e.disableMargin&&n.showDaysOutsideCurrentMonth===e.showDaysOutsideCurrentMonth&&n.disableHighlightToday===e.disableHighlightToday&&n.className===e.className&&n.outsideCurrentMonth===e.outsideCurrentMonth&&n.onDayFocus===e.onDayFocus&&n.onDaySelect===e.onDaySelect,n6=h.memo(e6,t6),r6=["children","className","reduceAnimations","slideDirection","transKey"],nr=At("PrivatePickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),N1=350,o6=Me(Eb)(({theme:n})=>{const e=n.transitions.create("transform",{duration:N1,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},[`& .${nr["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${nr["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${nr.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${nr.slideExit}`]:{transform:"translate(0%)"},[`& .${nr["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${nr["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}}),i6=n=>{let{children:e,className:t,reduceAnimations:r,slideDirection:o,transKey:i}=n,s=tt(n,r6);if(r)return v.jsx("div",{className:Qt(nr.root,t),children:e});const a={exit:nr.slideExit,enterActive:nr.slideEnterActive,enter:nr[`slideEnter-${o}`],exitActive:nr[`slideExitActiveLeft-${o}`]};return v.jsx(o6,{className:Qt(nr.root,t),childFactory:l=>h.cloneElement(l,{classNames:a}),children:v.jsx(yf,K({mountOnEnter:!0,unmountOnExit:!0,timeout:N1,classNames:a},s,{children:e}),i)})},B1=(up+yh*2)*6,s6=Me("div")({display:"flex",justifyContent:"center",alignItems:"center"}),a6=Me(mo)(({theme:n})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:n.palette.text.secondary})),l6=Me("div")({display:"flex",justifyContent:"center",alignItems:"center",minHeight:B1}),c6=Me(i6)({minHeight:B1}),u6=Me("div")({overflow:"hidden"}),d6=Me("div")({margin:`${yh}px 0`,display:"flex",justifyContent:"center"});function p6(n){const e=$a(),t=_t(),{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:w=()=>v.jsx("span",{children:"..."}),showDaysOutsideCurrentMonth:S,slideDirection:T,TransitionProps:k,disablePast:x,disableFuture:C,minDate:E,maxDate:P,shouldDisableDate:O}=n,F=D1({shouldDisableDate:O,minDate:E,maxDate:P,disablePast:x,disableFuture:C}),D=h.useCallback(($,G="finish")=>{g||f($,G)},[f,g]),U=t.getMonth(s),N=a.filter($=>!!$).map($=>t.startOfDay($)),z=U,_=h.useMemo(()=>h.createRef(),[z]);return v.jsxs(h.Fragment,{children:[v.jsx(s6,{children:t.getWeekdays().map(($,G)=>v.jsx(a6,{"aria-hidden":!0,variant:"caption",children:$.charAt(0).toUpperCase()},$+G.toString()))}),p?v.jsx(l6,{children:w()}):v.jsx(c6,K({transKey:z,onExited:m,reduceAnimations:y,slideDirection:T,className:i},k,{nodeRef:_,children:v.jsx(u6,{ref:_,role:"grid",children:t.getWeekArray(s).map($=>v.jsx(d6,{role:"row",children:$.map(G=>{const le={key:G==null?void 0:G.toString(),day:G,isAnimating:d,disabled:l||F(G),autoFocus:r&&u!==null&&t.isSameDay(G,u),today:t.isSameDay(G,e),outsideCurrentMonth:t.getMonth(G)!==U,selected:N.some(Z=>t.isSameDay(Z,G)),disableHighlightToday:c,showDaysOutsideCurrentMonth:S,onDayFocus:o,onDaySelect:D};return b?b(G,N,le):v.jsx("div",{role:"cell",children:v.jsx(n6,K({},le))},le.key)})},`week-${$[0]}`))})}))]})}const f6=Me("div")({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),h6=Me("div")(({theme:n})=>K({display:"flex",maxHeight:30,overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},n.typography.body1,{fontWeight:n.typography.fontWeightMedium})),m6=Me("div")({marginRight:6}),g6=Me(xo)({marginRight:"auto"}),v6=Me(B_)(({theme:n,ownerState:e})=>K({willChange:"transform",transition:n.transitions.create("transform"),transform:"rotate(0deg)"},e.openView==="year"&&{transform:"rotate(180deg)"})),y6=k1();function b6(n){const{components:e={},componentsProps:t={},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}=n;y6({leftArrowButtonText:l,rightArrowButtonText:g,getViewSwitchingButtonText:a});const b=hs(),w=l??b.previousMonth,S=g??b.nextMonth,T=a??b.calendarViewSwitchingButtonAriaLabel,k=_t(),x=t.switchViewButton||{},C=()=>d(k.getNextMonth(r),"left"),E=()=>d(k.getPreviousMonth(r),"right"),P=M4(r,{disableFuture:i,maxDate:c}),O=E4(r,{disablePast:s,minDate:u}),F=()=>{if(!(y.length===1||!p||o))if(y.length===2)p(y.find(U=>U!==f)||y[0]);else{const U=y.indexOf(f)!==0?0:1;p(y[U])}};if(y.length===1&&y[0]==="year")return null;const D=n;return v.jsxs(f6,{ownerState:D,children:[v.jsxs(h6,{role:"presentation",onClick:F,ownerState:D,children:[v.jsx(R1,{reduceAnimations:m,transKey:k.format(r,"monthAndYear"),children:v.jsx(m6,{"aria-live":"polite",ownerState:D,children:k.format(r,"monthAndYear")})}),y.length>1&&!o&&v.jsx(g6,K({size:"small",as:e.SwitchViewButton,"aria-label":T(f)},x,{children:v.jsx(v6,{as:e.SwitchViewIcon,ownerState:D})}))]}),v.jsx(vb,{in:f==="day",children:v.jsx(E1,{leftArrowButtonText:w,rightArrowButtonText:S,components:e,componentsProps:t,onLeftClick:E,onRightClick:C,isLeftDisabled:O,isRightDisabled:P})})]})}function x6(n){return kn("PrivatePickersYear",n)}const v0=At("PrivatePickersYear",["root","modeMobile","modeDesktop","yearButton","disabled","selected"]),w6=n=>{const{wrapperVariant:e,disabled:t,selected:r,classes:o}=n,i={root:["root",e&&`mode${Sa(e)}`],yearButton:["yearButton",t&&"disabled",r&&"selected"]};return Mn(i,x6,o)},C6=Me("div")(({ownerState:n})=>K({flexBasis:"33.3%",display:"flex",alignItems:"center",justifyContent:"center"},(n==null?void 0:n.wrapperVariant)==="desktop"&&{flexBasis:"25%"})),S6=Me("button")(({theme:n})=>K({color:"unset",backgroundColor:"transparent",border:0,outline:0},n.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:_l(n.palette.action.active,n.palette.action.hoverOpacity)},[`&.${v0.disabled}`]:{color:n.palette.text.secondary},[`&.${v0.selected}`]:{color:n.palette.primary.contrastText,backgroundColor:n.palette.primary.main,"&:focus, &:hover":{backgroundColor:n.palette.primary.dark}}})),k6=h.forwardRef(function(e,t){const{autoFocus:r,className:o,children:i,disabled:s,onClick:a,onKeyDown:l,selected:c,value:u}=e,d=h.useRef(null),p=_r(d,t),f=h.useContext(ai),m=K({},e,{wrapperVariant:f}),g=w6(m);return h.useEffect(()=>{r&&d.current.focus()},[r]),v.jsx(C6,{className:Qt(g.root,o),ownerState:m,children:v.jsx(S6,{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 M6(n){return kn("MuiYearPicker",n)}At("MuiYearPicker",["root"]);const E6=n=>{const{classes:e}=n;return Mn({root:["root"]},M6,e)},T6=Me("div",{name:"MuiYearPicker",slot:"Root",overridesResolver:(n,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",margin:"0 4px"}),O6=h.forwardRef(function(e,t){const r=$a(),o=cs(),i=_t(),s=pu(),a=Ur({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:w}=a,S=a,T=E6(S),k=u||r,x=i.getYear(k),C=h.useContext(ai),E=h.useRef(null),[P,O]=h.useState(x),F=h.useCallback(_=>!!(f&&i.isBeforeYear(_,r)||p&&i.isAfterYear(_,r)||g&&i.isBeforeYear(_,g)||m&&i.isAfterYear(_,m)||w&&w(_)),[p,f,m,g,r,w,i]),D=(_,$,G="finish")=>{if(b)return;const le=i.setYear(k,$);y(le,G)},U=h.useCallback(_=>{F(i.setYear(k,_))||O(_)},[k,F,i]),N=C==="desktop"?4:3,z=(_,$)=>{switch(_.key){case"ArrowUp":U($-N),_.preventDefault();break;case"ArrowDown":U($+N),_.preventDefault();break;case"ArrowLeft":U($+(o.direction==="ltr"?-1:1)),_.preventDefault();break;case"ArrowRight":U($+(o.direction==="ltr"?1:-1)),_.preventDefault();break}};return v.jsx(T6,{ref:t,className:Qt(T.root,c),ownerState:S,children:i.getYearRange(g,m).map(_=>{const $=i.getYear(_),G=$===x;return v.jsx(k6,{selected:G,value:$,onClick:D,onKeyDown:z,autoFocus:l&&$===P,ref:G?E:void 0,disabled:d||F(_),children:i.format(_,"year")},i.format(_,"year"))})})}),L6=typeof navigator<"u"&&/(android)/i.test(navigator.userAgent),A6=n=>kn("MuiCalendarPicker",n);At("MuiCalendarPicker",["root","viewTransitionContainer"]);const P6=["autoFocus","onViewChange","date","disableFuture","disablePast","defaultCalendarMonth","loading","onChange","onYearChange","onMonthChange","reduceAnimations","renderLoading","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate"],D6=n=>{const{classes:e}=n;return Mn({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},A6,e)},R6=Me(bh,{name:"MuiCalendarPicker",slot:"Root",overridesResolver:(n,e)=>e.root})({display:"flex",flexDirection:"column"}),I6=Me(R1,{name:"MuiCalendarPicker",slot:"ViewTransitionContainer",overridesResolver:(n,e)=>e.viewTransitionContainer})({overflowY:"auto"}),$6=h.forwardRef(function(e,t){const r=_t(),o=pu(),i=Ur({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=L6,renderLoading:b=()=>v.jsx("span",{children:"..."}),shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:T,view:k,views:x=["year","day"],openTo:C="day",className:E,disabled:P,readOnly:O,minDate:F=o.minDate,maxDate:D=o.maxDate}=i,U=tt(i,P6),{openView:N,setOpenView:z,openNext:_}=vh({view:k,views:x,openTo:C,onChange:f,onViewChange:a}),{calendarState:$,changeFocusedDay:G,changeMonth:le,handleChangeMonth:Z,isDateDisabled:V,onMonthSwitchingAnimationEnd:J}=W4({date:l,defaultCalendarMonth:d,reduceAnimations:y,onMonthChange:g,minDate:F,maxDate:D,shouldDisableDate:w,disablePast:u,disableFuture:c}),ce=h.useCallback((pe,ye)=>{const Le=r.startOfMonth(pe),Oe=r.endOfMonth(pe),B=V(pe)?nd({utils:r,date:pe,minDate:r.isBefore(F,Le)?Le:F,maxDate:r.isAfter(D,Oe)?Oe:D,disablePast:u,disableFuture:c,isDateDisabled:V}):pe;B?(f(B,ye),g==null||g(Le)):(_(),le(Le)),G(B)},[G,c,u,V,D,F,f,g,le,_,r]),q=h.useCallback((pe,ye)=>{const Le=r.startOfYear(pe),Oe=r.endOfYear(pe),B=V(pe)?nd({utils:r,date:pe,minDate:r.isBefore(F,Le)?Le:F,maxDate:r.isAfter(D,Oe)?Oe:D,disablePast:u,disableFuture:c,isDateDisabled:V}):pe;B?(f(B,ye),m==null||m(B)):(_(),le(Le)),G(B)},[G,c,u,V,D,F,f,m,_,r,le]),M=h.useCallback((pe,ye)=>f(l&&pe?r.mergeDateAndTime(pe,l):pe,ye),[r,l,f]);h.useEffect(()=>{if(l&&V(l)){const pe=nd({utils:r,date:l,minDate:F,maxDate:D,disablePast:u,disableFuture:c,isDateDisabled:V});f(pe,"partial")}},[]),h.useEffect(()=>{l&&le(l)},[l]);const I=i,ie=D6(I),te={disablePast:u,disableFuture:c,maxDate:D,minDate:F},Q=P&&l||F,fe=P&&l||D;return v.jsxs(R6,{ref:t,className:Qt(ie.root,E),ownerState:I,children:[v.jsx(b6,K({},U,{views:x,openView:N,currentMonth:$.currentMonth,onViewChange:z,onMonthChange:(pe,ye)=>Z({newMonth:pe,direction:ye}),minDate:Q,maxDate:fe,disabled:P,disablePast:u,disableFuture:c,reduceAnimations:y})),v.jsx(I6,{reduceAnimations:y,className:ie.viewTransitionContainer,transKey:N,ownerState:I,children:v.jsxs("div",{children:[N==="year"&&v.jsx(O6,K({},U,te,{autoFocus:s,date:l,onChange:q,shouldDisableYear:T,disabled:P,readOnly:O})),N==="month"&&v.jsx(z4,K({},te,{className:E,date:l,onChange:ce,disabled:P,readOnly:O,shouldDisableMonth:S})),N==="day"&&v.jsx(p6,K({},U,$,te,{autoFocus:s,onMonthSwitchingAnimationEnd:J,onFocusedDayChange:G,reduceAnimations:y,selectedDays:[l],onSelectedDaysChange:M,loading:p,renderLoading:b,disabled:P,readOnly:O,shouldDisableDate:w}))]})})]})}),N6=n=>{const[,e]=h.useReducer(l=>l+1,0),t=h.useRef(null),{replace:r,append:o}=n,i=r?r(n.format(n.value)):n.format(n.value),s=h.useRef(!1),a=l=>{const c=l.target.value;t.current=[c,l.target,c.length>i.length,s.current,i===n.format(c)],e()};return h.useLayoutEffect(()=>{if(t.current==null)return;let[l,c,u,d,p]=t.current;t.current=null;const f=d&&p,g=l.slice(c.selectionStart).search(n.accept||/\d/g),y=g!==-1?g:0,b=x=>(x.match(n.accept||/\d/g)||[]).join(""),w=b(l.substr(0,c.selectionStart)),S=x=>{let C=0,E=0;for(let P=0;P!==w.length;++P){let O=x.indexOf(w[P],C)+1,F=b(x).indexOf(w[P],E)+1;F-E>1&&(O=C,F=E),E=Math.max(F,E),C=Math.max(C,O)}return C};if(n.mask===!0&&u&&!p){let x=S(l);const C=b(l.substr(x))[0];x=l.indexOf(C,x),l=`${l.substr(0,x)}${l.substr(x+1)}`}let T=n.format(l);o!=null&&c.selectionStart===l.length&&!p&&(u?T=o(T):b(T.slice(-1))===""&&(T=T.slice(0,-1)));const k=r?r(T):T;return i===k?e():n.onChange(k),()=>{let x=S(T);if(n.mask!=null&&(u||d&&!f))for(;T[x]&&b(T[x])==="";)x+=1;c.selectionStart=c.selectionEnd=x+(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:t.current!=null?t.current[0]:i,onChange:a}},pp=(n,e,t)=>{const r=n.date(e);return e===null?"":n.isValid(r)?n.formatByString(r,t):""},ec="_",F1="2019-11-21T22:30:00.000",j1="2019-01-01T09:00:00.000";function B6(n,e,t,r){if(n)return n;const i=r.formatByString(r.date(j1),e).replace(t,ec),s=r.formatByString(r.date(F1),e).replace(t,"_");return i===s?i:""}function F6(n,e,t,r){if(!n)return!1;const i=r.formatByString(r.date(j1),e).replace(t,ec),s=r.formatByString(r.date(F1),e).replace(t,"_"),a=s===i&&n===s;return!a&&r.lib,a}const j6=(n,e)=>t=>{let r=0;return t.split("").map((o,i)=>{if(e.lastIndex=0,r>n.length-1)return"";const s=n[r],a=n[r+1],l=e.test(o)?o:"",c=s===ec?l:s+l;return r+=c.length,i===t.length-1&&a&&a!==ec?c?c+a:"":c}).join("")},_6=({acceptRegex:n=/[\d]/gi,disabled:e,disableMaskedInput:t,ignoreInvalidInputs:r,inputFormat:o,inputProps:i,label:s,mask:a,onChange:l,rawValue:c,readOnly:u,rifmFormatter:d,TextFieldProps:p,validationError:f})=>{const m=_t(),g=m.getFormatHelperText(o),{shouldUseMaskedInput:y,maskToUse:b}=h.useMemo(()=>{if(t)return{shouldUseMaskedInput:!1,maskToUse:""};const D=B6(a,o,n,m);return{shouldUseMaskedInput:F6(D,o,n,m),maskToUse:D}},[n,t,o,a,m]),w=h.useMemo(()=>y&&b?j6(b,n):D=>D,[n,b,y]),S=c===null?null:m.date(c),[T,k]=h.useState(S),[x,C]=h.useState(pp(m,c,o)),E=h.useRef();h.useEffect(()=>{const D=c!==E.current;if(E.current=c,!D)return;const U=c===null?null:m.date(c);if(!(c===null||m.isValid(U))||m.isEqual(T,U))return;const z=pp(m,c,o);k(U),C(z)},[m,c,o,T]);const P=D=>{const U=D===""||D===a?"":D;C(U);const N=U===null?null:m.parse(U,o);r&&!m.isValid(N)||(k(N),l(N,U||void 0))},O=N6({value:x,onChange:P,format:d||w});return K({label:s,disabled:e,error:f,inputProps:K({},y?O:{value:x,onChange:D=>{P(D.currentTarget.value)}},{disabled:e,placeholder:g,readOnly:u,type:y?"tel":"text"},i)},p)},z6=["components","disableOpenPicker","getOpenDialogAriaText","InputAdornmentProps","InputProps","inputRef","openPicker","OpenPickerButtonProps","renderInput"],xh=h.forwardRef(function(e,t){const{components:r={},disableOpenPicker:o,getOpenDialogAriaText:i,InputAdornmentProps:s,InputProps:a,inputRef:l,openPicker:c,OpenPickerButtonProps:u,renderInput:d}=e,p=tt(e,z6),f=hs(),m=i??f.openDatePickerDialogue,g=_t(),y=_6(p),b=(s==null?void 0:s.position)||"end",w=r.OpenPickerIcon||m1;return d(K({ref:t,inputRef:l},y,{InputProps:K({},a,{[`${b}Adornment`]:o?void 0:v.jsx(sa,K({position:b},s,{children:v.jsx(xo,K({edge:b,disabled:p.disabled||p.readOnly,"aria-label":m(p.rawValue,g)},u,{onClick:c,children:v.jsx(w,{})}))}))})}))});function y0(){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 H6=(n,e)=>{const[t,r]=h.useState(y0);return lf(()=>{const i=()=>{r(y0())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),Ao(n,["hours","minutes","seconds"])?!1:(e||t)==="landscape"},V6=["autoFocus","className","parsedValue","DateInputProps","isMobileKeyboardViewOpen","onDateChange","onViewChange","openTo","orientation","showToolbar","toggleMobileKeyboardView","ToolbarComponent","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],U6=Me("div")({padding:"16px 24px"}),W6=Me("div")(({ownerState:n})=>K({display:"flex",flexDirection:"column"},n.isLandscape&&{flexDirection:"row"})),G6={fullWidth:!0},b0=n=>n==="year"||n==="month"||n==="day",x0=n=>n==="hours"||n==="minutes"||n==="seconds";function wh(n){const{autoFocus:e,parsedValue:t,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}=n,y=tt(n,V6),b=H6(g,l),w=h.useContext(ai),S=c??w!=="desktop",T=h.useCallback((P,O)=>{i(P,w,O)},[i,w]),k=h.useCallback(P=>{o&&u(),s&&s(P)},[o,s,u]),{openView:x,setOpenView:C,handleChangeAndOpenNext:E}=vh({view:void 0,views:g,openTo:a,onChange:T,onViewChange:k});return v.jsxs(W6,{ownerState:{isLandscape:b},children:[S&&v.jsx(d,K({},y,{views:g,isLandscape:b,parsedValue:t,onChange:T,setOpenView:C,openView:x,toolbarTitle:m,toolbarFormat:p,toolbarPlaceholder:f,isMobileKeyboardViewOpen:o,toggleMobileKeyboardView:u})),v.jsx(bh,{children:o?v.jsx(U6,{children:v.jsx(xh,K({},r,{ignoreInvalidInputs:!0,disableOpenPicker:!0,TextFieldProps:G6}))}):v.jsxs(h.Fragment,{children:[b0(x)&&v.jsx($6,K({autoFocus:e,date:t,onViewChange:C,onChange:E,view:x,views:g.filter(b0)},y)),x0(x)&&v.jsx(R4,K({},y,{autoFocus:e,date:t,view:x,views:g.filter(x0),onChange:E,onViewChange:C,showViewSwitcher:w==="desktop"}))]})})]})}const K6=({open:n,onOpen:e,onClose:t})=>{const r=h.useRef(typeof n=="boolean").current,[o,i]=h.useState(!1);h.useEffect(()=>{if(r){if(typeof n!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(n)}},[r,n]);const s=h.useCallback(a=>{r||i(a),a&&e&&e(),!a&&t&&t()},[r,e,t]);return{isOpen:o,setIsOpen:s}},Ch=(n,e)=>{const{onAccept:t,onChange:r,value:o,closeOnSelect:i}=n,s=_t(),{isOpen:a,setIsOpen:l}=K6(n),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(x=>{f(C=>{switch(x.action){case"setAll":case"acceptAndClose":return{draft:x.value,committed:x.value,resetFallback:x.value};case"setCommitted":return K({},C,{draft:x.value,committed:x.value});case"setDraft":return K({},C,{draft:x.value});default:return C}}),!x.skipOnChangeCall&&!e.areValuesEqual(s,p.committed,x.value)&&r(x.value),x.action==="acceptAndClose"&&(l(!1),t&&!e.areValuesEqual(s,p.resetFallback,x.value)&&t(x.value))},[t,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),w=h.useMemo(()=>({parsedValue:p.draft,isMobileKeyboardViewOpen:y,toggleMobileKeyboardView:()=>b(!y),onDateChange:(x,C,E="partial")=>{switch(E){case"shallow":return m({action:"setDraft",value:x,skipOnChangeCall:!0});case"partial":return m({action:"setDraft",value:x});case"finish":return m(i??C==="desktop"?{value:x,action:"acceptAndClose"}:{value:x,action:"setCommitted"});default:throw new Error("MUI: Invalid selectionState passed to `onDateChange`")}}}),[m,y,p.draft,i]),S=h.useCallback((x,C)=>{const E=e.valueReducer?e.valueReducer(s,u,x):x;r(E,C)},[r,e,u,s]),T=h.useMemo(()=>({onChange:S,open:a,rawValue:o,openPicker:()=>l(!0)}),[S,a,o,l]),k={pickerProps:w,inputProps:T,wrapperProps:g};return h.useDebugValue(k,()=>({MuiPickerState:{dateState:p,other:k}})),k},q6=["onChange","PopperProps","PaperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps"],Y6=h.forwardRef(function(e,t){const r=v5(e,"MuiDesktopDatePicker"),o=V4(r)!==null,{pickerProps:i,inputProps:s,wrapperProps:a}=Ch(r,y5),{PopperProps:l,PaperProps:c,ToolbarComponent:u=Y_,TransitionComponent:d,components:p,componentsProps:f}=r,m=tt(r,q6),g=K({},s,m,{components:p,componentsProps:f,ref:t,validationError:o});return v.jsx(b1,K({},a,{DateInputProps:g,KeyboardDateInputComponent:xh,PopperProps:l,PaperProps:c,TransitionComponent:d,components:p,componentsProps:f,children:v.jsx(wh,K({},i,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:g,components:p,componentsProps:f},m))}))}),J6={"& .MuiPaper-root":{border:`2px solid ${j.newColors.grey2[100]}`,boxShadow:"0px 1px 5px rgba(26, 26, 26, 0.161)"},"& .MuiPickersDay-today":{color:`${j.newColors.realTeal[100]} !important`,border:"none !important",fontFamily:j.fontFamily,fontWeight:j.fontWeight.bold,backgroundColor:"transparent !important","&:hover":{color:j.newColors.realTeal[100],backgroundColor:`${j.colors.tealOpacity} !important`}},"& .MuiPickersDay-dayWithMargin":{color:j.newColors.almostBlack[100],fontFamily:j.fontFamily,"&:hover":{color:j.newColors.realTeal[100],backgroundColor:j.colors.tealOpacity,fontWeight:j.fontWeight.bold}},"& .MuiIconButton-edgeStart, .MuiIconButton-edgeEnd":{color:j.newColors.grey4[100]},"& .MuiPickersDay-root.Mui-selected":{backgroundColor:`${j.newColors.realTeal[100]} !important`,color:"#FFFF !important",fontWeight:j.fontWeight.bold,"&:hover":{color:"#FFFF !important",backgroundColor:`${j.newColors.realTeal[100]} !important`}},"& .MuiCalendarPicker-root > div:first-of-type":{marginBottom:"16px",paddingLeft:"16px",paddingRight:"16px"}},_1=Y.div` - min-width: 0; - - .MuiOutlinedInput-root { - padding-right: 16px; - - & fieldset { - border-radius: 0; - border: ${({$isPickerOpen:n})=>n?`1px solid ${j.newColors.almostBlack[100]}`:j.borders.simplyGrey}; - } - - ${({$disabled:n})=>n?` - background-color: ${j.colors.disableBackground}; - `:` - background-color: ${j.newColors.grey1[100]}; - &:hover { - & fieldset { - border-color: ${j.newColors.simplyGrey[100]}; - } - } - `} - - &.Mui-disabled fieldset.MuiOutlinedInput-notchedOutline{ - border-color: ${j.colors.disableBorder}; - } - - .MuiOutlinedInput-input { - height: ${j.fieldSpecs.inputText.height}; - padding: ${j.fieldSpecs.inputText.padding}; - } - - &.Mui-focused fieldset { - border-color: ${j.newColors.almostBlack[100]}; - border-width: 1px; - } - } - - .MuiIconButton-root { - color: ${({$isPickerOpen:n})=>n?j.newColors.almostBlack[100]:j.newColors.grey3[100]}; - } -`,Z6=Y(tf)` - width: 100%; -`,X6=n=>{var p,f;const{fieldDef:e,onChange:t,value:r=null,onBlur:o,disabled:i,inputRef:s,id:a}=n,[l,c]=h.useState(!1),u=async()=>{c(!l),l&&o&&o()},d=m=>{var g;return v.jsx(Z6,{...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(s1,{dateAdapter:r1,children:v.jsx(_1,{"data-testid":"date-picker-test-id",$isPickerOpen:l,$disabled:i,children:v.jsx(Y6,{renderInput:d,inputFormat:Vi,value:r,onChange:t,onOpen:u,onClose:u,PopperProps:{sx:J6},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})})})};function z1(n,e){var t;const r=Ur({props:n,name:e}),o=_t(),i=(t=r.ampm)!=null?t:o.is12HourCycleInCurrentLocale(),a=hs().openTimePickerDialogue;return K({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:K({OpenPickerIcon:g1},r.components)})}const H1={emptyValue:null,parseInput:a1,getTodayValue:n=>n.date(),areValuesEqual:(n,e,t)=>n.isEqual(e,t),valueReducer:(n,e,t)=>!e||!n.isValid(t)?t:n.mergeDateAndTime(e,t)},Q6=["className","selected","value"],V1=At("PrivatePickersToolbarText",["selected"]),ez=Me(mo)(({theme:n})=>({transition:n.transitions.create("color"),color:n.palette.text.secondary,[`&.${V1.selected}`]:{color:n.palette.text.primary}})),U1=h.forwardRef(function(e,t){const{className:r,selected:o,value:i}=e,s=tt(e,Q6);return v.jsx(ez,K({ref:t,className:Qt(r,o&&V1.selected),component:"span"},s,{children:i}))}),tz=["align","className","selected","typographyClassName","value","variant"],nz=Me(Ts)({padding:0,minWidth:16,textTransform:"none"}),Ms=h.forwardRef(function(e,t){const{align:r,className:o,selected:i,typographyClassName:s,value:a,variant:l}=e,c=tt(e,tz);return v.jsx(nz,K({variant:"text",ref:t,className:o},c,{children:v.jsx(U1,{align:r,className:s,variant:l,value:a,selected:i})}))});function rz(n){return kn("MuiTimePickerToolbar",n)}const oz=At("MuiTimePickerToolbar",["root","separator","hourMinuteLabel","hourMinuteLabelLandscape","hourMinuteLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),iz=["ampm","ampmInClock","parsedValue","isLandscape","isMobileKeyboardViewOpen","onChange","openView","setOpenView","toggleMobileKeyboardView","toolbarTitle","views","disabled","readOnly"],sz=n=>{const{theme:e,isLandscape:t,classes:r}=n,o={root:["root"],separator:["separator"],hourMinuteLabel:["hourMinuteLabel",t&&"hourMinuteLabelLandscape",e.direction==="rtl"&&"hourMinuteLabelReverse"],ampmSelection:["ampmSelection",t&&"ampmLandscape"],ampmLabel:["ampmLabel"]};return Mn(o,rz,r)},az=Me(v1,{name:"MuiTimePickerToolbar",slot:"Root",overridesResolver:(n,e)=>e.root})({[`& .${Gi.penIconButtonLandscape}`]:{marginTop:"auto"}}),lz=Me(U1,{name:"MuiTimePickerToolbar",slot:"Separator",overridesResolver:(n,e)=>e.separator})({outline:0,margin:"0 4px 0 2px",cursor:"default"}),cz=Me("div",{name:"MuiTimePickerToolbar",slot:"HourMinuteLabel",overridesResolver:(n,e)=>e.hourMinuteLabel})(({theme:n,ownerState:e})=>K({display:"flex",justifyContent:"flex-end",alignItems:"flex-end"},e.isLandscape&&{marginTop:"auto"},n.direction==="rtl"&&{flexDirection:"row-reverse"})),uz=Me("div",{name:"MuiTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(n,e)=>e.ampmSelection})(({ownerState:n})=>K({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12},n.isLandscape&&{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",flexBasis:"100%"},{[`& .${oz.ampmLabel}`]:{fontSize:17}})),W1=n=>{const{ampm:e,ampmInClock:t,parsedValue:r,isLandscape:o,isMobileKeyboardViewOpen:i,onChange:s,openView:a,setOpenView:l,toggleMobileKeyboardView:c,toolbarTitle:u="Select time",views:d,disabled:p,readOnly:f}=n,m=tt(n,iz),g=_t(),y=cs(),b=!!(e&&!t),{meridiemMode:w,handleMeridiemChange:S}=O1(r,e,s),T=E=>e?g.format(E,"hours12h"):g.format(E,"hours24h"),k=n,x=sz(K({},k,{theme:y})),C=v.jsx(lz,{tabIndex:-1,value:":",variant:"h3",selected:!1,className:x.separator});return v.jsxs(az,K({viewType:"clock",landscapeDirection:"row",toolbarTitle:u,isLandscape:o,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:c,ownerState:k,className:x.root},m,{children:[v.jsxs(cz,{className:x.hourMinuteLabel,ownerState:k,children:[Ao(d,"hours")&&v.jsx(Ms,{tabIndex:-1,variant:"h3",onClick:()=>l("hours"),selected:a==="hours",value:r?T(r):"--"}),Ao(d,["hours","minutes"])&&C,Ao(d,"minutes")&&v.jsx(Ms,{tabIndex:-1,variant:"h3",onClick:()=>l("minutes"),selected:a==="minutes",value:r?g.format(r,"minutes"):"--"}),Ao(d,["minutes","seconds"])&&C,Ao(d,"seconds")&&v.jsx(Ms,{variant:"h3",onClick:()=>l("seconds"),selected:a==="seconds",value:r?g.format(r,"seconds"):"--"})]}),b&&v.jsxs(uz,{className:x.ampmSelection,ownerState:k,children:[v.jsx(Ms,{disableRipple:!0,variant:"subtitle2",selected:w==="am",typographyClassName:x.ampmLabel,value:g.getMeridiemText("am"),onClick:f?void 0:()=>S("am"),disabled:p}),v.jsx(Ms,{disableRipple:!0,variant:"subtitle2",selected:w==="pm",typographyClassName:x.ampmLabel,value:g.getMeridiemText("pm"),onClick:f?void 0:()=>S("pm"),disabled:p})]})]}))},dz=({adapter:n,value:e,props:t})=>{const{minTime:r,maxTime:o,minutesStep:i,shouldDisableTime:s,disableIgnoringDatePartForTimeValidation:a}=t,l=n.utils.date(e),c=T1(a,n.utils);if(e===null)return null;switch(!0){case!n.utils.isValid(e):return"invalidDate";case!!(r&&c(r,l)):return"minTime";case!!(o&&c(l,o)):return"maxTime";case!!(s&&s(n.utils.getHours(l),"hours")):return"shouldDisableTime-hours";case!!(s&&s(n.utils.getMinutes(l),"minutes")):return"shouldDisableTime-minutes";case!!(s&&s(n.utils.getSeconds(l),"seconds")):return"shouldDisableTime-seconds";case!!(i&&n.utils.getMinutes(l)%i!==0):return"minutesStep";default:return null}},pz=(n,e)=>n===e,G1=n=>A1(n,dz,pz),fz=["onChange","PaperProps","PopperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps"],hz=h.forwardRef(function(e,t){const r=z1(e,"MuiDesktopTimePicker"),o=G1(r)!==null,{pickerProps:i,inputProps:s,wrapperProps:a}=Ch(r,H1),{PaperProps:l,PopperProps:c,ToolbarComponent:u=W1,TransitionComponent:d,components:p,componentsProps:f}=r,m=tt(r,fz),g=K({},s,m,{components:p,componentsProps:f,ref:t,validationError:o});return v.jsx(b1,K({},a,{DateInputProps:g,KeyboardDateInputComponent:xh,PopperProps:c,PaperProps:l,TransitionComponent:d,components:p,componentsProps:f,children:v.jsx(wh,K({},i,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:g,components:p,componentsProps:f},m))}))}),mz=Me(fM)({[`& .${qm.container}`]:{outline:0},[`& .${qm.paper}`]:{outline:0,minWidth:L1}}),gz=Me(hM)({"&:first-of-type":{padding:0}}),vz=n=>{var e;const{children:t,DialogProps:r={},onAccept:o,onClear:i,onDismiss:s,onCancel:a,onSetToday:l,open:c,components:u,componentsProps:d}=n,p=(e=u==null?void 0:u.ActionBar)!=null?e:y1;return v.jsxs(mz,K({open:c,onClose:s},r,{children:[v.jsx(gz,{children:t}),v.jsx(p,K({onAccept:o,onClear:i,onCancel:a,onSetToday:l,actions:["cancel","accept"]},d==null?void 0:d.actionBar))]}))},yz=["children","DateInputProps","DialogProps","onAccept","onClear","onDismiss","onCancel","onSetToday","open","PureDateInputComponent","components","componentsProps"];function bz(n){const{children:e,DateInputProps:t,DialogProps:r,onAccept:o,onClear:i,onDismiss:s,onCancel:a,onSetToday:l,open:c,PureDateInputComponent:u,components:d,componentsProps:p}=n,f=tt(n,yz);return v.jsxs(ai.Provider,{value:"mobile",children:[v.jsx(u,K({components:d},f,t)),v.jsx(vz,{DialogProps:r,onAccept:o,onClear:i,onDismiss:s,onCancel:a,onSetToday:l,open:c,components:d,componentsProps:p,children:e})]})}const xz=h.forwardRef(function(e,t){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=hs(),g=o??m.openDatePickerDialogue,y=_t(),b=h.useMemo(()=>K({},s,{readOnly:!0}),[s]),w=pp(y,u,i);return d(K({label:l,disabled:r,ref:t,inputRef:a,error:f,InputProps:b,inputProps:K({disabled:r,readOnly:!0,"aria-readonly":!0,"aria-label":g(u,y),value:w},!e.readOnly&&{onClick:c},{onKeyDown:x1(c)})},p))}),wz=["ToolbarComponent","value","onChange","components","componentsProps"],Cz=h.forwardRef(function(e,t){const r=z1(e,"MuiMobileTimePicker"),o=G1(r)!==null,{pickerProps:i,inputProps:s,wrapperProps:a}=Ch(r,H1),{ToolbarComponent:l=W1,components:c,componentsProps:u}=r,d=tt(r,wz),p=K({},s,d,{components:c,componentsProps:u,ref:t,validationError:o});return v.jsx(bz,K({},d,a,{DateInputProps:p,PureDateInputComponent:xz,components:c,componentsProps:u,children:v.jsx(wh,K({},i,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:l,DateInputProps:p,components:c,componentsProps:u},d))}))}),Sz=["desktopModeMediaQuery","DialogProps","PopperProps","TransitionComponent"],kz=h.forwardRef(function(e,t){const r=Ur({props:e,name:"MuiTimePicker"}),{desktopModeMediaQuery:o="@media (pointer: fine)",DialogProps:i,PopperProps:s,TransitionComponent:a}=r,l=tt(r,Sz);return gM(o)?v.jsx(hz,K({ref:t,PopperProps:s,TransitionComponent:a},l)):v.jsx(Cz,K({ref:t,DialogProps:i},l))}),Mz=Ak({palette:{primary:{main:j.newColors.realTeal[100]}}}),K1=n=>{const{fieldDef:e,onChange:t,value:r=null,onBlur:o,disabled:i,inputRef:s,id:a}=n,[l,c]=h.useState(!1),u=h.useCallback(async()=>{c(p=>(p&&o&&o(),!p))},[o]),d=p=>{var f;return v.jsx(tf,{...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(s1,{dateAdapter:r1,children:v.jsx(VM,{theme:Mz,children:v.jsx(_1,{$isPickerOpen:l,$disabled:i,children:v.jsx(kz,{value:r,onChange:t,renderInput:d,onOpen:u,onClose:u,disabled:i})})})})},w0=Y.div` - display: flex; - flex-direction: column; -`,q1=Y.div` - ${({$hasTimeField:n})=>n&&` - display: grid; - grid-template-columns: repeat(1,minmax(0,1fr)); - gap: 24px 12px; - - ${Nt("sm","FORM_COL")} { - grid-template-columns: repeat(2,minmax(0,1fr)); - } - `} -`;function Ez({showTime:n}){return v.jsxs(q1,{$hasTimeField:n,children:[v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}),n&&v.jsx(Xe,{variant:"rectangular",width:"100%",height:43})]})}const Tz=n=>{const{fieldDef:e,onChange:t,value:r,onBlur:o,disabled:i,error:s,methods:a,inputRef:l,skeleton:c,id:u}=n,{inputSettings:{showTime:d,minDate:p,maxDate:f,defaultTime:m}={}}=e,g=h.useRef({date:!1,time:!1}),y=h.useRef(!1),b=h.useMemo(()=>r||{validDate:!1,validTime:!1},[r]),{addError:w,removeError:S}=Xx({methods:a,name:e.name}),T=C=>async()=>{g.current[C]=!0,g.current.date&&(!d||g.current.time)&&o()},k=async(C,E)=>{const P=op(E,Vi),O=C&&!E;if(d&&C&&!b.validTime?w(hi):S(hi),O||E&&P){S(Zu);const F={...b,date:C,validDate:!0};if(!b.validTime&&m){S([Ui,hi]);const D=rp(new Date,QF(m));F.time=D,F.validTime=!0,y.current=!0}t(F,{validate:!0})}else{E&&!P?w(Zu):S(Zu);const F={...b,date:C,validDate:!1};y.current&&(F.time=void 0,F.validTime=!1),t(F,{validate:!0})}},x=async(C,E)=>{const P=E!==void 0,O=op(E,kb);b.date&&!C?(S(Ui),w(hi),t({...b,time:C,validTime:!1},{validate:!0})):P&&!O?(S(hi),w(Ui),t({...b,time:C,validTime:!1},{validate:!0})):(y.current=!1,S([hi,Ui]),t({...b,time:C,validTime:!!C},{validate:!0}))};return c?v.jsx(Ez,{showTime:d}):v.jsxs(q1,{$hasTimeField:d,children:[v.jsx(w0,{children:v.jsx(X6,{id:u,error:s,onChange:k,fieldDef:{name:e==null?void 0:e.name,label:"",type:"",inputSettings:{placeholder:Sb,minDate:p,maxDate:f},required:e==null?void 0:e.required},value:b==null?void 0:b.date,onBlur:T("date"),disabled:i,inputRef:l})}),d&&v.jsx(w0,{children:v.jsx(K1,{id:`${e==null?void 0:e.name}-time`,error:s,onChange:x,fieldDef:{name:e==null?void 0:e.name,label:"",type:"timePicker",inputSettings:{placeholder:ff}},value:b==null?void 0:b.time,onBlur:T("time"),disabled:i})})]})},Oz=h.memo(Tz),Lz=Y(y_)` +`;function lT(){return v.jsxs(aT,{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 cT=n=>{var w,S;const{fieldDef:e,error:t,onChange:r,onBlur:o,value:i,disabled:s,skeleton:a}=n,{required:l}=e||null,[c,u]=h.useState([]),[d,p]=h.useState(!1),[f,m]=h.useState(void 0);h.useEffect(()=>{(async()=>{var k,x;if((k=e==null?void 0:e.inputSettings)!=null&&k.options)u(e.inputSettings.options),m(!0);else if((x=e==null?void 0:e.inputSettings)!=null&&x.getOptions){const C=await e.inputSettings.getOptions();u(C),m(!1)}p(!1)})()},[(w=e==null?void 0:e.inputSettings)==null?void 0:w.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(T=>T.value===i.value)?g(i):u([...c,{...i,selected:!0}])),p(!0))},[i,d,c,f]);const g=T=>{let k=[...c];k=k.map(C=>(C==null?void 0:C.value)===(T==null?void 0:T.value)?{...C,selected:l&&C.selected?C.selected:!C.selected}:{...C,selected:!1});const x=k.find(C=>C.selected===!0);return u(k),x},y=T=>{const k=g(T);p(!0),r(k?{label:k.label,value:k.value}:void 0)},b=typeof t=="string"?(t==null?void 0:t.trim().length)>0:!1;return a?v.jsx(lT,{}):v.jsx(sT,{$error:b||b&&l,onBlur:o,role:"listbox",children:c.map(T=>v.jsx(jd,{label:T.label,disabled:s,selected:T.selected,onClick:()=>y(T),role:"option"},T.value))})},uT=h.memo(cT);function Qm(n){return typeof n.normalize<"u"?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n}function dT(n={}){const{ignoreAccents:e=!0,ignoreCase:t=!0,limit:r,matchFrom:o="any",stringify:i,trim:s=!1}=n;return(a,{inputValue:l,getOptionLabel:c})=>{let u=s?l.trim():l;t&&(u=u.toLowerCase()),e&&(u=Qm(u));const d=u?a.filter(p=>{let f=(i||c)(p);return t&&(f=f.toLowerCase()),e&&(f=Qm(f)),o==="start"?f.indexOf(u)===0:f.indexOf(u)>-1}):a;return typeof r=="number"?d.slice(0,r):d}}function Za(n,e){for(let t=0;t{var e;return n.current!==null&&((e=n.current.parentElement)==null?void 0:e.contains(document.activeElement))};function hT(n){const{unstable_isActiveElementInListbox:e=fT,unstable_classNamePrefix:t="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:i=!1,blurOnSelect:s=!1,clearOnBlur:a=!n.freeSolo,clearOnEscape:l=!1,componentName:c="useAutocomplete",defaultValue:u=n.multiple?[]:null,disableClearable:d=!1,disableCloseOnSelect:p=!1,disabled:f,disabledItemsFocusable:m=!1,disableListWrap:g=!1,filterOptions:y=pT,filterSelectedOptions:b=!1,freeSolo:w=!1,getOptionDisabled:S,getOptionKey:T,getOptionLabel:k=re=>{var X;return(X=re.label)!=null?X:re},groupBy:x,handleHomeEndKeys:C=!n.freeSolo,id:E,includeInputInList:P=!1,inputValue:O,isOptionEqualToValue:F=(re,X)=>re===X,multiple:D=!1,onChange:U,onClose:N,onHighlightChange:z,onInputChange:_,onOpen:$,open:G,openOnFocus:le=!1,options:Z,readOnly:V=!1,selectOnFocus:J=!n.freeSolo,value:ce}=n,q=af(E);let M=k;M=re=>{const X=k(re);return typeof X!="string"?String(X):X};const I=h.useRef(!1),ie=h.useRef(!0),te=h.useRef(null),Q=h.useRef(null),[fe,pe]=h.useState(null),[ye,Le]=h.useState(-1),Oe=o?0:-1,B=h.useRef(Oe),[R,oe]=Yi({controlled:ce,default:u,name:c}),[ne,de]=Yi({controlled:O,default:"",name:c,state:"inputValue"}),[he,we]=h.useState(!1),ve=h.useCallback((re,X)=>{if(!(D?R.length!(b&&(D?R:[R]).some(X=>X!==null&&F(re,X)))),{inputValue:Ae&&_e?"":ne,getOptionLabel:M}):[],it=$M({filteredOptions:Pe,value:R,inputValue:ne});h.useEffect(()=>{const re=R!==it.value;he&&!re||w&&!re||ve(null,R)},[R,ve,he,it.value,w]);const zt=me&&Pe.length>0&&!V,Pt=Os(re=>{re===-1?te.current.focus():fe.querySelector(`[data-tag-index="${re}"]`).focus()});h.useEffect(()=>{D&&ye>R.length-1&&(Le(-1),Pt(-1))},[R,D,ye,Pt]);function Wt(re,X){if(!Q.current||re<0||re>=Pe.length)return-1;let ke=re;for(;;){const be=Q.current.querySelector(`[data-option-index="${ke}"]`),ze=m?!1:!be||be.disabled||be.getAttribute("aria-disabled")==="true";if(be&&be.hasAttribute("tabindex")&&!ze)return ke;if(X==="next"?ke=(ke+1)%Pe.length:ke=(ke-1+Pe.length)%Pe.length,ke===re)return-1}}const Ht=Os(({event:re,index:X,reason:ke="auto"})=>{if(B.current=X,X===-1?te.current.removeAttribute("aria-activedescendant"):te.current.setAttribute("aria-activedescendant",`${q}-option-${X}`),z&&z(re,X===-1?null:Pe[X],ke),!Q.current)return;const be=Q.current.querySelector(`[role="option"].${t}-focused`);be&&(be.classList.remove(`${t}-focused`),be.classList.remove(`${t}-focusVisible`));let ze=Q.current;if(Q.current.getAttribute("role")!=="listbox"&&(ze=Q.current.parentElement.querySelector('[role="listbox"]')),!ze)return;if(X===-1){ze.scrollTop=0;return}const et=Q.current.querySelector(`[data-option-index="${X}"]`);if(et&&(et.classList.add(`${t}-focused`),ke==="keyboard"&&et.classList.add(`${t}-focusVisible`),ze.scrollHeight>ze.clientHeight&&ke!=="mouse"&&ke!=="touch")){const L=et,W=ze.clientHeight+ze.scrollTop,ae=L.offsetTop+L.offsetHeight;ae>W?ze.scrollTop=ae-ze.clientHeight:L.offsetTop-L.offsetHeight*(x?1.3:0){if(!He)return;const et=Wt((()=>{const L=Pe.length-1;if(X==="reset")return Oe;if(X==="start")return 0;if(X==="end")return L;const W=B.current+X;return W<0?W===-1&&P?-1:g&&B.current!==-1||Math.abs(X)>1?0:L:W>L?W===L+1&&P?-1:g||Math.abs(X)>1?L:0:W})(),ke);if(Ht({index:et,reason:be,event:re}),r&&X!=="reset")if(et===-1)te.current.value=ne;else{const L=M(Pe[et]);te.current.value=L,L.toLowerCase().indexOf(ne.toLowerCase())===0&&ne.length>0&&te.current.setSelectionRange(ne.length,L.length)}}),lt=()=>{const re=(X,ke)=>{const be=X?M(X):"",ze=ke?M(ke):"";return be===ze};if(B.current!==-1&&it.filteredOptions&&it.filteredOptions.length!==Pe.length&&it.inputValue===ne&&(D?R.length===it.value.length&&it.value.every((X,ke)=>M(R[ke])===M(X)):re(it.value,R))){const X=it.filteredOptions[B.current];if(X)return Za(Pe,ke=>M(ke)===M(X))}return-1},yn=h.useCallback(()=>{if(!He)return;const re=lt();if(re!==-1){B.current=re;return}const X=D?R[0]:R;if(Pe.length===0||X==null){Gt({diff:"reset"});return}if(Q.current){if(X!=null){const ke=Pe[B.current];if(D&&ke&&Za(R,ze=>F(ke,ze))!==-1)return;const be=Za(Pe,ze=>F(ze,X));be===-1?Gt({diff:"reset"}):Ht({index:be});return}if(B.current>=Pe.length-1){Ht({index:Pe.length-1});return}Ht({index:B.current})}},[Pe.length,D?!1:R,b,Gt,Ht,He,ne,D]),Dn=Os(re=>{Hk(Q,re),re&&yn()});h.useEffect(()=>{yn()},[yn]);const $t=re=>{me||(ue(!0),Ee(!0),$&&$(re))},cn=(re,X)=>{me&&(ue(!1),N&&N(re,X))},Kt=(re,X,ke,be)=>{if(D){if(R.length===X.length&&R.every((ze,et)=>ze===X[et]))return}else if(R===X)return;U&&U(re,X,ke,be),oe(X)},En=h.useRef(!1),Rn=(re,X,ke="selectOption",be="options")=>{let ze=ke,et=X;if(D){et=Array.isArray(R)?R.slice():[];const L=Za(et,W=>F(X,W));L===-1?et.push(X):be!=="freeSolo"&&(et.splice(L,1),ze="removeOption")}ve(re,et),Kt(re,et,ze,{option:X}),!p&&(!re||!re.ctrlKey&&!re.metaKey)&&cn(re,ze),(s===!0||s==="touch"&&En.current||s==="mouse"&&!En.current)&&te.current.blur()};function Gn(re,X){if(re===-1)return-1;let ke=re;for(;;){if(X==="next"&&ke===R.length||X==="previous"&&ke===-1)return-1;const be=fe.querySelector(`[data-tag-index="${ke}"]`);if(!be||!be.hasAttribute("tabindex")||be.disabled||be.getAttribute("aria-disabled")==="true")ke+=X==="next"?1:-1;else return ke}}const un=(re,X)=>{if(!D)return;ne===""&&cn(re,"toggleInput");let ke=ye;ye===-1?ne===""&&X==="previous"&&(ke=R.length-1):(ke+=X==="next"?1:-1,ke<0&&(ke=0),ke===R.length&&(ke=-1)),ke=Gn(ke,X),Le(ke),Pt(ke)},dn=re=>{I.current=!0,de(""),_&&_(re,"","clear"),Kt(re,D?[]:null,"clear")},Lr=re=>X=>{if(re.onKeyDown&&re.onKeyDown(X),!X.defaultMuiPrevented&&(ye!==-1&&["ArrowLeft","ArrowRight"].indexOf(X.key)===-1&&(Le(-1),Pt(-1)),X.which!==229))switch(X.key){case"Home":He&&C&&(X.preventDefault(),Gt({diff:"start",direction:"next",reason:"keyboard",event:X}));break;case"End":He&&C&&(X.preventDefault(),Gt({diff:"end",direction:"previous",reason:"keyboard",event:X}));break;case"PageUp":X.preventDefault(),Gt({diff:-eg,direction:"previous",reason:"keyboard",event:X}),$t(X);break;case"PageDown":X.preventDefault(),Gt({diff:eg,direction:"next",reason:"keyboard",event:X}),$t(X);break;case"ArrowDown":X.preventDefault(),Gt({diff:1,direction:"next",reason:"keyboard",event:X}),$t(X);break;case"ArrowUp":X.preventDefault(),Gt({diff:-1,direction:"previous",reason:"keyboard",event:X}),$t(X);break;case"ArrowLeft":un(X,"previous");break;case"ArrowRight":un(X,"next");break;case"Enter":if(B.current!==-1&&He){const ke=Pe[B.current],be=S?S(ke):!1;if(X.preventDefault(),be)return;Rn(X,ke,"selectOption"),r&&te.current.setSelectionRange(te.current.value.length,te.current.value.length)}else w&&ne!==""&&Ae===!1&&(D&&X.preventDefault(),Rn(X,ne,"createOption","freeSolo"));break;case"Escape":He?(X.preventDefault(),X.stopPropagation(),cn(X,"escape")):l&&(ne!==""||D&&R.length>0)&&(X.preventDefault(),X.stopPropagation(),dn(X));break;case"Backspace":if(D&&!V&&ne===""&&R.length>0){const ke=ye===-1?R.length-1:ye,be=R.slice();be.splice(ke,1),Kt(X,be,"removeOption",{option:R[ke]})}break;case"Delete":if(D&&!V&&ne===""&&R.length>0&&ye!==-1){const ke=ye,be=R.slice();be.splice(ke,1),Kt(X,be,"removeOption",{option:R[ke]})}break}},Kn=re=>{we(!0),le&&!I.current&&$t(re)},qn=re=>{if(e(Q)){te.current.focus();return}we(!1),ie.current=!0,I.current=!1,i&&B.current!==-1&&He?Rn(re,Pe[B.current],"blur"):i&&w&&ne!==""?Rn(re,ne,"blur","freeSolo"):a&&ve(re,R),cn(re,"blur")},Dt=re=>{const X=re.target.value;ne!==X&&(de(X),Ee(!1),_&&_(re,X,"input")),X===""?!d&&!D&&Kt(re,null,"clear"):$t(re)},yt=re=>{const X=Number(re.currentTarget.getAttribute("data-option-index"));B.current!==X&&Ht({event:re,index:X,reason:"mouse"})},qt=re=>{Ht({event:re,index:Number(re.currentTarget.getAttribute("data-option-index")),reason:"touch"}),En.current=!0},In=re=>{const X=Number(re.currentTarget.getAttribute("data-option-index"));Rn(re,Pe[X],"selectOption"),En.current=!1},Yn=re=>X=>{const ke=R.slice();ke.splice(re,1),Kt(X,ke,"removeOption",{option:R[re]})},Ar=re=>{me?cn(re,"toggleInput"):$t(re)},Pr=re=>{re.currentTarget.contains(re.target)&&re.target.getAttribute("id")!==q&&re.preventDefault()},Jt=re=>{re.currentTarget.contains(re.target)&&(te.current.focus(),J&&ie.current&&te.current.selectionEnd-te.current.selectionStart===0&&te.current.select(),ie.current=!1)},Jn=re=>{!f&&(ne===""||!me)&&Ar(re)};let $n=w&&ne.length>0;$n=$n||(D?R.length>0:R!==null);let Nn=Pe;return x&&(Nn=Pe.reduce((re,X,ke)=>{const be=x(X);return re.length>0&&re[re.length-1].group===be?re[re.length-1].options.push(X):re.push({key:ke,index:ke,group:be,options:[X]}),re},[])),f&&he&&qn(),{getRootProps:(re={})=>K({"aria-owns":zt?`${q}-listbox`:null},re,{onKeyDown:Lr(re),onMouseDown:Pr,onClick:Jt}),getInputLabelProps:()=>({id:`${q}-label`,htmlFor:q}),getInputProps:()=>({id:q,value:ne,onBlur:qn,onFocus:Kn,onChange:Dt,onMouseDown:Jn,"aria-activedescendant":He?"":null,"aria-autocomplete":r?"both":"list","aria-controls":zt?`${q}-listbox`:void 0,"aria-expanded":zt,autoComplete:"off",ref:te,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:f}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:dn}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Ar}),getTagProps:({index:re})=>K({key:re,"data-tag-index":re,tabIndex:-1},!V&&{onDelete:Yn(re)}),getListboxProps:()=>({role:"listbox",id:`${q}-listbox`,"aria-labelledby":`${q}-label`,ref:Dn,onMouseDown:re=>{re.preventDefault()}}),getOptionProps:({index:re,option:X})=>{var ke;const be=(D?R:[R]).some(et=>et!=null&&F(X,et)),ze=S?S(X):!1;return{key:(ke=T==null?void 0:T(X))!=null?ke:M(X),tabIndex:-1,role:"option",id:`${q}-option-${re}`,onMouseMove:yt,onClick:In,onTouchStart:qt,"data-option-index":re,"aria-disabled":ze,"aria-selected":be}},id:q,inputValue:ne,value:R,dirty:$n,expanded:He&&fe,popupOpen:He,focused:he||ye!==-1,anchorEl:fe,setAnchorEl:pe,focusedTag:ye,groupedOptions:Nn}}function mT(n){return kn("MuiListSubheader",n)}At("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const gT=["className","color","component","disableGutters","disableSticky","inset"],vT=n=>{const{classes:e,color:t,disableGutters:r,inset:o,disableSticky:i}=n,s={root:["root",t!=="default"&&`color${Sa(t)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]};return Mn(s,mT,e)},yT=Me("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,t.color!=="default"&&e[`color${Sa(t.color)}`],!t.disableGutters&&e.gutters,t.inset&&e.inset,!t.disableSticky&&e.sticky]}})(({theme:n,ownerState:e})=>K({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(n.vars||n).palette.text.secondary,fontFamily:n.typography.fontFamily,fontWeight:n.typography.fontWeightMedium,fontSize:n.typography.pxToRem(14)},e.color==="primary"&&{color:(n.vars||n).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:(n.vars||n).palette.background.paper})),_b=h.forwardRef(function(e,t){const r=Qo({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,gT),d=K({},r,{color:i,component:s,disableGutters:a,disableSticky:l,inset:c}),p=vT(d);return v.jsx(yT,K({as:s,className:_n(p.root,o),ref:t,ownerState:d},u))});_b.muiSkipListHighlight=!0;const bT=Vr(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 xT(n){return kn("MuiAutocomplete",n)}const Ke=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 tg,ng;const wT=["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"],CT=["ref"],ST=["key"],kT=["key"],MT=n=>{const{classes:e,disablePortal:t,expanded:r,focused:o,fullWidth:i,hasClearIcon:s,hasPopupIcon:a,inputFocused:l,popupOpen:c,size:u}=n,d={root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",s&&"hasClearIcon",a&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${Sa(u)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",c&&"popupIndicatorOpen"],popper:["popper",t&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Mn(d,xT,e)},ET=Me("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:s,size:a}=t;return[{[`& .${Ke.tag}`]:e.tag},{[`& .${Ke.tag}`]:e[`tagSize${Sa(a)}`]},{[`& .${Ke.inputRoot}`]:e.inputRoot},{[`& .${Ke.input}`]:e.input},{[`& .${Ke.input}`]:s&&e.inputFocused},e.root,r&&e.fullWidth,i&&e.hasPopupIcon,o&&e.hasClearIcon]}})({[`&.${Ke.focused} .${Ke.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${Ke.clearIndicator}`]:{visibility:"visible"}},[`& .${Ke.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${Ke.inputRoot}`]:{[`.${Ke.hasPopupIcon}&, .${Ke.hasClearIcon}&`]:{paddingRight:30},[`.${Ke.hasPopupIcon}.${Ke.hasClearIcon}&`]:{paddingRight:56},[`& .${Ke.input}`]:{width:0,minWidth:30}},[`& .${Du.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Du.root}.${Mo.sizeSmall}`]:{[`& .${Du.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Vm.root}`]:{padding:9,[`.${Ke.hasPopupIcon}&, .${Ke.hasClearIcon}&`]:{paddingRight:39},[`.${Ke.hasPopupIcon}.${Ke.hasClearIcon}&`]:{paddingRight:65},[`& .${Ke.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${Ke.endAdornment}`]:{right:9}},[`& .${Vm.root}.${Mo.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${Ke.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${pi.root}`]:{paddingTop:19,paddingLeft:8,[`.${Ke.hasPopupIcon}&, .${Ke.hasClearIcon}&`]:{paddingRight:39},[`.${Ke.hasPopupIcon}.${Ke.hasClearIcon}&`]:{paddingRight:65},[`& .${pi.input}`]:{padding:"7px 4px"},[`& .${Ke.endAdornment}`]:{right:9}},[`& .${pi.root}.${Mo.sizeSmall}`]:{paddingBottom:1,[`& .${pi.input}`]:{padding:"2.5px 4px"}},[`& .${Mo.hiddenLabel}`]:{paddingTop:8},[`& .${pi.root}.${Mo.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${Ke.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${pi.root}.${Mo.hiddenLabel}.${Mo.sizeSmall}`]:{[`& .${Ke.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${Ke.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${Ke.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${Ke.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${Ke.inputRoot}`]:{flexWrap:"wrap"}}}]}),TT=Me("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(n,e)=>e.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),OT=Me(xo,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(n,e)=>e.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),LT=Me(xo,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:n},e)=>K({},e.popupIndicator,n.popupOpen&&e.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),AT=Me(ei,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[{[`& .${Ke.option}`]:e.option},e.popper,t.disablePortal&&e.popperDisablePortal]}})(({theme:n})=>({zIndex:(n.vars||n).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),PT=Me(ka,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(n,e)=>e.paper})(({theme:n})=>K({},n.typography.body1,{overflow:"auto"})),DT=Me("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(n,e)=>e.loading})(({theme:n})=>({color:(n.vars||n).palette.text.secondary,padding:"14px 16px"})),RT=Me("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(n,e)=>e.noOptions})(({theme:n})=>({color:(n.vars||n).palette.text.secondary,padding:"14px 16px"})),IT=Me("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(n,e)=>e.listbox})(({theme:n})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${Ke.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,[n.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${Ke.focused}`]:{backgroundColor:(n.vars||n).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(n.vars||n).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${Ke.focusVisible}`]:{backgroundColor:(n.vars||n).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:n.vars?`rgba(${n.vars.palette.primary.mainChannel} / ${n.vars.palette.action.selectedOpacity})`:Ru(n.palette.primary.main,n.palette.action.selectedOpacity),[`&.${Ke.focused}`]:{backgroundColor:n.vars?`rgba(${n.vars.palette.primary.mainChannel} / calc(${n.vars.palette.action.selectedOpacity} + ${n.vars.palette.action.hoverOpacity}))`:Ru(n.palette.primary.main,n.palette.action.selectedOpacity+n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(n.vars||n).palette.action.selected}},[`&.${Ke.focusVisible}`]:{backgroundColor:n.vars?`rgba(${n.vars.palette.primary.mainChannel} / calc(${n.vars.palette.action.selectedOpacity} + ${n.vars.palette.action.focusOpacity}))`:Ru(n.palette.primary.main,n.palette.action.selectedOpacity+n.palette.action.focusOpacity)}}}})),$T=Me(_b,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(n,e)=>e.groupLabel})(({theme:n})=>({backgroundColor:(n.vars||n).palette.background.paper,top:-8})),NT=Me("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(n,e)=>e.groupUl})({padding:0,[`& .${Ke.option}`]:{paddingLeft:24}}),BT=h.forwardRef(function(e,t){var r,o,i,s;const a=Qo({props:e,name:"MuiAutocomplete"}),{autoComplete:l=!1,autoHighlight:c=!1,autoSelect:u=!1,blurOnSelect:d=!1,ChipProps:p,className:f,clearIcon:m=tg||(tg=v.jsx(bT,{fontSize:"small"})),clearOnBlur:g=!a.freeSolo,clearOnEscape:y=!1,clearText:b="Clear",closeText:w="Close",componentsProps:S={},defaultValue:T=a.multiple?[]:null,disableClearable:k=!1,disableCloseOnSelect:x=!1,disabled:C=!1,disabledItemsFocusable:E=!1,disableListWrap:P=!1,disablePortal:O=!1,filterSelectedOptions:F=!1,forcePopupIcon:D="auto",freeSolo:U=!1,fullWidth:N=!1,getLimitTagsText:z=be=>`+${be}`,getOptionLabel:_,groupBy:$,handleHomeEndKeys:G=!a.freeSolo,includeInputInList:le=!1,limitTags:Z=-1,ListboxComponent:V="ul",ListboxProps:J,loading:ce=!1,loadingText:q="Loading…",multiple:M=!1,noOptionsText:I="No options",openOnFocus:ie=!1,openText:te="Open",PaperComponent:Q=ka,PopperComponent:fe=ei,popupIcon:pe=ng||(ng=v.jsx(ak,{})),readOnly:ye=!1,renderGroup:Le,renderInput:Oe,renderOption:B,renderTags:R,selectOnFocus:oe=!a.freeSolo,size:ne="medium",slotProps:de={}}=a,he=tt(a,wT),{getRootProps:we,getInputProps:ve,getInputLabelProps:me,getPopupIndicatorProps:ue,getClearProps:_e,getTagProps:Ee,getListboxProps:Ae,getOptionProps:He,value:Pe,dirty:it,expanded:zt,id:Pt,popupOpen:Wt,focused:Ht,focusedTag:Gt,anchorEl:lt,setAnchorEl:yn,inputValue:Dn,groupedOptions:$t}=hT(K({},a,{componentName:"Autocomplete"})),cn=!k&&!C&&it&&!ye,Kt=(!U||D===!0)&&D!==!1,{onMouseDown:En}=ve(),{ref:Rn}=J??{},Gn=Ae(),{ref:un}=Gn,dn=tt(Gn,CT),Lr=_r(un,Rn),qn=_||(be=>{var ze;return(ze=be.label)!=null?ze:be}),Dt=K({},a,{disablePortal:O,expanded:zt,focused:Ht,fullWidth:N,getOptionLabel:qn,hasClearIcon:cn,hasPopupIcon:Kt,inputFocused:Gt===-1,popupOpen:Wt,size:ne}),yt=MT(Dt);let qt;if(M&&Pe.length>0){const be=ze=>K({className:yt.tag,disabled:C},Ee(ze));R?qt=R(Pe,be,Dt):qt=Pe.map((ze,et)=>{const L=be({index:et}),{key:W}=L,ae=tt(L,ST);return v.jsx(Pk,K({label:qn(ze),size:ne},ae,p),W)})}if(Z>-1&&Array.isArray(qt)){const be=qt.length-Z;!Ht&&be>0&&(qt=qt.splice(0,Z),qt.push(v.jsx("span",{className:yt.tag,children:z(be)},qt.length)))}const Yn=Le||(be=>v.jsxs("li",{children:[v.jsx($T,{className:yt.groupLabel,ownerState:Dt,component:"div",children:be.group}),v.jsx(NT,{className:yt.groupUl,ownerState:Dt,children:be.children})]},be.key)),Pr=B||((be,ze)=>{const{key:et}=be,L=tt(be,kT);return v.jsx("li",K({},L,{children:qn(ze)}),et)}),Jt=(be,ze)=>{const et=He({option:be,index:ze});return Pr(K({},et,{className:yt.option}),be,{selected:et["aria-selected"],index:ze,inputValue:Dn},Dt)},Jn=(r=de.clearIndicator)!=null?r:S.clearIndicator,$n=(o=de.paper)!=null?o:S.paper,Nn=(i=de.popper)!=null?i:S.popper,re=(s=de.popupIndicator)!=null?s:S.popupIndicator,X=be=>v.jsx(AT,K({as:fe,disablePortal:O,style:{width:lt?lt.clientWidth:null},ownerState:Dt,role:"presentation",anchorEl:lt,open:Wt},Nn,{className:_n(yt.popper,Nn==null?void 0:Nn.className),children:v.jsx(PT,K({ownerState:Dt,as:Q},$n,{className:_n(yt.paper,$n==null?void 0:$n.className),children:be}))}));let ke=null;return $t.length>0?ke=X(v.jsx(IT,K({as:V,className:yt.listbox,ownerState:Dt},dn,J,{ref:Lr,children:$t.map((be,ze)=>$?Yn({key:be.key,group:be.group,children:be.options.map((et,L)=>Jt(et,be.index+L))}):Jt(be,ze))}))):ce&&$t.length===0?ke=X(v.jsx(DT,{className:yt.loading,ownerState:Dt,children:q})):$t.length===0&&!U&&!ce&&(ke=X(v.jsx(RT,{className:yt.noOptions,ownerState:Dt,role:"presentation",onMouseDown:be=>{be.preventDefault()},children:I}))),v.jsxs(h.Fragment,{children:[v.jsx(ET,K({ref:t,className:_n(yt.root,f),ownerState:Dt},we(he),{children:Oe({id:Pt,disabled:C,fullWidth:!0,size:ne==="small"?"small":void 0,InputLabelProps:me(),InputProps:K({ref:yn,className:yt.inputRoot,startAdornment:qt,onClick:be=>{be.target===be.currentTarget&&En(be)}},(cn||Kt)&&{endAdornment:v.jsxs(TT,{className:yt.endAdornment,ownerState:Dt,children:[cn?v.jsx(OT,K({},_e(),{"aria-label":b,title:b,ownerState:Dt},Jn,{className:_n(yt.clearIndicator,Jn==null?void 0:Jn.className),children:m})):null,Kt?v.jsx(LT,K({},ue(),{disabled:C,"aria-label":Wt?w:te,title:Wt?w:te,ownerState:Dt},re,{className:_n(yt.popupIndicator,re==null?void 0:re.className),children:pe})):null]})}),inputProps:K({className:yt.input,disabled:C,readOnly:ye},ve())})})),lt?ke:null]})}),FT=Y(BT)` & .MuiFormControl-root .MuiInputBase-root { font-family: ${j.fontFamily}; color: ${j.newColors.almostBlack[100]}; @@ -571,7 +204,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho border-left: ${n=>n.open?"":j.borders.fieldGray}; } } -`,Az=Y.div` +`,jT=Y.div` margin: 0; padding: 0; @@ -583,7 +216,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho .MuiAutocomplete-paper { width: ${({$innerWidth:n})=>n===wt.xs?wt.sm:n} } -`,Pz=Y(ei)` +`,_T=Y(ei)` z-index: 999999999 !important; .MuiAutocomplete-listbox .MuiAutocomplete-option { font-family: ${j.fontFamily}; @@ -602,7 +235,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho background-color: ${j.newColors.grey2[100]}; } } -`,Dz=Y.div` +`,zT=Y.div` display: flex; flex-direction: row; align-items: flex-start; @@ -624,166 +257,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho & .MuiOutlinedInput-input { height: ${j.fieldSpecs.inputText.height}; } -`,Rz=({children:n})=>v.jsx(Dz,{children:n}),Iz=n=>{var k,x;const{fieldDef:e,error:t,onChange:r,onBlur:o,value:i,disabled:s,inputRef:a,id:l,skeleton:c}=n,[u,d]=h.useState(!1),[p,f]=h.useState([]),[m,g]=h.useState(void 0);h.useEffect(()=>{(async()=>{var E,P;if((E=e==null?void 0:e.inputSettings)!=null&&E.options)f(e.inputSettings.options),g(!0);else if((P=e==null?void 0:e.inputSettings)!=null&&P.getOptions){const O=await e.inputSettings.getOptions();f(O),g(!1)}})()},[(k=e==null?void 0:e.inputSettings)==null?void 0:k.options,(x=e==null?void 0:e.inputSettings)==null?void 0:x.getOptions]),h.useEffect(()=>{i&&m===!1&&(p.find(C=>(C==null?void 0:C.value)===(i==null?void 0:i.value))||f([...p,i]))},[p,i,m]);const y=C=>{var E;return v.jsx(Rz,{children:v.jsx(tf,{...C,"data-testid":"textfield-test-id",variant:"outlined",placeholder:(E=e==null?void 0:e.inputSettings)==null?void 0:E.placeholder,required:e==null?void 0:e.required,inputProps:{...C.inputProps,ref:P=>{a&&(a.current=P),C.inputProps.ref.current=P},id:l}})})},b=()=>{d(!u)},w=async C=>{r&&await r(C||void 0)},S=(C,E)=>(E==null?void 0:E.value)===""?!0:C.value===(E==null?void 0:E.value),T=C=>v.jsx(Pz,{$value:(i==null?void 0:i.value)==="",...C});return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(Az,{"data-testid":"dropdown-single-selection-test-id",$innerWidth:e==null?void 0:e.size,children:v.jsx(Lz,{value:i||null,onOpen:b,onClose:b,"data-testid":"autocomplete-test-id",options:p,getOptionLabel:C=>C.label,getOptionKey:C=>C.value,isOptionEqualToValue:S,onChange:(C,E)=>w(E),$error:e!=null&&e.required&&t?!!t:void 0,renderInput:y,PopperComponent:T,popupIcon:v.jsx(cf,{}),onBlur:C=>o&&o(C.target.value),open:u,disabled:s})})},$z=h.memo(Iz),Nz=Y.div` - color: ${j.newColors.grey3[100]}; - font-family: ${j.fontFamily}; - font-size: 14px; - margin-top: 4px; - - @media (max-width: ${j.breakpoints.mobile}) { - width: calc(100vw - 40px); - }; -`,Bz=Y.div` - border: 2px solid ${j.newColors.grey2[100]}; - border-radius: 4px; - font-family: ${j.fontFamily}; - min-height: 204px; - padding: 16px; - padding-bottom: 16px; - position: relative; - width: 450px; - max-width: 100%; - background-color: white; -`,Fz=Y.div` - display: flex; - justify-content: end; - - button:first-child { - padding-right: 16px; - } - - button:last-child { - padding-left: 16px; - } -`,jz=Y.div` - display: flex; - flex-wrap: wrap; -`,_z=Y.div` - display: flex; - flex-direction: column; - margin-bottom: 16px; -`,zz=Y.div` - margin-right: 16px; - margin-bottom: 16px; - height: fit-content; - border: 2px solid ${j.newColors.grey2[100]}; - - img { - display: block; - width: 230px; - max-width: 100%; - } -`,C0=Y.span` - color: ${j.newColors.grey3[100]}; - font-size: 14px; - font-weight: ${j.fontWeight.semiBold}; - margin-bottom: 8px; -`,Y1=Y.span` - color: ${j.newColors.almostBlack[100]}; - font-size: 14px; - font-weight: ${j.fontWeight.normal}; -`,Hz=Y(Y1)` - margin-bottom: 12px; -`,Vz=Y.div` - @media (max-width: ${j.breakpoints.mobile}) { - width: calc(100vw - 40px); - }; -`,Uz=Y.div` - display: flex; - flex-grow: 1; - align-items: end; -`,Wz=({value:n,initialCenter:e,onDragMarkerEnd:t,zoom:r=7,focusZoom:o=11,shouldPanRef:i})=>{const s=Nb(),a=h.useRef(null);if(h.useEffect(()=>{(async()=>{const l=Qi(n)?n:void 0,c=await lO(s),{lat:u,lng:d}=l?n:Qi(e)?e:Df,p=new google.maps.LatLng(u,d),f=l&&s.getZoom(){const{initialCenter:e,value:t,zoom:r=0,focusZoom:o=11,onCoordinatesChange:i,googleMapsApiKey:s,onBlur:a}=n,[l,c]=h.useState(""),u=Qi(e)?e:Df,d=async b=>{c(b);try{const w=await Sf(b),S=await Ib(w[0]);i(S)}catch(w){console.error("Could not change coordinates: ",{error:w,value:b})}},p=()=>{c("")},f=h.useRef(!0),m=({latLng:b})=>{f.current=!1;const w=b.lat(),S=b.lng();i({lat:w,lng:S})};h.useEffect(()=>{(t===void 0||t.lat===void 0&&t.lng===void 0)&&p()},[t]);const{isLoaded:g,loadError:y}=Mf({googleMapsApiKey:s,libraries:ex});return v.jsxs(Vz,{children:[v.jsx(tx,{className:"mapCoordinates",value:l,onChange:c,onBlur:a,onSelect:d,placeholder:"Type a location, address or city…",googleMapsApiKey:s,textField:{InputProps:{endAdornment:v.jsx(sa,{position:"end",children:v.jsx(dO,{"data-testid":"location-search-clear-icon",onClick:p})})}}}),g&&!y&&v.jsx(VE,{mapContainerStyle:Gz,center:u,zoom:t?o:r,onClick:m,options:Kz,children:v.jsx(Wz,{value:t,initialCenter:e,onDragMarkerEnd:m,zoom:r,focusZoom:o,shouldPanRef:f})})]})},Yz=h.memo(qz);function Jz({zoom:n,focusZoom:e,initialCenter:t,onCoordinatesChange:r,value:o,googleMapsApiKey:i,onBlur:s}){return v.jsxs("div",{children:[v.jsx(Yz,{initialCenter:t,value:o,zoom:n,focusZoom:e,onCoordinatesChange:r,googleMapsApiKey:i,onBlur:s}),v.jsx(Nz,{children:"Click on the map to update the latitude and longitude coordinates"})]})}function Zz({show:n,onClick:e}){return n&&v.jsx(Uz,{children:v.jsx(ln,{className:"reset-button",color:"teal",variant:"text",label:"Reset",onClick:e,size:"large"})})}const Xz=[{fields:[[["placesList"]],[["lat"],["lng"],["resetButton"]]]}],Qz=n=>{var E,P;const{value:e,fieldDef:t,onChange:r,handleClose:o,dialogOpen:i,handleDialogClose:s,handleUnsavedChanges:a,initialCenter:l=Df,googleMapsApiKey:c}=n,u=h.useCallback(async()=>{const O=e?e.lat:void 0,F=e?e.lng:void 0;return{lat:O,lng:F,placesList:{lat:O,lng:F}}},[e]),d=Lu(),{state:p,methods:{setFieldValue:f,setFormValues:m},handleSubmit:g}=d,y=h.useMemo(()=>Qi(e)?e:void 0,[e]),b=h.useMemo(()=>{const O={lat:Number(p.data.lat),lng:Number(p.data.lng)};return Qi(O)?O:void 0},[p.data.lat,p.data.lng]);h.useEffect(()=>{if(!p.data.lat)return;const O=String(p.data.lat),F=O.split(",");F.length!==2||!cO(O)||m({values:{lat:F[0].trim(),lng:F[1].trim()}})},[p.data.lat,p.data.lng,m]),h.useEffect(()=>{const O=p.data.lat!==void 0||p.data.lng!==void 0;O!==p.data.resetButton&&f({name:"resetButton",value:O})},[f,p.data.lat,p.data.lng,p.data.reset,p.data.resetButton]),h.useEffect(()=>{if(!b){f({name:"placesList",value:void 0});return}Yg(p.data.placesList,b)||f({name:"placesList",value:{lat:b.lat,lng:b.lng}})},[p.data.placesList,b]),h.useEffect(()=>{const O=Yg(y,b);a(!O)},[y,b,a]);const w=g(()=>{const O={...e,...b};r(O),o(!0)}),S=h.useCallback(O=>{const F=O?O.lat:void 0,D=O?O.lng:void 0;m({values:{placesList:{lat:F,lng:D},lat:String(F),lng:String(D)},validate:!0})},[m]),T=(E=t==null?void 0:t.inputSettings)==null?void 0:E.zoom,k=(P=t==null?void 0:t.inputSettings)==null?void 0:P.focusZoom,x=h.useMemo(()=>[{name:"placesList",type:({value:O,onBlur:F})=>v.jsx(Jz,{zoom:T,focusZoom:k,initialCenter:l,onCoordinatesChange:S,value:O,onBlur:F,googleMapsApiKey:c})},{name:"lat",label:"Latitude",type:"text",validators:[Af],required:!0},{name:"lng",label:"Longitude",type:"text",validators:[Pf],required:!0},{name:"resetButton",label:"Reset",type:({value:O})=>v.jsx(Zz,{show:O,onClick:()=>m({values:{lat:void 0,lng:void 0,placesList:void 0}})})}],[T,k,l,S,c,m]),C=h.useMemo(()=>[{label:"Cancel",onClick:()=>o(),color:"gray",variant:"outlined"},{label:"Save",onClick:w,type:"submit",color:"yellow",variant:"contained"}],[o,w]);return v.jsx(mf,{className:"mapCoordinates",children:v.jsx(Ou,{...d,onBack:o,backLabel:"Cancel coordinates entry",title:"Map Coordinates",buttons:C,sections:Xz,fields:x,dialogOpen:i,handleDialogClose:s,getFormValues:u})})},eH=n=>{var x,C,E;const{value:e,onBlur:t,onChange:r,disabled:o,fieldDef:i,skeleton:s}=n,a=h.useMemo(()=>Qi(e)?e:void 0,[e]),l=(x=i==null?void 0:i.inputSettings)==null?void 0:x.initialCenter,[c,u]=h.useState(!1),[d,p]=h.useState(!1),[f,m]=h.useState(!1),[g,y]=h.useState(!1),b=()=>{u(!0)},w=async(P=!1)=>{typeof P=="boolean"&&P?(p(!1),u(!1),t&&await t()):d?m(!0):(p(!1),u(!1),t&&await t())},S=async P=>{P&&await w(!0),m(!1)},T=async()=>{r&&await r(void 0),await t()},k=h.useMemo(()=>[{label:"No, keep it",onClick:()=>y(!1),color:"gray",variant:"outlined"},{label:"Yes, remove it",onClick:()=>{T(),y(!1)},color:"yellow",variant:"contained"}],[g]);return s?v.jsx(Xe,{variant:"rectangular",width:280,height:357}):v.jsxs(v.Fragment,{children:[a?v.jsx("div",{children:v.jsxs(Bz,{children:[v.jsxs(jz,{children:[v.jsx(zz,{children:v.jsx("img",{src:`https://maps.googleapis.com/maps/api/staticmap?zoom=${((C=i==null?void 0:i.inputSettings)==null?void 0:C.focusZoom)??11}&size=232x153&maptype=roadmap&markers=color:red%7C${a==null?void 0:a.lat},${a==null?void 0:a.lng}&key=${i.inputSettings.googleMapsApiKey}`,alt:"location"})}),v.jsxs(_z,{children:[v.jsx(C0,{children:"Latitude"}),a?v.jsx(Hz,{children:a==null?void 0:a.lat}):v.jsx(Hd,{}),v.jsx(C0,{children:"Longitude"}),a?v.jsx(Y1,{children:a==null?void 0:a.lng}):v.jsx(Hd,{})]})]}),v.jsxs(Fz,{children:[v.jsx(ln,{color:"teal",variant:"text",label:"Edit",disabled:o,onClick:b}),v.jsx(ln,{color:"red",disabled:o,variant:"text",label:"Remove",onClick:()=>y(!0)})]})]})}):v.jsx(ln,{disabled:o,onClick:b,color:"gray",variant:"outlined",label:"ADD COORDINATES"}),v.jsx(df,{open:c,onClose:w,children:v.jsx(Qz,{value:e,fieldDef:i,onChange:r,handleClose:w,handleUnsavedChanges:P=>p(P),dialogOpen:f,handleDialogClose:S,initialCenter:l,googleMapsApiKey:(E=i==null?void 0:i.inputSettings)==null?void 0:E.googleMapsApiKey})}),v.jsx(hf,{buttons:k,dialogTitle:"Are you sure you want to remove these coordinates?",open:g,children:"All data for these coordinates will be lost. This action is irreversible."})]})},tH=h.memo(eH),nH=Y.div` - & > div > .viewContainer { - padding-left: 0; - padding-right: 0; - } -`,rH=Y.div` - margin-bottom: 0.5rem; -`,oH=Y.div` - display: flex; - flex-direction: column; - gap: 16px; -`,iH=Y(Xe)` - margin-bottom: 16px; -`,J1=Y.div` - display: flex; - align-items: center; - gap: 16px; -`,sH=Y.div` - flex: 1 1 0%; -`,aH=Y.div` - flex: 0 0 32px; -`;function lH(){return v.jsx(Xe,{variant:"rectangular",width:143,height:36,sx:{marginBottom:2}})}function S0(){return v.jsx(aH,{children:v.jsx(Xe,{variant:"rectangular",width:"100%",height:32})})}function rd(){return v.jsx(sH,{children:v.jsx(Xe,{variant:"rectangular",width:"100%",height:48})})}function k0(){return v.jsxs(J1,{children:[v.jsx(S0,{}),v.jsx(S0,{}),v.jsx(rd,{}),v.jsx(rd,{}),v.jsx(rd,{})]})}function cH({buttonCount:n=0}){return v.jsxs("div",{children:[v.jsx(J1,{children:[...Array(n)].map((e,t)=>v.jsx(lH,{},t))}),v.jsx(iH,{variant:"rectangular",width:"100%",height:56}),v.jsxs(oH,{children:[v.jsx(k0,{}),v.jsx(k0,{})]})]})}const uH=n=>{const{value:e,disabled:t,fieldDef:r,skeleton:o}=n,{buttons:i=[],dataView:s}=r.inputSettings,a=(s.data!==void 0?s.data:e)||[],l=a.length>0;return o?v.jsx(cH,{buttonCount:i.length}):v.jsxs(nH,{children:[v.jsx(rH,{children:v.jsx(Ca,{children:i.map((c,u)=>v.jsx(ln,{...c,disabled:c.disabled===void 0?t:c.disabled},`${c.label}-${u}`))})}),l&&v.jsx(iM,{data:[],...s,disabled:t,data:a})]})},dH=h.memo(uH),pH=Y.table` - border-collapse: collapse; - color: ${j.newColors.almostBlack[100]}; - background-color: white; - width: 100%; -`,od=Y.th` - padding: 24px 16px; - font-weight: ${j.fontWeight.medium}; - font-size: 14px; - text-align: left; -`,fH=Y.tr` - background-color: ${j.newColors.grey2[100]}; - - th:first-child { - padding-left: 24px; - } - - th:last-child { - padding-right: 24px; - } -`,fp=Y.td` - padding: 16px 16px; - - &:first-child { - padding-left: 24px; - } - - &:last-child { - padding-right: 24px; - } -`,M0=Y(fp)` - font-weight: ${j.fontWeight.semiBold}; - font-size: 14px; -`,hH=Y.p` - margin: 0; - font-weight: ${j.fontWeight.semiBold}; - font-size: 14px; -`,mH=Y.p` - margin: 8px 0 0 0; - font-weight: 400; - font-size: 14px; -`,E0=Y.td` - padding-left: 16px; - font-weight: ${j.fontWeight.normal}; - font-size: 14px; -`,gH=Y.tbody` - tr { - border-bottom: 1px solid ${j.newColors.grey2[100]}; - } - - tr:last-child, - tr:nth-last-child(2) { - border: none; - } -`,vH=Y.tr` - background-color: ${j.newColors.grey1[100]}; - - .totals-row { - font-weight: ${j.fontWeight.medium}; - } -`,tX=[{name:"2023_02_10",title:"Shoulder Before"},{name:"2023_02_11",title:"Day 1",subtitle:"Thu, Jan 05 2023"},{name:"2023_02_12",title:"Day 2",subtitle:"Fri, Jan 06 2023"},{name:"2023_02_13",title:"Day 3",subtitle:"Sat, Jan 07 2023"}],nX=[{name:"single",title:"Single"},{name:"double",title:"Double"},{name:"queen",title:"Queen"},{name:"king",title:"King"},{name:"suite",title:"Suite"},{name:"any",title:"Any"}],rX={"2023_02_10":{single:"12",double:"13",queen:"14",king:"15",suite:"16",any:"17"},"2023_02_11":{single:"18",double:"19",queen:"20",king:"21",suite:"22",any:"23"},"2023_02_12":{single:"12",double:"13",queen:"14",king:"15",suite:"16",any:"20"},"2023_02_13":{single:"1",double:"1",queen:"1",king:"1",suite:"1",any:"1"}},T0=(n,e)=>e.map(t=>t.name).includes(n),yH=Y.div` - display: flex; - align-items: center; -`,hp=Y.div` - flex: 1 1 0%; - padding: 16px; -`;function gi(){return v.jsx(hp,{children:v.jsx(Xe,{variant:"rectangular",width:"100%",height:43})})}function O0(){return v.jsxs(yH,{children:[v.jsxs(hp,{children:[v.jsx(Xe,{width:80,height:28}),v.jsx(Xe,{width:64,height:28})]}),v.jsx(gi,{}),v.jsx(gi,{}),v.jsx(gi,{}),v.jsx(gi,{}),v.jsx(gi,{}),v.jsx(gi,{}),v.jsx(hp,{children:v.jsx(Xe,{width:78,height:28})})]})}function bH(){return v.jsxs("div",{children:[v.jsx(Xe,{variant:"rectangular",width:"100%",height:64}),v.jsx(O0,{}),v.jsx(O0,{})]})}const xH=n=>{const{fieldDef:e,onChange:t,value:r,disabled:o,inputRef:i,skeleton:s}=n,{inputSettings:a}=e,{displaySumColumn:l=!0,displaySumRow:c=!0}=a,[u,d]=h.useState({}),p=h.useRef([]),f={};h.useEffect(()=>{const b={};if(r){for(const w in r)if(T0(w,a.rows))for(const S in r[w])T0(S,a.columns)&&(b[S]=(b[S]||0)+Number(r[w][S]||0))}else a.columns.forEach(w=>{b[w.name]=0});l&&(b.mos_col_totals=Object.values(b).reduce((w,S)=>w+S),d(b))},[r]);const m=(b,w,S)=>{var x;const T=((x=b.target.value)==null?void 0:x.trim())===""?void 0:b.target.value;let k={...r};k[w]?k[w][S]=T:k={...k,[w]:{[S]:T}},T===void 0&&(Object.values(k[w]).every(C=>C===void 0)&&(k={...k,[w]:void 0}),Object.values(k).every(C=>C===void 0)&&(k=void 0)),t(k)},g=b=>b&&new Intl.NumberFormat(navigator.language,a.numberFormatOptions).format(b),y=(b,w,S)=>{var T;switch(b.keyCode){case 37:b.target.selectionStart===0&&S>0&&p.current[w][S-1].focus();break;case 38:w>0&&p.current[w-1][S].focus();break;case 39:b.target.selectionStart===((T=b.target.value)==null?void 0:T.length)&&Sv.jsx(od,{children:b.title},`${b.name}-${w}`)),c&&v.jsx(od,{children:a.columnTotalLabel||"Total"})]})}),v.jsxs(gH,{children:[a.rows.map((b,w)=>v.jsxs("tr",{children:[v.jsxs(fp,{children:[v.jsx(hH,{children:b.title}),(b==null?void 0:b.subtitle)&&v.jsx(mH,{children:b.subtitle})]},`${b.name}`),a.columns.map((S,T)=>{var x;const k=((x=r==null?void 0:r[b.name])==null?void 0:x[S.name])??"";if(c){const C=isNaN(Number(k))?0:Number(k);f[b.name]=(f[b.name]||0)+C}return v.jsx(fp,{children:v.jsx(Yc,{inputProps:{"data-testid":`${b.name}-${S.name}`},placeholder:"0",value:k,onChange:C=>m(C,b.name,S.name),fieldSize:"90px",disabled:o,inputRef:C=>{p!=null&&p.current&&(p.current[w]=p.current[w]||[],p.current[w][T]=C),!w&&!T&&i&&(i.current=C)},onKeyDown:C=>y(C,w,T)})},`${b.name}-${S.name}`)}),c&&v.jsx(M0,{children:g(f[b.name])},`totals-${b.name}`)]},`row-${b.name}`)),l&&v.jsxs(vH,{children:[v.jsx(M0,{children:a.rowTotalLabel||"Total"}),a.columns.map(b=>v.jsx(E0,{children:g(u[b.name])||0},`column-${b.name}`)),c&&v.jsx(E0,{className:"totals-row",children:g(u.mos_col_totals)||0})]})]})]})},wH=h.memo(xH);var CH=function(n){var e={};function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=n,t.c=e,t.d=function(r,o,i){t.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:i})},t.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},t.t=function(r,o){if(1&o&&(r=t(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var s in r)t.d(i,s,(function(a){return r[a]}).bind(null,s));return i},t.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(o,"a",o),o},t.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},t.p="",t(t.s=9)}([function(n,e){n.exports=h},function(n,e,t){var r;/*! +`,HT=({children:n})=>v.jsx(zT,{children:n}),VT=n=>{var k,x;const{fieldDef:e,error:t,onChange:r,onBlur:o,value:i,disabled:s,inputRef:a,id:l,skeleton:c}=n,[u,d]=h.useState(!1),[p,f]=h.useState([]),[m,g]=h.useState(void 0);h.useEffect(()=>{(async()=>{var E,P;if((E=e==null?void 0:e.inputSettings)!=null&&E.options)f(e.inputSettings.options),g(!0);else if((P=e==null?void 0:e.inputSettings)!=null&&P.getOptions){const O=await e.inputSettings.getOptions();f(O),g(!1)}})()},[(k=e==null?void 0:e.inputSettings)==null?void 0:k.options,(x=e==null?void 0:e.inputSettings)==null?void 0:x.getOptions]),h.useEffect(()=>{i&&m===!1&&(p.find(C=>(C==null?void 0:C.value)===(i==null?void 0:i.value))||f([...p,i]))},[p,i,m]);const y=C=>{var E;return v.jsx(HT,{children:v.jsx(tf,{...C,"data-testid":"textfield-test-id",variant:"outlined",placeholder:(E=e==null?void 0:e.inputSettings)==null?void 0:E.placeholder,required:e==null?void 0:e.required,inputProps:{...C.inputProps,ref:P=>{a&&(a.current=P),C.inputProps.ref.current=P},id:l}})})},b=()=>{d(!u)},w=async C=>{r&&await r(C||void 0)},S=(C,E)=>(E==null?void 0:E.value)===""?!0:C.value===(E==null?void 0:E.value),T=C=>v.jsx(_T,{$value:(i==null?void 0:i.value)==="",...C});return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(jT,{"data-testid":"dropdown-single-selection-test-id",$innerWidth:e==null?void 0:e.size,children:v.jsx(FT,{value:i||null,onOpen:b,onClose:b,"data-testid":"autocomplete-test-id",options:p,getOptionLabel:C=>C.label,getOptionKey:C=>C.value,isOptionEqualToValue:S,onChange:(C,E)=>w(E),$error:e!=null&&e.required&&t?!!t:void 0,renderInput:y,PopperComponent:T,popupIcon:v.jsx(cf,{}),onBlur:C=>o&&o(C.target.value),open:u,disabled:s})})},UT=h.memo(VT);var WT=function(n){var e={};function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=n,t.c=e,t.d=function(r,o,i){t.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:i})},t.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},t.t=function(r,o){if(1&o&&(r=t(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var s in r)t.d(i,s,(function(a){return r[a]}).bind(null,s));return i},t.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(o,"a",o),o},t.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},t.p="",t(t.s=9)}([function(n,e){n.exports=h},function(n,e,t){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=P?E:P)),x=E,k=y(k),T.slice(x,x+k.length)==k}}).call(this,t(3))},function(n,e){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch{typeof window=="object"&&(t=window)}n.exports=t},function(n,e,t){(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.*?")+"$"),w=c.splice,S=F(a,"Map"),T=F(Object,"create");function k(N){var z=-1,_=N?N.length:0;for(this.clear();++z<_;){var $=N[z];this.set($[0],$[1])}}function x(N){var z=-1,_=N?N.length:0;for(this.clear();++z<_;){var $=N[z];this.set($[0],$[1])}}function C(N){var z=-1,_=N?N.length:0;for(this.clear();++z<_;){var $=N[z];this.set($[0],$[1])}}function E(N,z){for(var _,$,G=N.length;G--;)if((_=N[G][0])===($=z)||_!=_&&$!=$)return G;return-1}function P(N){return!(!U(N)||(z=N,f&&f in z))&&(function(_){var $=U(_)?y.call(_):"";return $=="[object Function]"||$=="[object GeneratorFunction]"}(N)||function(_){var $=!1;if(_!=null&&typeof _.toString!="function")try{$=!!(_+"")}catch{}return $}(N)?b:o).test(function(_){if(_!=null){try{return m.call(_)}catch{}try{return _+""}catch{}}return""}(N));var z}function O(N,z){var _,$,G=N.__data__;return(($=typeof(_=z))=="string"||$=="number"||$=="symbol"||$=="boolean"?_!=="__proto__":_===null)?G[typeof z=="string"?"string":"hash"]:G.map}function F(N,z){var _=function($,G){return $==null?void 0:$[G]}(N,z);return P(_)?_:void 0}function D(N,z){if(typeof N!="function"||z&&typeof z!="function")throw new TypeError("Expected a function");var _=function(){var $=arguments,G=z?z.apply(this,$):$[0],le=_.cache;if(le.has(G))return le.get(G);var Z=N.apply(this,$);return _.cache=le.set(G,Z),Z};return _.cache=new(D.Cache||C),_}function U(N){var z=typeof N;return!!N&&(z=="object"||z=="function")}k.prototype.clear=function(){this.__data__=T?T(null):{}},k.prototype.delete=function(N){return this.has(N)&&delete this.__data__[N]},k.prototype.get=function(N){var z=this.__data__;if(T){var _=z[N];return _==="__lodash_hash_undefined__"?void 0:_}return g.call(z,N)?z[N]:void 0},k.prototype.has=function(N){var z=this.__data__;return T?z[N]!==void 0:g.call(z,N)},k.prototype.set=function(N,z){return this.__data__[N]=T&&z===void 0?"__lodash_hash_undefined__":z,this},x.prototype.clear=function(){this.__data__=[]},x.prototype.delete=function(N){var z=this.__data__,_=E(z,N);return!(_<0)&&(_==z.length-1?z.pop():w.call(z,_,1),!0)},x.prototype.get=function(N){var z=this.__data__,_=E(z,N);return _<0?void 0:z[_][1]},x.prototype.has=function(N){return E(this.__data__,N)>-1},x.prototype.set=function(N,z){var _=this.__data__,$=E(_,N);return $<0?_.push([N,z]):_[$][1]=z,this},C.prototype.clear=function(){this.__data__={hash:new k,map:new(S||x),string:new k}},C.prototype.delete=function(N){return O(this,N).delete(N)},C.prototype.get=function(N){return O(this,N).get(N)},C.prototype.has=function(N){return O(this,N).has(N)},C.prototype.set=function(N,z){return O(this,N).set(N,z),this},D.Cache=C,n.exports=D}).call(this,t(3))},function(n,e,t){(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(w){var S=typeof w;return!!w&&(S=="object"||S=="function")}function b(w){if(typeof w=="number")return w;if(function(k){return typeof k=="symbol"||function(x){return!!x&&typeof x=="object"}(k)&&p.call(k)=="[object Symbol]"}(w))return NaN;if(y(w)){var S=typeof w.valueOf=="function"?w.valueOf():w;w=y(S)?S+"":S}if(typeof w!="string")return w===0?w:+w;w=w.replace(o,"");var T=s.test(w);return T||a.test(w)?l(w.slice(2),T?2:8):i.test(w)?NaN:+w}n.exports=function(w,S,T){var k,x,C,E,P,O,F=0,D=!1,U=!1,N=!0;if(typeof w!="function")throw new TypeError("Expected a function");function z(V){var J=k,ce=x;return k=x=void 0,F=V,E=w.apply(ce,J)}function _(V){return F=V,P=setTimeout(G,S),D?z(V):E}function $(V){var J=V-O;return O===void 0||J>=S||J<0||U&&V-F>=C}function G(){var V=g();if($(V))return le(V);P=setTimeout(G,function(J){var ce=S-(J-O);return U?m(ce,C-(J-F)):ce}(V))}function le(V){return P=void 0,N&&k?z(V):(k=x=void 0,E)}function Z(){var V=g(),J=$(V);if(k=arguments,x=this,O=V,J){if(P===void 0)return _(O);if(U)return P=setTimeout(G,S),z(O)}return P===void 0&&(P=setTimeout(G,S)),E}return S=b(S)||0,y(T)&&(D=!!T.leading,C=(U="maxWait"in T)?f(b(T.maxWait)||0,S):C,N="trailing"in T?!!T.trailing:N),Z.cancel=function(){P!==void 0&&clearTimeout(P),F=0,k=O=x=P=void 0},Z.flush=function(){return P===void 0?E:le(g())},Z}}).call(this,t(3))},function(n,e,t){(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,w=typeof self=="object"&&self&&self.Object===Object&&self,S=b||w||Function("return this")(),T=e&&!e.nodeType&&e,k=T&&typeof o=="object"&&o&&!o.nodeType&&o,x=k&&k.exports===T&&b.process,C=function(){try{return x&&x.binding("util")}catch{}}(),E=C&&C.isTypedArray;function P(L,W,ae,ge){var Fe=-1,$e=L?L.length:0;for(ge&&$e&&(ae=L[++Fe]);++Fe<$e;)ae=W(ae,L[Fe],Fe,L);return ae}function O(L,W){for(var ae=-1,ge=L?L.length:0;++ae-1},Ae.prototype.set=function(L,W){var ae=this.__data__,ge=Pt(ae,L);return ge<0?ae.push([L,W]):ae[ge][1]=W,this},He.prototype.clear=function(){this.__data__={hash:new Ee,map:new(Le||Ae),string:new Ee}},He.prototype.delete=function(L){return Gn(this,L).delete(L)},He.prototype.get=function(L){return Gn(this,L).get(L)},He.prototype.has=function(L){return Gn(this,L).has(L)},He.prototype.set=function(L,W){return Gn(this,L).set(L,W),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,W){var ae=this.__data__;if(ae instanceof Ae){var ge=ae.__data__;if(!Le||ge.length<199)return ge.push([L,W]),this;ae=this.__data__=new He(ge)}return ae.set(L,W),this};var Wt,Ht=(Wt=function(L,W){return L&&Gt(L,W,ze)},function(L,W){if(L==null)return L;if(!Jn(L))return Wt(L,W);for(var ae=L.length,ge=-1,Fe=Object(L);++gebt))return!1;var ft=$e.get(L);if(ft&&$e.get(W))return ft==W;var ct=-1,Zn=!0,nn=1&Fe?new Pe:void 0;for($e.set(L,W),$e.set(W,L);++ct-1&&L%1==0&&L-1&&L%1==0&&L<=9007199254740991}function re(L){var W=typeof L;return!!L&&(W=="object"||W=="function")}function X(L){return!!L&&typeof L=="object"}function ke(L){return typeof L=="symbol"||X(L)&&M.call(L)=="[object Symbol]"}var be=E?function(L){return function(W){return L(W)}}(E):function(L){return X(L)&&Nn(L.length)&&!!y[M.call(L)]};function ze(L){return Jn(L)?zt(L):Kt(L)}function et(L){return L}o.exports=function(L,W,ae){var ge=Jt(L)?P:F,Fe=arguments.length<3;return ge(L,cn(W),ae,Fe,Ht)}}).call(this,t(3),t(7)(n))},function(n,e){n.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(n,e){String.prototype.padEnd||(String.prototype.padEnd=function(t,r){return t>>=0,r=String(r!==void 0?r:" "),this.length>t?String(this):((t-=this.length)>r.length&&(r+=r.repeat(t/r.length)),String(this)+r.slice(0,t))})},function(n,e,t){function r(Z,V,J){return V in Z?Object.defineProperty(Z,V,{value:J,enumerable:!0,configurable:!0,writable:!0}):Z[V]=J,Z}function o(Z){if(Symbol.iterator in Object(Z)||Object.prototype.toString.call(Z)==="[object Arguments]")return Array.from(Z)}function i(Z){return function(V){if(Array.isArray(V)){for(var J=0,ce=new Array(V.length);J0?(Q.mainCode=!0,I||V.constructor.name==="Array"&&V.includes(te[2])?(Q.hasAreaCodes=!0,[Q].concat(fe)):(ie=ie.concat(fe),[Q])):[Q]}))),ie]}function _(Z,V,J,ce){if(J!==null){var q=Object.keys(J),M=Object.values(J);q.forEach(function(I,ie){if(ce)return Z.push([I,M[ie]]);var te=Z.findIndex(function(fe){return fe[0]===I});if(te===-1){var Q=[I];Q[V]=M[ie],Z.push(Q)}else Z[te][V]=M[ie]})}}function $(Z,V){return V.length===0?Z:Z.map(function(J){var ce=V.findIndex(function(M){return M[0]===J[2]});if(ce===-1)return J;var q=V[ce];return q[1]&&(J[4]=q[1]),q[3]&&(J[5]=q[3]),q[2]&&(J[6]=q[2]),J})}var G=function Z(V,J,ce,q,M,I,ie,te,Q,fe,pe,ye,Le,Oe){l(this,Z),this.filterRegions=function(me,ue){if(typeof me=="string"){var _e=me;return ue.filter(function(Ee){return Ee.regions.some(function(Ae){return Ae===_e})})}return ue.filter(function(Ee){return me.map(function(Ae){return Ee.regions.some(function(He){return He===Ae})}).some(function(Ae){return Ae})})},this.sortTerritories=function(me,ue){var _e=[].concat(i(me),i(ue));return _e.sort(function(Ee,Ae){return Ee.nameAe.name?1:0}),_e},this.getFilteredCountryList=function(me,ue,_e){return me.length===0?ue:_e?me.map(function(Ee){var Ae=ue.find(function(He){return He.iso2===Ee});if(Ae)return Ae}).filter(function(Ee){return Ee}):ue.filter(function(Ee){return me.some(function(Ae){return Ae===Ee.iso2})})},this.localizeCountries=function(me,ue,_e){for(var Ee=0;EeHe.localName?1:0}),me},this.getCustomAreas=function(me,ue){for(var _e=[],Ee=0;Eeve.dialCode.length||me.dialCode.length===ve.dialCode.length&&me.priority="0"&&B.indexOf(0)<="9"?oe.find(function(ne){return ne.dialCode==+B}):oe.find(function(ne){return ne.iso2==B}))&&R.dialCode&&M.setState({selectedCountry:R,formattedNumber:M.props.disableCountryCode?"":M.formatNumber(R.dialCode,R)})},M.scrollTo=function(B,R){if(B){var oe=M.dropdownRef;if(oe&&document.body){var ne=oe.offsetHeight,de=oe.getBoundingClientRect().top+document.body.scrollTop,he=de+ne,we=B,ve=we.getBoundingClientRect(),me=we.offsetHeight,ue=ve.top+document.body.scrollTop,_e=ue+me,Ee=ue-de+oe.scrollTop,Ae=ne/2-me/2;if(M.props.enableSearch?uehe){R&&(Ee+=Ae);var He=ne-me;oe.scrollTop=Ee-He}}}},M.scrollToTop=function(){var B=M.dropdownRef;B&&document.body&&(B.scrollTop=0)},M.formatNumber=function(B,R){if(!R)return B;var oe,ne=R.format,de=M.props,he=de.disableCountryCode,we=de.enableAreaCodeStretch,ve=de.enableLongNumbers,me=de.autoFormat;if(he?((oe=ne.split(" ")).shift(),oe=oe.join(" ")):we&&R.isAreaCode?((oe=ne.split(" "))[1]=oe[1].replace(/\.+/,"".padEnd(R.areaCodeLength,".")),oe=oe.join(" ")):oe=ne,!B||B.length===0)return he?"":M.props.prefix;if(B&&B.length<2||!oe||!me)return he?B:M.props.prefix+B;var ue,_e=x()(oe,function(Ee,Ae){if(Ee.remainingText.length===0)return Ee;if(Ae!==".")return{formattedText:Ee.formattedText+Ae,remainingText:Ee.remainingText};var He,Pe=s(He=Ee.remainingText)||o(He)||a(),it=Pe[0],zt=Pe.slice(1);return{formattedText:Ee.formattedText+it,remainingText:zt}},{formattedText:"",remainingText:B.split("")});return(ue=ve?_e.formattedText+_e.remainingText.join(""):_e.formattedText).includes("(")&&!ue.includes(")")&&(ue+=")"),ue},M.cursorToEnd=function(){var B=M.numberInputRef;if(document.activeElement===B){B.focus();var R=B.value.length;B.value.charAt(R-1)===")"&&(R-=1),B.setSelectionRange(R,R)}},M.getElement=function(B){return M["flag_no_".concat(B)]},M.getCountryData=function(){return M.state.selectedCountry?{name:M.state.selectedCountry.name||"",dialCode:M.state.selectedCountry.dialCode||"",countryCode:M.state.selectedCountry.iso2||"",format:M.state.selectedCountry.format||""}:{}},M.handleFlagDropdownClick=function(B){if(B.preventDefault(),M.state.showDropdown||!M.props.disabled){var R=M.state,oe=R.preferredCountries,ne=R.onlyCountries,de=R.selectedCountry,he=M.concatPreferredCountries(oe,ne).findIndex(function(we){return we.dialCode===de.dialCode&&we.iso2===de.iso2});M.setState({showDropdown:!M.state.showDropdown,highlightCountryIndex:he},function(){M.state.showDropdown&&M.scrollTo(M.getElement(M.state.highlightCountryIndex))})}},M.handleInput=function(B){var R=B.target.value,oe=M.props,ne=oe.prefix,de=oe.onChange,he=M.props.disableCountryCode?"":ne,we=M.state.selectedCountry,ve=M.state.freezeSelection;if(!M.props.countryCodeEditable){var me=ne+(we.hasAreaCodes?M.state.onlyCountries.find(function(Ht){return Ht.iso2===we.iso2&&Ht.mainCode}).dialCode:we.dialCode);if(R.slice(0,me.length)!==me)return}if(R===ne)return de&&de("",M.getCountryData(),B,""),M.setState({formattedNumber:""});if(!(R.replace(/\D/g,"").length>15&&(M.props.enableLongNumbers===!1||typeof M.props.enableLongNumbers=="number"&&R.replace(/\D/g,"").length>M.props.enableLongNumbers))&&R!==M.state.formattedNumber){B.preventDefault?B.preventDefault():B.returnValue=!1;var ue=M.props.country,_e=M.state,Ee=_e.onlyCountries,Ae=_e.selectedCountry,He=_e.hiddenAreaCodes;if(de&&B.persist(),R.length>0){var Pe=R.replace(/\D/g,"");(!M.state.freezeSelection||Ae&&Ae.dialCode.length>Pe.length)&&(we=M.props.disableCountryGuess?Ae:M.guessSelectedCountry(Pe.substring(0,6),ue,Ee,He)||Ae,ve=!1),he=M.formatNumber(Pe,we),we=we.dialCode?we:Ae}var it=B.target.selectionStart,zt=B.target.selectionStart,Pt=M.state.formattedNumber,Wt=he.length-Pt.length;M.setState({formattedNumber:he,freezeSelection:ve,selectedCountry:we},function(){Wt>0&&(zt-=Wt),he.charAt(he.length-1)==")"?M.numberInputRef.setSelectionRange(he.length-1,he.length-1):zt>0&&Pt.length>=he.length?M.numberInputRef.setSelectionRange(zt,zt):it1?de.replace(oe.dialCode,ne.dialCode):ne.dialCode,we=M.formatNumber(he.replace(/\D/g,""),ne);M.setState({showDropdown:!1,selectedCountry:ne,freezeSelection:!0,formattedNumber:we,searchValue:""},function(){M.cursorToEnd(),M.props.onChange&&M.props.onChange(we.replace(/[^0-9]+/g,""),M.getCountryData(),R,we)})}},M.handleInputFocus=function(B){M.numberInputRef&&M.numberInputRef.value===M.props.prefix&&M.state.selectedCountry&&!M.props.disableCountryCode&&M.setState({formattedNumber:M.props.prefix+M.state.selectedCountry.dialCode},function(){M.props.jumpCursorToEnd&&setTimeout(M.cursorToEnd,0)}),M.setState({placeholder:""}),M.props.onFocus&&M.props.onFocus(B,M.getCountryData()),M.props.jumpCursorToEnd&&setTimeout(M.cursorToEnd,0)},M.handleInputBlur=function(B){B.target.value||M.setState({placeholder:M.props.placeholder}),M.props.onBlur&&M.props.onBlur(B,M.getCountryData())},M.handleInputCopy=function(B){if(M.props.copyNumbersOnly){var R=window.getSelection().toString().replace(/[^0-9]+/g,"");B.clipboardData.setData("text/plain",R),B.preventDefault()}},M.getHighlightCountryIndex=function(B){var R=M.state.highlightCountryIndex+B;return R<0||R>=M.state.onlyCountries.length+M.state.preferredCountries.length?R-B:M.props.enableSearch&&R>M.getSearchFilteredCountries().length?0:R},M.searchCountry=function(){var B=M.getProbableCandidate(M.state.queryString)||M.state.onlyCountries[0],R=M.state.onlyCountries.findIndex(function(oe){return oe==B})+M.state.preferredCountries.length;M.scrollTo(M.getElement(R),!0),M.setState({queryString:"",highlightCountryIndex:R})},M.handleKeydown=function(B){var R=M.props.keys,oe=B.target.className;if(oe.includes("selected-flag")&&B.which===R.ENTER&&!M.state.showDropdown)return M.handleFlagDropdownClick(B);if(oe.includes("form-control")&&(B.which===R.ENTER||B.which===R.ESC))return B.target.blur();if(M.state.showDropdown&&!M.props.disabled&&(!oe.includes("search-box")||B.which===R.UP||B.which===R.DOWN||B.which===R.ENTER||B.which===R.ESC&&B.target.value==="")){B.preventDefault?B.preventDefault():B.returnValue=!1;var ne=function(de){M.setState({highlightCountryIndex:M.getHighlightCountryIndex(de)},function(){M.scrollTo(M.getElement(M.state.highlightCountryIndex),!0)})};switch(B.which){case R.DOWN:ne(1);break;case R.UP:ne(-1);break;case R.ENTER:M.props.enableSearch?M.handleFlagItemClick(M.getSearchFilteredCountries()[M.state.highlightCountryIndex]||M.getSearchFilteredCountries()[0],B):M.handleFlagItemClick([].concat(i(M.state.preferredCountries),i(M.state.onlyCountries))[M.state.highlightCountryIndex],B);break;case R.ESC:case R.TAB:M.setState({showDropdown:!1},M.cursorToEnd);break;default:(B.which>=R.A&&B.which<=R.Z||B.which===R.SPACE)&&M.setState({queryString:M.state.queryString+String.fromCharCode(B.which)},M.state.debouncedQueryStingSearcher)}}},M.handleInputKeyDown=function(B){var R=M.props,oe=R.keys,ne=R.onEnterKeyPress,de=R.onKeyDown;B.which===oe.ENTER&&ne&&ne(B),de&&de(B)},M.handleClickOutside=function(B){M.dropdownRef&&M.dropdownRef!==B.target&&!M.dropdownRef.contains(B.target)&&M.state.showDropdown&&M.setState({showDropdown:!1})},M.handleSearchChange=function(B){var R=B.currentTarget.value,oe=M.state,ne=oe.preferredCountries,de=oe.selectedCountry,he=0;if(R===""&&de){var we=M.state.onlyCountries;he=M.concatPreferredCountries(ne,we).findIndex(function(ve){return ve==de}),setTimeout(function(){return M.scrollTo(M.getElement(he))},100)}M.setState({searchValue:R,highlightCountryIndex:he})},M.concatPreferredCountries=function(B,R){return B.length>0?i(new Set(B.concat(R))):R},M.getDropdownCountryName=function(B){return B.localName||B.name},M.getSearchFilteredCountries=function(){var B=M.state,R=B.preferredCountries,oe=B.onlyCountries,ne=B.searchValue,de=M.props.enableSearch,he=M.concatPreferredCountries(R,oe),we=ne.trim().toLowerCase().replace("+","");if(de&&we){if(/^\d+$/.test(we))return he.filter(function(ue){var _e=ue.dialCode;return["".concat(_e)].some(function(Ee){return Ee.toLowerCase().includes(we)})});var ve=he.filter(function(ue){var _e=ue.iso2;return["".concat(_e)].some(function(Ee){return Ee.toLowerCase().includes(we)})}),me=he.filter(function(ue){var _e=ue.name,Ee=ue.localName;return ue.iso2,["".concat(_e),"".concat(Ee||"")].some(function(Ae){return Ae.toLowerCase().includes(we)})});return M.scrollToTop(),i(new Set([].concat(ve,me)))}return he},M.getCountryDropdownList=function(){var B=M.state,R=B.preferredCountries,oe=B.highlightCountryIndex,ne=B.showDropdown,de=B.searchValue,he=M.props,we=he.disableDropdown,ve=he.prefix,me=M.props,ue=me.enableSearch,_e=me.searchNotFound,Ee=me.disableSearchIcon,Ae=me.searchClass,He=me.searchStyle,Pe=me.searchPlaceholder,it=me.autocompleteSearch,zt=me.DropdownList,Pt=M.getSearchFilteredCountries().map(function(lt,yn){var Dn=oe===yn,$t=O()({country:!0,preferred:lt.iso2==="us"||lt.iso2==="gb",active:lt.iso2==="us",highlight:Dn}),cn="flag ".concat(lt.iso2);return y.a.createElement("li",Object.assign({ref:function(Kt){return M["flag_no_".concat(yn)]=Kt},key:"flag_no_".concat(yn),"data-flag-key":"flag_no_".concat(yn),className:$t,"data-dial-code":"1",tabIndex:we?"-1":"0","data-country-code":lt.iso2,onClick:function(Kt){return M.handleFlagItemClick(lt,Kt)},role:"option"},Dn?{"aria-selected":!0}:{}),y.a.createElement("div",{className:cn}),y.a.createElement("span",{className:"country-name"},M.getDropdownCountryName(lt)),y.a.createElement("span",{className:"dial-code"},lt.format?M.formatNumber(lt.dialCode,lt):ve+lt.dialCode))}),Wt=y.a.createElement("li",{key:"dashes",className:"divider"});R.length>0&&(!ue||ue&&!de.trim())&&Pt.splice(R.length,0,Wt);var Ht=O()(r({"country-list":!0,hide:!ne},M.props.dropdownClass,!0)),Gt=y.a.createElement(y.a.Fragment,null,ue&&y.a.createElement("li",{className:O()(r({search:!0},Ae,Ae))},!Ee&&y.a.createElement("span",{className:O()(r({"search-emoji":!0},"".concat(Ae,"-emoji"),Ae)),role:"img","aria-label":"Magnifying glass"},"🔎"),y.a.createElement("input",{className:O()(r({"search-box":!0},"".concat(Ae,"-box"),Ae)),style:He,type:"search",placeholder:Pe,autoFocus:!0,autoComplete:it?"on":"off",value:de,onChange:M.handleSearchChange})),Pt.length>0?Pt:y.a.createElement("li",{className:"no-entries-message"},y.a.createElement("span",null,_e)));return zt?y.a.createElement(zt,{ref:function(lt){return!ue&<&<.focus(),M.dropdownRef=lt},anchorEl:M.numberInputRef},Gt):y.a.createElement("ul",{ref:function(lt){return!ue&<&<.focus(),M.dropdownRef=lt},className:Ht,style:M.props.dropdownStyle,role:"listbox",tabIndex:"0"},Gt)};var I,ie=new G(q.enableAreaCodes,q.enableTerritories,q.regions,q.onlyCountries,q.preferredCountries,q.excludeCountries,q.preserveOrder,q.masks,q.priority,q.areaCodes,q.localization,q.prefix,q.defaultMask,q.alwaysDefaultMask),te=ie.onlyCountries,Q=ie.preferredCountries,fe=ie.hiddenAreaCodes,pe=q.value?q.value.replace(/\D/g,""):"";I=q.disableInitialCountryGuess?0:pe.length>1?M.guessSelectedCountry(pe.substring(0,6),q.country,te,fe)||0:q.country&&te.find(function(B){return B.iso2==q.country})||0;var ye,Le=pe.length<2&&I&&!E()(pe,I.dialCode)?I.dialCode:"";ye=pe===""&&I===0?"":M.formatNumber((q.disableCountryCode?"":Le)+pe,I.name?I:void 0);var Oe=te.findIndex(function(B){return B==I});return M.state={showDropdown:q.showDropdown,formattedNumber:ye,onlyCountries:te,preferredCountries:Q,hiddenAreaCodes:fe,selectedCountry:I,highlightCountryIndex:Oe,queryString:"",freezeSelection:!1,debouncedQueryStingSearcher:w()(M.searchCountry,250),searchValue:""},M}var J,ce;return function(q,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");q.prototype=Object.create(M&&M.prototype,{constructor:{value:q,writable:!0,configurable:!0}}),M&&m(q,M)}(V,Z),J=V,(ce=[{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(q,M,I){q.country!==this.props.country?this.updateCountry(this.props.country):q.value!==this.props.value&&this.updateFormattedNumber(this.props.value)}},{key:"updateFormattedNumber",value:function(q){if(q===null)return this.setState({selectedCountry:0,formattedNumber:""});var M=this.state,I=M.onlyCountries,ie=M.selectedCountry,te=M.hiddenAreaCodes,Q=this.props,fe=Q.country,pe=Q.prefix;if(q==="")return this.setState({selectedCountry:ie,formattedNumber:""});var ye,Le,Oe=q.replace(/\D/g,"");if(ie&&E()(q,pe+ie.dialCode))Le=this.formatNumber(Oe,ie),this.setState({formattedNumber:Le});else{var B=(ye=this.props.disableCountryGuess?ie:this.guessSelectedCountry(Oe.substring(0,6),fe,I,te)||ie)&&E()(Oe,pe+ye.dialCode)?ye.dialCode:"";Le=this.formatNumber((this.props.disableCountryCode?"":B)+Oe,ye||void 0),this.setState({selectedCountry:ye,formattedNumber:Le})}}},{key:"render",value:function(){var q,M,I,ie=this,te=this.state,Q=te.onlyCountries,fe=te.selectedCountry,pe=te.showDropdown,ye=te.formattedNumber,Le=te.hiddenAreaCodes,Oe=this.props,B=Oe.disableDropdown,R=Oe.tabbableDropdown,oe=Oe.renderStringAsFlag,ne=Oe.isValid,de=Oe.defaultErrorMessage,he=Oe.specialLabel;if(typeof ne=="boolean")M=ne;else{var we=ne(ye.replace(/\D/g,""),fe,Q,Le);typeof we=="boolean"?(M=we)===!1&&(I=de):(M=!1,I=we)}var ve=O()((r(q={},this.props.containerClass,!0),r(q,"react-tel-input",!0),q)),me=O()({arrow:!0,up:pe}),ue=O()(r({"form-control":!0,"invalid-number":!M,open:pe},this.props.inputClass,!0)),_e=O()({"selected-flag":!0,open:pe}),Ee=O()(r({"flag-dropdown":!0,"invalid-number":!M,open:pe},this.props.buttonClass,!0)),Ae="flag ".concat(fe&&fe.iso2);return y.a.createElement("div",{className:"".concat(ve," ").concat(this.props.className),style:this.props.style||this.props.containerStyle,onKeyDown:this.handleKeydown},he&&y.a.createElement("div",{className:"special-label"},he),I&&y.a.createElement("div",{className:"invalid-number-message"},I),y.a.createElement("input",Object.assign({className:ue,style:this.props.inputStyle,onChange:this.handleInput,onClick:this.handleInputClick,onDoubleClick:this.handleDoubleClick,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onCopy:this.handleInputCopy,value:ye,onKeyDown:this.handleInputKeyDown,placeholder:this.props.placeholder,disabled:this.props.disabled,type:"tel"},this.props.inputProps,{ref:function(He){ie.numberInputRef=He,typeof ie.props.inputProps.ref=="function"?ie.props.inputProps.ref(He):typeof ie.props.inputProps.ref=="object"&&(ie.props.inputProps.ref.current=He)}})),y.a.createElement("div",{className:Ee,style:this.props.buttonStyle,ref:function(He){return ie.dropdownContainerRef=He}},oe?y.a.createElement("div",{className:_e},oe):y.a.createElement("div",{onClick:B?void 0:this.handleFlagDropdownClick,className:_e,title:fe?"".concat(fe.localName||fe.name,": + ").concat(fe.dialCode):"",tabIndex:B||R===!1?"-1":"0",role:"button","aria-haspopup":"listbox","aria-expanded":!!pe||void 0},y.a.createElement("div",{className:Ae},!B&&y.a.createElement("div",{className:me}))),pe&&this.getCountryDropdownList()))}}])&&c(J.prototype,ce),V}(y.a.Component);le.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=le}]);const SH=ef(CH),kH=Y.div` +*/(function(){var o={}.hasOwnProperty;function i(){for(var s=[],a=0;a=P?E:P)),x=E,k=y(k),T.slice(x,x+k.length)==k}}).call(this,t(3))},function(n,e){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch{typeof window=="object"&&(t=window)}n.exports=t},function(n,e,t){(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.*?")+"$"),w=c.splice,S=F(a,"Map"),T=F(Object,"create");function k(N){var z=-1,_=N?N.length:0;for(this.clear();++z<_;){var $=N[z];this.set($[0],$[1])}}function x(N){var z=-1,_=N?N.length:0;for(this.clear();++z<_;){var $=N[z];this.set($[0],$[1])}}function C(N){var z=-1,_=N?N.length:0;for(this.clear();++z<_;){var $=N[z];this.set($[0],$[1])}}function E(N,z){for(var _,$,G=N.length;G--;)if((_=N[G][0])===($=z)||_!=_&&$!=$)return G;return-1}function P(N){return!(!U(N)||(z=N,f&&f in z))&&(function(_){var $=U(_)?y.call(_):"";return $=="[object Function]"||$=="[object GeneratorFunction]"}(N)||function(_){var $=!1;if(_!=null&&typeof _.toString!="function")try{$=!!(_+"")}catch{}return $}(N)?b:o).test(function(_){if(_!=null){try{return m.call(_)}catch{}try{return _+""}catch{}}return""}(N));var z}function O(N,z){var _,$,G=N.__data__;return(($=typeof(_=z))=="string"||$=="number"||$=="symbol"||$=="boolean"?_!=="__proto__":_===null)?G[typeof z=="string"?"string":"hash"]:G.map}function F(N,z){var _=function($,G){return $==null?void 0:$[G]}(N,z);return P(_)?_:void 0}function D(N,z){if(typeof N!="function"||z&&typeof z!="function")throw new TypeError("Expected a function");var _=function(){var $=arguments,G=z?z.apply(this,$):$[0],le=_.cache;if(le.has(G))return le.get(G);var Z=N.apply(this,$);return _.cache=le.set(G,Z),Z};return _.cache=new(D.Cache||C),_}function U(N){var z=typeof N;return!!N&&(z=="object"||z=="function")}k.prototype.clear=function(){this.__data__=T?T(null):{}},k.prototype.delete=function(N){return this.has(N)&&delete this.__data__[N]},k.prototype.get=function(N){var z=this.__data__;if(T){var _=z[N];return _==="__lodash_hash_undefined__"?void 0:_}return g.call(z,N)?z[N]:void 0},k.prototype.has=function(N){var z=this.__data__;return T?z[N]!==void 0:g.call(z,N)},k.prototype.set=function(N,z){return this.__data__[N]=T&&z===void 0?"__lodash_hash_undefined__":z,this},x.prototype.clear=function(){this.__data__=[]},x.prototype.delete=function(N){var z=this.__data__,_=E(z,N);return!(_<0)&&(_==z.length-1?z.pop():w.call(z,_,1),!0)},x.prototype.get=function(N){var z=this.__data__,_=E(z,N);return _<0?void 0:z[_][1]},x.prototype.has=function(N){return E(this.__data__,N)>-1},x.prototype.set=function(N,z){var _=this.__data__,$=E(_,N);return $<0?_.push([N,z]):_[$][1]=z,this},C.prototype.clear=function(){this.__data__={hash:new k,map:new(S||x),string:new k}},C.prototype.delete=function(N){return O(this,N).delete(N)},C.prototype.get=function(N){return O(this,N).get(N)},C.prototype.has=function(N){return O(this,N).has(N)},C.prototype.set=function(N,z){return O(this,N).set(N,z),this},D.Cache=C,n.exports=D}).call(this,t(3))},function(n,e,t){(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(w){var S=typeof w;return!!w&&(S=="object"||S=="function")}function b(w){if(typeof w=="number")return w;if(function(k){return typeof k=="symbol"||function(x){return!!x&&typeof x=="object"}(k)&&p.call(k)=="[object Symbol]"}(w))return NaN;if(y(w)){var S=typeof w.valueOf=="function"?w.valueOf():w;w=y(S)?S+"":S}if(typeof w!="string")return w===0?w:+w;w=w.replace(o,"");var T=s.test(w);return T||a.test(w)?l(w.slice(2),T?2:8):i.test(w)?NaN:+w}n.exports=function(w,S,T){var k,x,C,E,P,O,F=0,D=!1,U=!1,N=!0;if(typeof w!="function")throw new TypeError("Expected a function");function z(V){var J=k,ce=x;return k=x=void 0,F=V,E=w.apply(ce,J)}function _(V){return F=V,P=setTimeout(G,S),D?z(V):E}function $(V){var J=V-O;return O===void 0||J>=S||J<0||U&&V-F>=C}function G(){var V=g();if($(V))return le(V);P=setTimeout(G,function(J){var ce=S-(J-O);return U?m(ce,C-(J-F)):ce}(V))}function le(V){return P=void 0,N&&k?z(V):(k=x=void 0,E)}function Z(){var V=g(),J=$(V);if(k=arguments,x=this,O=V,J){if(P===void 0)return _(O);if(U)return P=setTimeout(G,S),z(O)}return P===void 0&&(P=setTimeout(G,S)),E}return S=b(S)||0,y(T)&&(D=!!T.leading,C=(U="maxWait"in T)?f(b(T.maxWait)||0,S):C,N="trailing"in T?!!T.trailing:N),Z.cancel=function(){P!==void 0&&clearTimeout(P),F=0,k=O=x=P=void 0},Z.flush=function(){return P===void 0?E:le(g())},Z}}).call(this,t(3))},function(n,e,t){(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,w=typeof self=="object"&&self&&self.Object===Object&&self,S=b||w||Function("return this")(),T=e&&!e.nodeType&&e,k=T&&typeof o=="object"&&o&&!o.nodeType&&o,x=k&&k.exports===T&&b.process,C=function(){try{return x&&x.binding("util")}catch{}}(),E=C&&C.isTypedArray;function P(L,W,ae,ge){var Fe=-1,$e=L?L.length:0;for(ge&&$e&&(ae=L[++Fe]);++Fe<$e;)ae=W(ae,L[Fe],Fe,L);return ae}function O(L,W){for(var ae=-1,ge=L?L.length:0;++ae-1},Ae.prototype.set=function(L,W){var ae=this.__data__,ge=Pt(ae,L);return ge<0?ae.push([L,W]):ae[ge][1]=W,this},He.prototype.clear=function(){this.__data__={hash:new Ee,map:new(Le||Ae),string:new Ee}},He.prototype.delete=function(L){return Gn(this,L).delete(L)},He.prototype.get=function(L){return Gn(this,L).get(L)},He.prototype.has=function(L){return Gn(this,L).has(L)},He.prototype.set=function(L,W){return Gn(this,L).set(L,W),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,W){var ae=this.__data__;if(ae instanceof Ae){var ge=ae.__data__;if(!Le||ge.length<199)return ge.push([L,W]),this;ae=this.__data__=new He(ge)}return ae.set(L,W),this};var Wt,Ht=(Wt=function(L,W){return L&&Gt(L,W,ze)},function(L,W){if(L==null)return L;if(!Jn(L))return Wt(L,W);for(var ae=L.length,ge=-1,Fe=Object(L);++gebt))return!1;var ft=$e.get(L);if(ft&&$e.get(W))return ft==W;var ct=-1,Zn=!0,rn=1&Fe?new Pe:void 0;for($e.set(L,W),$e.set(W,L);++ct-1&&L%1==0&&L-1&&L%1==0&&L<=9007199254740991}function re(L){var W=typeof L;return!!L&&(W=="object"||W=="function")}function X(L){return!!L&&typeof L=="object"}function ke(L){return typeof L=="symbol"||X(L)&&M.call(L)=="[object Symbol]"}var be=E?function(L){return function(W){return L(W)}}(E):function(L){return X(L)&&Nn(L.length)&&!!y[M.call(L)]};function ze(L){return Jn(L)?zt(L):Kt(L)}function et(L){return L}o.exports=function(L,W,ae){var ge=Jt(L)?P:F,Fe=arguments.length<3;return ge(L,cn(W),ae,Fe,Ht)}}).call(this,t(3),t(7)(n))},function(n,e){n.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(n,e){String.prototype.padEnd||(String.prototype.padEnd=function(t,r){return t>>=0,r=String(r!==void 0?r:" "),this.length>t?String(this):((t-=this.length)>r.length&&(r+=r.repeat(t/r.length)),String(this)+r.slice(0,t))})},function(n,e,t){function r(Z,V,J){return V in Z?Object.defineProperty(Z,V,{value:J,enumerable:!0,configurable:!0,writable:!0}):Z[V]=J,Z}function o(Z){if(Symbol.iterator in Object(Z)||Object.prototype.toString.call(Z)==="[object Arguments]")return Array.from(Z)}function i(Z){return function(V){if(Array.isArray(V)){for(var J=0,ce=new Array(V.length);J0?(Q.mainCode=!0,I||V.constructor.name==="Array"&&V.includes(te[2])?(Q.hasAreaCodes=!0,[Q].concat(fe)):(ie=ie.concat(fe),[Q])):[Q]}))),ie]}function _(Z,V,J,ce){if(J!==null){var q=Object.keys(J),M=Object.values(J);q.forEach(function(I,ie){if(ce)return Z.push([I,M[ie]]);var te=Z.findIndex(function(fe){return fe[0]===I});if(te===-1){var Q=[I];Q[V]=M[ie],Z.push(Q)}else Z[te][V]=M[ie]})}}function $(Z,V){return V.length===0?Z:Z.map(function(J){var ce=V.findIndex(function(M){return M[0]===J[2]});if(ce===-1)return J;var q=V[ce];return q[1]&&(J[4]=q[1]),q[3]&&(J[5]=q[3]),q[2]&&(J[6]=q[2]),J})}var G=function Z(V,J,ce,q,M,I,ie,te,Q,fe,pe,ye,Le,Oe){l(this,Z),this.filterRegions=function(me,ue){if(typeof me=="string"){var _e=me;return ue.filter(function(Ee){return Ee.regions.some(function(Ae){return Ae===_e})})}return ue.filter(function(Ee){return me.map(function(Ae){return Ee.regions.some(function(He){return He===Ae})}).some(function(Ae){return Ae})})},this.sortTerritories=function(me,ue){var _e=[].concat(i(me),i(ue));return _e.sort(function(Ee,Ae){return Ee.nameAe.name?1:0}),_e},this.getFilteredCountryList=function(me,ue,_e){return me.length===0?ue:_e?me.map(function(Ee){var Ae=ue.find(function(He){return He.iso2===Ee});if(Ae)return Ae}).filter(function(Ee){return Ee}):ue.filter(function(Ee){return me.some(function(Ae){return Ae===Ee.iso2})})},this.localizeCountries=function(me,ue,_e){for(var Ee=0;EeHe.localName?1:0}),me},this.getCustomAreas=function(me,ue){for(var _e=[],Ee=0;Eeve.dialCode.length||me.dialCode.length===ve.dialCode.length&&me.priority="0"&&B.indexOf(0)<="9"?oe.find(function(ne){return ne.dialCode==+B}):oe.find(function(ne){return ne.iso2==B}))&&R.dialCode&&M.setState({selectedCountry:R,formattedNumber:M.props.disableCountryCode?"":M.formatNumber(R.dialCode,R)})},M.scrollTo=function(B,R){if(B){var oe=M.dropdownRef;if(oe&&document.body){var ne=oe.offsetHeight,de=oe.getBoundingClientRect().top+document.body.scrollTop,he=de+ne,we=B,ve=we.getBoundingClientRect(),me=we.offsetHeight,ue=ve.top+document.body.scrollTop,_e=ue+me,Ee=ue-de+oe.scrollTop,Ae=ne/2-me/2;if(M.props.enableSearch?uehe){R&&(Ee+=Ae);var He=ne-me;oe.scrollTop=Ee-He}}}},M.scrollToTop=function(){var B=M.dropdownRef;B&&document.body&&(B.scrollTop=0)},M.formatNumber=function(B,R){if(!R)return B;var oe,ne=R.format,de=M.props,he=de.disableCountryCode,we=de.enableAreaCodeStretch,ve=de.enableLongNumbers,me=de.autoFormat;if(he?((oe=ne.split(" ")).shift(),oe=oe.join(" ")):we&&R.isAreaCode?((oe=ne.split(" "))[1]=oe[1].replace(/\.+/,"".padEnd(R.areaCodeLength,".")),oe=oe.join(" ")):oe=ne,!B||B.length===0)return he?"":M.props.prefix;if(B&&B.length<2||!oe||!me)return he?B:M.props.prefix+B;var ue,_e=x()(oe,function(Ee,Ae){if(Ee.remainingText.length===0)return Ee;if(Ae!==".")return{formattedText:Ee.formattedText+Ae,remainingText:Ee.remainingText};var He,Pe=s(He=Ee.remainingText)||o(He)||a(),it=Pe[0],zt=Pe.slice(1);return{formattedText:Ee.formattedText+it,remainingText:zt}},{formattedText:"",remainingText:B.split("")});return(ue=ve?_e.formattedText+_e.remainingText.join(""):_e.formattedText).includes("(")&&!ue.includes(")")&&(ue+=")"),ue},M.cursorToEnd=function(){var B=M.numberInputRef;if(document.activeElement===B){B.focus();var R=B.value.length;B.value.charAt(R-1)===")"&&(R-=1),B.setSelectionRange(R,R)}},M.getElement=function(B){return M["flag_no_".concat(B)]},M.getCountryData=function(){return M.state.selectedCountry?{name:M.state.selectedCountry.name||"",dialCode:M.state.selectedCountry.dialCode||"",countryCode:M.state.selectedCountry.iso2||"",format:M.state.selectedCountry.format||""}:{}},M.handleFlagDropdownClick=function(B){if(B.preventDefault(),M.state.showDropdown||!M.props.disabled){var R=M.state,oe=R.preferredCountries,ne=R.onlyCountries,de=R.selectedCountry,he=M.concatPreferredCountries(oe,ne).findIndex(function(we){return we.dialCode===de.dialCode&&we.iso2===de.iso2});M.setState({showDropdown:!M.state.showDropdown,highlightCountryIndex:he},function(){M.state.showDropdown&&M.scrollTo(M.getElement(M.state.highlightCountryIndex))})}},M.handleInput=function(B){var R=B.target.value,oe=M.props,ne=oe.prefix,de=oe.onChange,he=M.props.disableCountryCode?"":ne,we=M.state.selectedCountry,ve=M.state.freezeSelection;if(!M.props.countryCodeEditable){var me=ne+(we.hasAreaCodes?M.state.onlyCountries.find(function(Ht){return Ht.iso2===we.iso2&&Ht.mainCode}).dialCode:we.dialCode);if(R.slice(0,me.length)!==me)return}if(R===ne)return de&&de("",M.getCountryData(),B,""),M.setState({formattedNumber:""});if(!(R.replace(/\D/g,"").length>15&&(M.props.enableLongNumbers===!1||typeof M.props.enableLongNumbers=="number"&&R.replace(/\D/g,"").length>M.props.enableLongNumbers))&&R!==M.state.formattedNumber){B.preventDefault?B.preventDefault():B.returnValue=!1;var ue=M.props.country,_e=M.state,Ee=_e.onlyCountries,Ae=_e.selectedCountry,He=_e.hiddenAreaCodes;if(de&&B.persist(),R.length>0){var Pe=R.replace(/\D/g,"");(!M.state.freezeSelection||Ae&&Ae.dialCode.length>Pe.length)&&(we=M.props.disableCountryGuess?Ae:M.guessSelectedCountry(Pe.substring(0,6),ue,Ee,He)||Ae,ve=!1),he=M.formatNumber(Pe,we),we=we.dialCode?we:Ae}var it=B.target.selectionStart,zt=B.target.selectionStart,Pt=M.state.formattedNumber,Wt=he.length-Pt.length;M.setState({formattedNumber:he,freezeSelection:ve,selectedCountry:we},function(){Wt>0&&(zt-=Wt),he.charAt(he.length-1)==")"?M.numberInputRef.setSelectionRange(he.length-1,he.length-1):zt>0&&Pt.length>=he.length?M.numberInputRef.setSelectionRange(zt,zt):it1?de.replace(oe.dialCode,ne.dialCode):ne.dialCode,we=M.formatNumber(he.replace(/\D/g,""),ne);M.setState({showDropdown:!1,selectedCountry:ne,freezeSelection:!0,formattedNumber:we,searchValue:""},function(){M.cursorToEnd(),M.props.onChange&&M.props.onChange(we.replace(/[^0-9]+/g,""),M.getCountryData(),R,we)})}},M.handleInputFocus=function(B){M.numberInputRef&&M.numberInputRef.value===M.props.prefix&&M.state.selectedCountry&&!M.props.disableCountryCode&&M.setState({formattedNumber:M.props.prefix+M.state.selectedCountry.dialCode},function(){M.props.jumpCursorToEnd&&setTimeout(M.cursorToEnd,0)}),M.setState({placeholder:""}),M.props.onFocus&&M.props.onFocus(B,M.getCountryData()),M.props.jumpCursorToEnd&&setTimeout(M.cursorToEnd,0)},M.handleInputBlur=function(B){B.target.value||M.setState({placeholder:M.props.placeholder}),M.props.onBlur&&M.props.onBlur(B,M.getCountryData())},M.handleInputCopy=function(B){if(M.props.copyNumbersOnly){var R=window.getSelection().toString().replace(/[^0-9]+/g,"");B.clipboardData.setData("text/plain",R),B.preventDefault()}},M.getHighlightCountryIndex=function(B){var R=M.state.highlightCountryIndex+B;return R<0||R>=M.state.onlyCountries.length+M.state.preferredCountries.length?R-B:M.props.enableSearch&&R>M.getSearchFilteredCountries().length?0:R},M.searchCountry=function(){var B=M.getProbableCandidate(M.state.queryString)||M.state.onlyCountries[0],R=M.state.onlyCountries.findIndex(function(oe){return oe==B})+M.state.preferredCountries.length;M.scrollTo(M.getElement(R),!0),M.setState({queryString:"",highlightCountryIndex:R})},M.handleKeydown=function(B){var R=M.props.keys,oe=B.target.className;if(oe.includes("selected-flag")&&B.which===R.ENTER&&!M.state.showDropdown)return M.handleFlagDropdownClick(B);if(oe.includes("form-control")&&(B.which===R.ENTER||B.which===R.ESC))return B.target.blur();if(M.state.showDropdown&&!M.props.disabled&&(!oe.includes("search-box")||B.which===R.UP||B.which===R.DOWN||B.which===R.ENTER||B.which===R.ESC&&B.target.value==="")){B.preventDefault?B.preventDefault():B.returnValue=!1;var ne=function(de){M.setState({highlightCountryIndex:M.getHighlightCountryIndex(de)},function(){M.scrollTo(M.getElement(M.state.highlightCountryIndex),!0)})};switch(B.which){case R.DOWN:ne(1);break;case R.UP:ne(-1);break;case R.ENTER:M.props.enableSearch?M.handleFlagItemClick(M.getSearchFilteredCountries()[M.state.highlightCountryIndex]||M.getSearchFilteredCountries()[0],B):M.handleFlagItemClick([].concat(i(M.state.preferredCountries),i(M.state.onlyCountries))[M.state.highlightCountryIndex],B);break;case R.ESC:case R.TAB:M.setState({showDropdown:!1},M.cursorToEnd);break;default:(B.which>=R.A&&B.which<=R.Z||B.which===R.SPACE)&&M.setState({queryString:M.state.queryString+String.fromCharCode(B.which)},M.state.debouncedQueryStingSearcher)}}},M.handleInputKeyDown=function(B){var R=M.props,oe=R.keys,ne=R.onEnterKeyPress,de=R.onKeyDown;B.which===oe.ENTER&&ne&&ne(B),de&&de(B)},M.handleClickOutside=function(B){M.dropdownRef&&M.dropdownRef!==B.target&&!M.dropdownRef.contains(B.target)&&M.state.showDropdown&&M.setState({showDropdown:!1})},M.handleSearchChange=function(B){var R=B.currentTarget.value,oe=M.state,ne=oe.preferredCountries,de=oe.selectedCountry,he=0;if(R===""&&de){var we=M.state.onlyCountries;he=M.concatPreferredCountries(ne,we).findIndex(function(ve){return ve==de}),setTimeout(function(){return M.scrollTo(M.getElement(he))},100)}M.setState({searchValue:R,highlightCountryIndex:he})},M.concatPreferredCountries=function(B,R){return B.length>0?i(new Set(B.concat(R))):R},M.getDropdownCountryName=function(B){return B.localName||B.name},M.getSearchFilteredCountries=function(){var B=M.state,R=B.preferredCountries,oe=B.onlyCountries,ne=B.searchValue,de=M.props.enableSearch,he=M.concatPreferredCountries(R,oe),we=ne.trim().toLowerCase().replace("+","");if(de&&we){if(/^\d+$/.test(we))return he.filter(function(ue){var _e=ue.dialCode;return["".concat(_e)].some(function(Ee){return Ee.toLowerCase().includes(we)})});var ve=he.filter(function(ue){var _e=ue.iso2;return["".concat(_e)].some(function(Ee){return Ee.toLowerCase().includes(we)})}),me=he.filter(function(ue){var _e=ue.name,Ee=ue.localName;return ue.iso2,["".concat(_e),"".concat(Ee||"")].some(function(Ae){return Ae.toLowerCase().includes(we)})});return M.scrollToTop(),i(new Set([].concat(ve,me)))}return he},M.getCountryDropdownList=function(){var B=M.state,R=B.preferredCountries,oe=B.highlightCountryIndex,ne=B.showDropdown,de=B.searchValue,he=M.props,we=he.disableDropdown,ve=he.prefix,me=M.props,ue=me.enableSearch,_e=me.searchNotFound,Ee=me.disableSearchIcon,Ae=me.searchClass,He=me.searchStyle,Pe=me.searchPlaceholder,it=me.autocompleteSearch,zt=me.DropdownList,Pt=M.getSearchFilteredCountries().map(function(lt,yn){var Dn=oe===yn,$t=O()({country:!0,preferred:lt.iso2==="us"||lt.iso2==="gb",active:lt.iso2==="us",highlight:Dn}),cn="flag ".concat(lt.iso2);return y.a.createElement("li",Object.assign({ref:function(Kt){return M["flag_no_".concat(yn)]=Kt},key:"flag_no_".concat(yn),"data-flag-key":"flag_no_".concat(yn),className:$t,"data-dial-code":"1",tabIndex:we?"-1":"0","data-country-code":lt.iso2,onClick:function(Kt){return M.handleFlagItemClick(lt,Kt)},role:"option"},Dn?{"aria-selected":!0}:{}),y.a.createElement("div",{className:cn}),y.a.createElement("span",{className:"country-name"},M.getDropdownCountryName(lt)),y.a.createElement("span",{className:"dial-code"},lt.format?M.formatNumber(lt.dialCode,lt):ve+lt.dialCode))}),Wt=y.a.createElement("li",{key:"dashes",className:"divider"});R.length>0&&(!ue||ue&&!de.trim())&&Pt.splice(R.length,0,Wt);var Ht=O()(r({"country-list":!0,hide:!ne},M.props.dropdownClass,!0)),Gt=y.a.createElement(y.a.Fragment,null,ue&&y.a.createElement("li",{className:O()(r({search:!0},Ae,Ae))},!Ee&&y.a.createElement("span",{className:O()(r({"search-emoji":!0},"".concat(Ae,"-emoji"),Ae)),role:"img","aria-label":"Magnifying glass"},"🔎"),y.a.createElement("input",{className:O()(r({"search-box":!0},"".concat(Ae,"-box"),Ae)),style:He,type:"search",placeholder:Pe,autoFocus:!0,autoComplete:it?"on":"off",value:de,onChange:M.handleSearchChange})),Pt.length>0?Pt:y.a.createElement("li",{className:"no-entries-message"},y.a.createElement("span",null,_e)));return zt?y.a.createElement(zt,{ref:function(lt){return!ue&<&<.focus(),M.dropdownRef=lt},anchorEl:M.numberInputRef},Gt):y.a.createElement("ul",{ref:function(lt){return!ue&<&<.focus(),M.dropdownRef=lt},className:Ht,style:M.props.dropdownStyle,role:"listbox",tabIndex:"0"},Gt)};var I,ie=new G(q.enableAreaCodes,q.enableTerritories,q.regions,q.onlyCountries,q.preferredCountries,q.excludeCountries,q.preserveOrder,q.masks,q.priority,q.areaCodes,q.localization,q.prefix,q.defaultMask,q.alwaysDefaultMask),te=ie.onlyCountries,Q=ie.preferredCountries,fe=ie.hiddenAreaCodes,pe=q.value?q.value.replace(/\D/g,""):"";I=q.disableInitialCountryGuess?0:pe.length>1?M.guessSelectedCountry(pe.substring(0,6),q.country,te,fe)||0:q.country&&te.find(function(B){return B.iso2==q.country})||0;var ye,Le=pe.length<2&&I&&!E()(pe,I.dialCode)?I.dialCode:"";ye=pe===""&&I===0?"":M.formatNumber((q.disableCountryCode?"":Le)+pe,I.name?I:void 0);var Oe=te.findIndex(function(B){return B==I});return M.state={showDropdown:q.showDropdown,formattedNumber:ye,onlyCountries:te,preferredCountries:Q,hiddenAreaCodes:fe,selectedCountry:I,highlightCountryIndex:Oe,queryString:"",freezeSelection:!1,debouncedQueryStingSearcher:w()(M.searchCountry,250),searchValue:""},M}var J,ce;return function(q,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");q.prototype=Object.create(M&&M.prototype,{constructor:{value:q,writable:!0,configurable:!0}}),M&&m(q,M)}(V,Z),J=V,(ce=[{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(q,M,I){q.country!==this.props.country?this.updateCountry(this.props.country):q.value!==this.props.value&&this.updateFormattedNumber(this.props.value)}},{key:"updateFormattedNumber",value:function(q){if(q===null)return this.setState({selectedCountry:0,formattedNumber:""});var M=this.state,I=M.onlyCountries,ie=M.selectedCountry,te=M.hiddenAreaCodes,Q=this.props,fe=Q.country,pe=Q.prefix;if(q==="")return this.setState({selectedCountry:ie,formattedNumber:""});var ye,Le,Oe=q.replace(/\D/g,"");if(ie&&E()(q,pe+ie.dialCode))Le=this.formatNumber(Oe,ie),this.setState({formattedNumber:Le});else{var B=(ye=this.props.disableCountryGuess?ie:this.guessSelectedCountry(Oe.substring(0,6),fe,I,te)||ie)&&E()(Oe,pe+ye.dialCode)?ye.dialCode:"";Le=this.formatNumber((this.props.disableCountryCode?"":B)+Oe,ye||void 0),this.setState({selectedCountry:ye,formattedNumber:Le})}}},{key:"render",value:function(){var q,M,I,ie=this,te=this.state,Q=te.onlyCountries,fe=te.selectedCountry,pe=te.showDropdown,ye=te.formattedNumber,Le=te.hiddenAreaCodes,Oe=this.props,B=Oe.disableDropdown,R=Oe.tabbableDropdown,oe=Oe.renderStringAsFlag,ne=Oe.isValid,de=Oe.defaultErrorMessage,he=Oe.specialLabel;if(typeof ne=="boolean")M=ne;else{var we=ne(ye.replace(/\D/g,""),fe,Q,Le);typeof we=="boolean"?(M=we)===!1&&(I=de):(M=!1,I=we)}var ve=O()((r(q={},this.props.containerClass,!0),r(q,"react-tel-input",!0),q)),me=O()({arrow:!0,up:pe}),ue=O()(r({"form-control":!0,"invalid-number":!M,open:pe},this.props.inputClass,!0)),_e=O()({"selected-flag":!0,open:pe}),Ee=O()(r({"flag-dropdown":!0,"invalid-number":!M,open:pe},this.props.buttonClass,!0)),Ae="flag ".concat(fe&&fe.iso2);return y.a.createElement("div",{className:"".concat(ve," ").concat(this.props.className),style:this.props.style||this.props.containerStyle,onKeyDown:this.handleKeydown},he&&y.a.createElement("div",{className:"special-label"},he),I&&y.a.createElement("div",{className:"invalid-number-message"},I),y.a.createElement("input",Object.assign({className:ue,style:this.props.inputStyle,onChange:this.handleInput,onClick:this.handleInputClick,onDoubleClick:this.handleDoubleClick,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onCopy:this.handleInputCopy,value:ye,onKeyDown:this.handleInputKeyDown,placeholder:this.props.placeholder,disabled:this.props.disabled,type:"tel"},this.props.inputProps,{ref:function(He){ie.numberInputRef=He,typeof ie.props.inputProps.ref=="function"?ie.props.inputProps.ref(He):typeof ie.props.inputProps.ref=="object"&&(ie.props.inputProps.ref.current=He)}})),y.a.createElement("div",{className:Ee,style:this.props.buttonStyle,ref:function(He){return ie.dropdownContainerRef=He}},oe?y.a.createElement("div",{className:_e},oe):y.a.createElement("div",{onClick:B?void 0:this.handleFlagDropdownClick,className:_e,title:fe?"".concat(fe.localName||fe.name,": + ").concat(fe.dialCode):"",tabIndex:B||R===!1?"-1":"0",role:"button","aria-haspopup":"listbox","aria-expanded":!!pe||void 0},y.a.createElement("div",{className:Ae},!B&&y.a.createElement("div",{className:me}))),pe&&this.getCountryDropdownList()))}}])&&c(J.prototype,ce),V}(y.a.Component);le.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=le}]);const GT=ef(WT),KT=Y.div` .react-tel-input { .form-control { border-radius: 0px; @@ -882,76 +360,423 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } } } -`,MH=Y(ei)` +`,qT=Y(ei)` z-index: 1500; -`,EH=Y.ul` +`,YT=Y.ul` list-style: none; margin: 0; padding: 8px 0; max-height: 40vh; overflow: auto; - li { - font-family: ${j.fontFamily}; - color: ${j.newColors.almostBlack[100]}; - font-size: 14px; - min-height: 40px; - display: flex; - gap: 8px; - overflow: hidden; - justify-content: flex-start; - align-items: center; - cursor: pointer; - box-sizing: border-box; - outline: 0; - -webkit-tap-highlight-color: transparent; - padding: 6px 16px; + li { + font-family: ${j.fontFamily}; + color: ${j.newColors.almostBlack[100]}; + font-size: 14px; + min-height: 40px; + display: flex; + gap: 8px; + overflow: hidden; + justify-content: flex-start; + align-items: center; + cursor: pointer; + box-sizing: border-box; + outline: 0; + -webkit-tap-highlight-color: transparent; + padding: 6px 16px; + + &:highlight, + &:hover { + background-color: rgba(0, 0, 0, 0.04); + } + + & .flag { + width: 25px; + height: 20px; + background-repeat: no-repeat; + } + } + + li.highlight, + li:hover { + background-color: rgba(0, 0, 0, 0.04); + } +`,JT=A.forwardRef(function({children:e,anchorEl:t},r){return v.jsx(qT,{open:!0,anchorEl:t,style:{width:t.clientWidth},children:v.jsx(ka,{children:v.jsx(YT,{ref:r,children:e})})})}),ZT=n=>{var u,d;const{fieldDef:e,error:t,onChange:r,onBlur:o,value:i,disabled:s,inputRef:a,id:l,skeleton:c}=n;return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(KT,{$error:!!(e!=null&&e.required&&t),onBlur:p=>o&&o(p.target.value),$disabled:s,children:v.jsx(GT,{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:JT})})},XT=h.memo(ZT);function QT(n){return kn("MuiRadioGroup",n)}At("MuiRadioGroup",["root","row","error"]);const eO=["actions","children","className","defaultValue","name","onChange","value"],tO=n=>{const{classes:e,row:t,error:r}=n;return Mn({root:["root",t&&"row",r&&"error"]},QT,e)},nO=h.forwardRef(function(e,t){const{actions:r,children:o,className:i,defaultValue:s,name:a,onChange:l,value:c}=e,u=tt(e,eO),d=h.useRef(null),p=tO(e),[f,m]=Yi({controlled:c,default:s,name:"RadioGroup"});h.useImperativeHandle(r,()=>({focus:()=>{let w=d.current.querySelector("input:not(:disabled):checked");w||(w=d.current.querySelector("input:not(:disabled)")),w&&w.focus()}}),[]);const g=_r(t,d),y=af(a),b=h.useMemo(()=>({name:y,onChange(w){m(w.target.value),l&&l(w,w.target.value)},value:f}),[y,l,m,f]);return v.jsx(Uk.Provider,{value:b,children:v.jsx(fk,K({role:"radiogroup",ref:g,className:_n(p.root,i)},u,{children:o}))})}),rO=Y(nO)` + margin-left: -12px; +`,oO=Y.div` + display: flex; + flex-flow: column; +`,iO=Y.div` + display: flex; + align-items: center; +`,sO=Y.div` + display: flex; + align-items: center; + justify-content: center; + width: 18px; + height: 40px; + margin-right: 14px; +`;function Bu(){return v.jsxs(iO,{children:[v.jsx(sO,{children:v.jsx(Xe,{variant:"circular",width:18,height:18})}),v.jsx(Xe,{width:52,height:28})]})}function aO(){return v.jsxs(oO,{children:[v.jsx(Bu,{}),v.jsx(Bu,{}),v.jsx(Bu,{})]})}const lO=n=>{var f,m;const{fieldDef:e,onChange:t,value:r,onBlur:o,disabled:i,skeleton:s}=n,[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 w=await e.inputSettings.getOptions();l(w),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(Wk,{disabled:i,label:g.label,value:g.value},g.label))}),p=g=>{const y=a.find(b=>b.value===g);t(y)};return s?v.jsx(aO,{}):v.jsx(rO,{onChange:g=>t&&p(g.target.value),value:r?r.value:"",onBlur:g=>o&&o(g.target.value),children:d})},cO=h.memo(lO),uO=n=>{const{value:e}=n;return v.jsx(v.Fragment,{children:e})},dO=h.memo(uO),pO=Y.div` + display: flex; + flex-flow: column; +`,fO=Y.div` + display: flex; + align-items: center; +`,hO=Y.div` + display: flex; + align-items: center; + justify-content: center; + padding-left: 10px; + height: 40px; + margin-right: 14px; + + & .MuiSkeleton-root { + border-radius: 99999em; + } +`;function mO(){return v.jsxs(fO,{children:[v.jsx(hO,{children:v.jsx(Xe,{variant:"rounded",width:36,height:22})}),v.jsx(Xe,{width:78,height:28})]})}function gO(){return v.jsx(pO,{children:v.jsx(mO,{})})}const vO=n=>{var a;const{fieldDef:e,onBlur:t,onChange:r,value:o,disabled:i,skeleton:s}=n;return s?v.jsx(gO,{}):v.jsx(Gk,{disabled:i,checked:o,label:(a=e==null?void 0:e.inputSettings)==null?void 0:a.toggleLabel,onChange:r,onBlur:t})},yO=h.memo(vO);var rr={},Ma={},bO=vb,xO=lb,wO=Zc,CO="[object String]";function SO(n){return typeof n=="string"||!xO(n)&&wO(n)&&bO(n)==CO}var kO=SO,MO=hk;function EO(n){return typeof n=="function"?n:MO}var TO=EO,OO=ck,LO=TO;function AO(n,e){return n&&OO(n,LO(e))}var Sf=AO,PO=mk,DO=PO(Object.getPrototypeOf,Object),kf=DO,RO=vb,IO=kf,$O=Zc,NO="[object Object]",BO=Function.prototype,FO=Object.prototype,zb=BO.toString,jO=FO.hasOwnProperty,_O=zb.call(Object);function zO(n){if(!$O(n)||RO(n)!=NO)return!1;var e=IO(n);if(e===null)return!0;var t=jO.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&zb.call(t)==_O}var HO=zO;Object.defineProperty(Ma,"__esModule",{value:!0});Ma.flattenNames=void 0;var VO=kO,UO=tu(VO),WO=Sf,GO=tu(WO),KO=HO,qO=tu(KO),YO=tM,JO=tu(YO);function tu(n){return n&&n.__esModule?n:{default:n}}var ZO=Ma.flattenNames=function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[];return(0,JO.default)(e,function(r){Array.isArray(r)?n(r).map(function(o){return t.push(o)}):(0,qO.default)(r)?(0,GO.default)(r,function(o,i){o===!0&&t.push(i),t.push(i+"-"+o)}):(0,UO.default)(r)&&t.push(r)}),t};Ma.default=ZO;var Ea={};function XO(n,e){for(var t=-1,r=n==null?0:n.length;++t1&&arguments[1]!==void 0?arguments[1]:[],r=e.default&&(0,cP.default)(e.default)||{};return t.map(function(o){var i=e[o];return i&&(0,aP.default)(i,function(s,a){r[a]||(r[a]={}),r[a]=uP({},r[a],i[a])}),o}),r};Ea.default=dP;var Ta={};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.autoprefix=void 0;var pP=Sf,pg=hP(pP),fP=Object.assign||function(n){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){wP(o,r);function o(){var i,s,a,l;xP(this,o);for(var c=arguments.length,u=Array(c),d=0;d1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){TP(o,r);function o(){var i,s,a,l;EP(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===t-1&&o("last-child"),(e===0||e%2===0)&&o("even"),Math.abs(e%2)===1&&o("odd"),o("nth-child",e),r};Tf.default=LP;Object.defineProperty(rr,"__esModule",{value:!0});rr.ReactCSS=rr.loop=rr.handleActive=Of=rr.handleHover=rr.hover=void 0;var AP=Ma,PP=us(AP),DP=Ea,RP=us(DP),IP=Ta,$P=us(IP),NP=Oa,Kb=us(NP),BP=La,FP=us(BP),jP=Tf,_P=us(jP);function us(n){return n&&n.__esModule?n:{default:n}}rr.hover=Kb.default;var Of=rr.handleHover=Kb.default;rr.handleActive=FP.default;rr.loop=_P.default;var zP=rr.ReactCSS=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;oa?p=1:p=Math.round(d*100/a)/100,t.a!==p)return{h:t.h,s:t.s,l:t.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:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null},_u={},VP=function(e,t,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=t,s.fillRect(0,0,r,r),s.translate(r,r),s.fillRect(0,0,r,r),i.toDataURL()):null},UP=function(e,t,r,o){var i=e+"-"+t+"-"+r+(o?"-server":"");if(_u[i])return _u[i];var s=VP(e,t,r,o);return _u[i]=s,s},mg=Object.assign||function(n){for(var e=1;e-1},oD=function(e){return Number(String(e).replace(/%/g,""))},iD=1,nt=function(n){QP(e,n);function e(t){ZP(this,e);var r=XP(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=oD(o.target.value);if(!isNaN(i)&&rD(o.keyCode)){var s=r.getArrowOffset(),a=o.keyCode===qb?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(t.value).toUpperCase(),blurValue:String(t.value).toUpperCase()},r.inputId="rc-editable-input-"+iD++,r}return YP(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 JP({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||eD}},{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=Ue({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 A.createElement("div",{style:o.wrap},A.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?A.createElement("label",{htmlFor:this.inputId,style:o.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(h.PureComponent||h.Component),sD=function(e,t,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(t==="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},aD=function(){function n(e,t){for(var r=0;r-1}function gD(n,e){var t=this.__data__,r=ru(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Wr(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e-1&&n%1==0&&n<=SR}function fs(n){return n!=null&&Rf(n.length)&&!Af(n)}function kR(n){return vo(n)&&fs(n)}function MR(){return!1}var nx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kg=nx&&typeof module=="object"&&module&&!module.nodeType&&module,ER=kg&&kg.exports===nx,Mg=ER?gr.Buffer:void 0,TR=Mg?Mg.isBuffer:void 0,Kl=TR||MR,OR="[object Object]",LR=Function.prototype,AR=Object.prototype,rx=LR.toString,PR=AR.hasOwnProperty,DR=rx.call(Object);function RR(n){if(!vo(n)||ni(n)!=OR)return!1;var e=ex(n);if(e===null)return!0;var t=PR.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&rx.call(t)==DR}var IR="[object Arguments]",$R="[object Array]",NR="[object Boolean]",BR="[object Date]",FR="[object Error]",jR="[object Function]",_R="[object Map]",zR="[object Number]",HR="[object Object]",VR="[object RegExp]",UR="[object Set]",WR="[object String]",GR="[object WeakMap]",KR="[object ArrayBuffer]",qR="[object DataView]",YR="[object Float32Array]",JR="[object Float64Array]",ZR="[object Int8Array]",XR="[object Int16Array]",QR="[object Int32Array]",eI="[object Uint8Array]",tI="[object Uint8ClampedArray]",nI="[object Uint16Array]",rI="[object Uint32Array]",Ct={};Ct[YR]=Ct[JR]=Ct[ZR]=Ct[XR]=Ct[QR]=Ct[eI]=Ct[tI]=Ct[nI]=Ct[rI]=!0;Ct[IR]=Ct[$R]=Ct[KR]=Ct[NR]=Ct[qR]=Ct[BR]=Ct[FR]=Ct[jR]=Ct[_R]=Ct[zR]=Ct[HR]=Ct[VR]=Ct[UR]=Ct[WR]=Ct[GR]=!1;function oI(n){return vo(n)&&Rf(n.length)&&!!Ct[ni(n)]}function iI(n){return function(e){return n(e)}}var ox=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ks=ox&&typeof module=="object"&&module&&!module.nodeType&&module,sI=Ks&&Ks.exports===ox,Hu=sI&&Yb.process,Eg=function(){try{var n=Ks&&Ks.require&&Ks.require("util").types;return n||Hu&&Hu.binding&&Hu.binding("util")}catch{}}(),Tg=Eg&&Eg.isTypedArray,If=Tg?iI(Tg):oI;function Kd(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}var aI=Object.prototype,lI=aI.hasOwnProperty;function cI(n,e,t){var r=n[e];(!(lI.call(n,e)&&Aa(r,t))||t===void 0&&!(e in n))&&Pf(n,e,t)}function uI(n,e,t,r){var o=!t;t||(t={});for(var i=-1,s=e.length;++i-1&&n%1==0&&n0){if(++e>=EI)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}var AI=LI(MI);function PI(n,e){return AI(SI(n,e,iu),n+"")}function DI(n,e,t){if(!sr(t))return!1;var r=typeof e;return(r=="number"?fs(t)&&$f(e,t.length):r=="string"&&e in t)?Aa(t[e],n):!1}function RI(n){return PI(function(e,t){var r=-1,o=t.length,i=o>1?t[o-1]:void 0,s=o>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(o--,i):void 0,s&&DI(t[0],t[1],s)&&(i=o<3?void 0:i,o=1),e=Object(e);++r=e||C<0||d&&E>=i}function b(){var x=Vu();if(y(x))return w(x);a=setTimeout(b,g(x))}function w(x){return a=void 0,p&&r?f(x):(r=o=void 0,s)}function S(){a!==void 0&&clearTimeout(a),c=0,r=l=o=a=void 0}function T(){return a===void 0?s:w(Vu())}function k(){var x=Vu(),C=y(x);if(r=arguments,o=this,l=x,C){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=T,k}var GI="Expected a function";function KI(n,e,t){var r=!0,o=!0;if(typeof n!="function")throw new TypeError(GI);return sr(t)&&(r="leading"in t?!!t.leading:r,o="trailing"in t?!!t.trailing:o),lx(n,e,{leading:r,maxWait:e,trailing:o})}var qI=function(e,t,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:t.h,s:d,v:p,a:t.a,source:"hsv"}},YI=function(){function n(e,t){for(var r=0;r=0,i=!t&&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,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y$,arguments)},brighten:function(){return this._applyModification(b$,arguments)},darken:function(){return this._applyModification(x$,arguments)},desaturate:function(){return this._applyModification(m$,arguments)},saturate:function(){return this._applyModification(g$,arguments)},greyscale:function(){return this._applyModification(v$,arguments)},spin:function(){return this._applyModification(w$,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k$,arguments)},complement:function(){return this._applyCombination(C$,arguments)},monochromatic:function(){return this._applyCombination(M$,arguments)},splitcomplement:function(){return this._applyCombination(S$,arguments)},triad:function(){return this._applyCombination($g,[3])},tetrad:function(){return this._applyCombination($g,[4])}};Ne.fromRatio=function(n,e){if(ql(n)=="object"){var t={};for(var r in n)n.hasOwnProperty(r)&&(r==="a"?t[r]=n[r]:t[r]=Ls(n[r]));n=t}return Ne(n,e)};function u$(n){var e={r:0,g:0,b:0},t=1,r=null,o=null,i=null,s=!1,a=!1;return typeof n=="string"&&(n=A$(n)),ql(n)=="object"&&(Rr(n.r)&&Rr(n.g)&&Rr(n.b)?(e=d$(n.r,n.g,n.b),s=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Rr(n.h)&&Rr(n.s)&&Rr(n.v)?(r=Ls(n.s),o=Ls(n.v),e=f$(n.h,r,o),s=!0,a="hsv"):Rr(n.h)&&Rr(n.s)&&Rr(n.l)&&(r=Ls(n.s),i=Ls(n.l),e=p$(n.h,r,i),s=!0,a="hsl"),n.hasOwnProperty("a")&&(t=n.a)),t=ux(t),{ok:s,format:n.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:t}}function d$(n,e,t){return{r:Et(n,255)*255,g:Et(e,255)*255,b:Et(t,255)*255}}function Pg(n,e,t){n=Et(n,255),e=Et(e,255),t=Et(t,255);var r=Math.max(n,e,t),o=Math.min(n,e,t),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 n:i=(e-t)/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=t;else{var a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=s(l,a,n+1/3),o=s(l,a,n),i=s(l,a,n-1/3)}return{r:r*255,g:o*255,b:i*255}}function Dg(n,e,t){n=Et(n,255),e=Et(e,255),t=Et(t,255);var r=Math.max(n,e,t),o=Math.min(n,e,t),i,s,a=r,l=r-o;if(s=r===0?0:l/r,r==o)i=0;else{switch(r){case n:i=(e-t)/l+(e>1)+720)%360;--e;)r.h=(r.h+o)%360,i.push(Ne(r));return i}function M$(n,e){e=e||6;for(var t=Ne(n).toHsv(),r=t.h,o=t.s,i=t.v,s=[],a=1/e;e--;)s.push(Ne({h:r,s:o,v:i})),i=(i+a)%1;return s}Ne.mix=function(n,e,t){t=t===0?0:t||50;var r=Ne(n).toRgb(),o=Ne(e).toRgb(),i=t/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(n,e){var t=Ne(n),r=Ne(e);return(Math.max(t.getLuminance(),r.getLuminance())+.05)/(Math.min(t.getLuminance(),r.getLuminance())+.05)};Ne.isReadable=function(n,e,t){var r=Ne.readability(n,e),o,i;switch(i=!1,o=P$(t),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(n,e,t){var r=null,o=0,i,s,a,l;t=t||{},s=t.includeFallbackColors,a=t.level,l=t.size;for(var c=0;co&&(o=i,r=Ne(e[c]));return Ne.isReadable(n,r,{level:a,size:l})||!s?r:(t.includeFallbackColors=!1,Ne.mostReadable(n,["#fff","#000"],t))};var qd=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"},E$=Ne.hexNames=T$(qd);function T$(n){var e={};for(var t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function ux(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Et(n,e){O$(n)&&(n="100%");var t=L$(n);return n=Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(n*e,10)/100),Math.abs(n-e)<1e-6?1:n%e/parseFloat(e)}function lu(n){return Math.min(1,Math.max(0,n))}function Fn(n){return parseInt(n,16)}function O$(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function L$(n){return typeof n=="string"&&n.indexOf("%")!=-1}function pr(n){return n.length==1?"0"+n:""+n}function Ls(n){return n<=1&&(n=n*100+"%"),n}function dx(n){return Math.round(parseFloat(n)*255).toString(16)}function Ng(n){return Fn(n)/255}var lr=function(){var n="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+n+")",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",o="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),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 Rr(n){return!!lr.CSS_UNIT.exec(n)}function A$(n){n=n.replace(l$,"").replace(c$,"").toLowerCase();var e=!1;if(qd[n])n=qd[n],e=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=lr.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=lr.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=lr.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=lr.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=lr.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=lr.hsva.exec(n))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=lr.hex8.exec(n))?{r:Fn(t[1]),g:Fn(t[2]),b:Fn(t[3]),a:Ng(t[4]),format:e?"name":"hex8"}:(t=lr.hex6.exec(n))?{r:Fn(t[1]),g:Fn(t[2]),b:Fn(t[3]),format:e?"name":"hex"}:(t=lr.hex4.exec(n))?{r:Fn(t[1]+""+t[1]),g:Fn(t[2]+""+t[2]),b:Fn(t[3]+""+t[3]),a:Ng(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=lr.hex3.exec(n))?{r:Fn(t[1]+""+t[1]),g:Fn(t[2]+""+t[2]),b:Fn(t[3]+""+t[3]),format:e?"name":"hex"}:!1}function P$(n){var e,t;return n=n||{level:"AA",size:"small"},e=(n.level||"AA").toUpperCase(),t=(n.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}var Bg=function(e){var t=["r","g","b","a","h","s","l","v"],r=0,o=0;return a$(t,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},As=function(e,t){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=t||0,i.h=t||0);var l=a==="000000"&&s.a===0;return{hsl:o,hex:l?"transparent":"#"+a,rgb:s,hsv:i,oldHue:e.h||t||o.h,source:e.source}},wo=function(e){if(e==="transparent")return!0;var t=String(e).charAt(0)==="#"?1:0;return e.length!==4+t&&e.length<7+t&&Ne(e).isValid()},Bf=function(e){if(!e)return"#fff";var t=As(e);if(t.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(t.rgb.r*299+t.rgb.g*587+t.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},Uu=function(e,t){var r=e.replace("°","");return Ne(t+" ("+r+")")._ok},ys=Object.assign||function(n){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){j$(o,r);function o(){var i,s,a,l;F$(this,o);for(var c=arguments.length,u=Array(c),d=0;da))return!1;var c=i.get(n),u=i.get(e);if(c&&u)return c==e&&u==n;var d=-1,p=!0,f=t&Z$?new Yl:void 0;for(i.set(n,e),i.set(e,n);++d=0||Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}var Qa=24,f3=wx.default=function(n){var e=n.fill,t=e===void 0?"currentColor":e,r=n.width,o=r===void 0?Qa:r,i=n.height,s=i===void 0?Qa:i,a=n.style,l=a===void 0?{}:a,c=p3(n,["fill","width","height","style"]);return tv.default.createElement("svg",ev({viewBox:"0 0 "+Qa+" "+Qa,style:ev({fill:t,width:o,height:s},l)},c),tv.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"}))},h3=function(){function n(e,t){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(Qg(o.s)?r.props.hsl.s:o.s),l:Number(Qg(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"},t.hsl.a!==1&&t.view==="hex"?r.state={view:"rgb"}:r.state={view:t.view},r}return h3(e,[{key:"render",value:function(){var r=this,o=Ue({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=A.createElement("div",{style:o.fields,className:"flexbox-fix"},A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?i=A.createElement("div",{style:o.fields,className:"flexbox-fix"},A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),A.createElement("div",{style:o.alpha},A.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=A.createElement("div",{style:o.fields,className:"flexbox-fix"},A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),A.createElement("div",{style:o.field},A.createElement(nt,{style:{input:o.input,label:o.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),A.createElement("div",{style:o.alpha},A.createElement(nt,{style:{input:o.input,label:o.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),A.createElement("div",{style:o.wrap,className:"flexbox-fix"},i,A.createElement("div",{style:o.toggle},A.createElement("div",{style:o.icon,onClick:this.toggleViews,ref:function(a){return r.icon=a}},A.createElement(f3,{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}(A.Component);Cx.defaultProps={view:"hex"};var nv=function(){var e=Ue({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 A.createElement("div",{style:e.picker})},y3=function(){var e=Ue({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return A.createElement("div",{style:e.picker})},Vf=function(e){var t=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=Ue(An({default:{picker:{width:t,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 A.createElement("div",{style:g.picker,className:"chrome-picker "+f},A.createElement("div",{style:g.saturation},A.createElement(au,{style:g.Saturation,hsl:s,hsv:a,pointer:y3,onChange:r})),A.createElement("div",{style:g.body},A.createElement("div",{style:g.controls,className:"flexbox-fix"},A.createElement("div",{style:g.color},A.createElement("div",{style:g.swatch},A.createElement("div",{style:g.active}),A.createElement(ds,{renderers:c}))),A.createElement("div",{style:g.toggles},A.createElement("div",{style:g.hue},A.createElement(ps,{style:g.Hue,hsl:s,pointer:nv,onChange:r})),A.createElement("div",{style:g.alpha},A.createElement(Lf,{style:g.Alpha,rgb:i,hsl:s,pointer:nv,renderers:c,onChange:r})))),A.createElement(Cx,{rgb:i,hsl:s,hex:l,view:m,onChange:r,disableAlpha:o})))};Vf.propTypes={width:Se.oneOfType([Se.string,Se.number]),disableAlpha:Se.bool,styles:Se.object,defaultView:Se.oneOf(["hex","rgb","hsl"])};Vf.defaultProps={width:225,disableAlpha:!1,styles:{}};Pn(Vf);var b3=function(e){var t=e.color,r=e.onClick,o=r===void 0?function(){}:r,i=e.onSwatchHover,s=e.active,a=Ue({default:{color:{background:t,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:Bf(t),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":t==="#FFFFFF",transparent:t==="transparent"});return A.createElement(ii,{style:a.color,color:t,onClick:o,onHover:i,focusStyle:{boxShadow:"0 0 4px "+t}},A.createElement("div",{style:a.dot}))},x3=function(e){var t=e.hex,r=e.rgb,o=e.onChange,i=Ue({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:t},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 A.createElement("div",{style:i.fields,className:"flexbox-fix"},A.createElement("div",{style:i.active}),A.createElement(nt,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:t,onChange:s}),A.createElement(nt,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:r.r,onChange:s}),A.createElement(nt,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:r.g,onChange:s}),A.createElement(nt,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:r.b,onChange:s}))},Uf=function(e){var t=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=Ue(An({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?wo(m.hex)&&t({hex:m.hex,source:"hex"},g):t(m,g)};return A.createElement(Pa,{style:d.Compact,styles:l},A.createElement("div",{style:d.compact,className:"compact-picker "+u},A.createElement("div",null,si(o,function(f){return A.createElement(b3,{key:f,color:f,active:f.toLowerCase()===i,onClick:p,onSwatchHover:r})}),A.createElement("div",{style:d.clear})),A.createElement(x3,{hex:i,rgb:s,onChange:p})))};Uf.propTypes={colors:Se.arrayOf(Se.string),styles:Se.object};Uf.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:{}};Pn(Uf);var w3=function(e){var t=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=Ue({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:s}},{hover:t});return A.createElement("div",{style:a.swatch},A.createElement(ii,{color:r,onClick:o,onHover:i,focusStyle:s}))};const C3=Of(w3);var Wf=function(e){var t=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=Ue(An({default:{card:{width:t,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 A.createElement("div",{style:d.card,className:"github-picker "+u},A.createElement("div",{style:d.triangleShadow}),A.createElement("div",{style:d.triangle}),si(r,function(f){return A.createElement(C3,{color:f,key:f,onClick:p,onSwatchHover:i})}))};Wf.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};Wf.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};Pn(Wf);var S3=function(e){var t=e.direction,r=Ue({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:t==="vertical"});return A.createElement("div",{style:r.picker})},k3=Object.assign||function(n){for(var e=1;e.5});return A.createElement("div",{style:r.picker})},O3=function(){var e=Ue({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 A.createElement("div",{style:e.pointer},A.createElement("div",{style:e.left},A.createElement("div",{style:e.leftInside})),A.createElement("div",{style:e.right},A.createElement("div",{style:e.rightInside})))},rv=function(e){var t=e.onClick,r=e.label,o=e.children,i=e.active,s=Ue({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 A.createElement("div",{style:s.button,onClick:t},r||o)},L3=function(e){var t=e.rgb,r=e.currentColor,o=Ue({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+t.r+","+t.g+", "+t.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 A.createElement("div",null,A.createElement("div",{style:o.label},"new"),A.createElement("div",{style:o.swatches},A.createElement("div",{style:o.new}),A.createElement("div",{style:o.current})),A.createElement("div",{style:o.label},"current"))},A3=function(){function n(e,t){for(var r=0;r100&&(u.a=100),u.a/=100,t({h:o.h,s:o.s,l:o.l,a:u.a,source:"rgb"},d))};return A.createElement("div",{style:a.fields,className:"flexbox-fix"},A.createElement("div",{style:a.double},A.createElement(nt,{style:{input:a.input,label:a.label},label:"hex",value:i.replace("#",""),onChange:l})),A.createElement("div",{style:a.single},A.createElement(nt,{style:{input:a.input,label:a.label},label:"r",value:r.r,onChange:l,dragLabel:"true",dragMax:"255"})),A.createElement("div",{style:a.single},A.createElement(nt,{style:{input:a.input,label:a.label},label:"g",value:r.g,onChange:l,dragLabel:"true",dragMax:"255"})),A.createElement("div",{style:a.single},A.createElement(nt,{style:{input:a.input,label:a.label},label:"b",value:r.b,onChange:l,dragLabel:"true",dragMax:"255"})),A.createElement("div",{style:a.alpha},A.createElement(nt,{style:{input:a.input,label:a.label},label:"a",value:Math.round(r.a*100),onChange:l,dragLabel:"true",dragMax:"100"})))},$3=Object.assign||function(n){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}var el=24,V3=kx.default=function(n){var e=n.fill,t=e===void 0?"currentColor":e,r=n.width,o=r===void 0?el:r,i=n.height,s=i===void 0?el:i,a=n.style,l=a===void 0?{}:a,c=H3(n,["fill","width","height","style"]);return iv.default.createElement("svg",ov({viewBox:"0 0 "+el+" "+el,style:ov({fill:t,width:o,height:s},l)},c),iv.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},U3=function(e){var t=e.color,r=e.onClick,o=r===void 0?function(){}:r,i=e.onSwatchHover,s=e.first,a=e.last,l=e.active,c=Ue({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:t,marginBottom:"1px"},check:{color:Bf(t),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":t==="#FFFFFF",transparent:t==="transparent"});return A.createElement(ii,{color:t,style:c.color,onClick:o,onHover:i,focusStyle:{boxShadow:"0 0 4px "+t}},A.createElement("div",{style:c.check},A.createElement(V3,null)))},W3=function(e){var t=e.onClick,r=e.onSwatchHover,o=e.group,i=e.active,s=Ue({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return A.createElement("div",{style:s.group},si(o,function(a,l){return A.createElement(U3,{key:a,color:a,active:a.toLowerCase()===i,first:l===0,last:l===o.length-1,onClick:t,onSwatchHover:r})}))},Jf=function(e){var t=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=Ue(An({default:{picker:{width:t,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 A.createElement("div",{style:p.picker,className:"swatches-picker "+d},A.createElement(Pa,null,A.createElement("div",{style:p.overflow},A.createElement("div",{style:p.body},si(s,function(m){return A.createElement(W3,{key:m.toString(),group:m,active:a,onClick:f,onSwatchHover:i})}),A.createElement("div",{style:p.clear})))))};Jf.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};Jf.defaultProps={width:320,height:240,colors:[[xi[900],xi[700],xi[500],xi[300],xi[100]],[wi[900],wi[700],wi[500],wi[300],wi[100]],[Ci[900],Ci[700],Ci[500],Ci[300],Ci[100]],[Si[900],Si[700],Si[500],Si[300],Si[100]],[ki[900],ki[700],ki[500],ki[300],ki[100]],[Mi[900],Mi[700],Mi[500],Mi[300],Mi[100]],[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]],["#194D33",Ps[700],Ps[500],Ps[300],Ps[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]],[Di[900],Di[700],Di[500],Di[300],Di[100]],[Ri[900],Ri[700],Ri[500],Ri[300],Ri[100]],[Ii[900],Ii[700],Ii[500],Ii[300],Ii[100]],[$i[900],$i[700],$i[500],$i[300],$i[100]],[Ni[900],Ni[700],Ni[500],Ni[300],Ni[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};Pn(Jf);var Zf=function(e){var t=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=Ue(An({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){wo(g)&&t({hex:g,source:"hex"},y)};return A.createElement("div",{style:p.card,className:"twitter-picker "+d},A.createElement("div",{style:p.triangleShadow}),A.createElement("div",{style:p.triangle}),A.createElement("div",{style:p.body},si(i,function(m,g){return A.createElement(ii,{key:g,color:m,hex:m,style:p.swatch,onClick:f,onHover:r,focusStyle:{boxShadow:"0 0 4px "+m}})}),A.createElement("div",{style:p.hash},"#"),A.createElement(nt,{label:null,style:{input:p.input},value:o.replace("#",""),onChange:f}),A.createElement("div",{style:p.clear})))};Zf.propTypes={width:Se.oneOfType([Se.string,Se.number]),triangle:Se.oneOf(["hide","top-left","top-right"]),colors:Se.arrayOf(Se.string),styles:Se.object};Zf.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};Pn(Zf);var Xf=function(e){var t=Ue({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 A.createElement("div",{style:t.picker})};Xf.propTypes={hsl:Se.shape({h:Se.number,s:Se.number,l:Se.number,a:Se.number})};Xf.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var Qf=function(e){var t=Ue({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 A.createElement("div",{style:t.picker})};Qf.propTypes={hsl:Se.shape({h:Se.number,s:Se.number,l:Se.number,a:Se.number})};Qf.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var G3=function(e){var t=e.onChange,r=e.rgb,o=e.hsl,i=e.hex,s=e.hsv,a=function(f,m){if(f.hex)wo(f.hex)&&t({hex:f.hex,source:"hex"},m);else if(f.rgb){var g=f.rgb.split(",");Uu(f.rgb,"rgb")&&t({r:g[0],g:g[1],b:g[2],a:1,source:"rgb"},m)}else if(f.hsv){var y=f.hsv.split(",");Uu(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),t({h:Number(y[0]),s:Number(y[1]),v:Number(y[2]),source:"hsv"},m))}else if(f.hsl){var b=f.hsl.split(",");Uu(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),t({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsl"},m))}},l=Ue({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 A.createElement("div",{style:l.wrap,className:"flexbox-fix"},A.createElement("div",{style:l.fields},A.createElement("div",{style:l.double},A.createElement(nt,{style:{input:l.input,label:l.label},label:"hex",value:i,onChange:a})),A.createElement("div",{style:l.column},A.createElement("div",{style:l.single},A.createElement(nt,{style:{input:l.input2,label:l.label2},label:"rgb",value:c,onChange:a})),A.createElement("div",{style:l.single},A.createElement(nt,{style:{input:l.input2,label:l.label2},label:"hsv",value:d,onChange:a})),A.createElement("div",{style:l.single},A.createElement(nt,{style:{input:l.input2,label:l.label2},label:"hsl",value:u,onChange:a})))))},eh=function(e){var t=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=Ue(An({default:{picker:{width:t,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 A.createElement("div",{style:f.picker,className:"google-picker "+p},A.createElement("div",{style:f.head},l),A.createElement("div",{style:f.swatch}),A.createElement("div",{style:f.saturation},A.createElement(au,{hsl:i,hsv:s,pointer:Xf,onChange:r})),A.createElement("div",{style:f.body},A.createElement("div",{style:f.controls,className:"flexbox-fix"},A.createElement("div",{style:f.hue},A.createElement(ps,{style:f.Hue,hsl:i,radius:"4px",pointer:Qf,onChange:r}))),A.createElement(G3,{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"};Pn(eh);const K3=n=>{let e=n.r.toString(16),t=n.g.toString(16),r=n.b.toString(16),o=Math.round(n.a*255).toString(16);return e.length===1&&(e="0"+e),t.length===1&&(t="0"+t),r.length===1&&(r="0"+r),o.length===1&&(o="0"+o),"#"+e+t+r+o},q3=n=>{const[e,t]=h.useState(null),{fieldDef:r,value:o,onChange:i,onBlur:s,disabled:a,skeleton:l,id:c}=n,[u,d]=h.useState(!1),[p,f]=h.useState(null),m=w=>{d(!u),t(w.currentTarget)},g=()=>{d(!1),t(null),s()},y=w=>{f(w),i(K3(w.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(rM,{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(oM,{id:b,open:u,anchorEl:e,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:v.jsx(B3,{color:o||j.newColors.realTeal[100],onChange:y})})]})},Y3=h.memo(q3),Gu={message:`Please enter a valid ${Cb} date`},Ui={message:`Please enter a valid ${ff} time`},fi={message:"Please also provide a time"};function J3(n,{min:e,max:t}){return e!==void 0&&nt?t:n}function Z3(n){return n<.5?8*n*n*n*n:1-Math.pow(-2*n+2,4)/2}function X3(n){return 1+2.70158*Math.pow(n-1,3)+1.70158*Math.pow(n-1,2)}function Q3(n){return n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2}const eB={easeInOutQuart:Z3,easeOutBack:X3,easeInOutCubic:Q3};function tB(n={}){const e={fn:()=>null,startTimestamp:0,preventNext:!1,valueStart:0,valueEnd:0,duration:0,easing:"easeInOutCubic",onComplete:()=>null},t=a=>{Object.assign(e,a)};t(n);const r=a=>{if(e.preventNext)return;e.startTimestamp||(e.startTimestamp=a);const l=Math.min((a-e.startTimestamp)/e.duration,1),c=Math.floor(eB[e.easing](l)*(e.valueEnd-e.valueStart)+e.valueStart);if(e.fn(c,e),l<1){window.requestAnimationFrame(r);return}e.onComplete&&e.onComplete(),e.preventNext=!0};return{start:(a={})=>{t(a),e.preventNext=!1,e.startTimestamp=0,window.requestAnimationFrame(r)},stop:()=>{e.preventNext=!0},inProgress:()=>!e.preventNext}}function nB(n){return h.useRef(tB(n)).current}const rB=400,oB=1500;function Mx({container:n,onComplete:e,onStop:t}){const r=nB({onComplete:()=>{e&&e(),t&&t()}});h.useEffect(()=>{const{current:i}=n;if(!i)return;const s=()=>{r.stop(),t&&t()};return i.addEventListener("wheel",s,{passive:!0}),()=>i.removeEventListener("wheel",s)},[r,n,t]);const o=h.useCallback(({target:i,offset:s=0})=>{if(!i)return;const{current:a}=n,{scrollTop:l}=a,c=i.getBoundingClientRect(),u=a.getBoundingClientRect(),d=c.top+l-u.top-s,p=a.scrollHeight-u.height,f=l,m=Math.min(d,p);r.start({fn:g=>typeof a.scrollTo=="function"&&a.scrollTo({top:g}),valueStart:f,valueEnd:m,duration:J3(Math.abs(m-f)*.75,{min:rB,max:oB})})},[r,n]);return{animation:r,scrollTo:o}}function iB({refs:n,container:e,threshold:t=.2}){const r=h.useRef(!1),o=h.useRef(wM(()=>r.current=!1,100)),{current:i}=e,{animation:s,scrollTo:a}=Mx({container:e,onStop:()=>{r.current=!1}}),[l,c]=h.useState(0),[u,d]=h.useState(null),p=u!==null?u:l,f=h.useCallback(()=>{let g=0;if(!i||!n)return g;const y=i.getBoundingClientRect();for(let b=0;by.top+y.height*t);b++)g=b;return g},[i,n,t]);h.useEffect(()=>{const g=f();c(g)},[f,n]),h.useEffect(()=>{if(!i)return;const g=()=>{o.current(),r.current||d(null);const y=f();c(y)};return i.addEventListener("scroll",g,{passive:!0}),()=>i.removeEventListener("scroll",g)},[i,f]);const m=h.useCallback(g=>{const[y]=n,b=n[g];if(!y||!b||!i)return;d(g),r.current=!0;const{scrollTop:w}=i,S=i.getBoundingClientRect(),k=y.getBoundingClientRect().top+w-S.top;a({target:b,offset:k})},[i,n,a]);return{animation:s,activeSection:p,setActiveSection:m}}function sB(n,e){const t=[];for(const r of n)e.includes(r)&&t.push(r);return t}function th(n,e){const t=new Set(n),r=new Set(e),o=[...n].filter(a=>!r.has(a)),i=[...e].filter(a=>!t.has(a));return[...o,...i]}function aB(n,e){switch(e.type){case"ADD_ERROR":{const t=Array.isArray(e.error)?e.error:[e.error],r=th(t,n);return r.length?[...n,...r]:n}case"REMOVE_ERROR":{const t=Array.isArray(e.error)?e.error:[e.error],r=sB(t,n);return r.length?n.filter(o=>!r.includes(o)):n}default:throw new Error("useFieldErrors action is not valid")}}function Ex({methods:n,name:e}){const{addValidator:t}=n||{},[r,o]=h.useReducer(aB,[]),i=r[0],s=h.useCallback(l=>{o({type:"ADD_ERROR",error:l})},[o]),a=h.useCallback(l=>{o({type:"REMOVE_ERROR",error:l})},[o]);return h.useEffect(()=>{if(!t)return;const{remove:l}=t({name:e,validator:()=>i&&i.message});return l},[t,i,e]),{addError:s,removeError:a}}function Qd(n,e){Be(2,arguments);var t=Re(n),r=Lt(e);return isNaN(r)?new Date(NaN):(r&&t.setDate(t.getDate()+r),t)}function lB(n,e){Be(2,arguments);var t=Lt(e);return df(n,t*1e3)}var cB=6e4;function uB(n,e){Be(2,arguments);var t=Lt(e);return df(n,t*cB)}var dB=36e5;function pB(n,e){Be(2,arguments);var t=Lt(e);return df(n,t*dB)}function fB(n,e){Be(2,arguments);var t=Lt(e),r=t*7;return Qd(n,r)}function kl(n,e){Be(2,arguments);var t=Re(n),r=Lt(e);if(isNaN(r))return new Date(NaN);if(!r)return t;var o=t.getDate(),i=new Date(t.getTime());i.setMonth(t.getMonth()+r+1,0);var s=i.getDate();return o>=s?i:(t.setFullYear(i.getFullYear(),i.getMonth(),o),t)}function sv(n,e){Be(2,arguments);var t=Lt(e);return kl(n,t*12)}function hB(n,e){Be(2,arguments);var t=Re(n),r=Re(e);return t.getFullYear()-r.getFullYear()}function qs(n,e){Be(2,arguments);var t=Re(n),r=Re(e),o=t.getTime()-r.getTime();return o<0?-1:o>0?1:o}function mB(n,e){Be(2,arguments);var t=Re(n),r=Re(e),o=qs(t,r),i=Math.abs(hB(t,r));t.setFullYear(1584),r.setFullYear(1584);var s=qs(t,r)===-o,a=o*(i-Number(s));return a===0?0:a}function gB(n,e){Be(2,arguments);var t=Re(n),r=Re(e),o=t.getFullYear()-r.getFullYear(),i=t.getMonth()-r.getMonth();return o*12+i}function ep(n){Be(1,arguments);var e=Re(n);return e.setHours(23,59,59,999),e}function tp(n){Be(1,arguments);var e=Re(n),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function vB(n){Be(1,arguments);var e=Re(n);return ep(e).getTime()===tp(e).getTime()}function Tx(n,e){Be(2,arguments);var t=Re(n),r=Re(e),o=qs(t,r),i=Math.abs(gB(t,r)),s;if(i<1)s=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-o*i);var a=qs(t,r)===-o;vB(Re(n))&&i===1&&qs(n,r)===1&&(a=!1),s=o*(i-Number(a))}return s===0?0:s}var av={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},yB="trunc";function Da(n){return n?av[n]:av[yB]}function bB(n,e,t){Be(2,arguments);var r=Tx(n,e)/3;return Da(void 0)(r)}var xB=864e5;function wB(n,e){Be(2,arguments);var t=Xi(n),r=Xi(e),o=t.getTime()-zd(t),i=r.getTime()-zd(r);return Math.round((o-i)/xB)}function lv(n,e){var t=n.getFullYear()-e.getFullYear()||n.getMonth()-e.getMonth()||n.getDate()-e.getDate()||n.getHours()-e.getHours()||n.getMinutes()-e.getMinutes()||n.getSeconds()-e.getSeconds()||n.getMilliseconds()-e.getMilliseconds();return t<0?-1:t>0?1:t}function Ox(n,e){Be(2,arguments);var t=Re(n),r=Re(e),o=lv(t,r),i=Math.abs(wB(t,r));t.setDate(t.getDate()-o*i);var s=+(lv(t,r)===-o),a=o*(i-s);return a===0?0:a}function CB(n,e,t){Be(2,arguments);var r=Ox(n,e)/7;return Da(void 0)(r)}function uu(n,e){return Be(2,arguments),Re(n).getTime()-Re(e).getTime()}function SB(n,e,t){Be(2,arguments);var r=uu(n,e)/eu;return Da(void 0)(r)}function kB(n,e,t){Be(2,arguments);var r=uu(n,e)/Qc;return Da(void 0)(r)}function MB(n,e,t){Be(2,arguments);var r=uu(n,e)/1e3;return Da(void 0)(r)}function EB(n,e){var t;Be(1,arguments);var r=n||{},o=Re(r.start),i=Re(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((t=void 0)!==null&&t!==void 0?t:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;l.getTime()<=s;)a.push(Re(l)),l.setDate(l.getDate()+c),l.setHours(0,0,0,0);return a}function Ku(n,e){var t,r,o,i,s,a,l,c;Be(1,arguments);var u=Xc(),d=Lt((t=(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&&t!==void 0?t:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=Re(n),f=p.getDay(),m=(fr.getTime()}function hi(n,e){Be(2,arguments);var t=Re(n),r=Re(e);return t.getTime()=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=Re(n),f=p.getDay(),m=(f2)return e;if(/:/.test(t[0])?r=t[0]:(e.date=t[0],r=t[1],ol.timeZoneDelimiter.test(e.date)&&(e.date=n.split(ol.timeZoneDelimiter)[0],r=n.substr(e.date.length,n.length))),r){var o=ol.timezone.exec(r);o?(e.time=r.replace(o[1],""),e.timezone=o[1]):e.time=r}return e}function YB(n,e){var t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=n.match(t);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:n.slice((r[1]||r[2]).length)}}function JB(n,e){if(e===null)return new Date(NaN);var t=n.match(WB);if(!t)return new Date(NaN);var r=!!t[4],o=xs(t[1]),i=xs(t[2])-1,s=xs(t[3]),a=xs(t[4]),l=xs(t[5])-1;if(r)return rF(e,a,l)?QB(e,a,l):new Date(NaN);var c=new Date(0);return!tF(e,i,s)||!nF(e,o)?new Date(NaN):(c.setUTCFullYear(e,i,Math.max(o,s)),c)}function xs(n){return n?parseInt(n):1}function ZB(n){var e=n.match(GB);if(!e)return NaN;var t=Ju(e[1]),r=Ju(e[2]),o=Ju(e[3]);return oF(t,r,o)?t*eu+r*Qc+o*1e3:NaN}function Ju(n){return n&&parseFloat(n.replace(",","."))||0}function XB(n){if(n==="Z")return 0;var e=n.match(KB);if(!e)return 0;var t=e[1]==="+"?-1:1,r=parseInt(e[2]),o=e[3]&&parseInt(e[3])||0;return iF(r,o)?t*(r*eu+o*Qc):NaN}function QB(n,e,t){var r=new Date(0);r.setUTCFullYear(n,0,4);var o=r.getUTCDay()||7,i=(e-1)*7+t+1-o;return r.setUTCDate(r.getUTCDate()+i),r}var eF=[31,null,31,30,31,30,31,31,30,31,30,31];function Ax(n){return n%400===0||n%4===0&&n%100!==0}function tF(n,e,t){return e>=0&&e<=11&&t>=1&&t<=(eF[e]||(Ax(n)?29:28))}function nF(n,e){return e>=1&&e<=(Ax(n)?366:365)}function rF(n,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function oF(n,e,t){return n===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&n>=0&&n<25}function iF(n,e){return e>=0&&e<=59}function sF(n,e){var t,r;Be(1,arguments);var o=Re(n);if(isNaN(o.getTime()))throw new RangeError("Invalid time value");var i=String((t=e==null?void 0:e.format)!==null&&t!==void 0?t:"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=Jr(o.getDate(),2),p=Jr(o.getMonth()+1,2),f=Jr(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=Jr(Math.floor(g/60),2),b=Jr(g%60,2),w=m<0?"+":"-";l="".concat(w).concat(y,":").concat(b)}else l="Z";var S=Jr(o.getHours(),2),T=Jr(o.getMinutes(),2),k=Jr(o.getSeconds(),2),x=a===""?"":"T",C=[S,T,k].join(u);a="".concat(a).concat(x).concat(C).concat(l)}return a}function aF(n,e){Be(2,arguments);var t=Re(n).getTime(),r=Re(e.start).getTime(),o=Re(e.end).getTime();if(!(r<=o))throw new RangeError("Invalid interval");return t>=r&&t<=o}var np={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=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 t(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}}",t(d,c)).replace("{{time}}",r(p,c))},i={p:r,P:o},s=i;e.default=s,n.exports=e.default})(np,np.exports);var lF=np.exports;const cF=ef(lF),uF={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 Px{constructor({locale:e,formats:t}={}){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||bb;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=cF[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=>UB(r),this.toISO=r=>sF(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)=>lB(r,o),this.addMinutes=(r,o)=>uB(r,o),this.addHours=(r,o)=>pB(r,o),this.addDays=(r,o)=>Qd(r,o),this.addWeeks=(r,o)=>fB(r,o),this.addMonths=(r,o)=>kl(r,o),this.addYears=(r,o)=>sv(r,o),this.isValid=r=>xb(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 mB(r,a);case"quarters":return bB(r,a);case"months":return Tx(r,a);case"weeks":return CB(r,a);case"days":return Ox(r,a);case"hours":return SB(r,a);case"minutes":return kB(r,a);case"seconds":return MB(r,a);default:return uu(r,a)}},this.isAfter=(r,o)=>tl(r,o),this.isBefore=(r,o)=>hi(r,o),this.startOfDay=r=>Xi(r),this.endOfDay=r=>ep(r),this.getHours=r=>LB(r),this.setHours=(r,o)=>jB(r,o),this.setMinutes=(r,o)=>_B(r,o),this.getSeconds=r=>DB(r),this.setSeconds=(r,o)=>HB(r,o),this.isSameDay=(r,o)=>VM(r,o),this.isSameMonth=(r,o)=>NB(r,o),this.isSameYear=(r,o)=>$B(r,o),this.isSameHour=(r,o)=>BB(r,o),this.startOfYear=r=>rl(r),this.endOfYear=r=>qu(r),this.startOfMonth=r=>nl(r),this.endOfMonth=r=>tp(r),this.startOfWeek=r=>Yu(r,{locale:this.locale}),this.endOfWeek=r=>Ku(r,{locale:this.locale}),this.getYear=r=>RB(r),this.setYear=(r,o)=>VB(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:Fb(r,o,new Date,{locale:this.locale}),this.format=(r,o)=>this.formatByString(r,this.formats[o]),this.formatByString=(r,o)=>Hi(r,o,{locale:this.locale}),this.isEqual=(r,o)=>r===null&&o===null?!0:IB(r,o),this.isNull=r=>r===null,this.isAfterDay=(r,o)=>tl(r,ep(o)),this.isBeforeDay=(r,o)=>hi(r,Xi(o)),this.isBeforeYear=(r,o)=>hi(r,rl(o)),this.isAfterYear=(r,o)=>tl(r,qu(o)),this.isWithinRange=(r,[o,i])=>aF(r,{start:o,end:i}),this.formatNumber=r=>r,this.getMinutes=r=>AB(r),this.getDate=r=>TB(r),this.setDate=(r,o)=>FB(r,o),this.getMonth=r=>PB(r),this.getDaysInMonth=r=>Lx(r),this.setMonth=(r,o)=>zB(r,o),this.getMeridiemText=r=>r==="am"?"AM":"PM",this.getNextMonth=r=>kl(r,1),this.getPreviousMonth=r=>kl(r,-1),this.getMonthArray=r=>{const i=[rl(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 EB({start:Yu(r,{locale:this.locale}),end:Ku(r,{locale:this.locale})}).map(o=>this.formatByString(o,"EEEEEE"))},this.getWeekArray=r=>{const o=Yu(nl(r),{locale:this.locale}),i=Ku(tp(r),{locale:this.locale});let s=0,a=o;const l=[];let c=null;for(;hi(a,i);){const u=Math.floor(s/7);l[u]=l[u]||[];const d=OB(a);c!==d&&(c=d,l[u].push(a),s+=1),a=Qd(a,1)}return l},this.getYearRange=(r,o)=>{const i=rl(r),s=qu(o),a=[];let l=i;for(;hi(l,s);)a.push(l),l=sv(l,1);return a},this.locale=e,this.formats=Object.assign({},uF,t)}isBeforeMonth(e,t){return hi(e,nl(t))}isAfterMonth(e,t){return tl(e,nl(t))}}const dF=n=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:K({},n)}}}}),Dx={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"open previous view",openNextView:"open next view",calendarViewSwitchingButtonAriaLabel:n=>n==="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:(n,e,t)=>`Select ${n}. ${e===null?"No time selected":`Selected time is ${t.format(e,"fullTime")}`}`,hoursClockNumberText:n=>`${n} hours`,minutesClockNumberText:n=>`${n} minutes`,secondsClockNumberText:n=>`${n} seconds`,openDatePickerDialogue:(n,e)=>n&&e.isValid(e.date(n))?`Choose date, selected date is ${e.format(e.date(n),"fullDate")}`:"Choose date",openTimePickerDialogue:(n,e)=>n&&e.isValid(e.date(n))?`Choose time, selected time is ${e.format(e.date(n),"fullTime")}`:"Choose time",timeTableLabel:"pick time",dateTableLabel:"pick date"},pF=Dx;dF(Dx);const Rx=h.createContext(null);function Ix(n){const e=Ur({props:n,name:"MuiLocalizationProvider"}),{children:t,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:K({},pF,l??{})}),[u,c,l]);return v.jsx(Rx.Provider,{value:d,children:t})}const Ra=()=>{const n=h.useContext(Rx);if(n===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 n},_t=()=>Ra().utils,du=()=>Ra().defaultDates,hs=()=>Ra().localeText,Ia=()=>{const n=_t();return h.useRef(n.date()).current},Zu=({date:n,disableFuture:e,disablePast:t,maxDate:r,minDate:o,isDateDisabled:i,utils:s})=>{const a=s.startOfDay(s.date());t&&s.isBefore(o,a)&&(o=a),e&&s.isAfter(r,a)&&(r=a);let l=n,c=n;for(s.isBefore(n,o)&&(l=s.date(o),c=null),s.isAfter(n,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},$x=(n,e)=>{const t=n.date(e);return n.isValid(t)?t:null},Nx=n=>n.length===1&&n[0]==="year",Bx=n=>n.length===2&&n.indexOf("month")!==-1&&n.indexOf("year")!==-1,fF=(n,e)=>Nx(n)?{inputFormat:e.formats.year}:Bx(n)?{disableMaskedInput:!0,inputFormat:e.formats.monthAndYear}:{inputFormat:e.formats.keyboardDate};function hF(n,e){var t;const r=_t(),o=du(),i=Ur({props:n,name:e}),s=(t=i.views)!=null?t:["year","day"];return K({openTo:"day",minDate:o.minDate,maxDate:o.maxDate},fF(s,r),i,{views:s})}const mF={emptyValue:null,getTodayValue:n=>n.date(),parseInput:$x,areValuesEqual:(n,e,t)=>n.isEqual(e,t)};function gF(n){return kn("MuiCollapse",n)}At("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const vF=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],yF=n=>{const{orientation:e,classes:t}=n,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return Mn(r,gF,t)},bF=Me("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[e.root,e[t.orientation],t.state==="entered"&&e.entered,t.state==="exited"&&!t.in&&t.collapsedSize==="0px"&&e.hidden]}})(({theme:n,ownerState:e})=>K({height:0,overflow:"hidden",transition:n.transitions.create("height")},e.orientation==="horizontal"&&{height:"auto",width:0,transition:n.transitions.create("width")},e.state==="entered"&&K({height:"auto",overflow:"visible"},e.orientation==="horizontal"&&{width:"auto"}),e.state==="exited"&&!e.in&&e.collapsedSize==="0px"&&{visibility:"hidden"})),xF=Me("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(n,e)=>e.wrapper})(({ownerState:n})=>K({display:"flex",width:"100%"},n.orientation==="horizontal"&&{width:"auto",height:"100%"})),wF=Me("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(n,e)=>e.wrapperInner})(({ownerState:n})=>K({width:"100%"},n.orientation==="horizontal"&&{width:"auto",height:"100%"})),Fx=h.forwardRef(function(e,t){const r=Qo({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:w,timeout:S=Ok.standard,TransitionComponent:T=mb}=r,k=tt(r,vF),x=K({},r,{orientation:b,collapsedSize:a}),C=yF(x),E=cs(),P=Vk(),O=h.useRef(null),F=h.useRef(),D=typeof a=="number"?`${a}px`:a,U=b==="horizontal",N=U?"width":"height",z=h.useRef(null),_=_r(t,z),$=I=>ie=>{if(I){const te=z.current;ie===void 0?I(te):I(te,ie)}},G=()=>O.current?O.current[U?"clientWidth":"clientHeight"]:0,le=$((I,ie)=>{O.current&&U&&(O.current.style.position="absolute"),I.style[N]=D,d&&d(I,ie)}),Z=$((I,ie)=>{const te=G();O.current&&U&&(O.current.style.position="");const{duration:Q,easing:fe}=Um({style:w,timeout:S,easing:c},{mode:"enter"});if(S==="auto"){const pe=E.transitions.getAutoHeightDuration(te);I.style.transitionDuration=`${pe}ms`,F.current=pe}else I.style.transitionDuration=typeof Q=="string"?Q:`${Q}ms`;I.style[N]=`${te}px`,I.style.transitionTimingFunction=fe,f&&f(I,ie)}),V=$((I,ie)=>{I.style[N]="auto",p&&p(I,ie)}),J=$(I=>{I.style[N]=`${G()}px`,m&&m(I)}),ce=$(g),q=$(I=>{const ie=G(),{duration:te,easing:Q}=Um({style:w,timeout:S,easing:c},{mode:"exit"});if(S==="auto"){const fe=E.transitions.getAutoHeightDuration(ie);I.style.transitionDuration=`${fe}ms`,F.current=fe}else I.style.transitionDuration=typeof te=="string"?te:`${te}ms`;I.style[N]=D,I.style.transitionTimingFunction=Q,y&&y(I)}),M=I=>{S==="auto"&&P.start(F.current||0,I),o&&o(z.current,I)};return v.jsx(T,K({in:u,onEnter:le,onEntered:V,onEntering:Z,onExit:J,onExited:ce,onExiting:q,addEndListener:M,nodeRef:z,timeout:S==="auto"?null:S},k,{children:(I,ie)=>v.jsx(bF,K({as:l,className:_n(C.root,s,{entered:C.entered,exited:!u&&D==="0px"&&C.hidden}[I]),style:K({[U?"minWidth":"minHeight"]:D},w),ref:_},ie,{ownerState:K({},x,{state:I}),children:v.jsx(xF,{ownerState:K({},x,{state:I}),className:C.wrapper,ref:O,children:v.jsx(wF,{ownerState:K({},x,{state:I}),className:C.wrapperInner,children:i})})}))}))});Fx.muiSupportAuto=!0;const jx=h.createContext({}),CF=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],SF=["component","slots","slotProps"],kF=["component"];function MF(n,e){const{className:t,elementType:r,ownerState:o,externalForwardedProps:i,getSlotOwnerState:s,internalForwardedProps:a}=e,l=tt(e,CF),{component:c,slots:u={[n]:void 0},slotProps:d={[n]:void 0}}=i;tt(i,SF);const p=u[n]||r,f=Bk(d[n],o),m=Fk(K({className:t},l,{externalForwardedProps:void 0,externalSlotProps:f})),{props:{component:g},internalRef:y}=m,b=tt(m.props,kF),w=_r(y,f==null?void 0:f.ref,e.ref),S=s?s(b):{},T=K({},o,S),k=g,x=jk(p,K({},n==="root",!u[n]&&a,b,k&&{as:k},{ref:w}),T);return Object.keys(S).forEach(C=>{delete x[C]}),[p,x]}function EF(n){return kn("MuiAccordion",n)}const il=At("MuiAccordion",["root","rounded","expanded","disabled","gutters","region"]),TF=["children","className","defaultExpanded","disabled","disableGutters","expanded","onChange","square","slots","slotProps","TransitionComponent","TransitionProps"],OF=n=>{const{classes:e,square:t,expanded:r,disabled:o,disableGutters:i}=n;return Mn({root:["root",!t&&"rounded",r&&"expanded",o&&"disabled",!i&&"gutters"],region:["region"]},EF,e)},LF=Me(ka,{name:"MuiAccordion",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n;return[{[`& .${il.region}`]:e.region},e.root,!t.square&&e.rounded,!t.disableGutters&&e.gutters]}})(({theme:n})=>{const e={duration:n.transitions.duration.shortest};return{position:"relative",transition:n.transitions.create(["margin"],e),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(n.vars||n).palette.divider,transition:n.transitions.create(["opacity","background-color"],e)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${il.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${il.disabled}`]:{backgroundColor:(n.vars||n).palette.action.disabledBackground}}},({theme:n})=>({variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(n.vars||n).shape.borderRadius,borderTopRightRadius:(n.vars||n).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(n.vars||n).shape.borderRadius,borderBottomRightRadius:(n.vars||n).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${il.expanded}`]:{margin:"16px 0"}}}]})),AF=h.forwardRef(function(e,t){const r=Qo({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,TF),[b,w]=Yi({controlled:c,default:s,name:"Accordion",state:"expanded"}),S=h.useCallback(U=>{w(!b),u&&u(U,!b)},[b,u,w]),[T,...k]=h.Children.toArray(o),x=h.useMemo(()=>({expanded:b,disabled:a,disableGutters:l,toggle:S}),[b,a,l,S]),C=K({},r,{square:d,disabled:a,disableGutters:l,expanded:b}),E=OF(C),P=K({transition:m},p),O=K({transition:g},f),[F,D]=MF("transition",{elementType:Fx,externalForwardedProps:{slots:P,slotProps:O},ownerState:C});return v.jsxs(LF,K({className:_n(E.root,i),ref:t,ownerState:C,square:d},y,{children:[v.jsx(jx.Provider,{value:x,children:T}),v.jsx(F,K({in:b,timeout:"auto"},D,{children:v.jsx("div",{"aria-labelledby":T.props.id,id:T.props["aria-controls"],role:"region",className:E.region,children:k})}))]}))});function PF(n){return kn("MuiAccordionDetails",n)}At("MuiAccordionDetails",["root"]);const DF=["className"],RF=n=>{const{classes:e}=n;return Mn({root:["root"]},PF,e)},IF=Me("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(n,e)=>e.root})(({theme:n})=>({padding:n.spacing(1,2,2)})),$F=h.forwardRef(function(e,t){const r=Qo({props:e,name:"MuiAccordionDetails"}),{className:o}=r,i=tt(r,DF),s=r,a=RF(s);return v.jsx(IF,K({className:_n(a.root,o),ref:t,ownerState:s},i))});function NF(n){return kn("MuiAccordionSummary",n)}const Wi=At("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),BF=["children","className","expandIcon","focusVisibleClassName","onClick"],FF=n=>{const{classes:e,expanded:t,disabled:r,disableGutters:o}=n;return Mn({root:["root",t&&"expanded",r&&"disabled",!o&&"gutters"],focusVisible:["focusVisible"],content:["content",t&&"expanded",!o&&"contentGutters"],expandIconWrapper:["expandIconWrapper",t&&"expanded"]},NF,e)},jF=Me(kb,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(n,e)=>e.root})(({theme:n})=>{const e={duration:n.transitions.duration.shortest};return{display:"flex",minHeight:48,padding:n.spacing(0,2),transition:n.transitions.create(["min-height","background-color"],e),[`&.${Wi.focusVisible}`]:{backgroundColor:(n.vars||n).palette.action.focus},[`&.${Wi.disabled}`]:{opacity:(n.vars||n).palette.action.disabledOpacity},[`&:hover:not(.${Wi.disabled})`]:{cursor:"pointer"},variants:[{props:t=>!t.disableGutters,style:{[`&.${Wi.expanded}`]:{minHeight:64}}}]}}),_F=Me("div",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(n,e)=>e.content})(({theme:n})=>({display:"flex",flexGrow:1,margin:"12px 0",variants:[{props:e=>!e.disableGutters,style:{transition:n.transitions.create(["margin"],{duration:n.transitions.duration.shortest}),[`&.${Wi.expanded}`]:{margin:"20px 0"}}}]})),zF=Me("div",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(n,e)=>e.expandIconWrapper})(({theme:n})=>({display:"flex",color:(n.vars||n).palette.action.active,transform:"rotate(0deg)",transition:n.transitions.create("transform",{duration:n.transitions.duration.shortest}),[`&.${Wi.expanded}`]:{transform:"rotate(180deg)"}})),HF=h.forwardRef(function(e,t){const r=Qo({props:e,name:"MuiAccordionSummary"}),{children:o,className:i,expandIcon:s,focusVisibleClassName:a,onClick:l}=r,c=tt(r,BF),{disabled:u=!1,disableGutters:d,expanded:p,toggle:f}=h.useContext(jx),m=b=>{f&&f(b),l&&l(b)},g=K({},r,{expanded:p,disabled:u,disableGutters:d}),y=FF(g);return v.jsxs(jF,K({focusRipple:!1,disableRipple:!0,disabled:u,component:"div","aria-expanded":p,className:_n(y.root,i),focusVisibleClassName:_n(y.focusVisible,a),onClick:m,ref:t,ownerState:g},c,{children:[v.jsx(_F,{className:y.content,ownerState:g,children:o}),s&&v.jsx(zF,{className:y.expandIconWrapper,ownerState:g,children:s})]}))}),uv=h.createContext();function VF(n){return kn("MuiGrid",n)}const UF=[0,1,2,3,4,5,6,7,8,9,10],WF=["column-reverse","column","row-reverse","row"],GF=["nowrap","wrap-reverse","wrap"],ws=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],ca=At("MuiGrid",["root","container","item","zeroMinWidth",...UF.map(n=>`spacing-xs-${n}`),...WF.map(n=>`direction-xs-${n}`),...GF.map(n=>`wrap-xs-${n}`),...ws.map(n=>`grid-xs-${n}`),...ws.map(n=>`grid-sm-${n}`),...ws.map(n=>`grid-md-${n}`),...ws.map(n=>`grid-lg-${n}`),...ws.map(n=>`grid-xl-${n}`)]),KF=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function Ji(n){const e=parseFloat(n);return`${e}${String(n).replace(String(e),"")||"px"}`}function qF({theme:n,ownerState:e}){let t;return n.breakpoints.keys.reduce((r,o)=>{let i={};if(e[o]&&(t=e[o]),!t)return r;if(t===!0)i={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(t==="auto")i={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=Jc({values:e.columns,breakpoints:n.breakpoints.values}),a=typeof s=="object"?s[o]:s;if(a==null)return r;const l=`${Math.round(t/a*1e8)/1e6}%`;let c={};if(e.container&&e.item&&e.columnSpacing!==0){const u=n.spacing(e.columnSpacing);if(u!=="0px"){const d=`calc(${l} + ${Ji(u)})`;c={flexBasis:d,maxWidth:d}}}i=K({flexBasis:l,flexGrow:0,maxWidth:l},c)}return n.breakpoints.values[o]===0?Object.assign(r,i):r[n.breakpoints.up(o)]=i,r},{})}function YF({theme:n,ownerState:e}){const t=Jc({values:e.direction,breakpoints:n.breakpoints.values});return rf({theme:n},t,r=>{const o={flexDirection:r};return r.indexOf("column")===0&&(o[`& > .${ca.item}`]={maxWidth:"none"}),o})}function _x({breakpoints:n,values:e}){let t="";Object.keys(e).forEach(o=>{t===""&&e[o]!==0&&(t=o)});const r=Object.keys(n).sort((o,i)=>n[o]-n[i]);return r.slice(0,r.indexOf(t))}function JF({theme:n,ownerState:e}){const{container:t,rowSpacing:r}=e;let o={};if(t&&r!==0){const i=Jc({values:r,breakpoints:n.breakpoints.values});let s;typeof i=="object"&&(s=_x({breakpoints:n.breakpoints.values,values:i})),o=rf({theme:n},i,(a,l)=>{var c;const u=n.spacing(a);return u!=="0px"?{marginTop:`-${Ji(u)}`,[`& > .${ca.item}`]:{paddingTop:Ji(u)}}:(c=s)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${ca.item}`]:{paddingTop:0}}})}return o}function ZF({theme:n,ownerState:e}){const{container:t,columnSpacing:r}=e;let o={};if(t&&r!==0){const i=Jc({values:r,breakpoints:n.breakpoints.values});let s;typeof i=="object"&&(s=_x({breakpoints:n.breakpoints.values,values:i})),o=rf({theme:n},i,(a,l)=>{var c;const u=n.spacing(a);return u!=="0px"?{width:`calc(100% + ${Ji(u)})`,marginLeft:`-${Ji(u)}`,[`& > .${ca.item}`]:{paddingLeft:Ji(u)}}:(c=s)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${ca.item}`]:{paddingLeft:0}}})}return o}function XF(n,e,t={}){if(!n||n<=0)return[];if(typeof n=="string"&&!Number.isNaN(Number(n))||typeof n=="number")return[t[`spacing-xs-${String(n)}`]];const r=[];return e.forEach(o=>{const i=n[o];Number(i)>0&&r.push(t[`spacing-${o}-${String(i)}`])}),r}const QF=Me("div",{name:"MuiGrid",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:t}=n,{container:r,direction:o,item:i,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=t;let u=[];r&&(u=XF(s,c,e));const d=[];return c.forEach(p=>{const f=t[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:n})=>K({boxSizing:"border-box"},n.container&&{display:"flex",flexWrap:"wrap",width:"100%"},n.item&&{margin:0},n.zeroMinWidth&&{minWidth:0},n.wrap!=="wrap"&&{flexWrap:n.wrap}),YF,JF,ZF,qF);function ej(n,e){if(!n||n<=0)return[];if(typeof n=="string"&&!Number.isNaN(Number(n))||typeof n=="number")return[`spacing-xs-${String(n)}`];const t=[];return e.forEach(r=>{const o=n[r];if(Number(o)>0){const i=`spacing-${r}-${String(o)}`;t.push(i)}}),t}const tj=n=>{const{classes:e,container:t,direction:r,item:o,spacing:i,wrap:s,zeroMinWidth:a,breakpoints:l}=n;let c=[];t&&(c=ej(i,l));const u=[];l.forEach(p=>{const f=n[p];f&&u.push(`grid-${p}-${String(f)}`)});const d={root:["root",t&&"container",o&&"item",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return Mn(d,VF,e)},nj=h.forwardRef(function(e,t){const r=Qo({props:e,name:"MuiGrid"}),{breakpoints:o}=cs(),i=Lk(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,KF),w=f||m,S=l||m,T=h.useContext(uv),k=u?a||12:T,x={},C=K({},b);o.keys.forEach(O=>{b[O]!=null&&(x[O]=b[O],delete C[O])});const E=K({},i,{columns:k,container:u,direction:d,item:p,rowSpacing:w,columnSpacing:S,wrap:g,zeroMinWidth:y,spacing:m},x,{breakpoints:o.keys}),P=tj(E);return v.jsx(uv.Provider,{value:k,children:v.jsx(QF,K({ownerState:E,className:_n(P.root,s),as:c,ref:t},C))})});function zx(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n))for(e=0;ee.root})(({theme:n,ownerState:e})=>K({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:n.spacing(2,3)},e.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"})),lj=Me(nj,{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(n,e)=>e.content})({flex:1}),cj=Me(xo,{name:"MuiPickersToolbar",slot:"PenIconButton",overridesResolver:(n,e)=>e.penIconButton})({}),uj=n=>n==="clock"?v.jsx(Vx,{color:"inherit"}):v.jsx(Hx,{color:"inherit"});function dj(n,e){return n?`text input view is open, go to ${e} view`:`${e} view is open, go to text input view`}const Ux=h.forwardRef(function(e,t){const{children:r,className:o,getMobileKeyboardInputViewButtonText:i=dj,isLandscape:s,isMobileKeyboardViewOpen:a,landscapeDirection:l="column",toggleMobileKeyboardView:c,toolbarTitle:u,viewType:d="calendar"}=e,p=e;return v.jsxs(aj,{ref:t,className:en(Gi.root,o),ownerState:p,children:[v.jsx(mo,{color:"text.secondary",variant:"overline",children:u}),v.jsxs(lj,{container:!0,justifyContent:"space-between",className:Gi.content,ownerState:p,direction:s?l:"row",alignItems:s?"flex-start":"flex-end",children:[r,v.jsx(cj,{onClick:c,className:en(Gi.penIconButton,s&&Gi.penIconButtonLandscape),ownerState:p,color:"inherit","aria-label":i(a,d),children:a?uj(d):v.jsx(sj,{color:"inherit"})})]})]})}),pj=["parsedValue","isLandscape","isMobileKeyboardViewOpen","onChange","toggleMobileKeyboardView","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],dv=At("MuiDatePickerToolbar",["root","title"]),fj=Me(Ux,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(n,e)=>e.root})({[`& .${Gi.penIconButton}`]:{position:"relative",top:4}}),hj=Me(mo,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(n,e)=>e.title})(({ownerState:n})=>K({},n.isLandscape&&{margin:"auto 16px auto auto"})),mj=h.forwardRef(function(e,t){const{parsedValue:r,isLandscape:o,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,toolbarFormat:a,toolbarPlaceholder:l="––",toolbarTitle:c="Select date",views:u}=e,d=tt(e,pj),p=_t(),f=h.useMemo(()=>r?a?p.formatByString(r,a):Nx(u)?p.format(r,"year"):Bx(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(fj,K({ref:t,toolbarTitle:c,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,isLandscape:o,ownerState:m,className:dv.root},d,{children:v.jsx(hj,{variant:"h4",align:o?"left":"center",ownerState:m,className:dv.title,children:f})}))}),ai=h.createContext(null),Wx=n=>{const{onAccept:e,onClear:t,onCancel:r,onSetToday:o,actions:i}=n,s=h.useContext(ai),a=hs(),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(Ts,{onClick:t,children:a.clearButtonLabel},u);case"cancel":return v.jsx(Ts,{onClick:r,children:a.cancelButtonLabel},u);case"accept":return v.jsx(Ts,{onClick:e,children:a.okButtonLabel},u);case"today":return v.jsx(Ts,{onClick:o,children:a.todayButtonLabel},u);default:return null}});return v.jsx(pM,{children:c})},gj=["onClick","onTouchStart"],vj=Me(ei)(({theme:n})=>({zIndex:n.zIndex.modal})),yj=Me(ka)(({ownerState:n})=>K({transformOrigin:"top center",outline:0},n.placement==="top"&&{transformOrigin:"bottom center"}));function bj(n,e){return e.documentElement.clientWidth{if(!n)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}},[n]);const s=Os(l=>{if(!i.current)return;const c=r.current;r.current=!1;const u=Iu(o.current);if(!o.current||"clientX"in l&&bj(l,u))return;if(t.current){t.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(n){const l=Iu(o.current),c=()=>{t.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",c)}}},[n,s]),h.useEffect(()=>{if(n){const l=Iu(o.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[n,s]),[o,a,a]}const wj=n=>{var e;const{anchorEl:t,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=Dk,TrapFocusProps:g,PaperProps:y={},components:b,componentsProps:w}=n;h.useEffect(()=>{function _($){d&&($.key==="Escape"||$.key==="Esc")&&s()}return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[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[T,k,x]=xj(d,i??s),C=h.useRef(null),E=_r(C,o),P=_r(E,T),O=n,{onClick:F,onTouchStart:D}=y,U=tt(y,gj),N=_=>{_.key==="Escape"&&(_.stopPropagation(),s())},z=(e=b==null?void 0:b.ActionBar)!=null?e:Wx;return v.jsx(vj,K({transition:!0,role:f,open:d,anchorEl:t,ownerState:O,onKeyDown:N},p,{children:({TransitionProps:_,placement:$})=>v.jsx(_k,K({open:d,disableAutoFocus:!0,disableEnforceFocus:f==="tooltip",isEnabled:()=>!0},g,{children:v.jsx(m,K({},_,{children:v.jsxs(yj,K({tabIndex:-1,elevation:8,ref:P,onClick:G=>{k(G),F&&F(G)},onTouchStart:G=>{x(G),D&&D(G)},ownerState:K({},O,{placement:$})},U,{children:[r,v.jsx(z,K({onAccept:l,onClear:a,onCancel:c,onSetToday:u,actions:[]},w==null?void 0:w.actionBar))]}))}))}))}))};function Gx(n){const{children:e,DateInputProps:t,KeyboardDateInputComponent:r,onClear:o,onDismiss:i,onCancel:s,onAccept:a,onSetToday:l,open:c,PopperProps:u,PaperProps:d,TransitionComponent:p,components:f,componentsProps:m}=n,g=h.useRef(null),y=_r(t.inputRef,g);return v.jsxs(ai.Provider,{value:"desktop",children:[v.jsx(r,K({},t,{inputRef:y})),v.jsx(wj,{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 Ao(n,e){return Array.isArray(e)?e.every(t=>n.indexOf(t)!==-1):n.indexOf(e)!==-1}const Kx=(n,e)=>t=>{(t.key==="Enter"||t.key===" ")&&(n(),t.preventDefault(),t.stopPropagation())};function nh({onChange:n,onViewChange:e,openTo:t,view:r,views:o}){var i,s;const[a,l]=Yi({name:"Picker",state:"view",controlled:r,default:t&&Ao(o,t)?t: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";n(m,y&&u?"partial":g),y&&p()},[u,n,p]),nextView:u,previousView:c,openNext:p,openView:a,setOpenView:d}}const Qi=220,lo=36,ua={x:Qi/2,y:Qi/2},qx={x:ua.x,y:0},Cj=qx.x-ua.x,Sj=qx.y-ua.y,kj=n=>n*(180/Math.PI),Yx=(n,e,t)=>{const r=e-ua.x,o=t-ua.y,i=Math.atan2(Cj,Sj)-Math.atan2(r,o);let s=kj(i);s=Math.round(s/n)*n,s%=360;const a=Math.floor(s/n)||0,l=r**2+o**2,c=Math.sqrt(l);return{value:a,distance:c}},Mj=(n,e,t=1)=>{const r=t*6;let{value:o}=Yx(r,n,e);return o=o*t%60,o},Ej=(n,e,t)=>{const{value:r,distance:o}=Yx(30,n,e);let i=r||12;return t?i%=12:oK({width:2,backgroundColor:n.palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},e.toAnimateTransform&&{transition:n.transitions.create(["transform","height"])})),Lj=Me("div")(({theme:n,ownerState:e})=>K({width:4,height:4,backgroundColor:n.palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${lo/2}px)`,border:`${(lo-4)/2}px solid ${n.palette.primary.main}`,boxSizing:"content-box"},e.hasSelected&&{backgroundColor:n.palette.primary.main}));class Jx extends h.Component{constructor(...e){super(...e),this.state={toAnimateTransform:!1,previousType:void 0}}render(){const e=this.props,{className:t,isInner:r,type:o,value:i}=e,s=tt(e,Tj),a=K({},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)*Qi),transform:`rotateZ(${u}deg)`}};return v.jsx(Oj,K({style:l(),className:t,ownerState:a},s,{children:v.jsx(Lj,{ownerState:a})}))}}Jx.getDerivedStateFromProps=(n,e)=>n.type!==e.previousType?{toAnimateTransform:!0,previousType:n.type}:{toAnimateTransform:!1,previousType:n.type};const Aj=Me("div")(({theme:n})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:n.spacing(2)})),Pj=Me("div")({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),Dj=Me("div")(({ownerState:n})=>K({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none"},n.disabled?{}:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}})),Rj=Me("div")(({theme:n})=>({width:6,height:6,borderRadius:"50%",backgroundColor:n.palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),Ij=Me(xo)(({theme:n,ownerState:e})=>K({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,left:8},e.meridiemMode==="am"&&{backgroundColor:n.palette.primary.main,color:n.palette.primary.contrastText,"&:hover":{backgroundColor:n.palette.primary.light}})),$j=Me(xo)(({theme:n,ownerState:e})=>K({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,right:8},e.meridiemMode==="pm"&&{backgroundColor:n.palette.primary.main,color:n.palette.primary.contrastText,"&:hover":{backgroundColor:n.palette.primary.light}}));function Nj(n){const{ampm:e,ampmInClock:t,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}=n,b=n,w=_t(),S=h.useContext(ai),T=h.useRef(!1),k=l(m,f),x=!e&&f==="hours"&&(m<1||m>12),C=($,G)=>{g||y||l($,f)||d($,G)},E=($,G)=>{let{offsetX:le,offsetY:Z}=$;if(le===void 0){const J=$.target.getBoundingClientRect();le=$.changedTouches[0].clientX-J.left,Z=$.changedTouches[0].clientY-J.top}const V=f==="seconds"||f==="minutes"?Mj(le,Z,u):Ej(le,Z,!!e);C(V,G)},P=$=>{T.current=!0,E($,"shallow")},O=$=>{T.current&&(E($,"finish"),T.current=!1)},F=$=>{$.buttons>0&&E($.nativeEvent,"shallow")},D=$=>{T.current&&(T.current=!1),E($.nativeEvent,"finish")},U=h.useMemo(()=>f==="hours"?!0:m%5===0,[f,m]),N=f==="minutes"?u:1,z=h.useRef(null);lf(()=>{r&&z.current.focus()},[r]);const _=$=>{if(!T.current)switch($.key){case"Home":C(0,"partial"),$.preventDefault();break;case"End":C(f==="minutes"?59:23,"partial"),$.preventDefault();break;case"ArrowUp":C(m+N,"partial"),$.preventDefault();break;case"ArrowDown":C(m-N,"partial"),$.preventDefault();break}};return v.jsxs(Aj,{children:[v.jsxs(Pj,{children:[v.jsx(Dj,{onTouchMove:P,onTouchEnd:O,onMouseUp:D,onMouseMove:F,ownerState:{disabled:g}}),!k&&v.jsxs(h.Fragment,{children:[v.jsx(Rj,{}),i&&v.jsx(Jx,{type:f,value:m,isInner:x,hasSelected:U})]}),v.jsx("div",{"aria-activedescendant":p,"aria-label":s(f,i,w),ref:z,role:"listbox",onKeyDown:_,tabIndex:0,children:o})]}),e&&(S==="desktop"||t)&&v.jsxs(h.Fragment,{children:[v.jsx(Ij,{onClick:y?void 0:()=>a("am"),disabled:g||c===null,ownerState:b,children:v.jsx(mo,{variant:"caption",children:"AM"})}),v.jsx($j,{disabled:g||c===null,onClick:y?void 0:()=>a("pm"),ownerState:b,children:v.jsx(mo,{variant:"caption",children:"PM"})})]})]})}const Zx=n=>()=>{},Bj=["className","disabled","index","inner","label","selected"],Jl=At("PrivateClockNumber",["selected","disabled"]),Fj=Me("span")(({theme:n,ownerState:e})=>K({height:lo,width:lo,position:"absolute",left:`calc((100% - ${lo}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:n.palette.text.primary,fontFamily:n.typography.fontFamily,"&:focused":{backgroundColor:n.palette.background.paper},[`&.${Jl.selected}`]:{color:n.palette.primary.contrastText},[`&.${Jl.disabled}`]:{pointerEvents:"none",color:n.palette.text.disabled}},e.inner&&K({},n.typography.body2,{color:n.palette.text.secondary})));function Xx(n){const{className:e,disabled:t,index:r,inner:o,label:i,selected:s}=n,a=tt(n,Bj),l=n,c=r%12/12*Math.PI*2-Math.PI/2,u=(Qi-lo-2)/2*(o?.65:1),d=Math.round(Math.cos(c)*u),p=Math.round(Math.sin(c)*u);return v.jsx(Fj,K({className:en(e,s&&Jl.selected,t&&Jl.disabled),"aria-disabled":t?!0:void 0,"aria-selected":s?!0:void 0,role:"option",style:{transform:`translate(${d}px, ${p+(Qi-lo)/2}px`},ownerState:l},a,{children:i}))}const jj=({ampm:n,date:e,getClockNumberText:t,isDisabled:r,selectedId:o,utils:i})=>{const s=e?i.getHours(e):null,a=[],l=n?1:0,c=n?12:23,u=d=>s===null?!1:n?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=!n&&(d===0||d>12);p=i.formatNumber(p);const m=u(d);a.push(v.jsx(Xx,{id:m?o:void 0,index:d,inner:f,selected:m,disabled:r(d),label:p,"aria-label":t(p)},d))}return a},pv=({utils:n,value:e,isDisabled:t,getClockNumberText:r,selectedId:o})=>{const i=n.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(Xx,{label:a,id:c?o:void 0,index:l+1,inner:!1,disabled:t(s),selected:c,"aria-label":r(a)},s)})},_j=["children","className","components","componentsProps","isLeftDisabled","isLeftHidden","isRightDisabled","isRightHidden","leftArrowButtonText","onLeftClick","onRightClick","rightArrowButtonText"],sl=At("MuiPickersArrowSwitcher",["root","spacer","button"]),zj=Me("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(n,e)=>e.root})({display:"flex"}),Hj=Me("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(n,e)=>e.spacer})(({theme:n})=>({width:n.spacing(3)})),fv=Me(xo,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(n,e)=>e.button})(({ownerState:n})=>K({},n.hidden&&{visibility:"hidden"})),Qx=h.forwardRef(function(e,t){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,_j),b=cs().direction==="rtl",w=(s==null?void 0:s.leftArrowButton)||{},S=(i==null?void 0:i.LeftArrowIcon)||oj,T=(s==null?void 0:s.rightArrowButton)||{},k=(i==null?void 0:i.RightArrowIcon)||ij,x=e;return v.jsxs(zj,K({ref:t,className:en(sl.root,o),ownerState:x},g,{children:[v.jsx(fv,K({as:i==null?void 0:i.LeftArrowButton,size:"small","aria-label":d,title:d,disabled:a,edge:"end",onClick:p},w,{className:en(sl.button,w.className),ownerState:K({},x,w,{hidden:l}),children:b?v.jsx(k,{}):v.jsx(S,{})})),r?v.jsx(mo,{variant:"subtitle1",component:"span",children:r}):v.jsx(Hj,{className:sl.spacer,ownerState:x}),v.jsx(fv,K({as:i==null?void 0:i.RightArrowButton,size:"small","aria-label":m,title:m,edge:"start",disabled:c,onClick:f},T,{className:en(sl.button,T.className),ownerState:K({},x,T,{hidden:u}),children:b?v.jsx(S,{}):v.jsx(k,{})}))]}))}),Vj=(n,e)=>n?e.getHours(n)>=12?"pm":"am":null,rp=(n,e,t)=>t&&(n>=12?"pm":"am")!==e?e==="am"?n-12:n+12:n,Uj=(n,e,t,r)=>{const o=rp(r.getHours(n),e,t);return r.setHours(n,o)},hv=(n,e)=>e.getHours(n)*3600+e.getMinutes(n)*60+e.getSeconds(n),e1=(n=!1,e)=>(t,r)=>n?e.isAfter(t,r):hv(t,e)>hv(r,e);function Wj(n,{disableFuture:e,maxDate:t}){const r=_t();return h.useMemo(()=>{const o=r.date(),i=r.startOfMonth(e&&r.isBefore(o,t)?o:t);return!r.isAfter(i,n)},[e,t,n,r])}function Gj(n,{disablePast:e,minDate:t}){const r=_t();return h.useMemo(()=>{const o=r.date(),i=r.startOfMonth(e&&r.isAfter(o,t)?o:t);return!r.isBefore(i,n)},[e,t,n,r])}function t1(n,e,t){const r=_t(),o=Vj(n,r),i=h.useCallback(s=>{const a=n==null?null:Uj(n,s,!!e,r);t(a,"partial")},[e,n,t,r]);return{meridiemMode:o,handleMeridiemChange:i}}function Kj(n){return kn("MuiClockPicker",n)}At("MuiClockPicker",["root","arrowSwitcher"]);const op=36,rh=2,n1=320,qj=358,oh=Me("div")({overflowX:"hidden",width:n1,maxHeight:qj,display:"flex",flexDirection:"column",margin:"0 auto"}),Yj=n=>{const{classes:e}=n;return Mn({root:["root"],arrowSwitcher:["arrowSwitcher"]},Kj,e)},Jj=Me(oh,{name:"MuiClockPicker",slot:"Root",overridesResolver:(n,e)=>e.root})({display:"flex",flexDirection:"column"}),Zj=Me(Qx,{name:"MuiClockPicker",slot:"ArrowSwitcher",overridesResolver:(n,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),Xj=Zx(),Qj=h.forwardRef(function(e,t){const r=Ur({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:w=1,rightArrowButtonText:S,shouldDisableTime:T,showViewSwitcher:k,onChange:x,view:C,views:E=["hours","minutes"],openTo:P,onViewChange:O,className:F,disabled:D,readOnly:U}=r;Xj({leftArrowButtonText:g,rightArrowButtonText:S,getClockLabelText:d,getHoursClockNumberText:p,getMinutesClockNumberText:f,getSecondsClockNumberText:m});const N=hs(),z=g??N.openPreviousView,_=S??N.openNextView,$=d??N.clockLabelText,G=p??N.hoursClockNumberText,le=f??N.minutesClockNumberText,Z=m??N.secondsClockNumberText,{openView:V,setOpenView:J,nextView:ce,previousView:q,handleChangeAndOpenNext:M}=nh({view:C,views:E,openTo:P,onViewChange:O,onChange:x}),I=Ia(),ie=_t(),te=h.useMemo(()=>c||ie.setSeconds(ie.setMinutes(ie.setHours(I,0),0),0),[c,I,ie]),{meridiemMode:Q,handleMeridiemChange:fe}=t1(te,o,M),pe=h.useCallback((R,oe)=>{const ne=e1(u,ie),de=({start:we,end:ve})=>!(b&&ne(b,ve)||y&&ne(we,y)),he=(we,ve=1)=>we%ve!==0?!1:T?!T(we,oe):!0;switch(oe){case"hours":{const we=rp(R,Q,o),ve=ie.setHours(te,we),me=ie.setSeconds(ie.setMinutes(ve,0),0),ue=ie.setSeconds(ie.setMinutes(ve,59),59);return!de({start:me,end:ue})||!he(we)}case"minutes":{const we=ie.setMinutes(te,R),ve=ie.setSeconds(we,0),me=ie.setSeconds(we,59);return!de({start:ve,end:me})||!he(R,w)}case"seconds":{const we=ie.setSeconds(te,R);return!de({start:we,end:we})||!he(R)}default:throw new Error("not supported")}},[o,te,u,y,Q,b,w,T,ie]),ye=af(),Le=h.useMemo(()=>{switch(V){case"hours":{const R=(oe,ne)=>{const de=rp(oe,Q,o);M(ie.setHours(te,de),ne)};return{onChange:R,value:ie.getHours(te),children:jj({date:c,utils:ie,ampm:o,onChange:R,getClockNumberText:G,isDisabled:oe=>D||pe(oe,"hours"),selectedId:ye})}}case"minutes":{const R=ie.getMinutes(te),oe=(ne,de)=>{M(ie.setMinutes(te,ne),de)};return{value:R,onChange:oe,children:pv({utils:ie,value:R,onChange:oe,getClockNumberText:le,isDisabled:ne=>D||pe(ne,"minutes"),selectedId:ye})}}case"seconds":{const R=ie.getSeconds(te),oe=(ne,de)=>{M(ie.setSeconds(te,ne),de)};return{value:R,onChange:oe,children:pv({utils:ie,value:R,onChange:oe,getClockNumberText:Z,isDisabled:ne=>D||pe(ne,"seconds"),selectedId:ye})}}default:throw new Error("You must provide the type for ClockView")}},[V,ie,c,o,G,le,Z,Q,M,te,pe,ye,D]),Oe=r,B=Yj(Oe);return v.jsxs(Jj,{ref:t,className:en(B.root,F),ownerState:Oe,children:[k&&v.jsx(Zj,{className:B.arrowSwitcher,leftArrowButtonText:z,rightArrowButtonText:_,components:a,componentsProps:l,onLeftClick:()=>J(q),onRightClick:()=>J(ce),isLeftDisabled:!q,isRightDisabled:!ce,ownerState:Oe}),v.jsx(Nj,K({autoFocus:s,date:c,ampmInClock:i,type:V,ampm:o,getClockLabelText:$,minutesStep:w,isTimeDisabled:pe,meridiemMode:Q,handleMeridiemChange:fe,selectedId:ye,disabled:D,readOnly:U},Le))]})}),e5=["disabled","onSelect","selected","value"],ip=At("PrivatePickersMonth",["root","selected"]),t5=Me(mo)(({theme:n})=>K({flex:"1 0 33.33%",display:"flex",alignItems:"center",justifyContent:"center",color:"unset",backgroundColor:"transparent",border:0,outline:0},n.typography.subtitle1,{margin:"8px 0",height:36,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:_l(n.palette.action.active,n.palette.action.hoverOpacity)},"&:disabled":{pointerEvents:"none",color:n.palette.text.secondary},[`&.${ip.selected}`]:{color:n.palette.primary.contrastText,backgroundColor:n.palette.primary.main,"&:focus, &:hover":{backgroundColor:n.palette.primary.dark}}})),n5=n=>{const{disabled:e,onSelect:t,selected:r,value:o}=n,i=tt(n,e5),s=()=>{t(o)};return v.jsx(t5,K({component:"button",type:"button",className:en(ip.root,r&&ip.selected),tabIndex:e?-1:0,onClick:s,onKeyDown:Kx(s),color:r?"primary":void 0,variant:r?"h5":"subtitle1",disabled:e},i))};function r5(n){return kn("MuiMonthPicker",n)}At("MuiMonthPicker",["root"]);const o5=["className","date","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly"],i5=n=>{const{classes:e}=n;return Mn({root:["root"]},r5,e)},s5=Me("div",{name:"MuiMonthPicker",slot:"Root",overridesResolver:(n,e)=>e.root})({width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch",margin:"0 4px"}),a5=h.forwardRef(function(e,t){const r=_t(),o=Ia(),i=du(),s=Ur({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,o5),w=s,S=i5(w),T=l??o,k=r.getMonth(T),x=E=>{const P=r.startOfMonth(d&&r.isAfter(o,f)?o:f),O=r.startOfMonth(u&&r.isBefore(o,p)?o:p);return r.isBefore(E,P)||r.isAfter(E,O)?!0:g?g(E):!1},C=E=>{if(y)return;const P=r.setMonth(T,E);m(P,"finish")};return v.jsx(s5,K({ref:t,className:en(S.root,a),ownerState:w},b,{children:r.getMonthArray(T).map(E=>{const P=r.getMonth(E),O=r.format(E,"monthShort");return v.jsx(n5,{value:P,selected:P===k,onSelect:C,disabled:c||x(E),children:O},O)})}))});function r1(n,e,t){const{value:r,onError:o}=n,i=Ra(),s=h.useRef(null),a=e({adapter:i,value:r,props:n});return h.useEffect(()=>{o&&!t(a,s.current)&&o(a,r),s.current=a},[t,o,s,a,r]),a}const o1=({props:n,value:e,adapter:t})=>{const r=t.utils.date(),o=t.utils.date(e),{shouldDisableDate:i,minDate:s=t.defaultDates.minDate,maxDate:a=t.defaultDates.maxDate,disableFuture:l,disablePast:c}=n;if(o===null)return null;switch(!0){case!t.utils.isValid(e):return"invalidDate";case!!(i&&i(o)):return"shouldDisableDate";case!!(l&&t.utils.isAfterDay(o,r)):return"disableFuture";case!!(c&&t.utils.isBeforeDay(o,r)):return"disablePast";case!!(s&&t.utils.isBeforeDay(o,s)):return"minDate";case!!(a&&t.utils.isAfterDay(o,a)):return"maxDate";default:return null}},i1=({shouldDisableDate:n,minDate:e,maxDate:t,disableFuture:r,disablePast:o})=>{const i=Ra();return h.useCallback(s=>o1({adapter:i,value:s,props:{shouldDisableDate:n,minDate:e,maxDate:t,disableFuture:r,disablePast:o}})!==null,[i,n,e,t,r,o])},l5=(n,e)=>n===e,c5=n=>r1(n,o1,l5),u5=(n,e,t)=>(r,o)=>{switch(o.type){case"changeMonth":return K({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!n});case"finishMonthSwitchingAnimation":return K({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&o.focusedDay!=null&&t.isSameDay(o.focusedDay,r.focusedDay))return r;const i=o.focusedDay!=null&&!e&&!t.isSameMonth(r.currentMonth,o.focusedDay);return K({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:i&&!n,currentMonth:i?t.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:o.focusedDay!=null&&t.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},d5=({date:n,defaultCalendarMonth:e,disableFuture:t,disablePast:r,disableSwitchToMonthOnDayFocus:o=!1,maxDate:i,minDate:s,onMonthChange:a,reduceAnimations:l,shouldDisableDate:c})=>{var u;const d=Ia(),p=_t(),f=h.useRef(u5(!!l,o,p)).current,[m,g]=h.useReducer(f,{isMonthSwitchingAnimating:!1,focusedDay:n||d,currentMonth:p.startOfMonth((u=n??e)!=null?u:d),slideDirection:"left"}),y=h.useCallback(k=>{g(K({type:"changeMonth"},k)),a&&a(k.newMonth)},[a]),b=h.useCallback(k=>{const x=k??d;p.isSameMonth(x,m.currentMonth)||y({newMonth:p.startOfMonth(x),direction:p.isAfterDay(x,m.currentMonth)?"left":"right"})},[m.currentMonth,y,d,p]),w=i1({shouldDisableDate:c,minDate:s,maxDate:i,disableFuture:t,disablePast:r}),S=h.useCallback(()=>{g({type:"finishMonthSwitchingAnimation"})},[]),T=h.useCallback(k=>{w(k)||g({type:"changeFocusedDay",focusedDay:k})},[w]);return{calendarState:m,changeMonth:b,changeFocusedDay:T,isDateDisabled:w,onMonthSwitchingAnimationEnd:S,handleChangeMonth:y}},p5=At("PrivatePickersFadeTransitionGroup",["root"]),mv=500,f5=Me(Mb)({display:"block",position:"relative"}),s1=({children:n,className:e,reduceAnimations:t,transKey:r})=>t?n:v.jsx(f5,{className:en(p5.root,e),children:v.jsx(gb,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:mv,enter:mv/2,exit:0},children:n},r)});function h5(n){return kn("MuiPickersDay",n)}const al=At("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),m5=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDayFocus","onDaySelect","onFocus","onKeyDown","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today"],g5=n=>{const{selected:e,disableMargin:t,disableHighlightToday:r,today:o,outsideCurrentMonth:i,showDaysOutsideCurrentMonth:s,classes:a}=n;return Mn({root:["root",e&&"selected",!t&&"dayWithMargin",!r&&o&&"today",i&&s&&"dayOutsideMonth"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},h5,a)},a1=({theme:n,ownerState:e})=>K({},n.typography.caption,{width:op,height:op,borderRadius:"50%",padding:0,backgroundColor:n.palette.background.paper,color:n.palette.text.primary,"&:hover":{backgroundColor:_l(n.palette.action.active,n.palette.action.hoverOpacity)},"&:focus":{backgroundColor:_l(n.palette.action.active,n.palette.action.hoverOpacity),[`&.${al.selected}`]:{willChange:"background-color",backgroundColor:n.palette.primary.dark}},[`&.${al.selected}`]:{color:n.palette.primary.contrastText,backgroundColor:n.palette.primary.main,fontWeight:n.typography.fontWeightMedium,transition:n.transitions.create("background-color",{duration:n.transitions.duration.short}),"&:hover":{willChange:"background-color",backgroundColor:n.palette.primary.dark}},[`&.${al.disabled}`]:{color:n.palette.text.disabled}},!e.disableMargin&&{margin:`0 ${rh}px`},e.outsideCurrentMonth&&e.showDaysOutsideCurrentMonth&&{color:n.palette.text.secondary},!e.disableHighlightToday&&e.today&&{[`&:not(.${al.selected})`]:{border:`1px solid ${n.palette.text.secondary}`}}),l1=(n,e)=>{const{ownerState:t}=n;return[e.root,!t.disableMargin&&e.dayWithMargin,!t.disableHighlightToday&&t.today&&e.today,!t.outsideCurrentMonth&&t.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,t.outsideCurrentMonth&&!t.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},v5=Me(kb,{name:"MuiPickersDay",slot:"Root",overridesResolver:l1})(a1),y5=Me("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:l1})(({theme:n,ownerState:e})=>K({},a1({theme:n,ownerState:e}),{visibility:"hidden"})),b5=()=>{},x5=h.forwardRef(function(e,t){const r=Ur({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=b5,onDaySelect:f,onFocus:m,onKeyDown:g,outsideCurrentMonth:y,selected:b=!1,showDaysOutsideCurrentMonth:w=!1,children:S,today:T=!1}=r,k=tt(r,m5),x=K({},r,{autoFocus:o,disabled:a,disableHighlightToday:l,disableMargin:c,selected:b,showDaysOutsideCurrentMonth:w,today:T}),C=g5(x),E=_t(),P=h.useRef(null),O=_r(P,t);lf(()=>{o&&!a&&!u&&!y&&P.current.focus()},[o,a,u,y]);const F=z=>{p&&p(s),m&&m(z)},D=z=>{a||f(s,"finish"),d&&d(z)},U=cs();function N(z){switch(g!==void 0&&g(z),z.key){case"ArrowUp":p(E.addDays(s,-7)),z.preventDefault();break;case"ArrowDown":p(E.addDays(s,7)),z.preventDefault();break;case"ArrowLeft":p(E.addDays(s,U.direction==="ltr"?-1:1)),z.preventDefault();break;case"ArrowRight":p(E.addDays(s,U.direction==="ltr"?1:-1)),z.preventDefault();break;case"Home":p(E.startOfWeek(s)),z.preventDefault();break;case"End":p(E.endOfWeek(s)),z.preventDefault();break;case"PageUp":p(E.getNextMonth(s)),z.preventDefault();break;case"PageDown":p(E.getPreviousMonth(s)),z.preventDefault();break}}return y&&!w?v.jsx(y5,{className:en(C.root,C.hiddenDaySpacingFiller,i),ownerState:x}):v.jsx(v5,K({className:en(C.root,i),ownerState:x,ref:O,centerRipple:!0,disabled:a,"aria-label":S?void 0:E.format(s,"fullDate"),tabIndex:b?0:-1,onFocus:F,onKeyDown:N,onClick:D},k,{children:S||E.format(s,"dayOfMonth")}))}),w5=(n,e)=>n.autoFocus===e.autoFocus&&n.isAnimating===e.isAnimating&&n.today===e.today&&n.disabled===e.disabled&&n.selected===e.selected&&n.disableMargin===e.disableMargin&&n.showDaysOutsideCurrentMonth===e.showDaysOutsideCurrentMonth&&n.disableHighlightToday===e.disableHighlightToday&&n.className===e.className&&n.outsideCurrentMonth===e.outsideCurrentMonth&&n.onDayFocus===e.onDayFocus&&n.onDaySelect===e.onDaySelect,C5=h.memo(x5,w5),S5=["children","className","reduceAnimations","slideDirection","transKey"],nr=At("PrivatePickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),c1=350,k5=Me(Mb)(({theme:n})=>{const e=n.transitions.create("transform",{duration:c1,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},[`& .${nr["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${nr["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${nr.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${nr.slideExit}`]:{transform:"translate(0%)"},[`& .${nr["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${nr["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}}),M5=n=>{let{children:e,className:t,reduceAnimations:r,slideDirection:o,transKey:i}=n,s=tt(n,S5);if(r)return v.jsx("div",{className:en(nr.root,t),children:e});const a={exit:nr.slideExit,enterActive:nr.slideEnterActive,enter:nr[`slideEnter-${o}`],exitActive:nr[`slideExitActiveLeft-${o}`]};return v.jsx(k5,{className:en(nr.root,t),childFactory:l=>h.cloneElement(l,{classNames:a}),children:v.jsx(yf,K({mountOnEnter:!0,unmountOnExit:!0,timeout:c1,classNames:a},s,{children:e}),i)})},u1=(op+rh*2)*6,E5=Me("div")({display:"flex",justifyContent:"center",alignItems:"center"}),T5=Me(mo)(({theme:n})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:n.palette.text.secondary})),O5=Me("div")({display:"flex",justifyContent:"center",alignItems:"center",minHeight:u1}),L5=Me(M5)({minHeight:u1}),A5=Me("div")({overflow:"hidden"}),P5=Me("div")({margin:`${rh}px 0`,display:"flex",justifyContent:"center"});function D5(n){const e=Ia(),t=_t(),{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:w=()=>v.jsx("span",{children:"..."}),showDaysOutsideCurrentMonth:S,slideDirection:T,TransitionProps:k,disablePast:x,disableFuture:C,minDate:E,maxDate:P,shouldDisableDate:O}=n,F=i1({shouldDisableDate:O,minDate:E,maxDate:P,disablePast:x,disableFuture:C}),D=h.useCallback(($,G="finish")=>{g||f($,G)},[f,g]),U=t.getMonth(s),N=a.filter($=>!!$).map($=>t.startOfDay($)),z=U,_=h.useMemo(()=>h.createRef(),[z]);return v.jsxs(h.Fragment,{children:[v.jsx(E5,{children:t.getWeekdays().map(($,G)=>v.jsx(T5,{"aria-hidden":!0,variant:"caption",children:$.charAt(0).toUpperCase()},$+G.toString()))}),p?v.jsx(O5,{children:w()}):v.jsx(L5,K({transKey:z,onExited:m,reduceAnimations:y,slideDirection:T,className:i},k,{nodeRef:_,children:v.jsx(A5,{ref:_,role:"grid",children:t.getWeekArray(s).map($=>v.jsx(P5,{role:"row",children:$.map(G=>{const le={key:G==null?void 0:G.toString(),day:G,isAnimating:d,disabled:l||F(G),autoFocus:r&&u!==null&&t.isSameDay(G,u),today:t.isSameDay(G,e),outsideCurrentMonth:t.getMonth(G)!==U,selected:N.some(Z=>t.isSameDay(Z,G)),disableHighlightToday:c,showDaysOutsideCurrentMonth:S,onDayFocus:o,onDaySelect:D};return b?b(G,N,le):v.jsx("div",{role:"cell",children:v.jsx(C5,K({},le))},le.key)})},`week-${$[0]}`))})}))]})}const R5=Me("div")({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),I5=Me("div")(({theme:n})=>K({display:"flex",maxHeight:30,overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},n.typography.body1,{fontWeight:n.typography.fontWeightMedium})),$5=Me("div")({marginRight:6}),N5=Me(xo)({marginRight:"auto"}),B5=Me(rj)(({theme:n,ownerState:e})=>K({willChange:"transform",transition:n.transitions.create("transform"),transform:"rotate(0deg)"},e.openView==="year"&&{transform:"rotate(180deg)"})),F5=Zx();function j5(n){const{components:e={},componentsProps:t={},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}=n;F5({leftArrowButtonText:l,rightArrowButtonText:g,getViewSwitchingButtonText:a});const b=hs(),w=l??b.previousMonth,S=g??b.nextMonth,T=a??b.calendarViewSwitchingButtonAriaLabel,k=_t(),x=t.switchViewButton||{},C=()=>d(k.getNextMonth(r),"left"),E=()=>d(k.getPreviousMonth(r),"right"),P=Wj(r,{disableFuture:i,maxDate:c}),O=Gj(r,{disablePast:s,minDate:u}),F=()=>{if(!(y.length===1||!p||o))if(y.length===2)p(y.find(U=>U!==f)||y[0]);else{const U=y.indexOf(f)!==0?0:1;p(y[U])}};if(y.length===1&&y[0]==="year")return null;const D=n;return v.jsxs(R5,{ownerState:D,children:[v.jsxs(I5,{role:"presentation",onClick:F,ownerState:D,children:[v.jsx(s1,{reduceAnimations:m,transKey:k.format(r,"monthAndYear"),children:v.jsx($5,{"aria-live":"polite",ownerState:D,children:k.format(r,"monthAndYear")})}),y.length>1&&!o&&v.jsx(N5,K({size:"small",as:e.SwitchViewButton,"aria-label":T(f)},x,{children:v.jsx(B5,{as:e.SwitchViewIcon,ownerState:D})}))]}),v.jsx(gb,{in:f==="day",children:v.jsx(Qx,{leftArrowButtonText:w,rightArrowButtonText:S,components:e,componentsProps:t,onLeftClick:E,onRightClick:C,isLeftDisabled:O,isRightDisabled:P})})]})}function _5(n){return kn("PrivatePickersYear",n)}const gv=At("PrivatePickersYear",["root","modeMobile","modeDesktop","yearButton","disabled","selected"]),z5=n=>{const{wrapperVariant:e,disabled:t,selected:r,classes:o}=n,i={root:["root",e&&`mode${Sa(e)}`],yearButton:["yearButton",t&&"disabled",r&&"selected"]};return Mn(i,_5,o)},H5=Me("div")(({ownerState:n})=>K({flexBasis:"33.3%",display:"flex",alignItems:"center",justifyContent:"center"},(n==null?void 0:n.wrapperVariant)==="desktop"&&{flexBasis:"25%"})),V5=Me("button")(({theme:n})=>K({color:"unset",backgroundColor:"transparent",border:0,outline:0},n.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:_l(n.palette.action.active,n.palette.action.hoverOpacity)},[`&.${gv.disabled}`]:{color:n.palette.text.secondary},[`&.${gv.selected}`]:{color:n.palette.primary.contrastText,backgroundColor:n.palette.primary.main,"&:focus, &:hover":{backgroundColor:n.palette.primary.dark}}})),U5=h.forwardRef(function(e,t){const{autoFocus:r,className:o,children:i,disabled:s,onClick:a,onKeyDown:l,selected:c,value:u}=e,d=h.useRef(null),p=_r(d,t),f=h.useContext(ai),m=K({},e,{wrapperVariant:f}),g=z5(m);return h.useEffect(()=>{r&&d.current.focus()},[r]),v.jsx(H5,{className:en(g.root,o),ownerState:m,children:v.jsx(V5,{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 W5(n){return kn("MuiYearPicker",n)}At("MuiYearPicker",["root"]);const G5=n=>{const{classes:e}=n;return Mn({root:["root"]},W5,e)},K5=Me("div",{name:"MuiYearPicker",slot:"Root",overridesResolver:(n,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",margin:"0 4px"}),q5=h.forwardRef(function(e,t){const r=Ia(),o=cs(),i=_t(),s=du(),a=Ur({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:w}=a,S=a,T=G5(S),k=u||r,x=i.getYear(k),C=h.useContext(ai),E=h.useRef(null),[P,O]=h.useState(x),F=h.useCallback(_=>!!(f&&i.isBeforeYear(_,r)||p&&i.isAfterYear(_,r)||g&&i.isBeforeYear(_,g)||m&&i.isAfterYear(_,m)||w&&w(_)),[p,f,m,g,r,w,i]),D=(_,$,G="finish")=>{if(b)return;const le=i.setYear(k,$);y(le,G)},U=h.useCallback(_=>{F(i.setYear(k,_))||O(_)},[k,F,i]),N=C==="desktop"?4:3,z=(_,$)=>{switch(_.key){case"ArrowUp":U($-N),_.preventDefault();break;case"ArrowDown":U($+N),_.preventDefault();break;case"ArrowLeft":U($+(o.direction==="ltr"?-1:1)),_.preventDefault();break;case"ArrowRight":U($+(o.direction==="ltr"?1:-1)),_.preventDefault();break}};return v.jsx(K5,{ref:t,className:en(T.root,c),ownerState:S,children:i.getYearRange(g,m).map(_=>{const $=i.getYear(_),G=$===x;return v.jsx(U5,{selected:G,value:$,onClick:D,onKeyDown:z,autoFocus:l&&$===P,ref:G?E:void 0,disabled:d||F(_),children:i.format(_,"year")},i.format(_,"year"))})})}),Y5=typeof navigator<"u"&&/(android)/i.test(navigator.userAgent),J5=n=>kn("MuiCalendarPicker",n);At("MuiCalendarPicker",["root","viewTransitionContainer"]);const Z5=["autoFocus","onViewChange","date","disableFuture","disablePast","defaultCalendarMonth","loading","onChange","onYearChange","onMonthChange","reduceAnimations","renderLoading","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate"],X5=n=>{const{classes:e}=n;return Mn({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},J5,e)},Q5=Me(oh,{name:"MuiCalendarPicker",slot:"Root",overridesResolver:(n,e)=>e.root})({display:"flex",flexDirection:"column"}),e_=Me(s1,{name:"MuiCalendarPicker",slot:"ViewTransitionContainer",overridesResolver:(n,e)=>e.viewTransitionContainer})({overflowY:"auto"}),t_=h.forwardRef(function(e,t){const r=_t(),o=du(),i=Ur({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=Y5,renderLoading:b=()=>v.jsx("span",{children:"..."}),shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:T,view:k,views:x=["year","day"],openTo:C="day",className:E,disabled:P,readOnly:O,minDate:F=o.minDate,maxDate:D=o.maxDate}=i,U=tt(i,Z5),{openView:N,setOpenView:z,openNext:_}=nh({view:k,views:x,openTo:C,onChange:f,onViewChange:a}),{calendarState:$,changeFocusedDay:G,changeMonth:le,handleChangeMonth:Z,isDateDisabled:V,onMonthSwitchingAnimationEnd:J}=d5({date:l,defaultCalendarMonth:d,reduceAnimations:y,onMonthChange:g,minDate:F,maxDate:D,shouldDisableDate:w,disablePast:u,disableFuture:c}),ce=h.useCallback((pe,ye)=>{const Le=r.startOfMonth(pe),Oe=r.endOfMonth(pe),B=V(pe)?Zu({utils:r,date:pe,minDate:r.isBefore(F,Le)?Le:F,maxDate:r.isAfter(D,Oe)?Oe:D,disablePast:u,disableFuture:c,isDateDisabled:V}):pe;B?(f(B,ye),g==null||g(Le)):(_(),le(Le)),G(B)},[G,c,u,V,D,F,f,g,le,_,r]),q=h.useCallback((pe,ye)=>{const Le=r.startOfYear(pe),Oe=r.endOfYear(pe),B=V(pe)?Zu({utils:r,date:pe,minDate:r.isBefore(F,Le)?Le:F,maxDate:r.isAfter(D,Oe)?Oe:D,disablePast:u,disableFuture:c,isDateDisabled:V}):pe;B?(f(B,ye),m==null||m(B)):(_(),le(Le)),G(B)},[G,c,u,V,D,F,f,m,_,r,le]),M=h.useCallback((pe,ye)=>f(l&&pe?r.mergeDateAndTime(pe,l):pe,ye),[r,l,f]);h.useEffect(()=>{if(l&&V(l)){const pe=Zu({utils:r,date:l,minDate:F,maxDate:D,disablePast:u,disableFuture:c,isDateDisabled:V});f(pe,"partial")}},[]),h.useEffect(()=>{l&&le(l)},[l]);const I=i,ie=X5(I),te={disablePast:u,disableFuture:c,maxDate:D,minDate:F},Q=P&&l||F,fe=P&&l||D;return v.jsxs(Q5,{ref:t,className:en(ie.root,E),ownerState:I,children:[v.jsx(j5,K({},U,{views:x,openView:N,currentMonth:$.currentMonth,onViewChange:z,onMonthChange:(pe,ye)=>Z({newMonth:pe,direction:ye}),minDate:Q,maxDate:fe,disabled:P,disablePast:u,disableFuture:c,reduceAnimations:y})),v.jsx(e_,{reduceAnimations:y,className:ie.viewTransitionContainer,transKey:N,ownerState:I,children:v.jsxs("div",{children:[N==="year"&&v.jsx(q5,K({},U,te,{autoFocus:s,date:l,onChange:q,shouldDisableYear:T,disabled:P,readOnly:O})),N==="month"&&v.jsx(a5,K({},te,{className:E,date:l,onChange:ce,disabled:P,readOnly:O,shouldDisableMonth:S})),N==="day"&&v.jsx(D5,K({},U,$,te,{autoFocus:s,onMonthSwitchingAnimationEnd:J,onFocusedDayChange:G,reduceAnimations:y,selectedDays:[l],onSelectedDaysChange:M,loading:p,renderLoading:b,disabled:P,readOnly:O,shouldDisableDate:w}))]})})]})}),n_=n=>{const[,e]=h.useReducer(l=>l+1,0),t=h.useRef(null),{replace:r,append:o}=n,i=r?r(n.format(n.value)):n.format(n.value),s=h.useRef(!1),a=l=>{const c=l.target.value;t.current=[c,l.target,c.length>i.length,s.current,i===n.format(c)],e()};return h.useLayoutEffect(()=>{if(t.current==null)return;let[l,c,u,d,p]=t.current;t.current=null;const f=d&&p,g=l.slice(c.selectionStart).search(n.accept||/\d/g),y=g!==-1?g:0,b=x=>(x.match(n.accept||/\d/g)||[]).join(""),w=b(l.substr(0,c.selectionStart)),S=x=>{let C=0,E=0;for(let P=0;P!==w.length;++P){let O=x.indexOf(w[P],C)+1,F=b(x).indexOf(w[P],E)+1;F-E>1&&(O=C,F=E),E=Math.max(F,E),C=Math.max(C,O)}return C};if(n.mask===!0&&u&&!p){let x=S(l);const C=b(l.substr(x))[0];x=l.indexOf(C,x),l=`${l.substr(0,x)}${l.substr(x+1)}`}let T=n.format(l);o!=null&&c.selectionStart===l.length&&!p&&(u?T=o(T):b(T.slice(-1))===""&&(T=T.slice(0,-1)));const k=r?r(T):T;return i===k?e():n.onChange(k),()=>{let x=S(T);if(n.mask!=null&&(u||d&&!f))for(;T[x]&&b(T[x])==="";)x+=1;c.selectionStart=c.selectionEnd=x+(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:t.current!=null?t.current[0]:i,onChange:a}},sp=(n,e,t)=>{const r=n.date(e);return e===null?"":n.isValid(r)?n.formatByString(r,t):""},Zl="_",d1="2019-11-21T22:30:00.000",p1="2019-01-01T09:00:00.000";function r_(n,e,t,r){if(n)return n;const i=r.formatByString(r.date(p1),e).replace(t,Zl),s=r.formatByString(r.date(d1),e).replace(t,"_");return i===s?i:""}function o_(n,e,t,r){if(!n)return!1;const i=r.formatByString(r.date(p1),e).replace(t,Zl),s=r.formatByString(r.date(d1),e).replace(t,"_"),a=s===i&&n===s;return!a&&r.lib,a}const i_=(n,e)=>t=>{let r=0;return t.split("").map((o,i)=>{if(e.lastIndex=0,r>n.length-1)return"";const s=n[r],a=n[r+1],l=e.test(o)?o:"",c=s===Zl?l:s+l;return r+=c.length,i===t.length-1&&a&&a!==Zl?c?c+a:"":c}).join("")},s_=({acceptRegex:n=/[\d]/gi,disabled:e,disableMaskedInput:t,ignoreInvalidInputs:r,inputFormat:o,inputProps:i,label:s,mask:a,onChange:l,rawValue:c,readOnly:u,rifmFormatter:d,TextFieldProps:p,validationError:f})=>{const m=_t(),g=m.getFormatHelperText(o),{shouldUseMaskedInput:y,maskToUse:b}=h.useMemo(()=>{if(t)return{shouldUseMaskedInput:!1,maskToUse:""};const D=r_(a,o,n,m);return{shouldUseMaskedInput:o_(D,o,n,m),maskToUse:D}},[n,t,o,a,m]),w=h.useMemo(()=>y&&b?i_(b,n):D=>D,[n,b,y]),S=c===null?null:m.date(c),[T,k]=h.useState(S),[x,C]=h.useState(sp(m,c,o)),E=h.useRef();h.useEffect(()=>{const D=c!==E.current;if(E.current=c,!D)return;const U=c===null?null:m.date(c);if(!(c===null||m.isValid(U))||m.isEqual(T,U))return;const z=sp(m,c,o);k(U),C(z)},[m,c,o,T]);const P=D=>{const U=D===""||D===a?"":D;C(U);const N=U===null?null:m.parse(U,o);r&&!m.isValid(N)||(k(N),l(N,U||void 0))},O=n_({value:x,onChange:P,format:d||w});return K({label:s,disabled:e,error:f,inputProps:K({},y?O:{value:x,onChange:D=>{P(D.currentTarget.value)}},{disabled:e,placeholder:g,readOnly:u,type:y?"tel":"text"},i)},p)},a_=["components","disableOpenPicker","getOpenDialogAriaText","InputAdornmentProps","InputProps","inputRef","openPicker","OpenPickerButtonProps","renderInput"],ih=h.forwardRef(function(e,t){const{components:r={},disableOpenPicker:o,getOpenDialogAriaText:i,InputAdornmentProps:s,InputProps:a,inputRef:l,openPicker:c,OpenPickerButtonProps:u,renderInput:d}=e,p=tt(e,a_),f=hs(),m=i??f.openDatePickerDialogue,g=_t(),y=s_(p),b=(s==null?void 0:s.position)||"end",w=r.OpenPickerIcon||Hx;return d(K({ref:t,inputRef:l},y,{InputProps:K({},a,{[`${b}Adornment`]:o?void 0:v.jsx(sa,K({position:b},s,{children:v.jsx(xo,K({edge:b,disabled:p.disabled||p.readOnly,"aria-label":m(p.rawValue,g)},u,{onClick:c,children:v.jsx(w,{})}))}))})}))});function vv(){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 l_=(n,e)=>{const[t,r]=h.useState(vv);return lf(()=>{const i=()=>{r(vv())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),Ao(n,["hours","minutes","seconds"])?!1:(e||t)==="landscape"},c_=["autoFocus","className","parsedValue","DateInputProps","isMobileKeyboardViewOpen","onDateChange","onViewChange","openTo","orientation","showToolbar","toggleMobileKeyboardView","ToolbarComponent","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],u_=Me("div")({padding:"16px 24px"}),d_=Me("div")(({ownerState:n})=>K({display:"flex",flexDirection:"column"},n.isLandscape&&{flexDirection:"row"})),p_={fullWidth:!0},yv=n=>n==="year"||n==="month"||n==="day",bv=n=>n==="hours"||n==="minutes"||n==="seconds";function sh(n){const{autoFocus:e,parsedValue:t,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}=n,y=tt(n,c_),b=l_(g,l),w=h.useContext(ai),S=c??w!=="desktop",T=h.useCallback((P,O)=>{i(P,w,O)},[i,w]),k=h.useCallback(P=>{o&&u(),s&&s(P)},[o,s,u]),{openView:x,setOpenView:C,handleChangeAndOpenNext:E}=nh({view:void 0,views:g,openTo:a,onChange:T,onViewChange:k});return v.jsxs(d_,{ownerState:{isLandscape:b},children:[S&&v.jsx(d,K({},y,{views:g,isLandscape:b,parsedValue:t,onChange:T,setOpenView:C,openView:x,toolbarTitle:m,toolbarFormat:p,toolbarPlaceholder:f,isMobileKeyboardViewOpen:o,toggleMobileKeyboardView:u})),v.jsx(oh,{children:o?v.jsx(u_,{children:v.jsx(ih,K({},r,{ignoreInvalidInputs:!0,disableOpenPicker:!0,TextFieldProps:p_}))}):v.jsxs(h.Fragment,{children:[yv(x)&&v.jsx(t_,K({autoFocus:e,date:t,onViewChange:C,onChange:E,view:x,views:g.filter(yv)},y)),bv(x)&&v.jsx(Qj,K({},y,{autoFocus:e,date:t,view:x,views:g.filter(bv),onChange:E,onViewChange:C,showViewSwitcher:w==="desktop"}))]})})]})}const f_=({open:n,onOpen:e,onClose:t})=>{const r=h.useRef(typeof n=="boolean").current,[o,i]=h.useState(!1);h.useEffect(()=>{if(r){if(typeof n!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(n)}},[r,n]);const s=h.useCallback(a=>{r||i(a),a&&e&&e(),!a&&t&&t()},[r,e,t]);return{isOpen:o,setIsOpen:s}},ah=(n,e)=>{const{onAccept:t,onChange:r,value:o,closeOnSelect:i}=n,s=_t(),{isOpen:a,setIsOpen:l}=f_(n),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(x=>{f(C=>{switch(x.action){case"setAll":case"acceptAndClose":return{draft:x.value,committed:x.value,resetFallback:x.value};case"setCommitted":return K({},C,{draft:x.value,committed:x.value});case"setDraft":return K({},C,{draft:x.value});default:return C}}),!x.skipOnChangeCall&&!e.areValuesEqual(s,p.committed,x.value)&&r(x.value),x.action==="acceptAndClose"&&(l(!1),t&&!e.areValuesEqual(s,p.resetFallback,x.value)&&t(x.value))},[t,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),w=h.useMemo(()=>({parsedValue:p.draft,isMobileKeyboardViewOpen:y,toggleMobileKeyboardView:()=>b(!y),onDateChange:(x,C,E="partial")=>{switch(E){case"shallow":return m({action:"setDraft",value:x,skipOnChangeCall:!0});case"partial":return m({action:"setDraft",value:x});case"finish":return m(i??C==="desktop"?{value:x,action:"acceptAndClose"}:{value:x,action:"setCommitted"});default:throw new Error("MUI: Invalid selectionState passed to `onDateChange`")}}}),[m,y,p.draft,i]),S=h.useCallback((x,C)=>{const E=e.valueReducer?e.valueReducer(s,u,x):x;r(E,C)},[r,e,u,s]),T=h.useMemo(()=>({onChange:S,open:a,rawValue:o,openPicker:()=>l(!0)}),[S,a,o,l]),k={pickerProps:w,inputProps:T,wrapperProps:g};return h.useDebugValue(k,()=>({MuiPickerState:{dateState:p,other:k}})),k},h_=["onChange","PopperProps","PaperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps"],m_=h.forwardRef(function(e,t){const r=hF(e,"MuiDesktopDatePicker"),o=c5(r)!==null,{pickerProps:i,inputProps:s,wrapperProps:a}=ah(r,mF),{PopperProps:l,PaperProps:c,ToolbarComponent:u=mj,TransitionComponent:d,components:p,componentsProps:f}=r,m=tt(r,h_),g=K({},s,m,{components:p,componentsProps:f,ref:t,validationError:o});return v.jsx(Gx,K({},a,{DateInputProps:g,KeyboardDateInputComponent:ih,PopperProps:l,PaperProps:c,TransitionComponent:d,components:p,componentsProps:f,children:v.jsx(sh,K({},i,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:g,components:p,componentsProps:f},m))}))}),g_={"& .MuiPaper-root":{border:`2px solid ${j.newColors.grey2[100]}`,boxShadow:"0px 1px 5px rgba(26, 26, 26, 0.161)"},"& .MuiPickersDay-today":{color:`${j.newColors.realTeal[100]} !important`,border:"none !important",fontFamily:j.fontFamily,fontWeight:j.fontWeight.bold,backgroundColor:"transparent !important","&:hover":{color:j.newColors.realTeal[100],backgroundColor:`${j.colors.tealOpacity} !important`}},"& .MuiPickersDay-dayWithMargin":{color:j.newColors.almostBlack[100],fontFamily:j.fontFamily,"&:hover":{color:j.newColors.realTeal[100],backgroundColor:j.colors.tealOpacity,fontWeight:j.fontWeight.bold}},"& .MuiIconButton-edgeStart, .MuiIconButton-edgeEnd":{color:j.newColors.grey4[100]},"& .MuiPickersDay-root.Mui-selected":{backgroundColor:`${j.newColors.realTeal[100]} !important`,color:"#FFFF !important",fontWeight:j.fontWeight.bold,"&:hover":{color:"#FFFF !important",backgroundColor:`${j.newColors.realTeal[100]} !important`}},"& .MuiCalendarPicker-root > div:first-of-type":{marginBottom:"16px",paddingLeft:"16px",paddingRight:"16px"}},f1=Y.div` + min-width: 0; + + .MuiOutlinedInput-root { + padding-right: 16px; + + & fieldset { + border-radius: 0; + border: ${({$isPickerOpen:n})=>n?`1px solid ${j.newColors.almostBlack[100]}`:j.borders.simplyGrey}; + } + + ${({$disabled:n})=>n?` + background-color: ${j.colors.disableBackground}; + `:` + background-color: ${j.newColors.grey1[100]}; + &:hover { + & fieldset { + border-color: ${j.newColors.simplyGrey[100]}; + } + } + `} + + &.Mui-disabled fieldset.MuiOutlinedInput-notchedOutline{ + border-color: ${j.colors.disableBorder}; + } + + .MuiOutlinedInput-input { + height: ${j.fieldSpecs.inputText.height}; + padding: ${j.fieldSpecs.inputText.padding}; + } + + &.Mui-focused fieldset { + border-color: ${j.newColors.almostBlack[100]}; + border-width: 1px; + } + } + + .MuiIconButton-root { + color: ${({$isPickerOpen:n})=>n?j.newColors.almostBlack[100]:j.newColors.grey3[100]}; + } +`,v_=Y(tf)` + width: 100%; +`,y_=n=>{var p,f;const{fieldDef:e,onChange:t,value:r=null,onBlur:o,disabled:i,inputRef:s,id:a}=n,[l,c]=h.useState(!1),u=async()=>{c(!l),l&&o&&o()},d=m=>{var g;return v.jsx(v_,{...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(Ix,{dateAdapter:Px,children:v.jsx(f1,{"data-testid":"date-picker-test-id",$isPickerOpen:l,$disabled:i,children:v.jsx(m_,{renderInput:d,inputFormat:Vi,value:r,onChange:t,onOpen:u,onClose:u,PopperProps:{sx:g_},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})})})};function h1(n,e){var t;const r=Ur({props:n,name:e}),o=_t(),i=(t=r.ampm)!=null?t:o.is12HourCycleInCurrentLocale(),a=hs().openTimePickerDialogue;return K({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:K({OpenPickerIcon:Vx},r.components)})}const m1={emptyValue:null,parseInput:$x,getTodayValue:n=>n.date(),areValuesEqual:(n,e,t)=>n.isEqual(e,t),valueReducer:(n,e,t)=>!e||!n.isValid(t)?t:n.mergeDateAndTime(e,t)},b_=["className","selected","value"],g1=At("PrivatePickersToolbarText",["selected"]),x_=Me(mo)(({theme:n})=>({transition:n.transitions.create("color"),color:n.palette.text.secondary,[`&.${g1.selected}`]:{color:n.palette.text.primary}})),v1=h.forwardRef(function(e,t){const{className:r,selected:o,value:i}=e,s=tt(e,b_);return v.jsx(x_,K({ref:t,className:en(r,o&&g1.selected),component:"span"},s,{children:i}))}),w_=["align","className","selected","typographyClassName","value","variant"],C_=Me(Ts)({padding:0,minWidth:16,textTransform:"none"}),Cs=h.forwardRef(function(e,t){const{align:r,className:o,selected:i,typographyClassName:s,value:a,variant:l}=e,c=tt(e,w_);return v.jsx(C_,K({variant:"text",ref:t,className:o},c,{children:v.jsx(v1,{align:r,className:s,variant:l,value:a,selected:i})}))});function S_(n){return kn("MuiTimePickerToolbar",n)}const k_=At("MuiTimePickerToolbar",["root","separator","hourMinuteLabel","hourMinuteLabelLandscape","hourMinuteLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),M_=["ampm","ampmInClock","parsedValue","isLandscape","isMobileKeyboardViewOpen","onChange","openView","setOpenView","toggleMobileKeyboardView","toolbarTitle","views","disabled","readOnly"],E_=n=>{const{theme:e,isLandscape:t,classes:r}=n,o={root:["root"],separator:["separator"],hourMinuteLabel:["hourMinuteLabel",t&&"hourMinuteLabelLandscape",e.direction==="rtl"&&"hourMinuteLabelReverse"],ampmSelection:["ampmSelection",t&&"ampmLandscape"],ampmLabel:["ampmLabel"]};return Mn(o,S_,r)},T_=Me(Ux,{name:"MuiTimePickerToolbar",slot:"Root",overridesResolver:(n,e)=>e.root})({[`& .${Gi.penIconButtonLandscape}`]:{marginTop:"auto"}}),O_=Me(v1,{name:"MuiTimePickerToolbar",slot:"Separator",overridesResolver:(n,e)=>e.separator})({outline:0,margin:"0 4px 0 2px",cursor:"default"}),L_=Me("div",{name:"MuiTimePickerToolbar",slot:"HourMinuteLabel",overridesResolver:(n,e)=>e.hourMinuteLabel})(({theme:n,ownerState:e})=>K({display:"flex",justifyContent:"flex-end",alignItems:"flex-end"},e.isLandscape&&{marginTop:"auto"},n.direction==="rtl"&&{flexDirection:"row-reverse"})),A_=Me("div",{name:"MuiTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(n,e)=>e.ampmSelection})(({ownerState:n})=>K({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12},n.isLandscape&&{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",flexBasis:"100%"},{[`& .${k_.ampmLabel}`]:{fontSize:17}})),y1=n=>{const{ampm:e,ampmInClock:t,parsedValue:r,isLandscape:o,isMobileKeyboardViewOpen:i,onChange:s,openView:a,setOpenView:l,toggleMobileKeyboardView:c,toolbarTitle:u="Select time",views:d,disabled:p,readOnly:f}=n,m=tt(n,M_),g=_t(),y=cs(),b=!!(e&&!t),{meridiemMode:w,handleMeridiemChange:S}=t1(r,e,s),T=E=>e?g.format(E,"hours12h"):g.format(E,"hours24h"),k=n,x=E_(K({},k,{theme:y})),C=v.jsx(O_,{tabIndex:-1,value:":",variant:"h3",selected:!1,className:x.separator});return v.jsxs(T_,K({viewType:"clock",landscapeDirection:"row",toolbarTitle:u,isLandscape:o,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:c,ownerState:k,className:x.root},m,{children:[v.jsxs(L_,{className:x.hourMinuteLabel,ownerState:k,children:[Ao(d,"hours")&&v.jsx(Cs,{tabIndex:-1,variant:"h3",onClick:()=>l("hours"),selected:a==="hours",value:r?T(r):"--"}),Ao(d,["hours","minutes"])&&C,Ao(d,"minutes")&&v.jsx(Cs,{tabIndex:-1,variant:"h3",onClick:()=>l("minutes"),selected:a==="minutes",value:r?g.format(r,"minutes"):"--"}),Ao(d,["minutes","seconds"])&&C,Ao(d,"seconds")&&v.jsx(Cs,{variant:"h3",onClick:()=>l("seconds"),selected:a==="seconds",value:r?g.format(r,"seconds"):"--"})]}),b&&v.jsxs(A_,{className:x.ampmSelection,ownerState:k,children:[v.jsx(Cs,{disableRipple:!0,variant:"subtitle2",selected:w==="am",typographyClassName:x.ampmLabel,value:g.getMeridiemText("am"),onClick:f?void 0:()=>S("am"),disabled:p}),v.jsx(Cs,{disableRipple:!0,variant:"subtitle2",selected:w==="pm",typographyClassName:x.ampmLabel,value:g.getMeridiemText("pm"),onClick:f?void 0:()=>S("pm"),disabled:p})]})]}))},P_=({adapter:n,value:e,props:t})=>{const{minTime:r,maxTime:o,minutesStep:i,shouldDisableTime:s,disableIgnoringDatePartForTimeValidation:a}=t,l=n.utils.date(e),c=e1(a,n.utils);if(e===null)return null;switch(!0){case!n.utils.isValid(e):return"invalidDate";case!!(r&&c(r,l)):return"minTime";case!!(o&&c(l,o)):return"maxTime";case!!(s&&s(n.utils.getHours(l),"hours")):return"shouldDisableTime-hours";case!!(s&&s(n.utils.getMinutes(l),"minutes")):return"shouldDisableTime-minutes";case!!(s&&s(n.utils.getSeconds(l),"seconds")):return"shouldDisableTime-seconds";case!!(i&&n.utils.getMinutes(l)%i!==0):return"minutesStep";default:return null}},D_=(n,e)=>n===e,b1=n=>r1(n,P_,D_),R_=["onChange","PaperProps","PopperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps"],I_=h.forwardRef(function(e,t){const r=h1(e,"MuiDesktopTimePicker"),o=b1(r)!==null,{pickerProps:i,inputProps:s,wrapperProps:a}=ah(r,m1),{PaperProps:l,PopperProps:c,ToolbarComponent:u=y1,TransitionComponent:d,components:p,componentsProps:f}=r,m=tt(r,R_),g=K({},s,m,{components:p,componentsProps:f,ref:t,validationError:o});return v.jsx(Gx,K({},a,{DateInputProps:g,KeyboardDateInputComponent:ih,PopperProps:c,PaperProps:l,TransitionComponent:d,components:p,componentsProps:f,children:v.jsx(sh,K({},i,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:g,components:p,componentsProps:f},m))}))}),$_=Me(fM)({[`& .${qm.container}`]:{outline:0},[`& .${qm.paper}`]:{outline:0,minWidth:n1}}),N_=Me(hM)({"&:first-of-type":{padding:0}}),B_=n=>{var e;const{children:t,DialogProps:r={},onAccept:o,onClear:i,onDismiss:s,onCancel:a,onSetToday:l,open:c,components:u,componentsProps:d}=n,p=(e=u==null?void 0:u.ActionBar)!=null?e:Wx;return v.jsxs($_,K({open:c,onClose:s},r,{children:[v.jsx(N_,{children:t}),v.jsx(p,K({onAccept:o,onClear:i,onCancel:a,onSetToday:l,actions:["cancel","accept"]},d==null?void 0:d.actionBar))]}))},F_=["children","DateInputProps","DialogProps","onAccept","onClear","onDismiss","onCancel","onSetToday","open","PureDateInputComponent","components","componentsProps"];function j_(n){const{children:e,DateInputProps:t,DialogProps:r,onAccept:o,onClear:i,onDismiss:s,onCancel:a,onSetToday:l,open:c,PureDateInputComponent:u,components:d,componentsProps:p}=n,f=tt(n,F_);return v.jsxs(ai.Provider,{value:"mobile",children:[v.jsx(u,K({components:d},f,t)),v.jsx(B_,{DialogProps:r,onAccept:o,onClear:i,onDismiss:s,onCancel:a,onSetToday:l,open:c,components:d,componentsProps:p,children:e})]})}const __=h.forwardRef(function(e,t){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=hs(),g=o??m.openDatePickerDialogue,y=_t(),b=h.useMemo(()=>K({},s,{readOnly:!0}),[s]),w=sp(y,u,i);return d(K({label:l,disabled:r,ref:t,inputRef:a,error:f,InputProps:b,inputProps:K({disabled:r,readOnly:!0,"aria-readonly":!0,"aria-label":g(u,y),value:w},!e.readOnly&&{onClick:c},{onKeyDown:Kx(c)})},p))}),z_=["ToolbarComponent","value","onChange","components","componentsProps"],H_=h.forwardRef(function(e,t){const r=h1(e,"MuiMobileTimePicker"),o=b1(r)!==null,{pickerProps:i,inputProps:s,wrapperProps:a}=ah(r,m1),{ToolbarComponent:l=y1,components:c,componentsProps:u}=r,d=tt(r,z_),p=K({},s,d,{components:c,componentsProps:u,ref:t,validationError:o});return v.jsx(j_,K({},d,a,{DateInputProps:p,PureDateInputComponent:__,components:c,componentsProps:u,children:v.jsx(sh,K({},i,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:l,DateInputProps:p,components:c,componentsProps:u},d))}))}),V_=["desktopModeMediaQuery","DialogProps","PopperProps","TransitionComponent"],U_=h.forwardRef(function(e,t){const r=Ur({props:e,name:"MuiTimePicker"}),{desktopModeMediaQuery:o="@media (pointer: fine)",DialogProps:i,PopperProps:s,TransitionComponent:a}=r,l=tt(r,V_);return gM(o)?v.jsx(I_,K({ref:t,PopperProps:s,TransitionComponent:a},l)):v.jsx(H_,K({ref:t,DialogProps:i},l))}),W_=Ak({palette:{primary:{main:j.newColors.realTeal[100]}}}),x1=n=>{const{fieldDef:e,onChange:t,value:r=null,onBlur:o,disabled:i,inputRef:s,id:a}=n,[l,c]=h.useState(!1),u=h.useCallback(async()=>{c(p=>(p&&o&&o(),!p))},[o]),d=p=>{var f;return v.jsx(tf,{...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(Ix,{dateAdapter:Px,children:v.jsx(HM,{theme:W_,children:v.jsx(f1,{$isPickerOpen:l,$disabled:i,children:v.jsx(U_,{value:r,onChange:t,renderInput:d,onOpen:u,onClose:u,disabled:i})})})})},xv=Y.div` + display: flex; + flex-direction: column; +`,w1=Y.div` + ${({$hasTimeField:n})=>n&&` + display: grid; + grid-template-columns: repeat(1,minmax(0,1fr)); + gap: 24px 12px; + + ${Nt("sm","FORM_COL")} { + grid-template-columns: repeat(2,minmax(0,1fr)); + } + `} +`;function G_({showTime:n}){return v.jsxs(w1,{$hasTimeField:n,children:[v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}),n&&v.jsx(Xe,{variant:"rectangular",width:"100%",height:43})]})}const K_=n=>{const{fieldDef:e,onChange:t,value:r,onBlur:o,disabled:i,error:s,methods:a,inputRef:l,skeleton:c,id:u}=n,{inputSettings:{showTime:d,minDate:p,maxDate:f,defaultTime:m}={}}=e,g=h.useRef({date:!1,time:!1}),y=h.useRef(!1),b=h.useMemo(()=>r||{validDate:!1,validTime:!1},[r]),{addError:w,removeError:S}=Ex({methods:a,name:e.name}),T=C=>async()=>{g.current[C]=!0,g.current.date&&(!d||g.current.time)&&o()},k=async(C,E)=>{const P=Ud(E,Vi),O=C&&!E;if(d&&C&&!b.validTime?w(fi):S(fi),O||E&&P){S(Gu);const F={...b,date:C,validDate:!0};if(!b.validTime&&m){S([Ui,fi]);const D=Vd(new Date,KE(m));F.time=D,F.validTime=!0,y.current=!0}t(F,{validate:!0})}else{E&&!P?w(Gu):S(Gu);const F={...b,date:C,validDate:!1};y.current&&(F.time=void 0,F.validTime=!1),t(F,{validate:!0})}},x=async(C,E)=>{const P=E!==void 0,O=Ud(E,Sb);b.date&&!C?(S(Ui),w(fi),t({...b,time:C,validTime:!1},{validate:!0})):P&&!O?(S(fi),w(Ui),t({...b,time:C,validTime:!1},{validate:!0})):(y.current=!1,S([fi,Ui]),t({...b,time:C,validTime:!!C},{validate:!0}))};return c?v.jsx(G_,{showTime:d}):v.jsxs(w1,{$hasTimeField:d,children:[v.jsx(xv,{children:v.jsx(y_,{id:u,error:s,onChange:k,fieldDef:{name:e==null?void 0:e.name,label:"",type:"",inputSettings:{placeholder:Cb,minDate:p,maxDate:f},required:e==null?void 0:e.required},value:b==null?void 0:b.date,onBlur:T("date"),disabled:i,inputRef:l})}),d&&v.jsx(xv,{children:v.jsx(x1,{id:`${e==null?void 0:e.name}-time`,error:s,onChange:x,fieldDef:{name:e==null?void 0:e.name,label:"",type:"timePicker",inputSettings:{placeholder:ff}},value:b==null?void 0:b.time,onBlur:T("time"),disabled:i})})]})},q_=h.memo(K_),Y_=n=>{const{fieldDef:e,onChange:t,value:r={validTime:!1},onBlur:o,disabled:i,error:s,methods:a,inputRef:l,id:c,skeleton:u}=n,{addError:d,removeError:p}=Ex({methods:a,name:e.name}),f=async(m,g)=>{const y=g!==void 0,b=Ud(g,Sb);if(y&&!b||!m){m&&d(Ui),t({...r,time:m,validTime:!1});return}else p([Ui]),t({...r,time:m,validTime:!0})};return u?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(x1,{id:c,error:s,onChange:f,fieldDef:{name:e==null?void 0:e.name,label:"",type:"timePicker",inputSettings:{placeholder:ff}},value:r==null?void 0:r.time,onBlur:o,disabled:i,inputRef:l})},J_=h.memo(Y_);var co={},lh={},Z_="Expected a function",wv=NaN,X_="[object Symbol]",Q_=/^\s+|\s+$/g,e4=/^[-+]0x[0-9a-f]+$/i,t4=/^0b[01]+$/i,n4=/^0o[0-7]+$/i,r4=parseInt,o4=typeof Ja=="object"&&Ja&&Ja.Object===Object&&Ja,i4=typeof self=="object"&&self&&self.Object===Object&&self,s4=o4||i4||Function("return this")(),a4=Object.prototype,l4=a4.toString,c4=Math.max,u4=Math.min,Xu=function(){return s4.Date.now()};function d4(n,e,t){var r,o,i,s,a,l,c=0,u=!1,d=!1,p=!0;if(typeof n!="function")throw new TypeError(Z_);e=Cv(e)||0,ap(t)&&(u=!!t.leading,d="maxWait"in t,i=d?c4(Cv(t.maxWait)||0,e):i,p="trailing"in t?!!t.trailing:p);function f(x){var C=r,E=o;return r=o=void 0,c=x,s=n.apply(E,C),s}function m(x){return c=x,a=setTimeout(b,e),u?f(x):s}function g(x){var C=x-l,E=x-c,P=e-C;return d?u4(P,i-E):P}function y(x){var C=x-l,E=x-c;return l===void 0||C>=e||C<0||d&&E>=i}function b(){var x=Xu();if(y(x))return w(x);a=setTimeout(b,g(x))}function w(x){return a=void 0,p&&r?f(x):(r=o=void 0,s)}function S(){a!==void 0&&clearTimeout(a),c=0,r=l=o=a=void 0}function T(){return a===void 0?s:w(Xu())}function k(){var x=Xu(),C=y(x);if(r=arguments,o=this,l=x,C){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=T,k}function ap(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function p4(n){return!!n&&typeof n=="object"}function f4(n){return typeof n=="symbol"||p4(n)&&l4.call(n)==X_}function Cv(n){if(typeof n=="number")return n;if(f4(n))return wv;if(ap(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=ap(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=n.replace(Q_,"");var t=t4.test(n);return t||n4.test(n)?r4(n.slice(2),t?2:8):e4.test(n)?wv:+n}var h4=d4,pu={};Object.defineProperty(pu,"__esModule",{value:!0});pu.compose=function(){for(var e=arguments.length,t=Array(e),r=0;r1?t-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 mi({},i,o,{onKeyDown:(0,Ir.compose)(r.handleInputKeyDown,o.onKeyDown),onBlur:(0,Ir.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 mi({},i,{key:o.id,id:r.getActiveSuggestionId(),role:"option",onMouseEnter:(0,Ir.compose)(s,i.onMouseEnter),onMouseLeave:(0,Ir.compose)(r.handleSuggestionMouseLeave,i.onMouseLeave),onMouseDown:(0,Ir.compose)(r.handleSuggestionMouseDown,i.onMouseDown),onMouseUp:(0,Ir.compose)(r.handleSuggestionMouseUp,i.onMouseUp),onTouchStart:(0,Ir.compose)(r.handleSuggestionTouchStart,i.onTouchStart),onTouchEnd:(0,Ir.compose)(r.handleSuggestionMouseUp,i.onTouchEnd),onClick:(0,Ir.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:t.value,ready:!t.googleCallbackName},r.debouncedFetchPredictions=(0,x4.default)(r.fetchPredictions,t.debounce),r}return m4(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}(v4.default.Component);uh.propTypes={onChange:Vt.default.func.isRequired,value:Vt.default.string.isRequired,children:Vt.default.func.isRequired,onError:Vt.default.func,onSelect:Vt.default.func,searchOptions:Vt.default.shape({bounds:Vt.default.object,componentRestrictions:Vt.default.object,location:Vt.default.object,offset:Vt.default.oneOfType([Vt.default.number,Vt.default.string]),radius:Vt.default.oneOfType([Vt.default.number,Vt.default.string]),types:Vt.default.array}),debounce:Vt.default.number,highlightFirstSuggestion:Vt.default.bool,shouldFetchSuggestions:Vt.default.bool,googleCallbackName:Vt.default.string};uh.defaultProps={onError:function(e,t){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};lh.default=uh;var $a={};Object.defineProperty($a,"__esModule",{value:!0});$a.geocodeByAddress=function(e){var t=new window.google.maps.Geocoder,r=window.google.maps.GeocoderStatus.OK;return new Promise(function(o,i){t.geocode({address:e},function(s,a){a!==r&&i(a),o(s)})})};$a.getLatLng=function(e){return new Promise(function(t,r){try{var o={lat:e.geometry.location.lat(),lng:e.geometry.location.lng()};t(o)}catch(i){r(i)}})};$a.geocodeByPlaceId=function(e){var t=new window.google.maps.Geocoder,r=window.google.maps.GeocoderStatus.OK;return new Promise(function(o,i){t.geocode({placeId:e},function(s,a){a!==r&&i(a),o(s)})})};Object.defineProperty(co,"__esModule",{value:!0});var C1=co.getLatLng=co.geocodeByPlaceId=ph=co.geocodeByAddress=void 0,M4=lh,E4=T4(M4),dh=$a;function T4(n){return n&&n.__esModule?n:{default:n}}var ph=co.geocodeByAddress=dh.geocodeByAddress;co.geocodeByPlaceId=dh.geocodeByPlaceId;C1=co.getLatLng=dh.getLatLng;var O4=co.default=E4.default;function Xl(){return{internalData:{},data:{},errors:{},disabled:!0,touched:{},submitWarning:{open:!1,lead:"",reasons:[]},waits:[],loadingInitial:!0}}function L4(){return{...Xl(),initialData:{},fields:{},mounted:{},internalValidators:{},hasBlurred:{},moveToError:!1,loadingInitial:!0}}function A4(n){return Object.keys(n).reduce((t,r)=>({...t,[r]:!0}),{})}function ll(n,e){if(n===null||e===null||n===void 0||e===void 0)return!1;const t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(const o of t)if(n[o]!==e[o])return!1;return!0}function P4(n,e){switch(e.type){case"SET_FIELD_ERRORS":return{...n,errors:e.merge?{...n.errors,...e.errors}:e.errors};case"SET_FIELD_VALUES":{const t=A4(e.values),r={data:e.merge?{...n.data,...e.values}:e.values,internalData:e.merge?{...n.internalData,...e.internalValues}:e.internalValues,touched:e.touched?e.merge?{...n.touched,...t}:t:n.touched},o={...n,data:ll(r.data,n.data)?n.data:r.data,internalData:ll(r.internalData,n.internalData)?n.internalData:r.internalData,touched:ll(r.touched,n.touched)?n.touched:r.touched,loadingInitial:e.loadingInitial!==void 0?e.loadingInitial:n.loadingInitial,disabled:e.disabled!==void 0?e.disabled:n.disabled};return ll(o,n)?n:o}case"SET_FORM_WAITS":return{...n,waits:e.waits};case"RESET":return{...Xl(),data:e.data,internalData:e.internalData,disabled:!1,loadingInitial:!1};case"FORM_DISABLE":return{...n,disabled:e.disabled,loadingInitial:e.loadingInitial!==void 0?e.loadingInitial:n.loadingInitial};case"FIELD_TOUCHED":return!!n.touched[e.name]===e.value?n:{...n,touched:{...n.touched,[e.name]:e.value}};case"FIELD_VALIDATE":return{...n,errors:{...n.errors,[e.name]:e.value}};case"FIELD_UNVALIDATE":return{...n,errors:{...n.errors,[e.name]:void 0}};case"FORM_START_DISABLE":return{...n,disabled:e.value};case"FORM_END_DISABLE":return{...n,disabled:e.value};case"FORM_RESET":return{...n,data:{},errors:{},disabled:!1};case"SET_SUBMIT_WARNING":return{...n,submitWarning:{...e}};default:return n}}var H;(function(n){n.UK="UK",n.GB="GB",n.JE="JE",n.GG="GG",n.IM="IM",n.US="US",n.CA="CA",n.IE="IE",n.DE="DE",n.JP="JP",n.FR="FR",n.AU="AU",n.IT="IT",n.CH="CH",n.AT="AT",n.ES="ES",n.NL="NL",n.BE="BE",n.DK="DK",n.SE="SE",n.NO="NO",n.BR="BR",n.PT="PT",n.FI="FI",n.AX="AX",n.KR="KR",n.CN="CN",n.TW="TW",n.SG="SG",n.DZ="DZ",n.AD="AD",n.AR="AR",n.AM="AM",n.AZ="AZ",n.BH="BH",n.BD="BD",n.BB="BB",n.BY="BY",n.BM="BM",n.BA="BA",n.IO="IO",n.BN="BN",n.BG="BG",n.KH="KH",n.CV="CV",n.CL="CL",n.CR="CR",n.HR="HR",n.CY="CY",n.CZ="CZ",n.DO="DO",n.EC="EC",n.EG="EG",n.EE="EE",n.FO="FO",n.GE="GE",n.GR="GR",n.GL="GL",n.GT="GT",n.HT="HT",n.HN="HN",n.HU="HU",n.IS="IS",n.IN="IN",n.ID="ID",n.IL="IL",n.JO="JO",n.KZ="KZ",n.KE="KE",n.KW="KW",n.KY="KY",n.LA="LA",n.LV="LV",n.LB="LB",n.LI="LI",n.LT="LT",n.LU="LU",n.MK="MK",n.MY="MY",n.MV="MV",n.MT="MT",n.MU="MU",n.MX="MX",n.MD="MD",n.MC="MC",n.MA="MA",n.NP="NP",n.NZ="NZ",n.NI="NI",n.NG="NG",n.OM="OM",n.PA="PA",n.PK="PK",n.PY="PY",n.PH="PH",n.PL="PL",n.PR="PR",n.RO="RO",n.RU="RU",n.SM="SM",n.SA="SA",n.SN="SN",n.SK="SK",n.SI="SI",n.ZA="ZA",n.LK="LK",n.TJ="TJ",n.TH="TH",n.TN="TN",n.TR="TR",n.TM="TM",n.UA="UA",n.UY="UY",n.UZ="UZ",n.VA="VA",n.VE="VE",n.ZM="ZM",n.AS="AS",n.CC="CC",n.CK="CK",n.RS="RS",n.ME="ME",n.CS="CS",n.YU="YU",n.CX="CX",n.ET="ET",n.FK="FK",n.NF="NF",n.FM="FM",n.GF="GF",n.GN="GN",n.GP="GP",n.GS="GS",n.GU="GU",n.GW="GW",n.HM="HM",n.IQ="IQ",n.KG="KG",n.LR="LR",n.LS="LS",n.MG="MG",n.MH="MH",n.MN="MN",n.MP="MP",n.MQ="MQ",n.NC="NC",n.NE="NE",n.VI="VI",n.VN="VN",n.PF="PF",n.PG="PG",n.PM="PM",n.PN="PN",n.PW="PW",n.RE="RE",n.SH="SH",n.SJ="SJ",n.SO="SO",n.SZ="SZ",n.TC="TC",n.WF="WF",n.XK="XK",n.YT="YT",n.PE="PE",n.INTL="INTL",n.CO="CO"})(H||(H={}));const lp=new Map([[H.UK,/^([A-Z]){1}([0-9][0-9]|[0-9]|[A-Z][0-9][A-Z]|[A-Z][0-9][0-9]|[A-Z][0-9]|[0-9][A-Z]){1}([ ])?([0-9][A-z][A-z]){1}$/i],[H.GB,/^([A-Z]){1}([0-9][0-9]|[0-9]|[A-Z][0-9][A-Z]|[A-Z][0-9][0-9]|[A-Z][0-9]|[0-9][A-Z]){1}([ ])?([0-9][A-z][A-z]){1}$/i],[H.JE,/^JE\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/],[H.GG,/^GY\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/],[H.IM,/^IM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/],[H.US,/^([0-9]{5})(?:-([0-9]{4}))?$/],[H.CA,/^([ABCEGHJKLMNPRSTVXY][0-9][ABCEGHJKLMNPRSTVWXYZ])\s*([0-9][ABCEGHJKLMNPRSTVWXYZ][0-9])$/i],[H.IE,/^([AC-FHKNPRTV-Y][0-9]{2}|D6W)[ -]?[0-9AC-FHKNPRTV-Y]{4}$/],[H.DE,/^\d{5}$/],[H.JP,/^\d{3}-\d{4}$/],[H.FR,/^\d{2}[ ]?\d{3}$/],[H.AU,/^\d{4}$/],[H.IT,/^\d{5}$/],[H.CH,/^\d{4}$/],[H.AT,/^(?!0)\d{4}$/],[H.ES,/^(?:0[1-9]|[1-4]\d|5[0-2])\d{3}$/],[H.NL,/^\d{4}[ ]?[A-Z]{2}$/],[H.BE,/^\d{4}$/],[H.DK,/^\d{4}$/],[H.SE,/^(SE-)?\d{3}[ ]?\d{2}$/],[H.NO,/^\d{4}$/],[H.BR,/^\d{5}[\-]?\d{3}$/],[H.PT,/^\d{4}([\-]\d{3})?$/],[H.FI,/^(FI-|AX-)?\d{5}$/],[H.AX,/^22\d{3}$/],[H.KR,/^\d{5}$/],[H.CN,/^\d{6}$/],[H.TW,/^\d{3}(\d{2,3})?$/],[H.SG,/^\d{6}$/],[H.DZ,/^\d{5}$/],[H.AD,/^AD\d{3}$/],[H.AR,/^([A-HJ-NP-Z])?\d{4}([A-Z]{3})?$/],[H.AM,/^(37)?\d{4}$/],[H.AZ,/^\d{4}$/],[H.BH,/^((1[0-2]|[2-9])\d{2})?$/],[H.BD,/^\d{4}$/],[H.BB,/^(BB\d{5})?$/],[H.BY,/^\d{6}$/],[H.BM,/^[A-Z]{2}[ ]?[A-Z0-9]{2}$/],[H.BA,/^\d{5}$/],[H.IO,/^BBND 1ZZ$/],[H.BN,/^[A-Z]{2}[ ]?\d{4}$/],[H.BG,/^\d{4}$/],[H.KH,/^\d{5}$/],[H.CV,/^\d{4}$/],[H.CL,/^\d{7}$/],[H.CR,/^(\d{4,5}|\d{3}-\d{4})$/],[H.HR,/^(HR-)?\d{5}$/],[H.CY,/^\d{4}$/],[H.CZ,/^\d{3}[ ]?\d{2}$/],[H.DO,/^\d{5}$/],[H.EC,/^([A-Z]\d{4}[A-Z]|(?:[A-Z]{2})?\d{6})?$/],[H.EG,/^\d{5}$/],[H.EE,/^\d{5}$/],[H.FO,/^\d{3}$/],[H.GE,/^\d{4}$/],[H.GR,/^\d{3}[ ]?\d{2}$/],[H.GL,/^39\d{2}$/],[H.GT,/^\d{5}$/],[H.HT,/^\d{4}$/],[H.HN,/^(?:\d{5})?$/],[H.HU,/^\d{4}$/],[H.IS,/^\d{3}$/],[H.IN,/^\d{6}$/],[H.ID,/^\d{5}$/],[H.IL,/^\d{5,7}$/],[H.JO,/^\d{5}$/],[H.KZ,/^\d{6}$/],[H.KE,/^\d{5}$/],[H.KW,/^\d{5}$/],[H.KY,/^KY[123]-\d{4}$/],[H.LA,/^\d{5}$/],[H.LV,/^(LV-)?\d{4}$/],[H.LB,/^(\d{4}([ ]?\d{4})?)?$/],[H.LI,/^(948[5-9])|(949[0-7])$/],[H.LT,/^(LT-)?\d{5}$/],[H.LU,/^(L-)?\d{4}$/],[H.MK,/^\d{4}$/],[H.MY,/^\d{5}$/],[H.MV,/^\d{5}$/],[H.MT,/^[A-Z]{3}[ ]?\d{2,4}$/],[H.MU,/^((\d|[A-Z])\d{4})?$/],[H.MX,/^\d{5}$/],[H.MD,/^\d{4}$/],[H.MC,/^980\d{2}$/],[H.MA,/^\d{5}$/],[H.NP,/^\d{5}$/],[H.NZ,/^\d{4}$/],[H.NI,/^((\d{4}-)?\d{3}-\d{3}(-\d{1})?)?$/],[H.NG,/^(\d{6})?$/],[H.OM,/^(PC )?\d{3}$/],[H.PA,/^\d{4}$/],[H.PK,/^\d{5}$/],[H.PY,/^\d{4}$/],[H.PH,/^\d{4}$/],[H.PL,/^\d{2}-\d{3}$/],[H.PR,/^00[679]\d{2}([ \-]\d{4})?$/],[H.RO,/^\d{6}$/],[H.RU,/^\d{6}$/],[H.SM,/^4789\d$/],[H.SA,/^\d{5}$/],[H.SN,/^\d{5}$/],[H.SK,/^\d{3}[ ]?\d{2}$/],[H.SI,/^(SI-)?\d{4}$/],[H.ZA,/^\d{4}$/],[H.LK,/^\d{5}$/],[H.TJ,/^\d{6}$/],[H.TH,/^\d{5}$/],[H.TN,/^\d{4}$/],[H.TR,/^\d{5}$/],[H.TM,/^\d{6}$/],[H.UA,/^\d{5}$/],[H.UY,/^\d{5}$/],[H.UZ,/^\d{6}$/],[H.VA,/^00120$/],[H.VE,/^\d{4}$/],[H.ZM,/^\d{5}$/],[H.AS,/^96799$/],[H.CC,/^6799$/],[H.CK,/^\d{4}$/],[H.RS,/^\d{5,6}$/],[H.ME,/^8\d{4}$/],[H.CS,/^\d{5}$/],[H.YU,/^\d{5}$/],[H.CX,/^6798$/],[H.ET,/^\d{4}$/],[H.FK,/^FIQQ 1ZZ$/],[H.NF,/^2899$/],[H.FM,/^(9694[1-4])([ \-]\d{4})?$/],[H.GF,/^9[78]3\d{2}$/],[H.GN,/^\d{3}$/],[H.GP,/^9[78][01]\d{2}$/],[H.GS,/^SIQQ 1ZZ$/],[H.GU,/^969[123]\d([ \-]\d{4})?$/],[H.GW,/^\d{4}$/],[H.HM,/^\d{4}$/],[H.IQ,/^\d{5}$/],[H.KG,/^\d{6}$/],[H.LR,/^\d{4}$/],[H.LS,/^\d{3}$/],[H.MG,/^\d{3}$/],[H.MH,/^969[67]\d([ \-]\d{4})?$/],[H.MN,/^\d{5}$/],[H.MP,/^9695[012]([ \-]\d{4})?$/],[H.MQ,/^9[78]2\d{2}$/],[H.NC,/^988\d{2}$/],[H.NE,/^\d{4}$/],[H.VI,/^008(([0-4]\d)|(5[01]))([ \-]\d{4})?$/],[H.VN,/^\d{6}$/],[H.PF,/^987\d{2}$/],[H.PG,/^\d{3}$/],[H.PM,/^9[78]5\d{2}$/],[H.PN,/^PCRN 1ZZ$/],[H.PW,/^96940$/],[H.RE,/^9[78]4\d{2}$/],[H.SH,/^(ASCN|STHL) 1ZZ$/],[H.SJ,/^\d{4}$/],[H.SO,/^\d{5}$/],[H.SZ,/^[HLMS]\d{3}$/],[H.TC,/^TKCA 1ZZ$/],[H.WF,/^986\d{2}$/],[H.XK,/^\d{5}$/],[H.YT,/^976\d{2}$/],[H.PE,/^[0-2]\d{4}$/],[H.INTL,/^(?:[A-Z0-9]+([- ]?[A-Z0-9]+)*)?$/i],[H.CO,/^(0[58]|1[135789]|2[0357]|4[147]|5[024]|6[368]|7[036]|8[1568]|9[4579])\d{4}$/]]),D4=(n,e)=>{if(!lp.has(e))throw Error(`Invalid country code: ${e}`);return lp.get(e).test(n)},R4=n=>lp.has(n);function I4(n){return!(n===null||typeof n!="object"||!("value"in n)||!("label"in n))}function S1(n,e=", ",t=" and "){if(n.length<3)return n.join(t);const r=n.slice(0,n.length-1).join(e),o=n[n.length-1];return`${r}${t}${o}`}const Sv="Segmenter"in Intl&&new Intl.Segmenter("en",{granularity:"grapheme"});function fh(n){return Sv?[...Sv.segment(n)].length:Array.from(n).length}const k1=["https","http"];function kv(n,e=k1){if(!n)return"";const[t=""]=e;for(const r of e)if(n.substring(0,r.length+3)===`${r}://`)return n;return`${t}://${n}`}const $4=["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 Ql(n){return $4.includes(n.tagName.toLowerCase())}function M1(n){return n.nodeType===Node.TEXT_NODE}function ec(n){return n.nodeType===Node.ELEMENT_NODE}function E1(n,e,t){const r=e&&ec(e)&&Ql(e),o=t&&ec(t)&&Ql(t),i=r&&o;return n.textContent&&!i}function hh(n,e){const t=Array.from(n.childNodes);t.forEach((r,o)=>{const i=ec(r)?r:void 0,s=M1(r)?r:void 0;e({node:r,index:o,parent:n,elem:i,text:s,siblings:t}),i&&hh(i,e)})}function N4(n,e,t){const o=new DOMParser().parseFromString(n,"text/html");let i=t;return hh(o.body,s=>{const a=e(i,s);a!==void 0&&(i=a)}),i}function T1(n){return N4(n,(e,{index:t,parent:r,siblings:o,text:i,elem:s})=>{if(i&&E1(i,o[t-1],o[t+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+fh(l.textContent||"")}}if(s){const a=s.tagName.toLowerCase();if(a!=="script"&&a!=="style"&&s!==o[0])return e+(Ql(s)?1:0)}},0)}const eX="validateDateRange",tX="validateNumberRange";function B4(n){if(!(!n||n.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 F4(n){if(n)return new Promise(function(e){setTimeout(function(){return n.includes("test")?e("String cannot include test"):e()},1e3)})}function mh(n){if(!(isFinite(n)&&Math.abs(n)<=90))return"Latitude should be between -90 and 90"}function gh(n){if(!(isFinite(n)&&Math.abs(n)<=180))return"Longitude should be between -180 and 180"}function j4(n){if(n===void 0||typeof n=="string"&&!n.trim().length||Array.isArray(n)&&!n.length||n===!1)return"This field is required, please fill it"}function _4(n){if(n&&!(!isNaN(Number(n))&&!isNaN(parseFloat(n))))return"The value is not a number"}function z4(n){if(!n)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(n))return"The value is not a valid URL"}function H4(n,e,t){const r=e[t.startDateName]?e[t.startDateName]:n,o=e[t.endDateName]?e[t.endDateName]:n;if(!r||!o)return;const i=r===n?"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 V4(n,e,{minName:t,maxName:r}){if(n===void 0)return;const o=t&&e[t],i=r&&e[r],s=Number(n);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 U4(n,e,{min:t,max:r}){if(n instanceof Date){if(t&&!r&&nr)return`Date must come on or before ${Hi(r,Vi)}`;if(t&&r&&(nr))return`Date must come between ${Hi(t,Vi)} and ${Hi(r,Vi)}`}}function W4(n,e,t){if(!t.max||typeof n!="string")return;const r="You have exceeded the maximum number of characters";if(t.ignoreHTML&&T1(n)>t.max||!t.ignoreHTML&&fh(n)>t.max)return r}function G4(n){if(!(!n||n[0]!=="1"||n.length===11))return"Phone number must be exactly 10 numbers excluding the country code"}async function O1(n,e,{countryField:t}){if(!n)return;const r=e[t];if(!r)return;const o=I4(r)?r.value:r;if(!(!o||!R4(o))&&!D4(n,o))return"This is not a valid postal code in the selected country"}function K4({internalData:n,data:e,errors:t,disabled:r,touched:o,submitWarning:i,waits:s,loadingInitial:a}){return{internalData:n,data:e,errors:t,disabled:r,touched:o,submitWarning:i,waits:s,loadingInitial:a}}async function q4(n,e,t){for(const r of n){const o=await r.fn(e,t,r.options);if(o)return{errorMessage:o,validator:r}}}function Y4(n){const e={required:j4,validateLatitude:mh,validateLongitude:gh,validateDateRange:H4,validateMinDate:U4,validateNumberRange:V4,validateCharacterCount:W4,validateEmail:B4,validateNumber:_4,validateSlow:F4,validateURL:z4,validatePhoneNumber:G4,validatePostcode:O1};return n.map(t=>typeof t=="string"?{fn:e[t],options:{}}:typeof t=="function"?{fn:t,options:{}}:{fn:e[t.fn],options:t.options})}function fu(){const n=h.useRef(L4()),[e,t]=h.useReducer(P4,Xl()),r=h.useCallback(x=>{if(!n.current.fields[x])throw new Error(`Field \`${x}\` is not registered with this form. Registered fields: ${Object.keys(n.current.fields).map(C=>`\`${C}\``).join(", ")}`);return n.current.fields[x]},[]),o=h.useCallback(async({name:x,include:C})=>{var z,_,$,G,le;const{data:E,internalValidators:P}=n.current,O=r(x),F=O.required,D=O.validators||[];F&&D.unshift({fn:"required",options:{}}),O.type==="phone"&&D.push({fn:"validatePhoneNumber",options:{}}),((z=O.inputSettings)==null?void 0:z.maxCharacters)>0&&D.push({fn:"validateCharacterCount",options:{max:O.inputSettings.maxCharacters,ignoreHTML:O.type==="textEditor"}}),((_=O.inputSettings)!=null&&_.minDate||($=O.inputSettings)!=null&&$.maxDate)&&D.push({fn:"validateMinDate",options:{min:(G=O.inputSettings)==null?void 0:G.minDate,max:(le=O.inputSettings)==null?void 0:le.maxDate}});const U=Y4([...P[x]||[],...D]).filter(Z=>!C||C.includes(Z.fn)),N=await q4(U,E[x],E);if(N)return N.errorMessage},[r]),i=h.useCallback(async({names:x})=>{const E=(await Promise.all(x.map(async O=>{const{name:F,include:D}=typeof O=="object"?O:{name:O,include:void 0},U=await o({name:F,include:D});return{name:F,error:U}}))).reduce((O,{name:F,error:D})=>({...O,[F]:D}),{}),P=Object.values(E).filter(Boolean).length;return{errors:E,count:P}},[o]),s=h.useCallback(({name:x})=>{const{mounted:C}=n.current;if(!C[x])return!1;const E=r(x),P=wl(E.disabled,K4(n.current),!1);return!Cl(P)},[r]),a=h.useCallback(async({name:x,validateLinkedFields:C})=>{const E=r(x),P={[x]:s({name:x})?await o({name:x}):void 0};if(C&&E.validates){const O=E.validates.map(D=>typeof D=="object"?D:{name:D,include:void 0}).filter(({name:D})=>s({name:D})),{errors:F}=await i({names:O});Object.assign(P,F)}n.current.errors={...n.current.errors,...P},t({type:"SET_FIELD_ERRORS",errors:P,merge:!0})},[s,o,i,r]),l=h.useCallback(async({values:x={},initial:C,validate:E})=>{const P=Object.keys(x).reduce((O,F)=>({...O,[F]:r(F).getResolvedValue(x[F]).internalValue}),{});if(n.current.data={...x},n.current.internalData={...P},C&&(n.current.initialData={...x},n.current.disabled=!1),E){const O=Object.keys(n.current.fields),{errors:F}=await i({names:O});n.current.errors={...n.current.errors,...F},t({type:"SET_FIELD_ERRORS",errors:F})}return t({type:"SET_FIELD_VALUES",values:x,internalValues:P,...C?{disabled:!1,loadingInitial:!1}:{}})},[r]),c=h.useCallback(({fields:x,sections:C})=>{const E=C&&C.map(({fields:P})=>P).flat(3);n.current.fields=x.reduce((P,O,F)=>{const D=QS(O.type),U=O.getResolvedValue||D.getResolvedValue,N={...O,validateOn:O.validateOn||D.validate,getResolvedValue:z=>U(z,O),order:(E?E.indexOf(O.name):F)+1};return{...P,[O.name]:N}},{})},[]),u=h.useCallback(()=>{const x={...n.current.initialData},C=Object.keys(x).reduce((E,P)=>({...E,[P]:r(P).getResolvedValue(x[P]).internalValue}),{});n.current={...Xl(),...n.current,hasBlurred:{},data:x,internalData:C,disabled:!1,loadingInitial:!1},t({type:"RESET",data:x,internalData:C})},[r]),d=h.useCallback(({name:x,value:C,touched:E,validate:P})=>{const{errors:O,internalData:F,hasBlurred:D}=n.current,U=r(x),N=typeof C=="function"?C(F[x]):C,{value:z,internalValue:_}=U.getResolvedValue(N);n.current.data[x]=z,n.current.internalData[x]=_,t({type:"SET_FIELD_VALUES",values:{[x]:z},internalValues:{[x]:_},merge:!0,touched:E}),(P||U.validateOn==="onChange")&&a({name:x,validateLinkedFields:!0}),U.validateOn==="onBlurChange"&&D[x]&&a({name:x,validateLinkedFields:!0}),U.validateOn==="onBlurAmend"&&D[x]&&O[x]&&(delete n.current.hasBlurred[x],t({type:"FIELD_UNVALIDATE",name:x,value:""}))},[r,a]),p=h.useCallback(({name:x})=>{const C=r(x);n.current.hasBlurred[x]=!0,(C.validateOn==="onBlur"||C.validateOn==="onBlurAmend"||C.validateOn==="onBlurChange")&&a({name:x,validateLinkedFields:!0})},[r,a]),f=h.useCallback(({disabled:x=!1,initial:C})=>{t({type:"FORM_DISABLE",disabled:x,loadingInitial:C})},[]),m=h.useCallback(x=>{t({type:"SET_SUBMIT_WARNING",...x})},[]),g=h.useCallback(async()=>{const{data:x,fields:C,waits:E}=n.current,P=Object.entries(C).map(([,U])=>U.name).filter(U=>s({name:U}));n.current.hasBlurred=Object.keys(C).reduce((U,N)=>({...U,[N]:!0}),{});const{count:O,errors:F}=await i({names:P});if(O)return n.current.errors=F,n.current.moveToError=!0,t({type:"SET_FIELD_ERRORS",errors:F}),{valid:!1,data:null};if(E.length>0)return m({open:!0,lead:"The form cannot be submitted at this time:",reasons:E.map(({message:U})=>U)}),{valid:!1,data:null};const D=Object.keys(C).filter(U=>s({name:U}));return{valid:!0,data:x,activeFields:D}},[s,i,m]),y=h.useCallback(({names:x})=>{const{waits:C}=n.current,E=C.filter(({name:P})=>!x.includes(P));n.current.waits=E,t({type:"SET_FORM_WAITS",waits:E})},[]),b=h.useCallback(({name:x,message:C,disableForm:E=!1})=>{const{waits:P}=n.current,O=[...P,{name:x,message:C,disableForm:E}];return n.current.waits=O,t({type:"SET_FORM_WAITS",waits:O}),{remove:(F={})=>y({names:[x],...F})}},[y]),w=h.useCallback(({name:x,fieldRef:C,inputRef:E})=>(n.current.mounted[x]={fieldRef:C,inputRef:E},{unmount:()=>{n.current.mounted[x]=!1,t({type:"SET_FIELD_ERRORS",errors:{[x]:void 0},merge:!0})}}),[]),S=h.useCallback(({name:x,validator:C})=>{const E=n.current.internalValidators[x]||[];if(!E.includes(C))return n.current.internalValidators[x]=[...E,C],{remove:()=>{const P=n.current.internalValidators[x]||[];P.includes(C)&&(n.current.internalValidators[x]=P.filter(O=>O!==C))}}},[]),T=h.useMemo(()=>({setFormValues:l,setFieldValue:d,setFieldBlur:p,submitForm:g,disableForm:f,addWait:b,removeWait:y,mountField:w,addValidator:S,init:c,reset:u,setSubmitWarning:m}),[p,l,d,g,f,b,y,w,S,c,u,m]),k=h.useCallback((x,C)=>async()=>{const{data:E,activeFields:P,valid:O}=await g();if(!O){C&&C({data:E});return}x({data:E,activeFields:P})},[g]);return{state:e,stable:n.current,methods:T,handleSubmit:k}}/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +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 cp=function(n,e){return cp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])},cp(n,e)};function gt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");cp(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var je=function(){return je=Object.assign||function(e){for(var t,r=1,o=arguments.length;r0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=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)})},t.injectScript=function(){t.props.preventGoogleFontsLoading&&D1(),jt(!!t.props.id,'LoadScript requires "id" prop to be a string: %s',t.props.id);var r={id:t.props.id,nonce:t.props.nonce,url:R1(t.props)};P1(r).then(function(){t.props.onLoad&&t.props.onLoad(),t.setState(function(){return{loaded:!0}})}).catch(function(o){t.props.onError&&t.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(t.props.googleMapsApiKey||"-",") or Client ID (").concat(t.props.googleMapsClientId||"-",`) to + Otherwise it is a Network issue. + `))})},t}return e.prototype.componentDidMount=function(){if(Ro){if(window.google&&window.google.maps&&!Ss){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(t){this.props.libraries!==t.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"),Ro&&t.language!==this.props.language&&(this.cleanup(),this.setState(function(){return{loaded:!1}},this.cleanupCallback))},e.prototype.componentWillUnmount=function(){var t=this;if(Ro){this.cleanup();var r=function(){t.check.current||(delete window.google,Ss=!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(I1,{})]})},e.defaultProps=up,e})(h.PureComponent);var Ov;function yh(n){var e=n.id,t=e===void 0?up.id:e,r=n.version,o=r===void 0?up.version:r,i=n.nonce,s=n.googleMapsApiKey,a=n.googleMapsClientId,l=n.language,c=n.region,u=n.libraries,d=n.preventGoogleFontsLoading,p=n.channel,f=n.mapIds,m=n.authReferrerPolicy,g=h.useRef(!1),y=h.useState(!1),b=y[0],w=y[1],S=h.useState(void 0),T=S[0],k=S[1];h.useEffect(function(){return g.current=!0,function(){g.current=!1}},[]),h.useEffect(function(){Ro&&d&&D1()},[d]),h.useEffect(function(){b&&jt(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")},[b]);var x=R1({version:o,googleMapsApiKey:s,googleMapsClientId:a,language:l,region:c,libraries:u,channel:p,mapIds:f,authReferrerPolicy:m});h.useEffect(function(){if(!Ro)return;function P(){g.current&&(w(!0),Ov=x)}if(window.google&&window.google.maps&&Ov===x){P();return}P1({id:t,url:x,nonce:i}).then(P).catch(function(F){g.current&&k(F),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(F)})},[t,x,i]);var C=h.useRef();return h.useEffect(function(){C.current&&u!==C.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"),C.current=u},[u]),{isLoaded:b,loadError:T,url:x}}var a6=v.jsx(I1,{});function l6(n){var e=n.loadingElement,t=n.onLoad,r=n.onError,o=n.onUnmount,i=n.children,s=vh(n,["loadingElement","onLoad","onError","onUnmount","children"]),a=yh(s),l=a.isLoaded,c=a.loadError;return h.useEffect(function(){l&&typeof t=="function"&&t()},[l,t]),h.useEffect(function(){c&&typeof r=="function"&&r(c)},[c,r]),h.useEffect(function(){return function(){o&&o()}},[o]),l?i:e||a6}h.memo(l6);var Lv;(function(n){n[n.INITIALIZED=0]="INITIALIZED",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.FAILURE=3]="FAILURE"})(Lv||(Lv={}));var Av={},Pv={options:function(n,e){n.setOptions(e)}};function c6(n){var e=n.options,t=n.onLoad,r=n.onUnmount,o=h.useContext(We),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(je(je({},e||{}),{map:o}));return a(l),t&&t(l),function(){s!==null&&(r&&r(s),s.setMap(null))}},[]),null}h.memo(c6);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={trafficLayer:null},t.setTrafficLayerCallback=function(){t.state.trafficLayer!==null&&t.props.onLoad&&t.props.onLoad(t.state.trafficLayer)},t.registeredEvents=[],t}return e.prototype.componentDidMount=function(){var t=new google.maps.TrafficLayer(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:Pv,eventMap:Av,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{trafficLayer:t}},this.setTrafficLayerCallback)},e.prototype.componentDidUpdate=function(t){this.state.trafficLayer!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Pv,eventMap:Av,prevProps:t,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=We,e})(h.PureComponent);function u6(n){var e=n.onLoad,t=n.onUnmount,r=h.useContext(We),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&&(t&&t(a),a.setMap(null))}},[]),null}h.memo(u6);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={bicyclingLayer:null},t.setBicyclingLayerCallback=function(){t.state.bicyclingLayer!==null&&(t.state.bicyclingLayer.setMap(t.context),t.props.onLoad&&t.props.onLoad(t.state.bicyclingLayer))},t}return e.prototype.componentDidMount=function(){var t=new google.maps.BicyclingLayer;this.setState(function(){return{bicyclingLayer:t}},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=We,e})(h.PureComponent);function d6(n){var e=n.onLoad,t=n.onUnmount,r=h.useContext(We),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&&(t&&t(i),i.setMap(null))}},[]),null}h.memo(d6);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={transitLayer:null},t.setTransitLayerCallback=function(){t.state.transitLayer!==null&&(t.state.transitLayer.setMap(t.context),t.props.onLoad&&t.props.onLoad(t.state.transitLayer))},t}return e.prototype.componentDidMount=function(){var t=new google.maps.TransitLayer;this.setState(function(){return{transitLayer:t}},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=We,e})(h.PureComponent);var Dv={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},Rv={drawingMode:function(n,e){n.setDrawingMode(e)},options:function(n,e){n.setOptions(e)}};function p6(n){var e=n.options,t=n.drawingMode,r=n.onCircleComplete,o=n.onMarkerComplete,i=n.onOverlayComplete,s=n.onPolygonComplete,a=n.onPolylineComplete,l=n.onRectangleComplete,c=n.onLoad,u=n.onUnmount,d=h.useContext(We),p=h.useState(null),f=p[0],m=p[1],g=h.useState(null),y=g[0],b=g[1],w=h.useState(null),S=w[0],T=w[1],k=h.useState(null),x=k[0],C=k[1],E=h.useState(null),P=E[0],O=E[1],F=h.useState(null),D=F[0],U=F[1],N=h.useState(null),z=N[0],_=N[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(t??null)},[f,t]),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),T(google.maps.event.addListener(f,"markercomplete",o)))},[f,o]),h.useEffect(function(){f&&i&&(x!==null&&google.maps.event.removeListener(x),C(google.maps.event.addListener(f,"overlaycomplete",i)))},[f,i]),h.useEffect(function(){f&&s&&(P!==null&&google.maps.event.removeListener(P),O(google.maps.event.addListener(f,"polygoncomplete",s)))},[f,s]),h.useEffect(function(){f&&a&&(D!==null&&google.maps.event.removeListener(D),U(google.maps.event.addListener(f,"polylinecomplete",a)))},[f,a]),h.useEffect(function(){f&&l&&(z!==null&&google.maps.event.removeListener(z),_(google.maps.event.addListener(f,"rectanglecomplete",l)))},[f,l]),h.useEffect(function(){jt(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing);var $=new google.maps.drawing.DrawingManager(je(je({},e||{}),{map:d}));return t&&$.setDrawingMode(t),r&&b(google.maps.event.addListener($,"circlecomplete",r)),o&&T(google.maps.event.addListener($,"markercomplete",o)),i&&C(google.maps.event.addListener($,"overlaycomplete",i)),s&&O(google.maps.event.addListener($,"polygoncomplete",s)),a&&U(google.maps.event.addListener($,"polylinecomplete",a)),l&&_(google.maps.event.addListener($,"rectanglecomplete",l)),m($),c&&c($),function(){f!==null&&(y&&google.maps.event.removeListener(y),S&&google.maps.event.removeListener(S),x&&google.maps.event.removeListener(x),P&&google.maps.event.removeListener(P),D&&google.maps.event.removeListener(D),z&&google.maps.event.removeListener(z),u&&u(f),f.setMap(null))}},[]),null}h.memo(p6);(function(n){gt(e,n);function e(t){var r=n.call(this,t)||this;return r.registeredEvents=[],r.state={drawingManager:null},r.setDrawingManagerCallback=function(){r.state.drawingManager!==null&&r.props.onLoad&&r.props.onLoad(r.state.drawingManager)},jt(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing),r}return e.prototype.componentDidMount=function(){var t=new google.maps.drawing.DrawingManager(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:Rv,eventMap:Dv,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{drawingManager:t}},this.setDrawingManagerCallback)},e.prototype.componentDidUpdate=function(t){this.state.drawingManager!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Rv,eventMap:Dv,prevProps:t,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=We,e})(h.PureComponent);var Iv={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"},$v={animation:function(n,e){n.setAnimation(e)},clickable:function(n,e){n.setClickable(e)},cursor:function(n,e){n.setCursor(e)},draggable:function(n,e){n.setDraggable(e)},icon:function(n,e){n.setIcon(e)},label:function(n,e){n.setLabel(e)},map:function(n,e){n.setMap(e)},opacity:function(n,e){n.setOpacity(e)},options:function(n,e){n.setOptions(e)},position:function(n,e){n.setPosition(e)},shape:function(n,e){n.setShape(e)},title:function(n,e){n.setTitle(e)},visible:function(n,e){n.setVisible(e)},zIndex:function(n,e){n.setZIndex(e)}},tc={};function f6(n){var e=n.position,t=n.options,r=n.clusterer,o=n.noClustererRedraw,i=n.children,s=n.draggable,a=n.visible,l=n.animation,c=n.clickable,u=n.cursor,d=n.icon,p=n.label,f=n.opacity,m=n.shape,g=n.title,y=n.zIndex,b=n.onClick,w=n.onDblClick,S=n.onDrag,T=n.onDragEnd,k=n.onDragStart,x=n.onMouseOut,C=n.onMouseOver,E=n.onMouseUp,P=n.onMouseDown,O=n.onRightClick,F=n.onClickableChanged,D=n.onCursorChanged,U=n.onAnimationChanged,N=n.onDraggableChanged,z=n.onFlatChanged,_=n.onIconChanged,$=n.onPositionChanged,G=n.onShapeChanged,le=n.onTitleChanged,Z=n.onVisibleChanged,V=n.onZindexChanged,J=n.onLoad,ce=n.onUnmount,q=h.useContext(We),M=h.useState(null),I=M[0],ie=M[1],te=h.useState(null),Q=te[0],fe=te[1],pe=h.useState(null),ye=pe[0],Le=pe[1],Oe=h.useState(null),B=Oe[0],R=Oe[1],oe=h.useState(null),ne=oe[0],de=oe[1],he=h.useState(null),we=he[0],ve=he[1],me=h.useState(null),ue=me[0],_e=me[1],Ee=h.useState(null),Ae=Ee[0],He=Ee[1],Pe=h.useState(null),it=Pe[0],zt=Pe[1],Pt=h.useState(null),Wt=Pt[0],Ht=Pt[1],Gt=h.useState(null),lt=Gt[0],yn=Gt[1],Dn=h.useState(null),$t=Dn[0],cn=Dn[1],Kt=h.useState(null),En=Kt[0],Rn=Kt[1],Gn=h.useState(null),un=Gn[0],dn=Gn[1],Lr=h.useState(null),Kn=Lr[0],qn=Lr[1],Dt=h.useState(null),yt=Dt[0],qt=Dt[1],In=h.useState(null),Yn=In[0],Ar=In[1],Pr=h.useState(null),Jt=Pr[0],Jn=Pr[1],$n=h.useState(null),Nn=$n[0],re=$n[1],X=h.useState(null),ke=X[0],be=X[1],ze=h.useState(null),et=ze[0],L=ze[1],W=h.useState(null),ae=W[0],ge=W[1];h.useEffect(function(){I!==null&&I.setMap(q)},[q]),h.useEffect(function(){typeof t<"u"&&I!==null&&I.setOptions(t)},[I,t]),h.useEffect(function(){typeof s<"u"&&I!==null&&I.setDraggable(s)},[I,s]),h.useEffect(function(){e&&I!==null&&I.setPosition(e)},[I,e]),h.useEffect(function(){typeof a<"u"&&I!==null&&I.setVisible(a)},[I,a]),h.useEffect(function(){I==null||I.setAnimation(l)},[I,l]),h.useEffect(function(){I&&c!==void 0&&I.setClickable(c)},[I,c]),h.useEffect(function(){I&&u!==void 0&&I.setCursor(u)},[I,u]),h.useEffect(function(){I&&d!==void 0&&I.setIcon(d)},[I,d]),h.useEffect(function(){I&&p!==void 0&&I.setLabel(p)},[I,p]),h.useEffect(function(){I&&f!==void 0&&I.setOpacity(f)},[I,f]),h.useEffect(function(){I&&m!==void 0&&I.setShape(m)},[I,m]),h.useEffect(function(){I&&g!==void 0&&I.setTitle(g)},[I,g]),h.useEffect(function(){I&&y!==void 0&&I.setZIndex(y)},[I,y]),h.useEffect(function(){I&&w&&(Q!==null&&google.maps.event.removeListener(Q),fe(google.maps.event.addListener(I,"dblclick",w)))},[w]),h.useEffect(function(){I&&T&&(ye!==null&&google.maps.event.removeListener(ye),Le(google.maps.event.addListener(I,"dragend",T)))},[T]),h.useEffect(function(){I&&k&&(B!==null&&google.maps.event.removeListener(B),R(google.maps.event.addListener(I,"dragstart",k)))},[k]),h.useEffect(function(){I&&P&&(ne!==null&&google.maps.event.removeListener(ne),de(google.maps.event.addListener(I,"mousedown",P)))},[P]),h.useEffect(function(){I&&x&&(we!==null&&google.maps.event.removeListener(we),ve(google.maps.event.addListener(I,"mouseout",x)))},[x]),h.useEffect(function(){I&&C&&(ue!==null&&google.maps.event.removeListener(ue),_e(google.maps.event.addListener(I,"mouseover",C)))},[C]),h.useEffect(function(){I&&E&&(Ae!==null&&google.maps.event.removeListener(Ae),He(google.maps.event.addListener(I,"mouseup",E)))},[E]),h.useEffect(function(){I&&O&&(it!==null&&google.maps.event.removeListener(it),zt(google.maps.event.addListener(I,"rightclick",O)))},[O]),h.useEffect(function(){I&&b&&(Wt!==null&&google.maps.event.removeListener(Wt),Ht(google.maps.event.addListener(I,"click",b)))},[b]),h.useEffect(function(){I&&S&&(lt!==null&&google.maps.event.removeListener(lt),yn(google.maps.event.addListener(I,"drag",S)))},[S]),h.useEffect(function(){I&&F&&($t!==null&&google.maps.event.removeListener($t),cn(google.maps.event.addListener(I,"clickable_changed",F)))},[F]),h.useEffect(function(){I&&D&&(En!==null&&google.maps.event.removeListener(En),Rn(google.maps.event.addListener(I,"cursor_changed",D)))},[D]),h.useEffect(function(){I&&U&&(un!==null&&google.maps.event.removeListener(un),dn(google.maps.event.addListener(I,"animation_changed",U)))},[U]),h.useEffect(function(){I&&N&&(Kn!==null&&google.maps.event.removeListener(Kn),qn(google.maps.event.addListener(I,"draggable_changed",N)))},[N]),h.useEffect(function(){I&&z&&(yt!==null&&google.maps.event.removeListener(yt),qt(google.maps.event.addListener(I,"flat_changed",z)))},[z]),h.useEffect(function(){I&&_&&(Yn!==null&&google.maps.event.removeListener(Yn),Ar(google.maps.event.addListener(I,"icon_changed",_)))},[_]),h.useEffect(function(){I&&$&&(Jt!==null&&google.maps.event.removeListener(Jt),Jn(google.maps.event.addListener(I,"position_changed",$)))},[$]),h.useEffect(function(){I&&G&&(Nn!==null&&google.maps.event.removeListener(Nn),re(google.maps.event.addListener(I,"shape_changed",G)))},[G]),h.useEffect(function(){I&&le&&(ke!==null&&google.maps.event.removeListener(ke),be(google.maps.event.addListener(I,"title_changed",le)))},[le]),h.useEffect(function(){I&&Z&&(et!==null&&google.maps.event.removeListener(et),L(google.maps.event.addListener(I,"visible_changed",Z)))},[Z]),h.useEffect(function(){I&&V&&(ae!==null&&google.maps.event.removeListener(ae),ge(google.maps.event.addListener(I,"zindex_changed",V)))},[V]),h.useEffect(function(){var $e=je(je(je({},t||tc),r?tc:{map:q}),{position:e}),xe=new google.maps.Marker($e);return r?r.addMarker(xe,!!o):xe.setMap(q),e&&xe.setPosition(e),typeof a<"u"&&xe.setVisible(a),typeof s<"u"&&xe.setDraggable(s),typeof c<"u"&&xe.setClickable(c),typeof u=="string"&&xe.setCursor(u),d&&xe.setIcon(d),typeof p<"u"&&xe.setLabel(p),typeof f<"u"&&xe.setOpacity(f),m&&xe.setShape(m),typeof g=="string"&&xe.setTitle(g),typeof y=="number"&&xe.setZIndex(y),w&&fe(google.maps.event.addListener(xe,"dblclick",w)),T&&Le(google.maps.event.addListener(xe,"dragend",T)),k&&R(google.maps.event.addListener(xe,"dragstart",k)),P&&de(google.maps.event.addListener(xe,"mousedown",P)),x&&ve(google.maps.event.addListener(xe,"mouseout",x)),C&&_e(google.maps.event.addListener(xe,"mouseover",C)),E&&He(google.maps.event.addListener(xe,"mouseup",E)),O&&zt(google.maps.event.addListener(xe,"rightclick",O)),b&&Ht(google.maps.event.addListener(xe,"click",b)),S&&yn(google.maps.event.addListener(xe,"drag",S)),F&&cn(google.maps.event.addListener(xe,"clickable_changed",F)),D&&Rn(google.maps.event.addListener(xe,"cursor_changed",D)),U&&dn(google.maps.event.addListener(xe,"animation_changed",U)),N&&qn(google.maps.event.addListener(xe,"draggable_changed",N)),z&&qt(google.maps.event.addListener(xe,"flat_changed",z)),_&&Ar(google.maps.event.addListener(xe,"icon_changed",_)),$&&Jn(google.maps.event.addListener(xe,"position_changed",$)),G&&re(google.maps.event.addListener(xe,"shape_changed",G)),le&&be(google.maps.event.addListener(xe,"title_changed",le)),Z&&L(google.maps.event.addListener(xe,"visible_changed",Z)),V&&ge(google.maps.event.addListener(xe,"zindex_changed",V)),ie(xe),J&&J(xe),function(){Q!==null&&google.maps.event.removeListener(Q),ye!==null&&google.maps.event.removeListener(ye),B!==null&&google.maps.event.removeListener(B),ne!==null&&google.maps.event.removeListener(ne),we!==null&&google.maps.event.removeListener(we),ue!==null&&google.maps.event.removeListener(ue),Ae!==null&&google.maps.event.removeListener(Ae),it!==null&&google.maps.event.removeListener(it),Wt!==null&&google.maps.event.removeListener(Wt),$t!==null&&google.maps.event.removeListener($t),En!==null&&google.maps.event.removeListener(En),un!==null&&google.maps.event.removeListener(un),Kn!==null&&google.maps.event.removeListener(Kn),yt!==null&&google.maps.event.removeListener(yt),Yn!==null&&google.maps.event.removeListener(Yn),Jt!==null&&google.maps.event.removeListener(Jt),ke!==null&&google.maps.event.removeListener(ke),et!==null&&google.maps.event.removeListener(et),ae!==null&&google.maps.event.removeListener(ae),ce&&ce(xe),r?r.removeMarker(xe,!!o):xe&&xe.setMap(null)}},[]);var Fe=h.useMemo(function(){return i?h.Children.map(i,function($e){if(!h.isValidElement($e))return $e;var xe=$e;return h.cloneElement(xe,{anchor:I})}):null},[i,I]);return v.jsx(v.Fragment,{children:Fe})||null}h.memo(f6);var h6=function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t}return e.prototype.componentDidMount=function(){var t=je(je(je({},this.props.options||tc),this.props.clusterer?tc:{map:this.context}),{position:this.props.position});this.marker=new google.maps.Marker(t),this.props.clusterer?this.props.clusterer.addMarker(this.marker,!!this.props.noClustererRedraw):this.marker.setMap(this.context),this.registeredEvents=Ye({updaterMap:$v,eventMap:Iv,prevProps:{},nextProps:this.props,instance:this.marker}),this.props.onLoad&&this.props.onLoad(this.marker)},e.prototype.componentDidUpdate=function(t){this.marker&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:$v,eventMap:Iv,prevProps:t,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 t=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:t.marker})})),r||null},e.contextType=We,e}(h.PureComponent),m6=function(){function n(e,t){e.getClusterer().extend(n,google.maps.OverlayView),this.cluster=e,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=t,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 n.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},n.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},n.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var t=this.cluster.getClusterer();if(google.maps.event.trigger(t,"click",this.cluster),google.maps.event.trigger(t,"clusterclick",this.cluster),t.getZoomOnClick()){var r=t.getMaxZoom(),o=this.cluster.getBounds(),i=t.getMap();i!==null&&"fitBounds"in i&&i.fitBounds(o),this.timeOut=window.setTimeout(function(){var s=t.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()}},n.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},n.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},n.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 t=this.getMap();t!==null&&(this.boundsChangedListener=google.maps.event.addListener(t,"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))},n.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)},n.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"}},n.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},n.prototype.show=function(){var e,t,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(((t=l[1])===null||t===void 0?void 0:t.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},n.prototype.useStyle=function(e){this.sums=e;var t=this.cluster.getClusterer().getStyles(),r=t[Math.min(t.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")},n.prototype.setCenter=function(e){this.center=e},n.prototype.getPosFromLatLng=function(e){var t=this.getProjection().fromLatLngToDivPixel(e);return t!==null&&(t.x-=this.anchorIcon[1],t.y-=this.anchorIcon[0]),t},n}(),g6=function(){function n(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 m6(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 n.prototype.getSize=function(){return this.markers.length},n.prototype.getMarkers=function(){return this.markers},n.prototype.getCenter=function(){return this.center},n.prototype.getMap=function(){return this.map},n.prototype.getClusterer=function(){return this.markerClusterer},n.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),t=this.getMarkers(),r=0,o=t;rs)e.getMap()!==this.map&&e.setMap(this.map);else if(ir){this.clusterIcon.hide();return}if(t0))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 n.prototype.createInfoBoxDiv=function(){var e=this,t=function(c){c.returnValue=!1,c.preventDefault&&c.preventDefault(),e.enableEventPropagation||Nv(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||t.panBy(r,o)}}},n.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var e=this.boxStyle;for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.div.style[t]=e[t]);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")}},n.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var t=this.div.ownerDocument,r=t&&t.defaultView?t.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},n.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},n.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection(),t=e.fromLatLngToDivPixel(this.position);t!==null&&(this.div.style.left=t.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(t.y+this.pixelOffset.height)+"px":this.div.style.top=t.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},n.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()},n.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")},n.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},n.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},n.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+""),google.maps.event.trigger(this,"zindex_changed")},n.prototype.getContent=function(){return this.content},n.prototype.getPosition=function(){return this.position},n.prototype.getZIndex=function(){return this.zIndex},n.prototype.getVisible=function(){var e=this.getMap();return typeof e>"u"||e===null?!1:!this.isHidden},n.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},n.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},n.prototype.open=function(e,t){var r=this;t&&(this.position=t.getPosition(),this.moveListener=google.maps.event.addListener(t,"position_changed",function(){var o=t.getPosition();r.setPosition(o)}),this.mapListener=google.maps.event.addListener(t,"map_changed",function(){r.setMap(t.map)})),this.setMap(e),this.div&&this.panBox()},n.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,t=this.eventListeners;e."),d&&d(V)}return function(){g!==null&&(w&&google.maps.event.removeListener(w),E&&google.maps.event.removeListener(E),k&&google.maps.event.removeListener(k),F&&google.maps.event.removeListener(F),N&&google.maps.event.removeListener(N),p&&p(g),g.close())}},[]),_.current?ti.createPortal(h.Children.only(e),_.current):null}h.memo(T6);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.containerElement=null,t.state={infoBox:null},t.open=function(r,o){o?t.context!==null&&r.open(t.context,o):r.getPosition()?t.context!==null&&r.open(t.context):jt(!1,"You must provide either an anchor or a position prop for .")},t.setInfoBoxCallback=function(){t.state.infoBox!==null&&t.containerElement!==null&&(t.state.infoBox.setContent(t.containerElement),t.open(t.state.infoBox,t.props.anchor),t.props.onLoad&&t.props.onLoad(t.state.infoBox))},t}return e.prototype.componentDidMount=function(){var t=this.props.options||{},r=t.position,o=vh(t,["position"]),i;r&&!(r instanceof google.maps.LatLng)&&(i=new google.maps.LatLng(r.lat,r.lng));var s=new N1(je(je({},o),i?{position:i}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=Ye({updaterMap:Fv,eventMap:Bv,prevProps:{},nextProps:this.props,instance:s}),this.setState({infoBox:s},this.setInfoBoxCallback)},e.prototype.componentDidUpdate=function(t){var r=this.state.infoBox;r!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Fv,eventMap:Bv,prevProps:t,nextProps:this.props,instance:r}))},e.prototype.componentWillUnmount=function(){var t=this.props.onUnmount,r=this.state.infoBox;r!==null&&(t&&t(r),Qe(this.registeredEvents),r.close())},e.prototype.render=function(){return this.containerElement?ti.createPortal(h.Children.only(this.props.children),this.containerElement):null},e.contextType=We,e})(h.PureComponent);var O6=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,o,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(!n(e[o],t[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!n(e[s],t[s]))return!1}return!0}return e!==e&&t!==t},jv=L1(O6);const _v=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Qu=1,ks=8;class bh{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=r>>4;if(o!==Qu)throw new Error(`Got v${o} data when expected v${Qu}.`);const i=_v[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 bh(a,s,i,e)}constructor(e,t=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(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const i=_v.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,ks,e),this.coords=new this.ArrayType(this.data,ks+a+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(ks+s+a+l),this.ids=new this.IndexArrayType(this.data,ks,e),this.coords=new this.ArrayType(this.data,ks+a+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Qu<<4)+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return dp(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,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],w=s[2*y+1];b>=e&&b<=r&&w>=t&&w<=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>=t&&g<=o&&c.push(i[f]),(u===0?e<=m:t<=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,t,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++)zv(i[2*y],i[2*y+1],e,t)<=c&&l.push(o[y]);continue}const f=p+d>>1,m=i[2*f],g=i[2*f+1];zv(m,g,e,t)<=c&&l.push(o[f]),(u===0?e-r<=m:t-r<=g)&&(a.push(p),a.push(f-1),a.push(1-u)),(u===0?e+r>=m:t+r>=g)&&(a.push(f+1),a.push(d),a.push(1-u))}return l}}function dp(n,e,t,r,o,i){if(o-r<=t)return;const s=r+o>>1;B1(n,e,s,r,o,i),dp(n,e,t,r,s-1,1-i),dp(n,e,t,s+1,o,1-i)}function B1(n,e,t,r,o,i){for(;o>r;){if(o-r>600){const c=o-r+1,u=t-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(t-u*p/c+f)),g=Math.min(o,Math.floor(t+(c-u)*p/c+f));B1(n,e,t,m,g,i)}const s=e[2*t+i];let a=r,l=o;for(Ms(n,e,r,t),e[2*o+i]>s&&Ms(n,e,r,o);as;)l--}e[2*r+i]===s?Ms(n,e,r,l):(l++,Ms(n,e,l,o)),l<=t&&(r=l+1),t<=l&&(o=l-1)}}function Ms(n,e,t,r){ed(n,t,r),ed(e,2*t,2*r),ed(e,2*t+1,2*r+1)}function ed(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function zv(n,e,t,r){const o=n-t,i=e-r;return o*o+i*i}const L6={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:n=>n},Hv=Math.fround||(n=>e=>(n[0]=+e,n[0]))(new Float32Array(1)),Eo=2,to=3,td=4,Xr=5,F1=6;class A6{constructor(e){this.options=Object.assign(Object.create(L6),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:o}=this.options;t&&console.time("total time");const i=`prepare ${e.length} points`;t&&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)),t&&console.log("z%d: %d clusters in %dms",l,a.numItems,+Date.now()-c)}return t&&console.timeEnd("total time"),this}getClusters(e,t){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],t),p=this.getClusters([-180,o,i,s],t);return d.concat(p)}const a=this.trees[this._limitZoom(t)],l=a.range(cl(r),ul(s),cl(i),ul(o)),c=a.data,u=[];for(const d of l){const p=this.stride*d;u.push(c[p+Xr]>1?Vv(c,p,this.clusterProps):this.points[c[p+to]])}return u}getChildren(e){const t=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(t*this.stride>=s.length)throw new Error(o);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),l=s[t*this.stride],c=s[t*this.stride+1],u=i.within(l,c,a),d=[];for(const p of u){const f=p*this.stride;s[f+td]===e&&d.push(s[f+Xr]>1?Vv(s,f,this.clusterProps):this.points[s[f+to]])}if(d.length===0)throw new Error(o);return d}getLeaves(e,t,r){t=t||10,r=r||0;const o=[];return this._appendLeaves(o,e,t,r,0),o}getTile(e,t,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((t-l)/i,c,(t+1+l)/i,u),o.data,t,r,i,d),t===0&&this._addTileFeatures(o.range(1-l/i,c,1,u),o.data,i,r,i,d),t===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 t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,r.length!==1)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,o,i){const s=this.getChildren(t);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=j1(t,l,this.clusterProps),d=t[l],p=t[l+1];else{const g=this.points[t[l+to]];u=g.properties;const[y,b]=g.geometry.coordinates;d=cl(y),p=ul(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=t[l+to]:m=this.points[t[l+to]].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,t){const{radius:r,extent:o,reduce:i,minPoints:s}=this.options,a=r/(o*Math.pow(2,t)),l=e.data,c=[],u=this.stride;for(let d=0;dt&&(y+=l[w+Xr])}if(y>g&&y>=s){let b=p*g,w=f*g,S,T=-1;const k=((d/u|0)<<5)+(t+1)+this.points.length;for(const x of m){const C=x*u;if(l[C+Eo]<=t)continue;l[C+Eo]=t;const E=l[C+Xr];b+=l[C]*E,w+=l[C+1]*E,l[C+td]=k,i&&(S||(S=this._map(l,d,!0),T=this.clusterProps.length,this.clusterProps.push(S)),i(S,this._map(l,C)))}l[d+td]=k,c.push(b/y,w/y,1/0,k,-1,y),i&&c.push(T)}else{for(let b=0;b1)for(const b of m){const w=b*u;if(!(l[w+Eo]<=t)){l[w+Eo]=t;for(let S=0;S>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+Xr]>1){const s=this.clusterProps[e[t+F1]];return r?Object.assign({},s):s}const o=this.points[e[t+to]].properties,i=this.options.map(o);return r&&i===o?Object.assign({},i):i}}function Vv(n,e,t){return{type:"Feature",id:n[e+to],properties:j1(n,e,t),geometry:{type:"Point",coordinates:[P6(n[e]),D6(n[e+1])]}}}function j1(n,e,t){const r=n[e+Xr],o=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,i=n[e+F1],s=i===-1?{}:Object.assign({},t[i]);return Object.assign(s,{cluster:!0,cluster_id:n[e+to],point_count:r,point_count_abbreviated:o})}function cl(n){return n/360+.5}function ul(n){const e=Math.sin(n*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}function P6(n){return(n-.5)*360}function D6(n){const e=(180-n*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 +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +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 R6(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(n);ojn.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(jn.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class I6{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return $6(e)}}const $6=n=>n.map(t=>new pp({position:jn.getPosition(t),markers:[t]}));class N6 extends I6{constructor(e){var{maxZoom:t,radius:r=60}=e,o=R6(e,["maxZoom","radius"]);super({maxZoom:t}),this.state={zoom:-1},this.superCluster=new A6(Object.assign({maxZoom:this.maxZoom,radius:r},o))}calculate(e){let t=!1;const r={zoom:e.map.getZoom()};if(!jv(e.markers,this.markers)){t=!0,this.markers=[...e.markers];const o=this.markers.map(i=>{const s=jn.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[s.lng(),s.lat()]},properties:{marker:i}}});this.superCluster.load(o)}return t||(this.state.zoom<=this.maxZoom||r.zoom<=this.maxZoom)&&(t=!jv(this.state,r)),this.state=r,t&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:t}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(t=>this.transformCluster(t))}transformCluster({geometry:{coordinates:[e,t]},properties:r}){if(r.cluster)return new pp({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(i=>i.properties.marker),position:{lat:t,lng:e}});const o=r.marker;return new pp({markers:[o],position:jn.getPosition(o)})}}class B6{constructor(e,t){this.markers={sum:e.length};const r=t.map(i=>i.count),o=r.reduce((i,s)=>i+s,0);this.clusters={count:t.length,markers:{mean:o/t.length,sum:o,min:Math.min(...r),max:Math.max(...r)}}}}class F6{render({count:e,position:t},r,o){const s=` + + + +${e} +`,a=`Cluster of ${e} markers`,l=Number(google.maps.Marker.MAX_ZINDEX)+e;if(jn.isAdvancedMarkerAvailable(o)){const d=new DOMParser().parseFromString(s,"image/svg+xml").documentElement;d.setAttribute("transform","translate(0 25)");const p={map:o,position:t,zIndex:l,title:a,content:d};return new google.maps.marker.AdvancedMarkerElement(p)}const c={position:t,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 j6(n,e){for(let t in e.prototype)n.prototype[t]=e.prototype[t]}class xh{constructor(){j6(xh,google.maps.OverlayView)}}var Ys;(function(n){n.CLUSTERING_BEGIN="clusteringbegin",n.CLUSTERING_END="clusteringend",n.CLUSTER_CLICK="click"})(Ys||(Ys={}));const _6=(n,e,t)=>{t.fitBounds(e.bounds)};class z6 extends xh{constructor({map:e,markers:t=[],algorithmOptions:r={},algorithm:o=new N6(r),renderer:i=new F6,onClusterClick:s=_6}){super(),this.markers=[...t],this.clusters=[],this.algorithm=o,this.renderer=i,this.onClusterClick=s,e&&this.setMap(e)}addMarker(e,t){this.markers.includes(e)||(this.markers.push(e),t||this.render())}addMarkers(e,t){e.forEach(r=>{this.addMarker(r,!0)}),t||this.render()}removeMarker(e,t){const r=this.markers.indexOf(e);return r===-1?!1:(jn.setMap(e,null),this.markers.splice(r,1),t||this.render(),!0)}removeMarkers(e,t){let r=!1;return e.forEach(o=>{r=this.removeMarker(o,!0)||r}),r&&!t&&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,Ys.CLUSTERING_BEGIN,this);const{clusters:t,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 t)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)||jn.setMap(s.marker,null):i.push(s.marker));this.clusters=t,this.renderClusters(),requestAnimationFrame(()=>i.forEach(s=>jn.setMap(s,null)))}google.maps.event.trigger(this,Ys.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=>jn.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new B6(this.markers,this.clusters),t=this.getMap();this.clusters.forEach(r=>{r.markers.length===1?r.marker=r.markers[0]:(r.marker=this.renderer.render(r,e,t),r.markers.forEach(o=>jn.setMap(o,null)),this.onClusterClick&&r.marker.addListener("click",o=>{google.maps.event.trigger(this,Ys.CLUSTER_CLICK,r),this.onClusterClick(o,r,t)})),jn.setMap(r.marker,t)})}}function H6(n){var e=A1(),t=h.useState(null),r=t[0],o=t[1];return h.useEffect(function(){if(e&&r===null){var i=new z6(je(je({},n),{map:e}));o(i)}},[e]),r}function V6(n){var e=n.children,t=n.options,r=H6(t);return r!==null?e(r):null}h.memo(V6);var Uv={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},Wv={options:function(n,e){n.setOptions(e)},position:function(n,e){n.setPosition(e)},zIndex:function(n,e){n.setZIndex(e)}};function U6(n){var e=n.children,t=n.anchor,r=n.options,o=n.position,i=n.zIndex,s=n.onCloseClick,a=n.onDomReady,l=n.onContentChanged,c=n.onPositionChanged,u=n.onZindexChanged,d=n.onLoad,p=n.onUnmount,f=h.useContext(We),m=h.useState(null),g=m[0],y=m[1],b=h.useState(null),w=b[0],S=b[1],T=h.useState(null),k=T[0],x=T[1],C=h.useState(null),E=C[0],P=C[1],O=h.useState(null),F=O[0],D=O[1],U=h.useState(null),N=U[0],z=U[1],_=h.useRef(null);return h.useEffect(function(){g!==null&&(g.close(),t?g.open(f,t):g.getPosition()&&g.open(f))},[f,g,t]),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&&(w!==null&&google.maps.event.removeListener(w),S(google.maps.event.addListener(g,"closeclick",s)))},[s]),h.useEffect(function(){g&&a&&(k!==null&&google.maps.event.removeListener(k),x(google.maps.event.addListener(g,"domready",a)))},[a]),h.useEffect(function(){g&&l&&(E!==null&&google.maps.event.removeListener(E),P(google.maps.event.addListener(g,"content_changed",l)))},[l]),h.useEffect(function(){g&&c&&(F!==null&&google.maps.event.removeListener(F),D(google.maps.event.addListener(g,"position_changed",c)))},[c]),h.useEffect(function(){g&&u&&(N!==null&&google.maps.event.removeListener(N),z(google.maps.event.addListener(g,"zindex_changed",u)))},[u]),h.useEffect(function(){var $=new google.maps.InfoWindow(je({},r||{}));return y($),_.current=document.createElement("div"),s&&S(google.maps.event.addListener($,"closeclick",s)),a&&x(google.maps.event.addListener($,"domready",a)),l&&P(google.maps.event.addListener($,"content_changed",l)),c&&D(google.maps.event.addListener($,"position_changed",c)),u&&z(google.maps.event.addListener($,"zindex_changed",u)),$.setContent(_.current),o&&$.setPosition(o),i&&$.setZIndex(i),t?$.open(f,t):$.getPosition()?$.open(f):jt(!1,"You must provide either an anchor (typically render it inside a ) or a position props for ."),d&&d($),function(){w&&google.maps.event.removeListener(w),E&&google.maps.event.removeListener(E),k&&google.maps.event.removeListener(k),F&&google.maps.event.removeListener(F),N&&google.maps.event.removeListener(N),p&&p($),$.close()}},[]),_.current?ti.createPortal(h.Children.only(e),_.current):null}h.memo(U6);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.containerElement=null,t.state={infoWindow:null},t.open=function(r,o){o?r.open(t.context,o):r.getPosition()?r.open(t.context):jt(!1,"You must provide either an anchor (typically render it inside a ) or a position props for .")},t.setInfoWindowCallback=function(){t.state.infoWindow!==null&&t.containerElement!==null&&(t.state.infoWindow.setContent(t.containerElement),t.open(t.state.infoWindow,t.props.anchor),t.props.onLoad&&t.props.onLoad(t.state.infoWindow))},t}return e.prototype.componentDidMount=function(){var t=new google.maps.InfoWindow(je({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=Ye({updaterMap:Wv,eventMap:Uv,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{infoWindow:t}},this.setInfoWindowCallback)},e.prototype.componentDidUpdate=function(t){this.state.infoWindow!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Wv,eventMap:Uv,prevProps:t,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?ti.createPortal(h.Children.only(this.props.children),this.containerElement):null},e.contextType=We,e})(h.PureComponent);var Gv={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},Kv={draggable:function(n,e){n.setDraggable(e)},editable:function(n,e){n.setEditable(e)},map:function(n,e){n.setMap(e)},options:function(n,e){n.setOptions(e)},path:function(n,e){n.setPath(e)},visible:function(n,e){n.setVisible(e)}},W6={};function G6(n){var e=n.options,t=n.draggable,r=n.editable,o=n.visible,i=n.path,s=n.onDblClick,a=n.onDragEnd,l=n.onDragStart,c=n.onMouseDown,u=n.onMouseMove,d=n.onMouseOut,p=n.onMouseOver,f=n.onMouseUp,m=n.onRightClick,g=n.onClick,y=n.onDrag,b=n.onLoad,w=n.onUnmount,S=h.useContext(We),T=h.useState(null),k=T[0],x=T[1],C=h.useState(null),E=C[0],P=C[1],O=h.useState(null),F=O[0],D=O[1],U=h.useState(null),N=U[0],z=U[1],_=h.useState(null),$=_[0],G=_[1],le=h.useState(null),Z=le[0],V=le[1],J=h.useState(null),ce=J[0],q=J[1],M=h.useState(null),I=M[0],ie=M[1],te=h.useState(null),Q=te[0],fe=te[1],pe=h.useState(null),ye=pe[0],Le=pe[1],Oe=h.useState(null),B=Oe[0],R=Oe[1],oe=h.useState(null),ne=oe[0],de=oe[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 t<"u"&&k!==null&&k.setDraggable(t)},[k,t]),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&&(E!==null&&google.maps.event.removeListener(E),P(google.maps.event.addListener(k,"dblclick",s)))},[s]),h.useEffect(function(){k&&a&&(F!==null&&google.maps.event.removeListener(F),D(google.maps.event.addListener(k,"dragend",a)))},[a]),h.useEffect(function(){k&&l&&(N!==null&&google.maps.event.removeListener(N),z(google.maps.event.addListener(k,"dragstart",l)))},[l]),h.useEffect(function(){k&&c&&($!==null&&google.maps.event.removeListener($),G(google.maps.event.addListener(k,"mousedown",c)))},[c]),h.useEffect(function(){k&&u&&(Z!==null&&google.maps.event.removeListener(Z),V(google.maps.event.addListener(k,"mousemove",u)))},[u]),h.useEffect(function(){k&&d&&(ce!==null&&google.maps.event.removeListener(ce),q(google.maps.event.addListener(k,"mouseout",d)))},[d]),h.useEffect(function(){k&&p&&(I!==null&&google.maps.event.removeListener(I),ie(google.maps.event.addListener(k,"mouseover",p)))},[p]),h.useEffect(function(){k&&f&&(Q!==null&&google.maps.event.removeListener(Q),fe(google.maps.event.addListener(k,"mouseup",f)))},[f]),h.useEffect(function(){k&&m&&(ye!==null&&google.maps.event.removeListener(ye),Le(google.maps.event.addListener(k,"rightclick",m)))},[m]),h.useEffect(function(){k&&g&&(B!==null&&google.maps.event.removeListener(B),R(google.maps.event.addListener(k,"click",g)))},[g]),h.useEffect(function(){k&&y&&(ne!==null&&google.maps.event.removeListener(ne),de(google.maps.event.addListener(k,"drag",y)))},[y]),h.useEffect(function(){var he=new google.maps.Polyline(je(je({},e||W6),{map:S}));return i&&he.setPath(i),typeof o<"u"&&he.setVisible(o),typeof r<"u"&&he.setEditable(r),typeof t<"u"&&he.setDraggable(t),s&&P(google.maps.event.addListener(he,"dblclick",s)),a&&D(google.maps.event.addListener(he,"dragend",a)),l&&z(google.maps.event.addListener(he,"dragstart",l)),c&&G(google.maps.event.addListener(he,"mousedown",c)),u&&V(google.maps.event.addListener(he,"mousemove",u)),d&&q(google.maps.event.addListener(he,"mouseout",d)),p&&ie(google.maps.event.addListener(he,"mouseover",p)),f&&fe(google.maps.event.addListener(he,"mouseup",f)),m&&Le(google.maps.event.addListener(he,"rightclick",m)),g&&R(google.maps.event.addListener(he,"click",g)),y&&de(google.maps.event.addListener(he,"drag",y)),x(he),b&&b(he),function(){E!==null&&google.maps.event.removeListener(E),F!==null&&google.maps.event.removeListener(F),N!==null&&google.maps.event.removeListener(N),$!==null&&google.maps.event.removeListener($),Z!==null&&google.maps.event.removeListener(Z),ce!==null&&google.maps.event.removeListener(ce),I!==null&&google.maps.event.removeListener(I),Q!==null&&google.maps.event.removeListener(Q),ye!==null&&google.maps.event.removeListener(ye),B!==null&&google.maps.event.removeListener(B),w&&w(he),he.setMap(null)}},[]),null}h.memo(G6);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={polyline:null},t.setPolylineCallback=function(){t.state.polyline!==null&&t.props.onLoad&&t.props.onLoad(t.state.polyline)},t}return e.prototype.componentDidMount=function(){var t=new google.maps.Polyline(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:Kv,eventMap:Gv,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{polyline:t}},this.setPolylineCallback)},e.prototype.componentDidUpdate=function(t){this.state.polyline!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Kv,eventMap:Gv,prevProps:t,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=We,e})(h.PureComponent);var qv={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},Yv={draggable:function(n,e){n.setDraggable(e)},editable:function(n,e){n.setEditable(e)},map:function(n,e){n.setMap(e)},options:function(n,e){n.setOptions(e)},path:function(n,e){n.setPath(e)},paths:function(n,e){n.setPaths(e)},visible:function(n,e){n.setVisible(e)}};function K6(n){var e=n.options,t=n.draggable,r=n.editable,o=n.visible,i=n.path,s=n.paths,a=n.onDblClick,l=n.onDragEnd,c=n.onDragStart,u=n.onMouseDown,d=n.onMouseMove,p=n.onMouseOut,f=n.onMouseOver,m=n.onMouseUp,g=n.onRightClick,y=n.onClick,b=n.onDrag,w=n.onLoad,S=n.onUnmount,T=n.onEdit,k=h.useContext(We),x=h.useState(null),C=x[0],E=x[1],P=h.useState(null),O=P[0],F=P[1],D=h.useState(null),U=D[0],N=D[1],z=h.useState(null),_=z[0],$=z[1],G=h.useState(null),le=G[0],Z=G[1],V=h.useState(null),J=V[0],ce=V[1],q=h.useState(null),M=q[0],I=q[1],ie=h.useState(null),te=ie[0],Q=ie[1],fe=h.useState(null),pe=fe[0],ye=fe[1],Le=h.useState(null),Oe=Le[0],B=Le[1],R=h.useState(null),oe=R[0],ne=R[1],de=h.useState(null),he=de[0],we=de[1];return h.useEffect(function(){C!==null&&C.setMap(k)},[k]),h.useEffect(function(){typeof e<"u"&&C!==null&&C.setOptions(e)},[C,e]),h.useEffect(function(){typeof t<"u"&&C!==null&&C.setDraggable(t)},[C,t]),h.useEffect(function(){typeof r<"u"&&C!==null&&C.setEditable(r)},[C,r]),h.useEffect(function(){typeof o<"u"&&C!==null&&C.setVisible(o)},[C,o]),h.useEffect(function(){typeof i<"u"&&C!==null&&C.setPath(i)},[C,i]),h.useEffect(function(){typeof s<"u"&&C!==null&&C.setPaths(s)},[C,s]),h.useEffect(function(){C&&a&&(O!==null&&google.maps.event.removeListener(O),F(google.maps.event.addListener(C,"dblclick",a)))},[a]),h.useEffect(function(){C&&(google.maps.event.addListener(C.getPath(),"insert_at",function(){T==null||T(C)}),google.maps.event.addListener(C.getPath(),"set_at",function(){T==null||T(C)}))},[C,T]),h.useEffect(function(){C&&l&&(U!==null&&google.maps.event.removeListener(U),N(google.maps.event.addListener(C,"dragend",l)))},[l]),h.useEffect(function(){C&&c&&(_!==null&&google.maps.event.removeListener(_),$(google.maps.event.addListener(C,"dragstart",c)))},[c]),h.useEffect(function(){C&&u&&(le!==null&&google.maps.event.removeListener(le),Z(google.maps.event.addListener(C,"mousedown",u)))},[u]),h.useEffect(function(){C&&d&&(J!==null&&google.maps.event.removeListener(J),ce(google.maps.event.addListener(C,"mousemove",d)))},[d]),h.useEffect(function(){C&&p&&(M!==null&&google.maps.event.removeListener(M),I(google.maps.event.addListener(C,"mouseout",p)))},[p]),h.useEffect(function(){C&&f&&(te!==null&&google.maps.event.removeListener(te),Q(google.maps.event.addListener(C,"mouseover",f)))},[f]),h.useEffect(function(){C&&m&&(pe!==null&&google.maps.event.removeListener(pe),ye(google.maps.event.addListener(C,"mouseup",m)))},[m]),h.useEffect(function(){C&&g&&(Oe!==null&&google.maps.event.removeListener(Oe),B(google.maps.event.addListener(C,"rightclick",g)))},[g]),h.useEffect(function(){C&&y&&(oe!==null&&google.maps.event.removeListener(oe),ne(google.maps.event.addListener(C,"click",y)))},[y]),h.useEffect(function(){C&&b&&(he!==null&&google.maps.event.removeListener(he),we(google.maps.event.addListener(C,"drag",b)))},[b]),h.useEffect(function(){var ve=new google.maps.Polygon(je(je({},e||{}),{map:k}));return i&&ve.setPath(i),s&&ve.setPaths(s),typeof o<"u"&&ve.setVisible(o),typeof r<"u"&&ve.setEditable(r),typeof t<"u"&&ve.setDraggable(t),a&&F(google.maps.event.addListener(ve,"dblclick",a)),l&&N(google.maps.event.addListener(ve,"dragend",l)),c&&$(google.maps.event.addListener(ve,"dragstart",c)),u&&Z(google.maps.event.addListener(ve,"mousedown",u)),d&&ce(google.maps.event.addListener(ve,"mousemove",d)),p&&I(google.maps.event.addListener(ve,"mouseout",p)),f&&Q(google.maps.event.addListener(ve,"mouseover",f)),m&&ye(google.maps.event.addListener(ve,"mouseup",m)),g&&B(google.maps.event.addListener(ve,"rightclick",g)),y&&ne(google.maps.event.addListener(ve,"click",y)),b&&we(google.maps.event.addListener(ve,"drag",b)),E(ve),w&&w(ve),function(){O!==null&&google.maps.event.removeListener(O),U!==null&&google.maps.event.removeListener(U),_!==null&&google.maps.event.removeListener(_),le!==null&&google.maps.event.removeListener(le),J!==null&&google.maps.event.removeListener(J),M!==null&&google.maps.event.removeListener(M),te!==null&&google.maps.event.removeListener(te),pe!==null&&google.maps.event.removeListener(pe),Oe!==null&&google.maps.event.removeListener(Oe),oe!==null&&google.maps.event.removeListener(oe),S&&S(ve),ve.setMap(null)}},[]),null}h.memo(K6);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={polygon:null},t.setPolygonCallback=function(){t.state.polygon!==null&&t.props.onLoad&&t.props.onLoad(t.state.polygon)},t}return e.prototype.componentDidMount=function(){var t=new google.maps.Polygon(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:Yv,eventMap:qv,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{polygon:t}},this.setPolygonCallback)},e.prototype.componentDidUpdate=function(t){this.state.polygon!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Yv,eventMap:qv,prevProps:t,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=We,e})(h.PureComponent);var Jv={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"},Zv={bounds:function(n,e){n.setBounds(e)},draggable:function(n,e){n.setDraggable(e)},editable:function(n,e){n.setEditable(e)},map:function(n,e){n.setMap(e)},options:function(n,e){n.setOptions(e)},visible:function(n,e){n.setVisible(e)}};function q6(n){var e=n.options,t=n.bounds,r=n.draggable,o=n.editable,i=n.visible,s=n.onDblClick,a=n.onDragEnd,l=n.onDragStart,c=n.onMouseDown,u=n.onMouseMove,d=n.onMouseOut,p=n.onMouseOver,f=n.onMouseUp,m=n.onRightClick,g=n.onClick,y=n.onDrag,b=n.onBoundsChanged,w=n.onLoad,S=n.onUnmount,T=h.useContext(We),k=h.useState(null),x=k[0],C=k[1],E=h.useState(null),P=E[0],O=E[1],F=h.useState(null),D=F[0],U=F[1],N=h.useState(null),z=N[0],_=N[1],$=h.useState(null),G=$[0],le=$[1],Z=h.useState(null),V=Z[0],J=Z[1],ce=h.useState(null),q=ce[0],M=ce[1],I=h.useState(null),ie=I[0],te=I[1],Q=h.useState(null),fe=Q[0],pe=Q[1],ye=h.useState(null),Le=ye[0],Oe=ye[1],B=h.useState(null),R=B[0],oe=B[1],ne=h.useState(null),de=ne[0],he=ne[1],we=h.useState(null),ve=we[0],me=we[1];return h.useEffect(function(){x!==null&&x.setMap(T)},[T]),h.useEffect(function(){typeof e<"u"&&x!==null&&x.setOptions(e)},[x,e]),h.useEffect(function(){typeof r<"u"&&x!==null&&x.setDraggable(r)},[x,r]),h.useEffect(function(){typeof o<"u"&&x!==null&&x.setEditable(o)},[x,o]),h.useEffect(function(){typeof i<"u"&&x!==null&&x.setVisible(i)},[x,i]),h.useEffect(function(){typeof t<"u"&&x!==null&&x.setBounds(t)},[x,t]),h.useEffect(function(){x&&s&&(P!==null&&google.maps.event.removeListener(P),O(google.maps.event.addListener(x,"dblclick",s)))},[s]),h.useEffect(function(){x&&a&&(D!==null&&google.maps.event.removeListener(D),U(google.maps.event.addListener(x,"dragend",a)))},[a]),h.useEffect(function(){x&&l&&(z!==null&&google.maps.event.removeListener(z),_(google.maps.event.addListener(x,"dragstart",l)))},[l]),h.useEffect(function(){x&&c&&(G!==null&&google.maps.event.removeListener(G),le(google.maps.event.addListener(x,"mousedown",c)))},[c]),h.useEffect(function(){x&&u&&(V!==null&&google.maps.event.removeListener(V),J(google.maps.event.addListener(x,"mousemove",u)))},[u]),h.useEffect(function(){x&&d&&(q!==null&&google.maps.event.removeListener(q),M(google.maps.event.addListener(x,"mouseout",d)))},[d]),h.useEffect(function(){x&&p&&(ie!==null&&google.maps.event.removeListener(ie),te(google.maps.event.addListener(x,"mouseover",p)))},[p]),h.useEffect(function(){x&&f&&(fe!==null&&google.maps.event.removeListener(fe),pe(google.maps.event.addListener(x,"mouseup",f)))},[f]),h.useEffect(function(){x&&m&&(Le!==null&&google.maps.event.removeListener(Le),Oe(google.maps.event.addListener(x,"rightclick",m)))},[m]),h.useEffect(function(){x&&g&&(R!==null&&google.maps.event.removeListener(R),oe(google.maps.event.addListener(x,"click",g)))},[g]),h.useEffect(function(){x&&y&&(de!==null&&google.maps.event.removeListener(de),he(google.maps.event.addListener(x,"drag",y)))},[y]),h.useEffect(function(){x&&b&&(ve!==null&&google.maps.event.removeListener(ve),me(google.maps.event.addListener(x,"bounds_changed",b)))},[b]),h.useEffect(function(){var ue=new google.maps.Rectangle(je(je({},e||{}),{map:T}));return typeof i<"u"&&ue.setVisible(i),typeof o<"u"&&ue.setEditable(o),typeof r<"u"&&ue.setDraggable(r),typeof t<"u"&&ue.setBounds(t),s&&O(google.maps.event.addListener(ue,"dblclick",s)),a&&U(google.maps.event.addListener(ue,"dragend",a)),l&&_(google.maps.event.addListener(ue,"dragstart",l)),c&&le(google.maps.event.addListener(ue,"mousedown",c)),u&&J(google.maps.event.addListener(ue,"mousemove",u)),d&&M(google.maps.event.addListener(ue,"mouseout",d)),p&&te(google.maps.event.addListener(ue,"mouseover",p)),f&&pe(google.maps.event.addListener(ue,"mouseup",f)),m&&Oe(google.maps.event.addListener(ue,"rightclick",m)),g&&oe(google.maps.event.addListener(ue,"click",g)),y&&he(google.maps.event.addListener(ue,"drag",y)),b&&me(google.maps.event.addListener(ue,"bounds_changed",b)),C(ue),w&&w(ue),function(){P!==null&&google.maps.event.removeListener(P),D!==null&&google.maps.event.removeListener(D),z!==null&&google.maps.event.removeListener(z),G!==null&&google.maps.event.removeListener(G),V!==null&&google.maps.event.removeListener(V),q!==null&&google.maps.event.removeListener(q),ie!==null&&google.maps.event.removeListener(ie),fe!==null&&google.maps.event.removeListener(fe),Le!==null&&google.maps.event.removeListener(Le),R!==null&&google.maps.event.removeListener(R),de!==null&&google.maps.event.removeListener(de),ve!==null&&google.maps.event.removeListener(ve),S&&S(ue),ue.setMap(null)}},[]),null}h.memo(q6);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={rectangle:null},t.setRectangleCallback=function(){t.state.rectangle!==null&&t.props.onLoad&&t.props.onLoad(t.state.rectangle)},t}return e.prototype.componentDidMount=function(){var t=new google.maps.Rectangle(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:Zv,eventMap:Jv,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{rectangle:t}},this.setRectangleCallback)},e.prototype.componentDidUpdate=function(t){this.state.rectangle!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Zv,eventMap:Jv,prevProps:t,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=We,e})(h.PureComponent);var Xv={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"},Qv={center:function(n,e){n.setCenter(e)},draggable:function(n,e){n.setDraggable(e)},editable:function(n,e){n.setEditable(e)},map:function(n,e){n.setMap(e)},options:function(n,e){n.setOptions(e)},radius:function(n,e){n.setRadius(e)},visible:function(n,e){n.setVisible(e)}},Y6={};function J6(n){var e=n.options,t=n.center,r=n.radius,o=n.draggable,i=n.editable,s=n.visible,a=n.onDblClick,l=n.onDragEnd,c=n.onDragStart,u=n.onMouseDown,d=n.onMouseMove,p=n.onMouseOut,f=n.onMouseOver,m=n.onMouseUp,g=n.onRightClick,y=n.onClick,b=n.onDrag,w=n.onCenterChanged,S=n.onRadiusChanged,T=n.onLoad,k=n.onUnmount,x=h.useContext(We),C=h.useState(null),E=C[0],P=C[1],O=h.useState(null),F=O[0],D=O[1],U=h.useState(null),N=U[0],z=U[1],_=h.useState(null),$=_[0],G=_[1],le=h.useState(null),Z=le[0],V=le[1],J=h.useState(null),ce=J[0],q=J[1],M=h.useState(null),I=M[0],ie=M[1],te=h.useState(null),Q=te[0],fe=te[1],pe=h.useState(null),ye=pe[0],Le=pe[1],Oe=h.useState(null),B=Oe[0],R=Oe[1],oe=h.useState(null),ne=oe[0],de=oe[1],he=h.useState(null),we=he[0],ve=he[1],me=h.useState(null),ue=me[0],_e=me[1],Ee=h.useState(null),Ae=Ee[0],He=Ee[1];return h.useEffect(function(){E!==null&&E.setMap(x)},[x]),h.useEffect(function(){typeof e<"u"&&E!==null&&E.setOptions(e)},[E,e]),h.useEffect(function(){typeof o<"u"&&E!==null&&E.setDraggable(o)},[E,o]),h.useEffect(function(){typeof i<"u"&&E!==null&&E.setEditable(i)},[E,i]),h.useEffect(function(){typeof s<"u"&&E!==null&&E.setVisible(s)},[E,s]),h.useEffect(function(){typeof r=="number"&&E!==null&&E.setRadius(r)},[E,r]),h.useEffect(function(){typeof t<"u"&&E!==null&&E.setCenter(t)},[E,t]),h.useEffect(function(){E&&a&&(F!==null&&google.maps.event.removeListener(F),D(google.maps.event.addListener(E,"dblclick",a)))},[a]),h.useEffect(function(){E&&l&&(N!==null&&google.maps.event.removeListener(N),z(google.maps.event.addListener(E,"dragend",l)))},[l]),h.useEffect(function(){E&&c&&($!==null&&google.maps.event.removeListener($),G(google.maps.event.addListener(E,"dragstart",c)))},[c]),h.useEffect(function(){E&&u&&(Z!==null&&google.maps.event.removeListener(Z),V(google.maps.event.addListener(E,"mousedown",u)))},[u]),h.useEffect(function(){E&&d&&(ce!==null&&google.maps.event.removeListener(ce),q(google.maps.event.addListener(E,"mousemove",d)))},[d]),h.useEffect(function(){E&&p&&(I!==null&&google.maps.event.removeListener(I),ie(google.maps.event.addListener(E,"mouseout",p)))},[p]),h.useEffect(function(){E&&f&&(Q!==null&&google.maps.event.removeListener(Q),fe(google.maps.event.addListener(E,"mouseover",f)))},[f]),h.useEffect(function(){E&&m&&(ye!==null&&google.maps.event.removeListener(ye),Le(google.maps.event.addListener(E,"mouseup",m)))},[m]),h.useEffect(function(){E&&g&&(B!==null&&google.maps.event.removeListener(B),R(google.maps.event.addListener(E,"rightclick",g)))},[g]),h.useEffect(function(){E&&y&&(ne!==null&&google.maps.event.removeListener(ne),de(google.maps.event.addListener(E,"click",y)))},[y]),h.useEffect(function(){E&&b&&(we!==null&&google.maps.event.removeListener(we),ve(google.maps.event.addListener(E,"drag",b)))},[b]),h.useEffect(function(){E&&w&&(ue!==null&&google.maps.event.removeListener(ue),_e(google.maps.event.addListener(E,"center_changed",w)))},[y]),h.useEffect(function(){E&&S&&(Ae!==null&&google.maps.event.removeListener(Ae),He(google.maps.event.addListener(E,"radius_changed",S)))},[S]),h.useEffect(function(){var Pe=new google.maps.Circle(je(je({},e||Y6),{map:x}));return typeof r=="number"&&Pe.setRadius(r),typeof t<"u"&&Pe.setCenter(t),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&&D(google.maps.event.addListener(Pe,"dblclick",a)),l&&z(google.maps.event.addListener(Pe,"dragend",l)),c&&G(google.maps.event.addListener(Pe,"dragstart",c)),u&&V(google.maps.event.addListener(Pe,"mousedown",u)),d&&q(google.maps.event.addListener(Pe,"mousemove",d)),p&&ie(google.maps.event.addListener(Pe,"mouseout",p)),f&&fe(google.maps.event.addListener(Pe,"mouseover",f)),m&&Le(google.maps.event.addListener(Pe,"mouseup",m)),g&&R(google.maps.event.addListener(Pe,"rightclick",g)),y&&de(google.maps.event.addListener(Pe,"click",y)),b&&ve(google.maps.event.addListener(Pe,"drag",b)),w&&_e(google.maps.event.addListener(Pe,"center_changed",w)),S&&He(google.maps.event.addListener(Pe,"radius_changed",S)),P(Pe),T&&T(Pe),function(){F!==null&&google.maps.event.removeListener(F),N!==null&&google.maps.event.removeListener(N),$!==null&&google.maps.event.removeListener($),Z!==null&&google.maps.event.removeListener(Z),ce!==null&&google.maps.event.removeListener(ce),I!==null&&google.maps.event.removeListener(I),Q!==null&&google.maps.event.removeListener(Q),ye!==null&&google.maps.event.removeListener(ye),B!==null&&google.maps.event.removeListener(B),ne!==null&&google.maps.event.removeListener(ne),ue!==null&&google.maps.event.removeListener(ue),Ae!==null&&google.maps.event.removeListener(Ae),k&&k(Pe),Pe.setMap(null)}},[]),null}h.memo(J6);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={circle:null},t.setCircleCallback=function(){t.state.circle!==null&&t.props.onLoad&&t.props.onLoad(t.state.circle)},t}return e.prototype.componentDidMount=function(){var t=new google.maps.Circle(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:Qv,eventMap:Xv,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{circle:t}},this.setCircleCallback)},e.prototype.componentDidUpdate=function(t){this.state.circle!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Qv,eventMap:Xv,prevProps:t,nextProps:this.props,instance:this.state.circle}))},e.prototype.componentWillUnmount=function(){var t;this.state.circle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),Qe(this.registeredEvents),(t=this.state.circle)===null||t===void 0||t.setMap(null))},e.prototype.render=function(){return null},e.contextType=We,e})(h.PureComponent);var e0={onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick",onAddFeature:"addfeature",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},t0={add:function(n,e){n.add(e)},addgeojson:function(n,e,t){n.addGeoJson(e,t)},contains:function(n,e){n.contains(e)},foreach:function(n,e){n.forEach(e)},loadgeojson:function(n,e,t,r){n.loadGeoJson(e,t,r)},overridestyle:function(n,e,t){n.overrideStyle(e,t)},remove:function(n,e){n.remove(e)},revertstyle:function(n,e){n.revertStyle(e)},controlposition:function(n,e){n.setControlPosition(e)},controls:function(n,e){n.setControls(e)},drawingmode:function(n,e){n.setDrawingMode(e)},map:function(n,e){n.setMap(e)},style:function(n,e){n.setStyle(e)},togeojson:function(n,e){n.toGeoJson(e)}};function Z6(n){var e=n.options,t=n.onClick,r=n.onDblClick,o=n.onMouseDown,i=n.onMouseMove,s=n.onMouseOut,a=n.onMouseOver,l=n.onMouseUp,c=n.onRightClick,u=n.onAddFeature,d=n.onRemoveFeature,p=n.onRemoveProperty,f=n.onSetGeometry,m=n.onSetProperty,g=n.onLoad,y=n.onUnmount,b=h.useContext(We),w=h.useState(null),S=w[0],T=w[1],k=h.useState(null),x=k[0],C=k[1],E=h.useState(null),P=E[0],O=E[1],F=h.useState(null),D=F[0],U=F[1],N=h.useState(null),z=N[0],_=N[1],$=h.useState(null),G=$[0],le=$[1],Z=h.useState(null),V=Z[0],J=Z[1],ce=h.useState(null),q=ce[0],M=ce[1],I=h.useState(null),ie=I[0],te=I[1],Q=h.useState(null),fe=Q[0],pe=Q[1],ye=h.useState(null),Le=ye[0],Oe=ye[1],B=h.useState(null),R=B[0],oe=B[1],ne=h.useState(null),de=ne[0],he=ne[1],we=h.useState(null),ve=we[0],me=we[1];return h.useEffect(function(){S!==null&&S.setMap(b)},[b]),h.useEffect(function(){S&&r&&(x!==null&&google.maps.event.removeListener(x),C(google.maps.event.addListener(S,"dblclick",r)))},[r]),h.useEffect(function(){S&&o&&(P!==null&&google.maps.event.removeListener(P),O(google.maps.event.addListener(S,"mousedown",o)))},[o]),h.useEffect(function(){S&&i&&(D!==null&&google.maps.event.removeListener(D),U(google.maps.event.addListener(S,"mousemove",i)))},[i]),h.useEffect(function(){S&&s&&(z!==null&&google.maps.event.removeListener(z),_(google.maps.event.addListener(S,"mouseout",s)))},[s]),h.useEffect(function(){S&&a&&(G!==null&&google.maps.event.removeListener(G),le(google.maps.event.addListener(S,"mouseover",a)))},[a]),h.useEffect(function(){S&&l&&(V!==null&&google.maps.event.removeListener(V),J(google.maps.event.addListener(S,"mouseup",l)))},[l]),h.useEffect(function(){S&&c&&(q!==null&&google.maps.event.removeListener(q),M(google.maps.event.addListener(S,"rightclick",c)))},[c]),h.useEffect(function(){S&&t&&(ie!==null&&google.maps.event.removeListener(ie),te(google.maps.event.addListener(S,"click",t)))},[t]),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&&(Le!==null&&google.maps.event.removeListener(Le),Oe(google.maps.event.addListener(S,"removefeature",d)))},[d]),h.useEffect(function(){S&&p&&(R!==null&&google.maps.event.removeListener(R),oe(google.maps.event.addListener(S,"removeproperty",p)))},[p]),h.useEffect(function(){S&&f&&(de!==null&&google.maps.event.removeListener(de),he(google.maps.event.addListener(S,"setgeometry",f)))},[f]),h.useEffect(function(){S&&m&&(ve!==null&&google.maps.event.removeListener(ve),me(google.maps.event.addListener(S,"setproperty",m)))},[m]),h.useEffect(function(){if(b!==null){var ue=new google.maps.Data(je(je({},e||{}),{map:b}));r&&C(google.maps.event.addListener(ue,"dblclick",r)),o&&O(google.maps.event.addListener(ue,"mousedown",o)),i&&U(google.maps.event.addListener(ue,"mousemove",i)),s&&_(google.maps.event.addListener(ue,"mouseout",s)),a&&le(google.maps.event.addListener(ue,"mouseover",a)),l&&J(google.maps.event.addListener(ue,"mouseup",l)),c&&M(google.maps.event.addListener(ue,"rightclick",c)),t&&te(google.maps.event.addListener(ue,"click",t)),u&&pe(google.maps.event.addListener(ue,"addfeature",u)),d&&Oe(google.maps.event.addListener(ue,"removefeature",d)),p&&oe(google.maps.event.addListener(ue,"removeproperty",p)),f&&he(google.maps.event.addListener(ue,"setgeometry",f)),m&&me(google.maps.event.addListener(ue,"setproperty",m)),T(ue),g&&g(ue)}return function(){S&&(x!==null&&google.maps.event.removeListener(x),P!==null&&google.maps.event.removeListener(P),D!==null&&google.maps.event.removeListener(D),z!==null&&google.maps.event.removeListener(z),G!==null&&google.maps.event.removeListener(G),V!==null&&google.maps.event.removeListener(V),q!==null&&google.maps.event.removeListener(q),ie!==null&&google.maps.event.removeListener(ie),fe!==null&&google.maps.event.removeListener(fe),Le!==null&&google.maps.event.removeListener(Le),R!==null&&google.maps.event.removeListener(R),de!==null&&google.maps.event.removeListener(de),ve!==null&&google.maps.event.removeListener(ve),y&&y(S),S.setMap(null))}},[]),null}h.memo(Z6);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={data:null},t.setDataCallback=function(){t.state.data!==null&&t.props.onLoad&&t.props.onLoad(t.state.data)},t}return e.prototype.componentDidMount=function(){if(this.context!==null){var t=new google.maps.Data(je(je({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:t0,eventMap:e0,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{data:t}},this.setDataCallback)}},e.prototype.componentDidUpdate=function(t){this.state.data!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:t0,eventMap:e0,prevProps:t,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=We,e})(h.PureComponent);var n0={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},r0={options:function(n,e){n.setOptions(e)},url:function(n,e){n.setUrl(e)},zIndex:function(n,e){n.setZIndex(e)}};(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={kmlLayer:null},t.setKmlLayerCallback=function(){t.state.kmlLayer!==null&&t.props.onLoad&&t.props.onLoad(t.state.kmlLayer)},t}return e.prototype.componentDidMount=function(){var t=new google.maps.KmlLayer(je(je({},this.props.options),{map:this.context}));this.registeredEvents=Ye({updaterMap:r0,eventMap:n0,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{kmlLayer:t}},this.setKmlLayerCallback)},e.prototype.componentDidUpdate=function(t){this.state.kmlLayer!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:r0,eventMap:n0,prevProps:t,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=We,e})(h.PureComponent);function _1(n,e){return typeof e=="function"?e(n.offsetWidth,n.offsetHeight):{x:0,y:0}}function X6(n,e){return new e(n.lat,n.lng)}function Q6(n,e){return new e(new google.maps.LatLng(n.ne.lat,n.ne.lng),new google.maps.LatLng(n.sw.lat,n.sw.lng))}function ez(n,e,t){return n instanceof e?n:t(n,e)}function tz(n,e,t){return n instanceof e?n:t(n,e)}function nz(n,e,t){var r=n&&n.fromLatLngToDivPixel(t.getNorthEast()),o=n&&n.fromLatLngToDivPixel(t.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 rz(n,e,t){var r=n&&n.fromLatLngToDivPixel(t);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 z1(n,e,t,r){return t!==void 0?nz(n,e,tz(t,google.maps.LatLngBounds,Q6)):rz(n,e,ez(r,google.maps.LatLng,X6))}function oz(n,e){return n.left===e.left&&n.top===e.top&&n.width===e.height&&n.height===e.height}function iz(n,e,t,r,o){var i=function(s){gt(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=je({},this.container?_1(this.container,o):{x:0,y:0}),u=z1(l,c,this.bounds,this.position),d=0,p=Object.entries(u);d? %s',google.maps.visualization),jt(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);var t=new google.maps.visualization.HeatmapLayer(je(je({},this.props.options||{}),{data:this.props.data,map:this.context}));this.registeredEvents=Ye({updaterMap:c0,eventMap:l0,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{heatmapLayer:t}},this.setHeatmapLayerCallback)},e.prototype.componentDidUpdate=function(t){Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:c0,eventMap:l0,prevProps:t,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=We,e})(h.PureComponent);var u0={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},d0={register:function(n,e,t){n.registerPanoProvider(e,t)},links:function(n,e){n.setLinks(e)},motionTracking:function(n,e){n.setMotionTracking(e)},options:function(n,e){n.setOptions(e)},pano:function(n,e){n.setPano(e)},position:function(n,e){n.setPosition(e)},pov:function(n,e){n.setPov(e)},visible:function(n,e){n.setVisible(e)},zoom:function(n,e){n.setZoom(e)}};(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={streetViewPanorama:null},t.setStreetViewPanoramaCallback=function(){t.state.streetViewPanorama!==null&&t.props.onLoad&&t.props.onLoad(t.state.streetViewPanorama)},t}return e.prototype.componentDidMount=function(){var t,r,o=(r=(t=this.context)===null||t===void 0?void 0:t.getStreetView())!==null&&r!==void 0?r:null;this.registeredEvents=Ye({updaterMap:d0,eventMap:u0,prevProps:{},nextProps:this.props,instance:o}),this.setState(function(){return{streetViewPanorama:o}},this.setStreetViewPanoramaCallback)},e.prototype.componentDidUpdate=function(t){this.state.streetViewPanorama!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:d0,eventMap:u0,prevProps:t,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=We,e})(h.PureComponent);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={streetViewService:null},t.setStreetViewServiceCallback=function(){t.state.streetViewService!==null&&t.props.onLoad&&t.props.onLoad(t.state.streetViewService)},t}return e.prototype.componentDidMount=function(){var t=new google.maps.StreetViewService;this.setState(function(){return{streetViewService:t}},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=We,e})(h.PureComponent);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={directionsService:null},t.setDirectionsServiceCallback=function(){t.state.directionsService!==null&&t.props.onLoad&&t.props.onLoad(t.state.directionsService)},t}return e.prototype.componentDidMount=function(){jt(!!this.props.options,"DirectionsService expected options object as parameter, but got %s",this.props.options);var t=new google.maps.DirectionsService;this.setState(function(){return{directionsService:t}},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 p0={onDirectionsChanged:"directions_changed"},f0={directions:function(n,e){n.setDirections(e)},map:function(n,e){n.setMap(e)},options:function(n,e){n.setOptions(e)},panel:function(n,e){n.setPanel(e)},routeIndex:function(n,e){n.setRouteIndex(e)}};(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.state={directionsRenderer:null},t.setDirectionsRendererCallback=function(){t.state.directionsRenderer!==null&&(t.state.directionsRenderer.setMap(t.context),t.props.onLoad&&t.props.onLoad(t.state.directionsRenderer))},t}return e.prototype.componentDidMount=function(){var t=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=Ye({updaterMap:f0,eventMap:p0,prevProps:{},nextProps:this.props,instance:t}),this.setState(function(){return{directionsRenderer:t}},this.setDirectionsRendererCallback)},e.prototype.componentDidUpdate=function(t){this.state.directionsRenderer!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:f0,eventMap:p0,prevProps:t,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=We,e})(h.PureComponent);(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.state={distanceMatrixService:null},t.setDistanceMatrixServiceCallback=function(){t.state.distanceMatrixService!==null&&t.props.onLoad&&t.props.onLoad(t.state.distanceMatrixService)},t}return e.prototype.componentDidMount=function(){jt(!!this.props.options,"DistanceMatrixService expected options object as parameter, but go %s",this.props.options);var t=new google.maps.DistanceMatrixService;this.setState(function(){return{distanceMatrixService:t}},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 h0={onPlacesChanged:"places_changed"},m0={bounds:function(n,e){n.setBounds(e)}};(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.containerElement=h.createRef(),t.state={searchBox:null},t.setSearchBoxCallback=function(){t.state.searchBox!==null&&t.props.onLoad&&t.props.onLoad(t.state.searchBox)},t}return e.prototype.componentDidMount=function(){if(jt(!!google.maps.places,'You need to provide libraries={["places"]} prop to component %s',google.maps.places),this.containerElement!==null&&this.containerElement.current!==null){var t=this.containerElement.current.querySelector("input");if(t!==null){var r=new google.maps.places.SearchBox(t,this.props.options);this.registeredEvents=Ye({updaterMap:m0,eventMap:h0,prevProps:{},nextProps:this.props,instance:r}),this.setState(function(){return{searchBox:r}},this.setSearchBoxCallback)}}},e.prototype.componentDidUpdate=function(t){this.state.searchBox!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:m0,eventMap:h0,prevProps:t,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=We,e})(h.PureComponent);var g0={onPlaceChanged:"place_changed"},v0={bounds:function(n,e){n.setBounds(e)},restrictions:function(n,e){n.setComponentRestrictions(e)},fields:function(n,e){n.setFields(e)},options:function(n,e){n.setOptions(e)},types:function(n,e){n.setTypes(e)}};(function(n){gt(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.registeredEvents=[],t.containerElement=h.createRef(),t.state={autocomplete:null},t.setAutocompleteCallback=function(){t.state.autocomplete!==null&&t.props.onLoad&&t.props.onLoad(t.state.autocomplete)},t}return e.prototype.componentDidMount=function(){var t;jt(!!google.maps.places,'You need to provide libraries={["places"]} prop to component %s',google.maps.places);var r=(t=this.containerElement.current)===null||t===void 0?void 0:t.querySelector("input");if(r){var o=new google.maps.places.Autocomplete(r,this.props.options);this.registeredEvents=Ye({updaterMap:v0,eventMap:g0,prevProps:{},nextProps:this.props,instance:o}),this.setState(function(){return{autocomplete:o}},this.setAutocompleteCallback)}},e.prototype.componentDidUpdate=function(t){Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:v0,eventMap:g0,prevProps:t,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=We,e})(h.PureComponent);const H1=["places"],wh={lat:0,lng:0};async function uz(n){const e=n.getBounds();if(e)return e;let t;return new Promise(r=>{t=google.maps.event.addListener(n,"bounds_changed",()=>{r(n.getBounds()),google.maps.event.removeListener(t)})})}function es(n){return!(!n||n.lat===void 0||n.lng===void 0||Number.isNaN(n.lat)||Number.isNaN(n.lng)||typeof mh(n.lat)=="string"||typeof gh(n.lng)=="string")}function dz(n){return n?/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/.test(n):!1}function y0(n,e){return n===e||n&&e&&n.lat===e.lat&&n.lng===e.lng}const pz=Y.div` + &.mapCoordinates { + margin-bottom: 8px; + } +`,b0=Y(Yc)` + min-width: 684px; + + &.MuiTextField-root { + display: flex; + } +`,fz=Y(hb)` + cursor: pointer; + color: ${j.newColors.almostBlack[100]}; +`,hz=Y.div` + background-color: white; + border: ${j.borders.fieldGray}; + border-top: 0; + font-family: ${j.fontFamily}; + padding: 8px 0; + box-shadow: 0 1px 3px rgba(0,0,0,.05); +`,mz=Y.div` + background-color: ${({$isSuggestionActive:n})=>n?j.colors.gray200:"white"}; + cursor: pointer; + padding: 6px 16px; + width: 100%; +`,gz=Y.p` + font-size: 14px; + margin: 0; + + &:active { + color: ${j.colors.gray800}; + font-weight: ${j.fontWeight.bold}; + } +`,vz=n=>{const{className:e,value:t,onChange:r,onBlur:o,onSelect:i,textField:s,placeholder:a,googleMapsApiKey:l,disabled:c,id:u}=n,[d,p]=h.useState(null),{isLoaded:f,loadError:m}=yh({googleMapsApiKey:l,libraries:H1}),g=w=>{p(w.target)},y=()=>{p(null),o&&o()},b={...s,inputProps:{"data-testid":"location-search-input"},variant:"outlined",value:t,onFocus:g,onBlur:y};return!f||m?v.jsx(b0,{...b,fieldSize:"lg",onChange:({target:{value:w}})=>r(w),disabled:c,id:u}):v.jsx(pz,{className:e,children:v.jsx(O4,{value:t,onChange:r,onSelect:i,children:({getInputProps:w,suggestions:S,getSuggestionItemProps:T})=>v.jsxs("div",{style:{position:"relative"},children:[v.jsx(b0,{...b,...w({placeholder:a}),onFocus:g,onBlur:y,disabled:c,id:u}),v.jsx(Rk,{open:!!d&&(S==null?void 0:S.length)>0,anchorEl:d,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"left"},disableAutoFocus:!0,disableEnforceFocus:!0,children:v.jsx(hz,{children:S==null?void 0:S.map(k=>h.createElement(mz,{...T(k),key:k==null?void 0:k.placeId,$isSuggestionActive:k==null?void 0:k.active},v.jsx(gz,{children:k==null?void 0:k.description})))})})]})})})},V1=h.memo(vz),yr={no:"street_number",street:"route",neighborhood:"neighborhood",locality:"locality",town:"postal_town",area1:"administrative_area_level_1",area2:"administrative_area_level_2",country:"country",postcode:"postal_code"},yz=Y.div` + display: flex; + flex-direction: row; + align-items: start; + gap: 0 20px; + min-width: 0; + + ${Nt("lg","FORM")} { + gap: 0 40px; + } +`,bz=Y.div` + font-family: ${j.fontFamily}; + position: relative; + min-width: 0; + flex-grow: 1; + display: flex; + flex-direction: column; + align-items: start; + + ${({$error:n,$spacing:e})=>n&&` + background-color: ${j.newColors.darkRed[5]}; + margin: ${e==="compact"?"0 -8px -8px":"-4px -12px -8px"}; + padding: ${e==="compact"?"0 8px 8px":"4px 12px 8px"}; + `} +`,xz=Y.div` + max-width: 100%; + + ${({$fullWidth:n})=>n&&` + width: 100%; + `} +`,wz=Y.div` + display: flex; + flex-direction: column; + align-items: stretch; + max-width: 100%; + + ${({$size:n})=>` + width: ${n!=="full"?n:"100%"}; + `} +`,Cz=Y.div` + display: flex; + align-items: end; + margin-bottom: 8px; + font-family: ${j.fontFamily}; + gap: 8px; + + .MuiInputLabel-root { + font-family: inherit; + font-size: 16px; + color: ${j.newColors.almostBlack[100]}; + word-wrap: break-word; + text-overflow: clip; + white-space: normal; + } +`,Sz=Y.div` + font-family: inherit; + font-size: 16px; + color: ${j.newColors.almostBlack[100]}; + word-wrap: break-word; +`,kz=Y.div` + color: ${({$invalid:n})=>n?j.newColors.darkRed[100]:j.newColors.grey3[100]}; + font-size: 12px; + margin-left: auto; +`,Mz=Y(ab)` + font-weight: ${j.fontWeight.semiBold} !important; + align-self: center; + color: ${j.newColors.grey4[100]} !important; +`,Ez=Y.span` + color: ${j.newColors.darkRed[100]}; +`,Tz=Y.div` + ${({$colsInRow:n=1})=>n===1&&` + ${Nt("sm","FORM_COL")} { + display: none; + } + `} + + svg { + vertical-align: middle; + } +`,Oz=n=>{const{children:e,className:t,required:r,name:o,limit:i,instructionText:s,colsInRow:a,as:l="label"}=n,{anchorProps:c,tooltipProps:u}=of();return v.jsxs(Cz,{className:t,children:[v.jsxs(Mz,{htmlFor:l==="label"&&o?`${o}-input`:void 0,as:l==="label"?ab:Sz,"data-testid":o&&`${Mr.FORM_FIELD_LABEL}:${o}`,title:typeof e=="string"?e:void 0,children:[e,r&&v.jsx(Ez,{children:"*"})]}),s&&v.jsxs(Tz,{$colsInRow:a,children:[v.jsx(SM,{...c}),v.jsx(sf,{...u,children:s})]}),i&&v.jsxs(kz,{$invalid:i[0]>i[1],children:[i[0],"/",i[1]]})]})},Lz=Y.div` + align-items: center; + display: flex; + flex-direction: row; + margin-top: ${j.fieldSpecs.inputSpacing.helperText.marginTop}; +`,Az=Y(Cf)` + &.MuiSvgIcon-root { + font-size: 16px; + color: ${({$error:n})=>n?j.newColors.darkRed[100]:"transparent"}; + margin-right: 8px; + } +`,x0=Y(sb)` + &.MuiFormHelperText-root { + color: ${j.newColors.grey3[100]}; + font-family: ${j.fontFamily}; + font-size: 12px; + margin-top: ${j.fieldSpecs.inputSpacing.helperText.marginTop}; + } + + &.MuiFormHelperText-root.Mui-error { + color: ${j.newColors.darkRed[100]}; + margin: 0; + } +`,fp=({children:n,error:e=!1})=>e?v.jsxs(Lz,{children:[v.jsx(Az,{$error:!!n,"data-testid":"error-icon-test-id"}),v.jsx(x0,{error:e,children:n})]}):v.jsx(x0,{error:e,children:n}),Pz=Y.div` + padding-left: 20px; + border-left: 2px solid ${j.newColors.grey2[100]}; + flex: none; + align-self: stretch; + margin-left: auto; + display: none; + width: 180px; + + ${({$colsInRow:n=1})=>n===1&&` + ${Nt("sm","FORM_COL")} { + display: block; + } + + ${Nt("md","FORM_COL")} { + width: 420px; + } + `} +`,Dz=Y.p` + color: ${j.newColors.grey3[100]}; + font-family: ${j.fontFamily}; + font-size: 14px; + margin: 0; +`,U1=n=>{const{children:e,colsInRow:t}=n;return v.jsx(Pz,{$colsInRow:t,children:v.jsx(Dz,{children:e})})};U1.displayName="InstructionText";function W1(n){const{fieldDef:{name:e}={},skeleton:t,methods:{mountField:r}={},inputRef:o,fieldRef:i}=n;h.useEffect(()=>{if(!r||!e||t)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,t,i])}function Rz(n){if(!(!n||!n.inputSettings)){if(n.type==="text"||n.type==="textEditor")return n.inputSettings.maxCharacters;if(n.type==="advancedSelection")return n.inputSettings.selectLimit<2?void 0:n.inputSettings.selectLimit}}function Iz(n,e){return typeof n=="string"?e.type==="textEditor"?T1(n):fh(n):Array.isArray(n)?n.length:0}function $z(n,e){return h.useMemo(()=>{const t=Rz(e);return t===void 0?void 0:[Iz(n,e),t]},[e,n])}const Nz=["color","date","dropdown","number","phone","text","textEditor","time"],Bz=n=>{var b;const{children:e,error:t,fieldDef:r,colsInRow:o,value:i,id:s,spacing:a,disabled:l,skeleton:c,useRealLabel:u}=n,d=h.useRef(),p=typeof t=="string"?(t==null?void 0:t.trim().length)>0:!1,f=p||p&&(r==null?void 0:r.required)||typeof t=="boolean"&&t===!0,m=$z(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);W1({...n,fieldRef:d});const y=u||Nz.includes(r==null?void 0:r.type);return v.jsxs(yz,{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(bz,{$error:f,$spacing:a,children:[v.jsxs(xz,{$fullWidth:(r==null?void 0:r.size)==="full",children:[g&&(c?v.jsx(Xe,{width:92,height:28,sx:{marginBottom:"8px"}}):v.jsx(Oz,{required:r==null?void 0: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(wz,{$size:r==null?void 0:r.size,children:e})]}),f?v.jsx(fp,{error:!!t,children:typeof t=="string"?t: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(U1,{colsInRow:o,children:r.instructionText})]})},G1=h.memo(Bz);function Fz({children:n,...e}){return W1(e),v.jsx(v.Fragment,{children:n})}const jz=h.memo(Fz);function _z(n,e){if(n===e||n===void 0&&Object.values(e).every(r=>r===void 0)||e===void 0&&Object.values(n).every(r=>r===void 0))return!0;if(!n||!e)return!1;const t=n.types===e.types||!th(n.types||[],e.types||[]).length;return String(n.address1)===String(e.address1)&&String(n.address2)===String(e.address2)&&String(n.address3)===String(e.address3)&&String(n.city)===String(e.city)&&String(n.state)===String(e.state)&&String(n.postalCode)===String(e.postalCode)&&String(n.country)===String(e.country)&&t}const zz=n=>{const{onSave:e,addressToEdit:t,handleClose:r,handleUnsavedChanges:o,dialogOpen:i,handleDialogClose:s,addressTypes:a,getOptionsCountries:l,getOptionsStates:c,googleMapsApiKey:u}=n,d=fu(),{state:p,methods:{setFieldValue:f,setFormValues:m},handleSubmit:g}=d,[y,b]=h.useState(""),[w,S]=h.useState(""),[T,k]=h.useState(!1);h.useEffect(()=>{o&&o(!_z(t,p.data))},[t,p.data]),h.useEffect(()=>{if(!p.data.country||!p.data.state)return;(async()=>{(await c(p.data.country.value)).find(({label:V})=>V.toLowerCase().includes(p.data.state.label.toLowerCase()))||f({name:"state",value:void 0})})()},[f,p.data.country,p.data.state,c]);const x=g(h.useCallback(async()=>{e({...t||{},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,t,p.data.address1,p.data.address2,p.data.address3,p.data.city,p.data.state,p.data.postalCode,p.data.country,p.data.types])),C=h.useCallback(async G=>{const le=fe=>{const pe=G.find(({types:ye})=>ye.includes(fe));return!pe||!pe.long_name?"":pe.long_name},Z=!!le(yr.town),V=[{label:"Address 1",value:[le(yr.no),le(yr.street)].filter(Boolean).join(" "),dataKey:"address1",emptyWarning:!0},{label:"Address 2",value:Z?le(yr.locality):"",dataKey:"address2"},{label:"City",value:le(Z?yr.town:yr.locality),dataKey:"city",emptyWarning:!0},{label:"Postal Code",value:le(yr.postcode),dataKey:"postalCode",emptyWarning:!0}],J=await l(),ce=le(yr.country),q=J.find(({label:fe})=>fe.toLowerCase().includes(ce.toLowerCase()));V.push({label:"Country",value:q||"",dataKey:"country",emptyWarning:!0});const M=q?await c(q.value):[],I=le(Z?yr.area2:yr.area1),ie=M.find(({label:fe})=>fe.toLowerCase().includes(I.toLowerCase()));V.push({label:"State",value:ie||"",dataKey:"state",emptyWarning:!0});const te=V.reduce((fe,pe)=>({...fe,[pe.dataKey]:pe.value}),{}),Q=V.filter(({emptyWarning:fe,value:pe})=>fe&&!pe);m({values:te}),Q.length&&(console.warn("Some components could not be resolved.",` + +Components received: +`,G,` - &:highlight, - &:hover { - background-color: rgba(0, 0, 0, 0.04); - } +By type they are: +`,G.map(({types:[fe],long_name:pe})=>`${fe}: ${pe}`).join(` +`),` - & .flag { - width: 25px; - height: 20px; - background-repeat: no-repeat; - } - } +Mosaic Result: +`,V),S(Q.map(({label:fe})=>fe).join(", ")),k(!0))},[l,c,m]),E=h.useCallback(async G=>{try{const le=await ph(G);C(le[0].address_components)}catch(le){console.error(le)}},[C]),P=h.useCallback((G,le)=>{le!=="clickaway"&&k(!1)},[]),O=h.useCallback(G=>{const{fieldDef:le}=G,{inputSettings:Z}=le;return v.jsx(G1,{error:G.error,id:le.name,fieldDef:{name:le.name,type:"autocomplete",label:le.label,required:le.required,size:wt.lg},methods:G.methods,disabled:G.disabled,useRealLabel:!0,children:v.jsx(V1,{onChange:V=>G.onChange(V),onBlur:G.onBlur,value:G.value??"",onSelect:Z.onSelect,googleMapsApiKey:u,disabled:G.disabled,id:`${le.name}-input`})})},[u]),F=h.useMemo(()=>[{fields:[[["address1"]],[["address2"]],[["address3"]],[["country"]],[["city"],["state"],["postalCode"]],...a?[[["types"]]]:[]]}],[a]),D=h.useMemo(()=>a?[{name:"types",type:"checkbox",label:"Type",size:"sm",required:!0,inputSettings:{options:[...a,...t?t.types.filter(G=>!a.find(({value:le})=>le===G.value)):[]]}}]:[],[a,t]),U=h.useMemo(()=>[{name:"address1",required:!0,type:O,label:"Address",inputSettings:{address:y,setAddress:b,onSelect:E}}],[O,y,E]),N=h.useMemo(()=>[{name:"country",type:"dropdown",label:"Country",size:"sm",required:!0,inputSettings:{getOptions:l},validates:[{name:"postalCode",include:[O1]}]},{name:"address2",type:"text",label:void 0,size:"lg"},{name:"address3",type:"text",label:void 0,size:"lg"},{name:"city",type:"text",label:"City",size:"sm",required:!0},{name:"state",type:"dropdown",label:"State",size:"sm",inputSettings:{getOptions:async()=>p.data.country?c(p.data.country.value):[]}},{name:"postalCode",type:"text",label:"Postal Code",size:"sm",required:!0,inputSettings:{type:"string"},validators:[{fn:"validatePostcode",options:{countryField:"country"}}]},...D],[l,D,c,p.data.country]),z=h.useMemo(()=>[...U,...N,...D],[N,D,U]),_=h.useCallback(async()=>{if(!t)return{};const G={address1:t.address1,address2:t.address2,address3:t.address3,city:t.city,state:t.state,postalCode:t.postalCode,country:t.country};return a&&(G.types=t.types),G},[t,a]),$=h.useMemo(()=>[{label:"Cancel",onClick:()=>r(),color:"gray",variant:"outlined"},{label:"Save",onClick:x,color:"yellow",variant:"contained",type:"submit"}],[r,x]);return v.jsxs(gf,{className:"address",children:[v.jsx(Lu,{...d,onBack:r,backLabel:"Cancel address entry",title:"Address Information",buttons:$,"data-testid":"address-testid",sections:F,fields:z,dialogOpen:i,handleDialogClose:s,getFormValues:_}),v.jsx(mf,{autoHideDuration:4e3,label:`The following fields could not be autocompleted: ${w}.`,open:T,onClose:P})]})},Hz=Y.div` + display: flex; + flex-direction: column; + color: ${j.newColors.almostBlack[100]}; + background-color: ${j.newColors.grey1[100]}; + font-family: ${j.fontFamily}; + height: 204px; + padding: 24px 16px 16px 24px; + width: 300px; - li.highlight, - li:hover { - background-color: rgba(0, 0, 0, 0.04); - } -`,TH=A.forwardRef(function({children:e,anchorEl:t},r){return v.jsx(MH,{open:!0,anchorEl:t,style:{width:t.clientWidth},children:v.jsx(ka,{children:v.jsx(EH,{ref:r,children:e})})})}),OH=n=>{var u,d;const{fieldDef:e,error:t,onChange:r,onBlur:o,value:i,disabled:s,inputRef:a,id:l,skeleton:c}=n;return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(kH,{$error:!!(e!=null&&e.required&&t),onBlur:p=>o&&o(p.target.value),$disabled:s,children:v.jsx(SH,{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:TH})})},LH=h.memo(OH),AH=Y(N_)` - margin-left: -12px; -`,PH=Y.div` - display: flex; - flex-flow: column; -`,DH=Y.div` - display: flex; - align-items: center; -`,RH=Y.div` - display: flex; - align-items: center; - justify-content: center; - width: 18px; - height: 40px; - margin-right: 14px; -`;function id(){return v.jsxs(DH,{children:[v.jsx(RH,{children:v.jsx(Xe,{variant:"circular",width:18,height:18})}),v.jsx(Xe,{width:52,height:28})]})}function IH(){return v.jsxs(PH,{children:[v.jsx(id,{}),v.jsx(id,{}),v.jsx(id,{})]})}const $H=n=>{var f,m;const{fieldDef:e,onChange:t,value:r,onBlur:o,disabled:i,skeleton:s}=n,[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 w=await e.inputSettings.getOptions();l(w),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(Wk,{disabled:i,label:g.label,value:g.value},g.label))}),p=g=>{const y=a.find(b=>b.value===g);t(y)};return s?v.jsx(IH,{}):v.jsx(AH,{onChange:g=>t&&p(g.target.value),value:r?r.value:"",onBlur:g=>o&&o(g.target.value),children:d})},NH=h.memo($H),BH=n=>{const{value:e}=n;return v.jsx(v.Fragment,{children:e})},FH=h.memo(BH),jH=n=>{var m,g,y,b,w,S,T,k;const{fieldDef:e,error:t,onChange:r,onBlur:o,value:i,disabled:s,inputRef:a,id:l,skeleton:c}=n,u=(m=e==null?void 0:e.inputSettings)!=null&&m.prefixElement?{startAdornment:v.jsx(sa,{position:"start",children:(g=e==null?void 0:e.inputSettings)==null?void 0:g.prefixElement})}:null,d=x=>{const{value:C}=x.target;r&&r(C===""?void 0:C)},p=x=>{const{value:C}=x.target;o&&o(C===""?void 0:C),e!=null&&e.onBlurCb&&(e==null||e.onBlurCb(C))},f=typeof t=="string"?(t==null?void 0:t.trim().length)>0:!1;return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(Yc,{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:((w=e==null?void 0:e.inputSettings)==null?void 0:w.type)==="number"?"text":(S=e==null?void 0:e.inputSettings)==null?void 0:S.type,minRows:(T=e==null?void 0:e.inputSettings)==null?void 0:T.minRows,maxRows:(k=e==null?void 0:e.inputSettings)==null?void 0:k.maxRows,disabled:s})},_H=h.memo(jH);function on(n){this.content=n}on.prototype={constructor:on,find:function(n){for(var e=0;e>1}};on.from=function(n){if(n instanceof on)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new on(e)};function Z1(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let o=n.child(r),i=e.child(r);if(o==i){t+=o.nodeSize;continue}if(!o.sameMarkup(i))return t;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)t++;return t}if(o.content.size||i.content.size){let s=Z1(o.content,i.content,t+1);if(s!=null)return s}t+=o.nodeSize}}function X1(n,e,t,r){for(let o=n.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:t,b:r};let s=n.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){t-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:t,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,t-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,o){let i="",s=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-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 t=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(o[o.length-1]=t.withText(t.text+r.text),i=1);ie)for(let i=0,s=0;se&&((st)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),o+=a.nodeSize),s=l}return new ee(r,o)}cutByIndex(e,t){return e==t?ee.empty:e==0&&t==this.content.length?this:new ee(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let o=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return o[e]=t,new ee(o,i)}addToStart(e){return new ee([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ee(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.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||t>0?ul(r+1,s):ul(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,t){if(!t)return ee.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ee(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ee.empty;let t,r=0;for(let o=0;othis.type.rank&&(t||(t=e.slice(0,o)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-o.type.rank),t}};ht.none=[];class ts extends Error{}class se{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ew(this.content,e+this.openStart,t);return r&&new se(r,this.openStart,this.openEnd)}removeBetween(e,t){return new se(Q1(this.content,e+this.openStart,t+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,t){if(!t)return se.empty;let r=t.openStart||0,o=t.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new se(ee.fromJSON(e,t.content),r,o)}static maxOpen(e,t=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)o++;return new se(e,r,o)}}se.empty=new se(ee.empty,0,0);function Q1(n,e,t){let{index:r,offset:o}=n.findIndex(e),i=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(o==e||i.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Q1(i.content,e-o-1,t-o-1)))}function ew(n,e,t,r){let{index:o,offset:i}=n.findIndex(e),s=n.maybeChild(o);if(i==e||s.isText)return n.cut(0,e).append(t).append(n.cut(e));let a=ew(s.content,e-i-1,t);return a&&n.replaceChild(o,s.copy(a))}function zH(n,e,t){if(t.openStart>n.depth)throw new ts("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ts("Inconsistent open depths");return tw(n,e,t,0)}function tw(n,e,t,r){let o=n.index(r),i=n.node(r);if(o==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Js(n,e,t,r){let o=(e||n).node(t),i=0,s=e?e.index(t):o.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(_o(n.nodeAfter,r),i++));for(let a=i;ao&&gp(n,e,o+1),s=r.depth>o&&gp(t,r,o+1),a=[];return Js(null,n,o,a),i&&s&&e.index(o)==t.index(o)?(nw(i,s),_o(zo(i,rw(n,e,t,r,o+1)),a)):(i&&_o(zo(i,nc(n,e,o+1)),a),Js(e,t,o,a),s&&_o(zo(s,nc(t,r,o+1)),a)),Js(r,null,o,a),new ee(a)}function nc(n,e,t){let r=[];if(Js(null,n,t,r),n.depth>t){let o=gp(n,e,t+1);_o(zo(o,nc(n,e,t+1)),r)}return Js(e,null,t,r),new ee(r)}function HH(n,e){let t=e.depth-n.openStart,o=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)o=e.node(i).copy(ee.from(o));return{start:o.resolveNoCache(n.openStart+t),end:o.resolveNoCache(o.content.size-n.openEnd-t)}}class da{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw 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,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(t);return r?e.child(t).cut(r):o}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],o=t==0?0:this.path[t*3-1]+1;for(let i=0;i0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new rc(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&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],o=0,i=t;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 da(t,r,i)}static resolveCached(e,t){let r=L0.get(e);if(r)for(let i=0;ie&&this.nodesBetween(e,t,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()+")"),ow(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=ee.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=o;lt.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let o=ee.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};Ho.prototype.text=void 0;class oc extends Ho{constructor(e,t,r,o){if(super(e,t,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):ow(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new oc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new oc(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function ow(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Ko{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new GH(e,t);if(r.next==null)return Ko.empty;let o=iw(r);r.next&&r.err("Unexpected trailing text");let i=QH(XH(o));return e8(i,r),i}matchType(e){for(let t=0;tc.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 t(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(` -`)}}Ko.empty=new Ko(!0);class GH{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function iw(n){let e=[];do e.push(KH(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function KH(n){let e=[];do e.push(qH(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function qH(n){let e=ZH(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=YH(n,e);else break;return e}function A0(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function YH(n,e){let t=A0(n),r=t;return n.eat(",")&&(n.next!="}"?r=A0(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function JH(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let o=[];for(let i in t){let s=t[i];s.groups.indexOf(e)>-1&&o.push(s)}return o.length==0&&n.err("No node type or group '"+e+"' found"),o}function ZH(n){if(n.eat("(")){let e=iw(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=JH(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function XH(n){let e=[[]];return o(i(n,0),t()),e;function t(){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=t())}else if(s.type=="star"){let l=t();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=t();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{n[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 Ko(r.indexOf(n.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[i]=new dw(i,t,s));let o=t.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 t8(n,e,t){let r=t.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 ${n}, got ${i}`)}}class n8{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?t8(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Na{constructor(e,t,r,o){this.name=e,this.rank=t,this.schema=r,this.spec=o,this.attrs=uw(e,o.attrs),this.excluded=null;let i=aw(this.attrs);this.instance=i?new ht(this,i):null}create(e=null){return!e&&this.instance?this.instance:new ht(this,lw(this.attrs,e))}static compile(e,t){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Na(i,o++,t,s)),r}removeFromSet(e){for(var t=0;t-1}}class pw{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let o in e)t[o]=e[o];t.nodes=on.from(e.nodes),t.marks=on.from(e.marks||{}),this.nodes=D0.compile(this.spec.nodes,this),this.marks=Na.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]=Ko.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?R0(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==""?[]:R0(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,t=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof D0){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(t,r,o)}text(e,t){let r=this.nodes.text;return new oc(r,r.defaultAttrs,e,ht.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Ho.fromJSON(this,e)}markFromJSON(e){return ht.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function R0(n,e){let t=[];for(let r=0;r-1)&&t.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function r8(n){return n.tag!=null}function o8(n){return n.style!=null}let Zs=class yp{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(o=>{if(r8(o))this.tags.push(o);else if(o8(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,t={}){let r=new $0(this,t,!1);return r.addAll(e,ht.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new $0(this,t,!0);return r.addAll(e,ht.none,t.from,t.to),se.maxOpen(r.finish())}matchTag(e,t,r){for(let o=r?this.tags.indexOf(r)+1:0;oe.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(s.getAttrs){let l=s.getAttrs(t);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let t=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s{r(s=N0(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=N0(s)),s.node||s.ignore||s.mark||(s.node=o)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new yp(e,yp.schemaRules(e)))}};const fw={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},i8={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},hw={ol:!0,ul:!0},ic=1,sc=2,Xs=4;function I0(n,e,t){return e!=null?(e?ic:0)|(e==="full"?sc:0):n&&n.whitespace=="pre"?ic|sc:t&~Xs}class dl{constructor(e,t,r,o,i,s){this.type=e,this.attrs=t,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=ht.none,this.match=i||(s&Xs?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(ee.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);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&ic)){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 t=ee.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(ee.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!fw.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class $0{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let o=t.topNode,i,s=I0(null,t.preserveWhitespace,0)|(r?Xs:0);o?i=new dl(o.type,o.attrs,ht.none,!0,t.topMatch||o.type.contentMatch,s):r?i=new dl(null,null,ht.none,!0,null,s):i=new dl(e.schema.topNodeType,null,ht.none,!0,null,s),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,o=this.top;if(o.options&sc||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o.options&ic)o.options&sc?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),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let o=e.nodeName.toLowerCase(),i;hw.hasOwnProperty(o)&&this.parser.normalizeLists&&s8(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,r));if(s?s.ignore:i8.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);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(fw.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,t);return}let u=s&&s.skip?t:this.readStyles(e,t);u&&this.addAll(e,u),a&&this.sync(l),this.needsBlock=c}else{let a=this.readStyles(e,t);a&&this.addElementByRule(e,s,a,s.consuming===!1?i:void 0)}}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let o=0;o!l.clearMark(c)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,r,o){let i,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(s,t.attrs||null,r,t.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[t.mark];r=r.concat(l.create(t.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,r)}i&&this.sync(a)&&this.open--}addAll(e,t,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,t);this.findAtPoint(e,i)}findPlace(e,t){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):B0(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new dl(e,t,l,o,null,a)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=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=t[a];if(c==""){if(a==t.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(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function s8(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&hw.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function a8(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function N0(n){let e={};for(let t in n)e[t]=n[t];return e}function B0(n,e){let t=e.schema.nodes;for(let r in t){let o=t[r];if(!o.allowsMarkType(n))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,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let o=this.marks[e.type.name];return o&&Ml(ad(r),o(e,t),null,e.attrs)}static renderSpec(e,t,r=null,o){return Ml(e,t,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new li(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=F0(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return F0(e.marks)}}function F0(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function ad(n){return n.document||window.document}const j0=new WeakMap;function l8(n){let e=j0.get(n);return e===void 0&&j0.set(n,e=c8(n)),e}function c8(n){let e=null;function t(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&&(t=o.slice(0,s),o=o.slice(s+1));let a,l=t?n.createElementNS(t,o):n.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}=Ml(n,p,t,r);if(l.appendChild(f),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const mw=65535,gw=Math.pow(2,16);function u8(n,e){return n+e*gw}function _0(n){return n&mw}function d8(n){return(n-(n&mw))/gw}const vw=1,yw=2,El=4,bw=8;let bp=class{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&bw)>0}get deletedBefore(){return(this.delInfo&(vw|El))>0}get deletedAfter(){return(this.delInfo&(yw|El))>0}get deletedAcross(){return(this.delInfo&El)>0}},qo=class Bi{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Bi.empty)return Bi.empty}recover(e){let t=0,r=_0(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:t:t,f=l+o+(p<0?0:u);if(r)return f;let m=e==(t<0?l:d)?null:u8(a/3,e-l),g=e==l?yw:e==d?vw:El;return(t<0?e!=l:e!=d)&&(g|=bw),new bp(f,g,m)}o+=u-c}return r?e+o:new bp(e+o,0,null)}touches(e,t){let r=0,o=_0(t),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 t=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o=0;t--){let o=e.getMirror(t);this.appendMap(e.maps[t].invert(),o!=null&&o>t?r-o-1:void 0)}}invert(){let e=new Tl;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!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),t.openStart,t.openEnd);return bn.fromReplace(e,this.from,this.to,i)}invert(){return new Ba(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Rs(t.pos,r.pos,this.mark)}merge(e){return e instanceof Rs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Rs(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Rs(t.from,t.to,e.markFromJSON(t.mark))}};hn.jsonID("addMark",kh);let Ba=class Is extends hn{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new se(Sh(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return bn.fromReplace(e,this.from,this.to,r)}invert(){return new kh(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Is(t.pos,r.pos,this.mark)}merge(e){return e instanceof Is&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Is(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Is(t.from,t.to,e.markFromJSON(t.mark))}};hn.jsonID("removeMark",Ba);let Mh=class $s extends hn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return bn.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return bn.fromReplace(e,this.pos,this.pos+1,new se(ee.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let o=0;or.pos?null:new Ol(t.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ol(t.from,t.to,t.gapFrom,t.gapTo,se.fromJSON(e,t.slice),t.insert,!!t.structure)}};hn.jsonID("replaceAround",vr);function wp(n,e,t){let r=n.resolve(e),o=t-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 p8(n,e,t,r){let o=[],i=[],s,a;n.doc.nodesBetween(e,t,(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,t),m=r.addToSet(d);for(let g=0;gn.step(l)),i.forEach(l=>n.step(l))}function f8(n,e,t,r){let o=[],i=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Na){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,t);for(let u=0;un.step(new Ba(s.from,s.to,s.style)))}function ww(n,e,t,r=t.contentMatch,o=!0){let i=n.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)n.step(s[l])}function h8(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function m8(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let o=n.$from.node(r),i=n.$from.index(r),s=n.$to.indexAfter(r);if(rt;m--)g||r.index(m)>0?(g=!0,u=ee.from(r.node(m).copy(u)),d++):l--;let p=ee.empty,f=0;for(let m=i,g=!1;m>t;m--)g||o.after(m+1)=0;s--){if(r.size){let a=t[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=ee.from(t[s].type.create(t[s].attrs,r))}let o=e.start,i=e.end;n.step(new vr(o,i,o,i,new se(r,0,0),t.length,!0))}function w8(n,e,t,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&k8(n.doc,n.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&&S8(n,s,a,i),ww(n,n.mapping.slice(i).map(a,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(a,1),p=u.map(a+s.nodeSize,1);return n.step(new vr(d,p,d+1,p-1,new se(ee.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&C8(n,s,a,i),!1}})}function C8(n,e,t,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=n.mapping.slice(r).map(t+1+i+s.index);n.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function S8(n,e,t,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+i);n.replaceWith(s,s+1,e.type.schema.text(` -`))}})}function k8(n,e,t){let r=n.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,t)}function M8(n,e,t,r,o){let i=n.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let s=t.create(r,null,o||i.marks);if(i.isLeaf)return n.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new vr(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new se(ee.from(s),0,0),1,!0))}function E8(n,e,t=1,r){let o=n.resolve(e),i=o.depth-t,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=t-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 T8(n,e,t=1,r){let o=n.doc.resolve(e),i=ee.empty,s=ee.empty;for(let a=o.depth,l=o.depth-t,c=t-1;a>l;a--,c--){i=ee.from(o.node(a).copy(i));let u=r&&r[c];s=ee.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}n.step(new zr(e,e,new se(i.append(s),t,t),!0))}function O8(n,e){let t=n.resolve(e),r=t.index();return L8(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function L8(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function A8(n,e,t){let r=new zr(e-t,e+t,se.empty,!0);n.step(r)}function P8(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))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,t))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,t))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 D8(n,e,t=e,r=se.empty){if(e==t&&!r.size)return null;let o=n.resolve(e),i=n.resolve(t);return Sw(o,i,r)?new zr(e,t,r):new R8(o,i,r).fit()}function Sw(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}let R8=class{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=ee.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=ee.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(),t=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 vr(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new zr(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=cd(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(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ee.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(t==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:t,openEnd:r}=this.unplaced,o=cd(e,t);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new se(e,t+1,Math.max(r,o.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=cd(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new se(Ns(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new se(Ns(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(d=y,u.push(kw(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=Bs(this.placed,t,ee.from(u)),this.frontier[t].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 t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:o}=this.frontier[t],i=t=0;a--){let{match:l,type:c}=this.frontier[a],u=ud(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Bs(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.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,t=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Bs(this.placed,this.depth,ee.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ee.empty,!0);t.childCount&&(this.placed=Bs(this.placed,this.frontier.length,t))}};function Ns(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ns(n.firstChild.content,e-1,t)))}function Bs(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Bs(n.lastChild.content,e-1,t)))}function cd(n,e){for(let t=0;t1&&(r=r.replaceChild(0,kw(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(ee.empty,!0)))),n.copy(r)}function ud(n,e,t,r,o){let i=n.node(e),s=o?n.indexAfter(e):n.index(e);if(s==i.childCount&&!t.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!I8(t,i.content,s)?a:null}function I8(n,e,t){for(let r=t;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=$8(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&&(n.replace(e,t,r),!(n.steps.length>d));p--){let f=s[p];f<0||(e=o.before(f),t=i.after(f))}}function Mw(n,e,t,r,o){if(er){let i=o.contentMatchAt(0),s=i.fillBefore(n).append(n);n=s.append(i.matchFragment(s).fillBefore(ee.empty,!0))}return n}function B8(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let o=P8(n.doc,e,r.type);o!=null&&(e=t=o)}n.replaceRange(e,t,new se(ee.from(r),0,0))}function F8(n,e,t){let r=n.doc.resolve(e),o=n.doc.resolve(t),i=Ew(r,o);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return n.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&&t>r.end(s)&&o.end(s)-t!=o.depth-s)return n.delete(r.before(s),t);n.delete(e,t)}function Ew(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let o=r;o>=0;o--){let i=n.start(o);if(ie.pos+(e.depth-o)||n.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==n.depth&&o==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&t.push(o)}return t}let Tw=class Ll extends hn{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return bn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let o=t.type.create(r,null,t.marks);return bn.fromReplace(e,this.pos,this.pos+1,new se(ee.from(o),0,t.isLeaf?0:1))}getMap(){return qo.empty}invert(e){return new Ll(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ll(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ll(t.pos,t.attr,t.value)}};hn.jsonID("attr",Tw);let Ow=class Cp extends hn{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let o in e.attrs)t[o]=e.attrs[o];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return bn.ok(r)}getMap(){return qo.empty}invert(e){return new Cp(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Cp(t.attr,t.value)}};hn.jsonID("docAttr",Ow);let ns=class extends Error{};ns=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};ns.prototype=Object.create(Error.prototype);ns.prototype.constructor=ns;ns.prototype.name="TransformError";let j8=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new xw}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new ns(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=se.empty){let o=D8(this.doc,e,t,r);return o&&this.step(o),this}replaceWith(e,t,r){return this.replace(e,t,new se(ee.from(r),0,0))}delete(e,t){return this.replace(e,t,se.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return N8(this,e,t,r),this}replaceRangeWith(e,t,r){return B8(this,e,t,r),this}deleteRange(e,t){return F8(this,e,t),this}lift(e,t){return g8(this,e,t),this}join(e,t=1){return A8(this,e,t),this}wrap(e,t){return x8(this,e,t),this}setBlockType(e,t=e,r,o=null){return w8(this,e,t,r,o),this}setNodeMarkup(e,t,r=null,o){return M8(this,e,t,r,o),this}setNodeAttribute(e,t,r){return this.step(new Tw(e,t,r)),this}setDocAttribute(e,t){return this.step(new Ow(e,t)),this}addNodeMark(e,t){return this.step(new Mh(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ht)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Eh(e,t)),this}split(e,t=1,r){return T8(this,e,t,r),this}addMark(e,t,r){return p8(this,e,t,r),this}removeMark(e,t,r){return f8(this,e,t,r),this}clearIncompatible(e,t,r){return ww(this,e,t,r),this}};const dd=Object.create(null);class Ze{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new _8(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;i--){let s=t<0?Fi(e.node(0),e.node(i),e.before(i+1),e.index(i),t,r):Fi(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new hr(e.node(0))}static atStart(e){return Fi(e,e,0,0,1)||new hr(e)}static atEnd(e){return Fi(e,e,e.content.size,e.childCount,-1)||new hr(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=dd[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in dd)throw new RangeError("Duplicate use of selection JSON ID "+e);return dd[e]=t,t.prototype.jsonID=e,t}getBookmark(){return qe.between(this.$anchor,this.$head).getBookmark()}}Ze.prototype.visible=!0;class _8{constructor(e,t){this.$from=e,this.$to=t}}let H0=!1;function V0(n){!H0&&!n.parent.inlineContent&&(H0=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class qe extends Ze{constructor(e,t=e){V0(e),V0(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return Ze.near(r);let o=e.resolve(t.map(this.anchor));return new qe(o.parent.inlineContent?o:r,r)}replace(e,t=se.empty){if(super.replace(e,t),t==se.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof qe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new fu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new qe(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let o=e.resolve(t);return new this(o,r==t?o:e.resolve(r))}static between(e,t,r){let o=e.pos-t.pos;if((!r||o)&&(r=o>=0?1:-1),!t.parent.inlineContent){let i=Ze.findFrom(t,r,!0)||Ze.findFrom(t,-r,!0);if(i)t=i.$head;else return Ze.near(t,r)}return e.parent.inlineContent||(o==0?e=t:(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(n,t-(o<0?a.nodeSize:0))}else{let l=Fi(n,a,t+o,o<0?a.childCount:0,o,i);if(l)return l}t+=a.nodeSize*o}return null}function U0(n,e,t){let r=n.steps.length-1;if(r{s==null&&(s=u)}),n.setSelection(Ze.near(n.doc.resolve(s),t))}const W0=1,pl=2,G0=4;class H8 extends j8{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|=pl,this}ensureMarks(e){return ht.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&pl)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~pl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ht.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let o=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(t);i=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,o.text(e,i)),this.selection.empty||this.setSelection(Ze.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=G0,this}get scrolledIntoView(){return(this.updated&G0)>0}}function K0(n,e){return!e||!n?n:n.bind(e)}class Fs{constructor(e,t,r){this.name=e,this.init=K0(t.init,r),this.apply=K0(t.apply,r)}}const V8=[new Fs("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Fs("selection",{init(n,e){return n.selection||Ze.atStart(e.doc)},apply(n){return n.selection}}),new Fs("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Fs("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class pd{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=V8.slice(),t&&t.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 Fs(r.key,r.spec.state,r))})}}class Ki{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let 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&&(t[r]=i.toJSON.call(o,this[o.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new pd(e.schema,e.plugins),i=new Ki(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Ho.fromJSON(e.schema,t.doc);else if(s.name=="selection")i.selection=Ze.fromJSON(i.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(i.storedMarks=t.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(t,a)){i[s.name]=c.fromJSON.call(l,e,t[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function Lw(n,e,t){for(let r in n){let o=n[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=Lw(o,e,{})),t[r]=o}return t}class mn{constructor(e){this.spec=e,this.props={},e.props&&Lw(e.props,this,this.props),this.key=e.key?e.key.key:Aw("plugin")}getState(e){return e[this.key]}}const fd=Object.create(null);function Aw(n){return n in fd?n+"$"+ ++fd[n]:(fd[n]=0,n+"$")}class Un{constructor(e="key"){this.key=Aw(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const sn=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},pa=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Sp=null;const Br=function(n,e,t){let r=Sp||(Sp=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},U8=function(){Sp=null},Yo=function(n,e,t,r){return t&&(q0(n,e,t,r,-1)||q0(n,e,t,r,1))},W8=/^(img|br|input|textarea|hr)$/i;function q0(n,e,t,r,o){for(;;){if(n==t&&e==r)return!0;if(e==(o<0?0:or(n))){let i=n.parentNode;if(!i||i.nodeType!=1||Fa(n)||W8.test(n.nodeName)||n.contentEditable=="false")return!1;e=sn(n)+(o<0?0:1),n=i}else if(n.nodeType==1){if(n=n.childNodes[e+(o<0?-1:0)],n.contentEditable=="false")return!1;e=o<0?or(n):0}else return!1}}function or(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function G8(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=or(n)}else if(n.parentNode&&!Fa(n))e=sn(n),n=n.parentNode;else return null}}function K8(n,e){for(;;){if(n.nodeType==3&&e2),tr=rs||(Tr?/Mac/.test(Tr.platform):!1),Z8=Tr?/Win/.test(Tr.platform):!1,cr=/Android \d/.test(Co),ja=!!Y0&&"webkitFontSmoothing"in Y0.documentElement.style,X8=ja?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Q8(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function $r(n,e){return typeof n=="number"?n:n[e]}function e9(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function J0(n,e,t){let r=n.someProp("scrollThreshold")||0,o=n.someProp("scrollMargin")||5,i=n.dom.ownerDocument;for(let s=t||n.dom;s;s=pa(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?Q8(i):e9(a),u=0,d=0;if(e.topc.bottom-$r(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+$r(o,"top")-c.top:e.bottom-c.bottom+$r(o,"bottom")),e.leftc.right-$r(r,"right")&&(u=e.right-c.right+$r(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 t9(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=t+1;s=t-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:Rw(n.dom)}}function Rw(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=pa(r));return e}function n9({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Iw(t,r==0?0:r-e)}function Iw(n,e){for(let t=0;t=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});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=d+1)}}return!t&&l&&(t=l,o=c,r=0),t&&t.nodeType==3?o9(t,o):!t||r&&t.nodeType==1?{node:n,offset:i}:$w(t,o)}function o9(n,e){let t=n.nodeValue.length,r=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:n,offset:0}}function Oh(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function i9(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,o,i)}function a9(n,e,t,r){let o=-1;for(let i=e,s=!1;i!=n.dom;){let a=n.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:n.docView.posFromDOM(e,t,-1)}function Nw(n,e,t){let r=n.childNodes.length;if(r&&t.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==n.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=n.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=a9(n,r,o,e))}a==null&&(a=s9(n,s,e));let l=n.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Z0(n){return n.top=0&&o==r.nodeValue.length?(l--,u=1):t<0?l--:c++,Es(Qr(Br(r,l,c),u),u<0)}if(!n.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(t<0||o==or(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return hd(l.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(t<0||o==or(r))){let l=r.childNodes[o-1],c=l.nodeType==3?Br(l,or(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Es(Qr(c,1),!1)}if(i==null&&o=0)}function Es(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function hd(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Fw(n,e,t){let r=n.state,o=n.root.activeElement;r!=e&&n.updateState(e),o!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),o!=n.dom&&o&&o.focus()}}function u9(n,e,t){let r=e.selection,o=t=="up"?r.$from:r.$to;return Fw(n,e,()=>{let{node:i}=n.docView.domFromPos(o.pos,t=="up"?-1:1);for(;;){let a=n.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=Bw(n,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=Br(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const d9=/[\u0590-\u08ac]/;function p9(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=n.domSelection();return a?!d9.test(r.parent.textContent)||!a.modify?t=="left"||t=="backward"?i:s:Fw(n,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",t,"character");let f=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:g}=n.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 X0=null,Q0=null,ey=!1;function f9(n,e,t){return X0==e&&Q0==t?ey:(X0=e,Q0=t,ey=t=="up"||t=="down"?u9(n,e,t):p9(n,e,t))}const ir=0,ty=1,Io=2,Or=3;class _a{constructor(e,t,r,o){this.parent=e,this.children=t,this.dom=r,this.contentDOM=o,this.dirty=ir,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tsn(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(t==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&t==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,t=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!t||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 t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||s instanceof _w){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof jw&&i.side>=0;r--);if(t<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&t&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,t):{node:this.contentDOM,offset:i?sn(i.dom)+1:0}}else{let i,s=!0;for(;i=r=u&&t<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,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=sn(p.dom)+1;break}e-=p.size}o==-1&&(o=0)}if(o>-1&&(c>t||a==this.children.length-1)){t=c;for(let u=a+1;uf&&st){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,t){for(let r=0,o=0;o=r:er){let a=r+i.border,l=s-i.border;if(e>=a&&t<=l){this.dirty=e==r||t==s?Io:ty,e==a&&t==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Or:i.markDirty(e-a,t-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Io:Or}r=s}this.dirty=Io}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Io:ty;t.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!t.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=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==ir&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class h9 extends _a{constructor(e,t,r,o){super(e,[],t,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Jo extends _a{constructor(e,t,r,o){super(e,[],r,o),this.mark=t}static create(e,t,r,o){let i=o.nodeViews[t.type.name],s=i&&i(t,o,r);return(!s||!s.dom)&&(s=li.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new Jo(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Or||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Or&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=ir){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=Op(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(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=li.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let p=u;return u=Vw(u,r,t),c?l=new m9(e,t,r,o,u,d||null,p,c,i,s+1):t.isText?new mu(e,t,r,o,u,p,i):new po(e,t,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 t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ee.empty)}return e}matchesNode(e,t,r){return this.dirty==ir&&e.eq(this.node)&&ac(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new v9(this,s&&s.node,e);x9(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?ht.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==Io)&&(s&&this.protectLocalComposition(e,s),zw(this.contentDOM,this.children,e),rs&&w9(this.dom))}localCompositionInfo(e,t){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof qe)||rt+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=C9(this.node.content,s,r-t,o-t);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:o}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new h9(this,i,t,o);e.input.compositionNodes.push(s),this.children=Op(this.children,r,r+o.length,e,s)}update(e,t,r,o){return this.dirty==Or||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,o),!0)}updateInner(e,t,r,o){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=ir}updateOuterDeco(e){if(ac(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Hw(this.dom,this.nodeDOM,Tp(this.outerDeco,this.node,t),Tp(e,this.node,t)),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 ny(n,e,t,r,o){Vw(r,e,n);let i=new po(void 0,n,e,t,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class mu extends po{constructor(e,t,r,o,i,s,a){super(e,t,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,t,r,o){return this.dirty==Or||this.dirty!=ir&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=ir||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=ir,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let o=this.node.cut(e,t),i=document.createTextNode(o.text);return new mu(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Or)}get domAtom(){return!1}isText(e){return this.node.text==e}}class _w extends _a{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ir&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class m9 extends po{constructor(e,t,r,o,i,s,a,l,c,u){super(e,t,r,o,i,s,a,c,u),this.spec=l}update(e,t,r,o){if(this.dirty==Or)return!1;if(this.spec.update){let i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,o){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,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 zw(n,e,t){let r=n.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=Jo.create(this.top,e[i],t,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,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,t,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=t.children[r-1];if(c instanceof Jo)t=c,r=c.children.length;else{a=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let l=a.node;if(l){if(l!=n.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function b9(n,e){return n.type.side-e.type.side}function x9(n,e,t,r){let o=e.locals(n),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 w9(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function C9(n,e,t,r){for(let o=0,i=0;o=t){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a=0&&c+e.length+a>=t)return a+c;if(t==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Op(n,e,t,r,o){let i=[];for(let s=0,a=0;s=t||u<=e?i.push(l):(ct&&i.push(l.slice(t-c,l.size,r)))}return i}function Lh(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let o=n.docView.nearestDesc(t.focusNode),i=o&&o.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(hu(t)){for(l=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&Ve.isSelectable(d)&&o.parent&&!(d.isInline&&q8(t.focusNode,t.focusOffset,o.dom))){let p=o.posBefore;c=new Ve(s==p?a:r.resolve(p))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=s,p=s;for(let f=0;f{(t.anchorNode!=r||t.anchorOffset!=o)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Uw(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function k9(n){let e=n.domSelection(),t=document.createRange();if(!e)return;let r=n.cursorWrapper.dom,o=r.nodeName=="IMG";o?t.setStart(r.parentNode,sn(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!o&&!n.state.selection.visible&&On&&uo<=11&&(r.disabled=!0,r.disabled=!1)}function Ww(n,e){if(e instanceof Ve){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(ay(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else ay(n)}function ay(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Ah(n,e,t,r){return n.someProp("createSelectionBetween",o=>o(n,e,t))||qe.between(e,t,r)}function ly(n){return n.editable&&!n.hasFocus()?!1:Gw(n)}function Gw(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function M9(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Yo(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Lp(n,e){let{$anchor:t,$head:r}=n.selection,o=e>0?t.max(r):t.min(r),i=o.parent.inlineContent?o.depth?n.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Ze.findFrom(i,e)}function no(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function cy(n,e,t){let r=n.state.selection;if(r instanceof qe)if(t.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=n.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return no(n,new qe(r.$anchor,s))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let o=Lp(n.state,e);return o&&o instanceof Ve?no(n,o):!1}else if(!(tr&&t.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=n.docView.descAt(a))&&!s.contentDOM?Ve.isSelectable(i)?no(n,new Ve(e<0?n.state.doc.resolve(o.pos-i.nodeSize):o)):ja?no(n,new qe(n.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ve&&r.node.isInline)return no(n,new qe(e>0?r.$to:r.$from));{let o=Lp(n.state,e);return o?no(n,o):!1}}}function lc(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ea(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function yi(n,e){return e<0?E9(n):T9(n)}function E9(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let o,i,s=!1;for(mr&&t.nodeType==1&&r0){if(t.nodeType!=1)break;{let a=t.childNodes[r-1];if(ea(a,-1))o=t,i=--r;else if(a.nodeType==3)t=a,r=t.nodeValue.length;else break}}else{if(Kw(t))break;{let a=t.previousSibling;for(;a&&ea(a,-1);)o=t.parentNode,i=sn(a),a=a.previousSibling;if(a)t=a,r=lc(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?Ap(n,t,r):o&&Ap(n,o,i)}function T9(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let o=lc(t),i,s;for(;;)if(r{n.state==o&&jr(n)},50)}function uy(n,e){let t=n.state.doc.resolve(e);if(!(fn||Z8)&&t.parent.inlineContent){let o=n.coordsAtPos(e);if(e>t.start()){let i=n.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(n.dom).direction=="rtl"?"rtl":"ltr"}function dy(n,e,t){let r=n.state.selection;if(r instanceof qe&&!r.empty||t.indexOf("s")>-1||tr&&t.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=Lp(n.state,e);if(s&&s instanceof Ve)return no(n,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof hr?Ze.near(s,e):Ze.findFrom(s,e);return a?no(n,a):!1}return!1}function py(n,e){if(!(n.state.selection instanceof qe))return!0;let{$head:t,$anchor:r,empty:o}=n.state.selection;if(!t.sameParent(r))return!0;if(!o)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(i&&!i.isText){let s=n.state.tr;return e<0?s.delete(t.pos-i.nodeSize,t.pos):s.delete(t.pos,t.pos+i.nodeSize),n.dispatch(s),!0}return!1}function fy(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function A9(n){if(!wn||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;fy(n,r,"true"),setTimeout(()=>fy(n,r,"false"),20)}return!1}function P9(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function D9(n,e){let t=e.keyCode,r=P9(e);if(t==8||tr&&t==72&&r=="c")return py(n,-1)||yi(n,-1);if(t==46&&!e.shiftKey||tr&&t==68&&r=="c")return py(n,1)||yi(n,1);if(t==13||t==27)return!0;if(t==37||tr&&t==66&&r=="c"){let o=t==37?uy(n,n.state.selection.from)=="ltr"?-1:1:-1;return cy(n,o,r)||yi(n,o)}else if(t==39||tr&&t==70&&r=="c"){let o=t==39?uy(n,n.state.selection.from)=="ltr"?1:-1:1;return cy(n,o,r)||yi(n,o)}else{if(t==38||tr&&t==80&&r=="c")return dy(n,-1,r)||yi(n,-1);if(t==40||tr&&t==78&&r=="c")return A9(n)||dy(n,1,r)||yi(n,1);if(r==(tr?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function qw(n,e){n.someProp("transformCopied",f=>{e=f(e,n)});let t=[],{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;t.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let s=n.someProp("clipboardSerializer")||li.fromSchema(n.state.schema),a=eC(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Qw[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(t)}`);let p=n.someProp("clipboardTextSerializer",f=>f(e,n))||e.content.textBetween(0,e.content.size,` - -`);return{dom:l,text:p,slice:e}}function Yw(n,e,t,r,o){let i=o.parent.type.spec.code,s,a;if(!t&&!e)return null;let l=e&&(r||i||!t);if(l){if(n.someProp("transformPastedText",p=>{e=p(e,i||r,n)}),i)return e?new se(ee.from(n.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):se.empty;let d=n.someProp("clipboardTextParser",p=>p(e,o,r,n));if(d)a=d;else{let p=o.marks(),{schema:f}=n.state,m=li.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 n.someProp("transformPastedHTML",d=>{t=d(t,n)}),s=N9(t),ja&&B9(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=(n.someProp("clipboardParser")||n.someProp("domParser")||Zs.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!R9.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)a=F9(hy(a,+u[1],+u[2]),u[4]);else if(a=se.maxOpen(I9(a.content,o),!0),a.openStart||a.openEnd){let d=0,p=0;for(let f=a.content.firstChild;d{a=d(a,n)}),a}const R9=/^(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 I9(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let o=e.node(t).contentMatchAt(e.index(t)),i,s=[];if(n.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&Zw(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Xw(s[s.length-1],i.length));let u=Jw(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return ee.from(s)}return n}function Jw(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,ee.from(n));return n}function Zw(n,e,t,r,o){if(o1&&(i=0),o=t&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(ee.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(a))}function hy(n,e,t){return et}).createHTML(n):n}function N9(n){let e=/^(\s*]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=eC().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),o;if((o=r&&Qw[r[1].toLowerCase()])&&(n=o.map(i=>"<"+i+">").join("")+n+o.map(i=>"").reverse().join("")),t.innerHTML=$9(n),o)for(let i=0;i=0;a-=2){let l=t.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=ee.from(l.create(r[a+1],o)),i++,s++}return new se(o,i,s)}const Cn={},Sn={},j9={touchstart:!0,touchmove:!0};class _9{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 z9(n){for(let e in Cn){let t=Cn[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{V9(n,r)&&!Ph(n,r)&&(n.editable||!(r.type in Sn))&&t(n,r)},j9[e]?{passive:!0}:void 0)}wn&&n.dom.addEventListener("input",()=>null),Dp(n)}function ao(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function H9(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Dp(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Ph(n,r))})}function Ph(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function V9(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function U9(n,e){!Ph(n,e)&&Cn[e.type]&&(n.editable||!(e.type in Sn))&&Cn[e.type](n,e)}Sn.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!nC(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(cr&&fn&&t.keyCode==13)))if(n.domObserver.selectionChanged(n.domSelectionRange())?n.domObserver.flush():t.keyCode!=229&&n.domObserver.forceFlush(),rs&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",o=>o(n,Po(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||D9(n,t)?t.preventDefault():ao(n,"key")};Sn.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Sn.keypress=(n,e)=>{let t=e;if(nC(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||tr&&t.metaKey)return;if(n.someProp("handleKeyPress",o=>o(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof qe)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(t.charCode);!/[\r\n]/.test(o)&&!n.someProp("handleTextInput",i=>i(n,r.$from.pos,r.$to.pos,o))&&n.dispatch(n.state.tr.insertText(o).scrollIntoView()),t.preventDefault()}};function gu(n){return{left:n.clientX,top:n.clientY}}function W9(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Dh(n,e,t,r,o){if(r==-1)return!1;let i=n.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(n.someProp(e,a=>s>i.depth?a(n,t,i.nodeAfter,i.before(s),o,!0):a(n,t,i.node(s),i.before(s),o,!1)))return!0;return!1}function Zi(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function G9(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Ve.isSelectable(r)?(Zi(n,new Ve(t)),!0):!1}function K9(n,e){if(e==-1)return!1;let t=n.state.selection,r,o;t instanceof Ve&&(r=t.node);let i=n.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&&t.$from.depth>0&&s>=t.$from.depth&&i.before(t.$from.depth+1)==t.$from.pos?o=i.before(t.$from.depth):o=i.before(s);break}}return o!=null?(Zi(n,Ve.create(n.state.doc,o)),!0):!1}function q9(n,e,t,r,o){return Dh(n,"handleClickOn",e,t,r)||n.someProp("handleClick",i=>i(n,e,r))||(o?K9(n,t):G9(n,t))}function Y9(n,e,t,r){return Dh(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",o=>o(n,e,r))}function J9(n,e,t,r){return Dh(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",o=>o(n,e,r))||Z9(n,t,r)}function Z9(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Zi(n,qe.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)Zi(n,qe.create(r,a+1,a+1+s.content.size));else if(Ve.isSelectable(s))Zi(n,Ve.create(r,a));else continue;return!0}}function Rh(n){return cc(n)}const tC=tr?"metaKey":"ctrlKey";Cn.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Rh(n),o=Date.now(),i="singleClick";o-n.input.lastClick.time<500&&W9(t,n.input.lastClick)&&!t[tC]&&(n.input.lastClick.type=="singleClick"?i="doubleClick":n.input.lastClick.type=="doubleClick"&&(i="tripleClick")),n.input.lastClick={time:o,x:t.clientX,y:t.clientY,type:i};let s=n.posAtCoords(gu(t));s&&(i=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new X9(n,s,t,!!r)):(i=="doubleClick"?Y9:J9)(n,s.pos,s.inside,t)?t.preventDefault():ao(n,"pointer"))};class X9{constructor(e,t,r,o){this.view=e,this.pos=t,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[tC],this.allowDefault=r.shiftKey;let i,s;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.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&&mr&&!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)),ao(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(()=>jr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(gu(e))),this.updateAllowDefault(e),this.allowDefault||!t?ao(this.view,"pointer"):q9(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||wn&&this.mightDrag&&!this.mightDrag.node.isAtom||fn&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Zi(this.view,Ze.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):ao(this.view,"pointer")}move(e){this.updateAllowDefault(e),ao(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)}}Cn.touchstart=n=>{n.input.lastTouch=Date.now(),Rh(n),ao(n,"pointer")};Cn.touchmove=n=>{n.input.lastTouch=Date.now(),ao(n,"pointer")};Cn.contextmenu=n=>Rh(n);function nC(n,e){return n.composing?!0:wn&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Q9=cr?5e3:-1;Sn.compositionstart=Sn.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof qe&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),cc(n,!0),n.markCursor=null;else if(cc(n,!e.selection.empty),mr&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.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=n.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}n.input.composing=!0}rC(n,Q9)};Sn.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,rC(n,20))};function rC(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>cc(n),e))}function oC(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=tV());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function eV(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=G8(e.focusNode,e.focusOffset),r=K8(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let o=r.pmViewDesc,i=n.domObserver.lastChangedTextNode;if(t==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let s=t.pmViewDesc;if(!(!s||!s.isText(t.nodeValue)))return r}}return t||r}function tV(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function cc(n,e=!1){if(!(cr&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),oC(n),e||n.docView&&n.docView.dirty){let t=Lh(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!n.state.selection.empty?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function nV(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const fa=On&&uo<15||rs&&X8<604;Cn.copy=Sn.cut=(n,e)=>{let t=e,r=n.state.selection,o=t.type=="cut";if(r.empty)return;let i=fa?null:t.clipboardData,s=r.content(),{dom:a,text:l}=qw(n,s);i?(t.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):nV(n,a),o&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function rV(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function oV(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?ha(n,r.value,null,o,e):ha(n,r.textContent,r.innerHTML,o,e)},50)}function ha(n,e,t,r,o){let i=Yw(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",l=>l(n,o,i||se.empty)))return!0;if(!i)return!1;let s=rV(i),a=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(i);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function iC(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Sn.paste=(n,e)=>{let t=e;if(n.composing&&!cr)return;let r=fa?null:t.clipboardData,o=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&ha(n,iC(r),r.getData("text/html"),o,t)?t.preventDefault():oV(n,t)};class sC{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const aC=tr?"altKey":"ctrlKey";Cn.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let o=n.state.selection,i=o.empty?null:n.posAtCoords(gu(t)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof Ve?o.to-1:o.to))){if(r&&r.mightDrag)s=Ve.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&(s=Ve.create(n.state.doc,d.posBefore))}}let a=(s||n.state.selection).content(),{dom:l,text:c,slice:u}=qw(n,a);(!t.dataTransfer.files.length||!fn||Dw>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(fa?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",fa||t.dataTransfer.setData("text/plain",c),n.dragging=new sC(u,!t[aC],s)};Cn.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Sn.dragover=Sn.dragenter=(n,e)=>e.preventDefault();Sn.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let o=n.posAtCoords(gu(t));if(!o)return;let i=n.state.doc.resolve(o.pos),s=r&&r.slice;s?n.someProp("transformPasted",m=>{s=m(s,n)}):s=Yw(n,iC(t.dataTransfer),fa?null:t.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!t[aC]);if(n.someProp("handleDrop",m=>m(n,t,s||se.empty,a))){t.preventDefault();return}if(!s)return;t.preventDefault();let l=s?Cw(n.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=n.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,w)=>m=w),c.setSelection(Ah(n,f,c.doc.resolve(m)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))};Cn.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&jr(n)},20))};Cn.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Cn.beforeinput=(n,e)=>{if(fn&&cr&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,Po(8,"Backspace")))))return;let{$cursor:o}=n.state.selection;o&&o.pos>0&&n.dispatch(n.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let n in Sn)Cn[n]=Sn[n];function ma(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class uc{constructor(e,t){this.toDOM=e,this.spec=t||Vo,this.side=this.spec.side||0}map(e,t,r,o){let{pos:i,deleted:s}=e.mapResult(t.from+o,this.side<0?-1:1);return s?null:new fr(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof uc&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ma(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class fo{constructor(e,t){this.attrs=e,this.spec=t||Vo}map(e,t,r,o){let i=e.map(t.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new fr(i,s,this)}valid(e,t){return t.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,t-a,r,o+a,i)}}map(e,t,r){return this==pn||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Vo)}mapInner(e,t,r,o,i){let s;for(let a=0;a{let c=l+r,u;if(u=cC(t,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+t.content.size;for(let a=0;ai&&l.type instanceof fo){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;co.map(e,t,Vo));return io.from(r)}forChild(e,t){if(t.isLeaf)return Xt.empty;let r=[];for(let o=0;ot instanceof Xt)?e:e.reduce((t,r)=>t.concat(r instanceof Xt?r:r.members),[]))}}forEachSet(e){for(let t=0;t{let y=g-m-(f-p);for(let b=0;bw+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=t.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let p=t.map(n[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(t,y,u+1,n[c]+i+1,s);b!=pn?(a[c]=d,a[c+1]=f,a[c+2]=b):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=sV(a,n,e,t,o,i,s),u=dc(c,r,0,s);e=u.local;for(let d=0;dt&&s.to{let c=cC(n,a,l+t);if(c){i=!0;let u=dc(c,a,t+l+1,r);u!=pn&&o.push(l,l+a.nodeSize,u)}});let s=lC(i?uC(n):n,-t).sort(Uo);for(let a=0;a0;)e++;n.splice(e,0,t)}function gd(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=pn&&e.push(r)}),n.cursorWrapper&&e.push(Xt.create(n.state.doc,[n.cursorWrapper.deco])),io.from(e)}const aV={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},lV=On&&uo<=11;class cV{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 uV{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new cV,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()}),lV&&(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,aV)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ly(this.view)){if(this.suppressingSelectionUpdates)return jr(this.view);if(On&&uo<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Yo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let i=e.focusNode;i;i=pa(i))t.add(i);for(let i=e.anchorNode;i;i=pa(i))if(t.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)&&ly(this.view)&&!this.ignoreSelectionChange(e)}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.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||fV(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),dV(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||jr(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.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],w=b.pmViewDesc;if(b.nodeName=="BR"&&!w){i=y;break}if(!w||w.size)break}let d=n.state.doc,p=n.someProp("domParser")||Zs.fromSchema(n.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:mV,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 mV(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(wn&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||wn&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const gV=/^(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 vV(n,e,t,r,o){let i=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let P=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,O=Lh(n,P);if(O&&!n.state.selection.eq(O)){if(fn&&cr&&n.input.lastKeyCode===13&&Date.now()-100D(n,Po(13,"Enter"))))return;let F=n.state.tr.setSelection(O);P=="pointer"?F.setMeta("pointer",!0):P=="key"&&F.scrollIntoView(),i&&F.setMeta("composition",i),n.dispatch(F)}return}let s=n.state.doc.resolve(e),a=s.sharedDepth(t);e=s.before(a+1),t=n.state.doc.resolve(t).after(a+1);let l=n.state.selection,c=hV(n,e,t),u=n.state.doc,d=u.slice(c.from,c.to),p,f;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||cr)&&o.some(P=>P.nodeType==1&&!gV.test(P.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",P=>P(n,Po(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof qe&&!l.empty&&l.$head.sameParent(l.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let P=xy(n,n.state.doc,c.sel);if(P&&!P.eq(n.state.selection)){let O=n.state.tr.setSelection(P);i&&O.setMeta("composition",i),n.dispatch(O)}}return}n.state.selection.fromn.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?m.start=n.state.selection.from:m.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),On&&uo<=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),w=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=m.endA,S;if((rs&&n.input.lastIOSEnter>Date.now()-225&&(!w||o.some(P=>P.nodeName=="DIV"||P.nodeName=="P"))||!w&&g.posP(n,Po(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&bV(u,m.start,m.endA,g,y)&&n.someProp("handleKeyDown",P=>P(n,Po(8,"Backspace")))){cr&&fn&&n.domObserver.suppressSelectionUpdates();return}fn&&cr&&m.endB==m.start&&(n.input.lastAndroidDelete=Date.now()),cr&&!w&&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(()=>{n.someProp("handleKeyDown",function(P){return P(n,Po(13,"Enter"))})},20));let T=m.start,k=m.endA,x,C,E;if(w){if(g.pos==y.pos)On&&uo<=11&&g.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>jr(n),20)),x=n.state.tr.delete(T,k),C=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(E=yV(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start()))))x=n.state.tr,E.type=="add"?x.addMark(T,k,E.mark):x.removeMark(T,k,E.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let P=g.parent.textBetween(g.parentOffset,y.parentOffset);if(n.someProp("handleTextInput",O=>O(n,T,k,P)))return;x=n.state.tr.insertText(P,T,k)}}if(x||(x=n.state.tr.replace(T,k,c.doc.slice(m.start-c.from,m.endB-c.from))),c.sel){let P=xy(n,x.doc,c.sel);P&&!(fn&&cr&&n.composing&&P.empty&&(m.start!=m.endB||n.input.lastAndroidDeletee.content.size?null:Ah(n,e.resolve(t.anchor),e.resolve(t.head))}function yV(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,o=t,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;ut||vd(s,!0,!1)0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,o++,e=!1;if(t){let i=n.node(r).maybeChild(n.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function xV(n,e,t,r,o){let i=n.findDiffStart(e,t);if(i==null)return null;let{a:s,b:a}=n.findDiffEnd(e,t+n.size,t+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&&t>=55296&&t<=56319}class wV{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new _9,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Ey),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=ky(this),Sy(this),this.nodeViews=My(this),this.docView=ny(this.state.doc,Cy(this),gd(this),this.dom,this),this.domObserver=new uV(this,(r,o,i,s)=>vV(this,r,o,i,s)),this.domObserver.start(),z9(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Dp(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ey),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(oC(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let f=My(this);SV(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Dp(this),this.editable=ky(this),Sy(this);let l=gd(this),c=Cy(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&&t9(this);if(s){this.domObserver.stop();let f=d&&(On||fn)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&CV(o.selection,e.selection);if(d){let m=fn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=eV(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=ny(e.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&M9(this))?jr(this,f):(Ww(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&&n9(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof Ve){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&J0(this,t.getBoundingClientRect(),e)}else J0(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 t=0;t0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new sC(e.slice,e.move,o<0?void 0:Ve.create(this.state.doc,o))}someProp(e,t){let r=this._props&&this._props[e],o;if(r!=null&&(o=t?t(r):r))return o;for(let s=0;st.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return l9(this,e)}coordsAtPos(e,t=1){return Bw(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let o=this.docView.posFromDOM(e,t,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,t){return f9(this,t||this.state,e)}pasteHTML(e,t){return ha(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ha(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(H9(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],gd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,U8())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return U9(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?wn&&this.root.nodeType===11&&Y8(this.dom.ownerDocument)==this.dom&&pV(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Cy(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[fr.node(0,n.state.doc.content.size,e)]}function Sy(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:fr.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function ky(n){return!n.someProp("editable",e=>e(n.state)===!1)}function CV(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function My(n){let e=Object.create(null);function t(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function SV(n,e){let t=0,r=0;for(let o in n){if(n[o]!=e[o])return!0;t++}for(let o in e)r++;return t!=r}function Ey(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var yo={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},pc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},kV=typeof navigator<"u"&&/Mac/.test(navigator.platform),MV=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var an=0;an<10;an++)yo[48+an]=yo[96+an]=String(an);for(var an=1;an<=24;an++)yo[an+111]="F"+an;for(var an=65;an<=90;an++)yo[an]=String.fromCharCode(an+32),pc[an]=String.fromCharCode(an);for(var yd in yo)pc.hasOwnProperty(yd)||(pc[yd]=yo[yd]);function EV(n){var e=kV&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||MV&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?pc:yo)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const TV=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function OV(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,o,i,s;for(let a=0;a127)&&(i=yo[r.keyCode])&&i!=o){let a=e[bd(i,r)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}const dC=65535,pC=Math.pow(2,16);function DV(n,e){return n+e*pC}function Ty(n){return n&dC}function RV(n){return(n-(n&dC))/pC}const fC=1,hC=2,Al=4,mC=8;let Rp=class{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&mC)>0}get deletedBefore(){return(this.delInfo&(fC|Al))>0}get deletedAfter(){return(this.delInfo&(hC|Al))>0}get deletedAcross(){return(this.delInfo&Al)>0}},Zo=class _i{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&_i.empty)return _i.empty}recover(e){let t=0,r=Ty(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:t:t,f=l+o+(p<0?0:u);if(r)return f;let m=e==(t<0?l:d)?null:DV(a/3,e-l),g=e==l?hC:e==d?fC:Al;return(t<0?e!=l:e!=d)&&(g|=mC),new Rp(f,g,m)}o+=u-c}return r?e+o:new Rp(e+o,0,null)}touches(e,t){let r=0,o=Ty(t),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 t=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o=0;t--){let o=e.getMirror(t);this.appendMap(e.maps[t].invert(),o!=null&&o>t?r-o-1:void 0)}}invert(){let e=new ta;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!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),t.openStart,t.openEnd);return xn.fromReplace(e,this.from,this.to,i)}invert(){return new za(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new _s(t.pos,r.pos,this.mark)}merge(e){return e instanceof _s&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new _s(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new _s(t.from,t.to,e.markFromJSON(t.mark))}};gn.jsonID("addMark",Bh);let za=class zs extends gn{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new se(Nh(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return xn.fromReplace(e,this.from,this.to,r)}invert(){return new Bh(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new zs(t.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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new zs(t.from,t.to,e.markFromJSON(t.mark))}};gn.jsonID("removeMark",za);let Fh=class Hs extends gn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return xn.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return xn.fromReplace(e,this.pos,this.pos+1,new se(ee.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let o=0;or.pos?null:new Pl(t.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Pl(t.from,t.to,t.gapFrom,t.gapTo,se.fromJSON(e,t.slice),t.insert,!!t.structure)}};gn.jsonID("replaceAround",ci);function $p(n,e,t){let r=n.resolve(e),o=t-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 IV(n,e,t,r){let o=[],i=[],s,a;n.doc.nodesBetween(e,t,(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,t),m=r.addToSet(d);for(let g=0;gn.step(l)),i.forEach(l=>n.step(l))}function $V(n,e,t,r){let o=[],i=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Na){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,t);for(let u=0;un.step(new za(s.from,s.to,s.style)))}function _h(n,e,t,r=t.contentMatch,o=!0){let i=n.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)n.step(s[l])}function NV(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function BV(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let o=n.$from.node(r),i=n.$from.index(r),s=n.$to.indexAfter(r);if(rt;m--)g||r.index(m)>0?(g=!0,u=ee.from(r.node(m).copy(u)),d++):l--;let p=ee.empty,f=0;for(let m=i,g=!1;m>t;m--)g||o.after(m+1)=0;s--){if(r.size){let a=t[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=ee.from(t[s].type.create(t[s].attrs,r))}let o=e.start,i=e.end;n.step(new ci(o,i,o,i,new se(r,0,0),t.length,!0))}function VV(n,e,t,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&UV(n.doc,n.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&&vC(n,s,a,i),_h(n,n.mapping.slice(i).map(a,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(a,1),p=u.map(a+s.nodeSize,1);return n.step(new ci(d,p,d+1,p-1,new se(ee.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&gC(n,s,a,i),!1}})}function gC(n,e,t,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=n.mapping.slice(r).map(t+1+i+s.index);n.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function vC(n,e,t,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+i);n.replaceWith(s,s+1,e.type.schema.text(` -`))}})}function UV(n,e,t){let r=n.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,t)}function WV(n,e,t,r,o){let i=n.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let s=t.create(r,null,o||i.marks);if(i.isLeaf)return n.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new ci(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new se(ee.from(s),0,0),1,!0))}function Dl(n,e,t=1,r){let o=n.resolve(e),i=o.depth-t,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=t-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 GV(n,e,t=1,r){let o=n.doc.resolve(e),i=ee.empty,s=ee.empty;for(let a=o.depth,l=o.depth-t,c=t-1;a>l;a--,c--){i=ee.from(o.node(a).copy(i));let u=r&&r[c];s=ee.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}n.step(new Hr(e,e,new se(i.append(s),t,t),!0))}function zh(n,e){let t=n.resolve(e),r=t.index();return yC(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function KV(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.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&&yC(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=t<0?r.before(o):r.after(o)}}function qV(n,e,t){let r=null,{linebreakReplacement:o}=n.doc.type.schema,i=n.doc.resolve(e-t),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=n.steps.length;if(r===!1){let u=n.doc.resolve(e+t);vC(n,u.node(),u.before(),a)}s.inlineContent&&_h(n,e+t-1,s,i.node().contentMatchAt(i.index()),r==null);let l=n.mapping.slice(a),c=l.map(e-t);if(n.step(new Hr(c,l.map(e+t,-1),se.empty,!0)),r===!0){let u=n.doc.resolve(c);gC(n,u.node(),u.before(),n.steps.length)}return n}function YV(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))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,t))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,t))return r.after(o+1);if(i0;o--)this.placed=ee.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(),t=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 ci(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new Hr(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=wd(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(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ee.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(t==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:t,openEnd:r}=this.unplaced,o=wd(e,t);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new se(e,t+1,Math.max(r,o.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=wd(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new se(Vs(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new se(Vs(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(d=y,u.push(wC(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=Us(this.placed,t,ee.from(u)),this.frontier[t].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 t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:o}=this.frontier[t],i=t=0;a--){let{match:l,type:c}=this.frontier[a],u=Cd(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Us(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.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,t=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Us(this.placed,this.depth,ee.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ee.empty,!0);t.childCount&&(this.placed=Us(this.placed,this.frontier.length,t))}};function Vs(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Vs(n.firstChild.content,e-1,t)))}function Us(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Us(n.lastChild.content,e-1,t)))}function wd(n,e){for(let t=0;t1&&(r=r.replaceChild(0,wC(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(ee.empty,!0)))),n.copy(r)}function Cd(n,e,t,r,o){let i=n.node(e),s=o?n.indexAfter(e):n.index(e);if(s==i.childCount&&!t.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!XV(t,i.content,s)?a:null}function XV(n,e,t){for(let r=t;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=QV(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&&(n.replace(e,t,r),!(n.steps.length>d));p--){let f=s[p];f<0||(e=o.before(f),t=i.after(f))}}function CC(n,e,t,r,o){if(er){let i=o.contentMatchAt(0),s=i.fillBefore(n).append(n);n=s.append(i.matchFragment(s).fillBefore(ee.empty,!0))}return n}function tU(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let o=YV(n.doc,e,r.type);o!=null&&(e=t=o)}n.replaceRange(e,t,new se(ee.from(r),0,0))}function nU(n,e,t){let r=n.doc.resolve(e),o=n.doc.resolve(t),i=SC(r,o);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return n.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&&t>r.end(s)&&o.end(s)-t!=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 n.delete(r.before(s),t);n.delete(e,t)}function SC(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let o=r;o>=0;o--){let i=n.start(o);if(ie.pos+(e.depth-o)||n.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==n.depth&&o==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&t.push(o)}return t}let kC=class Rl extends gn{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return xn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let o=t.type.create(r,null,t.marks);return xn.fromReplace(e,this.pos,this.pos+1,new se(ee.from(o),0,t.isLeaf?0:1))}getMap(){return Zo.empty}invert(e){return new Rl(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Rl(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Rl(t.pos,t.attr,t.value)}};gn.jsonID("attr",kC);let MC=class Np extends gn{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let o in e.attrs)t[o]=e.attrs[o];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return xn.ok(r)}getMap(){return Zo.empty}invert(e){return new Np(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Np(t.attr,t.value)}};gn.jsonID("docAttr",MC);let is=class extends Error{};is=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};is.prototype=Object.create(Error.prototype);is.prototype.constructor=is;is.prototype.name="TransformError";class rU{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ta}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new is(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=se.empty){let o=JV(this.doc,e,t,r);return o&&this.step(o),this}replaceWith(e,t,r){return this.replace(e,t,new se(ee.from(r),0,0))}delete(e,t){return this.replace(e,t,se.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return eU(this,e,t,r),this}replaceRangeWith(e,t,r){return tU(this,e,t,r),this}deleteRange(e,t){return nU(this,e,t),this}lift(e,t){return FV(this,e,t),this}join(e,t=1){return qV(this,e,t),this}wrap(e,t){return HV(this,e,t),this}setBlockType(e,t=e,r,o=null){return VV(this,e,t,r,o),this}setNodeMarkup(e,t,r=null,o){return WV(this,e,t,r,o),this}setNodeAttribute(e,t,r){return this.step(new kC(e,t,r)),this}setDocAttribute(e,t){return this.step(new MC(e,t)),this}addNodeMark(e,t){return this.step(new Fh(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ht)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new jh(e,t)),this}split(e,t=1,r){return GV(this,e,t,r),this}addMark(e,t,r){return IV(this,e,t,r),this}removeMark(e,t,r){return $V(this,e,t,r),this}clearIncompatible(e,t,r){return _h(this,e,t,r),this}}const EC=65535,TC=Math.pow(2,16);function oU(n,e){return n+e*TC}function Ly(n){return n&EC}function iU(n){return(n-(n&EC))/TC}const OC=1,LC=2,Il=4,AC=8;class Ay{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&AC)>0}get deletedBefore(){return(this.delInfo&(OC|Il))>0}get deletedAfter(){return(this.delInfo&(LC|Il))>0}get deletedAcross(){return(this.delInfo&Il)>0}}class zn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&zn.empty)return zn.empty}recover(e){let t=0,r=Ly(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:t:t,f=l+o+(p<0?0:u);if(r)return f;let m=e==(t<0?l:d)?null:oU(a/3,e-l),g=e==l?LC:e==d?OC:Il;return(t<0?e!=l:e!=d)&&(g|=AC),new Ay(f,g,m)}o+=u-c}return r?e+o:new Ay(e+o,0,null)}touches(e,t){let r=0,o=Ly(t),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 t=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),t.openStart,t.openEnd);return Ut.fromReplace(e,this.from,this.to,i)}invert(){return new Bo(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new No(t.pos,r.pos,this.mark)}merge(e){return e instanceof No&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new No(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new No(t.from,t.to,e.markFromJSON(t.mark))}}vn.jsonID("addMark",No);class Bo extends vn{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new se(Hh(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return Ut.fromReplace(e,this.from,this.to,r)}invert(){return new No(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Bo(t.pos,r.pos,this.mark)}merge(e){return e instanceof Bo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Bo(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Bo(t.from,t.to,e.markFromJSON(t.mark))}}vn.jsonID("removeMark",Bo);class Fo extends vn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ut.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ut.fromReplace(e,this.pos,this.pos+1,new se(ee.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let o=0;or.pos?null:new ho(t.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ho(t.from,t.to,t.gapFrom,t.gapTo,se.fromJSON(e,t.slice),t.insert,!!t.structure)}}vn.jsonID("replaceAround",ho);function Bp(n,e,t){let r=n.resolve(e),o=t-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 sU(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function vu(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let o=n.$from.node(r),i=n.$from.index(r),s=n.$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 yu(n,e){let t=n.resolve(e),r=t.index();return PC(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function dU(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.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&&PC(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=t<0?r.before(o):r.after(o)}}function Vh(n,e,t=e,r=se.empty){if(e==t&&!r.size)return null;let o=n.resolve(e),i=n.resolve(t);return pU(o,i,r)?new ur(e,t,r):new fU(o,i,r).fit()}function pU(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class fU{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=ee.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=ee.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(),t=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 ho(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new ur(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=kd(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(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ee.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(t==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:t,openEnd:r}=this.unplaced,o=kd(e,t);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new se(e,t+1,Math.max(r,o.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=kd(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new se(Ws(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new se(Ws(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(d=y,u.push(RC(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=Gs(this.placed,t,ee.from(u)),this.frontier[t].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 t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:o}=this.frontier[t],i=t=0;a--){let{match:l,type:c}=this.frontier[a],u=Md(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Gs(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.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,t=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Gs(this.placed,this.depth,ee.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ee.empty,!0);t.childCount&&(this.placed=Gs(this.placed,this.frontier.length,t))}}function Ws(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ws(n.firstChild.content,e-1,t)))}function Gs(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Gs(n.lastChild.content,e-1,t)))}function kd(n,e){for(let t=0;t1&&(r=r.replaceChild(0,RC(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(ee.empty,!0)))),n.copy(r)}function Md(n,e,t,r,o){let i=n.node(e),s=o?n.indexAfter(e):n.index(e);if(s==i.childCount&&!t.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!hU(t,i.content,s)?a:null}function hU(n,e,t){for(let r=t;rn.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function IC(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const gU=(n,e,t)=>{let r=IC(n,t);if(!r)return!1;let o=Uh(r);if(!o){let s=r.blockRange(),a=s&&vu(s);return a==null?!1:(e&&e(n.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(FC(n,o,e,-1))return!0;if(r.parent.content.size==0&&(ss(i,"end")||Ve.isSelectable(i)))for(let s=r.depth;;s--){let a=Vh(n.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(n.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},vU=(n,e,t)=>{let r=IC(n,t);if(!r)return!1;let o=Uh(r);return o?$C(n,o,e):!1},yU=(n,e,t)=>{let r=NC(n,t);if(!r)return!1;let o=Wh(r);return o?$C(n,o,e):!1};function $C(n,e,t){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=Vh(n.doc,i,l,se.empty);if(!c||c.from!=i||c instanceof ur&&c.slice.size>=l-i)return!1;if(t){let u=n.tr.step(c);u.setSelection(qe.create(u.doc,i)),t(u.scrollIntoView())}return!0}function ss(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const bU=(n,e,t)=>{let{$head:r,empty:o}=n.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;i=Uh(r)}let s=i&&i.nodeBefore;return!s||!Ve.isSelectable(s)?!1:(e&&e(n.tr.setSelection(Ve.create(n.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function Uh(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function NC(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let r=NC(n,t);if(!r)return!1;let o=Wh(r);if(!o)return!1;let i=o.nodeAfter;if(FC(n,o,e,1))return!0;if(r.parent.content.size==0&&(ss(i,"start")||Ve.isSelectable(i))){let s=Vh(n.doc,r.before(),r.after(),se.empty);if(s&&s.slice.size{let{$head:r,empty:o}=n.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,r=t instanceof Ve,o;if(r){if(t.node.isTextblock||!yu(n.doc,t.from))return!1;o=t.from}else if(o=DC(n.doc,t.from,-1),o==null)return!1;if(e){let i=n.tr.join(o);r&&i.setSelection(Ve.create(i.doc,o-n.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},SU=(n,e)=>{let t=n.selection,r;if(t instanceof Ve){if(t.node.isTextblock||!yu(n.doc,t.to))return!1;r=t.to}else if(r=DC(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},kU=(n,e)=>{let{$from:t,$to:r}=n.selection,o=t.blockRange(r),i=o&&vu(o);return i==null?!1:(e&&e(n.tr.lift(o,i).scrollIntoView()),!0)},MU=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(` -`).scrollIntoView()),!0)};function BC(n){for(let e=0;e{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let o=t.node(-1),i=t.indexAfter(-1),s=BC(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=t.after(),l=n.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Ze.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},TU=(n,e)=>{let t=n.selection,{$from:r,$to:o}=t;if(t instanceof hr||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=BC(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let i=t.before();if(uU(n.doc,i))return e&&e(n.tr.split(i).scrollIntoView()),!0}let r=t.blockRange(),o=r&&vu(r);return o==null?!1:(e&&e(n.tr.lift(r,o).scrollIntoView()),!0)},LU=(n,e)=>{let{$from:t,to:r}=n.selection,o,i=t.sharedDepth(r);return i==0?!1:(o=t.before(i),e&&e(n.tr.setSelection(Ve.create(n.doc,o))),!0)};function AU(n,e,t){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)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||yu(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function FC(n,e,t,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&AU(n,e,t))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(t){let f=e.pos+i.nodeSize,m=ee.empty;for(let b=s.length-1;b>=0;b--)m=ee.from(s[b].create(null,m));m=ee.from(o.copy(m));let g=n.tr.step(new ho(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&&yu(g.doc,y.pos)&&g.join(y.pos),t(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&&vu(d);if(p!=null&&p>=e.depth)return t&&t(n.tr.lift(d,p).scrollIntoView()),!0;if(c&&ss(i,"start",!0)&&ss(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(t){let b=ee.empty;for(let S=m.length-1;S>=0;S--)b=ee.from(m[S].copy(b));let w=n.tr.step(new ho(e.pos-m.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new se(b,m.length,0),0,!0));t(w.scrollIntoView())}return!0}}return!1}function jC(n){return function(e,t){let r=e.selection,o=n<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(t&&t(e.tr.setSelection(qe.create(e.doc,n<0?o.start(i):o.end(i)))),!0):!1}}const PU=jC(-1),DU=jC(1);function RU(n,e=null){return function(t,r){let{$from:o,$to:i}=t.selection,s=o.blockRange(i),a=s&&aU(s,n,e);return a?(r&&r(t.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Dy(n,e=null){return function(t,r){let o=!1;for(let i=0;i{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(n,e)))if(l.type==n)o=!0;else{let u=t.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,n)}})}if(!o)return!1;if(r){let i=t.tr;for(let s=0;s=2&&o.node(s.depth-1).type.compatibleContent(n)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=t.doc.resolve(s.start-2);l=new rc(u,u,s.depth),s.endIndex=0;u--)i=ee.from(t[u].type.create(t[u].attrs,i));n.step(new vr(e.start-(r?2:0),e.end,e.start,e.end,new se(i,0,0),t.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==n);return i?t?r.node(i.depth-1).type==n?BU(e,t,n,i):FU(e,t,i):!0:!1}}function BU(n,e,t,r){let o=n.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(t.start),s=i.nodeAfter;if(r.mapping.map(t.end)!=t.start+i.nodeAfter.nodeSize)return!1;let a=t.startIndex==0,l=t.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?ee.empty:ee.from(o))))return!1;let d=i.pos,p=d+s.nodeSize;return r.step(new vr(d-(a?1:0),p+(l?1:0),d+1,p-1,new se((a?ee.empty:ee.from(o.copy(ee.empty))).append(l?ee.empty:ee.from(o.copy(ee.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function jU(n){return function(e,t){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==n);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!=n)return!1;if(t){let c=l.lastChild&&l.lastChild.type==a.type,u=ee.from(c?n.create():null),d=new se(ee.from(n.create(null,ee.from(a.type.create(null,u)))),c?3:1,0),p=i.start,f=i.end;t(e.tr.step(new vr(p-(c?3:1),f,p,f,d,1,!0)).scrollIntoView())}return!0}}function bu(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:o}=t,{storedMarks:i}=t;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=t.selection,o=t.doc,i=t.storedMarks,t}}}class xu{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:t,state:r}=this,{view:o}=t,{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,t=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],l=!!e,c=e||i.tr,u=()=>(!l&&t&&!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,t),b=f(...g)(y);return a.push(b),d}])),run:u};return d}createCan(e){const{rawCommands:t,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,t=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:e,editor:o,view:s,state:bu({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class _U{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(o=>o!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function Ie(n,e,t){return n.config[e]===void 0&&n.parent?Ie(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?Ie(n.parent,e,t):null}):n.config[e]}function wu(n){const e=n.filter(o=>o.type==="extension"),t=n.filter(o=>o.type==="node"),r=n.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function _C(n){const e=[],{nodeExtensions:t,markExtensions:r}=wu(n),o=[...t,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.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 tn(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function It(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).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 hc(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>It(t,r),{})}function zC(n){return typeof n=="function"}function Je(n,e=void 0,...t){return zC(n)?e?n.bind(e)(...t):n(...t):n}function zU(n={}){return Object.keys(n).length===0&&n.constructor===Object}function HU(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Ry(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(t):HU(t.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function Iy(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&zU(t)?!1:t!=null))}function VU(n,e){var t;const r=_C(n),{nodeExtensions:o,markExtensions:i}=wu(n),s=(t=o.find(c=>Ie(c,"topNode")))===null||t===void 0?void 0:t.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=n.reduce((b,w)=>{const S=Ie(w,"extendNodeSchema",d);return{...b,...S?S(c):{}}},{}),f=Iy({...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 w;return[b.name,{default:(w=b==null?void 0:b.attribute)===null||w===void 0?void 0:w.default}]}))}),m=Je(Ie(c,"parseHTML",d));m&&(f.parseDOM=m.map(b=>Ry(b,u)));const g=Ie(c,"renderHTML",d);g&&(f.toDOM=b=>g({node:b,HTMLAttributes:hc(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=n.reduce((y,b)=>{const w=Ie(b,"extendMarkSchema",d);return{...y,...w?w(c):{}}},{}),f=Iy({...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=>Ry(y,u)));const g=Ie(c,"renderHTML",d);return g&&(f.toDOM=y=>g({mark:y,HTMLAttributes:hc(y,u)})),[c.name,f]}));return new pw({topNode:s,nodes:a,marks:l})}function Ed(n,e){return e.nodes[n]||e.marks[n]||null}function $y(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const UU=(n,e=500)=>{let t="";const r=n.parentOffset;return n.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%";t+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),t};function Gh(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Cu{constructor(e){this.find=e.find,this.handler=e.handler}}const WU=(n,e)=>{if(Gh(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function fl(n){var e;const{editor:t,from:r,to:o,text:i,rules:s,plugin:a}=n,{view:l}=t;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=UU(c)+i;return s.forEach(p=>{if(u)return;const f=WU(d,p.find);if(!f)return;const m=l.state.tr,g=bu({state:l.state,transaction:m}),y={from:r-(f[0].length-i.length),to:o},{commands:b,chain:w,can:S}=new xu({editor:t,state:g});p.handler({state:g,range:y,match:f,commands:b,chain:w,can:S})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:o,text:i}),l.dispatch(m),u=!0)}),u}function GU(n){const{editor:e,rules:t}=n,r=new mn({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;fl({editor:e,from:c,to:d,text:u,rules:t,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,a){return fl({editor:e,from:i,to:s,text:a,rules:t,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&fl({editor:e,from:i.pos,to:i.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?fl({editor:e,from:s.pos,to:s.pos,text:` -`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function KU(n){return Object.prototype.toString.call(n).slice(8,-1)}function hl(n){return KU(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Su(n,e){const t={...n};return hl(n)&&hl(e)&&Object.keys(e).forEach(r=>{hl(e[r])&&hl(n[r])?t[r]=Su(n[r],e[r]):t[r]=e[r]}),t}class Vn{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 Vn(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Su(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Vn(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.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: "${t.name}".`),t.options=Je(Ie(t,"addOptions",{name:t.name})),t.storage=Je(Ie(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){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)===t.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===t.name);return l&&r.removeStoredMark(l),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}function qU(n){return typeof n=="number"}class YU{constructor(e){this.find=e.find,this.handler=e.handler}}const JU=(n,e,t)=>{if(Gh(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=n,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 ZU(n){const{editor:e,state:t,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=n,{commands:l,chain:c,can:u}=new xu({editor:e,state:t}),d=[];return t.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,"");JU(b,i.find,s).forEach(S=>{if(S.index===void 0)return;const T=g+S.index+1,k=T+S[0].length,x={from:t.tr.mapping.map(T),to:t.tr.mapping.map(k)},C=i.handler({state:t,range:x,match:S,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});d.push(C)})}),d.every(f=>f!==null)}const XU=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",n),t};function QU(n){const{editor:e,rules:t}=n;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=bu({state:u,transaction:g});if(!(!ZU({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 t.map(u=>new mn({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"),w=!!b;if(!g&&!y&&!w)return;if(w){const{from:k,text:x}=b,C=k+x.length,E=XU(x);return l({rule:u,state:f,from:k,to:{b:C},pasteEvt:E})}const S=p.doc.content.findDiffStart(f.doc.content),T=p.doc.content.findDiffEnd(f.doc.content);if(!(!qU(S)||!T||S===T.b))return l({rule:u,state:f,from:S,to:T,pasteEvt:s})}}))}function e7(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}class qi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=qi.resolve(e),this.schema=VU(this.extensions,t),this.setupExtensions()}static resolve(e){const t=qi.sort(qi.flatten(e)),r=e7(t.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.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},o=Ie(t,"addExtensions",r);return o?[t,...this.flatten(o())]:t}).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:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Ed(t.name,this.schema)},o=Ie(t,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,t=qi.sort([...this.extensions].reverse()),r=[],o=[],i=t.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Ed(s.name,this.schema)},l=[],c=Ie(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&Ie(s,"exitable",a)&&(u.ArrowRight=()=>Vn.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=AV(u);l.push(d);const p=Ie(s,"addInputRules",a);$y(s,e.options.enableInputRules)&&p&&r.push(...p());const f=Ie(s,"addPasteRules",a);$y(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[GU({editor:e,rules:r}),...QU({editor:e,rules:o}),...i]}get attributes(){return _C(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=wu(this.extensions);return Object.fromEntries(t.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:tn(r.name,this.schema)},s=Ie(r,"addNodeView",i);if(!s)return[];const a=(l,c,u,d,p)=>{const f=hc(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 t;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Ed(e.name,this.schema)};e.type==="mark"&&(!((t=Je(Ie(e,"keepOnSplit",r)))!==null&&t!==void 0)||t)&&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 Ln{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 Ln(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Su(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Ln({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.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: "${t.name}".`),t.options=Je(Ie(t,"addOptions",{name:t.name})),t.storage=Je(Ie(t,"addStorage",{name:t.name,options:t.options})),t}}function HC(n,e,t){const{from:r,to:o}=e,{blockSeparator:i=` - -`,textSerializers:s={}}=t||{};let a="";return n.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 VC(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const t7=Ln.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new mn({key:new Un("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{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=VC(t);return HC(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),n7=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),r7=(n=!1)=>({commands:e})=>e.setContent("",n),o7=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:o}=r;return t&&o.forEach(({$from:i,$to:s})=>{n.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=BV(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},i7=n=>e=>n(e),s7=()=>({state:n,dispatch:e})=>TU(n,e),a7=(n,e)=>({editor:t,tr:r})=>{const{state:o}=t,i=o.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new qe(r.doc.resolve(s-1))),!0},l7=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const o=n.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);n.delete(a,l).scrollIntoView()}return!0}return!1},c7=n=>({tr:e,state:t,dispatch:r})=>{const o=tn(n,t.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},u7=n=>({tr:e,dispatch:t})=>{const{from:r,to:o}=n;return t&&e.delete(r,o),!0},d7=()=>({state:n,dispatch:e})=>mU(n,e),p7=()=>({commands:n})=>n.keyboardShortcut("Enter"),f7=()=>({state:n,dispatch:e})=>EU(n,e);function mc(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>t.strict?e[o]===n[o]:Gh(e[o])?e[o].test(n[o]):e[o]===n[o]):!0}function Fp(n,e,t={}){return n.find(r=>r.type===e&&mc(r.attrs,t))}function h7(n,e,t={}){return!!Fp(n,e,t)}function Kh(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const o=Fp([...r.node.marks],e,t);if(!o)return;let i=r.index,s=n.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(Fp([...r.node.marks],e,t);i>0&&o.isInSet(n.parent.child(i-1).marks);)i-=1,s-=n.parent.child(i).nodeSize;for(;a({tr:t,state:r,dispatch:o})=>{const i=So(n,r.schema),{doc:s,selection:a}=t,{$from:l,from:c,to:u}=a;if(o){const d=Kh(l,i,e);if(d&&d.from<=c&&d.to>=u){const p=qe.create(s,d.from,d.to);t.setSelection(p)}}return!0},g7=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r({editor:t,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{ku()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(i&&n===null&&!UC(t.state.selection))return s(),!0;const a=WC(o.doc,n)||t.state.selection,l=t.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},y7=(n,e)=>t=>n.every((r,o)=>e(r,{...t,index:o})),b7=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),GC=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&GC(r)}return n};function ml(n){const e=`${n}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return GC(t)}function gc(n,e,t){t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,o=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return ee.fromArray(n.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(n);return t.errorOnInvalidContent&&s.check(),s}catch(i){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",i),gc("",e,t)}if(o){if(t.errorOnInvalidContent){let s=!1,a="";const l=new pw({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(t.slice?Zs.fromSchema(l).parseSlice(ml(n),t.parseOptions):Zs.fromSchema(l).parse(ml(n),t.parseOptions),t.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Zs.fromSchema(e);return t.slice?i.parseSlice(ml(n),t.parseOptions).content:i.parse(ml(n),t.parseOptions)}return gc("",e,t)}function x7(n,e,t){const r=n.steps.length-1;if(r{s===0&&(s=u)}),n.setSelection(Ze.near(n.doc.resolve(s),t))}const w7=n=>!("type"in n),C7=(n,e,t)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){t={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let a;try{a=gc(e,i.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(s=t.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 n=="number"?{from:n,to:n}:{from:n.from,to:n.to},u=!0,d=!0;if((w7(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)),t.updateSelection&&x7(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:f}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:f})}return!0},S7=()=>({state:n,dispatch:e})=>CU(n,e),k7=()=>({state:n,dispatch:e})=>SU(n,e),M7=()=>({state:n,dispatch:e})=>gU(n,e),E7=()=>({state:n,dispatch:e})=>xU(n,e),T7=()=>({state:n,dispatch:e,tr:t})=>{try{const r=bC(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},O7=()=>({state:n,dispatch:e,tr:t})=>{try{const r=bC(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},L7=()=>({state:n,dispatch:e})=>vU(n,e),A7=()=>({state:n,dispatch:e})=>yU(n,e);function KC(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function P7(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,o,i,s;for(let a=0;a({editor:e,view:t,tr:r,dispatch:o})=>{const i=P7(n).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(()=>{t.someProp("handleKeyDown",c=>c(t,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function ya(n,e,t={}){const{from:r,to:o,empty:i}=n.selection,s=e?tn(e,n.schema):null,a=[];n.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=>mc(d.node.attrs,t,{strict:!1}));return i?!!c.length:c.reduce((d,p)=>d+p.to-p.from,0)>=l}const R7=(n,e={})=>({state:t,dispatch:r})=>{const o=tn(n,t.schema);return ya(t,o,e)?kU(t,r):!1},I7=()=>({state:n,dispatch:e})=>OU(n,e),$7=n=>({state:e,dispatch:t})=>{const r=tn(n,e.schema);return NU(r)(e,t)},N7=()=>({state:n,dispatch:e})=>MU(n,e);function Mu(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Ny(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,o)=>(t.includes(o)||(r[o]=n[o]),r),{})}const B7=(n,e)=>({tr:t,state:r,dispatch:o})=>{let i=null,s=null;const a=Mu(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(i=tn(n,r.schema)),a==="mark"&&(s=So(n,r.schema)),o&&t.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{i&&i===c.type&&t.setNodeMarkup(u,void 0,Ny(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&t.addMark(u,u+c.nodeSize,s.create(Ny(d.attrs,e)))})})}),!0):!1},F7=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),j7=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),_7=()=>({state:n,dispatch:e})=>bU(n,e),z7=()=>({state:n,dispatch:e})=>wU(n,e),H7=()=>({state:n,dispatch:e})=>LU(n,e),V7=()=>({state:n,dispatch:e})=>DU(n,e),U7=()=>({state:n,dispatch:e})=>PU(n,e);function jp(n,e,t={},r={}){return gc(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const W7=(n,e=!1,t={},r={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{var l,c;const{doc:u}=i;if(t.preserveWhitespace!=="full"){const d=jp(n,o.schema,t,{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},n,{parseOptions:t,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function qh(n,e){const t=So(e,n.schema),{from:r,to:o,empty:i}=n.selection,s=[];i?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,o,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===t.name);return a?{...a.attrs}:{}}function G7(n,e){const t=new rU(n);return e.forEach(r=>{r.steps.forEach(o=>{t.step(o)})}),t}function K7(n){for(let e=0;e{t(o)&&r.push({node:o,pos:i})}),r}function Y7(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Yh(n){return e=>Y7(e.$from,n)}function J7(n,e){const t=li.fromSchema(e).serializeFragment(n),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(t),o.innerHTML}function Z7(n,e){const t={from:0,to:n.content.size};return HC(n,t,e)}function X7(n,e){const t=tn(e,n.schema),{from:r,to:o}=n.selection,i=[];n.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===t.name);return s?{...s.attrs}:{}}function qC(n,e){const t=Mu(typeof e=="string"?e:e.name,n.schema);return t==="node"?X7(n,e):t==="mark"?qh(n,e):{}}function Q7(n,e=JSON.stringify){const t={};return n.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(t,o)?!1:t[o]=!0})}function eW(n){const e=Q7(n);return e.length===1?e:e.filter((t,r)=>!e.filter((i,s)=>s!==r).some(i=>t.oldRange.from>=i.oldRange.from&&t.oldRange.to<=i.oldRange.to&&t.newRange.from>=i.newRange.from&&t.newRange.to<=i.newRange.to))}function tW(n){const{mapping:e,steps:t}=n,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}=t[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}})})}),eW(r)}function Jh(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(o=>{const i=t.resolve(n),s=Kh(i,o.type);s&&r.push({mark:o,...s})}):t.nodesBetween(n,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 $l(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const o=n.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function _p(n,e,t={}){const{empty:r,ranges:o}=n.selection,i=e?So(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>mc(d.attrs,t,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:d,$to:p})=>{const f=d.pos,m=p.pos;n.doc.nodesBetween(f,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const b=Math.max(f,y),w=Math.min(m,y+g.nodeSize),S=w-b;s+=S,a.push(...g.marks.map(T=>({mark:T,from:b,to:w})))})}),s===0)return!1;const l=a.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>mc(d.mark.attrs,t,{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 nW(n,e,t={}){if(!e)return ya(n,null,t)||_p(n,null,t);const r=Mu(e,n.schema);return r==="node"?ya(n,e,t):r==="mark"?_p(n,e,t):!1}function By(n,e){const{nodeExtensions:t}=wu(e),r=t.find(s=>s.name===n);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 Zh(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!==null&&r!==void 0?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let o=!0;return n.content.forEach(i=>{o!==!1&&(Zh(i,{ignoreWhitespace:t,checkChildren:e})||(o=!1))}),o}return!1}function rW(n,e,t){const o=n.state.doc.content.size,i=Fr(e,0,o),s=Fr(t,0,o),a=n.coordsAtPos(i),l=n.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 oW(n,e,t){var r;const{selection:o}=e;let i=null;if(UC(o)&&(i=o.$cursor),i){const a=(r=n.storedMarks)!==null&&r!==void 0?r:i.marks();return!!t.isInSet(a)||!a.some(l=>l.type.excludes(t))}const{ranges:s}=o;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(a.pos,l.pos,(u,d,p)=>{if(c)return!1;if(u.isInline){const f=!p||p.type.allowsMarkType(t),m=!!t.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(t));c=f&&m}return!c}),c})}const iW=(n,e={})=>({tr:t,state:r,dispatch:o})=>{const{selection:i}=t,{empty:s,ranges:a}=i,l=So(n,r.schema);if(o)if(s){const c=qh(r,l);t.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&&t.addMark(m,g,l.create({...b.attrs,...e}))}):t.addMark(m,g,l.create(e))})});return oW(r,t,l)},sW=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),aW=(n,e={})=>({state:t,dispatch:r,chain:o})=>{const i=tn(n,t.schema);return i.isTextblock?o().command(({commands:s})=>Dy(i,e)(t)?!0:s.clearNodes()).command(({state:s})=>Dy(i,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},lW=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,o=Fr(n,0,r.content.size),i=Ve.create(r,o);e.setSelection(i)}return!0},cW=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:o,to:i}=typeof n=="number"?{from:n,to:n}:n,s=qe.atStart(r).from,a=qe.atEnd(r).to,l=Fr(o,s,a),c=Fr(i,s,a),u=qe.create(r,l,c);e.setSelection(u)}return!0},uW=n=>({state:e,dispatch:t})=>{const r=tn(n,e.schema);return jU(r)(e,t)};function Fy(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(o=>e==null?void 0:e.includes(o.type.name));n.tr.ensureMarks(r)}}const dW=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=o.extensionManager.attributes,u=$l(c,a.node().type.name,a.node().attrs);if(i instanceof Ve&&i.node.isBlock)return!a.parentOffset||!Dl(s,a.pos)?!1:(r&&(n&&Fy(t,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:K7(a.node(-1).contentMatchAt(a.indexAfter(-1)));let f=d&&p?[{type:p,attrs:u}]:void 0,m=Dl(e.doc,e.mapping.map(a.pos),1,f);if(!f&&!m&&Dl(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 qe&&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)}n&&Fy(t,o.extensionManager.splittableMarks),e.scrollIntoView()}return m},pW=(n,e={})=>({tr:t,state:r,dispatch:o,editor:i})=>{var s;const a=tn(n,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=ee.empty;const w=l.index(-1)?1:l.index(-2)?2:3;for(let E=l.depth-w;E>=l.depth-3;E-=1)b=ee.from(l.node(E).copy(b));const S=l.indexAfter(-1){if(C>-1)return!1;E.isTextblock&&E.content.size===0&&(C=P+1)}),C>-1&&t.setSelection(qe.near(t.doc.resolve(C))),t.scrollIntoView()}return!0}const f=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,m={...$l(p,d.type.name,d.attrs),...e},g={...$l(p,l.node().type.name,l.node().attrs),...e};t.delete(l.pos,c.pos);const y=f?[{type:a,attrs:m},{type:f,attrs:g}]:[{type:a,attrs:m}];if(!Dl(t.doc,l.pos,2))return!1;if(o){const{selection:b,storedMarks:w}=r,{splittableMarks:S}=i.extensionManager,T=w||b.$to.parentOffset&&b.$from.marks();if(t.split(l.pos,2,y).scrollIntoView(),!T||!o)return!0;const k=T.filter(x=>S.includes(x.type.name));t.ensureMarks(k)}return!0},Td=(n,e)=>{const t=Yh(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const o=n.doc.nodeAt(r);return t.node.type===(o==null?void 0:o.type)&&zh(n.doc,t.pos)&&n.join(t.pos),!0},Od=(n,e)=>{const t=Yh(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const o=n.doc.nodeAt(r);return t.node.type===(o==null?void 0:o.type)&&zh(n.doc,r)&&n.join(r),!0},fW=(n,e,t,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:d,splittableMarks:p}=o.extensionManager,f=tn(n,s.schema),m=tn(e,s.schema),{selection:g,storedMarks:y}=s,{$from:b,$to:w}=g,S=b.blockRange(w),T=y||g.$to.parentOffset&&g.$from.marks();if(!S)return!1;const k=Yh(x=>By(x.type.name,d))(g);if(S.depth>=1&&k&&S.depth-k.depth<=1){if(k.node.type===f)return c.liftListItem(m);if(By(k.node.type.name,d)&&f.validContent(k.node.content)&&a)return l().command(()=>(i.setNodeMarkup(k.pos,f),!0)).command(()=>Td(i,f)).command(()=>Od(i,f)).run()}return!t||!T||!a?l().command(()=>u().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>Td(i,f)).command(()=>Od(i,f)).run():l().command(()=>{const x=u().wrapInList(f,r),C=T.filter(E=>p.includes(E.type.name));return i.ensureMarks(C),x?!0:c.clearNodes()}).wrapInList(f,r).command(()=>Td(i,f)).command(()=>Od(i,f)).run()},hW=(n,e={},t={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=t,s=So(n,r.schema);return _p(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},mW=(n,e,t={})=>({state:r,commands:o})=>{const i=tn(n,r.schema),s=tn(e,r.schema),a=ya(r,i,t);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,...t})},gW=(n,e={})=>({state:t,commands:r})=>{const o=tn(n,t.schema);return ya(t,o,e)?r.lift(o):r.wrapIn(o,e)},vW=()=>({state:n,dispatch:e})=>{const t=n.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,n.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1},yW=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:o}=t;return r||e&&o.forEach(i=>{n.removeMark(i.$from.pos,i.$to.pos)}),!0},bW=(n,e={})=>({tr:t,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=t,l=So(n,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=Kh(c,l,m);g&&(p=g.from,f=g.to),t.removeMark(p,f,l)}else d.forEach(p=>{t.removeMark(p.$from.pos,p.$to.pos,l)});return t.removeStoredMark(l),!0},xW=(n,e={})=>({tr:t,state:r,dispatch:o})=>{let i=null,s=null;const a=Mu(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(i=tn(n,r.schema)),a==="mark"&&(s=So(n,r.schema)),o&&t.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(d,p)=>{i&&i===d.type&&t.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);t.addMark(m,g,s.create({...f.attrs,...e}))}})})}),!0):!1},wW=(n,e={})=>({state:t,dispatch:r})=>{const o=tn(n,t.schema);return RU(o,e)(t,r)},CW=(n,e={})=>({state:t,dispatch:r})=>{const o=tn(n,t.schema);return IU(o,e)(t,r)};var SW=Object.freeze({__proto__:null,blur:n7,clearContent:r7,clearNodes:o7,command:i7,createParagraphNear:s7,cut:a7,deleteCurrentNode:l7,deleteNode:c7,deleteRange:u7,deleteSelection:d7,enter:p7,exitCode:f7,extendMarkRange:m7,first:g7,focus:v7,forEach:y7,insertContent:b7,insertContentAt:C7,joinBackward:M7,joinDown:k7,joinForward:E7,joinItemBackward:T7,joinItemForward:O7,joinTextblockBackward:L7,joinTextblockForward:A7,joinUp:S7,keyboardShortcut:D7,lift:R7,liftEmptyBlock:I7,liftListItem:$7,newlineInCode:N7,resetAttributes:B7,scrollIntoView:F7,selectAll:j7,selectNodeBackward:_7,selectNodeForward:z7,selectParentNode:H7,selectTextblockEnd:V7,selectTextblockStart:U7,setContent:W7,setMark:iW,setMeta:sW,setNode:aW,setNodeSelection:lW,setTextSelection:cW,sinkListItem:uW,splitBlock:dW,splitListItem:pW,toggleList:fW,toggleMark:hW,toggleNode:mW,toggleWrap:gW,undoInputRule:vW,unsetAllMarks:yW,unsetMark:bW,updateAttributes:xW,wrapIn:wW,wrapInList:CW});const kW=Ln.create({name:"commands",addCommands(){return{...SW}}}),MW=Ln.create({name:"drop",addProseMirrorPlugins(){return[new mn({key:new Un("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),EW=Ln.create({name:"editable",addProseMirrorPlugins(){return[new mn({key:new Un("editable"),props:{editable:()=>this.editor.options.editable}})]}}),TW=Ln.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new mn({key:new Un("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),OW=Ln.create({name:"keymap",addKeyboardShortcuts(){const n=()=>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:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":n,"Alt-Backspace":n,"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 ku()||KC()?i:o},addProseMirrorPlugins(){return[new mn({key:new Un("clearDocument"),appendTransaction:(n,e,t)=>{const r=n.some(g=>g.docChanged)&&!e.doc.eq(t.doc),o=n.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)||!Zh(t.doc))return;const p=t.tr,f=bu({state:t,transaction:p}),{commands:m}=new xu({editor:this.editor,state:f});if(m.clearNodes(),!!p.steps.length)return p}})]}}),LW=Ln.create({name:"paste",addProseMirrorPlugins(){return[new mn({key:new Un("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),AW=Ln.create({name:"tabindex",addProseMirrorPlugins(){return[new mn({key:new Un("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Do{get name(){return this.node.type.name}constructor(e,t,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,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 t=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}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,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),t=this.resolvedPos.doc.resolve(e);return new Do(t,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 Do(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 Do(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,r)=>{const o=t.isBlock&&!t.isTextblock,i=this.pos+r+1,s=this.resolvedPos.doc.resolve(i);if(!o&&s.depth<=this.depth)return;const a=new Do(s,this.editor,o,o?t:null);o&&(a.actualDepth=this.depth+1),e.push(new Do(s,this.editor,o,o?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(t).length>0){const i=o.node.attrs,s=Object.keys(t);for(let a=0;a{r&&o.length>0||(s.node.type.name===e&&i.every(l=>t[l]===s.node.attrs[l])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,t,r))))}),o}setAttribute(e){const t=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(t.from).run()}}const PW=`.ProseMirror { + & span { + font-size: 14px; + margin: 0; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + line-height: 20px; + } +`,Vz=Y.span` + font-weight: ${j.fontWeight.semiBold}; + margin-bottom: 12px !important; +`,Uz=Y(Ca)` + align-self: flex-end; + margin-top: auto; +`,Wz=n=>{var s,a;const{address:e,onEdit:t,onRemoveAddress:r,disabled:o}=n,i=e.types.map(l=>l.label);return v.jsxs(Hz,{"data-testid":"address-card-test",children:[v.jsx(Vz,{children:`${S1(i)} Address`}),v.jsx("span",{children:e==null?void 0:e.address1}),(e==null?void 0:e.address2)&&v.jsx("span",{children:e==null?void 0:e.address2}),(e==null?void 0:e.address3)&&v.jsx("span",{children:e==null?void 0:e.address3}),v.jsx("span",{children:`${e==null?void 0:e.city}, ${(s=e==null?void 0:e.state)!=null&&s.label?e.state.label:""} ${e==null?void 0:e.postalCode}`}),v.jsx("span",{children:(a=e==null?void 0:e.country)==null?void 0:a.label}),v.jsxs(Uz,{separator:!0,children:[v.jsx(ln,{label:"Edit",color:"teal",variant:"text",disabled:o,onClick:()=>t(e)}),v.jsx(ln,{color:"red",variant:"text",disabled:o,label:"Remove",onClick:()=>r(e)})]})]})},Gz=h.memo(Wz);Y.div` + align-items: center; + background-color: ${j.newColors.grey2[100]}; + display: flex; + justify-content: center; + min-height: 204px; + width: 300px; +`;const Kz=Y.div` + display: flex; + flex-wrap: wrap; + gap: 16px; +`,qz=Y.div` + margin-bottom: 16px; +`,Yz=Y.div` + display: flex; + gap: 16px; +`;function Jz(){return v.jsxs("div",{children:[v.jsx(Xe,{variant:"rectangular",width:143,height:36,sx:{marginBottom:2}}),v.jsxs(Yz,{children:[v.jsx(Xe,{variant:"rectangular",width:300,height:204}),v.jsx(Xe,{variant:"rectangular",width:300,height:204})]})]})}const nd=[{label:"Physical",value:"physical",inputSettingsKey:"amountPhysical"},{label:"Billing",value:"billing",inputSettingsKey:"amountBilling"},{label:"Shipping",value:"shipping",inputSettingsKey:"amountShipping"}],Zz=n=>{var E,P,O;const{disabled:e,value:t,onBlur:r,onChange:o,fieldDef:i,skeleton:s}=n,[a,l]=h.useState(!1),[c,u]=h.useState(!1),[d,p]=h.useState(!1),[f,m]=h.useState(null),{singleType:g,limits:y}=h.useMemo(()=>{var _,$;const D=nd.map(G=>{var le;return{...G,limit:(le=i==null?void 0:i.inputSettings)==null?void 0:le[G.inputSettingsKey]}}).filter(G=>G.limit!==void 0),U=D.length===1&&((_=i==null?void 0:i.inputSettings)==null?void 0:_.amountPerType)===void 0?D[0]:!1,N=(($=i==null?void 0:i.inputSettings)==null?void 0:$.amountPerType)??+!D.length;return{limits:nd.reduce((G,le)=>{var Z;return{...G,[le.value]:((Z=i==null?void 0:i.inputSettings)==null?void 0:Z[le.inputSettingsKey])??N}},{}),singleType:U}},[i==null?void 0:i.inputSettings]),b=h.useMemo(()=>nd.filter(D=>{const U=(t||[]).filter(N=>N.types.map(({value:z})=>z).includes(D.value));return!(y[D.value]>-1&&U.length>=y[D.value])}),[y,t]),w=()=>{l(!0)},S=h.useCallback(async F=>{o((t||[]).filter(D=>D!==F)),await r()},[r,o,t]),T=async(F=!1)=>{typeof F=="boolean"&&F?(l(!1),r&&await r()):c?p(!0):(l(!1),r&&await r())},k=async F=>{F&&l(!1),p(!1)},x=F=>{const D=[...t||[]],U={...F,types:g?[{value:g.value,label:g.label}]:F.types};if(typeof a=="object"){const N=t.findIndex(z=>z===a);D.splice(N,1,U)}else D.push(U);o(D)},C=h.useMemo(()=>[{label:"No, keep it",onClick:()=>m(void 0),color:"gray",variant:"outlined"},{label:"Yes, remove it",onClick:()=>{S(f),m(void 0)},color:"yellow",variant:"contained"}],[S,f]);return s?v.jsx(Jz,{}):v.jsxs(v.Fragment,{children:[b.length>0&&v.jsx(qz,{children:v.jsx(ln,{disabled:e,color:"gray",variant:"outlined",label:"ADD ADDRESS",onClick:w})}),!!t&&v.jsx(Kz,{children:t.map((F,D)=>v.jsx(Gz,{address:F,onEdit:l,disabled:e,onRemoveAddress:m},`${D}`))}),v.jsx(pf,{open:!!a,onClose:T,children:v.jsx(zz,{googleMapsApiKey:(E=i==null?void 0:i.inputSettings)==null?void 0:E.googleMapsApiKey,handleClose:T,addressToEdit:typeof a=="object"?a:void 0,handleUnsavedChanges:F=>u(F),dialogOpen:d,handleDialogClose:k,addressTypes:g?void 0:b,getOptionsCountries:(P=i==null?void 0:i.inputSettings)==null?void 0:P.getOptionsCountries,getOptionsStates:(O=i==null?void 0:i.inputSettings)==null?void 0:O.getOptionsStates,onSave:x})}),v.jsx(hf,{buttons:C,dialogTitle:"Are you sure you want to remove this address?",open:!!f,children:"All data for this address will be lost. This action is irreversible."})]})},Xz=h.memo(Zz);function on(n){this.content=n}on.prototype={constructor:on,find:function(n){for(var e=0;e>1}};on.from=function(n){if(n instanceof on)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new on(e)};function K1(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let o=n.child(r),i=e.child(r);if(o==i){t+=o.nodeSize;continue}if(!o.sameMarkup(i))return t;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)t++;return t}if(o.content.size||i.content.size){let s=K1(o.content,i.content,t+1);if(s!=null)return s}t+=o.nodeSize}}function q1(n,e,t,r){for(let o=n.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:t,b:r};let s=n.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){t-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:t,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,t-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,o){let i="",s=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-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 t=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(o[o.length-1]=t.withText(t.text+r.text),i=1);ie)for(let i=0,s=0;se&&((st)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),o+=a.nodeSize),s=l}return new ee(r,o)}cutByIndex(e,t){return e==t?ee.empty:e==0&&t==this.content.length?this:new ee(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let o=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return o[e]=t,new ee(o,i)}addToStart(e){return new ee([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ee(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.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||t>0?dl(r+1,s):dl(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,t){if(!t)return ee.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ee(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ee.empty;let t,r=0;for(let o=0;othis.type.rank&&(t||(t=e.slice(0,o)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-o.type.rank),t}};ht.none=[];class ts extends Error{}class se{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=J1(this.content,e+this.openStart,t);return r&&new se(r,this.openStart,this.openEnd)}removeBetween(e,t){return new se(Y1(this.content,e+this.openStart,t+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,t){if(!t)return se.empty;let r=t.openStart||0,o=t.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new se(ee.fromJSON(e,t.content),r,o)}static maxOpen(e,t=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)o++;return new se(e,r,o)}}se.empty=new se(ee.empty,0,0);function Y1(n,e,t){let{index:r,offset:o}=n.findIndex(e),i=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(o==e||i.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Y1(i.content,e-o-1,t-o-1)))}function J1(n,e,t,r){let{index:o,offset:i}=n.findIndex(e),s=n.maybeChild(o);if(i==e||s.isText)return n.cut(0,e).append(t).append(n.cut(e));let a=J1(s.content,e-i-1,t);return a&&n.replaceChild(o,s.copy(a))}function Qz(n,e,t){if(t.openStart>n.depth)throw new ts("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ts("Inconsistent open depths");return Z1(n,e,t,0)}function Z1(n,e,t,r){let o=n.index(r),i=n.node(r);if(o==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Js(n,e,t,r){let o=(e||n).node(t),i=0,s=e?e.index(t):o.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(_o(n.nodeAfter,r),i++));for(let a=i;ao&&mp(n,e,o+1),s=r.depth>o&&mp(t,r,o+1),a=[];return Js(null,n,o,a),i&&s&&e.index(o)==t.index(o)?(X1(i,s),_o(zo(i,Q1(n,e,t,r,o+1)),a)):(i&&_o(zo(i,rc(n,e,o+1)),a),Js(e,t,o,a),s&&_o(zo(s,rc(t,r,o+1)),a)),Js(r,null,o,a),new ee(a)}function rc(n,e,t){let r=[];if(Js(null,n,t,r),n.depth>t){let o=mp(n,e,t+1);_o(zo(o,rc(n,e,t+1)),r)}return Js(e,null,t,r),new ee(r)}function eH(n,e){let t=e.depth-n.openStart,o=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)o=e.node(i).copy(ee.from(o));return{start:o.resolveNoCache(n.openStart+t),end:o.resolveNoCache(o.content.size-n.openEnd-t)}}class da{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw 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,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(t);return r?e.child(t).cut(r):o}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],o=t==0?0:this.path[t*3-1]+1;for(let i=0;i0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new oc(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&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],o=0,i=t;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 da(t,r,i)}static resolveCached(e,t){let r=w0.get(e);if(r)for(let i=0;ie&&this.nodesBetween(e,t,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()+")"),ew(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=ee.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=o;lt.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let o=ee.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};Ho.prototype.text=void 0;class ic extends Ho{constructor(e,t,r,o){if(super(e,t,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):ew(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ic(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ic(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function ew(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Ko{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new oH(e,t);if(r.next==null)return Ko.empty;let o=tw(r);r.next&&r.err("Unexpected trailing text");let i=dH(uH(o));return pH(i,r),i}matchType(e){for(let t=0;tc.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 t(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(` +`)}}Ko.empty=new Ko(!0);class oH{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function tw(n){let e=[];do e.push(iH(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function iH(n){let e=[];do e.push(sH(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function sH(n){let e=cH(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=aH(n,e);else break;return e}function C0(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function aH(n,e){let t=C0(n),r=t;return n.eat(",")&&(n.next!="}"?r=C0(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function lH(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let o=[];for(let i in t){let s=t[i];s.groups.indexOf(e)>-1&&o.push(s)}return o.length==0&&n.err("No node type or group '"+e+"' found"),o}function cH(n){if(n.eat("(")){let e=tw(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=lH(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function uH(n){let e=[[]];return o(i(n,0),t()),e;function t(){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=t())}else if(s.type=="star"){let l=t();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=t();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{n[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 Ko(r.indexOf(n.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[i]=new aw(i,t,s));let o=t.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 fH(n,e,t){let r=t.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 ${n}, got ${i}`)}}class hH{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?fH(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Na{constructor(e,t,r,o){this.name=e,this.rank=t,this.schema=r,this.spec=o,this.attrs=sw(e,o.attrs),this.excluded=null;let i=rw(this.attrs);this.instance=i?new ht(this,i):null}create(e=null){return!e&&this.instance?this.instance:new ht(this,ow(this.attrs,e))}static compile(e,t){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Na(i,o++,t,s)),r}removeFromSet(e){for(var t=0;t-1}}class lw{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let o in e)t[o]=e[o];t.nodes=on.from(e.nodes),t.marks=on.from(e.marks||{}),this.nodes=k0.compile(this.spec.nodes,this),this.marks=Na.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]=Ko.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?M0(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==""?[]:M0(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,t=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof k0){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(t,r,o)}text(e,t){let r=this.nodes.text;return new ic(r,r.defaultAttrs,e,ht.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Ho.fromJSON(this,e)}markFromJSON(e){return ht.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function M0(n,e){let t=[];for(let r=0;r-1)&&t.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function mH(n){return n.tag!=null}function gH(n){return n.style!=null}let Zs=class vp{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(o=>{if(mH(o))this.tags.push(o);else if(gH(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,t={}){let r=new T0(this,t,!1);return r.addAll(e,ht.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new T0(this,t,!0);return r.addAll(e,ht.none,t.from,t.to),se.maxOpen(r.finish())}matchTag(e,t,r){for(let o=r?this.tags.indexOf(r)+1:0;oe.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(s.getAttrs){let l=s.getAttrs(t);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let t=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s{r(s=O0(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=O0(s)),s.node||s.ignore||s.mark||(s.node=o)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new vp(e,vp.schemaRules(e)))}};const cw={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},vH={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},uw={ol:!0,ul:!0},sc=1,ac=2,Xs=4;function E0(n,e,t){return e!=null?(e?sc:0)|(e==="full"?ac:0):n&&n.whitespace=="pre"?sc|ac:t&~Xs}class pl{constructor(e,t,r,o,i,s){this.type=e,this.attrs=t,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=ht.none,this.match=i||(s&Xs?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(ee.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);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&sc)){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 t=ee.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(ee.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!cw.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class T0{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let o=t.topNode,i,s=E0(null,t.preserveWhitespace,0)|(r?Xs:0);o?i=new pl(o.type,o.attrs,ht.none,!0,t.topMatch||o.type.contentMatch,s):r?i=new pl(null,null,ht.none,!0,null,s):i=new pl(e.schema.topNodeType,null,ht.none,!0,null,s),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,o=this.top;if(o.options&ac||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o.options&sc)o.options&ac?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),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let o=e.nodeName.toLowerCase(),i;uw.hasOwnProperty(o)&&this.parser.normalizeLists&&yH(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,r));if(s?s.ignore:vH.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);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(cw.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,t);return}let u=s&&s.skip?t:this.readStyles(e,t);u&&this.addAll(e,u),a&&this.sync(l),this.needsBlock=c}else{let a=this.readStyles(e,t);a&&this.addElementByRule(e,s,a,s.consuming===!1?i:void 0)}}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` +`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let o=0;o!l.clearMark(c)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,r,o){let i,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(s,t.attrs||null,r,t.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[t.mark];r=r.concat(l.create(t.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,r)}i&&this.sync(a)&&this.open--}addAll(e,t,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,t);this.findAtPoint(e,i)}findPlace(e,t){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):L0(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new pl(e,t,l,o,null,a)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=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=t[a];if(c==""){if(a==t.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(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function yH(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&uw.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function bH(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function O0(n){let e={};for(let t in n)e[t]=n[t];return e}function L0(n,e){let t=e.schema.nodes;for(let r in t){let o=t[r];if(!o.allowsMarkType(n))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,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let o=this.marks[e.type.name];return o&&Ml(od(r),o(e,t),null,e.attrs)}static renderSpec(e,t,r=null,o){return Ml(e,t,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new li(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=A0(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return A0(e.marks)}}function A0(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function od(n){return n.document||window.document}const P0=new WeakMap;function xH(n){let e=P0.get(n);return e===void 0&&P0.set(n,e=wH(n)),e}function wH(n){let e=null;function t(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&&(t=o.slice(0,s),o=o.slice(s+1));let a,l=t?n.createElementNS(t,o):n.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}=Ml(n,p,t,r);if(l.appendChild(f),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const dw=65535,pw=Math.pow(2,16);function CH(n,e){return n+e*pw}function D0(n){return n&dw}function SH(n){return(n-(n&dw))/pw}const fw=1,hw=2,El=4,mw=8;let yp=class{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&mw)>0}get deletedBefore(){return(this.delInfo&(fw|El))>0}get deletedAfter(){return(this.delInfo&(hw|El))>0}get deletedAcross(){return(this.delInfo&El)>0}},qo=class Bi{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Bi.empty)return Bi.empty}recover(e){let t=0,r=D0(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:t:t,f=l+o+(p<0?0:u);if(r)return f;let m=e==(t<0?l:d)?null:CH(a/3,e-l),g=e==l?hw:e==d?fw:El;return(t<0?e!=l:e!=d)&&(g|=mw),new yp(f,g,m)}o+=u-c}return r?e+o:new yp(e+o,0,null)}touches(e,t){let r=0,o=D0(t),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 t=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o=0;t--){let o=e.getMirror(t);this.appendMap(e.maps[t].invert(),o!=null&&o>t?r-o-1:void 0)}}invert(){let e=new Tl;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!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),t.openStart,t.openEnd);return bn.fromReplace(e,this.from,this.to,i)}invert(){return new Ba(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Rs(t.pos,r.pos,this.mark)}merge(e){return e instanceof Rs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Rs(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Rs(t.from,t.to,e.markFromJSON(t.mark))}};hn.jsonID("addMark",Sh);let Ba=class Is extends hn{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new se(Ch(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return bn.fromReplace(e,this.from,this.to,r)}invert(){return new Sh(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Is(t.pos,r.pos,this.mark)}merge(e){return e instanceof Is&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Is(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Is(t.from,t.to,e.markFromJSON(t.mark))}};hn.jsonID("removeMark",Ba);let kh=class $s extends hn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return bn.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return bn.fromReplace(e,this.pos,this.pos+1,new se(ee.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let o=0;or.pos?null:new Ol(t.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ol(t.from,t.to,t.gapFrom,t.gapTo,se.fromJSON(e,t.slice),t.insert,!!t.structure)}};hn.jsonID("replaceAround",vr);function xp(n,e,t){let r=n.resolve(e),o=t-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 kH(n,e,t,r){let o=[],i=[],s,a;n.doc.nodesBetween(e,t,(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,t),m=r.addToSet(d);for(let g=0;gn.step(l)),i.forEach(l=>n.step(l))}function MH(n,e,t,r){let o=[],i=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Na){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,t);for(let u=0;un.step(new Ba(s.from,s.to,s.style)))}function vw(n,e,t,r=t.contentMatch,o=!0){let i=n.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)n.step(s[l])}function EH(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function TH(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let o=n.$from.node(r),i=n.$from.index(r),s=n.$to.indexAfter(r);if(rt;m--)g||r.index(m)>0?(g=!0,u=ee.from(r.node(m).copy(u)),d++):l--;let p=ee.empty,f=0;for(let m=i,g=!1;m>t;m--)g||o.after(m+1)=0;s--){if(r.size){let a=t[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=ee.from(t[s].type.create(t[s].attrs,r))}let o=e.start,i=e.end;n.step(new vr(o,i,o,i,new se(r,0,0),t.length,!0))}function RH(n,e,t,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&NH(n.doc,n.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&&$H(n,s,a,i),vw(n,n.mapping.slice(i).map(a,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(a,1),p=u.map(a+s.nodeSize,1);return n.step(new vr(d,p,d+1,p-1,new se(ee.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&IH(n,s,a,i),!1}})}function IH(n,e,t,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=n.mapping.slice(r).map(t+1+i+s.index);n.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function $H(n,e,t,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+i);n.replaceWith(s,s+1,e.type.schema.text(` +`))}})}function NH(n,e,t){let r=n.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,t)}function BH(n,e,t,r,o){let i=n.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let s=t.create(r,null,o||i.marks);if(i.isLeaf)return n.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new vr(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new se(ee.from(s),0,0),1,!0))}function FH(n,e,t=1,r){let o=n.resolve(e),i=o.depth-t,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=t-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 jH(n,e,t=1,r){let o=n.doc.resolve(e),i=ee.empty,s=ee.empty;for(let a=o.depth,l=o.depth-t,c=t-1;a>l;a--,c--){i=ee.from(o.node(a).copy(i));let u=r&&r[c];s=ee.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}n.step(new zr(e,e,new se(i.append(s),t,t),!0))}function _H(n,e){let t=n.resolve(e),r=t.index();return zH(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function zH(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function HH(n,e,t){let r=new zr(e-t,e+t,se.empty,!0);n.step(r)}function VH(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))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,t))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,t))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 UH(n,e,t=e,r=se.empty){if(e==t&&!r.size)return null;let o=n.resolve(e),i=n.resolve(t);return bw(o,i,r)?new zr(e,t,r):new WH(o,i,r).fit()}function bw(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}let WH=class{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=ee.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=ee.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(),t=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 vr(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new zr(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=sd(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(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ee.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(t==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:t,openEnd:r}=this.unplaced,o=sd(e,t);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new se(e,t+1,Math.max(r,o.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=sd(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new se(Ns(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new se(Ns(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(d=y,u.push(xw(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=Bs(this.placed,t,ee.from(u)),this.frontier[t].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 t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:o}=this.frontier[t],i=t=0;a--){let{match:l,type:c}=this.frontier[a],u=ad(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Bs(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.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,t=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Bs(this.placed,this.depth,ee.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ee.empty,!0);t.childCount&&(this.placed=Bs(this.placed,this.frontier.length,t))}};function Ns(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ns(n.firstChild.content,e-1,t)))}function Bs(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Bs(n.lastChild.content,e-1,t)))}function sd(n,e){for(let t=0;t1&&(r=r.replaceChild(0,xw(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(ee.empty,!0)))),n.copy(r)}function ad(n,e,t,r,o){let i=n.node(e),s=o?n.indexAfter(e):n.index(e);if(s==i.childCount&&!t.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!GH(t,i.content,s)?a:null}function GH(n,e,t){for(let r=t;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=KH(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&&(n.replace(e,t,r),!(n.steps.length>d));p--){let f=s[p];f<0||(e=o.before(f),t=i.after(f))}}function ww(n,e,t,r,o){if(er){let i=o.contentMatchAt(0),s=i.fillBefore(n).append(n);n=s.append(i.matchFragment(s).fillBefore(ee.empty,!0))}return n}function YH(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let o=VH(n.doc,e,r.type);o!=null&&(e=t=o)}n.replaceRange(e,t,new se(ee.from(r),0,0))}function JH(n,e,t){let r=n.doc.resolve(e),o=n.doc.resolve(t),i=Cw(r,o);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return n.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&&t>r.end(s)&&o.end(s)-t!=o.depth-s)return n.delete(r.before(s),t);n.delete(e,t)}function Cw(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let o=r;o>=0;o--){let i=n.start(o);if(ie.pos+(e.depth-o)||n.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==n.depth&&o==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&t.push(o)}return t}let Sw=class Ll extends hn{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return bn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let o=t.type.create(r,null,t.marks);return bn.fromReplace(e,this.pos,this.pos+1,new se(ee.from(o),0,t.isLeaf?0:1))}getMap(){return qo.empty}invert(e){return new Ll(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ll(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ll(t.pos,t.attr,t.value)}};hn.jsonID("attr",Sw);let kw=class wp extends hn{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let o in e.attrs)t[o]=e.attrs[o];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return bn.ok(r)}getMap(){return qo.empty}invert(e){return new wp(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new wp(t.attr,t.value)}};hn.jsonID("docAttr",kw);let ns=class extends Error{};ns=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};ns.prototype=Object.create(Error.prototype);ns.prototype.constructor=ns;ns.prototype.name="TransformError";let ZH=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new gw}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new ns(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=se.empty){let o=UH(this.doc,e,t,r);return o&&this.step(o),this}replaceWith(e,t,r){return this.replace(e,t,new se(ee.from(r),0,0))}delete(e,t){return this.replace(e,t,se.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return qH(this,e,t,r),this}replaceRangeWith(e,t,r){return YH(this,e,t,r),this}deleteRange(e,t){return JH(this,e,t),this}lift(e,t){return OH(this,e,t),this}join(e,t=1){return HH(this,e,t),this}wrap(e,t){return DH(this,e,t),this}setBlockType(e,t=e,r,o=null){return RH(this,e,t,r,o),this}setNodeMarkup(e,t,r=null,o){return BH(this,e,t,r,o),this}setNodeAttribute(e,t,r){return this.step(new Sw(e,t,r)),this}setDocAttribute(e,t){return this.step(new kw(e,t)),this}addNodeMark(e,t){return this.step(new kh(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ht)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Mh(e,t)),this}split(e,t=1,r){return jH(this,e,t,r),this}addMark(e,t,r){return kH(this,e,t,r),this}removeMark(e,t,r){return MH(this,e,t,r),this}clearIncompatible(e,t,r){return vw(this,e,t,r),this}};const ld=Object.create(null);class Ze{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new XH(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;i--){let s=t<0?Fi(e.node(0),e.node(i),e.before(i+1),e.index(i),t,r):Fi(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new hr(e.node(0))}static atStart(e){return Fi(e,e,0,0,1)||new hr(e)}static atEnd(e){return Fi(e,e,e.content.size,e.childCount,-1)||new hr(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ld[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in ld)throw new RangeError("Duplicate use of selection JSON ID "+e);return ld[e]=t,t.prototype.jsonID=e,t}getBookmark(){return qe.between(this.$anchor,this.$head).getBookmark()}}Ze.prototype.visible=!0;class XH{constructor(e,t){this.$from=e,this.$to=t}}let I0=!1;function $0(n){!I0&&!n.parent.inlineContent&&(I0=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class qe extends Ze{constructor(e,t=e){$0(e),$0(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return Ze.near(r);let o=e.resolve(t.map(this.anchor));return new qe(o.parent.inlineContent?o:r,r)}replace(e,t=se.empty){if(super.replace(e,t),t==se.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof qe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new hu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new qe(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let o=e.resolve(t);return new this(o,r==t?o:e.resolve(r))}static between(e,t,r){let o=e.pos-t.pos;if((!r||o)&&(r=o>=0?1:-1),!t.parent.inlineContent){let i=Ze.findFrom(t,r,!0)||Ze.findFrom(t,-r,!0);if(i)t=i.$head;else return Ze.near(t,r)}return e.parent.inlineContent||(o==0?e=t:(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(n,t-(o<0?a.nodeSize:0))}else{let l=Fi(n,a,t+o,o<0?a.childCount:0,o,i);if(l)return l}t+=a.nodeSize*o}return null}function N0(n,e,t){let r=n.steps.length-1;if(r{s==null&&(s=u)}),n.setSelection(Ze.near(n.doc.resolve(s),t))}const B0=1,fl=2,F0=4;class e8 extends ZH{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|=fl,this}ensureMarks(e){return ht.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&fl)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~fl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ht.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let o=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(t);i=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,o.text(e,i)),this.selection.empty||this.setSelection(Ze.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=F0,this}get scrolledIntoView(){return(this.updated&F0)>0}}function j0(n,e){return!e||!n?n:n.bind(e)}class Fs{constructor(e,t,r){this.name=e,this.init=j0(t.init,r),this.apply=j0(t.apply,r)}}const t8=[new Fs("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Fs("selection",{init(n,e){return n.selection||Ze.atStart(e.doc)},apply(n){return n.selection}}),new Fs("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Fs("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class cd{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=t8.slice(),t&&t.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 Fs(r.key,r.spec.state,r))})}}class Ki{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let 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&&(t[r]=i.toJSON.call(o,this[o.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new cd(e.schema,e.plugins),i=new Ki(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Ho.fromJSON(e.schema,t.doc);else if(s.name=="selection")i.selection=Ze.fromJSON(i.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(i.storedMarks=t.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(t,a)){i[s.name]=c.fromJSON.call(l,e,t[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function Mw(n,e,t){for(let r in n){let o=n[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=Mw(o,e,{})),t[r]=o}return t}class mn{constructor(e){this.spec=e,this.props={},e.props&&Mw(e.props,this,this.props),this.key=e.key?e.key.key:Ew("plugin")}getState(e){return e[this.key]}}const ud=Object.create(null);function Ew(n){return n in ud?n+"$"+ ++ud[n]:(ud[n]=0,n+"$")}class Un{constructor(e="key"){this.key=Ew(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const sn=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},pa=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Cp=null;const Br=function(n,e,t){let r=Cp||(Cp=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},n8=function(){Cp=null},Yo=function(n,e,t,r){return t&&(_0(n,e,t,r,-1)||_0(n,e,t,r,1))},r8=/^(img|br|input|textarea|hr)$/i;function _0(n,e,t,r,o){for(;;){if(n==t&&e==r)return!0;if(e==(o<0?0:or(n))){let i=n.parentNode;if(!i||i.nodeType!=1||Fa(n)||r8.test(n.nodeName)||n.contentEditable=="false")return!1;e=sn(n)+(o<0?0:1),n=i}else if(n.nodeType==1){if(n=n.childNodes[e+(o<0?-1:0)],n.contentEditable=="false")return!1;e=o<0?or(n):0}else return!1}}function or(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function o8(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=or(n)}else if(n.parentNode&&!Fa(n))e=sn(n),n=n.parentNode;else return null}}function i8(n,e){for(;;){if(n.nodeType==3&&e2),tr=rs||(Tr?/Mac/.test(Tr.platform):!1),c8=Tr?/Win/.test(Tr.platform):!1,cr=/Android \d/.test(Co),ja=!!z0&&"webkitFontSmoothing"in z0.documentElement.style,u8=ja?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function d8(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function $r(n,e){return typeof n=="number"?n:n[e]}function p8(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function H0(n,e,t){let r=n.someProp("scrollThreshold")||0,o=n.someProp("scrollMargin")||5,i=n.dom.ownerDocument;for(let s=t||n.dom;s;s=pa(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?d8(i):p8(a),u=0,d=0;if(e.topc.bottom-$r(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+$r(o,"top")-c.top:e.bottom-c.bottom+$r(o,"bottom")),e.leftc.right-$r(r,"right")&&(u=e.right-c.right+$r(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 f8(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=t+1;s=t-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:Lw(n.dom)}}function Lw(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=pa(r));return e}function h8({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Aw(t,r==0?0:r-e)}function Aw(n,e){for(let t=0;t=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});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=d+1)}}return!t&&l&&(t=l,o=c,r=0),t&&t.nodeType==3?g8(t,o):!t||r&&t.nodeType==1?{node:n,offset:i}:Pw(t,o)}function g8(n,e){let t=n.nodeValue.length,r=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:n,offset:0}}function Th(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function v8(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,o,i)}function b8(n,e,t,r){let o=-1;for(let i=e,s=!1;i!=n.dom;){let a=n.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:n.docView.posFromDOM(e,t,-1)}function Dw(n,e,t){let r=n.childNodes.length;if(r&&t.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==n.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=n.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=b8(n,r,o,e))}a==null&&(a=y8(n,s,e));let l=n.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function V0(n){return n.top=0&&o==r.nodeValue.length?(l--,u=1):t<0?l--:c++,Es(Qr(Br(r,l,c),u),u<0)}if(!n.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(t<0||o==or(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return dd(l.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(t<0||o==or(r))){let l=r.childNodes[o-1],c=l.nodeType==3?Br(l,or(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Es(Qr(c,1),!1)}if(i==null&&o=0)}function Es(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function dd(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Iw(n,e,t){let r=n.state,o=n.root.activeElement;r!=e&&n.updateState(e),o!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),o!=n.dom&&o&&o.focus()}}function C8(n,e,t){let r=e.selection,o=t=="up"?r.$from:r.$to;return Iw(n,e,()=>{let{node:i}=n.docView.domFromPos(o.pos,t=="up"?-1:1);for(;;){let a=n.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=Rw(n,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=Br(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const S8=/[\u0590-\u08ac]/;function k8(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=n.domSelection();return a?!S8.test(r.parent.textContent)||!a.modify?t=="left"||t=="backward"?i:s:Iw(n,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",t,"character");let f=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:g}=n.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 U0=null,W0=null,G0=!1;function M8(n,e,t){return U0==e&&W0==t?G0:(U0=e,W0=t,G0=t=="up"||t=="down"?C8(n,e,t):k8(n,e,t))}const ir=0,K0=1,Io=2,Or=3;class _a{constructor(e,t,r,o){this.parent=e,this.children=t,this.dom=r,this.contentDOM=o,this.dirty=ir,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tsn(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(t==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&t==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,t=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!t||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 t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||s instanceof Nw){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof $w&&i.side>=0;r--);if(t<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&t&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,t):{node:this.contentDOM,offset:i?sn(i.dom)+1:0}}else{let i,s=!0;for(;i=r=u&&t<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,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=sn(p.dom)+1;break}e-=p.size}o==-1&&(o=0)}if(o>-1&&(c>t||a==this.children.length-1)){t=c;for(let u=a+1;uf&&st){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,t){for(let r=0,o=0;o=r:er){let a=r+i.border,l=s-i.border;if(e>=a&&t<=l){this.dirty=e==r||t==s?Io:K0,e==a&&t==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Or:i.markDirty(e-a,t-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Io:Or}r=s}this.dirty=Io}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Io:K0;t.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!t.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=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==ir&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class E8 extends _a{constructor(e,t,r,o){super(e,[],t,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Jo extends _a{constructor(e,t,r,o){super(e,[],r,o),this.mark=t}static create(e,t,r,o){let i=o.nodeViews[t.type.name],s=i&&i(t,o,r);return(!s||!s.dom)&&(s=li.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new Jo(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Or||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Or&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=ir){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=Tp(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(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=li.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let p=u;return u=jw(u,r,t),c?l=new T8(e,t,r,o,u,d||null,p,c,i,s+1):t.isText?new gu(e,t,r,o,u,p,i):new po(e,t,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 t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ee.empty)}return e}matchesNode(e,t,r){return this.dirty==ir&&e.eq(this.node)&&lc(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new L8(this,s&&s.node,e);D8(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?ht.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==Io)&&(s&&this.protectLocalComposition(e,s),Bw(this.contentDOM,this.children,e),rs&&R8(this.dom))}localCompositionInfo(e,t){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof qe)||rt+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=I8(this.node.content,s,r-t,o-t);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:o}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new E8(this,i,t,o);e.input.compositionNodes.push(s),this.children=Tp(this.children,r,r+o.length,e,s)}update(e,t,r,o){return this.dirty==Or||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,o),!0)}updateInner(e,t,r,o){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=ir}updateOuterDeco(e){if(lc(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Fw(this.dom,this.nodeDOM,Ep(this.outerDeco,this.node,t),Ep(e,this.node,t)),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 q0(n,e,t,r,o){jw(r,e,n);let i=new po(void 0,n,e,t,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class gu extends po{constructor(e,t,r,o,i,s,a){super(e,t,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,t,r,o){return this.dirty==Or||this.dirty!=ir&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=ir||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=ir,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let o=this.node.cut(e,t),i=document.createTextNode(o.text);return new gu(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Or)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Nw extends _a{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ir&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class T8 extends po{constructor(e,t,r,o,i,s,a,l,c,u){super(e,t,r,o,i,s,a,c,u),this.spec=l}update(e,t,r,o){if(this.dirty==Or)return!1;if(this.spec.update){let i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,o){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,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 Bw(n,e,t){let r=n.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=Jo.create(this.top,e[i],t,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,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,t,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=t.children[r-1];if(c instanceof Jo)t=c,r=c.children.length;else{a=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let l=a.node;if(l){if(l!=n.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function P8(n,e){return n.type.side-e.type.side}function D8(n,e,t,r){let o=e.locals(n),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 R8(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function I8(n,e,t,r){for(let o=0,i=0;o=t){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a=0&&c+e.length+a>=t)return a+c;if(t==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Tp(n,e,t,r,o){let i=[];for(let s=0,a=0;s=t||u<=e?i.push(l):(ct&&i.push(l.slice(t-c,l.size,r)))}return i}function Oh(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let o=n.docView.nearestDesc(t.focusNode),i=o&&o.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(mu(t)){for(l=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&Ve.isSelectable(d)&&o.parent&&!(d.isInline&&s8(t.focusNode,t.focusOffset,o.dom))){let p=o.posBefore;c=new Ve(s==p?a:r.resolve(p))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=s,p=s;for(let f=0;f{(t.anchorNode!=r||t.anchorOffset!=o)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!_w(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function N8(n){let e=n.domSelection(),t=document.createRange();if(!e)return;let r=n.cursorWrapper.dom,o=r.nodeName=="IMG";o?t.setStart(r.parentNode,sn(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!o&&!n.state.selection.visible&&On&&uo<=11&&(r.disabled=!0,r.disabled=!1)}function zw(n,e){if(e instanceof Ve){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Q0(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Q0(n)}function Q0(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Lh(n,e,t,r){return n.someProp("createSelectionBetween",o=>o(n,e,t))||qe.between(e,t,r)}function ey(n){return n.editable&&!n.hasFocus()?!1:Hw(n)}function Hw(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function B8(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Yo(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Op(n,e){let{$anchor:t,$head:r}=n.selection,o=e>0?t.max(r):t.min(r),i=o.parent.inlineContent?o.depth?n.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Ze.findFrom(i,e)}function no(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function ty(n,e,t){let r=n.state.selection;if(r instanceof qe)if(t.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=n.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return no(n,new qe(r.$anchor,s))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let o=Op(n.state,e);return o&&o instanceof Ve?no(n,o):!1}else if(!(tr&&t.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=n.docView.descAt(a))&&!s.contentDOM?Ve.isSelectable(i)?no(n,new Ve(e<0?n.state.doc.resolve(o.pos-i.nodeSize):o)):ja?no(n,new qe(n.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ve&&r.node.isInline)return no(n,new qe(e>0?r.$to:r.$from));{let o=Op(n.state,e);return o?no(n,o):!1}}}function cc(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ea(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function vi(n,e){return e<0?F8(n):j8(n)}function F8(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let o,i,s=!1;for(mr&&t.nodeType==1&&r0){if(t.nodeType!=1)break;{let a=t.childNodes[r-1];if(ea(a,-1))o=t,i=--r;else if(a.nodeType==3)t=a,r=t.nodeValue.length;else break}}else{if(Vw(t))break;{let a=t.previousSibling;for(;a&&ea(a,-1);)o=t.parentNode,i=sn(a),a=a.previousSibling;if(a)t=a,r=cc(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?Lp(n,t,r):o&&Lp(n,o,i)}function j8(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let o=cc(t),i,s;for(;;)if(r{n.state==o&&jr(n)},50)}function ny(n,e){let t=n.state.doc.resolve(e);if(!(fn||c8)&&t.parent.inlineContent){let o=n.coordsAtPos(e);if(e>t.start()){let i=n.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(n.dom).direction=="rtl"?"rtl":"ltr"}function ry(n,e,t){let r=n.state.selection;if(r instanceof qe&&!r.empty||t.indexOf("s")>-1||tr&&t.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=Op(n.state,e);if(s&&s instanceof Ve)return no(n,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof hr?Ze.near(s,e):Ze.findFrom(s,e);return a?no(n,a):!1}return!1}function oy(n,e){if(!(n.state.selection instanceof qe))return!0;let{$head:t,$anchor:r,empty:o}=n.state.selection;if(!t.sameParent(r))return!0;if(!o)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(i&&!i.isText){let s=n.state.tr;return e<0?s.delete(t.pos-i.nodeSize,t.pos):s.delete(t.pos,t.pos+i.nodeSize),n.dispatch(s),!0}return!1}function iy(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function H8(n){if(!wn||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;iy(n,r,"true"),setTimeout(()=>iy(n,r,"false"),20)}return!1}function V8(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function U8(n,e){let t=e.keyCode,r=V8(e);if(t==8||tr&&t==72&&r=="c")return oy(n,-1)||vi(n,-1);if(t==46&&!e.shiftKey||tr&&t==68&&r=="c")return oy(n,1)||vi(n,1);if(t==13||t==27)return!0;if(t==37||tr&&t==66&&r=="c"){let o=t==37?ny(n,n.state.selection.from)=="ltr"?-1:1:-1;return ty(n,o,r)||vi(n,o)}else if(t==39||tr&&t==70&&r=="c"){let o=t==39?ny(n,n.state.selection.from)=="ltr"?1:-1:1;return ty(n,o,r)||vi(n,o)}else{if(t==38||tr&&t==80&&r=="c")return ry(n,-1,r)||vi(n,-1);if(t==40||tr&&t==78&&r=="c")return H8(n)||ry(n,1,r)||vi(n,1);if(r==(tr?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Uw(n,e){n.someProp("transformCopied",f=>{e=f(e,n)});let t=[],{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;t.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let s=n.someProp("clipboardSerializer")||li.fromSchema(n.state.schema),a=Jw(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Yw[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(t)}`);let p=n.someProp("clipboardTextSerializer",f=>f(e,n))||e.content.textBetween(0,e.content.size,` + +`);return{dom:l,text:p,slice:e}}function Ww(n,e,t,r,o){let i=o.parent.type.spec.code,s,a;if(!t&&!e)return null;let l=e&&(r||i||!t);if(l){if(n.someProp("transformPastedText",p=>{e=p(e,i||r,n)}),i)return e?new se(ee.from(n.state.schema.text(e.replace(/\r\n?/g,` +`))),0,0):se.empty;let d=n.someProp("clipboardTextParser",p=>p(e,o,r,n));if(d)a=d;else{let p=o.marks(),{schema:f}=n.state,m=li.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 n.someProp("transformPastedHTML",d=>{t=d(t,n)}),s=q8(t),ja&&Y8(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=(n.someProp("clipboardParser")||n.someProp("domParser")||Zs.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!W8.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)a=J8(sy(a,+u[1],+u[2]),u[4]);else if(a=se.maxOpen(G8(a.content,o),!0),a.openStart||a.openEnd){let d=0,p=0;for(let f=a.content.firstChild;d{a=d(a,n)}),a}const W8=/^(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 G8(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let o=e.node(t).contentMatchAt(e.index(t)),i,s=[];if(n.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&Kw(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=qw(s[s.length-1],i.length));let u=Gw(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return ee.from(s)}return n}function Gw(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,ee.from(n));return n}function Kw(n,e,t,r,o){if(o1&&(i=0),o=t&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(ee.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(a))}function sy(n,e,t){return et}).createHTML(n):n}function q8(n){let e=/^(\s*]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Jw().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),o;if((o=r&&Yw[r[1].toLowerCase()])&&(n=o.map(i=>"<"+i+">").join("")+n+o.map(i=>"").reverse().join("")),t.innerHTML=K8(n),o)for(let i=0;i=0;a-=2){let l=t.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=ee.from(l.create(r[a+1],o)),i++,s++}return new se(o,i,s)}const Cn={},Sn={},Z8={touchstart:!0,touchmove:!0};class X8{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 Q8(n){for(let e in Cn){let t=Cn[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{t9(n,r)&&!Ah(n,r)&&(n.editable||!(r.type in Sn))&&t(n,r)},Z8[e]?{passive:!0}:void 0)}wn&&n.dom.addEventListener("input",()=>null),Pp(n)}function ao(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function e9(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Pp(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Ah(n,r))})}function Ah(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function t9(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function n9(n,e){!Ah(n,e)&&Cn[e.type]&&(n.editable||!(e.type in Sn))&&Cn[e.type](n,e)}Sn.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Xw(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(cr&&fn&&t.keyCode==13)))if(n.domObserver.selectionChanged(n.domSelectionRange())?n.domObserver.flush():t.keyCode!=229&&n.domObserver.forceFlush(),rs&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",o=>o(n,Po(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||U8(n,t)?t.preventDefault():ao(n,"key")};Sn.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Sn.keypress=(n,e)=>{let t=e;if(Xw(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||tr&&t.metaKey)return;if(n.someProp("handleKeyPress",o=>o(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof qe)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(t.charCode);!/[\r\n]/.test(o)&&!n.someProp("handleTextInput",i=>i(n,r.$from.pos,r.$to.pos,o))&&n.dispatch(n.state.tr.insertText(o).scrollIntoView()),t.preventDefault()}};function vu(n){return{left:n.clientX,top:n.clientY}}function r9(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Ph(n,e,t,r,o){if(r==-1)return!1;let i=n.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(n.someProp(e,a=>s>i.depth?a(n,t,i.nodeAfter,i.before(s),o,!0):a(n,t,i.node(s),i.before(s),o,!1)))return!0;return!1}function Zi(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function o9(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Ve.isSelectable(r)?(Zi(n,new Ve(t)),!0):!1}function i9(n,e){if(e==-1)return!1;let t=n.state.selection,r,o;t instanceof Ve&&(r=t.node);let i=n.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&&t.$from.depth>0&&s>=t.$from.depth&&i.before(t.$from.depth+1)==t.$from.pos?o=i.before(t.$from.depth):o=i.before(s);break}}return o!=null?(Zi(n,Ve.create(n.state.doc,o)),!0):!1}function s9(n,e,t,r,o){return Ph(n,"handleClickOn",e,t,r)||n.someProp("handleClick",i=>i(n,e,r))||(o?i9(n,t):o9(n,t))}function a9(n,e,t,r){return Ph(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",o=>o(n,e,r))}function l9(n,e,t,r){return Ph(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",o=>o(n,e,r))||c9(n,t,r)}function c9(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Zi(n,qe.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)Zi(n,qe.create(r,a+1,a+1+s.content.size));else if(Ve.isSelectable(s))Zi(n,Ve.create(r,a));else continue;return!0}}function Dh(n){return uc(n)}const Zw=tr?"metaKey":"ctrlKey";Cn.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Dh(n),o=Date.now(),i="singleClick";o-n.input.lastClick.time<500&&r9(t,n.input.lastClick)&&!t[Zw]&&(n.input.lastClick.type=="singleClick"?i="doubleClick":n.input.lastClick.type=="doubleClick"&&(i="tripleClick")),n.input.lastClick={time:o,x:t.clientX,y:t.clientY,type:i};let s=n.posAtCoords(vu(t));s&&(i=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new u9(n,s,t,!!r)):(i=="doubleClick"?a9:l9)(n,s.pos,s.inside,t)?t.preventDefault():ao(n,"pointer"))};class u9{constructor(e,t,r,o){this.view=e,this.pos=t,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Zw],this.allowDefault=r.shiftKey;let i,s;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.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&&mr&&!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)),ao(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(()=>jr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(vu(e))),this.updateAllowDefault(e),this.allowDefault||!t?ao(this.view,"pointer"):s9(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||wn&&this.mightDrag&&!this.mightDrag.node.isAtom||fn&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Zi(this.view,Ze.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):ao(this.view,"pointer")}move(e){this.updateAllowDefault(e),ao(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)}}Cn.touchstart=n=>{n.input.lastTouch=Date.now(),Dh(n),ao(n,"pointer")};Cn.touchmove=n=>{n.input.lastTouch=Date.now(),ao(n,"pointer")};Cn.contextmenu=n=>Dh(n);function Xw(n,e){return n.composing?!0:wn&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const d9=cr?5e3:-1;Sn.compositionstart=Sn.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof qe&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),uc(n,!0),n.markCursor=null;else if(uc(n,!e.selection.empty),mr&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.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=n.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}n.input.composing=!0}Qw(n,d9)};Sn.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Qw(n,20))};function Qw(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>uc(n),e))}function eC(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=f9());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function p9(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=o8(e.focusNode,e.focusOffset),r=i8(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let o=r.pmViewDesc,i=n.domObserver.lastChangedTextNode;if(t==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let s=t.pmViewDesc;if(!(!s||!s.isText(t.nodeValue)))return r}}return t||r}function f9(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function uc(n,e=!1){if(!(cr&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),eC(n),e||n.docView&&n.docView.dirty){let t=Oh(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!n.state.selection.empty?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function h9(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const fa=On&&uo<15||rs&&u8<604;Cn.copy=Sn.cut=(n,e)=>{let t=e,r=n.state.selection,o=t.type=="cut";if(r.empty)return;let i=fa?null:t.clipboardData,s=r.content(),{dom:a,text:l}=Uw(n,s);i?(t.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):h9(n,a),o&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function m9(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function g9(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?ha(n,r.value,null,o,e):ha(n,r.textContent,r.innerHTML,o,e)},50)}function ha(n,e,t,r,o){let i=Ww(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",l=>l(n,o,i||se.empty)))return!0;if(!i)return!1;let s=m9(i),a=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(i);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function tC(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Sn.paste=(n,e)=>{let t=e;if(n.composing&&!cr)return;let r=fa?null:t.clipboardData,o=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&ha(n,tC(r),r.getData("text/html"),o,t)?t.preventDefault():g9(n,t)};class nC{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const rC=tr?"altKey":"ctrlKey";Cn.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let o=n.state.selection,i=o.empty?null:n.posAtCoords(vu(t)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof Ve?o.to-1:o.to))){if(r&&r.mightDrag)s=Ve.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&(s=Ve.create(n.state.doc,d.posBefore))}}let a=(s||n.state.selection).content(),{dom:l,text:c,slice:u}=Uw(n,a);(!t.dataTransfer.files.length||!fn||Ow>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(fa?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",fa||t.dataTransfer.setData("text/plain",c),n.dragging=new nC(u,!t[rC],s)};Cn.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Sn.dragover=Sn.dragenter=(n,e)=>e.preventDefault();Sn.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let o=n.posAtCoords(vu(t));if(!o)return;let i=n.state.doc.resolve(o.pos),s=r&&r.slice;s?n.someProp("transformPasted",m=>{s=m(s,n)}):s=Ww(n,tC(t.dataTransfer),fa?null:t.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!t[rC]);if(n.someProp("handleDrop",m=>m(n,t,s||se.empty,a))){t.preventDefault();return}if(!s)return;t.preventDefault();let l=s?yw(n.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=n.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,w)=>m=w),c.setSelection(Lh(n,f,c.doc.resolve(m)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))};Cn.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&jr(n)},20))};Cn.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Cn.beforeinput=(n,e)=>{if(fn&&cr&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,Po(8,"Backspace")))))return;let{$cursor:o}=n.state.selection;o&&o.pos>0&&n.dispatch(n.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let n in Sn)Cn[n]=Sn[n];function ma(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class dc{constructor(e,t){this.toDOM=e,this.spec=t||Vo,this.side=this.spec.side||0}map(e,t,r,o){let{pos:i,deleted:s}=e.mapResult(t.from+o,this.side<0?-1:1);return s?null:new fr(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof dc&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ma(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class fo{constructor(e,t){this.attrs=e,this.spec=t||Vo}map(e,t,r,o){let i=e.map(t.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new fr(i,s,this)}valid(e,t){return t.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,t-a,r,o+a,i)}}map(e,t,r){return this==pn||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Vo)}mapInner(e,t,r,o,i){let s;for(let a=0;a{let c=l+r,u;if(u=iC(t,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+t.content.size;for(let a=0;ai&&l.type instanceof fo){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;co.map(e,t,Vo));return io.from(r)}forChild(e,t){if(t.isLeaf)return Qt.empty;let r=[];for(let o=0;ot instanceof Qt)?e:e.reduce((t,r)=>t.concat(r instanceof Qt?r:r.members),[]))}}forEachSet(e){for(let t=0;t{let y=g-m-(f-p);for(let b=0;bw+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=t.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let p=t.map(n[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(t,y,u+1,n[c]+i+1,s);b!=pn?(a[c]=d,a[c+1]=f,a[c+2]=b):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=y9(a,n,e,t,o,i,s),u=pc(c,r,0,s);e=u.local;for(let d=0;dt&&s.to{let c=iC(n,a,l+t);if(c){i=!0;let u=pc(c,a,t+l+1,r);u!=pn&&o.push(l,l+a.nodeSize,u)}});let s=oC(i?sC(n):n,-t).sort(Uo);for(let a=0;a0;)e++;n.splice(e,0,t)}function fd(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=pn&&e.push(r)}),n.cursorWrapper&&e.push(Qt.create(n.state.doc,[n.cursorWrapper.deco])),io.from(e)}const b9={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},x9=On&&uo<=11;class w9{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 C9{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new w9,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()}),x9&&(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,b9)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ey(this.view)){if(this.suppressingSelectionUpdates)return jr(this.view);if(On&&uo<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Yo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let i=e.focusNode;i;i=pa(i))t.add(i);for(let i=e.anchorNode;i;i=pa(i))if(t.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)&&ey(this.view)&&!this.ignoreSelectionChange(e)}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.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||M9(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),S9(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||jr(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.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],w=b.pmViewDesc;if(b.nodeName=="BR"&&!w){i=y;break}if(!w||w.size)break}let d=n.state.doc,p=n.someProp("domParser")||Zs.fromSchema(n.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:T9,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 T9(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(wn&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||wn&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const O9=/^(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 L9(n,e,t,r,o){let i=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let P=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,O=Oh(n,P);if(O&&!n.state.selection.eq(O)){if(fn&&cr&&n.input.lastKeyCode===13&&Date.now()-100D(n,Po(13,"Enter"))))return;let F=n.state.tr.setSelection(O);P=="pointer"?F.setMeta("pointer",!0):P=="key"&&F.scrollIntoView(),i&&F.setMeta("composition",i),n.dispatch(F)}return}let s=n.state.doc.resolve(e),a=s.sharedDepth(t);e=s.before(a+1),t=n.state.doc.resolve(t).after(a+1);let l=n.state.selection,c=E9(n,e,t),u=n.state.doc,d=u.slice(c.from,c.to),p,f;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||cr)&&o.some(P=>P.nodeType==1&&!O9.test(P.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",P=>P(n,Po(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof qe&&!l.empty&&l.$head.sameParent(l.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let P=py(n,n.state.doc,c.sel);if(P&&!P.eq(n.state.selection)){let O=n.state.tr.setSelection(P);i&&O.setMeta("composition",i),n.dispatch(O)}}return}n.state.selection.fromn.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?m.start=n.state.selection.from:m.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),On&&uo<=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),w=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=m.endA,S;if((rs&&n.input.lastIOSEnter>Date.now()-225&&(!w||o.some(P=>P.nodeName=="DIV"||P.nodeName=="P"))||!w&&g.posP(n,Po(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&P9(u,m.start,m.endA,g,y)&&n.someProp("handleKeyDown",P=>P(n,Po(8,"Backspace")))){cr&&fn&&n.domObserver.suppressSelectionUpdates();return}fn&&cr&&m.endB==m.start&&(n.input.lastAndroidDelete=Date.now()),cr&&!w&&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(()=>{n.someProp("handleKeyDown",function(P){return P(n,Po(13,"Enter"))})},20));let T=m.start,k=m.endA,x,C,E;if(w){if(g.pos==y.pos)On&&uo<=11&&g.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>jr(n),20)),x=n.state.tr.delete(T,k),C=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(E=A9(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start()))))x=n.state.tr,E.type=="add"?x.addMark(T,k,E.mark):x.removeMark(T,k,E.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let P=g.parent.textBetween(g.parentOffset,y.parentOffset);if(n.someProp("handleTextInput",O=>O(n,T,k,P)))return;x=n.state.tr.insertText(P,T,k)}}if(x||(x=n.state.tr.replace(T,k,c.doc.slice(m.start-c.from,m.endB-c.from))),c.sel){let P=py(n,x.doc,c.sel);P&&!(fn&&cr&&n.composing&&P.empty&&(m.start!=m.endB||n.input.lastAndroidDeletee.content.size?null:Lh(n,e.resolve(t.anchor),e.resolve(t.head))}function A9(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,o=t,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;ut||hd(s,!0,!1)0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,o++,e=!1;if(t){let i=n.node(r).maybeChild(n.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function D9(n,e,t,r,o){let i=n.findDiffStart(e,t);if(i==null)return null;let{a:s,b:a}=n.findDiffEnd(e,t+n.size,t+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&&t>=55296&&t<=56319}class R9{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new X8,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(yy),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=gy(this),my(this),this.nodeViews=vy(this),this.docView=q0(this.state.doc,hy(this),fd(this),this.dom,this),this.domObserver=new C9(this,(r,o,i,s)=>L9(this,r,o,i,s)),this.domObserver.start(),Q8(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Pp(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(yy),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(eC(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let f=vy(this);$9(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Pp(this),this.editable=gy(this),my(this);let l=fd(this),c=hy(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&&f8(this);if(s){this.domObserver.stop();let f=d&&(On||fn)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&I9(o.selection,e.selection);if(d){let m=fn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=p9(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=q0(e.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&B8(this))?jr(this,f):(zw(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&&h8(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof Ve){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&H0(this,t.getBoundingClientRect(),e)}else H0(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 t=0;t0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new nC(e.slice,e.move,o<0?void 0:Ve.create(this.state.doc,o))}someProp(e,t){let r=this._props&&this._props[e],o;if(r!=null&&(o=t?t(r):r))return o;for(let s=0;st.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return x8(this,e)}coordsAtPos(e,t=1){return Rw(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let o=this.docView.posFromDOM(e,t,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,t){return M8(this,t||this.state,e)}pasteHTML(e,t){return ha(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ha(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(e9(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],fd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,n8())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return n9(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?wn&&this.root.nodeType===11&&a8(this.dom.ownerDocument)==this.dom&&k9(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function hy(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[fr.node(0,n.state.doc.content.size,e)]}function my(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:fr.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function gy(n){return!n.someProp("editable",e=>e(n.state)===!1)}function I9(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function vy(n){let e=Object.create(null);function t(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function $9(n,e){let t=0,r=0;for(let o in n){if(n[o]!=e[o])return!0;t++}for(let o in e)r++;return t!=r}function yy(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var yo={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:"'"},fc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},N9=typeof navigator<"u"&&/Mac/.test(navigator.platform),B9=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var an=0;an<10;an++)yo[48+an]=yo[96+an]=String(an);for(var an=1;an<=24;an++)yo[an+111]="F"+an;for(var an=65;an<=90;an++)yo[an]=String.fromCharCode(an+32),fc[an]=String.fromCharCode(an);for(var md in yo)fc.hasOwnProperty(md)||(fc[md]=yo[md]);function F9(n){var e=N9&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||B9&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?fc:yo)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const j9=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function _9(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,o,i,s;for(let a=0;a127)&&(i=yo[r.keyCode])&&i!=o){let a=e[gd(i,r)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}const aC=65535,lC=Math.pow(2,16);function U9(n,e){return n+e*lC}function by(n){return n&aC}function W9(n){return(n-(n&aC))/lC}const cC=1,uC=2,Al=4,dC=8;let Dp=class{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&dC)>0}get deletedBefore(){return(this.delInfo&(cC|Al))>0}get deletedAfter(){return(this.delInfo&(uC|Al))>0}get deletedAcross(){return(this.delInfo&Al)>0}},Zo=class _i{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&_i.empty)return _i.empty}recover(e){let t=0,r=by(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:t:t,f=l+o+(p<0?0:u);if(r)return f;let m=e==(t<0?l:d)?null:U9(a/3,e-l),g=e==l?uC:e==d?cC:Al;return(t<0?e!=l:e!=d)&&(g|=dC),new Dp(f,g,m)}o+=u-c}return r?e+o:new Dp(e+o,0,null)}touches(e,t){let r=0,o=by(t),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 t=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o=0;t--){let o=e.getMirror(t);this.appendMap(e.maps[t].invert(),o!=null&&o>t?r-o-1:void 0)}}invert(){let e=new ta;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!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),t.openStart,t.openEnd);return xn.fromReplace(e,this.from,this.to,i)}invert(){return new za(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new _s(t.pos,r.pos,this.mark)}merge(e){return e instanceof _s&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new _s(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new _s(t.from,t.to,e.markFromJSON(t.mark))}};gn.jsonID("addMark",Nh);let za=class zs extends gn{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new se($h(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return xn.fromReplace(e,this.from,this.to,r)}invert(){return new Nh(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new zs(t.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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new zs(t.from,t.to,e.markFromJSON(t.mark))}};gn.jsonID("removeMark",za);let Bh=class Hs extends gn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return xn.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return xn.fromReplace(e,this.pos,this.pos+1,new se(ee.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let o=0;or.pos?null:new Pl(t.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Pl(t.from,t.to,t.gapFrom,t.gapTo,se.fromJSON(e,t.slice),t.insert,!!t.structure)}};gn.jsonID("replaceAround",ci);function Ip(n,e,t){let r=n.resolve(e),o=t-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 G9(n,e,t,r){let o=[],i=[],s,a;n.doc.nodesBetween(e,t,(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,t),m=r.addToSet(d);for(let g=0;gn.step(l)),i.forEach(l=>n.step(l))}function K9(n,e,t,r){let o=[],i=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Na){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,t);for(let u=0;un.step(new za(s.from,s.to,s.style)))}function jh(n,e,t,r=t.contentMatch,o=!0){let i=n.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)n.step(s[l])}function q9(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Y9(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let o=n.$from.node(r),i=n.$from.index(r),s=n.$to.indexAfter(r);if(rt;m--)g||r.index(m)>0?(g=!0,u=ee.from(r.node(m).copy(u)),d++):l--;let p=ee.empty,f=0;for(let m=i,g=!1;m>t;m--)g||o.after(m+1)=0;s--){if(r.size){let a=t[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=ee.from(t[s].type.create(t[s].attrs,r))}let o=e.start,i=e.end;n.step(new ci(o,i,o,i,new se(r,0,0),t.length,!0))}function tV(n,e,t,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&nV(n.doc,n.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&&fC(n,s,a,i),jh(n,n.mapping.slice(i).map(a,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(a,1),p=u.map(a+s.nodeSize,1);return n.step(new ci(d,p,d+1,p-1,new se(ee.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&pC(n,s,a,i),!1}})}function pC(n,e,t,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=n.mapping.slice(r).map(t+1+i+s.index);n.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function fC(n,e,t,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+i);n.replaceWith(s,s+1,e.type.schema.text(` +`))}})}function nV(n,e,t){let r=n.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,t)}function rV(n,e,t,r,o){let i=n.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let s=t.create(r,null,o||i.marks);if(i.isLeaf)return n.replaceWith(e,e+i.nodeSize,s);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new ci(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new se(ee.from(s),0,0),1,!0))}function Dl(n,e,t=1,r){let o=n.resolve(e),i=o.depth-t,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=t-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 oV(n,e,t=1,r){let o=n.doc.resolve(e),i=ee.empty,s=ee.empty;for(let a=o.depth,l=o.depth-t,c=t-1;a>l;a--,c--){i=ee.from(o.node(a).copy(i));let u=r&&r[c];s=ee.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}n.step(new Hr(e,e,new se(i.append(s),t,t),!0))}function _h(n,e){let t=n.resolve(e),r=t.index();return hC(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function iV(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.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&&hC(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=t<0?r.before(o):r.after(o)}}function sV(n,e,t){let r=null,{linebreakReplacement:o}=n.doc.type.schema,i=n.doc.resolve(e-t),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=n.steps.length;if(r===!1){let u=n.doc.resolve(e+t);fC(n,u.node(),u.before(),a)}s.inlineContent&&jh(n,e+t-1,s,i.node().contentMatchAt(i.index()),r==null);let l=n.mapping.slice(a),c=l.map(e-t);if(n.step(new Hr(c,l.map(e+t,-1),se.empty,!0)),r===!0){let u=n.doc.resolve(c);pC(n,u.node(),u.before(),n.steps.length)}return n}function aV(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))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,t))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,t))return r.after(o+1);if(i0;o--)this.placed=ee.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(),t=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 ci(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new Hr(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==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(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ee.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(t==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:t,openEnd:r}=this.unplaced,o=yd(e,t);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new se(e,t+1,Math.max(r,o.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=yd(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new se(Vs(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new se(Vs(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(d=y,u.push(vC(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=Us(this.placed,t,ee.from(u)),this.frontier[t].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 t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:o}=this.frontier[t],i=t=0;a--){let{match:l,type:c}=this.frontier[a],u=bd(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Us(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.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,t=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Us(this.placed,this.depth,ee.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ee.empty,!0);t.childCount&&(this.placed=Us(this.placed,this.frontier.length,t))}};function Vs(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Vs(n.firstChild.content,e-1,t)))}function Us(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Us(n.lastChild.content,e-1,t)))}function yd(n,e){for(let t=0;t1&&(r=r.replaceChild(0,vC(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(ee.empty,!0)))),n.copy(r)}function bd(n,e,t,r,o){let i=n.node(e),s=o?n.indexAfter(e):n.index(e);if(s==i.childCount&&!t.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!uV(t,i.content,s)?a:null}function uV(n,e,t){for(let r=t;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=dV(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&&(n.replace(e,t,r),!(n.steps.length>d));p--){let f=s[p];f<0||(e=o.before(f),t=i.after(f))}}function yC(n,e,t,r,o){if(er){let i=o.contentMatchAt(0),s=i.fillBefore(n).append(n);n=s.append(i.matchFragment(s).fillBefore(ee.empty,!0))}return n}function fV(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let o=aV(n.doc,e,r.type);o!=null&&(e=t=o)}n.replaceRange(e,t,new se(ee.from(r),0,0))}function hV(n,e,t){let r=n.doc.resolve(e),o=n.doc.resolve(t),i=bC(r,o);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return n.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&&t>r.end(s)&&o.end(s)-t!=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 n.delete(r.before(s),t);n.delete(e,t)}function bC(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let o=r;o>=0;o--){let i=n.start(o);if(ie.pos+(e.depth-o)||n.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==n.depth&&o==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&t.push(o)}return t}let xC=class Rl extends gn{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return xn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let o=t.type.create(r,null,t.marks);return xn.fromReplace(e,this.pos,this.pos+1,new se(ee.from(o),0,t.isLeaf?0:1))}getMap(){return Zo.empty}invert(e){return new Rl(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Rl(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Rl(t.pos,t.attr,t.value)}};gn.jsonID("attr",xC);let wC=class $p extends gn{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let o in e.attrs)t[o]=e.attrs[o];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return xn.ok(r)}getMap(){return Zo.empty}invert(e){return new $p(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new $p(t.attr,t.value)}};gn.jsonID("docAttr",wC);let is=class extends Error{};is=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};is.prototype=Object.create(Error.prototype);is.prototype.constructor=is;is.prototype.name="TransformError";class mV{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ta}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new is(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=se.empty){let o=lV(this.doc,e,t,r);return o&&this.step(o),this}replaceWith(e,t,r){return this.replace(e,t,new se(ee.from(r),0,0))}delete(e,t){return this.replace(e,t,se.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return pV(this,e,t,r),this}replaceRangeWith(e,t,r){return fV(this,e,t,r),this}deleteRange(e,t){return hV(this,e,t),this}lift(e,t){return J9(this,e,t),this}join(e,t=1){return sV(this,e,t),this}wrap(e,t){return eV(this,e,t),this}setBlockType(e,t=e,r,o=null){return tV(this,e,t,r,o),this}setNodeMarkup(e,t,r=null,o){return rV(this,e,t,r,o),this}setNodeAttribute(e,t,r){return this.step(new xC(e,t,r)),this}setDocAttribute(e,t){return this.step(new wC(e,t)),this}addNodeMark(e,t){return this.step(new Bh(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ht)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Fh(e,t)),this}split(e,t=1,r){return oV(this,e,t,r),this}addMark(e,t,r){return G9(this,e,t,r),this}removeMark(e,t,r){return K9(this,e,t,r),this}clearIncompatible(e,t,r){return jh(this,e,t,r),this}}const CC=65535,SC=Math.pow(2,16);function gV(n,e){return n+e*SC}function wy(n){return n&CC}function vV(n){return(n-(n&CC))/SC}const kC=1,MC=2,Il=4,EC=8;class Cy{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&EC)>0}get deletedBefore(){return(this.delInfo&(kC|Il))>0}get deletedAfter(){return(this.delInfo&(MC|Il))>0}get deletedAcross(){return(this.delInfo&Il)>0}}class zn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&zn.empty)return zn.empty}recover(e){let t=0,r=wy(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:t:t,f=l+o+(p<0?0:u);if(r)return f;let m=e==(t<0?l:d)?null:gV(a/3,e-l),g=e==l?MC:e==d?kC:Il;return(t<0?e!=l:e!=d)&&(g|=EC),new Cy(f,g,m)}o+=u-c}return r?e+o:new Cy(e+o,0,null)}touches(e,t){let r=0,o=wy(t),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 t=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),t.openStart,t.openEnd);return Ut.fromReplace(e,this.from,this.to,i)}invert(){return new Bo(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new No(t.pos,r.pos,this.mark)}merge(e){return e instanceof No&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new No(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new No(t.from,t.to,e.markFromJSON(t.mark))}}vn.jsonID("addMark",No);class Bo extends vn{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new se(zh(t.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),t.openStart,t.openEnd);return Ut.fromReplace(e,this.from,this.to,r)}invert(){return new No(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Bo(t.pos,r.pos,this.mark)}merge(e){return e instanceof Bo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Bo(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Bo(t.from,t.to,e.markFromJSON(t.mark))}}vn.jsonID("removeMark",Bo);class Fo extends vn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ut.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ut.fromReplace(e,this.pos,this.pos+1,new se(ee.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let o=0;or.pos?null:new ho(t.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ho(t.from,t.to,t.gapFrom,t.gapTo,se.fromJSON(e,t.slice),t.insert,!!t.structure)}}vn.jsonID("replaceAround",ho);function Np(n,e,t){let r=n.resolve(e),o=t-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 yV(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function yu(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let o=n.$from.node(r),i=n.$from.index(r),s=n.$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 bu(n,e){let t=n.resolve(e),r=t.index();return TC(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function SV(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.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&&TC(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=t<0?r.before(o):r.after(o)}}function Hh(n,e,t=e,r=se.empty){if(e==t&&!r.size)return null;let o=n.resolve(e),i=n.resolve(t);return kV(o,i,r)?new ur(e,t,r):new MV(o,i,r).fit()}function kV(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class MV{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=ee.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=ee.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(),t=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 ho(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new ur(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=wd(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(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ee.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(t==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:t,openEnd:r}=this.unplaced,o=wd(e,t);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new se(e,t+1,Math.max(r,o.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,o=wd(e,t);if(o.childCount<=1&&t>0){let i=e.size-t<=t+o.size;this.unplaced=new se(Ws(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new se(Ws(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:o,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(d=y,u.push(LC(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=Gs(this.placed,t,ee.from(u)),this.frontier[t].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 t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:o}=this.frontier[t],i=t=0;a--){let{match:l,type:c}=this.frontier[a],u=Cd(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Gs(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.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,t=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Gs(this.placed,this.depth,ee.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ee.empty,!0);t.childCount&&(this.placed=Gs(this.placed,this.frontier.length,t))}}function Ws(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ws(n.firstChild.content,e-1,t)))}function Gs(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Gs(n.lastChild.content,e-1,t)))}function wd(n,e){for(let t=0;t1&&(r=r.replaceChild(0,LC(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(ee.empty,!0)))),n.copy(r)}function Cd(n,e,t,r,o){let i=n.node(e),s=o?n.indexAfter(e):n.index(e);if(s==i.childCount&&!t.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!EV(t,i.content,s)?a:null}function EV(n,e,t){for(let r=t;rn.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function AC(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const OV=(n,e,t)=>{let r=AC(n,t);if(!r)return!1;let o=Vh(r);if(!o){let s=r.blockRange(),a=s&&yu(s);return a==null?!1:(e&&e(n.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(IC(n,o,e,-1))return!0;if(r.parent.content.size==0&&(ss(i,"end")||Ve.isSelectable(i)))for(let s=r.depth;;s--){let a=Hh(n.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(n.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},LV=(n,e,t)=>{let r=AC(n,t);if(!r)return!1;let o=Vh(r);return o?PC(n,o,e):!1},AV=(n,e,t)=>{let r=DC(n,t);if(!r)return!1;let o=Uh(r);return o?PC(n,o,e):!1};function PC(n,e,t){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=Hh(n.doc,i,l,se.empty);if(!c||c.from!=i||c instanceof ur&&c.slice.size>=l-i)return!1;if(t){let u=n.tr.step(c);u.setSelection(qe.create(u.doc,i)),t(u.scrollIntoView())}return!0}function ss(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const PV=(n,e,t)=>{let{$head:r,empty:o}=n.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;i=Vh(r)}let s=i&&i.nodeBefore;return!s||!Ve.isSelectable(s)?!1:(e&&e(n.tr.setSelection(Ve.create(n.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function Vh(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function DC(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let r=DC(n,t);if(!r)return!1;let o=Uh(r);if(!o)return!1;let i=o.nodeAfter;if(IC(n,o,e,1))return!0;if(r.parent.content.size==0&&(ss(i,"start")||Ve.isSelectable(i))){let s=Hh(n.doc,r.before(),r.after(),se.empty);if(s&&s.slice.size{let{$head:r,empty:o}=n.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,r=t instanceof Ve,o;if(r){if(t.node.isTextblock||!bu(n.doc,t.from))return!1;o=t.from}else if(o=OC(n.doc,t.from,-1),o==null)return!1;if(e){let i=n.tr.join(o);r&&i.setSelection(Ve.create(i.doc,o-n.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},$V=(n,e)=>{let t=n.selection,r;if(t instanceof Ve){if(t.node.isTextblock||!bu(n.doc,t.to))return!1;r=t.to}else if(r=OC(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},NV=(n,e)=>{let{$from:t,$to:r}=n.selection,o=t.blockRange(r),i=o&&yu(o);return i==null?!1:(e&&e(n.tr.lift(o,i).scrollIntoView()),!0)},BV=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(` +`).scrollIntoView()),!0)};function RC(n){for(let e=0;e{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let o=t.node(-1),i=t.indexAfter(-1),s=RC(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=t.after(),l=n.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Ze.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},jV=(n,e)=>{let t=n.selection,{$from:r,$to:o}=t;if(t instanceof hr||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=RC(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let i=t.before();if(CV(n.doc,i))return e&&e(n.tr.split(i).scrollIntoView()),!0}let r=t.blockRange(),o=r&&yu(r);return o==null?!1:(e&&e(n.tr.lift(r,o).scrollIntoView()),!0)},zV=(n,e)=>{let{$from:t,to:r}=n.selection,o,i=t.sharedDepth(r);return i==0?!1:(o=t.before(i),e&&e(n.tr.setSelection(Ve.create(n.doc,o))),!0)};function HV(n,e,t){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)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||bu(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function IC(n,e,t,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&HV(n,e,t))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(t){let f=e.pos+i.nodeSize,m=ee.empty;for(let b=s.length-1;b>=0;b--)m=ee.from(s[b].create(null,m));m=ee.from(o.copy(m));let g=n.tr.step(new ho(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&&bu(g.doc,y.pos)&&g.join(y.pos),t(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&&yu(d);if(p!=null&&p>=e.depth)return t&&t(n.tr.lift(d,p).scrollIntoView()),!0;if(c&&ss(i,"start",!0)&&ss(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(t){let b=ee.empty;for(let S=m.length-1;S>=0;S--)b=ee.from(m[S].copy(b));let w=n.tr.step(new ho(e.pos-m.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new se(b,m.length,0),0,!0));t(w.scrollIntoView())}return!0}}return!1}function $C(n){return function(e,t){let r=e.selection,o=n<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(t&&t(e.tr.setSelection(qe.create(e.doc,n<0?o.start(i):o.end(i)))),!0):!1}}const VV=$C(-1),UV=$C(1);function WV(n,e=null){return function(t,r){let{$from:o,$to:i}=t.selection,s=o.blockRange(i),a=s&&bV(s,n,e);return a?(r&&r(t.tr.wrap(s,a).scrollIntoView()),!0):!1}}function ky(n,e=null){return function(t,r){let o=!1;for(let i=0;i{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(n,e)))if(l.type==n)o=!0;else{let u=t.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,n)}})}if(!o)return!1;if(r){let i=t.tr;for(let s=0;s=2&&o.node(s.depth-1).type.compatibleContent(n)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=t.doc.resolve(s.start-2);l=new oc(u,u,s.depth),s.endIndex=0;u--)i=ee.from(t[u].type.create(t[u].attrs,i));n.step(new vr(e.start-(r?2:0),e.end,e.start,e.end,new se(i,0,0),t.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==n);return i?t?r.node(i.depth-1).type==n?YV(e,t,n,i):JV(e,t,i):!0:!1}}function YV(n,e,t,r){let o=n.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(t.start),s=i.nodeAfter;if(r.mapping.map(t.end)!=t.start+i.nodeAfter.nodeSize)return!1;let a=t.startIndex==0,l=t.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?ee.empty:ee.from(o))))return!1;let d=i.pos,p=d+s.nodeSize;return r.step(new vr(d-(a?1:0),p+(l?1:0),d+1,p-1,new se((a?ee.empty:ee.from(o.copy(ee.empty))).append(l?ee.empty:ee.from(o.copy(ee.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function ZV(n){return function(e,t){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==n);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!=n)return!1;if(t){let c=l.lastChild&&l.lastChild.type==a.type,u=ee.from(c?n.create():null),d=new se(ee.from(n.create(null,ee.from(a.type.create(null,u)))),c?3:1,0),p=i.start,f=i.end;t(e.tr.step(new vr(p-(c?3:1),f,p,f,d,1,!0)).scrollIntoView())}return!0}}function xu(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:o}=t,{storedMarks:i}=t;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=t.selection,o=t.doc,i=t.storedMarks,t}}}class wu{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:t,state:r}=this,{view:o}=t,{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,t=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],l=!!e,c=e||i.tr,u=()=>(!l&&t&&!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,t),b=f(...g)(y);return a.push(b),d}])),run:u};return d}createCan(e){const{rawCommands:t,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,t=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:e,editor:o,view:s,state:xu({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class XV{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(o=>o!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function Ie(n,e,t){return n.config[e]===void 0&&n.parent?Ie(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?Ie(n.parent,e,t):null}):n.config[e]}function Cu(n){const e=n.filter(o=>o.type==="extension"),t=n.filter(o=>o.type==="node"),r=n.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function NC(n){const e=[],{nodeExtensions:t,markExtensions:r}=Cu(n),o=[...t,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.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 nn(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function It(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).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 mc(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>It(t,r),{})}function BC(n){return typeof n=="function"}function Je(n,e=void 0,...t){return BC(n)?e?n.bind(e)(...t):n(...t):n}function QV(n={}){return Object.keys(n).length===0&&n.constructor===Object}function eU(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function My(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(t):eU(t.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function Ey(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&QV(t)?!1:t!=null))}function tU(n,e){var t;const r=NC(n),{nodeExtensions:o,markExtensions:i}=Cu(n),s=(t=o.find(c=>Ie(c,"topNode")))===null||t===void 0?void 0:t.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=n.reduce((b,w)=>{const S=Ie(w,"extendNodeSchema",d);return{...b,...S?S(c):{}}},{}),f=Ey({...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 w;return[b.name,{default:(w=b==null?void 0:b.attribute)===null||w===void 0?void 0:w.default}]}))}),m=Je(Ie(c,"parseHTML",d));m&&(f.parseDOM=m.map(b=>My(b,u)));const g=Ie(c,"renderHTML",d);g&&(f.toDOM=b=>g({node:b,HTMLAttributes:mc(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=n.reduce((y,b)=>{const w=Ie(b,"extendMarkSchema",d);return{...y,...w?w(c):{}}},{}),f=Ey({...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=>My(y,u)));const g=Ie(c,"renderHTML",d);return g&&(f.toDOM=y=>g({mark:y,HTMLAttributes:mc(y,u)})),[c.name,f]}));return new lw({topNode:s,nodes:a,marks:l})}function Sd(n,e){return e.nodes[n]||e.marks[n]||null}function Ty(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const nU=(n,e=500)=>{let t="";const r=n.parentOffset;return n.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%";t+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),t};function Wh(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Su{constructor(e){this.find=e.find,this.handler=e.handler}}const rU=(n,e)=>{if(Wh(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function hl(n){var e;const{editor:t,from:r,to:o,text:i,rules:s,plugin:a}=n,{view:l}=t;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=nU(c)+i;return s.forEach(p=>{if(u)return;const f=rU(d,p.find);if(!f)return;const m=l.state.tr,g=xu({state:l.state,transaction:m}),y={from:r-(f[0].length-i.length),to:o},{commands:b,chain:w,can:S}=new wu({editor:t,state:g});p.handler({state:g,range:y,match:f,commands:b,chain:w,can:S})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:o,text:i}),l.dispatch(m),u=!0)}),u}function oU(n){const{editor:e,rules:t}=n,r=new mn({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;hl({editor:e,from:c,to:d,text:u,rules:t,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,a){return hl({editor:e,from:i,to:s,text:a,rules:t,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&hl({editor:e,from:i.pos,to:i.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?hl({editor:e,from:s.pos,to:s.pos,text:` +`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function iU(n){return Object.prototype.toString.call(n).slice(8,-1)}function ml(n){return iU(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function ku(n,e){const t={...n};return ml(n)&&ml(e)&&Object.keys(e).forEach(r=>{ml(e[r])&&ml(n[r])?t[r]=ku(n[r],e[r]):t[r]=e[r]}),t}class Vn{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 Vn(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>ku(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Vn(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.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: "${t.name}".`),t.options=Je(Ie(t,"addOptions",{name:t.name})),t.storage=Je(Ie(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){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)===t.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===t.name);return l&&r.removeStoredMark(l),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}function sU(n){return typeof n=="number"}class aU{constructor(e){this.find=e.find,this.handler=e.handler}}const lU=(n,e,t)=>{if(Wh(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=n,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 cU(n){const{editor:e,state:t,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=n,{commands:l,chain:c,can:u}=new wu({editor:e,state:t}),d=[];return t.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,"");lU(b,i.find,s).forEach(S=>{if(S.index===void 0)return;const T=g+S.index+1,k=T+S[0].length,x={from:t.tr.mapping.map(T),to:t.tr.mapping.map(k)},C=i.handler({state:t,range:x,match:S,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});d.push(C)})}),d.every(f=>f!==null)}const uU=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",n),t};function dU(n){const{editor:e,rules:t}=n;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=xu({state:u,transaction:g});if(!(!cU({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 t.map(u=>new mn({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"),w=!!b;if(!g&&!y&&!w)return;if(w){const{from:k,text:x}=b,C=k+x.length,E=uU(x);return l({rule:u,state:f,from:k,to:{b:C},pasteEvt:E})}const S=p.doc.content.findDiffStart(f.doc.content),T=p.doc.content.findDiffEnd(f.doc.content);if(!(!sU(S)||!T||S===T.b))return l({rule:u,state:f,from:S,to:T,pasteEvt:s})}}))}function pU(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}class qi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=qi.resolve(e),this.schema=tU(this.extensions,t),this.setupExtensions()}static resolve(e){const t=qi.sort(qi.flatten(e)),r=pU(t.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.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},o=Ie(t,"addExtensions",r);return o?[t,...this.flatten(o())]:t}).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:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Sd(t.name,this.schema)},o=Ie(t,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,t=qi.sort([...this.extensions].reverse()),r=[],o=[],i=t.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Sd(s.name,this.schema)},l=[],c=Ie(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&Ie(s,"exitable",a)&&(u.ArrowRight=()=>Vn.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=H9(u);l.push(d);const p=Ie(s,"addInputRules",a);Ty(s,e.options.enableInputRules)&&p&&r.push(...p());const f=Ie(s,"addPasteRules",a);Ty(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[oU({editor:e,rules:r}),...dU({editor:e,rules:o}),...i]}get attributes(){return NC(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Cu(this.extensions);return Object.fromEntries(t.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:nn(r.name,this.schema)},s=Ie(r,"addNodeView",i);if(!s)return[];const a=(l,c,u,d,p)=>{const f=mc(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 t;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Sd(e.name,this.schema)};e.type==="mark"&&(!((t=Je(Ie(e,"keepOnSplit",r)))!==null&&t!==void 0)||t)&&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 Ln{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 Ln(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>ku(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Ln({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.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: "${t.name}".`),t.options=Je(Ie(t,"addOptions",{name:t.name})),t.storage=Je(Ie(t,"addStorage",{name:t.name,options:t.options})),t}}function FC(n,e,t){const{from:r,to:o}=e,{blockSeparator:i=` + +`,textSerializers:s={}}=t||{};let a="";return n.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 jC(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const fU=Ln.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new mn({key:new Un("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{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=jC(t);return FC(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),hU=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),mU=(n=!1)=>({commands:e})=>e.setContent("",n),gU=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:o}=r;return t&&o.forEach(({$from:i,$to:s})=>{n.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=Y9(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},vU=n=>e=>n(e),yU=()=>({state:n,dispatch:e})=>jV(n,e),bU=(n,e)=>({editor:t,tr:r})=>{const{state:o}=t,i=o.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new qe(r.doc.resolve(s-1))),!0},xU=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const o=n.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);n.delete(a,l).scrollIntoView()}return!0}return!1},wU=n=>({tr:e,state:t,dispatch:r})=>{const o=nn(n,t.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},CU=n=>({tr:e,dispatch:t})=>{const{from:r,to:o}=n;return t&&e.delete(r,o),!0},SU=()=>({state:n,dispatch:e})=>TV(n,e),kU=()=>({commands:n})=>n.keyboardShortcut("Enter"),MU=()=>({state:n,dispatch:e})=>FV(n,e);function gc(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>t.strict?e[o]===n[o]:Wh(e[o])?e[o].test(n[o]):e[o]===n[o]):!0}function Bp(n,e,t={}){return n.find(r=>r.type===e&&gc(r.attrs,t))}function EU(n,e,t={}){return!!Bp(n,e,t)}function Gh(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const o=Bp([...r.node.marks],e,t);if(!o)return;let i=r.index,s=n.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(Bp([...r.node.marks],e,t);i>0&&o.isInSet(n.parent.child(i-1).marks);)i-=1,s-=n.parent.child(i).nodeSize;for(;a({tr:t,state:r,dispatch:o})=>{const i=So(n,r.schema),{doc:s,selection:a}=t,{$from:l,from:c,to:u}=a;if(o){const d=Gh(l,i,e);if(d&&d.from<=c&&d.to>=u){const p=qe.create(s,d.from,d.to);t.setSelection(p)}}return!0},OU=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r({editor:t,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{Mu()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(i&&n===null&&!_C(t.state.selection))return s(),!0;const a=zC(o.doc,n)||t.state.selection,l=t.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},AU=(n,e)=>t=>n.every((r,o)=>e(r,{...t,index:o})),PU=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),HC=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&HC(r)}return n};function gl(n){const e=`${n}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return HC(t)}function vc(n,e,t){t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,o=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return ee.fromArray(n.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(n);return t.errorOnInvalidContent&&s.check(),s}catch(i){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",i),vc("",e,t)}if(o){if(t.errorOnInvalidContent){let s=!1,a="";const l=new lw({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(t.slice?Zs.fromSchema(l).parseSlice(gl(n),t.parseOptions):Zs.fromSchema(l).parse(gl(n),t.parseOptions),t.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Zs.fromSchema(e);return t.slice?i.parseSlice(gl(n),t.parseOptions).content:i.parse(gl(n),t.parseOptions)}return vc("",e,t)}function DU(n,e,t){const r=n.steps.length-1;if(r{s===0&&(s=u)}),n.setSelection(Ze.near(n.doc.resolve(s),t))}const RU=n=>!("type"in n),IU=(n,e,t)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){t={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let a;try{a=vc(e,i.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(s=t.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 n=="number"?{from:n,to:n}:{from:n.from,to:n.to},u=!0,d=!0;if((RU(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)),t.updateSelection&&DU(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:f}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:f})}return!0},$U=()=>({state:n,dispatch:e})=>IV(n,e),NU=()=>({state:n,dispatch:e})=>$V(n,e),BU=()=>({state:n,dispatch:e})=>OV(n,e),FU=()=>({state:n,dispatch:e})=>DV(n,e),jU=()=>({state:n,dispatch:e,tr:t})=>{try{const r=mC(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},_U=()=>({state:n,dispatch:e,tr:t})=>{try{const r=mC(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},zU=()=>({state:n,dispatch:e})=>LV(n,e),HU=()=>({state:n,dispatch:e})=>AV(n,e);function VC(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function VU(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,o,i,s;for(let a=0;a({editor:e,view:t,tr:r,dispatch:o})=>{const i=VU(n).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(()=>{t.someProp("handleKeyDown",c=>c(t,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function ya(n,e,t={}){const{from:r,to:o,empty:i}=n.selection,s=e?nn(e,n.schema):null,a=[];n.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=>gc(d.node.attrs,t,{strict:!1}));return i?!!c.length:c.reduce((d,p)=>d+p.to-p.from,0)>=l}const WU=(n,e={})=>({state:t,dispatch:r})=>{const o=nn(n,t.schema);return ya(t,o,e)?NV(t,r):!1},GU=()=>({state:n,dispatch:e})=>_V(n,e),KU=n=>({state:e,dispatch:t})=>{const r=nn(n,e.schema);return qV(r)(e,t)},qU=()=>({state:n,dispatch:e})=>BV(n,e);function Eu(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Oy(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,o)=>(t.includes(o)||(r[o]=n[o]),r),{})}const YU=(n,e)=>({tr:t,state:r,dispatch:o})=>{let i=null,s=null;const a=Eu(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(i=nn(n,r.schema)),a==="mark"&&(s=So(n,r.schema)),o&&t.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{i&&i===c.type&&t.setNodeMarkup(u,void 0,Oy(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&t.addMark(u,u+c.nodeSize,s.create(Oy(d.attrs,e)))})})}),!0):!1},JU=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),ZU=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),XU=()=>({state:n,dispatch:e})=>PV(n,e),QU=()=>({state:n,dispatch:e})=>RV(n,e),e7=()=>({state:n,dispatch:e})=>zV(n,e),t7=()=>({state:n,dispatch:e})=>UV(n,e),n7=()=>({state:n,dispatch:e})=>VV(n,e);function Fp(n,e,t={},r={}){return vc(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const r7=(n,e=!1,t={},r={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{var l,c;const{doc:u}=i;if(t.preserveWhitespace!=="full"){const d=Fp(n,o.schema,t,{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},n,{parseOptions:t,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function Kh(n,e){const t=So(e,n.schema),{from:r,to:o,empty:i}=n.selection,s=[];i?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,o,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===t.name);return a?{...a.attrs}:{}}function o7(n,e){const t=new mV(n);return e.forEach(r=>{r.steps.forEach(o=>{t.step(o)})}),t}function i7(n){for(let e=0;e{t(o)&&r.push({node:o,pos:i})}),r}function a7(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function qh(n){return e=>a7(e.$from,n)}function l7(n,e){const t=li.fromSchema(e).serializeFragment(n),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(t),o.innerHTML}function c7(n,e){const t={from:0,to:n.content.size};return FC(n,t,e)}function u7(n,e){const t=nn(e,n.schema),{from:r,to:o}=n.selection,i=[];n.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===t.name);return s?{...s.attrs}:{}}function UC(n,e){const t=Eu(typeof e=="string"?e:e.name,n.schema);return t==="node"?u7(n,e):t==="mark"?Kh(n,e):{}}function d7(n,e=JSON.stringify){const t={};return n.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(t,o)?!1:t[o]=!0})}function p7(n){const e=d7(n);return e.length===1?e:e.filter((t,r)=>!e.filter((i,s)=>s!==r).some(i=>t.oldRange.from>=i.oldRange.from&&t.oldRange.to<=i.oldRange.to&&t.newRange.from>=i.newRange.from&&t.newRange.to<=i.newRange.to))}function f7(n){const{mapping:e,steps:t}=n,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}=t[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}})})}),p7(r)}function Yh(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(o=>{const i=t.resolve(n),s=Gh(i,o.type);s&&r.push({mark:o,...s})}):t.nodesBetween(n,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 $l(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const o=n.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function jp(n,e,t={}){const{empty:r,ranges:o}=n.selection,i=e?So(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>gc(d.attrs,t,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:d,$to:p})=>{const f=d.pos,m=p.pos;n.doc.nodesBetween(f,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const b=Math.max(f,y),w=Math.min(m,y+g.nodeSize),S=w-b;s+=S,a.push(...g.marks.map(T=>({mark:T,from:b,to:w})))})}),s===0)return!1;const l=a.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>gc(d.mark.attrs,t,{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 h7(n,e,t={}){if(!e)return ya(n,null,t)||jp(n,null,t);const r=Eu(e,n.schema);return r==="node"?ya(n,e,t):r==="mark"?jp(n,e,t):!1}function Ly(n,e){const{nodeExtensions:t}=Cu(e),r=t.find(s=>s.name===n);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 Jh(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!==null&&r!==void 0?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let o=!0;return n.content.forEach(i=>{o!==!1&&(Jh(i,{ignoreWhitespace:t,checkChildren:e})||(o=!1))}),o}return!1}function m7(n,e,t){const o=n.state.doc.content.size,i=Fr(e,0,o),s=Fr(t,0,o),a=n.coordsAtPos(i),l=n.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 g7(n,e,t){var r;const{selection:o}=e;let i=null;if(_C(o)&&(i=o.$cursor),i){const a=(r=n.storedMarks)!==null&&r!==void 0?r:i.marks();return!!t.isInSet(a)||!a.some(l=>l.type.excludes(t))}const{ranges:s}=o;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(a.pos,l.pos,(u,d,p)=>{if(c)return!1;if(u.isInline){const f=!p||p.type.allowsMarkType(t),m=!!t.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(t));c=f&&m}return!c}),c})}const v7=(n,e={})=>({tr:t,state:r,dispatch:o})=>{const{selection:i}=t,{empty:s,ranges:a}=i,l=So(n,r.schema);if(o)if(s){const c=Kh(r,l);t.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&&t.addMark(m,g,l.create({...b.attrs,...e}))}):t.addMark(m,g,l.create(e))})});return g7(r,t,l)},y7=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),b7=(n,e={})=>({state:t,dispatch:r,chain:o})=>{const i=nn(n,t.schema);return i.isTextblock?o().command(({commands:s})=>ky(i,e)(t)?!0:s.clearNodes()).command(({state:s})=>ky(i,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},x7=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,o=Fr(n,0,r.content.size),i=Ve.create(r,o);e.setSelection(i)}return!0},w7=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:o,to:i}=typeof n=="number"?{from:n,to:n}:n,s=qe.atStart(r).from,a=qe.atEnd(r).to,l=Fr(o,s,a),c=Fr(i,s,a),u=qe.create(r,l,c);e.setSelection(u)}return!0},C7=n=>({state:e,dispatch:t})=>{const r=nn(n,e.schema);return ZV(r)(e,t)};function Ay(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(o=>e==null?void 0:e.includes(o.type.name));n.tr.ensureMarks(r)}}const S7=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=o.extensionManager.attributes,u=$l(c,a.node().type.name,a.node().attrs);if(i instanceof Ve&&i.node.isBlock)return!a.parentOffset||!Dl(s,a.pos)?!1:(r&&(n&&Ay(t,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:i7(a.node(-1).contentMatchAt(a.indexAfter(-1)));let f=d&&p?[{type:p,attrs:u}]:void 0,m=Dl(e.doc,e.mapping.map(a.pos),1,f);if(!f&&!m&&Dl(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 qe&&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)}n&&Ay(t,o.extensionManager.splittableMarks),e.scrollIntoView()}return m},k7=(n,e={})=>({tr:t,state:r,dispatch:o,editor:i})=>{var s;const a=nn(n,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=ee.empty;const w=l.index(-1)?1:l.index(-2)?2:3;for(let E=l.depth-w;E>=l.depth-3;E-=1)b=ee.from(l.node(E).copy(b));const S=l.indexAfter(-1){if(C>-1)return!1;E.isTextblock&&E.content.size===0&&(C=P+1)}),C>-1&&t.setSelection(qe.near(t.doc.resolve(C))),t.scrollIntoView()}return!0}const f=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,m={...$l(p,d.type.name,d.attrs),...e},g={...$l(p,l.node().type.name,l.node().attrs),...e};t.delete(l.pos,c.pos);const y=f?[{type:a,attrs:m},{type:f,attrs:g}]:[{type:a,attrs:m}];if(!Dl(t.doc,l.pos,2))return!1;if(o){const{selection:b,storedMarks:w}=r,{splittableMarks:S}=i.extensionManager,T=w||b.$to.parentOffset&&b.$from.marks();if(t.split(l.pos,2,y).scrollIntoView(),!T||!o)return!0;const k=T.filter(x=>S.includes(x.type.name));t.ensureMarks(k)}return!0},kd=(n,e)=>{const t=qh(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const o=n.doc.nodeAt(r);return t.node.type===(o==null?void 0:o.type)&&_h(n.doc,t.pos)&&n.join(t.pos),!0},Md=(n,e)=>{const t=qh(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const o=n.doc.nodeAt(r);return t.node.type===(o==null?void 0:o.type)&&_h(n.doc,r)&&n.join(r),!0},M7=(n,e,t,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:d,splittableMarks:p}=o.extensionManager,f=nn(n,s.schema),m=nn(e,s.schema),{selection:g,storedMarks:y}=s,{$from:b,$to:w}=g,S=b.blockRange(w),T=y||g.$to.parentOffset&&g.$from.marks();if(!S)return!1;const k=qh(x=>Ly(x.type.name,d))(g);if(S.depth>=1&&k&&S.depth-k.depth<=1){if(k.node.type===f)return c.liftListItem(m);if(Ly(k.node.type.name,d)&&f.validContent(k.node.content)&&a)return l().command(()=>(i.setNodeMarkup(k.pos,f),!0)).command(()=>kd(i,f)).command(()=>Md(i,f)).run()}return!t||!T||!a?l().command(()=>u().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>kd(i,f)).command(()=>Md(i,f)).run():l().command(()=>{const x=u().wrapInList(f,r),C=T.filter(E=>p.includes(E.type.name));return i.ensureMarks(C),x?!0:c.clearNodes()}).wrapInList(f,r).command(()=>kd(i,f)).command(()=>Md(i,f)).run()},E7=(n,e={},t={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=t,s=So(n,r.schema);return jp(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},T7=(n,e,t={})=>({state:r,commands:o})=>{const i=nn(n,r.schema),s=nn(e,r.schema),a=ya(r,i,t);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,...t})},O7=(n,e={})=>({state:t,commands:r})=>{const o=nn(n,t.schema);return ya(t,o,e)?r.lift(o):r.wrapIn(o,e)},L7=()=>({state:n,dispatch:e})=>{const t=n.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,n.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1},A7=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:o}=t;return r||e&&o.forEach(i=>{n.removeMark(i.$from.pos,i.$to.pos)}),!0},P7=(n,e={})=>({tr:t,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=t,l=So(n,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=Gh(c,l,m);g&&(p=g.from,f=g.to),t.removeMark(p,f,l)}else d.forEach(p=>{t.removeMark(p.$from.pos,p.$to.pos,l)});return t.removeStoredMark(l),!0},D7=(n,e={})=>({tr:t,state:r,dispatch:o})=>{let i=null,s=null;const a=Eu(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(i=nn(n,r.schema)),a==="mark"&&(s=So(n,r.schema)),o&&t.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(d,p)=>{i&&i===d.type&&t.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);t.addMark(m,g,s.create({...f.attrs,...e}))}})})}),!0):!1},R7=(n,e={})=>({state:t,dispatch:r})=>{const o=nn(n,t.schema);return WV(o,e)(t,r)},I7=(n,e={})=>({state:t,dispatch:r})=>{const o=nn(n,t.schema);return GV(o,e)(t,r)};var $7=Object.freeze({__proto__:null,blur:hU,clearContent:mU,clearNodes:gU,command:vU,createParagraphNear:yU,cut:bU,deleteCurrentNode:xU,deleteNode:wU,deleteRange:CU,deleteSelection:SU,enter:kU,exitCode:MU,extendMarkRange:TU,first:OU,focus:LU,forEach:AU,insertContent:PU,insertContentAt:IU,joinBackward:BU,joinDown:NU,joinForward:FU,joinItemBackward:jU,joinItemForward:_U,joinTextblockBackward:zU,joinTextblockForward:HU,joinUp:$U,keyboardShortcut:UU,lift:WU,liftEmptyBlock:GU,liftListItem:KU,newlineInCode:qU,resetAttributes:YU,scrollIntoView:JU,selectAll:ZU,selectNodeBackward:XU,selectNodeForward:QU,selectParentNode:e7,selectTextblockEnd:t7,selectTextblockStart:n7,setContent:r7,setMark:v7,setMeta:y7,setNode:b7,setNodeSelection:x7,setTextSelection:w7,sinkListItem:C7,splitBlock:S7,splitListItem:k7,toggleList:M7,toggleMark:E7,toggleNode:T7,toggleWrap:O7,undoInputRule:L7,unsetAllMarks:A7,unsetMark:P7,updateAttributes:D7,wrapIn:R7,wrapInList:I7});const N7=Ln.create({name:"commands",addCommands(){return{...$7}}}),B7=Ln.create({name:"drop",addProseMirrorPlugins(){return[new mn({key:new Un("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),F7=Ln.create({name:"editable",addProseMirrorPlugins(){return[new mn({key:new Un("editable"),props:{editable:()=>this.editor.options.editable}})]}}),j7=Ln.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new mn({key:new Un("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),_7=Ln.create({name:"keymap",addKeyboardShortcuts(){const n=()=>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:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":n,"Alt-Backspace":n,"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 Mu()||VC()?i:o},addProseMirrorPlugins(){return[new mn({key:new Un("clearDocument"),appendTransaction:(n,e,t)=>{const r=n.some(g=>g.docChanged)&&!e.doc.eq(t.doc),o=n.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)||!Jh(t.doc))return;const p=t.tr,f=xu({state:t,transaction:p}),{commands:m}=new wu({editor:this.editor,state:f});if(m.clearNodes(),!!p.steps.length)return p}})]}}),z7=Ln.create({name:"paste",addProseMirrorPlugins(){return[new mn({key:new Un("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),H7=Ln.create({name:"tabindex",addProseMirrorPlugins(){return[new mn({key:new Un("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Do{get name(){return this.node.type.name}constructor(e,t,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,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 t=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}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,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),t=this.resolvedPos.doc.resolve(e);return new Do(t,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 Do(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 Do(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,r)=>{const o=t.isBlock&&!t.isTextblock,i=this.pos+r+1,s=this.resolvedPos.doc.resolve(i);if(!o&&s.depth<=this.depth)return;const a=new Do(s,this.editor,o,o?t:null);o&&(a.actualDepth=this.depth+1),e.push(new Do(s,this.editor,o,o?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(t).length>0){const i=o.node.attrs,s=Object.keys(t);for(let a=0;a{r&&o.length>0||(s.node.type.name===e&&i.every(l=>t[l]===s.node.attrs[l])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,t,r))))}),o}setAttribute(e){const t=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(t.from).run()}}const V7=`.ProseMirror { position: relative; } @@ -1025,9 +850,9 @@ img.ProseMirror-separator { .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 -}`;function DW(n,e,t){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=n,document.getElementsByTagName("head")[0].appendChild(o),o}let RW=class extends _U{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:t})=>{throw t},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:t,slice:r,moved:o})=>this.options.onDrop(t,r,o)),this.on("paste",({event:t,slice:r})=>this.options.onPaste(t,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=DW(PW,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,t=!0){this.setOptions({editable:e}),t&&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,t){const r=zC(t)?t(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 t=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(t))});return this.view.updateState(r),r}createExtensionManager(){var e,t;const o=[...this.options.enableCoreExtensions?[EW,t7.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||t===void 0?void 0:t.blockSeparator}),kW,TW,OW,AW,MW,LW].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 xu({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=jp(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=jp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const t=WC(e,this.options.autofocus);this.view=new wV(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Ki.create({doc:e,selection:t||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 t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const t=this.state.apply(e),r=!this.state.selection.eq(t.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),this.view.updateState(t),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 qC(this.state,e)}isActive(e,t){const r=typeof e=="string"?e:null,o=typeof e=="string"?t:e;return nW(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return J7(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=` +}`;function U7(n,e,t){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=n,document.getElementsByTagName("head")[0].appendChild(o),o}let W7=class extends XV{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:t})=>{throw t},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:t,slice:r,moved:o})=>this.options.onDrop(t,r,o)),this.on("paste",({event:t,slice:r})=>this.options.onPaste(t,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=U7(V7,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,t=!0){this.setOptions({editable:e}),t&&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,t){const r=BC(t)?t(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 t=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(t))});return this.view.updateState(r),r}createExtensionManager(){var e,t;const o=[...this.options.enableCoreExtensions?[F7,fU.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||t===void 0?void 0:t.blockSeparator}),N7,j7,_7,H7,B7,z7].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 wu({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=Fp(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=Fp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const t=zC(e,this.options.autofocus);this.view=new R9(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Ki.create({doc:e,selection:t||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 t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const t=this.state.apply(e),r=!this.state.selection.eq(t.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),this.view.updateState(t),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 UC(this.state,e)}isActive(e,t){const r=typeof e=="string"?e:null,o=typeof e=="string"?t:e;return h7(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return l7(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=` -`,textSerializers:r={}}=e||{};return Z7(this.state.doc,{blockSeparator:t,textSerializers:{...VC(this.schema),...r}})}get isEmpty(){return Zh(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,t){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,t))||null}$nodes(e,t){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new Do(t,this)}get $doc(){return this.$pos(0)}};function as(n){return new Cu({find:n.find,handler:({state:e,range:t,match:r})=>{const o=Je(n.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=t.from+a.indexOf(s),u=c+s.length;if(Jh(t.from,t.to,e.doc).filter(f=>f.mark.type.excluded.find(g=>g===n.type&&g!==f.mark.type)).filter(f=>f.to>c).length)return null;ut.from&&i.delete(t.from+l,c);const p=t.from+l+s.length;i.addMark(t.from+l,p,n.type.create(o||{})),i.removeStoredMark(n.type)}}})}function IW(n){return new Cu({find:n.find,handler:({state:e,range:t,match:r})=>{const o=Je(n.getAttributes,void 0,r)||{},{tr:i}=e,s=t.from;let a=t.to;const l=n.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=n.type.isInline?s:s-1;i.insert(c,n.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}})}function zp(n){return new Cu({find:n.find,handler:({state:e,range:t,match:r})=>{const o=e.doc.resolve(t.from),i=Je(n.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,i)}})}function ba(n){return new Cu({find:n.find,handler:({state:e,range:t,match:r,chain:o})=>{const i=Je(n.getAttributes,void 0,r)||{},s=e.tr.delete(t.from,t.to),l=s.doc.resolve(t.from).blockRange(),c=l&&jV(l,n.type,i);if(!c)return null;if(s.wrap(l,c),n.keepMarks&&n.editor){const{selection:d,storedMarks:p}=e,{splittableMarks:f}=n.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(n.keepAttributes){const d=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(d,i).run()}const u=s.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&zh(s.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&s.join(t.from-1)}})}let Wn=class Hp{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 Hp(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Su(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Hp(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.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: "${t.name}".`),t.options=Je(Ie(t,"addOptions",{name:t.name})),t.storage=Je(Ie(t,"addStorage",{name:t.name,options:t.options})),t}};function $W(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class NW{constructor(e,t,r){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,r,o,i,s,a,l;const{view:c}=this.editor,u=e.target,d=u.nodeType===3?(t=u.parentElement)===null||t===void 0?void 0:t.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(),w=d.getBoundingClientRect(),S=(o=e.offsetX)!==null&&o!==void 0?o:(i=e.nativeEvent)===null||i===void 0?void 0:i.offsetX,T=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;p=w.x-b.x+S,f=w.y-b.y+T}(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 t;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)&&!(!((t=this.contentDOM)===null||t===void 0)&&t.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"&&(ku()||$W())&&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:t})=>{const r=this.getPos();return typeof r!="number"?!1:(t.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}function Xo(n){return new YU({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:o})=>{const i=Je(n.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=t.to;if(a){const u=l.search(/\S/),d=t.from+l.indexOf(a),p=d+a.length;if(Jh(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===n.type&&y!==m.mark.type)).filter(m=>m.to>d).length)return null;pt.from&&s.delete(t.from+u,d),c=t.from+u+a.length,s.addMark(t.from+u,c,n.type.create(i||{})),s.removeStoredMark(n.type)}}})}function BW(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var YC={exports:{}},Ld={};/** +`,textSerializers:r={}}=e||{};return c7(this.state.doc,{blockSeparator:t,textSerializers:{...jC(this.schema),...r}})}get isEmpty(){return Jh(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,t){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,t))||null}$nodes(e,t){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new Do(t,this)}get $doc(){return this.$pos(0)}};function as(n){return new Su({find:n.find,handler:({state:e,range:t,match:r})=>{const o=Je(n.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=t.from+a.indexOf(s),u=c+s.length;if(Yh(t.from,t.to,e.doc).filter(f=>f.mark.type.excluded.find(g=>g===n.type&&g!==f.mark.type)).filter(f=>f.to>c).length)return null;ut.from&&i.delete(t.from+l,c);const p=t.from+l+s.length;i.addMark(t.from+l,p,n.type.create(o||{})),i.removeStoredMark(n.type)}}})}function G7(n){return new Su({find:n.find,handler:({state:e,range:t,match:r})=>{const o=Je(n.getAttributes,void 0,r)||{},{tr:i}=e,s=t.from;let a=t.to;const l=n.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=n.type.isInline?s:s-1;i.insert(c,n.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}})}function _p(n){return new Su({find:n.find,handler:({state:e,range:t,match:r})=>{const o=e.doc.resolve(t.from),i=Je(n.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,i)}})}function ba(n){return new Su({find:n.find,handler:({state:e,range:t,match:r,chain:o})=>{const i=Je(n.getAttributes,void 0,r)||{},s=e.tr.delete(t.from,t.to),l=s.doc.resolve(t.from).blockRange(),c=l&&Z9(l,n.type,i);if(!c)return null;if(s.wrap(l,c),n.keepMarks&&n.editor){const{selection:d,storedMarks:p}=e,{splittableMarks:f}=n.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(n.keepAttributes){const d=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(d,i).run()}const u=s.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&_h(s.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&s.join(t.from-1)}})}let Wn=class zp{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 zp(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>ku(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new zp(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.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: "${t.name}".`),t.options=Je(Ie(t,"addOptions",{name:t.name})),t.storage=Je(Ie(t,"addStorage",{name:t.name,options:t.options})),t}};function K7(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class q7{constructor(e,t,r){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,r,o,i,s,a,l;const{view:c}=this.editor,u=e.target,d=u.nodeType===3?(t=u.parentElement)===null||t===void 0?void 0:t.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(),w=d.getBoundingClientRect(),S=(o=e.offsetX)!==null&&o!==void 0?o:(i=e.nativeEvent)===null||i===void 0?void 0:i.offsetX,T=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;p=w.x-b.x+S,f=w.y-b.y+T}(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 t;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)&&!(!((t=this.contentDOM)===null||t===void 0)&&t.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"&&(Mu()||K7())&&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:t})=>{const r=this.getPos();return typeof r!="number"?!1:(t.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}function Xo(n){return new aU({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:o})=>{const i=Je(n.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=t.to;if(a){const u=l.search(/\S/),d=t.from+l.indexOf(a),p=d+a.length;if(Yh(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===n.type&&y!==m.mark.type)).filter(m=>m.to>d).length)return null;pt.from&&s.delete(t.from+u,d),c=t.from+u+a.length,s.addMark(t.from+u,c,n.type.create(i||{})),s.removeStoredMark(n.type)}}})}function Y7(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var WC={exports:{}},Ed={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -1035,7 +860,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 jy;function FW(){if(jy)return Ld;jy=1;var n=A;function e(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var t=typeof Object.is=="function"?Object.is:e,r=n.useState,o=n.useEffect,i=n.useLayoutEffect,s=n.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!t(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 Ld.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:u,Ld}YC.exports=FW();var Xh=YC.exports;const jW=(...n)=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},_W=({contentComponent:n})=>{const e=Xh.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return A.createElement(A.Fragment,null,Object.values(e))};function zW(){const n=new Set;let e={};return{subscribe(t){return n.add(t),()=>{n.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,r){e={...e,[t]:yM.createPortal(r.reactElement,r.element,t)},n.forEach(o=>o())},removeRenderer(t){const r={...e};delete r[t],e=r,n.forEach(o=>o())}}}class HW extends A.Component{constructor(e){var t;super(e),this.editorContentRef=A.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((t=e.editor)===null||t===void 0)&&t.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 t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=zW(),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 t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,innerRef:t,...r}=this.props;return A.createElement(A.Fragment,null,A.createElement("div",{ref:jW(t,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&A.createElement(_W,{contentComponent:e.contentComponent}))}}const VW=h.forwardRef((n,e)=>{const t=A.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return A.createElement(HW,{key:t,innerRef:e,...n})}),UW=A.memo(VW);var WW=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,o,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(!n(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!n(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!(s==="_owner"&&e.$$typeof)&&!n(e[s],t[s]))return!1}return!0}return e!==e&&t!==t},GW=BW(WW),JC={exports:{}},Ad={};/** + */var Py;function J7(){if(Py)return Ed;Py=1;var n=A;function e(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var t=typeof Object.is=="function"?Object.is:e,r=n.useState,o=n.useEffect,i=n.useLayoutEffect,s=n.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!t(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 Ed.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:u,Ed}WC.exports=J7();var Zh=WC.exports;const Z7=(...n)=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},X7=({contentComponent:n})=>{const e=Zh.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return A.createElement(A.Fragment,null,Object.values(e))};function Q7(){const n=new Set;let e={};return{subscribe(t){return n.add(t),()=>{n.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,r){e={...e,[t]:CM.createPortal(r.reactElement,r.element,t)},n.forEach(o=>o())},removeRenderer(t){const r={...e};delete r[t],e=r,n.forEach(o=>o())}}}class eW extends A.Component{constructor(e){var t;super(e),this.editorContentRef=A.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((t=e.editor)===null||t===void 0)&&t.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 t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=Q7(),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 t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,innerRef:t,...r}=this.props;return A.createElement(A.Fragment,null,A.createElement("div",{ref:Z7(t,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&A.createElement(X7,{contentComponent:e.contentComponent}))}}const tW=h.forwardRef((n,e)=>{const t=A.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return A.createElement(eW,{key:t,innerRef:e,...n})}),nW=A.memo(tW);var rW=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,o,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(!n(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!n(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!(s==="_owner"&&e.$$typeof)&&!n(e[s],t[s]))return!1}return!0}return e!==e&&t!==t},oW=Y7(rW),GC={exports:{}},Td={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -1043,7 +868,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 _y;function KW(){if(_y)return Ad;_y=1;var n=A,e=Xh;function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:t,o=e.useSyncExternalStore,i=n.useRef,s=n.useEffect,a=n.useMemo,l=n.useDebugValue;return Ad.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(x){if(!w){if(w=!0,S=x,x=p(x),f!==void 0&&g.hasValue){var C=g.value;if(f(C,x))return T=C}return T=x}if(C=T,r(S,x))return C;var E=p(x);return f!==void 0&&f(C,E)?C:(S=x,T=E)}var w=!1,S,T,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},Ad}JC.exports=KW();var qW=JC.exports;class YW{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 t=()=>{this.transactionNumber+=1,this.subscribers.forEach(o=>o())},r=this.editor;return r.on("transaction",t),()=>{r.off("transaction",t)}}}}function JW(n){var e;const[t]=h.useState(()=>new YW(n.editor)),r=qW.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,n.selector,(e=n.equalityFn)!==null&&e!==void 0?e:GW);return h.useEffect(()=>t.watch(n.editor),[n.editor,t]),h.useDebugValue(r),r}const ZW=!1,Vp=typeof window>"u",XW=Vp||!!(typeof window<"u"&&window.next);class QW{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(t=>t())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return Vp||XW?null:this.createEditor();if(this.options.current.immediatelyRender&&Vp&&ZW)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 RW(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,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function eG(n={},e=[]){const t=h.useRef(n);t.current=n;const[r]=h.useState(()=>new QW(t)),o=Xh.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return h.useDebugValue(o),h.useEffect(r.onRender(e)),JW({editor:o,selector:({transactionNumber:i})=>n.shouldRerenderOnTransaction===!1?null:n.immediatelyRender&&i===0?0:i+1}),o}const tG=h.createContext({editor:null});tG.Consumer;const ZC=h.createContext({onDragStart:void 0}),nG=()=>h.useContext(ZC),rG=A.forwardRef((n,e)=>{const{onDragStart:t}=nG(),r=n.as||"div";return A.createElement(r,{...n,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...n.style}})});function oG(n){return!!(typeof n=="function"&&n.prototype&&n.prototype.isReactComponent)}function iG(n){var e;return typeof n=="object"&&((e=n.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class sG{constructor(e,{editor:t,props:r={},as:o="div",className:i=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=r,this.element=document.createElement(o),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?ti.flushSync(()=>{this.render()}):this.render()}render(){var e;const t=this.component,r=this.props,o=this.editor;(oG(t)||iG(t))&&(r.ref=i=>{this.ref=i}),this.reactElement=A.createElement(t,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 t=this.editor;(e=t==null?void 0:t.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}}class aG extends NW{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=A.memo(c=>A.createElement(ZC.Provider,{value:o},A.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 sG(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:t}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&t>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,t,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=t,this.innerDecorations=r,this.options.update({oldNode:i,oldDecorations:s,newNode:e,newDecorations:t,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>o({node:e,decorations:t,innerDecorations:r})})}return e===this.node&&this.decorations===t&&this.innerDecorations===r||(this.node=e,this.decorations=t,this.innerDecorations=r,o({node:e,decorations:t,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 t=this.editor.extensionManager.attributes,r=hc(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:r})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}}function lG(n,e){return t=>t.editor.contentComponent?new aG(n,t,e):{}}const XC=bo`font-size: font-size: 28px;`,QC=bo`font-size: font-size: 36px;`,eS=bo`font-size: font-size: 22px;`,tS=bo`font-size: font-size: 14px;`,nS=bo`font-size: font-size: 12px;`,rS=bo`font-size: font-size: 12px;`,oS=bo` + */var Dy;function iW(){if(Dy)return Td;Dy=1;var n=A,e=Zh;function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:t,o=e.useSyncExternalStore,i=n.useRef,s=n.useEffect,a=n.useMemo,l=n.useDebugValue;return Td.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(x){if(!w){if(w=!0,S=x,x=p(x),f!==void 0&&g.hasValue){var C=g.value;if(f(C,x))return T=C}return T=x}if(C=T,r(S,x))return C;var E=p(x);return f!==void 0&&f(C,E)?C:(S=x,T=E)}var w=!1,S,T,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},Td}GC.exports=iW();var sW=GC.exports;class aW{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 t=()=>{this.transactionNumber+=1,this.subscribers.forEach(o=>o())},r=this.editor;return r.on("transaction",t),()=>{r.off("transaction",t)}}}}function lW(n){var e;const[t]=h.useState(()=>new aW(n.editor)),r=sW.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,n.selector,(e=n.equalityFn)!==null&&e!==void 0?e:oW);return h.useEffect(()=>t.watch(n.editor),[n.editor,t]),h.useDebugValue(r),r}const cW=!1,Hp=typeof window>"u",uW=Hp||!!(typeof window<"u"&&window.next);class dW{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(t=>t())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return Hp||uW?null:this.createEditor();if(this.options.current.immediatelyRender&&Hp&&cW)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 W7(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,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function pW(n={},e=[]){const t=h.useRef(n);t.current=n;const[r]=h.useState(()=>new dW(t)),o=Zh.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return h.useDebugValue(o),h.useEffect(r.onRender(e)),lW({editor:o,selector:({transactionNumber:i})=>n.shouldRerenderOnTransaction===!1?null:n.immediatelyRender&&i===0?0:i+1}),o}const fW=h.createContext({editor:null});fW.Consumer;const KC=h.createContext({onDragStart:void 0}),hW=()=>h.useContext(KC),mW=A.forwardRef((n,e)=>{const{onDragStart:t}=hW(),r=n.as||"div";return A.createElement(r,{...n,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...n.style}})});function gW(n){return!!(typeof n=="function"&&n.prototype&&n.prototype.isReactComponent)}function vW(n){var e;return typeof n=="object"&&((e=n.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class yW{constructor(e,{editor:t,props:r={},as:o="div",className:i=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=r,this.element=document.createElement(o),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?ti.flushSync(()=>{this.render()}):this.render()}render(){var e;const t=this.component,r=this.props,o=this.editor;(gW(t)||vW(t))&&(r.ref=i=>{this.ref=i}),this.reactElement=A.createElement(t,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 t=this.editor;(e=t==null?void 0:t.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}}class bW extends q7{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=A.memo(c=>A.createElement(KC.Provider,{value:o},A.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 yW(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:t}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&t>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,t,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=t,this.innerDecorations=r,this.options.update({oldNode:i,oldDecorations:s,newNode:e,newDecorations:t,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>o({node:e,decorations:t,innerDecorations:r})})}return e===this.node&&this.decorations===t&&this.innerDecorations===r||(this.node=e,this.decorations=t,this.innerDecorations=r,o({node:e,decorations:t,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 t=this.editor.extensionManager.attributes,r=mc(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:r})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}}function xW(n,e){return t=>t.editor.contentComponent?new bW(n,t,e):{}}const qC=bo`font-size: font-size: 28px;`,YC=bo`font-size: font-size: 36px;`,JC=bo`font-size: font-size: 22px;`,ZC=bo`font-size: font-size: 14px;`,XC=bo`font-size: font-size: 12px;`,QC=bo`font-size: font-size: 12px;`,eS=bo` &:disabled { color: ${j.colors.gray400}; } @@ -1056,10 +881,10 @@ img.ProseMirror-separator { color: ${n?j.colors.gray700:j.colors.gray600}; background-color: ${n?j.newColors.simplyGold[40]:"transparent"}; `} -`,zy=bo` +`,Ry=bo` outline: 3px solid #008DA8; outline-offset: 1px; -`,cG=Y.div` +`,wW=Y.div` font-family: ${j.fontFamily}; ${({$disabled:n})=>n?` @@ -1069,7 +894,7 @@ img.ProseMirror-separator { --border-color: ${j.newColors.simplyGrey[100]}; color: ${j.newColors.almostBlack[100]}; `} -`,uG=Y(UW)` +`,CW=Y(nW)` .tiptap { background-color: ${j.newColors.grey1[100]}; border: 1px solid var(--border-color); @@ -1111,29 +936,29 @@ img.ProseMirror-separator { } h1 { - ${XC} + ${qC} margin: 28px 0; } h2 { - ${QC} + ${YC} margin: 24px 0; } h3 { - ${eS} + ${JC} } h4 { - ${tS} + ${ZC} } h5 { - ${nS} + ${XC} } h6 { - ${rS} + ${QC} } :first-child{ @@ -1166,7 +991,7 @@ img.ProseMirror-separator { } .ProseMirror-selectednode .tiptap-pill{ - ${zy} + ${Ry} } ul, @@ -1217,11 +1042,11 @@ img.ProseMirror-separator { max-width: 100%; &.ProseMirror-selectednode { - ${zy} + ${Ry} } } } -`,dG=Y.div` +`,SW=Y.div` ${({$disabled:n})=>` --border-color: ${n?j.colors.disableBorder:j.newColors.simplyGrey[100]}; `} @@ -1230,7 +1055,7 @@ img.ProseMirror-separator { box-shadow: box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); border: 1px solid var(--border-color); padding: 4px 0; -`,pG=Y.div` +`,kW=Y.div` background: ${j.newColors.grey1[100]}; border: 1px solid var(--border-color); border-bottom: 0; @@ -1251,10 +1076,10 @@ img.ProseMirror-separator { ${({$focus:n})=>n&&` border-color: ${j.newColors.almostBlack[100]}; `} -`,fG=Y.div` +`,MW=Y.div` display: flex; flex-wrap: wrap; -`,hG=Y.div` +`,EW=Y.div` display: flex; align-items: center; justify-content: center; @@ -1272,7 +1097,7 @@ img.ProseMirror-separator { bottom: 6px; right: -1px; } -`,iS=Y.button.attrs(n=>({...n,type:"button"}))` +`,tS=Y.button.attrs(n=>({...n,type:"button"}))` align-items: center; background: none; border-radius: 4px; @@ -1295,10 +1120,10 @@ img.ProseMirror-separator { width: 32px; `} - ${oS} -`,mG=Y(iS)` + ${eS} +`,TW=Y(tS)` width: 90px; -`,gG=Y(ak)` +`,OW=Y(lk)` background: ${j.newColors.grey1[100]}; border: 1px solid var(--border-color); -webkit-box-sizing: border-box; @@ -1314,34 +1139,34 @@ img.ProseMirror-separator { border-color: ${j.newColors.almostBlack[100]}; outline: none; } -`,vG=Y(Ik)` +`,LW=Y(Ik)` font-family: ${j.fontFamily}; padding: 10px; h1 { - ${XC} + ${qC} } h2 { - ${QC} + ${YC} } h3 { - ${eS} + ${JC} } h4 { - ${tS} + ${ZC} } h5 { - ${nS} + ${XC} } h6 { - ${rS} + ${QC} } -`,Qh=Y.button` +`,Xh=Y.button` background: none; border: 0; border-radius: 0; @@ -1353,26 +1178,26 @@ img.ProseMirror-separator { width: 100%; padding: 8px 12px; - ${oS} + ${eS} h1, h2, h3, h4, h5, h6 { margin: 0; } -`,em=Y.div` +`,Qh=Y.div` display: flex; align-items: center; text-align: left; gap: 4px; -`,tm=Y.div` +`,em=Y.div` background: ${j.colors.gray200}; font-size: 12px; text-align: center; padding: 2px 4px; border-radius: 3px; margin-left: auto; -`,yG=Y.div` +`,AW=Y.div` background: white; border: 1px solid var(--border-color); border-bottom: 0; @@ -1384,7 +1209,7 @@ img.ProseMirror-separator { gap: 4px; position: relative; z-index: 2; -`,bG=Y.button.attrs(n=>({...n,type:"button"}))` +`,PW=Y.button.attrs(n=>({...n,type:"button"}))` border-radius: 0; border: 1px solid transparent; padding: 4px 8px; @@ -1399,13 +1224,13 @@ img.ProseMirror-separator { background: white; cursor: pointer; `} -`,xG=Y(ei)` +`,DW=Y(ei)` z-index: 5; -`,wG=Y.div` +`,RW=Y.div` border: 1px solid ${j.colors.gray300}; background: white; width: 300px; -`,CG=Y(ln)` +`,IW=Y(ln)` && { margin-left: auto; @@ -1414,39 +1239,148 @@ img.ProseMirror-separator { height: 24px; } } -`,SG=Y.a.attrs(n=>({...n,target:"_blank"}))` +`,$W=Y.a.attrs(n=>({...n,target:"_blank"}))` font-family: ${j.fontFamily}; display: flex; align-items: center; gap: 4px; font-size: 14px; color: ${j.colors.teal}; -`;var nm={},kG=kt;Object.defineProperty(nm,"__esModule",{value:!0});var rm=nm.default=void 0,MG=kG(Mt()),EG=St();rm=nm.default=(0,MG.default)((0,EG.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 TG({url:n}){return v.jsxs(SG,{href:n,target:"_blank",children:[v.jsx(rm,{})," ","Preview"]})}function sS({onRemove:n}){return v.jsxs(JM,{$spacing:"compact",children:[v.jsx(ln,{color:"yellow",variant:"contained",label:"Submit",type:"submit"}),n&&v.jsx(CG,{color:"red",variant:"text",label:"Remove",onClick:n})]})}function OG({editor:n,getFormValues:e,onClose:t,update:r}){const o=Lu(),{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(()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),t()},[n,t]),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(TG,{url:i}),show:({data:u})=>!!u.url},{name:"newTab",label:"Open in new tab",type:"toggle"}],[i]);return v.jsx(Ou,{...o,fields:c,spacing:"compact",autoFocus:!0,getFormValues:e,onSubmit:a,bottomSlot:v.jsx(sS,{onRemove:l})})}function LG({getFormValues:n,update:e}){const t=Lu(),{handleSubmit:r}=t,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(Ou,{...t,fields:i,spacing:"compact",autoFocus:!0,getFormValues:n,onSubmit:o,bottomSlot:v.jsx(sS,{})})}const AG=[{name:"offset",options:{offset:[0,5]}}];function PG({editor:n,onClose:e,type:t,values:r,update:o,anchorEl:i,open:s}){const a=h.useCallback(async()=>r||{},[r]);return v.jsx(xG,{anchorEl:i,open:s,modifiers:AG,children:v.jsx(CM,{onClickAway:e,children:v.jsx(wG,{children:t==="link"?v.jsx(OG,{editor:n,getFormValues:a,onClose:e,update:o}):t==="image"?v.jsx(LG,{editor:n,getFormValues:a,onClose:e,update:o}):null})})})}const aS=h.forwardRef(function({label:e,children:t,active:r,square:o,shortcut:i,disabled:s,...a},l){const{anchorProps:c,tooltipProps:u}=of(),d=p=>{c.ref(p),l&&(typeof l=="function"?l(p):l.current=p)};return v.jsxs(v.Fragment,{children:[v.jsx(iS,{...a,...c,ref:d,$active:r,$square:o,disabled:s,children:t}),e&&v.jsxs(sf,{...u,children:[e," ",i&&v.jsxs(v.Fragment,{children:["(",v.jsx(Eu,{shortcut:i}),")"]})]})]})});function ms({editor:n,level:e,onClose:t,shortcut:r}){const o=()=>{n.chain().focus().toggleHeading({level:e}).run(),t&&t()};return v.jsxs(Qh,{onClick:o,$active:n.isActive("heading",{level:e}),"data-testid":`${Mr.TEXT_EDITOR_HEADING_CONTROL}-${e}`,children:[v.jsx(em,{children:A.createElement(`h${e}`,null,`Heading ${e}`)}),r&&v.jsx(tm,{children:v.jsx(Eu,{shortcut:r})})]})}function DG({editor:n,onClose:e,shortcut:t}){const r=()=>{n.chain().focus().setParagraph().run(),e&&e()};return v.jsxs(Qh,{onClick:r,$active:n.isActive("paragraph"),children:[v.jsx(em,{children:"Normal Text"}),t&&v.jsx(tm,{children:v.jsx(Eu,{shortcut:t})})]})}function RG(n){return v.jsx(ms,{level:1,...n})}function IG(n){return v.jsx(ms,{level:2,...n})}function $G(n){return v.jsx(ms,{level:3,...n})}function NG(n){return v.jsx(ms,{level:4,...n})}function BG(n){return v.jsx(ms,{level:5,...n})}function FG(n){return v.jsx(ms,{level:6,...n})}function Eu({shortcut:n}){const t=window.navigator.userAgent.toUpperCase().includes("MAC")?n.mac:n.pc;return v.jsx(v.Fragment,{children:t})}function jG({name:n,Icon:e,label:t,shortcut:r,cmd:o,editor:i,onClose:s,inputSettings:a}){const l=()=>{o({editor:i,inputSettings:a}),s()};return v.jsx("li",{children:v.jsxs(Qh,{onClick:l,$active:i.isActive(n),"data-testid":`${Mr.TEXT_EDITOR_CONTROL}:${n}`,children:[v.jsxs(em,{children:[e&&v.jsx(e,{}),t]}),r&&v.jsx(tm,{children:v.jsx(Eu,{shortcut:r})})]})})}function Hy({editor:n,controls:e,MenuButton:t,inputSettings:r,testId:o,disabled:i}){const[s,a]=h.useState(null),l=d=>{a(d.target)},c=()=>{a(null),n.chain().focus()},u=e.some(({name:d})=>n.isActive(d));return v.jsxs(v.Fragment,{children:[t?v.jsx(t,{onClick:l,editor:n,disabled:i}):v.jsx(aS,{onClick:l,square:!0,active:u,"data-testid":o,disabled:i,children:v.jsx(SM,{})}),v.jsx(vG,{anchorEl:s,open:!!s,onClose:c,children:e.map((d,p)=>"Component"in d?h.createElement(d.Component,{...d,onClose:c,editor:n,key:p,inputSettings:r,"data-testid":`${Mr.TEXT_EDITOR_CONTROL}:${d.name}`,disabled:i}):h.createElement(jG,{...d,onClose:c,editor:n,inputSettings:r,key:p}))})]})}function _G({disabled:n,editor:e,onClick:t}){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(mG,{onClick:t,disabled:n||!o,"data-testid":Mr.TEXT_EDITOR_HEADING_MENU,children:o||"Normal Text"})}var om={},zG=kt;Object.defineProperty(om,"__esModule",{value:!0});var lS=om.default=void 0,HG=zG(Mt()),VG=St();lS=om.default=(0,HG.default)((0,VG.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 im={},UG=kt;Object.defineProperty(im,"__esModule",{value:!0});var cS=im.default=void 0,WG=UG(Mt()),GG=St();cS=im.default=(0,WG.default)((0,GG.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 sm={},KG=kt;Object.defineProperty(sm,"__esModule",{value:!0});var uS=sm.default=void 0,qG=KG(Mt()),YG=St();uS=sm.default=(0,qG.default)((0,YG.jsx)("path",{d:"M15 15H3v2h12zm0-8H3v2h12zM3 13h18v-2H3zm0 8h18v-2H3zM3 3v2h18V3z"}),"FormatAlignLeft");var am={},JG=kt;Object.defineProperty(am,"__esModule",{value:!0});var dS=am.default=void 0,ZG=JG(Mt()),XG=St();dS=am.default=(0,ZG.default)((0,XG.jsx)("path",{d:"M7 15v2h10v-2zm-4 6h18v-2H3zm0-8h18v-2H3zm4-6v2h10V7zM3 3v2h18V3z"}),"FormatAlignCenter");var lm={},QG=kt;Object.defineProperty(lm,"__esModule",{value:!0});var pS=lm.default=void 0,eK=QG(Mt()),tK=St();pS=lm.default=(0,eK.default)((0,tK.jsx)("path",{d:"M3 21h18v-2H3zm6-4h12v-2H9zm-6-4h18v-2H3zm6-4h12V7H9zM3 3v2h18V3z"}),"FormatAlignRight");var cm={},nK=kt;Object.defineProperty(cm,"__esModule",{value:!0});var fS=cm.default=void 0,rK=nK(Mt()),oK=St();fS=cm.default=(0,rK.default)((0,oK.jsx)("path",{d:"M3 21h18v-2H3zm0-4h18v-2H3zm0-4h18v-2H3zm0-4h18V7H3zm0-6v2h18V3z"}),"FormatAlignJustify");var um={},iK=kt;Object.defineProperty(um,"__esModule",{value:!0});var hS=um.default=void 0,sK=iK(Mt()),aK=St();hS=um.default=(0,sK.default)((0,aK.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 dm={},lK=kt;Object.defineProperty(dm,"__esModule",{value:!0});var mS=dm.default=void 0,cK=lK(Mt()),uK=St();mS=dm.default=(0,cK.default)((0,uK.jsx)("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}),"FormatItalic");var pm={},dK=kt;Object.defineProperty(pm,"__esModule",{value:!0});var gS=pm.default=void 0,pK=dK(Mt()),fK=St();gS=pm.default=(0,pK.default)((0,fK.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 fm={},hK=kt;Object.defineProperty(fm,"__esModule",{value:!0});var vS=fm.default=void 0,mK=hK(Mt()),gK=St();vS=fm.default=(0,mK.default)((0,gK.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 hm={},vK=kt;Object.defineProperty(hm,"__esModule",{value:!0});var yS=hm.default=void 0,yK=vK(Mt()),bK=St();yS=hm.default=(0,yK.default)((0,bK.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 mm={},xK=kt;Object.defineProperty(mm,"__esModule",{value:!0});var bS=mm.default=void 0,wK=xK(Mt()),CK=St();bS=mm.default=(0,wK.default)((0,CK.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 gm={},SK=kt;Object.defineProperty(gm,"__esModule",{value:!0});var xS=gm.default=void 0,kK=SK(Mt()),MK=St();xS=gm.default=(0,kK.default)((0,MK.jsx)("path",{d:"M10 19h4v-3h-4zM5 4v3h5v3h4V7h5V4zM3 14h18v-2H3z"}),"FormatStrikethrough");var vm={},EK=kt;Object.defineProperty(vm,"__esModule",{value:!0});var wS=vm.default=void 0,TK=EK(Mt()),OK=St();wS=vm.default=(0,TK.default)((0,OK.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 ym={},LK=kt;Object.defineProperty(ym,"__esModule",{value:!0});var CS=ym.default=void 0,AK=LK(Mt()),PK=St();CS=ym.default=(0,AK.default)((0,PK.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 bm={},DK=kt;Object.defineProperty(bm,"__esModule",{value:!0});var SS=bm.default=void 0,RK=DK(Mt()),IK=St();SS=bm.default=(0,RK.default)((0,IK.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 xm={},$K=kt;Object.defineProperty(xm,"__esModule",{value:!0});var kS=xm.default=void 0,NK=$K(Mt()),BK=St();kS=xm.default=(0,NK.default)((0,BK.jsx)("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"}),"FormatQuote");var wm={},FK=kt;Object.defineProperty(wm,"__esModule",{value:!0});var Cm=wm.default=void 0,jK=FK(Mt()),_K=St();Cm=wm.default=(0,jK.default)((0,_K.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 zK={name:"normal-text",label:"Normal Text",Component:DG,shortcut:{mac:"Cmd+Alt+0",pc:"Ctrl+Alt+0"}},HK={name:"heading-1",label:"Heading 1",Component:RG,shortcut:{mac:"Cmd+Alt+1",pc:"Ctrl+Alt+1"}},VK={name:"heading-2",label:"Heading 2",Component:IG,shortcut:{mac:"Cmd+Alt+2",pc:"Ctrl+Alt+2"}},UK={name:"heading-3",label:"Heading 3",Component:$G,shortcut:{mac:"Cmd+Alt+3",pc:"Ctrl+Alt+3"}},WK={name:"heading-4",label:"Heading 4",Component:NG,shortcut:{mac:"Cmd+Alt+4",pc:"Ctrl+Alt+4"}},GK={name:"heading-5",label:"Heading 5",Component:BG,shortcut:{mac:"Cmd+Alt+5",pc:"Ctrl+Alt+5"}},KK={name:"heading-6",label:"Heading 6",Component:FG,shortcut:{mac:"Cmd+Alt+6",pc:"Ctrl+Alt+6"}},qK={name:"headings",label:"Headings",MenuButton:_G,controls:[zK,HK,VK,UK,WK,GK,KK]},MS={name:"bold",label:"Bold",cmd:({editor:n})=>n.chain().focus().toggleBold().run(),Icon:lS,shortcut:{mac:"Cmd+B",pc:"Ctrl+B"}},ES={name:"italic",label:"Italic",cmd:({editor:n})=>n.chain().focus().toggleItalic().run(),Icon:mS,shortcut:{mac:"Cmd+I",pc:"Ctrl+I"}},TS={name:"underline",label:"Underline",cmd:({editor:n})=>n.chain().focus().toggleUnderline().run(),Icon:bS,shortcut:{mac:"Cmd+U",pc:"Ctrl+U"}},OS={name:"strike",label:"Strikethrough",cmd:({editor:n})=>n.chain().focus().toggleStrike().run(),Icon:xS,shortcut:{mac:"Cmd+Shift+S",pc:"Ctrl+Shift+S"}},LS={name:"superscript",label:"Superscript",cmd:({editor:n})=>n.chain().focus().toggleSuperscript().run(),Icon:wS,shortcut:{mac:"Cmd+.",pc:"Ctrl+."}},AS={name:"subscript",label:"Subscript",cmd:({editor:n})=>n.chain().focus().toggleSubscript().run(),Icon:CS,shortcut:{mac:"Cmd+,",pc:"Ctrl+,"}},PS={name:"clear",label:"Clear Formatting",cmd:({editor:n})=>n.chain().focus().unsetAllMarks().run(),Icon:cS},YK={name:"bulletList",label:"Bullet List",cmd:({editor:n})=>n.chain().focus().toggleBulletList().run(),Icon:sM,shortcut:{mac:"Cmd+Shift+8",pc:"Ctrl+Shift+8"}},JK={name:"orderedList",label:"Ordered List",cmd:({editor:n})=>n.chain().focus().toggleOrderedList().run(),Icon:SS,shortcut:{mac:"Cmd+Shift+7",pc:"Ctrl+Shift+7"}},ZK={name:"alignLeft",label:"Align Left",cmd:({editor:n})=>n.chain().focus().setTextAlign("left").run(),Icon:uS,shortcut:{mac:"Cmd+Shift+L",pc:"Ctrl+Shift+L"}},XK={name:"alignCenter",label:"Align Center",cmd:({editor:n})=>n.chain().focus().setTextAlign("center").run(),Icon:dS,shortcut:{mac:"Cmd+Shift+E",pc:"Ctrl+Shift+E"}},QK={name:"alignRight",label:"Align Right",cmd:({editor:n})=>n.chain().focus().setTextAlign("right").run(),Icon:pS,shortcut:{mac:"Cmd+Shift+R",pc:"Ctrl+Shift+R"}},eq={name:"alignJustify",label:"Align Justify",cmd:({editor:n})=>n.chain().focus().setTextAlign("justify").run(),Icon:fS,shortcut:{mac:"Cmd+Shift+J",pc:"Ctrl+Shift+J"}},DS={name:"link",label:"Link",cmd:({editor:n,inputSettings:{onLink:e,allowedLinkProtocols:t=Yb}})=>{var u;const{view:r}=n,{state:o,state:{selection:{from:i,to:s}}}=r,a=n.isActive("link")&&n.getAttributes("link"),l=a?(u=n.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}}}=n;n.isActive("link")?n.state.doc.nodesBetween(m-1,m,(y,b)=>{if(y.type.name==="text")return n.chain().focus().extendMarkRange("link").setLink({href:qg(d,t),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}):n.chain().insertContentAt({from:m,to:g},f).setTextSelection({from:m,to:m+f.length}).focus().extendMarkRange("link").setLink({href:qg(d,t),target:p?"_blank":""}).run()}})},Icon:gS},RS={name:"linkPreview",label:"Open URL in new tab",cmd:({editor:n})=>{const e=n.state.selection.$to.marks().find(({type:t})=>t.name==="link");!e||!e.attrs.href||window.open(e.attrs.href,"_blank")},Icon:rm},IS={name:"image",label:"Image",cmd:({editor:n,inputSettings:{onImage:e}})=>{const t=n.state.selection.node,r=(t==null?void 0:t.type.name)==="image"?t:void 0,o={src:(r==null?void 0:r.attrs.src)||"",alt:r==null?void 0:r.attrs.alt};e({...o,updateImage:i=>n.chain().focus().setImage(i).run()})},Icon:hS},tq={name:"codeBlock",label:"Code Block",cmd:({editor:n})=>n.chain().focus().toggleCodeBlock().run(),Icon:Cm,shortcut:{mac:"Cmd+Alt+C",pc:"Ctrl+Alt+C"}},nq={name:"blockquote",label:"Quote",cmd:({editor:n})=>n.chain().focus().toggleBlockquote().run(),Icon:kS,shortcut:{mac:"Cmd+Shift+B",pc:"Ctrl+Shift+B"}},rq={name:"undo",label:"Undo",cmd:({editor:n})=>n.chain().focus().undo().run(),Icon:vS,shortcut:{mac:"Cmd+Z",pc:"Ctrl+Z"}},oq={name:"redo",label:"Redo",cmd:({editor:n})=>n.chain().focus().redo().run(),Icon:yS,shortcut:{mac:"Cmd+Y",pc:"Ctrl+Y"}},iq=[ZK,XK,QK,eq,qK,MS,ES,TS,OS,LS,AS,PS,YK,JK,DS,RS,IS,tq,nq,rq,oq];function sq(n){return!("MenuButton"in n)&&!Array.isArray(n)}function $S(n,e){if(typeof n=="string"){const t=iq.find(({name:r})=>r===n);if(t){const r=wl(t.show,{selectionTypes:e});if(Cl(r))return t}}else if(Array.isArray(n)){const t=[];for(const r of n){const o=$S(r,e);if(o){if(!sq(o))throw new Error("Menu controls only allow standard controls as their children.");const i=wl(o.show,{selectionTypes:e});Cl(i)&&t.push(o)}}if(t.length)return t}else{const t=wl(n.show,{selectionTypes:e});if(Cl(t))return n}}function aq(n,e){const t=[];for(const r of n){const o=[];for(const i of r){const s=$S(i,e);s&&o.push(s)}o.length&&t.push(o)}return t}const lq=[{label:"Visual",value:"visual"},{label:"Source",value:"code"}];function cq({mode:n,onChange:e,focus:t}){return v.jsx(yG,{children:lq.map(({value:r,label:o})=>v.jsx(bG,{onClick:()=>e(r),$active:r===n,$focus:t,children:o},r))})}function NS({editor:n,controls:e,selectionTypes:t,inputSettings:r={},disabled:o}){const i=h.useMemo(()=>aq(e,t),[e,t]);return v.jsx(fG,{children:i.map((s,a)=>v.jsx(hG,{children:s.map((l,c)=>Array.isArray(l)?v.jsx(Hy,{editor:n,controls:l,inputSettings:r,testId:`${Mr.TEXT_EDITOR_CONTROL}:menu-${a}-${c}`,disabled:o},c):"MenuButton"in l?v.jsx(Hy,{editor:n,controls:l.controls,MenuButton:l.MenuButton,inputSettings:r,disabled:o},c):"Component"in l?h.createElement(l.Component,{...l,key:c,editor:n,inputSettings:r,"data-testid":`${Mr.TEXT_EDITOR_CONTROL}:${l.name}`,disabled:o}):v.jsx(aS,{onClick:()=>l.cmd({editor:n,inputSettings:r}),label:l.label,shortcut:l.shortcut,active:n.isActive(l.name),square:!0,"data-testid":`${Mr.TEXT_EDITOR_CONTROL}:${l.name}`,disabled:o,children:v.jsx(l.Icon,{})},l.name))},a))})}function uq(){return v.jsx(rG,{className:"tiptap-flex",contentEditable:!1,children:v.jsxs("div",{className:"tiptap-pill",draggable:!0,"data-drag-handle":"",children:[v.jsx(Cm,{})," ","Script"]})})}function BS(n,e){const r=new DOMParser().parseFromString(n,"text/html");return Lf(r.body,e),r.body.innerHTML}const Nl=Wn.create({name:"script",group:"block",content:"inline*",code:!0,draggable:!0,parseHTML(){return[{tag:"script",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:n}){return["span",It({"data-type":this.name},this.options.HTMLAttributes,n),0]},addNodeView(){return lG(uq,{className:"tiptap-block"})}});function dq(n){return n.includes(``)?BS(n,({elem:e})=>{if(!e||e.tagName.toLowerCase()!=="span"||e.getAttribute("data-type")!==Nl.name)return;const t=e.outerHTML.replace(new RegExp(`^`)," - + diff --git a/sb8/qa/project.json b/sb8/qa/project.json index 8e7d413e0c..fcc37c1199 100644 --- a/sb8/qa/project.json +++ b/sb8/qa/project.json @@ -1 +1 @@ -{"generatedAt":1730373646230,"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.8.0"},"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":1730459512549,"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.8.0"},"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"}}}