@ahrowe/ui 0.16.8 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import{stickyStack as e}from"./stickyStack.mjs";import t from"./sticky.module.mjs";import{useCallback as n,useEffect as r,useLayoutEffect as i,useRef as a,useState as o}from"react";import s from"classnames";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u({children:u,offsetTop:d=0,zIndex:f=20,disabled:p=!1,onStuckChange:m,className:h,style:g,classNames:_,styles:v,...y}){let b=a(null),x=a(null),S=a(null),[C,w]=o({width:0,left:0,height:0}),[T,E]=o({isStuck:!1,top:d}),D=a(m);r(()=>{D.current=m},[m]);let O=n(()=>{let t=b.current,n=x.current;if(!t||!n)return;let r=t.getBoundingClientRect();w({width:t.clientWidth,left:r.left,height:n.offsetHeight}),e.schedule()},[]);i(()=>{let t=e.register({node:b.current,offsetTop:d,disabled:p,getMetrics:()=>{let e=b.current,t=x.current;if(!e||!t)return null;let n=e.getBoundingClientRect();return{top:n.top,left:n.left,width:e.clientWidth,contentHeight:t.offsetHeight}}},E);return S.current=t,()=>{e.unregister(t),S.current=null}},[]),r(()=>{S.current&&e.updateEntry(S.current,{offsetTop:d,disabled:p}),e.schedule()},[d,p]),i(()=>{O()},[O,u]),r(()=>{let e=new ResizeObserver(O);return b.current&&e.observe(b.current),x.current&&e.observe(x.current),()=>e.disconnect()},[O]);let k=a(!0);r(()=>{if(k.current){k.current=!1;return}D.current?.(T.isStuck)},[T.isStuck]);let A=T.isStuck?{position:`fixed`,top:T.top,left:C.left,width:C.width,zIndex:f,...v?.content}:v?.content;return l(`div`,{ref:b,className:s(t.sticky,h,_?.root),style:{...v?.root,...g},...y,children:[T.isStuck&&c(`div`,{"aria-hidden":!0,className:s(t.stickyPlaceholder,_?.placeholder),style:{height:C.height,...v?.placeholder}}),c(`div`,{ref:x,className:s(t.stickyContent,T.isStuck&&t.stickyContentStuck,_?.content),style:A,children:u})]})}export{u as default};
1
+ import{stickyStack as e}from"./stickyStack.mjs";import t from"./sticky.module.mjs";import{useCallback as n,useEffect as r,useLayoutEffect as i,useRef as a,useState as o}from"react";import s from"classnames";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u(e){let t=e?.parentElement??null;for(;t&&t!==document.body;){let{overflowY:e}=getComputedStyle(t);if(e===`auto`||e===`scroll`||e===`overlay`)return t;t=t.parentElement}return null}function d({children:d,offsetTop:f=0,offsetElement:p,stickToScrollParent:m=!1,zIndex:h=20,disabled:g=!1,onStuckChange:_,className:v,style:y,classNames:b,styles:x,...S}){let C=a(null),w=a(null),T=a(null),E=a(null),[D,O]=o({width:0,left:0,height:0}),[k,A]=o(null),[j,M]=o(0),N=p?.current?k??p.current.offsetHeight:f,[P,F]=o({isStuck:!1,top:N}),I=a(_);r(()=>{I.current=_},[_]);let L=n(()=>{let t=C.current,n=w.current;if(!t||!n)return;let r=t.getBoundingClientRect();O({width:t.clientWidth,left:r.left,height:n.offsetHeight}),e.schedule()},[]);r(()=>{let e=p?.current;if(!e)return;let t=()=>A(e.offsetHeight);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[p]),i(()=>{E.current=m?u(C.current):null},[m]),i(()=>{let t=e.register({node:C.current,offsetTop:N,disabled:g,getMetrics:()=>{let e=C.current,t=w.current;if(!e||!t)return null;let n=e.getBoundingClientRect(),r=E.current?.getBoundingClientRect(),i=r?.top??0;return M(e=>e===i?e:i),{top:r?n.top-r.top:n.top,left:r?n.left-r.left:n.left,width:e.clientWidth,contentHeight:t.offsetHeight,container:E.current}}},F);return T.current=t,()=>{e.unregister(t),T.current=null}},[]),r(()=>{T.current&&e.updateEntry(T.current,{offsetTop:N,disabled:g}),e.schedule()},[N,g]),i(()=>{L()},[L,d]),r(()=>{let e=new ResizeObserver(L);return C.current&&e.observe(C.current),w.current&&e.observe(w.current),E.current&&e.observe(E.current),()=>e.disconnect()},[L,m]);let R=a(!0);r(()=>{if(R.current){R.current=!1;return}I.current?.(P.isStuck)},[P.isStuck]);let z=P.isStuck?{position:`fixed`,top:j+P.top,left:D.left,width:D.width,zIndex:h,...x?.content}:x?.content;return l(`div`,{ref:C,className:s(t.sticky,v,b?.root),style:{...x?.root,...y},...S,children:[P.isStuck&&c(`div`,{"aria-hidden":!0,className:s(t.stickyPlaceholder,b?.placeholder),style:{height:D.height,...x?.placeholder}}),c(`div`,{ref:w,className:s(t.stickyContent,P.isStuck&&t.stickyContentStuck,b?.content),style:z,children:d})]})}export{d as default};
2
2
  //# sourceMappingURL=sticky.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sticky.mjs","names":[],"sources":["../../../../package/common/sticky/sticky.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport cx from 'classnames';\nimport type { StickyProps } from './sticky.types';\nimport { stickyStack } from './stickyStack';\nimport type { StickyStackResult } from './stickyStack';\n\nimport styles from './sticky.module.pcss';\n\ninterface Metrics {\n width: number;\n left: number;\n height: number;\n}\n\nexport default function Sticky({\n children,\n offsetTop = 0,\n zIndex = 20,\n disabled = false,\n onStuckChange,\n className,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n}: StickyProps) {\n const rootRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const stackIdRef = useRef<symbol | null>(null);\n const [metrics, setMetrics] = useState<Metrics>({ width: 0, left: 0, height: 0 });\n const [stackResult, setStackResult] = useState<StickyStackResult>({ isStuck: false, top: offsetTop });\n\n const onStuckChangeRef = useRef(onStuckChange);\n useEffect(() => {\n onStuckChangeRef.current = onStuckChange;\n }, [onStuckChange]);\n\n // Local geometry (width/left/height) doesn't depend on other Stickies — only the\n // effective `top` and `isStuck` (from the stack coordinator) do.\n const measure = useCallback(() => {\n const root = rootRef.current;\n const content = contentRef.current;\n if (!root || !content) return;\n const rootRect = root.getBoundingClientRect();\n setMetrics({ width: root.clientWidth, left: rootRect.left, height: content.offsetHeight });\n stickyStack.schedule();\n }, []);\n\n useLayoutEffect(() => {\n const id = stickyStack.register(\n {\n node: rootRef.current as HTMLElement,\n offsetTop,\n disabled,\n getMetrics: () => {\n const root = rootRef.current;\n const content = contentRef.current;\n if (!root || !content) return null;\n const rect = root.getBoundingClientRect();\n return { top: rect.top, left: rect.left, width: root.clientWidth, contentHeight: content.offsetHeight };\n },\n },\n setStackResult,\n );\n stackIdRef.current = id;\n return () => {\n stickyStack.unregister(id);\n stackIdRef.current = null;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n if (stackIdRef.current) {\n stickyStack.updateEntry(stackIdRef.current, { offsetTop, disabled });\n }\n stickyStack.schedule();\n }, [offsetTop, disabled]);\n\n useLayoutEffect(() => {\n measure();\n }, [measure, children]);\n\n useEffect(() => {\n const ro = new ResizeObserver(measure);\n if (rootRef.current) ro.observe(rootRef.current);\n if (contentRef.current) ro.observe(contentRef.current);\n return () => ro.disconnect();\n }, [measure]);\n\n const firstRun = useRef(true);\n useEffect(() => {\n if (firstRun.current) {\n firstRun.current = false;\n return;\n }\n onStuckChangeRef.current?.(stackResult.isStuck);\n }, [stackResult.isStuck]);\n\n const contentStyle: React.CSSProperties | undefined = stackResult.isStuck\n ? {\n position: 'fixed',\n top: stackResult.top,\n left: metrics.left,\n width: metrics.width,\n zIndex,\n ...slotStyles?.content,\n }\n : slotStyles?.content;\n\n return (\n <div ref={rootRef} className={cx(styles.sticky, className, classNames?.root)} style={{ ...slotStyles?.root, ...style }} {...rest}>\n {stackResult.isStuck && (\n <div\n aria-hidden\n className={cx(styles.stickyPlaceholder, classNames?.placeholder)}\n style={{ height: metrics.height, ...slotStyles?.placeholder }}\n />\n )}\n <div\n ref={contentRef}\n className={cx(styles.stickyContent, stackResult.isStuck && styles.stickyContentStuck, classNames?.content)}\n style={contentStyle}\n >\n {children}\n </div>\n </div>\n );\n}\n"],"mappings":"iQAcA,SAAwB,EAAO,CAC7B,WACA,YAAY,EACZ,SAAS,GACT,WAAW,GACX,gBACA,YACA,QACA,aACA,OAAQ,EACR,GAAG,GACW,CACd,IAAM,EAAU,EAAuB,IAAI,EACrC,EAAa,EAAuB,IAAI,EACxC,EAAa,EAAsB,IAAI,EACvC,CAAC,EAAS,GAAc,EAAkB,CAAE,MAAO,EAAG,KAAM,EAAG,OAAQ,CAAE,CAAC,EAC1E,CAAC,EAAa,GAAkB,EAA4B,CAAE,QAAS,GAAO,IAAK,CAAU,CAAC,EAE9F,EAAmB,EAAO,CAAa,EAC7C,MAAgB,CACd,EAAiB,QAAU,CAC7B,EAAG,CAAC,CAAa,CAAC,EAIlB,IAAM,EAAU,MAAkB,CAChC,IAAM,EAAO,EAAQ,QACf,EAAU,EAAW,QAC3B,GAAI,CAAC,GAAQ,CAAC,EAAS,OACvB,IAAM,EAAW,EAAK,sBAAsB,EAC5C,EAAW,CAAE,MAAO,EAAK,YAAa,KAAM,EAAS,KAAM,OAAQ,EAAQ,YAAa,CAAC,EACzF,EAAY,SAAS,CACvB,EAAG,CAAC,CAAC,EAEL,MAAsB,CACpB,IAAM,EAAK,EAAY,SACrB,CACE,KAAM,EAAQ,QACd,YACA,WACA,eAAkB,CAChB,IAAM,EAAO,EAAQ,QACf,EAAU,EAAW,QAC3B,GAAI,CAAC,GAAQ,CAAC,EAAS,OAAO,KAC9B,IAAM,EAAO,EAAK,sBAAsB,EACxC,MAAO,CAAE,IAAK,EAAK,IAAK,KAAM,EAAK,KAAM,MAAO,EAAK,YAAa,cAAe,EAAQ,YAAa,CACxG,CACF,EACA,CACF,EAEA,MADA,GAAW,QAAU,MACR,CACX,EAAY,WAAW,CAAE,EACzB,EAAW,QAAU,IACvB,CAEF,EAAG,CAAC,CAAC,EAEL,MAAgB,CACV,EAAW,SACb,EAAY,YAAY,EAAW,QAAS,CAAE,YAAW,UAAS,CAAC,EAErE,EAAY,SAAS,CACvB,EAAG,CAAC,EAAW,CAAQ,CAAC,EAExB,MAAsB,CACpB,EAAQ,CACV,EAAG,CAAC,EAAS,CAAQ,CAAC,EAEtB,MAAgB,CACd,IAAM,EAAK,IAAI,eAAe,CAAO,EAGrC,OAFI,EAAQ,SAAS,EAAG,QAAQ,EAAQ,OAAO,EAC3C,EAAW,SAAS,EAAG,QAAQ,EAAW,OAAO,MACxC,EAAG,WAAW,CAC7B,EAAG,CAAC,CAAO,CAAC,EAEZ,IAAM,EAAW,EAAO,EAAI,EAC5B,MAAgB,CACd,GAAI,EAAS,QAAS,CACpB,EAAS,QAAU,GACnB,MACF,CACA,EAAiB,UAAU,EAAY,OAAO,CAChD,EAAG,CAAC,EAAY,OAAO,CAAC,EAExB,IAAM,EAAgD,EAAY,QAC9D,CACE,SAAU,QACV,IAAK,EAAY,IACjB,KAAM,EAAQ,KACd,MAAO,EAAQ,MACf,SACA,GAAG,GAAY,OACjB,EACA,GAAY,QAEhB,OACE,EAAC,MAAD,CAAK,IAAK,EAAS,UAAW,EAAG,EAAO,OAAQ,EAAW,GAAY,IAAI,EAAG,MAAO,CAAE,GAAG,GAAY,KAAM,GAAG,CAAM,EAAG,GAAI,WAA5H,CACG,EAAY,SACX,EAAC,MAAD,CACE,cAAA,GACA,UAAW,EAAG,EAAO,kBAAmB,GAAY,WAAW,EAC/D,MAAO,CAAE,OAAQ,EAAQ,OAAQ,GAAG,GAAY,WAAY,CAC7D,CAAA,EAEH,EAAC,MAAD,CACE,IAAK,EACL,UAAW,EAAG,EAAO,cAAe,EAAY,SAAW,EAAO,mBAAoB,GAAY,OAAO,EACzG,MAAO,EAEN,UACE,CAAA,CACF,GAET"}
1
+ {"version":3,"file":"sticky.mjs","names":[],"sources":["../../../../package/common/sticky/sticky.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport cx from 'classnames';\nimport type { StickyProps } from './sticky.types';\nimport { stickyStack } from './stickyStack';\nimport type { StickyStackResult } from './stickyStack';\n\nimport styles from './sticky.module.pcss';\n\ninterface Metrics {\n width: number;\n left: number;\n height: number;\n}\n\n// Nearest ancestor whose own scrollbar would carry the sticky's scroll — used so\n// `stickToScrollParent` can pin relative to that container's box instead of the viewport.\nfunction getScrollParent(el: HTMLElement | null): HTMLElement | null {\n let node = el?.parentElement ?? null;\n while (node && node !== document.body) {\n const { overflowY } = getComputedStyle(node);\n if (overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'overlay') return node;\n node = node.parentElement;\n }\n return null;\n}\n\nexport default function Sticky({\n children,\n offsetTop = 0,\n offsetElement,\n stickToScrollParent = false,\n zIndex = 20,\n disabled = false,\n onStuckChange,\n className,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n}: StickyProps) {\n const rootRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const stackIdRef = useRef<symbol | null>(null);\n const scrollParentRef = useRef<HTMLElement | null>(null);\n const [metrics, setMetrics] = useState<Metrics>({ width: 0, left: 0, height: 0 });\n const [measuredOffset, setMeasuredOffset] = useState<number | null>(null);\n const [scrollParentTop, setScrollParentTop] = useState(0);\n const effectiveOffsetTop = offsetElement?.current ? (measuredOffset ?? offsetElement.current.offsetHeight) : offsetTop;\n const [stackResult, setStackResult] = useState<StickyStackResult>({ isStuck: false, top: effectiveOffsetTop });\n\n const onStuckChangeRef = useRef(onStuckChange);\n useEffect(() => {\n onStuckChangeRef.current = onStuckChange;\n }, [onStuckChange]);\n\n // Local geometry (width/left/height) doesn't depend on other Stickies — only the\n // effective `top` and `isStuck` (from the stack coordinator) do.\n const measure = useCallback(() => {\n const root = rootRef.current;\n const content = contentRef.current;\n if (!root || !content) return;\n const rootRect = root.getBoundingClientRect();\n setMetrics({ width: root.clientWidth, left: rootRect.left, height: content.offsetHeight });\n stickyStack.schedule();\n }, []);\n\n useEffect(() => {\n const el = offsetElement?.current;\n if (!el) return;\n const updateFromElement = () => setMeasuredOffset(el.offsetHeight);\n updateFromElement();\n const ro = new ResizeObserver(updateFromElement);\n ro.observe(el);\n return () => ro.disconnect();\n }, [offsetElement]);\n\n useLayoutEffect(() => {\n scrollParentRef.current = stickToScrollParent ? getScrollParent(rootRef.current) : null;\n }, [stickToScrollParent]);\n\n useLayoutEffect(() => {\n const id = stickyStack.register(\n {\n node: rootRef.current as HTMLElement,\n offsetTop: effectiveOffsetTop,\n disabled,\n getMetrics: () => {\n const root = rootRef.current;\n const content = contentRef.current;\n if (!root || !content) return null;\n const rect = root.getBoundingClientRect();\n const parentRect = scrollParentRef.current?.getBoundingClientRect();\n const newParentTop = parentRect?.top ?? 0;\n setScrollParentTop((prev) => (prev === newParentTop ? prev : newParentTop));\n // Report top/left relative to the scroll parent's box so the stack's stuck/stacking\n // math stays in the same coordinate space regardless of what it's pinned relative to.\n const top = parentRect ? rect.top - parentRect.top : rect.top;\n const left = parentRect ? rect.left - parentRect.left : rect.left;\n return { top, left, width: root.clientWidth, contentHeight: content.offsetHeight, container: scrollParentRef.current };\n },\n },\n setStackResult,\n );\n stackIdRef.current = id;\n return () => {\n stickyStack.unregister(id);\n stackIdRef.current = null;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n if (stackIdRef.current) {\n stickyStack.updateEntry(stackIdRef.current, { offsetTop: effectiveOffsetTop, disabled });\n }\n stickyStack.schedule();\n }, [effectiveOffsetTop, disabled]);\n\n useLayoutEffect(() => {\n measure();\n }, [measure, children]);\n\n useEffect(() => {\n const ro = new ResizeObserver(measure);\n if (rootRef.current) ro.observe(rootRef.current);\n if (contentRef.current) ro.observe(contentRef.current);\n if (scrollParentRef.current) ro.observe(scrollParentRef.current);\n return () => ro.disconnect();\n }, [measure, stickToScrollParent]);\n\n const firstRun = useRef(true);\n useEffect(() => {\n if (firstRun.current) {\n firstRun.current = false;\n return;\n }\n onStuckChangeRef.current?.(stackResult.isStuck);\n }, [stackResult.isStuck]);\n\n // stackResult.top is relative to the scroll parent's box (or the viewport if there isn't\n // one) — convert back to a viewport-absolute value for the fixed `top`.\n const contentStyle: React.CSSProperties | undefined = stackResult.isStuck\n ? {\n position: 'fixed',\n top: scrollParentTop + stackResult.top,\n left: metrics.left,\n width: metrics.width,\n zIndex,\n ...slotStyles?.content,\n }\n : slotStyles?.content;\n\n return (\n <div ref={rootRef} className={cx(styles.sticky, className, classNames?.root)} style={{ ...slotStyles?.root, ...style }} {...rest}>\n {stackResult.isStuck && (\n <div\n aria-hidden\n className={cx(styles.stickyPlaceholder, classNames?.placeholder)}\n style={{ height: metrics.height, ...slotStyles?.placeholder }}\n />\n )}\n <div\n ref={contentRef}\n className={cx(styles.stickyContent, stackResult.isStuck && styles.stickyContentStuck, classNames?.content)}\n style={contentStyle}\n >\n {children}\n </div>\n </div>\n );\n}\n"],"mappings":"iQAgBA,SAAS,EAAgB,EAA4C,CACnE,IAAI,EAAO,GAAI,eAAiB,KAChC,KAAO,GAAQ,IAAS,SAAS,MAAM,CACrC,GAAM,CAAE,aAAc,iBAAiB,CAAI,EAC3C,GAAI,IAAc,QAAU,IAAc,UAAY,IAAc,UAAW,OAAO,EACtF,EAAO,EAAK,aACd,CACA,OAAO,IACT,CAEA,SAAwB,EAAO,CAC7B,WACA,YAAY,EACZ,gBACA,sBAAsB,GACtB,SAAS,GACT,WAAW,GACX,gBACA,YACA,QACA,aACA,OAAQ,EACR,GAAG,GACW,CACd,IAAM,EAAU,EAAuB,IAAI,EACrC,EAAa,EAAuB,IAAI,EACxC,EAAa,EAAsB,IAAI,EACvC,EAAkB,EAA2B,IAAI,EACjD,CAAC,EAAS,GAAc,EAAkB,CAAE,MAAO,EAAG,KAAM,EAAG,OAAQ,CAAE,CAAC,EAC1E,CAAC,EAAgB,GAAqB,EAAwB,IAAI,EAClE,CAAC,EAAiB,GAAsB,EAAS,CAAC,EAClD,EAAqB,GAAe,QAAW,GAAkB,EAAc,QAAQ,aAAgB,EACvG,CAAC,EAAa,GAAkB,EAA4B,CAAE,QAAS,GAAO,IAAK,CAAmB,CAAC,EAEvG,EAAmB,EAAO,CAAa,EAC7C,MAAgB,CACd,EAAiB,QAAU,CAC7B,EAAG,CAAC,CAAa,CAAC,EAIlB,IAAM,EAAU,MAAkB,CAChC,IAAM,EAAO,EAAQ,QACf,EAAU,EAAW,QAC3B,GAAI,CAAC,GAAQ,CAAC,EAAS,OACvB,IAAM,EAAW,EAAK,sBAAsB,EAC5C,EAAW,CAAE,MAAO,EAAK,YAAa,KAAM,EAAS,KAAM,OAAQ,EAAQ,YAAa,CAAC,EACzF,EAAY,SAAS,CACvB,EAAG,CAAC,CAAC,EAEL,MAAgB,CACd,IAAM,EAAK,GAAe,QAC1B,GAAI,CAAC,EAAI,OACT,IAAM,MAA0B,EAAkB,EAAG,YAAY,EACjE,EAAkB,EAClB,IAAM,EAAK,IAAI,eAAe,CAAiB,EAE/C,OADA,EAAG,QAAQ,CAAE,MACA,EAAG,WAAW,CAC7B,EAAG,CAAC,CAAa,CAAC,EAElB,MAAsB,CACpB,EAAgB,QAAU,EAAsB,EAAgB,EAAQ,OAAO,EAAI,IACrF,EAAG,CAAC,CAAmB,CAAC,EAExB,MAAsB,CACpB,IAAM,EAAK,EAAY,SACrB,CACE,KAAM,EAAQ,QACd,UAAW,EACX,WACA,eAAkB,CAChB,IAAM,EAAO,EAAQ,QACf,EAAU,EAAW,QAC3B,GAAI,CAAC,GAAQ,CAAC,EAAS,OAAO,KAC9B,IAAM,EAAO,EAAK,sBAAsB,EAClC,EAAa,EAAgB,SAAS,sBAAsB,EAC5D,EAAe,GAAY,KAAO,EAMxC,OALA,EAAoB,GAAU,IAAS,EAAe,EAAO,CAAa,EAKnE,CAAE,IAFG,EAAa,EAAK,IAAM,EAAW,IAAM,EAAK,IAE5C,KADD,EAAa,EAAK,KAAO,EAAW,KAAO,EAAK,KACzC,MAAO,EAAK,YAAa,cAAe,EAAQ,aAAc,UAAW,EAAgB,OAAQ,CACvH,CACF,EACA,CACF,EAEA,MADA,GAAW,QAAU,MACR,CACX,EAAY,WAAW,CAAE,EACzB,EAAW,QAAU,IACvB,CAEF,EAAG,CAAC,CAAC,EAEL,MAAgB,CACV,EAAW,SACb,EAAY,YAAY,EAAW,QAAS,CAAE,UAAW,EAAoB,UAAS,CAAC,EAEzF,EAAY,SAAS,CACvB,EAAG,CAAC,EAAoB,CAAQ,CAAC,EAEjC,MAAsB,CACpB,EAAQ,CACV,EAAG,CAAC,EAAS,CAAQ,CAAC,EAEtB,MAAgB,CACd,IAAM,EAAK,IAAI,eAAe,CAAO,EAIrC,OAHI,EAAQ,SAAS,EAAG,QAAQ,EAAQ,OAAO,EAC3C,EAAW,SAAS,EAAG,QAAQ,EAAW,OAAO,EACjD,EAAgB,SAAS,EAAG,QAAQ,EAAgB,OAAO,MAClD,EAAG,WAAW,CAC7B,EAAG,CAAC,EAAS,CAAmB,CAAC,EAEjC,IAAM,EAAW,EAAO,EAAI,EAC5B,MAAgB,CACd,GAAI,EAAS,QAAS,CACpB,EAAS,QAAU,GACnB,MACF,CACA,EAAiB,UAAU,EAAY,OAAO,CAChD,EAAG,CAAC,EAAY,OAAO,CAAC,EAIxB,IAAM,EAAgD,EAAY,QAC9D,CACE,SAAU,QACV,IAAK,EAAkB,EAAY,IACnC,KAAM,EAAQ,KACd,MAAO,EAAQ,MACf,SACA,GAAG,GAAY,OACjB,EACA,GAAY,QAEhB,OACE,EAAC,MAAD,CAAK,IAAK,EAAS,UAAW,EAAG,EAAO,OAAQ,EAAW,GAAY,IAAI,EAAG,MAAO,CAAE,GAAG,GAAY,KAAM,GAAG,CAAM,EAAG,GAAI,WAA5H,CACG,EAAY,SACX,EAAC,MAAD,CACE,cAAA,GACA,UAAW,EAAG,EAAO,kBAAmB,GAAY,WAAW,EAC/D,MAAO,CAAE,OAAQ,EAAQ,OAAQ,GAAG,GAAY,WAAY,CAC7D,CAAA,EAEH,EAAC,MAAD,CACE,IAAK,EACL,UAAW,EAAG,EAAO,cAAe,EAAY,SAAW,EAAO,mBAAoB,GAAY,OAAO,EACzG,MAAO,EAEN,UACE,CAAA,CACF,GAET"}
@@ -1,2 +1,2 @@
1
- function e(e,t,n,r){return e<r&&n<t}function t(e,t){if(e===t)return 0;let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}var n=new class{constructor(){this.entries=new Map,this.listeners=new Map,this.results=new Map,this.rafId=0,this.listenerCount=0,this.schedule=()=>{cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(this.recompute)},this.recompute=()=>{let n=[...this.entries.entries()].sort(([,e],[,n])=>t(e.node,n.node)),r=[];for(let[t,i]of n){let n=i.getMetrics();if(!n)continue;let a=r.filter(t=>e(t.left,t.right,n.left,n.left+n.width)).reduce((e,t)=>Math.max(e,t.bottom),i.offsetTop),o=!i.disabled&&n.top<=a,s={isStuck:o,top:o?a:i.offsetTop};o&&r.push({left:n.left,right:n.left+n.width,bottom:a+n.contentHeight});let c=this.results.get(t);(!c||c.isStuck!==s.isStuck||c.top!==s.top)&&(this.results.set(t,s),this.listeners.get(t)?.(s))}}}register(e,t){let n=Symbol(`sticky`);return this.entries.set(n,e),this.listeners.set(n,t),this.startListening(),n}updateEntry(e,t){let n=this.entries.get(e);n&&Object.assign(n,t)}unregister(e){this.entries.has(e)&&(this.entries.delete(e),this.listeners.delete(e),this.results.delete(e),this.stopListening())}startListening(){this.listenerCount===0&&(window.addEventListener(`scroll`,this.schedule,{passive:!0,capture:!0}),window.addEventListener(`resize`,this.schedule)),this.listenerCount++}stopListening(){this.listenerCount--,this.listenerCount===0&&(window.removeEventListener(`scroll`,this.schedule,{capture:!0}),window.removeEventListener(`resize`,this.schedule))}};export{n as stickyStack};
1
+ function e(e,t,n,r){return e<r&&n<t}function t(e,t){if(e===t)return 0;let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}var n=new class{constructor(){this.entries=new Map,this.listeners=new Map,this.results=new Map,this.rafId=0,this.listenerCount=0,this.schedule=()=>{cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(this.recompute)},this.recompute=()=>{let n=[...this.entries.entries()].sort(([,e],[,n])=>t(e.node,n.node)),r=new Map;for(let[t,i]of n){let n=i.getMetrics();if(!n)continue;let a=r.get(n.container);a||(a=[],r.set(n.container,a));let o=a.filter(t=>e(t.left,t.right,n.left,n.left+n.width)).reduce((e,t)=>Math.max(e,t.bottom),i.offsetTop),s=!i.disabled&&n.top<=o,c={isStuck:s,top:s?o:i.offsetTop};s&&a.push({left:n.left,right:n.left+n.width,bottom:o+n.contentHeight});let l=this.results.get(t);(!l||l.isStuck!==c.isStuck||l.top!==c.top)&&(this.results.set(t,c),this.listeners.get(t)?.(c))}}}register(e,t){let n=Symbol(`sticky`);return this.entries.set(n,e),this.listeners.set(n,t),this.startListening(),n}updateEntry(e,t){let n=this.entries.get(e);n&&Object.assign(n,t)}unregister(e){this.entries.has(e)&&(this.entries.delete(e),this.listeners.delete(e),this.results.delete(e),this.stopListening())}startListening(){this.listenerCount===0&&(window.addEventListener(`scroll`,this.schedule,{passive:!0,capture:!0}),window.addEventListener(`resize`,this.schedule)),this.listenerCount++}stopListening(){this.listenerCount--,this.listenerCount===0&&(window.removeEventListener(`scroll`,this.schedule,{capture:!0}),window.removeEventListener(`resize`,this.schedule))}};export{n as stickyStack};
2
2
  //# sourceMappingURL=stickyStack.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"stickyStack.mjs","names":[],"sources":["../../../../package/common/sticky/stickyStack.ts"],"sourcesContent":["/**\n * Coordinates every mounted `Sticky` so ones that overlap horizontally stack\n * underneath each other (in DOM order) instead of pinning to the same spot.\n * Non-overlapping ones (e.g. side-by-side halves under a full-width one) land\n * at the same top instead of being pushed down by each other.\n */\n\nexport interface StickyStackMetrics {\n /** Current (unstuck-flow) top of the root element, from getBoundingClientRect. */\n top: number;\n left: number;\n width: number;\n contentHeight: number;\n}\n\nexport interface StickyStackEntry {\n node: HTMLElement;\n offsetTop: number;\n disabled: boolean;\n getMetrics: () => StickyStackMetrics | null;\n}\n\nexport interface StickyStackResult {\n isStuck: boolean;\n /** Effective `top` to pin at while stuck — offsetTop plus the height of any stuck, overlapping entries above it. */\n top: number;\n}\n\ntype ResultListener = (result: StickyStackResult) => void;\n\nfunction rangesOverlap(aLeft: number, aRight: number, bLeft: number, bRight: number): boolean {\n return aLeft < bRight && bLeft < aRight;\n}\n\nfunction compareDomOrder(a: HTMLElement, b: HTMLElement): number {\n if (a === b) return 0;\n const position = a.compareDocumentPosition(b);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) return -1;\n if (position & Node.DOCUMENT_POSITION_PRECEDING) return 1;\n return 0;\n}\n\nclass StickyStack {\n private entries = new Map<symbol, StickyStackEntry>();\n private listeners = new Map<symbol, ResultListener>();\n private results = new Map<symbol, StickyStackResult>();\n private rafId = 0;\n private listenerCount = 0;\n\n schedule = (): void => {\n cancelAnimationFrame(this.rafId);\n this.rafId = requestAnimationFrame(this.recompute);\n };\n\n register(entry: StickyStackEntry, onChange: ResultListener): symbol {\n const id = Symbol('sticky');\n this.entries.set(id, entry);\n this.listeners.set(id, onChange);\n this.startListening();\n return id;\n }\n\n updateEntry(id: symbol, patch: Partial<Pick<StickyStackEntry, 'offsetTop' | 'disabled'>>): void {\n const entry = this.entries.get(id);\n if (entry) Object.assign(entry, patch);\n }\n\n unregister(id: symbol): void {\n if (!this.entries.has(id)) return;\n this.entries.delete(id);\n this.listeners.delete(id);\n this.results.delete(id);\n this.stopListening();\n }\n\n recompute = (): void => {\n const ordered = [...this.entries.entries()].sort(([, a], [, b]) => compareDomOrder(a.node, b.node));\n const placed: { left: number; right: number; bottom: number }[] = [];\n\n for (const [id, entry] of ordered) {\n const metrics = entry.getMetrics();\n if (!metrics) continue;\n\n const overlapping = placed.filter((p) => rangesOverlap(p.left, p.right, metrics.left, metrics.left + metrics.width));\n const baseTop = overlapping.reduce((max, p) => Math.max(max, p.bottom), entry.offsetTop);\n const isStuck = !entry.disabled && metrics.top <= baseTop;\n const result: StickyStackResult = { isStuck, top: isStuck ? baseTop : entry.offsetTop };\n\n if (isStuck) {\n placed.push({ left: metrics.left, right: metrics.left + metrics.width, bottom: baseTop + metrics.contentHeight });\n }\n\n const prev = this.results.get(id);\n if (!prev || prev.isStuck !== result.isStuck || prev.top !== result.top) {\n this.results.set(id, result);\n this.listeners.get(id)?.(result);\n }\n }\n };\n\n private startListening(): void {\n if (this.listenerCount === 0) {\n window.addEventListener('scroll', this.schedule, { passive: true, capture: true });\n window.addEventListener('resize', this.schedule);\n }\n this.listenerCount++;\n }\n\n private stopListening(): void {\n this.listenerCount--;\n if (this.listenerCount === 0) {\n window.removeEventListener('scroll', this.schedule, { capture: true } as EventListenerOptions);\n window.removeEventListener('resize', this.schedule);\n }\n }\n}\n\nexport const stickyStack = new StickyStack();\n"],"mappings":"AA8BA,SAAS,EAAc,EAAe,EAAgB,EAAe,EAAyB,CAC5F,OAAO,EAAQ,GAAU,EAAQ,CACnC,CAEA,SAAS,EAAgB,EAAgB,EAAwB,CAC/D,GAAI,IAAM,EAAG,MAAO,GACpB,IAAM,EAAW,EAAE,wBAAwB,CAAC,EAG5C,OAFI,EAAW,KAAK,4BAAoC,GACpD,EAAW,KAAK,4BAAoC,EACjD,CACT,CA6EA,IAAa,EAAc,IAAI,KA3Eb,4BACE,IAAI,mBACF,IAAI,iBACN,IAAI,eACN,qBACQ,oBAED,CACrB,qBAAqB,KAAK,KAAK,EAC/B,KAAK,MAAQ,sBAAsB,KAAK,SAAS,CACnD,qBAuBwB,CACtB,IAAM,EAAU,CAAC,GAAG,KAAK,QAAQ,QAAQ,CAAC,EAAE,MAAM,EAAG,GAAI,EAAG,KAAO,EAAgB,EAAE,KAAM,EAAE,IAAI,CAAC,EAC5F,EAA4D,CAAC,EAEnE,IAAK,GAAM,CAAC,EAAI,KAAU,EAAS,CACjC,IAAM,EAAU,EAAM,WAAW,EACjC,GAAI,CAAC,EAAS,SAGd,IAAM,EADc,EAAO,OAAQ,GAAM,EAAc,EAAE,KAAM,EAAE,MAAO,EAAQ,KAAM,EAAQ,KAAO,EAAQ,KAAK,CAClG,EAAY,QAAQ,EAAK,IAAM,KAAK,IAAI,EAAK,EAAE,MAAM,EAAG,EAAM,SAAS,EACjF,EAAU,CAAC,EAAM,UAAY,EAAQ,KAAO,EAC5C,EAA4B,CAAE,UAAS,IAAK,EAAU,EAAU,EAAM,SAAU,EAElF,GACF,EAAO,KAAK,CAAE,KAAM,EAAQ,KAAM,MAAO,EAAQ,KAAO,EAAQ,MAAO,OAAQ,EAAU,EAAQ,aAAc,CAAC,EAGlH,IAAM,EAAO,KAAK,QAAQ,IAAI,CAAE,GAC5B,CAAC,GAAQ,EAAK,UAAY,EAAO,SAAW,EAAK,MAAQ,EAAO,OAClE,KAAK,QAAQ,IAAI,EAAI,CAAM,EAC3B,KAAK,UAAU,IAAI,CAAE,IAAI,CAAM,EAEnC,CACF,EA5CA,SAAS,EAAyB,EAAkC,CAClE,IAAM,EAAK,OAAO,QAAQ,EAI1B,OAHA,KAAK,QAAQ,IAAI,EAAI,CAAK,EAC1B,KAAK,UAAU,IAAI,EAAI,CAAQ,EAC/B,KAAK,eAAe,EACb,CACT,CAEA,YAAY,EAAY,EAAwE,CAC9F,IAAM,EAAQ,KAAK,QAAQ,IAAI,CAAE,EAC7B,GAAO,OAAO,OAAO,EAAO,CAAK,CACvC,CAEA,WAAW,EAAkB,CACtB,KAAK,QAAQ,IAAI,CAAE,IACxB,KAAK,QAAQ,OAAO,CAAE,EACtB,KAAK,UAAU,OAAO,CAAE,EACxB,KAAK,QAAQ,OAAO,CAAE,EACtB,KAAK,cAAc,EACrB,CA2BA,gBAA+B,CACzB,KAAK,gBAAkB,IACzB,OAAO,iBAAiB,SAAU,KAAK,SAAU,CAAE,QAAS,GAAM,QAAS,EAAK,CAAC,EACjF,OAAO,iBAAiB,SAAU,KAAK,QAAQ,GAEjD,KAAK,eACP,CAEA,eAA8B,CAC5B,KAAK,gBACD,KAAK,gBAAkB,IACzB,OAAO,oBAAoB,SAAU,KAAK,SAAU,CAAE,QAAS,EAAK,CAAyB,EAC7F,OAAO,oBAAoB,SAAU,KAAK,QAAQ,EAEtD,CACF"}
1
+ {"version":3,"file":"stickyStack.mjs","names":[],"sources":["../../../../package/common/sticky/stickyStack.ts"],"sourcesContent":["/**\n * Coordinates every mounted `Sticky` so ones that overlap horizontally stack\n * underneath each other (in DOM order) instead of pinning to the same spot.\n * Non-overlapping ones (e.g. side-by-side halves under a full-width one) land\n * at the same top instead of being pushed down by each other.\n */\n\nexport interface StickyStackMetrics {\n /** Current (unstuck-flow) top of the root element, from getBoundingClientRect. */\n top: number;\n left: number;\n width: number;\n contentHeight: number;\n /** The element this entry sticks relative to (its scroll parent), or null for the viewport.\n * Stacking only considers overlap between entries sharing the same container — two Stickies\n * in unrelated scroll panels should never push each other down just because they happen to\n * share horizontal DOM coordinates. */\n container: HTMLElement | null;\n}\n\nexport interface StickyStackEntry {\n node: HTMLElement;\n offsetTop: number;\n disabled: boolean;\n getMetrics: () => StickyStackMetrics | null;\n}\n\nexport interface StickyStackResult {\n isStuck: boolean;\n /** Effective `top` to pin at while stuck — offsetTop plus the height of any stuck, overlapping entries above it. */\n top: number;\n}\n\ntype ResultListener = (result: StickyStackResult) => void;\n\nfunction rangesOverlap(aLeft: number, aRight: number, bLeft: number, bRight: number): boolean {\n return aLeft < bRight && bLeft < aRight;\n}\n\nfunction compareDomOrder(a: HTMLElement, b: HTMLElement): number {\n if (a === b) return 0;\n const position = a.compareDocumentPosition(b);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) return -1;\n if (position & Node.DOCUMENT_POSITION_PRECEDING) return 1;\n return 0;\n}\n\nclass StickyStack {\n private entries = new Map<symbol, StickyStackEntry>();\n private listeners = new Map<symbol, ResultListener>();\n private results = new Map<symbol, StickyStackResult>();\n private rafId = 0;\n private listenerCount = 0;\n\n schedule = (): void => {\n cancelAnimationFrame(this.rafId);\n this.rafId = requestAnimationFrame(this.recompute);\n };\n\n register(entry: StickyStackEntry, onChange: ResultListener): symbol {\n const id = Symbol('sticky');\n this.entries.set(id, entry);\n this.listeners.set(id, onChange);\n this.startListening();\n return id;\n }\n\n updateEntry(id: symbol, patch: Partial<Pick<StickyStackEntry, 'offsetTop' | 'disabled'>>): void {\n const entry = this.entries.get(id);\n if (entry) Object.assign(entry, patch);\n }\n\n unregister(id: symbol): void {\n if (!this.entries.has(id)) return;\n this.entries.delete(id);\n this.listeners.delete(id);\n this.results.delete(id);\n this.stopListening();\n }\n\n recompute = (): void => {\n const ordered = [...this.entries.entries()].sort(([, a], [, b]) => compareDomOrder(a.node, b.node));\n const placedByContainer = new Map<HTMLElement | null, { left: number; right: number; bottom: number }[]>();\n\n for (const [id, entry] of ordered) {\n const metrics = entry.getMetrics();\n if (!metrics) continue;\n\n let placed = placedByContainer.get(metrics.container);\n if (!placed) {\n placed = [];\n placedByContainer.set(metrics.container, placed);\n }\n\n const overlapping = placed.filter((p) => rangesOverlap(p.left, p.right, metrics.left, metrics.left + metrics.width));\n const baseTop = overlapping.reduce((max, p) => Math.max(max, p.bottom), entry.offsetTop);\n const isStuck = !entry.disabled && metrics.top <= baseTop;\n const result: StickyStackResult = { isStuck, top: isStuck ? baseTop : entry.offsetTop };\n\n if (isStuck) {\n placed.push({ left: metrics.left, right: metrics.left + metrics.width, bottom: baseTop + metrics.contentHeight });\n }\n\n const prev = this.results.get(id);\n if (!prev || prev.isStuck !== result.isStuck || prev.top !== result.top) {\n this.results.set(id, result);\n this.listeners.get(id)?.(result);\n }\n }\n };\n\n private startListening(): void {\n if (this.listenerCount === 0) {\n window.addEventListener('scroll', this.schedule, { passive: true, capture: true });\n window.addEventListener('resize', this.schedule);\n }\n this.listenerCount++;\n }\n\n private stopListening(): void {\n this.listenerCount--;\n if (this.listenerCount === 0) {\n window.removeEventListener('scroll', this.schedule, { capture: true } as EventListenerOptions);\n window.removeEventListener('resize', this.schedule);\n }\n }\n}\n\nexport const stickyStack = new StickyStack();\n"],"mappings":"AAmCA,SAAS,EAAc,EAAe,EAAgB,EAAe,EAAyB,CAC5F,OAAO,EAAQ,GAAU,EAAQ,CACnC,CAEA,SAAS,EAAgB,EAAgB,EAAwB,CAC/D,GAAI,IAAM,EAAG,MAAO,GACpB,IAAM,EAAW,EAAE,wBAAwB,CAAC,EAG5C,OAFI,EAAW,KAAK,4BAAoC,GACpD,EAAW,KAAK,4BAAoC,EACjD,CACT,CAmFA,IAAa,EAAc,IAAI,KAjFb,4BACE,IAAI,mBACF,IAAI,iBACN,IAAI,eACN,qBACQ,oBAED,CACrB,qBAAqB,KAAK,KAAK,EAC/B,KAAK,MAAQ,sBAAsB,KAAK,SAAS,CACnD,qBAuBwB,CACtB,IAAM,EAAU,CAAC,GAAG,KAAK,QAAQ,QAAQ,CAAC,EAAE,MAAM,EAAG,GAAI,EAAG,KAAO,EAAgB,EAAE,KAAM,EAAE,IAAI,CAAC,EAC5F,EAAoB,IAAI,IAE9B,IAAK,GAAM,CAAC,EAAI,KAAU,EAAS,CACjC,IAAM,EAAU,EAAM,WAAW,EACjC,GAAI,CAAC,EAAS,SAEd,IAAI,EAAS,EAAkB,IAAI,EAAQ,SAAS,EAC/C,IACH,EAAS,CAAC,EACV,EAAkB,IAAI,EAAQ,UAAW,CAAM,GAIjD,IAAM,EADc,EAAO,OAAQ,GAAM,EAAc,EAAE,KAAM,EAAE,MAAO,EAAQ,KAAM,EAAQ,KAAO,EAAQ,KAAK,CAClG,EAAY,QAAQ,EAAK,IAAM,KAAK,IAAI,EAAK,EAAE,MAAM,EAAG,EAAM,SAAS,EACjF,EAAU,CAAC,EAAM,UAAY,EAAQ,KAAO,EAC5C,EAA4B,CAAE,UAAS,IAAK,EAAU,EAAU,EAAM,SAAU,EAElF,GACF,EAAO,KAAK,CAAE,KAAM,EAAQ,KAAM,MAAO,EAAQ,KAAO,EAAQ,MAAO,OAAQ,EAAU,EAAQ,aAAc,CAAC,EAGlH,IAAM,EAAO,KAAK,QAAQ,IAAI,CAAE,GAC5B,CAAC,GAAQ,EAAK,UAAY,EAAO,SAAW,EAAK,MAAQ,EAAO,OAClE,KAAK,QAAQ,IAAI,EAAI,CAAM,EAC3B,KAAK,UAAU,IAAI,CAAE,IAAI,CAAM,EAEnC,CACF,EAlDA,SAAS,EAAyB,EAAkC,CAClE,IAAM,EAAK,OAAO,QAAQ,EAI1B,OAHA,KAAK,QAAQ,IAAI,EAAI,CAAK,EAC1B,KAAK,UAAU,IAAI,EAAI,CAAQ,EAC/B,KAAK,eAAe,EACb,CACT,CAEA,YAAY,EAAY,EAAwE,CAC9F,IAAM,EAAQ,KAAK,QAAQ,IAAI,CAAE,EAC7B,GAAO,OAAO,OAAO,EAAO,CAAK,CACvC,CAEA,WAAW,EAAkB,CACtB,KAAK,QAAQ,IAAI,CAAE,IACxB,KAAK,QAAQ,OAAO,CAAE,EACtB,KAAK,UAAU,OAAO,CAAE,EACxB,KAAK,QAAQ,OAAO,CAAE,EACtB,KAAK,cAAc,EACrB,CAiCA,gBAA+B,CACzB,KAAK,gBAAkB,IACzB,OAAO,iBAAiB,SAAU,KAAK,SAAU,CAAE,QAAS,GAAM,QAAS,EAAK,CAAC,EACjF,OAAO,iBAAiB,SAAU,KAAK,QAAQ,GAEjD,KAAK,eACP,CAEA,eAA8B,CAC5B,KAAK,gBACD,KAAK,gBAAkB,IACzB,OAAO,oBAAoB,SAAU,KAAK,SAAU,CAAE,QAAS,EAAK,CAAyB,EAC7F,OAAO,oBAAoB,SAAU,KAAK,QAAQ,EAEtD,CACF"}
package/dist/index.cjs CHANGED
@@ -9,5 +9,5 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
9
9
  `),s=n.map(t=>{let n=e.points[t.wallIndex],r=e.points[(t.wallIndex+1)%e.points.length],i=Wi(n,r,t);return i?` <path d="${i}" fill="none" />`:``}).filter(Boolean).join(`
10
10
  `),c=e.name?` <text fontSize="5" x="${a.x.toFixed(1)}" y="${a.y.toFixed(1)}">${Vi(e.name)}</text>`:``;return[` <g id="${e.id}">`,o,` <path id="background" d="${i}" />`,s,c,` </g>`].filter(Boolean).join(`
11
11
  `)});return[`<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="${o}">`,` <g id="layer1">`,...s,` </g>`,` <use id="use" href="" />`,`</svg>`].join(`
12
- `)}function Ki(e){let t=[];for(let n of e.matchAll(/[ML]\s*([-\d.]+)[,\s]+([-\d.]+)/gi))t.push({x:parseFloat(n[1]),y:parseFloat(n[2])});return t}function qi(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`),n=[];return t.querySelectorAll(`[id^="room"]`).forEach(e=>{let t=e.querySelector(`[id="background"]`);if(!t)return;let r=t.getAttribute(`d`);if(!r)return;let i=Ki(r);if(i.length<3)return;let a=e.querySelector(`text`)?.textContent?.trim()??``;n.push({id:e.id,name:a,points:i})}),n}function Ji(e,t){let n=Gi(e,t),r=new Blob([n],{type:`image/svg+xml`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`room-plan.svg`,a.click(),URL.revokeObjectURL(i)}var Q={roomDrawer:`roomDrawer_SJj4-`,"roomDrawer-toolbar":`roomDrawer-toolbar_55H5p`,roomDrawerToolbar:`roomDrawer-toolbar_55H5p`,"roomDrawer-toolbar-sep":`roomDrawer-toolbar-sep_nJeh8`,roomDrawerToolbarSep:`roomDrawer-toolbar-sep_nJeh8`,"roomDrawer-toolbar-btn":`roomDrawer-toolbar-btn_2qinY`,roomDrawerToolbarBtn:`roomDrawer-toolbar-btn_2qinY`,"roomDrawer-toolbar-btn-active":`roomDrawer-toolbar-btn-active_4XX25`,roomDrawerToolbarBtnActive:`roomDrawer-toolbar-btn-active_4XX25`,"roomDrawer-toolbar-zoomLabel":`roomDrawer-toolbar-zoomLabel_HMkb5`,roomDrawerToolbarZoomLabel:`roomDrawer-toolbar-zoomLabel_HMkb5`,"roomDrawer-canvas":`roomDrawer-canvas_Y18uD`,roomDrawerCanvas:`roomDrawer-canvas_Y18uD`,"roomDrawer-canvas-select":`roomDrawer-canvas-select_M43-x`,roomDrawerCanvasSelect:`roomDrawer-canvas-select_M43-x`,"roomDrawer-info":`roomDrawer-info_qwC6L`,roomDrawerInfo:`roomDrawer-info_qwC6L`,"roomDrawer-info-label":`roomDrawer-info-label_8I9hB`,roomDrawerInfoLabel:`roomDrawer-info-label_8I9hB`,"roomDrawer-info-input":`roomDrawer-info-input_YAl-K`,roomDrawerInfoInput:`roomDrawer-info-input_YAl-K`,"roomDrawer-info-spacer":`roomDrawer-info-spacer_cOj96`,roomDrawerInfoSpacer:`roomDrawer-info-spacer_cOj96`,"roomDrawer-info-delete":`roomDrawer-info-delete_TSBUN`,roomDrawerInfoDelete:`roomDrawer-info-delete_TSBUN`,"roomDrawer-hint":`roomDrawer-hint_3WTFa`,roomDrawerHint:`roomDrawer-hint_3WTFa`,"roomDrawer-info-doorsBtn":`roomDrawer-info-doorsBtn_oK5Uf`,roomDrawerInfoDoorsBtn:`roomDrawer-info-doorsBtn_oK5Uf`,"roomDrawer-doorPanel":`roomDrawer-doorPanel_e-Tl9`,roomDrawerDoorPanel:`roomDrawer-doorPanel_e-Tl9`,"roomDrawer-doorPanel-header":`roomDrawer-doorPanel-header_--iXz`,roomDrawerDoorPanelHeader:`roomDrawer-doorPanel-header_--iXz`,"roomDrawer-doorPanel-icon":`roomDrawer-doorPanel-icon_KxaVY`,roomDrawerDoorPanelIcon:`roomDrawer-doorPanel-icon_KxaVY`,"roomDrawer-doorPanel-title":`roomDrawer-doorPanel-title_8nOZS`,roomDrawerDoorPanelTitle:`roomDrawer-doorPanel-title_8nOZS`,"roomDrawer-doorPanel-done":`roomDrawer-doorPanel-done_ejQkx`,roomDrawerDoorPanelDone:`roomDrawer-doorPanel-done_ejQkx`,"roomDrawer-doorPanel-list":`roomDrawer-doorPanel-list_rDou7`,roomDrawerDoorPanelList:`roomDrawer-doorPanel-list_rDou7`,"roomDrawer-doorPanel-item":`roomDrawer-doorPanel-item_U-3-B`,roomDrawerDoorPanelItem:`roomDrawer-doorPanel-item_U-3-B`,"roomDrawer-doorPanel-label":`roomDrawer-doorPanel-label_qSYqY`,roomDrawerDoorPanelLabel:`roomDrawer-doorPanel-label_qSYqY`,"roomDrawer-doorPanel-widthLabel":`roomDrawer-doorPanel-widthLabel_jXv7D`,roomDrawerDoorPanelWidthLabel:`roomDrawer-doorPanel-widthLabel_jXv7D`,"roomDrawer-doorPanel-empty":`roomDrawer-doorPanel-empty_LcDw0`,roomDrawerDoorPanelEmpty:`roomDrawer-doorPanel-empty_LcDw0`,"roomDrawer-canvas-door":`roomDrawer-canvas-door_qzCIa`,roomDrawerCanvasDoor:`roomDrawer-canvas-door_qzCIa`,doorGap:`doorGap_KrIuB`,doorMarker:`doorMarker_-N63z`,gridLine:`gridLine_V-rxw`,roomFill:`roomFill_JnJ0J`,"roomFill-selected":`roomFill-selected_IfIRr`,roomFillSelected:`roomFill-selected_IfIRr`,roomStroke:`roomStroke_S18UH`,"roomStroke-selected":`roomStroke-selected_fm19u`,roomStrokeSelected:`roomStroke-selected_fm19u`,roomText:`roomText_6fIeU`,doorPanel:`doorPanel_raCv0`,"doorPanel-selected":`doorPanel-selected_5DG7g`,doorPanelSelected:`doorPanel-selected_5DG7g`,doorSwing:`doorSwing_Tbt9D`,"doorSwing-selected":`doorSwing-selected_fFte5`,doorSwingSelected:`doorSwing-selected_fFte5`,preview:`preview_seIZY`,polyCloseTarget:`polyCloseTarget_snjYx`,polyVertex:`polyVertex_fw0nX`,vertexHandle:`vertexHandle_-z7g5`},Yi=6,Xi=5,Zi=1.25,Qi=.25,$i=12,ea=0;function ta(e){return ea+=1,`${e}${ea}`}var na={select:`Drag inside to move · Drag corner to reshape · Click wall to add corner · Dbl-click corner to remove · Delete to erase`,rect:`Drag to draw a rectangular room`,polygon:`Click to place corners · Click first point or Enter to close · Esc to cancel`};function ra({className:e}){let[t,n]=(0,c.useState)([]),[r,i]=(0,c.useState)([]),[a,o]=(0,c.useState)(`rect`),[s,p]=(0,c.useState)(null),[m,h]=(0,c.useState)(null),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)([]),[S,C]=(0,c.useState)(null),[w,T]=(0,c.useState)(1),[E,D]=(0,c.useState)({x:0,y:0}),O=(0,c.useRef)(null),k=(0,c.useRef)(null),A=(0,c.useRef)(null),j=(0,c.useRef)(null),M=(0,c.useRef)(null),N=(0,c.useRef)({rooms:t,doors:r,tool:a,selectedId:s,editingDoorsForRoomId:m,polyPoints:b,zoom:w,pan:E});(0,c.useLayoutEffect)(()=>{N.current={rooms:t,doors:r,tool:a,selectedId:s,editingDoorsForRoomId:m,polyPoints:b,zoom:w,pan:E}});function P(e){e.length<3||(n(t=>[...t,{id:ta(`room`),name:`Room ${t.length+1}`,points:e}]),x([]),C(null))}(0,c.useEffect)(()=>{let e=j.current;if(!e)return;function t(e){e.preventDefault();let{zoom:t,pan:n}=N.current,r=Ni(e.clientX,e.clientY,j.current);if(!r)return;let i=e.deltaY<0?Zi:1/Zi,a=Math.max(Qi,Math.min($i,t*i));D({x:r.x-(r.x-n.x)*(t/a),y:r.y-(r.y-n.y)*(t/a)}),T(a)}return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]),(0,c.useEffect)(()=>{function e(e){let{tool:t,selectedId:r,editingDoorsForRoomId:a,polyPoints:o,zoom:s,pan:c}=N.current;if(e.key===`Escape`){if(a){h(null);return}t===`polygon`&&(x([]),C(null)),p(null);return}if(e.key===`Enter`&&t===`polygon`&&o.length>=3){P(o);return}if((e.key===`+`||e.key===`=`)&&!(e.target instanceof HTMLInputElement)){let e=Math.max(Qi,Math.min($i,s*Zi)),t=c.x+400/s/2,n=c.y+300/s/2;T(e),D({x:t-400/e/2,y:n-300/e/2});return}if(e.key===`-`&&!(e.target instanceof HTMLInputElement)){let e=Math.max(Qi,Math.min($i,s/Zi)),t=c.x+400/s/2,n=c.y+300/s/2;T(e),D({x:t-400/e/2,y:n-300/e/2});return}if(e.key===`0`&&!(e.target instanceof HTMLInputElement)){T(1),D({x:0,y:0});return}(e.key===`Delete`||e.key===`Backspace`)&&r&&!a&&!(e.target instanceof HTMLInputElement)&&(n(e=>e.filter(e=>e.id!==r)),i(e=>e.filter(e=>e.roomId!==r)),p(null))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);function F(e,t=w,n=E){let r=Math.max(Qi,Math.min($i,t*e)),i=n.x+400/t/2,a=n.y+300/t/2;D({x:i-400/r/2,y:a-300/r/2}),T(r)}function I(e){return j.current?Ni(e.clientX,e.clientY,j.current):null}function L(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=Pi(e,t.points[r]);i<=Yi&&(!n||i<n.d)&&(n={index:r,d:i})}return n}function R(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=t.points[r],a=t.points[(r+1)%t.points.length],{dist:o,t:s}=Fi(e,i,a);o<=Xi&&(!n||o<n.d)&&(n={index:r,t:s,d:o})}return n}function z(e,t,r,a){return n(n=>n.map(n=>{if(n.id!==e)return n;let r=[...n.points];return r.splice(t+1,0,a),{...n,points:r}})),i(n=>n.map(n=>n.roomId===e?n.wallIndex===t?n.t<=r?{...n,t:r>0?n.t/r:0}:{...n,wallIndex:t+1,t:(n.t-r)/(1-r)}:n.wallIndex>t?{...n,wallIndex:n.wallIndex+1}:n:n)),t+1}function B(e,r){let a=t.find(t=>t.id===e);if(!a||a.points.length<=3)return;let o=a.points.length;n(t=>t.map(t=>t.id===e?{...t,points:t.points.filter((e,t)=>t!==r)}:t)),i(t=>t.map(t=>{if(t.roomId!==e)return t;let n=(r-1+o)%o;return t.wallIndex===n||t.wallIndex===r?{...t,wallIndex:-1}:t.wallIndex>r?{...t,wallIndex:t.wallIndex-1}:t}).filter(e=>e.wallIndex!==-1))}function V(e){if(e.button===1){e.preventDefault();let t=j.current;if(t){let n=t.getBoundingClientRect();A.current={startClient:{x:e.clientX,y:e.clientY},origPan:{...E},scaleX:400/w/n.width,scaleY:300/w/n.height}}return}if(e.button!==0)return;e.preventDefault();let n=I(e);if(n){if(m){let e=t.find(e=>e.id===m);if(e){let t=Ii(n,[e]);t&&i(e=>[...e,{id:ta(`door`),roomId:t.roomId,wallIndex:t.wallIndex,t:t.t,width:12}])}return}if(a===`rect`){_(n),y(n);return}if(a===`polygon`){b.length>=3&&Pi(n,b[0])<=8?P(b):x(e=>[...e,n]);return}if(a===`select`){let e=t.find(e=>e.id===s)??null;if(e){let t=L(n,e);if(t){O.current={type:`vertex`,roomId:e.id,index:t.index,start:n,origPt:e.points[t.index]};return}}if(e){let t=R(n,e);if(t){let r=e.points[t.index],i=e.points[(t.index+1)%e.points.length],a=Mi({x:r.x+(i.x-r.x)*t.t,y:r.y+(i.y-r.y)*t.t}),o=z(e.id,t.index,t.t,a);O.current={type:`vertex`,roomId:e.id,index:o,start:n,origPt:a};return}}let r=t.find(e=>Li(n,e.points));if(r){p(r.id),O.current={type:`room`,roomId:r.id,start:n,origPoints:[...r.points]};return}p(null)}}}function ee(e){if(a!==`select`||m)return;let n=I(e);if(!n)return;let r=t.find(e=>e.id===s);if(!r)return;let i=L(n,r);i&&(e.preventDefault(),B(r.id,i.index))}function H(e){if(A.current){let{startClient:t,origPan:n,scaleX:r,scaleY:i}=A.current;D({x:n.x-(e.clientX-t.x)*r,y:n.y-(e.clientY-t.y)*i});return}let r=I(e);if(r){if(k.current&&m){let e=t.find(e=>e.id===m);if(e){let t=Ii(r,[e]);t&&i(e=>e.map(e=>e.id===k.current?{...e,wallIndex:t.wallIndex,t:t.t}:e))}return}if(a===`rect`&&g){y(r);return}if(a===`polygon`){C(r);return}if(a===`select`&&!m&&O.current){let e=O.current;if(e.type===`vertex`){let t=r.x-e.start.x,i=r.y-e.start.y,a=Mi({x:e.origPt.x+t,y:e.origPt.y+i});n(t=>t.map(t=>{if(t.id!==e.roomId)return t;let n=[...t.points];return n[e.index]=a,{...t,points:n}}))}else{let t=r.x-e.start.x,i=r.y-e.start.y;n(n=>n.map(n=>n.id===e.roomId?{...n,points:e.origPoints.map(e=>({x:e.x+t,y:e.y+i}))}:n))}}}}function te(e){if(A.current){A.current=null;return}let t=I(e);if(t){if(a===`rect`&&g){let e=Math.min(g.x,t.x),r=Math.min(g.y,t.y),i=Math.abs(t.x-g.x),a=Math.abs(t.y-g.y);i>=10&&a>=10&&n(t=>[...t,{id:ta(`room`),name:`Room ${t.length+1}`,points:zi(e,r,i,a)}]),_(null),y(null)}k.current=null,O.current=null}}function ne(e){s&&n(t=>t.map(t=>t.id===s?{...t,name:e}:t))}function re(e,t){let n=parseFloat(t);isNaN(n)||n<=0||i(t=>t.map(t=>t.id===e?{...t,width:n}:t))}function U(){s&&(n(e=>e.filter(e=>e.id!==s)),i(e=>e.filter(e=>e.roomId!==s)),h(null),p(null))}function ie(e){i(t=>t.filter(t=>t.id!==e))}function ae(e){o(e),h(null),x([]),C(null),_(null),y(null)}function W(e){let t=e.target.files?.[0];if(!t)return;e.target.value=``;let r=new FileReader;r.onload=e=>{let t=e.target?.result;if(typeof t!=`string`)return;let r=qi(t);r.length!==0&&(n(r.map(e=>({...e,id:ta(`room`)}))),i([]),p(null),h(null),T(1),D({x:0,y:0}))},r.readAsText(t)}let G=a===`rect`&&g&&v?{x:Math.min(g.x,v.x),y:Math.min(g.y,v.y),w:Math.abs(v.x-g.x),h:Math.abs(v.y-g.y)}:null,oe=s?t.find(e=>e.id===s)??null:null,se=m?t.find(e=>e.id===m)??null:null,ce=m?r.filter(e=>e.roomId===m):[],K=[{t:`select`,icon:d.faHandPointer,label:`Select & edit`},{t:`rect`,icon:d.faSquare,label:`Rectangle room`},{t:`polygon`,icon:d.faDrawPolygon,label:`Polygon room`}],le=400/w,ue=300/w,de=m?Q.roomDrawerCanvasDoor:a===`select`?Q.roomDrawerCanvasSelect:void 0;return(0,f.jsxs)(`div`,{className:(0,l.default)(Q.roomDrawer,e),children:[(0,f.jsxs)(`div`,{className:Q.roomDrawerToolbar,children:[K.map(({t:e,icon:t,label:n})=>(0,f.jsx)(`button`,{title:n,className:(0,l.default)(Q.roomDrawerToolbarBtn,e===a&&!m&&Q.roomDrawerToolbarBtnActive),onClick:()=>ae(e),children:(0,f.jsx)(u.FontAwesomeIcon,{icon:t})},e)),(0,f.jsx)(`div`,{className:Q.roomDrawerToolbarSep}),(0,f.jsx)(`button`,{title:`Zoom in (+)`,className:Q.roomDrawerToolbarBtn,onClick:()=>F(Zi),disabled:w>=$i,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faMagnifyingGlassPlus})}),(0,f.jsxs)(`button`,{title:`Reset zoom (0) — ${Math.round(w*100)}%`,className:Q.roomDrawerToolbarZoomLabel,onClick:()=>{T(1),D({x:0,y:0})},children:[Math.round(w*100),`%`]}),(0,f.jsx)(`button`,{title:`Zoom out (−)`,className:Q.roomDrawerToolbarBtn,onClick:()=>F(1/Zi),disabled:w<=Qi,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faMagnifyingGlassMinus})}),(0,f.jsx)(`div`,{className:Q.roomDrawerToolbarSep}),(0,f.jsx)(`button`,{title:`Upload SVG`,className:Q.roomDrawerToolbarBtn,onClick:()=>M.current?.click(),children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faUpload})}),(0,f.jsx)(`button`,{title:`Download SVG`,className:Q.roomDrawerToolbarBtn,onClick:()=>Ji(t,r),disabled:t.length===0,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDownload})}),(0,f.jsx)(`input`,{ref:M,type:`file`,accept:`.svg,image/svg+xml`,style:{display:`none`},onChange:W})]}),(0,f.jsxs)(`svg`,{ref:j,className:(0,l.default)(Q.roomDrawerCanvas,de),viewBox:`${E.x} ${E.y} ${le} ${ue}`,onMouseDown:V,onMouseMove:H,onMouseUp:te,onDoubleClick:ee,children:[(0,f.jsx)(`defs`,{children:(0,f.jsx)(`pattern`,{id:`rd-grid`,width:5,height:5,patternUnits:`userSpaceOnUse`,children:(0,f.jsx)(`path`,{d:`M 5 0 L 0 0 0 5`,fill:`none`,className:Q.gridLine})})}),(0,f.jsx)(`rect`,{x:E.x,y:E.y,width:le,height:ue,fill:`url(#rd-grid)`}),t.map(e=>{let t=e.points,n=t.map((e,t)=>`${t===0?`M`:`L`} ${e.x},${e.y}`).join(` `)+` Z`,i=Ui(t,r.filter(t=>t.roomId===e.id)),a=Ri(t),o=s===e.id,c=m===e.id;return(0,f.jsxs)(`g`,{children:[(0,f.jsx)(`path`,{d:n,className:(0,l.default)(Q.roomFill,(o||c)&&Q.roomFillSelected)}),i.map((e,t)=>(0,f.jsx)(`path`,{d:e,className:(0,l.default)(Q.roomStroke,(o||c)&&Q.roomStrokeSelected)},t)),e.name&&(0,f.jsx)(`text`,{x:a.x,y:a.y,className:Q.roomText,textAnchor:`middle`,dominantBaseline:`middle`,children:e.name})]},e.id)}),r.map(e=>{let n=t.find(t=>t.id===e.roomId);if(!n)return null;let r=n.points[e.wallIndex],i=n.points[(e.wallIndex+1)%n.points.length],a=Bi(r,i,e.t,e.width);return a?(0,f.jsx)(`line`,{x1:a.p1.x,y1:a.p1.y,x2:a.p2.x,y2:a.p2.y,className:Q.doorGap},e.id):null}),m&&ce.map(e=>{let n=t.find(t=>t.id===e.roomId);if(!n)return null;let r=n.points[e.wallIndex],i=n.points[(e.wallIndex+1)%n.points.length],a=Bi(r,i,e.t,e.width);if(!a)return null;let o={x:(a.p1.x+a.p2.x)/2,y:(a.p1.y+a.p2.y)/2};return(0,f.jsx)(`circle`,{cx:o.x,cy:o.y,r:2.5,className:Q.doorMarker,onMouseDown:t=>{t.button===0&&(t.preventDefault(),t.stopPropagation(),k.current=e.id)}},e.id)}),a===`select`&&!m&&oe&&oe.points.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:3.5,className:Q.vertexHandle},t)),G&&(0,f.jsx)(`rect`,{x:G.x,y:G.y,width:G.w,height:G.h,className:Q.preview}),a===`polygon`&&b.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`polyline`,{points:[...b,S??b[b.length-1]].map(e=>`${e.x},${e.y}`).join(` `),className:Q.preview}),b.length>=3&&(0,f.jsx)(`circle`,{cx:b[0].x,cy:b[0].y,r:8/2,className:Q.polyCloseTarget}),b.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:2,className:Q.polyVertex},t))]})]}),oe&&!m&&(0,f.jsxs)(`div`,{className:Q.roomDrawerInfo,children:[(0,f.jsx)(`span`,{className:Q.roomDrawerInfoLabel,children:`Name`}),(0,f.jsx)(`input`,{className:Q.roomDrawerInfoInput,value:oe.name,onChange:e=>ne(e.target.value),placeholder:`Room name`}),(0,f.jsxs)(`button`,{className:Q.roomDrawerInfoDoorsBtn,onClick:()=>h(oe.id),title:`Edit doors`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen}),(0,f.jsx)(`span`,{children:r.filter(e=>e.roomId===oe.id).length})]}),(0,f.jsx)(`button`,{className:Q.roomDrawerInfoDelete,onClick:U,title:`Delete room`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]}),m&&se&&(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanel,children:[(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanelHeader,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen,className:Q.roomDrawerDoorPanelIcon}),(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelTitle,children:se.name?`Doors · ${se.name}`:`Doors`}),(0,f.jsxs)(`button`,{className:Q.roomDrawerDoorPanelDone,onClick:()=>h(null),title:`Done (Esc)`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faCheck}),`Done`]})]}),(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanelList,children:[ce.length===0&&(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelEmpty,children:`Click on a wall to add a door`}),ce.map((e,t)=>(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanelItem,children:[(0,f.jsxs)(`span`,{className:Q.roomDrawerDoorPanelLabel,children:[`Door `,t+1]}),(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelWidthLabel,children:`Width`}),(0,f.jsx)(`input`,{className:Q.roomDrawerInfoInput,type:`number`,min:1,value:e.width,onChange:t=>re(e.id,t.target.value)}),(0,f.jsx)(`button`,{className:Q.roomDrawerInfoDelete,onClick:()=>ie(e.id),title:`Delete door`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]},e.id))]})]}),(0,f.jsx)(`div`,{className:Q.roomDrawerHint,children:m?`Click a wall to add a door · Adjust width or delete from the list · Done or Esc to finish`:`${na[a]} · Scroll to zoom · Middle-drag to pan · 0 to reset`})]})}var ia={"roomViewer-containerLoading":`roomViewer-containerLoading_BL3M-`,roomViewerContainerLoading:`roomViewer-containerLoading_BL3M-`,"roomViewer-container":`roomViewer-container_YlmB8`,roomViewerContainer:`roomViewer-container_YlmB8`,"roomViewer-active":`roomViewer-active_gG6wf`,roomViewerActive:`roomViewer-active_gG6wf`,"roomViewer-selected":`roomViewer-selected_CpdMj`,roomViewerSelected:`roomViewer-selected_CpdMj`,"roomViewer-tint":`roomViewer-tint_O9JrM`,roomViewerTint:`roomViewer-tint_O9JrM`,"roomViewer-actions":`roomViewer-actions_4cA74`,roomViewerActions:`roomViewer-actions_4cA74`,"roomViewer-header":`roomViewer-header_XEHCO`,roomViewerHeader:`roomViewer-header_XEHCO`};function aa({data:e=[]}){let t=(0,c.useRef)(null),[,n]=(0,c.useState)(null),[r,i]=(0,c.useState)(0),[a,o]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let i=new AbortController;n(null);let a=t.current;return r>e.length-1||!a?(o(!1),()=>i.abort()):(a.querySelectorAll(`[id^="room"]`).forEach(e=>{e.addEventListener(`click`,()=>s(e.id,a),{signal:i.signal})}),o(!1),()=>i.abort())},[e,r]);function s(e,t){let r=e.substring(4);n(n=>{if(r===n)return n;let[i]=t.querySelectorAll(`[id="use"]`);i?.setAttribute(`href`,`#${e}`);let[a]=t.querySelectorAll(`[id="${e}"]`);if(n){let[e]=t.querySelectorAll(`[id="room${n}"]`);if(e){e.classList.remove(ia.roomViewerSelected,ia.roomViewerTint);let[t]=e.querySelectorAll(`[id="background"]`);t&&t.classList.remove(ia.roomViewerTint)}}if(a){a.classList.add(ia.roomViewerSelected);let[e]=a.querySelectorAll(`[id="background"]`);(e??a).classList.add(ia.roomViewerTint)}return r})}function p(t){i(n=>{let r=n+t;return r<0||r>e.length-1?n:r})}let m=e[r]?.data??null;return(0,f.jsxs)(`div`,{className:ia.roomViewer,ref:t,children:[(0,f.jsx)(`h3`,{className:ia.roomViewerHeader,children:e[r]?.label??``}),(0,f.jsx)(`div`,{className:(0,l.default)(ia.roomViewerContainer,a&&ia.roomViewerContainerLoading),children:m},r),e.length>1&&(0,f.jsxs)(`div`,{className:ia.roomViewerActions,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronLeft,onClick:()=>p(-1)}),(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faLayerGroup}),(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronRight,onClick:()=>p(1)})]})]})}var oa={scrollbarProvider:`scrollbarProvider_IMBFu`};function sa({className:e=void 0,children:t=void 0}){return(0,f.jsx)(`div`,{className:(0,l.default)(oa.scrollbarProvider,e),children:t})}var ca=sa,la=function(e){return e.Small=`small`,e.Medium=`medium`,e.Large=`large`,e}({}),ua={sectionHeader:`sectionHeader_X3bNj`,"sectionHeader-leading":`sectionHeader-leading_d6opV`,sectionHeaderLeading:`sectionHeader-leading_d6opV`,"sectionHeader-titles":`sectionHeader-titles_iN9dT`,sectionHeaderTitles:`sectionHeader-titles_iN9dT`,"sectionHeader-title":`sectionHeader-title_wH--S`,sectionHeaderTitle:`sectionHeader-title_wH--S`,"sectionHeader-subtitle":`sectionHeader-subtitle_WRK3Y`,sectionHeaderSubtitle:`sectionHeader-subtitle_WRK3Y`,"sectionHeader-trailing":`sectionHeader-trailing_ewWDV`,sectionHeaderTrailing:`sectionHeader-trailing_ewWDV`,"sectionHeader-left":`sectionHeader-left_ZUuWs`,sectionHeaderLeft:`sectionHeader-left_ZUuWs`,"sectionHeader-center":`sectionHeader-center_MzSev`,sectionHeaderCenter:`sectionHeader-center_MzSev`,"sectionHeader-actions":`sectionHeader-actions_E40ZS`,sectionHeaderActions:`sectionHeader-actions_E40ZS`,"sectionHeader-divider":`sectionHeader-divider_Ovpev`,sectionHeaderDivider:`sectionHeader-divider_Ovpev`,"sectionHeader-size-small":`sectionHeader-size-small_6OVWE`,sectionHeaderSizeSmall:`sectionHeader-size-small_6OVWE`,"sectionHeader-size-medium":`sectionHeader-size-medium_BVSe6`,sectionHeaderSizeMedium:`sectionHeader-size-medium_BVSe6`,"sectionHeader-size-large":`sectionHeader-size-large_bOZDP`,sectionHeaderSizeLarge:`sectionHeader-size-large_bOZDP`},da={[la.Small]:ua.sectionHeaderSizeSmall,[la.Medium]:ua.sectionHeaderSizeMedium,[la.Large]:ua.sectionHeaderSizeLarge};function fa(e){let{title:t,subtitle:n,icon:r,thumbnail:i,left:a,center:o,actions:s,level:c=2,size:d=la.Medium,divider:p=!1,className:m,style:h,classNames:g,styles:_,...v}=O(`SectionHeader`,e),y=typeof i==`string`&&i.startsWith(`http`)?i:void 0,b=i!=null&&i!==``,x=b||r!=null,S=`h${c}`;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`div`,{...v,className:(0,l.default)(ua.sectionHeader,da[d],m,g?.root),style:{...h,..._?.root},children:[x&&(0,f.jsx)(`div`,{className:(0,l.default)(ua.sectionHeaderLeading,g?.leading),style:{...y?{backgroundImage:`url(${y})`}:{},..._?.leading},children:b?!y&&i:r&&(0,f.jsx)(u.FontAwesomeIcon,{icon:r})}),(0,f.jsxs)(`div`,{className:(0,l.default)(ua.sectionHeaderTitles,g?.titles),style:_?.titles,children:[(0,f.jsx)(S,{className:(0,l.default)(ua.sectionHeaderTitle,g?.title),style:_?.title,children:t}),n!=null&&n!==``&&(0,f.jsx)(`div`,{className:(0,l.default)(ua.sectionHeaderSubtitle,g?.subtitle),style:_?.subtitle,children:n})]}),(0,f.jsxs)(`div`,{className:(0,l.default)(ua.sectionHeaderTrailing,g?.trailing),style:_?.trailing,children:[(0,f.jsx)(`div`,{className:(0,l.default)(ua.sectionHeaderLeft,g?.left),style:_?.left,children:a}),(0,f.jsx)(`div`,{className:(0,l.default)(ua.sectionHeaderCenter,g?.center),style:_?.center,children:o}),(0,f.jsx)(`div`,{className:(0,l.default)(ua.sectionHeaderActions,g?.actions),style:_?.actions,children:Array.isArray(s)?s.map((e,t)=>(0,f.jsx)(ae,{title:e.title,onClick:e.onClick?t=>{t.stopPropagation(),e.onClick?.(t)}:void 0,icon:e.icon},t)):s})]})]}),p&&(0,f.jsx)(xn,{className:ua.sectionHeaderDivider})]})}var pa=function(e){return e.Text=`text`,e.Circle=`circle`,e.Rectangular=`rectangular`,e}({}),ma=function(e){return e.Shimmer=`shimmer`,e.Pulse=`pulse`,e.None=`none`,e}({}),ha={skeleton:`skeleton_TSg1y`,"skeleton-lines":`skeleton-lines_-Z-gf`,skeletonLines:`skeleton-lines_-Z-gf`,"skeleton-line-last":`skeleton-line-last_UFw21`,skeletonLineLast:`skeleton-line-last_UFw21`,"skeleton-text":`skeleton-text_Jlefj`,skeletonText:`skeleton-text_Jlefj`,"skeleton-circle":`skeleton-circle_t0bbj`,skeletonCircle:`skeleton-circle_t0bbj`,"skeleton-rectangular":`skeleton-rectangular_UtIyN`,skeletonRectangular:`skeleton-rectangular_UtIyN`,"skeleton-animation-pulse":`skeleton-animation-pulse_wGbPg`,skeletonAnimationPulse:`skeleton-animation-pulse_wGbPg`,skeletonPulse:`skeletonPulse_06yjn`,"skeleton-animation-shimmer":`skeleton-animation-shimmer_a0nwc`,skeletonAnimationShimmer:`skeleton-animation-shimmer_a0nwc`,skeletonShimmer:`skeletonShimmer_wLPXR`},ga={[pa.Text]:ha.skeletonText,[pa.Circle]:ha.skeletonCircle,[pa.Rectangular]:ha.skeletonRectangular},_a={[ma.Shimmer]:ha.skeletonAnimationShimmer,[ma.Pulse]:ha.skeletonAnimationPulse,[ma.None]:void 0};function va(e){let{variant:t=pa.Text,animation:n=ma.Shimmer,lines:r=1,className:i,style:a,classNames:o,styles:s,...c}=O(`Skeleton`,e),u=ga[t],d=_a[n];return t!==pa.Text||r<=1?(0,f.jsx)(`span`,{...c,className:(0,l.default)(ha.skeleton,u,d,i),style:a}):(0,f.jsx)(`span`,{...c,className:(0,l.default)(ha.skeletonLines,i),style:a,children:Array.from({length:r},(e,t)=>(0,f.jsx)(`span`,{className:(0,l.default)(ha.skeleton,u,d,t===r-1&&ha.skeletonLineLast,o?.line),style:s?.line},t))})}var ya={slider:`slider_qmg2W`,"slider-thumb":`slider-thumb_CHuJN`,sliderThumb:`slider-thumb_CHuJN`,"slider-disabled":`slider-disabled_T0o2S`,sliderDisabled:`slider-disabled_T0o2S`,"slider-has-mark-labels":`slider-has-mark-labels_Xw6ZJ`,sliderHasMarkLabels:`slider-has-mark-labels_Xw6ZJ`,"slider-track":`slider-track_UyKYc`,sliderTrack:`slider-track_UyKYc`,"slider-range":`slider-range_exAs9`,sliderRange:`slider-range_exAs9`,"slider-dragging":`slider-dragging_htPFH`,sliderDragging:`slider-dragging_htPFH`,"slider-mark":`slider-mark_fvw-n`,sliderMark:`slider-mark_fvw-n`,"slider-mark-label":`slider-mark-label_iDtU2`,sliderMarkLabel:`slider-mark-label_iDtU2`,"slider-value":`slider-value_3rQgd`,sliderValue:`slider-value_3rQgd`};function ba(e){let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1}function xa({value:e,defaultValue:t,onChange:n,onChangeEnd:r,min:i=0,max:a=100,step:o=1,disabled:s=!1,marks:u,showValue:d=!1,formatValue:p,size:m=`18px`,tabIndex:h=0,className:g,style:_,classNames:v,styles:y,"aria-label":b,...x}){let S=(0,c.useRef)(null),C=(0,c.useRef)(null),w=(0,c.useRef)(!1),[T,E]=(0,c.useState)(!1),D=e!==void 0,[O,k]=(0,c.useState)(t??i),A=ba(o);function j(e){return Math.min(a,Math.max(i,e))}function M(e){let t=Math.round((e-i)/o)*o+i;return Number(j(t).toFixed(A))}let N=j(D?e:O),P=(0,c.useRef)(N);(0,c.useEffect)(()=>{P.current=N},[N]);let F=`${(a>i?(N-i)/(a-i):0)*100}%`;function I(e,t){let i=M(e);i!==P.current&&(P.current=i,D||k(i),n?.(i)),t&&r?.(i)}function L(e){let t=S.current;if(!t)return P.current;let n=t.getBoundingClientRect(),r=n.width?(e-n.left)/n.width:0;return i+Math.min(1,Math.max(0,r))*(a-i)}function R(e){s||(e.preventDefault(),C.current?.focus(),C.current?.setPointerCapture?.(e.pointerId),w.current=!0,E(!0),I(L(e.clientX),!1))}function z(e){w.current&&I(L(e.clientX),!1)}function B(e){w.current&&(w.current=!1,E(!1),C.current?.releasePointerCapture?.(e.pointerId),r?.(P.current))}function V(e){if(s)return;let t=o*10,n=null;switch(e.key){case`ArrowRight`:case`ArrowUp`:n=N+o;break;case`ArrowLeft`:case`ArrowDown`:n=N-o;break;case`PageUp`:n=N+t;break;case`PageDown`:n=N-t;break;case`Home`:n=i;break;case`End`:n=a;break;default:return}e.preventDefault(),I(n,!0)}let ee=p?p(N):N,H=!!u?.some(e=>e.label!=null);return(0,f.jsx)(`div`,{...x,ref:C,role:`slider`,"aria-label":b,"aria-valuemin":i,"aria-valuemax":a,"aria-valuenow":N,"aria-valuetext":typeof ee==`string`||typeof ee==`number`?String(ee):void 0,"aria-orientation":`horizontal`,"aria-disabled":s||void 0,tabIndex:s?-1:h,className:(0,l.default)(ya.slider,s&&ya.sliderDisabled,T&&ya.sliderDragging,H&&ya.sliderHasMarkLabels,g,v?.root),style:{"--slider-thumb-size":m,..._,...y?.root},onPointerDown:R,onPointerMove:z,onPointerUp:B,onKeyDown:V,children:(0,f.jsxs)(`div`,{ref:S,className:(0,l.default)(ya.sliderTrack,v?.track),style:y?.track,children:[(0,f.jsx)(`div`,{className:(0,l.default)(ya.sliderRange,v?.range),style:{width:F,...y?.range}}),u?.map(e=>{let t=`${(a>i?(j(e.value)-i)/(a-i):0)*100}%`;return(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(`span`,{className:(0,l.default)(ya.sliderMark,v?.mark),style:{left:t,...y?.mark}}),e.label!=null&&(0,f.jsx)(`span`,{className:(0,l.default)(ya.sliderMarkLabel,v?.markLabel),style:{left:t,...y?.markLabel},children:e.label})]},e.value)}),(0,f.jsx)(`div`,{className:(0,l.default)(ya.sliderThumb,v?.thumb),style:{left:F,...y?.thumb},children:d&&(0,f.jsx)(`span`,{className:(0,l.default)(ya.sliderValue,v?.value),style:y?.value,children:ee})})]})})}var Sa={splitButton:`splitButton_5ak5W`,splitButtonPrimary:`splitButtonPrimary_4mVy8`,splitButtonTrigger:`splitButtonTrigger_32cQA`,splitButtonMenu:`splitButtonMenu_P6Ofl`,splitButtonMenuItem:`splitButtonMenuItem_dbEEz`,"splitButtonMenuItem-disabled":`splitButtonMenuItem-disabled_Dw1mr`,splitButtonMenuItemDisabled:`splitButtonMenuItem-disabled_Dw1mr`,"splitButtonMenuItem-icon":`splitButtonMenuItem-icon_dMuKX`,splitButtonMenuItemIcon:`splitButtonMenuItem-icon_dMuKX`};function Ca(e,t){return(e%t+t)%t}function wa(e){let{children:t,onClick:n=()=>{},actions:r=[],styleType:i=I.Primary,size:a=L.Default,disabled:o=!1,isLoading:s=!1,align:p=Ve.Right,className:m,style:h,classNames:g,styles:_,...v}=O(`SplitButton`,e),[y,b]=(0,c.useState)(!1),x=(0,c.useRef)([]),[S,C]=(0,c.useState)(o);o!==S&&(C(o),o&&b(!1)),(0,c.useEffect)(()=>{if(!y)return;let e=r.findIndex(e=>!e.disabled);e!==-1&&x.current[e]?.focus()},[y]);function w(e,t){let n=r.map((e,t)=>t).filter(e=>!r[e].disabled);if(n.length===0)return;let i=n.indexOf(e),a=i===-1?t===1?0:n.length-1:Ca(i+t,n.length);x.current[n[a]]?.focus()}function T(e){let t=x.current.findIndex(e=>e===document.activeElement);e.key===`ArrowDown`?(e.preventDefault(),w(t,1)):e.key===`ArrowUp`?(e.preventDefault(),w(t,-1)):e.key===`Home`?(e.preventDefault(),w(-1,1)):e.key===`End`&&(e.preventDefault(),w(-1,-1))}return(0,f.jsxs)(Xe,{...v,className:(0,l.default)(Sa.splitButton,g?.root,m),style:{...h,..._?.root},children:[(0,f.jsx)(H,{styleType:i,size:a,disabled:o,isLoading:s,onClick:n,className:(0,l.default)(Sa.splitButtonPrimary,g?.primaryButton),style:_?.primaryButton,children:t}),(0,f.jsx)(Ue,{isOpen:y,onOpenChange:b,align:p,dontCloseOnChildClick:!0,content:(0,f.jsx)(`ul`,{className:(0,l.default)(Sa.splitButtonMenu,g?.menu),style:_?.menu,role:`menu`,onKeyDown:T,children:r.map((e,t)=>(0,f.jsx)(`li`,{role:`none`,children:(0,f.jsxs)(U,{ref:e=>{x.current[t]=e},role:`menuitem`,tabIndex:e.disabled?-1:0,"aria-disabled":e.disabled,className:(0,l.default)(Sa.splitButtonMenuItem,{[Sa.splitButtonMenuItemDisabled]:e.disabled},g?.menuItem),style:_?.menuItem,onClick:()=>{o||e.disabled||(e.onClick(),b(!1))},children:[e.icon?(0,f.jsx)(u.FontAwesomeIcon,{icon:e.icon,className:Sa.splitButtonMenuItemIcon}):null,e.label]})},e.id))}),children:(0,f.jsx)(H,{styleType:i,size:a,disabled:o,icon:d.faChevronDown,"aria-label":`More actions`,className:(0,l.default)(Sa.splitButtonTrigger,g?.triggerButton),style:_?.triggerButton})})]})}var $={stepper:`stepper_kiS2A`,"stepper-vertical":`stepper-vertical_2y9rg`,stepperVertical:`stepper-vertical_2y9rg`,"stepper-label-bottom":`stepper-label-bottom_lDfhy`,stepperLabelBottom:`stepper-label-bottom_lDfhy`,"stepper-label-top":`stepper-label-top_sBw4-`,stepperLabelTop:`stepper-label-top_sBw4-`,"stepper-entry":`stepper-entry_KD4JJ`,stepperEntry:`stepper-entry_KD4JJ`,"stepper-clickable":`stepper-clickable_Nm6fP`,stepperClickable:`stepper-clickable_Nm6fP`,"stepper-entry-disabled":`stepper-entry-disabled_T9S5R`,stepperEntryDisabled:`stepper-entry-disabled_T9S5R`,"stepper-entry-number":`stepper-entry-number_J168Q`,stepperEntryNumber:`stepper-entry-number_J168Q`,"stepper-entry-active":`stepper-entry-active_V1aRt`,stepperEntryActive:`stepper-entry-active_V1aRt`,"stepper-entry-done":`stepper-entry-done_M3wb5`,stepperEntryDone:`stepper-entry-done_M3wb5`,"stepper-entry-error":`stepper-entry-error_xjGSr`,stepperEntryError:`stepper-entry-error_xjGSr`,"stepper-checkmark":`stepper-checkmark_iKCap`,stepperCheckmark:`stepper-checkmark_iKCap`,showCheckmark:`showCheckmark_Rd0oW`,"stepper-marker-cell":`stepper-marker-cell_reOS7`,stepperMarkerCell:`stepper-marker-cell_reOS7`,"stepper-rail-segment":`stepper-rail-segment_U-ZgF`,stepperRailSegment:`stepper-rail-segment_U-ZgF`,"stepper-rail-filled":`stepper-rail-filled_wCImi`,stepperRailFilled:`stepper-rail-filled_wCImi`,"stepper-rail-hidden":`stepper-rail-hidden_l17t6`,stepperRailHidden:`stepper-rail-hidden_l17t6`,"stepper-entry-labels":`stepper-entry-labels_nQT8D`,stepperEntryLabels:`stepper-entry-labels_nQT8D`,"stepper-entry-label":`stepper-entry-label_b94eg`,stepperEntryLabel:`stepper-entry-label_b94eg`,"stepper-description":`stepper-description_5Q0YP`,stepperDescription:`stepper-description_5Q0YP`,"stepper-optional":`stepper-optional_N8mkW`,stepperOptional:`stepper-optional_N8mkW`,"stepper-connector":`stepper-connector_J2FwZ`,stepperConnector:`stepper-connector_J2FwZ`,"stepper-connector-filled":`stepper-connector-filled_W8UZS`,stepperConnectorFilled:`stepper-connector-filled_W8UZS`,"stepper-step":`stepper-step_nUfsV`,stepperStep:`stepper-step_nUfsV`,"stepper-content":`stepper-content_yjlFH`,stepperContent:`stepper-content_yjlFH`,"stepper-label-left":`stepper-label-left_yGbjC`,stepperLabelLeft:`stepper-label-left_yGbjC`,"stepper-content-inner":`stepper-content-inner_0w2wP`,stepperContentInner:`stepper-content-inner_0w2wP`,"stepper-outlined":`stepper-outlined_V7UjP`,stepperOutlined:`stepper-outlined_V7UjP`,"stepper-dots":`stepper-dots_s4cgN`,stepperDots:`stepper-dots_s4cgN`},Ta=function(e){return e.Horizontal=`horizontal`,e.Vertical=`vertical`,e}({}),Ea=function(e){return e.Default=`default`,e.Outlined=`outlined`,e.Dots=`dots`,e}({}),Da=function(e){return e.None=`none`,e.ActiveOnly=`activeOnly`,e.Completed=`completed`,e}({}),Oa=function(e){return e.Top=`top`,e.Bottom=`bottom`,e.Left=`left`,e.Right=`right`,e}({}),ka={[Ea.Default]:$.stepperDefault,[Ea.Outlined]:$.stepperOutlined,[Ea.Dots]:$.stepperDots},Aa={[Oa.Top]:$.stepperLabelTop,[Oa.Bottom]:$.stepperLabelBottom,[Oa.Left]:$.stepperLabelLeft,[Oa.Right]:$.stepperLabelRight};function ja(){return(0,f.jsx)(`svg`,{className:$.stepperCheckmark,strokeLinejoin:`round`,strokeLinecap:`round`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`-0.2 -1.2 3.4 2`,height:`20px`,width:`20px`,children:(0,f.jsx)(`path`,{d:`M 0 0 l 1 1 l 2 -2`,strokeWidth:`0.4`,fill:`none`})})}function Ma({open:e,className:t,style:n,children:r}){let i=(0,c.useRef)(null),[a,o]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=i.current;if(!e)return;let t=new ResizeObserver(()=>o(e.offsetHeight));return t.observe(e),()=>t.disconnect()},[]),(0,f.jsx)(`div`,{className:(0,l.default)($.stepperContent,t),style:{...n,height:e?a??`auto`:0},"aria-hidden":!e,children:(0,f.jsx)(`div`,{ref:i,className:$.stepperContentInner,children:r})})}function Na(e,t){let n=[Oa.Left,Oa.Right];return t?e&&n.includes(e)?e:Oa.Right:e&&!n.includes(e)?e:Oa.Bottom}function Pa({steps:e=[],currentStep:t=0,alignment:n=Ta.Horizontal,onStepClicked:r=null,nonLinear:i=!1,hideLabels:a=!1,styleType:o=Ea.Default,collapse:s=Da.None,labelPlacement:d,className:p,style:m,classNames:h,styles:g,..._}){let v=n===Ta.Vertical,y=Na(d,v);return(0,f.jsx)(`div`,{..._,className:(0,l.default)($.stepper,ka[o],Aa[y],{[$.stepperVertical]:v},h?.root,p),style:{...g?.root,...m},children:e.map((n,o)=>{let d=o<t,p=o<=t,m=!!n.error,_=!!r&&!n.disabled&&(i?o!==t:d),y=(0,l.default)($.stepperEntry,{[$.stepperEntryActive]:p},{[$.stepperEntryDone]:d&&!m},{[$.stepperEntryError]:m},{[$.stepperEntryDisabled]:n.disabled},{[$.stepperClickable]:_},h?.entry),b=n.icon?(0,f.jsx)(u.FontAwesomeIcon,{icon:n.icon,className:h?.icon,style:g?.icon}):d&&!m?(0,f.jsx)(ja,{}):o+1,x=(0,f.jsx)(`div`,{className:(0,l.default)($.stepperEntryNumber,{[$.stepperEntryNumberDone]:d&&!m},h?.entryNumber),style:g?.entryNumber,children:b}),S=n.optional===!0?`Optional`:n.optional===!1?null:n.optional,C=!a&&(0,f.jsxs)(`div`,{className:$.stepperEntryLabels,children:[(0,f.jsx)(`div`,{className:(0,l.default)($.stepperEntryLabel,h?.entryLabel),style:g?.entryLabel,children:n.label}),n.description!=null&&(0,f.jsx)(`div`,{className:(0,l.default)($.stepperDescription,h?.description),style:g?.description,children:n.description}),S!=null&&(0,f.jsx)(`div`,{className:(0,l.default)($.stepperOptional,h?.optional),style:g?.optional,children:S})]}),w=_?{role:`button`,tabIndex:0,onClick:()=>r?.(o),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r?.(o))}}:{},T=e=>(0,f.jsx)(`div`,{className:y,style:g?.entry,"aria-current":o===t?`step`:void 0,"aria-invalid":m||void 0,...w,children:e}),E=o<e.length-1&&(0,f.jsx)(`div`,{className:(0,l.default)($.stepperConnector,{[$.stepperConnectorFilled]:d},h?.connector),style:g?.connector});if(v){let r=o===0,i=o===e.length-1,c=s===Da.None?!0:s===Da.ActiveOnly?o===t:!d,u=e=>{let t=e===`lead`?r:i,n=e===`lead`?p:d;return(0,f.jsx)(`div`,{className:(0,l.default)($.stepperRailSegment,{[$.stepperRailFilled]:!t&&n,[$.stepperRailHidden]:t})})},m=(0,f.jsxs)(`div`,{className:$.stepperMarkerCell,children:[u(`lead`),x,u(`trail`)]});return(0,f.jsxs)(`div`,{className:$.stepperStep,children:[T((0,f.jsxs)(f.Fragment,{children:[m,C]})),E,n.content!=null&&!a&&(0,f.jsx)(Ma,{open:c,className:h?.content,style:g?.content,children:n.content})]},o)}return(0,f.jsxs)(c.default.Fragment,{children:[T((0,f.jsxs)(f.Fragment,{children:[x,C]})),E]},o)})})}function Fa(e,t,n,r){return e<r&&n<t}function Ia(e,t){if(e===t)return 0;let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}var La=new class{constructor(){this.entries=new Map,this.listeners=new Map,this.results=new Map,this.rafId=0,this.listenerCount=0,this.schedule=()=>{cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(this.recompute)},this.recompute=()=>{let e=[...this.entries.entries()].sort(([,e],[,t])=>Ia(e.node,t.node)),t=[];for(let[n,r]of e){let e=r.getMetrics();if(!e)continue;let i=t.filter(t=>Fa(t.left,t.right,e.left,e.left+e.width)).reduce((e,t)=>Math.max(e,t.bottom),r.offsetTop),a=!r.disabled&&e.top<=i,o={isStuck:a,top:a?i:r.offsetTop};a&&t.push({left:e.left,right:e.left+e.width,bottom:i+e.contentHeight});let s=this.results.get(n);(!s||s.isStuck!==o.isStuck||s.top!==o.top)&&(this.results.set(n,o),this.listeners.get(n)?.(o))}}}register(e,t){let n=Symbol(`sticky`);return this.entries.set(n,e),this.listeners.set(n,t),this.startListening(),n}updateEntry(e,t){let n=this.entries.get(e);n&&Object.assign(n,t)}unregister(e){this.entries.has(e)&&(this.entries.delete(e),this.listeners.delete(e),this.results.delete(e),this.stopListening())}startListening(){this.listenerCount===0&&(window.addEventListener(`scroll`,this.schedule,{passive:!0,capture:!0}),window.addEventListener(`resize`,this.schedule)),this.listenerCount++}stopListening(){this.listenerCount--,this.listenerCount===0&&(window.removeEventListener(`scroll`,this.schedule,{capture:!0}),window.removeEventListener(`resize`,this.schedule))}},Ra={sticky:`sticky_L6zO2`,"sticky-content":`sticky-content_ZaXTD`,stickyContent:`sticky-content_ZaXTD`,"sticky-content-stuck":`sticky-content-stuck_w-gRW`,stickyContentStuck:`sticky-content-stuck_w-gRW`,"sticky-placeholder":`sticky-placeholder_aJ3Sb`,stickyPlaceholder:`sticky-placeholder_aJ3Sb`};function za({children:e,offsetTop:t=0,zIndex:n=20,disabled:r=!1,onStuckChange:i,className:a,style:o,classNames:s,styles:u,...d}){let p=(0,c.useRef)(null),m=(0,c.useRef)(null),h=(0,c.useRef)(null),[g,_]=(0,c.useState)({width:0,left:0,height:0}),[v,y]=(0,c.useState)({isStuck:!1,top:t}),b=(0,c.useRef)(i);(0,c.useEffect)(()=>{b.current=i},[i]);let x=(0,c.useCallback)(()=>{let e=p.current,t=m.current;if(!e||!t)return;let n=e.getBoundingClientRect();_({width:e.clientWidth,left:n.left,height:t.offsetHeight}),La.schedule()},[]);(0,c.useLayoutEffect)(()=>{let e=La.register({node:p.current,offsetTop:t,disabled:r,getMetrics:()=>{let e=p.current,t=m.current;if(!e||!t)return null;let n=e.getBoundingClientRect();return{top:n.top,left:n.left,width:e.clientWidth,contentHeight:t.offsetHeight}}},y);return h.current=e,()=>{La.unregister(e),h.current=null}},[]),(0,c.useEffect)(()=>{h.current&&La.updateEntry(h.current,{offsetTop:t,disabled:r}),La.schedule()},[t,r]),(0,c.useLayoutEffect)(()=>{x()},[x,e]),(0,c.useEffect)(()=>{let e=new ResizeObserver(x);return p.current&&e.observe(p.current),m.current&&e.observe(m.current),()=>e.disconnect()},[x]);let S=(0,c.useRef)(!0);(0,c.useEffect)(()=>{if(S.current){S.current=!1;return}b.current?.(v.isStuck)},[v.isStuck]);let C=v.isStuck?{position:`fixed`,top:v.top,left:g.left,width:g.width,zIndex:n,...u?.content}:u?.content;return(0,f.jsxs)(`div`,{ref:p,className:(0,l.default)(Ra.sticky,a,s?.root),style:{...u?.root,...o},...d,children:[v.isStuck&&(0,f.jsx)(`div`,{"aria-hidden":!0,className:(0,l.default)(Ra.stickyPlaceholder,s?.placeholder),style:{height:g.height,...u?.placeholder}}),(0,f.jsx)(`div`,{ref:m,className:(0,l.default)(Ra.stickyContent,v.isStuck&&Ra.stickyContentStuck,s?.content),style:C,children:e})]})}var Ba={switch:`switch_9TG2Y`,"switch-disabled":`switch-disabled_UL-F-`,switchDisabled:`switch-disabled_UL-F-`,"switch-track":`switch-track_awA-t`,switchTrack:`switch-track_awA-t`,"switch-track-checked":`switch-track-checked_boZKe`,switchTrackChecked:`switch-track-checked_boZKe`,"switch-thumb":`switch-thumb_4fUTo`,switchThumb:`switch-thumb_4fUTo`,"switch-thumb-checked":`switch-thumb-checked_GU--w`,switchThumbChecked:`switch-thumb-checked_GU--w`,"switch-label":`switch-label_3pLBQ`,switchLabel:`switch-label_3pLBQ`};function Va(e){let{label:t=``,selected:n=!1,onToggle:r=()=>{},className:i=``,style:a,disabled:o=!1,title:s=``,tabIndex:u=0,formValidator:d=null,children:p=null,classNames:m,styles:h,...g}=O(`Switch`,e),[,_]=(0,c.useState)(0);(0,c.useEffect)(()=>{if(!d)return;let e=()=>_(e=>e+1);return d.registerOnUpdateListener(e),()=>d.removeOnUpdateListener(e)},[d]);function v(e){o||(d&&d.set(!d.value),r(!y,e))}let y=d?d.value:n;return(0,f.jsxs)(`div`,{...g,title:s,className:(0,l.default)(Ba.switch,{[Ba.switchDisabled]:o},i),style:a,onClick:v,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(e))},role:`switch`,"aria-checked":y,tabIndex:o?-1:u,children:[(0,f.jsx)(`div`,{className:(0,l.default)(Ba.switchTrack,y&&Ba.switchTrackChecked,m?.track),style:h?.track,children:(0,f.jsx)(`div`,{className:(0,l.default)(Ba.switchThumb,y&&Ba.switchThumbChecked,m?.thumb),style:h?.thumb})}),(p||t)&&(0,f.jsx)(`div`,{className:(0,l.default)(Ba.switchLabel,m?.label),style:h?.label,children:p||t})]})}var Ha={tabHeader:`tabHeader_C-b9d`,"tabHeader-tab":`tabHeader-tab_Wbyt-`,tabHeaderTab:`tabHeader-tab_Wbyt-`,"tabHeader-tab-active":`tabHeader-tab-active_IExSo`,tabHeaderTabActive:`tabHeader-tab-active_IExSo`,"tabHeader-tab-disabled":`tabHeader-tab-disabled_yWJxS`,tabHeaderTabDisabled:`tabHeader-tab-disabled_yWJxS`,"tabHeader-icon":`tabHeader-icon_ryEHB`,tabHeaderIcon:`tabHeader-icon_ryEHB`,"tabHeader-labels":`tabHeader-labels_q5Af5`,tabHeaderLabels:`tabHeader-labels_q5Af5`,"tabHeader-title":`tabHeader-title_Jq2Vy`,tabHeaderTitle:`tabHeader-title_Jq2Vy`,"tabHeader-subtitle":`tabHeader-subtitle_4lhSa`,tabHeaderSubtitle:`tabHeader-subtitle_4lhSa`};function Ua({tabs:e=[],currentTab:t,onChange:n,className:r,style:i,classNames:a,styles:o,...s}){return(0,f.jsx)(`div`,{...s,role:`tablist`,className:(0,l.default)(Ha.tabHeader,a?.root,r),style:{...o?.root,...i},children:e.map(e=>{let r=e.id===t,i=!!e.title||!!e.subtitle;return(0,f.jsxs)(U,{role:`tab`,"aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:e.disabled?-1:0,className:(0,l.default)(Ha.tabHeaderTab,{[Ha.tabHeaderTabActive]:r},{[Ha.tabHeaderTabDisabled]:e.disabled},a?.tab),style:o?.tab,onClick:()=>{e.disabled||r||n(e.id)},children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:e.icon,className:(0,l.default)(Ha.tabHeaderIcon,a?.icon),style:o?.icon}),i&&(0,f.jsxs)(`div`,{className:(0,l.default)(Ha.tabHeaderLabels,a?.labels),style:o?.labels,children:[e.title&&(0,f.jsx)(`span`,{className:(0,l.default)(Ha.tabHeaderTitle,a?.title),style:o?.title,children:e.title}),e.subtitle&&(0,f.jsx)(`span`,{className:(0,l.default)(Ha.tabHeaderSubtitle,a?.subtitle),style:o?.subtitle,children:e.subtitle})]})]},e.id)})})}function Wa(e){return(0,f.jsx)(Tt,{...O(`Textarea`,e),multiline:!0})}var Ga={id:`default`,variables:{"--grey":`#8A8A8A`,"--lightgrey":`#e0e0e0`,"--lightergrey":`#B1B1B1`,"--white":`#FFFFFF`,"--red":`#D6002A`,"--lighter-red":`#ffeae9`,"--green":`#287626`,"--lighter-green":`#C4FFC9`,"--blue":`#5873d5`,"--lighter-blue":`#C6DBFF`,"--black":`black`,"--orange":`#ff7f50`,"--lighter-orange":`#ffe5d9`,"--primary-color":`#8184d6`,"--primary-accent":`#90CAF9`,"--primary-lighter":`#9a9ce4`,"--accent-color":`var(--grey)`,"--accent-color-light":`var(--lightgrey)`,"--text-color":`var(--white)`,"--text-dark":`var(--lightergrey)`,"--text-light":`var(--lightergrey)`,"--text-on-primary":`var(--white)`,"--text-on-delete":`var(--white)`,"--border-color":`#656574`,"--background":`#393945`,"--background-accent":`#33333c`,"--background-accent-dark":`var(--grey)`,"--background-accent-light":`#484856`,"--background-modal":`#484856`,"--success-color":`var(--green)`,"--success-lighter":`var(--lighter-green)`,"--error-color":`var(--red)`,"--error-lighter":`var(--lighter-red)`,"--required-mark-color":`var(--error-color)`,"--info-color":`var(--blue)`,"--info-lighter":`var(--lighter-blue)`,"--warn-color":`var(--orange)`,"--warn-lighter":`var(--lighter-orange)`,"--default-font-size":`14px`,"--text-small-font-size":`12px`,"--header-font-size":`24px`,"--header-medium-font-size":`18px`,"--header-small-font-size":`16px`,"--default-font-weight":`400`,"--header-font-weight":`600`,"--input-background":`transparent`,"--input-icon-color":`var(--text-color)`,"--error-border-color":`var(--red)`,"--button-default-color":`var(--primary-color)`,"--button-default-border":`1px solid var(--primary-color)`,"--default-border-radius":`8px`,"--padding-sides":`15px`,"--margin-top":`10px`,"--default-font":`'Inter', sans-serif`,"--themed-font":`'Inter', sans-serif`,"--card-shadow":`0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%)`,"--background-card-elevated":`var(--background-accent-light)`,"--background-card-outlined":`transparent`,"--background-card-filled":`var(--background-accent)`,"--spacing-s":`4px`,"--spacing-m":`8px`,"--spacing-l":`16px`}},Ka={themeRoot:`themeRoot_oegLp`,colorFade:`colorFade_eLv2g`},qa=class extends c.Component{constructor(...e){super(...e),this.state={resolvedVariables:{},colorFadeActive:!1,currentThemeColor:null},this.colorFadeTimeout=null,this.wrapperRef=c.default.createRef(),this.themeColorMeta=null,this.createdThemeColorMeta=!1,this.applyTheme=e=>{let t=this.props.themes??[Ga],n=t.find(e=>!e.baseThemeId)??t[0],r=n?n.variables:{},i=t.find(t=>t.id===e),a=i?this.resolveChain(i.id):[],o=Object.assign({},r,...a);this.setState({resolvedVariables:o,colorFadeActive:!0}),this.colorFadeTimeout&&clearTimeout(this.colorFadeTimeout),this.colorFadeTimeout=setTimeout(()=>{this.setState({colorFadeActive:!1}),this.colorFadeTimeout=null},500),setTimeout(()=>{this.wrapperRef.current&&this.setState({currentThemeColor:getComputedStyle(this.wrapperRef.current).getPropertyValue(`--primary-color`).trim()})},1)}}componentDidMount(){this.applyTheme(this.props.currentThemeId),this.syncThemeColorMeta(this.state.currentThemeColor??``)}componentDidUpdate(e,t){t.currentThemeColor!==this.state.currentThemeColor&&this.syncThemeColorMeta(this.state.currentThemeColor??``),(e.currentThemeId!==this.props.currentThemeId||e.themes!==this.props.themes)&&this.applyTheme(this.props.currentThemeId)}componentWillUnmount(){this.colorFadeTimeout&&clearTimeout(this.colorFadeTimeout),this.createdThemeColorMeta&&=(this.themeColorMeta?.remove(),this.themeColorMeta=null,!1)}syncThemeColorMeta(e){if(!(typeof document>`u`)){if(!this.themeColorMeta){let e=document.head.querySelector(`meta[name="theme-color"]`);if(e)this.themeColorMeta=e;else{let e=document.createElement(`meta`);e.setAttribute(`name`,`theme-color`),document.head.appendChild(e),this.themeColorMeta=e,this.createdThemeColorMeta=!0}}this.themeColorMeta.setAttribute(`content`,e)}}resolveChain(e){let t=(this.props.themes??[Ga]).find(t=>t.id===e);return t?[...t.baseThemeId?this.resolveChain(t.baseThemeId):[],t.variables]:[]}render(){let{children:e}=this.props,{resolvedVariables:t,colorFadeActive:n}=this.state;return(0,f.jsx)(`div`,{ref:this.wrapperRef,id:`themeProvider`,className:(0,l.default)(Ka.themeRoot,n&&Ka.colorFade),style:t,children:e})}};function Ja(e=`default`){let[t,n]=(0,c.useState)(localStorage.getItem(`theme`)||e);return{currentThemeId:t,setCurrentThemeId:e=>{n(e),localStorage.setItem(`theme`,e)}}}var Ya=(0,c.createContext)(null);function Xa(){return(0,c.useContext)(Ya)}function Za({children:e,className:t,style:n,...r}){let i=(0,c.useRef)(null),a=(0,c.useRef)(void 0),o=(0,c.useRef)(!1),s=(0,c.useRef)(null),[l,u]=(0,c.useState)({pointer:null,rect:null}),d=()=>{o.current||(o.current=!0,a.current=requestAnimationFrame(()=>{o.current=!1,a.current=void 0;let e=i.current,t=s.current;if(!e||!t)return;let n=e.getBoundingClientRect();u({pointer:{x:t.x-n.left,y:t.y-n.top},rect:n})}))},p=e=>{s.current={x:e.clientX,y:e.clientY},d()},m=()=>{s.current=null,o.current&&a.current!==void 0&&(cancelAnimationFrame(a.current),o.current=!1,a.current=void 0),u({pointer:null,rect:null})};return(0,f.jsx)(`div`,{...r,ref:i,className:t,style:n,onPointerMove:p,onPointerLeave:m,children:(0,f.jsx)(Ya.Provider,{value:l,children:e})})}function Qa(e){let t=Math.max(-1,Math.min(1,e));return Math.sign(t)*Math.abs(t)**1.6}function $a(e,t){return Math.max(-t,Math.min(t,e))}function eo(e,t,n,{maxTiltX:r,maxTiltY:i,easing:a,lockAxis:o}){let s=n.width>0?e/n.width*2-1:0,c=n.height>0?t/n.height*2-1:0;return{rotateX:o===`x`?0:$a(-a(c)*r,r),rotateY:o===`y`?0:$a(a(s)*i,i)}}var to={tilt:`tilt_gbX2b`,"tilt-perspective":`tilt-perspective_CFdP6`,tiltPerspective:`tilt-perspective_CFdP6`,"tilt-surface":`tilt-surface_Jyzwe`,tiltSurface:`tilt-surface_Jyzwe`};function no(){return typeof process<`u`&&!1}function ro(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}var io=.3,ao=.05,oo=(0,c.forwardRef)(function(e,t){let{children:n,maxTilt:r=15,maxTiltX:i,maxTiltY:a,perspective:o=800,easing:s=Qa,lockAxis:u=`none`,scaleOnHover:d=1,trackingMode:p=`self`,disabled:m=!1,onTiltChange:h,className:g,style:_,classNames:v,styles:y,...b}=O(`Tilt`,e),x=(0,c.useRef)(null),S=(0,c.useRef)(null),C=(0,c.useRef)(void 0),w=(0,c.useRef)(!1),T=(0,c.useRef)(!1),E=(0,c.useRef)(!1),D=(0,c.useRef)(null),k=(0,c.useRef)({rotateX:0,rotateY:0}),A=Xa(),j=p===`group`,M=j&&A!==null;(0,c.useEffect)(()=>{j&&A===null&&no()&&console.warn(`Tilt: trackingMode="group" was set with no ancestor TiltGroup, falling back to self tracking.`)},[j,A===null]);let N=i??r,P=a??r;function F(e,t,n){let r=S.current;r&&(r.style.transform=`rotateX(${e}deg) rotateY(${t}deg)`+(n===1?``:` scale(${n})`))}function I(){C.current!==void 0&&(cancelAnimationFrame(C.current),C.current=void 0),w.current=!1}function L(){if(C.current=void 0,!S.current){w.current=!1;return}let e=T.current&&!m&&!ro(),t=0,n=0;if(e){let e=D.current,r=x.current?.getBoundingClientRect();if(e&&r){let i=eo(e.x-r.left,e.y-r.top,r,{maxTiltX:N,maxTiltY:P,easing:s,lockAxis:u});t=i.rotateX,n=i.rotateY}}let r=k.current,i,a;if(E.current?(i=r.rotateX+(t-r.rotateX)*io,a=r.rotateY+(n-r.rotateY)*io,Math.abs(t-i)<ao&&Math.abs(n-a)<ao&&(i=t,a=n,E.current=!1)):(i=t,a=n),k.current={rotateX:i,rotateY:a},F(i,a,e?d:1),h?.(i,a),!E.current){w.current=!1;return}C.current=requestAnimationFrame(L)}function R(){w.current||(w.current=!0,C.current=requestAnimationFrame(L))}function z(e){T.current!==e&&(E.current=!0),T.current=e,R()}let B=e=>{m||M||ro()||(D.current={x:e.clientX,y:e.clientY},z(!0))},V=()=>{M||z(!1)};return(0,c.useEffect)(()=>{if(M){if(m||ro()){z(!1);return}A?.pointer&&A.rect?(D.current={x:A.rect.left+A.pointer.x,y:A.rect.top+A.pointer.y},z(!0)):z(!1)}},[M,m,A?.pointer,A?.rect]),(0,c.useEffect)(()=>()=>{I()},[]),(0,c.useImperativeHandle)(t,()=>({setTilt(e,t){let n={rotateX:Math.max(-N,Math.min(N,e)),rotateY:Math.max(-P,Math.min(P,t))};I(),T.current=!1,E.current=!1,k.current=n,F(n.rotateX,n.rotateY,d),h?.(n.rotateX,n.rotateY)},reset(){I(),T.current=!1,E.current=!1,k.current={rotateX:0,rotateY:0},F(0,0,1)}})),(0,f.jsx)(`div`,{...b,ref:x,className:(0,l.default)(to.tilt,g,v?.root),style:{..._,...y?.root},onPointerMove:B,onPointerLeave:V,onPointerCancel:V,children:(0,f.jsx)(`div`,{className:(0,l.default)(to.tiltPerspective,v?.perspective),style:{perspective:`${o}px`,...y?.perspective},children:(0,f.jsx)(`div`,{ref:S,className:(0,l.default)(to.tiltSurface,v?.surface),style:y?.surface,children:n})})})}),so=e=>(Math.trunc(e)%24+24)%24,co=e=>(Math.trunc(e)%60+60)%60;function lo(e){if(!e)return null;let t=e.match(/^(\d{1,2}):(\d{1,2})$/);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return n>23||r>59?null:{hours:n,minutes:r}}function uo(e){return e?`${String(so(e.hours)).padStart(2,`0`)}:${String(co(e.minutes)).padStart(2,`0`)}`:``}function fo(e,t){return co(!t||t<=1?e:Math.round(co(e)/t)*t)}var po=e=>e.hours*60+e.minutes;function mo(e,t,n){let r=po(e),i=lo(t),a=lo(n);return i&&(r=Math.max(r,po(i))),a&&(r=Math.min(r,po(a))),{hours:Math.floor(r/60),minutes:r%60}}function ho(e,t,n,r,i){let a=r*i*Math.PI/180;return{x:e+n*Math.sin(a),y:t-n*Math.cos(a)}}function go(e,t){return(Math.atan2(e,-t)*180/Math.PI+360)%360}var _o=(e,t)=>Math.sqrt(e*e+t*t),vo={clockFace:`clockFace_LbXIa`,clockHand:`clockHand_E9nTw`,"clockHand-line":`clockHand-line_iOipC`,clockHandLine:`clockHand-line_iOipC`,"clockHand-center":`clockHand-center_VElxx`,clockHandCenter:`clockHand-center_VElxx`,"clockHand-knob":`clockHand-knob_Mb2Fx`,clockHandKnob:`clockHand-knob_Mb2Fx`,clockNumber:`clockNumber_qHDO8`,"clockNumber-inner":`clockNumber-inner_x2XR1`,clockNumberInner:`clockNumber-inner_x2XR1`,"clockNumber-selected":`clockNumber-selected_rPVlV`,clockNumberSelected:`clockNumber-selected_rPVlV`},yo=50,bo=40,xo=25.5,So=65.5/2,Co=30,wo=6,To=e=>(e+11)%12+1;function Eo(e,t){if(e===`minutes`)return Array.from({length:12},(e,t)=>{let n=t*5;return{label:String(n).padStart(2,`0`),slot:t,value:n,ring:`outer`}});if(!t)return Array.from({length:12},(e,t)=>{let n=t===0?12:t;return{label:String(n),slot:t,value:n,ring:`outer`}});let n=Array.from({length:12},(e,t)=>{let n=t===0?12:t;return{label:String(n),slot:t,value:n,ring:`outer`}}),r=Array.from({length:12},(e,t)=>{let n=t===0?0:t+12;return{label:String(n).padStart(2,`0`),slot:t,value:n,ring:`inner`}});return[...n,...r]}function Do({time:e,mode:t,use24Hour:n,minuteStep:r,onChange:i,onCommit:a,classNames:o,styles:s}){let u=(0,c.useRef)(null),d=(0,c.useRef)(!1),p=Eo(t,n),m=e.hours>=12,h=To(e.hours),g=t===`minutes`?{slot:e.minutes,radius:bo}:n?e.hours===0?{slot:0,radius:xo}:e.hours<=12?{slot:e.hours%12,radius:bo}:{slot:(e.hours-12)%12,radius:xo}:{slot:h%12,radius:bo},_=ho(yo,yo,g.radius,g.slot,t===`minutes`?wo:Co),v=i=>t===`minutes`?fo(e.minutes,r)===i.value||e.minutes===i.value:n?e.hours===i.value:h===i.value,y=(i,a)=>{let o=u.current?.getBoundingClientRect();if(!o)return e;let s=i-(o.left+o.width/2),c=a-(o.top+o.height/2),l=go(s,c);if(t===`minutes`){let t=fo(Math.round(l/wo),r);return{hours:e.hours,minutes:t}}let d=Math.round(l/Co)%12;if(!n){let t=d===0?12:d;return{hours:so(m?t%12+12:t%12),minutes:e.minutes}}return{hours:so(_o(s,c)/(o.width/2)*yo<So?d===0?0:d+12:d===0?12:d),minutes:e.minutes}};return(0,f.jsxs)(`div`,{ref:u,className:(0,l.default)(vo.clockFace,o?.clockFace),style:s?.clockFace,onPointerDown:e=>{d.current=!0,e.currentTarget.setPointerCapture?.(e.pointerId),i(y(e.clientX,e.clientY))},onPointerMove:e=>{d.current&&i(y(e.clientX,e.clientY))},onPointerUp:e=>{d.current&&(d.current=!1,a(y(e.clientX,e.clientY)))},role:`slider`,"aria-label":t===`minutes`?`Minutes`:`Hours`,"aria-valuetext":t===`minutes`?`${e.minutes} minutes`:`${e.hours} hours`,children:[(0,f.jsxs)(`svg`,{className:vo.clockHand,viewBox:`0 0 100 100`,"aria-hidden":!0,children:[(0,f.jsx)(`circle`,{cx:yo,cy:yo,r:1.8,className:vo.clockHandCenter}),(0,f.jsx)(`line`,{x1:yo,y1:yo,x2:_.x,y2:_.y,className:vo.clockHandLine}),(0,f.jsx)(`circle`,{cx:_.x,cy:_.y,r:7,className:(0,l.default)(vo.clockHandKnob,o?.clockHand),style:s?.clockHand})]}),p.map(e=>{let t=ho(yo,yo,e.ring===`inner`?xo:bo,e.slot,Co),n=v(e);return(0,f.jsx)(`div`,{className:(0,l.default)(vo.clockNumber,e.ring===`inner`&&vo.clockNumberInner,n&&vo.clockNumberSelected,o?.clockNumber),style:{left:`${t.x}%`,top:`${t.y}%`,...s?.clockNumber},children:e.label},`${e.ring}-${e.value}`)})]})}var Oo={timeInput:`timeInput_EbsZN`,"timeInput-clock":`timeInput-clock_D1-dk`,timeInputClock:`timeInput-clock_D1-dk`,"timeInput-clockHeader":`timeInput-clockHeader_bsYNW`,timeInputClockHeader:`timeInput-clockHeader_bsYNW`,"timeInput-headerSegment":`timeInput-headerSegment_Oiu7e`,timeInputHeaderSegment:`timeInput-headerSegment_Oiu7e`,"timeInput-headerSegment-active":`timeInput-headerSegment-active_-Funz`,timeInputHeaderSegmentActive:`timeInput-headerSegment-active_-Funz`,"timeInput-headerColon":`timeInput-headerColon_LwyQH`,timeInputHeaderColon:`timeInput-headerColon_LwyQH`,"timeInput-meridiem":`timeInput-meridiem_tk9km`,timeInputMeridiem:`timeInput-meridiem_tk9km`,"timeInput-meridiem-active":`timeInput-meridiem-active_40uHm`,timeInputMeridiemActive:`timeInput-meridiem-active_40uHm`,"timeInput-footer":`timeInput-footer_NCXsB`,timeInputFooter:`timeInput-footer_NCXsB`};function ko({value:e,selected:t,onChange:n=()=>null,onSelect:r=()=>null,formValidator:i=null,isInline:a=!1,isModal:o=!1,noInput:s=!1,noHeader:p=!1,showClearButton:m=!1,showNowButton:g=!1,minuteStep:_=1,use24Hour:v=!0,minTime:y=null,maxTime:b=null,label:x=``,isValid:S=!0,errorMessage:C=``,isRequired:w=!1,disabled:T=!1,className:E=``,style:D,classNames:O,styles:k,...A}){let j=()=>i?i.value||``:e??t??``,[M,N]=(0,c.useState)(j),[P,F]=(0,c.useState)(!1),[L,R]=(0,c.useState)(`hours`),[z,B]=(0,c.useState)(!1),[V,ee]=(0,c.useState)(!1),[,te]=(0,c.useState)(0),ne=j(),[re,U]=(0,c.useState)(ne),ie=(0,c.useRef)(i);!i&&re!==ne&&(U(ne),N(ne)),(0,c.useEffect)(()=>{if(ie.current=i,!i)return;let e=()=>{N(i.value||``),te(e=>e+1)};return i.registerOnUpdateListener(e),()=>i.removeOnUpdateListener(e)},[i]);let ae=()=>i?i.touched&&i.hasError():!S||!!C,W=()=>!!(w||i?.validators.find(e=>e.validatorId===`required`)),G=e=>{let t=e?uo(e):null;i&&i.set(t),n?.(t)},oe=e=>{N(e?uo(e):``),G(e)},se=lo(M),ce=se??{hours:12,minutes:0},K=e=>{oe(mo({hours:e.hours,minutes:fo(e.minutes,_)},y,b))},le=e=>{let t=mo({hours:e.hours,minutes:fo(e.minutes,_)},y,b);if(oe(t),L===`hours`){R(`minutes`);return}r?.(uo(t)),a||F(!1)},ue=()=>{T||(R(`hours`),F(!0))},de=({previousState:e,nextState:t})=>{if(!e||t.value===e.value)return t;let n=t.value,r=n.slice(0,2);/^\d\d$/.test(r)&&Number(r)>23&&(n=`23${n.slice(2)}`);let i=n.slice(3,5);return/^\d\d$/.test(i)&&Number(i)>59&&(n=`${n.slice(0,3)}59`),n===t.value?t:{...t,value:n}},q=e=>{N(e);let t=lo(e);t&&G(t)},fe=()=>{ie.current&&(ie.current.touched=!0),B(!1),G(lo(M))},J=e=>{e!==ce.hours>=12&&oe({hours:so(ce.hours+(e?12:-12)),minutes:ce.minutes})},pe=ae(),me=se?String(v?se.hours:(se.hours+11)%12+1).padStart(2,`0`):`--`,he=se?String(se.minutes).padStart(2,`0`):`--`,ge=p?null:(0,f.jsxs)(`div`,{className:(0,l.default)(Oo.timeInputClockHeader,O?.clockHeader),style:k?.clockHeader,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(Oo.timeInputHeaderSegment,L===`hours`&&Oo.timeInputHeaderSegmentActive,O?.headerSegment),style:k?.headerSegment,onClick:()=>R(`hours`),children:me}),(0,f.jsx)(`span`,{className:Oo.timeInputHeaderColon,children:`:`}),(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(Oo.timeInputHeaderSegment,L===`minutes`&&Oo.timeInputHeaderSegmentActive,O?.headerSegment),style:k?.headerSegment,onClick:()=>R(`minutes`),children:he}),!v&&(0,f.jsxs)(`div`,{className:(0,l.default)(Oo.timeInputMeridiem,O?.meridiem),style:k?.meridiem,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(ce.hours<12&&Oo.timeInputMeridiemActive),onClick:()=>J(!1),children:`AM`}),(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(ce.hours>=12&&Oo.timeInputMeridiemActive),onClick:()=>J(!0),children:`PM`})]})]}),_e=m||g?(0,f.jsxs)(`div`,{className:(0,l.default)(Oo.timeInputFooter,O?.footer),style:k?.footer,children:[g&&(0,f.jsx)(H,{styleType:I.Default,onClick:()=>{let e=new Date;K({hours:e.getHours(),minutes:e.getMinutes()})},children:`Now`}),m&&(0,f.jsx)(H,{styleType:I.Default,onClick:()=>{oe(null),r?.(null)},children:`Clear`})]}):null,ve=(0,f.jsxs)(`div`,{className:(0,l.default)(Oo.timeInputClock,O?.clock),style:k?.clock,children:[ge,(0,f.jsx)(Do,{time:ce,mode:L,use24Hour:v,minuteStep:_,onChange:K,onCommit:le,classNames:O,styles:k}),_e]}),ye=s?null:(0,f.jsx)(Tt,{label:`${x}${W()?` *`:``}`,value:M,icon:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faClock}),onIconClick:ue,onClick:ue,readOnly:o,disabled:T,isValid:!pe,customInput:(0,f.jsx)(h.default,{mask:`99:99`,maskPlaceholder:`_`,beforeMaskedStateChange:de}),onChange:e=>q(e),onBlur:fe,onFocus:()=>B(!0),onMouseEnter:()=>ee(!0),onMouseLeave:()=>ee(!1)}),be=a?ve:o?(0,f.jsx)(Bt,{hideHeader:!0,isOpen:P,onClose:()=>F(!1),children:ve}):(0,f.jsx)(Ue,{isOpen:P,onOpenChange:F,content:ve,align:Ve.Left,dontCloseOnChildClick:!0,children:ye});return(0,f.jsxs)(`div`,{className:(0,l.default)(Oo.timeInput,O?.root,E),style:{...k?.root,...D},...A,children:[(o||a)&&ye,be,(0,f.jsx)(vt,{variant:`error`,message:i?i.getCurrentErrorMessage()??``:C||``,isVisible:pe&&(z||V)})]})}var Ao={timeline:`timeline_VtQdt`,"timeline-item":`timeline-item_s8-U2`,timelineItem:`timeline-item_s8-U2`,"timeline-item-connector":`timeline-item-connector_06FQ0`,timelineItemConnector:`timeline-item-connector_06FQ0`,"timeline-item-clickable":`timeline-item-clickable_0w8zK`,timelineItemClickable:`timeline-item-clickable_0w8zK`,"timeline-item-disabled":`timeline-item-disabled_EkWVA`,timelineItemDisabled:`timeline-item-disabled_EkWVA`,"timeline-marker":`timeline-marker_u6jDA`,timelineMarker:`timeline-marker_u6jDA`,"timeline-dot":`timeline-dot_l-s7C`,timelineDot:`timeline-dot_l-s7C`,"timeline-dot-primary":`timeline-dot-primary_5Uk-e`,timelineDotPrimary:`timeline-dot-primary_5Uk-e`,"timeline-dot-success":`timeline-dot-success_iEoLv`,timelineDotSuccess:`timeline-dot-success_iEoLv`,"timeline-dot-warn":`timeline-dot-warn_-6G8K`,timelineDotWarn:`timeline-dot-warn_-6G8K`,"timeline-dot-error":`timeline-dot-error_-10M7`,timelineDotError:`timeline-dot-error_-10M7`,"timeline-connector":`timeline-connector_VuXnH`,timelineConnector:`timeline-connector_VuXnH`,"timeline-content":`timeline-content_K4Ztg`,timelineContent:`timeline-content_K4Ztg`,"timeline-header":`timeline-header_xr4Tw`,timelineHeader:`timeline-header_xr4Tw`,"timeline-title":`timeline-title_MZ26k`,timelineTitle:`timeline-title_MZ26k`,"timeline-timestamp":`timeline-timestamp_-0w-N`,timelineTimestamp:`timeline-timestamp_-0w-N`,"timeline-description":`timeline-description_WcWIu`,timelineDescription:`timeline-description_WcWIu`,"timeline-right":`timeline-right_fZEKn`,timelineRight:`timeline-right_fZEKn`,"timeline-alternate":`timeline-alternate_Kv9LY`,timelineAlternate:`timeline-alternate_Kv9LY`,"timeline-item-right":`timeline-item-right_s5ELB`,timelineItemRight:`timeline-item-right_s5ELB`},jo=function(e){return e.Left=`left`,e.Right=`right`,e.Alternate=`alternate`,e}({}),Mo=function(e){return e.Default=`default`,e.Primary=`primary`,e.Success=`success`,e.Warn=`warn`,e.Error=`error`,e}({}),No={[Mo.Primary]:Ao.timelineDotPrimary,[Mo.Success]:Ao.timelineDotSuccess,[Mo.Warn]:Ao.timelineDotWarn,[Mo.Error]:Ao.timelineDotError};function Po({items:e=[],alignment:t=jo.Left,className:n,style:r,classNames:i,styles:a,...o}){return(0,f.jsx)(`div`,{...o,className:(0,l.default)(Ao.timeline,{[Ao.timelineRight]:t===jo.Right,[Ao.timelineAlternate]:t===jo.Alternate},i?.root,n),style:{...a?.root,...r},children:e.map((n,r)=>{let o=n.id??r,s=r===e.length-1,c=t===jo.Alternate&&r%2==1,d=!!n.onClick&&!n.disabled,p=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`div`,{className:(0,l.default)(Ao.timelineMarker,i?.marker),style:a?.marker,children:[(0,f.jsx)(`div`,{className:(0,l.default)(Ao.timelineDot,No[n.status??Mo.Default],i?.dot),style:a?.dot,children:n.icon&&(0,f.jsx)(u.FontAwesomeIcon,{icon:n.icon})}),!s&&(0,f.jsx)(`div`,{className:(0,l.default)(Ao.timelineConnector,i?.connector),style:a?.connector})]}),(0,f.jsxs)(`div`,{className:(0,l.default)(Ao.timelineContent,i?.content),style:a?.content,children:[(0,f.jsxs)(`div`,{className:Ao.timelineHeader,children:[(0,f.jsx)(`div`,{className:(0,l.default)(Ao.timelineTitle,i?.title),style:a?.title,children:n.title}),n.timestamp!=null&&(0,f.jsx)(`div`,{className:(0,l.default)(Ao.timelineTimestamp,i?.timestamp),style:a?.timestamp,children:n.timestamp})]}),n.description!=null&&(0,f.jsx)(`div`,{className:(0,l.default)(Ao.timelineDescription,i?.description),style:a?.description,children:n.description}),n.content]})]}),m=(0,l.default)(Ao.timelineItem,{[Ao.timelineItemRight]:c},{[Ao.timelineItemClickable]:d},{[Ao.timelineItemDisabled]:n.disabled},i?.item);return d?(0,f.jsx)(U,{className:m,style:a?.item,onClick:n.onClick,children:p},o):(0,f.jsx)(`div`,{className:m,style:a?.item,"aria-disabled":n.disabled||void 0,children:p},o)})})}var Fo={virtualList:`virtualList_qBPNc`,"virtualList-drag-clone":`virtualList-drag-clone_artnC`,virtualListDragClone:`virtualList-drag-clone_artnC`,"virtualList-header":`virtualList-header_0Ellb`,virtualListHeader:`virtualList-header_0Ellb`,"virtualList-header-cell":`virtualList-header-cell_c8NGV`,virtualListHeaderCell:`virtualList-header-cell_c8NGV`,"virtualList-header-toggle":`virtualList-header-toggle_pYFxD`,virtualListHeaderToggle:`virtualList-header-toggle_pYFxD`,"virtualList-toggle-wrapper":`virtualList-toggle-wrapper_JP32M`,virtualListToggleWrapper:`virtualList-toggle-wrapper_JP32M`,"virtualList-toggle-popover":`virtualList-toggle-popover_gbpd7`,virtualListTogglePopover:`virtualList-toggle-popover_gbpd7`,"virtualList-toggle-item":`virtualList-toggle-item_5gu5d`,virtualListToggleItem:`virtualList-toggle-item_5gu5d`,"virtualList-column-chip":`virtualList-column-chip_nOqr6`,virtualListColumnChip:`virtualList-column-chip_nOqr6`,"virtualList-select-cell":`virtualList-select-cell_s9kAy`,virtualListSelectCell:`virtualList-select-cell_s9kAy`,"virtualList-body":`virtualList-body_k-fRr`,virtualListBody:`virtualList-body_k-fRr`,"virtualList-row":`virtualList-row_TTY50`,virtualListRow:`virtualList-row_TTY50`,"virtualList-row-no-divider":`virtualList-row-no-divider_Ct0gV`,virtualListRowNoDivider:`virtualList-row-no-divider_Ct0gV`,"virtualList-row-no-hover":`virtualList-row-no-hover_2d3mH`,virtualListRowNoHover:`virtualList-row-no-hover_2d3mH`,"virtualList-row-selected":`virtualList-row-selected_hwEN-`,virtualListRowSelected:`virtualList-row-selected_hwEN-`,"virtualList-row-draggable":`virtualList-row-draggable_I86ha`,virtualListRowDraggable:`virtualList-row-draggable_I86ha`,"virtualList-row-dragging":`virtualList-row-dragging_6T5tQ`,virtualListRowDragging:`virtualList-row-dragging_6T5tQ`,"virtualList-row-drop-inside":`virtualList-row-drop-inside_Uhi9n`,virtualListRowDropInside:`virtualList-row-drop-inside_Uhi9n`,"virtualList-drop-line":`virtualList-drop-line_EM-g4`,virtualListDropLine:`virtualList-drop-line_EM-g4`,"virtualList-drop-line-before":`virtualList-drop-line-before_n-0iZ`,virtualListDropLineBefore:`virtualList-drop-line-before_n-0iZ`,"virtualList-drop-line-after":`virtualList-drop-line-after_2dld-`,virtualListDropLineAfter:`virtualList-drop-line-after_2dld-`,"virtualList-reordering":`virtualList-reordering_Rt9E3`,virtualListReordering:`virtualList-reordering_Rt9E3`,"virtualList-cell":`virtualList-cell_H0zBv`,virtualListCell:`virtualList-cell_H0zBv`,"virtualList-loading-full":`virtualList-loading-full_wzZNM`,virtualListLoadingFull:`virtualList-loading-full_wzZNM`,"virtualList-loading-indicator":`virtualList-loading-indicator_EJced`,virtualListLoadingIndicator:`virtualList-loading-indicator_EJced`,"virtualList-spinner":`virtualList-spinner_apClW`,virtualListSpinner:`virtualList-spinner_apClW`};function Io({index:e,top:t,padding:n,columnTemplate:r,isSelected:i,showDivider:a,hover:o,onClick:s,observer:u,ariaRowIndex:d,ariaPosInSet:p,ariaSetSize:m,rowRole:h,reorderable:g,mouseDragEnabled:_,draggable:v,isDragging:y,reserveToggleGutter:b,onMouseDown:x,onMouseOver:S,onMouseLeave:C,onDragStart:w,onDragOver:T,onDragEnd:E,onDrop:D,onTouchStart:O,dropPosition:k,dropIndentPx:A,dropIndicatorClassName:j,dropIndicatorStyle:M,rowClassName:N,rowStyle:P,children:F}){let I=(0,c.useRef)(null);return(0,c.useLayoutEffect)(()=>{let e=I.current;if(!(!e||!u))return u.observe(e),()=>u.unobserve(e)},[u]),(0,f.jsxs)(`div`,{ref:I,"data-index":e,className:(0,l.default)(Fo.virtualListRow,i&&Fo.virtualListRowSelected,!a&&Fo.virtualListRowNoDivider,!o&&Fo.virtualListRowNoHover,g&&Fo.virtualListRowDraggable,y&&Fo.virtualListRowDragging,k===`inside`&&Fo.virtualListRowDropInside,N),style:{position:`absolute`,top:0,left:0,right:0,transform:`translateY(${t}px)`,...n==null?{}:{padding:n},...r?{display:`grid`,gridTemplateColumns:r}:{},...b?{paddingRight:32}:{},...P},onClick:s,draggable:v,onMouseDown:x,onMouseOver:S,onMouseLeave:C,onDragStart:w,onDragOver:T,onDragEnd:E,onDrop:D??(_?e=>e.preventDefault():void 0),onTouchStart:O,onContextMenu:_?e=>e.preventDefault():void 0,"aria-selected":i,"aria-rowindex":d,"aria-posinset":p,"aria-setsize":m,role:h,children:[(k===`before`||k===`after`)&&(0,f.jsx)(`div`,{"data-drop-line":k,"aria-hidden":!0,className:(0,l.default)(Fo.virtualListDropLine,k===`before`?Fo.virtualListDropLineBefore:Fo.virtualListDropLineAfter,j),style:{left:A??0,...M}}),F]})}function Lo(e,t,n,r=0){let i=e.length,a=Array(i+1);a[0]=0;for(let o=0;o<i;o++){let s=o<i-1?r:0;a[o+1]=a[o]+(t.get(e[o])??n)+s}return{offsets:a,totalHeight:a[i]}}function Ro(e,t,n){if(n<=0)return 0;let r=0,i=n-1;for(;r<i;){let n=r+i>>1;e[n+1]<=t?r=n+1:i=n}return r}function zo(e,t,n,r,i){if(i===0)return{startIndex:0,endIndex:-1};let a=Ro(e,t,i),o=a;for(;o<i&&e[o]<t+n;)o++;return{startIndex:Math.max(0,a-r),endIndex:Math.min(i-1,o+r-1)}}function Bo(e,t,n,r,i){if(e===-1||e===t)return null;let a=r+i/2;return(t>e?n>=a:n<=a)?t:null}function Vo(e,t,n,r){if(n<=0)return`before`;let i=(e-t)/n;return r?i<1/3?`before`:i>2/3?`after`:`inside`:i<.5?`before`:`after`}function Ho(e,t){let n=t[e],r=e+1;for(;r<t.length&&t[r]>n;)r++;return r-1}function Uo(e,t){return e.length===0?`1fr`:e.map(e=>{switch(e.width.type){case`fixed`:return`${e.width.px}px`;case`flex`:return`${e.width.weight??1}fr`;case`fit`:{let n=t?.[e.key];return n==null?`fit-content(100%)`:`${n}px`}}}).join(` `)}var Wo=`ahroweui:virtuallist:columns:`;function Go(e){if(!e||typeof window>`u`)return null;try{let t=window.localStorage.getItem(Wo+e);if(!t)return null;let n=JSON.parse(t);if(n&&Array.isArray(n.visible)&&Array.isArray(n.known))return{visible:n.visible.filter(e=>typeof e==`string`),known:n.known.filter(e=>typeof e==`string`)}}catch{}return null}function Ko(e,t){return e.lockVisible?!0:t&&t.known.includes(e.key)?t.visible.includes(e.key):!e.defaultHidden}function qo(e,t){if(typeof e==`number`)return e;let n=e.trim();if(n===``)return 0;let r=Number(n);if(!Number.isNaN(r))return r;let i=/^(-?\d*\.?\d+)px$/.exec(n);if(i)return parseFloat(i[1]);if(typeof document>`u`||!t)return 0;let a=document.createElement(`div`);a.style.cssText=`position:absolute;visibility:hidden;height:${n};`,t.appendChild(a);let o=a.getBoundingClientRect().height;return t.removeChild(a),Number.isFinite(o)?o:0}function Jo({items:e,keys:t,getItemKey:n,estimatedRowHeight:r,rowGap:i,overscan:a,onLoadMore:o,loadMoreThreshold:s,isLoading:l}){let[u,d]=(0,c.useState)(0),[f,p]=(0,c.useState)(0),[m,h]=(0,c.useState)(0),[g,_]=(0,c.useState)(()=>qo(i,null)),[v,y]=(0,c.useState)(new Map),[b,x]=(0,c.useState)(!1),S=(0,c.useRef)(!1),C=(0,c.useRef)(null),w=(0,c.useRef)(null),T=(0,c.useRef)([]),E=(0,c.useRef)(null),D=(0,c.useRef)(0),O=(0,c.useRef)([]),[k]=(0,c.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(e=>{y(t=>{let n=null;for(let r of e){let e=r.target,i=Number(e.dataset.index);if(Number.isNaN(i))continue;let a=O.current[i];if(a===void 0)continue;let o=r.borderBoxSize?.[0],s=o?Math.round(o.blockSize):e.offsetHeight;t.get(a)!==s&&(n||=new Map(t),n.set(a,s))}return n??t})}));(0,c.useEffect)(()=>()=>k?.disconnect(),[k]),(0,c.useLayoutEffect)(()=>{let e=C.current;if(!e)return;p(e.clientHeight),h(e.clientWidth);let t=new ResizeObserver(()=>{p(e.clientHeight),h(e.clientWidth)});return t.observe(e),()=>t.disconnect()},[]);let A=(0,c.useRef)(o);(0,c.useLayoutEffect)(()=>{A.current=o});let j=(0,c.useCallback)(()=>{let e=A.current;!e||S.current||(S.current=!0,x(!0),e().finally(()=>{S.current=!1,x(!1)}))},[]),M=(0,c.useCallback)(e=>{let t=e.currentTarget;D.current=t.scrollTop,E.current??=requestAnimationFrame(()=>{E.current=null,d(D.current)}),t.scrollTop+t.clientHeight>=t.scrollHeight-s&&j()},[s,j]);(0,c.useEffect)(()=>()=>{E.current!=null&&cancelAnimationFrame(E.current)},[]),(0,c.useLayoutEffect)(()=>{O.current=t}),(0,c.useLayoutEffect)(()=>{let e=qo(i,C.current);_(t=>t===e?t:e)},[i,m,f]);let{offsets:N,totalHeight:P}=(0,c.useMemo)(()=>Lo(t,v,r,g),[t,v,r,g]),F=(0,c.useRef)(``);(0,c.useEffect)(()=>{if(!o||l||b||f===0||P>=f-(w.current?.offsetHeight??0))return;let t=`${e.length}:${f}`;F.current!==t&&(F.current=t,j())},[o,l,b,e.length,P,f,j]),(0,c.useLayoutEffect)(()=>{let t=C.current,n=T.current;if(T.current=N,!t||n.length===0)return;let r=t.scrollTop;if(r<=0)return;let i=Ro(n,r,n.length-1);if(i>=e.length)return;let a=r-n[i],o=N[i]+a;Math.abs(o-r)>.5&&(t.scrollTop=o,D.current=o,d(o))},[N,e.length]);let I=(0,c.useMemo)(()=>{function t(e,t){let n=C.current;if(!n)return;let r=Math.max(0,e);typeof n.scrollTo==`function`?n.scrollTo({top:r,behavior:t??`auto`}):n.scrollTop=r}function r(n,r){let i=C.current;if(!i||e.length===0)return;let a=Math.max(0,Math.min(n,e.length-1)),o=N[a]??0,s=(N[a+1]??o)-o,c=w.current?.offsetHeight??0,l=Math.max(0,i.clientHeight-c),u=r?.align??`start`,d=o-c;u===`center`?d-=(l-s)/2:u===`end`&&(d-=l-s),t(d,r?.behavior)}return{scrollToIndex:r,scrollToKey(t,i){let a=e.findIndex((e,r)=>(n?n(e,r):r)===t);a>=0&&r(a,i)},scrollToTop(e){t(0,e?.behavior)},getScrollElement:()=>C.current}},[e,N,n]),{startIndex:L,endIndex:R}=(0,c.useMemo)(()=>zo(N,u,f,a,e.length),[N,u,f,a,e.length]);return{rootRef:C,headerRef:w,rowObserver:k,keysRef:O,offsets:N,totalHeight:P,containerHeight:f,containerWidth:m,startIndex:L,endIndex:R,handleScroll:M,showLoadMoreSpinner:b,scrollApi:I}}function Yo({items:e,getKey:t,multiSelect:n,selectedKeys:r,onSelectionChange:i}){let a=r!==void 0,[o,s]=(0,c.useState)(new Set),l=a?r:o;function u(e){a||s(e),i?.(e)}function d(e){let t=new Set(l);t.has(e)?t.delete(e):t.add(e),u(t)}function f(){let n=e.map((e,n)=>t(e,n));u(n.every(e=>l.has(e))?new Set:new Set(n))}let{allSelected:p,someSelected:m}=(0,c.useMemo)(()=>{if(!n||e.length===0)return{allSelected:!1,someSelected:!1};let r=e.every((e,n)=>l.has(t(e,n)));return{allSelected:r,someSelected:!r&&e.some((e,n)=>l.has(t(e,n)))}},[n,e,l,t]);return{effectiveSelectedKeys:l,handleRowSelect:d,handleSelectAll:f,allSelected:p,someSelected:m}}function Xo({columns:e,items:t,multiSelect:n,visibleColumnKeys:r,onVisibleColumnsChange:i,persistColumnsKey:a,showColumnToggle:o,rootRef:s,startIndex:l,endIndex:u,containerHeight:d,containerWidth:f}){let p=r!==void 0,[m,h]=(0,c.useState)(!1),[g,_]=(0,c.useState)({}),[v,y]=(0,c.useState)(()=>{let t=Go(a);return new Set((e??[]).filter(e=>Ko(e,t)).map(e=>e.key))}),b=(0,c.useRef)(new Set((e??[]).map(e=>e.key)));(0,c.useEffect)(()=>{if(p)return;let t=e??[],n=new Set(t.map(e=>e.key)),r=b.current,i=n.size===r.size;if(i){for(let e of n)if(!r.has(e)){i=!1;break}}if(i)return;b.current=n;let o=Go(a);y(e=>{let n=new Set;for(let i of t)r.has(i.key)?e.has(i.key)&&n.add(i.key):Ko(i,o)&&n.add(i.key);return n})},[e,p,a]),(0,c.useEffect)(()=>{if(p||!a||typeof window>`u`)return;let t=e??[];if(!(t.length===0||v.size===0))try{window.localStorage.setItem(Wo+a,JSON.stringify({visible:[...v],known:t.map(e=>e.key)}))}catch{}},[v,e,p,a]);let x=p?new Set(r):v,S=(e??[]).filter(e=>e.lockVisible).map(e=>e.key),C=S.some(e=>!x.has(e))?new Set([...x,...S]):x,w=!!e?.length,T=w?e.filter(e=>C.has(e.key)):[],E=w?e.filter(e=>!e.defaultHidden&&!C.has(e.key)).length:0,D=w?`${n&&w?`40px `:``}${Uo(T,g)}`:void 0,O=o!==!1&&w&&e.some(e=>!e.hideFromToggle),k=T.filter(e=>e.width.type===`fit`),A=k.length>0,j=k.map(e=>e.key).join(`|`),[M,N]=(0,c.useState)({key:j,items:t});(M.key!==j||M.items!==t)&&(N({key:j,items:t}),Object.keys(g).length>0&&_({}));let P=(0,c.useCallback)(()=>{let e=s.current;if(!e)return;let t=new Map;e.querySelectorAll(`[data-fit-key]`).forEach(e=>{let n=e,r=n.getAttribute(`data-fit-key`);if(!r)return;let i=n.scrollWidth>n.clientWidth,a=n.scrollWidth;if(i||n.firstElementChild){let e=getComputedStyle(n),t=parseFloat(e.paddingLeft)||0,r=parseFloat(e.paddingRight)||0;if(i&&(a+=r),n.firstElementChild&&!i&&n.scrollWidth<=t+r+1){let e=1/0,i=-1/0;if(n.querySelectorAll(`*`).forEach(t=>{let n=t.getBoundingClientRect();n.left<e&&(e=n.left),n.right>i&&(i=n.right)}),i>e){let n=Math.ceil(i-e)+t+r;n>a&&(a=n)}}}a>(t.get(r)??0)&&t.set(r,a)}),t.size!==0&&_(n=>{let r=!1,i={...n};for(let[a,o]of t){if(o<=0)continue;let t=Math.min(Math.ceil(o),e.clientWidth);t>(n[a]??0)&&(i[a]=t,r=!0)}return r?i:n})},[s]),[F]=(0,c.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(()=>P())),I=(0,c.useRef)(new Set);(0,c.useEffect)(()=>()=>{F?.disconnect(),I.current.clear()},[F]),(0,c.useLayoutEffect)(()=>{if(!A)return;let e=s.current;if(!e||(P(),!F))return;let t=new Set(e.querySelectorAll(`[data-fit-key]`)),n=I.current;for(let e of n)t.has(e)||(F.unobserve(e),n.delete(e));for(let e of t)n.has(e)||(F.observe(e),n.add(e))},[A,j,g,l,u,d,f,t,P,F]),(0,c.useEffect)(()=>{if(!A)return;let e=0,t=requestAnimationFrame(()=>{P(),e=requestAnimationFrame(()=>P())});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},[A,j,t,P]);let L=(0,c.useCallback)(()=>_({}),[]);function R(t){if(e?.find(e=>e.key===t)?.lockVisible)return;let n=new Set(C);if(n.has(t)){if(n.size<=1)return;n.delete(t)}else n.add(t);let r=[...n];p||y(n),i?.(r)}return{hasColumns:w,visibleColumns:T,columnTemplate:D,shouldShowToggle:O,effectiveVisible:C,manuallyHiddenCount:E,toggleOpen:m,setToggleOpen:h,handleToggleColumn:R,recalculateColumns:L}}function Zo({reorderable:e,treeReorder:t,onReorder:n,onTreeDrop:r,longPressDelay:i,dragHandle:a,treeIndentPx:o,keys:s,depths:l,isGroupAt:u,rootRef:d,keysRef:f}){let p=(0,c.useRef)(null),[m,h]=(0,c.useState)(null),[g,_]=(0,c.useState)(null),v=(0,c.useRef)(null),y=(0,c.useRef)(n),b=(0,c.useRef)(r),x=(0,c.useRef)(t),S=(0,c.useRef)(l),C=(0,c.useRef)(u),w=(0,c.useRef)(!0),T=(0,c.useRef)(null),[E,D]=(0,c.useState)(null),O=(0,c.useRef)(null),k=(0,c.useRef)(!1),A=(0,c.useRef)(null),j=(0,c.useRef)(0),M=(0,c.useRef)(0),N=(0,c.useRef)(null),P=(0,c.useRef)(!1),F=(0,c.useRef)(null),I=(0,c.useRef)(0),L=(0,c.useRef)(0),R=(0,c.useRef)(0),[z]=(0,c.useState)(()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`).matches:!1);(0,c.useLayoutEffect)(()=>{y.current=n,b.current=r,x.current=t,S.current=l,v.current=g,C.current=u});function B(e){z||T.current!==e&&(T.current=e,D(e))}function V(e,t){t.buttons===0&&B(t.target.closest(`[data-drag-handle]`)?e:null)}function ee(e){e.buttons===0&&B(null)}function H(e,t){if(t.button!==0)return;let n=!!t.target.closest(`[data-drag-handle]`);w.current=n,n&&B(e)}function te(e,n){if(a&&!w.current){n.preventDefault();return}p.current=e,h(e),t&&_(null)}function ne(e,t,n){let r=p.current;if(r==null)return null;let i=s.indexOf(r);if(i!==-1&&e>=i&&e<=Ho(i,l))return null;let a=Vo(t,n.top,n.height,u(e));return{key:s[e],position:a}}function re(e,t){t.preventDefault();let n=t.currentTarget.getBoundingClientRect(),r=ne(e,t.clientY,n);_(e=>e?.key===r?.key&&e?.position===r?.position?e:r)}function U(){let e=p.current,t=v.current;e!=null&&t&&t.key!==e&&r?.(e,t)}function ie(e){e.preventDefault(),U(),_(null),p.current=null,h(null),B(null)}function ae(){_(null),p.current=null,h(null),B(null)}function W(e,t){t.preventDefault();let r=p.current;if(r==null)return;let i=s.indexOf(r),a=t.currentTarget.getBoundingClientRect(),o=Bo(i,e,t.clientY,a.top,a.height);o!=null&&n?.(i,o)}function G(){p.current=null,h(null),B(null)}let oe=(0,c.useCallback)(e=>{let t=p.current,n=d.current;if(t==null||!n)return;let r=F.current?M.current-I.current+R.current/2:M.current,i=document.elementFromPoint(e,r),a=i&&n.contains(i)?i.closest(`[data-index]`):null;if(!a)return;let o=Number(a.dataset.index);if(Number.isNaN(o))return;let s=f.current.indexOf(t),c=a.getBoundingClientRect();if(x.current){let e=f.current,t=S.current;if(s!==-1&&o>=s&&o<=Ho(s,t)){_(null);return}let n=Vo(r,c.top,c.height,C.current(o)),i={key:e[o],position:n};_(e=>e?.key===i.key&&e?.position===i.position?e:i);return}let l=Bo(s,o,r,c.top,c.height);l!=null&&y.current?.(s,l)},[d,f]),se=(0,c.useCallback)(()=>{let e=F.current;e&&(e.style.transform=`translate(${L.current}px, ${M.current-I.current}px)`)},[]),ce=(0,c.useCallback)(()=>{let e=d.current;if(!e||!k.current){N.current=null;return}let t=e.getBoundingClientRect(),n=j.current,r=M.current,i=0;n>=t.left&&n<=t.right&&r>=t.top&&r<=t.bottom&&(r<t.top+48?i=-Math.min(18,Math.ceil((t.top+48-r)/3)):r>t.bottom-48&&(i=Math.min(18,Math.ceil((r-(t.bottom-48))/3)))),i!==0&&(e.scrollTop+=i,oe(n)),N.current=requestAnimationFrame(ce)},[oe,d]),K=(0,c.useCallback)(()=>{if(O.current!=null&&(clearTimeout(O.current),O.current=null),window.removeEventListener(`touchmove`,le),window.removeEventListener(`touchend`,K),window.removeEventListener(`touchcancel`,K),N.current!=null&&(cancelAnimationFrame(N.current),N.current=null),F.current&&=(F.current.remove(),null),document.body.style.touchAction=``,document.body.style.overscrollBehavior=``,k.current&&(P.current=!0,setTimeout(()=>{P.current=!1},350),x.current)){let e=p.current,t=v.current;e!=null&&t&&t.key!==e&&b.current?.(e,t)}_(null),k.current=!1,A.current=null,p.current=null,h(null)},[]),le=(0,c.useCallback)(e=>{let t=e.touches[0];if(t){if(j.current=t.clientX,M.current=t.clientY,!k.current){let e=A.current;e!=null&&Math.abs(t.clientY-e)>10&&O.current!=null&&(clearTimeout(O.current),O.current=null);return}e.cancelable&&e.preventDefault(),se(),oe(t.clientX)}},[oe,se]);function ue(n,r){if(!e&&!t||a&&!r.target.closest(`[data-drag-handle]`)||O.current!=null||k.current)return;let o=r.touches[0];o&&(A.current=o.clientY,j.current=o.clientX,M.current=o.clientY,window.addEventListener(`touchmove`,le,{passive:!1}),window.addEventListener(`touchend`,K),window.addEventListener(`touchcancel`,K),O.current=window.setTimeout(()=>{O.current=null,k.current=!0,p.current=n,h(n),navigator.vibrate?.(10),document.body.style.touchAction=`none`,document.body.style.overscrollBehavior=`none`,de(n),N.current??=requestAnimationFrame(ce)},i))}function de(e){let t=d.current;if(!t)return;let n=f.current.indexOf(e),r=t.querySelector(`[data-index="${n}"]`);if(!r)return;let i=r.getBoundingClientRect();I.current=M.current-i.top,L.current=i.left,R.current=i.height;let a=r.cloneNode(!0);a.removeAttribute(`data-index`),a.setAttribute(`data-drag-clone`,`true`),a.setAttribute(`aria-hidden`,`true`),a.classList.add(Fo.virtualListDragClone),Object.assign(a.style,{position:`fixed`,left:`0`,top:`0`,width:`${i.width}px`,height:`${i.height}px`,margin:`0`,opacity:`1`,pointerEvents:`none`,zIndex:`3`,background:`var(--background)`,boxShadow:`var(--card-shadow)`,borderRadius:`var(--default-border-radius)`}),t.appendChild(a),F.current=a,se()}(0,c.useEffect)(()=>K,[K]);let q=e||t,fe=q&&!z;function J(n,r){let i=t&&g?.key===r?g.position:void 0;return{reorderable:q&&!a,mouseDragEnabled:fe,draggable:fe&&(!a||r===E)||void 0,isDragging:q&&r===m,onMouseDown:q&&a?e=>H(r,e):void 0,onMouseOver:q&&a?e=>V(r,e):void 0,onMouseLeave:q&&a?ee:void 0,onDragStart:q?e=>te(r,e):void 0,onDragOver:t?e=>re(n,e):e?e=>W(n,e):void 0,onDragEnd:t?ae:e?G:void 0,onDrop:t?ie:void 0,onTouchStart:q?e=>ue(r,e):void 0,dropPosition:i,dropIndentPx:i?(l[n]??0)*o:void 0}}function pe(){return P.current?(P.current=!1,!0):!1}return{draggingKey:m,dragEnabled:q,getRowDragProps:J,consumeSuppressedClick:pe}}function Qo({items:e,renderRow:t,columns:n,height:r=`100%`,estimatedRowHeight:i=40,overscan:a=3,rowGap:o=0,rowPadding:s,selectedKey:p,getItemKey:m,onRowClick:h,visibleColumnKeys:g,onVisibleColumnsChange:_,persistColumnsKey:v,showColumnToggle:y,onLoadMore:b,loadMoreThreshold:x=100,isLoading:S=!1,multiSelect:C=!1,selectedKeys:w,onSelectionChange:T,reorderable:E=!1,onReorder:D,longPressDelay:O=400,treeReorder:k=!1,getItemDepth:A,isGroup:j,onTreeDrop:M,treeIndentPx:N=24,dragHandle:P=!1,showDivider:I=!0,rowHover:L=!0,className:R,style:z,classNames:B,styles:V,...ee},H){let te=(0,c.useCallback)((e,t)=>m?m(e,t):t,[m]),ne=(0,c.useMemo)(()=>e.map((e,t)=>te(e,t)),[e,te]),re=(0,c.useMemo)(()=>A?e.map((e,t)=>A(e,t)):[],[e,A]),U=(0,c.useCallback)(t=>j?j(e[t],t):!1,[j,e]),ie=Jo({items:e,keys:ne,getItemKey:m,estimatedRowHeight:i,rowGap:o,overscan:a,onLoadMore:b,loadMoreThreshold:x,isLoading:S}),{rootRef:ae,headerRef:W,rowObserver:G,keysRef:oe,offsets:se,totalHeight:ce,startIndex:K,endIndex:le}=ie,ue=Yo({items:e,getKey:te,multiSelect:C,selectedKeys:w,onSelectionChange:T}),{effectiveSelectedKeys:de}=ue,{hasColumns:q,visibleColumns:fe,columnTemplate:J,shouldShowToggle:pe,effectiveVisible:me,manuallyHiddenCount:he,toggleOpen:ge,setToggleOpen:_e,handleToggleColumn:ve,recalculateColumns:ye}=Xo({columns:n,items:e,multiSelect:C,visibleColumnKeys:g,onVisibleColumnsChange:_,persistColumnsKey:v,showColumnToggle:y,rootRef:ae,startIndex:K,endIndex:le,containerHeight:ie.containerHeight,containerWidth:ie.containerWidth});(0,c.useImperativeHandle)(H,()=>({...ie.scrollApi,recalculateColumns:ye}),[ie.scrollApi,ye]);let be=Zo({reorderable:E,treeReorder:k,onReorder:D,onTreeDrop:M,longPressDelay:O,dragHandle:P,treeIndentPx:N,keys:ne,depths:re,isGroupAt:U,rootRef:ae,keysRef:oe}),xe=typeof s==`number`?`${s}px`:s,Se=n=>{let r=e[n],i=te(r,n),a=p!=null&&i===p||de.has(i),o=be.getRowDragProps(n,i);return(0,f.jsx)(Io,{index:n,top:se[n],padding:xe,columnTemplate:J,isSelected:a,showDivider:I,hover:L,onClick:()=>{be.consumeSuppressedClick()||h?.(r,n)},observer:G,ariaRowIndex:q?n+2:void 0,ariaPosInSet:q?void 0:n+1,ariaSetSize:q?void 0:e.length,rowRole:q?`row`:`listitem`,reserveToggleGutter:pe,...o,dropIndicatorClassName:B?.dropIndicator,dropIndicatorStyle:V?.dropIndicator,rowClassName:B?.row,rowStyle:V?.row,children:q?(0,f.jsxs)(f.Fragment,{children:[C&&(0,f.jsx)(`div`,{className:(0,l.default)(Fo.virtualListSelectCell,B?.selectCell),style:V?.selectCell,role:`gridcell`,onClick:e=>e.stopPropagation(),children:(0,f.jsx)(dt,{selected:de.has(i),onToggle:()=>ue.handleRowSelect(i),"aria-label":`Select row`})}),fe.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)(Fo.virtualListCell,B?.cell),style:V?.cell,role:`gridcell`,"data-fit-key":e.width.type===`fit`?e.key:void 0,children:e.renderCell(r,n)},e.key))]}):t?.(r,n)},i)},Ce=[];for(let e=K;e<=le;e++)Ce.push(Se(e));let we=be.draggingKey==null?-1:ne.indexOf(be.draggingKey);return we>=0&&(we<K||we>le)&&Ce.push(Se(we)),(0,f.jsxs)(`div`,{...ee,ref:ae,className:(0,l.default)(Fo.virtualList,be.draggingKey!=null&&Fo.virtualListReordering,R,B?.root),style:{height:r,...z,...V?.root},onScroll:ie.handleScroll,role:q?`grid`:`list`,"aria-rowcount":q?e.length+1:void 0,children:[q&&(0,f.jsxs)(`div`,{ref:W,className:(0,l.default)(Fo.virtualListHeader,B?.header),style:{gridTemplateColumns:J,...pe?{paddingRight:32}:{},...V?.header},role:`row`,"aria-rowindex":1,children:[C&&(0,f.jsx)(`div`,{className:(0,l.default)(Fo.virtualListSelectCell,B?.selectCell),style:V?.selectCell,role:`columnheader`,children:(0,f.jsx)(dt,{selected:ue.allSelected||ue.someSelected,onToggle:ue.handleSelectAll,"aria-label":`Select all rows`})}),fe.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)(Fo.virtualListHeaderCell,B?.headerCell),style:V?.headerCell,role:`columnheader`,"data-fit-key":e.width.type===`fit`?e.key:void 0,children:e.label},e.key)),pe&&(0,f.jsxs)(`div`,{className:Fo.virtualListToggleWrapper,children:[(0,f.jsx)(Ue,{isOpen:ge,onOpenChange:_e,align:Ve.Right,dontCloseOnChildClick:!0,content:(0,f.jsx)(`div`,{className:(0,l.default)(Fo.virtualListTogglePopover,B?.togglePopover),style:V?.togglePopover,children:n.filter(e=>!e.hideFromToggle).map(e=>(0,f.jsx)(dt,{className:(0,l.default)(Fo.virtualListToggleItem,B?.toggleItem),style:V?.toggleItem,selected:me.has(e.key),onToggle:()=>ve(e.key),disabled:e.lockVisible,cursorDefault:!1,children:e.toggleLabel??e.label},e.key))}),children:(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(Fo.virtualListHeaderToggle,B?.headerToggle),style:V?.headerToggle,"aria-label":`Toggle column visibility`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faGear,style:V?.headerToggle})})}),he>0&&(0,f.jsx)(`span`,{className:(0,l.default)(Fo.virtualListColumnChip,B?.columnChip),style:V?.columnChip,"data-column-hidden-count":he,"aria-label":`${he} columns hidden`,children:he})]})]}),S?(0,f.jsx)(`div`,{className:Fo.virtualListLoadingFull,children:(0,f.jsx)(F,{className:Fo.virtualListSpinner})}):(0,f.jsx)(`div`,{className:(0,l.default)(Fo.virtualListBody,B?.body),style:{height:ce,...V?.body},children:Ce}),ie.showLoadMoreSpinner&&(0,f.jsx)(`div`,{className:(0,l.default)(Fo.virtualListLoadingIndicator,B?.loadingIndicator),style:V?.loadingIndicator,children:(0,f.jsx)(F,{className:Fo.virtualListSpinner})})]})}var $o=c.default.forwardRef(Qo),es={wizard:`wizard_uRBAN`,"wizard-content":`wizard-content_lcl4C`,wizardContent:`wizard-content_lcl4C`,"wizard-content-outOfFrame":`wizard-content-outOfFrame_Eks4Y`,wizardContentOutOfFrame:`wizard-content-outOfFrame_Eks4Y`,"wizard-content-container":`wizard-content-container_yxbCJ`,wizardContentContainer:`wizard-content-container_yxbCJ`};function ts({currentStep:e=0,stepCount:t=0,renderStep:n=()=>null,className:r,style:i,classNames:a,styles:o,...s}){let[u,d]=(0,c.useState)(void 0),[p,m]=(0,c.useState)(!1),[h,g]=(0,c.useState)(e),_=(0,c.useRef)([]),v=(0,c.useRef)(null);e!==h&&(g(e),m(!0)),(0,c.useEffect)(()=>{if(!p)return;let e=setTimeout(()=>m(!1),400);return()=>clearTimeout(e)},[p]),(0,c.useEffect)(()=>{v.current?.disconnect();let t=_.current[e];if(t)return d(t.clientHeight),v.current=new ResizeObserver(()=>{d(t.clientHeight)}),v.current.observe(t),()=>v.current?.disconnect()},[e,t]);let y={...u===void 0?{}:{height:`${u}px`},...o?.root,...i};return(0,f.jsx)(`div`,{...s,className:(0,l.default)(es.wizard,a?.root,r),style:y,children:(0,f.jsx)(`div`,{className:(0,l.default)(es.wizardContentContainer,a?.container),style:{width:`${t*100}%`,marginLeft:`-${e*100}%`,...o?.container},children:Array.from({length:t},(r,i)=>(0,f.jsx)(`div`,{ref:e=>{_.current[i]=e},className:(0,l.default)(es.wizardContent,a?.step),style:{width:`${100/t}%`,marginLeft:`${100/t*i}%`,...o?.step},children:(0,f.jsx)(`div`,{className:(0,l.default)({[es.wizardContentOutOfFrame]:e!==i&&!p},a?.stepContent),style:o?.stepContent,inert:e===i?void 0:!0,children:n(i)})},`wizardStep${i}`))})})}var ns=e=>{Un(e[0].message,{type:`error`})},rs=class extends b.FormValidatorGroup{constructor(e,t=null,n){super(e,t,{...n,onSubmitError:n?.onSubmitError??ns}),this.Form=(0,b.createFormComponent)(this)}},is=class extends c.PureComponent{static{this.defaultProps={formValidator:null,onMouseEnter:null,onMouseLeave:null,onFocus:null,onBlur:null,onChange:null,errorMessage:``,isValid:!1,isRequired:!1,label:``}}constructor(e){super(e);let{formValidator:t}=e;t&&(t.label=e.label??``,t.validate(),t.registerOnUpdateListener(()=>{this.forceUpdate()})),this.state={isFocused:!1,isHovered:!1},this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.hasError=this.hasError.bind(this),this.renderTooltip=this.renderTooltip.bind(this),this.onChange=this.onChange.bind(this)}componentDidMount(){setTimeout(()=>this.setState({isFocused:!1,isHovered:!1}),1)}componentDidUpdate(e){let{formValidator:t}=this.props;e.formValidator&&t&&e.formValidator!==t&&t.registerOnUpdateListener(()=>{this.forceUpdate()})}onMouseEnter(e){let{onMouseEnter:t}=this.props;this.setState({isHovered:!0}),t&&t(e)}onMouseLeave(e){let{onMouseLeave:t}=this.props;this.setState({isHovered:!1}),t&&t(e)}onFocus(e){let{onFocus:t}=this.props;this.setState({isFocused:!0}),t&&t(e)}onBlur(e){let{formValidator:t,onBlur:n}=this.props;t&&(t.touched=!0),this.setState({isFocused:!1}),n&&n(e)}hasError(){let{errorMessage:e,isValid:t,formValidator:n}=this.props;return n?n.touched&&n.hasError():!t||!!e}isRequired(){let{isRequired:e,formValidator:t}=this.props;return!!(e||t&&t.validators.find(e=>e.validatorId===`required`))}renderTooltip(){let{errorMessage:e,formValidator:t}=this.props,{isHovered:n,isFocused:r}=this.state;return(0,f.jsx)(vt,{variant:`error`,message:t?t.getCurrentErrorMessage():e||``,isVisible:this.hasError()&&(r||n)})}onChange(e){let{onChange:t,formValidator:n}=this.props;if(n){let t=e;e&&e.target&&(t=e.target.value),n.set(t)}t&&t(e)}};function as(e,{initialValues:t,onSubmit:n,onValidate:r,errorParser:i,onSubmitError:a}={}){return(0,b.useFormValidatorGroupInstance)(()=>new rs(e,null,{initialValues:t,errorParser:i,onSubmitError:a}),n,r)}exports.Accordion=A,exports.AccordionStyleType=x,exports.ActionButtons=te,exports.ActionIcon=ae,exports.Alert=ce,exports.AlertStyleType=W,exports.Align=Ve,exports.AnimatedLogo=de,exports.AnimatedText=xe,exports.AnimatedTextUnit=fe,exports.AnimatedTextVariant=q,exports.Avatar=je,exports.AvatarGroup=Me,exports.Badge=De,exports.BadgePosition=Ce,exports.BadgeStyleType=Se,exports.BodyEnd=Ne,exports.Breadcrumb=Ke,exports.Button=H,exports.ButtonGroup=Xe,exports.ButtonGroupOrientation=Je,exports.ButtonSize=L,exports.ButtonStyleType=I,exports.ButtonType=R,exports.Card=et,exports.CardActions=it,exports.CardContent=rt,exports.CardHeader=tt,exports.CardMedia=nt,exports.CardStyleType=Ze,exports.Carousel=ct,exports.Checkbox=dt,exports.Chip=ht,exports.ChipContainer=gt,exports.ChipStyleType=ft,exports.ColorPicker=Rt,exports.ConfigProvider=D,exports.ConfirmModal=Vt,exports.DatePicker=gn,exports.Divider=xn,exports.DividerOrientation=vn,exports.DividerTextPosition=_n,exports.Drawer=Cn,exports.DropZone=jn,exports.DropZoneReturnType=Tn,exports.DropZoneStatus=wn,exports.Dropdown=mn,exports.EmptyState=Nn,exports.ErrorBoundary=Qn,exports.Fab=rr,exports.Flip=sr,exports.FloatingMenu=Ue,Object.defineProperty(exports,"FormValidator",{enumerable:!0,get:function(){return b.FormValidator}}),exports.FormValidatorGroup=rs,exports.IconLoading=Qr,exports.IconPicker=dr,exports.IdleManager=pr,exports.InfiniteBlock=pn,exports.Input=Tt,exports.InputDropdown=_r,exports.InputIconPosition=wt,exports.InputType=Ct,exports.InteractableDiv=U,exports.KanbanBoard=zr,exports.KanbanColumn=Cr,exports.KlipyPicker=Yr,exports.Modal=Bt,exports.NumberInput=ti,exports.OptionPicker=ri,exports.Overscroll=si,exports.Popover=hi,exports.PopoverAlign=ui,exports.PopoverPlacement=li,exports.PopoverTrigger=di,exports.ProgressBar=vi,exports.RadioGroup=xi,exports.RadioGroupOrientation=yi,exports.Rating=Ti,exports.RevealLens=Ai,exports.Ripple=B,exports.RoomDrawer=ra,exports.RoomViewer=aa,exports.ScrollbarProvider=ca,exports.SearchInput=Ur,exports.SectionHeader=fa,exports.SectionHeaderSize=la,exports.Skeleton=va,exports.SkeletonAnimation=ma,exports.SkeletonVariant=pa,exports.Slider=xa,exports.SpinnerLoading=F,exports.SplitButton=wa,exports.Stepper=Pa,exports.StepperAlignment=Ta,exports.StepperCollapse=Da,exports.StepperLabelPlacement=Oa,exports.StepperStyleType=Ea,exports.Sticky=za,exports.Switch=Va,exports.TabHeader=Ua,exports.Textarea=Wa,exports.ThemeProvider=qa,exports.Tilt=oo,exports.TiltGroup=Za,exports.TiltGroupContext=Ya,exports.TimeInput=ko,exports.Timeline=Po,exports.TimelineAlignment=jo,exports.TimelineItemStatus=Mo,exports.ToastProvider=qn,exports.Tooltip=vt,exports.ValidatableComponent=is,Object.defineProperty(exports,"Validators",{enumerable:!0,get:function(){return b.Validators}}),exports.VirtualList=$o,exports.Wizard=ts,exports.defaultTheme=Ga,exports.defaultTiltEasing=Qa,exports.getLocale=Yt,Object.defineProperty(exports,"hasEightPasswordChars",{enumerable:!0,get:function(){return b.hasEightPasswordChars}}),Object.defineProperty(exports,"hasOnePasswordDigit",{enumerable:!0,get:function(){return b.hasOnePasswordDigit}}),Object.defineProperty(exports,"hasOnePasswordLetter",{enumerable:!0,get:function(){return b.hasOnePasswordLetter}}),Object.defineProperty(exports,"isBic",{enumerable:!0,get:function(){return b.isBic}}),Object.defineProperty(exports,"isDate",{enumerable:!0,get:function(){return b.isDate}}),Object.defineProperty(exports,"isEmail",{enumerable:!0,get:function(){return b.isEmail}}),Object.defineProperty(exports,"isISODate",{enumerable:!0,get:function(){return b.isISODate}}),Object.defineProperty(exports,"isNumber",{enumerable:!0,get:function(){return b.isNumber}}),Object.defineProperty(exports,"isPassword",{enumerable:!0,get:function(){return b.isPassword}}),Object.defineProperty(exports,"isURL",{enumerable:!0,get:function(){return b.isURL}}),exports.mapLocale=Kt,exports.setLocale=Jt,exports.showToast=Un,exports.useComponentDefaults=O,Object.defineProperty(exports,"useFormValidator",{enumerable:!0,get:function(){return b.useFormValidator}}),exports.useFormValidatorGroup=as,exports.useTheme=Ja,exports.useTiltGroup=Xa;
12
+ `)}function Ki(e){let t=[];for(let n of e.matchAll(/[ML]\s*([-\d.]+)[,\s]+([-\d.]+)/gi))t.push({x:parseFloat(n[1]),y:parseFloat(n[2])});return t}function qi(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`),n=[];return t.querySelectorAll(`[id^="room"]`).forEach(e=>{let t=e.querySelector(`[id="background"]`);if(!t)return;let r=t.getAttribute(`d`);if(!r)return;let i=Ki(r);if(i.length<3)return;let a=e.querySelector(`text`)?.textContent?.trim()??``;n.push({id:e.id,name:a,points:i})}),n}function Ji(e,t){let n=Gi(e,t),r=new Blob([n],{type:`image/svg+xml`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`room-plan.svg`,a.click(),URL.revokeObjectURL(i)}var Q={roomDrawer:`roomDrawer_SJj4-`,"roomDrawer-toolbar":`roomDrawer-toolbar_55H5p`,roomDrawerToolbar:`roomDrawer-toolbar_55H5p`,"roomDrawer-toolbar-sep":`roomDrawer-toolbar-sep_nJeh8`,roomDrawerToolbarSep:`roomDrawer-toolbar-sep_nJeh8`,"roomDrawer-toolbar-btn":`roomDrawer-toolbar-btn_2qinY`,roomDrawerToolbarBtn:`roomDrawer-toolbar-btn_2qinY`,"roomDrawer-toolbar-btn-active":`roomDrawer-toolbar-btn-active_4XX25`,roomDrawerToolbarBtnActive:`roomDrawer-toolbar-btn-active_4XX25`,"roomDrawer-toolbar-zoomLabel":`roomDrawer-toolbar-zoomLabel_HMkb5`,roomDrawerToolbarZoomLabel:`roomDrawer-toolbar-zoomLabel_HMkb5`,"roomDrawer-canvas":`roomDrawer-canvas_Y18uD`,roomDrawerCanvas:`roomDrawer-canvas_Y18uD`,"roomDrawer-canvas-select":`roomDrawer-canvas-select_M43-x`,roomDrawerCanvasSelect:`roomDrawer-canvas-select_M43-x`,"roomDrawer-info":`roomDrawer-info_qwC6L`,roomDrawerInfo:`roomDrawer-info_qwC6L`,"roomDrawer-info-label":`roomDrawer-info-label_8I9hB`,roomDrawerInfoLabel:`roomDrawer-info-label_8I9hB`,"roomDrawer-info-input":`roomDrawer-info-input_YAl-K`,roomDrawerInfoInput:`roomDrawer-info-input_YAl-K`,"roomDrawer-info-spacer":`roomDrawer-info-spacer_cOj96`,roomDrawerInfoSpacer:`roomDrawer-info-spacer_cOj96`,"roomDrawer-info-delete":`roomDrawer-info-delete_TSBUN`,roomDrawerInfoDelete:`roomDrawer-info-delete_TSBUN`,"roomDrawer-hint":`roomDrawer-hint_3WTFa`,roomDrawerHint:`roomDrawer-hint_3WTFa`,"roomDrawer-info-doorsBtn":`roomDrawer-info-doorsBtn_oK5Uf`,roomDrawerInfoDoorsBtn:`roomDrawer-info-doorsBtn_oK5Uf`,"roomDrawer-doorPanel":`roomDrawer-doorPanel_e-Tl9`,roomDrawerDoorPanel:`roomDrawer-doorPanel_e-Tl9`,"roomDrawer-doorPanel-header":`roomDrawer-doorPanel-header_--iXz`,roomDrawerDoorPanelHeader:`roomDrawer-doorPanel-header_--iXz`,"roomDrawer-doorPanel-icon":`roomDrawer-doorPanel-icon_KxaVY`,roomDrawerDoorPanelIcon:`roomDrawer-doorPanel-icon_KxaVY`,"roomDrawer-doorPanel-title":`roomDrawer-doorPanel-title_8nOZS`,roomDrawerDoorPanelTitle:`roomDrawer-doorPanel-title_8nOZS`,"roomDrawer-doorPanel-done":`roomDrawer-doorPanel-done_ejQkx`,roomDrawerDoorPanelDone:`roomDrawer-doorPanel-done_ejQkx`,"roomDrawer-doorPanel-list":`roomDrawer-doorPanel-list_rDou7`,roomDrawerDoorPanelList:`roomDrawer-doorPanel-list_rDou7`,"roomDrawer-doorPanel-item":`roomDrawer-doorPanel-item_U-3-B`,roomDrawerDoorPanelItem:`roomDrawer-doorPanel-item_U-3-B`,"roomDrawer-doorPanel-label":`roomDrawer-doorPanel-label_qSYqY`,roomDrawerDoorPanelLabel:`roomDrawer-doorPanel-label_qSYqY`,"roomDrawer-doorPanel-widthLabel":`roomDrawer-doorPanel-widthLabel_jXv7D`,roomDrawerDoorPanelWidthLabel:`roomDrawer-doorPanel-widthLabel_jXv7D`,"roomDrawer-doorPanel-empty":`roomDrawer-doorPanel-empty_LcDw0`,roomDrawerDoorPanelEmpty:`roomDrawer-doorPanel-empty_LcDw0`,"roomDrawer-canvas-door":`roomDrawer-canvas-door_qzCIa`,roomDrawerCanvasDoor:`roomDrawer-canvas-door_qzCIa`,doorGap:`doorGap_KrIuB`,doorMarker:`doorMarker_-N63z`,gridLine:`gridLine_V-rxw`,roomFill:`roomFill_JnJ0J`,"roomFill-selected":`roomFill-selected_IfIRr`,roomFillSelected:`roomFill-selected_IfIRr`,roomStroke:`roomStroke_S18UH`,"roomStroke-selected":`roomStroke-selected_fm19u`,roomStrokeSelected:`roomStroke-selected_fm19u`,roomText:`roomText_6fIeU`,doorPanel:`doorPanel_raCv0`,"doorPanel-selected":`doorPanel-selected_5DG7g`,doorPanelSelected:`doorPanel-selected_5DG7g`,doorSwing:`doorSwing_Tbt9D`,"doorSwing-selected":`doorSwing-selected_fFte5`,doorSwingSelected:`doorSwing-selected_fFte5`,preview:`preview_seIZY`,polyCloseTarget:`polyCloseTarget_snjYx`,polyVertex:`polyVertex_fw0nX`,vertexHandle:`vertexHandle_-z7g5`},Yi=6,Xi=5,Zi=1.25,Qi=.25,$i=12,ea=0;function ta(e){return ea+=1,`${e}${ea}`}var na={select:`Drag inside to move · Drag corner to reshape · Click wall to add corner · Dbl-click corner to remove · Delete to erase`,rect:`Drag to draw a rectangular room`,polygon:`Click to place corners · Click first point or Enter to close · Esc to cancel`};function ra({className:e}){let[t,n]=(0,c.useState)([]),[r,i]=(0,c.useState)([]),[a,o]=(0,c.useState)(`rect`),[s,p]=(0,c.useState)(null),[m,h]=(0,c.useState)(null),[g,_]=(0,c.useState)(null),[v,y]=(0,c.useState)(null),[b,x]=(0,c.useState)([]),[S,C]=(0,c.useState)(null),[w,T]=(0,c.useState)(1),[E,D]=(0,c.useState)({x:0,y:0}),O=(0,c.useRef)(null),k=(0,c.useRef)(null),A=(0,c.useRef)(null),j=(0,c.useRef)(null),M=(0,c.useRef)(null),N=(0,c.useRef)({rooms:t,doors:r,tool:a,selectedId:s,editingDoorsForRoomId:m,polyPoints:b,zoom:w,pan:E});(0,c.useLayoutEffect)(()=>{N.current={rooms:t,doors:r,tool:a,selectedId:s,editingDoorsForRoomId:m,polyPoints:b,zoom:w,pan:E}});function P(e){e.length<3||(n(t=>[...t,{id:ta(`room`),name:`Room ${t.length+1}`,points:e}]),x([]),C(null))}(0,c.useEffect)(()=>{let e=j.current;if(!e)return;function t(e){e.preventDefault();let{zoom:t,pan:n}=N.current,r=Ni(e.clientX,e.clientY,j.current);if(!r)return;let i=e.deltaY<0?Zi:1/Zi,a=Math.max(Qi,Math.min($i,t*i));D({x:r.x-(r.x-n.x)*(t/a),y:r.y-(r.y-n.y)*(t/a)}),T(a)}return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]),(0,c.useEffect)(()=>{function e(e){let{tool:t,selectedId:r,editingDoorsForRoomId:a,polyPoints:o,zoom:s,pan:c}=N.current;if(e.key===`Escape`){if(a){h(null);return}t===`polygon`&&(x([]),C(null)),p(null);return}if(e.key===`Enter`&&t===`polygon`&&o.length>=3){P(o);return}if((e.key===`+`||e.key===`=`)&&!(e.target instanceof HTMLInputElement)){let e=Math.max(Qi,Math.min($i,s*Zi)),t=c.x+400/s/2,n=c.y+300/s/2;T(e),D({x:t-400/e/2,y:n-300/e/2});return}if(e.key===`-`&&!(e.target instanceof HTMLInputElement)){let e=Math.max(Qi,Math.min($i,s/Zi)),t=c.x+400/s/2,n=c.y+300/s/2;T(e),D({x:t-400/e/2,y:n-300/e/2});return}if(e.key===`0`&&!(e.target instanceof HTMLInputElement)){T(1),D({x:0,y:0});return}(e.key===`Delete`||e.key===`Backspace`)&&r&&!a&&!(e.target instanceof HTMLInputElement)&&(n(e=>e.filter(e=>e.id!==r)),i(e=>e.filter(e=>e.roomId!==r)),p(null))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);function F(e,t=w,n=E){let r=Math.max(Qi,Math.min($i,t*e)),i=n.x+400/t/2,a=n.y+300/t/2;D({x:i-400/r/2,y:a-300/r/2}),T(r)}function I(e){return j.current?Ni(e.clientX,e.clientY,j.current):null}function L(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=Pi(e,t.points[r]);i<=Yi&&(!n||i<n.d)&&(n={index:r,d:i})}return n}function R(e,t){let n=null;for(let r=0;r<t.points.length;r++){let i=t.points[r],a=t.points[(r+1)%t.points.length],{dist:o,t:s}=Fi(e,i,a);o<=Xi&&(!n||o<n.d)&&(n={index:r,t:s,d:o})}return n}function z(e,t,r,a){return n(n=>n.map(n=>{if(n.id!==e)return n;let r=[...n.points];return r.splice(t+1,0,a),{...n,points:r}})),i(n=>n.map(n=>n.roomId===e?n.wallIndex===t?n.t<=r?{...n,t:r>0?n.t/r:0}:{...n,wallIndex:t+1,t:(n.t-r)/(1-r)}:n.wallIndex>t?{...n,wallIndex:n.wallIndex+1}:n:n)),t+1}function B(e,r){let a=t.find(t=>t.id===e);if(!a||a.points.length<=3)return;let o=a.points.length;n(t=>t.map(t=>t.id===e?{...t,points:t.points.filter((e,t)=>t!==r)}:t)),i(t=>t.map(t=>{if(t.roomId!==e)return t;let n=(r-1+o)%o;return t.wallIndex===n||t.wallIndex===r?{...t,wallIndex:-1}:t.wallIndex>r?{...t,wallIndex:t.wallIndex-1}:t}).filter(e=>e.wallIndex!==-1))}function V(e){if(e.button===1){e.preventDefault();let t=j.current;if(t){let n=t.getBoundingClientRect();A.current={startClient:{x:e.clientX,y:e.clientY},origPan:{...E},scaleX:400/w/n.width,scaleY:300/w/n.height}}return}if(e.button!==0)return;e.preventDefault();let n=I(e);if(n){if(m){let e=t.find(e=>e.id===m);if(e){let t=Ii(n,[e]);t&&i(e=>[...e,{id:ta(`door`),roomId:t.roomId,wallIndex:t.wallIndex,t:t.t,width:12}])}return}if(a===`rect`){_(n),y(n);return}if(a===`polygon`){b.length>=3&&Pi(n,b[0])<=8?P(b):x(e=>[...e,n]);return}if(a===`select`){let e=t.find(e=>e.id===s)??null;if(e){let t=L(n,e);if(t){O.current={type:`vertex`,roomId:e.id,index:t.index,start:n,origPt:e.points[t.index]};return}}if(e){let t=R(n,e);if(t){let r=e.points[t.index],i=e.points[(t.index+1)%e.points.length],a=Mi({x:r.x+(i.x-r.x)*t.t,y:r.y+(i.y-r.y)*t.t}),o=z(e.id,t.index,t.t,a);O.current={type:`vertex`,roomId:e.id,index:o,start:n,origPt:a};return}}let r=t.find(e=>Li(n,e.points));if(r){p(r.id),O.current={type:`room`,roomId:r.id,start:n,origPoints:[...r.points]};return}p(null)}}}function ee(e){if(a!==`select`||m)return;let n=I(e);if(!n)return;let r=t.find(e=>e.id===s);if(!r)return;let i=L(n,r);i&&(e.preventDefault(),B(r.id,i.index))}function H(e){if(A.current){let{startClient:t,origPan:n,scaleX:r,scaleY:i}=A.current;D({x:n.x-(e.clientX-t.x)*r,y:n.y-(e.clientY-t.y)*i});return}let r=I(e);if(r){if(k.current&&m){let e=t.find(e=>e.id===m);if(e){let t=Ii(r,[e]);t&&i(e=>e.map(e=>e.id===k.current?{...e,wallIndex:t.wallIndex,t:t.t}:e))}return}if(a===`rect`&&g){y(r);return}if(a===`polygon`){C(r);return}if(a===`select`&&!m&&O.current){let e=O.current;if(e.type===`vertex`){let t=r.x-e.start.x,i=r.y-e.start.y,a=Mi({x:e.origPt.x+t,y:e.origPt.y+i});n(t=>t.map(t=>{if(t.id!==e.roomId)return t;let n=[...t.points];return n[e.index]=a,{...t,points:n}}))}else{let t=r.x-e.start.x,i=r.y-e.start.y;n(n=>n.map(n=>n.id===e.roomId?{...n,points:e.origPoints.map(e=>({x:e.x+t,y:e.y+i}))}:n))}}}}function te(e){if(A.current){A.current=null;return}let t=I(e);if(t){if(a===`rect`&&g){let e=Math.min(g.x,t.x),r=Math.min(g.y,t.y),i=Math.abs(t.x-g.x),a=Math.abs(t.y-g.y);i>=10&&a>=10&&n(t=>[...t,{id:ta(`room`),name:`Room ${t.length+1}`,points:zi(e,r,i,a)}]),_(null),y(null)}k.current=null,O.current=null}}function ne(e){s&&n(t=>t.map(t=>t.id===s?{...t,name:e}:t))}function re(e,t){let n=parseFloat(t);isNaN(n)||n<=0||i(t=>t.map(t=>t.id===e?{...t,width:n}:t))}function U(){s&&(n(e=>e.filter(e=>e.id!==s)),i(e=>e.filter(e=>e.roomId!==s)),h(null),p(null))}function ie(e){i(t=>t.filter(t=>t.id!==e))}function ae(e){o(e),h(null),x([]),C(null),_(null),y(null)}function W(e){let t=e.target.files?.[0];if(!t)return;e.target.value=``;let r=new FileReader;r.onload=e=>{let t=e.target?.result;if(typeof t!=`string`)return;let r=qi(t);r.length!==0&&(n(r.map(e=>({...e,id:ta(`room`)}))),i([]),p(null),h(null),T(1),D({x:0,y:0}))},r.readAsText(t)}let G=a===`rect`&&g&&v?{x:Math.min(g.x,v.x),y:Math.min(g.y,v.y),w:Math.abs(v.x-g.x),h:Math.abs(v.y-g.y)}:null,oe=s?t.find(e=>e.id===s)??null:null,se=m?t.find(e=>e.id===m)??null:null,ce=m?r.filter(e=>e.roomId===m):[],K=[{t:`select`,icon:d.faHandPointer,label:`Select & edit`},{t:`rect`,icon:d.faSquare,label:`Rectangle room`},{t:`polygon`,icon:d.faDrawPolygon,label:`Polygon room`}],le=400/w,ue=300/w,de=m?Q.roomDrawerCanvasDoor:a===`select`?Q.roomDrawerCanvasSelect:void 0;return(0,f.jsxs)(`div`,{className:(0,l.default)(Q.roomDrawer,e),children:[(0,f.jsxs)(`div`,{className:Q.roomDrawerToolbar,children:[K.map(({t:e,icon:t,label:n})=>(0,f.jsx)(`button`,{title:n,className:(0,l.default)(Q.roomDrawerToolbarBtn,e===a&&!m&&Q.roomDrawerToolbarBtnActive),onClick:()=>ae(e),children:(0,f.jsx)(u.FontAwesomeIcon,{icon:t})},e)),(0,f.jsx)(`div`,{className:Q.roomDrawerToolbarSep}),(0,f.jsx)(`button`,{title:`Zoom in (+)`,className:Q.roomDrawerToolbarBtn,onClick:()=>F(Zi),disabled:w>=$i,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faMagnifyingGlassPlus})}),(0,f.jsxs)(`button`,{title:`Reset zoom (0) — ${Math.round(w*100)}%`,className:Q.roomDrawerToolbarZoomLabel,onClick:()=>{T(1),D({x:0,y:0})},children:[Math.round(w*100),`%`]}),(0,f.jsx)(`button`,{title:`Zoom out (−)`,className:Q.roomDrawerToolbarBtn,onClick:()=>F(1/Zi),disabled:w<=Qi,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faMagnifyingGlassMinus})}),(0,f.jsx)(`div`,{className:Q.roomDrawerToolbarSep}),(0,f.jsx)(`button`,{title:`Upload SVG`,className:Q.roomDrawerToolbarBtn,onClick:()=>M.current?.click(),children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faUpload})}),(0,f.jsx)(`button`,{title:`Download SVG`,className:Q.roomDrawerToolbarBtn,onClick:()=>Ji(t,r),disabled:t.length===0,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDownload})}),(0,f.jsx)(`input`,{ref:M,type:`file`,accept:`.svg,image/svg+xml`,style:{display:`none`},onChange:W})]}),(0,f.jsxs)(`svg`,{ref:j,className:(0,l.default)(Q.roomDrawerCanvas,de),viewBox:`${E.x} ${E.y} ${le} ${ue}`,onMouseDown:V,onMouseMove:H,onMouseUp:te,onDoubleClick:ee,children:[(0,f.jsx)(`defs`,{children:(0,f.jsx)(`pattern`,{id:`rd-grid`,width:5,height:5,patternUnits:`userSpaceOnUse`,children:(0,f.jsx)(`path`,{d:`M 5 0 L 0 0 0 5`,fill:`none`,className:Q.gridLine})})}),(0,f.jsx)(`rect`,{x:E.x,y:E.y,width:le,height:ue,fill:`url(#rd-grid)`}),t.map(e=>{let t=e.points,n=t.map((e,t)=>`${t===0?`M`:`L`} ${e.x},${e.y}`).join(` `)+` Z`,i=Ui(t,r.filter(t=>t.roomId===e.id)),a=Ri(t),o=s===e.id,c=m===e.id;return(0,f.jsxs)(`g`,{children:[(0,f.jsx)(`path`,{d:n,className:(0,l.default)(Q.roomFill,(o||c)&&Q.roomFillSelected)}),i.map((e,t)=>(0,f.jsx)(`path`,{d:e,className:(0,l.default)(Q.roomStroke,(o||c)&&Q.roomStrokeSelected)},t)),e.name&&(0,f.jsx)(`text`,{x:a.x,y:a.y,className:Q.roomText,textAnchor:`middle`,dominantBaseline:`middle`,children:e.name})]},e.id)}),r.map(e=>{let n=t.find(t=>t.id===e.roomId);if(!n)return null;let r=n.points[e.wallIndex],i=n.points[(e.wallIndex+1)%n.points.length],a=Bi(r,i,e.t,e.width);return a?(0,f.jsx)(`line`,{x1:a.p1.x,y1:a.p1.y,x2:a.p2.x,y2:a.p2.y,className:Q.doorGap},e.id):null}),m&&ce.map(e=>{let n=t.find(t=>t.id===e.roomId);if(!n)return null;let r=n.points[e.wallIndex],i=n.points[(e.wallIndex+1)%n.points.length],a=Bi(r,i,e.t,e.width);if(!a)return null;let o={x:(a.p1.x+a.p2.x)/2,y:(a.p1.y+a.p2.y)/2};return(0,f.jsx)(`circle`,{cx:o.x,cy:o.y,r:2.5,className:Q.doorMarker,onMouseDown:t=>{t.button===0&&(t.preventDefault(),t.stopPropagation(),k.current=e.id)}},e.id)}),a===`select`&&!m&&oe&&oe.points.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:3.5,className:Q.vertexHandle},t)),G&&(0,f.jsx)(`rect`,{x:G.x,y:G.y,width:G.w,height:G.h,className:Q.preview}),a===`polygon`&&b.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`polyline`,{points:[...b,S??b[b.length-1]].map(e=>`${e.x},${e.y}`).join(` `),className:Q.preview}),b.length>=3&&(0,f.jsx)(`circle`,{cx:b[0].x,cy:b[0].y,r:8/2,className:Q.polyCloseTarget}),b.map((e,t)=>(0,f.jsx)(`circle`,{cx:e.x,cy:e.y,r:2,className:Q.polyVertex},t))]})]}),oe&&!m&&(0,f.jsxs)(`div`,{className:Q.roomDrawerInfo,children:[(0,f.jsx)(`span`,{className:Q.roomDrawerInfoLabel,children:`Name`}),(0,f.jsx)(`input`,{className:Q.roomDrawerInfoInput,value:oe.name,onChange:e=>ne(e.target.value),placeholder:`Room name`}),(0,f.jsxs)(`button`,{className:Q.roomDrawerInfoDoorsBtn,onClick:()=>h(oe.id),title:`Edit doors`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen}),(0,f.jsx)(`span`,{children:r.filter(e=>e.roomId===oe.id).length})]}),(0,f.jsx)(`button`,{className:Q.roomDrawerInfoDelete,onClick:U,title:`Delete room`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]}),m&&se&&(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanel,children:[(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanelHeader,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faDoorOpen,className:Q.roomDrawerDoorPanelIcon}),(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelTitle,children:se.name?`Doors · ${se.name}`:`Doors`}),(0,f.jsxs)(`button`,{className:Q.roomDrawerDoorPanelDone,onClick:()=>h(null),title:`Done (Esc)`,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faCheck}),`Done`]})]}),(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanelList,children:[ce.length===0&&(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelEmpty,children:`Click on a wall to add a door`}),ce.map((e,t)=>(0,f.jsxs)(`div`,{className:Q.roomDrawerDoorPanelItem,children:[(0,f.jsxs)(`span`,{className:Q.roomDrawerDoorPanelLabel,children:[`Door `,t+1]}),(0,f.jsx)(`span`,{className:Q.roomDrawerDoorPanelWidthLabel,children:`Width`}),(0,f.jsx)(`input`,{className:Q.roomDrawerInfoInput,type:`number`,min:1,value:e.width,onChange:t=>re(e.id,t.target.value)}),(0,f.jsx)(`button`,{className:Q.roomDrawerInfoDelete,onClick:()=>ie(e.id),title:`Delete door`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faTrash})})]},e.id))]})]}),(0,f.jsx)(`div`,{className:Q.roomDrawerHint,children:m?`Click a wall to add a door · Adjust width or delete from the list · Done or Esc to finish`:`${na[a]} · Scroll to zoom · Middle-drag to pan · 0 to reset`})]})}var ia={"roomViewer-containerLoading":`roomViewer-containerLoading_BL3M-`,roomViewerContainerLoading:`roomViewer-containerLoading_BL3M-`,"roomViewer-container":`roomViewer-container_YlmB8`,roomViewerContainer:`roomViewer-container_YlmB8`,"roomViewer-active":`roomViewer-active_gG6wf`,roomViewerActive:`roomViewer-active_gG6wf`,"roomViewer-selected":`roomViewer-selected_CpdMj`,roomViewerSelected:`roomViewer-selected_CpdMj`,"roomViewer-tint":`roomViewer-tint_O9JrM`,roomViewerTint:`roomViewer-tint_O9JrM`,"roomViewer-actions":`roomViewer-actions_4cA74`,roomViewerActions:`roomViewer-actions_4cA74`,"roomViewer-header":`roomViewer-header_XEHCO`,roomViewerHeader:`roomViewer-header_XEHCO`};function aa({data:e=[]}){let t=(0,c.useRef)(null),[,n]=(0,c.useState)(null),[r,i]=(0,c.useState)(0),[a,o]=(0,c.useState)(!0);(0,c.useEffect)(()=>{let i=new AbortController;n(null);let a=t.current;return r>e.length-1||!a?(o(!1),()=>i.abort()):(a.querySelectorAll(`[id^="room"]`).forEach(e=>{e.addEventListener(`click`,()=>s(e.id,a),{signal:i.signal})}),o(!1),()=>i.abort())},[e,r]);function s(e,t){let r=e.substring(4);n(n=>{if(r===n)return n;let[i]=t.querySelectorAll(`[id="use"]`);i?.setAttribute(`href`,`#${e}`);let[a]=t.querySelectorAll(`[id="${e}"]`);if(n){let[e]=t.querySelectorAll(`[id="room${n}"]`);if(e){e.classList.remove(ia.roomViewerSelected,ia.roomViewerTint);let[t]=e.querySelectorAll(`[id="background"]`);t&&t.classList.remove(ia.roomViewerTint)}}if(a){a.classList.add(ia.roomViewerSelected);let[e]=a.querySelectorAll(`[id="background"]`);(e??a).classList.add(ia.roomViewerTint)}return r})}function p(t){i(n=>{let r=n+t;return r<0||r>e.length-1?n:r})}let m=e[r]?.data??null;return(0,f.jsxs)(`div`,{className:ia.roomViewer,ref:t,children:[(0,f.jsx)(`h3`,{className:ia.roomViewerHeader,children:e[r]?.label??``}),(0,f.jsx)(`div`,{className:(0,l.default)(ia.roomViewerContainer,a&&ia.roomViewerContainerLoading),children:m},r),e.length>1&&(0,f.jsxs)(`div`,{className:ia.roomViewerActions,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronLeft,onClick:()=>p(-1)}),(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faLayerGroup}),(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronRight,onClick:()=>p(1)})]})]})}var oa={scrollbarProvider:`scrollbarProvider_IMBFu`};function sa({className:e=void 0,children:t=void 0}){return(0,f.jsx)(`div`,{className:(0,l.default)(oa.scrollbarProvider,e),children:t})}var ca=sa,la=function(e){return e.Small=`small`,e.Medium=`medium`,e.Large=`large`,e}({}),ua={sectionHeader:`sectionHeader_X3bNj`,"sectionHeader-leading":`sectionHeader-leading_d6opV`,sectionHeaderLeading:`sectionHeader-leading_d6opV`,"sectionHeader-titles":`sectionHeader-titles_iN9dT`,sectionHeaderTitles:`sectionHeader-titles_iN9dT`,"sectionHeader-title":`sectionHeader-title_wH--S`,sectionHeaderTitle:`sectionHeader-title_wH--S`,"sectionHeader-subtitle":`sectionHeader-subtitle_WRK3Y`,sectionHeaderSubtitle:`sectionHeader-subtitle_WRK3Y`,"sectionHeader-trailing":`sectionHeader-trailing_ewWDV`,sectionHeaderTrailing:`sectionHeader-trailing_ewWDV`,"sectionHeader-left":`sectionHeader-left_ZUuWs`,sectionHeaderLeft:`sectionHeader-left_ZUuWs`,"sectionHeader-center":`sectionHeader-center_MzSev`,sectionHeaderCenter:`sectionHeader-center_MzSev`,"sectionHeader-actions":`sectionHeader-actions_E40ZS`,sectionHeaderActions:`sectionHeader-actions_E40ZS`,"sectionHeader-divider":`sectionHeader-divider_Ovpev`,sectionHeaderDivider:`sectionHeader-divider_Ovpev`,"sectionHeader-size-small":`sectionHeader-size-small_6OVWE`,sectionHeaderSizeSmall:`sectionHeader-size-small_6OVWE`,"sectionHeader-size-medium":`sectionHeader-size-medium_BVSe6`,sectionHeaderSizeMedium:`sectionHeader-size-medium_BVSe6`,"sectionHeader-size-large":`sectionHeader-size-large_bOZDP`,sectionHeaderSizeLarge:`sectionHeader-size-large_bOZDP`},da={[la.Small]:ua.sectionHeaderSizeSmall,[la.Medium]:ua.sectionHeaderSizeMedium,[la.Large]:ua.sectionHeaderSizeLarge};function fa(e){let{title:t,subtitle:n,icon:r,thumbnail:i,left:a,center:o,actions:s,level:c=2,size:d=la.Medium,divider:p=!1,className:m,style:h,classNames:g,styles:_,...v}=O(`SectionHeader`,e),y=typeof i==`string`&&i.startsWith(`http`)?i:void 0,b=i!=null&&i!==``,x=b||r!=null,S=`h${c}`;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`div`,{...v,className:(0,l.default)(ua.sectionHeader,da[d],m,g?.root),style:{...h,..._?.root},children:[x&&(0,f.jsx)(`div`,{className:(0,l.default)(ua.sectionHeaderLeading,g?.leading),style:{...y?{backgroundImage:`url(${y})`}:{},..._?.leading},children:b?!y&&i:r&&(0,f.jsx)(u.FontAwesomeIcon,{icon:r})}),(0,f.jsxs)(`div`,{className:(0,l.default)(ua.sectionHeaderTitles,g?.titles),style:_?.titles,children:[(0,f.jsx)(S,{className:(0,l.default)(ua.sectionHeaderTitle,g?.title),style:_?.title,children:t}),n!=null&&n!==``&&(0,f.jsx)(`div`,{className:(0,l.default)(ua.sectionHeaderSubtitle,g?.subtitle),style:_?.subtitle,children:n})]}),(0,f.jsxs)(`div`,{className:(0,l.default)(ua.sectionHeaderTrailing,g?.trailing),style:_?.trailing,children:[(0,f.jsx)(`div`,{className:(0,l.default)(ua.sectionHeaderLeft,g?.left),style:_?.left,children:a}),(0,f.jsx)(`div`,{className:(0,l.default)(ua.sectionHeaderCenter,g?.center),style:_?.center,children:o}),(0,f.jsx)(`div`,{className:(0,l.default)(ua.sectionHeaderActions,g?.actions),style:_?.actions,children:Array.isArray(s)?s.map((e,t)=>(0,f.jsx)(ae,{title:e.title,onClick:e.onClick?t=>{t.stopPropagation(),e.onClick?.(t)}:void 0,icon:e.icon},t)):s})]})]}),p&&(0,f.jsx)(xn,{className:ua.sectionHeaderDivider})]})}var pa=function(e){return e.Text=`text`,e.Circle=`circle`,e.Rectangular=`rectangular`,e}({}),ma=function(e){return e.Shimmer=`shimmer`,e.Pulse=`pulse`,e.None=`none`,e}({}),ha={skeleton:`skeleton_TSg1y`,"skeleton-lines":`skeleton-lines_-Z-gf`,skeletonLines:`skeleton-lines_-Z-gf`,"skeleton-line-last":`skeleton-line-last_UFw21`,skeletonLineLast:`skeleton-line-last_UFw21`,"skeleton-text":`skeleton-text_Jlefj`,skeletonText:`skeleton-text_Jlefj`,"skeleton-circle":`skeleton-circle_t0bbj`,skeletonCircle:`skeleton-circle_t0bbj`,"skeleton-rectangular":`skeleton-rectangular_UtIyN`,skeletonRectangular:`skeleton-rectangular_UtIyN`,"skeleton-animation-pulse":`skeleton-animation-pulse_wGbPg`,skeletonAnimationPulse:`skeleton-animation-pulse_wGbPg`,skeletonPulse:`skeletonPulse_06yjn`,"skeleton-animation-shimmer":`skeleton-animation-shimmer_a0nwc`,skeletonAnimationShimmer:`skeleton-animation-shimmer_a0nwc`,skeletonShimmer:`skeletonShimmer_wLPXR`},ga={[pa.Text]:ha.skeletonText,[pa.Circle]:ha.skeletonCircle,[pa.Rectangular]:ha.skeletonRectangular},_a={[ma.Shimmer]:ha.skeletonAnimationShimmer,[ma.Pulse]:ha.skeletonAnimationPulse,[ma.None]:void 0};function va(e){let{variant:t=pa.Text,animation:n=ma.Shimmer,lines:r=1,className:i,style:a,classNames:o,styles:s,...c}=O(`Skeleton`,e),u=ga[t],d=_a[n];return t!==pa.Text||r<=1?(0,f.jsx)(`span`,{...c,className:(0,l.default)(ha.skeleton,u,d,i),style:a}):(0,f.jsx)(`span`,{...c,className:(0,l.default)(ha.skeletonLines,i),style:a,children:Array.from({length:r},(e,t)=>(0,f.jsx)(`span`,{className:(0,l.default)(ha.skeleton,u,d,t===r-1&&ha.skeletonLineLast,o?.line),style:s?.line},t))})}var ya={slider:`slider_qmg2W`,"slider-thumb":`slider-thumb_CHuJN`,sliderThumb:`slider-thumb_CHuJN`,"slider-disabled":`slider-disabled_T0o2S`,sliderDisabled:`slider-disabled_T0o2S`,"slider-has-mark-labels":`slider-has-mark-labels_Xw6ZJ`,sliderHasMarkLabels:`slider-has-mark-labels_Xw6ZJ`,"slider-track":`slider-track_UyKYc`,sliderTrack:`slider-track_UyKYc`,"slider-range":`slider-range_exAs9`,sliderRange:`slider-range_exAs9`,"slider-dragging":`slider-dragging_htPFH`,sliderDragging:`slider-dragging_htPFH`,"slider-mark":`slider-mark_fvw-n`,sliderMark:`slider-mark_fvw-n`,"slider-mark-label":`slider-mark-label_iDtU2`,sliderMarkLabel:`slider-mark-label_iDtU2`,"slider-value":`slider-value_3rQgd`,sliderValue:`slider-value_3rQgd`};function ba(e){let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1}function xa({value:e,defaultValue:t,onChange:n,onChangeEnd:r,min:i=0,max:a=100,step:o=1,disabled:s=!1,marks:u,showValue:d=!1,formatValue:p,size:m=`18px`,tabIndex:h=0,className:g,style:_,classNames:v,styles:y,"aria-label":b,...x}){let S=(0,c.useRef)(null),C=(0,c.useRef)(null),w=(0,c.useRef)(!1),[T,E]=(0,c.useState)(!1),D=e!==void 0,[O,k]=(0,c.useState)(t??i),A=ba(o);function j(e){return Math.min(a,Math.max(i,e))}function M(e){let t=Math.round((e-i)/o)*o+i;return Number(j(t).toFixed(A))}let N=j(D?e:O),P=(0,c.useRef)(N);(0,c.useEffect)(()=>{P.current=N},[N]);let F=`${(a>i?(N-i)/(a-i):0)*100}%`;function I(e,t){let i=M(e);i!==P.current&&(P.current=i,D||k(i),n?.(i)),t&&r?.(i)}function L(e){let t=S.current;if(!t)return P.current;let n=t.getBoundingClientRect(),r=n.width?(e-n.left)/n.width:0;return i+Math.min(1,Math.max(0,r))*(a-i)}function R(e){s||(e.preventDefault(),C.current?.focus(),C.current?.setPointerCapture?.(e.pointerId),w.current=!0,E(!0),I(L(e.clientX),!1))}function z(e){w.current&&I(L(e.clientX),!1)}function B(e){w.current&&(w.current=!1,E(!1),C.current?.releasePointerCapture?.(e.pointerId),r?.(P.current))}function V(e){if(s)return;let t=o*10,n=null;switch(e.key){case`ArrowRight`:case`ArrowUp`:n=N+o;break;case`ArrowLeft`:case`ArrowDown`:n=N-o;break;case`PageUp`:n=N+t;break;case`PageDown`:n=N-t;break;case`Home`:n=i;break;case`End`:n=a;break;default:return}e.preventDefault(),I(n,!0)}let ee=p?p(N):N,H=!!u?.some(e=>e.label!=null);return(0,f.jsx)(`div`,{...x,ref:C,role:`slider`,"aria-label":b,"aria-valuemin":i,"aria-valuemax":a,"aria-valuenow":N,"aria-valuetext":typeof ee==`string`||typeof ee==`number`?String(ee):void 0,"aria-orientation":`horizontal`,"aria-disabled":s||void 0,tabIndex:s?-1:h,className:(0,l.default)(ya.slider,s&&ya.sliderDisabled,T&&ya.sliderDragging,H&&ya.sliderHasMarkLabels,g,v?.root),style:{"--slider-thumb-size":m,..._,...y?.root},onPointerDown:R,onPointerMove:z,onPointerUp:B,onKeyDown:V,children:(0,f.jsxs)(`div`,{ref:S,className:(0,l.default)(ya.sliderTrack,v?.track),style:y?.track,children:[(0,f.jsx)(`div`,{className:(0,l.default)(ya.sliderRange,v?.range),style:{width:F,...y?.range}}),u?.map(e=>{let t=`${(a>i?(j(e.value)-i)/(a-i):0)*100}%`;return(0,f.jsxs)(c.default.Fragment,{children:[(0,f.jsx)(`span`,{className:(0,l.default)(ya.sliderMark,v?.mark),style:{left:t,...y?.mark}}),e.label!=null&&(0,f.jsx)(`span`,{className:(0,l.default)(ya.sliderMarkLabel,v?.markLabel),style:{left:t,...y?.markLabel},children:e.label})]},e.value)}),(0,f.jsx)(`div`,{className:(0,l.default)(ya.sliderThumb,v?.thumb),style:{left:F,...y?.thumb},children:d&&(0,f.jsx)(`span`,{className:(0,l.default)(ya.sliderValue,v?.value),style:y?.value,children:ee})})]})})}var Sa={splitButton:`splitButton_5ak5W`,splitButtonPrimary:`splitButtonPrimary_4mVy8`,splitButtonTrigger:`splitButtonTrigger_32cQA`,splitButtonMenu:`splitButtonMenu_P6Ofl`,splitButtonMenuItem:`splitButtonMenuItem_dbEEz`,"splitButtonMenuItem-disabled":`splitButtonMenuItem-disabled_Dw1mr`,splitButtonMenuItemDisabled:`splitButtonMenuItem-disabled_Dw1mr`,"splitButtonMenuItem-icon":`splitButtonMenuItem-icon_dMuKX`,splitButtonMenuItemIcon:`splitButtonMenuItem-icon_dMuKX`};function Ca(e,t){return(e%t+t)%t}function wa(e){let{children:t,onClick:n=()=>{},actions:r=[],styleType:i=I.Primary,size:a=L.Default,disabled:o=!1,isLoading:s=!1,align:p=Ve.Right,className:m,style:h,classNames:g,styles:_,...v}=O(`SplitButton`,e),[y,b]=(0,c.useState)(!1),x=(0,c.useRef)([]),[S,C]=(0,c.useState)(o);o!==S&&(C(o),o&&b(!1)),(0,c.useEffect)(()=>{if(!y)return;let e=r.findIndex(e=>!e.disabled);e!==-1&&x.current[e]?.focus()},[y]);function w(e,t){let n=r.map((e,t)=>t).filter(e=>!r[e].disabled);if(n.length===0)return;let i=n.indexOf(e),a=i===-1?t===1?0:n.length-1:Ca(i+t,n.length);x.current[n[a]]?.focus()}function T(e){let t=x.current.findIndex(e=>e===document.activeElement);e.key===`ArrowDown`?(e.preventDefault(),w(t,1)):e.key===`ArrowUp`?(e.preventDefault(),w(t,-1)):e.key===`Home`?(e.preventDefault(),w(-1,1)):e.key===`End`&&(e.preventDefault(),w(-1,-1))}return(0,f.jsxs)(Xe,{...v,className:(0,l.default)(Sa.splitButton,g?.root,m),style:{...h,..._?.root},children:[(0,f.jsx)(H,{styleType:i,size:a,disabled:o,isLoading:s,onClick:n,className:(0,l.default)(Sa.splitButtonPrimary,g?.primaryButton),style:_?.primaryButton,children:t}),(0,f.jsx)(Ue,{isOpen:y,onOpenChange:b,align:p,dontCloseOnChildClick:!0,content:(0,f.jsx)(`ul`,{className:(0,l.default)(Sa.splitButtonMenu,g?.menu),style:_?.menu,role:`menu`,onKeyDown:T,children:r.map((e,t)=>(0,f.jsx)(`li`,{role:`none`,children:(0,f.jsxs)(U,{ref:e=>{x.current[t]=e},role:`menuitem`,tabIndex:e.disabled?-1:0,"aria-disabled":e.disabled,className:(0,l.default)(Sa.splitButtonMenuItem,{[Sa.splitButtonMenuItemDisabled]:e.disabled},g?.menuItem),style:_?.menuItem,onClick:()=>{o||e.disabled||(e.onClick(),b(!1))},children:[e.icon?(0,f.jsx)(u.FontAwesomeIcon,{icon:e.icon,className:Sa.splitButtonMenuItemIcon}):null,e.label]})},e.id))}),children:(0,f.jsx)(H,{styleType:i,size:a,disabled:o,icon:d.faChevronDown,"aria-label":`More actions`,className:(0,l.default)(Sa.splitButtonTrigger,g?.triggerButton),style:_?.triggerButton})})]})}var $={stepper:`stepper_kiS2A`,"stepper-vertical":`stepper-vertical_2y9rg`,stepperVertical:`stepper-vertical_2y9rg`,"stepper-label-bottom":`stepper-label-bottom_lDfhy`,stepperLabelBottom:`stepper-label-bottom_lDfhy`,"stepper-label-top":`stepper-label-top_sBw4-`,stepperLabelTop:`stepper-label-top_sBw4-`,"stepper-entry":`stepper-entry_KD4JJ`,stepperEntry:`stepper-entry_KD4JJ`,"stepper-clickable":`stepper-clickable_Nm6fP`,stepperClickable:`stepper-clickable_Nm6fP`,"stepper-entry-disabled":`stepper-entry-disabled_T9S5R`,stepperEntryDisabled:`stepper-entry-disabled_T9S5R`,"stepper-entry-number":`stepper-entry-number_J168Q`,stepperEntryNumber:`stepper-entry-number_J168Q`,"stepper-entry-active":`stepper-entry-active_V1aRt`,stepperEntryActive:`stepper-entry-active_V1aRt`,"stepper-entry-done":`stepper-entry-done_M3wb5`,stepperEntryDone:`stepper-entry-done_M3wb5`,"stepper-entry-error":`stepper-entry-error_xjGSr`,stepperEntryError:`stepper-entry-error_xjGSr`,"stepper-checkmark":`stepper-checkmark_iKCap`,stepperCheckmark:`stepper-checkmark_iKCap`,showCheckmark:`showCheckmark_Rd0oW`,"stepper-marker-cell":`stepper-marker-cell_reOS7`,stepperMarkerCell:`stepper-marker-cell_reOS7`,"stepper-rail-segment":`stepper-rail-segment_U-ZgF`,stepperRailSegment:`stepper-rail-segment_U-ZgF`,"stepper-rail-filled":`stepper-rail-filled_wCImi`,stepperRailFilled:`stepper-rail-filled_wCImi`,"stepper-rail-hidden":`stepper-rail-hidden_l17t6`,stepperRailHidden:`stepper-rail-hidden_l17t6`,"stepper-entry-labels":`stepper-entry-labels_nQT8D`,stepperEntryLabels:`stepper-entry-labels_nQT8D`,"stepper-entry-label":`stepper-entry-label_b94eg`,stepperEntryLabel:`stepper-entry-label_b94eg`,"stepper-description":`stepper-description_5Q0YP`,stepperDescription:`stepper-description_5Q0YP`,"stepper-optional":`stepper-optional_N8mkW`,stepperOptional:`stepper-optional_N8mkW`,"stepper-connector":`stepper-connector_J2FwZ`,stepperConnector:`stepper-connector_J2FwZ`,"stepper-connector-filled":`stepper-connector-filled_W8UZS`,stepperConnectorFilled:`stepper-connector-filled_W8UZS`,"stepper-step":`stepper-step_nUfsV`,stepperStep:`stepper-step_nUfsV`,"stepper-content":`stepper-content_yjlFH`,stepperContent:`stepper-content_yjlFH`,"stepper-label-left":`stepper-label-left_yGbjC`,stepperLabelLeft:`stepper-label-left_yGbjC`,"stepper-content-inner":`stepper-content-inner_0w2wP`,stepperContentInner:`stepper-content-inner_0w2wP`,"stepper-outlined":`stepper-outlined_V7UjP`,stepperOutlined:`stepper-outlined_V7UjP`,"stepper-dots":`stepper-dots_s4cgN`,stepperDots:`stepper-dots_s4cgN`},Ta=function(e){return e.Horizontal=`horizontal`,e.Vertical=`vertical`,e}({}),Ea=function(e){return e.Default=`default`,e.Outlined=`outlined`,e.Dots=`dots`,e}({}),Da=function(e){return e.None=`none`,e.ActiveOnly=`activeOnly`,e.Completed=`completed`,e}({}),Oa=function(e){return e.Top=`top`,e.Bottom=`bottom`,e.Left=`left`,e.Right=`right`,e}({}),ka={[Ea.Default]:$.stepperDefault,[Ea.Outlined]:$.stepperOutlined,[Ea.Dots]:$.stepperDots},Aa={[Oa.Top]:$.stepperLabelTop,[Oa.Bottom]:$.stepperLabelBottom,[Oa.Left]:$.stepperLabelLeft,[Oa.Right]:$.stepperLabelRight};function ja(){return(0,f.jsx)(`svg`,{className:$.stepperCheckmark,strokeLinejoin:`round`,strokeLinecap:`round`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`-0.2 -1.2 3.4 2`,height:`20px`,width:`20px`,children:(0,f.jsx)(`path`,{d:`M 0 0 l 1 1 l 2 -2`,strokeWidth:`0.4`,fill:`none`})})}function Ma({open:e,className:t,style:n,children:r}){let i=(0,c.useRef)(null),[a,o]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=i.current;if(!e)return;let t=new ResizeObserver(()=>o(e.offsetHeight));return t.observe(e),()=>t.disconnect()},[]),(0,f.jsx)(`div`,{className:(0,l.default)($.stepperContent,t),style:{...n,height:e?a??`auto`:0},"aria-hidden":!e,children:(0,f.jsx)(`div`,{ref:i,className:$.stepperContentInner,children:r})})}function Na(e,t){let n=[Oa.Left,Oa.Right];return t?e&&n.includes(e)?e:Oa.Right:e&&!n.includes(e)?e:Oa.Bottom}function Pa({steps:e=[],currentStep:t=0,alignment:n=Ta.Horizontal,onStepClicked:r=null,nonLinear:i=!1,hideLabels:a=!1,styleType:o=Ea.Default,collapse:s=Da.None,labelPlacement:d,className:p,style:m,classNames:h,styles:g,..._}){let v=n===Ta.Vertical,y=Na(d,v);return(0,f.jsx)(`div`,{..._,className:(0,l.default)($.stepper,ka[o],Aa[y],{[$.stepperVertical]:v},h?.root,p),style:{...g?.root,...m},children:e.map((n,o)=>{let d=o<t,p=o<=t,m=!!n.error,_=!!r&&!n.disabled&&(i?o!==t:d),y=(0,l.default)($.stepperEntry,{[$.stepperEntryActive]:p},{[$.stepperEntryDone]:d&&!m},{[$.stepperEntryError]:m},{[$.stepperEntryDisabled]:n.disabled},{[$.stepperClickable]:_},h?.entry),b=n.icon?(0,f.jsx)(u.FontAwesomeIcon,{icon:n.icon,className:h?.icon,style:g?.icon}):d&&!m?(0,f.jsx)(ja,{}):o+1,x=(0,f.jsx)(`div`,{className:(0,l.default)($.stepperEntryNumber,{[$.stepperEntryNumberDone]:d&&!m},h?.entryNumber),style:g?.entryNumber,children:b}),S=n.optional===!0?`Optional`:n.optional===!1?null:n.optional,C=!a&&(0,f.jsxs)(`div`,{className:$.stepperEntryLabels,children:[(0,f.jsx)(`div`,{className:(0,l.default)($.stepperEntryLabel,h?.entryLabel),style:g?.entryLabel,children:n.label}),n.description!=null&&(0,f.jsx)(`div`,{className:(0,l.default)($.stepperDescription,h?.description),style:g?.description,children:n.description}),S!=null&&(0,f.jsx)(`div`,{className:(0,l.default)($.stepperOptional,h?.optional),style:g?.optional,children:S})]}),w=_?{role:`button`,tabIndex:0,onClick:()=>r?.(o),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r?.(o))}}:{},T=e=>(0,f.jsx)(`div`,{className:y,style:g?.entry,"aria-current":o===t?`step`:void 0,"aria-invalid":m||void 0,...w,children:e}),E=o<e.length-1&&(0,f.jsx)(`div`,{className:(0,l.default)($.stepperConnector,{[$.stepperConnectorFilled]:d},h?.connector),style:g?.connector});if(v){let r=o===0,i=o===e.length-1,c=s===Da.None?!0:s===Da.ActiveOnly?o===t:!d,u=e=>{let t=e===`lead`?r:i,n=e===`lead`?p:d;return(0,f.jsx)(`div`,{className:(0,l.default)($.stepperRailSegment,{[$.stepperRailFilled]:!t&&n,[$.stepperRailHidden]:t})})},m=(0,f.jsxs)(`div`,{className:$.stepperMarkerCell,children:[u(`lead`),x,u(`trail`)]});return(0,f.jsxs)(`div`,{className:$.stepperStep,children:[T((0,f.jsxs)(f.Fragment,{children:[m,C]})),E,n.content!=null&&!a&&(0,f.jsx)(Ma,{open:c,className:h?.content,style:g?.content,children:n.content})]},o)}return(0,f.jsxs)(c.default.Fragment,{children:[T((0,f.jsxs)(f.Fragment,{children:[x,C]})),E]},o)})})}function Fa(e,t,n,r){return e<r&&n<t}function Ia(e,t){if(e===t)return 0;let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}var La=new class{constructor(){this.entries=new Map,this.listeners=new Map,this.results=new Map,this.rafId=0,this.listenerCount=0,this.schedule=()=>{cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(this.recompute)},this.recompute=()=>{let e=[...this.entries.entries()].sort(([,e],[,t])=>Ia(e.node,t.node)),t=new Map;for(let[n,r]of e){let e=r.getMetrics();if(!e)continue;let i=t.get(e.container);i||(i=[],t.set(e.container,i));let a=i.filter(t=>Fa(t.left,t.right,e.left,e.left+e.width)).reduce((e,t)=>Math.max(e,t.bottom),r.offsetTop),o=!r.disabled&&e.top<=a,s={isStuck:o,top:o?a:r.offsetTop};o&&i.push({left:e.left,right:e.left+e.width,bottom:a+e.contentHeight});let c=this.results.get(n);(!c||c.isStuck!==s.isStuck||c.top!==s.top)&&(this.results.set(n,s),this.listeners.get(n)?.(s))}}}register(e,t){let n=Symbol(`sticky`);return this.entries.set(n,e),this.listeners.set(n,t),this.startListening(),n}updateEntry(e,t){let n=this.entries.get(e);n&&Object.assign(n,t)}unregister(e){this.entries.has(e)&&(this.entries.delete(e),this.listeners.delete(e),this.results.delete(e),this.stopListening())}startListening(){this.listenerCount===0&&(window.addEventListener(`scroll`,this.schedule,{passive:!0,capture:!0}),window.addEventListener(`resize`,this.schedule)),this.listenerCount++}stopListening(){this.listenerCount--,this.listenerCount===0&&(window.removeEventListener(`scroll`,this.schedule,{capture:!0}),window.removeEventListener(`resize`,this.schedule))}},Ra={sticky:`sticky_L6zO2`,"sticky-content":`sticky-content_ZaXTD`,stickyContent:`sticky-content_ZaXTD`,"sticky-content-stuck":`sticky-content-stuck_w-gRW`,stickyContentStuck:`sticky-content-stuck_w-gRW`,"sticky-placeholder":`sticky-placeholder_aJ3Sb`,stickyPlaceholder:`sticky-placeholder_aJ3Sb`};function za(e){let t=e?.parentElement??null;for(;t&&t!==document.body;){let{overflowY:e}=getComputedStyle(t);if(e===`auto`||e===`scroll`||e===`overlay`)return t;t=t.parentElement}return null}function Ba({children:e,offsetTop:t=0,offsetElement:n,stickToScrollParent:r=!1,zIndex:i=20,disabled:a=!1,onStuckChange:o,className:s,style:u,classNames:d,styles:p,...m}){let h=(0,c.useRef)(null),g=(0,c.useRef)(null),_=(0,c.useRef)(null),v=(0,c.useRef)(null),[y,b]=(0,c.useState)({width:0,left:0,height:0}),[x,S]=(0,c.useState)(null),[C,w]=(0,c.useState)(0),T=n?.current?x??n.current.offsetHeight:t,[E,D]=(0,c.useState)({isStuck:!1,top:T}),O=(0,c.useRef)(o);(0,c.useEffect)(()=>{O.current=o},[o]);let k=(0,c.useCallback)(()=>{let e=h.current,t=g.current;if(!e||!t)return;let n=e.getBoundingClientRect();b({width:e.clientWidth,left:n.left,height:t.offsetHeight}),La.schedule()},[]);(0,c.useEffect)(()=>{let e=n?.current;if(!e)return;let t=()=>S(e.offsetHeight);t();let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[n]),(0,c.useLayoutEffect)(()=>{v.current=r?za(h.current):null},[r]),(0,c.useLayoutEffect)(()=>{let e=La.register({node:h.current,offsetTop:T,disabled:a,getMetrics:()=>{let e=h.current,t=g.current;if(!e||!t)return null;let n=e.getBoundingClientRect(),r=v.current?.getBoundingClientRect(),i=r?.top??0;return w(e=>e===i?e:i),{top:r?n.top-r.top:n.top,left:r?n.left-r.left:n.left,width:e.clientWidth,contentHeight:t.offsetHeight,container:v.current}}},D);return _.current=e,()=>{La.unregister(e),_.current=null}},[]),(0,c.useEffect)(()=>{_.current&&La.updateEntry(_.current,{offsetTop:T,disabled:a}),La.schedule()},[T,a]),(0,c.useLayoutEffect)(()=>{k()},[k,e]),(0,c.useEffect)(()=>{let e=new ResizeObserver(k);return h.current&&e.observe(h.current),g.current&&e.observe(g.current),v.current&&e.observe(v.current),()=>e.disconnect()},[k,r]);let A=(0,c.useRef)(!0);(0,c.useEffect)(()=>{if(A.current){A.current=!1;return}O.current?.(E.isStuck)},[E.isStuck]);let j=E.isStuck?{position:`fixed`,top:C+E.top,left:y.left,width:y.width,zIndex:i,...p?.content}:p?.content;return(0,f.jsxs)(`div`,{ref:h,className:(0,l.default)(Ra.sticky,s,d?.root),style:{...p?.root,...u},...m,children:[E.isStuck&&(0,f.jsx)(`div`,{"aria-hidden":!0,className:(0,l.default)(Ra.stickyPlaceholder,d?.placeholder),style:{height:y.height,...p?.placeholder}}),(0,f.jsx)(`div`,{ref:g,className:(0,l.default)(Ra.stickyContent,E.isStuck&&Ra.stickyContentStuck,d?.content),style:j,children:e})]})}var Va={switch:`switch_9TG2Y`,"switch-disabled":`switch-disabled_UL-F-`,switchDisabled:`switch-disabled_UL-F-`,"switch-track":`switch-track_awA-t`,switchTrack:`switch-track_awA-t`,"switch-track-checked":`switch-track-checked_boZKe`,switchTrackChecked:`switch-track-checked_boZKe`,"switch-thumb":`switch-thumb_4fUTo`,switchThumb:`switch-thumb_4fUTo`,"switch-thumb-checked":`switch-thumb-checked_GU--w`,switchThumbChecked:`switch-thumb-checked_GU--w`,"switch-label":`switch-label_3pLBQ`,switchLabel:`switch-label_3pLBQ`};function Ha(e){let{label:t=``,selected:n=!1,onToggle:r=()=>{},className:i=``,style:a,disabled:o=!1,title:s=``,tabIndex:u=0,formValidator:d=null,children:p=null,classNames:m,styles:h,...g}=O(`Switch`,e),[,_]=(0,c.useState)(0);(0,c.useEffect)(()=>{if(!d)return;let e=()=>_(e=>e+1);return d.registerOnUpdateListener(e),()=>d.removeOnUpdateListener(e)},[d]);function v(e){o||(d&&d.set(!d.value),r(!y,e))}let y=d?d.value:n;return(0,f.jsxs)(`div`,{...g,title:s,className:(0,l.default)(Va.switch,{[Va.switchDisabled]:o},i),style:a,onClick:v,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(e))},role:`switch`,"aria-checked":y,tabIndex:o?-1:u,children:[(0,f.jsx)(`div`,{className:(0,l.default)(Va.switchTrack,y&&Va.switchTrackChecked,m?.track),style:h?.track,children:(0,f.jsx)(`div`,{className:(0,l.default)(Va.switchThumb,y&&Va.switchThumbChecked,m?.thumb),style:h?.thumb})}),(p||t)&&(0,f.jsx)(`div`,{className:(0,l.default)(Va.switchLabel,m?.label),style:h?.label,children:p||t})]})}var Ua={tabHeader:`tabHeader_C-b9d`,"tabHeader-tab":`tabHeader-tab_Wbyt-`,tabHeaderTab:`tabHeader-tab_Wbyt-`,"tabHeader-tab-active":`tabHeader-tab-active_IExSo`,tabHeaderTabActive:`tabHeader-tab-active_IExSo`,"tabHeader-tab-disabled":`tabHeader-tab-disabled_yWJxS`,tabHeaderTabDisabled:`tabHeader-tab-disabled_yWJxS`,"tabHeader-icon":`tabHeader-icon_ryEHB`,tabHeaderIcon:`tabHeader-icon_ryEHB`,"tabHeader-labels":`tabHeader-labels_q5Af5`,tabHeaderLabels:`tabHeader-labels_q5Af5`,"tabHeader-title":`tabHeader-title_Jq2Vy`,tabHeaderTitle:`tabHeader-title_Jq2Vy`,"tabHeader-subtitle":`tabHeader-subtitle_4lhSa`,tabHeaderSubtitle:`tabHeader-subtitle_4lhSa`};function Wa({tabs:e=[],currentTab:t,onChange:n,className:r,style:i,classNames:a,styles:o,...s}){return(0,f.jsx)(`div`,{...s,role:`tablist`,className:(0,l.default)(Ua.tabHeader,a?.root,r),style:{...o?.root,...i},children:e.map(e=>{let r=e.id===t,i=!!e.title||!!e.subtitle;return(0,f.jsxs)(U,{role:`tab`,"aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:e.disabled?-1:0,className:(0,l.default)(Ua.tabHeaderTab,{[Ua.tabHeaderTabActive]:r},{[Ua.tabHeaderTabDisabled]:e.disabled},a?.tab),style:o?.tab,onClick:()=>{e.disabled||r||n(e.id)},children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:e.icon,className:(0,l.default)(Ua.tabHeaderIcon,a?.icon),style:o?.icon}),i&&(0,f.jsxs)(`div`,{className:(0,l.default)(Ua.tabHeaderLabels,a?.labels),style:o?.labels,children:[e.title&&(0,f.jsx)(`span`,{className:(0,l.default)(Ua.tabHeaderTitle,a?.title),style:o?.title,children:e.title}),e.subtitle&&(0,f.jsx)(`span`,{className:(0,l.default)(Ua.tabHeaderSubtitle,a?.subtitle),style:o?.subtitle,children:e.subtitle})]})]},e.id)})})}function Ga(e){return(0,f.jsx)(Tt,{...O(`Textarea`,e),multiline:!0})}var Ka={id:`default`,variables:{"--grey":`#8A8A8A`,"--lightgrey":`#e0e0e0`,"--lightergrey":`#B1B1B1`,"--white":`#FFFFFF`,"--red":`#D6002A`,"--lighter-red":`#ffeae9`,"--green":`#287626`,"--lighter-green":`#C4FFC9`,"--blue":`#5873d5`,"--lighter-blue":`#C6DBFF`,"--black":`black`,"--orange":`#ff7f50`,"--lighter-orange":`#ffe5d9`,"--primary-color":`#8184d6`,"--primary-accent":`#90CAF9`,"--primary-lighter":`#9a9ce4`,"--accent-color":`var(--grey)`,"--accent-color-light":`var(--lightgrey)`,"--text-color":`var(--white)`,"--text-dark":`var(--lightergrey)`,"--text-light":`var(--lightergrey)`,"--text-on-primary":`var(--white)`,"--text-on-delete":`var(--white)`,"--border-color":`#656574`,"--background":`#393945`,"--background-accent":`#33333c`,"--background-accent-dark":`var(--grey)`,"--background-accent-light":`#484856`,"--background-modal":`#484856`,"--success-color":`var(--green)`,"--success-lighter":`var(--lighter-green)`,"--error-color":`var(--red)`,"--error-lighter":`var(--lighter-red)`,"--required-mark-color":`var(--error-color)`,"--info-color":`var(--blue)`,"--info-lighter":`var(--lighter-blue)`,"--warn-color":`var(--orange)`,"--warn-lighter":`var(--lighter-orange)`,"--default-font-size":`14px`,"--text-small-font-size":`12px`,"--header-font-size":`24px`,"--header-medium-font-size":`18px`,"--header-small-font-size":`16px`,"--default-font-weight":`400`,"--header-font-weight":`600`,"--input-background":`transparent`,"--input-icon-color":`var(--text-color)`,"--error-border-color":`var(--red)`,"--button-default-color":`var(--primary-color)`,"--button-default-border":`1px solid var(--primary-color)`,"--default-border-radius":`8px`,"--padding-sides":`15px`,"--margin-top":`10px`,"--default-font":`'Inter', sans-serif`,"--themed-font":`'Inter', sans-serif`,"--card-shadow":`0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%)`,"--background-card-elevated":`var(--background-accent-light)`,"--background-card-outlined":`transparent`,"--background-card-filled":`var(--background-accent)`,"--spacing-s":`4px`,"--spacing-m":`8px`,"--spacing-l":`16px`}},qa={themeRoot:`themeRoot_oegLp`,colorFade:`colorFade_eLv2g`},Ja=class extends c.Component{constructor(...e){super(...e),this.state={resolvedVariables:{},colorFadeActive:!1,currentThemeColor:null},this.colorFadeTimeout=null,this.wrapperRef=c.default.createRef(),this.themeColorMeta=null,this.createdThemeColorMeta=!1,this.applyTheme=e=>{let t=this.props.themes??[Ka],n=t.find(e=>!e.baseThemeId)??t[0],r=n?n.variables:{},i=t.find(t=>t.id===e),a=i?this.resolveChain(i.id):[],o=Object.assign({},r,...a);this.setState({resolvedVariables:o,colorFadeActive:!0}),this.colorFadeTimeout&&clearTimeout(this.colorFadeTimeout),this.colorFadeTimeout=setTimeout(()=>{this.setState({colorFadeActive:!1}),this.colorFadeTimeout=null},500),setTimeout(()=>{this.wrapperRef.current&&this.setState({currentThemeColor:getComputedStyle(this.wrapperRef.current).getPropertyValue(`--primary-color`).trim()})},1)}}componentDidMount(){this.applyTheme(this.props.currentThemeId),this.syncThemeColorMeta(this.state.currentThemeColor??``)}componentDidUpdate(e,t){t.currentThemeColor!==this.state.currentThemeColor&&this.syncThemeColorMeta(this.state.currentThemeColor??``),(e.currentThemeId!==this.props.currentThemeId||e.themes!==this.props.themes)&&this.applyTheme(this.props.currentThemeId)}componentWillUnmount(){this.colorFadeTimeout&&clearTimeout(this.colorFadeTimeout),this.createdThemeColorMeta&&=(this.themeColorMeta?.remove(),this.themeColorMeta=null,!1)}syncThemeColorMeta(e){if(!(typeof document>`u`)){if(!this.themeColorMeta){let e=document.head.querySelector(`meta[name="theme-color"]`);if(e)this.themeColorMeta=e;else{let e=document.createElement(`meta`);e.setAttribute(`name`,`theme-color`),document.head.appendChild(e),this.themeColorMeta=e,this.createdThemeColorMeta=!0}}this.themeColorMeta.setAttribute(`content`,e)}}resolveChain(e){let t=(this.props.themes??[Ka]).find(t=>t.id===e);return t?[...t.baseThemeId?this.resolveChain(t.baseThemeId):[],t.variables]:[]}render(){let{children:e}=this.props,{resolvedVariables:t,colorFadeActive:n}=this.state;return(0,f.jsx)(`div`,{ref:this.wrapperRef,id:`themeProvider`,className:(0,l.default)(qa.themeRoot,n&&qa.colorFade),style:t,children:e})}};function Ya(e=`default`){let[t,n]=(0,c.useState)(localStorage.getItem(`theme`)||e);return{currentThemeId:t,setCurrentThemeId:e=>{n(e),localStorage.setItem(`theme`,e)}}}var Xa=(0,c.createContext)(null);function Za(){return(0,c.useContext)(Xa)}function Qa({children:e,className:t,style:n,...r}){let i=(0,c.useRef)(null),a=(0,c.useRef)(void 0),o=(0,c.useRef)(!1),s=(0,c.useRef)(null),[l,u]=(0,c.useState)({pointer:null,rect:null}),d=()=>{o.current||(o.current=!0,a.current=requestAnimationFrame(()=>{o.current=!1,a.current=void 0;let e=i.current,t=s.current;if(!e||!t)return;let n=e.getBoundingClientRect();u({pointer:{x:t.x-n.left,y:t.y-n.top},rect:n})}))},p=e=>{s.current={x:e.clientX,y:e.clientY},d()},m=()=>{s.current=null,o.current&&a.current!==void 0&&(cancelAnimationFrame(a.current),o.current=!1,a.current=void 0),u({pointer:null,rect:null})};return(0,f.jsx)(`div`,{...r,ref:i,className:t,style:n,onPointerMove:p,onPointerLeave:m,children:(0,f.jsx)(Xa.Provider,{value:l,children:e})})}function $a(e){let t=Math.max(-1,Math.min(1,e));return Math.sign(t)*Math.abs(t)**1.6}function eo(e,t){return Math.max(-t,Math.min(t,e))}function to(e,t,n,{maxTiltX:r,maxTiltY:i,easing:a,lockAxis:o}){let s=n.width>0?e/n.width*2-1:0,c=n.height>0?t/n.height*2-1:0;return{rotateX:o===`x`?0:eo(-a(c)*r,r),rotateY:o===`y`?0:eo(a(s)*i,i)}}var no={tilt:`tilt_gbX2b`,"tilt-perspective":`tilt-perspective_CFdP6`,tiltPerspective:`tilt-perspective_CFdP6`,"tilt-surface":`tilt-surface_Jyzwe`,tiltSurface:`tilt-surface_Jyzwe`};function ro(){return typeof process<`u`&&!1}function io(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}var ao=.3,oo=.05,so=(0,c.forwardRef)(function(e,t){let{children:n,maxTilt:r=15,maxTiltX:i,maxTiltY:a,perspective:o=800,easing:s=$a,lockAxis:u=`none`,scaleOnHover:d=1,trackingMode:p=`self`,disabled:m=!1,onTiltChange:h,className:g,style:_,classNames:v,styles:y,...b}=O(`Tilt`,e),x=(0,c.useRef)(null),S=(0,c.useRef)(null),C=(0,c.useRef)(void 0),w=(0,c.useRef)(!1),T=(0,c.useRef)(!1),E=(0,c.useRef)(!1),D=(0,c.useRef)(null),k=(0,c.useRef)({rotateX:0,rotateY:0}),A=Za(),j=p===`group`,M=j&&A!==null;(0,c.useEffect)(()=>{j&&A===null&&ro()&&console.warn(`Tilt: trackingMode="group" was set with no ancestor TiltGroup, falling back to self tracking.`)},[j,A===null]);let N=i??r,P=a??r;function F(e,t,n){let r=S.current;r&&(r.style.transform=`rotateX(${e}deg) rotateY(${t}deg)`+(n===1?``:` scale(${n})`))}function I(){C.current!==void 0&&(cancelAnimationFrame(C.current),C.current=void 0),w.current=!1}function L(){if(C.current=void 0,!S.current){w.current=!1;return}let e=T.current&&!m&&!io(),t=0,n=0;if(e){let e=D.current,r=x.current?.getBoundingClientRect();if(e&&r){let i=to(e.x-r.left,e.y-r.top,r,{maxTiltX:N,maxTiltY:P,easing:s,lockAxis:u});t=i.rotateX,n=i.rotateY}}let r=k.current,i,a;if(E.current?(i=r.rotateX+(t-r.rotateX)*ao,a=r.rotateY+(n-r.rotateY)*ao,Math.abs(t-i)<oo&&Math.abs(n-a)<oo&&(i=t,a=n,E.current=!1)):(i=t,a=n),k.current={rotateX:i,rotateY:a},F(i,a,e?d:1),h?.(i,a),!E.current){w.current=!1;return}C.current=requestAnimationFrame(L)}function R(){w.current||(w.current=!0,C.current=requestAnimationFrame(L))}function z(e){T.current!==e&&(E.current=!0),T.current=e,R()}let B=e=>{m||M||io()||(D.current={x:e.clientX,y:e.clientY},z(!0))},V=()=>{M||z(!1)};return(0,c.useEffect)(()=>{if(M){if(m||io()){z(!1);return}A?.pointer&&A.rect?(D.current={x:A.rect.left+A.pointer.x,y:A.rect.top+A.pointer.y},z(!0)):z(!1)}},[M,m,A?.pointer,A?.rect]),(0,c.useEffect)(()=>()=>{I()},[]),(0,c.useImperativeHandle)(t,()=>({setTilt(e,t){let n={rotateX:Math.max(-N,Math.min(N,e)),rotateY:Math.max(-P,Math.min(P,t))};I(),T.current=!1,E.current=!1,k.current=n,F(n.rotateX,n.rotateY,d),h?.(n.rotateX,n.rotateY)},reset(){I(),T.current=!1,E.current=!1,k.current={rotateX:0,rotateY:0},F(0,0,1)}})),(0,f.jsx)(`div`,{...b,ref:x,className:(0,l.default)(no.tilt,g,v?.root),style:{..._,...y?.root},onPointerMove:B,onPointerLeave:V,onPointerCancel:V,children:(0,f.jsx)(`div`,{className:(0,l.default)(no.tiltPerspective,v?.perspective),style:{perspective:`${o}px`,...y?.perspective},children:(0,f.jsx)(`div`,{ref:S,className:(0,l.default)(no.tiltSurface,v?.surface),style:y?.surface,children:n})})})}),co=e=>(Math.trunc(e)%24+24)%24,lo=e=>(Math.trunc(e)%60+60)%60;function uo(e){if(!e)return null;let t=e.match(/^(\d{1,2}):(\d{1,2})$/);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return n>23||r>59?null:{hours:n,minutes:r}}function fo(e){return e?`${String(co(e.hours)).padStart(2,`0`)}:${String(lo(e.minutes)).padStart(2,`0`)}`:``}function po(e,t){return lo(!t||t<=1?e:Math.round(lo(e)/t)*t)}var mo=e=>e.hours*60+e.minutes;function ho(e,t,n){let r=mo(e),i=uo(t),a=uo(n);return i&&(r=Math.max(r,mo(i))),a&&(r=Math.min(r,mo(a))),{hours:Math.floor(r/60),minutes:r%60}}function go(e,t,n,r,i){let a=r*i*Math.PI/180;return{x:e+n*Math.sin(a),y:t-n*Math.cos(a)}}function _o(e,t){return(Math.atan2(e,-t)*180/Math.PI+360)%360}var vo=(e,t)=>Math.sqrt(e*e+t*t),yo={clockFace:`clockFace_LbXIa`,clockHand:`clockHand_E9nTw`,"clockHand-line":`clockHand-line_iOipC`,clockHandLine:`clockHand-line_iOipC`,"clockHand-center":`clockHand-center_VElxx`,clockHandCenter:`clockHand-center_VElxx`,"clockHand-knob":`clockHand-knob_Mb2Fx`,clockHandKnob:`clockHand-knob_Mb2Fx`,clockNumber:`clockNumber_qHDO8`,"clockNumber-inner":`clockNumber-inner_x2XR1`,clockNumberInner:`clockNumber-inner_x2XR1`,"clockNumber-selected":`clockNumber-selected_rPVlV`,clockNumberSelected:`clockNumber-selected_rPVlV`},bo=50,xo=40,So=25.5,Co=65.5/2,wo=30,To=6,Eo=e=>(e+11)%12+1;function Do(e,t){if(e===`minutes`)return Array.from({length:12},(e,t)=>{let n=t*5;return{label:String(n).padStart(2,`0`),slot:t,value:n,ring:`outer`}});if(!t)return Array.from({length:12},(e,t)=>{let n=t===0?12:t;return{label:String(n),slot:t,value:n,ring:`outer`}});let n=Array.from({length:12},(e,t)=>{let n=t===0?12:t;return{label:String(n),slot:t,value:n,ring:`outer`}}),r=Array.from({length:12},(e,t)=>{let n=t===0?0:t+12;return{label:String(n).padStart(2,`0`),slot:t,value:n,ring:`inner`}});return[...n,...r]}function Oo({time:e,mode:t,use24Hour:n,minuteStep:r,onChange:i,onCommit:a,classNames:o,styles:s}){let u=(0,c.useRef)(null),d=(0,c.useRef)(!1),p=Do(t,n),m=e.hours>=12,h=Eo(e.hours),g=t===`minutes`?{slot:e.minutes,radius:xo}:n?e.hours===0?{slot:0,radius:So}:e.hours<=12?{slot:e.hours%12,radius:xo}:{slot:(e.hours-12)%12,radius:So}:{slot:h%12,radius:xo},_=go(bo,bo,g.radius,g.slot,t===`minutes`?To:wo),v=i=>t===`minutes`?po(e.minutes,r)===i.value||e.minutes===i.value:n?e.hours===i.value:h===i.value,y=(i,a)=>{let o=u.current?.getBoundingClientRect();if(!o)return e;let s=i-(o.left+o.width/2),c=a-(o.top+o.height/2),l=_o(s,c);if(t===`minutes`){let t=po(Math.round(l/To),r);return{hours:e.hours,minutes:t}}let d=Math.round(l/wo)%12;if(!n){let t=d===0?12:d;return{hours:co(m?t%12+12:t%12),minutes:e.minutes}}return{hours:co(vo(s,c)/(o.width/2)*bo<Co?d===0?0:d+12:d===0?12:d),minutes:e.minutes}};return(0,f.jsxs)(`div`,{ref:u,className:(0,l.default)(yo.clockFace,o?.clockFace),style:s?.clockFace,onPointerDown:e=>{d.current=!0,e.currentTarget.setPointerCapture?.(e.pointerId),i(y(e.clientX,e.clientY))},onPointerMove:e=>{d.current&&i(y(e.clientX,e.clientY))},onPointerUp:e=>{d.current&&(d.current=!1,a(y(e.clientX,e.clientY)))},role:`slider`,"aria-label":t===`minutes`?`Minutes`:`Hours`,"aria-valuetext":t===`minutes`?`${e.minutes} minutes`:`${e.hours} hours`,children:[(0,f.jsxs)(`svg`,{className:yo.clockHand,viewBox:`0 0 100 100`,"aria-hidden":!0,children:[(0,f.jsx)(`circle`,{cx:bo,cy:bo,r:1.8,className:yo.clockHandCenter}),(0,f.jsx)(`line`,{x1:bo,y1:bo,x2:_.x,y2:_.y,className:yo.clockHandLine}),(0,f.jsx)(`circle`,{cx:_.x,cy:_.y,r:7,className:(0,l.default)(yo.clockHandKnob,o?.clockHand),style:s?.clockHand})]}),p.map(e=>{let t=go(bo,bo,e.ring===`inner`?So:xo,e.slot,wo),n=v(e);return(0,f.jsx)(`div`,{className:(0,l.default)(yo.clockNumber,e.ring===`inner`&&yo.clockNumberInner,n&&yo.clockNumberSelected,o?.clockNumber),style:{left:`${t.x}%`,top:`${t.y}%`,...s?.clockNumber},children:e.label},`${e.ring}-${e.value}`)})]})}var ko={timeInput:`timeInput_EbsZN`,"timeInput-clock":`timeInput-clock_D1-dk`,timeInputClock:`timeInput-clock_D1-dk`,"timeInput-clockHeader":`timeInput-clockHeader_bsYNW`,timeInputClockHeader:`timeInput-clockHeader_bsYNW`,"timeInput-headerSegment":`timeInput-headerSegment_Oiu7e`,timeInputHeaderSegment:`timeInput-headerSegment_Oiu7e`,"timeInput-headerSegment-active":`timeInput-headerSegment-active_-Funz`,timeInputHeaderSegmentActive:`timeInput-headerSegment-active_-Funz`,"timeInput-headerColon":`timeInput-headerColon_LwyQH`,timeInputHeaderColon:`timeInput-headerColon_LwyQH`,"timeInput-meridiem":`timeInput-meridiem_tk9km`,timeInputMeridiem:`timeInput-meridiem_tk9km`,"timeInput-meridiem-active":`timeInput-meridiem-active_40uHm`,timeInputMeridiemActive:`timeInput-meridiem-active_40uHm`,"timeInput-footer":`timeInput-footer_NCXsB`,timeInputFooter:`timeInput-footer_NCXsB`};function Ao({value:e,selected:t,onChange:n=()=>null,onSelect:r=()=>null,formValidator:i=null,isInline:a=!1,isModal:o=!1,noInput:s=!1,noHeader:p=!1,showClearButton:m=!1,showNowButton:g=!1,minuteStep:_=1,use24Hour:v=!0,minTime:y=null,maxTime:b=null,label:x=``,isValid:S=!0,errorMessage:C=``,isRequired:w=!1,disabled:T=!1,className:E=``,style:D,classNames:O,styles:k,...A}){let j=()=>i?i.value||``:e??t??``,[M,N]=(0,c.useState)(j),[P,F]=(0,c.useState)(!1),[L,R]=(0,c.useState)(`hours`),[z,B]=(0,c.useState)(!1),[V,ee]=(0,c.useState)(!1),[,te]=(0,c.useState)(0),ne=j(),[re,U]=(0,c.useState)(ne),ie=(0,c.useRef)(i);!i&&re!==ne&&(U(ne),N(ne)),(0,c.useEffect)(()=>{if(ie.current=i,!i)return;let e=()=>{N(i.value||``),te(e=>e+1)};return i.registerOnUpdateListener(e),()=>i.removeOnUpdateListener(e)},[i]);let ae=()=>i?i.touched&&i.hasError():!S||!!C,W=()=>!!(w||i?.validators.find(e=>e.validatorId===`required`)),G=e=>{let t=e?fo(e):null;i&&i.set(t),n?.(t)},oe=e=>{N(e?fo(e):``),G(e)},se=uo(M),ce=se??{hours:12,minutes:0},K=e=>{oe(ho({hours:e.hours,minutes:po(e.minutes,_)},y,b))},le=e=>{let t=ho({hours:e.hours,minutes:po(e.minutes,_)},y,b);if(oe(t),L===`hours`){R(`minutes`);return}r?.(fo(t)),a||F(!1)},ue=()=>{T||(R(`hours`),F(!0))},de=({previousState:e,nextState:t})=>{if(!e||t.value===e.value)return t;let n=t.value,r=n.slice(0,2);/^\d\d$/.test(r)&&Number(r)>23&&(n=`23${n.slice(2)}`);let i=n.slice(3,5);return/^\d\d$/.test(i)&&Number(i)>59&&(n=`${n.slice(0,3)}59`),n===t.value?t:{...t,value:n}},q=e=>{N(e);let t=uo(e);t&&G(t)},fe=()=>{ie.current&&(ie.current.touched=!0),B(!1),G(uo(M))},J=e=>{e!==ce.hours>=12&&oe({hours:co(ce.hours+(e?12:-12)),minutes:ce.minutes})},pe=ae(),me=se?String(v?se.hours:(se.hours+11)%12+1).padStart(2,`0`):`--`,he=se?String(se.minutes).padStart(2,`0`):`--`,ge=p?null:(0,f.jsxs)(`div`,{className:(0,l.default)(ko.timeInputClockHeader,O?.clockHeader),style:k?.clockHeader,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(ko.timeInputHeaderSegment,L===`hours`&&ko.timeInputHeaderSegmentActive,O?.headerSegment),style:k?.headerSegment,onClick:()=>R(`hours`),children:me}),(0,f.jsx)(`span`,{className:ko.timeInputHeaderColon,children:`:`}),(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(ko.timeInputHeaderSegment,L===`minutes`&&ko.timeInputHeaderSegmentActive,O?.headerSegment),style:k?.headerSegment,onClick:()=>R(`minutes`),children:he}),!v&&(0,f.jsxs)(`div`,{className:(0,l.default)(ko.timeInputMeridiem,O?.meridiem),style:k?.meridiem,children:[(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(ce.hours<12&&ko.timeInputMeridiemActive),onClick:()=>J(!1),children:`AM`}),(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(ce.hours>=12&&ko.timeInputMeridiemActive),onClick:()=>J(!0),children:`PM`})]})]}),_e=m||g?(0,f.jsxs)(`div`,{className:(0,l.default)(ko.timeInputFooter,O?.footer),style:k?.footer,children:[g&&(0,f.jsx)(H,{styleType:I.Default,onClick:()=>{let e=new Date;K({hours:e.getHours(),minutes:e.getMinutes()})},children:`Now`}),m&&(0,f.jsx)(H,{styleType:I.Default,onClick:()=>{oe(null),r?.(null)},children:`Clear`})]}):null,ve=(0,f.jsxs)(`div`,{className:(0,l.default)(ko.timeInputClock,O?.clock),style:k?.clock,children:[ge,(0,f.jsx)(Oo,{time:ce,mode:L,use24Hour:v,minuteStep:_,onChange:K,onCommit:le,classNames:O,styles:k}),_e]}),ye=s?null:(0,f.jsx)(Tt,{label:`${x}${W()?` *`:``}`,value:M,icon:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faClock}),onIconClick:ue,onClick:ue,readOnly:o,disabled:T,isValid:!pe,customInput:(0,f.jsx)(h.default,{mask:`99:99`,maskPlaceholder:`_`,beforeMaskedStateChange:de}),onChange:e=>q(e),onBlur:fe,onFocus:()=>B(!0),onMouseEnter:()=>ee(!0),onMouseLeave:()=>ee(!1)}),be=a?ve:o?(0,f.jsx)(Bt,{hideHeader:!0,isOpen:P,onClose:()=>F(!1),children:ve}):(0,f.jsx)(Ue,{isOpen:P,onOpenChange:F,content:ve,align:Ve.Left,dontCloseOnChildClick:!0,children:ye});return(0,f.jsxs)(`div`,{className:(0,l.default)(ko.timeInput,O?.root,E),style:{...k?.root,...D},...A,children:[(o||a)&&ye,be,(0,f.jsx)(vt,{variant:`error`,message:i?i.getCurrentErrorMessage()??``:C||``,isVisible:pe&&(z||V)})]})}var jo={timeline:`timeline_VtQdt`,"timeline-item":`timeline-item_s8-U2`,timelineItem:`timeline-item_s8-U2`,"timeline-item-connector":`timeline-item-connector_06FQ0`,timelineItemConnector:`timeline-item-connector_06FQ0`,"timeline-item-clickable":`timeline-item-clickable_0w8zK`,timelineItemClickable:`timeline-item-clickable_0w8zK`,"timeline-item-disabled":`timeline-item-disabled_EkWVA`,timelineItemDisabled:`timeline-item-disabled_EkWVA`,"timeline-marker":`timeline-marker_u6jDA`,timelineMarker:`timeline-marker_u6jDA`,"timeline-dot":`timeline-dot_l-s7C`,timelineDot:`timeline-dot_l-s7C`,"timeline-dot-primary":`timeline-dot-primary_5Uk-e`,timelineDotPrimary:`timeline-dot-primary_5Uk-e`,"timeline-dot-success":`timeline-dot-success_iEoLv`,timelineDotSuccess:`timeline-dot-success_iEoLv`,"timeline-dot-warn":`timeline-dot-warn_-6G8K`,timelineDotWarn:`timeline-dot-warn_-6G8K`,"timeline-dot-error":`timeline-dot-error_-10M7`,timelineDotError:`timeline-dot-error_-10M7`,"timeline-connector":`timeline-connector_VuXnH`,timelineConnector:`timeline-connector_VuXnH`,"timeline-content":`timeline-content_K4Ztg`,timelineContent:`timeline-content_K4Ztg`,"timeline-header":`timeline-header_xr4Tw`,timelineHeader:`timeline-header_xr4Tw`,"timeline-title":`timeline-title_MZ26k`,timelineTitle:`timeline-title_MZ26k`,"timeline-timestamp":`timeline-timestamp_-0w-N`,timelineTimestamp:`timeline-timestamp_-0w-N`,"timeline-description":`timeline-description_WcWIu`,timelineDescription:`timeline-description_WcWIu`,"timeline-right":`timeline-right_fZEKn`,timelineRight:`timeline-right_fZEKn`,"timeline-alternate":`timeline-alternate_Kv9LY`,timelineAlternate:`timeline-alternate_Kv9LY`,"timeline-item-right":`timeline-item-right_s5ELB`,timelineItemRight:`timeline-item-right_s5ELB`},Mo=function(e){return e.Left=`left`,e.Right=`right`,e.Alternate=`alternate`,e}({}),No=function(e){return e.Default=`default`,e.Primary=`primary`,e.Success=`success`,e.Warn=`warn`,e.Error=`error`,e}({}),Po={[No.Primary]:jo.timelineDotPrimary,[No.Success]:jo.timelineDotSuccess,[No.Warn]:jo.timelineDotWarn,[No.Error]:jo.timelineDotError};function Fo({items:e=[],alignment:t=Mo.Left,className:n,style:r,classNames:i,styles:a,...o}){return(0,f.jsx)(`div`,{...o,className:(0,l.default)(jo.timeline,{[jo.timelineRight]:t===Mo.Right,[jo.timelineAlternate]:t===Mo.Alternate},i?.root,n),style:{...a?.root,...r},children:e.map((n,r)=>{let o=n.id??r,s=r===e.length-1,c=t===Mo.Alternate&&r%2==1,d=!!n.onClick&&!n.disabled,p=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(`div`,{className:(0,l.default)(jo.timelineMarker,i?.marker),style:a?.marker,children:[(0,f.jsx)(`div`,{className:(0,l.default)(jo.timelineDot,Po[n.status??No.Default],i?.dot),style:a?.dot,children:n.icon&&(0,f.jsx)(u.FontAwesomeIcon,{icon:n.icon})}),!s&&(0,f.jsx)(`div`,{className:(0,l.default)(jo.timelineConnector,i?.connector),style:a?.connector})]}),(0,f.jsxs)(`div`,{className:(0,l.default)(jo.timelineContent,i?.content),style:a?.content,children:[(0,f.jsxs)(`div`,{className:jo.timelineHeader,children:[(0,f.jsx)(`div`,{className:(0,l.default)(jo.timelineTitle,i?.title),style:a?.title,children:n.title}),n.timestamp!=null&&(0,f.jsx)(`div`,{className:(0,l.default)(jo.timelineTimestamp,i?.timestamp),style:a?.timestamp,children:n.timestamp})]}),n.description!=null&&(0,f.jsx)(`div`,{className:(0,l.default)(jo.timelineDescription,i?.description),style:a?.description,children:n.description}),n.content]})]}),m=(0,l.default)(jo.timelineItem,{[jo.timelineItemRight]:c},{[jo.timelineItemClickable]:d},{[jo.timelineItemDisabled]:n.disabled},i?.item);return d?(0,f.jsx)(U,{className:m,style:a?.item,onClick:n.onClick,children:p},o):(0,f.jsx)(`div`,{className:m,style:a?.item,"aria-disabled":n.disabled||void 0,children:p},o)})})}var Io={virtualList:`virtualList_qBPNc`,"virtualList-drag-clone":`virtualList-drag-clone_artnC`,virtualListDragClone:`virtualList-drag-clone_artnC`,"virtualList-header":`virtualList-header_0Ellb`,virtualListHeader:`virtualList-header_0Ellb`,"virtualList-header-cell":`virtualList-header-cell_c8NGV`,virtualListHeaderCell:`virtualList-header-cell_c8NGV`,"virtualList-header-toggle":`virtualList-header-toggle_pYFxD`,virtualListHeaderToggle:`virtualList-header-toggle_pYFxD`,"virtualList-toggle-wrapper":`virtualList-toggle-wrapper_JP32M`,virtualListToggleWrapper:`virtualList-toggle-wrapper_JP32M`,"virtualList-toggle-popover":`virtualList-toggle-popover_gbpd7`,virtualListTogglePopover:`virtualList-toggle-popover_gbpd7`,"virtualList-toggle-item":`virtualList-toggle-item_5gu5d`,virtualListToggleItem:`virtualList-toggle-item_5gu5d`,"virtualList-column-chip":`virtualList-column-chip_nOqr6`,virtualListColumnChip:`virtualList-column-chip_nOqr6`,"virtualList-select-cell":`virtualList-select-cell_s9kAy`,virtualListSelectCell:`virtualList-select-cell_s9kAy`,"virtualList-body":`virtualList-body_k-fRr`,virtualListBody:`virtualList-body_k-fRr`,"virtualList-row":`virtualList-row_TTY50`,virtualListRow:`virtualList-row_TTY50`,"virtualList-row-no-divider":`virtualList-row-no-divider_Ct0gV`,virtualListRowNoDivider:`virtualList-row-no-divider_Ct0gV`,"virtualList-row-no-hover":`virtualList-row-no-hover_2d3mH`,virtualListRowNoHover:`virtualList-row-no-hover_2d3mH`,"virtualList-row-selected":`virtualList-row-selected_hwEN-`,virtualListRowSelected:`virtualList-row-selected_hwEN-`,"virtualList-row-draggable":`virtualList-row-draggable_I86ha`,virtualListRowDraggable:`virtualList-row-draggable_I86ha`,"virtualList-row-dragging":`virtualList-row-dragging_6T5tQ`,virtualListRowDragging:`virtualList-row-dragging_6T5tQ`,"virtualList-row-drop-inside":`virtualList-row-drop-inside_Uhi9n`,virtualListRowDropInside:`virtualList-row-drop-inside_Uhi9n`,"virtualList-drop-line":`virtualList-drop-line_EM-g4`,virtualListDropLine:`virtualList-drop-line_EM-g4`,"virtualList-drop-line-before":`virtualList-drop-line-before_n-0iZ`,virtualListDropLineBefore:`virtualList-drop-line-before_n-0iZ`,"virtualList-drop-line-after":`virtualList-drop-line-after_2dld-`,virtualListDropLineAfter:`virtualList-drop-line-after_2dld-`,"virtualList-reordering":`virtualList-reordering_Rt9E3`,virtualListReordering:`virtualList-reordering_Rt9E3`,"virtualList-cell":`virtualList-cell_H0zBv`,virtualListCell:`virtualList-cell_H0zBv`,"virtualList-loading-full":`virtualList-loading-full_wzZNM`,virtualListLoadingFull:`virtualList-loading-full_wzZNM`,"virtualList-loading-indicator":`virtualList-loading-indicator_EJced`,virtualListLoadingIndicator:`virtualList-loading-indicator_EJced`,"virtualList-spinner":`virtualList-spinner_apClW`,virtualListSpinner:`virtualList-spinner_apClW`};function Lo({index:e,top:t,padding:n,columnTemplate:r,isSelected:i,showDivider:a,hover:o,onClick:s,observer:u,ariaRowIndex:d,ariaPosInSet:p,ariaSetSize:m,rowRole:h,reorderable:g,mouseDragEnabled:_,draggable:v,isDragging:y,reserveToggleGutter:b,onMouseDown:x,onMouseOver:S,onMouseLeave:C,onDragStart:w,onDragOver:T,onDragEnd:E,onDrop:D,onTouchStart:O,dropPosition:k,dropIndentPx:A,dropIndicatorClassName:j,dropIndicatorStyle:M,rowClassName:N,rowStyle:P,children:F}){let I=(0,c.useRef)(null);return(0,c.useLayoutEffect)(()=>{let e=I.current;if(!(!e||!u))return u.observe(e),()=>u.unobserve(e)},[u]),(0,f.jsxs)(`div`,{ref:I,"data-index":e,className:(0,l.default)(Io.virtualListRow,i&&Io.virtualListRowSelected,!a&&Io.virtualListRowNoDivider,!o&&Io.virtualListRowNoHover,g&&Io.virtualListRowDraggable,y&&Io.virtualListRowDragging,k===`inside`&&Io.virtualListRowDropInside,N),style:{position:`absolute`,top:0,left:0,right:0,transform:`translateY(${t}px)`,...n==null?{}:{padding:n},...r?{display:`grid`,gridTemplateColumns:r}:{},...b?{paddingRight:32}:{},...P},onClick:s,draggable:v,onMouseDown:x,onMouseOver:S,onMouseLeave:C,onDragStart:w,onDragOver:T,onDragEnd:E,onDrop:D??(_?e=>e.preventDefault():void 0),onTouchStart:O,onContextMenu:_?e=>e.preventDefault():void 0,"aria-selected":i,"aria-rowindex":d,"aria-posinset":p,"aria-setsize":m,role:h,children:[(k===`before`||k===`after`)&&(0,f.jsx)(`div`,{"data-drop-line":k,"aria-hidden":!0,className:(0,l.default)(Io.virtualListDropLine,k===`before`?Io.virtualListDropLineBefore:Io.virtualListDropLineAfter,j),style:{left:A??0,...M}}),F]})}function Ro(e,t,n,r=0){let i=e.length,a=Array(i+1);a[0]=0;for(let o=0;o<i;o++){let s=o<i-1?r:0;a[o+1]=a[o]+(t.get(e[o])??n)+s}return{offsets:a,totalHeight:a[i]}}function zo(e,t,n){if(n<=0)return 0;let r=0,i=n-1;for(;r<i;){let n=r+i>>1;e[n+1]<=t?r=n+1:i=n}return r}function Bo(e,t,n,r,i){if(i===0)return{startIndex:0,endIndex:-1};let a=zo(e,t,i),o=a;for(;o<i&&e[o]<t+n;)o++;return{startIndex:Math.max(0,a-r),endIndex:Math.min(i-1,o+r-1)}}function Vo(e,t,n,r,i){if(e===-1||e===t)return null;let a=r+i/2;return(t>e?n>=a:n<=a)?t:null}function Ho(e,t,n,r){if(n<=0)return`before`;let i=(e-t)/n;return r?i<1/3?`before`:i>2/3?`after`:`inside`:i<.5?`before`:`after`}function Uo(e,t){let n=t[e],r=e+1;for(;r<t.length&&t[r]>n;)r++;return r-1}function Wo(e,t){return e.length===0?`1fr`:e.map(e=>{switch(e.width.type){case`fixed`:return`${e.width.px}px`;case`flex`:return`${e.width.weight??1}fr`;case`fit`:{let n=t?.[e.key];return n==null?`fit-content(100%)`:`${n}px`}}}).join(` `)}var Go=`ahroweui:virtuallist:columns:`;function Ko(e){if(!e||typeof window>`u`)return null;try{let t=window.localStorage.getItem(Go+e);if(!t)return null;let n=JSON.parse(t);if(n&&Array.isArray(n.visible)&&Array.isArray(n.known))return{visible:n.visible.filter(e=>typeof e==`string`),known:n.known.filter(e=>typeof e==`string`)}}catch{}return null}function qo(e,t){return e.lockVisible?!0:t&&t.known.includes(e.key)?t.visible.includes(e.key):!e.defaultHidden}function Jo(e,t){if(typeof e==`number`)return e;let n=e.trim();if(n===``)return 0;let r=Number(n);if(!Number.isNaN(r))return r;let i=/^(-?\d*\.?\d+)px$/.exec(n);if(i)return parseFloat(i[1]);if(typeof document>`u`||!t)return 0;let a=document.createElement(`div`);a.style.cssText=`position:absolute;visibility:hidden;height:${n};`,t.appendChild(a);let o=a.getBoundingClientRect().height;return t.removeChild(a),Number.isFinite(o)?o:0}function Yo({items:e,keys:t,getItemKey:n,estimatedRowHeight:r,rowGap:i,overscan:a,onLoadMore:o,loadMoreThreshold:s,isLoading:l}){let[u,d]=(0,c.useState)(0),[f,p]=(0,c.useState)(0),[m,h]=(0,c.useState)(0),[g,_]=(0,c.useState)(()=>Jo(i,null)),[v,y]=(0,c.useState)(new Map),[b,x]=(0,c.useState)(!1),S=(0,c.useRef)(!1),C=(0,c.useRef)(null),w=(0,c.useRef)(null),T=(0,c.useRef)([]),E=(0,c.useRef)(null),D=(0,c.useRef)(0),O=(0,c.useRef)([]),[k]=(0,c.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(e=>{y(t=>{let n=null;for(let r of e){let e=r.target,i=Number(e.dataset.index);if(Number.isNaN(i))continue;let a=O.current[i];if(a===void 0)continue;let o=r.borderBoxSize?.[0],s=o?Math.round(o.blockSize):e.offsetHeight;t.get(a)!==s&&(n||=new Map(t),n.set(a,s))}return n??t})}));(0,c.useEffect)(()=>()=>k?.disconnect(),[k]),(0,c.useLayoutEffect)(()=>{let e=C.current;if(!e)return;p(e.clientHeight),h(e.clientWidth);let t=new ResizeObserver(()=>{p(e.clientHeight),h(e.clientWidth)});return t.observe(e),()=>t.disconnect()},[]);let A=(0,c.useRef)(o);(0,c.useLayoutEffect)(()=>{A.current=o});let j=(0,c.useCallback)(()=>{let e=A.current;!e||S.current||(S.current=!0,x(!0),e().finally(()=>{S.current=!1,x(!1)}))},[]),M=(0,c.useCallback)(e=>{let t=e.currentTarget;D.current=t.scrollTop,E.current??=requestAnimationFrame(()=>{E.current=null,d(D.current)}),t.scrollTop+t.clientHeight>=t.scrollHeight-s&&j()},[s,j]);(0,c.useEffect)(()=>()=>{E.current!=null&&cancelAnimationFrame(E.current)},[]),(0,c.useLayoutEffect)(()=>{O.current=t}),(0,c.useLayoutEffect)(()=>{let e=Jo(i,C.current);_(t=>t===e?t:e)},[i,m,f]);let{offsets:N,totalHeight:P}=(0,c.useMemo)(()=>Ro(t,v,r,g),[t,v,r,g]),F=(0,c.useRef)(``);(0,c.useEffect)(()=>{if(!o||l||b||f===0||P>=f-(w.current?.offsetHeight??0))return;let t=`${e.length}:${f}`;F.current!==t&&(F.current=t,j())},[o,l,b,e.length,P,f,j]),(0,c.useLayoutEffect)(()=>{let t=C.current,n=T.current;if(T.current=N,!t||n.length===0)return;let r=t.scrollTop;if(r<=0)return;let i=zo(n,r,n.length-1);if(i>=e.length)return;let a=r-n[i],o=N[i]+a;Math.abs(o-r)>.5&&(t.scrollTop=o,D.current=o,d(o))},[N,e.length]);let I=(0,c.useMemo)(()=>{function t(e,t){let n=C.current;if(!n)return;let r=Math.max(0,e);typeof n.scrollTo==`function`?n.scrollTo({top:r,behavior:t??`auto`}):n.scrollTop=r}function r(n,r){let i=C.current;if(!i||e.length===0)return;let a=Math.max(0,Math.min(n,e.length-1)),o=N[a]??0,s=(N[a+1]??o)-o,c=w.current?.offsetHeight??0,l=Math.max(0,i.clientHeight-c),u=r?.align??`start`,d=o-c;u===`center`?d-=(l-s)/2:u===`end`&&(d-=l-s),t(d,r?.behavior)}return{scrollToIndex:r,scrollToKey(t,i){let a=e.findIndex((e,r)=>(n?n(e,r):r)===t);a>=0&&r(a,i)},scrollToTop(e){t(0,e?.behavior)},getScrollElement:()=>C.current}},[e,N,n]),{startIndex:L,endIndex:R}=(0,c.useMemo)(()=>Bo(N,u,f,a,e.length),[N,u,f,a,e.length]);return{rootRef:C,headerRef:w,rowObserver:k,keysRef:O,offsets:N,totalHeight:P,containerHeight:f,containerWidth:m,startIndex:L,endIndex:R,handleScroll:M,showLoadMoreSpinner:b,scrollApi:I}}function Xo({items:e,getKey:t,multiSelect:n,selectedKeys:r,onSelectionChange:i}){let a=r!==void 0,[o,s]=(0,c.useState)(new Set),l=a?r:o;function u(e){a||s(e),i?.(e)}function d(e){let t=new Set(l);t.has(e)?t.delete(e):t.add(e),u(t)}function f(){let n=e.map((e,n)=>t(e,n));u(n.every(e=>l.has(e))?new Set:new Set(n))}let{allSelected:p,someSelected:m}=(0,c.useMemo)(()=>{if(!n||e.length===0)return{allSelected:!1,someSelected:!1};let r=e.every((e,n)=>l.has(t(e,n)));return{allSelected:r,someSelected:!r&&e.some((e,n)=>l.has(t(e,n)))}},[n,e,l,t]);return{effectiveSelectedKeys:l,handleRowSelect:d,handleSelectAll:f,allSelected:p,someSelected:m}}function Zo({columns:e,items:t,multiSelect:n,visibleColumnKeys:r,onVisibleColumnsChange:i,persistColumnsKey:a,showColumnToggle:o,rootRef:s,startIndex:l,endIndex:u,containerHeight:d,containerWidth:f}){let p=r!==void 0,[m,h]=(0,c.useState)(!1),[g,_]=(0,c.useState)({}),[v,y]=(0,c.useState)(()=>{let t=Ko(a);return new Set((e??[]).filter(e=>qo(e,t)).map(e=>e.key))}),b=(0,c.useRef)(new Set((e??[]).map(e=>e.key)));(0,c.useEffect)(()=>{if(p)return;let t=e??[],n=new Set(t.map(e=>e.key)),r=b.current,i=n.size===r.size;if(i){for(let e of n)if(!r.has(e)){i=!1;break}}if(i)return;b.current=n;let o=Ko(a);y(e=>{let n=new Set;for(let i of t)r.has(i.key)?e.has(i.key)&&n.add(i.key):qo(i,o)&&n.add(i.key);return n})},[e,p,a]),(0,c.useEffect)(()=>{if(p||!a||typeof window>`u`)return;let t=e??[];if(!(t.length===0||v.size===0))try{window.localStorage.setItem(Go+a,JSON.stringify({visible:[...v],known:t.map(e=>e.key)}))}catch{}},[v,e,p,a]);let x=p?new Set(r):v,S=(e??[]).filter(e=>e.lockVisible).map(e=>e.key),C=S.some(e=>!x.has(e))?new Set([...x,...S]):x,w=!!e?.length,T=w?e.filter(e=>C.has(e.key)):[],E=w?e.filter(e=>!e.defaultHidden&&!C.has(e.key)).length:0,D=w?`${n&&w?`40px `:``}${Wo(T,g)}`:void 0,O=o!==!1&&w&&e.some(e=>!e.hideFromToggle),k=T.filter(e=>e.width.type===`fit`),A=k.length>0,j=k.map(e=>e.key).join(`|`),[M,N]=(0,c.useState)({key:j,items:t});(M.key!==j||M.items!==t)&&(N({key:j,items:t}),Object.keys(g).length>0&&_({}));let P=(0,c.useCallback)(()=>{let e=s.current;if(!e)return;let t=new Map;e.querySelectorAll(`[data-fit-key]`).forEach(e=>{let n=e,r=n.getAttribute(`data-fit-key`);if(!r)return;let i=n.scrollWidth>n.clientWidth,a=n.scrollWidth;if(i||n.firstElementChild){let e=getComputedStyle(n),t=parseFloat(e.paddingLeft)||0,r=parseFloat(e.paddingRight)||0;if(i&&(a+=r),n.firstElementChild&&!i&&n.scrollWidth<=t+r+1){let e=1/0,i=-1/0;if(n.querySelectorAll(`*`).forEach(t=>{let n=t.getBoundingClientRect();n.left<e&&(e=n.left),n.right>i&&(i=n.right)}),i>e){let n=Math.ceil(i-e)+t+r;n>a&&(a=n)}}}a>(t.get(r)??0)&&t.set(r,a)}),t.size!==0&&_(n=>{let r=!1,i={...n};for(let[a,o]of t){if(o<=0)continue;let t=Math.min(Math.ceil(o),e.clientWidth);t>(n[a]??0)&&(i[a]=t,r=!0)}return r?i:n})},[s]),[F]=(0,c.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(()=>P())),I=(0,c.useRef)(new Set);(0,c.useEffect)(()=>()=>{F?.disconnect(),I.current.clear()},[F]),(0,c.useLayoutEffect)(()=>{if(!A)return;let e=s.current;if(!e||(P(),!F))return;let t=new Set(e.querySelectorAll(`[data-fit-key]`)),n=I.current;for(let e of n)t.has(e)||(F.unobserve(e),n.delete(e));for(let e of t)n.has(e)||(F.observe(e),n.add(e))},[A,j,g,l,u,d,f,t,P,F]),(0,c.useEffect)(()=>{if(!A)return;let e=0,t=requestAnimationFrame(()=>{P(),e=requestAnimationFrame(()=>P())});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},[A,j,t,P]);let L=(0,c.useCallback)(()=>_({}),[]);function R(t){if(e?.find(e=>e.key===t)?.lockVisible)return;let n=new Set(C);if(n.has(t)){if(n.size<=1)return;n.delete(t)}else n.add(t);let r=[...n];p||y(n),i?.(r)}return{hasColumns:w,visibleColumns:T,columnTemplate:D,shouldShowToggle:O,effectiveVisible:C,manuallyHiddenCount:E,toggleOpen:m,setToggleOpen:h,handleToggleColumn:R,recalculateColumns:L}}function Qo({reorderable:e,treeReorder:t,onReorder:n,onTreeDrop:r,longPressDelay:i,dragHandle:a,treeIndentPx:o,keys:s,depths:l,isGroupAt:u,rootRef:d,keysRef:f}){let p=(0,c.useRef)(null),[m,h]=(0,c.useState)(null),[g,_]=(0,c.useState)(null),v=(0,c.useRef)(null),y=(0,c.useRef)(n),b=(0,c.useRef)(r),x=(0,c.useRef)(t),S=(0,c.useRef)(l),C=(0,c.useRef)(u),w=(0,c.useRef)(!0),T=(0,c.useRef)(null),[E,D]=(0,c.useState)(null),O=(0,c.useRef)(null),k=(0,c.useRef)(!1),A=(0,c.useRef)(null),j=(0,c.useRef)(0),M=(0,c.useRef)(0),N=(0,c.useRef)(null),P=(0,c.useRef)(!1),F=(0,c.useRef)(null),I=(0,c.useRef)(0),L=(0,c.useRef)(0),R=(0,c.useRef)(0),[z]=(0,c.useState)(()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`).matches:!1);(0,c.useLayoutEffect)(()=>{y.current=n,b.current=r,x.current=t,S.current=l,v.current=g,C.current=u});function B(e){z||T.current!==e&&(T.current=e,D(e))}function V(e,t){t.buttons===0&&B(t.target.closest(`[data-drag-handle]`)?e:null)}function ee(e){e.buttons===0&&B(null)}function H(e,t){if(t.button!==0)return;let n=!!t.target.closest(`[data-drag-handle]`);w.current=n,n&&B(e)}function te(e,n){if(a&&!w.current){n.preventDefault();return}p.current=e,h(e),t&&_(null)}function ne(e,t,n){let r=p.current;if(r==null)return null;let i=s.indexOf(r);if(i!==-1&&e>=i&&e<=Uo(i,l))return null;let a=Ho(t,n.top,n.height,u(e));return{key:s[e],position:a}}function re(e,t){t.preventDefault();let n=t.currentTarget.getBoundingClientRect(),r=ne(e,t.clientY,n);_(e=>e?.key===r?.key&&e?.position===r?.position?e:r)}function U(){let e=p.current,t=v.current;e!=null&&t&&t.key!==e&&r?.(e,t)}function ie(e){e.preventDefault(),U(),_(null),p.current=null,h(null),B(null)}function ae(){_(null),p.current=null,h(null),B(null)}function W(e,t){t.preventDefault();let r=p.current;if(r==null)return;let i=s.indexOf(r),a=t.currentTarget.getBoundingClientRect(),o=Vo(i,e,t.clientY,a.top,a.height);o!=null&&n?.(i,o)}function G(){p.current=null,h(null),B(null)}let oe=(0,c.useCallback)(e=>{let t=p.current,n=d.current;if(t==null||!n)return;let r=F.current?M.current-I.current+R.current/2:M.current,i=document.elementFromPoint(e,r),a=i&&n.contains(i)?i.closest(`[data-index]`):null;if(!a)return;let o=Number(a.dataset.index);if(Number.isNaN(o))return;let s=f.current.indexOf(t),c=a.getBoundingClientRect();if(x.current){let e=f.current,t=S.current;if(s!==-1&&o>=s&&o<=Uo(s,t)){_(null);return}let n=Ho(r,c.top,c.height,C.current(o)),i={key:e[o],position:n};_(e=>e?.key===i.key&&e?.position===i.position?e:i);return}let l=Vo(s,o,r,c.top,c.height);l!=null&&y.current?.(s,l)},[d,f]),se=(0,c.useCallback)(()=>{let e=F.current;e&&(e.style.transform=`translate(${L.current}px, ${M.current-I.current}px)`)},[]),ce=(0,c.useCallback)(()=>{let e=d.current;if(!e||!k.current){N.current=null;return}let t=e.getBoundingClientRect(),n=j.current,r=M.current,i=0;n>=t.left&&n<=t.right&&r>=t.top&&r<=t.bottom&&(r<t.top+48?i=-Math.min(18,Math.ceil((t.top+48-r)/3)):r>t.bottom-48&&(i=Math.min(18,Math.ceil((r-(t.bottom-48))/3)))),i!==0&&(e.scrollTop+=i,oe(n)),N.current=requestAnimationFrame(ce)},[oe,d]),K=(0,c.useCallback)(()=>{if(O.current!=null&&(clearTimeout(O.current),O.current=null),window.removeEventListener(`touchmove`,le),window.removeEventListener(`touchend`,K),window.removeEventListener(`touchcancel`,K),N.current!=null&&(cancelAnimationFrame(N.current),N.current=null),F.current&&=(F.current.remove(),null),document.body.style.touchAction=``,document.body.style.overscrollBehavior=``,k.current&&(P.current=!0,setTimeout(()=>{P.current=!1},350),x.current)){let e=p.current,t=v.current;e!=null&&t&&t.key!==e&&b.current?.(e,t)}_(null),k.current=!1,A.current=null,p.current=null,h(null)},[]),le=(0,c.useCallback)(e=>{let t=e.touches[0];if(t){if(j.current=t.clientX,M.current=t.clientY,!k.current){let e=A.current;e!=null&&Math.abs(t.clientY-e)>10&&O.current!=null&&(clearTimeout(O.current),O.current=null);return}e.cancelable&&e.preventDefault(),se(),oe(t.clientX)}},[oe,se]);function ue(n,r){if(!e&&!t||a&&!r.target.closest(`[data-drag-handle]`)||O.current!=null||k.current)return;let o=r.touches[0];o&&(A.current=o.clientY,j.current=o.clientX,M.current=o.clientY,window.addEventListener(`touchmove`,le,{passive:!1}),window.addEventListener(`touchend`,K),window.addEventListener(`touchcancel`,K),O.current=window.setTimeout(()=>{O.current=null,k.current=!0,p.current=n,h(n),navigator.vibrate?.(10),document.body.style.touchAction=`none`,document.body.style.overscrollBehavior=`none`,de(n),N.current??=requestAnimationFrame(ce)},i))}function de(e){let t=d.current;if(!t)return;let n=f.current.indexOf(e),r=t.querySelector(`[data-index="${n}"]`);if(!r)return;let i=r.getBoundingClientRect();I.current=M.current-i.top,L.current=i.left,R.current=i.height;let a=r.cloneNode(!0);a.removeAttribute(`data-index`),a.setAttribute(`data-drag-clone`,`true`),a.setAttribute(`aria-hidden`,`true`),a.classList.add(Io.virtualListDragClone),Object.assign(a.style,{position:`fixed`,left:`0`,top:`0`,width:`${i.width}px`,height:`${i.height}px`,margin:`0`,opacity:`1`,pointerEvents:`none`,zIndex:`3`,background:`var(--background)`,boxShadow:`var(--card-shadow)`,borderRadius:`var(--default-border-radius)`}),t.appendChild(a),F.current=a,se()}(0,c.useEffect)(()=>K,[K]);let q=e||t,fe=q&&!z;function J(n,r){let i=t&&g?.key===r?g.position:void 0;return{reorderable:q&&!a,mouseDragEnabled:fe,draggable:fe&&(!a||r===E)||void 0,isDragging:q&&r===m,onMouseDown:q&&a?e=>H(r,e):void 0,onMouseOver:q&&a?e=>V(r,e):void 0,onMouseLeave:q&&a?ee:void 0,onDragStart:q?e=>te(r,e):void 0,onDragOver:t?e=>re(n,e):e?e=>W(n,e):void 0,onDragEnd:t?ae:e?G:void 0,onDrop:t?ie:void 0,onTouchStart:q?e=>ue(r,e):void 0,dropPosition:i,dropIndentPx:i?(l[n]??0)*o:void 0}}function pe(){return P.current?(P.current=!1,!0):!1}return{draggingKey:m,dragEnabled:q,getRowDragProps:J,consumeSuppressedClick:pe}}function $o({items:e,renderRow:t,columns:n,height:r=`100%`,estimatedRowHeight:i=40,overscan:a=3,rowGap:o=0,rowPadding:s,selectedKey:p,getItemKey:m,onRowClick:h,visibleColumnKeys:g,onVisibleColumnsChange:_,persistColumnsKey:v,showColumnToggle:y,onLoadMore:b,loadMoreThreshold:x=100,isLoading:S=!1,multiSelect:C=!1,selectedKeys:w,onSelectionChange:T,reorderable:E=!1,onReorder:D,longPressDelay:O=400,treeReorder:k=!1,getItemDepth:A,isGroup:j,onTreeDrop:M,treeIndentPx:N=24,dragHandle:P=!1,showDivider:I=!0,rowHover:L=!0,className:R,style:z,classNames:B,styles:V,...ee},H){let te=(0,c.useCallback)((e,t)=>m?m(e,t):t,[m]),ne=(0,c.useMemo)(()=>e.map((e,t)=>te(e,t)),[e,te]),re=(0,c.useMemo)(()=>A?e.map((e,t)=>A(e,t)):[],[e,A]),U=(0,c.useCallback)(t=>j?j(e[t],t):!1,[j,e]),ie=Yo({items:e,keys:ne,getItemKey:m,estimatedRowHeight:i,rowGap:o,overscan:a,onLoadMore:b,loadMoreThreshold:x,isLoading:S}),{rootRef:ae,headerRef:W,rowObserver:G,keysRef:oe,offsets:se,totalHeight:ce,startIndex:K,endIndex:le}=ie,ue=Xo({items:e,getKey:te,multiSelect:C,selectedKeys:w,onSelectionChange:T}),{effectiveSelectedKeys:de}=ue,{hasColumns:q,visibleColumns:fe,columnTemplate:J,shouldShowToggle:pe,effectiveVisible:me,manuallyHiddenCount:he,toggleOpen:ge,setToggleOpen:_e,handleToggleColumn:ve,recalculateColumns:ye}=Zo({columns:n,items:e,multiSelect:C,visibleColumnKeys:g,onVisibleColumnsChange:_,persistColumnsKey:v,showColumnToggle:y,rootRef:ae,startIndex:K,endIndex:le,containerHeight:ie.containerHeight,containerWidth:ie.containerWidth});(0,c.useImperativeHandle)(H,()=>({...ie.scrollApi,recalculateColumns:ye}),[ie.scrollApi,ye]);let be=Qo({reorderable:E,treeReorder:k,onReorder:D,onTreeDrop:M,longPressDelay:O,dragHandle:P,treeIndentPx:N,keys:ne,depths:re,isGroupAt:U,rootRef:ae,keysRef:oe}),xe=typeof s==`number`?`${s}px`:s,Se=n=>{let r=e[n],i=te(r,n),a=p!=null&&i===p||de.has(i),o=be.getRowDragProps(n,i);return(0,f.jsx)(Lo,{index:n,top:se[n],padding:xe,columnTemplate:J,isSelected:a,showDivider:I,hover:L,onClick:()=>{be.consumeSuppressedClick()||h?.(r,n)},observer:G,ariaRowIndex:q?n+2:void 0,ariaPosInSet:q?void 0:n+1,ariaSetSize:q?void 0:e.length,rowRole:q?`row`:`listitem`,reserveToggleGutter:pe,...o,dropIndicatorClassName:B?.dropIndicator,dropIndicatorStyle:V?.dropIndicator,rowClassName:B?.row,rowStyle:V?.row,children:q?(0,f.jsxs)(f.Fragment,{children:[C&&(0,f.jsx)(`div`,{className:(0,l.default)(Io.virtualListSelectCell,B?.selectCell),style:V?.selectCell,role:`gridcell`,onClick:e=>e.stopPropagation(),children:(0,f.jsx)(dt,{selected:de.has(i),onToggle:()=>ue.handleRowSelect(i),"aria-label":`Select row`})}),fe.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)(Io.virtualListCell,B?.cell),style:V?.cell,role:`gridcell`,"data-fit-key":e.width.type===`fit`?e.key:void 0,children:e.renderCell(r,n)},e.key))]}):t?.(r,n)},i)},Ce=[];for(let e=K;e<=le;e++)Ce.push(Se(e));let we=be.draggingKey==null?-1:ne.indexOf(be.draggingKey);return we>=0&&(we<K||we>le)&&Ce.push(Se(we)),(0,f.jsxs)(`div`,{...ee,ref:ae,className:(0,l.default)(Io.virtualList,be.draggingKey!=null&&Io.virtualListReordering,R,B?.root),style:{height:r,...z,...V?.root},onScroll:ie.handleScroll,role:q?`grid`:`list`,"aria-rowcount":q?e.length+1:void 0,children:[q&&(0,f.jsxs)(`div`,{ref:W,className:(0,l.default)(Io.virtualListHeader,B?.header),style:{gridTemplateColumns:J,...pe?{paddingRight:32}:{},...V?.header},role:`row`,"aria-rowindex":1,children:[C&&(0,f.jsx)(`div`,{className:(0,l.default)(Io.virtualListSelectCell,B?.selectCell),style:V?.selectCell,role:`columnheader`,children:(0,f.jsx)(dt,{selected:ue.allSelected||ue.someSelected,onToggle:ue.handleSelectAll,"aria-label":`Select all rows`})}),fe.map(e=>(0,f.jsx)(`div`,{className:(0,l.default)(Io.virtualListHeaderCell,B?.headerCell),style:V?.headerCell,role:`columnheader`,"data-fit-key":e.width.type===`fit`?e.key:void 0,children:e.label},e.key)),pe&&(0,f.jsxs)(`div`,{className:Io.virtualListToggleWrapper,children:[(0,f.jsx)(Ue,{isOpen:ge,onOpenChange:_e,align:Ve.Right,dontCloseOnChildClick:!0,content:(0,f.jsx)(`div`,{className:(0,l.default)(Io.virtualListTogglePopover,B?.togglePopover),style:V?.togglePopover,children:n.filter(e=>!e.hideFromToggle).map(e=>(0,f.jsx)(dt,{className:(0,l.default)(Io.virtualListToggleItem,B?.toggleItem),style:V?.toggleItem,selected:me.has(e.key),onToggle:()=>ve(e.key),disabled:e.lockVisible,cursorDefault:!1,children:e.toggleLabel??e.label},e.key))}),children:(0,f.jsx)(`button`,{type:`button`,className:(0,l.default)(Io.virtualListHeaderToggle,B?.headerToggle),style:V?.headerToggle,"aria-label":`Toggle column visibility`,children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faGear,style:V?.headerToggle})})}),he>0&&(0,f.jsx)(`span`,{className:(0,l.default)(Io.virtualListColumnChip,B?.columnChip),style:V?.columnChip,"data-column-hidden-count":he,"aria-label":`${he} columns hidden`,children:he})]})]}),S?(0,f.jsx)(`div`,{className:Io.virtualListLoadingFull,children:(0,f.jsx)(F,{className:Io.virtualListSpinner})}):(0,f.jsx)(`div`,{className:(0,l.default)(Io.virtualListBody,B?.body),style:{height:ce,...V?.body},children:Ce}),ie.showLoadMoreSpinner&&(0,f.jsx)(`div`,{className:(0,l.default)(Io.virtualListLoadingIndicator,B?.loadingIndicator),style:V?.loadingIndicator,children:(0,f.jsx)(F,{className:Io.virtualListSpinner})})]})}var es=c.default.forwardRef($o),ts={wizard:`wizard_uRBAN`,"wizard-content":`wizard-content_lcl4C`,wizardContent:`wizard-content_lcl4C`,"wizard-content-outOfFrame":`wizard-content-outOfFrame_Eks4Y`,wizardContentOutOfFrame:`wizard-content-outOfFrame_Eks4Y`,"wizard-content-container":`wizard-content-container_yxbCJ`,wizardContentContainer:`wizard-content-container_yxbCJ`};function ns({currentStep:e=0,stepCount:t=0,renderStep:n=()=>null,className:r,style:i,classNames:a,styles:o,...s}){let[u,d]=(0,c.useState)(void 0),[p,m]=(0,c.useState)(!1),[h,g]=(0,c.useState)(e),_=(0,c.useRef)([]),v=(0,c.useRef)(null);e!==h&&(g(e),m(!0)),(0,c.useEffect)(()=>{if(!p)return;let e=setTimeout(()=>m(!1),400);return()=>clearTimeout(e)},[p]),(0,c.useEffect)(()=>{v.current?.disconnect();let t=_.current[e];if(t)return d(t.clientHeight),v.current=new ResizeObserver(()=>{d(t.clientHeight)}),v.current.observe(t),()=>v.current?.disconnect()},[e,t]);let y={...u===void 0?{}:{height:`${u}px`},...o?.root,...i};return(0,f.jsx)(`div`,{...s,className:(0,l.default)(ts.wizard,a?.root,r),style:y,children:(0,f.jsx)(`div`,{className:(0,l.default)(ts.wizardContentContainer,a?.container),style:{width:`${t*100}%`,marginLeft:`-${e*100}%`,...o?.container},children:Array.from({length:t},(r,i)=>(0,f.jsx)(`div`,{ref:e=>{_.current[i]=e},className:(0,l.default)(ts.wizardContent,a?.step),style:{width:`${100/t}%`,marginLeft:`${100/t*i}%`,...o?.step},children:(0,f.jsx)(`div`,{className:(0,l.default)({[ts.wizardContentOutOfFrame]:e!==i&&!p},a?.stepContent),style:o?.stepContent,inert:e===i?void 0:!0,children:n(i)})},`wizardStep${i}`))})})}var rs=e=>{Un(e[0].message,{type:`error`})},is=class extends b.FormValidatorGroup{constructor(e,t=null,n){super(e,t,{...n,onSubmitError:n?.onSubmitError??rs}),this.Form=(0,b.createFormComponent)(this)}},as=class extends c.PureComponent{static{this.defaultProps={formValidator:null,onMouseEnter:null,onMouseLeave:null,onFocus:null,onBlur:null,onChange:null,errorMessage:``,isValid:!1,isRequired:!1,label:``}}constructor(e){super(e);let{formValidator:t}=e;t&&(t.label=e.label??``,t.validate(),t.registerOnUpdateListener(()=>{this.forceUpdate()})),this.state={isFocused:!1,isHovered:!1},this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.hasError=this.hasError.bind(this),this.renderTooltip=this.renderTooltip.bind(this),this.onChange=this.onChange.bind(this)}componentDidMount(){setTimeout(()=>this.setState({isFocused:!1,isHovered:!1}),1)}componentDidUpdate(e){let{formValidator:t}=this.props;e.formValidator&&t&&e.formValidator!==t&&t.registerOnUpdateListener(()=>{this.forceUpdate()})}onMouseEnter(e){let{onMouseEnter:t}=this.props;this.setState({isHovered:!0}),t&&t(e)}onMouseLeave(e){let{onMouseLeave:t}=this.props;this.setState({isHovered:!1}),t&&t(e)}onFocus(e){let{onFocus:t}=this.props;this.setState({isFocused:!0}),t&&t(e)}onBlur(e){let{formValidator:t,onBlur:n}=this.props;t&&(t.touched=!0),this.setState({isFocused:!1}),n&&n(e)}hasError(){let{errorMessage:e,isValid:t,formValidator:n}=this.props;return n?n.touched&&n.hasError():!t||!!e}isRequired(){let{isRequired:e,formValidator:t}=this.props;return!!(e||t&&t.validators.find(e=>e.validatorId===`required`))}renderTooltip(){let{errorMessage:e,formValidator:t}=this.props,{isHovered:n,isFocused:r}=this.state;return(0,f.jsx)(vt,{variant:`error`,message:t?t.getCurrentErrorMessage():e||``,isVisible:this.hasError()&&(r||n)})}onChange(e){let{onChange:t,formValidator:n}=this.props;if(n){let t=e;e&&e.target&&(t=e.target.value),n.set(t)}t&&t(e)}};function os(e,{initialValues:t,onSubmit:n,onValidate:r,errorParser:i,onSubmitError:a}={}){return(0,b.useFormValidatorGroupInstance)(()=>new is(e,null,{initialValues:t,errorParser:i,onSubmitError:a}),n,r)}exports.Accordion=A,exports.AccordionStyleType=x,exports.ActionButtons=te,exports.ActionIcon=ae,exports.Alert=ce,exports.AlertStyleType=W,exports.Align=Ve,exports.AnimatedLogo=de,exports.AnimatedText=xe,exports.AnimatedTextUnit=fe,exports.AnimatedTextVariant=q,exports.Avatar=je,exports.AvatarGroup=Me,exports.Badge=De,exports.BadgePosition=Ce,exports.BadgeStyleType=Se,exports.BodyEnd=Ne,exports.Breadcrumb=Ke,exports.Button=H,exports.ButtonGroup=Xe,exports.ButtonGroupOrientation=Je,exports.ButtonSize=L,exports.ButtonStyleType=I,exports.ButtonType=R,exports.Card=et,exports.CardActions=it,exports.CardContent=rt,exports.CardHeader=tt,exports.CardMedia=nt,exports.CardStyleType=Ze,exports.Carousel=ct,exports.Checkbox=dt,exports.Chip=ht,exports.ChipContainer=gt,exports.ChipStyleType=ft,exports.ColorPicker=Rt,exports.ConfigProvider=D,exports.ConfirmModal=Vt,exports.DatePicker=gn,exports.Divider=xn,exports.DividerOrientation=vn,exports.DividerTextPosition=_n,exports.Drawer=Cn,exports.DropZone=jn,exports.DropZoneReturnType=Tn,exports.DropZoneStatus=wn,exports.Dropdown=mn,exports.EmptyState=Nn,exports.ErrorBoundary=Qn,exports.Fab=rr,exports.Flip=sr,exports.FloatingMenu=Ue,Object.defineProperty(exports,"FormValidator",{enumerable:!0,get:function(){return b.FormValidator}}),exports.FormValidatorGroup=is,exports.IconLoading=Qr,exports.IconPicker=dr,exports.IdleManager=pr,exports.InfiniteBlock=pn,exports.Input=Tt,exports.InputDropdown=_r,exports.InputIconPosition=wt,exports.InputType=Ct,exports.InteractableDiv=U,exports.KanbanBoard=zr,exports.KanbanColumn=Cr,exports.KlipyPicker=Yr,exports.Modal=Bt,exports.NumberInput=ti,exports.OptionPicker=ri,exports.Overscroll=si,exports.Popover=hi,exports.PopoverAlign=ui,exports.PopoverPlacement=li,exports.PopoverTrigger=di,exports.ProgressBar=vi,exports.RadioGroup=xi,exports.RadioGroupOrientation=yi,exports.Rating=Ti,exports.RevealLens=Ai,exports.Ripple=B,exports.RoomDrawer=ra,exports.RoomViewer=aa,exports.ScrollbarProvider=ca,exports.SearchInput=Ur,exports.SectionHeader=fa,exports.SectionHeaderSize=la,exports.Skeleton=va,exports.SkeletonAnimation=ma,exports.SkeletonVariant=pa,exports.Slider=xa,exports.SpinnerLoading=F,exports.SplitButton=wa,exports.Stepper=Pa,exports.StepperAlignment=Ta,exports.StepperCollapse=Da,exports.StepperLabelPlacement=Oa,exports.StepperStyleType=Ea,exports.Sticky=Ba,exports.Switch=Ha,exports.TabHeader=Wa,exports.Textarea=Ga,exports.ThemeProvider=Ja,exports.Tilt=so,exports.TiltGroup=Qa,exports.TiltGroupContext=Xa,exports.TimeInput=Ao,exports.Timeline=Fo,exports.TimelineAlignment=Mo,exports.TimelineItemStatus=No,exports.ToastProvider=qn,exports.Tooltip=vt,exports.ValidatableComponent=as,Object.defineProperty(exports,"Validators",{enumerable:!0,get:function(){return b.Validators}}),exports.VirtualList=es,exports.Wizard=ns,exports.defaultTheme=Ka,exports.defaultTiltEasing=$a,exports.getLocale=Yt,Object.defineProperty(exports,"hasEightPasswordChars",{enumerable:!0,get:function(){return b.hasEightPasswordChars}}),Object.defineProperty(exports,"hasOnePasswordDigit",{enumerable:!0,get:function(){return b.hasOnePasswordDigit}}),Object.defineProperty(exports,"hasOnePasswordLetter",{enumerable:!0,get:function(){return b.hasOnePasswordLetter}}),Object.defineProperty(exports,"isBic",{enumerable:!0,get:function(){return b.isBic}}),Object.defineProperty(exports,"isDate",{enumerable:!0,get:function(){return b.isDate}}),Object.defineProperty(exports,"isEmail",{enumerable:!0,get:function(){return b.isEmail}}),Object.defineProperty(exports,"isISODate",{enumerable:!0,get:function(){return b.isISODate}}),Object.defineProperty(exports,"isNumber",{enumerable:!0,get:function(){return b.isNumber}}),Object.defineProperty(exports,"isPassword",{enumerable:!0,get:function(){return b.isPassword}}),Object.defineProperty(exports,"isURL",{enumerable:!0,get:function(){return b.isURL}}),exports.mapLocale=Kt,exports.setLocale=Jt,exports.showToast=Un,exports.useComponentDefaults=O,Object.defineProperty(exports,"useFormValidator",{enumerable:!0,get:function(){return b.useFormValidator}}),exports.useFormValidatorGroup=os,exports.useTheme=Ya,exports.useTiltGroup=Za;
13
13
  //# sourceMappingURL=index.cjs.map