@embedreach/components 0.2.16 → 0.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/chunks/index.js
CHANGED
|
@@ -54567,7 +54567,7 @@ function TanstackTable({
|
|
|
54567
54567
|
const TableSkeleton = () => /* @__PURE__ */ jsx("div", { className: "h-full w-full flex items-center justify-center", children: /* @__PURE__ */ jsx(BasicLoader, {}) });
|
|
54568
54568
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-full border rounded-lg shadow-sm hover:shadow-md transition-shadow duration-300 overflow-hidden", children: [
|
|
54569
54569
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-3 py-4 px-2 sticky top-0 z-20 bg-primary/5 border-b rounded-t-md md:flex-row md:items-center md:justify-between", children: [
|
|
54570
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
54570
|
+
/* @__PURE__ */ jsx("div", { className: "md:w-1/4", children: /* @__PURE__ */ jsx(
|
|
54571
54571
|
Input,
|
|
54572
54572
|
{
|
|
54573
54573
|
placeholder: "Search...",
|
package/dist/index.umd.js
CHANGED
|
@@ -72,7 +72,7 @@ function YZ(e,t){return"function"==typeof e?e(t):e}function XZ(e,t){return n=>{t
|
|
|
72
72
|
*
|
|
73
73
|
* @license MIT
|
|
74
74
|
*/
|
|
75
|
-
function IQ(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(n=e)||"function"==typeof n||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(n)?i.createElement(e,t):e:null;var n}function FQ(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function UQ(e,n=[]){let r=[];const o=()=>{const t=r.map((e=>i.createContext(e)));return function(n){const r=n?.[e]||t;return i.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return o.scopeName=e,[function(n,o){const a=i.createContext(o),s=r.length;r=[...r,o];const l=n=>{const{scope:r,children:o,...l}=n,c=r?.[e]?.[s]||a,u=i.useMemo((()=>l),Object.values(l));return t.jsx(c.Provider,{value:u,children:o})};return l.displayName=n+"Provider",[l,function(t,r){const l=i.useContext(r?.[e]?.[s]||a);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},$Q(o,...n)]}function $Q(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return i.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function VQ(e){const t=i.useRef(e);return i.useEffect((()=>{t.current=e})),i.useMemo((()=>(...e)=>t.current?.(...e)),[])}function BQ({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=i.useState(e),[r]=n,o=i.useRef(r),a=VQ(t);return i.useEffect((()=>{o.current!==r&&(a(r),o.current=r)}),[r,o,a]),n}({defaultProp:t,onChange:n}),a=void 0!==e,s=a?e:r,l=VQ(n);return[s,i.useCallback((t=>{if(a){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[a,e,o,l])]}var zQ=i.forwardRef(((e,n)=>{const{children:r,...o}=e,a=i.Children.toArray(r),s=a.find(GQ);if(s){const e=s.props.children,r=a.map((t=>t===s?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(HQ,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(HQ,{...o,ref:n,children:r})}));zQ.displayName="Slot";var HQ=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n);return i.cloneElement(n,{...KQ(r,n.props),ref:t?YU(t,e):e})}return i.Children.count(n)>1?i.Children.only(null):null}));HQ.displayName="SlotClone";var qQ=({children:e})=>t.jsx(t.Fragment,{children:e});function GQ(e){return i.isValidElement(e)&&e.type===qQ}function KQ(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}var WQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,a=o?zQ:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(a,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{});function YQ(e,t){e&&a.flushSync((()=>e.dispatchEvent(t)))}function XQ(e){const r=e+"CollectionProvider",[o,i]=UQ(r),[a,s]=o(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:r,children:o}=e,i=n.useRef(null),s=n.useRef(new Map).current;return t.jsx(a,{scope:r,itemMap:s,collectionRef:i,children:o})};l.displayName=r;const c=e+"CollectionSlot",u=n.forwardRef(((e,n)=>{const{scope:r,children:o}=e,i=XU(n,s(c,r).collectionRef);return t.jsx(zQ,{ref:i,children:o})}));u.displayName=c;const d=e+"CollectionItemSlot",p="data-radix-collection-item",f=n.forwardRef(((e,r)=>{const{scope:o,children:i,...a}=e,l=n.useRef(null),c=XU(r,l),u=s(d,o);return n.useEffect((()=>(u.itemMap.set(l,{ref:l,...a}),()=>{u.itemMap.delete(l)}))),t.jsx(zQ,{[p]:"",ref:c,children:i})}));return f.displayName=d,[{Provider:l,Slot:u,ItemSlot:f},function(t){const r=s(e+"CollectionConsumer",t);return n.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[r.collectionRef,r.itemMap])},i]}var ZQ=i.createContext(void 0);function QQ(e){const t=i.useContext(ZQ);return e||t||"ltr"}function JQ(e,t=globalThis?.document){const n=VQ(e);i.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}var eJ,tJ="dismissableLayer.update",nJ="dismissableLayer.pointerDownOutside",rJ="dismissableLayer.focusOutside",oJ=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),iJ=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(oJ),[p,f]=i.useState(null),h=p?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=XU(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=p?v.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,_=x>=b,S=function(e,t=globalThis?.document){const n=VQ(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){sJ(nJ,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));_&&!n&&(a?.(e),l?.(e),e.defaultPrevented||c?.())}),h),E=function(e,t=globalThis?.document){const n=VQ(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){sJ(rJ,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(s?.(e),l?.(e),e.defaultPrevented||c?.())}),h);return JQ((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),h),i.useEffect((()=>{if(p)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(eJ=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),aJ(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=eJ)}}),[p,h,r,d]),i.useEffect((()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),aJ())}),[p,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(tJ,e),()=>document.removeEventListener(tJ,e)}),[]),t.jsx(WQ.div,{...u,ref:g,style:{pointerEvents:w?_?"auto":"none":void 0,...e.style},onFocusCapture:FQ(e.onFocusCapture,E.onFocusCapture),onBlurCapture:FQ(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:FQ(e.onPointerDownCapture,S.onPointerDownCapture)})}));iJ.displayName="DismissableLayer";function aJ(){const e=new CustomEvent(tJ);document.dispatchEvent(e)}function sJ(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?YQ(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(oJ),o=i.useRef(null),a=XU(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(WQ.div,{...e,ref:a})})).displayName="DismissableLayerBranch";var lJ=0;function cJ(){i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??uJ()),document.body.insertAdjacentElement("beforeend",e[1]??uJ()),lJ++,()=>{1===lJ&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),lJ--}}),[])}function uJ(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var dJ="focusScope.autoFocusOnMount",pJ="focusScope.autoFocusOnUnmount",fJ={bubbles:!1,cancelable:!0},hJ=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...l}=e,[c,u]=i.useState(null),d=VQ(a),p=VQ(s),f=i.useRef(null),h=XU(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:yJ(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||yJ(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&yJ(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){bJ.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(dJ,fJ);c.addEventListener(dJ,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yJ(r,{select:t}),document.activeElement!==n)return}((e=mJ(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&yJ(c))}return()=>{c.removeEventListener(dJ,d),setTimeout((()=>{const e=new CustomEvent(pJ,fJ);c.addEventListener(pJ,p),c.dispatchEvent(e),e.defaultPrevented||yJ(t??document.body,{select:!0}),c.removeEventListener(pJ,p),bJ.remove(m)}),0)}}var e}),[c,d,p,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=mJ(e),n=gJ(t,e),r=gJ(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&yJ(i,{select:!0})):(e.preventDefault(),r&&yJ(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(WQ.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})}));function mJ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function gJ(e,t){for(const n of e)if(!vJ(n,{upTo:t}))return n}function vJ(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function yJ(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}hJ.displayName="FocusScope";var bJ=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=xJ(e,t),e.unshift(t)},remove(t){e=xJ(e,t),e[0]?.resume()}}}();function xJ(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var wJ=Boolean(globalThis?.document)?i.useLayoutEffect:()=>{},_J=i["useId".toString()]||(()=>{}),SJ=0;function EJ(e){const[t,n]=i.useState(_J());return wJ((()=>{n((e=>e??String(SJ++)))}),[e]),t?`radix-${t}`:""}const TJ=["top","right","bottom","left"],CJ=Math.min,AJ=Math.max,NJ=Math.round,RJ=Math.floor,OJ=e=>({x:e,y:e}),PJ={left:"right",right:"left",bottom:"top",top:"bottom"},kJ={start:"end",end:"start"};function MJ(e,t,n){return AJ(e,CJ(t,n))}function jJ(e,t){return"function"==typeof e?e(t):e}function LJ(e){return e.split("-")[0]}function DJ(e){return e.split("-")[1]}function IJ(e){return"x"===e?"y":"x"}function FJ(e){return"y"===e?"height":"width"}function UJ(e){return["top","bottom"].includes(LJ(e))?"y":"x"}function $J(e){return IJ(UJ(e))}function VJ(e){return e.replace(/start|end/g,(e=>kJ[e]))}function BJ(e){return e.replace(/left|right|bottom|top/g,(e=>PJ[e]))}function zJ(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function HJ(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function qJ(e,t,n){let{reference:r,floating:o}=e;const i=UJ(t),a=$J(t),s=FJ(a),l=LJ(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(DJ(t)){case"start":f[a]-=p*(n&&c?-1:1);break;case"end":f[a]+=p*(n&&c?-1:1)}return f}async function GJ(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=jJ(t,e),h=zJ(f),m=s[p?"floating"===d?"reference":"floating":d],g=HJ(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=HJ(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.x}}function KJ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function WJ(e){return TJ.some((t=>e[t]>=0))}function YJ(){return"undefined"!=typeof window}function XJ(e){return JJ(e)?(e.nodeName||"").toLowerCase():"#document"}function ZJ(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function QJ(e){var t;return null==(t=(JJ(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function JJ(e){return!!YJ()&&(e instanceof Node||e instanceof ZJ(e).Node)}function e0(e){return!!YJ()&&(e instanceof Element||e instanceof ZJ(e).Element)}function t0(e){return!!YJ()&&(e instanceof HTMLElement||e instanceof ZJ(e).HTMLElement)}function n0(e){return!(!YJ()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ZJ(e).ShadowRoot)}function r0(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=c0(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function o0(e){return["table","td","th"].includes(XJ(e))}function i0(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(JSe){return!1}}))}function a0(e){const t=s0(),n=e0(e)?c0(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function s0(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function l0(e){return["html","body","#document"].includes(XJ(e))}function c0(e){return ZJ(e).getComputedStyle(e)}function u0(e){return e0(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function d0(e){if("html"===XJ(e))return e;const t=e.assignedSlot||e.parentNode||n0(e)&&e.host||QJ(e);return n0(t)?t.host:t}function p0(e){const t=d0(e);return l0(t)?e.ownerDocument?e.ownerDocument.body:e.body:t0(t)&&r0(t)?t:p0(t)}function f0(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=p0(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=ZJ(o);if(i){const e=h0(a);return t.concat(a,a.visualViewport||[],r0(o)?o:[],e&&n?f0(e):[])}return t.concat(o,f0(o,[],n))}function h0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function m0(e){const t=c0(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=t0(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=NJ(n)!==i||NJ(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function g0(e){return e0(e)?e:e.contextElement}function v0(e){const t=g0(e);if(!t0(t))return OJ(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=m0(t);let a=(i?NJ(n.width):n.width)/r,s=(i?NJ(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const y0=OJ(0);function b0(e){const t=ZJ(e);return s0()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:y0}function x0(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=g0(e);let a=OJ(1);t&&(r?e0(r)&&(a=v0(r)):a=v0(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ZJ(e))&&t}(i,n,r)?b0(i):OJ(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=ZJ(i),t=r&&e0(r)?ZJ(r):r;let n=e,o=h0(n);for(;o&&r&&t!==n;){const e=v0(o),t=o.getBoundingClientRect(),r=c0(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=ZJ(o),o=h0(n)}}return HJ({width:u,height:d,x:l,y:c})}function w0(e,t){const n=u0(e).scrollLeft;return t?t.left+n:x0(QJ(e)).left+n}function _0(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:w0(e,r)),y:r.top+t.scrollTop}}function S0(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ZJ(e),r=QJ(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=s0();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=QJ(e),n=u0(e),r=e.ownerDocument.body,o=AJ(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=AJ(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+w0(e);const s=-n.scrollTop;return"rtl"===c0(r).direction&&(a+=AJ(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(QJ(e));else if(e0(t))r=function(e,t){const n=x0(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=t0(e)?v0(e):OJ(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=b0(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return HJ(r)}function E0(e,t){const n=d0(e);return!(n===t||!e0(n)||l0(n))&&("fixed"===c0(n).position||E0(n,t))}function T0(e,t,n){const r=t0(t),o=QJ(t),i="fixed"===n,a=x0(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=OJ(0);if(r||!r&&!i)if(("body"!==XJ(t)||r0(o))&&(s=u0(t)),r){const e=x0(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=w0(o));const c=!o||r||i?OJ(0):_0(o,s);return{x:a.left+s.scrollLeft-l.x-c.x,y:a.top+s.scrollTop-l.y-c.y,width:a.width,height:a.height}}function C0(e){return"static"===c0(e).position}function A0(e,t){if(!t0(e)||"fixed"===c0(e).position)return null;if(t)return t(e);let n=e.offsetParent;return QJ(e)===n&&(n=n.ownerDocument.body),n}function N0(e,t){const n=ZJ(e);if(i0(e))return n;if(!t0(e)){let t=d0(e);for(;t&&!l0(t);){if(e0(t)&&!C0(t))return t;t=d0(t)}return n}let r=A0(e,t);for(;r&&o0(r)&&C0(r);)r=A0(r,t);return r&&l0(r)&&C0(r)&&!a0(r)?n:r||function(e){let t=d0(e);for(;t0(t)&&!l0(t);){if(a0(t))return t;if(i0(t))return null;t=d0(t)}return null}(e)||n}const R0={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=QJ(r),s=!!t&&i0(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=OJ(1);const u=OJ(0),d=t0(r);if((d||!d&&!i)&&(("body"!==XJ(r)||r0(a))&&(l=u0(r)),t0(r))){const e=x0(r);c=v0(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?OJ(0):_0(a,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:QJ,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?i0(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=f0(e,[],!1).filter((e=>e0(e)&&"body"!==XJ(e))),o=null;const i="fixed"===c0(e).position;let a=i?d0(e):e;for(;e0(a)&&!l0(a);){const t=c0(a),n=a0(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||r0(a)&&!n&&E0(e,a))?r=r.filter((e=>e!==a)):o=t,a=d0(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i.reduce(((e,n)=>{const r=S0(t,n,o);return e.top=AJ(r.top,e.top),e.right=CJ(r.right,e.right),e.bottom=CJ(r.bottom,e.bottom),e.left=AJ(r.left,e.left),e}),S0(t,i[0],o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:N0,getElementRects:async function(e){const t=this.getOffsetParent||N0,n=this.getDimensions,r=await n(e.floating);return{reference:T0(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=m0(e);return{width:t,height:n}},getScale:v0,isElement:e0,isRTL:function(e){return"rtl"===c0(e).direction}};function O0(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=g0(e),u=o||i?[...c?f0(c):[],...f0(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const o=QJ(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const f={rootMargin:-RJ(u)+"px "+-RJ(o.clientWidth-(c+d))+"px "+-RJ(o.clientHeight-(u+p))+"px "+-RJ(c)+"px",threshold:AJ(0,CJ(1,l))||1};let h=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(JSe){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let m=l?x0(e):null;return l&&function t(){const r=x0(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const P0=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=LJ(n),s=DJ(n),l="y"===UJ(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=jJ(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},k0=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=jJ(e,t),c={x:n,y:r},u=await GJ(t,l),d=UJ(LJ(o)),p=IJ(d);let f=c[p],h=c[d];if(i){f=MJ(f+u["y"===p?"top":"left"],f,f-u["y"===p?"bottom":"right"])}if(a){h=MJ(h+u["y"===d?"top":"left"],h,h-u["y"===d?"bottom":"right"])}const m=s.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[d]:a}}}}}},M0=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=jJ(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=LJ(o),y=UJ(s),b=LJ(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(b||!m?[BJ(s)]:function(e){const t=BJ(e);return[VJ(e),t,VJ(t)]}(s)),_="none"!==h;!p&&_&&w.push(...function(e,t,n,r){const o=DJ(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(LJ(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(VJ)))),i}(s,m,h,x));const S=[s,...w],E=await GJ(t,g),T=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&T.push(E[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=DJ(e),o=$J(e),i=FJ(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=BJ(a)),[a,BJ(a)]}(o,a,x);T.push(E[e[0]],E[e[1]])}if(C=[...C,{placement:o,overflows:T}],!T.every((e=>e<=0))){var A,N;const e=((null==(A=i.flip)?void 0:A.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(N=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:N.placement;if(!n)switch(f){case"bestFit":{var R;const e=null==(R=C.filter((e=>{if(_){const t=UJ(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:R[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},j0=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=jJ(e,t),u=await GJ(t,c),d=LJ(o),p=DJ(o),f="y"===UJ(o),{width:h,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,g="end"===p?"top":"bottom");const y=m-u.top-u.bottom,b=h-u.left-u.right;let x=CJ(m-u[g],y),w=CJ(h-u[v],b);if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(w=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=y),!t.middlewareData.shift&&!p){const e=AJ(u.left,0),t=AJ(u.right,0),n=AJ(u.top,0),r=AJ(u.bottom,0);f?w=h-2*(0!==e||0!==t?e+t:AJ(u.left,u.right)):x=m-2*(0!==n||0!==r?n+r:AJ(u.top,u.bottom))}await l({...t,availableWidth:w,availableHeight:x});const _=await a.getDimensions(s.floating);return h!==_.width||m!==_.height?{reset:{rects:!0}}:{}}}},L0=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=jJ(e,t);switch(r){case"referenceHidden":{const e=KJ(await GJ(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:WJ(e)}}}case"escaped":{const e=KJ(await GJ(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:WJ(e)}}}default:return{}}}}},D0=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=jJ(e,t)||{};if(null==c)return{};const d=zJ(u),p={x:n,y:r},f=$J(o),h=FJ(f),m=await a.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[f]-p[f]-i.floating[h],w=p[f]-i.reference[f],_=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let S=_?_[b]:0;S&&await(null==a.isElement?void 0:a.isElement(_))||(S=s.floating[b]||i.floating[h]);const E=x/2-w/2,T=S/2-m[h]/2-1,C=CJ(d[v],T),A=CJ(d[y],T),N=C,R=S-m[h]-A,O=S/2-m[h]/2+E,P=MJ(N,O,R),k=!l.arrow&&null!=DJ(o)&&O!==P&&i.reference[h]/2-(O<N?C:A)-m[h]/2<0,M=k?O<N?O-N:O-R:0;return{[f]:p[f]+M,data:{[f]:P,centerOffset:O-P-M,...k&&{alignmentOffset:M}},reset:k}}}),I0=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=jJ(e,t),u={x:n,y:r},d=UJ(o),p=IJ(d);let f=u[p],h=u[d];const m=jJ(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,n=i.reference[p]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var v,y;const e="y"===p?"width":"height",t=["top","left"].includes(LJ(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},F0=(e,t,n)=>{const r={platform:R0,...n},o={...r.platform,_c:new Map};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=qJ(c,r,l),p=r,f={},h=0;for(let m=0;m<s.length;m++){const{name:n,fn:i}=s[m],{x:g,y:v,data:y,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,f={...f,[n]:{...f[n],...y}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=qJ(c,p,l))),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})};var U0="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function $0(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!$0(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!$0(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function V0(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function B0(e,t){const n=V0(e);return Math.round(t*n)/n}function z0(e){const t=i.useRef(e);return U0((()=>{t.current=e})),t}function H0(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[p,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=i.useState(r);$0(h,r)||m(r);const[g,v]=i.useState(null),[y,b]=i.useState(null),x=i.useCallback((e=>{e!==E.current&&(E.current=e,v(e))}),[]),w=i.useCallback((e=>{e!==T.current&&(T.current=e,b(e))}),[]),_=s||g,S=l||y,E=i.useRef(null),T=i.useRef(null),C=i.useRef(p),A=null!=u,N=z0(u),R=z0(o),O=z0(d),P=i.useCallback((()=>{if(!E.current||!T.current)return;const e={placement:t,strategy:n,middleware:h};R.current&&(e.platform=R.current),F0(E.current,T.current,e).then((e=>{const t={...e,isPositioned:!1!==O.current};k.current&&!$0(C.current,t)&&(C.current=t,a.flushSync((()=>{f(t)})))}))}),[h,t,n,R,O]);U0((()=>{!1===d&&C.current.isPositioned&&(C.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const k=i.useRef(!1);U0((()=>(k.current=!0,()=>{k.current=!1})),[]),U0((()=>{if(_&&(E.current=_),S&&(T.current=S),_&&S){if(N.current)return N.current(_,S,P);P()}}),[_,S,P,N,A]);const M=i.useMemo((()=>({reference:E,floating:T,setReference:x,setFloating:w})),[x,w]),j=i.useMemo((()=>({reference:_,floating:S})),[_,S]),L=i.useMemo((()=>{const e={position:n,left:0,top:0};if(!j.floating)return e;const t=B0(j.floating,p.x),r=B0(j.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...V0(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,j.floating,p.x,p.y]);return i.useMemo((()=>({...p,update:P,refs:M,elements:j,floatingStyles:L})),[p,P,M,j,L])}const q0=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&{}.hasOwnProperty.call(n,"current")?null!=n.current?D0({element:n.current,padding:r}).fn(t):{}:n?D0({element:n,padding:r}).fn(t):{}}}),G0=(e,t)=>({...P0(e),options:[e,t]}),K0=(e,t)=>({...k0(e),options:[e,t]}),W0=(e,t)=>({...I0(e),options:[e,t]}),Y0=(e,t)=>({...M0(e),options:[e,t]}),X0=(e,t)=>({...j0(e),options:[e,t]}),Z0=(e,t)=>({...L0(e),options:[e,t]}),Q0=(e,t)=>({...q0(e),options:[e,t]});var J0=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...a}=e;return t.jsx(WQ.svg,{...a,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:t.jsx("polygon",{points:"0,0 30,0 15,10"})})}));J0.displayName="Arrow";var e1=J0;function t1(e){const[t,n]=i.useState(void 0);return wJ((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}var n1="Popper",[r1,o1]=UQ(n1),[i1,a1]=r1(n1),s1=e=>{const{__scopePopper:n,children:r}=e,[o,a]=i.useState(null);return t.jsx(i1,{scope:n,anchor:o,onAnchorChange:a,children:r})};s1.displayName=n1;var l1="PopperAnchor",c1=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...a}=e,s=a1(l1,r),l=i.useRef(null),c=XU(n,l);return i.useEffect((()=>{s.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(WQ.div,{...a,ref:c})}));c1.displayName=l1;var u1="PopperContent",[d1,p1]=r1(u1),f1=i.forwardRef(((e,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:g,...v}=e,y=a1(u1,r),[b,x]=i.useState(null),w=XU(n,(e=>x(e))),[_,S]=i.useState(null),E=t1(_),T=E?.width??0,C=E?.height??0,A=o+("center"!==s?"-"+s:""),N="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},R=Array.isArray(d)?d:[d],O=R.length>0,P={padding:N,boundary:R.filter(v1),altBoundary:O},{refs:k,floatingStyles:M,placement:j,isPositioned:L,middlewareData:D}=H0({strategy:"fixed",placement:A,whileElementsMounted:(...e)=>O0(...e,{animationFrame:"always"===m}),elements:{reference:y.anchor},middleware:[G0({mainAxis:a+C,alignmentAxis:l}),u&&K0({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?W0():void 0,...P}),u&&Y0({...P}),X0({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),_&&Q0({element:_,padding:c}),y1({arrowWidth:T,arrowHeight:C}),h&&Z0({strategy:"referenceHidden",...P})]}),[I,F]=b1(j),U=VQ(g);wJ((()=>{L&&U?.()}),[L,U]);const $=D.arrow?.x,V=D.arrow?.y,B=0!==D.arrow?.centerOffset,[z,H]=i.useState();return wJ((()=>{b&&H(window.getComputedStyle(b).zIndex)}),[b]),t.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:L?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:z,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(d1,{scope:r,placedSide:I,onArrowChange:S,arrowX:$,arrowY:V,shouldHideArrow:B,children:t.jsx(WQ.div,{"data-side":I,"data-align":F,...v,ref:w,style:{...v.style,animation:L?void 0:"none"}})})})}));f1.displayName=u1;var h1="PopperArrow",m1={top:"bottom",right:"left",bottom:"top",left:"right"},g1=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=p1(h1,r),a=m1[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(e1,{...o,ref:n,style:{...o.style,display:"block"}})})}));function v1(e){return null!==e}g1.displayName=h1;var y1=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[l,c]=b1(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+s/2;let f="",h="";return"bottom"===l?(f=i?u:`${d}px`,h=-s+"px"):"top"===l?(f=i?u:`${d}px`,h=`${r.floating.height+s}px`):"right"===l?(f=-s+"px",h=i?u:`${p}px`):"left"===l&&(f=`${r.floating.width+s}px`,h=i?u:`${p}px`),{data:{x:f,y:h}}}});function b1(e){const[t,n="center"]=e.split("-");return[t,n]}var x1=s1,w1=c1,_1=f1,S1=g1,E1=i.forwardRef(((e,n)=>{const{container:o,...a}=e,[s,l]=i.useState(!1);wJ((()=>l(!0)),[]);const c=o||s&&globalThis?.document?.body;return c?r.createPortal(t.jsx(WQ.div,{...a,ref:n}),c):null}));E1.displayName="Portal";var T1=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=i.useState(),r=i.useRef({}),o=i.useRef(e),a=i.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return i.useReducer(((e,n)=>t[e][n]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect((()=>{const e=C1(r.current);a.current="mounted"===l?e:"none"}),[l]),wJ((()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,i=C1(t);if(e)c("MOUNT");else if("none"===i||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),wJ((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=i=>{const a=C1(r.current).includes(i.animationName);if(i.target===t&&a&&(c("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},s=e=>{e.target===t&&(a.current=C1(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):i.Children.only(n),a=XU(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?i.cloneElement(o,{ref:a}):null};function C1(e){return e?.animationName||"none"}T1.displayName="Presence";var A1="rovingFocusGroup.onEntryFocus",N1={bubbles:!1,cancelable:!0},R1="RovingFocusGroup",[O1,P1,k1]=XQ(R1),[M1,j1]=UQ(R1,[k1]),[L1,D1]=M1(R1),I1=i.forwardRef(((e,n)=>t.jsx(O1.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(O1.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(F1,{...e,ref:n})})})));I1.displayName=R1;var F1=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:a=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...f}=e,h=i.useRef(null),m=XU(n,h),g=QQ(s),[v=null,y]=BQ({prop:l,defaultProp:c,onChange:u}),[b,x]=i.useState(!1),w=VQ(d),_=P1(r),S=i.useRef(!1),[E,T]=i.useState(0);return i.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(A1,w),()=>e.removeEventListener(A1,w)}),[w]),t.jsx(L1,{scope:r,orientation:o,dir:g,loop:a,currentTabStopId:v,onItemFocus:i.useCallback((e=>y(e)),[y]),onItemShiftTab:i.useCallback((()=>x(!0)),[]),onFocusableItemAdd:i.useCallback((()=>T((e=>e+1))),[]),onFocusableItemRemove:i.useCallback((()=>T((e=>e-1))),[]),children:t.jsx(WQ.div,{tabIndex:b||0===E?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:FQ(e.onMouseDown,(()=>{S.current=!0})),onFocus:FQ(e.onFocus,(e=>{if(e.target===e.currentTarget&&!S.current&&!b){const t=new CustomEvent(A1,N1);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=_().filter((e=>e.focusable));B1([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),p)}}S.current=!1})),onBlur:FQ(e.onBlur,(()=>x(!1)))})})})),U1="RovingFocusGroupItem",$1=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:a=!1,tabStopId:s,...l}=e,c=EJ(),u=s||c,d=D1(U1,r),p=d.currentTabStopId===u,f=P1(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=d;return i.useEffect((()=>{if(o)return h(),()=>m()}),[o,h,m]),t.jsx(O1.ItemSlot,{scope:r,id:u,focusable:o,active:a,children:t.jsx(WQ.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:FQ(e.onMouseDown,(e=>{o?d.onItemFocus(u):e.preventDefault()})),onFocus:FQ(e.onFocus,(()=>d.onItemFocus(u))),onKeyDown:FQ(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:V1[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=d.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>B1(o)))}var n,r}))})})}));$1.displayName=U1;var V1={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function B1(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var z1=I1,H1=$1,q1=["Enter"," "],G1=["ArrowUp","PageDown","End"],K1=["ArrowDown","PageUp","Home",...G1],W1={ltr:[...q1,"ArrowRight"],rtl:[...q1,"ArrowLeft"]},Y1={ltr:["ArrowLeft"],rtl:["ArrowRight"]},X1="Menu",[Z1,Q1,J1]=XQ(X1),[e2,t2]=UQ(X1,[J1,o1,j1]),n2=o1(),r2=j1(),[o2,i2]=e2(X1),[a2,s2]=e2(X1),l2=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:a,onOpenChange:s,modal:l=!0}=e,c=n2(n),[u,d]=i.useState(null),p=i.useRef(!1),f=VQ(s),h=QQ(a);return i.useEffect((()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),t.jsx(x1,{...c,children:t.jsx(o2,{scope:n,open:r,onOpenChange:f,content:u,onContentChange:d,children:t.jsx(a2,{scope:n,onClose:i.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:p,dir:h,modal:l,children:o})})})};l2.displayName=X1;var c2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=n2(r);return t.jsx(w1,{...i,...o,ref:n})}));c2.displayName="MenuAnchor";var u2="MenuPortal",[d2,p2]=e2(u2,{forceMount:void 0}),f2=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,a=i2(u2,n);return t.jsx(d2,{scope:n,forceMount:r,children:t.jsx(T1,{present:r||a.open,children:t.jsx(E1,{asChild:!0,container:i,children:o})})})};f2.displayName=u2;var h2="MenuContent",[m2,g2]=e2(h2),v2=i.forwardRef(((e,n)=>{const r=p2(h2,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,a=i2(h2,e.__scopeMenu),s=s2(h2,e.__scopeMenu);return t.jsx(Z1.Provider,{scope:e.__scopeMenu,children:t.jsx(T1,{present:o||a.open,children:t.jsx(Z1.Slot,{scope:e.__scopeMenu,children:t.jsx(s.modal?y2:b2,{...i,ref:n})})})})})),y2=i.forwardRef(((e,n)=>{const r=i2(h2,e.__scopeMenu),o=i.useRef(null),a=XU(n,o);return i.useEffect((()=>{const e=o.current;if(e)return LV(e)}),[]),t.jsx(x2,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:FQ(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),b2=i.forwardRef(((e,n)=>{const r=i2(h2,e.__scopeMenu);return t.jsx(x2,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),x2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:g,...v}=e,y=i2(h2,r),b=s2(h2,r),x=n2(r),w=r2(r),_=Q1(r),[S,E]=i.useState(null),T=i.useRef(null),C=XU(n,T,y.onContentChange),A=i.useRef(0),N=i.useRef(""),R=i.useRef(0),O=i.useRef(null),P=i.useRef("right"),k=i.useRef(0),M=g?NV:i.Fragment,j=g?{as:zQ,allowPinchZoom:!0}:void 0,L=e=>{const t=N.current+e,n=_().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,l=Math.max(i,0),s.map(((e,t)=>s[(l+t)%s.length])));var s,l;1===o.length&&(a=a.filter((e=>e!==n)));const c=a.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(n.map((e=>e.textValue)),t,o),a=n.find((e=>e.textValue===i))?.ref.current;!function e(t){N.current=t,window.clearTimeout(A.current),""!==t&&(A.current=window.setTimeout((()=>e("")),1e3))}(t),a&&setTimeout((()=>a.focus()))};i.useEffect((()=>()=>window.clearTimeout(A.current)),[]),cJ();const D=i.useCallback((e=>P.current===O.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const e=t[i].x,s=t[i].y,l=t[a].y;s>r!=l>r&&n<(t[a].x-e)*(r-s)/(l-s)+e&&(o=!o)}return o}(n,t)}(e,O.current?.area)),[]);return t.jsx(m2,{scope:r,searchRef:N,onItemEnter:i.useCallback((e=>{D(e)&&e.preventDefault()}),[D]),onItemLeave:i.useCallback((e=>{D(e)||(T.current?.focus(),E(null))}),[D]),onTriggerLeave:i.useCallback((e=>{D(e)&&e.preventDefault()}),[D]),pointerGraceTimerRef:R,onPointerGraceIntentChange:i.useCallback((e=>{O.current=e}),[]),children:t.jsx(M,{...j,children:t.jsx(hJ,{asChild:!0,trapped:a,onMountAutoFocus:FQ(s,(e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:t.jsx(iJ,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:t.jsx(z1,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:FQ(u,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:t.jsx(_1,{role:"menu","aria-orientation":"vertical","data-state":G2(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:C,style:{outline:"none",...v.style},onKeyDown:FQ(v.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&L(e.key));if(e.target!==T.current)return;if(!K1.includes(e.key))return;e.preventDefault();const o=_().filter((e=>!e.disabled)).map((e=>e.ref.current));G1.includes(e.key)&&o.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(o)})),onBlur:FQ(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(A.current),N.current="")})),onPointerMove:FQ(e.onPointerMove,Y2((e=>{const t=k.current!==e.clientX;if(e.currentTarget.contains(e.target)&&t){P.current=e.clientX>k.current?"right":"left",k.current=e.clientX}})))})})})})})})}));v2.displayName=h2;var w2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(WQ.div,{role:"group",...o,ref:n})}));w2.displayName="MenuGroup";var _2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(WQ.div,{...o,ref:n})}));_2.displayName="MenuLabel";var S2="MenuItem",E2="menu.itemSelect",T2=i.forwardRef(((e,n)=>{const{disabled:r=!1,onSelect:o,...a}=e,s=i.useRef(null),l=s2(S2,e.__scopeMenu),c=g2(S2,e.__scopeMenu),u=XU(n,s),d=i.useRef(!1);return t.jsx(C2,{...a,ref:u,disabled:r,onClick:FQ(e.onClick,(()=>{const e=s.current;if(!r&&e){const t=new CustomEvent(E2,{bubbles:!0,cancelable:!0});e.addEventListener(E2,(e=>o?.(e)),{once:!0}),YQ(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:FQ(e.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:FQ(e.onKeyDown,(e=>{r||""!==c.searchRef.current&&" "===e.key||q1.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));T2.displayName=S2;var C2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:a,...s}=e,l=g2(S2,r),c=r2(r),u=i.useRef(null),d=XU(n,u),[p,f]=i.useState(!1),[h,m]=i.useState("");return i.useEffect((()=>{const e=u.current;e&&m((e.textContent??"").trim())}),[s.children]),t.jsx(Z1.ItemSlot,{scope:r,disabled:o,textValue:a??h,children:t.jsx(H1,{asChild:!0,...c,focusable:!o,children:t.jsx(WQ.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:d,onPointerMove:FQ(e.onPointerMove,Y2((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:FQ(e.onPointerLeave,Y2((e=>l.onItemLeave(e)))),onFocus:FQ(e.onFocus,(()=>f(!0))),onBlur:FQ(e.onBlur,(()=>f(!1)))})})})})),A2=i.forwardRef(((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(L2,{scope:e.__scopeMenu,checked:r,children:t.jsx(T2,{role:"menuitemcheckbox","aria-checked":K2(r)?"mixed":r,...i,ref:n,"data-state":W2(r),onSelect:FQ(i.onSelect,(()=>o?.(!!K2(r)||!r)),{checkForDefaultPrevented:!1})})})}));A2.displayName="MenuCheckboxItem";var N2="MenuRadioGroup",[R2,O2]=e2(N2,{value:void 0,onValueChange:()=>{}}),P2=i.forwardRef(((e,n)=>{const{value:r,onValueChange:o,...i}=e,a=VQ(o);return t.jsx(R2,{scope:e.__scopeMenu,value:r,onValueChange:a,children:t.jsx(w2,{...i,ref:n})})}));P2.displayName=N2;var k2="MenuRadioItem",M2=i.forwardRef(((e,n)=>{const{value:r,...o}=e,i=O2(k2,e.__scopeMenu),a=r===i.value;return t.jsx(L2,{scope:e.__scopeMenu,checked:a,children:t.jsx(T2,{role:"menuitemradio","aria-checked":a,...o,ref:n,"data-state":W2(a),onSelect:FQ(o.onSelect,(()=>i.onValueChange?.(r)),{checkForDefaultPrevented:!1})})})}));M2.displayName=k2;var j2="MenuItemIndicator",[L2,D2]=e2(j2,{checked:!1}),I2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,a=D2(j2,r);return t.jsx(T1,{present:o||K2(a.checked)||!0===a.checked,children:t.jsx(WQ.span,{...i,ref:n,"data-state":W2(a.checked)})})}));I2.displayName=j2;var F2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(WQ.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})}));F2.displayName="MenuSeparator";var U2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=n2(r);return t.jsx(S1,{...i,...o,ref:n})}));U2.displayName="MenuArrow";var[$2,V2]=e2("MenuSub"),B2="MenuSubTrigger",z2=i.forwardRef(((e,n)=>{const r=i2(B2,e.__scopeMenu),o=s2(B2,e.__scopeMenu),a=V2(B2,e.__scopeMenu),s=g2(B2,e.__scopeMenu),l=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},p=i.useCallback((()=>{l.current&&window.clearTimeout(l.current),l.current=null}),[]);return i.useEffect((()=>p),[p]),i.useEffect((()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}}),[c,u]),t.jsx(c2,{asChild:!0,...d,children:t.jsx(C2,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":G2(r.open),...e,ref:YU(n,a.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:FQ(e.onPointerMove,Y2((t=>{s.onItemEnter(t),t.defaultPrevented||e.disabled||r.open||l.current||(s.onPointerGraceIntentChange(null),l.current=window.setTimeout((()=>{r.onOpenChange(!0),p()}),100))}))),onPointerLeave:FQ(e.onPointerLeave,Y2((e=>{p();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,i=t[o?"left":"right"],a=t[o?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+(o?-5:5),y:e.clientY},{x:i,y:t.top},{x:a,y:t.top},{x:a,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout((()=>s.onPointerGraceIntentChange(null)),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}}))),onKeyDown:FQ(e.onKeyDown,(t=>{e.disabled||""!==s.searchRef.current&&" "===t.key||W1[o.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())}))})})}));z2.displayName=B2;var H2="MenuSubContent",q2=i.forwardRef(((e,n)=>{const r=p2(h2,e.__scopeMenu),{forceMount:o=r.forceMount,...a}=e,s=i2(h2,e.__scopeMenu),l=s2(h2,e.__scopeMenu),c=V2(H2,e.__scopeMenu),u=i.useRef(null),d=XU(n,u);return t.jsx(Z1.Provider,{scope:e.__scopeMenu,children:t.jsx(T1,{present:o||s.open,children:t.jsx(Z1.Slot,{scope:e.__scopeMenu,children:t.jsx(x2,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:FQ(e.onFocusOutside,(e=>{e.target!==c.trigger&&s.onOpenChange(!1)})),onEscapeKeyDown:FQ(e.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:FQ(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=Y1[l.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())}))})})})})}));function G2(e){return e?"open":"closed"}function K2(e){return"indeterminate"===e}function W2(e){return K2(e)?"indeterminate":e?"checked":"unchecked"}function Y2(e){return t=>"mouse"===t.pointerType?e(t):void 0}q2.displayName=H2;var X2=l2,Z2=c2,Q2=f2,J2=v2,e3=w2,t3=_2,n3=T2,r3=A2,o3=P2,i3=M2,a3=I2,s3=F2,l3=U2,c3=z2,u3=q2,d3="DropdownMenu",[p3,f3]=UQ(d3,[t2]),h3=t2(),[m3,g3]=p3(d3),v3=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:a,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,u=h3(n),d=i.useRef(null),[p=!1,f]=BQ({prop:a,defaultProp:s,onChange:l});return t.jsx(m3,{scope:n,triggerId:EJ(),triggerRef:d,contentId:EJ(),open:p,onOpenChange:f,onOpenToggle:i.useCallback((()=>f((e=>!e))),[f]),modal:c,children:t.jsx(X2,{...u,open:p,onOpenChange:f,dir:o,modal:c,children:r})})};v3.displayName=d3;var y3="DropdownMenuTrigger",b3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,a=g3(y3,r),s=h3(r);return t.jsx(Z2,{asChild:!0,...s,children:t.jsx(WQ.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:YU(n,a.triggerRef),onPointerDown:FQ(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(a.onOpenToggle(),a.open||e.preventDefault())})),onKeyDown:FQ(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));b3.displayName=y3;var x3=e=>{const{__scopeDropdownMenu:n,...r}=e,o=h3(n);return t.jsx(Q2,{...o,...r})};x3.displayName="DropdownMenuPortal";var w3="DropdownMenuContent",_3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,a=g3(w3,r),s=h3(r),l=i.useRef(!1);return t.jsx(J2,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...o,ref:n,onCloseAutoFocus:FQ(e.onCloseAutoFocus,(e=>{l.current||a.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:FQ(e.onInteractOutside,(e=>{const t=e.detail.originalEvent;a.modal&&!(2===t.button||0===t.button&&!0===t.ctrlKey)||(l.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));_3.displayName=w3;i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(e3,{...i,...o,ref:n})})).displayName="DropdownMenuGroup";var S3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(t3,{...i,...o,ref:n})}));S3.displayName="DropdownMenuLabel";var E3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(n3,{...i,...o,ref:n})}));E3.displayName="DropdownMenuItem";var T3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(r3,{...i,...o,ref:n})}));T3.displayName="DropdownMenuCheckboxItem";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(o3,{...i,...o,ref:n})})).displayName="DropdownMenuRadioGroup";var C3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(i3,{...i,...o,ref:n})}));C3.displayName="DropdownMenuRadioItem";var A3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(a3,{...i,...o,ref:n})}));A3.displayName="DropdownMenuItemIndicator";var N3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(s3,{...i,...o,ref:n})}));N3.displayName="DropdownMenuSeparator";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(l3,{...i,...o,ref:n})})).displayName="DropdownMenuArrow";var R3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(c3,{...i,...o,ref:n})}));R3.displayName="DropdownMenuSubTrigger";var O3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(u3,{...i,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));O3.displayName="DropdownMenuSubContent";var P3=x3,k3=_3,M3=S3,j3=E3,L3=T3,D3=C3,I3=A3,F3=N3,U3=R3,$3=O3;const V3=v3,B3=b3;i.forwardRef((({className:e,inset:n,children:r,...o},i)=>t.jsxs(U3,{ref:i,className:Zd("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[r,t.jsx(mu,{className:"ml-auto"})]}))).displayName=U3.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx($3,{ref:r,className:Zd("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}))).displayName=$3.displayName;const z3=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(P3,{children:t.jsx(k3,{ref:o,sideOffset:n,className:Zd("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})));z3.displayName=k3.displayName;const H3=i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(j3,{ref:o,className:Zd("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r})));H3.displayName=j3.displayName;i.forwardRef((({className:e,children:n,checked:r,...o},i)=>t.jsxs(L3,{ref:i,className:Zd("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(I3,{children:t.jsx(pu,{className:"h-4 w-4"})})}),n]}))).displayName=L3.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(D3,{ref:o,className:Zd("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(I3,{children:t.jsx(wu,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=D3.displayName;i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(M3,{ref:o,className:Zd("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}))).displayName=M3.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(F3,{ref:r,className:Zd("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=F3.displayName;const q3=i.forwardRef((({className:e,type:n,...r},o)=>t.jsx("input",{type:n,className:Zd("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...r})));function G3({data:e,columns:t,enableDebug:r=!1,paginationMode:o="none",initialPageSize:a=10,initialPageIndex:s=0,cursorPaginationQueryResult:l,onQueryParametersChange:c,manualPageCount:u}){const d=n.useMemo((()=>e),[e]),p=n.useMemo((()=>t),[t]),f="cursor"===o,h=l,[m,g]=n.useState(s),[v,y]=n.useState([void 0]),[b,x]=n.useState(a);n.useEffect((()=>{if(f&&h){const{isLoading:e,isFetching:t,isPlaceholderData:n,nextCursor:r}=h;e||t||n||!r||""===r?e||t||n||r&&""!==r||!(v.length>m+1)||y((e=>e.slice(0,m+1))):v.length===m+1&&y((e=>[...e,r]))}}),[f,h,m,v]);const w=n.useCallback((()=>{f&&(g(s),y([void 0]),x(a),c&&c({cursor:void 0,pageSize:a}))}),[f,c,a,s]),[_,S]=n.useState({pageIndex:f?m:s,pageSize:b});n.useEffect((()=>{f&&_.pageIndex!==m&&S((e=>({...e,pageIndex:m})))}),[m,_.pageIndex,f]);const E=n.useCallback((e=>{if(!f||!c)return;let t,n=m,r=b;"object"==typeof e?(r=e.newPageSize,n=0,x(r),g(n),y([void 0]),c({cursor:void 0,pageSize:r})):"prev"===e?(n=Math.max(m-1,0),t=v[n],g(n),c({cursor:t,pageSize:b})):"next"===e&&h&&h.nextCursor&&""!==h.nextCursor&&(n=m+1,t=h.nextCursor,g(n),c({cursor:t,pageSize:b}))}),[f,c,m,v,b,h]),T=f&&m>0,C=!!(f&&h&&h.nextCursor&&""!==h.nextCursor),[A,N]=n.useState(""),R=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=i.useState((()=>({current:LQ(t)}))),[r,o]=i.useState((()=>n.current.initialState));return n.current.setOptions((t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{o(t),null==e.onStateChange||e.onStateChange(t)}}))),n.current}({data:d,columns:p,state:{globalFilter:A,pagination:_},getCoreRowModel:e=>QZ((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(t,o,i){void 0===o&&(o=0);const a=[];for(let l=0;l<t.length;l++){const c=oQ(e,e._getRowId(t[l],l,i),t[l],l,o,0,null==i?void 0:i.id);var s;n.flatRows.push(c),n.rowsById[c.id]=c,a.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[l],l),null!=(s=c.originalSubRows)&&s.length&&(c.subRows=r(c.originalSubRows,o+1,c)))}return a};return n.rows=r(t),n}),JZ(e.options,"debugTable","getRowModel",(()=>e._autoResetPageIndex()))),getFilteredRowModel:e=>QZ((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,r)=>{if(!t.rows.length||(null==n||!n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],i=[];(null!=n?n:[]).forEach((t=>{var n;const r=e.getColumn(t.id);if(!r)return;const i=r.getFilterFn();i?o.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value}):process}));const a=(null!=n?n:[]).map((e=>e.id)),s=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let c,u;r&&s&&l.length&&(a.push("__global__"),l.forEach((e=>{var t;i.push({id:e.id,filterFn:s,resolvedValue:null!=(t=null==s.resolveFilterValue?void 0:s.resolveFilterValue(r))?t:r})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){c=o[e];const t=c.id;n.columnFilters[t]=c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){u=i[e];const t=u.id;if(u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return DQ(t.rows,(e=>{for(let t=0;t<a.length;t++)if(!1===e.columnFilters[a[t]])return!1;return!0}),e)}),JZ(e.options,"debugTable","getFilteredRowModel",(()=>e._autoResetPageIndex()))),onGlobalFilterChange:N,onPaginationChange:S,..."standard"===o&&{getPaginationRowModel:e=>QZ((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:r,pageIndex:o}=t;let{rows:i,flatRows:a,rowsById:s}=n;const l=r*o;let c;i=i.slice(l,l+r),c=e.options.paginateExpandedRows?{rows:i,flatRows:a,rowsById:s}:function(e){const t=[],n=e=>{var r;t.push(e),null!=(r=e.subRows)&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}({rows:i,flatRows:a,rowsById:s}),c.flatRows=[];const u=e=>{c.flatRows.push(e),e.subRows.length&&e.subRows.forEach(u)};return c.rows.forEach(u),c}),JZ(e.options,"debugTable","getPaginationRowModel")),pageCount:void 0!==u?u:void 0},...f&&{manualPagination:!0,pageCount:void 0!==u?u:-1},debugTable:r,debugHeaders:r,debugColumns:r});n.useEffect((()=>{!f&&R&&R.getState().pagination.pageIndex!==s&&R.setPageIndex(s)}),[s,R,f]),n.useEffect((()=>{R&&R.getState().pagination.pageSize!==b&&R.setPageSize(b)}),[b,R]);const O=f?v[m]:void 0;return{...R,setGlobalFilter:N,globalFilter:A,...f&&{currentApiCursor:O,handleCursorNavigation:E,canGoPreviousForCursor:T,canGoNextForCursor:C,resetCursorPagination:w,logicalPage:m}}}function K3({data:e,columns:r,enableDebug:o=!1,paginationMode:i="none",initialPageSize:a=10,initialPageIndex:s=0,headerActions:l,isLoading:c=!1,cursorPaginationQueryResult:u,onQueryParametersChange:d,searchValue:p,onSearchChange:f,onRowClick:h}){const m=G3({data:e??[],columns:r,enableDebug:o,paginationMode:i,initialPageSize:a,initialPageIndex:s,cursorPaginationQueryResult:u,onQueryParametersChange:d}),g=n.useRef(null),[v,y]=n.useState(!1),b="standard"===i,x="cursor"===i,w=x?m.canGoPreviousForCursor??!1:m.getCanPreviousPage(),_=x?m.canGoNextForCursor??!1:m.getCanNextPage(),S=!b&&!x||c?null:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(vZ,{"data-testid":"previous-button",variant:"outline",size:"sm",className:"bg-card",onClick:()=>{x&&m.handleCursorNavigation?m.handleCursorNavigation("prev"):m.previousPage()},disabled:!w||c,children:t.jsx(hu,{className:"h-4 w-4 mr-1"})}),b&&t.jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",m.getState().pagination.pageIndex+1," of"," ",-1===m.getPageCount()?"many":m.getPageCount()]}),t.jsx(vZ,{"data-testid":"next-button",variant:"outline",size:"sm",className:"bg-card",onClick:()=>{x&&m.handleCursorNavigation?m.handleCursorNavigation("next"):m.nextPage()},disabled:!_||c,children:t.jsx(mu,{className:"h-4 w-4 ml-1"})}),t.jsxs(V3,{children:[t.jsx(B3,{asChild:!0,children:t.jsxs(vZ,{variant:"outline",size:"sm",className:"bg-card",disabled:c,children:[m.getState().pagination.pageSize," rows",t.jsx(fu,{className:"ml-1 h-4 w-4"})]})}),t.jsx(z3,{align:"end",children:[5,10,20,30,50].map((e=>t.jsxs(H3,{onClick:()=>{x&&m.handleCursorNavigation?m.handleCursorNavigation({newPageSize:e}):m.setPageSize(e)},children:[e," rows"]},e)))})]})]}),E=()=>t.jsxs(zZ,{className:"flex-grow min-h-0 relative",children:[t.jsx(HZ,{className:Zd("sticky top-0 z-10",v&&"shadow-md border-b border-slate-200"),children:m.getHeaderGroups().map((e=>t.jsx(GZ,{children:e.headers.map((e=>t.jsx(KZ,{colSpan:e.colSpan,children:e.isPlaceholder?null:IQ(e.column.columnDef.header,e.getContext())},e.id)))},e.id)))}),t.jsx(qZ,{children:m.getRowModel().rows.length?m.getRowModel().rows.map((e=>t.jsx(GZ,{className:Zd("rounded-b-md",h&&"cursor-pointer hover:bg-muted/90 transition-colors"),"data-state":e.getIsSelected()&&"selected",onClick:()=>h?.(e.original),children:e.getVisibleCells().map((e=>t.jsx(WZ,{children:IQ(e.column.columnDef.cell,e.getContext())},e.id)))},e.id))):t.jsx(GZ,{children:t.jsx(WZ,{colSpan:r.length,className:"h-24 text-center",children:"No results found"})})})]}),T=()=>t.jsx("div",{className:"h-full w-full flex items-center justify-center",children:t.jsx(hZ,{})});return t.jsxs("div",{className:"flex flex-col h-full border rounded-lg shadow-sm hover:shadow-md transition-shadow duration-300 overflow-hidden",children:[t.jsxs("div",{className:"flex flex-col items-start gap-3 py-4 px-2 sticky top-0 z-20 bg-primary/5 border-b rounded-t-md md:flex-row md:items-center md:justify-between",children:[t.jsx("div",{className:"w-full md:w-1/4",children:t.jsx(q3,{placeholder:"Search...",value:p??m.getState().globalFilter??"",onChange:e=>{const t=e.target.value;f?f(t):m.setGlobalFilter(t)},className:"max-w-sm bg-card",disabled:c})}),t.jsxs("div",{className:"flex items-center space-x-4",children:[S,l&&t.jsx("div",{children:l})]})]}),t.jsx("div",{ref:g,className:"w-full overflow-x-auto h-full",onScroll:()=>{g.current&&y(g.current.scrollTop>0)},children:t.jsx(c?T:E,{})}),o&&t.jsx("div",{className:"mt-4",children:t.jsx("pre",{className:"p-2 bg-gray-50 text-xs overflow-x-auto",children:t.jsx("code",{children:JSON.stringify(m.getState(),null,2)})})})]})}q3.displayName="Input";var W3={};Object.defineProperty(W3,"__esModule",{value:!0}),W3.parse=function(e,t){const n=new e5,r=e.length;if(r<2)return n;const o=t?.decode||r5;let i=0;do{const t=e.indexOf("=",i);if(-1===t)break;const a=e.indexOf(";",i),s=-1===a?r:a;if(t>s){i=e.lastIndexOf(";",t-1)+1;continue}const l=t5(e,i,t),c=n5(e,t,l),u=e.slice(l,c);if(void 0===n[u]){let r=t5(e,t+1,s),i=n5(e,s,r);const a=o(e.slice(r,i));n[u]=a}i=s+1}while(i<r);return n},W3.serialize=function(e,t,n){const r=n?.encode||encodeURIComponent;if(!Y3.test(e))throw new TypeError(`argument name is invalid: ${e}`);const o=r(t);if(!X3.test(o))throw new TypeError(`argument val is invalid: ${t}`);let i=e+"="+o;if(!n)return i;if(void 0!==n.maxAge){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);i+="; Max-Age="+n.maxAge}if(n.domain){if(!Z3.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);i+="; Domain="+n.domain}if(n.path){if(!Q3.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);i+="; Path="+n.path}if(n.expires){if(!function(e){return"[object Date]"===J3.call(e)}
|
|
75
|
+
function IQ(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(n=e)||"function"==typeof n||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(n)?i.createElement(e,t):e:null;var n}function FQ(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function UQ(e,n=[]){let r=[];const o=()=>{const t=r.map((e=>i.createContext(e)));return function(n){const r=n?.[e]||t;return i.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return o.scopeName=e,[function(n,o){const a=i.createContext(o),s=r.length;r=[...r,o];const l=n=>{const{scope:r,children:o,...l}=n,c=r?.[e]?.[s]||a,u=i.useMemo((()=>l),Object.values(l));return t.jsx(c.Provider,{value:u,children:o})};return l.displayName=n+"Provider",[l,function(t,r){const l=i.useContext(r?.[e]?.[s]||a);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},$Q(o,...n)]}function $Q(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return i.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function VQ(e){const t=i.useRef(e);return i.useEffect((()=>{t.current=e})),i.useMemo((()=>(...e)=>t.current?.(...e)),[])}function BQ({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=i.useState(e),[r]=n,o=i.useRef(r),a=VQ(t);return i.useEffect((()=>{o.current!==r&&(a(r),o.current=r)}),[r,o,a]),n}({defaultProp:t,onChange:n}),a=void 0!==e,s=a?e:r,l=VQ(n);return[s,i.useCallback((t=>{if(a){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[a,e,o,l])]}var zQ=i.forwardRef(((e,n)=>{const{children:r,...o}=e,a=i.Children.toArray(r),s=a.find(GQ);if(s){const e=s.props.children,r=a.map((t=>t===s?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(HQ,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(HQ,{...o,ref:n,children:r})}));zQ.displayName="Slot";var HQ=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n);return i.cloneElement(n,{...KQ(r,n.props),ref:t?YU(t,e):e})}return i.Children.count(n)>1?i.Children.only(null):null}));HQ.displayName="SlotClone";var qQ=({children:e})=>t.jsx(t.Fragment,{children:e});function GQ(e){return i.isValidElement(e)&&e.type===qQ}function KQ(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}var WQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,a=o?zQ:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(a,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{});function YQ(e,t){e&&a.flushSync((()=>e.dispatchEvent(t)))}function XQ(e){const r=e+"CollectionProvider",[o,i]=UQ(r),[a,s]=o(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:r,children:o}=e,i=n.useRef(null),s=n.useRef(new Map).current;return t.jsx(a,{scope:r,itemMap:s,collectionRef:i,children:o})};l.displayName=r;const c=e+"CollectionSlot",u=n.forwardRef(((e,n)=>{const{scope:r,children:o}=e,i=XU(n,s(c,r).collectionRef);return t.jsx(zQ,{ref:i,children:o})}));u.displayName=c;const d=e+"CollectionItemSlot",p="data-radix-collection-item",f=n.forwardRef(((e,r)=>{const{scope:o,children:i,...a}=e,l=n.useRef(null),c=XU(r,l),u=s(d,o);return n.useEffect((()=>(u.itemMap.set(l,{ref:l,...a}),()=>{u.itemMap.delete(l)}))),t.jsx(zQ,{[p]:"",ref:c,children:i})}));return f.displayName=d,[{Provider:l,Slot:u,ItemSlot:f},function(t){const r=s(e+"CollectionConsumer",t);return n.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[r.collectionRef,r.itemMap])},i]}var ZQ=i.createContext(void 0);function QQ(e){const t=i.useContext(ZQ);return e||t||"ltr"}function JQ(e,t=globalThis?.document){const n=VQ(e);i.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}var eJ,tJ="dismissableLayer.update",nJ="dismissableLayer.pointerDownOutside",rJ="dismissableLayer.focusOutside",oJ=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),iJ=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(oJ),[p,f]=i.useState(null),h=p?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=XU(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=p?v.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,_=x>=b,S=function(e,t=globalThis?.document){const n=VQ(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){sJ(nJ,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));_&&!n&&(a?.(e),l?.(e),e.defaultPrevented||c?.())}),h),E=function(e,t=globalThis?.document){const n=VQ(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){sJ(rJ,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(s?.(e),l?.(e),e.defaultPrevented||c?.())}),h);return JQ((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),h),i.useEffect((()=>{if(p)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(eJ=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),aJ(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=eJ)}}),[p,h,r,d]),i.useEffect((()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),aJ())}),[p,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(tJ,e),()=>document.removeEventListener(tJ,e)}),[]),t.jsx(WQ.div,{...u,ref:g,style:{pointerEvents:w?_?"auto":"none":void 0,...e.style},onFocusCapture:FQ(e.onFocusCapture,E.onFocusCapture),onBlurCapture:FQ(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:FQ(e.onPointerDownCapture,S.onPointerDownCapture)})}));iJ.displayName="DismissableLayer";function aJ(){const e=new CustomEvent(tJ);document.dispatchEvent(e)}function sJ(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?YQ(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(oJ),o=i.useRef(null),a=XU(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(WQ.div,{...e,ref:a})})).displayName="DismissableLayerBranch";var lJ=0;function cJ(){i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??uJ()),document.body.insertAdjacentElement("beforeend",e[1]??uJ()),lJ++,()=>{1===lJ&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),lJ--}}),[])}function uJ(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var dJ="focusScope.autoFocusOnMount",pJ="focusScope.autoFocusOnUnmount",fJ={bubbles:!1,cancelable:!0},hJ=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...l}=e,[c,u]=i.useState(null),d=VQ(a),p=VQ(s),f=i.useRef(null),h=XU(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:yJ(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||yJ(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&yJ(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){bJ.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(dJ,fJ);c.addEventListener(dJ,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yJ(r,{select:t}),document.activeElement!==n)return}((e=mJ(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&yJ(c))}return()=>{c.removeEventListener(dJ,d),setTimeout((()=>{const e=new CustomEvent(pJ,fJ);c.addEventListener(pJ,p),c.dispatchEvent(e),e.defaultPrevented||yJ(t??document.body,{select:!0}),c.removeEventListener(pJ,p),bJ.remove(m)}),0)}}var e}),[c,d,p,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=mJ(e),n=gJ(t,e),r=gJ(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&yJ(i,{select:!0})):(e.preventDefault(),r&&yJ(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(WQ.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})}));function mJ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function gJ(e,t){for(const n of e)if(!vJ(n,{upTo:t}))return n}function vJ(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function yJ(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}hJ.displayName="FocusScope";var bJ=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=xJ(e,t),e.unshift(t)},remove(t){e=xJ(e,t),e[0]?.resume()}}}();function xJ(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var wJ=Boolean(globalThis?.document)?i.useLayoutEffect:()=>{},_J=i["useId".toString()]||(()=>{}),SJ=0;function EJ(e){const[t,n]=i.useState(_J());return wJ((()=>{n((e=>e??String(SJ++)))}),[e]),t?`radix-${t}`:""}const TJ=["top","right","bottom","left"],CJ=Math.min,AJ=Math.max,NJ=Math.round,RJ=Math.floor,OJ=e=>({x:e,y:e}),PJ={left:"right",right:"left",bottom:"top",top:"bottom"},kJ={start:"end",end:"start"};function MJ(e,t,n){return AJ(e,CJ(t,n))}function jJ(e,t){return"function"==typeof e?e(t):e}function LJ(e){return e.split("-")[0]}function DJ(e){return e.split("-")[1]}function IJ(e){return"x"===e?"y":"x"}function FJ(e){return"y"===e?"height":"width"}function UJ(e){return["top","bottom"].includes(LJ(e))?"y":"x"}function $J(e){return IJ(UJ(e))}function VJ(e){return e.replace(/start|end/g,(e=>kJ[e]))}function BJ(e){return e.replace(/left|right|bottom|top/g,(e=>PJ[e]))}function zJ(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function HJ(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function qJ(e,t,n){let{reference:r,floating:o}=e;const i=UJ(t),a=$J(t),s=FJ(a),l=LJ(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(DJ(t)){case"start":f[a]-=p*(n&&c?-1:1);break;case"end":f[a]+=p*(n&&c?-1:1)}return f}async function GJ(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=jJ(t,e),h=zJ(f),m=s[p?"floating"===d?"reference":"floating":d],g=HJ(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=HJ(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.x}}function KJ(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function WJ(e){return TJ.some((t=>e[t]>=0))}function YJ(){return"undefined"!=typeof window}function XJ(e){return JJ(e)?(e.nodeName||"").toLowerCase():"#document"}function ZJ(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function QJ(e){var t;return null==(t=(JJ(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function JJ(e){return!!YJ()&&(e instanceof Node||e instanceof ZJ(e).Node)}function e0(e){return!!YJ()&&(e instanceof Element||e instanceof ZJ(e).Element)}function t0(e){return!!YJ()&&(e instanceof HTMLElement||e instanceof ZJ(e).HTMLElement)}function n0(e){return!(!YJ()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ZJ(e).ShadowRoot)}function r0(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=c0(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function o0(e){return["table","td","th"].includes(XJ(e))}function i0(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(JSe){return!1}}))}function a0(e){const t=s0(),n=e0(e)?c0(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function s0(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function l0(e){return["html","body","#document"].includes(XJ(e))}function c0(e){return ZJ(e).getComputedStyle(e)}function u0(e){return e0(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function d0(e){if("html"===XJ(e))return e;const t=e.assignedSlot||e.parentNode||n0(e)&&e.host||QJ(e);return n0(t)?t.host:t}function p0(e){const t=d0(e);return l0(t)?e.ownerDocument?e.ownerDocument.body:e.body:t0(t)&&r0(t)?t:p0(t)}function f0(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=p0(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=ZJ(o);if(i){const e=h0(a);return t.concat(a,a.visualViewport||[],r0(o)?o:[],e&&n?f0(e):[])}return t.concat(o,f0(o,[],n))}function h0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function m0(e){const t=c0(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=t0(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=NJ(n)!==i||NJ(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function g0(e){return e0(e)?e:e.contextElement}function v0(e){const t=g0(e);if(!t0(t))return OJ(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=m0(t);let a=(i?NJ(n.width):n.width)/r,s=(i?NJ(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const y0=OJ(0);function b0(e){const t=ZJ(e);return s0()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:y0}function x0(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=g0(e);let a=OJ(1);t&&(r?e0(r)&&(a=v0(r)):a=v0(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ZJ(e))&&t}(i,n,r)?b0(i):OJ(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=ZJ(i),t=r&&e0(r)?ZJ(r):r;let n=e,o=h0(n);for(;o&&r&&t!==n;){const e=v0(o),t=o.getBoundingClientRect(),r=c0(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=ZJ(o),o=h0(n)}}return HJ({width:u,height:d,x:l,y:c})}function w0(e,t){const n=u0(e).scrollLeft;return t?t.left+n:x0(QJ(e)).left+n}function _0(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:w0(e,r)),y:r.top+t.scrollTop}}function S0(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ZJ(e),r=QJ(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=s0();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=QJ(e),n=u0(e),r=e.ownerDocument.body,o=AJ(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=AJ(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+w0(e);const s=-n.scrollTop;return"rtl"===c0(r).direction&&(a+=AJ(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(QJ(e));else if(e0(t))r=function(e,t){const n=x0(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=t0(e)?v0(e):OJ(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=b0(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return HJ(r)}function E0(e,t){const n=d0(e);return!(n===t||!e0(n)||l0(n))&&("fixed"===c0(n).position||E0(n,t))}function T0(e,t,n){const r=t0(t),o=QJ(t),i="fixed"===n,a=x0(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=OJ(0);if(r||!r&&!i)if(("body"!==XJ(t)||r0(o))&&(s=u0(t)),r){const e=x0(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=w0(o));const c=!o||r||i?OJ(0):_0(o,s);return{x:a.left+s.scrollLeft-l.x-c.x,y:a.top+s.scrollTop-l.y-c.y,width:a.width,height:a.height}}function C0(e){return"static"===c0(e).position}function A0(e,t){if(!t0(e)||"fixed"===c0(e).position)return null;if(t)return t(e);let n=e.offsetParent;return QJ(e)===n&&(n=n.ownerDocument.body),n}function N0(e,t){const n=ZJ(e);if(i0(e))return n;if(!t0(e)){let t=d0(e);for(;t&&!l0(t);){if(e0(t)&&!C0(t))return t;t=d0(t)}return n}let r=A0(e,t);for(;r&&o0(r)&&C0(r);)r=A0(r,t);return r&&l0(r)&&C0(r)&&!a0(r)?n:r||function(e){let t=d0(e);for(;t0(t)&&!l0(t);){if(a0(t))return t;if(i0(t))return null;t=d0(t)}return null}(e)||n}const R0={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=QJ(r),s=!!t&&i0(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=OJ(1);const u=OJ(0),d=t0(r);if((d||!d&&!i)&&(("body"!==XJ(r)||r0(a))&&(l=u0(r)),t0(r))){const e=x0(r);c=v0(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?OJ(0):_0(a,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:QJ,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?i0(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=f0(e,[],!1).filter((e=>e0(e)&&"body"!==XJ(e))),o=null;const i="fixed"===c0(e).position;let a=i?d0(e):e;for(;e0(a)&&!l0(a);){const t=c0(a),n=a0(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||r0(a)&&!n&&E0(e,a))?r=r.filter((e=>e!==a)):o=t,a=d0(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i.reduce(((e,n)=>{const r=S0(t,n,o);return e.top=AJ(r.top,e.top),e.right=CJ(r.right,e.right),e.bottom=CJ(r.bottom,e.bottom),e.left=AJ(r.left,e.left),e}),S0(t,i[0],o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:N0,getElementRects:async function(e){const t=this.getOffsetParent||N0,n=this.getDimensions,r=await n(e.floating);return{reference:T0(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=m0(e);return{width:t,height:n}},getScale:v0,isElement:e0,isRTL:function(e){return"rtl"===c0(e).direction}};function O0(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=g0(e),u=o||i?[...c?f0(c):[],...f0(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const o=QJ(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const f={rootMargin:-RJ(u)+"px "+-RJ(o.clientWidth-(c+d))+"px "+-RJ(o.clientHeight-(u+p))+"px "+-RJ(c)+"px",threshold:AJ(0,CJ(1,l))||1};let h=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(JSe){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let m=l?x0(e):null;return l&&function t(){const r=x0(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const P0=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=LJ(n),s=DJ(n),l="y"===UJ(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=jJ(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},k0=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=jJ(e,t),c={x:n,y:r},u=await GJ(t,l),d=UJ(LJ(o)),p=IJ(d);let f=c[p],h=c[d];if(i){f=MJ(f+u["y"===p?"top":"left"],f,f-u["y"===p?"bottom":"right"])}if(a){h=MJ(h+u["y"===d?"top":"left"],h,h-u["y"===d?"bottom":"right"])}const m=s.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[d]:a}}}}}},M0=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=jJ(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=LJ(o),y=UJ(s),b=LJ(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(b||!m?[BJ(s)]:function(e){const t=BJ(e);return[VJ(e),t,VJ(t)]}(s)),_="none"!==h;!p&&_&&w.push(...function(e,t,n,r){const o=DJ(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(LJ(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(VJ)))),i}(s,m,h,x));const S=[s,...w],E=await GJ(t,g),T=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&T.push(E[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=DJ(e),o=$J(e),i=FJ(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=BJ(a)),[a,BJ(a)]}(o,a,x);T.push(E[e[0]],E[e[1]])}if(C=[...C,{placement:o,overflows:T}],!T.every((e=>e<=0))){var A,N;const e=((null==(A=i.flip)?void 0:A.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(N=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:N.placement;if(!n)switch(f){case"bestFit":{var R;const e=null==(R=C.filter((e=>{if(_){const t=UJ(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:R[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},j0=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=jJ(e,t),u=await GJ(t,c),d=LJ(o),p=DJ(o),f="y"===UJ(o),{width:h,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,g="end"===p?"top":"bottom");const y=m-u.top-u.bottom,b=h-u.left-u.right;let x=CJ(m-u[g],y),w=CJ(h-u[v],b);if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(w=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=y),!t.middlewareData.shift&&!p){const e=AJ(u.left,0),t=AJ(u.right,0),n=AJ(u.top,0),r=AJ(u.bottom,0);f?w=h-2*(0!==e||0!==t?e+t:AJ(u.left,u.right)):x=m-2*(0!==n||0!==r?n+r:AJ(u.top,u.bottom))}await l({...t,availableWidth:w,availableHeight:x});const _=await a.getDimensions(s.floating);return h!==_.width||m!==_.height?{reset:{rects:!0}}:{}}}},L0=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=jJ(e,t);switch(r){case"referenceHidden":{const e=KJ(await GJ(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:WJ(e)}}}case"escaped":{const e=KJ(await GJ(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:WJ(e)}}}default:return{}}}}},D0=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=jJ(e,t)||{};if(null==c)return{};const d=zJ(u),p={x:n,y:r},f=$J(o),h=FJ(f),m=await a.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[f]-p[f]-i.floating[h],w=p[f]-i.reference[f],_=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let S=_?_[b]:0;S&&await(null==a.isElement?void 0:a.isElement(_))||(S=s.floating[b]||i.floating[h]);const E=x/2-w/2,T=S/2-m[h]/2-1,C=CJ(d[v],T),A=CJ(d[y],T),N=C,R=S-m[h]-A,O=S/2-m[h]/2+E,P=MJ(N,O,R),k=!l.arrow&&null!=DJ(o)&&O!==P&&i.reference[h]/2-(O<N?C:A)-m[h]/2<0,M=k?O<N?O-N:O-R:0;return{[f]:p[f]+M,data:{[f]:P,centerOffset:O-P-M,...k&&{alignmentOffset:M}},reset:k}}}),I0=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=jJ(e,t),u={x:n,y:r},d=UJ(o),p=IJ(d);let f=u[p],h=u[d];const m=jJ(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,n=i.reference[p]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var v,y;const e="y"===p?"width":"height",t=["top","left"].includes(LJ(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},F0=(e,t,n)=>{const r={platform:R0,...n},o={...r.platform,_c:new Map};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=qJ(c,r,l),p=r,f={},h=0;for(let m=0;m<s.length;m++){const{name:n,fn:i}=s[m],{x:g,y:v,data:y,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,f={...f,[n]:{...f[n],...y}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=qJ(c,p,l))),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})};var U0="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function $0(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!$0(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!$0(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function V0(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function B0(e,t){const n=V0(e);return Math.round(t*n)/n}function z0(e){const t=i.useRef(e);return U0((()=>{t.current=e})),t}function H0(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[p,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=i.useState(r);$0(h,r)||m(r);const[g,v]=i.useState(null),[y,b]=i.useState(null),x=i.useCallback((e=>{e!==E.current&&(E.current=e,v(e))}),[]),w=i.useCallback((e=>{e!==T.current&&(T.current=e,b(e))}),[]),_=s||g,S=l||y,E=i.useRef(null),T=i.useRef(null),C=i.useRef(p),A=null!=u,N=z0(u),R=z0(o),O=z0(d),P=i.useCallback((()=>{if(!E.current||!T.current)return;const e={placement:t,strategy:n,middleware:h};R.current&&(e.platform=R.current),F0(E.current,T.current,e).then((e=>{const t={...e,isPositioned:!1!==O.current};k.current&&!$0(C.current,t)&&(C.current=t,a.flushSync((()=>{f(t)})))}))}),[h,t,n,R,O]);U0((()=>{!1===d&&C.current.isPositioned&&(C.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const k=i.useRef(!1);U0((()=>(k.current=!0,()=>{k.current=!1})),[]),U0((()=>{if(_&&(E.current=_),S&&(T.current=S),_&&S){if(N.current)return N.current(_,S,P);P()}}),[_,S,P,N,A]);const M=i.useMemo((()=>({reference:E,floating:T,setReference:x,setFloating:w})),[x,w]),j=i.useMemo((()=>({reference:_,floating:S})),[_,S]),L=i.useMemo((()=>{const e={position:n,left:0,top:0};if(!j.floating)return e;const t=B0(j.floating,p.x),r=B0(j.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...V0(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,j.floating,p.x,p.y]);return i.useMemo((()=>({...p,update:P,refs:M,elements:j,floatingStyles:L})),[p,P,M,j,L])}const q0=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&{}.hasOwnProperty.call(n,"current")?null!=n.current?D0({element:n.current,padding:r}).fn(t):{}:n?D0({element:n,padding:r}).fn(t):{}}}),G0=(e,t)=>({...P0(e),options:[e,t]}),K0=(e,t)=>({...k0(e),options:[e,t]}),W0=(e,t)=>({...I0(e),options:[e,t]}),Y0=(e,t)=>({...M0(e),options:[e,t]}),X0=(e,t)=>({...j0(e),options:[e,t]}),Z0=(e,t)=>({...L0(e),options:[e,t]}),Q0=(e,t)=>({...q0(e),options:[e,t]});var J0=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...a}=e;return t.jsx(WQ.svg,{...a,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:t.jsx("polygon",{points:"0,0 30,0 15,10"})})}));J0.displayName="Arrow";var e1=J0;function t1(e){const[t,n]=i.useState(void 0);return wJ((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}var n1="Popper",[r1,o1]=UQ(n1),[i1,a1]=r1(n1),s1=e=>{const{__scopePopper:n,children:r}=e,[o,a]=i.useState(null);return t.jsx(i1,{scope:n,anchor:o,onAnchorChange:a,children:r})};s1.displayName=n1;var l1="PopperAnchor",c1=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...a}=e,s=a1(l1,r),l=i.useRef(null),c=XU(n,l);return i.useEffect((()=>{s.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(WQ.div,{...a,ref:c})}));c1.displayName=l1;var u1="PopperContent",[d1,p1]=r1(u1),f1=i.forwardRef(((e,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:g,...v}=e,y=a1(u1,r),[b,x]=i.useState(null),w=XU(n,(e=>x(e))),[_,S]=i.useState(null),E=t1(_),T=E?.width??0,C=E?.height??0,A=o+("center"!==s?"-"+s:""),N="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},R=Array.isArray(d)?d:[d],O=R.length>0,P={padding:N,boundary:R.filter(v1),altBoundary:O},{refs:k,floatingStyles:M,placement:j,isPositioned:L,middlewareData:D}=H0({strategy:"fixed",placement:A,whileElementsMounted:(...e)=>O0(...e,{animationFrame:"always"===m}),elements:{reference:y.anchor},middleware:[G0({mainAxis:a+C,alignmentAxis:l}),u&&K0({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?W0():void 0,...P}),u&&Y0({...P}),X0({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),_&&Q0({element:_,padding:c}),y1({arrowWidth:T,arrowHeight:C}),h&&Z0({strategy:"referenceHidden",...P})]}),[I,F]=b1(j),U=VQ(g);wJ((()=>{L&&U?.()}),[L,U]);const $=D.arrow?.x,V=D.arrow?.y,B=0!==D.arrow?.centerOffset,[z,H]=i.useState();return wJ((()=>{b&&H(window.getComputedStyle(b).zIndex)}),[b]),t.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:L?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:z,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(d1,{scope:r,placedSide:I,onArrowChange:S,arrowX:$,arrowY:V,shouldHideArrow:B,children:t.jsx(WQ.div,{"data-side":I,"data-align":F,...v,ref:w,style:{...v.style,animation:L?void 0:"none"}})})})}));f1.displayName=u1;var h1="PopperArrow",m1={top:"bottom",right:"left",bottom:"top",left:"right"},g1=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=p1(h1,r),a=m1[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(e1,{...o,ref:n,style:{...o.style,display:"block"}})})}));function v1(e){return null!==e}g1.displayName=h1;var y1=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[l,c]=b1(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+s/2;let f="",h="";return"bottom"===l?(f=i?u:`${d}px`,h=-s+"px"):"top"===l?(f=i?u:`${d}px`,h=`${r.floating.height+s}px`):"right"===l?(f=-s+"px",h=i?u:`${p}px`):"left"===l&&(f=`${r.floating.width+s}px`,h=i?u:`${p}px`),{data:{x:f,y:h}}}});function b1(e){const[t,n="center"]=e.split("-");return[t,n]}var x1=s1,w1=c1,_1=f1,S1=g1,E1=i.forwardRef(((e,n)=>{const{container:o,...a}=e,[s,l]=i.useState(!1);wJ((()=>l(!0)),[]);const c=o||s&&globalThis?.document?.body;return c?r.createPortal(t.jsx(WQ.div,{...a,ref:n}),c):null}));E1.displayName="Portal";var T1=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=i.useState(),r=i.useRef({}),o=i.useRef(e),a=i.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return i.useReducer(((e,n)=>t[e][n]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect((()=>{const e=C1(r.current);a.current="mounted"===l?e:"none"}),[l]),wJ((()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,i=C1(t);if(e)c("MOUNT");else if("none"===i||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),wJ((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=i=>{const a=C1(r.current).includes(i.animationName);if(i.target===t&&a&&(c("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},s=e=>{e.target===t&&(a.current=C1(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):i.Children.only(n),a=XU(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?i.cloneElement(o,{ref:a}):null};function C1(e){return e?.animationName||"none"}T1.displayName="Presence";var A1="rovingFocusGroup.onEntryFocus",N1={bubbles:!1,cancelable:!0},R1="RovingFocusGroup",[O1,P1,k1]=XQ(R1),[M1,j1]=UQ(R1,[k1]),[L1,D1]=M1(R1),I1=i.forwardRef(((e,n)=>t.jsx(O1.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(O1.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(F1,{...e,ref:n})})})));I1.displayName=R1;var F1=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:a=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...f}=e,h=i.useRef(null),m=XU(n,h),g=QQ(s),[v=null,y]=BQ({prop:l,defaultProp:c,onChange:u}),[b,x]=i.useState(!1),w=VQ(d),_=P1(r),S=i.useRef(!1),[E,T]=i.useState(0);return i.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(A1,w),()=>e.removeEventListener(A1,w)}),[w]),t.jsx(L1,{scope:r,orientation:o,dir:g,loop:a,currentTabStopId:v,onItemFocus:i.useCallback((e=>y(e)),[y]),onItemShiftTab:i.useCallback((()=>x(!0)),[]),onFocusableItemAdd:i.useCallback((()=>T((e=>e+1))),[]),onFocusableItemRemove:i.useCallback((()=>T((e=>e-1))),[]),children:t.jsx(WQ.div,{tabIndex:b||0===E?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:FQ(e.onMouseDown,(()=>{S.current=!0})),onFocus:FQ(e.onFocus,(e=>{if(e.target===e.currentTarget&&!S.current&&!b){const t=new CustomEvent(A1,N1);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=_().filter((e=>e.focusable));B1([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),p)}}S.current=!1})),onBlur:FQ(e.onBlur,(()=>x(!1)))})})})),U1="RovingFocusGroupItem",$1=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:a=!1,tabStopId:s,...l}=e,c=EJ(),u=s||c,d=D1(U1,r),p=d.currentTabStopId===u,f=P1(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=d;return i.useEffect((()=>{if(o)return h(),()=>m()}),[o,h,m]),t.jsx(O1.ItemSlot,{scope:r,id:u,focusable:o,active:a,children:t.jsx(WQ.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:FQ(e.onMouseDown,(e=>{o?d.onItemFocus(u):e.preventDefault()})),onFocus:FQ(e.onFocus,(()=>d.onItemFocus(u))),onKeyDown:FQ(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:V1[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=d.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>B1(o)))}var n,r}))})})}));$1.displayName=U1;var V1={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function B1(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var z1=I1,H1=$1,q1=["Enter"," "],G1=["ArrowUp","PageDown","End"],K1=["ArrowDown","PageUp","Home",...G1],W1={ltr:[...q1,"ArrowRight"],rtl:[...q1,"ArrowLeft"]},Y1={ltr:["ArrowLeft"],rtl:["ArrowRight"]},X1="Menu",[Z1,Q1,J1]=XQ(X1),[e2,t2]=UQ(X1,[J1,o1,j1]),n2=o1(),r2=j1(),[o2,i2]=e2(X1),[a2,s2]=e2(X1),l2=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:a,onOpenChange:s,modal:l=!0}=e,c=n2(n),[u,d]=i.useState(null),p=i.useRef(!1),f=VQ(s),h=QQ(a);return i.useEffect((()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),t.jsx(x1,{...c,children:t.jsx(o2,{scope:n,open:r,onOpenChange:f,content:u,onContentChange:d,children:t.jsx(a2,{scope:n,onClose:i.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:p,dir:h,modal:l,children:o})})})};l2.displayName=X1;var c2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=n2(r);return t.jsx(w1,{...i,...o,ref:n})}));c2.displayName="MenuAnchor";var u2="MenuPortal",[d2,p2]=e2(u2,{forceMount:void 0}),f2=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,a=i2(u2,n);return t.jsx(d2,{scope:n,forceMount:r,children:t.jsx(T1,{present:r||a.open,children:t.jsx(E1,{asChild:!0,container:i,children:o})})})};f2.displayName=u2;var h2="MenuContent",[m2,g2]=e2(h2),v2=i.forwardRef(((e,n)=>{const r=p2(h2,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,a=i2(h2,e.__scopeMenu),s=s2(h2,e.__scopeMenu);return t.jsx(Z1.Provider,{scope:e.__scopeMenu,children:t.jsx(T1,{present:o||a.open,children:t.jsx(Z1.Slot,{scope:e.__scopeMenu,children:t.jsx(s.modal?y2:b2,{...i,ref:n})})})})})),y2=i.forwardRef(((e,n)=>{const r=i2(h2,e.__scopeMenu),o=i.useRef(null),a=XU(n,o);return i.useEffect((()=>{const e=o.current;if(e)return LV(e)}),[]),t.jsx(x2,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:FQ(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),b2=i.forwardRef(((e,n)=>{const r=i2(h2,e.__scopeMenu);return t.jsx(x2,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),x2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:g,...v}=e,y=i2(h2,r),b=s2(h2,r),x=n2(r),w=r2(r),_=Q1(r),[S,E]=i.useState(null),T=i.useRef(null),C=XU(n,T,y.onContentChange),A=i.useRef(0),N=i.useRef(""),R=i.useRef(0),O=i.useRef(null),P=i.useRef("right"),k=i.useRef(0),M=g?NV:i.Fragment,j=g?{as:zQ,allowPinchZoom:!0}:void 0,L=e=>{const t=N.current+e,n=_().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=(s=e,l=Math.max(i,0),s.map(((e,t)=>s[(l+t)%s.length])));var s,l;1===o.length&&(a=a.filter((e=>e!==n)));const c=a.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(n.map((e=>e.textValue)),t,o),a=n.find((e=>e.textValue===i))?.ref.current;!function e(t){N.current=t,window.clearTimeout(A.current),""!==t&&(A.current=window.setTimeout((()=>e("")),1e3))}(t),a&&setTimeout((()=>a.focus()))};i.useEffect((()=>()=>window.clearTimeout(A.current)),[]),cJ();const D=i.useCallback((e=>P.current===O.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const e=t[i].x,s=t[i].y,l=t[a].y;s>r!=l>r&&n<(t[a].x-e)*(r-s)/(l-s)+e&&(o=!o)}return o}(n,t)}(e,O.current?.area)),[]);return t.jsx(m2,{scope:r,searchRef:N,onItemEnter:i.useCallback((e=>{D(e)&&e.preventDefault()}),[D]),onItemLeave:i.useCallback((e=>{D(e)||(T.current?.focus(),E(null))}),[D]),onTriggerLeave:i.useCallback((e=>{D(e)&&e.preventDefault()}),[D]),pointerGraceTimerRef:R,onPointerGraceIntentChange:i.useCallback((e=>{O.current=e}),[]),children:t.jsx(M,{...j,children:t.jsx(hJ,{asChild:!0,trapped:a,onMountAutoFocus:FQ(s,(e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:t.jsx(iJ,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:t.jsx(z1,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:FQ(u,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:t.jsx(_1,{role:"menu","aria-orientation":"vertical","data-state":G2(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:C,style:{outline:"none",...v.style},onKeyDown:FQ(v.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&L(e.key));if(e.target!==T.current)return;if(!K1.includes(e.key))return;e.preventDefault();const o=_().filter((e=>!e.disabled)).map((e=>e.ref.current));G1.includes(e.key)&&o.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(o)})),onBlur:FQ(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(A.current),N.current="")})),onPointerMove:FQ(e.onPointerMove,Y2((e=>{const t=k.current!==e.clientX;if(e.currentTarget.contains(e.target)&&t){P.current=e.clientX>k.current?"right":"left",k.current=e.clientX}})))})})})})})})}));v2.displayName=h2;var w2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(WQ.div,{role:"group",...o,ref:n})}));w2.displayName="MenuGroup";var _2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(WQ.div,{...o,ref:n})}));_2.displayName="MenuLabel";var S2="MenuItem",E2="menu.itemSelect",T2=i.forwardRef(((e,n)=>{const{disabled:r=!1,onSelect:o,...a}=e,s=i.useRef(null),l=s2(S2,e.__scopeMenu),c=g2(S2,e.__scopeMenu),u=XU(n,s),d=i.useRef(!1);return t.jsx(C2,{...a,ref:u,disabled:r,onClick:FQ(e.onClick,(()=>{const e=s.current;if(!r&&e){const t=new CustomEvent(E2,{bubbles:!0,cancelable:!0});e.addEventListener(E2,(e=>o?.(e)),{once:!0}),YQ(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:FQ(e.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:FQ(e.onKeyDown,(e=>{r||""!==c.searchRef.current&&" "===e.key||q1.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));T2.displayName=S2;var C2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:a,...s}=e,l=g2(S2,r),c=r2(r),u=i.useRef(null),d=XU(n,u),[p,f]=i.useState(!1),[h,m]=i.useState("");return i.useEffect((()=>{const e=u.current;e&&m((e.textContent??"").trim())}),[s.children]),t.jsx(Z1.ItemSlot,{scope:r,disabled:o,textValue:a??h,children:t.jsx(H1,{asChild:!0,...c,focusable:!o,children:t.jsx(WQ.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:d,onPointerMove:FQ(e.onPointerMove,Y2((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:FQ(e.onPointerLeave,Y2((e=>l.onItemLeave(e)))),onFocus:FQ(e.onFocus,(()=>f(!0))),onBlur:FQ(e.onBlur,(()=>f(!1)))})})})})),A2=i.forwardRef(((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(L2,{scope:e.__scopeMenu,checked:r,children:t.jsx(T2,{role:"menuitemcheckbox","aria-checked":K2(r)?"mixed":r,...i,ref:n,"data-state":W2(r),onSelect:FQ(i.onSelect,(()=>o?.(!!K2(r)||!r)),{checkForDefaultPrevented:!1})})})}));A2.displayName="MenuCheckboxItem";var N2="MenuRadioGroup",[R2,O2]=e2(N2,{value:void 0,onValueChange:()=>{}}),P2=i.forwardRef(((e,n)=>{const{value:r,onValueChange:o,...i}=e,a=VQ(o);return t.jsx(R2,{scope:e.__scopeMenu,value:r,onValueChange:a,children:t.jsx(w2,{...i,ref:n})})}));P2.displayName=N2;var k2="MenuRadioItem",M2=i.forwardRef(((e,n)=>{const{value:r,...o}=e,i=O2(k2,e.__scopeMenu),a=r===i.value;return t.jsx(L2,{scope:e.__scopeMenu,checked:a,children:t.jsx(T2,{role:"menuitemradio","aria-checked":a,...o,ref:n,"data-state":W2(a),onSelect:FQ(o.onSelect,(()=>i.onValueChange?.(r)),{checkForDefaultPrevented:!1})})})}));M2.displayName=k2;var j2="MenuItemIndicator",[L2,D2]=e2(j2,{checked:!1}),I2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,a=D2(j2,r);return t.jsx(T1,{present:o||K2(a.checked)||!0===a.checked,children:t.jsx(WQ.span,{...i,ref:n,"data-state":W2(a.checked)})})}));I2.displayName=j2;var F2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(WQ.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})}));F2.displayName="MenuSeparator";var U2=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=n2(r);return t.jsx(S1,{...i,...o,ref:n})}));U2.displayName="MenuArrow";var[$2,V2]=e2("MenuSub"),B2="MenuSubTrigger",z2=i.forwardRef(((e,n)=>{const r=i2(B2,e.__scopeMenu),o=s2(B2,e.__scopeMenu),a=V2(B2,e.__scopeMenu),s=g2(B2,e.__scopeMenu),l=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},p=i.useCallback((()=>{l.current&&window.clearTimeout(l.current),l.current=null}),[]);return i.useEffect((()=>p),[p]),i.useEffect((()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}}),[c,u]),t.jsx(c2,{asChild:!0,...d,children:t.jsx(C2,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":G2(r.open),...e,ref:YU(n,a.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:FQ(e.onPointerMove,Y2((t=>{s.onItemEnter(t),t.defaultPrevented||e.disabled||r.open||l.current||(s.onPointerGraceIntentChange(null),l.current=window.setTimeout((()=>{r.onOpenChange(!0),p()}),100))}))),onPointerLeave:FQ(e.onPointerLeave,Y2((e=>{p();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,i=t[o?"left":"right"],a=t[o?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+(o?-5:5),y:e.clientY},{x:i,y:t.top},{x:a,y:t.top},{x:a,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout((()=>s.onPointerGraceIntentChange(null)),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}}))),onKeyDown:FQ(e.onKeyDown,(t=>{e.disabled||""!==s.searchRef.current&&" "===t.key||W1[o.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())}))})})}));z2.displayName=B2;var H2="MenuSubContent",q2=i.forwardRef(((e,n)=>{const r=p2(h2,e.__scopeMenu),{forceMount:o=r.forceMount,...a}=e,s=i2(h2,e.__scopeMenu),l=s2(h2,e.__scopeMenu),c=V2(H2,e.__scopeMenu),u=i.useRef(null),d=XU(n,u);return t.jsx(Z1.Provider,{scope:e.__scopeMenu,children:t.jsx(T1,{present:o||s.open,children:t.jsx(Z1.Slot,{scope:e.__scopeMenu,children:t.jsx(x2,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:FQ(e.onFocusOutside,(e=>{e.target!==c.trigger&&s.onOpenChange(!1)})),onEscapeKeyDown:FQ(e.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:FQ(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=Y1[l.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())}))})})})})}));function G2(e){return e?"open":"closed"}function K2(e){return"indeterminate"===e}function W2(e){return K2(e)?"indeterminate":e?"checked":"unchecked"}function Y2(e){return t=>"mouse"===t.pointerType?e(t):void 0}q2.displayName=H2;var X2=l2,Z2=c2,Q2=f2,J2=v2,e3=w2,t3=_2,n3=T2,r3=A2,o3=P2,i3=M2,a3=I2,s3=F2,l3=U2,c3=z2,u3=q2,d3="DropdownMenu",[p3,f3]=UQ(d3,[t2]),h3=t2(),[m3,g3]=p3(d3),v3=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:a,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,u=h3(n),d=i.useRef(null),[p=!1,f]=BQ({prop:a,defaultProp:s,onChange:l});return t.jsx(m3,{scope:n,triggerId:EJ(),triggerRef:d,contentId:EJ(),open:p,onOpenChange:f,onOpenToggle:i.useCallback((()=>f((e=>!e))),[f]),modal:c,children:t.jsx(X2,{...u,open:p,onOpenChange:f,dir:o,modal:c,children:r})})};v3.displayName=d3;var y3="DropdownMenuTrigger",b3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,a=g3(y3,r),s=h3(r);return t.jsx(Z2,{asChild:!0,...s,children:t.jsx(WQ.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:YU(n,a.triggerRef),onPointerDown:FQ(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(a.onOpenToggle(),a.open||e.preventDefault())})),onKeyDown:FQ(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));b3.displayName=y3;var x3=e=>{const{__scopeDropdownMenu:n,...r}=e,o=h3(n);return t.jsx(Q2,{...o,...r})};x3.displayName="DropdownMenuPortal";var w3="DropdownMenuContent",_3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,a=g3(w3,r),s=h3(r),l=i.useRef(!1);return t.jsx(J2,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...o,ref:n,onCloseAutoFocus:FQ(e.onCloseAutoFocus,(e=>{l.current||a.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:FQ(e.onInteractOutside,(e=>{const t=e.detail.originalEvent;a.modal&&!(2===t.button||0===t.button&&!0===t.ctrlKey)||(l.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));_3.displayName=w3;i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(e3,{...i,...o,ref:n})})).displayName="DropdownMenuGroup";var S3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(t3,{...i,...o,ref:n})}));S3.displayName="DropdownMenuLabel";var E3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(n3,{...i,...o,ref:n})}));E3.displayName="DropdownMenuItem";var T3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(r3,{...i,...o,ref:n})}));T3.displayName="DropdownMenuCheckboxItem";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(o3,{...i,...o,ref:n})})).displayName="DropdownMenuRadioGroup";var C3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(i3,{...i,...o,ref:n})}));C3.displayName="DropdownMenuRadioItem";var A3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(a3,{...i,...o,ref:n})}));A3.displayName="DropdownMenuItemIndicator";var N3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(s3,{...i,...o,ref:n})}));N3.displayName="DropdownMenuSeparator";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(l3,{...i,...o,ref:n})})).displayName="DropdownMenuArrow";var R3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(c3,{...i,...o,ref:n})}));R3.displayName="DropdownMenuSubTrigger";var O3=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=h3(r);return t.jsx(u3,{...i,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));O3.displayName="DropdownMenuSubContent";var P3=x3,k3=_3,M3=S3,j3=E3,L3=T3,D3=C3,I3=A3,F3=N3,U3=R3,$3=O3;const V3=v3,B3=b3;i.forwardRef((({className:e,inset:n,children:r,...o},i)=>t.jsxs(U3,{ref:i,className:Zd("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[r,t.jsx(mu,{className:"ml-auto"})]}))).displayName=U3.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx($3,{ref:r,className:Zd("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}))).displayName=$3.displayName;const z3=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(P3,{children:t.jsx(k3,{ref:o,sideOffset:n,className:Zd("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})));z3.displayName=k3.displayName;const H3=i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(j3,{ref:o,className:Zd("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r})));H3.displayName=j3.displayName;i.forwardRef((({className:e,children:n,checked:r,...o},i)=>t.jsxs(L3,{ref:i,className:Zd("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(I3,{children:t.jsx(pu,{className:"h-4 w-4"})})}),n]}))).displayName=L3.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(D3,{ref:o,className:Zd("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(I3,{children:t.jsx(wu,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=D3.displayName;i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(M3,{ref:o,className:Zd("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}))).displayName=M3.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(F3,{ref:r,className:Zd("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=F3.displayName;const q3=i.forwardRef((({className:e,type:n,...r},o)=>t.jsx("input",{type:n,className:Zd("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...r})));function G3({data:e,columns:t,enableDebug:r=!1,paginationMode:o="none",initialPageSize:a=10,initialPageIndex:s=0,cursorPaginationQueryResult:l,onQueryParametersChange:c,manualPageCount:u}){const d=n.useMemo((()=>e),[e]),p=n.useMemo((()=>t),[t]),f="cursor"===o,h=l,[m,g]=n.useState(s),[v,y]=n.useState([void 0]),[b,x]=n.useState(a);n.useEffect((()=>{if(f&&h){const{isLoading:e,isFetching:t,isPlaceholderData:n,nextCursor:r}=h;e||t||n||!r||""===r?e||t||n||r&&""!==r||!(v.length>m+1)||y((e=>e.slice(0,m+1))):v.length===m+1&&y((e=>[...e,r]))}}),[f,h,m,v]);const w=n.useCallback((()=>{f&&(g(s),y([void 0]),x(a),c&&c({cursor:void 0,pageSize:a}))}),[f,c,a,s]),[_,S]=n.useState({pageIndex:f?m:s,pageSize:b});n.useEffect((()=>{f&&_.pageIndex!==m&&S((e=>({...e,pageIndex:m})))}),[m,_.pageIndex,f]);const E=n.useCallback((e=>{if(!f||!c)return;let t,n=m,r=b;"object"==typeof e?(r=e.newPageSize,n=0,x(r),g(n),y([void 0]),c({cursor:void 0,pageSize:r})):"prev"===e?(n=Math.max(m-1,0),t=v[n],g(n),c({cursor:t,pageSize:b})):"next"===e&&h&&h.nextCursor&&""!==h.nextCursor&&(n=m+1,t=h.nextCursor,g(n),c({cursor:t,pageSize:b}))}),[f,c,m,v,b,h]),T=f&&m>0,C=!!(f&&h&&h.nextCursor&&""!==h.nextCursor),[A,N]=n.useState(""),R=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=i.useState((()=>({current:LQ(t)}))),[r,o]=i.useState((()=>n.current.initialState));return n.current.setOptions((t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{o(t),null==e.onStateChange||e.onStateChange(t)}}))),n.current}({data:d,columns:p,state:{globalFilter:A,pagination:_},getCoreRowModel:e=>QZ((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(t,o,i){void 0===o&&(o=0);const a=[];for(let l=0;l<t.length;l++){const c=oQ(e,e._getRowId(t[l],l,i),t[l],l,o,0,null==i?void 0:i.id);var s;n.flatRows.push(c),n.rowsById[c.id]=c,a.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[l],l),null!=(s=c.originalSubRows)&&s.length&&(c.subRows=r(c.originalSubRows,o+1,c)))}return a};return n.rows=r(t),n}),JZ(e.options,"debugTable","getRowModel",(()=>e._autoResetPageIndex()))),getFilteredRowModel:e=>QZ((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,r)=>{if(!t.rows.length||(null==n||!n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],i=[];(null!=n?n:[]).forEach((t=>{var n;const r=e.getColumn(t.id);if(!r)return;const i=r.getFilterFn();i?o.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value}):process}));const a=(null!=n?n:[]).map((e=>e.id)),s=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let c,u;r&&s&&l.length&&(a.push("__global__"),l.forEach((e=>{var t;i.push({id:e.id,filterFn:s,resolvedValue:null!=(t=null==s.resolveFilterValue?void 0:s.resolveFilterValue(r))?t:r})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){c=o[e];const t=c.id;n.columnFilters[t]=c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){u=i[e];const t=u.id;if(u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return DQ(t.rows,(e=>{for(let t=0;t<a.length;t++)if(!1===e.columnFilters[a[t]])return!1;return!0}),e)}),JZ(e.options,"debugTable","getFilteredRowModel",(()=>e._autoResetPageIndex()))),onGlobalFilterChange:N,onPaginationChange:S,..."standard"===o&&{getPaginationRowModel:e=>QZ((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:r,pageIndex:o}=t;let{rows:i,flatRows:a,rowsById:s}=n;const l=r*o;let c;i=i.slice(l,l+r),c=e.options.paginateExpandedRows?{rows:i,flatRows:a,rowsById:s}:function(e){const t=[],n=e=>{var r;t.push(e),null!=(r=e.subRows)&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}({rows:i,flatRows:a,rowsById:s}),c.flatRows=[];const u=e=>{c.flatRows.push(e),e.subRows.length&&e.subRows.forEach(u)};return c.rows.forEach(u),c}),JZ(e.options,"debugTable","getPaginationRowModel")),pageCount:void 0!==u?u:void 0},...f&&{manualPagination:!0,pageCount:void 0!==u?u:-1},debugTable:r,debugHeaders:r,debugColumns:r});n.useEffect((()=>{!f&&R&&R.getState().pagination.pageIndex!==s&&R.setPageIndex(s)}),[s,R,f]),n.useEffect((()=>{R&&R.getState().pagination.pageSize!==b&&R.setPageSize(b)}),[b,R]);const O=f?v[m]:void 0;return{...R,setGlobalFilter:N,globalFilter:A,...f&&{currentApiCursor:O,handleCursorNavigation:E,canGoPreviousForCursor:T,canGoNextForCursor:C,resetCursorPagination:w,logicalPage:m}}}function K3({data:e,columns:r,enableDebug:o=!1,paginationMode:i="none",initialPageSize:a=10,initialPageIndex:s=0,headerActions:l,isLoading:c=!1,cursorPaginationQueryResult:u,onQueryParametersChange:d,searchValue:p,onSearchChange:f,onRowClick:h}){const m=G3({data:e??[],columns:r,enableDebug:o,paginationMode:i,initialPageSize:a,initialPageIndex:s,cursorPaginationQueryResult:u,onQueryParametersChange:d}),g=n.useRef(null),[v,y]=n.useState(!1),b="standard"===i,x="cursor"===i,w=x?m.canGoPreviousForCursor??!1:m.getCanPreviousPage(),_=x?m.canGoNextForCursor??!1:m.getCanNextPage(),S=!b&&!x||c?null:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(vZ,{"data-testid":"previous-button",variant:"outline",size:"sm",className:"bg-card",onClick:()=>{x&&m.handleCursorNavigation?m.handleCursorNavigation("prev"):m.previousPage()},disabled:!w||c,children:t.jsx(hu,{className:"h-4 w-4 mr-1"})}),b&&t.jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",m.getState().pagination.pageIndex+1," of"," ",-1===m.getPageCount()?"many":m.getPageCount()]}),t.jsx(vZ,{"data-testid":"next-button",variant:"outline",size:"sm",className:"bg-card",onClick:()=>{x&&m.handleCursorNavigation?m.handleCursorNavigation("next"):m.nextPage()},disabled:!_||c,children:t.jsx(mu,{className:"h-4 w-4 ml-1"})}),t.jsxs(V3,{children:[t.jsx(B3,{asChild:!0,children:t.jsxs(vZ,{variant:"outline",size:"sm",className:"bg-card",disabled:c,children:[m.getState().pagination.pageSize," rows",t.jsx(fu,{className:"ml-1 h-4 w-4"})]})}),t.jsx(z3,{align:"end",children:[5,10,20,30,50].map((e=>t.jsxs(H3,{onClick:()=>{x&&m.handleCursorNavigation?m.handleCursorNavigation({newPageSize:e}):m.setPageSize(e)},children:[e," rows"]},e)))})]})]}),E=()=>t.jsxs(zZ,{className:"flex-grow min-h-0 relative",children:[t.jsx(HZ,{className:Zd("sticky top-0 z-10",v&&"shadow-md border-b border-slate-200"),children:m.getHeaderGroups().map((e=>t.jsx(GZ,{children:e.headers.map((e=>t.jsx(KZ,{colSpan:e.colSpan,children:e.isPlaceholder?null:IQ(e.column.columnDef.header,e.getContext())},e.id)))},e.id)))}),t.jsx(qZ,{children:m.getRowModel().rows.length?m.getRowModel().rows.map((e=>t.jsx(GZ,{className:Zd("rounded-b-md",h&&"cursor-pointer hover:bg-muted/90 transition-colors"),"data-state":e.getIsSelected()&&"selected",onClick:()=>h?.(e.original),children:e.getVisibleCells().map((e=>t.jsx(WZ,{children:IQ(e.column.columnDef.cell,e.getContext())},e.id)))},e.id))):t.jsx(GZ,{children:t.jsx(WZ,{colSpan:r.length,className:"h-24 text-center",children:"No results found"})})})]}),T=()=>t.jsx("div",{className:"h-full w-full flex items-center justify-center",children:t.jsx(hZ,{})});return t.jsxs("div",{className:"flex flex-col h-full border rounded-lg shadow-sm hover:shadow-md transition-shadow duration-300 overflow-hidden",children:[t.jsxs("div",{className:"flex flex-col items-start gap-3 py-4 px-2 sticky top-0 z-20 bg-primary/5 border-b rounded-t-md md:flex-row md:items-center md:justify-between",children:[t.jsx("div",{className:"md:w-1/4",children:t.jsx(q3,{placeholder:"Search...",value:p??m.getState().globalFilter??"",onChange:e=>{const t=e.target.value;f?f(t):m.setGlobalFilter(t)},className:"max-w-sm bg-card",disabled:c})}),t.jsxs("div",{className:"flex items-center space-x-4",children:[S,l&&t.jsx("div",{children:l})]})]}),t.jsx("div",{ref:g,className:"w-full overflow-x-auto h-full",onScroll:()=>{g.current&&y(g.current.scrollTop>0)},children:t.jsx(c?T:E,{})}),o&&t.jsx("div",{className:"mt-4",children:t.jsx("pre",{className:"p-2 bg-gray-50 text-xs overflow-x-auto",children:t.jsx("code",{children:JSON.stringify(m.getState(),null,2)})})})]})}q3.displayName="Input";var W3={};Object.defineProperty(W3,"__esModule",{value:!0}),W3.parse=function(e,t){const n=new e5,r=e.length;if(r<2)return n;const o=t?.decode||r5;let i=0;do{const t=e.indexOf("=",i);if(-1===t)break;const a=e.indexOf(";",i),s=-1===a?r:a;if(t>s){i=e.lastIndexOf(";",t-1)+1;continue}const l=t5(e,i,t),c=n5(e,t,l),u=e.slice(l,c);if(void 0===n[u]){let r=t5(e,t+1,s),i=n5(e,s,r);const a=o(e.slice(r,i));n[u]=a}i=s+1}while(i<r);return n},W3.serialize=function(e,t,n){const r=n?.encode||encodeURIComponent;if(!Y3.test(e))throw new TypeError(`argument name is invalid: ${e}`);const o=r(t);if(!X3.test(o))throw new TypeError(`argument val is invalid: ${t}`);let i=e+"="+o;if(!n)return i;if(void 0!==n.maxAge){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);i+="; Max-Age="+n.maxAge}if(n.domain){if(!Z3.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);i+="; Domain="+n.domain}if(n.path){if(!Q3.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);i+="; Path="+n.path}if(n.expires){if(!function(e){return"[object Date]"===J3.call(e)}
|
|
76
76
|
/**
|
|
77
77
|
* react-router v7.5.2
|
|
78
78
|
*
|