@equinor/stratus-ui 1.13.0 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("react");c=s(c,1);let l=require("react/jsx-runtime"),u=require("react-dom"),d=require("@tanstack/react-table"),f=require("@tanstack/react-virtual"),p=require("@tiptap/extension-color");p=s(p,1);let m=require("@tiptap/extension-highlight");m=s(m,1);let h=require("@tiptap/extension-subscript");h=s(h,1);let g=require("@tiptap/extension-superscript");g=s(g,1);let _=require("@tiptap/extension-table"),v=require("@tiptap/extension-table-cell");v=s(v,1);let y=require("@tiptap/extension-table-header");y=s(y,1);let b=require("@tiptap/extension-table-row");b=s(b,1);let x=require("@tiptap/extension-text-align");x=s(x,1);let S=require("@tiptap/extension-text-style"),C=require("@tiptap/core"),w=require("@tiptap/react"),T=require("@tiptap/starter-kit");T=s(T,1);let E=require("@popperjs/core"),D=require("date-fns");var O={primary:{main:`var(--stratus-primary)`,hover:`var(--stratus-primary-hover)`,hoverAlt:`var(--stratus-primary-hover-alt)`,highlight:`var(--stratus-primary-highlight)`,highlightHover:`var(--stratus-primary-highlight-hover)`,light:`var(--stratus-primary-light)`},secondary:{main:`var(--stratus-secondary)`,hover:`var(--stratus-secondary-hover)`,highlight:`var(--stratus-secondary-highlight)`,light:`var(--stratus-secondary-light)`},danger:{main:`var(--stratus-error)`,hover:`var(--stratus-error-hover)`,text:`var(--stratus-error-text)`,highlight:`var(--stratus-error-highlight)`},warning:{main:`var(--stratus-warning)`,hover:`var(--stratus-warning-hover)`,text:`var(--stratus-warning-text)`,highlight:`var(--stratus-warning-highlight)`},success:{main:`var(--stratus-success)`,hover:`var(--stratus-success-hover)`,text:`var(--stratus-success-text)`,highlight:`var(--stratus-success-highlight)`},text:{main:`var(--stratus-text-main)`,muted:`var(--stratus-text-muted)`,primary:`var(--stratus-text-primary)`,secondary:`var(--stratus-text-secondary)`,tertiary:`var(--stratus-text-tertiary)`,disabled:`var(--stratus-text-disabled)`,inverted:`var(--stratus-text-inverted)`,invertedAlt:`var(--stratus-text-inverted-alt)`},surface:{surface:`var(--stratus-surface)`,muted:`var(--stratus-surface-muted)`,canvas:`var(--stratus-surface-muted)`,raised:`var(--stratus-surface-raised)`,nav:`var(--stratus-bg-nav)`,popover:`var(--stratus-popover-bg)`,overlay:`var(--stratus-bg-overlay)`,lighten:`var(--stratus-bg-lighten)`},background:{main:`var(--stratus-surface-muted)`,nav:`var(--stratus-bg-nav)`,paper:`var(--stratus-surface-raised)`,popover:`var(--stratus-popover-bg)`,overlay:`var(--stratus-bg-overlay)`,lighten:`var(--stratus-bg-lighten)`},border:{light:`var(--stratus-border-light)`,divider:`var(--stratus-divider)`},table:{header:`var(--stratus-table-header-bg)`,headerActive:`var(--stratus-table-header-active-bg)`,headerHover:`var(--stratus-table-header-hover-bg)`,cell:`var(--stratus-table-cell-bg)`,cellActive:`var(--stratus-table-cell-active-bg)`,cellHover:`var(--stratus-table-row-hover-bg)`},disabled:{fill:`var(--stratus-disabled-fill)`,text:`var(--stratus-disabled-text)`,border:`var(--stratus-disabled-border)`}};function k(e,{as:t,disabled:n,type:r}){let i=t??e;return i===`button`?{Component:i,isButton:!0,rootProps:{disabled:n||void 0,type:r,"data-disabled":n?`true`:void 0}}:{Component:i,isButton:!1,rootProps:{"aria-disabled":n||void 0,"data-disabled":n?`true`:void 0}}}function A(...e){return e.filter(Boolean).join(` `)}var j={p:`padding`,pt:`paddingTop`,pr:`paddingRight`,pb:`paddingBottom`,pl:`paddingLeft`,px:`paddingInline`,py:`paddingBlock`,m:`margin`,mt:`marginTop`,mr:`marginRight`,mb:`marginBottom`,ml:`marginLeft`,mx:`marginInline`,my:`marginBlock`,w:`width`,minW:`minWidth`,maxW:`maxWidth`,h:`height`,minH:`minHeight`,maxH:`maxHeight`,bg:`backgroundColor`,rounded:`borderRadius`},M=new Set(`display.position.top.right.bottom.left.inset.zIndex.overflow.overflowX.overflowY.float.clear.visibility.boxSizing.flex.flexDirection.flexWrap.flexFlow.flexGrow.flexShrink.flexBasis.justifyContent.alignItems.alignSelf.alignContent.order.gap.rowGap.columnGap.grid.gridTemplate.gridTemplateColumns.gridTemplateRows.gridTemplateAreas.gridArea.gridColumn.gridRow.gridAutoFlow.gridAutoColumns.gridAutoRows.gridGap.gridRowGap.gridColumnGap.justifyItems.justifySelf.placeContent.placeItems.placeSelf.width.minWidth.maxWidth.height.minHeight.maxHeight.aspectRatio.margin.marginTop.marginRight.marginBottom.marginLeft.marginBlock.marginBlockStart.marginBlockEnd.marginInline.marginInlineStart.marginInlineEnd.padding.paddingTop.paddingRight.paddingBottom.paddingLeft.paddingBlock.paddingBlockStart.paddingBlockEnd.paddingInline.paddingInlineStart.paddingInlineEnd.border.borderTop.borderRight.borderBottom.borderLeft.borderWidth.borderStyle.borderColor.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomLeftRadius.borderBottomRightRadius.borderCollapse.borderSpacing.outline.outlineColor.outlineStyle.outlineWidth.outlineOffset.background.backgroundColor.backgroundImage.backgroundSize.backgroundPosition.backgroundRepeat.backgroundClip.backgroundOrigin.backgroundAttachment.color.opacity.font.fontFamily.fontSize.fontWeight.fontStyle.fontVariant.lineHeight.letterSpacing.textAlign.textDecoration.textTransform.textOverflow.textShadow.textIndent.whiteSpace.wordBreak.wordSpacing.wordWrap.overflowWrap.verticalAlign.transform.transformOrigin.transition.transitionProperty.transitionDuration.transitionTimingFunction.transitionDelay.animation.animationName.animationDuration.animationTimingFunction.animationDelay.animationIterationCount.animationDirection.animationFillMode.animationPlayState.boxShadow.filter.backdropFilter.mixBlendMode.clipPath.mask.cursor.pointerEvents.userSelect.resize.touchAction.scrollBehavior.scrollMargin.scrollPadding.scrollSnapType.scrollSnapAlign.tableLayout.listStyle.listStyleType.listStylePosition.listStyleImage.content.objectFit.objectPosition.isolation.contain.willChange.appearance.accentColor.caretColor`.split(`.`)),N=[0,4,8,16,32,64,128,256,512],P=new Set([`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`marginBlock`,`marginBlockStart`,`marginBlockEnd`,`marginInline`,`marginInlineStart`,`marginInlineEnd`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`paddingBlock`,`paddingBlockStart`,`paddingBlockEnd`,`paddingInline`,`paddingInlineStart`,`paddingInlineEnd`]),F=new Set([`gap`,`rowGap`,`columnGap`]);function I(e,t){if(typeof t!=`number`)return t;if(P.has(e)){let e=N[t];return e==null?`${t}px`:`${e}px`}return F.has(e)?`${t}px`:t}function L(e){let t={},n={...e};for(let[e,r]of Object.entries(j))e in n&&(r in n||(t[r]=I(r,n[e])),delete n[e]);for(let e of M)e in n&&(t[e]=I(e,n[e]),delete n[e]);if(`style`in n){let e=n.style;if(delete n.style,e&&typeof e==`object`)return{cssProps:{...e,...t},otherProps:n}}return{cssProps:t,otherProps:n}}function R(e){return c.forwardRef(e)}var z=48,B=R((e,t)=>{let{color:n,...r}=e,{cssProps:i,otherProps:a}=L(r),{as:o,className:s,size:c=48,style:u,thickness:d=4,value:f=0,variant:p=`indeterminate`,...m}=a,{Component:h,rootProps:g}=k(`span`,{as:o}),_=2*Math.PI*((z-d)/2),v=Math.max(0,Math.min(100,f)),y=p===`determinate`?{strokeDasharray:_.toFixed(3),strokeDashoffset:`${((100-v)/100*_).toFixed(3)}px`}:void 0,b={...u,...i,"--stratus-circular-progress-size":`${c}px`,...n?{"--stratus-circular-progress-color":n}:{}};return(0,l.jsx)(h,{ref:t,className:A(`stratus-circular-progress`,`stratus-circular-progress--${p}`,s),role:`progressbar`,"aria-valuenow":p===`determinate`?Math.round(v):void 0,"aria-valuemin":p===`determinate`?0:void 0,"aria-valuemax":p===`determinate`?100:void 0,style:b,...g,...m,children:(0,l.jsxs)(`svg`,{viewBox:`${z/2} ${z/2} ${z} ${z}`,"aria-hidden":!0,children:[(0,l.jsx)(`circle`,{className:`stratus-circular-progress__track`,cx:z,cy:z,r:(z-d)/2,fill:`none`,strokeWidth:d}),(0,l.jsx)(`circle`,{className:`stratus-circular-progress__indicator`,style:y,cx:z,cy:z,r:(z-d)/2,fill:`none`,strokeWidth:d,strokeLinecap:`round`})]})})});B.displayName=`CircularProgress`;var V=c.forwardRef(function({className:e,disabled:t=!1},n){let r=c.useRef(null),i=c.useCallback((e,n)=>{let i=r.current;if(!i||t)return;let a=i.getBoundingClientRect(),o=e-a.left,s=n-a.top,c=Math.max(a.width,a.height)*2,l=document.createElement(`span`);l.className=A(`stratus-ripple`),l.style.width=`${c}px`,l.style.height=`${c}px`,l.style.left=`${o}px`,l.style.top=`${s}px`,i.appendChild(l);let u=getComputedStyle(i).getPropertyValue(`--stratus-button-ripple-opacity`).trim()||`0.22`,d=l.animate([{transform:`translate(-50%, -50%) scale(0)`,opacity:u},{transform:`translate(-50%, -50%) scale(1)`,opacity:`0`}],{duration:520,easing:`ease-out`,fill:`forwards`});d.onfinish=()=>l.remove()},[t]),a=c.useCallback(()=>{let e=r.current;if(!e)return;let t=e.getBoundingClientRect();i(t.left+t.width/2,t.top+t.height/2)},[i]);return c.useImperativeHandle(n,()=>({triggerAt:i,triggerCenter:a}),[i,a]),(0,l.jsx)(`span`,{ref:r,"aria-hidden":!0,className:A(`stratus-button__ripples`,e)})}),H=R((e,t)=>{let{cssProps:n,otherProps:r}=L(e),{variant:i=`contained`,colorScheme:a=`primary`,size:o=`md`,compact:s=!1,fullWidth:u=!1,as:d,loading:f=!1,spinner:p,startAdornment:m,endAdornment:h,className:g,disabled:_,children:v,type:y=`button`,disableRipple:b=!1,iconSize:x,onPointerDown:S,onKeyDown:C,...w}=r,T=s?`sm`:o,E=(0,c.useRef)(null),D=!!(!v&&(m||h)),O=!!(_||f),j=e=>{S?.(e),!e.defaultPrevented&&(b||O||e.button===0&&E.current?.triggerAt(e.clientX,e.clientY))},M=e=>{C?.(e),!e.defaultPrevented&&(b||O||(e.key===`Enter`||e.key===` `)&&E.current?.triggerCenter())},{Component:N,rootProps:P}=k(`button`,{as:d,disabled:O,type:y}),F=A(`stratus-button`,`stratus-button--${i}`,`stratus-button--${a}`,`stratus-button--${T}`,u&&`stratus-button--fullWidth`,D&&`stratus-button--iconOnly`,f&&`stratus-button--loading`,g),I=p??(D?(0,l.jsx)(B,{size:x??24,color:`currentColor`}):(0,l.jsx)(`span`,{className:`stratus-button__spinner`,"aria-hidden":!0})),R=f&&D,z={...n};return(0,l.jsxs)(N,{ref:t,className:F,"aria-busy":f||void 0,style:z,...P,...w,onPointerDown:j,onKeyDown:M,children:[(0,l.jsx)(V,{ref:E,disabled:b||O}),f?I:null,m&&!R?(0,l.jsx)(`span`,{className:A(`stratus-button__startAdornment`),style:x?{fontSize:x,width:x,height:x}:void 0,children:m}):null,v?(0,l.jsx)(`span`,{className:A(`stratus-button__label`),children:v}):null,h&&!R?(0,l.jsx)(`span`,{className:A(`stratus-button__endAdornment`),style:x?{fontSize:x,width:x,height:x}:void 0,children:h}):null]})}),U=new Set([`default`,`primary`,`secondary`,`success`,`warning`,`danger`]),W=(0,c.forwardRef)(function(e,t){let{children:n,className:r,color:i=`inherit`,size:a,rotation:o=0,...s}=e,{cssProps:c,otherProps:u}=L(s),d=U.has(i),f=i!==`inherit`&&!d,p={...a==null?{}:{width:a,height:a},...c,...f?{color:i}:{},...o?{transform:`rotate(${o}deg)`}:{}};return(0,l.jsx)(`span`,{ref:t,className:A(`stratus-icon`,d&&`stratus-icon--${i}`,r),style:p,...u,children:n})});function G(e){let{name:t,width:n,height:r,svgPathData:i}=e,a=(0,c.memo)((0,c.forwardRef)(function(e,t){let{size:a,...o}=e;return(0,l.jsx)(W,{ref:t,size:a,...o,children:(0,l.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${n} ${r}`,fill:`currentColor`,children:(0,l.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:i})})})}));return a.displayName=t?t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace(`-`,``).replace(`_`,``)).replace(/^[a-z]/,e=>e.toUpperCase())+`Icon`:`SvgIcon`,a}var ee=G({name:`arrow_drop_down`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m7 9.5 5 5 5-5z`}),te=typeof window>`u`?c.useEffect:c.useLayoutEffect;function ne(e,t=!1){let[n,r]=(0,c.useState)(null);return te(()=>{r(t?null:e??document.body)},[e,t]),n}function re(e){return e.startsWith(`top`)?`top`:e.startsWith(`bottom`)?`bottom`:e.startsWith(`left`)?`left`:`right`}var ie=8;function ae(e,t,n){let r=re(n),i=0,a=0;switch(r){case`bottom`:i=e.bottom+ie;break;case`top`:i=e.top-t.height-ie;break;case`left`:a=e.left-t.width-ie;break;case`right`:a=e.right+ie}r===`top`||r===`bottom`?a=n.endsWith(`-start`)?e.left:n.endsWith(`-end`)?e.right-t.width:e.left+e.width/2-t.width/2:i=n.endsWith(`-start`)?e.top:n.endsWith(`-end`)?e.bottom-t.height:e.top+e.height/2-t.height/2;let o=document.documentElement.clientWidth,s=document.documentElement.clientHeight;return a=Math.max(4,Math.min(a,o-t.width-4)),i=Math.max(4,Math.min(i,s-t.height-4)),{top:i,left:a}}var K=(0,c.forwardRef)(({children:e,className:t,content:n,placement:r=`bottom`,trigger:i=[`click`,`hover`],open:a,defaultOpen:o=!1,arrow:s=!0,closeOnClickOutside:d=!0,tooltipRef:f,zIndex:p=1500,maxWidth:m=`300px`,fontSize:h=`0.75rem`,style:g,container:_,keepMounted:v=!1,disablePortal:y=!1,disabled:b=!1,onOpen:x,onClose:S,onClick:C,onMouseEnter:w,onMouseLeave:T,onContextMenu:E,onClickOutside:D,...O},k)=>{let[j,M]=(0,c.useState)(o),N=(0,c.useRef)(null),P=(0,c.useRef)(null),F=(0,c.useRef)(void 0),[I,L]=(0,c.useState)(null),R=a!==void 0,z=b?!1:R?a:j,B=(0,c.useRef)(z);(0,c.useEffect)(()=>{let e=B.current;B.current=z,b&&(clearTimeout(F.current),R||M(!1),e&&S?.(new MouseEvent(`click`,{bubbles:!0,cancelable:!0})))},[b,z,R,S]),(0,c.useEffect)(()=>()=>clearTimeout(F.current),[]);let V=(0,c.useMemo)(()=>Array.isArray(i)?i:[i],[i]),H={};for(let e of Object.keys(O))e.startsWith(`data-`)&&(H[e]=O[e]);let U=(0,c.useCallback)(e=>{b||(R||M(!0),x?.(e))},[b,R,x]),W=(0,c.useCallback)(e=>{R||M(!1),S?.(e)},[R,S]);(0,c.useImperativeHandle)(f,()=>({open:e=>{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0});U(e??t)},close:e=>{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0});W(e??t)}}));let G=(0,c.useCallback)(()=>{if(!N.current||!P.current)return;let e=N.current.getBoundingClientRect(),t=P.current.getBoundingClientRect(),n=ae(e,{width:t.width,height:t.height},r);L(n)},[r]);(0,c.useLayoutEffect)(()=>{z&&G()},[z,G,n]),(0,c.useEffect)(()=>{if(!z)return;let e=()=>G();return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[z,G]),(0,c.useEffect)(()=>{if(!z||!d||!V.includes(`click`)&&!V.includes(`contextMenu`))return;let e=e=>{let t=e.target;N.current?.contains(t)||P.current?.contains(t)||(W(e),D?.(!1,e))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[z,d,W,D]);let ee=(0,c.useCallback)(e=>{if(!V.includes(`click`))return;let t=!z;R||M(t),C?.(t,e),t?x?.(e):S?.(e)},[V,z,R,C,x,S]),te=(0,c.useCallback)(e=>{if(!V.includes(`contextMenu`))return;e.preventDefault();let t=!z;R||M(t),E?.(t,e),t?x?.(e):S?.(e)},[V,z,R,E,x,S]),ie=(0,c.useCallback)(e=>{V.includes(`hover`)&&(clearTimeout(F.current),U(e),w?.(!0,e))},[V,U,w]),K=(0,c.useCallback)(e=>{V.includes(`hover`)&&(F.current=setTimeout(()=>W(e),100),T?.(!1,e))},[V,W,T]),oe=(0,c.useCallback)(()=>{V.includes(`hover`)&&clearTimeout(F.current)},[V]),se=(0,c.useCallback)(e=>{V.includes(`hover`)&&(W(e),T?.(!1,e))},[V,W,T]),q={};b||(V.includes(`click`)&&(q.onClick=ee),V.includes(`contextMenu`)&&(q.onContextMenu=te),V.includes(`hover`)&&(q.onMouseEnter=ie,q.onMouseLeave=K));let ce=(0,c.useCallback)(e=>{N.current=e},[]),le=()=>typeof e==`string`?(0,l.jsx)(`span`,{ref:ce,...q,className:`stratus-tooltip-anchor`,style:b?{cursor:`default`}:void 0,children:e}):c.Children.map(e,e=>(0,c.isValidElement)(e)?(0,c.cloneElement)(e,{ref:ce,...q,style:{display:e.props?.display??`inline-block`,...b?{}:{cursor:`pointer`},...e.props?.style}}):e),ue=re(r),de=Array.isArray(m)?m[0]:m,fe=Array.isArray(h)?h[0]:h,pe=!b&&(z||v)?(0,l.jsxs)(`div`,{ref:e=>{P.current=e,typeof k==`function`?k(e):k&&(k.current=e)},className:A(`stratus-tooltip`,`stratus-tooltip--${ue}`,t),role:`tooltip`,"data-state":z?`open`:`closed`,style:{top:I?.top??-9999,left:I?.left??-9999,zIndex:typeof p==`string`?Number(p)||1500:p,display:z?void 0:`none`,...!z&&v?{visibility:`hidden`}:{}},onMouseEnter:oe,onMouseLeave:se,...H,children:[s&&(0,l.jsx)(`span`,{className:`stratus-tooltip__arrow`}),(0,l.jsx)(`div`,{className:`stratus-tooltip__content`,style:{"--stratus-tooltip-max-width":de,"--stratus-tooltip-font-size":fe,...g},children:n})]}):null,me=ne(_,y);return(0,l.jsxs)(l.Fragment,{children:[le(),pe&&(y?pe:me?(0,u.createPortal)(pe,me):null)]})});K.displayName=`Tooltip`;var oe=(0,c.forwardRef)(function(e,t){let{menu:n,contextMenu:r,trigger:i=[`click`],arrow:a=!1,className:o,style:s,...c}=e,u=r?Array.isArray(i)?[...i,`contextMenu`]:[i,`contextMenu`]:i;return(0,l.jsx)(K,{ref:t,content:(0,l.jsx)(`div`,{className:`stratus-dropdown-content`,children:n}),trigger:u,arrow:a,maxWidth:`fit-content`,style:s,className:A(`stratus-dropdown`,o),...c})}),se=(0,c.forwardRef)(function(e,t){let{orientation:n,color:r,size:i,...a}=e,{cssProps:o,otherProps:s}=L(a),{className:c,style:u,...d}=s,f=he()?.mode??`vertical`,p=n??(f===`horizontal`?`vertical`:`horizontal`),m={...u,...o};return r&&(p===`horizontal`?m.borderTopColor=r:m.borderLeftColor=r),i&&(p===`horizontal`?m.borderTopWidth=`${i}px`:m.borderLeftWidth=`${i}px`),(0,l.jsx)(`hr`,{ref:t,role:`separator`,"aria-orientation":p,className:A(`stratus-menu-divider`,`stratus-menu-divider--${p}`,c),style:m,...d})});se.displayName=`MenuDivider`;var q=R((e,t)=>{let n=(0,c.useId)(),r=(0,c.useRef)(null),{as:i,children:a,id:o,startAdornment:s,endAdornment:u,disabled:d=!1,clickable:f=!0,onClick:p,...m}=e,{cssProps:h,otherProps:g}=L(m),{className:_,style:v,...y}=g,b=he(),x=o??n,S=d||(b?.disabled??!1),C=b?.compact??!1,w=b?.isSelected(x)??!1,T=e=>{if(!(S||!f)&&(p?.({id:x,label:a},e),b)){b.toggleSelect(x,e,a);let t={menuItemId:x,selected:!b.isSelected(x),selectedIds:b.selectedIds,open:!1,openIds:b.openIds};b.onClick?.(t,e)}},E=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(e))},D=i??`li`,O=A(`stratus-menu-item`,C&&`stratus-menu-item--compact`,S&&`stratus-menu-item--disabled`,w&&`stratus-menu-item--selected`,!f&&`stratus-menu-item--not-clickable`,_),k={...v,...h};return(0,l.jsxs)(D,{ref:t,role:`menuitem`,tabIndex:S?void 0:0,"aria-disabled":S||void 0,className:O,style:k,onClick:T,onKeyDown:E,onPointerDown:e=>{S||!f||e.button===0&&r.current?.triggerAt(e.clientX,e.clientY)},...y,children:[f&&!S&&(0,l.jsx)(V,{ref:r}),s&&(0,l.jsx)(`span`,{className:`stratus-menu-item__start-adornment`,children:s}),(0,l.jsx)(`span`,{className:`stratus-menu-item__title`,children:a}),u&&(0,l.jsx)(`span`,{className:`stratus-menu-item__end-adornment`,children:u})]})}),ce=R((e,t)=>{let{as:n,children:r,title:i,...a}=e,{cssProps:o,otherProps:s}=L(a),{className:u,style:d,...f}=s,p=n??`li`,m=(0,c.useId)(),h=A(`stratus-menu-item-group`,u),g={...d,...o};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(p,{ref:t,role:`none`,id:m,className:h,style:g,...f,children:i}),r]})}),le=G({name:`chevron_down`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m7.41 8.295 4.59 4.58 4.59-4.58L18 9.705l-6 6-6-6z`}),ue=G({name:`chevron_right`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m8.295 16.59 4.58-4.59-4.58-4.59L9.705 6l6 6-6 6z`});function de(){return(0,l.jsx)(le,{size:16})}function fe(){return(0,l.jsx)(ue,{size:16})}var pe=(0,c.forwardRef)(function(e,t){let n=(0,c.useId)(),{title:r,children:i,id:a,startAdornment:o,arrow:s=!0,disabled:u=!1,onClick:d,...f}=e,{cssProps:p,otherProps:m}=L(f),{className:h,style:g,..._}=m,v=he(),y=a??n,b=u||(v?.disabled??!1),x=v?.compact??!1,S=(v?.mode??`vertical`)===`inline`,[C,w]=(0,c.useState)(!1),T=v?.isOpen(y)??C,E=(0,c.useRef)(null),D=(0,c.useRef)(null),[O,k]=(0,c.useState)(T?`auto`:0),j=(0,c.useRef)(!0);(0,c.useEffect)(()=>{if(!S)return;if(j.current){j.current=!1,T&&k(`auto`);return}let e=E.current;if(e){if(T){let t=e.scrollHeight;k(t);let n=()=>{k(`auto`),e.removeEventListener(`transitionend`,n)};e.addEventListener(`transitionend`,n)}else{let t=e.scrollHeight;k(t),e.offsetHeight,requestAnimationFrame(()=>k(0))}}},[T,S]),(0,c.useEffect)(()=>{if(S||!T)return;let e=e=>{let t=e.target;D.current?.contains(t)||E.current?.contains(t)||(v?v.toggleOpen(y,e,r):w(!1))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[S,T,v,y,r]);let M=e=>{if(b)return;let t={id:y,label:r,level:v?.level};d?.(t,e),v?v.toggleOpen(y,e,r):w(e=>!e)},N=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),M(e))},P=v?.triggersSubMenu??`click`,F=Array.isArray(P)?P.includes(`hover`):P===`hover`,I=e=>{!F||b||T||(v?v.toggleOpen(y,e,r):w(!0))},R=e=>{!F||b||!T||(v?v.toggleOpen(y,e,r):w(!1))},z=S?(0,l.jsx)(de,{}):(0,l.jsx)(fe,{});return(0,l.jsxs)(`li`,{ref:t,className:A(`stratus-submenu`,h),style:{...g,...p},onMouseEnter:S?void 0:I,onMouseLeave:S?void 0:R,..._,children:[(0,l.jsxs)(`div`,{ref:D,role:`menuitem`,tabIndex:b?void 0:0,"aria-haspopup":`true`,"aria-expanded":T,"aria-disabled":b||void 0,className:A(`stratus-submenu__trigger`,x&&`stratus-submenu__trigger--compact`,b&&`stratus-submenu__trigger--disabled`),onClick:M,onKeyDown:N,children:[o&&(0,l.jsx)(`span`,{className:`stratus-menu-item__start-adornment`,children:o}),(0,l.jsx)(`span`,{className:`stratus-submenu__trigger__title`,children:r}),s&&(0,l.jsx)(`span`,{className:A(`stratus-submenu__trigger__arrow`,S&&T&&`stratus-submenu__trigger__arrow--open`),children:z})]}),S?(0,l.jsx)(`div`,{ref:E,className:`stratus-submenu__inline-content`,style:{height:O},children:(0,l.jsx)(`ul`,{role:`menu`,className:`stratus-menu stratus-menu--inline`,children:i})}):T&&(0,l.jsx)(`div`,{ref:E,className:`stratus-submenu__popover`,children:(0,l.jsx)(`ul`,{role:`menu`,className:`stratus-menu`,children:i})})]})});pe.displayName=`SubMenu`;var me=pe,J=(0,c.createContext)(null);function he(){return(0,c.useContext)(J)}var ge=R((e,t)=>{let{as:n,children:r,mode:i=`vertical`,inlineCollapsed:a=!1,multiple:o=!1,selectable:s=!0,selectedIds:u,openIds:d,triggersSubMenu:f=`click`,compact:p=!1,disabled:m=!1,onClick:h,onSelect:g,onDeselect:_,onOpen:v,onClose:y,...b}=e,{cssProps:x,otherProps:S}=L(b),{className:C,style:w,...T}=S,E=he(),D=E?E.level+1:0,[O,k]=(0,c.useState)(u??[]),[j,M]=(0,c.useState)(d??[]),N=u??O,P=d??j;(0,c.useEffect)(()=>{u&&k(u)},[u]),(0,c.useEffect)(()=>{d&&M(d)},[d]);let F=(0,c.useCallback)(e=>N.includes(e),[N]),I=(0,c.useCallback)(e=>P.includes(e),[P]),R=(0,c.useCallback)((e,t,n)=>{if(!s)return;let r=N.includes(e),i;i=r?N.filter(t=>t!==e):o?[...N,e]:[e],u||k(i);let a={menuItemId:e,selected:!r,selectedIds:i,open:!1,openIds:P};r?_?.(a,t):g?.(a,t)},[s,N,o,u,P,g,_]),z=(0,c.useCallback)((e,t,n)=>{let r=P.includes(e),i;i=r?P.filter(t=>t!==e):[...P,e],d||M(i);let a={menuItemId:e,selected:!1,selectedIds:N,open:!r,openIds:i};r?y?.(a,t):v?.(a,t)},[P,d,N,v,y]),B={mode:a?`vertical`:i,compact:p,disabled:m,selectable:s,selectedIds:N,openIds:P,level:D,triggersSubMenu:f,isSelected:F,isOpen:I,toggleSelect:R,toggleOpen:z,onClick:h},V=n??`ul`,H=A(`stratus-menu`,`stratus-menu--${i}`,C),U={...w,...x};return(0,l.jsx)(J.Provider,{value:B,children:(0,l.jsx)(V,{ref:t,role:`menu`,className:H,style:U,...T,children:r})})}),_e=R((e,t)=>{let{as:n,options:r,selectedId:i,defaultSelectedId:a,menuButtonAriaLabel:o=`Select option`,onAction:s,onOptionChange:u,variant:d=`contained`,color:f=`primary`,compact:p=!1,fullWidth:m=!1,disabled:h=!1,...g}=e,_=(0,c.useRef)(null),v=r.find(e=>e.id===a)??r[0],[y,b]=(0,c.useState)(v?.id),x=i??y,S=r.find(e=>e.id===x)??r[0],C=S?.id,w=p?`sm`:void 0,T=r.length>0,E=T&&r.every(e=>e.disabled),D=ve,O=(e,t)=>{let n=r.find(t=>t.id===e.menuItemId);!n||n.disabled||(i===void 0&&b(n.id),u?.(n,t),_.current?.close(t))},k=e=>{!S||S.disabled||s?.(S,e)};return(0,l.jsxs)(D,{...g,ref:t,as:n,active:-1,variant:d,color:f,compact:p,fullWidth:m,disabled:h,children:[(0,l.jsx)(H,{onClick:k,disabled:h||!S||S.disabled,children:S?.label??`No options`}),(0,l.jsx)(oe,{tooltipRef:_,placement:`bottom-end`,menu:(0,l.jsx)(ge,{compact:p,selectedIds:C?[C]:[],onClick:O,children:r.map(e=>(0,l.jsx)(q,{id:e.id,disabled:e.disabled,children:e.label},e.id))}),children:(0,l.jsx)(H,{"aria-label":o,disabled:h||!T||E,variant:d,colorScheme:f,size:w,style:{paddingLeft:10,paddingRight:10},children:(0,l.jsx)(ee,{})})})]})}),ve=R((e,t)=>{let{cssProps:n,otherProps:r}=L(e),{children:i,className:a,style:o,active:s,defaultActive:u=0,color:d=`primary`,variant:f=`outlined`,variantActive:p=`contained`,orientation:m=`horizontal`,compact:h=!1,fullWidth:g=!1,disabled:_=!1,onChange:v,as:y,...b}=r,x=s!==void 0,[S,C]=(0,c.useState)(u),w=x?s:S,T=(e,t)=>{x||C(e),v?.({index:e},t)},E=A(`stratus-buttonGroup`,`stratus-buttonGroup--${m}`,`stratus-buttonGroup--${d}`,g&&`stratus-buttonGroup--fullWidth`,h&&`stratus-buttonGroup--compact`,_&&`stratus-buttonGroup--disabled`,a),D={...o,...n};return(0,l.jsx)(y??`div`,{ref:t,role:`group`,className:E,style:D,...b,children:c.Children.toArray(i).map((e,t)=>{if(!(0,c.isValidElement)(e))return e;let n=w===t,r=e;return(0,c.cloneElement)(r,{className:A(r.props.className,n&&`stratus-buttonGroup__item--active`),variant:n?p:f,colorScheme:d,size:h?`sm`:void 0,disabled:_||r.props.disabled,onClick:e=>{let n=r.props.onClick;n?.(e),T(t,e)}})})})}),ye=R((e,t)=>{let{cssProps:n,otherProps:r}=L(e),{as:i,className:a,gap:o,children:s,...c}=r,{Component:u,rootProps:d}=k(`div`,{as:i}),f=A(`stratus-box`,a),p={...n};return(0,l.jsx)(u,{ref:t,className:f,style:{gap:typeof o==`number`?`${o}px`:o,...p},...d,...c,children:s})}),be=new Set([`primary`,`secondary`,`success`,`warning`,`danger`,`disabled`,`inherit`]),xe={h1:`h1`,h1_bold:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`},Se=R((e,t)=>{let{cssProps:n,otherProps:r}=L(e),{as:i,className:a,style:o,variant:s=`p`,color:c,children:u,...d}=r,{Component:f,rootProps:p}=k(xe[s]??`p`,{as:i}),m=A(`stratus-typography`,s&&`stratus-typography--${s}`,c&&be.has(c)&&`stratus-typography--color-${c}`,a),h=c&&!be.has(c)?{color:c}:void 0,g={...o,...n,...h};return(0,l.jsx)(f,{ref:t,className:m,style:Object.keys(g).length>0?g:void 0,...p,...d,children:u})}),Ce=(0,d.tableFeatures)({columnResizingFeature:d.columnResizingFeature,columnSizingFeature:d.columnSizingFeature,columnVisibilityFeature:d.columnVisibilityFeature,rowExpandingFeature:d.rowExpandingFeature,rowSelectionFeature:d.rowSelectionFeature,rowSortingFeature:d.rowSortingFeature,expandedRowModel:(0,d.createExpandedRowModel)(),sortedRowModel:(0,d.createSortedRowModel)(),sortFns:d.sortFns});function we(e){let t={};for(let n of e)t[String(n)]=!0;return t}function Te(e,t){return e===!0?t.map(e=>e.id):Object.keys(e).filter(t=>e[t])}function Ee(e){let t={};for(let n of e)t[n.id]=n.desc?`desc`:`asc`;return t}var De={1:`0 1px 3px var(--stratus-shadow-ambient), 0 1px 2px var(--stratus-shadow-penumbra)`,2:`0 3px 6px var(--stratus-shadow-ambient), 0 2px 4px var(--stratus-shadow-penumbra)`,3:`0 10px 20px var(--stratus-shadow-ambient), 0 3px 6px var(--stratus-shadow-penumbra)`};function Oe(e,t,n){let r=[],i=0;for(let a=0;a<e;a+=1){let e=t(a),o=i+e;if((i<=n||r.length===0)&&r.push({index:a,start:i,end:o,size:e}),i=o,i>n&&r.length>0)break}return r}function ke(e,t){let{columns:n,data:r,rowId:i=`id`,childrenId:a=`children`,compact:o=!1,headerHeight:s,rowHeight:u,dynamicHeight:p=!1,sortable:m=!0,multiSort:h=!1,resizable:g=!0,expandable:_=!1,expandedRowKeys:v,defaultExpandedRowKeys:y,draggable:b=!1,selectable:x=!1,selectRowOnClick:S=!0,stripedRows:C=!1,disabled:w=!1,elevation:T=0,maxHeight:E,noDataValue:D,extraColumnsWidth:O,className:k,rowClassName:j,onRowClick:M,onColumnSort:N,onRowSelect:P,onDragEnd:F,onEndReached:I,onEndReachedThreshold:L=50,style:R}=e,z=(0,c.useRef)(null),B=(0,c.useRef)(null),[V,H]=(0,c.useState)(0),[U,W]=(0,c.useState)(0);(0,c.useEffect)(()=>{let e=z.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e)H(t.contentRect.width),W(t.contentRect.height)});return t.observe(e),()=>t.disconnect()},[]);let[G,ee]=(0,c.useState)([]),te=(0,c.useCallback)(e=>{w||ee(t=>{let n=typeof e==`function`?e(t):e;return N?.(Ee(n)),n})},[N,w]),[ne,re]=(0,c.useState)(()=>y?we(y):{}),ie=(0,c.useMemo)(()=>v===void 0?ne:we(v),[v,ne]),ae=(0,c.useCallback)(e=>{v===void 0&&re(t=>typeof e==`function`?e(t):e)},[v]),[K,oe]=(0,c.useState)(()=>e.defaultSelectedRowsIds?Object.fromEntries(e.defaultSelectedRowsIds.map(e=>[e,!0])):{}),[se,q]=(0,c.useState)(null),[ce,le]=(0,c.useState)(null),ue=(0,c.useCallback)((e,t)=>typeof e==`function`?Math.max(e(V,t),0):typeof e==`string`?e.endsWith(`%`)?Math.max(parseFloat(e)/100*V,0):parseFloat(e)||150:e,[V]),de=(0,c.useMemo)(()=>{let e=[];if(_){let t=O?O({totalWidth:V,column:{key:`__expandable__`},defaultWidth:48}):48;t>0&&e.push({id:`__expandable__`,size:t,minSize:t,maxSize:t,enableSorting:!1,enableResizing:!1,header:()=>null,cell:({row:e})=>e.getCanExpand()?(0,l.jsx)(`span`,{role:`button`,"aria-label":e.getIsExpanded()?`Collapse row`:`Expand row`,className:A(`stratus-table__expand-icon`,e.getIsExpanded()&&`stratus-table__expand-icon--open`),onClick:t=>{t.stopPropagation(),e.toggleExpanded()},children:`▶`}):null})}if(x){let t=O?O({totalWidth:V,column:{key:`__selectable__`},defaultWidth:48}):48;t>0&&e.push({id:`__selectable__`,size:t,minSize:t,maxSize:t,enableSorting:!1,enableResizing:!1,header:({table:e})=>(0,l.jsx)(`input`,{type:`checkbox`,checked:e.getIsAllRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()}),cell:({row:e})=>(0,l.jsx)(`input`,{type:`checkbox`,checked:e.getIsSelected(),onChange:t=>{e.toggleSelected(),P?.({rowIndex:e.index,rowData:e.original,selected:t.target.checked})},onClick:e=>e.stopPropagation()})})}if(b){let t=O?O({totalWidth:V,column:{key:`__draggable__`},defaultWidth:48}):48;t>0&&e.push({id:`__draggable__`,size:t,minSize:t,maxSize:t,enableSorting:!1,enableResizing:!1,header:()=>null,cell:()=>(0,l.jsx)(`span`,{"aria-label":`Drag row`,className:`stratus-table__drag-handle`,role:`img`})})}return n.forEach((t,n)=>{let r=t.key??t.dataKey,i=V>0?ue(t.width,t):150,a=t.sortable===void 0?m:t.sortable,o=t.resizable===void 0?g:t.resizable,s;if(typeof t.sortType==`function`){let e=t.sortType,n=t.dataKey;s=(r,i)=>e(r.original,i.original,n,t)}else t.sortType===`datetime`&&(s=(e,n)=>{let r=e.original[t.dataKey],i=n.original[t.dataKey];return new Date(r instanceof Date||typeof r==`string`||typeof r==`number`?r:0).getTime()-new Date(i instanceof Date||typeof i==`string`||typeof i==`number`?i:0).getTime()});e.push({id:r,accessorKey:t.dataKey,size:i,minSize:t.minWidth??50,enableSorting:a,enableResizing:o,sortFn:s??`auto`,header:t.headerRenderer?()=>t.headerRenderer({column:t,columnIndex:n}):()=>t.title??``,cell:t.cellRenderer?e=>t.cellRenderer({rowData:e.row.original,rowIndex:e.row.index,column:t,columnIndex:n,cellData:e.getValue()}):e=>{let t=e.getValue();return t==null?``:String(t)},meta:{_col:t,_colIndex:n}})}),e},[n,V,_,x,b,m,g,O,ue,P]),fe=(0,c.useCallback)(e=>String(e[i]),[i]),pe=(0,c.useCallback)(e=>{let t=e[a];return Array.isArray(t)?t:void 0},[a]),me=(0,d.useTable)({features:Ce,data:r,columns:de,state:{sorting:G,expanded:ie,rowSelection:K},getRowId:fe,getSubRows:_?pe:void 0,onSortingChange:te,onExpandedChange:ae,onRowSelectionChange:oe,enableSorting:m&&!w,enableMultiSort:h,enableSortingRemoval:!0,columnResizeMode:`onChange`,enableColumnResizing:g&&!w,enableRowSelection:x,enableExpanding:_}),J=Array.isArray(s)?s[0]:s,he=u??(o?32:48),ge=me.getRowModel().rows,_e=me.getHeaderGroups(),ve=me.getVisibleLeafColumns(),ye=!r.length,be=T?De[T]??De[1]:void 0,xe=(0,f.useVirtualizer)({count:ve.length,estimateSize:e=>ve[e]?.getSize()??150,getScrollElement:()=>B.current,horizontal:!0,overscan:3,initialRect:{width:V||800,height:U||he*10}}),Se=(0,f.useVirtualizer)({count:ge.length,estimateSize:()=>he,getScrollElement:()=>B.current,measureElement:p&&typeof window<`u`&&window.navigator.userAgent.indexOf(`Firefox`)===-1?e=>e?.getBoundingClientRect().height:void 0,overscan:5,initialRect:{width:V||800,height:U||he*10}}),ke=xe.getVirtualItems(),Ae=Se.getVirtualItems(),je=ke.length?ke:Oe(ve.length,e=>ve[e]?.getSize()??150,(V||800)+450),Me=Ae.length?Ae:Oe(ge.length,()=>he,he*15),Ne=je[0]?.start??0,Pe=je.length?Math.max(xe.getTotalSize()-(je[je.length-1]?.end??0),0):0,Fe=ve.map(e=>e.getSize()).join(`|`);(0,c.useEffect)(()=>{xe.measure()},[xe,Fe,U]),(0,c.useEffect)(()=>{Se.measure()},[Se,U]),(0,c.useImperativeHandle)(t,()=>({clearSortState:()=>{ee([]),N?.({})},setColumnSort:({columnKey:e,order:t})=>{let n=[{id:e,desc:t===`desc`}];ee(n),N?.(Ee(n))},setSelectedRows:e=>{oe(Object.fromEntries(e.map(e=>[e,!0])))},getTableRef:()=>({scrollToTop:e=>{B.current&&(B.current.scrollTop=e)},scrollToRow:e=>{Se.scrollToIndex(e,{align:`start`})},scrollToLeft:e=>{B.current&&(B.current.scrollLeft=e)},getDOMNode:()=>z.current,getExpandedState:()=>({expandedData:me.getExpandedRowModel().rows.map(e=>e.original)}),getExpandedRowKeys:()=>Te(me.state.expanded,me.getRowModel().rows),setExpandedRowKeys:e=>{v===void 0&&re(we(e))}})}),[me,Se,v,N]),(0,c.useEffect)(()=>{if(!I)return;let e=B.current;if(!e)return;let t=()=>{e.scrollTop+e.clientHeight>=e.scrollHeight-L&&I()};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[I,L]);let Ie=(0,c.useCallback)((e,t)=>{!b||w||(q(e.id),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.id))},[b,w]),Le=(0,c.useCallback)((e,t)=>{!b||w||(t.preventDefault(),t.dataTransfer.dropEffect=`move`,le(e.id))},[b,w]),Re=(0,c.useCallback)((e,t)=>{if(!b||w)return;t.preventDefault();let n=t.dataTransfer.getData(`text/plain`)||se;if(q(null),le(null),!n||n===e.id)return;let r=ge.findIndex(e=>e.id===n),i=ge.findIndex(t=>t.id===e.id);if(r<0||i<0)return;let a=ge.map(e=>e.original),[o]=a.splice(r,1);a.splice(i,0,o),F?.({oldIndex:r,newIndex:i,rowData:o,data:a})},[b,w,se,ge,F]),ze=(0,c.useCallback)(()=>{q(null),le(null)},[]);return(0,l.jsx)(`div`,{ref:z,className:A(`stratus-table-root`,k),style:{...R,...be?{boxShadow:be}:{}},children:(0,l.jsx)(`div`,{ref:B,className:`stratus-table-scroll`,style:{...U>0?{height:U}:{},...E===void 0?{}:{maxHeight:E}},children:(0,l.jsxs)(`table`,{className:A(`stratus-table`,`stratus-table--virtualized`,o?`stratus-table--compact`:void 0),style:{width:xe.getTotalSize()||`100%`},children:[(0,l.jsx)(`colgroup`,{children:me.getAllColumns().map(e=>(0,l.jsx)(`col`,{style:{width:e.getSize()}},e.id))}),(0,l.jsx)(`thead`,{className:`stratus-table__head--virtualized`,children:_e.map(e=>(0,l.jsxs)(`tr`,{className:`stratus-table__row--virtualized`,style:J?{height:J}:void 0,children:[Ne>0&&(0,l.jsx)(`th`,{"aria-hidden":`true`,className:`stratus-table__virtual-padding`,style:{width:Ne}}),je.map(t=>{let n=e.headers[t.index];if(!n)return null;let r=n.column.getCanSort(),i=n.column.getIsSorted(),a=n.column.columnDef.meta?._col;return(0,l.jsxs)(`th`,{"data-sortable":r||void 0,"data-sort-direction":i||void 0,className:a?.headerClassName,style:{display:`flex`,width:n.getSize(),...J?{height:J}:{}},onClick:r&&!w?n.column.getToggleSortingHandler():void 0,children:[n.isPlaceholder?null:(0,d.flexRender)(n.column.columnDef.header,n.getContext()),i&&(0,l.jsx)(`span`,{className:`stratus-table__sort-icon`,children:i===`asc`?`▲`:`▼`}),n.column.getCanResize()&&g&&(0,l.jsx)(`div`,{className:A(`stratus-table__resizer`,n.column.getIsResizing()&&`stratus-table__resizer--active`),onMouseDown:n.getResizeHandler(),onTouchStart:n.getResizeHandler()})]},n.id)}),Pe>0&&(0,l.jsx)(`th`,{"aria-hidden":`true`,className:`stratus-table__virtual-padding`,style:{width:Pe}})]},e.id))}),(0,l.jsx)(`tbody`,{className:`stratus-table__body--virtualized`,style:{height:ye?void 0:Se.getTotalSize()},children:ye?(0,l.jsx)(`tr`,{className:`stratus-table__row--virtualized`,children:(0,l.jsx)(`td`,{colSpan:Math.max(ve.length,1),className:`stratus-table__cell--virtualized`,style:{width:xe.getTotalSize()},children:(0,l.jsx)(`div`,{className:`stratus-table__empty`,children:D})})}):Me.map(e=>{let t=ge[e.index];if(!t)return null;let n=e.index,r=t.original,i=fe(r),a=``;typeof j==`function`?a=j({rowData:r,rowIndex:n}):typeof j==`string`&&(a=j);let o=C&&n%2==1,s=t.getIsSelected(),c=!!M,u=b&&ce===t.id;return(0,l.jsxs)(`tr`,{"data-index":e.index,ref:p?Se.measureElement:void 0,className:A(`stratus-table__row--virtualized`,a||void 0,b&&`stratus-table__row--draggable`,se===t.id&&`stratus-table__row--dragging`,u&&`stratus-table__row--drag-over`),draggable:b&&!w,"data-clickable":c||void 0,"data-selected":s||void 0,"data-striped":o||void 0,style:{transform:`translateY(${e.start}px)`,...p?{}:{height:he}},onDragStart:e=>Ie(t,e),onDragOver:e=>Le(t,e),onDrop:e=>Re(t,e),onDragEnd:ze,onClick:w?void 0:e=>{S&&x&&(t.toggleSelected(),P?.({rowIndex:t.index,rowData:r,selected:!t.getIsSelected()})),M?.({rowKey:i,rowIndex:t.index,rowData:r,event:e})},children:[Ne>0&&(0,l.jsx)(`td`,{"aria-hidden":`true`,className:`stratus-table__virtual-padding`,style:{width:Ne}}),je.map(e=>{let i=t.getVisibleCells()[e.index];if(!i)return null;let a=i.column.columnDef.meta?._col,o=``;return a?.className&&(o=typeof a.className==`function`?a.className({rowData:r,rowIndex:n,column:a}):a.className),(0,l.jsx)(`td`,{className:A(`stratus-table__cell--virtualized`,o||void 0),style:{width:i.column.getSize()},children:(0,d.flexRender)(i.column.columnDef.cell,i.getContext())},i.id)}),Pe>0&&(0,l.jsx)(`td`,{"aria-hidden":`true`,className:`stratus-table__virtual-padding`,style:{width:Pe}})]},t.id)})})]})})})}var Ae=(0,c.forwardRef)(ke);Ae.displayName=`Table`;var je=G({name:`check_circle_outlined`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-2-5.83 6.59-6.59L18 9l-8 8-4-4 1.41-1.41z`}),Me=G({name:`close`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),Ne=G({name:`error_filled`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 15v-2h2v2zm0-10v6h2V7z`}),Pe=G({name:`info_circle`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12.01 22C17.53 22 22 17.52 22 12S17.53 2 12.01 2C6.48 2 2 6.48 2 12s4.48 10 10.01 10M13 9V7h-2v2zm0 8v-6h-2v6zm7-5c0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8 8-3.58 8-8`}),Fe=G({name:`warning_filled`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m23 21.5-11-19-11 19zm-12-3v-2h2v2zm0-4h2v-4h-2z`}),Ie=20,Le={info:()=>(0,l.jsx)(Pe,{size:Ie}),success:()=>(0,l.jsx)(je,{size:Ie}),warning:()=>(0,l.jsx)(Fe,{size:Ie}),error:()=>(0,l.jsx)(Ne,{size:Ie})},Re=(0,c.forwardRef)(function(e,t){let{cssProps:n,otherProps:r}=L(e),{className:i,children:a,variant:o=`contained`,severity:s=`info`,title:c,showIcon:u=!1,icon:d,onClose:f,...p}=r,m=typeof f==`function`,h=a!=null,g=()=>{if(d)return d;let e=Le[s];return e?e():null},_=A(`stratus-alert`,`stratus-alert--${o}`,`stratus-alert--${s}`,i),v={...n};return(0,l.jsxs)(`div`,{ref:t,role:`alert`,className:_,style:v,...p,children:[(0,l.jsxs)(`div`,{className:`stratus-alert__header`,children:[u&&(0,l.jsx)(`span`,{className:`stratus-alert__icon`,children:g()}),(0,l.jsx)(`div`,{className:`stratus-alert__title`,children:c}),m&&(0,l.jsx)(`button`,{type:`button`,className:`stratus-alert__close-btn`,"aria-label":`Close`,onClick:f,children:(0,l.jsx)(Me,{size:18})})]}),h&&(0,l.jsx)(`div`,{className:`stratus-alert__message`,children:a})]})});Re.displayName=`Alert`;var ze=G({name:`chevron_up`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m7.41 15.705 4.59-4.58 4.59 4.58 1.41-1.41-6-6-6 6z`});function Be({id:e,header:t,headerLevel:n,headerItems:r,isExpanded:i,disabled:a,expandIconPosition:o,expandIcon:s,onToggle:c,headerClassName:u,chevronClassName:d,titleClassName:f}){let p=s??(i?(0,l.jsx)(ze,{size:16}):(0,l.jsx)(le,{size:16}));return(0,l.jsxs)(`div`,{id:e,className:A(`stratus-accordion__header`,u),role:`button`,tabIndex:a?void 0:0,"aria-expanded":i,"aria-disabled":a||void 0,onClick:c,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c(e))},children:[o===`left`&&(0,l.jsx)(`span`,{className:A(`stratus-accordion__chevron stratus-accordion__chevron--left`,d),children:p}),(0,l.jsxs)(`div`,{className:`stratus-accordion__header-content`,children:[(0,l.jsx)(n,{className:A(`stratus-accordion__title`,i&&`stratus-accordion__title--expanded`,f),children:t}),r]}),o===`right`&&(0,l.jsx)(`span`,{className:A(`stratus-accordion__chevron stratus-accordion__chevron--right`,d),children:p})]})}var Ve=(0,c.forwardRef)(function(e,t){let{cssProps:n,otherProps:r}=L(e),{className:i,children:a,style:o,header:s,headerLevel:u=`h2`,headerItems:d,defaultExpanded:f,expanded:p,expandIconPosition:m=`left`,expandIcon:h,disabled:g=!1,elevation:_=!1,square:v=!0,onChange:y,headerClassName:b,chevronClassName:x,titleClassName:S,collapseClassName:C,panelClassName:w,panelInnerClassName:T,...E}=r,D=(0,c.useId)(),O=typeof p==`boolean`,k=(0,c.useRef)(!0),[j,M]=(0,c.useState)(p??f??!1),N=!g&&(O?p:j),P=a!=null,F=(0,c.useRef)(N),[I,R]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(k.current){k.current=!1,F.current=N;return}let e=F.current;N?R(!1):e&&P&&R(!0),F.current=N},[P,N]);let z=e=>{if(g)return;let t=O?!p:!j;!t&&P&&R(!0),O||M(t),y?.(t,e)};return(0,l.jsxs)(`div`,{ref:t,className:A(`stratus-accordion`,_&&`stratus-accordion--elevation`,!v&&`stratus-accordion--rounded`,i),style:{...o,...n},...E,children:[(0,l.jsx)(Be,{id:D,header:s,headerLevel:u,headerItems:d,isExpanded:!!N,disabled:g,expandIconPosition:m,expandIcon:h,onToggle:z,headerClassName:b,chevronClassName:x,titleClassName:S}),(N||I)&&P&&(0,l.jsx)(`div`,{className:`stratus-accordion__divider`}),(0,l.jsx)(`div`,{className:A(`stratus-accordion__collapse`,N&&`stratus-accordion__collapse--expanded`,C),onTransitionEnd:e=>{e.propertyName===`grid-template-rows`&&!N&&R(!1)},children:(0,l.jsx)(`div`,{className:A(`stratus-accordion__panel`,w),role:`region`,"aria-labelledby":D,children:(0,l.jsx)(`div`,{className:A(`stratus-accordion__panel-inner`,T),children:a})})})]})});Ve.displayName=`Accordion`;var He=G({name:`menu`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M3 8V6h18v2zm0 5h18v-2H3zm0 5h18v-2H3z`}),Ue=G({name:`more_vertical`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-2 8c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2`}),We=1024,Ge=typeof window<`u`?window.innerWidth:We,Ke=0,qe=null,Je=new Set;function Ye(){qe===null&&(qe=requestAnimationFrame(()=>{qe=null;let e=window.innerWidth;if(e!==Ge){Ge=e;for(let e of Je)e()}}))}function Xe(e){return Je.add(e),Ke===0&&typeof window<`u`&&window.addEventListener(`resize`,Ye),Ke+=1,()=>{Je.delete(e),--Ke,Ke===0&&typeof window<`u`&&(window.removeEventListener(`resize`,Ye),qe!==null&&(cancelAnimationFrame(qe),qe=null))}}function Ze(){return Ge}function Qe(){return We}function $e(){return(0,c.useSyncExternalStore)(Xe,Ze,Qe)}function et({open:e,content:t,onClose:n}){return(0,l.jsxs)(l.Fragment,{children:[e&&(0,l.jsx)(`div`,{className:`stratus-appBar__drawer-backdrop`,onClick:n}),(0,l.jsx)(`div`,{className:A(`stratus-appBar__drawer`,e&&`stratus-appBar__drawer--open`),children:t})]})}var tt=(0,c.forwardRef)(function(e,t){let{header:n,content:r,smallScreenContent:i,smallScreenContentOpen:a,smallScreenContentOnOpen:o,smallScreenContentOnClose:s,actions:u,smallScreenActions:d,smallScreenSize:f=425,zIndex:p,...m}=e,{cssProps:h,otherProps:g}=L(m),{className:_,style:v,...y}=g,b=$e(),x=typeof window<`u`&&b<f,S=typeof a==`boolean`,[C,w]=(0,c.useState)(!1),T=S?a:C,E=i??r,D=d??u,O=e=>{S||w(!0),o?.(e)},k=e=>{S||w(!1),s?.(e)},[j,M]=(0,c.useState)(!1),N=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!j)return;let e=e=>{N.current&&!N.current.contains(e.target)&&M(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[j]);let P={...v,...h,...p==null?{}:{zIndex:Number(p)}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`header`,{ref:t,className:A(`stratus-appBar`,_),style:P,...y,children:[(0,l.jsx)(`div`,{className:`stratus-appBar__header`,children:n}),!x&&r&&(0,l.jsx)(`div`,{className:`stratus-appBar__content`,children:r}),(0,l.jsxs)(`div`,{className:`stratus-appBar__actions`,children:[!x&&u,x&&(0,l.jsxs)(`div`,{className:`stratus-appBar__sm-actions`,children:[E&&(0,l.jsx)(`button`,{type:`button`,className:`stratus-appBar__menu-btn`,"aria-label":`Toggle AppBar menu content`,onClick:O,children:(0,l.jsx)(He,{size:24})}),D&&(0,l.jsxs)(`div`,{className:`stratus-appBar__popover-anchor`,ref:N,children:[(0,l.jsx)(`button`,{type:`button`,className:`stratus-appBar__menu-btn`,"aria-label":`Toggle AppBar menu actions`,onClick:()=>M(e=>!e),children:(0,l.jsx)(Ue,{size:24})}),j&&(0,l.jsx)(`div`,{className:`stratus-appBar__popover`,children:D})]})]})]})]}),x&&E&&(0,l.jsx)(et,{open:!!T,content:E,onClose:k})]})});tt.displayName=`AppBar`;var nt=(0,c.forwardRef)(function(e,t){let{children:n,content:r,variant:i=`default`,alignment:a=`top-right`,visible:o=!0,max:s=99,overlap:c,backgroundColor:u,color:d,bg:f,border:p,zIndex:m,display:h,...g}=e,{cssProps:_,otherProps:v}=L(g),{className:y,style:b,title:x,...S}=v,C=i===`dot`?null:typeof r==`number`&&r>s?`${s}+`:r,w={},T=u??f;T&&(w.backgroundColor=T),d&&(w.color=d),p&&(w.border=p),m!=null&&(w.zIndex=Number(m)),h!=null&&(w.display=h);let E=A(`stratus-badge-container`,y),D={...b,..._};return(0,l.jsxs)(`div`,{ref:t,className:E,style:D,...S,children:[n,o&&(0,l.jsx)(`span`,{className:A(`stratus-badge`,i===`dot`&&`stratus-badge--dot`,`stratus-badge--${a}`,c===`circle`&&`stratus-badge--overlap-circle`),style:w,title:x,children:C})]})});nt.displayName=`Badge`;var rt=R((e,t)=>{let{as:n,children:r,disableRipple:i=!1,...a}=e,{cssProps:o,otherProps:s}=L(a),{className:c,style:u,...d}=s,f=n??`div`,p={...u,...o};return(0,l.jsxs)(f,{ref:t,role:`button`,tabIndex:0,className:A(`stratus-card__action-area`,c),style:p,...d,children:[r,!i&&(0,l.jsx)(V,{})]})}),it=R((e,t)=>{let{as:n,children:r,...i}=e,{cssProps:a,otherProps:o}=L(i),{className:s,style:c,...u}=o,d=n??`div`,f={...c,...a};return(0,l.jsx)(d,{ref:t,className:A(`stratus-card__actions`,s),style:f,...u,children:r})}),at=R((e,t)=>{let{as:n,children:r,...i}=e,{cssProps:a,otherProps:o}=L(i),{className:s,style:c,...u}=o,d=n??`div`,f={...c,...a};return(0,l.jsx)(d,{ref:t,className:A(`stratus-card__content`,s),style:f,...u,children:r})}),ot=R((e,t)=>{let{as:n,title:r,subtitle:i,startAdornment:a,endAdornment:o,children:s,...c}=e,{cssProps:u,otherProps:d}=L(c),{className:f,style:p,...m}=d,h=n??`div`,g={...p,...u};return(0,l.jsxs)(h,{ref:t,className:A(`stratus-card__header`,f),style:g,...m,children:[a&&(0,l.jsx)(`div`,{className:`stratus-card__header-start`,children:a}),(0,l.jsxs)(`div`,{className:`stratus-card__header-body`,children:[(0,l.jsx)(`span`,{className:`stratus-card__header-title`,children:r}),i&&(0,l.jsx)(`span`,{className:`stratus-card__header-subtitle`,children:i})]}),o&&(0,l.jsx)(`div`,{className:`stratus-card__header-end`,children:o}),s]})}),st=R((e,t)=>{let{as:n,children:r,src:i,...a}=e,{cssProps:o,otherProps:s}=L(a),{className:c,style:u,...d}=s,f=n??`div`,p={...u,...o};return i&&(p.backgroundImage=`url(${i})`),(0,l.jsx)(f,{ref:t,className:A(`stratus-card__media`,c),style:p,...d,children:r})}),ct=R((e,t)=>{let{as:n,children:r,elevation:i=2,square:a=!1,...o}=e,{cssProps:s,otherProps:c}=L(o),{className:u,style:d,...f}=c,p=n??`div`,m=A(`stratus-card`,i===0?`stratus-card--elevation-0`:`stratus-card--elevation-${i}`,a&&`stratus-card--square`,u),h={...d,...s};return(0,l.jsx)(p,{ref:t,className:m,style:h,...f,children:r})});function lt({disabled:e,onClose:t}){return(0,l.jsx)(`button`,{type:`button`,"aria-label":`Close chip`,className:`stratus-chip__close`,disabled:e,onClick:n=>{n.preventDefault(),n.stopPropagation(),!e&&t&&t(n)},children:(0,l.jsx)(Me,{size:14})})}var ut=(0,c.forwardRef)(function(e,t){let{children:n,variant:r=`default`,startAdornment:i,endAdornment:a,closable:o=!1,disabled:s=!1,disableRipple:u=!1,onClose:d,onClick:f,...p}=e,{cssProps:m,otherProps:h}=L(p),{className:g,style:_,...v}=h,y=typeof f==`function`&&!s,b=(0,c.useRef)(null),x=e=>{e.defaultPrevented||!y||u||e.button===0&&b.current?.triggerAt(e.clientX,e.clientY)},S=e=>{!s&&f&&f(e)},C=A(`stratus-chip`,`stratus-chip--${r}`,y&&`stratus-chip--clickable`,s&&`stratus-chip--disabled`,g),w={..._,...m};return(0,l.jsxs)(`div`,{ref:t,"aria-disabled":s||void 0,className:C,style:w,tabIndex:y?0:void 0,onClick:y?S:void 0,onPointerDown:y?x:void 0,onKeyDown:y?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),S(e))}:void 0,...v,children:[y&&!u&&(0,l.jsx)(V,{ref:b}),i&&(0,l.jsx)(`span`,{className:`stratus-chip__adornment stratus-chip__adornment--start`,children:i}),(0,l.jsx)(`span`,{className:`stratus-chip__text`,children:n}),a&&(0,l.jsx)(`span`,{className:`stratus-chip__adornment stratus-chip__adornment--end`,children:a}),o&&(0,l.jsx)(lt,{disabled:s,onClose:d})]})});ut.displayName=`Chip`;var dt=R((e,t)=>{let{color:n,...r}=e,{cssProps:i,otherProps:a}=L(r),{as:o,className:s,size:c=32,style:u,...d}=a,{Component:f,rootProps:p}=k(`span`,{as:o}),m={...u,...i,...n?{"--stratus-dots-progress-color":n}:{}};return(0,l.jsx)(f,{ref:t,className:A(`stratus-dots-progress`,s),role:`status`,"aria-label":`Loading`,style:m,...p,...d,children:(0,l.jsxs)(`svg`,{viewBox:`0 0 16 4`,width:c,height:c/2,"aria-hidden":!0,children:[(0,l.jsx)(`circle`,{cx:2,cy:2,r:2,className:`stratus-dots-progress__dot`}),(0,l.jsx)(`circle`,{cx:8,cy:2,r:2,className:`stratus-dots-progress__dot stratus-dots-progress__dot--2`}),(0,l.jsx)(`circle`,{cx:14,cy:2,r:2,className:`stratus-dots-progress__dot stratus-dots-progress__dot--3`})]})})}),ft=R((e,t)=>{let{color:n,...r}=e,{cssProps:i,otherProps:a}=L(r),{as:o,className:s,size:c=4,style:u,value:d=0,variant:f=`indeterminate`,...p}=a,{Component:m,rootProps:h}=k(`span`,{as:o}),g=Math.max(0,Math.min(100,d)),_=f===`determinate`?{transform:`translateX(${g-100}%)`}:void 0,v={...u,...i,"--_stratus-linear-progress-value":`${c}px`,...n?{"--stratus-linear-progress-color":n}:{}};return(0,l.jsxs)(m,{ref:t,className:A(`stratus-linear-progress`,`stratus-linear-progress--${f}`,s),role:`progressbar`,"aria-valuenow":f===`determinate`?Math.round(g):void 0,"aria-valuemin":f===`determinate`?0:void 0,"aria-valuemax":f===`determinate`?100:void 0,style:v,...h,...p,children:[(0,l.jsx)(`span`,{className:`stratus-linear-progress__bar stratus-linear-progress__bar--1`,style:_}),f===`indeterminate`&&(0,l.jsx)(`span`,{className:`stratus-linear-progress__bar stratus-linear-progress__bar--2`})]})}),pt=R((e,t)=>{let{as:n,orientation:r=`horizontal`,size:i=1,color:a,...o}=e,{cssProps:s,otherProps:c}=L(o),{className:u,style:d,...f}=c,p=n??`hr`,m=A(`stratus-divider`,`stratus-divider--${r}`,u),h={...d,...s,"--stratus-divider-size":`${i}px`,...a?{"--stratus-divider-color":a}:{}};return(0,l.jsx)(p,{ref:t,className:m,style:h,...f})});pt.displayName=`Divider`;var mt=0,ht=``;function gt(e){(0,c.useEffect)(()=>{if(!(!e||typeof document>`u`))return mt===0&&(ht=document.body.style.overflow,document.body.style.overflow=`hidden`),mt+=1,()=>{--mt,mt===0&&(document.body.style.overflow=ht)}},[e])}var _t=[`a[href]`,`area[href]`,`button:not([disabled])`,`input:not([disabled]):not([type='hidden'])`,`select:not([disabled])`,`textarea:not([disabled])`,`iframe`,`object`,`embed`,`[tabindex]:not([tabindex='-1'])`,`[contenteditable='true']`,`audio[controls]`,`video[controls]`,`details > summary`].join(`,`);function vt(e){return Array.from(e.querySelectorAll(_t)).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`&&(e.offsetWidth>0||e.offsetHeight>0||e.tagName===`IFRAME`))}function yt(e,t,{initialFocus:n=!0,restoreFocus:r=!0}={}){(0,c.useEffect)(()=>{if(!t)return;let i=e.current;if(!i)return;let a=document.activeElement;if(n){let e=vt(i)[0]??i;e===i&&!i.hasAttribute(`tabindex`)&&i.setAttribute(`tabindex`,`-1`),e.focus({preventScroll:!0})}let o=e=>{if(e.key!==`Tab`)return;let t=vt(i);if(t.length===0){e.preventDefault(),i.focus({preventScroll:!0});return}let n=t[0],r=t[t.length-1],a=document.activeElement;e.shiftKey?(a===n||!i.contains(a))&&(e.preventDefault(),r.focus({preventScroll:!0})):a===r&&(e.preventDefault(),n.focus({preventScroll:!0}))};return document.addEventListener(`keydown`,o,!0),()=>{document.removeEventListener(`keydown`,o,!0),r&&a?.isConnected&&a.focus({preventScroll:!0})}},[t,e,n,r])}var bt=G({name:`fullscreen`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M7 10H5V5h5v2H7zm-2 4h2v3h3v2H5zm12 3h-3v2h5v-5h-2zM14 7V5h5v5h-2V7z`}),xt=G({name:`fullscreen_exit`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M5 8h3V5h2v5H5zm3 8H5v-2h5v5H8zm6 3h2v-3h3v-2h-5zm2-14v3h3v2h-5V5z`});function St({header:e,headerId:t,hasStringHeader:n,closable:r,fullScreen:i,isFullscreen:a,isTemporary:o,onToggleFullscreen:s,onClose:c}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`stratus-drawer__header`,children:[(0,l.jsx)(`div`,{id:n?t:void 0,className:`stratus-drawer__header-inner`,children:e}),i&&o&&(0,l.jsx)(`button`,{type:`button`,"aria-label":a?`Exit fullscreen`:`Fullscreen`,className:`stratus-drawer__header-btn`,onClick:s,children:a?(0,l.jsx)(xt,{size:20}):(0,l.jsx)(bt,{size:20})}),r&&(0,l.jsx)(`button`,{type:`button`,"aria-label":`Close drawer`,className:`stratus-drawer__header-btn`,onClick:e=>c?.(e),children:(0,l.jsx)(Me,{size:20})})]}),(0,l.jsx)(`hr`,{className:`stratus-drawer__divider`})]})}var Ct=(0,c.forwardRef)(function(e,t){let{open:n=!1,variant:r=`temporary`,placement:i=`left`,smallScreenSize:a=425,header:o,closable:s=!1,fullScreen:d=!1,initialFullScreen:f=!1,keepMounted:p=!1,transitionDuration:m=225,hideBackdrop:h=!1,disablePortal:g=!1,children:_,onClose:v,width:y=240,...b}=e,{cssProps:x,otherProps:S}=L(b),{className:C,style:w,...T}=S,E=$e(),D=r===`responsive`?E<a?`temporary`:`permanent`:r,O=D===`temporary`,k=D===`persistent`,j=D===`permanent`,[M,N]=(0,c.useState)(f),P=(0,c.useCallback)(()=>N(e=>!e),[]),[F,I]=(0,c.useState)(n),[R,z]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(n)I(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>z(!0))});else{z(!1);let e=setTimeout(()=>{p||I(!1)},O||k?m:0);return()=>clearTimeout(e)}},[n,p,m,O,k]);let B=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!n||!O)return;let e=e=>{e.key===`Escape`&&v?.(e)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n,O,v]),yt(B,n&&O),gt(n&&O);let V=(0,c.useId)(),H=typeof o==`string`||typeof o==`number`,U=Array.isArray(y)?(E<a?y[0]:y[1])??y[0]:y,W=typeof U==`number`?`${U}px`:U,G=i===`left`||i===`right`,ee={"--stratus-drawer-duration":`${m}ms`,...G?{width:M?`100%`:W}:{},...w,...x},te=ne(void 0,g);if(!(j||F||p))return null;let re=o!=null||s||d?(0,l.jsx)(St,{header:o,headerId:V,hasStringHeader:H,closable:s,fullScreen:d,isFullscreen:M,isTemporary:O,onToggleFullscreen:P,onClose:v}):null,ie=(0,l.jsxs)(`div`,{ref:e=>{B.current=e,typeof t==`function`?t(e):t&&(t.current=e)},role:O?`dialog`:void 0,"aria-modal":O&&n?!0:void 0,"aria-labelledby":O&&H?V:void 0,tabIndex:O?-1:void 0,className:A(`stratus-drawer`,`stratus-drawer--${D}`,`stratus-drawer--${i}`,R&&n||j?`stratus-drawer--open`:`stratus-drawer--closed`,M&&`stratus-drawer--fullscreen`,C),style:ee,...T,children:[re,_]});if(j||k)return(0,l.jsx)(`div`,{className:`stratus-drawer-container`,children:ie});let ae=(0,l.jsxs)(l.Fragment,{children:[!h&&(0,l.jsx)(`div`,{className:A(`stratus-drawer-backdrop`,R&&n&&`stratus-drawer-backdrop--open`),style:{"--stratus-drawer-duration":`${m}ms`},onClick:e=>v?.(e),"aria-hidden":!0}),ie]});return g?ae:te?(0,u.createPortal)(ae,te):null});Ct.displayName=`Drawer`;var wt={info:()=>(0,l.jsx)(Pe,{size:20,color:`currentColor`}),success:()=>(0,l.jsx)(je,{size:20,color:`currentColor`}),warning:()=>(0,l.jsx)(Fe,{size:20,color:`currentColor`}),error:()=>(0,l.jsx)(Ne,{size:20,color:`currentColor`})};function Tt({severity:e,message:t,actions:n,onClose:r}){return(0,l.jsxs)(l.Fragment,{children:[e&&(0,l.jsx)(`span`,{className:`stratus-notification__icon`,children:wt[e]()}),(0,l.jsx)(`div`,{className:`stratus-notification__content`,children:t}),n&&(0,l.jsx)(`div`,{className:`stratus-notification__actions`,children:n}),r&&(0,l.jsx)(`button`,{type:`button`,className:`stratus-notification__close`,"aria-label":`Close notification`,onClick:r,children:(0,l.jsx)(Me,{size:16})})]})}var Et=(0,c.forwardRef)(function(e,t){let{open:n,message:r,actions:i,autoHide:a=!0,autoHideDuration:o=6e3,showAutoHideLoader:s=!0,closeOnClickOutside:d=!1,placement:f=`bottom-start`,disablePortal:p=!1,onClose:m,severity:h,children:g,..._}=e,{cssProps:v,otherProps:y}=L(_),{className:b,style:x,...S}=y,C=(0,c.useRef)(null),w=(0,c.useRef)(null),T=(0,c.useRef)(0),E=(0,c.useRef)(o),D=(0,c.useCallback)(()=>{w.current&&=(clearTimeout(w.current),null)},[]),O=(0,c.useRef)(m);(0,c.useEffect)(()=>{O.current=m},[m]);let k=(0,c.useCallback)(e=>{D(),E.current=e,T.current=Date.now(),w.current=setTimeout(()=>{O.current?.()},e)},[D]);(0,c.useEffect)(()=>(n&&a?k(o):D(),D),[n,a,o,k,D]);let[j,M]=(0,c.useState)(!1),N=()=>{!a||!w.current||(E.current=Math.max(0,E.current-(Date.now()-T.current)),D(),M(!0))},P=()=>{!a||!n||w.current||(k(E.current),M(!1))};(0,c.useEffect)(()=>{if(!n||!d)return;let e=e=>{C.current&&!C.current.contains(e.target)&&m?.()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n,d,m]);let F=ne(void 0,p);if(!n)return null;let I=(0,l.jsxs)(`div`,{ref:e=>{C.current=e,typeof t==`function`?t(e):t&&(t.current=e)},className:A(`stratus-notification`,h?`stratus-notification--${h}`:g?void 0:`stratus-notification--default`,b),style:{...x,...v},onMouseEnter:N,onMouseLeave:P,...S,children:[g??(0,l.jsx)(Tt,{severity:h,message:r,actions:i,onClose:m}),a&&s&&(0,l.jsx)(`div`,{className:`stratus-notification__progress-wrap`,children:(0,l.jsx)(`div`,{className:A(`stratus-notification__progress`,j&&`stratus-notification__progress--paused`),style:{animationDuration:`${o}ms`}})})]}),R=(0,l.jsx)(`div`,{className:A(`stratus-notification-container`,`stratus-notification-container--${f}`),children:I});return p?R:F?(0,u.createPortal)(R,F):null}),Dt=0,Ot=new Map;function kt(){let e=document.getElementById(`stratus-notifications`);return e||(e=document.createElement(`div`),e.id=`stratus-notifications`,document.body.appendChild(e)),e}function At(e){let t=Ot.get(e);t&&(t.cleanup(),t.container.remove(),Ot.delete(e));let n=document.getElementById(`stratus-notifications`);n&&n.children.length===0&&n.remove()}function jt(e,t){let n=e.key??`stratus-notif-${++Dt}`,r=e.placement??`bottom-start`,i=e.autoHideDuration??6e3,a=e.showAutoHideLoader??!0;At(n);let o=kt(),s=document.createElement(`div`);s.setAttribute(`data-notification-id`,n),s.style.position=`fixed`,s.style.zIndex=String(e.zIndex??1400),s.style.pointerEvents=`none`;let c=r.split(`-`),l=c[0],u=c[1];l===`top`?(s.style.top=`16px`,s.style.bottom=`auto`):(s.style.bottom=`16px`,s.style.top=`auto`),u===`start`?(s.style.left=`16px`,s.style.right=`auto`):u===`end`?(s.style.right=`16px`,s.style.left=`auto`):(s.style.left=`50%`,s.style.transform=`translateX(-50%)`),o.appendChild(s);let d=document.createElement(`div`);if(d.className=A(`stratus-notification`,t?`stratus-notification--${t}`:`stratus-notification--default`),d.style.pointerEvents=`auto`,e.maxWidth&&(d.style.maxWidth=typeof e.maxWidth==`number`?`${e.maxWidth}px`:e.maxWidth),t){let e=document.createElement(`span`);e.className=`stratus-notification__icon`,e.innerHTML=Mt(t),d.appendChild(e)}let f=document.createElement(`div`);f.className=`stratus-notification__content`,f.textContent=String(e.message??``),d.appendChild(f);let p=document.createElement(`button`);p.className=`stratus-notification__close`,p.type=`button`,p.setAttribute(`aria-label`,`Close notification`),p.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>`,p.addEventListener(`click`,()=>At(n)),d.appendChild(p);let m=null;if(a){let e=document.createElement(`div`);e.className=`stratus-notification__progress-wrap`,m=document.createElement(`div`),m.className=`stratus-notification__progress`,m.style.animationDuration=`${i}ms`,e.appendChild(m),d.appendChild(e)}s.appendChild(d);let h=Date.now(),g=i,_=null;function v(e){_&&clearTimeout(_),g=e,h=Date.now(),_=setTimeout(()=>At(n),e),m?.classList.remove(`stratus-notification__progress--paused`)}function y(){_&&(clearTimeout(_),_=null,g=Math.max(0,g-(Date.now()-h)),m?.classList.add(`stratus-notification__progress--paused`))}function b(){_||v(g)}d.addEventListener(`mouseenter`,y),d.addEventListener(`mouseleave`,b),v(i),Ot.set(n,{container:s,cleanup:()=>{_&&clearTimeout(_)}})}function Mt(e){switch(e){case`info`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>`;case`success`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>`;case`warning`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>`;case`error`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>`}}var Nt=Et;Nt.show=e=>jt(e),Nt.info=e=>jt(e,`info`),Nt.success=e=>jt(e,`success`),Nt.warning=e=>jt(e,`warning`),Nt.error=e=>jt(e,`error`),Nt.displayName=`Notification`;function Pt({footer:e,okText:t,cancelText:n,onOk:r,onCancel:i}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`hr`,{className:`stratus-modal__divider`}),(0,l.jsx)(`div`,{className:`stratus-modal__footer`,children:e??(0,l.jsxs)(l.Fragment,{children:[typeof i==`function`&&(0,l.jsx)(H,{variant:typeof r==`function`?`ghost`:`outlined`,onClick:i,children:n}),typeof r==`function`&&(0,l.jsx)(H,{variant:`contained`,onClick:r,children:t})]})})]})}function Ft(){return(0,l.jsx)(Me,{size:20})}var It=(0,c.forwardRef)(function(e,t){let{open:n,showClose:r=!0,closeIcon:i,title:a,footer:o,okText:s=`Ok`,cancelText:d=`Cancel`,fullScreen:f=!1,keepMounted:p=!1,disablePortal:m=!1,zIndex:h,backdropProps:g,onClose:_,onOk:v,onCancel:y,children:b,...x}=e,S=g?.closable??!1,C=g?.invisible??!1,{cssProps:w,otherProps:T}=L(x),{className:E,style:D,...O}=T,[k,j]=(0,c.useState)(n),[M,N]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(n)j(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>N(!0))});else{N(!1);let e=setTimeout(()=>{p||j(!1)},200);return()=>clearTimeout(e)}},[n,p]),(0,c.useEffect)(()=>{if(!n||!S)return;let e=e=>{e.key===`Escape`&&_?.(e)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n,S,_]),gt(n);let P=(0,c.useRef)(null);yt(P,n);let F=(0,c.useId)(),I=typeof a==`string`||typeof a==`number`,R=e=>{e.target===e.currentTarget&&(g?.onClick?.(e),S&&_?.(e))},z=ne(void 0,m);if(!(k||p))return null;let B=a!=null||r,V=o!=null||typeof v==`function`||typeof y==`function`,U={...D,...w},W=(0,l.jsx)(`div`,{className:A(`stratus-modal-backdrop`,M&&n&&`stratus-modal-backdrop--open`,C&&`stratus-modal-backdrop--invisible`),style:h!=null||g?.style?{...h!=null&&{"--stratus-modal-z":Number(h)},...g?.style}:void 0,onClick:R,"aria-hidden":!n,children:(0,l.jsx)(`div`,{ref:e=>{P.current=e,typeof t==`function`?t(e):t&&(t.current=e)},role:`dialog`,"aria-modal":!0,"aria-labelledby":I?F:void 0,tabIndex:-1,className:A(`stratus-modal`,f&&`stratus-modal--fullscreen`,E),style:U,...O,children:(0,l.jsxs)(`div`,{className:`stratus-modal__container`,children:[B&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`stratus-modal__header`,children:[a!=null&&(0,l.jsx)(`span`,{id:I?F:void 0,className:`stratus-modal__header-title`,children:a}),r&&(0,l.jsx)(H,{variant:`ghost`,"aria-label":`Close modal`,className:`stratus-modal__header-close`,onClick:e=>_?.(e),startAdornment:i??(0,l.jsx)(Ft,{})})]}),(0,l.jsx)(`hr`,{className:`stratus-modal__divider`})]}),(0,l.jsx)(`div`,{className:A(`stratus-modal__content`,f&&`stratus-modal__content--fullscreen`),children:(0,l.jsx)(`div`,{className:`stratus-modal__content-inner`,children:b})}),V&&(0,l.jsx)(Pt,{footer:o,okText:s,cancelText:d,onOk:v,onCancel:y})]})})});return m?W:z?(0,u.createPortal)(W,z):null});It.displayName=`Modal`;function Lt({size:e=48}){let t=e*1.2;return(0,l.jsxs)(`svg`,{className:`stratus-screen-loader__star-progress`,role:`progressbar`,"aria-label":`Loading`,"aria-valuetext":`Loading`,width:e,height:t,viewBox:`0 0 40 48`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,preserveAspectRatio:`xMidYMid meet`,style:e?{"--stratus-screen-loader-size":`${e}px`}:void 0,children:[(0,l.jsx)(`path`,{d:`M32.756 34.6798L29.482 36.5817C29.4139 36.6219 29.3295 36.6227 29.2606 36.5829L25.9476 34.7151C25.7975 34.6306 25.7967 34.4149 25.9456 34.3284L29.2397 32.4256C29.3077 32.3858 29.3914 32.3858 29.4603 32.4248L32.754 34.2931C32.9033 34.3784 32.9041 34.5929 32.756 34.6798Z`}),(0,l.jsx)(`path`,{d:`M25.9596 45.4706L22.6655 43.5867C22.5966 43.5469 22.554 43.4744 22.554 43.396V41.4289V39.5922C22.5519 39.4204 22.7381 39.3109 22.8878 39.397L26.1819 41.2981C26.25 41.3379 26.2926 41.4104 26.2934 41.4896V43.4268V45.2762C26.2947 45.4472 26.1085 45.5559 25.9596 45.4706Z`}),(0,l.jsx)(`path`,{d:`M12.3022 47.7037V44.9795V42.6544C12.3022 42.5495 12.3576 42.4515 12.4482 42.3986L14.1262 41.4062L16.8143 39.8188C17.0119 39.7019 17.2617 39.8442 17.2625 40.0739L17.2633 42.7627V45.1456C17.2633 45.251 17.2079 45.3486 17.1165 45.4015L12.7496 47.9587C12.552 48.0748 12.3031 47.9325 12.3022 47.7037Z`}),(0,l.jsx)(`path`,{d:`M0.221343 34.2106L6.76939 30.4056C6.90636 30.326 7.07449 30.3256 7.21227 30.4023L13.8378 34.1401C14.138 34.3095 14.14 34.7413 13.8415 34.9131L7.25492 38.7182C7.11795 38.7977 6.94941 38.7985 6.81204 38.7206L0.225854 34.9836C-0.0734986 34.8139 -0.075549 34.3833 0.221343 34.2106Z`}),(0,l.jsx)(`path`,{d:`M6.03876 9.125L16.9237 15.5151C17.1513 15.6484 17.2903 15.8912 17.2903 16.1549V28.8331C17.2903 29.4076 16.665 29.7647 16.1704 29.4728L5.28546 23.0264C5.05869 22.8919 4.92008 22.6479 4.9209 22.3855V9.76307C4.92254 9.1902 5.54503 8.83467 6.03876 9.125Z`}),(0,l.jsx)(`path`,{d:`M39.6262 1.07261V11.7603V19.3368C39.627 19.7178 39.4265 20.0709 39.0988 20.2644L31.4145 24.8195L23.3545 29.5964C22.6385 30.0192 21.7339 29.5029 21.7339 28.6717V10.3259C21.7339 9.94495 21.9356 9.5927 22.2641 9.39955L38.008 0.149533C38.7232 -0.270381 39.6241 0.24385 39.6262 1.07261Z`})]})}var Rt=R((e,t)=>{let{cssProps:n,otherProps:r}=L(e),{as:i,className:a,children:o,loader:s,sizeLoader:c,title:d,backdropInvisible:f=!1,container:p,disablePortal:m=!1,zIndex:h,style:g,..._}=r,{Component:v,rootProps:y}=k(`div`,{as:i}),b=ne(p,m),x={...g,...n,...h==null?{}:{"--stratus-screen-loader-z":String(h)}},S=(0,l.jsx)(v,{ref:t,className:A(`stratus-screen-loader`,f&&`stratus-screen-loader--invisible`,a),role:`status`,"aria-live":`polite`,"aria-busy":`true`,style:Object.keys(x).length?x:void 0,...y,..._,children:(0,l.jsxs)(`div`,{className:`stratus-screen-loader__content`,children:[s??(0,l.jsx)(Lt,{size:c}),d!=null&&(0,l.jsx)(Se,{className:`stratus-screen-loader__title`,variant:`h3`,as:`div`,children:d}),o!=null&&(0,l.jsx)(`div`,{className:`stratus-screen-loader__children`,children:o})]})});return m?S:b?(0,u.createPortal)(S,b):null});Rt.displayName=`ScreenLoader`;function zt(){return(0,l.jsx)(Me,{size:16})}var Bt=(0,c.forwardRef)(function(e,t){let{children:n,className:r,content:i,title:a,showClose:o=!1,closeIcon:s,footer:u,placement:d=`bottom`,trigger:f=`click`,open:p,arrow:m=!0,closeOnClickOutside:h=!0,tooltipRef:g,zIndex:_=1400,maxWidth:v=`300px`,style:y,keepMounted:b=!1,disablePortal:x=!1,onOpen:S,onClose:C}=e,w=(0,c.useRef)(null),T=g??w,E=a!=null||o,D=(0,l.jsxs)(`div`,{className:`stratus-popover__container`,children:[E&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`stratus-popover__header`,children:[a!=null&&(0,l.jsx)(`span`,{className:`stratus-popover__header-title`,children:a}),o&&(0,l.jsx)(H,{variant:`ghost`,"aria-label":`Close popover`,className:`stratus-popover__header-close`,onClick:()=>{T&&`current`in T&&T.current?.close()},children:s??(0,l.jsx)(zt,{})})]}),(0,l.jsx)(`hr`,{className:`stratus-popover__divider`})]}),(0,l.jsx)(`div`,{className:`stratus-popover__content`,children:i}),u!=null&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`hr`,{className:`stratus-popover__divider`}),(0,l.jsx)(`div`,{className:`stratus-popover__footer`,children:u})]})]});return(0,l.jsx)(K,{ref:t,className:A(`stratus-popover`,r),content:D,placement:d,trigger:f,open:p,arrow:m,closeOnClickOutside:h,tooltipRef:T,zIndex:_,maxWidth:v,fontSize:`1rem`,style:y,keepMounted:b,disablePortal:x,onOpen:S,onClose:C,children:n})});Bt.displayName=`Popover`;function Vt({helperText:e,helperIcon:t}){return e?(0,l.jsxs)(`div`,{className:`stratus-input__helper`,children:[t&&(0,l.jsx)(`span`,{className:`stratus-input__helper-icon`,children:t}),(0,l.jsx)(`span`,{children:e})]}):null}function Ht({label:e,meta:t,htmlFor:n}){return!e&&!t?null:(0,l.jsxs)(`div`,{className:`stratus-input__label-row`,children:[e&&(0,l.jsx)(`label`,{className:`stratus-input__label`,htmlFor:n,children:e}),t&&(0,l.jsx)(`span`,{className:`stratus-input__meta`,children:t})]})}var Ut=(0,c.forwardRef)(function(e,t){let{children:n,className:r,style:i,inputRef:a,inputProps:o={},type:s=`text`,variant:u=`default`,label:d,meta:f,helperText:p,helperIcon:m,value:h,defaultValue:g,placeholder:_,startAdornment:v,endAdornment:y,outlineWidth:b,multiple:x=!1,compact:S=!1,fullWidth:C=!1,forceFocus:w=!1,disabled:T=!1,onChange:E,onFocus:D,onBlur:O,...k}=e,{cssProps:j,otherProps:M}=L(k),N=(0,c.useId)(),P=o.id??N,[F,I]=(0,c.useState)(g??``),R=h!==void 0,z=R?h:F,B=(0,c.useRef)(null),V=(0,c.useCallback)(e=>{B.current=e,a&&(a.current=e)},[a]),H=e=>{let t=e.target.value;R||I(t),E?.(t,e)},U=e=>{D?.(String(z),e)},W=e=>{O?.(String(z),e)},G=A(`stratus-input`,`stratus-input--${u}`,S&&`stratus-input--compact`,C&&`stratus-input--full-width`,T&&`stratus-input--disabled`,w&&`stratus-input--force-focus`,r),ee={...b?{"--stratus-input-outline-w":b}:{},...i,...j},te=x?`textarea`:`input`;return(0,l.jsxs)(`div`,{ref:t,className:G,style:Object.keys(ee).length?ee:void 0,...M,children:[(0,l.jsx)(Ht,{label:d,meta:f,htmlFor:P}),(0,l.jsxs)(`div`,{className:`stratus-input__wrapper`,children:[v&&(0,l.jsx)(`span`,{className:`stratus-input__start-adornment`,children:v}),n??(0,l.jsx)(te,{...o,ref:V,id:P,type:x?void 0:s,className:A(`stratus-input__input`,x&&`stratus-input__input--textarea`,o.className),value:z,placeholder:_,disabled:T,onChange:H,onFocus:U,onBlur:W}),y&&(0,l.jsx)(`span`,{className:`stratus-input__end-adornment`,children:y})]}),(0,l.jsx)(Vt,{helperText:p,helperIcon:m})]})}),Wt=(0,c.forwardRef)(function(e,t){let{inputRef:n,inputProps:r={},defaultChecked:i=!1,checked:a,variant:o=`default`,label:s,labelPlacement:u=`right`,color:d=`primary`,compact:f=!1,disabled:p=!1,disableRipple:m=!1,onChange:h,...g}=e,{cssProps:_,otherProps:v}=L(g),{className:y,style:b,...x}=v,[S,C]=(0,c.useState)(i),w=a!==void 0,T=w?a:S,E=(0,c.useRef)(null),D=(0,c.useCallback)(e=>{E.current=e,n&&(n.current=e)},[n]),O=e=>{w||C(e.target.checked),h?.(e)},k=A(`stratus-switch`,o===`small`&&`stratus-switch--small`,`stratus-switch--${d}`,f&&`stratus-switch--compact`,p&&`stratus-switch--disabled`,m&&`stratus-switch--no-ripple`,y),j={...b,..._},M=s?(0,l.jsx)(`span`,{className:`stratus-switch__label`,children:s}):null;return(0,l.jsxs)(`label`,{ref:t,className:k,style:Object.keys(j).length?j:void 0,...x,children:[u===`left`&&M,(0,l.jsx)(`input`,{...r,ref:D,type:`checkbox`,role:`switch`,className:`stratus-switch__input`,checked:T,disabled:p,onChange:O}),(0,l.jsx)(`span`,{className:`stratus-switch__track-wrapper`,children:(0,l.jsx)(`span`,{className:`stratus-switch__track`,children:(0,l.jsx)(`span`,{className:`stratus-switch__thumb`})})}),u===`right`&&M]})});function Gt({size:e}){return(0,l.jsx)(`svg`,{className:`stratus-checkbox__icon stratus-checkbox__icon--unchecked`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`var(--stratus-surface, #fff)`,stroke:`currentColor`,strokeWidth:`2`})})}function Kt({size:e}){return(0,l.jsxs)(`svg`,{className:`stratus-checkbox__icon stratus-checkbox__icon--checked`,width:e,height:e,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`currentColor`}),(0,l.jsx)(`path`,{d:`M9 12l2 2 4-4`,stroke:`white`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function qt({size:e}){return(0,l.jsxs)(`svg`,{className:`stratus-checkbox__icon stratus-checkbox__icon--indeterminate`,width:e,height:e,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`currentColor`}),(0,l.jsx)(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`,stroke:`white`,strokeWidth:`2`,strokeLinecap:`round`})]})}var Jt=(0,c.forwardRef)(function(e,t){let{className:n,style:r,inputRef:i,inputProps:a={},defaultChecked:o=!1,checked:s,label:u,labelPlacement:d=`right`,color:f=`primary`,indeterminate:p=!1,uncheckedIcon:m,checkedIcon:h,indeterminateIcon:g,iconSize:_=24,compact:v=!1,disabled:y=!1,disableRipple:b=!1,onChange:x,...S}=e,{cssProps:C,otherProps:w}=L(S),[T,E]=(0,c.useState)(o),D=s!==void 0,O=D?s:T,k=(0,c.useRef)(null),j=(0,c.useCallback)(e=>{k.current=e,i&&(i.current=e)},[i]);(0,c.useEffect)(()=>{k.current&&(k.current.indeterminate=p)},[p]);let M=e=>{D||E(e.target.checked),x?.(e)},N=(0,c.useRef)(null),P=e=>{b||y||e.button===0&&N.current?.triggerAt(e.clientX,e.clientY)},F;F=p?g??(0,l.jsx)(qt,{size:_}):O?h??(0,l.jsx)(Kt,{size:_}):m??(0,l.jsx)(Gt,{size:_});let I=A(`stratus-checkbox`,`stratus-checkbox--${f}`,v&&`stratus-checkbox--compact`,y&&`stratus-checkbox--disabled`,b&&`stratus-checkbox--no-ripple`,n),R={...r,...C},z=u?(0,l.jsx)(`span`,{className:`stratus-checkbox__label`,children:u}):null;return(0,l.jsxs)(`label`,{ref:t,className:I,style:Object.keys(R).length?R:void 0,onPointerDown:P,...w,children:[d===`left`&&z,(0,l.jsx)(`input`,{...a,ref:j,type:`checkbox`,className:`stratus-checkbox__input`,checked:O,disabled:y,onChange:M,"data-indeterminate":p||void 0}),(0,l.jsxs)(`span`,{className:`stratus-checkbox__icon-wrapper`,children:[(0,l.jsx)(V,{ref:N,disabled:b||y}),F]}),d===`right`&&z]})});function Yt(){return(0,l.jsx)(`span`,{className:`stratus-select__chevron`,children:(0,l.jsx)(`svg`,{width:`10`,height:`5`,viewBox:`0 0 10 5`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M0 0l5 5 5-5z`})})})}function Xt({onClear:e,label:t=`Clear`}){return(0,l.jsx)(`button`,{type:`button`,className:`stratus-select__clear`,onClick:e,"aria-label":t,children:`✕`})}function Zt({helperText:e,helperIcon:t}){return e?(0,l.jsxs)(`div`,{className:`stratus-select__helper`,children:[t&&(0,l.jsx)(`span`,{className:`stratus-input__helper-icon`,children:t}),(0,l.jsx)(`span`,{children:e})]}):null}function Qt({label:e,meta:t,htmlFor:n}){return!e&&!t?null:(0,l.jsxs)(`div`,{className:`stratus-select__label-row`,children:[e&&(0,l.jsx)(`label`,{className:`stratus-select__label`,htmlFor:n,children:e}),t&&(0,l.jsx)(`span`,{className:`stratus-select__meta`,children:t})]})}function $t(e){return e==null||e===``?[]:Array.isArray(e)?e.filter(e=>e!==``&&e!=null):[e]}function en(e){let t=[];for(let n of e)n.type===`optgroup`&&n.options?t.push(...en(n.options)):t.push(n);return t}function tn(e){return String(e.value??e.label)}function nn(e){let t=[];return c.Children.forEach(e,e=>{if((0,c.isValidElement)(e)){if(e.type===`option`){let{value:n,disabled:r,children:i}=e.props;t.push({label:String(i??``),value:n===void 0?String(i??``):n,disabled:!!r})}else if(e.type===`optgroup`){let{label:n,disabled:r,children:i}=e.props;t.push({type:`optgroup`,label:String(n??``),disabled:!!r,options:nn(i)})}}}),t}function rn({tags:e,infield:t,selectedIds:n,allFlat:r,tagMaxCount:i,tagMaxCountPlaceholder:a,selectedLabel:o,onTagRemove:s}){if(e&&t){if(n.length===0)return null;let e=r.filter(e=>n.map(String).includes(String(tn(e))));if(i!==void 0&&e.length>i){let t=typeof a==`function`?a(e.length):a??`${e.length} selected`;return(0,l.jsx)(`div`,{className:`stratus-select__tags`,children:(0,l.jsx)(`span`,{className:`stratus-select__tag`,children:t})})}return(0,l.jsx)(`div`,{className:`stratus-select__tags`,children:e.map(e=>(0,l.jsxs)(`span`,{className:`stratus-select__tag`,children:[e.label,(0,l.jsx)(`button`,{type:`button`,className:`stratus-select__tag-close`,onClick:t=>s(tn(e),t),children:`✕`})]},tn(e)))})}if(t){let e=typeof o==`function`?o(n.length,r.length):`${n.length}/${r.length} ${o}`;return(0,l.jsx)(`span`,{className:`stratus-select__selected-label`,children:e})}return null}var an=(0,c.forwardRef)(function(e,t){let{children:n,className:r,style:i,selectRef:a,inputRef:o,options:s=[],value:d,defaultValue:f,inputValue:p,variant:m=`default`,label:h,meta:g,placeholder:_,helperText:v,helperIcon:y,startAdornment:b,endAdornment:x,allowClear:S=!0,clearLabel:C,multiple:w=!1,expandable:T=!1,infield:E=!0,tags:D=!1,tagMaxCount:O,tagMaxCountPlaceholder:k,selectedLabel:j=`Selected`,filterOption:M=!0,noOptionsText:N=`No Data`,hideDropdownWhenEmpty:P=!1,persistInputText:F=!1,compact:I=!1,fullWidth:R=!1,disablePortal:z=!1,disabled:B=!1,onSelect:V,onDeselect:H,onClear:U,onChange:W,itemGroupRenderer:G,itemRenderer:ee,...te}=e,{cssProps:re,otherProps:ie}=L(te),ae=(0,c.useId)(),[K,oe]=(0,c.useState)(!1),[se,q]=(0,c.useState)(()=>$t(f)),[ce,le]=(0,c.useState)(``),[ue,de]=(0,c.useState)(-1),[fe,pe]=(0,c.useState)(new Set),me=d!==void 0,J=me?$t(d):se,he=p===void 0?ce:p,ge=(0,c.useRef)(null),_e=(0,c.useRef)(null),ve=(0,c.useRef)(null),ye=(0,c.useRef)(null),[be,xe]=(0,c.useState)({}),Se=(0,c.useCallback)(e=>{ge.current=e,o&&(o.current=e)},[o]);(0,c.useImperativeHandle)(a,()=>({open:()=>{oe(!0),ge.current?.focus()},close:()=>oe(!1)}),[]),(0,c.useEffect)(()=>{if(!K)return;let e=e=>{let t=e.target,n=_e.current?.contains(t),r=ye.current?.contains(t);!n&&!r&&(oe(!1),le(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[K]),(0,c.useLayoutEffect)(()=>{if(!K||z)return;let e=()=>{let e=ve.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom-2,r=t.top-2,i=n<Math.min(256,r)&&r>n,a=Math.max(0,i?r:n);xe({position:`fixed`,left:t.left,width:t.width,maxHeight:Math.min(256,a),...i?{bottom:window.innerHeight-t.top+2}:{top:t.bottom+2}})};return e(),window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[K,z]);let Ce=(0,c.useMemo)(()=>nn(n),[n]),we=(0,c.useMemo)(()=>s.length>0?s:Ce,[s,Ce]),Te=(0,c.useMemo)(()=>en(we),[we]),Ee=(0,c.useCallback)(e=>!M||!he?!0:typeof M==`function`?M(e,he,J.map(String)):e.label.toLowerCase().includes(he.toLowerCase()),[M,he,J]),De=(0,c.useMemo)(()=>Te.filter(e=>!e.disabled&&Ee(e)),[Te,Ee]);(0,c.useEffect)(()=>{if(!K){de(-1);return}let e=De.findIndex(e=>J.map(String).includes(tn(e)));de(e)},[K]),(0,c.useEffect)(()=>{K&&de(e=>e>De.length-1?-1:e)},[De.length]),(0,c.useEffect)(()=>{if(ue<0||!ye.current)return;let e=De[ue];if(!e)return;let t=String(e.value??e.label);ye.current.querySelector(`[data-option-id="${CSS.escape(t)}"]`)?.scrollIntoView({block:`nearest`})},[ue,De]);let Oe=(0,c.useMemo)(()=>w||J.length===0?``:Te.find(e=>String(e.value??e.label)===String(J[0]))?.label??String(J[0]),[w,J,Te]),ke=(0,c.useCallback)((e,t)=>{let n=tn(e),r=J.map(String).includes(String(n)),i;if(w){if(r){i=J.filter(e=>String(e)!==String(n)),me||q(i);let r={selectedValue:i,deselectedValue:e.value??e.label,options:Te.filter(e=>i.map(String).includes(String(tn(e))))};H?.(r,t)}else{i=[...J,e.value??e.label],me||q(i);let n={selectedValue:i,options:Te.filter(e=>i.map(String).includes(String(tn(e))))};V?.(n,t)}}else{i=[e.value??e.label],me||q(i),oe(!1),le(``);let n={selectedValue:e.value??e.label,options:[e]};V?.(n,t)}},[J,w,me,Te,V,H]),Ae=(0,c.useCallback)(e=>{if(!B)switch(e.key){case`ArrowDown`:e.preventDefault(),K?de(e=>e<De.length-1?e+1:0):oe(!0);break;case`ArrowUp`:e.preventDefault(),K&&de(e=>e>0?e-1:De.length-1);break;case`Enter`:if(e.preventDefault(),K&&ue>=0){let t=De[ue];t&&ke(t,e)}else K||oe(!0);break;case`Escape`:K&&(e.preventDefault(),oe(!1))}},[B,K,ue,De,ke]),je=(0,c.useCallback)(e=>{e.stopPropagation(),me||q([]),le(``),U?.(e)},[me,U]),Me=(0,c.useCallback)((e,t)=>{t.stopPropagation();let n=Te.find(t=>String(tn(t))===String(e));n&&ke(n,t)},[Te,ke]),Ne=(0,c.useCallback)(e=>{pe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Pe=(0,c.useCallback)(e=>{if(!M)return;let t=e.target.value;le(t),W?.(t),K||oe(!0)},[M,K,W]);function Fe(e){let t=[];for(let n of e){if(n.type===`optgroup`&&n.options){let e=Fe(n.options).filter(Boolean);if(e.length===0)continue;let r=T&&fe.has(n.label);G?t.push(G(n,r?[]:e,he)):t.push((0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:A(`stratus-select__optgroup-label`,T&&`stratus-select__optgroup--expandable`),onClick:T?()=>Ne(n.label):void 0,children:[T&&(0,l.jsx)(`span`,{className:A(`stratus-select__optgroup-chevron`,r&&`stratus-select__optgroup-chevron--collapsed`),children:(0,l.jsx)(`svg`,{width:`10`,height:`5`,viewBox:`0 0 10 5`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M0 0l5 5 5-5z`})})}),n.label]}),!r&&e]},`group-${n.label}`));continue}if(!Ee(n))continue;let e=tn(n),r=J.map(String).includes(String(e)),i=De[ue]===n;ee?t.push((0,l.jsx)(`div`,{"data-option-id":e,className:A(i&&`stratus-select__option--highlighted`),onClick:n.disabled?void 0:e=>ke(n,e),children:ee(n,he,J.map(String))},e)):t.push((0,l.jsxs)(`div`,{"data-option-id":e,className:A(`stratus-select__option`,r&&`stratus-select__option--selected`,i&&`stratus-select__option--highlighted`,n.disabled&&`stratus-select__option--disabled`),onClick:n.disabled?void 0:e=>ke(n,e),children:[w&&(0,l.jsx)(`span`,{className:A(`stratus-select__checkbox`,r&&`stratus-select__checkbox--checked`,n.disabled&&`stratus-select__checkbox--disabled`),"aria-hidden":`true`,children:r&&(0,l.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`10`,height:`10`,children:(0,l.jsx)(`path`,{d:`M3 8.5l3 3 7-7`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),n.label]},e))}return t}let Ie=ne(void 0,z),Le=Fe(we),Re=Le.length>0,ze=K&&!(P&&!Re)?(0,l.jsx)(`div`,{ref:ye,className:A(`stratus-select__dropdown`,!z&&`stratus-select__dropdown--portal`),style:z?void 0:be,children:Re?Le:(0,l.jsx)(`div`,{className:`stratus-select__no-data`,children:N})}):null,Be=z?ze:ze&&Ie?(0,u.createPortal)(ze,Ie):null,Ve=A(`stratus-select`,`stratus-select--${m}`,I&&`stratus-select--compact`,R&&`stratus-select--full-width`,B&&`stratus-select--disabled`,K&&`stratus-select--open`,M&&`stratus-select--filterable`,r),He={...i,...re},Ue=J.length>0||he&&he.length>0;return(0,l.jsxs)(`div`,{ref:e=>{_e.current=e,typeof t==`function`?t(e):t&&(t.current=e)},className:Ve,style:Object.keys(He).length?He:void 0,...ie,children:[(0,l.jsx)(Qt,{label:h,meta:g,htmlFor:ae}),(0,l.jsxs)(`div`,{ref:ve,className:`stratus-select__input-wrapper`,onClick:()=>{B||(oe(e=>!e),ge.current?.focus())},onKeyDown:Ae,children:[b&&(0,l.jsx)(`span`,{className:`stratus-input__start-adornment`,children:b}),w&&D&&E&&J.length>0?(0,l.jsx)(rn,{tags:D,infield:E,selectedIds:J,allFlat:Te,tagMaxCount:O,tagMaxCountPlaceholder:k,selectedLabel:j,onTagRemove:Me}):null,w&&!D&&E?(0,l.jsx)(rn,{tags:D,infield:E,selectedIds:J,allFlat:Te,tagMaxCount:O,tagMaxCountPlaceholder:k,selectedLabel:j,onTagRemove:Me}):null,!(w&&D&&E&&J.length>0)&&!(w&&!D&&E)&&(0,l.jsx)(`input`,{ref:Se,id:ae,type:`text`,className:`stratus-select__input`,value:M&&he!==``&&(K||F)?he:Oe,placeholder:J.length>0?void 0:_,disabled:B,onChange:Pe,autoComplete:`off`}),x&&(0,l.jsx)(`span`,{className:`stratus-input__end-adornment`,children:x}),S&&Ue&&!B&&(0,l.jsx)(Xt,{onClear:je,label:C}),(0,l.jsx)(Yt,{})]}),Be,(0,l.jsx)(Zt,{helperText:v,helperIcon:y})]})}),on=new Set([`default`,`primary`,`secondary`,`success`,`warning`,`danger`,`disabled`]),sn=R((e,t)=>{let{as:n,color:r,underline:i=`hover`,...a}=e,{cssProps:o,otherProps:s}=L(a),{className:c,style:u,rel:d,target:f,...p}=s,m=n??`a`,h=r&&on.has(r),g=r&&!h,_=f&&m===`a`?Array.from(new Set([...String(d??``).split(/\s+/).filter(Boolean),`noreferrer`,`noopener`])).join(` `):d,v=A(`stratus-link`,h&&`stratus-link--${r}`,`stratus-link--underline-${i}`,c),y={...u,...o,...g?{color:r}:{}};return(0,l.jsx)(m,{ref:t,className:v,style:Object.keys(y).length?y:void 0,...p,target:f,rel:_})});sn.displayName=`Link`;var cn=(0,c.forwardRef)(function(e,t){let{className:n,style:r,label:i,icon:a,disabled:o=!1,disableRipple:s=!1,children:u,color:d,...f}=e,{cssProps:p,otherProps:m}=L(f),h=(0,c.useRef)(null),g=e=>{m.onPointerDown?.(e),!(e.defaultPrevented||o||s)&&e.button===0&&h.current?.triggerAt(e.clientX,e.clientY)},_={...r,...p};return(0,l.jsxs)(`button`,{ref:t,type:`button`,className:A(`stratus-tab`,n),style:Object.keys(_).length?_:void 0,disabled:o,"aria-disabled":o||void 0,...m,onPointerDown:g,children:[a,i,!o&&!s&&(0,l.jsx)(V,{ref:h})]})}),ln=new Set([`primary`,`secondary`,`success`,`warning`,`danger`]),un=(0,c.forwardRef)(function(e,t){let{className:n,style:r,tabsListAs:i=`div`,selectedTab:a,orientation:o=`horizontal`,textColor:s=`primary`,indicatorColor:u=`primary`,align:d=`flex-start`,fullWidth:f=!1,disabled:p=!1,onChange:m,children:h,...g}=e,{cssProps:_,otherProps:v}=L(g),y={...r,..._},b=ln.has(u),x=c.Children.toArray(h).map((e,t)=>{if(!(0,c.isValidElement)(e))return e;let n=e;return(0,c.cloneElement)(n,{className:A(n.props.className,t===a&&`stratus-tab--active`,s&&`stratus-tab--${s}`),color:s,disabled:p||n.props.disabled,onClick:e=>{m?.(t,e);let r=n.props.onClick;r?.(e)}})}),S=c.Children.toArray(h).map((e,t)=>{if(!(0,c.isValidElement)(e))return null;let n=e.props.children;if(!n)return null;let r=a!==t;return(0,l.jsx)(`div`,{className:A(`stratus-tabs__panel`,r&&`stratus-tabs__panel--hidden`),hidden:r,"aria-hidden":r,children:n},`stratus-tabs__panel--${t}`)}),C=S.some(Boolean);return(0,l.jsxs)(`div`,{className:A(`stratus-tabs-root`,`stratus-tabs-root--${o}`),children:[(0,l.jsx)(`div`,{ref:t,className:A(`stratus-tabs`,`stratus-tabs--${o}`,n),style:Object.keys(y).length?y:void 0,...v,children:(0,l.jsx)(`div`,{className:A(`stratus-tabs__container`,`stratus-tabs__container--${o}`),children:(0,l.jsx)(i,{className:A(`stratus-tabs__list`,`stratus-tabs__list--${o}`,f&&`stratus-tabs__list--fullwidth`,`stratus-tabs__indicator--${o}`,b&&`stratus-tabs__indicator--${u}`),style:{justifyContent:d},children:x})})}),C&&S]})}),dn=new Set([0,1,2,3,4,5,6,8,12,16,24]);function fn(e){let t=Math.round(e*.5),n=Math.round(e*.7),r=Math.round(e*-.2),i=e,a=Math.round(e*1.5),o=Math.round(e*.1),s=Math.round(e*1.8),c=Math.round(e*.35);return[`0px ${t}px ${n}px ${r}px rgba(0,0,0,0.2)`,`0px ${i}px ${a}px ${o}px rgba(0,0,0,0.14)`,`0px ${Math.round(e*.3)}px ${s}px ${c}px rgba(0,0,0,0.12)`].join(`,`)}var pn=R((e,t)=>{let{as:n,elevation:r=2,square:i=!1,...a}=e,{cssProps:o,otherProps:s}=L(a),{className:c,style:u,...d}=s,f=n??`div`,p=dn.has(r),m={...u,...o,...!p&&r>0?{boxShadow:fn(r)}:{}},h=A(`stratus-paper`,i&&`stratus-paper--square`,p&&`stratus-paper--elevation-${r}`,c);return(0,l.jsx)(f,{ref:t,className:h,style:Object.keys(m).length?m:void 0,...d})});pn.displayName=`Paper`;var mn=G({name:`search`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M14.966 14.255h.79l4.99 5-1.49 1.49-5-4.99v-.79l-.27-.28a6.47 6.47 0 0 1-4.23 1.57 6.5 6.5 0 1 1 6.5-6.5c0 1.61-.59 3.09-1.57 4.23zm-9.71-4.5c0 2.49 2.01 4.5 4.5 4.5s4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5-4.5 2.01-4.5 4.5`});function hn(){return(0,l.jsx)(mn,{size:16})}var gn=(0,c.forwardRef)(function(e,t){let{className:n,inputValue:r,placeholder:i=`Search`,emptyOnStartTyping:a=!1,onSelect:o,onChange:s,onClear:u,filterOption:d=!0,hideDropdownWhenEmpty:f=!0,...p}=e,[,m]=(0,c.useState)(``),[h,g]=(0,c.useState)(r??``);return(0,c.useEffect)(()=>{r!==void 0&&g(r)},[r]),(0,l.jsx)(an,{ref:t,className:A(`stratus-input-search`,n),startAdornment:(0,l.jsx)(hn,{}),inputValue:h,placeholder:i,filterOption:d,hideDropdownWhenEmpty:f,persistInputText:!0,onSelect:(e,t)=>{if(!a&&e.selectedValue!=null){let t=e.options.find(t=>String(t.value??t.label)===String(e.selectedValue));t&&(m(t.label),g(t.label))}o?.(e,t)},onChange:e=>{g(a?``:e),s?.(e)},onClear:e=>{g(``),m(``),u?.(e)},...p})});function _n(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&bn(e.charCodeAt(r-1))&&yn(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=_n(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function vn(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&bn(e.charCodeAt(i-1))&&yn(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=vn(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function yn(e){return e>=56320&&e<57344}function bn(e){return e>=55296&&e<56320}var Y=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return _n(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return vn(this,e,t,n)}findIndex(e){if(e==0)return Sn(0,e);if(e==this.size)return Sn(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Sn(t+1,i):Sn(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};Y.empty=new Y([],0);var xn={index:0,offset:0};function Sn(e,t){return xn.index=e,xn.offset=t,xn}function Cn(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Cn(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Cn(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var wn=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Cn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};wn.none=[];var Tn=class extends Error{},X=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Dn(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(En(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(Y.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};X.empty=new X(Y.empty,0,0);function En(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(En(a.content,t-i-1,n-i-1)))}function Dn(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=Dn(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function On(e,t,n){if(n.openStart>e.depth)throw new Tn(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Tn(`Inconsistent open depths`);return kn(e,t,n,0)}function kn(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=kn(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Pn(a,In(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Pn(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=Ln(n,e);return Pn(a,Fn(e,i,o,t,r))}}function An(e,t){if(!t.type.compatibleContent(e.type))throw new Tn(`Cannot join `+t.type.name+` onto `+e.type.name)}function jn(e,t,n){let r=e.node(n);return An(r,t.node(n)),r}function Mn(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Nn(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Mn(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Mn(i.child(e),r);t&&t.depth==n&&t.textOffset&&Mn(t.nodeBefore,r)}function Pn(e,t){if(!e.type.validContent(t))throw new Tn(`Invalid content for node `+e.type.name);return e.copy(t)}function Fn(e,t,n,r,i){let a=e.depth>i&&jn(e,t,i+1),o=r.depth>i&&jn(n,r,i+1),s=[];return Nn(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(An(a,o),Mn(Pn(a,Fn(e,t,n,r,i+1)),s)):(a&&Mn(Pn(a,In(e,t,i+1)),s),Nn(t,n,i,s),o&&Mn(Pn(o,In(n,r,i+1)),s)),Nn(r,null,i,s),new Y(s)}function In(e,t,n){let r=[];return Nn(null,e,n,r),e.depth>n&&Mn(Pn(jn(e,t,n+1),In(e,t,n+1)),r),Nn(t,null,n,r),new Y(r)}function Ln(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Y.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Rn=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return wn.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Hn(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Vn.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Vn.set(t,r=new zn);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Bn,i}},zn=class{constructor(){this.elts=[],this.i=0}},Bn=12,Vn=new WeakMap,Hn=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Un=Object.create(null),Wn=class e{constructor(e,t,n,r=wn.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Y.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Cn(this.attrs,t||e.defaultAttrs||Un)&&wn.sameSet(this.marks,n||wn.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return X.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new X(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return On(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Rn.resolveCached(this,e)}resolveNoCache(e){return Rn.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Gn(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=Y.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=wn.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!wn.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=Y.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Wn.prototype.text=void 0;function Gn(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Kn=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new qn(t,n);if(r.next==null)return e.empty;let i=Jn(r);r.next&&r.err(`Unexpected trailing text`);let a=ir(tr(i));return ar(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return Y.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("react");c=s(c,1);let l=require("react/jsx-runtime"),u=require("react-dom"),d=require("@tanstack/react-table"),f=require("@tanstack/react-virtual"),p=require("@tiptap/extension-color");p=s(p,1);let m=require("@tiptap/extension-highlight");m=s(m,1);let h=require("@tiptap/extension-subscript");h=s(h,1);let g=require("@tiptap/extension-superscript");g=s(g,1);let _=require("@tiptap/extension-table"),v=require("@tiptap/extension-table-cell");v=s(v,1);let y=require("@tiptap/extension-table-header");y=s(y,1);let b=require("@tiptap/extension-table-row");b=s(b,1);let x=require("@tiptap/extension-text-align");x=s(x,1);let S=require("@tiptap/extension-text-style"),C=require("@tiptap/core"),w=require("@tiptap/react"),T=require("@tiptap/starter-kit");T=s(T,1);let E=require("@popperjs/core"),D=require("date-fns");var O={primary:{main:`var(--stratus-primary)`,hover:`var(--stratus-primary-hover)`,hoverAlt:`var(--stratus-primary-hover-alt)`,highlight:`var(--stratus-primary-highlight)`,highlightHover:`var(--stratus-primary-highlight-hover)`,light:`var(--stratus-primary-light)`},secondary:{main:`var(--stratus-secondary)`,hover:`var(--stratus-secondary-hover)`,highlight:`var(--stratus-secondary-highlight)`,light:`var(--stratus-secondary-light)`},danger:{main:`var(--stratus-error)`,hover:`var(--stratus-error-hover)`,text:`var(--stratus-error-text)`,highlight:`var(--stratus-error-highlight)`},warning:{main:`var(--stratus-warning)`,hover:`var(--stratus-warning-hover)`,text:`var(--stratus-warning-text)`,highlight:`var(--stratus-warning-highlight)`},success:{main:`var(--stratus-success)`,hover:`var(--stratus-success-hover)`,text:`var(--stratus-success-text)`,highlight:`var(--stratus-success-highlight)`},text:{main:`var(--stratus-text-main)`,muted:`var(--stratus-text-muted)`,primary:`var(--stratus-text-primary)`,secondary:`var(--stratus-text-secondary)`,tertiary:`var(--stratus-text-tertiary)`,disabled:`var(--stratus-text-disabled)`,inverted:`var(--stratus-text-inverted)`,invertedAlt:`var(--stratus-text-inverted-alt)`},surface:{surface:`var(--stratus-surface)`,muted:`var(--stratus-surface-muted)`,canvas:`var(--stratus-surface-muted)`,raised:`var(--stratus-surface-raised)`,nav:`var(--stratus-bg-nav)`,popover:`var(--stratus-popover-bg)`,overlay:`var(--stratus-bg-overlay)`,lighten:`var(--stratus-bg-lighten)`},background:{main:`var(--stratus-surface-muted)`,nav:`var(--stratus-bg-nav)`,paper:`var(--stratus-surface-raised)`,popover:`var(--stratus-popover-bg)`,overlay:`var(--stratus-bg-overlay)`,lighten:`var(--stratus-bg-lighten)`},border:{light:`var(--stratus-border-light)`,divider:`var(--stratus-divider)`},table:{header:`var(--stratus-table-header-bg)`,headerActive:`var(--stratus-table-header-active-bg)`,headerHover:`var(--stratus-table-header-hover-bg)`,cell:`var(--stratus-table-cell-bg)`,cellActive:`var(--stratus-table-cell-active-bg)`,cellHover:`var(--stratus-table-row-hover-bg)`},disabled:{fill:`var(--stratus-disabled-fill)`,text:`var(--stratus-disabled-text)`,border:`var(--stratus-disabled-border)`}};function k(e,{as:t,disabled:n,type:r}){let i=t??e;return i===`button`?{Component:i,isButton:!0,rootProps:{disabled:n||void 0,type:r,"data-disabled":n?`true`:void 0}}:{Component:i,isButton:!1,rootProps:{"aria-disabled":n||void 0,"data-disabled":n?`true`:void 0}}}function A(...e){return e.filter(Boolean).join(` `)}var j={p:`padding`,pt:`paddingTop`,pr:`paddingRight`,pb:`paddingBottom`,pl:`paddingLeft`,px:`paddingInline`,py:`paddingBlock`,m:`margin`,mt:`marginTop`,mr:`marginRight`,mb:`marginBottom`,ml:`marginLeft`,mx:`marginInline`,my:`marginBlock`,w:`width`,minW:`minWidth`,maxW:`maxWidth`,h:`height`,minH:`minHeight`,maxH:`maxHeight`,bg:`backgroundColor`,rounded:`borderRadius`},M=new Set(`display.position.top.right.bottom.left.inset.zIndex.overflow.overflowX.overflowY.float.clear.visibility.boxSizing.flex.flexDirection.flexWrap.flexFlow.flexGrow.flexShrink.flexBasis.justifyContent.alignItems.alignSelf.alignContent.order.gap.rowGap.columnGap.grid.gridTemplate.gridTemplateColumns.gridTemplateRows.gridTemplateAreas.gridArea.gridColumn.gridRow.gridAutoFlow.gridAutoColumns.gridAutoRows.gridGap.gridRowGap.gridColumnGap.justifyItems.justifySelf.placeContent.placeItems.placeSelf.width.minWidth.maxWidth.height.minHeight.maxHeight.aspectRatio.margin.marginTop.marginRight.marginBottom.marginLeft.marginBlock.marginBlockStart.marginBlockEnd.marginInline.marginInlineStart.marginInlineEnd.padding.paddingTop.paddingRight.paddingBottom.paddingLeft.paddingBlock.paddingBlockStart.paddingBlockEnd.paddingInline.paddingInlineStart.paddingInlineEnd.border.borderTop.borderRight.borderBottom.borderLeft.borderWidth.borderStyle.borderColor.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomLeftRadius.borderBottomRightRadius.borderCollapse.borderSpacing.outline.outlineColor.outlineStyle.outlineWidth.outlineOffset.background.backgroundColor.backgroundImage.backgroundSize.backgroundPosition.backgroundRepeat.backgroundClip.backgroundOrigin.backgroundAttachment.color.opacity.font.fontFamily.fontSize.fontWeight.fontStyle.fontVariant.lineHeight.letterSpacing.textAlign.textDecoration.textTransform.textOverflow.textShadow.textIndent.whiteSpace.wordBreak.wordSpacing.wordWrap.overflowWrap.verticalAlign.transform.transformOrigin.transition.transitionProperty.transitionDuration.transitionTimingFunction.transitionDelay.animation.animationName.animationDuration.animationTimingFunction.animationDelay.animationIterationCount.animationDirection.animationFillMode.animationPlayState.boxShadow.filter.backdropFilter.mixBlendMode.clipPath.mask.cursor.pointerEvents.userSelect.resize.touchAction.scrollBehavior.scrollMargin.scrollPadding.scrollSnapType.scrollSnapAlign.tableLayout.listStyle.listStyleType.listStylePosition.listStyleImage.content.objectFit.objectPosition.isolation.contain.willChange.appearance.accentColor.caretColor`.split(`.`)),N=[0,4,8,16,32,64,128,256,512],P=new Set([`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`marginBlock`,`marginBlockStart`,`marginBlockEnd`,`marginInline`,`marginInlineStart`,`marginInlineEnd`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`paddingBlock`,`paddingBlockStart`,`paddingBlockEnd`,`paddingInline`,`paddingInlineStart`,`paddingInlineEnd`]),F=new Set([`gap`,`rowGap`,`columnGap`]);function I(e,t){if(typeof t!=`number`)return t;if(P.has(e)){let e=N[t];return e==null?`${t}px`:`${e}px`}return F.has(e)?`${t}px`:t}function L(e){let t={},n={...e};for(let[e,r]of Object.entries(j))e in n&&(r in n||(t[r]=I(r,n[e])),delete n[e]);for(let e of M)e in n&&(t[e]=I(e,n[e]),delete n[e]);if(`style`in n){let e=n.style;if(delete n.style,e&&typeof e==`object`)return{cssProps:{...e,...t},otherProps:n}}return{cssProps:t,otherProps:n}}function R(e){return c.forwardRef(e)}var z=48,B=R((e,t)=>{let{color:n,...r}=e,{cssProps:i,otherProps:a}=L(r),{as:o,className:s,size:c=48,style:u,thickness:d=4,value:f=0,variant:p=`indeterminate`,...m}=a,{Component:h,rootProps:g}=k(`span`,{as:o}),_=2*Math.PI*((z-d)/2),v=Math.max(0,Math.min(100,f)),y=p===`determinate`?{strokeDasharray:_.toFixed(3),strokeDashoffset:`${((100-v)/100*_).toFixed(3)}px`}:void 0,b={...u,...i,"--stratus-circular-progress-size":`${c}px`,...n?{"--stratus-circular-progress-color":n}:{}};return(0,l.jsx)(h,{ref:t,className:A(`stratus-circular-progress`,`stratus-circular-progress--${p}`,s),role:`progressbar`,"aria-valuenow":p===`determinate`?Math.round(v):void 0,"aria-valuemin":p===`determinate`?0:void 0,"aria-valuemax":p===`determinate`?100:void 0,style:b,...g,...m,children:(0,l.jsxs)(`svg`,{viewBox:`${z/2} ${z/2} ${z} ${z}`,"aria-hidden":!0,children:[(0,l.jsx)(`circle`,{className:`stratus-circular-progress__track`,cx:z,cy:z,r:(z-d)/2,fill:`none`,strokeWidth:d}),(0,l.jsx)(`circle`,{className:`stratus-circular-progress__indicator`,style:y,cx:z,cy:z,r:(z-d)/2,fill:`none`,strokeWidth:d,strokeLinecap:`round`})]})})});B.displayName=`CircularProgress`;var V=c.forwardRef(function({className:e,disabled:t=!1},n){let r=c.useRef(null),i=c.useCallback((e,n)=>{let i=r.current;if(!i||t)return;let a=i.getBoundingClientRect(),o=e-a.left,s=n-a.top,c=Math.max(a.width,a.height)*2,l=document.createElement(`span`);l.className=A(`stratus-ripple`),l.style.width=`${c}px`,l.style.height=`${c}px`,l.style.left=`${o}px`,l.style.top=`${s}px`,i.appendChild(l);let u=getComputedStyle(i).getPropertyValue(`--stratus-button-ripple-opacity`).trim()||`0.22`,d=l.animate([{transform:`translate(-50%, -50%) scale(0)`,opacity:u},{transform:`translate(-50%, -50%) scale(1)`,opacity:`0`}],{duration:520,easing:`ease-out`,fill:`forwards`});d.onfinish=()=>l.remove()},[t]),a=c.useCallback(()=>{let e=r.current;if(!e)return;let t=e.getBoundingClientRect();i(t.left+t.width/2,t.top+t.height/2)},[i]);return c.useImperativeHandle(n,()=>({triggerAt:i,triggerCenter:a}),[i,a]),(0,l.jsx)(`span`,{ref:r,"aria-hidden":!0,className:A(`stratus-button__ripples`,e)})}),H=R((e,t)=>{let{cssProps:n,otherProps:r}=L(e),{variant:i=`contained`,colorScheme:a=`primary`,size:o=`md`,compact:s=!1,fullWidth:u=!1,as:d,loading:f=!1,spinner:p,startAdornment:m,endAdornment:h,className:g,disabled:_,children:v,type:y=`button`,disableRipple:b=!1,iconSize:x,onPointerDown:S,onKeyDown:C,...w}=r,T=s?`sm`:o,E=(0,c.useRef)(null),D=!!(!v&&(m||h)),O=!!(_||f),j=e=>{S?.(e),!e.defaultPrevented&&(b||O||e.button===0&&E.current?.triggerAt(e.clientX,e.clientY))},M=e=>{C?.(e),!e.defaultPrevented&&(b||O||(e.key===`Enter`||e.key===` `)&&E.current?.triggerCenter())},{Component:N,rootProps:P}=k(`button`,{as:d,disabled:O,type:y}),F=A(`stratus-button`,`stratus-button--${i}`,`stratus-button--${a}`,`stratus-button--${T}`,u&&`stratus-button--fullWidth`,D&&`stratus-button--iconOnly`,f&&`stratus-button--loading`,g),I=p??(D?(0,l.jsx)(B,{size:x??24,color:`currentColor`}):(0,l.jsx)(`span`,{className:`stratus-button__spinner`,"aria-hidden":!0})),R=f&&D,z={...n};return(0,l.jsxs)(N,{ref:t,className:F,"aria-busy":f||void 0,style:z,...P,...w,onPointerDown:j,onKeyDown:M,children:[(0,l.jsx)(V,{ref:E,disabled:b||O}),f?I:null,m&&!R?(0,l.jsx)(`span`,{className:A(`stratus-button__startAdornment`),style:x?{fontSize:x,width:x,height:x}:void 0,children:m}):null,v?(0,l.jsx)(`span`,{className:A(`stratus-button__label`),children:v}):null,h&&!R?(0,l.jsx)(`span`,{className:A(`stratus-button__endAdornment`),style:x?{fontSize:x,width:x,height:x}:void 0,children:h}):null]})}),U=new Set([`default`,`primary`,`secondary`,`success`,`warning`,`danger`]),W=(0,c.forwardRef)(function(e,t){let{children:n,className:r,color:i=`inherit`,size:a,rotation:o=0,...s}=e,{cssProps:c,otherProps:u}=L(s),d=U.has(i),f=i!==`inherit`&&!d,p={...a==null?{}:{width:a,height:a},...c,...f?{color:i}:{},...o?{transform:`rotate(${o}deg)`}:{}};return(0,l.jsx)(`span`,{ref:t,className:A(`stratus-icon`,d&&`stratus-icon--${i}`,r),style:p,...u,children:n})});function G(e){let{name:t,width:n,height:r,svgPathData:i}=e,a=(0,c.memo)((0,c.forwardRef)(function(e,t){let{size:a,...o}=e;return(0,l.jsx)(W,{ref:t,size:a,...o,children:(0,l.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${n} ${r}`,fill:`currentColor`,children:(0,l.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:i})})})}));return a.displayName=t?t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace(`-`,``).replace(`_`,``)).replace(/^[a-z]/,e=>e.toUpperCase())+`Icon`:`SvgIcon`,a}var ee=G({name:`arrow_drop_down`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m7 9.5 5 5 5-5z`}),te=typeof window>`u`?c.useEffect:c.useLayoutEffect;function ne(e,t=!1){let[n,r]=(0,c.useState)(null);return te(()=>{r(t?null:e??document.body)},[e,t]),n}function re(e){return e.startsWith(`top`)?`top`:e.startsWith(`bottom`)?`bottom`:e.startsWith(`left`)?`left`:`right`}var ie=8;function ae(e,t,n){let r=re(n),i=0,a=0;switch(r){case`bottom`:i=e.bottom+ie;break;case`top`:i=e.top-t.height-ie;break;case`left`:a=e.left-t.width-ie;break;case`right`:a=e.right+ie}r===`top`||r===`bottom`?a=n.endsWith(`-start`)?e.left:n.endsWith(`-end`)?e.right-t.width:e.left+e.width/2-t.width/2:i=n.endsWith(`-start`)?e.top:n.endsWith(`-end`)?e.bottom-t.height:e.top+e.height/2-t.height/2;let o=document.documentElement.clientWidth,s=document.documentElement.clientHeight;return a=Math.max(4,Math.min(a,o-t.width-4)),i=Math.max(4,Math.min(i,s-t.height-4)),{top:i,left:a}}var K=(0,c.forwardRef)(({children:e,className:t,content:n,placement:r=`bottom`,trigger:i=[`click`,`hover`],open:a,defaultOpen:o=!1,arrow:s=!0,closeOnClickOutside:d=!0,tooltipRef:f,zIndex:p=1500,maxWidth:m=`300px`,fontSize:h=`0.75rem`,style:g,container:_,keepMounted:v=!1,disablePortal:y=!1,disabled:b=!1,onOpen:x,onClose:S,onClick:C,onMouseEnter:w,onMouseLeave:T,onContextMenu:E,onClickOutside:D,...O},k)=>{let[j,M]=(0,c.useState)(o),N=(0,c.useRef)(null),P=(0,c.useRef)(null),F=(0,c.useRef)(void 0),[I,L]=(0,c.useState)(null),R=a!==void 0,z=b?!1:R?a:j,B=(0,c.useRef)(z);(0,c.useEffect)(()=>{let e=B.current;B.current=z,b&&(clearTimeout(F.current),R||M(!1),e&&S?.(new MouseEvent(`click`,{bubbles:!0,cancelable:!0})))},[b,z,R,S]),(0,c.useEffect)(()=>()=>clearTimeout(F.current),[]);let V=(0,c.useMemo)(()=>Array.isArray(i)?i:[i],[i]),H={};for(let e of Object.keys(O))e.startsWith(`data-`)&&(H[e]=O[e]);let U=(0,c.useCallback)(e=>{b||(R||M(!0),x?.(e))},[b,R,x]),W=(0,c.useCallback)(e=>{R||M(!1),S?.(e)},[R,S]);(0,c.useImperativeHandle)(f,()=>({open:e=>{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0});U(e??t)},close:e=>{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0});W(e??t)}}));let G=(0,c.useCallback)(()=>{if(!N.current||!P.current)return;let e=N.current.getBoundingClientRect(),t=P.current.getBoundingClientRect(),n=ae(e,{width:t.width,height:t.height},r);L(n)},[r]);(0,c.useLayoutEffect)(()=>{z&&G()},[z,G,n]),(0,c.useEffect)(()=>{if(!z)return;let e=()=>G();return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[z,G]),(0,c.useEffect)(()=>{if(!z||!d||!V.includes(`click`)&&!V.includes(`contextMenu`))return;let e=e=>{let t=e.target;N.current?.contains(t)||P.current?.contains(t)||(W(e),D?.(!1,e))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[z,d,W,D]);let ee=(0,c.useCallback)(e=>{if(!V.includes(`click`))return;let t=!z;R||M(t),C?.(t,e),t?x?.(e):S?.(e)},[V,z,R,C,x,S]),te=(0,c.useCallback)(e=>{if(!V.includes(`contextMenu`))return;e.preventDefault();let t=!z;R||M(t),E?.(t,e),t?x?.(e):S?.(e)},[V,z,R,E,x,S]),ie=(0,c.useCallback)(e=>{V.includes(`hover`)&&(clearTimeout(F.current),U(e),w?.(!0,e))},[V,U,w]),K=(0,c.useCallback)(e=>{V.includes(`hover`)&&(F.current=setTimeout(()=>W(e),100),T?.(!1,e))},[V,W,T]),oe=(0,c.useCallback)(()=>{V.includes(`hover`)&&clearTimeout(F.current)},[V]),se=(0,c.useCallback)(e=>{V.includes(`hover`)&&(W(e),T?.(!1,e))},[V,W,T]),q={};b||(V.includes(`click`)&&(q.onClick=ee),V.includes(`contextMenu`)&&(q.onContextMenu=te),V.includes(`hover`)&&(q.onMouseEnter=ie,q.onMouseLeave=K));let ce=(0,c.useCallback)(e=>{N.current=e},[]),le=()=>typeof e==`string`?(0,l.jsx)(`span`,{ref:ce,...q,className:`stratus-tooltip-anchor`,style:b?{cursor:`default`}:void 0,children:e}):c.Children.map(e,e=>(0,c.isValidElement)(e)?(0,c.cloneElement)(e,{ref:ce,...q,style:{display:e.props?.display??`inline-block`,...b?{}:{cursor:`pointer`},...e.props?.style}}):e),ue=re(r),de=Array.isArray(m)?m[0]:m,fe=Array.isArray(h)?h[0]:h,pe=!b&&(z||v)?(0,l.jsxs)(`div`,{ref:e=>{P.current=e,typeof k==`function`?k(e):k&&(k.current=e)},className:A(`stratus-tooltip`,`stratus-tooltip--${ue}`,t),role:`tooltip`,"data-state":z?`open`:`closed`,style:{top:I?.top??-9999,left:I?.left??-9999,zIndex:typeof p==`string`?Number(p)||1500:p,display:z?void 0:`none`,...!z&&v?{visibility:`hidden`}:{}},onMouseEnter:oe,onMouseLeave:se,...H,children:[s&&(0,l.jsx)(`span`,{className:`stratus-tooltip__arrow`}),(0,l.jsx)(`div`,{className:`stratus-tooltip__content`,style:{"--stratus-tooltip-max-width":de,"--stratus-tooltip-font-size":fe,...g},children:n})]}):null,me=ne(_,y);return(0,l.jsxs)(l.Fragment,{children:[le(),pe&&(y?pe:me?(0,u.createPortal)(pe,me):null)]})});K.displayName=`Tooltip`;var oe=(0,c.forwardRef)(function(e,t){let{menu:n,contextMenu:r,trigger:i=[`click`],arrow:a=!1,className:o,style:s,...c}=e,u=r?Array.isArray(i)?[...i,`contextMenu`]:[i,`contextMenu`]:i;return(0,l.jsx)(K,{ref:t,content:(0,l.jsx)(`div`,{className:`stratus-dropdown-content`,children:n}),trigger:u,arrow:a,maxWidth:`fit-content`,style:s,className:A(`stratus-dropdown`,o),...c})}),se=(0,c.forwardRef)(function(e,t){let{orientation:n,color:r,size:i,...a}=e,{cssProps:o,otherProps:s}=L(a),{className:c,style:u,...d}=s,f=he()?.mode??`vertical`,p=n??(f===`horizontal`?`vertical`:`horizontal`),m={...u,...o};return r&&(p===`horizontal`?m.borderTopColor=r:m.borderLeftColor=r),i&&(p===`horizontal`?m.borderTopWidth=`${i}px`:m.borderLeftWidth=`${i}px`),(0,l.jsx)(`hr`,{ref:t,role:`separator`,"aria-orientation":p,className:A(`stratus-menu-divider`,`stratus-menu-divider--${p}`,c),style:m,...d})});se.displayName=`MenuDivider`;var q=R((e,t)=>{let n=(0,c.useId)(),r=(0,c.useRef)(null),{as:i,children:a,id:o,startAdornment:s,endAdornment:u,disabled:d=!1,clickable:f=!0,onClick:p,...m}=e,{cssProps:h,otherProps:g}=L(m),{className:_,style:v,...y}=g,b=he(),x=o??n,S=d||(b?.disabled??!1),C=b?.compact??!1,w=b?.isSelected(x)??!1,T=e=>{if(!(S||!f)&&(p?.({id:x,label:a},e),b)){b.toggleSelect(x,e,a);let t={menuItemId:x,selected:!b.isSelected(x),selectedIds:b.selectedIds,open:!1,openIds:b.openIds};b.onClick?.(t,e)}},E=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(e))},D=i??`li`,O=A(`stratus-menu-item`,C&&`stratus-menu-item--compact`,S&&`stratus-menu-item--disabled`,w&&`stratus-menu-item--selected`,!f&&`stratus-menu-item--not-clickable`,_),k={...v,...h};return(0,l.jsxs)(D,{ref:t,role:`menuitem`,tabIndex:S?void 0:0,"aria-disabled":S||void 0,className:O,style:k,onClick:T,onKeyDown:E,onPointerDown:e=>{S||!f||e.button===0&&r.current?.triggerAt(e.clientX,e.clientY)},...y,children:[f&&!S&&(0,l.jsx)(V,{ref:r}),s&&(0,l.jsx)(`span`,{className:`stratus-menu-item__start-adornment`,children:s}),(0,l.jsx)(`span`,{className:`stratus-menu-item__title`,children:a}),u&&(0,l.jsx)(`span`,{className:`stratus-menu-item__end-adornment`,children:u})]})}),ce=R((e,t)=>{let{as:n,children:r,title:i,...a}=e,{cssProps:o,otherProps:s}=L(a),{className:u,style:d,...f}=s,p=n??`li`,m=(0,c.useId)(),h=A(`stratus-menu-item-group`,u),g={...d,...o};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(p,{ref:t,role:`none`,id:m,className:h,style:g,...f,children:i}),r]})}),le=G({name:`chevron_down`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m7.41 8.295 4.59 4.58 4.59-4.58L18 9.705l-6 6-6-6z`}),ue=G({name:`chevron_right`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m8.295 16.59 4.58-4.59-4.58-4.59L9.705 6l6 6-6 6z`});function de(){return(0,l.jsx)(le,{size:16})}function fe(){return(0,l.jsx)(ue,{size:16})}var pe=(0,c.forwardRef)(function(e,t){let n=(0,c.useId)(),{title:r,children:i,id:a,startAdornment:o,arrow:s=!0,disabled:u=!1,onClick:d,...f}=e,{cssProps:p,otherProps:m}=L(f),{className:h,style:g,..._}=m,v=he(),y=a??n,b=u||(v?.disabled??!1),x=v?.compact??!1,S=(v?.mode??`vertical`)===`inline`,[C,w]=(0,c.useState)(!1),T=v?.isOpen(y)??C,E=(0,c.useRef)(null),D=(0,c.useRef)(null),[O,k]=(0,c.useState)(T?`auto`:0),j=(0,c.useRef)(!0);(0,c.useEffect)(()=>{if(!S)return;if(j.current){j.current=!1,T&&k(`auto`);return}let e=E.current;if(e){if(T){let t=e.scrollHeight;k(t);let n=()=>{k(`auto`),e.removeEventListener(`transitionend`,n)};e.addEventListener(`transitionend`,n)}else{let t=e.scrollHeight;k(t),e.offsetHeight,requestAnimationFrame(()=>k(0))}}},[T,S]),(0,c.useEffect)(()=>{if(S||!T)return;let e=e=>{let t=e.target;D.current?.contains(t)||E.current?.contains(t)||(v?v.toggleOpen(y,e,r):w(!1))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[S,T,v,y,r]);let M=e=>{if(b)return;let t={id:y,label:r,level:v?.level};d?.(t,e),v?v.toggleOpen(y,e,r):w(e=>!e)},N=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),M(e))},P=v?.triggersSubMenu??`click`,F=Array.isArray(P)?P.includes(`hover`):P===`hover`,I=e=>{!F||b||T||(v?v.toggleOpen(y,e,r):w(!0))},R=e=>{!F||b||!T||(v?v.toggleOpen(y,e,r):w(!1))},z=S?(0,l.jsx)(de,{}):(0,l.jsx)(fe,{});return(0,l.jsxs)(`li`,{ref:t,className:A(`stratus-submenu`,h),style:{...g,...p},onMouseEnter:S?void 0:I,onMouseLeave:S?void 0:R,..._,children:[(0,l.jsxs)(`div`,{ref:D,role:`menuitem`,tabIndex:b?void 0:0,"aria-haspopup":`true`,"aria-expanded":T,"aria-disabled":b||void 0,className:A(`stratus-submenu__trigger`,x&&`stratus-submenu__trigger--compact`,b&&`stratus-submenu__trigger--disabled`),onClick:M,onKeyDown:N,children:[o&&(0,l.jsx)(`span`,{className:`stratus-menu-item__start-adornment`,children:o}),(0,l.jsx)(`span`,{className:`stratus-submenu__trigger__title`,children:r}),s&&(0,l.jsx)(`span`,{className:A(`stratus-submenu__trigger__arrow`,S&&T&&`stratus-submenu__trigger__arrow--open`),children:z})]}),S?(0,l.jsx)(`div`,{ref:E,className:`stratus-submenu__inline-content`,style:{height:O},children:(0,l.jsx)(`ul`,{role:`menu`,className:`stratus-menu stratus-menu--inline`,children:i})}):T&&(0,l.jsx)(`div`,{ref:E,className:`stratus-submenu__popover`,children:(0,l.jsx)(`ul`,{role:`menu`,className:`stratus-menu`,children:i})})]})});pe.displayName=`SubMenu`;var me=pe,J=(0,c.createContext)(null);function he(){return(0,c.useContext)(J)}var ge=R((e,t)=>{let{as:n,children:r,mode:i=`vertical`,inlineCollapsed:a=!1,multiple:o=!1,selectable:s=!0,selectedIds:u,openIds:d,triggersSubMenu:f=`click`,compact:p=!1,disabled:m=!1,onClick:h,onSelect:g,onDeselect:_,onOpen:v,onClose:y,...b}=e,{cssProps:x,otherProps:S}=L(b),{className:C,style:w,...T}=S,E=he(),D=E?E.level+1:0,[O,k]=(0,c.useState)(u??[]),[j,M]=(0,c.useState)(d??[]),N=u??O,P=d??j;(0,c.useEffect)(()=>{u&&k(u)},[u]),(0,c.useEffect)(()=>{d&&M(d)},[d]);let F=(0,c.useCallback)(e=>N.includes(e),[N]),I=(0,c.useCallback)(e=>P.includes(e),[P]),R=(0,c.useCallback)((e,t,n)=>{if(!s)return;let r=N.includes(e),i;i=r?N.filter(t=>t!==e):o?[...N,e]:[e],u||k(i);let a={menuItemId:e,selected:!r,selectedIds:i,open:!1,openIds:P};r?_?.(a,t):g?.(a,t)},[s,N,o,u,P,g,_]),z=(0,c.useCallback)((e,t,n)=>{let r=P.includes(e),i;i=r?P.filter(t=>t!==e):[...P,e],d||M(i);let a={menuItemId:e,selected:!1,selectedIds:N,open:!r,openIds:i};r?y?.(a,t):v?.(a,t)},[P,d,N,v,y]),B={mode:a?`vertical`:i,compact:p,disabled:m,selectable:s,selectedIds:N,openIds:P,level:D,triggersSubMenu:f,isSelected:F,isOpen:I,toggleSelect:R,toggleOpen:z,onClick:h},V=n??`ul`,H=A(`stratus-menu`,`stratus-menu--${i}`,C),U={...w,...x};return(0,l.jsx)(J.Provider,{value:B,children:(0,l.jsx)(V,{ref:t,role:`menu`,className:H,style:U,...T,children:r})})}),_e=R((e,t)=>{let{as:n,options:r,selectedId:i,defaultSelectedId:a,menuButtonAriaLabel:o=`Select option`,onAction:s,onOptionChange:u,variant:d=`contained`,color:f=`primary`,compact:p=!1,fullWidth:m=!1,disabled:h=!1,...g}=e,_=(0,c.useRef)(null),v=r.find(e=>e.id===a)??r[0],[y,b]=(0,c.useState)(v?.id),x=i??y,S=r.find(e=>e.id===x)??r[0],C=S?.id,w=p?`sm`:void 0,T=r.length>0,E=T&&r.every(e=>e.disabled),D=ve,O=(e,t)=>{let n=r.find(t=>t.id===e.menuItemId);!n||n.disabled||(i===void 0&&b(n.id),u?.(n,t),_.current?.close(t))},k=e=>{!S||S.disabled||s?.(S,e)};return(0,l.jsxs)(D,{...g,ref:t,as:n,active:-1,variant:d,color:f,compact:p,fullWidth:m,disabled:h,children:[(0,l.jsx)(H,{onClick:k,disabled:h||!S||S.disabled,children:S?.label??`No options`}),(0,l.jsx)(oe,{tooltipRef:_,placement:`bottom-end`,menu:(0,l.jsx)(ge,{compact:p,selectedIds:C?[C]:[],onClick:O,children:r.map(e=>(0,l.jsx)(q,{id:e.id,disabled:e.disabled,children:e.label},e.id))}),children:(0,l.jsx)(H,{"aria-label":o,disabled:h||!T||E,variant:d,colorScheme:f,size:w,style:{paddingLeft:10,paddingRight:10},children:(0,l.jsx)(ee,{})})})]})}),ve=R((e,t)=>{let{cssProps:n,otherProps:r}=L(e),{children:i,className:a,style:o,active:s,defaultActive:u=0,color:d=`primary`,variant:f=`outlined`,variantActive:p=`contained`,orientation:m=`horizontal`,compact:h=!1,fullWidth:g=!1,disabled:_=!1,onChange:v,as:y,...b}=r,x=s!==void 0,[S,C]=(0,c.useState)(u),w=x?s:S,T=(e,t)=>{x||C(e),v?.({index:e},t)},E=A(`stratus-buttonGroup`,`stratus-buttonGroup--${m}`,`stratus-buttonGroup--${d}`,g&&`stratus-buttonGroup--fullWidth`,h&&`stratus-buttonGroup--compact`,_&&`stratus-buttonGroup--disabled`,a),D={...o,...n};return(0,l.jsx)(y??`div`,{ref:t,role:`group`,className:E,style:D,...b,children:c.Children.toArray(i).map((e,t)=>{if(!(0,c.isValidElement)(e))return e;let n=w===t,r=e;return(0,c.cloneElement)(r,{className:A(r.props.className,n&&`stratus-buttonGroup__item--active`),variant:n?p:f,colorScheme:d,size:h?`sm`:void 0,disabled:_||r.props.disabled,onClick:e=>{let n=r.props.onClick;n?.(e),T(t,e)}})})})}),ye=R((e,t)=>{let{cssProps:n,otherProps:r}=L(e),{as:i,className:a,gap:o,children:s,...c}=r,{Component:u,rootProps:d}=k(`div`,{as:i}),f=A(`stratus-box`,a),p={...n};return(0,l.jsx)(u,{ref:t,className:f,style:{gap:typeof o==`number`?`${o}px`:o,...p},...d,...c,children:s})}),be=new Set([`primary`,`secondary`,`success`,`warning`,`danger`,`disabled`,`inherit`]),xe={h1:`h1`,h1_bold:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`},Se=R((e,t)=>{let{cssProps:n,otherProps:r}=L(e),{as:i,className:a,style:o,variant:s=`p`,color:c,children:u,...d}=r,{Component:f,rootProps:p}=k(xe[s]??`p`,{as:i}),m=A(`stratus-typography`,s&&`stratus-typography--${s}`,c&&be.has(c)&&`stratus-typography--color-${c}`,a),h=c&&!be.has(c)?{color:c}:void 0,g={...o,...n,...h};return(0,l.jsx)(f,{ref:t,className:m,style:Object.keys(g).length>0?g:void 0,...p,...d,children:u})}),Ce=(0,d.tableFeatures)({columnResizingFeature:d.columnResizingFeature,columnSizingFeature:d.columnSizingFeature,columnVisibilityFeature:d.columnVisibilityFeature,rowExpandingFeature:d.rowExpandingFeature,rowSelectionFeature:d.rowSelectionFeature,rowSortingFeature:d.rowSortingFeature,expandedRowModel:(0,d.createExpandedRowModel)(),sortedRowModel:(0,d.createSortedRowModel)(),sortFns:d.sortFns});function we(e){let t={};for(let n of e)t[String(n)]=!0;return t}function Te(e,t){return e===!0?t.map(e=>e.id):Object.keys(e).filter(t=>e[t])}function Ee(e){let t={};for(let n of e)t[n.id]=n.desc?`desc`:`asc`;return t}var De={1:`0 1px 3px var(--stratus-shadow-ambient), 0 1px 2px var(--stratus-shadow-penumbra)`,2:`0 3px 6px var(--stratus-shadow-ambient), 0 2px 4px var(--stratus-shadow-penumbra)`,3:`0 10px 20px var(--stratus-shadow-ambient), 0 3px 6px var(--stratus-shadow-penumbra)`};function Oe(e,t,n){let r=[],i=0;for(let a=0;a<e;a+=1){let e=t(a),o=i+e;if((i<=n||r.length===0)&&r.push({index:a,start:i,end:o,size:e}),i=o,i>n&&r.length>0)break}return r}function ke(e,t){let{columns:n,data:r,rowId:i=`id`,childrenId:a=`children`,compact:o=!1,headerHeight:s,rowHeight:u,dynamicHeight:p=!1,sortable:m=!0,multiSort:h=!1,resizable:g=!0,expandable:_=!1,expandedRowKeys:v,defaultExpandedRowKeys:y,draggable:b=!1,selectable:x=!1,selectRowOnClick:S=!0,stripedRows:C=!1,disabled:w=!1,elevation:T=0,maxHeight:E,noDataValue:D,extraColumnsWidth:O,className:k,rowClassName:j,onRowClick:M,onColumnSort:N,onRowSelect:P,onDragEnd:F,onEndReached:I,onEndReachedThreshold:L=50,style:R}=e,z=(0,c.useRef)(null),B=(0,c.useRef)(null),[V,H]=(0,c.useState)(0),[U,W]=(0,c.useState)(0);(0,c.useEffect)(()=>{let e=z.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e)H(t.contentRect.width),W(t.contentRect.height)});return t.observe(e),()=>t.disconnect()},[]);let[G,ee]=(0,c.useState)([]),te=(0,c.useCallback)(e=>{w||ee(t=>{let n=typeof e==`function`?e(t):e;return N?.(Ee(n)),n})},[N,w]),[ne,re]=(0,c.useState)(()=>y?we(y):{}),ie=(0,c.useMemo)(()=>v===void 0?ne:we(v),[v,ne]),ae=(0,c.useCallback)(e=>{v===void 0&&re(t=>typeof e==`function`?e(t):e)},[v]),[K,oe]=(0,c.useState)(()=>e.defaultSelectedRowsIds?Object.fromEntries(e.defaultSelectedRowsIds.map(e=>[e,!0])):{}),[se,q]=(0,c.useState)(null),[ce,le]=(0,c.useState)(null),ue=(0,c.useCallback)((e,t)=>typeof e==`function`?Math.max(e(V,t),0):typeof e==`string`?e.endsWith(`%`)?Math.max(parseFloat(e)/100*V,0):parseFloat(e)||150:e,[V]),de=(0,c.useMemo)(()=>{let e=[];if(_){let t=O?O({totalWidth:V,column:{key:`__expandable__`},defaultWidth:48}):48;t>0&&e.push({id:`__expandable__`,size:t,minSize:t,maxSize:t,enableSorting:!1,enableResizing:!1,header:()=>null,cell:({row:e})=>e.getCanExpand()?(0,l.jsx)(`span`,{role:`button`,"aria-label":e.getIsExpanded()?`Collapse row`:`Expand row`,className:A(`stratus-table__expand-icon`,e.getIsExpanded()&&`stratus-table__expand-icon--open`),onClick:t=>{t.stopPropagation(),e.toggleExpanded()},children:`▶`}):null})}if(x){let t=O?O({totalWidth:V,column:{key:`__selectable__`},defaultWidth:48}):48;t>0&&e.push({id:`__selectable__`,size:t,minSize:t,maxSize:t,enableSorting:!1,enableResizing:!1,header:({table:e})=>(0,l.jsx)(`input`,{type:`checkbox`,checked:e.getIsAllRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()}),cell:({row:e})=>(0,l.jsx)(`input`,{type:`checkbox`,checked:e.getIsSelected(),onChange:t=>{e.toggleSelected(),P?.({rowIndex:e.index,rowData:e.original,selected:t.target.checked})},onClick:e=>e.stopPropagation()})})}if(b){let t=O?O({totalWidth:V,column:{key:`__draggable__`},defaultWidth:48}):48;t>0&&e.push({id:`__draggable__`,size:t,minSize:t,maxSize:t,enableSorting:!1,enableResizing:!1,header:()=>null,cell:()=>(0,l.jsx)(`span`,{"aria-label":`Drag row`,className:`stratus-table__drag-handle`,role:`img`})})}return n.forEach((t,n)=>{let r=t.key??t.dataKey,i=V>0?ue(t.width,t):150,a=t.sortable===void 0?m:t.sortable,o=t.resizable===void 0?g:t.resizable,s;if(typeof t.sortType==`function`){let e=t.sortType,n=t.dataKey;s=(r,i)=>e(r.original,i.original,n,t)}else t.sortType===`datetime`&&(s=(e,n)=>{let r=e.original[t.dataKey],i=n.original[t.dataKey];return new Date(r instanceof Date||typeof r==`string`||typeof r==`number`?r:0).getTime()-new Date(i instanceof Date||typeof i==`string`||typeof i==`number`?i:0).getTime()});e.push({id:r,accessorKey:t.dataKey,size:i,minSize:t.minWidth??50,enableSorting:a,enableResizing:o,sortFn:s??`auto`,header:t.headerRenderer?()=>t.headerRenderer({column:t,columnIndex:n}):()=>t.title??``,cell:t.cellRenderer?e=>t.cellRenderer({rowData:e.row.original,rowIndex:e.row.index,column:t,columnIndex:n,cellData:e.getValue()}):e=>{let t=e.getValue();return t==null?``:String(t)},meta:{_col:t,_colIndex:n}})}),e},[n,V,_,x,b,m,g,O,ue,P]),fe=(0,c.useCallback)(e=>String(e[i]),[i]),pe=(0,c.useCallback)(e=>{let t=e[a];return Array.isArray(t)?t:void 0},[a]),me=(0,d.useTable)({features:Ce,data:r,columns:de,state:{sorting:G,expanded:ie,rowSelection:K},getRowId:fe,getSubRows:_?pe:void 0,onSortingChange:te,onExpandedChange:ae,onRowSelectionChange:oe,enableSorting:m&&!w,enableMultiSort:h,enableSortingRemoval:!0,columnResizeMode:`onChange`,enableColumnResizing:g&&!w,enableRowSelection:x,enableExpanding:_}),J=Array.isArray(s)?s[0]:s,he=u??(o?32:48),ge=me.getRowModel().rows,_e=me.getHeaderGroups(),ve=me.getVisibleLeafColumns(),ye=!r.length,be=T?De[T]??De[1]:void 0,xe=(0,f.useVirtualizer)({count:ve.length,estimateSize:e=>ve[e]?.getSize()??150,getScrollElement:()=>B.current,horizontal:!0,overscan:3,initialRect:{width:V||800,height:U||he*10}}),Se=(0,f.useVirtualizer)({count:ge.length,estimateSize:()=>he,getScrollElement:()=>B.current,measureElement:p&&typeof window<`u`&&window.navigator.userAgent.indexOf(`Firefox`)===-1?e=>e?.getBoundingClientRect().height:void 0,overscan:5,initialRect:{width:V||800,height:U||he*10}}),ke=xe.getVirtualItems(),Ae=Se.getVirtualItems(),je=ke.length?ke:Oe(ve.length,e=>ve[e]?.getSize()??150,(V||800)+450),Me=Ae.length?Ae:Oe(ge.length,()=>he,he*15),Ne=je[0]?.start??0,Pe=je.length?Math.max(xe.getTotalSize()-(je[je.length-1]?.end??0),0):0,Fe=ve.map(e=>e.getSize()).join(`|`);(0,c.useEffect)(()=>{xe.measure()},[xe,Fe,U]),(0,c.useEffect)(()=>{Se.measure()},[Se,U]),(0,c.useImperativeHandle)(t,()=>({clearSortState:()=>{ee([]),N?.({})},setColumnSort:({columnKey:e,order:t})=>{let n=[{id:e,desc:t===`desc`}];ee(n),N?.(Ee(n))},setSelectedRows:e=>{oe(Object.fromEntries(e.map(e=>[e,!0])))},getTableRef:()=>({scrollToTop:e=>{B.current&&(B.current.scrollTop=e)},scrollToRow:e=>{Se.scrollToIndex(e,{align:`start`})},scrollToLeft:e=>{B.current&&(B.current.scrollLeft=e)},getDOMNode:()=>z.current,getExpandedState:()=>({expandedData:me.getExpandedRowModel().rows.map(e=>e.original)}),getExpandedRowKeys:()=>Te(me.state.expanded,me.getRowModel().rows),setExpandedRowKeys:e=>{v===void 0&&re(we(e))}})}),[me,Se,v,N]),(0,c.useEffect)(()=>{if(!I)return;let e=B.current;if(!e)return;let t=()=>{e.scrollTop+e.clientHeight>=e.scrollHeight-L&&I()};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[I,L]);let Ie=(0,c.useCallback)((e,t)=>{!b||w||(q(e.id),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.id))},[b,w]),Le=(0,c.useCallback)((e,t)=>{!b||w||(t.preventDefault(),t.dataTransfer.dropEffect=`move`,le(e.id))},[b,w]),Re=(0,c.useCallback)((e,t)=>{if(!b||w)return;t.preventDefault();let n=t.dataTransfer.getData(`text/plain`)||se;if(q(null),le(null),!n||n===e.id)return;let r=ge.findIndex(e=>e.id===n),i=ge.findIndex(t=>t.id===e.id);if(r<0||i<0)return;let a=ge.map(e=>e.original),[o]=a.splice(r,1);a.splice(i,0,o),F?.({oldIndex:r,newIndex:i,rowData:o,data:a})},[b,w,se,ge,F]),ze=(0,c.useCallback)(()=>{q(null),le(null)},[]);return(0,l.jsx)(`div`,{ref:z,className:A(`stratus-table-root`,k),style:{...R,...be?{boxShadow:be}:{}},children:(0,l.jsx)(`div`,{ref:B,className:`stratus-table-scroll`,style:{...U>0?{height:U}:{},...E===void 0?{}:{maxHeight:E}},children:(0,l.jsxs)(`table`,{className:A(`stratus-table`,`stratus-table--virtualized`,o?`stratus-table--compact`:void 0),style:{width:xe.getTotalSize()||`100%`},children:[(0,l.jsx)(`colgroup`,{children:me.getAllColumns().map(e=>(0,l.jsx)(`col`,{style:{width:e.getSize()}},e.id))}),(0,l.jsx)(`thead`,{className:`stratus-table__head--virtualized`,children:_e.map(e=>(0,l.jsxs)(`tr`,{className:`stratus-table__row--virtualized`,style:J?{height:J}:void 0,children:[Ne>0&&(0,l.jsx)(`th`,{"aria-hidden":`true`,className:`stratus-table__virtual-padding`,style:{width:Ne}}),je.map(t=>{let n=e.headers[t.index];if(!n)return null;let r=n.column.getCanSort(),i=n.column.getIsSorted(),a=n.column.columnDef.meta?._col;return(0,l.jsxs)(`th`,{"data-sortable":r||void 0,"data-sort-direction":i||void 0,className:a?.headerClassName,style:{display:`flex`,width:n.getSize(),...J?{height:J}:{}},onClick:r&&!w?n.column.getToggleSortingHandler():void 0,children:[n.isPlaceholder?null:(0,d.flexRender)(n.column.columnDef.header,n.getContext()),i&&(0,l.jsx)(`span`,{className:`stratus-table__sort-icon`,children:i===`asc`?`▲`:`▼`}),n.column.getCanResize()&&g&&(0,l.jsx)(`div`,{className:A(`stratus-table__resizer`,n.column.getIsResizing()&&`stratus-table__resizer--active`),onMouseDown:n.getResizeHandler(),onTouchStart:n.getResizeHandler()})]},n.id)}),Pe>0&&(0,l.jsx)(`th`,{"aria-hidden":`true`,className:`stratus-table__virtual-padding`,style:{width:Pe}})]},e.id))}),(0,l.jsx)(`tbody`,{className:`stratus-table__body--virtualized`,style:{height:ye?void 0:Se.getTotalSize()},children:ye?(0,l.jsx)(`tr`,{className:`stratus-table__row--virtualized`,children:(0,l.jsx)(`td`,{colSpan:Math.max(ve.length,1),className:`stratus-table__cell--virtualized`,style:{width:xe.getTotalSize()},children:(0,l.jsx)(`div`,{className:`stratus-table__empty`,children:D})})}):Me.map(e=>{let t=ge[e.index];if(!t)return null;let n=e.index,r=t.original,i=fe(r),a=``;typeof j==`function`?a=j({rowData:r,rowIndex:n}):typeof j==`string`&&(a=j);let o=C&&n%2==1,s=t.getIsSelected(),c=!!M,u=b&&ce===t.id;return(0,l.jsxs)(`tr`,{"data-index":e.index,ref:p?Se.measureElement:void 0,className:A(`stratus-table__row--virtualized`,a||void 0,b&&`stratus-table__row--draggable`,se===t.id&&`stratus-table__row--dragging`,u&&`stratus-table__row--drag-over`),draggable:b&&!w,"data-clickable":c||void 0,"data-selected":s||void 0,"data-striped":o||void 0,style:{transform:`translateY(${e.start}px)`,...p?{}:{height:he}},onDragStart:e=>Ie(t,e),onDragOver:e=>Le(t,e),onDrop:e=>Re(t,e),onDragEnd:ze,onClick:w?void 0:e=>{S&&x&&(t.toggleSelected(),P?.({rowIndex:t.index,rowData:r,selected:!t.getIsSelected()})),M?.({rowKey:i,rowIndex:t.index,rowData:r,event:e})},children:[Ne>0&&(0,l.jsx)(`td`,{"aria-hidden":`true`,className:`stratus-table__virtual-padding`,style:{width:Ne}}),je.map(e=>{let i=t.getVisibleCells()[e.index];if(!i)return null;let a=i.column.columnDef.meta?._col,o=``;return a?.className&&(o=typeof a.className==`function`?a.className({rowData:r,rowIndex:n,column:a}):a.className),(0,l.jsx)(`td`,{className:A(`stratus-table__cell--virtualized`,o||void 0),style:{width:i.column.getSize()},children:(0,d.flexRender)(i.column.columnDef.cell,i.getContext())},i.id)}),Pe>0&&(0,l.jsx)(`td`,{"aria-hidden":`true`,className:`stratus-table__virtual-padding`,style:{width:Pe}})]},t.id)})})]})})})}var Ae=(0,c.forwardRef)(ke);Ae.displayName=`Table`;var je=G({name:`check_circle_outlined`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-2-5.83 6.59-6.59L18 9l-8 8-4-4 1.41-1.41z`}),Me=G({name:`close`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),Ne=G({name:`error_filled`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 15v-2h2v2zm0-10v6h2V7z`}),Pe=G({name:`info_circle`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12.01 22C17.53 22 22 17.52 22 12S17.53 2 12.01 2C6.48 2 2 6.48 2 12s4.48 10 10.01 10M13 9V7h-2v2zm0 8v-6h-2v6zm7-5c0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8 8-3.58 8-8`}),Fe=G({name:`warning_filled`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m23 21.5-11-19-11 19zm-12-3v-2h2v2zm0-4h2v-4h-2z`}),Ie=20,Le={info:()=>(0,l.jsx)(Pe,{size:Ie}),success:()=>(0,l.jsx)(je,{size:Ie}),warning:()=>(0,l.jsx)(Fe,{size:Ie}),error:()=>(0,l.jsx)(Ne,{size:Ie})},Re=(0,c.forwardRef)(function(e,t){let{cssProps:n,otherProps:r}=L(e),{className:i,children:a,variant:o=`contained`,severity:s=`info`,title:c,showIcon:u=!1,icon:d,onClose:f,...p}=r,m=typeof f==`function`,h=a!=null,g=()=>{if(d)return d;let e=Le[s];return e?e():null},_=A(`stratus-alert`,`stratus-alert--${o}`,`stratus-alert--${s}`,i),v={...n};return(0,l.jsxs)(`div`,{ref:t,role:`alert`,className:_,style:v,...p,children:[(0,l.jsxs)(`div`,{className:`stratus-alert__header`,children:[u&&(0,l.jsx)(`span`,{className:`stratus-alert__icon`,children:g()}),(0,l.jsx)(`div`,{className:`stratus-alert__title`,children:c}),m&&(0,l.jsx)(`button`,{type:`button`,className:`stratus-alert__close-btn`,"aria-label":`Close`,onClick:f,children:(0,l.jsx)(Me,{size:18})})]}),h&&(0,l.jsx)(`div`,{className:`stratus-alert__message`,children:a})]})});Re.displayName=`Alert`;var ze=G({name:`chevron_up`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m7.41 15.705 4.59-4.58 4.59 4.58 1.41-1.41-6-6-6 6z`});function Be({id:e,header:t,headerLevel:n,headerItems:r,isExpanded:i,disabled:a,expandIconPosition:o,expandIcon:s,onToggle:c,headerClassName:u,chevronClassName:d,titleClassName:f}){let p=s??(i?(0,l.jsx)(ze,{size:16}):(0,l.jsx)(le,{size:16}));return(0,l.jsxs)(`div`,{id:e,className:A(`stratus-accordion__header`,u),role:`button`,tabIndex:a?void 0:0,"aria-expanded":i,"aria-disabled":a||void 0,onClick:c,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c(e))},children:[o===`left`&&(0,l.jsx)(`span`,{className:A(`stratus-accordion__chevron stratus-accordion__chevron--left`,d),children:p}),(0,l.jsxs)(`div`,{className:`stratus-accordion__header-content`,children:[(0,l.jsx)(n,{className:A(`stratus-accordion__title`,i&&`stratus-accordion__title--expanded`,f),children:t}),r]}),o===`right`&&(0,l.jsx)(`span`,{className:A(`stratus-accordion__chevron stratus-accordion__chevron--right`,d),children:p})]})}var Ve=(0,c.forwardRef)(function(e,t){let{cssProps:n,otherProps:r}=L(e),{className:i,children:a,style:o,header:s,headerLevel:u=`h2`,headerItems:d,defaultExpanded:f,expanded:p,expandIconPosition:m=`left`,expandIcon:h,disabled:g=!1,elevation:_=!1,square:v=!0,onChange:y,headerClassName:b,chevronClassName:x,titleClassName:S,collapseClassName:C,panelClassName:w,panelInnerClassName:T,...E}=r,D=(0,c.useId)(),O=typeof p==`boolean`,k=(0,c.useRef)(!0),[j,M]=(0,c.useState)(p??f??!1),N=!g&&(O?p:j),P=a!=null,F=(0,c.useRef)(N),[I,R]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(k.current){k.current=!1,F.current=N;return}let e=F.current;N?R(!1):e&&P&&R(!0),F.current=N},[P,N]);let z=e=>{if(g)return;let t=O?!p:!j;!t&&P&&R(!0),O||M(t),y?.(t,e)};return(0,l.jsxs)(`div`,{ref:t,className:A(`stratus-accordion`,_&&`stratus-accordion--elevation`,!v&&`stratus-accordion--rounded`,i),style:{...o,...n},...E,children:[(0,l.jsx)(Be,{id:D,header:s,headerLevel:u,headerItems:d,isExpanded:!!N,disabled:g,expandIconPosition:m,expandIcon:h,onToggle:z,headerClassName:b,chevronClassName:x,titleClassName:S}),(N||I)&&P&&(0,l.jsx)(`div`,{className:`stratus-accordion__divider`}),(0,l.jsx)(`div`,{className:A(`stratus-accordion__collapse`,N&&`stratus-accordion__collapse--expanded`,C),onTransitionEnd:e=>{e.propertyName===`grid-template-rows`&&!N&&R(!1)},children:(0,l.jsx)(`div`,{className:A(`stratus-accordion__panel`,w),role:`region`,"aria-labelledby":D,children:(0,l.jsx)(`div`,{className:A(`stratus-accordion__panel-inner`,T),children:a})})})]})});Ve.displayName=`Accordion`;var He=G({name:`menu`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M3 8V6h18v2zm0 5h18v-2H3zm0 5h18v-2H3z`}),Ue=G({name:`more_vertical`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-2 8c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2`}),We=1024,Ge=typeof window<`u`?window.innerWidth:We,Ke=0,qe=null,Je=new Set;function Ye(){qe===null&&(qe=requestAnimationFrame(()=>{qe=null;let e=window.innerWidth;if(e!==Ge){Ge=e;for(let e of Je)e()}}))}function Xe(e){return Je.add(e),Ke===0&&typeof window<`u`&&window.addEventListener(`resize`,Ye),Ke+=1,()=>{Je.delete(e),--Ke,Ke===0&&typeof window<`u`&&(window.removeEventListener(`resize`,Ye),qe!==null&&(cancelAnimationFrame(qe),qe=null))}}function Ze(){return Ge}function Qe(){return We}function $e(){return(0,c.useSyncExternalStore)(Xe,Ze,Qe)}function et({open:e,content:t,onClose:n}){return(0,l.jsxs)(l.Fragment,{children:[e&&(0,l.jsx)(`div`,{className:`stratus-appBar__drawer-backdrop`,onClick:n}),(0,l.jsx)(`div`,{className:A(`stratus-appBar__drawer`,e&&`stratus-appBar__drawer--open`),children:t})]})}var tt=(0,c.forwardRef)(function(e,t){let{header:n,content:r,smallScreenContent:i,smallScreenContentOpen:a,smallScreenContentOnOpen:o,smallScreenContentOnClose:s,actions:u,smallScreenActions:d,smallScreenSize:f=425,zIndex:p,...m}=e,{cssProps:h,otherProps:g}=L(m),{className:_,style:v,...y}=g,b=$e(),x=typeof window<`u`&&b<f,S=typeof a==`boolean`,[C,w]=(0,c.useState)(!1),T=S?a:C,E=i??r,D=d??u,O=e=>{S||w(!0),o?.(e)},k=e=>{S||w(!1),s?.(e)},[j,M]=(0,c.useState)(!1),N=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!j)return;let e=e=>{N.current&&!N.current.contains(e.target)&&M(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[j]);let P={...v,...h,...p==null?{}:{zIndex:Number(p)}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`header`,{ref:t,className:A(`stratus-appBar`,_),style:P,...y,children:[(0,l.jsx)(`div`,{className:`stratus-appBar__header`,children:n}),!x&&r&&(0,l.jsx)(`div`,{className:`stratus-appBar__content`,children:r}),(0,l.jsxs)(`div`,{className:`stratus-appBar__actions`,children:[!x&&u,x&&(0,l.jsxs)(`div`,{className:`stratus-appBar__sm-actions`,children:[E&&(0,l.jsx)(`button`,{type:`button`,className:`stratus-appBar__menu-btn`,"aria-label":`Toggle AppBar menu content`,onClick:O,children:(0,l.jsx)(He,{size:24})}),D&&(0,l.jsxs)(`div`,{className:`stratus-appBar__popover-anchor`,ref:N,children:[(0,l.jsx)(`button`,{type:`button`,className:`stratus-appBar__menu-btn`,"aria-label":`Toggle AppBar menu actions`,onClick:()=>M(e=>!e),children:(0,l.jsx)(Ue,{size:24})}),j&&(0,l.jsx)(`div`,{className:`stratus-appBar__popover`,children:D})]})]})]})]}),x&&E&&(0,l.jsx)(et,{open:!!T,content:E,onClose:k})]})});tt.displayName=`AppBar`;var nt=(0,c.forwardRef)(function(e,t){let{children:n,content:r,variant:i=`default`,alignment:a=`top-right`,visible:o=!0,max:s=99,overlap:c,backgroundColor:u,color:d,bg:f,border:p,zIndex:m,display:h,...g}=e,{cssProps:_,otherProps:v}=L(g),{className:y,style:b,title:x,...S}=v,C=i===`dot`?null:typeof r==`number`&&r>s?`${s}+`:r,w={},T=u??f;T&&(w.backgroundColor=T),d&&(w.color=d),p&&(w.border=p),m!=null&&(w.zIndex=Number(m)),h!=null&&(w.display=h);let E=A(`stratus-badge-container`,y),D={...b,..._};return(0,l.jsxs)(`div`,{ref:t,className:E,style:D,...S,children:[n,o&&(0,l.jsx)(`span`,{className:A(`stratus-badge`,i===`dot`&&`stratus-badge--dot`,`stratus-badge--${a}`,c===`circle`&&`stratus-badge--overlap-circle`),style:w,title:x,children:C})]})});nt.displayName=`Badge`;var rt=R((e,t)=>{let{as:n,children:r,disableRipple:i=!1,...a}=e,{cssProps:o,otherProps:s}=L(a),{className:c,style:u,...d}=s,f=n??`div`,p={...u,...o};return(0,l.jsxs)(f,{ref:t,role:`button`,tabIndex:0,className:A(`stratus-card__action-area`,c),style:p,...d,children:[r,!i&&(0,l.jsx)(V,{})]})}),it=R((e,t)=>{let{as:n,children:r,...i}=e,{cssProps:a,otherProps:o}=L(i),{className:s,style:c,...u}=o,d=n??`div`,f={...c,...a};return(0,l.jsx)(d,{ref:t,className:A(`stratus-card__actions`,s),style:f,...u,children:r})}),at=R((e,t)=>{let{as:n,children:r,...i}=e,{cssProps:a,otherProps:o}=L(i),{className:s,style:c,...u}=o,d=n??`div`,f={...c,...a};return(0,l.jsx)(d,{ref:t,className:A(`stratus-card__content`,s),style:f,...u,children:r})}),ot=R((e,t)=>{let{as:n,title:r,subtitle:i,startAdornment:a,endAdornment:o,children:s,...c}=e,{cssProps:u,otherProps:d}=L(c),{className:f,style:p,...m}=d,h=n??`div`,g={...p,...u};return(0,l.jsxs)(h,{ref:t,className:A(`stratus-card__header`,f),style:g,...m,children:[a&&(0,l.jsx)(`div`,{className:`stratus-card__header-start`,children:a}),(0,l.jsxs)(`div`,{className:`stratus-card__header-body`,children:[(0,l.jsx)(`span`,{className:`stratus-card__header-title`,children:r}),i&&(0,l.jsx)(`span`,{className:`stratus-card__header-subtitle`,children:i})]}),o&&(0,l.jsx)(`div`,{className:`stratus-card__header-end`,children:o}),s]})}),st=R((e,t)=>{let{as:n,children:r,src:i,...a}=e,{cssProps:o,otherProps:s}=L(a),{className:c,style:u,...d}=s,f=n??`div`,p={...u,...o};return i&&(p.backgroundImage=`url(${i})`),(0,l.jsx)(f,{ref:t,className:A(`stratus-card__media`,c),style:p,...d,children:r})}),ct=R((e,t)=>{let{as:n,children:r,elevation:i=2,square:a=!1,...o}=e,{cssProps:s,otherProps:c}=L(o),{className:u,style:d,...f}=c,p=n??`div`,m=A(`stratus-card`,i===0?`stratus-card--elevation-0`:`stratus-card--elevation-${i}`,a&&`stratus-card--square`,u),h={...d,...s};return(0,l.jsx)(p,{ref:t,className:m,style:h,...f,children:r})});function lt({disabled:e,onClose:t}){return(0,l.jsx)(`button`,{type:`button`,"aria-label":`Close chip`,className:`stratus-chip__close`,disabled:e,onClick:n=>{n.preventDefault(),n.stopPropagation(),!e&&t&&t(n)},children:(0,l.jsx)(Me,{size:14})})}var ut=(0,c.forwardRef)(function(e,t){let{children:n,variant:r=`default`,startAdornment:i,endAdornment:a,closable:o=!1,disabled:s=!1,disableRipple:u=!1,onClose:d,onClick:f,...p}=e,{cssProps:m,otherProps:h}=L(p),{className:g,style:_,...v}=h,y=typeof f==`function`&&!s,b=(0,c.useRef)(null),x=e=>{e.defaultPrevented||!y||u||e.button===0&&b.current?.triggerAt(e.clientX,e.clientY)},S=e=>{!s&&f&&f(e)},C=A(`stratus-chip`,`stratus-chip--${r}`,y&&`stratus-chip--clickable`,s&&`stratus-chip--disabled`,g),w={..._,...m};return(0,l.jsxs)(`div`,{ref:t,"aria-disabled":s||void 0,className:C,style:w,tabIndex:y?0:void 0,onClick:y?S:void 0,onPointerDown:y?x:void 0,onKeyDown:y?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),S(e))}:void 0,...v,children:[y&&!u&&(0,l.jsx)(V,{ref:b}),i&&(0,l.jsx)(`span`,{className:`stratus-chip__adornment stratus-chip__adornment--start`,children:i}),(0,l.jsx)(`span`,{className:`stratus-chip__text`,children:n}),a&&(0,l.jsx)(`span`,{className:`stratus-chip__adornment stratus-chip__adornment--end`,children:a}),o&&(0,l.jsx)(lt,{disabled:s,onClose:d})]})});ut.displayName=`Chip`;var dt=R((e,t)=>{let{color:n,...r}=e,{cssProps:i,otherProps:a}=L(r),{as:o,className:s,size:c=32,style:u,...d}=a,{Component:f,rootProps:p}=k(`span`,{as:o}),m={...u,...i,...n?{"--stratus-dots-progress-color":n}:{}};return(0,l.jsx)(f,{ref:t,className:A(`stratus-dots-progress`,s),role:`status`,"aria-label":`Loading`,style:m,...p,...d,children:(0,l.jsxs)(`svg`,{viewBox:`0 0 16 4`,width:c,height:c/2,"aria-hidden":!0,children:[(0,l.jsx)(`circle`,{cx:2,cy:2,r:2,className:`stratus-dots-progress__dot`}),(0,l.jsx)(`circle`,{cx:8,cy:2,r:2,className:`stratus-dots-progress__dot stratus-dots-progress__dot--2`}),(0,l.jsx)(`circle`,{cx:14,cy:2,r:2,className:`stratus-dots-progress__dot stratus-dots-progress__dot--3`})]})})}),ft=R((e,t)=>{let{color:n,...r}=e,{cssProps:i,otherProps:a}=L(r),{as:o,className:s,size:c=4,style:u,value:d=0,variant:f=`indeterminate`,...p}=a,{Component:m,rootProps:h}=k(`span`,{as:o}),g=Math.max(0,Math.min(100,d)),_=f===`determinate`?{transform:`translateX(${g-100}%)`}:void 0,v={...u,...i,"--_stratus-linear-progress-value":`${c}px`,...n?{"--stratus-linear-progress-color":n}:{}};return(0,l.jsxs)(m,{ref:t,className:A(`stratus-linear-progress`,`stratus-linear-progress--${f}`,s),role:`progressbar`,"aria-valuenow":f===`determinate`?Math.round(g):void 0,"aria-valuemin":f===`determinate`?0:void 0,"aria-valuemax":f===`determinate`?100:void 0,style:v,...h,...p,children:[(0,l.jsx)(`span`,{className:`stratus-linear-progress__bar stratus-linear-progress__bar--1`,style:_}),f===`indeterminate`&&(0,l.jsx)(`span`,{className:`stratus-linear-progress__bar stratus-linear-progress__bar--2`})]})}),pt=R((e,t)=>{let{as:n,orientation:r=`horizontal`,size:i=1,color:a,...o}=e,{cssProps:s,otherProps:c}=L(o),{className:u,style:d,...f}=c,p=n??`hr`,m=A(`stratus-divider`,`stratus-divider--${r}`,u),h={...d,...s,"--stratus-divider-size":`${i}px`,...a?{"--stratus-divider-color":a}:{}};return(0,l.jsx)(p,{ref:t,className:m,style:h,...f})});pt.displayName=`Divider`;var mt=0,ht=``;function gt(e){(0,c.useEffect)(()=>{if(!(!e||typeof document>`u`))return mt===0&&(ht=document.body.style.overflow,document.body.style.overflow=`hidden`),mt+=1,()=>{--mt,mt===0&&(document.body.style.overflow=ht)}},[e])}var _t=[`a[href]`,`area[href]`,`button:not([disabled])`,`input:not([disabled]):not([type='hidden'])`,`select:not([disabled])`,`textarea:not([disabled])`,`iframe`,`object`,`embed`,`[tabindex]:not([tabindex='-1'])`,`[contenteditable='true']`,`audio[controls]`,`video[controls]`,`details > summary`].join(`,`);function vt(e){return Array.from(e.querySelectorAll(_t)).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`&&(e.offsetWidth>0||e.offsetHeight>0||e.tagName===`IFRAME`))}function yt(e,t,{initialFocus:n=!0,restoreFocus:r=!0}={}){(0,c.useEffect)(()=>{if(!t)return;let i=e.current;if(!i)return;let a=document.activeElement;if(n){let e=vt(i)[0]??i;e===i&&!i.hasAttribute(`tabindex`)&&i.setAttribute(`tabindex`,`-1`),e.focus({preventScroll:!0})}let o=e=>{if(e.key!==`Tab`)return;let t=vt(i);if(t.length===0){e.preventDefault(),i.focus({preventScroll:!0});return}let n=t[0],r=t[t.length-1],a=document.activeElement;e.shiftKey?(a===n||!i.contains(a))&&(e.preventDefault(),r.focus({preventScroll:!0})):a===r&&(e.preventDefault(),n.focus({preventScroll:!0}))};return document.addEventListener(`keydown`,o,!0),()=>{document.removeEventListener(`keydown`,o,!0),r&&a?.isConnected&&a.focus({preventScroll:!0})}},[t,e,n,r])}var bt=G({name:`fullscreen`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M7 10H5V5h5v2H7zm-2 4h2v3h3v2H5zm12 3h-3v2h5v-5h-2zM14 7V5h5v5h-2V7z`}),xt=G({name:`fullscreen_exit`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M5 8h3V5h2v5H5zm3 8H5v-2h5v5H8zm6 3h2v-3h3v-2h-5zm2-14v3h3v2h-5V5z`});function St({header:e,headerId:t,hasStringHeader:n,closable:r,fullScreen:i,isFullscreen:a,isTemporary:o,onToggleFullscreen:s,onClose:c}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`stratus-drawer__header`,children:[(0,l.jsx)(`div`,{id:n?t:void 0,className:`stratus-drawer__header-inner`,children:e}),i&&o&&(0,l.jsx)(`button`,{type:`button`,"aria-label":a?`Exit fullscreen`:`Fullscreen`,className:`stratus-drawer__header-btn`,onClick:s,children:a?(0,l.jsx)(xt,{size:20}):(0,l.jsx)(bt,{size:20})}),r&&(0,l.jsx)(`button`,{type:`button`,"aria-label":`Close drawer`,className:`stratus-drawer__header-btn`,onClick:e=>c?.(e),children:(0,l.jsx)(Me,{size:20})})]}),(0,l.jsx)(`hr`,{className:`stratus-drawer__divider`})]})}var Ct=(0,c.forwardRef)(function(e,t){let{open:n=!1,variant:r=`temporary`,placement:i=`left`,smallScreenSize:a=425,header:o,closable:s=!1,fullScreen:d=!1,initialFullScreen:f=!1,keepMounted:p=!1,transitionDuration:m=225,hideBackdrop:h=!1,disablePortal:g=!1,children:_,onClose:v,width:y=240,...b}=e,{cssProps:x,otherProps:S}=L(b),{className:C,style:w,...T}=S,E=$e(),D=r===`responsive`?E<a?`temporary`:`permanent`:r,O=D===`temporary`,k=D===`persistent`,j=D===`permanent`,[M,N]=(0,c.useState)(f),P=(0,c.useCallback)(()=>N(e=>!e),[]),[F,I]=(0,c.useState)(n),[R,z]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(n)I(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>z(!0))});else{z(!1);let e=setTimeout(()=>{p||I(!1)},O||k?m:0);return()=>clearTimeout(e)}},[n,p,m,O,k]);let B=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!n||!O)return;let e=e=>{e.key===`Escape`&&v?.(e)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n,O,v]),yt(B,n&&O),gt(n&&O);let V=(0,c.useId)(),H=typeof o==`string`||typeof o==`number`,U=Array.isArray(y)?(E<a?y[0]:y[1])??y[0]:y,W=typeof U==`number`?`${U}px`:U,G=i===`left`||i===`right`,ee={"--stratus-drawer-duration":`${m}ms`,...G?{width:M?`100%`:W}:{},...w,...x},te=ne(void 0,g);if(!(j||F||p))return null;let re=o!=null||s||d?(0,l.jsx)(St,{header:o,headerId:V,hasStringHeader:H,closable:s,fullScreen:d,isFullscreen:M,isTemporary:O,onToggleFullscreen:P,onClose:v}):null,ie=(0,l.jsxs)(`div`,{ref:e=>{B.current=e,typeof t==`function`?t(e):t&&(t.current=e)},role:O?`dialog`:void 0,"aria-modal":O&&n?!0:void 0,"aria-labelledby":O&&H?V:void 0,tabIndex:O?-1:void 0,className:A(`stratus-drawer`,`stratus-drawer--${D}`,`stratus-drawer--${i}`,R&&n||j?`stratus-drawer--open`:`stratus-drawer--closed`,M&&`stratus-drawer--fullscreen`,C),style:ee,...T,children:[re,_]});if(j||k)return(0,l.jsx)(`div`,{className:`stratus-drawer-container`,children:ie});let ae=(0,l.jsxs)(l.Fragment,{children:[!h&&(0,l.jsx)(`div`,{className:A(`stratus-drawer-backdrop`,R&&n&&`stratus-drawer-backdrop--open`),style:{"--stratus-drawer-duration":`${m}ms`},onClick:e=>v?.(e),"aria-hidden":!0}),ie]});return g?ae:te?(0,u.createPortal)(ae,te):null});Ct.displayName=`Drawer`;var wt={info:()=>(0,l.jsx)(Pe,{size:20,color:`currentColor`}),success:()=>(0,l.jsx)(je,{size:20,color:`currentColor`}),warning:()=>(0,l.jsx)(Fe,{size:20,color:`currentColor`}),error:()=>(0,l.jsx)(Ne,{size:20,color:`currentColor`})};function Tt({severity:e,message:t,actions:n,onClose:r}){return(0,l.jsxs)(l.Fragment,{children:[e&&(0,l.jsx)(`span`,{className:`stratus-notification__icon`,children:wt[e]()}),(0,l.jsx)(`div`,{className:`stratus-notification__content`,children:t}),n&&(0,l.jsx)(`div`,{className:`stratus-notification__actions`,children:n}),r&&(0,l.jsx)(`button`,{type:`button`,className:`stratus-notification__close`,"aria-label":`Close notification`,onClick:r,children:(0,l.jsx)(Me,{size:16})})]})}var Et=(0,c.forwardRef)(function(e,t){let{open:n,message:r,actions:i,autoHide:a=!0,autoHideDuration:o=6e3,showAutoHideLoader:s=!0,closeOnClickOutside:d=!1,placement:f=`bottom-start`,disablePortal:p=!1,onClose:m,severity:h,children:g,..._}=e,{cssProps:v,otherProps:y}=L(_),{className:b,style:x,...S}=y,C=(0,c.useRef)(null),w=(0,c.useRef)(null),T=(0,c.useRef)(0),E=(0,c.useRef)(o),D=(0,c.useCallback)(()=>{w.current&&=(clearTimeout(w.current),null)},[]),O=(0,c.useRef)(m);(0,c.useEffect)(()=>{O.current=m},[m]);let k=(0,c.useCallback)(e=>{D(),E.current=e,T.current=Date.now(),w.current=setTimeout(()=>{O.current?.()},e)},[D]);(0,c.useEffect)(()=>(n&&a?k(o):D(),D),[n,a,o,k,D]);let[j,M]=(0,c.useState)(!1),N=()=>{!a||!w.current||(E.current=Math.max(0,E.current-(Date.now()-T.current)),D(),M(!0))},P=()=>{!a||!n||w.current||(k(E.current),M(!1))};(0,c.useEffect)(()=>{if(!n||!d)return;let e=e=>{C.current&&!C.current.contains(e.target)&&m?.()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n,d,m]);let F=ne(void 0,p);if(!n)return null;let I=(0,l.jsxs)(`div`,{ref:e=>{C.current=e,typeof t==`function`?t(e):t&&(t.current=e)},className:A(`stratus-notification`,h?`stratus-notification--${h}`:g?void 0:`stratus-notification--default`,b),style:{...x,...v},onMouseEnter:N,onMouseLeave:P,...S,children:[g??(0,l.jsx)(Tt,{severity:h,message:r,actions:i,onClose:m}),a&&s&&(0,l.jsx)(`div`,{className:`stratus-notification__progress-wrap`,children:(0,l.jsx)(`div`,{className:A(`stratus-notification__progress`,j&&`stratus-notification__progress--paused`),style:{animationDuration:`${o}ms`}})})]}),R=(0,l.jsx)(`div`,{className:A(`stratus-notification-container`,`stratus-notification-container--${f}`),children:I});return p?R:F?(0,u.createPortal)(R,F):null}),Dt=0,Ot=new Map;function kt(){let e=document.getElementById(`stratus-notifications`);return e||(e=document.createElement(`div`),e.id=`stratus-notifications`,document.body.appendChild(e)),e}function At(e){let t=Ot.get(e);t&&(t.cleanup(),t.container.remove(),Ot.delete(e));let n=document.getElementById(`stratus-notifications`);n&&n.children.length===0&&n.remove()}function jt(e,t){let n=e.key??`stratus-notif-${++Dt}`,r=e.placement??`bottom-start`,i=e.autoHideDuration??6e3,a=e.showAutoHideLoader??!0;At(n);let o=kt(),s=document.createElement(`div`);s.setAttribute(`data-notification-id`,n),s.style.position=`fixed`,s.style.zIndex=String(e.zIndex??1400),s.style.pointerEvents=`none`;let c=r.split(`-`),l=c[0],u=c[1];l===`top`?(s.style.top=`16px`,s.style.bottom=`auto`):(s.style.bottom=`16px`,s.style.top=`auto`),u===`start`?(s.style.left=`16px`,s.style.right=`auto`):u===`end`?(s.style.right=`16px`,s.style.left=`auto`):(s.style.left=`50%`,s.style.transform=`translateX(-50%)`),o.appendChild(s);let d=document.createElement(`div`);if(d.className=A(`stratus-notification`,t?`stratus-notification--${t}`:`stratus-notification--default`),d.style.pointerEvents=`auto`,e.maxWidth&&(d.style.maxWidth=typeof e.maxWidth==`number`?`${e.maxWidth}px`:e.maxWidth),t){let e=document.createElement(`span`);e.className=`stratus-notification__icon`,e.innerHTML=Mt(t),d.appendChild(e)}let f=document.createElement(`div`);f.className=`stratus-notification__content`,f.textContent=String(e.message??``),d.appendChild(f);let p=document.createElement(`button`);p.className=`stratus-notification__close`,p.type=`button`,p.setAttribute(`aria-label`,`Close notification`),p.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>`,p.addEventListener(`click`,()=>At(n)),d.appendChild(p);let m=null;if(a){let e=document.createElement(`div`);e.className=`stratus-notification__progress-wrap`,m=document.createElement(`div`),m.className=`stratus-notification__progress`,m.style.animationDuration=`${i}ms`,e.appendChild(m),d.appendChild(e)}s.appendChild(d);let h=Date.now(),g=i,_=null;function v(e){_&&clearTimeout(_),g=e,h=Date.now(),_=setTimeout(()=>At(n),e),m?.classList.remove(`stratus-notification__progress--paused`)}function y(){_&&(clearTimeout(_),_=null,g=Math.max(0,g-(Date.now()-h)),m?.classList.add(`stratus-notification__progress--paused`))}function b(){_||v(g)}d.addEventListener(`mouseenter`,y),d.addEventListener(`mouseleave`,b),v(i),Ot.set(n,{container:s,cleanup:()=>{_&&clearTimeout(_)}})}function Mt(e){switch(e){case`info`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>`;case`success`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>`;case`warning`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>`;case`error`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>`}}var Nt=Et;Nt.show=e=>jt(e),Nt.info=e=>jt(e,`info`),Nt.success=e=>jt(e,`success`),Nt.warning=e=>jt(e,`warning`),Nt.error=e=>jt(e,`error`),Nt.displayName=`Notification`;function Pt({footer:e,okText:t,cancelText:n,onOk:r,onCancel:i}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`hr`,{className:`stratus-modal__divider`}),(0,l.jsx)(`div`,{className:`stratus-modal__footer`,children:e??(0,l.jsxs)(l.Fragment,{children:[typeof i==`function`&&(0,l.jsx)(H,{variant:typeof r==`function`?`ghost`:`outlined`,onClick:i,children:n}),typeof r==`function`&&(0,l.jsx)(H,{variant:`contained`,onClick:r,children:t})]})})]})}function Ft(){return(0,l.jsx)(Me,{size:20})}var It=(0,c.forwardRef)(function(e,t){let{open:n,showClose:r=!0,closeIcon:i,title:a,footer:o,okText:s=`Ok`,cancelText:d=`Cancel`,fullScreen:f=!1,keepMounted:p=!1,disablePortal:m=!1,zIndex:h,backdropProps:g,onClose:_,onOk:v,onCancel:y,children:b,...x}=e,S=g?.closable??!1,C=g?.invisible??!1,{cssProps:w,otherProps:T}=L(x),{className:E,style:D,...O}=T,[k,j]=(0,c.useState)(n),[M,N]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(n)j(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>N(!0))});else{N(!1);let e=setTimeout(()=>{p||j(!1)},200);return()=>clearTimeout(e)}},[n,p]),(0,c.useEffect)(()=>{if(!n||!S)return;let e=e=>{e.key===`Escape`&&_?.(e)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n,S,_]),gt(n);let P=(0,c.useRef)(null);yt(P,n);let F=(0,c.useId)(),I=typeof a==`string`||typeof a==`number`,R=e=>{e.target===e.currentTarget&&(g?.onClick?.(e),S&&_?.(e))},z=ne(void 0,m);if(!(k||p))return null;let B=a!=null||r,V=o!=null||typeof v==`function`||typeof y==`function`,U={...D,...w},W=(0,l.jsx)(`div`,{className:A(`stratus-modal-backdrop`,M&&n&&`stratus-modal-backdrop--open`,C&&`stratus-modal-backdrop--invisible`),style:h!=null||g?.style?{...h!=null&&{"--stratus-modal-z":Number(h)},...g?.style}:void 0,onClick:R,"aria-hidden":!n,children:(0,l.jsx)(`div`,{ref:e=>{P.current=e,typeof t==`function`?t(e):t&&(t.current=e)},role:`dialog`,"aria-modal":!0,"aria-labelledby":I?F:void 0,tabIndex:-1,className:A(`stratus-modal`,f&&`stratus-modal--fullscreen`,E),style:U,...O,children:(0,l.jsxs)(`div`,{className:`stratus-modal__container`,children:[B&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`stratus-modal__header`,children:[a!=null&&(0,l.jsx)(`span`,{id:I?F:void 0,className:`stratus-modal__header-title`,children:a}),r&&(0,l.jsx)(H,{variant:`ghost`,"aria-label":`Close modal`,className:`stratus-modal__header-close`,onClick:e=>_?.(e),startAdornment:i??(0,l.jsx)(Ft,{})})]}),(0,l.jsx)(`hr`,{className:`stratus-modal__divider`})]}),(0,l.jsx)(`div`,{className:A(`stratus-modal__content`,f&&`stratus-modal__content--fullscreen`),children:(0,l.jsx)(`div`,{className:`stratus-modal__content-inner`,children:b})}),V&&(0,l.jsx)(Pt,{footer:o,okText:s,cancelText:d,onOk:v,onCancel:y})]})})});return m?W:z?(0,u.createPortal)(W,z):null});It.displayName=`Modal`;function Lt({size:e=48}){let t=e*1.2;return(0,l.jsxs)(`svg`,{className:`stratus-screen-loader__star-progress`,role:`progressbar`,"aria-label":`Loading`,"aria-valuetext":`Loading`,width:e,height:t,viewBox:`0 0 40 48`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,preserveAspectRatio:`xMidYMid meet`,style:e?{"--stratus-screen-loader-size":`${e}px`}:void 0,children:[(0,l.jsx)(`path`,{d:`M32.756 34.6798L29.482 36.5817C29.4139 36.6219 29.3295 36.6227 29.2606 36.5829L25.9476 34.7151C25.7975 34.6306 25.7967 34.4149 25.9456 34.3284L29.2397 32.4256C29.3077 32.3858 29.3914 32.3858 29.4603 32.4248L32.754 34.2931C32.9033 34.3784 32.9041 34.5929 32.756 34.6798Z`}),(0,l.jsx)(`path`,{d:`M25.9596 45.4706L22.6655 43.5867C22.5966 43.5469 22.554 43.4744 22.554 43.396V41.4289V39.5922C22.5519 39.4204 22.7381 39.3109 22.8878 39.397L26.1819 41.2981C26.25 41.3379 26.2926 41.4104 26.2934 41.4896V43.4268V45.2762C26.2947 45.4472 26.1085 45.5559 25.9596 45.4706Z`}),(0,l.jsx)(`path`,{d:`M12.3022 47.7037V44.9795V42.6544C12.3022 42.5495 12.3576 42.4515 12.4482 42.3986L14.1262 41.4062L16.8143 39.8188C17.0119 39.7019 17.2617 39.8442 17.2625 40.0739L17.2633 42.7627V45.1456C17.2633 45.251 17.2079 45.3486 17.1165 45.4015L12.7496 47.9587C12.552 48.0748 12.3031 47.9325 12.3022 47.7037Z`}),(0,l.jsx)(`path`,{d:`M0.221343 34.2106L6.76939 30.4056C6.90636 30.326 7.07449 30.3256 7.21227 30.4023L13.8378 34.1401C14.138 34.3095 14.14 34.7413 13.8415 34.9131L7.25492 38.7182C7.11795 38.7977 6.94941 38.7985 6.81204 38.7206L0.225854 34.9836C-0.0734986 34.8139 -0.075549 34.3833 0.221343 34.2106Z`}),(0,l.jsx)(`path`,{d:`M6.03876 9.125L16.9237 15.5151C17.1513 15.6484 17.2903 15.8912 17.2903 16.1549V28.8331C17.2903 29.4076 16.665 29.7647 16.1704 29.4728L5.28546 23.0264C5.05869 22.8919 4.92008 22.6479 4.9209 22.3855V9.76307C4.92254 9.1902 5.54503 8.83467 6.03876 9.125Z`}),(0,l.jsx)(`path`,{d:`M39.6262 1.07261V11.7603V19.3368C39.627 19.7178 39.4265 20.0709 39.0988 20.2644L31.4145 24.8195L23.3545 29.5964C22.6385 30.0192 21.7339 29.5029 21.7339 28.6717V10.3259C21.7339 9.94495 21.9356 9.5927 22.2641 9.39955L38.008 0.149533C38.7232 -0.270381 39.6241 0.24385 39.6262 1.07261Z`})]})}var Rt=R((e,t)=>{let{cssProps:n,otherProps:r}=L(e),{as:i,className:a,children:o,loader:s,sizeLoader:c,title:d,backdropInvisible:f=!1,container:p,disablePortal:m=!1,zIndex:h,style:g,..._}=r,{Component:v,rootProps:y}=k(`div`,{as:i}),b=ne(p,m),x={...g,...n,...h==null?{}:{"--stratus-screen-loader-z":String(h)}},S=(0,l.jsx)(v,{ref:t,className:A(`stratus-screen-loader`,f&&`stratus-screen-loader--invisible`,a),role:`status`,"aria-live":`polite`,"aria-busy":`true`,style:Object.keys(x).length?x:void 0,...y,..._,children:(0,l.jsxs)(`div`,{className:`stratus-screen-loader__content`,children:[s??(0,l.jsx)(Lt,{size:c}),d!=null&&(0,l.jsx)(Se,{className:`stratus-screen-loader__title`,variant:`h3`,as:`div`,children:d}),o!=null&&(0,l.jsx)(`div`,{className:`stratus-screen-loader__children`,children:o})]})});return m?S:b?(0,u.createPortal)(S,b):null});Rt.displayName=`ScreenLoader`;function zt(){return(0,l.jsx)(Me,{size:16})}var Bt=(0,c.forwardRef)(function(e,t){let{children:n,className:r,content:i,title:a,showClose:o=!1,closeIcon:s,footer:u,placement:d=`bottom`,trigger:f=`click`,open:p,arrow:m=!0,closeOnClickOutside:h=!0,tooltipRef:g,zIndex:_=1400,maxWidth:v=`300px`,style:y,keepMounted:b=!1,disablePortal:x=!1,onOpen:S,onClose:C}=e,w=(0,c.useRef)(null),T=g??w,E=a!=null||o,D=(0,l.jsxs)(`div`,{className:`stratus-popover__container`,children:[E&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`stratus-popover__header`,children:[a!=null&&(0,l.jsx)(`span`,{className:`stratus-popover__header-title`,children:a}),o&&(0,l.jsx)(H,{variant:`ghost`,"aria-label":`Close popover`,className:`stratus-popover__header-close`,onClick:()=>{T&&`current`in T&&T.current?.close()},children:s??(0,l.jsx)(zt,{})})]}),(0,l.jsx)(`hr`,{className:`stratus-popover__divider`})]}),(0,l.jsx)(`div`,{className:`stratus-popover__content`,children:i}),u!=null&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`hr`,{className:`stratus-popover__divider`}),(0,l.jsx)(`div`,{className:`stratus-popover__footer`,children:u})]})]});return(0,l.jsx)(K,{ref:t,className:A(`stratus-popover`,r),content:D,placement:d,trigger:f,open:p,arrow:m,closeOnClickOutside:h,tooltipRef:T,zIndex:_,maxWidth:v,fontSize:`1rem`,style:y,keepMounted:b,disablePortal:x,onOpen:S,onClose:C,children:n})});Bt.displayName=`Popover`;function Vt({helperText:e,helperIcon:t}){return e?(0,l.jsxs)(`div`,{className:`stratus-input__helper`,children:[t&&(0,l.jsx)(`span`,{className:`stratus-input__helper-icon`,children:t}),(0,l.jsx)(`span`,{children:e})]}):null}function Ht({label:e,meta:t,htmlFor:n}){return!e&&!t?null:(0,l.jsxs)(`div`,{className:`stratus-input__label-row`,children:[e&&(0,l.jsx)(`label`,{className:`stratus-input__label`,htmlFor:n,children:e}),t&&(0,l.jsx)(`span`,{className:`stratus-input__meta`,children:t})]})}var Ut=(0,c.forwardRef)(function(e,t){let{children:n,className:r,style:i,inputRef:a,inputProps:o={},type:s=`text`,variant:u=`default`,label:d,meta:f,helperText:p,helperIcon:m,value:h,defaultValue:g,placeholder:_,startAdornment:v,endAdornment:y,outlineWidth:b,multiple:x=!1,compact:S=!1,fullWidth:C=!1,forceFocus:w=!1,disabled:T=!1,onChange:E,onFocus:D,onBlur:O,...k}=e,{cssProps:j,otherProps:M}=L(k),N=(0,c.useId)(),P=o.id??N,[F,I]=(0,c.useState)(g??``),R=h!==void 0,z=R?h:F,B=(0,c.useRef)(null),V=(0,c.useCallback)(e=>{B.current=e,a&&(a.current=e)},[a]),H=e=>{let t=e.target.value;R||I(t),E?.(t,e)},U=e=>{D?.(String(z),e)},W=e=>{O?.(String(z),e)},G=A(`stratus-input`,`stratus-input--${u}`,S&&`stratus-input--compact`,C&&`stratus-input--full-width`,T&&`stratus-input--disabled`,w&&`stratus-input--force-focus`,r),ee={...b?{"--stratus-input-outline-w":b}:{},...i,...j},te=x?`textarea`:`input`;return(0,l.jsxs)(`div`,{ref:t,className:G,style:Object.keys(ee).length?ee:void 0,...M,children:[(0,l.jsx)(Ht,{label:d,meta:f,htmlFor:P}),(0,l.jsxs)(`div`,{className:`stratus-input__wrapper`,children:[v&&(0,l.jsx)(`span`,{className:`stratus-input__start-adornment`,children:v}),n??(0,l.jsx)(te,{...o,ref:V,id:P,type:x?void 0:s,className:A(`stratus-input__input`,x&&`stratus-input__input--textarea`,o.className),value:z,placeholder:_,disabled:T,onChange:H,onFocus:U,onBlur:W}),y&&(0,l.jsx)(`span`,{className:`stratus-input__end-adornment`,children:y})]}),(0,l.jsx)(Vt,{helperText:p,helperIcon:m})]})}),Wt=(0,c.forwardRef)(function(e,t){let{inputRef:n,inputProps:r={},defaultChecked:i=!1,checked:a,variant:o=`default`,label:s,labelPlacement:u=`right`,color:d=`primary`,compact:f=!1,disabled:p=!1,disableRipple:m=!1,onChange:h,...g}=e,{cssProps:_,otherProps:v}=L(g),{className:y,style:b,...x}=v,[S,C]=(0,c.useState)(i),w=a!==void 0,T=w?a:S,E=(0,c.useRef)(null),D=(0,c.useCallback)(e=>{E.current=e,n&&(n.current=e)},[n]),O=e=>{w||C(e.target.checked),h?.(e)},k=A(`stratus-switch`,o===`small`&&`stratus-switch--small`,`stratus-switch--${d}`,f&&`stratus-switch--compact`,p&&`stratus-switch--disabled`,m&&`stratus-switch--no-ripple`,y),j={...b,..._},M=s?(0,l.jsx)(`span`,{className:`stratus-switch__label`,children:s}):null;return(0,l.jsxs)(`label`,{ref:t,className:k,style:Object.keys(j).length?j:void 0,...x,children:[u===`left`&&M,(0,l.jsx)(`input`,{...r,ref:D,type:`checkbox`,role:`switch`,className:`stratus-switch__input`,checked:T,disabled:p,onChange:O}),(0,l.jsx)(`span`,{className:`stratus-switch__track-wrapper`,children:(0,l.jsx)(`span`,{className:`stratus-switch__track`,children:(0,l.jsx)(`span`,{className:`stratus-switch__thumb`})})}),u===`right`&&M]})});function Gt({size:e}){return(0,l.jsx)(`svg`,{className:`stratus-checkbox__icon stratus-checkbox__icon--unchecked`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`var(--stratus-surface, #fff)`,stroke:`currentColor`,strokeWidth:`2`})})}function Kt({size:e}){return(0,l.jsxs)(`svg`,{className:`stratus-checkbox__icon stratus-checkbox__icon--checked`,width:e,height:e,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`currentColor`}),(0,l.jsx)(`path`,{d:`M9 12l2 2 4-4`,stroke:`white`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function qt({size:e}){return(0,l.jsxs)(`svg`,{className:`stratus-checkbox__icon stratus-checkbox__icon--indeterminate`,width:e,height:e,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`currentColor`}),(0,l.jsx)(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`,stroke:`white`,strokeWidth:`2`,strokeLinecap:`round`})]})}var Jt=(0,c.forwardRef)(function(e,t){let{className:n,style:r,inputRef:i,inputProps:a={},defaultChecked:o=!1,checked:s,label:u,labelPlacement:d=`right`,color:f=`primary`,indeterminate:p=!1,uncheckedIcon:m,checkedIcon:h,indeterminateIcon:g,iconSize:_=24,compact:v=!1,disabled:y=!1,disableRipple:b=!1,onChange:x,...S}=e,{cssProps:C,otherProps:w}=L(S),[T,E]=(0,c.useState)(o),D=s!==void 0,O=D?s:T,k=(0,c.useRef)(null),j=(0,c.useCallback)(e=>{k.current=e,i&&(i.current=e)},[i]);(0,c.useEffect)(()=>{k.current&&(k.current.indeterminate=p)},[p]);let M=e=>{D||E(e.target.checked),x?.(e)},N=(0,c.useRef)(null),P=e=>{b||y||e.button===0&&N.current?.triggerAt(e.clientX,e.clientY)},F;F=p?g??(0,l.jsx)(qt,{size:_}):O?h??(0,l.jsx)(Kt,{size:_}):m??(0,l.jsx)(Gt,{size:_});let I=A(`stratus-checkbox`,`stratus-checkbox--${f}`,v&&`stratus-checkbox--compact`,y&&`stratus-checkbox--disabled`,b&&`stratus-checkbox--no-ripple`,n),R={...r,...C},z=u?(0,l.jsx)(`span`,{className:`stratus-checkbox__label`,children:u}):null;return(0,l.jsxs)(`label`,{ref:t,className:I,style:Object.keys(R).length?R:void 0,onPointerDown:P,...w,children:[d===`left`&&z,(0,l.jsx)(`input`,{...a,ref:j,type:`checkbox`,className:`stratus-checkbox__input`,checked:O,disabled:y,onChange:M,"data-indeterminate":p||void 0}),(0,l.jsxs)(`span`,{className:`stratus-checkbox__icon-wrapper`,children:[(0,l.jsx)(V,{ref:N,disabled:b||y}),F]}),d===`right`&&z]})});function Yt(){return(0,l.jsx)(`span`,{className:`stratus-select__chevron`,children:(0,l.jsx)(`svg`,{width:`10`,height:`5`,viewBox:`0 0 10 5`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M0 0l5 5 5-5z`})})})}function Xt({onClear:e,label:t=`Clear`}){return(0,l.jsx)(`button`,{type:`button`,className:`stratus-select__clear`,onClick:e,"aria-label":t,children:`✕`})}function Zt({helperText:e,helperIcon:t}){return e?(0,l.jsxs)(`div`,{className:`stratus-select__helper`,children:[t&&(0,l.jsx)(`span`,{className:`stratus-input__helper-icon`,children:t}),(0,l.jsx)(`span`,{children:e})]}):null}function Qt({label:e,meta:t,htmlFor:n}){return!e&&!t?null:(0,l.jsxs)(`div`,{className:`stratus-select__label-row`,children:[e&&(0,l.jsx)(`label`,{className:`stratus-select__label`,htmlFor:n,children:e}),t&&(0,l.jsx)(`span`,{className:`stratus-select__meta`,children:t})]})}function $t(e){return e==null||e===``?[]:Array.isArray(e)?e.filter(e=>e!==``&&e!=null):[e]}function en(e){let t=[];for(let n of e)n.type===`optgroup`&&n.options?t.push(...en(n.options)):t.push(n);return t}function tn(e){return String(e.value??e.label)}function nn(e){let t=[];return c.Children.forEach(e,e=>{if((0,c.isValidElement)(e)){if(e.type===`option`){let{value:n,disabled:r,children:i}=e.props;t.push({label:String(i??``),value:n===void 0?String(i??``):n,disabled:!!r})}else if(e.type===`optgroup`){let{label:n,disabled:r,children:i}=e.props;t.push({type:`optgroup`,label:String(n??``),disabled:!!r,options:nn(i)})}}}),t}function rn({tags:e,infield:t,selectedIds:n,allFlat:r,tagMaxCount:i,tagMaxCountPlaceholder:a,selectedLabel:o,onTagRemove:s}){if(e&&t){if(n.length===0)return null;let e=r.filter(e=>n.map(String).includes(String(tn(e))));if(i!==void 0&&e.length>i){let t=typeof a==`function`?a(e.length):a??`${e.length} selected`;return(0,l.jsx)(`div`,{className:`stratus-select__tags`,children:(0,l.jsx)(`span`,{className:`stratus-select__tag`,children:t})})}return(0,l.jsx)(`div`,{className:`stratus-select__tags`,children:e.map(e=>(0,l.jsxs)(`span`,{className:`stratus-select__tag`,children:[e.label,(0,l.jsx)(`button`,{type:`button`,className:`stratus-select__tag-close`,onClick:t=>s(tn(e),t),children:`✕`})]},tn(e)))})}if(t){let e=typeof o==`function`?o(n.length,r.length):`${n.length}/${r.length} ${o}`;return(0,l.jsx)(`span`,{className:`stratus-select__selected-label`,children:e})}return null}var an=(0,c.forwardRef)(function(e,t){let{children:n,className:r,style:i,selectRef:a,inputRef:o,options:s=[],value:d,defaultValue:f,inputValue:p,variant:m=`default`,label:h,meta:g,placeholder:_,helperText:v,helperIcon:y,startAdornment:b,endAdornment:x,allowClear:S=!0,clearLabel:C,multiple:w=!1,expandable:T=!1,infield:E=!0,tags:D=!1,tagMaxCount:O,tagMaxCountPlaceholder:k,selectedLabel:j=`Selected`,filterOption:M=!0,noOptionsText:N=`No Data`,hideDropdownWhenEmpty:P=!1,persistInputText:F=!1,compact:I=!1,fullWidth:R=!1,disablePortal:z=!1,disabled:B=!1,onSelect:V,onDeselect:H,onClear:U,onChange:W,itemGroupRenderer:G,itemRenderer:ee,...te}=e,{cssProps:re,otherProps:ie}=L(te),ae=(0,c.useId)(),[K,oe]=(0,c.useState)(!1),[se,q]=(0,c.useState)(()=>$t(f)),[ce,le]=(0,c.useState)(``),[ue,de]=(0,c.useState)(-1),[fe,pe]=(0,c.useState)(new Set),me=d!==void 0,J=me?$t(d):se,he=p===void 0?ce:p,ge=(0,c.useRef)(null),_e=(0,c.useRef)(null),ve=(0,c.useRef)(null),ye=(0,c.useRef)(null),[be,xe]=(0,c.useState)({}),Se=(0,c.useCallback)(e=>{ge.current=e,o&&(o.current=e)},[o]);(0,c.useImperativeHandle)(a,()=>({open:()=>{oe(!0),ge.current?.focus()},close:()=>oe(!1)}),[]),(0,c.useEffect)(()=>{if(!K)return;let e=e=>{let t=e.target,n=_e.current?.contains(t),r=ye.current?.contains(t);!n&&!r&&(oe(!1),le(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[K]),(0,c.useLayoutEffect)(()=>{if(!K||z)return;let e=()=>{let e=ve.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom-2,r=t.top-2,i=n<Math.min(256,r)&&r>n,a=Math.max(0,i?r:n);xe({position:`fixed`,left:t.left,width:t.width,maxHeight:Math.min(256,a),...i?{bottom:window.innerHeight-t.top+2}:{top:t.bottom+2}})};return e(),window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[K,z]);let Ce=(0,c.useMemo)(()=>nn(n),[n]),we=(0,c.useMemo)(()=>s.length>0?s:Ce,[s,Ce]),Te=(0,c.useMemo)(()=>en(we),[we]),Ee=(0,c.useCallback)(e=>!M||!he?!0:typeof M==`function`?M(e,he,J.map(String)):e.label.toLowerCase().includes(he.toLowerCase()),[M,he,J]),De=(0,c.useMemo)(()=>Te.filter(e=>!e.disabled&&Ee(e)),[Te,Ee]);(0,c.useEffect)(()=>{if(!K){de(-1);return}let e=De.findIndex(e=>J.map(String).includes(tn(e)));de(e)},[K]),(0,c.useEffect)(()=>{K&&de(e=>e>De.length-1?-1:e)},[De.length]),(0,c.useEffect)(()=>{if(ue<0||!ye.current)return;let e=De[ue];if(!e)return;let t=String(e.value??e.label);ye.current.querySelector(`[data-option-id="${CSS.escape(t)}"]`)?.scrollIntoView({block:`nearest`})},[ue,De]);let Oe=(0,c.useMemo)(()=>w||J.length===0?``:Te.find(e=>String(e.value??e.label)===String(J[0]))?.label??String(J[0]),[w,J,Te]),ke=(0,c.useCallback)((e,t)=>{let n=tn(e),r=J.map(String).includes(String(n)),i;if(w){if(r){i=J.filter(e=>String(e)!==String(n)),me||q(i);let r={selectedValue:i,deselectedValue:e.value??e.label,options:Te.filter(e=>i.map(String).includes(String(tn(e))))};H?.(r,t)}else{i=[...J,e.value??e.label],me||q(i);let n={selectedValue:i,options:Te.filter(e=>i.map(String).includes(String(tn(e))))};V?.(n,t)}}else{i=[e.value??e.label],me||q(i),oe(!1),le(``);let n={selectedValue:e.value??e.label,options:[e]};V?.(n,t)}},[J,w,me,Te,V,H]),Ae=(0,c.useCallback)(e=>{if(!B)switch(e.key){case`ArrowDown`:e.preventDefault(),K?de(e=>e<De.length-1?e+1:0):oe(!0);break;case`ArrowUp`:e.preventDefault(),K&&de(e=>e>0?e-1:De.length-1);break;case`Enter`:if(e.preventDefault(),K&&ue>=0){let t=De[ue];t&&ke(t,e)}else K||oe(!0);break;case`Escape`:K&&(e.preventDefault(),oe(!1))}},[B,K,ue,De,ke]),je=(0,c.useCallback)(e=>{e.stopPropagation(),me||q([]),le(``),U?.(e)},[me,U]),Me=(0,c.useCallback)((e,t)=>{t.stopPropagation();let n=Te.find(t=>String(tn(t))===String(e));n&&ke(n,t)},[Te,ke]),Ne=(0,c.useCallback)(e=>{pe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Pe=(0,c.useCallback)(e=>{if(!M)return;let t=e.target.value;le(t),W?.(t),K||oe(!0)},[M,K,W]);function Fe(e){let t=[];for(let n of e){if(n.type===`optgroup`&&n.options){let e=Fe(n.options).filter(Boolean);if(e.length===0)continue;let r=T&&fe.has(n.label);G?t.push(G(n,r?[]:e,he)):t.push((0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:A(`stratus-select__optgroup-label`,T&&`stratus-select__optgroup--expandable`),onClick:T?()=>Ne(n.label):void 0,children:[T&&(0,l.jsx)(`span`,{className:A(`stratus-select__optgroup-chevron`,r&&`stratus-select__optgroup-chevron--collapsed`),children:(0,l.jsx)(`svg`,{width:`10`,height:`5`,viewBox:`0 0 10 5`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M0 0l5 5 5-5z`})})}),n.label]}),!r&&e]},`group-${n.label}`));continue}if(!Ee(n))continue;let e=tn(n),r=J.map(String).includes(String(e)),i=De[ue]===n;ee?t.push((0,l.jsx)(`div`,{"data-option-id":e,className:A(i&&`stratus-select__option--highlighted`),onClick:n.disabled?void 0:e=>ke(n,e),children:ee(n,he,J.map(String))},e)):t.push((0,l.jsxs)(`div`,{"data-option-id":e,className:A(`stratus-select__option`,r&&`stratus-select__option--selected`,i&&`stratus-select__option--highlighted`,n.disabled&&`stratus-select__option--disabled`),onClick:n.disabled?void 0:e=>ke(n,e),children:[w&&(0,l.jsx)(`span`,{className:A(`stratus-select__checkbox`,r&&`stratus-select__checkbox--checked`,n.disabled&&`stratus-select__checkbox--disabled`),"aria-hidden":`true`,children:r&&(0,l.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`10`,height:`10`,children:(0,l.jsx)(`path`,{d:`M3 8.5l3 3 7-7`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),(0,l.jsx)(`span`,{className:`stratus-select__option-label`,title:n.label,children:n.label})]},e))}return t}let Ie=ne(void 0,z),Le=Fe(we),Re=Le.length>0,ze=K&&!(P&&!Re)?(0,l.jsx)(`div`,{ref:ye,className:A(`stratus-select__dropdown`,!z&&`stratus-select__dropdown--portal`),style:z?void 0:be,children:Re?Le:(0,l.jsx)(`div`,{className:`stratus-select__no-data`,children:N})}):null,Be=z?ze:ze&&Ie?(0,u.createPortal)(ze,Ie):null,Ve=A(`stratus-select`,`stratus-select--${m}`,I&&`stratus-select--compact`,R&&`stratus-select--full-width`,B&&`stratus-select--disabled`,K&&`stratus-select--open`,M&&`stratus-select--filterable`,r),He={...i,...re},Ue=J.length>0||he&&he.length>0;return(0,l.jsxs)(`div`,{ref:e=>{_e.current=e,typeof t==`function`?t(e):t&&(t.current=e)},className:Ve,style:Object.keys(He).length?He:void 0,...ie,children:[(0,l.jsx)(Qt,{label:h,meta:g,htmlFor:ae}),(0,l.jsxs)(`div`,{ref:ve,className:`stratus-select__input-wrapper`,onClick:()=>{B||(oe(e=>!e),ge.current?.focus())},onKeyDown:Ae,children:[b&&(0,l.jsx)(`span`,{className:`stratus-input__start-adornment`,children:b}),w&&D&&E&&J.length>0?(0,l.jsx)(rn,{tags:D,infield:E,selectedIds:J,allFlat:Te,tagMaxCount:O,tagMaxCountPlaceholder:k,selectedLabel:j,onTagRemove:Me}):null,w&&!D&&E?(0,l.jsx)(rn,{tags:D,infield:E,selectedIds:J,allFlat:Te,tagMaxCount:O,tagMaxCountPlaceholder:k,selectedLabel:j,onTagRemove:Me}):null,!(w&&D&&E&&J.length>0)&&!(w&&!D&&E)&&(0,l.jsx)(`input`,{ref:Se,id:ae,type:`text`,className:`stratus-select__input`,value:M&&he!==``&&(K||F)?he:Oe,placeholder:J.length>0?void 0:_,disabled:B,onChange:Pe,autoComplete:`off`}),x&&(0,l.jsx)(`span`,{className:`stratus-input__end-adornment`,children:x}),S&&Ue&&!B&&(0,l.jsx)(Xt,{onClear:je,label:C}),(0,l.jsx)(Yt,{})]}),Be,(0,l.jsx)(Zt,{helperText:v,helperIcon:y})]})}),on=new Set([`default`,`primary`,`secondary`,`success`,`warning`,`danger`,`disabled`]),sn=R((e,t)=>{let{as:n,color:r,underline:i=`hover`,...a}=e,{cssProps:o,otherProps:s}=L(a),{className:c,style:u,rel:d,target:f,...p}=s,m=n??`a`,h=r&&on.has(r),g=r&&!h,_=f&&m===`a`?Array.from(new Set([...String(d??``).split(/\s+/).filter(Boolean),`noreferrer`,`noopener`])).join(` `):d,v=A(`stratus-link`,h&&`stratus-link--${r}`,`stratus-link--underline-${i}`,c),y={...u,...o,...g?{color:r}:{}};return(0,l.jsx)(m,{ref:t,className:v,style:Object.keys(y).length?y:void 0,...p,target:f,rel:_})});sn.displayName=`Link`;var cn=(0,c.forwardRef)(function(e,t){let{className:n,style:r,label:i,icon:a,disabled:o=!1,disableRipple:s=!1,children:u,color:d,...f}=e,{cssProps:p,otherProps:m}=L(f),h=(0,c.useRef)(null),g=e=>{m.onPointerDown?.(e),!(e.defaultPrevented||o||s)&&e.button===0&&h.current?.triggerAt(e.clientX,e.clientY)},_={...r,...p};return(0,l.jsxs)(`button`,{ref:t,type:`button`,className:A(`stratus-tab`,n),style:Object.keys(_).length?_:void 0,disabled:o,"aria-disabled":o||void 0,...m,onPointerDown:g,children:[a,i,!o&&!s&&(0,l.jsx)(V,{ref:h})]})}),ln=new Set([`primary`,`secondary`,`success`,`warning`,`danger`]),un=(0,c.forwardRef)(function(e,t){let{className:n,style:r,tabsListAs:i=`div`,selectedTab:a,orientation:o=`horizontal`,textColor:s=`primary`,indicatorColor:u=`primary`,align:d=`flex-start`,fullWidth:f=!1,disabled:p=!1,onChange:m,children:h,...g}=e,{cssProps:_,otherProps:v}=L(g),y={...r,..._},b=ln.has(u),x=c.Children.toArray(h).map((e,t)=>{if(!(0,c.isValidElement)(e))return e;let n=e;return(0,c.cloneElement)(n,{className:A(n.props.className,t===a&&`stratus-tab--active`,s&&`stratus-tab--${s}`),color:s,disabled:p||n.props.disabled,onClick:e=>{m?.(t,e);let r=n.props.onClick;r?.(e)}})}),S=c.Children.toArray(h).map((e,t)=>{if(!(0,c.isValidElement)(e))return null;let n=e.props.children;if(!n)return null;let r=a!==t;return(0,l.jsx)(`div`,{className:A(`stratus-tabs__panel`,r&&`stratus-tabs__panel--hidden`),hidden:r,"aria-hidden":r,children:n},`stratus-tabs__panel--${t}`)}),C=S.some(Boolean);return(0,l.jsxs)(`div`,{className:A(`stratus-tabs-root`,`stratus-tabs-root--${o}`),children:[(0,l.jsx)(`div`,{ref:t,className:A(`stratus-tabs`,`stratus-tabs--${o}`,n),style:Object.keys(y).length?y:void 0,...v,children:(0,l.jsx)(`div`,{className:A(`stratus-tabs__container`,`stratus-tabs__container--${o}`),children:(0,l.jsx)(i,{className:A(`stratus-tabs__list`,`stratus-tabs__list--${o}`,f&&`stratus-tabs__list--fullwidth`,`stratus-tabs__indicator--${o}`,b&&`stratus-tabs__indicator--${u}`),style:{justifyContent:d},children:x})})}),C&&S]})}),dn=new Set([0,1,2,3,4,5,6,8,12,16,24]);function fn(e){let t=Math.round(e*.5),n=Math.round(e*.7),r=Math.round(e*-.2),i=e,a=Math.round(e*1.5),o=Math.round(e*.1),s=Math.round(e*1.8),c=Math.round(e*.35);return[`0px ${t}px ${n}px ${r}px rgba(0,0,0,0.2)`,`0px ${i}px ${a}px ${o}px rgba(0,0,0,0.14)`,`0px ${Math.round(e*.3)}px ${s}px ${c}px rgba(0,0,0,0.12)`].join(`,`)}var pn=R((e,t)=>{let{as:n,elevation:r=2,square:i=!1,...a}=e,{cssProps:o,otherProps:s}=L(a),{className:c,style:u,...d}=s,f=n??`div`,p=dn.has(r),m={...u,...o,...!p&&r>0?{boxShadow:fn(r)}:{}},h=A(`stratus-paper`,i&&`stratus-paper--square`,p&&`stratus-paper--elevation-${r}`,c);return(0,l.jsx)(f,{ref:t,className:h,style:Object.keys(m).length?m:void 0,...d})});pn.displayName=`Paper`;var mn=G({name:`search`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M14.966 14.255h.79l4.99 5-1.49 1.49-5-4.99v-.79l-.27-.28a6.47 6.47 0 0 1-4.23 1.57 6.5 6.5 0 1 1 6.5-6.5c0 1.61-.59 3.09-1.57 4.23zm-9.71-4.5c0 2.49 2.01 4.5 4.5 4.5s4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5-4.5 2.01-4.5 4.5`});function hn(){return(0,l.jsx)(mn,{size:16})}var gn=(0,c.forwardRef)(function(e,t){let{className:n,inputValue:r,placeholder:i=`Search`,emptyOnStartTyping:a=!1,onSelect:o,onChange:s,onClear:u,filterOption:d=!0,hideDropdownWhenEmpty:f=!0,...p}=e,[,m]=(0,c.useState)(``),[h,g]=(0,c.useState)(r??``);return(0,c.useEffect)(()=>{r!==void 0&&g(r)},[r]),(0,l.jsx)(an,{ref:t,className:A(`stratus-input-search`,n),startAdornment:(0,l.jsx)(hn,{}),inputValue:h,placeholder:i,filterOption:d,hideDropdownWhenEmpty:f,persistInputText:!0,onSelect:(e,t)=>{if(!a&&e.selectedValue!=null){let t=e.options.find(t=>String(t.value??t.label)===String(e.selectedValue));t&&(m(t.label),g(t.label))}o?.(e,t)},onChange:e=>{g(a?``:e),s?.(e)},onClear:e=>{g(``),m(``),u?.(e)},...p})});function _n(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&bn(e.charCodeAt(r-1))&&yn(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=_n(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function vn(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&bn(e.charCodeAt(i-1))&&yn(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=vn(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function yn(e){return e>=56320&&e<57344}function bn(e){return e>=55296&&e<56320}var Y=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return _n(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return vn(this,e,t,n)}findIndex(e){if(e==0)return Sn(0,e);if(e==this.size)return Sn(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Sn(t+1,i):Sn(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};Y.empty=new Y([],0);var xn={index:0,offset:0};function Sn(e,t){return xn.index=e,xn.offset=t,xn}function Cn(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Cn(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Cn(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var wn=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Cn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};wn.none=[];var Tn=class extends Error{},X=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Dn(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(En(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(Y.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};X.empty=new X(Y.empty,0,0);function En(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(En(a.content,t-i-1,n-i-1)))}function Dn(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=Dn(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function On(e,t,n){if(n.openStart>e.depth)throw new Tn(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Tn(`Inconsistent open depths`);return kn(e,t,n,0)}function kn(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=kn(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Pn(a,In(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Pn(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=Ln(n,e);return Pn(a,Fn(e,i,o,t,r))}}function An(e,t){if(!t.type.compatibleContent(e.type))throw new Tn(`Cannot join `+t.type.name+` onto `+e.type.name)}function jn(e,t,n){let r=e.node(n);return An(r,t.node(n)),r}function Mn(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Nn(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Mn(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Mn(i.child(e),r);t&&t.depth==n&&t.textOffset&&Mn(t.nodeBefore,r)}function Pn(e,t){if(!e.type.validContent(t))throw new Tn(`Invalid content for node `+e.type.name);return e.copy(t)}function Fn(e,t,n,r,i){let a=e.depth>i&&jn(e,t,i+1),o=r.depth>i&&jn(n,r,i+1),s=[];return Nn(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(An(a,o),Mn(Pn(a,Fn(e,t,n,r,i+1)),s)):(a&&Mn(Pn(a,In(e,t,i+1)),s),Nn(t,n,i,s),o&&Mn(Pn(o,In(n,r,i+1)),s)),Nn(r,null,i,s),new Y(s)}function In(e,t,n){let r=[];return Nn(null,e,n,r),e.depth>n&&Mn(Pn(jn(e,t,n+1),In(e,t,n+1)),r),Nn(t,null,n,r),new Y(r)}function Ln(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Y.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Rn=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return wn.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Hn(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Vn.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Vn.set(t,r=new zn);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Bn,i}},zn=class{constructor(){this.elts=[],this.i=0}},Bn=12,Vn=new WeakMap,Hn=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Un=Object.create(null),Wn=class e{constructor(e,t,n,r=wn.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Y.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Cn(this.attrs,t||e.defaultAttrs||Un)&&wn.sameSet(this.marks,n||wn.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return X.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new X(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return On(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Rn.resolveCached(this,e)}resolveNoCache(e){return Rn.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Gn(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=Y.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=wn.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!wn.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=Y.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Wn.prototype.text=void 0;function Gn(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Kn=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new qn(t,n);if(r.next==null)return e.empty;let i=Jn(r);r.next&&r.err(`Unexpected trailing text`);let a=ir(tr(i));return ar(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return Y.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
2
2
  `)}};Kn.empty=new Kn(!0);var qn=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Jn(e){let t=[];do t.push(Yn(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Yn(e){let t=[];do t.push(Xn(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Xn(e){let t=er(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Qn(e,t);else break;return t}function Zn(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Qn(e,t){let n=Zn(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Zn(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function $n(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function er(e){if(e.eat(`(`)){let t=Jn(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=$n(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function tr(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function nr(e,t){return t-e}function rr(e,t){let n=[];return r(t),n.sort(nr);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function ir(e){let t=Object.create(null);return n(rr(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);rr(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Kn(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(nr);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function ar(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function or(e){return e.tag!=null}function sr(e){return e.style!=null}var cr=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(or(e))this.tags.push(e);else if(sr(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new _r(this,t,!1);return n.addAll(e,wn.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new _r(this,t,!0);return n.addAll(e,wn.none,t.from,t.to),X.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(yr(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=br(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=br(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},lr={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ur={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},dr={ol:!0,ul:!0},fr=1,pr=2,mr=4;function hr(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?fr:0)|(t===`full`?pr:0)}var gr=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=wn.none,this.match=i||(a&mr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Y.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&fr)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=Y.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Y.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!lr.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},_r=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=hr(null,t.preserveWhitespace,0)|(n?mr:0);i=r?new gr(r.type,r.attrs,wn.none,!0,t.topMatch||r.type.contentMatch,a):n?new gr(null,null,wn.none,!0,null,a):new gr(e.schema.topNodeType,null,wn.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&pr?`full`:this.localPreserveWS||(r.options&fr)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
3
3
  `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;dr.hasOwnProperty(a)&&this.parser.normalizeLists&&vr(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:ur.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(lr.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=wn.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):xr(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=hr(e,i,a.options);a.options&mr&&a.content.length==0&&(o|=mr);let s=wn.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):xr(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new gr(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=fr);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function vr(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&dr.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function yr(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function br(e){let t={};for(let n in e)t[n]=e[n];return t}function xr(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var Sr=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=wr(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return wr(t).createTextNode(e.text);let{dom:n,contentDOM:r}=Or(wr(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Or(wr(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:Or(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Cr(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Cr(e.marks)}};function Cr(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function wr(e){return e.document||window.document}var Tr=new WeakMap;function Er(e){let t=Tr.get(e);return t===void 0&&Tr.set(e,t=Dr(e)),t}function Dr(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function Or(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Er(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=Or(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var kr=65535,Ar=2**16;function jr(e,t){return e+t*Ar}function Mr(e){return e&kr}function Nr(e){return(e-(e&kr))/Ar}var Pr=1,Fr=2,Ir=4,Lr=8,Rr=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Lr)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Ir)>0}},zr=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Mr(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+Nr(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:jr(o/3,e-s),f=e==s?Fr:e==u?Pr:Ir;return(t<0?e!=s:e!=u)&&(f|=Lr),new Rr(a,f,d)}r+=l-c}return n?e+r:new Rr(e+r,0,null)}touches(e,t){let n=0,r=Mr(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};zr.empty=new zr([]);var Br=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Rr(e,r,null)}},Vr=Object.create(null),Hr=class{getMap(){return zr.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Vr[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Vr)throw RangeError(`Duplicate use of step JSON ID `+e);return Vr[e]=t,t.prototype.jsonID=e,t}},Ur=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Tn)return e.fail(t.message);throw t}}};function Wr(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Wr(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return Y.fromArray(r)}var Gr=class e extends Hr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new X(Wr(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Ur.fromReplace(e,this.from,this.to,i)}invert(){return new Kr(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Hr.jsonID(`addMark`,Gr);var Kr=class e extends Hr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new X(Wr(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Ur.fromReplace(e,this.from,this.to,n)}invert(){return new Gr(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Hr.jsonID(`removeMark`,Kr);var qr=class e extends Hr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ur.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ur.fromReplace(e,this.pos,this.pos+1,new X(Y.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Jr(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Hr.jsonID(`addNodeMark`,qr);var Jr=class e extends Hr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ur.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ur.fromReplace(e,this.pos,this.pos+1,new X(Y.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new qr(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Hr.jsonID(`removeNodeMark`,Jr);var Yr=class e extends Hr{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Zr(e,this.from,this.to)?Ur.fail(`Structure replace would overwrite content`):Ur.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new zr([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?X.empty:new X(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?X.empty:new X(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,X.fromJSON(t,n.slice),!!n.structure)}};Yr.MAP_BIAS=1,Hr.jsonID(`replace`,Yr);var Xr=class e extends Hr{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Zr(e,this.from,this.gapFrom)||Zr(e,this.gapTo,this.to)))return Ur.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ur.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Ur.fromReplace(e,this.from,this.to,n):Ur.fail(`Content does not fit in gap`)}getMap(){return new zr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,X.fromJSON(t,n.slice),n.insert,!!n.structure)}};Hr.jsonID(`replaceAround`,Xr);function Zr(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Qr(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}var $r=class e extends Hr{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ur.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Ur.fromReplace(e,this.pos,this.pos+1,new X(Y.from(r),0,+!t.isLeaf))}getMap(){return zr.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Hr.jsonID(`attr`,$r);var ei=class e extends Hr{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Ur.ok(n)}getMap(){return zr.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Hr.jsonID(`docAttr`,ei);var ti=class extends Error{};ti=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},ti.prototype=Object.create(Error.prototype),ti.prototype.constructor=ti,ti.prototype.name=`TransformError`;var ni=Object.create(null),Z=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new ri(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=X.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?X.empty:t),o==0&&di(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),di(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Q(e):ui(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?ui(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):ui(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new ci(e.node(0))}static atStart(e){return ui(e,e,0,0,1)||new ci(e)}static atEnd(e){return ui(e,e,e.content.size,e.childCount,-1)||new ci(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=ni[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ni)throw RangeError(`Duplicate use of selection JSON ID `+e);return ni[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Q.between(this.$anchor,this.$head).getBookmark()}};Z.prototype.visible=!0;var ri=class{constructor(e,t){this.$from=e,this.$to=t}},ii=!1;function ai(e){!ii&&!e.parent.inlineContent&&(ii=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var Q=class e extends Z{constructor(e,t=e){ai(e),ai(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Z.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=X.empty){if(super.replace(e,t),t==X.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new oi(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=Z.findFrom(n,r,!0)||Z.findFrom(n,-r,!0);if(e)n=e.$head;else return Z.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Z.findFrom(t,-r,!0)||Z.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};Z.jsonID(`text`,Q);var oi=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return Q.between(e.resolve(this.anchor),e.resolve(this.head))}},$=class e extends Z{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?Z.near(a):new e(a)}content(){return new X(Y.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new si(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};$.prototype.visible=!1,Z.jsonID(`node`,$);var si=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new oi(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&$.isSelectable(n)?new $(t):Z.near(t)}},ci=class e extends Z{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=X.empty){if(t==X.empty){e.delete(0,e.doc.content.size);let t=Z.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return li}};Z.jsonID(`all`,ci);var li={map(){return this},resolve(e){return new ci(e)}};function ui(e,t,n,r,i,a=!1){if(t.inlineContent)return Q.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=ui(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&$.isSelectable(r))return $.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function di(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Yr||i instanceof Xr))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(Z.near(e.doc.resolve(o),n))}function fi(e,t){return!t||!e?e:e.bind(t)}var pi=class{constructor(e,t,n){this.name=e,this.init=fi(t.init,n),this.apply=fi(t.apply,n)}};new pi(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new pi(`selection`,{init(e,t){return e.selection||Z.atStart(t.doc)},apply(e){return e.selection}}),new pi(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new pi(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function mi(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=mi(i,t,{})),n[r]=i}return n}var hi=class{constructor(e){this.spec=e,this.props={},e.props&&mi(e.props,this,this.props),this.key=e.key?e.key.key:_i(`plugin`)}getState(e){return e[this.key]}},gi=Object.create(null);function _i(e){return e in gi?e+`$`+ ++gi[e]:(gi[e]=0,e+`$`)}var vi=class{constructor(e=`key`){this.key=_i(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};function yi(e={}){return new hi({view(t){return new bi(t,e)}})}var bi=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=Qr(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},xi=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Si=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Ci=null,wi=function(e,t,n){let r=Ci||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Ti=function(){Ci=null},Ei=function(e,t,n,r){return n&&(Oi(e,t,n,r,-1)||Oi(e,t,n,r,1))},Di=/^(img|br|input|textarea|hr)$/i;function Oi(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ki(e))){let n=e.parentNode;if(!n||n.nodeType!=1||Ni(e)||Di.test(e.nodeName)||e.contentEditable==`false`)return!1;t=xi(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?ki(e):0}else return!1}}function ki(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Ai(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=ki(e)}else if(e.parentNode&&!Ni(e))t=xi(e),e=e.parentNode;else return null}}function ji(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Ni(e))t=xi(e)+1,e=e.parentNode;else return null}}function Mi(e,t,n){for(let r=t==0,i=t==ki(e);r||i;){if(e==n)return!0;let t=xi(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==ki(e)}}function Ni(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Pi=function(e){return e.focusNode&&Ei(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Fi(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Ii(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Li(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(ki(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(ki(r.startContainer),r.startOffset)}}}var Ri=typeof navigator<`u`?navigator:null,zi=typeof document<`u`?document:null,Bi=Ri&&Ri.userAgent||``,Vi=/Edge\/(\d+)/.exec(Bi),Hi=/MSIE \d/.exec(Bi),Ui=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Bi),Wi=!!(Hi||Ui||Vi),Gi=Hi?document.documentMode:Ui?+Ui[1]:Vi?+Vi[1]:0,Ki=!Wi&&/gecko\/(\d+)/i.test(Bi);Ki&&+(/Firefox\/(\d+)/.exec(Bi)||[0,0])[1];var qi=!Wi&&/Chrome\/(\d+)/.exec(Bi),Ji=!!qi,Yi=qi?+qi[1]:0,Xi=!Wi&&!!Ri&&/Apple Computer/.test(Ri.vendor),Zi=Xi&&(/Mobile\/\w+/.test(Bi)||!!Ri&&Ri.maxTouchPoints>2),Qi=Zi||(Ri?/Mac/.test(Ri.platform):!1),$i=Ri?/Win/.test(Ri.platform):!1,ea=/Android \d/.test(Bi),ta=!!zi&&`webkitFontSmoothing`in zi.documentElement.style,na=ta?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ra(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function ia(e,t){return typeof e==`number`?e:e[t]}function aa(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function oa(e,t,n){if(!xa(t)&&t.left==0)return;let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=Si(o);continue}let e=o,n=e==a.body,s=n?ra(a):aa(e),c=0,l=0;if(t.top<s.top+ia(r,`top`)?l=-(s.top-t.top+ia(i,`top`)):t.bottom>s.bottom-ia(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+ia(i,`top`)-s.top:t.bottom-s.bottom+ia(i,`bottom`)),t.left<s.left+ia(r,`left`)?c=-(s.left-t.left+ia(i,`left`)):t.right>s.right-ia(r,`right`)&&(c=t.right-s.right+ia(i,`right`)),c||l){if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:Si(o)}}function sa(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:ca(e.dom)}}function ca(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Si(r));return t}function la({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ua(n,r==0?0:r-t)}function ua(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var da=null;function fa(e){if(e.setActive)return e.setActive();if(da)return e.focus(da);let t=ca(e);e.focus(da==null?{get preventScroll(){return da={preventScroll:!0},!0}}:void 0),da||(da=!1,ua(t,0))}function pa(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=wi(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?ma(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:pa(n,i)}function ma(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=Sa(r,1);if(n.top!=n.bottom&&ha(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function ha(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function ga(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function _a(e,t,n){let{node:r,offset:i}=pa(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function va(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function ya(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(ha(t,i))return ya(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function ba(e,t){let n=e.dom.ownerDocument,r,i=0,a=Li(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!ha(t,n)||(o=ya(e.dom,t,n),!o))return null}if(Xi)for(let e=o;r&&e;e=Si(e))e.draggable&&(r=void 0);if(o=ga(o,t),r){if(Ki&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;ta&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=va(e,r,i,t))}s??=_a(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function xa(e){return e.top<e.bottom||e.left<e.right}function Sa(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(xa(e))return e}return Array.prototype.find.call(n,xa)||e.getBoundingClientRect()}var Ca=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function wa(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=ta||Ki;if(r.nodeType==3){if(o&&(Ca.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=Sa(wi(r,i,i),n);if(Ki&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=Sa(wi(r,i-1,i-1),-1);if(t.top==e.top){let n=Sa(wi(r,i,i+1),-1);if(n.top!=e.top)return Ta(n,n.left<t.left)}}return e}{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,Ta(Sa(wi(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==ki(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return Ea(e.getBoundingClientRect(),!1)}if(a==null&&i<ki(r)){let e=r.childNodes[i];if(e.nodeType==1)return Ea(e.getBoundingClientRect(),!0)}return Ea(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==ki(r))){let e=r.childNodes[i-1],t=e.nodeType==3?wi(e,ki(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return Ta(Sa(t,1),!1)}if(a==null&&i<ki(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?wi(e,0,+!o):e.nodeType==1?e:null:null;if(t)return Ta(Sa(t,-1),!0)}return Ta(Sa(r.nodeType==3?wi(r):r,-n),n>=0)}function Ta(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Ea(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Da(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function Oa(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Da(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=wa(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=wi(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var ka=/[\u0590-\u08ac]/;function Aa(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!ka.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Da(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var ja=null,Ma=null,Na=!1;function Pa(e,t,n){return ja==t&&Ma==n?Na:(ja=t,Ma=n,Na=n==`up`||n==`down`?Oa(e,t,n):Aa(e,t,n))}var Fa=0,Ia=1,La=2,Ra=3,za=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Fa,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>xi(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node)){if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof Ka){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof Ba&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?xi(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?xi(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=xi(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=xi(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((Ki||Xi)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`