@capitaltg/vero 1.13.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -156,13 +156,13 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
156
156
|
[&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t}));Sr.displayName=_e.Group.displayName;const Nr=u.forwardRef(({className:e,...t},n)=>d.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[d.jsx(nh,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),d.jsx(_e.Input,{ref:n,className:k(`flex h-11 w-full rounded-sm bg-transparent py-3 text-sm outline-none
|
|
157
157
|
placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));Nr.displayName=_e.Input.displayName;const Er=u.forwardRef(({className:e,...t},n)=>d.jsx(_e.Item,{ref:n,className:k(`relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm
|
|
158
158
|
text-foreground outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50
|
|
159
|
-
aria-selected:bg-accent aria-selected:text-accent-foreground`,e),...t}));Er.displayName=_e.Item.displayName;const Mr=u.forwardRef(({className:e,...t},n)=>d.jsx(_e.List,{ref:n,className:k("max-h-[20rem] overflow-y-auto overflow-x-hidden",e),...t}));Mr.displayName=_e.List.displayName;const hc=({children:e="Loading...",...t})=>d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 text-sm text-muted-foreground",...t,children:[d.jsx(wi,{className:"h-4 w-4 animate-spin"}),e]});hc.displayName="CommandLoading";const uv=["top","right","bottom","left"],vt=Math.min,Ie=Math.max,or=Math.round,Xn=Math.floor,Xe=e=>({x:e,y:e}),dv={left:"right",right:"left",bottom:"top",top:"bottom"},fv={start:"end",end:"start"};function Po(e,t,n){return Ie(e,vt(t,n))}function st(e,t){return typeof e=="function"?e(t):e}function it(e){return e.split("-")[0]}function Zt(e){return e.split("-")[1]}function la(e){return e==="x"?"y":"x"}function ua(e){return e==="y"?"height":"width"}function yt(e){return["top","bottom"].includes(it(e))?"y":"x"}function da(e){return la(yt(e))}function mv(e,t,n){n===void 0&&(n=!1);const r=Zt(e),o=da(e),a=ua(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=ar(i)),[i,ar(i)]}function pv(e){const t=ar(e);return[ko(e),t,ko(t)]}function ko(e){return e.replace(/start|end/g,t=>fv[t])}function hv(e,t,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?a:i;default:return[]}}function gv(e,t,n,r){const o=Zt(e);let a=hv(it(e),n==="start",r);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(ko)))),a}function ar(e){return e.replace(/left|right|bottom|top/g,t=>dv[t])}function vv(e){return{top:0,right:0,bottom:0,left:0,...e}}function gc(e){return typeof e!="number"?vv(e):{top:e,right:e,bottom:e,left:e}}function sr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ws(e,t,n){let{reference:r,floating:o}=e;const a=yt(t),i=da(t),s=ua(i),c=it(t),l=a==="y",f=r.x+r.width/2-o.width/2,m=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(c){case"top":h={x:f,y:r.y-o.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:m};break;case"left":h={x:r.x-o.width,y:m};break;default:h={x:r.x,y:r.y}}switch(Zt(t)){case"start":h[i]-=p*(n&&l?-1:1);break;case"end":h[i]+=p*(n&&l?-1:1);break}return h}const yv=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:m}=ws(l,r,c),p=r,h={},y=0;for(let g=0;g<s.length;g++){const{name:v,fn:b}=s[g],{x,y:w,data:S,reset:C}=await b({x:f,y:m,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:l,platform:i,elements:{reference:e,floating:t}});f=x??f,m=w??m,h={...h,[v]:{...h[v],...S}},C&&y<=50&&(y++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(l=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:f,y:m}=ws(l,p,c)),g=-1)}return{x:f,y:m,placement:p,strategy:o,middlewareData:h}};async function yn(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:m="floating",altBoundary:p=!1,padding:h=0}=st(t,e),y=gc(h),v=s[p?m==="floating"?"reference":"floating":m],b=sr(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:f,strategy:c})),x=m==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),S=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},C=sr(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:w,strategy:c}):x);return{top:(b.top-C.top+y.top)/S.y,bottom:(C.bottom-b.bottom+y.bottom)/S.y,left:(b.left-C.left+y.left)/S.x,right:(C.right-b.right+y.right)/S.x}}const bv=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:c}=t,{element:l,padding:f=0}=st(e,t)||{};if(l==null)return{};const m=gc(f),p={x:n,y:r},h=da(o),y=ua(h),g=await i.getDimensions(l),v=h==="y",b=v?"top":"left",x=v?"bottom":"right",w=v?"clientHeight":"clientWidth",S=a.reference[y]+a.reference[h]-p[h]-a.floating[y],C=p[h]-a.reference[h],M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let E=M?M[w]:0;(!E||!await(i.isElement==null?void 0:i.isElement(M)))&&(E=s.floating[w]||a.floating[y]);const R=S/2-C/2,$=E/2-g[y]/2-1,_=vt(m[b],$),I=vt(m[x],$),D=_,L=E-g[y]-I,B=E/2-g[y]/2+R,K=Po(D,B,L),j=!c.arrow&&Zt(o)!=null&&B!==K&&a.reference[y]/2-(B<D?_:I)-g[y]/2<0,Q=j?B<D?B-D:B-L:0;return{[h]:p[h]+Q,data:{[h]:K,centerOffset:B-K-Q,...j&&{alignmentOffset:Q}},reset:j}}}),xv=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...v}=st(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=it(o),x=yt(s),w=it(s)===s,S=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=p||(w||!g?[ar(s)]:pv(s)),M=y!=="none";!p&&M&&C.push(...gv(s,g,y,S));const E=[s,...C],R=await yn(t,v),$=[];let _=((r=a.flip)==null?void 0:r.overflows)||[];if(f&&$.push(R[b]),m){const B=mv(o,i,S);$.push(R[B[0]],R[B[1]])}if(_=[..._,{placement:o,overflows:$}],!$.every(B=>B<=0)){var I,D;const B=(((I=a.flip)==null?void 0:I.index)||0)+1,K=E[B];if(K)return{data:{index:B,overflows:_},reset:{placement:K}};let j=(D=_.filter(Q=>Q.overflows[0]<=0).sort((Q,F)=>Q.overflows[1]-F.overflows[1])[0])==null?void 0:D.placement;if(!j)switch(h){case"bestFit":{var L;const Q=(L=_.filter(F=>{if(M){const O=yt(F.placement);return O===x||O==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(O=>O>0).reduce((O,ee)=>O+ee,0)]).sort((F,O)=>F[1]-O[1])[0])==null?void 0:L[0];Q&&(j=Q);break}case"initialPlacement":j=s;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function Cs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ss(e){return uv.some(t=>e[t]>=0)}const wv=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=st(e,t);switch(r){case"referenceHidden":{const a=await yn(t,{...o,elementContext:"reference"}),i=Cs(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Ss(i)}}}case"escaped":{const a=await yn(t,{...o,altBoundary:!0}),i=Cs(a,n.floating);return{data:{escapedOffsets:i,escaped:Ss(i)}}}default:return{}}}}};async function Cv(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=it(n),s=Zt(n),c=yt(n)==="y",l=["left","top"].includes(i)?-1:1,f=a&&c?-1:1,m=st(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:y}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return s&&typeof y=="number"&&(h=s==="end"?y*-1:y),c?{x:h*f,y:p*l}:{x:p*l,y:h*f}}const Sv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,c=await Cv(t,e);return i===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:i}}}}},Nv=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:v=>{let{x:b,y:x}=v;return{x:b,y:x}}},...c}=st(e,t),l={x:n,y:r},f=await yn(t,c),m=yt(it(o)),p=la(m);let h=l[p],y=l[m];if(a){const v=p==="y"?"top":"left",b=p==="y"?"bottom":"right",x=h+f[v],w=h-f[b];h=Po(x,h,w)}if(i){const v=m==="y"?"top":"left",b=m==="y"?"bottom":"right",x=y+f[v],w=y-f[b];y=Po(x,y,w)}const g=s.fn({...t,[p]:h,[m]:y});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:a,[m]:i}}}}}},Ev=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=st(e,t),f={x:n,y:r},m=yt(o),p=la(m);let h=f[p],y=f[m];const g=st(s,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=p==="y"?"height":"width",S=a.reference[p]-a.floating[w]+v.mainAxis,C=a.reference[p]+a.reference[w]-v.mainAxis;h<S?h=S:h>C&&(h=C)}if(l){var b,x;const w=p==="y"?"width":"height",S=["top","left"].includes(it(o)),C=a.reference[m]-a.floating[w]+(S&&((b=i.offset)==null?void 0:b[m])||0)+(S?0:v.crossAxis),M=a.reference[m]+a.reference[w]+(S?0:((x=i.offset)==null?void 0:x[m])||0)-(S?v.crossAxis:0);y<C?y=C:y>M&&(y=M)}return{[p]:h,[m]:y}}}},Mv=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:c=()=>{},...l}=st(e,t),f=await yn(t,l),m=it(o),p=Zt(o),h=yt(o)==="y",{width:y,height:g}=a.floating;let v,b;m==="top"||m==="bottom"?(v=m,b=p===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(b=m,v=p==="end"?"top":"bottom");const x=g-f.top-f.bottom,w=y-f.left-f.right,S=vt(g-f[v],x),C=vt(y-f[b],w),M=!t.middlewareData.shift;let E=S,R=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=x),M&&!p){const _=Ie(f.left,0),I=Ie(f.right,0),D=Ie(f.top,0),L=Ie(f.bottom,0);h?R=y-2*(_!==0||I!==0?_+I:Ie(f.left,f.right)):E=g-2*(D!==0||L!==0?D+L:Ie(f.top,f.bottom))}await c({...t,availableWidth:R,availableHeight:E});const $=await i.getDimensions(s.floating);return y!==$.width||g!==$.height?{reset:{rects:!0}}:{}}}};function Rr(){return typeof window<"u"}function Qt(e){return vc(e)?(e.nodeName||"").toLowerCase():"#document"}function De(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Je(e){var t;return(t=(vc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vc(e){return Rr()?e instanceof Node||e instanceof De(e).Node:!1}function He(e){return Rr()?e instanceof Element||e instanceof De(e).Element:!1}function Qe(e){return Rr()?e instanceof HTMLElement||e instanceof De(e).HTMLElement:!1}function Ns(e){return!Rr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof De(e).ShadowRoot}function On(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Rv(e){return["table","td","th"].includes(Qt(e))}function Pr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function fa(e){const t=ma(),n=He(e)?Ve(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Pv(e){let t=bt(e);for(;Qe(t)&&!Ut(t);){if(fa(t))return t;if(Pr(t))return null;t=bt(t)}return null}function ma(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ut(e){return["html","body","#document"].includes(Qt(e))}function Ve(e){return De(e).getComputedStyle(e)}function kr(e){return He(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bt(e){if(Qt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ns(e)&&e.host||Je(e);return Ns(t)?t.host:t}function yc(e){const t=bt(e);return Ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qe(t)&&On(t)?t:yc(t)}function bn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=yc(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),i=De(o);if(a){const s=Io(i);return t.concat(i,i.visualViewport||[],On(o)?o:[],s&&n?bn(s):[])}return t.concat(o,bn(o,[],n))}function Io(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bc(e){const t=Ve(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Qe(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=or(n)!==a||or(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function pa(e){return He(e)?e:e.contextElement}function Gt(e){const t=pa(e);if(!Qe(t))return Xe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=bc(t);let i=(a?or(n.width):n.width)/r,s=(a?or(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const kv=Xe(0);function xc(e){const t=De(e);return!ma()||!t.visualViewport?kv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iv(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==De(e)?!1:t}function Pt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=pa(e);let i=Xe(1);t&&(r?He(r)&&(i=Gt(r)):i=Gt(e));const s=Iv(a,n,r)?xc(a):Xe(0);let c=(o.left+s.x)/i.x,l=(o.top+s.y)/i.y,f=o.width/i.x,m=o.height/i.y;if(a){const p=De(a),h=r&&He(r)?De(r):r;let y=p,g=Io(y);for(;g&&r&&h!==y;){const v=Gt(g),b=g.getBoundingClientRect(),x=Ve(g),w=b.left+(g.clientLeft+parseFloat(x.paddingLeft))*v.x,S=b.top+(g.clientTop+parseFloat(x.paddingTop))*v.y;c*=v.x,l*=v.y,f*=v.x,m*=v.y,c+=w,l+=S,y=De(g),g=Io(y)}}return sr({width:f,height:m,x:c,y:l})}function ha(e,t){const n=kr(e).scrollLeft;return t?t.left+n:Pt(Je(e)).left+n}function wc(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:ha(e,r)),a=r.top+t.scrollTop;return{x:o,y:a}}function Dv(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",i=Je(r),s=t?Pr(t.floating):!1;if(r===i||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Xe(1);const f=Xe(0),m=Qe(r);if((m||!m&&!a)&&((Qt(r)!=="body"||On(i))&&(c=kr(r)),Qe(r))){const h=Pt(r);l=Gt(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const p=i&&!m&&!a?wc(i,c,!0):Xe(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+f.x+p.x,y:n.y*l.y-c.scrollTop*l.y+f.y+p.y}}function Ov(e){return Array.from(e.getClientRects())}function Tv(e){const t=Je(e),n=kr(e),r=e.ownerDocument.body,o=Ie(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ie(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ha(e);const s=-n.scrollTop;return Ve(r).direction==="rtl"&&(i+=Ie(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}function Av(e,t){const n=De(e),r=Je(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,c=0;if(o){a=o.width,i=o.height;const l=ma();(!l||l&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:i,x:s,y:c}}function _v(e,t){const n=Pt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=Qe(e)?Gt(e):Xe(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,c=o*a.x,l=r*a.y;return{width:i,height:s,x:c,y:l}}function Es(e,t,n){let r;if(t==="viewport")r=Av(e,n);else if(t==="document")r=Tv(Je(e));else if(He(t))r=_v(t,n);else{const o=xc(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return sr(r)}function Cc(e,t){const n=bt(e);return n===t||!He(n)||Ut(n)?!1:Ve(n).position==="fixed"||Cc(n,t)}function jv(e,t){const n=t.get(e);if(n)return n;let r=bn(e,[],!1).filter(s=>He(s)&&Qt(s)!=="body"),o=null;const a=Ve(e).position==="fixed";let i=a?bt(e):e;for(;He(i)&&!Ut(i);){const s=Ve(i),c=fa(i);!c&&s.position==="fixed"&&(o=null),(a?!c&&!o:!c&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||On(i)&&!c&&Cc(e,i))?r=r.filter(f=>f!==i):o=s,i=bt(i)}return t.set(e,r),r}function Fv(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Pr(t)?[]:jv(t,this._c):[].concat(n),r],s=i[0],c=i.reduce((l,f)=>{const m=Es(t,f,o);return l.top=Ie(m.top,l.top),l.right=vt(m.right,l.right),l.bottom=vt(m.bottom,l.bottom),l.left=Ie(m.left,l.left),l},Es(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function $v(e){const{width:t,height:n}=bc(e);return{width:t,height:n}}function Lv(e,t,n){const r=Qe(t),o=Je(t),a=n==="fixed",i=Pt(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const c=Xe(0);if(r||!r&&!a)if((Qt(t)!=="body"||On(o))&&(s=kr(t)),r){const p=Pt(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&(c.x=ha(o));const l=o&&!r&&!a?wc(o,s):Xe(0),f=i.left+s.scrollLeft-c.x-l.x,m=i.top+s.scrollTop-c.y-l.y;return{x:f,y:m,width:i.width,height:i.height}}function uo(e){return Ve(e).position==="static"}function Ms(e,t){if(!Qe(e)||Ve(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Je(e)===n&&(n=n.ownerDocument.body),n}function Sc(e,t){const n=De(e);if(Pr(e))return n;if(!Qe(e)){let o=bt(e);for(;o&&!Ut(o);){if(He(o)&&!uo(o))return o;o=bt(o)}return n}let r=Ms(e,t);for(;r&&Rv(r)&&uo(r);)r=Ms(r,t);return r&&Ut(r)&&uo(r)&&!fa(r)?n:r||Pv(e)||n}const Wv=async function(e){const t=this.getOffsetParent||Sc,n=this.getDimensions,r=await n(e.floating);return{reference:Lv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Bv(e){return Ve(e).direction==="rtl"}const Hv={convertOffsetParentRelativeRectToViewportRelativeRect:Dv,getDocumentElement:Je,getClippingRect:Fv,getOffsetParent:Sc,getElementRects:Wv,getClientRects:Ov,getDimensions:$v,getScale:Gt,isElement:He,isRTL:Bv};function Nc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vv(e,t){let n=null,r;const o=Je(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function i(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();const l=e.getBoundingClientRect(),{left:f,top:m,width:p,height:h}=l;if(s||t(),!p||!h)return;const y=Xn(m),g=Xn(o.clientWidth-(f+p)),v=Xn(o.clientHeight-(m+h)),b=Xn(f),w={rootMargin:-y+"px "+-g+"px "+-v+"px "+-b+"px",threshold:Ie(0,vt(1,c))||1};let S=!0;function C(M){const E=M[0].intersectionRatio;if(E!==c){if(!S)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!Nc(l,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return i(!0),a}function Ec(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=pa(e),f=o||a?[...l?bn(l):[],...bn(t)]:[];f.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const m=l&&s?Vv(l,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(b=>{let[x]=b;x&&x.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let y,g=c?Pt(e):null;c&&v();function v(){const b=Pt(e);g&&!Nc(g,b)&&n(),g=b,y=requestAnimationFrame(v)}return n(),()=>{var b;f.forEach(x=>{o&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),m==null||m(),(b=h)==null||b.disconnect(),h=null,c&&cancelAnimationFrame(y)}}const Yv=Sv,Gv=Nv,Uv=xv,zv=Mv,Kv=wv,Rs=bv,qv=Ev,Xv=(e,t,n)=>{const r=new Map,o={platform:Hv,...n},a={...o.platform,_c:r};return yv(e,t,{...o,platform:a})};var tr=typeof document<"u"?N.useLayoutEffect:N.useEffect;function ir(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ir(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&e.$$typeof)&&!ir(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Mc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ps(e,t){const n=Mc(e);return Math.round(t*n)/n}function fo(e){const t=u.useRef(e);return tr(()=>{t.current=e}),t}function Rc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[f,m]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=u.useState(r);ir(p,r)||h(r);const[y,g]=u.useState(null),[v,b]=u.useState(null),x=u.useCallback(F=>{F!==M.current&&(M.current=F,g(F))},[]),w=u.useCallback(F=>{F!==E.current&&(E.current=F,b(F))},[]),S=a||y,C=i||v,M=u.useRef(null),E=u.useRef(null),R=u.useRef(f),$=c!=null,_=fo(c),I=fo(o),D=fo(l),L=u.useCallback(()=>{if(!M.current||!E.current)return;const F={placement:t,strategy:n,middleware:p};I.current&&(F.platform=I.current),Xv(M.current,E.current,F).then(O=>{const ee={...O,isPositioned:D.current!==!1};B.current&&!ir(R.current,ee)&&(R.current=ee,En.flushSync(()=>{m(ee)}))})},[p,t,n,I,D]);tr(()=>{l===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[l]);const B=u.useRef(!1);tr(()=>(B.current=!0,()=>{B.current=!1}),[]),tr(()=>{if(S&&(M.current=S),C&&(E.current=C),S&&C){if(_.current)return _.current(S,C,L);L()}},[S,C,L,_,$]);const K=u.useMemo(()=>({reference:M,floating:E,setReference:x,setFloating:w}),[x,w]),j=u.useMemo(()=>({reference:S,floating:C}),[S,C]),Q=u.useMemo(()=>{const F={position:n,left:0,top:0};if(!j.floating)return F;const O=Ps(j.floating,f.x),ee=Ps(j.floating,f.y);return s?{...F,transform:"translate("+O+"px, "+ee+"px)",...Mc(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:ee}},[n,s,j.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:L,refs:K,elements:j,floatingStyles:Q}),[f,L,K,j,Q])}const Zv=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Rs({element:r.current,padding:o}).fn(n):{}:r?Rs({element:r,padding:o}).fn(n):{}}}},Pc=(e,t)=>({...Yv(e),options:[e,t]}),kc=(e,t)=>({...Gv(e),options:[e,t]}),Ic=(e,t)=>({...qv(e),options:[e,t]}),Dc=(e,t)=>({...Uv(e),options:[e,t]}),Oc=(e,t)=>({...zv(e),options:[e,t]}),Tc=(e,t)=>({...Kv(e),options:[e,t]}),Ac=(e,t)=>({...Zv(e),options:[e,t]});var Qv="Arrow",_c=u.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return d.jsx(V.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});_c.displayName=Qv;var Jv=_c;function Tn(e){const[t,n]=u.useState(void 0);return me(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,s;if("borderBoxSize"in a){const c=a.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,s=l.blockSize}else i=e.offsetWidth,s=e.offsetHeight;n({width:i,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ga="Popper",[jc,Jt]=ye(ga),[ey,Fc]=jc(ga),$c=e=>{const{__scopePopper:t,children:n}=e,[r,o]=u.useState(null);return d.jsx(ey,{scope:t,anchor:r,onAnchorChange:o,children:n})};$c.displayName=ga;var Lc="PopperAnchor",Wc=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=Fc(Lc,n),i=u.useRef(null),s=q(t,i);return u.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:d.jsx(V.div,{...o,ref:s})});Wc.displayName=Lc;var va="PopperContent",[ty,ny]=jc(va),Bc=u.forwardRef((e,t)=>{var A,U,z,te,ae,oe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:y,...g}=e,v=Fc(va,n),[b,x]=u.useState(null),w=q(t,Z=>x(Z)),[S,C]=u.useState(null),M=Tn(S),E=(M==null?void 0:M.width)??0,R=(M==null?void 0:M.height)??0,$=r+(a!=="center"?"-"+a:""),_=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},I=Array.isArray(l)?l:[l],D=I.length>0,L={padding:_,boundary:I.filter(oy),altBoundary:D},{refs:B,floatingStyles:K,placement:j,isPositioned:Q,middlewareData:F}=Rc({strategy:"fixed",placement:$,whileElementsMounted:(...Z)=>Ec(...Z,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[Pc({mainAxis:o+R,alignmentAxis:i}),c&&kc({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?Ic():void 0,...L}),c&&Dc({...L}),Oc({...L,apply:({elements:Z,rects:se,availableWidth:xe,availableHeight:Oe})=>{const{width:tt,height:an}=se.reference,Fe=Z.floating.style;Fe.setProperty("--radix-popper-available-width",`${xe}px`),Fe.setProperty("--radix-popper-available-height",`${Oe}px`),Fe.setProperty("--radix-popper-anchor-width",`${tt}px`),Fe.setProperty("--radix-popper-anchor-height",`${an}px`)}}),S&&Ac({element:S,padding:s}),ay({arrowWidth:E,arrowHeight:R}),p&&Tc({strategy:"referenceHidden",...L})]}),[O,ee]=Yc(j),J=Ee(y);me(()=>{Q&&(J==null||J())},[Q,J]);const P=(A=F.arrow)==null?void 0:A.x,H=(U=F.arrow)==null?void 0:U.y,Y=((z=F.arrow)==null?void 0:z.centerOffset)!==0,[W,X]=u.useState();return me(()=>{b&&X(window.getComputedStyle(b).zIndex)},[b]),d.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:Q?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[(te=F.transformOrigin)==null?void 0:te.x,(ae=F.transformOrigin)==null?void 0:ae.y].join(" "),...((oe=F.hide)==null?void 0:oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(ty,{scope:n,placedSide:O,onArrowChange:C,arrowX:P,arrowY:H,shouldHideArrow:Y,children:d.jsx(V.div,{"data-side":O,"data-align":ee,...g,ref:w,style:{...g.style,animation:Q?void 0:"none"}})})})});Bc.displayName=va;var Hc="PopperArrow",ry={top:"bottom",right:"left",bottom:"top",left:"right"},Vc=u.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,a=ny(Hc,r),i=ry[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(Jv,{...o,ref:n,style:{...o.style,display:"block"}})})});Vc.displayName=Hc;function oy(e){return e!==null}var ay=e=>({name:"transformOrigin",options:e,fn(t){var v,b,x;const{placement:n,rects:r,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,f]=Yc(n),m={start:"0%",center:"50%",end:"100%"}[f],p=(((b=o.arrow)==null?void 0:b.x)??0)+s/2,h=(((x=o.arrow)==null?void 0:x.y)??0)+c/2;let y="",g="";return l==="bottom"?(y=i?m:`${p}px`,g=`${-c}px`):l==="top"?(y=i?m:`${p}px`,g=`${r.floating.height+c}px`):l==="right"?(y=`${-c}px`,g=i?m:`${h}px`):l==="left"&&(y=`${r.floating.width+c}px`,g=i?m:`${h}px`),{data:{x:y,y:g}}}});function Yc(e){const[t,n="center"]=e.split("-");return[t,n]}var ya=$c,Ir=Wc,ba=Bc,xa=Vc,Dr="Popover",[Gc,lE]=ye(Dr,[Jt]),An=Jt(),[sy,Ct]=Gc(Dr),Uc=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!1}=e,s=An(t),c=u.useRef(null),[l,f]=u.useState(!1),[m,p]=Se({prop:r,defaultProp:o??!1,onChange:a,caller:Dr});return d.jsx(ya,{...s,children:d.jsx(sy,{scope:t,contentId:ge(),triggerRef:c,open:m,onOpenChange:p,onOpenToggle:u.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:l,onCustomAnchorAdd:u.useCallback(()=>f(!0),[]),onCustomAnchorRemove:u.useCallback(()=>f(!1),[]),modal:i,children:n})})};Uc.displayName=Dr;var zc="PopoverAnchor",iy=u.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ct(zc,n),a=An(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:s}=o;return u.useEffect(()=>(i(),()=>s()),[i,s]),d.jsx(Ir,{...a,...r,ref:t})});iy.displayName=zc;var Kc="PopoverTrigger",qc=u.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ct(Kc,n),a=An(n),i=q(t,o.triggerRef),s=d.jsx(V.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":tl(o.open),...r,ref:i,onClick:T(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:d.jsx(Ir,{asChild:!0,...a,children:s})});qc.displayName=Kc;var wa="PopoverPortal",[cy,ly]=Gc(wa,{forceMount:void 0}),Xc=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,a=Ct(wa,t);return d.jsx(cy,{scope:t,forceMount:n,children:d.jsx(Ae,{present:n||a.open,children:d.jsx(kn,{asChild:!0,container:o,children:r})})})};Xc.displayName=wa;var zt="PopoverContent",Zc=u.forwardRef((e,t)=>{const n=ly(zt,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,a=Ct(zt,e.__scopePopover);return d.jsx(Ae,{present:r||a.open,children:a.modal?d.jsx(dy,{...o,ref:t}):d.jsx(fy,{...o,ref:t})})});Zc.displayName=zt;var uy=ht("PopoverContent.RemoveScroll"),dy=u.forwardRef((e,t)=>{const n=Ct(zt,e.__scopePopover),r=u.useRef(null),o=q(t,r),a=u.useRef(!1);return u.useEffect(()=>{const i=r.current;if(i)return br(i)},[]),d.jsx(In,{as:uy,allowPinchZoom:!0,children:d.jsx(Qc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:T(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),a.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:T(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0,l=s.button===2||c;a.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:T(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),fy=u.forwardRef((e,t)=>{const n=Ct(zt,e.__scopePopover),r=u.useRef(!1),o=u.useRef(!1);return d.jsx(Qc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,s;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Qc=u.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:f,...m}=e,p=Ct(zt,n),h=An(n);return vr(),d.jsx(Pn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:d.jsx(Rn,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),children:d.jsx(ba,{"data-state":tl(p.open),role:"dialog",id:p.contentId,...h,...m,ref:t,style:{...m.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)"}})})})}),Jc="PopoverClose",my=u.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ct(Jc,n);return d.jsx(V.button,{type:"button",...r,ref:t,onClick:T(e.onClick,()=>o.onOpenChange(!1))})});my.displayName=Jc;var py="PopoverArrow",el=u.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=An(n);return d.jsx(xa,{...o,...r,ref:t})});el.displayName=py;function tl(e){return e?"open":"closed"}var hy=Uc,gy=qc,vy=Xc,nl=Zc,yy=el;const en=hy,tn=gy,by=yy,Tt=u.forwardRef(({className:e,align:t="center",sideOffset:n=4,hasArrow:r,zIndex:o,children:a,...i},s)=>{const c=je("popover",o);return d.jsx(vy,{children:d.jsxs(nl,{ref:s,align:t,className:k(ie.popover,e),sideOffset:n,style:{zIndex:c,...i.style},...i,children:[a,r?d.jsx(by,{className:"fill-popover stroke-muted stroke-[1px]",height:7,width:15}):null]})})});Tt.displayName=nl.displayName;function xy({loadOptions:e,options:t=[],value:n,onChange:r,placeholder:o="Select an option...",loadingMessage:a="Loading...",emptyMessage:i="No results found",errorMessage:s="Failed to load options",className:c,listClassName:l,popoverClassName:f,maxSuggestions:m=10,debounceMs:p=300,minSearch:h=2,zIndex:y,isDisabled:g=!1,name:v,required:b,autoFocus:x,renderOption:w,renderValue:S,getOptionValue:C,getOptionLabel:M,...E},R){const[$,_]=N.useState(!1),I=je("dropdown",y),[D,L]=N.useState(""),[B,K]=N.useState(!1),[j,Q]=N.useState(!1),[F,O]=N.useState([]),[ee,J]=N.useState(!1),[P,H]=N.useState(void 0),Y=N.useRef();N.useEffect(()=>()=>{Y.current&&clearTimeout(Y.current)},[]),N.useEffect(()=>{n||H(void 0)},[n]);const W=N.useCallback(Z=>C?C(Z):"",[C]),X=N.useCallback(async Z=>{if(e)try{K(!0),Q(!1);const se=await e(Z);O(se.slice(0,m)),J(!0)}catch(se){console.error("Error fetching options:",se),Q(!0),O([])}finally{K(!1)}},[e,m]),A=N.useMemo(()=>{if(e)return[];const Z=D.toLowerCase().trim();return t.filter(se=>Z.length===0?!0:(M?M(se).toLowerCase():W(se).toLowerCase()).includes(Z)).slice(0,m)},[e,t,D,m,M,W]),U=e?F:A,z=N.useMemo(()=>{if(P)return P;if(n&&!e)return t.find(Z=>W(Z)===n)},[P,n,e,t,W]),te=N.useCallback(Z=>{const se=U.find(xe=>W(xe)===Z);se&&(H(se),r(Z,se)),_(!1),L(""),J(!1)},[r,U,W]),ae=N.useCallback(Z=>{L(Z),Z.length===0?J(!1):e||J(!0),Y.current&&clearTimeout(Y.current),e&&Z.length>=h?Y.current=setTimeout(()=>X(Z),p):e&&Z.length===0&&O([])},[e,h,p,X]),oe=N.useCallback(()=>{r("",void 0),H(void 0),L(""),O([]),J(!1)},[r]);return d.jsxs(d.Fragment,{children:[v||b?d.jsx("input",{name:v,required:b,type:"hidden",value:n}):null,d.jsxs(en,{open:$,onOpenChange:_,children:[d.jsx(tn,{asChild:!0,children:d.jsxs(Be,{ref:R,"aria-expanded":$,autoFocus:x,className:k("w-full justify-between px-3",!n&&"text-muted-foreground",c),isDisabled:g,role:"combobox",variant:"input",...E,onKeyDown:Z=>{var se;(Z.key==="Delete"||Z.key==="Backspace")&&n&&!$&&(Z.preventDefault(),oe()),(se=E.onKeyDown)==null||se.call(E,Z)},children:[d.jsx("span",{className:"truncate",children:z?S?S(z):(M==null?void 0:M(z))??n:n||o}),d.jsxs("div",{"aria-hidden":"true",className:"flex items-center gap-1",children:[n||D?d.jsx(hr,{className:"h-4 w-4 opacity-50 hover:opacity-100",onClick:Z=>{Z.stopPropagation(),oe()}}):null,d.jsx(ea,{className:"h-4 w-4 shrink-0 opacity-50"})]})]})}),d.jsx(Tt,{align:"start",className:k("min-w-[--radix-popover-trigger-width] px-0 py-0",f),zIndex:I,children:d.jsxs(Cr,{shouldFilter:!1,children:[d.jsx(Nr,{placeholder:o,value:D,onValueChange:ae}),B?d.jsx(hc,{children:a}):null,!B&&j?d.jsx(Ro,{children:s}):null,!B&&!j&&ee&&U.length===0?d.jsx(Ro,{children:i}):null,!B&&!j&&U.length>0?d.jsx(Mr,{className:k("max-h-[16.5rem] overflow-y-auto",l),children:d.jsx(Sr,{children:U.map((Z,se)=>{const xe=W(Z),Oe=!!(xe&&n&&xe===n);return d.jsx(Er,{className:"cursor-pointer",value:xe,onSelect:te,children:w?w(Z,Oe):d.jsxs(d.Fragment,{children:[d.jsx(Dt,{className:k("mr-2 h-4 w-4",Oe?"opacity-100":"opacity-0")}),(M==null?void 0:M(Z))??xe]})},xe||se)})})}):null]})})]})]})}const rl=N.forwardRef(xy);rl.displayName="Autocomplete";const wy=rl,Cy=Ne(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold
|
|
159
|
+
aria-selected:bg-accent aria-selected:text-accent-foreground`,e),...t}));Er.displayName=_e.Item.displayName;const Mr=u.forwardRef(({className:e,...t},n)=>d.jsx(_e.List,{ref:n,className:k("max-h-[20rem] overflow-y-auto overflow-x-hidden",e),...t}));Mr.displayName=_e.List.displayName;const hc=({children:e="Loading...",...t})=>d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 text-sm text-muted-foreground",...t,children:[d.jsx(wi,{className:"h-4 w-4 animate-spin"}),e]});hc.displayName="CommandLoading";const uv=["top","right","bottom","left"],vt=Math.min,Ie=Math.max,or=Math.round,Xn=Math.floor,Xe=e=>({x:e,y:e}),dv={left:"right",right:"left",bottom:"top",top:"bottom"},fv={start:"end",end:"start"};function Po(e,t,n){return Ie(e,vt(t,n))}function st(e,t){return typeof e=="function"?e(t):e}function it(e){return e.split("-")[0]}function Zt(e){return e.split("-")[1]}function la(e){return e==="x"?"y":"x"}function ua(e){return e==="y"?"height":"width"}function yt(e){return["top","bottom"].includes(it(e))?"y":"x"}function da(e){return la(yt(e))}function mv(e,t,n){n===void 0&&(n=!1);const r=Zt(e),o=da(e),a=ua(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=ar(i)),[i,ar(i)]}function pv(e){const t=ar(e);return[ko(e),t,ko(t)]}function ko(e){return e.replace(/start|end/g,t=>fv[t])}function hv(e,t,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?a:i;default:return[]}}function gv(e,t,n,r){const o=Zt(e);let a=hv(it(e),n==="start",r);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(ko)))),a}function ar(e){return e.replace(/left|right|bottom|top/g,t=>dv[t])}function vv(e){return{top:0,right:0,bottom:0,left:0,...e}}function gc(e){return typeof e!="number"?vv(e):{top:e,right:e,bottom:e,left:e}}function sr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ws(e,t,n){let{reference:r,floating:o}=e;const a=yt(t),i=da(t),s=ua(i),c=it(t),l=a==="y",f=r.x+r.width/2-o.width/2,m=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(c){case"top":h={x:f,y:r.y-o.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:m};break;case"left":h={x:r.x-o.width,y:m};break;default:h={x:r.x,y:r.y}}switch(Zt(t)){case"start":h[i]-=p*(n&&l?-1:1);break;case"end":h[i]+=p*(n&&l?-1:1);break}return h}const yv=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:m}=ws(l,r,c),p=r,h={},y=0;for(let g=0;g<s.length;g++){const{name:v,fn:b}=s[g],{x,y:w,data:S,reset:C}=await b({x:f,y:m,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:l,platform:i,elements:{reference:e,floating:t}});f=x??f,m=w??m,h={...h,[v]:{...h[v],...S}},C&&y<=50&&(y++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(l=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:f,y:m}=ws(l,p,c)),g=-1)}return{x:f,y:m,placement:p,strategy:o,middlewareData:h}};async function yn(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:m="floating",altBoundary:p=!1,padding:h=0}=st(t,e),y=gc(h),v=s[p?m==="floating"?"reference":"floating":m],b=sr(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:f,strategy:c})),x=m==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),S=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},C=sr(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:w,strategy:c}):x);return{top:(b.top-C.top+y.top)/S.y,bottom:(C.bottom-b.bottom+y.bottom)/S.y,left:(b.left-C.left+y.left)/S.x,right:(C.right-b.right+y.right)/S.x}}const bv=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:c}=t,{element:l,padding:f=0}=st(e,t)||{};if(l==null)return{};const m=gc(f),p={x:n,y:r},h=da(o),y=ua(h),g=await i.getDimensions(l),v=h==="y",b=v?"top":"left",x=v?"bottom":"right",w=v?"clientHeight":"clientWidth",S=a.reference[y]+a.reference[h]-p[h]-a.floating[y],C=p[h]-a.reference[h],M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let E=M?M[w]:0;(!E||!await(i.isElement==null?void 0:i.isElement(M)))&&(E=s.floating[w]||a.floating[y]);const R=S/2-C/2,$=E/2-g[y]/2-1,_=vt(m[b],$),I=vt(m[x],$),D=_,L=E-g[y]-I,B=E/2-g[y]/2+R,K=Po(D,B,L),j=!c.arrow&&Zt(o)!=null&&B!==K&&a.reference[y]/2-(B<D?_:I)-g[y]/2<0,Q=j?B<D?B-D:B-L:0;return{[h]:p[h]+Q,data:{[h]:K,centerOffset:B-K-Q,...j&&{alignmentOffset:Q}},reset:j}}}),xv=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...v}=st(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=it(o),x=yt(s),w=it(s)===s,S=await(c.isRTL==null?void 0:c.isRTL(l.floating)),C=p||(w||!g?[ar(s)]:pv(s)),M=y!=="none";!p&&M&&C.push(...gv(s,g,y,S));const E=[s,...C],R=await yn(t,v),$=[];let _=((r=a.flip)==null?void 0:r.overflows)||[];if(f&&$.push(R[b]),m){const B=mv(o,i,S);$.push(R[B[0]],R[B[1]])}if(_=[..._,{placement:o,overflows:$}],!$.every(B=>B<=0)){var I,D;const B=(((I=a.flip)==null?void 0:I.index)||0)+1,K=E[B];if(K)return{data:{index:B,overflows:_},reset:{placement:K}};let j=(D=_.filter(Q=>Q.overflows[0]<=0).sort((Q,F)=>Q.overflows[1]-F.overflows[1])[0])==null?void 0:D.placement;if(!j)switch(h){case"bestFit":{var L;const Q=(L=_.filter(F=>{if(M){const O=yt(F.placement);return O===x||O==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(O=>O>0).reduce((O,ee)=>O+ee,0)]).sort((F,O)=>F[1]-O[1])[0])==null?void 0:L[0];Q&&(j=Q);break}case"initialPlacement":j=s;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function Cs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ss(e){return uv.some(t=>e[t]>=0)}const wv=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=st(e,t);switch(r){case"referenceHidden":{const a=await yn(t,{...o,elementContext:"reference"}),i=Cs(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Ss(i)}}}case"escaped":{const a=await yn(t,{...o,altBoundary:!0}),i=Cs(a,n.floating);return{data:{escapedOffsets:i,escaped:Ss(i)}}}default:return{}}}}};async function Cv(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=it(n),s=Zt(n),c=yt(n)==="y",l=["left","top"].includes(i)?-1:1,f=a&&c?-1:1,m=st(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:y}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return s&&typeof y=="number"&&(h=s==="end"?y*-1:y),c?{x:h*f,y:p*l}:{x:p*l,y:h*f}}const Sv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,c=await Cv(t,e);return i===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:i}}}}},Nv=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:v=>{let{x:b,y:x}=v;return{x:b,y:x}}},...c}=st(e,t),l={x:n,y:r},f=await yn(t,c),m=yt(it(o)),p=la(m);let h=l[p],y=l[m];if(a){const v=p==="y"?"top":"left",b=p==="y"?"bottom":"right",x=h+f[v],w=h-f[b];h=Po(x,h,w)}if(i){const v=m==="y"?"top":"left",b=m==="y"?"bottom":"right",x=y+f[v],w=y-f[b];y=Po(x,y,w)}const g=s.fn({...t,[p]:h,[m]:y});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:a,[m]:i}}}}}},Ev=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=st(e,t),f={x:n,y:r},m=yt(o),p=la(m);let h=f[p],y=f[m];const g=st(s,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=p==="y"?"height":"width",S=a.reference[p]-a.floating[w]+v.mainAxis,C=a.reference[p]+a.reference[w]-v.mainAxis;h<S?h=S:h>C&&(h=C)}if(l){var b,x;const w=p==="y"?"width":"height",S=["top","left"].includes(it(o)),C=a.reference[m]-a.floating[w]+(S&&((b=i.offset)==null?void 0:b[m])||0)+(S?0:v.crossAxis),M=a.reference[m]+a.reference[w]+(S?0:((x=i.offset)==null?void 0:x[m])||0)-(S?v.crossAxis:0);y<C?y=C:y>M&&(y=M)}return{[p]:h,[m]:y}}}},Mv=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:c=()=>{},...l}=st(e,t),f=await yn(t,l),m=it(o),p=Zt(o),h=yt(o)==="y",{width:y,height:g}=a.floating;let v,b;m==="top"||m==="bottom"?(v=m,b=p===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(b=m,v=p==="end"?"top":"bottom");const x=g-f.top-f.bottom,w=y-f.left-f.right,S=vt(g-f[v],x),C=vt(y-f[b],w),M=!t.middlewareData.shift;let E=S,R=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=x),M&&!p){const _=Ie(f.left,0),I=Ie(f.right,0),D=Ie(f.top,0),L=Ie(f.bottom,0);h?R=y-2*(_!==0||I!==0?_+I:Ie(f.left,f.right)):E=g-2*(D!==0||L!==0?D+L:Ie(f.top,f.bottom))}await c({...t,availableWidth:R,availableHeight:E});const $=await i.getDimensions(s.floating);return y!==$.width||g!==$.height?{reset:{rects:!0}}:{}}}};function Rr(){return typeof window<"u"}function Qt(e){return vc(e)?(e.nodeName||"").toLowerCase():"#document"}function De(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Je(e){var t;return(t=(vc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vc(e){return Rr()?e instanceof Node||e instanceof De(e).Node:!1}function He(e){return Rr()?e instanceof Element||e instanceof De(e).Element:!1}function Qe(e){return Rr()?e instanceof HTMLElement||e instanceof De(e).HTMLElement:!1}function Ns(e){return!Rr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof De(e).ShadowRoot}function On(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Rv(e){return["table","td","th"].includes(Qt(e))}function Pr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function fa(e){const t=ma(),n=He(e)?Ve(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Pv(e){let t=bt(e);for(;Qe(t)&&!Ut(t);){if(fa(t))return t;if(Pr(t))return null;t=bt(t)}return null}function ma(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ut(e){return["html","body","#document"].includes(Qt(e))}function Ve(e){return De(e).getComputedStyle(e)}function kr(e){return He(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bt(e){if(Qt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ns(e)&&e.host||Je(e);return Ns(t)?t.host:t}function yc(e){const t=bt(e);return Ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qe(t)&&On(t)?t:yc(t)}function bn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=yc(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),i=De(o);if(a){const s=Io(i);return t.concat(i,i.visualViewport||[],On(o)?o:[],s&&n?bn(s):[])}return t.concat(o,bn(o,[],n))}function Io(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bc(e){const t=Ve(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Qe(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=or(n)!==a||or(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function pa(e){return He(e)?e:e.contextElement}function Gt(e){const t=pa(e);if(!Qe(t))return Xe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=bc(t);let i=(a?or(n.width):n.width)/r,s=(a?or(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const kv=Xe(0);function xc(e){const t=De(e);return!ma()||!t.visualViewport?kv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iv(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==De(e)?!1:t}function Pt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=pa(e);let i=Xe(1);t&&(r?He(r)&&(i=Gt(r)):i=Gt(e));const s=Iv(a,n,r)?xc(a):Xe(0);let c=(o.left+s.x)/i.x,l=(o.top+s.y)/i.y,f=o.width/i.x,m=o.height/i.y;if(a){const p=De(a),h=r&&He(r)?De(r):r;let y=p,g=Io(y);for(;g&&r&&h!==y;){const v=Gt(g),b=g.getBoundingClientRect(),x=Ve(g),w=b.left+(g.clientLeft+parseFloat(x.paddingLeft))*v.x,S=b.top+(g.clientTop+parseFloat(x.paddingTop))*v.y;c*=v.x,l*=v.y,f*=v.x,m*=v.y,c+=w,l+=S,y=De(g),g=Io(y)}}return sr({width:f,height:m,x:c,y:l})}function ha(e,t){const n=kr(e).scrollLeft;return t?t.left+n:Pt(Je(e)).left+n}function wc(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:ha(e,r)),a=r.top+t.scrollTop;return{x:o,y:a}}function Dv(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",i=Je(r),s=t?Pr(t.floating):!1;if(r===i||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Xe(1);const f=Xe(0),m=Qe(r);if((m||!m&&!a)&&((Qt(r)!=="body"||On(i))&&(c=kr(r)),Qe(r))){const h=Pt(r);l=Gt(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const p=i&&!m&&!a?wc(i,c,!0):Xe(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+f.x+p.x,y:n.y*l.y-c.scrollTop*l.y+f.y+p.y}}function Ov(e){return Array.from(e.getClientRects())}function Tv(e){const t=Je(e),n=kr(e),r=e.ownerDocument.body,o=Ie(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ie(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ha(e);const s=-n.scrollTop;return Ve(r).direction==="rtl"&&(i+=Ie(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}function Av(e,t){const n=De(e),r=Je(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,c=0;if(o){a=o.width,i=o.height;const l=ma();(!l||l&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:i,x:s,y:c}}function _v(e,t){const n=Pt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=Qe(e)?Gt(e):Xe(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,c=o*a.x,l=r*a.y;return{width:i,height:s,x:c,y:l}}function Es(e,t,n){let r;if(t==="viewport")r=Av(e,n);else if(t==="document")r=Tv(Je(e));else if(He(t))r=_v(t,n);else{const o=xc(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return sr(r)}function Cc(e,t){const n=bt(e);return n===t||!He(n)||Ut(n)?!1:Ve(n).position==="fixed"||Cc(n,t)}function jv(e,t){const n=t.get(e);if(n)return n;let r=bn(e,[],!1).filter(s=>He(s)&&Qt(s)!=="body"),o=null;const a=Ve(e).position==="fixed";let i=a?bt(e):e;for(;He(i)&&!Ut(i);){const s=Ve(i),c=fa(i);!c&&s.position==="fixed"&&(o=null),(a?!c&&!o:!c&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||On(i)&&!c&&Cc(e,i))?r=r.filter(f=>f!==i):o=s,i=bt(i)}return t.set(e,r),r}function Fv(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Pr(t)?[]:jv(t,this._c):[].concat(n),r],s=i[0],c=i.reduce((l,f)=>{const m=Es(t,f,o);return l.top=Ie(m.top,l.top),l.right=vt(m.right,l.right),l.bottom=vt(m.bottom,l.bottom),l.left=Ie(m.left,l.left),l},Es(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function $v(e){const{width:t,height:n}=bc(e);return{width:t,height:n}}function Lv(e,t,n){const r=Qe(t),o=Je(t),a=n==="fixed",i=Pt(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const c=Xe(0);if(r||!r&&!a)if((Qt(t)!=="body"||On(o))&&(s=kr(t)),r){const p=Pt(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&(c.x=ha(o));const l=o&&!r&&!a?wc(o,s):Xe(0),f=i.left+s.scrollLeft-c.x-l.x,m=i.top+s.scrollTop-c.y-l.y;return{x:f,y:m,width:i.width,height:i.height}}function uo(e){return Ve(e).position==="static"}function Ms(e,t){if(!Qe(e)||Ve(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Je(e)===n&&(n=n.ownerDocument.body),n}function Sc(e,t){const n=De(e);if(Pr(e))return n;if(!Qe(e)){let o=bt(e);for(;o&&!Ut(o);){if(He(o)&&!uo(o))return o;o=bt(o)}return n}let r=Ms(e,t);for(;r&&Rv(r)&&uo(r);)r=Ms(r,t);return r&&Ut(r)&&uo(r)&&!fa(r)?n:r||Pv(e)||n}const Wv=async function(e){const t=this.getOffsetParent||Sc,n=this.getDimensions,r=await n(e.floating);return{reference:Lv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Bv(e){return Ve(e).direction==="rtl"}const Hv={convertOffsetParentRelativeRectToViewportRelativeRect:Dv,getDocumentElement:Je,getClippingRect:Fv,getOffsetParent:Sc,getElementRects:Wv,getClientRects:Ov,getDimensions:$v,getScale:Gt,isElement:He,isRTL:Bv};function Nc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Vv(e,t){let n=null,r;const o=Je(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function i(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();const l=e.getBoundingClientRect(),{left:f,top:m,width:p,height:h}=l;if(s||t(),!p||!h)return;const y=Xn(m),g=Xn(o.clientWidth-(f+p)),v=Xn(o.clientHeight-(m+h)),b=Xn(f),w={rootMargin:-y+"px "+-g+"px "+-v+"px "+-b+"px",threshold:Ie(0,vt(1,c))||1};let S=!0;function C(M){const E=M[0].intersectionRatio;if(E!==c){if(!S)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!Nc(l,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return i(!0),a}function Ec(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=pa(e),f=o||a?[...l?bn(l):[],...bn(t)]:[];f.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const m=l&&s?Vv(l,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(b=>{let[x]=b;x&&x.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let y,g=c?Pt(e):null;c&&v();function v(){const b=Pt(e);g&&!Nc(g,b)&&n(),g=b,y=requestAnimationFrame(v)}return n(),()=>{var b;f.forEach(x=>{o&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),m==null||m(),(b=h)==null||b.disconnect(),h=null,c&&cancelAnimationFrame(y)}}const Yv=Sv,Gv=Nv,Uv=xv,zv=Mv,Kv=wv,Rs=bv,qv=Ev,Xv=(e,t,n)=>{const r=new Map,o={platform:Hv,...n},a={...o.platform,_c:r};return yv(e,t,{...o,platform:a})};var tr=typeof document<"u"?N.useLayoutEffect:N.useEffect;function ir(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ir(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&e.$$typeof)&&!ir(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Mc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ps(e,t){const n=Mc(e);return Math.round(t*n)/n}function fo(e){const t=u.useRef(e);return tr(()=>{t.current=e}),t}function Rc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[f,m]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=u.useState(r);ir(p,r)||h(r);const[y,g]=u.useState(null),[v,b]=u.useState(null),x=u.useCallback(F=>{F!==M.current&&(M.current=F,g(F))},[]),w=u.useCallback(F=>{F!==E.current&&(E.current=F,b(F))},[]),S=a||y,C=i||v,M=u.useRef(null),E=u.useRef(null),R=u.useRef(f),$=c!=null,_=fo(c),I=fo(o),D=fo(l),L=u.useCallback(()=>{if(!M.current||!E.current)return;const F={placement:t,strategy:n,middleware:p};I.current&&(F.platform=I.current),Xv(M.current,E.current,F).then(O=>{const ee={...O,isPositioned:D.current!==!1};B.current&&!ir(R.current,ee)&&(R.current=ee,En.flushSync(()=>{m(ee)}))})},[p,t,n,I,D]);tr(()=>{l===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[l]);const B=u.useRef(!1);tr(()=>(B.current=!0,()=>{B.current=!1}),[]),tr(()=>{if(S&&(M.current=S),C&&(E.current=C),S&&C){if(_.current)return _.current(S,C,L);L()}},[S,C,L,_,$]);const K=u.useMemo(()=>({reference:M,floating:E,setReference:x,setFloating:w}),[x,w]),j=u.useMemo(()=>({reference:S,floating:C}),[S,C]),Q=u.useMemo(()=>{const F={position:n,left:0,top:0};if(!j.floating)return F;const O=Ps(j.floating,f.x),ee=Ps(j.floating,f.y);return s?{...F,transform:"translate("+O+"px, "+ee+"px)",...Mc(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:ee}},[n,s,j.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:L,refs:K,elements:j,floatingStyles:Q}),[f,L,K,j,Q])}const Zv=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Rs({element:r.current,padding:o}).fn(n):{}:r?Rs({element:r,padding:o}).fn(n):{}}}},Pc=(e,t)=>({...Yv(e),options:[e,t]}),kc=(e,t)=>({...Gv(e),options:[e,t]}),Ic=(e,t)=>({...qv(e),options:[e,t]}),Dc=(e,t)=>({...Uv(e),options:[e,t]}),Oc=(e,t)=>({...zv(e),options:[e,t]}),Tc=(e,t)=>({...Kv(e),options:[e,t]}),Ac=(e,t)=>({...Zv(e),options:[e,t]});var Qv="Arrow",_c=u.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return d.jsx(V.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});_c.displayName=Qv;var Jv=_c;function Tn(e){const[t,n]=u.useState(void 0);return me(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,s;if("borderBoxSize"in a){const c=a.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,s=l.blockSize}else i=e.offsetWidth,s=e.offsetHeight;n({width:i,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ga="Popper",[jc,Jt]=ye(ga),[ey,Fc]=jc(ga),$c=e=>{const{__scopePopper:t,children:n}=e,[r,o]=u.useState(null);return d.jsx(ey,{scope:t,anchor:r,onAnchorChange:o,children:n})};$c.displayName=ga;var Lc="PopperAnchor",Wc=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=Fc(Lc,n),i=u.useRef(null),s=q(t,i);return u.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:d.jsx(V.div,{...o,ref:s})});Wc.displayName=Lc;var va="PopperContent",[ty,ny]=jc(va),Bc=u.forwardRef((e,t)=>{var A,U,z,te,ae,oe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:y,...g}=e,v=Fc(va,n),[b,x]=u.useState(null),w=q(t,Z=>x(Z)),[S,C]=u.useState(null),M=Tn(S),E=(M==null?void 0:M.width)??0,R=(M==null?void 0:M.height)??0,$=r+(a!=="center"?"-"+a:""),_=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},I=Array.isArray(l)?l:[l],D=I.length>0,L={padding:_,boundary:I.filter(oy),altBoundary:D},{refs:B,floatingStyles:K,placement:j,isPositioned:Q,middlewareData:F}=Rc({strategy:"fixed",placement:$,whileElementsMounted:(...Z)=>Ec(...Z,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[Pc({mainAxis:o+R,alignmentAxis:i}),c&&kc({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?Ic():void 0,...L}),c&&Dc({...L}),Oc({...L,apply:({elements:Z,rects:se,availableWidth:xe,availableHeight:Oe})=>{const{width:tt,height:an}=se.reference,Fe=Z.floating.style;Fe.setProperty("--radix-popper-available-width",`${xe}px`),Fe.setProperty("--radix-popper-available-height",`${Oe}px`),Fe.setProperty("--radix-popper-anchor-width",`${tt}px`),Fe.setProperty("--radix-popper-anchor-height",`${an}px`)}}),S&&Ac({element:S,padding:s}),ay({arrowWidth:E,arrowHeight:R}),p&&Tc({strategy:"referenceHidden",...L})]}),[O,ee]=Yc(j),J=Ee(y);me(()=>{Q&&(J==null||J())},[Q,J]);const P=(A=F.arrow)==null?void 0:A.x,H=(U=F.arrow)==null?void 0:U.y,Y=((z=F.arrow)==null?void 0:z.centerOffset)!==0,[W,X]=u.useState();return me(()=>{b&&X(window.getComputedStyle(b).zIndex)},[b]),d.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:Q?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[(te=F.transformOrigin)==null?void 0:te.x,(ae=F.transformOrigin)==null?void 0:ae.y].join(" "),...((oe=F.hide)==null?void 0:oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(ty,{scope:n,placedSide:O,onArrowChange:C,arrowX:P,arrowY:H,shouldHideArrow:Y,children:d.jsx(V.div,{"data-side":O,"data-align":ee,...g,ref:w,style:{...g.style,animation:Q?void 0:"none"}})})})});Bc.displayName=va;var Hc="PopperArrow",ry={top:"bottom",right:"left",bottom:"top",left:"right"},Vc=u.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,a=ny(Hc,r),i=ry[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(Jv,{...o,ref:n,style:{...o.style,display:"block"}})})});Vc.displayName=Hc;function oy(e){return e!==null}var ay=e=>({name:"transformOrigin",options:e,fn(t){var v,b,x;const{placement:n,rects:r,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,f]=Yc(n),m={start:"0%",center:"50%",end:"100%"}[f],p=(((b=o.arrow)==null?void 0:b.x)??0)+s/2,h=(((x=o.arrow)==null?void 0:x.y)??0)+c/2;let y="",g="";return l==="bottom"?(y=i?m:`${p}px`,g=`${-c}px`):l==="top"?(y=i?m:`${p}px`,g=`${r.floating.height+c}px`):l==="right"?(y=`${-c}px`,g=i?m:`${h}px`):l==="left"&&(y=`${r.floating.width+c}px`,g=i?m:`${h}px`),{data:{x:y,y:g}}}});function Yc(e){const[t,n="center"]=e.split("-");return[t,n]}var ya=$c,Ir=Wc,ba=Bc,xa=Vc,Dr="Popover",[Gc,lE]=ye(Dr,[Jt]),An=Jt(),[sy,Ct]=Gc(Dr),Uc=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!1}=e,s=An(t),c=u.useRef(null),[l,f]=u.useState(!1),[m,p]=Se({prop:r,defaultProp:o??!1,onChange:a,caller:Dr});return d.jsx(ya,{...s,children:d.jsx(sy,{scope:t,contentId:ge(),triggerRef:c,open:m,onOpenChange:p,onOpenToggle:u.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:l,onCustomAnchorAdd:u.useCallback(()=>f(!0),[]),onCustomAnchorRemove:u.useCallback(()=>f(!1),[]),modal:i,children:n})})};Uc.displayName=Dr;var zc="PopoverAnchor",iy=u.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ct(zc,n),a=An(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:s}=o;return u.useEffect(()=>(i(),()=>s()),[i,s]),d.jsx(Ir,{...a,...r,ref:t})});iy.displayName=zc;var Kc="PopoverTrigger",qc=u.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ct(Kc,n),a=An(n),i=q(t,o.triggerRef),s=d.jsx(V.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":tl(o.open),...r,ref:i,onClick:T(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:d.jsx(Ir,{asChild:!0,...a,children:s})});qc.displayName=Kc;var wa="PopoverPortal",[cy,ly]=Gc(wa,{forceMount:void 0}),Xc=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,a=Ct(wa,t);return d.jsx(cy,{scope:t,forceMount:n,children:d.jsx(Ae,{present:n||a.open,children:d.jsx(kn,{asChild:!0,container:o,children:r})})})};Xc.displayName=wa;var zt="PopoverContent",Zc=u.forwardRef((e,t)=>{const n=ly(zt,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,a=Ct(zt,e.__scopePopover);return d.jsx(Ae,{present:r||a.open,children:a.modal?d.jsx(dy,{...o,ref:t}):d.jsx(fy,{...o,ref:t})})});Zc.displayName=zt;var uy=ht("PopoverContent.RemoveScroll"),dy=u.forwardRef((e,t)=>{const n=Ct(zt,e.__scopePopover),r=u.useRef(null),o=q(t,r),a=u.useRef(!1);return u.useEffect(()=>{const i=r.current;if(i)return br(i)},[]),d.jsx(In,{as:uy,allowPinchZoom:!0,children:d.jsx(Qc,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:T(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),a.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:T(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0,l=s.button===2||c;a.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:T(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),fy=u.forwardRef((e,t)=>{const n=Ct(zt,e.__scopePopover),r=u.useRef(!1),o=u.useRef(!1);return d.jsx(Qc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,s;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Qc=u.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:f,...m}=e,p=Ct(zt,n),h=An(n);return vr(),d.jsx(Pn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:d.jsx(Rn,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),children:d.jsx(ba,{"data-state":tl(p.open),role:"dialog",id:p.contentId,...h,...m,ref:t,style:{...m.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)"}})})})}),Jc="PopoverClose",my=u.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ct(Jc,n);return d.jsx(V.button,{type:"button",...r,ref:t,onClick:T(e.onClick,()=>o.onOpenChange(!1))})});my.displayName=Jc;var py="PopoverArrow",el=u.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=An(n);return d.jsx(xa,{...o,...r,ref:t})});el.displayName=py;function tl(e){return e?"open":"closed"}var hy=Uc,gy=qc,vy=Xc,nl=Zc,yy=el;const en=hy,tn=gy,by=yy,Tt=u.forwardRef(({className:e,align:t="center",sideOffset:n=4,hasArrow:r,zIndex:o,children:a,...i},s)=>{const c=je("popover",o);return d.jsx(vy,{children:d.jsxs(nl,{ref:s,align:t,className:k(ie.popover,e),sideOffset:n,style:{zIndex:c,...i.style},...i,children:[a,r?d.jsx(by,{className:"fill-popover stroke-muted stroke-[1px]",height:7,width:15}):null]})})});Tt.displayName=nl.displayName;function xy({loadOptions:e,options:t=[],value:n,onChange:r,placeholder:o="Select an option...",loadingMessage:a="Loading...",emptyMessage:i="No results found",errorMessage:s="Failed to load options",className:c,listClassName:l,popoverClassName:f,maxSuggestions:m=10,debounceMs:p=300,minSearch:h=2,zIndex:y,isDisabled:g=!1,name:v,required:b,autoFocus:x,renderOption:w,renderValue:S,getOptionValue:C,getOptionLabel:M,...E},R){const[$,_]=N.useState(!1),I=je("dropdown",y),[D,L]=N.useState(""),[B,K]=N.useState(!1),[j,Q]=N.useState(!1),[F,O]=N.useState([]),[ee,J]=N.useState(!1),[P,H]=N.useState(void 0),Y=N.useRef();N.useEffect(()=>()=>{Y.current&&clearTimeout(Y.current)},[]),N.useEffect(()=>{n||H(void 0)},[n]);const W=N.useCallback(Z=>C?C(Z):"",[C]),X=N.useCallback(async Z=>{if(e)try{K(!0),Q(!1);const se=await e(Z);O(se.slice(0,m)),J(!0)}catch(se){console.error("Error fetching options:",se),Q(!0),O([])}finally{K(!1)}},[e,m]),A=N.useMemo(()=>{if(e)return[];const Z=D.toLowerCase().trim();return t.filter(se=>Z.length===0?!0:(M?M(se).toLowerCase():W(se).toLowerCase()).includes(Z)).slice(0,m)},[e,t,D,m,M,W]),U=e?F:A,z=N.useMemo(()=>{if(P)return P;if(n&&!e)return t.find(Z=>W(Z)===n)},[P,n,e,t,W]),te=N.useCallback(Z=>{const se=U.find(xe=>W(xe)===Z);se&&(H(se),r(Z,se)),_(!1),L(""),J(!1)},[r,U,W]),ae=N.useCallback(Z=>{L(Z),Z.length===0?J(!1):e||J(!0),Y.current&&clearTimeout(Y.current),e&&Z.length>=h?Y.current=setTimeout(()=>X(Z),p):e&&Z.length===0&&O([])},[e,h,p,X]),oe=N.useCallback(()=>{r("",void 0),H(void 0),L(""),O([]),J(!1)},[r]);return d.jsxs(d.Fragment,{children:[v||b?d.jsx("input",{name:v,required:b,type:"hidden",value:n}):null,d.jsxs(en,{open:$,onOpenChange:_,children:[d.jsx(tn,{asChild:!0,children:d.jsxs(Be,{ref:R,"aria-expanded":$,autoFocus:x,className:k("w-full justify-between px-3",!n&&"text-muted-foreground",c),isDisabled:g,variant:"input",...E,onKeyDown:Z=>{var se;(Z.key==="Delete"||Z.key==="Backspace")&&n&&!$&&(Z.preventDefault(),oe()),(se=E.onKeyDown)==null||se.call(E,Z)},children:[d.jsx("span",{className:"truncate",children:z?S?S(z):(M==null?void 0:M(z))??n:n||o}),d.jsxs("div",{"aria-hidden":"true",className:"flex items-center gap-1",children:[n||D?d.jsx(hr,{className:"h-4 w-4 opacity-50 hover:opacity-100",onClick:Z=>{Z.stopPropagation(),oe()}}):null,d.jsx(ea,{className:"h-4 w-4 shrink-0 opacity-50"})]})]})}),d.jsx(Tt,{align:"start",className:k("min-w-[--radix-popover-trigger-width] px-0 py-0",f),zIndex:I,children:d.jsxs(Cr,{shouldFilter:!1,children:[d.jsx(Nr,{placeholder:o,value:D,onValueChange:ae}),B?d.jsx(hc,{children:a}):null,!B&&j?d.jsx(Ro,{children:s}):null,!B&&!j&&ee&&U.length===0?d.jsx(Ro,{children:i}):null,!B&&!j&&U.length>0?d.jsx(Mr,{className:k("max-h-[16.5rem] overflow-y-auto",l),children:d.jsx(Sr,{children:U.map((Z,se)=>{const xe=W(Z),Oe=!!(xe&&n&&xe===n);return d.jsx(Er,{className:"cursor-pointer",value:xe,onSelect:te,children:w?w(Z,Oe):d.jsxs(d.Fragment,{children:[d.jsx(Dt,{className:k("mr-2 h-4 w-4",Oe?"opacity-100":"opacity-0")}),(M==null?void 0:M(Z))??xe]})},xe||se)})})}):null]})})]})]})}const rl=N.forwardRef(xy);rl.displayName="Autocomplete";const wy=rl,Cy=Ne(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold
|
|
160
160
|
transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:"border-transparent bg-base-200 text-black",primary:"border-transparent bg-primary-400 text-white",success:"border-transparent bg-success-500 text-white",danger:"border-transparent bg-danger-400 text-white",warning:"border-transparent bg-warning-300 text-black",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),ol=u.forwardRef(({className:e,variant:t,...n},r)=>d.jsx("div",{ref:r,className:k(Cy({variant:t,className:e})),...n}));ol.displayName="Badge";const al=u.forwardRef(({items:e,separator:t=d.jsx(Jo,{className:"h-4 w-4"}),className:n,...r},o)=>d.jsx("nav",{ref:o,"aria-label":"Breadcrumb",className:k("flex",n),...r,children:d.jsx("ol",{className:"flex flex-wrap items-center gap-1 pl-0",children:e.map((a,i)=>d.jsxs("li",{className:"flex items-center gap-1",children:[a.href?d.jsx("a",{className:k(ie.link,ie.linkNoUnderline),href:a.href,children:a.label}):d.jsx("span",{"aria-current":"page",className:"font-medium text-foreground",children:a.label}),i<e.length-1?d.jsx("span",{className:"text-muted-foreground",children:t}):null]},i))})}));al.displayName="Breadcrumbs";const mo={},fn={};function hn(e,t){try{const r=(mo[e]||(mo[e]=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return r in fn?fn[r]:ks(r,r.split(":"))}catch{if(e in fn)return fn[e];const n=e==null?void 0:e.match(Sy);return n?ks(e,n.slice(1)):NaN}}const Sy=/([+-]\d\d):?(\d\d)?/;function ks(e,t){const n=+t[0],r=+(t[1]||0);return fn[e]=n>0?n*60+r:n*60-r}class qe extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(hn(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),sl(this),Do(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new qe(...n,t):new qe(Date.now(),t)}withTimeZone(t){return new qe(+this,t)}getTimezoneOffset(){return-hn(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Do(this),+this}[Symbol.for("constructDateFrom")](t){return new qe(+new Date(t),this.timeZone)}}const Is=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Is.test(e))return;const t=e.replace(Is,"$1UTC");qe.prototype[t]&&(e.startsWith("get")?qe.prototype[e]=function(){return this.internal[t]()}:(qe.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Ny(this),+this},qe.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Do(this),+this}))});function Do(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function Ny(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),sl(e)}function sl(e){const t=hn(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),o=-new Date(+n).getTimezoneOffset(),a=r-o,i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);const s=r-t;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const c=hn(e.timeZone,e),f=-new Date(+e).getTimezoneOffset()-c,m=c!==t,p=f-s;if(m&&p){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+p);const h=hn(e.timeZone,e),y=c-h;y&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y))}}class Ce extends qe{static tz(t,...n){return n.length?new Ce(...n,t):new Ce(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),o=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,o]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,o]=this.tzComponents();return`${t} GMT${n}${r}${o} (${Ey(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[n,r,o]}withTimeZone(t){return new Ce(+this,t)}[Symbol.for("constructDateFrom")](t){return new Ce(+new Date(t),this.timeZone)}}function Ey(e,t){return new Intl.DateTimeFormat("en-GB",{timeZone:e,timeZoneName:"long"}).format(t).slice(12)}var G;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(G||(G={}));var he;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(he||(he={}));var We;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(We||(We={}));var ke;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(ke||(ke={}));const il=6048e5,My=864e5,Ds=Symbol.for("constructDateFrom");function be(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ds in e?e[Ds](t):e instanceof Date?new e.constructor(t):new Date(t)}function ue(e,t){return be(t||e,e)}function cl(e,t,n){const r=ue(e,n==null?void 0:n.in);return isNaN(t)?be(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function ll(e,t,n){const r=ue(e,n==null?void 0:n.in);if(isNaN(t))return be(e,NaN);if(!t)return r;const o=r.getDate(),a=be(e,r.getTime());a.setMonth(r.getMonth()+t+1,0);const i=a.getDate();return o>=i?a:(r.setFullYear(a.getFullYear(),a.getMonth(),o),r)}let Ry={};function _n(){return Ry}function Kt(e,t){var s,c,l,f;const n=_n(),r=(t==null?void 0:t.weekStartsOn)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(l=n.locale)==null?void 0:l.options)==null?void 0:f.weekStartsOn)??0,o=ue(e,t==null?void 0:t.in),a=o.getDay(),i=(a<r?7:0)+a-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function xn(e,t){return Kt(e,{...t,weekStartsOn:1})}function ul(e,t){const n=ue(e,t==null?void 0:t.in),r=n.getFullYear(),o=be(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=xn(o),i=be(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const s=xn(i);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Os(e){const t=ue(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function nn(e,...t){const n=be.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function wn(e,t){const n=ue(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function dl(e,t,n){const[r,o]=nn(n==null?void 0:n.in,e,t),a=wn(r),i=wn(o),s=+a-Os(a),c=+i-Os(i);return Math.round((s-c)/My)}function Py(e,t){const n=ul(e,t),r=be(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),xn(r)}function ky(e,t,n){return cl(e,t*7,n)}function Iy(e,t,n){return ll(e,t*12,n)}function Dy(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=be.bind(null,o));const a=ue(o,r);(!n||n<a||isNaN(+a))&&(n=a)}),be(r,n||NaN)}function Oy(e,t){let n,r=t==null?void 0:t.in;return e.forEach(o=>{!r&&typeof o=="object"&&(r=be.bind(null,o));const a=ue(o,r);(!n||n>a||isNaN(+a))&&(n=a)}),be(r,n||NaN)}function Ty(e,t,n){const[r,o]=nn(n==null?void 0:n.in,e,t);return+wn(r)==+wn(o)}function fl(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ay(e){return!(!fl(e)&&typeof e!="number"||isNaN(+ue(e)))}function _y(e,t,n){const[r,o]=nn(n==null?void 0:n.in,e,t),a=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return a*12+i}function jy(e,t){const n=ue(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Fy(e,t){const[n,r]=nn(e,t.start,t.end);return{start:n,end:r}}function $y(e,t){const{start:n,end:r}=Fy(t==null?void 0:t.in,e);let o=+n>+r;const a=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0),i.setDate(1);let s=1;const c=[];for(;+i<=a;)c.push(be(n,i)),i.setMonth(i.getMonth()+s);return o?c.reverse():c}function Ly(e,t){const n=ue(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Wy(e,t){const n=ue(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function ml(e,t){const n=ue(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function pl(e,t){var s,c,l,f;const n=_n(),r=(t==null?void 0:t.weekStartsOn)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(l=n.locale)==null?void 0:l.options)==null?void 0:f.weekStartsOn)??0,o=ue(e,t==null?void 0:t.in),a=o.getDay(),i=(a<r?-7:0)+6-(a-r);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}function By(e,t){return pl(e,{...t,weekStartsOn:1})}const Hy={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Vy=(e,t,n)=>{let r;const o=Hy[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function po(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Yy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Gy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Uy={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zy={date:po({formats:Yy,defaultWidth:"full"}),time:po({formats:Gy,defaultWidth:"full"}),dateTime:po({formats:Uy,defaultWidth:"full"})},Ky={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},qy=(e,t,n,r)=>Ky[e];function un(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):i;o=e.formattingValues[s]||e.formattingValues[i]}else{const i=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[s]||e.values[i]}const a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}const Xy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Zy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Qy={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Jy={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},eb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},tb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},nb=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},rb={ordinalNumber:nb,era:un({values:Xy,defaultWidth:"wide"}),quarter:un({values:Zy,defaultWidth:"wide",argumentCallback:e=>e-1}),month:un({values:Qy,defaultWidth:"wide"}),day:un({values:Jy,defaultWidth:"wide"}),dayPeriod:un({values:eb,defaultWidth:"wide",formattingValues:tb,defaultFormattingWidth:"wide"})};function dn(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const i=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?ab(s,m=>m.test(i)):ob(s,m=>m.test(i));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const f=t.slice(i.length);return{value:l,rest:f}}}function ob(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ab(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function sb(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],a=t.match(e.parsePattern);if(!a)return null;let i=e.valueCallback?e.valueCallback(a[0]):a[0];i=n.valueCallback?n.valueCallback(i):i;const s=t.slice(o.length);return{value:i,rest:s}}}const ib=/^(\d+)(th|st|nd|rd)?/i,cb=/\d+/i,lb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ub={any:[/^b/i,/^(a|c)/i]},db={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fb={any:[/1/i,/2/i,/3/i,/4/i]},mb={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},pb={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},hb={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},gb={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},vb={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},yb={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},bb={ordinalNumber:sb({matchPattern:ib,parsePattern:cb,valueCallback:e=>parseInt(e,10)}),era:dn({matchPatterns:lb,defaultMatchWidth:"wide",parsePatterns:ub,defaultParseWidth:"any"}),quarter:dn({matchPatterns:db,defaultMatchWidth:"wide",parsePatterns:fb,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dn({matchPatterns:mb,defaultMatchWidth:"wide",parsePatterns:pb,defaultParseWidth:"any"}),day:dn({matchPatterns:hb,defaultMatchWidth:"wide",parsePatterns:gb,defaultParseWidth:"any"}),dayPeriod:dn({matchPatterns:vb,defaultMatchWidth:"any",parsePatterns:yb,defaultParseWidth:"any"})},Ca={code:"en-US",formatDistance:Vy,formatLong:zy,formatRelative:qy,localize:rb,match:bb,options:{weekStartsOn:0,firstWeekContainsDate:1}};function xb(e,t){const n=ue(e,t==null?void 0:t.in);return dl(n,ml(n))+1}function hl(e,t){const n=ue(e,t==null?void 0:t.in),r=+xn(n)-+Py(n);return Math.round(r/il)+1}function gl(e,t){var f,m,p,h;const n=ue(e,t==null?void 0:t.in),r=n.getFullYear(),o=_n(),a=(t==null?void 0:t.firstWeekContainsDate)??((m=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(p=o.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,i=be((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,a),i.setHours(0,0,0,0);const s=Kt(i,t),c=be((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);const l=Kt(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function wb(e,t){var s,c,l,f;const n=_n(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(l=n.locale)==null?void 0:l.options)==null?void 0:f.firstWeekContainsDate)??1,o=gl(e,t),a=be((t==null?void 0:t.in)||e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),Kt(a,t)}function vl(e,t){const n=ue(e,t==null?void 0:t.in),r=+Kt(n,t)-+wb(n,t);return Math.round(r/il)+1}function le(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ft={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return le(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):le(n+1,2)},d(e,t){return le(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return le(e.getHours()%12||12,t.length)},H(e,t){return le(e.getHours(),t.length)},m(e,t){return le(e.getMinutes(),t.length)},s(e,t){return le(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return le(o,t.length)}},Wt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ts={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return ft.y(e,t)},Y:function(e,t,n,r){const o=gl(e,r),a=o>0?o:1-o;if(t==="YY"){const i=a%100;return le(i,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):le(a,t.length)},R:function(e,t){const n=ul(e);return le(n,t.length)},u:function(e,t){const n=e.getFullYear();return le(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return le(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return le(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ft.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return le(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=vl(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):le(o,t.length)},I:function(e,t,n){const r=hl(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):le(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ft.d(e,t)},D:function(e,t,n){const r=xb(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):le(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return le(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return le(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return le(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Wt.noon:r===0?o=Wt.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Wt.evening:r>=12?o=Wt.afternoon:r>=4?o=Wt.morning:o=Wt.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ft.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ft.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):le(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):le(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ft.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ft.s(e,t)},S:function(e,t){return ft.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return _s(r);case"XXXX":case"XX":return Et(r);case"XXXXX":case"XXX":default:return Et(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return _s(r);case"xxxx":case"xx":return Et(r);case"xxxxx":case"xxx":default:return Et(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+As(r,":");case"OOOO":default:return"GMT"+Et(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+As(r,":");case"zzzz":default:return"GMT"+Et(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return le(r,t.length)},T:function(e,t,n){return le(+e,t.length)}};function As(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return a===0?n+String(o):n+String(o)+t+le(a,2)}function _s(e,t){return e%60===0?(e>0?"-":"+")+le(Math.abs(e)/60,2):Et(e,t)}function Et(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=le(Math.trunc(r/60),2),a=le(r%60,2);return n+o+t+a}const js=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},yl=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Cb=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return js(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",js(r,t)).replace("{{time}}",yl(o,t))},Sb={p:yl,P:Cb},Nb=/^D+$/,Eb=/^Y+$/,Mb=["D","DD","YY","YYYY"];function Rb(e){return Nb.test(e)}function Pb(e){return Eb.test(e)}function kb(e,t,n){const r=Ib(e,t,n);if(console.warn(r),Mb.includes(e))throw new RangeError(r)}function Ib(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Db=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ob=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Tb=/^'([^]*?)'?$/,Ab=/''/g,_b=/[a-zA-Z]/;function gn(e,t,n){var f,m,p,h,y,g,v,b;const r=_n(),o=(n==null?void 0:n.locale)??r.locale??Ca,a=(n==null?void 0:n.firstWeekContainsDate)??((m=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,i=(n==null?void 0:n.weekStartsOn)??((g=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((b=(v=r.locale)==null?void 0:v.options)==null?void 0:b.weekStartsOn)??0,s=ue(e,n==null?void 0:n.in);if(!Ay(s))throw new RangeError("Invalid time value");let c=t.match(Ob).map(x=>{const w=x[0];if(w==="p"||w==="P"){const S=Sb[w];return S(x,o.formatLong)}return x}).join("").match(Db).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const w=x[0];if(w==="'")return{isToken:!1,value:jb(x)};if(Ts[w])return{isToken:!0,value:x};if(w.match(_b))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:x}});o.localize.preprocessor&&(c=o.localize.preprocessor(s,c));const l={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return c.map(x=>{if(!x.isToken)return x.value;const w=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Pb(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Rb(w))&&kb(w,t,String(e));const S=Ts[w[0]];return S(s,w,o.localize,l)}).join("")}function jb(e){const t=e.match(Tb);return t?t[1].replace(Ab,"'"):e}function Fb(e,t){const n=ue(e,t==null?void 0:t.in),r=n.getFullYear(),o=n.getMonth(),a=be(n,0);return a.setFullYear(r,o+1,0),a.setHours(0,0,0,0),a.getDate()}function $b(e,t){return ue(e,t==null?void 0:t.in).getMonth()}function Lb(e,t){return ue(e,t==null?void 0:t.in).getFullYear()}function Wb(e,t){return+ue(e)>+ue(t)}function Bb(e,t){return+ue(e)<+ue(t)}function Hb(e,t,n){const[r,o]=nn(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}function Vb(e,t,n){const[r,o]=nn(n==null?void 0:n.in,e,t);return r.getFullYear()===o.getFullYear()}function Yb(e,t,n){const r=ue(e,n==null?void 0:n.in),o=r.getFullYear(),a=r.getDate(),i=be(e,0);i.setFullYear(o,t,15),i.setHours(0,0,0,0);const s=Fb(i);return r.setMonth(t,Math.min(a,s)),r}function Gb(e,t,n){const r=ue(e,n==null?void 0:n.in);return isNaN(+r)?be(e,NaN):(r.setFullYear(t),r)}const Fs=5,Ub=4;function zb(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,-r+1),a=t.addDays(o,Fs*7-1);return t.getMonth(e)===t.getMonth(a)?Fs:Ub}function bl(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function Kb(e,t){const n=bl(e,t),r=zb(e,t);return t.addDays(n,r*7-1)}class ct{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Ce.tz(this.options.timeZone):new this.Date},this.newDate=(r,o,a)=>{var i;return(i=this.overrides)!=null&&i.newDate?this.overrides.newDate(r,o,a):this.options.timeZone?new Ce(r,o,a,this.options.timeZone):new Date(r,o,a)},this.addDays=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addDays?this.overrides.addDays(r,o):cl(r,o)},this.addMonths=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addMonths?this.overrides.addMonths(r,o):ll(r,o)},this.addWeeks=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addWeeks?this.overrides.addWeeks(r,o):ky(r,o)},this.addYears=(r,o)=>{var a;return(a=this.overrides)!=null&&a.addYears?this.overrides.addYears(r,o):Iy(r,o)},this.differenceInCalendarDays=(r,o)=>{var a;return(a=this.overrides)!=null&&a.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,o):dl(r,o)},this.differenceInCalendarMonths=(r,o)=>{var a;return(a=this.overrides)!=null&&a.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,o):_y(r,o)},this.eachMonthOfInterval=r=>{var o;return(o=this.overrides)!=null&&o.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):$y(r)},this.endOfBroadcastWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):Kb(r,this)},this.endOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.endOfISOWeek?this.overrides.endOfISOWeek(r):By(r)},this.endOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.endOfMonth?this.overrides.endOfMonth(r):jy(r)},this.endOfWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.endOfWeek?this.overrides.endOfWeek(r,o):pl(r,this.options)},this.endOfYear=r=>{var o;return(o=this.overrides)!=null&&o.endOfYear?this.overrides.endOfYear(r):Wy(r)},this.format=(r,o,a)=>{var s;const i=(s=this.overrides)!=null&&s.format?this.overrides.format(r,o,this.options):gn(r,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(i):i},this.getISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.getISOWeek?this.overrides.getISOWeek(r):hl(r)},this.getMonth=(r,o)=>{var a;return(a=this.overrides)!=null&&a.getMonth?this.overrides.getMonth(r,this.options):$b(r,this.options)},this.getYear=(r,o)=>{var a;return(a=this.overrides)!=null&&a.getYear?this.overrides.getYear(r,this.options):Lb(r,this.options)},this.getWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.getWeek?this.overrides.getWeek(r,this.options):vl(r,this.options)},this.isAfter=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isAfter?this.overrides.isAfter(r,o):Wb(r,o)},this.isBefore=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isBefore?this.overrides.isBefore(r,o):Bb(r,o)},this.isDate=r=>{var o;return(o=this.overrides)!=null&&o.isDate?this.overrides.isDate(r):fl(r)},this.isSameDay=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isSameDay?this.overrides.isSameDay(r,o):Ty(r,o)},this.isSameMonth=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isSameMonth?this.overrides.isSameMonth(r,o):Hb(r,o)},this.isSameYear=(r,o)=>{var a;return(a=this.overrides)!=null&&a.isSameYear?this.overrides.isSameYear(r,o):Vb(r,o)},this.max=r=>{var o;return(o=this.overrides)!=null&&o.max?this.overrides.max(r):Dy(r)},this.min=r=>{var o;return(o=this.overrides)!=null&&o.min?this.overrides.min(r):Oy(r)},this.setMonth=(r,o)=>{var a;return(a=this.overrides)!=null&&a.setMonth?this.overrides.setMonth(r,o):Yb(r,o)},this.setYear=(r,o)=>{var a;return(a=this.overrides)!=null&&a.setYear?this.overrides.setYear(r,o):Gb(r,o)},this.startOfBroadcastWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):bl(r,this)},this.startOfDay=r=>{var o;return(o=this.overrides)!=null&&o.startOfDay?this.overrides.startOfDay(r):wn(r)},this.startOfISOWeek=r=>{var o;return(o=this.overrides)!=null&&o.startOfISOWeek?this.overrides.startOfISOWeek(r):xn(r)},this.startOfMonth=r=>{var o;return(o=this.overrides)!=null&&o.startOfMonth?this.overrides.startOfMonth(r):Ly(r)},this.startOfWeek=(r,o)=>{var a;return(a=this.overrides)!=null&&a.startOfWeek?this.overrides.startOfWeek(r,this.options):Kt(r,this.options)},this.startOfYear=r=>{var o;return(o=this.overrides)!=null&&o.startOfYear?this.overrides.startOfYear(r):ml(r)},this.options={locale:Ca,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let o=0;o<10;o++)r[o.toString()]=n.format(o);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}}const et=new ct;class xl{constructor(t,n,r=et){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class qb{constructor(t,n){this.date=t,this.weeks=n}}class Xb{constructor(t,n){this.days=n,this.weekNumber=t}}function rt(e,t,n=!1,r=et){let{from:o,to:a}=e;const{differenceInCalendarDays:i,isSameDay:s}=r;return o&&a?(i(a,o)<0&&([o,a]=[a,o]),i(t,o)>=(n?1:0)&&i(a,t)>=(n?1:0)):!n&&a?s(a,t):!n&&o?s(o,t):!1}function wl(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Sa(e){return!!(e&&typeof e=="object"&&"from"in e)}function Cl(e){return!!(e&&typeof e=="object"&&"after"in e)}function Sl(e){return!!(e&&typeof e=="object"&&"before"in e)}function Nl(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function El(e,t){return Array.isArray(e)&&e.every(t.isDate)}function ot(e,t,n=et){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:a,isAfter:i}=n;return r.some(s=>{if(typeof s=="boolean")return s;if(n.isDate(s))return o(e,s);if(El(s,n))return s.includes(e);if(Sa(s))return rt(s,e,!1,n);if(Nl(s))return Array.isArray(s.dayOfWeek)?s.dayOfWeek.includes(e.getDay()):s.dayOfWeek===e.getDay();if(wl(s)){const c=a(s.before,e),l=a(s.after,e),f=c>0,m=l<0;return i(s.before,s.after)?m&&f:f||m}return Cl(s)?a(e,s.after)>0:Sl(s)?a(s.before,e)>0:typeof s=="function"?s(e):!1})}function Zb(e,t,n){const{disabled:r,hidden:o,modifiers:a,showOutsideDays:i,broadcastCalendar:s,today:c}=t,{isSameDay:l,isSameMonth:f,startOfMonth:m,isBefore:p,endOfMonth:h,isAfter:y}=n,g=t.startMonth&&m(t.startMonth),v=t.endMonth&&h(t.endMonth),b={[he.focused]:[],[he.outside]:[],[he.disabled]:[],[he.hidden]:[],[he.today]:[]},x={};for(const w of e){const{date:S,displayMonth:C}=w,M=!!(C&&!f(S,C)),E=!!(g&&p(S,g)),R=!!(v&&y(S,v)),$=!!(r&&ot(S,r,n)),_=!!(o&&ot(S,o,n))||E||R||!s&&!i&&M||s&&i===!1&&M,I=l(S,c??n.today());M&&b.outside.push(w),$&&b.disabled.push(w),_&&b.hidden.push(w),I&&b.today.push(w),a&&Object.keys(a).forEach(D=>{const L=a==null?void 0:a[D];L&&ot(S,L,n)&&(x[D]?x[D].push(w):x[D]=[w])})}return w=>{const S={[he.focused]:!1,[he.disabled]:!1,[he.hidden]:!1,[he.outside]:!1,[he.today]:!1},C={};for(const M in b){const E=b[M];S[M]=E.some(R=>R===w)}for(const M in x)C[M]=x[M].some(E=>E===w);return{...S,...C}}}function Qb(e,t,n={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[a])=>(n[a]?o.push(n[a]):t[he[a]]?o.push(t[he[a]]):t[We[a]]&&o.push(t[We[a]]),o),[t[G.Day]])}function Jb(e){return N.createElement("button",{...e})}function ex(e){return N.createElement("span",{...e})}function tx(e){const{size:t=24,orientation:n="left",className:r}=e;return N.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&N.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&N.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&N.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&N.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function nx(e){const{day:t,modifiers:n,...r}=e;return N.createElement("td",{...r})}function rx(e){const{day:t,modifiers:n,...r}=e,o=N.useRef(null);return N.useEffect(()=>{var a;n.focused&&((a=o.current)==null||a.focus())},[n.focused]),N.createElement("button",{ref:o,...r})}function ox(e){const{options:t,className:n,components:r,classNames:o,...a}=e,i=[o[G.Dropdown],n].join(" "),s=t==null?void 0:t.find(({value:c})=>c===a.value);return N.createElement("span",{"data-disabled":a.disabled,className:o[G.DropdownRoot]},N.createElement(r.Select,{className:i,...a},t==null?void 0:t.map(({value:c,label:l,disabled:f})=>N.createElement(r.Option,{key:c,value:c,disabled:f},l))),N.createElement("span",{className:o[G.CaptionLabel],"aria-hidden":!0},s==null?void 0:s.label,N.createElement(r.Chevron,{orientation:"down",size:18,className:o[G.Chevron]})))}function ax(e){return N.createElement("div",{...e})}function sx(e){return N.createElement("div",{...e})}function ix(e){const{calendarMonth:t,displayIndex:n,...r}=e;return N.createElement("div",{...r},e.children)}function cx(e){const{calendarMonth:t,displayIndex:n,...r}=e;return N.createElement("div",{...r})}function lx(e){return N.createElement("table",{...e})}function ux(e){return N.createElement("div",{...e})}const Ml=N.createContext(void 0);function jn(){const e=N.useContext(Ml);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function dx(e){const{components:t}=jn();return N.createElement(t.Dropdown,{...e})}function fx(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...a}=e,{components:i,classNames:s,labels:{labelPrevious:c,labelNext:l}}=jn(),f=N.useCallback(p=>{o&&(n==null||n(p))},[o,n]),m=N.useCallback(p=>{r&&(t==null||t(p))},[r,t]);return N.createElement("nav",{...a},N.createElement(i.PreviousMonthButton,{type:"button",className:s[G.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:m},N.createElement(i.Chevron,{disabled:r?void 0:!0,className:s[G.Chevron],orientation:"left"})),N.createElement(i.NextMonthButton,{type:"button",className:s[G.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":l(o),onClick:f},N.createElement(i.Chevron,{disabled:o?void 0:!0,orientation:"right",className:s[G.Chevron]})))}function mx(e){const{components:t}=jn();return N.createElement(t.Button,{...e})}function px(e){return N.createElement("option",{...e})}function hx(e){const{components:t}=jn();return N.createElement(t.Button,{...e})}function gx(e){const{rootRef:t,...n}=e;return N.createElement("div",{...n,ref:t})}function vx(e){return N.createElement("select",{...e})}function yx(e){const{week:t,...n}=e;return N.createElement("tr",{...n})}function bx(e){return N.createElement("th",{...e})}function xx(e){return N.createElement("thead",{"aria-hidden":!0},N.createElement("tr",{...e}))}function wx(e){const{week:t,...n}=e;return N.createElement("th",{...n})}function Cx(e){return N.createElement("th",{...e})}function Sx(e){return N.createElement("tbody",{...e})}function Nx(e){const{components:t}=jn();return N.createElement(t.Dropdown,{...e})}const Ex=Object.freeze(Object.defineProperty({__proto__:null,Button:Jb,CaptionLabel:ex,Chevron:tx,Day:nx,DayButton:rx,Dropdown:ox,DropdownNav:ax,Footer:sx,Month:ix,MonthCaption:cx,MonthGrid:lx,Months:ux,MonthsDropdown:dx,Nav:fx,NextMonthButton:mx,Option:px,PreviousMonthButton:hx,Root:gx,Select:vx,Week:yx,WeekNumber:wx,WeekNumberHeader:Cx,Weekday:bx,Weekdays:xx,Weeks:Sx,YearsDropdown:Nx},Symbol.toStringTag,{value:"Module"}));function Mx(e){return{...Ex,...e}}function Rx(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function Px(){const e={};for(const t in G)e[G[t]]=`rdp-${G[t]}`;for(const t in he)e[he[t]]=`rdp-${he[t]}`;for(const t in We)e[We[t]]=`rdp-${We[t]}`;for(const t in ke)e[ke[t]]=`rdp-${ke[t]}`;return e}function Rl(e,t,n){return(n??new ct(t)).format(e,"LLLL y")}const kx=Rl;function Ix(e,t,n){return(n??new ct(t)).format(e,"d")}function Dx(e,t=et){return t.format(e,"LLLL")}function Ox(e,t=et){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function Tx(){return""}function Ax(e,t,n){return(n??new ct(t)).format(e,"cccccc")}function Pl(e,t=et){return t.format(e,"yyyy")}const _x=Pl,jx=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Rl,formatDay:Ix,formatMonthCaption:kx,formatMonthDropdown:Dx,formatWeekNumber:Ox,formatWeekNumberHeader:Tx,formatWeekdayName:Ax,formatYearCaption:_x,formatYearDropdown:Pl},Symbol.toStringTag,{value:"Module"}));function Fx(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...jx,...e}}function $x(e,t,n,r,o){const{startOfMonth:a,startOfYear:i,endOfYear:s,eachMonthOfInterval:c,getMonth:l}=o;return c({start:i(e),end:s(e)}).map(p=>{const h=r.formatMonthDropdown(p,o),y=l(p),g=t&&p<a(t)||n&&p>a(n)||!1;return{value:y,label:h,disabled:g}})}function Lx(e,t={},n={}){let r={...t==null?void 0:t[G.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{r={...r,...n==null?void 0:n[o]}}),r}function Wx(e,t,n){const r=e.today(),o=t?e.startOfISOWeek(r):e.startOfWeek(r),a=[];for(let i=0;i<7;i++){const s=e.addDays(o,i);a.push(s)}return a}function Bx(e,t,n,r){if(!e||!t)return;const{startOfYear:o,endOfYear:a,addYears:i,getYear:s,isBefore:c,isSameYear:l}=r,f=o(e),m=a(t),p=[];let h=f;for(;c(h,m)||l(h,m);)p.push(h),h=i(h,1);return p.map(y=>{const g=n.formatYearDropdown(y,r);return{value:s(y),label:g,disabled:!1}})}function kl(e,t,n){return(n??new ct(t)).format(e,"LLLL y")}const Hx=kl;function Vx(e,t,n,r){let o=(r??new ct(n)).format(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o}function Il(e,t,n,r){let o=(r??new ct(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const Yx=Il;function Gx(){return""}function Ux(e){return"Choose the Month"}function zx(e){return"Go to the Next Month"}function Kx(e){return"Go to the Previous Month"}function qx(e,t,n){return(n??new ct(t)).format(e,"cccc")}function Xx(e,t){return`Week ${e}`}function Zx(e){return"Week Number"}function Qx(e){return"Choose the Year"}const Jx=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Hx,labelDay:Yx,labelDayButton:Il,labelGrid:kl,labelGridcell:Vx,labelMonthDropdown:Ux,labelNav:Gx,labelNext:zx,labelPrevious:Kx,labelWeekNumber:Xx,labelWeekNumberHeader:Zx,labelWeekday:qx,labelYearDropdown:Qx},Symbol.toStringTag,{value:"Module"})),Fn=e=>e instanceof HTMLElement?e:null,ho=e=>[...e.querySelectorAll("[data-animated-month]")??[]],ew=e=>Fn(e.querySelector("[data-animated-month]")),go=e=>Fn(e.querySelector("[data-animated-caption]")),vo=e=>Fn(e.querySelector("[data-animated-weeks]")),tw=e=>Fn(e.querySelector("[data-animated-nav]")),nw=e=>Fn(e.querySelector("[data-animated-weekdays]"));function rw(e,t,{classNames:n,months:r,focused:o,dateLib:a}){const i=N.useRef(null),s=N.useRef(r),c=N.useRef(!1);N.useLayoutEffect(()=>{const l=s.current;if(s.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;const f=a.isSameMonth(r[0].date,l[0].date),m=a.isAfter(r[0].date,l[0].date),p=m?n[ke.caption_after_enter]:n[ke.caption_before_enter],h=m?n[ke.weeks_after_enter]:n[ke.weeks_before_enter],y=i.current,g=e.current.cloneNode(!0);if(g instanceof HTMLElement?(ho(g).forEach(w=>{if(!(w instanceof HTMLElement))return;const S=ew(w);S&&w.contains(S)&&w.removeChild(S);const C=go(w);C&&C.classList.remove(p);const M=vo(w);M&&M.classList.remove(h)}),i.current=g):i.current=null,c.current||f||o)return;const v=y instanceof HTMLElement?ho(y):[],b=ho(e.current);if(b&&b.every(x=>x instanceof HTMLElement)&&v&&v.every(x=>x instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const x=tw(e.current);x&&(x.style.zIndex="1"),b.forEach((w,S)=>{const C=v[S];if(!C)return;w.style.position="relative",w.style.overflow="hidden";const M=go(w);M&&M.classList.add(p);const E=vo(w);E&&E.classList.add(h);const R=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),x&&(x.style.zIndex=""),M&&M.classList.remove(p),E&&E.classList.remove(h),w.style.position="",w.style.overflow="",w.contains(C)&&w.removeChild(C)};C.style.pointerEvents="none",C.style.position="absolute",C.style.overflow="hidden",C.setAttribute("aria-hidden","true");const $=nw(C);$&&($.style.opacity="0");const _=go(C);_&&(_.classList.add(m?n[ke.caption_before_exit]:n[ke.caption_after_exit]),_.addEventListener("animationend",R));const I=vo(C);I&&I.classList.add(m?n[ke.weeks_before_exit]:n[ke.weeks_after_exit]),w.insertBefore(C,w.firstChild)})}})}function ow(e,t,n,r){const o=e[0],a=e[e.length-1],{ISOWeek:i,fixedWeeks:s,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:f,differenceInCalendarMonths:m,endOfBroadcastWeek:p,endOfISOWeek:h,endOfMonth:y,endOfWeek:g,isAfter:v,startOfBroadcastWeek:b,startOfISOWeek:x,startOfWeek:w}=r,S=c?b(o,r):i?x(o):w(o),C=c?p(a):i?h(y(a)):g(y(a)),M=f(C,S),E=m(a,o)+1,R=[];for(let I=0;I<=M;I++){const D=l(S,I);if(t&&v(D,t))break;R.push(D)}const _=(c?35:42)*E;if(s&&R.length<_){const I=_-R.length;for(let D=0;D<I;D++){const L=l(R[R.length-1],1);R.push(L)}}return R}function aw(e){const t=[];return e.reduce((n,r)=>{const o=r.weeks.reduce((a,i)=>[...a,...i.days],t);return[...n,...o]},t)}function sw(e,t,n,r){const{numberOfMonths:o=1}=n,a=[];for(let i=0;i<o;i++){const s=r.addMonths(e,i);if(t&&s>t)break;a.push(s)}return a}function $s(e,t){const{month:n,defaultMonth:r,today:o=t.today(),numberOfMonths:a=1,endMonth:i,startMonth:s}=e;let c=n||r||o;const{differenceInCalendarMonths:l,addMonths:f,startOfMonth:m}=t;if(i&&l(i,c)<0){const p=-1*(a-1);c=f(i,p)}return s&&l(c,s)<0&&(c=s),m(c)}function iw(e,t,n,r){const{addDays:o,endOfBroadcastWeek:a,endOfISOWeek:i,endOfMonth:s,endOfWeek:c,getISOWeek:l,getWeek:f,startOfBroadcastWeek:m,startOfISOWeek:p,startOfWeek:h}=r,y=e.reduce((g,v)=>{const b=n.broadcastCalendar?m(v,r):n.ISOWeek?p(v):h(v),x=n.broadcastCalendar?a(v):n.ISOWeek?i(s(v)):c(s(v)),w=t.filter(E=>E>=b&&E<=x),S=n.broadcastCalendar?35:42;if(n.fixedWeeks&&w.length<S){const E=t.filter(R=>{const $=S-w.length;return R>x&&R<=o(x,$)});w.push(...E)}const C=w.reduce((E,R)=>{const $=n.ISOWeek?l(R):f(R),_=E.find(D=>D.weekNumber===$),I=new xl(R,v,r);return _?_.days.push(I):E.push(new Xb($,[I])),E},[]),M=new qb(v,C);return g.push(M),g},[]);return n.reverseMonths?y.reverse():y}function cw(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:a,startOfMonth:i,endOfMonth:s,addYears:c,endOfYear:l,newDate:f,today:m}=t,{fromYear:p,toYear:h,fromMonth:y,toMonth:g}=e;!n&&y&&(n=y),!n&&p&&(n=t.newDate(p,0,1)),!r&&g&&(r=g),!r&&h&&(r=f(h,11,31));const v=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=i(n):p?n=f(p,0,1):!n&&v&&(n=o(c(e.today??m(),-100))),r?r=s(r):h?r=f(h,11,31):!r&&v&&(r=l(e.today??m())),[n&&a(n),r&&a(r)]}function lw(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a=1}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:c}=r,l=o?a:1,f=i(e);if(!t)return s(f,l);if(!(c(t,e)<a))return s(f,l)}function uw(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:c}=r,l=o?a??1:1,f=i(e);if(!t)return s(f,-l);if(!(c(f,t)<=0))return s(f,-l)}function dw(e){const t=[];return e.reduce((n,r)=>[...n,...r.weeks],t)}function Or(e,t){const[n,r]=N.useState(e);return[t===void 0?n:t,r]}function fw(e,t){const[n,r]=cw(e,t),{startOfMonth:o,endOfMonth:a}=t,i=$s(e,t),[s,c]=Or(i,e.month?i:void 0);N.useEffect(()=>{const M=$s(e,t);c(M)},[e.timeZone]);const l=sw(s,r,e,t),f=ow(l,e.endMonth?a(e.endMonth):void 0,e,t),m=iw(l,f,e,t),p=dw(m),h=aw(m),y=uw(s,n,e,t),g=lw(s,r,e,t),{disableNavigation:v,onMonthChange:b}=e,x=M=>p.some(E=>E.days.some(R=>R.isEqualTo(M))),w=M=>{if(v)return;let E=o(M);n&&E<o(n)&&(E=o(n)),r&&E>o(r)&&(E=o(r)),c(E),b==null||b(E)};return{months:m,weeks:p,days:h,navStart:n,navEnd:r,previousMonth:y,nextMonth:g,goToMonth:w,goToDay:M=>{x(M)||w(M.date)}}}var ze;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(ze||(ze={}));function Ls(e){return!e[he.disabled]&&!e[he.hidden]&&!e[he.outside]}function mw(e,t,n,r){let o,a=-1;for(const i of e){const s=t(i);Ls(s)&&(s[he.focused]&&a<ze.FocusedModifier?(o=i,a=ze.FocusedModifier):r!=null&&r.isEqualTo(i)&&a<ze.LastFocused?(o=i,a=ze.LastFocused):n(i.date)&&a<ze.Selected?(o=i,a=ze.Selected):s[he.today]&&a<ze.Today&&(o=i,a=ze.Today))}return o||(o=e.find(i=>Ls(t(i)))),o}function pw(e,t,n,r,o,a,i){const{ISOWeek:s,broadcastCalendar:c}=a,{addDays:l,addMonths:f,addWeeks:m,addYears:p,endOfBroadcastWeek:h,endOfISOWeek:y,endOfWeek:g,max:v,min:b,startOfBroadcastWeek:x,startOfISOWeek:w,startOfWeek:S}=i;let M={day:l,week:m,month:f,year:p,startOfWeek:E=>c?x(E,i):s?w(E):S(E),endOfWeek:E=>c?h(E):s?y(E):g(E)}[e](n,t==="after"?1:-1);return t==="before"&&r?M=v([r,M]):t==="after"&&o&&(M=b([o,M])),M}function Dl(e,t,n,r,o,a,i,s=0){if(s>365)return;const c=pw(e,t,n.date,r,o,a,i),l=!!(a.disabled&&ot(c,a.disabled,i)),f=!!(a.hidden&&ot(c,a.hidden,i)),m=c,p=new xl(c,m,i);return!l&&!f?p:Dl(e,t,p,r,o,a,i,s+1)}function hw(e,t,n,r,o){const{autoFocus:a}=e,[i,s]=N.useState(),c=mw(t.days,n,r||(()=>!1),i),[l,f]=N.useState(a?c:void 0);return{isFocusTarget:g=>!!(c!=null&&c.isEqualTo(g)),setFocused:f,focused:l,blur:()=>{s(l),f(void 0)},moveFocus:(g,v)=>{if(!l)return;const b=Dl(g,v,l,t.navStart,t.navEnd,e,o);b&&(t.goToDay(b),f(b))}}}function gw(e,t){const{selected:n,required:r,onSelect:o}=e,[a,i]=Or(n,o?n:void 0),s=o?n:a,{isSameDay:c}=t,l=h=>(s==null?void 0:s.some(y=>c(y,h)))??!1,{min:f,max:m}=e;return{selected:s,select:(h,y,g)=>{let v=[...s??[]];if(l(h)){if((s==null?void 0:s.length)===f||r&&(s==null?void 0:s.length)===1)return;v=s==null?void 0:s.filter(b=>!c(b,h))}else(s==null?void 0:s.length)===m?v=[h]:v=[...v,h];return o||i(v),o==null||o(v,h,y,g),v},isSelected:l}}function vw(e,t,n=0,r=0,o=!1,a=et){const{from:i,to:s}=t||{},{isSameDay:c,isAfter:l,isBefore:f}=a;let m;if(!i&&!s)m={from:e,to:n>0?void 0:e};else if(i&&!s)c(i,e)?o?m={from:i,to:void 0}:m=void 0:f(e,i)?m={from:e,to:i}:m={from:i,to:e};else if(i&&s)if(c(i,e)&&c(s,e))o?m={from:i,to:s}:m=void 0;else if(c(i,e))m={from:i,to:n>0?void 0:e};else if(c(s,e))m={from:e,to:n>0?void 0:e};else if(f(e,i))m={from:e,to:s};else if(l(e,i))m={from:i,to:e};else if(l(e,s))m={from:i,to:e};else throw new Error("Invalid range");if(m!=null&&m.from&&(m!=null&&m.to)){const p=a.differenceInCalendarDays(m.to,m.from);r>0&&p>r?m={from:e,to:void 0}:n>1&&p<n&&(m={from:e,to:void 0})}return m}function yw(e,t,n=et){const r=Array.isArray(t)?t:[t];let o=e.from;const a=n.differenceInCalendarDays(e.to,e.from),i=Math.min(a,6);for(let s=0;s<=i;s++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}function Ws(e,t,n=et){return rt(e,t.from,!1,n)||rt(e,t.to,!1,n)||rt(t,e.from,!1,n)||rt(t,e.to,!1,n)}function bw(e,t,n=et){const r=Array.isArray(t)?t:[t];if(r.filter(s=>typeof s!="function").some(s=>typeof s=="boolean"?s:n.isDate(s)?rt(e,s,!1,n):El(s,n)?s.some(c=>rt(e,c,!1,n)):Sa(s)?s.from&&s.to?Ws(e,{from:s.from,to:s.to},n):!1:Nl(s)?yw(e,s.dayOfWeek,n):wl(s)?n.isAfter(s.before,s.after)?Ws(e,{from:n.addDays(s.after,1),to:n.addDays(s.before,-1)},n):ot(e.from,s,n)||ot(e.to,s,n):Cl(s)||Sl(s)?ot(e.from,s,n)||ot(e.to,s,n):!1))return!0;const i=r.filter(s=>typeof s=="function");if(i.length){let s=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let l=0;l<=c;l++){if(i.some(f=>f(s)))return!0;s=n.addDays(s,1)}}return!1}function xw(e,t){const{disabled:n,excludeDisabled:r,selected:o,required:a,onSelect:i}=e,[s,c]=Or(o,i?o:void 0),l=i?o:s;return{selected:l,select:(p,h,y)=>{const{min:g,max:v}=e,b=p?vw(p,l,g,v,a,t):void 0;return r&&n&&(b!=null&&b.from)&&b.to&&bw({from:b.from,to:b.to},n,t)&&(b.from=p,b.to=void 0),i||c(b),i==null||i(b,p,h,y),b},isSelected:p=>l&&rt(l,p,!1,t)}}function ww(e,t){const{selected:n,required:r,onSelect:o}=e,[a,i]=Or(n,o?n:void 0),s=o?n:a,{isSameDay:c}=t;return{selected:s,select:(m,p,h)=>{let y=m;return!r&&s&&s&&c(m,s)&&(y=void 0),o||i(y),o==null||o(y,m,p,h),y},isSelected:m=>s?c(s,m):!1}}function Cw(e,t){const n=ww(e,t),r=gw(e,t),o=xw(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}function Sw(e){var qa;let t=e;t.timeZone&&(t={...e},t.today&&(t.today=new Ce(t.today,t.timeZone)),t.month&&(t.month=new Ce(t.month,t.timeZone)),t.defaultMonth&&(t.defaultMonth=new Ce(t.defaultMonth,t.timeZone)),t.startMonth&&(t.startMonth=new Ce(t.startMonth,t.timeZone)),t.endMonth&&(t.endMonth=new Ce(t.endMonth,t.timeZone)),t.mode==="single"&&t.selected?t.selected=new Ce(t.selected,t.timeZone):t.mode==="multiple"&&t.selected?t.selected=(qa=t.selected)==null?void 0:qa.map(re=>new Ce(re,t.timeZone)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?new Ce(t.selected.from,t.timeZone):void 0,to:t.selected.to?new Ce(t.selected.to,t.timeZone):void 0}));const{components:n,formatters:r,labels:o,dateLib:a,locale:i,classNames:s}=N.useMemo(()=>{const re={...Ca,...t.locale};return{dateLib:new ct({locale:re,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:Mx(t.components),formatters:Fx(t.formatters),labels:{...Jx,...t.labels},locale:re,classNames:{...Px(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]),{captionLayout:c,mode:l,navLayout:f,numberOfMonths:m=1,onDayBlur:p,onDayClick:h,onDayFocus:y,onDayKeyDown:g,onDayMouseEnter:v,onDayMouseLeave:b,onNextClick:x,onPrevClick:w,showWeekNumber:S,styles:C}=t,{formatCaption:M,formatDay:E,formatMonthDropdown:R,formatWeekNumber:$,formatWeekNumberHeader:_,formatWeekdayName:I,formatYearDropdown:D}=r,L=fw(t,a),{days:B,months:K,navStart:j,navEnd:Q,previousMonth:F,nextMonth:O,goToMonth:ee}=L,J=Zb(B,t,a),{isSelected:P,select:H,selected:Y}=Cw(t,a)??{},{blur:W,focused:X,isFocusTarget:A,moveFocus:U,setFocused:z}=hw(t,L,J,P??(()=>!1),a),{labelDayButton:te,labelGridcell:ae,labelGrid:oe,labelMonthDropdown:Z,labelNav:se,labelPrevious:xe,labelNext:Oe,labelWeekday:tt,labelWeekNumber:an,labelWeekNumberHeader:Fe,labelYearDropdown:rm}=o,om=N.useMemo(()=>Wx(a,t.ISOWeek),[a,t.ISOWeek]),za=l!==void 0||h!==void 0,qr=N.useCallback(()=>{F&&(ee(F),w==null||w(F))},[F,ee,w]),Xr=N.useCallback(()=>{O&&(ee(O),x==null||x(O))},[ee,O,x]),am=N.useCallback((re,pe)=>de=>{de.preventDefault(),de.stopPropagation(),z(re),H==null||H(re.date,pe,de),h==null||h(re.date,pe,de)},[H,h,z]),sm=N.useCallback((re,pe)=>de=>{z(re),y==null||y(re.date,pe,de)},[y,z]),im=N.useCallback((re,pe)=>de=>{W(),p==null||p(re.date,pe,de)},[W,p]),cm=N.useCallback((re,pe)=>de=>{const lt={ArrowLeft:["day",t.dir==="rtl"?"after":"before"],ArrowRight:["day",t.dir==="rtl"?"before":"after"],ArrowDown:["week","after"],ArrowUp:["week","before"],PageUp:[de.shiftKey?"year":"month","before"],PageDown:[de.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(lt[de.key]){de.preventDefault(),de.stopPropagation();const[$e,Vn]=lt[de.key];U($e,Vn)}g==null||g(re.date,pe,de)},[U,g,t.dir]),lm=N.useCallback((re,pe)=>de=>{v==null||v(re.date,pe,de)},[v]),um=N.useCallback((re,pe)=>de=>{b==null||b(re.date,pe,de)},[b]),dm=N.useCallback(re=>pe=>{const de=Number(pe.target.value),lt=a.setMonth(a.startOfMonth(re),de);ee(lt)},[a,ee]),fm=N.useCallback(re=>pe=>{const de=Number(pe.target.value),lt=a.setYear(a.startOfMonth(re),de);ee(lt)},[a,ee]),{className:mm,style:pm}=N.useMemo(()=>({className:[s[G.Root],t.className].filter(Boolean).join(" "),style:{...C==null?void 0:C[G.Root],...t.style}}),[s,t.className,t.style,C]),hm=Rx(t),Ka=N.useRef(null);rw(Ka,!!t.animate,{classNames:s,months:K,focused:X,dateLib:a});const gm={dayPickerProps:t,selected:Y,select:H,isSelected:P,months:K,nextMonth:O,previousMonth:F,goToMonth:ee,getModifiers:J,components:n,classNames:s,styles:C,labels:o,formatters:r};return N.createElement(Ml.Provider,{value:gm},N.createElement(n.Root,{rootRef:t.animate?Ka:void 0,className:mm,style:pm,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],...hm},N.createElement(n.Months,{className:s[G.Months],style:C==null?void 0:C[G.Months]},!t.hideNavigation&&!f&&N.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:s[G.Nav],style:C==null?void 0:C[G.Nav],"aria-label":se(),onPreviousClick:qr,onNextClick:Xr,previousMonth:F,nextMonth:O}),K.map((re,pe)=>{const de=$x(re.date,j,Q,r,a),lt=Bx(j,Q,r,a);return N.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:s[G.Month],style:C==null?void 0:C[G.Month],key:pe,displayIndex:pe,calendarMonth:re},f==="around"&&!t.hideNavigation&&pe===0&&N.createElement(n.PreviousMonthButton,{type:"button",className:s[G.PreviousMonthButton],tabIndex:F?void 0:-1,"aria-disabled":F?void 0:!0,"aria-label":xe(F),onClick:qr,"data-animated-button":t.animate?"true":void 0},N.createElement(n.Chevron,{disabled:F?void 0:!0,className:s[G.Chevron],orientation:t.dir==="rtl"?"right":"left"})),N.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:s[G.MonthCaption],style:C==null?void 0:C[G.MonthCaption],calendarMonth:re,displayIndex:pe},c!=null&&c.startsWith("dropdown")?N.createElement(n.DropdownNav,{className:s[G.Dropdowns],style:C==null?void 0:C[G.Dropdowns]},c==="dropdown"||c==="dropdown-months"?N.createElement(n.MonthsDropdown,{className:s[G.MonthsDropdown],"aria-label":Z(),classNames:s,components:n,disabled:!!t.disableNavigation,onChange:dm(re.date),options:de,style:C==null?void 0:C[G.Dropdown],value:a.getMonth(re.date)}):N.createElement("span",null,R(re.date,a)),c==="dropdown"||c==="dropdown-years"?N.createElement(n.YearsDropdown,{className:s[G.YearsDropdown],"aria-label":rm(a.options),classNames:s,components:n,disabled:!!t.disableNavigation,onChange:fm(re.date),options:lt,style:C==null?void 0:C[G.Dropdown],value:a.getYear(re.date)}):N.createElement("span",null,D(re.date,a)),N.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},M(re.date,a.options,a))):N.createElement(n.CaptionLabel,{className:s[G.CaptionLabel],role:"status","aria-live":"polite"},M(re.date,a.options,a))),f==="around"&&!t.hideNavigation&&pe===m-1&&N.createElement(n.NextMonthButton,{type:"button",className:s[G.NextMonthButton],tabIndex:O?void 0:-1,"aria-disabled":O?void 0:!0,"aria-label":Oe(O),onClick:Xr,"data-animated-button":t.animate?"true":void 0},N.createElement(n.Chevron,{disabled:O?void 0:!0,className:s[G.Chevron],orientation:t.dir==="rtl"?"left":"right"})),pe===m-1&&f==="after"&&!t.hideNavigation&&N.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:s[G.Nav],style:C==null?void 0:C[G.Nav],"aria-label":se(),onPreviousClick:qr,onNextClick:Xr,previousMonth:F,nextMonth:O}),N.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":l==="multiple"||l==="range","aria-label":oe(re.date,a.options,a)||void 0,className:s[G.MonthGrid],style:C==null?void 0:C[G.MonthGrid]},!t.hideWeekdays&&N.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:s[G.Weekdays],style:C==null?void 0:C[G.Weekdays]},S&&N.createElement(n.WeekNumberHeader,{"aria-label":Fe(a.options),className:s[G.WeekNumberHeader],style:C==null?void 0:C[G.WeekNumberHeader],scope:"col"},_()),om.map(($e,Vn)=>N.createElement(n.Weekday,{"aria-label":tt($e,a.options,a),className:s[G.Weekday],key:Vn,style:C==null?void 0:C[G.Weekday],scope:"col"},I($e,a.options,a)))),N.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:s[G.Weeks],style:C==null?void 0:C[G.Weeks]},re.weeks.map(($e,Vn)=>N.createElement(n.Week,{className:s[G.Week],key:$e.weekNumber,style:C==null?void 0:C[G.Week],week:$e},S&&N.createElement(n.WeekNumber,{week:$e,style:C==null?void 0:C[G.WeekNumber],"aria-label":an($e.weekNumber,{locale:i}),className:s[G.WeekNumber],scope:"row",role:"rowheader"},$($e.weekNumber,a)),$e.days.map(we=>{const{date:Ue}=we,ce=J(we);if(ce[he.focused]=!ce.hidden&&!!(X!=null&&X.isEqualTo(we)),ce[We.selected]=(P==null?void 0:P(Ue))||ce.selected,Sa(Y)){const{from:Zr,to:Qr}=Y;ce[We.range_start]=!!(Zr&&Qr&&a.isSameDay(Ue,Zr)),ce[We.range_end]=!!(Zr&&Qr&&a.isSameDay(Ue,Qr)),ce[We.range_middle]=rt(Y,Ue,!0,a)}const vm=Lx(ce,C,t.modifiersStyles),ym=Qb(ce,s,t.modifiersClassNames),bm=!za&&!ce.hidden?ae(Ue,ce,a.options,a):void 0;return N.createElement(n.Day,{key:`${a.format(Ue,"yyyy-MM-dd")}_${a.format(we.displayMonth,"yyyy-MM")}`,day:we,modifiers:ce,className:ym.join(" "),style:vm,role:"gridcell","aria-selected":ce.selected||void 0,"aria-label":bm,"data-day":a.format(Ue,"yyyy-MM-dd"),"data-month":we.outside?a.format(Ue,"yyyy-MM"):void 0,"data-selected":ce.selected||void 0,"data-disabled":ce.disabled||void 0,"data-hidden":ce.hidden||void 0,"data-outside":we.outside||void 0,"data-focused":ce.focused||void 0,"data-today":ce.today||void 0},!ce.hidden&&za?N.createElement(n.DayButton,{className:s[G.DayButton],style:C==null?void 0:C[G.DayButton],type:"button",day:we,modifiers:ce,disabled:ce.disabled||void 0,tabIndex:A(we)?0:-1,"aria-label":te(Ue,ce,a.options,a),onClick:am(we,ce),onBlur:im(we,ce),onFocus:sm(we,ce),onKeyDown:cm(we,ce),onMouseEnter:lm(we,ce),onMouseLeave:um(we,ce)},E(Ue,a.options,a)):!ce.hidden&&E(we.date,a.options,a))}))))))})),t.footer&&N.createElement(n.Footer,{className:s[G.Footer],style:C==null?void 0:C[G.Footer],role:"status","aria-live":"polite"},t.footer)))}function Nw(e){function t(n){if(e==="month"||e==="year")return d.jsx(d.Fragment,{});const{orientation:r}=n;return r==="left"?d.jsx(Yp,{...n}):d.jsx(Jo,{...n})}return t.displayName="CalendarChevron",t}function cr(e){setTimeout(()=>{var t;(t=e.current)==null||t.focus()},0)}function Ew(e){const{actionState:t,setActionState:n,monthButtonRef:r,yearButtonRef:o,navHeight:a}=e;function i(s){const{calendarMonth:c}=s;return d.jsxs("div",{className:k(a,"relative mx-12 flex items-center justify-center text-sm font-medium"),children:[d.jsx(Be,{ref:r,"aria-label":"Select calendar month",className:"px-1.5 focus:ring-2 focus:ring-offset-0",size:"sm",variant:"ghost",onClick:()=>{if(t==="month"){n("default"),cr(r);return}n("month")},children:c.date.toLocaleString("default",{month:"long"})}),d.jsx(Be,{ref:o,"aria-label":"Select calendar year",className:"px-1.5 focus:ring-2 focus:ring-offset-0",size:"sm",variant:"ghost",onClick:()=>{if(t==="year"){n("default"),cr(o);return}n("year")},children:c.date.getFullYear()})]})}return i.displayName="CalendarMonthCaption",i}function Tr(e,t,n){if(!t&&!n)throw new Error(`${e} must have either a label prop or an aria-label attribute`);if(t&&n)throw new Error(`${e} must have either a label prop or an aria-label attribute, but not both`)}const Mw=()=>Array.from({length:12},(e,t)=>new Date(0,t).toLocaleString("en-US",{month:"long"})),Rw=e=>{const{onSelect:t}=e,n=N.useRef(null);return N.useEffect(()=>{n.current&&n.current.focus()},[]),d.jsx("div",{className:`-mx-1 -my-1 grid max-h-72 min-w-80 grid-cols-1 gap-1 px-1 py-1 md:grid-cols-2
|
|
161
161
|
lg:grid-cols-3`,children:Mw().map((r,o)=>d.jsx(Be,{ref:o===0?n:void 0,className:k(`relative min-h-10 w-full text-center text-sm font-normal focus-within:relative
|
|
162
162
|
focus-within:z-20 focus:opacity-100 focus:ring-2 focus:ring-offset-0`),size:"sm",variant:"ghost",onClick:()=>{t==null||t(o)},children:r},r))})},Pw=(e,t)=>{const n=new Date().getFullYear(),r=e?e.getFullYear():n-23,o=t?t.getFullYear():n,a=[];for(let i=o;i>=r;i--)a.push(i);return a},kw=e=>{const{onSelect:t,startMonth:n,endMonth:r}=e,o=N.useRef(null);return N.useEffect(()=>{o.current&&o.current.focus()},[]),d.jsx("div",{className:`-mx-1 -my-1 grid max-h-72 min-w-80 gap-1 overflow-y-auto px-1 py-1 md:grid-cols-3
|
|
163
163
|
lg:grid-cols-4`,children:Pw(n,r).map((a,i)=>d.jsx(Be,{ref:i===0?o:void 0,className:k(`relative min-h-10 w-full text-center text-sm font-normal focus-within:relative
|
|
164
164
|
focus-within:z-20 focus:opacity-100 focus:ring-2 focus:ring-offset-0`),size:"sm",variant:"ghost",onClick:()=>{t==null||t(a)},children:a},a))})};function Iw(e){const{actionState:t,setActionState:n,activeMonth:r,setActiveMonth:o,monthButtonRef:a,yearButtonRef:i,startMonth:s,endMonth:c}=e;function l(){return t==="month"?d.jsx(Rw,{onSelect:f=>{const m=r?new Date(r):new Date;m.setMonth(f),o(m),n("default"),cr(a)}}):t==="year"?d.jsx(kw,{endMonth:c,startMonth:s,onSelect:f=>{const m=r?new Date(r):new Date;m.setFullYear(f),o(m),n("default"),cr(i)}}):d.jsx(d.Fragment,{})}return l.displayName="CalendarMonthGrid",l}function Na({className:e,classNames:t,showOutsideDays:n=!0,...r}){const[o,a]=N.useState("default"),[i,s]=N.useState(void 0),c=N.useRef(null),l=N.useRef(null),f="h-7 md:h-9",m="w-7 px-0 py-0 focus:ring-2 focus:ring-offset-0 md:w-9",p="w-9 md:w-10 lg:w-11 px-0",h="h-9 md:h-10 lg:h-11 py-0",y="text-[#767676] aria-selected:text-[#767676] dark:text-[#828282] dark:aria-selected:text-[#828282]",g=r.mode==="range"?"":"[&>button]:bg-primary [&>button]:text-primary-foreground",v="focus:ring-inset focus:ring-0 focus:ring-offset-2 focus:shadow-[inset_0_0_0_0_#ffffff,0_0_0_2px_#005ea2]",b=N.useMemo(()=>{const w=Nw(o),S=Ew({actionState:o,setActionState:a,monthButtonRef:c,yearButtonRef:l,navHeight:f});if(o==="default")return{Chevron:w,MonthCaption:S};const C=Iw({actionState:o,setActionState:a,activeMonth:i,setActiveMonth:s,monthButtonRef:c,yearButtonRef:l,startMonth:r.startMonth,endMonth:r.endMonth});return{Chevron:w,MonthCaption:S,MonthGrid:C}},[o,i,r.endMonth,r.startMonth]),x=r.defaultMonth??i??(r.mode==="single"?r.selected:new Date)??new Date;return d.jsx(Sw,{className:k("min-w-80 px-3 py-3",e),classNames:{months:"flex flex-col gap-4 sm:flex-row",month:"w-full space-y-4",month_caption:k(f,"relative flex items-center justify-center text-sm font-medium"),nav:"absolute left-4 right-4 flex items-center justify-between",button_previous:k(at({variant:"ghost"}),f,m),button_next:k(at({variant:"ghost"}),f,m),month_grid:"w-full border-collapse space-y-1",weekdays:"mb-1 flex",weekday:k(p,"text-sm font-medium text-popover-foreground"),week:"mt-1 flex w-full",day:k(p,h),day_button:k(at({variant:"ghost"}),p,h,`relative rounded-l-full rounded-r-full text-center text-sm font-normal
|
|
165
|
-
focus-within:relative focus-within:z-20 focus:opacity-100`,v),range_start:"rounded-l-full aria-selected:bg-accent [&>button]:bg-primary [&>button]:text-primary-foreground",range_end:"rounded-r-full aria-selected:bg-accent [&>button]:bg-primary [&>button]:text-primary-foreground",selected:g,today:"[&>button]:rounded-l-full [&>button]:rounded-r-full [&>button]:bg-accent [&>button]:text-accent-foreground",outside:k("day-outside",y),disabled:"text-muted-foreground opacity-50",range_middle:"first:rounded-l-md last:rounded-r-md aria-selected:bg-accent aria-selected:text-accent-foreground",hidden:"invisible",...t},components:b,defaultMonth:x,month:i,showOutsideDays:n,onMonthChange:s,...r,disableNavigation:o!=="default"})}function Ar(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var _r="Checkbox",[Dw,uE]=ye(_r),[Ow,Tw]=Dw(_r),Ol=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:a,required:i,disabled:s,value:c="on",onCheckedChange:l,form:f,...m}=e,[p,h]=u.useState(null),y=q(t,S=>h(S)),g=u.useRef(!1),v=p?f||!!p.closest("form"):!0,[b,x]=Se({prop:o,defaultProp:a??!1,onChange:l,caller:_r}),w=u.useRef(b);return u.useEffect(()=>{const S=p==null?void 0:p.form;if(S){const C=()=>x(w.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[p,x]),d.jsxs(Ow,{scope:n,state:b,disabled:s,children:[d.jsx(V.button,{type:"button",role:"checkbox","aria-checked":pt(b)?"mixed":b,"aria-required":i,"data-state":jl(b),"data-disabled":s?"":void 0,disabled:s,value:c,...m,ref:y,onKeyDown:T(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:T(e.onClick,S=>{x(C=>pt(C)?!0:!C),v&&(g.current=S.isPropagationStopped(),g.current||S.stopPropagation())})}),v&&d.jsx(_l,{control:p,bubbles:!g.current,name:r,value:c,checked:b,required:i,disabled:s,form:f,style:{transform:"translateX(-100%)"},defaultChecked:pt(a)?!1:a})]})});Ol.displayName=_r;var Tl="CheckboxIndicator",Al=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,a=Tw(Tl,n);return d.jsx(Ae,{present:r||pt(a.state)||a.state===!0,children:d.jsx(V.span,{"data-state":jl(a.state),"data-disabled":a.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Al.displayName=Tl;var Aw="CheckboxBubbleInput",_l=u.forwardRef(({__scopeCheckbox:e,control:t,checked:n,bubbles:r=!0,defaultChecked:o,...a},i)=>{const s=u.useRef(null),c=q(s,i),l=Ar(n),f=Tn(t);u.useEffect(()=>{const p=s.current;if(!p)return;const h=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(h,"checked").set;if(l!==n&&g){const v=new Event("click",{bubbles:r});p.indeterminate=pt(n),g.call(p,pt(n)?!1:n),p.dispatchEvent(v)}},[l,n,r]);const m=u.useRef(pt(n)?!1:n);return d.jsx(V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??m.current,...a,tabIndex:-1,ref:c,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_l.displayName=Aw;function pt(e){return e==="indeterminate"}function jl(e){return pt(e)?"indeterminate":e?"checked":"unchecked"}var jr=Ol,_w=Al;const Fl=u.forwardRef(({id:e,label:t,description:n,isChecked:r,isDisabled:o,className:a,"aria-label":i,...s},c)=>{const l=Pe({isDisabled:o}),{ariaProps:f,labelId:m,descriptionId:p}=Ot({label:t,description:n,"aria-label":i}),h=()=>t?typeof t=="string"?d.jsx("span",{className:"font-medium",id:m,children:t}):d.jsx("span",{id:m,children:t}):null;return d.jsxs("div",{className:k("relative",r?k(ie.button,at({variant:"primary"})):k(ie.button,at({variant:"input"})),o&&"pointer-events-none cursor-not-allowed opacity-50",a),children:[d.jsx(jr,{ref:c,checked:r,className:"absolute inset-0 opacity-0",id:e,...f,...s,...l}),d.jsxs("div",{className:"flex items-center gap-2",children:[h(),n?d.jsx("span",{className:"text-sm text-muted-foreground",id:p,children:n}):null]})]})});Fl.displayName="CheckboxButton";var jw="Label",$l=u.forwardRef((e,t)=>d.jsx(V.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));$l.displayName=jw;var Ll=$l;const xt=u.forwardRef(({className:e,...t},n)=>d.jsx(Ll,{ref:n,className:k(ie.text.label,e),...t}));xt.displayName=Ll.displayName;const Wl="peer h-5 w-5 shrink-0 rounded-sm border-2 border-gray-500 ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary-400 data-[state=checked]:bg-primary-400 data-[state=checked]:text-white",Bl=u.forwardRef(({id:e,label:t,description:n,isChecked:r,isDisabled:o,className:a,"aria-label":i,...s},c)=>{const l=Pe({isDisabled:o}),{ariaProps:f,labelId:m,descriptionId:p}=Ot({label:t,description:n,"aria-label":i});return d.jsxs("div",{className:k("flex items-start gap-2",o&&"cursor-not-allowed opacity-50 [&>*]:cursor-not-allowed"),children:[d.jsx(jr,{ref:c,checked:r,className:k(ie.focusRing,ie.focusRingSm,Wl,a),id:e,...s,...l,...f,children:d.jsx(_w,{className:k("flex items-center justify-center text-current"),children:d.jsx(Dt,{className:"h-4 w-4",strokeWidth:3})})}),d.jsxs("div",{className:"mt-[3px] flex flex-col",children:[t?d.jsx(xt,{className:k(!o&&"cursor-pointer",o&&"pointer-events-none cursor-not-allowed"),htmlFor:e,id:m,children:t}):null,n?d.jsx(xt,{className:k(!o&&"cursor-pointer",o&&"pointer-events-none cursor-not-allowed"),htmlFor:e,children:d.jsx("span",{className:"inline-block pt-1 text-sm text-muted-foreground",id:p,children:n})}):null]})]})});Bl.displayName="CheckboxDefault";const Hl=u.forwardRef(({id:e,label:t,description:n,isChecked:r,isDisabled:o,className:a,"aria-label":i,...s},c)=>{const l=Pe({isDisabled:o}),{ariaProps:f,labelId:m,descriptionId:p}=Ot({label:t,description:n,"aria-label":i}),h=()=>t?typeof t=="string"?d.jsx("div",{className:"font-medium",id:m,children:t}):d.jsx("div",{id:m,children:t}):null;return d.jsxs("div",{className:k("relative rounded-lg border-2 border-muted bg-popover px-4 py-4",r&&"border-primary-400",o?"cursor-not-allowed opacity-50 [&_*]:cursor-not-allowed":"cursor-pointer hover:bg-accent hover:text-accent-foreground",a),children:[d.jsx(jr,{ref:c,checked:r,className:"absolute inset-0 opacity-0",id:e,...f,...s,...l}),d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:k(Wl,"pointer-events-none mt-1",r&&"border-primary-400 bg-primary-400"),children:r?d.jsx("div",{className:"flex h-full w-full items-center justify-center",children:d.jsx(Dt,{className:"h-4 w-4 text-white",strokeWidth:3})}):null}),d.jsxs("div",{className:"pointer-events-none space-y-1",children:[h(),n?d.jsx("p",{className:"mb-0 mt-0 text-sm text-muted-foreground",id:p,children:n}):null]})]})]})});Hl.displayName="CheckboxTile";const Ea=u.forwardRef(({className:e,label:t,description:n,id:r,"aria-label":o,isChecked:a=!1,isDisabled:i=!1,variant:s="default",...c},l)=>{Tr("Checkbox",t,o);let f=Bl;return s==="button"?f=Fl:s==="tile"&&(f=Hl),d.jsx(f,{ref:l,"aria-label":o,className:e,description:n,id:r,isChecked:a,isDisabled:i,label:t,...c})});Ea.displayName=jr.displayName;const Vl=u.forwardRef(({options:e,value:t,onChange:n,className:r,columns:o=1,id:a,isDisabled:i,orientation:s="vertical",variant:c="default",...l},f)=>{const m=gr({variant:c,orientation:s,columns:o}),p=N.useId(),h=a??p;return d.jsx("div",{ref:f,className:k(m,r),id:a,...l,children:e.map(y=>{const g=y.inputId??`${h}-${y.id}`;return d.jsx(Ea,{description:y.description,id:g,isChecked:t.includes(y.id),isDisabled:i||y.isDisabled,label:y.label,variant:c,onCheckedChange:v=>{n(v?[...t,y.id]:t.filter(b=>b!==y.id))}},y.id)})})});Vl.displayName="CheckboxGroup";function Fw(e,t,n){const r=t.toLowerCase().trim();return r.length===0||e.toLowerCase().includes(r)||(n??[]).some(a=>String(a).toLowerCase().includes(r))?1:0}const Yl=N.forwardRef(({options:e,value:t,onChange:n,placeholder:r="Select an item...",searchPlaceholder:o="Search items...",emptyMessage:a="No items found",filter:i,className:s,listClassName:c,popoverClassName:l,zIndex:f,isDisabled:m=!1,name:p,required:h,autoFocus:y,...g},v)=>{var S;const[b,x]=N.useState(!1),w=je("dropdown",f);return d.jsxs(d.Fragment,{children:[p||h?d.jsx("input",{name:p,required:h,type:"hidden",value:t}):null,d.jsxs(en,{open:b,onOpenChange:x,children:[d.jsx(tn,{asChild:!0,children:d.jsxs(Be,{ref:v,"aria-expanded":b,autoFocus:y,className:k("w-full justify-between px-3",!t&&"text-muted-foreground",s),isDisabled:m,role:"combobox",variant:"input",...g,children:[d.jsx("span",{className:"min-w-0 truncate",children:t?(S=e.find(C=>C.value===t))==null?void 0:S.label:r}),d.jsx(ea,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),d.jsx(Tt,{align:"start",className:k("min-w-[--radix-popover-trigger-width] px-0 py-0",l),zIndex:w,children:d.jsxs(Cr,{filter:i??Fw,children:[d.jsx(Nr,{placeholder:o}),d.jsxs(Mr,{className:k("max-h-[16.5rem] overflow-y-auto",c),children:[d.jsx(ca,{children:a}),d.jsx(Sr,{children:e.map(C=>d.jsxs(Er,{keywords:[C.label],value:C.value,onSelect:M=>{n(M===t?"":M),x(!1)},children:[d.jsx(Dt,{className:k("mr-2 h-4 w-4 shrink-0",t===C.value?"opacity-100":"opacity-0")}),C.label]},C.value))})]})]})})]})]})});Yl.displayName="Combobox";const Gl=N.forwardRef(({value:e,startMonth:t,endMonth:n,onChange:r,placeholder:o="Pick a date",className:a,zIndex:i,isDisabled:s=!1,name:c,required:l,autoFocus:f,...m},p)=>{const[h,y]=N.useState(!1),g=je("popover",i),v=b=>{r(b),y(!1)};return d.jsxs(d.Fragment,{children:[c||l?d.jsx("input",{name:c,required:l,type:"hidden",value:e?e.toISOString().split("T")[0]:""}):null,d.jsxs(en,{open:h,onOpenChange:y,children:[d.jsx(tn,{asChild:!0,children:d.jsxs(Be,{ref:p,"aria-required":l,autoFocus:f,className:k("w-full justify-start px-3 text-left font-normal",!e&&"text-muted-foreground",a),"data-component":"date-picker",isDisabled:s,variant:"input",...m,children:[d.jsx(bi,{className:"mr-2 h-4 w-4"}),e?gn(e,"LLLL dd, y"):d.jsx("span",{children:o})]})}),d.jsx(Tt,{align:"start",className:"w-auto px-0 py-0",zIndex:g,children:d.jsx(Na,{autoFocus:!0,endMonth:n,mode:"single",selected:e,startMonth:t,onSelect:v})})]})]})});Gl.displayName="DatePicker";const Ul=u.forwardRef(({value:e,onChange:t,placeholder:n={from:"Pick start date",to:"Pick end date"},className:r,zIndex:o,isDisabled:a=!1,startMonth:i,endMonth:s,name:c,required:l,autoFocus:f,...m},p)=>{const h=je("popover",o),y=v=>{const{from:b,to:x}=e;if(!b)return t({from:v,to:void 0});if(v<b)return t({from:v,to:void 0});if(b&&x)return t({from:v,to:void 0});if(v>b)return t({from:b,to:v});if(v.getTime()===b.getTime())return t({from:void 0,to:void 0})},g=v=>v.from?v.to?`${v.from.toISOString().split("T")[0]},${v.to.toISOString().split("T")[0]}`:v.from.toISOString().split("T")[0]:"";return d.jsxs("div",{className:k("grid gap-2",r),children:[c||l?d.jsx("input",{name:c,required:l,type:"hidden",value:g(e)}):null,d.jsxs(en,{children:[d.jsx(tn,{asChild:!0,children:d.jsxs(Be,{ref:p,autoFocus:f,className:k("w-full justify-start px-3 text-left font-normal",!e.from&&!e.to&&"text-muted-foreground"),"data-component":"date-range-picker",isDisabled:a,variant:"input",...m,children:[d.jsx(bi,{className:"mr-2 h-4 w-4"}),e.from?e.to?d.jsxs(d.Fragment,{children:[gn(e.from,"LLLL dd, y")," - ",gn(e.to,"LLLL dd, y")]}):gn(e.from,"LLLL dd, y"):d.jsx("span",{children:n.from})]})}),d.jsx(Tt,{align:"start",className:"w-auto px-0 py-0",zIndex:h,children:d.jsx(Na,{autoFocus:!0,defaultMonth:e.from,endMonth:s,mode:"range",modifiers:{today:()=>!1},numberOfMonths:2,selected:{from:e.from,to:e.to},showOutsideDays:!1,startMonth:i,onDayClick:y,onSelect:v=>{v&&t(v)}})})]})]})});Ul.displayName="DateRangePicker";const zl=u.forwardRef(({className:e,...t},n)=>d.jsx(nc,{ref:n,className:k(ie.text.hint,"mr-8",e),...t}));zl.displayName=nc.displayName;const Kl=({className:e,...t})=>d.jsx("div",{className:k("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Kl.displayName="DialogFooter";const ql=({className:e,...t})=>d.jsx("div",{className:k("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ql.displayName="DialogHeader";const Xl=u.forwardRef(({className:e,...t},n)=>d.jsx(tc,{ref:n,className:k(ie.text.title,"mr-8 text-lg font-bold leading-none tracking-tight text-base-700 dark:text-base-100",e),...t}));Xl.displayName=tc.displayName;var yo="rovingFocusGroup.onEntryFocus",$w={bubbles:!1,cancelable:!0},$n="RovingFocusGroup",[Oo,Zl,Lw]=Mn($n),[Ww,Ql]=ye($n,[Lw]),[Bw,Hw]=Ww($n),Jl=u.forwardRef((e,t)=>d.jsx(Oo.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Oo.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Vw,{...e,ref:t})})}));Jl.displayName=$n;var Vw=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...m}=e,p=u.useRef(null),h=q(t,p),y=wt(a),[g,v]=Se({prop:i,defaultProp:s??null,onChange:c,caller:$n}),[b,x]=u.useState(!1),w=Ee(l),S=Zl(n),C=u.useRef(!1),[M,E]=u.useState(0);return u.useEffect(()=>{const R=p.current;if(R)return R.addEventListener(yo,w),()=>R.removeEventListener(yo,w)},[w]),d.jsx(Bw,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:g,onItemFocus:u.useCallback(R=>v(R),[v]),onItemShiftTab:u.useCallback(()=>x(!0),[]),onFocusableItemAdd:u.useCallback(()=>E(R=>R+1),[]),onFocusableItemRemove:u.useCallback(()=>E(R=>R-1),[]),children:d.jsx(V.div,{tabIndex:b||M===0?-1:0,"data-orientation":r,...m,ref:h,style:{outline:"none",...e.style},onMouseDown:T(e.onMouseDown,()=>{C.current=!0}),onFocus:T(e.onFocus,R=>{const $=!C.current;if(R.target===R.currentTarget&&$&&!b){const _=new CustomEvent(yo,$w);if(R.currentTarget.dispatchEvent(_),!_.defaultPrevented){const I=S().filter(j=>j.focusable),D=I.find(j=>j.active),L=I.find(j=>j.id===g),K=[D,L,...I].filter(Boolean).map(j=>j.ref.current);nu(K,f)}}C.current=!1}),onBlur:T(e.onBlur,()=>x(!1))})})}),eu="RovingFocusGroupItem",tu=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:i,...s}=e,c=ge(),l=a||c,f=Hw(eu,n),m=f.currentTabStopId===l,p=Zl(n),{onFocusableItemAdd:h,onFocusableItemRemove:y,currentTabStopId:g}=f;return u.useEffect(()=>{if(r)return h(),()=>y()},[r,h,y]),d.jsx(Oo.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:d.jsx(V.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:T(e.onMouseDown,v=>{r?f.onItemFocus(l):v.preventDefault()}),onFocus:T(e.onFocus,()=>f.onItemFocus(l)),onKeyDown:T(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){f.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=Uw(v,f.orientation,f.dir);if(b!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=p().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const S=w.indexOf(v.currentTarget);w=f.loop?zw(w,S+1):w.slice(S+1)}setTimeout(()=>nu(w))}}),children:typeof i=="function"?i({isCurrentTabStop:m,hasTabStop:g!=null}):i})})});tu.displayName=eu;var Yw={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Gw(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Uw(e,t,n){const r=Gw(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Yw[r]}function nu(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function zw(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Kw=Jl,qw=tu,To=["Enter"," "],Xw=["ArrowDown","PageUp","Home"],ru=["ArrowUp","PageDown","End"],Zw=[...Xw,...ru],Qw={ltr:[...To,"ArrowRight"],rtl:[...To,"ArrowLeft"]},Jw={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ln="Menu",[Cn,eC,tC]=Mn(Ln),[At,ou]=ye(Ln,[tC,Jt,Ql]),Fr=Jt(),au=Ql(),[nC,_t]=At(Ln),[rC,Wn]=At(Ln),su=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:a,modal:i=!0}=e,s=Fr(t),[c,l]=u.useState(null),f=u.useRef(!1),m=Ee(a),p=wt(o);return u.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),d.jsx(ya,{...s,children:d.jsx(nC,{scope:t,open:n,onOpenChange:m,content:c,onContentChange:l,children:d.jsx(rC,{scope:t,onClose:u.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:f,dir:p,modal:i,children:r})})})};su.displayName=Ln;var oC="MenuAnchor",Ma=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fr(n);return d.jsx(Ir,{...o,...r,ref:t})});Ma.displayName=oC;var Ra="MenuPortal",[aC,iu]=At(Ra,{forceMount:void 0}),cu=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,a=_t(Ra,t);return d.jsx(aC,{scope:t,forceMount:n,children:d.jsx(Ae,{present:n||a.open,children:d.jsx(kn,{asChild:!0,container:o,children:r})})})};cu.displayName=Ra;var Te="MenuContent",[sC,Pa]=At(Te),lu=u.forwardRef((e,t)=>{const n=iu(Te,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=_t(Te,e.__scopeMenu),i=Wn(Te,e.__scopeMenu);return d.jsx(Cn.Provider,{scope:e.__scopeMenu,children:d.jsx(Ae,{present:r||a.open,children:d.jsx(Cn.Slot,{scope:e.__scopeMenu,children:i.modal?d.jsx(iC,{...o,ref:t}):d.jsx(cC,{...o,ref:t})})})})}),iC=u.forwardRef((e,t)=>{const n=_t(Te,e.__scopeMenu),r=u.useRef(null),o=q(t,r);return u.useEffect(()=>{const a=r.current;if(a)return br(a)},[]),d.jsx(ka,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:T(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),cC=u.forwardRef((e,t)=>{const n=_t(Te,e.__scopeMenu);return d.jsx(ka,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),lC=ht("MenuContent.ScrollLock"),ka=u.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:h,disableOutsideScroll:y,...g}=e,v=_t(Te,n),b=Wn(Te,n),x=Fr(n),w=au(n),S=eC(n),[C,M]=u.useState(null),E=u.useRef(null),R=q(t,E,v.onContentChange),$=u.useRef(0),_=u.useRef(""),I=u.useRef(0),D=u.useRef(null),L=u.useRef("right"),B=u.useRef(0),K=y?In:u.Fragment,j=y?{as:lC,allowPinchZoom:!0}:void 0,Q=O=>{var A,U;const ee=_.current+O,J=S().filter(z=>!z.disabled),P=document.activeElement,H=(A=J.find(z=>z.ref.current===P))==null?void 0:A.textValue,Y=J.map(z=>z.textValue),W=wC(Y,ee,H),X=(U=J.find(z=>z.textValue===W))==null?void 0:U.ref.current;(function z(te){_.current=te,window.clearTimeout($.current),te!==""&&($.current=window.setTimeout(()=>z(""),1e3))})(ee),X&&setTimeout(()=>X.focus())};u.useEffect(()=>()=>window.clearTimeout($.current),[]),vr();const F=u.useCallback(O=>{var J,P;return L.current===((J=D.current)==null?void 0:J.side)&&SC(O,(P=D.current)==null?void 0:P.area)},[]);return d.jsx(sC,{scope:n,searchRef:_,onItemEnter:u.useCallback(O=>{F(O)&&O.preventDefault()},[F]),onItemLeave:u.useCallback(O=>{var ee;F(O)||((ee=E.current)==null||ee.focus(),M(null))},[F]),onTriggerLeave:u.useCallback(O=>{F(O)&&O.preventDefault()},[F]),pointerGraceTimerRef:I,onPointerGraceIntentChange:u.useCallback(O=>{D.current=O},[]),children:d.jsx(K,{...j,children:d.jsx(Pn,{asChild:!0,trapped:o,onMountAutoFocus:T(a,O=>{var ee;O.preventDefault(),(ee=E.current)==null||ee.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:d.jsx(Rn,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:h,children:d.jsx(Kw,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:M,onEntryFocus:T(c,O=>{b.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(ba,{role:"menu","aria-orientation":"vertical","data-state":Eu(v.open),"data-radix-menu-content":"",dir:b.dir,...x,...g,ref:R,style:{outline:"none",...g.style},onKeyDown:T(g.onKeyDown,O=>{const J=O.target.closest("[data-radix-menu-content]")===O.currentTarget,P=O.ctrlKey||O.altKey||O.metaKey,H=O.key.length===1;J&&(O.key==="Tab"&&O.preventDefault(),!P&&H&&Q(O.key));const Y=E.current;if(O.target!==Y||!Zw.includes(O.key))return;O.preventDefault();const X=S().filter(A=>!A.disabled).map(A=>A.ref.current);ru.includes(O.key)&&X.reverse(),bC(X)}),onBlur:T(e.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout($.current),_.current="")}),onPointerMove:T(e.onPointerMove,Sn(O=>{const ee=O.target,J=B.current!==O.clientX;if(O.currentTarget.contains(ee)&&J){const P=O.clientX>B.current?"right":"left";L.current=P,B.current=O.clientX}}))})})})})})})});lu.displayName=Te;var uC="MenuGroup",Ia=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(V.div,{role:"group",...r,ref:t})});Ia.displayName=uC;var dC="MenuLabel",uu=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(V.div,{...r,ref:t})});uu.displayName=dC;var lr="MenuItem",Bs="menu.itemSelect",$r=u.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,a=u.useRef(null),i=Wn(lr,e.__scopeMenu),s=Pa(lr,e.__scopeMenu),c=q(t,a),l=u.useRef(!1),f=()=>{const m=a.current;if(!n&&m){const p=new CustomEvent(Bs,{bubbles:!0,cancelable:!0});m.addEventListener(Bs,h=>r==null?void 0:r(h),{once:!0}),ei(m,p),p.defaultPrevented?l.current=!1:i.onClose()}};return d.jsx(du,{...o,ref:c,disabled:n,onClick:T(e.onClick,f),onPointerDown:m=>{var p;(p=e.onPointerDown)==null||p.call(e,m),l.current=!0},onPointerUp:T(e.onPointerUp,m=>{var p;l.current||(p=m.currentTarget)==null||p.click()}),onKeyDown:T(e.onKeyDown,m=>{const p=s.searchRef.current!=="";n||p&&m.key===" "||To.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});$r.displayName=lr;var du=u.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=e,i=Pa(lr,n),s=au(n),c=u.useRef(null),l=q(t,c),[f,m]=u.useState(!1),[p,h]=u.useState("");return u.useEffect(()=>{const y=c.current;y&&h((y.textContent??"").trim())},[a.children]),d.jsx(Cn.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:d.jsx(qw,{asChild:!0,...s,focusable:!r,children:d.jsx(V.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:l,onPointerMove:T(e.onPointerMove,Sn(y=>{r?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:T(e.onPointerLeave,Sn(y=>i.onItemLeave(y))),onFocus:T(e.onFocus,()=>m(!0)),onBlur:T(e.onBlur,()=>m(!1))})})})}),fC="MenuCheckboxItem",fu=u.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return d.jsx(vu,{scope:e.__scopeMenu,checked:n,children:d.jsx($r,{role:"menuitemcheckbox","aria-checked":ur(n)?"mixed":n,...o,ref:t,"data-state":Oa(n),onSelect:T(o.onSelect,()=>r==null?void 0:r(ur(n)?!0:!n),{checkForDefaultPrevented:!1})})})});fu.displayName=fC;var mu="MenuRadioGroup",[mC,pC]=At(mu,{value:void 0,onValueChange:()=>{}}),pu=u.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,a=Ee(r);return d.jsx(mC,{scope:e.__scopeMenu,value:n,onValueChange:a,children:d.jsx(Ia,{...o,ref:t})})});pu.displayName=mu;var hu="MenuRadioItem",gu=u.forwardRef((e,t)=>{const{value:n,...r}=e,o=pC(hu,e.__scopeMenu),a=n===o.value;return d.jsx(vu,{scope:e.__scopeMenu,checked:a,children:d.jsx($r,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":Oa(a),onSelect:T(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});gu.displayName=hu;var Da="MenuItemIndicator",[vu,hC]=At(Da,{checked:!1}),yu=u.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,a=hC(Da,n);return d.jsx(Ae,{present:r||ur(a.checked)||a.checked===!0,children:d.jsx(V.span,{...o,ref:t,"data-state":Oa(a.checked)})})});yu.displayName=Da;var gC="MenuSeparator",bu=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(V.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});bu.displayName=gC;var vC="MenuArrow",xu=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fr(n);return d.jsx(xa,{...o,...r,ref:t})});xu.displayName=vC;var yC="MenuSub",[dE,wu]=At(yC),mn="MenuSubTrigger",Cu=u.forwardRef((e,t)=>{const n=_t(mn,e.__scopeMenu),r=Wn(mn,e.__scopeMenu),o=wu(mn,e.__scopeMenu),a=Pa(mn,e.__scopeMenu),i=u.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},f=u.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return u.useEffect(()=>f,[f]),u.useEffect(()=>{const m=s.current;return()=>{window.clearTimeout(m),c(null)}},[s,c]),d.jsx(Ma,{asChild:!0,...l,children:d.jsx(du,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Eu(n.open),...e,ref:Ze(t,o.onTriggerChange),onClick:m=>{var p;(p=e.onClick)==null||p.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:T(e.onPointerMove,Sn(m=>{a.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:T(e.onPointerLeave,Sn(m=>{var h,y;f();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const g=(y=n.content)==null?void 0:y.dataset.side,v=g==="right",b=v?-5:5,x=p[v?"left":"right"],w=p[v?"right":"left"];a.onPointerGraceIntentChange({area:[{x:m.clientX+b,y:m.clientY},{x,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x,y:p.bottom}],side:g}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(m),m.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:T(e.onKeyDown,m=>{var h;const p=a.searchRef.current!=="";e.disabled||p&&m.key===" "||Qw[r.dir].includes(m.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),m.preventDefault())})})})});Cu.displayName=mn;var Su="MenuSubContent",Nu=u.forwardRef((e,t)=>{const n=iu(Te,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=_t(Te,e.__scopeMenu),i=Wn(Te,e.__scopeMenu),s=wu(Su,e.__scopeMenu),c=u.useRef(null),l=q(t,c);return d.jsx(Cn.Provider,{scope:e.__scopeMenu,children:d.jsx(Ae,{present:r||a.open,children:d.jsx(Cn.Slot,{scope:e.__scopeMenu,children:d.jsx(ka,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var m;i.isUsingKeyboardRef.current&&((m=c.current)==null||m.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:T(e.onFocusOutside,f=>{f.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:T(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:T(e.onKeyDown,f=>{var h;const m=f.currentTarget.contains(f.target),p=Jw[i.dir].includes(f.key);m&&p&&(a.onOpenChange(!1),(h=s.trigger)==null||h.focus(),f.preventDefault())})})})})})});Nu.displayName=Su;function Eu(e){return e?"open":"closed"}function ur(e){return e==="indeterminate"}function Oa(e){return ur(e)?"indeterminate":e?"checked":"unchecked"}function bC(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function xC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function wC(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=xC(e,Math.max(a,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function CC(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const s=t[a],c=t[i],l=s.x,f=s.y,m=c.x,p=c.y;f>r!=p>r&&n<(m-l)*(r-f)/(p-f)+l&&(o=!o)}return o}function SC(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return CC(n,t)}function Sn(e){return t=>t.pointerType==="mouse"?e(t):void 0}var NC=su,EC=Ma,MC=cu,RC=lu,PC=Ia,kC=uu,IC=$r,DC=fu,OC=pu,TC=gu,AC=yu,_C=bu,jC=xu,FC=Cu,$C=Nu,Lr="DropdownMenu",[LC,fE]=ye(Lr,[ou]),Me=ou(),[WC,Mu]=LC(Lr),Ru=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,c=Me(t),l=u.useRef(null),[f,m]=Se({prop:o,defaultProp:a??!1,onChange:i,caller:Lr});return d.jsx(WC,{scope:t,triggerId:ge(),triggerRef:l,contentId:ge(),open:f,onOpenChange:m,onOpenToggle:u.useCallback(()=>m(p=>!p),[m]),modal:s,children:d.jsx(NC,{...c,open:f,onOpenChange:m,dir:r,modal:s,children:n})})};Ru.displayName=Lr;var Pu="DropdownMenuTrigger",ku=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,a=Mu(Pu,n),i=Me(n);return d.jsx(EC,{asChild:!0,...i,children:d.jsx(V.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Ze(t,a.triggerRef),onPointerDown:T(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:T(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});ku.displayName=Pu;var BC="DropdownMenuPortal",Iu=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Me(t);return d.jsx(MC,{...r,...n})};Iu.displayName=BC;var Du="DropdownMenuContent",Ou=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mu(Du,n),a=Me(n),i=u.useRef(!1);return d.jsx(RC,{id:o.contentId,"aria-labelledby":o.triggerId,...a,...r,ref:t,onCloseAutoFocus:T(e.onCloseAutoFocus,s=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,s.preventDefault()}),onInteractOutside:T(e.onInteractOutside,s=>{const c=s.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,f=c.button===2||l;(!o.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ou.displayName=Du;var HC="DropdownMenuGroup",VC=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(PC,{...o,...r,ref:t})});VC.displayName=HC;var YC="DropdownMenuLabel",GC=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(kC,{...o,...r,ref:t})});GC.displayName=YC;var UC="DropdownMenuItem",Tu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(IC,{...o,...r,ref:t})});Tu.displayName=UC;var zC="DropdownMenuCheckboxItem",KC=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(DC,{...o,...r,ref:t})});KC.displayName=zC;var qC="DropdownMenuRadioGroup",XC=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(OC,{...o,...r,ref:t})});XC.displayName=qC;var ZC="DropdownMenuRadioItem",QC=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(TC,{...o,...r,ref:t})});QC.displayName=ZC;var JC="DropdownMenuItemIndicator",e0=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(AC,{...o,...r,ref:t})});e0.displayName=JC;var t0="DropdownMenuSeparator",Au=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(_C,{...o,...r,ref:t})});Au.displayName=t0;var n0="DropdownMenuArrow",r0=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(jC,{...o,...r,ref:t})});r0.displayName=n0;var o0="DropdownMenuSubTrigger",a0=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(FC,{...o,...r,ref:t})});a0.displayName=o0;var s0="DropdownMenuSubContent",i0=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx($C,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});i0.displayName=s0;var c0=Ru,l0=ku,u0=Iu,d0=Ou,f0=Tu,m0=Au;const _u=N.memo(({item:e})=>{const{isDisabled:t,onClick:n,icon:r,label:o}=e,a=N.useCallback(i=>{t?(i.preventDefault(),i.stopPropagation()):n==null||n()},[t,n]);return d.jsxs(f0,{"aria-disabled":t,className:k(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm
|
|
165
|
+
focus-within:relative focus-within:z-20 focus:opacity-100`,v),range_start:"rounded-l-full aria-selected:bg-accent [&>button]:bg-primary [&>button]:text-primary-foreground",range_end:"rounded-r-full aria-selected:bg-accent [&>button]:bg-primary [&>button]:text-primary-foreground",selected:g,today:"[&>button]:rounded-l-full [&>button]:rounded-r-full [&>button]:bg-accent [&>button]:text-accent-foreground",outside:k("day-outside",y),disabled:"text-muted-foreground opacity-50",range_middle:"first:rounded-l-md last:rounded-r-md aria-selected:bg-accent aria-selected:text-accent-foreground",hidden:"invisible",...t},components:b,defaultMonth:x,month:i,showOutsideDays:n,onMonthChange:s,...r,disableNavigation:o!=="default"})}function Ar(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var _r="Checkbox",[Dw,uE]=ye(_r),[Ow,Tw]=Dw(_r),Ol=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:a,required:i,disabled:s,value:c="on",onCheckedChange:l,form:f,...m}=e,[p,h]=u.useState(null),y=q(t,S=>h(S)),g=u.useRef(!1),v=p?f||!!p.closest("form"):!0,[b,x]=Se({prop:o,defaultProp:a??!1,onChange:l,caller:_r}),w=u.useRef(b);return u.useEffect(()=>{const S=p==null?void 0:p.form;if(S){const C=()=>x(w.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[p,x]),d.jsxs(Ow,{scope:n,state:b,disabled:s,children:[d.jsx(V.button,{type:"button",role:"checkbox","aria-checked":pt(b)?"mixed":b,"aria-required":i,"data-state":jl(b),"data-disabled":s?"":void 0,disabled:s,value:c,...m,ref:y,onKeyDown:T(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:T(e.onClick,S=>{x(C=>pt(C)?!0:!C),v&&(g.current=S.isPropagationStopped(),g.current||S.stopPropagation())})}),v&&d.jsx(_l,{control:p,bubbles:!g.current,name:r,value:c,checked:b,required:i,disabled:s,form:f,style:{transform:"translateX(-100%)"},defaultChecked:pt(a)?!1:a})]})});Ol.displayName=_r;var Tl="CheckboxIndicator",Al=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,a=Tw(Tl,n);return d.jsx(Ae,{present:r||pt(a.state)||a.state===!0,children:d.jsx(V.span,{"data-state":jl(a.state),"data-disabled":a.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Al.displayName=Tl;var Aw="CheckboxBubbleInput",_l=u.forwardRef(({__scopeCheckbox:e,control:t,checked:n,bubbles:r=!0,defaultChecked:o,...a},i)=>{const s=u.useRef(null),c=q(s,i),l=Ar(n),f=Tn(t);u.useEffect(()=>{const p=s.current;if(!p)return;const h=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(h,"checked").set;if(l!==n&&g){const v=new Event("click",{bubbles:r});p.indeterminate=pt(n),g.call(p,pt(n)?!1:n),p.dispatchEvent(v)}},[l,n,r]);const m=u.useRef(pt(n)?!1:n);return d.jsx(V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??m.current,...a,tabIndex:-1,ref:c,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_l.displayName=Aw;function pt(e){return e==="indeterminate"}function jl(e){return pt(e)?"indeterminate":e?"checked":"unchecked"}var jr=Ol,_w=Al;const Fl=u.forwardRef(({id:e,label:t,description:n,isChecked:r,isDisabled:o,className:a,"aria-label":i,...s},c)=>{const l=Pe({isDisabled:o}),{ariaProps:f,labelId:m,descriptionId:p}=Ot({label:t,description:n,"aria-label":i}),h=()=>t?typeof t=="string"?d.jsx("span",{className:"font-medium",id:m,children:t}):d.jsx("span",{id:m,children:t}):null;return d.jsxs("div",{className:k("relative",r?k(ie.button,at({variant:"primary"})):k(ie.button,at({variant:"input"})),o&&"pointer-events-none cursor-not-allowed opacity-50",a),children:[d.jsx(jr,{ref:c,checked:r,className:"absolute inset-0 opacity-0",id:e,...f,...s,...l}),d.jsxs("div",{className:"flex items-center gap-2",children:[h(),n?d.jsx("span",{className:"text-sm text-muted-foreground",id:p,children:n}):null]})]})});Fl.displayName="CheckboxButton";var jw="Label",$l=u.forwardRef((e,t)=>d.jsx(V.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));$l.displayName=jw;var Ll=$l;const xt=u.forwardRef(({className:e,...t},n)=>d.jsx(Ll,{ref:n,className:k(ie.text.label,e),...t}));xt.displayName=Ll.displayName;const Wl="peer h-5 w-5 shrink-0 rounded-sm border-2 border-gray-500 ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary-400 data-[state=checked]:bg-primary-400 data-[state=checked]:text-white",Bl=u.forwardRef(({id:e,label:t,description:n,isChecked:r,isDisabled:o,className:a,"aria-label":i,...s},c)=>{const l=Pe({isDisabled:o}),{ariaProps:f,labelId:m,descriptionId:p}=Ot({label:t,description:n,"aria-label":i});return d.jsxs("div",{className:k("flex items-start gap-2",o&&"cursor-not-allowed opacity-50 [&>*]:cursor-not-allowed"),children:[d.jsx(jr,{ref:c,checked:r,className:k(ie.focusRing,ie.focusRingSm,Wl,a),id:e,...s,...l,...f,children:d.jsx(_w,{className:k("flex items-center justify-center text-current"),children:d.jsx(Dt,{className:"h-4 w-4",strokeWidth:3})})}),d.jsxs("div",{className:"mt-[3px] flex flex-col",children:[t?d.jsx(xt,{className:k(!o&&"cursor-pointer",o&&"pointer-events-none cursor-not-allowed"),htmlFor:e,id:m,children:t}):null,n?d.jsx(xt,{className:k(!o&&"cursor-pointer",o&&"pointer-events-none cursor-not-allowed"),htmlFor:e,children:d.jsx("span",{className:"inline-block pt-1 text-sm text-muted-foreground",id:p,children:n})}):null]})]})});Bl.displayName="CheckboxDefault";const Hl=u.forwardRef(({id:e,label:t,description:n,isChecked:r,isDisabled:o,className:a,"aria-label":i,...s},c)=>{const l=Pe({isDisabled:o}),{ariaProps:f,labelId:m,descriptionId:p}=Ot({label:t,description:n,"aria-label":i}),h=()=>t?typeof t=="string"?d.jsx("div",{className:"font-medium",id:m,children:t}):d.jsx("div",{id:m,children:t}):null;return d.jsxs("div",{className:k("relative rounded-lg border-2 border-muted bg-popover px-4 py-4",r&&"border-primary-400",o?"cursor-not-allowed opacity-50 [&_*]:cursor-not-allowed":"cursor-pointer hover:bg-accent hover:text-accent-foreground",a),children:[d.jsx(jr,{ref:c,checked:r,className:"absolute inset-0 opacity-0",id:e,...f,...s,...l}),d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:k(Wl,"pointer-events-none mt-1",r&&"border-primary-400 bg-primary-400"),children:r?d.jsx("div",{className:"flex h-full w-full items-center justify-center",children:d.jsx(Dt,{className:"h-4 w-4 text-white",strokeWidth:3})}):null}),d.jsxs("div",{className:"pointer-events-none space-y-1",children:[h(),n?d.jsx("p",{className:"mb-0 mt-0 text-sm text-muted-foreground",id:p,children:n}):null]})]})]})});Hl.displayName="CheckboxTile";const Ea=u.forwardRef(({className:e,label:t,description:n,id:r,"aria-label":o,isChecked:a=!1,isDisabled:i=!1,variant:s="default",...c},l)=>{Tr("Checkbox",t,o);let f=Bl;return s==="button"?f=Fl:s==="tile"&&(f=Hl),d.jsx(f,{ref:l,"aria-label":o,className:e,description:n,id:r,isChecked:a,isDisabled:i,label:t,...c})});Ea.displayName=jr.displayName;const Vl=u.forwardRef(({options:e,value:t,onChange:n,className:r,columns:o=1,id:a,isDisabled:i,orientation:s="vertical",variant:c="default",...l},f)=>{const m=gr({variant:c,orientation:s,columns:o}),p=N.useId(),h=a??p;return d.jsx("div",{ref:f,className:k(m,r),id:a,...l,children:e.map(y=>{const g=y.inputId??`${h}-${y.id}`;return d.jsx(Ea,{description:y.description,id:g,isChecked:t.includes(y.id),isDisabled:i||y.isDisabled,label:y.label,variant:c,onCheckedChange:v=>{n(v?[...t,y.id]:t.filter(b=>b!==y.id))}},y.id)})})});Vl.displayName="CheckboxGroup";function Fw(e,t,n){const r=t.toLowerCase().trim();return r.length===0||e.toLowerCase().includes(r)||(n??[]).some(a=>String(a).toLowerCase().includes(r))?1:0}const Yl=N.forwardRef(({options:e,value:t,onChange:n,placeholder:r="Select an item...",searchPlaceholder:o="Search items...",emptyMessage:a="No items found",filter:i,className:s,listClassName:c,popoverClassName:l,zIndex:f,isDisabled:m=!1,name:p,required:h,autoFocus:y,...g},v)=>{var S;const[b,x]=N.useState(!1),w=je("dropdown",f);return d.jsxs(d.Fragment,{children:[p||h?d.jsx("input",{name:p,required:h,type:"hidden",value:t}):null,d.jsxs(en,{open:b,onOpenChange:x,children:[d.jsx(tn,{asChild:!0,children:d.jsxs(Be,{ref:v,"aria-expanded":b,autoFocus:y,className:k("w-full justify-between px-3",!t&&"text-muted-foreground",s),isDisabled:m,variant:"input",...g,children:[d.jsx("span",{className:"min-w-0 truncate",children:t?(S=e.find(C=>C.value===t))==null?void 0:S.label:r}),d.jsx(ea,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),d.jsx(Tt,{align:"start",className:k("min-w-[--radix-popover-trigger-width] px-0 py-0",l),zIndex:w,children:d.jsxs(Cr,{filter:i??Fw,children:[d.jsx(Nr,{placeholder:o}),d.jsxs(Mr,{className:k("max-h-[16.5rem] overflow-y-auto",c),children:[d.jsx(ca,{children:a}),d.jsx(Sr,{children:e.map(C=>d.jsxs(Er,{keywords:[C.label],value:C.value,onSelect:M=>{n(M===t?"":M),x(!1)},children:[d.jsx(Dt,{className:k("mr-2 h-4 w-4 shrink-0",t===C.value?"opacity-100":"opacity-0")}),C.label]},C.value))})]})]})})]})]})});Yl.displayName="Combobox";const Gl=N.forwardRef(({value:e,startMonth:t,endMonth:n,onChange:r,placeholder:o="Pick a date",className:a,zIndex:i,isDisabled:s=!1,name:c,required:l,autoFocus:f,...m},p)=>{const[h,y]=N.useState(!1),g=je("popover",i),v=b=>{r(b),y(!1)};return d.jsxs(d.Fragment,{children:[c||l?d.jsx("input",{name:c,required:l,type:"hidden",value:e?e.toISOString().split("T")[0]:""}):null,d.jsxs(en,{open:h,onOpenChange:y,children:[d.jsx(tn,{asChild:!0,children:d.jsxs(Be,{ref:p,"aria-required":l,autoFocus:f,className:k("w-full justify-start px-3 text-left font-normal",!e&&"text-muted-foreground",a),"data-component":"date-picker",isDisabled:s,variant:"input",...m,children:[d.jsx(bi,{className:"mr-2 h-4 w-4"}),e?gn(e,"LLLL dd, y"):d.jsx("span",{children:o})]})}),d.jsx(Tt,{align:"start",className:"w-auto px-0 py-0",zIndex:g,children:d.jsx(Na,{autoFocus:!0,endMonth:n,mode:"single",selected:e,startMonth:t,onSelect:v})})]})]})});Gl.displayName="DatePicker";const Ul=u.forwardRef(({value:e,onChange:t,placeholder:n={from:"Pick start date",to:"Pick end date"},className:r,zIndex:o,isDisabled:a=!1,startMonth:i,endMonth:s,name:c,required:l,autoFocus:f,...m},p)=>{const h=je("popover",o),y=v=>{const{from:b,to:x}=e;if(!b)return t({from:v,to:void 0});if(v<b)return t({from:v,to:void 0});if(b&&x)return t({from:v,to:void 0});if(v>b)return t({from:b,to:v});if(v.getTime()===b.getTime())return t({from:void 0,to:void 0})},g=v=>v.from?v.to?`${v.from.toISOString().split("T")[0]},${v.to.toISOString().split("T")[0]}`:v.from.toISOString().split("T")[0]:"";return d.jsxs("div",{className:k("grid gap-2",r),children:[c||l?d.jsx("input",{name:c,required:l,type:"hidden",value:g(e)}):null,d.jsxs(en,{children:[d.jsx(tn,{asChild:!0,children:d.jsxs(Be,{ref:p,autoFocus:f,className:k("w-full justify-start px-3 text-left font-normal",!e.from&&!e.to&&"text-muted-foreground"),"data-component":"date-range-picker",isDisabled:a,variant:"input",...m,children:[d.jsx(bi,{className:"mr-2 h-4 w-4"}),e.from?e.to?d.jsxs(d.Fragment,{children:[gn(e.from,"LLLL dd, y")," - ",gn(e.to,"LLLL dd, y")]}):gn(e.from,"LLLL dd, y"):d.jsx("span",{children:n.from})]})}),d.jsx(Tt,{align:"start",className:"w-auto px-0 py-0",zIndex:h,children:d.jsx(Na,{autoFocus:!0,defaultMonth:e.from,endMonth:s,mode:"range",modifiers:{today:()=>!1},numberOfMonths:2,selected:{from:e.from,to:e.to},showOutsideDays:!1,startMonth:i,onDayClick:y,onSelect:v=>{v&&t(v)}})})]})]})});Ul.displayName="DateRangePicker";const zl=u.forwardRef(({className:e,...t},n)=>d.jsx(nc,{ref:n,className:k(ie.text.hint,"mr-8",e),...t}));zl.displayName=nc.displayName;const Kl=({className:e,...t})=>d.jsx("div",{className:k("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Kl.displayName="DialogFooter";const ql=({className:e,...t})=>d.jsx("div",{className:k("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ql.displayName="DialogHeader";const Xl=u.forwardRef(({className:e,...t},n)=>d.jsx(tc,{ref:n,className:k(ie.text.title,"mr-8 text-lg font-bold leading-none tracking-tight text-base-700 dark:text-base-100",e),...t}));Xl.displayName=tc.displayName;var yo="rovingFocusGroup.onEntryFocus",$w={bubbles:!1,cancelable:!0},$n="RovingFocusGroup",[Oo,Zl,Lw]=Mn($n),[Ww,Ql]=ye($n,[Lw]),[Bw,Hw]=Ww($n),Jl=u.forwardRef((e,t)=>d.jsx(Oo.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Oo.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Vw,{...e,ref:t})})}));Jl.displayName=$n;var Vw=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...m}=e,p=u.useRef(null),h=q(t,p),y=wt(a),[g,v]=Se({prop:i,defaultProp:s??null,onChange:c,caller:$n}),[b,x]=u.useState(!1),w=Ee(l),S=Zl(n),C=u.useRef(!1),[M,E]=u.useState(0);return u.useEffect(()=>{const R=p.current;if(R)return R.addEventListener(yo,w),()=>R.removeEventListener(yo,w)},[w]),d.jsx(Bw,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:g,onItemFocus:u.useCallback(R=>v(R),[v]),onItemShiftTab:u.useCallback(()=>x(!0),[]),onFocusableItemAdd:u.useCallback(()=>E(R=>R+1),[]),onFocusableItemRemove:u.useCallback(()=>E(R=>R-1),[]),children:d.jsx(V.div,{tabIndex:b||M===0?-1:0,"data-orientation":r,...m,ref:h,style:{outline:"none",...e.style},onMouseDown:T(e.onMouseDown,()=>{C.current=!0}),onFocus:T(e.onFocus,R=>{const $=!C.current;if(R.target===R.currentTarget&&$&&!b){const _=new CustomEvent(yo,$w);if(R.currentTarget.dispatchEvent(_),!_.defaultPrevented){const I=S().filter(j=>j.focusable),D=I.find(j=>j.active),L=I.find(j=>j.id===g),K=[D,L,...I].filter(Boolean).map(j=>j.ref.current);nu(K,f)}}C.current=!1}),onBlur:T(e.onBlur,()=>x(!1))})})}),eu="RovingFocusGroupItem",tu=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:i,...s}=e,c=ge(),l=a||c,f=Hw(eu,n),m=f.currentTabStopId===l,p=Zl(n),{onFocusableItemAdd:h,onFocusableItemRemove:y,currentTabStopId:g}=f;return u.useEffect(()=>{if(r)return h(),()=>y()},[r,h,y]),d.jsx(Oo.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:d.jsx(V.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:T(e.onMouseDown,v=>{r?f.onItemFocus(l):v.preventDefault()}),onFocus:T(e.onFocus,()=>f.onItemFocus(l)),onKeyDown:T(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){f.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=Uw(v,f.orientation,f.dir);if(b!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=p().filter(S=>S.focusable).map(S=>S.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const S=w.indexOf(v.currentTarget);w=f.loop?zw(w,S+1):w.slice(S+1)}setTimeout(()=>nu(w))}}),children:typeof i=="function"?i({isCurrentTabStop:m,hasTabStop:g!=null}):i})})});tu.displayName=eu;var Yw={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Gw(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Uw(e,t,n){const r=Gw(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Yw[r]}function nu(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function zw(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Kw=Jl,qw=tu,To=["Enter"," "],Xw=["ArrowDown","PageUp","Home"],ru=["ArrowUp","PageDown","End"],Zw=[...Xw,...ru],Qw={ltr:[...To,"ArrowRight"],rtl:[...To,"ArrowLeft"]},Jw={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ln="Menu",[Cn,eC,tC]=Mn(Ln),[At,ou]=ye(Ln,[tC,Jt,Ql]),Fr=Jt(),au=Ql(),[nC,_t]=At(Ln),[rC,Wn]=At(Ln),su=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:a,modal:i=!0}=e,s=Fr(t),[c,l]=u.useState(null),f=u.useRef(!1),m=Ee(a),p=wt(o);return u.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),d.jsx(ya,{...s,children:d.jsx(nC,{scope:t,open:n,onOpenChange:m,content:c,onContentChange:l,children:d.jsx(rC,{scope:t,onClose:u.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:f,dir:p,modal:i,children:r})})})};su.displayName=Ln;var oC="MenuAnchor",Ma=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fr(n);return d.jsx(Ir,{...o,...r,ref:t})});Ma.displayName=oC;var Ra="MenuPortal",[aC,iu]=At(Ra,{forceMount:void 0}),cu=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,a=_t(Ra,t);return d.jsx(aC,{scope:t,forceMount:n,children:d.jsx(Ae,{present:n||a.open,children:d.jsx(kn,{asChild:!0,container:o,children:r})})})};cu.displayName=Ra;var Te="MenuContent",[sC,Pa]=At(Te),lu=u.forwardRef((e,t)=>{const n=iu(Te,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=_t(Te,e.__scopeMenu),i=Wn(Te,e.__scopeMenu);return d.jsx(Cn.Provider,{scope:e.__scopeMenu,children:d.jsx(Ae,{present:r||a.open,children:d.jsx(Cn.Slot,{scope:e.__scopeMenu,children:i.modal?d.jsx(iC,{...o,ref:t}):d.jsx(cC,{...o,ref:t})})})})}),iC=u.forwardRef((e,t)=>{const n=_t(Te,e.__scopeMenu),r=u.useRef(null),o=q(t,r);return u.useEffect(()=>{const a=r.current;if(a)return br(a)},[]),d.jsx(ka,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:T(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),cC=u.forwardRef((e,t)=>{const n=_t(Te,e.__scopeMenu);return d.jsx(ka,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),lC=ht("MenuContent.ScrollLock"),ka=u.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:h,disableOutsideScroll:y,...g}=e,v=_t(Te,n),b=Wn(Te,n),x=Fr(n),w=au(n),S=eC(n),[C,M]=u.useState(null),E=u.useRef(null),R=q(t,E,v.onContentChange),$=u.useRef(0),_=u.useRef(""),I=u.useRef(0),D=u.useRef(null),L=u.useRef("right"),B=u.useRef(0),K=y?In:u.Fragment,j=y?{as:lC,allowPinchZoom:!0}:void 0,Q=O=>{var A,U;const ee=_.current+O,J=S().filter(z=>!z.disabled),P=document.activeElement,H=(A=J.find(z=>z.ref.current===P))==null?void 0:A.textValue,Y=J.map(z=>z.textValue),W=wC(Y,ee,H),X=(U=J.find(z=>z.textValue===W))==null?void 0:U.ref.current;(function z(te){_.current=te,window.clearTimeout($.current),te!==""&&($.current=window.setTimeout(()=>z(""),1e3))})(ee),X&&setTimeout(()=>X.focus())};u.useEffect(()=>()=>window.clearTimeout($.current),[]),vr();const F=u.useCallback(O=>{var J,P;return L.current===((J=D.current)==null?void 0:J.side)&&SC(O,(P=D.current)==null?void 0:P.area)},[]);return d.jsx(sC,{scope:n,searchRef:_,onItemEnter:u.useCallback(O=>{F(O)&&O.preventDefault()},[F]),onItemLeave:u.useCallback(O=>{var ee;F(O)||((ee=E.current)==null||ee.focus(),M(null))},[F]),onTriggerLeave:u.useCallback(O=>{F(O)&&O.preventDefault()},[F]),pointerGraceTimerRef:I,onPointerGraceIntentChange:u.useCallback(O=>{D.current=O},[]),children:d.jsx(K,{...j,children:d.jsx(Pn,{asChild:!0,trapped:o,onMountAutoFocus:T(a,O=>{var ee;O.preventDefault(),(ee=E.current)==null||ee.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:d.jsx(Rn,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:p,onDismiss:h,children:d.jsx(Kw,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:M,onEntryFocus:T(c,O=>{b.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(ba,{role:"menu","aria-orientation":"vertical","data-state":Eu(v.open),"data-radix-menu-content":"",dir:b.dir,...x,...g,ref:R,style:{outline:"none",...g.style},onKeyDown:T(g.onKeyDown,O=>{const J=O.target.closest("[data-radix-menu-content]")===O.currentTarget,P=O.ctrlKey||O.altKey||O.metaKey,H=O.key.length===1;J&&(O.key==="Tab"&&O.preventDefault(),!P&&H&&Q(O.key));const Y=E.current;if(O.target!==Y||!Zw.includes(O.key))return;O.preventDefault();const X=S().filter(A=>!A.disabled).map(A=>A.ref.current);ru.includes(O.key)&&X.reverse(),bC(X)}),onBlur:T(e.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout($.current),_.current="")}),onPointerMove:T(e.onPointerMove,Sn(O=>{const ee=O.target,J=B.current!==O.clientX;if(O.currentTarget.contains(ee)&&J){const P=O.clientX>B.current?"right":"left";L.current=P,B.current=O.clientX}}))})})})})})})});lu.displayName=Te;var uC="MenuGroup",Ia=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(V.div,{role:"group",...r,ref:t})});Ia.displayName=uC;var dC="MenuLabel",uu=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(V.div,{...r,ref:t})});uu.displayName=dC;var lr="MenuItem",Bs="menu.itemSelect",$r=u.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,a=u.useRef(null),i=Wn(lr,e.__scopeMenu),s=Pa(lr,e.__scopeMenu),c=q(t,a),l=u.useRef(!1),f=()=>{const m=a.current;if(!n&&m){const p=new CustomEvent(Bs,{bubbles:!0,cancelable:!0});m.addEventListener(Bs,h=>r==null?void 0:r(h),{once:!0}),ei(m,p),p.defaultPrevented?l.current=!1:i.onClose()}};return d.jsx(du,{...o,ref:c,disabled:n,onClick:T(e.onClick,f),onPointerDown:m=>{var p;(p=e.onPointerDown)==null||p.call(e,m),l.current=!0},onPointerUp:T(e.onPointerUp,m=>{var p;l.current||(p=m.currentTarget)==null||p.click()}),onKeyDown:T(e.onKeyDown,m=>{const p=s.searchRef.current!=="";n||p&&m.key===" "||To.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});$r.displayName=lr;var du=u.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=e,i=Pa(lr,n),s=au(n),c=u.useRef(null),l=q(t,c),[f,m]=u.useState(!1),[p,h]=u.useState("");return u.useEffect(()=>{const y=c.current;y&&h((y.textContent??"").trim())},[a.children]),d.jsx(Cn.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:d.jsx(qw,{asChild:!0,...s,focusable:!r,children:d.jsx(V.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:l,onPointerMove:T(e.onPointerMove,Sn(y=>{r?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:T(e.onPointerLeave,Sn(y=>i.onItemLeave(y))),onFocus:T(e.onFocus,()=>m(!0)),onBlur:T(e.onBlur,()=>m(!1))})})})}),fC="MenuCheckboxItem",fu=u.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return d.jsx(vu,{scope:e.__scopeMenu,checked:n,children:d.jsx($r,{role:"menuitemcheckbox","aria-checked":ur(n)?"mixed":n,...o,ref:t,"data-state":Oa(n),onSelect:T(o.onSelect,()=>r==null?void 0:r(ur(n)?!0:!n),{checkForDefaultPrevented:!1})})})});fu.displayName=fC;var mu="MenuRadioGroup",[mC,pC]=At(mu,{value:void 0,onValueChange:()=>{}}),pu=u.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,a=Ee(r);return d.jsx(mC,{scope:e.__scopeMenu,value:n,onValueChange:a,children:d.jsx(Ia,{...o,ref:t})})});pu.displayName=mu;var hu="MenuRadioItem",gu=u.forwardRef((e,t)=>{const{value:n,...r}=e,o=pC(hu,e.__scopeMenu),a=n===o.value;return d.jsx(vu,{scope:e.__scopeMenu,checked:a,children:d.jsx($r,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":Oa(a),onSelect:T(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});gu.displayName=hu;var Da="MenuItemIndicator",[vu,hC]=At(Da,{checked:!1}),yu=u.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,a=hC(Da,n);return d.jsx(Ae,{present:r||ur(a.checked)||a.checked===!0,children:d.jsx(V.span,{...o,ref:t,"data-state":Oa(a.checked)})})});yu.displayName=Da;var gC="MenuSeparator",bu=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(V.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});bu.displayName=gC;var vC="MenuArrow",xu=u.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Fr(n);return d.jsx(xa,{...o,...r,ref:t})});xu.displayName=vC;var yC="MenuSub",[dE,wu]=At(yC),mn="MenuSubTrigger",Cu=u.forwardRef((e,t)=>{const n=_t(mn,e.__scopeMenu),r=Wn(mn,e.__scopeMenu),o=wu(mn,e.__scopeMenu),a=Pa(mn,e.__scopeMenu),i=u.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},f=u.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return u.useEffect(()=>f,[f]),u.useEffect(()=>{const m=s.current;return()=>{window.clearTimeout(m),c(null)}},[s,c]),d.jsx(Ma,{asChild:!0,...l,children:d.jsx(du,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Eu(n.open),...e,ref:Ze(t,o.onTriggerChange),onClick:m=>{var p;(p=e.onClick)==null||p.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:T(e.onPointerMove,Sn(m=>{a.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:T(e.onPointerLeave,Sn(m=>{var h,y;f();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const g=(y=n.content)==null?void 0:y.dataset.side,v=g==="right",b=v?-5:5,x=p[v?"left":"right"],w=p[v?"right":"left"];a.onPointerGraceIntentChange({area:[{x:m.clientX+b,y:m.clientY},{x,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x,y:p.bottom}],side:g}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(m),m.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:T(e.onKeyDown,m=>{var h;const p=a.searchRef.current!=="";e.disabled||p&&m.key===" "||Qw[r.dir].includes(m.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),m.preventDefault())})})})});Cu.displayName=mn;var Su="MenuSubContent",Nu=u.forwardRef((e,t)=>{const n=iu(Te,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=_t(Te,e.__scopeMenu),i=Wn(Te,e.__scopeMenu),s=wu(Su,e.__scopeMenu),c=u.useRef(null),l=q(t,c);return d.jsx(Cn.Provider,{scope:e.__scopeMenu,children:d.jsx(Ae,{present:r||a.open,children:d.jsx(Cn.Slot,{scope:e.__scopeMenu,children:d.jsx(ka,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var m;i.isUsingKeyboardRef.current&&((m=c.current)==null||m.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:T(e.onFocusOutside,f=>{f.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:T(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:T(e.onKeyDown,f=>{var h;const m=f.currentTarget.contains(f.target),p=Jw[i.dir].includes(f.key);m&&p&&(a.onOpenChange(!1),(h=s.trigger)==null||h.focus(),f.preventDefault())})})})})})});Nu.displayName=Su;function Eu(e){return e?"open":"closed"}function ur(e){return e==="indeterminate"}function Oa(e){return ur(e)?"indeterminate":e?"checked":"unchecked"}function bC(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function xC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function wC(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=xC(e,Math.max(a,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function CC(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const s=t[a],c=t[i],l=s.x,f=s.y,m=c.x,p=c.y;f>r!=p>r&&n<(m-l)*(r-f)/(p-f)+l&&(o=!o)}return o}function SC(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return CC(n,t)}function Sn(e){return t=>t.pointerType==="mouse"?e(t):void 0}var NC=su,EC=Ma,MC=cu,RC=lu,PC=Ia,kC=uu,IC=$r,DC=fu,OC=pu,TC=gu,AC=yu,_C=bu,jC=xu,FC=Cu,$C=Nu,Lr="DropdownMenu",[LC,fE]=ye(Lr,[ou]),Me=ou(),[WC,Mu]=LC(Lr),Ru=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,c=Me(t),l=u.useRef(null),[f,m]=Se({prop:o,defaultProp:a??!1,onChange:i,caller:Lr});return d.jsx(WC,{scope:t,triggerId:ge(),triggerRef:l,contentId:ge(),open:f,onOpenChange:m,onOpenToggle:u.useCallback(()=>m(p=>!p),[m]),modal:s,children:d.jsx(NC,{...c,open:f,onOpenChange:m,dir:r,modal:s,children:n})})};Ru.displayName=Lr;var Pu="DropdownMenuTrigger",ku=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,a=Mu(Pu,n),i=Me(n);return d.jsx(EC,{asChild:!0,...i,children:d.jsx(V.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Ze(t,a.triggerRef),onPointerDown:T(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:T(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});ku.displayName=Pu;var BC="DropdownMenuPortal",Iu=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Me(t);return d.jsx(MC,{...r,...n})};Iu.displayName=BC;var Du="DropdownMenuContent",Ou=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Mu(Du,n),a=Me(n),i=u.useRef(!1);return d.jsx(RC,{id:o.contentId,"aria-labelledby":o.triggerId,...a,...r,ref:t,onCloseAutoFocus:T(e.onCloseAutoFocus,s=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,s.preventDefault()}),onInteractOutside:T(e.onInteractOutside,s=>{const c=s.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,f=c.button===2||l;(!o.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ou.displayName=Du;var HC="DropdownMenuGroup",VC=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(PC,{...o,...r,ref:t})});VC.displayName=HC;var YC="DropdownMenuLabel",GC=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(kC,{...o,...r,ref:t})});GC.displayName=YC;var UC="DropdownMenuItem",Tu=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(IC,{...o,...r,ref:t})});Tu.displayName=UC;var zC="DropdownMenuCheckboxItem",KC=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(DC,{...o,...r,ref:t})});KC.displayName=zC;var qC="DropdownMenuRadioGroup",XC=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(OC,{...o,...r,ref:t})});XC.displayName=qC;var ZC="DropdownMenuRadioItem",QC=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(TC,{...o,...r,ref:t})});QC.displayName=ZC;var JC="DropdownMenuItemIndicator",e0=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(AC,{...o,...r,ref:t})});e0.displayName=JC;var t0="DropdownMenuSeparator",Au=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(_C,{...o,...r,ref:t})});Au.displayName=t0;var n0="DropdownMenuArrow",r0=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(jC,{...o,...r,ref:t})});r0.displayName=n0;var o0="DropdownMenuSubTrigger",a0=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx(FC,{...o,...r,ref:t})});a0.displayName=o0;var s0="DropdownMenuSubContent",i0=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Me(n);return d.jsx($C,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});i0.displayName=s0;var c0=Ru,l0=ku,u0=Iu,d0=Ou,f0=Tu,m0=Au;const _u=N.memo(({item:e})=>{const{isDisabled:t,onClick:n,icon:r,label:o}=e,a=N.useCallback(i=>{t?(i.preventDefault(),i.stopPropagation()):n==null||n()},[t,n]);return d.jsxs(f0,{"aria-disabled":t,className:k(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm
|
|
166
166
|
outline-none transition-colors focus:bg-accent focus:text-accent-foreground`,n&&!t&&"cursor-pointer",t&&"cursor-not-allowed opacity-50"),onClick:a,children:[r?d.jsx("span",{className:"mr-2",children:r}):null,o]})});_u.displayName="DropdownMenuItem";const ju=u.forwardRef(({className:e,children:t,items:n,align:r="start",variant:o="default",isDisabled:a=!1,zIndex:i,...s},c)=>{const l=je("dropdown",i);return d.jsxs(c0,{children:[d.jsx(l0,{asChild:!0,children:d.jsxs(Be,{ref:c,className:k("flex items-center gap-1",e),isDisabled:a,variant:o,...s,children:[t,d.jsx(Qo,{className:"h-4 w-4"})]})}),d.jsx(u0,{children:d.jsx(d0,{align:r,className:`min-w-[8rem] overflow-hidden rounded-md border bg-popover px-1 py-1
|
|
167
167
|
text-popover-foreground shadow-md data-[state=open]:animate-in
|
|
168
168
|
data-[state=closed]:animate-out data-[state=closed]:fade-out-0
|