@dss-kit/ui-kit 0.2.28 → 0.2.29

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.
Files changed (32) hide show
  1. package/README.md +21 -21
  2. package/dist/components/controls/MarkdownTextEditor/nodes/CustomLinkNode/parts/CustomLinkNodeComponent/CustomLinkNodeComponent.d.ts.map +1 -1
  3. package/dist/components/controls/MarkdownTextEditor/nodes/ImageRowNode/parts/ImageRowNodeComponent/ImageRowNodeComponent.d.ts.map +1 -1
  4. package/dist/components/shared/MarkdownText/MarkdownText.d.ts +8 -0
  5. package/dist/components/shared/MarkdownText/MarkdownText.d.ts.map +1 -0
  6. package/dist/components/shared/MarkdownText/MarkdownText.stories.d.ts +10 -0
  7. package/dist/components/shared/MarkdownText/MarkdownText.stories.d.ts.map +1 -0
  8. package/dist/components/shared/MarkdownText/MarkdownText.styles.d.ts +2 -0
  9. package/dist/components/shared/MarkdownText/MarkdownText.styles.d.ts.map +1 -0
  10. package/dist/components/shared/MarkdownText/index.d.ts +2 -0
  11. package/dist/components/shared/MarkdownText/index.d.ts.map +1 -0
  12. package/dist/components/shared/index.d.ts +1 -0
  13. package/dist/components/shared/index.d.ts.map +1 -1
  14. package/dist/styles/utils/breakpoints/base.scss +11 -11
  15. package/dist/styles/utils/breakpoints/index.scss +3 -3
  16. package/dist/styles/utils/breakpoints/screen.scss +61 -61
  17. package/dist/styles/utils/breakpoints/semantic.scss +31 -31
  18. package/dist/styles/utils/fonts/font-family.scss +3 -3
  19. package/dist/styles/utils/fonts/index.scss +1 -1
  20. package/dist/styles/utils/index.scss +5 -5
  21. package/dist/styles/utils/size/index.scss +1 -1
  22. package/dist/styles/utils/size/modifiers.scss +40 -40
  23. package/dist/styles/utils/style/index.scss +1 -1
  24. package/dist/styles/utils/style/variants.scss +34 -34
  25. package/dist/styles/utils/typography/_font-weight.scss +33 -33
  26. package/dist/styles/utils/typography/_variants.scss +85 -85
  27. package/dist/styles/utils/typography/index.scss +2 -2
  28. package/dist/ui-kit.cjs.js +46 -46
  29. package/dist/ui-kit.cjs.js.map +1 -1
  30. package/dist/ui-kit.es.js +6177 -6046
  31. package/dist/ui-kit.es.js.map +1 -1
  32. package/package.json +92 -92
@@ -1,11 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),S=require("react"),R=require("@emotion/css"),Ss=require("react-dom"),el=require("@highcharts/react");function k0(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=k0(S),p_=k0(Ss);function m_(e){const{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:x,xGap:y,yGap:v,row:b,flex:w,relative:_,absolute:E,display:T,overflow:k,absoluteFill:P,center:O,justifyContent:D,alignItems:I,alignSelf:$,borderWidth:H,borderBottomWidth:U,borderColor:F,borderRadius:N,borderStyle:j,border:K,zIndex:te,minWidth:J,minHeight:Z,maxWidth:se,maxHeight:oe,flexWrap:fe,flexGrow:_e,flexShrink:ne,flexBasis:ye,backgroundColor:Te,position:De,top:st,right:ee,bottom:we,left:ze,cursor:Ee,...mt}=e;return{spacers:{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:x,xGap:y,yGap:v,row:b,flex:w,relative:_,absolute:E,display:T,overflow:k,absoluteFill:P,center:O,justifyContent:D,alignItems:I,alignSelf:$,borderWidth:H,borderBottomWidth:U,borderColor:F,borderRadius:N,borderStyle:j,border:K,zIndex:te,minWidth:J,minHeight:Z,maxWidth:se,maxHeight:oe,flexWrap:fe,flexGrow:_e,flexShrink:ne,flexBasis:ye,backgroundColor:Te,position:De,top:st,right:ee,bottom:we,left:ze,cursor:Ee},rest:mt}}const y_=e=>R.css({display:e.display??"flex",flexDirection:e.row?"row":"column",height:e.h==="screen"?"100vh":e.h==="full"?"100%":e.h,width:e.w==="screen"?"100vw":e.w==="full"?"100%":e.w,margin:e.m,marginTop:e.mt??e.my,marginBottom:e.mb??e.my,marginLeft:e.ml??e.mx,marginRight:e.mr??e.mx,padding:e.p,paddingTop:e.pt??e.py,paddingBottom:e.pb??e.py,paddingLeft:e.pl??e.px,paddingRight:e.pr??e.px,gap:e.gap,columnGap:e.xGap,rowGap:e.yGap,justifyContent:e.center?"center":e.justifyContent,alignItems:e.center?"center":e.alignItems,alignSelf:e.alignSelf,borderWidth:e.borderWidth,borderBottomWidth:e.borderBottomWidth,borderColor:e.borderColor,borderRadius:e.borderRadius,borderStyle:e.borderStyle,border:e.border,zIndex:e.zIndex,overflow:e.overflow,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,flex:e.flex===!0?1:e.flex,flexWrap:e.flexWrap,flexGrow:e.flexGrow,flexShrink:e.flexShrink,flexBasis:e.flexBasis,backgroundColor:e.backgroundColor,position:e?.position?e?.position:e?.absolute?"absolute":e?.relative?"relative":void 0,...e.absoluteFill&&{position:"absolute",top:0,right:0,bottom:0,left:0},top:e?.top,right:e?.right,bottom:e?.bottom,left:e?.left,cursor:e.cursor}),G=S.forwardRef(({className:e,children:t,...n},r)=>{const{spacers:o,rest:i}=m_(n),s=S.useMemo(()=>y_(o),[o]);return C.jsx("div",{ref:r,className:R.cx(s,e),...i,children:t})});G.displayName="Box";function Mo(e,t){const{current:n}=S.useRef(e!==void 0),[r,o]=S.useState(t),i=n?e:r,s=S.useCallback(a=>{n||o(a)},[]);return[i,s]}function vf(e,t,n,r=""){if(n)return e[`${t}_${n}${r}`]}function v_(e,t,n){return vf(e,t,n,"Weight")}function x_(e,t,n){return vf(e,t,n,"Size")}const b_={border:{accentPrimary:"var(--border-accent-primary)",accentPrimaryHover:"var(--border-accent-primary-hover)",accentSecondary:"var(--border-accent-secondary)",accentSecondaryHover:"var(--border-accent-secondary-hover)",negativePrimary:"var(--border-negative-primary)",negativePrimaryHover:"var(--border-negative-primary-hover)",negativeSecondary:"var(--border-negative-secondary)",negativeSecondaryHover:"var(--border-negative-secondary-hover)",positivePrimary:"var(--border-positive-primary)",positivePrimaryHover:"var(--border-positive-primary-hover)",positiveSecondary:"var(--border-positive-secondary)",positiveSecondaryHover:"var(--border-positive-secondary-hover)",warningPrimary:"var(--border-warning-primary)",warningPrimaryHover:"var(--border-warning-primary-hover)",warningSecondary:"var(--border-warning-secondary)",warningSecondaryHover:"var(--border-warning-secondary-hover)",neutralPrimary:"var(--border-neutral-primary)",neutralPrimaryHover:"var(--border-neutral-primary-hover)",neutralAlphaBasic:"var(--border-neutral-alpha-basic)",neutralAlphaLow:"var(--border-neutral-alpha-low)",neutralAlphaHigh:"var(--border-neutral-alpha-high)",transferPrimary:"var(--border-transfer-primary)",transferPrimaryHover:"var(--border-transfer-primary-hover)",transferSecondary:"var(--border-transfer-secondary)",transferSecondaryHover:"var(--border-transfer-secondary-hover)"},text:{primary:"var(--text-primary)",primaryInverse:"var(--text-primary-inverse)",primaryHover:"var(--text-primary-hover)",secondary:"var(--text-secondary)",secondaryInverse:"var(--text-secondary-inverse)",secondaryHover:"var(--text-secondary-hover)",tertiary:"var(--text-tertiary)",tertiaryInverse:"var(--text-tertiary-inverse)",tertiaryHover:"var(--text-tertiary-hover)",positive:"var(--text-positive)",positiveHover:"var(--text-positive-hover)",negative:"var(--text-negative)",negativeHover:"var(--text-negative-hover)",warning:"var(--text-warning)",warningHover:"var(--text-warning-hover)",accent:"var(--text-accent)",accentHover:"var(--text-accent-hover)",inverse:"var(--text-inverse)",transfer:"var(--text-transfer)",transferHover:"var(--text-transfer-hover)"},icon:{primary:"var(--icon-primary)",primaryHover:"var(--icon-primary-hover)",primaryInverse:"var(--icon-primary-inverse)",secondary:"var(--icon-secondary)",secondaryHover:"var(--icon-secondary-hover)",tertiary:"var(--icon-tertiary)",tertiaryInverse:"var(--icon-tertiary-inverse)",tertiaryHover:"var(--icon-tertiary-hover)",positive:"var(--icon-positive)",positiveHover:"var(--icon-positive-hover)",negative:"var(--icon-negative)",negativeHover:"var(--icon-negative-hover)",warning:"var(--icon-warning)",warningHover:"var(--icon-warning-hover)",accent:"var(--icon-accent)",accentHover:"var(--icon-accent-hover)",inverse:"var(--icon-inverse)",transfer:"var(--icon-transfer)",transferHover:"var(--icon-transfer-hover)"},fill:{accentPrimary:"var(--fill-accent-primary)",accentPrimaryHover:"var(--fill-accent-primary-hover)",accentSecondary:"var(--fill-accent-secondary)",accentSecondaryHover:"var(--fill-accent-secondary-hover)",accentTintHigh:"var(--fill-accent-tint-high)",accentTint:"var(--fill-accent-tint)",accentTintLow:"var(--fill-accent-tint-low)",accentTransparent:"var(--fill-accent-transparent)",positivePrimary:"var(--fill-positive-primary)",positivePrimaryHover:"var(--fill-positive-primary-hover)",positiveSecondary:"var(--fill-positive-secondary)",positiveSecondaryHover:"var(--fill-positive-secondary-hover)",positiveTintHigh:"var(--fill-positive-tint-high)",positiveTint:"var(--fill-positive-tint)",positiveTintLow:"var(--fill-positive-tint-low)",positiveTransparent:"var(--fill-positive-transparent)",negativePrimary:"var(--fill-negative-primary)",negativePrimaryHover:"var(--fill-negative-primary-hover)",negativeSecondary:"var(--fill-negative-secondary)",negativeSecondaryHover:"var(--fill-negative-secondary-hover)",negativeTintHigh:"var(--fill-negative-tint-high)",negativeTint:"var(--fill-negative-tint)",negativeTintLow:"var(--fill-negative-tint-low)",negativeTransparent:"var(--fill-negative-transparent)",warningPrimary:"var(--fill-warning-primary)",warningPrimaryHover:"var(--fill-warning-primary-hover)",warningSecondary:"var(--fill-warning-secondary)",warningSecondaryHover:"var(--fill-warning-secondary-hover)",warningTintHigh:"var(--fill-warning-tint-high)",warningTint:"var(--fill-warning-tint)",warningTintLow:"var(--fill-warning-tint-low)",warningTransparent:"var(--fill-warning-transparent)",neutralPrimary:"var(--fill-neutral-primary)",neutralPrimaryHover:"var(--fill-neutral-primary-hover)",neutralSecondary:"var(--fill-neutral-secondary)",neutralSecondaryInverse:"var(--fill-neutral-secondary-inverse)",neutralSecondaryHover:"var(--fill-neutral-secondary-hover)",neutralTint:"var(--fill-neutral-tint)",neutralTintLow:"var(--fill-neutral-tint-low)",transferPrimary:"var(--fill-transfer-primary)",transferPrimaryHover:"var(--fill-transfer-primary-hover)",transferSecondary:"var(--fill-transfer-secondary)",transferSecondaryHover:"var(--fill-transfer-secondary-hover)",transferTintHigh:"var(--fill-transfer-tint-high)",transferTint:"var(--fill-transfer-tint)",transferTintLow:"var(--fill-transfer-tint-low)",transferTransparent:"var(--fill-transfer-transparent)",bgPrimary:"var(--fill-bg-primary)",bgPrimaryInverse:"var(--fill-bg-primary-inverse)",bgSecondary:"var(--fill-bg-secondary)",bgSecondaryInverse:"var(--fill-bg-secondary-inverse)",bgTertiary:"var(--fill-bg-tertiary)",bgOverlayPrimary:"var(--fill-bg-overlay-primary)"},status:{accent:"var(--status-accent)",accentTint:"var(--status-accent-tint)",accentTintLow:"var(--status-accent-tint-low)",negative:"var(--status-negative)",negativeTint:"var(--status-negative-tint)",negativeTintLow:"var(--status-negative-tint-low)",positive:"var(--status-positive)",positiveTint:"var(--status-positive-tint)",positiveTintLow:"var(--status-positive-tint-low)",warning:"var(--status-warning)",warningTint:"var(--status-warning-tint)",warningTintLow:"var(--status-warning-tint-low)",neutral:"var(--status-neutral)",neutralTint:"var(--status-neutral-tint)",neutralTintLow:"var(--status-neutral-tint-low)",transfer:"var(--status-transfer)",transferTint:"var(--status-transfer-tint)",transferTintLow:"var(--status-transfer-tint-low)"},effect:{shadowS:"var(--effect-shadow-s)",shadowM:"var(--effect-shadow-m)",shadowL:"var(--effect-shadow-l)"},scrollbar:{thumbPrimary:"var(--scrollbar-thumb-primary)",trackPrimary:"var(--scrollbar-track-primary)"},gradient:{progressbar:"var(--gradient-progressbar)",progressbarPositive:"var(--gradient-progressbar-positive)",progressbarAccent:"var(--gradient-progressbar-accent)",progressbarNegative:"var(--gradient-progressbar-negative)",progressbarWarning:"var(--gradient-progressbar-warning)",progressbarNeutral:"var(--gradient-progressbar-neutral)",progressbarTransfer:"var(--gradient-progressbar-transfer)",accent1:"var(--gradient-accent-1)",accent1_20:"var(--gradient-accent-1-20)",accent1_10:"var(--gradient-accent-1-10)",negative1:"var(--gradient-negative-1)",negative1_20:"var(--gradient-negative-1-20)",negative1_10:"var(--gradient-negative-1-10)",positive1:"var(--gradient-positive-1)",positive1_20:"var(--gradient-positive-1-20)",positive1_10:"var(--gradient-positive-1-10)",warning1:"var(--gradient-warning-1)",warning1_20:"var(--gradient-warning-1-20)",warning1_10:"var(--gradient-warning-1-10)",neutral1:"var(--gradient-neutral-1)",neutral1_20:"var(--gradient-neutral-1-20)",neutral1_10:"var(--gradient-neutral-1-10)",accentAlternative1:"var(--gradient-accent-alternative-1)",transfer1:"var(--gradient-transfer-1)",transfer1_20:"var(--gradient-transfer-1-20)",transfer1_10:"var(--gradient-transfer-1-10)"}},w_={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)",fullRound:"var(--corner-full-round)"},C_={regular:"var(--fw-regular)",medium:"var(--fw-medium)",semibold:"var(--fw-semibold)",bold:"var(--fw-bold)"},S_={button:{xs:"var(--height-button-xs)",sm:"var(--height-button-sm)",md:"var(--height-button-md)",lg:"var(--height-button-lg)"},avatar:{"2xs":"var(--height-avatar-2xs)",xs:"var(--height-avatar-xs)",sm:"var(--height-avatar-sm)",md:"var(--height-avatar-md)",lg:"var(--height-avatar-lg)",xl:"var(--height-avatar-xl)","2xl":"var(--height-avatar-2xl)"},icon:{"2xs":"var(--height-icon-2xs)",xs:"var(--height-icon-xs)",sm:"var(--height-icon-sm)",md:"var(--height-icon-md)",lg:"var(--height-icon-lg)",xl:"var(--height-icon-xl)"},switch:{sm:"var(--height-switch-sm)",md:"var(--height-switch-md)",lg:"var(--height-switch-lg)"}},__={primary:"var(--opacity-primary)",secondary:"var(--opacity-secondary)",tertiary:"var(--opacity-tertiary)"},T_={zero:"var(--spacing-zero)",xs:"var(--spacing-xs)",sm:"var(--spacing-sm)",md:"var(--spacing-md)",lg:"var(--spacing-lg)",xl:"var(--spacing-xl)","2xl":"var(--spacing-2xl)","3xl":"var(--spacing-3xl)","4xl":"var(--spacing-4xl)","5xl":"var(--spacing-5xl)","6xl":"var(--spacing-6xl)","7xl":"var(--spacing-7xl)","8xl":"var(--spacing-8xl)","9xl":"var(--spacing-9xl)","10xl":"var(--spacing-10xl)"},E_={general:"var(--transition-general)"},V={spacing:T_,cornerRadius:w_,opacity:__,transition:E_,fontWeight:C_,height:S_,color:b_},A0=R.keyframes`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),S=require("react"),R=require("@emotion/css"),Ts=require("react-dom"),rl=require("@highcharts/react");function N0(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=N0(S),S_=N0(Ts);function __(e){const{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:x,xGap:y,yGap:v,row:b,flex:w,relative:_,absolute:E,display:T,overflow:k,absoluteFill:P,center:O,justifyContent:D,alignItems:I,alignSelf:$,borderWidth:H,borderBottomWidth:U,borderColor:L,borderRadius:N,borderStyle:V,border:K,zIndex:te,minWidth:J,minHeight:Z,maxWidth:ae,maxHeight:oe,flexWrap:fe,flexGrow:Te,flexShrink:ne,flexBasis:ve,backgroundColor:Ee,position:De,top:st,right:ee,bottom:Ce,left:ze,cursor:Re,...mt}=e;return{spacers:{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:x,xGap:y,yGap:v,row:b,flex:w,relative:_,absolute:E,display:T,overflow:k,absoluteFill:P,center:O,justifyContent:D,alignItems:I,alignSelf:$,borderWidth:H,borderBottomWidth:U,borderColor:L,borderRadius:N,borderStyle:V,border:K,zIndex:te,minWidth:J,minHeight:Z,maxWidth:ae,maxHeight:oe,flexWrap:fe,flexGrow:Te,flexShrink:ne,flexBasis:ve,backgroundColor:Ee,position:De,top:st,right:ee,bottom:Ce,left:ze,cursor:Re},rest:mt}}const T_=e=>R.css({display:e.display??"flex",flexDirection:e.row?"row":"column",height:e.h==="screen"?"100vh":e.h==="full"?"100%":e.h,width:e.w==="screen"?"100vw":e.w==="full"?"100%":e.w,margin:e.m,marginTop:e.mt??e.my,marginBottom:e.mb??e.my,marginLeft:e.ml??e.mx,marginRight:e.mr??e.mx,padding:e.p,paddingTop:e.pt??e.py,paddingBottom:e.pb??e.py,paddingLeft:e.pl??e.px,paddingRight:e.pr??e.px,gap:e.gap,columnGap:e.xGap,rowGap:e.yGap,justifyContent:e.center?"center":e.justifyContent,alignItems:e.center?"center":e.alignItems,alignSelf:e.alignSelf,borderWidth:e.borderWidth,borderBottomWidth:e.borderBottomWidth,borderColor:e.borderColor,borderRadius:e.borderRadius,borderStyle:e.borderStyle,border:e.border,zIndex:e.zIndex,overflow:e.overflow,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,flex:e.flex===!0?1:e.flex,flexWrap:e.flexWrap,flexGrow:e.flexGrow,flexShrink:e.flexShrink,flexBasis:e.flexBasis,backgroundColor:e.backgroundColor,position:e?.position?e?.position:e?.absolute?"absolute":e?.relative?"relative":void 0,...e.absoluteFill&&{position:"absolute",top:0,right:0,bottom:0,left:0},top:e?.top,right:e?.right,bottom:e?.bottom,left:e?.left,cursor:e.cursor}),G=S.forwardRef(({className:e,children:t,...n},r)=>{const{spacers:o,rest:i}=__(n),s=S.useMemo(()=>T_(o),[o]);return C.jsx("div",{ref:r,className:R.cx(s,e),...i,children:t})});G.displayName="Box";function Po(e,t){const{current:n}=S.useRef(e!==void 0),[r,o]=S.useState(t),i=n?e:r,s=S.useCallback(a=>{n||o(a)},[]);return[i,s]}function wf(e,t,n,r=""){if(n)return e[`${t}_${n}${r}`]}function E_(e,t,n){return wf(e,t,n,"Weight")}function R_(e,t,n){return wf(e,t,n,"Size")}const k_={border:{accentPrimary:"var(--border-accent-primary)",accentPrimaryHover:"var(--border-accent-primary-hover)",accentSecondary:"var(--border-accent-secondary)",accentSecondaryHover:"var(--border-accent-secondary-hover)",negativePrimary:"var(--border-negative-primary)",negativePrimaryHover:"var(--border-negative-primary-hover)",negativeSecondary:"var(--border-negative-secondary)",negativeSecondaryHover:"var(--border-negative-secondary-hover)",positivePrimary:"var(--border-positive-primary)",positivePrimaryHover:"var(--border-positive-primary-hover)",positiveSecondary:"var(--border-positive-secondary)",positiveSecondaryHover:"var(--border-positive-secondary-hover)",warningPrimary:"var(--border-warning-primary)",warningPrimaryHover:"var(--border-warning-primary-hover)",warningSecondary:"var(--border-warning-secondary)",warningSecondaryHover:"var(--border-warning-secondary-hover)",neutralPrimary:"var(--border-neutral-primary)",neutralPrimaryHover:"var(--border-neutral-primary-hover)",neutralAlphaBasic:"var(--border-neutral-alpha-basic)",neutralAlphaLow:"var(--border-neutral-alpha-low)",neutralAlphaHigh:"var(--border-neutral-alpha-high)",transferPrimary:"var(--border-transfer-primary)",transferPrimaryHover:"var(--border-transfer-primary-hover)",transferSecondary:"var(--border-transfer-secondary)",transferSecondaryHover:"var(--border-transfer-secondary-hover)"},text:{primary:"var(--text-primary)",primaryInverse:"var(--text-primary-inverse)",primaryHover:"var(--text-primary-hover)",secondary:"var(--text-secondary)",secondaryInverse:"var(--text-secondary-inverse)",secondaryHover:"var(--text-secondary-hover)",tertiary:"var(--text-tertiary)",tertiaryInverse:"var(--text-tertiary-inverse)",tertiaryHover:"var(--text-tertiary-hover)",positive:"var(--text-positive)",positiveHover:"var(--text-positive-hover)",negative:"var(--text-negative)",negativeHover:"var(--text-negative-hover)",warning:"var(--text-warning)",warningHover:"var(--text-warning-hover)",accent:"var(--text-accent)",accentHover:"var(--text-accent-hover)",inverse:"var(--text-inverse)",transfer:"var(--text-transfer)",transferHover:"var(--text-transfer-hover)"},icon:{primary:"var(--icon-primary)",primaryHover:"var(--icon-primary-hover)",primaryInverse:"var(--icon-primary-inverse)",secondary:"var(--icon-secondary)",secondaryHover:"var(--icon-secondary-hover)",tertiary:"var(--icon-tertiary)",tertiaryInverse:"var(--icon-tertiary-inverse)",tertiaryHover:"var(--icon-tertiary-hover)",positive:"var(--icon-positive)",positiveHover:"var(--icon-positive-hover)",negative:"var(--icon-negative)",negativeHover:"var(--icon-negative-hover)",warning:"var(--icon-warning)",warningHover:"var(--icon-warning-hover)",accent:"var(--icon-accent)",accentHover:"var(--icon-accent-hover)",inverse:"var(--icon-inverse)",transfer:"var(--icon-transfer)",transferHover:"var(--icon-transfer-hover)"},fill:{accentPrimary:"var(--fill-accent-primary)",accentPrimaryHover:"var(--fill-accent-primary-hover)",accentSecondary:"var(--fill-accent-secondary)",accentSecondaryHover:"var(--fill-accent-secondary-hover)",accentTintHigh:"var(--fill-accent-tint-high)",accentTint:"var(--fill-accent-tint)",accentTintLow:"var(--fill-accent-tint-low)",accentTransparent:"var(--fill-accent-transparent)",positivePrimary:"var(--fill-positive-primary)",positivePrimaryHover:"var(--fill-positive-primary-hover)",positiveSecondary:"var(--fill-positive-secondary)",positiveSecondaryHover:"var(--fill-positive-secondary-hover)",positiveTintHigh:"var(--fill-positive-tint-high)",positiveTint:"var(--fill-positive-tint)",positiveTintLow:"var(--fill-positive-tint-low)",positiveTransparent:"var(--fill-positive-transparent)",negativePrimary:"var(--fill-negative-primary)",negativePrimaryHover:"var(--fill-negative-primary-hover)",negativeSecondary:"var(--fill-negative-secondary)",negativeSecondaryHover:"var(--fill-negative-secondary-hover)",negativeTintHigh:"var(--fill-negative-tint-high)",negativeTint:"var(--fill-negative-tint)",negativeTintLow:"var(--fill-negative-tint-low)",negativeTransparent:"var(--fill-negative-transparent)",warningPrimary:"var(--fill-warning-primary)",warningPrimaryHover:"var(--fill-warning-primary-hover)",warningSecondary:"var(--fill-warning-secondary)",warningSecondaryHover:"var(--fill-warning-secondary-hover)",warningTintHigh:"var(--fill-warning-tint-high)",warningTint:"var(--fill-warning-tint)",warningTintLow:"var(--fill-warning-tint-low)",warningTransparent:"var(--fill-warning-transparent)",neutralPrimary:"var(--fill-neutral-primary)",neutralPrimaryHover:"var(--fill-neutral-primary-hover)",neutralSecondary:"var(--fill-neutral-secondary)",neutralSecondaryInverse:"var(--fill-neutral-secondary-inverse)",neutralSecondaryHover:"var(--fill-neutral-secondary-hover)",neutralTint:"var(--fill-neutral-tint)",neutralTintLow:"var(--fill-neutral-tint-low)",transferPrimary:"var(--fill-transfer-primary)",transferPrimaryHover:"var(--fill-transfer-primary-hover)",transferSecondary:"var(--fill-transfer-secondary)",transferSecondaryHover:"var(--fill-transfer-secondary-hover)",transferTintHigh:"var(--fill-transfer-tint-high)",transferTint:"var(--fill-transfer-tint)",transferTintLow:"var(--fill-transfer-tint-low)",transferTransparent:"var(--fill-transfer-transparent)",bgPrimary:"var(--fill-bg-primary)",bgPrimaryInverse:"var(--fill-bg-primary-inverse)",bgSecondary:"var(--fill-bg-secondary)",bgSecondaryInverse:"var(--fill-bg-secondary-inverse)",bgTertiary:"var(--fill-bg-tertiary)",bgOverlayPrimary:"var(--fill-bg-overlay-primary)"},status:{accent:"var(--status-accent)",accentTint:"var(--status-accent-tint)",accentTintLow:"var(--status-accent-tint-low)",negative:"var(--status-negative)",negativeTint:"var(--status-negative-tint)",negativeTintLow:"var(--status-negative-tint-low)",positive:"var(--status-positive)",positiveTint:"var(--status-positive-tint)",positiveTintLow:"var(--status-positive-tint-low)",warning:"var(--status-warning)",warningTint:"var(--status-warning-tint)",warningTintLow:"var(--status-warning-tint-low)",neutral:"var(--status-neutral)",neutralTint:"var(--status-neutral-tint)",neutralTintLow:"var(--status-neutral-tint-low)",transfer:"var(--status-transfer)",transferTint:"var(--status-transfer-tint)",transferTintLow:"var(--status-transfer-tint-low)"},effect:{shadowS:"var(--effect-shadow-s)",shadowM:"var(--effect-shadow-m)",shadowL:"var(--effect-shadow-l)"},scrollbar:{thumbPrimary:"var(--scrollbar-thumb-primary)",trackPrimary:"var(--scrollbar-track-primary)"},gradient:{progressbar:"var(--gradient-progressbar)",progressbarPositive:"var(--gradient-progressbar-positive)",progressbarAccent:"var(--gradient-progressbar-accent)",progressbarNegative:"var(--gradient-progressbar-negative)",progressbarWarning:"var(--gradient-progressbar-warning)",progressbarNeutral:"var(--gradient-progressbar-neutral)",progressbarTransfer:"var(--gradient-progressbar-transfer)",accent1:"var(--gradient-accent-1)",accent1_20:"var(--gradient-accent-1-20)",accent1_10:"var(--gradient-accent-1-10)",negative1:"var(--gradient-negative-1)",negative1_20:"var(--gradient-negative-1-20)",negative1_10:"var(--gradient-negative-1-10)",positive1:"var(--gradient-positive-1)",positive1_20:"var(--gradient-positive-1-20)",positive1_10:"var(--gradient-positive-1-10)",warning1:"var(--gradient-warning-1)",warning1_20:"var(--gradient-warning-1-20)",warning1_10:"var(--gradient-warning-1-10)",neutral1:"var(--gradient-neutral-1)",neutral1_20:"var(--gradient-neutral-1-20)",neutral1_10:"var(--gradient-neutral-1-10)",accentAlternative1:"var(--gradient-accent-alternative-1)",transfer1:"var(--gradient-transfer-1)",transfer1_20:"var(--gradient-transfer-1-20)",transfer1_10:"var(--gradient-transfer-1-10)"}},A_={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)",fullRound:"var(--corner-full-round)"},M_={regular:"var(--fw-regular)",medium:"var(--fw-medium)",semibold:"var(--fw-semibold)",bold:"var(--fw-bold)"},N_={button:{xs:"var(--height-button-xs)",sm:"var(--height-button-sm)",md:"var(--height-button-md)",lg:"var(--height-button-lg)"},avatar:{"2xs":"var(--height-avatar-2xs)",xs:"var(--height-avatar-xs)",sm:"var(--height-avatar-sm)",md:"var(--height-avatar-md)",lg:"var(--height-avatar-lg)",xl:"var(--height-avatar-xl)","2xl":"var(--height-avatar-2xl)"},icon:{"2xs":"var(--height-icon-2xs)",xs:"var(--height-icon-xs)",sm:"var(--height-icon-sm)",md:"var(--height-icon-md)",lg:"var(--height-icon-lg)",xl:"var(--height-icon-xl)"},switch:{sm:"var(--height-switch-sm)",md:"var(--height-switch-md)",lg:"var(--height-switch-lg)"}},P_={primary:"var(--opacity-primary)",secondary:"var(--opacity-secondary)",tertiary:"var(--opacity-tertiary)"},L_={zero:"var(--spacing-zero)",xs:"var(--spacing-xs)",sm:"var(--spacing-sm)",md:"var(--spacing-md)",lg:"var(--spacing-lg)",xl:"var(--spacing-xl)","2xl":"var(--spacing-2xl)","3xl":"var(--spacing-3xl)","4xl":"var(--spacing-4xl)","5xl":"var(--spacing-5xl)","6xl":"var(--spacing-6xl)","7xl":"var(--spacing-7xl)","8xl":"var(--spacing-8xl)","9xl":"var(--spacing-9xl)","10xl":"var(--spacing-10xl)"},F_={general:"var(--transition-general)"},j={spacing:L_,cornerRadius:A_,opacity:P_,transition:F_,fontWeight:M_,height:N_,color:k_},P0=R.keyframes`
2
2
  0% {
3
3
  box-shadow: 0 16px 0 var(--loader-color);
4
4
  }
5
5
  100% {
6
6
  box-shadow: 0 20px 0 var(--loader-color);
7
7
  }
8
- `,Fg={content:'""',position:"absolute",width:8,height:8,borderRadius:"50%",boxShadow:"0 16px 0 var(--loader-color)",animationName:A0,animationDuration:"0.4s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationDirection:"alternate"},R_={loader:R.css({width:8,height:8,borderRadius:"50%",boxShadow:"0 16px 0 var(--loader-color)",position:"relative",animationName:A0,animationDuration:"0.4s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationDirection:"alternate",animationDelay:"0.32s",display:"block",top:-19,opacity:.9,"&::before":{...Fg,left:-12,animationDelay:"0.48s"},"&::after":{...Fg,right:-12,animationDelay:"0.16s"}})},M0=({color:e=V.color.text.accent})=>C.jsx("span",{className:R.cx(R_.loader,R.css({"--loader-color":e}))}),N0=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));var In=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wc={exports:{}};var Lg;function k_(){return Lg||(Lg=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)t.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(wc)),wc.exports}var A_=k_();const bf=xf(A_),M_=R.keyframes`
8
+ `,Og={content:'""',position:"absolute",width:8,height:8,borderRadius:"50%",boxShadow:"0 16px 0 var(--loader-color)",animationName:P0,animationDuration:"0.4s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationDirection:"alternate"},$_={loader:R.css({width:8,height:8,borderRadius:"50%",boxShadow:"0 16px 0 var(--loader-color)",position:"relative",animationName:P0,animationDuration:"0.4s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationDirection:"alternate",animationDelay:"0.32s",display:"block",top:-19,opacity:.9,"&::before":{...Og,left:-12,animationDelay:"0.48s"},"&::after":{...Og,right:-12,animationDelay:"0.16s"}})},L0=({color:e=j.color.text.accent})=>C.jsx("span",{className:R.cx($_.loader,R.css({"--loader-color":e}))}),F0=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));var Dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tc={exports:{}};var Ig;function O_(){return Ig||(Ig=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)t.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Tc)),Tc.exports}var I_=O_();const Sf=Cf(I_),D_=R.keyframes`
9
9
  0% {
10
10
  transform: scale(0);
11
11
  opacity: 0.36;
@@ -14,7 +14,7 @@
14
14
  transform: scale(1);
15
15
  opacity: 0;
16
16
  }
17
- `,$g={rippleOverlay:R.css({position:"absolute",inset:0,pointerEvents:"none",overflow:"visible",borderRadius:"inherit",zIndex:0}),ripple:R.css({position:"absolute",borderRadius:"50%",transform:"scale(0)",transformOrigin:"center center",opacity:.36,willChange:"transform, opacity",animationName:M_,animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationFillMode:"forwards"})},Cc="button, a, input, label, [role='button'], [data-ripple]";function N_(e){if(typeof e.composedPath=="function")return e.composedPath();const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentNode||n.host;return t.push(window),t}const No=S.forwardRef(({color:e="rgba(0,0,0,0.18)",duration:t=1e3,radius:n="auto",className:r},o)=>{const i=S.useRef(null),[s,a]=S.useState([]),l=S.useRef([]),c=S.useRef(1),u=S.useRef(null),f=()=>{l.current.map(p=>clearTimeout(p)),l.current=[]},d=S.useCallback((p,m,x,y)=>{if(typeof window>"u")return;const v=x.getBoundingClientRect(),b=n==="auto"?Math.max(v.width,v.height)*2:n,w=p-y.left,_=m-y.top,E=Math.max(0,v.top-y.top),T=Math.max(0,v.left-y.left),k=Math.max(0,y.right-v.right),P=Math.max(0,y.bottom-v.bottom),D=window.getComputedStyle(x).borderRadius||"0px",I=c.current++,$={id:I,left:w-b/2,top:_-b/2,size:Math.ceil(b),clip:{top:Math.round(E),right:Math.round(k),bottom:Math.round(P),left:Math.round(T)},borderRadius:D};a(U=>[...U,$]);const H=window.setTimeout(()=>{a(U=>U.filter(F=>F.id!==I))},t+80);l.current.push(H)},[t,n]),h=S.useCallback(p=>{try{if(!i.current)return;const m=i.current,x=m.parentElement;if(!x)return;const y=N_(p);let v=null;for(const T of y)if(T instanceof Element){if(T===x)break;if(T.matches&&T.matches(Cc)){v=T;break}}if(v||(v=x),v.closest&&(v.closest("[disabled]")||v.getAttribute("aria-disabled")==="true"||v.classList.contains("ripple-disabled")))return;const b=p.target;if(b?.closest&&(b.closest("[disabled]")||b.getAttribute?.("aria-disabled")==="true"))return;const w=m.getBoundingClientRect(),{clientX:_}=p,{clientY:E}=p;d(_,E,v,w)}catch{}},[d]),g=S.useCallback(p=>{if(!i.current||!(p.key==="Enter"||p.key===" "))return;const m=i.current,x=m.parentElement;if(!x)return;const y=document.activeElement;let v=null;if(y instanceof Element&&y.matches(Cc)&&(v=y),v||(v=x),v.closest&&(v.closest("[disabled]")||v.getAttribute("aria-disabled")==="true"))return;const b=m.getBoundingClientRect(),w=v.getBoundingClientRect().left+v.getBoundingClientRect().width/2,_=v.getBoundingClientRect().top+v.getBoundingClientRect().height/2;d(w,_,v,b)},[d]);return S.useImperativeHandle(o,()=>({trigger:({center:p=!0,x:m,y:x}={})=>{const y=i.current;if(!y)return;const v=y.parentElement;if(!v)return;const b=y.getBoundingClientRect(),w=document.activeElement instanceof Element&&document.activeElement.matches(Cc)?document.activeElement:v,_=p?w.getBoundingClientRect().left+w.getBoundingClientRect().width/2:m??b.left+b.width/2,E=p?w.getBoundingClientRect().top+w.getBoundingClientRect().height/2:x??b.top+b.height/2;d(_,E,w,b)}}),[d]),S.useEffect(()=>{const p=i.current;if(!p)return;const m=p.parentElement;if(!m||typeof window>"u")return;const x=window.getComputedStyle(m);let y=!1;return x.position==="static"&&(m.style.position="relative",y=!0,u.current=m),m.addEventListener("pointerdown",h,!0),m.addEventListener("keydown",g),()=>{m.removeEventListener("pointerdown",h,!0),m.removeEventListener("keydown",g),y&&u.current&&(u.current.style.position="",u.current=null),f()}},[h,g]),S.useEffect(()=>()=>f(),[]),C.jsx("div",{ref:i,className:`${$g.rippleOverlay} ${r??""}`,"aria-hidden":!0,children:s.map(p=>C.jsx("span",{className:$g.ripple,style:{left:`${p.left}px`,top:`${p.top}px`,width:`${p.size}px`,height:`${p.size}px`,backgroundColor:e,animationDuration:`${t}ms`,clipPath:`inset(${p.clip.top}px ${p.clip.right}px ${p.clip.bottom}px ${p.clip.left}px round ${p.borderRadius})`}},p.id))})}),P_=R.css({display:"flex",alignItems:"center",justifyContent:"center",transition:V.transition.general,position:"relative",overflow:"hidden","& svg":{transition:V.transition.general},"&:disabled":{opacity:.5}}),F_={md:R.css({minHeight:V.height.button.md,minWidth:V.height.button.md,borderRadius:V.cornerRadius.md,"& svg, & img":{width:V.height.icon.md,height:V.height.icon.md}}),sm:R.css({minHeight:V.height.button.sm,minWidth:V.height.button.sm,borderRadius:V.cornerRadius.md,"& svg, & img":{width:V.height.icon.sm,height:V.height.icon.sm}}),xs:R.css({minHeight:V.height.button.xs,minWidth:V.height.button.xs,borderRadius:V.cornerRadius.sm,"& svg, & img":{width:V.height.icon.sm,height:V.height.icon.sm}}),custom:R.css({})},L_={primary:R.css({backgroundColor:V.color.fill.accentPrimary,"& svg":{color:V.color.icon.primaryInverse},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.accentPrimaryHover,"& svg":{color:V.color.icon.primaryInverse}}}),secondary:R.css({backgroundColor:V.color.fill.accentSecondary,"& svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.accentSecondaryHover,"& svg":{color:V.color.icon.primaryHover}}}),negative:R.css({backgroundColor:V.color.fill.negativeSecondary,"& svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.negativeSecondaryHover,"& svg":{color:V.color.icon.primaryHover}}}),positive:R.css({backgroundColor:V.color.fill.positiveSecondary,"& svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.positiveSecondaryHover,"& svg":{color:V.color.icon.primaryHover}}}),warning:R.css({backgroundColor:V.color.fill.warningSecondary,"& svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.warningSecondaryHover,"& svg":{color:V.color.icon.primaryHover}}}),neutral:R.css({backgroundColor:V.color.fill.neutralSecondary,"& svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.neutralSecondaryHover,"& svg":{color:V.color.icon.primaryHover}}}),transfer:R.css({backgroundColor:V.color.fill.transferSecondary,"& svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.transferSecondaryHover,"& svg":{color:V.color.icon.primaryHover}}}),"neutral-white":R.css({backgroundColor:V.color.fill.bgPrimary,"& svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.bgSecondary,"& svg":{color:V.color.icon.primaryHover}}}),"no-bg":R.css({backgroundColor:"transparent","& svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.bgSecondary,"& svg":{color:V.color.icon.primaryHover}}}),custom:R.css({})};function dr({attr:e,children:t,className:n,type:r="button",color:o="primary",size:i="md",...s}){return C.jsxs("button",{...e,...s,type:r,className:bf(P_,F_[i],L_[o],n),children:[C.jsx(No,{}),t]})}const P0=S.createContext({isOpen:!1,onClose:()=>{}}),$_=()=>S.useContext(P0),Nn=(e,t="max")=>t==="min"?`@media (min-width: ${e}px)`:`@media (max-width: ${e-1}px)`,ss={xs:(e="max")=>Nn(480,e),sm:(e="max")=>Nn(576,e),md:(e="max")=>Nn(768,e),lg:(e="max")=>Nn(992,e),xl:(e="max")=>Nn(1200,e),bp1024:(e="max")=>Nn(1024,e),bp1280:(e="max")=>Nn(1280,e),bp1440:(e="max")=>Nn(1440,e),bp1920:(e="max")=>Nn(1920,e),bp375:(e="max")=>Nn(375,e)},O_=R.keyframes`
17
+ `,Dg={rippleOverlay:R.css({position:"absolute",inset:0,pointerEvents:"none",overflow:"visible",borderRadius:"inherit",zIndex:0}),ripple:R.css({position:"absolute",borderRadius:"50%",transform:"scale(0)",transformOrigin:"center center",opacity:.36,willChange:"transform, opacity",animationName:D_,animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationFillMode:"forwards"})},Ec="button, a, input, label, [role='button'], [data-ripple]";function j_(e){if(typeof e.composedPath=="function")return e.composedPath();const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentNode||n.host;return t.push(window),t}const Lo=S.forwardRef(({color:e="rgba(0,0,0,0.18)",duration:t=1e3,radius:n="auto",className:r},o)=>{const i=S.useRef(null),[s,a]=S.useState([]),l=S.useRef([]),c=S.useRef(1),u=S.useRef(null),f=()=>{l.current.map(p=>clearTimeout(p)),l.current=[]},d=S.useCallback((p,m,x,y)=>{if(typeof window>"u")return;const v=x.getBoundingClientRect(),b=n==="auto"?Math.max(v.width,v.height)*2:n,w=p-y.left,_=m-y.top,E=Math.max(0,v.top-y.top),T=Math.max(0,v.left-y.left),k=Math.max(0,y.right-v.right),P=Math.max(0,y.bottom-v.bottom),D=window.getComputedStyle(x).borderRadius||"0px",I=c.current++,$={id:I,left:w-b/2,top:_-b/2,size:Math.ceil(b),clip:{top:Math.round(E),right:Math.round(k),bottom:Math.round(P),left:Math.round(T)},borderRadius:D};a(U=>[...U,$]);const H=window.setTimeout(()=>{a(U=>U.filter(L=>L.id!==I))},t+80);l.current.push(H)},[t,n]),h=S.useCallback(p=>{try{if(!i.current)return;const m=i.current,x=m.parentElement;if(!x)return;const y=j_(p);let v=null;for(const T of y)if(T instanceof Element){if(T===x)break;if(T.matches&&T.matches(Ec)){v=T;break}}if(v||(v=x),v.closest&&(v.closest("[disabled]")||v.getAttribute("aria-disabled")==="true"||v.classList.contains("ripple-disabled")))return;const b=p.target;if(b?.closest&&(b.closest("[disabled]")||b.getAttribute?.("aria-disabled")==="true"))return;const w=m.getBoundingClientRect(),{clientX:_}=p,{clientY:E}=p;d(_,E,v,w)}catch{}},[d]),g=S.useCallback(p=>{if(!i.current||!(p.key==="Enter"||p.key===" "))return;const m=i.current,x=m.parentElement;if(!x)return;const y=document.activeElement;let v=null;if(y instanceof Element&&y.matches(Ec)&&(v=y),v||(v=x),v.closest&&(v.closest("[disabled]")||v.getAttribute("aria-disabled")==="true"))return;const b=m.getBoundingClientRect(),w=v.getBoundingClientRect().left+v.getBoundingClientRect().width/2,_=v.getBoundingClientRect().top+v.getBoundingClientRect().height/2;d(w,_,v,b)},[d]);return S.useImperativeHandle(o,()=>({trigger:({center:p=!0,x:m,y:x}={})=>{const y=i.current;if(!y)return;const v=y.parentElement;if(!v)return;const b=y.getBoundingClientRect(),w=document.activeElement instanceof Element&&document.activeElement.matches(Ec)?document.activeElement:v,_=p?w.getBoundingClientRect().left+w.getBoundingClientRect().width/2:m??b.left+b.width/2,E=p?w.getBoundingClientRect().top+w.getBoundingClientRect().height/2:x??b.top+b.height/2;d(_,E,w,b)}}),[d]),S.useEffect(()=>{const p=i.current;if(!p)return;const m=p.parentElement;if(!m||typeof window>"u")return;const x=window.getComputedStyle(m);let y=!1;return x.position==="static"&&(m.style.position="relative",y=!0,u.current=m),m.addEventListener("pointerdown",h,!0),m.addEventListener("keydown",g),()=>{m.removeEventListener("pointerdown",h,!0),m.removeEventListener("keydown",g),y&&u.current&&(u.current.style.position="",u.current=null),f()}},[h,g]),S.useEffect(()=>()=>f(),[]),C.jsx("div",{ref:i,className:`${Dg.rippleOverlay} ${r??""}`,"aria-hidden":!0,children:s.map(p=>C.jsx("span",{className:Dg.ripple,style:{left:`${p.left}px`,top:`${p.top}px`,width:`${p.size}px`,height:`${p.size}px`,backgroundColor:e,animationDuration:`${t}ms`,clipPath:`inset(${p.clip.top}px ${p.clip.right}px ${p.clip.bottom}px ${p.clip.left}px round ${p.borderRadius})`}},p.id))})}),V_=R.css({display:"flex",alignItems:"center",justifyContent:"center",transition:j.transition.general,position:"relative",overflow:"hidden","& svg":{transition:j.transition.general},"&:disabled":{opacity:.5}}),B_={md:R.css({minHeight:j.height.button.md,minWidth:j.height.button.md,borderRadius:j.cornerRadius.md,"& svg, & img":{width:j.height.icon.md,height:j.height.icon.md}}),sm:R.css({minHeight:j.height.button.sm,minWidth:j.height.button.sm,borderRadius:j.cornerRadius.md,"& svg, & img":{width:j.height.icon.sm,height:j.height.icon.sm}}),xs:R.css({minHeight:j.height.button.xs,minWidth:j.height.button.xs,borderRadius:j.cornerRadius.sm,"& svg, & img":{width:j.height.icon.sm,height:j.height.icon.sm}}),custom:R.css({})},z_={primary:R.css({backgroundColor:j.color.fill.accentPrimary,"& svg":{color:j.color.icon.primaryInverse},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.accentPrimaryHover,"& svg":{color:j.color.icon.primaryInverse}}}),secondary:R.css({backgroundColor:j.color.fill.accentSecondary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.accentSecondaryHover,"& svg":{color:j.color.icon.primaryHover}}}),negative:R.css({backgroundColor:j.color.fill.negativeSecondary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.negativeSecondaryHover,"& svg":{color:j.color.icon.primaryHover}}}),positive:R.css({backgroundColor:j.color.fill.positiveSecondary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.positiveSecondaryHover,"& svg":{color:j.color.icon.primaryHover}}}),warning:R.css({backgroundColor:j.color.fill.warningSecondary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.warningSecondaryHover,"& svg":{color:j.color.icon.primaryHover}}}),neutral:R.css({backgroundColor:j.color.fill.neutralSecondary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.neutralSecondaryHover,"& svg":{color:j.color.icon.primaryHover}}}),transfer:R.css({backgroundColor:j.color.fill.transferSecondary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.transferSecondaryHover,"& svg":{color:j.color.icon.primaryHover}}}),"neutral-white":R.css({backgroundColor:j.color.fill.bgPrimary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.bgSecondary,"& svg":{color:j.color.icon.primaryHover}}}),"no-bg":R.css({backgroundColor:"transparent","& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.bgSecondary,"& svg":{color:j.color.icon.primaryHover}}}),custom:R.css({})};function fr({attr:e,children:t,className:n,type:r="button",color:o="primary",size:i="md",...s}){return C.jsxs("button",{...e,...s,type:r,className:Sf(V_,B_[i],z_[o],n),children:[C.jsx(Lo,{}),t]})}const $0=S.createContext({isOpen:!1,onClose:()=>{}}),H_=()=>S.useContext($0),Nn=(e,t="max")=>t==="min"?`@media (min-width: ${e}px)`:`@media (max-width: ${e-1}px)`,ls={xs:(e="max")=>Nn(480,e),sm:(e="max")=>Nn(576,e),md:(e="max")=>Nn(768,e),lg:(e="max")=>Nn(992,e),xl:(e="max")=>Nn(1200,e),bp1024:(e="max")=>Nn(1024,e),bp1280:(e="max")=>Nn(1280,e),bp1440:(e="max")=>Nn(1440,e),bp1920:(e="max")=>Nn(1920,e),bp375:(e="max")=>Nn(375,e)},W_=R.keyframes`
18
18
  0% {
19
19
  opacity: 0;
20
20
  transform: scale(0.95);
@@ -23,7 +23,7 @@
23
23
  opacity: 1;
24
24
  transform: none;
25
25
  }
26
- `,la={overlay:R.css({backdropFilter:"blur(5px)"}),modal:R.css({animationDuration:"0.2s",animationTimingFunction:"ease-in-out",animationName:O_,maxWidth:`calc(100vw - ${V.spacing["3xl"]})`,maxHeight:`calc(100vh - ${V.spacing["7xl"]} - ${V.spacing["7xl"]})`,borderRadius:V.cornerRadius["2xl"],backgroundColor:V.color.fill.bgPrimary,boxShadow:`0 4px 20px 0 ${V.color.effect.shadowS}`,[ss.sm()]:{flex:1}}),closeButton:R.css({position:"absolute",zIndex:1,top:V.spacing.lg,right:V.spacing.lg}),size_lg:R.css({width:874}),size_md:R.css({width:650}),size_sm:R.css({width:426})},F0=S.forwardRef(({isOpen:e,onClose:t,overlayClassName:n,modalClassName:r,size:o="md",closeOnBackdropClick:i=!0,closeOnEsc:s=!0,disableBodyScroll:a=!0,showAbsoluteCloseButton:l,children:c},u)=>{S.useEffect(()=>{if(a&&e&&typeof window<"u"&&typeof document<"u"){const h=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h}}},[e,a]);const f=S.useCallback(h=>{h.key==="Escape"&&t()},[t]);S.useEffect(()=>{if(typeof window<"u"&&typeof document<"u"&&s&&e)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,s,f]);const d=S.useCallback(h=>{i&&h.target===h.currentTarget&&t()},[i,t]);return e?C.jsx(Hi,{children:C.jsx(P0.Provider,{value:{isOpen:e,onClose:t},children:C.jsx(G,{position:"fixed",top:0,right:0,bottom:0,left:0,row:!0,center:!0,flex:1,onClick:d,backgroundColor:V.color.fill.bgOverlayPrimary,className:R.cx(la.overlay,n),zIndex:1,children:C.jsxs(G,{ref:u,className:R.cx(la.modal,la[`size_${o}`],r),relative:!0,children:[l&&C.jsx(dr,{className:la.closeButton,onClick:t,color:"neutral",children:C.jsx(N0,{})}),c]})})})}):null});F0.displayName="Modal";const I_=R.css({borderTop:`1px solid ${V.color.border.neutralAlphaBasic}`}),L0=S.forwardRef(({children:e,row:t=!0,flex:n=!0,gap:r=V.spacing.lg,p:o=V.spacing["2xl"],className:i,...s},a)=>C.jsx(G,{flex:n,row:t,gap:r,p:o,className:R.cx(I_,i),ref:a,...s,children:e}));L0.displayName="ModalFooter";const wf=S.createContext({});function Cf(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const Sf=typeof window<"u",$0=Sf?S.useLayoutEffect:S.useEffect,Fl=S.createContext(null);function _f(e,t){e.indexOf(t)===-1&&e.push(t)}function Tf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const hr=(e,t,n)=>n>t?t:n<e?e:n;function Ku(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Ai=()=>{},gr=()=>{};process.env.NODE_ENV!=="production"&&(Ai=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Ku(t,n))},gr=(e,t,n)=>{if(!e)throw new Error(Ku(t,n))});const pr={},O0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function I0(e){return typeof e=="object"&&e!==null}const D0=e=>/^0[^.\s]+$/u.test(e);function Ef(e){let t;return()=>(t===void 0&&(t=e()),t)}const an=e=>e,D_=(e,t)=>n=>t(e(n)),Ds=(...e)=>e.reduce(D_),_s=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Rf{constructor(){this.subscriptions=[]}add(t){return _f(this.subscriptions,t),()=>Tf(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const s=this.subscriptions[i];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Cn=e=>e*1e3,sn=e=>e/1e3;function V0(e,t){return t?e*(1e3/t):0}const Og=new Set;function kf(e,t,n){e||Og.has(t)||(console.warn(Ku(t,n)),Og.add(t))}const j0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,V_=1e-7,j_=12;function B_(e,t,n,r,o){let i,s,a=0;do s=t+(n-t)/2,i=j0(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>V_&&++a<j_);return s}function Vs(e,t,n,r){if(e===t&&n===r)return an;const o=i=>B_(i,0,1,e,n);return i=>i===0||i===1?i:j0(o(i),t,r)}const B0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,z0=e=>t=>1-e(1-t),H0=Vs(.33,1.53,.69,.99),Af=z0(H0),W0=B0(Af),K0=e=>(e*=2)<1?.5*Af(e):.5*(2-Math.pow(2,-10*(e-1))),Mf=e=>1-Math.sin(Math.acos(e)),U0=z0(Mf),G0=B0(Mf),z_=Vs(.42,0,1,1),H_=Vs(0,0,.58,1),q0=Vs(.42,0,.58,1),W_=e=>Array.isArray(e)&&typeof e[0]!="number",Y0=e=>Array.isArray(e)&&typeof e[0]=="number",Ig={linear:an,easeIn:z_,easeInOut:q0,easeOut:H_,circIn:Mf,circInOut:G0,circOut:U0,backIn:Af,backInOut:W0,backOut:H0,anticipate:K0},K_=e=>typeof e=="string",Dg=e=>{if(Y0(e)){gr(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return Vs(t,n,r,o)}else if(K_(e))return gr(Ig[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ig[e];return e},ca=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function U_(e,t){let n=new Set,r=new Set,o=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,f=!1,d=!1)=>{const g=d&&o?n:r;return f&&s.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(a=u,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(l),n.clear(),o=!1,i&&(i=!1,c.process(u))}};return c}const G_=40;function X0(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=ca.reduce((v,b)=>(v[b]=U_(i),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:d,render:h,postRender:g}=s,p=()=>{const v=pr.useManualTiming?o.timestamp:performance.now();n=!1,pr.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(v-o.timestamp,G_),1)),o.timestamp=v,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),f.process(o),d.process(o),h.process(o),g.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,o.isProcessing||e(p)};return{schedule:ca.reduce((v,b)=>{const w=s[b];return v[b]=(_,E=!1,T=!1)=>(n||m(),w.schedule(_,E,T)),v},{}),cancel:v=>{for(let b=0;b<ca.length;b++)s[ca[b]].cancel(v)},state:o,steps:s}}const{schedule:Ue,cancel:Lr,state:ht,steps:Sc}=X0(typeof requestAnimationFrame<"u"?requestAnimationFrame:an,!0);let ja;function q_(){ja=void 0}const Ot={now:()=>(ja===void 0&&Ot.set(ht.isProcessing||pr.useManualTiming?ht.timestamp:performance.now()),ja),set:e=>{ja=e,queueMicrotask(q_)}},Z0=e=>t=>typeof t=="string"&&t.startsWith(e),J0=Z0("--"),Y_=Z0("var(--"),Nf=e=>Y_(e)?X_.test(e.split("/*")[0].trim()):!1,X_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Mi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ts={...Mi,transform:e=>hr(0,1,e)},ua={...Mi,default:1},hs=e=>Math.round(e*1e5)/1e5,Pf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Z_(e){return e==null}const J_=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ff=(e,t)=>n=>!!(typeof n=="string"&&J_.test(n)&&n.startsWith(e)||t&&!Z_(n)&&Object.prototype.hasOwnProperty.call(n,t)),Q0=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,s,a]=r.match(Pf);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},Q_=e=>hr(0,255,e),_c={...Mi,transform:e=>Math.round(Q_(e))},ao={test:Ff("rgb","red"),parse:Q0("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+_c.transform(e)+", "+_c.transform(t)+", "+_c.transform(n)+", "+hs(Ts.transform(r))+")"};function eT(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Uu={test:Ff("#"),parse:eT,transform:ao.transform},js=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Sr=js("deg"),Vn=js("%"),he=js("px"),tT=js("vh"),nT=js("vw"),Vg={...Vn,parse:e=>Vn.parse(e)/100,transform:e=>Vn.transform(e*100)},ni={test:Ff("hsl","hue"),parse:Q0("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Vn.transform(hs(t))+", "+Vn.transform(hs(n))+", "+hs(Ts.transform(r))+")"},nt={test:e=>ao.test(e)||Uu.test(e)||ni.test(e),parse:e=>ao.test(e)?ao.parse(e):ni.test(e)?ni.parse(e):Uu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ao.transform(e):ni.transform(e),getAnimatableNone:e=>{const t=nt.parse(e);return t.alpha=0,nt.transform(t)}},rT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function oT(e){return isNaN(e)&&typeof e=="string"&&(e.match(Pf)?.length||0)+(e.match(rT)?.length||0)>0}const ex="number",tx="color",iT="var",sT="var(",jg="${}",aT=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Es(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const a=t.replace(aT,l=>(nt.test(l)?(r.color.push(i),o.push(tx),n.push(nt.parse(l))):l.startsWith(sT)?(r.var.push(i),o.push(iT),n.push(l)):(r.number.push(i),o.push(ex),n.push(parseFloat(l))),++i,jg)).split(jg);return{values:n,split:a,indexes:r,types:o}}function nx(e){return Es(e).values}function rx(e){const{split:t,types:n}=Es(e),r=t.length;return o=>{let i="";for(let s=0;s<r;s++)if(i+=t[s],o[s]!==void 0){const a=n[s];a===ex?i+=hs(o[s]):a===tx?i+=nt.transform(o[s]):i+=o[s]}return i}}const lT=e=>typeof e=="number"?0:nt.test(e)?nt.getAnimatableNone(e):e;function cT(e){const t=nx(e);return rx(e)(t.map(lT))}const $r={test:oT,parse:nx,createTransformer:rx,getAnimatableNone:cT};function Tc(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function uT({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Tc(l,a,e+1/3),i=Tc(l,a,e),s=Tc(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}function tl(e,t){return n=>n>0?t:e}const Ze=(e,t,n)=>e+(t-e)*n,Ec=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},dT=[Uu,ao,ni],fT=e=>dT.find(t=>t.test(e));function Bg(e){const t=fT(e);if(Ai(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===ni&&(n=uT(n)),n}const zg=(e,t)=>{const n=Bg(e),r=Bg(t);if(!n||!r)return tl(e,t);const o={...n};return i=>(o.red=Ec(n.red,r.red,i),o.green=Ec(n.green,r.green,i),o.blue=Ec(n.blue,r.blue,i),o.alpha=Ze(n.alpha,r.alpha,i),ao.transform(o))},Gu=new Set(["none","hidden"]);function hT(e,t){return Gu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function gT(e,t){return n=>Ze(e,t,n)}function Lf(e){return typeof e=="number"?gT:typeof e=="string"?Nf(e)?tl:nt.test(e)?zg:yT:Array.isArray(e)?ox:typeof e=="object"?nt.test(e)?zg:pT:tl}function ox(e,t){const n=[...e],r=n.length,o=e.map((i,s)=>Lf(i)(i,t[s]));return i=>{for(let s=0;s<r;s++)n[s]=o[s](i);return n}}function pT(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Lf(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function mT(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],s=e.indexes[i][r[i]],a=e.values[s]??0;n[o]=a,r[i]++}return n}const yT=(e,t)=>{const n=$r.createTransformer(t),r=Es(e),o=Es(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Gu.has(e)&&!o.values.length||Gu.has(t)&&!r.values.length?hT(e,t):Ds(ox(mT(r,o),o.values),n):(Ai(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),tl(e,t))};function ix(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ze(e,t,n):Lf(e)(e,t)}const vT=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Ue.update(t,n),stop:()=>Lr(t),now:()=>ht.isProcessing?ht.timestamp:Ot.now()}},sx=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=Math.round(e(i/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},nl=2e4;function $f(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<nl;)t+=n,r=e.next(t);return t>=nl?1/0:t}function xT(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min($f(r),nl);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:sn(o)}}const bT=5;function ax(e,t,n){const r=Math.max(t-bT,0);return V0(n-e(r),t-r)}const Ye={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Rc=.001;function wT({duration:e=Ye.duration,bounce:t=Ye.bounce,velocity:n=Ye.velocity,mass:r=Ye.mass}){let o,i;Ai(e<=Cn(Ye.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=hr(Ye.minDamping,Ye.maxDamping,s),e=hr(Ye.minDuration,Ye.maxDuration,sn(e)),s<1?(o=c=>{const u=c*s,f=u*e,d=u-n,h=qu(c,s),g=Math.exp(-f);return Rc-d/h*g},i=c=>{const f=c*s*e,d=f*n+n,h=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-f),p=qu(Math.pow(c,2),s);return(-o(c)+Rc>0?-1:1)*((d-h)*g)/p}):(o=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Rc+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=ST(o,i,a);if(e=Cn(e),isNaN(l))return{stiffness:Ye.stiffness,damping:Ye.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const CT=12;function ST(e,t,n){let r=n;for(let o=1;o<CT;o++)r=r-e(r)/t(r);return r}function qu(e,t){return e*Math.sqrt(1-t*t)}const _T=["duration","bounce"],TT=["stiffness","damping","mass"];function Hg(e,t){return t.some(n=>e[n]!==void 0)}function ET(e){let t={velocity:Ye.velocity,stiffness:Ye.stiffness,damping:Ye.damping,mass:Ye.mass,isResolvedFromDuration:!1,...e};if(!Hg(e,TT)&&Hg(e,_T))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*hr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Ye.mass,stiffness:o,damping:i}}else{const n=wT(e);t={...t,...n,mass:Ye.mass},t.isResolvedFromDuration=!0}return t}function rl(e=Ye.visualDuration,t=Ye.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:d,isResolvedFromDuration:h}=ET({...n,velocity:-sn(n.velocity||0)}),g=d||0,p=c/(2*Math.sqrt(l*u)),m=s-i,x=sn(Math.sqrt(l/u)),y=Math.abs(m)<5;r||(r=y?Ye.restSpeed.granular:Ye.restSpeed.default),o||(o=y?Ye.restDelta.granular:Ye.restDelta.default);let v;if(p<1){const w=qu(x,p);v=_=>{const E=Math.exp(-p*x*_);return s-E*((g+p*x*m)/w*Math.sin(w*_)+m*Math.cos(w*_))}}else if(p===1)v=w=>s-Math.exp(-x*w)*(m+(g+x*m)*w);else{const w=x*Math.sqrt(p*p-1);v=_=>{const E=Math.exp(-p*x*_),T=Math.min(w*_,300);return s-E*((g+p*x*m)*Math.sinh(T)+w*m*Math.cosh(T))/w}}const b={calculatedDuration:h&&f||null,next:w=>{const _=v(w);if(h)a.done=w>=f;else{let E=w===0?g:0;p<1&&(E=w===0?Cn(g):ax(v,w,_));const T=Math.abs(E)<=r,k=Math.abs(s-_)<=o;a.done=T&&k}return a.value=a.done?s:_,a},toString:()=>{const w=Math.min($f(b),nl),_=sx(E=>b.next(w*E).value,w,30);return w+"ms "+_},toTransition:()=>{}};return b}rl.applyToOptions=e=>{const t=xT(e,100,rl);return e.ease=t.ease,e.duration=Cn(t.duration),e.type="keyframes",e};function Yu({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],d={done:!1,value:f},h=T=>a!==void 0&&T<a||l!==void 0&&T>l,g=T=>a===void 0?l:l===void 0||Math.abs(a-T)<Math.abs(l-T)?a:l;let p=n*t;const m=f+p,x=s===void 0?m:s(m);x!==m&&(p=x-f);const y=T=>-p*Math.exp(-T/r),v=T=>x+y(T),b=T=>{const k=y(T),P=v(T);d.done=Math.abs(k)<=c,d.value=d.done?x:P};let w,_;const E=T=>{h(d.value)&&(w=T,_=rl({keyframes:[d.value,g(d.value)],velocity:ax(v,T,d.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:T=>{let k=!1;return!_&&w===void 0&&(k=!0,b(T),E(T)),w!==void 0&&T>=w?_.next(T-w):(!k&&b(T),d)}}}function RT(e,t,n){const r=[],o=n||pr.mix||ix,i=e.length-1;for(let s=0;s<i;s++){let a=o(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||an:t;a=Ds(l,a)}r.push(a)}return r}function kT(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(gr(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=RT(t,r,o),l=a.length,c=u=>{if(s&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const d=_s(e[f],e[f+1],u);return a[f](d)};return n?u=>c(hr(e[0],e[i-1],u)):c}function AT(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=_s(0,t,r);e.push(Ze(n,1,o))}}function MT(e){const t=[0];return AT(t,e.length-1),t}function NT(e,t){return e.map(n=>n*t)}function PT(e,t){return e.map(()=>t||q0).splice(0,e.length-1)}function ri({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=W_(r)?r.map(Dg):Dg(r),i={done:!1,value:t[0]},s=NT(n&&n.length===t.length?n:MT(t),e),a=kT(s,t,{ease:Array.isArray(o)?o:PT(t,o)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const FT=e=>e!==null;function Of(e,{repeat:t,repeatType:n="loop"},r,o=1){const i=e.filter(FT),a=o<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const LT={decay:Yu,inertia:Yu,tween:ri,keyframes:ri,spring:rl};function lx(e){typeof e.type=="string"&&(e.type=LT[e.type])}class If{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const $T=e=>e/100;class Df extends If{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Ot.now()&&this.tick(Ot.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;lx(t);const{type:n=ri,repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:s=0}=t;let{keyframes:a}=t;const l=n||ri;process.env.NODE_ENV!=="production"&&l!==ri&&gr(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==ri&&typeof a[0]!="number"&&(this.mixKeyframes=Ds($T,ix(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=$f(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:d,repeatDelay:h,type:g,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const x=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?x<0:x>o;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let v=this.currentTime,b=r;if(f){const T=Math.min(this.currentTime,o)/a;let k=Math.floor(T),P=T%1;!P&&T>=1&&(P=1),P===1&&k--,k=Math.min(k,f+1),k%2&&(d==="reverse"?(P=1-P,h&&(P-=h/a)):d==="mirror"&&(b=s)),v=hr(0,1,P)*a}const w=y?{done:!1,value:u[0]}:b.next(v);i&&(w.value=i(w.value));let{done:_}=w;!y&&l!==null&&(_=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return E&&g!==Yu&&(w.value=Of(u,this.options,m,this.speed)),p&&p(w.value),E&&this.finish(),w}then(t,n){return this.finished.then(t,n)}get duration(){return sn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sn(t)}get time(){return sn(this.currentTime)}set time(t){t=Cn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Ot.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=sn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=vT,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ot.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function OT(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const lo=e=>e*180/Math.PI,Xu=e=>{const t=lo(Math.atan2(e[1],e[0]));return Zu(t)},IT={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Xu,rotateZ:Xu,skewX:e=>lo(Math.atan(e[1])),skewY:e=>lo(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Zu=e=>(e=e%360,e<0&&(e+=360),e),Wg=Xu,Kg=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ug=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),DT={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Kg,scaleY:Ug,scale:e=>(Kg(e)+Ug(e))/2,rotateX:e=>Zu(lo(Math.atan2(e[6],e[5]))),rotateY:e=>Zu(lo(Math.atan2(-e[2],e[0]))),rotateZ:Wg,rotate:Wg,skewX:e=>lo(Math.atan(e[4])),skewY:e=>lo(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ju(e){return e.includes("scale")?1:0}function Qu(e,t){if(!e||e==="none")return Ju(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=DT,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=IT,o=a}if(!o)return Ju(t);const i=r[t],s=o[1].split(",").map(jT);return typeof i=="function"?i(s):s[i]}const VT=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Qu(n,t)};function jT(e){return parseFloat(e.trim())}const Ni=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pi=new Set(Ni),Gg=e=>e===Mi||e===he,BT=new Set(["x","y","z"]),zT=Ni.filter(e=>!BT.has(e));function HT(e){const t=[];return zT.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const fo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Qu(t,"x"),y:(e,{transform:t})=>Qu(t,"y")};fo.translateX=fo.x;fo.translateY=fo.y;const ho=new Set;let ed=!1,td=!1,nd=!1;function cx(){if(td){const e=Array.from(ho).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=HT(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,s])=>{r.getValue(i)?.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}td=!1,ed=!1,ho.forEach(e=>e.complete(nd)),ho.clear()}function ux(){ho.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(td=!0)})}function WT(){nd=!0,ux(),cx(),nd=!1}class Vf{constructor(t,n,r,o,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(ho.add(this),ed||(ed=!0,Ue.read(ux),Ue.resolveKeyframes(cx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const i=o?.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),o&&i===void 0&&o.set(t[0])}OT(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ho.delete(this)}cancel(){this.state==="scheduled"&&(ho.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const KT=e=>e.startsWith("--");function UT(e,t,n){KT(t)?e.style.setProperty(t,n):e.style[t]=n}const GT=Ef(()=>window.ScrollTimeline!==void 0),qT={};function YT(e,t){const n=Ef(e);return()=>qT[t]??n()}const dx=YT(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),as=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,qg={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:as([0,.65,.55,1]),circOut:as([.55,0,1,.45]),backIn:as([.31,.01,.66,-.59]),backOut:as([.33,1.53,.69,.99])};function fx(e,t){if(e)return typeof e=="function"?dx()?sx(e,t):"ease-out":Y0(e)?as(e):Array.isArray(e)?e.map(n=>fx(n,t)||qg.easeOut):qg[e]}function XT(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const f=fx(a,o);Array.isArray(f)&&(u.easing=f);const d={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return c&&(d.pseudoElement=c),e.animate(u,d)}function hx(e){return typeof e=="function"&&"applyToOptions"in e}function ZT({type:e,...t}){return hx(e)&&dx()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class JT extends If{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,gr(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=ZT(t);this.animation=XT(n,r,o,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Of(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):UT(n,r,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return sn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sn(t)}get time(){return sn(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Cn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&GT()?(this.animation.timeline=t,an):n(this)}}const gx={anticipate:K0,backInOut:W0,circInOut:G0};function QT(e){return e in gx}function eE(e){typeof e.ease=="string"&&QT(e.ease)&&(e.ease=gx[e.ease])}const Yg=10;class tE extends JT{constructor(t){eE(t),lx(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:i,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Df({...s,autoplay:!1}),l=Cn(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-Yg).value,a.sample(l).value,Yg),a.stop()}}const Xg=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&($r.test(e)||e==="0")&&!e.startsWith("url("));function nE(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function rE(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],s=Xg(o,t),a=Xg(i,t);return Ai(s===a,`You are trying to animate ${t} from "${o}" to "${i}". "${s?i:o}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:nE(e)||(n==="spring"||hx(n))&&r}function rd(e){e.duration=0,e.type="keyframes"}const oE=new Set(["opacity","clipPath","filter","transform"]),iE=Ef(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function sE(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return iE()&&n&&oE.has(n)&&(n!=="transform"||!c)&&!l&&!r&&o!=="mirror"&&i!==0&&s!=="inertia"}const aE=40;class lE extends If{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:s="loop",keyframes:a,name:l,motionValue:c,element:u,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ot.now();const d={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:s,name:l,motionValue:c,element:u,...f},h=u?.KeyframeResolver||Vf;this.keyframeResolver=new h(a,(g,p,m)=>this.onKeyframesResolved(g,p,d,!m),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:i,type:s,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Ot.now(),rE(t,i,s,a)||((pr.instantAnimations||!l)&&u?.(Of(t,r,n)),t[0]=t[t.length-1],rd(r),r.repeat=0);const d={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>aE?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!c&&sE(d)?new tE({...d,element:d.motionValue.owner.current}):new Df(d);h.finished.then(()=>this.notifyFinished()).catch(an),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),WT()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const cE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function uE(e){const t=cE.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const dE=4;function px(e,t,n=1){gr(n<=dE,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=uE(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const s=i.trim();return O0(s)?parseFloat(s):s}return Nf(o)?px(o,t,n+1):o}function jf(e,t){return e?.[t]??e?.default??e}const mx=new Set(["width","height","top","left","right","bottom",...Ni]),fE={test:e=>e==="auto",parse:e=>e},yx=e=>t=>t.test(e),vx=[Mi,he,Vn,Sr,nT,tT,fE],Zg=e=>vx.find(yx(e));function hE(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||D0(e):!0}const gE=new Set(["brightness","contrast","saturate","opacity"]);function pE(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Pf)||[];if(!r)return e;const o=n.replace(r,"");let i=gE.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const mE=/\b([a-z-]*)\(.*?\)/gu,od={...$r,getAnimatableNone:e=>{const t=e.match(mE);return t?t.map(pE).join(" "):e}},Jg={...Mi,transform:Math.round},yE={rotate:Sr,rotateX:Sr,rotateY:Sr,rotateZ:Sr,scale:ua,scaleX:ua,scaleY:ua,scaleZ:ua,skew:Sr,skewX:Sr,skewY:Sr,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:Ts,originX:Vg,originY:Vg,originZ:he},Bf={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,radius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,backgroundPositionX:he,backgroundPositionY:he,...yE,zIndex:Jg,fillOpacity:Ts,strokeOpacity:Ts,numOctaves:Jg},vE={...Bf,color:nt,backgroundColor:nt,outlineColor:nt,fill:nt,stroke:nt,borderColor:nt,borderTopColor:nt,borderRightColor:nt,borderBottomColor:nt,borderLeftColor:nt,filter:od,WebkitFilter:od},xx=e=>vE[e];function bx(e,t){let n=xx(e);return n!==od&&(n=$r),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const xE=new Set(["auto","none","0"]);function bE(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!xE.has(i)&&Es(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=bx(n,o)}class wE extends Vf{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Nf(c))){const u=px(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!mx.has(r)||t.length!==2)return;const[o,i]=t,s=Zg(o),a=Zg(i);if(s!==a)if(Gg(s)&&Gg(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else fo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||hE(t[o]))&&r.push(o);r.length&&bE(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=fo[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=fo[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{t.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function CE(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=n?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const wx=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Cx(e){return I0(e)&&"offsetHeight"in e}const Qg=30,SE=e=>!isNaN(parseFloat(e));class _E{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=Ot.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ot.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=SE(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&kf(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Rf);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ot.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Qg)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Qg);return V0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xi(e,t){return new _E(e,t)}const{schedule:zf}=X0(queueMicrotask,!1),yn={x:!1,y:!1};function Sx(){return yn.x||yn.y}function TE(e){return e==="x"||e==="y"?yn[e]?null:(yn[e]=!0,()=>{yn[e]=!1}):yn.x||yn.y?null:(yn.x=yn.y=!0,()=>{yn.x=yn.y=!1})}function _x(e,t){const n=CE(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function ep(e){return!(e.pointerType==="touch"||Sx())}function EE(e,t,n={}){const[r,o,i]=_x(e,n),s=a=>{if(!ep(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=f=>{ep(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",s,o)}),i}const Tx=(e,t)=>t?e===t?!0:Tx(e,t.parentElement):!1,Hf=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,RE=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function kE(e){return RE.has(e.tagName)||e.tabIndex!==-1}const Ba=new WeakSet;function tp(e){return t=>{t.key==="Enter"&&e(t)}}function kc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const AE=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=tp(()=>{if(Ba.has(n))return;kc(n,"down");const o=tp(()=>{kc(n,"up")}),i=()=>kc(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function np(e){return Hf(e)&&!Sx()}function ME(e,t,n={}){const[r,o,i]=_x(e,n),s=a=>{const l=a.currentTarget;if(!np(a))return;Ba.add(l);const c=t(l,a),u=(h,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),Ba.has(l)&&Ba.delete(l),np(h)&&typeof c=="function"&&c(h,{success:g})},f=h=>{u(h,l===window||l===document||n.useGlobalTarget||Tx(l,h.target))},d=h=>{u(h,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",d,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,o),Cx(a)&&(a.addEventListener("focus",c=>AE(c,o)),!kE(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Ex(e){return I0(e)&&"ownerSVGElement"in e}function NE(e){return Ex(e)&&e.tagName==="svg"}const wt=e=>!!(e&&e.getVelocity),PE=[...vx,nt,$r],FE=e=>PE.find(yx(e)),Wf=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function rp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function LE(...e){return t=>{let n=!1;const r=e.map(o=>{const i=rp(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():rp(e[o],null)}}}}function $E(...e){return M.useCallback(LE(...e),e)}class OE extends M.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=Cx(r)&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=o-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function IE({children:e,isPresent:t,anchorX:n,root:r}){const o=S.useId(),i=S.useRef(null),s=S.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=S.useContext(Wf),l=$E(i,e?.ref);return S.useInsertionEffect(()=>{const{width:c,height:u,top:f,left:d,right:h}=s.current;if(t||!i.current||!c||!u)return;const g=n==="left"?`left: ${d}`:`right: ${h}`;i.current.dataset.motionPopId=o;const p=document.createElement("style");a&&(p.nonce=a);const m=r??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(`
26
+ `,da={overlay:R.css({backdropFilter:"blur(5px)"}),modal:R.css({animationDuration:"0.2s",animationTimingFunction:"ease-in-out",animationName:W_,maxWidth:`calc(100vw - ${j.spacing["3xl"]})`,maxHeight:`calc(100vh - ${j.spacing["7xl"]} - ${j.spacing["7xl"]})`,borderRadius:j.cornerRadius["2xl"],backgroundColor:j.color.fill.bgPrimary,boxShadow:`0 4px 20px 0 ${j.color.effect.shadowS}`,[ls.sm()]:{flex:1}}),closeButton:R.css({position:"absolute",zIndex:1,top:j.spacing.lg,right:j.spacing.lg}),size_lg:R.css({width:874}),size_md:R.css({width:650}),size_sm:R.css({width:426})},O0=S.forwardRef(({isOpen:e,onClose:t,overlayClassName:n,modalClassName:r,size:o="md",closeOnBackdropClick:i=!0,closeOnEsc:s=!0,disableBodyScroll:a=!0,showAbsoluteCloseButton:l,children:c},u)=>{S.useEffect(()=>{if(a&&e&&typeof window<"u"&&typeof document<"u"){const h=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h}}},[e,a]);const f=S.useCallback(h=>{h.key==="Escape"&&t()},[t]);S.useEffect(()=>{if(typeof window<"u"&&typeof document<"u"&&s&&e)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,s,f]);const d=S.useCallback(h=>{i&&h.target===h.currentTarget&&t()},[i,t]);return e?C.jsx(Ki,{children:C.jsx($0.Provider,{value:{isOpen:e,onClose:t},children:C.jsx(G,{position:"fixed",top:0,right:0,bottom:0,left:0,row:!0,center:!0,flex:1,onClick:d,backgroundColor:j.color.fill.bgOverlayPrimary,className:R.cx(da.overlay,n),zIndex:1,children:C.jsxs(G,{ref:u,className:R.cx(da.modal,da[`size_${o}`],r),relative:!0,children:[l&&C.jsx(fr,{className:da.closeButton,onClick:t,color:"neutral",children:C.jsx(F0,{})}),c]})})})}):null});O0.displayName="Modal";const K_=R.css({borderTop:`1px solid ${j.color.border.neutralAlphaBasic}`}),I0=S.forwardRef(({children:e,row:t=!0,flex:n=!0,gap:r=j.spacing.lg,p:o=j.spacing["2xl"],className:i,...s},a)=>C.jsx(G,{flex:n,row:t,gap:r,p:o,className:R.cx(K_,i),ref:a,...s,children:e}));I0.displayName="ModalFooter";const _f=S.createContext({});function Tf(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const Ef=typeof window<"u",D0=Ef?S.useLayoutEffect:S.useEffect,Il=S.createContext(null);function Rf(e,t){e.indexOf(t)===-1&&e.push(t)}function kf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const gr=(e,t,n)=>n>t?t:n<e?e:n;function Yu(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Ni=()=>{},pr=()=>{};process.env.NODE_ENV!=="production"&&(Ni=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Yu(t,n))},pr=(e,t,n)=>{if(!e)throw new Error(Yu(t,n))});const mr={},j0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function V0(e){return typeof e=="object"&&e!==null}const B0=e=>/^0[^.\s]+$/u.test(e);function Af(e){let t;return()=>(t===void 0&&(t=e()),t)}const an=e=>e,U_=(e,t)=>n=>t(e(n)),Vs=(...e)=>e.reduce(U_),Es=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Mf{constructor(){this.subscriptions=[]}add(t){return Rf(this.subscriptions,t),()=>kf(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const s=this.subscriptions[i];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Cn=e=>e*1e3,sn=e=>e/1e3;function z0(e,t){return t?e*(1e3/t):0}const jg=new Set;function Nf(e,t,n){e||jg.has(t)||(console.warn(Yu(t,n)),jg.add(t))}const H0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,G_=1e-7,q_=12;function Y_(e,t,n,r,o){let i,s,a=0;do s=t+(n-t)/2,i=H0(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>G_&&++a<q_);return s}function Bs(e,t,n,r){if(e===t&&n===r)return an;const o=i=>Y_(i,0,1,e,n);return i=>i===0||i===1?i:H0(o(i),t,r)}const W0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,K0=e=>t=>1-e(1-t),U0=Bs(.33,1.53,.69,.99),Pf=K0(U0),G0=W0(Pf),q0=e=>(e*=2)<1?.5*Pf(e):.5*(2-Math.pow(2,-10*(e-1))),Lf=e=>1-Math.sin(Math.acos(e)),Y0=K0(Lf),X0=W0(Lf),X_=Bs(.42,0,1,1),Z_=Bs(0,0,.58,1),Z0=Bs(.42,0,.58,1),J_=e=>Array.isArray(e)&&typeof e[0]!="number",J0=e=>Array.isArray(e)&&typeof e[0]=="number",Vg={linear:an,easeIn:X_,easeInOut:Z0,easeOut:Z_,circIn:Lf,circInOut:X0,circOut:Y0,backIn:Pf,backInOut:G0,backOut:U0,anticipate:q0},Q_=e=>typeof e=="string",Bg=e=>{if(J0(e)){pr(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return Bs(t,n,r,o)}else if(Q_(e))return pr(Vg[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Vg[e];return e},fa=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function eT(e,t){let n=new Set,r=new Set,o=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,f=!1,d=!1)=>{const g=d&&o?n:r;return f&&s.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(a=u,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(l),n.clear(),o=!1,i&&(i=!1,c.process(u))}};return c}const tT=40;function Q0(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=fa.reduce((v,b)=>(v[b]=eT(i),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:d,render:h,postRender:g}=s,p=()=>{const v=mr.useManualTiming?o.timestamp:performance.now();n=!1,mr.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(v-o.timestamp,tT),1)),o.timestamp=v,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),f.process(o),d.process(o),h.process(o),g.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,o.isProcessing||e(p)};return{schedule:fa.reduce((v,b)=>{const w=s[b];return v[b]=(_,E=!1,T=!1)=>(n||m(),w.schedule(_,E,T)),v},{}),cancel:v=>{for(let b=0;b<fa.length;b++)s[fa[b]].cancel(v)},state:o,steps:s}}const{schedule:Ue,cancel:$r,state:ht,steps:Rc}=Q0(typeof requestAnimationFrame<"u"?requestAnimationFrame:an,!0);let Ha;function nT(){Ha=void 0}const Ot={now:()=>(Ha===void 0&&Ot.set(ht.isProcessing||mr.useManualTiming?ht.timestamp:performance.now()),Ha),set:e=>{Ha=e,queueMicrotask(nT)}},ex=e=>t=>typeof t=="string"&&t.startsWith(e),tx=ex("--"),rT=ex("var(--"),Ff=e=>rT(e)?oT.test(e.split("/*")[0].trim()):!1,oT=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Pi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Rs={...Pi,transform:e=>gr(0,1,e)},ha={...Pi,default:1},ps=e=>Math.round(e*1e5)/1e5,$f=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function iT(e){return e==null}const sT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Of=(e,t)=>n=>!!(typeof n=="string"&&sT.test(n)&&n.startsWith(e)||t&&!iT(n)&&Object.prototype.hasOwnProperty.call(n,t)),nx=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,s,a]=r.match($f);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},aT=e=>gr(0,255,e),kc={...Pi,transform:e=>Math.round(aT(e))},co={test:Of("rgb","red"),parse:nx("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+kc.transform(e)+", "+kc.transform(t)+", "+kc.transform(n)+", "+ps(Rs.transform(r))+")"};function lT(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Xu={test:Of("#"),parse:lT,transform:co.transform},zs=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),_r=zs("deg"),Vn=zs("%"),he=zs("px"),cT=zs("vh"),uT=zs("vw"),zg={...Vn,parse:e=>Vn.parse(e)/100,transform:e=>Vn.transform(e*100)},oi={test:Of("hsl","hue"),parse:nx("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Vn.transform(ps(t))+", "+Vn.transform(ps(n))+", "+ps(Rs.transform(r))+")"},nt={test:e=>co.test(e)||Xu.test(e)||oi.test(e),parse:e=>co.test(e)?co.parse(e):oi.test(e)?oi.parse(e):Xu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?co.transform(e):oi.transform(e),getAnimatableNone:e=>{const t=nt.parse(e);return t.alpha=0,nt.transform(t)}},dT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function fT(e){return isNaN(e)&&typeof e=="string"&&(e.match($f)?.length||0)+(e.match(dT)?.length||0)>0}const rx="number",ox="color",hT="var",gT="var(",Hg="${}",pT=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ks(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const a=t.replace(pT,l=>(nt.test(l)?(r.color.push(i),o.push(ox),n.push(nt.parse(l))):l.startsWith(gT)?(r.var.push(i),o.push(hT),n.push(l)):(r.number.push(i),o.push(rx),n.push(parseFloat(l))),++i,Hg)).split(Hg);return{values:n,split:a,indexes:r,types:o}}function ix(e){return ks(e).values}function sx(e){const{split:t,types:n}=ks(e),r=t.length;return o=>{let i="";for(let s=0;s<r;s++)if(i+=t[s],o[s]!==void 0){const a=n[s];a===rx?i+=ps(o[s]):a===ox?i+=nt.transform(o[s]):i+=o[s]}return i}}const mT=e=>typeof e=="number"?0:nt.test(e)?nt.getAnimatableNone(e):e;function yT(e){const t=ix(e);return sx(e)(t.map(mT))}const Or={test:fT,parse:ix,createTransformer:sx,getAnimatableNone:yT};function Ac(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function vT({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Ac(l,a,e+1/3),i=Ac(l,a,e),s=Ac(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}function ol(e,t){return n=>n>0?t:e}const Ze=(e,t,n)=>e+(t-e)*n,Mc=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},xT=[Xu,co,oi],bT=e=>xT.find(t=>t.test(e));function Wg(e){const t=bT(e);if(Ni(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===oi&&(n=vT(n)),n}const Kg=(e,t)=>{const n=Wg(e),r=Wg(t);if(!n||!r)return ol(e,t);const o={...n};return i=>(o.red=Mc(n.red,r.red,i),o.green=Mc(n.green,r.green,i),o.blue=Mc(n.blue,r.blue,i),o.alpha=Ze(n.alpha,r.alpha,i),co.transform(o))},Zu=new Set(["none","hidden"]);function wT(e,t){return Zu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function CT(e,t){return n=>Ze(e,t,n)}function If(e){return typeof e=="number"?CT:typeof e=="string"?Ff(e)?ol:nt.test(e)?Kg:TT:Array.isArray(e)?ax:typeof e=="object"?nt.test(e)?Kg:ST:ol}function ax(e,t){const n=[...e],r=n.length,o=e.map((i,s)=>If(i)(i,t[s]));return i=>{for(let s=0;s<r;s++)n[s]=o[s](i);return n}}function ST(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=If(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function _T(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],s=e.indexes[i][r[i]],a=e.values[s]??0;n[o]=a,r[i]++}return n}const TT=(e,t)=>{const n=Or.createTransformer(t),r=ks(e),o=ks(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Zu.has(e)&&!o.values.length||Zu.has(t)&&!r.values.length?wT(e,t):Vs(ax(_T(r,o),o.values),n):(Ni(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),ol(e,t))};function lx(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ze(e,t,n):If(e)(e,t)}const ET=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Ue.update(t,n),stop:()=>$r(t),now:()=>ht.isProcessing?ht.timestamp:Ot.now()}},cx=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=Math.round(e(i/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},il=2e4;function Df(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<il;)t+=n,r=e.next(t);return t>=il?1/0:t}function RT(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(Df(r),il);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:sn(o)}}const kT=5;function ux(e,t,n){const r=Math.max(t-kT,0);return z0(n-e(r),t-r)}const Ye={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Nc=.001;function AT({duration:e=Ye.duration,bounce:t=Ye.bounce,velocity:n=Ye.velocity,mass:r=Ye.mass}){let o,i;Ni(e<=Cn(Ye.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=gr(Ye.minDamping,Ye.maxDamping,s),e=gr(Ye.minDuration,Ye.maxDuration,sn(e)),s<1?(o=c=>{const u=c*s,f=u*e,d=u-n,h=Ju(c,s),g=Math.exp(-f);return Nc-d/h*g},i=c=>{const f=c*s*e,d=f*n+n,h=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-f),p=Ju(Math.pow(c,2),s);return(-o(c)+Nc>0?-1:1)*((d-h)*g)/p}):(o=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Nc+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=NT(o,i,a);if(e=Cn(e),isNaN(l))return{stiffness:Ye.stiffness,damping:Ye.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const MT=12;function NT(e,t,n){let r=n;for(let o=1;o<MT;o++)r=r-e(r)/t(r);return r}function Ju(e,t){return e*Math.sqrt(1-t*t)}const PT=["duration","bounce"],LT=["stiffness","damping","mass"];function Ug(e,t){return t.some(n=>e[n]!==void 0)}function FT(e){let t={velocity:Ye.velocity,stiffness:Ye.stiffness,damping:Ye.damping,mass:Ye.mass,isResolvedFromDuration:!1,...e};if(!Ug(e,LT)&&Ug(e,PT))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*gr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Ye.mass,stiffness:o,damping:i}}else{const n=AT(e);t={...t,...n,mass:Ye.mass},t.isResolvedFromDuration=!0}return t}function sl(e=Ye.visualDuration,t=Ye.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:d,isResolvedFromDuration:h}=FT({...n,velocity:-sn(n.velocity||0)}),g=d||0,p=c/(2*Math.sqrt(l*u)),m=s-i,x=sn(Math.sqrt(l/u)),y=Math.abs(m)<5;r||(r=y?Ye.restSpeed.granular:Ye.restSpeed.default),o||(o=y?Ye.restDelta.granular:Ye.restDelta.default);let v;if(p<1){const w=Ju(x,p);v=_=>{const E=Math.exp(-p*x*_);return s-E*((g+p*x*m)/w*Math.sin(w*_)+m*Math.cos(w*_))}}else if(p===1)v=w=>s-Math.exp(-x*w)*(m+(g+x*m)*w);else{const w=x*Math.sqrt(p*p-1);v=_=>{const E=Math.exp(-p*x*_),T=Math.min(w*_,300);return s-E*((g+p*x*m)*Math.sinh(T)+w*m*Math.cosh(T))/w}}const b={calculatedDuration:h&&f||null,next:w=>{const _=v(w);if(h)a.done=w>=f;else{let E=w===0?g:0;p<1&&(E=w===0?Cn(g):ux(v,w,_));const T=Math.abs(E)<=r,k=Math.abs(s-_)<=o;a.done=T&&k}return a.value=a.done?s:_,a},toString:()=>{const w=Math.min(Df(b),il),_=cx(E=>b.next(w*E).value,w,30);return w+"ms "+_},toTransition:()=>{}};return b}sl.applyToOptions=e=>{const t=RT(e,100,sl);return e.ease=t.ease,e.duration=Cn(t.duration),e.type="keyframes",e};function Qu({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],d={done:!1,value:f},h=T=>a!==void 0&&T<a||l!==void 0&&T>l,g=T=>a===void 0?l:l===void 0||Math.abs(a-T)<Math.abs(l-T)?a:l;let p=n*t;const m=f+p,x=s===void 0?m:s(m);x!==m&&(p=x-f);const y=T=>-p*Math.exp(-T/r),v=T=>x+y(T),b=T=>{const k=y(T),P=v(T);d.done=Math.abs(k)<=c,d.value=d.done?x:P};let w,_;const E=T=>{h(d.value)&&(w=T,_=sl({keyframes:[d.value,g(d.value)],velocity:ux(v,T,d.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:T=>{let k=!1;return!_&&w===void 0&&(k=!0,b(T),E(T)),w!==void 0&&T>=w?_.next(T-w):(!k&&b(T),d)}}}function $T(e,t,n){const r=[],o=n||mr.mix||lx,i=e.length-1;for(let s=0;s<i;s++){let a=o(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||an:t;a=Vs(l,a)}r.push(a)}return r}function OT(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(pr(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=$T(t,r,o),l=a.length,c=u=>{if(s&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const d=Es(e[f],e[f+1],u);return a[f](d)};return n?u=>c(gr(e[0],e[i-1],u)):c}function IT(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Es(0,t,r);e.push(Ze(n,1,o))}}function DT(e){const t=[0];return IT(t,e.length-1),t}function jT(e,t){return e.map(n=>n*t)}function VT(e,t){return e.map(()=>t||Z0).splice(0,e.length-1)}function ii({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=J_(r)?r.map(Bg):Bg(r),i={done:!1,value:t[0]},s=jT(n&&n.length===t.length?n:DT(t),e),a=OT(s,t,{ease:Array.isArray(o)?o:VT(t,o)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const BT=e=>e!==null;function jf(e,{repeat:t,repeatType:n="loop"},r,o=1){const i=e.filter(BT),a=o<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const zT={decay:Qu,inertia:Qu,tween:ii,keyframes:ii,spring:sl};function dx(e){typeof e.type=="string"&&(e.type=zT[e.type])}class Vf{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const HT=e=>e/100;class Bf extends Vf{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Ot.now()&&this.tick(Ot.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;dx(t);const{type:n=ii,repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:s=0}=t;let{keyframes:a}=t;const l=n||ii;process.env.NODE_ENV!=="production"&&l!==ii&&pr(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==ii&&typeof a[0]!="number"&&(this.mixKeyframes=Vs(HT,lx(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=Df(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:d,repeatDelay:h,type:g,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const x=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?x<0:x>o;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let v=this.currentTime,b=r;if(f){const T=Math.min(this.currentTime,o)/a;let k=Math.floor(T),P=T%1;!P&&T>=1&&(P=1),P===1&&k--,k=Math.min(k,f+1),k%2&&(d==="reverse"?(P=1-P,h&&(P-=h/a)):d==="mirror"&&(b=s)),v=gr(0,1,P)*a}const w=y?{done:!1,value:u[0]}:b.next(v);i&&(w.value=i(w.value));let{done:_}=w;!y&&l!==null&&(_=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return E&&g!==Qu&&(w.value=jf(u,this.options,m,this.speed)),p&&p(w.value),E&&this.finish(),w}then(t,n){return this.finished.then(t,n)}get duration(){return sn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sn(t)}get time(){return sn(this.currentTime)}set time(t){t=Cn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Ot.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=sn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ET,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ot.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function WT(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const uo=e=>e*180/Math.PI,ed=e=>{const t=uo(Math.atan2(e[1],e[0]));return td(t)},KT={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ed,rotateZ:ed,skewX:e=>uo(Math.atan(e[1])),skewY:e=>uo(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},td=e=>(e=e%360,e<0&&(e+=360),e),Gg=ed,qg=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Yg=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),UT={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:qg,scaleY:Yg,scale:e=>(qg(e)+Yg(e))/2,rotateX:e=>td(uo(Math.atan2(e[6],e[5]))),rotateY:e=>td(uo(Math.atan2(-e[2],e[0]))),rotateZ:Gg,rotate:Gg,skewX:e=>uo(Math.atan(e[4])),skewY:e=>uo(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function nd(e){return e.includes("scale")?1:0}function rd(e,t){if(!e||e==="none")return nd(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=UT,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=KT,o=a}if(!o)return nd(t);const i=r[t],s=o[1].split(",").map(qT);return typeof i=="function"?i(s):s[i]}const GT=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return rd(n,t)};function qT(e){return parseFloat(e.trim())}const Li=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Fi=new Set(Li),Xg=e=>e===Pi||e===he,YT=new Set(["x","y","z"]),XT=Li.filter(e=>!YT.has(e));function ZT(e){const t=[];return XT.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const go={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>rd(t,"x"),y:(e,{transform:t})=>rd(t,"y")};go.translateX=go.x;go.translateY=go.y;const po=new Set;let od=!1,id=!1,sd=!1;function fx(){if(id){const e=Array.from(po).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=ZT(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,s])=>{r.getValue(i)?.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}id=!1,od=!1,po.forEach(e=>e.complete(sd)),po.clear()}function hx(){po.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(id=!0)})}function JT(){sd=!0,hx(),fx(),sd=!1}class zf{constructor(t,n,r,o,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(po.add(this),od||(od=!0,Ue.read(hx),Ue.resolveKeyframes(fx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const i=o?.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),o&&i===void 0&&o.set(t[0])}WT(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),po.delete(this)}cancel(){this.state==="scheduled"&&(po.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const QT=e=>e.startsWith("--");function eE(e,t,n){QT(t)?e.style.setProperty(t,n):e.style[t]=n}const tE=Af(()=>window.ScrollTimeline!==void 0),nE={};function rE(e,t){const n=Af(e);return()=>nE[t]??n()}const gx=rE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cs=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Zg={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cs([0,.65,.55,1]),circOut:cs([.55,0,1,.45]),backIn:cs([.31,.01,.66,-.59]),backOut:cs([.33,1.53,.69,.99])};function px(e,t){if(e)return typeof e=="function"?gx()?cx(e,t):"ease-out":J0(e)?cs(e):Array.isArray(e)?e.map(n=>px(n,t)||Zg.easeOut):Zg[e]}function oE(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const f=px(a,o);Array.isArray(f)&&(u.easing=f);const d={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return c&&(d.pseudoElement=c),e.animate(u,d)}function mx(e){return typeof e=="function"&&"applyToOptions"in e}function iE({type:e,...t}){return mx(e)&&gx()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class sE extends Vf{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,pr(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=iE(t);this.animation=oE(n,r,o,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=jf(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):eE(n,r,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return sn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sn(t)}get time(){return sn(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Cn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&tE()?(this.animation.timeline=t,an):n(this)}}const yx={anticipate:q0,backInOut:G0,circInOut:X0};function aE(e){return e in yx}function lE(e){typeof e.ease=="string"&&aE(e.ease)&&(e.ease=yx[e.ease])}const Jg=10;class cE extends sE{constructor(t){lE(t),dx(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:i,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Bf({...s,autoplay:!1}),l=Cn(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-Jg).value,a.sample(l).value,Jg),a.stop()}}const Qg=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Or.test(e)||e==="0")&&!e.startsWith("url("));function uE(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function dE(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],s=Qg(o,t),a=Qg(i,t);return Ni(s===a,`You are trying to animate ${t} from "${o}" to "${i}". "${s?i:o}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:uE(e)||(n==="spring"||mx(n))&&r}function ad(e){e.duration=0,e.type="keyframes"}const fE=new Set(["opacity","clipPath","filter","transform"]),hE=Af(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function gE(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return hE()&&n&&fE.has(n)&&(n!=="transform"||!c)&&!l&&!r&&o!=="mirror"&&i!==0&&s!=="inertia"}const pE=40;class mE extends Vf{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:s="loop",keyframes:a,name:l,motionValue:c,element:u,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ot.now();const d={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:s,name:l,motionValue:c,element:u,...f},h=u?.KeyframeResolver||zf;this.keyframeResolver=new h(a,(g,p,m)=>this.onKeyframesResolved(g,p,d,!m),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:i,type:s,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Ot.now(),dE(t,i,s,a)||((mr.instantAnimations||!l)&&u?.(jf(t,r,n)),t[0]=t[t.length-1],ad(r),r.repeat=0);const d={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>pE?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!c&&gE(d)?new cE({...d,element:d.motionValue.owner.current}):new Bf(d);h.finished.then(()=>this.notifyFinished()).catch(an),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),JT()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const yE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vE(e){const t=yE.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const xE=4;function vx(e,t,n=1){pr(n<=xE,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=vE(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const s=i.trim();return j0(s)?parseFloat(s):s}return Ff(o)?vx(o,t,n+1):o}function Hf(e,t){return e?.[t]??e?.default??e}const xx=new Set(["width","height","top","left","right","bottom",...Li]),bE={test:e=>e==="auto",parse:e=>e},bx=e=>t=>t.test(e),wx=[Pi,he,Vn,_r,uT,cT,bE],ep=e=>wx.find(bx(e));function wE(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||B0(e):!0}const CE=new Set(["brightness","contrast","saturate","opacity"]);function SE(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match($f)||[];if(!r)return e;const o=n.replace(r,"");let i=CE.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const _E=/\b([a-z-]*)\(.*?\)/gu,ld={...Or,getAnimatableNone:e=>{const t=e.match(_E);return t?t.map(SE).join(" "):e}},tp={...Pi,transform:Math.round},TE={rotate:_r,rotateX:_r,rotateY:_r,rotateZ:_r,scale:ha,scaleX:ha,scaleY:ha,scaleZ:ha,skew:_r,skewX:_r,skewY:_r,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:Rs,originX:zg,originY:zg,originZ:he},Wf={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,radius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,backgroundPositionX:he,backgroundPositionY:he,...TE,zIndex:tp,fillOpacity:Rs,strokeOpacity:Rs,numOctaves:tp},EE={...Wf,color:nt,backgroundColor:nt,outlineColor:nt,fill:nt,stroke:nt,borderColor:nt,borderTopColor:nt,borderRightColor:nt,borderBottomColor:nt,borderLeftColor:nt,filter:ld,WebkitFilter:ld},Cx=e=>EE[e];function Sx(e,t){let n=Cx(e);return n!==ld&&(n=Or),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const RE=new Set(["auto","none","0"]);function kE(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!RE.has(i)&&ks(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=Sx(n,o)}class AE extends zf{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Ff(c))){const u=vx(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!xx.has(r)||t.length!==2)return;const[o,i]=t,s=ep(o),a=ep(i);if(s!==a)if(Xg(s)&&Xg(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else go[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||wE(t[o]))&&r.push(o);r.length&&kE(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=go[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=go[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{t.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function ME(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=n?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const _x=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Tx(e){return V0(e)&&"offsetHeight"in e}const np=30,NE=e=>!isNaN(parseFloat(e));class PE{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=Ot.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ot.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=NE(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Nf(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Mf);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ot.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>np)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,np);return z0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function wi(e,t){return new PE(e,t)}const{schedule:Kf}=Q0(queueMicrotask,!1),yn={x:!1,y:!1};function Ex(){return yn.x||yn.y}function LE(e){return e==="x"||e==="y"?yn[e]?null:(yn[e]=!0,()=>{yn[e]=!1}):yn.x||yn.y?null:(yn.x=yn.y=!0,()=>{yn.x=yn.y=!1})}function Rx(e,t){const n=ME(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function rp(e){return!(e.pointerType==="touch"||Ex())}function FE(e,t,n={}){const[r,o,i]=Rx(e,n),s=a=>{if(!rp(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=f=>{rp(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",s,o)}),i}const kx=(e,t)=>t?e===t?!0:kx(e,t.parentElement):!1,Uf=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,$E=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function OE(e){return $E.has(e.tagName)||e.tabIndex!==-1}const Wa=new WeakSet;function op(e){return t=>{t.key==="Enter"&&e(t)}}function Pc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const IE=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=op(()=>{if(Wa.has(n))return;Pc(n,"down");const o=op(()=>{Pc(n,"up")}),i=()=>Pc(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ip(e){return Uf(e)&&!Ex()}function DE(e,t,n={}){const[r,o,i]=Rx(e,n),s=a=>{const l=a.currentTarget;if(!ip(a))return;Wa.add(l);const c=t(l,a),u=(h,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),Wa.has(l)&&Wa.delete(l),ip(h)&&typeof c=="function"&&c(h,{success:g})},f=h=>{u(h,l===window||l===document||n.useGlobalTarget||kx(l,h.target))},d=h=>{u(h,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",d,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,o),Tx(a)&&(a.addEventListener("focus",c=>IE(c,o)),!OE(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Ax(e){return V0(e)&&"ownerSVGElement"in e}function jE(e){return Ax(e)&&e.tagName==="svg"}const wt=e=>!!(e&&e.getVelocity),VE=[...wx,nt,Or],BE=e=>VE.find(bx(e)),Gf=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function sp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zE(...e){return t=>{let n=!1;const r=e.map(o=>{const i=sp(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():sp(e[o],null)}}}}function HE(...e){return M.useCallback(zE(...e),e)}class WE extends M.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=Tx(r)&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=o-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function KE({children:e,isPresent:t,anchorX:n,root:r}){const o=S.useId(),i=S.useRef(null),s=S.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=S.useContext(Gf),l=HE(i,e?.ref);return S.useInsertionEffect(()=>{const{width:c,height:u,top:f,left:d,right:h}=s.current;if(t||!i.current||!c||!u)return;const g=n==="left"?`left: ${d}`:`right: ${h}`;i.current.dataset.motionPopId=o;const p=document.createElement("style");a&&(p.nonce=a);const m=r??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(`
27
27
  [data-motion-pop-id="${o}"] {
28
28
  position: absolute !important;
29
29
  width: ${c}px !important;
@@ -31,66 +31,66 @@
31
31
  ${g}px !important;
32
32
  top: ${f}px !important;
33
33
  }
34
- `),()=>{m.contains(p)&&m.removeChild(p)}},[t]),C.jsx(OE,{isPresent:t,childRef:i,sizeRef:s,children:M.cloneElement(e,{ref:l})})}const DE=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s,anchorX:a,root:l})=>{const c=Cf(VE),u=S.useId();let f=!0,d=S.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:h=>{c.set(h,!0);for(const g of c.values())if(!g)return;r&&r()},register:h=>(c.set(h,!1),()=>c.delete(h))}),[n,c,r]);return i&&f&&(d={...d}),S.useMemo(()=>{c.forEach((h,g)=>c.set(g,!1))},[n]),M.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=C.jsx(IE,{isPresent:n,anchorX:a,root:l,children:e})),C.jsx(Fl.Provider,{value:d,children:e})};function VE(){return new Map}function Rx(e=!0){const t=S.useContext(Fl);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=S.useId();S.useEffect(()=>{if(e)return o(i)},[e]);const s=S.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const da=e=>e.key||"";function op(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const kx=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=Rx(s),f=S.useMemo(()=>op(e),[e]),d=s&&!c?[]:f.map(da),h=S.useRef(!0),g=S.useRef(f),p=Cf(()=>new Map),[m,x]=S.useState(f),[y,v]=S.useState(f);$0(()=>{h.current=!1,g.current=f;for(let _=0;_<y.length;_++){const E=da(y[_]);d.includes(E)?p.delete(E):p.get(E)!==!0&&p.set(E,!1)}},[y,d.length,d.join("-")]);const b=[];if(f!==m){let _=[...f];for(let E=0;E<y.length;E++){const T=y[E],k=da(T);d.includes(k)||(_.splice(E,0,T),b.push(T))}return i==="wait"&&b.length&&(_=b),v(op(_)),x(f),null}process.env.NODE_ENV!=="production"&&i==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:w}=S.useContext(wf);return C.jsx(C.Fragment,{children:y.map(_=>{const E=da(_),T=s&&!c?!1:f===y||d.includes(E),k=()=>{if(p.has(E))p.set(E,!0);else return;let P=!0;p.forEach(O=>{O||(P=!1)}),P&&(w?.(),v(g.current),s&&u?.(),r&&r())};return C.jsx(DE,{isPresent:T,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,root:l,onExitComplete:T?void 0:k,anchorX:a,children:_},E)})})},Ax=S.createContext({strict:!1}),ip={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},bi={};for(const e in ip)bi[e]={isEnabled:t=>ip[e].some(n=>!!t[n])};function jE(e){for(const t in e)bi[t]={...bi[t],...e[t]}}const BE=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ol(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||BE.has(e)}let Mx=e=>!ol(e);function zE(e){typeof e=="function"&&(Mx=t=>t.startsWith("on")?!ol(t):e(t))}try{zE(require("@emotion/is-prop-valid").default)}catch{}function HE(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Mx(o)||n===!0&&ol(o)||!t&&!ol(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Ll=S.createContext({});function $l(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Rs(e){return typeof e=="string"||Array.isArray(e)}const Kf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Uf=["initial",...Kf];function Ol(e){return $l(e.animate)||Uf.some(t=>Rs(e[t]))}function Nx(e){return!!(Ol(e)||e.variants)}function WE(e,t){if(Ol(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Rs(n)?n:void 0,animate:Rs(r)?r:void 0}}return e.inherit!==!1?t:{}}function KE(e){const{initial:t,animate:n}=WE(e,S.useContext(Ll));return S.useMemo(()=>({initial:t,animate:n}),[sp(t),sp(n)])}function sp(e){return Array.isArray(e)?e.join(" "):e}function ap(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const qi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=ap(e,t.target.x),r=ap(e,t.target.y);return`${n}% ${r}%`}},UE={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=$r.parse(e);if(o.length>5)return r;const i=$r.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Ze(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}},id={borderRadius:{...qi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:qi,borderTopRightRadius:qi,borderBottomLeftRadius:qi,borderBottomRightRadius:qi,boxShadow:UE};function Px(e,{layout:t,layoutId:n}){return Pi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!id[e]||e==="opacity")}const GE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qE=Ni.length;function YE(e,t,n){let r="",o=!0;for(let i=0;i<qE;i++){const s=Ni[i],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=wx(a,Bf[s]);if(!l){o=!1;const u=GE[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Gf(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Pi.has(l)){s=!0;continue}else if(J0(l)){o[l]=c;continue}else{const u=wx(c,Bf[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=YE(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const qf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Fx(e,t,n){for(const r in t)!wt(t[r])&&!Px(r,n)&&(e[r]=t[r])}function XE({transformTemplate:e},t){return S.useMemo(()=>{const n=qf();return Gf(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ZE(e,t){const n=e.style||{},r={};return Fx(r,n,e),Object.assign(r,XE(e,t)),r}function JE(e,t){const n={},r=ZE(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const QE={offset:"stroke-dashoffset",array:"stroke-dasharray"},e2={offset:"strokeDashoffset",array:"strokeDasharray"};function t2(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?QE:e2;e[i.offset]=he.transform(-r);const s=he.transform(t),a=he.transform(n);e[i.array]=`${s} ${a}`}function Lx(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:i=1,pathOffset:s=0,...a},l,c,u){if(Gf(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:d}=e;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&t2(f,o,i,s,!1)}const $x=()=>({...qf(),attrs:{}}),Ox=e=>typeof e=="string"&&e.toLowerCase()==="svg";function n2(e,t,n,r){const o=S.useMemo(()=>{const i=$x();return Lx(i,t,Ox(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Fx(i,e.style,e),o.style={...i,...o.style}}return o}const r2=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Yf(e){return typeof e!="string"||e.includes("-")?!1:!!(r2.indexOf(e)>-1||/[A-Z]/u.test(e))}function o2(e,t,n,{latestValues:r},o,i=!1){const a=(Yf(e)?n2:JE)(t,r,o,e),l=HE(t,typeof e=="string",i),c=e!==S.Fragment?{...l,...a,ref:n}:{},{children:u}=t,f=S.useMemo(()=>wt(u)?u.get():u,[u]);return S.createElement(e,{...c,children:f})}function lp(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Xf(e,t,n,r){if(typeof t=="function"){const[o,i]=lp(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=lp(r);t=t(n!==void 0?n:e.custom,o,i)}return t}function za(e){return wt(e)?e.get():e}function i2({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:s2(n,r,o,e),renderState:t()}}function s2(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=za(i[d]);let{initial:s,animate:a}=e;const l=Ol(e),c=Nx(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?a:s;if(f&&typeof f!="boolean"&&!$l(f)){const d=Array.isArray(f)?f:[f];for(let h=0;h<d.length;h++){const g=Xf(e,d[h]);if(g){const{transitionEnd:p,transition:m,...x}=g;for(const y in x){let v=x[y];if(Array.isArray(v)){const b=u?v.length-1:0;v=v[b]}v!==null&&(o[y]=v)}for(const y in p)o[y]=p[y]}}}return o}const Ix=e=>(t,n)=>{const r=S.useContext(Ll),o=S.useContext(Fl),i=()=>i2(e,t,r,o);return n?i():Cf(i)};function Zf(e,t,n){const{style:r}=e,o={};for(const i in r)(wt(r[i])||t.style&&wt(t.style[i])||Px(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(o[i]=r[i]);return o}const a2=Ix({scrapeMotionValuesFromProps:Zf,createRenderState:qf});function Dx(e,t,n){const r=Zf(e,t,n);for(const o in e)if(wt(e[o])||wt(t[o])){const i=Ni.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const l2=Ix({scrapeMotionValuesFromProps:Dx,createRenderState:$x}),c2=Symbol.for("motionComponentSymbol");function oi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function u2(e,t,n){return S.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):oi(n)&&(n.current=r))},[t])}const Jf=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),d2="framerAppearId",Vx="data-"+Jf(d2),jx=S.createContext({});function f2(e,t,n,r,o){const{visualElement:i}=S.useContext(Ll),s=S.useContext(Ax),a=S.useContext(Fl),l=S.useContext(Wf).reducedMotion,c=S.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,f=S.useContext(jx);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&h2(c.current,n,o,f);const d=S.useRef(!1);S.useInsertionEffect(()=>{u&&d.current&&u.update(n,a)});const h=n[Vx],g=S.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return $0(()=>{u&&(d.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),S.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),u.enteringChildren=void 0)}),u}function h2(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Bx(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!s||a&&oi(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Bx(e){if(e)return e.options.allowProjection!==!1?e.projection:Bx(e.parent)}function Ac(e,{forwardMotionProps:t=!1}={},n,r){n&&jE(n);const o=Yf(e)?l2:a2;function i(a,l){let c;const u={...S.useContext(Wf),...a,layoutId:g2(a)},{isStatic:f}=u,d=KE(a),h=o(a,f);if(!f&&Sf){p2(u,n);const g=m2(u);c=g.MeasureLayout,d.visualElement=f2(e,h,u,r,g.ProjectionNode)}return C.jsxs(Ll.Provider,{value:d,children:[c&&d.visualElement?C.jsx(c,{visualElement:d.visualElement,...u}):null,o2(e,a,u2(h,d.visualElement,l),h,f,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=S.forwardRef(i);return s[c2]=e,s}function g2({layoutId:e}){const t=S.useContext(wf).id;return t&&e!==void 0?t+"-"+e:e}function p2(e,t){const n=S.useContext(Ax).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Ai(!1,r,"lazy-strict-mode"):gr(!1,r,"lazy-strict-mode")}}function m2(e){const{drag:t,layout:n}=bi;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function y2(e,t){if(typeof Proxy>"u")return Ac;const n=new Map,r=(i,s)=>Ac(i,s,e,t),o=(i,s)=>(process.env.NODE_ENV!=="production"&&kf(!1,"motion() is deprecated. Use motion.create() instead."),r(i,s));return new Proxy(o,{get:(i,s)=>s==="create"?r:(n.has(s)||n.set(s,Ac(s,void 0,e,t)),n.get(s))})}function zx({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function v2({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function x2(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Mc(e){return e===void 0||e===1}function sd({scale:e,scaleX:t,scaleY:n}){return!Mc(e)||!Mc(t)||!Mc(n)}function to(e){return sd(e)||Hx(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Hx(e){return cp(e.x)||cp(e.y)}function cp(e){return e&&e!=="0%"}function il(e,t,n){const r=e-n,o=t*r;return n+o}function up(e,t,n,r,o){return o!==void 0&&(e=il(e,o,r)),il(e,n,r)+t}function ad(e,t=0,n=1,r,o){e.min=up(e.min,t,n,r,o),e.max=up(e.max,t,n,r,o)}function Wx(e,{x:t,y:n}){ad(e.x,t.translate,t.scale,t.originPoint),ad(e.y,n.translate,n.scale,n.originPoint)}const dp=.999999999999,fp=1.0000000000001;function b2(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&si(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Wx(e,s)),r&&to(i.latestValues)&&si(e,i.latestValues))}t.x<fp&&t.x>dp&&(t.x=1),t.y<fp&&t.y>dp&&(t.y=1)}function ii(e,t){e.min=e.min+t,e.max=e.max+t}function hp(e,t,n,r,o=.5){const i=Ze(e.min,e.max,o);ad(e,t,n,i,r)}function si(e,t){hp(e.x,t.x,t.scaleX,t.scale,t.originX),hp(e.y,t.y,t.scaleY,t.scale,t.originY)}function Kx(e,t){return zx(x2(e.getBoundingClientRect(),t))}function w2(e,t,n){const r=Kx(e,n),{scroll:o}=t;return o&&(ii(r.x,o.offset.x),ii(r.y,o.offset.y)),r}const gp=()=>({translate:0,scale:1,origin:0,originPoint:0}),ai=()=>({x:gp(),y:gp()}),pp=()=>({min:0,max:0}),at=()=>({x:pp(),y:pp()}),ld={current:null},Ux={current:!1};function C2(){if(Ux.current=!0,!!Sf)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ld.current=e.matches;e.addEventListener("change",t),t()}else ld.current=!1}const S2=new WeakMap;function _2(e,t,n){for(const r in t){const o=t[r],i=n[r];if(wt(o))e.addValue(r,o);else if(wt(i))e.addValue(r,xi(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=e.getStaticValue(r);e.addValue(r,xi(s!==void 0?s:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const mp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class T2{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Vf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=Ot.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Ue.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Ol(n),this.isVariantNode=Nx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&wt(h)&&h.set(l[d])}}mount(t){this.current=t,S2.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Ux.current||C2(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ld.current,process.env.NODE_ENV!=="production"&&kf(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Lr(this.notifyUpdate),Lr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Pi.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in bi){const n=bi[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):at()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<mp.length;r++){const o=mp[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,s=t[i];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=_2(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=xi(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(O0(r)||D0(r))?r=parseFloat(r):!FE(r)&&$r.test(n)&&(r=bx(t,n)),this.setBaseTarget(t,wt(r)?r.get():r)),wt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Xf(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!wt(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Rf),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){zf.render(this.render)}}class Gx extends T2{constructor(){super(...arguments),this.KeyframeResolver=wE}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;wt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function qx(e,{style:t,vars:n},r,o){const i=e.style;let s;for(s in t)i[s]=t[s];o?.applyProjectionStyles(i,r);for(s in n)i.setProperty(s,n[s])}function E2(e){return window.getComputedStyle(e)}class R2 extends Gx{constructor(){super(...arguments),this.type="html",this.renderInstance=qx}readValueFromInstance(t,n){if(Pi.has(n))return this.projection?.isProjecting?Ju(n):VT(t,n);{const r=E2(t),o=(J0(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Kx(t,n)}build(t,n,r){Gf(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Zf(t,n,r)}}const Yx=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function k2(e,t,n,r){qx(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Yx.has(o)?o:Jf(o),t.attrs[o])}class A2 extends Gx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=at}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Pi.has(n)){const r=xx(n);return r&&r.default||0}return n=Yx.has(n)?n:Jf(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Dx(t,n,r)}build(t,n,r){Lx(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){k2(t,n,r,o)}mount(t){this.isSVGTag=Ox(t.tagName),super.mount(t)}}const M2=(e,t)=>Yf(e)?new A2(t):new R2(t,{allowProjection:e!==S.Fragment});function ci(e,t,n){const r=e.getProps();return Xf(r,t,n!==void 0?n:r.custom,e)}const cd=e=>Array.isArray(e);function N2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,xi(n))}function P2(e){return cd(e)?e[e.length-1]||0:e}function F2(e,t){const n=ci(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const s in i){const a=P2(i[s]);N2(e,s,a)}}function L2(e){return!!(wt(e)&&e.add)}function ud(e,t){const n=e.getValue("willChange");if(L2(n))return n.add(t);if(!n&&pr.WillChange){const r=new pr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Xx(e){return e.props[Vx]}const $2=e=>e!==null;function O2(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter($2),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[i]}const I2={type:"spring",stiffness:500,damping:25,restSpeed:10},D2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),V2={type:"keyframes",duration:.8},j2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},B2=(e,{keyframes:t})=>t.length>2?V2:Pi.has(e)?e.startsWith("scale")?D2(t[1]):I2:j2;function z2({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Qf=(e,t,n,r={},o,i)=>s=>{const a=jf(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Cn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};z2(a)||Object.assign(u,B2(e,u)),u.duration&&(u.duration=Cn(u.duration)),u.repeatDelay&&(u.repeatDelay=Cn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(rd(u),u.delay===0&&(f=!0)),(pr.instantAnimations||pr.skipAnimations)&&(f=!0,rd(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const d=O2(u.keyframes,a);if(d!==void 0){Ue.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new Df(u):new lE(u)};function H2({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Zx(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(i=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),d=a[u];if(d===void 0||c&&H2(c,u))continue;const h={delay:n,...jf(i||{},u)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===g&&!h.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const x=Xx(e);if(x){const y=window.MotionHandoffAnimation(x,u,Ue);y!==null&&(h.startTime=y,p=!0)}}ud(e,u),f.start(Qf(u,f,d,e.shouldReduceMotion&&mx.has(u)?{type:!1}:h,e,p));const m=f.animation;m&&l.push(m)}return s&&Promise.all(l).then(()=>{Ue.update(()=>{s&&F2(e,s)})}),l}function Jx(e,t,n,r=0,o=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(i,s):o===1?i*r:a-i*r}function dd(e,t,n={}){const r=ci(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(Zx(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:f}=o;return W2(e,t,l,c,u,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[i,s]:[s,i];return l().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function W2(e,t,n=0,r=0,o=0,i=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(dd(l,t,{...s,delay:n+(typeof r=="function"?0:r)+Jx(e.variantChildren,l,r,o,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function K2(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>dd(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=dd(e,t,n);else{const o=typeof t=="function"?ci(e,t,n.custom):t;r=Promise.all(Zx(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Qx(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const U2=Uf.length;function e1(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?e1(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<U2;n++){const r=Uf[n],o=e.props[r];(Rs(o)||o===!1)&&(t[r]=o)}return t}const G2=[...Kf].reverse(),q2=Kf.length;function Y2(e){return t=>Promise.all(t.map(({animation:n,options:r})=>K2(e,n,r)))}function X2(e){let t=Y2(e),n=yp(),r=!0;const o=l=>(c,u)=>{const f=ci(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:h,...g}=f;c={...c,...g,...h}}return c};function i(l){t=l(e)}function s(l){const{props:c}=e,u=e1(e.parent)||{},f=[],d=new Set;let h={},g=1/0;for(let m=0;m<q2;m++){const x=G2[m],y=n[x],v=c[x]!==void 0?c[x]:u[x],b=Rs(v),w=x===l?y.isActive:null;w===!1&&(g=m);let _=v===u[x]&&v!==c[x]&&b;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),y.protectedKeys={...h},!y.isActive&&w===null||!v&&!y.prevProp||$l(v)||typeof v=="boolean")continue;const E=Z2(y.prevProp,v);let T=E||x===l&&y.isActive&&!_&&b||m>g&&b,k=!1;const P=Array.isArray(v)?v:[v];let O=P.reduce(o(x),{});w===!1&&(O={});const{prevResolvedValues:D={}}=y,I={...D,...O},$=F=>{T=!0,d.has(F)&&(k=!0,d.delete(F)),y.needsAnimating[F]=!0;const N=e.getValue(F);N&&(N.liveStyle=!1)};for(const F in I){const N=O[F],j=D[F];if(h.hasOwnProperty(F))continue;let K=!1;cd(N)&&cd(j)?K=!Qx(N,j):K=N!==j,K?N!=null?$(F):d.add(F):N!==void 0&&d.has(F)?$(F):y.protectedKeys[F]=!0}y.prevProp=v,y.prevResolvedValues=O,y.isActive&&(h={...h,...O}),r&&e.blockInitialAnimation&&(T=!1);const H=_&&E;T&&(!H||k)&&f.push(...P.map(F=>{const N={type:x};if(typeof F=="string"&&r&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:j}=e,K=ci(j,F);if(j.enteringChildren&&K){const{delayChildren:te}=K.transition||{};N.delay=Jx(j.enteringChildren,e,te)}}return{animation:F,options:N}}))}if(d.size){const m={};if(typeof c.initial!="boolean"){const x=ci(e,Array.isArray(c.initial)?c.initial[0]:c.initial);x&&x.transition&&(m.transition=x.transition)}d.forEach(x=>{const y=e.getBaseTarget(x),v=e.getValue(x);v&&(v.liveStyle=!0),m[x]=y??null}),f.push({animation:m})}let p=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=yp()}}}function Z2(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Qx(t,e):!1}function Jr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function yp(){return{animate:Jr(!0),whileInView:Jr(),whileHover:Jr(),whileTap:Jr(),whileDrag:Jr(),whileFocus:Jr(),exit:Jr()}}class Kr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class J2 extends Kr{constructor(t){super(t),t.animationState||(t.animationState=X2(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$l(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Q2=0;class eR extends Kr{constructor(){super(...arguments),this.id=Q2++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const tR={animation:{Feature:J2},exit:{Feature:eR}};function ks(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Bs(e){return{point:{x:e.pageX,y:e.pageY}}}const nR=e=>t=>Hf(t)&&e(t,Bs(t));function gs(e,t,n,r){return ks(e,t,nR(n),r)}const t1=1e-4,rR=1-t1,oR=1+t1,n1=.01,iR=0-n1,sR=0+n1;function At(e){return e.max-e.min}function aR(e,t,n){return Math.abs(e-t)<=n}function vp(e,t,n,r=.5){e.origin=r,e.originPoint=Ze(t.min,t.max,e.origin),e.scale=At(n)/At(t),e.translate=Ze(n.min,n.max,e.origin)-e.originPoint,(e.scale>=rR&&e.scale<=oR||isNaN(e.scale))&&(e.scale=1),(e.translate>=iR&&e.translate<=sR||isNaN(e.translate))&&(e.translate=0)}function ps(e,t,n,r){vp(e.x,t.x,n.x,r?r.originX:void 0),vp(e.y,t.y,n.y,r?r.originY:void 0)}function xp(e,t,n){e.min=n.min+t.min,e.max=e.min+At(t)}function lR(e,t,n){xp(e.x,t.x,n.x),xp(e.y,t.y,n.y)}function bp(e,t,n){e.min=t.min-n.min,e.max=e.min+At(t)}function sl(e,t,n){bp(e.x,t.x,n.x),bp(e.y,t.y,n.y)}function rn(e){return[e("x"),e("y")]}const r1=({current:e})=>e?e.ownerDocument.defaultView:null,wp=(e,t)=>Math.abs(e-t);function cR(e,t){const n=wp(e.x,t.x),r=wp(e.y,t.y);return Math.sqrt(n**2+r**2)}class o1{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Pc(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=cR(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:p}=d,{timestamp:m}=ht;this.history.push({...p,timestamp:m});const{onStart:x,onMove:y}=this.handlers;h||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Nc(h,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Pc(d.type==="pointercancel"?this.lastMoveEventInfo:Nc(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,x),p&&p(d,x)},!Hf(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=o||window;const a=Bs(t),l=Nc(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=ht;this.history=[{...c,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Pc(l,this.history)),this.removeListeners=Ds(gs(this.contextWindow,"pointermove",this.handlePointerMove),gs(this.contextWindow,"pointerup",this.handlePointerUp),gs(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Lr(this.updatePoint)}}function Nc(e,t){return t?{point:t(e.point)}:e}function Cp(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Pc({point:e},t){return{point:e,delta:Cp(e,i1(t)),offset:Cp(e,uR(t)),velocity:dR(t,.1)}}function uR(e){return e[0]}function i1(e){return e[e.length-1]}function dR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=i1(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Cn(t)));)n--;if(!r)return{x:0,y:0};const i=sn(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function fR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ze(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ze(n,e,r.max):Math.min(e,n)),e}function Sp(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function hR(e,{top:t,left:n,bottom:r,right:o}){return{x:Sp(e.x,n,o),y:Sp(e.y,t,r)}}function _p(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function gR(e,t){return{x:_p(e.x,t.x),y:_p(e.y,t.y)}}function pR(e,t){let n=.5;const r=At(e),o=At(t);return o>r?n=_s(t.min,t.max-r,e.min):r>o&&(n=_s(e.min,e.max-o,t.min)),hr(0,1,n)}function mR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fd=.35;function yR(e=fd){return e===!1?e=0:e===!0&&(e=fd),{x:Tp(e,"left","right"),y:Tp(e,"top","bottom")}}function Tp(e,t,n){return{min:Ep(e,t),max:Ep(e,n)}}function Ep(e,t){return typeof e=="number"?e:e[t]||0}const vR=new WeakMap;class xR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=at(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Bs(f).point)},s=(f,d)=>{const{drag:h,dragPropagation:g,onDragStart:p}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=TE(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rn(x=>{let y=this.getAxisMotionValue(x).get()||0;if(Vn.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const b=v.layout.layoutBox[x];b&&(y=At(b)*(parseFloat(y)/100))}}this.originPoint[x]=y}),p&&Ue.postRender(()=>p(f,d)),ud(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:x}=d;if(g&&this.currentDirection===null){this.currentDirection=bR(x),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,x),this.updateAxis("y",d.point,x),this.visualElement.render(),m&&m(f,d)},l=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>rn(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new o1(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:r1(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!r)return;const{velocity:s}=o;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&Ue.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!fa(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=fR(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&oi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=hR(r.layoutBox,t):this.constraints=!1,this.elastic=yR(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&rn(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=mR(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!oi(t))return!1;const r=t.current;gr(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=w2(r,o.root,this.visualElement.getTransformPagePoint());let s=gR(o.layout.layoutBox,i);if(n){const a=n(v2(s));this.hasMutatedConstraints=!!a,a&&(s=zx(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=rn(u=>{if(!fa(u,n,this.currentDirection))return;let f=l&&l[u]||{};s&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ud(this.visualElement,t),r.start(Qf(t,r,0,n,this.visualElement,!1))}stopAnimation(){rn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){rn(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){rn(n=>{const{drag:r}=this.getProps();if(!fa(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-Ze(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!oi(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};rn(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();o[s]=pR({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),rn(s=>{if(!fa(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(Ze(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;vR.set(this.visualElement,this);const t=this.visualElement.current,n=gs(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();oi(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Ue.read(r);const s=ks(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(rn(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=fd,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function fa(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function bR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class wR extends Kr{constructor(t){super(t),this.removeGroupControls=an,this.removeListeners=an,this.controls=new xR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||an}unmount(){this.removeGroupControls(),this.removeListeners()}}const Rp=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class CR extends Kr{constructor(){super(...arguments),this.removePointerDownListener=an}onPointerDown(t){this.session=new o1(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:r1(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Rp(t),onStart:Rp(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&Ue.postRender(()=>o(i,s))}}}mount(){this.removePointerDownListener=gs(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Ha={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Fc=!1;class SR extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),Fc&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Ha.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,Fc=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Ue.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zf.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;Fc=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function s1(e){const[t,n]=Rx(),r=S.useContext(wf);return C.jsx(SR,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(jx),isPresent:t,safeToRemove:n})}function _R(e,t,n){const r=wt(e)?e:xi(e);return r.start(Qf("",r,t,n)),r.animation}const TR=(e,t)=>e.depth-t.depth;class ER{constructor(){this.children=[],this.isDirty=!1}add(t){_f(this.children,t),this.isDirty=!0}remove(t){Tf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(TR),this.isDirty=!1,this.children.forEach(t)}}function RR(e,t){const n=Ot.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Lr(r),e(i-t))};return Ue.setup(r,!0),()=>Lr(r)}const a1=["TopLeft","TopRight","BottomLeft","BottomRight"],kR=a1.length,kp=e=>typeof e=="string"?parseFloat(e):e,Ap=e=>typeof e=="number"||he.test(e);function AR(e,t,n,r,o,i){o?(e.opacity=Ze(0,n.opacity??1,MR(r)),e.opacityExit=Ze(t.opacity??1,0,NR(r))):i&&(e.opacity=Ze(t.opacity??1,n.opacity??1,r));for(let s=0;s<kR;s++){const a=`border${a1[s]}Radius`;let l=Mp(t,a),c=Mp(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Ap(l)===Ap(c)?(e[a]=Math.max(Ze(kp(l),kp(c),r),0),(Vn.test(c)||Vn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Ze(t.rotate||0,n.rotate||0,r))}function Mp(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const MR=l1(0,.5,U0),NR=l1(.5,.95,an);function l1(e,t,n){return r=>r<e?0:r>t?1:n(_s(e,t,r))}function Np(e,t){e.min=t.min,e.max=t.max}function hn(e,t){Np(e.x,t.x),Np(e.y,t.y)}function Pp(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Fp(e,t,n,r,o){return e-=t,e=il(e,1/n,r),o!==void 0&&(e=il(e,1/o,r)),e}function PR(e,t=0,n=1,r=.5,o,i=e,s=e){if(Vn.test(t)&&(t=parseFloat(t),t=Ze(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Ze(i.min,i.max,r);e===i&&(a-=t),e.min=Fp(e.min,t,n,a,o),e.max=Fp(e.max,t,n,a,o)}function Lp(e,t,[n,r,o],i,s){PR(e,t[n],t[r],t[o],t.scale,i,s)}const FR=["x","scaleX","originX"],LR=["y","scaleY","originY"];function $p(e,t,n,r){Lp(e.x,t,FR,n?n.x:void 0,r?r.x:void 0),Lp(e.y,t,LR,n?n.y:void 0,r?r.y:void 0)}function Op(e){return e.translate===0&&e.scale===1}function c1(e){return Op(e.x)&&Op(e.y)}function Ip(e,t){return e.min===t.min&&e.max===t.max}function $R(e,t){return Ip(e.x,t.x)&&Ip(e.y,t.y)}function Dp(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function u1(e,t){return Dp(e.x,t.x)&&Dp(e.y,t.y)}function Vp(e){return At(e.x)/At(e.y)}function jp(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class OR{constructor(){this.members=[]}add(t){_f(this.members,t),t.scheduleRender()}remove(t){if(Tf(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function IR(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=n?.z||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:d,skewX:h,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Lc=["","X","Y","Z"],DR=1e3;let VR=0;function $c(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function d1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Xx(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&d1(r)}function f1({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t?.()){this.id=VR++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(zR),this.nodes.forEach(UR),this.nodes.forEach(GR),this.nodes.forEach(HR)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new ER)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Rf),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Ex(s)&&!NE(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const d=()=>this.root.updateBlockedByResize=!1;Ue.read(()=>{f=window.innerWidth}),e(s,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=RR(d,250),Ha.hasAnimatedSinceResize&&(Ha.hasAnimatedSinceResize=!1,this.nodes.forEach(Hp)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||JR,{onLayoutAnimationStart:p,onLayoutAnimationComplete:m}=c.getProps(),x=!this.targetLayout||!u1(this.targetLayout,h),y=!f&&d;if(this.options.layoutRoot||this.resumeFrom||y||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...jf(g,"layout"),onPlay:p,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,y)}else f||Hp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Lr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(qR),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&d1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Bp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(zp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(KR),this.nodes.forEach(jR),this.nodes.forEach(BR)):this.nodes.forEach(zp),this.clearAllSnapshots();const a=Ot.now();ht.delta=hr(0,1e3/60,a-ht.timestamp),ht.timestamp=a,ht.isProcessing=!0,Sc.update.process(ht),Sc.preRender.process(ht),Sc.render.process(ht),ht.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(WR),this.sharedNodes.forEach(YR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!At(this.snapshot.measuredBox.x)&&!At(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=at(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!c1(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||to(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),QR(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return at();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ek))){const{scroll:c}=this.root;c&&(ii(a.x,c.offset.x),ii(a.y,c.offset.y))}return a}removeElementScroll(s){const a=at();if(hn(a,s),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:f}=c;c!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&hn(a,s),ii(a.x,u.offset.x),ii(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const l=at();hn(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&si(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),to(u.latestValues)&&si(l,u.latestValues)}return to(this.latestValues)&&si(l,this.latestValues),l}removeTransform(s){const a=at();hn(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!to(c.latestValues))continue;sd(c.latestValues)&&c.updateSnapshot();const u=at(),f=c.measurePageBox();hn(u,f),$p(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return to(this.latestValues)&&$p(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ht.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=ht.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=at(),this.targetWithTransforms=at()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):hn(this.target,this.layout.layoutBox),Wx(this.target,this.targetDelta)):hn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||sd(this.parent.latestValues)||Hx(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,l){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=at(),this.relativeTargetOrigin=at(),sl(this.relativeTargetOrigin,a,l),hn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===ht.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;hn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;b2(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=at());const{target:h}=s;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Pp(this.prevProjectionDelta.x,this.projectionDelta.x),Pp(this.prevProjectionDelta.y,this.projectionDelta.y)),ps(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!jp(this.projectionDelta.x,this.prevProjectionDelta.x)||!jp(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ai(),this.projectionDelta=ai(),this.projectionDeltaWithTransform=ai()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=ai();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=at(),h=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=h!==g,m=this.getStack(),x=!m||m.members.length<=1,y=!!(p&&!x&&this.options.crossfade===!0&&!this.path.some(ZR));this.animationProgress=0;let v;this.mixTargetDelta=b=>{const w=b/1e3;Wp(f.x,s.x,w),Wp(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(sl(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),XR(this.relativeTarget,this.relativeTargetOrigin,d,w),v&&$R(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=at()),hn(v,this.relativeTarget)),p&&(this.animationValues=u,AR(u,c,this.latestValues,w,y,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Lr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{Ha.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=xi(0)),this.currentAnimation=_R(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(DR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&h1(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||at();const f=At(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const d=At(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+d}hn(a,l),si(a,u),ps(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new OR),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&$c("z",s,c,this.animationValues);for(let u=0;u<Lc.length;u++)$c(`rotate${Lc[u]}`,s,c,this.animationValues),$c(`skew${Lc[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=za(a?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=za(a?.pointerEvents)||""),this.hasProjected&&!to(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=IR(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),s.transform=f;const{x:d,y:h}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in id){if(u[g]===void 0)continue;const{correct:p,applyTo:m,isCSSVariable:x}=id[g],y=f==="none"?u[g]:p(u[g],c);if(m){const v=m.length;for(let b=0;b<v;b++)s[m[b]]=y}else x?this.options.visualElement.renderState.vars[g]=y:s[g]=y}this.options.layoutId&&(s.pointerEvents=c===this?za(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(Bp),this.root.sharedNodes.clear()}}}function jR(e){e.updateLayout()}function BR(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?rn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=At(f);f.min=n[u].min,f.max=f.min+d}):h1(o,t.layoutBox,n)&&rn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=At(n[u]);f.max=f.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=ai();ps(s,n,t.layoutBox);const a=ai();i?ps(a,e.applyTransform(r,!0),t.measuredBox):ps(a,n,t.layoutBox);const l=!c1(s);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const h=at();sl(h,t.layoutBox,f.layoutBox);const g=at();sl(g,n,d.layoutBox),u1(h,g)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function zR(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function HR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function WR(e){e.clearSnapshot()}function Bp(e){e.clearMeasurements()}function zp(e){e.isLayoutDirty=!1}function KR(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Hp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function UR(e){e.resolveTargetDelta()}function GR(e){e.calcProjection()}function qR(e){e.resetSkewAndRotation()}function YR(e){e.removeLeadSnapshot()}function Wp(e,t,n){e.translate=Ze(t.translate,0,n),e.scale=Ze(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Kp(e,t,n,r){e.min=Ze(t.min,n.min,r),e.max=Ze(t.max,n.max,r)}function XR(e,t,n,r){Kp(e.x,t.x,n.x,r),Kp(e.y,t.y,n.y,r)}function ZR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const JR={duration:.45,ease:[.4,0,.1,1]},Up=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gp=Up("applewebkit/")&&!Up("chrome/")?Math.round:an;function qp(e){e.min=Gp(e.min),e.max=Gp(e.max)}function QR(e){qp(e.x),qp(e.y)}function h1(e,t,n){return e==="position"||e==="preserve-aspect"&&!aR(Vp(t),Vp(n),.2)}function ek(e){return e!==e.root&&e.scroll?.wasRoot}const tk=f1({attachResizeListener:(e,t)=>ks(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Oc={current:void 0},g1=f1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Oc.current){const e=new tk({});e.mount(window),e.setOptions({layoutScroll:!0}),Oc.current=e}return Oc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),nk={pan:{Feature:CR},drag:{Feature:wR,ProjectionNode:g1,MeasureLayout:s1}};function Yp(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&Ue.postRender(()=>i(t,Bs(t)))}class rk extends Kr{mount(){const{current:t}=this.node;t&&(this.unmount=EE(t,(n,r)=>(Yp(this.node,r,"Start"),o=>Yp(this.node,o,"End"))))}unmount(){}}class ok extends Kr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ds(ks(this.node.current,"focus",()=>this.onFocus()),ks(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Xp(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&Ue.postRender(()=>i(t,Bs(t)))}class ik extends Kr{mount(){const{current:t}=this.node;t&&(this.unmount=ME(t,(n,r)=>(Xp(this.node,r,"Start"),(o,{success:i})=>Xp(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const hd=new WeakMap,Ic=new WeakMap,sk=e=>{const t=hd.get(e.target);t&&t(e)},ak=e=>{e.forEach(sk)};function lk({root:e,...t}){const n=e||document;Ic.has(n)||Ic.set(n,{});const r=Ic.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(ak,{root:e,...t})),r[o]}function ck(e,t,n){const r=lk(t);return hd.set(e,n),r.observe(e),()=>{hd.delete(e),r.unobserve(e)}}const uk={some:0,all:1};class dk extends Kr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:uk[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),d=c?u:f;d&&d(l)};return ck(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(fk(t,n))&&this.startObserver()}unmount(){}}function fk({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const hk={inView:{Feature:dk},tap:{Feature:ik},focus:{Feature:ok},hover:{Feature:rk}},gk={layout:{ProjectionNode:g1,MeasureLayout:s1}},pk={...tR,...hk,...nk,...gk},zs=y2(pk,M2),gn={fontFamily:"Inter, sans-serif",wordBreak:"break-word"},Fe={common:gn,title1:{...gn,fontSize:32,lineHeight:"36px",[ss.md()]:{fontSize:24}},title2:{...gn,fontSize:24,lineHeight:"28px",[ss.md()]:{fontSize:20}},title3:{...gn,fontSize:20,lineHeight:"28px",[ss.md()]:{fontSize:18},[ss.xs()]:{fontSize:16}},headline1:{...gn,fontSize:22,lineHeight:"26px"},headline2:{...gn,fontSize:18,lineHeight:"22px"},headline3:{...gn,fontSize:16,lineHeight:"20px"},body1:{...gn,fontSize:16,lineHeight:"24px"},body2:{...gn,fontSize:14,lineHeight:"20px"},caption1:{...gn,fontSize:12,lineHeight:"16px"},caption2:{...gn,fontSize:10,lineHeight:"14px"}},{transition:mk,color:Xn,fontWeight:ha}=V,ga={text:R.css({...Fe.common,transition:mk.general}),"title-1":R.css({...Fe.title1}),"title-2":R.css({...Fe.title2}),"title-3":R.css({...Fe.title3}),"headline-1":R.css({...Fe.headline1}),"headline-2":R.css({...Fe.headline2}),"headline-3":R.css({...Fe.headline3}),"body-1":R.css({...Fe.body1}),"body-2":R.css({...Fe.body2}),"caption-1":R.css({...Fe.caption1}),"caption-2":R.css({...Fe.caption2}),primary:R.css({color:Xn.text.primary}),secondary:R.css({color:Xn.text.secondary}),tertiary:R.css({color:Xn.text.tertiary}),positive:R.css({color:Xn.text.positive}),negative:R.css({color:Xn.text.negative}),warning:R.css({color:Xn.text.warning}),accent:R.css({color:Xn.text.accent}),inverse:R.css({color:Xn.text.inverse}),transfer:R.css({color:Xn.text.transfer}),regular:R.css({fontWeight:ha.regular}),medium:R.css({fontWeight:ha.medium}),semibold:R.css({fontWeight:ha.semibold}),bold:R.css({fontWeight:ha.bold})},yk=e=>{let t;e.center?t="center":e.left?t="left":e.right&&(t="right");let n;return e.uppercase?n="uppercase":e.lowercase?n="lowercase":e.capitalize&&(n="capitalize"),R.css({marginTop:e.mt,marginBottom:e.mb,marginRight:e.mr,marginLeft:e.ml,flex:e.flex,cursor:e.cursor,wordBreak:e.wordBreak,whiteSpace:e.whiteSpace,textOverflow:e.textOverflow,textDecoration:e.decoration,textAlign:t,textTransform:n,color:e.color,opacity:e.disabled?.5:void 0,overflow:e.overflow})},ae=S.forwardRef(({children:e,className:t,variant:n="body-1",fontWeight:r="medium",tag:o="p",colorName:i="primary",style:s,clickOpacity:a=.5,opacityDuration:l=200,onClick:c,disabled:u,mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:x,whiteSpace:y,textOverflow:v,decoration:b,color:w,center:_,left:E,right:T,uppercase:k,lowercase:P,capitalize:O,overflow:D,...I},$)=>{const[H,U]=S.useState(!1),F=!!c,N=()=>F&&U(!0),j=()=>F&&U(!1),K=yk({mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:x,whiteSpace:y,textOverflow:v,decoration:b,color:w,center:_,left:E,right:T,uppercase:k,lowercase:P,capitalize:O,overflow:D}),te=o,J=F?R.css({opacity:H?a:1,transition:`opacity ${l}ms ease`}):"";return C.jsx(te,{ref:$,...I,className:R.cx(ga.text,ga[n],ga[i],ga[r],J,t,K),style:s,onClick:c,onMouseDown:N,onMouseUp:j,onMouseLeave:j,onTouchStart:N,onTouchEnd:j,role:F?"button":void 0,tabIndex:F?0:void 0,children:e})});ae.displayName="Text";const p1=zs(ae),{color:gd,cornerRadius:Kt,height:pa,transition:vk}=V,xk=R.css({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",borderRadius:16,height:48,padding:"0 16px",cursor:"pointer",fontSize:16,fontWeight:600,overflow:"hidden",transition:"all 0.2s ease",gap:8}),Yi={zero:Kt.zero,xs:Kt.xs,sm:Kt.sm,md:Kt.md,lg:Kt.lg,xl:Kt.xl,"2xl":Kt["2xl"],"3xl":Kt["3xl"],"4xl":Kt["4xl"],"5xl":Kt["5xl"],"6xl":Kt["6xl"],"full-round":Kt.fullRound},bk={xs:pa.button.xs,sm:pa.button.sm,md:pa.button.md,lg:pa.button.lg},wk={clear:R.css({backgroundColor:"transparent",border:"none"}),filled:R.css({backgroundColor:gd.fill.accentPrimary,color:"white",border:"none"}),outline:R.css({backgroundColor:"transparent",border:`1px solid ${gd.border.accentPrimary}`})},Ck=(e,t,n,r)=>{if(r)return R.css({cursor:"not-allowed",opacity:.7});const o={transition:vk.general,borderRadius:Kt.lg,border:"none",color:e==="filled"?gd.text.inverse:`var(--text-${t})`};switch(e){case"filled":return R.css({...o,backgroundColor:`var(--fill-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${t}-${n}-hover)`}});case"outline":return R.css({...o,backgroundColor:"transparent",border:`1px solid var(--border-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});case"clear":return R.css({...o,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});default:return R.css(o)}},{color:ma}=V,wi=({disabled:e,loading:t,wrapperClassName:n,buttonClassName:r,buttonDisabledClassName:o,textClassName:i,children:s,variant:a="filled",backgroundColor:l,textColor:c,textFontWeight:u,borderColor:f,color:d="accent",opacity:h,borderRadius:g,width:p="full",size:m="md",iconLeft:x,iconRight:y,intensity:v="primary",flex:b,type:w="button",..._})=>{const E=S.useMemo(()=>{switch(p){case"full":return"100%";case"auto":return"auto";default:return p}},[p]),T=S.useMemo(()=>l||(a==="filled"?d==="neutral"?ma.fill.neutralSecondary:`var(--fill-${d}-${v})`:"transparent"),[a,l,d,v]),k=S.useMemo(()=>{if(v==="primary"){if(d==="neutral")return ma.text.secondary;if(a==="filled")return ma.text.inverse}else if(d==="neutral")return ma.text.secondary;return`var(--text-${d})`},[v,d,a]),P=S.useMemo(()=>{if(v==="primary"){if(d==="neutral")return"secondary";if(a==="filled")return"inverse"}else if(d==="neutral")return"secondary";return d},[a,d,v]),O=S.useMemo(()=>f||(a==="outline"?`var(--border-${d}-${v})`:"transparent"),[a,f,d,v]),D=S.useMemo(()=>{switch(m){case"lg":return Yi.lg;case"md":case"sm":return Yi.md;case"xs":return Yi.sm;default:return Yi.md}},[m]),I=R.cx(xk,Ck(a,d,v,e),wk[a],e?o:void 0,R.css({borderRadius:g?Yi[g]:D,backgroundColor:T,borderColor:O,color:c,width:"100%",height:bk[m],opacity:h||(e?.7:1)}),r),$=S.useMemo(()=>{switch(m){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[m]);return C.jsx(G,{className:R.cx(n),w:E,flex:b,relative:!0,overflow:"hidden",children:C.jsxs(zs.button,{..._,whileTap:!e&&!t?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},disabled:e||t,className:I,type:w,children:[t?C.jsx(M0,{color:k}):C.jsxs(C.Fragment,{children:[x,C.jsx(p1,{style:{color:c},colorName:P,variant:$,className:i,textOverflow:"ellipsis",overflow:"hidden",children:s}),y]}),C.jsx(No,{})]})})},Sk=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",...e},M.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),_k=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...e},M.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),{color:Qr}=V,xr={checkbox:R.css({display:"inline-flex",alignItems:"flex-start",gap:8,userSelect:"none"}),disabled:R.css({cursor:"not-allowed",opacity:.5}),checkbox__input:R.css({position:"absolute",opacity:0,width:"var(--checkbox-size)",height:"var(--checkbox-size)"}),checkbox__box:R.css({width:"var(--checkbox-size)",height:"var(--checkbox-size)",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${Qr.border.neutralAlphaHigh}`,backgroundColor:Qr.fill.bgSecondary,opacity:1,transition:"all 0.15s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative","& svg":{color:Qr.border.accentPrimary}}),checked:R.css({borderColor:`${Qr.border.accentPrimary} !important`,backgroundColor:`${Qr.fill.accentSecondary} !important`}),error:R.css({borderColor:Qr.border.negativePrimary,backgroundColor:Qr.fill.negativeSecondary})},Tk={primary:R.css({}),secondary:R.css({backgroundColor:"transparent"})},Ek={sm:20,md:24},eh=S.forwardRef(({checked:e,onChange:t,disabled:n,error:r,indeterminate:o,size:i="md",title:s,titleColor:a,subtitle:l,subtitleColor:c="secondary",name:u,required:f,variant:d="primary",flex:h,readOnly:g},p)=>{const[m,x]=S.useState(!1),y=e!==void 0,v=y?e:m,b=k=>{y||x(k.target.checked),t?.(k)},w=Ek[i],_=v||o,E=!!g&&!n,T=n?"not-allowed":E?"auto":"pointer";return C.jsxs("label",{className:R.cx(xr.checkbox,R.css({flex:h,cursor:T}),{[xr.disabled]:n}),children:[C.jsxs(G,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${w}px`,"--checkbox-size-double":`${w*2}px`},children:[C.jsx("input",{ref:p,type:"checkbox",checked:v,onChange:E?void 0:b,onClick:k=>k.stopPropagation(),disabled:n,readOnly:E,name:u,required:f,className:R.cx(xr.checkbox__input,{[xr.disabled]:n},R.css({cursor:T}))}),C.jsx("div",{className:R.cx(xr.checkbox__box,Tk[d],{[xr.disabled]:n,[xr.error]:r,[xr.checked]:_}),children:_&&(o?C.jsx(_k,{width:w*.75,height:w*.75}):C.jsx(Sk,{width:w*.75,height:w*.75}))})]}),(s||l)&&C.jsxs(G,{gap:4,children:[s&&C.jsx(ae,{colorName:a,variant:i==="sm"?"body-2":"body-1",children:s}),l&&C.jsx(ae,{variant:"body-2",colorName:c,children:l})]})]})});eh.displayName="Checkbox";const Rk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{opacity:.5},M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 17.9999C14.4185 17.9999 18.0002 14.4182 18.0002 9.99991C18.0002 5.58163 14.4185 1.99991 10.0002 1.99991C5.58197 1.99991 2.00024 5.58163 2.00024 9.99991C2.00024 14.4182 5.58197 17.9999 10.0002 17.9999ZM6.46514 6.46446C6.85566 6.07393 7.48883 6.07393 7.87935 6.46446L9.64712 8.23222C9.84238 8.42749 10.159 8.42749 10.3542 8.23222L12.122 6.46446C12.5125 6.07393 13.1457 6.07393 13.5362 6.46446C13.9267 6.85498 13.9267 7.48814 13.5362 7.87867L11.7684 9.64644C11.5732 9.8417 11.5732 10.1583 11.7684 10.3535L13.5362 12.1213C13.9267 12.5118 13.9267 13.145 13.5362 13.5355C13.1457 13.926 12.5125 13.926 12.122 13.5355L10.3542 11.7678C10.159 11.5725 9.84238 11.5725 9.64712 11.7678L7.87935 13.5355C7.48883 13.926 6.85566 13.926 6.46514 13.5355C6.07462 13.145 6.07462 12.5118 6.46514 12.1213L8.23291 10.3535C8.42817 10.1583 8.42817 9.8417 8.23291 9.64644L6.46514 7.87867C6.07462 7.48815 6.07462 6.85498 6.46514 6.46446Z",fill:"currentColor"}))),{color:Jt,spacing:Xi}=V,Dc=R.css({opacity:.6,cursor:"not-allowed"}),yt={"input-container":R.css({backgroundColor:Jt.fill.accentSecondary,border:`1px solid ${Jt.border.neutralAlphaBasic}`,padding:`${Xi.md} ${Xi.lg}`,borderRadius:12,minHeight:40,width:"100%",transition:"border-color 0.2s ease, background-color 0.2s ease","& textarea":{resize:"none"},[`&:not(.${Dc}):hover`]:{backgroundColor:Jt.fill.neutralPrimaryHover},"&:focus-within":{borderColor:Jt.border.accentPrimary,[`&:not(.${Dc}):hover`]:{borderColor:Jt.border.accentPrimary}}}),input:R.css({...Fe.common,...Fe.body1,background:"transparent",width:"100%",color:Jt.text.primary,"&::placeholder":{color:Jt.text.tertiary,textOverflow:"ellipsis"}}),"input-text-size_sm":R.css({...Fe.body2}),"input-text-size_md":R.css({...Fe.body2}),"input-text-align_left":R.css({textAlign:"left"}),"input-text-align_center":R.css({textAlign:"center"}),"input-text-align_right":R.css({textAlign:"right"}),sm:R.css({height:40,padding:Xi.md}),md:R.css({height:48,padding:`14px ${Xi.lg} 14px ${Xi.lg}`}),error:R.css({borderColor:Jt.border.negativePrimary}),disabled:Dc,multiline:R.css({height:"auto"}),primary:R.css({background:Jt.fill.bgPrimary}),secondary:R.css({background:Jt.fill.bgSecondary}),"clear-button":R.css({cursor:"pointer",color:Jt.text.tertiary,height:20,"&:hover":{color:Jt.text.primary}})},{spacing:Zp}=V;function Jp(e){return{...new Event("input",{bubbles:!0}),target:e,currentTarget:e}}const Ci=S.forwardRef((e,t)=>{const{label:n,prompt:r,error:o,errorText:i,size:s="md",prefix:a,suffix:l,background:c="primary",showClearButton:u,disabled:f,value:d,defaultValue:h,inputClassName:g,textAlign:p="left",...m}=e,x=e.multiline===!0,y=S.useRef(null),v=S.useRef(null),[b,w]=Mo(typeof d=="string"||typeof d=="number"?String(d):void 0,typeof h=="string"||typeof h=="number"?String(h):"");S.useImperativeHandle(t,()=>({focus:()=>{y.current?.focus(),v.current?.focus()},blur:()=>{y.current?.blur(),v.current?.blur()},get value(){return y.current?.value||v.current?.value},set value(P){w(P),y.current&&(y.current.value=P),v.current&&(v.current.value=P)}}));const _=P=>{if(w(P.target.value),x){const O=e.onChange;O?.(P)}else{const O=e.onChange;O?.(P)}};S.useEffect(()=>{x&&e.autoResize&&v.current&&(v.current.style.height="auto",v.current.style.height=`${v.current.scrollHeight}px`)},[b,x,e.autoResize]);const E=()=>{if(w(""),!x){const O=y.current;if(O){O.value="";const D=Jp(O),I=e.onChange;I?.(D)}return}const P=v.current;if(P){P.value="";const O=Jp(P),D=e.onChange;D?.(O)}},T=()=>{if(x){const{rows:I,autoResize:$,onChange:H,multiline:U,...F}=m;return C.jsx("textarea",{ref:v,rows:e.rows??3,className:R.cx(yt.input,g,{[yt.disabled]:f,[yt[`input-text-align_${p}`]]:!!p}),disabled:f,maxLength:e.maxLength,...F,value:b,onChange:_})}const{onChange:P,multiline:O,...D}=m;return C.jsx("input",{...D,ref:y,className:R.cx(yt.input,yt[`input-text-size_${s}`],g,{[yt.disabled]:f,[yt[`input-text-align_${p}`]]:!!p}),disabled:f,type:e.type??"text",value:b,onChange:_})},k=S.useMemo(()=>c==="white"?yt.primary:c==="gray"?yt.secondary:yt[c],[c]);return C.jsxs(G,{w:"full",gap:Zp.sm,children:[typeof n=="string"?C.jsx(ae,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",children:n}):n,C.jsxs(G,{row:!0,alignItems:x?"flex-start":"center",w:"full",gap:Zp.md,className:R.cx(yt["input-container"],k,yt[s],{[yt.error]:o,[yt.disabled]:f,[yt.multiline]:x}),children:[a&&C.jsx(G,{flex:"none",children:a}),C.jsx(G,{flex:"1",children:T()}),u&&b&&!f&&C.jsx(G,{flex:"none",children:C.jsx("span",{className:yt["clear-button"],onClick:E,children:C.jsx(Rk,{})})}),l&&C.jsx(G,{flex:"none",children:l})]}),(r||x)&&C.jsxs(G,{row:!0,gap:10,w:"full",children:[typeof r=="string"?C.jsx(ae,{variant:"caption-1",colorName:"tertiary",children:r}):r,x&&e.maxLength&&C.jsx(ae,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${b.length}/${e.maxLength}`})]}),i&&o&&C.jsx(ae,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:i})]})});Ci.displayName="Input";const kk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M15 8.33333H5M17.5 5H2.5M17.5 11.6667H2.5M15 15H5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Ak=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M13.3333 8.33333H2.5M16.6667 5H2.5M16.6667 11.6667H2.5M13.3333 15H2.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Mk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M17.5 8.33333H6.66665M17.5 5H3.33331M17.5 11.6667H3.33331M17.5 15H6.66665",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Nk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M5 10H11.6667C13.5076 10 15 8.50766 15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H5V10ZM5 10H12.5C14.3409 10 15.8333 11.4924 15.8333 13.3334C15.8333 15.1743 14.3409 16.6667 12.5 16.6667H5V10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Pk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M13.5 17.5H5.77614C5.2713 17.5 5.01887 17.5 4.90199 17.4002C4.80056 17.3135 4.74674 17.1836 4.75721 17.0506C4.76927 16.8974 4.94776 16.7189 5.30474 16.3619L12.3905 9.27614C12.7205 8.94613 12.8855 8.78112 13.0758 8.7193C13.2432 8.66492 13.4235 8.66492 13.5908 8.7193C13.7811 8.78112 13.9461 8.94613 14.2761 9.27614L17.5 12.5V13.5M13.5 17.5C14.9001 17.5 15.6002 17.5 16.135 17.2275C16.6054 16.9878 16.9878 16.6054 17.2275 16.135C17.5 15.6002 17.5 14.9001 17.5 13.5M13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5M8.75 7.08333C8.75 8.00381 8.00381 8.75 7.08333 8.75C6.16286 8.75 5.41667 8.00381 5.41667 7.08333C5.41667 6.16286 6.16286 5.41667 7.08333 5.41667C8.00381 5.41667 8.75 6.16286 8.75 7.08333Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Fk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M15.8334 3.33337H8.33335M11.6667 16.6667H4.16669M12.5 3.33337L7.50002 16.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Lk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{clipPath:"url(#clip0_1571_1710)"},M.createElement("path",{d:"M8.33332 10.8333C8.69119 11.3118 9.14778 11.7077 9.67211 11.9941C10.1964 12.2806 10.7762 12.4509 11.3722 12.4936C11.9681 12.5363 12.5663 12.4503 13.1261 12.2415C13.6859 12.0327 14.1942 11.7059 14.6167 11.2833L17.1167 8.78335C17.8756 7.9975 18.2956 6.94499 18.2861 5.85251C18.2766 4.76002 17.8384 3.71497 17.0659 2.94243C16.2934 2.1699 15.2483 1.7317 14.1558 1.7222C13.0633 1.71271 12.0108 2.13269 11.225 2.89168L9.79165 4.31668M11.6666 9.16668C11.3088 8.68824 10.8522 8.29236 10.3279 8.0059C9.80353 7.71943 9.22373 7.54908 8.62777 7.5064C8.03182 7.46372 7.43366 7.54971 6.87386 7.75853C6.31406 7.96735 5.80572 8.29412 5.38332 8.71668L2.88332 11.2167C2.12432 12.0025 1.70435 13.055 1.71384 14.1475C1.72334 15.24 2.16154 16.2851 2.93407 17.0576C3.70661 17.8301 4.75166 18.2683 5.84414 18.2778C6.93663 18.2873 7.98914 17.8673 8.77498 17.1083L10.2 15.6833",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),M.createElement("defs",null,M.createElement("clipPath",{id:"clip0_1571_1710"},M.createElement("rect",{width:20,height:20,fill:"white"})))),$k=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M17.5 9.99996L7.5 9.99996M17.5 4.99996L7.5 4.99996M17.5 15L7.5 15M4.16667 9.99996C4.16667 10.4602 3.79357 10.8333 3.33333 10.8333C2.8731 10.8333 2.5 10.4602 2.5 9.99996C2.5 9.53972 2.8731 9.16663 3.33333 9.16663C3.79357 9.16663 4.16667 9.53972 4.16667 9.99996ZM4.16667 4.99996C4.16667 5.4602 3.79357 5.83329 3.33333 5.83329C2.8731 5.83329 2.5 5.4602 2.5 4.99996C2.5 4.53972 2.8731 4.16663 3.33333 4.16663C3.79357 4.16663 4.16667 4.53972 4.16667 4.99996ZM4.16667 15C4.16667 15.4602 3.79357 15.8333 3.33333 15.8333C2.8731 15.8333 2.5 15.4602 2.5 15C2.5 14.5397 2.8731 14.1666 3.33333 14.1666C3.79357 14.1666 4.16667 14.5397 4.16667 15Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Ok=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M14 8.74967C14.4142 8.74967 14.75 8.41389 14.75 7.99967C14.75 7.58546 14.4142 7.24967 14 7.24967V7.99967V8.74967ZM6 7.24967C5.58579 7.24967 5.25 7.58546 5.25 7.99967C5.25 8.41389 5.58579 8.74967 6 8.74967V7.99967V7.24967ZM14 4.74967C14.4142 4.74967 14.75 4.41389 14.75 3.99967C14.75 3.58546 14.4142 3.24967 14 3.24967V3.99967V4.74967ZM6 3.24967C5.58579 3.24967 5.25 3.58546 5.25 3.99967C5.25 4.41389 5.58579 4.74967 6 4.74967V3.99967V3.24967ZM14 12.7497C14.4142 12.7497 14.75 12.4139 14.75 11.9997C14.75 11.5855 14.4142 11.2497 14 11.2497V11.9997V12.7497ZM6 11.2497C5.58579 11.2497 5.25 11.5855 5.25 11.9997C5.25 12.4139 5.58579 12.7497 6 12.7497V11.9997V11.2497ZM1.58967 3.48952C1.24295 3.71614 1.14558 4.18092 1.3722 4.52765C1.59882 4.87437 2.0636 4.97174 2.41033 4.74512L2 4.11732L1.58967 3.48952ZM3.2 3.33301H3.95C3.95 3.05764 3.79909 2.80441 3.5569 2.67337C3.31471 2.54233 3.02018 2.55455 2.78967 2.70521L3.2 3.33301ZM2.4 5.91634C1.98579 5.91634 1.65 6.25213 1.65 6.66634C1.65 7.08055 1.98579 7.41634 2.4 7.41634V6.66634V5.91634ZM4 7.41634C4.41421 7.41634 4.75 7.08055 4.75 6.66634C4.75 6.25213 4.41421 5.91634 4 5.91634V6.66634V7.41634ZM3.73743 10.8967L4.2726 11.4222L4.2726 11.4222L3.73743 10.8967ZM2 12.6663L1.46483 12.1409C1.25318 12.3565 1.19153 12.678 1.30841 12.9565C1.4253 13.2351 1.69791 13.4163 2 13.4163V12.6663ZM4 13.4163C4.41421 13.4163 4.75 13.0806 4.75 12.6663C4.75 12.2521 4.41421 11.9163 4 11.9163V12.6663V13.4163ZM1.25 10.2589C1.25 10.6731 1.58579 11.0089 2 11.0089C2.41421 11.0089 2.75 10.6731 2.75 10.2589H2H1.25ZM14 7.99967V7.24967L6 7.24967V7.99967V8.74967L14 8.74967V7.99967ZM14 3.99967V3.24967H6V3.99967V4.74967H14V3.99967ZM14 11.9997V11.2497L6 11.2497V11.9997V12.7497L14 12.7497V11.9997ZM2 4.11732L2.41033 4.74512L3.61033 3.96081L3.2 3.33301L2.78967 2.70521L1.58967 3.48952L2 4.11732ZM3.2 3.33301H2.45V6.66634H3.2H3.95V3.33301H3.2ZM3.2 6.66634V5.91634H2.4V6.66634V7.41634H3.2V6.66634ZM3.2 6.66634V7.41634H4V6.66634V5.91634H3.2V6.66634ZM3.73743 10.8967L3.20226 10.3713L1.46483 12.1409L2 12.6663L2.53517 13.1918L4.2726 11.4222L3.73743 10.8967ZM2 12.6663V13.4163H4V12.6663V11.9163H2V12.6663ZM4 10.2654H3.25C3.25 10.2957 3.23759 10.3353 3.20225 10.3713L3.73743 10.8967L4.2726 11.4222C4.57518 11.114 4.75 10.7002 4.75 10.2654H4ZM3 9.33301V10.083C3.08406 10.083 3.1515 10.1147 3.19493 10.1553C3.23791 10.1955 3.25 10.2354 3.25 10.2654H4H4.75C4.75 9.29296 3.91808 8.58301 3 8.58301V9.33301ZM2 10.2589H2.75C2.75 10.2299 2.76126 10.1927 2.80245 10.1545C2.84462 10.1155 2.91258 10.083 3 10.083V9.33301V8.58301C2.0889 8.58301 1.25 9.28004 1.25 10.2589H2Z",fill:"currentColor"})),Ik=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M5 13.3334C5 15.1743 6.49238 16.6667 8.33333 16.6667H11.6667C13.5076 16.6667 15 15.1743 15 13.3334C15 11.4924 13.5076 10 11.6667 10M15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H8.33333C6.49238 3.33337 5 4.82576 5 6.66671M2.5 10H17.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Dk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M2.5 7.5L17.5 7.5M7.5 2.5L7.5 17.5M6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5C17.5 14.9001 17.5 15.6002 17.2275 16.135C16.9878 16.6054 16.6054 16.9878 16.135 17.2275C15.6002 17.5 14.9001 17.5 13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Vk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M15 3.33337V9.16671C15 11.9281 12.7614 14.1667 9.99998 14.1667C7.23856 14.1667 4.99998 11.9281 4.99998 9.16671V3.33337M3.33331 17.5H16.6666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),m1=S.createContext(null);function th(){const e=S.useContext(m1);if(!e)throw new Error("useEditorStates must be used within EditorState Provider");return e}const y1=S.createContext(null);function jk(){const e=S.useContext(y1);if(!e)throw new Error("useToolbarContext must be used within ToolbarContext provider");return e}var ls={exports:{}};ls.exports;var Qp;function Bk(){return Qp||(Qp=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",p="[object Map]",m="[object Number]",x="[object Null]",y="[object Object]",v="[object Proxy]",b="[object RegExp]",w="[object Set]",_="[object String]",E="[object Undefined]",T="[object WeakMap]",k="[object ArrayBuffer]",P="[object DataView]",O="[object Float32Array]",D="[object Float64Array]",I="[object Int8Array]",$="[object Int16Array]",H="[object Int32Array]",U="[object Uint8Array]",F="[object Uint8ClampedArray]",N="[object Uint16Array]",j="[object Uint32Array]",K=/[\\^$.*+?()[\]{}|]/g,te=/^\[object .+?Constructor\]$/,J=/^(?:0|[1-9]\d*)$/,Z={};Z[O]=Z[D]=Z[I]=Z[$]=Z[H]=Z[U]=Z[F]=Z[N]=Z[j]=!0,Z[a]=Z[l]=Z[k]=Z[u]=Z[P]=Z[f]=Z[d]=Z[h]=Z[p]=Z[m]=Z[y]=Z[b]=Z[w]=Z[_]=Z[T]=!1;var se=typeof In=="object"&&In&&In.Object===Object&&In,oe=typeof self=="object"&&self&&self.Object===Object&&self,fe=se||oe||Function("return this")(),_e=t&&!t.nodeType&&t,ne=_e&&!0&&e&&!e.nodeType&&e,ye=ne&&ne.exports===_e,Te=ye&&se.process,De=(function(){try{var A=ne&&ne.require&&ne.require("util").types;return A||Te&&Te.binding&&Te.binding("util")}catch{}})(),st=De&&De.isTypedArray;function ee(A,L,z){switch(z.length){case 0:return A.call(L);case 1:return A.call(L,z[0]);case 2:return A.call(L,z[0],z[1]);case 3:return A.call(L,z[0],z[1],z[2])}return A.apply(L,z)}function we(A,L){for(var z=-1,re=Array(A);++z<A;)re[z]=L(z);return re}function ze(A){return function(L){return A(L)}}function Ee(A,L){return A?.[L]}function mt(A,L){return function(z){return A(L(z))}}var Lt=Array.prototype,Yt=Function.prototype,Xt=Object.prototype,ve=fe["__core-js_shared__"],Ae=Yt.toString,Zt=Xt.hasOwnProperty,pg=(function(){var A=/[^.]+$/.exec(ve&&ve.keys&&ve.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""})(),mg=Xt.toString,cS=Ae.call(Object),uS=RegExp("^"+Ae.call(Zt).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),na=ye?fe.Buffer:void 0,yg=fe.Symbol,vg=fe.Uint8Array;na&&na.allocUnsafe;var xg=mt(Object.getPrototypeOf,Object),bg=Object.create,dS=Xt.propertyIsEnumerable,fS=Lt.splice,Yr=yg?yg.toStringTag:void 0,ra=(function(){try{var A=hc(Object,"defineProperty");return A({},"",{}),A}catch{}})(),hS=na?na.isBuffer:void 0,wg=Math.max,gS=Date.now,Cg=hc(fe,"Map"),Ki=hc(Object,"create"),pS=(function(){function A(){}return function(L){if(!Zr(L))return{};if(bg)return bg(L);A.prototype=L;var z=new A;return A.prototype=void 0,z}})();function Xr(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var re=A[L];this.set(re[0],re[1])}}function mS(){this.__data__=Ki?Ki(null):{},this.size=0}function yS(A){var L=this.has(A)&&delete this.__data__[A];return this.size-=L?1:0,L}function vS(A){var L=this.__data__;if(Ki){var z=L[A];return z===r?void 0:z}return Zt.call(L,A)?L[A]:void 0}function xS(A){var L=this.__data__;return Ki?L[A]!==void 0:Zt.call(L,A)}function bS(A,L){var z=this.__data__;return this.size+=this.has(A)?0:1,z[A]=Ki&&L===void 0?r:L,this}Xr.prototype.clear=mS,Xr.prototype.delete=yS,Xr.prototype.get=vS,Xr.prototype.has=xS,Xr.prototype.set=bS;function Yn(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var re=A[L];this.set(re[0],re[1])}}function wS(){this.__data__=[],this.size=0}function CS(A){var L=this.__data__,z=oa(L,A);if(z<0)return!1;var re=L.length-1;return z==re?L.pop():fS.call(L,z,1),--this.size,!0}function SS(A){var L=this.__data__,z=oa(L,A);return z<0?void 0:L[z][1]}function _S(A){return oa(this.__data__,A)>-1}function TS(A,L){var z=this.__data__,re=oa(z,A);return re<0?(++this.size,z.push([A,L])):z[re][1]=L,this}Yn.prototype.clear=wS,Yn.prototype.delete=CS,Yn.prototype.get=SS,Yn.prototype.has=_S,Yn.prototype.set=TS;function Io(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var re=A[L];this.set(re[0],re[1])}}function ES(){this.size=0,this.__data__={hash:new Xr,map:new(Cg||Yn),string:new Xr}}function RS(A){var L=sa(this,A).delete(A);return this.size-=L?1:0,L}function kS(A){return sa(this,A).get(A)}function AS(A){return sa(this,A).has(A)}function MS(A,L){var z=sa(this,A),re=z.size;return z.set(A,L),this.size+=z.size==re?0:1,this}Io.prototype.clear=ES,Io.prototype.delete=RS,Io.prototype.get=kS,Io.prototype.has=AS,Io.prototype.set=MS;function Do(A){var L=this.__data__=new Yn(A);this.size=L.size}function NS(){this.__data__=new Yn,this.size=0}function PS(A){var L=this.__data__,z=L.delete(A);return this.size=L.size,z}function FS(A){return this.__data__.get(A)}function LS(A){return this.__data__.has(A)}function $S(A,L){var z=this.__data__;if(z instanceof Yn){var re=z.__data__;if(!Cg||re.length<n-1)return re.push([A,L]),this.size=++z.size,this;z=this.__data__=new Io(re)}return z.set(A,L),this.size=z.size,this}Do.prototype.clear=NS,Do.prototype.delete=PS,Do.prototype.get=FS,Do.prototype.has=LS,Do.prototype.set=$S;function OS(A,L){var z=mc(A),re=!z&&pc(A),Ce=!z&&!re&&Rg(A),Oe=!z&&!re&&!Ce&&Ag(A),He=z||re||Ce||Oe,ke=He?we(A.length,String):[],We=ke.length;for(var fn in A)He&&(fn=="length"||Ce&&(fn=="offset"||fn=="parent")||Oe&&(fn=="buffer"||fn=="byteLength"||fn=="byteOffset")||Tg(fn,We))||ke.push(fn);return ke}function dc(A,L,z){(z!==void 0&&!aa(A[L],z)||z===void 0&&!(L in A))&&fc(A,L,z)}function IS(A,L,z){var re=A[L];(!(Zt.call(A,L)&&aa(re,z))||z===void 0&&!(L in A))&&fc(A,L,z)}function oa(A,L){for(var z=A.length;z--;)if(aa(A[z][0],L))return z;return-1}function fc(A,L,z){L=="__proto__"&&ra?ra(A,L,{configurable:!0,enumerable:!0,value:z,writable:!0}):A[L]=z}var DS=ZS();function ia(A){return A==null?A===void 0?E:x:Yr&&Yr in Object(A)?JS(A):o_(A)}function Sg(A){return Ui(A)&&ia(A)==a}function VS(A){if(!Zr(A)||n_(A))return!1;var L=vc(A)?uS:te;return L.test(l_(A))}function jS(A){return Ui(A)&&kg(A.length)&&!!Z[ia(A)]}function BS(A){if(!Zr(A))return r_(A);var L=Eg(A),z=[];for(var re in A)re=="constructor"&&(L||!Zt.call(A,re))||z.push(re);return z}function _g(A,L,z,re,Ce){A!==L&&DS(L,function(Oe,He){if(Ce||(Ce=new Do),Zr(Oe))zS(A,L,He,z,_g,re,Ce);else{var ke=re?re(gc(A,He),Oe,He+"",A,L,Ce):void 0;ke===void 0&&(ke=Oe),dc(A,He,ke)}},Mg)}function zS(A,L,z,re,Ce,Oe,He){var ke=gc(A,z),We=gc(L,z),fn=He.get(We);if(fn){dc(A,z,fn);return}var Wt=Oe?Oe(ke,We,z+"",A,L,He):void 0,Gi=Wt===void 0;if(Gi){var xc=mc(We),bc=!xc&&Rg(We),Pg=!xc&&!bc&&Ag(We);Wt=We,xc||bc||Pg?mc(ke)?Wt=ke:c_(ke)?Wt=qS(ke):bc?(Gi=!1,Wt=KS(We)):Pg?(Gi=!1,Wt=GS(We)):Wt=[]:u_(We)||pc(We)?(Wt=ke,pc(ke)?Wt=d_(ke):(!Zr(ke)||vc(ke))&&(Wt=QS(We))):Gi=!1}Gi&&(He.set(We,Wt),Ce(Wt,We,re,Oe,He),He.delete(We)),dc(A,z,Wt)}function HS(A,L){return s_(i_(A,L,Ng),A+"")}var WS=ra?function(A,L){return ra(A,"toString",{configurable:!0,enumerable:!1,value:h_(L),writable:!0})}:Ng;function KS(A,L){return A.slice()}function US(A){var L=new A.constructor(A.byteLength);return new vg(L).set(new vg(A)),L}function GS(A,L){var z=US(A.buffer);return new A.constructor(z,A.byteOffset,A.length)}function qS(A,L){var z=-1,re=A.length;for(L||(L=Array(re));++z<re;)L[z]=A[z];return L}function YS(A,L,z,re){var Ce=!z;z||(z={});for(var Oe=-1,He=L.length;++Oe<He;){var ke=L[Oe],We=void 0;We===void 0&&(We=A[ke]),Ce?fc(z,ke,We):IS(z,ke,We)}return z}function XS(A){return HS(function(L,z){var re=-1,Ce=z.length,Oe=Ce>1?z[Ce-1]:void 0,He=Ce>2?z[2]:void 0;for(Oe=A.length>3&&typeof Oe=="function"?(Ce--,Oe):void 0,He&&e_(z[0],z[1],He)&&(Oe=Ce<3?void 0:Oe,Ce=1),L=Object(L);++re<Ce;){var ke=z[re];ke&&A(L,ke,re,Oe)}return L})}function ZS(A){return function(L,z,re){for(var Ce=-1,Oe=Object(L),He=re(L),ke=He.length;ke--;){var We=He[++Ce];if(z(Oe[We],We,Oe)===!1)break}return L}}function sa(A,L){var z=A.__data__;return t_(L)?z[typeof L=="string"?"string":"hash"]:z.map}function hc(A,L){var z=Ee(A,L);return VS(z)?z:void 0}function JS(A){var L=Zt.call(A,Yr),z=A[Yr];try{A[Yr]=void 0;var re=!0}catch{}var Ce=mg.call(A);return re&&(L?A[Yr]=z:delete A[Yr]),Ce}function QS(A){return typeof A.constructor=="function"&&!Eg(A)?pS(xg(A)):{}}function Tg(A,L){var z=typeof A;return L=L??s,!!L&&(z=="number"||z!="symbol"&&J.test(A))&&A>-1&&A%1==0&&A<L}function e_(A,L,z){if(!Zr(z))return!1;var re=typeof L;return(re=="number"?yc(z)&&Tg(L,z.length):re=="string"&&L in z)?aa(z[L],A):!1}function t_(A){var L=typeof A;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?A!=="__proto__":A===null}function n_(A){return!!pg&&pg in A}function Eg(A){var L=A&&A.constructor,z=typeof L=="function"&&L.prototype||Xt;return A===z}function r_(A){var L=[];if(A!=null)for(var z in Object(A))L.push(z);return L}function o_(A){return mg.call(A)}function i_(A,L,z){return L=wg(L===void 0?A.length-1:L,0),function(){for(var re=arguments,Ce=-1,Oe=wg(re.length-L,0),He=Array(Oe);++Ce<Oe;)He[Ce]=re[L+Ce];Ce=-1;for(var ke=Array(L+1);++Ce<L;)ke[Ce]=re[Ce];return ke[L]=z(He),ee(A,this,ke)}}function gc(A,L){if(!(L==="constructor"&&typeof A[L]=="function")&&L!="__proto__")return A[L]}var s_=a_(WS);function a_(A){var L=0,z=0;return function(){var re=gS(),Ce=i-(re-z);if(z=re,Ce>0){if(++L>=o)return arguments[0]}else L=0;return A.apply(void 0,arguments)}}function l_(A){if(A!=null){try{return Ae.call(A)}catch{}try{return A+""}catch{}}return""}function aa(A,L){return A===L||A!==A&&L!==L}var pc=Sg((function(){return arguments})())?Sg:function(A){return Ui(A)&&Zt.call(A,"callee")&&!dS.call(A,"callee")},mc=Array.isArray;function yc(A){return A!=null&&kg(A.length)&&!vc(A)}function c_(A){return Ui(A)&&yc(A)}var Rg=hS||g_;function vc(A){if(!Zr(A))return!1;var L=ia(A);return L==h||L==g||L==c||L==v}function kg(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function Zr(A){var L=typeof A;return A!=null&&(L=="object"||L=="function")}function Ui(A){return A!=null&&typeof A=="object"}function u_(A){if(!Ui(A)||ia(A)!=y)return!1;var L=xg(A);if(L===null)return!0;var z=Zt.call(L,"constructor")&&L.constructor;return typeof z=="function"&&z instanceof z&&Ae.call(z)==cS}var Ag=st?ze(st):jS;function d_(A){return YS(A,Mg(A))}function Mg(A){return yc(A)?OS(A):BS(A)}var f_=XS(function(A,L,z){_g(A,L,z)});function h_(A){return function(){return A}}function Ng(A){return A}function g_(){return!1}e.exports=f_})(ls,ls.exports)),ls.exports}var zk=Bk();const Hk=xf(zk),v1=S.createContext(null);function Wk(){return S.useContext(v1)}function Kk({children:e,locale:t}){return C.jsx(v1.Provider,{value:t||null,children:e})}function Uk({localeKey:e,defaultLocale:t}){const n=S.createContext(t);function r(s){const{extraLocale:a}=s||{},l=Wk();return{value:S.useMemo(()=>{const u=l?l[e]:null,f=[{},t];return u&&f.push(u),a&&f.push(a),Hk(...f)},[t,a,e,l])}}function o(){return S.useContext(n)}function i({children:s,locale:a}){const{value:l}=r({extraLocale:a});return C.jsx(n.Provider,{value:l,children:s})}return{Context:n,useComposeLocaleProviderValue:r,useLocale:o,Provider:i}}const x1="MarkdownTextEditor",Gk={toolbar:{link:{textPlaceholder:"Enter the text to display",linkPlaceholder:"Paste a link",linkErrorText:"Please enter a valid link",buttonText:"Save"},table:{maxRowsErrorText:e=>`Maximum number of rows is ${e.limit}`,maxColumnsErrorText:e=>`Maximum number of columns is ${e.limit}`,minRowsErrorText:e=>`Minimum number of rows is ${e.limit}`,minColumnsErrorText:e=>`Minimum number of columns is ${e.limit}`,rowsPlaceholder:"Rows count",columnsPlaceholder:"Columns count",buttonText:"Create table"},textSize:{paragraph:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3"},preview:{show:"Preview",hide:"Preview"},actions:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",link:"Link",image:"Image",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",table:"Table",bulletList:"Bullet list",numberedList:"Numbered list"}}},{Provider:qk,useLocale:Hs}=Uk({localeKey:x1,defaultLocale:Gk}),b1=S.createContext(null);function Yk(e,t){return{getTheme:function(){return t??null}}}function it(){const e=S.useContext(b1);return e==null&&(function(t,...n){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(const i of n)o.append("v",i);throw r.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),e}function q(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function w1(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Mn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Xk=Mn&&"documentMode"in document?document.documentMode:null,vn=Mn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),yo=Mn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),al=!(!Mn||!("InputEvent"in window)||Xk)&&"getTargetRanges"in new window.InputEvent("input"),Ws=Mn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Fi=Mn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Zk=Mn&&/Android/.test(navigator.userAgent),C1=Mn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),em=Mn&&Zk&&C1,Ks=Mn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&vn&&!C1;function S1(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}const Jk=0,Qk=1,eA=2,_1=128,tA=1,nA=2,rA=3,oA=4,iA=5,sA=6,Il=Ws||Fi||Ks?" ":"​",Or=`
34
+ `),()=>{m.contains(p)&&m.removeChild(p)}},[t]),C.jsx(WE,{isPresent:t,childRef:i,sizeRef:s,children:M.cloneElement(e,{ref:l})})}const UE=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s,anchorX:a,root:l})=>{const c=Tf(GE),u=S.useId();let f=!0,d=S.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:h=>{c.set(h,!0);for(const g of c.values())if(!g)return;r&&r()},register:h=>(c.set(h,!1),()=>c.delete(h))}),[n,c,r]);return i&&f&&(d={...d}),S.useMemo(()=>{c.forEach((h,g)=>c.set(g,!1))},[n]),M.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=C.jsx(KE,{isPresent:n,anchorX:a,root:l,children:e})),C.jsx(Il.Provider,{value:d,children:e})};function GE(){return new Map}function Mx(e=!0){const t=S.useContext(Il);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=S.useId();S.useEffect(()=>{if(e)return o(i)},[e]);const s=S.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const ga=e=>e.key||"";function ap(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const Nx=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=Mx(s),f=S.useMemo(()=>ap(e),[e]),d=s&&!c?[]:f.map(ga),h=S.useRef(!0),g=S.useRef(f),p=Tf(()=>new Map),[m,x]=S.useState(f),[y,v]=S.useState(f);D0(()=>{h.current=!1,g.current=f;for(let _=0;_<y.length;_++){const E=ga(y[_]);d.includes(E)?p.delete(E):p.get(E)!==!0&&p.set(E,!1)}},[y,d.length,d.join("-")]);const b=[];if(f!==m){let _=[...f];for(let E=0;E<y.length;E++){const T=y[E],k=ga(T);d.includes(k)||(_.splice(E,0,T),b.push(T))}return i==="wait"&&b.length&&(_=b),v(ap(_)),x(f),null}process.env.NODE_ENV!=="production"&&i==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:w}=S.useContext(_f);return C.jsx(C.Fragment,{children:y.map(_=>{const E=ga(_),T=s&&!c?!1:f===y||d.includes(E),k=()=>{if(p.has(E))p.set(E,!0);else return;let P=!0;p.forEach(O=>{O||(P=!1)}),P&&(w?.(),v(g.current),s&&u?.(),r&&r())};return C.jsx(UE,{isPresent:T,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,root:l,onExitComplete:T?void 0:k,anchorX:a,children:_},E)})})},Px=S.createContext({strict:!1}),lp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ci={};for(const e in lp)Ci[e]={isEnabled:t=>lp[e].some(n=>!!t[n])};function qE(e){for(const t in e)Ci[t]={...Ci[t],...e[t]}}const YE=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function al(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||YE.has(e)}let Lx=e=>!al(e);function XE(e){typeof e=="function"&&(Lx=t=>t.startsWith("on")?!al(t):e(t))}try{XE(require("@emotion/is-prop-valid").default)}catch{}function ZE(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Lx(o)||n===!0&&al(o)||!t&&!al(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Dl=S.createContext({});function jl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function As(e){return typeof e=="string"||Array.isArray(e)}const qf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Yf=["initial",...qf];function Vl(e){return jl(e.animate)||Yf.some(t=>As(e[t]))}function Fx(e){return!!(Vl(e)||e.variants)}function JE(e,t){if(Vl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||As(n)?n:void 0,animate:As(r)?r:void 0}}return e.inherit!==!1?t:{}}function QE(e){const{initial:t,animate:n}=JE(e,S.useContext(Dl));return S.useMemo(()=>({initial:t,animate:n}),[cp(t),cp(n)])}function cp(e){return Array.isArray(e)?e.join(" "):e}function up(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Xi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=up(e,t.target.x),r=up(e,t.target.y);return`${n}% ${r}%`}},e2={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Or.parse(e);if(o.length>5)return r;const i=Or.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Ze(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}},cd={borderRadius:{...Xi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Xi,borderTopRightRadius:Xi,borderBottomLeftRadius:Xi,borderBottomRightRadius:Xi,boxShadow:e2};function $x(e,{layout:t,layoutId:n}){return Fi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!cd[e]||e==="opacity")}const t2={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},n2=Li.length;function r2(e,t,n){let r="",o=!0;for(let i=0;i<n2;i++){const s=Li[i],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=_x(a,Wf[s]);if(!l){o=!1;const u=t2[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Xf(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Fi.has(l)){s=!0;continue}else if(tx(l)){o[l]=c;continue}else{const u=_x(c,Wf[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=r2(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const Zf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ox(e,t,n){for(const r in t)!wt(t[r])&&!$x(r,n)&&(e[r]=t[r])}function o2({transformTemplate:e},t){return S.useMemo(()=>{const n=Zf();return Xf(n,t,e),Object.assign({},n.vars,n.style)},[t])}function i2(e,t){const n=e.style||{},r={};return Ox(r,n,e),Object.assign(r,o2(e,t)),r}function s2(e,t){const n={},r=i2(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const a2={offset:"stroke-dashoffset",array:"stroke-dasharray"},l2={offset:"strokeDashoffset",array:"strokeDasharray"};function c2(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?a2:l2;e[i.offset]=he.transform(-r);const s=he.transform(t),a=he.transform(n);e[i.array]=`${s} ${a}`}function Ix(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:i=1,pathOffset:s=0,...a},l,c,u){if(Xf(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:d}=e;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&c2(f,o,i,s,!1)}const Dx=()=>({...Zf(),attrs:{}}),jx=e=>typeof e=="string"&&e.toLowerCase()==="svg";function u2(e,t,n,r){const o=S.useMemo(()=>{const i=Dx();return Ix(i,t,jx(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Ox(i,e.style,e),o.style={...i,...o.style}}return o}const d2=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Jf(e){return typeof e!="string"||e.includes("-")?!1:!!(d2.indexOf(e)>-1||/[A-Z]/u.test(e))}function f2(e,t,n,{latestValues:r},o,i=!1){const a=(Jf(e)?u2:s2)(t,r,o,e),l=ZE(t,typeof e=="string",i),c=e!==S.Fragment?{...l,...a,ref:n}:{},{children:u}=t,f=S.useMemo(()=>wt(u)?u.get():u,[u]);return S.createElement(e,{...c,children:f})}function dp(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Qf(e,t,n,r){if(typeof t=="function"){const[o,i]=dp(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=dp(r);t=t(n!==void 0?n:e.custom,o,i)}return t}function Ka(e){return wt(e)?e.get():e}function h2({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:g2(n,r,o,e),renderState:t()}}function g2(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=Ka(i[d]);let{initial:s,animate:a}=e;const l=Vl(e),c=Fx(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?a:s;if(f&&typeof f!="boolean"&&!jl(f)){const d=Array.isArray(f)?f:[f];for(let h=0;h<d.length;h++){const g=Qf(e,d[h]);if(g){const{transitionEnd:p,transition:m,...x}=g;for(const y in x){let v=x[y];if(Array.isArray(v)){const b=u?v.length-1:0;v=v[b]}v!==null&&(o[y]=v)}for(const y in p)o[y]=p[y]}}}return o}const Vx=e=>(t,n)=>{const r=S.useContext(Dl),o=S.useContext(Il),i=()=>h2(e,t,r,o);return n?i():Tf(i)};function eh(e,t,n){const{style:r}=e,o={};for(const i in r)(wt(r[i])||t.style&&wt(t.style[i])||$x(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(o[i]=r[i]);return o}const p2=Vx({scrapeMotionValuesFromProps:eh,createRenderState:Zf});function Bx(e,t,n){const r=eh(e,t,n);for(const o in e)if(wt(e[o])||wt(t[o])){const i=Li.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const m2=Vx({scrapeMotionValuesFromProps:Bx,createRenderState:Dx}),y2=Symbol.for("motionComponentSymbol");function si(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function v2(e,t,n){return S.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):si(n)&&(n.current=r))},[t])}const th=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),x2="framerAppearId",zx="data-"+th(x2),Hx=S.createContext({});function b2(e,t,n,r,o){const{visualElement:i}=S.useContext(Dl),s=S.useContext(Px),a=S.useContext(Il),l=S.useContext(Gf).reducedMotion,c=S.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,f=S.useContext(Hx);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&w2(c.current,n,o,f);const d=S.useRef(!1);S.useInsertionEffect(()=>{u&&d.current&&u.update(n,a)});const h=n[zx],g=S.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return D0(()=>{u&&(d.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),S.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),u.enteringChildren=void 0)}),u}function w2(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Wx(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!s||a&&si(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Wx(e){if(e)return e.options.allowProjection!==!1?e.projection:Wx(e.parent)}function Lc(e,{forwardMotionProps:t=!1}={},n,r){n&&qE(n);const o=Jf(e)?m2:p2;function i(a,l){let c;const u={...S.useContext(Gf),...a,layoutId:C2(a)},{isStatic:f}=u,d=QE(a),h=o(a,f);if(!f&&Ef){S2(u,n);const g=_2(u);c=g.MeasureLayout,d.visualElement=b2(e,h,u,r,g.ProjectionNode)}return C.jsxs(Dl.Provider,{value:d,children:[c&&d.visualElement?C.jsx(c,{visualElement:d.visualElement,...u}):null,f2(e,a,v2(h,d.visualElement,l),h,f,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=S.forwardRef(i);return s[y2]=e,s}function C2({layoutId:e}){const t=S.useContext(_f).id;return t&&e!==void 0?t+"-"+e:e}function S2(e,t){const n=S.useContext(Px).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Ni(!1,r,"lazy-strict-mode"):pr(!1,r,"lazy-strict-mode")}}function _2(e){const{drag:t,layout:n}=Ci;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function T2(e,t){if(typeof Proxy>"u")return Lc;const n=new Map,r=(i,s)=>Lc(i,s,e,t),o=(i,s)=>(process.env.NODE_ENV!=="production"&&Nf(!1,"motion() is deprecated. Use motion.create() instead."),r(i,s));return new Proxy(o,{get:(i,s)=>s==="create"?r:(n.has(s)||n.set(s,Lc(s,void 0,e,t)),n.get(s))})}function Kx({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function E2({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function R2(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Fc(e){return e===void 0||e===1}function ud({scale:e,scaleX:t,scaleY:n}){return!Fc(e)||!Fc(t)||!Fc(n)}function ro(e){return ud(e)||Ux(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ux(e){return fp(e.x)||fp(e.y)}function fp(e){return e&&e!=="0%"}function ll(e,t,n){const r=e-n,o=t*r;return n+o}function hp(e,t,n,r,o){return o!==void 0&&(e=ll(e,o,r)),ll(e,n,r)+t}function dd(e,t=0,n=1,r,o){e.min=hp(e.min,t,n,r,o),e.max=hp(e.max,t,n,r,o)}function Gx(e,{x:t,y:n}){dd(e.x,t.translate,t.scale,t.originPoint),dd(e.y,n.translate,n.scale,n.originPoint)}const gp=.999999999999,pp=1.0000000000001;function k2(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&li(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Gx(e,s)),r&&ro(i.latestValues)&&li(e,i.latestValues))}t.x<pp&&t.x>gp&&(t.x=1),t.y<pp&&t.y>gp&&(t.y=1)}function ai(e,t){e.min=e.min+t,e.max=e.max+t}function mp(e,t,n,r,o=.5){const i=Ze(e.min,e.max,o);dd(e,t,n,i,r)}function li(e,t){mp(e.x,t.x,t.scaleX,t.scale,t.originX),mp(e.y,t.y,t.scaleY,t.scale,t.originY)}function qx(e,t){return Kx(R2(e.getBoundingClientRect(),t))}function A2(e,t,n){const r=qx(e,n),{scroll:o}=t;return o&&(ai(r.x,o.offset.x),ai(r.y,o.offset.y)),r}const yp=()=>({translate:0,scale:1,origin:0,originPoint:0}),ci=()=>({x:yp(),y:yp()}),vp=()=>({min:0,max:0}),at=()=>({x:vp(),y:vp()}),fd={current:null},Yx={current:!1};function M2(){if(Yx.current=!0,!!Ef)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>fd.current=e.matches;e.addEventListener("change",t),t()}else fd.current=!1}const N2=new WeakMap;function P2(e,t,n){for(const r in t){const o=t[r],i=n[r];if(wt(o))e.addValue(r,o);else if(wt(i))e.addValue(r,wi(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=e.getStaticValue(r);e.addValue(r,wi(s!==void 0?s:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const xp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class L2{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=zf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=Ot.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Ue.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Vl(n),this.isVariantNode=Fx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&wt(h)&&h.set(l[d])}}mount(t){this.current=t,N2.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Yx.current||M2(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:fd.current,process.env.NODE_ENV!=="production"&&Nf(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),$r(this.notifyUpdate),$r(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Fi.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ci){const n=Ci[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):at()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<xp.length;r++){const o=xp[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,s=t[i];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=P2(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=wi(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(j0(r)||B0(r))?r=parseFloat(r):!BE(r)&&Or.test(n)&&(r=Sx(t,n)),this.setBaseTarget(t,wt(r)?r.get():r)),wt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=Qf(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!wt(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Mf),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Kf.render(this.render)}}class Xx extends L2{constructor(){super(...arguments),this.KeyframeResolver=AE}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;wt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Zx(e,{style:t,vars:n},r,o){const i=e.style;let s;for(s in t)i[s]=t[s];o?.applyProjectionStyles(i,r);for(s in n)i.setProperty(s,n[s])}function F2(e){return window.getComputedStyle(e)}class $2 extends Xx{constructor(){super(...arguments),this.type="html",this.renderInstance=Zx}readValueFromInstance(t,n){if(Fi.has(n))return this.projection?.isProjecting?nd(n):GT(t,n);{const r=F2(t),o=(tx(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return qx(t,n)}build(t,n,r){Xf(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return eh(t,n,r)}}const Jx=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function O2(e,t,n,r){Zx(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Jx.has(o)?o:th(o),t.attrs[o])}class I2 extends Xx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=at}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Fi.has(n)){const r=Cx(n);return r&&r.default||0}return n=Jx.has(n)?n:th(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Bx(t,n,r)}build(t,n,r){Ix(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){O2(t,n,r,o)}mount(t){this.isSVGTag=jx(t.tagName),super.mount(t)}}const D2=(e,t)=>Jf(e)?new I2(t):new $2(t,{allowProjection:e!==S.Fragment});function di(e,t,n){const r=e.getProps();return Qf(r,t,n!==void 0?n:r.custom,e)}const hd=e=>Array.isArray(e);function j2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,wi(n))}function V2(e){return hd(e)?e[e.length-1]||0:e}function B2(e,t){const n=di(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const s in i){const a=V2(i[s]);j2(e,s,a)}}function z2(e){return!!(wt(e)&&e.add)}function gd(e,t){const n=e.getValue("willChange");if(z2(n))return n.add(t);if(!n&&mr.WillChange){const r=new mr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Qx(e){return e.props[zx]}const H2=e=>e!==null;function W2(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(H2),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[i]}const K2={type:"spring",stiffness:500,damping:25,restSpeed:10},U2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),G2={type:"keyframes",duration:.8},q2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Y2=(e,{keyframes:t})=>t.length>2?G2:Fi.has(e)?e.startsWith("scale")?U2(t[1]):K2:q2;function X2({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const nh=(e,t,n,r={},o,i)=>s=>{const a=Hf(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Cn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};X2(a)||Object.assign(u,Y2(e,u)),u.duration&&(u.duration=Cn(u.duration)),u.repeatDelay&&(u.repeatDelay=Cn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ad(u),u.delay===0&&(f=!0)),(mr.instantAnimations||mr.skipAnimations)&&(f=!0,ad(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const d=W2(u.keyframes,a);if(d!==void 0){Ue.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new Bf(u):new mE(u)};function Z2({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function eb(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(i=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),d=a[u];if(d===void 0||c&&Z2(c,u))continue;const h={delay:n,...Hf(i||{},u)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===g&&!h.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const x=Qx(e);if(x){const y=window.MotionHandoffAnimation(x,u,Ue);y!==null&&(h.startTime=y,p=!0)}}gd(e,u),f.start(nh(u,f,d,e.shouldReduceMotion&&xx.has(u)?{type:!1}:h,e,p));const m=f.animation;m&&l.push(m)}return s&&Promise.all(l).then(()=>{Ue.update(()=>{s&&B2(e,s)})}),l}function tb(e,t,n,r=0,o=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(i,s):o===1?i*r:a-i*r}function pd(e,t,n={}){const r=di(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(eb(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:f}=o;return J2(e,t,l,c,u,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[i,s]:[s,i];return l().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function J2(e,t,n=0,r=0,o=0,i=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(pd(l,t,{...s,delay:n+(typeof r=="function"?0:r)+tb(e.variantChildren,l,r,o,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function Q2(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>pd(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=pd(e,t,n);else{const o=typeof t=="function"?di(e,t,n.custom):t;r=Promise.all(eb(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function nb(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const eR=Yf.length;function rb(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?rb(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<eR;n++){const r=Yf[n],o=e.props[r];(As(o)||o===!1)&&(t[r]=o)}return t}const tR=[...qf].reverse(),nR=qf.length;function rR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Q2(e,n,r)))}function oR(e){let t=rR(e),n=bp(),r=!0;const o=l=>(c,u)=>{const f=di(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:h,...g}=f;c={...c,...g,...h}}return c};function i(l){t=l(e)}function s(l){const{props:c}=e,u=rb(e.parent)||{},f=[],d=new Set;let h={},g=1/0;for(let m=0;m<nR;m++){const x=tR[m],y=n[x],v=c[x]!==void 0?c[x]:u[x],b=As(v),w=x===l?y.isActive:null;w===!1&&(g=m);let _=v===u[x]&&v!==c[x]&&b;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),y.protectedKeys={...h},!y.isActive&&w===null||!v&&!y.prevProp||jl(v)||typeof v=="boolean")continue;const E=iR(y.prevProp,v);let T=E||x===l&&y.isActive&&!_&&b||m>g&&b,k=!1;const P=Array.isArray(v)?v:[v];let O=P.reduce(o(x),{});w===!1&&(O={});const{prevResolvedValues:D={}}=y,I={...D,...O},$=L=>{T=!0,d.has(L)&&(k=!0,d.delete(L)),y.needsAnimating[L]=!0;const N=e.getValue(L);N&&(N.liveStyle=!1)};for(const L in I){const N=O[L],V=D[L];if(h.hasOwnProperty(L))continue;let K=!1;hd(N)&&hd(V)?K=!nb(N,V):K=N!==V,K?N!=null?$(L):d.add(L):N!==void 0&&d.has(L)?$(L):y.protectedKeys[L]=!0}y.prevProp=v,y.prevResolvedValues=O,y.isActive&&(h={...h,...O}),r&&e.blockInitialAnimation&&(T=!1);const H=_&&E;T&&(!H||k)&&f.push(...P.map(L=>{const N={type:x};if(typeof L=="string"&&r&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,K=di(V,L);if(V.enteringChildren&&K){const{delayChildren:te}=K.transition||{};N.delay=tb(V.enteringChildren,e,te)}}return{animation:L,options:N}}))}if(d.size){const m={};if(typeof c.initial!="boolean"){const x=di(e,Array.isArray(c.initial)?c.initial[0]:c.initial);x&&x.transition&&(m.transition=x.transition)}d.forEach(x=>{const y=e.getBaseTarget(x),v=e.getValue(x);v&&(v.liveStyle=!0),m[x]=y??null}),f.push({animation:m})}let p=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=bp()}}}function iR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!nb(t,e):!1}function Qr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function bp(){return{animate:Qr(!0),whileInView:Qr(),whileHover:Qr(),whileTap:Qr(),whileDrag:Qr(),whileFocus:Qr(),exit:Qr()}}class Ur{constructor(t){this.isMounted=!1,this.node=t}update(){}}class sR extends Ur{constructor(t){super(t),t.animationState||(t.animationState=oR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();jl(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let aR=0;class lR extends Ur{constructor(){super(...arguments),this.id=aR++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const cR={animation:{Feature:sR},exit:{Feature:lR}};function Ms(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Hs(e){return{point:{x:e.pageX,y:e.pageY}}}const uR=e=>t=>Uf(t)&&e(t,Hs(t));function ms(e,t,n,r){return Ms(e,t,uR(n),r)}const ob=1e-4,dR=1-ob,fR=1+ob,ib=.01,hR=0-ib,gR=0+ib;function At(e){return e.max-e.min}function pR(e,t,n){return Math.abs(e-t)<=n}function wp(e,t,n,r=.5){e.origin=r,e.originPoint=Ze(t.min,t.max,e.origin),e.scale=At(n)/At(t),e.translate=Ze(n.min,n.max,e.origin)-e.originPoint,(e.scale>=dR&&e.scale<=fR||isNaN(e.scale))&&(e.scale=1),(e.translate>=hR&&e.translate<=gR||isNaN(e.translate))&&(e.translate=0)}function ys(e,t,n,r){wp(e.x,t.x,n.x,r?r.originX:void 0),wp(e.y,t.y,n.y,r?r.originY:void 0)}function Cp(e,t,n){e.min=n.min+t.min,e.max=e.min+At(t)}function mR(e,t,n){Cp(e.x,t.x,n.x),Cp(e.y,t.y,n.y)}function Sp(e,t,n){e.min=t.min-n.min,e.max=e.min+At(t)}function cl(e,t,n){Sp(e.x,t.x,n.x),Sp(e.y,t.y,n.y)}function rn(e){return[e("x"),e("y")]}const sb=({current:e})=>e?e.ownerDocument.defaultView:null,_p=(e,t)=>Math.abs(e-t);function yR(e,t){const n=_p(e.x,t.x),r=_p(e.y,t.y);return Math.sqrt(n**2+r**2)}class ab{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Oc(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=yR(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:p}=d,{timestamp:m}=ht;this.history.push({...p,timestamp:m});const{onStart:x,onMove:y}=this.handlers;h||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=$c(h,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Oc(d.type==="pointercancel"?this.lastMoveEventInfo:$c(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,x),p&&p(d,x)},!Uf(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=o||window;const a=Hs(t),l=$c(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=ht;this.history=[{...c,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Oc(l,this.history)),this.removeListeners=Vs(ms(this.contextWindow,"pointermove",this.handlePointerMove),ms(this.contextWindow,"pointerup",this.handlePointerUp),ms(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),$r(this.updatePoint)}}function $c(e,t){return t?{point:t(e.point)}:e}function Tp(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Oc({point:e},t){return{point:e,delta:Tp(e,lb(t)),offset:Tp(e,vR(t)),velocity:xR(t,.1)}}function vR(e){return e[0]}function lb(e){return e[e.length-1]}function xR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=lb(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Cn(t)));)n--;if(!r)return{x:0,y:0};const i=sn(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function bR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ze(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ze(n,e,r.max):Math.min(e,n)),e}function Ep(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function wR(e,{top:t,left:n,bottom:r,right:o}){return{x:Ep(e.x,n,o),y:Ep(e.y,t,r)}}function Rp(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function CR(e,t){return{x:Rp(e.x,t.x),y:Rp(e.y,t.y)}}function SR(e,t){let n=.5;const r=At(e),o=At(t);return o>r?n=Es(t.min,t.max-r,e.min):r>o&&(n=Es(e.min,e.max-o,t.min)),gr(0,1,n)}function _R(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const md=.35;function TR(e=md){return e===!1?e=0:e===!0&&(e=md),{x:kp(e,"left","right"),y:kp(e,"top","bottom")}}function kp(e,t,n){return{min:Ap(e,t),max:Ap(e,n)}}function Ap(e,t){return typeof e=="number"?e:e[t]||0}const ER=new WeakMap;class RR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=at(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Hs(f).point)},s=(f,d)=>{const{drag:h,dragPropagation:g,onDragStart:p}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=LE(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rn(x=>{let y=this.getAxisMotionValue(x).get()||0;if(Vn.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const b=v.layout.layoutBox[x];b&&(y=At(b)*(parseFloat(y)/100))}}this.originPoint[x]=y}),p&&Ue.postRender(()=>p(f,d)),gd(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:x}=d;if(g&&this.currentDirection===null){this.currentDirection=kR(x),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,x),this.updateAxis("y",d.point,x),this.visualElement.render(),m&&m(f,d)},l=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>rn(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new ab(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:sb(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!r)return;const{velocity:s}=o;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&Ue.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!pa(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=bR(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&si(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=wR(r.layoutBox,t):this.constraints=!1,this.elastic=TR(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&rn(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=_R(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!si(t))return!1;const r=t.current;pr(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=A2(r,o.root,this.visualElement.getTransformPagePoint());let s=CR(o.layout.layoutBox,i);if(n){const a=n(E2(s));this.hasMutatedConstraints=!!a,a&&(s=Kx(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=rn(u=>{if(!pa(u,n,this.currentDirection))return;let f=l&&l[u]||{};s&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return gd(this.visualElement,t),r.start(nh(t,r,0,n,this.visualElement,!1))}stopAnimation(){rn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){rn(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){rn(n=>{const{drag:r}=this.getProps();if(!pa(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-Ze(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!si(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};rn(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();o[s]=SR({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),rn(s=>{if(!pa(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(Ze(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;ER.set(this.visualElement,this);const t=this.visualElement.current,n=ms(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();si(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Ue.read(r);const s=Ms(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(rn(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=md,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function pa(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function kR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class AR extends Ur{constructor(t){super(t),this.removeGroupControls=an,this.removeListeners=an,this.controls=new RR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||an}unmount(){this.removeGroupControls(),this.removeListeners()}}const Mp=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class MR extends Ur{constructor(){super(...arguments),this.removePointerDownListener=an}onPointerDown(t){this.session=new ab(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sb(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Mp(t),onStart:Mp(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&Ue.postRender(()=>o(i,s))}}}mount(){this.removePointerDownListener=ms(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Ua={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Ic=!1;class NR extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),Ic&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Ua.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,Ic=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Ue.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Kf.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;Ic=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function cb(e){const[t,n]=Mx(),r=S.useContext(_f);return C.jsx(NR,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(Hx),isPresent:t,safeToRemove:n})}function PR(e,t,n){const r=wt(e)?e:wi(e);return r.start(nh("",r,t,n)),r.animation}const LR=(e,t)=>e.depth-t.depth;class FR{constructor(){this.children=[],this.isDirty=!1}add(t){Rf(this.children,t),this.isDirty=!0}remove(t){kf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(LR),this.isDirty=!1,this.children.forEach(t)}}function $R(e,t){const n=Ot.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&($r(r),e(i-t))};return Ue.setup(r,!0),()=>$r(r)}const ub=["TopLeft","TopRight","BottomLeft","BottomRight"],OR=ub.length,Np=e=>typeof e=="string"?parseFloat(e):e,Pp=e=>typeof e=="number"||he.test(e);function IR(e,t,n,r,o,i){o?(e.opacity=Ze(0,n.opacity??1,DR(r)),e.opacityExit=Ze(t.opacity??1,0,jR(r))):i&&(e.opacity=Ze(t.opacity??1,n.opacity??1,r));for(let s=0;s<OR;s++){const a=`border${ub[s]}Radius`;let l=Lp(t,a),c=Lp(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Pp(l)===Pp(c)?(e[a]=Math.max(Ze(Np(l),Np(c),r),0),(Vn.test(c)||Vn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Ze(t.rotate||0,n.rotate||0,r))}function Lp(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const DR=db(0,.5,Y0),jR=db(.5,.95,an);function db(e,t,n){return r=>r<e?0:r>t?1:n(Es(e,t,r))}function Fp(e,t){e.min=t.min,e.max=t.max}function hn(e,t){Fp(e.x,t.x),Fp(e.y,t.y)}function $p(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Op(e,t,n,r,o){return e-=t,e=ll(e,1/n,r),o!==void 0&&(e=ll(e,1/o,r)),e}function VR(e,t=0,n=1,r=.5,o,i=e,s=e){if(Vn.test(t)&&(t=parseFloat(t),t=Ze(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Ze(i.min,i.max,r);e===i&&(a-=t),e.min=Op(e.min,t,n,a,o),e.max=Op(e.max,t,n,a,o)}function Ip(e,t,[n,r,o],i,s){VR(e,t[n],t[r],t[o],t.scale,i,s)}const BR=["x","scaleX","originX"],zR=["y","scaleY","originY"];function Dp(e,t,n,r){Ip(e.x,t,BR,n?n.x:void 0,r?r.x:void 0),Ip(e.y,t,zR,n?n.y:void 0,r?r.y:void 0)}function jp(e){return e.translate===0&&e.scale===1}function fb(e){return jp(e.x)&&jp(e.y)}function Vp(e,t){return e.min===t.min&&e.max===t.max}function HR(e,t){return Vp(e.x,t.x)&&Vp(e.y,t.y)}function Bp(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function hb(e,t){return Bp(e.x,t.x)&&Bp(e.y,t.y)}function zp(e){return At(e.x)/At(e.y)}function Hp(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class WR{constructor(){this.members=[]}add(t){Rf(this.members,t),t.scheduleRender()}remove(t){if(kf(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function KR(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=n?.z||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:d,skewX:h,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Dc=["","X","Y","Z"],UR=1e3;let GR=0;function jc(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function gb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Qx(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&gb(r)}function pb({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t?.()){this.id=GR++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(XR),this.nodes.forEach(ek),this.nodes.forEach(tk),this.nodes.forEach(ZR)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new FR)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Mf),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Ax(s)&&!jE(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const d=()=>this.root.updateBlockedByResize=!1;Ue.read(()=>{f=window.innerWidth}),e(s,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=$R(d,250),Ua.hasAnimatedSinceResize&&(Ua.hasAnimatedSinceResize=!1,this.nodes.forEach(Up)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||sk,{onLayoutAnimationStart:p,onLayoutAnimationComplete:m}=c.getProps(),x=!this.targetLayout||!hb(this.targetLayout,h),y=!f&&d;if(this.options.layoutRoot||this.resumeFrom||y||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Hf(g,"layout"),onPlay:p,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,y)}else f||Up(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),$r(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(nk),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&gb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Wp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Kp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(QR),this.nodes.forEach(qR),this.nodes.forEach(YR)):this.nodes.forEach(Kp),this.clearAllSnapshots();const a=Ot.now();ht.delta=gr(0,1e3/60,a-ht.timestamp),ht.timestamp=a,ht.isProcessing=!0,Rc.update.process(ht),Rc.preRender.process(ht),Rc.render.process(ht),ht.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Kf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(JR),this.sharedNodes.forEach(rk)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!At(this.snapshot.measuredBox.x)&&!At(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=at(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!fb(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||ro(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),ak(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return at();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(lk))){const{scroll:c}=this.root;c&&(ai(a.x,c.offset.x),ai(a.y,c.offset.y))}return a}removeElementScroll(s){const a=at();if(hn(a,s),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:f}=c;c!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&hn(a,s),ai(a.x,u.offset.x),ai(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const l=at();hn(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&li(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),ro(u.latestValues)&&li(l,u.latestValues)}return ro(this.latestValues)&&li(l,this.latestValues),l}removeTransform(s){const a=at();hn(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!ro(c.latestValues))continue;ud(c.latestValues)&&c.updateSnapshot();const u=at(),f=c.measurePageBox();hn(u,f),Dp(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return ro(this.latestValues)&&Dp(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ht.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=ht.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=at(),this.targetWithTransforms=at()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),mR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):hn(this.target,this.layout.layoutBox),Gx(this.target,this.targetDelta)):hn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||ud(this.parent.latestValues)||Ux(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,l){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=at(),this.relativeTargetOrigin=at(),cl(this.relativeTargetOrigin,a,l),hn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===ht.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;hn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;k2(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=at());const{target:h}=s;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():($p(this.prevProjectionDelta.x,this.projectionDelta.x),$p(this.prevProjectionDelta.y,this.projectionDelta.y)),ys(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!Hp(this.projectionDelta.x,this.prevProjectionDelta.x)||!Hp(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ci(),this.projectionDelta=ci(),this.projectionDeltaWithTransform=ci()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=ci();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=at(),h=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=h!==g,m=this.getStack(),x=!m||m.members.length<=1,y=!!(p&&!x&&this.options.crossfade===!0&&!this.path.some(ik));this.animationProgress=0;let v;this.mixTargetDelta=b=>{const w=b/1e3;Gp(f.x,s.x,w),Gp(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(cl(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ok(this.relativeTarget,this.relativeTargetOrigin,d,w),v&&HR(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=at()),hn(v,this.relativeTarget)),p&&(this.animationValues=u,IR(u,c,this.latestValues,w,y,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&($r(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{Ua.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=wi(0)),this.currentAnimation=PR(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(UR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&mb(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||at();const f=At(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const d=At(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+d}hn(a,l),li(a,u),ys(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new WR),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&jc("z",s,c,this.animationValues);for(let u=0;u<Dc.length;u++)jc(`rotate${Dc[u]}`,s,c,this.animationValues),jc(`skew${Dc[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Ka(a?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Ka(a?.pointerEvents)||""),this.hasProjected&&!ro(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=KR(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),s.transform=f;const{x:d,y:h}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in cd){if(u[g]===void 0)continue;const{correct:p,applyTo:m,isCSSVariable:x}=cd[g],y=f==="none"?u[g]:p(u[g],c);if(m){const v=m.length;for(let b=0;b<v;b++)s[m[b]]=y}else x?this.options.visualElement.renderState.vars[g]=y:s[g]=y}this.options.layoutId&&(s.pointerEvents=c===this?Ka(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(Wp),this.root.sharedNodes.clear()}}}function qR(e){e.updateLayout()}function YR(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?rn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=At(f);f.min=n[u].min,f.max=f.min+d}):mb(o,t.layoutBox,n)&&rn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=At(n[u]);f.max=f.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=ci();ys(s,n,t.layoutBox);const a=ci();i?ys(a,e.applyTransform(r,!0),t.measuredBox):ys(a,n,t.layoutBox);const l=!fb(s);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const h=at();cl(h,t.layoutBox,f.layoutBox);const g=at();cl(g,n,d.layoutBox),hb(h,g)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function XR(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ZR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function JR(e){e.clearSnapshot()}function Wp(e){e.clearMeasurements()}function Kp(e){e.isLayoutDirty=!1}function QR(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Up(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ek(e){e.resolveTargetDelta()}function tk(e){e.calcProjection()}function nk(e){e.resetSkewAndRotation()}function rk(e){e.removeLeadSnapshot()}function Gp(e,t,n){e.translate=Ze(t.translate,0,n),e.scale=Ze(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function qp(e,t,n,r){e.min=Ze(t.min,n.min,r),e.max=Ze(t.max,n.max,r)}function ok(e,t,n,r){qp(e.x,t.x,n.x,r),qp(e.y,t.y,n.y,r)}function ik(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const sk={duration:.45,ease:[.4,0,.1,1]},Yp=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Xp=Yp("applewebkit/")&&!Yp("chrome/")?Math.round:an;function Zp(e){e.min=Xp(e.min),e.max=Xp(e.max)}function ak(e){Zp(e.x),Zp(e.y)}function mb(e,t,n){return e==="position"||e==="preserve-aspect"&&!pR(zp(t),zp(n),.2)}function lk(e){return e!==e.root&&e.scroll?.wasRoot}const ck=pb({attachResizeListener:(e,t)=>Ms(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Vc={current:void 0},yb=pb({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Vc.current){const e=new ck({});e.mount(window),e.setOptions({layoutScroll:!0}),Vc.current=e}return Vc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),uk={pan:{Feature:MR},drag:{Feature:AR,ProjectionNode:yb,MeasureLayout:cb}};function Jp(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&Ue.postRender(()=>i(t,Hs(t)))}class dk extends Ur{mount(){const{current:t}=this.node;t&&(this.unmount=FE(t,(n,r)=>(Jp(this.node,r,"Start"),o=>Jp(this.node,o,"End"))))}unmount(){}}class fk extends Ur{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Vs(Ms(this.node.current,"focus",()=>this.onFocus()),Ms(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Qp(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&Ue.postRender(()=>i(t,Hs(t)))}class hk extends Ur{mount(){const{current:t}=this.node;t&&(this.unmount=DE(t,(n,r)=>(Qp(this.node,r,"Start"),(o,{success:i})=>Qp(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const yd=new WeakMap,Bc=new WeakMap,gk=e=>{const t=yd.get(e.target);t&&t(e)},pk=e=>{e.forEach(gk)};function mk({root:e,...t}){const n=e||document;Bc.has(n)||Bc.set(n,{});const r=Bc.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(pk,{root:e,...t})),r[o]}function yk(e,t,n){const r=mk(t);return yd.set(e,n),r.observe(e),()=>{yd.delete(e),r.unobserve(e)}}const vk={some:0,all:1};class xk extends Ur{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:vk[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),d=c?u:f;d&&d(l)};return yk(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(bk(t,n))&&this.startObserver()}unmount(){}}function bk({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const wk={inView:{Feature:xk},tap:{Feature:hk},focus:{Feature:fk},hover:{Feature:dk}},Ck={layout:{ProjectionNode:yb,MeasureLayout:cb}},Sk={...cR,...wk,...uk,...Ck},Ws=T2(Sk,D2),gn={fontFamily:"Inter, sans-serif",wordBreak:"break-word"},me={common:gn,title1:{...gn,fontSize:32,lineHeight:"36px",[ls.md()]:{fontSize:24}},title2:{...gn,fontSize:24,lineHeight:"28px",[ls.md()]:{fontSize:20}},title3:{...gn,fontSize:20,lineHeight:"28px",[ls.md()]:{fontSize:18},[ls.xs()]:{fontSize:16}},headline1:{...gn,fontSize:22,lineHeight:"26px"},headline2:{...gn,fontSize:18,lineHeight:"22px"},headline3:{...gn,fontSize:16,lineHeight:"20px"},body1:{...gn,fontSize:16,lineHeight:"24px"},body2:{...gn,fontSize:14,lineHeight:"20px"},caption1:{...gn,fontSize:12,lineHeight:"16px"},caption2:{...gn,fontSize:10,lineHeight:"14px"}},{transition:_k,color:Zn,fontWeight:ma}=j,ya={text:R.css({...me.common,transition:_k.general}),"title-1":R.css({...me.title1}),"title-2":R.css({...me.title2}),"title-3":R.css({...me.title3}),"headline-1":R.css({...me.headline1}),"headline-2":R.css({...me.headline2}),"headline-3":R.css({...me.headline3}),"body-1":R.css({...me.body1}),"body-2":R.css({...me.body2}),"caption-1":R.css({...me.caption1}),"caption-2":R.css({...me.caption2}),primary:R.css({color:Zn.text.primary}),secondary:R.css({color:Zn.text.secondary}),tertiary:R.css({color:Zn.text.tertiary}),positive:R.css({color:Zn.text.positive}),negative:R.css({color:Zn.text.negative}),warning:R.css({color:Zn.text.warning}),accent:R.css({color:Zn.text.accent}),inverse:R.css({color:Zn.text.inverse}),transfer:R.css({color:Zn.text.transfer}),regular:R.css({fontWeight:ma.regular}),medium:R.css({fontWeight:ma.medium}),semibold:R.css({fontWeight:ma.semibold}),bold:R.css({fontWeight:ma.bold})},Tk=e=>{let t;e.center?t="center":e.left?t="left":e.right&&(t="right");let n;return e.uppercase?n="uppercase":e.lowercase?n="lowercase":e.capitalize&&(n="capitalize"),R.css({marginTop:e.mt,marginBottom:e.mb,marginRight:e.mr,marginLeft:e.ml,flex:e.flex,cursor:e.cursor,wordBreak:e.wordBreak,whiteSpace:e.whiteSpace,textOverflow:e.textOverflow,textDecoration:e.decoration,textAlign:t,textTransform:n,color:e.color,opacity:e.disabled?.5:void 0,overflow:e.overflow})},se=S.forwardRef(({children:e,className:t,variant:n="body-1",fontWeight:r="medium",tag:o="p",colorName:i="primary",style:s,clickOpacity:a=.5,opacityDuration:l=200,onClick:c,disabled:u,mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:x,whiteSpace:y,textOverflow:v,decoration:b,color:w,center:_,left:E,right:T,uppercase:k,lowercase:P,capitalize:O,overflow:D,...I},$)=>{const[H,U]=S.useState(!1),L=!!c,N=()=>L&&U(!0),V=()=>L&&U(!1),K=Tk({mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:x,whiteSpace:y,textOverflow:v,decoration:b,color:w,center:_,left:E,right:T,uppercase:k,lowercase:P,capitalize:O,overflow:D}),te=o,J=L?R.css({opacity:H?a:1,transition:`opacity ${l}ms ease`}):"";return C.jsx(te,{ref:$,...I,className:R.cx(ya.text,ya[n],ya[i],ya[r],J,t,K),style:s,onClick:c,onMouseDown:N,onMouseUp:V,onMouseLeave:V,onTouchStart:N,onTouchEnd:V,role:L?"button":void 0,tabIndex:L?0:void 0,children:e})});se.displayName="Text";const vb=Ws(se),{color:vd,cornerRadius:Kt,height:va,transition:Ek}=j,Rk=R.css({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",borderRadius:16,height:48,padding:"0 16px",cursor:"pointer",fontSize:16,fontWeight:600,overflow:"hidden",transition:"all 0.2s ease",gap:8}),Zi={zero:Kt.zero,xs:Kt.xs,sm:Kt.sm,md:Kt.md,lg:Kt.lg,xl:Kt.xl,"2xl":Kt["2xl"],"3xl":Kt["3xl"],"4xl":Kt["4xl"],"5xl":Kt["5xl"],"6xl":Kt["6xl"],"full-round":Kt.fullRound},kk={xs:va.button.xs,sm:va.button.sm,md:va.button.md,lg:va.button.lg},Ak={clear:R.css({backgroundColor:"transparent",border:"none"}),filled:R.css({backgroundColor:vd.fill.accentPrimary,color:"white",border:"none"}),outline:R.css({backgroundColor:"transparent",border:`1px solid ${vd.border.accentPrimary}`})},Mk=(e,t,n,r)=>{if(r)return R.css({cursor:"not-allowed",opacity:.7});const o={transition:Ek.general,borderRadius:Kt.lg,border:"none",color:e==="filled"?vd.text.inverse:`var(--text-${t})`};switch(e){case"filled":return R.css({...o,backgroundColor:`var(--fill-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${t}-${n}-hover)`}});case"outline":return R.css({...o,backgroundColor:"transparent",border:`1px solid var(--border-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});case"clear":return R.css({...o,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});default:return R.css(o)}},{color:xa}=j,Si=({disabled:e,loading:t,wrapperClassName:n,buttonClassName:r,buttonDisabledClassName:o,textClassName:i,children:s,variant:a="filled",backgroundColor:l,textColor:c,textFontWeight:u,borderColor:f,color:d="accent",opacity:h,borderRadius:g,width:p="full",size:m="md",iconLeft:x,iconRight:y,intensity:v="primary",flex:b,type:w="button",..._})=>{const E=S.useMemo(()=>{switch(p){case"full":return"100%";case"auto":return"auto";default:return p}},[p]),T=S.useMemo(()=>l||(a==="filled"?d==="neutral"?xa.fill.neutralSecondary:`var(--fill-${d}-${v})`:"transparent"),[a,l,d,v]),k=S.useMemo(()=>{if(v==="primary"){if(d==="neutral")return xa.text.secondary;if(a==="filled")return xa.text.inverse}else if(d==="neutral")return xa.text.secondary;return`var(--text-${d})`},[v,d,a]),P=S.useMemo(()=>{if(v==="primary"){if(d==="neutral")return"secondary";if(a==="filled")return"inverse"}else if(d==="neutral")return"secondary";return d},[a,d,v]),O=S.useMemo(()=>f||(a==="outline"?`var(--border-${d}-${v})`:"transparent"),[a,f,d,v]),D=S.useMemo(()=>{switch(m){case"lg":return Zi.lg;case"md":case"sm":return Zi.md;case"xs":return Zi.sm;default:return Zi.md}},[m]),I=R.cx(Rk,Mk(a,d,v,e),Ak[a],e?o:void 0,R.css({borderRadius:g?Zi[g]:D,backgroundColor:T,borderColor:O,color:c,width:"100%",height:kk[m],opacity:h||(e?.7:1)}),r),$=S.useMemo(()=>{switch(m){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[m]);return C.jsx(G,{className:R.cx(n),w:E,flex:b,relative:!0,overflow:"hidden",children:C.jsxs(Ws.button,{..._,whileTap:!e&&!t?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},disabled:e||t,className:I,type:w,children:[t?C.jsx(L0,{color:k}):C.jsxs(C.Fragment,{children:[x,C.jsx(vb,{style:{color:c},colorName:P,variant:$,className:i,textOverflow:"ellipsis",overflow:"hidden",children:s}),y]}),C.jsx(Lo,{})]})})},Nk=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",...e},M.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),Pk=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...e},M.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),{color:eo}=j,br={checkbox:R.css({display:"inline-flex",alignItems:"flex-start",gap:8,userSelect:"none"}),disabled:R.css({cursor:"not-allowed",opacity:.5}),checkbox__input:R.css({position:"absolute",opacity:0,width:"var(--checkbox-size)",height:"var(--checkbox-size)"}),checkbox__box:R.css({width:"var(--checkbox-size)",height:"var(--checkbox-size)",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${eo.border.neutralAlphaHigh}`,backgroundColor:eo.fill.bgSecondary,opacity:1,transition:"all 0.15s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative","& svg":{color:eo.border.accentPrimary}}),checked:R.css({borderColor:`${eo.border.accentPrimary} !important`,backgroundColor:`${eo.fill.accentSecondary} !important`}),error:R.css({borderColor:eo.border.negativePrimary,backgroundColor:eo.fill.negativeSecondary})},Lk={primary:R.css({}),secondary:R.css({backgroundColor:"transparent"})},Fk={sm:20,md:24},rh=S.forwardRef(({checked:e,onChange:t,disabled:n,error:r,indeterminate:o,size:i="md",title:s,titleColor:a,subtitle:l,subtitleColor:c="secondary",name:u,required:f,variant:d="primary",flex:h,readOnly:g},p)=>{const[m,x]=S.useState(!1),y=e!==void 0,v=y?e:m,b=k=>{y||x(k.target.checked),t?.(k)},w=Fk[i],_=v||o,E=!!g&&!n,T=n?"not-allowed":E?"auto":"pointer";return C.jsxs("label",{className:R.cx(br.checkbox,R.css({flex:h,cursor:T}),{[br.disabled]:n}),children:[C.jsxs(G,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${w}px`,"--checkbox-size-double":`${w*2}px`},children:[C.jsx("input",{ref:p,type:"checkbox",checked:v,onChange:E?void 0:b,onClick:k=>k.stopPropagation(),disabled:n,readOnly:E,name:u,required:f,className:R.cx(br.checkbox__input,{[br.disabled]:n},R.css({cursor:T}))}),C.jsx("div",{className:R.cx(br.checkbox__box,Lk[d],{[br.disabled]:n,[br.error]:r,[br.checked]:_}),children:_&&(o?C.jsx(Pk,{width:w*.75,height:w*.75}):C.jsx(Nk,{width:w*.75,height:w*.75}))})]}),(s||l)&&C.jsxs(G,{gap:4,children:[s&&C.jsx(se,{colorName:a,variant:i==="sm"?"body-2":"body-1",children:s}),l&&C.jsx(se,{variant:"body-2",colorName:c,children:l})]})]})});rh.displayName="Checkbox";const $k=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{opacity:.5},M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 17.9999C14.4185 17.9999 18.0002 14.4182 18.0002 9.99991C18.0002 5.58163 14.4185 1.99991 10.0002 1.99991C5.58197 1.99991 2.00024 5.58163 2.00024 9.99991C2.00024 14.4182 5.58197 17.9999 10.0002 17.9999ZM6.46514 6.46446C6.85566 6.07393 7.48883 6.07393 7.87935 6.46446L9.64712 8.23222C9.84238 8.42749 10.159 8.42749 10.3542 8.23222L12.122 6.46446C12.5125 6.07393 13.1457 6.07393 13.5362 6.46446C13.9267 6.85498 13.9267 7.48814 13.5362 7.87867L11.7684 9.64644C11.5732 9.8417 11.5732 10.1583 11.7684 10.3535L13.5362 12.1213C13.9267 12.5118 13.9267 13.145 13.5362 13.5355C13.1457 13.926 12.5125 13.926 12.122 13.5355L10.3542 11.7678C10.159 11.5725 9.84238 11.5725 9.64712 11.7678L7.87935 13.5355C7.48883 13.926 6.85566 13.926 6.46514 13.5355C6.07462 13.145 6.07462 12.5118 6.46514 12.1213L8.23291 10.3535C8.42817 10.1583 8.42817 9.8417 8.23291 9.64644L6.46514 7.87867C6.07462 7.48815 6.07462 6.85498 6.46514 6.46446Z",fill:"currentColor"}))),{color:Jt,spacing:Ji}=j,zc=R.css({opacity:.6,cursor:"not-allowed"}),yt={"input-container":R.css({backgroundColor:Jt.fill.accentSecondary,border:`1px solid ${Jt.border.neutralAlphaBasic}`,padding:`${Ji.md} ${Ji.lg}`,borderRadius:12,minHeight:40,width:"100%",transition:"border-color 0.2s ease, background-color 0.2s ease","& textarea":{resize:"none"},[`&:not(.${zc}):hover`]:{backgroundColor:Jt.fill.neutralPrimaryHover},"&:focus-within":{borderColor:Jt.border.accentPrimary,[`&:not(.${zc}):hover`]:{borderColor:Jt.border.accentPrimary}}}),input:R.css({...me.common,...me.body1,background:"transparent",width:"100%",color:Jt.text.primary,"&::placeholder":{color:Jt.text.tertiary,textOverflow:"ellipsis"}}),"input-text-size_sm":R.css({...me.body2}),"input-text-size_md":R.css({...me.body2}),"input-text-align_left":R.css({textAlign:"left"}),"input-text-align_center":R.css({textAlign:"center"}),"input-text-align_right":R.css({textAlign:"right"}),sm:R.css({height:40,padding:Ji.md}),md:R.css({height:48,padding:`14px ${Ji.lg} 14px ${Ji.lg}`}),error:R.css({borderColor:Jt.border.negativePrimary}),disabled:zc,multiline:R.css({height:"auto"}),primary:R.css({background:Jt.fill.bgPrimary}),secondary:R.css({background:Jt.fill.bgSecondary}),"clear-button":R.css({cursor:"pointer",color:Jt.text.tertiary,height:20,"&:hover":{color:Jt.text.primary}})},{spacing:em}=j;function tm(e){return{...new Event("input",{bubbles:!0}),target:e,currentTarget:e}}const _i=S.forwardRef((e,t)=>{const{label:n,prompt:r,error:o,errorText:i,size:s="md",prefix:a,suffix:l,background:c="primary",showClearButton:u,disabled:f,value:d,defaultValue:h,inputClassName:g,textAlign:p="left",...m}=e,x=e.multiline===!0,y=S.useRef(null),v=S.useRef(null),[b,w]=Po(typeof d=="string"||typeof d=="number"?String(d):void 0,typeof h=="string"||typeof h=="number"?String(h):"");S.useImperativeHandle(t,()=>({focus:()=>{y.current?.focus(),v.current?.focus()},blur:()=>{y.current?.blur(),v.current?.blur()},get value(){return y.current?.value||v.current?.value},set value(P){w(P),y.current&&(y.current.value=P),v.current&&(v.current.value=P)}}));const _=P=>{if(w(P.target.value),x){const O=e.onChange;O?.(P)}else{const O=e.onChange;O?.(P)}};S.useEffect(()=>{x&&e.autoResize&&v.current&&(v.current.style.height="auto",v.current.style.height=`${v.current.scrollHeight}px`)},[b,x,e.autoResize]);const E=()=>{if(w(""),!x){const O=y.current;if(O){O.value="";const D=tm(O),I=e.onChange;I?.(D)}return}const P=v.current;if(P){P.value="";const O=tm(P),D=e.onChange;D?.(O)}},T=()=>{if(x){const{rows:I,autoResize:$,onChange:H,multiline:U,...L}=m;return C.jsx("textarea",{ref:v,rows:e.rows??3,className:R.cx(yt.input,g,{[yt.disabled]:f,[yt[`input-text-align_${p}`]]:!!p}),disabled:f,maxLength:e.maxLength,...L,value:b,onChange:_})}const{onChange:P,multiline:O,...D}=m;return C.jsx("input",{...D,ref:y,className:R.cx(yt.input,yt[`input-text-size_${s}`],g,{[yt.disabled]:f,[yt[`input-text-align_${p}`]]:!!p}),disabled:f,type:e.type??"text",value:b,onChange:_})},k=S.useMemo(()=>c==="white"?yt.primary:c==="gray"?yt.secondary:yt[c],[c]);return C.jsxs(G,{w:"full",gap:em.sm,children:[typeof n=="string"?C.jsx(se,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",children:n}):n,C.jsxs(G,{row:!0,alignItems:x?"flex-start":"center",w:"full",gap:em.md,className:R.cx(yt["input-container"],k,yt[s],{[yt.error]:o,[yt.disabled]:f,[yt.multiline]:x}),children:[a&&C.jsx(G,{flex:"none",children:a}),C.jsx(G,{flex:"1",children:T()}),u&&b&&!f&&C.jsx(G,{flex:"none",children:C.jsx("span",{className:yt["clear-button"],onClick:E,children:C.jsx($k,{})})}),l&&C.jsx(G,{flex:"none",children:l})]}),(r||x)&&C.jsxs(G,{row:!0,gap:10,w:"full",children:[typeof r=="string"?C.jsx(se,{variant:"caption-1",colorName:"tertiary",children:r}):r,x&&e.maxLength&&C.jsx(se,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${b.length}/${e.maxLength}`})]}),i&&o&&C.jsx(se,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:i})]})});_i.displayName="Input";const Ok=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M15 8.33333H5M17.5 5H2.5M17.5 11.6667H2.5M15 15H5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Ik=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M13.3333 8.33333H2.5M16.6667 5H2.5M16.6667 11.6667H2.5M13.3333 15H2.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Dk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M17.5 8.33333H6.66665M17.5 5H3.33331M17.5 11.6667H3.33331M17.5 15H6.66665",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),jk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M5 10H11.6667C13.5076 10 15 8.50766 15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H5V10ZM5 10H12.5C14.3409 10 15.8333 11.4924 15.8333 13.3334C15.8333 15.1743 14.3409 16.6667 12.5 16.6667H5V10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Vk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M13.5 17.5H5.77614C5.2713 17.5 5.01887 17.5 4.90199 17.4002C4.80056 17.3135 4.74674 17.1836 4.75721 17.0506C4.76927 16.8974 4.94776 16.7189 5.30474 16.3619L12.3905 9.27614C12.7205 8.94613 12.8855 8.78112 13.0758 8.7193C13.2432 8.66492 13.4235 8.66492 13.5908 8.7193C13.7811 8.78112 13.9461 8.94613 14.2761 9.27614L17.5 12.5V13.5M13.5 17.5C14.9001 17.5 15.6002 17.5 16.135 17.2275C16.6054 16.9878 16.9878 16.6054 17.2275 16.135C17.5 15.6002 17.5 14.9001 17.5 13.5M13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5M8.75 7.08333C8.75 8.00381 8.00381 8.75 7.08333 8.75C6.16286 8.75 5.41667 8.00381 5.41667 7.08333C5.41667 6.16286 6.16286 5.41667 7.08333 5.41667C8.00381 5.41667 8.75 6.16286 8.75 7.08333Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Bk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M15.8334 3.33337H8.33335M11.6667 16.6667H4.16669M12.5 3.33337L7.50002 16.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),zk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{clipPath:"url(#clip0_1571_1710)"},M.createElement("path",{d:"M8.33332 10.8333C8.69119 11.3118 9.14778 11.7077 9.67211 11.9941C10.1964 12.2806 10.7762 12.4509 11.3722 12.4936C11.9681 12.5363 12.5663 12.4503 13.1261 12.2415C13.6859 12.0327 14.1942 11.7059 14.6167 11.2833L17.1167 8.78335C17.8756 7.9975 18.2956 6.94499 18.2861 5.85251C18.2766 4.76002 17.8384 3.71497 17.0659 2.94243C16.2934 2.1699 15.2483 1.7317 14.1558 1.7222C13.0633 1.71271 12.0108 2.13269 11.225 2.89168L9.79165 4.31668M11.6666 9.16668C11.3088 8.68824 10.8522 8.29236 10.3279 8.0059C9.80353 7.71943 9.22373 7.54908 8.62777 7.5064C8.03182 7.46372 7.43366 7.54971 6.87386 7.75853C6.31406 7.96735 5.80572 8.29412 5.38332 8.71668L2.88332 11.2167C2.12432 12.0025 1.70435 13.055 1.71384 14.1475C1.72334 15.24 2.16154 16.2851 2.93407 17.0576C3.70661 17.8301 4.75166 18.2683 5.84414 18.2778C6.93663 18.2873 7.98914 17.8673 8.77498 17.1083L10.2 15.6833",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),M.createElement("defs",null,M.createElement("clipPath",{id:"clip0_1571_1710"},M.createElement("rect",{width:20,height:20,fill:"white"})))),Hk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M17.5 9.99996L7.5 9.99996M17.5 4.99996L7.5 4.99996M17.5 15L7.5 15M4.16667 9.99996C4.16667 10.4602 3.79357 10.8333 3.33333 10.8333C2.8731 10.8333 2.5 10.4602 2.5 9.99996C2.5 9.53972 2.8731 9.16663 3.33333 9.16663C3.79357 9.16663 4.16667 9.53972 4.16667 9.99996ZM4.16667 4.99996C4.16667 5.4602 3.79357 5.83329 3.33333 5.83329C2.8731 5.83329 2.5 5.4602 2.5 4.99996C2.5 4.53972 2.8731 4.16663 3.33333 4.16663C3.79357 4.16663 4.16667 4.53972 4.16667 4.99996ZM4.16667 15C4.16667 15.4602 3.79357 15.8333 3.33333 15.8333C2.8731 15.8333 2.5 15.4602 2.5 15C2.5 14.5397 2.8731 14.1666 3.33333 14.1666C3.79357 14.1666 4.16667 14.5397 4.16667 15Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Wk=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M14 8.74967C14.4142 8.74967 14.75 8.41389 14.75 7.99967C14.75 7.58546 14.4142 7.24967 14 7.24967V7.99967V8.74967ZM6 7.24967C5.58579 7.24967 5.25 7.58546 5.25 7.99967C5.25 8.41389 5.58579 8.74967 6 8.74967V7.99967V7.24967ZM14 4.74967C14.4142 4.74967 14.75 4.41389 14.75 3.99967C14.75 3.58546 14.4142 3.24967 14 3.24967V3.99967V4.74967ZM6 3.24967C5.58579 3.24967 5.25 3.58546 5.25 3.99967C5.25 4.41389 5.58579 4.74967 6 4.74967V3.99967V3.24967ZM14 12.7497C14.4142 12.7497 14.75 12.4139 14.75 11.9997C14.75 11.5855 14.4142 11.2497 14 11.2497V11.9997V12.7497ZM6 11.2497C5.58579 11.2497 5.25 11.5855 5.25 11.9997C5.25 12.4139 5.58579 12.7497 6 12.7497V11.9997V11.2497ZM1.58967 3.48952C1.24295 3.71614 1.14558 4.18092 1.3722 4.52765C1.59882 4.87437 2.0636 4.97174 2.41033 4.74512L2 4.11732L1.58967 3.48952ZM3.2 3.33301H3.95C3.95 3.05764 3.79909 2.80441 3.5569 2.67337C3.31471 2.54233 3.02018 2.55455 2.78967 2.70521L3.2 3.33301ZM2.4 5.91634C1.98579 5.91634 1.65 6.25213 1.65 6.66634C1.65 7.08055 1.98579 7.41634 2.4 7.41634V6.66634V5.91634ZM4 7.41634C4.41421 7.41634 4.75 7.08055 4.75 6.66634C4.75 6.25213 4.41421 5.91634 4 5.91634V6.66634V7.41634ZM3.73743 10.8967L4.2726 11.4222L4.2726 11.4222L3.73743 10.8967ZM2 12.6663L1.46483 12.1409C1.25318 12.3565 1.19153 12.678 1.30841 12.9565C1.4253 13.2351 1.69791 13.4163 2 13.4163V12.6663ZM4 13.4163C4.41421 13.4163 4.75 13.0806 4.75 12.6663C4.75 12.2521 4.41421 11.9163 4 11.9163V12.6663V13.4163ZM1.25 10.2589C1.25 10.6731 1.58579 11.0089 2 11.0089C2.41421 11.0089 2.75 10.6731 2.75 10.2589H2H1.25ZM14 7.99967V7.24967L6 7.24967V7.99967V8.74967L14 8.74967V7.99967ZM14 3.99967V3.24967H6V3.99967V4.74967H14V3.99967ZM14 11.9997V11.2497L6 11.2497V11.9997V12.7497L14 12.7497V11.9997ZM2 4.11732L2.41033 4.74512L3.61033 3.96081L3.2 3.33301L2.78967 2.70521L1.58967 3.48952L2 4.11732ZM3.2 3.33301H2.45V6.66634H3.2H3.95V3.33301H3.2ZM3.2 6.66634V5.91634H2.4V6.66634V7.41634H3.2V6.66634ZM3.2 6.66634V7.41634H4V6.66634V5.91634H3.2V6.66634ZM3.73743 10.8967L3.20226 10.3713L1.46483 12.1409L2 12.6663L2.53517 13.1918L4.2726 11.4222L3.73743 10.8967ZM2 12.6663V13.4163H4V12.6663V11.9163H2V12.6663ZM4 10.2654H3.25C3.25 10.2957 3.23759 10.3353 3.20225 10.3713L3.73743 10.8967L4.2726 11.4222C4.57518 11.114 4.75 10.7002 4.75 10.2654H4ZM3 9.33301V10.083C3.08406 10.083 3.1515 10.1147 3.19493 10.1553C3.23791 10.1955 3.25 10.2354 3.25 10.2654H4H4.75C4.75 9.29296 3.91808 8.58301 3 8.58301V9.33301ZM2 10.2589H2.75C2.75 10.2299 2.76126 10.1927 2.80245 10.1545C2.84462 10.1155 2.91258 10.083 3 10.083V9.33301V8.58301C2.0889 8.58301 1.25 9.28004 1.25 10.2589H2Z",fill:"currentColor"})),Kk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M5 13.3334C5 15.1743 6.49238 16.6667 8.33333 16.6667H11.6667C13.5076 16.6667 15 15.1743 15 13.3334C15 11.4924 13.5076 10 11.6667 10M15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H8.33333C6.49238 3.33337 5 4.82576 5 6.66671M2.5 10H17.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Uk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M2.5 7.5L17.5 7.5M7.5 2.5L7.5 17.5M6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5C17.5 14.9001 17.5 15.6002 17.2275 16.135C16.9878 16.6054 16.6054 16.9878 16.135 17.2275C15.6002 17.5 14.9001 17.5 13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Gk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M15 3.33337V9.16671C15 11.9281 12.7614 14.1667 9.99998 14.1667C7.23856 14.1667 4.99998 11.9281 4.99998 9.16671V3.33337M3.33331 17.5H16.6666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),oh=S.createContext(null);function Ks(){const e=S.useContext(oh);if(!e)throw new Error("useEditorStates must be used within EditorState Provider");return e}const xb=S.createContext(null);function qk(){const e=S.useContext(xb);if(!e)throw new Error("useToolbarContext must be used within ToolbarContext provider");return e}var us={exports:{}};us.exports;var nm;function Yk(){return nm||(nm=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",p="[object Map]",m="[object Number]",x="[object Null]",y="[object Object]",v="[object Proxy]",b="[object RegExp]",w="[object Set]",_="[object String]",E="[object Undefined]",T="[object WeakMap]",k="[object ArrayBuffer]",P="[object DataView]",O="[object Float32Array]",D="[object Float64Array]",I="[object Int8Array]",$="[object Int16Array]",H="[object Int32Array]",U="[object Uint8Array]",L="[object Uint8ClampedArray]",N="[object Uint16Array]",V="[object Uint32Array]",K=/[\\^$.*+?()[\]{}|]/g,te=/^\[object .+?Constructor\]$/,J=/^(?:0|[1-9]\d*)$/,Z={};Z[O]=Z[D]=Z[I]=Z[$]=Z[H]=Z[U]=Z[L]=Z[N]=Z[V]=!0,Z[a]=Z[l]=Z[k]=Z[u]=Z[P]=Z[f]=Z[d]=Z[h]=Z[p]=Z[m]=Z[y]=Z[b]=Z[w]=Z[_]=Z[T]=!1;var ae=typeof Dn=="object"&&Dn&&Dn.Object===Object&&Dn,oe=typeof self=="object"&&self&&self.Object===Object&&self,fe=ae||oe||Function("return this")(),Te=t&&!t.nodeType&&t,ne=Te&&!0&&e&&!e.nodeType&&e,ve=ne&&ne.exports===Te,Ee=ve&&ae.process,De=(function(){try{var A=ne&&ne.require&&ne.require("util").types;return A||Ee&&Ee.binding&&Ee.binding("util")}catch{}})(),st=De&&De.isTypedArray;function ee(A,F,z){switch(z.length){case 0:return A.call(F);case 1:return A.call(F,z[0]);case 2:return A.call(F,z[0],z[1]);case 3:return A.call(F,z[0],z[1],z[2])}return A.apply(F,z)}function Ce(A,F){for(var z=-1,re=Array(A);++z<A;)re[z]=F(z);return re}function ze(A){return function(F){return A(F)}}function Re(A,F){return A?.[F]}function mt(A,F){return function(z){return A(F(z))}}var Ft=Array.prototype,Yt=Function.prototype,Xt=Object.prototype,xe=fe["__core-js_shared__"],Me=Yt.toString,Zt=Xt.hasOwnProperty,vg=(function(){var A=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""})(),xg=Xt.toString,yS=Me.call(Object),vS=RegExp("^"+Me.call(Zt).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ia=ve?fe.Buffer:void 0,bg=fe.Symbol,wg=fe.Uint8Array;ia&&ia.allocUnsafe;var Cg=mt(Object.getPrototypeOf,Object),Sg=Object.create,xS=Xt.propertyIsEnumerable,bS=Ft.splice,Xr=bg?bg.toStringTag:void 0,sa=(function(){try{var A=yc(Object,"defineProperty");return A({},"",{}),A}catch{}})(),wS=ia?ia.isBuffer:void 0,_g=Math.max,CS=Date.now,Tg=yc(fe,"Map"),Gi=yc(Object,"create"),SS=(function(){function A(){}return function(F){if(!Jr(F))return{};if(Sg)return Sg(F);A.prototype=F;var z=new A;return A.prototype=void 0,z}})();function Zr(A){var F=-1,z=A==null?0:A.length;for(this.clear();++F<z;){var re=A[F];this.set(re[0],re[1])}}function _S(){this.__data__=Gi?Gi(null):{},this.size=0}function TS(A){var F=this.has(A)&&delete this.__data__[A];return this.size-=F?1:0,F}function ES(A){var F=this.__data__;if(Gi){var z=F[A];return z===r?void 0:z}return Zt.call(F,A)?F[A]:void 0}function RS(A){var F=this.__data__;return Gi?F[A]!==void 0:Zt.call(F,A)}function kS(A,F){var z=this.__data__;return this.size+=this.has(A)?0:1,z[A]=Gi&&F===void 0?r:F,this}Zr.prototype.clear=_S,Zr.prototype.delete=TS,Zr.prototype.get=ES,Zr.prototype.has=RS,Zr.prototype.set=kS;function Xn(A){var F=-1,z=A==null?0:A.length;for(this.clear();++F<z;){var re=A[F];this.set(re[0],re[1])}}function AS(){this.__data__=[],this.size=0}function MS(A){var F=this.__data__,z=aa(F,A);if(z<0)return!1;var re=F.length-1;return z==re?F.pop():bS.call(F,z,1),--this.size,!0}function NS(A){var F=this.__data__,z=aa(F,A);return z<0?void 0:F[z][1]}function PS(A){return aa(this.__data__,A)>-1}function LS(A,F){var z=this.__data__,re=aa(z,A);return re<0?(++this.size,z.push([A,F])):z[re][1]=F,this}Xn.prototype.clear=AS,Xn.prototype.delete=MS,Xn.prototype.get=NS,Xn.prototype.has=PS,Xn.prototype.set=LS;function jo(A){var F=-1,z=A==null?0:A.length;for(this.clear();++F<z;){var re=A[F];this.set(re[0],re[1])}}function FS(){this.size=0,this.__data__={hash:new Zr,map:new(Tg||Xn),string:new Zr}}function $S(A){var F=ca(this,A).delete(A);return this.size-=F?1:0,F}function OS(A){return ca(this,A).get(A)}function IS(A){return ca(this,A).has(A)}function DS(A,F){var z=ca(this,A),re=z.size;return z.set(A,F),this.size+=z.size==re?0:1,this}jo.prototype.clear=FS,jo.prototype.delete=$S,jo.prototype.get=OS,jo.prototype.has=IS,jo.prototype.set=DS;function Vo(A){var F=this.__data__=new Xn(A);this.size=F.size}function jS(){this.__data__=new Xn,this.size=0}function VS(A){var F=this.__data__,z=F.delete(A);return this.size=F.size,z}function BS(A){return this.__data__.get(A)}function zS(A){return this.__data__.has(A)}function HS(A,F){var z=this.__data__;if(z instanceof Xn){var re=z.__data__;if(!Tg||re.length<n-1)return re.push([A,F]),this.size=++z.size,this;z=this.__data__=new jo(re)}return z.set(A,F),this.size=z.size,this}Vo.prototype.clear=jS,Vo.prototype.delete=VS,Vo.prototype.get=BS,Vo.prototype.has=zS,Vo.prototype.set=HS;function WS(A,F){var z=bc(A),re=!z&&xc(A),Se=!z&&!re&&Mg(A),Oe=!z&&!re&&!Se&&Pg(A),He=z||re||Se||Oe,Ae=He?Ce(A.length,String):[],We=Ae.length;for(var fn in A)He&&(fn=="length"||Se&&(fn=="offset"||fn=="parent")||Oe&&(fn=="buffer"||fn=="byteLength"||fn=="byteOffset")||kg(fn,We))||Ae.push(fn);return Ae}function pc(A,F,z){(z!==void 0&&!ua(A[F],z)||z===void 0&&!(F in A))&&mc(A,F,z)}function KS(A,F,z){var re=A[F];(!(Zt.call(A,F)&&ua(re,z))||z===void 0&&!(F in A))&&mc(A,F,z)}function aa(A,F){for(var z=A.length;z--;)if(ua(A[z][0],F))return z;return-1}function mc(A,F,z){F=="__proto__"&&sa?sa(A,F,{configurable:!0,enumerable:!0,value:z,writable:!0}):A[F]=z}var US=i_();function la(A){return A==null?A===void 0?E:x:Xr&&Xr in Object(A)?s_(A):f_(A)}function Eg(A){return qi(A)&&la(A)==a}function GS(A){if(!Jr(A)||u_(A))return!1;var F=Cc(A)?vS:te;return F.test(m_(A))}function qS(A){return qi(A)&&Ng(A.length)&&!!Z[la(A)]}function YS(A){if(!Jr(A))return d_(A);var F=Ag(A),z=[];for(var re in A)re=="constructor"&&(F||!Zt.call(A,re))||z.push(re);return z}function Rg(A,F,z,re,Se){A!==F&&US(F,function(Oe,He){if(Se||(Se=new Vo),Jr(Oe))XS(A,F,He,z,Rg,re,Se);else{var Ae=re?re(vc(A,He),Oe,He+"",A,F,Se):void 0;Ae===void 0&&(Ae=Oe),pc(A,He,Ae)}},Lg)}function XS(A,F,z,re,Se,Oe,He){var Ae=vc(A,z),We=vc(F,z),fn=He.get(We);if(fn){pc(A,z,fn);return}var Wt=Oe?Oe(Ae,We,z+"",A,F,He):void 0,Yi=Wt===void 0;if(Yi){var Sc=bc(We),_c=!Sc&&Mg(We),$g=!Sc&&!_c&&Pg(We);Wt=We,Sc||_c||$g?bc(Ae)?Wt=Ae:y_(Ae)?Wt=n_(Ae):_c?(Yi=!1,Wt=QS(We)):$g?(Yi=!1,Wt=t_(We)):Wt=[]:v_(We)||xc(We)?(Wt=Ae,xc(Ae)?Wt=x_(Ae):(!Jr(Ae)||Cc(Ae))&&(Wt=a_(We))):Yi=!1}Yi&&(He.set(We,Wt),Se(Wt,We,re,Oe,He),He.delete(We)),pc(A,z,Wt)}function ZS(A,F){return g_(h_(A,F,Fg),A+"")}var JS=sa?function(A,F){return sa(A,"toString",{configurable:!0,enumerable:!1,value:w_(F),writable:!0})}:Fg;function QS(A,F){return A.slice()}function e_(A){var F=new A.constructor(A.byteLength);return new wg(F).set(new wg(A)),F}function t_(A,F){var z=e_(A.buffer);return new A.constructor(z,A.byteOffset,A.length)}function n_(A,F){var z=-1,re=A.length;for(F||(F=Array(re));++z<re;)F[z]=A[z];return F}function r_(A,F,z,re){var Se=!z;z||(z={});for(var Oe=-1,He=F.length;++Oe<He;){var Ae=F[Oe],We=void 0;We===void 0&&(We=A[Ae]),Se?mc(z,Ae,We):KS(z,Ae,We)}return z}function o_(A){return ZS(function(F,z){var re=-1,Se=z.length,Oe=Se>1?z[Se-1]:void 0,He=Se>2?z[2]:void 0;for(Oe=A.length>3&&typeof Oe=="function"?(Se--,Oe):void 0,He&&l_(z[0],z[1],He)&&(Oe=Se<3?void 0:Oe,Se=1),F=Object(F);++re<Se;){var Ae=z[re];Ae&&A(F,Ae,re,Oe)}return F})}function i_(A){return function(F,z,re){for(var Se=-1,Oe=Object(F),He=re(F),Ae=He.length;Ae--;){var We=He[++Se];if(z(Oe[We],We,Oe)===!1)break}return F}}function ca(A,F){var z=A.__data__;return c_(F)?z[typeof F=="string"?"string":"hash"]:z.map}function yc(A,F){var z=Re(A,F);return GS(z)?z:void 0}function s_(A){var F=Zt.call(A,Xr),z=A[Xr];try{A[Xr]=void 0;var re=!0}catch{}var Se=xg.call(A);return re&&(F?A[Xr]=z:delete A[Xr]),Se}function a_(A){return typeof A.constructor=="function"&&!Ag(A)?SS(Cg(A)):{}}function kg(A,F){var z=typeof A;return F=F??s,!!F&&(z=="number"||z!="symbol"&&J.test(A))&&A>-1&&A%1==0&&A<F}function l_(A,F,z){if(!Jr(z))return!1;var re=typeof F;return(re=="number"?wc(z)&&kg(F,z.length):re=="string"&&F in z)?ua(z[F],A):!1}function c_(A){var F=typeof A;return F=="string"||F=="number"||F=="symbol"||F=="boolean"?A!=="__proto__":A===null}function u_(A){return!!vg&&vg in A}function Ag(A){var F=A&&A.constructor,z=typeof F=="function"&&F.prototype||Xt;return A===z}function d_(A){var F=[];if(A!=null)for(var z in Object(A))F.push(z);return F}function f_(A){return xg.call(A)}function h_(A,F,z){return F=_g(F===void 0?A.length-1:F,0),function(){for(var re=arguments,Se=-1,Oe=_g(re.length-F,0),He=Array(Oe);++Se<Oe;)He[Se]=re[F+Se];Se=-1;for(var Ae=Array(F+1);++Se<F;)Ae[Se]=re[Se];return Ae[F]=z(He),ee(A,this,Ae)}}function vc(A,F){if(!(F==="constructor"&&typeof A[F]=="function")&&F!="__proto__")return A[F]}var g_=p_(JS);function p_(A){var F=0,z=0;return function(){var re=CS(),Se=i-(re-z);if(z=re,Se>0){if(++F>=o)return arguments[0]}else F=0;return A.apply(void 0,arguments)}}function m_(A){if(A!=null){try{return Me.call(A)}catch{}try{return A+""}catch{}}return""}function ua(A,F){return A===F||A!==A&&F!==F}var xc=Eg((function(){return arguments})())?Eg:function(A){return qi(A)&&Zt.call(A,"callee")&&!xS.call(A,"callee")},bc=Array.isArray;function wc(A){return A!=null&&Ng(A.length)&&!Cc(A)}function y_(A){return qi(A)&&wc(A)}var Mg=wS||C_;function Cc(A){if(!Jr(A))return!1;var F=la(A);return F==h||F==g||F==c||F==v}function Ng(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function Jr(A){var F=typeof A;return A!=null&&(F=="object"||F=="function")}function qi(A){return A!=null&&typeof A=="object"}function v_(A){if(!qi(A)||la(A)!=y)return!1;var F=Cg(A);if(F===null)return!0;var z=Zt.call(F,"constructor")&&F.constructor;return typeof z=="function"&&z instanceof z&&Me.call(z)==yS}var Pg=st?ze(st):qS;function x_(A){return r_(A,Lg(A))}function Lg(A){return wc(A)?WS(A):YS(A)}var b_=o_(function(A,F,z){Rg(A,F,z)});function w_(A){return function(){return A}}function Fg(A){return A}function C_(){return!1}e.exports=b_})(us,us.exports)),us.exports}var Xk=Yk();const Zk=Cf(Xk),bb=S.createContext(null);function Jk(){return S.useContext(bb)}function Qk({children:e,locale:t}){return C.jsx(bb.Provider,{value:t||null,children:e})}function e3({localeKey:e,defaultLocale:t}){const n=S.createContext(t);function r(s){const{extraLocale:a}=s||{},l=Jk();return{value:S.useMemo(()=>{const u=l?l[e]:null,f=[{},t];return u&&f.push(u),a&&f.push(a),Zk(...f)},[t,a,e,l])}}function o(){return S.useContext(n)}function i({children:s,locale:a}){const{value:l}=r({extraLocale:a});return C.jsx(n.Provider,{value:l,children:s})}return{Context:n,useComposeLocaleProviderValue:r,useLocale:o,Provider:i}}const wb="MarkdownTextEditor",t3={toolbar:{link:{textPlaceholder:"Enter the text to display",linkPlaceholder:"Paste a link",linkErrorText:"Please enter a valid link",buttonText:"Save"},table:{maxRowsErrorText:e=>`Maximum number of rows is ${e.limit}`,maxColumnsErrorText:e=>`Maximum number of columns is ${e.limit}`,minRowsErrorText:e=>`Minimum number of rows is ${e.limit}`,minColumnsErrorText:e=>`Minimum number of columns is ${e.limit}`,rowsPlaceholder:"Rows count",columnsPlaceholder:"Columns count",buttonText:"Create table"},textSize:{paragraph:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3"},preview:{show:"Preview",hide:"Preview"},actions:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",link:"Link",image:"Image",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",table:"Table",bulletList:"Bullet list",numberedList:"Numbered list"}}},{Provider:n3,useLocale:Us}=e3({localeKey:wb,defaultLocale:t3}),Cb=S.createContext(null);function r3(e,t){return{getTheme:function(){return t??null}}}function it(){const e=S.useContext(Cb);return e==null&&(function(t,...n){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(const i of n)o.append("v",i);throw r.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),e}function q(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Sb(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Mn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,o3=Mn&&"documentMode"in document?document.documentMode:null,vn=Mn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),xo=Mn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ul=!(!Mn||!("InputEvent"in window)||o3)&&"getTargetRanges"in new window.InputEvent("input"),Gs=Mn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),$i=Mn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,i3=Mn&&/Android/.test(navigator.userAgent),_b=Mn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),rm=Mn&&i3&&_b,qs=Mn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&vn&&!_b;function Tb(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}const s3=0,a3=1,l3=2,Eb=128,c3=1,u3=2,d3=3,f3=4,h3=5,g3=6,Bl=Gs||$i||qs?" ":"​",Ir=`
35
35
 
36
- `,aA=yo?" ":Il,Ir={bold:1,capitalize:1024,code:16,highlight:_1,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},lA={directionless:1,unmergeable:2},tm={center:2,end:6,justify:4,left:1,right:3,start:5},cA={[nA]:"center",[sA]:"end",[oA]:"justify",[tA]:"left",[rA]:"right",[iA]:"start"},uA={normal:0,segmented:2,token:1},dA={[Jk]:"normal",[eA]:"segmented",[Qk]:"token"},nm="$config";function T1(e,t,n,r,o,i){let s=e.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===t&&(B(s)&&T1(s,a,n,r,o,i),n.has(a)||i.delete(a),o.push(a)),s=s.getNextSibling()}}let pd=!1,nh=0;function fA(e){nh=e.timeStamp}function Vc(e,t,n){const r=e.nodeName==="BR",o=t.__lexicalLineBreak;return o&&(e===o||r&&e.previousSibling===o)||r&&Yl(e,n)!==void 0}function hA(e,t,n){const r=Ft(dn(n));let o=null,i=null;r!==null&&r.anchorNode===e&&(o=r.anchorOffset,i=r.focusOffset);const s=e.nodeValue;s!==null&&_h(t,s,o,i,!1)}function gA(e,t,n){if(W(e)){const r=e.anchor.getNode();if(r.is(n)&&e.format!==r.getFormat())return!1}return vr(t)&&n.isAttached()}function pA(e,t,n,r){for(let o=e;o&&!x3(o);o=Ys(o)){const i=Yl(o,t);if(i!==void 0){const s=Pe(i,n);if(s)return Se(s)||!Be(o)?void 0:[o,s]}else if(o===r)return[r,Eb(n)]}}function E1(e,t,n){pd=!0;const r=performance.now()-nh>100;try{zn(e,()=>{const o=Y()||(function(d){return d.getEditorState().read(()=>{const h=Y();return h!==null?h.clone():null})})(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let d=0;d<t.length;d++){const h=t[d],g=h.type,p=h.target,m=pA(p,e,a,s);if(!m)continue;const[x,y]=m;if(g==="characterData")r&&X(y)&&vr(p)&&gA(o,p,y)&&hA(p,y,e);else if(g==="childList"){c=!0;const v=h.addedNodes;for(let _=0;_<v.length;_++){const E=v[_],T=_b(E),k=E.parentNode;if(k!=null&&E!==l&&T===null&&!Vc(E,k,e)){if(yo){const P=(Be(E)?E.innerText:null)||E.nodeValue;P&&(u+=P)}k.removeChild(E)}}const b=h.removedNodes,w=b.length;if(w>0){let _=0;for(let E=0;E<w;E++){const T=b[E];(Vc(T,p,e)||l===T)&&(p.appendChild(T),_++)}w!==_&&i.set(x,y)}}}if(i.size>0)for(const[d,h]of i)h.reconcileObservedMutation(d,e);const f=n.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){const x=g[m],y=x.parentNode;y==null||x.nodeName!=="BR"||Vc(x,p,e)||y.removeChild(x)}}n.takeRecords()}o!==null&&(c&&Ge(o),yo&&Mb(e)&&o.insertRawText(u))})}finally{pd=!1}}function R1(e){const t=e._observer;t!==null&&E1(e,t.takeRecords(),t)}function k1(e){(function(t){nh===0&&dn(t).addEventListener("textInput",fA,!0)})(e),e._observer=new MutationObserver((t,n)=>{E1(e,t,n)})}let mA=class{key;parse;unparse;isEqual;defaultValue;constructor(t,n){this.key=t,this.parse=n.parse.bind(n),this.unparse=(n.unparse||bA).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0)}};function yA(e,t){return new mA(e,t)}function A1(e,t,n="latest"){const r=(n==="latest"?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function jc(e,t,n){let r;if(ut(),typeof n=="function"){const i=e.getLatest(),s=A1(i,t);if(r=n(s),t.isEqual(s,r))return i}else r=n;const o=e.getWritable();return N1(o).updateFromKnown(t,r),o}function vA(e){const t=new Map,n=new Set;for(let r=typeof e=="function"?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:o}=Zl(r);if(o&&o.stateConfigs)for(const i of o.stateConfigs){let s;"stateConfig"in i?(s=i.stateConfig,i.flat&&n.add(s.key)):s=i,t.set(s.key,s)}}return{flatKeys:n,sharedConfigMap:t}}let xA=class M1{node;knownState;unknownState;sharedNodeState;size;constructor(t,n,r=void 0,o=new Map,i=void 0){this.node=t,this.sharedNodeState=n,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,a=i!==void 0?i:(function(l,c,u){let f=u.size;if(c)for(const d in c){const h=l.get(d);h&&u.has(h)||f++}return f})(s,r,o);this.size=a}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const o=this.unknownState[t.key];o!==void 0&&(r=t.parse(o)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},n={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in t&&(n[r]=t[r],delete t[r]);return rm(t)&&(n.$=t),n}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,o=new Map(this.knownState);return new M1(t,n,(function(i,s,a){let l;if(a)for(const[c,u]of Object.entries(a)){const f=i.get(c);f?s.has(f)||s.set(f,f.parse(u)):(l=l||{},l[c]=u)}return l})(n.sharedConfigMap,o,r),o,this.size)}updateFromKnown(t,n){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:o,unknownState:i}=this;o.has(t)||i&&r in i||(i&&(delete i[r],this.unknownState=rm(i)),this.size++),o.set(t,n)}updateFromUnknown(t,n){const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(const[r,o]of Object.entries(t))this.updateFromUnknown(r,o)}};function N1(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new xA(t,P1(t));return t.__state=n,n}function P1(e){return e.__state?e.__state.sharedNodeState:vb(Vi(),e.getType()).sharedNodeState}function rm(e){if(e)for(const t in e)return e}function bA(e){return e}function om(e,t,n){for(const[r,o]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const i=n?n.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function im(e,t,n){const{unknownState:r}=t,o=n?n.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!e.has(i)&&(e.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function sm(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function am(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style,l=e.__state,c=t.__state;return(n===null||n===i)&&(r===null||r===s)&&(o===null||o===a)&&(e.__state===null||l===c||(function(u,f){if(u===f)return!0;if(u&&f&&u.size!==f.size)return!1;const d=new Set;return!(u&&om(d,u,f)||f&&om(d,f,u)||u&&im(d,u,f)||f&&im(d,f,u))})(l,c))}function lm(e,t){const n=e.mergeWithSibling(t),r=$e()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function cm(e){let t,n,r=e;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&X(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(am(t,r)){r=lm(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&X(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(am(r,n)){r=lm(r,n);break}break}n.remove()}}else r.remove()}function As(e){return um(e.anchor),um(e.focus),e}function um(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),X(r)){e.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!B(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}let vo,Ct,Ms,Dl,md,yd,xo,Sn,vd,Ns,lt="",Ln=null,no=null,or="",Xo=!1,ll=!1;function cl(e,t){const n=xo.get(e);if(t!==null){const r=Cd(e);r.parentNode===t&&t.removeChild(r)}if(Sn.has(e)||Ct._keyToDOMMap.delete(e),B(n)){const r=dl(n,xo);xd(r,0,r.length-1,null)}n!==void 0&&Th(Ns,Ms,Dl,n,"destroyed")}function xd(e,t,n,r){let o=t;for(;o<=n;++o){const i=e[o];i!==void 0&&cl(i,r)}}function eo(e,t){e.setProperty("text-align",t)}const wA="40px";function F1(e,t){const n=vo.theme.indent;if(typeof n=="string"){const o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||wA;e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${r})`)}function L1(e,t){const n=e.style;t===0?eo(n,""):t===1?eo(n,"left"):t===2?eo(n,"center"):t===3?eo(n,"right"):t===4?eo(n,"justify"):t===5?eo(n,"start"):t===6&&eo(n,"end")}function bd(e,t){const n=(function(r){const o=r.__dir;if(o!==null)return o;if(ot(r))return null;const i=r.getParentOrThrow();return ot(i)&&i.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function ul(e,t){const n=Sn.get(e);n===void 0&&q(60);const r=n.createDOM(vo,Ct);if((function(o,i,s){const a=s._keyToDOMMap;(function(l,c,u){const f=`__lexicalKey_${c._key}`;l[f]=u})(i,s,o),a.set(o,i)})(e,r,Ct),X(n)?r.setAttribute("data-lexical-text","true"):Se(n)&&r.setAttribute("data-lexical-decorator","true"),B(n)){const o=n.__indent,i=n.__size;if(bd(r,n),o!==0&&F1(r,o),i!==0){const a=i-1;wd(dl(n,Sn),n,0,a,n.getDOMSlot(r))}const s=n.__format;s!==0&&L1(r,s),n.isInline()||$1(null,n,r),Xl(n)&&(lt+=Or,or+=Or)}else{const o=n.getTextContent();if(Se(n)){const i=n.decorate(Ct,vo);i!==null&&O1(e,i),r.contentEditable="false"}lt+=o,or+=o}return t!==null&&t.insertChild(r),Th(Ns,Ms,Dl,n,"created"),r}function wd(e,t,n,r,o){const i=lt;lt="";let s=n;for(;s<=r;++s){ul(e[s],o);const a=Sn.get(e[s]);a!==null&&X(a)&&Ln===null&&(Ln=a.getFormat(),no=a.getStyle())}Xl(t)&&(lt+=Or),o.element.__lexicalTextContent=lt,lt=i+lt}function dm(e,t){if(e){const n=e.__last;if(n){const r=t.get(n);if(r)return Bn(r)?"line-break":Se(r)&&r.isInline()?"decorator":null}return"empty"}return null}function $1(e,t,n){const r=dm(e,xo),o=dm(t,Sn);r!==o&&t.getDOMSlot(n).setManagedLineBreak(o)}function CA(e,t,n){var r;Ln=null,no=null,(function(o,i,s){const a=lt,l=o.__size,c=i.__size;lt="";const u=s.element;if(l===1&&c===1){const f=o.__first,d=i.__first;if(f===d)cs(f,u);else{const g=Cd(f),p=ul(d,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){const x=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(x)}throw m}cl(f,null)}const h=Sn.get(d);X(h)&&Ln===null&&(Ln=h.getFormat(),no=h.getStyle())}else{const f=dl(o,xo),d=dl(i,Sn);if(f.length!==l&&q(227),d.length!==c&&q(228),l===0)c!==0&&wd(d,i,0,c-1,s);else if(c===0){if(l!==0){const h=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;xd(f,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,x,y){const v=m-1,b=x-1;let w,_,E=y.getFirstChild(),T=0,k=0;for(;T<=v&&k<=b;){const D=g[T],I=p[k];if(D===I)E=Bc(cs(I,y.element)),T++,k++;else{w===void 0&&(w=new Set(g)),_===void 0&&(_=new Set(p));const H=_.has(D),U=w.has(I);if(H)if(U){const F=Co(Ct,I);F===E?E=Bc(cs(I,y.element)):(y.withBefore(E).insertChild(F),cs(I,y.element)),T++,k++}else ul(I,y.withBefore(E)),k++;else E=Bc(Cd(D)),cl(D,y.element),T++}const $=Sn.get(I);$!==null&&X($)&&Ln===null&&(Ln=$.getFormat(),no=$.getStyle())}const P=T>v,O=k>b;if(P&&!O){const D=p[b+1],I=D===void 0?null:Ct.getElementByKey(D);wd(p,h,k,b,y.withBefore(I))}else O&&!P&&xd(g,T,v,y.element)})(i,f,d,l,c,s)}Xl(i)&&(lt+=Or),u.__lexicalTextContent=lt,lt=a+lt})(e,t,t.getDOMSlot(n)),r=t,Ln==null||Ln===r.__textFormat||ll||r.setTextFormat(Ln),(function(o){no==null||no===o.__textStyle||ll||o.setTextStyle(no)})(t)}function dl(e,t){const n=[];let r=e.__first;for(;r!==null;){const o=t.get(r);o===void 0&&q(101),n.push(r),r=o.__next}return n}function cs(e,t){const n=xo.get(e);let r=Sn.get(e);n!==void 0&&r!==void 0||q(61);const o=Xo||yd.has(e)||md.has(e),i=Co(Ct,e);if(n===r&&!o){if(B(n)){const s=i.__lexicalTextContent;s!==void 0&&(lt+=s,or+=s)}else{const s=n.getTextContent();or+=s,lt+=s}return i}if(n!==r&&o&&Th(Ns,Ms,Dl,r,"updated"),r.updateDOM(n,i,vo)){const s=ul(e,null);return t===null&&q(62),t.replaceChild(s,i),cl(e,null),s}if(B(n)&&B(r)){const s=r.__indent;(Xo||s!==n.__indent)&&F1(i,s);const a=r.__format;if((Xo||a!==n.__format)&&L1(i,a),o&&(CA(n,r,i),ot(r)||r.isInline()||$1(n,r,i)),Xl(r)&&(lt+=Or,or+=Or),(Xo||r.__dir!==n.__dir)&&(bd(i,r),ot(r)&&!Xo))for(const l of r.getChildren())B(l)&&bd(Co(Ct,l.getKey()),l)}else{const s=r.getTextContent();if(Se(r)){const a=r.decorate(Ct,vo);a!==null&&O1(e,a)}lt+=s,or+=s}if(!ll&&ot(r)&&r.__cachedText!==or){const s=r.getWritable();s.__cachedText=or,r=s}return i}function O1(e,t){let n=Ct._pendingDecorators;const r=Ct._decorators;if(n===null){if(r[e]===t)return;n=Tb(Ct)}n[e]=t}function Bc(e){let t=e.nextSibling;return t!==null&&t===Ct._blockCursorElement&&(t=t.nextSibling),t}function SA(e,t,n,r,o,i){lt="",or="",Xo=r===2,Ct=n,vo=n._config,Ms=n._nodes,Dl=Ct._listeners.mutation,md=o,yd=i,xo=e._nodeMap,Sn=t._nodeMap,ll=t._readOnly,vd=new Map(n._keyToDOMMap);const s=new Map;return Ns=s,cs("root",null),Ct=void 0,Ms=void 0,md=void 0,yd=void 0,xo=void 0,Sn=void 0,vo=void 0,vd=void 0,Ns=void 0,s}function Cd(e){const t=vd.get(e);return t===void 0&&q(75,e),t}function le(e){return{type:e}}const lr=le("SELECTION_CHANGE_COMMAND"),rh=le("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Vl=le("CLICK_COMMAND"),I1=le("BEFORE_INPUT_COMMAND"),D1=le("INPUT_COMMAND"),V1=le("COMPOSITION_START_COMMAND"),j1=le("COMPOSITION_END_COMMAND"),Pr=le("DELETE_CHARACTER_COMMAND"),ui=le("INSERT_LINE_BREAK_COMMAND"),bo=le("INSERT_PARAGRAPH_COMMAND"),go=le("CONTROLLED_TEXT_INSERTION_COMMAND"),oh=le("PASTE_COMMAND"),Sd=le("REMOVE_TEXT_COMMAND"),Si=le("DELETE_WORD_COMMAND"),wo=le("DELETE_LINE_COMMAND"),It=le("FORMAT_TEXT_COMMAND"),B1=le("UNDO_COMMAND"),z1=le("REDO_COMMAND"),H1=le("KEYDOWN_COMMAND"),ih=le("KEY_ARROW_RIGHT_COMMAND"),_A=le("MOVE_TO_END"),sh=le("KEY_ARROW_LEFT_COMMAND"),TA=le("MOVE_TO_START"),ah=le("KEY_ARROW_UP_COMMAND"),lh=le("KEY_ARROW_DOWN_COMMAND"),fl=le("KEY_ENTER_COMMAND"),W1=le("KEY_SPACE_COMMAND"),jl=le("KEY_BACKSPACE_COMMAND"),ch=le("KEY_ESCAPE_COMMAND"),uh=le("KEY_DELETE_COMMAND"),dh=le("KEY_TAB_COMMAND"),EA=le("INSERT_TAB_COMMAND"),RA=le("INDENT_CONTENT_COMMAND"),fm=le("OUTDENT_CONTENT_COMMAND"),K1=le("DROP_COMMAND"),di=le("FORMAT_ELEMENT_COMMAND"),U1=le("DRAGSTART_COMMAND"),G1=le("DRAGOVER_COMMAND"),kA=le("DRAGEND_COMMAND"),Bl=le("COPY_COMMAND"),zl=le("CUT_COMMAND"),_d=le("SELECT_ALL_COMMAND"),q1=le("FOCUS_COMMAND"),AA=le("BLUR_COMMAND"),MA=le("KEY_MODIFIER_COMMAND"),Zn=Object.freeze({}),Td=[["keydown",function(e,t){Ps=e.timeStamp,Y1=e.key,!t.isComposing()&&Q(t,H1,e)}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;xn(n)&&r!=="touch"&&r!=="pen"&&e.button===0&&zn(t,()=>{xb(n)||(kd=!0)})}],["compositionstart",function(e,t){Q(t,V1,e)}],["compositionend",function(e,t){yo?us=!0:Fi||!Ws&&!Ks?Q(t,j1,e):(Ad=!0,Md=e.data)}],["input",function(e,t){e.stopPropagation(),zn(t,()=>{t.dispatchCommand(D1,e)},{event:e}),Zo=null}],["click",function(e,t){zn(t,()=>{const n=Y(),r=Ft(dn(t)),o=Gn();if(r){if(W(n)){const i=n.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&n.isCollapsed()&&!ot(s)&&qe().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&n.is(o))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&s!==n.focus.getNode()){const a=be(s,l=>B(l)&&!l.isInline());B(a)&&a.select(0)}}else if(e.pointerType==="touch"||e.pointerType==="pen"){const i=r.anchorNode;(Be(i)||vr(i))&&Ge(Ul(o,r,t,e))}}Q(t,Vl,e)})}],["cut",Zn],["copy",Zn],["dragstart",Zn],["dragover",Zn],["dragend",Zn],["paste",Zn],["focus",Zn],["blur",Zn],["drop",Zn]];al&&Td.push(["beforeinput",(e,t)=>(function(n,r){const o=n.inputType;o==="deleteCompositionText"||yo&&Mb(r)||o!=="insertCompositionText"&&Q(r,I1,n)})(e,t)]);let Ps=0,Y1=null,X1=0,Zo=null;const Ed=new WeakMap,hl=new WeakMap;let Rd=!1,kd=!1,ms=!1,us=!1,Ad=!1,Md="",io=null,Z1=[0,"",0,"root",0];function J1(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=$e(),c=Ft(dn(l)),u=c!==null?c.anchorNode:null,f=i.key,d=l.getElementByKey(f),h=n.length;return f!==s.key||!X(a)||(!o&&(!al||X1<r+50)||a.isDirty()&&h<2||Rb(n))&&i.offset!==s.offset&&!a.isComposing()||nr(a)||a.isDirty()&&h>1||(o||!al)&&d!==null&&!a.isComposing()&&u!==Ti(d)||c!==null&&t!==null&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;const m=g.anchor.offset,x=p.getParentOrThrow(),y=po(p);return m===0?!p.canInsertTextBefore()||!x.canInsertTextBefore()&&!p.isComposing()||y||(function(v){const b=v.getPreviousSibling();return(X(b)||B(b)&&b.isInline())&&!b.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!x.canInsertTextAfter()&&!p.isComposing()||y)})(e,a)}function hm(e,t){return vr(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function gm(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;Rd&&(Rd=!1,hm(r,o)&&hm(i,s)&&!io)||zn(t,()=>{if(!n)return void Ge(null);if(!qs(t,r,i))return;let a=Y();if(io&&W(a)&&a.isCollapsed()){const l=a.anchor,c=io.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=io.clone(),Ge(a))}if(io=null,W(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){e.type==="Range"&&e.anchorNode===e.focusNode&&(a.dirty=!0);const u=dn(t).event,f=u?u.timeStamp:performance.now(),[d,h,g,p,m]=Z1,x=qe(),y=t.isComposing()===!1&&x.getTextContent()==="";if(f<m+200&&l.offset===g&&l.key===p)Wa(a,d,h);else if(l.type==="text")X(c)||q(141),Q1(a,c);else if(l.type==="element"&&!y){B(c)||q(259);const v=l.getNode();v.isEmpty()?(function(b,w){const _=w.getTextFormat(),E=w.getTextStyle();Wa(b,_,E)})(a,v):Wa(a,0,"")}}else{const u=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),p=g?s:o,m=g?o:s,x=g?f:u,y=g?u:f;let v=2047,b=!1;for(let w=0;w<h;w++){const _=d[w],E=_.getTextContentSize();if(X(_)&&E!==0&&!(w===0&&_.__key===x&&p===E||w===h-1&&_.__key===y&&m===0)&&(b=!0,v&=_.getFormat(),v===0))break}a.format=b?v:0}}Q(t,lr,void 0)})}function Wa(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Q1(e,t){Wa(e,t.getFormat(),t.getStyle())}function eb(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function NA(e){const t=e.inputType,n=eb(e),r=$e(),o=Y();if(t==="deleteContentBackward"){if(o===null){const f=Gn();if(!W(f))return!0;Ge(f.clone())}if(W(o)){const f=o.anchor.key===o.focus.key;if(i=e.timeStamp,Y1==="MediaLast"&&i<Ps+30&&r.isComposing()&&f){if(gt(null),Ps=0,setTimeout(()=>{zn(r,()=>{gt(null)})},30),W(o)){const d=o.anchor.getNode();d.markDirty(),X(d)||q(142),Q1(o,d)}}else{gt(null),e.preventDefault();const d=o.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),p=o.anchor.offset===0&&o.focus.offset===h.length;let m=em&&f&&!p&&g;if(m&&o.isCollapsed()&&(m=!Se($d(o.anchor,!0))),!m){Q(r,Pr,!0);const x=Y();em&&W(x)&&x.isCollapsed()&&(io=x,setTimeout(()=>io=null))}}return!0}}var i;if(!W(o))return!0;const s=e.data;Zo!==null&&Sh(!1,r,Zo),o.dirty&&Zo===null||!o.isCollapsed()||ot(o.anchor.getNode())||n===null||o.applyDOMRange(n),Zo=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(s===`
37
- `)e.preventDefault(),Q(r,ui,!1);else if(s===Or)e.preventDefault(),Q(r,bo,void 0);else if(s==null&&e.dataTransfer){const f=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(f)}else s!=null&&J1(o,n,s,e.timeStamp,!0)?(e.preventDefault(),Q(r,go,s)):Zo=s;return X1=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Q(r,go,e);break;case"insertFromComposition":gt(null),Q(r,go,e);break;case"insertLineBreak":gt(null),Q(r,ui,!1);break;case"insertParagraph":gt(null),ms&&!Fi?(ms=!1,Q(r,ui,!1)):Q(r,bo,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Q(r,oh,e);break;case"deleteByComposition":(function(f,d){return f!==d||B(f)||B(d)||!po(f)||!po(d)})(c,u)&&Q(r,Sd,e);break;case"deleteByDrag":case"deleteByCut":Q(r,Sd,e);break;case"deleteContent":Q(r,Pr,!1);break;case"deleteWordBackward":Q(r,Si,!0);break;case"deleteWordForward":Q(r,Si,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Q(r,wo,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Q(r,wo,!1);break;case"formatStrikeThrough":Q(r,It,"strikethrough");break;case"formatBold":Q(r,It,"bold");break;case"formatItalic":Q(r,It,"italic");break;case"formatUnderline":Q(r,It,"underline");break;case"historyUndo":Q(r,B1,void 0);break;case"historyRedo":Q(r,z1,void 0)}return!0}function PA(e){if(Be(e.target)&&xb(e.target))return!0;const t=$e(),n=Y(),r=e.data,o=eb(e);if(r!=null&&W(n)&&J1(n,o,r,e.timeStamp,!1)){us&&(gl(t,r),us=!1);const i=n.anchor.getNode(),s=Ft(dn(t));if(s===null)return!0;const a=n.isBackward(),l=a?n.anchor.offset:n.focus.offset,c=a?n.focus.offset:n.anchor.offset;al&&!n.isCollapsed()&&X(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,l)+r+i.getTextContent().slice(l+c)===Ab(s.anchorNode)||Q(t,go,r);const u=r.length;yo&&u>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=u),Ws||Fi||Ks||!t.isComposing()||(Ps=0,gt(null))}else Sh(!1,t,r!==null?r:void 0),us&&(gl(t,r||void 0),us=!1);return(function(){ut();const i=$e();R1(i)})(),!0}function FA(e){const t=$e(),n=Y();if(W(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();gt(r.key),(e.timeStamp<Ps+30||r.type==="element"||!n.isCollapsed()||o.getFormat()!==n.format||X(o)&&o.getStyle()!==n.style)&&Q(t,go,aA)}return!0}function LA(e){return gl($e(),e.data),!0}function gl(e,t){const n=e._compositionKey;if(gt(null),n!==null&&t!=null){if(t===""){const r=Pe(n),o=Ti(e.getElementByKey(n));return void(o!==null&&o.nodeValue!==null&&X(r)&&_h(r,o.nodeValue,null,null,!0))}if(t[t.length-1]===`
38
- `){const r=Y();if(W(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void Q(e,fl,null)}}}Sh(!0,e,t)}function $A(e){const t=$e();if(e.key==null)return!0;if(Ad&&Vm(e))return zn(t,()=>{gl(t,Md)}),Ad=!1,Md="",!0;if((function(n){return Ne(n,"ArrowRight",{shiftKey:"any"})})(e))Q(t,ih,e);else if((function(n){return Ne(n,"ArrowRight",Qn)})(e))Q(t,_A,e);else if((function(n){return Ne(n,"ArrowLeft",{shiftKey:"any"})})(e))Q(t,sh,e);else if((function(n){return Ne(n,"ArrowLeft",Qn)})(e))Q(t,TA,e);else if((function(n){return Ne(n,"ArrowUp",{altKey:"any",shiftKey:"any"})})(e))Q(t,ah,e);else if((function(n){return Ne(n,"ArrowDown",{altKey:"any",shiftKey:"any"})})(e))Q(t,lh,e);else if((function(n){return Ne(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(e))ms=!0,Q(t,fl,e);else if((function(n){return n.key===" "})(e))Q(t,W1,e);else if((function(n){return vn&&Ne(n,"o",{ctrlKey:!0})})(e))e.preventDefault(),ms=!0,Q(t,ui,!0);else if((function(n){return Ne(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(e))ms=!1,Q(t,fl,e);else if((function(n){return Ne(n,"Backspace",{shiftKey:"any"})||vn&&Ne(n,"h",{ctrlKey:!0})})(e))Vm(e)?Q(t,jl,e):(e.preventDefault(),Q(t,Pr,!0));else if((function(n){return n.key==="Escape"})(e))Q(t,ch,e);else if((function(n){return Ne(n,"Delete",{})||vn&&Ne(n,"d",{ctrlKey:!0})})(e))(function(n){return n.key==="Delete"})(e)?Q(t,uh,e):(e.preventDefault(),Q(t,Pr,!1));else if((function(n){return Ne(n,"Backspace",Dm)})(e))e.preventDefault(),Q(t,Si,!0);else if((function(n){return Ne(n,"Delete",Dm)})(e))e.preventDefault(),Q(t,Si,!1);else if((function(n){return vn&&Ne(n,"Backspace",{metaKey:!0})})(e))e.preventDefault(),Q(t,wo,!0);else if((function(n){return vn&&(Ne(n,"Delete",{metaKey:!0})||Ne(n,"k",{ctrlKey:!0}))})(e))e.preventDefault(),Q(t,wo,!1);else if((function(n){return Ne(n,"b",Qn)})(e))e.preventDefault(),Q(t,It,"bold");else if((function(n){return Ne(n,"u",Qn)})(e))e.preventDefault(),Q(t,It,"underline");else if((function(n){return Ne(n,"i",Qn)})(e))e.preventDefault(),Q(t,It,"italic");else if((function(n){return Ne(n,"Tab",{shiftKey:"any"})})(e))Q(t,dh,e);else if((function(n){return Ne(n,"z",Qn)})(e))e.preventDefault(),Q(t,B1,void 0);else if((function(n){return vn?Ne(n,"z",{metaKey:!0,shiftKey:!0}):Ne(n,"y",{ctrlKey:!0})||Ne(n,"z",{ctrlKey:!0,shiftKey:!0})})(e))e.preventDefault(),Q(t,z1,void 0);else{const n=t._editorState._selection;n===null||W(n)?jm(e)&&(e.preventDefault(),Q(t,_d,e)):(function(r){return Ne(r,"c",Qn)})(e)?(e.preventDefault(),Q(t,Bl,e)):(function(r){return Ne(r,"x",Qn)})(e)?(e.preventDefault(),Q(t,zl,e)):jm(e)&&(e.preventDefault(),Q(t,_d,e))}return(function(n){return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey})(e)&&t.dispatchCommand(MA,e),!0}function tb(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}const fi=new Map;function nb(e){const t=p3(e.target);if(t===null)return;const n=bb(t.anchorNode);if(n===null)return;kd&&(kd=!1,zn(n,()=>{const l=Gn(),c=t.anchorNode;(Be(c)||vr(c))&&Ge(Ul(l,t,n,e))}));const r=Ch(n),o=r[r.length-1],i=o._key,s=fi.get(i),a=s||o;a!==n&&gm(t,a,!1),gm(t,n,!0),n!==o?fi.set(i,n):s&&fi.delete(i)}function pm(e){e._lexicalHandled=!0}function mm(e){return e._lexicalHandled===!0}function OA(e){const t=Ed.get(e);if(t===void 0)return;const n=hl.get(t);if(n===void 0)return;const r=n-1;r>=0||q(164),Ed.delete(e),hl.set(t,r),r===0&&t.removeEventListener("selectionchange",nb);const o=ql(e);wh(o)?((function(s){if(s._parentEditor!==null){const a=Ch(s),l=a[a.length-1]._key;fi.get(l)===s&&fi.delete(l)}else fi.delete(s._key)})(o),e.__lexicalEditor=null):o&&q(198);const i=tb(e);for(let s=0;s<i.length;s++)i[s]();e.__lexicalEventHandles=[]}function Nd(e,t,n){ut();const r=e.__key,o=e.getParent();if(o===null)return;const i=(function(a){const l=Y();if(!W(l)||!B(a))return l;const{anchor:c,focus:u}=l,f=c.getNode(),d=u.getNode();return Od(f,a)&&c.set(a.__key,0,"element"),Od(d,a)&&u.set(a.__key,0,"element"),l})(e);let s=!1;if(W(i)&&t){const a=i.anchor,l=i.focus;a.key===r&&(yl(a,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),l.key===r&&(yl(l,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else bt(i)&&t&&e.isSelected()&&e.selectPrevious();if(W(i)&&t&&!s){const a=e.getIndexWithinParent();mo(e),ml(i,o,a,-1)}else mo(e);n||pt(o)||o.canBeEmpty()||!o.isEmpty()||Nd(o,t),t&&i&&ot(o)&&o.isEmpty()&&o.selectEnd()}const rb=Symbol.for("ephemeral");function pl(e){return e[rb]||!1}class jn{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:t}=Zl(this);return t===void 0&&q(64,this.name),t}static clone(t){q(65,this.name)}$config(){return{}}config(t,n){const r=n.extends||Object.getPrototypeOf(this.constructor);return Object.assign(n,{extends:r,type:t}),{[t]:n}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}static importDOM;constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Sb(this,t)}getType(){return this.__type}isInline(){q(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const n=Pe(t);if(n===null)break;t=n.__parent}return!1}isSelected(t){const n=t||Y();if(n==null)return!1;const r=n.getNodes().some(o=>o.__key===this.__key);if(X(this))return r;if(W(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;const o=this.getParent();if(Se(this)&&this.isInline()&&o){const i=n.isBackward()?n.focus:n.anchor;if(o.is(i.getNode())&&i.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:Pe(t)}getParentOrThrow(){const t=this.getParent();return t===null&&q(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){const n=t.getParent();if(pt(n))return B(t)||t===this&&Se(t)||q(194),t;t=n}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return t===null&&q(67,this.__key),t}getParents(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return t===null?null:Pe(t)}getPreviousSiblings(){const t=[],n=this.getParent();if(n===null)return t;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)t.push(r),r=r.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return t===null?null:Pe(t)}getNextSiblings(){const t=[];let n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getCommonAncestor(t){const n=B(this)?this:this.getParent(),r=B(t)?t:t.getParent(),o=n&&r?Ua(n,r):null;return o?o.commonAncestor:null}is(t){return t!=null&&this.__key===t.__key}isBefore(t){const n=Ua(this,t);return n!==null&&(n.type==="descendant"||(n.type==="branch"?Ib(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&q(279),!1)))}isParentOf(t){const n=Ua(this,t);return n!==null&&n.type==="ancestor"}getNodesBetween(t){const n=this.isBefore(t),r=[],o=new Set;let i=this;for(;i!==null;){const s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===t)break;const a=B(i)?n?i.getFirstChild():i.getLastChild():null;if(a!==null){i=a;continue}const l=n?i.getNextSibling():i.getPreviousSibling();if(l!==null){i=l;continue}const c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===t)break;let u=null,f=c;do{if(f===null&&q(68),u=n?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||o.has(f.__key)||r.push(f)}while(u===null);i=u}return n||r.reverse(),r}isDirty(){const t=$e()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(pl(this))return this;const t=Pe(this.__key);return t===null&&q(113),t}getWritable(){if(pl(this))return this;ut();const t=Ur(),n=$e(),r=t._nodeMap,o=this.__key,i=this.getLatest(),s=n._cloneNotNeeded,a=Y();if(a!==null&&a.setCachedNodes(null),s.has(o))return xl(i),i;const l=Fb(i);return s.add(o),xl(l),r.set(o,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){q(70)}updateDOM(t,n,r){q(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){q(18,this.name)}updateFromJSON(t){return(function(n,r){const o=n.getWritable(),i=r.$;let s=i;for(const a of P1(o).flatKeys)a in r&&(s!==void 0&&s!==i||(s={...i}),s[a]=r[a]);return(o.__state||s)&&N1(n).updateFromJSON(s),o})(this,t)}static transform(){return null}remove(t){Nd(this,!0,t)}replace(t,n){ut();let r=Y();r!==null&&(r=r.clone()),Gc(this,t);const o=this.getLatest(),i=this.__key,s=t.__key,a=t.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;mo(a);const u=o.getPreviousSibling(),f=o.getNextSibling(),d=o.__prev,h=o.__next,g=o.__parent;if(Nd(o,!1,!0),u===null?l.__first=s:u.getWritable().__next=s,a.__prev=d,f===null?l.__last=s:f.getWritable().__prev=s,a.__next=h,a.__parent=g,l.__size=c,n&&(B(this)&&B(a)||q(139),this.getChildren().forEach(p=>{a.append(p)})),W(r)){Ge(r);const p=r.anchor,m=r.focus;p.key===i&&bm(p,a),m.key===i&&bm(m,a)}return Er()===i&&gt(s),a}insertAfter(t,n=!0){ut(),Gc(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.getParent(),s=Y();let a=!1,l=!1;if(i!==null){const h=t.getIndexWithinParent();if(mo(o),W(s)){const g=i.__key,p=s.anchor,m=s.focus;a=p.type==="element"&&p.key===g&&p.offset===h+1,l=m.type==="element"&&m.key===g&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=o.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,o.__next=d,o.__prev=r.__key,o.__parent=r.__parent,n&&W(s)){const h=this.getIndexWithinParent();ml(s,u,h+1);const g=u.__key;a&&s.anchor.set(g,h+2,"element"),l&&s.focus.set(g,h+2,"element")}return t}insertBefore(t,n=!0){ut(),Gc(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.__key;mo(o);const s=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,c=this.getIndexWithinParent();s===null?a.__first=i:s.getWritable().__next=i,a.__size++,r.__prev=i,o.__prev=l,o.__next=r.__key,o.__parent=r.__parent;const u=Y();return n&&W(u)&&ml(u,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return me()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){ut();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(B(r))return r.select();if(!X(r)){const i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(t,n)}selectNext(t,n){ut();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(B(r))return r.select(0,0);if(!X(r)){const i=r.getIndexWithinParent();return o.select(i,i)}return r.select(t,n)}markDirty(){this.getWritable()}reconcileObservedMutation(t,n){this.markDirty()}}const IA="historic",hi="history-merge",DA="paste",ob="collaboration",VA="skip-scroll-into-view",jA="skip-dom-selection",BA="skip-selection-focus";class Li extends jn{static getType(){return"linebreak"}static clone(t){return new Li(t.__key)}constructor(t){super(t)}getTextContent(){return`
39
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>(function(n){const r=n.parentElement;if(r!==null&&bl(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&ya(o)){const i=r.lastChild;if(i===n||i.previousSibling===n&&ya(i))return!0}}return!1})(t)||(function(n){const r=n.parentElement;if(r!==null&&bl(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&ya(o))return!1;const i=r.lastChild;if(i===n||i.previousSibling===n&&ya(i))return!0}return!1})(t)?null:{conversion:zA,priority:0}}}static importJSON(t){return Tn().updateFromJSON(t)}}function zA(e){return{node:Tn()}}function Tn(){return _t(new Li)}function Bn(e){return e instanceof Li}function ya(e){return vr(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function zc(e,t){return 16&t?"code":t&_1?"mark":32&t?"sub":64&t?"sup":null}function Hc(e,t){return 1&t?"strong":2&t?"em":"span"}function ib(e,t,n,r,o){const i=r.classList;let s=gi(o,"base");s!==void 0&&i.add(...s),s=gi(o,"underlineStrikethrough");let a=!1;const l=8&t&&4&t;s!==void 0&&(8&n&&4&n?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const c in Ir){const u=Ir[c];if(s=gi(o,c),s!==void 0)if(n&u){if(a&&(c==="underline"||c==="strikethrough")){t&u&&i.remove(...s);continue}((t&u)===0||l&&c==="underline"||c==="strikethrough")&&i.add(...s)}else t&u&&i.remove(...s)}}function sb(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?Il:"");if(r==null)t.textContent=i;else{const s=r.nodeValue;if(s!==i)if(o||yo){const[a,l,c]=(function(u,f){const d=u.length,h=f.length;let g=0,p=0;for(;g<d&&g<h&&u[g]===f[g];)g++;for(;p+g<d&&p+g<h&&u[d-p-1]===f[h-p-1];)p++;return[g,d-g-p,f.slice(g,h-p)]})(s,i);l!==0&&r.deleteData(a,l),r.insertData(a,c)}else r.nodeValue=i}}function ym(e,t,n,r,o,i){sb(o,e,t);const s=i.theme.text;s!==void 0&&ib(0,0,r,e,s)}function va(e,t){const n=document.createElement(t);return n.appendChild(e),n}class un extends jn{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(t){return new un(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",n){super(n),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return dA[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Er()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const n=Ir[t];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,n){return vl(this.getLatest().__format,t,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,n){const r=this.__format,o=zc(0,r),i=Hc(0,r),s=o===null?i:o,a=document.createElement(s);let l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),o!==null&&(l=document.createElement(i),a.appendChild(l)),ym(l,this,0,r,this.__text,t);const c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(t,n,r){const o=this.__text,i=t.__format,s=this.__format,a=zc(0,i),l=zc(0,s),c=Hc(0,i),u=Hc(0,s);if((a===null?c:a)!==(l===null?u:l))return!0;if(a===l&&c!==u){const p=n.firstChild;p==null&&q(48);const m=document.createElement(u);return ym(m,this,0,s,o,r),n.replaceChild(m,p),!1}let f=n;l!==null&&a!==null&&(f=n.firstChild,f==null&&q(49)),sb(o,f,this);const d=r.theme.text;d!==void 0&&i!==s&&ib(0,i,s,f,d);const h=t.__style,g=this.__style;return h!==g&&(n.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:UA,priority:0}),b:()=>({conversion:WA,priority:0}),code:()=>({conversion:Jn,priority:0}),em:()=>({conversion:Jn,priority:0}),i:()=>({conversion:Jn,priority:0}),mark:()=>({conversion:Jn,priority:0}),s:()=>({conversion:Jn,priority:0}),span:()=>({conversion:HA,priority:0}),strong:()=>({conversion:Jn,priority:0}),sub:()=>({conversion:Jn,priority:0}),sup:()=>({conversion:Jn,priority:0}),u:()=>({conversion:Jn,priority:0})}}static importJSON(t){return Le().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:n}=super.exportDOM(t);return Be(n)||q(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=va(n,"b")),this.hasFormat("italic")&&(n=va(n,"i")),this.hasFormat("strikethrough")&&(n=va(n,"s")),this.hasFormat("underline")&&(n=va(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,n){}setFormat(t){const n=this.getWritable();return n.__format=typeof t=="string"?Ir[t]:t,n}setDetail(t){const n=this.getWritable();return n.__detail=typeof t=="string"?lA[t]:t,n}setStyle(t){const n=this.getWritable();return n.__style=t,n}toggleFormat(t){const n=vl(this.getFormat(),t,null);return this.setFormat(n)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const n=uA[t];if(this.__mode===n)return this;const r=this.getWritable();return r.__mode=n,r}setTextContent(t){if(this.__text===t)return this;const n=this.getWritable();return n.__text=t,n}select(t,n){ut();let r=t,o=n;const i=Y(),s=this.getTextContent(),a=this.__key;if(typeof s=="string"){const l=s.length;r===void 0&&(r=l),o===void 0&&(o=l)}else r=0,o=0;if(!W(i))return cb(a,r,a,o,"text","text");{const l=Er();l!==i.anchor.key&&l!==i.focus.key||gt(a),i.setTextNodeRange(this,r,this,o)}return i}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,n,r,o){const i=this.getWritable(),s=i.__text,a=r.length;let l=t;l<0&&(l=a+l,l<0&&(l=0));const c=Y();if(o&&W(c)){const f=t+a;c.setTextNodeRange(i,f,i,f)}const u=s.slice(0,l)+r+s.slice(l+n);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){ut();const n=this.getLatest(),r=n.getTextContent();if(r==="")return[];const o=n.__key,i=Er(),s=r.length;t.sort((T,k)=>T-k),t.push(s);const a=[],l=t.length;for(let T=0,k=0;T<s&&k<=l;k++){const P=t[k];P>T&&(a.push(r.slice(T,P)),T=P)}const c=a.length;if(c===1)return[n];const u=a[0],f=n.getParent();let d;const h=n.getFormat(),g=n.getStyle(),p=n.__detail;let m=!1,x=null,y=null;const v=Y();if(W(v)){const[T,k]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];T.type==="text"&&T.key===o&&(x=T),k.type==="text"&&k.key===o&&(y=k)}n.isSegmented()?(d=Le(u),d.__format=h,d.__style=g,d.__detail=p,d.__state=sm(n,d),m=!0):d=n.setTextContent(u);const b=[d];for(let T=1;T<c;T++){const k=Le(a[T]);k.__format=h,k.__style=g,k.__detail=p,k.__state=sm(n,k);const P=k.__key;i===o&&gt(P),b.push(k)}const w=x?x.offset:null,_=y?y.offset:null;let E=0;for(const T of b){if(!x&&!y)break;const k=E+T.getTextContentSize();if(x!==null&&w!==null&&w<=k&&w>=E&&(x.set(T.getKey(),w-E,"text"),w<k&&(x=null)),y!==null&&_!==null&&_<=k&&_>=E){y.set(T.getKey(),_-E,"text");break}E=k}if(f!==null){(function(P){const O=P.getPreviousSibling(),D=P.getNextSibling();O!==null&&xl(O),D!==null&&xl(D)})(this);const T=f.getWritable(),k=this.getIndexWithinParent();m?(T.splice(k,0,b),this.remove()):T.splice(k,1,b),W(v)&&ml(v,f,k,c-1)}return b}mergeWithSibling(t){const n=t===this.getPreviousSibling();n||t===this.getNextSibling()||q(50);const r=this.__key,o=t.__key,i=this.__text,s=i.length;Er()===o&&gt(r);const a=Y();if(W(a)){const f=a.anchor,d=a.focus;f!==null&&f.key===o&&Rm(f,n,r,t,s),d!==null&&d.key===o&&Rm(d,n,r,t,s)}const l=t.__text,c=n?l+i:i+l;this.setTextContent(c);const u=this.getWritable();return t.remove(),u}isTextEntity(){return!1}}function HA(e){return{forChild:fh(e.style),node:null}}function WA(e){const t=e,n=t.style.fontWeight==="normal";return{forChild:fh(t.style,n?void 0:"bold"),node:null}}const vm=new WeakMap;function KA(e){if(!Be(e))return!1;if(e.nodeName==="PRE")return!0;const t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function UA(e){const t=e;e.parentElement===null&&q(129);let n=t.textContent||"";if((function(r){let o,i=r.parentNode;const s=[r];for(;i!==null&&(o=vm.get(i))===void 0&&!KA(i);)s.push(i),i=i.parentNode;const a=o===void 0?i:o;for(let l=0;l<s.length;l++)vm.set(s[l],a);return a})(t)!==null){const r=n.split(/(\r?\n|\t)/),o=[],i=r.length;for(let s=0;s<i;s++){const a=r[s];a===`
36
+ `,p3=xo?" ":Bl,Dr={bold:1,capitalize:1024,code:16,highlight:Eb,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},m3={directionless:1,unmergeable:2},om={center:2,end:6,justify:4,left:1,right:3,start:5},y3={[u3]:"center",[g3]:"end",[f3]:"justify",[c3]:"left",[d3]:"right",[h3]:"start"},v3={normal:0,segmented:2,token:1},x3={[s3]:"normal",[l3]:"segmented",[a3]:"token"},im="$config";function Rb(e,t,n,r,o,i){let s=e.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===t&&(B(s)&&Rb(s,a,n,r,o,i),n.has(a)||i.delete(a),o.push(a)),s=s.getNextSibling()}}let xd=!1,ih=0;function b3(e){ih=e.timeStamp}function Hc(e,t,n){const r=e.nodeName==="BR",o=t.__lexicalLineBreak;return o&&(e===o||r&&e.previousSibling===o)||r&&Ql(e,n)!==void 0}function w3(e,t,n){const r=Lt(dn(n));let o=null,i=null;r!==null&&r.anchorNode===e&&(o=r.anchorOffset,i=r.focusOffset);const s=e.nodeValue;s!==null&&Rh(t,s,o,i,!1)}function C3(e,t,n){if(W(e)){const r=e.anchor.getNode();if(r.is(n)&&e.format!==r.getFormat())return!1}return xr(t)&&n.isAttached()}function S3(e,t,n,r){for(let o=e;o&&!RA(o);o=Js(o)){const i=Ql(o,t);if(i!==void 0){const s=Le(i,n);if(s)return _e(s)||!Be(o)?void 0:[o,s]}else if(o===r)return[r,k1(n)]}}function kb(e,t,n){xd=!0;const r=performance.now()-ih>100;try{Hn(e,()=>{const o=Y()||(function(d){return d.getEditorState().read(()=>{const h=Y();return h!==null?h.clone():null})})(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let d=0;d<t.length;d++){const h=t[d],g=h.type,p=h.target,m=S3(p,e,a,s);if(!m)continue;const[x,y]=m;if(g==="characterData")r&&X(y)&&xr(p)&&C3(o,p,y)&&w3(p,y,e);else if(g==="childList"){c=!0;const v=h.addedNodes;for(let _=0;_<v.length;_++){const E=v[_],T=E1(E),k=E.parentNode;if(k!=null&&E!==l&&T===null&&!Hc(E,k,e)){if(xo){const P=(Be(E)?E.innerText:null)||E.nodeValue;P&&(u+=P)}k.removeChild(E)}}const b=h.removedNodes,w=b.length;if(w>0){let _=0;for(let E=0;E<w;E++){const T=b[E];(Hc(T,p,e)||l===T)&&(p.appendChild(T),_++)}w!==_&&i.set(x,y)}}}if(i.size>0)for(const[d,h]of i)h.reconcileObservedMutation(d,e);const f=n.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){const x=g[m],y=x.parentNode;y==null||x.nodeName!=="BR"||Hc(x,p,e)||y.removeChild(x)}}n.takeRecords()}o!==null&&(c&&Ge(o),xo&&P1(e)&&o.insertRawText(u))})}finally{xd=!1}}function Ab(e){const t=e._observer;t!==null&&kb(e,t.takeRecords(),t)}function Mb(e){(function(t){ih===0&&dn(t).addEventListener("textInput",b3,!0)})(e),e._observer=new MutationObserver((t,n)=>{kb(e,t,n)})}let _3=class{key;parse;unparse;isEqual;defaultValue;constructor(t,n){this.key=t,this.parse=n.parse.bind(n),this.unparse=(n.unparse||k3).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0)}};function T3(e,t){return new _3(e,t)}function Nb(e,t,n="latest"){const r=(n==="latest"?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function Wc(e,t,n){let r;if(ut(),typeof n=="function"){const i=e.getLatest(),s=Nb(i,t);if(r=n(s),t.isEqual(s,r))return i}else r=n;const o=e.getWritable();return Lb(o).updateFromKnown(t,r),o}function E3(e){const t=new Map,n=new Set;for(let r=typeof e=="function"?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:o}=tc(r);if(o&&o.stateConfigs)for(const i of o.stateConfigs){let s;"stateConfig"in i?(s=i.stateConfig,i.flat&&n.add(s.key)):s=i,t.set(s.key,s)}}return{flatKeys:n,sharedConfigMap:t}}let R3=class Pb{node;knownState;unknownState;sharedNodeState;size;constructor(t,n,r=void 0,o=new Map,i=void 0){this.node=t,this.sharedNodeState=n,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,a=i!==void 0?i:(function(l,c,u){let f=u.size;if(c)for(const d in c){const h=l.get(d);h&&u.has(h)||f++}return f})(s,r,o);this.size=a}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const o=this.unknownState[t.key];o!==void 0&&(r=t.parse(o)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},n={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in t&&(n[r]=t[r],delete t[r]);return sm(t)&&(n.$=t),n}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,o=new Map(this.knownState);return new Pb(t,n,(function(i,s,a){let l;if(a)for(const[c,u]of Object.entries(a)){const f=i.get(c);f?s.has(f)||s.set(f,f.parse(u)):(l=l||{},l[c]=u)}return l})(n.sharedConfigMap,o,r),o,this.size)}updateFromKnown(t,n){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:o,unknownState:i}=this;o.has(t)||i&&r in i||(i&&(delete i[r],this.unknownState=sm(i)),this.size++),o.set(t,n)}updateFromUnknown(t,n){const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(const[r,o]of Object.entries(t))this.updateFromUnknown(r,o)}};function Lb(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new R3(t,Fb(t));return t.__state=n,n}function Fb(e){return e.__state?e.__state.sharedNodeState:b1(Bi(),e.getType()).sharedNodeState}function sm(e){if(e)for(const t in e)return e}function k3(e){return e}function am(e,t,n){for(const[r,o]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const i=n?n.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function lm(e,t,n){const{unknownState:r}=t,o=n?n.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!e.has(i)&&(e.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function cm(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function um(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style,l=e.__state,c=t.__state;return(n===null||n===i)&&(r===null||r===s)&&(o===null||o===a)&&(e.__state===null||l===c||(function(u,f){if(u===f)return!0;if(u&&f&&u.size!==f.size)return!1;const d=new Set;return!(u&&am(d,u,f)||f&&am(d,f,u)||u&&lm(d,u,f)||f&&lm(d,f,u))})(l,c))}function dm(e,t){const n=e.mergeWithSibling(t),r=$e()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function fm(e){let t,n,r=e;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&X(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(um(t,r)){r=dm(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&X(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(um(r,n)){r=dm(r,n);break}break}n.remove()}}else r.remove()}function Ns(e){return hm(e.anchor),hm(e.focus),e}function hm(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),X(r)){e.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!B(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}let bo,Ct,Ps,zl,bd,wd,wo,Sn,Cd,Ls,lt="",$n=null,oo=null,ir="",Jo=!1,dl=!1;function fl(e,t){const n=wo.get(e);if(t!==null){const r=Ed(e);r.parentNode===t&&t.removeChild(r)}if(Sn.has(e)||Ct._keyToDOMMap.delete(e),B(n)){const r=gl(n,wo);Sd(r,0,r.length-1,null)}n!==void 0&&kh(Ls,Ps,zl,n,"destroyed")}function Sd(e,t,n,r){let o=t;for(;o<=n;++o){const i=e[o];i!==void 0&&fl(i,r)}}function to(e,t){e.setProperty("text-align",t)}const A3="40px";function $b(e,t){const n=bo.theme.indent;if(typeof n=="string"){const o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||A3;e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${r})`)}function Ob(e,t){const n=e.style;t===0?to(n,""):t===1?to(n,"left"):t===2?to(n,"center"):t===3?to(n,"right"):t===4?to(n,"justify"):t===5?to(n,"start"):t===6&&to(n,"end")}function _d(e,t){const n=(function(r){const o=r.__dir;if(o!==null)return o;if(ot(r))return null;const i=r.getParentOrThrow();return ot(i)&&i.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function hl(e,t){const n=Sn.get(e);n===void 0&&q(60);const r=n.createDOM(bo,Ct);if((function(o,i,s){const a=s._keyToDOMMap;(function(l,c,u){const f=`__lexicalKey_${c._key}`;l[f]=u})(i,s,o),a.set(o,i)})(e,r,Ct),X(n)?r.setAttribute("data-lexical-text","true"):_e(n)&&r.setAttribute("data-lexical-decorator","true"),B(n)){const o=n.__indent,i=n.__size;if(_d(r,n),o!==0&&$b(r,o),i!==0){const a=i-1;Td(gl(n,Sn),n,0,a,n.getDOMSlot(r))}const s=n.__format;s!==0&&Ob(r,s),n.isInline()||Ib(null,n,r),ec(n)&&(lt+=Ir,ir+=Ir)}else{const o=n.getTextContent();if(_e(n)){const i=n.decorate(Ct,bo);i!==null&&Db(e,i),r.contentEditable="false"}lt+=o,ir+=o}return t!==null&&t.insertChild(r),kh(Ls,Ps,zl,n,"created"),r}function Td(e,t,n,r,o){const i=lt;lt="";let s=n;for(;s<=r;++s){hl(e[s],o);const a=Sn.get(e[s]);a!==null&&X(a)&&$n===null&&($n=a.getFormat(),oo=a.getStyle())}ec(t)&&(lt+=Ir),o.element.__lexicalTextContent=lt,lt=i+lt}function gm(e,t){if(e){const n=e.__last;if(n){const r=t.get(n);if(r)return zn(r)?"line-break":_e(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Ib(e,t,n){const r=gm(e,wo),o=gm(t,Sn);r!==o&&t.getDOMSlot(n).setManagedLineBreak(o)}function M3(e,t,n){var r;$n=null,oo=null,(function(o,i,s){const a=lt,l=o.__size,c=i.__size;lt="";const u=s.element;if(l===1&&c===1){const f=o.__first,d=i.__first;if(f===d)ds(f,u);else{const g=Ed(f),p=hl(d,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){const x=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(x)}throw m}fl(f,null)}const h=Sn.get(d);X(h)&&$n===null&&($n=h.getFormat(),oo=h.getStyle())}else{const f=gl(o,wo),d=gl(i,Sn);if(f.length!==l&&q(227),d.length!==c&&q(228),l===0)c!==0&&Td(d,i,0,c-1,s);else if(c===0){if(l!==0){const h=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;Sd(f,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,x,y){const v=m-1,b=x-1;let w,_,E=y.getFirstChild(),T=0,k=0;for(;T<=v&&k<=b;){const D=g[T],I=p[k];if(D===I)E=Kc(ds(I,y.element)),T++,k++;else{w===void 0&&(w=new Set(g)),_===void 0&&(_=new Set(p));const H=_.has(D),U=w.has(I);if(H)if(U){const L=_o(Ct,I);L===E?E=Kc(ds(I,y.element)):(y.withBefore(E).insertChild(L),ds(I,y.element)),T++,k++}else hl(I,y.withBefore(E)),k++;else E=Kc(Ed(D)),fl(D,y.element),T++}const $=Sn.get(I);$!==null&&X($)&&$n===null&&($n=$.getFormat(),oo=$.getStyle())}const P=T>v,O=k>b;if(P&&!O){const D=p[b+1],I=D===void 0?null:Ct.getElementByKey(D);Td(p,h,k,b,y.withBefore(I))}else O&&!P&&Sd(g,T,v,y.element)})(i,f,d,l,c,s)}ec(i)&&(lt+=Ir),u.__lexicalTextContent=lt,lt=a+lt})(e,t,t.getDOMSlot(n)),r=t,$n==null||$n===r.__textFormat||dl||r.setTextFormat($n),(function(o){oo==null||oo===o.__textStyle||dl||o.setTextStyle(oo)})(t)}function gl(e,t){const n=[];let r=e.__first;for(;r!==null;){const o=t.get(r);o===void 0&&q(101),n.push(r),r=o.__next}return n}function ds(e,t){const n=wo.get(e);let r=Sn.get(e);n!==void 0&&r!==void 0||q(61);const o=Jo||wd.has(e)||bd.has(e),i=_o(Ct,e);if(n===r&&!o){if(B(n)){const s=i.__lexicalTextContent;s!==void 0&&(lt+=s,ir+=s)}else{const s=n.getTextContent();ir+=s,lt+=s}return i}if(n!==r&&o&&kh(Ls,Ps,zl,r,"updated"),r.updateDOM(n,i,bo)){const s=hl(e,null);return t===null&&q(62),t.replaceChild(s,i),fl(e,null),s}if(B(n)&&B(r)){const s=r.__indent;(Jo||s!==n.__indent)&&$b(i,s);const a=r.__format;if((Jo||a!==n.__format)&&Ob(i,a),o&&(M3(n,r,i),ot(r)||r.isInline()||Ib(n,r,i)),ec(r)&&(lt+=Ir,ir+=Ir),(Jo||r.__dir!==n.__dir)&&(_d(i,r),ot(r)&&!Jo))for(const l of r.getChildren())B(l)&&_d(_o(Ct,l.getKey()),l)}else{const s=r.getTextContent();if(_e(r)){const a=r.decorate(Ct,bo);a!==null&&Db(e,a)}lt+=s,ir+=s}if(!dl&&ot(r)&&r.__cachedText!==ir){const s=r.getWritable();s.__cachedText=ir,r=s}return i}function Db(e,t){let n=Ct._pendingDecorators;const r=Ct._decorators;if(n===null){if(r[e]===t)return;n=R1(Ct)}n[e]=t}function Kc(e){let t=e.nextSibling;return t!==null&&t===Ct._blockCursorElement&&(t=t.nextSibling),t}function N3(e,t,n,r,o,i){lt="",ir="",Jo=r===2,Ct=n,bo=n._config,Ps=n._nodes,zl=Ct._listeners.mutation,bd=o,wd=i,wo=e._nodeMap,Sn=t._nodeMap,dl=t._readOnly,Cd=new Map(n._keyToDOMMap);const s=new Map;return Ls=s,ds("root",null),Ct=void 0,Ps=void 0,bd=void 0,wd=void 0,wo=void 0,Sn=void 0,bo=void 0,Cd=void 0,Ls=void 0,s}function Ed(e){const t=Cd.get(e);return t===void 0&&q(75,e),t}function le(e){return{type:e}}const cr=le("SELECTION_CHANGE_COMMAND"),sh=le("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Hl=le("CLICK_COMMAND"),jb=le("BEFORE_INPUT_COMMAND"),Vb=le("INPUT_COMMAND"),Bb=le("COMPOSITION_START_COMMAND"),zb=le("COMPOSITION_END_COMMAND"),Lr=le("DELETE_CHARACTER_COMMAND"),fi=le("INSERT_LINE_BREAK_COMMAND"),Co=le("INSERT_PARAGRAPH_COMMAND"),mo=le("CONTROLLED_TEXT_INSERTION_COMMAND"),ah=le("PASTE_COMMAND"),Rd=le("REMOVE_TEXT_COMMAND"),Ti=le("DELETE_WORD_COMMAND"),So=le("DELETE_LINE_COMMAND"),It=le("FORMAT_TEXT_COMMAND"),Hb=le("UNDO_COMMAND"),Wb=le("REDO_COMMAND"),Kb=le("KEYDOWN_COMMAND"),lh=le("KEY_ARROW_RIGHT_COMMAND"),P3=le("MOVE_TO_END"),ch=le("KEY_ARROW_LEFT_COMMAND"),L3=le("MOVE_TO_START"),uh=le("KEY_ARROW_UP_COMMAND"),dh=le("KEY_ARROW_DOWN_COMMAND"),pl=le("KEY_ENTER_COMMAND"),Ub=le("KEY_SPACE_COMMAND"),Wl=le("KEY_BACKSPACE_COMMAND"),fh=le("KEY_ESCAPE_COMMAND"),hh=le("KEY_DELETE_COMMAND"),gh=le("KEY_TAB_COMMAND"),F3=le("INSERT_TAB_COMMAND"),$3=le("INDENT_CONTENT_COMMAND"),pm=le("OUTDENT_CONTENT_COMMAND"),Gb=le("DROP_COMMAND"),hi=le("FORMAT_ELEMENT_COMMAND"),qb=le("DRAGSTART_COMMAND"),Yb=le("DRAGOVER_COMMAND"),O3=le("DRAGEND_COMMAND"),Kl=le("COPY_COMMAND"),Ul=le("CUT_COMMAND"),kd=le("SELECT_ALL_COMMAND"),Xb=le("FOCUS_COMMAND"),I3=le("BLUR_COMMAND"),D3=le("KEY_MODIFIER_COMMAND"),Jn=Object.freeze({}),Ad=[["keydown",function(e,t){Fs=e.timeStamp,Zb=e.key,!t.isComposing()&&Q(t,Kb,e)}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;xn(n)&&r!=="touch"&&r!=="pen"&&e.button===0&&Hn(t,()=>{w1(n)||(Pd=!0)})}],["compositionstart",function(e,t){Q(t,Bb,e)}],["compositionend",function(e,t){xo?fs=!0:$i||!Gs&&!qs?Q(t,zb,e):(Ld=!0,Fd=e.data)}],["input",function(e,t){e.stopPropagation(),Hn(t,()=>{t.dispatchCommand(Vb,e)},{event:e}),Qo=null}],["click",function(e,t){Hn(t,()=>{const n=Y(),r=Lt(dn(t)),o=qn();if(r){if(W(n)){const i=n.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&n.isCollapsed()&&!ot(s)&&qe().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&n.is(o))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&s!==n.focus.getNode()){const a=we(s,l=>B(l)&&!l.isInline());B(a)&&a.select(0)}}else if(e.pointerType==="touch"||e.pointerType==="pen"){const i=r.anchorNode;(Be(i)||xr(i))&&Ge(Xl(o,r,t,e))}}Q(t,Hl,e)})}],["cut",Jn],["copy",Jn],["dragstart",Jn],["dragover",Jn],["dragend",Jn],["paste",Jn],["focus",Jn],["blur",Jn],["drop",Jn]];ul&&Ad.push(["beforeinput",(e,t)=>(function(n,r){const o=n.inputType;o==="deleteCompositionText"||xo&&P1(r)||o!=="insertCompositionText"&&Q(r,jb,n)})(e,t)]);let Fs=0,Zb=null,Jb=0,Qo=null;const Md=new WeakMap,ml=new WeakMap;let Nd=!1,Pd=!1,vs=!1,fs=!1,Ld=!1,Fd="",ao=null,Qb=[0,"",0,"root",0];function e1(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=$e(),c=Lt(dn(l)),u=c!==null?c.anchorNode:null,f=i.key,d=l.getElementByKey(f),h=n.length;return f!==s.key||!X(a)||(!o&&(!ul||Jb<r+50)||a.isDirty()&&h<2||A1(n))&&i.offset!==s.offset&&!a.isComposing()||rr(a)||a.isDirty()&&h>1||(o||!ul)&&d!==null&&!a.isComposing()&&u!==Ri(d)||c!==null&&t!==null&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;const m=g.anchor.offset,x=p.getParentOrThrow(),y=yo(p);return m===0?!p.canInsertTextBefore()||!x.canInsertTextBefore()&&!p.isComposing()||y||(function(v){const b=v.getPreviousSibling();return(X(b)||B(b)&&b.isInline())&&!b.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!x.canInsertTextAfter()&&!p.isComposing()||y)})(e,a)}function mm(e,t){return xr(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function ym(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;Nd&&(Nd=!1,mm(r,o)&&mm(i,s)&&!ao)||Hn(t,()=>{if(!n)return void Ge(null);if(!Zs(t,r,i))return;let a=Y();if(ao&&W(a)&&a.isCollapsed()){const l=a.anchor,c=ao.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=ao.clone(),Ge(a))}if(ao=null,W(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){e.type==="Range"&&e.anchorNode===e.focusNode&&(a.dirty=!0);const u=dn(t).event,f=u?u.timeStamp:performance.now(),[d,h,g,p,m]=Qb,x=qe(),y=t.isComposing()===!1&&x.getTextContent()==="";if(f<m+200&&l.offset===g&&l.key===p)Ga(a,d,h);else if(l.type==="text")X(c)||q(141),t1(a,c);else if(l.type==="element"&&!y){B(c)||q(259);const v=l.getNode();v.isEmpty()?(function(b,w){const _=w.getTextFormat(),E=w.getTextStyle();Ga(b,_,E)})(a,v):Ga(a,0,"")}}else{const u=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),p=g?s:o,m=g?o:s,x=g?f:u,y=g?u:f;let v=2047,b=!1;for(let w=0;w<h;w++){const _=d[w],E=_.getTextContentSize();if(X(_)&&E!==0&&!(w===0&&_.__key===x&&p===E||w===h-1&&_.__key===y&&m===0)&&(b=!0,v&=_.getFormat(),v===0))break}a.format=b?v:0}}Q(t,cr,void 0)})}function Ga(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function t1(e,t){Ga(e,t.getFormat(),t.getStyle())}function n1(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function j3(e){const t=e.inputType,n=n1(e),r=$e(),o=Y();if(t==="deleteContentBackward"){if(o===null){const f=qn();if(!W(f))return!0;Ge(f.clone())}if(W(o)){const f=o.anchor.key===o.focus.key;if(i=e.timeStamp,Zb==="MediaLast"&&i<Fs+30&&r.isComposing()&&f){if(gt(null),Fs=0,setTimeout(()=>{Hn(r,()=>{gt(null)})},30),W(o)){const d=o.anchor.getNode();d.markDirty(),X(d)||q(142),t1(o,d)}}else{gt(null),e.preventDefault();const d=o.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),p=o.anchor.offset===0&&o.focus.offset===h.length;let m=rm&&f&&!p&&g;if(m&&o.isCollapsed()&&(m=!_e(jd(o.anchor,!0))),!m){Q(r,Lr,!0);const x=Y();rm&&W(x)&&x.isCollapsed()&&(ao=x,setTimeout(()=>ao=null))}}return!0}}var i;if(!W(o))return!0;const s=e.data;Qo!==null&&Eh(!1,r,Qo),o.dirty&&Qo===null||!o.isCollapsed()||ot(o.anchor.getNode())||n===null||o.applyDOMRange(n),Qo=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(s===`
37
+ `)e.preventDefault(),Q(r,fi,!1);else if(s===Ir)e.preventDefault(),Q(r,Co,void 0);else if(s==null&&e.dataTransfer){const f=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(f)}else s!=null&&e1(o,n,s,e.timeStamp,!0)?(e.preventDefault(),Q(r,mo,s)):Qo=s;return Jb=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Q(r,mo,e);break;case"insertFromComposition":gt(null),Q(r,mo,e);break;case"insertLineBreak":gt(null),Q(r,fi,!1);break;case"insertParagraph":gt(null),vs&&!$i?(vs=!1,Q(r,fi,!1)):Q(r,Co,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Q(r,ah,e);break;case"deleteByComposition":(function(f,d){return f!==d||B(f)||B(d)||!yo(f)||!yo(d)})(c,u)&&Q(r,Rd,e);break;case"deleteByDrag":case"deleteByCut":Q(r,Rd,e);break;case"deleteContent":Q(r,Lr,!1);break;case"deleteWordBackward":Q(r,Ti,!0);break;case"deleteWordForward":Q(r,Ti,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Q(r,So,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Q(r,So,!1);break;case"formatStrikeThrough":Q(r,It,"strikethrough");break;case"formatBold":Q(r,It,"bold");break;case"formatItalic":Q(r,It,"italic");break;case"formatUnderline":Q(r,It,"underline");break;case"historyUndo":Q(r,Hb,void 0);break;case"historyRedo":Q(r,Wb,void 0)}return!0}function V3(e){if(Be(e.target)&&w1(e.target))return!0;const t=$e(),n=Y(),r=e.data,o=n1(e);if(r!=null&&W(n)&&e1(n,o,r,e.timeStamp,!1)){fs&&(yl(t,r),fs=!1);const i=n.anchor.getNode(),s=Lt(dn(t));if(s===null)return!0;const a=n.isBackward(),l=a?n.anchor.offset:n.focus.offset,c=a?n.focus.offset:n.anchor.offset;ul&&!n.isCollapsed()&&X(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,l)+r+i.getTextContent().slice(l+c)===N1(s.anchorNode)||Q(t,mo,r);const u=r.length;xo&&u>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=u),Gs||$i||qs||!t.isComposing()||(Fs=0,gt(null))}else Eh(!1,t,r!==null?r:void 0),fs&&(yl(t,r||void 0),fs=!1);return(function(){ut();const i=$e();Ab(i)})(),!0}function B3(e){const t=$e(),n=Y();if(W(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();gt(r.key),(e.timeStamp<Fs+30||r.type==="element"||!n.isCollapsed()||o.getFormat()!==n.format||X(o)&&o.getStyle()!==n.style)&&Q(t,mo,p3)}return!0}function z3(e){return yl($e(),e.data),!0}function yl(e,t){const n=e._compositionKey;if(gt(null),n!==null&&t!=null){if(t===""){const r=Le(n),o=Ri(e.getElementByKey(n));return void(o!==null&&o.nodeValue!==null&&X(r)&&Rh(r,o.nodeValue,null,null,!0))}if(t[t.length-1]===`
38
+ `){const r=Y();if(W(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void Q(e,pl,null)}}}Eh(!0,e,t)}function H3(e){const t=$e();if(e.key==null)return!0;if(Ld&&zm(e))return Hn(t,()=>{yl(t,Fd)}),Ld=!1,Fd="",!0;if((function(n){return Pe(n,"ArrowRight",{shiftKey:"any"})})(e))Q(t,lh,e);else if((function(n){return Pe(n,"ArrowRight",er)})(e))Q(t,P3,e);else if((function(n){return Pe(n,"ArrowLeft",{shiftKey:"any"})})(e))Q(t,ch,e);else if((function(n){return Pe(n,"ArrowLeft",er)})(e))Q(t,L3,e);else if((function(n){return Pe(n,"ArrowUp",{altKey:"any",shiftKey:"any"})})(e))Q(t,uh,e);else if((function(n){return Pe(n,"ArrowDown",{altKey:"any",shiftKey:"any"})})(e))Q(t,dh,e);else if((function(n){return Pe(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(e))vs=!0,Q(t,pl,e);else if((function(n){return n.key===" "})(e))Q(t,Ub,e);else if((function(n){return vn&&Pe(n,"o",{ctrlKey:!0})})(e))e.preventDefault(),vs=!0,Q(t,fi,!0);else if((function(n){return Pe(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(e))vs=!1,Q(t,pl,e);else if((function(n){return Pe(n,"Backspace",{shiftKey:"any"})||vn&&Pe(n,"h",{ctrlKey:!0})})(e))zm(e)?Q(t,Wl,e):(e.preventDefault(),Q(t,Lr,!0));else if((function(n){return n.key==="Escape"})(e))Q(t,fh,e);else if((function(n){return Pe(n,"Delete",{})||vn&&Pe(n,"d",{ctrlKey:!0})})(e))(function(n){return n.key==="Delete"})(e)?Q(t,hh,e):(e.preventDefault(),Q(t,Lr,!1));else if((function(n){return Pe(n,"Backspace",Bm)})(e))e.preventDefault(),Q(t,Ti,!0);else if((function(n){return Pe(n,"Delete",Bm)})(e))e.preventDefault(),Q(t,Ti,!1);else if((function(n){return vn&&Pe(n,"Backspace",{metaKey:!0})})(e))e.preventDefault(),Q(t,So,!0);else if((function(n){return vn&&(Pe(n,"Delete",{metaKey:!0})||Pe(n,"k",{ctrlKey:!0}))})(e))e.preventDefault(),Q(t,So,!1);else if((function(n){return Pe(n,"b",er)})(e))e.preventDefault(),Q(t,It,"bold");else if((function(n){return Pe(n,"u",er)})(e))e.preventDefault(),Q(t,It,"underline");else if((function(n){return Pe(n,"i",er)})(e))e.preventDefault(),Q(t,It,"italic");else if((function(n){return Pe(n,"Tab",{shiftKey:"any"})})(e))Q(t,gh,e);else if((function(n){return Pe(n,"z",er)})(e))e.preventDefault(),Q(t,Hb,void 0);else if((function(n){return vn?Pe(n,"z",{metaKey:!0,shiftKey:!0}):Pe(n,"y",{ctrlKey:!0})||Pe(n,"z",{ctrlKey:!0,shiftKey:!0})})(e))e.preventDefault(),Q(t,Wb,void 0);else{const n=t._editorState._selection;n===null||W(n)?Hm(e)&&(e.preventDefault(),Q(t,kd,e)):(function(r){return Pe(r,"c",er)})(e)?(e.preventDefault(),Q(t,Kl,e)):(function(r){return Pe(r,"x",er)})(e)?(e.preventDefault(),Q(t,Ul,e)):Hm(e)&&(e.preventDefault(),Q(t,kd,e))}return(function(n){return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey})(e)&&t.dispatchCommand(D3,e),!0}function r1(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}const gi=new Map;function o1(e){const t=SA(e.target);if(t===null)return;const n=C1(t.anchorNode);if(n===null)return;Pd&&(Pd=!1,Hn(n,()=>{const l=qn(),c=t.anchorNode;(Be(c)||xr(c))&&Ge(Xl(l,t,n,e))}));const r=Th(n),o=r[r.length-1],i=o._key,s=gi.get(i),a=s||o;a!==n&&ym(t,a,!1),ym(t,n,!0),n!==o?gi.set(i,n):s&&gi.delete(i)}function vm(e){e._lexicalHandled=!0}function xm(e){return e._lexicalHandled===!0}function W3(e){const t=Md.get(e);if(t===void 0)return;const n=ml.get(t);if(n===void 0)return;const r=n-1;r>=0||q(164),Md.delete(e),ml.set(t,r),r===0&&t.removeEventListener("selectionchange",o1);const o=Jl(e);_h(o)?((function(s){if(s._parentEditor!==null){const a=Th(s),l=a[a.length-1]._key;gi.get(l)===s&&gi.delete(l)}else gi.delete(s._key)})(o),e.__lexicalEditor=null):o&&q(198);const i=r1(e);for(let s=0;s<i.length;s++)i[s]();e.__lexicalEventHandles=[]}function $d(e,t,n){ut();const r=e.__key,o=e.getParent();if(o===null)return;const i=(function(a){const l=Y();if(!W(l)||!B(a))return l;const{anchor:c,focus:u}=l,f=c.getNode(),d=u.getNode();return Vd(f,a)&&c.set(a.__key,0,"element"),Vd(d,a)&&u.set(a.__key,0,"element"),l})(e);let s=!1;if(W(i)&&t){const a=i.anchor,l=i.focus;a.key===r&&(bl(a,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),l.key===r&&(bl(l,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else bt(i)&&t&&e.isSelected()&&e.selectPrevious();if(W(i)&&t&&!s){const a=e.getIndexWithinParent();vo(e),xl(i,o,a,-1)}else vo(e);n||pt(o)||o.canBeEmpty()||!o.isEmpty()||$d(o,t),t&&i&&ot(o)&&o.isEmpty()&&o.selectEnd()}const i1=Symbol.for("ephemeral");function vl(e){return e[i1]||!1}class Bn{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:t}=tc(this);return t===void 0&&q(64,this.name),t}static clone(t){q(65,this.name)}$config(){return{}}config(t,n){const r=n.extends||Object.getPrototypeOf(this.constructor);return Object.assign(n,{extends:r,type:t}),{[t]:n}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}static importDOM;constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),T1(this,t)}getType(){return this.__type}isInline(){q(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const n=Le(t);if(n===null)break;t=n.__parent}return!1}isSelected(t){const n=t||Y();if(n==null)return!1;const r=n.getNodes().some(o=>o.__key===this.__key);if(X(this))return r;if(W(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;const o=this.getParent();if(_e(this)&&this.isInline()&&o){const i=n.isBackward()?n.focus:n.anchor;if(o.is(i.getNode())&&i.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:Le(t)}getParentOrThrow(){const t=this.getParent();return t===null&&q(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){const n=t.getParent();if(pt(n))return B(t)||t===this&&_e(t)||q(194),t;t=n}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return t===null&&q(67,this.__key),t}getParents(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return t===null?null:Le(t)}getPreviousSiblings(){const t=[],n=this.getParent();if(n===null)return t;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)t.push(r),r=r.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return t===null?null:Le(t)}getNextSiblings(){const t=[];let n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getCommonAncestor(t){const n=B(this)?this:this.getParent(),r=B(t)?t:t.getParent(),o=n&&r?Ya(n,r):null;return o?o.commonAncestor:null}is(t){return t!=null&&this.__key===t.__key}isBefore(t){const n=Ya(this,t);return n!==null&&(n.type==="descendant"||(n.type==="branch"?j1(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&q(279),!1)))}isParentOf(t){const n=Ya(this,t);return n!==null&&n.type==="ancestor"}getNodesBetween(t){const n=this.isBefore(t),r=[],o=new Set;let i=this;for(;i!==null;){const s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===t)break;const a=B(i)?n?i.getFirstChild():i.getLastChild():null;if(a!==null){i=a;continue}const l=n?i.getNextSibling():i.getPreviousSibling();if(l!==null){i=l;continue}const c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===t)break;let u=null,f=c;do{if(f===null&&q(68),u=n?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||o.has(f.__key)||r.push(f)}while(u===null);i=u}return n||r.reverse(),r}isDirty(){const t=$e()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(vl(this))return this;const t=Le(this.__key);return t===null&&q(113),t}getWritable(){if(vl(this))return this;ut();const t=Gr(),n=$e(),r=t._nodeMap,o=this.__key,i=this.getLatest(),s=n._cloneNotNeeded,a=Y();if(a!==null&&a.setCachedNodes(null),s.has(o))return Cl(i),i;const l=$1(i);return s.add(o),Cl(l),r.set(o,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){q(70)}updateDOM(t,n,r){q(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){q(18,this.name)}updateFromJSON(t){return(function(n,r){const o=n.getWritable(),i=r.$;let s=i;for(const a of Fb(o).flatKeys)a in r&&(s!==void 0&&s!==i||(s={...i}),s[a]=r[a]);return(o.__state||s)&&Lb(n).updateFromJSON(s),o})(this,t)}static transform(){return null}remove(t){$d(this,!0,t)}replace(t,n){ut();let r=Y();r!==null&&(r=r.clone()),Zc(this,t);const o=this.getLatest(),i=this.__key,s=t.__key,a=t.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;vo(a);const u=o.getPreviousSibling(),f=o.getNextSibling(),d=o.__prev,h=o.__next,g=o.__parent;if($d(o,!1,!0),u===null?l.__first=s:u.getWritable().__next=s,a.__prev=d,f===null?l.__last=s:f.getWritable().__prev=s,a.__next=h,a.__parent=g,l.__size=c,n&&(B(this)&&B(a)||q(139),this.getChildren().forEach(p=>{a.append(p)})),W(r)){Ge(r);const p=r.anchor,m=r.focus;p.key===i&&Sm(p,a),m.key===i&&Sm(m,a)}return Rr()===i&&gt(s),a}insertAfter(t,n=!0){ut(),Zc(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.getParent(),s=Y();let a=!1,l=!1;if(i!==null){const h=t.getIndexWithinParent();if(vo(o),W(s)){const g=i.__key,p=s.anchor,m=s.focus;a=p.type==="element"&&p.key===g&&p.offset===h+1,l=m.type==="element"&&m.key===g&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=o.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,o.__next=d,o.__prev=r.__key,o.__parent=r.__parent,n&&W(s)){const h=this.getIndexWithinParent();xl(s,u,h+1);const g=u.__key;a&&s.anchor.set(g,h+2,"element"),l&&s.focus.set(g,h+2,"element")}return t}insertBefore(t,n=!0){ut(),Zc(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.__key;vo(o);const s=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,c=this.getIndexWithinParent();s===null?a.__first=i:s.getWritable().__next=i,a.__size++,r.__prev=i,o.__prev=l,o.__next=r.__key,o.__parent=r.__parent;const u=Y();return n&&W(u)&&xl(u,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return ye()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){ut();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(B(r))return r.select();if(!X(r)){const i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(t,n)}selectNext(t,n){ut();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(B(r))return r.select(0,0);if(!X(r)){const i=r.getIndexWithinParent();return o.select(i,i)}return r.select(t,n)}markDirty(){this.getWritable()}reconcileObservedMutation(t,n){this.markDirty()}}const K3="historic",pi="history-merge",U3="paste",s1="collaboration",G3="skip-scroll-into-view",q3="skip-dom-selection",Y3="skip-selection-focus";class Oi extends Bn{static getType(){return"linebreak"}static clone(t){return new Oi(t.__key)}constructor(t){super(t)}getTextContent(){return`
39
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>(function(n){const r=n.parentElement;if(r!==null&&Sl(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&ba(o)){const i=r.lastChild;if(i===n||i.previousSibling===n&&ba(i))return!0}}return!1})(t)||(function(n){const r=n.parentElement;if(r!==null&&Sl(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&ba(o))return!1;const i=r.lastChild;if(i===n||i.previousSibling===n&&ba(i))return!0}return!1})(t)?null:{conversion:X3,priority:0}}}static importJSON(t){return Tn().updateFromJSON(t)}}function X3(e){return{node:Tn()}}function Tn(){return _t(new Oi)}function zn(e){return e instanceof Oi}function ba(e){return xr(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function Uc(e,t){return 16&t?"code":t&Eb?"mark":32&t?"sub":64&t?"sup":null}function Gc(e,t){return 1&t?"strong":2&t?"em":"span"}function a1(e,t,n,r,o){const i=r.classList;let s=mi(o,"base");s!==void 0&&i.add(...s),s=mi(o,"underlineStrikethrough");let a=!1;const l=8&t&&4&t;s!==void 0&&(8&n&&4&n?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const c in Dr){const u=Dr[c];if(s=mi(o,c),s!==void 0)if(n&u){if(a&&(c==="underline"||c==="strikethrough")){t&u&&i.remove(...s);continue}((t&u)===0||l&&c==="underline"||c==="strikethrough")&&i.add(...s)}else t&u&&i.remove(...s)}}function l1(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?Bl:"");if(r==null)t.textContent=i;else{const s=r.nodeValue;if(s!==i)if(o||xo){const[a,l,c]=(function(u,f){const d=u.length,h=f.length;let g=0,p=0;for(;g<d&&g<h&&u[g]===f[g];)g++;for(;p+g<d&&p+g<h&&u[d-p-1]===f[h-p-1];)p++;return[g,d-g-p,f.slice(g,h-p)]})(s,i);l!==0&&r.deleteData(a,l),r.insertData(a,c)}else r.nodeValue=i}}function bm(e,t,n,r,o,i){l1(o,e,t);const s=i.theme.text;s!==void 0&&a1(0,0,r,e,s)}function wa(e,t){const n=document.createElement(t);return n.appendChild(e),n}class un extends Bn{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(t){return new un(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",n){super(n),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return x3[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Rr()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const n=Dr[t];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,n){return wl(this.getLatest().__format,t,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,n){const r=this.__format,o=Uc(0,r),i=Gc(0,r),s=o===null?i:o,a=document.createElement(s);let l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),o!==null&&(l=document.createElement(i),a.appendChild(l)),bm(l,this,0,r,this.__text,t);const c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(t,n,r){const o=this.__text,i=t.__format,s=this.__format,a=Uc(0,i),l=Uc(0,s),c=Gc(0,i),u=Gc(0,s);if((a===null?c:a)!==(l===null?u:l))return!0;if(a===l&&c!==u){const p=n.firstChild;p==null&&q(48);const m=document.createElement(u);return bm(m,this,0,s,o,r),n.replaceChild(m,p),!1}let f=n;l!==null&&a!==null&&(f=n.firstChild,f==null&&q(49)),l1(o,f,this);const d=r.theme.text;d!==void 0&&i!==s&&a1(0,i,s,f,d);const h=t.__style,g=this.__style;return h!==g&&(n.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:eA,priority:0}),b:()=>({conversion:J3,priority:0}),code:()=>({conversion:Qn,priority:0}),em:()=>({conversion:Qn,priority:0}),i:()=>({conversion:Qn,priority:0}),mark:()=>({conversion:Qn,priority:0}),s:()=>({conversion:Qn,priority:0}),span:()=>({conversion:Z3,priority:0}),strong:()=>({conversion:Qn,priority:0}),sub:()=>({conversion:Qn,priority:0}),sup:()=>({conversion:Qn,priority:0}),u:()=>({conversion:Qn,priority:0})}}static importJSON(t){return Fe().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:n}=super.exportDOM(t);return Be(n)||q(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=wa(n,"b")),this.hasFormat("italic")&&(n=wa(n,"i")),this.hasFormat("strikethrough")&&(n=wa(n,"s")),this.hasFormat("underline")&&(n=wa(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,n){}setFormat(t){const n=this.getWritable();return n.__format=typeof t=="string"?Dr[t]:t,n}setDetail(t){const n=this.getWritable();return n.__detail=typeof t=="string"?m3[t]:t,n}setStyle(t){const n=this.getWritable();return n.__style=t,n}toggleFormat(t){const n=wl(this.getFormat(),t,null);return this.setFormat(n)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const n=v3[t];if(this.__mode===n)return this;const r=this.getWritable();return r.__mode=n,r}setTextContent(t){if(this.__text===t)return this;const n=this.getWritable();return n.__text=t,n}select(t,n){ut();let r=t,o=n;const i=Y(),s=this.getTextContent(),a=this.__key;if(typeof s=="string"){const l=s.length;r===void 0&&(r=l),o===void 0&&(o=l)}else r=0,o=0;if(!W(i))return d1(a,r,a,o,"text","text");{const l=Rr();l!==i.anchor.key&&l!==i.focus.key||gt(a),i.setTextNodeRange(this,r,this,o)}return i}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,n,r,o){const i=this.getWritable(),s=i.__text,a=r.length;let l=t;l<0&&(l=a+l,l<0&&(l=0));const c=Y();if(o&&W(c)){const f=t+a;c.setTextNodeRange(i,f,i,f)}const u=s.slice(0,l)+r+s.slice(l+n);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){ut();const n=this.getLatest(),r=n.getTextContent();if(r==="")return[];const o=n.__key,i=Rr(),s=r.length;t.sort((T,k)=>T-k),t.push(s);const a=[],l=t.length;for(let T=0,k=0;T<s&&k<=l;k++){const P=t[k];P>T&&(a.push(r.slice(T,P)),T=P)}const c=a.length;if(c===1)return[n];const u=a[0],f=n.getParent();let d;const h=n.getFormat(),g=n.getStyle(),p=n.__detail;let m=!1,x=null,y=null;const v=Y();if(W(v)){const[T,k]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];T.type==="text"&&T.key===o&&(x=T),k.type==="text"&&k.key===o&&(y=k)}n.isSegmented()?(d=Fe(u),d.__format=h,d.__style=g,d.__detail=p,d.__state=cm(n,d),m=!0):d=n.setTextContent(u);const b=[d];for(let T=1;T<c;T++){const k=Fe(a[T]);k.__format=h,k.__style=g,k.__detail=p,k.__state=cm(n,k);const P=k.__key;i===o&&gt(P),b.push(k)}const w=x?x.offset:null,_=y?y.offset:null;let E=0;for(const T of b){if(!x&&!y)break;const k=E+T.getTextContentSize();if(x!==null&&w!==null&&w<=k&&w>=E&&(x.set(T.getKey(),w-E,"text"),w<k&&(x=null)),y!==null&&_!==null&&_<=k&&_>=E){y.set(T.getKey(),_-E,"text");break}E=k}if(f!==null){(function(P){const O=P.getPreviousSibling(),D=P.getNextSibling();O!==null&&Cl(O),D!==null&&Cl(D)})(this);const T=f.getWritable(),k=this.getIndexWithinParent();m?(T.splice(k,0,b),this.remove()):T.splice(k,1,b),W(v)&&xl(v,f,k,c-1)}return b}mergeWithSibling(t){const n=t===this.getPreviousSibling();n||t===this.getNextSibling()||q(50);const r=this.__key,o=t.__key,i=this.__text,s=i.length;Rr()===o&&gt(r);const a=Y();if(W(a)){const f=a.anchor,d=a.focus;f!==null&&f.key===o&&Mm(f,n,r,t,s),d!==null&&d.key===o&&Mm(d,n,r,t,s)}const l=t.__text,c=n?l+i:i+l;this.setTextContent(c);const u=this.getWritable();return t.remove(),u}isTextEntity(){return!1}}function Z3(e){return{forChild:ph(e.style),node:null}}function J3(e){const t=e,n=t.style.fontWeight==="normal";return{forChild:ph(t.style,n?void 0:"bold"),node:null}}const wm=new WeakMap;function Q3(e){if(!Be(e))return!1;if(e.nodeName==="PRE")return!0;const t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function eA(e){const t=e;e.parentElement===null&&q(129);let n=t.textContent||"";if((function(r){let o,i=r.parentNode;const s=[r];for(;i!==null&&(o=wm.get(i))===void 0&&!Q3(i);)s.push(i),i=i.parentNode;const a=o===void 0?i:o;for(let l=0;l<s.length;l++)wm.set(s[l],a);return a})(t)!==null){const r=n.split(/(\r?\n|\t)/),o=[],i=r.length;for(let s=0;s<i;s++){const a=r[s];a===`
40
40
  `||a===`\r
41
- `?o.push(Tn()):a===" "?o.push(Oi()):a!==""&&o.push(Le(a))}return{node:o}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let r=t,o=!0;for(;r!==null&&(r=xm(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(n=n.slice(1)),o=!1;break}}o&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=t,o=!0;for(;r!==null&&(r=xm(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:Le(n)}}function xm(e,t){let n=e;for(;;){let r;for(;(r=t?n.nextSibling:n.previousSibling)===null;){const i=n.parentElement;if(i===null)return null;n=i}if(n=r,Be(n)){const i=n.style.display;if(i===""&&!Vd(n)||i!==""&&!i.startsWith("inline"))return null}let o=n;for(;(o=t?n.firstChild:n.lastChild)!==null;)n=o;if(vr(n))return n;if(n.nodeName==="BR")return null}}const GA={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Jn(e){const t=GA[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:fh(e.style,t),node:null}}function Le(e=""){return _t(new un(e))}function X(e){return e instanceof un}function fh(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o=n==="700"||n==="bold",i=r.includes("line-through"),s=e.fontStyle==="italic",a=r.includes("underline"),l=e.verticalAlign;return c=>(X(c)&&(o&&!c.hasFormat("bold")&&c.toggleFormat("bold"),i&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),l!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),l!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),t&&!c.hasFormat(t)&&c.toggleFormat(t)),c)}class $i extends un{static getType(){return"tab"}static clone(t){return new $i(t.__key)}constructor(t){super(" ",t),this.__detail=2}static importDOM(){return null}createDOM(t){const n=super.createDOM(t),r=gi(t.theme,"tab");return r!==void 0&&n.classList.add(...r),n}static importJSON(t){return Oi().updateFromJSON(t)}setTextContent(t){return t!==" "&&t!==""&&w1(126),super.setTextContent(" ")}spliceText(t,n,r,o){return r===""&&n===0||r===" "&&n===1||q(286),this}setDetail(t){return t!==2&&q(127),this}setMode(t){return t!=="normal"&&q(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Oi(){return _t(new $i)}function Hl(e){return e instanceof $i}class qA{key;offset;type;_selection;constructor(t,n,r){this._selection=null,this.key=t,this.offset=n,this.type=r}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:Ob(Mt(En(this,"next")),Mt(En(t,"next")))<0}getNode(){const t=Pe(this.key);return t===null&&q(20),t}set(t,n,r,o){const i=this._selection,s=this.key;o&&this.key===t&&this.offset===n&&this.type===r||(this.key=t,this.offset=n,this.type=r,Ii()||(Er()===s&&gt(t),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}}function zt(e,t,n){return new qA(e,t,n)}function Wc(e,t){let n=t.__key,r=e.offset,o="element";if(X(t)){o="text";const i=t.getTextContentSize();r>i&&(r=i)}else if(!B(t)){const i=t.getNextSibling();if(X(i))n=i.__key,r=0,o="text";else{const s=t.getParent();s&&(n=s.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function bm(e,t){if(B(t)){const n=t.getLastDescendant();B(n)||X(n)?Wc(e,n):Wc(e,t)}else Wc(e,t)}class Wl{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!bt(t))return!1;const n=this._nodes,r=t._nodes;return n.size===r.size&&Array.from(n).every(o=>r.has(o))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new Wl(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.getNodes(),r=n.length,o=n[r-1];let i;if(X(o))i=o.select();else{const s=o.getIndexWithinParent()+1;i=o.getParentOrThrow().select(s,s)}i.insertNodes(t);for(let s=0;s<r;s++)n[s].remove()}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this._nodes,r=[];for(const o of n){const i=Pe(o);i!==null&&r.push(i)}return Ii()||(this._cachedNodes=r),r}getTextContent(){const t=this.getNodes();let n="";for(let r=0;r<t.length;r++)n+=t[r].getTextContent();return n}deleteNodes(){const t=this.getNodes();if((Y()||Gn())===this&&t[0]){const n=tt(t[0],"next");Db(Vr(n,n))}for(const n of t)n.remove()}}function W(e){return e instanceof Po}class Po{format;style;anchor;focus;_cachedNodes;dirty;constructor(t,n,r,o){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!W(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=(function(r){const o=[],[i,s]=r.getTextSlices();i&&o.push(i.caret.origin);const a=new Set,l=new Set;for(const c of r)if(Vt(c)){const{origin:u}=c;o.length===0?a.add(u):(l.add(u),o.push(u))}else{const{origin:u}=c;B(u)&&l.has(u)||o.push(u)}if(s&&o.push(s.caret.origin),Dr(r.focus)&&B(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=Nt(r.focus.origin,"previous");Vt(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(o[o.length-1]);c=Xs(c))a.delete(c.origin),o.pop();for(;o.length>1;){const c=o[o.length-1];if(!B(c)||l.has(c)||c.isEmpty()||a.has(c))break;o.pop()}if(o.length===0&&r.isCollapsed()){const c=Mt(r.anchor),u=Mt(r.anchor.getFlipped()),f=h=>Hn(h)?h.origin:h.getNodeAtCaret(),d=f(c)||f(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);o.push(d)}return o})(Vb(Um(this),"next"));return Ii()||(this._cachedNodes=n),n}setTextNodeRange(t,n,r,o){this.anchor.set(t.__key,n,"text"),this.focus.set(r.__key,o,"text")}getTextContent(){const t=this.getNodes();if(t.length===0)return"";const n=t[0],r=t[t.length-1],o=this.anchor,i=this.focus,s=o.isBefore(i),[a,l]=Pd(this);let c="",u=!0;for(let f=0;f<t.length;f++){const d=t[f];if(B(d)&&!d.isInline())u||(c+=`
42
- `),u=!d.isEmpty();else if(u=!1,X(d)){let h=d.getTextContent();d===n?d===r?o.type==="element"&&i.type==="element"&&i.offset!==o.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=s?h.slice(a):h.slice(l):d===r&&(h=s?h.slice(0,l):h.slice(0,a)),c+=h}else!Se(d)&&!Bn(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(t){const n=$e(),r=n.getEditorState()._selection,o=lb(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,r);if(o===null)return;const[i,s]=o;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(s.key,s.offset,s.type,!0),As(this)}clone(){const t=this.anchor,n=this.focus;return new Po(zt(t.key,t.offset,t.type),zt(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=vl(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const n=Ir[t];return(this.format&n)!==0}insertRawText(t){const n=t.split(/(\r?\n|\t)/),r=[],o=n.length;for(let i=0;i<o;i++){const s=n[i];s===`
41
+ `?o.push(Tn()):a===" "?o.push(Di()):a!==""&&o.push(Fe(a))}return{node:o}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let r=t,o=!0;for(;r!==null&&(r=Cm(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(n=n.slice(1)),o=!1;break}}o&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=t,o=!0;for(;r!==null&&(r=Cm(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:Fe(n)}}function Cm(e,t){let n=e;for(;;){let r;for(;(r=t?n.nextSibling:n.previousSibling)===null;){const i=n.parentElement;if(i===null)return null;n=i}if(n=r,Be(n)){const i=n.style.display;if(i===""&&!Hd(n)||i!==""&&!i.startsWith("inline"))return null}let o=n;for(;(o=t?n.firstChild:n.lastChild)!==null;)n=o;if(xr(n))return n;if(n.nodeName==="BR")return null}}const tA={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Qn(e){const t=tA[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:ph(e.style,t),node:null}}function Fe(e=""){return _t(new un(e))}function X(e){return e instanceof un}function ph(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o=n==="700"||n==="bold",i=r.includes("line-through"),s=e.fontStyle==="italic",a=r.includes("underline"),l=e.verticalAlign;return c=>(X(c)&&(o&&!c.hasFormat("bold")&&c.toggleFormat("bold"),i&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),l!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),l!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),t&&!c.hasFormat(t)&&c.toggleFormat(t)),c)}class Ii extends un{static getType(){return"tab"}static clone(t){return new Ii(t.__key)}constructor(t){super(" ",t),this.__detail=2}static importDOM(){return null}createDOM(t){const n=super.createDOM(t),r=mi(t.theme,"tab");return r!==void 0&&n.classList.add(...r),n}static importJSON(t){return Di().updateFromJSON(t)}setTextContent(t){return t!==" "&&t!==""&&Sb(126),super.setTextContent(" ")}spliceText(t,n,r,o){return r===""&&n===0||r===" "&&n===1||q(286),this}setDetail(t){return t!==2&&q(127),this}setMode(t){return t!=="normal"&&q(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Di(){return _t(new Ii)}function Gl(e){return e instanceof Ii}class nA{key;offset;type;_selection;constructor(t,n,r){this._selection=null,this.key=t,this.offset=n,this.type=r}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:D1(Mt(En(this,"next")),Mt(En(t,"next")))<0}getNode(){const t=Le(this.key);return t===null&&q(20),t}set(t,n,r,o){const i=this._selection,s=this.key;o&&this.key===t&&this.offset===n&&this.type===r||(this.key=t,this.offset=n,this.type=r,ji()||(Rr()===s&&gt(t),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}}function zt(e,t,n){return new nA(e,t,n)}function qc(e,t){let n=t.__key,r=e.offset,o="element";if(X(t)){o="text";const i=t.getTextContentSize();r>i&&(r=i)}else if(!B(t)){const i=t.getNextSibling();if(X(i))n=i.__key,r=0,o="text";else{const s=t.getParent();s&&(n=s.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function Sm(e,t){if(B(t)){const n=t.getLastDescendant();B(n)||X(n)?qc(e,n):qc(e,t)}else qc(e,t)}class ql{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!bt(t))return!1;const n=this._nodes,r=t._nodes;return n.size===r.size&&Array.from(n).every(o=>r.has(o))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new ql(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.getNodes(),r=n.length,o=n[r-1];let i;if(X(o))i=o.select();else{const s=o.getIndexWithinParent()+1;i=o.getParentOrThrow().select(s,s)}i.insertNodes(t);for(let s=0;s<r;s++)n[s].remove()}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this._nodes,r=[];for(const o of n){const i=Le(o);i!==null&&r.push(i)}return ji()||(this._cachedNodes=r),r}getTextContent(){const t=this.getNodes();let n="";for(let r=0;r<t.length;r++)n+=t[r].getTextContent();return n}deleteNodes(){const t=this.getNodes();if((Y()||qn())===this&&t[0]){const n=tt(t[0],"next");V1(Vr(n,n))}for(const n of t)n.remove()}}function W(e){return e instanceof Fo}class Fo{format;style;anchor;focus;_cachedNodes;dirty;constructor(t,n,r,o){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!W(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=(function(r){const o=[],[i,s]=r.getTextSlices();i&&o.push(i.caret.origin);const a=new Set,l=new Set;for(const c of r)if(jt(c)){const{origin:u}=c;o.length===0?a.add(u):(l.add(u),o.push(u))}else{const{origin:u}=c;B(u)&&l.has(u)||o.push(u)}if(s&&o.push(s.caret.origin),jr(r.focus)&&B(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=Nt(r.focus.origin,"previous");jt(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(o[o.length-1]);c=Qs(c))a.delete(c.origin),o.pop();for(;o.length>1;){const c=o[o.length-1];if(!B(c)||l.has(c)||c.isEmpty()||a.has(c))break;o.pop()}if(o.length===0&&r.isCollapsed()){const c=Mt(r.anchor),u=Mt(r.anchor.getFlipped()),f=h=>Wn(h)?h.origin:h.getNodeAtCaret(),d=f(c)||f(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);o.push(d)}return o})(B1(Ym(this),"next"));return ji()||(this._cachedNodes=n),n}setTextNodeRange(t,n,r,o){this.anchor.set(t.__key,n,"text"),this.focus.set(r.__key,o,"text")}getTextContent(){const t=this.getNodes();if(t.length===0)return"";const n=t[0],r=t[t.length-1],o=this.anchor,i=this.focus,s=o.isBefore(i),[a,l]=Od(this);let c="",u=!0;for(let f=0;f<t.length;f++){const d=t[f];if(B(d)&&!d.isInline())u||(c+=`
42
+ `),u=!d.isEmpty();else if(u=!1,X(d)){let h=d.getTextContent();d===n?d===r?o.type==="element"&&i.type==="element"&&i.offset!==o.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=s?h.slice(a):h.slice(l):d===r&&(h=s?h.slice(0,l):h.slice(0,a)),c+=h}else!_e(d)&&!zn(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(t){const n=$e(),r=n.getEditorState()._selection,o=u1(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,r);if(o===null)return;const[i,s]=o;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(s.key,s.offset,s.type,!0),Ns(this)}clone(){const t=this.anchor,n=this.focus;return new Fo(zt(t.key,t.offset,t.type),zt(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=wl(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const n=Dr[t];return(this.format&n)!==0}insertRawText(t){const n=t.split(/(\r?\n|\t)/),r=[],o=n.length;for(let i=0;i<o;i++){const s=n[i];s===`
43
43
  `||s===`\r
44
- `?r.push(Tn()):s===" "?r.push(Oi()):r.push(Le(s))}this.insertNodes(r)}insertText(t){const n=this.anchor,r=this.focus,o=this.format,i=this.style;let s=n,a=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,a=n),s.type==="element"&&(function(m,x,y,v){const b=m.getNode(),w=b.getChildAtIndex(m.offset),_=Le();if(_.setFormat(y),_.setStyle(v),Gr(w))w.splice(0,0,[_]);else{const E=ot(b)?me().append(_):_;w===null?b.append(E):w.insertBefore(E)}m.is(x)&&x.set(_.__key,0,"text"),m.set(_.__key,0,"text")})(s,a,o,i),a.type==="element"&&bn(a,Mt(En(a,"next")));const l=s.offset;let c=a.offset;const u=this.getNodes(),f=u.length;let d=u[0];X(d)||q(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let p=u[f-1];if(f===1&&a.type==="element"&&(c=h,a.set(s.key,c,"text")),this.isCollapsed()&&l===h&&(nr(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let m=d.getNextSibling();if(X(m)&&m.canInsertTextBefore()&&!nr(m)||(m=Le(),m.setFormat(o),m.setStyle(i),g.canInsertTextAfter()?d.insertAfter(m):g.insertAfter(m)),m.select(0,0),d=m,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(nr(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let m=d.getPreviousSibling();if(X(m)&&!nr(m)||(m=Le(),m.setFormat(o),g.canInsertTextBefore()?d.insertBefore(m):g.insertBefore(m)),m.select(),d=m,t!=="")return void this.insertText(t)}else if(d.isSegmented()&&l!==h){const m=Le(d.getTextContent());m.setFormat(o),d.replace(m),d=m}else if(!this.isCollapsed()&&t!==""){const m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||B(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),ab(this.anchor,this.focus,null),void this.insertText(t)}if(f===1){if(po(d)){const v=Le(t);return v.select(),void d.replace(v)}const m=d.getFormat(),x=d.getStyle();if(l!==c||m===o&&x===i){if(Hl(d)){const v=Le(t);return v.setFormat(o),v.setStyle(i),v.select(),void d.replace(v)}}else{if(d.getTextContent()!==""){const v=Le(t);if(v.setFormat(o),v.setStyle(i),v.select(),l===0)d.insertBefore(v,!1);else{const[b]=d.splitText(l);b.insertAfter(v,!1)}return void(v.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}d.setFormat(o),d.setStyle(i)}const y=c-l;d=d.spliceText(l,y,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=t.length:(this.format=m,this.style=x))}else{const m=new Set([...d.getParentKeys(),...p.getParentKeys()]),x=B(d)?d:d.getParentOrThrow();let y=B(p)?p:p.getParentOrThrow(),v=p;if(!x.is(y)&&y.isInline())do v=y,y=y.getParentOrThrow();while(y.isInline());if(a.type==="text"&&(c!==0||p.getTextContent()==="")||a.type==="element"&&p.getIndexWithinParent()<c)if(X(p)&&!po(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){const T=Le(p.getTextContent());p.replace(T),p=T}ot(a.getNode())||a.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{const T=p.getParentOrThrow();T.canBeEmpty()||T.getChildrenSize()!==1?p.remove():T.remove()}else m.add(p.__key);const b=y.getChildren(),w=new Set(u),_=x.is(y),E=x.isInline()&&d.getNextSibling()===null?x:d;for(let T=b.length-1;T>=0;T--){const k=b[T];if(k.is(d)||B(k)&&k.isParentOf(d))break;k.isAttached()&&(!w.has(k)||k.is(v)?_||E.insertAfter(k,!1):k.remove())}if(!_){let T=y,k=null;for(;T!==null;){const P=T.getChildren(),O=P.length;(O===0||P[O-1].is(k))&&(m.delete(T.__key),k=T),T=T.getParent()}}if(po(d))if(l===h)d.select();else{const T=Le(t);T.select(),d.replace(T)}else d=d.spliceText(l,h-l,t,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);for(let T=1;T<f;T++){const k=u[T],P=k.__key;m.has(P)||k.remove()}}}removeText(){const t=Y()===this;Ga(this,R3(Um(this))),t&&Y()!==this&&Ge(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void gt(null);const r=this.getNodes(),o=[];for(const b of r)X(b)&&o.push(b);const i=b=>{r.forEach(w=>{if(B(w)){const _=w.getFormatFlags(t,b);w.setTextFormat(_)}})},s=o.length;if(s===0)return this.toggleFormat(t),gt(null),void i(n);const a=this.anchor,l=this.focus,c=this.isBackward(),u=c?l:a,f=c?a:l;let d=0,h=o[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(d=1,h=o[1],g=0),h==null)return;const p=h.getFormatFlags(t,n);i(p);const m=s-1;let x=o[m];const y=f.type==="text"?f.offset:x.getTextContentSize();if(h.is(x)){if(g===y)return;if(nr(h)||g===0&&y===h.getTextContentSize())h.setFormat(p);else{const b=h.splitText(g,y),w=g===0?b[0]:b[1];w.setFormat(p),u.type==="text"&&u.set(w.__key,0,"text"),f.type==="text"&&f.set(w.__key,y-g,"text")}return void(this.format=p)}g===0||nr(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const v=x.getFormatFlags(t,p);y>0&&(y===x.getTextContentSize()||nr(x)||([x]=x.splitText(y)),x.setFormat(v));for(let b=d+1;b<m;b++){const w=o[b],_=w.getFormatFlags(t,v);w.setFormat(_)}u.type==="text"&&u.set(h.__key,g,"text"),f.type==="text"&&f.set(x.__key,y,"text"),this.format=p|v}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=Y();return W(g)||q(134),g.insertNodes(t)}const n=(this.isBackward()?this.focus:this.anchor).getNode(),r=be(n,Tr),o=t[t.length-1];if(B(r)&&"__language"in r){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const g=Kc(this);r.splice(g,0,t),o.selectEnd()}return}if(!t.some(g=>(B(g)||Se(g))&&!g.isInline())){B(r)||q(211,n.constructor.name,n.getType());const g=Kc(this);return r.splice(g,0,t),void o.selectEnd()}const i=(function(g){const p=me();let m=null;for(let x=0;x<g.length;x++){const y=g[x],v=Bn(y);if(v||Se(y)&&y.isInline()||B(y)&&y.isInline()||X(y)||y.isParentRequired()){if(m===null&&(m=y.createParentElementNode(),p.append(m),v))continue;m!==null&&m.append(y)}else p.append(y),m=null}return p})(t),s=i.getLastDescendant(),a=i.getChildren(),l=!B(r)||!r.isEmpty()?this.insertParagraph():null,c=a[a.length-1];let u=a[0];var f;B(f=u)&&Tr(f)&&!f.isEmpty()&&B(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(B(r)||q(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=a[1]),u&&(r===null&&q(212,n.constructor.name,n.getType()),(function(g,p){const m=p.getParentOrThrow().getLastChild();let x=p;const y=[p];for(;x!==m;)x.getNextSibling()||q(140),x=x.getNextSibling(),y.push(x);let v=g;for(const b of y)v=v.insertAfter(b)})(r,u));const d=be(s,Tr);l&&B(d)&&(l.canMergeWhenEmpty()||Tr(c))&&(d.append(...l.getChildren()),l.remove()),B(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=B(r)?r.getLastChild():null;Bn(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=me();return qe().splice(this.anchor.offset,0,[s]),s.select(),s}const t=Kc(this),n=be(this.anchor.getNode(),Tr);B(n)||q(213);const r=n.getChildAtIndex(t),o=r?[r,...r.getNextSiblings()]:[],i=n.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(t){const n=Tn();if(this.insertNodes([n]),t){const r=n.getParentOrThrow(),o=n.getIndexWithinParent();r.select(o,o)}}extract(){const t=[...this.getNodes()],n=t.length;let r=t[0],o=t[n-1];const[i,s]=Pd(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,f]=a?[s,i]:[i,s];if(n===0)return[];if(n===1){if(X(r)&&!this.isCollapsed()){const d=r.splitText(u,f),h=u===0?d[0]:d[1];return h?(l.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(X(r)&&(u===r.getTextContentSize()?t.shift():u!==0&&([,r]=r.splitText(u),t[0]=r,l.set(r.getKey(),0,"text"))),X(o)){const d=o.getTextContent().length;f===0?t.pop():f!==d&&([o]=o.splitText(f),t[t.length-1]=o,c.set(o.getKey(),o.getTextContentSize(),"text"))}return t}modify(t,n,r){if(km(this,t,n,r))return;const o=t==="move",i=$e(),s=Ft(dn(i));if(!s)return;const a=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(l===null||a===null||!B(c)||c.isInline()||c.canBeEmpty()||Id(a,i,l),this.dirty){let u=Co(i,this.anchor.key),f=Co(i,this.focus.key);this.anchor.type==="text"&&(u=Ti(u)),this.focus.type==="text"&&(f=Ti(f)),u&&f&&ub(s,u,this.anchor.offset,f,this.focus.offset)}if((function(u,f,d,h){u.modify(f,d,h)})(s,t,n?"backward":"forward",r),s.rangeCount>0){const u=s.getRangeAt(0),f=this.anchor.getNode(),d=ot(f)?f:f3(f);if(this.applyDOMRange(u),this.dirty=!0,!o){const h=this.getNodes(),g=[];let p=!1;for(let m=0;m<h.length;m++){const x=h[m];Od(x,d)?g.push(x):p=!0}if(p&&g.length>0)if(n){const m=g[0];B(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=g[g.length-1];B(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(m){const x=m.focus,y=m.anchor,v=y.key,b=y.offset,w=y.type;y.set(x.key,x.offset,x.type,!0),x.set(v,b,w,!0)})(this)}}r==="lineboundary"&&km(this,t,n,r,"decorators")}forwardDeletion(t,n,r){if(!r&&(t.type==="element"&&B(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const o=n.getParent(),i=n.getNextSibling()||(o===null?null:o.getNextSibling());if(B(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,t))return;const i=Ls(En(r,t?"previous":"next"));if(i.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of i.iterNodeCarets("shadowRoot"))if(Vt(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(B(i.anchor.origin)&&i.anchor.origin.isEmpty()){const c=Mt(l);Ga(this,Vr(c,c)),i.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(Dr(l)){if(B(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(i.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(Se(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&B(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();const c=hh();c.add(l.origin.getKey()),Ge(c)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:c}=a;return Ga(this,Vr(!l.origin.isEmpty()&&c.isEmpty()?Zs(tt(c,l.direction)):i.anchor,l)),this.removeText()}}const s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&r.offset===0&&Cm(this,r.getNode()))return}else{const a=s.type==="text"?s.getNode():null;if(o=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=s.offset,c=a.getTextContentSize();if(a.is(o)||t&&l!==c||!t&&l!==0)return void Sm(a,t,l)}else if(o!==null&&o.isSegmented()){const l=r.offset,c=o.getTextContentSize();if(o.is(a)||t&&l!==0||!t&&l!==c)return void Sm(o,t,l)}(function(l,c){const u=l.anchor,f=l.focus,d=u.getNode(),h=f.getNode();if(d===h&&u.type==="text"&&f.type==="text"){const g=u.offset,p=f.offset,m=g<p,x=m?g:p,y=m?p:g,v=y-1;x!==v&&(function(b){return!(Rb(b)||YA(b))})(d.getTextContent().slice(x,y))&&(c?f.set(f.key,v,f.type):u.set(u.key,v,u.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&ot(r.getParent())&&r.getPreviousSibling()===null&&Cm(this,r)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function bt(e){return e instanceof Wl}function wm(e){const t=e.offset;if(e.type==="text")return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Pd(e){const t=e.getStartEndPoints();if(t===null)return[0,0];const[n,r]=t;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[wm(n),wm(r)]}function Cm(e,t){for(let n=t;n;n=n.getParent()){if(B(n)){if(n.collapseAtStart(e))return!0;if(pt(n))break}if(n.getPreviousSibling())break}return!1}const YA=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch{}return()=>!1})();function Sm(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,a=0;for(let c=0;c<i;c++){const u=c===i-1;if(a=s,s+=o[c].length,t&&s===n||s>n||u){o.splice(c,1),u&&(a=void 0);break}}const l=o.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function _m(e,t,n,r){let o,i=t;if(Be(e)){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],f=!1;if(u===c)u=a[i+1],f=!0;else if(c!==null){const d=c.parentNode;e===d&&t>Array.prototype.indexOf.call(d.children,c)&&i--}if(o=li(u),X(o))i=Wn(o,s?"next":"previous");else{let d=li(e);if(d===null)return null;if(B(d)){const h=r.getElementByKey(d.getKey());h===null&&q(214),[d,i]=d.getDOMSlot(h).resolveChildIndex(d,h,e,t),B(d)||q(215),s&&i>=d.getChildrenSize()&&(i=Math.max(0,d.getChildrenSize()-1));let p=d.getChildAtIndex(i);if(B(p)&&(function(m,x,y){const v=m.getParent();return y===null||v===null||!v.canBeEmpty()||v!==y.getNode()})(p,0,n)){const m=s?p.getLastDescendant():p.getFirstDescendant();m===null?d=p:(p=m,d=B(p)?p:p.getParentOrThrow()),i=0}X(p)?(o=p,d=null,i=Wn(p,s?"next":"previous")):p!==d&&s&&!f&&(B(d)||q(216),i=Math.min(d.getChildrenSize(),i+1))}else{const h=d.getIndexWithinParent();i=t===0&&Se(d)&&li(e)===d?h:h+1,d=d.getParentOrThrow()}if(B(d))return zt(d.__key,i,"element")}}else o=li(e);return X(o)?zt(o.__key,Wn(o,i,"clamp"),"text"):null}function Tm(e,t,n){const r=e.offset,o=e.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(t){if((n||!t)&&i===null&&B(s)&&s.isInline()){const a=s.getPreviousSibling();X(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else B(i)&&!n&&i.isInline()?e.set(i.__key,i.getChildrenSize(),"element"):X(i)&&e.set(i.__key,i.getTextContent().length,"text")}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(t&&B(i)&&i.isInline())e.set(i.__key,0,"element");else if((n||t)&&i===null&&B(s)&&s.isInline()&&!s.canInsertTextAfter()){const a=s.getNextSibling();X(a)&&e.set(a.__key,0,"text")}}}function ab(e,t,n){if(e.type==="text"&&t.type==="text"){const r=e.isBefore(t),o=e.is(t);Tm(e,r,o),Tm(t,!r,o),o&&t.set(e.key,e.offset,e.type);const i=$e();if(i.isComposing()&&i._compositionKey!==e.key&&W(n)){const s=n.anchor,a=n.focus;e.set(s.key,s.offset,s.type,!0),t.set(a.key,a.offset,a.type,!0)}}}function lb(e,t,n,r,o,i){if(e===null||n===null||!qs(o,e,n))return null;const s=_m(e,t,W(i)?i.anchor:null,o);if(s===null)return null;const a=_m(n,r,W(i)?i.focus:null,o);if(a===null)return null;if(s.type==="element"&&a.type==="element"){const l=li(e),c=li(n);if(Se(l)&&Se(c))return null}return ab(s,a,i),[s,a]}function Fd(e){return B(e)&&!e.isInline()}function cb(e,t,n,r,o,i){const s=Ur(),a=new Po(zt(e,t,o),zt(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function Kl(){const e=zt("root",0,"element"),t=zt("root",0,"element");return new Po(e,t,0,"")}function hh(){return new Wl(new Set)}function XA(e,t){return Ul(null,e,t,null)}function Ul(e,t,n,r){const o=n._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,a=s==="selectionchange",l=!pd&&(a||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(W(e)&&!l)return e.clone();if(t===null)return null;if(c=t.anchorNode,u=t.focusNode,f=t.anchorOffset,d=t.focusOffset,(a||s===void 0)&&W(e)&&!qs(n,c,u))return e.clone();const h=lb(c,f,u,d,n,e);if(h===null)return null;const[g,p]=h;return new Po(g,p,W(e)?e.format:0,W(e)?e.style:"")}function Y(){return Ur()._selection}function Gn(){return $e()._editorState._selection}function ml(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const c=o.offset;if(n<=c&&r>0||n<c&&r<0){const u=Math.max(0,c+r);o.set(l,u,"element"),i.set(l,u,"element"),Em(e)}}else{const c=e.isBackward(),u=c?i:o,f=u.getNode(),d=c?o:i,h=d.getNode();if(t.is(f)){const g=u.offset;(n<=g&&r>0||n<g&&r<0)&&u.set(l,Math.max(0,g+r),"element")}if(t.is(h)){const g=d.offset;(n<=g&&r>0||n<g&&r<0)&&d.set(l,Math.max(0,g+r),"element")}}Em(e)}function Em(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,i=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!B(i))return;const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(X(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(B(i)){const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(X(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text")}}if(B(s)){const a=s.getChildrenSize(),l=o>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(o);if(X(c)){let u=0;l&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function yl(e,t,n,r,o){let i=null,s=0,a=null;r!==null?(i=r.__key,X(r)?(s=r.getTextContentSize(),a="text"):B(r)&&(s=r.getChildrenSize(),a="element")):o!==null&&(i=o.__key,X(o)?a="text":B(o)&&(a="element")),i!==null&&a!==null?e.set(i,s,a):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function Rm(e,t,n,r,o){e.type==="text"?e.set(n,e.offset+(t?0:o),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function ub(e,t,n,r,o){try{e.setBaseAndExtent(t,n,r,o)}catch{}}function ZA(e,t,n,r,o,i,s){const a=r.anchorNode,l=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(o.has(ob)&&f!==i||f!==null&&bh(f))return;if(!W(t))return void(e!==null&&qs(n,a,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.key,p=h.key,m=Co(n,g),x=Co(n,p),y=d.offset,v=h.offset,b=t.format,w=t.style,_=t.isCollapsed();let E=m,T=x,k=!1;if(d.type==="text"){E=Ti(m);const H=d.getNode();k=H.getFormat()!==b||H.getStyle()!==w}else W(e)&&e.anchor.type==="text"&&(k=!0);var P,O,D,I,$;if(h.type==="text"&&(T=Ti(x)),E!==null&&T!==null&&(_&&(e===null||k||W(e)&&(e.format!==b||e.style!==w))&&(P=b,O=w,D=y,I=g,$=performance.now(),Z1=[P,O,D,I,$]),c!==y||u!==v||a!==E||l!==T||r.type==="Range"&&_||(f!==null&&i.contains(f)||o.has(BA)||i.focus({preventScroll:!0}),d.type==="element"))){if(ub(r,E,y,T,v),!o.has(VA)&&t.isCollapsed()&&i!==null&&i===document.activeElement){const H=W(t)&&t.anchor.type==="element"?E.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(H!==null){let U;if(H instanceof Text){const F=document.createRange();F.selectNode(H),U=F.getBoundingClientRect()}else U=H.getBoundingClientRect();(function(F,N,j){const K=Nb(j),te=Eh(K);if(K===null||te===null)return;let{top:J,bottom:Z}=N,se=0,oe=0,fe=j;for(;fe!==null;){const _e=fe===K.body;if(_e)se=0,oe=dn(F).innerHeight;else{const ye=fe.getBoundingClientRect();se=ye.top,oe=ye.bottom}let ne=0;if(J<se?ne=-(se-J):Z>oe&&(ne=Z-oe),ne!==0)if(_e)te.scrollBy(0,ne);else{const ye=fe.scrollTop;fe.scrollTop+=ne;const Te=fe.scrollTop-ye;J-=Te,Z-=Te}if(_e)break;fe=Ys(fe)}})(n,U,i)}}Rd=!0}}function gh(e){let t=Y()||Gn();t===null&&(t=qe().selectEnd()),t.insertNodes(e)}function Kc(e){let t=e;e.isCollapsed()||t.removeText();const n=Y();W(n)&&(t=n),W(t)||q(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!Tr(o);){const s=o;if([o,i]=JA(o,i),s.is(o))break}return i}function JA(e,t){const n=e.getParent();if(!n){const o=me();return qe().append(o),o.select(),[qe(),0]}if(X(e)){const o=e.splitText(t);if(o.length===0)return[n,e.getIndexWithinParent()];const i=t===0?0:1;return[n,o[0].getIndexWithinParent()+i]}if(!B(e)||t===0)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const o=new Po(zt(e.__key,t,"element"),zt(e.__key,t,"element"),0,""),i=e.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function km(e,t,n,r,o="decorators-and-blocks"){if(t==="move"&&r==="character"&&!e.isCollapsed()){const[u,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(u.key,u.offset,u.type),!0}const i=En(e.focus,n?"previous":"next"),s=r==="lineboundary",a=t==="move";let l=i,c=o==="decorators-and-blocks";if(!Ph(l)){for(const u of l){c=!1;const{origin:f}=u;if(!Se(f)||f.isIsolated()||(l=u,!s||!f.isInline()))break}if(c)for(const u of Ls(i).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(Vt(u))u.origin.isInline()||(l=u);else{if(B(u.origin))continue;Se(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===i)return!1;if(a&&!s&&Se(l.origin)&&l.origin.isKeyboardSelectable()){const u=hh();return u.add(l.origin.getKey()),Ge(u),!0}return l=Mt(l),a&&bn(e.anchor,l),bn(e.focus,l),c||!s}let dt=null,ft=null,Dt=!1,Uc=!1,Ka=0;const Am={characterData:!0,childList:!0,subtree:!0};function Ii(){return Dt||dt!==null&&dt._readOnly}function ut(){Dt&&q(13)}function db(){Ka>99&&q(14)}function Ur(){return dt===null&&q(195,fb()),dt}function $e(){return ft===null&&q(196,fb()),ft}function fb(){let e=0;const t=new Set,n=_i.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=ql(o);if(wh(i))e++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function QA(){return ft}function Mm(e,t,n){const r=t.__type,o=vb(e,r);let i=n.get(r);i===void 0&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let a=0;a<s&&(i[a](t),t.isAttached());a++);}function Nm(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function hb(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const o of r)n.add(o)}function e3(e){return ph(e,$e()._nodes)}function ph(e,t){const n=e.type,r=t.get(n);r===void 0&&q(17,n);const o=r.klass;e.type!==o.getType()&&q(18,o.name);const i=o.importJSON(e),s=e.children;if(B(i)&&Array.isArray(s))for(let a=0;a<s.length;a++){const l=ph(s[a],t);i.append(l)}return i}function Pm(e,t,n){const r=dt,o=Dt,i=ft;dt=t,Dt=!0,ft=e;try{return n()}finally{dt=r,Dt=o,ft=i}}function ir(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||r===null;if(n===null)return;const i=e._editorState,s=i._selection,a=n._selection,l=e._dirtyType!==0,c=dt,u=Dt,f=ft,d=e._updating,h=e._observer;let g=null;if(e._pendingEditorState=null,e._editorState=n,!o&&l&&h!==null){ft=e,dt=n,Dt=!1,e._updating=!0;try{const _=e._dirtyType,E=e._dirtyElements,T=e._dirtyLeaves;h.disconnect(),g=SA(i,n,e,_,E,T)}catch(_){if(_ instanceof Error&&e._onError(_),Uc)throw _;return mb(e,null,r,n),k1(e),e._dirtyType=2,Uc=!0,ir(e,i),void(Uc=!1)}finally{h.observe(r,Am),e._updating=d,dt=c,Dt=u,ft=f}}n._readOnly||(n._readOnly=!0);const p=e._dirtyLeaves,m=e._dirtyElements,x=e._normalizedNodes,y=e._updateTags,v=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(_,E){const T=_._decorators;let k=_._pendingDecorators||T;const P=E._nodeMap;let O;for(O in k)P.has(O)||(k===T&&(k=Tb(_)),delete k[O])})(e,n);const b=o?null:Ft(dn(e));if(e._editable&&b!==null&&(l||a===null||a.dirty||!a.is(s))&&r!==null&&!y.has(jA)){ft=e,dt=n;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){const _=e._blockCursorElement;_!==null&&Id(_,e,r),ZA(s,a,e,b,y,r)}(function(_,E,T){let k=_._blockCursorElement;if(W(T)&&T.isCollapsed()&&T.anchor.type==="element"&&E.contains(document.activeElement)){const P=T.anchor,O=P.getNode(),D=P.offset;let I=!1,$=null;if(D===O.getChildrenSize())qc(O.getChildAtIndex(D-1))&&(I=!0);else{const H=O.getChildAtIndex(D);if(H!==null&&qc(H)){const U=H.getPreviousSibling();(U===null||qc(U))&&(I=!0,$=_.getElementByKey(H.__key))}}if(I){const H=_.getElementByKey(O.__key);return k===null&&(_._blockCursorElement=k=(function(U){const F=U.theme,N=document.createElement("div");N.contentEditable="false",N.setAttribute("data-lexical-cursor","true");let j=F.blockCursor;if(j!==void 0){if(typeof j=="string"){const K=S1(j);j=F.blockCursor=K}j!==void 0&&N.classList.add(...j)}return N})(_._config)),E.style.caretColor="transparent",void($===null?H.appendChild(k):H.insertBefore(k,$))}}k!==null&&Id(k,_,E)})(e,r,a)}finally{h!==null&&h.observe(r,Am),ft=f,dt=c}}g!==null&&(function(_,E,T,k,P){const O=Array.from(_._listeners.mutation),D=O.length;for(let I=0;I<D;I++){const[$,H]=O[I];for(const U of H){const F=E.get(U);F!==void 0&&$(F,{dirtyLeaves:k,prevEditorState:P,updateTags:T})}}})(e,g,y,p,i),W(a)||a===null||s!==null&&s.is(a)||e.dispatchCommand(lr,void 0);const w=e._pendingDecorators;w!==null&&(e._decorators=w,e._pendingDecorators=null,ys("decorator",e,!0,w)),(function(_,E,T){const k=Om(E),P=Om(T);k!==P&&ys("textcontent",_,!0,P)})(e,t||i,n),ys("update",e,!0,{dirtyElements:m,dirtyLeaves:p,editorState:n,mutatedNodes:g,normalizedNodes:x,prevEditorState:t||i,tags:y}),(function(_,E){if(_._deferred=[],E.length!==0){const T=_._updating;_._updating=!0;try{for(let k=0;k<E.length;k++)E[k]()}finally{_._updating=T}}})(e,v),(function(_){const E=_._updates;if(E.length!==0){const T=E.shift();if(T){const[k,P]=T;Gl(_,k,P)}}})(e)}function ys(e,t,n,...r){const o=t._updating;t._updating=n;try{const i=Array.from(t._listeners[e]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{t._updating=o}}function Fm(e,t){const n=e._updates;let r=t||!1;for(;n.length!==0;){const o=n.shift();if(o){const[i,s]=o,a=e._pendingEditorState;let l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(a===null&&q(191),a._flushSync=!0),l&&e._deferred.push(l),hb(e,s.tag)),a==null?Gl(e,i,s):i()}}return r}function Gl(e,t,n){const r=e._updateTags;let o,i=!1,s=!1;n!==void 0&&(o=n.onUpdate,hb(e,n.tag),i=n.skipTransforms||!1,s=n.discrete||!1),o&&e._deferred.push(o);const a=e._editorState;let l=e._pendingEditorState,c=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=gb(l||a),c=!0),l._flushSync=s;const u=dt,f=Dt,d=ft,h=e._updating;dt=l,Dt=!1,e._updating=!0,ft=e;const g=e._headless||e.getRootElement()===null;vh(null);try{c&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(y,v){const b=y.getEditorState()._selection,w=Ft(dn(y));return W(b)||b==null?Ul(b,w,y,v):b.clone()})(e,n&&n.event||null));const m=e._compositionKey;t(),i=Fm(e,i),(function(y,v){const b=v.getEditorState()._selection,w=y._selection;if(W(w)){const _=w.anchor,E=w.focus;let T;if(_.type==="text"&&(T=_.getNode(),T.selectionTransform(b,w)),E.type==="text"){const k=E.getNode();T!==k&&k.selectionTransform(b,w)}}})(l,e),e._dirtyType!==0&&(i?(function(y,v){const b=v._dirtyLeaves,w=y._nodeMap;for(const _ of b){const E=w.get(_);X(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&cm(E)}})(l,e):(function(y,v){const b=v._dirtyLeaves,w=v._dirtyElements,_=y._nodeMap,E=Er(),T=new Map;let k=b,P=k.size,O=w,D=O.size;for(;P>0||D>0;){if(P>0){v._dirtyLeaves=new Set;for(const I of k){const $=_.get(I);X($)&&$.isAttached()&&$.isSimpleText()&&!$.isUnmergeable()&&cm($),$!==void 0&&Nm($,E)&&Mm(v,$,T),b.add(I)}if(k=v._dirtyLeaves,P=k.size,P>0){Ka++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,O.delete("root")&&O.set("root",!0);for(const I of O){const $=I[0],H=I[1];if(w.set($,H),!H)continue;const U=_.get($);U!==void 0&&Nm(U,E)&&Mm(v,U,T)}k=v._dirtyLeaves,P=k.size,O=v._dirtyElements,D=O.size,Ka++}v._dirtyLeaves=b,v._dirtyElements=w})(l,e),Fm(e),(function(y,v,b,w){const _=y._nodeMap,E=v._nodeMap,T=[];for(const[k]of w){const P=E.get(k);P!==void 0&&(P.isAttached()||(B(P)&&T1(P,k,_,E,T,w),_.has(k)||w.delete(k),T.push(k)))}for(const k of T)E.delete(k);for(const k of b){const P=E.get(k);P===void 0||P.isAttached()||(_.has(k)||b.delete(k),E.delete(k))}})(a,l,e._dirtyLeaves,e._dirtyElements)),m!==e._compositionKey&&(l._flushSync=!0);const x=l._selection;if(W(x)){const y=l._nodeMap,v=x.anchor.key,b=x.focus.key;y.get(v)!==void 0&&y.get(b)!==void 0||q(19)}else bt(x)&&x._nodes.size===0&&(l._selection=null)}catch(m){return m instanceof Error&&e._onError(m),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void ir(e)}finally{dt=u,Dt=f,ft=d,e._updating=h,Ka=0}e._dirtyType!==0||e._deferred.length>0||(function(m,x){const y=x.getEditorState()._selection,v=m._selection;if(v!==null){if(v.dirty||!v.is(y))return!0}else if(y!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,ir(e)):c&&s3(()=>{ir(e)}):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function zn(e,t,n){ft===e&&n===void 0?t():Gl(e,t,n)}class vs{element;before;after;constructor(t,n,r){this.element=t,this.before=n||null,this.after=r||null}withBefore(t){return new vs(this.element,t,this.after)}withAfter(t){return new vs(this.element,this.before,t)}withElement(t){return this.element===t?this:new vs(t,this.before,this.after)}insertChild(t){const n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&q(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&q(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&q(224),this.element.replaceChild(t,n),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{const n=t==="decorator"&&(Ks||Fi||Ws);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const n=this.element,r=t.nodeName==="IMG"?t.nextSibling:null;r&&n.removeChild(r),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before,i=document.createElement("br");if(r.insertBefore(i,o),t){const s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,r,o){if(r===this.element){const l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,o))]}const i=Lm(n,r);i.push(o);const s=Lm(n,this.element);let a=t.getIndexWithinParent();for(let l=0;l<s.length;l++){const c=i[l],u=s[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[t.getParentOrThrow(),a]}}function Lm(e,t){const n=[];let r=t;for(;r!==e&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;n.push(o)}return r!==e&&q(225),n.reverse()}class St extends jn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return cA[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const t=$e()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if(X(n)&&t.push(n),B(n)){const r=n.getAllTextNodes();t.push(...r)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;B(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;B(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),r=n.length;if(t>=r){const i=n[r-1];return B(i)&&i.getLastDescendant()||i||null}const o=n[t];return B(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Pe(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return t===null&&q(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return t===null?null:Pe(t)}getLastChildOrThrow(){const t=this.getLastChild();return t===null&&q(96,this.__key),t}getChildAtIndex(t){const n=this.getChildrenSize();let r,o;if(t<n/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=t;){if(o===t)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=n-1;r!==null&&o>=t;){if(o===t)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let t="";const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContent(),B(i)&&o!==r-1&&!i.isInline()&&(t+=Or)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContentSize(),B(i)&&o!==r-1&&!i.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){const n=tm[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){const n=Ir[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return vl(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){ut();const r=Y();let o=t,i=n;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const l=this.getFirstChild();if(X(l)||B(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||n!==void 0&&n!==s)){const l=this.getLastChild();if(X(l)||B(l))return l.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const a=this.__key;return W(r)?(r.anchor.set(a,o,"element"),r.focus.set(a,i,"element"),r.dirty=!0,r):cb(a,o,a,i,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?tm[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){const n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,r){pl(this)&&q(324,this.__key,this.__type);const o=this.getChildrenSize(),i=this.getWritable();t+n<=o||q(226,String(t),String(n),String(o));const s=i.__key,a=[],l=[],c=this.getChildAtIndex(t+n);let u=null,f=o-n+r.length;if(t!==0)if(t===o)u=this.getLastChild();else{const h=this.getChildAtIndex(t);h!==null&&(u=h.getPreviousSibling())}if(n>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<n;g++){h===null&&q(100);const p=h.getNextSibling(),m=h.__key;mo(h.getWritable()),l.push(m),h=p}}let d=u;for(const h of r){d!==null&&h.is(d)&&(u=d=d.getPreviousSibling());const g=h.getWritable();g.__parent===s&&f--,mo(g);const p=h.__key;if(d===null)i.__first=p,g.__prev=null;else{const m=d.getWritable();m.__next=p,g.__prev=m.__key}h.__key===s&&q(76),g.__parent=s,a.push(p),d=h}if(t+n===o)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){const h=c.getWritable();if(d!==null){const g=d.getWritable();h.__prev=d.__key,g.__next=c.__key}else h.__prev=null}if(i.__size=f,l.length){const h=Y();if(W(h)){const g=new Set(l),p=new Set(a),{anchor:m,focus:x}=h;$m(m,g,p)&&yl(m,m.getNode(),this,u,c),$m(x,g,p)&&yl(x,x.getNode(),this,u,c),f!==0||this.canBeEmpty()||pt(this)||this.remove()}}return i}getDOMSlot(t){return new vs(t)}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){const r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px");const o=this.getDirection();o&&(n.dir=o)}return{element:n}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||pt(this)||this.getChildren().some(X)||(n!==0&&(t.textFormat=n),r!==""&&(t.textStyle=r)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){const r=this.getDOMSlot(t);let o=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const s=n.getElementByKey(i.getKey());s!==null&&(o==null?(r.insertChild(s),o=s):o!==s&&r.replaceChild(s,o),o=o.nextSibling)}}}function B(e){return e instanceof St}function $m(e,t,n){let r=e.getNode();for(;r;){const o=r.__key;if(t.has(o)&&!n.has(o))return!0;r=r.getParent()}return!1}class Us extends jn{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Se(e){return e instanceof Us}class Di extends St{__cachedText;static getType(){return"root"}static clone(){return new Di}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){q(51)}getTextContent(){const t=this.__cachedText;return!Ii()&&$e()._dirtyType!==0||t===null?super.getTextContent():t}remove(){q(52)}replace(t){q(53)}insertBefore(t){q(54)}insertAfter(t){q(55)}updateDOM(t,n){return!1}splice(t,n,r){for(const o of r)B(o)||Se(o)||q(282);return super.splice(t,n,r)}static importJSON(t){return qe().updateFromJSON(t)}collapseAtStart(){return!0}}function ot(e){return e instanceof Di}function gb(e){return new Gs(new Map(e._nodeMap))}function mh(){return new Gs(new Map([["root",new Di]]))}function pb(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&q(130,n.name),B(e)){const r=t.children;Array.isArray(r)||q(59,n.name);const o=e.getChildren();for(let i=0;i<o.length;i++){const s=pb(o[i]);r.push(s)}}return t}function t3(e){return e instanceof Gs}class Gs{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return Pm(n&&n.editor||null,this,t)}clone(t){const n=new Gs(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Pm(null,this,()=>({root:pb(qe())}))}}class yh extends St{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class Fo extends St{static getType(){return"paragraph"}static clone(t){return new Fo(t.__key)}createDOM(t){const n=document.createElement("p"),r=gi(t.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(t,n,r){return!1}static importDOM(){return{p:t=>({conversion:n3,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}static importJSON(t){return me().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){const n=this.getChildren().find(X);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){const r=me();r.setTextFormat(t.format),r.setTextStyle(t.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){const t=this.getChildren();if(t.length===0||X(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function n3(e){const t=me();return e.style&&(t.setFormat(e.style.textAlign),Rh(e,t)),{node:t}}function me(){return _t(new Fo)}function Gr(e){return e instanceof Fo}const xe=0,sr=1,$t=3,r3=4;function mb(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=mh(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",o.set("root",n))}function o3(e){const t=new Set,n=new Set;let r=e;for(;r;){const{ownNodeConfig:o}=Zl(r),i=r.transform;if(!n.has(i)){n.add(i);const s=r.transform();s&&t.add(s)}if(o){const s=o.$transform;s&&t.add(s),r=o.extends}else{const s=Object.getPrototypeOf(r);r=s.prototype instanceof jn&&s!==jn?s:void 0}}return t}function yb(e){const t=e||{},n=QA(),r=t.theme||{},o=e===void 0?n:t.parentEditor||null,i=t.disableEvents||!1,s=mh(),a=t.namespace||(o!==null?o._config.namespace:kb()),l=t.editorState,c=[Di,un,Li,$i,Fo,yh,...t.nodes||[]],{onError:u,html:f}=t,d=t.editable===void 0||t.editable;let h;if(e===void 0&&n!==null)h=n._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],x=null,y=null;if(typeof m!="function"){const w=m;m=w.replace,x=w.with,y=w.withKlass||null}Zl(m);const v=m.getType(),b=o3(m);h.set(v,{exportDOM:f&&f.export?f.export.get(m):void 0,klass:m,replace:x,replaceWithKlass:y,sharedNodeState:vA(c[p]),transforms:b})}}const g=new _i(s,o,h,{disableEvents:i,namespace:a,theme:r},u||console.error,(function(p,m){const x=new Map,y=new Set,v=b=>{Object.keys(b).forEach(w=>{let _=x.get(w);_===void 0&&(_=[],x.set(w,_)),_.push(b[w])})};return p.forEach(b=>{const w=b.klass.importDOM;if(w==null||y.has(w))return;y.add(w);const _=w.call(b.klass);_!==null&&v(_)}),m&&v(m),x})(h,f?f.import:void 0),d,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(p){p.registerCommand(I1,NA,xe),p.registerCommand(D1,PA,xe),p.registerCommand(V1,FA,xe),p.registerCommand(j1,LA,xe),p.registerCommand(H1,$A,xe)})(g),g}class _i{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,n,r,o,i,s,a,l){this._createEditorArgs=l,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=kb(),this._onError=i,this._htmlConversions=s,this._editable=a,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,r){r===void 0&&q(35);const o=this._commands;o.has(t)||o.set(t,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(t);i===void 0&&q(36,String(t));const s=i[r];return s.add(n),()=>{s.delete(n),i.every(a=>a.size===0)&&o.delete(t)}}registerMutationListener(t,n,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;let s=i.get(n);s===void 0&&(s=new Set,i.set(n,s)),s.add(o);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(n,o),()=>{s.delete(o),s.size===0&&i.delete(n)}}getRegisteredNode(t){const n=this._nodes.get(t.getType());return n===void 0&&q(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){const r=this._editorState,o=Hm(r).get(n.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){const r=this.getRegisteredNode(t);return r.transforms.add(n),r}registerNodeTransform(t,n){const r=this.registerNodeTransformToKlass(t,n),o=[r],i=r.replaceWithKlass;if(i!=null){const s=this.registerNodeTransformToKlass(i,n);o.push(s)}return(function(s,a){const l=Hm(s.getEditorState()),c=[];for(const u of a){const f=l.get(u);f&&c.push(f)}c.length!==0&&s.update(()=>{for(const u of c)for(const f of u.keys()){const d=Pe(f);d&&d.markDirty()}},s._pendingEditorState===null?{tag:hi}:void 0)})(this,o.map(s=>s.klass.getType())),()=>{o.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return Q(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const r=gi(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=t,mb(this,n,t,o),n!==null&&(this._config.disableEvents||OA(n),r!=null&&n.classList.remove(...r)),t!==null){const i=Eh(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,k1(this),this._updateTags.add(hi),ir(this),this._config.disableEvents||(function(a,l){const c=a.ownerDocument;Ed.set(a,c);const u=hl.get(c)??0;u<1&&c.addEventListener("selectionchange",nb),hl.set(c,u+1),a.__lexicalEditor=l;const f=tb(a);for(let d=0;d<Td.length;d++){const[h,g]=Td[d],p=typeof g=="function"?m=>{mm(m)||(pm(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(mm(m))return;pm(m);const x=l.isEditable();switch(h){case"cut":return x&&Q(l,zl,m);case"copy":return Q(l,Bl,m);case"paste":return x&&Q(l,oh,m);case"dragstart":return x&&Q(l,U1,m);case"dragover":return x&&Q(l,G1,m);case"dragend":return x&&Q(l,kA,m);case"focus":return x&&Q(l,q1,m);case"blur":return x&&Q(l,AA,m);case"drop":return x&&Q(l,K1,m)}};a.addEventListener(h,p),f.push(()=>{a.removeEventListener(h,p)})}})(t,this),r!=null&&t.classList.add(...r)}else this._window=null,this._updateTags.add(hi),ir(this);ys("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&q(38);let r=t;r._readOnly&&(r=gb(t),r._selection=t._selection?t._selection.clone():null),R1(this);const o=this._pendingEditorState,i=this._updateTags,s=n!==void 0?n.tag:null;o===null||o.isEmpty()||(s!=null&&i.add(s),ir(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&i.add(s),this._updating||ir(this)}parseEditorState(t,n){return(function(r,o,i){const s=mh(),a=dt,l=Dt,c=ft,u=o._dirtyElements,f=o._dirtyLeaves,d=o._cloneNotNeeded,h=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,dt=s,Dt=!1,ft=o,vh(null);try{const g=o._nodes;ph(r.root,g),i&&i(),s._readOnly=!0}catch(g){g instanceof Error&&o._onError(g)}finally{o._dirtyElements=u,o._dirtyLeaves=f,o._cloneNotNeeded=d,o._dirtyType=h,dt=a,Dt=l,ft=c}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return ir(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(r,o,i){r._updating?r._updates.push([o,i]):Gl(r,o,i)})(this,t,n)}focus(t,n={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),zn(this,()=>{const o=Y(),i=qe();o!==null?o.dirty||Ge(o.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),c3("focus"),u3(()=>{r.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=Ft(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,ys("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}_i.version="0.39.0+prod.esm";let Ld=null;function vh(e){Ld=e}let i3=1;function vb(e,t){const n=xh(e,t);return n===void 0&&q(30,t),n}function xh(e,t){return e._nodes.get(t)}const s3=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function xb(e){return Se(Ht(e))}function bh(e){const t=document.activeElement;if(!Be(t))return!1;const n=t.nodeName;return Se(Ht(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&ql(t)==null)}function qs(e,t,n){const r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!bh(t)&&bb(t)===e}catch{return!1}}function wh(e){return e instanceof _i}function bb(e){let t=e;for(;t!=null;){const n=ql(t);if(wh(n))return n;t=Ys(t)}return null}function ql(e){return e?e.__lexicalEditor:null}function po(e){return Hl(e)||e.isToken()}function nr(e){return po(e)||e.isSegmented()}function vr(e){return xn(e)&&e.nodeType===3}function wb(e){return xn(e)&&e.nodeType===9}function Ti(e){let t=e;for(;t!=null;){if(vr(t))return t;t=t.firstChild}return null}function vl(e,t,n){const r=Ir[t];if(n!==null&&(e&r)===(n&r))return e;let o=e^r;return t==="subscript"?o&=-65:t==="superscript"?o&=-33:t==="lowercase"?(o&=-513,o&=-1025):t==="uppercase"?(o&=-257,o&=-1025):t==="capitalize"&&(o&=-257,o&=-513),o}function Cb(e){return X(e)||Bn(e)||Se(e)}function Sb(e,t){const n=(function(){const s=Ld;return Ld=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);ut(),db();const r=$e(),o=Ur(),i=""+i3++;o._nodeMap.set(i,e),B(e)?r._dirtyElements.set(i,!0):r._dirtyLeaves.add(i),r._cloneNotNeeded.add(i),r._dirtyType=1,e.__key=i}function mo(e){const t=e.getParent();if(t!==null){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling(),s=i!==null?i.__key:null,a=o!==null?o.__key:null,l=o!==null?o.getWritable():null,c=i!==null?i.getWritable():null;o===null&&(r.__first=s),i===null&&(r.__last=a),l!==null&&(l.__next=s),c!==null&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function xl(e){db(),pl(e)&&q(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent,r=Ur(),o=$e(),i=r._nodeMap,s=o._dirtyElements;n!==null&&(function(l,c,u){let f=l;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}})(n,i,s);const a=t.__key;o._dirtyType=1,B(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function gt(e){ut();const t=$e(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){const r=Pe(n);r!==null&&r.getWritable()}if(e!==null){const r=Pe(e);r!==null&&r.getWritable()}}}function Er(){return Ii()?null:$e()._compositionKey}function Pe(e,t){const n=(t||Ur())._nodeMap.get(e);return n===void 0?null:n}function _b(e,t){const n=Yl(e,$e());return n!==void 0?Pe(n,t):null}function Yl(e,t){return e[`__lexicalKey_${t._key}`]}function Ht(e,t){let n=e;for(;n!=null;){const r=_b(n,t);if(r!==null)return r;n=Ys(n)}return null}function Tb(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Om(e){return e.read(()=>qe().getTextContent())}function qe(){return Eb(Ur())}function Eb(e){return e._nodeMap.get("root")}function Ge(e){ut();const t=Ur();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function li(e){const t=$e(),n=(function(r,o){let i=r;for(;i!=null;){const s=Yl(i,o);if(s!==void 0)return s;i=Ys(i)}return null})(e,t);return n===null?e===t.getRootElement()?Pe("root"):null:Pe(n)}function Rb(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Ch(e){const t=[];let n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function kb(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Ab(e){return vr(e)?e.nodeValue:null}function Sh(e,t,n){const r=Ft(dn(t));if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let a=Ab(o);const l=Ht(o);if(a!==null&&X(l)){if(a===Il&&n){const c=n.length;a=n,i=c,s=c}a!==null&&_h(l,a,i,s,e)}}}function _h(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===Il&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(a===""){if(gt(null),Ws||Fi||Ks)i.remove();else{const p=$e();setTimeout(()=>{p.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=Gn(),f=i.getTextContentSize(),d=Er(),h=i.getKey();if(i.isToken()||d!==null&&h===d&&!s||W(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===e.__key&&u.focus.offset===f&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const g=Y();if(!W(g)||n===null||r===null)return void Im(i,a,g);if(g.setTextNodeRange(i,n,i,r),i.isSegmented()){const p=Le(i.getTextContent());i.replace(p),i=p}Im(i,a,g)}}}function Im(e,t,n){if(e.setTextContent(t),W(n)){const r=e.getKey();for(const o of["anchor","focus"]){const i=n[o];i.type==="text"&&i.key===r&&(i.offset=Wn(e,i.offset,"clamp"))}}}function xa(e,t,n){const r=t[n]||!1;return r==="any"||r===e[n]}function a3(e,t){return xa(e,t,"altKey")&&xa(e,t,"ctrlKey")&&xa(e,t,"shiftKey")&&xa(e,t,"metaKey")}function Ne(e,t,n){return a3(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const Qn={ctrlKey:!vn,metaKey:vn},Dm={altKey:vn,ctrlKey:!vn};function Vm(e){return e.key==="Backspace"}function jm(e){return Ne(e,"a",Qn)}function l3(e){const t=qe();if(W(e)){const n=e.anchor,r=e.focus,o=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),As(e),e}{const n=t.select(0,t.getChildrenSize());return Ge(As(n)),n}}function gi(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;const o=e[t];if(typeof o=="string"){const i=S1(o);return n[t]=i,i}return o}function Th(e,t,n,r,o){if(n.size===0)return;const i=r.__type,s=r.__key,a=t.get(i);a===void 0&&q(33,i);const l=a.klass;let c=e.get(l);c===void 0&&(c=new Map,e.set(l,c));const u=c.get(s),f=u==="destroyed"&&o==="created";(u===void 0||f)&&c.set(s,f?"updated":o)}function Bm(e,t,n){const r=e.getParent();let o=n,i=e;return r!==null&&(t&&n===0?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function $d(e,t){const n=e.offset;if(e.type==="element")return Bm(e.getNode(),t,n);{const r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){const o=t?r.getPreviousSibling():r.getNextSibling();return o===null?Bm(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):o}}return null}function Mb(e){const t=dn(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function Q(e,t,n){return(function(r,o,i){const s=Ch(r);for(let a=4;a>=0;a--)for(let l=0;l<s.length;l++){const c=s[l],u=c._commands.get(o);if(u!==void 0){const f=u[a];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(zn(c,()=>{for(let p=0;p<h;p++)if(d[p](i,r))return void(g=!0)}),g)return g}}}return!1})(e,t,n)}function Xl(e){return!ot(e)&&!e.isLastChild()&&!e.isInline()}function Co(e,t){const n=e._keyToDOMMap.get(t);return n===void 0&&q(75,t),n}function Ys(e){const t=e.assignedSlot||e.parentElement;return Dd(t)?t.host:t}function Nb(e){return wb(e)?e:Be(e)?e.ownerDocument:null}function c3(e){ut(),$e()._updateTags.add(e)}function u3(e){ut(),$e()._deferred.push(e)}function Od(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Eh(e){const t=Nb(e);return t?t.defaultView:null}function dn(e){const t=e._window;return t===null&&q(78),t}function d3(e){return B(e)&&e.isInline()||Se(e)&&e.isInline()}function f3(e){let t=e.getParentOrThrow();for(;t!==null;){if(pt(t))return t;t=t.getParentOrThrow()}return t}function pt(e){return ot(e)||B(e)&&e.isShadowRoot()}function h3(e){const t=e.constructor.clone(e);return Sb(t,null),t.afterCloneFrom(e),t}function _t(e){const t=$e(),n=e.getType(),r=xh(t,n);r===void 0&&q(200,e.constructor.name,n);const{replace:o,replaceWithKlass:i}=r;if(o!==null){const s=o(e),a=s.constructor;return i!==null?s instanceof i||q(201,i.name,i.getType(),a.name,a.getType(),e.constructor.name,n):s instanceof e.constructor&&a!==e.constructor||q(202,a.name,a.getType(),e.constructor.name,n),s.__key===e.__key&&q(203,e.constructor.name,n,a.name,a.getType()),s}return e}function Gc(e,t){!ot(e.getParent())||B(t)||Se(t)||q(99)}function g3(e){const t=Pe(e);return t===null&&q(63,e),t}function qc(e){return(Se(e)||B(e)&&!e.canBeEmpty())&&!e.isInline()}function Id(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;r!==null&&r.removeChild(e)}function Ft(e){return Mn?(e||window).getSelection():null}function p3(e){const t=Eh(e);return t?t.getSelection():null}function Pb(e){return Be(e)&&e.tagName==="A"}function Be(e){return xn(e)&&e.nodeType===1}function xn(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function Dd(e){return xn(e)&&e.nodeType===11}function Vd(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return e.nodeName.match(t)!==null}function bl(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return e.nodeName.match(t)!==null}function Tr(e){if(Se(e)&&!e.isInline())return!0;if(!B(e)||pt(e))return!1;const t=e.getFirstChild(),n=t===null||Bn(t)||X(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function Vi(){return $e()}const zm=new WeakMap,m3=new Map;function Hm(e){if(!e._readOnly&&e.isEmpty())return m3;e._readOnly||q(192);let t=zm.get(e);return t||(t=(function(n){const r=new Map;for(const[o,i]of n._nodeMap){const s=i.__type;let a=r.get(s);a||(a=new Map,r.set(s,a)),a.set(o,i)}return r})(e),zm.set(e,t)),t}function Fb(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function y3(e){return(t=Fb(e))[rb]=!0,t;var t}function Rh(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function v3(e){e.__lexicalUnmanaged=!0}function x3(e){return e.__lexicalUnmanaged===!0}function Zi(e,t){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(e,t)&&e[t]!==jn[t]}function Zl(e){const t=nm in e.prototype?e.prototype[nm]():void 0,n=(function(s){if(!(s===jn||s.prototype instanceof jn)){let a="<unknown>",l="<unknown>";try{a=s.getType()}catch{}try{_i.version&&(l=JSON.parse(_i.version))}catch{}q(290,s.name,a,l)}return s===Us||s===St||s===jn})(e),r=!n&&Zi(e,"getType")?e.getType():void 0;let o,i=r;if(t)if(r)o=t[r];else for(const[s,a]of Object.entries(t))i=s,o=a;if(!n&&i&&(Zi(e,"getType")||(e.getType=()=>i),Zi(e,"clone")||(e.clone=s=>(vh(s),new e)),Zi(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(s=>new e().updateFromJSON(s))),!Zi(e,"importDOM")&&o)){const{importDOM:s}=o;s&&(e.importDOM=()=>s)}return{ownNodeConfig:o,ownNodeType:i}}function Lb(e){const t=Vi();return ut(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}const be=(e,t)=>{let n=e;for(;n!=null&&!ot(n);){if(t(n))return n;n=n.getParent()}return null},b3={next:"previous",previous:"next"};class kh{origin;constructor(t){this.origin=t}[Symbol.iterator](){return Nh({hasNext:Dr,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return tt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return tt(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){const r=this.getNodeAtCaret();return t.is(this.origin)||t.is(r)||(r===null?this.insert(t):r.replace(t,n)),this}splice(t,n,r="next"){const o=r===this.direction?n:Array.from(n).reverse();let i=this;const s=this.getParentAtCaret(),a=new Map;for(let l=i.getAdjacentCaret();l!==null&&a.size<t;l=l.getAdjacentCaret()){const c=l.origin.getWritable();a.set(c.getKey(),c)}for(const l of o){if(a.size>0){const c=i.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||i.origin.is(l))){const u=l.getParent();u&&u.is(s)&&l.remove(),c.replace(l)}}else c===null&&q(263,Array.from(a).join(" "))}else i.insert(l);i=tt(l,this.direction)}for(const l of a.values())l.remove();return this}}class Fs extends kh{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Nt(t,this.direction)}getParentCaret(t="root"){return tt(Ah(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Lo(this.direction);return tt(this.getNodeAtCaret(),t)||Nt(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof Fs&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const w3={root:ot,shadowRoot:pt};function Lo(e){return b3[e]}function Ah(e,t="root"){return w3[t](e)?null:e}class So extends kh{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:tt(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return B(this.origin)?Nt(this.origin,this.direction):null}getParentCaret(t="root"){return tt(Ah(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Lo(this.direction);return tt(this.getNodeAtCaret(),t)||Nt(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof So&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof So||t instanceof _o)&&this.direction===t.direction&&this.origin.is(t.origin)}}class _o extends kh{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:To(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return tt(Ah(this.getParentAtCaret(),t),this.direction)}getFlipped(){return To(this.origin,Lo(this.direction),this.offset)}isSamePointCaret(t){return t instanceof _o&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof So||t instanceof _o)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return tt(this.origin,this.direction)}}function Hn(e){return e instanceof _o}function Dr(e){return e instanceof So}function Vt(e){return e instanceof Fs}const C3={next:class extends _o{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends _o{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},S3={next:class extends So{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends So{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},_3={next:class extends Fs{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Fs{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function tt(e,t){return e?new S3[t](e):null}function To(e,t,n){return e?new C3[t](e,Wn(e,n)):null}function Wn(e,t,n="error"){const r=e.getTextContentSize();let o=t==="next"?r:t==="previous"?0:t;return(o<0||o>r)&&(n!=="clamp"&&w1(284,String(t),String(r),e.getKey()),o=o<0?0:r),o}function Wm(e,t){return new E3(e,t)}function Nt(e,t){return B(e)?new _3[t](e):null}function T3(e){return e&&e.getChildCaret()||e}function Xs(e){return e&&T3(e.getAdjacentCaret())}class Mh{type="node-caret-range";direction;anchor;focus;constructor(t,n,r){this.anchor=t,this.focus=n,this.direction=r}getLatest(){const t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new Mh(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=o=>{const i=this[o].getLatest();return Hn(i)?(function(s,a){const{direction:l,origin:c}=s,u=Wn(c,a==="focus"?Lo(l):l);return Wm(s,u-s.offset)})(i,o):null},n=t("anchor"),r=t("focus");if(n&&r){const{caret:o}=n,{caret:i}=r;if(o.isSameNodeCaret(i))return[Wm(o,i.offset-o.offset),null]}return[n,r]}iterNodeCarets(t="root"){const n=Hn(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),o=Hn(r),i=s=>s.isSameNodeCaret(r)?null:Xs(s)||s.getParentCaret(t);return Nh({hasNext:s=>s!==null&&!(o&&r.isSameNodeCaret(s)),initial:n.isSameNodeCaret(r)?null:i(n),map:s=>s,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class E3{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){const{distance:t,caret:{offset:n}}=this,r=n+t;return r<n?[r,n]:[n,r]}getTextContent(){const[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:n}}=this,[r,o]=this.getSliceIndices(),i=t.getTextContent();return To(t.setTextContent(i.slice(0,r)+i.slice(o)),n,r)}}function Ls(e){return Vr(e,tt(qe(),e.direction))}function $b(e){return Vr(e,e)}function Vr(e,t){return e.direction!==t.direction&&q(265),new Mh(e,t,e.direction)}function Nh(e){const{initial:t,hasNext:n,step:r,map:o}=e;let i=t;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};const s={done:!1,value:o(i)};return i=r(i),s}}}function Ob(e,t){const n=Ua(e.origin,t.origin);switch(n===null&&q(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const r=e.type==="text",o=t.type==="text";return r&&o?(function(i,s){return Math.sign(i-s)})(e.offset,t.offset):e.type===t.type?0:r?-1:o?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return Ib(n)}}function Ib(e){const{a:t,b:n}=e,r=t.__key,o=n.__key;let i=t,s=n;for(;i&&s;i=i.getNextSibling(),s=s.getNextSibling()){if(i.__key===o)return-1;if(s.__key===r)return 1}return i===null?1:-1}function ba(e,t){return t.is(e)}function Km(e){return B(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Ua(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,o]=Km(e);r;o=r,r=r.getParent())n.set(r,o);for(let[r,o]=Km(t);r;o=r,r=r.getParent()){const i=n.get(r);if(i!==void 0)return i===null?(ba(e,r)||q(276),{commonAncestor:r,type:"ancestor"}):o===null?(ba(t,r)||q(277),{commonAncestor:r,type:"descendant"}):((B(i)||ba(e,i))&&(B(o)||ba(t,o))&&r.is(i.getParent())&&r.is(o.getParent())||q(278),{a:i,b:o,commonAncestor:r,type:"branch"})}return null}function En(e,t){const{type:n,key:r,offset:o}=e,i=g3(e.key);return n==="text"?(X(i)||q(266,i.getType(),r),To(i,t,o)):(B(i)||q(267,i.getType(),r),k3(i,e.offset,t))}function bn(e,t){const{origin:n,direction:r}=t,o=r==="next";Hn(t)?e.set(n.getKey(),t.offset,"text"):Dr(t)?X(n)?e.set(n.getKey(),Wn(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(Vt(t)&&B(n)||q(268),e.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function Db(e){const t=Y(),n=W(t)?t:Kl();return Ga(n,e),Ge(n),n}function Ga(e,t){bn(e.anchor,t.anchor),bn(e.focus,t.focus)}function Um(e){const{anchor:t,focus:n}=e,r=En(t,"next"),o=En(n,"next"),i=Ob(r,o)<=0?"next":"previous";return Vr(mr(r,i),mr(o,i))}function Zs(e){const{direction:t,origin:n}=e,r=tt(n,Lo(t)).getNodeAtCaret();return r?tt(r,t):Nt(n.getParentOrThrow(),t)}function Gm(e,t="root"){const n=[e];for(let r=Vt(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(Zs(r));return n}function Yc(e){return!!e&&e.origin.isAttached()}function R3(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let o=t;const i=Vb(e,r),s=Gm(i.anchor,n),a=Gm(i.focus.getFlipped(),n),l=new Set,c=[];for(const g of i.iterNodeCarets(n))if(Vt(g))l.add(g.origin.getKey());else if(Dr(g)){const{origin:p}=g;B(p)&&!l.has(p.getKey())||c.push(p)}for(const g of c)g.remove();for(const g of i.getTextSlices()){if(!g)continue;const{origin:p}=g.caret,m=p.getTextContentSize(),x=Zs(tt(p,r)),y=p.getMode();if(Math.abs(g.distance)===m&&o==="removeEmptySlices"||y==="token"&&g.distance!==0)x.remove();else if(g.distance!==0){o="removeEmptySlices";let v=g.removeTextSlice();const b=g.caret.origin;if(y==="segmented"){const w=v.origin,_=Le(w.getTextContent()).setStyle(w.getStyle()).setFormat(w.getFormat());x.replaceOrInsert(_),v=To(_,r,v.offset)}b.is(s[0].origin)&&(s[0]=v),b.is(a[0].origin)&&(a[0]=v.getFlipped())}}let u,f;for(const g of s)if(Yc(g)){u=Mt(g);break}for(const g of a)if(Yc(g)){f=Mt(g);break}const d=(function(g,p,m){if(!g||!p)return null;const x=g.getParentAtCaret(),y=p.getParentAtCaret();if(!x||!y)return null;const v=x.getParents().reverse();v.push(x);const b=y.getParents().reverse();b.push(y);const w=Math.min(v.length,b.length);let _;for(_=0;_<w&&v[_]===b[_];_++);const E=(P,O)=>{let D;for(let I=_;I<P.length;I++){const $=P[I];if(pt($))return;!D&&O($)&&(D=$)}return D},T=E(v,Tr),k=T&&E(b,P=>m.has(P.getKey())&&Tr(P));return T&&k?[T,k]:null})(u,f,l);if(d){const[g,p]=d;Nt(g,"previous").splice(0,p.getChildren()),p.remove()}const h=[u,f,...s,...a].find(Yc);if(h)return $b(mr(Mt(h),e.direction));q(269,JSON.stringify(s.map(g=>g.origin.__key)))}function Mt(e){const t=(function(o){let i=o;for(;Vt(i);){const s=Xs(i);if(!Vt(s))break;i=s}return i})(e.getLatest()),{direction:n}=t;if(X(t.origin))return Hn(t)?t:To(t.origin,n,n);const r=t.getAdjacentCaret();return Dr(r)&&X(r.origin)?To(r.origin,n,Lo(n)):t}function Ph(e){return Hn(e)&&e.offset!==Wn(e.origin,e.direction)}function mr(e,t){return e.direction===t?e:e.getFlipped()}function Vb(e,t){return e.direction===t?e:Vr(mr(e.focus,t),mr(e.anchor,t))}function k3(e,t,n){let r=Nt(e,"next");for(let o=0;o<t;o++){const i=r.getAdjacentCaret();if(i===null)break;r=i}return mr(r,n)}function A3(e){const{origin:t,offset:n,direction:r}=e;if(n===Wn(t,r))return e.getSiblingCaret();if(n===Wn(t,Lo(r)))return Zs(e.getSiblingCaret());const[o]=t.splitText(n);return X(o)||q(281),mr(tt(o,"next"),r)}function M3(e,t){return!0}function N3(e,{$copyElementNode:t=h3,$splitTextPointCaretNext:n=A3,rootMode:r="shadowRoot",$shouldSplit:o=M3}={}){if(Hn(e))return n(e);const i=e.getParentCaret(r);if(i){const{origin:s}=i;if(Vt(e)&&(!s.canBeEmpty()||!o(s,"first")))return Zs(i);const a=(function(l){const c=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(e);(a.length>0||s.canBeEmpty()&&o(s,"last"))&&i.insert(t(s).splice(0,0,a))}return i}function P3(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}const jd=new Map;function jb(e){const t={};if(!e)return t;const n=e.split(";");for(const r of n)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(t[o.trim()]=i.trim())}return t}function qm(e){let t=jd.get(e);return t===void 0&&(t=jb(e),jd.set(e,t)),t}function Bb(e){const t=Vi().getElementByKey(e.getKey());if(t===null)return null;const n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function zb(e){return Bb(ot(e)?e:e.getParentOrThrow())}function Ym(e){const t=zb(e);return t!==null&&t.direction==="rtl"}function Hb(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!nr(t)&&r!==null){const[o,i]=r,s=e.isBackward(),a=o.getNode(),l=i.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[f,d]=Pd(e),h=a.is(l),g=t.is(s?l:a),p=t.is(s?a:l);let m,x=0;h?(x=f>d?d:f,m=f>d?f:d):g?(x=s?d:f,m=void 0):p&&(x=0,m=s?f:d);const y=t.__text.slice(x,m);y!==t.__text&&(n==="clone"&&(t=y3(t)),t.__text=y)}}return t}function F3(e){const t=e.getStyle(),n=jb(t);jd.set(t,n)}function Wb(e){const t=Kb(e);return t!==null&&t.writingMode==="vertical-rl"}function Kb(e){const t=e.anchor.getNode();return B(t)?Bb(t):zb(t)}function Xm(e,t){let n=Wb(e)?!t:t;Ub(e)&&(n=!n);const r=En(e.focus,n?"previous":"next");if(Ph(r))return!1;for(const o of Ls(r)){if(Vt(o))return!o.origin.isInline();if(!B(o.origin)){if(Se(o.origin))return!0;break}}return!1}function L3(e,t,n,r){e.modify(t?"extend":"move",n,r)}function Ub(e){const t=Kb(e);return t!==null&&t.direction==="rtl"}function Zm(e,t,n){const r=Ub(e);let o;o=Wb(e)||r?!n:n,L3(e,t,o,"character")}function Gb(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const qb=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,$3=qb&&"documentMode"in document?document.documentMode:null;!(!qb||!("InputEvent"in window)||$3)&&"getTargetRanges"in new window.InputEvent("input");function Yb(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}function Rn(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Qe(e,...t){const n=Yb(...t);n.length>0&&e.classList.add(...n)}function Kn(e,...t){const n=Yb(...t);n.length>0&&e.classList.remove(...n)}function O3(e){return e?e.getAdjacentCaret():null}function I3(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function D3(e){const t=be(e,n=>B(n)&&!n.isInline());return B(t)||Gb(4,e.__key),t}function V3(e){const t=Y()||Gn();let n;if(W(t))n=En(t.focus,"next");else{if(t!=null){const s=t.getNodes(),a=s[s.length-1];a&&(n=tt(a,"next"))}n=n||Nt(qe(),"previous").getFlipped().insert(me())}const r=j3(e,n),o=Xs(r),i=Vt(o)?Mt(o):r;return Db($b(i)),e.getLatest()}function j3(e,t,n){let r=mr(t,"next");for(let o=r;o;o=N3(o,n))r=o;return Hn(r)&&Gb(283),r.insert(e.isInline()?me().append(e):e),mr(tt(e.getLatest(),"next"),t.direction)}function Rr(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function B3(e,t){Nt(e,"next").insert(t)}function Xb(e,t){return Zb(e,t,null)}function Zb(e,t,n){let r=!1;for(const o of Qb(e))t(o)?n!==null&&n(o):(r=!0,B(o)&&Zb(o,t,n||(i=>o.insertAfter(i))),o.remove());return r}function Jb(e,t){const n=[],r=Array.from(e).reverse();for(let o=r.pop();o!==void 0;o=r.pop())if(t(o))n.push(o);else if(B(o))for(const i of Qb(o))r.push(i);return n}function Qb(e){return z3(Nt(e,"previous"))}function z3(e){return Nh({hasNext:Dr,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function ew(){const[e]=it(),[t,n]=S.useState(!1),[r,o]=S.useState(!1),[i,s]=S.useState(!1),[a,l]=S.useState(!1),[c,u]=S.useState("left"),f=c==="left",d=c==="center",h=c==="right",g=S.useCallback(()=>{const x=Y();W(x)&&(n(x.hasFormat("bold")),o(x.hasFormat("italic")),s(x.hasFormat("underline")),l(x.hasFormat("strikethrough")))},[]),p=S.useCallback(x=>{u(x)},[]),m=S.useCallback(()=>{const x=Y();if(!W(x))return;const y=x.anchor.getNode(),v=y.getKey()==="root"?y:y.getTopLevelElementOrThrow();if(B(v)){const b=v.getFormatType();p(b)}},[p]);return S.useEffect(()=>{const x=Rn(e.registerCommand(It,(y,v)=>(e.read(()=>{g()}),!1),sr),e.registerCommand(di,(y,v)=>(e.read(()=>{p(y)}),!1),sr),e.registerCommand(lr,(y,v)=>(e.read(()=>{g(),m()}),!1),sr));return()=>{x()}},[e,g,p,m]),{isBold:t,isItalic:r,isUnderline:i,isStrikethrough:a,alignment:c,isAlignLeft:f,isAlignCenter:d,isAlignRight:h}}var ie=(e=>(e.BOLD="font-bold",e.ITALIC="font-italic",e.UNDERLINE="font-underline",e.STRIKETHROUGH="font-strikethrough",e.ALIGN_LEFT="align-left",e.ALIGN_CENTER="align-center",e.ALIGN_RIGHT="align-right",e.LINK="insert-link",e.IMAGE="insert-image",e.TABLE="insert-table",e.BULLET_LIST="insert-bullet-list",e.NUMBERED_LIST="insert-numbered-list",e))(ie||{});function H3(){const{isBold:e,isItalic:t,isUnderline:n,isStrikethrough:r,isAlignLeft:o,isAlignCenter:i,isAlignRight:s}=ew(),l=Hs().toolbar.actions,{availableActions:c}=jk(),u=S.useMemo(()=>({id:ie.BOLD,IconComponent:Nk,label:l.bold,isActive:e}),[l.bold,e]),f=S.useMemo(()=>({id:ie.ITALIC,IconComponent:Fk,label:l.italic,isActive:t}),[l.italic,t]),d=S.useMemo(()=>({id:ie.UNDERLINE,IconComponent:Vk,label:l.underline,isActive:n}),[l.underline,n]),h=S.useMemo(()=>({id:ie.STRIKETHROUGH,IconComponent:Ik,label:l.strikethrough,isActive:r}),[l.strikethrough,r]),g=S.useMemo(()=>({id:ie.ALIGN_LEFT,IconComponent:Ak,label:l.alignLeft,isActive:o}),[l.alignLeft,o]),p=S.useMemo(()=>({id:ie.ALIGN_CENTER,IconComponent:kk,label:l.alignCenter,isActive:i}),[l.alignCenter,i]),m=S.useMemo(()=>({id:ie.ALIGN_RIGHT,IconComponent:Mk,label:l.alignRight,isActive:s}),[l.alignRight,s]),x=S.useMemo(()=>({id:ie.BULLET_LIST,IconComponent:$k,label:l.bulletList}),[l.bulletList]),y=S.useMemo(()=>({id:ie.NUMBERED_LIST,IconComponent:Ok,label:l.numberedList}),[l.numberedList]),v=S.useMemo(()=>({id:ie.LINK,IconComponent:Lk,label:l.link}),[l.link]),b=S.useMemo(()=>({id:ie.IMAGE,IconComponent:Pk,label:l.image}),[l.image]),w=S.useMemo(()=>({id:ie.TABLE,IconComponent:Dk,label:l.table}),[l.table]),_=S.useMemo(()=>({[ie.BOLD]:u,[ie.ITALIC]:f,[ie.UNDERLINE]:d,[ie.STRIKETHROUGH]:h,[ie.ALIGN_LEFT]:g,[ie.ALIGN_CENTER]:p,[ie.ALIGN_RIGHT]:m,[ie.BULLET_LIST]:x,[ie.NUMBERED_LIST]:y,[ie.LINK]:v,[ie.IMAGE]:b,[ie.TABLE]:w}),[u,f,d,h,g,p,m,x,y,v,b,w]),E=S.useMemo(()=>c.map(k=>k.map(P=>_[P])),[c,_]);return{availableActions:S.useMemo(()=>E.flat(),[E]),availableActionGroups:E}}const W3=Symbol.for("preact-signals");function Fh(){if(pi>1)return void pi--;let e,t=!1;for(;xs!==void 0;){let n=xs;for(xs=void 0,Bd++;n!==void 0;){const r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&nw(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(Bd=0,pi--,t)throw e}let Me,xs;function Jm(e){const t=Me;Me=void 0;try{return e()}finally{Me=t}}let pi=0,Bd=0,qa=0;function Qm(e){if(Me===void 0)return;let t=e.n;return t===void 0||t.t!==Me?(t={i:0,S:e,p:Me.s,n:void 0,t:Me,e:void 0,x:void 0,r:t},Me.s!==void 0&&(Me.s.n=t),Me.s=t,e.n=t,32&Me.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Me.s,t.n=void 0,Me.s.n=t,Me.s=t),t):void 0}function Rt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function tw(e,t){return new Rt(e,t)}function nw(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function ey(e){for(let t=e.s;t!==void 0;t=t.n){const n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function rw(e){let t,n=e.s;for(;n!==void 0;){const r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}e.s=t}function Vo(e,t){Rt.call(this,void 0),this.x=e,this.s=void 0,this.g=qa-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function ow(e){const t=e.u;if(e.u=void 0,typeof t=="function"){pi++;const n=Me;Me=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Lh(e),r}finally{Me=n,Fh()}}}function Lh(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ow(e)}function K3(e){if(Me!==this)throw new Error("Out-of-order effect");rw(this),Me=e,this.f&=-2,8&this.f&&Lh(this),Fh()}function Jo(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function U3(e,t){const n=new Jo(e,t);try{n.c()}catch(o){throw n.d(),o}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}Rt.prototype.brand=W3,Rt.prototype.h=function(){return!0},Rt.prototype.S=function(e){const t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:Jm(()=>{var n;(n=this.W)==null||n.call(this)}))},Rt.prototype.U=function(e){if(this.t!==void 0){const t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Jm(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Rt.prototype.subscribe=function(e){return U3(()=>{const t=this.value,n=Me;Me=void 0;try{e(t)}finally{Me=n}},{name:"sub"})},Rt.prototype.valueOf=function(){return this.value},Rt.prototype.toString=function(){return this.value+""},Rt.prototype.toJSON=function(){return this.value},Rt.prototype.peek=function(){const e=Me;Me=void 0;try{return this.value}finally{Me=e}},Object.defineProperty(Rt.prototype,"value",{get(){const e=Qm(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(Bd>100)throw new Error("Cycle detected");this.v=e,this.i++,qa++,pi++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Fh()}}}}),Vo.prototype=new Rt,Vo.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===qa))return!0;if(this.g=qa,this.f|=1,this.i>0&&!nw(this))return this.f&=-2,!0;const e=Me;try{ey(this),Me=this;const t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Me=e,rw(this),this.f&=-2,!0},Vo.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}Rt.prototype.S.call(this,e)},Vo.prototype.U=function(e){if(this.t!==void 0&&(Rt.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Vo.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Vo.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=Qm(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Jo.prototype.c=function(){const e=this.S();try{if(8&this.f||this.x===void 0)return;const t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Jo.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ow(this),ey(this),pi++;const e=Me;return Me=this,K3.bind(this,e)},Jo.prototype.N=function(){2&this.f||(this.f|=2,this.o=xs,xs=this)},Jo.prototype.d=function(){this.f|=8,1&this.f||Lh(this)},Jo.prototype.dispose=function(){this.d()};function G3(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}function Ie(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function iw(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){const n=e,r=t;for(const o in r)n[o]=iw(n[o],r[o]);return e}return t}const $h=0,zd=1,sw=2,Xc=3,wa=4,jo=5,Zc=6,Ji=7;function Jc(e){return e.id===$h}function aw(e){return e.id===sw}function q3(e){return(function(t){return t.id===zd})(e)||Ie(305,String(e.id),String(zd)),Object.assign(e,{id:sw})}const Y3=new Set;let X3=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:$h}}mergeConfigs(){let t=this.extension.config||{};const n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):P3;for(const r of this.configs)t=n(t,r);return t}init(t){const n=this.state;aw(n)||Ie(306,String(n.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(a,l,c){return Object.assign(a,{config:l,id:Xc,registerState:c})})(n,this.mergeConfigs(),r);let s;this.state=i,this.extension.init&&(s=this.extension.init(t,i.config,r)),this.state=(function(a,l,c){return Object.assign(a,{id:wa,initResult:l,registerState:c})})(i,s,o)}build(t){const n=this.state;let r;n.id!==wa&&Ie(307,String(n.id),String(jo)),this.extension.build&&(r=this.extension.build(t,n.config,n.registerState));const o={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(i,s,a){return Object.assign(i,{id:jo,output:s,registerState:a})})(n,r,o)}register(t,n){this._signal=n;const r=this.state;r.id!==jo&&Ie(308,String(r.id),String(jo));const o=this.extension.register&&this.extension.register(t,r.config,r.registerState);return this.state=(function(i){return Object.assign(i,{id:Zc})})(r),()=>{const i=this.state;i.id!==Ji&&Ie(309,String(r.id),String(Ji)),this.state=(function(s){return Object.assign(s,{id:jo})})(i),o&&o()}}afterRegistration(t){const n=this.state;let r;return n.id!==Zc&&Ie(310,String(n.id),String(Zc)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(o){return Object.assign(o,{id:Ji})})(n),r}getSignal(){return this._signal===void 0&&Ie(311),this._signal}getInitResult(){this.extension.init===void 0&&Ie(312,this.extension.name);const t=this.state;return(function(n){return n.id>=wa})(t)||Ie(313,String(t.id),String(wa)),t.initResult}getInitPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return(function(n){return n.id>=Xc})(t)||Ie(314,String(t.id),String(Xc)),{config:t.config}}getPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){const t=this.state;return(function(n){return n.id>=Ji})(t)||Ie(316,String(t.id),String(Ji)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Y3}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(n){return n.id>=jo})(t)||Ie(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}};const ty={tag:hi};function Z3(){const e=qe();e.isEmpty()&&e.append(me())}const J3={config:{setOptions:ty,updateOptions:ty},init:({$initialEditorState:e=Z3})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){const o=r.getInitResult();if(!o.initialized){o.initialized=!0;const{$initialEditorState:i}=o;if(t3(i))e.setEditorState(i,n);else if(typeof i=="function")e.update(()=>{i(e)},t);else if(i&&(typeof i=="string"||typeof i=="object")){const s=e.parseEditorState(i);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Di,un,Li,$i,Fo]},ny=Symbol.for("@lexical/extension/LexicalBuilder");function ry(){}function Q3(e){throw e}function Ca(e){return Array.isArray(e)?e:[e]}const Qc="0.39.0+prod.esm";let eM=class Ya{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=Qc,this.roots=t;for(const n of t)this.addExtension(n)}static fromExtensions(t){const n=[Ca(J3)];for(const r of t)n.push(Ca(r));return new Ya(n)}static maybeFromEditor(t){const n=t[ny];return n&&(n.PACKAGE_VERSION!==Qc&&Ie(292,n.PACKAGE_VERSION,Qc),n instanceof Ya||Ie(293)),n}static fromEditor(t){const n=Ya.maybeFromEditor(t);return n===void 0&&Ie(294),n}constructEditor(){const{$initialEditorState:t,onError:n,...r}=this.buildCreateEditorArgs(),o=Object.assign(yb({...r,...n?{onError:i=>{n(i,o)}}:{}}),{[ny]:this});for(const i of this.sortedExtensionReps())i.build(o);return o}buildEditor(){let t=ry;function n(){try{t()}finally{t=ry}}const r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=Rn(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Ie(295,t.name),n}addEdge(t,n,r){const o=this.outgoingConfigEdges.get(t);o?o.set(n,r):this.outgoingConfigEdges.set(t,new Map([[n,r]]));const i=this.incomingEdges.get(n);i?i.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Ie(296);const n=Ca(t),[r]=n;typeof r.name!="string"&&Ie(297,typeof r.name);let o=this.extensionNameMap.get(r.name);if(o!==void 0&&o.extension!==r&&Ie(298,r.name),!o){o=new X3(this,r),this.extensionNameMap.set(r.name,o);const i=this.conflicts.get(r.name);typeof i=="string"&&Ie(299,r.name,i);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&Ie(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const a=Ca(s);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[s,a]of r.peerDependencies||[])this.addEdge(r.name,s,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],n=(r,o)=>{let i=r.state;if(aw(i))return;const s=r.extension.name;var a;Jc(i)||Ie(300,s,o||"[unknown]"),Jc(a=i)||Ie(304,String(a.id),String($h)),i=Object.assign(a,{id:zd}),r.state=i;const l=this.outgoingConfigEdges.get(s);if(l)for(const c of l.keys()){const u=this.extensionNameMap.get(c);u&&n(u,s)}i=q3(i),r.state=i,t.push(r)};for(const r of this.extensionNameMap.values())Jc(r.state)&&n(r);for(const r of t)for(const[o,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){const s=this.extensionNameMap.get(o);if(s)for(const a of i)s.configs.add(a)}for(const[r,...o]of this.roots)if(o.length>0){const i=this.extensionNameMap.get(r.name);i===void 0&&Ie(301,r.name);for(const s of o)i.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const n=this.sortedExtensionReps(),r=new AbortController,o=[()=>r.abort()],i=r.signal;for(const s of n){const a=s.register(t,i);a&&o.push(a)}for(const s of n){const a=s.afterRegistration(t);a&&o.push(a)}return Rn(...o)}buildCreateEditorArgs(){const t={},n=new Set,r=new Map,o=new Map,i={},s={},a=this.sortedExtensionReps();for(const u of a){const{extension:f}=u;if(f.onError!==void 0&&(t.onError=f.onError),f.disableEvents!==void 0&&(t.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(t.parentEditor=f.parentEditor),f.editable!==void 0&&(t.editable=f.editable),f.namespace!==void 0&&(t.namespace=f.namespace),f.$initialEditorState!==void 0&&(t.$initialEditorState=f.$initialEditorState),f.nodes)for(const d of G3(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&Ie(302,f.name,d.replace.name,h.extension.name),r.set(d.replace,u)}n.add(d)}if(f.html){if(f.html.export)for(const[d,h]of f.html.export.entries())o.set(d,h);f.html.import&&Object.assign(i,f.html.import)}f.theme&&iw(s,f.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);const l=Object.keys(i).length>0,c=o.size>0;(l||c)&&(t.html={},l&&(t.html.import=i),c&&(t.html.export=o));for(const u of a)u.init(t);return t.onError||(t.onError=Q3),t}},Oh=class lw extends Us{static getType(){return"horizontalrule"}static clone(t){return new lw(t.__key)}static importJSON(t){return cw().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:tM,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){const n=document.createElement("hr");return Qe(n,t.theme.hr),n}getTextContent(){return`
45
- `}isInline(){return!1}updateDOM(){return!1}};function tM(){return{node:cw()}}function cw(){return Lb(Oh)}function nM(e){return e instanceof Oh}function kr(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Hd(e){let t=1,n=e.getParent();for(;n!=null;){if(Re(n)){const r=n.getParent();if(pe(r)){t++,n=r.getParent();continue}kr(40)}return t}return t}function Wd(e){let t=e.getParent();pe(t)||kr(40);let n=t;for(;n!==null;)n=n.getParent(),pe(n)&&(t=n);return t}function uw(e){let t=[];const n=e.getChildren().filter(Re);for(let r=0;r<n.length;r++){const o=n[r],i=o.getFirstChild();pe(i)?t=t.concat(uw(i)):t.push(o)}return t}function $n(e){return Re(e)&&pe(e.getFirstChild())}function oy(e){return Gt().append(e)}function dw(e,t){return Re(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function iy(e){const t=Y();if(t!==null){let n=t.getNodes();if(W(t)){const o=t.getStartEndPoints();o===null&&kr(143);const[i]=o,s=i.getNode(),a=s.getParent();if(pt(s)){const l=s.getFirstChild();if(l)n=l.selectStart().getNodes();else{const c=me();s.append(c),n=c.select().getNodes()}}else if(dw(s,n)){const l=jt(e);if(pt(a)){s.replace(l);const c=Gt();B(s)&&(c.setFormat(s.getFormatType()),c.setIndent(s.getIndent())),l.append(c)}else if(Re(s)){const c=s.getParentOrThrow();Eo(l,c.getChildren()),c.replace(l)}return}}const r=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(B(i)&&i.isEmpty()&&!Re(i)&&!r.has(i.getKey())){sy(i,e);continue}let s=Cb(i)?i.getParent():Re(i)&&i.isEmpty()?i:null;for(;s!=null;){const a=s.getKey();if(pe(s)){if(!r.has(a)){const l=jt(e);Eo(l,s.getChildren()),s.replace(l),r.add(a)}break}{const l=s.getParent();if(pt(l)&&!r.has(a)){r.add(a),sy(s,e);break}s=l}}}}}function Eo(e,t){e.splice(e.getChildrenSize(),0,t)}function sy(e,t){if(pe(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),o=Gt();let i;if(Eo(o,e.getChildren()),pe(n)&&t===n.getListType())n.append(o),pe(r)&&t===r.getListType()&&(Eo(n,r.getChildren()),r.remove()),i=n;else if(pe(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(o),i=r;else{const s=jt(t);s.append(o),e.replace(s),i=s}return o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),e.remove(),i}function Ih(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&$n(n)&&$n(r)&&(Ih(n.getFirstChild(),r.getFirstChild()),r.remove());const o=t.getChildren();o.length>0&&e.append(...o),t.remove()}function rM(){const e=Y();if(W(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(dw(r,n))t.add(Wd(r));else for(let o=0;o<n.length;o++){const i=n[o];if(Cb(i)){const s=I3(i,qr);s!=null&&t.add(Wd(s))}}for(const o of t){let i=o;const s=uw(o);for(const a of s){const l=me().setTextStyle(e.style).setTextFormat(e.format);Eo(l,a.getChildren()),i.insertAfter(l),i=l,a.__key===e.anchor.key&&bn(e.anchor,Mt(Nt(l,"next"))),a.__key===e.focus.key&&bn(e.focus,Mt(Nt(l,"next"))),a.remove()}o.remove()}}}function fw(e){const t=e.getListType()!=="check";let n=e.getStart();for(const r of e.getChildren())Re(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),pe(r.getFirstChild())||n++)}function oM(e){const t=new Set;if($n(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),o=e.getPreviousSibling();if($n(r)&&$n(o)){const i=o.getFirstChild();if(pe(i)){i.append(e);const s=r.getFirstChild();pe(s)&&(Eo(i,s.getChildren()),r.remove(),t.add(r.getKey()))}}else if($n(r)){const i=r.getFirstChild();if(pe(i)){const s=i.getFirstChild();s!==null&&s.insertBefore(e)}}else if($n(o)){const i=o.getFirstChild();pe(i)&&i.append(e)}else if(pe(n)){const i=Gt().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=jt(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());i.append(s),s.append(e),o?o.insertAfter(i):r?r.insertBefore(i):n.append(i)}}function iM(e){if($n(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(pe(n?n.getParent():void 0)&&Re(n)&&pe(t)){const r=t?t.getFirstChild():void 0,o=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(o))n.insertAfter(e),t.isEmpty()&&n.remove();else{const i=t.getListType(),s=Gt(),a=jt(i);s.append(a),e.getPreviousSiblings().forEach(u=>a.append(u));const l=Gt(),c=jt(i);l.append(c),Eo(c,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(e)}}}function sM(){const e=Y();if(!W(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!Re(t)||t.getChildrenSize()!==0)return!1;const n=Wd(t),r=t.getParent();pe(r)||kr(40);const o=r.getParent();let i;if(pt(o))i=me(),n.insertAfter(i);else{if(!Re(o))return!1;i=Gt(),o.insertAfter(i)}i.setTextStyle(e.style).setTextFormat(e.format).select();const s=t.getNextSiblings();if(s.length>0){const a=jt(r.getListType());if(Re(i)){const l=Gt();l.append(a),i.insertAfter(l)}else i.insertAfter(a);a.append(...s)}return(function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const c=l.getParent();if(c==null||!Re(c)&&!pe(c))break;l=c}l.remove()})(t),!0}function wl(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}let qr=class extends St{__value;__checked;$config(){return this.config("listitem",{$transform:t=>{if(t.__checked==null)return;const n=t.getParent();pe(n)&&n.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0)},extends:St,importDOM:{li:()=>({conversion:aM,priority:0})}})}constructor(t=1,n=void 0,r){super(r),this.__value=t===void 0?1:t,this.__checked=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__value=t.__value,this.__checked=t.__checked}createDOM(t){const n=document.createElement("li");return this.updateListItemDOM(null,n,t),n}updateListItemDOM(t,n,r){(function(s,a,l){const c=a.getParent();!pe(c)||c.getListType()!=="check"||pe(a.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||s.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(n,this,t),n.value=this.__value,(function(s,a,l){const c=[],u=[],f=a.list,d=f?f.listitem:void 0;let h;if(f&&f.nested&&(h=f.nested.listitem),d!==void 0&&c.push(...wl(d)),f){const g=l.getParent(),p=pe(g)&&g.getListType()==="check",m=l.getChecked();p&&!m||u.push(f.listitemUnchecked),p&&m||u.push(f.listitemChecked),p&&c.push(m?f.listitemChecked:f.listitemUnchecked)}if(h!==void 0){const g=wl(h);l.getChildren().some(p=>pe(p))?c.push(...g):u.push(...g)}u.length>0&&Kn(s,...u),c.length>0&&Qe(s,...c)})(n,r.theme,this);const o=t?t.__style:"",i=this.__style;o!==i&&(i===""?n.removeAttribute("style"):n.style.cssText=i),(function(s,a,l){const c=qm(a.__textStyle);for(const u in c)s.style.setProperty(`--listitem-marker-${u}`,c[u]);if(l)for(const u in qm(l.__textStyle))u in c||s.style.removeProperty(`--listitem-marker-${u}`)})(n,this,t)}updateDOM(t,n,r){const o=n;return this.updateListItemDOM(t,o,r),!1}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const n=this.createDOM(t._config),r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();return o&&(n.dir=o),{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let n=0;n<t.length;n++){const r=t[n];if(B(r)&&this.canMergeWith(r)){const o=r.getChildren();this.append(...o),r.remove()}else super.append(r)}return this}replace(t,n){if(Re(t))return super.replace(t);this.setIndent(0);const r=this.getParentOrThrow();if(!pe(r))return t;if(r.__first===this.getKey())r.insertBefore(t);else if(r.__last===this.getKey())r.insertAfter(t);else{const o=jt(r.getListType());let i=this.getNextSibling();for(;i;){const s=i;i=i.getNextSibling(),o.append(s)}r.insertAfter(t),t.insertAfter(o)}return n&&(B(t)||kr(139),this.getChildren().forEach(o=>{t.append(o)})),this.remove(),r.getChildrenSize()===0&&r.remove(),t}insertAfter(t,n=!0){const r=this.getParentOrThrow();if(pe(r)||kr(39),Re(t))return super.insertAfter(t,n);const o=this.getNextSiblings();if(r.insertAfter(t,n),o.length!==0){const i=jt(r.getListType());o.forEach(s=>i.append(s)),t.insertAfter(i,n)}return t}remove(t){const n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(t),n&&r&&$n(n)&&$n(r)&&(Ih(n.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(t,n=!0){const r=Gt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,n),r}collapseAtStart(t){const n=me();this.getChildren().forEach(s=>n.append(s));const r=this.getParentOrThrow(),o=r.getParentOrThrow(),i=Re(o);if(r.getChildrenSize()===1)if(i)r.remove(),o.select();else{r.insertBefore(n),r.remove();const s=t.anchor,a=t.focus,l=n.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(l,s.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const n=this.getWritable();return n.__value=t,n}getChecked(){const t=this.getLatest();let n;const r=this.getParent();return pe(r)&&(n=r.getListType()),n==="check"?!!t.__checked:void 0}setChecked(t){const n=this.getWritable();return n.__checked=t,n}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let n=t.getParentOrThrow(),r=0;for(;Re(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(t){typeof t!="number"&&kr(117),(t=Math.floor(t))>=0||kr(199);let n=this.getIndent();for(;n!==t;)n<t?(oM(this),n++):(iM(this),n--);return this}canInsertAfter(t){return Re(t)}canReplaceWith(t){return Re(t)}canMergeWith(t){return Re(t)||Gr(t)}extractWithChild(t,n){if(!W(n))return!1;const r=n.anchor.getNode(),o=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return jt("bullet")}canMergeWhenEmpty(){return!0}};function aM(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return ay(n)}if(e.classList.contains("joplin-checkbox")){for(const n of e.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return ay(n.children[0])}const t=e.getAttribute("aria-checked");return{node:Gt(t==="true"||t!=="false"&&void 0)}}function ay(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:Gt(e.hasAttribute("checked"))}}function Gt(e){return _t(new qr(void 0,e))}function Re(e){return e instanceof qr}let $o=class extends St{__tag;__start;__listType;$config(){return this.config("list",{$transform:t=>{(function(n){const r=n.getNextSibling();pe(r)&&n.getListType()===r.getListType()&&Ih(n,r)})(t),fw(t)},extends:St,importDOM:{ol:()=>({conversion:cy,priority:0}),ul:()=>({conversion:cy,priority:0})}})}constructor(t="number",n=1,r){super(r);const o=cM[t]||t;this.__listType=o,this.__tag=o==="number"?"ol":"ul",this.__start=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__listType=t.__listType,this.__tag=t.__tag,this.__start=t.__start}getTag(){return this.getLatest().__tag}setListType(t){const n=this.getWritable();return n.__listType=t,n.__tag=t==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t){const n=this.getWritable();return n.__start=t,n}createDOM(t,n){const r=this.__tag,o=document.createElement(r);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,ly(o,t.theme,this),o}updateDOM(t,n,r){return t.__tag!==this.__tag||t.__listType!==this.__listType||(ly(n,r.theme,this),!1)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const n=this.createDOM(t._config,t);return Be(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t,n,r){let o=r;for(let i=0;i<r.length;i++){const s=r[i];Re(s)||(o===r&&(o=[...r]),o[i]=Gt().append(!B(s)||pe(s)||s.isInline()?s:Le(s.getTextContent())))}return super.splice(t,n,o)}extractWithChild(t){return Re(t)}};function ly(e,t,n){const r=[],o=[],i=t.list;if(i!==void 0){const s=i[`${n.__tag}Depth`]||[],a=Hd(n)-1,l=a%s.length,c=s[l],u=i[n.__tag];let f;const d=i.nested,h=i.checklist;if(d!==void 0&&d.list&&(f=d.list),u!==void 0&&r.push(u),h!==void 0&&n.__listType==="check"&&r.push(h),c!==void 0){r.push(...wl(c));for(let g=0;g<s.length;g++)g!==l&&o.push(n.__tag+g)}if(f!==void 0){const g=wl(f);a>1?r.push(...g):o.push(...g)}}o.length>0&&Kn(e,...o),r.length>0&&Qe(e,...r)}function lM(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(Re(r)){t.push(r);const o=r.getChildren();o.length>1&&o.forEach(i=>{pe(i)&&t.push(oy(i))})}else t.push(oy(r))}return t}function cy(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=jt("number",e.start):t==="ul"&&(n=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const o of r.childNodes)if(Be(o)&&o.hasAttribute("aria-checked"))return!0;return!1})(e)?jt("check"):jt("bullet")),{after:lM,node:n}}const cM={ol:"number",ul:"bullet"};function jt(e="number",t=1){return _t(new $o(e,t))}function pe(e){return e instanceof $o}const uM=le("UPDATE_LIST_START_COMMAND"),hw=le("INSERT_UNORDERED_LIST_COMMAND"),gw=le("INSERT_ORDERED_LIST_COMMAND"),dM=le("REMOVE_LIST_COMMAND");function fM(e){return Rn(e.registerCommand(gw,()=>(iy("number"),!0),sr),e.registerCommand(uM,t=>{const{listNodeKey:n,newStart:r}=t,o=Pe(n);return!!pe(o)&&(o.getListType()==="number"&&(o.setStart(r),fw(o)),!0)},sr),e.registerCommand(hw,()=>(iy("bullet"),!0),sr),e.registerCommand(dM,()=>(rM(),!0),sr),e.registerCommand(bo,()=>sM(),sr),e.registerNodeTransform(qr,t=>{const n=t.getFirstChild();if(n){if(X(n)){const r=n.getStyle(),o=n.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==o&&t.setTextFormat(o)}}else{const r=Y();W(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(un,t=>{const n=t.getParent();if(Re(n)&&t.is(n.getFirstChild())){const r=t.getStyle(),o=t.getFormat();r===n.getTextStyle()&&o===n.getTextFormat()||n.setTextStyle(r).setTextFormat(o)}}))}function hM(e){const t=n=>{const r=n.getParent();if(pe(n.getFirstChild())||!pe(r))return;const o=be(n,i=>Re(i)&&pe(i.getParent())&&Re(i.getPreviousSibling()));if(o===null&&n.getIndent()>0)n.setIndent(0);else if(Re(o)){const i=o.getPreviousSibling();if(Re(i)){const s=(function(l){let c=l,u=c.getFirstChild();for(;pe(u);){const f=u.getLastChild();if(!Re(f))break;c=f,u=c.getFirstChild()}return c})(i),a=s.getParent();if(pe(a)){const l=Hd(a);l+1<Hd(r)&&n.setIndent(l)}}}};return e.registerNodeTransform($o,n=>{const r=[n];for(;r.length>0;){const o=r.shift();if(pe(o)){for(const i of o.getChildren())if(Re(i)){t(i);const s=i.getFirstChild();pe(s)&&r.push(s)}}}})}function gM(e,t){const n=wb(t)?t.body.childNodes:t.childNodes;let r=[];const o=[];for(const i of n)if(!mw.has(i.nodeName)){const s=yw(i,e,o,!1);s!==null&&(r=r.concat(s))}return(function(i){for(const s of i)s.getNextSibling()instanceof yh&&s.insertAfter(Tn());for(const s of i){const a=s.getChildren();for(const l of a)s.insertBefore(l);s.remove()}})(o),r}function pM(e,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=qe().getChildren();for(let o=0;o<r.length;o++)pw(e,r[o],n,t);return n.innerHTML}function pw(e,t,n,r=null){let o=r===null||t.isSelected(r);const i=B(t)&&t.excludeFromCopy("html");let s=t;r!==null&&X(t)&&(s=Hb(r,t,"clone"));const a=B(s)?s.getChildren():[],l=xh(e,s.getType());let c;c=l&&l.exportDOM!==void 0?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let h=0;h<a.length;h++){const g=a[h],p=pw(e,g,d,r);!o&&B(t)&&p&&t.extractWithChild(g,r,"html")&&(o=!0)}if(o&&!i){if((Be(u)||Dd(u))&&u.append(d),n.append(u),f){const h=f.call(s,u);h&&(Dd(u)?u.replaceChildren(h):u.replaceWith(h))}}else n.append(d);return o}const mw=new Set(["STYLE","SCRIPT"]);function yw(e,t,n,r,o=new Map,i){let s=[];if(mw.has(e.nodeName))return s;let a=null;const l=(function(g,p){const{nodeName:m}=g,x=p._htmlConversions.get(m.toLowerCase());let y=null;if(x!==void 0)for(const v of x){const b=v(g);b!==null&&(y===null||(y.priority||0)<=(b.priority||0))&&(y=b)}return y!==null?y.conversion:null})(e,t),c=l?l(e):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(const[,p]of o)if(a=p(a,i),!a)break;a&&s.push(...Array.isArray(g)?g:[a])}c.forChild!=null&&o.set(e.nodeName,c.forChild)}const f=e.childNodes;let d=[];const h=(a==null||!pt(a))&&(a!=null&&Fd(a)||r);for(let g=0;g<f.length;g++)d.push(...yw(f[g],t,n,h,new Map(o),a));return u!=null&&(d=u(d)),bl(e)&&(d=mM(e,d,h?()=>{const g=new yh;return n.push(g),g}:me)),a==null?d.length>0?s=s.concat(d):bl(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Vd(g.nextSibling)&&Vd(g.previousSibling)})(e)&&(s=s.concat(Tn())):B(a)&&a.append(...d),s}function mM(e,t,n){const r=e.style.textAlign,o=[];let i=[];for(let s=0;s<t.length;s++){const a=t[s];if(Fd(a))r&&!a.getFormat()&&a.setFormat(r),o.push(a);else if(i.push(a),s===t.length-1||s<t.length-1&&Fd(t[s+1])){const l=n();l.setFormat(r),l.append(...i),o.push(l),i=[]}}return o}function Cl(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function yM(e,t=Y()){return t==null&&Cl(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?"":pM(e,t)}function vM(e,t=Y()){return t==null&&Cl(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(xM(e,t))}function uy(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===n._config.namespace&&Array.isArray(a.nodes))return dy(n,bM(a.nodes),t)}catch(a){console.error(a)}const o=e.getData("text/html"),i=e.getData("text/plain");if(o&&i!==o)try{const a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(l):l})(o),"text/html");return dy(n,gM(n,a),t)}catch(a){console.error(a)}const s=i||e.getData("text/uri-list");if(s!=null)if(W(t)){const a=s.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){const c=Y();if(W(c)){const u=a[l];u===`
44
+ `?r.push(Tn()):s===" "?r.push(Di()):r.push(Fe(s))}this.insertNodes(r)}insertText(t){const n=this.anchor,r=this.focus,o=this.format,i=this.style;let s=n,a=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,a=n),s.type==="element"&&(function(m,x,y,v){const b=m.getNode(),w=b.getChildAtIndex(m.offset),_=Fe();if(_.setFormat(y),_.setStyle(v),qr(w))w.splice(0,0,[_]);else{const E=ot(b)?ye().append(_):_;w===null?b.append(E):w.insertBefore(E)}m.is(x)&&x.set(_.__key,0,"text"),m.set(_.__key,0,"text")})(s,a,o,i),a.type==="element"&&bn(a,Mt(En(a,"next")));const l=s.offset;let c=a.offset;const u=this.getNodes(),f=u.length;let d=u[0];X(d)||q(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let p=u[f-1];if(f===1&&a.type==="element"&&(c=h,a.set(s.key,c,"text")),this.isCollapsed()&&l===h&&(rr(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let m=d.getNextSibling();if(X(m)&&m.canInsertTextBefore()&&!rr(m)||(m=Fe(),m.setFormat(o),m.setStyle(i),g.canInsertTextAfter()?d.insertAfter(m):g.insertAfter(m)),m.select(0,0),d=m,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(rr(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let m=d.getPreviousSibling();if(X(m)&&!rr(m)||(m=Fe(),m.setFormat(o),g.canInsertTextBefore()?d.insertBefore(m):g.insertBefore(m)),m.select(),d=m,t!=="")return void this.insertText(t)}else if(d.isSegmented()&&l!==h){const m=Fe(d.getTextContent());m.setFormat(o),d.replace(m),d=m}else if(!this.isCollapsed()&&t!==""){const m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||B(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),c1(this.anchor,this.focus,null),void this.insertText(t)}if(f===1){if(yo(d)){const v=Fe(t);return v.select(),void d.replace(v)}const m=d.getFormat(),x=d.getStyle();if(l!==c||m===o&&x===i){if(Gl(d)){const v=Fe(t);return v.setFormat(o),v.setStyle(i),v.select(),void d.replace(v)}}else{if(d.getTextContent()!==""){const v=Fe(t);if(v.setFormat(o),v.setStyle(i),v.select(),l===0)d.insertBefore(v,!1);else{const[b]=d.splitText(l);b.insertAfter(v,!1)}return void(v.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}d.setFormat(o),d.setStyle(i)}const y=c-l;d=d.spliceText(l,y,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=t.length:(this.format=m,this.style=x))}else{const m=new Set([...d.getParentKeys(),...p.getParentKeys()]),x=B(d)?d:d.getParentOrThrow();let y=B(p)?p:p.getParentOrThrow(),v=p;if(!x.is(y)&&y.isInline())do v=y,y=y.getParentOrThrow();while(y.isInline());if(a.type==="text"&&(c!==0||p.getTextContent()==="")||a.type==="element"&&p.getIndexWithinParent()<c)if(X(p)&&!yo(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){const T=Fe(p.getTextContent());p.replace(T),p=T}ot(a.getNode())||a.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{const T=p.getParentOrThrow();T.canBeEmpty()||T.getChildrenSize()!==1?p.remove():T.remove()}else m.add(p.__key);const b=y.getChildren(),w=new Set(u),_=x.is(y),E=x.isInline()&&d.getNextSibling()===null?x:d;for(let T=b.length-1;T>=0;T--){const k=b[T];if(k.is(d)||B(k)&&k.isParentOf(d))break;k.isAttached()&&(!w.has(k)||k.is(v)?_||E.insertAfter(k,!1):k.remove())}if(!_){let T=y,k=null;for(;T!==null;){const P=T.getChildren(),O=P.length;(O===0||P[O-1].is(k))&&(m.delete(T.__key),k=T),T=T.getParent()}}if(yo(d))if(l===h)d.select();else{const T=Fe(t);T.select(),d.replace(T)}else d=d.spliceText(l,h-l,t,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);for(let T=1;T<f;T++){const k=u[T],P=k.__key;m.has(P)||k.remove()}}}removeText(){const t=Y()===this;Xa(this,$A(Ym(this))),t&&Y()!==this&&Ge(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void gt(null);const r=this.getNodes(),o=[];for(const b of r)X(b)&&o.push(b);const i=b=>{r.forEach(w=>{if(B(w)){const _=w.getFormatFlags(t,b);w.setTextFormat(_)}})},s=o.length;if(s===0)return this.toggleFormat(t),gt(null),void i(n);const a=this.anchor,l=this.focus,c=this.isBackward(),u=c?l:a,f=c?a:l;let d=0,h=o[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(d=1,h=o[1],g=0),h==null)return;const p=h.getFormatFlags(t,n);i(p);const m=s-1;let x=o[m];const y=f.type==="text"?f.offset:x.getTextContentSize();if(h.is(x)){if(g===y)return;if(rr(h)||g===0&&y===h.getTextContentSize())h.setFormat(p);else{const b=h.splitText(g,y),w=g===0?b[0]:b[1];w.setFormat(p),u.type==="text"&&u.set(w.__key,0,"text"),f.type==="text"&&f.set(w.__key,y-g,"text")}return void(this.format=p)}g===0||rr(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const v=x.getFormatFlags(t,p);y>0&&(y===x.getTextContentSize()||rr(x)||([x]=x.splitText(y)),x.setFormat(v));for(let b=d+1;b<m;b++){const w=o[b],_=w.getFormatFlags(t,v);w.setFormat(_)}u.type==="text"&&u.set(h.__key,g,"text"),f.type==="text"&&f.set(x.__key,y,"text"),this.format=p|v}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=Y();return W(g)||q(134),g.insertNodes(t)}const n=(this.isBackward()?this.focus:this.anchor).getNode(),r=we(n,Er),o=t[t.length-1];if(B(r)&&"__language"in r){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const g=Yc(this);r.splice(g,0,t),o.selectEnd()}return}if(!t.some(g=>(B(g)||_e(g))&&!g.isInline())){B(r)||q(211,n.constructor.name,n.getType());const g=Yc(this);return r.splice(g,0,t),void o.selectEnd()}const i=(function(g){const p=ye();let m=null;for(let x=0;x<g.length;x++){const y=g[x],v=zn(y);if(v||_e(y)&&y.isInline()||B(y)&&y.isInline()||X(y)||y.isParentRequired()){if(m===null&&(m=y.createParentElementNode(),p.append(m),v))continue;m!==null&&m.append(y)}else p.append(y),m=null}return p})(t),s=i.getLastDescendant(),a=i.getChildren(),l=!B(r)||!r.isEmpty()?this.insertParagraph():null,c=a[a.length-1];let u=a[0];var f;B(f=u)&&Er(f)&&!f.isEmpty()&&B(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(B(r)||q(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=a[1]),u&&(r===null&&q(212,n.constructor.name,n.getType()),(function(g,p){const m=p.getParentOrThrow().getLastChild();let x=p;const y=[p];for(;x!==m;)x.getNextSibling()||q(140),x=x.getNextSibling(),y.push(x);let v=g;for(const b of y)v=v.insertAfter(b)})(r,u));const d=we(s,Er);l&&B(d)&&(l.canMergeWhenEmpty()||Er(c))&&(d.append(...l.getChildren()),l.remove()),B(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=B(r)?r.getLastChild():null;zn(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=ye();return qe().splice(this.anchor.offset,0,[s]),s.select(),s}const t=Yc(this),n=we(this.anchor.getNode(),Er);B(n)||q(213);const r=n.getChildAtIndex(t),o=r?[r,...r.getNextSiblings()]:[],i=n.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(t){const n=Tn();if(this.insertNodes([n]),t){const r=n.getParentOrThrow(),o=n.getIndexWithinParent();r.select(o,o)}}extract(){const t=[...this.getNodes()],n=t.length;let r=t[0],o=t[n-1];const[i,s]=Od(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,f]=a?[s,i]:[i,s];if(n===0)return[];if(n===1){if(X(r)&&!this.isCollapsed()){const d=r.splitText(u,f),h=u===0?d[0]:d[1];return h?(l.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(X(r)&&(u===r.getTextContentSize()?t.shift():u!==0&&([,r]=r.splitText(u),t[0]=r,l.set(r.getKey(),0,"text"))),X(o)){const d=o.getTextContent().length;f===0?t.pop():f!==d&&([o]=o.splitText(f),t[t.length-1]=o,c.set(o.getKey(),o.getTextContentSize(),"text"))}return t}modify(t,n,r){if(Nm(this,t,n,r))return;const o=t==="move",i=$e(),s=Lt(dn(i));if(!s)return;const a=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(l===null||a===null||!B(c)||c.isInline()||c.canBeEmpty()||Bd(a,i,l),this.dirty){let u=_o(i,this.anchor.key),f=_o(i,this.focus.key);this.anchor.type==="text"&&(u=Ri(u)),this.focus.type==="text"&&(f=Ri(f)),u&&f&&f1(s,u,this.anchor.offset,f,this.focus.offset)}if((function(u,f,d,h){u.modify(f,d,h)})(s,t,n?"backward":"forward",r),s.rangeCount>0){const u=s.getRangeAt(0),f=this.anchor.getNode(),d=ot(f)?f:bA(f);if(this.applyDOMRange(u),this.dirty=!0,!o){const h=this.getNodes(),g=[];let p=!1;for(let m=0;m<h.length;m++){const x=h[m];Vd(x,d)?g.push(x):p=!0}if(p&&g.length>0)if(n){const m=g[0];B(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=g[g.length-1];B(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(m){const x=m.focus,y=m.anchor,v=y.key,b=y.offset,w=y.type;y.set(x.key,x.offset,x.type,!0),x.set(v,b,w,!0)})(this)}}r==="lineboundary"&&Nm(this,t,n,r,"decorators")}forwardDeletion(t,n,r){if(!r&&(t.type==="element"&&B(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const o=n.getParent(),i=n.getNextSibling()||(o===null?null:o.getNextSibling());if(B(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,t))return;const i=Os(En(r,t?"previous":"next"));if(i.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of i.iterNodeCarets("shadowRoot"))if(jt(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(B(i.anchor.origin)&&i.anchor.origin.isEmpty()){const c=Mt(l);Xa(this,Vr(c,c)),i.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(jr(l)){if(B(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(i.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(_e(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&B(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();const c=mh();c.add(l.origin.getKey()),Ge(c)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:c}=a;return Xa(this,Vr(!l.origin.isEmpty()&&c.isEmpty()?ea(tt(c,l.direction)):i.anchor,l)),this.removeText()}}const s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&r.offset===0&&Tm(this,r.getNode()))return}else{const a=s.type==="text"?s.getNode():null;if(o=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=s.offset,c=a.getTextContentSize();if(a.is(o)||t&&l!==c||!t&&l!==0)return void Em(a,t,l)}else if(o!==null&&o.isSegmented()){const l=r.offset,c=o.getTextContentSize();if(o.is(a)||t&&l!==0||!t&&l!==c)return void Em(o,t,l)}(function(l,c){const u=l.anchor,f=l.focus,d=u.getNode(),h=f.getNode();if(d===h&&u.type==="text"&&f.type==="text"){const g=u.offset,p=f.offset,m=g<p,x=m?g:p,y=m?p:g,v=y-1;x!==v&&(function(b){return!(A1(b)||rA(b))})(d.getTextContent().slice(x,y))&&(c?f.set(f.key,v,f.type):u.set(u.key,v,u.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&ot(r.getParent())&&r.getPreviousSibling()===null&&Tm(this,r)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function bt(e){return e instanceof ql}function _m(e){const t=e.offset;if(e.type==="text")return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Od(e){const t=e.getStartEndPoints();if(t===null)return[0,0];const[n,r]=t;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[_m(n),_m(r)]}function Tm(e,t){for(let n=t;n;n=n.getParent()){if(B(n)){if(n.collapseAtStart(e))return!0;if(pt(n))break}if(n.getPreviousSibling())break}return!1}const rA=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch{}return()=>!1})();function Em(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,a=0;for(let c=0;c<i;c++){const u=c===i-1;if(a=s,s+=o[c].length,t&&s===n||s>n||u){o.splice(c,1),u&&(a=void 0);break}}const l=o.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function Rm(e,t,n,r){let o,i=t;if(Be(e)){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],f=!1;if(u===c)u=a[i+1],f=!0;else if(c!==null){const d=c.parentNode;e===d&&t>Array.prototype.indexOf.call(d.children,c)&&i--}if(o=ui(u),X(o))i=Kn(o,s?"next":"previous");else{let d=ui(e);if(d===null)return null;if(B(d)){const h=r.getElementByKey(d.getKey());h===null&&q(214),[d,i]=d.getDOMSlot(h).resolveChildIndex(d,h,e,t),B(d)||q(215),s&&i>=d.getChildrenSize()&&(i=Math.max(0,d.getChildrenSize()-1));let p=d.getChildAtIndex(i);if(B(p)&&(function(m,x,y){const v=m.getParent();return y===null||v===null||!v.canBeEmpty()||v!==y.getNode()})(p,0,n)){const m=s?p.getLastDescendant():p.getFirstDescendant();m===null?d=p:(p=m,d=B(p)?p:p.getParentOrThrow()),i=0}X(p)?(o=p,d=null,i=Kn(p,s?"next":"previous")):p!==d&&s&&!f&&(B(d)||q(216),i=Math.min(d.getChildrenSize(),i+1))}else{const h=d.getIndexWithinParent();i=t===0&&_e(d)&&ui(e)===d?h:h+1,d=d.getParentOrThrow()}if(B(d))return zt(d.__key,i,"element")}}else o=ui(e);return X(o)?zt(o.__key,Kn(o,i,"clamp"),"text"):null}function km(e,t,n){const r=e.offset,o=e.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(t){if((n||!t)&&i===null&&B(s)&&s.isInline()){const a=s.getPreviousSibling();X(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else B(i)&&!n&&i.isInline()?e.set(i.__key,i.getChildrenSize(),"element"):X(i)&&e.set(i.__key,i.getTextContent().length,"text")}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(t&&B(i)&&i.isInline())e.set(i.__key,0,"element");else if((n||t)&&i===null&&B(s)&&s.isInline()&&!s.canInsertTextAfter()){const a=s.getNextSibling();X(a)&&e.set(a.__key,0,"text")}}}function c1(e,t,n){if(e.type==="text"&&t.type==="text"){const r=e.isBefore(t),o=e.is(t);km(e,r,o),km(t,!r,o),o&&t.set(e.key,e.offset,e.type);const i=$e();if(i.isComposing()&&i._compositionKey!==e.key&&W(n)){const s=n.anchor,a=n.focus;e.set(s.key,s.offset,s.type,!0),t.set(a.key,a.offset,a.type,!0)}}}function u1(e,t,n,r,o,i){if(e===null||n===null||!Zs(o,e,n))return null;const s=Rm(e,t,W(i)?i.anchor:null,o);if(s===null)return null;const a=Rm(n,r,W(i)?i.focus:null,o);if(a===null)return null;if(s.type==="element"&&a.type==="element"){const l=ui(e),c=ui(n);if(_e(l)&&_e(c))return null}return c1(s,a,i),[s,a]}function Id(e){return B(e)&&!e.isInline()}function d1(e,t,n,r,o,i){const s=Gr(),a=new Fo(zt(e,t,o),zt(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function Yl(){const e=zt("root",0,"element"),t=zt("root",0,"element");return new Fo(e,t,0,"")}function mh(){return new ql(new Set)}function oA(e,t){return Xl(null,e,t,null)}function Xl(e,t,n,r){const o=n._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,a=s==="selectionchange",l=!xd&&(a||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(W(e)&&!l)return e.clone();if(t===null)return null;if(c=t.anchorNode,u=t.focusNode,f=t.anchorOffset,d=t.focusOffset,(a||s===void 0)&&W(e)&&!Zs(n,c,u))return e.clone();const h=u1(c,f,u,d,n,e);if(h===null)return null;const[g,p]=h;return new Fo(g,p,W(e)?e.format:0,W(e)?e.style:"")}function Y(){return Gr()._selection}function qn(){return $e()._editorState._selection}function xl(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const c=o.offset;if(n<=c&&r>0||n<c&&r<0){const u=Math.max(0,c+r);o.set(l,u,"element"),i.set(l,u,"element"),Am(e)}}else{const c=e.isBackward(),u=c?i:o,f=u.getNode(),d=c?o:i,h=d.getNode();if(t.is(f)){const g=u.offset;(n<=g&&r>0||n<g&&r<0)&&u.set(l,Math.max(0,g+r),"element")}if(t.is(h)){const g=d.offset;(n<=g&&r>0||n<g&&r<0)&&d.set(l,Math.max(0,g+r),"element")}}Am(e)}function Am(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,i=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!B(i))return;const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(X(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(B(i)){const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(X(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text")}}if(B(s)){const a=s.getChildrenSize(),l=o>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(o);if(X(c)){let u=0;l&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function bl(e,t,n,r,o){let i=null,s=0,a=null;r!==null?(i=r.__key,X(r)?(s=r.getTextContentSize(),a="text"):B(r)&&(s=r.getChildrenSize(),a="element")):o!==null&&(i=o.__key,X(o)?a="text":B(o)&&(a="element")),i!==null&&a!==null?e.set(i,s,a):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function Mm(e,t,n,r,o){e.type==="text"?e.set(n,e.offset+(t?0:o),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function f1(e,t,n,r,o){try{e.setBaseAndExtent(t,n,r,o)}catch{}}function iA(e,t,n,r,o,i,s){const a=r.anchorNode,l=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(o.has(s1)&&f!==i||f!==null&&Sh(f))return;if(!W(t))return void(e!==null&&Zs(n,a,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.key,p=h.key,m=_o(n,g),x=_o(n,p),y=d.offset,v=h.offset,b=t.format,w=t.style,_=t.isCollapsed();let E=m,T=x,k=!1;if(d.type==="text"){E=Ri(m);const H=d.getNode();k=H.getFormat()!==b||H.getStyle()!==w}else W(e)&&e.anchor.type==="text"&&(k=!0);var P,O,D,I,$;if(h.type==="text"&&(T=Ri(x)),E!==null&&T!==null&&(_&&(e===null||k||W(e)&&(e.format!==b||e.style!==w))&&(P=b,O=w,D=y,I=g,$=performance.now(),Qb=[P,O,D,I,$]),c!==y||u!==v||a!==E||l!==T||r.type==="Range"&&_||(f!==null&&i.contains(f)||o.has(Y3)||i.focus({preventScroll:!0}),d.type==="element"))){if(f1(r,E,y,T,v),!o.has(G3)&&t.isCollapsed()&&i!==null&&i===document.activeElement){const H=W(t)&&t.anchor.type==="element"?E.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(H!==null){let U;if(H instanceof Text){const L=document.createRange();L.selectNode(H),U=L.getBoundingClientRect()}else U=H.getBoundingClientRect();(function(L,N,V){const K=L1(V),te=Ah(K);if(K===null||te===null)return;let{top:J,bottom:Z}=N,ae=0,oe=0,fe=V;for(;fe!==null;){const Te=fe===K.body;if(Te)ae=0,oe=dn(L).innerHeight;else{const ve=fe.getBoundingClientRect();ae=ve.top,oe=ve.bottom}let ne=0;if(J<ae?ne=-(ae-J):Z>oe&&(ne=Z-oe),ne!==0)if(Te)te.scrollBy(0,ne);else{const ve=fe.scrollTop;fe.scrollTop+=ne;const Ee=fe.scrollTop-ve;J-=Ee,Z-=Ee}if(Te)break;fe=Js(fe)}})(n,U,i)}}Nd=!0}}function yh(e){let t=Y()||qn();t===null&&(t=qe().selectEnd()),t.insertNodes(e)}function Yc(e){let t=e;e.isCollapsed()||t.removeText();const n=Y();W(n)&&(t=n),W(t)||q(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!Er(o);){const s=o;if([o,i]=sA(o,i),s.is(o))break}return i}function sA(e,t){const n=e.getParent();if(!n){const o=ye();return qe().append(o),o.select(),[qe(),0]}if(X(e)){const o=e.splitText(t);if(o.length===0)return[n,e.getIndexWithinParent()];const i=t===0?0:1;return[n,o[0].getIndexWithinParent()+i]}if(!B(e)||t===0)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const o=new Fo(zt(e.__key,t,"element"),zt(e.__key,t,"element"),0,""),i=e.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function Nm(e,t,n,r,o="decorators-and-blocks"){if(t==="move"&&r==="character"&&!e.isCollapsed()){const[u,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(u.key,u.offset,u.type),!0}const i=En(e.focus,n?"previous":"next"),s=r==="lineboundary",a=t==="move";let l=i,c=o==="decorators-and-blocks";if(!$h(l)){for(const u of l){c=!1;const{origin:f}=u;if(!_e(f)||f.isIsolated()||(l=u,!s||!f.isInline()))break}if(c)for(const u of Os(i).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(jt(u))u.origin.isInline()||(l=u);else{if(B(u.origin))continue;_e(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===i)return!1;if(a&&!s&&_e(l.origin)&&l.origin.isKeyboardSelectable()){const u=mh();return u.add(l.origin.getKey()),Ge(u),!0}return l=Mt(l),a&&bn(e.anchor,l),bn(e.focus,l),c||!s}let dt=null,ft=null,Dt=!1,Xc=!1,qa=0;const Pm={characterData:!0,childList:!0,subtree:!0};function ji(){return Dt||dt!==null&&dt._readOnly}function ut(){Dt&&q(13)}function h1(){qa>99&&q(14)}function Gr(){return dt===null&&q(195,g1()),dt}function $e(){return ft===null&&q(196,g1()),ft}function g1(){let e=0;const t=new Set,n=Ei.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=Jl(o);if(_h(i))e++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function aA(){return ft}function Lm(e,t,n){const r=t.__type,o=b1(e,r);let i=n.get(r);i===void 0&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let a=0;a<s&&(i[a](t),t.isAttached());a++);}function Fm(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function p1(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const o of r)n.add(o)}function lA(e){return vh(e,$e()._nodes)}function vh(e,t){const n=e.type,r=t.get(n);r===void 0&&q(17,n);const o=r.klass;e.type!==o.getType()&&q(18,o.name);const i=o.importJSON(e),s=e.children;if(B(i)&&Array.isArray(s))for(let a=0;a<s.length;a++){const l=vh(s[a],t);i.append(l)}return i}function $m(e,t,n){const r=dt,o=Dt,i=ft;dt=t,Dt=!0,ft=e;try{return n()}finally{dt=r,Dt=o,ft=i}}function sr(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||r===null;if(n===null)return;const i=e._editorState,s=i._selection,a=n._selection,l=e._dirtyType!==0,c=dt,u=Dt,f=ft,d=e._updating,h=e._observer;let g=null;if(e._pendingEditorState=null,e._editorState=n,!o&&l&&h!==null){ft=e,dt=n,Dt=!1,e._updating=!0;try{const _=e._dirtyType,E=e._dirtyElements,T=e._dirtyLeaves;h.disconnect(),g=N3(i,n,e,_,E,T)}catch(_){if(_ instanceof Error&&e._onError(_),Xc)throw _;return v1(e,null,r,n),Mb(e),e._dirtyType=2,Xc=!0,sr(e,i),void(Xc=!1)}finally{h.observe(r,Pm),e._updating=d,dt=c,Dt=u,ft=f}}n._readOnly||(n._readOnly=!0);const p=e._dirtyLeaves,m=e._dirtyElements,x=e._normalizedNodes,y=e._updateTags,v=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(_,E){const T=_._decorators;let k=_._pendingDecorators||T;const P=E._nodeMap;let O;for(O in k)P.has(O)||(k===T&&(k=R1(_)),delete k[O])})(e,n);const b=o?null:Lt(dn(e));if(e._editable&&b!==null&&(l||a===null||a.dirty||!a.is(s))&&r!==null&&!y.has(q3)){ft=e,dt=n;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){const _=e._blockCursorElement;_!==null&&Bd(_,e,r),iA(s,a,e,b,y,r)}(function(_,E,T){let k=_._blockCursorElement;if(W(T)&&T.isCollapsed()&&T.anchor.type==="element"&&E.contains(document.activeElement)){const P=T.anchor,O=P.getNode(),D=P.offset;let I=!1,$=null;if(D===O.getChildrenSize())Jc(O.getChildAtIndex(D-1))&&(I=!0);else{const H=O.getChildAtIndex(D);if(H!==null&&Jc(H)){const U=H.getPreviousSibling();(U===null||Jc(U))&&(I=!0,$=_.getElementByKey(H.__key))}}if(I){const H=_.getElementByKey(O.__key);return k===null&&(_._blockCursorElement=k=(function(U){const L=U.theme,N=document.createElement("div");N.contentEditable="false",N.setAttribute("data-lexical-cursor","true");let V=L.blockCursor;if(V!==void 0){if(typeof V=="string"){const K=Tb(V);V=L.blockCursor=K}V!==void 0&&N.classList.add(...V)}return N})(_._config)),E.style.caretColor="transparent",void($===null?H.appendChild(k):H.insertBefore(k,$))}}k!==null&&Bd(k,_,E)})(e,r,a)}finally{h!==null&&h.observe(r,Pm),ft=f,dt=c}}g!==null&&(function(_,E,T,k,P){const O=Array.from(_._listeners.mutation),D=O.length;for(let I=0;I<D;I++){const[$,H]=O[I];for(const U of H){const L=E.get(U);L!==void 0&&$(L,{dirtyLeaves:k,prevEditorState:P,updateTags:T})}}})(e,g,y,p,i),W(a)||a===null||s!==null&&s.is(a)||e.dispatchCommand(cr,void 0);const w=e._pendingDecorators;w!==null&&(e._decorators=w,e._pendingDecorators=null,xs("decorator",e,!0,w)),(function(_,E,T){const k=jm(E),P=jm(T);k!==P&&xs("textcontent",_,!0,P)})(e,t||i,n),xs("update",e,!0,{dirtyElements:m,dirtyLeaves:p,editorState:n,mutatedNodes:g,normalizedNodes:x,prevEditorState:t||i,tags:y}),(function(_,E){if(_._deferred=[],E.length!==0){const T=_._updating;_._updating=!0;try{for(let k=0;k<E.length;k++)E[k]()}finally{_._updating=T}}})(e,v),(function(_){const E=_._updates;if(E.length!==0){const T=E.shift();if(T){const[k,P]=T;Zl(_,k,P)}}})(e)}function xs(e,t,n,...r){const o=t._updating;t._updating=n;try{const i=Array.from(t._listeners[e]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{t._updating=o}}function Om(e,t){const n=e._updates;let r=t||!1;for(;n.length!==0;){const o=n.shift();if(o){const[i,s]=o,a=e._pendingEditorState;let l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(a===null&&q(191),a._flushSync=!0),l&&e._deferred.push(l),p1(e,s.tag)),a==null?Zl(e,i,s):i()}}return r}function Zl(e,t,n){const r=e._updateTags;let o,i=!1,s=!1;n!==void 0&&(o=n.onUpdate,p1(e,n.tag),i=n.skipTransforms||!1,s=n.discrete||!1),o&&e._deferred.push(o);const a=e._editorState;let l=e._pendingEditorState,c=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=m1(l||a),c=!0),l._flushSync=s;const u=dt,f=Dt,d=ft,h=e._updating;dt=l,Dt=!1,e._updating=!0,ft=e;const g=e._headless||e.getRootElement()===null;wh(null);try{c&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(y,v){const b=y.getEditorState()._selection,w=Lt(dn(y));return W(b)||b==null?Xl(b,w,y,v):b.clone()})(e,n&&n.event||null));const m=e._compositionKey;t(),i=Om(e,i),(function(y,v){const b=v.getEditorState()._selection,w=y._selection;if(W(w)){const _=w.anchor,E=w.focus;let T;if(_.type==="text"&&(T=_.getNode(),T.selectionTransform(b,w)),E.type==="text"){const k=E.getNode();T!==k&&k.selectionTransform(b,w)}}})(l,e),e._dirtyType!==0&&(i?(function(y,v){const b=v._dirtyLeaves,w=y._nodeMap;for(const _ of b){const E=w.get(_);X(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&fm(E)}})(l,e):(function(y,v){const b=v._dirtyLeaves,w=v._dirtyElements,_=y._nodeMap,E=Rr(),T=new Map;let k=b,P=k.size,O=w,D=O.size;for(;P>0||D>0;){if(P>0){v._dirtyLeaves=new Set;for(const I of k){const $=_.get(I);X($)&&$.isAttached()&&$.isSimpleText()&&!$.isUnmergeable()&&fm($),$!==void 0&&Fm($,E)&&Lm(v,$,T),b.add(I)}if(k=v._dirtyLeaves,P=k.size,P>0){qa++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,O.delete("root")&&O.set("root",!0);for(const I of O){const $=I[0],H=I[1];if(w.set($,H),!H)continue;const U=_.get($);U!==void 0&&Fm(U,E)&&Lm(v,U,T)}k=v._dirtyLeaves,P=k.size,O=v._dirtyElements,D=O.size,qa++}v._dirtyLeaves=b,v._dirtyElements=w})(l,e),Om(e),(function(y,v,b,w){const _=y._nodeMap,E=v._nodeMap,T=[];for(const[k]of w){const P=E.get(k);P!==void 0&&(P.isAttached()||(B(P)&&Rb(P,k,_,E,T,w),_.has(k)||w.delete(k),T.push(k)))}for(const k of T)E.delete(k);for(const k of b){const P=E.get(k);P===void 0||P.isAttached()||(_.has(k)||b.delete(k),E.delete(k))}})(a,l,e._dirtyLeaves,e._dirtyElements)),m!==e._compositionKey&&(l._flushSync=!0);const x=l._selection;if(W(x)){const y=l._nodeMap,v=x.anchor.key,b=x.focus.key;y.get(v)!==void 0&&y.get(b)!==void 0||q(19)}else bt(x)&&x._nodes.size===0&&(l._selection=null)}catch(m){return m instanceof Error&&e._onError(m),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void sr(e)}finally{dt=u,Dt=f,ft=d,e._updating=h,qa=0}e._dirtyType!==0||e._deferred.length>0||(function(m,x){const y=x.getEditorState()._selection,v=m._selection;if(v!==null){if(v.dirty||!v.is(y))return!0}else if(y!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,sr(e)):c&&gA(()=>{sr(e)}):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Hn(e,t,n){ft===e&&n===void 0?t():Zl(e,t,n)}class bs{element;before;after;constructor(t,n,r){this.element=t,this.before=n||null,this.after=r||null}withBefore(t){return new bs(this.element,t,this.after)}withAfter(t){return new bs(this.element,this.before,t)}withElement(t){return this.element===t?this:new bs(t,this.before,this.after)}insertChild(t){const n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&q(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&q(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&q(224),this.element.replaceChild(t,n),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{const n=t==="decorator"&&(qs||$i||Gs);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const n=this.element,r=t.nodeName==="IMG"?t.nextSibling:null;r&&n.removeChild(r),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before,i=document.createElement("br");if(r.insertBefore(i,o),t){const s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,r,o){if(r===this.element){const l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,o))]}const i=Im(n,r);i.push(o);const s=Im(n,this.element);let a=t.getIndexWithinParent();for(let l=0;l<s.length;l++){const c=i[l],u=s[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[t.getParentOrThrow(),a]}}function Im(e,t){const n=[];let r=t;for(;r!==e&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;n.push(o)}return r!==e&&q(225),n.reverse()}class St extends Bn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return y3[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const t=$e()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if(X(n)&&t.push(n),B(n)){const r=n.getAllTextNodes();t.push(...r)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;B(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;B(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),r=n.length;if(t>=r){const i=n[r-1];return B(i)&&i.getLastDescendant()||i||null}const o=n[t];return B(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Le(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return t===null&&q(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return t===null?null:Le(t)}getLastChildOrThrow(){const t=this.getLastChild();return t===null&&q(96,this.__key),t}getChildAtIndex(t){const n=this.getChildrenSize();let r,o;if(t<n/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=t;){if(o===t)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=n-1;r!==null&&o>=t;){if(o===t)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let t="";const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContent(),B(i)&&o!==r-1&&!i.isInline()&&(t+=Ir)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContentSize(),B(i)&&o!==r-1&&!i.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){const n=om[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){const n=Dr[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return wl(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){ut();const r=Y();let o=t,i=n;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const l=this.getFirstChild();if(X(l)||B(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||n!==void 0&&n!==s)){const l=this.getLastChild();if(X(l)||B(l))return l.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const a=this.__key;return W(r)?(r.anchor.set(a,o,"element"),r.focus.set(a,i,"element"),r.dirty=!0,r):d1(a,o,a,i,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?om[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){const n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,r){vl(this)&&q(324,this.__key,this.__type);const o=this.getChildrenSize(),i=this.getWritable();t+n<=o||q(226,String(t),String(n),String(o));const s=i.__key,a=[],l=[],c=this.getChildAtIndex(t+n);let u=null,f=o-n+r.length;if(t!==0)if(t===o)u=this.getLastChild();else{const h=this.getChildAtIndex(t);h!==null&&(u=h.getPreviousSibling())}if(n>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<n;g++){h===null&&q(100);const p=h.getNextSibling(),m=h.__key;vo(h.getWritable()),l.push(m),h=p}}let d=u;for(const h of r){d!==null&&h.is(d)&&(u=d=d.getPreviousSibling());const g=h.getWritable();g.__parent===s&&f--,vo(g);const p=h.__key;if(d===null)i.__first=p,g.__prev=null;else{const m=d.getWritable();m.__next=p,g.__prev=m.__key}h.__key===s&&q(76),g.__parent=s,a.push(p),d=h}if(t+n===o)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){const h=c.getWritable();if(d!==null){const g=d.getWritable();h.__prev=d.__key,g.__next=c.__key}else h.__prev=null}if(i.__size=f,l.length){const h=Y();if(W(h)){const g=new Set(l),p=new Set(a),{anchor:m,focus:x}=h;Dm(m,g,p)&&bl(m,m.getNode(),this,u,c),Dm(x,g,p)&&bl(x,x.getNode(),this,u,c),f!==0||this.canBeEmpty()||pt(this)||this.remove()}}return i}getDOMSlot(t){return new bs(t)}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){const r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px");const o=this.getDirection();o&&(n.dir=o)}return{element:n}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||pt(this)||this.getChildren().some(X)||(n!==0&&(t.textFormat=n),r!==""&&(t.textStyle=r)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){const r=this.getDOMSlot(t);let o=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const s=n.getElementByKey(i.getKey());s!==null&&(o==null?(r.insertChild(s),o=s):o!==s&&r.replaceChild(s,o),o=o.nextSibling)}}}function B(e){return e instanceof St}function Dm(e,t,n){let r=e.getNode();for(;r;){const o=r.__key;if(t.has(o)&&!n.has(o))return!0;r=r.getParent()}return!1}class Ys extends Bn{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function _e(e){return e instanceof Ys}class Vi extends St{__cachedText;static getType(){return"root"}static clone(){return new Vi}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){q(51)}getTextContent(){const t=this.__cachedText;return!ji()&&$e()._dirtyType!==0||t===null?super.getTextContent():t}remove(){q(52)}replace(t){q(53)}insertBefore(t){q(54)}insertAfter(t){q(55)}updateDOM(t,n){return!1}splice(t,n,r){for(const o of r)B(o)||_e(o)||q(282);return super.splice(t,n,r)}static importJSON(t){return qe().updateFromJSON(t)}collapseAtStart(){return!0}}function ot(e){return e instanceof Vi}function m1(e){return new Xs(new Map(e._nodeMap))}function xh(){return new Xs(new Map([["root",new Vi]]))}function y1(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&q(130,n.name),B(e)){const r=t.children;Array.isArray(r)||q(59,n.name);const o=e.getChildren();for(let i=0;i<o.length;i++){const s=y1(o[i]);r.push(s)}}return t}function cA(e){return e instanceof Xs}class Xs{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return $m(n&&n.editor||null,this,t)}clone(t){const n=new Xs(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return $m(null,this,()=>({root:y1(qe())}))}}class bh extends St{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class $o extends St{static getType(){return"paragraph"}static clone(t){return new $o(t.__key)}createDOM(t){const n=document.createElement("p"),r=mi(t.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(t,n,r){return!1}static importDOM(){return{p:t=>({conversion:uA,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}static importJSON(t){return ye().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){const n=this.getChildren().find(X);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){const r=ye();r.setTextFormat(t.format),r.setTextStyle(t.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){const t=this.getChildren();if(t.length===0||X(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function uA(e){const t=ye();return e.style&&(t.setFormat(e.style.textAlign),Mh(e,t)),{node:t}}function ye(){return _t(new $o)}function qr(e){return e instanceof $o}const be=0,ar=1,$t=3,dA=4;function v1(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=xh(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",o.set("root",n))}function fA(e){const t=new Set,n=new Set;let r=e;for(;r;){const{ownNodeConfig:o}=tc(r),i=r.transform;if(!n.has(i)){n.add(i);const s=r.transform();s&&t.add(s)}if(o){const s=o.$transform;s&&t.add(s),r=o.extends}else{const s=Object.getPrototypeOf(r);r=s.prototype instanceof Bn&&s!==Bn?s:void 0}}return t}function x1(e){const t=e||{},n=aA(),r=t.theme||{},o=e===void 0?n:t.parentEditor||null,i=t.disableEvents||!1,s=xh(),a=t.namespace||(o!==null?o._config.namespace:M1()),l=t.editorState,c=[Vi,un,Oi,Ii,$o,bh,...t.nodes||[]],{onError:u,html:f}=t,d=t.editable===void 0||t.editable;let h;if(e===void 0&&n!==null)h=n._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],x=null,y=null;if(typeof m!="function"){const w=m;m=w.replace,x=w.with,y=w.withKlass||null}tc(m);const v=m.getType(),b=fA(m);h.set(v,{exportDOM:f&&f.export?f.export.get(m):void 0,klass:m,replace:x,replaceWithKlass:y,sharedNodeState:E3(c[p]),transforms:b})}}const g=new Ei(s,o,h,{disableEvents:i,namespace:a,theme:r},u||console.error,(function(p,m){const x=new Map,y=new Set,v=b=>{Object.keys(b).forEach(w=>{let _=x.get(w);_===void 0&&(_=[],x.set(w,_)),_.push(b[w])})};return p.forEach(b=>{const w=b.klass.importDOM;if(w==null||y.has(w))return;y.add(w);const _=w.call(b.klass);_!==null&&v(_)}),m&&v(m),x})(h,f?f.import:void 0),d,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(p){p.registerCommand(jb,j3,be),p.registerCommand(Vb,V3,be),p.registerCommand(Bb,B3,be),p.registerCommand(zb,z3,be),p.registerCommand(Kb,H3,be)})(g),g}class Ei{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,n,r,o,i,s,a,l){this._createEditorArgs=l,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=M1(),this._onError=i,this._htmlConversions=s,this._editable=a,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,r){r===void 0&&q(35);const o=this._commands;o.has(t)||o.set(t,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(t);i===void 0&&q(36,String(t));const s=i[r];return s.add(n),()=>{s.delete(n),i.every(a=>a.size===0)&&o.delete(t)}}registerMutationListener(t,n,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;let s=i.get(n);s===void 0&&(s=new Set,i.set(n,s)),s.add(o);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(n,o),()=>{s.delete(o),s.size===0&&i.delete(n)}}getRegisteredNode(t){const n=this._nodes.get(t.getType());return n===void 0&&q(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){const r=this._editorState,o=Um(r).get(n.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){const r=this.getRegisteredNode(t);return r.transforms.add(n),r}registerNodeTransform(t,n){const r=this.registerNodeTransformToKlass(t,n),o=[r],i=r.replaceWithKlass;if(i!=null){const s=this.registerNodeTransformToKlass(i,n);o.push(s)}return(function(s,a){const l=Um(s.getEditorState()),c=[];for(const u of a){const f=l.get(u);f&&c.push(f)}c.length!==0&&s.update(()=>{for(const u of c)for(const f of u.keys()){const d=Le(f);d&&d.markDirty()}},s._pendingEditorState===null?{tag:pi}:void 0)})(this,o.map(s=>s.klass.getType())),()=>{o.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return Q(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const r=mi(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=t,v1(this,n,t,o),n!==null&&(this._config.disableEvents||W3(n),r!=null&&n.classList.remove(...r)),t!==null){const i=Ah(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,Mb(this),this._updateTags.add(pi),sr(this),this._config.disableEvents||(function(a,l){const c=a.ownerDocument;Md.set(a,c);const u=ml.get(c)??0;u<1&&c.addEventListener("selectionchange",o1),ml.set(c,u+1),a.__lexicalEditor=l;const f=r1(a);for(let d=0;d<Ad.length;d++){const[h,g]=Ad[d],p=typeof g=="function"?m=>{xm(m)||(vm(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(xm(m))return;vm(m);const x=l.isEditable();switch(h){case"cut":return x&&Q(l,Ul,m);case"copy":return Q(l,Kl,m);case"paste":return x&&Q(l,ah,m);case"dragstart":return x&&Q(l,qb,m);case"dragover":return x&&Q(l,Yb,m);case"dragend":return x&&Q(l,O3,m);case"focus":return x&&Q(l,Xb,m);case"blur":return x&&Q(l,I3,m);case"drop":return x&&Q(l,Gb,m)}};a.addEventListener(h,p),f.push(()=>{a.removeEventListener(h,p)})}})(t,this),r!=null&&t.classList.add(...r)}else this._window=null,this._updateTags.add(pi),sr(this);xs("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&q(38);let r=t;r._readOnly&&(r=m1(t),r._selection=t._selection?t._selection.clone():null),Ab(this);const o=this._pendingEditorState,i=this._updateTags,s=n!==void 0?n.tag:null;o===null||o.isEmpty()||(s!=null&&i.add(s),sr(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&i.add(s),this._updating||sr(this)}parseEditorState(t,n){return(function(r,o,i){const s=xh(),a=dt,l=Dt,c=ft,u=o._dirtyElements,f=o._dirtyLeaves,d=o._cloneNotNeeded,h=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,dt=s,Dt=!1,ft=o,wh(null);try{const g=o._nodes;vh(r.root,g),i&&i(),s._readOnly=!0}catch(g){g instanceof Error&&o._onError(g)}finally{o._dirtyElements=u,o._dirtyLeaves=f,o._cloneNotNeeded=d,o._dirtyType=h,dt=a,Dt=l,ft=c}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return sr(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(r,o,i){r._updating?r._updates.push([o,i]):Zl(r,o,i)})(this,t,n)}focus(t,n={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Hn(this,()=>{const o=Y(),i=qe();o!==null?o.dirty||Ge(o.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),yA("focus"),vA(()=>{r.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=Lt(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,xs("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}Ei.version="0.39.0+prod.esm";let Dd=null;function wh(e){Dd=e}let hA=1;function b1(e,t){const n=Ch(e,t);return n===void 0&&q(30,t),n}function Ch(e,t){return e._nodes.get(t)}const gA=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function w1(e){return _e(Ht(e))}function Sh(e){const t=document.activeElement;if(!Be(t))return!1;const n=t.nodeName;return _e(Ht(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&Jl(t)==null)}function Zs(e,t,n){const r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!Sh(t)&&C1(t)===e}catch{return!1}}function _h(e){return e instanceof Ei}function C1(e){let t=e;for(;t!=null;){const n=Jl(t);if(_h(n))return n;t=Js(t)}return null}function Jl(e){return e?e.__lexicalEditor:null}function yo(e){return Gl(e)||e.isToken()}function rr(e){return yo(e)||e.isSegmented()}function xr(e){return xn(e)&&e.nodeType===3}function S1(e){return xn(e)&&e.nodeType===9}function Ri(e){let t=e;for(;t!=null;){if(xr(t))return t;t=t.firstChild}return null}function wl(e,t,n){const r=Dr[t];if(n!==null&&(e&r)===(n&r))return e;let o=e^r;return t==="subscript"?o&=-65:t==="superscript"?o&=-33:t==="lowercase"?(o&=-513,o&=-1025):t==="uppercase"?(o&=-257,o&=-1025):t==="capitalize"&&(o&=-257,o&=-513),o}function _1(e){return X(e)||zn(e)||_e(e)}function T1(e,t){const n=(function(){const s=Dd;return Dd=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);ut(),h1();const r=$e(),o=Gr(),i=""+hA++;o._nodeMap.set(i,e),B(e)?r._dirtyElements.set(i,!0):r._dirtyLeaves.add(i),r._cloneNotNeeded.add(i),r._dirtyType=1,e.__key=i}function vo(e){const t=e.getParent();if(t!==null){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling(),s=i!==null?i.__key:null,a=o!==null?o.__key:null,l=o!==null?o.getWritable():null,c=i!==null?i.getWritable():null;o===null&&(r.__first=s),i===null&&(r.__last=a),l!==null&&(l.__next=s),c!==null&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function Cl(e){h1(),vl(e)&&q(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent,r=Gr(),o=$e(),i=r._nodeMap,s=o._dirtyElements;n!==null&&(function(l,c,u){let f=l;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}})(n,i,s);const a=t.__key;o._dirtyType=1,B(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function gt(e){ut();const t=$e(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){const r=Le(n);r!==null&&r.getWritable()}if(e!==null){const r=Le(e);r!==null&&r.getWritable()}}}function Rr(){return ji()?null:$e()._compositionKey}function Le(e,t){const n=(t||Gr())._nodeMap.get(e);return n===void 0?null:n}function E1(e,t){const n=Ql(e,$e());return n!==void 0?Le(n,t):null}function Ql(e,t){return e[`__lexicalKey_${t._key}`]}function Ht(e,t){let n=e;for(;n!=null;){const r=E1(n,t);if(r!==null)return r;n=Js(n)}return null}function R1(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function jm(e){return e.read(()=>qe().getTextContent())}function qe(){return k1(Gr())}function k1(e){return e._nodeMap.get("root")}function Ge(e){ut();const t=Gr();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function ui(e){const t=$e(),n=(function(r,o){let i=r;for(;i!=null;){const s=Ql(i,o);if(s!==void 0)return s;i=Js(i)}return null})(e,t);return n===null?e===t.getRootElement()?Le("root"):null:Le(n)}function A1(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Th(e){const t=[];let n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function M1(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function N1(e){return xr(e)?e.nodeValue:null}function Eh(e,t,n){const r=Lt(dn(t));if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let a=N1(o);const l=Ht(o);if(a!==null&&X(l)){if(a===Bl&&n){const c=n.length;a=n,i=c,s=c}a!==null&&Rh(l,a,i,s,e)}}}function Rh(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===Bl&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(a===""){if(gt(null),Gs||$i||qs)i.remove();else{const p=$e();setTimeout(()=>{p.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=qn(),f=i.getTextContentSize(),d=Rr(),h=i.getKey();if(i.isToken()||d!==null&&h===d&&!s||W(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===e.__key&&u.focus.offset===f&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const g=Y();if(!W(g)||n===null||r===null)return void Vm(i,a,g);if(g.setTextNodeRange(i,n,i,r),i.isSegmented()){const p=Fe(i.getTextContent());i.replace(p),i=p}Vm(i,a,g)}}}function Vm(e,t,n){if(e.setTextContent(t),W(n)){const r=e.getKey();for(const o of["anchor","focus"]){const i=n[o];i.type==="text"&&i.key===r&&(i.offset=Kn(e,i.offset,"clamp"))}}}function Ca(e,t,n){const r=t[n]||!1;return r==="any"||r===e[n]}function pA(e,t){return Ca(e,t,"altKey")&&Ca(e,t,"ctrlKey")&&Ca(e,t,"shiftKey")&&Ca(e,t,"metaKey")}function Pe(e,t,n){return pA(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const er={ctrlKey:!vn,metaKey:vn},Bm={altKey:vn,ctrlKey:!vn};function zm(e){return e.key==="Backspace"}function Hm(e){return Pe(e,"a",er)}function mA(e){const t=qe();if(W(e)){const n=e.anchor,r=e.focus,o=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),Ns(e),e}{const n=t.select(0,t.getChildrenSize());return Ge(Ns(n)),n}}function mi(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;const o=e[t];if(typeof o=="string"){const i=Tb(o);return n[t]=i,i}return o}function kh(e,t,n,r,o){if(n.size===0)return;const i=r.__type,s=r.__key,a=t.get(i);a===void 0&&q(33,i);const l=a.klass;let c=e.get(l);c===void 0&&(c=new Map,e.set(l,c));const u=c.get(s),f=u==="destroyed"&&o==="created";(u===void 0||f)&&c.set(s,f?"updated":o)}function Wm(e,t,n){const r=e.getParent();let o=n,i=e;return r!==null&&(t&&n===0?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function jd(e,t){const n=e.offset;if(e.type==="element")return Wm(e.getNode(),t,n);{const r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){const o=t?r.getPreviousSibling():r.getNextSibling();return o===null?Wm(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):o}}return null}function P1(e){const t=dn(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function Q(e,t,n){return(function(r,o,i){const s=Th(r);for(let a=4;a>=0;a--)for(let l=0;l<s.length;l++){const c=s[l],u=c._commands.get(o);if(u!==void 0){const f=u[a];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(Hn(c,()=>{for(let p=0;p<h;p++)if(d[p](i,r))return void(g=!0)}),g)return g}}}return!1})(e,t,n)}function ec(e){return!ot(e)&&!e.isLastChild()&&!e.isInline()}function _o(e,t){const n=e._keyToDOMMap.get(t);return n===void 0&&q(75,t),n}function Js(e){const t=e.assignedSlot||e.parentElement;return zd(t)?t.host:t}function L1(e){return S1(e)?e:Be(e)?e.ownerDocument:null}function yA(e){ut(),$e()._updateTags.add(e)}function vA(e){ut(),$e()._deferred.push(e)}function Vd(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Ah(e){const t=L1(e);return t?t.defaultView:null}function dn(e){const t=e._window;return t===null&&q(78),t}function xA(e){return B(e)&&e.isInline()||_e(e)&&e.isInline()}function bA(e){let t=e.getParentOrThrow();for(;t!==null;){if(pt(t))return t;t=t.getParentOrThrow()}return t}function pt(e){return ot(e)||B(e)&&e.isShadowRoot()}function wA(e){const t=e.constructor.clone(e);return T1(t,null),t.afterCloneFrom(e),t}function _t(e){const t=$e(),n=e.getType(),r=Ch(t,n);r===void 0&&q(200,e.constructor.name,n);const{replace:o,replaceWithKlass:i}=r;if(o!==null){const s=o(e),a=s.constructor;return i!==null?s instanceof i||q(201,i.name,i.getType(),a.name,a.getType(),e.constructor.name,n):s instanceof e.constructor&&a!==e.constructor||q(202,a.name,a.getType(),e.constructor.name,n),s.__key===e.__key&&q(203,e.constructor.name,n,a.name,a.getType()),s}return e}function Zc(e,t){!ot(e.getParent())||B(t)||_e(t)||q(99)}function CA(e){const t=Le(e);return t===null&&q(63,e),t}function Jc(e){return(_e(e)||B(e)&&!e.canBeEmpty())&&!e.isInline()}function Bd(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;r!==null&&r.removeChild(e)}function Lt(e){return Mn?(e||window).getSelection():null}function SA(e){const t=Ah(e);return t?t.getSelection():null}function F1(e){return Be(e)&&e.tagName==="A"}function Be(e){return xn(e)&&e.nodeType===1}function xn(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function zd(e){return xn(e)&&e.nodeType===11}function Hd(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return e.nodeName.match(t)!==null}function Sl(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return e.nodeName.match(t)!==null}function Er(e){if(_e(e)&&!e.isInline())return!0;if(!B(e)||pt(e))return!1;const t=e.getFirstChild(),n=t===null||zn(t)||X(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function Bi(){return $e()}const Km=new WeakMap,_A=new Map;function Um(e){if(!e._readOnly&&e.isEmpty())return _A;e._readOnly||q(192);let t=Km.get(e);return t||(t=(function(n){const r=new Map;for(const[o,i]of n._nodeMap){const s=i.__type;let a=r.get(s);a||(a=new Map,r.set(s,a)),a.set(o,i)}return r})(e),Km.set(e,t)),t}function $1(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function TA(e){return(t=$1(e))[i1]=!0,t;var t}function Mh(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function EA(e){e.__lexicalUnmanaged=!0}function RA(e){return e.__lexicalUnmanaged===!0}function Qi(e,t){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(e,t)&&e[t]!==Bn[t]}function tc(e){const t=im in e.prototype?e.prototype[im]():void 0,n=(function(s){if(!(s===Bn||s.prototype instanceof Bn)){let a="<unknown>",l="<unknown>";try{a=s.getType()}catch{}try{Ei.version&&(l=JSON.parse(Ei.version))}catch{}q(290,s.name,a,l)}return s===Ys||s===St||s===Bn})(e),r=!n&&Qi(e,"getType")?e.getType():void 0;let o,i=r;if(t)if(r)o=t[r];else for(const[s,a]of Object.entries(t))i=s,o=a;if(!n&&i&&(Qi(e,"getType")||(e.getType=()=>i),Qi(e,"clone")||(e.clone=s=>(wh(s),new e)),Qi(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(s=>new e().updateFromJSON(s))),!Qi(e,"importDOM")&&o)){const{importDOM:s}=o;s&&(e.importDOM=()=>s)}return{ownNodeConfig:o,ownNodeType:i}}function O1(e){const t=Bi();return ut(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}const we=(e,t)=>{let n=e;for(;n!=null&&!ot(n);){if(t(n))return n;n=n.getParent()}return null},kA={next:"previous",previous:"next"};class Nh{origin;constructor(t){this.origin=t}[Symbol.iterator](){return Fh({hasNext:jr,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return tt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return tt(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){const r=this.getNodeAtCaret();return t.is(this.origin)||t.is(r)||(r===null?this.insert(t):r.replace(t,n)),this}splice(t,n,r="next"){const o=r===this.direction?n:Array.from(n).reverse();let i=this;const s=this.getParentAtCaret(),a=new Map;for(let l=i.getAdjacentCaret();l!==null&&a.size<t;l=l.getAdjacentCaret()){const c=l.origin.getWritable();a.set(c.getKey(),c)}for(const l of o){if(a.size>0){const c=i.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||i.origin.is(l))){const u=l.getParent();u&&u.is(s)&&l.remove(),c.replace(l)}}else c===null&&q(263,Array.from(a).join(" "))}else i.insert(l);i=tt(l,this.direction)}for(const l of a.values())l.remove();return this}}class $s extends Nh{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Nt(t,this.direction)}getParentCaret(t="root"){return tt(Ph(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Oo(this.direction);return tt(this.getNodeAtCaret(),t)||Nt(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof $s&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const AA={root:ot,shadowRoot:pt};function Oo(e){return kA[e]}function Ph(e,t="root"){return AA[t](e)?null:e}class To extends Nh{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:tt(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return B(this.origin)?Nt(this.origin,this.direction):null}getParentCaret(t="root"){return tt(Ph(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Oo(this.direction);return tt(this.getNodeAtCaret(),t)||Nt(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof To&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof To||t instanceof Eo)&&this.direction===t.direction&&this.origin.is(t.origin)}}class Eo extends Nh{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Ro(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return tt(Ph(this.getParentAtCaret(),t),this.direction)}getFlipped(){return Ro(this.origin,Oo(this.direction),this.offset)}isSamePointCaret(t){return t instanceof Eo&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof To||t instanceof Eo)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return tt(this.origin,this.direction)}}function Wn(e){return e instanceof Eo}function jr(e){return e instanceof To}function jt(e){return e instanceof $s}const MA={next:class extends Eo{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Eo{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},NA={next:class extends To{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends To{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},PA={next:class extends $s{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends $s{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function tt(e,t){return e?new NA[t](e):null}function Ro(e,t,n){return e?new MA[t](e,Kn(e,n)):null}function Kn(e,t,n="error"){const r=e.getTextContentSize();let o=t==="next"?r:t==="previous"?0:t;return(o<0||o>r)&&(n!=="clamp"&&Sb(284,String(t),String(r),e.getKey()),o=o<0?0:r),o}function Gm(e,t){return new FA(e,t)}function Nt(e,t){return B(e)?new PA[t](e):null}function LA(e){return e&&e.getChildCaret()||e}function Qs(e){return e&&LA(e.getAdjacentCaret())}class Lh{type="node-caret-range";direction;anchor;focus;constructor(t,n,r){this.anchor=t,this.focus=n,this.direction=r}getLatest(){const t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new Lh(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=o=>{const i=this[o].getLatest();return Wn(i)?(function(s,a){const{direction:l,origin:c}=s,u=Kn(c,a==="focus"?Oo(l):l);return Gm(s,u-s.offset)})(i,o):null},n=t("anchor"),r=t("focus");if(n&&r){const{caret:o}=n,{caret:i}=r;if(o.isSameNodeCaret(i))return[Gm(o,i.offset-o.offset),null]}return[n,r]}iterNodeCarets(t="root"){const n=Wn(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),o=Wn(r),i=s=>s.isSameNodeCaret(r)?null:Qs(s)||s.getParentCaret(t);return Fh({hasNext:s=>s!==null&&!(o&&r.isSameNodeCaret(s)),initial:n.isSameNodeCaret(r)?null:i(n),map:s=>s,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class FA{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){const{distance:t,caret:{offset:n}}=this,r=n+t;return r<n?[r,n]:[n,r]}getTextContent(){const[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:n}}=this,[r,o]=this.getSliceIndices(),i=t.getTextContent();return Ro(t.setTextContent(i.slice(0,r)+i.slice(o)),n,r)}}function Os(e){return Vr(e,tt(qe(),e.direction))}function I1(e){return Vr(e,e)}function Vr(e,t){return e.direction!==t.direction&&q(265),new Lh(e,t,e.direction)}function Fh(e){const{initial:t,hasNext:n,step:r,map:o}=e;let i=t;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};const s={done:!1,value:o(i)};return i=r(i),s}}}function D1(e,t){const n=Ya(e.origin,t.origin);switch(n===null&&q(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const r=e.type==="text",o=t.type==="text";return r&&o?(function(i,s){return Math.sign(i-s)})(e.offset,t.offset):e.type===t.type?0:r?-1:o?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return j1(n)}}function j1(e){const{a:t,b:n}=e,r=t.__key,o=n.__key;let i=t,s=n;for(;i&&s;i=i.getNextSibling(),s=s.getNextSibling()){if(i.__key===o)return-1;if(s.__key===r)return 1}return i===null?1:-1}function Sa(e,t){return t.is(e)}function qm(e){return B(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Ya(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,o]=qm(e);r;o=r,r=r.getParent())n.set(r,o);for(let[r,o]=qm(t);r;o=r,r=r.getParent()){const i=n.get(r);if(i!==void 0)return i===null?(Sa(e,r)||q(276),{commonAncestor:r,type:"ancestor"}):o===null?(Sa(t,r)||q(277),{commonAncestor:r,type:"descendant"}):((B(i)||Sa(e,i))&&(B(o)||Sa(t,o))&&r.is(i.getParent())&&r.is(o.getParent())||q(278),{a:i,b:o,commonAncestor:r,type:"branch"})}return null}function En(e,t){const{type:n,key:r,offset:o}=e,i=CA(e.key);return n==="text"?(X(i)||q(266,i.getType(),r),Ro(i,t,o)):(B(i)||q(267,i.getType(),r),OA(i,e.offset,t))}function bn(e,t){const{origin:n,direction:r}=t,o=r==="next";Wn(t)?e.set(n.getKey(),t.offset,"text"):jr(t)?X(n)?e.set(n.getKey(),Kn(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(jt(t)&&B(n)||q(268),e.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function V1(e){const t=Y(),n=W(t)?t:Yl();return Xa(n,e),Ge(n),n}function Xa(e,t){bn(e.anchor,t.anchor),bn(e.focus,t.focus)}function Ym(e){const{anchor:t,focus:n}=e,r=En(t,"next"),o=En(n,"next"),i=D1(r,o)<=0?"next":"previous";return Vr(yr(r,i),yr(o,i))}function ea(e){const{direction:t,origin:n}=e,r=tt(n,Oo(t)).getNodeAtCaret();return r?tt(r,t):Nt(n.getParentOrThrow(),t)}function Xm(e,t="root"){const n=[e];for(let r=jt(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(ea(r));return n}function Qc(e){return!!e&&e.origin.isAttached()}function $A(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let o=t;const i=B1(e,r),s=Xm(i.anchor,n),a=Xm(i.focus.getFlipped(),n),l=new Set,c=[];for(const g of i.iterNodeCarets(n))if(jt(g))l.add(g.origin.getKey());else if(jr(g)){const{origin:p}=g;B(p)&&!l.has(p.getKey())||c.push(p)}for(const g of c)g.remove();for(const g of i.getTextSlices()){if(!g)continue;const{origin:p}=g.caret,m=p.getTextContentSize(),x=ea(tt(p,r)),y=p.getMode();if(Math.abs(g.distance)===m&&o==="removeEmptySlices"||y==="token"&&g.distance!==0)x.remove();else if(g.distance!==0){o="removeEmptySlices";let v=g.removeTextSlice();const b=g.caret.origin;if(y==="segmented"){const w=v.origin,_=Fe(w.getTextContent()).setStyle(w.getStyle()).setFormat(w.getFormat());x.replaceOrInsert(_),v=Ro(_,r,v.offset)}b.is(s[0].origin)&&(s[0]=v),b.is(a[0].origin)&&(a[0]=v.getFlipped())}}let u,f;for(const g of s)if(Qc(g)){u=Mt(g);break}for(const g of a)if(Qc(g)){f=Mt(g);break}const d=(function(g,p,m){if(!g||!p)return null;const x=g.getParentAtCaret(),y=p.getParentAtCaret();if(!x||!y)return null;const v=x.getParents().reverse();v.push(x);const b=y.getParents().reverse();b.push(y);const w=Math.min(v.length,b.length);let _;for(_=0;_<w&&v[_]===b[_];_++);const E=(P,O)=>{let D;for(let I=_;I<P.length;I++){const $=P[I];if(pt($))return;!D&&O($)&&(D=$)}return D},T=E(v,Er),k=T&&E(b,P=>m.has(P.getKey())&&Er(P));return T&&k?[T,k]:null})(u,f,l);if(d){const[g,p]=d;Nt(g,"previous").splice(0,p.getChildren()),p.remove()}const h=[u,f,...s,...a].find(Qc);if(h)return I1(yr(Mt(h),e.direction));q(269,JSON.stringify(s.map(g=>g.origin.__key)))}function Mt(e){const t=(function(o){let i=o;for(;jt(i);){const s=Qs(i);if(!jt(s))break;i=s}return i})(e.getLatest()),{direction:n}=t;if(X(t.origin))return Wn(t)?t:Ro(t.origin,n,n);const r=t.getAdjacentCaret();return jr(r)&&X(r.origin)?Ro(r.origin,n,Oo(n)):t}function $h(e){return Wn(e)&&e.offset!==Kn(e.origin,e.direction)}function yr(e,t){return e.direction===t?e:e.getFlipped()}function B1(e,t){return e.direction===t?e:Vr(yr(e.focus,t),yr(e.anchor,t))}function OA(e,t,n){let r=Nt(e,"next");for(let o=0;o<t;o++){const i=r.getAdjacentCaret();if(i===null)break;r=i}return yr(r,n)}function IA(e){const{origin:t,offset:n,direction:r}=e;if(n===Kn(t,r))return e.getSiblingCaret();if(n===Kn(t,Oo(r)))return ea(e.getSiblingCaret());const[o]=t.splitText(n);return X(o)||q(281),yr(tt(o,"next"),r)}function DA(e,t){return!0}function jA(e,{$copyElementNode:t=wA,$splitTextPointCaretNext:n=IA,rootMode:r="shadowRoot",$shouldSplit:o=DA}={}){if(Wn(e))return n(e);const i=e.getParentCaret(r);if(i){const{origin:s}=i;if(jt(e)&&(!s.canBeEmpty()||!o(s,"first")))return ea(i);const a=(function(l){const c=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(e);(a.length>0||s.canBeEmpty()&&o(s,"last"))&&i.insert(t(s).splice(0,0,a))}return i}function VA(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}const Wd=new Map;function z1(e){const t={};if(!e)return t;const n=e.split(";");for(const r of n)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(t[o.trim()]=i.trim())}return t}function Zm(e){let t=Wd.get(e);return t===void 0&&(t=z1(e),Wd.set(e,t)),t}function H1(e){const t=Bi().getElementByKey(e.getKey());if(t===null)return null;const n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function W1(e){return H1(ot(e)?e:e.getParentOrThrow())}function Jm(e){const t=W1(e);return t!==null&&t.direction==="rtl"}function K1(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!rr(t)&&r!==null){const[o,i]=r,s=e.isBackward(),a=o.getNode(),l=i.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[f,d]=Od(e),h=a.is(l),g=t.is(s?l:a),p=t.is(s?a:l);let m,x=0;h?(x=f>d?d:f,m=f>d?f:d):g?(x=s?d:f,m=void 0):p&&(x=0,m=s?f:d);const y=t.__text.slice(x,m);y!==t.__text&&(n==="clone"&&(t=TA(t)),t.__text=y)}}return t}function BA(e){const t=e.getStyle(),n=z1(t);Wd.set(t,n)}function U1(e){const t=G1(e);return t!==null&&t.writingMode==="vertical-rl"}function G1(e){const t=e.anchor.getNode();return B(t)?H1(t):W1(t)}function Qm(e,t){let n=U1(e)?!t:t;q1(e)&&(n=!n);const r=En(e.focus,n?"previous":"next");if($h(r))return!1;for(const o of Os(r)){if(jt(o))return!o.origin.isInline();if(!B(o.origin)){if(_e(o.origin))return!0;break}}return!1}function zA(e,t,n,r){e.modify(t?"extend":"move",n,r)}function q1(e){const t=G1(e);return t!==null&&t.direction==="rtl"}function ey(e,t,n){const r=q1(e);let o;o=U1(e)||r?!n:n,zA(e,t,o,"character")}function Y1(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const X1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,HA=X1&&"documentMode"in document?document.documentMode:null;!(!X1||!("InputEvent"in window)||HA)&&"getTargetRanges"in new window.InputEvent("input");function Z1(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}function Rn(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Qe(e,...t){const n=Z1(...t);n.length>0&&e.classList.add(...n)}function Un(e,...t){const n=Z1(...t);n.length>0&&e.classList.remove(...n)}function WA(e){return e?e.getAdjacentCaret():null}function KA(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function UA(e){const t=we(e,n=>B(n)&&!n.isInline());return B(t)||Y1(4,e.__key),t}function GA(e){const t=Y()||qn();let n;if(W(t))n=En(t.focus,"next");else{if(t!=null){const s=t.getNodes(),a=s[s.length-1];a&&(n=tt(a,"next"))}n=n||Nt(qe(),"previous").getFlipped().insert(ye())}const r=qA(e,n),o=Qs(r),i=jt(o)?Mt(o):r;return V1(I1(i)),e.getLatest()}function qA(e,t,n){let r=yr(t,"next");for(let o=r;o;o=jA(o,n))r=o;return Wn(r)&&Y1(283),r.insert(e.isInline()?ye().append(e):e),yr(tt(e.getLatest(),"next"),t.direction)}function kr(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function YA(e,t){Nt(e,"next").insert(t)}function J1(e,t){return Q1(e,t,null)}function Q1(e,t,n){let r=!1;for(const o of tw(e))t(o)?n!==null&&n(o):(r=!0,B(o)&&Q1(o,t,n||(i=>o.insertAfter(i))),o.remove());return r}function ew(e,t){const n=[],r=Array.from(e).reverse();for(let o=r.pop();o!==void 0;o=r.pop())if(t(o))n.push(o);else if(B(o))for(const i of tw(o))r.push(i);return n}function tw(e){return XA(Nt(e,"previous"))}function XA(e){return Fh({hasNext:jr,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function nw(){const[e]=it(),[t,n]=S.useState(!1),[r,o]=S.useState(!1),[i,s]=S.useState(!1),[a,l]=S.useState(!1),[c,u]=S.useState("left"),f=c==="left",d=c==="center",h=c==="right",g=S.useCallback(()=>{const x=Y();W(x)&&(n(x.hasFormat("bold")),o(x.hasFormat("italic")),s(x.hasFormat("underline")),l(x.hasFormat("strikethrough")))},[]),p=S.useCallback(x=>{u(x)},[]),m=S.useCallback(()=>{const x=Y();if(!W(x))return;const y=x.anchor.getNode(),v=y.getKey()==="root"?y:y.getTopLevelElementOrThrow();if(B(v)){const b=v.getFormatType();p(b)}},[p]);return S.useEffect(()=>{const x=Rn(e.registerCommand(It,(y,v)=>(e.read(()=>{g()}),!1),ar),e.registerCommand(hi,(y,v)=>(e.read(()=>{p(y)}),!1),ar),e.registerCommand(cr,(y,v)=>(e.read(()=>{g(),m()}),!1),ar));return()=>{x()}},[e,g,p,m]),{isBold:t,isItalic:r,isUnderline:i,isStrikethrough:a,alignment:c,isAlignLeft:f,isAlignCenter:d,isAlignRight:h}}var ie=(e=>(e.BOLD="font-bold",e.ITALIC="font-italic",e.UNDERLINE="font-underline",e.STRIKETHROUGH="font-strikethrough",e.ALIGN_LEFT="align-left",e.ALIGN_CENTER="align-center",e.ALIGN_RIGHT="align-right",e.LINK="insert-link",e.IMAGE="insert-image",e.TABLE="insert-table",e.BULLET_LIST="insert-bullet-list",e.NUMBERED_LIST="insert-numbered-list",e))(ie||{});function ZA(){const{isBold:e,isItalic:t,isUnderline:n,isStrikethrough:r,isAlignLeft:o,isAlignCenter:i,isAlignRight:s}=nw(),l=Us().toolbar.actions,{availableActions:c}=qk(),u=S.useMemo(()=>({id:ie.BOLD,IconComponent:jk,label:l.bold,isActive:e}),[l.bold,e]),f=S.useMemo(()=>({id:ie.ITALIC,IconComponent:Bk,label:l.italic,isActive:t}),[l.italic,t]),d=S.useMemo(()=>({id:ie.UNDERLINE,IconComponent:Gk,label:l.underline,isActive:n}),[l.underline,n]),h=S.useMemo(()=>({id:ie.STRIKETHROUGH,IconComponent:Kk,label:l.strikethrough,isActive:r}),[l.strikethrough,r]),g=S.useMemo(()=>({id:ie.ALIGN_LEFT,IconComponent:Ik,label:l.alignLeft,isActive:o}),[l.alignLeft,o]),p=S.useMemo(()=>({id:ie.ALIGN_CENTER,IconComponent:Ok,label:l.alignCenter,isActive:i}),[l.alignCenter,i]),m=S.useMemo(()=>({id:ie.ALIGN_RIGHT,IconComponent:Dk,label:l.alignRight,isActive:s}),[l.alignRight,s]),x=S.useMemo(()=>({id:ie.BULLET_LIST,IconComponent:Hk,label:l.bulletList}),[l.bulletList]),y=S.useMemo(()=>({id:ie.NUMBERED_LIST,IconComponent:Wk,label:l.numberedList}),[l.numberedList]),v=S.useMemo(()=>({id:ie.LINK,IconComponent:zk,label:l.link}),[l.link]),b=S.useMemo(()=>({id:ie.IMAGE,IconComponent:Vk,label:l.image}),[l.image]),w=S.useMemo(()=>({id:ie.TABLE,IconComponent:Uk,label:l.table}),[l.table]),_=S.useMemo(()=>({[ie.BOLD]:u,[ie.ITALIC]:f,[ie.UNDERLINE]:d,[ie.STRIKETHROUGH]:h,[ie.ALIGN_LEFT]:g,[ie.ALIGN_CENTER]:p,[ie.ALIGN_RIGHT]:m,[ie.BULLET_LIST]:x,[ie.NUMBERED_LIST]:y,[ie.LINK]:v,[ie.IMAGE]:b,[ie.TABLE]:w}),[u,f,d,h,g,p,m,x,y,v,b,w]),E=S.useMemo(()=>c.map(k=>k.map(P=>_[P])),[c,_]);return{availableActions:S.useMemo(()=>E.flat(),[E]),availableActionGroups:E}}const JA=Symbol.for("preact-signals");function Oh(){if(yi>1)return void yi--;let e,t=!1;for(;ws!==void 0;){let n=ws;for(ws=void 0,Kd++;n!==void 0;){const r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&ow(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(Kd=0,yi--,t)throw e}let Ne,ws;function ty(e){const t=Ne;Ne=void 0;try{return e()}finally{Ne=t}}let yi=0,Kd=0,Za=0;function ny(e){if(Ne===void 0)return;let t=e.n;return t===void 0||t.t!==Ne?(t={i:0,S:e,p:Ne.s,n:void 0,t:Ne,e:void 0,x:void 0,r:t},Ne.s!==void 0&&(Ne.s.n=t),Ne.s=t,e.n=t,32&Ne.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Ne.s,t.n=void 0,Ne.s.n=t,Ne.s=t),t):void 0}function Rt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function rw(e,t){return new Rt(e,t)}function ow(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function ry(e){for(let t=e.s;t!==void 0;t=t.n){const n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function iw(e){let t,n=e.s;for(;n!==void 0;){const r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}e.s=t}function Bo(e,t){Rt.call(this,void 0),this.x=e,this.s=void 0,this.g=Za-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function sw(e){const t=e.u;if(e.u=void 0,typeof t=="function"){yi++;const n=Ne;Ne=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Ih(e),r}finally{Ne=n,Oh()}}}function Ih(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,sw(e)}function QA(e){if(Ne!==this)throw new Error("Out-of-order effect");iw(this),Ne=e,this.f&=-2,8&this.f&&Ih(this),Oh()}function ei(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function eM(e,t){const n=new ei(e,t);try{n.c()}catch(o){throw n.d(),o}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}Rt.prototype.brand=JA,Rt.prototype.h=function(){return!0},Rt.prototype.S=function(e){const t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:ty(()=>{var n;(n=this.W)==null||n.call(this)}))},Rt.prototype.U=function(e){if(this.t!==void 0){const t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&ty(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Rt.prototype.subscribe=function(e){return eM(()=>{const t=this.value,n=Ne;Ne=void 0;try{e(t)}finally{Ne=n}},{name:"sub"})},Rt.prototype.valueOf=function(){return this.value},Rt.prototype.toString=function(){return this.value+""},Rt.prototype.toJSON=function(){return this.value},Rt.prototype.peek=function(){const e=Ne;Ne=void 0;try{return this.value}finally{Ne=e}},Object.defineProperty(Rt.prototype,"value",{get(){const e=ny(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(Kd>100)throw new Error("Cycle detected");this.v=e,this.i++,Za++,yi++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Oh()}}}}),Bo.prototype=new Rt,Bo.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Za))return!0;if(this.g=Za,this.f|=1,this.i>0&&!ow(this))return this.f&=-2,!0;const e=Ne;try{ry(this),Ne=this;const t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Ne=e,iw(this),this.f&=-2,!0},Bo.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}Rt.prototype.S.call(this,e)},Bo.prototype.U=function(e){if(this.t!==void 0&&(Rt.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Bo.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Bo.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=ny(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),ei.prototype.c=function(){const e=this.S();try{if(8&this.f||this.x===void 0)return;const t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},ei.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,sw(this),ry(this),yi++;const e=Ne;return Ne=this,QA.bind(this,e)},ei.prototype.N=function(){2&this.f||(this.f|=2,this.o=ws,ws=this)},ei.prototype.d=function(){this.f|=8,1&this.f||Ih(this)},ei.prototype.dispose=function(){this.d()};function tM(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}function Ie(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function aw(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){const n=e,r=t;for(const o in r)n[o]=aw(n[o],r[o]);return e}return t}const Dh=0,Ud=1,lw=2,eu=3,_a=4,zo=5,tu=6,es=7;function nu(e){return e.id===Dh}function cw(e){return e.id===lw}function nM(e){return(function(t){return t.id===Ud})(e)||Ie(305,String(e.id),String(Ud)),Object.assign(e,{id:lw})}const rM=new Set;let oM=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:Dh}}mergeConfigs(){let t=this.extension.config||{};const n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):VA;for(const r of this.configs)t=n(t,r);return t}init(t){const n=this.state;cw(n)||Ie(306,String(n.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(a,l,c){return Object.assign(a,{config:l,id:eu,registerState:c})})(n,this.mergeConfigs(),r);let s;this.state=i,this.extension.init&&(s=this.extension.init(t,i.config,r)),this.state=(function(a,l,c){return Object.assign(a,{id:_a,initResult:l,registerState:c})})(i,s,o)}build(t){const n=this.state;let r;n.id!==_a&&Ie(307,String(n.id),String(zo)),this.extension.build&&(r=this.extension.build(t,n.config,n.registerState));const o={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(i,s,a){return Object.assign(i,{id:zo,output:s,registerState:a})})(n,r,o)}register(t,n){this._signal=n;const r=this.state;r.id!==zo&&Ie(308,String(r.id),String(zo));const o=this.extension.register&&this.extension.register(t,r.config,r.registerState);return this.state=(function(i){return Object.assign(i,{id:tu})})(r),()=>{const i=this.state;i.id!==es&&Ie(309,String(r.id),String(es)),this.state=(function(s){return Object.assign(s,{id:zo})})(i),o&&o()}}afterRegistration(t){const n=this.state;let r;return n.id!==tu&&Ie(310,String(n.id),String(tu)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(o){return Object.assign(o,{id:es})})(n),r}getSignal(){return this._signal===void 0&&Ie(311),this._signal}getInitResult(){this.extension.init===void 0&&Ie(312,this.extension.name);const t=this.state;return(function(n){return n.id>=_a})(t)||Ie(313,String(t.id),String(_a)),t.initResult}getInitPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return(function(n){return n.id>=eu})(t)||Ie(314,String(t.id),String(eu)),{config:t.config}}getPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){const t=this.state;return(function(n){return n.id>=es})(t)||Ie(316,String(t.id),String(es)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||rM}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(n){return n.id>=zo})(t)||Ie(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}};const oy={tag:pi};function iM(){const e=qe();e.isEmpty()&&e.append(ye())}const sM={config:{setOptions:oy,updateOptions:oy},init:({$initialEditorState:e=iM})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){const o=r.getInitResult();if(!o.initialized){o.initialized=!0;const{$initialEditorState:i}=o;if(cA(i))e.setEditorState(i,n);else if(typeof i=="function")e.update(()=>{i(e)},t);else if(i&&(typeof i=="string"||typeof i=="object")){const s=e.parseEditorState(i);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Vi,un,Oi,Ii,$o]},iy=Symbol.for("@lexical/extension/LexicalBuilder");function sy(){}function aM(e){throw e}function Ta(e){return Array.isArray(e)?e:[e]}const ru="0.39.0+prod.esm";let lM=class Ja{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=ru,this.roots=t;for(const n of t)this.addExtension(n)}static fromExtensions(t){const n=[Ta(sM)];for(const r of t)n.push(Ta(r));return new Ja(n)}static maybeFromEditor(t){const n=t[iy];return n&&(n.PACKAGE_VERSION!==ru&&Ie(292,n.PACKAGE_VERSION,ru),n instanceof Ja||Ie(293)),n}static fromEditor(t){const n=Ja.maybeFromEditor(t);return n===void 0&&Ie(294),n}constructEditor(){const{$initialEditorState:t,onError:n,...r}=this.buildCreateEditorArgs(),o=Object.assign(x1({...r,...n?{onError:i=>{n(i,o)}}:{}}),{[iy]:this});for(const i of this.sortedExtensionReps())i.build(o);return o}buildEditor(){let t=sy;function n(){try{t()}finally{t=sy}}const r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=Rn(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Ie(295,t.name),n}addEdge(t,n,r){const o=this.outgoingConfigEdges.get(t);o?o.set(n,r):this.outgoingConfigEdges.set(t,new Map([[n,r]]));const i=this.incomingEdges.get(n);i?i.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Ie(296);const n=Ta(t),[r]=n;typeof r.name!="string"&&Ie(297,typeof r.name);let o=this.extensionNameMap.get(r.name);if(o!==void 0&&o.extension!==r&&Ie(298,r.name),!o){o=new oM(this,r),this.extensionNameMap.set(r.name,o);const i=this.conflicts.get(r.name);typeof i=="string"&&Ie(299,r.name,i);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&Ie(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const a=Ta(s);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[s,a]of r.peerDependencies||[])this.addEdge(r.name,s,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],n=(r,o)=>{let i=r.state;if(cw(i))return;const s=r.extension.name;var a;nu(i)||Ie(300,s,o||"[unknown]"),nu(a=i)||Ie(304,String(a.id),String(Dh)),i=Object.assign(a,{id:Ud}),r.state=i;const l=this.outgoingConfigEdges.get(s);if(l)for(const c of l.keys()){const u=this.extensionNameMap.get(c);u&&n(u,s)}i=nM(i),r.state=i,t.push(r)};for(const r of this.extensionNameMap.values())nu(r.state)&&n(r);for(const r of t)for(const[o,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){const s=this.extensionNameMap.get(o);if(s)for(const a of i)s.configs.add(a)}for(const[r,...o]of this.roots)if(o.length>0){const i=this.extensionNameMap.get(r.name);i===void 0&&Ie(301,r.name);for(const s of o)i.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const n=this.sortedExtensionReps(),r=new AbortController,o=[()=>r.abort()],i=r.signal;for(const s of n){const a=s.register(t,i);a&&o.push(a)}for(const s of n){const a=s.afterRegistration(t);a&&o.push(a)}return Rn(...o)}buildCreateEditorArgs(){const t={},n=new Set,r=new Map,o=new Map,i={},s={},a=this.sortedExtensionReps();for(const u of a){const{extension:f}=u;if(f.onError!==void 0&&(t.onError=f.onError),f.disableEvents!==void 0&&(t.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(t.parentEditor=f.parentEditor),f.editable!==void 0&&(t.editable=f.editable),f.namespace!==void 0&&(t.namespace=f.namespace),f.$initialEditorState!==void 0&&(t.$initialEditorState=f.$initialEditorState),f.nodes)for(const d of tM(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&Ie(302,f.name,d.replace.name,h.extension.name),r.set(d.replace,u)}n.add(d)}if(f.html){if(f.html.export)for(const[d,h]of f.html.export.entries())o.set(d,h);f.html.import&&Object.assign(i,f.html.import)}f.theme&&aw(s,f.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);const l=Object.keys(i).length>0,c=o.size>0;(l||c)&&(t.html={},l&&(t.html.import=i),c&&(t.html.export=o));for(const u of a)u.init(t);return t.onError||(t.onError=aM),t}},jh=class uw extends Ys{static getType(){return"horizontalrule"}static clone(t){return new uw(t.__key)}static importJSON(t){return dw().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:cM,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){const n=document.createElement("hr");return Qe(n,t.theme.hr),n}getTextContent(){return`
45
+ `}isInline(){return!1}updateDOM(){return!1}};function cM(){return{node:dw()}}function dw(){return O1(jh)}function uM(e){return e instanceof jh}function Ar(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Gd(e){let t=1,n=e.getParent();for(;n!=null;){if(ke(n)){const r=n.getParent();if(pe(r)){t++,n=r.getParent();continue}Ar(40)}return t}return t}function qd(e){let t=e.getParent();pe(t)||Ar(40);let n=t;for(;n!==null;)n=n.getParent(),pe(n)&&(t=n);return t}function fw(e){let t=[];const n=e.getChildren().filter(ke);for(let r=0;r<n.length;r++){const o=n[r],i=o.getFirstChild();pe(i)?t=t.concat(fw(i)):t.push(o)}return t}function On(e){return ke(e)&&pe(e.getFirstChild())}function ay(e){return Gt().append(e)}function hw(e,t){return ke(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function ly(e){const t=Y();if(t!==null){let n=t.getNodes();if(W(t)){const o=t.getStartEndPoints();o===null&&Ar(143);const[i]=o,s=i.getNode(),a=s.getParent();if(pt(s)){const l=s.getFirstChild();if(l)n=l.selectStart().getNodes();else{const c=ye();s.append(c),n=c.select().getNodes()}}else if(hw(s,n)){const l=Vt(e);if(pt(a)){s.replace(l);const c=Gt();B(s)&&(c.setFormat(s.getFormatType()),c.setIndent(s.getIndent())),l.append(c)}else if(ke(s)){const c=s.getParentOrThrow();ko(l,c.getChildren()),c.replace(l)}return}}const r=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(B(i)&&i.isEmpty()&&!ke(i)&&!r.has(i.getKey())){cy(i,e);continue}let s=_1(i)?i.getParent():ke(i)&&i.isEmpty()?i:null;for(;s!=null;){const a=s.getKey();if(pe(s)){if(!r.has(a)){const l=Vt(e);ko(l,s.getChildren()),s.replace(l),r.add(a)}break}{const l=s.getParent();if(pt(l)&&!r.has(a)){r.add(a),cy(s,e);break}s=l}}}}}function ko(e,t){e.splice(e.getChildrenSize(),0,t)}function cy(e,t){if(pe(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),o=Gt();let i;if(ko(o,e.getChildren()),pe(n)&&t===n.getListType())n.append(o),pe(r)&&t===r.getListType()&&(ko(n,r.getChildren()),r.remove()),i=n;else if(pe(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(o),i=r;else{const s=Vt(t);s.append(o),e.replace(s),i=s}return o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),e.remove(),i}function Vh(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&On(n)&&On(r)&&(Vh(n.getFirstChild(),r.getFirstChild()),r.remove());const o=t.getChildren();o.length>0&&e.append(...o),t.remove()}function dM(){const e=Y();if(W(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(hw(r,n))t.add(qd(r));else for(let o=0;o<n.length;o++){const i=n[o];if(_1(i)){const s=KA(i,Yr);s!=null&&t.add(qd(s))}}for(const o of t){let i=o;const s=fw(o);for(const a of s){const l=ye().setTextStyle(e.style).setTextFormat(e.format);ko(l,a.getChildren()),i.insertAfter(l),i=l,a.__key===e.anchor.key&&bn(e.anchor,Mt(Nt(l,"next"))),a.__key===e.focus.key&&bn(e.focus,Mt(Nt(l,"next"))),a.remove()}o.remove()}}}function gw(e){const t=e.getListType()!=="check";let n=e.getStart();for(const r of e.getChildren())ke(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),pe(r.getFirstChild())||n++)}function fM(e){const t=new Set;if(On(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),o=e.getPreviousSibling();if(On(r)&&On(o)){const i=o.getFirstChild();if(pe(i)){i.append(e);const s=r.getFirstChild();pe(s)&&(ko(i,s.getChildren()),r.remove(),t.add(r.getKey()))}}else if(On(r)){const i=r.getFirstChild();if(pe(i)){const s=i.getFirstChild();s!==null&&s.insertBefore(e)}}else if(On(o)){const i=o.getFirstChild();pe(i)&&i.append(e)}else if(pe(n)){const i=Gt().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=Vt(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());i.append(s),s.append(e),o?o.insertAfter(i):r?r.insertBefore(i):n.append(i)}}function hM(e){if(On(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(pe(n?n.getParent():void 0)&&ke(n)&&pe(t)){const r=t?t.getFirstChild():void 0,o=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(o))n.insertAfter(e),t.isEmpty()&&n.remove();else{const i=t.getListType(),s=Gt(),a=Vt(i);s.append(a),e.getPreviousSiblings().forEach(u=>a.append(u));const l=Gt(),c=Vt(i);l.append(c),ko(c,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(e)}}}function gM(){const e=Y();if(!W(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!ke(t)||t.getChildrenSize()!==0)return!1;const n=qd(t),r=t.getParent();pe(r)||Ar(40);const o=r.getParent();let i;if(pt(o))i=ye(),n.insertAfter(i);else{if(!ke(o))return!1;i=Gt(),o.insertAfter(i)}i.setTextStyle(e.style).setTextFormat(e.format).select();const s=t.getNextSiblings();if(s.length>0){const a=Vt(r.getListType());if(ke(i)){const l=Gt();l.append(a),i.insertAfter(l)}else i.insertAfter(a);a.append(...s)}return(function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const c=l.getParent();if(c==null||!ke(c)&&!pe(c))break;l=c}l.remove()})(t),!0}function _l(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}let Yr=class extends St{__value;__checked;$config(){return this.config("listitem",{$transform:t=>{if(t.__checked==null)return;const n=t.getParent();pe(n)&&n.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0)},extends:St,importDOM:{li:()=>({conversion:pM,priority:0})}})}constructor(t=1,n=void 0,r){super(r),this.__value=t===void 0?1:t,this.__checked=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__value=t.__value,this.__checked=t.__checked}createDOM(t){const n=document.createElement("li");return this.updateListItemDOM(null,n,t),n}updateListItemDOM(t,n,r){(function(s,a,l){const c=a.getParent();!pe(c)||c.getListType()!=="check"||pe(a.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||s.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(n,this,t),n.value=this.__value,(function(s,a,l){const c=[],u=[],f=a.list,d=f?f.listitem:void 0;let h;if(f&&f.nested&&(h=f.nested.listitem),d!==void 0&&c.push(..._l(d)),f){const g=l.getParent(),p=pe(g)&&g.getListType()==="check",m=l.getChecked();p&&!m||u.push(f.listitemUnchecked),p&&m||u.push(f.listitemChecked),p&&c.push(m?f.listitemChecked:f.listitemUnchecked)}if(h!==void 0){const g=_l(h);l.getChildren().some(p=>pe(p))?c.push(...g):u.push(...g)}u.length>0&&Un(s,...u),c.length>0&&Qe(s,...c)})(n,r.theme,this);const o=t?t.__style:"",i=this.__style;o!==i&&(i===""?n.removeAttribute("style"):n.style.cssText=i),(function(s,a,l){const c=Zm(a.__textStyle);for(const u in c)s.style.setProperty(`--listitem-marker-${u}`,c[u]);if(l)for(const u in Zm(l.__textStyle))u in c||s.style.removeProperty(`--listitem-marker-${u}`)})(n,this,t)}updateDOM(t,n,r){const o=n;return this.updateListItemDOM(t,o,r),!1}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const n=this.createDOM(t._config),r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();return o&&(n.dir=o),{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let n=0;n<t.length;n++){const r=t[n];if(B(r)&&this.canMergeWith(r)){const o=r.getChildren();this.append(...o),r.remove()}else super.append(r)}return this}replace(t,n){if(ke(t))return super.replace(t);this.setIndent(0);const r=this.getParentOrThrow();if(!pe(r))return t;if(r.__first===this.getKey())r.insertBefore(t);else if(r.__last===this.getKey())r.insertAfter(t);else{const o=Vt(r.getListType());let i=this.getNextSibling();for(;i;){const s=i;i=i.getNextSibling(),o.append(s)}r.insertAfter(t),t.insertAfter(o)}return n&&(B(t)||Ar(139),this.getChildren().forEach(o=>{t.append(o)})),this.remove(),r.getChildrenSize()===0&&r.remove(),t}insertAfter(t,n=!0){const r=this.getParentOrThrow();if(pe(r)||Ar(39),ke(t))return super.insertAfter(t,n);const o=this.getNextSiblings();if(r.insertAfter(t,n),o.length!==0){const i=Vt(r.getListType());o.forEach(s=>i.append(s)),t.insertAfter(i,n)}return t}remove(t){const n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(t),n&&r&&On(n)&&On(r)&&(Vh(n.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(t,n=!0){const r=Gt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,n),r}collapseAtStart(t){const n=ye();this.getChildren().forEach(s=>n.append(s));const r=this.getParentOrThrow(),o=r.getParentOrThrow(),i=ke(o);if(r.getChildrenSize()===1)if(i)r.remove(),o.select();else{r.insertBefore(n),r.remove();const s=t.anchor,a=t.focus,l=n.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(l,s.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const n=this.getWritable();return n.__value=t,n}getChecked(){const t=this.getLatest();let n;const r=this.getParent();return pe(r)&&(n=r.getListType()),n==="check"?!!t.__checked:void 0}setChecked(t){const n=this.getWritable();return n.__checked=t,n}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let n=t.getParentOrThrow(),r=0;for(;ke(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(t){typeof t!="number"&&Ar(117),(t=Math.floor(t))>=0||Ar(199);let n=this.getIndent();for(;n!==t;)n<t?(fM(this),n++):(hM(this),n--);return this}canInsertAfter(t){return ke(t)}canReplaceWith(t){return ke(t)}canMergeWith(t){return ke(t)||qr(t)}extractWithChild(t,n){if(!W(n))return!1;const r=n.anchor.getNode(),o=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Vt("bullet")}canMergeWhenEmpty(){return!0}};function pM(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return uy(n)}if(e.classList.contains("joplin-checkbox")){for(const n of e.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return uy(n.children[0])}const t=e.getAttribute("aria-checked");return{node:Gt(t==="true"||t!=="false"&&void 0)}}function uy(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:Gt(e.hasAttribute("checked"))}}function Gt(e){return _t(new Yr(void 0,e))}function ke(e){return e instanceof Yr}let Io=class extends St{__tag;__start;__listType;$config(){return this.config("list",{$transform:t=>{(function(n){const r=n.getNextSibling();pe(r)&&n.getListType()===r.getListType()&&Vh(n,r)})(t),gw(t)},extends:St,importDOM:{ol:()=>({conversion:fy,priority:0}),ul:()=>({conversion:fy,priority:0})}})}constructor(t="number",n=1,r){super(r);const o=yM[t]||t;this.__listType=o,this.__tag=o==="number"?"ol":"ul",this.__start=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__listType=t.__listType,this.__tag=t.__tag,this.__start=t.__start}getTag(){return this.getLatest().__tag}setListType(t){const n=this.getWritable();return n.__listType=t,n.__tag=t==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t){const n=this.getWritable();return n.__start=t,n}createDOM(t,n){const r=this.__tag,o=document.createElement(r);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,dy(o,t.theme,this),o}updateDOM(t,n,r){return t.__tag!==this.__tag||t.__listType!==this.__listType||(dy(n,r.theme,this),!1)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const n=this.createDOM(t._config,t);return Be(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t,n,r){let o=r;for(let i=0;i<r.length;i++){const s=r[i];ke(s)||(o===r&&(o=[...r]),o[i]=Gt().append(!B(s)||pe(s)||s.isInline()?s:Fe(s.getTextContent())))}return super.splice(t,n,o)}extractWithChild(t){return ke(t)}};function dy(e,t,n){const r=[],o=[],i=t.list;if(i!==void 0){const s=i[`${n.__tag}Depth`]||[],a=Gd(n)-1,l=a%s.length,c=s[l],u=i[n.__tag];let f;const d=i.nested,h=i.checklist;if(d!==void 0&&d.list&&(f=d.list),u!==void 0&&r.push(u),h!==void 0&&n.__listType==="check"&&r.push(h),c!==void 0){r.push(..._l(c));for(let g=0;g<s.length;g++)g!==l&&o.push(n.__tag+g)}if(f!==void 0){const g=_l(f);a>1?r.push(...g):o.push(...g)}}o.length>0&&Un(e,...o),r.length>0&&Qe(e,...r)}function mM(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(ke(r)){t.push(r);const o=r.getChildren();o.length>1&&o.forEach(i=>{pe(i)&&t.push(ay(i))})}else t.push(ay(r))}return t}function fy(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=Vt("number",e.start):t==="ul"&&(n=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const o of r.childNodes)if(Be(o)&&o.hasAttribute("aria-checked"))return!0;return!1})(e)?Vt("check"):Vt("bullet")),{after:mM,node:n}}const yM={ol:"number",ul:"bullet"};function Vt(e="number",t=1){return _t(new Io(e,t))}function pe(e){return e instanceof Io}const vM=le("UPDATE_LIST_START_COMMAND"),pw=le("INSERT_UNORDERED_LIST_COMMAND"),mw=le("INSERT_ORDERED_LIST_COMMAND"),xM=le("REMOVE_LIST_COMMAND");function bM(e){return Rn(e.registerCommand(mw,()=>(ly("number"),!0),ar),e.registerCommand(vM,t=>{const{listNodeKey:n,newStart:r}=t,o=Le(n);return!!pe(o)&&(o.getListType()==="number"&&(o.setStart(r),gw(o)),!0)},ar),e.registerCommand(pw,()=>(ly("bullet"),!0),ar),e.registerCommand(xM,()=>(dM(),!0),ar),e.registerCommand(Co,()=>gM(),ar),e.registerNodeTransform(Yr,t=>{const n=t.getFirstChild();if(n){if(X(n)){const r=n.getStyle(),o=n.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==o&&t.setTextFormat(o)}}else{const r=Y();W(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(un,t=>{const n=t.getParent();if(ke(n)&&t.is(n.getFirstChild())){const r=t.getStyle(),o=t.getFormat();r===n.getTextStyle()&&o===n.getTextFormat()||n.setTextStyle(r).setTextFormat(o)}}))}function wM(e){const t=n=>{const r=n.getParent();if(pe(n.getFirstChild())||!pe(r))return;const o=we(n,i=>ke(i)&&pe(i.getParent())&&ke(i.getPreviousSibling()));if(o===null&&n.getIndent()>0)n.setIndent(0);else if(ke(o)){const i=o.getPreviousSibling();if(ke(i)){const s=(function(l){let c=l,u=c.getFirstChild();for(;pe(u);){const f=u.getLastChild();if(!ke(f))break;c=f,u=c.getFirstChild()}return c})(i),a=s.getParent();if(pe(a)){const l=Gd(a);l+1<Gd(r)&&n.setIndent(l)}}}};return e.registerNodeTransform(Io,n=>{const r=[n];for(;r.length>0;){const o=r.shift();if(pe(o)){for(const i of o.getChildren())if(ke(i)){t(i);const s=i.getFirstChild();pe(s)&&r.push(s)}}}})}function CM(e,t){const n=S1(t)?t.body.childNodes:t.childNodes;let r=[];const o=[];for(const i of n)if(!vw.has(i.nodeName)){const s=xw(i,e,o,!1);s!==null&&(r=r.concat(s))}return(function(i){for(const s of i)s.getNextSibling()instanceof bh&&s.insertAfter(Tn());for(const s of i){const a=s.getChildren();for(const l of a)s.insertBefore(l);s.remove()}})(o),r}function SM(e,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=qe().getChildren();for(let o=0;o<r.length;o++)yw(e,r[o],n,t);return n.innerHTML}function yw(e,t,n,r=null){let o=r===null||t.isSelected(r);const i=B(t)&&t.excludeFromCopy("html");let s=t;r!==null&&X(t)&&(s=K1(r,t,"clone"));const a=B(s)?s.getChildren():[],l=Ch(e,s.getType());let c;c=l&&l.exportDOM!==void 0?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let h=0;h<a.length;h++){const g=a[h],p=yw(e,g,d,r);!o&&B(t)&&p&&t.extractWithChild(g,r,"html")&&(o=!0)}if(o&&!i){if((Be(u)||zd(u))&&u.append(d),n.append(u),f){const h=f.call(s,u);h&&(zd(u)?u.replaceChildren(h):u.replaceWith(h))}}else n.append(d);return o}const vw=new Set(["STYLE","SCRIPT"]);function xw(e,t,n,r,o=new Map,i){let s=[];if(vw.has(e.nodeName))return s;let a=null;const l=(function(g,p){const{nodeName:m}=g,x=p._htmlConversions.get(m.toLowerCase());let y=null;if(x!==void 0)for(const v of x){const b=v(g);b!==null&&(y===null||(y.priority||0)<=(b.priority||0))&&(y=b)}return y!==null?y.conversion:null})(e,t),c=l?l(e):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(const[,p]of o)if(a=p(a,i),!a)break;a&&s.push(...Array.isArray(g)?g:[a])}c.forChild!=null&&o.set(e.nodeName,c.forChild)}const f=e.childNodes;let d=[];const h=(a==null||!pt(a))&&(a!=null&&Id(a)||r);for(let g=0;g<f.length;g++)d.push(...xw(f[g],t,n,h,new Map(o),a));return u!=null&&(d=u(d)),Sl(e)&&(d=_M(e,d,h?()=>{const g=new bh;return n.push(g),g}:ye)),a==null?d.length>0?s=s.concat(d):Sl(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Hd(g.nextSibling)&&Hd(g.previousSibling)})(e)&&(s=s.concat(Tn())):B(a)&&a.append(...d),s}function _M(e,t,n){const r=e.style.textAlign,o=[];let i=[];for(let s=0;s<t.length;s++){const a=t[s];if(Id(a))r&&!a.getFormat()&&a.setFormat(r),o.push(a);else if(i.push(a),s===t.length-1||s<t.length-1&&Id(t[s+1])){const l=n();l.setFormat(r),l.append(...i),o.push(l),i=[]}}return o}function Tl(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function TM(e,t=Y()){return t==null&&Tl(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?"":SM(e,t)}function EM(e,t=Y()){return t==null&&Tl(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(RM(e,t))}function hy(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===n._config.namespace&&Array.isArray(a.nodes))return gy(n,kM(a.nodes),t)}catch(a){console.error(a)}const o=e.getData("text/html"),i=e.getData("text/plain");if(o&&i!==o)try{const a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(l):l})(o),"text/html");return gy(n,CM(n,a),t)}catch(a){console.error(a)}const s=i||e.getData("text/uri-list");if(s!=null)if(W(t)){const a=s.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){const c=Y();if(W(c)){const u=a[l];u===`
46
46
  `||u===`\r
47
- `?c.insertParagraph():u===" "?c.insertNodes([Oi()]):c.insertText(u)}}}else t.insertRawText(s)}function dy(e,t,n){e.dispatchCommand(rh,{nodes:t,selection:n})||(n.insertNodes(t),(function(r){if(W(r)&&r.isCollapsed()){const o=r.anchor;let i=null;const s=En(o,"previous");if(s)if(Hn(s))i=s.origin;else{const a=Vr(s,Nt(qe(),"next").getFlipped());for(const l of a){if(X(l.origin)){i=l.origin;break}if(B(l.origin)&&!l.origin.isInline())break}}if(i&&X(i)){const a=i.getFormat(),l=i.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}})(n))}function vw(e,t,n,r=[]){let o=t===null||n.isSelected(t);const i=B(n)&&n.excludeFromCopy("html");let s=n;t!==null&&X(s)&&(s=Hb(t,s,"clone"));const a=B(s)?s.getChildren():[],l=(function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Cl(58,f.name),B(c)){const d=u.children;Array.isArray(d)||Cl(59,f.name)}return u})(s);X(s)&&s.getTextContentSize()===0&&(o=!1);for(let c=0;c<a.length;c++){const u=a[c],f=vw(e,t,u,l.children);!o&&B(n)&&f&&n.extractWithChild(u,t,"clone")&&(o=!0)}if(o&&!i)r.push(l);else if(Array.isArray(l.children))for(let c=0;c<l.children.length;c++){const u=l.children[c];r.push(u)}return o}function xM(e,t){const n=[],r=qe().getChildren();for(let o=0;o<r.length;o++)vw(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function bM(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=e3(r);X(o)&&F3(o),t.push(o)}return t}let Bo=null;async function Kd(e,t,n){if(Bo!==null)return!1;if(t!==null)return new Promise((c,u)=>{e.update(()=>{c(fy(e,t,n))})});const r=e.getRootElement(),o=e._window||window,i=o.document,s=Ft(o);if(r===null||s===null)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),s.removeAllRanges(),s.addRange(l),new Promise((c,u)=>{const f=e.registerCommand(Bl,d=>(Rr(d,ClipboardEvent)&&(f(),Bo!==null&&(o.clearTimeout(Bo),Bo=null),c(fy(e,d,n))),!0),r3);Bo=o.setTimeout(()=>{f(),Bo=null,c(!1)},50),i.execCommand("copy"),a.remove()})}function fy(e,t,n){if(n===void 0){const o=Ft(e._window),i=Y();if(!i||i.isCollapsed()||!o)return!1;const s=o.anchorNode,a=o.focusNode;if(s!==null&&a!==null&&!qs(e,s,a))return!1;n=bw(i)}t.preventDefault();const r=t.clipboardData;return r!==null&&(wM(r,n),!0)}const xw=[["text/html",yM],["application/x-lexical-editor",vM]];function bw(e=Y()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=Vi();for(const[r,o]of xw){const i=o(n,e);i!==null&&(t[r]=i)}}return t}function wM(e,t){for(const[n]of xw)t[n]===void 0&&e.setData(n,"");for(const n in t){const r=t[n];r!==void 0&&e.setData(n,r)}}function CM(e){const t=window.location.origin,n=r=>{if(r.origin!==t)return;const o=e.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const a=s.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[c,u,f,d,h]=l;e.update(()=>{const g=Y();if(W(g)){const p=g.anchor;let m=p.getNode(),x=0,y=0;if(X(m)&&c>=0&&u>=0&&(x=c,y=c+u,g.setTextNodeRange(m,x,m,y)),x===y&&f===""||(g.insertRawText(f),m=p.getNode()),X(m)){x=d,y=d+h;const v=m.getTextContentSize();x=x>v?v:x,y=y>v?v:y,g.setTextNodeRange(m,x,m,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}function hy(e,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const Oo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,SM=Oo&&"documentMode"in document?document.documentMode:null,_M=Oo&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),TM=!(!Oo||!("InputEvent"in window)||SM)&&"getTargetRanges"in new window.InputEvent("input"),EM=Oo&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),gy=Oo&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,RM=Oo&&/^(?=.*Chrome).*/i.test(navigator.userAgent),kM=Oo&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&_M&&!RM,py=le("DRAG_DROP_PASTE_FILE");let Jl=class ww extends St{static getType(){return"quote"}static clone(t){return new ww(t.__key)}createDOM(t){const n=document.createElement("blockquote");return Qe(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:t=>({conversion:AM,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return Dh().updateFromJSON(t)}insertNewAfter(t,n){const r=me(),o=this.getDirection();return r.setDirection(o),this.insertAfter(r,n),r}collapseAtStart(){const t=me();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function Dh(){return _t(new Jl)}function Ud(e){return e instanceof Jl}let Ql=class Cw extends St{__tag;static getType(){return"heading"}static clone(t){return new Cw(t.__tag,t.__key)}constructor(t,n){super(n),this.__tag=t}getTag(){return this.__tag}setTag(t){const n=this.getWritable();return this.__tag=t,n}createDOM(t){const n=this.__tag,r=document.createElement(n),o=t.theme.heading;if(o!==void 0){const i=o[n];Qe(r,i)}return r}updateDOM(t,n,r){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:zo,priority:0}),h2:t=>({conversion:zo,priority:0}),h3:t=>({conversion:zo,priority:0}),h4:t=>({conversion:zo,priority:0}),h5:t=>({conversion:zo,priority:0}),h6:t=>({conversion:zo,priority:0}),p:t=>{const n=t.firstChild;return n!==null&&my(n)?{conversion:()=>({node:null}),priority:3}:null},span:t=>my(t)?{conversion:n=>({node:co("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return co(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,n=!0){const r=t?t.anchor.offset:0,o=this.getLastDescendant(),i=!o||t&&t.anchor.key===o.getKey()&&r===o.getTextContentSize()||!t?me():co(this.getTag()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,n),r===0&&!this.isEmpty()&&t){const a=me();a.select(),this.replace(a,!0)}return i}collapseAtStart(){const t=this.isEmpty()?me():co(this.getTag());return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}extractWithChild(){return!0}};function my(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function zo(e){const t=e.nodeName.toLowerCase();let n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=co(t),e.style!==null&&(Rh(e,n),n.setFormat(e.style.textAlign))),{node:n}}function AM(e){const t=Dh();return e.style!==null&&(t.setFormat(e.style.textAlign),Rh(e,t)),{node:t}}function co(e="h1"){return _t(new Ql(e))}function Sw(e){return e instanceof Ql}function Sa(e){let t=null;if(Rr(e,DragEvent)?t=e.dataTransfer:Rr(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function yy(e){const t=Y();if(!W(t))return!1;const n=new Set,r=t.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(n.has(s))continue;const a=be(i,c=>B(c)&&!c.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!n.has(l)&&(n.add(l),e(a))}return n.size>0}function vy(e){const t=Ht(e);return Se(t)}function eu(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function MM(e){return Rn(e.registerCommand(Vl,t=>{const n=Y();return!!bt(n)&&(n.clear(),!0)},xe),e.registerCommand(Pr,t=>{const n=Y();return W(n)?(n.deleteCharacter(t),!0):!!bt(n)&&(n.deleteNodes(),!0)},xe),e.registerCommand(Si,t=>{const n=Y();return!!W(n)&&(n.deleteWord(t),!0)},xe),e.registerCommand(wo,t=>{const n=Y();return!!W(n)&&(n.deleteLine(t),!0)},xe),e.registerCommand(go,t=>{const n=Y();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const r=t.dataTransfer;if(r!=null)uy(r,n,e);else if(W(n)){const o=t.data;return o&&n.insertText(o),!0}}return!0},xe),e.registerCommand(Sd,()=>{const t=Y();return!!W(t)&&(t.removeText(),!0)},xe),e.registerCommand(It,t=>{const n=Y();return!!W(n)&&(n.formatText(t),!0)},xe),e.registerCommand(di,t=>{const n=Y();if(!W(n)&&!bt(n))return!1;const r=n.getNodes();for(const o of r){const i=be(o,s=>B(s)&&!s.isInline());i!==null&&i.setFormat(t)}return!0},xe),e.registerCommand(ui,t=>{const n=Y();return!!W(n)&&(n.insertLineBreak(t),!0)},xe),e.registerCommand(bo,()=>{const t=Y();return!!W(t)&&(t.insertParagraph(),!0)},xe),e.registerCommand(EA,()=>(gh([Oi()]),!0),xe),e.registerCommand(RA,()=>yy(t=>{const n=t.getIndent();t.setIndent(n+1)}),xe),e.registerCommand(fm,()=>yy(t=>{const n=t.getIndent();n>0&&t.setIndent(Math.max(0,n-1))}),xe),e.registerCommand(ah,t=>{const n=Y();if(bt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectPrevious(),!0}else if(W(n)){const r=$d(n.focus,!0);if(!t.shiftKey&&Se(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),t.preventDefault(),!0}return!1},xe),e.registerCommand(lh,t=>{const n=Y();if(bt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectNext(0,0),!0}else if(W(n)){if((function(o){const i=o.focus;return i.key==="root"&&i.offset===qe().getChildrenSize()})(n))return t.preventDefault(),!0;const r=$d(n.focus,!1);if(!t.shiftKey&&Se(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),t.preventDefault(),!0}return!1},xe),e.registerCommand(sh,t=>{const n=Y();if(bt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),Ym(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!W(n))return!1;if(Xm(n,!0)){const r=t.shiftKey;return t.preventDefault(),Zm(n,r,!0),!0}return!1},xe),e.registerCommand(ih,t=>{const n=Y();if(bt(n)){const o=n.getNodes();if(o.length>0)return t.preventDefault(),Ym(o[0])?o[0].selectPrevious():o[0].selectNext(0,0),!0}if(!W(n))return!1;const r=t.shiftKey;return!!Xm(n,!1)&&(t.preventDefault(),Zm(n,r,!1),!0)},xe),e.registerCommand(jl,t=>{if(vy(t.target))return!1;const n=Y();if(W(n)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:o}=r;if(o.offset!==0)return!1;const i=o.getNode();if(ot(i))return!1;const s=D3(i);return s.getIndent()>0&&(s.is(i)||i.is(s.getFirstDescendant()))})(n))return t.preventDefault(),e.dispatchCommand(fm,void 0);if(gy&&navigator.language==="ko-KR")return!1}else if(!bt(n))return!1;return t.preventDefault(),e.dispatchCommand(Pr,!0)},xe),e.registerCommand(uh,t=>{if(vy(t.target))return!1;const n=Y();return!(!W(n)&&!bt(n))&&(t.preventDefault(),e.dispatchCommand(Pr,!1))},xe),e.registerCommand(fl,t=>{const n=Y();if(!W(n))return!1;if(eu(n),t!==null){if((gy||EM||kM)&&TM)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(ui,!1)}return e.dispatchCommand(bo,void 0)},xe),e.registerCommand(ch,()=>{const t=Y();return!!W(t)&&(e.blur(),!0)},xe),e.registerCommand(K1,t=>{const[,n]=Sa(t);if(n.length>0){const o=hy(t.clientX,t.clientY);if(o!==null){const{offset:i,node:s}=o,a=Ht(s);if(a!==null){const l=Kl();if(X(a))l.anchor.set(a.getKey(),i,"text"),l.focus.set(a.getKey(),i,"text");else{const u=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;l.anchor.set(u,f,"element"),l.focus.set(u,f,"element")}const c=As(l);Ge(c)}e.dispatchCommand(py,n)}return t.preventDefault(),!0}const r=Y();return!!W(r)},xe),e.registerCommand(U1,t=>{const[n]=Sa(t),r=Y();return!(n&&!W(r))},xe),e.registerCommand(G1,t=>{const[n]=Sa(t),r=Y();if(n&&!W(r))return!1;const o=hy(t.clientX,t.clientY);if(o!==null){const i=Ht(o.node);Se(i)&&t.preventDefault()}return!0},xe),e.registerCommand(_d,()=>(l3(),!0),xe),e.registerCommand(Bl,t=>(Kd(e,Rr(t,ClipboardEvent)?t:null),!0),xe),e.registerCommand(zl,t=>((async function(n,r){await Kd(r,Rr(n,ClipboardEvent)?n:null),r.update(()=>{const o=Y();W(o)?o.removeText():bt(o)&&o.getNodes().forEach(i=>i.remove())})})(t,e),!0),xe),e.registerCommand(oh,t=>{const[,n,r]=Sa(t);return n.length>0&&!r?(e.dispatchCommand(py,n),!0):xn(t.target)&&bh(t.target)?!1:Y()!==null&&((function(o,i){o.preventDefault(),i.update(()=>{const s=Y(),a=Rr(o,InputEvent)||Rr(o,KeyboardEvent)?null:o.clipboardData;a!=null&&s!==null&&uy(a,s,i)},{tag:DA})})(t,e),!0)},xe),e.registerCommand(W1,t=>{const n=Y();return W(n)&&eu(n),!1},xe),e.registerCommand(dh,t=>{const n=Y();return W(n)&&eu(n),!1},xe))}var tu={exports:{}},xy;function NM(){return xy||(xy=1,(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var n=(function(r){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function y(v){return v instanceof l?new l(v.type,y(v.content),v.alias):Array.isArray(v)?v.map(y):v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++i}),y.__id},clone:function y(v,b){b=b||{};var w,_;switch(a.util.type(v)){case"Object":if(_=a.util.objId(v),b[_])return b[_];w={},b[_]=w;for(var E in v)v.hasOwnProperty(E)&&(w[E]=y(v[E],b));return w;case"Array":return _=a.util.objId(v),b[_]?b[_]:(w=[],b[_]=w,v.forEach(function(T,k){w[k]=y(T,b)}),w);default:return v}},getLanguage:function(y){for(;y;){var v=o.exec(y.className);if(v)return v[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,v){y.className=y.className.replace(RegExp(o,"gi"),""),y.classList.add("language-"+v)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(w){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(w.stack)||[])[1];if(y){var v=document.getElementsByTagName("script");for(var b in v)if(v[b].src==y)return v[b]}return null}},isActive:function(y,v,b){for(var w="no-"+v;y;){var _=y.classList;if(_.contains(v))return!0;if(_.contains(w))return!1;y=y.parentElement}return!!b}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(y,v){var b=a.util.clone(a.languages[y]);for(var w in v)b[w]=v[w];return b},insertBefore:function(y,v,b,w){w=w||a.languages;var _=w[y],E={};for(var T in _)if(_.hasOwnProperty(T)){if(T==v)for(var k in b)b.hasOwnProperty(k)&&(E[k]=b[k]);b.hasOwnProperty(T)||(E[T]=_[T])}var P=w[y];return w[y]=E,a.languages.DFS(a.languages,function(O,D){D===P&&O!=y&&(this[O]=E)}),E},DFS:function y(v,b,w,_){_=_||{};var E=a.util.objId;for(var T in v)if(v.hasOwnProperty(T)){b.call(v,T,v[T],w||T);var k=v[T],P=a.util.type(k);P==="Object"&&!_[E(k)]?(_[E(k)]=!0,y(k,b,null,_)):P==="Array"&&!_[E(k)]&&(_[E(k)]=!0,y(k,b,T,_))}}},plugins:{},highlightAll:function(y,v){a.highlightAllUnder(document,y,v)},highlightAllUnder:function(y,v,b){var w={callback:b,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",w),w.elements=Array.prototype.slice.apply(w.container.querySelectorAll(w.selector)),a.hooks.run("before-all-elements-highlight",w);for(var _=0,E;E=w.elements[_++];)a.highlightElement(E,v===!0,w.callback)},highlightElement:function(y,v,b){var w=a.util.getLanguage(y),_=a.languages[w];a.util.setLanguage(y,w);var E=y.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,w);var T=y.textContent,k={element:y,language:w,grammar:_,code:T};function P(D){k.highlightedCode=D,a.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,a.hooks.run("after-highlight",k),a.hooks.run("complete",k),b&&b.call(k.element)}if(a.hooks.run("before-sanity-check",k),E=k.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!k.code){a.hooks.run("complete",k),b&&b.call(k.element);return}if(a.hooks.run("before-highlight",k),!k.grammar){P(a.util.encode(k.code));return}if(v&&r.Worker){var O=new Worker(a.filename);O.onmessage=function(D){P(D.data)},O.postMessage(JSON.stringify({language:k.language,code:k.code,immediateClose:!0}))}else P(a.highlight(k.code,k.grammar,k.language))},highlight:function(y,v,b){var w={code:y,grammar:v,language:b};if(a.hooks.run("before-tokenize",w),!w.grammar)throw new Error('The language "'+w.language+'" has no grammar.');return w.tokens=a.tokenize(w.code,w.grammar),a.hooks.run("after-tokenize",w),l.stringify(a.util.encode(w.tokens),w.language)},tokenize:function(y,v){var b=v.rest;if(b){for(var w in b)v[w]=b[w];delete v.rest}var _=new f;return d(_,_.head,y),u(y,_,v,_.head,0),g(_)},hooks:{all:{},add:function(y,v){var b=a.hooks.all;b[y]=b[y]||[],b[y].push(v)},run:function(y,v){var b=a.hooks.all[y];if(!(!b||!b.length))for(var w=0,_;_=b[w++];)_(v)}},Token:l};r.Prism=a;function l(y,v,b,w){this.type=y,this.content=v,this.alias=b,this.length=(w||"").length|0}l.stringify=function y(v,b){if(typeof v=="string")return v;if(Array.isArray(v)){var w="";return v.forEach(function(P){w+=y(P,b)}),w}var _={type:v.type,content:y(v.content,b),tag:"span",classes:["token",v.type],attributes:{},language:b},E=v.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(_.classes,E):_.classes.push(E)),a.hooks.run("wrap",_);var T="";for(var k in _.attributes)T+=" "+k+'="'+(_.attributes[k]||"").replace(/"/g,"&quot;")+'"';return"<"+_.tag+' class="'+_.classes.join(" ")+'"'+T+">"+_.content+"</"+_.tag+">"};function c(y,v,b,w){y.lastIndex=v;var _=y.exec(b);if(_&&w&&_[1]){var E=_[1].length;_.index+=E,_[0]=_[0].slice(E)}return _}function u(y,v,b,w,_,E){for(var T in b)if(!(!b.hasOwnProperty(T)||!b[T])){var k=b[T];k=Array.isArray(k)?k:[k];for(var P=0;P<k.length;++P){if(E&&E.cause==T+","+P)return;var O=k[P],D=O.inside,I=!!O.lookbehind,$=!!O.greedy,H=O.alias;if($&&!O.pattern.global){var U=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,U+"g")}for(var F=O.pattern||O,N=w.next,j=_;N!==v.tail&&!(E&&j>=E.reach);j+=N.value.length,N=N.next){var K=N.value;if(v.length>y.length)return;if(!(K instanceof l)){var te=1,J;if($){if(J=c(F,j,y,I),!J||J.index>=y.length)break;var fe=J.index,Z=J.index+J[0].length,se=j;for(se+=N.value.length;fe>=se;)N=N.next,se+=N.value.length;if(se-=N.value.length,j=se,N.value instanceof l)continue;for(var oe=N;oe!==v.tail&&(se<Z||typeof oe.value=="string");oe=oe.next)te++,se+=oe.value.length;te--,K=y.slice(j,se),J.index-=j}else if(J=c(F,0,K,I),!J)continue;var fe=J.index,_e=J[0],ne=K.slice(0,fe),ye=K.slice(fe+_e.length),Te=j+K.length;E&&Te>E.reach&&(E.reach=Te);var De=N.prev;ne&&(De=d(v,De,ne),j+=ne.length),h(v,De,te);var st=new l(T,D?a.tokenize(_e,D):_e,H,_e);if(N=d(v,De,st),ye&&d(v,N,ye),te>1){var ee={cause:T+","+P,reach:Te};u(y,v,b,N.prev,j,ee),E&&ee.reach>E.reach&&(E.reach=ee.reach)}}}}}}function f(){var y={value:null,prev:null,next:null},v={value:null,prev:y,next:null};y.next=v,this.head=y,this.tail=v,this.length=0}function d(y,v,b){var w=v.next,_={value:b,prev:v,next:w};return v.next=_,w.prev=_,y.length++,_}function h(y,v,b){for(var w=v.next,_=0;_<b&&w!==y.tail;_++)w=w.next;v.next=w,w.prev=v,y.length-=_}function g(y){for(var v=[],b=y.head.next;b!==y.tail;)v.push(b.value),b=b.next;return v}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(y){var v=JSON.parse(y.data),b=v.language,w=v.code,_=v.immediateClose;r.postMessage(a.highlight(w,a.languages[b],b)),_&&r.close()},!1)),a;var p=a.util.currentScript();p&&(a.filename=p.src,p.hasAttribute("data-manual")&&(a.manual=!0));function m(){a.manual||a.highlightAll()}if(!a.manual){var x=document.readyState;x==="loading"||x==="interactive"&&p&&p.defer?document.addEventListener("DOMContentLoaded",m):window.requestAnimationFrame?window.requestAnimationFrame(m):window.setTimeout(m,16)}return a})(t);e.exports&&(e.exports=n),typeof In<"u"&&(In.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(o,i){var s={};s["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[i]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};a["language-"+i]={pattern:/[\s\S]+/,inside:n.languages[i]};var l={};l[o]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return o}),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,o){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[o,"language-"+o],inside:n.languages[o]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(r){var o=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+o.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+o.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+o.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+o.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:o,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var i=r.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,(function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",o=function(p,m){return"✖ Error "+p+" while fetching file: "+m},i="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",l="loading",c="loaded",u="failed",f="pre[data-src]:not(["+a+'="'+c+'"]):not(['+a+'="'+l+'"])';function d(p,m,x){var y=new XMLHttpRequest;y.open("GET",p,!0),y.onreadystatechange=function(){y.readyState==4&&(y.status<400&&y.responseText?m(y.responseText):y.status>=400?x(o(y.status,y.statusText)):x(i))},y.send(null)}function h(p){var m=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(m){var x=Number(m[1]),y=m[2],v=m[3];return y?v?[x,Number(v)]:[x,void 0]:[x,x]}}n.hooks.add("before-highlightall",function(p){p.selector+=", "+f}),n.hooks.add("before-sanity-check",function(p){var m=p.element;if(m.matches(f)){p.code="",m.setAttribute(a,l);var x=m.appendChild(document.createElement("CODE"));x.textContent=r;var y=m.getAttribute("data-src"),v=p.language;if(v==="none"){var b=(/\.(\w+)$/.exec(y)||[,"none"])[1];v=s[b]||b}n.util.setLanguage(x,v),n.util.setLanguage(m,v);var w=n.plugins.autoloader;w&&w.loadLanguages(v),d(y,function(_){m.setAttribute(a,c);var E=h(m.getAttribute("data-range"));if(E){var T=_.split(/\r\n?|\n/g),k=E[0],P=E[1]==null?T.length:E[1];k<0&&(k+=T.length),k=Math.max(0,Math.min(k-1,T.length)),P<0&&(P+=T.length),P=Math.max(0,Math.min(P,T.length)),_=T.slice(k,P).join(`
48
- `),m.hasAttribute("data-start")||m.setAttribute("data-start",String(k+1))}x.textContent=_,n.highlightElement(x)},function(_){m.setAttribute(a,u),x.textContent=_})}}),n.plugins.fileHighlight={highlight:function(m){for(var x=(m||document).querySelectorAll(f),y=0,v;v=x[y++];)n.highlightElement(v)}};var g=!1;n.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(tu)),tu.exports}NM();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var i={};i[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:o},Prism.languages.insertBefore("markup","cdata",i)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(u){return u=u.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(f){u!==f&&(e.languages.markdown[u].inside.content.inside[f]=e.languages.markdown[f])})}),e.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function f(d){if(!(!d||typeof d=="string"))for(var h=0,g=d.length;h<g;h++){var p=d[h];if(p.type!=="code"){f(p.content);continue}var m=p.content[1],x=p.content[3];if(m&&x&&m.type==="code-language"&&x.type==="code-block"&&typeof m.content=="string"){var y=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");y=(/[a-z][\w-]*/i.exec(y)||[""])[0].toLowerCase();var v="language-"+y;x.alias?typeof x.alias=="string"?x.alias=[x.alias,v]:x.alias.push(v):x.alias=[v]}}}f(u.tokens)}),e.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var f="",d=0,h=u.classes.length;d<h;d++){var g=u.classes[d],p=/language-(.+)/.exec(g);if(p){f=p[1];break}}var m=e.languages[f];if(m)u.content=e.highlight(c(u.content),m,f);else if(f&&f!=="none"&&e.plugins.autoloader){var x="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=x,e.plugins.autoloader.loadLanguages(f,function(){var y=document.getElementById(x);y&&(y.innerHTML=e.highlight(y.textContent,e.languages[f],f))})}}});var s=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;function c(u){var f=u.replace(s,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(d,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),l(g)}else{var p=a[h];return p||d}}),f}e.languages.md=e.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism);var by={},wy;function PM(){return wy||(wy=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),by}PM();var Cy={},Sy;function FM(){return Sy||(Sy=1,(function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism)),Cy}FM();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift});var _y={},Ty;function LM(){return Ty||(Ty=1,(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism)),_y}LM();var Ey={},Ry;function $M(){return Ry||(Ry=1,(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Ey}$M();var ky={},Ay;function OM(){return Ay||(Ay=1,(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(Prism)),ky}OM();function _w(e,t){for(const n of e.childNodes){if(Be(n)&&n.tagName===t)return!0;_w(n,t)}return!1}const ds="data-language",Qi="data-highlight-language",_a="data-theme";let ec=class Tw extends St{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new Tw(t.__language,t.__key)}constructor(t,n){super(n),this.__language=t||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t){super.afterCloneFrom(t),this.__language=t.__language,this.__theme=t.__theme,this.__isSyntaxHighlightSupported=t.__isSyntaxHighlightSupported}createDOM(t){const n=document.createElement("code");Qe(n,t.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(ds,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(Qi,r));const o=this.getTheme();o&&n.setAttribute(_a,o);const i=this.getStyle();return i&&n.setAttribute("style",i),n}updateDOM(t,n,r){const o=this.__language,i=t.__language;o?o!==i&&n.setAttribute(ds,o):i&&n.removeAttribute(ds);const s=this.__isSyntaxHighlightSupported;t.__isSyntaxHighlightSupported&&i?s&&o?o!==i&&n.setAttribute(Qi,o):n.removeAttribute(Qi):s&&o&&n.setAttribute(Qi,o);const a=this.__theme,l=t.__theme;a?a!==l&&n.setAttribute(_a,a):l&&n.removeAttribute(_a);const c=this.__style,u=t.__style;return c?c!==u&&n.setAttribute("style",c):u&&n.removeAttribute("style"),!1}exportDOM(t){const n=document.createElement("pre");Qe(n,t._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(ds,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(Qi,r));const o=this.getTheme();o&&n.setAttribute(_a,o);const i=this.getStyle();return i&&n.setAttribute("style",i),{element:n}}static importDOM(){return{code:t=>t.textContent!=null&&(/\r?\n/.test(t.textContent)||_w(t,"BR"))?{conversion:My,priority:1}:null,div:()=>({conversion:IM,priority:1}),pre:()=>({conversion:My,priority:0}),table:t=>nu(t)?{conversion:DM,priority:3}:null,td:t=>{const n=t,r=n.closest("table");return n.classList.contains("js-file-line")||r&&nu(r)?{conversion:Ny,priority:3}:null},tr:t=>{const n=t.closest("table");return n&&nu(n)?{conversion:Ny,priority:3}:null}}}static importJSON(t){return cr().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language).setTheme(t.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t,n=!0){const r=this.getChildren(),o=r.length;if(o>=2&&r[o-1].getTextContent()===`
47
+ `?c.insertParagraph():u===" "?c.insertNodes([Di()]):c.insertText(u)}}}else t.insertRawText(s)}function gy(e,t,n){e.dispatchCommand(sh,{nodes:t,selection:n})||(n.insertNodes(t),(function(r){if(W(r)&&r.isCollapsed()){const o=r.anchor;let i=null;const s=En(o,"previous");if(s)if(Wn(s))i=s.origin;else{const a=Vr(s,Nt(qe(),"next").getFlipped());for(const l of a){if(X(l.origin)){i=l.origin;break}if(B(l.origin)&&!l.origin.isInline())break}}if(i&&X(i)){const a=i.getFormat(),l=i.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}})(n))}function bw(e,t,n,r=[]){let o=t===null||n.isSelected(t);const i=B(n)&&n.excludeFromCopy("html");let s=n;t!==null&&X(s)&&(s=K1(t,s,"clone"));const a=B(s)?s.getChildren():[],l=(function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Tl(58,f.name),B(c)){const d=u.children;Array.isArray(d)||Tl(59,f.name)}return u})(s);X(s)&&s.getTextContentSize()===0&&(o=!1);for(let c=0;c<a.length;c++){const u=a[c],f=bw(e,t,u,l.children);!o&&B(n)&&f&&n.extractWithChild(u,t,"clone")&&(o=!0)}if(o&&!i)r.push(l);else if(Array.isArray(l.children))for(let c=0;c<l.children.length;c++){const u=l.children[c];r.push(u)}return o}function RM(e,t){const n=[],r=qe().getChildren();for(let o=0;o<r.length;o++)bw(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function kM(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=lA(r);X(o)&&BA(o),t.push(o)}return t}let Ho=null;async function Yd(e,t,n){if(Ho!==null)return!1;if(t!==null)return new Promise((c,u)=>{e.update(()=>{c(py(e,t,n))})});const r=e.getRootElement(),o=e._window||window,i=o.document,s=Lt(o);if(r===null||s===null)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),s.removeAllRanges(),s.addRange(l),new Promise((c,u)=>{const f=e.registerCommand(Kl,d=>(kr(d,ClipboardEvent)&&(f(),Ho!==null&&(o.clearTimeout(Ho),Ho=null),c(py(e,d,n))),!0),dA);Ho=o.setTimeout(()=>{f(),Ho=null,c(!1)},50),i.execCommand("copy"),a.remove()})}function py(e,t,n){if(n===void 0){const o=Lt(e._window),i=Y();if(!i||i.isCollapsed()||!o)return!1;const s=o.anchorNode,a=o.focusNode;if(s!==null&&a!==null&&!Zs(e,s,a))return!1;n=Cw(i)}t.preventDefault();const r=t.clipboardData;return r!==null&&(AM(r,n),!0)}const ww=[["text/html",TM],["application/x-lexical-editor",EM]];function Cw(e=Y()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=Bi();for(const[r,o]of ww){const i=o(n,e);i!==null&&(t[r]=i)}}return t}function AM(e,t){for(const[n]of ww)t[n]===void 0&&e.setData(n,"");for(const n in t){const r=t[n];r!==void 0&&e.setData(n,r)}}function MM(e){const t=window.location.origin,n=r=>{if(r.origin!==t)return;const o=e.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const a=s.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[c,u,f,d,h]=l;e.update(()=>{const g=Y();if(W(g)){const p=g.anchor;let m=p.getNode(),x=0,y=0;if(X(m)&&c>=0&&u>=0&&(x=c,y=c+u,g.setTextNodeRange(m,x,m,y)),x===y&&f===""||(g.insertRawText(f),m=p.getNode()),X(m)){x=d,y=d+h;const v=m.getTextContentSize();x=x>v?v:x,y=y>v?v:y,g.setTextNodeRange(m,x,m,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}function my(e,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const Do=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,NM=Do&&"documentMode"in document?document.documentMode:null,PM=Do&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),LM=!(!Do||!("InputEvent"in window)||NM)&&"getTargetRanges"in new window.InputEvent("input"),FM=Do&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),yy=Do&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,$M=Do&&/^(?=.*Chrome).*/i.test(navigator.userAgent),OM=Do&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&PM&&!$M,vy=le("DRAG_DROP_PASTE_FILE");let nc=class Sw extends St{static getType(){return"quote"}static clone(t){return new Sw(t.__key)}createDOM(t){const n=document.createElement("blockquote");return Qe(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:t=>({conversion:IM,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return Bh().updateFromJSON(t)}insertNewAfter(t,n){const r=ye(),o=this.getDirection();return r.setDirection(o),this.insertAfter(r,n),r}collapseAtStart(){const t=ye();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function Bh(){return _t(new nc)}function Xd(e){return e instanceof nc}let rc=class _w extends St{__tag;static getType(){return"heading"}static clone(t){return new _w(t.__tag,t.__key)}constructor(t,n){super(n),this.__tag=t}getTag(){return this.__tag}setTag(t){const n=this.getWritable();return this.__tag=t,n}createDOM(t){const n=this.__tag,r=document.createElement(n),o=t.theme.heading;if(o!==void 0){const i=o[n];Qe(r,i)}return r}updateDOM(t,n,r){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:Wo,priority:0}),h2:t=>({conversion:Wo,priority:0}),h3:t=>({conversion:Wo,priority:0}),h4:t=>({conversion:Wo,priority:0}),h5:t=>({conversion:Wo,priority:0}),h6:t=>({conversion:Wo,priority:0}),p:t=>{const n=t.firstChild;return n!==null&&xy(n)?{conversion:()=>({node:null}),priority:3}:null},span:t=>xy(t)?{conversion:n=>({node:fo("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return fo(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,n=!0){const r=t?t.anchor.offset:0,o=this.getLastDescendant(),i=!o||t&&t.anchor.key===o.getKey()&&r===o.getTextContentSize()||!t?ye():fo(this.getTag()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,n),r===0&&!this.isEmpty()&&t){const a=ye();a.select(),this.replace(a,!0)}return i}collapseAtStart(){const t=this.isEmpty()?ye():fo(this.getTag());return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}extractWithChild(){return!0}};function xy(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function Wo(e){const t=e.nodeName.toLowerCase();let n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=fo(t),e.style!==null&&(Mh(e,n),n.setFormat(e.style.textAlign))),{node:n}}function IM(e){const t=Bh();return e.style!==null&&(t.setFormat(e.style.textAlign),Mh(e,t)),{node:t}}function fo(e="h1"){return _t(new rc(e))}function Tw(e){return e instanceof rc}function Ea(e){let t=null;if(kr(e,DragEvent)?t=e.dataTransfer:kr(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function by(e){const t=Y();if(!W(t))return!1;const n=new Set,r=t.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(n.has(s))continue;const a=we(i,c=>B(c)&&!c.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!n.has(l)&&(n.add(l),e(a))}return n.size>0}function wy(e){const t=Ht(e);return _e(t)}function ou(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function DM(e){return Rn(e.registerCommand(Hl,t=>{const n=Y();return!!bt(n)&&(n.clear(),!0)},be),e.registerCommand(Lr,t=>{const n=Y();return W(n)?(n.deleteCharacter(t),!0):!!bt(n)&&(n.deleteNodes(),!0)},be),e.registerCommand(Ti,t=>{const n=Y();return!!W(n)&&(n.deleteWord(t),!0)},be),e.registerCommand(So,t=>{const n=Y();return!!W(n)&&(n.deleteLine(t),!0)},be),e.registerCommand(mo,t=>{const n=Y();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const r=t.dataTransfer;if(r!=null)hy(r,n,e);else if(W(n)){const o=t.data;return o&&n.insertText(o),!0}}return!0},be),e.registerCommand(Rd,()=>{const t=Y();return!!W(t)&&(t.removeText(),!0)},be),e.registerCommand(It,t=>{const n=Y();return!!W(n)&&(n.formatText(t),!0)},be),e.registerCommand(hi,t=>{const n=Y();if(!W(n)&&!bt(n))return!1;const r=n.getNodes();for(const o of r){const i=we(o,s=>B(s)&&!s.isInline());i!==null&&i.setFormat(t)}return!0},be),e.registerCommand(fi,t=>{const n=Y();return!!W(n)&&(n.insertLineBreak(t),!0)},be),e.registerCommand(Co,()=>{const t=Y();return!!W(t)&&(t.insertParagraph(),!0)},be),e.registerCommand(F3,()=>(yh([Di()]),!0),be),e.registerCommand($3,()=>by(t=>{const n=t.getIndent();t.setIndent(n+1)}),be),e.registerCommand(pm,()=>by(t=>{const n=t.getIndent();n>0&&t.setIndent(Math.max(0,n-1))}),be),e.registerCommand(uh,t=>{const n=Y();if(bt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectPrevious(),!0}else if(W(n)){const r=jd(n.focus,!0);if(!t.shiftKey&&_e(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),t.preventDefault(),!0}return!1},be),e.registerCommand(dh,t=>{const n=Y();if(bt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectNext(0,0),!0}else if(W(n)){if((function(o){const i=o.focus;return i.key==="root"&&i.offset===qe().getChildrenSize()})(n))return t.preventDefault(),!0;const r=jd(n.focus,!1);if(!t.shiftKey&&_e(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),t.preventDefault(),!0}return!1},be),e.registerCommand(ch,t=>{const n=Y();if(bt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),Jm(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!W(n))return!1;if(Qm(n,!0)){const r=t.shiftKey;return t.preventDefault(),ey(n,r,!0),!0}return!1},be),e.registerCommand(lh,t=>{const n=Y();if(bt(n)){const o=n.getNodes();if(o.length>0)return t.preventDefault(),Jm(o[0])?o[0].selectPrevious():o[0].selectNext(0,0),!0}if(!W(n))return!1;const r=t.shiftKey;return!!Qm(n,!1)&&(t.preventDefault(),ey(n,r,!1),!0)},be),e.registerCommand(Wl,t=>{if(wy(t.target))return!1;const n=Y();if(W(n)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:o}=r;if(o.offset!==0)return!1;const i=o.getNode();if(ot(i))return!1;const s=UA(i);return s.getIndent()>0&&(s.is(i)||i.is(s.getFirstDescendant()))})(n))return t.preventDefault(),e.dispatchCommand(pm,void 0);if(yy&&navigator.language==="ko-KR")return!1}else if(!bt(n))return!1;return t.preventDefault(),e.dispatchCommand(Lr,!0)},be),e.registerCommand(hh,t=>{if(wy(t.target))return!1;const n=Y();return!(!W(n)&&!bt(n))&&(t.preventDefault(),e.dispatchCommand(Lr,!1))},be),e.registerCommand(pl,t=>{const n=Y();if(!W(n))return!1;if(ou(n),t!==null){if((yy||FM||OM)&&LM)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(fi,!1)}return e.dispatchCommand(Co,void 0)},be),e.registerCommand(fh,()=>{const t=Y();return!!W(t)&&(e.blur(),!0)},be),e.registerCommand(Gb,t=>{const[,n]=Ea(t);if(n.length>0){const o=my(t.clientX,t.clientY);if(o!==null){const{offset:i,node:s}=o,a=Ht(s);if(a!==null){const l=Yl();if(X(a))l.anchor.set(a.getKey(),i,"text"),l.focus.set(a.getKey(),i,"text");else{const u=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;l.anchor.set(u,f,"element"),l.focus.set(u,f,"element")}const c=Ns(l);Ge(c)}e.dispatchCommand(vy,n)}return t.preventDefault(),!0}const r=Y();return!!W(r)},be),e.registerCommand(qb,t=>{const[n]=Ea(t),r=Y();return!(n&&!W(r))},be),e.registerCommand(Yb,t=>{const[n]=Ea(t),r=Y();if(n&&!W(r))return!1;const o=my(t.clientX,t.clientY);if(o!==null){const i=Ht(o.node);_e(i)&&t.preventDefault()}return!0},be),e.registerCommand(kd,()=>(mA(),!0),be),e.registerCommand(Kl,t=>(Yd(e,kr(t,ClipboardEvent)?t:null),!0),be),e.registerCommand(Ul,t=>((async function(n,r){await Yd(r,kr(n,ClipboardEvent)?n:null),r.update(()=>{const o=Y();W(o)?o.removeText():bt(o)&&o.getNodes().forEach(i=>i.remove())})})(t,e),!0),be),e.registerCommand(ah,t=>{const[,n,r]=Ea(t);return n.length>0&&!r?(e.dispatchCommand(vy,n),!0):xn(t.target)&&Sh(t.target)?!1:Y()!==null&&((function(o,i){o.preventDefault(),i.update(()=>{const s=Y(),a=kr(o,InputEvent)||kr(o,KeyboardEvent)?null:o.clipboardData;a!=null&&s!==null&&hy(a,s,i)},{tag:U3})})(t,e),!0)},be),e.registerCommand(Ub,t=>{const n=Y();return W(n)&&ou(n),!1},be),e.registerCommand(gh,t=>{const n=Y();return W(n)&&ou(n),!1},be))}var iu={exports:{}},Cy;function jM(){return Cy||(Cy=1,(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var n=(function(r){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function y(v){return v instanceof l?new l(v.type,y(v.content),v.alias):Array.isArray(v)?v.map(y):v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++i}),y.__id},clone:function y(v,b){b=b||{};var w,_;switch(a.util.type(v)){case"Object":if(_=a.util.objId(v),b[_])return b[_];w={},b[_]=w;for(var E in v)v.hasOwnProperty(E)&&(w[E]=y(v[E],b));return w;case"Array":return _=a.util.objId(v),b[_]?b[_]:(w=[],b[_]=w,v.forEach(function(T,k){w[k]=y(T,b)}),w);default:return v}},getLanguage:function(y){for(;y;){var v=o.exec(y.className);if(v)return v[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,v){y.className=y.className.replace(RegExp(o,"gi"),""),y.classList.add("language-"+v)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(w){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(w.stack)||[])[1];if(y){var v=document.getElementsByTagName("script");for(var b in v)if(v[b].src==y)return v[b]}return null}},isActive:function(y,v,b){for(var w="no-"+v;y;){var _=y.classList;if(_.contains(v))return!0;if(_.contains(w))return!1;y=y.parentElement}return!!b}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(y,v){var b=a.util.clone(a.languages[y]);for(var w in v)b[w]=v[w];return b},insertBefore:function(y,v,b,w){w=w||a.languages;var _=w[y],E={};for(var T in _)if(_.hasOwnProperty(T)){if(T==v)for(var k in b)b.hasOwnProperty(k)&&(E[k]=b[k]);b.hasOwnProperty(T)||(E[T]=_[T])}var P=w[y];return w[y]=E,a.languages.DFS(a.languages,function(O,D){D===P&&O!=y&&(this[O]=E)}),E},DFS:function y(v,b,w,_){_=_||{};var E=a.util.objId;for(var T in v)if(v.hasOwnProperty(T)){b.call(v,T,v[T],w||T);var k=v[T],P=a.util.type(k);P==="Object"&&!_[E(k)]?(_[E(k)]=!0,y(k,b,null,_)):P==="Array"&&!_[E(k)]&&(_[E(k)]=!0,y(k,b,T,_))}}},plugins:{},highlightAll:function(y,v){a.highlightAllUnder(document,y,v)},highlightAllUnder:function(y,v,b){var w={callback:b,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",w),w.elements=Array.prototype.slice.apply(w.container.querySelectorAll(w.selector)),a.hooks.run("before-all-elements-highlight",w);for(var _=0,E;E=w.elements[_++];)a.highlightElement(E,v===!0,w.callback)},highlightElement:function(y,v,b){var w=a.util.getLanguage(y),_=a.languages[w];a.util.setLanguage(y,w);var E=y.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,w);var T=y.textContent,k={element:y,language:w,grammar:_,code:T};function P(D){k.highlightedCode=D,a.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,a.hooks.run("after-highlight",k),a.hooks.run("complete",k),b&&b.call(k.element)}if(a.hooks.run("before-sanity-check",k),E=k.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!k.code){a.hooks.run("complete",k),b&&b.call(k.element);return}if(a.hooks.run("before-highlight",k),!k.grammar){P(a.util.encode(k.code));return}if(v&&r.Worker){var O=new Worker(a.filename);O.onmessage=function(D){P(D.data)},O.postMessage(JSON.stringify({language:k.language,code:k.code,immediateClose:!0}))}else P(a.highlight(k.code,k.grammar,k.language))},highlight:function(y,v,b){var w={code:y,grammar:v,language:b};if(a.hooks.run("before-tokenize",w),!w.grammar)throw new Error('The language "'+w.language+'" has no grammar.');return w.tokens=a.tokenize(w.code,w.grammar),a.hooks.run("after-tokenize",w),l.stringify(a.util.encode(w.tokens),w.language)},tokenize:function(y,v){var b=v.rest;if(b){for(var w in b)v[w]=b[w];delete v.rest}var _=new f;return d(_,_.head,y),u(y,_,v,_.head,0),g(_)},hooks:{all:{},add:function(y,v){var b=a.hooks.all;b[y]=b[y]||[],b[y].push(v)},run:function(y,v){var b=a.hooks.all[y];if(!(!b||!b.length))for(var w=0,_;_=b[w++];)_(v)}},Token:l};r.Prism=a;function l(y,v,b,w){this.type=y,this.content=v,this.alias=b,this.length=(w||"").length|0}l.stringify=function y(v,b){if(typeof v=="string")return v;if(Array.isArray(v)){var w="";return v.forEach(function(P){w+=y(P,b)}),w}var _={type:v.type,content:y(v.content,b),tag:"span",classes:["token",v.type],attributes:{},language:b},E=v.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(_.classes,E):_.classes.push(E)),a.hooks.run("wrap",_);var T="";for(var k in _.attributes)T+=" "+k+'="'+(_.attributes[k]||"").replace(/"/g,"&quot;")+'"';return"<"+_.tag+' class="'+_.classes.join(" ")+'"'+T+">"+_.content+"</"+_.tag+">"};function c(y,v,b,w){y.lastIndex=v;var _=y.exec(b);if(_&&w&&_[1]){var E=_[1].length;_.index+=E,_[0]=_[0].slice(E)}return _}function u(y,v,b,w,_,E){for(var T in b)if(!(!b.hasOwnProperty(T)||!b[T])){var k=b[T];k=Array.isArray(k)?k:[k];for(var P=0;P<k.length;++P){if(E&&E.cause==T+","+P)return;var O=k[P],D=O.inside,I=!!O.lookbehind,$=!!O.greedy,H=O.alias;if($&&!O.pattern.global){var U=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,U+"g")}for(var L=O.pattern||O,N=w.next,V=_;N!==v.tail&&!(E&&V>=E.reach);V+=N.value.length,N=N.next){var K=N.value;if(v.length>y.length)return;if(!(K instanceof l)){var te=1,J;if($){if(J=c(L,V,y,I),!J||J.index>=y.length)break;var fe=J.index,Z=J.index+J[0].length,ae=V;for(ae+=N.value.length;fe>=ae;)N=N.next,ae+=N.value.length;if(ae-=N.value.length,V=ae,N.value instanceof l)continue;for(var oe=N;oe!==v.tail&&(ae<Z||typeof oe.value=="string");oe=oe.next)te++,ae+=oe.value.length;te--,K=y.slice(V,ae),J.index-=V}else if(J=c(L,0,K,I),!J)continue;var fe=J.index,Te=J[0],ne=K.slice(0,fe),ve=K.slice(fe+Te.length),Ee=V+K.length;E&&Ee>E.reach&&(E.reach=Ee);var De=N.prev;ne&&(De=d(v,De,ne),V+=ne.length),h(v,De,te);var st=new l(T,D?a.tokenize(Te,D):Te,H,Te);if(N=d(v,De,st),ve&&d(v,N,ve),te>1){var ee={cause:T+","+P,reach:Ee};u(y,v,b,N.prev,V,ee),E&&ee.reach>E.reach&&(E.reach=ee.reach)}}}}}}function f(){var y={value:null,prev:null,next:null},v={value:null,prev:y,next:null};y.next=v,this.head=y,this.tail=v,this.length=0}function d(y,v,b){var w=v.next,_={value:b,prev:v,next:w};return v.next=_,w.prev=_,y.length++,_}function h(y,v,b){for(var w=v.next,_=0;_<b&&w!==y.tail;_++)w=w.next;v.next=w,w.prev=v,y.length-=_}function g(y){for(var v=[],b=y.head.next;b!==y.tail;)v.push(b.value),b=b.next;return v}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(y){var v=JSON.parse(y.data),b=v.language,w=v.code,_=v.immediateClose;r.postMessage(a.highlight(w,a.languages[b],b)),_&&r.close()},!1)),a;var p=a.util.currentScript();p&&(a.filename=p.src,p.hasAttribute("data-manual")&&(a.manual=!0));function m(){a.manual||a.highlightAll()}if(!a.manual){var x=document.readyState;x==="loading"||x==="interactive"&&p&&p.defer?document.addEventListener("DOMContentLoaded",m):window.requestAnimationFrame?window.requestAnimationFrame(m):window.setTimeout(m,16)}return a})(t);e.exports&&(e.exports=n),typeof Dn<"u"&&(Dn.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(o,i){var s={};s["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[i]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};a["language-"+i]={pattern:/[\s\S]+/,inside:n.languages[i]};var l={};l[o]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return o}),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,o){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[o,"language-"+o],inside:n.languages[o]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(r){var o=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+o.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+o.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+o.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+o.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:o,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var i=r.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,(function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",o=function(p,m){return"✖ Error "+p+" while fetching file: "+m},i="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",l="loading",c="loaded",u="failed",f="pre[data-src]:not(["+a+'="'+c+'"]):not(['+a+'="'+l+'"])';function d(p,m,x){var y=new XMLHttpRequest;y.open("GET",p,!0),y.onreadystatechange=function(){y.readyState==4&&(y.status<400&&y.responseText?m(y.responseText):y.status>=400?x(o(y.status,y.statusText)):x(i))},y.send(null)}function h(p){var m=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(m){var x=Number(m[1]),y=m[2],v=m[3];return y?v?[x,Number(v)]:[x,void 0]:[x,x]}}n.hooks.add("before-highlightall",function(p){p.selector+=", "+f}),n.hooks.add("before-sanity-check",function(p){var m=p.element;if(m.matches(f)){p.code="",m.setAttribute(a,l);var x=m.appendChild(document.createElement("CODE"));x.textContent=r;var y=m.getAttribute("data-src"),v=p.language;if(v==="none"){var b=(/\.(\w+)$/.exec(y)||[,"none"])[1];v=s[b]||b}n.util.setLanguage(x,v),n.util.setLanguage(m,v);var w=n.plugins.autoloader;w&&w.loadLanguages(v),d(y,function(_){m.setAttribute(a,c);var E=h(m.getAttribute("data-range"));if(E){var T=_.split(/\r\n?|\n/g),k=E[0],P=E[1]==null?T.length:E[1];k<0&&(k+=T.length),k=Math.max(0,Math.min(k-1,T.length)),P<0&&(P+=T.length),P=Math.max(0,Math.min(P,T.length)),_=T.slice(k,P).join(`
48
+ `),m.hasAttribute("data-start")||m.setAttribute("data-start",String(k+1))}x.textContent=_,n.highlightElement(x)},function(_){m.setAttribute(a,u),x.textContent=_})}}),n.plugins.fileHighlight={highlight:function(m){for(var x=(m||document).querySelectorAll(f),y=0,v;v=x[y++];)n.highlightElement(v)}};var g=!1;n.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(iu)),iu.exports}jM();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var i={};i[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:o},Prism.languages.insertBefore("markup","cdata",i)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(u){return u=u.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(f){u!==f&&(e.languages.markdown[u].inside.content.inside[f]=e.languages.markdown[f])})}),e.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function f(d){if(!(!d||typeof d=="string"))for(var h=0,g=d.length;h<g;h++){var p=d[h];if(p.type!=="code"){f(p.content);continue}var m=p.content[1],x=p.content[3];if(m&&x&&m.type==="code-language"&&x.type==="code-block"&&typeof m.content=="string"){var y=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");y=(/[a-z][\w-]*/i.exec(y)||[""])[0].toLowerCase();var v="language-"+y;x.alias?typeof x.alias=="string"?x.alias=[x.alias,v]:x.alias.push(v):x.alias=[v]}}}f(u.tokens)}),e.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var f="",d=0,h=u.classes.length;d<h;d++){var g=u.classes[d],p=/language-(.+)/.exec(g);if(p){f=p[1];break}}var m=e.languages[f];if(m)u.content=e.highlight(c(u.content),m,f);else if(f&&f!=="none"&&e.plugins.autoloader){var x="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=x,e.plugins.autoloader.loadLanguages(f,function(){var y=document.getElementById(x);y&&(y.innerHTML=e.highlight(y.textContent,e.languages[f],f))})}}});var s=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;function c(u){var f=u.replace(s,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(d,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),l(g)}else{var p=a[h];return p||d}}),f}e.languages.md=e.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism);var Sy={},_y;function VM(){return _y||(_y=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Sy}VM();var Ty={},Ey;function BM(){return Ey||(Ey=1,(function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism)),Ty}BM();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift});var Ry={},ky;function zM(){return ky||(ky=1,(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism)),Ry}zM();var Ay={},My;function HM(){return My||(My=1,(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Ay}HM();var Ny={},Py;function WM(){return Py||(Py=1,(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(Prism)),Ny}WM();function Ew(e,t){for(const n of e.childNodes){if(Be(n)&&n.tagName===t)return!0;Ew(n,t)}return!1}const hs="data-language",ts="data-highlight-language",Ra="data-theme";let oc=class Rw extends St{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new Rw(t.__language,t.__key)}constructor(t,n){super(n),this.__language=t||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t){super.afterCloneFrom(t),this.__language=t.__language,this.__theme=t.__theme,this.__isSyntaxHighlightSupported=t.__isSyntaxHighlightSupported}createDOM(t){const n=document.createElement("code");Qe(n,t.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(hs,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(ts,r));const o=this.getTheme();o&&n.setAttribute(Ra,o);const i=this.getStyle();return i&&n.setAttribute("style",i),n}updateDOM(t,n,r){const o=this.__language,i=t.__language;o?o!==i&&n.setAttribute(hs,o):i&&n.removeAttribute(hs);const s=this.__isSyntaxHighlightSupported;t.__isSyntaxHighlightSupported&&i?s&&o?o!==i&&n.setAttribute(ts,o):n.removeAttribute(ts):s&&o&&n.setAttribute(ts,o);const a=this.__theme,l=t.__theme;a?a!==l&&n.setAttribute(Ra,a):l&&n.removeAttribute(Ra);const c=this.__style,u=t.__style;return c?c!==u&&n.setAttribute("style",c):u&&n.removeAttribute("style"),!1}exportDOM(t){const n=document.createElement("pre");Qe(n,t._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(hs,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(ts,r));const o=this.getTheme();o&&n.setAttribute(Ra,o);const i=this.getStyle();return i&&n.setAttribute("style",i),{element:n}}static importDOM(){return{code:t=>t.textContent!=null&&(/\r?\n/.test(t.textContent)||Ew(t,"BR"))?{conversion:Ly,priority:1}:null,div:()=>({conversion:KM,priority:1}),pre:()=>({conversion:Ly,priority:0}),table:t=>su(t)?{conversion:UM,priority:3}:null,td:t=>{const n=t,r=n.closest("table");return n.classList.contains("js-file-line")||r&&su(r)?{conversion:Fy,priority:3}:null},tr:t=>{const n=t.closest("table");return n&&su(n)?{conversion:Fy,priority:3}:null}}}static importJSON(t){return ur().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language).setTheme(t.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t,n=!0){const r=this.getChildren(),o=r.length;if(o>=2&&r[o-1].getTextContent()===`
49
49
  `&&r[o-2].getTextContent()===`
50
- `&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===o){r[o-1].remove(),r[o-2].remove();const l=me();return this.insertAfter(l,n),l}const{anchor:i,focus:s}=t,a=(i.isBefore(s)?i:s).getNode();if(X(a)){let l=jM(a);const c=[];for(;;)if(Hl(l))c.push(Oi()),l=l.getNextSibling();else{if(!Aw(l))break;{let m=0;const x=l.getTextContent(),y=l.getTextContentSize();for(;m<y&&x[m]===" ";)m++;if(m!==0&&c.push(kw(" ".repeat(m))),m!==y)break;l=l.getNextSibling()}}const u=a.splitText(i.offset)[0],f=i.offset===0?0:1,d=u.getIndexWithinParent()+f,h=a.getParentOrThrow(),g=[Tn(),...c];h.splice(d,0,g);const p=c[c.length-1];p?p.select():i.offset===0?u.selectPrevious():u.getNextSibling().selectNext(0,0)}if(Vh(a)){const{offset:l}=t.anchor;a.splice(l,0,[Tn()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const t=me();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}setLanguage(t){const n=this.getWritable();return n.__language=t||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t){const n=this.getWritable();return n.__isSyntaxHighlightSupported=t,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t){const n=this.getWritable();return n.__theme=t||void 0,n}getTheme(){return this.getLatest().__theme}};function cr(e,t){return Lb(ec).setLanguage(e).setTheme(t)}function Vh(e){return e instanceof ec}function My(e){return{node:cr(e.getAttribute(ds))}}function IM(e){const t=e,n=Py(t);return n||(function(r){let o=r.parentElement;for(;o!==null;){if(Py(o))return!0;o=o.parentElement}return!1})(t)?{node:n?cr():null}:{node:null}}function DM(){return{node:cr()}}function Ny(){return{node:null}}function Py(e){return e.style.fontFamily.match("monospace")!==null}function nu(e){return e.classList.contains("js-file-line-container")}let Ew=class Rw extends un{__highlightType;constructor(t="",n,r){super(t,r),this.__highlightType=n}static getType(){return"code-highlight"}static clone(t){return new Rw(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const n=this.getWritable();return n.__highlightType=t||void 0,n}canHaveFormat(){return!1}createDOM(t){const n=super.createDOM(t),r=ru(t.theme,this.__highlightType);return Qe(n,r),n}updateDOM(t,n,r){const o=super.updateDOM(t,n,r),i=ru(r.theme,t.__highlightType),s=ru(r.theme,this.__highlightType);return i!==s&&(i&&Kn(n,i),s&&Qe(n,s)),o}static importJSON(t){return kw().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return cr()}};function ru(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function kw(e="",t){return _t(new Ew(e,t))}function Aw(e){return e instanceof Ew}function VM(e,t){let n=e;for(let r=tt(e,t);r&&(Aw(r.origin)||Hl(r.origin));r=O3(r))n=r.origin;return n}function jM(e){return VM(e,"previous")}(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),n==="diff"&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+`].*(?:\r
50
+ `&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===o){r[o-1].remove(),r[o-2].remove();const l=ye();return this.insertAfter(l,n),l}const{anchor:i,focus:s}=t,a=(i.isBefore(s)?i:s).getNode();if(X(a)){let l=qM(a);const c=[];for(;;)if(Gl(l))c.push(Di()),l=l.getNextSibling();else{if(!Nw(l))break;{let m=0;const x=l.getTextContent(),y=l.getTextContentSize();for(;m<y&&x[m]===" ";)m++;if(m!==0&&c.push(Mw(" ".repeat(m))),m!==y)break;l=l.getNextSibling()}}const u=a.splitText(i.offset)[0],f=i.offset===0?0:1,d=u.getIndexWithinParent()+f,h=a.getParentOrThrow(),g=[Tn(),...c];h.splice(d,0,g);const p=c[c.length-1];p?p.select():i.offset===0?u.selectPrevious():u.getNextSibling().selectNext(0,0)}if(zh(a)){const{offset:l}=t.anchor;a.splice(l,0,[Tn()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const t=ye();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}setLanguage(t){const n=this.getWritable();return n.__language=t||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t){const n=this.getWritable();return n.__isSyntaxHighlightSupported=t,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t){const n=this.getWritable();return n.__theme=t||void 0,n}getTheme(){return this.getLatest().__theme}};function ur(e,t){return O1(oc).setLanguage(e).setTheme(t)}function zh(e){return e instanceof oc}function Ly(e){return{node:ur(e.getAttribute(hs))}}function KM(e){const t=e,n=$y(t);return n||(function(r){let o=r.parentElement;for(;o!==null;){if($y(o))return!0;o=o.parentElement}return!1})(t)?{node:n?ur():null}:{node:null}}function UM(){return{node:ur()}}function Fy(){return{node:null}}function $y(e){return e.style.fontFamily.match("monospace")!==null}function su(e){return e.classList.contains("js-file-line-container")}let kw=class Aw extends un{__highlightType;constructor(t="",n,r){super(t,r),this.__highlightType=n}static getType(){return"code-highlight"}static clone(t){return new Aw(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const n=this.getWritable();return n.__highlightType=t||void 0,n}canHaveFormat(){return!1}createDOM(t){const n=super.createDOM(t),r=au(t.theme,this.__highlightType);return Qe(n,r),n}updateDOM(t,n,r){const o=super.updateDOM(t,n,r),i=au(r.theme,t.__highlightType),s=au(r.theme,this.__highlightType);return i!==s&&(i&&Un(n,i),s&&Qe(n,s)),o}static importJSON(t){return Mw().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return ur()}};function au(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function Mw(e="",t){return _t(new kw(e,t))}function Nw(e){return e instanceof kw}function GM(e,t){let n=e;for(let r=tt(e,t);r&&(Nw(r.origin)||Gl(r.origin));r=WA(r))n=r.origin;return n}function qM(e){return GM(e,"previous")}(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),n==="diff"&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+`].*(?:\r
51
51
  ?|
52
- |(?![\\s\\S])))+`,"m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(Prism);const BM=new Set(["http:","https:","mailto:","sms:","tel:"]);let Js=class Mw extends St{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new Mw(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",n={},r){super(r);const{target:o=null,rel:i=null,title:s=null}=n;this.__url=t,this.__target=o,this.__rel=i,this.__title=s}createDOM(t){const n=document.createElement("a");return this.updateLinkDOM(null,n,t),Qe(n,t.theme.link),n}updateLinkDOM(t,n,r){if(Pb(n)){t&&t.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(const o of["target","rel","title"]){const i=`__${o}`,s=this[i];t&&t[i]===s||(s?n[o]=s:n.removeAttribute(o))}}}updateDOM(t,n,r){return this.updateLinkDOM(t,n,r),!1}static importDOM(){return{a:t=>({conversion:zM,priority:1})}}static importJSON(t){return Sl().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){t=Ly(t);try{const n=new URL(Ly(t));if(!BM.has(n.protocol))return"about:blank"}catch{return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const n=this.getWritable();return n.__url=t,n}getTarget(){return this.getLatest().__target}setTarget(t){const n=this.getWritable();return n.__target=t,n}getRel(){return this.getLatest().__rel}setRel(t){const n=this.getWritable();return n.__rel=t,n}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();return n.__title=t,n}insertNewAfter(t,n=!0){const r=Sl(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,r){if(!W(n))return!1;const o=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(o)&&this.isParentOf(i)&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function zM(e){let t=null;if(Pb(e)){const n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=Sl(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Sl(e="",t){return _t(new Js(e,t))}function HM(e){return e instanceof Js}class Qs extends Js{__isUnlinked;constructor(t="",n={},r){super(t,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}static getType(){return"autolink"}static clone(t){return new Qs(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){const n=this.getWritable();return n.__isUnlinked=t,n}createDOM(t){return this.__isUnlinked?document.createElement("span"):super.createDOM(t)}updateDOM(t,n,r){return super.updateDOM(t,n,r)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){return Fy().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t,n=!0){const r=this.getParentOrThrow().insertNewAfter(t,n);if(B(r)){const o=Fy(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(o),o}return null}}function Fy(e="",t){return _t(new Qs(e,t))}function WM(e){return e instanceof Qs}const KM=/^\+?[0-9\s()-]{5,}$/;function Ly(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:KM.test(e)?`tel:${e}`:`https://${e}`}function Gd(e,t){const n={};for(const r of e){const o=t(r);o&&(n[o]?n[o].push(r):n[o]=[r])}return n}function jh(e){const t=Gd(e,n=>n.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const _l=/[!-/:-@[-`{-~\s]/,UM=/^\s{0,3}$/;function qd(e){if(!Gr(e))return!1;const t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&X(t)&&UM.test(t.getTextContent())}function GM(e,t,n,r){for(const o of t){if(!o.export)continue;const i=o.export(e,s=>Tl(s,n,r));if(i!=null)return i}return B(e)?Tl(e,n,r):Se(e)?e.getTextContent():null}function Tl(e,t,n,r,o){const i=[],s=e.getChildren();r||(r=[]),o||(o=[]);e:for(const a of s){for(const l of n){if(!l.export)continue;const c=l.export(a,u=>Tl(u,t,n,r,[...o,...r]),(u,f)=>$y(u,f,t,r,o));if(c!=null){i.push(c);continue e}}Bn(a)?i.push(`
53
- `):X(a)?i.push($y(a,a.getTextContent(),t,r,o)):B(a)?i.push(Tl(a,t,n,r,o)):Se(a)&&i.push(a.getTextContent())}return i.join("")}function $y(e,t,n,r,o){let i=e.getFormat()===0?t:(function(d){return d.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(t);e.hasFormat("code")||(i=i.replace(/([*_`~\\])/g,"\\$1"));let s="",a="",l="";const c=Oy(e,!0),u=Oy(e,!1),f=new Set;for(const d of n){const h=d.format[0],g=d.tag;Ta(e,h)&&!f.has(h)&&(f.add(h),Ta(c,h)&&r.find(p=>p.tag===g)||(r.push({format:h,tag:g}),s+=g))}for(let d=0;d<r.length;d++){const h=Ta(e,r[d].format),g=Ta(u,r[d].format);if(h&&g)continue;const p=[...r];for(;p.length>d;){const m=p.pop();o&&m&&o.find(x=>x.tag===m.tag)||(m&&typeof m.tag=="string"&&(h?g||(l+=m.tag):a+=m.tag),r.pop())}break}return i=s+i+l,a+i}function Oy(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const r=e.getParentOrThrow();r.isInline()&&(n=t?r.getPreviousSibling():r.getNextSibling())}for(;n;){if(B(n)){if(!n.isInline())break;const r=t?n.getLastDescendant():n.getFirstDescendant();if(X(r))return r;n=t?n.getPreviousSibling():n.getNextSibling()}if(X(n))return n;if(!B(n))return null}return null}function Ta(e,t){return X(e)&&e.hasFormat(t)}function qM(e,t){const n=(function(o,i){const s=o.match(i.openTagsRegExp);if(s==null)return null;for(const a of s){const l=a.replace(/^\s/,""),c=i.fullMatchRegExpByTag[l];if(c==null)continue;const u=o.match(c),f=i.transformersByTag[l];if(u!=null&&f!=null){if(f.intraword!==!1)return u;const{index:d=0}=u,h=o[d-1],g=o[d+u[0].length];if((!h||_l.test(h))&&(!g||_l.test(g)))return u}}return null})(e.getTextContent(),t);if(!n)return null;const r=n.index||0;return{endIndex:r+n[0].length,match:n,startIndex:r,transformer:t.transformersByTag[n[1]]}}function ro(e){return X(e)&&!e.hasFormat("code")}function oo(e,t,n){let r=qM(e,t),o=(function(s,a){const l=s;let c,u,f,d;for(const h of a){if(!h.replace||!h.importRegExp)continue;const g=l.getTextContent().match(h.importRegExp);if(!g)continue;const p=g.index||0,m=h.getEndIndex?h.getEndIndex(l,g):p+g[0].length;m!==!1&&(c===void 0||u===void 0||p<c&&(m>u||m<=c))&&(c=p,u=m,f=h,d=g)}return c===void 0||u===void 0||f===void 0||d===void 0?null:{endIndex:u,match:d,startIndex:c,transformer:f}})(e,n);if(r&&o&&(r.startIndex<=o.startIndex&&r.endIndex>=o.endIndex||o.startIndex>r.endIndex?o=null:r=null),r){const s=(function(a,l,c,u,f){const d=a.getTextContent();let h,g,p;if(f[0]===d?h=a:l===0?[h,g]=a.splitText(c):[p,h,g]=a.splitText(l,c),h.setTextContent(f[2]),u)for(const m of u.format)h.hasFormat(m)||h.toggleFormat(m);return{nodeAfter:g,nodeBefore:p,transformedNode:h}})(e,r.startIndex,r.endIndex,r.transformer,r.match);ro(s.nodeAfter)&&oo(s.nodeAfter,t,n),ro(s.nodeBefore)&&oo(s.nodeBefore,t,n),ro(s.transformedNode)&&oo(s.transformedNode,t,n)}else if(o){const s=(function(a,l,c,u,f){let d,h,g;return l===0?[d,h]=a.splitText(c):[g,d,h]=a.splitText(l,c),u.replace?{nodeAfter:h,nodeBefore:g,transformedNode:u.replace(d,f)||void 0}:null})(e,o.startIndex,o.endIndex,o.transformer,o.match);if(!s)return;ro(s.nodeAfter)&&oo(s.nodeAfter,t,n),ro(s.nodeBefore)&&oo(s.nodeBefore,t,n),ro(s.transformedNode)&&oo(s.transformedNode,t,n)}const i=e.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(s,a)=>String.fromCodePoint(a));e.setTextContent(i)}function YM(e,t=!1){const n=jh(e),r=(function(o){const i={},s={},a=[],l="(?<![\\\\])";for(const c of o){const{tag:u}=c;i[u]=c;const f=u.replace(/(\*|\^|\+)/g,"\\$1");a.push(f),u.length===1?s[u]=u==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${f}])(${f})((\\\\${f})?.*?[^${f}\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?![\\\\${f}])`):s[u]=new RegExp(`(?<!\\\\)(${f})((\\\\${f})?.*?[^\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?!\\\\)`)}return{fullMatchRegExpByTag:s,openTagsRegExp:new RegExp(`${l}(${a.join("|")})`,"g"),transformersByTag:i}})(n.textFormat);return(o,i)=>{const s=o.split(`
54
- `),a=s.length,l=i||qe();l.clear();for(let u=0;u<a;u++){const f=s[u],[d,h]=XM(s,u,n.multilineElement,l);d?u=h:ZM(f,l,n.element,r,n.textMatch,t)}const c=l.getChildren();for(const u of c)!t&&qd(u)&&l.getChildrenSize()>1&&u.remove();Y()!==null&&l.selectStart()}}function XM(e,t,n,r){for(const o of n){const{handleImportAfterStartMatch:i,regExpEnd:s,regExpStart:a,replace:l}=o,c=e[t].match(a);if(!c)continue;if(i){const g=i({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:o});if(g===null)continue;if(g)return g}const u=typeof s=="object"&&"regExp"in s?s.regExp:s,f=s&&typeof s=="object"&&"optional"in s?s.optional:!s;let d=t;const h=e.length;for(;d<h;){const g=u?e[d].match(u):null;if(!g&&(!f||f&&d<h-1)){d++;continue}if(g&&t===d&&g.index===c.index){d++;continue}const p=[];if(g&&t===d)p.push(e[t].slice(c[0].length,-g[0].length));else for(let m=t;m<=d;m++)if(m===t){const x=e[m].slice(c[0].length);p.push(x)}else if(m===d&&g){const x=e[m].slice(0,-g[0].length);p.push(x)}else p.push(e[m]);if(l(r,null,c,g,p,!0)!==!1)return[!0,d];break}}return[!1,t]}function ZM(e,t,n,r,o,i){const s=Le(e),a=me();a.append(s),t.append(a);for(const{regExp:l,replace:c}of n){const u=e.match(l);if(u&&(s.setTextContent(e.slice(u[0].length)),c(a,[s],u,!0)!==!1))break}if(oo(s,r,o),a.isAttached()&&e.length>0){const l=a.getPreviousSibling();if(!i&&(Gr(l)||Ud(l)||pe(l))){let c=l;if(pe(l)){const u=l.getLastDescendant();c=u==null?null:be(u,Re)}c!=null&&c.getTextContentSize()>0&&(c.splice(c.getChildrenSize(),0,[Tn(),...a.getChildren()]),a.remove())}}}function JM(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Nw=/^(\s*)(\d{1,})\.\s/,Pw=/^(\s*)[-*+]\s/,QM=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,Yd=/^(#{1,6})\s/,Fw=/^>\s/,Lw=/^[ \t]*```([\w-]+)?/,Xd=/[ \t]*```$/,eN=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,tN=/^(?:\|)(.+)(?:\|)\s?$/,nN=/^(\| ?:?-*:? ?)+\|\s?$/,Iy=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Dy=/^<\/[a-z_][\w-]*\s*>/i,Vy=e=>new RegExp(`(?:${e.source})$`,e.flags),fs=yA("mdListMarker",{parse:e=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-"}),$w=e=>(t,n,r,o)=>{const i=e(r);i.append(...n),t.replace(i),o||i.select(0,0)},Ow=e=>(t,n,r,o)=>{const i=t.getPreviousSibling(),s=t.getNextSibling(),a=Gt(e==="check"?r[3]==="x":void 0),l=r[0].trim()[0],c=e!=="bullet"&&e!=="check"||l!==fs.parse(l)?void 0:l;if(pe(s)&&s.getListType()===e){c&&jc(s,fs,c);const f=s.getFirstChild();f!==null?f.insertBefore(a):s.append(a),t.remove()}else if(pe(i)&&i.getListType()===e)c&&jc(i,fs,c),i.append(a),t.remove();else{const f=jt(e,e==="number"?Number(r[2]):void 0);c&&jc(f,fs,c),f.append(a),t.replace(f)}a.append(...n),o||a.select(0,0);const u=(function(f){const d=f.match(/\t/g),h=f.match(/ /g);let g=0;return d&&(g+=d.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);u&&a.setIndent(u)},Bh=(e,t,n)=>{const r=[],o=e.getChildren();let i=0;for(const s of o)if(Re(s)){if(s.getChildrenSize()===1){const f=s.getFirstChild();if(pe(f)){r.push(Bh(f,t,n+1));continue}}const a=" ".repeat(4*n),l=e.getListType(),c=A1(e,fs),u=l==="number"?`${e.getStart()+i}. `:l==="check"?`${c} [${s.getChecked()?"x":" "}] `:c+" ";r.push(a+u+t(s)),i++}return r.join(`
55
- `)},rN={dependencies:[Ql],export:(e,t)=>{if(!Sw(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:Yd,replace:$w(e=>{const t="h"+e[1].length;return co(t)}),type:"element"},oN={dependencies:[Jl],export:(e,t)=>{if(!Ud(e))return null;const n=t(e).split(`
52
+ |(?![\\s\\S])))+`,"m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(Prism);const YM=new Set(["http:","https:","mailto:","sms:","tel:"]);let ta=class Pw extends St{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new Pw(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",n={},r){super(r);const{target:o=null,rel:i=null,title:s=null}=n;this.__url=t,this.__target=o,this.__rel=i,this.__title=s}createDOM(t){const n=document.createElement("a");return this.updateLinkDOM(null,n,t),Qe(n,t.theme.link),n}updateLinkDOM(t,n,r){if(F1(n)){t&&t.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(const o of["target","rel","title"]){const i=`__${o}`,s=this[i];t&&t[i]===s||(s?n[o]=s:n.removeAttribute(o))}}}updateDOM(t,n,r){return this.updateLinkDOM(t,n,r),!1}static importDOM(){return{a:t=>({conversion:XM,priority:1})}}static importJSON(t){return El().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){t=Iy(t);try{const n=new URL(Iy(t));if(!YM.has(n.protocol))return"about:blank"}catch{return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const n=this.getWritable();return n.__url=t,n}getTarget(){return this.getLatest().__target}setTarget(t){const n=this.getWritable();return n.__target=t,n}getRel(){return this.getLatest().__rel}setRel(t){const n=this.getWritable();return n.__rel=t,n}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();return n.__title=t,n}insertNewAfter(t,n=!0){const r=El(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,r){if(!W(n))return!1;const o=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(o)&&this.isParentOf(i)&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function XM(e){let t=null;if(F1(e)){const n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=El(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function El(e="",t){return _t(new ta(e,t))}function ZM(e){return e instanceof ta}class na extends ta{__isUnlinked;constructor(t="",n={},r){super(t,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}static getType(){return"autolink"}static clone(t){return new na(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){const n=this.getWritable();return n.__isUnlinked=t,n}createDOM(t){return this.__isUnlinked?document.createElement("span"):super.createDOM(t)}updateDOM(t,n,r){return super.updateDOM(t,n,r)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){return Oy().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t,n=!0){const r=this.getParentOrThrow().insertNewAfter(t,n);if(B(r)){const o=Oy(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(o),o}return null}}function Oy(e="",t){return _t(new na(e,t))}function JM(e){return e instanceof na}const QM=/^\+?[0-9\s()-]{5,}$/;function Iy(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:QM.test(e)?`tel:${e}`:`https://${e}`}function Zd(e,t){const n={};for(const r of e){const o=t(r);o&&(n[o]?n[o].push(r):n[o]=[r])}return n}function Hh(e){const t=Zd(e,n=>n.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const Rl=/[!-/:-@[-`{-~\s]/,eN=/^\s{0,3}$/;function Jd(e){if(!qr(e))return!1;const t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&X(t)&&eN.test(t.getTextContent())}function tN(e,t,n,r){for(const o of t){if(!o.export)continue;const i=o.export(e,s=>kl(s,n,r));if(i!=null)return i}return B(e)?kl(e,n,r):_e(e)?e.getTextContent():null}function kl(e,t,n,r,o){const i=[],s=e.getChildren();r||(r=[]),o||(o=[]);e:for(const a of s){for(const l of n){if(!l.export)continue;const c=l.export(a,u=>kl(u,t,n,r,[...o,...r]),(u,f)=>Dy(u,f,t,r,o));if(c!=null){i.push(c);continue e}}zn(a)?i.push(`
53
+ `):X(a)?i.push(Dy(a,a.getTextContent(),t,r,o)):B(a)?i.push(kl(a,t,n,r,o)):_e(a)&&i.push(a.getTextContent())}return i.join("")}function Dy(e,t,n,r,o){let i=e.getFormat()===0?t:(function(d){return d.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(t);e.hasFormat("code")||(i=i.replace(/([*_`~\\])/g,"\\$1"));let s="",a="",l="";const c=jy(e,!0),u=jy(e,!1),f=new Set;for(const d of n){const h=d.format[0],g=d.tag;ka(e,h)&&!f.has(h)&&(f.add(h),ka(c,h)&&r.find(p=>p.tag===g)||(r.push({format:h,tag:g}),s+=g))}for(let d=0;d<r.length;d++){const h=ka(e,r[d].format),g=ka(u,r[d].format);if(h&&g)continue;const p=[...r];for(;p.length>d;){const m=p.pop();o&&m&&o.find(x=>x.tag===m.tag)||(m&&typeof m.tag=="string"&&(h?g||(l+=m.tag):a+=m.tag),r.pop())}break}return i=s+i+l,a+i}function jy(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const r=e.getParentOrThrow();r.isInline()&&(n=t?r.getPreviousSibling():r.getNextSibling())}for(;n;){if(B(n)){if(!n.isInline())break;const r=t?n.getLastDescendant():n.getFirstDescendant();if(X(r))return r;n=t?n.getPreviousSibling():n.getNextSibling()}if(X(n))return n;if(!B(n))return null}return null}function ka(e,t){return X(e)&&e.hasFormat(t)}function nN(e,t){const n=(function(o,i){const s=o.match(i.openTagsRegExp);if(s==null)return null;for(const a of s){const l=a.replace(/^\s/,""),c=i.fullMatchRegExpByTag[l];if(c==null)continue;const u=o.match(c),f=i.transformersByTag[l];if(u!=null&&f!=null){if(f.intraword!==!1)return u;const{index:d=0}=u,h=o[d-1],g=o[d+u[0].length];if((!h||Rl.test(h))&&(!g||Rl.test(g)))return u}}return null})(e.getTextContent(),t);if(!n)return null;const r=n.index||0;return{endIndex:r+n[0].length,match:n,startIndex:r,transformer:t.transformersByTag[n[1]]}}function io(e){return X(e)&&!e.hasFormat("code")}function so(e,t,n){let r=nN(e,t),o=(function(s,a){const l=s;let c,u,f,d;for(const h of a){if(!h.replace||!h.importRegExp)continue;const g=l.getTextContent().match(h.importRegExp);if(!g)continue;const p=g.index||0,m=h.getEndIndex?h.getEndIndex(l,g):p+g[0].length;m!==!1&&(c===void 0||u===void 0||p<c&&(m>u||m<=c))&&(c=p,u=m,f=h,d=g)}return c===void 0||u===void 0||f===void 0||d===void 0?null:{endIndex:u,match:d,startIndex:c,transformer:f}})(e,n);if(r&&o&&(r.startIndex<=o.startIndex&&r.endIndex>=o.endIndex||o.startIndex>r.endIndex?o=null:r=null),r){const s=(function(a,l,c,u,f){const d=a.getTextContent();let h,g,p;if(f[0]===d?h=a:l===0?[h,g]=a.splitText(c):[p,h,g]=a.splitText(l,c),h.setTextContent(f[2]),u)for(const m of u.format)h.hasFormat(m)||h.toggleFormat(m);return{nodeAfter:g,nodeBefore:p,transformedNode:h}})(e,r.startIndex,r.endIndex,r.transformer,r.match);io(s.nodeAfter)&&so(s.nodeAfter,t,n),io(s.nodeBefore)&&so(s.nodeBefore,t,n),io(s.transformedNode)&&so(s.transformedNode,t,n)}else if(o){const s=(function(a,l,c,u,f){let d,h,g;return l===0?[d,h]=a.splitText(c):[g,d,h]=a.splitText(l,c),u.replace?{nodeAfter:h,nodeBefore:g,transformedNode:u.replace(d,f)||void 0}:null})(e,o.startIndex,o.endIndex,o.transformer,o.match);if(!s)return;io(s.nodeAfter)&&so(s.nodeAfter,t,n),io(s.nodeBefore)&&so(s.nodeBefore,t,n),io(s.transformedNode)&&so(s.transformedNode,t,n)}const i=e.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(s,a)=>String.fromCodePoint(a));e.setTextContent(i)}function rN(e,t=!1){const n=Hh(e),r=(function(o){const i={},s={},a=[],l="(?<![\\\\])";for(const c of o){const{tag:u}=c;i[u]=c;const f=u.replace(/(\*|\^|\+)/g,"\\$1");a.push(f),u.length===1?s[u]=u==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${f}])(${f})((\\\\${f})?.*?[^${f}\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?![\\\\${f}])`):s[u]=new RegExp(`(?<!\\\\)(${f})((\\\\${f})?.*?[^\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?!\\\\)`)}return{fullMatchRegExpByTag:s,openTagsRegExp:new RegExp(`${l}(${a.join("|")})`,"g"),transformersByTag:i}})(n.textFormat);return(o,i)=>{const s=o.split(`
54
+ `),a=s.length,l=i||qe();l.clear();for(let u=0;u<a;u++){const f=s[u],[d,h]=oN(s,u,n.multilineElement,l);d?u=h:iN(f,l,n.element,r,n.textMatch,t)}const c=l.getChildren();for(const u of c)!t&&Jd(u)&&l.getChildrenSize()>1&&u.remove();Y()!==null&&l.selectStart()}}function oN(e,t,n,r){for(const o of n){const{handleImportAfterStartMatch:i,regExpEnd:s,regExpStart:a,replace:l}=o,c=e[t].match(a);if(!c)continue;if(i){const g=i({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:o});if(g===null)continue;if(g)return g}const u=typeof s=="object"&&"regExp"in s?s.regExp:s,f=s&&typeof s=="object"&&"optional"in s?s.optional:!s;let d=t;const h=e.length;for(;d<h;){const g=u?e[d].match(u):null;if(!g&&(!f||f&&d<h-1)){d++;continue}if(g&&t===d&&g.index===c.index){d++;continue}const p=[];if(g&&t===d)p.push(e[t].slice(c[0].length,-g[0].length));else for(let m=t;m<=d;m++)if(m===t){const x=e[m].slice(c[0].length);p.push(x)}else if(m===d&&g){const x=e[m].slice(0,-g[0].length);p.push(x)}else p.push(e[m]);if(l(r,null,c,g,p,!0)!==!1)return[!0,d];break}}return[!1,t]}function iN(e,t,n,r,o,i){const s=Fe(e),a=ye();a.append(s),t.append(a);for(const{regExp:l,replace:c}of n){const u=e.match(l);if(u&&(s.setTextContent(e.slice(u[0].length)),c(a,[s],u,!0)!==!1))break}if(so(s,r,o),a.isAttached()&&e.length>0){const l=a.getPreviousSibling();if(!i&&(qr(l)||Xd(l)||pe(l))){let c=l;if(pe(l)){const u=l.getLastDescendant();c=u==null?null:we(u,ke)}c!=null&&c.getTextContentSize()>0&&(c.splice(c.getChildrenSize(),0,[Tn(),...a.getChildren()]),a.remove())}}}function sN(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Lw=/^(\s*)(\d{1,})\.\s/,Fw=/^(\s*)[-*+]\s/,aN=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,Qd=/^(#{1,6})\s/,$w=/^>\s/,Ow=/^[ \t]*```([\w-]+)?/,ef=/[ \t]*```$/,lN=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,cN=/^(?:\|)(.+)(?:\|)\s?$/,uN=/^(\| ?:?-*:? ?)+\|\s?$/,Vy=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,By=/^<\/[a-z_][\w-]*\s*>/i,zy=e=>new RegExp(`(?:${e.source})$`,e.flags),gs=T3("mdListMarker",{parse:e=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-"}),Iw=e=>(t,n,r,o)=>{const i=e(r);i.append(...n),t.replace(i),o||i.select(0,0)},Dw=e=>(t,n,r,o)=>{const i=t.getPreviousSibling(),s=t.getNextSibling(),a=Gt(e==="check"?r[3]==="x":void 0),l=r[0].trim()[0],c=e!=="bullet"&&e!=="check"||l!==gs.parse(l)?void 0:l;if(pe(s)&&s.getListType()===e){c&&Wc(s,gs,c);const f=s.getFirstChild();f!==null?f.insertBefore(a):s.append(a),t.remove()}else if(pe(i)&&i.getListType()===e)c&&Wc(i,gs,c),i.append(a),t.remove();else{const f=Vt(e,e==="number"?Number(r[2]):void 0);c&&Wc(f,gs,c),f.append(a),t.replace(f)}a.append(...n),o||a.select(0,0);const u=(function(f){const d=f.match(/\t/g),h=f.match(/ /g);let g=0;return d&&(g+=d.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);u&&a.setIndent(u)},Wh=(e,t,n)=>{const r=[],o=e.getChildren();let i=0;for(const s of o)if(ke(s)){if(s.getChildrenSize()===1){const f=s.getFirstChild();if(pe(f)){r.push(Wh(f,t,n+1));continue}}const a=" ".repeat(4*n),l=e.getListType(),c=Nb(e,gs),u=l==="number"?`${e.getStart()+i}. `:l==="check"?`${c} [${s.getChecked()?"x":" "}] `:c+" ";r.push(a+u+t(s)),i++}return r.join(`
55
+ `)},dN={dependencies:[rc],export:(e,t)=>{if(!Tw(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:Qd,replace:Iw(e=>{const t="h"+e[1].length;return fo(t)}),type:"element"},fN={dependencies:[nc],export:(e,t)=>{if(!Xd(e))return null;const n=t(e).split(`
56
56
  `),r=[];for(const o of n)r.push("> "+o);return r.join(`
57
- `)},regExp:Fw,replace:(e,t,n,r)=>{if(r){const i=e.getPreviousSibling();if(Ud(i))return i.splice(i.getChildrenSize(),0,[Tn(),...t]),void e.remove()}const o=Dh();o.append(...t),e.replace(o),r||o.select(0,0)},type:"element"},iN={dependencies:[ec],export:e=>{if(!Vh(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?`
58
- `+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:Xd},regExpStart:Lw,replace:(e,t,n,r,o,i)=>{let s,a;if(!t&&o){if(o.length===1)r?(s=cr(),a=n[1]+o[0]):(s=cr(n[1]),a=o[0].startsWith(" ")?o[0].slice(1):o[0]);else{if(s=cr(n[1]),o[0].trim().length===0)for(;o.length>0&&!o[0].length;)o.shift();else o[0]=o[0].startsWith(" ")?o[0].slice(1):o[0];for(;o.length>0&&!o[o.length-1].length;)o.pop();a=o.join(`
59
- `)}const l=Le(a);s.append(l),e.append(s)}else t&&$w(l=>cr(l?l[1]:void 0))(e,t,n,i)},type:"multiline-element"},sN={dependencies:[$o,qr],export:(e,t)=>pe(e)?Bh(e,t,0):null,regExp:Pw,replace:Ow("bullet"),type:"element"},aN={dependencies:[$o,qr],export:(e,t)=>pe(e)?Bh(e,t,0):null,regExp:Nw,replace:Ow("number"),type:"element"},lN={format:["code"],tag:"`",type:"text-format"},cN={format:["highlight"],tag:"==",type:"text-format"},uN={format:["bold","italic"],tag:"***",type:"text-format"},dN={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},fN={format:["bold"],tag:"**",type:"text-format"},hN={format:["bold"],intraword:!1,tag:"__",type:"text-format"},gN={format:["strikethrough"],tag:"~~",type:"text-format"},pN={format:["italic"],tag:"*",type:"text-format"},mN={format:["italic"],intraword:!1,tag:"_",type:"text-format"},yN={dependencies:[Js],export:(e,t,n)=>{if(!HM(e)||WM(e))return null;const r=e.getTitle(),o=t(e);return r?`[${o}](${e.getURL()} "${r}")`:`[${o}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,o]=t,i=Sl(r,{title:o}),s=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(s<a)return;if(s>a){const f=n.split("[");c="["+f[0],l=f.slice(1).join("[")}const u=Le(l);return u.setFormat(e.getFormat()),i.append(u),e.replace(i),c&&i.insertBefore(Le(c)),u},trigger:")",type:"text-match"},vN=[rN,oN,sN,aN],xN=[iN],bN=[lN,uN,dN,fN,hN,cN,pN,mN,gN],wN=[yN],ea=[...vN,...xN,...bN,...wN];function jy(e,t,n){const r=n.length;for(let o=t;o>=r;o--){const i=o-r;if(Iw(e,i,n,0,r)&&e[i+r]!==" ")return i}return-1}function Iw(e,t,n,r,o){for(let i=0;i<o;i++)if(e[t+i]!==n[r+i])return!1;return!0}function CN(e,t=ea){const n=jh(t),r=Gd(n.textFormat,({tag:s})=>s[s.length-1]),o=Gd(n.textMatch,({trigger:s})=>s);for(const s of t){const a=s.type;if(a==="element"||a==="text-match"||a==="multiline-element"){const l=s.dependencies;for(const c of l)e.hasNode(c)||JM(173,c.getType())}}const i=(s,a,l)=>{(function(c,u,f,d){const h=c.getParent();if(!pt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExp:p,replace:m}of d){const x=g.match(p);if(x&&x[0].length===(x[0].endsWith(" ")?f:f-1)){const y=u.getNextSiblings(),[v,b]=u.splitText(f);if(m(c,b?[b,...y]:y,x,!1)!==!1)return v.remove(),!0}}return!1})(s,a,l,n.element)||(function(c,u,f,d){const h=c.getParent();if(!pt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExpStart:p,replace:m,regExpEnd:x}of d){if(x&&!("optional"in x)||x&&"optional"in x&&!x.optional)continue;const y=g.match(p);if(y&&y[0].length===(y[0].endsWith(" ")?f:f-1)){const v=u.getNextSiblings(),[b,w]=u.splitText(f);if(m(c,w?[w,...v]:v,y,null,null,!1)!==!1)return b.remove(),!0}}return!1})(s,a,l,n.multilineElement)||(function(c,u,f){let d=c.getTextContent();const h=f[d[u-1]];if(h==null)return!1;u<d.length&&(d=d.slice(0,u));for(const g of h){if(!g.replace||!g.regExp)continue;const p=d.match(g.regExp);if(p===null)continue;const m=p.index||0,x=m+p[0].length;let y;return m===0?[y]=c.splitText(x):[,y]=c.splitText(m,x),y.selectNext(0,0),g.replace(y,p),!0}return!1})(a,l,o)||(function(c,u,f){const d=c.getTextContent(),h=u-1,g=d[h],p=f[g];if(!p)return!1;for(const m of p){const{tag:x}=m,y=x.length,v=h-y+1;if(y>1&&!Iw(d,v,x,0,y)||d[v-1]===" ")continue;const b=d[h+1];if(m.intraword===!1&&b&&!_l.test(b))continue;const w=c;let _=w,E=jy(d,v,x),T=_;for(;E<0&&(T=T.getPreviousSibling())&&!Bn(T);)if(X(T)){if(T.hasFormat("code"))continue;const F=T.getTextContent();_=T,E=jy(F,F.length,x)}if(E<0||_===w&&E+y===v)continue;const k=_.getTextContent();if(E>0&&k[E-1]===g)continue;const P=k[E-1];if(m.intraword===!1&&P&&!_l.test(P))continue;const O=w.getTextContent(),D=O.slice(0,v)+O.slice(h+1);w.setTextContent(D);const I=_===w?D:k;_.setTextContent(I.slice(0,E)+I.slice(E+y));const $=Y(),H=Kl();Ge(H);const U=h-y*(_===w?2:1)+1;H.anchor.set(_.__key,E,"text"),H.focus.set(w.__key,U,"text");for(const F of m.format)H.hasFormat(F)||H.formatText(F);H.anchor.set(H.focus.key,H.focus.offset,H.focus.type);for(const F of m.format)H.hasFormat(F)&&H.toggleFormat(F);return W($)&&(H.format=$.format),!0}})(a,l,r)};return e.registerUpdateListener(({tags:s,dirtyLeaves:a,editorState:l,prevEditorState:c})=>{if(s.has(ob)||s.has(IA)||e.isComposing())return;const u=l.read(Y),f=c.read(Y);if(!W(f)||!W(u)||!u.isCollapsed()||u.is(f))return;const d=u.anchor.key,h=u.anchor.offset,g=l._nodeMap.get(d);!X(g)||!a.has(d)||h!==1&&h>f.anchor.offset+1||e.update(()=>{if(!ro(g))return;const p=g.getParent();p===null||Vh(p)||i(p,g,u.anchor.offset)})})}function SN(e,t=ea,n,r=!1,o=!1){const i=r?e:(function(s,a=!1){const l=s.split(`
60
- `);let c=!1;const u=[];for(let f=0;f<l.length;f++){const d=l[f].trimEnd(),h=u[u.length-1];eN.test(d)?u.push(d):Lw.test(d)||Xd.test(d)?(c=!c,u.push(d)):c||d===""||h===""||!h||Yd.test(h)||Yd.test(d)||Fw.test(d)||Nw.test(d)||Pw.test(d)||QM.test(d)||tN.test(d)||nN.test(d)||!a||Iy.test(d)||Dy.test(d)||Vy(Dy).test(h)||Vy(Iy).test(h)||Xd.test(h)?u.push(d):u[u.length-1]=h+" "+d.trimStart()}return u.join(`
61
- `)})(e,o);return YM(t,r)(i,n)}function _N(e=ea,t,n=!1){return(function(o,i=!1){const s=jh(o),a=[...s.multilineElement,...s.element],l=!i,c=s.textFormat.filter(u=>u.format.length===1).sort((u,f)=>Number(u.format.includes("code"))-Number(f.format.includes("code")));return u=>{const f=[],d=(u||qe()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],p=GM(g,a,c,s.textMatch);p!=null&&f.push(l&&h>0&&!qd(g)&&!qd(d[h-1])?`
57
+ `)},regExp:$w,replace:(e,t,n,r)=>{if(r){const i=e.getPreviousSibling();if(Xd(i))return i.splice(i.getChildrenSize(),0,[Tn(),...t]),void e.remove()}const o=Bh();o.append(...t),e.replace(o),r||o.select(0,0)},type:"element"},hN={dependencies:[oc],export:e=>{if(!zh(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?`
58
+ `+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:ef},regExpStart:Ow,replace:(e,t,n,r,o,i)=>{let s,a;if(!t&&o){if(o.length===1)r?(s=ur(),a=n[1]+o[0]):(s=ur(n[1]),a=o[0].startsWith(" ")?o[0].slice(1):o[0]);else{if(s=ur(n[1]),o[0].trim().length===0)for(;o.length>0&&!o[0].length;)o.shift();else o[0]=o[0].startsWith(" ")?o[0].slice(1):o[0];for(;o.length>0&&!o[o.length-1].length;)o.pop();a=o.join(`
59
+ `)}const l=Fe(a);s.append(l),e.append(s)}else t&&Iw(l=>ur(l?l[1]:void 0))(e,t,n,i)},type:"multiline-element"},gN={dependencies:[Io,Yr],export:(e,t)=>pe(e)?Wh(e,t,0):null,regExp:Fw,replace:Dw("bullet"),type:"element"},pN={dependencies:[Io,Yr],export:(e,t)=>pe(e)?Wh(e,t,0):null,regExp:Lw,replace:Dw("number"),type:"element"},mN={format:["code"],tag:"`",type:"text-format"},yN={format:["highlight"],tag:"==",type:"text-format"},vN={format:["bold","italic"],tag:"***",type:"text-format"},xN={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},bN={format:["bold"],tag:"**",type:"text-format"},wN={format:["bold"],intraword:!1,tag:"__",type:"text-format"},CN={format:["strikethrough"],tag:"~~",type:"text-format"},SN={format:["italic"],tag:"*",type:"text-format"},_N={format:["italic"],intraword:!1,tag:"_",type:"text-format"},TN={dependencies:[ta],export:(e,t,n)=>{if(!ZM(e)||JM(e))return null;const r=e.getTitle(),o=t(e);return r?`[${o}](${e.getURL()} "${r}")`:`[${o}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,o]=t,i=El(r,{title:o}),s=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(s<a)return;if(s>a){const f=n.split("[");c="["+f[0],l=f.slice(1).join("[")}const u=Fe(l);return u.setFormat(e.getFormat()),i.append(u),e.replace(i),c&&i.insertBefore(Fe(c)),u},trigger:")",type:"text-match"},EN=[dN,fN,gN,pN],RN=[hN],kN=[mN,vN,xN,bN,wN,yN,SN,_N,CN],AN=[TN],ra=[...EN,...RN,...kN,...AN];function Hy(e,t,n){const r=n.length;for(let o=t;o>=r;o--){const i=o-r;if(jw(e,i,n,0,r)&&e[i+r]!==" ")return i}return-1}function jw(e,t,n,r,o){for(let i=0;i<o;i++)if(e[t+i]!==n[r+i])return!1;return!0}function MN(e,t=ra){const n=Hh(t),r=Zd(n.textFormat,({tag:s})=>s[s.length-1]),o=Zd(n.textMatch,({trigger:s})=>s);for(const s of t){const a=s.type;if(a==="element"||a==="text-match"||a==="multiline-element"){const l=s.dependencies;for(const c of l)e.hasNode(c)||sN(173,c.getType())}}const i=(s,a,l)=>{(function(c,u,f,d){const h=c.getParent();if(!pt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExp:p,replace:m}of d){const x=g.match(p);if(x&&x[0].length===(x[0].endsWith(" ")?f:f-1)){const y=u.getNextSiblings(),[v,b]=u.splitText(f);if(m(c,b?[b,...y]:y,x,!1)!==!1)return v.remove(),!0}}return!1})(s,a,l,n.element)||(function(c,u,f,d){const h=c.getParent();if(!pt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExpStart:p,replace:m,regExpEnd:x}of d){if(x&&!("optional"in x)||x&&"optional"in x&&!x.optional)continue;const y=g.match(p);if(y&&y[0].length===(y[0].endsWith(" ")?f:f-1)){const v=u.getNextSiblings(),[b,w]=u.splitText(f);if(m(c,w?[w,...v]:v,y,null,null,!1)!==!1)return b.remove(),!0}}return!1})(s,a,l,n.multilineElement)||(function(c,u,f){let d=c.getTextContent();const h=f[d[u-1]];if(h==null)return!1;u<d.length&&(d=d.slice(0,u));for(const g of h){if(!g.replace||!g.regExp)continue;const p=d.match(g.regExp);if(p===null)continue;const m=p.index||0,x=m+p[0].length;let y;return m===0?[y]=c.splitText(x):[,y]=c.splitText(m,x),y.selectNext(0,0),g.replace(y,p),!0}return!1})(a,l,o)||(function(c,u,f){const d=c.getTextContent(),h=u-1,g=d[h],p=f[g];if(!p)return!1;for(const m of p){const{tag:x}=m,y=x.length,v=h-y+1;if(y>1&&!jw(d,v,x,0,y)||d[v-1]===" ")continue;const b=d[h+1];if(m.intraword===!1&&b&&!Rl.test(b))continue;const w=c;let _=w,E=Hy(d,v,x),T=_;for(;E<0&&(T=T.getPreviousSibling())&&!zn(T);)if(X(T)){if(T.hasFormat("code"))continue;const L=T.getTextContent();_=T,E=Hy(L,L.length,x)}if(E<0||_===w&&E+y===v)continue;const k=_.getTextContent();if(E>0&&k[E-1]===g)continue;const P=k[E-1];if(m.intraword===!1&&P&&!Rl.test(P))continue;const O=w.getTextContent(),D=O.slice(0,v)+O.slice(h+1);w.setTextContent(D);const I=_===w?D:k;_.setTextContent(I.slice(0,E)+I.slice(E+y));const $=Y(),H=Yl();Ge(H);const U=h-y*(_===w?2:1)+1;H.anchor.set(_.__key,E,"text"),H.focus.set(w.__key,U,"text");for(const L of m.format)H.hasFormat(L)||H.formatText(L);H.anchor.set(H.focus.key,H.focus.offset,H.focus.type);for(const L of m.format)H.hasFormat(L)&&H.toggleFormat(L);return W($)&&(H.format=$.format),!0}})(a,l,r)};return e.registerUpdateListener(({tags:s,dirtyLeaves:a,editorState:l,prevEditorState:c})=>{if(s.has(s1)||s.has(K3)||e.isComposing())return;const u=l.read(Y),f=c.read(Y);if(!W(f)||!W(u)||!u.isCollapsed()||u.is(f))return;const d=u.anchor.key,h=u.anchor.offset,g=l._nodeMap.get(d);!X(g)||!a.has(d)||h!==1&&h>f.anchor.offset+1||e.update(()=>{if(!io(g))return;const p=g.getParent();p===null||zh(p)||i(p,g,u.anchor.offset)})})}function Vw(e,t=ra,n,r=!1,o=!1){const i=r?e:(function(s,a=!1){const l=s.split(`
60
+ `);let c=!1;const u=[];for(let f=0;f<l.length;f++){const d=l[f].trimEnd(),h=u[u.length-1];lN.test(d)?u.push(d):Ow.test(d)||ef.test(d)?(c=!c,u.push(d)):c||d===""||h===""||!h||Qd.test(h)||Qd.test(d)||$w.test(d)||Lw.test(d)||Fw.test(d)||aN.test(d)||cN.test(d)||uN.test(d)||!a||Vy.test(d)||By.test(d)||zy(By).test(h)||zy(Vy).test(h)||ef.test(h)?u.push(d):u[u.length-1]=h+" "+d.trimStart()}return u.join(`
61
+ `)})(e,o);return rN(t,r)(i,n)}function NN(e=ra,t,n=!1){return(function(o,i=!1){const s=Hh(o),a=[...s.multilineElement,...s.element],l=!i,c=s.textFormat.filter(u=>u.format.length===1).sort((u,f)=>Number(u.format.includes("code"))-Number(f.format.includes("code")));return u=>{const f=[],d=(u||qe()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],p=tN(g,a,c,s.textMatch);p!=null&&f.push(l&&h>0&&!Jd(g)&&!Jd(d[h-1])?`
62
62
  `.concat(p):p)}return f.join(`
63
- `)}})(e,n)(t)}function TN({defaultSelection:e}){const[t]=it();return S.useEffect(()=>{t.focus(()=>{const n=document.activeElement,r=t.getRootElement();r===null||n!==null&&r.contains(n)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}const Dw=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,EN=Dw?S.useLayoutEffect:S.useEffect,Ea={tag:hi};function RN({initialConfig:e,children:t}){const n=S.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:a,html:l}=e,c=Yk(null,r),u=yb({editable:e.editable,html:l,namespace:o,nodes:i,onError:f=>s(f,u),theme:r});return(function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=qe();if(h.isEmpty()){const g=me();h.append(g);const p=Dw?document.activeElement:null;(Y()!==null||p!==null&&p===f.getRootElement())&&g.select()}},Ea);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,Ea);break}case"object":f.setEditorState(d,Ea);break;case"function":f.update(()=>{qe().isEmpty()&&d(f)},Ea)}}})(u,a),[u,c]},[]);return EN(()=>{const r=e.editable,[o]=n;o.setEditable(r===void 0||r)},[]),C.jsx(b1.Provider,{value:n,children:t})}function kN(){return qe().getTextContent()}function AN(e,t=!0){if(e)return!1;let n=kN();return t&&(n=n.trim()),n===""}function MN(e){if(!AN(e,!1))return!1;const t=qe().getChildren(),n=t.length;if(n>1)return!1;for(let r=0;r<n;r++){const o=t[r];if(Se(o))return!1;if(B(o)){if(!Gr(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let a=0;a<s;a++){const l=i[r];if(!X(l))return!1}}}return!0}function Vw(e){return()=>MN(e)}function NN(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function PN(e,t,n,r){const o=s=>s instanceof n,i=s=>{const a=Le(s.getTextContent());a.setFormat(s.getFormat()),s.replace(a)};return[e.registerNodeTransform(un,s=>{if(!s.isSimpleText())return;let a,l=s.getPreviousSibling(),c=s.getTextContent(),u=s;if(X(l)){const d=l.getTextContent(),h=t(d+c);if(o(l)){if(h===null||(g=>g.getLatest().__mode)(l)!==0)return void i(l);{const g=h.end-d.length;if(g>0){const p=d+c.slice(0,g);if(l.select(),l.setTextContent(p),g===c.length)s.remove();else{const m=c.slice(g);s.setTextContent(m)}return}}}else if(h===null||h.start<d.length)return}let f=0;for(;;){a=t(c);let d,h=a===null?"":c.slice(a.end);if(c=h,h===""){const p=u.getNextSibling();if(X(p)){h=u.getTextContent()+p.getTextContent();const m=t(h);if(m===null)return void(o(p)?i(p):p.markDirty());if(m.start!==0)return}}if(a===null)return;if(a.start===0&&X(l)&&l.isTextEntity()){f+=a.end;continue}a.start===0?[d,u]=u.splitText(a.end):[,d,u]=u.splitText(a.start+f,a.end+f),d===void 0&&NN(165,"nodeToReplace");const g=r(d);if(g.setFormat(d.getFormat()),d.replace(g),u==null)return;f=0,l=g}}),e.registerNodeTransform(n,s=>{const a=s.getTextContent(),l=t(a);if(l===null||l.start!==0)return void i(s);if(a.length>l.end)return void s.splitText(l.end);const c=s.getPreviousSibling();X(c)&&c.isTextEntity()&&(i(c),i(s));const u=s.getNextSibling();X(u)&&u.isTextEntity()&&(i(u),o(s)&&i(s))})]}let tc=class jw extends un{static getType(){return"hashtag"}static clone(t){return new jw(t.__text,t.__key)}createDOM(t){const n=super.createDOM(t);return Qe(n,t.theme.hashtag),n}static importJSON(t){return Bw().updateFromJSON(t)}canInsertTextBefore(){return!1}isTextEntity(){return!0}};function Bw(e=""){return _t(new tc(e))}const FN=new RegExp((function(){const{alpha:e,alphanumeric:t,hashChars:n}=(function(){const o=String.fromCharCode,i="A-Za-zªµºÀ-ÖØ-öø-Ɂɐ-ˁˆ-ˑˠ-ˤˮͺΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϵϷ-ҁҊ-ӎӐ-ӹԀ-ԏԱ-Ֆՙա-ևא-תװ-ײء-غـ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ݭހ-ޥޱऄ-हऽॐक़-ॡॽঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཪྈ-ྋက-အဣ-ဧဩ-ဪၐ-ၕႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᴀ-ᶿḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℱℳ-ℹℼ-ℿⅅ-ⅉⰀ-Ⱞⰰ-ⱞⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〆〱-〵〻-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄬㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-龻ꀀ-ꒌꠀ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢ가-힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵÀ-ÖØ-öø-ÿĀ-ɏɓ-ɔɖ-ɗəɛɣɨɯɲʉʋʻ̀-ͯḀ-ỿЀ-ӿԀ-ԧⷠ-ⷿꙀ-֑ꚟ-ֿׁ-ׂׄ-ׇׅא-תװ-״﬒-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏؐ-ؚؠ-ٟٮ-ۓە-ۜ۞-۪ۨ-ۯۺ-ۼۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼ‌-‌ก-ฺเ-๎ᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿"+o(173824)+"-"+o(177983)+o(177984)+"-"+o(178207)+o(194560)+"-"+o(195103)+"〃々〻";return{alpha:i,alphanumeric:i+"̀-ͯ҃-֑҆-ֹֻ-ֽֿׁ-ׂׄ-ׇׅؐ-ًؕ-ٰٞۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ްँ-ः़ा-्॑-॔ॢ-ॣঁ-ঃ়া-ৄে-ৈো-্ৗৢ-ৣਁ-ਃ਼ਾ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗං-ඃ්ා-ුූෘ-ෟෲ-ෳัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾-༿ཱ-྄྆-྇ྐ-ྗྙ-ྼ࿆ာ-ဲံ-္ၖ-ၙ፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈ-ᧉᨗ-ᨛ᷀-᷃⃐-⃥⃜⃡-⃫〪-゙〯-゚ꠂ꠆ꠋꠣ-ꠧﬞ︀-️︠-︣0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉០-៩᠐-᠙᥆-᥏᧐-᧙0-9_",hashChars:"#\\uFF03"}})(),r="["+t+"]";return"("+("^|$|[^&/"+t+"]")+")("+("["+n+"]")+")("+r+"*"+("["+e+"]")+r+"*)"})(),"i"),LN={getHashtagMatch:function(e){const t=FN.exec(e);if(t===null)return null;const n=t[3].length+1,r=t.index+t[1].length;return{end:r+n,start:r}}};function $N(e,t=LN){return Rn(...PN(e,t.getHashtagMatch,tc,n=>Bw(n.getTextContent())))}function ON(){const[e]=it();return S.useEffect(()=>{if(!e.hasNodes([tc]))throw new Error("HashtagPlugin: HashtagNode not registered on editor");return $N(e)},[e]),null}function IN({hasStrictIndent:e=!1}){const[t]=it();return S.useEffect(()=>{if(!t.hasNodes([$o,qr]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[t]),S.useEffect(()=>{if(e)return hM(t)},[t,e]),(function(n){S.useEffect(()=>fM(n),[n])})(t),null}function By(e,t){return e.getEditorState().read(()=>{const n=Pe(t);return n!==null&&n.isSelected()})}function DN(e){const[t]=it(),[n,r]=S.useState(()=>By(t,e));return S.useEffect(()=>{let o=!0;const i=t.registerUpdateListener(()=>{o&&r(By(t,e))});return()=>{o=!1,i()}},[t,e]),[n,S.useCallback(o=>{t.update(()=>{let i=Y();bt(i)||(i=hh(),Ge(i)),bt(i)&&(o?i.add(e):i.delete(e))})},[t,e]),S.useCallback(()=>{t.update(()=>{const o=Y();bt(o)&&o.clear()})},[t])]}function VN({nodeKey:e}){const[t]=it(),[n,r,o]=DN(e);return S.useEffect(()=>Rn(t.registerCommand(Vl,i=>{const s=t.getElementByKey(e);return i.target===s&&(i.shiftKey||o(),r(!n),!0)},sr)),[o,t,n,e,r]),S.useEffect(()=>{const i=t.getElementByKey(e),s=t._config.theme.hrSelected??"selected";i!==null&&(n?Qe(i,s):Kn(i,s))},[t,n,e]),null}let zw=class Hw extends Oh{static getType(){return"horizontalrule"}static clone(t){return new Hw(t.__key)}static importJSON(t){return zh().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:jN,priority:0})}}decorate(){return C.jsx(VN,{nodeKey:this.__key})}};function jN(){return{node:zh()}}function zh(){return _t(new zw)}const BN=[{dependencies:[zw],export:e=>nM(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const o=zh();r||e.getNextSibling()!=null?e.replace(o):e.insertBefore(o),o.selectNext()},type:"element"},...ea];function zN({transformers:e=BN}){const[t]=it();return S.useEffect(()=>CN(t,e),[t,e]),null}const HN=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function WN({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=it();return HN(()=>{if(n)return r.registerUpdateListener(({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&i.size===0&&s.size===0||e&&l.has(hi)||a.isEmpty()||n(o,r,l)})},[r,e,t,n]),null}const Hh=/^(\d+(?:\.\d+)?)px$/,rt={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class kn extends St{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(t){return new kn(t.__headerState,t.__colSpan,t.__width,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__rowSpan=t.__rowSpan,this.__backgroundColor=t.__backgroundColor,this.__verticalAlign=t.__verticalAlign}static importDOM(){return{td:t=>({conversion:zy,priority:0}),th:t=>({conversion:zy,priority:0})}}static importJSON(t){return ln().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeaderStyles(t.headerState).setColSpan(t.colSpan||1).setRowSpan(t.rowSpan||1).setWidth(t.width||void 0).setBackgroundColor(t.backgroundColor||null).setVerticalAlign(t.verticalAlign||void 0)}constructor(t=rt.NO_STATUS,n=1,r,o){super(o),this.__colSpan=n,this.__rowSpan=1,this.__headerState=t,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),Zd(this.__verticalAlign)&&(n.style.verticalAlign=this.__verticalAlign),Qe(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(t){const n=super.exportDOM(t);if(Be(n.element)){const r=n.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return n}exportJSON(){return{...super.exportJSON(),...Zd(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(t){const n=this.getWritable();return n.__colSpan=t,n}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(t){const n=this.getWritable();return n.__rowSpan=t,n}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t,n=rt.BOTH){const r=this.getWritable();return r.__headerState=t&n|r.__headerState&~n,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){const n=this.getWritable();return n.__width=t,n}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){const n=this.getWritable();return n.__backgroundColor=t,n}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(t){const n=this.getWritable();return n.__verticalAlign=t||void 0,n}toggleHeaderStyle(t){const n=this.getWritable();return(n.__headerState&t)===t?n.__headerState-=t:n.__headerState+=t,n}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==rt.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor||t.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function Zd(e){return e==="middle"||e==="bottom"}function zy(e){const t=e,n=e.nodeName.toLowerCase();let r;Hh.test(t.style.width)&&(r=parseFloat(t.style.width));const o=ln(n==="th"?rt.ROW:rt.NO_STATUS,t.colSpan,r);o.__rowSpan=t.rowSpan;const i=t.style.backgroundColor;i!==""&&(o.__backgroundColor=i);const s=t.style.verticalAlign;Zd(s)&&(o.__verticalAlign=s);const a=t.style,l=(a&&a.textDecoration||"").split(" "),c=a.fontWeight==="700"||a.fontWeight==="bold",u=l.includes("line-through"),f=a.fontStyle==="italic",d=l.includes("underline");return{after:h=>{const g=[];let p=null;const m=()=>{if(p){const x=p.getFirstChild();Bn(x)&&p.getChildrenSize()===1&&x.remove()}};for(const x of h)d3(x)||X(x)||Bn(x)?(X(x)&&(c&&x.toggleFormat("bold"),u&&x.toggleFormat("strikethrough"),f&&x.toggleFormat("italic"),d&&x.toggleFormat("underline")),p?p.append(x):(p=me().append(x),g.push(p))):(g.push(x),m(),p=null);return m(),g.length===0&&g.push(me()),g},node:o}}function ln(e=rt.NO_STATUS,t=1,n){return _t(new kn(e,t,n))}function ge(e){return e instanceof kn}const Ww=le("INSERT_TABLE_COMMAND");function de(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class jr extends St{__height;static getType(){return"tablerow"}static clone(t){return new jr(t.__height,t.__key)}static importDOM(){return{tr:t=>({conversion:KN,priority:0})}}static importJSON(t){return Ei().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeight(t.height)}constructor(t,n){super(n),this.__height=t}exportJSON(){const t=this.getHeight();return{...super.exportJSON(),...t===void 0?void 0:{height:t}}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),Qe(n,t.theme.tableRow),n}extractWithChild(t,n,r){return r==="html"}isShadowRoot(){return!0}setHeight(t){const n=this.getWritable();return n.__height=t,n}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function KN(e){const t=e;let n;return Hh.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:r=>Jb(r,ge),node:Ei(n)}}function Ei(e){return _t(new jr(e))}function et(e){return e instanceof jr}const Wh=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,UN=Wh&&"documentMode"in document?document.documentMode:null,Hy=Wh&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function GN(e,t,n=!0){const r=rc();for(let o=0;o<e;o++){const i=Ei();for(let s=0;s<t;s++){let a=rt.NO_STATUS;typeof n=="object"?(o===0&&n.rows&&(a|=rt.ROW),s===0&&n.columns&&(a|=rt.COLUMN)):n&&(o===0&&(a|=rt.ROW),s===0&&(a|=rt.COLUMN));const l=ln(a),c=me();c.append(Le()),l.append(c),i.append(l)}r.append(i)}return r}function qN(e){const t=be(e,n=>Xe(n));if(Xe(t))return t;throw new Error("Expected table cell to be inside of table.")}Wh&&"InputEvent"in window&&!UN&&new window.InputEvent("input");const Jd=(e,t)=>e===rt.BOTH||e===t?t:rt.NO_STATUS;function YN(e,t=!0){const[,,n]=Dn(e),[r,o]=on(n,e,e),i=r[0].length,{startRow:s}=o;let a=null;if(t){const l=s+e.__rowSpan-1,c=r[l],u=Ei();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g+h.__rowSpan-1<=l){const p=c[d].cell.__headerState,m=Jd(p,rt.COLUMN);u.append(ln(m).append(me()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);et(f)||de(256),f.insertAfter(u),a=u}else{const l=s,c=r[l],u=Ei();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g===l){const p=c[d].cell.__headerState,m=Jd(p,rt.COLUMN);u.append(ln(m).append(me()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);et(f)||de(257),f.insertBefore(u),a=u}return a}function XN(e,t=!0,n=!0){const[,,r]=Dn(e),[o,i]=on(r,e,e),s=o.length,{startColumn:a}=i,l=t?a+e.__colSpan-1:a-1,c=r.getFirstChild();et(c)||de(120);let u=null;function f(g=rt.NO_STATUS){const p=ln(g).append(me());return u===null&&(u=p),p}let d=c;e:for(let g=0;g<s;g++){if(g!==0){const w=d.getNextSibling();et(w)||de(121),d=w}const p=o[g],m=p[l<0?0:l].cell.__headerState,x=Jd(m,rt.ROW);if(l<0){Kw(d,f(x));continue}const{cell:y,startColumn:v,startRow:b}=p[l];if(v+y.__colSpan-1<=l){let w=y,_=b,E=l;for(;_!==g&&w.__rowSpan>1;){if(E-=y.__colSpan,!(E>=0)){d.append(f(x));continue e}{const{cell:T,startRow:k}=p[E];w=T,_=k}}w.insertAfter(f(x))}else y.setColSpan(y.__colSpan+1)}u!==null&&n&&ZN(u);const h=r.getColWidths();if(h){const g=[...h],p=l<0?0:l,m=g[p];g.splice(p,0,m),r.setColWidths(g)}return u}function ZN(e){const t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function Kw(e,t){const n=e.getFirstChild();n!==null?n.insertBefore(t):e.append(t)}function JN(e){if(e.length===0)return null;const t=qN(e[0]),[n]=Ar(t,null,null);let r=1/0,o=-1/0,i=1/0,s=-1/0;const a=new Set;for(const h of n)for(const g of h){if(!g||!g.cell)continue;const p=g.cell.getKey();if(!a.has(p)&&e.some(m=>m.is(g.cell))){a.add(p);const m=g.startRow,x=g.startColumn,y=g.cell.__rowSpan||1,v=g.cell.__colSpan||1;r=Math.min(r,m),o=Math.max(o,m+y-1),i=Math.min(i,x),s=Math.max(s,x+v-1)}}if(r===1/0||i===1/0)return null;const l=o-r+1,c=s-i+1,u=n[r][i];if(!u.cell)return null;const f=u.cell;f.setColSpan(c),f.setRowSpan(l);const d=new Set([f.getKey()]);for(let h=r;h<=o;h++)for(let g=i;g<=s;g++){const p=n[h][g];if(!p.cell)continue;const m=p.cell,x=m.getKey();d.has(x)||(d.add(x),QN(m)||f.append(...m.getChildren()),m.remove())}return f.getChildrenSize()===0&&f.append(me()),f}function QN(e){if(e.getChildrenSize()!==1)return!1;const t=e.getFirstChildOrThrow();return!(!Gr(t)||!t.isEmpty())}function eP(e){const[t,n,r]=Dn(e),o=t.__colSpan,i=t.__rowSpan;if(o===1&&i===1)return;const[s,a]=on(r,t,t),{startColumn:l,startRow:c}=a,u=t.__headerState&rt.COLUMN,f=Array.from({length:o},(g,p)=>{let m=u;for(let x=0;m!==0&&x<s.length;x++)m&=s[x][p+l].cell.__headerState;return m}),d=t.__headerState&rt.ROW,h=Array.from({length:i},(g,p)=>{let m=d;for(let x=0;m!==0&&x<s[0].length;x++)m&=s[p+c][x].cell.__headerState;return m});if(o>1){for(let g=1;g<o;g++)t.insertAfter(ln(f[g]|h[0]).append(me()));t.setColSpan(1)}if(i>1){let g;for(let p=1;p<i;p++){const m=c+p,x=s[m];g=(g||n).getNextSibling(),et(g)||de(125);let y=null;for(let v=0;v<l;v++){const b=x[v],w=b.cell;b.startRow===m&&(y=w),w.__colSpan>1&&(v+=w.__colSpan-1)}if(y===null)for(let v=o-1;v>=0;v--)Kw(g,ln(f[v]|h[p]).append(me()));else for(let v=o-1;v>=0;v--)y.insertAfter(ln(f[v]|h[p]).append(me()))}t.setRowSpan(1)}}function on(e,t,n){const[r,o,i]=Ar(e,t,n);return o===null&&de(207),i===null&&de(208),[r,o,i]}function Ar(e,t,n){const r=[];let o=null,i=null;function s(l){let c=r[l];return c===void 0&&(r[l]=c=[]),c}const a=e.getChildren();for(let l=0;l<a.length;l++){const c=a[l];et(c)||de(209);const u=s(l);for(let f=c.getFirstChild(),d=0;f!=null;f=f.getNextSibling()){for(ge(f)||de(147);u[d]!==void 0;)d++;const h={cell:f,startColumn:d,startRow:l},{__rowSpan:g,__colSpan:p}=f;for(let m=0;m<g&&!(l+m>=a.length);m++){const x=s(l+m);for(let y=0;y<p;y++)x[d+y]=h}t!==null&&o===null&&t.is(f)&&(o=h),n!==null&&i===null&&n.is(f)&&(i=h)}}return[r,o,i]}function Dn(e){let t;if(e instanceof kn)t=e;else if("__type"in e){const o=be(e,ge);ge(o)||de(148),t=o}else{const o=be(e.getNode(),ge);ge(o)||de(148),t=o}const n=t.getParent();et(n)||de(149);const r=n.getParent();return Xe(r)||de(210),[t,n,r]}function El(e,t,n){let r,o=Math.min(t.startColumn,n.startColumn),i=Math.min(t.startRow,n.startRow),s=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),a=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let l=0;l<e.length;l++)for(let c=0;c<e[0].length;c++){const u=e[l][c];if(!u)continue;const f=u.startColumn+u.cell.__colSpan-1,d=u.startRow+u.cell.__rowSpan-1,h=u.startColumn<=s&&f>=o,g=u.startRow<=a&&d>=i;if(h&&g){const p=Math.min(o,u.startColumn),m=Math.max(s,f),x=Math.min(i,u.startRow),y=Math.max(a,d);p===o&&m===s&&x===i&&y===a||(o=p,s=m,i=x,a=y,r=!0)}}}while(r);return{maxColumn:s,maxRow:a,minColumn:o,minRow:i}}function Wy(e){const[t,,n]=Dn(e),r=n.getChildren(),o=r.length,i=r[0].getChildren().length,s=new Array(o);for(let a=0;a<o;a++)s[a]=new Array(i);for(let a=0;a<o;a++){const l=r[a].getChildren();let c=0;for(let u=0;u<l.length;u++){for(;s[a][c];)c++;const f=l[u],d=f.__rowSpan||1,h=f.__colSpan||1;for(let g=0;g<d;g++)for(let p=0;p<h;p++)s[a+g][c+p]=f;if(t===f)return{colSpan:h,columnIndex:c,rowIndex:a,rowSpan:d};c+=h}}return null}function Ky(e){const[[t,n,r,o],[i,s,a,l]]=["anchor","focus"].map(c=>{const u=e[c].getNode(),f=be(u,ge);ge(f)||de(238,c,u.getKey(),u.getType());const d=f.getParent();et(d)||de(239,c);const h=d.getParent();return Xe(h)||de(240,c),[u,f,d,h]});return o.is(l)||de(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:o,focusCell:s,focusNode:i,focusRow:a,focusTable:l}}class nc{tableKey;anchor;focus;_cachedNodes;dirty;constructor(t,n,r){this.anchor=n,this.focus=r,n._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;const t=Pe(this.tableKey),n=Pe(this.anchor.key),r=Pe(this.focus.key);return t!==null&&n!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return je(t)&&this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)}set(t,n,r){this.dirty=this.dirty||t!==this.tableKey||n!==this.anchor.key||r!==this.focus.key,this.tableKey=t,this.anchor.key=n,this.focus.key=r,this._cachedNodes=null}clone(){return new nc(this.tableKey,zt(this.anchor.key,this.anchor.offset,this.anchor.type),zt(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}hasFormat(t){let n=0;this.getNodes().filter(ge).forEach(o=>{const i=o.getFirstChild();Gr(i)&&(n|=i.getTextFormat())});const r=Ir[t];return(n&r)!==0}insertNodes(t){const n=this.focus.getNode();B(n)||de(151),As(n.select(0,n.getChildrenSize())).insertNodes(t)}getShape(){const{anchorCell:t,focusCell:n}=Ky(this),r=Wy(t);r===null&&de(153);const o=Wy(n);o===null&&de(155);const i=Math.min(r.columnIndex,o.columnIndex),s=Math.max(r.columnIndex+r.colSpan-1,o.columnIndex+o.colSpan-1),a=Math.min(r.rowIndex,o.rowIndex),l=Math.max(r.rowIndex+r.rowSpan-1,o.rowIndex+o.rowSpan-1);return{fromX:Math.min(i,s),fromY:Math.min(a,l),toX:Math.max(i,s),toY:Math.max(a,l)}}getNodes(){if(!this.isValid())return[];const t=this._cachedNodes;if(t!==null)return t;const{anchorTable:n,anchorCell:r,focusCell:o}=Ky(this),i=o.getParents()[1];if(i!==n){if(n.isParentOf(o)){const m=i.getParent();m==null&&de(159),this.set(this.tableKey,o.getKey(),m.getKey())}else{const m=n.getParent();m==null&&de(158),this.set(this.tableKey,m.getKey(),o.getKey())}return this.getNodes()}const[s,a,l]=on(n,r,o),{minColumn:c,maxColumn:u,minRow:f,maxRow:d}=El(s,a,l),h=new Map([[n.getKey(),n]]);let g=null;for(let m=f;m<=d;m++)for(let x=c;x<=u;x++){const{cell:y}=s[m][x],v=y.getParent();et(v)||de(160),v!==g&&(h.set(v.getKey(),v),g=v),h.has(y.getKey())||nP(y,b=>{h.set(b.getKey(),b)})}const p=Array.from(h.values());return Ii()||(this._cachedNodes=p),p}getTextContent(){const t=this.getNodes().filter(r=>ge(r));let n="";for(let r=0;r<t.length;r++){const o=t[r],i=o.__parent,s=(t[r+1]||{}).__parent;n+=o.getTextContent()+(s!==i?`
64
- `:" ")}return n}}function je(e){return e instanceof nc}function Uw(){const e=zt("root",0,"element"),t=zt("root",0,"element");return new nc("root",e,t)}function tP(e,t,n){e.getKey(),t.getKey(),n.getKey();const r=Y(),o=je(r)?r.clone():Uw();return o.set(e.getKey(),t.getKey(),n.getKey()),o}function nP(e,t){const n=[[e]];for(let r=n.at(-1);r!==void 0&&n.length>0;r=n.at(-1)){const o=r.pop();o===void 0?n.pop():t(o)!==!1&&B(o)&&n.push(o.getChildren())}}function Gw(e,t=Vi()){const n=Pe(e);Xe(n)||de(231,e);const r=Ro(n,t.getElementByKey(e));return r===null&&de(232,e),{tableElement:r,tableNode:n}}class rP{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;shouldCheckSelection;abortController;listenerOptions;nextFocus;constructor(t,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.shouldCheckSelection=!1,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.nextFocus=null,this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach(t=>t()),this.listenersToRemove.clear()}$lookup(){return Gw(this.tableNodeKey,this.editor)}trackTable(){const t=new MutationObserver(n=>{this.editor.getEditorState().read(()=>{let r=!1;for(let s=0;s<n.length;s++){const a=n[s].target.nodeName;if(a==="TABLE"||a==="TBODY"||a==="THEAD"||a==="TR"){r=!0;break}}if(!r)return;const{tableNode:o,tableElement:i}=this.$lookup();this.table=mi(o,i)},{editor:this.editor})});this.editor.getEditorState().read(()=>{const{tableNode:n,tableElement:r}=this.$lookup();this.table=mi(n,r),t.observe(r,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();const{tableNode:n,tableElement:r}=this.$lookup();Ra(t,mi(n,r),null),Y()!==null&&(Ge(null),t.dispatchCommand(lr,void 0))}$enableHighlightStyle(){const t=this.editor,{tableElement:n}=this.$lookup();Kn(n,t._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){const{tableElement:t}=this.$lookup();Qe(t,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(t){if(t!==null){t.tableKey!==this.tableNodeKey&&de(233,t.tableKey,this.tableNodeKey);const n=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Ra(n,this.table,this.tableSelection)}else this.$clearHighlight()}setShouldCheckSelection(){this.shouldCheckSelection=!0}getAndClearShouldCheckSelection(){return!!this.shouldCheckSelection&&(this.shouldCheckSelection=!1,!0)}setNextFocus(t){this.nextFocus=t}getAndClearNextFocus(){const{nextFocus:t}=this;return t!==null&&(this.nextFocus=null),t}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){const t=Ft(this.editor._window);t&&t.rangeCount>0&&t.removeAllRanges()}}$setFocusCellForSelection(t,n=!1){const r=this.editor,{tableNode:o}=this.$lookup(),i=t.x,s=t.y;if(this.focusCell=t,this.isHighlightingCells||this.anchorX===i&&this.anchorY===s&&!n){if(i===this.focusX&&s===this.focusY)return!1}else this.isHighlightingCells=!0,this.$disableHighlightStyle();if(this.focusX=i,this.focusY=s,this.isHighlightingCells){const a=ef(o,t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&a!==null)return this.focusCellNodeKey=a.getKey(),this.tableSelection=tP(o,this.$getAnchorTableCellOrThrow(),a),Ge(this.tableSelection),r.dispatchCommand(lr,void 0),Ra(r,this.table,this.tableSelection),!0}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?Pe(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){const t=this.$getAnchorTableCell();return t===null&&de(234),t}$getFocusTableCell(){return this.focusCellNodeKey?Pe(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){const t=this.$getFocusTableCell();return t===null&&de(235),t}$setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y;const{tableNode:n}=this.$lookup(),r=ef(n,t.elem);if(r!==null){const o=r.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():Uw(),this.anchorCellNodeKey=o}}$formatCells(t){const n=Y();je(n)||de(236);const r=Kl(),o=r.anchor,i=r.focus,s=n.getNodes().filter(ge);s.length>0||de(237);const a=s[0].getFirstChild(),l=Gr(a)?a.getFormatFlags(t,null):null;s.forEach(c=>{o.set(c.getKey(),0,"element"),i.set(c.getKey(),c.getChildrenSize(),"element"),r.formatText(t,l)}),Ge(n),this.editor.dispatchCommand(lr,void 0)}$clearText(){const{editor:t}=this,n=Pe(this.tableNodeKey);if(!Xe(n))throw new Error("Expected TableNode.");const r=Y();je(r)||de(253);const o=r.getNodes().filter(ge),i=n.getFirstChild(),s=n.getLastChild();if(o.length>0&&i!==null&&s!==null&&et(i)&&et(s)&&o[0]===i.getFirstChild()&&o[o.length-1]===s.getLastChild()){n.selectPrevious();const a=n.getParent();return n.remove(),void(ot(a)&&a.isEmpty()&&t.dispatchCommand(bo,void 0))}o.forEach(a=>{if(B(a)){const l=me(),c=Le();l.append(c),a.append(l),a.getChildren().forEach(u=>{u!==l&&u.remove()})}}),Ra(t,this.table,null),Ge(null),t.dispatchCommand(lr,void 0)}}const Qd="__lexicalTableSelection";function Qo(e){return Be(e)&&e.nodeName==="TABLE"}function Ro(e,t){if(!t)return t;const n=Qo(t)?t:e.getDOMSlot(t).element;return n.nodeName!=="TABLE"&&de(245,t.nodeName),n}function Kh(e){return e._window}function bs(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;ge(n)&&(r=n)}return null}const oP=[[lh,"down"],[ah,"up"],[sh,"backward"],[ih,"forward"]],iP=[Si,wo,Pr],sP=[jl,uh];function aP(e,t,n,r){const o=n.getRootElement(),i=Kh(n);o!==null&&i!==null||de(246);const s=new rP(n,e.getKey()),a=Ro(e,t);(function(h,g){Uy(h)!==null&&de(205),h[Qd]=g})(a,s),s.listenersToRemove.add(()=>(function(h,g){Uy(h)===g&&delete h[Qd]})(a,s));const l=h=>{if(s.pointerType=h.pointerType,h.button!==0||!xn(h.target)||!i)return;const g=Rl(h.target);g!==null&&n.update(()=>{const p=Gn();if(Hy&&h.shiftKey&&Fn(p,e)&&(W(p)||je(p))){const m=p.anchor.getNode(),x=bs(e,p.anchor.getNode());x?(s.$setAnchorCellForSelection(so(s,x)),s.$setFocusCellForSelection(g),ar(h)):(e.isBefore(m)?e.selectStart():e.selectEnd()).anchor.set(p.anchor.key,p.anchor.offset,p.anchor.type)}else h.pointerType!=="touch"&&s.$setAnchorCellForSelection(g)}),(()=>{if(s.isSelecting)return;const p=()=>{s.isSelecting=!1,i.removeEventListener("pointerup",p),i.removeEventListener("pointermove",m)},m=x=>{if(1&~x.buttons&&s.isSelecting)return s.isSelecting=!1,i.removeEventListener("pointerup",p),void i.removeEventListener("pointermove",m);if(!xn(x.target))return;let y=null;const v=!(Hy||a.contains(x.target));if(v)y=Gy(a,x.target);else for(const b of document.elementsFromPoint(x.clientX,x.clientY))if(y=Gy(a,b),y)break;!y||s.focusCell!==null&&y.elem===s.focusCell.elem||(s.setNextFocus({focusCell:y,override:v}),n.dispatchCommand(lr,void 0))};s.isSelecting=!0,i.addEventListener("pointerup",p,s.listenerOptions),i.addEventListener("pointermove",m,s.listenerOptions)})()};a.addEventListener("pointerdown",l,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("pointerdown",l)});const c=h=>{h.detail>=3&&xn(h.target)&&Rl(h.target)!==null&&h.preventDefault()};a.addEventListener("mousedown",c,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("mousedown",c)});const u=h=>{const g=h.target;h.button===0&&xn(g)&&n.update(()=>{const p=Y();je(p)&&p.tableKey===s.tableNodeKey&&o.contains(g)&&s.$clearHighlight()})};i.addEventListener("pointerdown",u,s.listenerOptions),s.listenersToRemove.add(()=>{i.removeEventListener("pointerdown",u)});for(const[h,g]of oP)s.listenersToRemove.add(n.registerCommand(h,p=>Xw(n,p,g,e,s),$t));s.listenersToRemove.add(n.registerCommand(ch,h=>{const g=Y();if(je(g)){const p=bs(e,g.focus.getNode());if(p!==null)return ar(h),p.selectEnd(),!0}return!1},$t));const f=h=>()=>{const g=Y();if(!Fn(g,e))return!1;if(je(g))return s.$clearText(),!0;if(W(g)){if(!ge(bs(e,g.anchor.getNode())))return!1;const p=g.anchor.getNode(),m=g.focus.getNode(),x=e.isParentOf(p),y=e.isParentOf(m);if(x&&!y||y&&!x)return s.$clearText(),!0;const v=be(g.anchor.getNode(),w=>B(w)),b=v&&be(v,w=>B(w)&&ge(w.getParent()));if(!B(b)||!B(v))return!1;if(h===wo&&b.getPreviousSibling()===null)return!0}return!1};for(const h of iP)s.listenersToRemove.add(n.registerCommand(h,f(h),$t));const d=h=>{const g=Y();if(!je(g)&&!W(g))return!1;const p=e.isParentOf(g.anchor.getNode());if(p!==e.isParentOf(g.focus.getNode())){const m=p?"anchor":"focus",x=p?"focus":"anchor",{key:y,offset:v,type:b}=g[x];return e[g[m].isBefore(g[x])?"selectPrevious":"selectNext"]()[x].set(y,v,b),!1}return!!Fn(g,e)&&!!je(g)&&(h&&(h.preventDefault(),h.stopPropagation()),s.$clearText(),!0)};for(const h of sP)s.listenersToRemove.add(n.registerCommand(h,d,$t));return s.listenersToRemove.add(n.registerCommand(zl,h=>{const g=Y();if(g){if(!je(g)&&!W(g))return!1;Kd(n,Rr(h,ClipboardEvent)?h:null,bw(g));const p=d(h);return W(g)?(g.removeText(),!0):p}return!1},$t)),s.listenersToRemove.add(n.registerCommand(It,h=>{const g=Y();if(!Fn(g,e))return!1;if(je(g))return s.$formatCells(h),!0;if(W(g)){const p=be(g.anchor.getNode(),m=>ge(m));if(!ge(p))return!1}return!1},$t)),s.listenersToRemove.add(n.registerCommand(di,h=>{const g=Y();if(!je(g)||!Fn(g,e))return!1;const p=g.anchor.getNode(),m=g.focus.getNode();if(!ge(p)||!ge(m))return!1;if((function(k,P){if(je(k)){const O=k.anchor.getNode(),D=k.focus.getNode();if(P&&O&&D){const[I]=on(P,O,D);return O.getKey()===I[0][0].cell.getKey()&&D.getKey()===I[I.length-1].at(-1).cell.getKey()}}return!1})(g,e))return e.setFormat(h),!0;const[x,y,v]=on(e,p,m),b=Math.max(y.startRow+y.cell.__rowSpan-1,v.startRow+v.cell.__rowSpan-1),w=Math.max(y.startColumn+y.cell.__colSpan-1,v.startColumn+v.cell.__colSpan-1),_=Math.min(y.startRow,v.startRow),E=Math.min(y.startColumn,v.startColumn),T=new Set;for(let k=_;k<=b;k++)for(let P=E;P<=w;P++){const O=x[k][P].cell;if(T.has(O))continue;T.add(O),O.setFormat(h);const D=O.getChildren();for(let I=0;I<D.length;I++){const $=D[I];B($)&&!$.isInline()&&$.setFormat(h)}}return!0},$t)),s.listenersToRemove.add(n.registerCommand(go,h=>{const g=Y();if(!Fn(g,e))return!1;if(je(g))return s.$clearHighlight(),!1;if(W(g)){const p=be(g.anchor.getNode(),m=>ge(m));if(!ge(p))return!1;if(typeof h=="string"){const m=Xy(n,g,e);if(m)return Yy(m,e,[Le(h)]),!0}}return!1},$t)),r&&s.listenersToRemove.add(n.registerCommand(dh,h=>{const g=Y();if(!W(g)||!g.isCollapsed()||!Fn(g,e))return!1;const p=es(g.anchor.getNode());return!(p===null||!e.is(yi(p)))&&(ar(h),(function(m,x){const y=x==="next"?"getNextSibling":"getPreviousSibling",v=x==="next"?"getFirstChild":"getLastChild",b=m[y]();if(B(b))return b.selectEnd();const w=be(m,et);w===null&&de(247);for(let E=w[y]();et(E);E=E[y]()){const T=E[v]();if(B(T))return T.selectEnd()}const _=be(w,Xe);_===null&&de(248),x==="next"?_.selectNext():_.selectPrevious()})(p,h.shiftKey?"previous":"next"),!0)},$t)),s.listenersToRemove.add(n.registerCommand(q1,h=>e.isSelected(),$t)),s.listenersToRemove.add(n.registerCommand(rh,(h,g)=>{if(n!==g)return!1;const{nodes:p,selection:m}=h,x=m.getStartEndPoints(),y=je(m),v=W(m)&&be(m.anchor.getNode(),ne=>ge(ne))!==null&&be(m.focus.getNode(),ne=>ge(ne))!==null||y;if(p.length!==1||!Xe(p[0])||!v||x===null)return!1;const[b,w]=x,[_,E,T]=Dn(b),k=be(w.getNode(),ne=>ge(ne));if(!(ge(_)&&ge(k)&&et(E)&&Xe(T)))return!1;const P=p[0],[O,D,I]=on(T,_,k),[$]=Ar(P,null,null),H=O.length,U=H>0?O[0].length:0;let F=D.startRow,N=D.startColumn,j=$.length,K=j>0?$[0].length:0;if(y){const ne=El(O,D,I),ye=ne.maxRow-ne.minRow+1,Te=ne.maxColumn-ne.minColumn+1;F=ne.minRow,N=ne.minColumn,j=Math.min(j,ye),K=Math.min(K,Te)}let te=!1;const J=Math.min(H,F+j)-1,Z=Math.min(U,N+K)-1,se=new Set;for(let ne=F;ne<=J;ne++)for(let ye=N;ye<=Z;ye++){const Te=O[ne][ye];se.has(Te.cell.getKey())||Te.cell.__rowSpan===1&&Te.cell.__colSpan===1||(eP(Te.cell),se.add(Te.cell.getKey()),te=!0)}let[oe]=Ar(T.getWritable(),null,null);const fe=j-H+F;for(let ne=0;ne<fe;ne++)YN(oe[H-1][0].cell);const _e=K-U+N;for(let ne=0;ne<_e;ne++)XN(oe[0][U-1].cell,!0,!1);[oe]=Ar(T.getWritable(),null,null);for(let ne=F;ne<F+j;ne++)for(let ye=N;ye<N+K;ye++){const Te=ne-F,De=ye-N,st=$[Te][De];if(st.startRow!==Te||st.startColumn!==De)continue;const ee=st.cell;if(ee.__rowSpan!==1||ee.__colSpan!==1){const Ee=[],mt=Math.min(ne+ee.__rowSpan,F+j)-1,Lt=Math.min(ye+ee.__colSpan,N+K)-1;for(let Yt=ne;Yt<=mt;Yt++)for(let Xt=ye;Xt<=Lt;Xt++){const ve=oe[Yt][Xt];Ee.push(ve.cell)}JN(Ee),te=!0}const{cell:we}=oe[ne][ye],ze=we.getChildren();ee.getChildren().forEach(Ee=>{X(Ee)&&me().append(Ee),we.append(Ee)}),ze.forEach(Ee=>Ee.remove())}if(y&&te){const[ne]=Ar(T.getWritable(),null,null);ne[D.startRow][D.startColumn].cell.selectEnd()}return!0},$t)),s.listenersToRemove.add(n.registerCommand(lr,()=>{const h=Y(),g=Gn(),p=s.getAndClearNextFocus();if(p!==null){const{focusCell:m}=p;if(je(h)&&h.tableKey===s.tableNodeKey)return(m.x!==s.focusX||m.y!==s.focusY)&&(s.$setFocusCellForSelection(m),!0);if(m!==s.anchorCell&&Fn(h,e))return s.$setFocusCellForSelection(m),!0}if(s.getAndClearShouldCheckSelection()&&W(g)&&W(h)&&h.isCollapsed()){const m=h.anchor.getNode(),x=e.getFirstChild(),y=es(m);if(y!==null&&et(x)){const v=x.getFirstChild();if(ge(v)&&e.is(be(y,b=>b.is(e)||b.is(v))))return v.selectStart(),!0}}if(W(h)){const{anchor:m,focus:x}=h,y=m.getNode(),v=x.getNode(),b=es(y),w=es(v),_=!(!b||!e.is(yi(b))),E=!(!w||!e.is(yi(w))),T=_!==E,k=_&&E,P=h.isBackward();if(T){const O=h.clone();if(E){const[D]=on(e,w,w),I=D[0][0].cell,$=D[D.length-1].at(-1).cell;O.focus.set(P?I.getKey():$.getKey(),P?0:$.getChildrenSize(),"element")}else if(_){const[D]=on(e,b,b),I=D[0][0].cell,$=D[D.length-1].at(-1).cell;O.anchor.set(P?$.getKey():I.getKey(),P?$.getChildrenSize():0,"element")}Ge(O),qy(n,s)}else if(k&&(b.is(w)||(s.$setAnchorCellForSelection(so(s,b)),s.$setFocusCellForSelection(so(s,w),!0)),s.pointerType==="touch"&&s.isSelecting&&h.isCollapsed()&&W(g)&&g.isCollapsed())){const O=es(g.anchor.getNode());O&&!O.is(w)&&(s.$setAnchorCellForSelection(so(s,O)),s.$setFocusCellForSelection(so(s,w),!0),s.pointerType=null)}}else if(h&&je(h)&&h.is(g)&&h.tableKey===e.getKey()){const m=Ft(i);if(m&&m.anchorNode&&m.focusNode){const x=Ht(m.focusNode),y=x&&!e.isParentOf(x),v=Ht(m.anchorNode),b=v&&e.isParentOf(v);if(y&&b&&m.rangeCount>0){const w=XA(m,n);w&&(w.anchor.set(e.getKey(),h.isBackward()?e.getChildrenSize():0,"element"),m.removeAllRanges(),Ge(w))}}}return h&&!h.is(g)&&(je(h)||je(g))&&s.tableSelection&&!s.tableSelection.is(g)?(je(h)&&h.tableKey===s.tableNodeKey?s.$updateTableTableSelection(h):!je(h)&&je(g)&&g.tableKey===s.tableNodeKey&&s.$updateTableTableSelection(null),!1):(s.hasHijackedSelectionStyles&&!e.isSelected()?(function(m,x){x.$enableHighlightStyle(),Uh(x.table,y=>{const v=y.elem;y.highlighted=!1,Yw(m,y),v.getAttribute("style")||v.removeAttribute("style")})})(n,s):!s.hasHijackedSelectionStyles&&e.isSelected()&&qy(n,s),!1)},$t)),s.listenersToRemove.add(n.registerCommand(bo,()=>{const h=Y();if(!W(h)||!h.isCollapsed()||!Fn(h,e))return!1;const g=Xy(n,h,e);return!!g&&(Yy(g,e),!0)},$t)),s}function Uy(e){return e[Qd]||null}function Rl(e){let t=e;for(;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const r=t._cell;return r===void 0?null:r}t=t.parentNode}return null}function Gy(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;const o=r.nodeName;o!=="TD"&&o!=="TH"||(n=r._cell||null)}return null}function mi(e,t){const n=[],r={columns:0,domRows:n,rows:0};let o=Ro(e,t).querySelector("tr"),i=0,s=0;for(n.length=0;o!=null;){const a=o.nodeName;if(a==="TD"||a==="TH"){const u={elem:o,hasBackgroundColor:o.style.backgroundColor!=="",highlighted:!1,x:i,y:s};o._cell=u;let f=n[s];f===void 0&&(f=n[s]=[]),f[i]=u}else{const u=o.firstChild;if(u!=null){o=u;continue}}const l=o.nextSibling;if(l!=null){i++,o=l;continue}const c=o.parentNode;if(c!=null){const u=c.nextSibling;if(u==null)break;s++,i=0,o=u}}return r.columns=i+1,r.rows=s+1,r}function Ra(e,t,n){const r=new Set(n?n.getNodes():[]);Uh(t,(o,i)=>{const s=o.elem;r.has(i)?(o.highlighted=!0,qw(e,o)):(o.highlighted=!1,Yw(e,o),s.getAttribute("style")||s.removeAttribute("style"))})}function Uh(e,t){const{domRows:n}=e;for(let r=0;r<n.length;r++){const o=n[r];if(o)for(let i=0;i<o.length;i++){const s=o[i];if(!s)continue;const a=Ht(s.elem);a!==null&&t(s,a,{x:i,y:r})}}}function qy(e,t){t.$disableHighlightStyle(),Uh(t.table,n=>{n.highlighted=!0,qw(e,n)})}const lP=(e,t,n,r,o)=>{const i=o==="forward";switch(o){case"backward":case"forward":return n!==(i?e.table.columns-1:0)?Aa(t.getCellNodeFromCordsOrThrow(n+(i?1:-1),r,e.table),i):r!==(i?e.table.rows-1:0)?Aa(t.getCellNodeFromCordsOrThrow(i?0:e.table.columns-1,r+(i?1:-1),e.table),i):i?t.selectNext():t.selectPrevious(),!0;case"up":return r!==0?Aa(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1):t.selectPrevious(),!0;case"down":return r!==e.table.rows-1?Aa(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0):t.selectNext(),!0;default:return!1}};function ou(e,t){let n,r;if(t.startColumn===e.minColumn)n="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n="maxColumn"}if(t.startRow===e.minRow)r="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r="maxRow"}return[n,r]}function ka([e,t]){return[e==="minColumn"?"maxColumn":"minColumn",t==="minRow"?"maxRow":"minRow"]}function Ho(e,t,[n,r]){const o=t[r],i=e[o];i===void 0&&de(250,r,String(o));const s=t[n],a=i[s];return a===void 0&&de(250,n,String(s)),a}function cP(e,t,n,r,o){const i=El(t,n,r),s=(function(_,E){const{minColumn:T,maxColumn:k,minRow:P,maxRow:O}=E;let D=1,I=1,$=1,H=1;const U=_[P],F=_[O];for(let N=T;N<=k;N++)D=Math.max(D,U[N].cell.__rowSpan),H=Math.max(H,F[N].cell.__rowSpan);for(let N=P;N<=O;N++)I=Math.max(I,_[N][T].cell.__colSpan),$=Math.max($,_[N][k].cell.__colSpan);return{bottomSpan:H,leftSpan:I,rightSpan:$,topSpan:D}})(t,i),{topSpan:a,leftSpan:l,bottomSpan:c,rightSpan:u}=s,f=(function(_,E){const T=ou(_,E);return T===null&&de(249,E.cell.getKey()),T})(i,n),[d,h]=ka(f);let g=i[d],p=i[h];o==="forward"?g+=d==="maxColumn"?1:l:o==="backward"?g-=d==="minColumn"?1:u:o==="down"?p+=h==="maxRow"?1:a:o==="up"&&(p-=h==="minRow"?1:c);const m=t[p];if(m===void 0)return!1;const x=m[g];if(x===void 0)return!1;const[y,v]=(function(_,E,T){const k=El(_,E,T),P=ou(k,E);if(P)return[Ho(_,k,P),Ho(_,k,ka(P))];const O=ou(k,T);if(O)return[Ho(_,k,ka(O)),Ho(_,k,O)];const D=["minColumn","minRow"];return[Ho(_,k,D),Ho(_,k,ka(D))]})(t,n,x),b=so(e,y.cell),w=so(e,v.cell);return e.$setAnchorCellForSelection(b),e.$setFocusCellForSelection(w,!0),!0}function Fn(e,t){if(W(e)||je(e)){const n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function Aa(e,t){t?e.selectStart():e.selectEnd()}function qw(e,t){const n=t.elem,r=e._config.theme;ge(Ht(n))||de(131),Qe(n,r.tableCellSelected)}function Yw(e,t){const n=t.elem;ge(Ht(n))||de(131);const r=e._config.theme;Kn(n,r.tableCellSelected)}function es(e){const t=be(e,ge);return ge(t)?t:null}function yi(e){const t=be(e,Xe);return Xe(t)?t:null}function uP(e,t,n,r,o,i,s){const a=En(n.focus,o?"previous":"next");if(Ph(a))return!1;let l=a;for(const m of Ls(a).iterNodeCarets("shadowRoot")){if(!Dr(m)||!B(m.origin))return!1;l=m}const c=l.getParentAtCaret();if(!ge(c))return!1;const u=c,f=(function(m){for(const x of Ls(m).iterNodeCarets("root")){const{origin:y}=x;if(ge(y)){if(Vt(x))return Nt(y,m.direction)}else if(!et(y))break}return null})(tt(u,l.direction)),d=be(u,Xe);if(!d||!d.is(i))return!1;const h=e.getElementByKey(u.getKey()),g=Rl(h);if(!h||!g)return!1;const p=fP(e,d);if(s.table=p,f)if(r==="extend"){const m=Rl(e.getElementByKey(f.origin.getKey()));if(!m)return!1;s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(m,!0)}else{const m=Mt(f);bn(n.anchor,m),bn(n.focus,m)}else if(r==="extend")s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(g,!0);else{const m=(function(x){const y=Xs(x);return Vt(y)?Mt(y):x})(tt(d,a.direction));bn(n.anchor,m),bn(n.focus,m)}return ar(t),!0}function Xw(e,t,n,r,o){if((n==="up"||n==="down")&&(function(s){const a=s.getRootElement();return a?a.hasAttribute("aria-controls")&&a.getAttribute("aria-controls")==="typeahead-menu":!1})(e))return!1;const i=Y();if(!Fn(i,r)){if(W(i)){if(n==="backward"){if(i.focus.offset>0)return!1;const s=(function(l){for(let c=l,u=l;u!==null;c=u,u=u.getParent())if(B(u)){if(u!==c&&u.getFirstChild()!==c)return null;if(!u.isInline())return u}return null})(i.focus.getNode());if(!s)return!1;const a=s.getPreviousSibling();return!!Xe(a)&&(ar(t),t.shiftKey?i.focus.set(a.getParentOrThrow().getKey(),a.getIndexWithinParent(),"element"):a.selectEnd(),!0)}if(t.shiftKey&&(n==="up"||n==="down")){const s=i.focus.getNode();if(!i.isCollapsed()&&(n==="up"&&!i.isBackward()||n==="down"&&i.isBackward())){let a=be(s,d=>Xe(d));if(ge(a)&&(a=be(a,Xe)),a!==r||!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(!l)return!1;let c=0;n==="up"&&B(l)&&(c=l.getChildrenSize());let u=l;n==="up"&&B(l)&&(u=l.getLastChild()||l,c=X(u)?u.getTextContentSize():0);const f=i.clone();return f.focus.set(u.getKey(),c,X(u)?"text":"element"),Ge(f),ar(t),!0}if(pt(s)){const a=n==="up"?i.getNodes()[i.getNodes().length-1]:i.getNodes()[0];if(a&&bs(r,a)!==null){const l=r.getFirstDescendant(),c=r.getLastDescendant();if(!l||!c)return!1;const[u]=Dn(l),[f]=Dn(c),d=r.getCordsFromCellNode(u,o.table),h=r.getCordsFromCellNode(f,o.table),g=r.getDOMCellFromCordsOrThrow(d.x,d.y,o.table),p=r.getDOMCellFromCordsOrThrow(h.x,h.y,o.table);return o.$setAnchorCellForSelection(g),o.$setFocusCellForSelection(p,!0),!0}return!1}{let a=be(s,c=>B(c)&&!c.isInline());if(ge(a)&&(a=be(a,Xe)),!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(Xe(l)&&o.tableNodeKey===l.getKey()){const c=l.getFirstDescendant(),u=l.getLastDescendant();if(!c||!u)return!1;const[f]=Dn(c),[d]=Dn(u),h=i.clone();return h.focus.set((n==="up"?f:d).getKey(),n==="up"?0:d.getChildrenSize(),"element"),ar(t),Ge(h),!0}}}}return n==="down"&&kl(e)&&o.setShouldCheckSelection(),!1}if(W(i)){if(n==="backward"||n==="forward")return uP(e,t,i,t.shiftKey?"extend":"move",n==="backward",r,o);if(i.isCollapsed()){const{anchor:s,focus:a}=i,l=be(s.getNode(),ge),c=be(a.getNode(),ge);if(!ge(l)||!l.is(c))return!1;const u=yi(l);if(u!==r&&u!=null){const x=Ro(u,e.getElementByKey(u.getKey()));if(x!=null)return o.table=mi(u,x),Xw(e,t,n,u,o)}const f=e.getElementByKey(l.__key),d=e.getElementByKey(s.key);if(d==null||f==null)return!1;let h;if(s.type==="element")h=d.getBoundingClientRect();else{const x=Ft(Kh(e));if(x===null||x.rangeCount===0)return!1;h=x.getRangeAt(0).getBoundingClientRect()}const g=n==="up"?l.getFirstChild():l.getLastChild();if(g==null)return!1;const p=e.getElementByKey(g.__key);if(p==null)return!1;const m=p.getBoundingClientRect();if(n==="up"?m.top>h.top-h.height:h.bottom+h.height>m.bottom){ar(t);const x=r.getCordsFromCellNode(l,o.table);if(!t.shiftKey)return lP(o,r,x.x,x.y,n);{const y=r.getDOMCellFromCordsOrThrow(x.x,x.y,o.table);o.$setAnchorCellForSelection(y),o.$setFocusCellForSelection(y,!0)}return!0}}}else if(je(i)){const{anchor:s,focus:a}=i,l=be(s.getNode(),ge),c=be(a.getNode(),ge),[u]=i.getNodes();Xe(u)||de(251);const f=Ro(u,e.getElementByKey(u.getKey()));if(!ge(l)||!ge(c)||!Xe(u)||f==null)return!1;o.$updateTableTableSelection(i);const d=mi(u,f),h=r.getCordsFromCellNode(l,d),g=r.getDOMCellFromCordsOrThrow(h.x,h.y,d);if(o.$setAnchorCellForSelection(g),ar(t),t.shiftKey){const[p,m,x]=on(r,l,c);return cP(o,p,m,x,n)}return c.selectEnd(),!0}return!1}function ar(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Yy(e,t,n){const r=me();e==="first"?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function Xy(e,t,n){const r=n.getParent();if(!r)return;const o=Ft(Kh(e));if(!o)return;const i=o.anchorNode,s=e.getElementByKey(r.getKey()),a=Ro(n,e.getElementByKey(n.getKey()));if(!i||!s||!a||!s.contains(i)||a.contains(i))return;const l=be(t.anchor.getNode(),y=>ge(y));if(!l)return;const c=be(l,y=>Xe(y));if(!Xe(c)||!c.is(n))return;const[u,f]=on(n,l,l),d=u[0][0],h=u[u.length-1][u[0].length-1],{startRow:g,startColumn:p}=f,m=g===d.startRow&&p===d.startColumn,x=g===h.startRow&&p===h.startColumn;return m?"first":x?"last":void 0}function so(e,t){const{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function ef(e,t,n){return bs(e,Ht(t,n))}function Zy(e,t,n){if(!t.theme.tableAlignment)return;const r=[],o=[];for(const i of["center","right"]){const s=t.theme.tableAlignment[i];s&&(i===n?o:r).push(s)}Kn(e,...r),Qe(e,...o)}const tf=new WeakSet;function kl(e=Vi()){return tf.has(e)}function dP(e,t){t?tf.add(e):tf.delete(e)}class An extends St{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(t){const n=this.getWritable();return n.__colWidths=t,n}static clone(t){return new An(t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__colWidths=t.__colWidths,this.__rowStriping=t.__rowStriping,this.__frozenColumnCount=t.__frozenColumnCount,this.__frozenRowCount=t.__frozenRowCount}static importDOM(){return{table:t=>({conversion:hP,priority:1})}}static importJSON(t){return rc().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setRowStriping(t.rowStriping||!1).setFrozenColumns(t.frozenColumnCount||0).setFrozenRows(t.frozenRowCount||0).setColWidths(t.colWidths)}constructor(t){super(t),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(t,n,r){return r==="html"}getDOMSlot(t){const n=Qo(t)?t:t.querySelector("table");return Qo(n)||de(229),super.getDOMSlot(t).withElement(n).withAfter(n.querySelector("colgroup"))}createDOM(t,n){const r=document.createElement("table");this.__style&&(r.style.cssText=this.__style);const o=document.createElement("colgroup");if(r.appendChild(o),v3(o),Qe(r,t.theme.table),this.updateTableElement(null,r,t),kl(n)){const i=document.createElement("div"),s=t.theme.tableScrollableWrapper;return s?Qe(i,s):i.style.cssText="overflow-x: auto;",i.appendChild(r),this.updateTableWrapper(null,i,r,t),i}return r}updateTableWrapper(t,n,r,o){this.__frozenColumnCount!==(t?t.__frozenColumnCount:0)&&(function(i,s,a,l){l>0?(Qe(i,a.theme.tableFrozenColumn),s.setAttribute("data-lexical-frozen-column","true")):(Kn(i,a.theme.tableFrozenColumn),s.removeAttribute("data-lexical-frozen-column"))})(n,r,o,this.__frozenColumnCount),this.__frozenRowCount!==(t?t.__frozenRowCount:0)&&(function(i,s,a,l){l>0?(Qe(i,a.theme.tableFrozenRow),s.setAttribute("data-lexical-frozen-row","true")):(Kn(i,a.theme.tableFrozenRow),s.removeAttribute("data-lexical-frozen-row"))})(n,r,o,this.__frozenRowCount)}updateTableElement(t,n,r){this.__style!==(t?t.__style:"")&&(n.style.cssText=this.__style),this.__rowStriping!==(!!t&&t.__rowStriping)&&(function(o,i,s){s?(Qe(o,i.theme.tableRowStriping),o.setAttribute("data-lexical-row-striping","true")):(Kn(o,i.theme.tableRowStriping),o.removeAttribute("data-lexical-row-striping"))})(n,r,this.__rowStriping),(function(o,i,s,a){const l=o.querySelector("colgroup");if(!l)return;const c=[];for(let u=0;u<s;u++){const f=document.createElement("col"),d=a&&a[u];d&&(f.style.width=`${d}px`),c.push(f)}l.replaceChildren(...c)})(n,0,this.getColumnCount(),this.getColWidths()),Zy(n,r,this.getFormatType())}updateDOM(t,n,r){const o=this.getDOMSlot(n).element;return n===o===kl()||(Be(i=n)&&i.nodeName==="DIV"&&this.updateTableWrapper(t,n,o,r),this.updateTableElement(t,o,r),!1);var i}exportDOM(t){const n=super.exportDOM(t),{element:r}=n;return{after:o=>{if(n.after&&(o=n.after(o)),!Qo(o)&&Be(o)&&(o=o.querySelector("table")),!Qo(o))return null;Zy(o,t._config,this.getFormatType());const[i]=Ar(this,null,null),s=new Map;for(const u of i)for(const f of u){const d=f.cell.getKey();s.has(d)||s.set(d,{colSpan:f.cell.getColSpan(),startColumn:f.startColumn})}const a=new Set;for(const u of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){const f=u.getAttribute("data-temporary-table-cell-lexical-key");if(f){const d=s.get(f);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),d){s.delete(f);for(let h=0;h<d.colSpan;h++)a.add(h+d.startColumn)}}}const l=o.querySelector(":scope > colgroup");if(l){const u=Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((f,d)=>a.has(d));l.replaceChildren(...u)}const c=o.querySelectorAll(":scope > tr");if(c.length>0){const u=document.createElement("tbody");for(const f of c)u.appendChild(f);o.append(u)}return o},element:!Qo(r)&&Be(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,n){const{rows:r,domRows:o}=n;for(let i=0;i<r;i++){const s=o[i];if(s!=null)for(let a=0;a<s.length;a++){const l=s[a];if(l==null)continue;const{elem:c}=l,u=ef(this,c);if(u!==null&&t.is(u))return{x:a,y:i}}}throw new Error("Cell not found in table.")}getDOMCellFromCords(t,n,r){const{domRows:o}=r,i=o[n];if(i==null)return null;const s=i[t<i.length?t:i.length-1];return s??null}getDOMCellFromCordsOrThrow(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(!o)throw new Error("Cell not found at cords.");return o}getCellNodeFromCords(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(o==null)return null;const i=Ht(o.elem);return ge(i)?i:null}getCellNodeFromCordsOrThrow(t,n,r){const o=this.getCellNodeFromCords(t,n,r);if(!o)throw new Error("Node at cords not TableCellNode.");return o}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(t){const n=this.getWritable();return n.__rowStriping=t,n}setFrozenColumns(t){const n=this.getWritable();return n.__frozenColumnCount=t,n}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(t){const n=this.getWritable();return n.__frozenRowCount=t,n}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){const t=this.getFirstChild();if(!t)return 0;let n=0;return t.getChildren().forEach(r=>{ge(r)&&(n+=r.getColSpan())}),n}}function fP(e,t){const n=e.getElementByKey(t.getKey());return n===null&&de(230),mi(t,n)}function hP(e){const t=rc();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&t.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&t.setFrozenRows(1);const n=e.querySelector(":scope > colgroup");if(n){let r=[];for(const o of n.querySelectorAll(":scope > col")){let i=o.style.width||"";if(!Hh.test(i)&&(i=o.getAttribute("width")||"",!/^\d+$/.test(i))){r=void 0;break}r.push(parseFloat(i))}r&&t.setColWidths(r)}return{after:r=>Jb(r,et),node:t}}function rc(){return _t(new An)}function Xe(e){return e instanceof An}function gP(e){et(e.getParent())?e.isEmpty()&&e.append(me()):e.remove()}function pP(e){Xe(e.getParent())?Xb(e,ge):e.remove()}function mP(e){Xb(e,et);const[t]=Ar(e,null,null),n=t.reduce((s,a)=>Math.max(s,a.length),0),r=e.getChildren();for(let s=0;s<t.length;++s){const a=r[s];if(!a)continue;et(a)||de(254,a.constructor.name,a.getType());const l=t[s].reduce((c,u)=>u?1+c:c,0);if(l!==n)for(let c=l;c<n;++c){const u=ln();u.append(me()),a.append(u)}}const o=e.getColWidths(),i=e.getColumnCount();if(o&&o.length!==i){let s;if(i<o.length)s=o.slice(0,i);else if(o.length>0){const a=o[o.length-1];s=[...o,...Array(i-o.length).fill(a)]}e.setColWidths(s)}}function yP(e){if(e.detail<3||!xn(e.target))return!1;const t=Ht(e.target);if(t===null)return!1;const n=be(t,r=>B(r)&&!r.isInline());return n===null?!1:!!ge(n.getParent())&&(n.select(0),!0)}function vP(e){return e.registerNodeTransform(kn,t=>{if(t.getColSpan()>1||t.getRowSpan()>1){const[,,n]=Dn(t),[r]=on(n,t,t),o=r.length,i=r[0].length;let s=n.getFirstChild();et(s)||de(175);const a=[];for(let l=0;l<o;l++){l!==0&&(s=s.getNextSibling(),et(s)||de(175));let c=null;for(let u=0;u<i;u++){const f=r[l][u],d=f.cell;if(f.startRow===l&&f.startColumn===u)c=d,a.push(d);else if(d.getColSpan()>1||d.getRowSpan()>1){ge(d)||de(176);const h=ln(d.__headerState);c!==null?c.insertAfter(h):B3(s,h)}}}for(const l of a)l.setColSpan(1),l.setRowSpan(1)}})}function xP(e,t=!0){const n=new Map,r=(i,s,a)=>{const l=Ro(i,a),c=aP(i,l,e,t);n.set(s,[c,l])},o=e.registerMutationListener(An,i=>{e.getEditorState().read(()=>{for(const[s,a]of i){const l=n.get(s);if(a==="created"||a==="updated"){const{tableNode:c,tableElement:u}=Gw(s);l===void 0?r(c,s,u):u!==l[1]&&(l[0].removeListeners(),n.delete(s),r(c,s,u))}else a==="destroyed"&&l!==void 0&&(l[0].removeListeners(),n.delete(s))}},{editor:e})},{skipInitialization:!1});return()=>{o();for(const[,[i]]of n)i.removeListeners()}}function bP(e,t){e.hasNodes([An])||de(255);const{hasNestedTables:n=tw(!1)}=t??{};return Rn(e.registerCommand(Ww,r=>(function({rows:o,columns:i,includeHeaders:s},a){const l=Y()||Gn();if(!l||!W(l)||!a&&yi(l.anchor.getNode()))return!1;const c=GN(Number(o),Number(i),s);V3(c);const u=c.getFirstDescendant();return X(u)&&u.select(),!0})(r,n.peek()),xe),e.registerCommand(rh,({nodes:r,selection:o},i)=>n.peek()||e!==i||!W(o)?!1:yi(o.anchor.getNode())!==null&&r.some(Xe),xe),e.registerCommand(Vl,yP,xe),e.registerNodeTransform(An,mP),e.registerNodeTransform(jr,pP),e.registerNodeTransform(kn,gP))}function wP({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:n=!0,hasHorizontalScroll:r=!1,hasNestedTables:o=!1}){const[i]=it();S.useEffect(()=>{kl(i)!==r&&(dP(i,r),i.registerNodeTransform(An,()=>{})())},[i,r]);const s=S.useMemo(()=>tw(!1),[]);return s.peek()!==o&&(s.value=o),S.useEffect(()=>bP(i,{hasNestedTables:s}),[i,s]),S.useEffect(()=>xP(i,n),[i,n]),S.useEffect(()=>{if(!e)return vP(i)},[i,e]),S.useEffect(()=>{if(!t)return i.registerNodeTransform(kn,a=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})},[i,t,e]),null}var iu,Jy;function Zw(){if(Jy)return iu;Jy=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return iu=e,iu}var su,Qy;function CP(){if(Qy)return su;Qy=1;var e=typeof In=="object"&&In&&In.Object===Object&&In;return su=e,su}var au,ev;function Jw(){if(ev)return au;ev=1;var e=CP(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return au=n,au}var lu,tv;function SP(){if(tv)return lu;tv=1;var e=Jw(),t=function(){return e.Date.now()};return lu=t,lu}var cu,nv;function _P(){if(nv)return cu;nv=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return cu=t,cu}var uu,rv;function TP(){if(rv)return uu;rv=1;var e=_P(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return uu=n,uu}var du,ov;function Qw(){if(ov)return du;ov=1;var e=Jw(),t=e.Symbol;return du=t,du}var fu,iv;function EP(){if(iv)return fu;iv=1;var e=Qw(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function i(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[o]=l:delete s[o]),u}return fu=i,fu}var hu,sv;function RP(){if(sv)return hu;sv=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return hu=n,hu}var gu,av;function kP(){if(av)return gu;av=1;var e=Qw(),t=EP(),n=RP(),r="[object Null]",o="[object Undefined]",i=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?o:r:i&&i in Object(a)?t(a):n(a)}return gu=s,gu}var pu,lv;function AP(){if(lv)return pu;lv=1;function e(t){return t!=null&&typeof t=="object"}return pu=e,pu}var mu,cv;function MP(){if(cv)return mu;cv=1;var e=kP(),t=AP(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return mu=r,mu}var yu,uv;function NP(){if(uv)return yu;uv=1;var e=TP(),t=Zw(),n=MP(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=t(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=i.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):o.test(c)?r:+c}return yu=l,yu}var vu,dv;function PP(){if(dv)return vu;dv=1;var e=Zw(),t=SP(),n=NP(),r="Expected a function",o=Math.max,i=Math.min;function s(a,l,c){var u,f,d,h,g,p,m=0,x=!1,y=!1,v=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(c)&&(x=!!c.leading,y="maxWait"in c,d=y?o(n(c.maxWait)||0,l):d,v="trailing"in c?!!c.trailing:v);function b(I){var $=u,H=f;return u=f=void 0,m=I,h=a.apply(H,$),h}function w(I){return m=I,g=setTimeout(T,l),x?b(I):h}function _(I){var $=I-p,H=I-m,U=l-$;return y?i(U,d-H):U}function E(I){var $=I-p,H=I-m;return p===void 0||$>=l||$<0||y&&H>=d}function T(){var I=t();if(E(I))return k(I);g=setTimeout(T,_(I))}function k(I){return g=void 0,v&&u?b(I):(u=f=void 0,h)}function P(){g!==void 0&&clearTimeout(g),m=0,u=p=f=g=void 0}function O(){return g===void 0?h:k(t())}function D(){var I=t(),$=E(I);if(u=arguments,f=this,p=I,$){if(g===void 0)return w(p);if(y)return clearTimeout(g),g=setTimeout(T,l),b(p)}return g===void 0&&(g=setTimeout(T,l)),h}return D.cancel=P,D.flush=O,D}return vu=s,vu}var FP=PP();const LP=xf(FP),$P=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M1.61342 8.47549C1.52262 8.33173 1.47723 8.25985 1.45182 8.14898C1.43273 8.06571 1.43273 7.93437 1.45182 7.8511C1.47723 7.74023 1.52262 7.66835 1.61341 7.52459C2.36369 6.3366 4.59693 3.33337 8.00027 3.33337C11.4036 3.33337 13.6369 6.3366 14.3871 7.52459C14.4779 7.66835 14.5233 7.74023 14.5487 7.8511C14.5678 7.93437 14.5678 8.06571 14.5487 8.14898C14.5233 8.25985 14.4779 8.33173 14.3871 8.47549C13.6369 9.66348 11.4036 12.6667 8.00027 12.6667C4.59693 12.6667 2.36369 9.66348 1.61342 8.47549Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M8.00027 10C9.10484 10 10.0003 9.10461 10.0003 8.00004C10.0003 6.89547 9.10484 6.00004 8.00027 6.00004C6.8957 6.00004 6.00027 6.89547 6.00027 8.00004C6.00027 9.10461 6.8957 10 8.00027 10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),eC=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M16 6V5.2C16 4.0799 16 3.51984 15.782 3.09202C15.5903 2.71569 15.2843 2.40973 14.908 2.21799C14.4802 2 13.9201 2 12.8 2H11.2C10.0799 2 9.51984 2 9.09202 2.21799C8.71569 2.40973 8.40973 2.71569 8.21799 3.09202C8 3.51984 8 4.0799 8 5.2V6M10 11.5V16.5M14 11.5V16.5M3 6H21M19 6V17.2C19 18.8802 19 19.7202 18.673 20.362C18.3854 20.9265 17.9265 21.3854 17.362 21.673C16.7202 22 15.8802 22 14.2 22H9.8C8.11984 22 7.27976 22 6.63803 21.673C6.07354 21.3854 5.6146 20.9265 5.32698 20.362C5 19.7202 5 18.8802 5 17.2V6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));function tC(e){return e instanceof ko}function nC(e){return new ko(e)}const{color:Ri,cornerRadius:OP,spacing:IP,transition:DP}=V,VP=R.css({display:"inline-flex",color:Ri.text.accent,textDecoration:"underline",cursor:"pointer"}),jP=R.css({color:Ri.text.accent,":hover":{color:Ri.text.accentHover}}),BP=R.css({width:"16px",height:"16px",color:Ri.icon.negative,cursor:"pointer",transition:DP.general,":hover":{color:Ri.icon.negativeHover}}),zP=R.css({boxShadow:`0 2px 10px 4px ${Ri.effect.shadowL}`,borderRadius:OP.md,padding:IP.sm});function HP({url:e,text:t,nodeKey:n}){const[r]=it(),o=S.useCallback(()=>{r.update(()=>{const i=Pe(n);tC(i)&&i.remove()})},[r,n]);return C.jsx(Nr,{content:C.jsxs(G,{flex:!0,row:!0,center:!0,gap:"var(--spacing-xs)",children:[C.jsx("a",{className:jP,target:"_blank",href:e,children:e}),C.jsx(eC,{className:BP,onClick:o})]}),placement:"right-start",trigger:"hover",contentClassName:zP,children:C.jsx(ae,{className:VP,children:t})})}const xu="custom-link-node";class ko extends Us{_url;_text;constructor({url:t,text:n},r){super(r),this._url=t,this._text=n}getType(){return xu}getData(){return{url:this._url,text:this._text}}isInline(){return!0}isIsolated(){return!1}createDOM(){const t=document.createElement("span");return t.style.display="inline",t}updateDOM(){return!1}decorate(){return C.jsx(HP,{...this.getData(),nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:xu,version:1,text:this._text,url:this._url}}static importJSON(t){return new ko({url:t.url,text:t.text})}static getType(){return xu}static clone(t){return new ko({url:t._url,text:t._text},t.__key)}}const WP={type:"text-match",dependencies:[ko],regExp:/\[([^\]]+)]\(([^)]+)\)/,trigger:")",importRegExp:/\[([^\]]+)]\(([^)]+)\)/,replace:(e,t)=>{const[,n,r]=t,o=nC({url:r,text:n});e.replace(o)},export:e=>{if(!tC(e))return null;const{text:n,url:r}=e.getData();return!r||!n?"":`[${n}](${r})`}},fv="image-row",KP=R.css({width:"fit-content",display:"flex",alignItems:"center"});function rC(e){return e.length?new Br(e):null}function oC(e){return e instanceof Br}const{color:nf,cornerRadius:iC,spacing:UP,transition:GP}=V,qP=R.css({width:"100px",height:"100px",objectFit:"cover",borderRadius:iC.md}),YP=R.css({width:"20px",height:"20px",color:nf.icon.negative,cursor:"pointer",transition:GP.general,":hover":{color:nf.icon.negativeHover}}),XP=R.css({boxShadow:`0 2px 10px 4px ${nf.effect.shadowL}`,borderRadius:iC.xs,padding:UP.xs}),{spacing:ZP}=V;function JP({images:e,nodeKey:t}){const[n]=it(),r=S.useCallback(()=>{n.update(()=>{const o=Pe(t);oC(o)&&o.remove()})},[n,t]);return C.jsx(Nr,{content:C.jsx(eC,{className:YP,onClick:r}),placement:"right-start",trigger:"hover",contentClassName:XP,children:C.jsx(G,{w:"full",flex:!0,row:!0,gap:ZP.sm,alignItems:"center",children:e.map(({src:o,alt:i})=>C.jsx("img",{src:o,alt:i??"",className:qP},o))})})}class Br extends Us{images;constructor(t,n){super(n),this.images=t}createDOM(){const t=document.createElement("div");return t.className=KP,t.contentEditable="false",t}updateDOM(){return!1}decorate(){return C.jsx(JP,{images:this.images,nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:fv,version:1,images:this.images}}static importJSON(t){return new Br(t.images)}isInline(){return!1}isIsolated(){return!0}isSelectable(){return!0}static getType(){return fv}static clone(t){return new Br(t.images,t.__key)}}const QP={type:"element",dependencies:[Br],regExp:/^!\[[^\]]*]\([^)]+\)(?:\s+!\[[^\]]*]\([^)]+\))*$/,replace:(e,t,n)=>{const[r]=n,i=[...r.matchAll(/!\[([^\]]*)]\(([^)]+)\)/g)].map(([a,l,c])=>({alt:l,src:c})),s=rC(i);s&&gh([s])},export:e=>{if(!(e instanceof Br))return null;const n=e.images;return n.length?n.map(({src:r,alt:o})=>`![${o}](${r})`).join(" "):""}},e6=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",null,M.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",fill:"currentColor"}),M.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",fill:"currentColor"}),M.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",fill:"currentColor"}),M.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),M.createElement("defs",null)),{color:hv}=V,t6=R.css({cursor:"pointer"}),n6=R.css({":hover":{backgroundColor:hv.fill.bgSecondary},":active":{backgroundColor:hv.fill.bgSecondary}}),{color:gv,spacing:pv}=V;function r6({groups:e,toolbarVisibleActionsCount:t,onAction:n,disabled:r}){const[o,i]=S.useState(!1),s=S.useCallback(c=>()=>{r||(c&&c(),i(!1))},[r]),a=S.useCallback(({IconComponent:c,...u},f)=>C.jsxs(G,{className:R.cx(t6,!r&&n6),p:pv.sm,alignItems:"center",flex:!0,row:!0,gap:pv.xs,onClick:s(()=>n(u.id,f)),children:[C.jsx(c,{width:20,height:20,color:gv.icon.tertiary}),C.jsx(ae,{variant:"body-2",children:u.label})]},u.id),[r,n,s]),l=S.useMemo(()=>e.map((c,u)=>{const f=u===e.length-1;if(!c.length)return null;const d=c.map((h,g)=>{const m=(u?e.slice(0,u).flat().length:0)+g+t;return a(h,m)});return C.jsxs(S.Fragment,{children:[d,f?null:C.jsx(G,{w:"full",h:1,backgroundColor:gv.border.neutralAlphaBasic})]},c.flatMap(h=>h.id).join("-"))}),[e,a,t]);return C.jsx(Nr,{content:C.jsx(G,{flex:!0,children:l}),placement:"bottom",open:o,onChange:i,children:C.jsx(dr,{size:"xs",color:"no-bg",disabled:r,children:C.jsx(e6,{})})})}const o6=R.css({minWidth:"fit-content"}),i6=e=>{throw new Error("defaultOnImagesUpload function must be overridden")},{spacing:mv}=V;function yv({onSave:e}){const[t,n]=S.useState(""),[r,o]=S.useState(""),[i,s]=S.useState(null),a=Hs(),{textPlaceholder:l,linkPlaceholder:c,linkErrorText:u,buttonText:f}=a.toolbar.link,d=S.useMemo(()=>i==="link"?u:null,[i,u]),h=S.useCallback(v=>{try{const b=new URL(v);if(!(b.protocol==="http:"||b.protocol==="https:"))throw new Error("Invalid protocol");return s(null),!0}catch{return s("link"),!1}},[]),g=S.useCallback(v=>{n(v.target.value)},[]),p=S.useCallback(v=>{h(v.target.value),o(v.target.value)},[h]),m=S.useCallback(()=>[()=>h(r)].map(w=>w()).every(Boolean),[r,h]),x=S.useCallback(()=>{n(""),o(""),s(null)},[]),y=S.useCallback(v=>{v.preventDefault(),m()&&(e({text:t||r,url:r}),x())},[r,e,t,m,x]);return S.useEffect(()=>()=>{x()},[]),C.jsx("form",{onSubmit:y,children:C.jsxs(G,{flex:!0,alignItems:"flex-start",p:mv.sm,gap:mv.sm,children:[C.jsx(G,{children:C.jsx(Ci,{placeholder:l,size:"sm",value:t,onChange:g})}),C.jsx(G,{children:C.jsx(Ci,{placeholder:c,size:"sm",value:r,onChange:p,error:!!d,errorText:d||""})}),C.jsx(wi,{size:"xs",width:"auto",type:"submit",children:f})]})})}const vv=50,xv=20,bv=1,wv=1;function Cv({onSave:e}){const[t,n]=S.useState(""),[r,o]=S.useState(""),[i,s]=S.useState(null),[a,l]=S.useState(null),c=Hs(),{maxRowsErrorText:u,maxColumnsErrorText:f,minRowsErrorText:d,minColumnsErrorText:h,rowsPlaceholder:g,columnsPlaceholder:p,buttonText:m}=c.toolbar.table,x=S.useMemo(()=>{switch(i){case"rows-max":return u({current:Number(t),limit:vv});case"rows-min":return d({current:Number(t),limit:bv});default:return null}},[i,t,u,d]),y=S.useMemo(()=>{switch(a){case"columns-max":return f({current:Number(r),limit:xv});case"columns-min":return h({current:Number(r),limit:wv});default:return null}},[a,r,f,h]),v=S.useCallback(O=>{try{const D=Number(O);if(D>vv)throw s("rows-max"),new Error("Rows amount exceeds maximum");if(D<bv)throw s("rows-min"),new Error("Rows amount below minimum");return s(null),!0}catch{return!1}},[]),b=S.useCallback(O=>{try{const D=Number(O);if(D>xv)throw l("columns-max"),new Error("Columns amount exceeds maximum");if(D<wv)throw l("columns-min"),new Error("Columns amount below minimum");return l(null),!0}catch{return!1}},[]),w=S.useCallback(O=>{const D=Number(O);return!Number.isNaN(D)&&Number.isInteger(D)?D:null},[]),_=S.useCallback(O=>{const D=O.target.value,I=w(D);typeof I=="number"&&(v(D),n(String(I)))},[v,w]),E=S.useCallback(O=>{const D=O.target.value,I=w(D);typeof I=="number"&&(b(D),o(String(I)))},[b,w]),T=S.useCallback(()=>[()=>v(t),()=>b(r)].map(I=>I()).every(Boolean),[r,t,b,v]),k=S.useCallback(()=>{n(""),o(""),s(null),l(null)},[]),P=S.useCallback(O=>{O.preventDefault(),T()&&(e({rows:t,columns:r}),k())},[r,e,t,T,k]);return S.useEffect(()=>()=>{k()},[]),C.jsx("form",{onSubmit:P,children:C.jsxs(G,{flex:!0,alignItems:"flex-start",p:"var(--spacing-sm)",gap:"var(--spacing-sm)",children:[C.jsx(G,{children:C.jsx(Ci,{placeholder:g,size:"sm",value:t,onChange:_,error:!!x,errorText:x||""})}),C.jsx(G,{children:C.jsx(Ci,{placeholder:p,size:"sm",value:r,onChange:E,error:!!y,errorText:y||""})}),C.jsx(wi,{size:"xs",width:"auto",type:"submit",children:m})]})})}function s6({disabled:e=!1}){const[t,n]=S.useState(null),[r]=it(),o=Hs(),i=S.useMemo(()=>{const l=o.toolbar.textSize;return[{value:"paragraph",label:l.paragraph,textProps:{variant:"body-2"}},{value:"h1",label:l.h1,textProps:{fontWeight:"semibold",variant:"headline-1"}},{value:"h2",label:l.h2,textProps:{fontWeight:"semibold",variant:"headline-2"}},{value:"h3",label:l.h3,textProps:{fontWeight:"semibold",variant:"headline-3"}}]},[o.toolbar.textSize]),s=S.useCallback(l=>{!l||Array.isArray(l)||r.update(()=>{const c=Y();if(!W(c))return;const u=c.anchor.getNode().getTopLevelElement();if(!u)return;const f=l==="paragraph"?me():co(l);u.getChildren().forEach(d=>{f.append(d)}),u.replace(f),f.selectEnd()})},[r]),a=S.useCallback(()=>{const l=Y();if(!W(l))return null;const c=l.anchor.getNode().getTopLevelElement();return Sw(c)?c.getTag():"paragraph"},[]);return S.useEffect(()=>{const l=r.registerUpdateListener(({editorState:c})=>{c.read(()=>{const u=a();u&&n(u)})});return()=>{l()}},[r,a]),C.jsx(cg,{size:"xs",items:i,renderDropdownItem:l=>C.jsx(ae,{whiteSpace:"nowrap",...l.textProps,children:l.label}),returnedValue:l=>l.value,renderSingleInputItem:l=>l.label,onChange:s,disabled:e,value:t,showDefaultItem:!1})}const{color:ts,cornerRadius:a6,spacing:bu}=V;function l6({onImagesUpload:e=i6}){const[t,n]=S.useState(11),[r,o]=S.useState(null),[i,s]=S.useState(null),a=S.useRef(null),{toolbar:l}=Hs(),c=l.preview,[u]=it(),{isEditable:f,isPreviewMode:d,setPreviewMode:h}=th(),{availableActionGroups:g}=H3(),p=S.useRef(null),m=S.useMemo(()=>!f||d,[f,d]),x=S.useMemo(()=>d?c.hide:c.show,[d,c]),{toolbarGroups:y,menuGroups:v}=S.useMemo(()=>{const $=[],H=[];let U=0;for(const F of g){const N=[],j=[];for(const K of F)U+=1,U<=t?N.push(K):j.push(K);N.length&&$.push(N),j.length&&H.push(j)}return{toolbarGroups:$,menuGroups:H}},[g,t]),b=S.useMemo(()=>typeof r=="number"&&r>t-1,[r,t]),w=S.useMemo(()=>typeof i=="number"&&i>t-1,[i,t]),_=S.useCallback($=>{const{text:H,url:U}=$;u.update(()=>{const F=Y();if(W(F)){const N=nC({text:H,url:U});F.insertNodes([N]);const j=Le(" ");N.insertAfter(j),j.select()}}),o(null)},[u]),E=S.useCallback($=>{const{rows:H,columns:U}=$;u.dispatchCommand(Ww,{rows:H,columns:U}),s(null)},[u]),T=S.useCallback(()=>{p.current&&p.current.click()},[]),k=S.useCallback(async $=>{try{const H=Array.from($.target.files||[]);if(!H.length)return;const U=await e(H);u.update(()=>{const F=rC(U);F&&gh([F])})}catch(H){console.error("Error uploading images:",H)}finally{$.target.value=""}},[u,e]),P=S.useCallback(($,H)=>{({[ie.BOLD]:()=>{u.dispatchCommand(It,"bold")},[ie.ITALIC]:()=>{u.dispatchCommand(It,"italic")},[ie.UNDERLINE]:()=>{u.dispatchCommand(It,"underline")},[ie.STRIKETHROUGH]:()=>{u.dispatchCommand(It,"strikethrough")},[ie.ALIGN_LEFT]:()=>{u.dispatchCommand(di,"left")},[ie.ALIGN_CENTER]:()=>{u.dispatchCommand(di,"center")},[ie.ALIGN_RIGHT]:()=>{u.dispatchCommand(di,"right")},[ie.LINK]:()=>{o(H)},[ie.IMAGE]:()=>{T()},[ie.TABLE]:()=>{s(H)},[ie.BULLET_LIST]:()=>{u.dispatchCommand(hw,void 0)},[ie.NUMBERED_LIST]:()=>{u.dispatchCommand(gw,void 0)}})[$]()},[T,u]),O=S.useMemo(()=>y.map(($,H)=>{const U=y.slice(0,H).reduce((j,K)=>j+K.length,0);if(!$.length)return null;const F=$.map(({IconComponent:j,isActive:K,id:te},J)=>{const Z=U+J,se=K?"neutral":"no-bg";return te===ie.LINK?C.jsx(Nr,{content:C.jsx(yv,{onSave:_}),placement:"bottom",open:r===Z,onChange:oe=>{o(oe?Z:null)},children:C.jsx(dr,{size:"xs",color:"no-bg",disabled:m,children:C.jsx(j,{})})},te):te===ie.TABLE?C.jsx(Nr,{content:C.jsx(Cv,{onSave:E}),placement:"bottom",open:i===Z,onChange:oe=>{s(oe?Z:null)},children:C.jsx(dr,{size:"xs",color:se,disabled:m,children:C.jsx(j,{})})},te):C.jsx(dr,{size:"xs",color:se,onClick:()=>P(te,Z),disabled:m,children:C.jsx(j,{})},te)});return F.every(j=>!j)?null:C.jsxs(S.Fragment,{children:[F,C.jsx(G,{w:1,h:32,backgroundColor:ts.border.neutralAlphaBasic})]},$.flatMap(j=>j.id).join("-"))}),[y,P,r,m,i,_,E]),D=S.useCallback(()=>{const $=a.current;if(!$)return;const H=$.clientWidth,U=40,F=4,N=1,j=F+N+F+U+F;let K=H-j,te=0;for(const J of g)if(J.length){for(const Z of J){const se=U+F;if(K-se>=0)K-=se,te+=1;else break}K-=N+F}n(te)},[g]),I=S.useMemo(()=>LP(D,20,{}),[D]);return S.useEffect(()=>{if(!a.current)return;const $=new ResizeObserver(()=>{I()});return $.observe(a.current),()=>$.disconnect()},[I]),C.jsxs(G,{backgroundColor:ts.fill.neutralPrimary,border:`1px solid ${ts.border.neutralAlphaBasic}`,borderRadius:a6.md,flex:!0,row:!0,alignItems:"center",justifyContent:"space-between",p:bu.sm,children:[C.jsxs(G,{flex:!0,flexGrow:1,row:!0,alignItems:"center",overflow:"hidden",children:[C.jsx("input",{ref:p,type:"file",accept:"image/*",hidden:!0,multiple:!0,onChange:k,disabled:m}),C.jsx(s6,{disabled:m}),C.jsx(Nr,{content:C.jsx(yv,{onSave:_}),placement:"bottom",open:b,onChange:$=>{$||o(null)},children:C.jsx("div",{})}),C.jsx(Nr,{content:C.jsx(Cv,{onSave:E}),placement:"bottom",open:w,onChange:$=>{$||s(null)},children:C.jsx("div",{})}),C.jsxs(G,{flex:!0,row:!0,alignItems:"center",gap:bu.xs,w:"full",ml:bu.xs,overflow:"hidden",ref:a,children:[O,v.length?C.jsx(r6,{disabled:m,onAction:P,groups:v,toolbarVisibleActionsCount:t}):null]})]}),C.jsx(wi,{width:"auto",size:"xs",color:d?"accent":"neutral",intensity:"secondary",wrapperClassName:o6,onClick:()=>{h($=>!$)},iconLeft:C.jsx($P,{color:d?ts.icon.accent:ts.icon.secondary}),children:x})]})}const sC=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function c6({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:i,ariaExpanded:s,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:f,ariaRequired:d,autoCapitalize:h,className:g,id:p,role:m="textbox",spellCheck:x=!0,style:y,tabIndex:v,"data-testid":b,...w},_){const[E,T]=S.useState(e.isEditable()),k=S.useCallback(O=>{O&&O.ownerDocument&&O.ownerDocument.defaultView?e.setRootElement(O):e.setRootElement(null)},[e]),P=S.useMemo(()=>(function(...O){return D=>{for(const I of O)typeof I=="function"?I(D):I!=null&&(I.current=D)}})(_,k),[k,_]);return sC(()=>(T(e.isEditable()),e.registerEditableListener(O=>{T(O)})),[e]),C.jsx("div",{"aria-activedescendant":E?t:void 0,"aria-autocomplete":E?n:"none","aria-controls":E?r:void 0,"aria-describedby":o,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":E&&m==="combobox"?!!s:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":E?f:void 0,"aria-readonly":!E||void 0,"aria-required":d,autoCapitalize:h,className:g,contentEditable:E,"data-testid":b,id:p,ref:P,role:m,spellCheck:x,style:y,tabIndex:v,...w})}const u6=S.forwardRef(c6);function Sv(e){return e.getEditorState().read(Vw(e.isComposing()))}const d6=S.forwardRef(f6);function f6(e,t){const{placeholder:n,...r}=e,[o]=it();return C.jsxs(C.Fragment,{children:[C.jsx(u6,{editor:o,...r,ref:t}),n!=null&&C.jsx(h6,{editor:o,content:n})]})}function h6({content:e,editor:t}){const n=(function(s){const[a,l]=S.useState(()=>Sv(s));return sC(()=>{function c(){const u=Sv(s);l(u)}return c(),Rn(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),a})(t),[r,o]=S.useState(t.isEditable());if(S.useLayoutEffect(()=>(o(t.isEditable()),t.registerEditableListener(s=>{o(s)})),[t]),!n)return null;let i=null;return typeof e=="function"?i=e(r):e!==null&&(i=e),i===null?null:C.jsx("div",{"aria-hidden":!0,children:i})}const g6=S.createContext(null),wu={didCatch:!1,error:null};class p6 extends S.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=wu}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){const{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState(wu))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;r&&n.error!==null&&m6(t.resetKeys,o)&&(this.props.onReset?.({next:o,prev:t.resetKeys,reason:"keys"}),this.setState(wu))}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=S.createElement(r,l);else if(o!==void 0)a=o;else throw s}return S.createElement(g6.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function m6(e=[],t=[]){return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function y6({children:e,onError:t}){return C.jsx(p6,{fallback:C.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}const v6=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function x6(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function b6(){return(function(e){const[t]=it(),n=S.useMemo(()=>e(t),[t,e]),[r,o]=S.useState(()=>n.initialValueFn()),i=S.useRef(r);return v6(()=>{const{initialValueFn:s,subscribe:a}=n,l=s();return i.current!==l&&(i.current=l,o(l)),a(c=>{i.current=c,o(c)})},[n,e]),r})(x6)}const w6={name:"@lexical/react/ReactProvider"};function C6(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Gh=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function S6({editor:e,ErrorBoundary:t}){return(function(n,r){const[o,i]=S.useState(()=>n.getDecorators());return Gh(()=>n.registerDecoratorListener(s=>{Ss.flushSync(()=>{i(s)})}),[n]),S.useEffect(()=>{i(n.getDecorators())},[n]),S.useMemo(()=>{const s=[],a=Object.keys(o);for(let l=0;l<a.length;l++){const c=a[l],u=C.jsx(r,{onError:d=>n._onError(d),children:C.jsx(S.Suspense,{fallback:null,children:o[c]})}),f=n.getElementByKey(c);f!==null&&s.push(Ss.createPortal(u,f,c))}return s},[r,o,n])})(e,t)}function _6({editor:e,ErrorBoundary:t}){return(function(n){const r=eM.maybeFromEditor(n);if(r&&r.hasExtensionByName(w6.name)){for(const o of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(o)&&C6(320,o);return!0}return!1})(e)?null:C.jsx(S6,{editor:e,ErrorBoundary:t})}function _v(e){return e.getEditorState().read(Vw(e.isComposing()))}function T6({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[r]=it();return(function(o){Gh(()=>Rn(MM(o),CM(o)),[o])})(r),C.jsxs(C.Fragment,{children:[e,C.jsx(E6,{content:t}),C.jsx(_6,{editor:r,ErrorBoundary:n})]})}function E6({content:e}){const[t]=it(),n=(function(o){const[i,s]=S.useState(()=>_v(o));return Gh(()=>{function a(){const l=_v(o);s(l)}return a(),Rn(o.registerUpdateListener(()=>{a()}),o.registerEditableListener(()=>{a()}))},[o]),i})(t),r=b6();return n?typeof e=="function"?e(r):e:null}const R6=R.css({width:"100%"}),k6=R.css({pointerEvents:"none"});function A6(e){const{placeholder:t}=e||{},n=S.useRef(null),{alignment:r}=ew(),o=S.useCallback(s=>{if(!t)return null;const a=typeof t=="string"||typeof t=="object"&&t.hasWrapper,l=typeof t=="string"?t:t.renderContent(s);return a?C.jsx(ae,{variant:"body-2",colorName:"tertiary",children:l}):C.jsx(C.Fragment,{children:l})},[t]),i=S.useCallback(s=>{const a=o(s);if(!a)return null;const l={left:"flex-start",center:"center",right:"flex-end"};return C.jsx(G,{absolute:!0,w:"full",top:0,left:0,alignItems:l[r],className:k6,children:a})},[o,r]);return C.jsx(G,{relative:!0,row:!0,w:"full",flexGrow:1,children:C.jsx(T6,{contentEditable:C.jsx(d6,{ref:n,className:R6,"aria-placeholder":"markdown editor",placeholder:i}),ErrorBoundary:y6})})}const{color:M6,spacing:N6}=V,P6=R.css({counterReset:"line"}),F6=R.css({display:"grid",gridTemplateColumns:"3ch 1fr",columnGap:N6.sm,whiteSpace:"pre-wrap",":before":{counterIncrement:"line",content:"counter(line)",color:M6.text.accent,userSelect:"none",textAlign:"right"}});function L6(){const{markdownText:e}=th(),t=e.split(`
65
- `);return C.jsx("pre",{className:P6,children:t.map((n,r)=>C.jsx(ae,{tag:"span",className:F6,children:n||" "},r))})}const Wo={text:R.css({fontFamily:"Inter, sans-serif"}),paragraph:R.css({...Fe.body2}),h1:R.css({...Fe.headline1}),h2:R.css({...Fe.headline2}),h3:R.css({...Fe.headline3}),h4:R.css({...Fe.body2})},{color:qh,spacing:Tv}=V,$6=R.css({borderSpacing:"0",borderCollapse:"separate"}),O6=R.css({border:`1px solid ${qh.border.neutralPrimary}`,padding:`${Tv.sm} ${Tv.sm}`}),I6=R.css({color:qh.text.accent}),D6=R.css({fontWeight:"bold"}),V6=R.css({textDecoration:"underline"}),j6=R.css({textDecoration:"line-through"}),B6=R.css({textDecoration:"underline line-through"}),z6=R.css({fontStyle:"italic"}),H6=R.css({color:qh.text.accent,textDecoration:"underline"}),W6={table:$6,tableCell:O6,hashtag:I6,link:H6,text:{base:Wo.text,bold:D6,underline:V6,strikethrough:j6,underlineStrikethrough:B6,italic:z6},heading:{h1:Wo.h1,h2:Wo.h2,h3:Wo.h3,h4:Wo.h4},paragraph:Wo.paragraph};function K6(){return{namespace:"ui-kit-markdown-text-editor",nodes:[Fo,un,$o,qr,An,kn,jr,Br,ko,tc,Ql,Jl,ec,Js,Qs],onError(e){throw e},theme:W6}}const U6=[[ie.BOLD,ie.ITALIC,ie.UNDERLINE,ie.STRIKETHROUGH],[ie.LINK,ie.IMAGE],[ie.ALIGN_LEFT,ie.ALIGN_CENTER,ie.ALIGN_RIGHT],[ie.TABLE],[ie.BULLET_LIST,ie.NUMBERED_LIST]];function G6(){const[e]=it(),{isEditable:t}=th();return S.useEffect(()=>{e.setEditable(t)},[e,t]),null}function q6(){const[e]=it();return S.useEffect(()=>{const t=e.registerCommand(jl,()=>{const n=Y();if(!W(n)||!n.isCollapsed()||n.anchor.offset!==0)return!1;const o=n.anchor.getNode().getTopLevelElement();if(!o||o.getType()!=="paragraph"||o.getTextContent()!=="")return!1;const i=o.getPreviousSibling();return oC(i)?(i.remove(),o.select(),!0):!1},$t);return()=>{t()}},[e]),null}const Y6=/^\|(.+)\|$/,X6=/^\|\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|$/,Z6=/^\|(.+)\|$/,J6={type:"multiline-element",dependencies:[An,jr,kn],regExpStart:Y6,handleImportAfterStartMatch({lines:e,rootNode:t,startLineIndex:n}){const r=e[n+1];if(!X6.test(r??""))return null;const o=rc();let i=n;for(;i<e.length&&Z6.test(e[i]);){if(i===n+1){i++;continue}const s=Ei(),a=e[i].slice(1,-1).split("|").map(c=>c.trim()),l=i===n;a.forEach(c=>{const u=ln(l?rt.ROW:void 0);u.append(Le(c)),s.append(u)}),o.append(s),i++}return t.append(o),[!0,i-1]},replace(){return!0},export(e){if(!(e instanceof An))return null;const n=e.getChildren();if(!n.length)return"";const r=[];return n.forEach((o,i)=>{if(!(o instanceof jr))return;const a=o.getChildren().map(l=>l instanceof kn?l.getTextContent().replace(/\n/g," ").trim():"");r.push(`| ${a.join(" | ")} |`),i||r.push(`| ${a.map(()=>"---").join(" | ")} |`)}),r.join(`
66
- `)}},rf=[J6,QP,WP,...ea];function Q6({defaultValue:e}){const[t]=it();return S.useEffect(()=>{t.update(()=>{e&&SN(e,rf)})},[t]),null}const{color:Cu,cornerRadius:Ev,spacing:Ma}=V;function eF({label:e,plugins:t,field:n,disabled:r=!1,locale:o,toolbar:i,defaultMarkdown:s,events:a={}}){const[l,c]=S.useState(""),[u,f]=S.useState(!1),{availableActions:d,onImagesUpload:h}=i||{},g=S.useMemo(()=>K6(),[]),p=S.useMemo(()=>({isEditable:!r,isPreviewMode:u,setPreviewMode:f,markdownText:l}),[r,u,l]),m=S.useMemo(()=>({availableActions:d||U6}),[d]),x=S.useCallback(v=>{c(v),a.onMarkdownChange&&a.onMarkdownChange(v)},[a]),y=S.useCallback(v=>{v.read(()=>{const b=_N(rf);x(b),a.onEditorStateChange&&a.onEditorStateChange(v)})},[x,a]);return C.jsx(qk,{locale:o,children:C.jsx(RN,{initialConfig:g,children:C.jsx(m1.Provider,{value:p,children:C.jsxs(y1.Provider,{value:m,children:[C.jsxs(G,{flex:!0,w:"full",borderRadius:Ev.lg,p:Ma.lg,gap:Ma.sm,backgroundColor:Cu.fill.neutralSecondary,children:[e?C.jsx(ae,{variant:"headline-3",fontWeight:"semibold",children:e}):null,C.jsx(l6,{onImagesUpload:h}),C.jsx(G,{backgroundColor:Cu.fill.neutralPrimary,border:`1px solid ${Cu.border.neutralAlphaBasic}`,borderRadius:Ev.md,p:`${Ma.md} ${Ma.lg}`,w:"full",h:144,overflow:"auto",children:u?C.jsx(L6,{}):C.jsx(A6,{...n})})]}),C.jsx(TN,{}),C.jsx(IN,{}),C.jsx(wP,{}),C.jsx(ON,{}),C.jsx(zN,{transformers:rf}),C.jsx(WN,{onChange:y}),C.jsx(G6,{}),C.jsx(Q6,{defaultValue:s}),C.jsx(q6,{}),t]})})})})}const{color:pn}=V,Ko={input:R.css({...Fe.common,...Fe.body1,width:48,height:48,textAlign:"center",borderRadius:12,border:`1px solid ${pn.border.neutralAlphaBasic}`,color:pn.text.primary,outline:"none",transition:"border-color 0.5s ease, background-color 0.5s ease, box-shadow 0.5s ease","&::placeholder":{color:pn.text.tertiary},"&:focus-visible":{borderColor:pn.border.accentPrimary,boxShadow:`0 0 0 1px ${pn.border.accentPrimary}`},"&:not(.disabled):hover":{backgroundColor:pn.fill.neutralPrimaryHover},"&:disabled":{opacity:.6,cursor:"not-allowed"}}),error:R.css({borderColor:pn.border.negativePrimary}),success:R.css({borderColor:pn.border.positivePrimary}),disabled:R.css({pointerEvents:"none",opacity:.5}),white:R.css({background:pn.fill.bgPrimary}),gray:R.css({background:pn.fill.bgSecondary}),glow:R.css({position:"absolute",inset:0,borderRadius:12,pointerEvents:"none",opacity:0,transformOrigin:"center",background:pn.fill.accentPrimary})};function tF(e){const t=S.useRef(void 0);return S.useEffect(()=>{t.current=e},[e]),t.current}const{spacing:Rv}=V,aC=S.forwardRef(({length:e=6,label:t,prompt:n,error:r,errorText:o,success:i,disabled:s,autoFocus:a,center:l,secure:c,loading:u,background:f="gray",numeric:d=!0,className:h,value:g,defaultValue:p,onChange:m,onComplete:x},y)=>{const v=typeof g=="string",b=v?g:p,w=typeof b=="string"?b.slice(0,e):"",[_,E]=Mo(v?g:void 0,w),[T,k]=S.useState(()=>{const F=w.slice(0,e);return Array.from({length:e},(N,j)=>F[j]??"")}),P=S.useRef(void 0),O=tF(g),D=S.useRef([]);S.useEffect(()=>{if(!v)return;const F=g??"";if(F===O)return;if(F===P.current){P.current=void 0;return}const N=F.slice(0,e);k(Array.from({length:e},(j,K)=>N[K]??""))},[v,g,e,O]);const I=S.useCallback((F,N)=>{const j=F.slice(0,e);N?.fromInternal&&(P.current=j),E(j),m?.(j),j.length===e&&x?.(j)},[e,m,x,E]);S.useImperativeHandle(y,()=>({focus:()=>{D.current[0]?.focus()},blur:()=>{D.current.forEach(F=>F?.blur())},get value(){return _||""},setValue:F=>{const N=F.slice(0,e);k(Array.from({length:e},(j,K)=>N[K]??"")),I(N,{fromInternal:!0})},clear:()=>{k(Array.from({length:e},()=>"")),I("",{fromInternal:!0})}}),[e,I,_]);const $=S.useCallback((F,N)=>{if(s)return;let j=N;if(d&&(j=j.replace(/\D/g,"")),j.length>1){const Z=T.slice(0,F).join("")+j+T.slice(F+1).join(""),se=Array.from({length:e},(_e,ne)=>Z[ne]??"");k(se),I(Z,{fromInternal:!0});const oe=Math.min(F+j.length,e-1),fe=D.current[oe];fe?.focus(),fe?.select();return}const K=T[F],te=[...T];te[F]=j,k(te);const J=te.join("");if(I(J,{fromInternal:!0}),!K&&j&&F<e-1){const Z=D.current[F+1];Z?.focus(),Z?.select()}},[T,s,e,d,I]),H=S.useCallback((F,N)=>{if(!s){if(N.key==="Backspace"){N.preventDefault();const j=D.current[F];if(T[F]){const K=[...T];K[F]="",k(K),I(K.join(""),{fromInternal:!0}),j?.focus();return}if(F>0){const K=D.current[F-1];K?.focus(),K?.select()}return}N.key==="ArrowLeft"&&F>0&&(N.preventDefault(),D.current[F-1]?.focus()),N.key==="ArrowRight"&&F<e-1&&(N.preventDefault(),D.current[F+1]?.focus())}},[T,s,e,I]),U=S.useCallback((F,N)=>{if(s)return;N.preventDefault();let j=N.clipboardData.getData("text");if(d&&(j=j.replace(/\D/g,"")),!j)return;const K=e-F,te=Math.min(j.length,K),J=j.slice(0,te),Z=[...T];for(let _e=0;_e<te;_e++)Z[F+_e]=J[_e]??"";k(Z);const se=Z.join("");I(se,{fromInternal:!0});const oe=Math.min(F+te-1,e-1),fe=D.current[oe];fe?.focus(),fe?.select()},[T,s,e,d,I]);return C.jsxs(G,{w:"full",gap:Rv.sm,className:h,center:l,children:[t&&C.jsx(ae,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",children:t}),C.jsx(G,{row:!0,w:"full",gap:Rv.sm,center:l,className:R.cx({[Ko.disabled]:s}),children:Array.from({length:e}).map((F,N)=>C.jsxs(G,{relative:!0,display:"inline-block",children:[C.jsx("input",{ref:j=>{D.current[N]=j},className:R.cx(Ko.input,Ko[f],r&&Ko.error,i&&Ko.success,T[N]&&R.css({caretColor:"transparent"})),inputMode:d?"numeric":"text",type:c?"password":"text",maxLength:1,autoFocus:a&&N===0,disabled:s||u,value:T[N],onChange:j=>$(N,j.target.value),onKeyDown:j=>H(N,j),onPaste:j=>U(N,j)}),C.jsx(zs.span,{className:Ko.glow,variants:nF,custom:N,initial:"idle",animate:u?"wave":"idle"})]},N))}),n&&C.jsx(ae,{variant:"caption-1",colorName:"tertiary",children:n}),o&&r&&C.jsx(ae,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:o})]})}),nF={idle:{opacity:0,scale:1,transition:{duration:.18}},wave:(e=0)=>({opacity:[0,.2,0],scale:[1,1.03,1],transition:{duration:1.5,delay:e*.15,repeat:1/0,ease:[.42,0,.58,1]}})};aC.displayName="OtpInput";const lC=S.createContext(null),rF=()=>S.useContext(lC),{spacing:oF}=V,ns={radio:R.css({display:"flex",alignItems:"flex-start",justifyContent:"flex-start",gap:oF.md,cursor:"pointer"}),disabled:R.css({opacity:.5,cursor:"not-allowed"}),sideRight:R.css({flexDirection:"row-reverse",justifyContent:"space-between"}),readOnly:R.css({cursor:"auto"}),checked:R.css({})},{color:br,cornerRadius:kv}=V,Av={sm:{inner:12,outer:20},md:{inner:16,outer:24}},cC=S.forwardRef(({value:e,children:t,checked:n,defaultChecked:r,onChange:o,disabled:i,className:s,description:a,size:l,side:c,readOnly:u,error:f},d)=>{const h=rF(),g=!!h,p=n!==void 0,[m,x]=Mo(n,r),y=g?h.value===e:p?n:m,v=h?.disabled||i,b=l??h?.size??"md",w=c??h?.side??"left",_=u??h?.readOnly??!1,E=f??h?.error??!1,T=Av[b].outer,k=Av[b].inner,P=()=>{v||_||(g?h.setValue?.(e):(p||x(!y),o?.(!y)))},O=y&&E?br.fill.negativeTint:y?br.fill.accentTint:br.fill.bgSecondary,D=y&&E?br.fill.negativePrimary:y?br.fill.accentPrimary:void 0,I=y&&E||E&&!y?br.border.negativeSecondary:br.border.neutralAlphaLow;return C.jsxs("button",{ref:d,role:"radio",type:"button","data-value":e,"aria-checked":y,"aria-disabled":v||void 0,tabIndex:y?0:-1,className:R.cx([ns.radio,y&&ns.checked,v&&ns.disabled,w==="right"&&ns.sideRight,_&&ns.readOnly,s]),onClick:P,children:[C.jsx(G,{w:T,h:T,backgroundColor:O,borderWidth:y?0:1,borderColor:I,borderStyle:"solid",center:!0,borderRadius:kv.fullRound,children:C.jsx(G,{w:k,h:k,backgroundColor:D,borderRadius:kv.fullRound,"aria-hidden":!0})}),C.jsxs(G,{alignItems:"flex-start",children:[C.jsx(ae,{variant:b==="sm"?"body-2":"body-1",tag:"span",left:!0,children:t}),a&&C.jsx(ae,{tag:"span",variant:"body-2",colorName:"secondary",children:a})]})]})});cC.displayName="Radio";const{spacing:Mv}=V,uC=S.forwardRef(({label:e,value:t,defaultValue:n,onChange:r,children:o,className:i,error:s=!1,disabled:a=!1,readOnly:l=!1,side:c="left",size:u="md"},f)=>{const[d,h]=Mo(t,n),g=t!==void 0,p=g?t:d,m=S.useCallback(y=>{g||h(y),r?.(y)},[g,r,h]),x=S.useRef(null);return S.useImperativeHandle(f,()=>x.current),C.jsx(lC.Provider,{value:{value:p,readOnly:l,disabled:a,setValue:m,size:u,side:c,error:s},children:C.jsxs(G,{gap:Mv.sm,ref:x,role:"radiogroup","aria-invalid":s||void 0,className:i,children:[typeof e=="string"?C.jsx(ae,{colorName:"secondary",children:e}):e,C.jsx(G,{gap:Mv.lg,children:o})]})})});uC.displayName="RadioGroup";const{color:er}=V,Nv=R.css({border:`1px solid ${er.border.neutralAlphaBasic}`}),Pv=R.css({display:"flex",alignItems:"center",justifyContent:"center"}),wr={primary:R.css({background:er.fill.bgPrimary,border:`1px solid ${er.border.neutralAlphaBasic}`}),secondary:R.css({background:er.fill.bgSecondary,border:`1px solid ${er.border.neutralAlphaBasic}`}),button:R.css({cursor:"pointer",border:"1px solid transparent",borderRadius:8,padding:"8px 12px",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:10,transition:"all 0.15s ease",position:"relative",overflow:"hidden",background:"none",[`&:hover:not(.${Nv})`]:{background:er.fill.neutralPrimaryHover},[`& .${Pv} svg`]:{color:er.icon.tertiary},"&:disabled":{cursor:"not-allowed",opacity:.5}}),"button-active":Nv,"button-primary":R.css({background:er.fill.bgSecondary}),"button-secondary":R.css({background:er.fill.bgPrimary}),"button-disabled":R.css({opacity:.5,cursor:"not-allowed"}),"full-width":R.css({width:"100%"}),"icon-container":Pv},{color:Fv,cornerRadius:iF,spacing:Lv}=V;function sF({value:e,onChange:t,options:n,variant:r="primary",fullWidth:o=!1,className:i}){return C.jsx(G,{row:!0,alignItems:"center",borderRadius:iF.md,p:Lv.xs,gap:Lv.md,className:R.cx(wr[r],o&&wr["full-width"],i),children:n.map(s=>{const a=s.value===e,l=s.disabled,c=s.separatorAfter??!1;return C.jsxs(S.Fragment,{children:[C.jsxs("button",{type:"button",disabled:l,className:R.cx(wr.button,o&&wr["full-width"],a&&wr["button-active"],a&&wr[`button-${r}`],l&&wr["button-disabled"]),onClick:()=>!l&&t(s.value),children:[s.icon&&C.jsx(G,{alignItems:"center",justifyContent:"center",className:wr["icon-container"],children:s.icon}),s.label&&C.jsx(ae,{colorName:a?"primary":"tertiary",children:s.label}),!l&&C.jsx(No,{color:Fv.fill.bgOverlayPrimary})]}),c&&C.jsx(G,{w:1,h:24,backgroundColor:Fv.fill.bgTertiary})]},s.value)})})}function oc(){return typeof window<"u"}function ji(e){return dC(e)?(e.nodeName||"").toLowerCase():"#document"}function Bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qn(e){var t;return(t=(dC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dC(e){return oc()?e instanceof Node||e instanceof Bt(e).Node:!1}function Ve(e){return oc()?e instanceof Element||e instanceof Bt(e).Element:!1}function Pt(e){return oc()?e instanceof HTMLElement||e instanceof Bt(e).HTMLElement:!1}function of(e){return!oc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bt(e).ShadowRoot}const aF=new Set(["inline","contents"]);function ta(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=cn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!aF.has(o)}const lF=new Set(["table","td","th"]);function cF(e){return lF.has(ji(e))}const uF=[":popover-open",":modal"];function ic(e){return uF.some(t=>{try{return e.matches(t)}catch{return!1}})}const dF=["transform","translate","scale","rotate","perspective"],fF=["transform","translate","scale","rotate","perspective","filter"],hF=["paint","layout","strict","content"];function Yh(e){const t=sc(),n=Ve(e)?cn(e):e;return dF.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||fF.some(r=>(n.willChange||"").includes(r))||hF.some(r=>(n.contain||"").includes(r))}function gF(e){let t=yr(e);for(;Pt(t)&&!fr(t);){if(Yh(t))return t;if(ic(t))return null;t=yr(t)}return null}function sc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const pF=new Set(["html","body","#document"]);function fr(e){return pF.has(ji(e))}function cn(e){return Bt(e).getComputedStyle(e)}function ac(e){return Ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yr(e){if(ji(e)==="html")return e;const t=e.assignedSlot||e.parentNode||of(e)&&e.host||qn(e);return of(t)?t.host:t}function fC(e){const t=yr(e);return fr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pt(t)&&ta(t)?t:fC(t)}function Fr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=fC(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Bt(o);if(i){const a=sf(s);return t.concat(s,s.visualViewport||[],ta(o)?o:[],a&&n?Fr(a):[])}return t.concat(o,Fr(o,[],n))}function sf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const zr=Math.min,Ut=Math.max,Al=Math.round,Na=Math.floor,Un=e=>({x:e,y:e}),mF={left:"right",right:"left",bottom:"top",top:"bottom"},yF={start:"end",end:"start"};function af(e,t,n){return Ut(e,zr(t,n))}function Bi(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function zi(e){return e.split("-")[1]}function hC(e){return e==="x"?"y":"x"}function Xh(e){return e==="y"?"height":"width"}const vF=new Set(["top","bottom"]);function ur(e){return vF.has(Hr(e))?"y":"x"}function Zh(e){return hC(ur(e))}function xF(e,t,n){n===void 0&&(n=!1);const r=zi(e),o=Zh(e),i=Xh(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ml(s)),[s,Ml(s)]}function bF(e){const t=Ml(e);return[lf(e),t,lf(t)]}function lf(e){return e.replace(/start|end/g,t=>yF[t])}const $v=["left","right"],Ov=["right","left"],wF=["top","bottom"],CF=["bottom","top"];function SF(e,t,n){switch(e){case"top":case"bottom":return n?t?Ov:$v:t?$v:Ov;case"left":case"right":return t?wF:CF;default:return[]}}function _F(e,t,n,r){const o=zi(e);let i=SF(Hr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(lf)))),i}function Ml(e){return e.replace(/left|right|bottom|top/g,t=>mF[t])}function TF(e){return{top:0,right:0,bottom:0,left:0,...e}}function gC(e){return typeof e!="number"?TF(e):{top:e,right:e,bottom:e,left:e}}function Nl(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function EF(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function RF(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function kF(){return/apple/i.test(navigator.vendor)}function AF(){return EF().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function MF(){return RF().includes("jsdom/")}const Iv="data-floating-ui-focusable",NF="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Dv(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function $s(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&of(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ei(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Su(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function PF(e){return e.matches("html,body")}function uo(e){return e?.ownerDocument||document}function pC(e){return Pt(e)&&e.matches(NF)}function FF(e){if(!e||MF())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function LF(e){return e?e.hasAttribute(Iv)?e:e.querySelector("["+Iv+"]")||e:null}function Xa(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...Xa(e,o.id,n)])}function $F(e){return"nativeEvent"in e}function Os(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var OF=typeof document<"u",IF=function(){},ki=OF?S.useLayoutEffect:IF;const DF={...M};function Pa(e){const t=M.useRef(e);return ki(()=>{t.current=e}),t}const VF=DF.useInsertionEffect,jF=VF||(e=>e());function On(e){const t=M.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return jF(()=>{t.current=e}),M.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Vv(e,t,n){let{reference:r,floating:o}=e;const i=ur(t),s=Zh(t),a=Xh(s),l=Hr(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(zi(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const BF=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Vv(c,r,l),d=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:x}=a[p],{x:y,y:v,data:b,reset:w}=await x({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=v??f,h={...h,[m]:{...h[m],...b}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(d=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:f}=Vv(c,d,l)),p=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}};async function Jh(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Bi(t,e),g=gC(h),m=a[d?f==="floating"?"reference":"floating":f],x=Nl(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},w=Nl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(x.top-w.top+g.top)/b.y,bottom:(w.bottom-x.bottom+g.bottom)/b.y,left:(x.left-w.left+g.left)/b.x,right:(w.right-x.right+g.right)/b.x}}const zF=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Bi(e,t)||{};if(c==null)return{};const f=gC(u),d={x:n,y:r},h=Zh(o),g=Xh(h),p=await s.getDimensions(c),m=h==="y",x=m?"top":"left",y=m?"bottom":"right",v=m?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[h]-d[h]-i.floating[g],w=d[h]-i.reference[h],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=_?_[v]:0;(!E||!await(s.isElement==null?void 0:s.isElement(_)))&&(E=a.floating[v]||i.floating[g]);const T=b/2-w/2,k=E/2-p[g]/2-1,P=zr(f[x],k),O=zr(f[y],k),D=P,I=E-p[g]-O,$=E/2-p[g]/2+T,H=af(D,$,I),U=!l.arrow&&zi(o)!=null&&$!==H&&i.reference[g]/2-($<D?P:O)-p[g]/2<0,F=U?$<D?$-D:$-I:0;return{[h]:d[h]+F,data:{[h]:H,centerOffset:$-H-F,...U&&{alignmentOffset:F}},reset:U}}}),HF=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=Bi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Hr(o),y=ur(a),v=Hr(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=d||(v||!p?[Ml(a)]:bF(a)),_=g!=="none";!d&&_&&w.push(..._F(a,p,g,b));const E=[a,...w],T=await Jh(t,m),k=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(T[x]),f){const $=xF(o,s,b);k.push(T[$[0]],T[$[1]])}if(P=[...P,{placement:o,overflows:k}],!k.every($=>$<=0)){var O,D;const $=(((O=i.flip)==null?void 0:O.index)||0)+1,H=E[$];if(H&&(!(f==="alignment"?y!==ur(H):!1)||P.every(N=>ur(N.placement)===y?N.overflows[0]>0:!0)))return{data:{index:$,overflows:P},reset:{placement:H}};let U=(D=P.filter(F=>F.overflows[0]<=0).sort((F,N)=>F.overflows[1]-N.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(h){case"bestFit":{var I;const F=(I=P.filter(N=>{if(_){const j=ur(N.placement);return j===y||j==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(j=>j>0).reduce((j,K)=>j+K,0)]).sort((N,j)=>N[1]-j[1])[0])==null?void 0:I[0];F&&(U=F);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}},WF=new Set(["left","top"]);async function KF(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Hr(n),a=zi(n),l=ur(n)==="y",c=WF.has(s)?-1:1,u=i&&l?-1:1,f=Bi(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const UF=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await KF(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},GF=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x,y}=m;return{x,y}}},...l}=Bi(e,t),c={x:n,y:r},u=await Jh(t,l),f=ur(Hr(o)),d=hC(f);let h=c[d],g=c[f];if(i){const m=d==="y"?"top":"left",x=d==="y"?"bottom":"right",y=h+u[m],v=h-u[x];h=af(y,h,v)}if(s){const m=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=g+u[m],v=g-u[x];g=af(y,g,v)}const p=a.fn({...t,[d]:h,[f]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[d]:i,[f]:s}}}}}},qF=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Bi(e,t),u=await Jh(t,c),f=Hr(o),d=zi(o),h=ur(o)==="y",{width:g,height:p}=i.floating;let m,x;f==="top"||f==="bottom"?(m=f,x=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,m=d==="end"?"top":"bottom");const y=p-u.top-u.bottom,v=g-u.left-u.right,b=zr(p-u[m],y),w=zr(g-u[x],v),_=!t.middlewareData.shift;let E=b,T=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=y),_&&!d){const P=Ut(u.left,0),O=Ut(u.right,0),D=Ut(u.top,0),I=Ut(u.bottom,0);h?T=g-2*(P!==0||O!==0?P+O:Ut(u.left,u.right)):E=p-2*(D!==0||I!==0?D+I:Ut(u.top,u.bottom))}await l({...t,availableWidth:T,availableHeight:E});const k=await s.getDimensions(a.floating);return g!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function mC(e){const t=cn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Pt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Al(n)!==i||Al(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Qh(e){return Ve(e)?e:e.contextElement}function vi(e){const t=Qh(e);if(!Pt(t))return Un(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=mC(t);let s=(i?Al(n.width):n.width)/r,a=(i?Al(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const YF=Un(0);function yC(e){const t=Bt(e);return!sc()||!t.visualViewport?YF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function XF(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bt(e)?!1:t}function Ao(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Qh(e);let s=Un(1);t&&(r?Ve(r)&&(s=vi(r)):s=vi(e));const a=XF(i,n,r)?yC(i):Un(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const d=Bt(i),h=r&&Ve(r)?Bt(r):r;let g=d,p=sf(g);for(;p&&r&&h!==g;){const m=vi(p),x=p.getBoundingClientRect(),y=cn(p),v=x.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,b=x.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,f*=m.y,l+=v,c+=b,g=Bt(p),p=sf(g)}}return Nl({width:u,height:f,x:l,y:c})}function lc(e,t){const n=ac(e).scrollLeft;return t?t.left+n:Ao(qn(e)).left+n}function vC(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-lc(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function ZF(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=qn(r),a=t?ic(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Un(1);const u=Un(0),f=Pt(r);if((f||!f&&!i)&&((ji(r)!=="body"||ta(s))&&(l=ac(r)),Pt(r))){const h=Ao(r);c=vi(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!i?vC(s,l):Un(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function JF(e){return Array.from(e.getClientRects())}function QF(e){const t=qn(e),n=ac(e),r=e.ownerDocument.body,o=Ut(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ut(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+lc(e);const a=-n.scrollTop;return cn(r).direction==="rtl"&&(s+=Ut(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const jv=25;function eL(e,t){const n=Bt(e),r=qn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=sc();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=lc(r);if(c<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=jv&&(i-=g)}else c<=jv&&(i+=c);return{width:i,height:s,x:a,y:l}}const tL=new Set(["absolute","fixed"]);function nL(e,t){const n=Ao(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Pt(e)?vi(e):Un(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Bv(e,t,n){let r;if(t==="viewport")r=eL(e,n);else if(t==="document")r=QF(qn(e));else if(Ve(t))r=nL(t,n);else{const o=yC(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Nl(r)}function xC(e,t){const n=yr(e);return n===t||!Ve(n)||fr(n)?!1:cn(n).position==="fixed"||xC(n,t)}function rL(e,t){const n=t.get(e);if(n)return n;let r=Fr(e,[],!1).filter(a=>Ve(a)&&ji(a)!=="body"),o=null;const i=cn(e).position==="fixed";let s=i?yr(e):e;for(;Ve(s)&&!fr(s);){const a=cn(s),l=Yh(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&tL.has(o.position)||ta(s)&&!l&&xC(e,s))?r=r.filter(u=>u!==s):o=a,s=yr(s)}return t.set(e,r),r}function oL(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?ic(t)?[]:rL(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=Bv(t,u,o);return c.top=Ut(f.top,c.top),c.right=zr(f.right,c.right),c.bottom=zr(f.bottom,c.bottom),c.left=Ut(f.left,c.left),c},Bv(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function iL(e){const{width:t,height:n}=mC(e);return{width:t,height:n}}function sL(e,t,n){const r=Pt(t),o=qn(t),i=n==="fixed",s=Ao(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Un(0);function c(){l.x=lc(o)}if(r||!r&&!i)if((ji(t)!=="body"||ta(o))&&(a=ac(t)),r){const h=Ao(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?vC(o,a):Un(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function _u(e){return cn(e).position==="static"}function zv(e,t){if(!Pt(e)||cn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return qn(e)===n&&(n=n.ownerDocument.body),n}function bC(e,t){const n=Bt(e);if(ic(e))return n;if(!Pt(e)){let o=yr(e);for(;o&&!fr(o);){if(Ve(o)&&!_u(o))return o;o=yr(o)}return n}let r=zv(e,t);for(;r&&cF(r)&&_u(r);)r=zv(r,t);return r&&fr(r)&&_u(r)&&!Yh(r)?n:r||gF(e)||n}const aL=async function(e){const t=this.getOffsetParent||bC,n=this.getDimensions,r=await n(e.floating);return{reference:sL(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lL(e){return cn(e).direction==="rtl"}const cL={convertOffsetParentRelativeRectToViewportRelativeRect:ZF,getDocumentElement:qn,getClippingRect:oL,getOffsetParent:bC,getElementRects:aL,getClientRects:JF,getDimensions:iL,getScale:vi,isElement:Ve,isRTL:lL};function wC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uL(e,t){let n=null,r;const o=qn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=c;if(a||t(),!d||!h)return;const g=Na(f),p=Na(o.clientWidth-(u+d)),m=Na(o.clientHeight-(f+h)),x=Na(u),v={rootMargin:-g+"px "+-p+"px "+-m+"px "+-x+"px",threshold:Ut(0,zr(1,l))||1};let b=!0;function w(_){const E=_[0].intersectionRatio;if(E!==l){if(!b)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!wC(c,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(w,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,v)}n.observe(e)}return s(!0),i}function eg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Qh(e),u=o||i?[...c?Fr(c):[],...Fr(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=c&&a?uL(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(x=>{let[y]=x;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,p=l?Ao(e):null;l&&m();function m(){const x=Ao(e);p&&!wC(p,x)&&n(),p=x,g=requestAnimationFrame(m)}return n(),()=>{var x;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const dL=UF,fL=GF,hL=HF,gL=qF,Hv=zF,pL=(e,t,n)=>{const r=new Map,o={platform:cL,...n},i={...o.platform,_c:r};return BF(e,t,{...o,platform:i})};var mL=typeof document<"u",yL=function(){},Za=mL?S.useLayoutEffect:yL;function Pl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Pl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Pl(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function CC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wv(e,t){const n=CC(e);return Math.round(t*n)/n}function Tu(e){const t=M.useRef(e);return Za(()=>{t.current=e}),t}function vL(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=M.useState(r);Pl(d,r)||h(r);const[g,p]=M.useState(null),[m,x]=M.useState(null),y=M.useCallback(N=>{N!==_.current&&(_.current=N,p(N))},[]),v=M.useCallback(N=>{N!==E.current&&(E.current=N,x(N))},[]),b=i||g,w=s||m,_=M.useRef(null),E=M.useRef(null),T=M.useRef(u),k=l!=null,P=Tu(l),O=Tu(o),D=Tu(c),I=M.useCallback(()=>{if(!_.current||!E.current)return;const N={placement:t,strategy:n,middleware:d};O.current&&(N.platform=O.current),pL(_.current,E.current,N).then(j=>{const K={...j,isPositioned:D.current!==!1};$.current&&!Pl(T.current,K)&&(T.current=K,p_.flushSync(()=>{f(K)}))})},[d,t,n,O,D]);Za(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[c]);const $=M.useRef(!1);Za(()=>($.current=!0,()=>{$.current=!1}),[]),Za(()=>{if(b&&(_.current=b),w&&(E.current=w),b&&w){if(P.current)return P.current(b,w,I);I()}},[b,w,I,P,k]);const H=M.useMemo(()=>({reference:_,floating:E,setReference:y,setFloating:v}),[y,v]),U=M.useMemo(()=>({reference:b,floating:w}),[b,w]),F=M.useMemo(()=>{const N={position:n,left:0,top:0};if(!U.floating)return N;const j=Wv(U.floating,u.x),K=Wv(U.floating,u.y);return a?{...N,transform:"translate("+j+"px, "+K+"px)",...CC(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:K}},[n,a,U.floating,u.x,u.y]);return M.useMemo(()=>({...u,update:I,refs:H,elements:U,floatingStyles:F}),[u,I,H,U,F])}const xL=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Hv({element:r.current,padding:o}).fn(n):{}:r?Hv({element:r,padding:o}).fn(n):{}}}},tg=(e,t)=>({...dL(e),options:[e,t]}),ng=(e,t)=>({...fL(e),options:[e,t]}),rg=(e,t)=>({...hL(e),options:[e,t]}),bL=(e,t)=>({...gL(e),options:[e,t]}),wL=(e,t)=>({...xL(e),options:[e,t]});function SC(e){const t=M.useRef(void 0),n=M.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i?.())}},e);return M.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const CL="data-floating-ui-focusable",Kv="active",Uv="selected",SL={...M};let Gv=!1,_L=0;const qv=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+_L++;function TL(){const[e,t]=M.useState(()=>Gv?qv():void 0);return ki(()=>{e==null&&t(qv())},[]),M.useEffect(()=>{Gv=!0},[]),e}const EL=SL.useId,_C=EL||TL;let cf;process.env.NODE_ENV!=="production"&&(cf=new Set);function RL(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=cf)!=null&&e.has(o))){var i;(i=cf)==null||i.add(o),console.error(o)}}function kL(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const AL=M.createContext(null),ML=M.createContext(null),og=()=>{var e;return((e=M.useContext(AL))==null?void 0:e.id)||null},ig=()=>M.useContext(ML);function sg(e){return"data-floating-ui-"+e}function nn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Yv=sg("safe-polygon");function Eu(e,t,n){if(n&&!Os(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function Ru(e){return typeof e=="function"?e():e}function TC(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,h=ig(),g=og(),p=Pa(c),m=Pa(l),x=Pa(n),y=Pa(f),v=M.useRef(),b=M.useRef(-1),w=M.useRef(),_=M.useRef(-1),E=M.useRef(!0),T=M.useRef(!1),k=M.useRef(()=>{}),P=M.useRef(!1),O=On(()=>{var F;const N=(F=o.current.openEvent)==null?void 0:F.type;return N?.includes("mouse")&&N!=="mousedown"});M.useEffect(()=>{if(!a)return;function F(N){let{open:j}=N;j||(nn(b),nn(_),E.current=!0,P.current=!1)}return i.on("openchange",F),()=>{i.off("openchange",F)}},[a,i]),M.useEffect(()=>{if(!a||!p.current||!n)return;function F(j){O()&&r(!1,j,"hover")}const N=uo(s.floating).documentElement;return N.addEventListener("mouseleave",F),()=>{N.removeEventListener("mouseleave",F)}},[s.floating,n,r,a,p,O]);const D=M.useCallback(function(F,N,j){N===void 0&&(N=!0),j===void 0&&(j="hover");const K=Eu(m.current,"close",v.current);K&&!w.current?(nn(b),b.current=window.setTimeout(()=>r(!1,F,j),K)):N&&(nn(b),r(!1,F,j))},[m,r]),I=On(()=>{k.current(),w.current=void 0}),$=On(()=>{if(T.current){const F=uo(s.floating).body;F.style.pointerEvents="",F.removeAttribute(Yv),T.current=!1}}),H=On(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);M.useEffect(()=>{if(!a)return;function F(J){if(nn(b),E.current=!1,u&&!Os(v.current)||Ru(y.current)>0&&!Eu(m.current,"open"))return;const Z=Eu(m.current,"open",v.current);Z?b.current=window.setTimeout(()=>{x.current||r(!0,J,"hover")},Z):n||r(!0,J,"hover")}function N(J){if(H()){$();return}k.current();const Z=uo(s.floating);if(nn(_),P.current=!1,p.current&&o.current.floatingContext){n||nn(b),w.current=p.current({...o.current.floatingContext,tree:h,x:J.clientX,y:J.clientY,onClose(){$(),I(),H()||D(J,!0,"safe-polygon")}});const oe=w.current;Z.addEventListener("mousemove",oe),k.current=()=>{Z.removeEventListener("mousemove",oe)};return}(v.current!=="touch"||!$s(s.floating,J.relatedTarget))&&D(J)}function j(J){H()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:h,x:J.clientX,y:J.clientY,onClose(){$(),I(),H()||D(J)}})(J))}function K(){nn(b)}function te(J){H()||D(J,!1)}if(Ve(s.domReference)){const J=s.domReference,Z=s.floating;return n&&J.addEventListener("mouseleave",j),d&&J.addEventListener("mousemove",F,{once:!0}),J.addEventListener("mouseenter",F),J.addEventListener("mouseleave",N),Z&&(Z.addEventListener("mouseleave",j),Z.addEventListener("mouseenter",K),Z.addEventListener("mouseleave",te)),()=>{n&&J.removeEventListener("mouseleave",j),d&&J.removeEventListener("mousemove",F),J.removeEventListener("mouseenter",F),J.removeEventListener("mouseleave",N),Z&&(Z.removeEventListener("mouseleave",j),Z.removeEventListener("mouseenter",K),Z.removeEventListener("mouseleave",te))}}},[s,a,e,u,d,D,I,$,r,n,x,h,m,p,o,H,y]),ki(()=>{var F;if(a&&n&&(F=p.current)!=null&&(F=F.__options)!=null&&F.blockPointerEvents&&O()){T.current=!0;const j=s.floating;if(Ve(s.domReference)&&j){var N;const K=uo(s.floating).body;K.setAttribute(Yv,"");const te=s.domReference,J=h==null||(N=h.nodesRef.current.find(Z=>Z.id===g))==null||(N=N.context)==null?void 0:N.elements.floating;return J&&(J.style.pointerEvents=""),K.style.pointerEvents="none",te.style.pointerEvents="auto",j.style.pointerEvents="auto",()=>{K.style.pointerEvents="",te.style.pointerEvents="",j.style.pointerEvents=""}}}},[a,n,g,s,h,p,O]),ki(()=>{n||(v.current=void 0,P.current=!1,I(),$())},[n,I,$]),M.useEffect(()=>()=>{I(),nn(b),nn(_),$()},[a,s.domReference,I,$]);const U=M.useMemo(()=>{function F(N){v.current=N.pointerType}return{onPointerDown:F,onPointerEnter:F,onMouseMove(N){const{nativeEvent:j}=N;function K(){!E.current&&!x.current&&r(!0,j,"hover")}u&&!Os(v.current)||n||Ru(y.current)===0||P.current&&N.movementX**2+N.movementY**2<2||(nn(_),v.current==="touch"?K():(P.current=!0,_.current=window.setTimeout(K,Ru(y.current))))}}},[u,r,n,x,y]);return M.useMemo(()=>a?{reference:U}:{},[a,U])}function Xv(e){return Pt(e.target)&&e.target.tagName==="BUTTON"}function NL(e){return Pt(e.target)&&e.target.tagName==="A"}function Zv(e){return pC(e)}function PL(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=M.useRef(),h=M.useRef(!1),g=M.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(Os(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}Os(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||Xv(p))&&(p.key===" "&&!Zv(i)&&(p.preventDefault(),h.current=!0),!NL(p)&&p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||Xv(p)||Zv(i)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,i,a,c,u,r,n,f,l]);return M.useMemo(()=>s?{reference:g}:{},[s,g])}const FL={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},LL={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Jv=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function EC(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:h,capture:g}=t,p=ig(),m=On(typeof l=="function"?l:()=>!1),x=typeof l=="function"?m:l,y=M.useRef(!1),{escapeKey:v,outsidePress:b}=Jv(h),{escapeKey:w,outsidePress:_}=Jv(g),E=M.useRef(!1),T=On($=>{var H;if(!n||!s||!a||$.key!=="Escape"||E.current)return;const U=(H=i.current.floatingContext)==null?void 0:H.nodeId,F=p?Xa(p.nodesRef.current,U):[];if(!v&&($.stopPropagation(),F.length>0)){let N=!0;if(F.forEach(j=>{var K;if((K=j.context)!=null&&K.open&&!j.context.dataRef.current.__escapeKeyBubbles){N=!1;return}}),!N)return}r(!1,$F($)?$.nativeEvent:$,"escape-key")}),k=On($=>{var H;const U=()=>{var F;T($),(F=ei($))==null||F.removeEventListener("keydown",U)};(H=ei($))==null||H.addEventListener("keydown",U)}),P=On($=>{var H;const U=i.current.insideReactTree;i.current.insideReactTree=!1;const F=y.current;if(y.current=!1,c==="click"&&F||U||typeof x=="function"&&!x($))return;const N=ei($),j="["+sg("inert")+"]",K=uo(o.floating).querySelectorAll(j);let te=Ve(N)?N:null;for(;te&&!fr(te);){const oe=yr(te);if(fr(oe)||!Ve(oe))break;te=oe}if(K.length&&Ve(N)&&!PF(N)&&!$s(N,o.floating)&&Array.from(K).every(oe=>!$s(te,oe)))return;if(Pt(N)&&I){const oe=fr(N),fe=cn(N),_e=/auto|scroll/,ne=oe||_e.test(fe.overflowX),ye=oe||_e.test(fe.overflowY),Te=ne&&N.clientWidth>0&&N.scrollWidth>N.clientWidth,De=ye&&N.clientHeight>0&&N.scrollHeight>N.clientHeight,st=fe.direction==="rtl",ee=De&&(st?$.offsetX<=N.offsetWidth-N.clientWidth:$.offsetX>N.clientWidth),we=Te&&$.offsetY>N.clientHeight;if(ee||we)return}const J=(H=i.current.floatingContext)==null?void 0:H.nodeId,Z=p&&Xa(p.nodesRef.current,J).some(oe=>{var fe;return Su($,(fe=oe.context)==null?void 0:fe.elements.floating)});if(Su($,o.floating)||Su($,o.domReference)||Z)return;const se=p?Xa(p.nodesRef.current,J):[];if(se.length>0){let oe=!0;if(se.forEach(fe=>{var _e;if((_e=fe.context)!=null&&_e.open&&!fe.context.dataRef.current.__outsidePressBubbles){oe=!1;return}}),!oe)return}r(!1,$,"outside-press")}),O=On($=>{var H;const U=()=>{var F;P($),(F=ei($))==null||F.removeEventListener(c,U)};(H=ei($))==null||H.addEventListener(c,U)});M.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=v,i.current.__outsidePressBubbles=b;let $=-1;function H(K){r(!1,K,"ancestor-scroll")}function U(){window.clearTimeout($),E.current=!0}function F(){$=window.setTimeout(()=>{E.current=!1},sc()?5:0)}const N=uo(o.floating);a&&(N.addEventListener("keydown",w?k:T,w),N.addEventListener("compositionstart",U),N.addEventListener("compositionend",F)),x&&N.addEventListener(c,_?O:P,_);let j=[];return d&&(Ve(o.domReference)&&(j=Fr(o.domReference)),Ve(o.floating)&&(j=j.concat(Fr(o.floating))),!Ve(o.reference)&&o.reference&&o.reference.contextElement&&(j=j.concat(Fr(o.reference.contextElement)))),j=j.filter(K=>{var te;return K!==((te=N.defaultView)==null?void 0:te.visualViewport)}),j.forEach(K=>{K.addEventListener("scroll",H,{passive:!0})}),()=>{a&&(N.removeEventListener("keydown",w?k:T,w),N.removeEventListener("compositionstart",U),N.removeEventListener("compositionend",F)),x&&N.removeEventListener(c,_?O:P,_),j.forEach(K=>{K.removeEventListener("scroll",H)}),window.clearTimeout($)}},[i,o,a,x,c,n,r,d,s,v,b,T,w,k,P,_,O]),M.useEffect(()=>{i.current.insideReactTree=!1},[i,x,c]);const D=M.useMemo(()=>({onKeyDown:T,...u&&{[FL[f]]:$=>{r(!1,$.nativeEvent,"reference-press")},...f!=="click"&&{onClick($){r(!1,$.nativeEvent,"reference-press")}}}}),[T,r,u,f]),I=M.useMemo(()=>({onKeyDown:T,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[LL[c]]:()=>{i.current.insideReactTree=!0}}),[T,c,i]);return M.useMemo(()=>s?{reference:D,floating:I}:{},[s,D,I])}function $L(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=_C(),i=M.useRef({}),[s]=M.useState(()=>kL()),a=og()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!Ve(h)&&RL("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=M.useState(r.reference),u=On((h,g,p)=>{i.current.openEvent=h?g:void 0,s.emit("openchange",{open:h,event:g,reason:p,nested:a}),n?.(h,g,p)}),f=M.useMemo(()=>({setPositionReference:c}),[]),d=M.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return M.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:o,refs:f}),[t,u,d,s,o,f])}function ag(e){e===void 0&&(e={});const{nodeId:t}=e,n=$L({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=M.useState(null),[a,l]=M.useState(null),u=o?.domReference||i,f=M.useRef(null),d=ig();ki(()=>{u&&(f.current=u)},[u]);const h=vL({...e,elements:{...o,...a&&{reference:a}}}),g=M.useCallback(v=>{const b=Ve(v)?{getBoundingClientRect:()=>v.getBoundingClientRect(),getClientRects:()=>v.getClientRects(),contextElement:v}:v;l(b),h.refs.setReference(b)},[h.refs]),p=M.useCallback(v=>{(Ve(v)||v===null)&&(f.current=v,s(v)),(Ve(h.refs.reference.current)||h.refs.reference.current===null||v!==null&&!Ve(v))&&h.refs.setReference(v)},[h.refs]),m=M.useMemo(()=>({...h.refs,setReference:p,setPositionReference:g,domReference:f}),[h.refs,p,g]),x=M.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),y=M.useMemo(()=>({...h,...r,refs:m,elements:x,nodeId:t}),[h,m,x,t,r]);return ki(()=>{r.dataRef.current.floatingContext=y;const v=d?.nodesRef.current.find(b=>b.id===t);v&&(v.context=y)}),M.useMemo(()=>({...h,context:y,refs:m,elements:x}),[h,m,x,y])}function ku(){return AF()&&kF()}function OL(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=M.useRef(!1),u=M.useRef(-1),f=M.useRef(!0);M.useEffect(()=>{if(!a)return;const h=Bt(s.domReference);function g(){!n&&Pt(s.domReference)&&s.domReference===Dv(uo(s.domReference))&&(c.current=!0)}function p(){f.current=!0}function m(){f.current=!1}return h.addEventListener("blur",g),ku()&&(h.addEventListener("keydown",p,!0),h.addEventListener("pointerdown",m,!0)),()=>{h.removeEventListener("blur",g),ku()&&(h.removeEventListener("keydown",p,!0),h.removeEventListener("pointerdown",m,!0))}},[s.domReference,n,a]),M.useEffect(()=>{if(!a)return;function h(g){let{reason:p}=g;(p==="reference-press"||p==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),M.useEffect(()=>()=>{nn(u)},[]);const d=M.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const g=ei(h.nativeEvent);if(l&&Ve(g)){if(ku()&&!h.relatedTarget){if(!f.current&&!pC(g))return}else if(!FF(g))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const g=h.relatedTarget,p=h.nativeEvent,m=Ve(g)&&g.hasAttribute(sg("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var x;const y=Dv(s.domReference?s.domReference.ownerDocument:document);!g&&y===s.domReference||$s((x=i.current.floatingContext)==null?void 0:x.refs.floating.current,y)||$s(s.domReference,y)||m||r(!1,p,"focus")})}}),[i,s.domReference,r,l]);return M.useMemo(()=>a?{reference:d}:{},[a,d])}function Au(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Kv]:s,[Uv]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[CL]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[Kv,Uv].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var d,h=arguments.length,g=new Array(h),p=0;p<h;p++)g[p]=arguments[p];return(d=r.get(c))==null?void 0:d.map(m=>m(...g)).find(m=>m!==void 0)}}}else s[c]=u}),s),{})}}function RC(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=M.useCallback(a=>Au(a,e,"reference"),t),i=M.useCallback(a=>Au(a,e,"floating"),n),s=M.useCallback(a=>Au(a,e,"item"),r);return M.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const IL=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function kC(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=_C(),u=((n=i.domReference)==null?void 0:n.id)||c,f=M.useMemo(()=>{var y;return((y=LF(i.floating))==null?void 0:y.id)||s},[i.floating,s]),d=(r=IL.get(l))!=null?r:l,g=og()!=null,p=M.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:u},...d==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,g,o,u,l]),m=M.useMemo(()=>{const y={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?y:{...y,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,l]),x=M.useCallback(y=>{let{active:v,selected:b}=y;const w={role:"option",...v&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...w,"aria-selected":b}}return{}},[f,l]);return M.useMemo(()=>a?{reference:p,floating:m,item:x}:{},[a,p,m,x])}const DL=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M6 9L12 15L18 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),VL=e=>M.createElement("svg",{fill:"currentColor",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 462.035 462.035",xmlSpace:"preserve",...e},M.createElement("g",null,M.createElement("path",{d:"M457.83,158.441c-0.021-0.028-0.033-0.058-0.057-0.087l-50.184-62.48c-0.564-0.701-1.201-1.305-1.879-1.845 c-2.16-2.562-5.355-4.225-8.967-4.225H65.292c-3.615,0-6.804,1.661-8.965,4.225c-0.678,0.54-1.316,1.138-1.885,1.845l-50.178,62.48 c-0.023,0.029-0.034,0.059-0.057,0.087C1.655,160.602,0,163.787,0,167.39v193.07c0,6.5,5.27,11.771,11.77,11.771h438.496 c6.5,0,11.77-5.271,11.77-11.771V167.39C462.037,163.787,460.381,160.602,457.83,158.441z M408.516,134.615l16.873,21.005h-16.873 V134.615z M384.975,113.345v42.274H296.84c-2.514,0-4.955,0.805-6.979,2.293l-58.837,43.299l-58.849-43.305 c-2.023-1.482-4.466-2.287-6.978-2.287H77.061v-42.274H384.975z M53.523,155.62H36.65l16.873-21.005V155.62z M438.498,348.69H23.54 V179.16h137.796l62.711,46.148c4.15,3.046,9.805,3.052,13.954-0.005l62.698-46.144h137.799V348.69L438.498,348.69z"}))),AC=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{opacity:.6},M.createElement("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))),{color:Qt,cornerRadius:jL,spacing:ti}=V,Mu={sm:{h:28,p:`${ti.xs} ${ti.sm}`,text:"body-2"},md:{h:32,p:`6px ${ti.md}`,text:"body-2"},lg:{h:40,p:`${ti.sm} ${ti.lg}`,text:"body-1"}},lg=S.forwardRef(({label:e,color:t="primary",size:n="md",onClick:r,onDelete:o,avatar:i,icon:s,disabled:a,className:l},c)=>{const u=S.useRef(null),f=S.useMemo(()=>{switch(t){case"primary":return{bg:Qt.status.neutralTintLow,color:Qt.text.primary};case"accent":return{bg:Qt.status.accentTintLow,color:Qt.text.accent};case"warning":return{bg:Qt.status.warningTintLow,color:Qt.text.warning};case"positive":return{bg:Qt.status.positiveTintLow,color:Qt.text.positive};case"negative":return{bg:Qt.status.negativeTintLow,color:Qt.text.negative};case"transfer":return{bg:"var(--status-transfer-tint-low)",color:"var(--text-transfer)"};default:return{bg:Qt.status.neutralTintLow,color:Qt.text.primary}}},[t]),d=R.css({cursor:a?"not-allowed":r?"pointer":"default",opacity:a?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s","&:hover":a?void 0:{backgroundColor:f.bg}}),h=R.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}});return C.jsxs(G,{ref:g=>{u.current=g,typeof c=="function"?c(g):c&&(c.current=g)},row:!0,alignItems:"center",justifyContent:"center",gap:ti.sm,h:Mu[n].h,p:Mu[n].p,overflow:"hidden",borderRadius:jL.sm,backgroundColor:f.bg,color:f.color,onClick:r,className:R.cx(d,l),children:[r&&C.jsx(No,{}),i&&C.jsx(G,{w:20,h:20,borderRadius:"50%",overflow:"hidden",children:i}),s&&C.jsx(G,{children:s}),typeof e=="string"?C.jsx(ae,{variant:Mu[n].text,colorName:t,textOverflow:"ellipsis",overflow:"hidden",children:e}):e,o&&!a&&C.jsx(ae,{className:h,colorName:t,onClick:g=>{g.stopPropagation(),o(g)},children:C.jsx(AC,{})})]})});lg.displayName="Tag";const{color:Et,cornerRadius:rs}=V,Qv=R.css({borderColor:Et.border.negativePrimary}),Nu=R.css({cursor:"not-allowed",opacity:.5}),MC=R.css({display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",color:"#9ca3af","& svg":{width:20,height:20,transition:"transform 0.2s ease-in"}}),BL=R.css({[`& .${MC} svg`]:{transform:"rotateX(180deg)"}}),ct={"select-container":R.css({position:"relative",display:"inline-block",minWidth:120,"&.full-width":{width:"100%"}}),"full-width":R.css({width:"100%"}),"select-input":R.css({border:`1px solid ${Et.border.neutralAlphaBasic}`,borderRadius:rs.md,cursor:"pointer",transition:"all 0.2s ease-in-out",boxSizing:"border-box",[`&:hover:not(.${Nu})`]:{borderColor:Et.border.neutralAlphaHigh,backgroundColor:Et.fill.neutralPrimaryHover},[`&:focus:not(.${Nu})`]:{outline:"none",borderColor:Et.border.accentPrimary},[`&.${Qv}:focus`]:{boxShadow:`0 0 0 3px ${Et.effect.shadowS}`}}),"size-xs":R.css({minHeight:32,padding:"8px 8px 8px 12px",borderRadius:rs.sm}),"size-sm":R.css({minHeight:40,padding:"10px 12px 10px 16px",borderRadius:rs.sm}),"size-md":R.css({minHeight:48,padding:"14px 12px 14px 16px",borderRadius:rs.md}),"background-primary":R.css({backgroundColor:Et.fill.bgPrimary}),"background-secondary":R.css({backgroundColor:Et.fill.bgSecondary}),error:Qv,disabled:Nu,open:BL,"select-value":R.css({flex:1,color:Et.text.primary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",alignSelf:"center",...Fe.common,...Fe.body2}),"select-value_xs":R.css({...Fe.common,...Fe.caption1}),hidden:R.css({visibility:"hidden"}),visible:R.css({visibility:"visible"}),"select-arrow":MC,"select-dropdown":R.css({marginTop:4,backgroundColor:Et.fill.bgPrimary,borderRadius:rs.md,boxShadow:`0 4px 20px 0 ${Et.effect.shadowS}`,maxHeight:224,overflow:"hidden"}),"select-menu":R.css({maxHeight:224,overflowY:"auto",padding:"4px 0","&::-webkit-scrollbar":{width:3},"&::-webkit-scrollbar-track":{background:"#f1f1f1"},"&::-webkit-scrollbar-thumb":{background:"#c1c1c1",borderRadius:3,"&:hover":{background:Et.fill.neutralSecondary}}}),"select-menu-item":R.css({cursor:"pointer",transition:"background-color 0.15s ease-in-out",color:Et.text.primary,padding:10,overflow:"hidden",textOverflow:"ellipsis","&:hover":{backgroundColor:Et.fill.neutralSecondaryHover}}),"select-menu-item-first":R.css({"&:hover":{cursor:"auto",backgroundColor:"inherit"}}),selected:R.css({backgroundColor:Et.fill.neutralSecondary}),"overflow-tooltip-container":R.css({width:"100%",position:"relative"}),"overflow-tooltip-text":R.css({width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),"empty-block":R.css({textAlign:"center",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:14})},zL={xs:R.css({width:16,height:16,"& svg":{width:16,height:16,transition:"transform 0.2s ease-in"}}),sm:R.css({}),md:R.css({})};function cg({value:e,onChange:t,multiple:n=!1,returnedValue:r,renderItem:o,renderInputItem:i,renderSingleInputItem:s,renderMultipleInputItem:a,renderDropdownItem:l,placeholder:c,items:u=[],fullWidth:f,size:d="md",showDefaultItem:h,disabled:g,label:p,firstItem:m,lastItem:x,observer:y,emptyText:v,onBlur:b,prompt:w,error:_,errorText:E,dropdownMaxWidth:T=400,dropdownMinWidth:k=120,minWidth:P=120,width:O,background:D="secondary",dropdownClassName:I}){const[$,H]=Mo(e,n?[]:null),[U,F]=S.useState(!1),{refs:N,floatingStyles:j}=ag({open:U,strategy:"fixed",middleware:[tg(4),rg({crossAxis:!0,fallbackAxisSideDirection:"start"}),ng({crossAxis:!0,padding:8}),bL({apply({availableHeight:ee,availableWidth:we,elements:ze,rects:Ee}){const mt=Math.min(typeof we=="number"?we-64:T,T),Lt=Ee.reference.width,Yt=Math.max(Lt,k);Object.assign(ze.floating.style,{maxHeight:typeof ee=="number"?`${ee}px`:"auto",maxWidth:`${mt}px`,minWidth:`${Yt}px`,width:"max-content"})}})],whileElementsMounted:eg}),K=S.useMemo(()=>n?$||[]:$!=null?[$]:[],[$,n]),te=S.useCallback(ee=>r?r(ee):ee,[r]),J=S.useMemo(()=>{const ee=new Map;return u.forEach(we=>{ee.set(te(we),we)}),ee},[u,te]),Z=!u.length&&!_,se=S.useMemo(()=>K.map(ee=>J.get(ee)).filter(ee=>!!ee),[J,K]);S.useEffect(()=>{process.env.NODE_ENV!=="production"&&o&&!l&&console.warn("[Select] `renderItem` deprecated, use `renderDropdownItem` instead.")},[l,o]);const oe=S.useCallback((ee,we)=>l?l(ee,we):o?o(ee):String(ee),[l,o]),fe=()=>{F(!1),b?.()},_e=ee=>{const we=te(ee);if(n){const ze=K.includes(we)?K.filter(Ee=>Ee!==we):[...K,we];H(ze),t?.(ze)}else H(we),t?.(we),fe()},ne=ee=>{if(!n)return;const we=K.filter(ze=>ze!==ee);H(we),t?.(we)},ye=()=>{const ee=n?[]:null;H(ee),t?.(ee),n||fe()},Te=()=>typeof c=="string"?C.jsx(ae,{variant:d==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",colorName:"tertiary",children:c??"Select..."}):c,De=()=>{if(!K.length)return Te();if(n)return a?a(se):i?i({mode:"multiple",selectedItems:se}):C.jsx(G,{flexWrap:"wrap",row:!0,gap:10,children:K.map(ze=>{const Ee=J.get(ze);return Ee?C.jsx(lg,{size:"sm",label:o?o(Ee):String(ze),onDelete:mt=>{mt.stopPropagation(),ne(ze)}},ze):null})});const ee=J.get(K[0])??null;if(!ee)return Te();if(s)return s(ee);if(i)return i({mode:"single",selectedItem:ee});const we=o?o(ee):String(K[0]);return typeof we=="string"?C.jsx(ae,{variant:d==="xs"?"caption-1":"body-2",tag:"p",textOverflow:"ellipsis",overflow:"hidden",children:we}):C.jsx(C.Fragment,{children:we})},st=U&&C.jsx(Hi,{children:C.jsx(G,{row:!0,top:0,right:0,bottom:0,left:0,position:"fixed",center:!0,flex:1,onClick:fe,display:"block",backgroundColor:"transparent",zIndex:1,children:C.jsx(zs.div,{ref:N.setFloating,className:R.cx(ct["select-dropdown"],I),initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{...j,zIndex:1},onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:C.jsxs("ul",{className:ct["select-menu"],children:[h&&!n&&C.jsx(G,{className:ct["select-menu-item"],role:"option",onClick:ye,children:C.jsx(ae,{variant:"body-2",colorName:"tertiary",children:c})}),m&&C.jsx(G,{className:R.cx(ct["select-menu-item"],ct["select-menu-item-first"]),children:m}),Z&&C.jsxs(G,{className:ct["empty-block"],children:[C.jsx(G,{w:20,h:20,children:C.jsx(VL,{})}),C.jsx(ae,{variant:"body-2",children:v??"There is nothing yet"})]}),u.map((ee,we)=>{const ze=te(ee),Ee=K.includes(ze),mt=oe(ee,{item:ee,selected:Ee,index:we}),Lt=typeof mt=="string";return C.jsxs(G,{row:!0,gap:10,alignItems:"center",className:R.cx(ct["select-menu-item"],{[ct.selected]:Ee}),role:"option",relative:!0,onClick:()=>_e(ee),children:[n&&C.jsx(eh,{size:"sm",checked:Ee}),Lt?C.jsx(ae,{variant:"body-2",tag:"p",wordBreak:"break-all",whiteSpace:"break-spaces",children:mt}):mt,C.jsx(No,{})]},ze)}),y,x&&C.jsx(G,{className:R.cx(ct["select-menu-item"],ct["select-menu-item-first"]),children:x})]})},"dropdown")})});return C.jsxs(G,{relative:!0,display:"inline-block",minWidth:P,w:O||(f?"full":"auto"),onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:[typeof p=="string"?C.jsx(ae,{variant:"body-2",colorName:"tertiary",fontWeight:"regular",mb:d==="sm"?4:8,children:p}):p,C.jsxs(G,{ref:N.setReference,row:!0,gap:10,tabIndex:g?-1:0,role:"button",alignItems:"flex-start","aria-haspopup":"listbox",relative:!0,w:"100%",className:R.cx(ct["select-input"],ct[`size-${d}`],ct[`background-${D}`],{[ct.error]:_,[ct.disabled]:g,[ct.open]:U}),onClick:()=>!g&&F(ee=>!ee),children:[C.jsx(G,{className:R.cx(ct["select-value"]),children:De()}),C.jsx(G,{className:R.cx(ct["select-arrow"],zL[d]),children:C.jsx(DL,{})})]}),typeof w=="string"?C.jsx(ae,{variant:"caption-1",colorName:"tertiary",mt:4,children:w}):w,_&&E&&C.jsx(ae,{tag:"p",colorName:"negative",variant:"body-2",mt:5,children:E}),C.jsx(kx,{children:st})]})}const HL=e=>M.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M3.94629 0.220237C3.78013 0.264025 3.64089 0.377624 3.56348 0.53176C3.27371 1.11189 3.05664 1.46395 2.83887 1.74953C2.61807 2.03873 2.38547 2.27579 2.03027 2.63039C1.21079 3.45057 0.799805 4.52619 0.799805 5.60012C0.799838 6.67406 1.21073 7.74968 2.03027 8.56985C3.67062 10.2096 6.32931 10.2095 7.96973 8.56985C8.78929 7.74968 9.20016 6.67408 9.2002 5.60012C9.15131 4.32908 8.43217 3.48543 7.94727 3.05813C7.76902 2.90106 7.40643 3.02424 7.2627 3.2134C7.24031 3.24286 7.21612 3.2739 7.18945 3.30617C6.93211 3.61754 6.56236 3.80807 6.41504 3.83156C6.38264 3.83667 6.36979 3.76513 6.2959 3.58254C5.79455 2.34427 5.78927 2.49365 5.58887 2.01125C5.48847 1.7692 5.05517 1.02727 4.92676 0.828635C4.80206 0.635591 4.64095 0.439873 4.43359 0.301292C4.29028 0.205951 4.1124 0.175957 3.94629 0.220237ZM4.75293 4.17824C5.2689 4.63997 5.60857 5.26651 5.71484 5.95071C6.10631 5.85571 6.46727 5.68318 6.78125 5.45071C6.86578 5.70826 6.89338 5.98123 6.8623 6.25051C6.83115 6.51993 6.74174 6.77966 6.60059 7.01125C6.45944 7.24281 6.27008 7.44117 6.04492 7.59231C5.81977 7.74344 5.56462 7.8443 5.29688 7.88723C5.0292 7.93013 4.75518 7.91446 4.49414 7.84133C4.23299 7.76812 3.99064 7.6383 3.78418 7.46242C3.5778 7.28657 3.41161 7.06792 3.29785 6.8218C3.18419 6.57572 3.12519 6.30771 3.125 6.03664C3.12508 5.58233 3.29054 5.14308 3.58984 4.80129C3.88917 4.4597 4.30271 4.2382 4.75293 4.17824Z",fill:"#FEAD34"})),WL=e=>M.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M10.1483 8.61509C10.3344 8.26159 9.98299 7.89856 9.58534 7.93723C9.42671 7.95265 9.25857 7.9605 9.07422 7.96035C6.36522 7.9582 4.17129 5.76427 4.16914 3.05527C4.169 2.87115 4.17682 2.70321 4.19221 2.54477C4.23082 2.14712 3.86769 1.79411 3.50976 1.97161C2.03398 2.70343 1.20002 4.02274 1.20002 5.89477C1.20002 8.60377 3.3961 10.7998 6.1051 10.7998C7.97571 10.7998 9.38737 10.06 10.1483 8.61509Z",fill:"white"})),{color:en,cornerRadius:e0,height:Pu,spacing:KL,transition:t0}=V,Pn={container:R.css({width:"100%",cursor:"pointer",outline:"none",userSelect:"none",display:"flex",justifyContent:"space-between",gap:KL.md,"&.disabled":{cursor:"not-allowed",opacity:.5},"&.reverse":{flexDirection:"row-reverse"}}),disabled:R.css({cursor:"not-allowed",opacity:.5}),reverse:R.css({flexDirection:"row-reverse"}),switchContainer:R.css({"--width-switch-sm":"34px","--width-switch-md":"40px","--width-switch-lg":"52px","--size-thumb-sm":"18px","--size-thumb-md":"20px","--size-thumb-lg":"28px","--thumb-translate":"0px","&:has(input:checked)":{"--thumb-translate":"calc(var(--switch-width) - var(--thumb-width) - 4px)"}}),variant_accent:R.css({"&:has(input:not(:checked))":{"--switch-bg-color":en.fill.bgTertiary,"--thumb-bg-color":en.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":en.fill.accentPrimary,"--thumb-bg-color":en.fill.bgPrimary}}),variant_secondary:R.css({"&:has(input:not(:checked))":{"--switch-bg-color":en.fill.bgTertiary,"--thumb-bg-color":en.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":en.fill.accentSecondary,"--thumb-bg-color":en.fill.accentPrimary}}),variant_theme:R.css({"&:has(input:not(:checked))":{"--switch-bg-color":en.fill.bgTertiary,"--thumb-bg-color":en.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":en.fill.bgSecondary,"--thumb-bg-color":en.fill.bgTertiary}}),size_sm:R.css({"--switch-width":"var(--width-switch-sm)","--switch-height":Pu.switch.sm,"--thumb-width":"var(--size-thumb-sm)","--thumb-height":"var(--size-thumb-sm)"}),size_md:R.css({"--switch-width":"var(--width-switch-md)","--switch-height":Pu.switch.md,"--thumb-width":"var(--size-thumb-md)","--thumb-height":"var(--size-thumb-md)"}),size_lg:R.css({"--switch-width":"var(--width-switch-lg)","--switch-height":Pu.switch.lg,"--thumb-width":"var(--size-thumb-lg)","--thumb-height":"var(--size-thumb-lg)"}),switch:R.css({width:"var(--switch-width)",height:"var(--switch-height)",transition:t0.general,display:"flex",alignItems:"center",padding:2,backgroundColor:"var(--switch-bg-color)",borderRadius:e0.xl}),thumb:R.css({display:"flex",alignItems:"center",justifyContent:"center",padding:4,transition:t0.general,transform:"translateX(var(--thumb-translate, 0))",width:"var(--thumb-width)",height:"var(--thumb-height)",backgroundColor:"var(--thumb-bg-color)",borderRadius:e0.fullRound}),moon:R.css({width:"100%",height:"100%"}),fire:R.css({width:"100%",height:"100%"})},{spacing:n0}=V,NC=S.forwardRef(({title:e,text:t,icon:n,disabled:r,onChange:o,checked:i,defaultValue:s,className:a,size:l="md",variant:c="accent",reverse:u=!1,w:f="auto",...d},h)=>{const[g,p]=Mo(i,s),m=S.useRef(null);S.useImperativeHandle(h,()=>({focus:()=>{m.current?.focus()},blur:()=>{m.current?.blur()},get checked(){return g??!1},setChecked:b=>{p(b),o?.(b)},toggle:()=>{const b=!g;p(b),o?.(b)},isFocused:()=>document.activeElement===m.current,isDisabled:()=>r??!1,getInputElement:()=>m.current,checkValidity:()=>m.current?.checkValidity()??!0,reset:()=>{const b=s??!1;p(b),o?.(b)}}),[g,p,o,r,s]);const x=S.useCallback(b=>{p(b.target.checked),o?.(b.target.checked)},[o]),y=S.useMemo(()=>typeof e=="string"?C.jsx(ae,{variant:"body-1",colorName:"primary",fontWeight:"medium",children:e}):e,[e]),v=S.useMemo(()=>typeof t=="string"?C.jsx(ae,{variant:"body-2",colorName:"secondary",fontWeight:"regular",children:t}):t,[t]);return C.jsxs(G,{row:!0,w:f,gap:n0.sm,children:[C.jsxs("label",{className:R.cx(Pn.container,a,{[Pn.disabled]:r,[Pn.reverse]:u}),children:[C.jsxs(G,{className:R.cx(Pn.switchContainer,Pn[`size_${l}`],Pn[`variant_${c}`]),children:[C.jsx("input",{ref:m,type:"checkbox",checked:g,hidden:!0,onChange:x,disabled:r,...d}),C.jsx("div",{className:Pn.switch,children:C.jsx("div",{className:Pn.thumb,children:c==="theme"&&(g?C.jsx(WL,{className:Pn.moon}):C.jsx(HL,{className:Pn.fire}))})})]}),(y||v)&&C.jsxs(G,{gap:n0.xs,children:[y,v]})]}),n]})});NC.displayName="Switch";const{spacing:r0}=V,UL=R.css({cursor:"pointer",userSelect:"none"}),GL=R.css({cursor:"not-allowed",opacity:.5}),qL=R.css({transition:"color 0.2s ease"}),YL=S.forwardRef(({label:e,selected:t,disabled:n,fullWidth:r,onClick:o},i)=>C.jsx(G,{w:r?"full":void 0,justifyContent:"center",alignItems:"center",ref:i,py:r0.md,px:r0.xl,onClick:o,className:R.cx(UL,{[GL]:n}),children:C.jsx(ae,{className:qL,colorName:t?"primary":"tertiary",fontWeight:"medium",variant:"body-2",children:e})})),{color:PC}=V,XL=R.css({borderBottom:`1px solid ${PC.border.neutralAlphaBasic}`}),FC=({value:e,onChange:t,options:n,fullWidth:r=!1,className:o})=>{const[i,s]=S.useState({left:0,width:0}),a=S.useRef([]),l=u=>f=>{a.current[u]=f};S.useEffect(()=>{const u=n.findIndex(d=>d.value===e),f=a.current[u];f&&s({left:f.offsetLeft,width:f.offsetWidth})},[e,n]);const c=(u,f=!1)=>()=>!f&&t(u);return C.jsxs(G,{row:!0,w:r?"full":"auto",relative:!0,className:R.cx(XL,o),children:[n.map((u,f)=>C.jsx(YL,{selected:e===u.value,onClick:c(u.value,u.disabled),ref:l(f),label:u.label,disabled:u.disabled,fullWidth:r},u.value)),C.jsx(G,{h:2,w:i.width,absolute:!0,bottom:-1,left:i.left,backgroundColor:PC.border.accentPrimary,className:R.css({transition:"left 0.2s ease, width 0.2s ease"})})]})};FC.displayName="Tabs";const LC=S.forwardRef(({title:e,subtitle:t,w:n="full",p:r,py:o,px:i=V.spacing["2xl"],pt:s=V.spacing["2xl"],pb:a=V.spacing.lg,row:l=!0,justifyContent:c="space-between",showCloseButton:u=!1},f)=>{const{onClose:d}=$_();return C.jsxs(G,{w:n,p:r,py:o,px:i,pt:s,pb:a,row:l,justifyContent:c,ref:f,borderColor:V.color.border.neutralAlphaBasic,borderWidth:0,borderBottomWidth:1,borderStyle:"solid",children:[C.jsxs(G,{gap:V.spacing.sm,children:[C.jsx(ae,{variant:"title-3",colorName:"primary",fontWeight:"semibold",children:e}),C.jsx(ae,{variant:"body-1",colorName:"tertiary",fontWeight:"medium",children:t})]}),u&&C.jsx(G,{children:C.jsx(dr,{onClick:d,color:"neutral",children:C.jsx(N0,{})})})]})});LC.displayName="ModalHeader";function Uo(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){var a,l,c;let u;n.key&&((a=n.debug)!=null&&a.call(n))&&(u=Date.now());const f=e();if(!(f.length!==r.length||f.some((g,p)=>r[p]!==g)))return o;r=f;let h;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(h=Date.now()),o=t(...f),n.key&&((c=n.debug)!=null&&c.call(n))){const g=Math.round((Date.now()-u)*100)/100,p=Math.round((Date.now()-h)*100)/100,m=p/16,x=(y,v)=>{for(y=String(y);y.length<v;)y=" "+y;return y};console.info(`%c⏱ ${x(p,5)} /${x(g,5)} ms`,`
63
+ `)}})(e,n)(t)}function PN({defaultSelection:e}){const[t]=it();return S.useEffect(()=>{t.focus(()=>{const n=document.activeElement,r=t.getRootElement();r===null||n!==null&&r.contains(n)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}const Bw=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,LN=Bw?S.useLayoutEffect:S.useEffect,Aa={tag:pi};function zw({initialConfig:e,children:t}){const n=S.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:a,html:l}=e,c=r3(null,r),u=x1({editable:e.editable,html:l,namespace:o,nodes:i,onError:f=>s(f,u),theme:r});return(function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=qe();if(h.isEmpty()){const g=ye();h.append(g);const p=Bw?document.activeElement:null;(Y()!==null||p!==null&&p===f.getRootElement())&&g.select()}},Aa);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,Aa);break}case"object":f.setEditorState(d,Aa);break;case"function":f.update(()=>{qe().isEmpty()&&d(f)},Aa)}}})(u,a),[u,c]},[]);return LN(()=>{const r=e.editable,[o]=n;o.setEditable(r===void 0||r)},[]),C.jsx(Cb.Provider,{value:n,children:t})}function FN(){return qe().getTextContent()}function $N(e,t=!0){if(e)return!1;let n=FN();return t&&(n=n.trim()),n===""}function ON(e){if(!$N(e,!1))return!1;const t=qe().getChildren(),n=t.length;if(n>1)return!1;for(let r=0;r<n;r++){const o=t[r];if(_e(o))return!1;if(B(o)){if(!qr(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let a=0;a<s;a++){const l=i[r];if(!X(l))return!1}}}return!0}function Hw(e){return()=>ON(e)}function IN(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function DN(e,t,n,r){const o=s=>s instanceof n,i=s=>{const a=Fe(s.getTextContent());a.setFormat(s.getFormat()),s.replace(a)};return[e.registerNodeTransform(un,s=>{if(!s.isSimpleText())return;let a,l=s.getPreviousSibling(),c=s.getTextContent(),u=s;if(X(l)){const d=l.getTextContent(),h=t(d+c);if(o(l)){if(h===null||(g=>g.getLatest().__mode)(l)!==0)return void i(l);{const g=h.end-d.length;if(g>0){const p=d+c.slice(0,g);if(l.select(),l.setTextContent(p),g===c.length)s.remove();else{const m=c.slice(g);s.setTextContent(m)}return}}}else if(h===null||h.start<d.length)return}let f=0;for(;;){a=t(c);let d,h=a===null?"":c.slice(a.end);if(c=h,h===""){const p=u.getNextSibling();if(X(p)){h=u.getTextContent()+p.getTextContent();const m=t(h);if(m===null)return void(o(p)?i(p):p.markDirty());if(m.start!==0)return}}if(a===null)return;if(a.start===0&&X(l)&&l.isTextEntity()){f+=a.end;continue}a.start===0?[d,u]=u.splitText(a.end):[,d,u]=u.splitText(a.start+f,a.end+f),d===void 0&&IN(165,"nodeToReplace");const g=r(d);if(g.setFormat(d.getFormat()),d.replace(g),u==null)return;f=0,l=g}}),e.registerNodeTransform(n,s=>{const a=s.getTextContent(),l=t(a);if(l===null||l.start!==0)return void i(s);if(a.length>l.end)return void s.splitText(l.end);const c=s.getPreviousSibling();X(c)&&c.isTextEntity()&&(i(c),i(s));const u=s.getNextSibling();X(u)&&u.isTextEntity()&&(i(u),o(s)&&i(s))})]}let ic=class Ww extends un{static getType(){return"hashtag"}static clone(t){return new Ww(t.__text,t.__key)}createDOM(t){const n=super.createDOM(t);return Qe(n,t.theme.hashtag),n}static importJSON(t){return Kw().updateFromJSON(t)}canInsertTextBefore(){return!1}isTextEntity(){return!0}};function Kw(e=""){return _t(new ic(e))}const jN=new RegExp((function(){const{alpha:e,alphanumeric:t,hashChars:n}=(function(){const o=String.fromCharCode,i="A-Za-zªµºÀ-ÖØ-öø-Ɂɐ-ˁˆ-ˑˠ-ˤˮͺΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϵϷ-ҁҊ-ӎӐ-ӹԀ-ԏԱ-Ֆՙա-ևא-תװ-ײء-غـ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ݭހ-ޥޱऄ-हऽॐक़-ॡॽঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཪྈ-ྋက-အဣ-ဧဩ-ဪၐ-ၕႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᴀ-ᶿḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℱℳ-ℹℼ-ℿⅅ-ⅉⰀ-Ⱞⰰ-ⱞⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〆〱-〵〻-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄬㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-龻ꀀ-ꒌꠀ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢ가-힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵÀ-ÖØ-öø-ÿĀ-ɏɓ-ɔɖ-ɗəɛɣɨɯɲʉʋʻ̀-ͯḀ-ỿЀ-ӿԀ-ԧⷠ-ⷿꙀ-֑ꚟ-ֿׁ-ׂׄ-ׇׅא-תװ-״﬒-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏؐ-ؚؠ-ٟٮ-ۓە-ۜ۞-۪ۨ-ۯۺ-ۼۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼ‌-‌ก-ฺเ-๎ᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿"+o(173824)+"-"+o(177983)+o(177984)+"-"+o(178207)+o(194560)+"-"+o(195103)+"〃々〻";return{alpha:i,alphanumeric:i+"̀-ͯ҃-֑҆-ֹֻ-ֽֿׁ-ׂׄ-ׇׅؐ-ًؕ-ٰٞۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ްँ-ः़ा-्॑-॔ॢ-ॣঁ-ঃ়া-ৄে-ৈো-্ৗৢ-ৣਁ-ਃ਼ਾ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗං-ඃ්ා-ුූෘ-ෟෲ-ෳัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾-༿ཱ-྄྆-྇ྐ-ྗྙ-ྼ࿆ာ-ဲံ-္ၖ-ၙ፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈ-ᧉᨗ-ᨛ᷀-᷃⃐-⃥⃜⃡-⃫〪-゙〯-゚ꠂ꠆ꠋꠣ-ꠧﬞ︀-️︠-︣0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉០-៩᠐-᠙᥆-᥏᧐-᧙0-9_",hashChars:"#\\uFF03"}})(),r="["+t+"]";return"("+("^|$|[^&/"+t+"]")+")("+("["+n+"]")+")("+r+"*"+("["+e+"]")+r+"*)"})(),"i"),VN={getHashtagMatch:function(e){const t=jN.exec(e);if(t===null)return null;const n=t[3].length+1,r=t.index+t[1].length;return{end:r+n,start:r}}};function BN(e,t=VN){return Rn(...DN(e,t.getHashtagMatch,ic,n=>Kw(n.getTextContent())))}function zN(){const[e]=it();return S.useEffect(()=>{if(!e.hasNodes([ic]))throw new Error("HashtagPlugin: HashtagNode not registered on editor");return BN(e)},[e]),null}function HN({hasStrictIndent:e=!1}){const[t]=it();return S.useEffect(()=>{if(!t.hasNodes([Io,Yr]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[t]),S.useEffect(()=>{if(e)return wM(t)},[t,e]),(function(n){S.useEffect(()=>bM(n),[n])})(t),null}function Wy(e,t){return e.getEditorState().read(()=>{const n=Le(t);return n!==null&&n.isSelected()})}function WN(e){const[t]=it(),[n,r]=S.useState(()=>Wy(t,e));return S.useEffect(()=>{let o=!0;const i=t.registerUpdateListener(()=>{o&&r(Wy(t,e))});return()=>{o=!1,i()}},[t,e]),[n,S.useCallback(o=>{t.update(()=>{let i=Y();bt(i)||(i=mh(),Ge(i)),bt(i)&&(o?i.add(e):i.delete(e))})},[t,e]),S.useCallback(()=>{t.update(()=>{const o=Y();bt(o)&&o.clear()})},[t])]}function KN({nodeKey:e}){const[t]=it(),[n,r,o]=WN(e);return S.useEffect(()=>Rn(t.registerCommand(Hl,i=>{const s=t.getElementByKey(e);return i.target===s&&(i.shiftKey||o(),r(!n),!0)},ar)),[o,t,n,e,r]),S.useEffect(()=>{const i=t.getElementByKey(e),s=t._config.theme.hrSelected??"selected";i!==null&&(n?Qe(i,s):Un(i,s))},[t,n,e]),null}let Uw=class Gw extends jh{static getType(){return"horizontalrule"}static clone(t){return new Gw(t.__key)}static importJSON(t){return Kh().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:UN,priority:0})}}decorate(){return C.jsx(KN,{nodeKey:this.__key})}};function UN(){return{node:Kh()}}function Kh(){return _t(new Uw)}const GN=[{dependencies:[Uw],export:e=>uM(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const o=Kh();r||e.getNextSibling()!=null?e.replace(o):e.insertBefore(o),o.selectNext()},type:"element"},...ra];function qN({transformers:e=GN}){const[t]=it();return S.useEffect(()=>MN(t,e),[t,e]),null}const YN=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function XN({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=it();return YN(()=>{if(n)return r.registerUpdateListener(({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&i.size===0&&s.size===0||e&&l.has(pi)||a.isEmpty()||n(o,r,l)})},[r,e,t,n]),null}const Uh=/^(\d+(?:\.\d+)?)px$/,rt={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class kn extends St{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(t){return new kn(t.__headerState,t.__colSpan,t.__width,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__rowSpan=t.__rowSpan,this.__backgroundColor=t.__backgroundColor,this.__verticalAlign=t.__verticalAlign}static importDOM(){return{td:t=>({conversion:Ky,priority:0}),th:t=>({conversion:Ky,priority:0})}}static importJSON(t){return ln().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeaderStyles(t.headerState).setColSpan(t.colSpan||1).setRowSpan(t.rowSpan||1).setWidth(t.width||void 0).setBackgroundColor(t.backgroundColor||null).setVerticalAlign(t.verticalAlign||void 0)}constructor(t=rt.NO_STATUS,n=1,r,o){super(o),this.__colSpan=n,this.__rowSpan=1,this.__headerState=t,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),tf(this.__verticalAlign)&&(n.style.verticalAlign=this.__verticalAlign),Qe(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(t){const n=super.exportDOM(t);if(Be(n.element)){const r=n.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return n}exportJSON(){return{...super.exportJSON(),...tf(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(t){const n=this.getWritable();return n.__colSpan=t,n}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(t){const n=this.getWritable();return n.__rowSpan=t,n}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t,n=rt.BOTH){const r=this.getWritable();return r.__headerState=t&n|r.__headerState&~n,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){const n=this.getWritable();return n.__width=t,n}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){const n=this.getWritable();return n.__backgroundColor=t,n}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(t){const n=this.getWritable();return n.__verticalAlign=t||void 0,n}toggleHeaderStyle(t){const n=this.getWritable();return(n.__headerState&t)===t?n.__headerState-=t:n.__headerState+=t,n}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==rt.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor||t.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function tf(e){return e==="middle"||e==="bottom"}function Ky(e){const t=e,n=e.nodeName.toLowerCase();let r;Uh.test(t.style.width)&&(r=parseFloat(t.style.width));const o=ln(n==="th"?rt.ROW:rt.NO_STATUS,t.colSpan,r);o.__rowSpan=t.rowSpan;const i=t.style.backgroundColor;i!==""&&(o.__backgroundColor=i);const s=t.style.verticalAlign;tf(s)&&(o.__verticalAlign=s);const a=t.style,l=(a&&a.textDecoration||"").split(" "),c=a.fontWeight==="700"||a.fontWeight==="bold",u=l.includes("line-through"),f=a.fontStyle==="italic",d=l.includes("underline");return{after:h=>{const g=[];let p=null;const m=()=>{if(p){const x=p.getFirstChild();zn(x)&&p.getChildrenSize()===1&&x.remove()}};for(const x of h)xA(x)||X(x)||zn(x)?(X(x)&&(c&&x.toggleFormat("bold"),u&&x.toggleFormat("strikethrough"),f&&x.toggleFormat("italic"),d&&x.toggleFormat("underline")),p?p.append(x):(p=ye().append(x),g.push(p))):(g.push(x),m(),p=null);return m(),g.length===0&&g.push(ye()),g},node:o}}function ln(e=rt.NO_STATUS,t=1,n){return _t(new kn(e,t,n))}function ge(e){return e instanceof kn}const qw=le("INSERT_TABLE_COMMAND");function de(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class Br extends St{__height;static getType(){return"tablerow"}static clone(t){return new Br(t.__height,t.__key)}static importDOM(){return{tr:t=>({conversion:ZN,priority:0})}}static importJSON(t){return ki().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeight(t.height)}constructor(t,n){super(n),this.__height=t}exportJSON(){const t=this.getHeight();return{...super.exportJSON(),...t===void 0?void 0:{height:t}}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),Qe(n,t.theme.tableRow),n}extractWithChild(t,n,r){return r==="html"}isShadowRoot(){return!0}setHeight(t){const n=this.getWritable();return n.__height=t,n}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function ZN(e){const t=e;let n;return Uh.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:r=>ew(r,ge),node:ki(n)}}function ki(e){return _t(new Br(e))}function et(e){return e instanceof Br}const Gh=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,JN=Gh&&"documentMode"in document?document.documentMode:null,Uy=Gh&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function QN(e,t,n=!0){const r=ac();for(let o=0;o<e;o++){const i=ki();for(let s=0;s<t;s++){let a=rt.NO_STATUS;typeof n=="object"?(o===0&&n.rows&&(a|=rt.ROW),s===0&&n.columns&&(a|=rt.COLUMN)):n&&(o===0&&(a|=rt.ROW),s===0&&(a|=rt.COLUMN));const l=ln(a),c=ye();c.append(Fe()),l.append(c),i.append(l)}r.append(i)}return r}function eP(e){const t=we(e,n=>Xe(n));if(Xe(t))return t;throw new Error("Expected table cell to be inside of table.")}Gh&&"InputEvent"in window&&!JN&&new window.InputEvent("input");const nf=(e,t)=>e===rt.BOTH||e===t?t:rt.NO_STATUS;function tP(e,t=!0){const[,,n]=jn(e),[r,o]=on(n,e,e),i=r[0].length,{startRow:s}=o;let a=null;if(t){const l=s+e.__rowSpan-1,c=r[l],u=ki();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g+h.__rowSpan-1<=l){const p=c[d].cell.__headerState,m=nf(p,rt.COLUMN);u.append(ln(m).append(ye()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);et(f)||de(256),f.insertAfter(u),a=u}else{const l=s,c=r[l],u=ki();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g===l){const p=c[d].cell.__headerState,m=nf(p,rt.COLUMN);u.append(ln(m).append(ye()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);et(f)||de(257),f.insertBefore(u),a=u}return a}function nP(e,t=!0,n=!0){const[,,r]=jn(e),[o,i]=on(r,e,e),s=o.length,{startColumn:a}=i,l=t?a+e.__colSpan-1:a-1,c=r.getFirstChild();et(c)||de(120);let u=null;function f(g=rt.NO_STATUS){const p=ln(g).append(ye());return u===null&&(u=p),p}let d=c;e:for(let g=0;g<s;g++){if(g!==0){const w=d.getNextSibling();et(w)||de(121),d=w}const p=o[g],m=p[l<0?0:l].cell.__headerState,x=nf(m,rt.ROW);if(l<0){Yw(d,f(x));continue}const{cell:y,startColumn:v,startRow:b}=p[l];if(v+y.__colSpan-1<=l){let w=y,_=b,E=l;for(;_!==g&&w.__rowSpan>1;){if(E-=y.__colSpan,!(E>=0)){d.append(f(x));continue e}{const{cell:T,startRow:k}=p[E];w=T,_=k}}w.insertAfter(f(x))}else y.setColSpan(y.__colSpan+1)}u!==null&&n&&rP(u);const h=r.getColWidths();if(h){const g=[...h],p=l<0?0:l,m=g[p];g.splice(p,0,m),r.setColWidths(g)}return u}function rP(e){const t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function Yw(e,t){const n=e.getFirstChild();n!==null?n.insertBefore(t):e.append(t)}function oP(e){if(e.length===0)return null;const t=eP(e[0]),[n]=Mr(t,null,null);let r=1/0,o=-1/0,i=1/0,s=-1/0;const a=new Set;for(const h of n)for(const g of h){if(!g||!g.cell)continue;const p=g.cell.getKey();if(!a.has(p)&&e.some(m=>m.is(g.cell))){a.add(p);const m=g.startRow,x=g.startColumn,y=g.cell.__rowSpan||1,v=g.cell.__colSpan||1;r=Math.min(r,m),o=Math.max(o,m+y-1),i=Math.min(i,x),s=Math.max(s,x+v-1)}}if(r===1/0||i===1/0)return null;const l=o-r+1,c=s-i+1,u=n[r][i];if(!u.cell)return null;const f=u.cell;f.setColSpan(c),f.setRowSpan(l);const d=new Set([f.getKey()]);for(let h=r;h<=o;h++)for(let g=i;g<=s;g++){const p=n[h][g];if(!p.cell)continue;const m=p.cell,x=m.getKey();d.has(x)||(d.add(x),iP(m)||f.append(...m.getChildren()),m.remove())}return f.getChildrenSize()===0&&f.append(ye()),f}function iP(e){if(e.getChildrenSize()!==1)return!1;const t=e.getFirstChildOrThrow();return!(!qr(t)||!t.isEmpty())}function sP(e){const[t,n,r]=jn(e),o=t.__colSpan,i=t.__rowSpan;if(o===1&&i===1)return;const[s,a]=on(r,t,t),{startColumn:l,startRow:c}=a,u=t.__headerState&rt.COLUMN,f=Array.from({length:o},(g,p)=>{let m=u;for(let x=0;m!==0&&x<s.length;x++)m&=s[x][p+l].cell.__headerState;return m}),d=t.__headerState&rt.ROW,h=Array.from({length:i},(g,p)=>{let m=d;for(let x=0;m!==0&&x<s[0].length;x++)m&=s[p+c][x].cell.__headerState;return m});if(o>1){for(let g=1;g<o;g++)t.insertAfter(ln(f[g]|h[0]).append(ye()));t.setColSpan(1)}if(i>1){let g;for(let p=1;p<i;p++){const m=c+p,x=s[m];g=(g||n).getNextSibling(),et(g)||de(125);let y=null;for(let v=0;v<l;v++){const b=x[v],w=b.cell;b.startRow===m&&(y=w),w.__colSpan>1&&(v+=w.__colSpan-1)}if(y===null)for(let v=o-1;v>=0;v--)Yw(g,ln(f[v]|h[p]).append(ye()));else for(let v=o-1;v>=0;v--)y.insertAfter(ln(f[v]|h[p]).append(ye()))}t.setRowSpan(1)}}function on(e,t,n){const[r,o,i]=Mr(e,t,n);return o===null&&de(207),i===null&&de(208),[r,o,i]}function Mr(e,t,n){const r=[];let o=null,i=null;function s(l){let c=r[l];return c===void 0&&(r[l]=c=[]),c}const a=e.getChildren();for(let l=0;l<a.length;l++){const c=a[l];et(c)||de(209);const u=s(l);for(let f=c.getFirstChild(),d=0;f!=null;f=f.getNextSibling()){for(ge(f)||de(147);u[d]!==void 0;)d++;const h={cell:f,startColumn:d,startRow:l},{__rowSpan:g,__colSpan:p}=f;for(let m=0;m<g&&!(l+m>=a.length);m++){const x=s(l+m);for(let y=0;y<p;y++)x[d+y]=h}t!==null&&o===null&&t.is(f)&&(o=h),n!==null&&i===null&&n.is(f)&&(i=h)}}return[r,o,i]}function jn(e){let t;if(e instanceof kn)t=e;else if("__type"in e){const o=we(e,ge);ge(o)||de(148),t=o}else{const o=we(e.getNode(),ge);ge(o)||de(148),t=o}const n=t.getParent();et(n)||de(149);const r=n.getParent();return Xe(r)||de(210),[t,n,r]}function Al(e,t,n){let r,o=Math.min(t.startColumn,n.startColumn),i=Math.min(t.startRow,n.startRow),s=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),a=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let l=0;l<e.length;l++)for(let c=0;c<e[0].length;c++){const u=e[l][c];if(!u)continue;const f=u.startColumn+u.cell.__colSpan-1,d=u.startRow+u.cell.__rowSpan-1,h=u.startColumn<=s&&f>=o,g=u.startRow<=a&&d>=i;if(h&&g){const p=Math.min(o,u.startColumn),m=Math.max(s,f),x=Math.min(i,u.startRow),y=Math.max(a,d);p===o&&m===s&&x===i&&y===a||(o=p,s=m,i=x,a=y,r=!0)}}}while(r);return{maxColumn:s,maxRow:a,minColumn:o,minRow:i}}function Gy(e){const[t,,n]=jn(e),r=n.getChildren(),o=r.length,i=r[0].getChildren().length,s=new Array(o);for(let a=0;a<o;a++)s[a]=new Array(i);for(let a=0;a<o;a++){const l=r[a].getChildren();let c=0;for(let u=0;u<l.length;u++){for(;s[a][c];)c++;const f=l[u],d=f.__rowSpan||1,h=f.__colSpan||1;for(let g=0;g<d;g++)for(let p=0;p<h;p++)s[a+g][c+p]=f;if(t===f)return{colSpan:h,columnIndex:c,rowIndex:a,rowSpan:d};c+=h}}return null}function qy(e){const[[t,n,r,o],[i,s,a,l]]=["anchor","focus"].map(c=>{const u=e[c].getNode(),f=we(u,ge);ge(f)||de(238,c,u.getKey(),u.getType());const d=f.getParent();et(d)||de(239,c);const h=d.getParent();return Xe(h)||de(240,c),[u,f,d,h]});return o.is(l)||de(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:o,focusCell:s,focusNode:i,focusRow:a,focusTable:l}}class sc{tableKey;anchor;focus;_cachedNodes;dirty;constructor(t,n,r){this.anchor=n,this.focus=r,n._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;const t=Le(this.tableKey),n=Le(this.anchor.key),r=Le(this.focus.key);return t!==null&&n!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return Ve(t)&&this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)}set(t,n,r){this.dirty=this.dirty||t!==this.tableKey||n!==this.anchor.key||r!==this.focus.key,this.tableKey=t,this.anchor.key=n,this.focus.key=r,this._cachedNodes=null}clone(){return new sc(this.tableKey,zt(this.anchor.key,this.anchor.offset,this.anchor.type),zt(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}hasFormat(t){let n=0;this.getNodes().filter(ge).forEach(o=>{const i=o.getFirstChild();qr(i)&&(n|=i.getTextFormat())});const r=Dr[t];return(n&r)!==0}insertNodes(t){const n=this.focus.getNode();B(n)||de(151),Ns(n.select(0,n.getChildrenSize())).insertNodes(t)}getShape(){const{anchorCell:t,focusCell:n}=qy(this),r=Gy(t);r===null&&de(153);const o=Gy(n);o===null&&de(155);const i=Math.min(r.columnIndex,o.columnIndex),s=Math.max(r.columnIndex+r.colSpan-1,o.columnIndex+o.colSpan-1),a=Math.min(r.rowIndex,o.rowIndex),l=Math.max(r.rowIndex+r.rowSpan-1,o.rowIndex+o.rowSpan-1);return{fromX:Math.min(i,s),fromY:Math.min(a,l),toX:Math.max(i,s),toY:Math.max(a,l)}}getNodes(){if(!this.isValid())return[];const t=this._cachedNodes;if(t!==null)return t;const{anchorTable:n,anchorCell:r,focusCell:o}=qy(this),i=o.getParents()[1];if(i!==n){if(n.isParentOf(o)){const m=i.getParent();m==null&&de(159),this.set(this.tableKey,o.getKey(),m.getKey())}else{const m=n.getParent();m==null&&de(158),this.set(this.tableKey,m.getKey(),o.getKey())}return this.getNodes()}const[s,a,l]=on(n,r,o),{minColumn:c,maxColumn:u,minRow:f,maxRow:d}=Al(s,a,l),h=new Map([[n.getKey(),n]]);let g=null;for(let m=f;m<=d;m++)for(let x=c;x<=u;x++){const{cell:y}=s[m][x],v=y.getParent();et(v)||de(160),v!==g&&(h.set(v.getKey(),v),g=v),h.has(y.getKey())||lP(y,b=>{h.set(b.getKey(),b)})}const p=Array.from(h.values());return ji()||(this._cachedNodes=p),p}getTextContent(){const t=this.getNodes().filter(r=>ge(r));let n="";for(let r=0;r<t.length;r++){const o=t[r],i=o.__parent,s=(t[r+1]||{}).__parent;n+=o.getTextContent()+(s!==i?`
64
+ `:" ")}return n}}function Ve(e){return e instanceof sc}function Xw(){const e=zt("root",0,"element"),t=zt("root",0,"element");return new sc("root",e,t)}function aP(e,t,n){e.getKey(),t.getKey(),n.getKey();const r=Y(),o=Ve(r)?r.clone():Xw();return o.set(e.getKey(),t.getKey(),n.getKey()),o}function lP(e,t){const n=[[e]];for(let r=n.at(-1);r!==void 0&&n.length>0;r=n.at(-1)){const o=r.pop();o===void 0?n.pop():t(o)!==!1&&B(o)&&n.push(o.getChildren())}}function Zw(e,t=Bi()){const n=Le(e);Xe(n)||de(231,e);const r=Ao(n,t.getElementByKey(e));return r===null&&de(232,e),{tableElement:r,tableNode:n}}class cP{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;shouldCheckSelection;abortController;listenerOptions;nextFocus;constructor(t,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.shouldCheckSelection=!1,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.nextFocus=null,this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach(t=>t()),this.listenersToRemove.clear()}$lookup(){return Zw(this.tableNodeKey,this.editor)}trackTable(){const t=new MutationObserver(n=>{this.editor.getEditorState().read(()=>{let r=!1;for(let s=0;s<n.length;s++){const a=n[s].target.nodeName;if(a==="TABLE"||a==="TBODY"||a==="THEAD"||a==="TR"){r=!0;break}}if(!r)return;const{tableNode:o,tableElement:i}=this.$lookup();this.table=vi(o,i)},{editor:this.editor})});this.editor.getEditorState().read(()=>{const{tableNode:n,tableElement:r}=this.$lookup();this.table=vi(n,r),t.observe(r,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();const{tableNode:n,tableElement:r}=this.$lookup();Ma(t,vi(n,r),null),Y()!==null&&(Ge(null),t.dispatchCommand(cr,void 0))}$enableHighlightStyle(){const t=this.editor,{tableElement:n}=this.$lookup();Un(n,t._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){const{tableElement:t}=this.$lookup();Qe(t,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(t){if(t!==null){t.tableKey!==this.tableNodeKey&&de(233,t.tableKey,this.tableNodeKey);const n=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Ma(n,this.table,this.tableSelection)}else this.$clearHighlight()}setShouldCheckSelection(){this.shouldCheckSelection=!0}getAndClearShouldCheckSelection(){return!!this.shouldCheckSelection&&(this.shouldCheckSelection=!1,!0)}setNextFocus(t){this.nextFocus=t}getAndClearNextFocus(){const{nextFocus:t}=this;return t!==null&&(this.nextFocus=null),t}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){const t=Lt(this.editor._window);t&&t.rangeCount>0&&t.removeAllRanges()}}$setFocusCellForSelection(t,n=!1){const r=this.editor,{tableNode:o}=this.$lookup(),i=t.x,s=t.y;if(this.focusCell=t,this.isHighlightingCells||this.anchorX===i&&this.anchorY===s&&!n){if(i===this.focusX&&s===this.focusY)return!1}else this.isHighlightingCells=!0,this.$disableHighlightStyle();if(this.focusX=i,this.focusY=s,this.isHighlightingCells){const a=of(o,t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&a!==null)return this.focusCellNodeKey=a.getKey(),this.tableSelection=aP(o,this.$getAnchorTableCellOrThrow(),a),Ge(this.tableSelection),r.dispatchCommand(cr,void 0),Ma(r,this.table,this.tableSelection),!0}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?Le(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){const t=this.$getAnchorTableCell();return t===null&&de(234),t}$getFocusTableCell(){return this.focusCellNodeKey?Le(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){const t=this.$getFocusTableCell();return t===null&&de(235),t}$setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y;const{tableNode:n}=this.$lookup(),r=of(n,t.elem);if(r!==null){const o=r.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():Xw(),this.anchorCellNodeKey=o}}$formatCells(t){const n=Y();Ve(n)||de(236);const r=Yl(),o=r.anchor,i=r.focus,s=n.getNodes().filter(ge);s.length>0||de(237);const a=s[0].getFirstChild(),l=qr(a)?a.getFormatFlags(t,null):null;s.forEach(c=>{o.set(c.getKey(),0,"element"),i.set(c.getKey(),c.getChildrenSize(),"element"),r.formatText(t,l)}),Ge(n),this.editor.dispatchCommand(cr,void 0)}$clearText(){const{editor:t}=this,n=Le(this.tableNodeKey);if(!Xe(n))throw new Error("Expected TableNode.");const r=Y();Ve(r)||de(253);const o=r.getNodes().filter(ge),i=n.getFirstChild(),s=n.getLastChild();if(o.length>0&&i!==null&&s!==null&&et(i)&&et(s)&&o[0]===i.getFirstChild()&&o[o.length-1]===s.getLastChild()){n.selectPrevious();const a=n.getParent();return n.remove(),void(ot(a)&&a.isEmpty()&&t.dispatchCommand(Co,void 0))}o.forEach(a=>{if(B(a)){const l=ye(),c=Fe();l.append(c),a.append(l),a.getChildren().forEach(u=>{u!==l&&u.remove()})}}),Ma(t,this.table,null),Ge(null),t.dispatchCommand(cr,void 0)}}const rf="__lexicalTableSelection";function ti(e){return Be(e)&&e.nodeName==="TABLE"}function Ao(e,t){if(!t)return t;const n=ti(t)?t:e.getDOMSlot(t).element;return n.nodeName!=="TABLE"&&de(245,t.nodeName),n}function qh(e){return e._window}function Cs(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;ge(n)&&(r=n)}return null}const uP=[[dh,"down"],[uh,"up"],[ch,"backward"],[lh,"forward"]],dP=[Ti,So,Lr],fP=[Wl,hh];function hP(e,t,n,r){const o=n.getRootElement(),i=qh(n);o!==null&&i!==null||de(246);const s=new cP(n,e.getKey()),a=Ao(e,t);(function(h,g){Yy(h)!==null&&de(205),h[rf]=g})(a,s),s.listenersToRemove.add(()=>(function(h,g){Yy(h)===g&&delete h[rf]})(a,s));const l=h=>{if(s.pointerType=h.pointerType,h.button!==0||!xn(h.target)||!i)return;const g=Ml(h.target);g!==null&&n.update(()=>{const p=qn();if(Uy&&h.shiftKey&&Fn(p,e)&&(W(p)||Ve(p))){const m=p.anchor.getNode(),x=Cs(e,p.anchor.getNode());x?(s.$setAnchorCellForSelection(lo(s,x)),s.$setFocusCellForSelection(g),lr(h)):(e.isBefore(m)?e.selectStart():e.selectEnd()).anchor.set(p.anchor.key,p.anchor.offset,p.anchor.type)}else h.pointerType!=="touch"&&s.$setAnchorCellForSelection(g)}),(()=>{if(s.isSelecting)return;const p=()=>{s.isSelecting=!1,i.removeEventListener("pointerup",p),i.removeEventListener("pointermove",m)},m=x=>{if(1&~x.buttons&&s.isSelecting)return s.isSelecting=!1,i.removeEventListener("pointerup",p),void i.removeEventListener("pointermove",m);if(!xn(x.target))return;let y=null;const v=!(Uy||a.contains(x.target));if(v)y=Xy(a,x.target);else for(const b of document.elementsFromPoint(x.clientX,x.clientY))if(y=Xy(a,b),y)break;!y||s.focusCell!==null&&y.elem===s.focusCell.elem||(s.setNextFocus({focusCell:y,override:v}),n.dispatchCommand(cr,void 0))};s.isSelecting=!0,i.addEventListener("pointerup",p,s.listenerOptions),i.addEventListener("pointermove",m,s.listenerOptions)})()};a.addEventListener("pointerdown",l,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("pointerdown",l)});const c=h=>{h.detail>=3&&xn(h.target)&&Ml(h.target)!==null&&h.preventDefault()};a.addEventListener("mousedown",c,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("mousedown",c)});const u=h=>{const g=h.target;h.button===0&&xn(g)&&n.update(()=>{const p=Y();Ve(p)&&p.tableKey===s.tableNodeKey&&o.contains(g)&&s.$clearHighlight()})};i.addEventListener("pointerdown",u,s.listenerOptions),s.listenersToRemove.add(()=>{i.removeEventListener("pointerdown",u)});for(const[h,g]of uP)s.listenersToRemove.add(n.registerCommand(h,p=>eC(n,p,g,e,s),$t));s.listenersToRemove.add(n.registerCommand(fh,h=>{const g=Y();if(Ve(g)){const p=Cs(e,g.focus.getNode());if(p!==null)return lr(h),p.selectEnd(),!0}return!1},$t));const f=h=>()=>{const g=Y();if(!Fn(g,e))return!1;if(Ve(g))return s.$clearText(),!0;if(W(g)){if(!ge(Cs(e,g.anchor.getNode())))return!1;const p=g.anchor.getNode(),m=g.focus.getNode(),x=e.isParentOf(p),y=e.isParentOf(m);if(x&&!y||y&&!x)return s.$clearText(),!0;const v=we(g.anchor.getNode(),w=>B(w)),b=v&&we(v,w=>B(w)&&ge(w.getParent()));if(!B(b)||!B(v))return!1;if(h===So&&b.getPreviousSibling()===null)return!0}return!1};for(const h of dP)s.listenersToRemove.add(n.registerCommand(h,f(h),$t));const d=h=>{const g=Y();if(!Ve(g)&&!W(g))return!1;const p=e.isParentOf(g.anchor.getNode());if(p!==e.isParentOf(g.focus.getNode())){const m=p?"anchor":"focus",x=p?"focus":"anchor",{key:y,offset:v,type:b}=g[x];return e[g[m].isBefore(g[x])?"selectPrevious":"selectNext"]()[x].set(y,v,b),!1}return!!Fn(g,e)&&!!Ve(g)&&(h&&(h.preventDefault(),h.stopPropagation()),s.$clearText(),!0)};for(const h of fP)s.listenersToRemove.add(n.registerCommand(h,d,$t));return s.listenersToRemove.add(n.registerCommand(Ul,h=>{const g=Y();if(g){if(!Ve(g)&&!W(g))return!1;Yd(n,kr(h,ClipboardEvent)?h:null,Cw(g));const p=d(h);return W(g)?(g.removeText(),!0):p}return!1},$t)),s.listenersToRemove.add(n.registerCommand(It,h=>{const g=Y();if(!Fn(g,e))return!1;if(Ve(g))return s.$formatCells(h),!0;if(W(g)){const p=we(g.anchor.getNode(),m=>ge(m));if(!ge(p))return!1}return!1},$t)),s.listenersToRemove.add(n.registerCommand(hi,h=>{const g=Y();if(!Ve(g)||!Fn(g,e))return!1;const p=g.anchor.getNode(),m=g.focus.getNode();if(!ge(p)||!ge(m))return!1;if((function(k,P){if(Ve(k)){const O=k.anchor.getNode(),D=k.focus.getNode();if(P&&O&&D){const[I]=on(P,O,D);return O.getKey()===I[0][0].cell.getKey()&&D.getKey()===I[I.length-1].at(-1).cell.getKey()}}return!1})(g,e))return e.setFormat(h),!0;const[x,y,v]=on(e,p,m),b=Math.max(y.startRow+y.cell.__rowSpan-1,v.startRow+v.cell.__rowSpan-1),w=Math.max(y.startColumn+y.cell.__colSpan-1,v.startColumn+v.cell.__colSpan-1),_=Math.min(y.startRow,v.startRow),E=Math.min(y.startColumn,v.startColumn),T=new Set;for(let k=_;k<=b;k++)for(let P=E;P<=w;P++){const O=x[k][P].cell;if(T.has(O))continue;T.add(O),O.setFormat(h);const D=O.getChildren();for(let I=0;I<D.length;I++){const $=D[I];B($)&&!$.isInline()&&$.setFormat(h)}}return!0},$t)),s.listenersToRemove.add(n.registerCommand(mo,h=>{const g=Y();if(!Fn(g,e))return!1;if(Ve(g))return s.$clearHighlight(),!1;if(W(g)){const p=we(g.anchor.getNode(),m=>ge(m));if(!ge(p))return!1;if(typeof h=="string"){const m=Qy(n,g,e);if(m)return Jy(m,e,[Fe(h)]),!0}}return!1},$t)),r&&s.listenersToRemove.add(n.registerCommand(gh,h=>{const g=Y();if(!W(g)||!g.isCollapsed()||!Fn(g,e))return!1;const p=ns(g.anchor.getNode());return!(p===null||!e.is(xi(p)))&&(lr(h),(function(m,x){const y=x==="next"?"getNextSibling":"getPreviousSibling",v=x==="next"?"getFirstChild":"getLastChild",b=m[y]();if(B(b))return b.selectEnd();const w=we(m,et);w===null&&de(247);for(let E=w[y]();et(E);E=E[y]()){const T=E[v]();if(B(T))return T.selectEnd()}const _=we(w,Xe);_===null&&de(248),x==="next"?_.selectNext():_.selectPrevious()})(p,h.shiftKey?"previous":"next"),!0)},$t)),s.listenersToRemove.add(n.registerCommand(Xb,h=>e.isSelected(),$t)),s.listenersToRemove.add(n.registerCommand(sh,(h,g)=>{if(n!==g)return!1;const{nodes:p,selection:m}=h,x=m.getStartEndPoints(),y=Ve(m),v=W(m)&&we(m.anchor.getNode(),ne=>ge(ne))!==null&&we(m.focus.getNode(),ne=>ge(ne))!==null||y;if(p.length!==1||!Xe(p[0])||!v||x===null)return!1;const[b,w]=x,[_,E,T]=jn(b),k=we(w.getNode(),ne=>ge(ne));if(!(ge(_)&&ge(k)&&et(E)&&Xe(T)))return!1;const P=p[0],[O,D,I]=on(T,_,k),[$]=Mr(P,null,null),H=O.length,U=H>0?O[0].length:0;let L=D.startRow,N=D.startColumn,V=$.length,K=V>0?$[0].length:0;if(y){const ne=Al(O,D,I),ve=ne.maxRow-ne.minRow+1,Ee=ne.maxColumn-ne.minColumn+1;L=ne.minRow,N=ne.minColumn,V=Math.min(V,ve),K=Math.min(K,Ee)}let te=!1;const J=Math.min(H,L+V)-1,Z=Math.min(U,N+K)-1,ae=new Set;for(let ne=L;ne<=J;ne++)for(let ve=N;ve<=Z;ve++){const Ee=O[ne][ve];ae.has(Ee.cell.getKey())||Ee.cell.__rowSpan===1&&Ee.cell.__colSpan===1||(sP(Ee.cell),ae.add(Ee.cell.getKey()),te=!0)}let[oe]=Mr(T.getWritable(),null,null);const fe=V-H+L;for(let ne=0;ne<fe;ne++)tP(oe[H-1][0].cell);const Te=K-U+N;for(let ne=0;ne<Te;ne++)nP(oe[0][U-1].cell,!0,!1);[oe]=Mr(T.getWritable(),null,null);for(let ne=L;ne<L+V;ne++)for(let ve=N;ve<N+K;ve++){const Ee=ne-L,De=ve-N,st=$[Ee][De];if(st.startRow!==Ee||st.startColumn!==De)continue;const ee=st.cell;if(ee.__rowSpan!==1||ee.__colSpan!==1){const Re=[],mt=Math.min(ne+ee.__rowSpan,L+V)-1,Ft=Math.min(ve+ee.__colSpan,N+K)-1;for(let Yt=ne;Yt<=mt;Yt++)for(let Xt=ve;Xt<=Ft;Xt++){const xe=oe[Yt][Xt];Re.push(xe.cell)}oP(Re),te=!0}const{cell:Ce}=oe[ne][ve],ze=Ce.getChildren();ee.getChildren().forEach(Re=>{X(Re)&&ye().append(Re),Ce.append(Re)}),ze.forEach(Re=>Re.remove())}if(y&&te){const[ne]=Mr(T.getWritable(),null,null);ne[D.startRow][D.startColumn].cell.selectEnd()}return!0},$t)),s.listenersToRemove.add(n.registerCommand(cr,()=>{const h=Y(),g=qn(),p=s.getAndClearNextFocus();if(p!==null){const{focusCell:m}=p;if(Ve(h)&&h.tableKey===s.tableNodeKey)return(m.x!==s.focusX||m.y!==s.focusY)&&(s.$setFocusCellForSelection(m),!0);if(m!==s.anchorCell&&Fn(h,e))return s.$setFocusCellForSelection(m),!0}if(s.getAndClearShouldCheckSelection()&&W(g)&&W(h)&&h.isCollapsed()){const m=h.anchor.getNode(),x=e.getFirstChild(),y=ns(m);if(y!==null&&et(x)){const v=x.getFirstChild();if(ge(v)&&e.is(we(y,b=>b.is(e)||b.is(v))))return v.selectStart(),!0}}if(W(h)){const{anchor:m,focus:x}=h,y=m.getNode(),v=x.getNode(),b=ns(y),w=ns(v),_=!(!b||!e.is(xi(b))),E=!(!w||!e.is(xi(w))),T=_!==E,k=_&&E,P=h.isBackward();if(T){const O=h.clone();if(E){const[D]=on(e,w,w),I=D[0][0].cell,$=D[D.length-1].at(-1).cell;O.focus.set(P?I.getKey():$.getKey(),P?0:$.getChildrenSize(),"element")}else if(_){const[D]=on(e,b,b),I=D[0][0].cell,$=D[D.length-1].at(-1).cell;O.anchor.set(P?$.getKey():I.getKey(),P?$.getChildrenSize():0,"element")}Ge(O),Zy(n,s)}else if(k&&(b.is(w)||(s.$setAnchorCellForSelection(lo(s,b)),s.$setFocusCellForSelection(lo(s,w),!0)),s.pointerType==="touch"&&s.isSelecting&&h.isCollapsed()&&W(g)&&g.isCollapsed())){const O=ns(g.anchor.getNode());O&&!O.is(w)&&(s.$setAnchorCellForSelection(lo(s,O)),s.$setFocusCellForSelection(lo(s,w),!0),s.pointerType=null)}}else if(h&&Ve(h)&&h.is(g)&&h.tableKey===e.getKey()){const m=Lt(i);if(m&&m.anchorNode&&m.focusNode){const x=Ht(m.focusNode),y=x&&!e.isParentOf(x),v=Ht(m.anchorNode),b=v&&e.isParentOf(v);if(y&&b&&m.rangeCount>0){const w=oA(m,n);w&&(w.anchor.set(e.getKey(),h.isBackward()?e.getChildrenSize():0,"element"),m.removeAllRanges(),Ge(w))}}}return h&&!h.is(g)&&(Ve(h)||Ve(g))&&s.tableSelection&&!s.tableSelection.is(g)?(Ve(h)&&h.tableKey===s.tableNodeKey?s.$updateTableTableSelection(h):!Ve(h)&&Ve(g)&&g.tableKey===s.tableNodeKey&&s.$updateTableTableSelection(null),!1):(s.hasHijackedSelectionStyles&&!e.isSelected()?(function(m,x){x.$enableHighlightStyle(),Yh(x.table,y=>{const v=y.elem;y.highlighted=!1,Qw(m,y),v.getAttribute("style")||v.removeAttribute("style")})})(n,s):!s.hasHijackedSelectionStyles&&e.isSelected()&&Zy(n,s),!1)},$t)),s.listenersToRemove.add(n.registerCommand(Co,()=>{const h=Y();if(!W(h)||!h.isCollapsed()||!Fn(h,e))return!1;const g=Qy(n,h,e);return!!g&&(Jy(g,e),!0)},$t)),s}function Yy(e){return e[rf]||null}function Ml(e){let t=e;for(;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const r=t._cell;return r===void 0?null:r}t=t.parentNode}return null}function Xy(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;const o=r.nodeName;o!=="TD"&&o!=="TH"||(n=r._cell||null)}return null}function vi(e,t){const n=[],r={columns:0,domRows:n,rows:0};let o=Ao(e,t).querySelector("tr"),i=0,s=0;for(n.length=0;o!=null;){const a=o.nodeName;if(a==="TD"||a==="TH"){const u={elem:o,hasBackgroundColor:o.style.backgroundColor!=="",highlighted:!1,x:i,y:s};o._cell=u;let f=n[s];f===void 0&&(f=n[s]=[]),f[i]=u}else{const u=o.firstChild;if(u!=null){o=u;continue}}const l=o.nextSibling;if(l!=null){i++,o=l;continue}const c=o.parentNode;if(c!=null){const u=c.nextSibling;if(u==null)break;s++,i=0,o=u}}return r.columns=i+1,r.rows=s+1,r}function Ma(e,t,n){const r=new Set(n?n.getNodes():[]);Yh(t,(o,i)=>{const s=o.elem;r.has(i)?(o.highlighted=!0,Jw(e,o)):(o.highlighted=!1,Qw(e,o),s.getAttribute("style")||s.removeAttribute("style"))})}function Yh(e,t){const{domRows:n}=e;for(let r=0;r<n.length;r++){const o=n[r];if(o)for(let i=0;i<o.length;i++){const s=o[i];if(!s)continue;const a=Ht(s.elem);a!==null&&t(s,a,{x:i,y:r})}}}function Zy(e,t){t.$disableHighlightStyle(),Yh(t.table,n=>{n.highlighted=!0,Jw(e,n)})}const gP=(e,t,n,r,o)=>{const i=o==="forward";switch(o){case"backward":case"forward":return n!==(i?e.table.columns-1:0)?Pa(t.getCellNodeFromCordsOrThrow(n+(i?1:-1),r,e.table),i):r!==(i?e.table.rows-1:0)?Pa(t.getCellNodeFromCordsOrThrow(i?0:e.table.columns-1,r+(i?1:-1),e.table),i):i?t.selectNext():t.selectPrevious(),!0;case"up":return r!==0?Pa(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1):t.selectPrevious(),!0;case"down":return r!==e.table.rows-1?Pa(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0):t.selectNext(),!0;default:return!1}};function lu(e,t){let n,r;if(t.startColumn===e.minColumn)n="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n="maxColumn"}if(t.startRow===e.minRow)r="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r="maxRow"}return[n,r]}function Na([e,t]){return[e==="minColumn"?"maxColumn":"minColumn",t==="minRow"?"maxRow":"minRow"]}function Ko(e,t,[n,r]){const o=t[r],i=e[o];i===void 0&&de(250,r,String(o));const s=t[n],a=i[s];return a===void 0&&de(250,n,String(s)),a}function pP(e,t,n,r,o){const i=Al(t,n,r),s=(function(_,E){const{minColumn:T,maxColumn:k,minRow:P,maxRow:O}=E;let D=1,I=1,$=1,H=1;const U=_[P],L=_[O];for(let N=T;N<=k;N++)D=Math.max(D,U[N].cell.__rowSpan),H=Math.max(H,L[N].cell.__rowSpan);for(let N=P;N<=O;N++)I=Math.max(I,_[N][T].cell.__colSpan),$=Math.max($,_[N][k].cell.__colSpan);return{bottomSpan:H,leftSpan:I,rightSpan:$,topSpan:D}})(t,i),{topSpan:a,leftSpan:l,bottomSpan:c,rightSpan:u}=s,f=(function(_,E){const T=lu(_,E);return T===null&&de(249,E.cell.getKey()),T})(i,n),[d,h]=Na(f);let g=i[d],p=i[h];o==="forward"?g+=d==="maxColumn"?1:l:o==="backward"?g-=d==="minColumn"?1:u:o==="down"?p+=h==="maxRow"?1:a:o==="up"&&(p-=h==="minRow"?1:c);const m=t[p];if(m===void 0)return!1;const x=m[g];if(x===void 0)return!1;const[y,v]=(function(_,E,T){const k=Al(_,E,T),P=lu(k,E);if(P)return[Ko(_,k,P),Ko(_,k,Na(P))];const O=lu(k,T);if(O)return[Ko(_,k,Na(O)),Ko(_,k,O)];const D=["minColumn","minRow"];return[Ko(_,k,D),Ko(_,k,Na(D))]})(t,n,x),b=lo(e,y.cell),w=lo(e,v.cell);return e.$setAnchorCellForSelection(b),e.$setFocusCellForSelection(w,!0),!0}function Fn(e,t){if(W(e)||Ve(e)){const n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function Pa(e,t){t?e.selectStart():e.selectEnd()}function Jw(e,t){const n=t.elem,r=e._config.theme;ge(Ht(n))||de(131),Qe(n,r.tableCellSelected)}function Qw(e,t){const n=t.elem;ge(Ht(n))||de(131);const r=e._config.theme;Un(n,r.tableCellSelected)}function ns(e){const t=we(e,ge);return ge(t)?t:null}function xi(e){const t=we(e,Xe);return Xe(t)?t:null}function mP(e,t,n,r,o,i,s){const a=En(n.focus,o?"previous":"next");if($h(a))return!1;let l=a;for(const m of Os(a).iterNodeCarets("shadowRoot")){if(!jr(m)||!B(m.origin))return!1;l=m}const c=l.getParentAtCaret();if(!ge(c))return!1;const u=c,f=(function(m){for(const x of Os(m).iterNodeCarets("root")){const{origin:y}=x;if(ge(y)){if(jt(x))return Nt(y,m.direction)}else if(!et(y))break}return null})(tt(u,l.direction)),d=we(u,Xe);if(!d||!d.is(i))return!1;const h=e.getElementByKey(u.getKey()),g=Ml(h);if(!h||!g)return!1;const p=vP(e,d);if(s.table=p,f)if(r==="extend"){const m=Ml(e.getElementByKey(f.origin.getKey()));if(!m)return!1;s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(m,!0)}else{const m=Mt(f);bn(n.anchor,m),bn(n.focus,m)}else if(r==="extend")s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(g,!0);else{const m=(function(x){const y=Qs(x);return jt(y)?Mt(y):x})(tt(d,a.direction));bn(n.anchor,m),bn(n.focus,m)}return lr(t),!0}function eC(e,t,n,r,o){if((n==="up"||n==="down")&&(function(s){const a=s.getRootElement();return a?a.hasAttribute("aria-controls")&&a.getAttribute("aria-controls")==="typeahead-menu":!1})(e))return!1;const i=Y();if(!Fn(i,r)){if(W(i)){if(n==="backward"){if(i.focus.offset>0)return!1;const s=(function(l){for(let c=l,u=l;u!==null;c=u,u=u.getParent())if(B(u)){if(u!==c&&u.getFirstChild()!==c)return null;if(!u.isInline())return u}return null})(i.focus.getNode());if(!s)return!1;const a=s.getPreviousSibling();return!!Xe(a)&&(lr(t),t.shiftKey?i.focus.set(a.getParentOrThrow().getKey(),a.getIndexWithinParent(),"element"):a.selectEnd(),!0)}if(t.shiftKey&&(n==="up"||n==="down")){const s=i.focus.getNode();if(!i.isCollapsed()&&(n==="up"&&!i.isBackward()||n==="down"&&i.isBackward())){let a=we(s,d=>Xe(d));if(ge(a)&&(a=we(a,Xe)),a!==r||!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(!l)return!1;let c=0;n==="up"&&B(l)&&(c=l.getChildrenSize());let u=l;n==="up"&&B(l)&&(u=l.getLastChild()||l,c=X(u)?u.getTextContentSize():0);const f=i.clone();return f.focus.set(u.getKey(),c,X(u)?"text":"element"),Ge(f),lr(t),!0}if(pt(s)){const a=n==="up"?i.getNodes()[i.getNodes().length-1]:i.getNodes()[0];if(a&&Cs(r,a)!==null){const l=r.getFirstDescendant(),c=r.getLastDescendant();if(!l||!c)return!1;const[u]=jn(l),[f]=jn(c),d=r.getCordsFromCellNode(u,o.table),h=r.getCordsFromCellNode(f,o.table),g=r.getDOMCellFromCordsOrThrow(d.x,d.y,o.table),p=r.getDOMCellFromCordsOrThrow(h.x,h.y,o.table);return o.$setAnchorCellForSelection(g),o.$setFocusCellForSelection(p,!0),!0}return!1}{let a=we(s,c=>B(c)&&!c.isInline());if(ge(a)&&(a=we(a,Xe)),!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(Xe(l)&&o.tableNodeKey===l.getKey()){const c=l.getFirstDescendant(),u=l.getLastDescendant();if(!c||!u)return!1;const[f]=jn(c),[d]=jn(u),h=i.clone();return h.focus.set((n==="up"?f:d).getKey(),n==="up"?0:d.getChildrenSize(),"element"),lr(t),Ge(h),!0}}}}return n==="down"&&Nl(e)&&o.setShouldCheckSelection(),!1}if(W(i)){if(n==="backward"||n==="forward")return mP(e,t,i,t.shiftKey?"extend":"move",n==="backward",r,o);if(i.isCollapsed()){const{anchor:s,focus:a}=i,l=we(s.getNode(),ge),c=we(a.getNode(),ge);if(!ge(l)||!l.is(c))return!1;const u=xi(l);if(u!==r&&u!=null){const x=Ao(u,e.getElementByKey(u.getKey()));if(x!=null)return o.table=vi(u,x),eC(e,t,n,u,o)}const f=e.getElementByKey(l.__key),d=e.getElementByKey(s.key);if(d==null||f==null)return!1;let h;if(s.type==="element")h=d.getBoundingClientRect();else{const x=Lt(qh(e));if(x===null||x.rangeCount===0)return!1;h=x.getRangeAt(0).getBoundingClientRect()}const g=n==="up"?l.getFirstChild():l.getLastChild();if(g==null)return!1;const p=e.getElementByKey(g.__key);if(p==null)return!1;const m=p.getBoundingClientRect();if(n==="up"?m.top>h.top-h.height:h.bottom+h.height>m.bottom){lr(t);const x=r.getCordsFromCellNode(l,o.table);if(!t.shiftKey)return gP(o,r,x.x,x.y,n);{const y=r.getDOMCellFromCordsOrThrow(x.x,x.y,o.table);o.$setAnchorCellForSelection(y),o.$setFocusCellForSelection(y,!0)}return!0}}}else if(Ve(i)){const{anchor:s,focus:a}=i,l=we(s.getNode(),ge),c=we(a.getNode(),ge),[u]=i.getNodes();Xe(u)||de(251);const f=Ao(u,e.getElementByKey(u.getKey()));if(!ge(l)||!ge(c)||!Xe(u)||f==null)return!1;o.$updateTableTableSelection(i);const d=vi(u,f),h=r.getCordsFromCellNode(l,d),g=r.getDOMCellFromCordsOrThrow(h.x,h.y,d);if(o.$setAnchorCellForSelection(g),lr(t),t.shiftKey){const[p,m,x]=on(r,l,c);return pP(o,p,m,x,n)}return c.selectEnd(),!0}return!1}function lr(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Jy(e,t,n){const r=ye();e==="first"?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function Qy(e,t,n){const r=n.getParent();if(!r)return;const o=Lt(qh(e));if(!o)return;const i=o.anchorNode,s=e.getElementByKey(r.getKey()),a=Ao(n,e.getElementByKey(n.getKey()));if(!i||!s||!a||!s.contains(i)||a.contains(i))return;const l=we(t.anchor.getNode(),y=>ge(y));if(!l)return;const c=we(l,y=>Xe(y));if(!Xe(c)||!c.is(n))return;const[u,f]=on(n,l,l),d=u[0][0],h=u[u.length-1][u[0].length-1],{startRow:g,startColumn:p}=f,m=g===d.startRow&&p===d.startColumn,x=g===h.startRow&&p===h.startColumn;return m?"first":x?"last":void 0}function lo(e,t){const{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function of(e,t,n){return Cs(e,Ht(t,n))}function ev(e,t,n){if(!t.theme.tableAlignment)return;const r=[],o=[];for(const i of["center","right"]){const s=t.theme.tableAlignment[i];s&&(i===n?o:r).push(s)}Un(e,...r),Qe(e,...o)}const sf=new WeakSet;function Nl(e=Bi()){return sf.has(e)}function yP(e,t){t?sf.add(e):sf.delete(e)}class An extends St{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(t){const n=this.getWritable();return n.__colWidths=t,n}static clone(t){return new An(t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__colWidths=t.__colWidths,this.__rowStriping=t.__rowStriping,this.__frozenColumnCount=t.__frozenColumnCount,this.__frozenRowCount=t.__frozenRowCount}static importDOM(){return{table:t=>({conversion:xP,priority:1})}}static importJSON(t){return ac().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setRowStriping(t.rowStriping||!1).setFrozenColumns(t.frozenColumnCount||0).setFrozenRows(t.frozenRowCount||0).setColWidths(t.colWidths)}constructor(t){super(t),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(t,n,r){return r==="html"}getDOMSlot(t){const n=ti(t)?t:t.querySelector("table");return ti(n)||de(229),super.getDOMSlot(t).withElement(n).withAfter(n.querySelector("colgroup"))}createDOM(t,n){const r=document.createElement("table");this.__style&&(r.style.cssText=this.__style);const o=document.createElement("colgroup");if(r.appendChild(o),EA(o),Qe(r,t.theme.table),this.updateTableElement(null,r,t),Nl(n)){const i=document.createElement("div"),s=t.theme.tableScrollableWrapper;return s?Qe(i,s):i.style.cssText="overflow-x: auto;",i.appendChild(r),this.updateTableWrapper(null,i,r,t),i}return r}updateTableWrapper(t,n,r,o){this.__frozenColumnCount!==(t?t.__frozenColumnCount:0)&&(function(i,s,a,l){l>0?(Qe(i,a.theme.tableFrozenColumn),s.setAttribute("data-lexical-frozen-column","true")):(Un(i,a.theme.tableFrozenColumn),s.removeAttribute("data-lexical-frozen-column"))})(n,r,o,this.__frozenColumnCount),this.__frozenRowCount!==(t?t.__frozenRowCount:0)&&(function(i,s,a,l){l>0?(Qe(i,a.theme.tableFrozenRow),s.setAttribute("data-lexical-frozen-row","true")):(Un(i,a.theme.tableFrozenRow),s.removeAttribute("data-lexical-frozen-row"))})(n,r,o,this.__frozenRowCount)}updateTableElement(t,n,r){this.__style!==(t?t.__style:"")&&(n.style.cssText=this.__style),this.__rowStriping!==(!!t&&t.__rowStriping)&&(function(o,i,s){s?(Qe(o,i.theme.tableRowStriping),o.setAttribute("data-lexical-row-striping","true")):(Un(o,i.theme.tableRowStriping),o.removeAttribute("data-lexical-row-striping"))})(n,r,this.__rowStriping),(function(o,i,s,a){const l=o.querySelector("colgroup");if(!l)return;const c=[];for(let u=0;u<s;u++){const f=document.createElement("col"),d=a&&a[u];d&&(f.style.width=`${d}px`),c.push(f)}l.replaceChildren(...c)})(n,0,this.getColumnCount(),this.getColWidths()),ev(n,r,this.getFormatType())}updateDOM(t,n,r){const o=this.getDOMSlot(n).element;return n===o===Nl()||(Be(i=n)&&i.nodeName==="DIV"&&this.updateTableWrapper(t,n,o,r),this.updateTableElement(t,o,r),!1);var i}exportDOM(t){const n=super.exportDOM(t),{element:r}=n;return{after:o=>{if(n.after&&(o=n.after(o)),!ti(o)&&Be(o)&&(o=o.querySelector("table")),!ti(o))return null;ev(o,t._config,this.getFormatType());const[i]=Mr(this,null,null),s=new Map;for(const u of i)for(const f of u){const d=f.cell.getKey();s.has(d)||s.set(d,{colSpan:f.cell.getColSpan(),startColumn:f.startColumn})}const a=new Set;for(const u of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){const f=u.getAttribute("data-temporary-table-cell-lexical-key");if(f){const d=s.get(f);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),d){s.delete(f);for(let h=0;h<d.colSpan;h++)a.add(h+d.startColumn)}}}const l=o.querySelector(":scope > colgroup");if(l){const u=Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((f,d)=>a.has(d));l.replaceChildren(...u)}const c=o.querySelectorAll(":scope > tr");if(c.length>0){const u=document.createElement("tbody");for(const f of c)u.appendChild(f);o.append(u)}return o},element:!ti(r)&&Be(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,n){const{rows:r,domRows:o}=n;for(let i=0;i<r;i++){const s=o[i];if(s!=null)for(let a=0;a<s.length;a++){const l=s[a];if(l==null)continue;const{elem:c}=l,u=of(this,c);if(u!==null&&t.is(u))return{x:a,y:i}}}throw new Error("Cell not found in table.")}getDOMCellFromCords(t,n,r){const{domRows:o}=r,i=o[n];if(i==null)return null;const s=i[t<i.length?t:i.length-1];return s??null}getDOMCellFromCordsOrThrow(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(!o)throw new Error("Cell not found at cords.");return o}getCellNodeFromCords(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(o==null)return null;const i=Ht(o.elem);return ge(i)?i:null}getCellNodeFromCordsOrThrow(t,n,r){const o=this.getCellNodeFromCords(t,n,r);if(!o)throw new Error("Node at cords not TableCellNode.");return o}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(t){const n=this.getWritable();return n.__rowStriping=t,n}setFrozenColumns(t){const n=this.getWritable();return n.__frozenColumnCount=t,n}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(t){const n=this.getWritable();return n.__frozenRowCount=t,n}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){const t=this.getFirstChild();if(!t)return 0;let n=0;return t.getChildren().forEach(r=>{ge(r)&&(n+=r.getColSpan())}),n}}function vP(e,t){const n=e.getElementByKey(t.getKey());return n===null&&de(230),vi(t,n)}function xP(e){const t=ac();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&t.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&t.setFrozenRows(1);const n=e.querySelector(":scope > colgroup");if(n){let r=[];for(const o of n.querySelectorAll(":scope > col")){let i=o.style.width||"";if(!Uh.test(i)&&(i=o.getAttribute("width")||"",!/^\d+$/.test(i))){r=void 0;break}r.push(parseFloat(i))}r&&t.setColWidths(r)}return{after:r=>ew(r,et),node:t}}function ac(){return _t(new An)}function Xe(e){return e instanceof An}function bP(e){et(e.getParent())?e.isEmpty()&&e.append(ye()):e.remove()}function wP(e){Xe(e.getParent())?J1(e,ge):e.remove()}function CP(e){J1(e,et);const[t]=Mr(e,null,null),n=t.reduce((s,a)=>Math.max(s,a.length),0),r=e.getChildren();for(let s=0;s<t.length;++s){const a=r[s];if(!a)continue;et(a)||de(254,a.constructor.name,a.getType());const l=t[s].reduce((c,u)=>u?1+c:c,0);if(l!==n)for(let c=l;c<n;++c){const u=ln();u.append(ye()),a.append(u)}}const o=e.getColWidths(),i=e.getColumnCount();if(o&&o.length!==i){let s;if(i<o.length)s=o.slice(0,i);else if(o.length>0){const a=o[o.length-1];s=[...o,...Array(i-o.length).fill(a)]}e.setColWidths(s)}}function SP(e){if(e.detail<3||!xn(e.target))return!1;const t=Ht(e.target);if(t===null)return!1;const n=we(t,r=>B(r)&&!r.isInline());return n===null?!1:!!ge(n.getParent())&&(n.select(0),!0)}function _P(e){return e.registerNodeTransform(kn,t=>{if(t.getColSpan()>1||t.getRowSpan()>1){const[,,n]=jn(t),[r]=on(n,t,t),o=r.length,i=r[0].length;let s=n.getFirstChild();et(s)||de(175);const a=[];for(let l=0;l<o;l++){l!==0&&(s=s.getNextSibling(),et(s)||de(175));let c=null;for(let u=0;u<i;u++){const f=r[l][u],d=f.cell;if(f.startRow===l&&f.startColumn===u)c=d,a.push(d);else if(d.getColSpan()>1||d.getRowSpan()>1){ge(d)||de(176);const h=ln(d.__headerState);c!==null?c.insertAfter(h):YA(s,h)}}}for(const l of a)l.setColSpan(1),l.setRowSpan(1)}})}function TP(e,t=!0){const n=new Map,r=(i,s,a)=>{const l=Ao(i,a),c=hP(i,l,e,t);n.set(s,[c,l])},o=e.registerMutationListener(An,i=>{e.getEditorState().read(()=>{for(const[s,a]of i){const l=n.get(s);if(a==="created"||a==="updated"){const{tableNode:c,tableElement:u}=Zw(s);l===void 0?r(c,s,u):u!==l[1]&&(l[0].removeListeners(),n.delete(s),r(c,s,u))}else a==="destroyed"&&l!==void 0&&(l[0].removeListeners(),n.delete(s))}},{editor:e})},{skipInitialization:!1});return()=>{o();for(const[,[i]]of n)i.removeListeners()}}function EP(e,t){e.hasNodes([An])||de(255);const{hasNestedTables:n=rw(!1)}=t??{};return Rn(e.registerCommand(qw,r=>(function({rows:o,columns:i,includeHeaders:s},a){const l=Y()||qn();if(!l||!W(l)||!a&&xi(l.anchor.getNode()))return!1;const c=QN(Number(o),Number(i),s);GA(c);const u=c.getFirstDescendant();return X(u)&&u.select(),!0})(r,n.peek()),be),e.registerCommand(sh,({nodes:r,selection:o},i)=>n.peek()||e!==i||!W(o)?!1:xi(o.anchor.getNode())!==null&&r.some(Xe),be),e.registerCommand(Hl,SP,be),e.registerNodeTransform(An,CP),e.registerNodeTransform(Br,wP),e.registerNodeTransform(kn,bP))}function RP({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:n=!0,hasHorizontalScroll:r=!1,hasNestedTables:o=!1}){const[i]=it();S.useEffect(()=>{Nl(i)!==r&&(yP(i,r),i.registerNodeTransform(An,()=>{})())},[i,r]);const s=S.useMemo(()=>rw(!1),[]);return s.peek()!==o&&(s.value=o),S.useEffect(()=>EP(i,{hasNestedTables:s}),[i,s]),S.useEffect(()=>TP(i,n),[i,n]),S.useEffect(()=>{if(!e)return _P(i)},[i,e]),S.useEffect(()=>{if(!t)return i.registerNodeTransform(kn,a=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})},[i,t,e]),null}var cu,tv;function tC(){if(tv)return cu;tv=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return cu=e,cu}var uu,nv;function kP(){if(nv)return uu;nv=1;var e=typeof Dn=="object"&&Dn&&Dn.Object===Object&&Dn;return uu=e,uu}var du,rv;function nC(){if(rv)return du;rv=1;var e=kP(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return du=n,du}var fu,ov;function AP(){if(ov)return fu;ov=1;var e=nC(),t=function(){return e.Date.now()};return fu=t,fu}var hu,iv;function MP(){if(iv)return hu;iv=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return hu=t,hu}var gu,sv;function NP(){if(sv)return gu;sv=1;var e=MP(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return gu=n,gu}var pu,av;function rC(){if(av)return pu;av=1;var e=nC(),t=e.Symbol;return pu=t,pu}var mu,lv;function PP(){if(lv)return mu;lv=1;var e=rC(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function i(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[o]=l:delete s[o]),u}return mu=i,mu}var yu,cv;function LP(){if(cv)return yu;cv=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return yu=n,yu}var vu,uv;function FP(){if(uv)return vu;uv=1;var e=rC(),t=PP(),n=LP(),r="[object Null]",o="[object Undefined]",i=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?o:r:i&&i in Object(a)?t(a):n(a)}return vu=s,vu}var xu,dv;function $P(){if(dv)return xu;dv=1;function e(t){return t!=null&&typeof t=="object"}return xu=e,xu}var bu,fv;function OP(){if(fv)return bu;fv=1;var e=FP(),t=$P(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return bu=r,bu}var wu,hv;function IP(){if(hv)return wu;hv=1;var e=NP(),t=tC(),n=OP(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=t(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=i.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):o.test(c)?r:+c}return wu=l,wu}var Cu,gv;function DP(){if(gv)return Cu;gv=1;var e=tC(),t=AP(),n=IP(),r="Expected a function",o=Math.max,i=Math.min;function s(a,l,c){var u,f,d,h,g,p,m=0,x=!1,y=!1,v=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(c)&&(x=!!c.leading,y="maxWait"in c,d=y?o(n(c.maxWait)||0,l):d,v="trailing"in c?!!c.trailing:v);function b(I){var $=u,H=f;return u=f=void 0,m=I,h=a.apply(H,$),h}function w(I){return m=I,g=setTimeout(T,l),x?b(I):h}function _(I){var $=I-p,H=I-m,U=l-$;return y?i(U,d-H):U}function E(I){var $=I-p,H=I-m;return p===void 0||$>=l||$<0||y&&H>=d}function T(){var I=t();if(E(I))return k(I);g=setTimeout(T,_(I))}function k(I){return g=void 0,v&&u?b(I):(u=f=void 0,h)}function P(){g!==void 0&&clearTimeout(g),m=0,u=p=f=g=void 0}function O(){return g===void 0?h:k(t())}function D(){var I=t(),$=E(I);if(u=arguments,f=this,p=I,$){if(g===void 0)return w(p);if(y)return clearTimeout(g),g=setTimeout(T,l),b(p)}return g===void 0&&(g=setTimeout(T,l)),h}return D.cancel=P,D.flush=O,D}return Cu=s,Cu}var jP=DP();const VP=Cf(jP),BP=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M1.61342 8.47549C1.52262 8.33173 1.47723 8.25985 1.45182 8.14898C1.43273 8.06571 1.43273 7.93437 1.45182 7.8511C1.47723 7.74023 1.52262 7.66835 1.61341 7.52459C2.36369 6.3366 4.59693 3.33337 8.00027 3.33337C11.4036 3.33337 13.6369 6.3366 14.3871 7.52459C14.4779 7.66835 14.5233 7.74023 14.5487 7.8511C14.5678 7.93437 14.5678 8.06571 14.5487 8.14898C14.5233 8.25985 14.4779 8.33173 14.3871 8.47549C13.6369 9.66348 11.4036 12.6667 8.00027 12.6667C4.59693 12.6667 2.36369 9.66348 1.61342 8.47549Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M8.00027 10C9.10484 10 10.0003 9.10461 10.0003 8.00004C10.0003 6.89547 9.10484 6.00004 8.00027 6.00004C6.8957 6.00004 6.00027 6.89547 6.00027 8.00004C6.00027 9.10461 6.8957 10 8.00027 10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),oC=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M16 6V5.2C16 4.0799 16 3.51984 15.782 3.09202C15.5903 2.71569 15.2843 2.40973 14.908 2.21799C14.4802 2 13.9201 2 12.8 2H11.2C10.0799 2 9.51984 2 9.09202 2.21799C8.71569 2.40973 8.40973 2.71569 8.21799 3.09202C8 3.51984 8 4.0799 8 5.2V6M10 11.5V16.5M14 11.5V16.5M3 6H21M19 6V17.2C19 18.8802 19 19.7202 18.673 20.362C18.3854 20.9265 17.9265 21.3854 17.362 21.673C16.7202 22 15.8802 22 14.2 22H9.8C8.11984 22 7.27976 22 6.63803 21.673C6.07354 21.3854 5.6146 20.9265 5.32698 20.362C5 19.7202 5 18.8802 5 17.2V6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));function iC(e){return e instanceof Mo}function sC(e){return new Mo(e)}const{color:Ai,cornerRadius:zP,spacing:HP,transition:WP}=j,KP=R.css({display:"inline-flex",color:Ai.text.accent,textDecoration:"underline",cursor:"pointer"}),UP=R.css({color:Ai.text.accent,":hover":{color:Ai.text.accentHover}}),GP=R.css({width:"16px",height:"16px",color:Ai.icon.negative,cursor:"pointer",transition:WP.general,":hover":{color:Ai.icon.negativeHover}}),qP=R.css({boxShadow:`0 2px 10px 4px ${Ai.effect.shadowL}`,borderRadius:zP.md,padding:HP.sm});function YP({url:e,text:t,nodeKey:n}){const[r]=it(),{isEditable:o}=Ks(),i=S.useCallback(()=>{r.update(()=>{const s=Le(n);iC(s)&&s.remove()})},[r,n]);return C.jsx(Pr,{content:C.jsxs(G,{flex:!0,row:!0,center:!0,gap:"var(--spacing-xs)",children:[C.jsx("a",{className:UP,target:"_blank",href:e,children:e}),o&&C.jsx(oC,{className:GP,onClick:i})]}),placement:"right-start",trigger:"hover",contentClassName:qP,children:C.jsx(se,{className:KP,children:t})})}const Su="custom-link-node";class Mo extends Ys{_url;_text;constructor({url:t,text:n},r){super(r),this._url=t,this._text=n}getType(){return Su}getData(){return{url:this._url,text:this._text}}isInline(){return!0}isIsolated(){return!1}createDOM(){const t=document.createElement("span");return t.style.display="inline",t}updateDOM(){return!1}decorate(){return C.jsx(YP,{...this.getData(),nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:Su,version:1,text:this._text,url:this._url}}static importJSON(t){return new Mo({url:t.url,text:t.text})}static getType(){return Su}static clone(t){return new Mo({url:t._url,text:t._text},t.__key)}}const XP={type:"text-match",dependencies:[Mo],regExp:/\[([^\]]+)]\(([^)]+)\)/,trigger:")",importRegExp:/\[([^\]]+)]\(([^)]+)\)/,replace:(e,t)=>{const[,n,r]=t,o=sC({url:r,text:n});e.replace(o)},export:e=>{if(!iC(e))return null;const{text:n,url:r}=e.getData();return!r||!n?"":`[${n}](${r})`}},pv="image-row",ZP=R.css({width:"fit-content",display:"flex",alignItems:"center"});function aC(e){return e.length?new zr(e):null}function lC(e){return e instanceof zr}const{color:af,cornerRadius:cC,spacing:JP,transition:QP}=j,e6=R.css({width:"100px",height:"100px",objectFit:"cover",borderRadius:cC.md}),t6=R.css({width:"20px",height:"20px",color:af.icon.negative,cursor:"pointer",transition:QP.general,":hover":{color:af.icon.negativeHover}}),n6=R.css({boxShadow:`0 2px 10px 4px ${af.effect.shadowL}`,borderRadius:cC.xs,padding:JP.xs}),{spacing:r6}=j;function o6({images:e,nodeKey:t}){const[n]=it(),{isEditable:r}=Ks(),o=S.useCallback(()=>{n.update(()=>{const i=Le(t);lC(i)&&i.remove()})},[n,t]);return C.jsx(Pr,{open:r?void 0:!1,content:C.jsx(oC,{className:t6,onClick:o}),placement:"right-start",trigger:"hover",contentClassName:n6,children:C.jsx(G,{w:"full",flex:!0,row:!0,gap:r6.sm,alignItems:"center",children:e.map(({src:i,alt:s})=>C.jsx("img",{src:i,alt:s??"",className:e6},i))})})}class zr extends Ys{images;constructor(t,n){super(n),this.images=t}createDOM(){const t=document.createElement("div");return t.className=ZP,t.contentEditable="false",t}updateDOM(){return!1}decorate(){return C.jsx(o6,{images:this.images,nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:pv,version:1,images:this.images}}static importJSON(t){return new zr(t.images)}isInline(){return!1}isIsolated(){return!0}isSelectable(){return!0}static getType(){return pv}static clone(t){return new zr(t.images,t.__key)}}const i6={type:"element",dependencies:[zr],regExp:/^!\[[^\]]*]\([^)]+\)(?:\s+!\[[^\]]*]\([^)]+\))*$/,replace:(e,t,n)=>{const[r]=n,i=[...r.matchAll(/!\[([^\]]*)]\(([^)]+)\)/g)].map(([a,l,c])=>({alt:l,src:c})),s=aC(i);s&&yh([s])},export:e=>{if(!(e instanceof zr))return null;const n=e.images;return n.length?n.map(({src:r,alt:o})=>`![${o}](${r})`).join(" "):""}},s6=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",null,M.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",fill:"currentColor"}),M.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",fill:"currentColor"}),M.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",fill:"currentColor"}),M.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),M.createElement("defs",null)),{color:mv}=j,a6=R.css({cursor:"pointer"}),l6=R.css({":hover":{backgroundColor:mv.fill.bgSecondary},":active":{backgroundColor:mv.fill.bgSecondary}}),{color:yv,spacing:vv}=j;function c6({groups:e,toolbarVisibleActionsCount:t,onAction:n,disabled:r}){const[o,i]=S.useState(!1),s=S.useCallback(c=>()=>{r||(c&&c(),i(!1))},[r]),a=S.useCallback(({IconComponent:c,...u},f)=>C.jsxs(G,{className:R.cx(a6,!r&&l6),p:vv.sm,alignItems:"center",flex:!0,row:!0,gap:vv.xs,onClick:s(()=>n(u.id,f)),children:[C.jsx(c,{width:20,height:20,color:yv.icon.tertiary}),C.jsx(se,{variant:"body-2",children:u.label})]},u.id),[r,n,s]),l=S.useMemo(()=>e.map((c,u)=>{const f=u===e.length-1;if(!c.length)return null;const d=c.map((h,g)=>{const m=(u?e.slice(0,u).flat().length:0)+g+t;return a(h,m)});return C.jsxs(S.Fragment,{children:[d,f?null:C.jsx(G,{w:"full",h:1,backgroundColor:yv.border.neutralAlphaBasic})]},c.flatMap(h=>h.id).join("-"))}),[e,a,t]);return C.jsx(Pr,{content:C.jsx(G,{flex:!0,children:l}),placement:"bottom",open:o,onChange:i,children:C.jsx(fr,{size:"xs",color:"no-bg",disabled:r,children:C.jsx(s6,{})})})}const u6=R.css({minWidth:"fit-content"}),d6=e=>{throw new Error("defaultOnImagesUpload function must be overridden")},{spacing:xv}=j;function bv({onSave:e}){const[t,n]=S.useState(""),[r,o]=S.useState(""),[i,s]=S.useState(null),a=Us(),{textPlaceholder:l,linkPlaceholder:c,linkErrorText:u,buttonText:f}=a.toolbar.link,d=S.useMemo(()=>i==="link"?u:null,[i,u]),h=S.useCallback(v=>{try{const b=new URL(v);if(!(b.protocol==="http:"||b.protocol==="https:"))throw new Error("Invalid protocol");return s(null),!0}catch{return s("link"),!1}},[]),g=S.useCallback(v=>{n(v.target.value)},[]),p=S.useCallback(v=>{h(v.target.value),o(v.target.value)},[h]),m=S.useCallback(()=>[()=>h(r)].map(w=>w()).every(Boolean),[r,h]),x=S.useCallback(()=>{n(""),o(""),s(null)},[]),y=S.useCallback(v=>{v.preventDefault(),m()&&(e({text:t||r,url:r}),x())},[r,e,t,m,x]);return S.useEffect(()=>()=>{x()},[]),C.jsx("form",{onSubmit:y,children:C.jsxs(G,{flex:!0,alignItems:"flex-start",p:xv.sm,gap:xv.sm,children:[C.jsx(G,{children:C.jsx(_i,{placeholder:l,size:"sm",value:t,onChange:g})}),C.jsx(G,{children:C.jsx(_i,{placeholder:c,size:"sm",value:r,onChange:p,error:!!d,errorText:d||""})}),C.jsx(Si,{size:"xs",width:"auto",type:"submit",children:f})]})})}const wv=50,Cv=20,Sv=1,_v=1;function Tv({onSave:e}){const[t,n]=S.useState(""),[r,o]=S.useState(""),[i,s]=S.useState(null),[a,l]=S.useState(null),c=Us(),{maxRowsErrorText:u,maxColumnsErrorText:f,minRowsErrorText:d,minColumnsErrorText:h,rowsPlaceholder:g,columnsPlaceholder:p,buttonText:m}=c.toolbar.table,x=S.useMemo(()=>{switch(i){case"rows-max":return u({current:Number(t),limit:wv});case"rows-min":return d({current:Number(t),limit:Sv});default:return null}},[i,t,u,d]),y=S.useMemo(()=>{switch(a){case"columns-max":return f({current:Number(r),limit:Cv});case"columns-min":return h({current:Number(r),limit:_v});default:return null}},[a,r,f,h]),v=S.useCallback(O=>{try{const D=Number(O);if(D>wv)throw s("rows-max"),new Error("Rows amount exceeds maximum");if(D<Sv)throw s("rows-min"),new Error("Rows amount below minimum");return s(null),!0}catch{return!1}},[]),b=S.useCallback(O=>{try{const D=Number(O);if(D>Cv)throw l("columns-max"),new Error("Columns amount exceeds maximum");if(D<_v)throw l("columns-min"),new Error("Columns amount below minimum");return l(null),!0}catch{return!1}},[]),w=S.useCallback(O=>{const D=Number(O);return!Number.isNaN(D)&&Number.isInteger(D)?D:null},[]),_=S.useCallback(O=>{const D=O.target.value,I=w(D);typeof I=="number"&&(v(D),n(String(I)))},[v,w]),E=S.useCallback(O=>{const D=O.target.value,I=w(D);typeof I=="number"&&(b(D),o(String(I)))},[b,w]),T=S.useCallback(()=>[()=>v(t),()=>b(r)].map(I=>I()).every(Boolean),[r,t,b,v]),k=S.useCallback(()=>{n(""),o(""),s(null),l(null)},[]),P=S.useCallback(O=>{O.preventDefault(),T()&&(e({rows:t,columns:r}),k())},[r,e,t,T,k]);return S.useEffect(()=>()=>{k()},[]),C.jsx("form",{onSubmit:P,children:C.jsxs(G,{flex:!0,alignItems:"flex-start",p:"var(--spacing-sm)",gap:"var(--spacing-sm)",children:[C.jsx(G,{children:C.jsx(_i,{placeholder:g,size:"sm",value:t,onChange:_,error:!!x,errorText:x||""})}),C.jsx(G,{children:C.jsx(_i,{placeholder:p,size:"sm",value:r,onChange:E,error:!!y,errorText:y||""})}),C.jsx(Si,{size:"xs",width:"auto",type:"submit",children:m})]})})}function f6({disabled:e=!1}){const[t,n]=S.useState(null),[r]=it(),o=Us(),i=S.useMemo(()=>{const l=o.toolbar.textSize;return[{value:"paragraph",label:l.paragraph,textProps:{variant:"body-2"}},{value:"h1",label:l.h1,textProps:{fontWeight:"semibold",variant:"headline-1"}},{value:"h2",label:l.h2,textProps:{fontWeight:"semibold",variant:"headline-2"}},{value:"h3",label:l.h3,textProps:{fontWeight:"semibold",variant:"headline-3"}}]},[o.toolbar.textSize]),s=S.useCallback(l=>{!l||Array.isArray(l)||r.update(()=>{const c=Y();if(!W(c))return;const u=c.anchor.getNode().getTopLevelElement();if(!u)return;const f=l==="paragraph"?ye():fo(l);u.getChildren().forEach(d=>{f.append(d)}),u.replace(f),f.selectEnd()})},[r]),a=S.useCallback(()=>{const l=Y();if(!W(l))return null;const c=l.anchor.getNode().getTopLevelElement();return Tw(c)?c.getTag():"paragraph"},[]);return S.useEffect(()=>{const l=r.registerUpdateListener(({editorState:c})=>{c.read(()=>{const u=a();u&&n(u)})});return()=>{l()}},[r,a]),C.jsx(fg,{size:"xs",items:i,renderDropdownItem:l=>C.jsx(se,{whiteSpace:"nowrap",...l.textProps,children:l.label}),returnedValue:l=>l.value,renderSingleInputItem:l=>l.label,onChange:s,disabled:e,value:t,showDefaultItem:!1})}const{color:rs,cornerRadius:h6,spacing:_u}=j;function g6({onImagesUpload:e=d6}){const[t,n]=S.useState(11),[r,o]=S.useState(null),[i,s]=S.useState(null),a=S.useRef(null),{toolbar:l}=Us(),c=l.preview,[u]=it(),{isEditable:f,isPreviewMode:d,setPreviewMode:h}=Ks(),{availableActionGroups:g}=ZA(),p=S.useRef(null),m=S.useMemo(()=>!f||d,[f,d]),x=S.useMemo(()=>d?c.hide:c.show,[d,c]),{toolbarGroups:y,menuGroups:v}=S.useMemo(()=>{const $=[],H=[];let U=0;for(const L of g){const N=[],V=[];for(const K of L)U+=1,U<=t?N.push(K):V.push(K);N.length&&$.push(N),V.length&&H.push(V)}return{toolbarGroups:$,menuGroups:H}},[g,t]),b=S.useMemo(()=>typeof r=="number"&&r>t-1,[r,t]),w=S.useMemo(()=>typeof i=="number"&&i>t-1,[i,t]),_=S.useCallback($=>{const{text:H,url:U}=$;u.update(()=>{const L=Y();if(W(L)){const N=sC({text:H,url:U});L.insertNodes([N]);const V=Fe(" ");N.insertAfter(V),V.select()}}),o(null)},[u]),E=S.useCallback($=>{const{rows:H,columns:U}=$;u.dispatchCommand(qw,{rows:H,columns:U}),s(null)},[u]),T=S.useCallback(()=>{p.current&&p.current.click()},[]),k=S.useCallback(async $=>{try{const H=Array.from($.target.files||[]);if(!H.length)return;const U=await e(H);u.update(()=>{const L=aC(U);L&&yh([L])})}catch(H){console.error("Error uploading images:",H)}finally{$.target.value=""}},[u,e]),P=S.useCallback(($,H)=>{({[ie.BOLD]:()=>{u.dispatchCommand(It,"bold")},[ie.ITALIC]:()=>{u.dispatchCommand(It,"italic")},[ie.UNDERLINE]:()=>{u.dispatchCommand(It,"underline")},[ie.STRIKETHROUGH]:()=>{u.dispatchCommand(It,"strikethrough")},[ie.ALIGN_LEFT]:()=>{u.dispatchCommand(hi,"left")},[ie.ALIGN_CENTER]:()=>{u.dispatchCommand(hi,"center")},[ie.ALIGN_RIGHT]:()=>{u.dispatchCommand(hi,"right")},[ie.LINK]:()=>{o(H)},[ie.IMAGE]:()=>{T()},[ie.TABLE]:()=>{s(H)},[ie.BULLET_LIST]:()=>{u.dispatchCommand(pw,void 0)},[ie.NUMBERED_LIST]:()=>{u.dispatchCommand(mw,void 0)}})[$]()},[T,u]),O=S.useMemo(()=>y.map(($,H)=>{const U=y.slice(0,H).reduce((V,K)=>V+K.length,0);if(!$.length)return null;const L=$.map(({IconComponent:V,isActive:K,id:te},J)=>{const Z=U+J,ae=K?"neutral":"no-bg";return te===ie.LINK?C.jsx(Pr,{content:C.jsx(bv,{onSave:_}),placement:"bottom",open:r===Z,onChange:oe=>{o(oe?Z:null)},children:C.jsx(fr,{size:"xs",color:"no-bg",disabled:m,children:C.jsx(V,{})})},te):te===ie.TABLE?C.jsx(Pr,{content:C.jsx(Tv,{onSave:E}),placement:"bottom",open:i===Z,onChange:oe=>{s(oe?Z:null)},children:C.jsx(fr,{size:"xs",color:ae,disabled:m,children:C.jsx(V,{})})},te):C.jsx(fr,{size:"xs",color:ae,onClick:()=>P(te,Z),disabled:m,children:C.jsx(V,{})},te)});return L.every(V=>!V)?null:C.jsxs(S.Fragment,{children:[L,C.jsx(G,{w:1,h:32,backgroundColor:rs.border.neutralAlphaBasic})]},$.flatMap(V=>V.id).join("-"))}),[y,P,r,m,i,_,E]),D=S.useCallback(()=>{const $=a.current;if(!$)return;const H=$.clientWidth,U=40,L=4,N=1,V=L+N+L+U+L;let K=H-V,te=0;for(const J of g)if(J.length){for(const Z of J){const ae=U+L;if(K-ae>=0)K-=ae,te+=1;else break}K-=N+L}n(te)},[g]),I=S.useMemo(()=>VP(D,20,{}),[D]);return S.useEffect(()=>{if(!a.current)return;const $=new ResizeObserver(()=>{I()});return $.observe(a.current),()=>$.disconnect()},[I]),C.jsxs(G,{backgroundColor:rs.fill.neutralPrimary,border:`1px solid ${rs.border.neutralAlphaBasic}`,borderRadius:h6.md,flex:!0,row:!0,alignItems:"center",justifyContent:"space-between",p:_u.sm,children:[C.jsxs(G,{flex:!0,flexGrow:1,row:!0,alignItems:"center",overflow:"hidden",children:[C.jsx("input",{ref:p,type:"file",accept:"image/*",hidden:!0,multiple:!0,onChange:k,disabled:m}),C.jsx(f6,{disabled:m}),C.jsx(Pr,{content:C.jsx(bv,{onSave:_}),placement:"bottom",open:b,onChange:$=>{$||o(null)},children:C.jsx("div",{})}),C.jsx(Pr,{content:C.jsx(Tv,{onSave:E}),placement:"bottom",open:w,onChange:$=>{$||s(null)},children:C.jsx("div",{})}),C.jsxs(G,{flex:!0,row:!0,alignItems:"center",gap:_u.xs,w:"full",ml:_u.xs,overflow:"hidden",ref:a,children:[O,v.length?C.jsx(c6,{disabled:m,onAction:P,groups:v,toolbarVisibleActionsCount:t}):null]})]}),C.jsx(Si,{width:"auto",size:"xs",color:d?"accent":"neutral",intensity:"secondary",wrapperClassName:u6,onClick:()=>{h($=>!$)},iconLeft:C.jsx(BP,{color:d?rs.icon.accent:rs.icon.secondary}),children:x})]})}const uC=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function p6({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:i,ariaExpanded:s,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:f,ariaRequired:d,autoCapitalize:h,className:g,id:p,role:m="textbox",spellCheck:x=!0,style:y,tabIndex:v,"data-testid":b,...w},_){const[E,T]=S.useState(e.isEditable()),k=S.useCallback(O=>{O&&O.ownerDocument&&O.ownerDocument.defaultView?e.setRootElement(O):e.setRootElement(null)},[e]),P=S.useMemo(()=>(function(...O){return D=>{for(const I of O)typeof I=="function"?I(D):I!=null&&(I.current=D)}})(_,k),[k,_]);return uC(()=>(T(e.isEditable()),e.registerEditableListener(O=>{T(O)})),[e]),C.jsx("div",{"aria-activedescendant":E?t:void 0,"aria-autocomplete":E?n:"none","aria-controls":E?r:void 0,"aria-describedby":o,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":E&&m==="combobox"?!!s:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":E?f:void 0,"aria-readonly":!E||void 0,"aria-required":d,autoCapitalize:h,className:g,contentEditable:E,"data-testid":b,id:p,ref:P,role:m,spellCheck:x,style:y,tabIndex:v,...w})}const m6=S.forwardRef(p6);function Ev(e){return e.getEditorState().read(Hw(e.isComposing()))}const dC=S.forwardRef(y6);function y6(e,t){const{placeholder:n,...r}=e,[o]=it();return C.jsxs(C.Fragment,{children:[C.jsx(m6,{editor:o,...r,ref:t}),n!=null&&C.jsx(v6,{editor:o,content:n})]})}function v6({content:e,editor:t}){const n=(function(s){const[a,l]=S.useState(()=>Ev(s));return uC(()=>{function c(){const u=Ev(s);l(u)}return c(),Rn(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),a})(t),[r,o]=S.useState(t.isEditable());if(S.useLayoutEffect(()=>(o(t.isEditable()),t.registerEditableListener(s=>{o(s)})),[t]),!n)return null;let i=null;return typeof e=="function"?i=e(r):e!==null&&(i=e),i===null?null:C.jsx("div",{"aria-hidden":!0,children:i})}const x6=S.createContext(null),Tu={didCatch:!1,error:null};class b6 extends S.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Tu}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){const{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState(Tu))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;r&&n.error!==null&&w6(t.resetKeys,o)&&(this.props.onReset?.({next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Tu))}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=S.createElement(r,l);else if(o!==void 0)a=o;else throw s}return S.createElement(x6.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function w6(e=[],t=[]){return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function fC({children:e,onError:t}){return C.jsx(b6,{fallback:C.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}const C6=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function S6(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function _6(){return(function(e){const[t]=it(),n=S.useMemo(()=>e(t),[t,e]),[r,o]=S.useState(()=>n.initialValueFn()),i=S.useRef(r);return C6(()=>{const{initialValueFn:s,subscribe:a}=n,l=s();return i.current!==l&&(i.current=l,o(l)),a(c=>{i.current=c,o(c)})},[n,e]),r})(S6)}const T6={name:"@lexical/react/ReactProvider"};function E6(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Xh=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function R6({editor:e,ErrorBoundary:t}){return(function(n,r){const[o,i]=S.useState(()=>n.getDecorators());return Xh(()=>n.registerDecoratorListener(s=>{Ts.flushSync(()=>{i(s)})}),[n]),S.useEffect(()=>{i(n.getDecorators())},[n]),S.useMemo(()=>{const s=[],a=Object.keys(o);for(let l=0;l<a.length;l++){const c=a[l],u=C.jsx(r,{onError:d=>n._onError(d),children:C.jsx(S.Suspense,{fallback:null,children:o[c]})}),f=n.getElementByKey(c);f!==null&&s.push(Ts.createPortal(u,f,c))}return s},[r,o,n])})(e,t)}function k6({editor:e,ErrorBoundary:t}){return(function(n){const r=lM.maybeFromEditor(n);if(r&&r.hasExtensionByName(T6.name)){for(const o of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(o)&&E6(320,o);return!0}return!1})(e)?null:C.jsx(R6,{editor:e,ErrorBoundary:t})}function Rv(e){return e.getEditorState().read(Hw(e.isComposing()))}function hC({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[r]=it();return(function(o){Xh(()=>Rn(DM(o),MM(o)),[o])})(r),C.jsxs(C.Fragment,{children:[e,C.jsx(A6,{content:t}),C.jsx(k6,{editor:r,ErrorBoundary:n})]})}function A6({content:e}){const[t]=it(),n=(function(o){const[i,s]=S.useState(()=>Rv(o));return Xh(()=>{function a(){const l=Rv(o);s(l)}return a(),Rn(o.registerUpdateListener(()=>{a()}),o.registerEditableListener(()=>{a()}))},[o]),i})(t),r=_6();return n?typeof e=="function"?e(r):e:null}const M6=R.css({width:"100%"}),N6=R.css({pointerEvents:"none"});function P6(e){const{placeholder:t}=e||{},n=S.useRef(null),{alignment:r}=nw(),o=S.useCallback(s=>{if(!t)return null;const a=typeof t=="string"||typeof t=="object"&&t.hasWrapper,l=typeof t=="string"?t:t.renderContent(s);return a?C.jsx(se,{variant:"body-2",colorName:"tertiary",children:l}):C.jsx(C.Fragment,{children:l})},[t]),i=S.useCallback(s=>{const a=o(s);if(!a)return null;const l={left:"flex-start",center:"center",right:"flex-end"};return C.jsx(G,{absolute:!0,w:"full",top:0,left:0,alignItems:l[r],className:N6,children:a})},[o,r]);return C.jsx(G,{relative:!0,row:!0,w:"full",flexGrow:1,children:C.jsx(hC,{contentEditable:C.jsx(dC,{ref:n,className:M6,"aria-placeholder":"markdown editor",placeholder:i}),ErrorBoundary:fC})})}const{color:L6,spacing:F6}=j,$6=R.css({counterReset:"line"}),O6=R.css({display:"grid",gridTemplateColumns:"3ch 1fr",columnGap:F6.sm,whiteSpace:"pre-wrap",":before":{counterIncrement:"line",content:"counter(line)",color:L6.text.accent,userSelect:"none",textAlign:"right"}});function I6(){const{markdownText:e}=Ks(),t=e.split(`
65
+ `);return C.jsx("pre",{className:$6,children:t.map((n,r)=>C.jsx(se,{tag:"span",className:O6,children:n||" "},r))})}const Uo={text:R.css({fontFamily:"Inter, sans-serif"}),paragraph:R.css({...me.body2}),h1:R.css({...me.headline1}),h2:R.css({...me.headline2}),h3:R.css({...me.headline3}),h4:R.css({...me.body2})},{color:Zh,spacing:kv}=j,D6=R.css({borderSpacing:"0",borderCollapse:"separate"}),j6=R.css({border:`1px solid ${Zh.border.neutralPrimary}`,padding:`${kv.sm} ${kv.sm}`}),V6=R.css({color:Zh.text.accent}),B6=R.css({fontWeight:"bold"}),z6=R.css({textDecoration:"underline"}),H6=R.css({textDecoration:"line-through"}),W6=R.css({textDecoration:"underline line-through"}),K6=R.css({fontStyle:"italic"}),U6=R.css({color:Zh.text.accent,textDecoration:"underline"}),G6={table:D6,tableCell:j6,hashtag:V6,link:U6,text:{base:Uo.text,bold:B6,underline:z6,strikethrough:H6,underlineStrikethrough:W6,italic:K6},heading:{h1:Uo.h1,h2:Uo.h2,h3:Uo.h3,h4:Uo.h4},paragraph:Uo.paragraph};function gC(){return{namespace:"ui-kit-markdown-text-editor",nodes:[$o,un,Io,Yr,An,kn,Br,zr,Mo,ic,rc,nc,oc,ta,na],onError(e){throw e},theme:G6}}const q6=[[ie.BOLD,ie.ITALIC,ie.UNDERLINE,ie.STRIKETHROUGH],[ie.LINK,ie.IMAGE],[ie.ALIGN_LEFT,ie.ALIGN_CENTER,ie.ALIGN_RIGHT],[ie.TABLE],[ie.BULLET_LIST,ie.NUMBERED_LIST]];function Y6(){const[e]=it(),{isEditable:t}=Ks();return S.useEffect(()=>{e.setEditable(t)},[e,t]),null}function X6(){const[e]=it();return S.useEffect(()=>{const t=e.registerCommand(Wl,()=>{const n=Y();if(!W(n)||!n.isCollapsed()||n.anchor.offset!==0)return!1;const o=n.anchor.getNode().getTopLevelElement();if(!o||o.getType()!=="paragraph"||o.getTextContent()!=="")return!1;const i=o.getPreviousSibling();return lC(i)?(i.remove(),o.select(),!0):!1},$t);return()=>{t()}},[e]),null}const Z6=/^\|(.+)\|$/,J6=/^\|\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|$/,Q6=/^\|(.+)\|$/,eL={type:"multiline-element",dependencies:[An,Br,kn],regExpStart:Z6,handleImportAfterStartMatch({lines:e,rootNode:t,startLineIndex:n}){const r=e[n+1];if(!J6.test(r??""))return null;const o=ac();let i=n;for(;i<e.length&&Q6.test(e[i]);){if(i===n+1){i++;continue}const s=ki(),a=e[i].slice(1,-1).split("|").map(c=>c.trim()),l=i===n;a.forEach(c=>{const u=ln(l?rt.ROW:void 0);u.append(Fe(c)),s.append(u)}),o.append(s),i++}return t.append(o),[!0,i-1]},replace(){return!0},export(e){if(!(e instanceof An))return null;const n=e.getChildren();if(!n.length)return"";const r=[];return n.forEach((o,i)=>{if(!(o instanceof Br))return;const a=o.getChildren().map(l=>l instanceof kn?l.getTextContent().replace(/\n/g," ").trim():"");r.push(`| ${a.join(" | ")} |`),i||r.push(`| ${a.map(()=>"---").join(" | ")} |`)}),r.join(`
66
+ `)}},Pl=[eL,i6,XP,...ra];function tL({defaultValue:e}){const[t]=it();return S.useEffect(()=>{t.update(()=>{e&&Vw(e,Pl)})},[t]),null}const{color:Eu,cornerRadius:Av,spacing:La}=j;function nL({label:e,plugins:t,field:n,disabled:r=!1,locale:o,toolbar:i,defaultMarkdown:s,events:a={}}){const[l,c]=S.useState(""),[u,f]=S.useState(!1),{availableActions:d,onImagesUpload:h}=i||{},g=S.useMemo(()=>gC(),[]),p=S.useMemo(()=>({isEditable:!r,isPreviewMode:u,setPreviewMode:f,markdownText:l}),[r,u,l]),m=S.useMemo(()=>({availableActions:d||q6}),[d]),x=S.useCallback(v=>{c(v),a.onMarkdownChange&&a.onMarkdownChange(v)},[a]),y=S.useCallback(v=>{v.read(()=>{const b=NN(Pl);x(b),a.onEditorStateChange&&a.onEditorStateChange(v)})},[x,a]);return C.jsx(n3,{locale:o,children:C.jsx(zw,{initialConfig:g,children:C.jsx(oh.Provider,{value:p,children:C.jsxs(xb.Provider,{value:m,children:[C.jsxs(G,{flex:!0,w:"full",borderRadius:Av.lg,p:La.lg,gap:La.sm,backgroundColor:Eu.fill.neutralSecondary,children:[e?C.jsx(se,{variant:"headline-3",fontWeight:"semibold",children:e}):null,C.jsx(g6,{onImagesUpload:h}),C.jsx(G,{backgroundColor:Eu.fill.neutralPrimary,border:`1px solid ${Eu.border.neutralAlphaBasic}`,borderRadius:Av.md,p:`${La.md} ${La.lg}`,w:"full",h:144,overflow:"auto",children:u?C.jsx(I6,{}):C.jsx(P6,{...n})})]}),C.jsx(PN,{}),C.jsx(HN,{}),C.jsx(RP,{}),C.jsx(zN,{}),C.jsx(qN,{transformers:Pl}),C.jsx(XN,{onChange:y}),C.jsx(Y6,{}),C.jsx(tL,{defaultValue:s}),C.jsx(X6,{}),t]})})})})}const{color:pn}=j,Go={input:R.css({...me.common,...me.body1,width:48,height:48,textAlign:"center",borderRadius:12,border:`1px solid ${pn.border.neutralAlphaBasic}`,color:pn.text.primary,outline:"none",transition:"border-color 0.5s ease, background-color 0.5s ease, box-shadow 0.5s ease","&::placeholder":{color:pn.text.tertiary},"&:focus-visible":{borderColor:pn.border.accentPrimary,boxShadow:`0 0 0 1px ${pn.border.accentPrimary}`},"&:not(.disabled):hover":{backgroundColor:pn.fill.neutralPrimaryHover},"&:disabled":{opacity:.6,cursor:"not-allowed"}}),error:R.css({borderColor:pn.border.negativePrimary}),success:R.css({borderColor:pn.border.positivePrimary}),disabled:R.css({pointerEvents:"none",opacity:.5}),white:R.css({background:pn.fill.bgPrimary}),gray:R.css({background:pn.fill.bgSecondary}),glow:R.css({position:"absolute",inset:0,borderRadius:12,pointerEvents:"none",opacity:0,transformOrigin:"center",background:pn.fill.accentPrimary})};function rL(e){const t=S.useRef(void 0);return S.useEffect(()=>{t.current=e},[e]),t.current}const{spacing:Mv}=j,pC=S.forwardRef(({length:e=6,label:t,prompt:n,error:r,errorText:o,success:i,disabled:s,autoFocus:a,center:l,secure:c,loading:u,background:f="gray",numeric:d=!0,className:h,value:g,defaultValue:p,onChange:m,onComplete:x},y)=>{const v=typeof g=="string",b=v?g:p,w=typeof b=="string"?b.slice(0,e):"",[_,E]=Po(v?g:void 0,w),[T,k]=S.useState(()=>{const L=w.slice(0,e);return Array.from({length:e},(N,V)=>L[V]??"")}),P=S.useRef(void 0),O=rL(g),D=S.useRef([]);S.useEffect(()=>{if(!v)return;const L=g??"";if(L===O)return;if(L===P.current){P.current=void 0;return}const N=L.slice(0,e);k(Array.from({length:e},(V,K)=>N[K]??""))},[v,g,e,O]);const I=S.useCallback((L,N)=>{const V=L.slice(0,e);N?.fromInternal&&(P.current=V),E(V),m?.(V),V.length===e&&x?.(V)},[e,m,x,E]);S.useImperativeHandle(y,()=>({focus:()=>{D.current[0]?.focus()},blur:()=>{D.current.forEach(L=>L?.blur())},get value(){return _||""},setValue:L=>{const N=L.slice(0,e);k(Array.from({length:e},(V,K)=>N[K]??"")),I(N,{fromInternal:!0})},clear:()=>{k(Array.from({length:e},()=>"")),I("",{fromInternal:!0})}}),[e,I,_]);const $=S.useCallback((L,N)=>{if(s)return;let V=N;if(d&&(V=V.replace(/\D/g,"")),V.length>1){const Z=T.slice(0,L).join("")+V+T.slice(L+1).join(""),ae=Array.from({length:e},(Te,ne)=>Z[ne]??"");k(ae),I(Z,{fromInternal:!0});const oe=Math.min(L+V.length,e-1),fe=D.current[oe];fe?.focus(),fe?.select();return}const K=T[L],te=[...T];te[L]=V,k(te);const J=te.join("");if(I(J,{fromInternal:!0}),!K&&V&&L<e-1){const Z=D.current[L+1];Z?.focus(),Z?.select()}},[T,s,e,d,I]),H=S.useCallback((L,N)=>{if(!s){if(N.key==="Backspace"){N.preventDefault();const V=D.current[L];if(T[L]){const K=[...T];K[L]="",k(K),I(K.join(""),{fromInternal:!0}),V?.focus();return}if(L>0){const K=D.current[L-1];K?.focus(),K?.select()}return}N.key==="ArrowLeft"&&L>0&&(N.preventDefault(),D.current[L-1]?.focus()),N.key==="ArrowRight"&&L<e-1&&(N.preventDefault(),D.current[L+1]?.focus())}},[T,s,e,I]),U=S.useCallback((L,N)=>{if(s)return;N.preventDefault();let V=N.clipboardData.getData("text");if(d&&(V=V.replace(/\D/g,"")),!V)return;const K=e-L,te=Math.min(V.length,K),J=V.slice(0,te),Z=[...T];for(let Te=0;Te<te;Te++)Z[L+Te]=J[Te]??"";k(Z);const ae=Z.join("");I(ae,{fromInternal:!0});const oe=Math.min(L+te-1,e-1),fe=D.current[oe];fe?.focus(),fe?.select()},[T,s,e,d,I]);return C.jsxs(G,{w:"full",gap:Mv.sm,className:h,center:l,children:[t&&C.jsx(se,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",children:t}),C.jsx(G,{row:!0,w:"full",gap:Mv.sm,center:l,className:R.cx({[Go.disabled]:s}),children:Array.from({length:e}).map((L,N)=>C.jsxs(G,{relative:!0,display:"inline-block",children:[C.jsx("input",{ref:V=>{D.current[N]=V},className:R.cx(Go.input,Go[f],r&&Go.error,i&&Go.success,T[N]&&R.css({caretColor:"transparent"})),inputMode:d?"numeric":"text",type:c?"password":"text",maxLength:1,autoFocus:a&&N===0,disabled:s||u,value:T[N],onChange:V=>$(N,V.target.value),onKeyDown:V=>H(N,V),onPaste:V=>U(N,V)}),C.jsx(Ws.span,{className:Go.glow,variants:oL,custom:N,initial:"idle",animate:u?"wave":"idle"})]},N))}),n&&C.jsx(se,{variant:"caption-1",colorName:"tertiary",children:n}),o&&r&&C.jsx(se,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:o})]})}),oL={idle:{opacity:0,scale:1,transition:{duration:.18}},wave:(e=0)=>({opacity:[0,.2,0],scale:[1,1.03,1],transition:{duration:1.5,delay:e*.15,repeat:1/0,ease:[.42,0,.58,1]}})};pC.displayName="OtpInput";const mC=S.createContext(null),iL=()=>S.useContext(mC),{spacing:sL}=j,os={radio:R.css({display:"flex",alignItems:"flex-start",justifyContent:"flex-start",gap:sL.md,cursor:"pointer"}),disabled:R.css({opacity:.5,cursor:"not-allowed"}),sideRight:R.css({flexDirection:"row-reverse",justifyContent:"space-between"}),readOnly:R.css({cursor:"auto"}),checked:R.css({})},{color:wr,cornerRadius:Nv}=j,Pv={sm:{inner:12,outer:20},md:{inner:16,outer:24}},yC=S.forwardRef(({value:e,children:t,checked:n,defaultChecked:r,onChange:o,disabled:i,className:s,description:a,size:l,side:c,readOnly:u,error:f},d)=>{const h=iL(),g=!!h,p=n!==void 0,[m,x]=Po(n,r),y=g?h.value===e:p?n:m,v=h?.disabled||i,b=l??h?.size??"md",w=c??h?.side??"left",_=u??h?.readOnly??!1,E=f??h?.error??!1,T=Pv[b].outer,k=Pv[b].inner,P=()=>{v||_||(g?h.setValue?.(e):(p||x(!y),o?.(!y)))},O=y&&E?wr.fill.negativeTint:y?wr.fill.accentTint:wr.fill.bgSecondary,D=y&&E?wr.fill.negativePrimary:y?wr.fill.accentPrimary:void 0,I=y&&E||E&&!y?wr.border.negativeSecondary:wr.border.neutralAlphaLow;return C.jsxs("button",{ref:d,role:"radio",type:"button","data-value":e,"aria-checked":y,"aria-disabled":v||void 0,tabIndex:y?0:-1,className:R.cx([os.radio,y&&os.checked,v&&os.disabled,w==="right"&&os.sideRight,_&&os.readOnly,s]),onClick:P,children:[C.jsx(G,{w:T,h:T,backgroundColor:O,borderWidth:y?0:1,borderColor:I,borderStyle:"solid",center:!0,borderRadius:Nv.fullRound,children:C.jsx(G,{w:k,h:k,backgroundColor:D,borderRadius:Nv.fullRound,"aria-hidden":!0})}),C.jsxs(G,{alignItems:"flex-start",children:[C.jsx(se,{variant:b==="sm"?"body-2":"body-1",tag:"span",left:!0,children:t}),a&&C.jsx(se,{tag:"span",variant:"body-2",colorName:"secondary",children:a})]})]})});yC.displayName="Radio";const{spacing:Lv}=j,vC=S.forwardRef(({label:e,value:t,defaultValue:n,onChange:r,children:o,className:i,error:s=!1,disabled:a=!1,readOnly:l=!1,side:c="left",size:u="md"},f)=>{const[d,h]=Po(t,n),g=t!==void 0,p=g?t:d,m=S.useCallback(y=>{g||h(y),r?.(y)},[g,r,h]),x=S.useRef(null);return S.useImperativeHandle(f,()=>x.current),C.jsx(mC.Provider,{value:{value:p,readOnly:l,disabled:a,setValue:m,size:u,side:c,error:s},children:C.jsxs(G,{gap:Lv.sm,ref:x,role:"radiogroup","aria-invalid":s||void 0,className:i,children:[typeof e=="string"?C.jsx(se,{colorName:"secondary",children:e}):e,C.jsx(G,{gap:Lv.lg,children:o})]})})});vC.displayName="RadioGroup";const{color:tr}=j,Fv=R.css({border:`1px solid ${tr.border.neutralAlphaBasic}`}),$v=R.css({display:"flex",alignItems:"center",justifyContent:"center"}),Cr={primary:R.css({background:tr.fill.bgPrimary,border:`1px solid ${tr.border.neutralAlphaBasic}`}),secondary:R.css({background:tr.fill.bgSecondary,border:`1px solid ${tr.border.neutralAlphaBasic}`}),button:R.css({cursor:"pointer",border:"1px solid transparent",borderRadius:8,padding:"8px 12px",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:10,transition:"all 0.15s ease",position:"relative",overflow:"hidden",background:"none",[`&:hover:not(.${Fv})`]:{background:tr.fill.neutralPrimaryHover},[`& .${$v} svg`]:{color:tr.icon.tertiary},"&:disabled":{cursor:"not-allowed",opacity:.5}}),"button-active":Fv,"button-primary":R.css({background:tr.fill.bgSecondary}),"button-secondary":R.css({background:tr.fill.bgPrimary}),"button-disabled":R.css({opacity:.5,cursor:"not-allowed"}),"full-width":R.css({width:"100%"}),"icon-container":$v},{color:Ov,cornerRadius:aL,spacing:Iv}=j;function lL({value:e,onChange:t,options:n,variant:r="primary",fullWidth:o=!1,className:i}){return C.jsx(G,{row:!0,alignItems:"center",borderRadius:aL.md,p:Iv.xs,gap:Iv.md,className:R.cx(Cr[r],o&&Cr["full-width"],i),children:n.map(s=>{const a=s.value===e,l=s.disabled,c=s.separatorAfter??!1;return C.jsxs(S.Fragment,{children:[C.jsxs("button",{type:"button",disabled:l,className:R.cx(Cr.button,o&&Cr["full-width"],a&&Cr["button-active"],a&&Cr[`button-${r}`],l&&Cr["button-disabled"]),onClick:()=>!l&&t(s.value),children:[s.icon&&C.jsx(G,{alignItems:"center",justifyContent:"center",className:Cr["icon-container"],children:s.icon}),s.label&&C.jsx(se,{colorName:a?"primary":"tertiary",children:s.label}),!l&&C.jsx(Lo,{color:Ov.fill.bgOverlayPrimary})]}),c&&C.jsx(G,{w:1,h:24,backgroundColor:Ov.fill.bgTertiary})]},s.value)})})}function lc(){return typeof window<"u"}function zi(e){return xC(e)?(e.nodeName||"").toLowerCase():"#document"}function Bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yn(e){var t;return(t=(xC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xC(e){return lc()?e instanceof Node||e instanceof Bt(e).Node:!1}function je(e){return lc()?e instanceof Element||e instanceof Bt(e).Element:!1}function Pt(e){return lc()?e instanceof HTMLElement||e instanceof Bt(e).HTMLElement:!1}function lf(e){return!lc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bt(e).ShadowRoot}const cL=new Set(["inline","contents"]);function oa(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=cn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!cL.has(o)}const uL=new Set(["table","td","th"]);function dL(e){return uL.has(zi(e))}const fL=[":popover-open",":modal"];function cc(e){return fL.some(t=>{try{return e.matches(t)}catch{return!1}})}const hL=["transform","translate","scale","rotate","perspective"],gL=["transform","translate","scale","rotate","perspective","filter"],pL=["paint","layout","strict","content"];function Jh(e){const t=uc(),n=je(e)?cn(e):e;return hL.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||gL.some(r=>(n.willChange||"").includes(r))||pL.some(r=>(n.contain||"").includes(r))}function mL(e){let t=vr(e);for(;Pt(t)&&!hr(t);){if(Jh(t))return t;if(cc(t))return null;t=vr(t)}return null}function uc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yL=new Set(["html","body","#document"]);function hr(e){return yL.has(zi(e))}function cn(e){return Bt(e).getComputedStyle(e)}function dc(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vr(e){if(zi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lf(e)&&e.host||Yn(e);return lf(t)?t.host:t}function bC(e){const t=vr(e);return hr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pt(t)&&oa(t)?t:bC(t)}function Fr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=bC(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Bt(o);if(i){const a=cf(s);return t.concat(s,s.visualViewport||[],oa(o)?o:[],a&&n?Fr(a):[])}return t.concat(o,Fr(o,[],n))}function cf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Hr=Math.min,Ut=Math.max,Ll=Math.round,Fa=Math.floor,Gn=e=>({x:e,y:e}),vL={left:"right",right:"left",bottom:"top",top:"bottom"},xL={start:"end",end:"start"};function uf(e,t,n){return Ut(e,Hr(t,n))}function Hi(e,t){return typeof e=="function"?e(t):e}function Wr(e){return e.split("-")[0]}function Wi(e){return e.split("-")[1]}function wC(e){return e==="x"?"y":"x"}function Qh(e){return e==="y"?"height":"width"}const bL=new Set(["top","bottom"]);function dr(e){return bL.has(Wr(e))?"y":"x"}function eg(e){return wC(dr(e))}function wL(e,t,n){n===void 0&&(n=!1);const r=Wi(e),o=eg(e),i=Qh(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Fl(s)),[s,Fl(s)]}function CL(e){const t=Fl(e);return[df(e),t,df(t)]}function df(e){return e.replace(/start|end/g,t=>xL[t])}const Dv=["left","right"],jv=["right","left"],SL=["top","bottom"],_L=["bottom","top"];function TL(e,t,n){switch(e){case"top":case"bottom":return n?t?jv:Dv:t?Dv:jv;case"left":case"right":return t?SL:_L;default:return[]}}function EL(e,t,n,r){const o=Wi(e);let i=TL(Wr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(df)))),i}function Fl(e){return e.replace(/left|right|bottom|top/g,t=>vL[t])}function RL(e){return{top:0,right:0,bottom:0,left:0,...e}}function CC(e){return typeof e!="number"?RL(e):{top:e,right:e,bottom:e,left:e}}function $l(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function kL(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function AL(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function ML(){return/apple/i.test(navigator.vendor)}function NL(){return kL().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function PL(){return AL().includes("jsdom/")}const Vv="data-floating-ui-focusable",LL="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Bv(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Is(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&lf(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ni(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ru(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function FL(e){return e.matches("html,body")}function ho(e){return e?.ownerDocument||document}function SC(e){return Pt(e)&&e.matches(LL)}function $L(e){if(!e||PL())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function OL(e){return e?e.hasAttribute(Vv)?e:e.querySelector("["+Vv+"]")||e:null}function Qa(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...Qa(e,o.id,n)])}function IL(e){return"nativeEvent"in e}function Ds(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var DL=typeof document<"u",jL=function(){},Mi=DL?S.useLayoutEffect:jL;const VL={...M};function $a(e){const t=M.useRef(e);return Mi(()=>{t.current=e}),t}const BL=VL.useInsertionEffect,zL=BL||(e=>e());function In(e){const t=M.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return zL(()=>{t.current=e}),M.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function zv(e,t,n){let{reference:r,floating:o}=e;const i=dr(t),s=eg(t),a=Qh(s),l=Wr(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Wi(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const HL=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=zv(c,r,l),d=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:x}=a[p],{x:y,y:v,data:b,reset:w}=await x({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=v??f,h={...h,[m]:{...h[m],...b}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(d=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:f}=zv(c,d,l)),p=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}};async function tg(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Hi(t,e),g=CC(h),m=a[d?f==="floating"?"reference":"floating":f],x=$l(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},w=$l(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(x.top-w.top+g.top)/b.y,bottom:(w.bottom-x.bottom+g.bottom)/b.y,left:(x.left-w.left+g.left)/b.x,right:(w.right-x.right+g.right)/b.x}}const WL=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Hi(e,t)||{};if(c==null)return{};const f=CC(u),d={x:n,y:r},h=eg(o),g=Qh(h),p=await s.getDimensions(c),m=h==="y",x=m?"top":"left",y=m?"bottom":"right",v=m?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[h]-d[h]-i.floating[g],w=d[h]-i.reference[h],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=_?_[v]:0;(!E||!await(s.isElement==null?void 0:s.isElement(_)))&&(E=a.floating[v]||i.floating[g]);const T=b/2-w/2,k=E/2-p[g]/2-1,P=Hr(f[x],k),O=Hr(f[y],k),D=P,I=E-p[g]-O,$=E/2-p[g]/2+T,H=uf(D,$,I),U=!l.arrow&&Wi(o)!=null&&$!==H&&i.reference[g]/2-($<D?P:O)-p[g]/2<0,L=U?$<D?$-D:$-I:0;return{[h]:d[h]+L,data:{[h]:H,centerOffset:$-H-L,...U&&{alignmentOffset:L}},reset:U}}}),KL=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=Hi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Wr(o),y=dr(a),v=Wr(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=d||(v||!p?[Fl(a)]:CL(a)),_=g!=="none";!d&&_&&w.push(...EL(a,p,g,b));const E=[a,...w],T=await tg(t,m),k=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(T[x]),f){const $=wL(o,s,b);k.push(T[$[0]],T[$[1]])}if(P=[...P,{placement:o,overflows:k}],!k.every($=>$<=0)){var O,D;const $=(((O=i.flip)==null?void 0:O.index)||0)+1,H=E[$];if(H&&(!(f==="alignment"?y!==dr(H):!1)||P.every(N=>dr(N.placement)===y?N.overflows[0]>0:!0)))return{data:{index:$,overflows:P},reset:{placement:H}};let U=(D=P.filter(L=>L.overflows[0]<=0).sort((L,N)=>L.overflows[1]-N.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(h){case"bestFit":{var I;const L=(I=P.filter(N=>{if(_){const V=dr(N.placement);return V===y||V==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(V=>V>0).reduce((V,K)=>V+K,0)]).sort((N,V)=>N[1]-V[1])[0])==null?void 0:I[0];L&&(U=L);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}},UL=new Set(["left","top"]);async function GL(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Wr(n),a=Wi(n),l=dr(n)==="y",c=UL.has(s)?-1:1,u=i&&l?-1:1,f=Hi(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const qL=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await GL(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},YL=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x,y}=m;return{x,y}}},...l}=Hi(e,t),c={x:n,y:r},u=await tg(t,l),f=dr(Wr(o)),d=wC(f);let h=c[d],g=c[f];if(i){const m=d==="y"?"top":"left",x=d==="y"?"bottom":"right",y=h+u[m],v=h-u[x];h=uf(y,h,v)}if(s){const m=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=g+u[m],v=g-u[x];g=uf(y,g,v)}const p=a.fn({...t,[d]:h,[f]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[d]:i,[f]:s}}}}}},XL=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Hi(e,t),u=await tg(t,c),f=Wr(o),d=Wi(o),h=dr(o)==="y",{width:g,height:p}=i.floating;let m,x;f==="top"||f==="bottom"?(m=f,x=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,m=d==="end"?"top":"bottom");const y=p-u.top-u.bottom,v=g-u.left-u.right,b=Hr(p-u[m],y),w=Hr(g-u[x],v),_=!t.middlewareData.shift;let E=b,T=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=y),_&&!d){const P=Ut(u.left,0),O=Ut(u.right,0),D=Ut(u.top,0),I=Ut(u.bottom,0);h?T=g-2*(P!==0||O!==0?P+O:Ut(u.left,u.right)):E=p-2*(D!==0||I!==0?D+I:Ut(u.top,u.bottom))}await l({...t,availableWidth:T,availableHeight:E});const k=await s.getDimensions(a.floating);return g!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function _C(e){const t=cn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Pt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ll(n)!==i||Ll(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function ng(e){return je(e)?e:e.contextElement}function bi(e){const t=ng(e);if(!Pt(t))return Gn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=_C(t);let s=(i?Ll(n.width):n.width)/r,a=(i?Ll(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ZL=Gn(0);function TC(e){const t=Bt(e);return!uc()||!t.visualViewport?ZL:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function JL(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bt(e)?!1:t}function No(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=ng(e);let s=Gn(1);t&&(r?je(r)&&(s=bi(r)):s=bi(e));const a=JL(i,n,r)?TC(i):Gn(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const d=Bt(i),h=r&&je(r)?Bt(r):r;let g=d,p=cf(g);for(;p&&r&&h!==g;){const m=bi(p),x=p.getBoundingClientRect(),y=cn(p),v=x.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,b=x.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,f*=m.y,l+=v,c+=b,g=Bt(p),p=cf(g)}}return $l({width:u,height:f,x:l,y:c})}function fc(e,t){const n=dc(e).scrollLeft;return t?t.left+n:No(Yn(e)).left+n}function EC(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-fc(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function QL(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Yn(r),a=t?cc(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Gn(1);const u=Gn(0),f=Pt(r);if((f||!f&&!i)&&((zi(r)!=="body"||oa(s))&&(l=dc(r)),Pt(r))){const h=No(r);c=bi(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!i?EC(s,l):Gn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function eF(e){return Array.from(e.getClientRects())}function tF(e){const t=Yn(e),n=dc(e),r=e.ownerDocument.body,o=Ut(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ut(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+fc(e);const a=-n.scrollTop;return cn(r).direction==="rtl"&&(s+=Ut(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Hv=25;function nF(e,t){const n=Bt(e),r=Yn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=uc();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=fc(r);if(c<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=Hv&&(i-=g)}else c<=Hv&&(i+=c);return{width:i,height:s,x:a,y:l}}const rF=new Set(["absolute","fixed"]);function oF(e,t){const n=No(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Pt(e)?bi(e):Gn(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Wv(e,t,n){let r;if(t==="viewport")r=nF(e,n);else if(t==="document")r=tF(Yn(e));else if(je(t))r=oF(t,n);else{const o=TC(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return $l(r)}function RC(e,t){const n=vr(e);return n===t||!je(n)||hr(n)?!1:cn(n).position==="fixed"||RC(n,t)}function iF(e,t){const n=t.get(e);if(n)return n;let r=Fr(e,[],!1).filter(a=>je(a)&&zi(a)!=="body"),o=null;const i=cn(e).position==="fixed";let s=i?vr(e):e;for(;je(s)&&!hr(s);){const a=cn(s),l=Jh(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&rF.has(o.position)||oa(s)&&!l&&RC(e,s))?r=r.filter(u=>u!==s):o=a,s=vr(s)}return t.set(e,r),r}function sF(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?cc(t)?[]:iF(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=Wv(t,u,o);return c.top=Ut(f.top,c.top),c.right=Hr(f.right,c.right),c.bottom=Hr(f.bottom,c.bottom),c.left=Ut(f.left,c.left),c},Wv(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function aF(e){const{width:t,height:n}=_C(e);return{width:t,height:n}}function lF(e,t,n){const r=Pt(t),o=Yn(t),i=n==="fixed",s=No(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Gn(0);function c(){l.x=fc(o)}if(r||!r&&!i)if((zi(t)!=="body"||oa(o))&&(a=dc(t)),r){const h=No(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?EC(o,a):Gn(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function ku(e){return cn(e).position==="static"}function Kv(e,t){if(!Pt(e)||cn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Yn(e)===n&&(n=n.ownerDocument.body),n}function kC(e,t){const n=Bt(e);if(cc(e))return n;if(!Pt(e)){let o=vr(e);for(;o&&!hr(o);){if(je(o)&&!ku(o))return o;o=vr(o)}return n}let r=Kv(e,t);for(;r&&dL(r)&&ku(r);)r=Kv(r,t);return r&&hr(r)&&ku(r)&&!Jh(r)?n:r||mL(e)||n}const cF=async function(e){const t=this.getOffsetParent||kC,n=this.getDimensions,r=await n(e.floating);return{reference:lF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uF(e){return cn(e).direction==="rtl"}const dF={convertOffsetParentRelativeRectToViewportRelativeRect:QL,getDocumentElement:Yn,getClippingRect:sF,getOffsetParent:kC,getElementRects:cF,getClientRects:eF,getDimensions:aF,getScale:bi,isElement:je,isRTL:uF};function AC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fF(e,t){let n=null,r;const o=Yn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=c;if(a||t(),!d||!h)return;const g=Fa(f),p=Fa(o.clientWidth-(u+d)),m=Fa(o.clientHeight-(f+h)),x=Fa(u),v={rootMargin:-g+"px "+-p+"px "+-m+"px "+-x+"px",threshold:Ut(0,Hr(1,l))||1};let b=!0;function w(_){const E=_[0].intersectionRatio;if(E!==l){if(!b)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!AC(c,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(w,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,v)}n.observe(e)}return s(!0),i}function rg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=ng(e),u=o||i?[...c?Fr(c):[],...Fr(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=c&&a?fF(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(x=>{let[y]=x;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,p=l?No(e):null;l&&m();function m(){const x=No(e);p&&!AC(p,x)&&n(),p=x,g=requestAnimationFrame(m)}return n(),()=>{var x;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const hF=qL,gF=YL,pF=KL,mF=XL,Uv=WL,yF=(e,t,n)=>{const r=new Map,o={platform:dF,...n},i={...o.platform,_c:r};return HL(e,t,{...o,platform:i})};var vF=typeof document<"u",xF=function(){},el=vF?S.useLayoutEffect:xF;function Ol(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ol(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ol(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function MC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gv(e,t){const n=MC(e);return Math.round(t*n)/n}function Au(e){const t=M.useRef(e);return el(()=>{t.current=e}),t}function bF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=M.useState(r);Ol(d,r)||h(r);const[g,p]=M.useState(null),[m,x]=M.useState(null),y=M.useCallback(N=>{N!==_.current&&(_.current=N,p(N))},[]),v=M.useCallback(N=>{N!==E.current&&(E.current=N,x(N))},[]),b=i||g,w=s||m,_=M.useRef(null),E=M.useRef(null),T=M.useRef(u),k=l!=null,P=Au(l),O=Au(o),D=Au(c),I=M.useCallback(()=>{if(!_.current||!E.current)return;const N={placement:t,strategy:n,middleware:d};O.current&&(N.platform=O.current),yF(_.current,E.current,N).then(V=>{const K={...V,isPositioned:D.current!==!1};$.current&&!Ol(T.current,K)&&(T.current=K,S_.flushSync(()=>{f(K)}))})},[d,t,n,O,D]);el(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[c]);const $=M.useRef(!1);el(()=>($.current=!0,()=>{$.current=!1}),[]),el(()=>{if(b&&(_.current=b),w&&(E.current=w),b&&w){if(P.current)return P.current(b,w,I);I()}},[b,w,I,P,k]);const H=M.useMemo(()=>({reference:_,floating:E,setReference:y,setFloating:v}),[y,v]),U=M.useMemo(()=>({reference:b,floating:w}),[b,w]),L=M.useMemo(()=>{const N={position:n,left:0,top:0};if(!U.floating)return N;const V=Gv(U.floating,u.x),K=Gv(U.floating,u.y);return a?{...N,transform:"translate("+V+"px, "+K+"px)",...MC(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:K}},[n,a,U.floating,u.x,u.y]);return M.useMemo(()=>({...u,update:I,refs:H,elements:U,floatingStyles:L}),[u,I,H,U,L])}const wF=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Uv({element:r.current,padding:o}).fn(n):{}:r?Uv({element:r,padding:o}).fn(n):{}}}},og=(e,t)=>({...hF(e),options:[e,t]}),ig=(e,t)=>({...gF(e),options:[e,t]}),sg=(e,t)=>({...pF(e),options:[e,t]}),CF=(e,t)=>({...mF(e),options:[e,t]}),SF=(e,t)=>({...wF(e),options:[e,t]});function NC(e){const t=M.useRef(void 0),n=M.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i?.())}},e);return M.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const _F="data-floating-ui-focusable",qv="active",Yv="selected",TF={...M};let Xv=!1,EF=0;const Zv=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+EF++;function RF(){const[e,t]=M.useState(()=>Xv?Zv():void 0);return Mi(()=>{e==null&&t(Zv())},[]),M.useEffect(()=>{Xv=!0},[]),e}const kF=TF.useId,PC=kF||RF;let ff;process.env.NODE_ENV!=="production"&&(ff=new Set);function AF(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=ff)!=null&&e.has(o))){var i;(i=ff)==null||i.add(o),console.error(o)}}function MF(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const NF=M.createContext(null),PF=M.createContext(null),ag=()=>{var e;return((e=M.useContext(NF))==null?void 0:e.id)||null},lg=()=>M.useContext(PF);function cg(e){return"data-floating-ui-"+e}function nn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Jv=cg("safe-polygon");function Mu(e,t,n){if(n&&!Ds(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function Nu(e){return typeof e=="function"?e():e}function LC(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,h=lg(),g=ag(),p=$a(c),m=$a(l),x=$a(n),y=$a(f),v=M.useRef(),b=M.useRef(-1),w=M.useRef(),_=M.useRef(-1),E=M.useRef(!0),T=M.useRef(!1),k=M.useRef(()=>{}),P=M.useRef(!1),O=In(()=>{var L;const N=(L=o.current.openEvent)==null?void 0:L.type;return N?.includes("mouse")&&N!=="mousedown"});M.useEffect(()=>{if(!a)return;function L(N){let{open:V}=N;V||(nn(b),nn(_),E.current=!0,P.current=!1)}return i.on("openchange",L),()=>{i.off("openchange",L)}},[a,i]),M.useEffect(()=>{if(!a||!p.current||!n)return;function L(V){O()&&r(!1,V,"hover")}const N=ho(s.floating).documentElement;return N.addEventListener("mouseleave",L),()=>{N.removeEventListener("mouseleave",L)}},[s.floating,n,r,a,p,O]);const D=M.useCallback(function(L,N,V){N===void 0&&(N=!0),V===void 0&&(V="hover");const K=Mu(m.current,"close",v.current);K&&!w.current?(nn(b),b.current=window.setTimeout(()=>r(!1,L,V),K)):N&&(nn(b),r(!1,L,V))},[m,r]),I=In(()=>{k.current(),w.current=void 0}),$=In(()=>{if(T.current){const L=ho(s.floating).body;L.style.pointerEvents="",L.removeAttribute(Jv),T.current=!1}}),H=In(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);M.useEffect(()=>{if(!a)return;function L(J){if(nn(b),E.current=!1,u&&!Ds(v.current)||Nu(y.current)>0&&!Mu(m.current,"open"))return;const Z=Mu(m.current,"open",v.current);Z?b.current=window.setTimeout(()=>{x.current||r(!0,J,"hover")},Z):n||r(!0,J,"hover")}function N(J){if(H()){$();return}k.current();const Z=ho(s.floating);if(nn(_),P.current=!1,p.current&&o.current.floatingContext){n||nn(b),w.current=p.current({...o.current.floatingContext,tree:h,x:J.clientX,y:J.clientY,onClose(){$(),I(),H()||D(J,!0,"safe-polygon")}});const oe=w.current;Z.addEventListener("mousemove",oe),k.current=()=>{Z.removeEventListener("mousemove",oe)};return}(v.current!=="touch"||!Is(s.floating,J.relatedTarget))&&D(J)}function V(J){H()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:h,x:J.clientX,y:J.clientY,onClose(){$(),I(),H()||D(J)}})(J))}function K(){nn(b)}function te(J){H()||D(J,!1)}if(je(s.domReference)){const J=s.domReference,Z=s.floating;return n&&J.addEventListener("mouseleave",V),d&&J.addEventListener("mousemove",L,{once:!0}),J.addEventListener("mouseenter",L),J.addEventListener("mouseleave",N),Z&&(Z.addEventListener("mouseleave",V),Z.addEventListener("mouseenter",K),Z.addEventListener("mouseleave",te)),()=>{n&&J.removeEventListener("mouseleave",V),d&&J.removeEventListener("mousemove",L),J.removeEventListener("mouseenter",L),J.removeEventListener("mouseleave",N),Z&&(Z.removeEventListener("mouseleave",V),Z.removeEventListener("mouseenter",K),Z.removeEventListener("mouseleave",te))}}},[s,a,e,u,d,D,I,$,r,n,x,h,m,p,o,H,y]),Mi(()=>{var L;if(a&&n&&(L=p.current)!=null&&(L=L.__options)!=null&&L.blockPointerEvents&&O()){T.current=!0;const V=s.floating;if(je(s.domReference)&&V){var N;const K=ho(s.floating).body;K.setAttribute(Jv,"");const te=s.domReference,J=h==null||(N=h.nodesRef.current.find(Z=>Z.id===g))==null||(N=N.context)==null?void 0:N.elements.floating;return J&&(J.style.pointerEvents=""),K.style.pointerEvents="none",te.style.pointerEvents="auto",V.style.pointerEvents="auto",()=>{K.style.pointerEvents="",te.style.pointerEvents="",V.style.pointerEvents=""}}}},[a,n,g,s,h,p,O]),Mi(()=>{n||(v.current=void 0,P.current=!1,I(),$())},[n,I,$]),M.useEffect(()=>()=>{I(),nn(b),nn(_),$()},[a,s.domReference,I,$]);const U=M.useMemo(()=>{function L(N){v.current=N.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(N){const{nativeEvent:V}=N;function K(){!E.current&&!x.current&&r(!0,V,"hover")}u&&!Ds(v.current)||n||Nu(y.current)===0||P.current&&N.movementX**2+N.movementY**2<2||(nn(_),v.current==="touch"?K():(P.current=!0,_.current=window.setTimeout(K,Nu(y.current))))}}},[u,r,n,x,y]);return M.useMemo(()=>a?{reference:U}:{},[a,U])}function Qv(e){return Pt(e.target)&&e.target.tagName==="BUTTON"}function LF(e){return Pt(e.target)&&e.target.tagName==="A"}function e0(e){return SC(e)}function FF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=M.useRef(),h=M.useRef(!1),g=M.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(Ds(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}Ds(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||Qv(p))&&(p.key===" "&&!e0(i)&&(p.preventDefault(),h.current=!0),!LF(p)&&p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||Qv(p)||e0(i)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,i,a,c,u,r,n,f,l]);return M.useMemo(()=>s?{reference:g}:{},[s,g])}const $F={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},OF={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},t0=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function FC(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:h,capture:g}=t,p=lg(),m=In(typeof l=="function"?l:()=>!1),x=typeof l=="function"?m:l,y=M.useRef(!1),{escapeKey:v,outsidePress:b}=t0(h),{escapeKey:w,outsidePress:_}=t0(g),E=M.useRef(!1),T=In($=>{var H;if(!n||!s||!a||$.key!=="Escape"||E.current)return;const U=(H=i.current.floatingContext)==null?void 0:H.nodeId,L=p?Qa(p.nodesRef.current,U):[];if(!v&&($.stopPropagation(),L.length>0)){let N=!0;if(L.forEach(V=>{var K;if((K=V.context)!=null&&K.open&&!V.context.dataRef.current.__escapeKeyBubbles){N=!1;return}}),!N)return}r(!1,IL($)?$.nativeEvent:$,"escape-key")}),k=In($=>{var H;const U=()=>{var L;T($),(L=ni($))==null||L.removeEventListener("keydown",U)};(H=ni($))==null||H.addEventListener("keydown",U)}),P=In($=>{var H;const U=i.current.insideReactTree;i.current.insideReactTree=!1;const L=y.current;if(y.current=!1,c==="click"&&L||U||typeof x=="function"&&!x($))return;const N=ni($),V="["+cg("inert")+"]",K=ho(o.floating).querySelectorAll(V);let te=je(N)?N:null;for(;te&&!hr(te);){const oe=vr(te);if(hr(oe)||!je(oe))break;te=oe}if(K.length&&je(N)&&!FL(N)&&!Is(N,o.floating)&&Array.from(K).every(oe=>!Is(te,oe)))return;if(Pt(N)&&I){const oe=hr(N),fe=cn(N),Te=/auto|scroll/,ne=oe||Te.test(fe.overflowX),ve=oe||Te.test(fe.overflowY),Ee=ne&&N.clientWidth>0&&N.scrollWidth>N.clientWidth,De=ve&&N.clientHeight>0&&N.scrollHeight>N.clientHeight,st=fe.direction==="rtl",ee=De&&(st?$.offsetX<=N.offsetWidth-N.clientWidth:$.offsetX>N.clientWidth),Ce=Ee&&$.offsetY>N.clientHeight;if(ee||Ce)return}const J=(H=i.current.floatingContext)==null?void 0:H.nodeId,Z=p&&Qa(p.nodesRef.current,J).some(oe=>{var fe;return Ru($,(fe=oe.context)==null?void 0:fe.elements.floating)});if(Ru($,o.floating)||Ru($,o.domReference)||Z)return;const ae=p?Qa(p.nodesRef.current,J):[];if(ae.length>0){let oe=!0;if(ae.forEach(fe=>{var Te;if((Te=fe.context)!=null&&Te.open&&!fe.context.dataRef.current.__outsidePressBubbles){oe=!1;return}}),!oe)return}r(!1,$,"outside-press")}),O=In($=>{var H;const U=()=>{var L;P($),(L=ni($))==null||L.removeEventListener(c,U)};(H=ni($))==null||H.addEventListener(c,U)});M.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=v,i.current.__outsidePressBubbles=b;let $=-1;function H(K){r(!1,K,"ancestor-scroll")}function U(){window.clearTimeout($),E.current=!0}function L(){$=window.setTimeout(()=>{E.current=!1},uc()?5:0)}const N=ho(o.floating);a&&(N.addEventListener("keydown",w?k:T,w),N.addEventListener("compositionstart",U),N.addEventListener("compositionend",L)),x&&N.addEventListener(c,_?O:P,_);let V=[];return d&&(je(o.domReference)&&(V=Fr(o.domReference)),je(o.floating)&&(V=V.concat(Fr(o.floating))),!je(o.reference)&&o.reference&&o.reference.contextElement&&(V=V.concat(Fr(o.reference.contextElement)))),V=V.filter(K=>{var te;return K!==((te=N.defaultView)==null?void 0:te.visualViewport)}),V.forEach(K=>{K.addEventListener("scroll",H,{passive:!0})}),()=>{a&&(N.removeEventListener("keydown",w?k:T,w),N.removeEventListener("compositionstart",U),N.removeEventListener("compositionend",L)),x&&N.removeEventListener(c,_?O:P,_),V.forEach(K=>{K.removeEventListener("scroll",H)}),window.clearTimeout($)}},[i,o,a,x,c,n,r,d,s,v,b,T,w,k,P,_,O]),M.useEffect(()=>{i.current.insideReactTree=!1},[i,x,c]);const D=M.useMemo(()=>({onKeyDown:T,...u&&{[$F[f]]:$=>{r(!1,$.nativeEvent,"reference-press")},...f!=="click"&&{onClick($){r(!1,$.nativeEvent,"reference-press")}}}}),[T,r,u,f]),I=M.useMemo(()=>({onKeyDown:T,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[OF[c]]:()=>{i.current.insideReactTree=!0}}),[T,c,i]);return M.useMemo(()=>s?{reference:D,floating:I}:{},[s,D,I])}function IF(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=PC(),i=M.useRef({}),[s]=M.useState(()=>MF()),a=ag()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!je(h)&&AF("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=M.useState(r.reference),u=In((h,g,p)=>{i.current.openEvent=h?g:void 0,s.emit("openchange",{open:h,event:g,reason:p,nested:a}),n?.(h,g,p)}),f=M.useMemo(()=>({setPositionReference:c}),[]),d=M.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return M.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:o,refs:f}),[t,u,d,s,o,f])}function ug(e){e===void 0&&(e={});const{nodeId:t}=e,n=IF({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=M.useState(null),[a,l]=M.useState(null),u=o?.domReference||i,f=M.useRef(null),d=lg();Mi(()=>{u&&(f.current=u)},[u]);const h=bF({...e,elements:{...o,...a&&{reference:a}}}),g=M.useCallback(v=>{const b=je(v)?{getBoundingClientRect:()=>v.getBoundingClientRect(),getClientRects:()=>v.getClientRects(),contextElement:v}:v;l(b),h.refs.setReference(b)},[h.refs]),p=M.useCallback(v=>{(je(v)||v===null)&&(f.current=v,s(v)),(je(h.refs.reference.current)||h.refs.reference.current===null||v!==null&&!je(v))&&h.refs.setReference(v)},[h.refs]),m=M.useMemo(()=>({...h.refs,setReference:p,setPositionReference:g,domReference:f}),[h.refs,p,g]),x=M.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),y=M.useMemo(()=>({...h,...r,refs:m,elements:x,nodeId:t}),[h,m,x,t,r]);return Mi(()=>{r.dataRef.current.floatingContext=y;const v=d?.nodesRef.current.find(b=>b.id===t);v&&(v.context=y)}),M.useMemo(()=>({...h,context:y,refs:m,elements:x}),[h,m,x,y])}function Pu(){return NL()&&ML()}function DF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=M.useRef(!1),u=M.useRef(-1),f=M.useRef(!0);M.useEffect(()=>{if(!a)return;const h=Bt(s.domReference);function g(){!n&&Pt(s.domReference)&&s.domReference===Bv(ho(s.domReference))&&(c.current=!0)}function p(){f.current=!0}function m(){f.current=!1}return h.addEventListener("blur",g),Pu()&&(h.addEventListener("keydown",p,!0),h.addEventListener("pointerdown",m,!0)),()=>{h.removeEventListener("blur",g),Pu()&&(h.removeEventListener("keydown",p,!0),h.removeEventListener("pointerdown",m,!0))}},[s.domReference,n,a]),M.useEffect(()=>{if(!a)return;function h(g){let{reason:p}=g;(p==="reference-press"||p==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),M.useEffect(()=>()=>{nn(u)},[]);const d=M.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const g=ni(h.nativeEvent);if(l&&je(g)){if(Pu()&&!h.relatedTarget){if(!f.current&&!SC(g))return}else if(!$L(g))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const g=h.relatedTarget,p=h.nativeEvent,m=je(g)&&g.hasAttribute(cg("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var x;const y=Bv(s.domReference?s.domReference.ownerDocument:document);!g&&y===s.domReference||Is((x=i.current.floatingContext)==null?void 0:x.refs.floating.current,y)||Is(s.domReference,y)||m||r(!1,p,"focus")})}}),[i,s.domReference,r,l]);return M.useMemo(()=>a?{reference:d}:{},[a,d])}function Lu(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[qv]:s,[Yv]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[_F]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[qv,Yv].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var d,h=arguments.length,g=new Array(h),p=0;p<h;p++)g[p]=arguments[p];return(d=r.get(c))==null?void 0:d.map(m=>m(...g)).find(m=>m!==void 0)}}}else s[c]=u}),s),{})}}function $C(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=M.useCallback(a=>Lu(a,e,"reference"),t),i=M.useCallback(a=>Lu(a,e,"floating"),n),s=M.useCallback(a=>Lu(a,e,"item"),r);return M.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const jF=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function OC(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=PC(),u=((n=i.domReference)==null?void 0:n.id)||c,f=M.useMemo(()=>{var y;return((y=OL(i.floating))==null?void 0:y.id)||s},[i.floating,s]),d=(r=jF.get(l))!=null?r:l,g=ag()!=null,p=M.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:u},...d==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,g,o,u,l]),m=M.useMemo(()=>{const y={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?y:{...y,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,l]),x=M.useCallback(y=>{let{active:v,selected:b}=y;const w={role:"option",...v&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...w,"aria-selected":b}}return{}},[f,l]);return M.useMemo(()=>a?{reference:p,floating:m,item:x}:{},[a,p,m,x])}const VF=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M6 9L12 15L18 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),BF=e=>M.createElement("svg",{fill:"currentColor",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 462.035 462.035",xmlSpace:"preserve",...e},M.createElement("g",null,M.createElement("path",{d:"M457.83,158.441c-0.021-0.028-0.033-0.058-0.057-0.087l-50.184-62.48c-0.564-0.701-1.201-1.305-1.879-1.845 c-2.16-2.562-5.355-4.225-8.967-4.225H65.292c-3.615,0-6.804,1.661-8.965,4.225c-0.678,0.54-1.316,1.138-1.885,1.845l-50.178,62.48 c-0.023,0.029-0.034,0.059-0.057,0.087C1.655,160.602,0,163.787,0,167.39v193.07c0,6.5,5.27,11.771,11.77,11.771h438.496 c6.5,0,11.77-5.271,11.77-11.771V167.39C462.037,163.787,460.381,160.602,457.83,158.441z M408.516,134.615l16.873,21.005h-16.873 V134.615z M384.975,113.345v42.274H296.84c-2.514,0-4.955,0.805-6.979,2.293l-58.837,43.299l-58.849-43.305 c-2.023-1.482-4.466-2.287-6.978-2.287H77.061v-42.274H384.975z M53.523,155.62H36.65l16.873-21.005V155.62z M438.498,348.69H23.54 V179.16h137.796l62.711,46.148c4.15,3.046,9.805,3.052,13.954-0.005l62.698-46.144h137.799V348.69L438.498,348.69z"}))),IC=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{opacity:.6},M.createElement("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))),{color:Qt,cornerRadius:zF,spacing:ri}=j,Fu={sm:{h:28,p:`${ri.xs} ${ri.sm}`,text:"body-2"},md:{h:32,p:`6px ${ri.md}`,text:"body-2"},lg:{h:40,p:`${ri.sm} ${ri.lg}`,text:"body-1"}},dg=S.forwardRef(({label:e,color:t="primary",size:n="md",onClick:r,onDelete:o,avatar:i,icon:s,disabled:a,className:l},c)=>{const u=S.useRef(null),f=S.useMemo(()=>{switch(t){case"primary":return{bg:Qt.status.neutralTintLow,color:Qt.text.primary};case"accent":return{bg:Qt.status.accentTintLow,color:Qt.text.accent};case"warning":return{bg:Qt.status.warningTintLow,color:Qt.text.warning};case"positive":return{bg:Qt.status.positiveTintLow,color:Qt.text.positive};case"negative":return{bg:Qt.status.negativeTintLow,color:Qt.text.negative};case"transfer":return{bg:"var(--status-transfer-tint-low)",color:"var(--text-transfer)"};default:return{bg:Qt.status.neutralTintLow,color:Qt.text.primary}}},[t]),d=R.css({cursor:a?"not-allowed":r?"pointer":"default",opacity:a?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s","&:hover":a?void 0:{backgroundColor:f.bg}}),h=R.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}});return C.jsxs(G,{ref:g=>{u.current=g,typeof c=="function"?c(g):c&&(c.current=g)},row:!0,alignItems:"center",justifyContent:"center",gap:ri.sm,h:Fu[n].h,p:Fu[n].p,overflow:"hidden",borderRadius:zF.sm,backgroundColor:f.bg,color:f.color,onClick:r,className:R.cx(d,l),children:[r&&C.jsx(Lo,{}),i&&C.jsx(G,{w:20,h:20,borderRadius:"50%",overflow:"hidden",children:i}),s&&C.jsx(G,{children:s}),typeof e=="string"?C.jsx(se,{variant:Fu[n].text,colorName:t,textOverflow:"ellipsis",overflow:"hidden",children:e}):e,o&&!a&&C.jsx(se,{className:h,colorName:t,onClick:g=>{g.stopPropagation(),o(g)},children:C.jsx(IC,{})})]})});dg.displayName="Tag";const{color:Et,cornerRadius:is}=j,n0=R.css({borderColor:Et.border.negativePrimary}),$u=R.css({cursor:"not-allowed",opacity:.5}),DC=R.css({display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",color:"#9ca3af","& svg":{width:20,height:20,transition:"transform 0.2s ease-in"}}),HF=R.css({[`& .${DC} svg`]:{transform:"rotateX(180deg)"}}),ct={"select-container":R.css({position:"relative",display:"inline-block",minWidth:120,"&.full-width":{width:"100%"}}),"full-width":R.css({width:"100%"}),"select-input":R.css({border:`1px solid ${Et.border.neutralAlphaBasic}`,borderRadius:is.md,cursor:"pointer",transition:"all 0.2s ease-in-out",boxSizing:"border-box",[`&:hover:not(.${$u})`]:{borderColor:Et.border.neutralAlphaHigh,backgroundColor:Et.fill.neutralPrimaryHover},[`&:focus:not(.${$u})`]:{outline:"none",borderColor:Et.border.accentPrimary},[`&.${n0}:focus`]:{boxShadow:`0 0 0 3px ${Et.effect.shadowS}`}}),"size-xs":R.css({minHeight:32,padding:"8px 8px 8px 12px",borderRadius:is.sm}),"size-sm":R.css({minHeight:40,padding:"10px 12px 10px 16px",borderRadius:is.sm}),"size-md":R.css({minHeight:48,padding:"14px 12px 14px 16px",borderRadius:is.md}),"background-primary":R.css({backgroundColor:Et.fill.bgPrimary}),"background-secondary":R.css({backgroundColor:Et.fill.bgSecondary}),error:n0,disabled:$u,open:HF,"select-value":R.css({flex:1,color:Et.text.primary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",alignSelf:"center",...me.common,...me.body2}),"select-value_xs":R.css({...me.common,...me.caption1}),hidden:R.css({visibility:"hidden"}),visible:R.css({visibility:"visible"}),"select-arrow":DC,"select-dropdown":R.css({marginTop:4,backgroundColor:Et.fill.bgPrimary,borderRadius:is.md,boxShadow:`0 4px 20px 0 ${Et.effect.shadowS}`,maxHeight:224,overflow:"hidden"}),"select-menu":R.css({maxHeight:224,overflowY:"auto",padding:"4px 0","&::-webkit-scrollbar":{width:3},"&::-webkit-scrollbar-track":{background:"#f1f1f1"},"&::-webkit-scrollbar-thumb":{background:"#c1c1c1",borderRadius:3,"&:hover":{background:Et.fill.neutralSecondary}}}),"select-menu-item":R.css({cursor:"pointer",transition:"background-color 0.15s ease-in-out",color:Et.text.primary,padding:10,overflow:"hidden",textOverflow:"ellipsis","&:hover":{backgroundColor:Et.fill.neutralSecondaryHover}}),"select-menu-item-first":R.css({"&:hover":{cursor:"auto",backgroundColor:"inherit"}}),selected:R.css({backgroundColor:Et.fill.neutralSecondary}),"overflow-tooltip-container":R.css({width:"100%",position:"relative"}),"overflow-tooltip-text":R.css({width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),"empty-block":R.css({textAlign:"center",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:14})},WF={xs:R.css({width:16,height:16,"& svg":{width:16,height:16,transition:"transform 0.2s ease-in"}}),sm:R.css({}),md:R.css({})};function fg({value:e,onChange:t,multiple:n=!1,returnedValue:r,renderItem:o,renderInputItem:i,renderSingleInputItem:s,renderMultipleInputItem:a,renderDropdownItem:l,placeholder:c,items:u=[],fullWidth:f,size:d="md",showDefaultItem:h,disabled:g,label:p,firstItem:m,lastItem:x,observer:y,emptyText:v,onBlur:b,prompt:w,error:_,errorText:E,dropdownMaxWidth:T=400,dropdownMinWidth:k=120,minWidth:P=120,width:O,background:D="secondary",dropdownClassName:I}){const[$,H]=Po(e,n?[]:null),[U,L]=S.useState(!1),{refs:N,floatingStyles:V}=ug({open:U,strategy:"fixed",middleware:[og(4),sg({crossAxis:!0,fallbackAxisSideDirection:"start"}),ig({crossAxis:!0,padding:8}),CF({apply({availableHeight:ee,availableWidth:Ce,elements:ze,rects:Re}){const mt=Math.min(typeof Ce=="number"?Ce-64:T,T),Ft=Re.reference.width,Yt=Math.max(Ft,k);Object.assign(ze.floating.style,{maxHeight:typeof ee=="number"?`${ee}px`:"auto",maxWidth:`${mt}px`,minWidth:`${Yt}px`,width:"max-content"})}})],whileElementsMounted:rg}),K=S.useMemo(()=>n?$||[]:$!=null?[$]:[],[$,n]),te=S.useCallback(ee=>r?r(ee):ee,[r]),J=S.useMemo(()=>{const ee=new Map;return u.forEach(Ce=>{ee.set(te(Ce),Ce)}),ee},[u,te]),Z=!u.length&&!_,ae=S.useMemo(()=>K.map(ee=>J.get(ee)).filter(ee=>!!ee),[J,K]);S.useEffect(()=>{process.env.NODE_ENV!=="production"&&o&&!l&&console.warn("[Select] `renderItem` deprecated, use `renderDropdownItem` instead.")},[l,o]);const oe=S.useCallback((ee,Ce)=>l?l(ee,Ce):o?o(ee):String(ee),[l,o]),fe=()=>{L(!1),b?.()},Te=ee=>{const Ce=te(ee);if(n){const ze=K.includes(Ce)?K.filter(Re=>Re!==Ce):[...K,Ce];H(ze),t?.(ze)}else H(Ce),t?.(Ce),fe()},ne=ee=>{if(!n)return;const Ce=K.filter(ze=>ze!==ee);H(Ce),t?.(Ce)},ve=()=>{const ee=n?[]:null;H(ee),t?.(ee),n||fe()},Ee=()=>typeof c=="string"?C.jsx(se,{variant:d==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",colorName:"tertiary",children:c??"Select..."}):c,De=()=>{if(!K.length)return Ee();if(n)return a?a(ae):i?i({mode:"multiple",selectedItems:ae}):C.jsx(G,{flexWrap:"wrap",row:!0,gap:10,children:K.map(ze=>{const Re=J.get(ze);return Re?C.jsx(dg,{size:"sm",label:o?o(Re):String(ze),onDelete:mt=>{mt.stopPropagation(),ne(ze)}},ze):null})});const ee=J.get(K[0])??null;if(!ee)return Ee();if(s)return s(ee);if(i)return i({mode:"single",selectedItem:ee});const Ce=o?o(ee):String(K[0]);return typeof Ce=="string"?C.jsx(se,{variant:d==="xs"?"caption-1":"body-2",tag:"p",textOverflow:"ellipsis",overflow:"hidden",children:Ce}):C.jsx(C.Fragment,{children:Ce})},st=U&&C.jsx(Ki,{children:C.jsx(G,{row:!0,top:0,right:0,bottom:0,left:0,position:"fixed",center:!0,flex:1,onClick:fe,display:"block",backgroundColor:"transparent",zIndex:1,children:C.jsx(Ws.div,{ref:N.setFloating,className:R.cx(ct["select-dropdown"],I),initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{...V,zIndex:1},onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:C.jsxs("ul",{className:ct["select-menu"],children:[h&&!n&&C.jsx(G,{className:ct["select-menu-item"],role:"option",onClick:ve,children:C.jsx(se,{variant:"body-2",colorName:"tertiary",children:c})}),m&&C.jsx(G,{className:R.cx(ct["select-menu-item"],ct["select-menu-item-first"]),children:m}),Z&&C.jsxs(G,{className:ct["empty-block"],children:[C.jsx(G,{w:20,h:20,children:C.jsx(BF,{})}),C.jsx(se,{variant:"body-2",children:v??"There is nothing yet"})]}),u.map((ee,Ce)=>{const ze=te(ee),Re=K.includes(ze),mt=oe(ee,{item:ee,selected:Re,index:Ce}),Ft=typeof mt=="string";return C.jsxs(G,{row:!0,gap:10,alignItems:"center",className:R.cx(ct["select-menu-item"],{[ct.selected]:Re}),role:"option",relative:!0,onClick:()=>Te(ee),children:[n&&C.jsx(rh,{size:"sm",checked:Re}),Ft?C.jsx(se,{variant:"body-2",tag:"p",wordBreak:"break-all",whiteSpace:"break-spaces",children:mt}):mt,C.jsx(Lo,{})]},ze)}),y,x&&C.jsx(G,{className:R.cx(ct["select-menu-item"],ct["select-menu-item-first"]),children:x})]})},"dropdown")})});return C.jsxs(G,{relative:!0,display:"inline-block",minWidth:P,w:O||(f?"full":"auto"),onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:[typeof p=="string"?C.jsx(se,{variant:"body-2",colorName:"tertiary",fontWeight:"regular",mb:d==="sm"?4:8,children:p}):p,C.jsxs(G,{ref:N.setReference,row:!0,gap:10,tabIndex:g?-1:0,role:"button",alignItems:"flex-start","aria-haspopup":"listbox",relative:!0,w:"100%",className:R.cx(ct["select-input"],ct[`size-${d}`],ct[`background-${D}`],{[ct.error]:_,[ct.disabled]:g,[ct.open]:U}),onClick:()=>!g&&L(ee=>!ee),children:[C.jsx(G,{className:R.cx(ct["select-value"]),children:De()}),C.jsx(G,{className:R.cx(ct["select-arrow"],WF[d]),children:C.jsx(VF,{})})]}),typeof w=="string"?C.jsx(se,{variant:"caption-1",colorName:"tertiary",mt:4,children:w}):w,_&&E&&C.jsx(se,{tag:"p",colorName:"negative",variant:"body-2",mt:5,children:E}),C.jsx(Nx,{children:st})]})}const KF=e=>M.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M3.94629 0.220237C3.78013 0.264025 3.64089 0.377624 3.56348 0.53176C3.27371 1.11189 3.05664 1.46395 2.83887 1.74953C2.61807 2.03873 2.38547 2.27579 2.03027 2.63039C1.21079 3.45057 0.799805 4.52619 0.799805 5.60012C0.799838 6.67406 1.21073 7.74968 2.03027 8.56985C3.67062 10.2096 6.32931 10.2095 7.96973 8.56985C8.78929 7.74968 9.20016 6.67408 9.2002 5.60012C9.15131 4.32908 8.43217 3.48543 7.94727 3.05813C7.76902 2.90106 7.40643 3.02424 7.2627 3.2134C7.24031 3.24286 7.21612 3.2739 7.18945 3.30617C6.93211 3.61754 6.56236 3.80807 6.41504 3.83156C6.38264 3.83667 6.36979 3.76513 6.2959 3.58254C5.79455 2.34427 5.78927 2.49365 5.58887 2.01125C5.48847 1.7692 5.05517 1.02727 4.92676 0.828635C4.80206 0.635591 4.64095 0.439873 4.43359 0.301292C4.29028 0.205951 4.1124 0.175957 3.94629 0.220237ZM4.75293 4.17824C5.2689 4.63997 5.60857 5.26651 5.71484 5.95071C6.10631 5.85571 6.46727 5.68318 6.78125 5.45071C6.86578 5.70826 6.89338 5.98123 6.8623 6.25051C6.83115 6.51993 6.74174 6.77966 6.60059 7.01125C6.45944 7.24281 6.27008 7.44117 6.04492 7.59231C5.81977 7.74344 5.56462 7.8443 5.29688 7.88723C5.0292 7.93013 4.75518 7.91446 4.49414 7.84133C4.23299 7.76812 3.99064 7.6383 3.78418 7.46242C3.5778 7.28657 3.41161 7.06792 3.29785 6.8218C3.18419 6.57572 3.12519 6.30771 3.125 6.03664C3.12508 5.58233 3.29054 5.14308 3.58984 4.80129C3.88917 4.4597 4.30271 4.2382 4.75293 4.17824Z",fill:"#FEAD34"})),UF=e=>M.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M10.1483 8.61509C10.3344 8.26159 9.98299 7.89856 9.58534 7.93723C9.42671 7.95265 9.25857 7.9605 9.07422 7.96035C6.36522 7.9582 4.17129 5.76427 4.16914 3.05527C4.169 2.87115 4.17682 2.70321 4.19221 2.54477C4.23082 2.14712 3.86769 1.79411 3.50976 1.97161C2.03398 2.70343 1.20002 4.02274 1.20002 5.89477C1.20002 8.60377 3.3961 10.7998 6.1051 10.7998C7.97571 10.7998 9.38737 10.06 10.1483 8.61509Z",fill:"white"})),{color:en,cornerRadius:r0,height:Ou,spacing:GF,transition:o0}=j,Pn={container:R.css({width:"100%",cursor:"pointer",outline:"none",userSelect:"none",display:"flex",justifyContent:"space-between",gap:GF.md,"&.disabled":{cursor:"not-allowed",opacity:.5},"&.reverse":{flexDirection:"row-reverse"}}),disabled:R.css({cursor:"not-allowed",opacity:.5}),reverse:R.css({flexDirection:"row-reverse"}),switchContainer:R.css({"--width-switch-sm":"34px","--width-switch-md":"40px","--width-switch-lg":"52px","--size-thumb-sm":"18px","--size-thumb-md":"20px","--size-thumb-lg":"28px","--thumb-translate":"0px","&:has(input:checked)":{"--thumb-translate":"calc(var(--switch-width) - var(--thumb-width) - 4px)"}}),variant_accent:R.css({"&:has(input:not(:checked))":{"--switch-bg-color":en.fill.bgTertiary,"--thumb-bg-color":en.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":en.fill.accentPrimary,"--thumb-bg-color":en.fill.bgPrimary}}),variant_secondary:R.css({"&:has(input:not(:checked))":{"--switch-bg-color":en.fill.bgTertiary,"--thumb-bg-color":en.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":en.fill.accentSecondary,"--thumb-bg-color":en.fill.accentPrimary}}),variant_theme:R.css({"&:has(input:not(:checked))":{"--switch-bg-color":en.fill.bgTertiary,"--thumb-bg-color":en.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":en.fill.bgSecondary,"--thumb-bg-color":en.fill.bgTertiary}}),size_sm:R.css({"--switch-width":"var(--width-switch-sm)","--switch-height":Ou.switch.sm,"--thumb-width":"var(--size-thumb-sm)","--thumb-height":"var(--size-thumb-sm)"}),size_md:R.css({"--switch-width":"var(--width-switch-md)","--switch-height":Ou.switch.md,"--thumb-width":"var(--size-thumb-md)","--thumb-height":"var(--size-thumb-md)"}),size_lg:R.css({"--switch-width":"var(--width-switch-lg)","--switch-height":Ou.switch.lg,"--thumb-width":"var(--size-thumb-lg)","--thumb-height":"var(--size-thumb-lg)"}),switch:R.css({width:"var(--switch-width)",height:"var(--switch-height)",transition:o0.general,display:"flex",alignItems:"center",padding:2,backgroundColor:"var(--switch-bg-color)",borderRadius:r0.xl}),thumb:R.css({display:"flex",alignItems:"center",justifyContent:"center",padding:4,transition:o0.general,transform:"translateX(var(--thumb-translate, 0))",width:"var(--thumb-width)",height:"var(--thumb-height)",backgroundColor:"var(--thumb-bg-color)",borderRadius:r0.fullRound}),moon:R.css({width:"100%",height:"100%"}),fire:R.css({width:"100%",height:"100%"})},{spacing:i0}=j,jC=S.forwardRef(({title:e,text:t,icon:n,disabled:r,onChange:o,checked:i,defaultValue:s,className:a,size:l="md",variant:c="accent",reverse:u=!1,w:f="auto",...d},h)=>{const[g,p]=Po(i,s),m=S.useRef(null);S.useImperativeHandle(h,()=>({focus:()=>{m.current?.focus()},blur:()=>{m.current?.blur()},get checked(){return g??!1},setChecked:b=>{p(b),o?.(b)},toggle:()=>{const b=!g;p(b),o?.(b)},isFocused:()=>document.activeElement===m.current,isDisabled:()=>r??!1,getInputElement:()=>m.current,checkValidity:()=>m.current?.checkValidity()??!0,reset:()=>{const b=s??!1;p(b),o?.(b)}}),[g,p,o,r,s]);const x=S.useCallback(b=>{p(b.target.checked),o?.(b.target.checked)},[o]),y=S.useMemo(()=>typeof e=="string"?C.jsx(se,{variant:"body-1",colorName:"primary",fontWeight:"medium",children:e}):e,[e]),v=S.useMemo(()=>typeof t=="string"?C.jsx(se,{variant:"body-2",colorName:"secondary",fontWeight:"regular",children:t}):t,[t]);return C.jsxs(G,{row:!0,w:f,gap:i0.sm,children:[C.jsxs("label",{className:R.cx(Pn.container,a,{[Pn.disabled]:r,[Pn.reverse]:u}),children:[C.jsxs(G,{className:R.cx(Pn.switchContainer,Pn[`size_${l}`],Pn[`variant_${c}`]),children:[C.jsx("input",{ref:m,type:"checkbox",checked:g,hidden:!0,onChange:x,disabled:r,...d}),C.jsx("div",{className:Pn.switch,children:C.jsx("div",{className:Pn.thumb,children:c==="theme"&&(g?C.jsx(UF,{className:Pn.moon}):C.jsx(KF,{className:Pn.fire}))})})]}),(y||v)&&C.jsxs(G,{gap:i0.xs,children:[y,v]})]}),n]})});jC.displayName="Switch";const{spacing:s0}=j,qF=R.css({cursor:"pointer",userSelect:"none"}),YF=R.css({cursor:"not-allowed",opacity:.5}),XF=R.css({transition:"color 0.2s ease"}),ZF=S.forwardRef(({label:e,selected:t,disabled:n,fullWidth:r,onClick:o},i)=>C.jsx(G,{w:r?"full":void 0,justifyContent:"center",alignItems:"center",ref:i,py:s0.md,px:s0.xl,onClick:o,className:R.cx(qF,{[YF]:n}),children:C.jsx(se,{className:XF,colorName:t?"primary":"tertiary",fontWeight:"medium",variant:"body-2",children:e})})),{color:VC}=j,JF=R.css({borderBottom:`1px solid ${VC.border.neutralAlphaBasic}`}),BC=({value:e,onChange:t,options:n,fullWidth:r=!1,className:o})=>{const[i,s]=S.useState({left:0,width:0}),a=S.useRef([]),l=u=>f=>{a.current[u]=f};S.useEffect(()=>{const u=n.findIndex(d=>d.value===e),f=a.current[u];f&&s({left:f.offsetLeft,width:f.offsetWidth})},[e,n]);const c=(u,f=!1)=>()=>!f&&t(u);return C.jsxs(G,{row:!0,w:r?"full":"auto",relative:!0,className:R.cx(JF,o),children:[n.map((u,f)=>C.jsx(ZF,{selected:e===u.value,onClick:c(u.value,u.disabled),ref:l(f),label:u.label,disabled:u.disabled,fullWidth:r},u.value)),C.jsx(G,{h:2,w:i.width,absolute:!0,bottom:-1,left:i.left,backgroundColor:VC.border.accentPrimary,className:R.css({transition:"left 0.2s ease, width 0.2s ease"})})]})};BC.displayName="Tabs";const zC=S.forwardRef(({title:e,subtitle:t,w:n="full",p:r,py:o,px:i=j.spacing["2xl"],pt:s=j.spacing["2xl"],pb:a=j.spacing.lg,row:l=!0,justifyContent:c="space-between",showCloseButton:u=!1},f)=>{const{onClose:d}=H_();return C.jsxs(G,{w:n,p:r,py:o,px:i,pt:s,pb:a,row:l,justifyContent:c,ref:f,borderColor:j.color.border.neutralAlphaBasic,borderWidth:0,borderBottomWidth:1,borderStyle:"solid",children:[C.jsxs(G,{gap:j.spacing.sm,children:[C.jsx(se,{variant:"title-3",colorName:"primary",fontWeight:"semibold",children:e}),C.jsx(se,{variant:"body-1",colorName:"tertiary",fontWeight:"medium",children:t})]}),u&&C.jsx(G,{children:C.jsx(fr,{onClick:d,color:"neutral",children:C.jsx(F0,{})})})]})});zC.displayName="ModalHeader";function qo(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){var a,l,c;let u;n.key&&((a=n.debug)!=null&&a.call(n))&&(u=Date.now());const f=e();if(!(f.length!==r.length||f.some((g,p)=>r[p]!==g)))return o;r=f;let h;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(h=Date.now()),o=t(...f),n.key&&((c=n.debug)!=null&&c.call(n))){const g=Math.round((Date.now()-u)*100)/100,p=Math.round((Date.now()-h)*100)/100,m=p/16,x=(y,v)=>{for(y=String(y);y.length<v;)y=" "+y;return y};console.info(`%c⏱ ${x(p,5)} /${x(g,5)} ms`,`
67
67
  font-size: .6rem;
68
68
  font-weight: bold;
69
- color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1,o}return s.updateDeps=a=>{r=a},s}function o0(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const ZL=(e,t)=>Math.abs(e-t)<1.01,JL=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},i0=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},QL=e=>e,e$=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},t$=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(i0(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(i0(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},s0={passive:!0},a0=typeof window>"u"?!0:"onscrollend"in window,n$=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&a0?()=>{}:JL(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:f,isRtl:d}=e.options;o=f?n.scrollLeft*(d&&-1||1):n.scrollTop,i(),t(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,s0);const c=e.options.useScrollendEvent&&a0;return c&&n.addEventListener("scrollend",l,s0),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},r$=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},o$=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class i${constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:QL,rangeExtractor:e$,onChange:()=>{},measureElement:r$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=Uo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=Uo(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,i,s,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=Uo(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a},l)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const d of this.laneAssignments.keys())d>=n&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),f=new Array(a).fill(void 0);for(let d=0;d<c;d++){const h=u[d];h&&(f[h.lane]=d)}for(let d=c;d<n;d++){const h=i(d),g=this.laneAssignments.get(d);let p,m;if(g!==void 0&&this.options.lanes>1){p=g;const b=f[p],w=b!==void 0?u[b]:void 0;m=w?w.end+this.options.gap:r+o}else{const b=this.options.lanes===1?u[d-1]:this.getFurthestMeasurement(u,d);m=b?b.end+this.options.gap:r+o,p=b?b.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,p)}const x=l.get(h),y=typeof x=="number"?x:this.options.estimateSize(d),v=m+y;u[d]={index:d,start:m,size:y,end:v,key:h,lane:p},f[p]=d}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Uo(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?s$({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Uo(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=Uo(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return o0(r[$C(0,r.length-1,o=>o0(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const s=10,a=c=>{if(!this.targetWindow)return;const u=this.getOffsetForIndex(n,c);if(!u){console.warn("Failed to get offset for index:",n);return}const[f,d]=u;this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const h=this.getScrollOffset(),g=this.getOffsetForIndex(n,d);if(!g){console.warn("Failed to get offset for index:",n);return}ZL(g[0],h)||l(d)})},l=c=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>a(c))):console.warn(`Failed to scroll to index ${n} after ${s} attempts.`))};a(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>=0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const $C=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function s$({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1,i=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:o};let s=$C(0,o,i,n),a=s;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<o&&l.some(u=>u<n+t);){const u=e[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+t);for(;s>=0&&c.some(u=>u>=n);){const u=e[s];c[u.lane]=u.start,s--}s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:s,endIndex:a}}const l0=typeof document<"u"?M.useLayoutEffect:M.useEffect;function a$(e){const t=M.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?Ss.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=M.useState(()=>new i$(n));return r.setOptions(n),l0(()=>r._didMount(),[]),l0(()=>r._willUpdate()),r}function l$(e){return a$({observeElementRect:t$,observeElementOffset:n$,scrollToFn:o$,...e})}const c0={main:R.css({flex:0,overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:`${V.color.scrollbar.thumbPrimary} ${V.color.scrollbar.trackPrimary}`,"&::-webkit-scrollbar":{width:6},"&::-webkit-scrollbar-track":{background:V.color.scrollbar.trackPrimary,borderRadius:V.cornerRadius.fullRound},"&::-webkit-scrollbar-thumb":{borderRadius:V.cornerRadius.fullRound,backgroundColor:V.color.scrollbar.thumbPrimary}})},OC=S.forwardRef(({children:e,className:t,row:n=!1,estimatedItemHeight:r=100,virtualize:o=!1,maxHeight:i=448},s)=>{const a=S.useRef(null),l=S.useMemo(()=>S.Children.toArray(e),[e]),c=l$({count:l.length,getScrollElement:()=>a.current,estimateSize:()=>r,measureElement:f=>f.getBoundingClientRect().height});return S.useImperativeHandle(s,()=>({scrollToTop:()=>c.scrollToOffset(0,{behavior:"smooth"}),scrollToBottom:()=>c.scrollToOffset(c.getTotalSize(),{behavior:"smooth"}),scrollToIndex:(f,d={})=>c.scrollToIndex(f,{behavior:"smooth",...d}),scrollToOffset:(f,d={})=>c.scrollToOffset(f,{behavior:"smooth",...d}),scrollBy:f=>{const d=c.scrollOffset||0;c.scrollToOffset(d+f,{behavior:"smooth"})},getElement:()=>a.current,getScrollOffset:()=>c.scrollOffset||0,getTotalSize:()=>c.getTotalSize()}),[c]),S.useMemo(()=>o||l.length>50,[o,l])&&l.length>0?C.jsx(G,{ref:a,row:n,maxHeight:i,className:R.cx(c0.main,t),w:"full",p:V.spacing["2xl"],children:C.jsx(G,{relative:!0,h:c.getTotalSize(),children:c.getVirtualItems().map(f=>C.jsx(G,{"data-index":f.index,ref:c.measureElement,w:"full",absolute:!0,style:{top:0,left:0,transform:`translateY(${f.start}px)`},children:l[f.index]},f.key))})}):C.jsx(G,{ref:a,className:R.cx(c0.main,t),w:"full",row:n,pl:V.spacing["2xl"],pr:V.spacing.xs,children:C.jsx(G,{py:V.spacing["2xl"],pr:V.spacing.xl,children:e})})});OC.displayName="ModalMain";const cc=F0;cc.Header=LC;cc.Main=OC;cc.Footer=L0;const IC=S.createContext(null),c$=()=>S.useContext(IC),Hi=({children:e})=>{const[t,n]=S.useState(null),r=c$();return S.useEffect(()=>{if(typeof document>"u")return;const o=r?.current??document.body;if(!o)return;let i=o.querySelector("[data-portal-root]")??void 0;i||(i=document.createElement("div"),i.setAttribute("data-portal-root","true"),o.appendChild(i)),n(i)},[r]),t?Ss.createPortal(e,t):null};function DC(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function Mr(e,t){return typeof e=="function"?e(t):e}function qt(e,t){return n=>{t.setState(r=>({...r,[e]:Mr(n,r[e])}))}}function uc(e){return e instanceof Function}function u$(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function d$(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function ce(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,f)=>r[f]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,d=f/16,h=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${h(f,5)} /${h(u,5)} ms`,`
69
+ color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1,o}return s.updateDeps=a=>{r=a},s}function a0(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const QF=(e,t)=>Math.abs(e-t)<1.01,e$=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},l0=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},t$=e=>e,n$=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},r$=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(l0(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(l0(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},c0={passive:!0},u0=typeof window>"u"?!0:"onscrollend"in window,o$=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&u0?()=>{}:e$(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:f,isRtl:d}=e.options;o=f?n.scrollLeft*(d&&-1||1):n.scrollTop,i(),t(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,c0);const c=e.options.useScrollendEvent&&u0;return c&&n.addEventListener("scrollend",l,c0),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},i$=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},s$=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class a${constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:t$,rangeExtractor:n$,onChange:()=>{},measureElement:i$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=qo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=qo(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,i,s,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=qo(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a},l)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const d of this.laneAssignments.keys())d>=n&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),f=new Array(a).fill(void 0);for(let d=0;d<c;d++){const h=u[d];h&&(f[h.lane]=d)}for(let d=c;d<n;d++){const h=i(d),g=this.laneAssignments.get(d);let p,m;if(g!==void 0&&this.options.lanes>1){p=g;const b=f[p],w=b!==void 0?u[b]:void 0;m=w?w.end+this.options.gap:r+o}else{const b=this.options.lanes===1?u[d-1]:this.getFurthestMeasurement(u,d);m=b?b.end+this.options.gap:r+o,p=b?b.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,p)}const x=l.get(h),y=typeof x=="number"?x:this.options.estimateSize(d),v=m+y;u[d]={index:d,start:m,size:y,end:v,key:h,lane:p},f[p]=d}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=qo(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?l$({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=qo(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=qo(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return a0(r[HC(0,r.length-1,o=>a0(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const s=10,a=c=>{if(!this.targetWindow)return;const u=this.getOffsetForIndex(n,c);if(!u){console.warn("Failed to get offset for index:",n);return}const[f,d]=u;this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const h=this.getScrollOffset(),g=this.getOffsetForIndex(n,d);if(!g){console.warn("Failed to get offset for index:",n);return}QF(g[0],h)||l(d)})},l=c=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>a(c))):console.warn(`Failed to scroll to index ${n} after ${s} attempts.`))};a(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>=0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const HC=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function l$({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1,i=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:o};let s=HC(0,o,i,n),a=s;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<o&&l.some(u=>u<n+t);){const u=e[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+t);for(;s>=0&&c.some(u=>u>=n);){const u=e[s];c[u.lane]=u.start,s--}s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:s,endIndex:a}}const d0=typeof document<"u"?M.useLayoutEffect:M.useEffect;function c$(e){const t=M.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?Ts.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=M.useState(()=>new a$(n));return r.setOptions(n),d0(()=>r._didMount(),[]),d0(()=>r._willUpdate()),r}function u$(e){return c$({observeElementRect:r$,observeElementOffset:o$,scrollToFn:s$,...e})}const f0={main:R.css({flex:0,overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:`${j.color.scrollbar.thumbPrimary} ${j.color.scrollbar.trackPrimary}`,"&::-webkit-scrollbar":{width:6},"&::-webkit-scrollbar-track":{background:j.color.scrollbar.trackPrimary,borderRadius:j.cornerRadius.fullRound},"&::-webkit-scrollbar-thumb":{borderRadius:j.cornerRadius.fullRound,backgroundColor:j.color.scrollbar.thumbPrimary}})},WC=S.forwardRef(({children:e,className:t,row:n=!1,estimatedItemHeight:r=100,virtualize:o=!1,maxHeight:i=448},s)=>{const a=S.useRef(null),l=S.useMemo(()=>S.Children.toArray(e),[e]),c=u$({count:l.length,getScrollElement:()=>a.current,estimateSize:()=>r,measureElement:f=>f.getBoundingClientRect().height});return S.useImperativeHandle(s,()=>({scrollToTop:()=>c.scrollToOffset(0,{behavior:"smooth"}),scrollToBottom:()=>c.scrollToOffset(c.getTotalSize(),{behavior:"smooth"}),scrollToIndex:(f,d={})=>c.scrollToIndex(f,{behavior:"smooth",...d}),scrollToOffset:(f,d={})=>c.scrollToOffset(f,{behavior:"smooth",...d}),scrollBy:f=>{const d=c.scrollOffset||0;c.scrollToOffset(d+f,{behavior:"smooth"})},getElement:()=>a.current,getScrollOffset:()=>c.scrollOffset||0,getTotalSize:()=>c.getTotalSize()}),[c]),S.useMemo(()=>o||l.length>50,[o,l])&&l.length>0?C.jsx(G,{ref:a,row:n,maxHeight:i,className:R.cx(f0.main,t),w:"full",p:j.spacing["2xl"],children:C.jsx(G,{relative:!0,h:c.getTotalSize(),children:c.getVirtualItems().map(f=>C.jsx(G,{"data-index":f.index,ref:c.measureElement,w:"full",absolute:!0,style:{top:0,left:0,transform:`translateY(${f.start}px)`},children:l[f.index]},f.key))})}):C.jsx(G,{ref:a,className:R.cx(f0.main,t),w:"full",row:n,pl:j.spacing["2xl"],pr:j.spacing.xs,children:C.jsx(G,{py:j.spacing["2xl"],pr:j.spacing.xl,children:e})})});WC.displayName="ModalMain";const hc=O0;hc.Header=zC;hc.Main=WC;hc.Footer=I0;const KC=S.createContext(null),d$=()=>S.useContext(KC),Ki=({children:e})=>{const[t,n]=S.useState(null),r=d$();return S.useEffect(()=>{if(typeof document>"u")return;const o=r?.current??document.body;if(!o)return;let i=o.querySelector("[data-portal-root]")??void 0;i||(i=document.createElement("div"),i.setAttribute("data-portal-root","true"),o.appendChild(i)),n(i)},[r]),t?Ts.createPortal(e,t):null};function UC(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function Nr(e,t){return typeof e=="function"?e(t):e}function qt(e,t){return n=>{t.setState(r=>({...r,[e]:Nr(n,r[e])}))}}function gc(e){return e instanceof Function}function f$(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function h$(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function ce(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,f)=>r[f]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,d=f/16,h=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${h(f,5)} /${h(u,5)} ms`,`
70
70
  font-size: .6rem;
71
71
  font-weight: bold;
72
- color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n?.key)}return o}}function ue(e,t,n,r){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function f$(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:ce(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),ue(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function h$(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=d=>{let h=d;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${p}" in deeply nested key "${l}" returned undefined.`)}return h}:u=d=>d[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:ce(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},ue(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ce(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(p=>p.getLeafColumns());return d(g)}return[f]},ue(e.options,"debugColumns","column.getLeafColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(f,e);return f}const vt="debugHeaders";function u0(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const g$={createTable:e=>{e.getHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?i:[],l=(s=o?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return Fa(t,[...a,...c,...l],e)},ue(e.options,vt,"getHeaderGroups")),e.getCenterHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Fa(t,n,e,"center")),ue(e.options,vt,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Fa(t,i,e,"left")},ue(e.options,vt,"getLeftHeaderGroups")),e.getRightHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Fa(t,i,e,"right")},ue(e.options,vt,"getRightHeaderGroups")),e.getFooterGroups=ce(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ue(e.options,vt,"getFooterGroups")),e.getLeftFooterGroups=ce(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ue(e.options,vt,"getLeftFooterGroups")),e.getCenterFooterGroups=ce(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ue(e.options,vt,"getCenterFooterGroups")),e.getRightFooterGroups=ce(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ue(e.options,vt,"getRightFooterGroups")),e.getFlatHeaders=ce(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,vt,"getFlatHeaders")),e.getLeftFlatHeaders=ce(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,vt,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ce(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,vt,"getCenterFlatHeaders")),e.getRightFlatHeaders=ce(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,vt,"getRightFlatHeaders")),e.getCenterLeafHeaders=ce(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,vt,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ce(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,vt,"getLeftLeafHeaders")),e.getRightLeafHeaders=ce(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,vt,"getRightLeafHeaders")),e.getLeafHeaders=ce(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},ue(e.options,vt,"getLeafHeaders"))}};function Fa(e,t,n,r){var o,i;let s=0;const a=function(d,h){h===void 0&&(h=1),s=Math.max(s,h),d.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(m=>{const x=[...p].reverse()[0],y=m.column.depth===g.depth;let v,b=!1;if(y&&m.column.parent?v=m.column.parent:(v=m.column,b=!0),x&&x?.column===v)x.subHeaders.push(m);else{const w=u0(n,v,{id:[r,h,v.id,m?.id].filter(Boolean).join("_"),isPlaceholder:b,placeholderId:b?`${p.filter(_=>_.column===v).length}`:void 0,depth:h,index:p.length});w.subHeaders.push(m),p.push(w)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&c(p,h-1)},u=t.map((d,h)=>u0(n,d,{depth:s,index:h}));c(u,s-1),l.reverse();const f=d=>d.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=0,x=[0];g.subHeaders&&g.subHeaders.length?(x=[],f(g.subHeaders).forEach(v=>{let{colSpan:b,rowSpan:w}=v;p+=b,x.push(w)})):p=1;const y=Math.min(...x);return m=m+y,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const p$=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>d$(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:ce(()=>[e.getAllLeafColumns()],l=>l.map(c=>f$(e,a,c,c.id)),ue(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ce(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),ue(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},m$={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},VC=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};VC.autoRemove=e=>_n(e);const jC=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};jC.autoRemove=e=>_n(e);const BC=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};BC.autoRemove=e=>_n(e);const zC=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};zC.autoRemove=e=>_n(e);const HC=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});HC.autoRemove=e=>_n(e)||!(e!=null&&e.length);const WC=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});WC.autoRemove=e=>_n(e)||!(e!=null&&e.length);const KC=(e,t,n)=>e.getValue(t)===n;KC.autoRemove=e=>_n(e);const UC=(e,t,n)=>e.getValue(t)==n;UC.autoRemove=e=>_n(e);const ug=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};ug.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};ug.autoRemove=e=>_n(e)||_n(e[0])&&_n(e[1]);const rr={includesString:VC,includesStringSensitive:jC,equalsString:BC,arrIncludes:zC,arrIncludesAll:HC,arrIncludesSome:WC,equals:KC,weakEquals:UC,inNumberRange:ug};function _n(e){return e==null||e===""}const y$={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:qt("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?rr.includesString:typeof r=="number"?rr.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?rr.equals:Array.isArray(r)?rr.arrIncludes:rr.weakEquals},e.getFilterFn=()=>{var n,r;return uc(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:rr[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r?.find(u=>u.id===e.id),s=Mr(n,i?i.value:void 0);if(d0(o,s,e)){var a;return(a=r?.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r?.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Mr(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(d0(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function d0(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const v$=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),x$=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},b$=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},w$=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},C$=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},S$=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!u$(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},_$=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),T$=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,E$=(e,t)=>t.length,Fu={sum:v$,min:x$,max:b$,extent:w$,mean:C$,median:S$,unique:_$,uniqueCount:T$,count:E$},R$={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:qt("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return Fu.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Fu.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return uc(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Fu[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function k$(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const A$={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:qt("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ce(n=>[ws(t,n)],n=>n.findIndex(r=>r.id===e.id),ue(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=ws(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=ws(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ce(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return k$(i,n,r)},ue(e.options,"debugTable","_getOrderColumnsFn"))}},Lu=()=>({left:[],right:[]}),M$={getInitialState:e=>({columnPinning:Lu(),...e}),getDefaultOptions:e=>({onColumnPinningChange:qt("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o?.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=o?.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o?.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o?.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o?.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o?.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},ue(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ue(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ue(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Lu():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Lu())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ue(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ue(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},ue(e.options,"debugColumns","getCenterLeafColumns"))}};function N$(e){return e||(typeof document<"u"?document:null)}const La={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},$u=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),P$={getDefaultColumnDef:()=>La,getInitialState:e=>({columnSizing:{},columnSizingInfo:$u(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:qt("columnSizing",e),onColumnSizingInfoChange:qt("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:La.minSize,(r=i??e.columnDef.size)!=null?r:La.size),(o=e.columnDef.maxSize)!=null?o:La.maxSize)},e.getStart=ce(n=>[n,ws(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),ue(t.options,"debugColumns","getStart")),e.getAfter=ce(n=>[n,ws(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),ue(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r?.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Ou(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(x=>[x.column.id,x.column.getSize()]):[[r.id,r.getSize()]],l=Ou(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(x,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(v=>{var b,w;const _=t.options.columnResizeDirection==="rtl"?-1:1,E=(y-((b=v?.startOffset)!=null?b:0))*_,T=Math.max(E/((w=v?.startSize)!=null?w:0),-.999999);return v.columnSizingStart.forEach(k=>{let[P,O]=k;c[P]=Math.round(Math.max(O+O*T,0)*100)/100}),{...v,deltaOffset:E,deltaPercentage:T}}),(t.options.columnResizeMode==="onChange"||x==="end")&&t.setColumnSizing(v=>({...v,...c})))},f=x=>u("move",x),d=x=>{u("end",x),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=N$(n),g={moveHandler:x=>f(x.clientX),upHandler:x=>{h?.removeEventListener("mousemove",g.moveHandler),h?.removeEventListener("mouseup",g.upHandler),d(x.clientX)}},p={moveHandler:x=>(x.cancelable&&(x.preventDefault(),x.stopPropagation()),f(x.touches[0].clientX),!1),upHandler:x=>{var y;h?.removeEventListener("touchmove",p.moveHandler),h?.removeEventListener("touchend",p.upHandler),x.cancelable&&(x.preventDefault(),x.stopPropagation()),d((y=x.touches[0])==null?void 0:y.clientX)}},m=F$()?{passive:!1}:!1;Ou(i)?(h?.addEventListener("touchmove",p.moveHandler,m),h?.addEventListener("touchend",p.upHandler,m)):(h?.addEventListener("mousemove",g.moveHandler,m),h?.addEventListener("mouseup",g.upHandler,m)),t.setColumnSizingInfo(x=>({...x,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?$u():(n=e.initialState.columnSizingInfo)!=null?n:$u())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let $a=null;function F$(){if(typeof $a=="boolean")return $a;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return $a=e,$a}function Ou(e){return e.type==="touchstart"}const L$={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:qt("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ce(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ue(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ce(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],ue(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>ce(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ue(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function ws(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const $$={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},O$={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:qt("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>rr.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return uc(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:rr[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},I$={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:qt("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},uf=0,df=10,Iu=()=>({pageIndex:uf,pageSize:df}),D$={getInitialState:e=>({...e,pagination:{...Iu(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:qt("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>Mr(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Iu():(o=e.initialState.pagination)!=null?o:Iu())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Mr(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?uf:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:uf)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?df:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:df)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Mr(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=Mr(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=ce(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},ue(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Du=()=>({top:[],bottom:[]}),V$={getInitialState:e=>({rowPinning:Du(),...e}),getDefaultOptions:e=>({onRowPinningChange:qt("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,d;return{top:((f=l?.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((d=l?.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=l?.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=l?.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((c=l?.top)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((u=l?.bottom)!=null?u:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Du():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Du())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ue(e.options,"debugRows","getTopRows")),e.getBottomRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ue(e.options,"debugRows","getBottomRows")),e.getCenterRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},ue(e.options,"debugRows","getCenterRows"))}},j$={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:qt("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{ff(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Vu(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Vu(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Vu(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return ff(a,e.id,n,(s=r?.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return dg(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return hf(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return hf(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},ff=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>ff(e,a.id,n,r,o))};function Vu(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=dg(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function dg(e,t){var n;return(n=t[e.id])!=null?n:!1}function hf(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(dg(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=hf(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const gf=/([0-9]+)/gm,B$=(e,t,n)=>GC(Wr(e.getValue(n)).toLowerCase(),Wr(t.getValue(n)).toLowerCase()),z$=(e,t,n)=>GC(Wr(e.getValue(n)),Wr(t.getValue(n))),H$=(e,t,n)=>fg(Wr(e.getValue(n)).toLowerCase(),Wr(t.getValue(n)).toLowerCase()),W$=(e,t,n)=>fg(Wr(e.getValue(n)),Wr(t.getValue(n))),K$=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},U$=(e,t,n)=>fg(e.getValue(n),t.getValue(n));function fg(e,t){return e===t?0:e>t?1:-1}function Wr(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function GC(e,t){const n=e.split(gf).filter(Boolean),r=t.split(gf).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const os={alphanumeric:B$,alphanumericCaseSensitive:z$,text:H$,textCaseSensitive:W$,datetime:K$,basic:U$},G$={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:qt("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return os.datetime;if(typeof i=="string"&&(r=!0,i.split(gf).length>1))return os.alphanumeric}return r?os.text:os.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return uc(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:os[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s?.find(h=>h.id===e.id),l=s?.findIndex(h=>h.id===e.id);let c=[],u,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var d;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},q$=[g$,L$,A$,M$,m$,y$,$$,O$,G$,R$,I$,D$,V$,j$,P$];function Y$(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...q$,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((d,h)=>Object.assign(d,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=d=>o.options.mergeOptions?o.options.mergeOptions(i,d):{...i,...d};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(d=>{var h;l=(h=d.getInitialState==null?void 0:d.getInitialState(l))!=null?h:l});const c=[];let u=!1;const f={_features:r,options:{...i,...e},initialState:l,_queue:d=>{c.push(d),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:d=>{const h=Mr(d,o.options);o.options=s(h)},getState:()=>o.options.state,setState:d=>{o.options.onStateChange==null||o.options.onStateChange(d)},_getRowId:(d,h,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(d,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(d,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[d];if(!g&&(g=o.getCoreRowModel().rowsById[d],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${d}`):new Error;return g},_getDefaultColumnDef:ce(()=>[o.options.defaultColumn],d=>{var h;return d=(h=d)!=null?h:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,m;return(p=(m=g.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...d}},ue(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:ce(()=>[o._getColumnDefs()],d=>{const h=function(g,p,m){return m===void 0&&(m=0),g.map(x=>{const y=h$(o,x,m,p),v=x;return y.columns=v.columns?h(v.columns,y,m+1):[],y})};return h(d)},ue(e,"debugColumns","getAllColumns")),getAllFlatColumns:ce(()=>[o.getAllColumns()],d=>d.flatMap(h=>h.getFlatColumns()),ue(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ce(()=>[o.getAllFlatColumns()],d=>d.reduce((h,g)=>(h[g.id]=g,h),{}),ue(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ce(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(d,h)=>{let g=d.flatMap(p=>p.getLeafColumns());return h(g)},ue(e,"debugColumns","getAllLeafColumns")),getColumn:d=>{const h=o._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${d}' does not exist.`),h}};Object.assign(o,f);for(let d=0;d<o._features.length;d++){const h=o._features[d];h==null||h.createTable==null||h.createTable(o)}return o}function X$(){return e=>ce(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=p$(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s?.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},ue(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Z$(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function J$(e){return t=>ce(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=Z$({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const d=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(d)};return f.rows.forEach(d),f},ue(t.options,"debugTable","getPaginationRowModel"))}function Q$(){return e=>ce(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,f)=>{for(let h=0;h<i.length;h+=1){var d;const g=i[h],p=s[g.id],m=p.sortUndefined,x=(d=g?.desc)!=null?d:!1;let y=0;if(m){const v=u.getValue(g.id),b=f.getValue(g.id),w=v===void 0,_=b===void 0;if(w||_){if(m==="first")return w?-1:1;if(m==="last")return w?1:-1;y=w&&_?0:w?m:-m}}if(y===0&&(y=p.sortingFn(u,f,g.id)),y!==0)return x&&(y*=-1),p.invertSorting&&(y*=-1),y}return u.index-f.index}),c.forEach(u=>{var f;o.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},ue(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function f0(e,t){return e?eO(e)?M.createElement(e,t):e:null}function eO(e){return tO(e)||typeof e=="function"||nO(e)}function tO(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function nO(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function rO(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=M.useState(()=>({current:Y$(t)})),[r,o]=M.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const oO=e=>M.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("style",null,`\r
73
- @keyframes spin {\r
74
- from {\r
75
- transform: rotate(0deg);\r
76
- }\r
77
- to {\r
78
- transform: rotate(360deg);\r
79
- }\r
80
- }\r
81
- .spinner {\r
82
- transform-origin: center;\r
83
- animation: spin 1s linear infinite;\r
84
- }\r
85
- `),M.createElement("g",{className:"spinner"},M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0003 6.83317C13.5692 6.83317 11.2376 7.79894 9.51851 9.51803C7.79943 11.2371 6.83366 13.5687 6.83366 15.9998C6.83366 18.431 7.79943 20.7626 9.51851 22.4817C11.2376 24.2007 13.5692 25.1665 16.0003 25.1665C18.4315 25.1665 20.7631 24.2007 22.4821 22.4817C24.2012 20.7626 25.167 18.431 25.167 15.9998C25.167 13.5687 24.2012 11.2371 22.4821 9.51803C20.7631 7.79894 18.4315 6.83317 16.0003 6.83317ZM3.16699 15.9998C3.16699 8.91217 8.91266 3.1665 16.0003 3.1665C23.088 3.1665 28.8337 8.91217 28.8337 15.9998C28.8337 23.0875 23.088 28.8332 16.0003 28.8332C8.91266 28.8332 3.16699 23.0875 3.16699 15.9998Z",fill:"currentColor",fillOpacity:.12}),M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9997 6.83319C13.6363 6.82787 11.3633 7.74068 9.65999 9.37907C9.30711 9.70535 8.84021 9.88001 8.35982 9.86545C7.87943 9.85089 7.42396 9.64827 7.09149 9.30122C6.75902 8.95416 6.57612 8.49043 6.58218 8.00985C6.58823 7.52928 6.78276 7.07031 7.12388 6.73174C9.50956 4.43941 12.6912 3.16143 15.9997 3.16652C16.4859 3.16652 16.9522 3.35967 17.296 3.70349C17.6398 4.04731 17.833 4.51362 17.833 4.99985C17.833 5.48608 17.6398 5.9524 17.296 6.29621C16.9522 6.64003 16.4859 6.83319 15.9997 6.83319Z",fill:"currentColor"}))),iO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{clipPath:"url(#clip0_2074_3858)"},M.createElement("path",{d:"M21 21L16.65 16.65M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),M.createElement("defs",null,M.createElement("clipPath",{id:"clip0_2074_3858"},M.createElement("rect",{width:24,height:24,fill:"white"})))),sO={table:R.css({...Fe.body2,fontWeight:500})},qC=S.forwardRef(({children:e,className:t,style:n,...r},o)=>C.jsx("td",{ref:o,className:R.cx(t),style:n,...r,children:e}));qC.displayName="TableBodyCell";const{spacing:h0}=V,YC=S.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o=h0.sm,px:i=h0.md,minHeight:s="56px",...a},l)=>C.jsx(G,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));YC.displayName="TableBodyCellContent";const{color:aO}=V,XC=S.forwardRef(({children:e,className:t,showBorders:n=!1,isSelected:r=!1,...o},i)=>{const s=R.css({borderBottom:n?`1px solid ${aO.border.neutralAlphaLow}`:"none"});return C.jsx("tr",{ref:i,className:R.cx(s,t),...o,children:e})});XC.displayName="TableBodyRow";const lO=S.forwardRef(({children:e,className:t,style:n,justifyContent:r="flex-start",alignItems:o="flex-start",...i},s)=>{const a=R.css({justifyContent:r,alignItems:o,fontWeight:"inherit"});return C.jsx("th",{ref:s,className:R.cx(a,t),style:n,...i,children:e})}),{spacing:g0}=V,hg=S.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o=g0.sm,px:i=g0.md,minHeight:s="56px",...a},l)=>C.jsx(G,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));hg.displayName="TableHeadCellContent";const cO=e=>M.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M8.75 0.75L4.75 4.75L0.75 0.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),uO=e=>M.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M8.75 4.75L4.75 0.75L0.75 4.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),{color:Oa}=V,dO=({sortDirection:e,gap:t="5px",...n})=>C.jsxs(G,{gap:t,...n,children:[C.jsx(uO,{style:{color:e==="asc"?Oa.icon.accent:Oa.icon.tertiary}}),C.jsx(cO,{style:{color:e==="desc"?Oa.icon.accent:Oa.icon.tertiary}})]}),ZC=({children:e,tableProps:t,gap:n="10px",...r})=>{const o=t.column.getIsSorted();return C.jsxs(hg,{style:{cursor:"pointer",userSelect:"none"},gap:n,...r,children:[e,C.jsx(dO,{sortDirection:o})]})};ZC.displayName="TableHeadCellContentSortable";const{color:p0}=V,JC=S.forwardRef(({children:e,className:t,showBorders:n=!1,...r},o)=>{const i=R.css({backgroundColor:p0.fill.bgSecondary,borderBottom:n?`1px solid ${p0.border.neutralAlphaLow}`:"none"});return C.jsx("tr",{ref:o,className:R.cx(i,t),...r,children:e})});JC.displayName="TableHeadRow";const fO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),hO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),gO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),ju=(e,t)=>{const n=t-e+1;return Array.from({length:n},(r,o)=>e+o)};function pO(e){const{count:t=1,page:n,maxVisiblePages:r=10}=e;let o=1,i=1;if(r<=2)return[n];r<=4?(o=0,i=0):r<=6?(o=1,i=0):r<=7?(o=1,i=Math.max(0,Math.floor((r-4)/2))):(o=1,i=Math.max(1,Math.floor((r-5)/2)));const s=ju(1,Math.min(o,t)),a=ju(Math.max(t-o+1,o+1),t),l=Math.max(Math.min(n-i,t-o-i*2-1),o+2),c=Math.min(Math.max(n+i,o+i*2+2),t-o-1);return[...s,...l>o+2?["start-dots"]:o+1<t-o?[o+1]:[],...ju(l,c),...c<t-o-1?["end-dots"]:t-o>o?[t-o]:[],...a]}const{color:Go,cornerRadius:mO,spacing:m0}=V,yO=({pageIndex:e,pageSize:t,totalCount:n,onPageChange:r,onPageSizeChange:o,pageSizeOptions:i=[10,20,50,100],showPageSizeSelector:s=!0,renderPageSizeSelectorDropdownItem:a=c=>c.label,renderPageSizeSelectorInputItem:l})=>{const c=S.useRef(null),[u,f]=S.useState(0),d=Math.ceil(n/t),h=e>0,g=e<d-1;S.useEffect(()=>{const w=c.current;if(!w)return;const _=new ResizeObserver(E=>{for(const T of E)f(T.contentRect.width)});return _.observe(w),()=>{_.disconnect()}},[]);const m=(w=>{if(w<=0)return 1;const P=w-96;if(P<=40)return 1;const O=Math.floor((P+8)/48);return Math.max(1,Math.min(10,O))})(u),x=pO({page:e+1,count:d,maxVisiblePages:m}),y=()=>{h&&r(e-1)},v=()=>{g&&r(e+1)},b=w=>{o(Number(w))};return n===0?null:C.jsxs(G,{flex:1,row:!0,justifyContent:"space-between",children:[C.jsxs(G,{ref:c,flex:1,row:!0,overflow:"hidden",gap:m0.sm,children:[C.jsx(dr,{onClick:y,disabled:!h,color:"neutral",size:"sm",children:C.jsx(fO,{})}),C.jsx(G,{row:!0,gap:m0.sm,children:x.map(w=>C.jsx(vO,{isDots:w==="start-dots"||w==="end-dots",isCurrentPage:w===e+1,disabled:w==="start-dots"||w==="end-dots",onClick:()=>r(w-1),children:w},w))}),C.jsx(dr,{color:"neutral",size:"sm",onClick:v,disabled:!g,children:C.jsx(hO,{})})]}),s&&C.jsx(G,{alignItems:"flex-end",children:C.jsx(cg,{width:"fit-content",value:t.toString(),size:"sm",items:i.map(w=>({value:w.toString(),label:w.toString()})),returnedValue:w=>w.value,renderDropdownItem:a,renderSingleInputItem:l,onChange:w=>b(w)})})]})},vO=({children:e,isCurrentPage:t=!1,onClick:n,isDots:r=!1,disabled:o=!1})=>{const i=R.css({cursor:o?"not-allowed":"pointer",userSelect:"none",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t?Go.fill.accentSecondary:Go.fill.bgSecondary,borderRadius:mO.sm,border:t?`1px solid ${Go.fill.accentSecondaryHover}`:`1px solid ${Go.border.neutralAlphaBasic}`}),s=R.css({width:"24px",height:"24px",color:t?Go.icon.secondary:Go.icon.tertiary});return C.jsx(G,{className:i,onClick:o?void 0:n,children:r?C.jsx(gO,{className:s}):C.jsx(ae,{center:!0,variant:"body-2",fontWeight:"medium",children:e})})},{color:pf,cornerRadius:xO}=V,bO=R.css({position:"relative",borderRadius:xO.md,overflow:"hidden","&::before, &::after":{content:'""',position:"absolute",top:0,bottom:14,width:96,pointerEvents:"none",zIndex:1,transition:"opacity 0.2s ease"},"&::before":{left:0,background:"linear-gradient(to left, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"},"&::after":{right:0,background:"linear-gradient(to right, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"}}),wO=R.css({overflowX:"auto",scrollbarWidth:"thin",scrollbarColor:`${pf.scrollbar.thumbPrimary} ${pf.scrollbar.trackPrimary}`}),QC=S.memo(({data:e,children:t,className:n,showBorders:r=!1,...o})=>{const[i,s]=S.useState(!1),[a,l]=S.useState(!1),c=S.useRef(null),u=S.useCallback(()=>{const d=c.current;if(!d)return;const{scrollLeft:h,scrollWidth:g,clientWidth:p}=d,m=g>p;s(m&&h>0),l(m&&h<g-p-1)},[]);S.useEffect(()=>{const d=c.current;if(!d)return;u();const h=new ResizeObserver(u);return h.observe(d),d.addEventListener("scroll",u),()=>{h.disconnect(),d.removeEventListener("scroll",u)}},[u,e]);const f=R.css({border:r?`1px solid ${pf.border.neutralAlphaLow}`:"transparent","&::before":{opacity:i?1:0},"&::after":{opacity:a?1:0}});return C.jsx(G,{className:R.cx(bO,f,n),...o,children:C.jsx(G,{ref:c,className:wO,children:t})})});QC.displayName="TableWrapper";const{spacing:mn,cornerRadius:y0,color:Is}=V,CO=R.css({width:"100%",maxWidth:"100%",minWidth:"max-content",borderCollapse:"collapse",borderSpacing:0,backgroundColor:Is.fill.bgPrimary}),SO=R.css({backgroundColor:Is.fill.bgSecondary,color:Is.text.tertiary}),Wi=({ref:e,data:t,columns:n,showBorders:r=!0,enableSorting:o=!1,enablePagination:i=!1,enableRowSelection:s=!1,enableMultiRowSelection:a=!1,sorting:l,onSortingChange:c,columnFilters:u,onColumnFiltersChange:f,columnVisibility:d,onColumnVisibilityChange:h,pagination:g,onPaginationChange:p,rowSelection:m,onRowSelectionChange:x,totalCount:y,loading:v=!1,emptyLabels:b={title:"Nothing found",description:"No results found for “result”",action:"Reset"},loadingLabels:w={title:"Loading...",description:"Please wait or reset your promt",action:"Reset"},className:_,containerClassName:E,tableOptions:T={},onRowClick:k,getRowId:P,headCellComponent:O=lO,bodyCellComponent:D=qC,headRowComponent:I=JC,bodyRowComponent:$=XC,onReset:H,renderPageSizeSelectorDropdownItem:U,renderPageSizeSelectorInputItem:F})=>{const[N,j]=S.useState([]),[K,te]=S.useState([]),[J,Z]=S.useState({}),[se,oe]=S.useState({pageIndex:0,pageSize:10}),[fe,_e]=S.useState({}),ne=l??N,ye=u??K,Te=d??J,De=g??se,st=m??fe,ee=ve=>{const Ae=typeof ve=="function"?ve(ne):ve;c?c(Ae):j(Ae)},we=ve=>{const Ae=typeof ve=="function"?ve(ye):ve;f?f(Ae):te(Ae)},ze=ve=>{const Ae=typeof ve=="function"?ve(Te):ve;h?h(Ae):Z(Ae)},Ee=ve=>{const Ae=typeof ve=="function"?ve(De):ve;p?p(Ae):oe(Ae)},Lt=rO({data:t,columns:n,state:{sorting:ne,columnFilters:ye,columnVisibility:Te,pagination:De,rowSelection:st},onSortingChange:ee,onColumnFiltersChange:we,onColumnVisibilityChange:ze,onPaginationChange:Ee,onRowSelectionChange:ve=>{const Ae=typeof ve=="function"?ve(st):ve;x?x(Ae):_e(Ae)},getCoreRowModel:X$(),getSortedRowModel:o?Q$():void 0,getPaginationRowModel:i?J$():void 0,enableRowSelection:s,enableMultiRowSelection:a,getRowId:P,manualPagination:!!y,pageCount:y?Math.ceil(y/De.pageSize):void 0,...T});S.useImperativeHandle(e,()=>Lt);const{rows:Yt}=Lt.getRowModel(),Xt=(ve,Ae)=>{k&&k(ve.original,Ae)};return v?C.jsxs(G,{w:"full",borderRadius:y0.md,py:mn["5xl"],px:mn["10xl"],alignItems:"center",className:R.cx(E),children:[C.jsx(oO,{width:32,height:32,style:{color:Is.icon.tertiary,marginBottom:mn.sm}}),C.jsx(ae,{mb:mn.xs,variant:"title-3",fontWeight:"semibold",children:w.title}),C.jsx(ae,{mb:mn.md,colorName:"tertiary",variant:"body-1",fontWeight:"medium",children:w.description}),typeof w.action=="string"?C.jsx(wi,{width:"auto",onClick:H,intensity:"secondary",color:"accent",children:w.action}):w.action]}):Yt.length?C.jsxs(G,{w:"full",gap:mn.xl,className:R.cx(E),children:[C.jsx(QC,{data:t,showBorders:r,children:C.jsxs("table",{className:R.cx(CO,sO.table,_),children:[C.jsx("thead",{className:SO,children:Lt.getHeaderGroups().map(ve=>C.jsx(I,{showBorders:r,children:ve.headers.map(Ae=>C.jsx(O,{style:{width:Ae.getSize()},onClick:Ae.column.getToggleSortingHandler(),children:Ae.isPlaceholder?null:f0(Ae.column.columnDef.header,Ae.getContext())},Ae.id))},ve.id))}),C.jsx("tbody",{children:Yt.map((ve,Ae)=>C.jsx($,{showBorders:r,isSelected:ve.getIsSelected(),onClick:()=>Xt(ve,Ae),children:ve.getVisibleCells().map(Zt=>C.jsx(D,{children:f0(Zt.column.columnDef.cell,Zt.getContext())},Zt.id))},ve.id))})]})}),i&&!v&&C.jsx(yO,{pageIndex:De.pageIndex,pageSize:De.pageSize,totalCount:y||t.length,renderPageSizeSelectorDropdownItem:U,renderPageSizeSelectorInputItem:F,onPageChange:ve=>Ee({...De,pageIndex:ve}),onPageSizeChange:ve=>Ee({...De,pageSize:ve,pageIndex:0})})]}):C.jsxs(G,{w:"full",borderRadius:y0.md,py:mn["5xl"],px:mn["10xl"],alignItems:"center",className:R.cx(E),children:[C.jsx(iO,{width:24,height:24,style:{color:Is.icon.tertiary,marginBottom:mn.sm}}),C.jsx(ae,{mb:mn.xs,variant:"title-3",fontWeight:"semibold",children:b.title}),C.jsx(ae,{mb:mn.md,colorName:"tertiary",variant:"body-1",fontWeight:"medium",children:b.description}),typeof b.action=="string"?C.jsx(wi,{width:"auto",onClick:H,intensity:"secondary",color:"accent",children:b.action}):b.action]})};Wi.displayName="Table";Wi.HeadCellContent=hg;Wi.BodyCellContent=YC;Wi.HeadCellContentSortable=ZC;Wi.createColumnHelper=DC;const{color:tn}=V,Bu={chart:{type:"areaspline",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0]},xAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},yAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},legend:{enabled:!1},credits:{enabled:!1}},_O={positive:{color:tn.fill.positivePrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,tn.fill.positiveTintHigh],[1,tn.fill.positiveTransparent]]}},negative:{color:tn.fill.negativePrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,tn.fill.negativeTintHigh],[1,tn.fill.negativeTransparent]]}},accent:{color:tn.fill.accentPrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,tn.fill.accentTintHigh],[1,tn.fill.accentTransparent]]}},warning:{color:tn.fill.warningPrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,tn.fill.warningTintHigh],[1,tn.fill.warningTransparent]]}},transfer:{color:"var(--fill-transfer-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-transfer-tint-high)"],[1,"var(--fill-transfer-transparent)"]]}}},{color:v0}=V,TO=(e,t,n,r,o)=>({...Bu,plotOptions:{areaspline:{marker:{enabled:!1,states:{hover:{enabled:o}}},allowPointSelect:!1}},xAxis:{...Bu.xAxis,...n},yAxis:{...Bu.yAxis,...r},series:[{type:"areaspline",data:t,..._O[e]}]}),EO=e=>({outside:!0,enabled:!!e,padding:0,position:{alignByTranslate:!0},shadow:{color:v0.effect.shadowM,offsetX:0,offsetY:0},borderRadius:8,backgroundColor:v0.fill.bgPrimary,useHTML:!0,...e}),eS=({color:e="positive",data:t=[],xAxis:n,yAxis:r,containerProps:o,highcharts:i,tooltip:s})=>{const a=S.useRef(null);S.useEffect(()=>()=>{typeof a=="object"&&a?.current?.chart&&a.current.chart.destroy()},[]);const l=S.useMemo(()=>TO(e,t,n,r,!!s),[e,t,n,r,s]),c=S.useMemo(()=>s?EO(s):{enabled:!1},[s]);return C.jsx(el.Chart,{highcharts:i,ref:a,options:l,containerProps:o,children:C.jsx(el.Tooltip,{...c})})};eS.displayName="LineChart";const{color:tr}=V,RO={chart:{type:"pie",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0],events:{click:void 0}},title:{align:"center",verticalAlign:"middle",floating:!0,style:{fontSize:"24px",fontWeight:"600",color:tr.text.primary}},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!1},startAngle:90,endAngle:-90,innerSize:"90%",borderWidth:0,states:{hover:{enabled:!1},select:{enabled:!1},inactive:{enabled:!1}},enableMouseTracking:!1}},tooltip:{enabled:!1},legend:{enabled:!1},credits:{enabled:!1}},kO={positive:{colors:[tr.fill.positivePrimary,tr.fill.positiveTintHigh]},negative:{colors:[tr.fill.negativePrimary,tr.fill.negativeTintHigh]},accent:{colors:[tr.fill.accentPrimary,tr.fill.accentTintHigh]},warning:{colors:[tr.fill.warningPrimary,tr.fill.warningTintHigh]},transfer:{colors:["var(--fill-transfer-primary)","var(--fill-transfer-tint-high)"]}},AO=(e,t)=>({...RO,series:[{type:"pie",data:[{name:"",y:Math.min(e,100)},{name:"",y:Math.max(100-e,0)}],...kO[t]}]}),tS=S.forwardRef(({highcharts:e,color:t="positive",percentage:n,label:r=s=>`${s}%`,containerProps:o},i)=>{const s=S.useRef(null),a=i||s;S.useEffect(()=>()=>{typeof a=="object"&&a?.current?.chart&&a.current.chart.destroy()},[a]);const l=S.useMemo(()=>AO(n,t),[n,t]);return C.jsx(el.Chart,{highcharts:e,ref:a,options:l,containerProps:o,children:C.jsx(el.Title,{children:r?.(n)})})});tS.displayName="PieProgressChart";const MO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M9 17L14 12L9 7",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),{color:x0}=V,Ja={link:R.css({...Fe.body2,color:x0.text.tertiary,textDecoration:"none",transition:"color 0.2s ease","&:hover":{textDecoration:"underline"}}),separator:R.css({color:x0.icon.tertiary}),nav:R.css({display:"flex",alignItems:"center",flexWrap:"wrap"}),navItem:R.css({display:"inline-flex",alignItems:"center"})},gg=({children:e,separator:t=C.jsx(MO,{className:Ja.separator})})=>{const n=S.Children.toArray(e).filter(r=>S.isValidElement(r));return C.jsx("nav",{"aria-label":"breadcrumb",className:Ja.nav,children:n.map((r,o)=>{const i=o===n.length-1;return C.jsxs(ae,{tag:"span",className:Ja.navItem,children:[S.cloneElement(r,{active:r.props.active??i}),!i&&t]},o)})})},NO=({children:e,href:t,active:n,className:r,activeClassName:o,activeElement:i,onClick:s})=>n?i||C.jsx(ae,{tag:"span",variant:"body-2",fontWeight:"medium",colorName:"primary",className:R.cx(r,o),onClick:s,children:e}):C.jsx("a",{href:t,className:R.cx(Ja.link,r),onClick:s,children:e});gg.Item=NO;gg.displayName="Breadcrumbs";const PO=gg,{color:Je,cornerRadius:Cr,height:xt,transition:b0}=V,FO={primary:{bg:Je.fill.accentTint,text:Je.text.accent,icon:Je.icon.accent},secondary:{bg:Je.fill.neutralTint,text:Je.text.secondary,icon:Je.icon.tertiary},negative:{bg:Je.fill.negativeTint,text:Je.text.negative,icon:Je.icon.negative},positive:{bg:Je.fill.positiveTint,text:Je.text.positive,icon:Je.icon.positive},warning:{bg:Je.fill.warningTint,text:Je.text.warning,icon:Je.icon.warning},neutral:{bg:Je.fill.neutralTint,text:Je.text.tertiary,icon:Je.icon.tertiary},transfer:{bg:"var(--fill-transfer-tint)",text:"var(--text-transfer)",icon:"var(--icon-transfer)"},custom:{bg:Je.fill.accentTint,text:Je.text.accent,icon:Je.icon.accent}},LO={"2xs":{size:xt.avatar["2xs"],borderRadius:Cr.xs,iconSize:xt.icon["2xs"],fontSize:10,fontWeight:500},xs:{size:xt.avatar.xs,borderRadius:Cr.sm,iconSize:xt.icon.xs,fontSize:12,fontWeight:500},sm:{size:xt.avatar.sm,borderRadius:Cr.sm,iconSize:xt.icon.xs,fontSize:14,fontWeight:500},md:{size:xt.avatar.md,borderRadius:Cr.sm,iconSize:xt.icon.sm,fontSize:14,fontWeight:500},lg:{size:xt.avatar.lg,borderRadius:Cr.md,iconSize:xt.icon.md,fontSize:16,fontWeight:600},xl:{size:xt.avatar.xl,borderRadius:Cr.md,iconSize:xt.icon.md,fontSize:16,fontWeight:600},"2xl":{size:xt.avatar["2xl"],borderRadius:Cr.md,iconSize:xt.icon.md,fontSize:18,fontWeight:500},custom:{size:xt.avatar.md,borderRadius:Cr.sm,iconSize:xt.icon.sm,fontSize:14,fontWeight:500}},nS=S.forwardRef(({children:e,color:t="primary",size:n="md",fullRound:r=!1,className:o},i)=>{const s=S.useMemo(()=>FO[t],[t]),a=S.useMemo(()=>LO[n],[n]),l=S.useMemo(()=>R.css({width:a.size,height:a.size,borderRadius:r?"var(--corner-full-round)":a.borderRadius,backgroundColor:s.bg,color:s.text,fontSize:a.fontSize,fontWeight:a.fontWeight,lineHeight:1,transition:b0.general,"& svg":{width:a.iconSize,height:a.iconSize,color:s.icon,transition:b0.general},"& img":{width:"100%",height:"100%",objectFit:"cover"},"&:has(img)":{backgroundColor:"transparent",border:`1px solid ${Je.border.neutralAlphaLow}`}}),[s,a,r]);return C.jsx(G,{ref:i,center:!0,overflow:"hidden",className:R.cx(l,o),children:e})});nS.displayName="Avatar";const{color:Tt,cornerRadius:zu,spacing:Qa}=V,mf={neutral:{border:Tt.border.neutralAlphaLow,bg:Tt.status.neutralTint,color:Tt.text.secondary,colorName:"secondary"},accent:{border:Tt.border.accentSecondary,bg:Tt.status.accentTintLow,color:Tt.text.accent,colorName:"accent"},warning:{border:Tt.border.warningSecondary,bg:Tt.status.warningTintLow,color:Tt.text.warning,colorName:"warning"},positive:{border:Tt.border.positiveSecondary,bg:Tt.status.positiveTintLow,color:Tt.text.positive,colorName:"positive"},negative:{border:Tt.border.negativeSecondary,bg:Tt.status.negativeTintLow,color:Tt.text.negative,colorName:"negative"},transfer:{border:"var(--border-transfer-secondary)",bg:"var(--status-transfer-tint-low)",color:"var(--text-transfer)",colorName:"transfer"}},Ia={sm:{h:24,text:"caption-1",corner:zu.xs,p:`6px ${Qa.sm}`},md:{h:32,text:"body-2",corner:zu.sm,p:`6px ${Qa.md}`},lg:{h:40,text:"body-2",corner:zu.md,p:`6px ${Qa.lg}`}},$O=(e,t,n,r)=>{const o=mf[t];let i=o.bg,s="none";const a=o.color;switch(e){case"outline":i="transparent",s=`1px solid ${o.border}`;break;case"clear":i="transparent";break;default:i=o.bg;break}return R.css({cursor:n?"not-allowed":r?"pointer":"default",opacity:n?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s",backgroundColor:i,color:a,border:s})},OO=R.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}}),rS=({label:e,color:t="neutral",size:n="md",variant:r="filled",leftElement:o,rightElement:i,disabled:s,onClick:a,onDelete:l,className:c})=>{const u=$O(r,t,s,a);return C.jsxs(G,{row:!0,alignItems:"center",gap:Qa.sm,p:Ia[n].p,h:Ia[n].h,overflow:"hidden",borderRadius:Ia[n].corner,onClick:a,className:R.cx(u,c),children:[a&&C.jsx(No,{}),o,C.jsx(ae,{variant:Ia[n].text,colorName:mf[t].colorName,textOverflow:"ellipsis",children:e}),i,l&&!s&&C.jsx(ae,{className:OO,colorName:mf[t].colorName,onClick:f=>{f.stopPropagation(),l(f)},children:C.jsx(AC,{})})]})};rS.displayName="Badge";const IO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.15}),M.createElement("path",{d:"M16 9L10.0337 15L8 12.9548",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Hu=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor",fillOpacity:.15}),M.createElement("path",{d:"M12 6C11.4477 6 11 6.44772 11 7V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V7C13 6.44772 12.5523 6 12 6Z",fill:"currentColor"}),M.createElement("path",{d:"M12 15C11.4477 15 11 15.4477 11 16V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16C13 15.4477 12.5523 15 12 15Z",fill:"currentColor"})),DO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.12}),M.createElement("path",{d:"M16 8L8 16M16 16L8 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),VO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"black",...e},M.createElement("path",{d:"M12 2V22M19.0711 4.92893L4.92893 19.0711M22 12H2M19.0711 19.0711L4.92893 4.92893",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),{color:Ke,cornerRadius:jO,spacing:Cs}=V,qo={hint:R.css({display:"flex",alignItems:"flex-start",gap:Cs.md,padding:Cs.lg,minHeight:48,width:"100%",borderRadius:jO.md,transition:"background 0.2s, color 0.2s"}),icon:R.css({flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:24,height:24}}),content:R.css({display:"flex",flexDirection:"column",gap:Cs.xs}),title:R.css({verticalAlign:"middle",color:"inherit"}),subtitle:R.css({verticalAlign:"middle",opacity:.8,color:"inherit"}),disabled:R.css({opacity:.5,pointerEvents:"none"})},BO={solid:{warning:R.css({background:Ke.status.warning,color:Ke.text.inverse}),negative:R.css({background:Ke.status.negative,color:Ke.text.inverse}),positive:R.css({background:Ke.status.positive,color:Ke.text.inverse}),accent:R.css({background:Ke.status.accent,color:Ke.text.inverse}),neutral:R.css({background:Ke.status.neutral,color:Ke.text.inverse}),transfer:R.css({background:Ke.status.transfer,color:Ke.text.inverse})},soft:{warning:R.css({background:Ke.status.warningTintLow,color:Ke.text.warning}),negative:R.css({background:Ke.status.negativeTintLow,color:Ke.text.negative}),positive:R.css({background:Ke.status.positiveTintLow,color:Ke.text.positive}),accent:R.css({background:Ke.status.accentTintLow,color:Ke.text.accent}),neutral:R.css({background:Ke.status.neutralTintLow,color:Ke.text.tertiary}),transfer:R.css({background:Ke.status.transferTintLow,color:Ke.text.transfer})}},zO={md:R.css({minHeight:48,padding:Cs.lg}),sm:R.css({minHeight:32,padding:Cs.md})},HO={negative:C.jsx(DO,{}),positive:C.jsx(IO,{}),accent:C.jsx(Hu,{}),warning:C.jsx(Hu,{}),transfer:C.jsx(Hu,{}),neutral:C.jsx(VO,{})},WO=({title:e,subtitle:t,color:n="warning",variant:r="soft",size:o="md",icon:i,disabled:s=!1,className:a,style:l})=>{const c=i||HO[n];return C.jsxs("div",{className:bf(qo.hint,zO[o],BO[r][n],s&&qo.disabled,a),style:l,"aria-disabled":s,children:[c&&C.jsx("span",{className:qo.icon,children:c}),C.jsxs("div",{className:qo.content,children:[e&&C.jsx(ae,{className:qo.title,variant:o==="md"?"body-1":"caption-2",children:e}),t&&C.jsx(ae,{className:qo.subtitle,variant:o==="md"?"body-2":"caption-1",children:t})]})]})},{color:oS,cornerRadius:KO}=V,UO=R.keyframes`
72
+ color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n?.key)}return o}}function ue(e,t,n,r){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function g$(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:ce(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),ue(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function p$(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=d=>{let h=d;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${p}" in deeply nested key "${l}" returned undefined.`)}return h}:u=d=>d[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:ce(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},ue(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ce(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(p=>p.getLeafColumns());return d(g)}return[f]},ue(e.options,"debugColumns","column.getLeafColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(f,e);return f}const vt="debugHeaders";function h0(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const m$={createTable:e=>{e.getHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?i:[],l=(s=o?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return Oa(t,[...a,...c,...l],e)},ue(e.options,vt,"getHeaderGroups")),e.getCenterHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Oa(t,n,e,"center")),ue(e.options,vt,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Oa(t,i,e,"left")},ue(e.options,vt,"getLeftHeaderGroups")),e.getRightHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Oa(t,i,e,"right")},ue(e.options,vt,"getRightHeaderGroups")),e.getFooterGroups=ce(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ue(e.options,vt,"getFooterGroups")),e.getLeftFooterGroups=ce(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ue(e.options,vt,"getLeftFooterGroups")),e.getCenterFooterGroups=ce(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ue(e.options,vt,"getCenterFooterGroups")),e.getRightFooterGroups=ce(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ue(e.options,vt,"getRightFooterGroups")),e.getFlatHeaders=ce(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,vt,"getFlatHeaders")),e.getLeftFlatHeaders=ce(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,vt,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ce(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,vt,"getCenterFlatHeaders")),e.getRightFlatHeaders=ce(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,vt,"getRightFlatHeaders")),e.getCenterLeafHeaders=ce(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,vt,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ce(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,vt,"getLeftLeafHeaders")),e.getRightLeafHeaders=ce(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,vt,"getRightLeafHeaders")),e.getLeafHeaders=ce(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},ue(e.options,vt,"getLeafHeaders"))}};function Oa(e,t,n,r){var o,i;let s=0;const a=function(d,h){h===void 0&&(h=1),s=Math.max(s,h),d.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(m=>{const x=[...p].reverse()[0],y=m.column.depth===g.depth;let v,b=!1;if(y&&m.column.parent?v=m.column.parent:(v=m.column,b=!0),x&&x?.column===v)x.subHeaders.push(m);else{const w=h0(n,v,{id:[r,h,v.id,m?.id].filter(Boolean).join("_"),isPlaceholder:b,placeholderId:b?`${p.filter(_=>_.column===v).length}`:void 0,depth:h,index:p.length});w.subHeaders.push(m),p.push(w)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&c(p,h-1)},u=t.map((d,h)=>h0(n,d,{depth:s,index:h}));c(u,s-1),l.reverse();const f=d=>d.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=0,x=[0];g.subHeaders&&g.subHeaders.length?(x=[],f(g.subHeaders).forEach(v=>{let{colSpan:b,rowSpan:w}=v;p+=b,x.push(w)})):p=1;const y=Math.min(...x);return m=m+y,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const y$=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>h$(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:ce(()=>[e.getAllLeafColumns()],l=>l.map(c=>g$(e,a,c,c.id)),ue(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ce(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),ue(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},v$={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},GC=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};GC.autoRemove=e=>_n(e);const qC=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};qC.autoRemove=e=>_n(e);const YC=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};YC.autoRemove=e=>_n(e);const XC=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};XC.autoRemove=e=>_n(e);const ZC=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});ZC.autoRemove=e=>_n(e)||!(e!=null&&e.length);const JC=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});JC.autoRemove=e=>_n(e)||!(e!=null&&e.length);const QC=(e,t,n)=>e.getValue(t)===n;QC.autoRemove=e=>_n(e);const eS=(e,t,n)=>e.getValue(t)==n;eS.autoRemove=e=>_n(e);const hg=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};hg.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};hg.autoRemove=e=>_n(e)||_n(e[0])&&_n(e[1]);const or={includesString:GC,includesStringSensitive:qC,equalsString:YC,arrIncludes:XC,arrIncludesAll:ZC,arrIncludesSome:JC,equals:QC,weakEquals:eS,inNumberRange:hg};function _n(e){return e==null||e===""}const x$={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:qt("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?or.includesString:typeof r=="number"?or.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?or.equals:Array.isArray(r)?or.arrIncludes:or.weakEquals},e.getFilterFn=()=>{var n,r;return gc(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:or[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r?.find(u=>u.id===e.id),s=Nr(n,i?i.value:void 0);if(g0(o,s,e)){var a;return(a=r?.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r?.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Nr(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(g0(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function g0(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const b$=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),w$=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},C$=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},S$=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},_$=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},T$=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!f$(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},E$=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),R$=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,k$=(e,t)=>t.length,Iu={sum:b$,min:w$,max:C$,extent:S$,mean:_$,median:T$,unique:E$,uniqueCount:R$,count:k$},A$={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:qt("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return Iu.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Iu.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return gc(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Iu[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function M$(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const N$={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:qt("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ce(n=>[Ss(t,n)],n=>n.findIndex(r=>r.id===e.id),ue(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Ss(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Ss(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ce(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return M$(i,n,r)},ue(e.options,"debugTable","_getOrderColumnsFn"))}},Du=()=>({left:[],right:[]}),P$={getInitialState:e=>({columnPinning:Du(),...e}),getDefaultOptions:e=>({onColumnPinningChange:qt("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o?.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=o?.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o?.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o?.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o?.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o?.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},ue(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ue(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ue(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Du():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Du())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ue(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ue(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},ue(e.options,"debugColumns","getCenterLeafColumns"))}};function L$(e){return e||(typeof document<"u"?document:null)}const Ia={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ju=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),F$={getDefaultColumnDef:()=>Ia,getInitialState:e=>({columnSizing:{},columnSizingInfo:ju(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:qt("columnSizing",e),onColumnSizingInfoChange:qt("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Ia.minSize,(r=i??e.columnDef.size)!=null?r:Ia.size),(o=e.columnDef.maxSize)!=null?o:Ia.maxSize)},e.getStart=ce(n=>[n,Ss(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),ue(t.options,"debugColumns","getStart")),e.getAfter=ce(n=>[n,Ss(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),ue(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r?.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Vu(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(x=>[x.column.id,x.column.getSize()]):[[r.id,r.getSize()]],l=Vu(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(x,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(v=>{var b,w;const _=t.options.columnResizeDirection==="rtl"?-1:1,E=(y-((b=v?.startOffset)!=null?b:0))*_,T=Math.max(E/((w=v?.startSize)!=null?w:0),-.999999);return v.columnSizingStart.forEach(k=>{let[P,O]=k;c[P]=Math.round(Math.max(O+O*T,0)*100)/100}),{...v,deltaOffset:E,deltaPercentage:T}}),(t.options.columnResizeMode==="onChange"||x==="end")&&t.setColumnSizing(v=>({...v,...c})))},f=x=>u("move",x),d=x=>{u("end",x),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=L$(n),g={moveHandler:x=>f(x.clientX),upHandler:x=>{h?.removeEventListener("mousemove",g.moveHandler),h?.removeEventListener("mouseup",g.upHandler),d(x.clientX)}},p={moveHandler:x=>(x.cancelable&&(x.preventDefault(),x.stopPropagation()),f(x.touches[0].clientX),!1),upHandler:x=>{var y;h?.removeEventListener("touchmove",p.moveHandler),h?.removeEventListener("touchend",p.upHandler),x.cancelable&&(x.preventDefault(),x.stopPropagation()),d((y=x.touches[0])==null?void 0:y.clientX)}},m=$$()?{passive:!1}:!1;Vu(i)?(h?.addEventListener("touchmove",p.moveHandler,m),h?.addEventListener("touchend",p.upHandler,m)):(h?.addEventListener("mousemove",g.moveHandler,m),h?.addEventListener("mouseup",g.upHandler,m)),t.setColumnSizingInfo(x=>({...x,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?ju():(n=e.initialState.columnSizingInfo)!=null?n:ju())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Da=null;function $$(){if(typeof Da=="boolean")return Da;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Da=e,Da}function Vu(e){return e.type==="touchstart"}const O$={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:qt("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ce(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ue(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ce(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],ue(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>ce(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ue(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Ss(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const I$={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},D$={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:qt("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>or.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return gc(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:or[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},j$={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:qt("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},hf=0,gf=10,Bu=()=>({pageIndex:hf,pageSize:gf}),V$={getInitialState:e=>({...e,pagination:{...Bu(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:qt("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>Nr(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Bu():(o=e.initialState.pagination)!=null?o:Bu())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Nr(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?hf:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:hf)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?gf:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:gf)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Nr(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=Nr(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=ce(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},ue(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},zu=()=>({top:[],bottom:[]}),B$={getInitialState:e=>({rowPinning:zu(),...e}),getDefaultOptions:e=>({onRowPinningChange:qt("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,d;return{top:((f=l?.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((d=l?.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=l?.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=l?.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((c=l?.top)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((u=l?.bottom)!=null?u:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?zu():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:zu())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ue(e.options,"debugRows","getTopRows")),e.getBottomRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ue(e.options,"debugRows","getBottomRows")),e.getCenterRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},ue(e.options,"debugRows","getCenterRows"))}},z$={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:qt("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{pf(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Hu(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Hu(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Hu(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return pf(a,e.id,n,(s=r?.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return gg(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return mf(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return mf(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},pf=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>pf(e,a.id,n,r,o))};function Hu(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=gg(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function gg(e,t){var n;return(n=t[e.id])!=null?n:!1}function mf(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(gg(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=mf(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const yf=/([0-9]+)/gm,H$=(e,t,n)=>tS(Kr(e.getValue(n)).toLowerCase(),Kr(t.getValue(n)).toLowerCase()),W$=(e,t,n)=>tS(Kr(e.getValue(n)),Kr(t.getValue(n))),K$=(e,t,n)=>pg(Kr(e.getValue(n)).toLowerCase(),Kr(t.getValue(n)).toLowerCase()),U$=(e,t,n)=>pg(Kr(e.getValue(n)),Kr(t.getValue(n))),G$=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},q$=(e,t,n)=>pg(e.getValue(n),t.getValue(n));function pg(e,t){return e===t?0:e>t?1:-1}function Kr(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function tS(e,t){const n=e.split(yf).filter(Boolean),r=t.split(yf).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const ss={alphanumeric:H$,alphanumericCaseSensitive:W$,text:K$,textCaseSensitive:U$,datetime:G$,basic:q$},Y$={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:qt("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return ss.datetime;if(typeof i=="string"&&(r=!0,i.split(yf).length>1))return ss.alphanumeric}return r?ss.text:ss.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return gc(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:ss[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s?.find(h=>h.id===e.id),l=s?.findIndex(h=>h.id===e.id);let c=[],u,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var d;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},X$=[m$,O$,N$,P$,v$,x$,I$,D$,Y$,A$,j$,V$,B$,z$,F$];function Z$(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...X$,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((d,h)=>Object.assign(d,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=d=>o.options.mergeOptions?o.options.mergeOptions(i,d):{...i,...d};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(d=>{var h;l=(h=d.getInitialState==null?void 0:d.getInitialState(l))!=null?h:l});const c=[];let u=!1;const f={_features:r,options:{...i,...e},initialState:l,_queue:d=>{c.push(d),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:d=>{const h=Nr(d,o.options);o.options=s(h)},getState:()=>o.options.state,setState:d=>{o.options.onStateChange==null||o.options.onStateChange(d)},_getRowId:(d,h,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(d,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(d,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[d];if(!g&&(g=o.getCoreRowModel().rowsById[d],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${d}`):new Error;return g},_getDefaultColumnDef:ce(()=>[o.options.defaultColumn],d=>{var h;return d=(h=d)!=null?h:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,m;return(p=(m=g.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...d}},ue(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:ce(()=>[o._getColumnDefs()],d=>{const h=function(g,p,m){return m===void 0&&(m=0),g.map(x=>{const y=p$(o,x,m,p),v=x;return y.columns=v.columns?h(v.columns,y,m+1):[],y})};return h(d)},ue(e,"debugColumns","getAllColumns")),getAllFlatColumns:ce(()=>[o.getAllColumns()],d=>d.flatMap(h=>h.getFlatColumns()),ue(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ce(()=>[o.getAllFlatColumns()],d=>d.reduce((h,g)=>(h[g.id]=g,h),{}),ue(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ce(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(d,h)=>{let g=d.flatMap(p=>p.getLeafColumns());return h(g)},ue(e,"debugColumns","getAllLeafColumns")),getColumn:d=>{const h=o._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${d}' does not exist.`),h}};Object.assign(o,f);for(let d=0;d<o._features.length;d++){const h=o._features[d];h==null||h.createTable==null||h.createTable(o)}return o}function J$(){return e=>ce(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=y$(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s?.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},ue(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Q$(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function eO(e){return t=>ce(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=Q$({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const d=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(d)};return f.rows.forEach(d),f},ue(t.options,"debugTable","getPaginationRowModel"))}function tO(){return e=>ce(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,f)=>{for(let h=0;h<i.length;h+=1){var d;const g=i[h],p=s[g.id],m=p.sortUndefined,x=(d=g?.desc)!=null?d:!1;let y=0;if(m){const v=u.getValue(g.id),b=f.getValue(g.id),w=v===void 0,_=b===void 0;if(w||_){if(m==="first")return w?-1:1;if(m==="last")return w?1:-1;y=w&&_?0:w?m:-m}}if(y===0&&(y=p.sortingFn(u,f,g.id)),y!==0)return x&&(y*=-1),p.invertSorting&&(y*=-1),y}return u.index-f.index}),c.forEach(u=>{var f;o.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},ue(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function p0(e,t){return e?nO(e)?M.createElement(e,t):e:null}function nO(e){return rO(e)||typeof e=="function"||oO(e)}function rO(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function oO(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function iO(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=M.useState(()=>({current:Z$(t)})),[r,o]=M.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const sO=e=>M.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("style",null,`
73
+ @keyframes spin {
74
+ from {
75
+ transform: rotate(0deg);
76
+ }
77
+ to {
78
+ transform: rotate(360deg);
79
+ }
80
+ }
81
+ .spinner {
82
+ transform-origin: center;
83
+ animation: spin 1s linear infinite;
84
+ }
85
+ `),M.createElement("g",{className:"spinner"},M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0003 6.83317C13.5692 6.83317 11.2376 7.79894 9.51851 9.51803C7.79943 11.2371 6.83366 13.5687 6.83366 15.9998C6.83366 18.431 7.79943 20.7626 9.51851 22.4817C11.2376 24.2007 13.5692 25.1665 16.0003 25.1665C18.4315 25.1665 20.7631 24.2007 22.4821 22.4817C24.2012 20.7626 25.167 18.431 25.167 15.9998C25.167 13.5687 24.2012 11.2371 22.4821 9.51803C20.7631 7.79894 18.4315 6.83317 16.0003 6.83317ZM3.16699 15.9998C3.16699 8.91217 8.91266 3.1665 16.0003 3.1665C23.088 3.1665 28.8337 8.91217 28.8337 15.9998C28.8337 23.0875 23.088 28.8332 16.0003 28.8332C8.91266 28.8332 3.16699 23.0875 3.16699 15.9998Z",fill:"currentColor",fillOpacity:.12}),M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9997 6.83319C13.6363 6.82787 11.3633 7.74068 9.65999 9.37907C9.30711 9.70535 8.84021 9.88001 8.35982 9.86545C7.87943 9.85089 7.42396 9.64827 7.09149 9.30122C6.75902 8.95416 6.57612 8.49043 6.58218 8.00985C6.58823 7.52928 6.78276 7.07031 7.12388 6.73174C9.50956 4.43941 12.6912 3.16143 15.9997 3.16652C16.4859 3.16652 16.9522 3.35967 17.296 3.70349C17.6398 4.04731 17.833 4.51362 17.833 4.99985C17.833 5.48608 17.6398 5.9524 17.296 6.29621C16.9522 6.64003 16.4859 6.83319 15.9997 6.83319Z",fill:"currentColor"}))),aO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{clipPath:"url(#clip0_2074_3858)"},M.createElement("path",{d:"M21 21L16.65 16.65M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),M.createElement("defs",null,M.createElement("clipPath",{id:"clip0_2074_3858"},M.createElement("rect",{width:24,height:24,fill:"white"})))),lO={table:R.css({...me.body2,fontWeight:500})},nS=S.forwardRef(({children:e,className:t,style:n,...r},o)=>C.jsx("td",{ref:o,className:R.cx(t),style:n,...r,children:e}));nS.displayName="TableBodyCell";const{spacing:m0}=j,rS=S.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o=m0.sm,px:i=m0.md,minHeight:s="56px",...a},l)=>C.jsx(G,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));rS.displayName="TableBodyCellContent";const{color:cO}=j,oS=S.forwardRef(({children:e,className:t,showBorders:n=!1,isSelected:r=!1,...o},i)=>{const s=R.css({borderBottom:n?`1px solid ${cO.border.neutralAlphaLow}`:"none"});return C.jsx("tr",{ref:i,className:R.cx(s,t),...o,children:e})});oS.displayName="TableBodyRow";const uO=S.forwardRef(({children:e,className:t,style:n,justifyContent:r="flex-start",alignItems:o="flex-start",...i},s)=>{const a=R.css({justifyContent:r,alignItems:o,fontWeight:"inherit"});return C.jsx("th",{ref:s,className:R.cx(a,t),style:n,...i,children:e})}),{spacing:y0}=j,mg=S.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o=y0.sm,px:i=y0.md,minHeight:s="56px",...a},l)=>C.jsx(G,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));mg.displayName="TableHeadCellContent";const dO=e=>M.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M8.75 0.75L4.75 4.75L0.75 0.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),fO=e=>M.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M8.75 4.75L4.75 0.75L0.75 4.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),{color:ja}=j,hO=({sortDirection:e,gap:t="5px",...n})=>C.jsxs(G,{gap:t,...n,children:[C.jsx(fO,{style:{color:e==="asc"?ja.icon.accent:ja.icon.tertiary}}),C.jsx(dO,{style:{color:e==="desc"?ja.icon.accent:ja.icon.tertiary}})]}),iS=({children:e,tableProps:t,gap:n="10px",...r})=>{const o=t.column.getIsSorted();return C.jsxs(mg,{style:{cursor:"pointer",userSelect:"none"},gap:n,...r,children:[e,C.jsx(hO,{sortDirection:o})]})};iS.displayName="TableHeadCellContentSortable";const{color:v0}=j,sS=S.forwardRef(({children:e,className:t,showBorders:n=!1,...r},o)=>{const i=R.css({backgroundColor:v0.fill.bgSecondary,borderBottom:n?`1px solid ${v0.border.neutralAlphaLow}`:"none"});return C.jsx("tr",{ref:o,className:R.cx(i,t),...r,children:e})});sS.displayName="TableHeadRow";const gO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),pO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),mO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Wu=(e,t)=>{const n=t-e+1;return Array.from({length:n},(r,o)=>e+o)};function yO(e){const{count:t=1,page:n,maxVisiblePages:r=10}=e;let o=1,i=1;if(r<=2)return[n];r<=4?(o=0,i=0):r<=6?(o=1,i=0):r<=7?(o=1,i=Math.max(0,Math.floor((r-4)/2))):(o=1,i=Math.max(1,Math.floor((r-5)/2)));const s=Wu(1,Math.min(o,t)),a=Wu(Math.max(t-o+1,o+1),t),l=Math.max(Math.min(n-i,t-o-i*2-1),o+2),c=Math.min(Math.max(n+i,o+i*2+2),t-o-1);return[...s,...l>o+2?["start-dots"]:o+1<t-o?[o+1]:[],...Wu(l,c),...c<t-o-1?["end-dots"]:t-o>o?[t-o]:[],...a]}const{color:Yo,cornerRadius:vO,spacing:x0}=j,xO=({pageIndex:e,pageSize:t,totalCount:n,onPageChange:r,onPageSizeChange:o,pageSizeOptions:i=[10,20,50,100],showPageSizeSelector:s=!0,renderPageSizeSelectorDropdownItem:a=c=>c.label,renderPageSizeSelectorInputItem:l})=>{const c=S.useRef(null),[u,f]=S.useState(0),d=Math.ceil(n/t),h=e>0,g=e<d-1;S.useEffect(()=>{const w=c.current;if(!w)return;const _=new ResizeObserver(E=>{for(const T of E)f(T.contentRect.width)});return _.observe(w),()=>{_.disconnect()}},[]);const m=(w=>{if(w<=0)return 1;const P=w-96;if(P<=40)return 1;const O=Math.floor((P+8)/48);return Math.max(1,Math.min(10,O))})(u),x=yO({page:e+1,count:d,maxVisiblePages:m}),y=()=>{h&&r(e-1)},v=()=>{g&&r(e+1)},b=w=>{o(Number(w))};return n===0?null:C.jsxs(G,{flex:1,row:!0,justifyContent:"space-between",children:[C.jsxs(G,{ref:c,flex:1,row:!0,overflow:"hidden",gap:x0.sm,children:[C.jsx(fr,{onClick:y,disabled:!h,color:"neutral",size:"sm",children:C.jsx(gO,{})}),C.jsx(G,{row:!0,gap:x0.sm,children:x.map(w=>C.jsx(bO,{isDots:w==="start-dots"||w==="end-dots",isCurrentPage:w===e+1,disabled:w==="start-dots"||w==="end-dots",onClick:()=>r(w-1),children:w},w))}),C.jsx(fr,{color:"neutral",size:"sm",onClick:v,disabled:!g,children:C.jsx(pO,{})})]}),s&&C.jsx(G,{alignItems:"flex-end",children:C.jsx(fg,{width:"fit-content",value:t.toString(),size:"sm",items:i.map(w=>({value:w.toString(),label:w.toString()})),returnedValue:w=>w.value,renderDropdownItem:a,renderSingleInputItem:l,onChange:w=>b(w)})})]})},bO=({children:e,isCurrentPage:t=!1,onClick:n,isDots:r=!1,disabled:o=!1})=>{const i=R.css({cursor:o?"not-allowed":"pointer",userSelect:"none",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t?Yo.fill.accentSecondary:Yo.fill.bgSecondary,borderRadius:vO.sm,border:t?`1px solid ${Yo.fill.accentSecondaryHover}`:`1px solid ${Yo.border.neutralAlphaBasic}`}),s=R.css({width:"24px",height:"24px",color:t?Yo.icon.secondary:Yo.icon.tertiary});return C.jsx(G,{className:i,onClick:o?void 0:n,children:r?C.jsx(mO,{className:s}):C.jsx(se,{center:!0,variant:"body-2",fontWeight:"medium",children:e})})},{color:vf,cornerRadius:wO}=j,CO=R.css({position:"relative",borderRadius:wO.md,overflow:"hidden","&::before, &::after":{content:'""',position:"absolute",top:0,bottom:14,width:96,pointerEvents:"none",zIndex:1,transition:"opacity 0.2s ease"},"&::before":{left:0,background:"linear-gradient(to left, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"},"&::after":{right:0,background:"linear-gradient(to right, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"}}),SO=R.css({overflowX:"auto",scrollbarWidth:"thin",scrollbarColor:`${vf.scrollbar.thumbPrimary} ${vf.scrollbar.trackPrimary}`}),aS=S.memo(({data:e,children:t,className:n,showBorders:r=!1,...o})=>{const[i,s]=S.useState(!1),[a,l]=S.useState(!1),c=S.useRef(null),u=S.useCallback(()=>{const d=c.current;if(!d)return;const{scrollLeft:h,scrollWidth:g,clientWidth:p}=d,m=g>p;s(m&&h>0),l(m&&h<g-p-1)},[]);S.useEffect(()=>{const d=c.current;if(!d)return;u();const h=new ResizeObserver(u);return h.observe(d),d.addEventListener("scroll",u),()=>{h.disconnect(),d.removeEventListener("scroll",u)}},[u,e]);const f=R.css({border:r?`1px solid ${vf.border.neutralAlphaLow}`:"transparent","&::before":{opacity:i?1:0},"&::after":{opacity:a?1:0}});return C.jsx(G,{className:R.cx(CO,f,n),...o,children:C.jsx(G,{ref:c,className:SO,children:t})})});aS.displayName="TableWrapper";const{spacing:mn,cornerRadius:b0,color:js}=j,_O=R.css({width:"100%",maxWidth:"100%",minWidth:"max-content",borderCollapse:"collapse",borderSpacing:0,backgroundColor:js.fill.bgPrimary}),TO=R.css({backgroundColor:js.fill.bgSecondary,color:js.text.tertiary}),Ui=({ref:e,data:t,columns:n,showBorders:r=!0,enableSorting:o=!1,enablePagination:i=!1,enableRowSelection:s=!1,enableMultiRowSelection:a=!1,sorting:l,onSortingChange:c,columnFilters:u,onColumnFiltersChange:f,columnVisibility:d,onColumnVisibilityChange:h,pagination:g,onPaginationChange:p,rowSelection:m,onRowSelectionChange:x,totalCount:y,loading:v=!1,emptyLabels:b={title:"Nothing found",description:"No results found for “result”",action:"Reset"},loadingLabels:w={title:"Loading...",description:"Please wait or reset your promt",action:"Reset"},className:_,containerClassName:E,tableOptions:T={},onRowClick:k,getRowId:P,headCellComponent:O=uO,bodyCellComponent:D=nS,headRowComponent:I=sS,bodyRowComponent:$=oS,onReset:H,renderPageSizeSelectorDropdownItem:U,renderPageSizeSelectorInputItem:L})=>{const[N,V]=S.useState([]),[K,te]=S.useState([]),[J,Z]=S.useState({}),[ae,oe]=S.useState({pageIndex:0,pageSize:10}),[fe,Te]=S.useState({}),ne=l??N,ve=u??K,Ee=d??J,De=g??ae,st=m??fe,ee=xe=>{const Me=typeof xe=="function"?xe(ne):xe;c?c(Me):V(Me)},Ce=xe=>{const Me=typeof xe=="function"?xe(ve):xe;f?f(Me):te(Me)},ze=xe=>{const Me=typeof xe=="function"?xe(Ee):xe;h?h(Me):Z(Me)},Re=xe=>{const Me=typeof xe=="function"?xe(De):xe;p?p(Me):oe(Me)},Ft=iO({data:t,columns:n,state:{sorting:ne,columnFilters:ve,columnVisibility:Ee,pagination:De,rowSelection:st},onSortingChange:ee,onColumnFiltersChange:Ce,onColumnVisibilityChange:ze,onPaginationChange:Re,onRowSelectionChange:xe=>{const Me=typeof xe=="function"?xe(st):xe;x?x(Me):Te(Me)},getCoreRowModel:J$(),getSortedRowModel:o?tO():void 0,getPaginationRowModel:i?eO():void 0,enableRowSelection:s,enableMultiRowSelection:a,getRowId:P,manualPagination:!!y,pageCount:y?Math.ceil(y/De.pageSize):void 0,...T});S.useImperativeHandle(e,()=>Ft);const{rows:Yt}=Ft.getRowModel(),Xt=(xe,Me)=>{k&&k(xe.original,Me)};return v?C.jsxs(G,{w:"full",borderRadius:b0.md,py:mn["5xl"],px:mn["10xl"],alignItems:"center",className:R.cx(E),children:[C.jsx(sO,{width:32,height:32,style:{color:js.icon.tertiary,marginBottom:mn.sm}}),C.jsx(se,{mb:mn.xs,variant:"title-3",fontWeight:"semibold",children:w.title}),C.jsx(se,{mb:mn.md,colorName:"tertiary",variant:"body-1",fontWeight:"medium",children:w.description}),typeof w.action=="string"?C.jsx(Si,{width:"auto",onClick:H,intensity:"secondary",color:"accent",children:w.action}):w.action]}):Yt.length?C.jsxs(G,{w:"full",gap:mn.xl,className:R.cx(E),children:[C.jsx(aS,{data:t,showBorders:r,children:C.jsxs("table",{className:R.cx(_O,lO.table,_),children:[C.jsx("thead",{className:TO,children:Ft.getHeaderGroups().map(xe=>C.jsx(I,{showBorders:r,children:xe.headers.map(Me=>C.jsx(O,{style:{width:Me.getSize()},onClick:Me.column.getToggleSortingHandler(),children:Me.isPlaceholder?null:p0(Me.column.columnDef.header,Me.getContext())},Me.id))},xe.id))}),C.jsx("tbody",{children:Yt.map((xe,Me)=>C.jsx($,{showBorders:r,isSelected:xe.getIsSelected(),onClick:()=>Xt(xe,Me),children:xe.getVisibleCells().map(Zt=>C.jsx(D,{children:p0(Zt.column.columnDef.cell,Zt.getContext())},Zt.id))},xe.id))})]})}),i&&!v&&C.jsx(xO,{pageIndex:De.pageIndex,pageSize:De.pageSize,totalCount:y||t.length,renderPageSizeSelectorDropdownItem:U,renderPageSizeSelectorInputItem:L,onPageChange:xe=>Re({...De,pageIndex:xe}),onPageSizeChange:xe=>Re({...De,pageSize:xe,pageIndex:0})})]}):C.jsxs(G,{w:"full",borderRadius:b0.md,py:mn["5xl"],px:mn["10xl"],alignItems:"center",className:R.cx(E),children:[C.jsx(aO,{width:24,height:24,style:{color:js.icon.tertiary,marginBottom:mn.sm}}),C.jsx(se,{mb:mn.xs,variant:"title-3",fontWeight:"semibold",children:b.title}),C.jsx(se,{mb:mn.md,colorName:"tertiary",variant:"body-1",fontWeight:"medium",children:b.description}),typeof b.action=="string"?C.jsx(Si,{width:"auto",onClick:H,intensity:"secondary",color:"accent",children:b.action}):b.action]})};Ui.displayName="Table";Ui.HeadCellContent=mg;Ui.BodyCellContent=rS;Ui.HeadCellContentSortable=iS;Ui.createColumnHelper=UC;const{color:tn}=j,Ku={chart:{type:"areaspline",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0]},xAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},yAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},legend:{enabled:!1},credits:{enabled:!1}},EO={positive:{color:tn.fill.positivePrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,tn.fill.positiveTintHigh],[1,tn.fill.positiveTransparent]]}},negative:{color:tn.fill.negativePrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,tn.fill.negativeTintHigh],[1,tn.fill.negativeTransparent]]}},accent:{color:tn.fill.accentPrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,tn.fill.accentTintHigh],[1,tn.fill.accentTransparent]]}},warning:{color:tn.fill.warningPrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,tn.fill.warningTintHigh],[1,tn.fill.warningTransparent]]}},transfer:{color:"var(--fill-transfer-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-transfer-tint-high)"],[1,"var(--fill-transfer-transparent)"]]}}},{color:w0}=j,RO=(e,t,n,r,o)=>({...Ku,plotOptions:{areaspline:{marker:{enabled:!1,states:{hover:{enabled:o}}},allowPointSelect:!1}},xAxis:{...Ku.xAxis,...n},yAxis:{...Ku.yAxis,...r},series:[{type:"areaspline",data:t,...EO[e]}]}),kO=e=>({outside:!0,enabled:!!e,padding:0,position:{alignByTranslate:!0},shadow:{color:w0.effect.shadowM,offsetX:0,offsetY:0},borderRadius:8,backgroundColor:w0.fill.bgPrimary,useHTML:!0,...e}),lS=({color:e="positive",data:t=[],xAxis:n,yAxis:r,containerProps:o,highcharts:i,tooltip:s})=>{const a=S.useRef(null);S.useEffect(()=>()=>{typeof a=="object"&&a?.current?.chart&&a.current.chart.destroy()},[]);const l=S.useMemo(()=>RO(e,t,n,r,!!s),[e,t,n,r,s]),c=S.useMemo(()=>s?kO(s):{enabled:!1},[s]);return C.jsx(rl.Chart,{highcharts:i,ref:a,options:l,containerProps:o,children:C.jsx(rl.Tooltip,{...c})})};lS.displayName="LineChart";const{color:nr}=j,AO={chart:{type:"pie",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0],events:{click:void 0}},title:{align:"center",verticalAlign:"middle",floating:!0,style:{fontSize:"24px",fontWeight:"600",color:nr.text.primary}},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!1},startAngle:90,endAngle:-90,innerSize:"90%",borderWidth:0,states:{hover:{enabled:!1},select:{enabled:!1},inactive:{enabled:!1}},enableMouseTracking:!1}},tooltip:{enabled:!1},legend:{enabled:!1},credits:{enabled:!1}},MO={positive:{colors:[nr.fill.positivePrimary,nr.fill.positiveTintHigh]},negative:{colors:[nr.fill.negativePrimary,nr.fill.negativeTintHigh]},accent:{colors:[nr.fill.accentPrimary,nr.fill.accentTintHigh]},warning:{colors:[nr.fill.warningPrimary,nr.fill.warningTintHigh]},transfer:{colors:["var(--fill-transfer-primary)","var(--fill-transfer-tint-high)"]}},NO=(e,t)=>({...AO,series:[{type:"pie",data:[{name:"",y:Math.min(e,100)},{name:"",y:Math.max(100-e,0)}],...MO[t]}]}),cS=S.forwardRef(({highcharts:e,color:t="positive",percentage:n,label:r=s=>`${s}%`,containerProps:o},i)=>{const s=S.useRef(null),a=i||s;S.useEffect(()=>()=>{typeof a=="object"&&a?.current?.chart&&a.current.chart.destroy()},[a]);const l=S.useMemo(()=>NO(n,t),[n,t]);return C.jsx(rl.Chart,{highcharts:e,ref:a,options:l,containerProps:o,children:C.jsx(rl.Title,{children:r?.(n)})})});cS.displayName="PieProgressChart";const PO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M9 17L14 12L9 7",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),{color:C0}=j,tl={link:R.css({...me.body2,color:C0.text.tertiary,textDecoration:"none",transition:"color 0.2s ease","&:hover":{textDecoration:"underline"}}),separator:R.css({color:C0.icon.tertiary}),nav:R.css({display:"flex",alignItems:"center",flexWrap:"wrap"}),navItem:R.css({display:"inline-flex",alignItems:"center"})},yg=({children:e,separator:t=C.jsx(PO,{className:tl.separator})})=>{const n=S.Children.toArray(e).filter(r=>S.isValidElement(r));return C.jsx("nav",{"aria-label":"breadcrumb",className:tl.nav,children:n.map((r,o)=>{const i=o===n.length-1;return C.jsxs(se,{tag:"span",className:tl.navItem,children:[S.cloneElement(r,{active:r.props.active??i}),!i&&t]},o)})})},LO=({children:e,href:t,active:n,className:r,activeClassName:o,activeElement:i,onClick:s})=>n?i||C.jsx(se,{tag:"span",variant:"body-2",fontWeight:"medium",colorName:"primary",className:R.cx(r,o),onClick:s,children:e}):C.jsx("a",{href:t,className:R.cx(tl.link,r),onClick:s,children:e});yg.Item=LO;yg.displayName="Breadcrumbs";const FO=yg,{color:Je,cornerRadius:Sr,height:xt,transition:S0}=j,$O={primary:{bg:Je.fill.accentTint,text:Je.text.accent,icon:Je.icon.accent},secondary:{bg:Je.fill.neutralTint,text:Je.text.secondary,icon:Je.icon.tertiary},negative:{bg:Je.fill.negativeTint,text:Je.text.negative,icon:Je.icon.negative},positive:{bg:Je.fill.positiveTint,text:Je.text.positive,icon:Je.icon.positive},warning:{bg:Je.fill.warningTint,text:Je.text.warning,icon:Je.icon.warning},neutral:{bg:Je.fill.neutralTint,text:Je.text.tertiary,icon:Je.icon.tertiary},transfer:{bg:"var(--fill-transfer-tint)",text:"var(--text-transfer)",icon:"var(--icon-transfer)"},custom:{bg:Je.fill.accentTint,text:Je.text.accent,icon:Je.icon.accent}},OO={"2xs":{size:xt.avatar["2xs"],borderRadius:Sr.xs,iconSize:xt.icon["2xs"],fontSize:10,fontWeight:500},xs:{size:xt.avatar.xs,borderRadius:Sr.sm,iconSize:xt.icon.xs,fontSize:12,fontWeight:500},sm:{size:xt.avatar.sm,borderRadius:Sr.sm,iconSize:xt.icon.xs,fontSize:14,fontWeight:500},md:{size:xt.avatar.md,borderRadius:Sr.sm,iconSize:xt.icon.sm,fontSize:14,fontWeight:500},lg:{size:xt.avatar.lg,borderRadius:Sr.md,iconSize:xt.icon.md,fontSize:16,fontWeight:600},xl:{size:xt.avatar.xl,borderRadius:Sr.md,iconSize:xt.icon.md,fontSize:16,fontWeight:600},"2xl":{size:xt.avatar["2xl"],borderRadius:Sr.md,iconSize:xt.icon.md,fontSize:18,fontWeight:500},custom:{size:xt.avatar.md,borderRadius:Sr.sm,iconSize:xt.icon.sm,fontSize:14,fontWeight:500}},uS=S.forwardRef(({children:e,color:t="primary",size:n="md",fullRound:r=!1,className:o},i)=>{const s=S.useMemo(()=>$O[t],[t]),a=S.useMemo(()=>OO[n],[n]),l=S.useMemo(()=>R.css({width:a.size,height:a.size,borderRadius:r?"var(--corner-full-round)":a.borderRadius,backgroundColor:s.bg,color:s.text,fontSize:a.fontSize,fontWeight:a.fontWeight,lineHeight:1,transition:S0.general,"& svg":{width:a.iconSize,height:a.iconSize,color:s.icon,transition:S0.general},"& img":{width:"100%",height:"100%",objectFit:"cover"},"&:has(img)":{backgroundColor:"transparent",border:`1px solid ${Je.border.neutralAlphaLow}`}}),[s,a,r]);return C.jsx(G,{ref:i,center:!0,overflow:"hidden",className:R.cx(l,o),children:e})});uS.displayName="Avatar";const{color:Tt,cornerRadius:Uu,spacing:nl}=j,xf={neutral:{border:Tt.border.neutralAlphaLow,bg:Tt.status.neutralTint,color:Tt.text.secondary,colorName:"secondary"},accent:{border:Tt.border.accentSecondary,bg:Tt.status.accentTintLow,color:Tt.text.accent,colorName:"accent"},warning:{border:Tt.border.warningSecondary,bg:Tt.status.warningTintLow,color:Tt.text.warning,colorName:"warning"},positive:{border:Tt.border.positiveSecondary,bg:Tt.status.positiveTintLow,color:Tt.text.positive,colorName:"positive"},negative:{border:Tt.border.negativeSecondary,bg:Tt.status.negativeTintLow,color:Tt.text.negative,colorName:"negative"},transfer:{border:"var(--border-transfer-secondary)",bg:"var(--status-transfer-tint-low)",color:"var(--text-transfer)",colorName:"transfer"}},Va={sm:{h:24,text:"caption-1",corner:Uu.xs,p:`6px ${nl.sm}`},md:{h:32,text:"body-2",corner:Uu.sm,p:`6px ${nl.md}`},lg:{h:40,text:"body-2",corner:Uu.md,p:`6px ${nl.lg}`}},IO=(e,t,n,r)=>{const o=xf[t];let i=o.bg,s="none";const a=o.color;switch(e){case"outline":i="transparent",s=`1px solid ${o.border}`;break;case"clear":i="transparent";break;default:i=o.bg;break}return R.css({cursor:n?"not-allowed":r?"pointer":"default",opacity:n?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s",backgroundColor:i,color:a,border:s})},DO=R.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}}),dS=({label:e,color:t="neutral",size:n="md",variant:r="filled",leftElement:o,rightElement:i,disabled:s,onClick:a,onDelete:l,className:c})=>{const u=IO(r,t,s,a);return C.jsxs(G,{row:!0,alignItems:"center",gap:nl.sm,p:Va[n].p,h:Va[n].h,overflow:"hidden",borderRadius:Va[n].corner,onClick:a,className:R.cx(u,c),children:[a&&C.jsx(Lo,{}),o,C.jsx(se,{variant:Va[n].text,colorName:xf[t].colorName,textOverflow:"ellipsis",children:e}),i,l&&!s&&C.jsx(se,{className:DO,colorName:xf[t].colorName,onClick:f=>{f.stopPropagation(),l(f)},children:C.jsx(IC,{})})]})};dS.displayName="Badge";const jO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.15}),M.createElement("path",{d:"M16 9L10.0337 15L8 12.9548",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Gu=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor",fillOpacity:.15}),M.createElement("path",{d:"M12 6C11.4477 6 11 6.44772 11 7V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V7C13 6.44772 12.5523 6 12 6Z",fill:"currentColor"}),M.createElement("path",{d:"M12 15C11.4477 15 11 15.4477 11 16V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16C13 15.4477 12.5523 15 12 15Z",fill:"currentColor"})),VO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.12}),M.createElement("path",{d:"M16 8L8 16M16 16L8 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),BO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"black",...e},M.createElement("path",{d:"M12 2V22M19.0711 4.92893L4.92893 19.0711M22 12H2M19.0711 19.0711L4.92893 4.92893",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),{color:Ke,cornerRadius:zO,spacing:_s}=j,Xo={hint:R.css({display:"flex",alignItems:"flex-start",gap:_s.md,padding:_s.lg,minHeight:48,width:"100%",borderRadius:zO.md,transition:"background 0.2s, color 0.2s"}),icon:R.css({flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:24,height:24}}),content:R.css({display:"flex",flexDirection:"column",gap:_s.xs}),title:R.css({verticalAlign:"middle",color:"inherit"}),subtitle:R.css({verticalAlign:"middle",opacity:.8,color:"inherit"}),disabled:R.css({opacity:.5,pointerEvents:"none"})},HO={solid:{warning:R.css({background:Ke.status.warning,color:Ke.text.inverse}),negative:R.css({background:Ke.status.negative,color:Ke.text.inverse}),positive:R.css({background:Ke.status.positive,color:Ke.text.inverse}),accent:R.css({background:Ke.status.accent,color:Ke.text.inverse}),neutral:R.css({background:Ke.status.neutral,color:Ke.text.inverse}),transfer:R.css({background:Ke.status.transfer,color:Ke.text.inverse})},soft:{warning:R.css({background:Ke.status.warningTintLow,color:Ke.text.warning}),negative:R.css({background:Ke.status.negativeTintLow,color:Ke.text.negative}),positive:R.css({background:Ke.status.positiveTintLow,color:Ke.text.positive}),accent:R.css({background:Ke.status.accentTintLow,color:Ke.text.accent}),neutral:R.css({background:Ke.status.neutralTintLow,color:Ke.text.tertiary}),transfer:R.css({background:Ke.status.transferTintLow,color:Ke.text.transfer})}},WO={md:R.css({minHeight:48,padding:_s.lg}),sm:R.css({minHeight:32,padding:_s.md})},KO={negative:C.jsx(VO,{}),positive:C.jsx(jO,{}),accent:C.jsx(Gu,{}),warning:C.jsx(Gu,{}),transfer:C.jsx(Gu,{}),neutral:C.jsx(BO,{})},UO=({title:e,subtitle:t,color:n="warning",variant:r="soft",size:o="md",icon:i,disabled:s=!1,className:a,style:l})=>{const c=i||KO[n];return C.jsxs("div",{className:Sf(Xo.hint,WO[o],HO[r][n],s&&Xo.disabled,a),style:l,"aria-disabled":s,children:[c&&C.jsx("span",{className:Xo.icon,children:c}),C.jsxs("div",{className:Xo.content,children:[e&&C.jsx(se,{className:Xo.title,variant:o==="md"?"body-1":"caption-2",children:e}),t&&C.jsx(se,{className:Xo.subtitle,variant:o==="md"?"body-2":"caption-1",children:t})]})]})},{color:no,cornerRadius:GO,spacing:Ln}=j,qO=R.css({width:"100%",cursor:"default",userSelect:"text",outline:"none",...me.body2,color:no.text.primary,overflowWrap:"anywhere","p, ul, ol, pre, blockquote, table":{margin:`${Ln.sm} 0`},"h1, h2, h3, h4, h5, h6":{margin:`${Ln.md} 0 ${Ln.sm}`,fontWeight:600},h1:{fontSize:me.title1.fontSize,lineHeight:me.title1.lineHeight},h2:{fontSize:me.title2.fontSize,lineHeight:me.title2.lineHeight},h3:{fontSize:me.title3.fontSize,lineHeight:me.title3.lineHeight},h4:{fontSize:me.headline2.fontSize,lineHeight:me.headline2.lineHeight},h5:{fontSize:me.headline3.fontSize,lineHeight:me.headline3.lineHeight},h6:{fontSize:me.body1.fontSize,lineHeight:me.body1.lineHeight},ul:{paddingLeft:Ln.xl,listStyleType:"disc"},ol:{paddingLeft:Ln.xl,listStyleType:"decimal"},li:{margin:`${Ln.xs} 0`},a:{color:no.text.accent,textDecoration:"underline"},code:{padding:`0 ${Ln.xs}`,borderRadius:GO.xs,backgroundColor:no.fill.neutralSecondary,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"pre code":{display:"block",padding:Ln.md,overflowX:"auto"},blockquote:{marginLeft:0,paddingLeft:Ln.md,borderLeft:`3px solid ${no.border.neutralAlphaBasic}`,color:no.text.secondary},table:{width:"100%",borderCollapse:"collapse"},"th, td":{border:`1px solid ${no.border.neutralAlphaBasic}`,padding:Ln.sm,textAlign:"left"},th:{backgroundColor:no.fill.neutralSecondary}});function YO({markdown:e,className:t,emptyState:n=null}){const r=e.trim(),o=S.useMemo(()=>({isEditable:!1,isPreviewMode:!0,setPreviewMode:()=>{},markdownText:r}),[r]);return r?C.jsx(oh.Provider,{value:o,children:C.jsx(zw,{initialConfig:{...gC(),editable:!1,namespace:"ui-kit-markdown-text-viewer",editorState:()=>{Vw(r,Pl)}},children:C.jsx(hC,{contentEditable:C.jsx(dC,{className:R.cx(qO,t),"aria-placeholder":"markdown text",placeholder:()=>null}),placeholder:null,ErrorBoundary:fC})},r)}):typeof n=="string"?C.jsx(se,{variant:"body-2",colorName:"tertiary",children:n}):n}const{color:fS,cornerRadius:XO}=j,ZO=R.keyframes`
86
86
  from {
87
87
  opacity: 0;
88
88
  }
89
89
  to {
90
90
  opacity: 1;
91
91
  }
92
- `,GO=R.css({animation:`${UO} 0.2s ease-out`,boxShadow:`0 4px 20px 0 ${oS.effect.shadowS}`}),qO=({children:e,className:t,...n})=>C.jsx(G,{relative:!0,backgroundColor:oS.fill.bgPrimary,borderRadius:KO.md,className:R.cx(GO,t),...n,children:e}),Nr=({children:e,content:t,initialOpen:n=!1,open:r,onChange:o,placement:i="bottom",trigger:s="click",offset:a=12,closeOnBackdropClick:l=!0,closeOnEsc:c=!0,className:u,contentClassName:f,style:d,openDelay:h=200,closeDelay:g=200,zIndex:p=1,popoverContentComponent:m=qO})=>{const[x,y]=S.useState(n),v=r??x,b=o??y,w=S.useCallback(()=>{l&&b(!1)},[l,b]),{context:_,refs:E,floatingStyles:T}=ag({placement:i,open:v,onOpenChange:b,whileElementsMounted:eg,middleware:[tg(a),rg({crossAxis:i.includes("-"),fallbackAxisSideDirection:i.includes("start")?"start":"end",padding:a}),ng({padding:a})]}),k=PL(_,{enabled:s==="click"}),P=TC(_,{enabled:s==="hover",delay:{open:h,close:g}}),O=EC(_,{escapeKey:c,outsidePress:!1}),D=kC(_),I=RC([k,P,O,D]),$=e.ref,H=SC([E.setReference,$]),U=S.cloneElement(e,I.getReferenceProps({...e.props,ref:H,"data-state":_.open?"open":"closed"}));return C.jsxs(C.Fragment,{children:[U,v&&C.jsxs(Hi,{children:[s!=="hover"&&l&&C.jsx(G,{position:"fixed",top:0,right:0,bottom:0,left:0,display:"block",backgroundColor:"transparent",onClick:w,zIndex:p}),C.jsx(G,{absolute:!0,zIndex:p,className:u,ref:E.setFloating,style:{...T,...d},...I.getFloatingProps(),children:C.jsx(m,{className:f,children:t})})]})]})},{color:YO,cornerRadius:kt,spacing:XO}=V,w0={xs:{width:16,height:16},sm:{width:24,height:24},md:{width:32,height:32},lg:{width:40,height:40},xl:{width:48,height:48}},ZO={zero:kt.zero,xs:kt.xs,sm:kt.sm,md:kt.md,lg:kt.lg,xl:kt.xl,"2xl":kt["2xl"],"3xl":kt["3xl"],"4xl":kt["4xl"],"5xl":kt["5xl"],"6xl":kt["6xl"],"full-round":kt.fullRound,circular:"50%"},C0=R.css({backgroundColor:YO.status.neutralTint,borderRadius:kt.sm,position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,background:"linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent)",transform:"translateX(-100%)"}}),JO=R.css({animation:"skeleton-pulse 1.5s ease-in-out infinite","@keyframes skeleton-pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}}),QO=R.css({"&::before":{animation:"skeleton-wave 1.6s linear infinite"},"@keyframes skeleton-wave":{"0%":{transform:"translateX(-100%)"},"50%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}}}),S0=(e,t)=>{if(t!==void 0)return R.css({borderRadius:ZO[t]});switch(e){case"circular":return R.css({borderRadius:"50%"});case"text":return R.css({borderRadius:kt.xs});default:return R.css({borderRadius:kt.sm})}},_0=e=>{switch(e){case"pulse":return JO;case"wave":return QO;default:return""}},iS=({width:e,height:t,variant:n="rectangular",size:r="md",animation:o="wave",lines:i=1,className:s,children:a,loading:l=!0,borderRadius:c})=>{if(!l&&a)return C.jsx(C.Fragment,{children:a});if(!l)return null;const u=e||w0[r].width,f=t||w0[r].height;return n==="text"&&i>1?C.jsx(G,{gap:XO.sm,className:s,children:Array.from({length:i},(d,h)=>C.jsx(G,{className:R.cx(C0,S0(n,c),_0(o)),w:h===i-1?"70%":u,h:f},h))}):C.jsx(G,{className:R.cx(C0,S0(n,c),_0(o),s),w:u,h:f})};iS.displayName="Skeleton";const T0=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M11.9998 8.99999V13M11.9998 17H12.0098M10.6151 3.89171L2.39019 18.0983C1.93398 18.8863 1.70588 19.2803 1.73959 19.6037C1.769 19.8857 1.91677 20.142 2.14613 20.3088C2.40908 20.5 2.86435 20.5 3.77487 20.5H20.2246C21.1352 20.5 21.5904 20.5 21.8534 20.3088C22.0827 20.142 22.2305 19.8857 22.2599 19.6037C22.2936 19.2803 22.0655 18.8863 21.6093 18.0983L13.3844 3.89171C12.9299 3.10654 12.7026 2.71396 12.4061 2.58211C12.1474 2.4671 11.8521 2.4671 11.5935 2.58211C11.2969 2.71396 11.0696 3.10655 10.6151 3.89171Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),E0=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),e5=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M12 16V12M12 8H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),t5=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M17 7L7 17M7 7L17 17",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),n5={positive:C.jsx(E0,{}),negative:C.jsx(T0,{}),warning:C.jsx(T0,{}),info:C.jsx(e5,{}),neutral:C.jsx(E0,{})},r5=R.css({boxShadow:`0 4px 20px 0 ${V.color.effect.shadowM}`}),o5=R.css({cursor:"pointer","&:hover":{opacity:.8}}),sS=S.forwardRef(({title:e,subtitle:t,icon:n,variant:r="neutral",w:o="full",onClose:i,...s},a)=>{const l=S.useMemo(()=>r==="neutral"||r==="info"?V.color.icon.accent:r==="positive"?V.color.icon.positive:r==="negative"?V.color.icon.negative:r==="warning"?V.color.icon.warning:V.color.icon.inverse,[r]),c=S.useMemo(()=>r==="neutral"?V.color.icon.tertiary:V.color.icon.inverse,[r]),u=S.useMemo(()=>r==="neutral"?V.color.fill.accentSecondary:V.color.fill.bgPrimary,[r]),f=S.useMemo(()=>r==="neutral"?V.color.fill.bgPrimary:r==="info"?V.color.fill.accentPrimary:r==="positive"?V.color.fill.positivePrimary:r==="negative"?V.color.fill.negativePrimary:r==="warning"?V.color.fill.warningPrimary:V.color.fill.accentPrimary,[r]),d=S.useMemo(()=>r==="neutral"?V.color.text.primary:V.color.text.primaryInverse,[r]),h=S.useMemo(()=>r==="neutral"?V.color.text.tertiaryInverse:V.color.text.primaryInverse,[r]);return C.jsxs(G,{row:!0,w:o,ref:a,p:V.spacing.md,gap:V.spacing.md,backgroundColor:f,borderRadius:V.cornerRadius.lg,className:r5,...s,children:[C.jsx(G,{w:48,h:48,center:!0,backgroundColor:u,borderRadius:V.cornerRadius.md,style:{color:l},children:n||n5[r]}),C.jsxs(G,{flex:1,children:[C.jsx(ae,{variant:"body-1",fontWeight:"semibold",color:d,children:e}),t&&C.jsx(ae,{variant:"body-2",fontWeight:"medium",color:h,children:t})]}),C.jsx(G,{onClick:i,children:C.jsx(t5,{width:24,height:24,color:c,className:o5})})]})});let Yo=[];const yf=new Set,is=new Map;function Wu(){for(const e of yf)e()}function i5(){return Math.random().toString(36).slice(2,9)}const wn={getSnapshot(){return Yo},subscribe(e){return yf.add(e),()=>yf.delete(e)},add(e){const t=e.id??i5(),n=e.duration??5e3;if(Yo=[...Yo,{...e,id:t,duration:n}],Wu(),n>0){const r=setTimeout(()=>wn.remove(t),n);is.set(t,r)}return t},remove(e){const t=is.get(e);t&&(clearTimeout(t),is.delete(e)),Yo=Yo.filter(n=>n.id!==e),Wu()},removeAll(){for(const[,e]of is)clearTimeout(e);is.clear(),Yo=[],Wu()}};class s5{show(t){return wn.add(t)}dismiss(t){wn.remove(t)}dismissAll(){wn.removeAll()}success(t,n){return this.show({...n,title:t,variant:"positive"})}error(t,n){return this.show({...n,title:t,variant:"negative"})}warning(t,n){return this.show({...n,title:t,variant:"warning"})}info(t,n){return this.show({...n,title:t,variant:"info"})}}const _r=new s5;function a5(){return{toasts:S.useSyncExternalStore(wn.subscribe,wn.getSnapshot,wn.getSnapshot),show:_r.show,success:_r.success,error:_r.error,warning:_r.warning,info:_r.info,dismiss:_r.dismiss,dismissAll:_r.dismissAll}}const l5={"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}},c5=e=>{const t=e.startsWith("top"),n=e.endsWith("left"),r=e.endsWith("right"),o=e.endsWith("center"),i=n?-40:r?40:0;return{initial:{opacity:0,x:i,y:t?-16:16,scale:.95},animate:{opacity:1,x:0,y:0,scale:1},exit:{opacity:0,x:i,scale:.95,transition:{duration:.15}}}},u5=R.css({position:"fixed",zIndex:2,display:"flex",flexDirection:"column",gap:8,pointerEvents:"none",maxWidth:325,width:"100%"}),d5=R.css({pointerEvents:"auto",width:"100%"});function aS({position:e="top-right"}){const t=S.useSyncExternalStore(wn.subscribe,wn.getSnapshot,wn.getSnapshot),n=c5(e);return C.jsx(Hi,{children:C.jsx("div",{className:u5,style:l5[e],children:C.jsx(kx,{initial:!1,children:t.map(r=>C.jsx(zs.div,{className:d5,layout:!0,initial:n.initial,animate:n.animate,exit:n.exit,transition:{type:"spring",stiffness:400,damping:30},children:C.jsx(sS,{title:r.title,subtitle:r.subtitle,icon:r.icon,variant:r.variant,onClose:()=>wn.remove(r.id)})},r.id))})})})}const{color:Da}=V,f5={top:"polygon(100% 0%, 50% 100%, 0% 0%)",bottom:"polygon(0% 100%, 50% 0%, 100% 100%)","top-start":"polygon(0% 0%, 0% 100%, 100% 0%)","top-end":"polygon(100% 0%, 100% 100%, 0% 0%)","bottom-start":"polygon(0% 100%, 0% 0%, 100% 100%)","bottom-end":"polygon(100% 100%, 100% 0%, 0% 100%)",left:"polygon(0% 100%, 100% 50%, 0% 0%)",right:"polygon(100% 100%, 0% 50%, 100% 0%)"},h5=10,g5=6,Va=1,R0={primary:{backgroundColor:Da.fill.bgPrimary,color:Da.text.primary},inverse:{backgroundColor:Da.fill.bgPrimaryInverse,color:Da.text.primaryInverse}},p5=(e,t)=>(e==="top"||e==="bottom")&&t?`${e}-${t}`:e,m5=(e,t,n)=>n?(e==="top"||e==="bottom")&&t?{[e==="top"?t==="start"?"borderBottomLeftRadius":"borderBottomRightRadius":t==="start"?"borderTopLeftRadius":"borderTopRightRadius"]:0}:{}:{},y5=(e,t,n)=>e==="left"||e==="right"?{width:6,height:n}:t?{width:8,height:6}:{width:n,height:6},v5=(e,t,n)=>e?(t==="top"||t==="bottom")&&n?{x:n==="start"?0:void 0,y:e.y}:{x:e.x,y:e.y}:{x:void 0,y:void 0},{color:x5,cornerRadius:b5,spacing:w5}=V,C5=R.keyframes`
92
+ `,JO=R.css({animation:`${ZO} 0.2s ease-out`,boxShadow:`0 4px 20px 0 ${fS.effect.shadowS}`}),QO=({children:e,className:t,...n})=>C.jsx(G,{relative:!0,backgroundColor:fS.fill.bgPrimary,borderRadius:XO.md,className:R.cx(JO,t),...n,children:e}),Pr=({children:e,content:t,initialOpen:n=!1,open:r,onChange:o,placement:i="bottom",trigger:s="click",offset:a=12,closeOnBackdropClick:l=!0,closeOnEsc:c=!0,className:u,contentClassName:f,style:d,openDelay:h=200,closeDelay:g=200,zIndex:p=1,popoverContentComponent:m=QO})=>{const[x,y]=S.useState(n),v=r??x,b=o??y,w=S.useCallback(()=>{l&&b(!1)},[l,b]),{context:_,refs:E,floatingStyles:T}=ug({placement:i,open:v,onOpenChange:b,whileElementsMounted:rg,middleware:[og(a),sg({crossAxis:i.includes("-"),fallbackAxisSideDirection:i.includes("start")?"start":"end",padding:a}),ig({padding:a})]}),k=FF(_,{enabled:s==="click"}),P=LC(_,{enabled:s==="hover",delay:{open:h,close:g}}),O=FC(_,{escapeKey:c,outsidePress:!1}),D=OC(_),I=$C([k,P,O,D]),$=e.ref,H=NC([E.setReference,$]),U=S.cloneElement(e,I.getReferenceProps({...e.props,ref:H,"data-state":_.open?"open":"closed"}));return C.jsxs(C.Fragment,{children:[U,v&&C.jsxs(Ki,{children:[s!=="hover"&&l&&C.jsx(G,{position:"fixed",top:0,right:0,bottom:0,left:0,display:"block",backgroundColor:"transparent",onClick:w,zIndex:p}),C.jsx(G,{absolute:!0,zIndex:p,className:u,ref:E.setFloating,style:{...T,...d},...I.getFloatingProps(),children:C.jsx(m,{className:f,children:t})})]})]})},{color:e5,cornerRadius:kt,spacing:t5}=j,_0={xs:{width:16,height:16},sm:{width:24,height:24},md:{width:32,height:32},lg:{width:40,height:40},xl:{width:48,height:48}},n5={zero:kt.zero,xs:kt.xs,sm:kt.sm,md:kt.md,lg:kt.lg,xl:kt.xl,"2xl":kt["2xl"],"3xl":kt["3xl"],"4xl":kt["4xl"],"5xl":kt["5xl"],"6xl":kt["6xl"],"full-round":kt.fullRound,circular:"50%"},T0=R.css({backgroundColor:e5.status.neutralTint,borderRadius:kt.sm,position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,background:"linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent)",transform:"translateX(-100%)"}}),r5=R.css({animation:"skeleton-pulse 1.5s ease-in-out infinite","@keyframes skeleton-pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}}),o5=R.css({"&::before":{animation:"skeleton-wave 1.6s linear infinite"},"@keyframes skeleton-wave":{"0%":{transform:"translateX(-100%)"},"50%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}}}),E0=(e,t)=>{if(t!==void 0)return R.css({borderRadius:n5[t]});switch(e){case"circular":return R.css({borderRadius:"50%"});case"text":return R.css({borderRadius:kt.xs});default:return R.css({borderRadius:kt.sm})}},R0=e=>{switch(e){case"pulse":return r5;case"wave":return o5;default:return""}},hS=({width:e,height:t,variant:n="rectangular",size:r="md",animation:o="wave",lines:i=1,className:s,children:a,loading:l=!0,borderRadius:c})=>{if(!l&&a)return C.jsx(C.Fragment,{children:a});if(!l)return null;const u=e||_0[r].width,f=t||_0[r].height;return n==="text"&&i>1?C.jsx(G,{gap:t5.sm,className:s,children:Array.from({length:i},(d,h)=>C.jsx(G,{className:R.cx(T0,E0(n,c),R0(o)),w:h===i-1?"70%":u,h:f},h))}):C.jsx(G,{className:R.cx(T0,E0(n,c),R0(o),s),w:u,h:f})};hS.displayName="Skeleton";const k0=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M11.9998 8.99999V13M11.9998 17H12.0098M10.6151 3.89171L2.39019 18.0983C1.93398 18.8863 1.70588 19.2803 1.73959 19.6037C1.769 19.8857 1.91677 20.142 2.14613 20.3088C2.40908 20.5 2.86435 20.5 3.77487 20.5H20.2246C21.1352 20.5 21.5904 20.5 21.8534 20.3088C22.0827 20.142 22.2305 19.8857 22.2599 19.6037C22.2936 19.2803 22.0655 18.8863 21.6093 18.0983L13.3844 3.89171C12.9299 3.10654 12.7026 2.71396 12.4061 2.58211C12.1474 2.4671 11.8521 2.4671 11.5935 2.58211C11.2969 2.71396 11.0696 3.10655 10.6151 3.89171Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),A0=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),i5=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M12 16V12M12 8H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),s5=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M17 7L7 17M7 7L17 17",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),a5={positive:C.jsx(A0,{}),negative:C.jsx(k0,{}),warning:C.jsx(k0,{}),info:C.jsx(i5,{}),neutral:C.jsx(A0,{})},l5=R.css({boxShadow:`0 4px 20px 0 ${j.color.effect.shadowM}`}),c5=R.css({cursor:"pointer","&:hover":{opacity:.8}}),gS=S.forwardRef(({title:e,subtitle:t,icon:n,variant:r="neutral",w:o="full",onClose:i,...s},a)=>{const l=S.useMemo(()=>r==="neutral"||r==="info"?j.color.icon.accent:r==="positive"?j.color.icon.positive:r==="negative"?j.color.icon.negative:r==="warning"?j.color.icon.warning:j.color.icon.inverse,[r]),c=S.useMemo(()=>r==="neutral"?j.color.icon.tertiary:j.color.icon.inverse,[r]),u=S.useMemo(()=>r==="neutral"?j.color.fill.accentSecondary:j.color.fill.bgPrimary,[r]),f=S.useMemo(()=>r==="neutral"?j.color.fill.bgPrimary:r==="info"?j.color.fill.accentPrimary:r==="positive"?j.color.fill.positivePrimary:r==="negative"?j.color.fill.negativePrimary:r==="warning"?j.color.fill.warningPrimary:j.color.fill.accentPrimary,[r]),d=S.useMemo(()=>r==="neutral"?j.color.text.primary:j.color.text.primaryInverse,[r]),h=S.useMemo(()=>r==="neutral"?j.color.text.tertiaryInverse:j.color.text.primaryInverse,[r]);return C.jsxs(G,{row:!0,w:o,ref:a,p:j.spacing.md,gap:j.spacing.md,backgroundColor:f,borderRadius:j.cornerRadius.lg,className:l5,...s,children:[C.jsx(G,{w:48,h:48,center:!0,backgroundColor:u,borderRadius:j.cornerRadius.md,style:{color:l},children:n||a5[r]}),C.jsxs(G,{flex:1,children:[C.jsx(se,{variant:"body-1",fontWeight:"semibold",color:d,children:e}),t&&C.jsx(se,{variant:"body-2",fontWeight:"medium",color:h,children:t})]}),C.jsx(G,{onClick:i,children:C.jsx(s5,{width:24,height:24,color:c,className:c5})})]})});let Zo=[];const bf=new Set,as=new Map;function qu(){for(const e of bf)e()}function u5(){return Math.random().toString(36).slice(2,9)}const wn={getSnapshot(){return Zo},subscribe(e){return bf.add(e),()=>bf.delete(e)},add(e){const t=e.id??u5(),n=e.duration??5e3;if(Zo=[...Zo,{...e,id:t,duration:n}],qu(),n>0){const r=setTimeout(()=>wn.remove(t),n);as.set(t,r)}return t},remove(e){const t=as.get(e);t&&(clearTimeout(t),as.delete(e)),Zo=Zo.filter(n=>n.id!==e),qu()},removeAll(){for(const[,e]of as)clearTimeout(e);as.clear(),Zo=[],qu()}};class d5{show(t){return wn.add(t)}dismiss(t){wn.remove(t)}dismissAll(){wn.removeAll()}success(t,n){return this.show({...n,title:t,variant:"positive"})}error(t,n){return this.show({...n,title:t,variant:"negative"})}warning(t,n){return this.show({...n,title:t,variant:"warning"})}info(t,n){return this.show({...n,title:t,variant:"info"})}}const Tr=new d5;function f5(){return{toasts:S.useSyncExternalStore(wn.subscribe,wn.getSnapshot,wn.getSnapshot),show:Tr.show,success:Tr.success,error:Tr.error,warning:Tr.warning,info:Tr.info,dismiss:Tr.dismiss,dismissAll:Tr.dismissAll}}const h5={"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}},g5=e=>{const t=e.startsWith("top"),n=e.endsWith("left"),r=e.endsWith("right"),o=e.endsWith("center"),i=n?-40:r?40:0;return{initial:{opacity:0,x:i,y:t?-16:16,scale:.95},animate:{opacity:1,x:0,y:0,scale:1},exit:{opacity:0,x:i,scale:.95,transition:{duration:.15}}}},p5=R.css({position:"fixed",zIndex:2,display:"flex",flexDirection:"column",gap:8,pointerEvents:"none",maxWidth:325,width:"100%"}),m5=R.css({pointerEvents:"auto",width:"100%"});function pS({position:e="top-right"}){const t=S.useSyncExternalStore(wn.subscribe,wn.getSnapshot,wn.getSnapshot),n=g5(e);return C.jsx(Ki,{children:C.jsx("div",{className:p5,style:h5[e],children:C.jsx(Nx,{initial:!1,children:t.map(r=>C.jsx(Ws.div,{className:m5,layout:!0,initial:n.initial,animate:n.animate,exit:n.exit,transition:{type:"spring",stiffness:400,damping:30},children:C.jsx(gS,{title:r.title,subtitle:r.subtitle,icon:r.icon,variant:r.variant,onClose:()=>wn.remove(r.id)})},r.id))})})})}const{color:Ba}=j,y5={top:"polygon(100% 0%, 50% 100%, 0% 0%)",bottom:"polygon(0% 100%, 50% 0%, 100% 100%)","top-start":"polygon(0% 0%, 0% 100%, 100% 0%)","top-end":"polygon(100% 0%, 100% 100%, 0% 0%)","bottom-start":"polygon(0% 100%, 0% 0%, 100% 100%)","bottom-end":"polygon(100% 100%, 100% 0%, 0% 100%)",left:"polygon(0% 100%, 100% 50%, 0% 0%)",right:"polygon(100% 100%, 0% 50%, 100% 0%)"},v5=10,x5=6,za=1,M0={primary:{backgroundColor:Ba.fill.bgPrimary,color:Ba.text.primary},inverse:{backgroundColor:Ba.fill.bgPrimaryInverse,color:Ba.text.primaryInverse}},b5=(e,t)=>(e==="top"||e==="bottom")&&t?`${e}-${t}`:e,w5=(e,t,n)=>n?(e==="top"||e==="bottom")&&t?{[e==="top"?t==="start"?"borderBottomLeftRadius":"borderBottomRightRadius":t==="start"?"borderTopLeftRadius":"borderTopRightRadius"]:0}:{}:{},C5=(e,t,n)=>e==="left"||e==="right"?{width:6,height:n}:t?{width:8,height:6}:{width:n,height:6},S5=(e,t,n)=>e?(t==="top"||t==="bottom")&&n?{x:n==="start"?0:void 0,y:e.y}:{x:e.x,y:e.y}:{x:void 0,y:void 0},{color:_5,cornerRadius:T5,spacing:E5}=j,R5=R.keyframes`
93
93
  from { opacity: 0; transform: translateY(2px); }
94
94
  to { opacity: 1; transform: translateY(0); }
95
- `,S5=R.css({boxShadow:`0 4px 20px 0 ${x5.effect.shadowM}`,animation:`${C5} 0.16s ease-out`,fontSize:"12px",lineHeight:"16px",fontWeight:"500",wordBreak:"break-word"}),_5=R.css({position:"absolute",clipPath:"var(--tooltip-arrow-shape)"}),lS=({color:e="primary",children:t,content:n,disabled:r=!1,initialOpen:o=!1,open:i,onChange:s,placement:a="top",trigger:l="hover",offset:c=5,showArrow:u=!0,openDelay:f=400,closeDelay:d=0,closeOnEsc:h=!0,zIndex:g=1,maxWidth:p,className:m,contentClassName:x,style:y,id:v,p:b=w5.md,borderRadius:w=b5.sm})=>{const[_,E]=S.useState(o),[T,k]=S.useState(null),P=i??_,O=s??E,D=S.useId(),I=v??`tooltip-${D}`,$=n==null||n==="",H=!r&&!$,U=S.useCallback(Xt=>{H&&O(Xt)},[H,O]),F=c+(u?g5:0),{context:N,refs:j,floatingStyles:K,middlewareData:te,placement:J}=ag({placement:a,open:H?P:!1,onOpenChange:U,whileElementsMounted:eg,middleware:[tg(F),rg({crossAxis:a.includes("-"),fallbackAxisSideDirection:a.includes("start")?"start":"end",padding:F}),ng({padding:F}),...u&&T?[wL({element:T,padding:0})]:[]]}),Z=te.arrow,se=J.split("-")[0],oe=J.includes("-")?J.split("-")[1]:null,fe=v5(Z,se,oe),_e=p5(se,oe),ne=m5(se,oe,u),ye=y5(se,oe,h5),Te=R.css({...ne,...R0[e]}),De=R.css({left:fe.x??void 0,top:fe.y??void 0,width:ye.width,height:ye.height,"--tooltip-arrow-shape":f5[_e],...se==="top"&&{bottom:-ye.height+Va},...se==="bottom"&&{top:-ye.height+Va},...se==="left"&&{right:-ye.width+Va},...se==="right"&&{left:-ye.width+Va},...oe==="end"&&(se==="top"||se==="bottom")&&{left:"auto",right:0},...R0[e]}),st=TC(N,{enabled:l==="hover"&&H,delay:{open:f,close:d},move:!1}),ee=OL(N,{enabled:l==="hover"&&H}),we=EC(N,{enabled:h&&H,escapeKey:!0}),ze=kC(N,{role:"tooltip"}),Ee=RC([st,ee,we,ze]),mt=t.ref,Lt=SC([j.setReference,mt]),Yt=S.useMemo(()=>S.cloneElement(t,Ee.getReferenceProps({...t.props,ref:Lt,"data-state":N.open?"open":"closed",...N.open?{"aria-describedby":I}:{}})),[t,Ee,N.open,I,Lt]);return C.jsxs(C.Fragment,{children:[Yt,H&&P&&C.jsx(Hi,{children:C.jsx(G,{absolute:!0,zIndex:g,className:m,ref:j.setFloating,style:{...K,...y},...Ee.getFloatingProps({id:I}),children:C.jsxs(G,{relative:!0,maxWidth:p,p:b,borderRadius:w,className:R.cx(S5,Te,x),children:[u&&C.jsx(G,{ref:k,className:R.cx(_5,De)}),typeof n=="string"?C.jsx(ae,{colorName:e,variant:"caption-1",fontWeight:"medium",children:n}):n]})})})]})};lS.displayName="Tooltip";const T5="_themeProviderScoped_8xy1z_9",E5={themeProviderScoped:T5};function R5({className:e,children:t,theme:n,position:r="top-right"}){const o=S.useRef(null);return C.jsx(IC.Provider,{value:o,children:C.jsxs("div",{ref:o,className:bf(E5.themeProviderScoped,e),id:"theme-provider-scoped","data-theme":n,children:[t,C.jsx(aS,{position:r})]})})}exports.AnimatedText=p1;exports.Avatar=nS;exports.Badge=rS;exports.Box=G;exports.Breadcrumbs=PO;exports.Button=wi;exports.Checkbox=eh;exports.Hint=WO;exports.IconButton=dr;exports.Input=Ci;exports.LineChart=eS;exports.Loader=M0;exports.MARKDOWN_TEXT_EDITOR_LOCALE_KEY=x1;exports.MarkdownTextEditor=eF;exports.MarkdownToolbarAction=ie;exports.Modal=cc;exports.OtpInput=aC;exports.PieProgressChart=tS;exports.Popover=Nr;exports.Portal=Hi;exports.Radio=cC;exports.RadioGroup=uC;exports.Ripple=No;exports.SegmentControl=sF;exports.Select=cg;exports.Skeleton=iS;exports.Switch=NC;exports.Table=Wi;exports.Tabs=FC;exports.Tag=lg;exports.Text=ae;exports.ThemeProviderScoped=R5;exports.Toast=sS;exports.ToastContainer=aS;exports.Tooltip=lS;exports.UiKitLocaleProvider=Kk;exports.createColumnHelper=DC;exports.getFontWeightClass=v_;exports.getSizeClass=x_;exports.getStyleClass=vf;exports.theme=V;exports.toast=_r;exports.useControlled=Mo;exports.useToast=a5;
95
+ `,k5=R.css({boxShadow:`0 4px 20px 0 ${_5.effect.shadowM}`,animation:`${R5} 0.16s ease-out`,fontSize:"12px",lineHeight:"16px",fontWeight:"500",wordBreak:"break-word"}),A5=R.css({position:"absolute",clipPath:"var(--tooltip-arrow-shape)"}),mS=({color:e="primary",children:t,content:n,disabled:r=!1,initialOpen:o=!1,open:i,onChange:s,placement:a="top",trigger:l="hover",offset:c=5,showArrow:u=!0,openDelay:f=400,closeDelay:d=0,closeOnEsc:h=!0,zIndex:g=1,maxWidth:p,className:m,contentClassName:x,style:y,id:v,p:b=E5.md,borderRadius:w=T5.sm})=>{const[_,E]=S.useState(o),[T,k]=S.useState(null),P=i??_,O=s??E,D=S.useId(),I=v??`tooltip-${D}`,$=n==null||n==="",H=!r&&!$,U=S.useCallback(Xt=>{H&&O(Xt)},[H,O]),L=c+(u?x5:0),{context:N,refs:V,floatingStyles:K,middlewareData:te,placement:J}=ug({placement:a,open:H?P:!1,onOpenChange:U,whileElementsMounted:rg,middleware:[og(L),sg({crossAxis:a.includes("-"),fallbackAxisSideDirection:a.includes("start")?"start":"end",padding:L}),ig({padding:L}),...u&&T?[SF({element:T,padding:0})]:[]]}),Z=te.arrow,ae=J.split("-")[0],oe=J.includes("-")?J.split("-")[1]:null,fe=S5(Z,ae,oe),Te=b5(ae,oe),ne=w5(ae,oe,u),ve=C5(ae,oe,v5),Ee=R.css({...ne,...M0[e]}),De=R.css({left:fe.x??void 0,top:fe.y??void 0,width:ve.width,height:ve.height,"--tooltip-arrow-shape":y5[Te],...ae==="top"&&{bottom:-ve.height+za},...ae==="bottom"&&{top:-ve.height+za},...ae==="left"&&{right:-ve.width+za},...ae==="right"&&{left:-ve.width+za},...oe==="end"&&(ae==="top"||ae==="bottom")&&{left:"auto",right:0},...M0[e]}),st=LC(N,{enabled:l==="hover"&&H,delay:{open:f,close:d},move:!1}),ee=DF(N,{enabled:l==="hover"&&H}),Ce=FC(N,{enabled:h&&H,escapeKey:!0}),ze=OC(N,{role:"tooltip"}),Re=$C([st,ee,Ce,ze]),mt=t.ref,Ft=NC([V.setReference,mt]),Yt=S.useMemo(()=>S.cloneElement(t,Re.getReferenceProps({...t.props,ref:Ft,"data-state":N.open?"open":"closed",...N.open?{"aria-describedby":I}:{}})),[t,Re,N.open,I,Ft]);return C.jsxs(C.Fragment,{children:[Yt,H&&P&&C.jsx(Ki,{children:C.jsx(G,{absolute:!0,zIndex:g,className:m,ref:V.setFloating,style:{...K,...y},...Re.getFloatingProps({id:I}),children:C.jsxs(G,{relative:!0,maxWidth:p,p:b,borderRadius:w,className:R.cx(k5,Ee,x),children:[u&&C.jsx(G,{ref:k,className:R.cx(A5,De)}),typeof n=="string"?C.jsx(se,{colorName:e,variant:"caption-1",fontWeight:"medium",children:n}):n]})})})]})};mS.displayName="Tooltip";const M5="_themeProviderScoped_8xy1z_9",N5={themeProviderScoped:M5};function P5({className:e,children:t,theme:n,position:r="top-right"}){const o=S.useRef(null);return C.jsx(KC.Provider,{value:o,children:C.jsxs("div",{ref:o,className:Sf(N5.themeProviderScoped,e),id:"theme-provider-scoped","data-theme":n,children:[t,C.jsx(pS,{position:r})]})})}exports.AnimatedText=vb;exports.Avatar=uS;exports.Badge=dS;exports.Box=G;exports.Breadcrumbs=FO;exports.Button=Si;exports.Checkbox=rh;exports.Hint=UO;exports.IconButton=fr;exports.Input=_i;exports.LineChart=lS;exports.Loader=L0;exports.MARKDOWN_TEXT_EDITOR_LOCALE_KEY=wb;exports.MarkdownText=YO;exports.MarkdownTextEditor=nL;exports.MarkdownToolbarAction=ie;exports.Modal=hc;exports.OtpInput=pC;exports.PieProgressChart=cS;exports.Popover=Pr;exports.Portal=Ki;exports.Radio=yC;exports.RadioGroup=vC;exports.Ripple=Lo;exports.SegmentControl=lL;exports.Select=fg;exports.Skeleton=hS;exports.Switch=jC;exports.Table=Ui;exports.Tabs=BC;exports.Tag=dg;exports.Text=se;exports.ThemeProviderScoped=P5;exports.Toast=gS;exports.ToastContainer=pS;exports.Tooltip=mS;exports.UiKitLocaleProvider=Qk;exports.createColumnHelper=UC;exports.getFontWeightClass=E_;exports.getSizeClass=R_;exports.getStyleClass=wf;exports.theme=j;exports.toast=Tr;exports.useControlled=Po;exports.useToast=f5;
96
96
  //# sourceMappingURL=ui-kit.cjs.js.map