@okam/directus-flexible-content 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -0
- package/index.js +113 -0
- package/index.mjs +16491 -0
- package/lib/components/FlexibleEditorContent/extensions.d.ts +2 -0
- package/lib/components/FlexibleEditorContent/index.d.ts +14 -0
- package/lib/components/RenderNodes/index.d.ts +13 -0
- package/lib/components/attributes/index.d.ts +2 -0
- package/lib/components/attributes/remapAttributes.d.ts +4 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/nodes/index.d.ts +3 -0
- package/lib/components/nodes/types.d.ts +9 -0
- package/lib/functions/index.d.ts +4 -0
- package/lib/functions/injectDataIntoContent.d.ts +4 -0
- package/lib/functions/mergeSerializers.d.ts +3 -0
- package/lib/functions/renderView.d.ts +4 -0
- package/lib/functions/types.d.ts +29 -0
- package/lib/types.d.ts +18 -0
- package/package.json +15 -0
- package/style.css +1 -0
package/index.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),mo=require("@tanstack/react-query"),ca=require("radash"),ua=require("graphql-request"),T=require("react"),P=require("tailwind-variants"),re=require("react-aria");require("react-use");const lt=require("react-spring");require("react-stately");const pu=require("react-div-100vh");require("@react-aria/utils");require("@react-aria/focus");const hu=require("isomorphic-dompurify");require("@react-aria/i18n");require("lodash");require("react-hook-form");require("@react-aria/checkbox");require("@react-aria/visually-hidden");require("@react-stately/toggle");const G=require("lodash.isequal");require("react-i18next");require("@react-aria/datepicker");require("@react-stately/datepicker");require("@react-aria/calendar");require("@react-stately/calendar");require("@react-aria/overlays");require("next/image");throw new Error("This module cannot be imported from a Client Component module. It should only be used from a Server Component.");function da(n,e){return e}const mu=process.env.NEXT_PUBLIC_GRAPHQL_URL,gu=process.env.NEXT_GRAPHQL_URL_ADMIN,bu=process.env.NEXT_PUBLIC_API_TOKEN??"",yu=process.env.NEXT_PUBLIC_API_TOKEN,wu=new ua.GraphQLClient(mu,{credentials:"include",mode:"cors",fetch,headers:{Authorization:`Bearer ${bu}`}});new ua.GraphQLClient(gu,{credentials:"include",mode:"cors",fetch,headers:{Authorization:`Bearer ${yu}`}});new mo.QueryClient({queryCache:new mo.QueryCache({onError:n=>{console.error(n)}}),defaultOptions:{queries:{staleTime:5*1e3}}});function fa(n,e,t=wu){return t.request(n,{...e})}process.env.NEXT_PUBLIC_GRAPHQL_URL;process.env.NEXT_PUBLIC_API_TOKEN;function Ui(n){return!!n}function vu(n){return!ca.isEmpty(n)&&Object.keys(n).length===1&&Object.keys(n)[0]==="id"&&!!n.id}async function xu(n){const{document:e,blockKey:t,variables:r}=n;if(!e||!Ui(r))return null;const i=await fa(e,r);return!i||typeof i!="object"||!t?null:i[t]}async function Su(n){const{document:e,item:t,blockKey:r,variables:i}=n;if(t){if(!vu(t))return t;const l={id:t.id,...i};return Ui(l)?xu({...n,variables:l}):null}if(!e||!Ui(i))return null;const s=await fa(e,i);return!s||typeof s!="object"||!r?null:s[r]}function Cu(n,...e){return e.reduce((r,i)=>i?{components:{...r.components,...i.components}}:r,n)}const pa={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BlockSettings"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"block_settings"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tokens"}},{kind:"Field",name:{kind:"Name",value:"variant"}}]}}]},Tu=n=>{var b,g,S;const{item:e,collection:t,config:r,variables:i,defaultVariant:s,...o}=n;if(!t||!r)return null;const l=(b=r==null?void 0:r.components)==null?void 0:b[t];if(!l)return null;const{settings:a}=e??{},c=(e==null?void 0:e.id)??(i==null?void 0:i.id);if(!c)return null;const{variant:u}=da(pa,a)??{},d=((g=l.getVariant)==null?void 0:g.call(l,n))??u??s,{default:f,document:p}=l,m=((S=l.variants)==null?void 0:S[d??""])??f;return m?y.jsx(m,{document:p,config:r,collection:t,item:e,...c?{variables:{...i,id:c}}:{variables:i},...o},c):null},ku=n=>n;function Eu(){const n=T.createContext(void 0);function e(){const t=T.useContext(n);return t===void 0?null:t}return[e,n.Provider]}const Mu={typography:()=>""},[Au,Pu]=Eu();function Ou({children:n,brandTheme:e=Mu}){const t=T.useMemo(()=>({brandTheme:e}),[e]);return y.jsx(Pu,{value:t,children:n})}const Ru=n=>({children:t})=>y.jsx(Ou,{brandTheme:n,children:t}),Nu=P.tv({base:"[border-radius: 32px] p-1.5 focus:outline-none text-color-1-500",defaultVariants:{textAlign:"left",isOpen:!1},variants:{textAlign:{center:"text-center",left:"text-left"}}}),Iu=P.tv({base:"grid overflow-hidden w-full items-center border-b-2 border-color-1-500 focus-ring-black",variants:{titleBold:{true:"font-bold"},textAlign:{center:"grid-cols-[3rem_1fr_3rem] pl-0 sm:pl-0",left:"grid-cols-[1fr_3rem]"},bgColor:{gray:"bg-gray-300",white:"bg-white"}},defaultVariants:{titleBold:!1,textAlign:"left",bgColor:"white"}}),Lu=P.tv({base:"",defaultVariants:{textAlign:"left"},variants:{textAlign:{center:"justify-self-center col-start-2",left:"justify-self-start"}}}),_u=P.tv({base:"text-color-1-500 min-h-12 rotate-90 min-w-12 rounded-full flex items-center justify-center transition duration-500 transform ml-auto aspect-square",variants:{isOpen:{true:"-rotate-90",false:""}}}),zu=P.tv({base:`
|
|
2
|
+
font-body
|
|
3
|
+
text-inherit
|
|
4
|
+
h-auto
|
|
5
|
+
grid
|
|
6
|
+
`,defaultVariants:{textAlign:"left"},variants:{textAlign:{center:"grid-cols-[3rem_1fr_3rem] px-6 text-center",left:"grid-cols-[1fr_3rem] text-left"}}}),ju=P.tv({base:"overflow-hidden flex flex-col gap-2 items-start",defaultVariants:{textAlign:"left"},variants:{textAlign:{center:"col-start-2",left:""}}}),Du={container:n=>Nu(n),button:n=>Iu(n),title:n=>Lu(n),icon:n=>_u(n),region:n=>zu(n),content:n=>ju(n)},Nt=P.tv({base:`
|
|
7
|
+
flex
|
|
8
|
+
items-center
|
|
9
|
+
justify-center
|
|
10
|
+
gap-4
|
|
11
|
+
transition
|
|
12
|
+
duration-300
|
|
13
|
+
ease-in-out
|
|
14
|
+
disabled:pointer-events-none
|
|
15
|
+
disabled:opacity-30
|
|
16
|
+
focus-ring-black
|
|
17
|
+
`,defaultVariants:{buttonStyle:"default",type:"button",size:"default",shape:"rounded"},variants:{buttonStyle:{default:`
|
|
18
|
+
px-4
|
|
19
|
+
py-2
|
|
20
|
+
text-white
|
|
21
|
+
!bg-color-1-500
|
|
22
|
+
hover:!bg-color-1-400
|
|
23
|
+
active:!bg-color-1-400
|
|
24
|
+
`,outline:`
|
|
25
|
+
px-4
|
|
26
|
+
py-2
|
|
27
|
+
bg-transparent
|
|
28
|
+
!border-color-1-500
|
|
29
|
+
text-color-1-500
|
|
30
|
+
hover:bg-color-1-500
|
|
31
|
+
hover:text-white
|
|
32
|
+
active:bg-color-1-500
|
|
33
|
+
active:text-white
|
|
34
|
+
`,hollow:`
|
|
35
|
+
px-2
|
|
36
|
+
bg-transparent
|
|
37
|
+
text-color-1-500
|
|
38
|
+
hover:border-b-color-1-500
|
|
39
|
+
active:border-b-color-1-500
|
|
40
|
+
focus:border-b-color-1-500
|
|
41
|
+
|
|
42
|
+
`},intent:{error:`
|
|
43
|
+
!bg-error
|
|
44
|
+
text-white
|
|
45
|
+
pointer-events-none
|
|
46
|
+
!border-error
|
|
47
|
+
`},size:{default:"min-w-12 min-h-6",large:"min-w-36 min-h-18"},shape:{rounded:"rounded-md",circular:"rounded-full"}}}),be=P.tv({variants:{size:{h1:"text-5xl",h2:"text-4xl",h3:"text-3xl",h4:"text-2xl",h5:"text-xl",h6:"text-lg",leading:"text-md font-bold leading-normal",paragraph:"text-md inline",footnotes:"text-sm",xs:"text-xs"},font:{body:"font-body"},weight:{normal:"font-normal",light:"font-light",bold:"font-bold"},color:{gray:"text-gray-500",white:"text-white"},isError:{true:"text-sm text-error py-3"},align:{center:"text-center",left:"text-left",right:"text-right"}},defaultVariants:{size:"paragraph",font:"body"}}),Bu=P.tv({base:"bg-color-1-200 p-4 flex flex-col gap-4"}),$u=P.tv({base:"flex justify-between items-center gap-4 relative"}),Hu=P.tv({extend:Nt,base:"self-end"}),Fu=P.tv({base:"bg-color-1-300 m-2 rounded-lg order-2"}),Vu=P.tv({base:"m-4"}),Wu=P.tv({base:""}),qu=P.tv({base:""}),Gu=P.tv({extend:be,defaultVariants:{size:"h1"}}),Uu=P.tv({extend:be}),Ku=P.tv({base:"block w-min bg-color-1-400 p-2 rounded-lg"}),Ju=P.tv({extend:Nt,variants:{order:{prev:"order-1",next:"order-3"}}}),Yu=P.tv({base:"flex gap-4 justify-center absolute z-10 bottom-4 left-0 right-0"}),Xu=P.tv({base:"w-4 h-4 rounded-full block bg-color-1-600 focus-ring-black",variants:{active:{true:"bg-color-1-100",false:""}}}),Qu={wrapper:Bu,container:$u,closeBtn:Hu,swiper:{swiper:Fu,wrapper:Vu},item:{wrapper:Wu,container:qu,title:Gu,content:Uu,icon:Ku},navigation:{button:Ju},pagination:{wrapper:Yu,bullet:Xu}},Zu=P.tv({base:"w-full bg-slate-100"}),ha=P.tv({base:"max-w-screen-lg mx-auto w-full",variants:{fullWidth:{true:"max-w-full col-span-full p-0"},spacing:{small:"mb-3",medium:"mb-6",large:"mb-8",none:"mb-0"}}}),ed=P.tv({extend:ha,base:"grid grid-cols-12 gap-6 px-4 col-span-full",variants:{fullWidth:{true:"max-w-full col-span-full p-0"}}}),td=P.tv({base:"bg-slate-300 h-64 p-4 flex justify-start items-end",defaultVariants:{size:"small"},variants:{size:{small:"col-span-12 sm:col-span-6 md:col-span-4 lg:col-span-4",medium:"col-span-12 sm:col-span-12 md:col-span-8 lg:col-span-8",large:"lg:col-start-3 sm:col-start-1 sm:col-end-13 lg:col-end-11 md:col-start-3 md:col-end-11 col-start-1 col-end-13"}}}),nd=P.tv({base:"inline-block text-gray-800"}),rd=P.tv({base:"flex items-center justify-between pb-4"}),id=P.tv({base:"flex items-center gap-1"}),sd=P.tv({base:"active:bg-color-1-500 p-2 rounded-full active:text-color-1-100 hover:bg-color-1-200 focus-ring-black"}),od=P.tv({base:"flex-1"}),ld=P.tv({base:"text-center"}),ad=P.tv({base:"py-0.5 relative",variants:{isFocusVisible:{true:"z-10",false:""}}}),cd=P.tv({base:"w-10 h-10 outline-none group",variants:{isSelected:{true:"",false:""},isInvalid:{true:"",fasle:""},isDisabled:{true:"disabled",false:""},isRoundedLeft:{true:"rounded-l-full",false:""},isRoundedRight:{true:"rounded-r-full",false:""}},compoundVariants:[{isSelected:!0,isInvalid:!0,class:"bg-red-300"},{isSelected:!0,isInvalid:!1,class:"bg-color-1-300"}]}),ud=P.tv({base:"w-full h-full rounded-full flex items-center justify-center cursor-pointer",variants:{isSelected:{true:"",false:""},isInvalid:{true:"",fasle:""},isDisabled:{true:"",false:""},isFocusVisible:{true:"ring-2 group-focus:z-2 ring-violet-600 ring-offset-2",false:""},isSelectionStart:{true:"",false:""},isSelectionEnd:{true:"",false:""}},compoundVariants:[{isDisabled:!0,isInvalid:!1,class:"text-gray-400"},{isSelectionStart:!0,isSelectionEnd:!1,isInvalid:!0,class:"bg-red-600 text-white hover:bg-red-700"},{isSelectionStart:!0,isSelectionEnd:!0,isInvalid:!0,class:"bg-red-600 text-white hover:bg-red-700"},{isSelectionStart:!0,isSelectionEnd:!1,isInvalid:!1,class:"bg-color-1-400 text-white hover:bg-color-1-500"},{isSelectionStart:!0,isSelectionEnd:!0,isInvalid:!1,class:"bg-color-1-400 rounded-full text-white hover:bg-color-1-500"},{isSelectionStart:!1,isSelectionEnd:!0,isInvalid:!0,class:"bg-red-600 text-white hover:bg-red-700"},{isSelectionStart:!1,isSelectionEnd:!0,isInvalid:!1,class:"bg-color-1-400 text-white hover:bg-color-1-500"},{isSelected:!1,isDisabled:!1,class:"hover:bg-color-1-100"},{isSelected:!0,isDisabled:!1,isInvalid:!1,isSelectionStart:!1,isSelectionEnd:!1,class:"hover:bg-color-1-300"},{isSelected:!0,isDisabled:!1,isInvalid:!0,isSelectionStart:!1,isSelectionEnd:!1,class:"hover:bg-red-400"}]}),dd=P.tv({base:"flex justify-between items-center relative h-[475px] mb-18 lg:h-[650px]"}),fd=P.tv({base:"bg-color-1-400 !py-4"}),pd=P.tv({base:"bg-color-1-100 py-4"}),hd=P.tv({base:"flex justify-center m-auto px-8 w-full h-full"}),md=P.tv({base:"bg-color-1-200 p-2"}),gd=P.tv({base:"bg-color-1-500 rounded-full p-4 text-white"}),bd={container:dd,slideContainer:hd,slideWrapper:md,navigationButtons:gd,swiper:fd,swiperWrapper:pd},yd=P.tv({base:"flex focus-ring-black"}),wd=P.tv({base:"hover:cursor-pointer",variants:{color:{gray:"text-gray-300",black:"text-black"},isDisabled:{true:"text-gray-6"}},defaultVariants:{color:"black"}}),vd=P.tv({base:"w-6 h-6 mt-0.5 mr-2.5 rounded-full border-2 border-gray-2 shrink-0 hover:cursor-pointer flex items-center justify-center",variants:{isDisabled:{true:"border-gray-6"},isFocused:{true:"outline-black [outline-offset: 2px]"},isError:{true:"border-red-500"}}}),xd=P.tv({base:"hidden w-4 h-4 bg-gray-300 rounded-full",variants:{selected:{true:"block text-white"}}}),Sd=P.tv({base:"text-white w-4 h-4 [&_svg]:w-4 [&_svg]:h-4"}),Cd=P.tv({base:"block",variants:{isDisabled:{true:"opacity-60 pointer-events-none"}}}),Td=P.tv({base:"flex flex-col gap-4 py-8"}),kd=P.tv({base:"relative inline-flex flex-col text-left"}),Ed=P.tv({base:"flex items-center border-2 border-color-1-500 rounded focus-ring-black"}),Md=P.tv({base:"fixed inset-0"}),Ad=P.tv({base:"absolute top-full bg-white border border-gray-300 rounded-md shadow-lg mt-2 p-8 z-10"}),Pd=P.tv({base:"pr-1 flex gap-2",defaultVariants:{dateFieldShown:!0},variants:{dateFieldShown:{true:"",false:"hidden"}}}),Od=P.tv({base:"focus-ring-black"}),Rd=P.tv({base:"text-color-1-500 bg-color-1-100 border-l-2 border-color-1-500 h-full py-2 px-2"}),Nd=P.tv({base:"text-color-1-500 font-bold px-2"}),Id=P.tv({base:"object-contain"}),Ld=n=>Id(n),_d=P.tv({base:"focus-ring-black"}),zd=P.tv({base:"rounded-3xl overflow-hidden"}),jd=P.tv({base:`
|
|
48
|
+
absolute
|
|
49
|
+
xl:top-10
|
|
50
|
+
xl:right-20
|
|
51
|
+
lg:top-8
|
|
52
|
+
lg:right-8
|
|
53
|
+
z-[10000]
|
|
54
|
+
top-4
|
|
55
|
+
right-4
|
|
56
|
+
size-10
|
|
57
|
+
focus-ring-black
|
|
58
|
+
`}),Dd=P.tv({extend:be,base:"sr-only"}),Bd=P.tv({base:"w-screen h-screen bg-black/50 absolute top-0 left-0 flex justify-center items-center"}),$d=P.tv({base:""}),Hd=P.tv({base:"flex flex-col gap-4 items-center"}),Fd={wrapper:_d,container:zd,label:Dd,closeBtn:jd,modal:{underlay:Bd,overlay:$d,dialog:Hd}},Vd=P.tv({base:"text-black flex flex-row items-center hover:cursor-pointer focus-ring-black",variants:{isDisabled:{true:"text-gray-6"}}}),Wd=P.tv({base:"w-6 h-6 mt-0.5 mr-2.5 rounded-full border-2 border-gray-2 shrink-0 hover:cursor-pointer flex items-center justify-center",variants:{isDisabled:{true:"border-gray-6"},isFocused:{true:"outline-black [outline-offset: 2px]"}}}),qd=P.tv({base:"hidden w-4 h-4 bg-gray-300 rounded-full",variants:{selected:{true:"block text-white"}}}),Gd=P.tv({base:"block",variants:{isDisabled:{true:"opacity-60 pointer-events-none"}}}),Ud=P.tv({base:"flex flex-col gap-4 py-8"}),Kd=P.tv({base:"p-4 w-full outline-0 search-cancel:appearance-none",variants:{isDisabled:{true:"opacity-60 pointer-events-none"}}}),Jd=P.tv({base:`
|
|
59
|
+
box-border
|
|
60
|
+
absolute
|
|
61
|
+
right-4
|
|
62
|
+
focus-ring-black
|
|
63
|
+
outline-0
|
|
64
|
+
`}),Yd=P.tv({base:"flex print:hidden relative",defaultVariants:{listDirection:"row"},variants:{listDirection:{row:"flex-row",column:"flex-col"}}}),Xd=P.tv({base:"relative z-20 !bg-color-1-500 hover:!bg-color-1-400 w-16 h-16 flex justify-center items-center active:!bg-color-1-400 rounded-full text-white focus-ring-black",variants:{isOpen:{true:"",false:""}}}),Qd=P.tv({base:"!bg-color-1-200 absolute opacity-0 invisible flex transition duration-300 items-center p-0 bg-primary-1 z-0 rounded-b-full rounded-t-full",defaultVariants:{listDirection:"row"},variants:{listDirection:{row:"flex-row pl-14 h-16 left-0",column:"flex-col [width:calc(100% + .5rem)] pt-14 w-16 top-0"},isOpen:{true:"opacity-100 visible",false:""}}}),Zd=P.tv({base:`
|
|
65
|
+
flex
|
|
66
|
+
items-center
|
|
67
|
+
justify-center
|
|
68
|
+
cursor-pointer
|
|
69
|
+
bg-color-1-200
|
|
70
|
+
hover:bg-color-1-300
|
|
71
|
+
w-full
|
|
72
|
+
text-color-1-500
|
|
73
|
+
rounded-none
|
|
74
|
+
p-2
|
|
75
|
+
focus-ring-black
|
|
76
|
+
z-10
|
|
77
|
+
has-focus-ring:z-20
|
|
78
|
+
`,defaultVariants:{listDirection:"row"},variants:{listDirection:{row:"last:rounded-r-full h-full",column:"last:rounded-b-full"}}}),ef=P.tv({base:"text-white"}),tf=P.tv({base:""}),nf=P.tv({base:"m-auto fixed right-0 top-0 bottom-0 w-full max-w-[512px] [&>div]:h-full"}),rf=P.tv({base:"h-full w-full flex justify-end"}),sf=P.tv({base:"bg-black h-full w-full overflow-y-auto"}),of=P.tv({base:`
|
|
79
|
+
w-full
|
|
80
|
+
min-h-32
|
|
81
|
+
rounded-2xl
|
|
82
|
+
px-6
|
|
83
|
+
h-12
|
|
84
|
+
border-2
|
|
85
|
+
border-solid
|
|
86
|
+
transition
|
|
87
|
+
duration-300
|
|
88
|
+
ease-in-out
|
|
89
|
+
text-gray-2
|
|
90
|
+
placeholder:text-gray-2
|
|
91
|
+
focus-ring-black
|
|
92
|
+
|
|
93
|
+
`,variants:{isError:{true:"border-red-500"}}}),lf=ku({main:n=>Zu(n),gridItem:n=>td(n),grid:n=>ed(n),container:n=>ha(n),accordion:Du,carousel:bd,calendar:{container:n=>nd(n),header:n=>rd(n),navigationButtonsContainer:n=>id(n),navigationButtons:n=>sd(n),table:n=>od(n),dayLabel:n=>ld(n),cellContainer:n=>ad(n),cell:n=>cd(n),cellDate:n=>ud(n)},datePicker:{container:n=>kd(n),button:n=>Ed(n),icon:n=>Rd(n),dateField:n=>Pd(n),dateSegment:n=>Od(n),label:n=>Nd(n),calendarPopover:n=>Ad(n),calendarUnderlay:n=>Md(n)},popover:{button:n=>Nt(n),popover:()=>"border-2 text-black p-4 bg-gray-300"},typography:n=>be(n),button:n=>Nt(n),sidePanel:{wrapper:n=>nf(n),container:n=>rf(n),innerContainer:n=>sf(n)},lightBox:Fd,shareButton:{icon:n=>ef(n),button:n=>Xd(n),container:n=>Yd(n),linksList:n=>Qd(n),link:n=>Zd(n),linkIcons:n=>tf(n)},checkbox:{container:n=>yd(n),label:n=>wd(n),checkBox:n=>vd(n),checkMark:n=>xd(n),checkMarkIcon:n=>Sd(n),errorMessage:n=>be(n)},radio:{label:n=>Vd(n),radio:n=>Wd(n),selectedMark:n=>qd(n),errorMessage:n=>be(n)},radioGroup:{radioGroup:n=>Gd(n),radioGroupItemsGroup:n=>Ud(n),errorMessage:n=>be(n)},checkboxGroup:{checkboxGroup:n=>Cd(n),checkboxGroupItemsGroup:n=>Td(n),errormessage:n=>be(n)},select:{button:n=>Nt(n),ul:n=>be({...n,className:"outline outline-2 outline-white outline-offset-2 p-2 my-4 rounded-md w-full flex flex-col gap-6"}),popover:n=>Nt({...n,className:"w-[var(--select-container-width)]"}),errorMessage:n=>be({...n,size:"footnotes",isError:!0}),wrapper:()=>"flex flex-col gap-4 relative",container:()=>"flex flex-col gap-4",li:()=>"transition w-full hover:text-gray-300 focus-ring-white"},textarea:{wrapper:()=>"flex flex-col",container:()=>"flex items-center gap-4",label:()=>"text-gray-3 px-6",input:n=>of(n),errorMessage:n=>be({...n,size:"footnotes",isError:!0})},search:{wrapper:()=>"min-w-fit sm:w-80 flex flex-col gap-2",container:()=>"relative flex items-center outline outline-2 outline-gray-300 focus-within:outline focus-within:outline-black focus-within:outline-2",label:()=>"text-gray-3",input:n=>Kd(n),icon:n=>Jd(n),errorMessage:n=>be({...n,size:"footnotes",isError:!0})},textInput:{wrapper:()=>"group flex flex-col rounded-md px-4 py-1 mb-3 m-0.5 border-2 aria-disabled:pointer-events-none aria-disabled:opacity-30 focus-ring-black",label:()=>'group-has-[:required]:after:content-["_*"] group-has-[:required]:after:text-red-500 text-xs',container:()=>"flex items-center gap-4",input:()=>"",errorMessage:n=>be({...n,className:"ml-0",size:"footnotes",isError:!0})},menu:{sidePanel:{wrapper:()=>"",container:()=>"",innerContainer:()=>""},wrapper:()=>""},menuItem:{wrapper:()=>"",container:()=>"",innerContent:()=>"",button:()=>"",anchor:()=>""},img:Ld,alerts:Qu});T.memo(Ru(lf));const Oe=(n,e={},t=null)=>{const r=Au();if(r!=null&&n!=null){const{brandTheme:i}=r,s=ca.get(i,n);if(typeof s=="function"){const o=s==null?void 0:s(e);if(typeof o=="string")return o}}if(t)return t},af=({as:n="span",themeName:e="typography",tokens:t,customTheme:r,children:i,...s})=>{const o=Oe(e,t,r);return y.jsx(n,{...s,className:o,children:i})};T.forwardRef((n,e)=>{const{as:t="span",tokens:r,themeName:i="typography",customTheme:s,children:o,...l}=n,a=Oe(i,r,s);return y.jsx(t,{...l,ref:e,className:a,children:o})});function ks(){const n=T.createContext(void 0);function e(){const t=T.useContext(n);if(t===void 0)throw new Error("useCtx must be inside a Provider");return t}return[e,n.Provider]}function Es(){const n=T.createContext(void 0);function e(){const t=T.useContext(n);return t===void 0?{}:t}return[e,n.Provider]}Es();const Ms=({as:n="div",themeName:e="box",tokens:t,customTheme:r,children:i,className:s,...o})=>{const l=Oe(e,t,r);return y.jsx(n,{...o,className:l,children:i})},As=T.forwardRef((n,e)=>{const{as:t="div",tokens:r,themeName:i="box",customTheme:s,children:o,...l}=n,a=Oe(i,r,s);return y.jsx(t,{...l,ref:e,className:a,children:o})}),ma=T.forwardRef((n,e)=>{var h;const{as:t="a",handlePress:r,children:i,as:s,customTheme:o,tokens:l,themeName:a="button",nextLinkProps:c,...u}=n,d=e,{linkProps:f}=re.useLink({...n,...c,href:n.href??((h=c==null?void 0:c.href)==null?void 0:h.toString()),elementType:s==null?void 0:s.toString(),onPress:r},e??d),p=Oe(a,l,o);return y.jsx(re.FocusRing,{focusRingClass:"has-focus-ring",children:y.jsx(t,{ref:d,...f,...c,...u,className:p,children:i})})}),ga=T.forwardRef((n,e)=>{const{as:t="button",handlePress:r,children:i,as:s,customTheme:o,tokens:l,themeName:a="button",isDisabled:c=!1,...u}=n,d=e,{buttonProps:f}=re.useButton({...n,isDisabled:c,elementType:s,onPress:r},e??d),p=Oe(a,l,o);return y.jsx(re.FocusRing,{within:!0,focusRingClass:"has-focus-ring",children:y.jsx(t,{ref:d,...f,...u,className:p,children:i})})}),ba=T.forwardRef((n,e)=>{const{as:t}=n;return t==="a"?y.jsx(ma,{ref:e,...n}):y.jsx(ga,{ref:e,...n})}),cf=n=>{const{as:e}=n,t=T.useRef(null);return e==="a"?y.jsx(ma,{ref:t,...n}):y.jsx(ga,{ref:t,...n})};T.memo(cf);const uf=(n,e,t)=>{const r=n[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((i,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==t?". Note that variables only represent file names one level deep.":""))))})},df=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:48,width:48,fill:"currentColor",...n}),ya=T.memo(df),ff=Object.freeze(Object.defineProperty({__proto__:null,default:ya},Symbol.toStringTag,{value:"Module"})),pf=n=>{const{icon:e,...t}=n,r=T.useMemo(()=>T.lazy(()=>uf(Object.assign({"../icons/ArrowDown.tsx":()=>Promise.resolve().then(()=>$h),"../icons/ArrowLeft.tsx":()=>Promise.resolve().then(()=>Vh),"../icons/ArrowRight.tsx":()=>Promise.resolve().then(()=>Gh),"../icons/Check.tsx":()=>Promise.resolve().then(()=>Jh),"../icons/ChevronLeft.tsx":()=>Promise.resolve().then(()=>Qh),"../icons/ChevronRight.tsx":()=>Promise.resolve().then(()=>tm),"../icons/CloseBtn.tsx":()=>Promise.resolve().then(()=>th),"../icons/Facebook.tsx":()=>Promise.resolve().then(()=>im),"../icons/FacebookColored.tsx":()=>Promise.resolve().then(()=>lm),"../icons/FacebookRounded.tsx":()=>Promise.resolve().then(()=>um),"../icons/Globe.tsx":()=>Promise.resolve().then(()=>pm),"../icons/IconFallback.tsx":()=>Promise.resolve().then(()=>ff),"../icons/Instagram.tsx":()=>Promise.resolve().then(()=>gm),"../icons/InstagramColored.tsx":()=>Promise.resolve().then(()=>wm),"../icons/Link.tsx":()=>Promise.resolve().then(()=>Sm),"../icons/LinkedIn.tsx":()=>Promise.resolve().then(()=>km),"../icons/Mail.tsx":()=>Promise.resolve().then(()=>Am),"../icons/Plus.tsx":()=>Promise.resolve().then(()=>Rm),"../icons/Search.tsx":()=>Promise.resolve().then(()=>ih),"../icons/Share.tsx":()=>Promise.resolve().then(()=>Lm),"../icons/Twitter.tsx":()=>Promise.resolve().then(()=>jm),"../icons/TwitterColored.tsx":()=>Promise.resolve().then(()=>$m),"../icons/Upload.tsx":()=>Promise.resolve().then(()=>Vm),"../icons/X.tsx":()=>Promise.resolve().then(()=>Gm),"../icons/YouTube.tsx":()=>Promise.resolve().then(()=>Jm),"../icons/YouTubeColored.tsx":()=>Promise.resolve().then(()=>Qm)}),`../icons/${e||"ArrowRight"}.tsx`,3)),[e]);return y.jsx(T.Suspense,{fallback:y.jsx(ya,{className:"overflow-visible pointer-events-none"}),children:y.jsx(r,{...t,className:"overflow-visible pointer-events-none",...n})})},Ps=n=>{const{icon:e,as:t="span",tokens:r,customTheme:i,themeName:s="icon",children:o,...l}=n,a=Oe(s,r,i);return typeof e!="string"?y.jsxs(t,{...l,className:a,children:[o,e]}):y.jsxs(t,{className:a,children:[o,y.jsx(pf,{icon:e,...l})]})},[hf,Uw]=ks(),mf=({isVisible:n,children:e})=>lt.useTransition(n,{from:{opacity:0,translateX:"100%"},enter:{opacity:1,translateX:"0%"},leave:{opacity:0,translateX:"25%"}})((r,i)=>i&&y.jsx(lt.animated.div,{style:r,children:e})),gf="fixed",bf=({isVisible:n,children:e})=>lt.useTransition(n,{from:{opacity:0,position:gf,left:0,top:0,zIndex:1e3,bottom:0,height:"100%"},enter:{opacity:1},leave:{opacity:0},config:lt.config.stiff})((r,i)=>i&&y.jsx(lt.animated.div,{style:r,children:e})),yf=({isVisible:n,children:e})=>lt.useTransition(n,{from:{opacity:0,scale:.75},enter:{opacity:1,scale:1},leave:{opacity:0,scale:.75},config:lt.config.stiff})((r,i)=>i&&y.jsx(lt.animated.div,{style:{position:"fixed",left:0,top:0,bottom:0,zIndex:1e3,width:"100%",height:"100%",...r},children:e})),wf=n=>{const{children:e,themeName:t,tokens:r,customTheme:i}=n,s=T.useRef(null),{dialogProps:o}=re.useDialog(n,s);return y.jsx(As,{themeName:`${t}.dialog`,tokens:r,customTheme:i,ref:s,"aria-modal":!0,...o,children:y.jsx(re.FocusRing,{focusRingClass:"has-focus-ring",within:!0,autoFocus:!0,children:y.jsx(re.FocusScope,{contain:!0,restoreFocus:!0,autoFocus:!0,children:e})})})},vf=n=>{const{themeName:e,tokens:t,customTheme:r,children:i,state:s,...o}=n,l=T.useRef(null),{modalProps:a,underlayProps:c}=re.useModalOverlay(o,s,l);return y.jsx(Ms,{themeName:`${e}.underlay`,tokens:t,customTheme:r,...c,children:y.jsx(As,{ref:l,themeName:`${e}.overlay`,tokens:t,...a,children:i})})},xf=n=>{const{children:e,transitionComponent:t=yf,state:r,themeName:i,tokens:s,...o}=n;return y.jsx(re.OverlayContainer,{children:y.jsx(t,{isVisible:r.isOpen,children:y.jsx(vf,{themeName:i,tokens:s,state:r,...o,children:y.jsx(wf,{themeName:i,tokens:s,...o,children:e})})})})},Sf=n=>{const{children:e,closeBtnRender:t,themeName:r="sidePanel",tokens:i,TransitionAnimation:s=mf,PanelTransition:o=bf,customTheme:l}=n,a=Oe(`${r}.wrapper`,i,l),c=Oe(`${r}.container`,i,l),u=Oe(`${r}.innerContainer`,i,l),{overlayState:d,overlayProps:f}=hf();return y.jsx(xf,{state:d,...f,transitionComponent:o,isDismissable:!0,children:y.jsxs(pu,{className:a,children:[t&&t(),y.jsx(s,{isVisible:d.isOpen,children:y.jsx("div",{className:c,children:y.jsx("div",{className:u,children:e})})})]})})};T.memo(Sf);T.forwardRef((n,e)=>{const{isOpen:t,onClose:r,children:i,positionProps:s,themeName:o="popover",tokens:l,customTheme:a,isDismissable:c,shouldCloseOnBlur:u,...d}=n,{overlayProps:f}=re.useOverlay({isDismissable:c,shouldCloseOnBlur:u,isOpen:t,onClose:r},e),{modalProps:p}=re.useModal(),{dialogProps:h}=re.useDialog({},e),m=Oe(`${o}.popover`,l,a);return y.jsx(re.FocusScope,{autoFocus:!0,restoreFocus:!0,contain:!0,children:y.jsxs(As,{customTheme:m,...re.mergeProps(f,p,h),ref:e,...s,...d,children:[T.Children.map(i,b=>y.jsx(re.FocusRing,{focusRingClass:"has-focus-ring",children:b})),y.jsx(re.DismissButton,{onDismiss:r})]})})});function go(n){return n!==null&&typeof n=="object"&&"constructor"in n&&n.constructor===Object}function Os(n,e){n===void 0&&(n={}),e===void 0&&(e={}),Object.keys(e).forEach(t=>{typeof n[t]>"u"?n[t]=e[t]:go(e[t])&&go(n[t])&&Object.keys(e[t]).length>0&&Os(n[t],e[t])})}const wa={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Ft(){const n=typeof document<"u"?document:{};return Os(n,wa),n}const Cf={document:wa,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(n){return typeof setTimeout>"u"?(n(),null):setTimeout(n,0)},cancelAnimationFrame(n){typeof setTimeout>"u"||clearTimeout(n)}};function Se(){const n=typeof window<"u"?window:{};return Os(n,Cf),n}function Tf(n){return n===void 0&&(n=""),n.trim().split(" ").filter(e=>!!e.trim())}function kf(n){const e=n;Object.keys(e).forEach(t=>{try{e[t]=null}catch{}try{delete e[t]}catch{}})}function Ki(n,e){return e===void 0&&(e=0),setTimeout(n,e)}function Jn(){return Date.now()}function Ef(n){const e=Se();let t;return e.getComputedStyle&&(t=e.getComputedStyle(n,null)),!t&&n.currentStyle&&(t=n.currentStyle),t||(t=n.style),t}function Mf(n,e){e===void 0&&(e="x");const t=Se();let r,i,s;const o=Ef(n);return t.WebKitCSSMatrix?(i=o.transform||o.webkitTransform,i.split(",").length>6&&(i=i.split(", ").map(l=>l.replace(",",".")).join(", ")),s=new t.WebKitCSSMatrix(i==="none"?"":i)):(s=o.MozTransform||o.OTransform||o.MsTransform||o.msTransform||o.transform||o.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),r=s.toString().split(",")),e==="x"&&(t.WebKitCSSMatrix?i=s.m41:r.length===16?i=parseFloat(r[12]):i=parseFloat(r[4])),e==="y"&&(t.WebKitCSSMatrix?i=s.m42:r.length===16?i=parseFloat(r[13]):i=parseFloat(r[5])),i||0}function bn(n){return typeof n=="object"&&n!==null&&n.constructor&&Object.prototype.toString.call(n).slice(8,-1)==="Object"}function Af(n){return typeof window<"u"&&typeof window.HTMLElement<"u"?n instanceof HTMLElement:n&&(n.nodeType===1||n.nodeType===11)}function we(){const n=Object(arguments.length<=0?void 0:arguments[0]),e=["__proto__","constructor","prototype"];for(let t=1;t<arguments.length;t+=1){const r=t<0||arguments.length<=t?void 0:arguments[t];if(r!=null&&!Af(r)){const i=Object.keys(Object(r)).filter(s=>e.indexOf(s)<0);for(let s=0,o=i.length;s<o;s+=1){const l=i[s],a=Object.getOwnPropertyDescriptor(r,l);a!==void 0&&a.enumerable&&(bn(n[l])&&bn(r[l])?r[l].__swiper__?n[l]=r[l]:we(n[l],r[l]):!bn(n[l])&&bn(r[l])?(n[l]={},r[l].__swiper__?n[l]=r[l]:we(n[l],r[l])):n[l]=r[l])}}}return n}function yn(n,e,t){n.style.setProperty(e,t)}function va(n){let{swiper:e,targetPosition:t,side:r}=n;const i=Se(),s=-e.translate;let o=null,l;const a=e.params.speed;e.wrapperEl.style.scrollSnapType="none",i.cancelAnimationFrame(e.cssModeFrameID);const c=t>s?"next":"prev",u=(f,p)=>c==="next"&&f>=p||c==="prev"&&f<=p,d=()=>{l=new Date().getTime(),o===null&&(o=l);const f=Math.max(Math.min((l-o)/a,1),0),p=.5-Math.cos(f*Math.PI)/2;let h=s+p*(t-s);if(u(h,t)&&(h=t),e.wrapperEl.scrollTo({[r]:h}),u(h,t)){e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout(()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[r]:h})}),i.cancelAnimationFrame(e.cssModeFrameID);return}e.cssModeFrameID=i.requestAnimationFrame(d)};d()}function Ye(n,e){return e===void 0&&(e=""),[...n.children].filter(t=>t.matches(e))}function Yn(n){try{console.warn(n);return}catch{}}function Ji(n,e){e===void 0&&(e=[]);const t=document.createElement(n);return t.classList.add(...Array.isArray(e)?e:Tf(e)),t}function Pf(n,e){const t=[];for(;n.previousElementSibling;){const r=n.previousElementSibling;e?r.matches(e)&&t.push(r):t.push(r),n=r}return t}function Of(n,e){const t=[];for(;n.nextElementSibling;){const r=n.nextElementSibling;e?r.matches(e)&&t.push(r):t.push(r),n=r}return t}function rt(n,e){return Se().getComputedStyle(n,null).getPropertyValue(e)}function bo(n){let e=n,t;if(e){for(t=0;(e=e.previousSibling)!==null;)e.nodeType===1&&(t+=1);return t}}function Rf(n,e){const t=[];let r=n.parentElement;for(;r;)t.push(r),r=r.parentElement;return t}function yo(n,e,t){const r=Se();return n[e==="width"?"offsetWidth":"offsetHeight"]+parseFloat(r.getComputedStyle(n,null).getPropertyValue(e==="width"?"margin-right":"margin-top"))+parseFloat(r.getComputedStyle(n,null).getPropertyValue(e==="width"?"margin-left":"margin-bottom"))}let Jr;function Nf(){const n=Se(),e=Ft();return{smoothScroll:e.documentElement&&e.documentElement.style&&"scrollBehavior"in e.documentElement.style,touch:!!("ontouchstart"in n||n.DocumentTouch&&e instanceof n.DocumentTouch)}}function xa(){return Jr||(Jr=Nf()),Jr}let Yr;function If(n){let{userAgent:e}=n===void 0?{}:n;const t=xa(),r=Se(),i=r.navigator.platform,s=e||r.navigator.userAgent,o={ios:!1,android:!1},l=r.screen.width,a=r.screen.height,c=s.match(/(Android);?[\s\/]+([\d.]+)?/);let u=s.match(/(iPad).*OS\s([\d_]+)/);const d=s.match(/(iPod)(.*OS\s([\d_]+))?/),f=!u&&s.match(/(iPhone\sOS|iOS)\s([\d_]+)/),p=i==="Win32";let h=i==="MacIntel";const m=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!u&&h&&t.touch&&m.indexOf(`${l}x${a}`)>=0&&(u=s.match(/(Version)\/([\d.]+)/),u||(u=[0,1,"13_0_0"]),h=!1),c&&!p&&(o.os="android",o.android=!0),(u||f||d)&&(o.os="ios",o.ios=!0),o}function Sa(n){return n===void 0&&(n={}),Yr||(Yr=If(n)),Yr}let Xr;function Lf(){const n=Se(),e=Sa();let t=!1;function r(){const l=n.navigator.userAgent.toLowerCase();return l.indexOf("safari")>=0&&l.indexOf("chrome")<0&&l.indexOf("android")<0}if(r()){const l=String(n.navigator.userAgent);if(l.includes("Version/")){const[a,c]=l.split("Version/")[1].split(" ")[0].split(".").map(u=>Number(u));t=a<16||a===16&&c<2}}const i=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(n.navigator.userAgent),s=r(),o=s||i&&e.ios;return{isSafari:t||s,needPerspectiveFix:t,need3dFix:o,isWebView:i}}function _f(){return Xr||(Xr=Lf()),Xr}function zf(n){let{swiper:e,on:t,emit:r}=n;const i=Se();let s=null,o=null;const l=()=>{!e||e.destroyed||!e.initialized||(r("beforeResize"),r("resize"))},a=()=>{!e||e.destroyed||!e.initialized||(s=new ResizeObserver(d=>{o=i.requestAnimationFrame(()=>{const{width:f,height:p}=e;let h=f,m=p;d.forEach(b=>{let{contentBoxSize:g,contentRect:S,target:w}=b;w&&w!==e.el||(h=S?S.width:(g[0]||g).inlineSize,m=S?S.height:(g[0]||g).blockSize)}),(h!==f||m!==p)&&l()})}),s.observe(e.el))},c=()=>{o&&i.cancelAnimationFrame(o),s&&s.unobserve&&e.el&&(s.unobserve(e.el),s=null)},u=()=>{!e||e.destroyed||!e.initialized||r("orientationchange")};t("init",()=>{if(e.params.resizeObserver&&typeof i.ResizeObserver<"u"){a();return}i.addEventListener("resize",l),i.addEventListener("orientationchange",u)}),t("destroy",()=>{c(),i.removeEventListener("resize",l),i.removeEventListener("orientationchange",u)})}function jf(n){let{swiper:e,extendParams:t,on:r,emit:i}=n;const s=[],o=Se(),l=function(u,d){d===void 0&&(d={});const f=o.MutationObserver||o.WebkitMutationObserver,p=new f(h=>{if(e.__preventObserver__)return;if(h.length===1){i("observerUpdate",h[0]);return}const m=function(){i("observerUpdate",h[0])};o.requestAnimationFrame?o.requestAnimationFrame(m):o.setTimeout(m,0)});p.observe(u,{attributes:typeof d.attributes>"u"?!0:d.attributes,childList:typeof d.childList>"u"?!0:d.childList,characterData:typeof d.characterData>"u"?!0:d.characterData}),s.push(p)},a=()=>{if(e.params.observer){if(e.params.observeParents){const u=Rf(e.hostEl);for(let d=0;d<u.length;d+=1)l(u[d])}l(e.hostEl,{childList:e.params.observeSlideChildren}),l(e.wrapperEl,{attributes:!1})}},c=()=>{s.forEach(u=>{u.disconnect()}),s.splice(0,s.length)};t({observer:!1,observeParents:!1,observeSlideChildren:!1}),r("init",a),r("destroy",c)}var Df={on(n,e,t){const r=this;if(!r.eventsListeners||r.destroyed||typeof e!="function")return r;const i=t?"unshift":"push";return n.split(" ").forEach(s=>{r.eventsListeners[s]||(r.eventsListeners[s]=[]),r.eventsListeners[s][i](e)}),r},once(n,e,t){const r=this;if(!r.eventsListeners||r.destroyed||typeof e!="function")return r;function i(){r.off(n,i),i.__emitterProxy&&delete i.__emitterProxy;for(var s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];e.apply(r,o)}return i.__emitterProxy=e,r.on(n,i,t)},onAny(n,e){const t=this;if(!t.eventsListeners||t.destroyed||typeof n!="function")return t;const r=e?"unshift":"push";return t.eventsAnyListeners.indexOf(n)<0&&t.eventsAnyListeners[r](n),t},offAny(n){const e=this;if(!e.eventsListeners||e.destroyed||!e.eventsAnyListeners)return e;const t=e.eventsAnyListeners.indexOf(n);return t>=0&&e.eventsAnyListeners.splice(t,1),e},off(n,e){const t=this;return!t.eventsListeners||t.destroyed||!t.eventsListeners||n.split(" ").forEach(r=>{typeof e>"u"?t.eventsListeners[r]=[]:t.eventsListeners[r]&&t.eventsListeners[r].forEach((i,s)=>{(i===e||i.__emitterProxy&&i.__emitterProxy===e)&&t.eventsListeners[r].splice(s,1)})}),t},emit(){const n=this;if(!n.eventsListeners||n.destroyed||!n.eventsListeners)return n;let e,t,r;for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return typeof s[0]=="string"||Array.isArray(s[0])?(e=s[0],t=s.slice(1,s.length),r=n):(e=s[0].events,t=s[0].data,r=s[0].context||n),t.unshift(r),(Array.isArray(e)?e:e.split(" ")).forEach(a=>{n.eventsAnyListeners&&n.eventsAnyListeners.length&&n.eventsAnyListeners.forEach(c=>{c.apply(r,[a,...t])}),n.eventsListeners&&n.eventsListeners[a]&&n.eventsListeners[a].forEach(c=>{c.apply(r,t)})}),n}};function Bf(){const n=this;let e,t;const r=n.el;typeof n.params.width<"u"&&n.params.width!==null?e=n.params.width:e=r.clientWidth,typeof n.params.height<"u"&&n.params.height!==null?t=n.params.height:t=r.clientHeight,!(e===0&&n.isHorizontal()||t===0&&n.isVertical())&&(e=e-parseInt(rt(r,"padding-left")||0,10)-parseInt(rt(r,"padding-right")||0,10),t=t-parseInt(rt(r,"padding-top")||0,10)-parseInt(rt(r,"padding-bottom")||0,10),Number.isNaN(e)&&(e=0),Number.isNaN(t)&&(t=0),Object.assign(n,{width:e,height:t,size:n.isHorizontal()?e:t}))}function $f(){const n=this;function e(M,I){return parseFloat(M.getPropertyValue(n.getDirectionLabel(I))||0)}const t=n.params,{wrapperEl:r,slidesEl:i,size:s,rtlTranslate:o,wrongRTL:l}=n,a=n.virtual&&t.virtual.enabled,c=a?n.virtual.slides.length:n.slides.length,u=Ye(i,`.${n.params.slideClass}, swiper-slide`),d=a?n.virtual.slides.length:u.length;let f=[];const p=[],h=[];let m=t.slidesOffsetBefore;typeof m=="function"&&(m=t.slidesOffsetBefore.call(n));let b=t.slidesOffsetAfter;typeof b=="function"&&(b=t.slidesOffsetAfter.call(n));const g=n.snapGrid.length,S=n.slidesGrid.length;let w=t.spaceBetween,v=-m,x=0,C=0;if(typeof s>"u")return;typeof w=="string"&&w.indexOf("%")>=0?w=parseFloat(w.replace("%",""))/100*s:typeof w=="string"&&(w=parseFloat(w)),n.virtualSize=-w,u.forEach(M=>{o?M.style.marginLeft="":M.style.marginRight="",M.style.marginBottom="",M.style.marginTop=""}),t.centeredSlides&&t.cssMode&&(yn(r,"--swiper-centered-offset-before",""),yn(r,"--swiper-centered-offset-after",""));const O=t.grid&&t.grid.rows>1&&n.grid;O?n.grid.initSlides(u):n.grid&&n.grid.unsetSlides();let k;const N=t.slidesPerView==="auto"&&t.breakpoints&&Object.keys(t.breakpoints).filter(M=>typeof t.breakpoints[M].slidesPerView<"u").length>0;for(let M=0;M<d;M+=1){k=0;let I;if(u[M]&&(I=u[M]),O&&n.grid.updateSlide(M,I,u),!(u[M]&&rt(I,"display")==="none")){if(t.slidesPerView==="auto"){N&&(u[M].style[n.getDirectionLabel("width")]="");const _=getComputedStyle(I),L=I.style.transform,$=I.style.webkitTransform;if(L&&(I.style.transform="none"),$&&(I.style.webkitTransform="none"),t.roundLengths)k=n.isHorizontal()?yo(I,"width"):yo(I,"height");else{const V=e(_,"width"),ee=e(_,"padding-left"),me=e(_,"padding-right"),de=e(_,"margin-left"),W=e(_,"margin-right"),fe=_.getPropertyValue("box-sizing");if(fe&&fe==="border-box")k=V+de+W;else{const{clientWidth:qt,offsetWidth:pn}=I;k=V+ee+me+de+W+(pn-qt)}}L&&(I.style.transform=L),$&&(I.style.webkitTransform=$),t.roundLengths&&(k=Math.floor(k))}else k=(s-(t.slidesPerView-1)*w)/t.slidesPerView,t.roundLengths&&(k=Math.floor(k)),u[M]&&(u[M].style[n.getDirectionLabel("width")]=`${k}px`);u[M]&&(u[M].swiperSlideSize=k),h.push(k),t.centeredSlides?(v=v+k/2+x/2+w,x===0&&M!==0&&(v=v-s/2-w),M===0&&(v=v-s/2-w),Math.abs(v)<1/1e3&&(v=0),t.roundLengths&&(v=Math.floor(v)),C%t.slidesPerGroup===0&&f.push(v),p.push(v)):(t.roundLengths&&(v=Math.floor(v)),(C-Math.min(n.params.slidesPerGroupSkip,C))%n.params.slidesPerGroup===0&&f.push(v),p.push(v),v=v+k+w),n.virtualSize+=k+w,x=k,C+=1}}if(n.virtualSize=Math.max(n.virtualSize,s)+b,o&&l&&(t.effect==="slide"||t.effect==="coverflow")&&(r.style.width=`${n.virtualSize+w}px`),t.setWrapperSize&&(r.style[n.getDirectionLabel("width")]=`${n.virtualSize+w}px`),O&&n.grid.updateWrapperSize(k,f),!t.centeredSlides){const M=[];for(let I=0;I<f.length;I+=1){let _=f[I];t.roundLengths&&(_=Math.floor(_)),f[I]<=n.virtualSize-s&&M.push(_)}f=M,Math.floor(n.virtualSize-s)-Math.floor(f[f.length-1])>1&&f.push(n.virtualSize-s)}if(a&&t.loop){const M=h[0]+w;if(t.slidesPerGroup>1){const I=Math.ceil((n.virtual.slidesBefore+n.virtual.slidesAfter)/t.slidesPerGroup),_=M*t.slidesPerGroup;for(let L=0;L<I;L+=1)f.push(f[f.length-1]+_)}for(let I=0;I<n.virtual.slidesBefore+n.virtual.slidesAfter;I+=1)t.slidesPerGroup===1&&f.push(f[f.length-1]+M),p.push(p[p.length-1]+M),n.virtualSize+=M}if(f.length===0&&(f=[0]),w!==0){const M=n.isHorizontal()&&o?"marginLeft":n.getDirectionLabel("marginRight");u.filter((I,_)=>!t.cssMode||t.loop?!0:_!==u.length-1).forEach(I=>{I.style[M]=`${w}px`})}if(t.centeredSlides&&t.centeredSlidesBounds){let M=0;h.forEach(_=>{M+=_+(w||0)}),M-=w;const I=M-s;f=f.map(_=>_<=0?-m:_>I?I+b:_)}if(t.centerInsufficientSlides){let M=0;if(h.forEach(I=>{M+=I+(w||0)}),M-=w,M<s){const I=(s-M)/2;f.forEach((_,L)=>{f[L]=_-I}),p.forEach((_,L)=>{p[L]=_+I})}}if(Object.assign(n,{slides:u,snapGrid:f,slidesGrid:p,slidesSizesGrid:h}),t.centeredSlides&&t.cssMode&&!t.centeredSlidesBounds){yn(r,"--swiper-centered-offset-before",`${-f[0]}px`),yn(r,"--swiper-centered-offset-after",`${n.size/2-h[h.length-1]/2}px`);const M=-n.snapGrid[0],I=-n.slidesGrid[0];n.snapGrid=n.snapGrid.map(_=>_+M),n.slidesGrid=n.slidesGrid.map(_=>_+I)}if(d!==c&&n.emit("slidesLengthChange"),f.length!==g&&(n.params.watchOverflow&&n.checkOverflow(),n.emit("snapGridLengthChange")),p.length!==S&&n.emit("slidesGridLengthChange"),t.watchSlidesProgress&&n.updateSlidesOffset(),n.emit("slidesUpdated"),!a&&!t.cssMode&&(t.effect==="slide"||t.effect==="fade")){const M=`${t.containerModifierClass}backface-hidden`,I=n.el.classList.contains(M);d<=t.maxBackfaceHiddenSlides?I||n.el.classList.add(M):I&&n.el.classList.remove(M)}}function Hf(n){const e=this,t=[],r=e.virtual&&e.params.virtual.enabled;let i=0,s;typeof n=="number"?e.setTransition(n):n===!0&&e.setTransition(e.params.speed);const o=l=>r?e.slides[e.getSlideIndexByData(l)]:e.slides[l];if(e.params.slidesPerView!=="auto"&&e.params.slidesPerView>1)if(e.params.centeredSlides)(e.visibleSlides||[]).forEach(l=>{t.push(l)});else for(s=0;s<Math.ceil(e.params.slidesPerView);s+=1){const l=e.activeIndex+s;if(l>e.slides.length&&!r)break;t.push(o(l))}else t.push(o(e.activeIndex));for(s=0;s<t.length;s+=1)if(typeof t[s]<"u"){const l=t[s].offsetHeight;i=l>i?l:i}(i||i===0)&&(e.wrapperEl.style.height=`${i}px`)}function Ff(){const n=this,e=n.slides,t=n.isElement?n.isHorizontal()?n.wrapperEl.offsetLeft:n.wrapperEl.offsetTop:0;for(let r=0;r<e.length;r+=1)e[r].swiperSlideOffset=(n.isHorizontal()?e[r].offsetLeft:e[r].offsetTop)-t-n.cssOverflowAdjustment()}function Vf(n){n===void 0&&(n=this&&this.translate||0);const e=this,t=e.params,{slides:r,rtlTranslate:i,snapGrid:s}=e;if(r.length===0)return;typeof r[0].swiperSlideOffset>"u"&&e.updateSlidesOffset();let o=-n;i&&(o=n),r.forEach(a=>{a.classList.remove(t.slideVisibleClass,t.slideFullyVisibleClass)}),e.visibleSlidesIndexes=[],e.visibleSlides=[];let l=t.spaceBetween;typeof l=="string"&&l.indexOf("%")>=0?l=parseFloat(l.replace("%",""))/100*e.size:typeof l=="string"&&(l=parseFloat(l));for(let a=0;a<r.length;a+=1){const c=r[a];let u=c.swiperSlideOffset;t.cssMode&&t.centeredSlides&&(u-=r[0].swiperSlideOffset);const d=(o+(t.centeredSlides?e.minTranslate():0)-u)/(c.swiperSlideSize+l),f=(o-s[0]+(t.centeredSlides?e.minTranslate():0)-u)/(c.swiperSlideSize+l),p=-(o-u),h=p+e.slidesSizesGrid[a],m=p>=0&&p<=e.size-e.slidesSizesGrid[a];(p>=0&&p<e.size-1||h>1&&h<=e.size||p<=0&&h>=e.size)&&(e.visibleSlides.push(c),e.visibleSlidesIndexes.push(a),r[a].classList.add(t.slideVisibleClass)),m&&r[a].classList.add(t.slideFullyVisibleClass),c.progress=i?-d:d,c.originalProgress=i?-f:f}}function Wf(n){const e=this;if(typeof n>"u"){const u=e.rtlTranslate?-1:1;n=e&&e.translate&&e.translate*u||0}const t=e.params,r=e.maxTranslate()-e.minTranslate();let{progress:i,isBeginning:s,isEnd:o,progressLoop:l}=e;const a=s,c=o;if(r===0)i=0,s=!0,o=!0;else{i=(n-e.minTranslate())/r;const u=Math.abs(n-e.minTranslate())<1,d=Math.abs(n-e.maxTranslate())<1;s=u||i<=0,o=d||i>=1,u&&(i=0),d&&(i=1)}if(t.loop){const u=e.getSlideIndexByData(0),d=e.getSlideIndexByData(e.slides.length-1),f=e.slidesGrid[u],p=e.slidesGrid[d],h=e.slidesGrid[e.slidesGrid.length-1],m=Math.abs(n);m>=f?l=(m-f)/h:l=(m+h-p)/h,l>1&&(l-=1)}Object.assign(e,{progress:i,progressLoop:l,isBeginning:s,isEnd:o}),(t.watchSlidesProgress||t.centeredSlides&&t.autoHeight)&&e.updateSlidesProgress(n),s&&!a&&e.emit("reachBeginning toEdge"),o&&!c&&e.emit("reachEnd toEdge"),(a&&!s||c&&!o)&&e.emit("fromEdge"),e.emit("progress",i)}function qf(){const n=this,{slides:e,params:t,slidesEl:r,activeIndex:i}=n,s=n.virtual&&t.virtual.enabled,o=n.grid&&t.grid&&t.grid.rows>1,l=d=>Ye(r,`.${t.slideClass}${d}, swiper-slide${d}`)[0];e.forEach(d=>{d.classList.remove(t.slideActiveClass,t.slideNextClass,t.slidePrevClass)});let a,c,u;if(s)if(t.loop){let d=i-n.virtual.slidesBefore;d<0&&(d=n.virtual.slides.length+d),d>=n.virtual.slides.length&&(d-=n.virtual.slides.length),a=l(`[data-swiper-slide-index="${d}"]`)}else a=l(`[data-swiper-slide-index="${i}"]`);else o?(a=e.filter(d=>d.column===i)[0],u=e.filter(d=>d.column===i+1)[0],c=e.filter(d=>d.column===i-1)[0]):a=e[i];a&&(a.classList.add(t.slideActiveClass),o?(u&&u.classList.add(t.slideNextClass),c&&c.classList.add(t.slidePrevClass)):(u=Of(a,`.${t.slideClass}, swiper-slide`)[0],t.loop&&!u&&(u=e[0]),u&&u.classList.add(t.slideNextClass),c=Pf(a,`.${t.slideClass}, swiper-slide`)[0],t.loop&&!c===0&&(c=e[e.length-1]),c&&c.classList.add(t.slidePrevClass))),n.emitSlidesClasses()}const Fn=(n,e)=>{if(!n||n.destroyed||!n.params)return;const t=()=>n.isElement?"swiper-slide":`.${n.params.slideClass}`,r=e.closest(t());if(r){let i=r.querySelector(`.${n.params.lazyPreloaderClass}`);!i&&n.isElement&&(r.shadowRoot?i=r.shadowRoot.querySelector(`.${n.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{r.shadowRoot&&(i=r.shadowRoot.querySelector(`.${n.params.lazyPreloaderClass}`),i&&i.remove())})),i&&i.remove()}},Qr=(n,e)=>{if(!n.slides[e])return;const t=n.slides[e].querySelector('[loading="lazy"]');t&&t.removeAttribute("loading")},Yi=n=>{if(!n||n.destroyed||!n.params)return;let e=n.params.lazyPreloadPrevNext;const t=n.slides.length;if(!t||!e||e<0)return;e=Math.min(e,t);const r=n.params.slidesPerView==="auto"?n.slidesPerViewDynamic():Math.ceil(n.params.slidesPerView),i=n.activeIndex;if(n.params.grid&&n.params.grid.rows>1){const o=i,l=[o-e];l.push(...Array.from({length:e}).map((a,c)=>o+r+c)),n.slides.forEach((a,c)=>{l.includes(a.column)&&Qr(n,c)});return}const s=i+r-1;if(n.params.rewind||n.params.loop)for(let o=i-e;o<=s+e;o+=1){const l=(o%t+t)%t;(l<i||l>s)&&Qr(n,l)}else for(let o=Math.max(i-e,0);o<=Math.min(s+e,t-1);o+=1)o!==i&&(o>s||o<i)&&Qr(n,o)};function Gf(n){const{slidesGrid:e,params:t}=n,r=n.rtlTranslate?n.translate:-n.translate;let i;for(let s=0;s<e.length;s+=1)typeof e[s+1]<"u"?r>=e[s]&&r<e[s+1]-(e[s+1]-e[s])/2?i=s:r>=e[s]&&r<e[s+1]&&(i=s+1):r>=e[s]&&(i=s);return t.normalizeSlideIndex&&(i<0||typeof i>"u")&&(i=0),i}function Uf(n){const e=this,t=e.rtlTranslate?e.translate:-e.translate,{snapGrid:r,params:i,activeIndex:s,realIndex:o,snapIndex:l}=e;let a=n,c;const u=p=>{let h=p-e.virtual.slidesBefore;return h<0&&(h=e.virtual.slides.length+h),h>=e.virtual.slides.length&&(h-=e.virtual.slides.length),h};if(typeof a>"u"&&(a=Gf(e)),r.indexOf(t)>=0)c=r.indexOf(t);else{const p=Math.min(i.slidesPerGroupSkip,a);c=p+Math.floor((a-p)/i.slidesPerGroup)}if(c>=r.length&&(c=r.length-1),a===s&&!e.params.loop){c!==l&&(e.snapIndex=c,e.emit("snapIndexChange"));return}if(a===s&&e.params.loop&&e.virtual&&e.params.virtual.enabled){e.realIndex=u(a);return}const d=e.grid&&i.grid&&i.grid.rows>1;let f;if(e.virtual&&i.virtual.enabled&&i.loop)f=u(a);else if(d){const p=e.slides.filter(m=>m.column===a)[0];let h=parseInt(p.getAttribute("data-swiper-slide-index"),10);Number.isNaN(h)&&(h=Math.max(e.slides.indexOf(p),0)),f=Math.floor(h/i.grid.rows)}else if(e.slides[a]){const p=e.slides[a].getAttribute("data-swiper-slide-index");p?f=parseInt(p,10):f=a}else f=a;Object.assign(e,{previousSnapIndex:l,snapIndex:c,previousRealIndex:o,realIndex:f,previousIndex:s,activeIndex:a}),e.initialized&&Yi(e),e.emit("activeIndexChange"),e.emit("snapIndexChange"),(e.initialized||e.params.runCallbacksOnInit)&&(o!==f&&e.emit("realIndexChange"),e.emit("slideChange"))}function Kf(n,e){const t=this,r=t.params;let i=n.closest(`.${r.slideClass}, swiper-slide`);!i&&t.isElement&&e&&e.length>1&&e.includes(n)&&[...e.slice(e.indexOf(n)+1,e.length)].forEach(l=>{!i&&l.matches&&l.matches(`.${r.slideClass}, swiper-slide`)&&(i=l)});let s=!1,o;if(i){for(let l=0;l<t.slides.length;l+=1)if(t.slides[l]===i){s=!0,o=l;break}}if(i&&s)t.clickedSlide=i,t.virtual&&t.params.virtual.enabled?t.clickedIndex=parseInt(i.getAttribute("data-swiper-slide-index"),10):t.clickedIndex=o;else{t.clickedSlide=void 0,t.clickedIndex=void 0;return}r.slideToClickedSlide&&t.clickedIndex!==void 0&&t.clickedIndex!==t.activeIndex&&t.slideToClickedSlide()}var Jf={updateSize:Bf,updateSlides:$f,updateAutoHeight:Hf,updateSlidesOffset:Ff,updateSlidesProgress:Vf,updateProgress:Wf,updateSlidesClasses:qf,updateActiveIndex:Uf,updateClickedSlide:Kf};function Yf(n){n===void 0&&(n=this.isHorizontal()?"x":"y");const e=this,{params:t,rtlTranslate:r,translate:i,wrapperEl:s}=e;if(t.virtualTranslate)return r?-i:i;if(t.cssMode)return i;let o=Mf(s,n);return o+=e.cssOverflowAdjustment(),r&&(o=-o),o||0}function Xf(n,e){const t=this,{rtlTranslate:r,params:i,wrapperEl:s,progress:o}=t;let l=0,a=0;const c=0;t.isHorizontal()?l=r?-n:n:a=n,i.roundLengths&&(l=Math.floor(l),a=Math.floor(a)),t.previousTranslate=t.translate,t.translate=t.isHorizontal()?l:a,i.cssMode?s[t.isHorizontal()?"scrollLeft":"scrollTop"]=t.isHorizontal()?-l:-a:i.virtualTranslate||(t.isHorizontal()?l-=t.cssOverflowAdjustment():a-=t.cssOverflowAdjustment(),s.style.transform=`translate3d(${l}px, ${a}px, ${c}px)`);let u;const d=t.maxTranslate()-t.minTranslate();d===0?u=0:u=(n-t.minTranslate())/d,u!==o&&t.updateProgress(n),t.emit("setTranslate",t.translate,e)}function Qf(){return-this.snapGrid[0]}function Zf(){return-this.snapGrid[this.snapGrid.length-1]}function ep(n,e,t,r,i){n===void 0&&(n=0),e===void 0&&(e=this.params.speed),t===void 0&&(t=!0),r===void 0&&(r=!0);const s=this,{params:o,wrapperEl:l}=s;if(s.animating&&o.preventInteractionOnTransition)return!1;const a=s.minTranslate(),c=s.maxTranslate();let u;if(r&&n>a?u=a:r&&n<c?u=c:u=n,s.updateProgress(u),o.cssMode){const d=s.isHorizontal();if(e===0)l[d?"scrollLeft":"scrollTop"]=-u;else{if(!s.support.smoothScroll)return va({swiper:s,targetPosition:-u,side:d?"left":"top"}),!0;l.scrollTo({[d?"left":"top"]:-u,behavior:"smooth"})}return!0}return e===0?(s.setTransition(0),s.setTranslate(u),t&&(s.emit("beforeTransitionStart",e,i),s.emit("transitionEnd"))):(s.setTransition(e),s.setTranslate(u),t&&(s.emit("beforeTransitionStart",e,i),s.emit("transitionStart")),s.animating||(s.animating=!0,s.onTranslateToWrapperTransitionEnd||(s.onTranslateToWrapperTransitionEnd=function(f){!s||s.destroyed||f.target===this&&(s.wrapperEl.removeEventListener("transitionend",s.onTranslateToWrapperTransitionEnd),s.onTranslateToWrapperTransitionEnd=null,delete s.onTranslateToWrapperTransitionEnd,t&&s.emit("transitionEnd"))}),s.wrapperEl.addEventListener("transitionend",s.onTranslateToWrapperTransitionEnd))),!0}var tp={getTranslate:Yf,setTranslate:Xf,minTranslate:Qf,maxTranslate:Zf,translateTo:ep};function np(n,e){const t=this;t.params.cssMode||(t.wrapperEl.style.transitionDuration=`${n}ms`,t.wrapperEl.style.transitionDelay=n===0?"0ms":""),t.emit("setTransition",n,e)}function Ca(n){let{swiper:e,runCallbacks:t,direction:r,step:i}=n;const{activeIndex:s,previousIndex:o}=e;let l=r;if(l||(s>o?l="next":s<o?l="prev":l="reset"),e.emit(`transition${i}`),t&&s!==o){if(l==="reset"){e.emit(`slideResetTransition${i}`);return}e.emit(`slideChangeTransition${i}`),l==="next"?e.emit(`slideNextTransition${i}`):e.emit(`slidePrevTransition${i}`)}}function rp(n,e){n===void 0&&(n=!0);const t=this,{params:r}=t;r.cssMode||(r.autoHeight&&t.updateAutoHeight(),Ca({swiper:t,runCallbacks:n,direction:e,step:"Start"}))}function ip(n,e){n===void 0&&(n=!0);const t=this,{params:r}=t;t.animating=!1,!r.cssMode&&(t.setTransition(0),Ca({swiper:t,runCallbacks:n,direction:e,step:"End"}))}var sp={setTransition:np,transitionStart:rp,transitionEnd:ip};function op(n,e,t,r,i){n===void 0&&(n=0),e===void 0&&(e=this.params.speed),t===void 0&&(t=!0),typeof n=="string"&&(n=parseInt(n,10));const s=this;let o=n;o<0&&(o=0);const{params:l,snapGrid:a,slidesGrid:c,previousIndex:u,activeIndex:d,rtlTranslate:f,wrapperEl:p,enabled:h}=s;if(s.animating&&l.preventInteractionOnTransition||!h&&!r&&!i||s.destroyed)return!1;const m=Math.min(s.params.slidesPerGroupSkip,o);let b=m+Math.floor((o-m)/s.params.slidesPerGroup);b>=a.length&&(b=a.length-1);const g=-a[b];if(l.normalizeSlideIndex)for(let w=0;w<c.length;w+=1){const v=-Math.floor(g*100),x=Math.floor(c[w]*100),C=Math.floor(c[w+1]*100);typeof c[w+1]<"u"?v>=x&&v<C-(C-x)/2?o=w:v>=x&&v<C&&(o=w+1):v>=x&&(o=w)}if(s.initialized&&o!==d&&(!s.allowSlideNext&&(f?g>s.translate&&g>s.minTranslate():g<s.translate&&g<s.minTranslate())||!s.allowSlidePrev&&g>s.translate&&g>s.maxTranslate()&&(d||0)!==o))return!1;o!==(u||0)&&t&&s.emit("beforeSlideChangeStart"),s.updateProgress(g);let S;if(o>d?S="next":o<d?S="prev":S="reset",f&&-g===s.translate||!f&&g===s.translate)return s.updateActiveIndex(o),l.autoHeight&&s.updateAutoHeight(),s.updateSlidesClasses(),l.effect!=="slide"&&s.setTranslate(g),S!=="reset"&&(s.transitionStart(t,S),s.transitionEnd(t,S)),!1;if(l.cssMode){const w=s.isHorizontal(),v=f?g:-g;if(e===0){const x=s.virtual&&s.params.virtual.enabled;x&&(s.wrapperEl.style.scrollSnapType="none",s._immediateVirtual=!0),x&&!s._cssModeVirtualInitialSet&&s.params.initialSlide>0?(s._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{p[w?"scrollLeft":"scrollTop"]=v})):p[w?"scrollLeft":"scrollTop"]=v,x&&requestAnimationFrame(()=>{s.wrapperEl.style.scrollSnapType="",s._immediateVirtual=!1})}else{if(!s.support.smoothScroll)return va({swiper:s,targetPosition:v,side:w?"left":"top"}),!0;p.scrollTo({[w?"left":"top"]:v,behavior:"smooth"})}return!0}return s.setTransition(e),s.setTranslate(g),s.updateActiveIndex(o),s.updateSlidesClasses(),s.emit("beforeTransitionStart",e,r),s.transitionStart(t,S),e===0?s.transitionEnd(t,S):s.animating||(s.animating=!0,s.onSlideToWrapperTransitionEnd||(s.onSlideToWrapperTransitionEnd=function(v){!s||s.destroyed||v.target===this&&(s.wrapperEl.removeEventListener("transitionend",s.onSlideToWrapperTransitionEnd),s.onSlideToWrapperTransitionEnd=null,delete s.onSlideToWrapperTransitionEnd,s.transitionEnd(t,S))}),s.wrapperEl.addEventListener("transitionend",s.onSlideToWrapperTransitionEnd)),!0}function lp(n,e,t,r){n===void 0&&(n=0),e===void 0&&(e=this.params.speed),t===void 0&&(t=!0),typeof n=="string"&&(n=parseInt(n,10));const i=this;if(i.destroyed)return;const s=i.grid&&i.params.grid&&i.params.grid.rows>1;let o=n;if(i.params.loop)if(i.virtual&&i.params.virtual.enabled)o=o+i.virtual.slidesBefore;else{let l;if(s){const f=o*i.params.grid.rows;l=i.slides.filter(p=>p.getAttribute("data-swiper-slide-index")*1===f)[0].column}else l=i.getSlideIndexByData(o);const a=s?Math.ceil(i.slides.length/i.params.grid.rows):i.slides.length,{centeredSlides:c}=i.params;let u=i.params.slidesPerView;u==="auto"?u=i.slidesPerViewDynamic():(u=Math.ceil(parseFloat(i.params.slidesPerView,10)),c&&u%2===0&&(u=u+1));let d=a-l<u;if(c&&(d=d||l<Math.ceil(u/2)),d){const f=c?l<i.activeIndex?"prev":"next":l-i.activeIndex-1<i.params.slidesPerView?"next":"prev";i.loopFix({direction:f,slideTo:!0,activeSlideIndex:f==="next"?l+1:l-a+1,slideRealIndex:f==="next"?i.realIndex:void 0})}if(s){const f=o*i.params.grid.rows;o=i.slides.filter(p=>p.getAttribute("data-swiper-slide-index")*1===f)[0].column}else o=i.getSlideIndexByData(o)}return requestAnimationFrame(()=>{i.slideTo(o,e,t,r)}),i}function ap(n,e,t){n===void 0&&(n=this.params.speed),e===void 0&&(e=!0);const r=this,{enabled:i,params:s,animating:o}=r;if(!i||r.destroyed)return r;let l=s.slidesPerGroup;s.slidesPerView==="auto"&&s.slidesPerGroup===1&&s.slidesPerGroupAuto&&(l=Math.max(r.slidesPerViewDynamic("current",!0),1));const a=r.activeIndex<s.slidesPerGroupSkip?1:l,c=r.virtual&&s.virtual.enabled;if(s.loop){if(o&&!c&&s.loopPreventsSliding)return!1;if(r.loopFix({direction:"next"}),r._clientLeft=r.wrapperEl.clientLeft,r.activeIndex===r.slides.length-1&&s.cssMode)return requestAnimationFrame(()=>{r.slideTo(r.activeIndex+a,n,e,t)}),!0}return s.rewind&&r.isEnd?r.slideTo(0,n,e,t):r.slideTo(r.activeIndex+a,n,e,t)}function cp(n,e,t){n===void 0&&(n=this.params.speed),e===void 0&&(e=!0);const r=this,{params:i,snapGrid:s,slidesGrid:o,rtlTranslate:l,enabled:a,animating:c}=r;if(!a||r.destroyed)return r;const u=r.virtual&&i.virtual.enabled;if(i.loop){if(c&&!u&&i.loopPreventsSliding)return!1;r.loopFix({direction:"prev"}),r._clientLeft=r.wrapperEl.clientLeft}const d=l?r.translate:-r.translate;function f(g){return g<0?-Math.floor(Math.abs(g)):Math.floor(g)}const p=f(d),h=s.map(g=>f(g));let m=s[h.indexOf(p)-1];if(typeof m>"u"&&i.cssMode){let g;s.forEach((S,w)=>{p>=S&&(g=w)}),typeof g<"u"&&(m=s[g>0?g-1:g])}let b=0;if(typeof m<"u"&&(b=o.indexOf(m),b<0&&(b=r.activeIndex-1),i.slidesPerView==="auto"&&i.slidesPerGroup===1&&i.slidesPerGroupAuto&&(b=b-r.slidesPerViewDynamic("previous",!0)+1,b=Math.max(b,0))),i.rewind&&r.isBeginning){const g=r.params.virtual&&r.params.virtual.enabled&&r.virtual?r.virtual.slides.length-1:r.slides.length-1;return r.slideTo(g,n,e,t)}else if(i.loop&&r.activeIndex===0&&i.cssMode)return requestAnimationFrame(()=>{r.slideTo(b,n,e,t)}),!0;return r.slideTo(b,n,e,t)}function up(n,e,t){n===void 0&&(n=this.params.speed),e===void 0&&(e=!0);const r=this;if(!r.destroyed)return r.slideTo(r.activeIndex,n,e,t)}function dp(n,e,t,r){n===void 0&&(n=this.params.speed),e===void 0&&(e=!0),r===void 0&&(r=.5);const i=this;if(i.destroyed)return;let s=i.activeIndex;const o=Math.min(i.params.slidesPerGroupSkip,s),l=o+Math.floor((s-o)/i.params.slidesPerGroup),a=i.rtlTranslate?i.translate:-i.translate;if(a>=i.snapGrid[l]){const c=i.snapGrid[l],u=i.snapGrid[l+1];a-c>(u-c)*r&&(s+=i.params.slidesPerGroup)}else{const c=i.snapGrid[l-1],u=i.snapGrid[l];a-c<=(u-c)*r&&(s-=i.params.slidesPerGroup)}return s=Math.max(s,0),s=Math.min(s,i.slidesGrid.length-1),i.slideTo(s,n,e,t)}function fp(){const n=this;if(n.destroyed)return;const{params:e,slidesEl:t}=n,r=e.slidesPerView==="auto"?n.slidesPerViewDynamic():e.slidesPerView;let i=n.clickedIndex,s;const o=n.isElement?"swiper-slide":`.${e.slideClass}`;if(e.loop){if(n.animating)return;s=parseInt(n.clickedSlide.getAttribute("data-swiper-slide-index"),10),e.centeredSlides?i<n.loopedSlides-r/2||i>n.slides.length-n.loopedSlides+r/2?(n.loopFix(),i=n.getSlideIndex(Ye(t,`${o}[data-swiper-slide-index="${s}"]`)[0]),Ki(()=>{n.slideTo(i)})):n.slideTo(i):i>n.slides.length-r?(n.loopFix(),i=n.getSlideIndex(Ye(t,`${o}[data-swiper-slide-index="${s}"]`)[0]),Ki(()=>{n.slideTo(i)})):n.slideTo(i)}else n.slideTo(i)}var pp={slideTo:op,slideToLoop:lp,slideNext:ap,slidePrev:cp,slideReset:up,slideToClosest:dp,slideToClickedSlide:fp};function hp(n){const e=this,{params:t,slidesEl:r}=e;if(!t.loop||e.virtual&&e.params.virtual.enabled)return;const i=()=>{Ye(r,`.${t.slideClass}, swiper-slide`).forEach((d,f)=>{d.setAttribute("data-swiper-slide-index",f)})},s=e.grid&&t.grid&&t.grid.rows>1,o=t.slidesPerGroup*(s?t.grid.rows:1),l=e.slides.length%o!==0,a=s&&e.slides.length%t.grid.rows!==0,c=u=>{for(let d=0;d<u;d+=1){const f=e.isElement?Ji("swiper-slide",[t.slideBlankClass]):Ji("div",[t.slideClass,t.slideBlankClass]);e.slidesEl.append(f)}};if(l){if(t.loopAddBlankSlides){const u=o-e.slides.length%o;c(u),e.recalcSlides(),e.updateSlides()}else Yn("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else if(a){if(t.loopAddBlankSlides){const u=t.grid.rows-e.slides.length%t.grid.rows;c(u),e.recalcSlides(),e.updateSlides()}else Yn("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else i();e.loopFix({slideRealIndex:n,direction:t.centeredSlides?void 0:"next"})}function mp(n){let{slideRealIndex:e,slideTo:t=!0,direction:r,setTranslate:i,activeSlideIndex:s,byController:o,byMousewheel:l}=n===void 0?{}:n;const a=this;if(!a.params.loop)return;a.emit("beforeLoopFix");const{slides:c,allowSlidePrev:u,allowSlideNext:d,slidesEl:f,params:p}=a,{centeredSlides:h}=p;if(a.allowSlidePrev=!0,a.allowSlideNext=!0,a.virtual&&p.virtual.enabled){t&&(!p.centeredSlides&&a.snapIndex===0?a.slideTo(a.virtual.slides.length,0,!1,!0):p.centeredSlides&&a.snapIndex<p.slidesPerView?a.slideTo(a.virtual.slides.length+a.snapIndex,0,!1,!0):a.snapIndex===a.snapGrid.length-1&&a.slideTo(a.virtual.slidesBefore,0,!1,!0)),a.allowSlidePrev=u,a.allowSlideNext=d,a.emit("loopFix");return}let m=p.slidesPerView;m==="auto"?m=a.slidesPerViewDynamic():(m=Math.ceil(parseFloat(p.slidesPerView,10)),h&&m%2===0&&(m=m+1));const b=p.slidesPerGroupAuto?m:p.slidesPerGroup;let g=b;g%b!==0&&(g+=b-g%b),g+=p.loopAdditionalSlides,a.loopedSlides=g;const S=a.grid&&p.grid&&p.grid.rows>1;c.length<m+g?Yn("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):S&&p.grid.fill==="row"&&Yn("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const w=[],v=[];let x=a.activeIndex;typeof s>"u"?s=a.getSlideIndex(c.filter(L=>L.classList.contains(p.slideActiveClass))[0]):x=s;const C=r==="next"||!r,O=r==="prev"||!r;let k=0,N=0;const M=S?Math.ceil(c.length/p.grid.rows):c.length,_=(S?c[s].column:s)+(h&&typeof i>"u"?-m/2+.5:0);if(_<g){k=Math.max(g-_,b);for(let L=0;L<g-_;L+=1){const $=L-Math.floor(L/M)*M;if(S){const V=M-$-1;for(let ee=c.length-1;ee>=0;ee-=1)c[ee].column===V&&w.push(ee)}else w.push(M-$-1)}}else if(_+m>M-g){N=Math.max(_-(M-g*2),b);for(let L=0;L<N;L+=1){const $=L-Math.floor(L/M)*M;S?c.forEach((V,ee)=>{V.column===$&&v.push(ee)}):v.push($)}}if(a.__preventObserver__=!0,requestAnimationFrame(()=>{a.__preventObserver__=!1}),O&&w.forEach(L=>{c[L].swiperLoopMoveDOM=!0,f.prepend(c[L]),c[L].swiperLoopMoveDOM=!1}),C&&v.forEach(L=>{c[L].swiperLoopMoveDOM=!0,f.append(c[L]),c[L].swiperLoopMoveDOM=!1}),a.recalcSlides(),p.slidesPerView==="auto"?a.updateSlides():S&&(w.length>0&&O||v.length>0&&C)&&a.slides.forEach((L,$)=>{a.grid.updateSlide($,L,a.slides)}),p.watchSlidesProgress&&a.updateSlidesOffset(),t){if(w.length>0&&O){if(typeof e>"u"){const L=a.slidesGrid[x],V=a.slidesGrid[x+k]-L;l?a.setTranslate(a.translate-V):(a.slideTo(x+k,0,!1,!0),i&&(a.touchEventsData.startTranslate=a.touchEventsData.startTranslate-V,a.touchEventsData.currentTranslate=a.touchEventsData.currentTranslate-V))}else if(i){const L=S?w.length/p.grid.rows:w.length;a.slideTo(a.activeIndex+L,0,!1,!0),a.touchEventsData.currentTranslate=a.translate}}else if(v.length>0&&C)if(typeof e>"u"){const L=a.slidesGrid[x],V=a.slidesGrid[x-N]-L;l?a.setTranslate(a.translate-V):(a.slideTo(x-N,0,!1,!0),i&&(a.touchEventsData.startTranslate=a.touchEventsData.startTranslate-V,a.touchEventsData.currentTranslate=a.touchEventsData.currentTranslate-V))}else{const L=S?v.length/p.grid.rows:v.length;a.slideTo(a.activeIndex-L,0,!1,!0)}}if(a.allowSlidePrev=u,a.allowSlideNext=d,a.controller&&a.controller.control&&!o){const L={slideRealIndex:e,direction:r,setTranslate:i,activeSlideIndex:s,byController:!0};Array.isArray(a.controller.control)?a.controller.control.forEach($=>{!$.destroyed&&$.params.loop&&$.loopFix({...L,slideTo:$.params.slidesPerView===p.slidesPerView?t:!1})}):a.controller.control instanceof a.constructor&&a.controller.control.params.loop&&a.controller.control.loopFix({...L,slideTo:a.controller.control.params.slidesPerView===p.slidesPerView?t:!1})}a.emit("loopFix")}function gp(){const n=this,{params:e,slidesEl:t}=n;if(!e.loop||n.virtual&&n.params.virtual.enabled)return;n.recalcSlides();const r=[];n.slides.forEach(i=>{const s=typeof i.swiperSlideIndex>"u"?i.getAttribute("data-swiper-slide-index")*1:i.swiperSlideIndex;r[s]=i}),n.slides.forEach(i=>{i.removeAttribute("data-swiper-slide-index")}),r.forEach(i=>{t.append(i)}),n.recalcSlides(),n.slideTo(n.realIndex,0)}var bp={loopCreate:hp,loopFix:mp,loopDestroy:gp};function yp(n){const e=this;if(!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)return;const t=e.params.touchEventsTarget==="container"?e.el:e.wrapperEl;e.isElement&&(e.__preventObserver__=!0),t.style.cursor="move",t.style.cursor=n?"grabbing":"grab",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1})}function wp(){const n=this;n.params.watchOverflow&&n.isLocked||n.params.cssMode||(n.isElement&&(n.__preventObserver__=!0),n[n.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",n.isElement&&requestAnimationFrame(()=>{n.__preventObserver__=!1}))}var vp={setGrabCursor:yp,unsetGrabCursor:wp};function xp(n,e){e===void 0&&(e=this);function t(r){if(!r||r===Ft()||r===Se())return null;r.assignedSlot&&(r=r.assignedSlot);const i=r.closest(n);return!i&&!r.getRootNode?null:i||t(r.getRootNode().host)}return t(e)}function wo(n,e,t){const r=Se(),{params:i}=n,s=i.edgeSwipeDetection,o=i.edgeSwipeThreshold;return s&&(t<=o||t>=r.innerWidth-o)?s==="prevent"?(e.preventDefault(),!0):!1:!0}function Sp(n){const e=this,t=Ft();let r=n;r.originalEvent&&(r=r.originalEvent);const i=e.touchEventsData;if(r.type==="pointerdown"){if(i.pointerId!==null&&i.pointerId!==r.pointerId)return;i.pointerId=r.pointerId}else r.type==="touchstart"&&r.targetTouches.length===1&&(i.touchId=r.targetTouches[0].identifier);if(r.type==="touchstart"){wo(e,r,r.targetTouches[0].pageX);return}const{params:s,touches:o,enabled:l}=e;if(!l||!s.simulateTouch&&r.pointerType==="mouse"||e.animating&&s.preventInteractionOnTransition)return;!e.animating&&s.cssMode&&s.loop&&e.loopFix();let a=r.target;if(s.touchEventsTarget==="wrapper"&&!e.wrapperEl.contains(a)||"which"in r&&r.which===3||"button"in r&&r.button>0||i.isTouched&&i.isMoved)return;const c=!!s.noSwipingClass&&s.noSwipingClass!=="",u=r.composedPath?r.composedPath():r.path;c&&r.target&&r.target.shadowRoot&&u&&(a=u[0]);const d=s.noSwipingSelector?s.noSwipingSelector:`.${s.noSwipingClass}`,f=!!(r.target&&r.target.shadowRoot);if(s.noSwiping&&(f?xp(d,a):a.closest(d))){e.allowClick=!0;return}if(s.swipeHandler&&!a.closest(s.swipeHandler))return;o.currentX=r.pageX,o.currentY=r.pageY;const p=o.currentX,h=o.currentY;if(!wo(e,r,p))return;Object.assign(i,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),o.startX=p,o.startY=h,i.touchStartTime=Jn(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,s.threshold>0&&(i.allowThresholdMove=!1);let m=!0;a.matches(i.focusableElements)&&(m=!1,a.nodeName==="SELECT"&&(i.isTouched=!1)),t.activeElement&&t.activeElement.matches(i.focusableElements)&&t.activeElement!==a&&t.activeElement.blur();const b=m&&e.allowTouchMove&&s.touchStartPreventDefault;(s.touchStartForcePreventDefault||b)&&!a.isContentEditable&&r.preventDefault(),s.freeMode&&s.freeMode.enabled&&e.freeMode&&e.animating&&!s.cssMode&&e.freeMode.onTouchStart(),e.emit("touchStart",r)}function Cp(n){const e=Ft(),t=this,r=t.touchEventsData,{params:i,touches:s,rtlTranslate:o,enabled:l}=t;if(!l||!i.simulateTouch&&n.pointerType==="mouse")return;let a=n;if(a.originalEvent&&(a=a.originalEvent),a.type==="pointermove"&&(r.touchId!==null||a.pointerId!==r.pointerId))return;let c;if(a.type==="touchmove"){if(c=[...a.changedTouches].filter(C=>C.identifier===r.touchId)[0],!c||c.identifier!==r.touchId)return}else c=a;if(!r.isTouched){r.startMoving&&r.isScrolling&&t.emit("touchMoveOpposite",a);return}const u=c.pageX,d=c.pageY;if(a.preventedByNestedSwiper){s.startX=u,s.startY=d;return}if(!t.allowTouchMove){a.target.matches(r.focusableElements)||(t.allowClick=!1),r.isTouched&&(Object.assign(s,{startX:u,startY:d,currentX:u,currentY:d}),r.touchStartTime=Jn());return}if(i.touchReleaseOnEdges&&!i.loop){if(t.isVertical()){if(d<s.startY&&t.translate<=t.maxTranslate()||d>s.startY&&t.translate>=t.minTranslate()){r.isTouched=!1,r.isMoved=!1;return}}else if(u<s.startX&&t.translate<=t.maxTranslate()||u>s.startX&&t.translate>=t.minTranslate())return}if(e.activeElement&&a.target===e.activeElement&&a.target.matches(r.focusableElements)){r.isMoved=!0,t.allowClick=!1;return}r.allowTouchCallbacks&&t.emit("touchMove",a),s.previousX=s.currentX,s.previousY=s.currentY,s.currentX=u,s.currentY=d;const f=s.currentX-s.startX,p=s.currentY-s.startY;if(t.params.threshold&&Math.sqrt(f**2+p**2)<t.params.threshold)return;if(typeof r.isScrolling>"u"){let C;t.isHorizontal()&&s.currentY===s.startY||t.isVertical()&&s.currentX===s.startX?r.isScrolling=!1:f*f+p*p>=25&&(C=Math.atan2(Math.abs(p),Math.abs(f))*180/Math.PI,r.isScrolling=t.isHorizontal()?C>i.touchAngle:90-C>i.touchAngle)}if(r.isScrolling&&t.emit("touchMoveOpposite",a),typeof r.startMoving>"u"&&(s.currentX!==s.startX||s.currentY!==s.startY)&&(r.startMoving=!0),r.isScrolling){r.isTouched=!1;return}if(!r.startMoving)return;t.allowClick=!1,!i.cssMode&&a.cancelable&&a.preventDefault(),i.touchMoveStopPropagation&&!i.nested&&a.stopPropagation();let h=t.isHorizontal()?f:p,m=t.isHorizontal()?s.currentX-s.previousX:s.currentY-s.previousY;i.oneWayMovement&&(h=Math.abs(h)*(o?1:-1),m=Math.abs(m)*(o?1:-1)),s.diff=h,h*=i.touchRatio,o&&(h=-h,m=-m);const b=t.touchesDirection;t.swipeDirection=h>0?"prev":"next",t.touchesDirection=m>0?"prev":"next";const g=t.params.loop&&!i.cssMode,S=t.touchesDirection==="next"&&t.allowSlideNext||t.touchesDirection==="prev"&&t.allowSlidePrev;if(!r.isMoved){if(g&&S&&t.loopFix({direction:t.swipeDirection}),r.startTranslate=t.getTranslate(),t.setTransition(0),t.animating){const C=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(C)}r.allowMomentumBounce=!1,i.grabCursor&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!0),t.emit("sliderFirstMove",a)}let w;if(new Date().getTime(),r.isMoved&&r.allowThresholdMove&&b!==t.touchesDirection&&g&&S&&Math.abs(h)>=1){Object.assign(s,{startX:u,startY:d,currentX:u,currentY:d,startTranslate:r.currentTranslate}),r.loopSwapReset=!0,r.startTranslate=r.currentTranslate;return}t.emit("sliderMove",a),r.isMoved=!0,r.currentTranslate=h+r.startTranslate;let v=!0,x=i.resistanceRatio;if(i.touchReleaseOnEdges&&(x=0),h>0?(g&&S&&!w&&r.allowThresholdMove&&r.currentTranslate>(i.centeredSlides?t.minTranslate()-t.slidesSizesGrid[t.activeIndex+1]:t.minTranslate())&&t.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),r.currentTranslate>t.minTranslate()&&(v=!1,i.resistance&&(r.currentTranslate=t.minTranslate()-1+(-t.minTranslate()+r.startTranslate+h)**x))):h<0&&(g&&S&&!w&&r.allowThresholdMove&&r.currentTranslate<(i.centeredSlides?t.maxTranslate()+t.slidesSizesGrid[t.slidesSizesGrid.length-1]:t.maxTranslate())&&t.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:t.slides.length-(i.slidesPerView==="auto"?t.slidesPerViewDynamic():Math.ceil(parseFloat(i.slidesPerView,10)))}),r.currentTranslate<t.maxTranslate()&&(v=!1,i.resistance&&(r.currentTranslate=t.maxTranslate()+1-(t.maxTranslate()-r.startTranslate-h)**x))),v&&(a.preventedByNestedSwiper=!0),!t.allowSlideNext&&t.swipeDirection==="next"&&r.currentTranslate<r.startTranslate&&(r.currentTranslate=r.startTranslate),!t.allowSlidePrev&&t.swipeDirection==="prev"&&r.currentTranslate>r.startTranslate&&(r.currentTranslate=r.startTranslate),!t.allowSlidePrev&&!t.allowSlideNext&&(r.currentTranslate=r.startTranslate),i.threshold>0)if(Math.abs(h)>i.threshold||r.allowThresholdMove){if(!r.allowThresholdMove){r.allowThresholdMove=!0,s.startX=s.currentX,s.startY=s.currentY,r.currentTranslate=r.startTranslate,s.diff=t.isHorizontal()?s.currentX-s.startX:s.currentY-s.startY;return}}else{r.currentTranslate=r.startTranslate;return}!i.followFinger||i.cssMode||((i.freeMode&&i.freeMode.enabled&&t.freeMode||i.watchSlidesProgress)&&(t.updateActiveIndex(),t.updateSlidesClasses()),i.freeMode&&i.freeMode.enabled&&t.freeMode&&t.freeMode.onTouchMove(),t.updateProgress(r.currentTranslate),t.setTranslate(r.currentTranslate))}function Tp(n){const e=this,t=e.touchEventsData;let r=n;r.originalEvent&&(r=r.originalEvent);let i;if(r.type==="touchend"||r.type==="touchcancel"){if(i=[...r.changedTouches].filter(x=>x.identifier===t.touchId)[0],!i||i.identifier!==t.touchId)return}else{if(t.touchId!==null||r.pointerId!==t.pointerId)return;i=r}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(r.type)&&!(["pointercancel","contextmenu"].includes(r.type)&&(e.browser.isSafari||e.browser.isWebView)))return;t.pointerId=null,t.touchId=null;const{params:o,touches:l,rtlTranslate:a,slidesGrid:c,enabled:u}=e;if(!u||!o.simulateTouch&&r.pointerType==="mouse")return;if(t.allowTouchCallbacks&&e.emit("touchEnd",r),t.allowTouchCallbacks=!1,!t.isTouched){t.isMoved&&o.grabCursor&&e.setGrabCursor(!1),t.isMoved=!1,t.startMoving=!1;return}o.grabCursor&&t.isMoved&&t.isTouched&&(e.allowSlideNext===!0||e.allowSlidePrev===!0)&&e.setGrabCursor(!1);const d=Jn(),f=d-t.touchStartTime;if(e.allowClick){const x=r.path||r.composedPath&&r.composedPath();e.updateClickedSlide(x&&x[0]||r.target,x),e.emit("tap click",r),f<300&&d-t.lastClickTime<300&&e.emit("doubleTap doubleClick",r)}if(t.lastClickTime=Jn(),Ki(()=>{e.destroyed||(e.allowClick=!0)}),!t.isTouched||!t.isMoved||!e.swipeDirection||l.diff===0&&!t.loopSwapReset||t.currentTranslate===t.startTranslate&&!t.loopSwapReset){t.isTouched=!1,t.isMoved=!1,t.startMoving=!1;return}t.isTouched=!1,t.isMoved=!1,t.startMoving=!1;let p;if(o.followFinger?p=a?e.translate:-e.translate:p=-t.currentTranslate,o.cssMode)return;if(o.freeMode&&o.freeMode.enabled){e.freeMode.onTouchEnd({currentPos:p});return}const h=p>=-e.maxTranslate()&&!e.params.loop;let m=0,b=e.slidesSizesGrid[0];for(let x=0;x<c.length;x+=x<o.slidesPerGroupSkip?1:o.slidesPerGroup){const C=x<o.slidesPerGroupSkip-1?1:o.slidesPerGroup;typeof c[x+C]<"u"?(h||p>=c[x]&&p<c[x+C])&&(m=x,b=c[x+C]-c[x]):(h||p>=c[x])&&(m=x,b=c[c.length-1]-c[c.length-2])}let g=null,S=null;o.rewind&&(e.isBeginning?S=o.virtual&&o.virtual.enabled&&e.virtual?e.virtual.slides.length-1:e.slides.length-1:e.isEnd&&(g=0));const w=(p-c[m])/b,v=m<o.slidesPerGroupSkip-1?1:o.slidesPerGroup;if(f>o.longSwipesMs){if(!o.longSwipes){e.slideTo(e.activeIndex);return}e.swipeDirection==="next"&&(w>=o.longSwipesRatio?e.slideTo(o.rewind&&e.isEnd?g:m+v):e.slideTo(m)),e.swipeDirection==="prev"&&(w>1-o.longSwipesRatio?e.slideTo(m+v):S!==null&&w<0&&Math.abs(w)>o.longSwipesRatio?e.slideTo(S):e.slideTo(m))}else{if(!o.shortSwipes){e.slideTo(e.activeIndex);return}e.navigation&&(r.target===e.navigation.nextEl||r.target===e.navigation.prevEl)?r.target===e.navigation.nextEl?e.slideTo(m+v):e.slideTo(m):(e.swipeDirection==="next"&&e.slideTo(g!==null?g:m+v),e.swipeDirection==="prev"&&e.slideTo(S!==null?S:m))}}function vo(){const n=this,{params:e,el:t}=n;if(t&&t.offsetWidth===0)return;e.breakpoints&&n.setBreakpoint();const{allowSlideNext:r,allowSlidePrev:i,snapGrid:s}=n,o=n.virtual&&n.params.virtual.enabled;n.allowSlideNext=!0,n.allowSlidePrev=!0,n.updateSize(),n.updateSlides(),n.updateSlidesClasses();const l=o&&e.loop;(e.slidesPerView==="auto"||e.slidesPerView>1)&&n.isEnd&&!n.isBeginning&&!n.params.centeredSlides&&!l?n.slideTo(n.slides.length-1,0,!1,!0):n.params.loop&&!o?n.slideToLoop(n.realIndex,0,!1,!0):n.slideTo(n.activeIndex,0,!1,!0),n.autoplay&&n.autoplay.running&&n.autoplay.paused&&(clearTimeout(n.autoplay.resizeTimeout),n.autoplay.resizeTimeout=setTimeout(()=>{n.autoplay&&n.autoplay.running&&n.autoplay.paused&&n.autoplay.resume()},500)),n.allowSlidePrev=i,n.allowSlideNext=r,n.params.watchOverflow&&s!==n.snapGrid&&n.checkOverflow()}function kp(n){const e=this;e.enabled&&(e.allowClick||(e.params.preventClicks&&n.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(n.stopPropagation(),n.stopImmediatePropagation())))}function Ep(){const n=this,{wrapperEl:e,rtlTranslate:t,enabled:r}=n;if(!r)return;n.previousTranslate=n.translate,n.isHorizontal()?n.translate=-e.scrollLeft:n.translate=-e.scrollTop,n.translate===0&&(n.translate=0),n.updateActiveIndex(),n.updateSlidesClasses();let i;const s=n.maxTranslate()-n.minTranslate();s===0?i=0:i=(n.translate-n.minTranslate())/s,i!==n.progress&&n.updateProgress(t?-n.translate:n.translate),n.emit("setTranslate",n.translate,!1)}function Mp(n){const e=this;Fn(e,n.target),!(e.params.cssMode||e.params.slidesPerView!=="auto"&&!e.params.autoHeight)&&e.update()}function Ap(){const n=this;n.documentTouchHandlerProceeded||(n.documentTouchHandlerProceeded=!0,n.params.touchReleaseOnEdges&&(n.el.style.touchAction="auto"))}const Ta=(n,e)=>{const t=Ft(),{params:r,el:i,wrapperEl:s,device:o}=n,l=!!r.nested,a=e==="on"?"addEventListener":"removeEventListener",c=e;t[a]("touchstart",n.onDocumentTouchStart,{passive:!1,capture:l}),i[a]("touchstart",n.onTouchStart,{passive:!1}),i[a]("pointerdown",n.onTouchStart,{passive:!1}),t[a]("touchmove",n.onTouchMove,{passive:!1,capture:l}),t[a]("pointermove",n.onTouchMove,{passive:!1,capture:l}),t[a]("touchend",n.onTouchEnd,{passive:!0}),t[a]("pointerup",n.onTouchEnd,{passive:!0}),t[a]("pointercancel",n.onTouchEnd,{passive:!0}),t[a]("touchcancel",n.onTouchEnd,{passive:!0}),t[a]("pointerout",n.onTouchEnd,{passive:!0}),t[a]("pointerleave",n.onTouchEnd,{passive:!0}),t[a]("contextmenu",n.onTouchEnd,{passive:!0}),(r.preventClicks||r.preventClicksPropagation)&&i[a]("click",n.onClick,!0),r.cssMode&&s[a]("scroll",n.onScroll),r.updateOnWindowResize?n[c](o.ios||o.android?"resize orientationchange observerUpdate":"resize observerUpdate",vo,!0):n[c]("observerUpdate",vo,!0),i[a]("load",n.onLoad,{capture:!0})};function Pp(){const n=this,{params:e}=n;n.onTouchStart=Sp.bind(n),n.onTouchMove=Cp.bind(n),n.onTouchEnd=Tp.bind(n),n.onDocumentTouchStart=Ap.bind(n),e.cssMode&&(n.onScroll=Ep.bind(n)),n.onClick=kp.bind(n),n.onLoad=Mp.bind(n),Ta(n,"on")}function Op(){Ta(this,"off")}var Rp={attachEvents:Pp,detachEvents:Op};const xo=(n,e)=>n.grid&&e.grid&&e.grid.rows>1;function Np(){const n=this,{realIndex:e,initialized:t,params:r,el:i}=n,s=r.breakpoints;if(!s||s&&Object.keys(s).length===0)return;const o=n.getBreakpoint(s,n.params.breakpointsBase,n.el);if(!o||n.currentBreakpoint===o)return;const a=(o in s?s[o]:void 0)||n.originalParams,c=xo(n,r),u=xo(n,a),d=r.enabled;c&&!u?(i.classList.remove(`${r.containerModifierClass}grid`,`${r.containerModifierClass}grid-column`),n.emitContainerClasses()):!c&&u&&(i.classList.add(`${r.containerModifierClass}grid`),(a.grid.fill&&a.grid.fill==="column"||!a.grid.fill&&r.grid.fill==="column")&&i.classList.add(`${r.containerModifierClass}grid-column`),n.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach(g=>{if(typeof a[g]>"u")return;const S=r[g]&&r[g].enabled,w=a[g]&&a[g].enabled;S&&!w&&n[g].disable(),!S&&w&&n[g].enable()});const f=a.direction&&a.direction!==r.direction,p=r.loop&&(a.slidesPerView!==r.slidesPerView||f),h=r.loop;f&&t&&n.changeDirection(),we(n.params,a);const m=n.params.enabled,b=n.params.loop;Object.assign(n,{allowTouchMove:n.params.allowTouchMove,allowSlideNext:n.params.allowSlideNext,allowSlidePrev:n.params.allowSlidePrev}),d&&!m?n.disable():!d&&m&&n.enable(),n.currentBreakpoint=o,n.emit("_beforeBreakpoint",a),t&&(p?(n.loopDestroy(),n.loopCreate(e),n.updateSlides()):!h&&b?(n.loopCreate(e),n.updateSlides()):h&&!b&&n.loopDestroy()),n.emit("breakpoint",a)}function Ip(n,e,t){if(e===void 0&&(e="window"),!n||e==="container"&&!t)return;let r=!1;const i=Se(),s=e==="window"?i.innerHeight:t.clientHeight,o=Object.keys(n).map(l=>{if(typeof l=="string"&&l.indexOf("@")===0){const a=parseFloat(l.substr(1));return{value:s*a,point:l}}return{value:l,point:l}});o.sort((l,a)=>parseInt(l.value,10)-parseInt(a.value,10));for(let l=0;l<o.length;l+=1){const{point:a,value:c}=o[l];e==="window"?i.matchMedia(`(min-width: ${c}px)`).matches&&(r=a):c<=t.clientWidth&&(r=a)}return r||"max"}var Lp={setBreakpoint:Np,getBreakpoint:Ip};function _p(n,e){const t=[];return n.forEach(r=>{typeof r=="object"?Object.keys(r).forEach(i=>{r[i]&&t.push(e+i)}):typeof r=="string"&&t.push(e+r)}),t}function zp(){const n=this,{classNames:e,params:t,rtl:r,el:i,device:s}=n,o=_p(["initialized",t.direction,{"free-mode":n.params.freeMode&&t.freeMode.enabled},{autoheight:t.autoHeight},{rtl:r},{grid:t.grid&&t.grid.rows>1},{"grid-column":t.grid&&t.grid.rows>1&&t.grid.fill==="column"},{android:s.android},{ios:s.ios},{"css-mode":t.cssMode},{centered:t.cssMode&&t.centeredSlides},{"watch-progress":t.watchSlidesProgress}],t.containerModifierClass);e.push(...o),i.classList.add(...e),n.emitContainerClasses()}function jp(){const n=this,{el:e,classNames:t}=n;e.classList.remove(...t),n.emitContainerClasses()}var Dp={addClasses:zp,removeClasses:jp};function Bp(){const n=this,{isLocked:e,params:t}=n,{slidesOffsetBefore:r}=t;if(r){const i=n.slides.length-1,s=n.slidesGrid[i]+n.slidesSizesGrid[i]+r*2;n.isLocked=n.size>s}else n.isLocked=n.snapGrid.length===1;t.allowSlideNext===!0&&(n.allowSlideNext=!n.isLocked),t.allowSlidePrev===!0&&(n.allowSlidePrev=!n.isLocked),e&&e!==n.isLocked&&(n.isEnd=!1),e!==n.isLocked&&n.emit(n.isLocked?"lock":"unlock")}var $p={checkOverflow:Bp},Xi={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function Hp(n,e){return function(r){r===void 0&&(r={});const i=Object.keys(r)[0],s=r[i];if(typeof s!="object"||s===null){we(e,r);return}if(n[i]===!0&&(n[i]={enabled:!0}),i==="navigation"&&n[i]&&n[i].enabled&&!n[i].prevEl&&!n[i].nextEl&&(n[i].auto=!0),["pagination","scrollbar"].indexOf(i)>=0&&n[i]&&n[i].enabled&&!n[i].el&&(n[i].auto=!0),!(i in n&&"enabled"in s)){we(e,r);return}typeof n[i]=="object"&&!("enabled"in n[i])&&(n[i].enabled=!0),n[i]||(n[i]={enabled:!1}),we(e,r)}}const Zr={eventsEmitter:Df,update:Jf,translate:tp,transition:sp,slide:pp,loop:bp,grabCursor:vp,events:Rp,breakpoints:Lp,checkOverflow:$p,classes:Dp},ei={};let Rs=class Ue{constructor(){let e,t;for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];i.length===1&&i[0].constructor&&Object.prototype.toString.call(i[0]).slice(8,-1)==="Object"?t=i[0]:[e,t]=i,t||(t={}),t=we({},t),e&&!t.el&&(t.el=e);const o=Ft();if(t.el&&typeof t.el=="string"&&o.querySelectorAll(t.el).length>1){const u=[];return o.querySelectorAll(t.el).forEach(d=>{const f=we({},t,{el:d});u.push(new Ue(f))}),u}const l=this;l.__swiper__=!0,l.support=xa(),l.device=Sa({userAgent:t.userAgent}),l.browser=_f(),l.eventsListeners={},l.eventsAnyListeners=[],l.modules=[...l.__modules__],t.modules&&Array.isArray(t.modules)&&l.modules.push(...t.modules);const a={};l.modules.forEach(u=>{u({params:t,swiper:l,extendParams:Hp(t,a),on:l.on.bind(l),once:l.once.bind(l),off:l.off.bind(l),emit:l.emit.bind(l)})});const c=we({},Xi,a);return l.params=we({},c,ei,t),l.originalParams=we({},l.params),l.passedParams=we({},t),l.params&&l.params.on&&Object.keys(l.params.on).forEach(u=>{l.on(u,l.params.on[u])}),l.params&&l.params.onAny&&l.onAny(l.params.onAny),Object.assign(l,{enabled:l.params.enabled,el:e,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return l.params.direction==="horizontal"},isVertical(){return l.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:l.params.allowSlideNext,allowSlidePrev:l.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:l.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:l.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),l.emit("_swiper"),l.params.init&&l.init(),l}getDirectionLabel(e){return this.isHorizontal()?e:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[e]}getSlideIndex(e){const{slidesEl:t,params:r}=this,i=Ye(t,`.${r.slideClass}, swiper-slide`),s=bo(i[0]);return bo(e)-s}getSlideIndexByData(e){return this.getSlideIndex(this.slides.filter(t=>t.getAttribute("data-swiper-slide-index")*1===e)[0])}recalcSlides(){const e=this,{slidesEl:t,params:r}=e;e.slides=Ye(t,`.${r.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const r=this;e=Math.min(Math.max(e,0),1);const i=r.minTranslate(),o=(r.maxTranslate()-i)*e+i;r.translateTo(o,typeof t>"u"?0:t),r.updateActiveIndex(),r.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter(r=>r.indexOf("swiper")===0||r.indexOf(e.params.containerModifierClass)===0);e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter(r=>r.indexOf("swiper-slide")===0||r.indexOf(t.params.slideClass)===0).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach(r=>{const i=e.getSlideClasses(r);t.push({slideEl:r,classNames:i}),e.emit("_slideClass",r,i)}),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){e===void 0&&(e="current"),t===void 0&&(t=!1);const r=this,{params:i,slides:s,slidesGrid:o,slidesSizesGrid:l,size:a,activeIndex:c}=r;let u=1;if(typeof i.slidesPerView=="number")return i.slidesPerView;if(i.centeredSlides){let d=s[c]?Math.ceil(s[c].swiperSlideSize):0,f;for(let p=c+1;p<s.length;p+=1)s[p]&&!f&&(d+=Math.ceil(s[p].swiperSlideSize),u+=1,d>a&&(f=!0));for(let p=c-1;p>=0;p-=1)s[p]&&!f&&(d+=s[p].swiperSlideSize,u+=1,d>a&&(f=!0))}else if(e==="current")for(let d=c+1;d<s.length;d+=1)(t?o[d]+l[d]-o[c]<a:o[d]-o[c]<a)&&(u+=1);else for(let d=c-1;d>=0;d-=1)o[c]-o[d]<a&&(u+=1);return u}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:t,params:r}=e;r.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach(o=>{o.complete&&Fn(e,o)}),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses();function i(){const o=e.rtlTranslate?e.translate*-1:e.translate,l=Math.min(Math.max(o,e.maxTranslate()),e.minTranslate());e.setTranslate(l),e.updateActiveIndex(),e.updateSlidesClasses()}let s;if(r.freeMode&&r.freeMode.enabled&&!r.cssMode)i(),r.autoHeight&&e.updateAutoHeight();else{if((r.slidesPerView==="auto"||r.slidesPerView>1)&&e.isEnd&&!r.centeredSlides){const o=e.virtual&&r.virtual.enabled?e.virtual.slides:e.slides;s=e.slideTo(o.length-1,0,!1,!0)}else s=e.slideTo(e.activeIndex,0,!1,!0);s||i()}r.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){t===void 0&&(t=!0);const r=this,i=r.params.direction;return e||(e=i==="horizontal"?"vertical":"horizontal"),e===i||e!=="horizontal"&&e!=="vertical"||(r.el.classList.remove(`${r.params.containerModifierClass}${i}`),r.el.classList.add(`${r.params.containerModifierClass}${e}`),r.emitContainerClasses(),r.params.direction=e,r.slides.forEach(s=>{e==="vertical"?s.style.width="":s.style.height=""}),r.emit("changeDirection"),t&&r.update()),r}changeLanguageDirection(e){const t=this;t.rtl&&e==="rtl"||!t.rtl&&e==="ltr"||(t.rtl=e==="rtl",t.rtlTranslate=t.params.direction==="horizontal"&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir="rtl"):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let r=e||t.params.el;if(typeof r=="string"&&(r=document.querySelector(r)),!r)return!1;r.swiper=t,r.parentNode&&r.parentNode.host&&r.parentNode.host.nodeName===t.params.swiperElementNodeName.toUpperCase()&&(t.isElement=!0);const i=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let o=r&&r.shadowRoot&&r.shadowRoot.querySelector?r.shadowRoot.querySelector(i()):Ye(r,i())[0];return!o&&t.params.createElements&&(o=Ji("div",t.params.wrapperClass),r.append(o),Ye(r,`.${t.params.slideClass}`).forEach(l=>{o.append(l)})),Object.assign(t,{el:r,wrapperEl:o,slidesEl:t.isElement&&!r.parentNode.host.slideSlots?r.parentNode.host:o,hostEl:t.isElement?r.parentNode.host:r,mounted:!0,rtl:r.dir.toLowerCase()==="rtl"||rt(r,"direction")==="rtl",rtlTranslate:t.params.direction==="horizontal"&&(r.dir.toLowerCase()==="rtl"||rt(r,"direction")==="rtl"),wrongRTL:rt(o,"display")==="-webkit-box"}),!0}init(e){const t=this;if(t.initialized||t.mount(e)===!1)return t;t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(),t.attachEvents();const i=[...t.el.querySelectorAll('[loading="lazy"]')];return t.isElement&&i.push(...t.hostEl.querySelectorAll('[loading="lazy"]')),i.forEach(s=>{s.complete?Fn(t,s):s.addEventListener("load",o=>{Fn(t,o.target)})}),Yi(t),t.initialized=!0,Yi(t),t.emit("init"),t.emit("afterInit"),t}destroy(e,t){e===void 0&&(e=!0),t===void 0&&(t=!0);const r=this,{params:i,el:s,wrapperEl:o,slides:l}=r;return typeof r.params>"u"||r.destroyed||(r.emit("beforeDestroy"),r.initialized=!1,r.detachEvents(),i.loop&&r.loopDestroy(),t&&(r.removeClasses(),s.removeAttribute("style"),o.removeAttribute("style"),l&&l.length&&l.forEach(a=>{a.classList.remove(i.slideVisibleClass,i.slideFullyVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass),a.removeAttribute("style"),a.removeAttribute("data-swiper-slide-index")})),r.emit("destroy"),Object.keys(r.eventsListeners).forEach(a=>{r.off(a)}),e!==!1&&(r.el.swiper=null,kf(r)),r.destroyed=!0),null}static extendDefaults(e){we(ei,e)}static get extendedDefaults(){return ei}static get defaults(){return Xi}static installModule(e){Ue.prototype.__modules__||(Ue.prototype.__modules__=[]);const t=Ue.prototype.__modules__;typeof e=="function"&&t.indexOf(e)<0&&t.push(e)}static use(e){return Array.isArray(e)?(e.forEach(t=>Ue.installModule(t)),Ue):(Ue.installModule(e),Ue)}};Object.keys(Zr).forEach(n=>{Object.keys(Zr[n]).forEach(e=>{Rs.prototype[e]=Zr[n][e]})});Rs.use([zf,jf]);const ka=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function wt(n){return typeof n=="object"&&n!==null&&n.constructor&&Object.prototype.toString.call(n).slice(8,-1)==="Object"&&!n.__swiper__}function It(n,e){const t=["__proto__","constructor","prototype"];Object.keys(e).filter(r=>t.indexOf(r)<0).forEach(r=>{typeof n[r]>"u"?n[r]=e[r]:wt(e[r])&&wt(n[r])&&Object.keys(e[r]).length>0?e[r].__swiper__?n[r]=e[r]:It(n[r],e[r]):n[r]=e[r]})}function Ea(n){return n===void 0&&(n={}),n.navigation&&typeof n.navigation.nextEl>"u"&&typeof n.navigation.prevEl>"u"}function Ma(n){return n===void 0&&(n={}),n.pagination&&typeof n.pagination.el>"u"}function Aa(n){return n===void 0&&(n={}),n.scrollbar&&typeof n.scrollbar.el>"u"}function Pa(n){n===void 0&&(n="");const e=n.split(" ").map(r=>r.trim()).filter(r=>!!r),t=[];return e.forEach(r=>{t.indexOf(r)<0&&t.push(r)}),t.join(" ")}function Fp(n){return n===void 0&&(n=""),n?n.includes("swiper-wrapper")?n:`swiper-wrapper ${n}`:"swiper-wrapper"}function Vp(n){let{swiper:e,slides:t,passedParams:r,changedParams:i,nextEl:s,prevEl:o,scrollbarEl:l,paginationEl:a}=n;const c=i.filter(N=>N!=="children"&&N!=="direction"&&N!=="wrapperClass"),{params:u,pagination:d,navigation:f,scrollbar:p,virtual:h,thumbs:m}=e;let b,g,S,w,v,x,C,O;i.includes("thumbs")&&r.thumbs&&r.thumbs.swiper&&u.thumbs&&!u.thumbs.swiper&&(b=!0),i.includes("controller")&&r.controller&&r.controller.control&&u.controller&&!u.controller.control&&(g=!0),i.includes("pagination")&&r.pagination&&(r.pagination.el||a)&&(u.pagination||u.pagination===!1)&&d&&!d.el&&(S=!0),i.includes("scrollbar")&&r.scrollbar&&(r.scrollbar.el||l)&&(u.scrollbar||u.scrollbar===!1)&&p&&!p.el&&(w=!0),i.includes("navigation")&&r.navigation&&(r.navigation.prevEl||o)&&(r.navigation.nextEl||s)&&(u.navigation||u.navigation===!1)&&f&&!f.prevEl&&!f.nextEl&&(v=!0);const k=N=>{e[N]&&(e[N].destroy(),N==="navigation"?(e.isElement&&(e[N].prevEl.remove(),e[N].nextEl.remove()),u[N].prevEl=void 0,u[N].nextEl=void 0,e[N].prevEl=void 0,e[N].nextEl=void 0):(e.isElement&&e[N].el.remove(),u[N].el=void 0,e[N].el=void 0))};i.includes("loop")&&e.isElement&&(u.loop&&!r.loop?x=!0:!u.loop&&r.loop?C=!0:O=!0),c.forEach(N=>{if(wt(u[N])&&wt(r[N]))Object.assign(u[N],r[N]),(N==="navigation"||N==="pagination"||N==="scrollbar")&&"enabled"in r[N]&&!r[N].enabled&&k(N);else{const M=r[N];(M===!0||M===!1)&&(N==="navigation"||N==="pagination"||N==="scrollbar")?M===!1&&k(N):u[N]=r[N]}}),c.includes("controller")&&!g&&e.controller&&e.controller.control&&u.controller&&u.controller.control&&(e.controller.control=u.controller.control),i.includes("children")&&t&&h&&u.virtual.enabled?(h.slides=t,h.update(!0)):i.includes("virtual")&&h&&u.virtual.enabled&&(t&&(h.slides=t),h.update(!0)),i.includes("children")&&t&&u.loop&&(O=!0),b&&m.init()&&m.update(!0),g&&(e.controller.control=u.controller.control),S&&(e.isElement&&(!a||typeof a=="string")&&(a=document.createElement("div"),a.classList.add("swiper-pagination"),a.part.add("pagination"),e.el.appendChild(a)),a&&(u.pagination.el=a),d.init(),d.render(),d.update()),w&&(e.isElement&&(!l||typeof l=="string")&&(l=document.createElement("div"),l.classList.add("swiper-scrollbar"),l.part.add("scrollbar"),e.el.appendChild(l)),l&&(u.scrollbar.el=l),p.init(),p.updateSize(),p.setTranslate()),v&&(e.isElement&&((!s||typeof s=="string")&&(s=document.createElement("div"),s.classList.add("swiper-button-next"),s.innerHTML=e.hostEl.constructor.nextButtonSvg,s.part.add("button-next"),e.el.appendChild(s)),(!o||typeof o=="string")&&(o=document.createElement("div"),o.classList.add("swiper-button-prev"),o.innerHTML=e.hostEl.constructor.prevButtonSvg,o.part.add("button-prev"),e.el.appendChild(o))),s&&(u.navigation.nextEl=s),o&&(u.navigation.prevEl=o),f.init(),f.update()),i.includes("allowSlideNext")&&(e.allowSlideNext=r.allowSlideNext),i.includes("allowSlidePrev")&&(e.allowSlidePrev=r.allowSlidePrev),i.includes("direction")&&e.changeDirection(r.direction,!1),(x||O)&&e.loopDestroy(),(C||O)&&e.loopCreate(),e.update()}function Wp(n,e){n===void 0&&(n={}),e===void 0&&(e=!0);const t={on:{}},r={},i={};It(t,Xi),t._emitClasses=!0,t.init=!1;const s={},o=ka.map(a=>a.replace(/_/,"")),l=Object.assign({},n);return Object.keys(l).forEach(a=>{typeof n[a]>"u"||(o.indexOf(a)>=0?wt(n[a])?(t[a]={},i[a]={},It(t[a],n[a]),It(i[a],n[a])):(t[a]=n[a],i[a]=n[a]):a.search(/on[A-Z]/)===0&&typeof n[a]=="function"?e?r[`${a[2].toLowerCase()}${a.substr(3)}`]=n[a]:t.on[`${a[2].toLowerCase()}${a.substr(3)}`]=n[a]:s[a]=n[a])}),["navigation","pagination","scrollbar"].forEach(a=>{t[a]===!0&&(t[a]={}),t[a]===!1&&delete t[a]}),{params:t,passedParams:i,rest:s,events:r}}function qp(n,e){let{el:t,nextEl:r,prevEl:i,paginationEl:s,scrollbarEl:o,swiper:l}=n;Ea(e)&&r&&i&&(l.params.navigation.nextEl=r,l.originalParams.navigation.nextEl=r,l.params.navigation.prevEl=i,l.originalParams.navigation.prevEl=i),Ma(e)&&s&&(l.params.pagination.el=s,l.originalParams.pagination.el=s),Aa(e)&&o&&(l.params.scrollbar.el=o,l.originalParams.scrollbar.el=o),l.init(t)}function Gp(n,e,t,r,i){const s=[];if(!e)return s;const o=a=>{s.indexOf(a)<0&&s.push(a)};if(t&&r){const a=r.map(i),c=t.map(i);a.join("")!==c.join("")&&o("children"),r.length!==t.length&&o("children")}return ka.filter(a=>a[0]==="_").map(a=>a.replace(/_/,"")).forEach(a=>{if(a in n&&a in e)if(wt(n[a])&&wt(e[a])){const c=Object.keys(n[a]),u=Object.keys(e[a]);c.length!==u.length?o(a):(c.forEach(d=>{n[a][d]!==e[a][d]&&o(a)}),u.forEach(d=>{n[a][d]!==e[a][d]&&o(a)}))}else n[a]!==e[a]&&o(a)}),s}const Up=n=>{!n||n.destroyed||!n.params.virtual||n.params.virtual&&!n.params.virtual.enabled||(n.updateSlides(),n.updateProgress(),n.updateSlidesClasses(),n.parallax&&n.params.parallax&&n.params.parallax.enabled&&n.parallax.setTranslate())};function Xn(){return Xn=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Xn.apply(this,arguments)}function Oa(n){return n.type&&n.type.displayName&&n.type.displayName.includes("SwiperSlide")}function Ra(n){const e=[];return T.Children.toArray(n).forEach(t=>{Oa(t)?e.push(t):t.props&&t.props.children&&Ra(t.props.children).forEach(r=>e.push(r))}),e}function Kp(n){const e=[],t={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return T.Children.toArray(n).forEach(r=>{if(Oa(r))e.push(r);else if(r.props&&r.props.slot&&t[r.props.slot])t[r.props.slot].push(r);else if(r.props&&r.props.children){const i=Ra(r.props.children);i.length>0?i.forEach(s=>e.push(s)):t["container-end"].push(r)}else t["container-end"].push(r)}),{slides:e,slots:t}}function Jp(n,e,t){if(!t)return null;const r=u=>{let d=u;return u<0?d=e.length+u:d>=e.length&&(d=d-e.length),d},i=n.isHorizontal()?{[n.rtlTranslate?"right":"left"]:`${t.offset}px`}:{top:`${t.offset}px`},{from:s,to:o}=t,l=n.params.loop?-e.length:0,a=n.params.loop?e.length*2:e.length,c=[];for(let u=l;u<a;u+=1)u>=s&&u<=o&&c.push(e[r(u)]);return c.map((u,d)=>T.cloneElement(u,{swiper:n,style:i,key:`slide-${d}`}))}function Kt(n,e){return typeof window>"u"?T.useEffect(n,e):T.useLayoutEffect(n,e)}const So=T.createContext(null),Yp=T.createContext(null),Xp=T.forwardRef(function(n,e){let{className:t,tag:r="div",wrapperTag:i="div",children:s,onSwiper:o,...l}=n===void 0?{}:n,a=!1;const[c,u]=T.useState("swiper"),[d,f]=T.useState(null),[p,h]=T.useState(!1),m=T.useRef(!1),b=T.useRef(null),g=T.useRef(null),S=T.useRef(null),w=T.useRef(null),v=T.useRef(null),x=T.useRef(null),C=T.useRef(null),O=T.useRef(null),{params:k,passedParams:N,rest:M,events:I}=Wp(l),{slides:_,slots:L}=Kp(s),$=()=>{h(!p)};Object.assign(k.on,{_containerClasses(W,fe){u(fe)}});const V=()=>{Object.assign(k.on,I),a=!0;const W={...k};if(delete W.wrapperClass,g.current=new Rs(W),g.current.virtual&&g.current.params.virtual.enabled){g.current.virtual.slides=_;const fe={cache:!1,slides:_,renderExternal:f,renderExternalUpdate:!1};It(g.current.params.virtual,fe),It(g.current.originalParams.virtual,fe)}};b.current||V(),g.current&&g.current.on("_beforeBreakpoint",$);const ee=()=>{a||!I||!g.current||Object.keys(I).forEach(W=>{g.current.on(W,I[W])})},me=()=>{!I||!g.current||Object.keys(I).forEach(W=>{g.current.off(W,I[W])})};T.useEffect(()=>()=>{g.current&&g.current.off("_beforeBreakpoint",$)}),T.useEffect(()=>{!m.current&&g.current&&(g.current.emitSlidesClasses(),m.current=!0)}),Kt(()=>{if(e&&(e.current=b.current),!!b.current)return g.current.destroyed&&V(),qp({el:b.current,nextEl:v.current,prevEl:x.current,paginationEl:C.current,scrollbarEl:O.current,swiper:g.current},k),o&&!g.current.destroyed&&o(g.current),()=>{g.current&&!g.current.destroyed&&g.current.destroy(!0,!1)}},[]),Kt(()=>{ee();const W=Gp(N,S.current,_,w.current,fe=>fe.key);return S.current=N,w.current=_,W.length&&g.current&&!g.current.destroyed&&Vp({swiper:g.current,slides:_,passedParams:N,changedParams:W,nextEl:v.current,prevEl:x.current,scrollbarEl:O.current,paginationEl:C.current}),()=>{me()}}),Kt(()=>{Up(g.current)},[d]);function de(){return k.virtual?Jp(g.current,_,d):_.map((W,fe)=>T.cloneElement(W,{swiper:g.current,swiperSlideIndex:fe}))}return T.createElement(r,Xn({ref:b,className:Pa(`${c}${t?` ${t}`:""}`)},M),T.createElement(Yp.Provider,{value:g.current},L["container-start"],T.createElement(i,{className:Fp(k.wrapperClass)},L["wrapper-start"],de(),L["wrapper-end"]),Ea(k)&&T.createElement(T.Fragment,null,T.createElement("div",{ref:x,className:"swiper-button-prev"}),T.createElement("div",{ref:v,className:"swiper-button-next"})),Aa(k)&&T.createElement("div",{ref:O,className:"swiper-scrollbar"}),Ma(k)&&T.createElement("div",{ref:C,className:"swiper-pagination"}),L["container-end"]))});Xp.displayName="Swiper";const Qp=T.forwardRef(function(n,e){let{tag:t="div",children:r,className:i="",swiper:s,zoom:o,lazy:l,virtualIndex:a,swiperSlideIndex:c,...u}=n===void 0?{}:n;const d=T.useRef(null),[f,p]=T.useState("swiper-slide"),[h,m]=T.useState(!1);function b(v,x,C){x===d.current&&p(C)}Kt(()=>{if(typeof c<"u"&&(d.current.swiperSlideIndex=c),e&&(e.current=d.current),!(!d.current||!s)){if(s.destroyed){f!=="swiper-slide"&&p("swiper-slide");return}return s.on("_slideClass",b),()=>{s&&s.off("_slideClass",b)}}}),Kt(()=>{s&&d.current&&!s.destroyed&&p(s.getSlideClasses(d.current))},[s]);const g={isActive:f.indexOf("swiper-slide-active")>=0,isVisible:f.indexOf("swiper-slide-visible")>=0,isPrev:f.indexOf("swiper-slide-prev")>=0,isNext:f.indexOf("swiper-slide-next")>=0},S=()=>typeof r=="function"?r(g):r,w=()=>{m(!0)};return T.createElement(t,Xn({ref:d,className:Pa(`${f}${i?` ${i}`:""}`),"data-swiper-slide-index":a,onLoad:w},u),o&&T.createElement(So.Provider,{value:g},T.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof o=="number"?o:void 0},S(),l&&!h&&T.createElement("div",{className:"swiper-lazy-preloader"}))),!o&&T.createElement(So.Provider,{value:g},S(),l&&!h&&T.createElement("div",{className:"swiper-lazy-preloader"})))});Qp.displayName="SwiperSlide";const Zp=({content:n,themeName:e="wysiwyg",...t})=>y.jsx(af,{...t,themeName:e,dangerouslySetInnerHTML:{__html:hu.sanitize(n,{ADD_TAGS:["iframe"],ADD_ATTR:["allow","allowfullscreen","frameborder","scrolling","target"]})}});ks();const eh=n=>y.jsx("svg",{width:24,height:24,fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...n,children:y.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M18 6 6 18M6 6l12 12"})}),Na=T.memo(eh,G),th=Object.freeze(Object.defineProperty({__proto__:null,default:Na},Symbol.toStringTag,{value:"Module"})),nh=n=>y.jsxs("svg",{width:20,height:20,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...n,children:[y.jsxs("g",{stroke:"currentColor",clipPath:"url(#a)",children:[y.jsx("circle",{cx:"8.2727",cy:"8.2727",r:"7.2727"}),y.jsx("path",{d:"M13.4551 13.4531L19.5005 19.4986"})]}),y.jsx("defs",{children:y.jsx("clipPath",{children:y.jsx("path",{fill:"currentColor",d:"M0 0h14v14H0z"})})})]}),rh=T.memo(nh,G),ih=Object.freeze(Object.defineProperty({__proto__:null,default:rh},Symbol.toStringTag,{value:"Module"}));T.createContext(null);T.createContext(null);Es();var sh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Co={exports:{}},tn={};tn._=tn._interop_require_default=oh;function oh(n){return n&&n.__esModule?n:{default:n}}var wn={exports:{}},ti={},To;function Ia(){return To||(To=1,function(n){Object.defineProperty(n,"__esModule",{value:!0});function e(o,l){for(var a in l)Object.defineProperty(o,a,{enumerable:!0,get:l[a]})}e(n,{assign:function(){return s},searchParamsToUrlQuery:function(){return t},urlQueryToSearchParams:function(){return i}});function t(o){const l={};return o.forEach((a,c)=>{typeof l[c]>"u"?l[c]=a:Array.isArray(l[c])?l[c].push(a):l[c]=[l[c],a]}),l}function r(o){return typeof o=="string"||typeof o=="number"&&!isNaN(o)||typeof o=="boolean"?String(o):""}function i(o){const l=new URLSearchParams;return Object.entries(o).forEach(a=>{let[c,u]=a;Array.isArray(u)?u.forEach(d=>l.append(c,r(d))):l.set(c,r(u))}),l}function s(o){for(var l=arguments.length,a=new Array(l>1?l-1:0),c=1;c<l;c++)a[c-1]=arguments[c];return a.forEach(u=>{Array.from(u.keys()).forEach(d=>o.delete(d)),u.forEach((d,f)=>o.append(f,d))}),o}}(ti)),ti}var ni={},vn={},ko;function lh(){if(ko)return vn;ko=1;function n(t){if(typeof WeakMap!="function")return null;var r=new WeakMap,i=new WeakMap;return(n=function(s){return s?i:r})(t)}vn._=vn._interop_require_wildcard=e;function e(t,r){if(!r&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var i=n(r);if(i&&i.has(t))return i.get(t);var s={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in t)if(l!=="default"&&Object.prototype.hasOwnProperty.call(t,l)){var a=o?Object.getOwnPropertyDescriptor(t,l):null;a&&(a.get||a.set)?Object.defineProperty(s,l,a):s[l]=t[l]}return s.default=t,i&&i.set(t,s),s}return vn}var Eo;function La(){return Eo||(Eo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0});function e(a,c){for(var u in c)Object.defineProperty(a,u,{enumerable:!0,get:c[u]})}e(n,{formatUrl:function(){return s},formatWithValidation:function(){return l},urlObjectKeys:function(){return o}});const r=lh()._(Ia()),i=/https?|ftp|gopher|file/;function s(a){let{auth:c,hostname:u}=a,d=a.protocol||"",f=a.pathname||"",p=a.hash||"",h=a.query||"",m=!1;c=c?encodeURIComponent(c).replace(/%3A/i,":")+"@":"",a.host?m=c+a.host:u&&(m=c+(~u.indexOf(":")?"["+u+"]":u),a.port&&(m+=":"+a.port)),h&&typeof h=="object"&&(h=String(r.urlQueryToSearchParams(h)));let b=a.search||h&&"?"+h||"";return d&&!d.endsWith(":")&&(d+=":"),a.slashes||(!d||i.test(d))&&m!==!1?(m="//"+(m||""),f&&f[0]!=="/"&&(f="/"+f)):m||(m=""),p&&p[0]!=="#"&&(p="#"+p),b&&b[0]!=="?"&&(b="?"+b),f=f.replace(/[?#]/g,encodeURIComponent),b=b.replace("#","%23"),""+d+m+f+b+p}const o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(a){return process.env.NODE_ENV==="development"&&a!==null&&typeof a=="object"&&Object.keys(a).forEach(c=>{o.includes(c)||console.warn("Unknown key passed via urlObject into url.format: "+c)}),s(a)}}(ni)),ni}var ri={},Mo;function ah(){return Mo||(Mo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"omit",{enumerable:!0,get:function(){return e}});function e(t,r){const i={};return Object.keys(t).forEach(s=>{r.includes(s)||(i[s]=t[s])}),i}}(ri)),ri}var ii={},Ao;function jr(){return Ao||(Ao=1,function(n){Object.defineProperty(n,"__esModule",{value:!0});function e(v,x){for(var C in x)Object.defineProperty(v,C,{enumerable:!0,get:x[C]})}e(n,{DecodeError:function(){return h},MiddlewareNotFoundError:function(){return S},MissingStaticPage:function(){return g},NormalizeError:function(){return m},PageNotFoundError:function(){return b},SP:function(){return f},ST:function(){return p},WEB_VITALS:function(){return t},execOnce:function(){return r},getDisplayName:function(){return a},getLocationOrigin:function(){return o},getURL:function(){return l},isAbsoluteUrl:function(){return s},isResSent:function(){return c},loadGetInitialProps:function(){return d},normalizeRepeatedSlashes:function(){return u},stringifyError:function(){return w}});const t=["CLS","FCP","FID","INP","LCP","TTFB"];function r(v){let x=!1,C;return function(){for(var O=arguments.length,k=new Array(O),N=0;N<O;N++)k[N]=arguments[N];return x||(x=!0,C=v(...k)),C}}const i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=v=>i.test(v);function o(){const{protocol:v,hostname:x,port:C}=window.location;return v+"//"+x+(C?":"+C:"")}function l(){const{href:v}=window.location,x=o();return v.substring(x.length)}function a(v){return typeof v=="string"?v:v.displayName||v.name||"Unknown"}function c(v){return v.finished||v.headersSent}function u(v){const x=v.split("?");return x[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(x[1]?"?"+x.slice(1).join("?"):"")}async function d(v,x){if(process.env.NODE_ENV!=="production"){var C;if((C=v.prototype)!=null&&C.getInitialProps){const N='"'+a(v)+'.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.';throw new Error(N)}}const O=x.res||x.ctx&&x.ctx.res;if(!v.getInitialProps)return x.ctx&&x.Component?{pageProps:await d(x.Component,x.ctx)}:{};const k=await v.getInitialProps(x);if(O&&c(O))return k;if(!k){const N='"'+a(v)+'.getInitialProps()" should resolve to an object. But found "'+k+'" instead.';throw new Error(N)}return process.env.NODE_ENV!=="production"&&Object.keys(k).length===0&&!x.ctx&&console.warn(""+a(v)+" returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps"),k}const f=typeof performance<"u",p=f&&["mark","measure","getEntriesByName"].every(v=>typeof performance[v]=="function");class h extends Error{}class m extends Error{}class b extends Error{constructor(x){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+x}}class g extends Error{constructor(x,C){super(),this.message="Failed to load static file for page: "+x+" "+C}}class S extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function w(v){return JSON.stringify({message:v.message,stack:v.stack})}}(ii)),ii}var xn={exports:{}},si={},Po;function _a(){return Po||(Po=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"removeTrailingSlash",{enumerable:!0,get:function(){return e}});function e(t){return t.replace(/\/$/,"")||"/"}}(si)),si}var oi={},Oo;function Ns(){return Oo||(Oo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"parsePath",{enumerable:!0,get:function(){return e}});function e(t){const r=t.indexOf("#"),i=t.indexOf("?"),s=i>-1&&(r<0||i<r);return s||r>-1?{pathname:t.substring(0,s?i:r),query:s?t.substring(i,r>-1?r:void 0):"",hash:r>-1?t.slice(r):""}:{pathname:t,query:"",hash:""}}}(oi)),oi}var Ro;function Dr(){return Ro||(Ro=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return i}});const t=_a(),r=Ns(),i=s=>{if(!s.startsWith("/")||process.env.__NEXT_MANUAL_TRAILING_SLASH)return s;const{pathname:o,query:l,hash:a}=(0,r.parsePath)(s);return process.env.__NEXT_TRAILING_SLASH?/\.[^/]+\/?$/.test(o)?""+(0,t.removeTrailingSlash)(o)+l+a:o.endsWith("/")?""+o+l+a:o+"/"+l+a:""+(0,t.removeTrailingSlash)(o)+l+a};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),n.exports=e.default)}(xn,xn.exports)),xn.exports}var li={},Sn={exports:{}},ai={},No;function za(){return No||(No=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"pathHasPrefix",{enumerable:!0,get:function(){return t}});const e=Ns();function t(r,i){if(typeof r!="string")return!1;const{pathname:s}=(0,e.parsePath)(r);return s===i||s.startsWith(i+"/")}}(ai)),ai}var Io;function ch(){return Io||(Io=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"hasBasePath",{enumerable:!0,get:function(){return i}});const t=za(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function i(s){return(0,t.pathHasPrefix)(s,r)}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),n.exports=e.default)}(Sn,Sn.exports)),Sn.exports}var Lo;function ja(){return Lo||(Lo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return r}});const e=jr(),t=ch();function r(i){if(!(0,e.isAbsoluteUrl)(i))return!0;try{const s=(0,e.getLocationOrigin)(),o=new URL(i,s);return o.origin===s&&(0,t.hasBasePath)(o.pathname)}catch{return!1}}}(li)),li}var ci={},ui={},_o;function uh(){return _o||(_o=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getSortedRoutes",{enumerable:!0,get:function(){return t}});class e{insert(i){this._insert(i.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(i){i===void 0&&(i="/");const s=[...this.children.keys()].sort();this.slugName!==null&&s.splice(s.indexOf("[]"),1),this.restSlugName!==null&&s.splice(s.indexOf("[...]"),1),this.optionalRestSlugName!==null&&s.splice(s.indexOf("[[...]]"),1);const o=s.map(l=>this.children.get(l)._smoosh(""+i+l+"/")).reduce((l,a)=>[...l,...a],[]);if(this.slugName!==null&&o.push(...this.children.get("[]")._smoosh(i+"["+this.slugName+"]/")),!this.placeholder){const l=i==="/"?"/":i.slice(0,-1);if(this.optionalRestSlugName!=null)throw new Error('You cannot define a route with the same specificity as a optional catch-all route ("'+l+'" and "'+l+"[[..."+this.optionalRestSlugName+']]").');o.unshift(l)}return this.restSlugName!==null&&o.push(...this.children.get("[...]")._smoosh(i+"[..."+this.restSlugName+"]/")),this.optionalRestSlugName!==null&&o.push(...this.children.get("[[...]]")._smoosh(i+"[[..."+this.optionalRestSlugName+"]]/")),o}_insert(i,s,o){if(i.length===0){this.placeholder=!1;return}if(o)throw new Error("Catch-all must be the last part of the URL.");let l=i[0];if(l.startsWith("[")&&l.endsWith("]")){let u=function(d,f){if(d!==null&&d!==f)throw new Error("You cannot use different slug names for the same dynamic path ('"+d+"' !== '"+f+"').");s.forEach(p=>{if(p===f)throw new Error('You cannot have the same slug name "'+f+'" repeat within a single dynamic path');if(p.replace(/\W/g,"")===l.replace(/\W/g,""))throw new Error('You cannot have the slug names "'+p+'" and "'+f+'" differ only by non-word symbols within a single dynamic path')}),s.push(f)},a=l.slice(1,-1),c=!1;if(a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1),c=!0),a.startsWith("...")&&(a=a.substring(3),o=!0),a.startsWith("[")||a.endsWith("]"))throw new Error("Segment names may not start or end with extra brackets ('"+a+"').");if(a.startsWith("."))throw new Error("Segment names may not start with erroneous periods ('"+a+"').");if(o)if(c){if(this.restSlugName!=null)throw new Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+i[0]+'" ).');u(this.optionalRestSlugName,a),this.optionalRestSlugName=a,l="[[...]]"}else{if(this.optionalRestSlugName!=null)throw new Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+i[0]+'").');u(this.restSlugName,a),this.restSlugName=a,l="[...]"}else{if(c)throw new Error('Optional route parameters are not yet supported ("'+i[0]+'").');u(this.slugName,a),this.slugName=a,l="[]"}}this.children.has(l)||this.children.set(l,new e),this.children.get(l)._insert(i.slice(1),s,o)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function t(r){const i=new e;return r.forEach(s=>i.insert(s)),i.smoosh()}}(ui)),ui}var di={},fi={},pi={},hi={},zo;function dh(){return zo||(zo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"ensureLeadingSlash",{enumerable:!0,get:function(){return e}});function e(t){return t.startsWith("/")?t:"/"+t}}(hi)),hi}var mi={},jo;function fh(){return jo||(jo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0});function e(s,o){for(var l in o)Object.defineProperty(s,l,{enumerable:!0,get:o[l]})}e(n,{DEFAULT_SEGMENT_KEY:function(){return i},PAGE_SEGMENT_KEY:function(){return r},isGroupSegment:function(){return t}});function t(s){return s[0]==="("&&s.endsWith(")")}const r="__PAGE__",i="__DEFAULT__"}(mi)),mi}var Do;function ph(){return Do||(Do=1,function(n){Object.defineProperty(n,"__esModule",{value:!0});function e(o,l){for(var a in l)Object.defineProperty(o,a,{enumerable:!0,get:l[a]})}e(n,{normalizeAppPath:function(){return i},normalizeRscURL:function(){return s}});const t=dh(),r=fh();function i(o){return(0,t.ensureLeadingSlash)(o.split("/").reduce((l,a,c,u)=>!a||(0,r.isGroupSegment)(a)||a[0]==="@"||(a==="page"||a==="route")&&c===u.length-1?l:l+"/"+a,""))}function s(o){return o.replace(/\.rsc($|\?)/,"$1")}}(pi)),pi}var Bo;function Da(){return Bo||(Bo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0});function e(o,l){for(var a in l)Object.defineProperty(o,a,{enumerable:!0,get:l[a]})}e(n,{INTERCEPTION_ROUTE_MARKERS:function(){return r},extractInterceptionRouteInformation:function(){return s},isInterceptionRouteAppPath:function(){return i}});const t=ph(),r=["(..)(..)","(.)","(..)","(...)"];function i(o){return o.split("/").find(l=>r.find(a=>l.startsWith(a)))!==void 0}function s(o){let l,a,c;for(const u of o.split("/"))if(a=r.find(d=>u.startsWith(d)),a){[l,c]=o.split(a,2);break}if(!l||!a||!c)throw new Error(`Invalid interception route: ${o}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);switch(l=(0,t.normalizeAppPath)(l),a){case"(.)":l==="/"?c=`/${c}`:c=l+"/"+c;break;case"(..)":if(l==="/")throw new Error(`Invalid interception route: ${o}. Cannot use (..) marker at the root level, use (.) instead.`);c=l.split("/").slice(0,-1).concat(c).join("/");break;case"(...)":c="/"+c;break;case"(..)(..)":const u=l.split("/");if(u.length<=2)throw new Error(`Invalid interception route: ${o}. Cannot use (..)(..) marker at the root level or one level up.`);c=u.slice(0,-2).concat(c).join("/");break;default:throw new Error("Invariant: unexpected marker")}return{interceptingRoute:l,interceptedRoute:c}}}(fi)),fi}var $o;function hh(){return $o||($o=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isDynamicRoute",{enumerable:!0,get:function(){return r}});const e=Da(),t=/\/\[[^/]+?\](?=\/|$)/;function r(i){return(0,e.isInterceptionRouteAppPath)(i)&&(i=(0,e.extractInterceptionRouteInformation)(i).interceptedRoute),t.test(i)}}(di)),di}var Ho;function mh(){return Ho||(Ho=1,function(n){Object.defineProperty(n,"__esModule",{value:!0});function e(i,s){for(var o in s)Object.defineProperty(i,o,{enumerable:!0,get:s[o]})}e(n,{getSortedRoutes:function(){return t.getSortedRoutes},isDynamicRoute:function(){return r.isDynamicRoute}});const t=uh(),r=hh()}(ci)),ci}var gi={},bi={},Fo;function gh(){return Fo||(Fo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getRouteMatcher",{enumerable:!0,get:function(){return t}});const e=jr();function t(r){let{re:i,groups:s}=r;return o=>{const l=i.exec(o);if(!l)return!1;const a=u=>{try{return decodeURIComponent(u)}catch{throw new e.DecodeError("failed to decode param")}},c={};return Object.keys(s).forEach(u=>{const d=s[u],f=l[d.pos];f!==void 0&&(c[u]=~f.indexOf("/")?f.split("/").map(p=>a(p)):d.repeat?[a(f)]:a(f))}),c}}}(bi)),bi}var yi={},wi={},Vo;function bh(){return Vo||(Vo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"escapeStringRegexp",{enumerable:!0,get:function(){return r}});const e=/[|\\{}()[\]^$+*?.-]/,t=/[|\\{}()[\]^$+*?.-]/g;function r(i){return e.test(i)?i.replace(t,"\\$&"):i}}(wi)),wi}var Wo;function yh(){return Wo||(Wo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0});function e(m,b){for(var g in b)Object.defineProperty(m,g,{enumerable:!0,get:b[g]})}e(n,{getNamedMiddlewareRegex:function(){return h},getNamedRouteRegex:function(){return p},getRouteRegex:function(){return c}});const t=Da(),r=bh(),i=_a(),s="nxtP",o="nxtI";function l(m){const b=m.startsWith("[")&&m.endsWith("]");b&&(m=m.slice(1,-1));const g=m.startsWith("...");return g&&(m=m.slice(3)),{key:m,repeat:g,optional:b}}function a(m){const b=(0,i.removeTrailingSlash)(m).slice(1).split("/"),g={};let S=1;return{parameterizedRoute:b.map(w=>{const v=t.INTERCEPTION_ROUTE_MARKERS.find(C=>w.startsWith(C)),x=w.match(/\[((?:\[.*\])|.+)\]/);if(v&&x){const{key:C,optional:O,repeat:k}=l(x[1]);return g[C]={pos:S++,repeat:k,optional:O},"/"+(0,r.escapeStringRegexp)(v)+"([^/]+?)"}else if(x){const{key:C,repeat:O,optional:k}=l(x[1]);return g[C]={pos:S++,repeat:O,optional:k},O?k?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}else return"/"+(0,r.escapeStringRegexp)(w)}).join(""),groups:g}}function c(m){const{parameterizedRoute:b,groups:g}=a(m);return{re:new RegExp("^"+b+"(?:/)?$"),groups:g}}function u(){let m=0;return()=>{let b="",g=++m;for(;g>0;)b+=String.fromCharCode(97+(g-1)%26),g=Math.floor((g-1)/26);return b}}function d(m){let{interceptionMarker:b,getSafeRouteKey:g,segment:S,routeKeys:w,keyPrefix:v}=m;const{key:x,optional:C,repeat:O}=l(S);let k=x.replace(/\W/g,"");v&&(k=""+v+k);let N=!1;(k.length===0||k.length>30)&&(N=!0),isNaN(parseInt(k.slice(0,1)))||(N=!0),N&&(k=g()),v?w[k]=""+v+x:w[k]=x;const M=b?(0,r.escapeStringRegexp)(b):"";return O?C?"(?:/"+M+"(?<"+k+">.+?))?":"/"+M+"(?<"+k+">.+?)":"/"+M+"(?<"+k+">[^/]+?)"}function f(m,b){const g=(0,i.removeTrailingSlash)(m).slice(1).split("/"),S=u(),w={};return{namedParameterizedRoute:g.map(v=>{const x=t.INTERCEPTION_ROUTE_MARKERS.some(O=>v.startsWith(O)),C=v.match(/\[((?:\[.*\])|.+)\]/);if(x&&C){const[O]=v.split(C[0]);return d({getSafeRouteKey:S,interceptionMarker:O,segment:C[1],routeKeys:w,keyPrefix:b?o:void 0})}else return C?d({getSafeRouteKey:S,segment:C[1],routeKeys:w,keyPrefix:b?s:void 0}):"/"+(0,r.escapeStringRegexp)(v)}).join(""),routeKeys:w}}function p(m,b){const g=f(m,b);return{...c(m),namedRegex:"^"+g.namedParameterizedRoute+"(?:/)?$",routeKeys:g.routeKeys}}function h(m,b){const{parameterizedRoute:g}=a(m),{catchAll:S=!0}=b;if(g==="/")return{namedRegex:"^/"+(S?".*":"")+"$"};const{namedParameterizedRoute:w}=f(m,!1);let v=S?"(?:(/.*)?)":"";return{namedRegex:"^"+w+v+"$"}}}(yi)),yi}var qo;function wh(){return qo||(qo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"interpolateAs",{enumerable:!0,get:function(){return r}});const e=gh(),t=yh();function r(i,s,o){let l="";const a=(0,t.getRouteRegex)(i),c=a.groups,u=(s!==i?(0,e.getRouteMatcher)(a)(s):"")||o;l=i;const d=Object.keys(c);return d.every(f=>{let p=u[f]||"";const{repeat:h,optional:m}=c[f];let b="["+(h?"...":"")+f+"]";return m&&(b=(p?"":"/")+"["+b+"]"),h&&!Array.isArray(p)&&(p=[p]),(m||f in u)&&(l=l.replace(b,h?p.map(g=>encodeURIComponent(g)).join("/"):encodeURIComponent(p))||"/")})||(l=""),{params:d,result:l}}}(gi)),gi}var Go;function vh(){return Go||(Go=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"resolveHref",{enumerable:!0,get:function(){return u}});const t=Ia(),r=La(),i=ah(),s=jr(),o=Dr(),l=ja(),a=mh(),c=wh();function u(d,f,p){let h,m=typeof f=="string"?f:(0,r.formatWithValidation)(f);const b=m.match(/^[a-zA-Z]{1,}:\/\//),g=b?m.slice(b[0].length):m;if((g.split("?",1)[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href '"+m+"' passed to next/router in page: '"+d.pathname+"'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");const w=(0,s.normalizeRepeatedSlashes)(g);m=(b?b[0]:"")+w}if(!(0,l.isLocalURL)(m))return p?[m]:m;try{h=new URL(m.startsWith("#")?d.asPath:d.pathname,"http://n")}catch{h=new URL("/","http://n")}try{const w=new URL(m,h);w.pathname=(0,o.normalizePathTrailingSlash)(w.pathname);let v="";if((0,a.isDynamicRoute)(w.pathname)&&w.searchParams&&p){const C=(0,t.searchParamsToUrlQuery)(w.searchParams),{result:O,params:k}=(0,c.interpolateAs)(w.pathname,w.pathname,C);O&&(v=(0,r.formatWithValidation)({pathname:O,hash:w.hash,query:(0,i.omit)(C,k)}))}const x=w.origin===h.origin?w.href.slice(w.origin.length):w.href;return p?[x,v||x]:x}catch{return p?[m]:m}}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),n.exports=e.default)}(wn,wn.exports)),wn.exports}var Cn={exports:{}},vi={},xi={},Uo;function Ba(){return Uo||(Uo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"addPathPrefix",{enumerable:!0,get:function(){return t}});const e=Ns();function t(r,i){if(!r.startsWith("/")||!i)return r;const{pathname:s,query:o,hash:l}=(0,e.parsePath)(r);return""+i+s+o+l}}(xi)),xi}var Ko;function xh(){return Ko||(Ko=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"addLocale",{enumerable:!0,get:function(){return r}});const e=Ba(),t=za();function r(i,s,o,l){if(!s||s===o)return i;const a=i.toLowerCase();return!l&&((0,t.pathHasPrefix)(a,"/api")||(0,t.pathHasPrefix)(a,"/"+s.toLowerCase()))?i:(0,e.addPathPrefix)(i,"/"+s)}}(vi)),vi}var Jo;function Sh(){return Jo||(Jo=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLocale",{enumerable:!0,get:function(){return r}});const t=Dr(),r=function(i){for(var s=arguments.length,o=new Array(s>1?s-1:0),l=1;l<s;l++)o[l-1]=arguments[l];return process.env.__NEXT_I18N_SUPPORT?(0,t.normalizePathTrailingSlash)(xh().addLocale(i,...o)):i};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),n.exports=e.default)}(Cn,Cn.exports)),Cn.exports}var Si={},Yo;function Ch(){return Yo||(Yo=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"RouterContext",{enumerable:!0,get:function(){return r}});const r=tn._(T).default.createContext(null);process.env.NODE_ENV!=="production"&&(r.displayName="RouterContext")}(Si)),Si}var Ci={},Xo;function Th(){return Xo||(Xo=1,function(n){"use client";Object.defineProperty(n,"__esModule",{value:!0});function e(c,u){for(var d in u)Object.defineProperty(c,d,{enumerable:!0,get:u[d]})}e(n,{AppRouterContext:function(){return i},GlobalLayoutRouterContext:function(){return o},LayoutRouterContext:function(){return s},MissingSlotContext:function(){return a},TemplateContext:function(){return l}});const r=tn._(T),i=r.default.createContext(null),s=r.default.createContext(null),o=r.default.createContext(null),l=r.default.createContext(null);process.env.NODE_ENV!=="production"&&(i.displayName="AppRouterContext",s.displayName="LayoutRouterContext",o.displayName="GlobalLayoutRouterContext",l.displayName="TemplateContext");const a=r.default.createContext(new Set)}(Ci)),Ci}var Tn={exports:{}},kn={exports:{}},Qo;function kh(){return Qo||(Qo=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,o){for(var l in o)Object.defineProperty(s,l,{enumerable:!0,get:o[l]})}t(e,{cancelIdleCallback:function(){return i},requestIdleCallback:function(){return r}});const r=typeof self<"u"&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(s){let o=Date.now();return self.setTimeout(function(){s({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-o))}})},1)},i=typeof self<"u"&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(s){return clearTimeout(s)};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),n.exports=e.default)}(kn,kn.exports)),kn.exports}var Zo;function Eh(){return Zo||(Zo=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"useIntersection",{enumerable:!0,get:function(){return c}});const t=T,r=kh(),i=typeof IntersectionObserver=="function",s=new Map,o=[];function l(u){const d={root:u.root||null,margin:u.rootMargin||""},f=o.find(b=>b.root===d.root&&b.margin===d.margin);let p;if(f&&(p=s.get(f),p))return p;const h=new Map,m=new IntersectionObserver(b=>{b.forEach(g=>{const S=h.get(g.target),w=g.isIntersecting||g.intersectionRatio>0;S&&w&&S(w)})},u);return p={id:d,observer:m,elements:h},o.push(d),s.set(d,p),p}function a(u,d,f){const{id:p,observer:h,elements:m}=l(f);return m.set(u,d),h.observe(u),function(){if(m.delete(u),h.unobserve(u),m.size===0){h.disconnect(),s.delete(p);const g=o.findIndex(S=>S.root===p.root&&S.margin===p.margin);g>-1&&o.splice(g,1)}}}function c(u){let{rootRef:d,rootMargin:f,disabled:p}=u;const h=p||!i,[m,b]=(0,t.useState)(!1),g=(0,t.useRef)(null),S=(0,t.useCallback)(v=>{g.current=v},[]);(0,t.useEffect)(()=>{if(i){if(h||m)return;const v=g.current;if(v&&v.tagName)return a(v,C=>C&&b(C),{root:d==null?void 0:d.current,rootMargin:f})}else if(!m){const v=(0,r.requestIdleCallback)(()=>b(!0));return()=>(0,r.cancelIdleCallback)(v)}},[h,f,d,m,g.current]);const w=(0,t.useCallback)(()=>{b(!1)},[]);return[S,m,w]}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),n.exports=e.default)}(Tn,Tn.exports)),Tn.exports}var En={exports:{}},Mn={exports:{}},Ti={},el;function Mh(){return el||(el=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"normalizeLocalePath",{enumerable:!0,get:function(){return e}});function e(t,r){let i;const s=t.split("/");return(r||[]).some(o=>s[1]&&s[1].toLowerCase()===o.toLowerCase()?(i=o,s.splice(1,1),t=s.join("/")||"/",!0):!1),{pathname:t,detectedLocale:i}}}(Ti)),Ti}var tl;function Ah(){return tl||(tl=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizeLocalePath",{enumerable:!0,get:function(){return t}});const t=(r,i)=>process.env.__NEXT_I18N_SUPPORT?Mh().normalizeLocalePath(r,i):{pathname:r,detectedLocale:void 0};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),n.exports=e.default)}(Mn,Mn.exports)),Mn.exports}var An={exports:{}},ki={},nl;function Ph(){return nl||(nl=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"detectDomainLocale",{enumerable:!0,get:function(){return e}});function e(t,r,i){if(t){i&&(i=i.toLowerCase());for(const l of t){var s,o;const a=(s=l.domain)==null?void 0:s.split(":",1)[0].toLowerCase();if(r===a||i===l.defaultLocale.toLowerCase()||(o=l.locales)!=null&&o.some(c=>c.toLowerCase()===i))return l}}}}(ki)),ki}var rl;function Oh(){return rl||(rl=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"detectDomainLocale",{enumerable:!0,get:function(){return t}});const t=function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];if(process.env.__NEXT_I18N_SUPPORT)return Ph().detectDomainLocale(...i)};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),n.exports=e.default)}(An,An.exports)),An.exports}var il;function Rh(){return il||(il=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getDomainLocale",{enumerable:!0,get:function(){return i}});const t=Dr(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function i(s,o,l,a){if(process.env.__NEXT_I18N_SUPPORT){const c=Ah().normalizeLocalePath,u=Oh().detectDomainLocale,d=o||c(s,l).detectedLocale,f=u(a,void 0,d);if(f){const p="http"+(f.http?"":"s")+"://",h=d===f.defaultLocale?"":"/"+d;return""+p+f.domain+(0,t.normalizePathTrailingSlash)(""+r+h+s)}return!1}else return!1}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),n.exports=e.default)}(En,En.exports)),En.exports}var Pn={exports:{}},sl;function Nh(){return sl||(sl=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addBasePath",{enumerable:!0,get:function(){return s}});const t=Ba(),r=Dr(),i=process.env.__NEXT_ROUTER_BASEPATH||"";function s(o,l){return(0,r.normalizePathTrailingSlash)(process.env.__NEXT_MANUAL_CLIENT_BASE_PATH&&!l?o:(0,t.addPathPrefix)(o,i))}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),n.exports=e.default)}(Pn,Pn.exports)),Pn.exports}var On={exports:{}},ol;function Ih(){return ol||(ol=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0});function t(p,h){for(var m in h)Object.defineProperty(p,m,{enumerable:!0,get:h[m]})}t(e,{ACTION_FAST_REFRESH:function(){return a},ACTION_NAVIGATE:function(){return i},ACTION_PREFETCH:function(){return l},ACTION_REFRESH:function(){return r},ACTION_RESTORE:function(){return s},ACTION_SERVER_ACTION:function(){return c},ACTION_SERVER_PATCH:function(){return o},PrefetchCacheEntryStatus:function(){return d},PrefetchKind:function(){return u},isThenable:function(){return f}});const r="refresh",i="navigate",s="restore",o="server-patch",l="prefetch",a="fast-refresh",c="server-action";var u;(function(p){p.AUTO="auto",p.FULL="full",p.TEMPORARY="temporary"})(u||(u={}));var d;(function(p){p.fresh="fresh",p.reusable="reusable",p.expired="expired",p.stale="stale"})(d||(d={}));function f(p){return p&&(typeof p=="object"||typeof p=="function")&&typeof p.then=="function"}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),n.exports=e.default)}(On,On.exports)),On.exports}(function(n,e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return C}});const t=tn,r=y,i=t._(T),s=vh(),o=ja(),l=La(),a=jr(),c=Sh(),u=Ch(),d=Th(),f=Eh(),p=Rh(),h=Nh(),m=Ih(),b=new Set;function g(O,k,N,M,I,_){if(typeof window>"u"||!_&&!(0,o.isLocalURL)(k))return;if(!M.bypassPrefetchedCheck){const $=typeof M.locale<"u"?M.locale:"locale"in O?O.locale:void 0,V=k+"%"+N+"%"+$;if(b.has(V))return;b.add(V)}const L=_?O.prefetch(k,I):O.prefetch(k,N,M);Promise.resolve(L).catch($=>{if(process.env.NODE_ENV!=="production")throw $})}function S(O){const N=O.currentTarget.getAttribute("target");return N&&N!=="_self"||O.metaKey||O.ctrlKey||O.shiftKey||O.altKey||O.nativeEvent&&O.nativeEvent.which===2}function w(O,k,N,M,I,_,L,$,V){const{nodeName:ee}=O.currentTarget;if(ee.toUpperCase()==="A"&&(S(O)||!V&&!(0,o.isLocalURL)(N)))return;O.preventDefault();const de=()=>{const W=L??!0;"beforePopState"in k?k[I?"replace":"push"](N,M,{shallow:_,locale:$,scroll:W}):k[I?"replace":"push"](M||N,{scroll:W})};V?i.default.startTransition(de):de()}function v(O){return typeof O=="string"?O:(0,l.formatUrl)(O)}const C=i.default.forwardRef(function(k,N){let M;const{href:I,as:_,children:L,prefetch:$=null,passHref:V,replace:ee,shallow:me,scroll:de,locale:W,onClick:fe,onMouseEnter:qt,onTouchStart:pn,legacyBehavior:Ae=!1,...uu}=k;M=L,Ae&&(typeof M=="string"||typeof M=="number")&&(M=(0,r.jsx)("a",{children:M}));const te=i.default.useContext(u.RouterContext),du=i.default.useContext(d.AppRouterContext),Ve=te??du,We=!te,hn=$!==!1,mn=$===null?m.PrefetchKind.AUTO:m.PrefetchKind.FULL;if(process.env.NODE_ENV!=="production"){let H=function(F){return new Error("Failed prop type: The prop `"+F.key+"` expects a "+F.expected+" in `<Link>`, but got `"+F.actual+"` instead."+(typeof window<"u"?`
|
|
94
|
+
Open your browser's console to view the Component stack trace.`:""))};Object.keys({href:!0}).forEach(F=>{if(F==="href"&&(k[F]==null||typeof k[F]!="string"&&typeof k[F]!="object"))throw H({key:F,expected:"`string` or `object`",actual:k[F]===null?"null":typeof k[F]})}),Object.keys({as:!0,replace:!0,scroll:!0,shallow:!0,passHref:!0,prefetch:!0,locale:!0,onClick:!0,onMouseEnter:!0,onTouchStart:!0,legacyBehavior:!0}).forEach(F=>{const Ge=typeof k[F];if(F==="as"){if(k[F]&&Ge!=="string"&&Ge!=="object")throw H({key:F,expected:"`string` or `object`",actual:Ge})}else if(F==="locale"){if(k[F]&&Ge!=="string")throw H({key:F,expected:"`string`",actual:Ge})}else if(F==="onClick"||F==="onMouseEnter"||F==="onTouchStart"){if(k[F]&&Ge!=="function")throw H({key:F,expected:"`function`",actual:Ge})}else if((F==="replace"||F==="scroll"||F==="shallow"||F==="passHref"||F==="prefetch"||F==="legacyBehavior")&&k[F]!=null&&Ge!=="boolean")throw H({key:F,expected:"`boolean`",actual:Ge})});const ho=i.default.useRef(!1);k.prefetch&&!ho.current&&!We&&(ho.current=!0,console.warn("Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://nextjs.org/docs/messages/prefetch-true-deprecated"))}if(process.env.NODE_ENV!=="production"&&We&&!_){let H;if(typeof I=="string"?H=I:typeof I=="object"&&typeof I.pathname=="string"&&(H=I.pathname),H&&H.split("/").some(Et=>Et.startsWith("[")&&Et.endsWith("]")))throw new Error("Dynamic href `"+H+"` found in <Link> while using the `/app` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href")}const{href:qe,as:ge}=i.default.useMemo(()=>{if(!te){const Et=v(I);return{href:Et,as:_?v(_):Et}}const[H,Xe]=(0,s.resolveHref)(te,I,!0);return{href:H,as:_?(0,s.resolveHref)(te,_):Xe||H}},[te,I,_]),ao=i.default.useRef(qe),co=i.default.useRef(ge);let oe;if(Ae)if(process.env.NODE_ENV==="development"){fe&&console.warn('"onClick" was passed to <Link> with `href` of `'+I+'` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link'),qt&&console.warn('"onMouseEnter" was passed to <Link> with `href` of `'+I+'` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link');try{oe=i.default.Children.only(M)}catch{throw M?new Error("Multiple children were passed to <Link> with `href` of `"+I+"` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children"+(typeof window<"u"?`
|
|
95
|
+
Open your browser's console to view the Component stack trace.`:"")):new Error("No children were passed to <Link> with `href` of `"+I+"` but one child is required https://nextjs.org/docs/messages/link-no-children")}}else oe=i.default.Children.only(M);else if(process.env.NODE_ENV==="development"&&(M==null?void 0:M.type)==="a")throw new Error(`Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.
|
|
96
|
+
Learn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor`);const kt=Ae?oe&&typeof oe=="object"&&oe.ref:N,[uo,fo,po]=(0,f.useIntersection)({rootMargin:"200px"}),fu=i.default.useCallback(H=>{(co.current!==ge||ao.current!==qe)&&(po(),co.current=ge,ao.current=qe),uo(H),kt&&(typeof kt=="function"?kt(H):typeof kt=="object"&&(kt.current=H))},[ge,kt,qe,po,uo]);i.default.useEffect(()=>{process.env.NODE_ENV==="production"&&Ve&&(!fo||!hn||g(Ve,qe,ge,{locale:W},{kind:mn},We))},[ge,qe,fo,W,hn,te==null?void 0:te.locale,Ve,We,mn]);const gn={ref:fu,onClick(H){if(process.env.NODE_ENV!=="production"&&!H)throw new Error('Component rendered inside next/link has to pass click event to "onClick" prop.');!Ae&&typeof fe=="function"&&fe(H),Ae&&oe.props&&typeof oe.props.onClick=="function"&&oe.props.onClick(H),Ve&&(H.defaultPrevented||w(H,Ve,qe,ge,ee,me,de,W,We))},onMouseEnter(H){!Ae&&typeof qt=="function"&&qt(H),Ae&&oe.props&&typeof oe.props.onMouseEnter=="function"&&oe.props.onMouseEnter(H),Ve&&((!hn||process.env.NODE_ENV==="development")&&We||g(Ve,qe,ge,{locale:W,priority:!0,bypassPrefetchedCheck:!0},{kind:mn},We))},onTouchStart:process.env.__NEXT_LINK_NO_TOUCH_START?void 0:function(Xe){!Ae&&typeof pn=="function"&&pn(Xe),Ae&&oe.props&&typeof oe.props.onTouchStart=="function"&&oe.props.onTouchStart(Xe),Ve&&(!hn&&We||g(Ve,qe,ge,{locale:W,priority:!0,bypassPrefetchedCheck:!0},{kind:mn},We))}};if((0,a.isAbsoluteUrl)(ge))gn.href=ge;else if(!Ae||V||oe.type==="a"&&!("href"in oe.props)){const H=typeof W<"u"?W:te==null?void 0:te.locale,Xe=(te==null?void 0:te.isLocaleDomain)&&(0,p.getDomainLocale)(ge,H,te==null?void 0:te.locales,te==null?void 0:te.domainLocales);gn.href=Xe||(0,h.addBasePath)((0,c.addLocale)(ge,H,te==null?void 0:te.defaultLocale))}return Ae?i.default.cloneElement(oe,gn):(0,r.jsx)("a",{...uu,...gn,children:M})});(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),n.exports=e.default)})(Co,Co.exports);const Lh=T.forwardRef((n,e)=>{const{themeName:t="alerts.closeBtn",...r}=n;return y.jsx(ba,{ref:e,themeName:t,...r,children:y.jsx(Ps,{icon:y.jsx(Na,{})})})});Lh.displayName="AlertsCloseButton";var _h={exports:{}};(function(n,e){(function(t,r,i){n.exports=i(),n.exports.default=i()})("slugify",sh,function(){var t=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),r=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function i(s,o){if(typeof s!="string")throw new Error("slugify: string argument expected");o=typeof o=="string"?{replacement:o}:o||{};var l=r[o.locale]||{},a=o.replacement===void 0?"-":o.replacement,c=o.trim===void 0?!0:o.trim,u=s.normalize().split("").reduce(function(d,f){var p=l[f];return p===void 0&&(p=t[f]),p===void 0&&(p=f),p===a&&(p=" "),d+p.replace(o.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return o.strict&&(u=u.replace(/[^A-Za-z0-9\s]/g,"")),c&&(u=u.trim()),u=u.replace(/\s+/g,a),o.lower&&(u=u.toLowerCase()),u}return i.extend=function(s){Object.assign(t,s)},i})})(_h);const[$a,Kw]=Es(),Is=T.forwardRef((n,e)=>{const{themeName:t="alerts.navigationBtn",tokens:r,customTheme:i,children:s,onSubmit:o,...l}=n,{isDisabled:a}=l,{pressProps:c}=re.usePress({onPress:()=>o==null?void 0:o()});return y.jsx(re.FocusRing,{within:!0,focusRingClass:"has-focus-ring",children:y.jsx(ba,{themeName:t,tokens:r,ref:e,...c,...l,"aria-disabled":a,children:s})})}),zh=T.forwardRef((n,e)=>{var i;const{controller:t}=$a(),r=(t==null?void 0:t.activeIndex)===(((i=t==null?void 0:t.slides)==null?void 0:i.length)??1)-1;return y.jsx(Is,{onSubmit:()=>t==null?void 0:t.slideNext(),...n,ref:e,isDisabled:r,children:y.jsx(Ps,{icon:"ArrowRight"})})}),jh=T.forwardRef((n,e)=>{const{controller:t}=$a(),r=(t==null?void 0:t.activeIndex)===0;return y.jsx(Is,{onSubmit:()=>t==null?void 0:t.slidePrev(),...n,ref:e,isDisabled:r,children:y.jsx(Ps,{icon:"ArrowLeft"})})});Is.displayName="AlertsNavigationButton";zh.displayName="AlertsNextNavigationButton";jh.displayName="AlertsPrevNavigationButton";process.env.NEXT_PUBLIC_IMG_DOMAIN;const Dh=n=>y.jsx("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:y.jsx("path",{d:"M17.728 13.66 12.388 19 7.05 13.66M12.4 5v14",stroke:"currentColor"})}),Bh=T.memo(Dh,G),$h=Object.freeze(Object.defineProperty({__proto__:null,default:Bh},Symbol.toStringTag,{value:"Module"})),Hh=n=>y.jsxs("svg",{width:24,height:24,fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...n,children:[y.jsx("g",{children:y.jsx("path",{d:"M.075 11.622a1 1 0 0 0 0 .76 1 1 0 0 0 .21.33l8 8a1.004 1.004 0 0 0 1.42-1.42l-6.3-6.29h19.59a1 1 0 0 0 0-2H3.405l6.3-6.29a1 1 0 0 0 0-1.42 1 1 0 0 0-1.42 0l-8 8a1 1 0 0 0-.21.33Z"})}),y.jsx("defs",{children:y.jsx("clipPath",{children:y.jsx("path",{fill:"currentColor",d:"M0 0h24v24H0z"})})})]}),Fh=T.memo(Hh,G),Vh=Object.freeze(Object.defineProperty({__proto__:null,default:Fh},Symbol.toStringTag,{value:"Module"})),Wh=n=>y.jsxs("svg",{width:24,height:24,fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...n,children:[y.jsx("g",{children:y.jsx("path",{d:"M23.92 12.38a1 1 0 0 0 0-.76 1 1 0 0 0-.21-.33l-8-8a1.003 1.003 0 1 0-1.42 1.42l6.3 6.29H1a1 1 0 1 0 0 2h19.59l-6.3 6.29a1 1 0 0 0 0 1.42 1.002 1.002 0 0 0 1.42 0l8-8c.091-.095.162-.207.21-.33Z"})}),y.jsx("defs",{children:y.jsx("clipPath",{children:y.jsx("path",{fill:"currentColor",d:"M0 0h24v24H0z"})})})]}),qh=T.memo(Wh,G),Gh=Object.freeze(Object.defineProperty({__proto__:null,default:qh},Symbol.toStringTag,{value:"Module"})),Uh=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:48,width:48,fill:"currentColor",viewBox:"0 0 48 48",...n,children:y.jsx("path",{d:"M21.05 33.1 35.2 18.95l-2.3-2.25-11.85 11.85-6-6-2.25 2.25ZM24 44q-4.1 0-7.75-1.575-3.65-1.575-6.375-4.3-2.725-2.725-4.3-6.375Q4 28.1 4 24q0-4.15 1.575-7.8 1.575-3.65 4.3-6.35 2.725-2.7 6.375-4.275Q19.9 4 24 4q4.15 0 7.8 1.575 3.65 1.575 6.35 4.275 2.7 2.7 4.275 6.35Q44 19.85 44 24q0 4.1-1.575 7.75-1.575 3.65-4.275 6.375t-6.35 4.3Q28.15 44 24 44Z"})}),Kh=T.memo(Uh,G),Jh=Object.freeze(Object.defineProperty({__proto__:null,default:Kh},Symbol.toStringTag,{value:"Module"})),Yh=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"48",width:"48",fill:"currentColor",...n,children:y.jsx("path",{d:"M28.05 36 16 23.95 28.05 11.9l2.15 2.15-9.9 9.9 9.9 9.9Z"})}),Xh=T.memo(Yh,G),Qh=Object.freeze(Object.defineProperty({__proto__:null,default:Xh},Symbol.toStringTag,{value:"Module"})),Zh=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",height:"48",width:"48",fill:"currentColor",...n,children:y.jsx("path",{d:"m18.75 36-2.15-2.15 9.9-9.9-9.9-9.9 2.15-2.15L30.8 23.95Z"})}),em=T.memo(Zh,G),tm=Object.freeze(Object.defineProperty({__proto__:null,default:em},Symbol.toStringTag,{value:"Module"})),nm=n=>y.jsx("svg",{width:24,height:24,fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...n,children:y.jsx("path",{d:"M9.161 5.889v2.753H7V12h2.161v10h4.442V12h2.977s.28-1.614.417-3.38h-3.379V6.316a.963.963 0 0 1 .332-.558c.174-.146.396-.233.63-.248H17V2h-3.275C9.063 2 9.173 5.37 9.173 5.889h-.012Z",fill:"currentColor"})}),rm=T.memo(nm,G),im=Object.freeze(Object.defineProperty({__proto__:null,default:rm},Symbol.toStringTag,{value:"Module"})),sm=n=>y.jsx("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 256 256",...n,children:y.jsx("path",{fill:"#3b5998",strokeMiterlimit:"10",strokeWidth:"0",d:"M147.5 254.3V139.1h38.7l6-45h-44.7V65.2c0-13 3.6-21.9 22.3-21.9h23.7V3.2c-11.6-1.2-23.1-1.8-34.7-1.8-34.3 0-57.8 20.9-57.8 59.4V94H62.2v45.1H101v115.2h46.5z"})}),om=T.memo(sm,G),lm=Object.freeze(Object.defineProperty({__proto__:null,default:om},Symbol.toStringTag,{value:"Module"})),am=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:25,viewBox:"0 0 24 25",fill:"none",...n,children:y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 12.5001C2 17.4501 5.6 21.5501 10.35 22.4001L10.4094 22.3515C10.4063 22.3509 10.4032 22.3503 10.4001 22.3498V15.2998H7.90015V12.4998H10.4001V10.2998C10.4001 7.79978 12.0001 6.39978 14.3001 6.39978C15.0001 6.39978 15.8001 6.49978 16.5001 6.59978V9.14978H15.2001C14.0001 9.14978 13.7001 9.74978 13.7001 10.5498V12.4998H16.3501L15.9001 15.2998H13.7001V22.3498C13.6696 22.3553 13.639 22.3608 13.6084 22.366L13.65 22.4001C18.4 21.5501 22 17.4501 22 12.5001C22 7.00006 17.5 2.50006 12 2.50006C6.5 2.50006 2 7.00006 2 12.5001Z",fill:"currentColor"})}),cm=T.memo(am,G),um=Object.freeze(Object.defineProperty({__proto__:null,default:cm},Symbol.toStringTag,{value:"Module"})),dm=n=>y.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 67 67",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[y.jsx("path",{d:"M16.1339 8.5415C18.1397 10.0645 19.8152 11.9792 21.0587 14.1693C22.2848 16.2537 25.064 22.0491 22.5341 25.3227C19.6732 29.0215 11.3848 30.2721 11.3848 33.6807C11.3848 36.2473 15.0181 39.1736 16.9594 42.0386C18.0736 43.6842 18.6691 45.626 18.6691 47.6133C18.6691 49.6006 18.0736 51.5423 16.9594 53.1879C16.0541 54.6088 14.817 55.7884 13.3547 56.6251",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"}),y.jsx("path",{d:"M57.8289 14.8058C52.7905 17.106 47.4837 18.766 42.0327 19.747C39.1227 19.9555 38.6895 17.5605 36.4621 14.1724C34.7905 11.6302 30.8874 8.45055 30.8874 5.81443C30.8648 4.90303 30.9876 3.99386 31.2511 3.12109",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"}),y.jsx("path",{d:"M33.6799 64.3334C50.6088 64.3334 64.3324 50.6098 64.3324 33.6809C64.3324 16.7519 50.6088 3.02832 33.6799 3.02832C16.751 3.02832 3.02734 16.7519 3.02734 33.6809C3.02734 50.6098 16.751 64.3334 33.6799 64.3334Z",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"}),y.jsx("path",{d:"M53.2225 36.1983C53.341 44.781 42.1549 55.5094 36.4658 53.188C31.4796 51.1445 34.9944 47.2291 33.7193 36.1983C33.188 31.6127 38.0842 27.8404 43.4872 27.8404C45.8806 27.6839 48.24 28.4711 50.0597 30.0335C51.8795 31.5958 53.2225 32.8948 53.2225 36.1983Z",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),fm=T.memo(dm,G),pm=Object.freeze(Object.defineProperty({__proto__:null,default:fm},Symbol.toStringTag,{value:"Module"})),hm=n=>y.jsx("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 256 256",...n,children:y.jsxs("g",{fill:"currentColor",strokeMiterlimit:"10",strokeWidth:"0",children:[y.jsx("path",{d:"M253.5 75.7a92.8 92.8 0 0 0-5.8-30.7A62 62 0 0 0 233 22.6 62 62 0 0 0 210.7 8c-8-3-17.2-5.2-30.7-5.8-13.5-.6-17.8-.8-52.1-.8s-38.7.2-52.2.8A92.8 92.8 0 0 0 45 8c-8.4 3.2-16 8.2-22.4 14.6A62 62 0 0 0 8 45c-3 8-5.2 17.3-5.8 30.7a890 890 0 0 0-.8 52.2c0 34.3.2 38.6.8 52.1A92.8 92.8 0 0 0 8 210.7a62 62 0 0 0 14.5 22.4A62 62 0 0 0 45 247.7c8 3.1 17.3 5.2 30.7 5.9 13.5.6 17.8.7 52.2.7s38.6-.1 52-.7a92.8 92.8 0 0 0 30.8-6c17-6.5 30.4-20 37-36.9 3-8 5.2-17.2 5.8-30.7.7-13.5.8-17.8.8-52.1s-.1-38.7-.8-52.2zM230.8 179c-.6 12.3-2.6 19-4.4 23.4-4.2 11-13 19.8-24 24a69.9 69.9 0 0 1-23.4 4.4c-13.4.6-17.4.7-51.1.7-33.8 0-37.8-.1-51.1-.7-12.4-.6-19-2.6-23.5-4.4-5.5-2-10.5-5.2-14.5-9.4-4.2-4.1-7.5-9-9.5-14.6a69.9 69.9 0 0 1-4.4-23.4c-.6-13.4-.7-17.4-.7-51.1s.1-37.8.7-51.1c.6-12.4 2.6-19 4.4-23.5 2-5.5 5.2-10.5 9.4-14.6 4.1-4.2 9-7.4 14.6-9.4a69.9 69.9 0 0 1 23.5-4.4c13.3-.6 17.3-.7 51-.7 33.8 0 37.8.1 51.1.7 12.4.6 19 2.7 23.5 4.4 5.5 2 10.5 5.2 14.6 9.4 4.2 4.1 7.4 9.1 9.4 14.6a69.9 69.9 0 0 1 4.4 23.5c.6 13.3.7 17.3.7 51s-.1 37.8-.7 51.2z"}),y.jsx("path",{d:"M127.9 63a65 65 0 1 0 0 129.8 65 65 0 0 0 0-129.9zm0 107a42.2 42.2 0 1 1 0-84.3 42.2 42.2 0 0 1 0 84.3zM210.5 60.4a15.2 15.2 0 1 1-30.3 0 15.2 15.2 0 0 1 30.3 0z"})]})}),mm=T.memo(hm,G),gm=Object.freeze(Object.defineProperty({__proto__:null,default:mm},Symbol.toStringTag,{value:"Module"})),bm=n=>y.jsx("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 256 256",...n,children:y.jsxs("g",{fill:"none",strokeMiterlimit:"10",strokeWidth:"0",transform:"matrix(2.8 0 0 2.8 1.4 1.4)",children:[y.jsxs("linearGradient",{id:"a",x1:"7.6",x2:"82.4",y1:"9.6",y2:"84.4",gradientTransform:"matrix(1 0 0 -1 0 92)",gradientUnits:"userSpaceOnUse",children:[y.jsx("stop",{offset:"0%",stopColor:"#ffd600"}),y.jsx("stop",{offset:"50%",stopColor:"#ff0100"}),y.jsx("stop",{offset:"100%",stopColor:"#d800b9"})]}),y.jsx("path",{fill:"url(#a)",d:"M89.7 26.4c-.2-4.7-1-8-2-10.9a22 22 0 0 0-5.3-8 22 22 0 0 0-8-5.1A33 33 0 0 0 63.7.3C58.8 0 57.2 0 45 0S31.2 0 26.4.3c-4.7.2-8 1-10.9 2a22 22 0 0 0-8 5.3 22 22 0 0 0-5.1 8A33 33 0 0 0 .3 26.3C0 31.2 0 32.8 0 45c0 12.2 0 13.8.3 18.6.2 4.7 1 8 2 10.9a22 22 0 0 0 5.3 8c2.2 2.2 5 4 8 5.1a33 33 0 0 0 10.8 2.1c4.8.2 6.4.3 18.6.3s13.8 0 18.6-.3c4.7-.2 8-1 10.9-2a23 23 0 0 0 13.1-13.2 33 33 0 0 0 2.1-11c.2-4.7.3-6.3.3-18.5s0-13.8-.3-18.6zm-8 36.8c-.3 4.4-1 6.8-1.6 8.3-1.5 4-4.6 7-8.6 8.6-1.5.6-4 1.3-8.3 1.5-4.8.2-6.2.3-18.2.3s-13.4 0-18.2-.3a25 25 0 0 1-8.3-1.5 14 14 0 0 1-5.2-3.4 14 14 0 0 1-3.4-5.2c-.6-1.5-1.3-4-1.5-8.3A313 313 0 0 1 8 45c0-12 0-13.4.3-18.2a25 25 0 0 1 1.5-8.3 14 14 0 0 1 3.4-5.2 14 14 0 0 1 5.2-3.4c1.5-.6 4-1.3 8.3-1.5C31.6 8.2 33 8 45 8s13.4 0 18.2.3c4.4.2 6.8.9 8.3 1.5a14 14 0 0 1 5.2 3.4 14 14 0 0 1 3.4 5.2c.6 1.5 1.3 4 1.5 8.3.2 4.8.3 6.2.3 18.2s0 13.4-.3 18.2z"}),y.jsxs("linearGradient",{id:"b",x1:"28.7",x2:"61.3",y1:"30.7",y2:"63.3",gradientTransform:"matrix(1 0 0 -1 0 92)",gradientUnits:"userSpaceOnUse",children:[y.jsx("stop",{offset:"0%",stopColor:"#ff6400"}),y.jsx("stop",{offset:"50%",stopColor:"#ff0100"}),y.jsx("stop",{offset:"100%",stopColor:"#fd0056"})]}),y.jsx("path",{fill:"url(#b)",d:"M45 21.9A23.1 23.1 0 1 0 45 68 23.1 23.1 0 0 0 45 22zM45 60a15 15 0 1 1 0-30 15 15 0 0 1 0 30z"}),y.jsxs("linearGradient",{id:"c",x1:"65.2",x2:"72.8",y1:"67.2",y2:"74.8",gradientTransform:"matrix(1 0 0 -1 0 92)",gradientUnits:"userSpaceOnUse",children:[y.jsx("stop",{offset:"0%",stopColor:"#f30072"}),y.jsx("stop",{offset:"100%",stopColor:"#e50097"})]}),y.jsx("path",{fill:"url(#c)",d:"M74.4 21a5.4 5.4 0 1 1-10.8 0 5.4 5.4 0 0 1 10.8 0z"})]})}),ym=T.memo(bm,G),wm=Object.freeze(Object.defineProperty({__proto__:null,default:ym},Symbol.toStringTag,{value:"Module"})),vm=n=>y.jsx("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 256 256",...n,children:y.jsxs("g",{fill:"currentColor",strokeMiterlimit:"10",strokeWidth:"0",children:[y.jsx("path",{d:"M61.4 254.3A59.8 59.8 0 0 1 19 151.8L65.8 105a11.2 11.2 0 0 1 15.9 16l-46.8 46.7a37.3 37.3 0 0 0 0 53.1 37.6 37.6 0 0 0 53 0l46.9-46.8a11.2 11.2 0 1 1 15.9 16l-46.8 46.7a59.8 59.8 0 0 1-42.5 17.6zM182 154a11.2 11.2 0 0 1-8-19.2L220.8 88a37.6 37.6 0 0 0-53-53.1l-46.9 46.8a11.2 11.2 0 0 1-15.9-16L151.8 19a59.6 59.6 0 0 1 85 0 60.1 60.1 0 0 1 0 84.9l-46.9 46.8c-2.2 2.2-5 3.3-8 3.3z"}),y.jsx("path",{d:"M72.6 194.3a11.2 11.2 0 0 1-8-19.1L175.3 64.7A11.2 11.2 0 1 1 191 80.6L80.6 191c-2.2 2.2-5.1 3.2-8 3.2z"})]})}),xm=T.memo(vm,G),Sm=Object.freeze(Object.defineProperty({__proto__:null,default:xm},Symbol.toStringTag,{value:"Module"})),Cm=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:19,viewBox:"0 0 18 19",fill:"none",...n,children:y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 1.79773C0 1.07677 0.604838 0.5 1.33064 0.5H16.6694C17.3952 0.5 18 1.07677 18 1.79773V17.2023C18 17.9232 17.3952 18.5 16.6694 18.5H1.33064C0.604838 18.5 0 17.9232 0 17.2023V1.79773ZM5.44373 15.5677V7.44492H2.73405V15.5677H5.44373ZM4.08889 6.31541C5.03244 6.31541 5.63728 5.69058 5.63728 4.92155C5.61308 4.1285 5.05663 3.52769 4.11308 3.52769C3.19373 3.52769 2.5647 4.1285 2.5647 4.92155C2.5647 5.69058 3.14534 6.31541 4.08889 6.31541ZM9.65304 15.5677H6.94336C6.94336 15.5677 6.99175 8.18991 6.94336 7.44492H9.67723V8.58586C9.66903 8.59819 9.66097 8.6104 9.65304 8.62249H9.67723V8.58586C10.0439 8.03441 10.6772 7.25266 12.1208 7.25266C13.9111 7.25266 15.2417 8.4062 15.2417 10.9055V15.5677H12.5321V11.2179C12.5321 10.1365 12.145 9.39151 11.153 9.39151C10.403 9.39151 9.94336 9.89619 9.74981 10.3768C9.67723 10.5451 9.65304 10.7854 9.65304 11.0257V15.5677Z",fill:"currentColor"})}),Tm=T.memo(Cm,G),km=Object.freeze(Object.defineProperty({__proto__:null,default:Tm},Symbol.toStringTag,{value:"Module"})),Em=n=>y.jsx("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 256 256",...n,children:y.jsxs("g",{fill:"currentColor",strokeMiterlimit:"10",strokeWidth:"0",transform:"matrix(2.8 0 0 2.8 1.4 1.4)",children:[y.jsx("path",{d:"M80.9 78.8H9c-5 0-9.1-4.1-9.1-9.1V20.3c0-5 4-9 9.1-9H81c5 0 9.1 4 9.1 9v49.4c0 5-4 9-9.1 9zM9 17.2A3.1 3.1 0 0 0 6 20.3v49.4c0 1.7 1.4 3 3.1 3H81c1.7 0 3.1-1.3 3.1-3V20.3c0-1.7-1.4-3-3.1-3H9z"}),y.jsx("path",{d:"M45 55.4c-5.4 0-10.6-2.3-14.2-6.3l-28.3-31 4.4-4 28.3 31c2.5 2.8 6 4.3 9.8 4.3 3.8 0 7.3-1.5 9.8-4.3l28.3-31 4.4 4-28.3 31c-3.6 4-8.8 6.3-14.2 6.3z"}),y.jsx("rect",{width:"39",height:"6",x:"-1",y:"57.2",rx:"0",ry:"0",transform:"rotate(-45.1 18.5 60.2)"}),y.jsx("rect",{width:"6",height:"39",x:"68.5",y:"40.7",rx:"0",ry:"0",transform:"rotate(-44.8 71.5 60.2)"})]})}),Mm=T.memo(Em,G),Am=Object.freeze(Object.defineProperty({__proto__:null,default:Mm},Symbol.toStringTag,{value:"Module"})),Pm=n=>y.jsxs("svg",{height:48,width:48,fill:"currentColor",...n,xmlns:"http://www.w3.org/2000/svg",children:[y.jsx("ellipse",{cx:"26",cy:"24.095",rx:"26",ry:"23.547",fill:"#fff"}),y.jsx("path",{d:"M37.742 24.095H14.258M26 13.46V34.73 13.46Z",stroke:"#9E9E9E",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Om=T.memo(Pm,G),Rm=Object.freeze(Object.defineProperty({__proto__:null,default:Om},Symbol.toStringTag,{value:"Module"})),Nm=n=>y.jsx("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 256 256",...n,children:y.jsx("path",{fill:"currentColor",strokeMiterlimit:"10",strokeWidth:"0",d:"M199.75 145.13a54.45 54.45 0 0 0-43.54 21.82l-47.88-23.93c1.4-4.82 2.2-9.9 2.2-15.17a54.3 54.3 0 0 0-2.2-15.16l47.88-23.93a54.45 54.45 0 0 0 43.54 21.82 54.61 54.61 0 0 0 54.56-54.56c0-30.08-24.48-54.56-54.56-54.56s-54.56 24.48-54.56 54.56c0 5.27.79 10.35 2.19 15.17L99.5 95.11A54.45 54.45 0 0 0 55.97 73.3C25.88 73.3 1.4 97.77 1.4 127.86s24.47 54.56 54.56 54.56c17.79 0 33.56-8.6 43.53-21.82l47.88 23.92a54.32 54.32 0 0 0-2.2 15.17c0 30.09 24.48 54.56 54.57 54.56s54.56-24.47 54.56-54.56a54.62 54.62 0 0 0-54.56-54.56zm0-124c19.24 0 34.89 15.65 34.89 34.9s-15.65 34.88-34.9 34.88-34.88-15.65-34.88-34.89 15.65-34.89 34.89-34.89zM55.97 162.75c-19.24 0-34.9-15.65-34.9-34.9s15.66-34.88 34.9-34.88 34.88 15.65 34.88 34.89-15.65 34.89-34.88 34.89zm143.78 71.83a34.93 34.93 0 0 1-34.9-34.89c0-19.24 15.66-34.89 34.9-34.89s34.89 15.65 34.89 34.9a34.93 34.93 0 0 1-34.9 34.88z"})}),Im=T.memo(Nm,G),Lm=Object.freeze(Object.defineProperty({__proto__:null,default:Im},Symbol.toStringTag,{value:"Module"})),_m=n=>y.jsx("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 256 256",...n,children:y.jsx("path",{fill:"currentColor",strokeMiterlimit:"10",strokeWidth:"0",d:"M81 231A147 147 0 0 0 228 76c11-7 19-16 26-27-9 5-19 7-29 9 10-7 18-17 22-29-10 6-21 10-33 12a52 52 0 0 0-88 48C83 87 45 66 19 35a52 52 0 0 0 16 69c-8 0-16-3-23-7v1c0 25 17 46 41 51a52 52 0 0 1-23 1c6 20 26 35 48 36a104 104 0 0 1-77 21c23 15 51 24 80 24"})}),zm=T.memo(_m,G),jm=Object.freeze(Object.defineProperty({__proto__:null,default:zm},Symbol.toStringTag,{value:"Module"})),Dm=n=>y.jsx("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 256 256",...n,children:y.jsx("path",{fill:"#1da1f2",strokeMiterlimit:"10",strokeWidth:"0",d:"M81 230.6c95.4 0 147.6-79 147.6-147.6 0-2.3 0-4.5-.2-6.7 10.2-7.4 19-16.5 25.9-26.9-9.5 4.2-19.5 7-29.8 8.2a52 52 0 0 0 22.8-28.7 104 104 0 0 1-33 12.6A52 52 0 0 0 126 88.8C84.2 86.7 45.4 67 19 34.6a52 52 0 0 0 16 69.2 51.5 51.5 0 0 1-23.5-6.5v.7c0 24.7 17.4 46 41.6 50.9-7.6 2-15.6 2.4-23.4.9a52 52 0 0 0 48.5 36 104.1 104.1 0 0 1-76.8 21.5A146.9 146.9 0 0 0 81 230.6"})}),Bm=T.memo(Dm,G),$m=Object.freeze(Object.defineProperty({__proto__:null,default:Bm},Symbol.toStringTag,{value:"Module"})),Hm=n=>y.jsx("svg",{width:24,height:24,fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...n,children:y.jsx("path",{d:"M17 21H7a4 4 0 0 1-4-4v-1a1 1 0 1 1 2 0v1a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-1a1 1 0 0 1 2 0v1a4 4 0 0 1-4 4Zm-5-4a1 1 0 0 1-1-1V6.41l-2.29 2.3a1.004 1.004 0 0 1-1.42-1.42l4-4a1 1 0 0 1 .33-.21A1 1 0 0 1 12 3a1 1 0 0 1 .38.08 1 1 0 0 1 .33.21l4 4a1.004 1.004 0 1 1-1.42 1.42L13 6.41V16a1 1 0 0 1-1 1Z",fill:"currentColor"})}),Fm=T.memo(Hm,G),Vm=Object.freeze(Object.defineProperty({__proto__:null,default:Fm},Symbol.toStringTag,{value:"Module"})),Wm=n=>y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:25,viewBox:"0 0 24 25",fill:"none",...n,children:y.jsx("path",{d:"M14.119 11.7052L20.4486 4.5H18.9492L13.4509 10.7549L9.0626 4.5H4L10.6374 13.9594L4 21.5142H5.4994L11.3021 14.9074L15.9374 21.5142H21M6.04057 5.60727H8.34407L18.9481 20.4613H16.644",fill:"currentColor"})}),qm=T.memo(Wm,G),Gm=Object.freeze(Object.defineProperty({__proto__:null,default:qm},Symbol.toStringTag,{value:"Module"})),Um=n=>y.jsx("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 256 256",...n,children:y.jsx("path",{fill:"currentColor",strokeMiterlimit:"10",strokeWidth:"0",d:"M249 67c-3-11-11-19-22-22-20-6-99-6-99-6s-79 0-99 6C18 48 10 56 7 67c-6 20-6 61-6 61s0 41 6 61c3 11 11 19 22 22 20 5 99 5 99 5s79 0 99-5c11-3 19-11 22-22 5-20 5-61 5-61s0-41-5-61zm-146 99V90l65 38-65 38z"})}),Km=T.memo(Um,G),Jm=Object.freeze(Object.defineProperty({__proto__:null,default:Km},Symbol.toStringTag,{value:"Module"})),Ym=n=>y.jsx("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 256 256",...n,children:y.jsxs("g",{fill:"currentColor",strokeMiterlimit:"10",strokeWidth:"0",children:[y.jsx("path",{fill:"red",d:"M249.02 66.99a31.68 31.68 0 0 0-22.36-22.36c-19.72-5.29-98.8-5.29-98.8-5.29s-79.09 0-98.8 5.29A31.68 31.68 0 0 0 6.68 66.99c-5.28 19.72-5.28 60.87-5.28 60.87s0 41.15 5.28 60.87a31.68 31.68 0 0 0 22.36 22.36c19.72 5.28 98.8 5.28 98.8 5.28s79.1 0 98.81-5.28a31.68 31.68 0 0 0 22.36-22.36c5.29-19.72 5.29-60.87 5.29-60.87s0-41.15-5.29-60.87z"}),y.jsx("path",{fill:"#fff",d:"m102.57 165.8 65.7-37.94-65.7-37.94z"})]})}),Xm=T.memo(Ym,G),Qm=Object.freeze(Object.defineProperty({__proto__:null,default:Xm},Symbol.toStringTag,{value:"Module"}));ks();const Zm=async n=>{const{variables:e,themeName:t="wysiwyg",tokens:r,item:i,document:s}=n,o=await Su({item:i,blockKey:"block_wysiwyg_by_id",document:s,variables:e});if(!o)return null;const{content:l,title:a,level:c,settings:u}=o,{tokens:d}=da(pa,u)??{};return!l&&!(a&&c)?null:y.jsxs(y.Fragment,{children:[a&&c&&y.jsx(Ms,{as:"span",themeName:t,tokens:{...r,...d},children:T.createElement(c,{},a)}),l&&y.jsx(Zp,{themeName:t,tokens:{...r,...d},content:l})]})},eg={block_wysiwyg:{default:n=>y.jsx(Zm,{...n})}},tg={components:{...eg}},ll=n=>{const{children:e,config:t,...r}=n,i=Cu(tg,t),s=l=>e?e({...r,...l,config:i}):y.jsx(Tu,{...r,...l,config:i});if("blocks"in n){const{blocks:l}=n;return l.map(s)}const{block:o}=n;return s(o)};function Ha(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=Ha(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Fa(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let o=n.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Fa(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class E{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,s){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,i+l,s||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new E(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),i+=l.nodeSize),o=a}return new E(r,i)}cutByIndex(e,t){return e==t?E.empty:e==0&&t==this.content.length?this:new E(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new E(i,s)}addToStart(e){return new E([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new E(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Ha(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Fa(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Rn(0,e);if(e==this.size)return Rn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=this.child(r),o=i+s.nodeSize;if(o>=e)return o==e||t>0?Rn(r+1,o):Rn(r,i);i=o}}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 E.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new E(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return E.empty;let t,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new E(t||e,r)}static from(e){if(!e)return E.empty;if(e instanceof E)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new E([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}E.empty=new E([],0);const Ei={index:0,offset:0};function Rn(n,e){return Ei.index=n,Ei.offset=e,Ei}function Qi(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Qi(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Qi(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let ye=class Zi{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qi(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Zi.none;if(e instanceof Zi)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};ye.none=[];class ng extends Error{}class R{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=Wa(this.content,e+this.openStart,t);return r&&new R(r,this.openStart,this.openEnd)}removeBetween(e,t){return new R(Va(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 R.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new R(E.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new R(e,r,i)}}R.empty=new R(E.empty,0,0);function Va(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(i==e||s.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(Va(s.content,e-i-1,t-i-1)))}function Wa(n,e,t,r){let{index:i,offset:s}=n.findIndex(e),o=n.maybeChild(i);if(s==e||o.isText)return n.cut(0,e).append(t).append(n.cut(e));let l=Wa(o.content,e-s-1,t);return l&&n.replaceChild(i,o.copy(l))}class es{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}function rg(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function ig(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let s=n[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function sg(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new og(n[t]);return e}class og{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Ls{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=sg(i.attrs),this.excluded=null;let s=rg(this.attrs);this.instance=s?new ye(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ye(this,ig(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Ls(s,i++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}function lg(n){return n.tag!=null}function ag(n){return n.style!=null}class nn{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(lg(i))this.tags.push(i);else if(ag(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let r=new cl(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new cl(this,t,!0);return r.addAll(e,t.from,t.to),R.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(dg(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=ul(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=ul(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new nn(e,nn.schemaRules(e)))}}const qa={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},cg={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ga={ol:!0,ul:!0},Qn=1,Zn=2,Jt=4;function al(n,e,t){return e!=null?(e?Qn:0)|(e==="full"?Zn:0):n&&n.whitespace=="pre"?Qn|Zn:t&~Jt}class Nn{constructor(e,t,r,i,s,o,l){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=s,this.options=l,this.content=[],this.activeMarks=ye.none,this.stashMarks=[],this.match=o||(l&Jt?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(E.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Qn)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=E.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(E.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):fg(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!qa.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class cl{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,s,o=al(null,t.preserveWhitespace,0)|(r?Jt:0);i?s=new Nn(i.type,i.attrs,ye.none,ye.none,!0,t.topMatch||i.type.contentMatch,o):r?s=new Nn(null,null,ye.none,ye.none,!0,null,o):s=new Nn(e.schema.topNodeType,null,ye.none,ye.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,t){let r=e.style;if(!r||!r.length)return t();let i=this.readStyles(e.style);if(!i)return;let[s,o]=i,l=this.top;for(let a=0;a<o.length;a++)this.removePendingMark(o[a],l);for(let a=0;a<s.length;a++)this.addPendingMark(s[a]);t();for(let a=0;a<s.length;a++)this.removePendingMark(s[a],l);for(let a=0;a<o.length;a++)this.addPendingMark(o[a])}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&Zn||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&Qn)r.options&Zn?t=t.replace(/\r\n?/g,`
|
|
97
|
+
`):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],s=e.previousSibling;(!i||s&&s.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),i;Ga.hasOwnProperty(r)&&this.parser.normalizeLists&&ug(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(s?s.ignore:cg.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);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 o,l=this.top,a=this.needsBlock;if(qa.hasOwnProperty(r))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),o=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}s&&s.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),o&&this.sync(l),this.needsBlock=a}else this.withStyleRules(e,()=>{this.addElementByRule(e,s,s.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
98
|
+
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=ye.none,r=ye.none;if(e.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=e.getPropertyValue(s);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(s,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(c=>{a.clearMark(c)&&(r=c.addToSet(r))}):t=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(t),a.consuming===!1)l=a;else break}}return[t,r]}addElementByRule(e,t,r){let i,s,o;t.node?(s=this.parser.schema.nodes[t.node],s.isLeaf?this.insertNode(s.create(t.attrs))||this.leafFallback(e):i=this.enter(s,t.attrs||null,t.preserveWhitespace)):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,o&&this.removePendingMark(o,l)}addAll(e,t,r){let i=t||0;for(let s=t?e.childNodes[t]:e.firstChild,o=r==null?null:e.childNodes[r];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let s=this.nodes[i],o=s.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,r=s,!o.length)||s.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let s=this.top;s.applyPending(e),s.match=s.match&&s.match.matchType(e);let o=al(e,i,s.options);s.options&Jt&&s.content.length==0&&(o|=Jt),this.nodes.push(new Nn(e,t,s.activeMarks,s.pendingMarks,r,null,o)),this.open++}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 i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=s?r.node(a-s).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;a--}}return!0};return o(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}}addPendingMark(e){let t=pg(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}}function ug(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ga.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function dg(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function ul(n){let e={};for(let t in n)e[t]=n[t];return e}function fg(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],o=l=>{s.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||s.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}function pg(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class ht{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Mi(t).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let l=0,a=0;for(;l<s.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(s[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<s.length;)i=s.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(s.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=ht.renderSpec(Mi(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&ht.renderSpec(Mi(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],s=i.indexOf(" ");s>0&&(r=i.slice(0,s),i=i.slice(s+1));let o,l=r?e.createElementNS(r,i):e.createElement(i),a=t[1],c=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){c=2;for(let u in a)if(a[u]!=null){let d=u.indexOf(" ");d>0?l.setAttributeNS(u.slice(0,d),u.slice(d+1),a[u]):l.setAttribute(u,a[u])}}for(let u=c;u<t.length;u++){let d=t[u];if(d===0){if(u<t.length-1||u>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:p}=ht.renderSpec(e,d,r);if(l.appendChild(f),p){if(o)throw new RangeError("Multiple content holes");o=p}}}return{dom:l,contentDOM:o}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ht(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=dl(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return dl(e.marks)}}function dl(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Mi(n){return n.document||window.document}const Ua=65535,Ka=Math.pow(2,16);function hg(n,e){return n+e*Ka}function fl(n){return n&Ua}function mg(n){return(n-(n&Ua))/Ka}const Ja=1,Ya=2,Vn=4,Xa=8;class ts{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Xa)>0}get deletedBefore(){return(this.delInfo&(Ja|Vn))>0}get deletedAfter(){return(this.delInfo&(Ya|Vn))>0}get deletedAcross(){return(this.delInfo&Vn)>0}}class ve{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ve.empty)return ve.empty}recover(e){let t=0,r=fl(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+mg(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let c=this.ranges[l+s],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,p=a+i+(f<0?0:u);if(r)return p;let h=e==(t<0?a:d)?null:hg(l/3,e-a),m=e==a?Ya:e==d?Ja:Vn;return(t<0?e!=a:e!=d)&&(m|=Xa),new ts(p,m,h)}i+=u-c}return r?e+i:new ts(e+i,0,null)}touches(e,t){let r=0,i=fl(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+s],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],l=o-(this.inverted?s:0),a=o+(this.inverted?0:s),c=this.ranges[i+t],u=this.ranges[i+r];e(l,l+c,a,a+u),s+=u-c}}invert(){return new ve(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ve.empty:new ve(e<0?[0,-e,0]:[0,0,e])}}ve.empty=new ve([]);class Yt{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Yt(this.maps,this.mirror,e,t)}copy(){return new Yt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Yt;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this.maps[s],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(s);if(a!=null&&a>s&&a<this.to){s=a,e=this.maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new ts(e,i,null)}}const Ai=Object.create(null);class ue{getMap(){return ve.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ai[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Ai)throw new RangeError("Duplicate use of step JSON ID "+e);return Ai[e]=t,t.prototype.jsonID=e,t}}class Z{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Z(e,null)}static fail(e){return new Z(null,e)}static fromReplace(e,t,r,i){try{return Z.ok(e.replace(t,r,i))}catch(s){if(s instanceof ng)return Z.fail(s.message);throw s}}}function _s(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(_s(s.content,e,s))),s.isInline&&(s=e(s,t,i)),r.push(s)}return E.fromArray(r)}class it extends ue{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=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new R(_s(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return Z.fromReplace(e,this.from,this.to,s)}invert(){return new Be(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 it(t.pos,r.pos,this.mark)}merge(e){return e instanceof it&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new it(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 it(t.from,t.to,e.markFromJSON(t.mark))}}ue.jsonID("addMark",it);class Be extends ue{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 R(_s(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Z.fromReplace(e,this.from,this.to,r)}invert(){return new it(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 Be(t.pos,r.pos,this.mark)}merge(e){return e instanceof Be&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Be(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 Be(t.from,t.to,e.markFromJSON(t.mark))}}ue.jsonID("removeMark",Be);class st extends ue{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Z.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Z.fromReplace(e,this.pos,this.pos+1,new R(E.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 i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new st(this.pos,t.marks[i]);return new st(this.pos,this.mark)}}return new jt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new st(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new st(t.pos,e.markFromJSON(t.mark))}}ue.jsonID("addNodeMark",st);class jt extends ue{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Z.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Z.fromReplace(e,this.pos,this.pos+1,new R(E.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new st(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new jt(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new jt(t.pos,e.markFromJSON(t.mark))}}ue.jsonID("removeNodeMark",jt);class ie extends ue{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&ns(e,this.from,this.to)?Z.fail("Structure replace would overwrite content"):Z.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ve([this.from,this.to-this.from,this.slice.size])}invert(e){return new ie(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new ie(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof ie)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?R.empty:new R(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ie(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?R.empty:new R(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ie(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};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")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ie(t.from,t.to,R.fromJSON(e,t.slice),!!t.structure)}}ue.jsonID("replace",ie);class se extends ue{constructor(e,t,r,i,s,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=l}apply(e){if(this.structure&&(ns(e,this.from,this.gapFrom)||ns(e,this.gapTo,this.to)))return Z.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Z.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Z.fromReplace(e,this.from,this.to,r):Z.fail("Content does not fit in gap")}getMap(){return new ve([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new se(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||s>r.pos?null:new se(t.pos,r.pos,i,s,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 se(t.from,t.to,t.gapFrom,t.gapTo,R.fromJSON(e,t.slice),t.insert,!!t.structure)}}ue.jsonID("replaceAround",se);function ns(n,e,t){let r=n.resolve(e),i=t-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function gg(n,e,t,r){let i=[],s=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+a.nodeSize,t),h=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(h)||(o&&o.to==f&&o.mark.eq(d[m])?o.to=p:i.push(o=new Be(f,p,d[m])));l&&l.to==f?l.to=p:s.push(l=new it(f,p,r))}}),i.forEach(a=>n.step(a)),s.forEach(a=>n.step(a))}function bg(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(r instanceof Ls){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let p=0;p<i.length;p++){let h=i[p];h.step==s-1&&d.eq(i[p].style)&&(f=h)}f?(f.to=c,f.step=s):i.push({style:d,from:Math.max(l,e),to:c,step:s})}}}),i.forEach(o=>n.step(new Be(o.from,o.to,o.style)))}function Qa(n,e,t,r=t.contentMatch,i=!0){let s=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<s.childCount;a++){let c=s.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new ie(l,u,R.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new Be(l,u,c.marks[f]));if(i&&c.isText&&t.whitespace!="pre"){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(c.text);)h||(h=new R(E.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new ie(l+f.index,l+f.index+f[0].length,h))}}l=u}if(!r.validEnd){let a=r.fillBefore(E.empty,!0);n.replace(l,l,new R(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function yg(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Vt(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),s=n.$from.index(r),o=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(s,o,t))return r;if(r==0||i.type.spec.isolating||!yg(i,s,o))break}return null}function wg(n,e,t){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),l=i.after(s+1),a=o,c=l,u=E.empty,d=0;for(let h=s,m=!1;h>t;h--)m||r.index(h)>0?(m=!0,u=E.from(r.node(h).copy(u)),d++):a--;let f=E.empty,p=0;for(let h=s,m=!1;h>t;h--)m||i.after(h+1)<i.end(h)?(m=!0,f=E.from(i.node(h).copy(f)),p++):c++;n.step(new se(a,c,o,l,new R(u.append(f),d,p),u.size-d,!0))}function zs(n,e,t=null,r=n){let i=vg(n,e),s=i&&xg(r,e);return s?i.map(pl).concat({type:e,attrs:t}).concat(s.map(pl)):null}function pl(n){return{type:n,attrs:null}}function vg(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(r,i,o)?s:null}function xg(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<i;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function Sg(n,e,t){let r=E.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=E.from(t[o].type.create(t[o].attrs,r))}let i=e.start,s=e.end;n.step(new se(i,s,i,s,new R(r,0,0),t.length,!0))}function Cg(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{if(o.isTextblock&&!o.hasMarkup(r,i)&&Eg(n.doc,n.mapping.slice(s).map(l),r)){let a=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!p?a=!1:!f&&p&&(a=!0)}a===!1&&kg(n,o,l,s),Qa(n,n.mapping.slice(s).map(l,1),r,void 0,a===null);let c=n.mapping.slice(s),u=c.map(l,1),d=c.map(l+o.nodeSize,1);return n.step(new se(u,d,u+1,d-1,new R(E.from(r.create(i,null,o.marks)),0,0),1,!0)),a===!0&&Tg(n,o,l,s),!1}})}function Tg(n,e,t,r){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=n.mapping.slice(r).map(t+1+s+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function kg(n,e,t,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+s);n.replaceWith(o,o+1,e.type.schema.text(`
|
|
99
|
+
`))}})}function Eg(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function Mg(n,e,t,r,i){let s=n.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(r,null,i||s.marks);if(s.isLeaf)return n.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new se(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new R(E.from(o),0,0),1,!0))}function Lt(n,e,t=1,r){let i=n.resolve(e),s=i.depth-t,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=t-2;c>s;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let l=i.indexAfter(s),a=r&&r[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function Ag(n,e,t=1,r){let i=n.doc.resolve(e),s=E.empty,o=E.empty;for(let l=i.depth,a=i.depth-t,c=t-1;l>a;l--,c--){s=E.from(i.node(l).copy(s));let u=r&&r[c];o=E.from(u?u.type.create(u.attrs,o):i.node(l).copy(o))}n.step(new ie(e,e,new R(s.append(o),t,t),!0))}function ut(n,e){let t=n.resolve(e),r=t.index();return Za(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Za(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function Br(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let s,o,l=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):t>0?(s=r.node(i+1),l++,o=r.node(i).maybeChild(l)):(s=r.node(i).maybeChild(l-1),o=r.node(i+1)),s&&!s.isTextblock&&Za(s,o)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function Pg(n,e,t){let r=new ie(e-t,e+t,R.empty,!0);n.step(r)}function Og(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 i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,t))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,t))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function Rg(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let o=r.depth;o>=0;o--){let l=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,a=r.index(o)+(l>0?1:0),c=r.node(o),u=!1;if(s==1)u=c.canReplace(a,a,i);else{let d=c.contentMatchAt(a).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(o+1):r.after(o+1)}return null}function $r(n,e,t=e,r=R.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),s=n.resolve(t);return ec(i,s,r)?new ie(e,t,r):new Ng(i,s,r).fit()}function ec(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class Ng{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=E.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=E.from(e.node(i).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,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let a=new R(s,o,l);return e>-1?new se(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new ie(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}t=s.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=Pi(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(t==1&&(o?c.matchType(o.type)||(d=c.fillBefore(E.from(o),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:d};if(t==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Pi(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new R(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Pi(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new R(Gt(e,t-1,1),t-1,s?t-1:r)}else this.unplaced=new R(Gt(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let m=0;m<s.length;m++)this.openFrontierNode(s[m]);let o=this.unplaced,l=r?r.content:o.content,a=o.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[t];if(i){for(let m=0;m<i.childCount;m++)u.push(i.child(m));d=d.matchFragment(i)}let p=l.size+e-(o.content.size-o.openEnd);for(;c<l.childCount;){let m=l.child(c),b=d.matchType(m.type);if(!b)break;c++,(c>1||a==0||m.content.size)&&(d=b,u.push(tc(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?p:-1)))}let h=c==l.childCount;h||(p=-1),this.placed=Ut(this.placed,t,E.from(u)),this.frontier[t].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=l;m<p;m++){let g=b.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),b=g.content}this.unplaced=h?e==0?R.empty:new R(Gt(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new R(Gt(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Oi(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Oi(e,t,i,r,s);if(o){for(let l=t-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],u=Oi(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:t,fit:o,move:s?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=Ut(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Ut(this.placed,this.depth,E.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(E.empty,!0);t.childCount&&(this.placed=Ut(this.placed,this.frontier.length,t))}}function Gt(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Gt(n.firstChild.content,e-1,t)))}function Ut(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Ut(n.lastChild.content,e-1,t)))}function Pi(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function tc(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,tc(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(E.empty,!0)))),n.copy(r)}function Oi(n,e,t,r,i){let s=n.node(e),o=i?n.indexAfter(e):n.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,o);return l&&!Ig(t,s.content,o)?l:null}function Ig(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function Lg(n){return n.spec.defining||n.spec.definingForContent}function _g(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),s=n.doc.resolve(t);if(ec(i,s,r))return n.step(new ie(e,t,r));let o=rc(i,n.doc.resolve(t));o[o.length-1]==0&&o.pop();let l=-(i.depth+1);o.unshift(l);for(let f=i.depth,p=i.pos-1;f>0;f--,p--){let h=i.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;o.indexOf(f)>-1?l=f:i.before(f)==p&&o.splice(1,0,-f)}let a=o.indexOf(l),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=Lg(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(l)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let m=0;m<o.length;m++){let b=o[(m+a)%o.length],g=!0;b<0&&(g=!1,b=-b);let S=i.node(b-1),w=i.index(b-1);if(S.canReplaceWith(w,w,h.type,h.marks))return n.replace(i.before(b),g?s.after(b):t,new R(nc(r.content,0,r.openStart,p),p,r.openEnd))}}let d=n.steps.length;for(let f=o.length-1;f>=0&&(n.replace(e,t,r),!(n.steps.length>d));f--){let p=o[f];p<0||(e=i.before(p),t=s.after(p))}}function nc(n,e,t,r,i){if(e<t){let s=n.firstChild;n=n.replaceChild(0,s.copy(nc(s.content,e+1,t,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(n).append(n);n=o.append(s.matchFragment(o).fillBefore(E.empty,!0))}return n}function zg(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=Og(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new R(E.from(r),0,0))}function jg(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),s=rc(r,i);for(let o=0;o<s.length;o++){let l=s[o],a=o==s.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return n.delete(r.start(l),i.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return n.delete(r.before(l),i.after(l))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&t>r.end(o)&&i.end(o)-t!=i.depth-o)return n.delete(r.before(o),t);n.delete(e,t)}function rc(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let s=n.start(i);if(s<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class _t extends ue{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 Z.fail("No node at attribute step's position");let r=Object.create(null);for(let s in t.attrs)r[s]=t.attrs[s];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Z.fromReplace(e,this.pos,this.pos+1,new R(E.from(i),0,t.isLeaf?0:1))}getMap(){return ve.empty}invert(e){return new _t(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 _t(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 _t(t.pos,t.attr,t.value)}}ue.jsonID("attr",_t);class rn extends ue{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Z.ok(r)}getMap(){return ve.empty}invert(e){return new rn(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 rn(t.attr,t.value)}}ue.jsonID("docAttr",rn);let Dt=class extends Error{};Dt=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};Dt.prototype=Object.create(Error.prototype);Dt.prototype.constructor=Dt;Dt.prototype.name="TransformError";class ic{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Yt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Dt(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=R.empty){let i=$r(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new R(E.from(r),0,0))}delete(e,t){return this.replace(e,t,R.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return _g(this,e,t,r),this}replaceRangeWith(e,t,r){return zg(this,e,t,r),this}deleteRange(e,t){return jg(this,e,t),this}lift(e,t){return wg(this,e,t),this}join(e,t=1){return Pg(this,e,t),this}wrap(e,t){return Sg(this,e,t),this}setBlockType(e,t=e,r,i=null){return Cg(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return Mg(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new _t(e,t,r)),this}setDocAttribute(e,t){return this.step(new rn(e,t)),this}addNodeMark(e,t){return this.step(new st(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ye)){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 jt(e,t)),this}split(e,t=1,r){return Ag(this,e,t,r),this}addMark(e,t,r){return gg(this,e,t,r),this}removeMark(e,t,r){return bg(this,e,t,r),this}clearIncompatible(e,t,r){return Qa(this,e,t,r),this}}const Ri=Object.create(null);class D{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new sc(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<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=R.empty){let r=t.content.lastChild,i=null;for(let l=0;l<t.openEnd;l++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:c}=o[l],u=e.mapping.slice(s);e.replaceRange(u.map(a.pos),u.map(c.pos),l?R.empty:t),l==0&&gl(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:l}=i[s],a=e.mapping.slice(r),c=a.map(o.pos),u=a.map(l.pos);s?e.deleteRange(c,u):(e.replaceRangeWith(c,u,t),gl(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new j(e):Pt(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=t<0?Pt(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):Pt(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,r);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Re(e.node(0))}static atStart(e){return Pt(e,e,0,0,1)||new Re(e)}static atEnd(e){return Pt(e,e,e.content.size,e.childCount,-1)||new Re(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ri[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 Ri)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ri[e]=t,t.prototype.jsonID=e,t}getBookmark(){return j.between(this.$anchor,this.$head).getBookmark()}}D.prototype.visible=!0;class sc{constructor(e,t){this.$from=e,this.$to=t}}let hl=!1;function ml(n){!hl&&!n.parent.inlineContent&&(hl=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class j extends D{constructor(e,t=e){ml(e),ml(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 D.near(r);let i=e.resolve(t.map(this.anchor));return new j(i.parent.inlineContent?i:r,r)}replace(e,t=R.empty){if(super.replace(e,t),t==R.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof j&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Hr(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 j(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let s=D.findFrom(t,r,!0)||D.findFrom(t,-r,!0);if(s)t=s.$head;else return D.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(D.findFrom(e,-r,!0)||D.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new j(e,t)}}D.jsonID("text",j);class Hr{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Hr(e.map(this.anchor),e.map(this.head))}resolve(e){return j.between(e.resolve(this.anchor),e.resolve(this.head))}}class z extends D{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),s=e.resolve(i);return r?D.near(s):new z(s)}content(){return new R(E.from(this.node),0,0)}eq(e){return e instanceof z&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new js(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new z(e.resolve(t.anchor))}static create(e,t){return new z(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}z.prototype.visible=!1;D.jsonID("node",z);class js{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Hr(r,r):new js(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&z.isSelectable(r)?new z(t):D.near(t)}}class Re extends D{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=R.empty){if(t==R.empty){e.delete(0,e.doc.content.size);let r=D.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Re(e)}map(e){return new Re(e)}eq(e){return e instanceof Re}getBookmark(){return Dg}}D.jsonID("all",Re);const Dg={map(){return this},resolve(n){return new Re(n)}};function Pt(n,e,t,r,i,s=!1){if(e.inlineContent)return j.create(n,t);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let l=e.child(o);if(l.isAtom){if(!s&&z.isSelectable(l))return z.create(n,t-(i<0?l.nodeSize:0))}else{let a=Pt(n,l,t+i,i<0?l.childCount:0,i,s);if(a)return a}t+=l.nodeSize*i}return null}function gl(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof ie||i instanceof se))return;let s=n.mapping.maps[r],o;s.forEach((l,a,c,u)=>{o==null&&(o=u)}),n.setSelection(D.near(n.doc.resolve(o),t))}function bl(n,e){return!e||!n?n:n.bind(e)}class In{constructor(e,t,r){this.name=e,this.init=bl(t.init,r),this.apply=bl(t.apply,r)}}new In("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new In("selection",{init(n,e){return n.selection||D.atStart(e.doc)},apply(n){return n.selection}}),new In("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new In("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function oc(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=oc(i,e,{})),t[r]=i}return t}class Ie{constructor(e){this.spec=e,this.props={},e.props&&oc(e.props,this,this.props),this.key=e.key?e.key.key:lc("plugin")}getState(e){return e[this.key]}}const Ni=Object.create(null);function lc(n){return n in Ni?n+"$"+ ++Ni[n]:(Ni[n]=0,n+"$")}class Me{constructor(e="key"){this.key=lc(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const St=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},ac=function(n,e,t,r){return t&&(yl(n,e,t,r,-1)||yl(n,e,t,r,1))},Bg=/^(img|br|input|textarea|hr)$/i;function yl(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:er(n))){let s=n.parentNode;if(!s||s.nodeType!=1||Ds(n)||Bg.test(n.nodeName)||n.contentEditable=="false")return!1;e=St(n)+(i<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?er(n):0}else return!1}}function er(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function $g(n,e,t){for(let r=e==0,i=e==er(n);r||i;){if(n==t)return!0;let s=St(n);if(n=n.parentNode,!n)return!1;r=r&&s==0,i=i&&s==er(n)}}function Ds(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const cc=function(n){return n.focusNode&&ac(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function uc(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const $e=typeof navigator<"u"?navigator:null,wl=typeof document<"u"?document:null,dt=$e&&$e.userAgent||"",rs=/Edge\/(\d+)/.exec(dt),dc=/MSIE \d/.exec(dt),is=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(dt),dn=!!(dc||is||rs),fc=dc?document.documentMode:is?+is[1]:rs?+rs[1]:0,Fr=!dn&&/gecko\/(\d+)/i.test(dt);Fr&&+(/Firefox\/(\d+)/.exec(dt)||[0,0])[1];const ss=!dn&&/Chrome\/(\d+)/.exec(dt),Ct=!!ss,Hg=ss?+ss[1]:0,Tt=!dn&&!!$e&&/Apple Computer/.test($e.vendor),Bs=Tt&&(/Mobile\/\w+/.test(dt)||!!$e&&$e.maxTouchPoints>2),ke=Bs||($e?/Mac/.test($e.platform):!1),Fg=$e?/Win/.test($e.platform):!1,fn=/Android \d/.test(dt),$s=!!wl&&"webkitFontSmoothing"in wl.documentElement.style,Vg=$s?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Wg(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),s=i&&i.size==0,o=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let l=r.resolve(o),a,c;if(cc(t)){for(a=l;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&z.isSelectable(u)&&i.parent&&!(u.isInline&&$g(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;c=new z(o==d?l:r.resolve(d))}}else{let u=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(u<0)return null;a=r.resolve(u)}if(!c){let u=e=="pointer"||n.state.selection.head<l.pos&&!s?1:-1;c=hc(n,a,l,u)}return c}function pc(n){return n.editable?n.hasFocus():Kg(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Hs(n,e=!1){let t=n.state.selection;if(Ug(n,t),!!pc(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&Ct){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&ac(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)Gg(n);else{let{anchor:r,head:i}=t,s,o;vl&&!(t instanceof j)&&(t.$from.parent.inlineContent||(s=xl(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(o=xl(n,t.to))),n.docView.setSelection(r,i,n.root,e),vl&&(s&&Sl(s),o&&Sl(o)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&qg(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const vl=Tt||Ct&&Hg<63;function xl(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,s=r?t.childNodes[r-1]:null;if(Tt&&i&&i.contentEditable=="false")return Ii(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Ii(i);if(s)return Ii(s)}}function Ii(n){return n.contentEditable="true",Tt&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Sl(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function qg(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!pc(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Gg(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,St(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&dn&&fc<=11&&(r.disabled=!0,r.disabled=!1)}function Ug(n,e){if(e instanceof z){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Cl(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Cl(n)}function Cl(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function hc(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||j.between(e,t,r)}function Kg(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 ls(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),s=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return s&&D.findFrom(s,e)}function Ze(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Tl(n,e,t){let r=n.state.selection;if(r instanceof j)if(t.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=n.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Ze(n,new j(r.$anchor,o))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=ls(n.state,e);return i&&i instanceof z?Ze(n,i):!1}else if(!(ke&&t.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let l=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=n.docView.descAt(l))&&!o.contentDOM?z.isSelectable(s)?Ze(n,new z(e<0?n.state.doc.resolve(i.pos-s.nodeSize):i)):$s?Ze(n,new j(n.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof z&&r.node.isInline)return Ze(n,new j(e>0?r.$to:r.$from));{let i=ls(n.state,e);return i?Ze(n,i):!1}}}function tr(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Xt(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Mt(n,e){return e<0?Jg(n):Yg(n)}function Jg(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,s,o=!1;for(Fr&&t.nodeType==1&&r<tr(t)&&Xt(t.childNodes[r],-1)&&(o=!0);;)if(r>0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(Xt(l,-1))i=t,s=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(mc(t))break;{let l=t.previousSibling;for(;l&&Xt(l,-1);)i=t.parentNode,s=St(l),l=l.previousSibling;if(l)t=l,r=tr(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}o?as(n,t,r):i&&as(n,i,s)}function Yg(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=tr(t),s,o;for(;;)if(r<i){if(t.nodeType!=1)break;let l=t.childNodes[r];if(Xt(l,1))s=t,o=++r;else break}else{if(mc(t))break;{let l=t.nextSibling;for(;l&&Xt(l,1);)s=l.parentNode,o=St(l)+1,l=l.nextSibling;if(l)t=l,r=0,i=tr(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}s&&as(n,s,o)}function mc(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Xg(n,e){for(;n&&e==n.childNodes.length&&!Ds(n);)e=St(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function Qg(n,e){for(;n&&!e&&!Ds(n);)e=St(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function as(n,e,t){if(e.nodeType!=3){let s,o;(o=Xg(e,t))?(e=o,t=0):(s=Qg(e,t))&&(e=s,t=s.nodeValue.length)}let r=n.domSelection();if(cc(r)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&Hs(n)},50)}function kl(n,e){let t=n.state.doc.resolve(e);if(!(Ct||Fg)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let s=n.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<t.end()){let s=n.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function El(n,e,t){let r=n.state.selection;if(r instanceof j&&!r.empty||t.indexOf("s")>-1||ke&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let o=ls(n.state,e);if(o&&o instanceof z)return Ze(n,o)}if(!i.parent.inlineContent){let o=e<0?i:s,l=r instanceof Re?D.near(o,e):D.findFrom(o,e);return l?Ze(n,l):!1}return!1}function Ml(n,e){if(!(n.state.selection instanceof j))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let o=n.state.tr;return e<0?o.delete(t.pos-s.nodeSize,t.pos):o.delete(t.pos,t.pos+s.nodeSize),n.dispatch(o),!0}return!1}function Al(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function Zg(n){if(!Tt||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;Al(n,r,"true"),setTimeout(()=>Al(n,r,"false"),20)}return!1}function e0(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function t0(n,e){let t=e.keyCode,r=e0(e);if(t==8||ke&&t==72&&r=="c")return Ml(n,-1)||Mt(n,-1);if(t==46&&!e.shiftKey||ke&&t==68&&r=="c")return Ml(n,1)||Mt(n,1);if(t==13||t==27)return!0;if(t==37||ke&&t==66&&r=="c"){let i=t==37?kl(n,n.state.selection.from)=="ltr"?-1:1:-1;return Tl(n,i,r)||Mt(n,i)}else if(t==39||ke&&t==70&&r=="c"){let i=t==39?kl(n,n.state.selection.from)=="ltr"?1:-1:1;return Tl(n,i,r)||Mt(n,i)}else{if(t==38||ke&&t==80&&r=="c")return El(n,-1,r)||Mt(n,-1);if(t==40||ke&&t==78&&r=="c")return Zg(n)||El(n,1,r)||Mt(n,1);if(r==(ke?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function gc(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let o=n.someProp("clipboardSerializer")||ht.fromSchema(n.state.schema),l=Sc(),a=l.createElement("div");a.appendChild(o.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=xc[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=l.createElement(u[p]);for(;a.firstChild;)h.appendChild(a.firstChild);a.appendChild(h),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,`
|
|
100
|
+
|
|
101
|
+
`);return{dom:a,text:f,slice:e}}function bc(n,e,t,r,i){let s=i.parent.type.spec.code,o,l;if(!t&&!e)return null;let a=e&&(r||s||!t);if(a){if(n.someProp("transformPastedText",f=>{e=f(e,s||r,n)}),s)return e?new R(E.from(n.state.schema.text(e.replace(/\r\n?/g,`
|
|
102
|
+
`))),0,0):R.empty;let d=n.someProp("clipboardTextParser",f=>f(e,i,r,n));if(d)l=d;else{let f=i.marks(),{schema:p}=n.state,h=ht.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let b=o.appendChild(document.createElement("p"));m&&b.appendChild(h.serializeNode(p.text(m,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),o=i0(t),$s&&s0(o);let c=o&&o.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 f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||nn.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!n0.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=o0(Pl(l,+u[1],+u[2]),u[4]);else if(l=R.maxOpen(r0(l.content,i),!0),l.openStart||l.openEnd){let d=0,f=0;for(let p=l.content.firstChild;d<l.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=l.content.lastChild;f<l.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);l=Pl(l,d,f)}return n.someProp("transformPasted",d=>{l=d(l,n)}),l}const n0=/^(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 r0(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,o=[];if(n.forEach(l=>{if(!o)return;let a=i.findWrapping(l.type),c;if(!a)return o=null;if(c=o.length&&s.length&&wc(a,s,l,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=vc(o[o.length-1],s.length));let u=yc(l,a);o.push(u),i=i.matchType(u.type),s=a}}),o)return E.from(o)}return n}function yc(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,E.from(n));return n}function wc(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let s=wc(n,e,t,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(E.from(yc(t,n,i+1))))}}function vc(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,vc(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(E.empty,!0);return n.copy(t.append(r))}function cs(n,e,t,r,i,s){let o=e<0?n.firstChild:n.lastChild,l=o.content;return n.childCount>1&&(s=0),i<r-1&&(l=cs(l,e,t,r,i+1,s)),i>=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(E.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,o.copy(l))}function Pl(n,e,t){return e<n.openStart&&(n=new R(cs(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new R(cs(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const xc={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Ol=null;function Sc(){return Ol||(Ol=document.implementation.createHTMLDocument("title"))}function i0(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Sc().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&xc[r[1].toLowerCase()])&&(n=i.map(s=>"<"+s+">").join("")+n+i.map(s=>"</"+s+">").reverse().join("")),t.innerHTML=n,i)for(let s=0;s<i.length;s++)t=t.querySelector(i[s])||t;return t}function s0(n){let e=n.querySelectorAll(Ct?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function o0(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:s,openEnd:o}=n;for(let l=r.length-2;l>=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=E.from(a.create(r[l+1],i)),s++,o++}return new R(i,s,o)}const Le={},xe={};function ot(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}xe.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Tc(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(fn&&Ct&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Bs&&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",i=>i(n,uc(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||t0(n,t)?t.preventDefault():ot(n,"key")};xe.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};xe.keypress=(n,e)=>{let t=e;if(Tc(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||ke&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof j)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",s=>s(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function Vr(n){return{left:n.clientX,top:n.clientY}}function l0(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Fs(n,e,t,r,i){if(r==-1)return!1;let s=n.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(n.someProp(e,l=>o>s.depth?l(n,t,s.nodeAfter,s.before(o),i,!0):l(n,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function zt(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function a0(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&z.isSelectable(r)?(zt(n,new z(t)),!0):!1}function c0(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof z&&(r=t.node);let s=n.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let l=o>s.depth?s.nodeAfter:s.node(o);if(z.isSelectable(l)){r&&t.$from.depth>0&&o>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(o);break}}return i!=null?(zt(n,z.create(n.state.doc,i)),!0):!1}function u0(n,e,t,r,i){return Fs(n,"handleClickOn",e,t,r)||n.someProp("handleClick",s=>s(n,e,r))||(i?c0(n,t):a0(n,t))}function d0(n,e,t,r){return Fs(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function f0(n,e,t,r){return Fs(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||p0(n,t,r)}function p0(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(zt(n,j.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(o.inlineContent)zt(n,j.create(r,l+1,l+1+o.content.size));else if(z.isSelectable(o))zt(n,z.create(r,l));else continue;return!0}}function Vs(n){return nr(n)}const Cc=ke?"metaKey":"ctrlKey";Le.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Vs(n),i=Date.now(),s="singleClick";i-n.input.lastClick.time<500&&l0(t,n.input.lastClick)&&!t[Cc]&&(n.input.lastClick.type=="singleClick"?s="doubleClick":n.input.lastClick.type=="doubleClick"&&(s="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s};let o=n.posAtCoords(Vr(t));o&&(s=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new h0(n,o,t,!!r)):(s=="doubleClick"?d0:f0)(n,o.pos,o.inside,t)?t.preventDefault():ot(n,"pointer"))};class h0{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Cc],this.allowDefault=r.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let u=e.state.doc.resolve(t.pos);s=u.parent,o=u.depth?u.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.dom.nodeType==1?a.dom:null;let{selection:c}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof z&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Fr&&!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)),ot(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(()=>Hs(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(Vr(e))),this.updateAllowDefault(e),this.allowDefault||!t?ot(this.view,"pointer"):u0(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Tt&&this.mightDrag&&!this.mightDrag.node.isAtom||Ct&&!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)?(zt(this.view,D.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):ot(this.view,"pointer")}move(e){this.updateAllowDefault(e),ot(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)}}Le.touchstart=n=>{n.input.lastTouch=Date.now(),Vs(n),ot(n,"pointer")};Le.touchmove=n=>{n.input.lastTouch=Date.now(),ot(n,"pointer")};Le.contextmenu=n=>Vs(n);function Tc(n,e){return n.composing?!0:Tt&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const m0=fn?5e3:-1;xe.compositionstart=xe.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),nr(n,!0),n.markCursor=null;else if(nr(n),Fr&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){n.domSelection().collapse(o,o.nodeValue.length);break}else i=o,s=-1}}n.input.composing=!0}kc(n,m0)};xe.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++,kc(n,20))};function kc(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>nr(n),e))}function g0(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=b0());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function b0(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function nr(n,e=!1){if(!(fn&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),g0(n),e||n.docView&&n.docView.dirty){let t=Wg(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function y0(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(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const sn=dn&&fc<15||Bs&&Vg<604;Le.copy=xe.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let s=sn?null:t.clipboardData,o=r.content(),{dom:l,text:a}=gc(n,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):y0(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function w0(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function v0(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 i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?us(n,r.value,null,i,e):us(n,r.textContent,r.innerHTML,i,e)},50)}function us(n,e,t,r,i){let s=bc(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,i,s||R.empty)))return!0;if(!s)return!1;let o=w0(s),l=o?n.state.tr.replaceSelectionWith(o,r):n.state.tr.replaceSelection(s);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Ec(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," "):""}xe.paste=(n,e)=>{let t=e;if(n.composing&&!fn)return;let r=sn?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&us(n,Ec(r),r.getData("text/html"),i,t)?t.preventDefault():v0(n,t)};class x0{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const Mc=ke?"altKey":"ctrlKey";Le.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,s=i.empty?null:n.posAtCoords(Vr(t)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof z?i.to-1:i.to))){if(r&&r.mightDrag)o=z.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&&(o=z.create(n.state.doc,d.posBefore))}}let l=(o||n.state.selection).content(),{dom:a,text:c,slice:u}=gc(n,l);t.dataTransfer.clearData(),t.dataTransfer.setData(sn?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",sn||t.dataTransfer.setData("text/plain",c),n.dragging=new x0(u,!t[Mc],o)};Le.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};xe.dragover=xe.dragenter=(n,e)=>e.preventDefault();xe.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Vr(t));if(!i)return;let s=n.state.doc.resolve(i.pos),o=r&&r.slice;o?n.someProp("transformPasted",h=>{o=h(o,n)}):o=bc(n,Ec(t.dataTransfer),sn?null:t.dataTransfer.getData("text/html"),!1,s);let l=!!(r&&!t[Mc]);if(n.someProp("handleDrop",h=>h(n,t,o||R.empty,l))){t.preventDefault();return}if(!o)return;t.preventDefault();let a=o?Rg(n.state.doc,s.pos,o):s.pos;a==null&&(a=s.pos);let c=n.state.tr;if(l){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,o.content.firstChild):c.replaceRange(u,u,o),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&z.isSelectable(o.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(o.content.firstChild))c.setSelection(new z(p));else{let h=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,b,g,S)=>h=S),c.setSelection(hc(n,p,c.doc.resolve(h)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))};Le.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())&&Hs(n)},20))};Le.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)};Le.beforeinput=(n,e)=>{if(Ct&&fn&&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",s=>s(n,uc(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in xe)Le[n]=xe[n];function on(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 rr{constructor(e,t){this.toDOM=e,this.spec=t||bt,this.side=this.spec.side||0}map(e,t,r,i){let{pos:s,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new Pe(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof rr&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&on(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class at{constructor(e,t){this.attrs=e,this.spec=t||bt}map(e,t,r,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new Pe(s,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof at&&on(this.attrs,e.attrs)&&on(this.spec,e.spec)}static is(e){return e.type instanceof at}destroy(){}}class Ws{constructor(e,t){this.attrs=e,this.spec=t||bt}map(e,t,r,i){let s=e.mapResult(t.from+i,1);if(s.deleted)return null;let o=e.mapResult(t.to+i,-1);return o.deleted||o.pos<=s.pos?null:new Pe(s.pos-r,o.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),s;return i==t.from&&!(s=e.child(r)).isText&&i+s.nodeSize==t.to}eq(e){return this==e||e instanceof Ws&&on(this.attrs,e.attrs)&&on(this.spec,e.spec)}destroy(){}}class Pe{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Pe(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new Pe(e,e,new rr(t,r))}static inline(e,t,r,i){return new Pe(e,t,new at(r,i))}static node(e,t,r,i){return new Pe(e,t,new Ws(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof at}get widget(){return this.type instanceof rr}}const Ot=[],bt={};class Q{constructor(e,t){this.local=e.length?e:Ot,this.children=t.length?t:Ot}static create(e,t){return t.length?ir(t,e,0,bt):pe}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,s){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=t&&l.to>=e&&(!s||s(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,r,i+l,s)}}map(e,t,r){return this==pe||e.maps.length==0?this:this.mapInner(e,t,0,0,r||bt)}mapInner(e,t,r,i,s){let o;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,i);a&&a.type.valid(t,a)?(o||(o=[])).push(a):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?S0(this.children,o||[],e,t,r,i,s):o?new Q(o.sort(yt),Ot):pe}add(e,t){return t.length?this==pe?Q.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,s=0;e.forEach((l,a)=>{let c=a+r,u;if(u=Pc(t,l,c)){for(i||(i=this.children.slice());s<i.length&&i[s]<a;)s+=3;i[s]==a?i[s+2]=i[s+2].addInner(l,u,c+1):i.splice(s,0,a,a+l.nodeSize,ir(u,l,c+1,bt)),s+=3}});let o=Ac(s?Oc(t):t,-r);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||o.splice(l--,1);return new Q(o.length?this.local.concat(o).sort(yt):this.local,i||this.children)}remove(e){return e.length==0||this==pe?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,l=r[s]+t,a=r[s+1]+t;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>l&&d.to<a&&(e[u]=null,(o||(o=[])).push(d));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(o,l+1);c!=pe?r[s+2]=c:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let l=0;l<i.length;l++)i[l].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Q(i,r):pe}forChild(e,t){if(this==pe)return this;if(t.isLeaf)return Q.empty;let r,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let s=e+1,o=s+t.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<o&&a.to>s&&a.type instanceof at){let c=Math.max(s,a.from)-s,u=Math.min(o,a.to)-s;c<u&&(i||(i=[])).push(a.copy(c,u))}}if(i){let l=new Q(i.sort(yt),Ot);return r?new pt([l,r]):l}return r||pe}eq(e){if(this==e)return!0;if(!(e instanceof Q)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return qs(this.localsInner(e))}localsInner(e){if(this==pe)return Ot;if(e.inlineContent||!this.local.some(at.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof at||t.push(this.local[r]);return t}}Q.empty=new Q([],[]);Q.removeOverlap=qs;const pe=Q.empty;class pt{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,bt));return pt.from(r)}forChild(e,t){if(t.isLeaf)return Q.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,t);s!=pe&&(s instanceof pt?r=r.concat(s.members):r.push(s))}return pt.from(r)}eq(e){if(!(e instanceof pt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!t)t=s;else{r&&(t=t.slice(),r=!1);for(let o=0;o<s.length;o++)t.push(s[o])}}return t?qs(r?t:t.sort(yt)):Ot}static from(e){switch(e.length){case 0:return pe;case 1:return e[0];default:return new pt(e.every(t=>t instanceof Q)?e:e.reduce((t,r)=>t.concat(r instanceof Q?r:r.members),[]))}}}function S0(n,e,t,r,i,s,o){let l=n.slice();for(let c=0,u=s;c<t.maps.length;c++){let d=0;t.maps[c].forEach((f,p,h,m)=>{let b=m-h-(p-f);for(let g=0;g<l.length;g+=3){let S=l[g+1];if(S<0||f>S+u-d)continue;let w=l[g]+u-d;p>=w?l[g+1]=f<=w?-2:-1:f>=u&&b&&(l[g]+=b,l[g+1]+=b)}d+=b}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=t.map(n[c]+s),d=u-i;if(d<0||d>=r.content.size){a=!0;continue}let f=t.map(n[c+1]+s,-1),p=f-i,{index:h,offset:m}=r.content.findIndex(d),b=r.maybeChild(h);if(b&&m==d&&m+b.nodeSize==p){let g=l[c+2].mapInner(t,b,u+1,n[c]+s+1,o);g!=pe?(l[c]=d,l[c+1]=p,l[c+2]=g):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=C0(l,n,e,t,i,s,o),u=ir(c,r,0,o);e=u.local;for(let d=0;d<l.length;d+=3)l[d+1]<0&&(l.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let p=u.children[d];for(;f<l.length&&l[f]<p;)f+=3;l.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new Q(e.sort(yt),l)}function Ac(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new Pe(i.from+e,i.to+e,i.type))}return t}function C0(n,e,t,r,i,s,o){function l(a,c){for(let u=0;u<a.local.length;u++){let d=a.local[u].map(r,i,c);d?t.push(d):o.onRemove&&o.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<n.length;a+=3)n[a+1]==-1&&l(n[a+2],e[a]+s+1);return t}function Pc(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let s=0,o;s<n.length;s++)(o=n[s])&&o.from>t&&o.to<r&&((i||(i=[])).push(o),n[s]=null);return i}function Oc(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function ir(n,e,t,r){let i=[],s=!1;e.forEach((l,a)=>{let c=Pc(n,l,a+t);if(c){s=!0;let u=ir(c,l,t+a+1,r);u!=pe&&i.push(a,a+l.nodeSize,u)}});let o=Ac(s?Oc(n):n,-t).sort(yt);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||(r.onRemove&&r.onRemove(o[l].spec),o.splice(l--,1));return o.length||i.length?new Q(o,i):pe}function yt(n,e){return n.from-e.from||n.to-e.to}function qs(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==n&&(e=n.slice()),e[i]=s.copy(s.from,r.to),Rl(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,s.from),Rl(e,i,r.copy(s.from,r.to)));break}}}return e}function Rl(n,e,t){for(;e<n.length&&yt(t,n[e])>0;)e++;n.splice(e,0,t)}var ct={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:"'"},sr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},T0=typeof navigator<"u"&&/Mac/.test(navigator.platform),k0=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var le=0;le<10;le++)ct[48+le]=ct[96+le]=String(le);for(var le=1;le<=24;le++)ct[le+111]="F"+le;for(var le=65;le<=90;le++)ct[le]=String.fromCharCode(le+32),sr[le]=String.fromCharCode(le);for(var Li in ct)sr.hasOwnProperty(Li)||(sr[Li]=ct[Li]);function E0(n){var e=T0&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||k0&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?sr:ct)[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 M0=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function A0(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,s,o;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))M0?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),o&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function P0(n){let e=Object.create(null);for(let t in n)e[A0(t)]=n[t];return e}function _i(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function O0(n){let e=P0(n);return function(t,r){let i=E0(r),s,o=e[_i(i,r)];if(o&&o(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[_i(i,r,!1)];if(l&&l(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(s=ct[r.keyCode])&&s!=i){let l=e[_i(s,r)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}const R0=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function Rc(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const N0=(n,e,t)=>{let r=Rc(n,t);if(!r)return!1;let i=Gs(r);if(!i){let o=r.blockRange(),l=o&&Vt(o);return l==null?!1:(e&&e(n.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(!s.type.spec.isolating&&_c(n,i,e))return!0;if(r.parent.content.size==0&&(Bt(s,"end")||z.isSelectable(s))){let o=$r(n.doc,r.before(),r.after(),R.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=n.tr.step(o);l.setSelection(Bt(s,"end")?D.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):z.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},I0=(n,e,t)=>{let r=Rc(n,t);if(!r)return!1;let i=Gs(r);return i?Nc(n,i,e):!1},L0=(n,e,t)=>{let r=Ic(n,t);if(!r)return!1;let i=Us(r);return i?Nc(n,i,e):!1};function Nc(n,e,t){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=$r(n.doc,s,a,R.empty);if(!c||c.from!=s||c instanceof ie&&c.slice.size>=a-s)return!1;if(t){let u=n.tr.step(c);u.setSelection(j.create(u.doc,s)),t(u.scrollIntoView())}return!0}function Bt(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 _0=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;s=Gs(r)}let o=s&&s.nodeBefore;return!o||!z.isSelectable(o)?!1:(e&&e(n.tr.setSelection(z.create(n.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function Gs(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 Ic(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const z0=(n,e,t)=>{let r=Ic(n,t);if(!r)return!1;let i=Us(r);if(!i)return!1;let s=i.nodeAfter;if(_c(n,i,e))return!0;if(r.parent.content.size==0&&(Bt(s,"start")||z.isSelectable(s))){let o=$r(n.doc,r.before(),r.after(),R.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=n.tr.step(o);l.setSelection(Bt(s,"start")?D.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):z.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},j0=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;s=Us(r)}let o=s&&s.nodeAfter;return!o||!z.isSelectable(o)?!1:(e&&e(n.tr.setSelection(z.create(n.doc,s.pos)).scrollIntoView()),!0)};function Us(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const D0=(n,e)=>{let t=n.selection,r=t instanceof z,i;if(r){if(t.node.isTextblock||!ut(n.doc,t.from))return!1;i=t.from}else if(i=Br(n.doc,t.from,-1),i==null)return!1;if(e){let s=n.tr.join(i);r&&s.setSelection(z.create(s.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},B0=(n,e)=>{let t=n.selection,r;if(t instanceof z){if(t.node.isTextblock||!ut(n.doc,t.to))return!1;r=t.to}else if(r=Br(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},$0=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),s=i&&Vt(i);return s==null?!1:(e&&e(n.tr.lift(i,s).scrollIntoView()),!0)},H0=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
103
|
+
`).scrollIntoView()),!0)};function Lc(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const F0=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=Lc(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let l=t.after(),a=n.tr.replaceWith(l,l,o.createAndFill());a.setSelection(D.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},V0=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Re||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=Lc(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=n.tr.insert(o,s.createAndFill());l.setSelection(j.create(l.doc,o+1)),e(l.scrollIntoView())}return!0},W0=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(Lt(n.doc,s))return e&&e(n.tr.split(s).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Vt(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},q0=(n,e)=>{let{$from:t,to:r}=n.selection,i,s=t.sharedDepth(r);return s==0?!1:(i=t.before(s),e&&e(n.tr.setSelection(z.create(n.doc,i))),!0)};function G0(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||ut(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function _c(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,s,o;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(G0(n,e,t))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(s=(o=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&o.matchType(s[0]||i.type).validEnd){if(t){let d=e.pos+i.nodeSize,f=E.empty;for(let m=s.length-1;m>=0;m--)f=E.from(s[m].create(null,f));f=E.from(r.copy(f));let p=n.tr.step(new se(e.pos-1,d,e.pos,d,new R(f,1,0),s.length,!0)),h=d+2*s.length;ut(p.doc,h)&&p.join(h),t(p.scrollIntoView())}return!0}let a=D.findFrom(e,1),c=a&&a.$from.blockRange(a.$to),u=c&&Vt(c);if(u!=null&&u>=e.depth)return t&&t(n.tr.lift(c,u).scrollIntoView()),!0;if(l&&Bt(i,"start",!0)&&Bt(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(t){let m=E.empty;for(let g=f.length-1;g>=0;g--)m=E.from(f[g].copy(m));let b=n.tr.step(new se(e.pos-f.length,e.pos+i.nodeSize,e.pos+h,e.pos+i.nodeSize-h,new R(m,f.length,0),0,!0));t(b.scrollIntoView())}return!0}}return!1}function zc(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(j.create(e.doc,n<0?i.start(s):i.end(s)))),!0):!1}}const U0=zc(-1),K0=zc(1);function J0(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),l=o&&zs(o,n,e);return l?(r&&r(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Nl(n,e=null){return function(t,r){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:l}}=t.selection.ranges[s];t.doc.nodesBetween(o,l,(a,c)=>{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)i=!0;else{let u=t.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,n)}})}if(!i)return!1;if(r){let s=t.tr;for(let o=0;o<t.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:a}}=t.selection.ranges[o];s.setBlockType(l,a,n,e)}r(s.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Y0(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),l=!1,a=o;if(!o)return!1;if(o.depth>=2&&i.node(o.depth-1).type.compatibleContent(n)&&o.startIndex==0){if(i.index(o.depth-1)==0)return!1;let u=t.doc.resolve(o.start-2);a=new es(u,u,o.depth),o.endIndex<o.parent.childCount&&(o=new es(i,t.doc.resolve(s.end(o.depth)),o.depth)),l=!0}let c=zs(a,n,e,o);return c?(r&&r(X0(t.tr,o,c,l,n).scrollIntoView()),!0):!1}}function X0(n,e,t,r,i){let s=E.empty;for(let u=t.length-1;u>=0;u--)s=E.from(t[u].type.create(t[u].attrs,s));n.step(new se(e.start-(r?2:0),e.end,e.start,e.end,new R(s,0,0),t.length,!0));let o=0;for(let u=0;u<t.length;u++)t[u].type==i&&(o=u+1);let l=t.length-o,a=e.start+t.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&Lt(n.doc,a,l)&&(n.split(a,l),a+=2*l),a+=c.child(u).nodeSize;return n}function Q0(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==n);return s?t?r.node(s.depth-1).type==n?Z0(e,t,n,s):e1(e,t,s):!0:!1}}function Z0(n,e,t,r){let i=n.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new se(s-1,o,s,o,new R(E.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new es(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const l=Vt(r);if(l==null)return!1;i.lift(r,l);let a=i.mapping.map(s,-1)-1;return ut(i.doc,a)&&i.join(a),e(i.scrollIntoView()),!0}function e1(n,e,t){let r=n.tr,i=t.parent;for(let p=t.end,h=t.endIndex-1,m=t.startIndex;h>m;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let s=r.doc.resolve(t.start),o=s.nodeAfter;if(r.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?E.empty:E.from(i))))return!1;let d=s.pos,f=d+o.nodeSize;return r.step(new se(d-(l?1:0),f+(a?1:0),d+1,f-1,new R((l?E.empty:E.from(i.copy(E.empty))).append(a?E.empty:E.from(i.copy(E.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function t1(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==n);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=E.from(c?n.create():null),d=new R(E.from(n.create(null,E.from(l.type.create(null,u)))),c?3:1,0),f=s.start,p=s.end;t(e.tr.step(new se(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}function jc(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:s}=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 s},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,s=t.storedMarks,t}}}class n1{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:i}=t,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...u)=>{const d=a(...u)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,l=[],a=!!e,c=e||s.tr,u=()=>(!a&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(c),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...m)=>{const b=this.buildProps(c,t),g=p(...m)(b);return l.push(g),d}])),run:u};return d}createCan(e){const{rawCommands:t,state:r}=this,i=!1,s=e||r.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...u)=>c(...u)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,l={tr:e,editor:i,view:o,state:jc({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([a,c])=>[a,(...u)=>c(...u)(l)]))}};return l}}function ne(n,e,t){return n.config[e]===void 0&&n.parent?ne(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?ne(n.parent,e,t):null}):n.config[e]}function r1(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function ae(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 U(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const l=s?s.split(" "):[],a=r[i]?r[i].split(" "):[],c=l.filter(u=>!a.includes(u));r[i]=[...a,...c].join(" ")}else i==="style"?r[i]=[r[i],s].join("; "):r[i]=s}),r},{})}function i1(n){return typeof n=="function"}function Y(n,e=void 0,...t){return i1(n)?e?n.bind(e)(...t):n(...t):n}function s1(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Wr{constructor(e){this.find=e.find,this.handler=e.handler}}class o1{constructor(e){this.find=e.find,this.handler=e.handler}}function l1(n){return Object.prototype.toString.call(n).slice(8,-1)}function zi(n){return l1(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function qr(n,e){const t={...n};return zi(n)&&zi(e)&&Object.keys(e).forEach(r=>{zi(e[r])?r in n?t[r]=qr(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class He{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=Y(ne(this,"addOptions",{name:this.name}))),this.storage=Y(ne(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new He(e)}configure(e={}){const t=this.extend();return t.parent=this.parent,t.options=qr(this.options,e),t.storage=Y(ne(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new He({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Y(ne(t,"addOptions",{name:t.name})),t.storage=Y(ne(t,"addStorage",{name:t.name,options:t.options})),t}}function a1(n,e,t){const{from:r,to:i}=e,{blockSeparator:s=`
|
|
104
|
+
|
|
105
|
+
`,textSerializers:o={}}=t||{};let l="";return n.nodesBetween(r,i,(a,c,u,d)=>{var f;a.isBlock&&c>r&&(l+=s);const p=o==null?void 0:o[a.type.name];if(p)return u&&(l+=p({node:a,pos:c,parent:u,index:d,range:e})),!1;a.isText&&(l+=(f=a==null?void 0:a.text)===null||f===void 0?void 0:f.slice(Math.max(r,c)-c,i-c))}),l}function c1(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}He.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ie({key:new Me("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(u=>u.$from.pos)),l=Math.max(...s.map(u=>u.$to.pos)),a=c1(t);return a1(r,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}});const u1=()=>({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),d1=(n=!1)=>({commands:e})=>e.setContent("",n),f1=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:s,$to:o})=>{n.doc.nodesBetween(s.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),p=d.blockRange(f);if(!p)return;const h=Vt(p);if(l.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(h||h===0)&&e.lift(p,h)})}),!0},p1=n=>e=>n(e),h1=()=>({state:n,dispatch:e})=>V0(n,e),m1=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,s=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new j(r.doc.resolve(o-1))),!0},g1=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const l=i.before(s),a=i.after(s);n.delete(l,a).scrollIntoView()}return!0}return!1},b1=n=>({tr:e,state:t,dispatch:r})=>{const i=ae(n,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const a=s.before(o),c=s.after(o);e.delete(a,c).scrollIntoView()}return!0}return!1},y1=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},w1=()=>({state:n,dispatch:e})=>R0(n,e),v1=()=>({commands:n})=>n.keyboardShortcut("Enter"),x1=()=>({state:n,dispatch:e})=>F0(n,e);function or(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:s1(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function ds(n,e,t={}){return n.find(r=>r.type===e&&or(r.attrs,t))}function S1(n,e,t={}){return!!ds(n,e,t)}function Ks(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 i=ds([...r.node.marks],e,t);if(!i)return;let s=r.index,o=n.start()+r.offset,l=s+1,a=o+r.node.nodeSize;for(ds([...r.node.marks],e,t);s>0&&i.isInSet(n.parent.child(s-1).marks);)s-=1,o-=n.parent.child(s).nodeSize;for(;l<n.parent.childCount&&S1([...n.parent.child(l).marks],e,t);)a+=n.parent.child(l).nodeSize,l+=1;return{from:o,to:a}}function ft(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const C1=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const s=ft(n,r.schema),{doc:o,selection:l}=t,{$from:a,from:c,to:u}=l;if(i){const d=Ks(a,s,e);if(d&&d.from<=c&&d.to>=u){const f=j.create(o,d.from,d.to);t.setSelection(f)}}return!0},T1=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Dc(n){return n instanceof j}function mt(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function k1(n,e=null){if(!e)return null;const t=D.atStart(n),r=D.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,s=r.to;return e==="all"?j.create(n,mt(0,i,s),mt(n.content.size,i,s)):j.create(n,mt(e,i,s),mt(e,i,s))}function Js(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const E1=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{Js()&&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(s&&n===null&&!Dc(t.state.selection))return o(),!0;const l=k1(i.doc,n)||t.state.selection,a=t.state.selection.eq(l);return s&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},M1=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),A1=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),Bc=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&&Bc(r)}return n};function Il(n){const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return Bc(t)}function lr(n,e,t){t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,i=typeof n=="string";if(r)try{return Array.isArray(n)&&n.length>0?E.fromArray(n.map(o=>e.nodeFromJSON(o))):e.nodeFromJSON(n)}catch(s){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",s),lr("",e,t)}if(i){const s=nn.fromSchema(e);return t.slice?s.parseSlice(Il(n),t.parseOptions).content:s.parse(Il(n),t.parseOptions)}return lr("",e,t)}function P1(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof ie||i instanceof se))return;const s=n.mapping.maps[r];let o=0;s.forEach((l,a,c,u)=>{o===0&&(o=u)}),n.setSelection(D.near(n.doc.resolve(o),t))}const O1=n=>n.toString().startsWith("<"),R1=(n,e,t)=>({tr:r,dispatch:i,editor:s})=>{if(i){t={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};const o=lr(e,s.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(o.toString()==="<>")return!0;let{from:l,to:a}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},c=!0,u=!0;if((O1(o)?o:[o]).forEach(p=>{p.check(),c=c?p.isText&&p.marks.length===0:!1,u=u?p.isBlock:!1}),l===a&&u){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,a+=1)}let f;c?(Array.isArray(e)?f=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?f=e.text:f=e,r.insertText(f,l,a)):(f=o,r.replaceWith(l,a,f)),t.updateSelection&&P1(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},N1=()=>({state:n,dispatch:e})=>D0(n,e),I1=()=>({state:n,dispatch:e})=>B0(n,e),L1=()=>({state:n,dispatch:e})=>N0(n,e),_1=()=>({state:n,dispatch:e})=>z0(n,e),z1=()=>({tr:n,state:e,dispatch:t})=>{try{const r=Br(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},j1=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Br(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},D1=()=>({state:n,dispatch:e})=>I0(n,e),B1=()=>({state:n,dispatch:e})=>L0(n,e);function $c(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function $1(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,s,o;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))Js()||$c()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),o&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}const H1=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const s=$1(n).split(/-(?!$)/),o=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function Ys(n,e,t={}){const{from:r,to:i,empty:s}=n.selection,o=e?ae(e,n.schema):null,l=[];n.doc.nodesBetween(r,i,(d,f)=>{if(d.isText)return;const p=Math.max(r,f),h=Math.min(i,f+d.nodeSize);l.push({node:d,from:p,to:h})});const a=i-r,c=l.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>or(d.node.attrs,t,{strict:!1}));return s?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=a}const F1=(n,e={})=>({state:t,dispatch:r})=>{const i=ae(n,t.schema);return Ys(t,i,e)?$0(t,r):!1},V1=()=>({state:n,dispatch:e})=>W0(n,e),W1=n=>({state:e,dispatch:t})=>{const r=ae(n,e.schema);return Q0(r)(e,t)},q1=()=>({state:n,dispatch:e})=>H0(n,e);function Xs(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Ll(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const G1=(n,e)=>({tr:t,state:r,dispatch:i})=>{let s=null,o=null;const l=Xs(typeof n=="string"?n:n.name,r.schema);return l?(l==="node"&&(s=ae(n,r.schema)),l==="mark"&&(o=ft(n,r.schema)),i&&t.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(c,u)=>{s&&s===c.type&&t.setNodeMarkup(u,void 0,Ll(c.attrs,e)),o&&c.marks.length&&c.marks.forEach(d=>{o===d.type&&t.addMark(u,u+c.nodeSize,o.create(Ll(d.attrs,e)))})})}),!0):!1},U1=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),K1=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),J1=()=>({state:n,dispatch:e})=>_0(n,e),Y1=()=>({state:n,dispatch:e})=>j0(n,e),X1=()=>({state:n,dispatch:e})=>q0(n,e),Q1=()=>({state:n,dispatch:e})=>K0(n,e),Z1=()=>({state:n,dispatch:e})=>U0(n,e);function eb(n,e,t={}){return lr(n,e,{slice:!1,parseOptions:t})}const tb=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:s})=>{const{doc:o}=r,l=eb(n,i.schema,t);return s&&r.replaceWith(0,o.content.size,l).setMeta("preventUpdate",!e),!0};function Gr(n,e){const t=ft(e,n.schema),{from:r,to:i,empty:s}=n.selection,o=[];s?(n.storedMarks&&o.push(...n.storedMarks),o.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function nb(n,e){const t=new ic(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function rb(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function ib(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,s)=>{t(i)&&r.push({node:i,pos:s})}),r}function Hc(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 Qs(n){return e=>Hc(e.$from,n)}function sb(n,e){const t=ae(e,n.schema),{from:r,to:i}=n.selection,s=[];n.doc.nodesBetween(r,i,l=>{s.push(l)});const o=s.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function ob(n,e){const t=Xs(typeof e=="string"?e:e.name,n.schema);return t==="node"?sb(n,e):t==="mark"?Gr(n,e):{}}function lb(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function ab(n){const e=lb(n);return e.length===1?e:e.filter((t,r)=>!e.filter((s,o)=>o!==r).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function cb(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=t[s];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const c=e.slice(s).map(l,-1),u=e.slice(s).map(a),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),ab(r)}function Zs(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const s=t.resolve(n-1),o=Ks(s,i.type);o&&r.push({mark:i,...o})}):t.nodesBetween(n,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}function Wn(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function ub(n,e,t={}){const{empty:r,ranges:i}=n.selection,s=e?ft(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(d=>s?s.name===d.type.name:!0).find(d=>or(d.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:d,$to:f})=>{const p=d.pos,h=f.pos;n.doc.nodesBetween(p,h,(m,b)=>{if(!m.isText&&!m.marks.length)return;const g=Math.max(p,b),S=Math.min(h,b+m.nodeSize),w=S-g;o+=w,l.push(...m.marks.map(v=>({mark:v,from:g,to:S})))})}),o===0)return!1;const a=l.filter(d=>s?s.name===d.mark.type.name:!0).filter(d=>or(d.mark.attrs,t,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=l.filter(d=>s?d.mark.type!==s&&d.mark.type.excludes(s):!0).reduce((d,f)=>d+f.to-f.from,0);return(a>0?a+c:a)>=o}function _l(n,e){const{nodeExtensions:t}=r1(e),r=t.find(o=>o.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=Y(ne(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function db(n,e,t){var r;const{selection:i}=e;let s=null;if(Dc(i)&&(s=i.$cursor),s){const l=(r=n.storedMarks)!==null&&r!==void 0?r:s.marks();return!!t.isInSet(l)||!l.some(a=>a.type.excludes(t))}const{ranges:o}=i;return o.some(({$from:l,$to:a})=>{let c=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,a.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const p=!f||f.type.allowsMarkType(t),h=!!t.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(t));c=p&&h}return!c}),c})}const fb=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:l}=s,a=ft(n,r.schema);if(i)if(o){const c=Gr(r,a);t.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,p)=>{const h=Math.max(p,u),m=Math.min(p+f.nodeSize,d);f.marks.find(g=>g.type===a)?f.marks.forEach(g=>{a===g.type&&t.addMark(h,m,a.create({...g.attrs,...e}))}):t.addMark(h,m,a.create(e))})});return db(r,t,a)},pb=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),hb=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const s=ae(n,t.schema);return s.isTextblock?i().command(({commands:o})=>Nl(s,e)(t)?!0:o.clearNodes()).command(({state:o})=>Nl(s,e)(o,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},mb=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=mt(n,0,r.content.size),s=z.create(r,i);e.setSelection(s)}return!0},gb=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:s}=typeof n=="number"?{from:n,to:n}:n,o=j.atStart(r).from,l=j.atEnd(r).to,a=mt(i,o,l),c=mt(s,o,l),u=j.create(r,a,c);e.setSelection(u)}return!0},bb=n=>({state:e,dispatch:t})=>{const r=ae(n,e.schema);return t1(r)(e,t)};function zl(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e==null?void 0:e.includes(i.type.name));n.tr.ensureMarks(r)}}const yb=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:l,$to:a}=s,c=i.extensionManager.attributes,u=Wn(c,l.node().type.name,l.node().attrs);if(s instanceof z&&s.node.isBlock)return!l.parentOffset||!Lt(o,l.pos)?!1:(r&&(n&&zl(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const d=a.parentOffset===a.parent.content.size;s instanceof j&&e.deleteSelection();const f=l.depth===0?void 0:rb(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=d&&f?[{type:f,attrs:u}]:void 0,h=Lt(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!h&&Lt(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:u}]:void 0),h&&(e.split(e.mapping.map(l.pos),1,p),f&&!d&&!l.parentOffset&&l.parent.type!==f)){const m=e.mapping.map(l.before()),b=e.doc.resolve(m);l.node(-1).canReplaceWith(b.index(),b.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}n&&zl(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},wb=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var s;const o=ae(n,t.schema),{$from:l,$to:a}=t.selection,c=t.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(a))return!1;const u=l.node(-1);if(u.type!==o)return!1;const d=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==o||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let b=E.empty;const g=l.index(-1)?1:l.index(-2)?2:3;for(let O=l.depth-g;O>=l.depth-3;O-=1)b=E.from(l.node(O).copy(b));const S=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,w=Wn(d,l.node().type.name,l.node().attrs),v=((s=o.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(w))||void 0;b=b.append(E.from(o.createAndFill(null,v)||void 0));const x=l.before(l.depth-(g-1));e.replace(x,l.after(-S),new R(b,4-g,0));let C=-1;e.doc.nodesBetween(x,e.doc.content.size,(O,k)=>{if(C>-1)return!1;O.isTextblock&&O.content.size===0&&(C=k+1)}),C>-1&&e.setSelection(j.near(e.doc.resolve(C))),e.scrollIntoView()}return!0}const f=a.pos===l.end()?u.contentMatchAt(0).defaultType:null,p=Wn(d,u.type.name,u.attrs),h=Wn(d,l.node().type.name,l.node().attrs);e.delete(l.pos,a.pos);const m=f?[{type:o,attrs:p},{type:f,attrs:h}]:[{type:o,attrs:p}];if(!Lt(e.doc,l.pos,2))return!1;if(r){const{selection:b,storedMarks:g}=t,{splittableMarks:S}=i.extensionManager,w=g||b.$to.parentOffset&&b.$from.marks();if(e.split(l.pos,2,m).scrollIntoView(),!w||!r)return!0;const v=w.filter(x=>S.includes(x.type.name));e.ensureMarks(v)}return!0},ji=(n,e)=>{const t=Qs(o=>o.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 i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&ut(n.doc,t.pos)&&n.join(t.pos),!0},Di=(n,e)=>{const t=Qs(o=>o.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 i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&ut(n.doc,r)&&n.join(r),!0},vb=(n,e,t,r={})=>({editor:i,tr:s,state:o,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,p=ae(n,o.schema),h=ae(e,o.schema),{selection:m,storedMarks:b}=o,{$from:g,$to:S}=m,w=g.blockRange(S),v=b||m.$to.parentOffset&&m.$from.marks();if(!w)return!1;const x=Qs(C=>_l(C.type.name,d))(m);if(w.depth>=1&&x&&w.depth-x.depth<=1){if(x.node.type===p)return c.liftListItem(h);if(_l(x.node.type.name,d)&&p.validContent(x.node.content)&&l)return a().command(()=>(s.setNodeMarkup(x.pos,p),!0)).command(()=>ji(s,p)).command(()=>Di(s,p)).run()}return!t||!v||!l?a().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>ji(s,p)).command(()=>Di(s,p)).run():a().command(()=>{const C=u().wrapInList(p,r),O=v.filter(k=>f.includes(k.type.name));return s.ensureMarks(O),C?!0:c.clearNodes()}).wrapInList(p,r).command(()=>ji(s,p)).command(()=>Di(s,p)).run()},xb=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=ft(n,r.schema);return ub(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},Sb=(n,e,t={})=>({state:r,commands:i})=>{const s=ae(n,r.schema),o=ae(e,r.schema);return Ys(r,s,t)?i.setNode(o):i.setNode(s,t)},Cb=(n,e={})=>({state:t,commands:r})=>{const i=ae(n,t.schema);return Ys(t,i,e)?r.lift(i):r.wrapIn(i,e)},Tb=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let s;if(i.spec.isInputRules&&(s=i.getState(n))){if(e){const o=n.tr,l=s.transform;for(let a=l.steps.length-1;a>=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,n.schema.text(s.text,a))}else o.delete(s.from,s.to)}return!0}}return!1},kb=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(s=>{n.removeMark(s.$from.pos,s.$to.pos)}),!0},Eb=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=t,a=ft(n,r.schema),{$from:c,empty:u,ranges:d}=l;if(!i)return!0;if(u&&o){let{from:f,to:p}=l;const h=(s=c.marks().find(b=>b.type===a))===null||s===void 0?void 0:s.attrs,m=Ks(c,a,h);m&&(f=m.from,p=m.to),t.removeMark(f,p,a)}else d.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,a)});return t.removeStoredMark(a),!0},Mb=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let s=null,o=null;const l=Xs(typeof n=="string"?n:n.name,r.schema);return l?(l==="node"&&(s=ae(n,r.schema)),l==="mark"&&(o=ft(n,r.schema)),i&&t.selection.ranges.forEach(a=>{const c=a.$from.pos,u=a.$to.pos;r.doc.nodesBetween(c,u,(d,f)=>{s&&s===d.type&&t.setNodeMarkup(f,void 0,{...d.attrs,...e}),o&&d.marks.length&&d.marks.forEach(p=>{if(o===p.type){const h=Math.max(f,c),m=Math.min(f+d.nodeSize,u);t.addMark(h,m,o.create({...p.attrs,...e}))}})})}),!0):!1},Ab=(n,e={})=>({state:t,dispatch:r})=>{const i=ae(n,t.schema);return J0(i,e)(t,r)},Pb=(n,e={})=>({state:t,dispatch:r})=>{const i=ae(n,t.schema);return Y0(i,e)(t,r)};var Ob=Object.freeze({__proto__:null,blur:u1,clearContent:d1,clearNodes:f1,command:p1,createParagraphNear:h1,cut:m1,deleteCurrentNode:g1,deleteNode:b1,deleteRange:y1,deleteSelection:w1,enter:v1,exitCode:x1,extendMarkRange:C1,first:T1,focus:E1,forEach:M1,insertContent:A1,insertContentAt:R1,joinUp:N1,joinDown:I1,joinBackward:L1,joinForward:_1,joinItemBackward:z1,joinItemForward:j1,joinTextblockBackward:D1,joinTextblockForward:B1,keyboardShortcut:H1,lift:F1,liftEmptyBlock:V1,liftListItem:W1,newlineInCode:q1,resetAttributes:G1,scrollIntoView:U1,selectAll:K1,selectNodeBackward:J1,selectNodeForward:Y1,selectParentNode:X1,selectTextblockEnd:Q1,selectTextblockStart:Z1,setContent:tb,setMark:fb,setMeta:pb,setNode:hb,setNodeSelection:mb,setTextSelection:gb,sinkListItem:bb,splitBlock:yb,splitListItem:wb,toggleList:vb,toggleMark:xb,toggleNode:Sb,toggleWrap:Cb,undoInputRule:Tb,unsetAllMarks:kb,unsetMark:Eb,updateAttributes:Mb,wrapIn:Ab,wrapInList:Pb});He.create({name:"commands",addCommands(){return{...Ob}}});He.create({name:"editable",addProseMirrorPlugins(){return[new Ie({key:new Me("editable"),props:{editable:()=>this.editor.options.editable}})]}});He.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Ie({key:new Me("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}}}})]}});He.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:d}=a,{pos:f,parent:p}=d,h=d.parent.isTextblock&&f>0?l.doc.resolve(f-1):d,m=h.parent.type.spec.isolating,b=d.pos-d.parentOffset,g=m&&h.parent.childCount===1?b===d.pos:D.atStart(c).from===f;return!u||!p.type.isTextblock||p.textContent.length||!g||g&&d.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.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()},i={...r},s={...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 Js()||$c()?s:i},addProseMirrorPlugins(){return[new Ie({key:new Me("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(h=>h.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:s,to:o}=e.selection,l=D.atStart(e.doc).from,a=D.atEnd(e.doc).to;if(i||!(s===l&&o===a)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const d=t.tr,f=jc({state:t,transaction:d}),{commands:p}=new n1({editor:this.editor,state:f});if(p.clearNodes(),!!d.steps.length)return d}})]}});He.create({name:"tabindex",addProseMirrorPlugins(){return[new Ie({key:new Me("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function $t(n){return new Wr({find:n.find,handler:({state:e,range:t,match:r})=>{const i=Y(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],l=r[0];if(o){const a=l.search(/\S/),c=t.from+l.indexOf(o),u=c+o.length;if(Zs(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===n.type&&m!==p.mark.type)).filter(p=>p.to>c).length)return null;u<t.to&&s.delete(u,t.to),c>t.from&&s.delete(t.from+a,c);const f=t.from+a+o.length;s.addMark(t.from+a,f,n.type.create(i||{})),s.removeStoredMark(n.type)}}})}function Rb(n){return new Wr({find:n.find,handler:({state:e,range:t,match:r})=>{const i=Y(n.getAttributes,void 0,r)||{},{tr:s}=e,o=t.from;let l=t.to;const a=n.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=o+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];s.insertText(d,o+r[0].length-1),s.replaceWith(u,l,a)}else r[0]&&s.insert(o-1,n.type.create(i)).delete(s.mapping.map(o),s.mapping.map(l));s.scrollIntoView()}})}function fs(n){return new Wr({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),s=Y(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,s)}})}function ln(n){return new Wr({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const s=Y(n.getAttributes,void 0,r)||{},o=e.tr.delete(t.from,t.to),a=o.doc.resolve(t.from).blockRange(),c=a&&zs(a,n.type,s);if(!c)return null;if(o.wrap(a,c),n.keepMarks&&n.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:p}=n.editor.extensionManager,h=f||d.$to.parentOffset&&d.$from.marks();if(h){const m=h.filter(b=>p.includes(b.type.name));o.ensureMarks(m)}}if(n.keepAttributes){const d=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,s).run()}const u=o.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&ut(o.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&o.join(t.from-1)}})}class Ne{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=Y(ne(this,"addOptions",{name:this.name}))),this.storage=Y(ne(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ne(e)}configure(e={}){const t=this.extend();return t.options=qr(this.options,e),t.storage=Y(ne(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ne({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Y(ne(t,"addOptions",{name:t.name})),t.storage=Y(ne(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===t.name))return!1;const a=o.find(c=>(c==null?void 0:c.type.name)===t.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class X{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=Y(ne(this,"addOptions",{name:this.name}))),this.storage=Y(ne(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new X(e)}configure(e={}){const t=this.extend();return t.options=qr(this.options,e),t.storage=Y(ne(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new X({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Y(ne(t,"addOptions",{name:t.name})),t.storage=Y(ne(t,"addStorage",{name:t.name,options:t.options})),t}}function vt(n){return new o1({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const s=Y(n.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,l=r[r.length-1],a=r[0];let c=t.to;if(l){const u=a.search(/\S/),d=t.from+a.indexOf(l),f=d+l.length;if(Zs(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(b=>b===n.type&&b!==h.mark.type)).filter(h=>h.to>d).length)return null;f<t.to&&o.delete(f,t.to),d>t.from&&o.delete(t.from+u,d),c=t.from+u+l.length,o.addMark(t.from+u,c,n.type.create(s||{})),o.removeStoredMark(n.type)}}})}const Fc=(n,e,t="id",r="item")=>{const i=s=>{var o,l,a;if(!s||!n)return null;if(s.type==="relation-block"&&((o=s.attrs)!=null&&o.id)){const c=(l=n.find(u=>{var d;return(u==null?void 0:u[t])===((d=s.attrs)==null?void 0:d.id)}))==null?void 0:l[r];s.attrs.data=c}return(a=s.content)==null||a.map(i),s};return i(e)},Vc=(n,e)=>{const t=e.map(s=>(s.type==="mark"?Ne:X).create({name:s.name,renderHTML({HTMLAttributes:l}){return s.render?[...s.render(l),0]:[s.component??(s.type==="mark"?"span":"div"),l,0]}})),r=t.map(({name:s})=>s);return[...n.filter(s=>r.indexOf(s.name)<0),...t]},Wc=(n,e,t)=>{const r=t.find(i=>i.type===e&&i.name===n);if(r)return{...r.config,options:r.options}},Nb=(n,e)=>{var r;const t=(r=e.addAttributes)==null?void 0:r.call(e);return!t||!n?n:Object.fromEntries(Object.entries(n).filter(([i])=>{var s;return((s=t[i])==null?void 0:s.rendered)!==!1}))},Bi=(n,e,t="node")=>{const r=Wc(n.type,t,e);if(!(r!=null&&r.renderHTML))return[];const i=Nb(n.attrs,r);return r.render?r.render(n):r.renderHTML({node:n,HTMLAttributes:i})},qc=(n,e,t)=>{if(n!=null&&n.content&&(n.content=n.content.map(o=>qc(o,e,t))),n.type==="text"){if(n.marks){let o;return n.marks.reverse().forEach(l=>{const[a="span",c=l.attrs]=Bi(l,e,"mark");o=t(a,c,o||n.text)}),o}return n.text??""}const r=Wc(n.type,"node",e);if(r!=null&&r.render)return Bi(n,e);const[i="div",s=n.attrs]=Bi(n,e);return t(i,s,n.content)},Gc=(n,e,t)=>qc(n,e,t),$i={colspan:"colSpan",rowspan:"rowSpan",textAlign:"textalign"},Ib=(n,e)=>({...Object.fromEntries(Object.entries(e).map(([t,r])=>[(n==null?void 0:n[t])??($i==null?void 0:$i[t])??t,r]))}),Hi={},Uc=n=>{const{content:e,serializers:t=[],componentSerializers:r=[],renderingNodes:i,remappedAttributes:s,themeName:o,tokens:l,customTheme:a}=n,c=JSON.parse(JSON.stringify(e)),u=Vc(t,r);return Gc(c,u,(d,f,p)=>{const h={...f,style:void 0},m=Ib(s,h),b=(i==null?void 0:i[d])??(Hi==null?void 0:Hi[d]);return b?b({children:p,attrs:m,themeName:o,tokens:l,customTheme:a}):y.jsx(Ms,{as:d,...m,themeName:o,tokens:l,customTheme:a,children:p})})},Lb=/^\s*>\s$/,_b=X.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",U(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[ln({find:Lb,type:this.type})]}}),zb=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,jb=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Db=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Bb=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,$b=Ne.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",U(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[$t({find:zb,type:this.type}),$t({find:Db,type:this.type})]},addPasteRules(){return[vt({find:jb,type:this.type}),vt({find:Bb,type:this.type})]}}),Hb=X.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",U(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),jl=Ne.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",U(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=Gr(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Dl=/^\s*([-+*])\s$/,Fb=X.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",U(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Hb.name,this.editor.getAttributes(jl.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=ln({find:Dl,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=ln({find:Dl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(jl.name),editor:this.editor})),[n]}}),Vb=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,Wb=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,qb=Ne.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",U(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[$t({find:Vb,type:this.type})]},addPasteRules(){return[vt({find:Wb,type:this.type})]}}),Gb=/^```([a-z]+)?[\s\n]$/,Ub=/^~~~([a-z]+)?[\s\n]$/,Kb=X.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options,s=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",U(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
106
|
+
|
|
107
|
+
`);return!s||!o?!1:n.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:s}=t;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0||r.nodeAt(l)?!1:n.commands.exitCode()}}},addInputRules(){return[fs({find:Gb,type:this.type,getAttributes:n=>({language:n[1]})}),fs({find:Ub,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Ie({key:new Me("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!t||!s)return!1;const{tr:o}=n.state;return n.state.selection.from===n.state.doc.nodeSize-(1+n.state.selection.$to.depth*2)?o.insert(n.state.selection.from-1,this.type.create({language:s})):o.replaceSelectionWith(this.type.create({language:s})),o.setSelection(j.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(t.replace(/\r\n?/g,`
|
|
108
|
+
`)),o.setMeta("paste",!0),n.dispatch(o),!0}}})]}}),Jb=X.create({name:"doc",topNode:!0,content:"block+"}),Yb=X.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",U(this.options.HTMLAttributes,n)]},renderText(){return`
|
|
109
|
+
`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=r.extensionManager,a=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&o){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Xb=X.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,U(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>fs({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),Qb=X.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",U(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:s})=>{var o;if(s){const{$to:l}=i.selection,a=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(j.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(z.create(i.doc,l.pos)):i.setSelection(j.create(i.doc,l.pos));else{const c=(o=l.parent.type.contentMatch.defaultType)===null||o===void 0?void 0:o.create();c&&(i.insert(a,c),i.setSelection(j.create(i.doc,a+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Rb({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Zb=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ey=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,ty=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ny=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ry=Ne.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",U(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[$t({find:Zb,type:this.type}),$t({find:ty,type:this.type})]},addPasteRules(){return[vt({find:ey,type:this.type}),vt({find:ny,type:this.type})]}}),iy="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",sy="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ht=(n,e)=>{for(const t in e)n[t]=e[t];return n},ps="numeric",hs="ascii",ms="alpha",qn="asciinumeric",Ln="alphanumeric",gs="domain",Kc="emoji",oy="scheme",ly="slashscheme",Bl="whitespace";function ay(n,e){return n in e||(e[n]=[]),e[n]}function gt(n,e,t){e[ps]&&(e[qn]=!0,e[Ln]=!0),e[hs]&&(e[qn]=!0,e[ms]=!0),e[qn]&&(e[Ln]=!0),e[ms]&&(e[Ln]=!0),e[Ln]&&(e[gs]=!0),e[Kc]&&(e[gs]=!0);for(const r in e){const i=ay(r,t);i.indexOf(n)<0&&i.push(n)}}function cy(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function he(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}he.groups={};he.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(n))return s}return e.jd},has(n,e){return e===void 0&&(e=!1),e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||he.groups;let i;return e&&e.j?i=e:(i=new he(e),t&&r&>(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const s=n.length;if(!s)return i;for(let o=0;o<s-1;o++)i=i.tt(n[o]);return i.tt(n[s-1],e,t,r)},tt(n,e,t,r){r=r||he.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const s=e;let o,l=i.go(n);if(l?(o=new he,Ht(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new he,s){if(r)if(o.t&&typeof o.t=="string"){const a=Ht(cy(o.t,r),t);gt(s,a,r)}else t&>(s,t,r);o.t=s}return i.j[n]=o,o}};const B=(n,e,t,r,i)=>n.ta(e,t,r,i),Ce=(n,e,t,r,i)=>n.tr(e,t,r,i),$l=(n,e,t,r,i)=>n.ts(e,t,r,i),A=(n,e,t,r,i)=>n.tt(e,t,r,i),Ke="WORD",bs="UWORD",an="LOCALHOST",ys="TLD",ws="UTLD",Gn="SCHEME",Rt="SLASH_SCHEME",eo="NUM",Jc="WS",to="NL",Qt="OPENBRACE",Zt="CLOSEBRACE",ar="OPENBRACKET",cr="CLOSEBRACKET",ur="OPENPAREN",dr="CLOSEPAREN",fr="OPENANGLEBRACKET",pr="CLOSEANGLEBRACKET",hr="FULLWIDTHLEFTPAREN",mr="FULLWIDTHRIGHTPAREN",gr="LEFTCORNERBRACKET",br="RIGHTCORNERBRACKET",yr="LEFTWHITECORNERBRACKET",wr="RIGHTWHITECORNERBRACKET",vr="FULLWIDTHLESSTHAN",xr="FULLWIDTHGREATERTHAN",Sr="AMPERSAND",Cr="APOSTROPHE",Tr="ASTERISK",et="AT",kr="BACKSLASH",Er="BACKTICK",Mr="CARET",tt="COLON",no="COMMA",Ar="DOLLAR",ze="DOT",Pr="EQUALS",ro="EXCLAMATION",je="HYPHEN",Or="PERCENT",Rr="PIPE",Nr="PLUS",Ir="POUND",Lr="QUERY",io="QUOTE",so="SEMI",De="SLASH",en="TILDE",_r="UNDERSCORE",Yc="EMOJI",zr="SYM";var Xc=Object.freeze({__proto__:null,WORD:Ke,UWORD:bs,LOCALHOST:an,TLD:ys,UTLD:ws,SCHEME:Gn,SLASH_SCHEME:Rt,NUM:eo,WS:Jc,NL:to,OPENBRACE:Qt,CLOSEBRACE:Zt,OPENBRACKET:ar,CLOSEBRACKET:cr,OPENPAREN:ur,CLOSEPAREN:dr,OPENANGLEBRACKET:fr,CLOSEANGLEBRACKET:pr,FULLWIDTHLEFTPAREN:hr,FULLWIDTHRIGHTPAREN:mr,LEFTCORNERBRACKET:gr,RIGHTCORNERBRACKET:br,LEFTWHITECORNERBRACKET:yr,RIGHTWHITECORNERBRACKET:wr,FULLWIDTHLESSTHAN:vr,FULLWIDTHGREATERTHAN:xr,AMPERSAND:Sr,APOSTROPHE:Cr,ASTERISK:Tr,AT:et,BACKSLASH:kr,BACKTICK:Er,CARET:Mr,COLON:tt,COMMA:no,DOLLAR:Ar,DOT:ze,EQUALS:Pr,EXCLAMATION:ro,HYPHEN:je,PERCENT:Or,PIPE:Rr,PLUS:Nr,POUND:Ir,QUERY:Lr,QUOTE:io,SEMI:so,SLASH:De,TILDE:en,UNDERSCORE:_r,EMOJI:Yc,SYM:zr});const At=/[a-z]/,Fi=new RegExp("\\p{L}","u"),Vi=new RegExp("\\p{Emoji}","u"),Wi=/\d/,Hl=/\s/,Fl=`
|
|
110
|
+
`,uy="️",dy="";let _n=null,zn=null;function fy(n){n===void 0&&(n=[]);const e={};he.groups=e;const t=new he;_n==null&&(_n=Vl(iy)),zn==null&&(zn=Vl(sy)),A(t,"'",Cr),A(t,"{",Qt),A(t,"}",Zt),A(t,"[",ar),A(t,"]",cr),A(t,"(",ur),A(t,")",dr),A(t,"<",fr),A(t,">",pr),A(t,"(",hr),A(t,")",mr),A(t,"「",gr),A(t,"」",br),A(t,"『",yr),A(t,"』",wr),A(t,"<",vr),A(t,">",xr),A(t,"&",Sr),A(t,"*",Tr),A(t,"@",et),A(t,"`",Er),A(t,"^",Mr),A(t,":",tt),A(t,",",no),A(t,"$",Ar),A(t,".",ze),A(t,"=",Pr),A(t,"!",ro),A(t,"-",je),A(t,"%",Or),A(t,"|",Rr),A(t,"+",Nr),A(t,"#",Ir),A(t,"?",Lr),A(t,'"',io),A(t,"/",De),A(t,";",so),A(t,"~",en),A(t,"_",_r),A(t,"\\",kr);const r=Ce(t,Wi,eo,{[ps]:!0});Ce(r,Wi,r);const i=Ce(t,At,Ke,{[hs]:!0});Ce(i,At,i);const s=Ce(t,Fi,bs,{[ms]:!0});Ce(s,At),Ce(s,Fi,s);const o=Ce(t,Hl,Jc,{[Bl]:!0});A(t,Fl,to,{[Bl]:!0}),A(o,Fl),Ce(o,Hl,o);const l=Ce(t,Vi,Yc,{[Kc]:!0});Ce(l,Vi,l),A(l,uy,l);const a=A(l,dy);Ce(a,Vi,l);const c=[[At,i]],u=[[At,null],[Fi,s]];for(let d=0;d<_n.length;d++)Qe(t,_n[d],ys,Ke,c);for(let d=0;d<zn.length;d++)Qe(t,zn[d],ws,bs,u);gt(ys,{tld:!0,ascii:!0},e),gt(ws,{utld:!0,alpha:!0},e),Qe(t,"file",Gn,Ke,c),Qe(t,"mailto",Gn,Ke,c),Qe(t,"http",Rt,Ke,c),Qe(t,"https",Rt,Ke,c),Qe(t,"ftp",Rt,Ke,c),Qe(t,"ftps",Rt,Ke,c),gt(Gn,{scheme:!0,ascii:!0},e),gt(Rt,{slashscheme:!0,ascii:!0},e),n=n.sort((d,f)=>d[0]>f[0]?1:-1);for(let d=0;d<n.length;d++){const f=n[d][0],h=n[d][1]?{[oy]:!0}:{[ly]:!0};f.indexOf("-")>=0?h[gs]=!0:At.test(f)?Wi.test(f)?h[qn]=!0:h[hs]=!0:h[ps]=!0,$l(t,f,f,h)}return $l(t,"localhost",an,{ascii:!0}),t.jd=new he(zr),{start:t,tokens:Ht({groups:e},Xc)}}function py(n,e){const t=hy(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,i=[];let s=0,o=0;for(;o<r;){let l=n,a=null,c=0,u=null,d=-1,f=-1;for(;o<r&&(a=l.go(t[o]));)l=a,l.accepts()?(d=0,f=0,u=l):d>=0&&(d+=t[o].length,f++),c+=t[o].length,s+=t[o].length,o++;s-=d,o-=f,c-=d,i.push({t:u.t,v:e.slice(s-c,s),s:s-c,e:s})}return i}function hy(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),s,o=i<55296||i>56319||r+1===t||(s=n.charCodeAt(r+1))<56320||s>57343?n[r]:n.slice(r,r+2);e.push(o),r+=o.length}return e}function Qe(n,e,t,r,i){let s;const o=e.length;for(let l=0;l<o-1;l++){const a=e[l];n.j[a]?s=n.j[a]:(s=new he(r),s.jr=i.slice(),n.j[a]=s),n=s}return s=new he(t),s.jr=i.slice(),n.j[e[o-1]]=s,s}function Vl(n){const e=[],t=[];let r=0,i="0123456789";for(;r<n.length;){let s=0;for(;i.indexOf(n[r+s])>=0;)s++;if(s>0){e.push(t.join(""));for(let o=parseInt(n.substring(r,r+s),10);o>0;o--)t.pop();r+=s}else t.push(n[r]),r++}return e}const cn={defaultProtocol:"http",events:null,format:Wl,formatHref:Wl,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function oo(n,e){e===void 0&&(e=null);let t=Ht({},cn);n&&(t=Ht(t,n instanceof oo?n.o:n));const r=t.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}oo.prototype={o:cn,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let i=this.o[n];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:cn[n],typeof i=="function"&&r&&(i=i(e,t))):typeof i=="function"&&r&&(i=i(e,t.t,t)),i)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function Wl(n){return n}function Qc(n,e){this.t="token",this.v=n,this.tk=e}Qc.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n){return n===void 0&&(n=cn.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),s=this.toFormattedString(n),o={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return o.href=r,l&&(o.class=l),a&&(o.target=a),c&&(o.rel=c),u&&Ht(o,u),{tagName:i,attributes:o,content:s,eventListeners:d}}};function Ur(n,e){class t extends Qc{constructor(i,s){super(i,s),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const ql=Ur("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Gl=Ur("text"),my=Ur("nl"),jn=Ur("url",{isLink:!0,toHref(n){return n===void 0&&(n=cn.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==an&&n[1].t===tt}}),Te=n=>new he(n);function gy(n){let{groups:e}=n;const t=e.domain.concat([Sr,Tr,et,kr,Er,Mr,Ar,Pr,je,eo,Or,Rr,Nr,Ir,De,zr,en,_r]),r=[Cr,tt,no,ze,ro,Lr,io,so,fr,pr,Qt,Zt,cr,ar,ur,dr,hr,mr,gr,br,yr,wr,vr,xr],i=[Sr,Cr,Tr,kr,Er,Mr,Ar,Pr,je,Qt,Zt,Or,Rr,Nr,Ir,Lr,De,zr,en,_r],s=Te(),o=A(s,en);B(o,i,o),B(o,e.domain,o);const l=Te(),a=Te(),c=Te();B(s,e.domain,l),B(s,e.scheme,a),B(s,e.slashscheme,c),B(l,i,o),B(l,e.domain,l);const u=A(l,et);A(o,et,u),A(a,et,u),A(c,et,u);const d=A(o,ze);B(d,i,o),B(d,e.domain,o);const f=Te();B(u,e.domain,f),B(f,e.domain,f);const p=A(f,ze);B(p,e.domain,f);const h=Te(ql);B(p,e.tld,h),B(p,e.utld,h),A(u,an,h);const m=A(f,je);B(m,e.domain,f),B(h,e.domain,f),A(h,ze,p),A(h,je,m);const b=A(h,tt);B(b,e.numeric,ql);const g=A(l,je),S=A(l,ze);B(g,e.domain,l),B(S,i,o),B(S,e.domain,l);const w=Te(jn);B(S,e.tld,w),B(S,e.utld,w),B(w,e.domain,l),B(w,i,o),A(w,ze,S),A(w,je,g),A(w,et,u);const v=A(w,tt),x=Te(jn);B(v,e.numeric,x);const C=Te(jn),O=Te();B(C,t,C),B(C,r,O),B(O,t,C),B(O,r,O),A(w,De,C),A(x,De,C);const k=A(a,tt),N=A(c,tt),M=A(N,De),I=A(M,De);B(a,e.domain,l),A(a,ze,S),A(a,je,g),B(c,e.domain,l),A(c,ze,S),A(c,je,g),B(k,e.domain,C),A(k,De,C),B(I,e.domain,C),B(I,t,C),A(I,De,C);const _=[[Qt,Zt],[ar,cr],[ur,dr],[fr,pr],[hr,mr],[gr,br],[yr,wr],[vr,xr]];for(let L=0;L<_.length;L++){const[$,V]=_[L],ee=A(C,$);A(O,$,ee),A(ee,V,C);const me=Te(jn);B(ee,t,me);const de=Te();B(ee,r),B(me,t,me),B(me,r,de),B(de,t,me),B(de,r,de),A(me,V,C),A(de,V,C)}return A(s,an,w),A(s,to,my),{start:s,tokens:Xc}}function by(n,e,t){let r=t.length,i=0,s=[],o=[];for(;i<r;){let l=n,a=null,c=null,u=0,d=null,f=-1;for(;i<r&&!(a=l.go(t[i].t));)o.push(t[i++]);for(;i<r&&(c=a||l.go(t[i].t));)a=null,l=c,l.accepts()?(f=0,d=l):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(t[i]),i++);else{o.length>0&&(s.push(qi(Gl,e,o)),o=[]),i-=f,u-=f;const p=d.t,h=t.slice(i-u,i);s.push(qi(p,e,h))}}return o.length>0&&s.push(qi(Gl,e,o)),s}function qi(n,e,t){const r=t[0].s,i=t[t.length-1].e,s=e.slice(r,i);return new n(s,t)}const yy=typeof console<"u"&&console&&console.warn||(()=>{}),wy="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",K={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function vy(){he.groups={},K.scanner=null,K.parser=null,K.tokenQueue=[],K.pluginQueue=[],K.customSchemes=[],K.initialized=!1}function Ul(n,e){if(e===void 0&&(e=!1),K.initialized&&yy(`linkifyjs: already initialized - will not register custom scheme "${n}" ${wy}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
|
|
111
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
112
|
+
2. Cannot start or end with "-"
|
|
113
|
+
3. "-" cannot repeat`);K.customSchemes.push([n,e])}function xy(){K.scanner=fy(K.customSchemes);for(let n=0;n<K.tokenQueue.length;n++)K.tokenQueue[n][1]({scanner:K.scanner});K.parser=gy(K.scanner.tokens);for(let n=0;n<K.pluginQueue.length;n++)K.pluginQueue[n][1]({scanner:K.scanner,parser:K.parser});K.initialized=!0}function Zc(n){return K.initialized||xy(),by(K.parser.start,n,py(K.scanner.start,n))}function eu(n,e,t){if(e===void 0&&(e=null),t===void 0&&(t=null),e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new oo(t),i=Zc(n),s=[];for(let o=0;o<i.length;o++){const l=i[o];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}function Sy(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function Cy(n){return new Ie({key:new Me("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(c=>c.docChanged)&&!t.doc.eq(r.doc),s=e.some(c=>c.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,l=nb(t.doc,[...e]);if(cb(l).forEach(({newRange:c})=>{const u=ib(r.doc,c,p=>p.isTextblock);let d,f;if(u.length>1?(d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&f){const p=f.split(" ").filter(g=>g!=="");if(p.length<=0)return!1;const h=p[p.length-1],m=d.pos+f.lastIndexOf(h);if(!h)return!1;const b=Zc(h).map(g=>g.toObject());if(!Sy(b))return!1;b.filter(g=>g.isLink).map(g=>({...g,from:m+g.start+1,to:m+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>n.validate?n.validate(g.value):!0).forEach(g=>{Zs(g.from,g.to,r.doc).some(S=>S.mark.type===n.type)||o.addMark(g.from,g.to,n.type.create({href:g.href}))})}}),!!o.steps.length)return o}})}function Ty(n){return new Ie({key:new Me("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,s;if(n.whenNotEditable&&e.editable||r.button!==0)return!1;let o=r.target;const l=[];for(;o.nodeName!=="DIV";)l.push(o),o=o.parentNode;if(!l.find(f=>f.nodeName==="A"))return!1;const a=ob(e.state,n.type.name),c=r.target,u=(i=c==null?void 0:c.href)!==null&&i!==void 0?i:a.href,d=(s=c==null?void 0:c.target)!==null&&s!==void 0?s:a.target;return c&&u?(window.open(u,d),!0):!1}}})}function ky(n){return new Ie({key:new Me("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:s}=i,{empty:o}=s;if(o)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const a=eu(l).find(c=>c.isLink&&c.value===l);return!l||!a?!1:(n.editor.commands.setMark(n.type,{href:a.href}),!0)}}})}const Ey=Ne.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){Ul(n);return}Ul(n.scheme,n.optionalSlashes)})},onDestroy(){vy()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:n}){var e;return!((e=n.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",U(this.options.HTMLAttributes,{...n,href:""}),0]:["a",U(this.options.HTMLAttributes,n),0]},addCommands(){return{setLink:n=>({chain:e})=>e().setMark(this.name,n).setMeta("preventAutolink",!0).run(),toggleLink:n=>({chain:e})=>e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[vt({find:n=>{const e=[];if(n){const t=eu(n).filter(r=>r.isLink);t.length&&t.forEach(r=>e.push({text:r.value,data:{href:r.href},index:r.start}))}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(Cy({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(Ty({type:this.type,whenNotEditable:this.options.openOnClick==="whenNotEditable"})),this.options.linkOnPaste&&n.push(ky({editor:this.editor,type:this.type})),n}}),My=X.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",U(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ay=X.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",U(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Kl=Ne.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",U(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=Gr(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Jl=/^(\d+)\.\s$/,Py=X.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",U(this.options.HTMLAttributes,t),0]:["ol",U(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Ay.name,this.editor.getAttributes(Kl.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=ln({find:Jl,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=ln({find:Jl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Kl.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),Oy=X.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",U(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Ry=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Ny=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Iy=Ne.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",U(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[$t({find:Ry,type:this.type})]},addPasteRules(){return[vt({find:Ny,type:this.type})]}});var vs,xs;if(typeof WeakMap<"u"){let n=new WeakMap;vs=e=>n.get(e),xs=(e,t)=>(n.set(e,t),t)}else{const n=[];let t=0;vs=r=>{for(let i=0;i<n.length;i+=2)if(n[i]==r)return n[i+1]},xs=(r,i)=>(t==10&&(t=0),n[t++]=r,n[t++]=i)}var J=class{constructor(n,e,t,r){this.width=n,this.height=e,this.map=t,this.problems=r}findCell(n){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=n)continue;const r=e%this.width,i=e/this.width|0;let s=r+1,o=i+1;for(let l=1;s<this.width&&this.map[e+l]==t;l++)s++;for(let l=1;o<this.height&&this.map[e+this.width*l]==t;l++)o++;return{left:r,top:i,right:s,bottom:o}}throw new RangeError(`No cell with offset ${n} found`)}colCount(n){for(let e=0;e<this.map.length;e++)if(this.map[e]==n)return e%this.width;throw new RangeError(`No cell with offset ${n} found`)}nextCell(n,e,t){const{left:r,right:i,top:s,bottom:o}=this.findCell(n);return e=="horiz"?(t<0?r==0:i==this.width)?null:this.map[s*this.width+(t<0?r-1:i)]:(t<0?s==0:o==this.height)?null:this.map[r+this.width*(t<0?s-1:o)]}rectBetween(n,e){const{left:t,right:r,top:i,bottom:s}=this.findCell(n),{left:o,right:l,top:a,bottom:c}=this.findCell(e);return{left:Math.min(t,o),top:Math.min(i,a),right:Math.max(r,l),bottom:Math.max(s,c)}}cellsInRect(n){const e=[],t={};for(let r=n.top;r<n.bottom;r++)for(let i=n.left;i<n.right;i++){const s=r*this.width+i,o=this.map[s];t[o]||(t[o]=!0,!(i==n.left&&i&&this.map[s-1]==o||r==n.top&&r&&this.map[s-this.width]==o)&&e.push(o))}return e}positionAt(n,e,t){for(let r=0,i=0;;r++){const s=i+t.child(r).nodeSize;if(r==n){let o=e+n*this.width;const l=(n+1)*this.width;for(;o<l&&this.map[o]<i;)o++;return o==l?s-1:this.map[o]}i=s}}static get(n){return vs(n)||xs(n,Ly(n))}};function Ly(n){if(n.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+n.type.name);const e=_y(n),t=n.childCount,r=[];let i=0,s=null;const o=[];for(let c=0,u=e*t;c<u;c++)r[c]=0;for(let c=0,u=0;c<t;c++){const d=n.child(c);u++;for(let h=0;;h++){for(;i<r.length&&r[i]!=0;)i++;if(h==d.childCount)break;const m=d.child(h),{colspan:b,rowspan:g,colwidth:S}=m.attrs;for(let w=0;w<g;w++){if(w+c>=t){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:g-w});break}const v=i+w*e;for(let x=0;x<b;x++){r[v+x]==0?r[v+x]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:b-x});const C=S&&S[x];if(C){const O=(v+x)%e*2,k=o[O];k==null||k!=C&&o[O+1]==1?(o[O]=C,o[O+1]=1):k==C&&o[O+1]++}}}i+=b,u+=m.nodeSize}const f=(c+1)*e;let p=0;for(;i<f;)r[i++]==0&&p++;p&&(s||(s=[])).push({type:"missing",row:c,n:p}),u++}const l=new J(e,t,r,s);let a=!1;for(let c=0;!a&&c<o.length;c+=2)o[c]!=null&&o[c+1]<t&&(a=!0);return a&&zy(l,o,n),l}function _y(n){let e=-1,t=!1;for(let r=0;r<n.childCount;r++){const i=n.child(r);let s=0;if(t)for(let o=0;o<r;o++){const l=n.child(o);for(let a=0;a<l.childCount;a++){const c=l.child(a);o+c.attrs.rowspan>r&&(s+=c.attrs.colspan)}}for(let o=0;o<i.childCount;o++){const l=i.child(o);s+=l.attrs.colspan,l.attrs.rowspan>1&&(t=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function zy(n,e,t){n.problems||(n.problems=[]);const r={};for(let i=0;i<n.map.length;i++){const s=n.map[i];if(r[s])continue;r[s]=!0;const o=t.nodeAt(s);if(!o)throw new RangeError(`No cell with offset ${s} found`);let l=null;const a=o.attrs;for(let c=0;c<a.colspan;c++){const u=(i+c)%n.width,d=e[u*2];d!=null&&(!a.colwidth||a.colwidth[c]!=d)&&((l||(l=jy(a)))[c]=d)}l&&n.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function jy(n){if(n.colwidth)return n.colwidth.slice();const e=[];for(let t=0;t<n.colspan;t++)e.push(0);return e}function ce(n){let e=n.cached.tableNodeTypes;if(!e){e=n.cached.tableNodeTypes={};for(const t in n.nodes){const r=n.nodes[t],i=r.spec.tableRole;i&&(e[i]=r)}}return e}var nt=new Me("selectingCells");function Wt(n){for(let e=n.depth-1;e>0;e--)if(n.node(e).type.spec.tableRole=="row")return n.node(0).resolve(n.before(e+1));return null}function Dy(n){for(let e=n.depth;e>0;e--){const t=n.node(e).type.spec.tableRole;if(t==="cell"||t==="header_cell")return n.node(e)}return null}function _e(n){const e=n.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function Kr(n){const e=n.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const t=Wt(e.$head)||By(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function By(n){for(let e=n.nodeAfter,t=n.pos;e;e=e.firstChild,t++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return n.doc.resolve(t)}for(let e=n.nodeBefore,t=n.pos;e;e=e.lastChild,t--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return n.doc.resolve(t-e.nodeSize)}}function Ss(n){return n.parent.type.spec.tableRole=="row"&&!!n.nodeAfter}function $y(n){return n.node(0).resolve(n.pos+n.nodeAfter.nodeSize)}function lo(n,e){return n.depth==e.depth&&n.pos>=e.start(-1)&&n.pos<=e.end(-1)}function tu(n,e,t){const r=n.node(-1),i=J.get(r),s=n.start(-1),o=i.nextCell(n.pos-s,e,t);return o==null?null:n.node(0).resolve(s+o)}function xt(n,e,t=1){const r={...n,colspan:n.colspan-t};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,t),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function nu(n,e,t=1){const r={...n,colspan:n.colspan+t};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<t;i++)r.colwidth.splice(e,0,0)}return r}function Hy(n,e,t){const r=ce(e.type.schema).header_cell;for(let i=0;i<n.height;i++)if(e.nodeAt(n.map[t+i*n.width]).type!=r)return!1;return!0}var q=class Je extends D{constructor(e,t=e){const r=e.node(-1),i=J.get(r),s=e.start(-1),o=i.rectBetween(e.pos-s,t.pos-s),l=e.node(0),a=i.cellsInRect(o).filter(u=>u!=t.pos-s);a.unshift(t.pos-s);const c=a.map(u=>{const d=r.nodeAt(u);if(!d)throw RangeError(`No cell with offset ${u} found`);const f=s+u+1;return new sc(l.resolve(f),l.resolve(f+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(e,t){const r=e.resolve(t.map(this.$anchorCell.pos)),i=e.resolve(t.map(this.$headCell.pos));if(Ss(r)&&Ss(i)&&lo(r,i)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?Je.rowSelection(r,i):s&&this.isColSelection()?Je.colSelection(r,i):new Je(r,i)}return j.between(r,i)}content(){const e=this.$anchorCell.node(-1),t=J.get(e),r=this.$anchorCell.start(-1),i=t.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},o=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*t.width+i.left,d=i.left;d<i.right;d++,u++){const f=t.map[u];if(s[f])continue;s[f]=!0;const p=t.findCell(f);let h=e.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);const m=i.left-p.left,b=p.right-i.right;if(m>0||b>0){let g=h.attrs;if(m>0&&(g=xt(g,0,m)),b>0&&(g=xt(g,g.colspan-b,b)),p.left<i.left){if(h=h.type.createAndFill(g),!h)throw RangeError(`Could not create cell with attrs ${JSON.stringify(g)}`)}else h=h.type.create(g,h.content)}if(p.top<i.top||p.bottom>i.bottom){const g={...h.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};p.top<i.top?h=h.type.createAndFill(g):h=h.type.create(g,h.content)}c.push(h)}o.push(e.child(a).copy(E.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:o;return new R(E.from(l),1,1)}replace(e,t=R.empty){const r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){const{$from:l,$to:a}=i[o],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(a.pos),o?R.empty:t)}const s=D.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,t){this.replace(e,new R(E.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),r=J.get(t),i=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<s.length;o++)e(t.nodeAt(s[o]),i+s[o])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const r=e.node(-1),i=J.get(r),s=e.start(-1),o=i.findCell(e.pos-s),l=i.findCell(t.pos-s),a=e.node(0);return o.top<=l.top?(o.top>0&&(e=a.resolve(s+i.map[o.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))):(l.top>0&&(t=a.resolve(s+i.map[l.left])),o.bottom<i.height&&(e=a.resolve(s+i.map[i.width*(i.height-1)+o.right-1]))),new Je(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=J.get(e),r=this.$anchorCell.start(-1),i=t.colCount(this.$anchorCell.pos-r),s=t.colCount(this.$headCell.pos-r);if(Math.min(i,s)>0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,l=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,l)==t.width}eq(e){return e instanceof Je&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const r=e.node(-1),i=J.get(r),s=e.start(-1),o=i.findCell(e.pos-s),l=i.findCell(t.pos-s),a=e.node(0);return o.left<=l.left?(o.left>0&&(e=a.resolve(s+i.map[o.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))):(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),o.right<i.width&&(e=a.resolve(s+i.map[i.width*(o.top+1)-1]))),new Je(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new Je(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){return new Je(e.resolve(t),e.resolve(r))}getBookmark(){return new Fy(this.$anchorCell.pos,this.$headCell.pos)}};q.prototype.visible=!1;D.jsonID("cell",q);var Fy=class ru{constructor(e,t){this.anchor=e,this.head=t}map(e){return new ru(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),r=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&r.index()<r.parent.childCount&&lo(t,r)?new q(t,r):D.near(r,1)}};function Vy(n){if(!(n.selection instanceof q))return null;const e=[];return n.selection.forEachCell((t,r)=>{e.push(Pe.node(r,r+t.nodeSize,{class:"selectedCell"}))}),Q.create(n.doc,e)}function Wy({$from:n,$to:e}){if(n.pos==e.pos||n.pos<n.pos-6)return!1;let t=n.pos,r=e.pos,i=n.depth;for(;i>=0&&!(n.after(i+1)<n.end(i));i--,t++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return t==r&&/row|table/.test(n.node(i).type.spec.tableRole)}function qy({$from:n,$to:e}){let t,r;for(let i=n.depth;i>0;i--){const s=n.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){t=s;break}}for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return t!==r&&e.parentOffset===0}function Gy(n,e,t){const r=(e||n).selection,i=(e||n).doc;let s,o;if(r instanceof z&&(o=r.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")s=q.create(i,r.from);else if(o=="row"){const l=i.resolve(r.from+1);s=q.rowSelection(l,l)}else if(!t){const l=J.get(r.node),a=r.from+1,c=a+l.map[l.width*l.height-1];s=q.create(i,a+1,c)}}else r instanceof j&&Wy(r)?s=j.create(i,r.from):r instanceof j&&qy(r)&&(s=j.create(i,r.$from.start(),r.$from.end()));return s&&(e||(e=n.tr)).setSelection(s),e}var Uy=new Me("fix-tables");function iu(n,e,t,r){const i=n.childCount,s=e.childCount;e:for(let o=0,l=0;o<s;o++){const a=e.child(o);for(let c=l,u=Math.min(i,o+3);c<u;c++)if(n.child(c)==a){l=c+1,t+=a.nodeSize;continue e}r(a,t),l<i&&n.child(l).sameMarkup(a)?iu(n.child(l),a,t+1,r):a.nodesBetween(0,a.content.size,r,t+1),t+=a.nodeSize}}function su(n,e){let t;const r=(i,s)=>{i.type.spec.tableRole=="table"&&(t=Ky(n,i,s,t))};return e?e.doc!=n.doc&&iu(e.doc,n.doc,0,r):n.doc.descendants(r),t}function Ky(n,e,t,r){const i=J.get(e);if(!i.problems)return r;r||(r=n.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let f=0;f<d.rowspan;f++)s[c.row+f]+=c.n;r.setNodeMarkup(r.mapping.map(t+1+c.pos),null,xt(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(t+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(t+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}}let o,l;for(let a=0;a<s.length;a++)s[a]&&(o==null&&(o=a),l=a);for(let a=0,c=t+1;a<i.height;a++){const u=e.child(a),d=c+u.nodeSize,f=s[a];if(f>0){let p="cell";u.firstChild&&(p=u.firstChild.type.spec.tableRole);const h=[];for(let b=0;b<f;b++){const g=ce(n.schema)[p].createAndFill();g&&h.push(g)}const m=(a==0||o==a-1)&&l==a?c+1:d-1;r.insert(r.mapping.map(m),h)}c=d}return r.setMeta(Uy,{fixTables:!0})}function Jy(n){if(!n.size)return null;let{content:e,openStart:t,openEnd:r}=n;for(;e.childCount==1&&(t>0&&r>0||e.child(0).type.spec.tableRole=="table");)t--,r--,e=e.child(0).content;const i=e.child(0),s=i.type.spec.tableRole,o=i.type.schema,l=[];if(s=="row")for(let a=0;a<e.childCount;a++){let c=e.child(a).content;const u=a?0:Math.max(0,t-1),d=a<e.childCount-1?0:Math.max(0,r-1);(u||d)&&(c=Cs(ce(o).row,new R(c,u,d)).content),l.push(c)}else if(s=="cell"||s=="header_cell")l.push(t||r?Cs(ce(o).row,new R(e,t,r)).content:e);else return null;return Yy(o,l)}function Yy(n,e){const t=[];for(let i=0;i<e.length;i++){const s=e[i];for(let o=s.childCount-1;o>=0;o--){const{rowspan:l,colspan:a}=s.child(o).attrs;for(let c=i;c<i+l;c++)t[c]=(t[c]||0)+a}}let r=0;for(let i=0;i<t.length;i++)r=Math.max(r,t[i]);for(let i=0;i<t.length;i++)if(i>=e.length&&e.push(E.empty),t[i]<r){const s=ce(n).cell.createAndFill(),o=[];for(let l=t[i];l<r;l++)o.push(s);e[i]=e[i].append(E.from(o))}return{height:e.length,width:r,rows:e}}function Cs(n,e){const t=n.createAndFill();return new ic(t).replace(0,t.content.size,e).doc}function Xy({width:n,height:e,rows:t},r,i){if(n!=r){const s=[],o=[];for(let l=0;l<t.length;l++){const a=t[l],c=[];for(let u=s[l]||0,d=0;u<r;d++){let f=a.child(d%a.childCount);u+f.attrs.colspan>r&&(f=f.type.createChecked(xt(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)s[l+p]=(s[l+p]||0)+f.attrs.colspan}o.push(E.from(c))}t=o,n=r}if(e!=i){const s=[];for(let o=0,l=0;o<i;o++,l++){const a=[],c=t[l%e];for(let u=0;u<c.childCount;u++){let d=c.child(u);o+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(E.from(a))}t=s,e=i}return{width:n,height:e,rows:t}}function Qy(n,e,t,r,i,s,o){const l=n.doc.type.schema,a=ce(l);let c,u;if(i>e.width)for(let d=0,f=0;d<e.height;d++){const p=t.child(d);f+=p.nodeSize;const h=[];let m;p.lastChild==null||p.lastChild.type==a.cell?m=c||(c=a.cell.createAndFill()):m=u||(u=a.header_cell.createAndFill());for(let b=e.width;b<i;b++)h.push(m);n.insert(n.mapping.slice(o).map(f-1+r),h)}if(s>e.height){const d=[];for(let h=0,m=(e.height-1)*e.width;h<Math.max(e.width,i);h++){const b=h>=e.width?!1:t.nodeAt(e.map[m+h]).type==a.header_cell;d.push(b?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const f=a.row.create(null,E.from(d)),p=[];for(let h=e.height;h<s;h++)p.push(f);n.insert(n.mapping.slice(o).map(r+t.nodeSize-2),p)}return!!(c||u)}function Yl(n,e,t,r,i,s,o,l){if(o==0||o==e.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=o*e.width+c,d=e.map[u];if(e.map[u-e.width]==d){a=!0;const f=t.nodeAt(d),{top:p,left:h}=e.findCell(d);n.setNodeMarkup(n.mapping.slice(l).map(d+r),null,{...f.attrs,rowspan:o-p}),n.insert(n.mapping.slice(l).map(e.positionAt(o,h,t)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-o})),c+=f.attrs.colspan-1}}return a}function Xl(n,e,t,r,i,s,o,l){if(o==0||o==e.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*e.width+o,d=e.map[u];if(e.map[u-1]==d){a=!0;const f=t.nodeAt(d),p=e.colCount(d),h=n.mapping.slice(l).map(d+r);n.setNodeMarkup(h,null,xt(f.attrs,o-p,f.attrs.colspan-(o-p))),n.insert(h+f.nodeSize,f.type.createAndFill(xt(f.attrs,0,o-p))),c+=f.attrs.rowspan-1}}return a}function Ql(n,e,t,r,i){let s=t?n.doc.nodeAt(t-1):n.doc;if(!s)throw new Error("No table found");let o=J.get(s);const{top:l,left:a}=r,c=a+i.width,u=l+i.height,d=n.tr;let f=0;function p(){if(s=t?d.doc.nodeAt(t-1):d.doc,!s)throw new Error("No table found");o=J.get(s),f=d.mapping.maps.length}Qy(d,o,s,t,c,u,f)&&p(),Yl(d,o,s,t,a,c,l,f)&&p(),Yl(d,o,s,t,a,c,u,f)&&p(),Xl(d,o,s,t,l,u,a,f)&&p(),Xl(d,o,s,t,l,u,c,f)&&p();for(let h=l;h<u;h++){const m=o.positionAt(h,a,s),b=o.positionAt(h,c,s);d.replace(d.mapping.slice(f).map(m+t),d.mapping.slice(f).map(b+t),new R(i.rows[h-l],0,0))}p(),d.setSelection(new q(d.doc.resolve(t+o.positionAt(l,a,s)),d.doc.resolve(t+o.positionAt(u-1,c-1,s)))),e(d)}var Zy=O0({ArrowLeft:Dn("horiz",-1),ArrowRight:Dn("horiz",1),ArrowUp:Dn("vert",-1),ArrowDown:Dn("vert",1),"Shift-ArrowLeft":Bn("horiz",-1),"Shift-ArrowRight":Bn("horiz",1),"Shift-ArrowUp":Bn("vert",-1),"Shift-ArrowDown":Bn("vert",1),Backspace:$n,"Mod-Backspace":$n,Delete:$n,"Mod-Delete":$n});function Un(n,e,t){return t.eq(n.selection)?!1:(e&&e(n.tr.setSelection(t).scrollIntoView()),!0)}function Dn(n,e){return(t,r,i)=>{if(!i)return!1;const s=t.selection;if(s instanceof q)return Un(t,r,D.near(s.$headCell,e));if(n!="horiz"&&!s.empty)return!1;const o=ou(i,n,e);if(o==null)return!1;if(n=="horiz")return Un(t,r,D.near(t.doc.resolve(s.head+e),e));{const l=t.doc.resolve(o),a=tu(l,n,e);let c;return a?c=D.near(a,1):e<0?c=D.near(t.doc.resolve(l.before(-1)),-1):c=D.near(t.doc.resolve(l.after(-1)),1),Un(t,r,c)}}}function Bn(n,e){return(t,r,i)=>{if(!i)return!1;const s=t.selection;let o;if(s instanceof q)o=s;else{const a=ou(i,n,e);if(a==null)return!1;o=new q(t.doc.resolve(a))}const l=tu(o.$headCell,n,e);return l?Un(t,r,new q(o.$anchorCell,l)):!1}}function $n(n,e){const t=n.selection;if(!(t instanceof q))return!1;if(e){const r=n.tr,i=ce(n.schema).cell.createAndFill().content;t.forEachCell((s,o)=>{s.content.eq(i)||r.replace(r.mapping.map(o+1),r.mapping.map(o+s.nodeSize-1),new R(i,0,0))}),r.docChanged&&e(r)}return!0}function ew(n,e){const t=n.state.doc,r=Wt(t.resolve(e));return r?(n.dispatch(n.state.tr.setSelection(new q(r))),!0):!1}function tw(n,e,t){if(!_e(n.state))return!1;let r=Jy(t);const i=n.state.selection;if(i instanceof q){r||(r={width:1,height:1,rows:[E.from(Cs(ce(n.state.schema).cell,t))]});const s=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),l=J.get(s).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=Xy(r,l.right-l.left,l.bottom-l.top),Ql(n.state,n.dispatch,o,l,r),!0}else if(r){const s=Kr(n.state),o=s.start(-1);return Ql(n.state,n.dispatch,o,J.get(s.node(-1)).findCell(s.pos-o),r),!0}else return!1}function nw(n,e){var t;if(e.ctrlKey||e.metaKey)return;const r=Zl(n,e.target);let i;if(e.shiftKey&&n.state.selection instanceof q)s(n.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Wt(n.state.selection.$anchor))!=null&&((t=Gi(n,e))==null?void 0:t.pos)!=i.pos)s(i,e),e.preventDefault();else if(!r)return;function s(a,c){let u=Gi(n,c);const d=nt.getState(n.state)==null;if(!u||!lo(a,u))if(d)u=a;else return;const f=new q(a,u);if(d||!n.state.selection.eq(f)){const p=n.state.tr.setSelection(f);d&&p.setMeta(nt,a.pos),n.dispatch(p)}}function o(){n.root.removeEventListener("mouseup",o),n.root.removeEventListener("dragstart",o),n.root.removeEventListener("mousemove",l),nt.getState(n.state)!=null&&n.dispatch(n.state.tr.setMeta(nt,-1))}function l(a){const c=a,u=nt.getState(n.state);let d;if(u!=null)d=n.state.doc.resolve(u);else if(Zl(n,c.target)!=r&&(d=Gi(n,e),!d))return o();d&&s(d,c)}n.root.addEventListener("mouseup",o),n.root.addEventListener("dragstart",o),n.root.addEventListener("mousemove",l)}function ou(n,e,t){if(!(n.state.selection instanceof j))return null;const{$head:r}=n.state.selection;for(let i=r.depth-1;i>=0;i--){const s=r.node(i);if((t<0?r.index(i):r.indexAfter(i))!=(t<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=r.before(i),a=e=="vert"?t>0?"down":"up":t>0?"right":"left";return n.endOfTextblock(a)?l:null}}return null}function Zl(n,e){for(;e&&e!=n.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Gi(n,e){const t=n.posAtCoords({left:e.clientX,top:e.clientY});return t&&t?Wt(n.state.doc.resolve(t.pos)):null}var rw=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ts(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,Ts(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Ts(n,e,t,r,i,s){var o;let l=0,a=!0,c=e.firstChild;const u=n.firstChild;if(u){for(let d=0,f=0;d<u.childCount;d++){const{colspan:p,colwidth:h}=u.child(d).attrs;for(let m=0;m<p;m++,f++){const b=i==f?s:h&&h[m],g=b?b+"px":"";l+=b||r,b||(a=!1),c?(c.style.width!=g&&(c.style.width=g),c=c.nextSibling):e.appendChild(document.createElement("col")).style.width=g}}for(;c;){const d=c.nextSibling;(o=c.parentNode)==null||o.removeChild(c),c=d}a?(t.style.width=l+"px",t.style.minWidth=""):(t.style.width="",t.style.minWidth=l+"px")}}var Ee=new Me("tableColumnResizing");function iw({handleWidth:n=5,cellMinWidth:e=25,View:t=rw,lastColumnResizable:r=!0}={}){const i=new Ie({key:Ee,state:{init(s,o){return i.spec.props.nodeViews[ce(o.schema).table.name]=(l,a)=>new t(l,e,a),new sw(-1,!1)},apply(s,o){return o.apply(s)}},props:{attributes:s=>{const o=Ee.getState(s);return o&&o.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,o)=>{ow(s,o,n,e,r)},mouseleave:s=>{lw(s)},mousedown:(s,o)=>{aw(s,o,e)}},decorations:s=>{const o=Ee.getState(s);if(o&&o.activeHandle>-1)return hw(s,o.activeHandle)},nodeViews:{}}});return i}var sw=class Kn{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){const t=this,r=e.getMeta(Ee);if(r&&r.setHandle!=null)return new Kn(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Kn(t.activeHandle,r.setDragging);if(t.activeHandle>-1&&e.docChanged){let i=e.mapping.map(t.activeHandle,-1);return Ss(e.doc.resolve(i))||(i=-1),new Kn(i,t.dragging)}return t}};function ow(n,e,t,r,i){const s=Ee.getState(n.state);if(s&&!s.dragging){const o=uw(e.target);let l=-1;if(o){const{left:a,right:c}=o.getBoundingClientRect();e.clientX-a<=t?l=ea(n,e,"left",t):c-e.clientX<=t&&(l=ea(n,e,"right",t))}if(l!=s.activeHandle){if(!i&&l!==-1){const a=n.state.doc.resolve(l),c=a.node(-1),u=J.get(c),d=a.start(-1);if(u.colCount(a.pos-d)+a.nodeAfter.attrs.colspan-1==u.width-1)return}lu(n,l)}}}function lw(n){const e=Ee.getState(n.state);e&&e.activeHandle>-1&&!e.dragging&&lu(n,-1)}function aw(n,e,t){var r;const i=(r=n.dom.ownerDocument.defaultView)!=null?r:window,s=Ee.getState(n.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const o=n.state.doc.nodeAt(s.activeHandle),l=cw(n,s.activeHandle,o.attrs);n.dispatch(n.state.tr.setMeta(Ee,{setDragging:{startX:e.clientX,startWidth:l}}));function a(u){i.removeEventListener("mouseup",a),i.removeEventListener("mousemove",c);const d=Ee.getState(n.state);d!=null&&d.dragging&&(dw(n,d.activeHandle,ta(d.dragging,u,t)),n.dispatch(n.state.tr.setMeta(Ee,{setDragging:null})))}function c(u){if(!u.which)return a(u);const d=Ee.getState(n.state);if(d&&d.dragging){const f=ta(d.dragging,u,t);fw(n,d.activeHandle,f,t)}}return i.addEventListener("mouseup",a),i.addEventListener("mousemove",c),e.preventDefault(),!0}function cw(n,e,{colspan:t,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const s=n.domAtPos(e);let l=s.node.childNodes[s.offset].offsetWidth,a=t;if(r)for(let c=0;c<t;c++)r[c]&&(l-=r[c],a--);return l/a}function uw(n){for(;n&&n.nodeName!="TD"&&n.nodeName!="TH";)n=n.classList&&n.classList.contains("ProseMirror")?null:n.parentNode;return n}function ea(n,e,t,r){const i=t=="right"?-r:r,s=n.posAtCoords({left:e.clientX+i,top:e.clientY});if(!s)return-1;const{pos:o}=s,l=Wt(n.state.doc.resolve(o));if(!l)return-1;if(t=="right")return l.pos;const a=J.get(l.node(-1)),c=l.start(-1),u=a.map.indexOf(l.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function ta(n,e,t){const r=e.clientX-n.startX;return Math.max(t,n.startWidth+r)}function lu(n,e){n.dispatch(n.state.tr.setMeta(Ee,{setHandle:e}))}function dw(n,e,t){const r=n.state.doc.resolve(e),i=r.node(-1),s=J.get(i),o=r.start(-1),l=s.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,a=n.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+l;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],f=i.nodeAt(d).attrs,p=f.colspan==1?0:l-s.colCount(d);if(f.colwidth&&f.colwidth[p]==t)continue;const h=f.colwidth?f.colwidth.slice():pw(f.colspan);h[p]=t,a.setNodeMarkup(o+d,null,{...f,colwidth:h})}a.docChanged&&n.dispatch(a)}function fw(n,e,t,r){const i=n.state.doc.resolve(e),s=i.node(-1),o=i.start(-1),l=J.get(s).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1;let a=n.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&Ts(s,a.firstChild,a,r,l,t)}function pw(n){return Array(n).fill(0)}function hw(n,e){const t=[],r=n.doc.resolve(e),i=r.node(-1);if(!i)return Q.empty;const s=J.get(i),o=r.start(-1),l=s.colCount(r.pos-o)+r.nodeAfter.attrs.colspan;for(let a=0;a<s.height;a++){const c=l+a*s.width-1;if((l==s.width||s.map[c]!=s.map[c+1])&&(a==0||s.map[c]!=s.map[c-s.width])){const u=s.map[c],d=o+u+i.nodeAt(u).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",t.push(Pe.widget(d,f))}}return Q.create(n.doc,t)}function Fe(n){const e=n.selection,t=Kr(n),r=t.node(-1),i=t.start(-1),s=J.get(r);return{...e instanceof q?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(t.pos-i),tableStart:i,map:s,table:r}}function au(n,{map:e,tableStart:t,table:r},i){let s=i>0?-1:0;Hy(e,r,i+s)&&(s=i==0||i==e.width?null:0);for(let o=0;o<e.height;o++){const l=o*e.width+i;if(i>0&&i<e.width&&e.map[l-1]==e.map[l]){const a=e.map[l],c=r.nodeAt(a);n.setNodeMarkup(n.mapping.map(t+a),null,nu(c.attrs,i-e.colCount(a))),o+=c.attrs.rowspan-1}else{const a=s==null?ce(r.type.schema).cell:r.nodeAt(e.map[l+s]).type,c=e.positionAt(o,i,r);n.insert(n.mapping.map(t+c),a.createAndFill())}}return n}function mw(n,e){if(!_e(n))return!1;if(e){const t=Fe(n);e(au(n.tr,t,t.left))}return!0}function gw(n,e){if(!_e(n))return!1;if(e){const t=Fe(n);e(au(n.tr,t,t.right))}return!0}function bw(n,{map:e,table:t,tableStart:r},i){const s=n.mapping.maps.length;for(let o=0;o<e.height;){const l=o*e.width+i,a=e.map[l],c=t.nodeAt(a),u=c.attrs;if(i>0&&e.map[l-1]==a||i<e.width-1&&e.map[l+1]==a)n.setNodeMarkup(n.mapping.slice(s).map(r+a),null,xt(u,i-e.colCount(a)));else{const d=n.mapping.slice(s).map(r+a);n.delete(d,d+c.nodeSize)}o+=u.rowspan}}function yw(n,e){if(!_e(n))return!1;if(e){const t=Fe(n),r=n.tr;if(t.left==0&&t.right==t.map.width)return!1;for(let i=t.right-1;bw(r,t,i),i!=t.left;i--){const s=t.tableStart?r.doc.nodeAt(t.tableStart-1):r.doc;if(!s)throw RangeError("No table found");t.table=s,t.map=J.get(s)}e(r)}return!0}function ww(n,e,t){var r;const i=ce(e.type.schema).header_cell;for(let s=0;s<n.width;s++)if(((r=e.nodeAt(n.map[s+t*n.width]))==null?void 0:r.type)!=i)return!1;return!0}function cu(n,{map:e,tableStart:t,table:r},i){var s;let o=t;for(let c=0;c<i;c++)o+=r.child(c).nodeSize;const l=[];let a=i>0?-1:0;ww(e,r,i+a)&&(a=i==0||i==e.height?null:0);for(let c=0,u=e.width*i;c<e.width;c++,u++)if(i>0&&i<e.height&&e.map[u]==e.map[u-e.width]){const d=e.map[u],f=r.nodeAt(d).attrs;n.setNodeMarkup(t+d,null,{...f,rowspan:f.rowspan+1}),c+=f.colspan-1}else{const d=a==null?ce(r.type.schema).cell:(s=r.nodeAt(e.map[u+a*e.width]))==null?void 0:s.type,f=d==null?void 0:d.createAndFill();f&&l.push(f)}return n.insert(o,ce(r.type.schema).row.create(null,l)),n}function vw(n,e){if(!_e(n))return!1;if(e){const t=Fe(n);e(cu(n.tr,t,t.top))}return!0}function xw(n,e){if(!_e(n))return!1;if(e){const t=Fe(n);e(cu(n.tr,t,t.bottom))}return!0}function Sw(n,{map:e,table:t,tableStart:r},i){let s=0;for(let c=0;c<i;c++)s+=t.child(c).nodeSize;const o=s+t.child(i).nodeSize,l=n.mapping.maps.length;n.delete(s+r,o+r);const a=new Set;for(let c=0,u=i*e.width;c<e.width;c++,u++){const d=e.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==e.map[u-e.width]){const f=t.nodeAt(d).attrs;n.setNodeMarkup(n.mapping.slice(l).map(d+r),null,{...f,rowspan:f.rowspan-1}),c+=f.colspan-1}else if(i<e.height&&d==e.map[u+e.width]){const f=t.nodeAt(d),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),m=e.positionAt(i+1,c,t);n.insert(n.mapping.slice(l).map(r+m),h),c+=p.colspan-1}}}}function Cw(n,e){if(!_e(n))return!1;if(e){const t=Fe(n),r=n.tr;if(t.top==0&&t.bottom==t.map.height)return!1;for(let i=t.bottom-1;Sw(r,t,i),i!=t.top;i--){const s=t.tableStart?r.doc.nodeAt(t.tableStart-1):r.doc;if(!s)throw RangeError("No table found");t.table=s,t.map=J.get(t.table)}e(r)}return!0}function na(n){const e=n.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function Tw({width:n,height:e,map:t},r){let i=r.top*n+r.left,s=i,o=(r.bottom-1)*n+r.left,l=i+(r.right-r.left-1);for(let a=r.top;a<r.bottom;a++){if(r.left>0&&t[s]==t[s-1]||r.right<n&&t[l]==t[l+1])return!0;s+=n,l+=n}for(let a=r.left;a<r.right;a++){if(r.top>0&&t[i]==t[i-n]||r.bottom<e&&t[o]==t[o+n])return!0;i++,o++}return!1}function ra(n,e){const t=n.selection;if(!(t instanceof q)||t.$anchorCell.pos==t.$headCell.pos)return!1;const r=Fe(n),{map:i}=r;if(Tw(i,r))return!1;if(e){const s=n.tr,o={};let l=E.empty,a,c;for(let u=r.top;u<r.bottom;u++)for(let d=r.left;d<r.right;d++){const f=i.map[u*i.width+d],p=r.table.nodeAt(f);if(!(o[f]||!p))if(o[f]=!0,a==null)a=f,c=p;else{na(p)||(l=l.append(p.content));const h=s.mapping.map(f+r.tableStart);s.delete(h,h+p.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+r.tableStart,null,{...nu(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),l.size){const u=a+1+c.content.size,d=na(c)?a+1:u;s.replaceWith(d+r.tableStart,u+r.tableStart,l)}s.setSelection(new q(s.doc.resolve(a+r.tableStart))),e(s)}return!0}function ia(n,e){const t=ce(n.schema);return kw(({node:r})=>t[r.type.spec.tableRole])(n,e)}function kw(n){return(e,t)=>{var r;const i=e.selection;let s,o;if(i instanceof q){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;s=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{if(s=Dy(i.$from),!s)return!1;o=(r=Wt(i.$from))==null?void 0:r.pos}if(s==null||o==null||s.attrs.colspan==1&&s.attrs.rowspan==1)return!1;if(t){let l=s.attrs;const a=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const u=Fe(e),d=e.tr;for(let p=0;p<u.right-u.left;p++)a.push(c?{...l,colwidth:c&&c[p]?[c[p]]:null}:l);let f;for(let p=u.top;p<u.bottom;p++){let h=u.map.positionAt(p,u.left,u.table);p==u.top&&(h+=s.nodeSize);for(let m=u.left,b=0;m<u.right;m++,b++)m==u.left&&p==u.top||d.insert(f=d.mapping.map(h+u.tableStart,1),n({node:s,row:p,col:m}).createAndFill(a[b]))}d.setNodeMarkup(o,n({node:s,row:u.top,col:u.left}),a[0]),i instanceof q&&d.setSelection(new q(d.doc.resolve(i.$anchorCell.pos),f?d.doc.resolve(f):void 0)),t(d)}return!0}}function Ew(n,e){return function(t,r){if(!_e(t))return!1;const i=Kr(t);if(i.nodeAfter.attrs[n]===e)return!1;if(r){const s=t.tr;t.selection instanceof q?t.selection.forEachCell((o,l)=>{o.attrs[n]!==e&&s.setNodeMarkup(l,null,{...o.attrs,[n]:e})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[n]:e}),r(s)}return!0}}function Mw(n){return function(e,t){if(!_e(e))return!1;if(t){const r=ce(e.schema),i=Fe(e),s=e.tr,o=i.map.cellsInRect(n=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:n=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=o.map(a=>i.table.nodeAt(a));for(let a=0;a<o.length;a++)l[a].type==r.header_cell&&s.setNodeMarkup(i.tableStart+o[a],r.cell,l[a].attrs);if(s.steps.length==0)for(let a=0;a<o.length;a++)s.setNodeMarkup(i.tableStart+o[a],r.header_cell,l[a].attrs);t(s)}return!0}}function sa(n,e,t){const r=e.map.cellsInRect({left:0,top:0,right:n=="row"?e.map.width:1,bottom:n=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const s=e.table.nodeAt(r[i]);if(s&&s.type!==t.header_cell)return!1}return!0}function un(n,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Mw(n):function(t,r){if(!_e(t))return!1;if(r){const i=ce(t.schema),s=Fe(t),o=t.tr,l=sa("row",s,i),a=sa("column",s,i),u=(n==="column"?l:n==="row"?a:!1)?1:0,d=n=="column"?{left:0,top:u,right:1,bottom:s.map.height}:n=="row"?{left:u,top:0,right:s.map.width,bottom:1}:s,f=n=="column"?a?i.cell:i.header_cell:n=="row"?l?i.cell:i.header_cell:i.cell;s.map.cellsInRect(d).forEach(p=>{const h=p+s.tableStart,m=o.doc.nodeAt(h);m&&o.setNodeMarkup(h,f,m.attrs)}),r(o)}return!0}}un("row",{useDeprecatedLogic:!0});un("column",{useDeprecatedLogic:!0});var Aw=un("cell",{useDeprecatedLogic:!0});function Pw(n,e){if(e<0){const t=n.nodeBefore;if(t)return n.pos-t.nodeSize;for(let r=n.index(-1)-1,i=n.before();r>=0;r--){const s=n.node(-1).child(r),o=s.lastChild;if(o)return i-1-o.nodeSize;i-=s.nodeSize}}else{if(n.index()<n.parent.childCount-1)return n.pos+n.nodeAfter.nodeSize;const t=n.node(-1);for(let r=n.indexAfter(-1),i=n.after();r<t.childCount;r++){const s=t.child(r);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function oa(n){return function(e,t){if(!_e(e))return!1;const r=Pw(Kr(e),n);if(r==null)return!1;if(t){const i=e.doc.resolve(r);t(e.tr.setSelection(j.between(i,$y(i))).scrollIntoView())}return!0}}function Ow(n,e){const t=n.selection.$anchor;for(let r=t.depth;r>0;r--)if(t.node(r).type.spec.tableRole=="table")return e&&e(n.tr.delete(t.before(r),t.after(r)).scrollIntoView()),!0;return!1}function Rw({allowTableNodeSelection:n=!1}={}){return new Ie({key:nt,state:{init(){return null},apply(e,t){const r=e.getMeta(nt);if(r!=null)return r==-1?null:r;if(t==null||!e.docChanged)return t;const{deleted:i,pos:s}=e.mapping.mapResult(t);return i?null:s}},props:{decorations:Vy,handleDOMEvents:{mousedown:nw},createSelectionBetween(e){return nt.getState(e.state)!=null?e.state.selection:null},handleTripleClick:ew,handleKeyDown:Zy,handlePaste:tw},appendTransaction(e,t,r){return Gy(r,su(r,t),n)}})}function la(n,e,t,r,i,s){let o=0,l=!0,a=e.firstChild;const c=n.firstChild;for(let u=0,d=0;u<c.childCount;u+=1){const{colspan:f,colwidth:p}=c.child(u).attrs;for(let h=0;h<f;h+=1,d+=1){const m=i===d?s:p&&p[h],b=m?`${m}px`:"";o+=m||r,m||(l=!1),a?(a.style.width!==b&&(a.style.width=b),a=a.nextSibling):e.appendChild(document.createElement("col")).style.width=b}}for(;a;){const u=a.nextSibling;a.parentNode.removeChild(a),a=u}l?(t.style.width=`${o}px`,t.style.minWidth=""):(t.style.width="",t.style.minWidth=`${o}px`)}class Nw{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),la(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,la(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function Iw(n,e,t,r){let i=0,s=!0;const o=[],l=n.firstChild;if(!l)return{};for(let d=0,f=0;d<l.childCount;d+=1){const{colspan:p,colwidth:h}=l.child(d).attrs;for(let m=0;m<p;m+=1,f+=1){const b=t===f?r:h&&h[m],g=b?`${b}px`:"";i+=b||e,b||(s=!1),o.push(["col",g?{style:`width: ${g}`}:{}])}}const a=s?`${i}px`:"",c=s?"":`${i}px`;return{colgroup:["colgroup",{},...o],tableWidth:a,tableMinWidth:c}}function aa(n,e){return n.createAndFill()}function Lw(n){if(n.cached.tableNodeTypes)return n.cached.tableNodeTypes;const e={};return Object.keys(n.nodes).forEach(t=>{const r=n.nodes[t];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),n.cached.tableNodeTypes=e,e}function _w(n,e,t,r,i){const s=Lw(n),o=[],l=[];for(let c=0;c<t;c+=1){const u=aa(s.cell);if(u&&l.push(u),r){const d=aa(s.header_cell);d&&o.push(d)}}const a=[];for(let c=0;c<e;c+=1)a.push(s.row.createChecked(null,r&&c===0?o:l));return s.table.createChecked(null,a)}function zw(n){return n instanceof q}const Hn=({editor:n})=>{const{selection:e}=n.state;if(!zw(e))return!1;let t=0;const r=Hc(e.ranges[0].$from,s=>s.type.name==="table");return r==null||r.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(t+=1)}),t===e.ranges.length?(n.commands.deleteTable(),!0):!1},jw=X.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Nw,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:n,HTMLAttributes:e}){const{colgroup:t,tableWidth:r,tableMinWidth:i}=Iw(n,this.options.cellMinWidth);return["table",U(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`minWidth: ${i}`}),t,["tbody",0]]},addCommands(){return{insertTable:({rows:n=3,cols:e=3,withHeaderRow:t=!0}={})=>({tr:r,dispatch:i,editor:s})=>{const o=_w(s.schema,n,e,t);if(i){const l=r.selection.anchor+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(j.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:n,dispatch:e})=>mw(n,e),addColumnAfter:()=>({state:n,dispatch:e})=>gw(n,e),deleteColumn:()=>({state:n,dispatch:e})=>yw(n,e),addRowBefore:()=>({state:n,dispatch:e})=>vw(n,e),addRowAfter:()=>({state:n,dispatch:e})=>xw(n,e),deleteRow:()=>({state:n,dispatch:e})=>Cw(n,e),deleteTable:()=>({state:n,dispatch:e})=>Ow(n,e),mergeCells:()=>({state:n,dispatch:e})=>ra(n,e),splitCell:()=>({state:n,dispatch:e})=>ia(n,e),toggleHeaderColumn:()=>({state:n,dispatch:e})=>un("column")(n,e),toggleHeaderRow:()=>({state:n,dispatch:e})=>un("row")(n,e),toggleHeaderCell:()=>({state:n,dispatch:e})=>Aw(n,e),mergeOrSplit:()=>({state:n,dispatch:e})=>ra(n,e)?!0:ia(n,e),setCellAttribute:(n,e)=>({state:t,dispatch:r})=>Ew(n,e)(t,r),goToNextCell:()=>({state:n,dispatch:e})=>oa(1)(n,e),goToPreviousCell:()=>({state:n,dispatch:e})=>oa(-1)(n,e),fixTables:()=>({state:n,dispatch:e})=>(e&&su(n),!0),setCellSelection:n=>({tr:e,dispatch:t})=>{if(t){const r=q.create(e.doc,n.anchorCell,n.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Hn,"Mod-Backspace":Hn,Delete:Hn,"Mod-Delete":Hn}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[iw({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Rw({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(n){const e={name:n.name,options:n.options,storage:n.storage};return{tableRole:Y(ne(n,"tableRole",e))}}}),Dw=X.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:n}){return["td",U(this.options.HTMLAttributes,n),0]}}),Bw=X.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:n}){return["th",U(this.options.HTMLAttributes,n),0]}}),$w=X.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:n}){return["tr",U(this.options.HTMLAttributes,n),0]}}),Hw=X.create({name:"text",group:"inline"}),Fw=He.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.textAlign||this.options.defaultAlignment,renderHTML:n=>n.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${n.textAlign}`}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:n})).every(t=>t):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(e=>n.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),Vw=[Jb,Hw,Oy,Yb,Xb,Kb,Fb,Py,My,_b,Qb,Ey,$b,ry,Iy,qb,jw,Bw,$w,Dw,Fw],Ww=n=>{const{flexibleEditor:e,editorNodes:t,serializers:r,nodes:i,config:s,themeName:o,tokens:l,customTheme:a,remappedAttributes:c}=n,u=Fc(t,e),d=r??[...Vw]??[],f=X.create({name:"relation-block",renderHTML:()=>["relation-block"],render:p=>{var m,b;const{attrs:h}=p;if(h!=null&&h.data){if(!((m=h==null?void 0:h.data)!=null&&m.blocks)){const w={collection:h.collection,item:{...p}};return y.jsx(ll,{block:w,config:s})}const g=(b=h==null?void 0:h.data)==null?void 0:b.blocks,S=g==null?void 0:g.map(w=>({...w,collection:h==null?void 0:h.collection}));return y.jsx(ll,{blocks:S,config:s})}return null}});return d.push(f),u?y.jsx(Uc,{content:u,serializers:d,renderingNodes:i,themeName:o,tokens:l,customTheme:a,remappedAttributes:c}):null};exports.FlexibleEditorContent=Ww;exports.RenderNodes=Uc;exports.injectDataIntoContent=Fc;exports.mergeSerializers=Vc;exports.renderView=Gc;
|