react-semaphor 0.0.480 → 0.0.481
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.
|
@@ -348,7 +348,7 @@ Valid keys: `+JSON.stringify(Object.keys(N),null," "));var Q=te(U,J,V,q,Y+"."+J
|
|
|
348
348
|
`)},PP=function(){var e=parseInt(document.body.getAttribute(uc)||"0",10);return isFinite(e)?e:0},Soe=function(){w.useEffect(function(){return document.body.setAttribute(uc,(PP()+1).toString()),function(){var e=PP()-1;e<=0?document.body.removeAttribute(uc):document.body.setAttribute(uc,e.toString())}},[])},Coe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Soe();var i=w.useMemo(function(){return voe(o)},[o]);return w.createElement(xoe,{styles:woe(i,!t,o,n?"":"!important")})},mw=!1;if(typeof window<"u")try{var wp=Object.defineProperty({},"passive",{get:function(){return mw=!0,!0}});window.addEventListener("test",wp,wp),window.removeEventListener("test",wp,wp)}catch{mw=!1}var jl=mw?{passive:!1}:!1,_oe=function(e){return e.tagName==="TEXTAREA"},oj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_oe(e)&&n[t]==="visible")},Eoe=function(e){return oj(e,"overflowY")},Roe=function(e){return oj(e,"overflowX")},MP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ij(e,r);if(o){var i=sj(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},koe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Poe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ij=function(e,t){return e==="v"?Eoe(t):Roe(t)},sj=function(e,t){return e==="v"?koe(t):Poe(t)},Moe=function(e,t){return e==="h"&&t==="rtl"?-1:1},Doe=function(e,t,n,r,o){var i=Moe(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var h=sj(e,a),g=h[0],m=h[1],b=h[2],y=m-b-i*g;(g||y)&&ij(e,a)&&(d+=y,f+=g),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(c=!0),c},Sp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},DP=function(e){return[e.deltaX,e.deltaY]},NP=function(e){return e&&"current"in e?e.current:e},Noe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Aoe=function(e){return`
|
|
349
349
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
350
350
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
351
|
-
`)},Ooe=0,Fl=[];function Toe(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(Ooe++)[0],i=w.useState(rj)[0],s=w.useRef(e);w.useEffect(function(){s.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=toe([e.lockRef.current],(e.shards||[]).map(NP),!0).filter(Boolean);return m.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=w.useCallback(function(m,b){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var y=Sp(m),v=n.current,x="deltaX"in m?m.deltaX:v[0]-y[0],_="deltaY"in m?m.deltaY:v[1]-y[1],E,S=m.target,C=Math.abs(x)>Math.abs(_)?"h":"v";if("touches"in m&&C==="h"&&S.type==="range")return!1;var k=MP(C,S);if(!k)return!0;if(k?E=C:(E=C==="v"?"h":"v",k=MP(C,S)),!k)return!1;if(!r.current&&"changedTouches"in m&&(x||_)&&(r.current=E),!E)return!0;var D=r.current||E;return Doe(D,b,m,D==="h"?x:_)},[]),l=w.useCallback(function(m){var b=m;if(!(!Fl.length||Fl[Fl.length-1]!==i)){var y="deltaY"in b?DP(b):Sp(b),v=t.current.filter(function(E){return E.name===b.type&&(E.target===b.target||b.target===E.shadowParent)&&Noe(E.delta,y)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var x=(s.current.shards||[]).map(NP).filter(Boolean).filter(function(E){return E.contains(b.target)}),_=x.length>0?a(b,x[0]):!s.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),c=w.useCallback(function(m,b,y,v){var x={name:m,delta:b,target:y,should:v,shadowParent:Ioe(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(_){return _!==x})},1)},[]),u=w.useCallback(function(m){n.current=Sp(m),r.current=void 0},[]),d=w.useCallback(function(m){c(m.type,DP(m),m.target,a(m,e.lockRef.current))},[]),f=w.useCallback(function(m){c(m.type,Sp(m),m.target,a(m,e.lockRef.current))},[]);w.useEffect(function(){return Fl.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,jl),document.addEventListener("touchmove",l,jl),document.addEventListener("touchstart",u,jl),function(){Fl=Fl.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,jl),document.removeEventListener("touchmove",l,jl),document.removeEventListener("touchstart",u,jl)}},[]);var h=e.removeScrollBar,g=e.inert;return w.createElement(w.Fragment,null,g?w.createElement(i,{styles:Aoe(o)}):null,h?w.createElement(Coe,{gapMode:e.gapMode}):null)}function Ioe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const joe=uoe(nj,Toe);var nh=w.forwardRef(function(e,t){return w.createElement(Pb,Vo({},e,{ref:t,sideCar:joe}))});nh.classNames=Pb.classNames;var Foe=[" ","Enter","ArrowUp","ArrowDown"],Loe=[" ","Enter"],rh="Select",[Mb,Db,$oe]=Im(rh),[mu,eke]=Rn(rh,[$oe,hi]),Nb=hi(),[zoe,Ws]=mu(rh),[Boe,Voe]=mu(rh),aj=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:h,form:g}=e,m=Nb(t),[b,y]=w.useState(null),[v,x]=w.useState(null),[_,E]=w.useState(!1),S=bl(c),[C=!1,k]=Xn({prop:r,defaultProp:o,onChange:i}),[D,M]=Xn({prop:s,defaultProp:a,onChange:l}),O=w.useRef(null),T=b?g||!!b.closest("form"):!0,[L,F]=w.useState(new Set),A=Array.from(L).map(I=>I.props.value).join(";");return p.jsx(Xf,{...m,children:p.jsxs(zoe,{required:h,scope:t,trigger:b,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:_,onValueNodeHasChildrenChange:E,contentId:xn(),value:D,onValueChange:M,open:C,onOpenChange:k,dir:S,triggerPointerDownPosRef:O,disabled:f,children:[p.jsx(Mb.Provider,{scope:t,children:p.jsx(Boe,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(I=>{F(j=>new Set(j).add(I))},[]),onNativeOptionRemove:w.useCallback(I=>{F(j=>{const z=new Set(j);return z.delete(I),z})},[]),children:n})}),T?p.jsxs(Oj,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:D,onChange:I=>M(I.target.value),disabled:f,form:g,children:[D===void 0?p.jsx("option",{value:""}):null,Array.from(L)]},A):null]})})};aj.displayName=rh;var lj="SelectTrigger",cj=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Nb(n),s=Ws(lj,n),a=s.disabled||r,l=je(t,s.onTriggerChange),c=Db(n),u=w.useRef("touch"),[d,f,h]=Tj(m=>{const b=c().filter(x=>!x.disabled),y=b.find(x=>x.value===s.value),v=Ij(b,m,y);v!==void 0&&s.onValueChange(v.value)}),g=m=>{a||(s.onOpenChange(!0),h()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return p.jsx(gu,{asChild:!0,...i,children:p.jsx(xe.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Aj(s.value)?"":void 0,...o,ref:l,onClick:fe(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&g(m)}),onPointerDown:fe(o.onPointerDown,m=>{u.current=m.pointerType;const b=m.target;b.hasPointerCapture(m.pointerId)&&b.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:fe(o.onKeyDown,m=>{const b=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(b&&m.key===" ")&&Foe.includes(m.key)&&(g(),m.preventDefault())})})})});cj.displayName=lj;var uj="SelectValue",dj=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Ws(uj,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=je(t,l.onValueNodeChange);return Ln(()=>{c(u)},[c,u]),p.jsx(xe.span,{...a,ref:d,style:{pointerEvents:"none"},children:Aj(l.value)?p.jsx(p.Fragment,{children:s}):i})});dj.displayName=uj;var Hoe="SelectIcon",fj=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return p.jsx(xe.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});fj.displayName=Hoe;var Woe="SelectPortal",hj=e=>p.jsx(Jf,{asChild:!0,...e});hj.displayName=Woe;var al="SelectContent",pj=w.forwardRef((e,t)=>{const n=Ws(al,e.__scopeSelect),[r,o]=w.useState();if(Ln(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Ya.createPortal(p.jsx(gj,{scope:e.__scopeSelect,children:p.jsx(Mb.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),i):null}return p.jsx(mj,{...e,ref:t})});pj.displayName=al;var fo=10,[gj,Us]=mu(al),Uoe="SelectContentImpl",mj=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:m,avoidCollisions:b,...y}=e,v=Ws(al,n),[x,_]=w.useState(null),[E,S]=w.useState(null),C=je(t,U=>_(U)),[k,D]=w.useState(null),[M,O]=w.useState(null),T=Db(n),[L,F]=w.useState(!1),A=w.useRef(!1);w.useEffect(()=>{if(x)return kb(x)},[x]),Eb();const I=w.useCallback(U=>{const[G,...X]=T().map(Q=>Q.ref.current),[J]=X.slice(-1),te=document.activeElement;for(const Q of U)if(Q===te||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===G&&E&&(E.scrollTop=0),Q===J&&E&&(E.scrollTop=E.scrollHeight),Q==null||Q.focus(),document.activeElement!==te))return},[T,E]),j=w.useCallback(()=>I([k,x]),[I,k,x]);w.useEffect(()=>{L&&j()},[L,j]);const{onOpenChange:z,triggerPointerDownPosRef:B}=v;w.useEffect(()=>{if(x){let U={x:0,y:0};const G=J=>{var te,Q;U={x:Math.abs(Math.round(J.pageX)-(((te=B.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(J.pageY)-(((Q=B.current)==null?void 0:Q.y)??0))}},X=J=>{U.x<=10&&U.y<=10?J.preventDefault():x.contains(J.target)||z(!1),document.removeEventListener("pointermove",G),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",X,{capture:!0})}}},[x,z,B]),w.useEffect(()=>{const U=()=>z(!1);return window.addEventListener("blur",U),window.addEventListener("resize",U),()=>{window.removeEventListener("blur",U),window.removeEventListener("resize",U)}},[z]);const[N,W]=Tj(U=>{const G=T().filter(te=>!te.disabled),X=G.find(te=>te.ref.current===document.activeElement),J=Ij(G,U,X);J&&setTimeout(()=>J.ref.current.focus())}),$=w.useCallback((U,G,X)=>{const J=!A.current&&!X;(v.value!==void 0&&v.value===G||J)&&(D(U),J&&(A.current=!0))},[v.value]),P=w.useCallback(()=>x==null?void 0:x.focus(),[x]),V=w.useCallback((U,G,X)=>{const J=!A.current&&!X;(v.value!==void 0&&v.value===G||J)&&O(U)},[v.value]),q=r==="popper"?bw:bj,Y=q===bw?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:m,avoidCollisions:b}:{};return p.jsx(gj,{scope:n,content:x,viewport:E,onViewportChange:S,itemRefCallback:$,selectedItem:k,onItemLeave:P,itemTextRefCallback:V,focusSelectedItem:j,selectedItemText:M,position:r,isPositioned:L,searchRef:N,children:p.jsx(nh,{as:ZI,allowPinchZoom:!0,children:p.jsx(th,{asChild:!0,trapped:v.open,onMountAutoFocus:U=>{U.preventDefault()},onUnmountAutoFocus:fe(o,U=>{var G;(G=v.trigger)==null||G.focus({preventScroll:!0}),U.preventDefault()}),children:p.jsx(wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:U=>U.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:p.jsx(q,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:U=>U.preventDefault(),...y,...Y,onPlaced:()=>F(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:fe(y.onKeyDown,U=>{const G=U.ctrlKey||U.altKey||U.metaKey;if(U.key==="Tab"&&U.preventDefault(),!G&&U.key.length===1&&W(U.key),["ArrowUp","ArrowDown","Home","End"].includes(U.key)){let J=T().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(U.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(U.key)){const te=U.target,Q=J.indexOf(te);J=J.slice(Q+1)}setTimeout(()=>I(J)),U.preventDefault()}})})})})})})});mj.displayName=Uoe;var qoe="SelectItemAlignedPosition",bj=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Ws(al,n),s=Us(al,n),[a,l]=w.useState(null),[c,u]=w.useState(null),d=je(t,C=>u(C)),f=Db(n),h=w.useRef(!1),g=w.useRef(!0),{viewport:m,selectedItem:b,selectedItemText:y,focusSelectedItem:v}=s,x=w.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&m&&b&&y){const C=i.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),M=y.getBoundingClientRect();if(i.dir!=="rtl"){const te=M.left-k.left,Q=D.left-te,ie=C.left-Q,ee=C.width+ie,de=Math.max(ee,k.width),he=window.innerWidth-fo,ue=pw(Q,[fo,Math.max(fo,he-de)]);a.style.minWidth=ee+"px",a.style.left=ue+"px"}else{const te=k.right-M.right,Q=window.innerWidth-D.right-te,ie=window.innerWidth-C.right-Q,ee=C.width+ie,de=Math.max(ee,k.width),he=window.innerWidth-fo,ue=pw(Q,[fo,Math.max(fo,he-de)]);a.style.minWidth=ee+"px",a.style.right=ue+"px"}const O=f(),T=window.innerHeight-fo*2,L=m.scrollHeight,F=window.getComputedStyle(c),A=parseInt(F.borderTopWidth,10),I=parseInt(F.paddingTop,10),j=parseInt(F.borderBottomWidth,10),z=parseInt(F.paddingBottom,10),B=A+I+L+z+j,N=Math.min(b.offsetHeight*5,B),W=window.getComputedStyle(m),$=parseInt(W.paddingTop,10),P=parseInt(W.paddingBottom,10),V=C.top+C.height/2-fo,q=T-V,Y=b.offsetHeight/2,U=b.offsetTop+Y,G=A+I+U,X=B-G;if(G<=V){const te=O.length>0&&b===O[O.length-1].ref.current;a.style.bottom="0px";const Q=c.clientHeight-m.offsetTop-m.offsetHeight,ie=Math.max(q,Y+(te?P:0)+Q+j),ee=G+ie;a.style.height=ee+"px"}else{const te=O.length>0&&b===O[0].ref.current;a.style.top="0px";const ie=Math.max(V,A+m.offsetTop+(te?$:0)+Y)+X;a.style.height=ie+"px",m.scrollTop=G-V+m.offsetTop}a.style.margin=`${fo}px 0`,a.style.minHeight=N+"px",a.style.maxHeight=T+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,a,c,m,b,y,i.dir,r]);Ln(()=>x(),[x]);const[_,E]=w.useState();Ln(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const S=w.useCallback(C=>{C&&g.current===!0&&(x(),v==null||v(),g.current=!1)},[x,v]);return p.jsx(Yoe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:S,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:p.jsx(xe.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});bj.displayName=qoe;var Goe="SelectPopperPosition",bw=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=fo,...i}=e,s=Nb(n);return p.jsx(Qf,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});bw.displayName=Goe;var[Yoe,kC]=mu(al,{}),yw="SelectViewport",yj=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Us(yw,n),s=kC(yw,n),a=je(t,i.onViewportChange),l=w.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),p.jsx(Mb.Slot,{scope:n,children:p.jsx(xe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:fe(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=s;if(f!=null&&f.current&&d){const h=Math.abs(l.current-u.scrollTop);if(h>0){const g=window.innerHeight-fo*2,m=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),y=Math.max(m,b);if(y<g){const v=y+h,x=Math.min(g,v),_=v-x;d.style.height=x+"px",d.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});yj.displayName=yw;var vj="SelectGroup",[Koe,Xoe]=mu(vj),xj=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=xn();return p.jsx(Koe,{scope:n,id:o,children:p.jsx(xe.div,{role:"group","aria-labelledby":o,...r,ref:t})})});xj.displayName=vj;var wj="SelectLabel",Sj=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Xoe(wj,n);return p.jsx(xe.div,{id:o.id,...r,ref:t})});Sj.displayName=wj;var Jg="SelectItem",[Qoe,Cj]=mu(Jg),_j=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Ws(Jg,n),l=Us(Jg,n),c=a.value===r,[u,d]=w.useState(i??""),[f,h]=w.useState(!1),g=je(t,v=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,v,r,o)}),m=xn(),b=w.useRef("touch"),y=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(Qoe,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:w.useCallback(v=>{d(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:p.jsx(Mb.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:p.jsx(xe.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:g,onFocus:fe(s.onFocus,()=>h(!0)),onBlur:fe(s.onBlur,()=>h(!1)),onClick:fe(s.onClick,()=>{b.current!=="mouse"&&y()}),onPointerUp:fe(s.onPointerUp,()=>{b.current==="mouse"&&y()}),onPointerDown:fe(s.onPointerDown,v=>{b.current=v.pointerType}),onPointerMove:fe(s.onPointerMove,v=>{var x;b.current=v.pointerType,o?(x=l.onItemLeave)==null||x.call(l):b.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fe(s.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:fe(s.onKeyDown,v=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&v.key===" "||(Loe.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});_j.displayName=Jg;var dd="SelectItemText",Ej=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Ws(dd,n),a=Us(dd,n),l=Cj(dd,n),c=Voe(dd,n),[u,d]=w.useState(null),f=je(t,y=>d(y),l.onItemTextChange,y=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,y,l.value,l.disabled)}),h=u==null?void 0:u.textContent,g=w.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:b}=c;return Ln(()=>(m(g),()=>b(g)),[m,b,g]),p.jsxs(p.Fragment,{children:[p.jsx(xe.span,{id:l.textId,...i,ref:f}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ya.createPortal(i.children,s.valueNode):null]})});Ej.displayName=dd;var Rj="SelectItemIndicator",kj=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Cj(Rj,n).isSelected?p.jsx(xe.span,{"aria-hidden":!0,...r,ref:t}):null});kj.displayName=Rj;var vw="SelectScrollUpButton",Pj=w.forwardRef((e,t)=>{const n=Us(vw,e.__scopeSelect),r=kC(vw,e.__scopeSelect),[o,i]=w.useState(!1),s=je(t,r.onScrollButtonChange);return Ln(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?p.jsx(Dj,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Pj.displayName=vw;var xw="SelectScrollDownButton",Mj=w.forwardRef((e,t)=>{const n=Us(xw,e.__scopeSelect),r=kC(xw,e.__scopeSelect),[o,i]=w.useState(!1),s=je(t,r.onScrollButtonChange);return Ln(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?p.jsx(Dj,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});Mj.displayName=xw;var Dj=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Us("SelectScrollButton",n),s=w.useRef(null),a=Db(n),l=w.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),Ln(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),p.jsx(xe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:fe(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:fe(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:fe(o.onPointerLeave,()=>{l()})})}),Zoe="SelectSeparator",Nj=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(xe.div,{"aria-hidden":!0,...r,ref:t})});Nj.displayName=Zoe;var ww="SelectArrow",Joe=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Nb(n),i=Ws(ww,n),s=Us(ww,n);return i.open&&s.position==="popper"?p.jsx(Zf,{...o,...r,ref:t}):null});Joe.displayName=ww;function Aj(e){return e===""||e===void 0}var Oj=w.forwardRef((e,t)=>{const{value:n,...r}=e,o=w.useRef(null),i=je(t,o),s=Rb(n);return w.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[s,n]),p.jsx(hC,{asChild:!0,children:p.jsx("select",{...r,ref:i,defaultValue:n})})});Oj.displayName="BubbleSelect";function Tj(e){const t=En(e),n=w.useRef(""),r=w.useRef(0),o=w.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Ij(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=eie(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function eie(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tie=aj,jj=cj,nie=dj,rie=fj,oie=hj,Fj=pj,iie=yj,sie=xj,Lj=Sj,$j=_j,aie=Ej,lie=kj,zj=Pj,Bj=Mj,Vj=Nj;const tn=tie,ql=sie,nn=nie,Xt=w.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(jj,{ref:r,className:se("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,p.jsx(rie,{asChild:!0,children:p.jsx(Cs,{className:"h-4 w-4 opacity-50"})})]}));Xt.displayName=jj.displayName;const Hj=w.forwardRef(({className:e,...t},n)=>p.jsx(zj,{ref:n,className:se("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(md,{className:"h-4 w-4"})}));Hj.displayName=zj.displayName;const Wj=w.forwardRef(({className:e,...t},n)=>p.jsx(Bj,{ref:n,className:se("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(Cs,{className:"h-4 w-4"})}));Wj.displayName=Bj.displayName;const Qt=w.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>p.jsx(oie,{children:p.jsx(zs,{children:p.jsxs(Fj,{ref:o,className:se("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover 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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[p.jsx(Hj,{}),p.jsx(iie,{className:se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),p.jsx(Wj,{})]})})}));Qt.displayName=Fj.displayName;const pa=w.forwardRef(({className:e,...t},n)=>p.jsx(Lj,{ref:n,className:se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));pa.displayName=Lj.displayName;const Se=w.forwardRef(({className:e,children:t,...n},r)=>p.jsxs($j,{ref:r,className:se("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(lie,{children:p.jsx(ei,{className:"h-4 w-4"})})}),p.jsx(aie,{children:t})]}));Se.displayName=$j.displayName;const Md=w.forwardRef(({className:e,...t},n)=>p.jsx(Vj,{ref:n,className:se("-mx-1 my-1 h-px bg-muted",e),...t}));Md.displayName=Vj.displayName;const dc=w.forwardRef(({className:e,type:t,...n},r)=>p.jsx("input",{type:t,className:se("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));dc.displayName="Input";var Uj=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(uie);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return p.jsx(Sw,{...r,ref:t,children:w.isValidElement(s)?w.cloneElement(s,void 0,a):null})}return p.jsx(Sw,{...r,ref:t,children:n})});Uj.displayName="Slot";var Sw=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const o=fie(n),i=die(r,n.props);return n.type!==w.Fragment&&(i.ref=t?Po(t,o):o),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});Sw.displayName="SlotClone";var cie=({children:e})=>p.jsx(p.Fragment,{children:e});function uie(e){return w.isValidElement(e)&&e.type===cie}function die(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]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function fie(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var PC="Popover",[qj,tke]=Rn(PC,[hi]),oh=hi(),[hie,qs]=qj(PC),Gj=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=oh(t),l=w.useRef(null),[c,u]=w.useState(!1),[d=!1,f]=Xn({prop:r,defaultProp:o,onChange:i});return p.jsx(Xf,{...a,children:p.jsx(hie,{scope:t,contentId:xn(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:w.useCallback(()=>u(!0),[]),onCustomAnchorRemove:w.useCallback(()=>u(!1),[]),modal:s,children:n})})};Gj.displayName=PC;var Yj="PopoverAnchor",pie=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=qs(Yj,n),i=oh(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return w.useEffect(()=>(s(),()=>a()),[s,a]),p.jsx(gu,{...i,...r,ref:t})});pie.displayName=Yj;var Kj="PopoverTrigger",Xj=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=qs(Kj,n),i=oh(n),s=je(t,o.triggerRef),a=p.jsx(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":t4(o.open),...r,ref:s,onClick:fe(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:p.jsx(gu,{asChild:!0,...i,children:a})});Xj.displayName=Kj;var MC="PopoverPortal",[gie,mie]=qj(MC,{forceMount:void 0}),Qj=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=qs(MC,t);return p.jsx(gie,{scope:t,forceMount:n,children:p.jsx(Sn,{present:n||i.open,children:p.jsx(Jf,{asChild:!0,container:o,children:r})})})};Qj.displayName=MC;var Xc="PopoverContent",Zj=w.forwardRef((e,t)=>{const n=mie(Xc,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=qs(Xc,e.__scopePopover);return p.jsx(Sn,{present:r||i.open,children:i.modal?p.jsx(bie,{...o,ref:t}):p.jsx(yie,{...o,ref:t})})});Zj.displayName=Xc;var bie=w.forwardRef((e,t)=>{const n=qs(Xc,e.__scopePopover),r=w.useRef(null),o=je(t,r),i=w.useRef(!1);return w.useEffect(()=>{const s=r.current;if(s)return kb(s)},[]),p.jsx(nh,{as:Uj,allowPinchZoom:!0,children:p.jsx(Jj,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:fe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:fe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),yie=w.forwardRef((e,t)=>{const n=qs(Xc,e.__scopePopover),r=w.useRef(!1),o=w.useRef(!1);return p.jsx(Jj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Jj=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=qs(Xc,n),h=oh(n);return Eb(),p.jsx(th,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:p.jsx(wl,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:p.jsx(Qf,{"data-state":t4(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),e4="PopoverClose",vie=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=qs(e4,n);return p.jsx(xe.button,{type:"button",...r,ref:t,onClick:fe(e.onClick,()=>o.onOpenChange(!1))})});vie.displayName=e4;var xie="PopoverArrow",wie=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=oh(n);return p.jsx(Zf,{...o,...r,ref:t})});wie.displayName=xie;function t4(e){return e?"open":"closed"}var Sie=Gj,Cie=Xj,_ie=Qj,Ab=Zj;const ih=Sie,sh=Cie,bu=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>p.jsx(_ie,{children:p.jsx(zs,{children:p.jsx(Ab,{ref:o,align:t,sideOffset:n,className:se("z-49 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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})})}));bu.displayName=Ab.displayName;function Eie(e,t){switch(t){case"full-date-time":return{locale:e,format:"full-date-time",options:{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}};case"short-date-time":return{locale:e,format:"short-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}};case"hours-date-time":return{locale:e,format:"hours-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}};case"short-date":return{format:"short-date",locale:e,options:{}};case"long-date":return{format:"long-date",locale:e,options:{year:"numeric",month:"long",day:"numeric"}};default:return{format:"short-date-time",locale:e,options:{}}}}function n4({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(s,a,l){const c=[...e];c[s]={...c[s],[a]:l},t(c)}function o(s){const a=[...e];a.splice(s,1),t(a)}function i(){t([...e,n])}return p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ee,{children:"Color Range"}),p.jsx(Ge,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:p.jsx(su,{className:"size-3"})})]}),e.map((s,a)=>p.jsxs("div",{className:"flex items-center gap-2 px-2",children:[p.jsx(dc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:se(`h-7 ${Li}`)}),p.jsx("span",{children:"-"}),p.jsx(dc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:se(`h-7 ${Li}`)}),p.jsx(dc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:se(`h-7 min-w-14 p-0 ${Li}`),type:"color",list:"presetColors"}),p.jsxs("datalist",{id:"presetColors",children:[p.jsx("option",{children:St.green[600]}),p.jsx("option",{children:St.red[500]}),p.jsx("option",{children:St.yellow[400]}),p.jsx("option",{children:St.orange[500]})]}),p.jsx(Ge,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:p.jsx(au,{className:"size-3"})})]},a))]})}function Rie(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.type}function kie(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.locale)||"en-US"}function Pie(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t&&i.type==="date");return((o=n==null?void 0:n.options)==null?void 0:o.format)||"short-date-time"}function Mie(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return(o=n==null?void 0:n.options)==null?void 0:o.currency}function Die(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.minimumFractionDigits)||0}function Nie(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.colorRanges)||[]}function Aie(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.style)==="percent"}function Oie(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.textAlign}function Tie(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.width}function Iie({columnIndex:e,columnName:t}){const[n,r]=R.useState(!1),o=nt(I=>{var j;return(j=I.card)==null?void 0:j.preferences}),[i,s]=R.useState(Rie(o,e)),[a,l]=R.useState(Oie(o,e)),[c,u]=R.useState(Tie(o,e)),[d,f]=R.useState(Nie(o,e)),[h,g]=R.useState(kie(o,e)),[m,b]=R.useState(Pie(o,e)),[y,v]=R.useState(Mie(o,e)),[x,_]=R.useState(Die(o,e).toString()),[E,S]=R.useState(Aie(o,e)),[C,k]=R.useState(""),D=nt(I=>I.actions.setCardPreferences);function M(){return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Text Align"}),p.jsxs(tn,{value:a||"left",onValueChange:I=>l(I),children:[p.jsx(Xt,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsxs(Qt,{children:[p.jsx(Se,{value:"left",children:"Left"}),p.jsx(Se,{value:"center",children:"Center"}),p.jsx(Se,{value:"right",children:"Right"})]})]})]}),p.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Width (px)"}),p.jsx(dc,{placeholder:"Auto",value:c?c.toString():"",className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",onChange:I=>{I.target.value===""?u(void 0):u(Number(I.target.value))}})]})]})}function O(){const I=[...new Set(qv.map(j=>j.currency))];return p.jsx(p.Fragment,{children:p.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Locale"}),p.jsxs(tn,{value:h,onValueChange:j=>g(j),children:[p.jsx(Xt,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsx(Qt,{children:p.jsxs(ql,{children:[p.jsx(pa,{children:"Locale"}),qv.map(j=>p.jsx(Se,{value:j.locale,children:j.locale},j.locale))]})})]}),p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Currency"}),p.jsxs(tn,{value:y||"none",onValueChange:j=>v(j==="none"?void 0:j),children:[p.jsx(Xt,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsx(Qt,{children:p.jsxs(ql,{children:[p.jsx(pa,{children:"Currency"}),p.jsx(Se,{value:"none",children:"None"}),I.map(j=>p.jsx(Se,{value:j,children:j},j))]})})]}),p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),p.jsxs(tn,{value:x,onValueChange:j=>_(j),children:[p.jsx(Xt,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsx(Qt,{children:["0","1","2","3","4"].map(j=>p.jsx(Se,{value:j,children:j},j))})]}),!y&&p.jsx(Yf,{onPressedChange:j=>S(j),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:p.jsx(BU,{className:"size-3"})})]})})}function T(){return p.jsx(p.Fragment,{children:p.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Locale"}),p.jsxs(tn,{defaultValue:"en-US",value:h,onValueChange:I=>g(I),children:[p.jsx(Xt,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsx(Qt,{children:Wz.map(I=>p.jsxs(ql,{children:[p.jsx(pa,{children:I.label}),I.locales.map(j=>p.jsx(Se,{value:j.code,children:j.name},j.code))]},I.label))})]}),p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Format"}),p.jsxs(tn,{defaultValue:"short-date-time",value:m,onValueChange:I=>{console.log("format",I),b(I)},children:[p.jsx(Xt,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsx(Qt,{className:"",id:"type",children:p.jsxs(ql,{children:[p.jsx(pa,{children:"Option"}),p.jsx(Se,{value:"full-date-time",children:"Full Date-Time"}),p.jsx(Se,{value:"short-date-time",children:"Short Date-Time"}),p.jsx(Se,{value:"hours-date-time",children:"24-Hour Date-Time"}),p.jsx(Se,{value:"short-date",children:"Short Date"}),p.jsx(Se,{value:"long-date",children:"Long Date"})]})})]})]})})}function L(){D({...o,columnSettings:[]})}function F(){var I;D({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter(j=>j.columnIdx!==e))||[]]})}function A(){var I,j,z,B;if(i==="date"){const N=Eie(h,m),W={columnIdx:e,type:i,options:N};D({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter($=>$.columnIdx!==e))||[],W]})}else if(i==="number"){let N;y?N={locale:h,currency:y,options:{style:"currency",currency:y,minimumFractionDigits:Number(x)},colorRanges:d.length>0?d:void 0}:N={locale:h,currency:void 0,options:{style:E?"percent":"decimal",minimumFractionDigits:Number(x)},colorRanges:d.length>0?d:void 0};const W={columnIdx:e,type:i,textAlign:a,width:c,options:N};D({...o,columnSettings:[...((j=o==null?void 0:o.columnSettings)==null?void 0:j.filter($=>$.columnIdx!==e))||[],W]})}else if(i==="html"){const N={columnIdx:e,type:i,options:{html:""}};D({...o,columnSettings:[...((z=o==null?void 0:o.columnSettings)==null?void 0:z.filter(W=>W.columnIdx!==e))||[],N]})}else{const N={columnIdx:e,type:"none",textAlign:a,width:c,options:{}};D({...o,columnSettings:[...((B=o==null?void 0:o.columnSettings)==null?void 0:B.filter(W=>W.columnIdx!==e))||[],N]})}}return p.jsxs(ih,{onOpenChange:I=>r(I),children:[p.jsx(sh,{asChild:!0,children:p.jsx(DU,{className:"size-3.5 cursor-pointer text-muted"})}),p.jsx(bu,{align:"center",className:"max-w-70 z-20",children:p.jsxs("div",{className:"grid gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),p.jsxs("div",{className:"grid gap-2",children:[p.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[p.jsx(Ee,{htmlFor:"scale",children:"Type"}),p.jsxs(tn,{value:i||"none",onValueChange:I=>s(I),children:[p.jsx(Xt,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsx(Qt,{id:"type",children:p.jsxs(ql,{children:[p.jsx(pa,{children:"Option"}),p.jsx(Se,{value:"number",children:"Number"}),p.jsx(Se,{value:"date",children:"Date"}),p.jsx(Se,{value:"html",children:"HTML"}),p.jsx(Se,{value:"none",children:"None"})]})})]})]}),M(),p.jsx(Md,{}),i==="number"&&O(),i==="date"&&T(),i==="number"&&p.jsxs(p.Fragment,{children:[p.jsx(Md,{}),p.jsx(n4,{colorRanges:d,setColorRanges:f})]}),p.jsx(Md,{}),p.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[p.jsx(Ge,{onClick:L,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),p.jsx(Ge,{onClick:F,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),p.jsx(Ge,{onClick:A,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function jie({card:e,column:t,columnKey:n,columnIndex:r}){var d;const o=oe(f=>f.isVisualEditing),i=e==null?void 0:e.preferences,s=t.getIsSorted(),a=(d=i==null?void 0:i.columnSettings)==null?void 0:d.find(f=>f.columnIdx===r),l=a==null?void 0:a.textAlign,c=a==null?void 0:a.width,u=c?{width:c}:{};return p.jsxs("div",{className:"flex w-full items-center justify-between",children:[p.jsxs("div",{className:se("flex grow cursor-pointer items-center justify-between gap-4",{"justify-center":l==="center","flex-row-reverse":l==="right","justify-start":l==="left"}),style:u,onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:[p.jsx("span",{className:"whitespace-nowrap",children:n}),p.jsx("span",{children:s==="asc"?p.jsx(E5,{className:"h-5 w-5"}):s==="desc"?p.jsx(_5,{className:"h-5 w-5"}):null})]}),o&&p.jsx("div",{className:"opacity-0 group-hover:opacity-100",children:p.jsx(Iie,{columnName:t.id,columnIndex:r})})]})}function Fie(e){const t=new Date(e);return!isNaN(t.getTime())}function Lie({card:e,cell:t,columnIndex:n}){var u,d;const r=e==null?void 0:e.preferences,o=t.getValue(),i=(u=r==null?void 0:r.columnSettings)==null?void 0:u.find(f=>f.columnIdx===n),s=c(o,i),a=_S(o,(d=i==null?void 0:i.options)==null?void 0:d.colorRanges),l=i==null?void 0:i.textAlign;i!=null&&i.width&&i.width;function c(f,h){const g=f;if((h==null?void 0:h.type)==="date"&&Fie(f)){const{locale:m,options:b}=h.options,y=new Date(f);return new Date(y.getTime()).toLocaleDateString(m,b)}if((h==null?void 0:h.type)==="number"){const{locale:m,currency:b,options:y}=h.options;return b?new Intl.NumberFormat(m,{style:"currency",currency:b,...y}).format(f):new Intl.NumberFormat(m,y).format(f)}return(h==null?void 0:h.type)==="html"?p.jsx("div",{className:"hover:underline",dangerouslySetInnerHTML:{__html:g}}):f}return p.jsx("p",{title:s,className:se("overflow-auto",{"text-center":l==="center","text-right":l==="right","text-left":l==="left"}),style:{backgroundColor:a},children:s})}function $ie(e,t){var d;const n=oe(f=>f.selectedSheetId),r=oe(f=>f.filterValues),o=(d=e==null?void 0:e.preferences)==null?void 0:d.onClickFilter,{addOrUpdateFilterValues:i,addFilteringCard:s}=sn(),{data:a}=Hi(e),l=a==null?void 0:a.records;R.useEffect(()=>{(!r||(r==null?void 0:r.length)===0)&&t.getRowModel().rows.forEach(f=>{f.getIsSelected()&&f.toggleSelected()})},[r,t]);const c=R.useCallback(f=>e.id+"-"+f+"-"+n,[e.id,n]);function u(f){console.log("handleRowSelect",f);const h=f.id;if(o){t.getRow(h).toggleSelected();const g=t.getRow(h).getIsSelected();let m=[];const b=t.getRowModel().rows.filter(x=>x.getIsSelected());g===!1?m=[...b,f]:m=b.filter(x=>x!==f);const{dimensionKeys:y}=yn(l),v=o.map(x=>{const _=y==null?void 0:y[x.columnIndex],E=m==null?void 0:m.map(C=>C==null?void 0:C.getValue(_));return{filterId:c(_),connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:_,expression:x.expression,valueType:Am(E[0]===void 0?"":E[0]),operation:"in",values:E}});i(v),s(e)}}return{handleRowSelect:u}}function zie(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var DC="ScrollArea",[r4,nke]=Rn(DC),[Bie,ao]=r4(DC),o4=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=w.useState(null),[c,u]=w.useState(null),[d,f]=w.useState(null),[h,g]=w.useState(null),[m,b]=w.useState(null),[y,v]=w.useState(0),[x,_]=w.useState(0),[E,S]=w.useState(!1),[C,k]=w.useState(!1),D=je(t,O=>l(O)),M=bl(o);return p.jsx(Bie,{scope:n,type:r,dir:M,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:E,onScrollbarXEnabledChange:S,scrollbarY:m,onScrollbarYChange:b,scrollbarYEnabled:C,onScrollbarYEnabledChange:k,onCornerWidthChange:v,onCornerHeightChange:_,children:p.jsx(xe.div,{dir:M,...s,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});o4.displayName=DC;var i4="ScrollAreaViewport",s4=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=ao(i4,n),a=w.useRef(null),l=je(t,a,s.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),p.jsx(xe.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});s4.displayName=i4;var pi="ScrollAreaScrollbar",NC=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ao(pi,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return w.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?p.jsx(Vie,{...r,ref:t,forceMount:n}):o.type==="scroll"?p.jsx(Hie,{...r,ref:t,forceMount:n}):o.type==="auto"?p.jsx(a4,{...r,ref:t,forceMount:n}):o.type==="always"?p.jsx(AC,{...r,ref:t}):null});NC.displayName=pi;var Vie=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ao(pi,e.__scopeScrollArea),[i,s]=w.useState(!1);return w.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),p.jsx(Sn,{present:n||i,children:p.jsx(a4,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Hie=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ao(pi,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Tb(()=>l("SCROLL_END"),100),[a,l]=zie("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),w.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const h=c[u];d!==h&&(l("SCROLL"),s()),d=h};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,s]),p.jsx(Sn,{present:n||a!=="hidden",children:p.jsx(AC,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:fe(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:fe(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),a4=w.forwardRef((e,t)=>{const n=ao(pi,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=w.useState(!1),a=e.orientation==="horizontal",l=Tb(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return Qc(n.viewport,l),Qc(n.content,l),p.jsx(Sn,{present:r||i,children:p.jsx(AC,{"data-state":i?"visible":"hidden",...o,ref:t})})}),AC=w.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ao(pi,e.__scopeScrollArea),i=w.useRef(null),s=w.useRef(0),[a,l]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=f4(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function d(f,h){return Kie(f,s.current,a,h)}return n==="horizontal"?p.jsx(Wie,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,h=AP(f,a,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):n==="vertical"?p.jsx(Uie,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,h=AP(f,a);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),Wie=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ao(pi,e.__scopeScrollArea),[s,a]=w.useState(),l=w.useRef(null),c=je(t,l,i.onScrollbarXChange);return w.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(c4,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ob(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),p4(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:tm(s.paddingLeft),paddingEnd:tm(s.paddingRight)}})}})}),Uie=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ao(pi,e.__scopeScrollArea),[s,a]=w.useState(),l=w.useRef(null),c=je(t,l,i.onScrollbarYChange);return w.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(c4,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ob(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),p4(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:tm(s.paddingTop),paddingEnd:tm(s.paddingBottom)}})}})}),[qie,l4]=r4(pi),c4=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,h=ao(pi,n),[g,m]=w.useState(null),b=je(t,D=>m(D)),y=w.useRef(null),v=w.useRef(""),x=h.viewport,_=r.content-r.viewport,E=En(u),S=En(l),C=Tb(d,10);function k(D){if(y.current){const M=D.clientX-y.current.left,O=D.clientY-y.current.top;c({x:M,y:O})}}return w.useEffect(()=>{const D=M=>{const O=M.target;(g==null?void 0:g.contains(O))&&E(M,_)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[x,g,_,E]),w.useEffect(S,[r,S]),Qc(g,C),Qc(h.content,C),p.jsx(qie,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:En(i),onThumbPointerUp:En(s),onThumbPositionChange:S,onThumbPointerDown:En(a),children:p.jsx(xe.div,{...f,ref:b,style:{position:"absolute",...f.style},onPointerDown:fe(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),y.current=g.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),k(D))}),onPointerMove:fe(e.onPointerMove,k),onPointerUp:fe(e.onPointerUp,D=>{const M=D.target;M.hasPointerCapture(D.pointerId)&&M.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=v.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null})})})}),em="ScrollAreaThumb",u4=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=l4(em,e.__scopeScrollArea);return p.jsx(Sn,{present:n||o.hasThumb,children:p.jsx(Gie,{ref:t,...r})})}),Gie=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=ao(em,n),s=l4(em,n),{onThumbPositionChange:a}=s,l=je(t,d=>s.onThumbChange(d)),c=w.useRef(void 0),u=Tb(()=>{c.current&&(c.current(),c.current=void 0)},100);return w.useEffect(()=>{const d=i.viewport;if(d){const f=()=>{if(u(),!c.current){const h=Xie(d,a);c.current=h,a()}};return a(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,a]),p.jsx(xe.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:fe(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),g=d.clientX-h.left,m=d.clientY-h.top;s.onThumbPointerDown({x:g,y:m})}),onPointerUp:fe(e.onPointerUp,s.onThumbPointerUp)})});u4.displayName=em;var OC="ScrollAreaCorner",d4=w.forwardRef((e,t)=>{const n=ao(OC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?p.jsx(Yie,{...e,ref:t}):null});d4.displayName=OC;var Yie=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ao(OC,n),[i,s]=w.useState(0),[a,l]=w.useState(0),c=!!(i&&a);return Qc(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),Qc(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),s(u)}),c?p.jsx(xe.div,{...r,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function tm(e){return e?parseInt(e,10):0}function f4(e,t){const n=e/t;return isNaN(n)?0:n}function Ob(e){const t=f4(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Kie(e,t,n,r="ltr"){const o=Ob(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return h4([l,c],d)(e)}function AP(e,t,n="ltr"){const r=Ob(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=pw(e,l);return h4([0,s],[0,a])(c)}function h4(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function p4(e,t){return e>0&&e<t}var Xie=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Tb(e,t){const n=En(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Qc(e,t){const n=En(t);Ln(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var Ib=o4,g4=s4,m4=d4;const hf=w.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(Ib,{ref:r,className:se("relative overflow-hidden",e),...n,children:[p.jsx(g4,{className:"h-full w-full rounded-[inherit]",children:t}),p.jsx(Sl,{}),p.jsx(m4,{})]}));hf.displayName=Ib.displayName;const Sl=w.forwardRef(({className:e,orientation:t="vertical",...n},r)=>p.jsx(NC,{ref:r,orientation:t,className:se("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:p.jsx(u4,{className:"relative flex-1 rounded-full bg-border"})}));Sl.displayName=NC.displayName;const yu=w.forwardRef(({className:e,children:t,style:n,...r},o)=>p.jsxs(Ib,{style:n,className:se("relative overflow-hidden",e),children:[p.jsx(g4,{ref:o,...r,className:"h-full w-full rounded-[inherit]",children:t}),p.jsx(Sl,{}),p.jsx(m4,{})]}));yu.displayName=Ib.displayName;const Tr=w.forwardRef(({className:e,type:t,...n},r)=>p.jsx("input",{type:t,className:se("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Tr.displayName="Input";function Qie({globalFilter:e,onGlobalFilterChange:t,totalColumns:n,columns:r,selectColumnVisible:o,onToggleSelectColumn:i,onColumnVisibilityChange:s,data:a,exportFileName:l="export"}){const[c,u]=R.useState(!0),d=oe(h=>h.themeStyle),f=d==null?void 0:d.controlInputRadius;return R.useEffect(()=>{const h=r.filter(m=>m.id!=="select"&&m.getCanHide()),g=h.every(m=>m.getIsVisible());u(g&&h.length>0)},[r]),n<10?null:p.jsxs("div",{className:"flex w-full items-center gap-2",children:[p.jsx("div",{className:"flex items-center gap-2",children:p.jsx(Tr,{style:{borderRadius:f},placeholder:"Search all columns...",value:e,onChange:h=>t(h.target.value),className:"h-9 max-w-sm"})}),p.jsx("div",{className:"flex items-center gap-2",children:n>5&&p.jsxs(ih,{children:[p.jsx(sh,{asChild:!0,children:p.jsx(Ge,{variant:"outline",size:"sm",style:{borderRadius:f},children:p.jsx(TU,{className:"h-4 w-4"})})}),p.jsx(bu,{style:{borderRadius:f},align:"end",className:"min-w-[200px] p-0",children:p.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[p.jsx(Ge,{variant:"ghost",size:"sm",className:"justify-start font-normal",onClick:()=>i(!o),children:p.jsxs("div",{className:"flex w-full items-center",children:[p.jsx("div",{className:"mr-2 flex h-4 w-4 items-center justify-center",children:o?p.jsx(ei,{className:"h-4 w-4"}):null}),p.jsx("span",{children:"Show Select Checkbox"})]})}),p.jsx(sl,{className:"my-1"}),p.jsx("div",{className:"max-h-[300px] overflow-y-auto bg-popover",children:p.jsx("div",{className:"p-1",children:r.filter(h=>h.getCanHide()&&h.id!=="select").map(h=>{const g=h.getIsVisible();return p.jsx("div",{style:{borderRadius:f||2},className:"w-full justify-start px-2 py-1.5 text-sm font-normal capitalize hover:bg-muted",onClick:()=>{typeof h.id=="string"&&(s==null||s(h.id,!g))},children:p.jsxs("div",{className:"flex w-full items-center",children:[p.jsx("div",{className:"mr-2 flex h-4 w-4 items-center justify-center",children:g?p.jsx(ei,{className:"h-4 w-4"}):null}),p.jsx("span",{children:h.id})]})},h.id)})})})]})})]})})]})}function Zie({pageCount:e,pageIndex:t,pageSize:n,rowCount:r,selectedRowCount:o,setPageIndex:i,setPageSize:s,canPreviousPage:a,canNextPage:l,previousPage:c,nextPage:u,onClearSelection:d}){const f=oe(g=>g.themeStyle),h=f==null?void 0:f.controlInputRadius;return p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"hidden flex-1 items-center gap-2 text-sm text-muted-foreground md:flex",children:[o>0&&p.jsxs(p.Fragment,{children:[o," of ",r," row(s) selected"," "]}),o===0&&p.jsxs(p.Fragment,{children:[r," rows"]}),o>0&&p.jsx(Ge,{variant:"outline",size:"sm",style:{borderRadius:h},onClick:d,className:"h-8 text-foreground",children:"Clear"})]}),p.jsxs("div",{className:"flex w-full items-center gap-8 md:w-fit",children:[p.jsxs("div",{className:"hidden items-center gap-2 md:flex",children:[p.jsx(Ee,{htmlFor:"rows-per-page",className:"text-sm font-normal text-muted-foreground",children:"Rows per page"}),p.jsxs(tn,{value:`${n}`,onValueChange:g=>{s(Number(g))},children:[p.jsx(Xt,{style:{borderRadius:h},className:`h-8 w-16 ${hr}`,id:"rows-per-page",children:p.jsx(nn,{placeholder:n})}),p.jsx(Qt,{side:"top",children:[10,20,30,40,50].map(g=>p.jsx(Se,{value:`${g}`,children:g},g))})]})]}),p.jsxs("div",{className:"flex w-fit items-center justify-center text-sm font-normal text-muted-foreground",children:["Page ",t+1," of ",e]}),p.jsxs("div",{className:"ml-auto flex items-center gap-2 md:ml-0",children:[p.jsxs(Ge,{style:{borderRadius:h},variant:"outline",className:"hidden h-8 w-8 p-0 md:flex",onClick:()=>i(0),disabled:!a,children:[p.jsx("span",{className:"sr-only",children:"Go to first page"}),p.jsx(NU,{className:"h-4 w-4"})]}),p.jsxs(Ge,{style:{borderRadius:h},variant:"outline",className:"h-8 w-8 p-0",onClick:c,disabled:!a,children:[p.jsx("span",{className:"sr-only",children:"Go to previous page"}),p.jsx(M5,{className:"h-4 w-4"})]}),p.jsxs(Ge,{style:{borderRadius:h},variant:"outline",className:"h-8 w-8 p-0",onClick:u,disabled:!l,children:[p.jsx("span",{className:"sr-only",children:"Go to next page"}),p.jsx(yS,{className:"h-4 w-4"})]}),p.jsxs(Ge,{style:{borderRadius:h},variant:"outline",className:"hidden h-8 w-8 p-0 md:flex",onClick:()=>i(e-1),disabled:!l,children:[p.jsx("span",{className:"sr-only",children:"Go to last page"}),p.jsx(AU,{className:"h-4 w-4"})]})]})]})]})}var TC="Checkbox",[Jie,rke]=Rn(TC),[ese,tse]=Jie(TC),b4=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[f,h]=w.useState(null),g=je(t,_=>h(_)),m=w.useRef(!1),b=f?u||!!f.closest("form"):!0,[y=!1,v]=Xn({prop:o,defaultProp:i,onChange:c}),x=w.useRef(y);return w.useEffect(()=>{const _=f==null?void 0:f.form;if(_){const E=()=>v(x.current);return _.addEventListener("reset",E),()=>_.removeEventListener("reset",E)}},[f,v]),p.jsxs(ese,{scope:n,state:y,disabled:a,children:[p.jsx(xe.button,{type:"button",role:"checkbox","aria-checked":Rs(y)?"mixed":y,"aria-required":s,"data-state":x4(y),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:g,onKeyDown:fe(e.onKeyDown,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:fe(e.onClick,_=>{v(E=>Rs(E)?!0:!E),b&&(m.current=_.isPropagationStopped(),m.current||_.stopPropagation())})}),b&&p.jsx(nse,{control:f,bubbles:!m.current,name:r,value:l,checked:y,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Rs(i)?!1:i})]})});b4.displayName=TC;var y4="CheckboxIndicator",v4=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=tse(y4,n);return p.jsx(Sn,{present:r||Rs(i.state)||i.state===!0,children:p.jsx(xe.span,{"data-state":x4(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});v4.displayName=y4;var nse=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...i}=e,s=w.useRef(null),a=Rb(n),l=fb(t);w.useEffect(()=>{const u=s.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&h){const g=new Event("click",{bubbles:r});u.indeterminate=Rs(n),h.call(u,Rs(n)?!1:n),u.dispatchEvent(g)}},[a,n,r]);const c=w.useRef(Rs(n)?!1:n);return p.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...i,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Rs(e){return e==="indeterminate"}function x4(e){return Rs(e)?"indeterminate":e?"checked":"unchecked"}var w4=b4,rse=v4;const ll=w.forwardRef(({className:e,...t},n)=>p.jsx(w4,{ref:n,className:se("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:p.jsx(rse,{className:se("flex items-center justify-center text-current"),children:p.jsx(ei,{className:"h-4 w-4"})})}));ll.displayName=w4.displayName;var IC="Radio",[ose,S4]=Rn(IC),[ise,sse]=ose(IC),C4=w.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,form:c,...u}=e,[d,f]=w.useState(null),h=je(t,b=>f(b)),g=w.useRef(!1),m=d?c||!!d.closest("form"):!0;return p.jsxs(ise,{scope:n,checked:o,disabled:s,children:[p.jsx(xe.button,{type:"button",role:"radio","aria-checked":o,"data-state":R4(o),"data-disabled":s?"":void 0,disabled:s,value:a,...u,ref:h,onClick:fe(e.onClick,b=>{o||l==null||l(),m&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),m&&p.jsx(ase,{control:d,bubbles:!g.current,name:r,value:a,checked:o,required:i,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});C4.displayName=IC;var _4="RadioIndicator",E4=w.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=sse(_4,n);return p.jsx(Sn,{present:r||i.checked,children:p.jsx(xe.span,{"data-state":R4(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});E4.displayName=_4;var ase=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=w.useRef(null),s=Rb(n),a=fb(t);return w.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[s,n,r]),p.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function R4(e){return e?"checked":"unchecked"}var lse=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],jC="RadioGroup",[cse,oke]=Rn(jC,[iu,S4]),k4=iu(),P4=S4(),[use,dse]=cse(jC),M4=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...f}=e,h=k4(n),g=bl(c),[m,b]=Xn({prop:i,defaultProp:o,onChange:d});return p.jsx(use,{scope:n,name:r,required:s,disabled:a,value:m,onValueChange:b,children:p.jsx(W1,{asChild:!0,...h,orientation:l,dir:g,loop:u,children:p.jsx(xe.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:g,...f,ref:t})})})});M4.displayName=jC;var D4="RadioGroupItem",N4=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=dse(D4,n),s=i.disabled||r,a=k4(n),l=P4(n),c=w.useRef(null),u=je(t,c),d=i.value===o.value,f=w.useRef(!1);return w.useEffect(()=>{const h=m=>{lse.includes(m.key)&&(f.current=!0)},g=()=>f.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",g)}},[]),p.jsx(U1,{asChild:!0,...a,focusable:!s,active:d,children:p.jsx(C4,{disabled:s,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:fe(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:fe(o.onFocus,()=>{var h;f.current&&((h=c.current)==null||h.click())})})})});N4.displayName=D4;var fse="RadioGroupIndicator",A4=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=P4(n);return p.jsx(E4,{...o,...r,ref:t})});A4.displayName=fse;var O4=M4,T4=N4,hse=A4;const cl=w.forwardRef(({className:e,...t},n)=>p.jsx(O4,{className:se("grid gap-2",e),...t,ref:n}));cl.displayName=O4.displayName;const yo=w.forwardRef(({className:e,...t},n)=>p.jsx(T4,{ref:n,className:se("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:p.jsx(hse,{className:"flex items-center justify-center",children:p.jsx(D5,{className:"h-2.5 w-2.5 fill-current text-current"})})}));yo.displayName=T4.displayName;var I4=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(gse);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return p.jsx(Cw,{...r,ref:t,children:w.isValidElement(s)?w.cloneElement(s,void 0,a):null})}return p.jsx(Cw,{...r,ref:t,children:n})});I4.displayName="Slot";var Cw=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const o=bse(n),i=mse(r,n.props);return n.type!==w.Fragment&&(i.ref=t?Po(t,o):o),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});Cw.displayName="SlotClone";var pse=({children:e})=>p.jsx(p.Fragment,{children:e});function gse(e){return w.isValidElement(e)&&e.type===pse}function mse(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]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function bse(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var FC="Dialog",[j4,F4]=Rn(FC),[yse,Mo]=j4(FC),L4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=w.useRef(null),l=w.useRef(null),[c=!1,u]=Xn({prop:r,defaultProp:o,onChange:i});return p.jsx(yse,{scope:t,triggerRef:a,contentRef:l,contentId:xn(),titleId:xn(),descriptionId:xn(),open:c,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(d=>!d),[u]),modal:s,children:n})};L4.displayName=FC;var $4="DialogTrigger",z4=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mo($4,n),i=je(t,o.triggerRef);return p.jsx(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":zC(o.open),...r,ref:i,onClick:fe(e.onClick,o.onOpenToggle)})});z4.displayName=$4;var LC="DialogPortal",[vse,B4]=j4(LC,{forceMount:void 0}),V4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Mo(LC,t);return p.jsx(vse,{scope:t,forceMount:n,children:w.Children.map(r,s=>p.jsx(Sn,{present:n||i.open,children:p.jsx(Jf,{asChild:!0,container:o,children:s})}))})};V4.displayName=LC;var nm="DialogOverlay",H4=w.forwardRef((e,t)=>{const n=B4(nm,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Mo(nm,e.__scopeDialog);return i.modal?p.jsx(Sn,{present:r||i.open,children:p.jsx(xse,{...o,ref:t})}):null});H4.displayName=nm;var xse=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mo(nm,n);return p.jsx(nh,{as:I4,allowPinchZoom:!0,shards:[o.contentRef],children:p.jsx(xe.div,{"data-state":zC(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ul="DialogContent",W4=w.forwardRef((e,t)=>{const n=B4(ul,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Mo(ul,e.__scopeDialog);return p.jsx(Sn,{present:r||i.open,children:i.modal?p.jsx(wse,{...o,ref:t}):p.jsx(Sse,{...o,ref:t})})});W4.displayName=ul;var wse=w.forwardRef((e,t)=>{const n=Mo(ul,e.__scopeDialog),r=w.useRef(null),o=je(t,n.contentRef,r);return w.useEffect(()=>{const i=r.current;if(i)return kb(i)},[]),p.jsx(U4,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:fe(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:fe(e.onFocusOutside,i=>i.preventDefault())})}),Sse=w.forwardRef((e,t)=>{const n=Mo(ul,e.__scopeDialog),r=w.useRef(!1),o=w.useRef(!1);return p.jsx(U4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),U4=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Mo(ul,n),l=w.useRef(null),c=je(t,l);return Eb(),p.jsxs(p.Fragment,{children:[p.jsx(th,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:p.jsx(wl,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":zC(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(_se,{titleId:a.titleId}),p.jsx(Rse,{contentRef:l,descriptionId:a.descriptionId})]})]})}),$C="DialogTitle",q4=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mo($C,n);return p.jsx(xe.h2,{id:o.titleId,...r,ref:t})});q4.displayName=$C;var G4="DialogDescription",Y4=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mo(G4,n);return p.jsx(xe.p,{id:o.descriptionId,...r,ref:t})});Y4.displayName=G4;var K4="DialogClose",X4=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mo(K4,n);return p.jsx(xe.button,{type:"button",...r,ref:t,onClick:fe(e.onClick,()=>o.onOpenChange(!1))})});X4.displayName=K4;function zC(e){return e?"open":"closed"}var Q4="DialogTitleWarning",[Cse,Z4]=ZB(Q4,{contentName:ul,titleName:$C,docsSlug:"dialog"}),_se=({titleId:e})=>{const t=Z4(Q4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
351
|
+
`)},Ooe=0,Fl=[];function Toe(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(Ooe++)[0],i=w.useState(rj)[0],s=w.useRef(e);w.useEffect(function(){s.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=toe([e.lockRef.current],(e.shards||[]).map(NP),!0).filter(Boolean);return m.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=w.useCallback(function(m,b){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var y=Sp(m),v=n.current,x="deltaX"in m?m.deltaX:v[0]-y[0],_="deltaY"in m?m.deltaY:v[1]-y[1],E,S=m.target,C=Math.abs(x)>Math.abs(_)?"h":"v";if("touches"in m&&C==="h"&&S.type==="range")return!1;var k=MP(C,S);if(!k)return!0;if(k?E=C:(E=C==="v"?"h":"v",k=MP(C,S)),!k)return!1;if(!r.current&&"changedTouches"in m&&(x||_)&&(r.current=E),!E)return!0;var D=r.current||E;return Doe(D,b,m,D==="h"?x:_)},[]),l=w.useCallback(function(m){var b=m;if(!(!Fl.length||Fl[Fl.length-1]!==i)){var y="deltaY"in b?DP(b):Sp(b),v=t.current.filter(function(E){return E.name===b.type&&(E.target===b.target||b.target===E.shadowParent)&&Noe(E.delta,y)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var x=(s.current.shards||[]).map(NP).filter(Boolean).filter(function(E){return E.contains(b.target)}),_=x.length>0?a(b,x[0]):!s.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),c=w.useCallback(function(m,b,y,v){var x={name:m,delta:b,target:y,should:v,shadowParent:Ioe(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(_){return _!==x})},1)},[]),u=w.useCallback(function(m){n.current=Sp(m),r.current=void 0},[]),d=w.useCallback(function(m){c(m.type,DP(m),m.target,a(m,e.lockRef.current))},[]),f=w.useCallback(function(m){c(m.type,Sp(m),m.target,a(m,e.lockRef.current))},[]);w.useEffect(function(){return Fl.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,jl),document.addEventListener("touchmove",l,jl),document.addEventListener("touchstart",u,jl),function(){Fl=Fl.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,jl),document.removeEventListener("touchmove",l,jl),document.removeEventListener("touchstart",u,jl)}},[]);var h=e.removeScrollBar,g=e.inert;return w.createElement(w.Fragment,null,g?w.createElement(i,{styles:Aoe(o)}):null,h?w.createElement(Coe,{gapMode:e.gapMode}):null)}function Ioe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const joe=uoe(nj,Toe);var nh=w.forwardRef(function(e,t){return w.createElement(Pb,Vo({},e,{ref:t,sideCar:joe}))});nh.classNames=Pb.classNames;var Foe=[" ","Enter","ArrowUp","ArrowDown"],Loe=[" ","Enter"],rh="Select",[Mb,Db,$oe]=Im(rh),[mu,eke]=Rn(rh,[$oe,hi]),Nb=hi(),[zoe,Ws]=mu(rh),[Boe,Voe]=mu(rh),aj=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:h,form:g}=e,m=Nb(t),[b,y]=w.useState(null),[v,x]=w.useState(null),[_,E]=w.useState(!1),S=bl(c),[C=!1,k]=Xn({prop:r,defaultProp:o,onChange:i}),[D,M]=Xn({prop:s,defaultProp:a,onChange:l}),O=w.useRef(null),T=b?g||!!b.closest("form"):!0,[L,F]=w.useState(new Set),A=Array.from(L).map(I=>I.props.value).join(";");return p.jsx(Xf,{...m,children:p.jsxs(zoe,{required:h,scope:t,trigger:b,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:_,onValueNodeHasChildrenChange:E,contentId:xn(),value:D,onValueChange:M,open:C,onOpenChange:k,dir:S,triggerPointerDownPosRef:O,disabled:f,children:[p.jsx(Mb.Provider,{scope:t,children:p.jsx(Boe,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(I=>{F(j=>new Set(j).add(I))},[]),onNativeOptionRemove:w.useCallback(I=>{F(j=>{const z=new Set(j);return z.delete(I),z})},[]),children:n})}),T?p.jsxs(Oj,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:D,onChange:I=>M(I.target.value),disabled:f,form:g,children:[D===void 0?p.jsx("option",{value:""}):null,Array.from(L)]},A):null]})})};aj.displayName=rh;var lj="SelectTrigger",cj=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Nb(n),s=Ws(lj,n),a=s.disabled||r,l=je(t,s.onTriggerChange),c=Db(n),u=w.useRef("touch"),[d,f,h]=Tj(m=>{const b=c().filter(x=>!x.disabled),y=b.find(x=>x.value===s.value),v=Ij(b,m,y);v!==void 0&&s.onValueChange(v.value)}),g=m=>{a||(s.onOpenChange(!0),h()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return p.jsx(gu,{asChild:!0,...i,children:p.jsx(xe.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Aj(s.value)?"":void 0,...o,ref:l,onClick:fe(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&g(m)}),onPointerDown:fe(o.onPointerDown,m=>{u.current=m.pointerType;const b=m.target;b.hasPointerCapture(m.pointerId)&&b.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:fe(o.onKeyDown,m=>{const b=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(b&&m.key===" ")&&Foe.includes(m.key)&&(g(),m.preventDefault())})})})});cj.displayName=lj;var uj="SelectValue",dj=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Ws(uj,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=je(t,l.onValueNodeChange);return Ln(()=>{c(u)},[c,u]),p.jsx(xe.span,{...a,ref:d,style:{pointerEvents:"none"},children:Aj(l.value)?p.jsx(p.Fragment,{children:s}):i})});dj.displayName=uj;var Hoe="SelectIcon",fj=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return p.jsx(xe.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});fj.displayName=Hoe;var Woe="SelectPortal",hj=e=>p.jsx(Jf,{asChild:!0,...e});hj.displayName=Woe;var al="SelectContent",pj=w.forwardRef((e,t)=>{const n=Ws(al,e.__scopeSelect),[r,o]=w.useState();if(Ln(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Ya.createPortal(p.jsx(gj,{scope:e.__scopeSelect,children:p.jsx(Mb.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),i):null}return p.jsx(mj,{...e,ref:t})});pj.displayName=al;var fo=10,[gj,Us]=mu(al),Uoe="SelectContentImpl",mj=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:m,avoidCollisions:b,...y}=e,v=Ws(al,n),[x,_]=w.useState(null),[E,S]=w.useState(null),C=je(t,U=>_(U)),[k,D]=w.useState(null),[M,O]=w.useState(null),T=Db(n),[L,F]=w.useState(!1),A=w.useRef(!1);w.useEffect(()=>{if(x)return kb(x)},[x]),Eb();const I=w.useCallback(U=>{const[G,...X]=T().map(Q=>Q.ref.current),[J]=X.slice(-1),te=document.activeElement;for(const Q of U)if(Q===te||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===G&&E&&(E.scrollTop=0),Q===J&&E&&(E.scrollTop=E.scrollHeight),Q==null||Q.focus(),document.activeElement!==te))return},[T,E]),j=w.useCallback(()=>I([k,x]),[I,k,x]);w.useEffect(()=>{L&&j()},[L,j]);const{onOpenChange:z,triggerPointerDownPosRef:B}=v;w.useEffect(()=>{if(x){let U={x:0,y:0};const G=J=>{var te,Q;U={x:Math.abs(Math.round(J.pageX)-(((te=B.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(J.pageY)-(((Q=B.current)==null?void 0:Q.y)??0))}},X=J=>{U.x<=10&&U.y<=10?J.preventDefault():x.contains(J.target)||z(!1),document.removeEventListener("pointermove",G),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",X,{capture:!0})}}},[x,z,B]),w.useEffect(()=>{const U=()=>z(!1);return window.addEventListener("blur",U),window.addEventListener("resize",U),()=>{window.removeEventListener("blur",U),window.removeEventListener("resize",U)}},[z]);const[N,W]=Tj(U=>{const G=T().filter(te=>!te.disabled),X=G.find(te=>te.ref.current===document.activeElement),J=Ij(G,U,X);J&&setTimeout(()=>J.ref.current.focus())}),$=w.useCallback((U,G,X)=>{const J=!A.current&&!X;(v.value!==void 0&&v.value===G||J)&&(D(U),J&&(A.current=!0))},[v.value]),P=w.useCallback(()=>x==null?void 0:x.focus(),[x]),V=w.useCallback((U,G,X)=>{const J=!A.current&&!X;(v.value!==void 0&&v.value===G||J)&&O(U)},[v.value]),q=r==="popper"?bw:bj,Y=q===bw?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:m,avoidCollisions:b}:{};return p.jsx(gj,{scope:n,content:x,viewport:E,onViewportChange:S,itemRefCallback:$,selectedItem:k,onItemLeave:P,itemTextRefCallback:V,focusSelectedItem:j,selectedItemText:M,position:r,isPositioned:L,searchRef:N,children:p.jsx(nh,{as:ZI,allowPinchZoom:!0,children:p.jsx(th,{asChild:!0,trapped:v.open,onMountAutoFocus:U=>{U.preventDefault()},onUnmountAutoFocus:fe(o,U=>{var G;(G=v.trigger)==null||G.focus({preventScroll:!0}),U.preventDefault()}),children:p.jsx(wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:U=>U.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:p.jsx(q,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:U=>U.preventDefault(),...y,...Y,onPlaced:()=>F(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:fe(y.onKeyDown,U=>{const G=U.ctrlKey||U.altKey||U.metaKey;if(U.key==="Tab"&&U.preventDefault(),!G&&U.key.length===1&&W(U.key),["ArrowUp","ArrowDown","Home","End"].includes(U.key)){let J=T().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(U.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(U.key)){const te=U.target,Q=J.indexOf(te);J=J.slice(Q+1)}setTimeout(()=>I(J)),U.preventDefault()}})})})})})})});mj.displayName=Uoe;var qoe="SelectItemAlignedPosition",bj=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Ws(al,n),s=Us(al,n),[a,l]=w.useState(null),[c,u]=w.useState(null),d=je(t,C=>u(C)),f=Db(n),h=w.useRef(!1),g=w.useRef(!0),{viewport:m,selectedItem:b,selectedItemText:y,focusSelectedItem:v}=s,x=w.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&m&&b&&y){const C=i.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),M=y.getBoundingClientRect();if(i.dir!=="rtl"){const te=M.left-k.left,Q=D.left-te,ie=C.left-Q,ee=C.width+ie,de=Math.max(ee,k.width),he=window.innerWidth-fo,ue=pw(Q,[fo,Math.max(fo,he-de)]);a.style.minWidth=ee+"px",a.style.left=ue+"px"}else{const te=k.right-M.right,Q=window.innerWidth-D.right-te,ie=window.innerWidth-C.right-Q,ee=C.width+ie,de=Math.max(ee,k.width),he=window.innerWidth-fo,ue=pw(Q,[fo,Math.max(fo,he-de)]);a.style.minWidth=ee+"px",a.style.right=ue+"px"}const O=f(),T=window.innerHeight-fo*2,L=m.scrollHeight,F=window.getComputedStyle(c),A=parseInt(F.borderTopWidth,10),I=parseInt(F.paddingTop,10),j=parseInt(F.borderBottomWidth,10),z=parseInt(F.paddingBottom,10),B=A+I+L+z+j,N=Math.min(b.offsetHeight*5,B),W=window.getComputedStyle(m),$=parseInt(W.paddingTop,10),P=parseInt(W.paddingBottom,10),V=C.top+C.height/2-fo,q=T-V,Y=b.offsetHeight/2,U=b.offsetTop+Y,G=A+I+U,X=B-G;if(G<=V){const te=O.length>0&&b===O[O.length-1].ref.current;a.style.bottom="0px";const Q=c.clientHeight-m.offsetTop-m.offsetHeight,ie=Math.max(q,Y+(te?P:0)+Q+j),ee=G+ie;a.style.height=ee+"px"}else{const te=O.length>0&&b===O[0].ref.current;a.style.top="0px";const ie=Math.max(V,A+m.offsetTop+(te?$:0)+Y)+X;a.style.height=ie+"px",m.scrollTop=G-V+m.offsetTop}a.style.margin=`${fo}px 0`,a.style.minHeight=N+"px",a.style.maxHeight=T+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,i.trigger,i.valueNode,a,c,m,b,y,i.dir,r]);Ln(()=>x(),[x]);const[_,E]=w.useState();Ln(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const S=w.useCallback(C=>{C&&g.current===!0&&(x(),v==null||v(),g.current=!1)},[x,v]);return p.jsx(Yoe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:S,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:p.jsx(xe.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});bj.displayName=qoe;var Goe="SelectPopperPosition",bw=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=fo,...i}=e,s=Nb(n);return p.jsx(Qf,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});bw.displayName=Goe;var[Yoe,kC]=mu(al,{}),yw="SelectViewport",yj=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=Us(yw,n),s=kC(yw,n),a=je(t,i.onViewportChange),l=w.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),p.jsx(Mb.Slot,{scope:n,children:p.jsx(xe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:fe(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=s;if(f!=null&&f.current&&d){const h=Math.abs(l.current-u.scrollTop);if(h>0){const g=window.innerHeight-fo*2,m=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),y=Math.max(m,b);if(y<g){const v=y+h,x=Math.min(g,v),_=v-x;d.style.height=x+"px",d.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});yj.displayName=yw;var vj="SelectGroup",[Koe,Xoe]=mu(vj),xj=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=xn();return p.jsx(Koe,{scope:n,id:o,children:p.jsx(xe.div,{role:"group","aria-labelledby":o,...r,ref:t})})});xj.displayName=vj;var wj="SelectLabel",Sj=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Xoe(wj,n);return p.jsx(xe.div,{id:o.id,...r,ref:t})});Sj.displayName=wj;var Jg="SelectItem",[Qoe,Cj]=mu(Jg),_j=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Ws(Jg,n),l=Us(Jg,n),c=a.value===r,[u,d]=w.useState(i??""),[f,h]=w.useState(!1),g=je(t,v=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,v,r,o)}),m=xn(),b=w.useRef("touch"),y=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(Qoe,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:w.useCallback(v=>{d(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:p.jsx(Mb.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:p.jsx(xe.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:g,onFocus:fe(s.onFocus,()=>h(!0)),onBlur:fe(s.onBlur,()=>h(!1)),onClick:fe(s.onClick,()=>{b.current!=="mouse"&&y()}),onPointerUp:fe(s.onPointerUp,()=>{b.current==="mouse"&&y()}),onPointerDown:fe(s.onPointerDown,v=>{b.current=v.pointerType}),onPointerMove:fe(s.onPointerMove,v=>{var x;b.current=v.pointerType,o?(x=l.onItemLeave)==null||x.call(l):b.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fe(s.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:fe(s.onKeyDown,v=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&v.key===" "||(Loe.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});_j.displayName=Jg;var dd="SelectItemText",Ej=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Ws(dd,n),a=Us(dd,n),l=Cj(dd,n),c=Voe(dd,n),[u,d]=w.useState(null),f=je(t,y=>d(y),l.onItemTextChange,y=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,y,l.value,l.disabled)}),h=u==null?void 0:u.textContent,g=w.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:b}=c;return Ln(()=>(m(g),()=>b(g)),[m,b,g]),p.jsxs(p.Fragment,{children:[p.jsx(xe.span,{id:l.textId,...i,ref:f}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ya.createPortal(i.children,s.valueNode):null]})});Ej.displayName=dd;var Rj="SelectItemIndicator",kj=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Cj(Rj,n).isSelected?p.jsx(xe.span,{"aria-hidden":!0,...r,ref:t}):null});kj.displayName=Rj;var vw="SelectScrollUpButton",Pj=w.forwardRef((e,t)=>{const n=Us(vw,e.__scopeSelect),r=kC(vw,e.__scopeSelect),[o,i]=w.useState(!1),s=je(t,r.onScrollButtonChange);return Ln(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?p.jsx(Dj,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Pj.displayName=vw;var xw="SelectScrollDownButton",Mj=w.forwardRef((e,t)=>{const n=Us(xw,e.__scopeSelect),r=kC(xw,e.__scopeSelect),[o,i]=w.useState(!1),s=je(t,r.onScrollButtonChange);return Ln(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?p.jsx(Dj,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});Mj.displayName=xw;var Dj=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Us("SelectScrollButton",n),s=w.useRef(null),a=Db(n),l=w.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),Ln(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),p.jsx(xe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:fe(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:fe(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:fe(o.onPointerLeave,()=>{l()})})}),Zoe="SelectSeparator",Nj=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(xe.div,{"aria-hidden":!0,...r,ref:t})});Nj.displayName=Zoe;var ww="SelectArrow",Joe=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Nb(n),i=Ws(ww,n),s=Us(ww,n);return i.open&&s.position==="popper"?p.jsx(Zf,{...o,...r,ref:t}):null});Joe.displayName=ww;function Aj(e){return e===""||e===void 0}var Oj=w.forwardRef((e,t)=>{const{value:n,...r}=e,o=w.useRef(null),i=je(t,o),s=Rb(n);return w.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[s,n]),p.jsx(hC,{asChild:!0,children:p.jsx("select",{...r,ref:i,defaultValue:n})})});Oj.displayName="BubbleSelect";function Tj(e){const t=En(e),n=w.useRef(""),r=w.useRef(0),o=w.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Ij(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=eie(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function eie(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var tie=aj,jj=cj,nie=dj,rie=fj,oie=hj,Fj=pj,iie=yj,sie=xj,Lj=Sj,$j=_j,aie=Ej,lie=kj,zj=Pj,Bj=Mj,Vj=Nj;const tn=tie,ql=sie,nn=nie,Xt=w.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(jj,{ref:r,className:se("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,p.jsx(rie,{asChild:!0,children:p.jsx(Cs,{className:"h-4 w-4 opacity-50"})})]}));Xt.displayName=jj.displayName;const Hj=w.forwardRef(({className:e,...t},n)=>p.jsx(zj,{ref:n,className:se("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(md,{className:"h-4 w-4"})}));Hj.displayName=zj.displayName;const Wj=w.forwardRef(({className:e,...t},n)=>p.jsx(Bj,{ref:n,className:se("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(Cs,{className:"h-4 w-4"})}));Wj.displayName=Bj.displayName;const Qt=w.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>p.jsx(oie,{children:p.jsx(zs,{children:p.jsxs(Fj,{ref:o,className:se("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover 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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[p.jsx(Hj,{}),p.jsx(iie,{className:se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),p.jsx(Wj,{})]})})}));Qt.displayName=Fj.displayName;const pa=w.forwardRef(({className:e,...t},n)=>p.jsx(Lj,{ref:n,className:se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));pa.displayName=Lj.displayName;const Se=w.forwardRef(({className:e,children:t,...n},r)=>p.jsxs($j,{ref:r,className:se("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(lie,{children:p.jsx(ei,{className:"h-4 w-4"})})}),p.jsx(aie,{children:t})]}));Se.displayName=$j.displayName;const Md=w.forwardRef(({className:e,...t},n)=>p.jsx(Vj,{ref:n,className:se("-mx-1 my-1 h-px bg-muted",e),...t}));Md.displayName=Vj.displayName;const dc=w.forwardRef(({className:e,type:t,...n},r)=>p.jsx("input",{type:t,className:se("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));dc.displayName="Input";var Uj=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(uie);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return p.jsx(Sw,{...r,ref:t,children:w.isValidElement(s)?w.cloneElement(s,void 0,a):null})}return p.jsx(Sw,{...r,ref:t,children:n})});Uj.displayName="Slot";var Sw=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const o=fie(n),i=die(r,n.props);return n.type!==w.Fragment&&(i.ref=t?Po(t,o):o),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});Sw.displayName="SlotClone";var cie=({children:e})=>p.jsx(p.Fragment,{children:e});function uie(e){return w.isValidElement(e)&&e.type===cie}function die(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]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function fie(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var PC="Popover",[qj,tke]=Rn(PC,[hi]),oh=hi(),[hie,qs]=qj(PC),Gj=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=oh(t),l=w.useRef(null),[c,u]=w.useState(!1),[d=!1,f]=Xn({prop:r,defaultProp:o,onChange:i});return p.jsx(Xf,{...a,children:p.jsx(hie,{scope:t,contentId:xn(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:c,onCustomAnchorAdd:w.useCallback(()=>u(!0),[]),onCustomAnchorRemove:w.useCallback(()=>u(!1),[]),modal:s,children:n})})};Gj.displayName=PC;var Yj="PopoverAnchor",pie=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=qs(Yj,n),i=oh(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return w.useEffect(()=>(s(),()=>a()),[s,a]),p.jsx(gu,{...i,...r,ref:t})});pie.displayName=Yj;var Kj="PopoverTrigger",Xj=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=qs(Kj,n),i=oh(n),s=je(t,o.triggerRef),a=p.jsx(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":t4(o.open),...r,ref:s,onClick:fe(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:p.jsx(gu,{asChild:!0,...i,children:a})});Xj.displayName=Kj;var MC="PopoverPortal",[gie,mie]=qj(MC,{forceMount:void 0}),Qj=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=qs(MC,t);return p.jsx(gie,{scope:t,forceMount:n,children:p.jsx(Sn,{present:n||i.open,children:p.jsx(Jf,{asChild:!0,container:o,children:r})})})};Qj.displayName=MC;var Xc="PopoverContent",Zj=w.forwardRef((e,t)=>{const n=mie(Xc,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=qs(Xc,e.__scopePopover);return p.jsx(Sn,{present:r||i.open,children:i.modal?p.jsx(bie,{...o,ref:t}):p.jsx(yie,{...o,ref:t})})});Zj.displayName=Xc;var bie=w.forwardRef((e,t)=>{const n=qs(Xc,e.__scopePopover),r=w.useRef(null),o=je(t,r),i=w.useRef(!1);return w.useEffect(()=>{const s=r.current;if(s)return kb(s)},[]),p.jsx(nh,{as:Uj,allowPinchZoom:!0,children:p.jsx(Jj,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:fe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:fe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),yie=w.forwardRef((e,t)=>{const n=qs(Xc,e.__scopePopover),r=w.useRef(!1),o=w.useRef(!1);return p.jsx(Jj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Jj=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=qs(Xc,n),h=oh(n);return Eb(),p.jsx(th,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:p.jsx(wl,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:p.jsx(Qf,{"data-state":t4(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),e4="PopoverClose",vie=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=qs(e4,n);return p.jsx(xe.button,{type:"button",...r,ref:t,onClick:fe(e.onClick,()=>o.onOpenChange(!1))})});vie.displayName=e4;var xie="PopoverArrow",wie=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=oh(n);return p.jsx(Zf,{...o,...r,ref:t})});wie.displayName=xie;function t4(e){return e?"open":"closed"}var Sie=Gj,Cie=Xj,_ie=Qj,Ab=Zj;const ih=Sie,sh=Cie,bu=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>p.jsx(_ie,{children:p.jsx(zs,{children:p.jsx(Ab,{ref:o,align:t,sideOffset:n,className:se("z-49 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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})})}));bu.displayName=Ab.displayName;function Eie(e,t){switch(t){case"full-date-time":return{locale:e,format:"full-date-time",options:{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}};case"short-date-time":return{locale:e,format:"short-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}};case"hours-date-time":return{locale:e,format:"hours-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}};case"short-date":return{format:"short-date",locale:e,options:{}};case"long-date":return{format:"long-date",locale:e,options:{year:"numeric",month:"long",day:"numeric"}};default:return{format:"short-date-time",locale:e,options:{}}}}function n4({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(s,a,l){const c=[...e];c[s]={...c[s],[a]:l},t(c)}function o(s){const a=[...e];a.splice(s,1),t(a)}function i(){t([...e,n])}return p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ee,{children:"Color Range"}),p.jsx(Ge,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:p.jsx(su,{className:"size-3"})})]}),e.map((s,a)=>p.jsxs("div",{className:"flex items-center gap-2 px-2",children:[p.jsx(dc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:se(`h-7 ${Li}`)}),p.jsx("span",{children:"-"}),p.jsx(dc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:se(`h-7 ${Li}`)}),p.jsx(dc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:se(`h-7 min-w-14 p-0 ${Li}`),type:"color",list:"presetColors"}),p.jsxs("datalist",{id:"presetColors",children:[p.jsx("option",{children:St.green[600]}),p.jsx("option",{children:St.red[500]}),p.jsx("option",{children:St.yellow[400]}),p.jsx("option",{children:St.orange[500]})]}),p.jsx(Ge,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:p.jsx(au,{className:"size-3"})})]},a))]})}function Rie(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.type}function kie(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.locale)||"en-US"}function Pie(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t&&i.type==="date");return((o=n==null?void 0:n.options)==null?void 0:o.format)||"short-date-time"}function Mie(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return(o=n==null?void 0:n.options)==null?void 0:o.currency}function Die(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.minimumFractionDigits)||0}function Nie(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.colorRanges)||[]}function Aie(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.style)==="percent"}function Oie(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.textAlign}function Tie(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.width}function Iie({columnIndex:e,columnName:t}){const[n,r]=R.useState(!1),o=nt(I=>{var j;return(j=I.card)==null?void 0:j.preferences}),[i,s]=R.useState(Rie(o,e)),[a,l]=R.useState(Oie(o,e)),[c,u]=R.useState(Tie(o,e)),[d,f]=R.useState(Nie(o,e)),[h,g]=R.useState(kie(o,e)),[m,b]=R.useState(Pie(o,e)),[y,v]=R.useState(Mie(o,e)),[x,_]=R.useState(Die(o,e).toString()),[E,S]=R.useState(Aie(o,e)),[C,k]=R.useState(""),D=nt(I=>I.actions.setCardPreferences);function M(){return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Text Align"}),p.jsxs(tn,{value:a||"left",onValueChange:I=>l(I),children:[p.jsx(Xt,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsxs(Qt,{children:[p.jsx(Se,{value:"left",children:"Left"}),p.jsx(Se,{value:"center",children:"Center"}),p.jsx(Se,{value:"right",children:"Right"})]})]})]}),p.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Width (px)"}),p.jsx(dc,{placeholder:"Auto",value:c?c.toString():"",className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",onChange:I=>{I.target.value===""?u(void 0):u(Number(I.target.value))}})]})]})}function O(){const I=[...new Set(qv.map(j=>j.currency))];return p.jsx(p.Fragment,{children:p.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Locale"}),p.jsxs(tn,{value:h,onValueChange:j=>g(j),children:[p.jsx(Xt,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsx(Qt,{children:p.jsxs(ql,{children:[p.jsx(pa,{children:"Locale"}),qv.map(j=>p.jsx(Se,{value:j.locale,children:j.locale},j.locale))]})})]}),p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Currency"}),p.jsxs(tn,{value:y||"none",onValueChange:j=>v(j==="none"?void 0:j),children:[p.jsx(Xt,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsx(Qt,{children:p.jsxs(ql,{children:[p.jsx(pa,{children:"Currency"}),p.jsx(Se,{value:"none",children:"None"}),I.map(j=>p.jsx(Se,{value:j,children:j},j))]})})]}),p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),p.jsxs(tn,{value:x,onValueChange:j=>_(j),children:[p.jsx(Xt,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsx(Qt,{children:["0","1","2","3","4"].map(j=>p.jsx(Se,{value:j,children:j},j))})]}),!y&&p.jsx(Yf,{onPressedChange:j=>S(j),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:p.jsx(BU,{className:"size-3"})})]})})}function T(){return p.jsx(p.Fragment,{children:p.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Locale"}),p.jsxs(tn,{defaultValue:"en-US",value:h,onValueChange:I=>g(I),children:[p.jsx(Xt,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsx(Qt,{children:Wz.map(I=>p.jsxs(ql,{children:[p.jsx(pa,{children:I.label}),I.locales.map(j=>p.jsx(Se,{value:j.code,children:j.name},j.code))]},I.label))})]}),p.jsx(Ee,{className:"col-span-3",htmlFor:"format",children:"Format"}),p.jsxs(tn,{defaultValue:"short-date-time",value:m,onValueChange:I=>{console.log("format",I),b(I)},children:[p.jsx(Xt,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsx(Qt,{className:"",id:"type",children:p.jsxs(ql,{children:[p.jsx(pa,{children:"Option"}),p.jsx(Se,{value:"full-date-time",children:"Full Date-Time"}),p.jsx(Se,{value:"short-date-time",children:"Short Date-Time"}),p.jsx(Se,{value:"hours-date-time",children:"24-Hour Date-Time"}),p.jsx(Se,{value:"short-date",children:"Short Date"}),p.jsx(Se,{value:"long-date",children:"Long Date"})]})})]})]})})}function L(){D({...o,columnSettings:[]})}function F(){var I;D({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter(j=>j.columnIdx!==e))||[]]})}function A(){var I,j,z,B;if(i==="date"){const N=Eie(h,m),W={columnIdx:e,type:i,options:N};D({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter($=>$.columnIdx!==e))||[],W]})}else if(i==="number"){let N;y?N={locale:h,currency:y,options:{style:"currency",currency:y,minimumFractionDigits:Number(x)},colorRanges:d.length>0?d:void 0}:N={locale:h,currency:void 0,options:{style:E?"percent":"decimal",minimumFractionDigits:Number(x)},colorRanges:d.length>0?d:void 0};const W={columnIdx:e,type:i,textAlign:a,width:c,options:N};D({...o,columnSettings:[...((j=o==null?void 0:o.columnSettings)==null?void 0:j.filter($=>$.columnIdx!==e))||[],W]})}else if(i==="html"){const N={columnIdx:e,type:i,options:{html:""}};D({...o,columnSettings:[...((z=o==null?void 0:o.columnSettings)==null?void 0:z.filter(W=>W.columnIdx!==e))||[],N]})}else{const N={columnIdx:e,type:"none",textAlign:a,width:c,options:{}};D({...o,columnSettings:[...((B=o==null?void 0:o.columnSettings)==null?void 0:B.filter(W=>W.columnIdx!==e))||[],N]})}}return p.jsxs(ih,{onOpenChange:I=>r(I),children:[p.jsx(sh,{asChild:!0,children:p.jsx(DU,{className:"size-3.5 cursor-pointer text-muted"})}),p.jsx(bu,{align:"center",className:"max-w-70 z-20",children:p.jsxs("div",{className:"grid gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),p.jsxs("div",{className:"grid gap-2",children:[p.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[p.jsx(Ee,{htmlFor:"scale",children:"Type"}),p.jsxs(tn,{value:i||"none",onValueChange:I=>s(I),children:[p.jsx(Xt,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:p.jsx(nn,{})}),p.jsx(Qt,{id:"type",children:p.jsxs(ql,{children:[p.jsx(pa,{children:"Option"}),p.jsx(Se,{value:"number",children:"Number"}),p.jsx(Se,{value:"date",children:"Date"}),p.jsx(Se,{value:"html",children:"HTML"}),p.jsx(Se,{value:"none",children:"None"})]})})]})]}),M(),p.jsx(Md,{}),i==="number"&&O(),i==="date"&&T(),i==="number"&&p.jsxs(p.Fragment,{children:[p.jsx(Md,{}),p.jsx(n4,{colorRanges:d,setColorRanges:f})]}),p.jsx(Md,{}),p.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[p.jsx(Ge,{onClick:L,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),p.jsx(Ge,{onClick:F,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),p.jsx(Ge,{onClick:A,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function jie({card:e,column:t,columnKey:n,columnIndex:r}){var d;const o=oe(f=>f.isVisualEditing),i=e==null?void 0:e.preferences,s=t.getIsSorted(),a=(d=i==null?void 0:i.columnSettings)==null?void 0:d.find(f=>f.columnIdx===r),l=a==null?void 0:a.textAlign,c=a==null?void 0:a.width,u=c?{width:c}:{};return p.jsxs("div",{className:"flex w-full items-center justify-between",children:[p.jsxs("div",{className:se("flex grow cursor-pointer items-center justify-between gap-4",{"justify-center":l==="center","flex-row-reverse":l==="right","justify-start":l==="left"}),style:u,onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:[p.jsx("span",{className:"whitespace-nowrap",children:n}),p.jsx("span",{children:s==="asc"?p.jsx(E5,{className:"h-5 w-5"}):s==="desc"?p.jsx(_5,{className:"h-5 w-5"}):null})]}),o&&p.jsx("div",{className:"opacity-0 group-hover:opacity-100",children:p.jsx(Iie,{columnName:t.id,columnIndex:r})})]})}function Fie(e){const t=new Date(e);return!isNaN(t.getTime())}function Lie({card:e,cell:t,columnIndex:n}){var u,d;const r=e==null?void 0:e.preferences,o=t.getValue(),i=(u=r==null?void 0:r.columnSettings)==null?void 0:u.find(f=>f.columnIdx===n),s=c(o,i),a=_S(o,(d=i==null?void 0:i.options)==null?void 0:d.colorRanges),l=i==null?void 0:i.textAlign;i!=null&&i.width&&i.width;function c(f,h){const g=f;if((h==null?void 0:h.type)==="date"&&Fie(f)){const{locale:m,options:b}=h.options,y=new Date(f);return new Date(y.getTime()).toLocaleDateString(m,b)}if((h==null?void 0:h.type)==="number"){const{locale:m,currency:b,options:y}=h.options;return b?new Intl.NumberFormat(m,{style:"currency",currency:b,...y}).format(f):new Intl.NumberFormat(m,y).format(f)}return(h==null?void 0:h.type)==="html"?p.jsx("div",{className:"hover:underline",dangerouslySetInnerHTML:{__html:g}}):f}return p.jsx("p",{title:s,className:se("overflow-auto",{"text-center":l==="center","text-right":l==="right","text-left":l==="left"}),style:{backgroundColor:a},children:s})}function $ie(e,t){var d;const n=oe(f=>f.selectedSheetId),r=oe(f=>f.filterValues),o=(d=e==null?void 0:e.preferences)==null?void 0:d.onClickFilter,{addOrUpdateFilterValues:i,addFilteringCard:s}=sn(),{data:a}=Hi(e),l=a==null?void 0:a.records;R.useEffect(()=>{(!r||(r==null?void 0:r.length)===0)&&t.getRowModel().rows.forEach(f=>{f.getIsSelected()&&f.toggleSelected()})},[r,t]);const c=R.useCallback(f=>e.id+"-"+f+"-"+n,[e.id,n]);function u(f){console.log("handleRowSelect",f);const h=f.id;if(o){t.getRow(h).toggleSelected();const g=t.getRow(h).getIsSelected();let m=[];const b=t.getRowModel().rows.filter(x=>x.getIsSelected());g===!1?m=[...b,f]:m=b.filter(x=>x!==f);const{dimensionKeys:y}=yn(l),v=o.map(x=>{const _=y==null?void 0:y[x.columnIndex],E=m==null?void 0:m.map(C=>C==null?void 0:C.getValue(_));return{filterId:c(_),connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:_,expression:x.expression,valueType:Am(E[0]===void 0?"":E[0]),operation:"in",values:E}});i(v),s(e)}}return{handleRowSelect:u}}function zie(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var DC="ScrollArea",[r4,nke]=Rn(DC),[Bie,ao]=r4(DC),o4=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=w.useState(null),[c,u]=w.useState(null),[d,f]=w.useState(null),[h,g]=w.useState(null),[m,b]=w.useState(null),[y,v]=w.useState(0),[x,_]=w.useState(0),[E,S]=w.useState(!1),[C,k]=w.useState(!1),D=je(t,O=>l(O)),M=bl(o);return p.jsx(Bie,{scope:n,type:r,dir:M,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:E,onScrollbarXEnabledChange:S,scrollbarY:m,onScrollbarYChange:b,scrollbarYEnabled:C,onScrollbarYEnabledChange:k,onCornerWidthChange:v,onCornerHeightChange:_,children:p.jsx(xe.div,{dir:M,...s,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});o4.displayName=DC;var i4="ScrollAreaViewport",s4=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=ao(i4,n),a=w.useRef(null),l=je(t,a,s.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),p.jsx(xe.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});s4.displayName=i4;var pi="ScrollAreaScrollbar",NC=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ao(pi,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return w.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?p.jsx(Vie,{...r,ref:t,forceMount:n}):o.type==="scroll"?p.jsx(Hie,{...r,ref:t,forceMount:n}):o.type==="auto"?p.jsx(a4,{...r,ref:t,forceMount:n}):o.type==="always"?p.jsx(AC,{...r,ref:t}):null});NC.displayName=pi;var Vie=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ao(pi,e.__scopeScrollArea),[i,s]=w.useState(!1);return w.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),p.jsx(Sn,{present:n||i,children:p.jsx(a4,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Hie=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ao(pi,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Tb(()=>l("SCROLL_END"),100),[a,l]=zie("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),w.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const h=c[u];d!==h&&(l("SCROLL"),s()),d=h};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,s]),p.jsx(Sn,{present:n||a!=="hidden",children:p.jsx(AC,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:fe(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:fe(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),a4=w.forwardRef((e,t)=>{const n=ao(pi,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=w.useState(!1),a=e.orientation==="horizontal",l=Tb(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return Qc(n.viewport,l),Qc(n.content,l),p.jsx(Sn,{present:r||i,children:p.jsx(AC,{"data-state":i?"visible":"hidden",...o,ref:t})})}),AC=w.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ao(pi,e.__scopeScrollArea),i=w.useRef(null),s=w.useRef(0),[a,l]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=f4(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function d(f,h){return Kie(f,s.current,a,h)}return n==="horizontal"?p.jsx(Wie,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,h=AP(f,a,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):n==="vertical"?p.jsx(Uie,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,h=AP(f,a);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),Wie=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ao(pi,e.__scopeScrollArea),[s,a]=w.useState(),l=w.useRef(null),c=je(t,l,i.onScrollbarXChange);return w.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(c4,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ob(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),p4(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:tm(s.paddingLeft),paddingEnd:tm(s.paddingRight)}})}})}),Uie=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ao(pi,e.__scopeScrollArea),[s,a]=w.useState(),l=w.useRef(null),c=je(t,l,i.onScrollbarYChange);return w.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.jsx(c4,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ob(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),p4(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:tm(s.paddingTop),paddingEnd:tm(s.paddingBottom)}})}})}),[qie,l4]=r4(pi),c4=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,h=ao(pi,n),[g,m]=w.useState(null),b=je(t,D=>m(D)),y=w.useRef(null),v=w.useRef(""),x=h.viewport,_=r.content-r.viewport,E=En(u),S=En(l),C=Tb(d,10);function k(D){if(y.current){const M=D.clientX-y.current.left,O=D.clientY-y.current.top;c({x:M,y:O})}}return w.useEffect(()=>{const D=M=>{const O=M.target;(g==null?void 0:g.contains(O))&&E(M,_)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[x,g,_,E]),w.useEffect(S,[r,S]),Qc(g,C),Qc(h.content,C),p.jsx(qie,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:En(i),onThumbPointerUp:En(s),onThumbPositionChange:S,onThumbPointerDown:En(a),children:p.jsx(xe.div,{...f,ref:b,style:{position:"absolute",...f.style},onPointerDown:fe(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),y.current=g.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),k(D))}),onPointerMove:fe(e.onPointerMove,k),onPointerUp:fe(e.onPointerUp,D=>{const M=D.target;M.hasPointerCapture(D.pointerId)&&M.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=v.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null})})})}),em="ScrollAreaThumb",u4=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=l4(em,e.__scopeScrollArea);return p.jsx(Sn,{present:n||o.hasThumb,children:p.jsx(Gie,{ref:t,...r})})}),Gie=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=ao(em,n),s=l4(em,n),{onThumbPositionChange:a}=s,l=je(t,d=>s.onThumbChange(d)),c=w.useRef(void 0),u=Tb(()=>{c.current&&(c.current(),c.current=void 0)},100);return w.useEffect(()=>{const d=i.viewport;if(d){const f=()=>{if(u(),!c.current){const h=Xie(d,a);c.current=h,a()}};return a(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,a]),p.jsx(xe.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:fe(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),g=d.clientX-h.left,m=d.clientY-h.top;s.onThumbPointerDown({x:g,y:m})}),onPointerUp:fe(e.onPointerUp,s.onThumbPointerUp)})});u4.displayName=em;var OC="ScrollAreaCorner",d4=w.forwardRef((e,t)=>{const n=ao(OC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?p.jsx(Yie,{...e,ref:t}):null});d4.displayName=OC;var Yie=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ao(OC,n),[i,s]=w.useState(0),[a,l]=w.useState(0),c=!!(i&&a);return Qc(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),Qc(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),s(u)}),c?p.jsx(xe.div,{...r,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function tm(e){return e?parseInt(e,10):0}function f4(e,t){const n=e/t;return isNaN(n)?0:n}function Ob(e){const t=f4(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Kie(e,t,n,r="ltr"){const o=Ob(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return h4([l,c],d)(e)}function AP(e,t,n="ltr"){const r=Ob(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=pw(e,l);return h4([0,s],[0,a])(c)}function h4(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function p4(e,t){return e>0&&e<t}var Xie=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Tb(e,t){const n=En(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Qc(e,t){const n=En(t);Ln(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var Ib=o4,g4=s4,m4=d4;const hf=w.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(Ib,{ref:r,className:se("relative overflow-hidden",e),...n,children:[p.jsx(g4,{className:"h-full w-full rounded-[inherit]",children:t}),p.jsx(Sl,{}),p.jsx(m4,{})]}));hf.displayName=Ib.displayName;const Sl=w.forwardRef(({className:e,orientation:t="vertical",...n},r)=>p.jsx(NC,{ref:r,orientation:t,className:se("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:p.jsx(u4,{className:"relative flex-1 rounded-full bg-border"})}));Sl.displayName=NC.displayName;const yu=w.forwardRef(({className:e,children:t,style:n,...r},o)=>p.jsxs(Ib,{style:n,className:se("relative overflow-hidden",e),children:[p.jsx(g4,{ref:o,...r,className:"h-full w-full rounded-[inherit]",children:t}),p.jsx(Sl,{}),p.jsx(m4,{})]}));yu.displayName=Ib.displayName;const Tr=w.forwardRef(({className:e,type:t,...n},r)=>p.jsx("input",{type:t,className:se("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Tr.displayName="Input";function Qie({globalFilter:e,onGlobalFilterChange:t,totalColumns:n,columns:r,selectColumnVisible:o,onToggleSelectColumn:i,onColumnVisibilityChange:s,data:a,exportFileName:l="export"}){const[c,u]=R.useState(!0),d=oe(h=>h.themeStyle),f=d==null?void 0:d.controlInputRadius;return R.useEffect(()=>{const h=r.filter(m=>m.id!=="select"&&m.getCanHide()),g=h.every(m=>m.getIsVisible());u(g&&h.length>0)},[r]),n<10?null:p.jsxs("div",{className:"flex w-full items-center gap-2",children:[p.jsx("div",{className:"flex items-center gap-2",children:p.jsx(Tr,{style:{borderRadius:f},placeholder:"Search all columns...",value:e,onChange:h=>t(h.target.value),className:"h-9 max-w-sm"})}),p.jsx("div",{className:"flex items-center gap-2",children:p.jsxs(ih,{children:[p.jsx(sh,{asChild:!0,children:p.jsx(Ge,{variant:"outline",size:"sm",style:{borderRadius:f},children:p.jsx(TU,{className:"h-4 w-4"})})}),p.jsx(bu,{style:{borderRadius:f},align:"end",className:"min-w-[200px] p-0",children:p.jsxs("div",{className:"flex flex-col gap-1 p-2",children:[p.jsx(Ge,{variant:"ghost",size:"sm",className:"justify-start font-normal",onClick:()=>i(!o),children:p.jsxs("div",{className:"flex w-full items-center",children:[p.jsx("div",{className:"mr-2 flex h-4 w-4 items-center justify-center",children:o?p.jsx(ei,{className:"h-4 w-4"}):null}),p.jsx("span",{children:"Show Select Checkbox"})]})}),p.jsx(sl,{className:"my-1"}),p.jsx("div",{className:"max-h-[300px] overflow-y-auto bg-popover",children:p.jsx("div",{className:"p-1",children:r.filter(h=>h.getCanHide()&&h.id!=="select").map(h=>{const g=h.getIsVisible();return p.jsx("div",{style:{borderRadius:f||2},className:"w-full justify-start px-2 py-1.5 text-sm font-normal capitalize hover:bg-muted",onClick:()=>{typeof h.id=="string"&&(s==null||s(h.id,!g))},children:p.jsxs("div",{className:"flex w-full items-center",children:[p.jsx("div",{className:"mr-2 flex h-4 w-4 items-center justify-center",children:g?p.jsx(ei,{className:"h-4 w-4"}):null}),p.jsx("span",{children:h.id})]})},h.id)})})})]})})]})})]})}function Zie({pageCount:e,pageIndex:t,pageSize:n,rowCount:r,selectedRowCount:o,setPageIndex:i,setPageSize:s,canPreviousPage:a,canNextPage:l,previousPage:c,nextPage:u,onClearSelection:d}){const f=oe(g=>g.themeStyle),h=f==null?void 0:f.controlInputRadius;return p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"hidden flex-1 items-center gap-2 text-sm text-muted-foreground md:flex",children:[o>0&&p.jsxs(p.Fragment,{children:[o," of ",r," row(s) selected"," "]}),o===0&&p.jsxs(p.Fragment,{children:[r," rows"]}),o>0&&p.jsx(Ge,{variant:"outline",size:"sm",style:{borderRadius:h},onClick:d,className:"h-8 text-foreground",children:"Clear"})]}),p.jsxs("div",{className:"flex w-full items-center gap-8 md:w-fit",children:[p.jsxs("div",{className:"hidden items-center gap-2 md:flex",children:[p.jsx(Ee,{htmlFor:"rows-per-page",className:"text-sm font-normal text-muted-foreground",children:"Rows per page"}),p.jsxs(tn,{value:`${n}`,onValueChange:g=>{s(Number(g))},children:[p.jsx(Xt,{style:{borderRadius:h},className:`h-8 w-16 ${hr}`,id:"rows-per-page",children:p.jsx(nn,{placeholder:n})}),p.jsx(Qt,{side:"top",children:[10,20,30,40,50].map(g=>p.jsx(Se,{value:`${g}`,children:g},g))})]})]}),p.jsxs("div",{className:"flex w-fit items-center justify-center text-sm font-normal text-muted-foreground",children:["Page ",t+1," of ",e]}),p.jsxs("div",{className:"ml-auto flex items-center gap-2 md:ml-0",children:[p.jsxs(Ge,{style:{borderRadius:h},variant:"outline",className:"hidden h-8 w-8 p-0 md:flex",onClick:()=>i(0),disabled:!a,children:[p.jsx("span",{className:"sr-only",children:"Go to first page"}),p.jsx(NU,{className:"h-4 w-4"})]}),p.jsxs(Ge,{style:{borderRadius:h},variant:"outline",className:"h-8 w-8 p-0",onClick:c,disabled:!a,children:[p.jsx("span",{className:"sr-only",children:"Go to previous page"}),p.jsx(M5,{className:"h-4 w-4"})]}),p.jsxs(Ge,{style:{borderRadius:h},variant:"outline",className:"h-8 w-8 p-0",onClick:u,disabled:!l,children:[p.jsx("span",{className:"sr-only",children:"Go to next page"}),p.jsx(yS,{className:"h-4 w-4"})]}),p.jsxs(Ge,{style:{borderRadius:h},variant:"outline",className:"hidden h-8 w-8 p-0 md:flex",onClick:()=>i(e-1),disabled:!l,children:[p.jsx("span",{className:"sr-only",children:"Go to last page"}),p.jsx(AU,{className:"h-4 w-4"})]})]})]})]})}var TC="Checkbox",[Jie,rke]=Rn(TC),[ese,tse]=Jie(TC),b4=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[f,h]=w.useState(null),g=je(t,_=>h(_)),m=w.useRef(!1),b=f?u||!!f.closest("form"):!0,[y=!1,v]=Xn({prop:o,defaultProp:i,onChange:c}),x=w.useRef(y);return w.useEffect(()=>{const _=f==null?void 0:f.form;if(_){const E=()=>v(x.current);return _.addEventListener("reset",E),()=>_.removeEventListener("reset",E)}},[f,v]),p.jsxs(ese,{scope:n,state:y,disabled:a,children:[p.jsx(xe.button,{type:"button",role:"checkbox","aria-checked":Rs(y)?"mixed":y,"aria-required":s,"data-state":x4(y),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:g,onKeyDown:fe(e.onKeyDown,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:fe(e.onClick,_=>{v(E=>Rs(E)?!0:!E),b&&(m.current=_.isPropagationStopped(),m.current||_.stopPropagation())})}),b&&p.jsx(nse,{control:f,bubbles:!m.current,name:r,value:l,checked:y,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Rs(i)?!1:i})]})});b4.displayName=TC;var y4="CheckboxIndicator",v4=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=tse(y4,n);return p.jsx(Sn,{present:r||Rs(i.state)||i.state===!0,children:p.jsx(xe.span,{"data-state":x4(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});v4.displayName=y4;var nse=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...i}=e,s=w.useRef(null),a=Rb(n),l=fb(t);w.useEffect(()=>{const u=s.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&h){const g=new Event("click",{bubbles:r});u.indeterminate=Rs(n),h.call(u,Rs(n)?!1:n),u.dispatchEvent(g)}},[a,n,r]);const c=w.useRef(Rs(n)?!1:n);return p.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...i,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Rs(e){return e==="indeterminate"}function x4(e){return Rs(e)?"indeterminate":e?"checked":"unchecked"}var w4=b4,rse=v4;const ll=w.forwardRef(({className:e,...t},n)=>p.jsx(w4,{ref:n,className:se("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:p.jsx(rse,{className:se("flex items-center justify-center text-current"),children:p.jsx(ei,{className:"h-4 w-4"})})}));ll.displayName=w4.displayName;var IC="Radio",[ose,S4]=Rn(IC),[ise,sse]=ose(IC),C4=w.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,form:c,...u}=e,[d,f]=w.useState(null),h=je(t,b=>f(b)),g=w.useRef(!1),m=d?c||!!d.closest("form"):!0;return p.jsxs(ise,{scope:n,checked:o,disabled:s,children:[p.jsx(xe.button,{type:"button",role:"radio","aria-checked":o,"data-state":R4(o),"data-disabled":s?"":void 0,disabled:s,value:a,...u,ref:h,onClick:fe(e.onClick,b=>{o||l==null||l(),m&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),m&&p.jsx(ase,{control:d,bubbles:!g.current,name:r,value:a,checked:o,required:i,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});C4.displayName=IC;var _4="RadioIndicator",E4=w.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=sse(_4,n);return p.jsx(Sn,{present:r||i.checked,children:p.jsx(xe.span,{"data-state":R4(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});E4.displayName=_4;var ase=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=w.useRef(null),s=Rb(n),a=fb(t);return w.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[s,n,r]),p.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function R4(e){return e?"checked":"unchecked"}var lse=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],jC="RadioGroup",[cse,oke]=Rn(jC,[iu,S4]),k4=iu(),P4=S4(),[use,dse]=cse(jC),M4=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...f}=e,h=k4(n),g=bl(c),[m,b]=Xn({prop:i,defaultProp:o,onChange:d});return p.jsx(use,{scope:n,name:r,required:s,disabled:a,value:m,onValueChange:b,children:p.jsx(W1,{asChild:!0,...h,orientation:l,dir:g,loop:u,children:p.jsx(xe.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:g,...f,ref:t})})})});M4.displayName=jC;var D4="RadioGroupItem",N4=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=dse(D4,n),s=i.disabled||r,a=k4(n),l=P4(n),c=w.useRef(null),u=je(t,c),d=i.value===o.value,f=w.useRef(!1);return w.useEffect(()=>{const h=m=>{lse.includes(m.key)&&(f.current=!0)},g=()=>f.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",g)}},[]),p.jsx(U1,{asChild:!0,...a,focusable:!s,active:d,children:p.jsx(C4,{disabled:s,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:fe(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:fe(o.onFocus,()=>{var h;f.current&&((h=c.current)==null||h.click())})})})});N4.displayName=D4;var fse="RadioGroupIndicator",A4=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=P4(n);return p.jsx(E4,{...o,...r,ref:t})});A4.displayName=fse;var O4=M4,T4=N4,hse=A4;const cl=w.forwardRef(({className:e,...t},n)=>p.jsx(O4,{className:se("grid gap-2",e),...t,ref:n}));cl.displayName=O4.displayName;const yo=w.forwardRef(({className:e,...t},n)=>p.jsx(T4,{ref:n,className:se("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:p.jsx(hse,{className:"flex items-center justify-center",children:p.jsx(D5,{className:"h-2.5 w-2.5 fill-current text-current"})})}));yo.displayName=T4.displayName;var I4=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(gse);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return p.jsx(Cw,{...r,ref:t,children:w.isValidElement(s)?w.cloneElement(s,void 0,a):null})}return p.jsx(Cw,{...r,ref:t,children:n})});I4.displayName="Slot";var Cw=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const o=bse(n),i=mse(r,n.props);return n.type!==w.Fragment&&(i.ref=t?Po(t,o):o),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});Cw.displayName="SlotClone";var pse=({children:e})=>p.jsx(p.Fragment,{children:e});function gse(e){return w.isValidElement(e)&&e.type===pse}function mse(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]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function bse(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var FC="Dialog",[j4,F4]=Rn(FC),[yse,Mo]=j4(FC),L4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=w.useRef(null),l=w.useRef(null),[c=!1,u]=Xn({prop:r,defaultProp:o,onChange:i});return p.jsx(yse,{scope:t,triggerRef:a,contentRef:l,contentId:xn(),titleId:xn(),descriptionId:xn(),open:c,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(d=>!d),[u]),modal:s,children:n})};L4.displayName=FC;var $4="DialogTrigger",z4=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mo($4,n),i=je(t,o.triggerRef);return p.jsx(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":zC(o.open),...r,ref:i,onClick:fe(e.onClick,o.onOpenToggle)})});z4.displayName=$4;var LC="DialogPortal",[vse,B4]=j4(LC,{forceMount:void 0}),V4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Mo(LC,t);return p.jsx(vse,{scope:t,forceMount:n,children:w.Children.map(r,s=>p.jsx(Sn,{present:n||i.open,children:p.jsx(Jf,{asChild:!0,container:o,children:s})}))})};V4.displayName=LC;var nm="DialogOverlay",H4=w.forwardRef((e,t)=>{const n=B4(nm,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Mo(nm,e.__scopeDialog);return i.modal?p.jsx(Sn,{present:r||i.open,children:p.jsx(xse,{...o,ref:t})}):null});H4.displayName=nm;var xse=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mo(nm,n);return p.jsx(nh,{as:I4,allowPinchZoom:!0,shards:[o.contentRef],children:p.jsx(xe.div,{"data-state":zC(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ul="DialogContent",W4=w.forwardRef((e,t)=>{const n=B4(ul,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Mo(ul,e.__scopeDialog);return p.jsx(Sn,{present:r||i.open,children:i.modal?p.jsx(wse,{...o,ref:t}):p.jsx(Sse,{...o,ref:t})})});W4.displayName=ul;var wse=w.forwardRef((e,t)=>{const n=Mo(ul,e.__scopeDialog),r=w.useRef(null),o=je(t,n.contentRef,r);return w.useEffect(()=>{const i=r.current;if(i)return kb(i)},[]),p.jsx(U4,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:fe(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:fe(e.onFocusOutside,i=>i.preventDefault())})}),Sse=w.forwardRef((e,t)=>{const n=Mo(ul,e.__scopeDialog),r=w.useRef(!1),o=w.useRef(!1);return p.jsx(U4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),U4=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Mo(ul,n),l=w.useRef(null),c=je(t,l);return Eb(),p.jsxs(p.Fragment,{children:[p.jsx(th,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:p.jsx(wl,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":zC(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(_se,{titleId:a.titleId}),p.jsx(Rse,{contentRef:l,descriptionId:a.descriptionId})]})]})}),$C="DialogTitle",q4=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mo($C,n);return p.jsx(xe.h2,{id:o.titleId,...r,ref:t})});q4.displayName=$C;var G4="DialogDescription",Y4=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mo(G4,n);return p.jsx(xe.p,{id:o.descriptionId,...r,ref:t})});Y4.displayName=G4;var K4="DialogClose",X4=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Mo(K4,n);return p.jsx(xe.button,{type:"button",...r,ref:t,onClick:fe(e.onClick,()=>o.onOpenChange(!1))})});X4.displayName=K4;function zC(e){return e?"open":"closed"}var Q4="DialogTitleWarning",[Cse,Z4]=ZB(Q4,{contentName:ul,titleName:$C,docsSlug:"dialog"}),_se=({titleId:e})=>{const t=Z4(Q4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
352
352
|
|
|
353
353
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
354
354
|
|
|
@@ -37031,7 +37031,7 @@ function pie({
|
|
|
37031
37031
|
className: "h-9 max-w-sm"
|
|
37032
37032
|
}
|
|
37033
37033
|
) }),
|
|
37034
|
-
/* @__PURE__ */ b("div", { className: "flex items-center gap-2", children:
|
|
37034
|
+
/* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ L(Ob, { children: [
|
|
37035
37035
|
/* @__PURE__ */ b(Ib, { asChild: !0, children: /* @__PURE__ */ b(
|
|
37036
37036
|
ot,
|
|
37037
37037
|
{
|
|
@@ -37072,10 +37072,7 @@ function pie({
|
|
|
37072
37072
|
style: { borderRadius: f || 2 },
|
|
37073
37073
|
className: "w-full justify-start px-2 py-1.5 text-sm font-normal capitalize hover:bg-muted",
|
|
37074
37074
|
onClick: () => {
|
|
37075
|
-
typeof h.id == "string" && (a == null || a(
|
|
37076
|
-
h.id,
|
|
37077
|
-
!p
|
|
37078
|
-
));
|
|
37075
|
+
typeof h.id == "string" && (a == null || a(h.id, !p));
|
|
37079
37076
|
},
|
|
37080
37077
|
children: /* @__PURE__ */ L("div", { className: "flex w-full items-center", children: [
|
|
37081
37078
|
/* @__PURE__ */ b("div", { className: "mr-2 flex h-4 w-4 items-center justify-center", children: p ? /* @__PURE__ */ b(Xi, { className: "h-4 w-4" }) : null }),
|
package/dist/dashboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-DCQaLvcq.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
|
package/dist/dashboard/index.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunks/index-DCQaLvcq.js"),Wt=require("./types/index.cjs"),e=require("react/jsx-runtime"),E=require("react");require("react-dom");function Kt(s){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>s[n]})}}return a.default=s,Object.freeze(a)}const de=Kt(E);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as F, p as Wt, u as L, a as at, b as Ue, d as Tn, e as zn, B as K, P as Xe, f as An, g as Fn, h as En, i as Ln, L as H, I as ue, j as Vn, k as _n, l as qn, m as W, n as Rn, o as jn, q as Bn, r as vs, s as yn, t as R, C as Kt, v as xs, S as Ne, w as we, x as Se, y as ke, z as Te, A as Me, E as ce, T as Pn, F as $e, G as Qe, H as Mt, J as Oe, K as Yt, M as Dt, N as Zt, O as It, Q as ze, R as Hn, U as ot, V as Cs, W as Gn, X as Un, Y as bn, Z as Ns, _ as p, $ as $n, a0 as et, a1 as gt, a2 as ws, a3 as Qn, a4 as Jn, a5 as Wn, a6 as Kn, a7 as Yn, a8 as Zn, a9 as Xn, aa as ve, ab as ea, ac as ta, ad as na, ae as aa, af as sa, ag as ra, ah as be, ai as Ss, aj as xe, ak as ks, al as Pe, am as Ce, an as Ms, ao as Ds, ap as Is, aq as Os, ar as yt, as as Ae, at as Ts, au as zs, av as J, aw as la, ax as As, ay as Fs, az as Es, aA as Pt, aB as ia, aC as Xt, aD as Ot, aE as tt, aF as oa, aG as bt, aH as Ht, aI as fe, aJ as Ls, aK as Vs, aL as ct, aM as _s, aN as qs, aO as Rs, aP as ca, aQ as js, aR as Tt, aS as Bs, aT as Ps, aU as Hs, aV as vn, aW as Gs, aX as Us, aY as $s, aZ as en, a_ as De, a$ as Qs, b0 as Gt, b1 as Ve, b2 as he, b3 as _e, b4 as Js, b5 as Ws, b6 as Ks, b7 as Ys, b8 as Zs, b9 as At, ba as Xs, bb as xn, bc as er, bd as Cn, be as tr, bf as nr, bg as ar, bh as sr, bi as da, bj as rr, bk as tn, bl as ua, bm as lr, bn as ir, bo as Ye, bp as or, bq as cr, br as ma, bs as dr, bt as ur, bu as mr, bv as hr, bw as pr, bx as zt, by as ha, bz as fr, bA as nn, bB as an, bC as Ze, bD as ft, bE as gr, bF as yr, bG as br, bH as sn, bI as pa, bJ as vr, bK as vt, bL as fa, bM as xt, bN as ga, bO as ya, bP as ba, bQ as xr, bR as Cr, bS as Nr, bT as wr, bU as Ee, bV as le, bW as ie, bX as oe, bY as rn, bZ as Sr, b_ as kr, b$ as Mr, c0 as Dr, c1 as Ir, c2 as Nn, c3 as va, c4 as Or, c5 as Tr, c6 as zr, c7 as Ar, c8 as ln, c9 as xa, ca as Ca, cb as on, cc as Fr, cd as Er, ce as Na, cf as Lr, cg as Vr, ch as _r, ci as qr, cj as Rr, ck as jr, cl as Br, cm as Pr, cn as Hr, co as Gr, cp as Ft, cq as wa, cr as Ur, cs as $r, ct as Qr, cu as Jr, cv as Wr, cw as Kr, cx as Yr } from "./chunks/index-
|
|
2
|
-
import { D as Uo, cC as $o, cA as Qo, cA as Jo, cF as Wo, cE as Ko, cD as Yo, cG as Zo, cH as Xo, cB as ec, cy as tc, cz as nc } from "./chunks/index-
|
|
1
|
+
import { c as F, p as Wt, u as L, a as at, b as Ue, d as Tn, e as zn, B as K, P as Xe, f as An, g as Fn, h as En, i as Ln, L as H, I as ue, j as Vn, k as _n, l as qn, m as W, n as Rn, o as jn, q as Bn, r as vs, s as yn, t as R, C as Kt, v as xs, S as Ne, w as we, x as Se, y as ke, z as Te, A as Me, E as ce, T as Pn, F as $e, G as Qe, H as Mt, J as Oe, K as Yt, M as Dt, N as Zt, O as It, Q as ze, R as Hn, U as ot, V as Cs, W as Gn, X as Un, Y as bn, Z as Ns, _ as p, $ as $n, a0 as et, a1 as gt, a2 as ws, a3 as Qn, a4 as Jn, a5 as Wn, a6 as Kn, a7 as Yn, a8 as Zn, a9 as Xn, aa as ve, ab as ea, ac as ta, ad as na, ae as aa, af as sa, ag as ra, ah as be, ai as Ss, aj as xe, ak as ks, al as Pe, am as Ce, an as Ms, ao as Ds, ap as Is, aq as Os, ar as yt, as as Ae, at as Ts, au as zs, av as J, aw as la, ax as As, ay as Fs, az as Es, aA as Pt, aB as ia, aC as Xt, aD as Ot, aE as tt, aF as oa, aG as bt, aH as Ht, aI as fe, aJ as Ls, aK as Vs, aL as ct, aM as _s, aN as qs, aO as Rs, aP as ca, aQ as js, aR as Tt, aS as Bs, aT as Ps, aU as Hs, aV as vn, aW as Gs, aX as Us, aY as $s, aZ as en, a_ as De, a$ as Qs, b0 as Gt, b1 as Ve, b2 as he, b3 as _e, b4 as Js, b5 as Ws, b6 as Ks, b7 as Ys, b8 as Zs, b9 as At, ba as Xs, bb as xn, bc as er, bd as Cn, be as tr, bf as nr, bg as ar, bh as sr, bi as da, bj as rr, bk as tn, bl as ua, bm as lr, bn as ir, bo as Ye, bp as or, bq as cr, br as ma, bs as dr, bt as ur, bu as mr, bv as hr, bw as pr, bx as zt, by as ha, bz as fr, bA as nn, bB as an, bC as Ze, bD as ft, bE as gr, bF as yr, bG as br, bH as sn, bI as pa, bJ as vr, bK as vt, bL as fa, bM as xt, bN as ga, bO as ya, bP as ba, bQ as xr, bR as Cr, bS as Nr, bT as wr, bU as Ee, bV as le, bW as ie, bX as oe, bY as rn, bZ as Sr, b_ as kr, b$ as Mr, c0 as Dr, c1 as Ir, c2 as Nn, c3 as va, c4 as Or, c5 as Tr, c6 as zr, c7 as Ar, c8 as ln, c9 as xa, ca as Ca, cb as on, cc as Fr, cd as Er, ce as Na, cf as Lr, cg as Vr, ch as _r, ci as qr, cj as Rr, ck as jr, cl as Br, cm as Pr, cn as Hr, co as Gr, cp as Ft, cq as wa, cr as Ur, cs as $r, ct as Qr, cu as Jr, cv as Wr, cw as Kr, cx as Yr } from "./chunks/index-DWZDX0_b.js";
|
|
2
|
+
import { D as Uo, cC as $o, cA as Qo, cA as Jo, cF as Wo, cE as Ko, cD as Yo, cG as Zo, cH as Xo, cB as ec, cy as tc, cz as nc } from "./chunks/index-DWZDX0_b.js";
|
|
3
3
|
import { EMPTY_SELECTION as sc } from "./types/index.js";
|
|
4
4
|
import { jsxs as r, jsx as e, Fragment as ae } from "react/jsx-runtime";
|
|
5
5
|
import * as Ke from "react";
|