randmarcomps 1.494.0 → 1.495.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/randmarcomps.d.ts +1 -0
- package/dist/randmarcomps.js +14 -5
- package/dist/randmarcomps.umd.cjs +2 -2
- package/dist/style.css +15 -0
- package/package.json +1 -1
package/dist/randmarcomps.d.ts
CHANGED
|
@@ -404,6 +404,7 @@ export declare const DialogClose: React_2.ForwardRefExoticComponent<DialogPrimit
|
|
|
404
404
|
|
|
405
405
|
export declare const DialogContent: React_2.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
406
406
|
animateExit?: boolean;
|
|
407
|
+
overlayClassName?: string;
|
|
407
408
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
408
409
|
|
|
409
410
|
export declare const DialogDescription: React_2.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React_2.RefAttributes<HTMLParagraphElement>, "ref"> & React_2.RefAttributes<HTMLParagraphElement>>;
|
package/dist/randmarcomps.js
CHANGED
|
@@ -6129,18 +6129,18 @@ const DialogTrigger = Trigger$6, DialogPortal = Portal$4, DialogClose = Close$1,
|
|
|
6129
6129
|
}
|
|
6130
6130
|
));
|
|
6131
6131
|
DialogOverlay.displayName = Overlay.displayName;
|
|
6132
|
-
const DialogContent = React.forwardRef(({ className: e, children: t, animateExit: n = !0,
|
|
6133
|
-
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
6132
|
+
const DialogContent = React.forwardRef(({ className: e, children: t, animateExit: n = !0, overlayClassName: o, ...l }, d) => /* @__PURE__ */ jsxs(DialogPortal, { forceMount: l.forceMount, children: [
|
|
6133
|
+
/* @__PURE__ */ jsx(DialogOverlay, { className: o }),
|
|
6134
6134
|
/* @__PURE__ */ jsxs(
|
|
6135
6135
|
Content$3,
|
|
6136
6136
|
{
|
|
6137
|
-
ref:
|
|
6137
|
+
ref: d,
|
|
6138
6138
|
className: cn(
|
|
6139
6139
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl shadow-primary duration-200 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
6140
6140
|
n && "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]",
|
|
6141
6141
|
e
|
|
6142
6142
|
),
|
|
6143
|
-
...
|
|
6143
|
+
...l,
|
|
6144
6144
|
children: [
|
|
6145
6145
|
t,
|
|
6146
6146
|
/* @__PURE__ */ jsxs(Close$1, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
@@ -80227,7 +80227,16 @@ const useConfig = () => {
|
|
|
80227
80227
|
}
|
|
80228
80228
|
) })
|
|
80229
80229
|
] }),
|
|
80230
|
-
/* @__PURE__ */ jsx(
|
|
80230
|
+
/* @__PURE__ */ jsx(
|
|
80231
|
+
DialogContent,
|
|
80232
|
+
{
|
|
80233
|
+
overlayClassName: "randmar-assistant-backdrop",
|
|
80234
|
+
className: "max-w-[85vw] p-0 data-[state=open]:visible data-[state=closed]:invisible bg-background/95 shadow-[0_30px_120px_-25px_rgba(0,0,0,0.75)] ring-1 ring-primary/20",
|
|
80235
|
+
forceMount: !0,
|
|
80236
|
+
animateExit: !1,
|
|
80237
|
+
children: /* @__PURE__ */ jsx(AIChatLayout, { className: "h-[85vh]", ref: S, inputRef: b, userId: l, userName: o ?? "Unknown user" })
|
|
80238
|
+
}
|
|
80239
|
+
)
|
|
80231
80240
|
] }),
|
|
80232
80241
|
t
|
|
80233
80242
|
] })
|
|
@@ -516,7 +516,7 @@
|
|
|
516
516
|
|
|
517
517
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
518
518
|
|
|
519
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return React__namespace.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},DESCRIPTION_WARNING_NAME="DialogDescriptionWarning",DescriptionWarning$1=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;return React__namespace.useEffect(()=>{var d;const l=(d=e.current)==null?void 0:d.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Root$a=Dialog$1,Trigger$6=DialogTrigger$1,Portal$4=DialogPortal$1,Overlay=DialogOverlay$1,Content$3=DialogContent$1,Title$1=DialogTitle$1,Description$1=DialogDescription$1,Close$1=DialogClose$1;const Dialog=({modal:e=!1,...t})=>jsxRuntime.jsx(Root$a,{modal:e,...t});Dialog.displayName=Root$a.displayName;const DialogTrigger=Trigger$6,DialogPortal=Portal$4,DialogClose=Close$1,DialogOverlay=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Overlay,{ref:n,className:cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));DialogOverlay.displayName=Overlay.displayName;const DialogContent=React__namespace.forwardRef(({className:e,children:t,animateExit:n=!0,...o},l)=>jsxRuntime.jsxs(DialogPortal,{forceMount:o.forceMount,children:[jsxRuntime.jsx(DialogOverlay,{}),jsxRuntime.jsxs(Content$3,{ref:l,className:cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl shadow-primary duration-200 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n&&"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]",e),...o,children:[t,jsxRuntime.jsxs(Close$1,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[jsxRuntime.jsx(X$1,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));DialogContent.displayName=Content$3.displayName;const DialogHeader=({className:e,...t})=>jsxRuntime.jsx("div",{className:cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});DialogHeader.displayName="DialogHeader";const DialogFooter=({className:e,...t})=>jsxRuntime.jsx("div",{className:cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});DialogFooter.displayName="DialogFooter";const DialogTitle=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Title$1,{ref:n,className:cn("text-lg font-semibold leading-none tracking-tight",e),...t}));DialogTitle.displayName=Title$1.displayName;const DialogDescription=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Description$1,{ref:n,className:cn("text-sm text-muted-foreground",e),...t}));DialogDescription.displayName=Description$1.displayName;const sides=["top","right","bottom","left"],min$4=Math.min,max$4=Math.max,round$1=Math.round,floor=Math.floor,createCoords=e=>({x:e,y:e}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$1(e,t,n){return max$4(e,min$4(t,n))}function evaluate(e,t){return typeof e=="function"?e(t):e}function getSide$1(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getOppositeAxis(e){return e==="x"?"y":"x"}function getAxisLength(e){return e==="y"?"height":"width"}const yAxisSides=new Set(["top","bottom"]);function getSideAxis(e){return yAxisSides.has(getSide$1(e))?"y":"x"}function getAlignmentAxis(e){return getOppositeAxis(getSideAxis(e))}function getAlignmentSides(e,t,n){n===void 0&&(n=!1);const o=getAlignment(e),l=getAlignmentAxis(e),d=getAxisLength(l);let f=l==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[d]>t.floating[d]&&(f=getOppositePlacement(f)),[f,getOppositePlacement(f)]}function getExpandedPlacements(e){const t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}function getOppositeAlignmentPlacement(e){return e.replace(/start|end/g,t=>oppositeAlignmentMap[t])}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(e,t,n){switch(e){case"top":case"bottom":return n?t?rlPlacement:lrPlacement:t?lrPlacement:rlPlacement;case"left":case"right":return t?tbPlacement:btPlacement;default:return[]}}function getOppositeAxisPlacements(e,t,n,o){const l=getAlignment(e);let d=getSideList(getSide$1(e),n==="start",o);return l&&(d=d.map(f=>f+"-"+l),t&&(d=d.concat(d.map(getOppositeAlignmentPlacement)))),d}function getOppositePlacement(e){return e.replace(/left|right|bottom|top/g,t=>oppositeSideMap[t])}function expandPaddingObject(e){return{top:0,right:0,bottom:0,left:0,...e}}function getPaddingObject(e){return typeof e!="number"?expandPaddingObject(e):{top:e,right:e,bottom:e,left:e}}function rectToClientRect(e){const{x:t,y:n,width:o,height:l}=e;return{width:o,height:l,top:n,left:t,right:t+o,bottom:n+l,x:t,y:n}}function computeCoordsFromPlacement(e,t,n){let{reference:o,floating:l}=e;const d=getSideAxis(t),f=getAlignmentAxis(t),g=getAxisLength(f),b=getSide$1(t),_=d==="y",S=o.x+o.width/2-l.width/2,R=o.y+o.height/2-l.height/2,C=o[g]/2-l[g]/2;let E;switch(b){case"top":E={x:S,y:o.y-l.height};break;case"bottom":E={x:S,y:o.y+o.height};break;case"right":E={x:o.x+o.width,y:R};break;case"left":E={x:o.x-l.width,y:R};break;default:E={x:o.x,y:o.y}}switch(getAlignment(t)){case"start":E[f]-=C*(n&&_?-1:1);break;case"end":E[f]+=C*(n&&_?-1:1);break}return E}const computePosition$1=async(e,t,n)=>{const{placement:o="bottom",strategy:l="absolute",middleware:d=[],platform:f}=n,g=d.filter(Boolean),b=await(f.isRTL==null?void 0:f.isRTL(t));let _=await f.getElementRects({reference:e,floating:t,strategy:l}),{x:S,y:R}=computeCoordsFromPlacement(_,o,b),C=o,E={},A=0;for(let M=0;M<g.length;M++){const{name:I,fn:j}=g[M],{x:q,y:Q,data:te,reset:F}=await j({x:S,y:R,initialPlacement:o,placement:C,strategy:l,middlewareData:E,rects:_,platform:f,elements:{reference:e,floating:t}});S=q??S,R=Q??R,E={...E,[I]:{...E[I],...te}},F&&A<=50&&(A++,typeof F=="object"&&(F.placement&&(C=F.placement),F.rects&&(_=F.rects===!0?await f.getElementRects({reference:e,floating:t,strategy:l}):F.rects),{x:S,y:R}=computeCoordsFromPlacement(_,C,b)),M=-1)}return{x:S,y:R,placement:C,strategy:l,middlewareData:E}};async function detectOverflow(e,t){var n;t===void 0&&(t={});const{x:o,y:l,platform:d,rects:f,elements:g,strategy:b}=e,{boundary:_="clippingAncestors",rootBoundary:S="viewport",elementContext:R="floating",altBoundary:C=!1,padding:E=0}=evaluate(t,e),A=getPaddingObject(E),I=g[C?R==="floating"?"reference":"floating":R],j=rectToClientRect(await d.getClippingRect({element:(n=await(d.isElement==null?void 0:d.isElement(I)))==null||n?I:I.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(g.floating)),boundary:_,rootBoundary:S,strategy:b})),q=R==="floating"?{x:o,y:l,width:f.floating.width,height:f.floating.height}:f.reference,Q=await(d.getOffsetParent==null?void 0:d.getOffsetParent(g.floating)),te=await(d.isElement==null?void 0:d.isElement(Q))?await(d.getScale==null?void 0:d.getScale(Q))||{x:1,y:1}:{x:1,y:1},F=rectToClientRect(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:g,rect:q,offsetParent:Q,strategy:b}):q);return{top:(j.top-F.top+A.top)/te.y,bottom:(F.bottom-j.bottom+A.bottom)/te.y,left:(j.left-F.left+A.left)/te.x,right:(F.right-j.right+A.right)/te.x}}const arrow$4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:l,rects:d,platform:f,elements:g,middlewareData:b}=t,{element:_,padding:S=0}=evaluate(e,t)||{};if(_==null)return{};const R=getPaddingObject(S),C={x:n,y:o},E=getAlignmentAxis(l),A=getAxisLength(E),M=await f.getDimensions(_),I=E==="y",j=I?"top":"left",q=I?"bottom":"right",Q=I?"clientHeight":"clientWidth",te=d.reference[A]+d.reference[E]-C[E]-d.floating[A],F=C[E]-d.reference[E],V=await(f.getOffsetParent==null?void 0:f.getOffsetParent(_));let ne=V?V[Q]:0;(!ne||!await(f.isElement==null?void 0:f.isElement(V)))&&(ne=g.floating[Q]||d.floating[A]);const ae=te/2-F/2,se=ne/2-M[A]/2-1,$e=min$4(R[j],se),Ne=min$4(R[q],se),oe=$e,Oe=ne-M[A]-Ne,Ae=ne/2-M[A]/2+ae,je=clamp$1(oe,Ae,Oe),Be=!b.arrow&&getAlignment(l)!=null&&Ae!==je&&d.reference[A]/2-(Ae<oe?$e:Ne)-M[A]/2<0,qe=Be?Ae<oe?Ae-oe:Ae-Oe:0;return{[E]:C[E]+qe,data:{[E]:je,centerOffset:Ae-je-qe,...Be&&{alignmentOffset:qe}},reset:Be}}}),flip$2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:l,middlewareData:d,rects:f,initialPlacement:g,platform:b,elements:_}=t,{mainAxis:S=!0,crossAxis:R=!0,fallbackPlacements:C,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:M=!0,...I}=evaluate(e,t);if((n=d.arrow)!=null&&n.alignmentOffset)return{};const j=getSide$1(l),q=getSideAxis(g),Q=getSide$1(g)===g,te=await(b.isRTL==null?void 0:b.isRTL(_.floating)),F=C||(Q||!M?[getOppositePlacement(g)]:getExpandedPlacements(g)),V=A!=="none";!C&&V&&F.push(...getOppositeAxisPlacements(g,M,A,te));const ne=[g,...F],ae=await detectOverflow(t,I),se=[];let $e=((o=d.flip)==null?void 0:o.overflows)||[];if(S&&se.push(ae[j]),R){const Ae=getAlignmentSides(l,f,te);se.push(ae[Ae[0]],ae[Ae[1]])}if($e=[...$e,{placement:l,overflows:se}],!se.every(Ae=>Ae<=0)){var Ne,oe;const Ae=(((Ne=d.flip)==null?void 0:Ne.index)||0)+1,je=ne[Ae];if(je&&(!(R==="alignment"?q!==getSideAxis(je):!1)||$e.every(Ve=>getSideAxis(Ve.placement)===q?Ve.overflows[0]>0:!0)))return{data:{index:Ae,overflows:$e},reset:{placement:je}};let Be=(oe=$e.filter(qe=>qe.overflows[0]<=0).sort((qe,Ve)=>qe.overflows[1]-Ve.overflows[1])[0])==null?void 0:oe.placement;if(!Be)switch(E){case"bestFit":{var Oe;const qe=(Oe=$e.filter(Ve=>{if(V){const Le=getSideAxis(Ve.placement);return Le===q||Le==="y"}return!0}).map(Ve=>[Ve.placement,Ve.overflows.filter(Le=>Le>0).reduce((Le,Ue)=>Le+Ue,0)]).sort((Ve,Le)=>Ve[1]-Le[1])[0])==null?void 0:Oe[0];qe&&(Be=qe);break}case"initialPlacement":Be=g;break}if(l!==Be)return{reset:{placement:Be}}}return{}}}};function getSideOffsets(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function isAnySideFullyClipped(e){return sides.some(t=>e[t]>=0)}const hide$2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...l}=evaluate(e,t);switch(o){case"referenceHidden":{const d=await detectOverflow(t,{...l,elementContext:"reference"}),f=getSideOffsets(d,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:isAnySideFullyClipped(f)}}}case"escaped":{const d=await detectOverflow(t,{...l,altBoundary:!0}),f=getSideOffsets(d,n.floating);return{data:{escapedOffsets:f,escaped:isAnySideFullyClipped(f)}}}default:return{}}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(e,t){const{placement:n,platform:o,elements:l}=e,d=await(o.isRTL==null?void 0:o.isRTL(l.floating)),f=getSide$1(n),g=getAlignment(n),b=getSideAxis(n)==="y",_=originSides.has(f)?-1:1,S=d&&b?-1:1,R=evaluate(t,e);let{mainAxis:C,crossAxis:E,alignmentAxis:A}=typeof R=="number"?{mainAxis:R,crossAxis:0,alignmentAxis:null}:{mainAxis:R.mainAxis||0,crossAxis:R.crossAxis||0,alignmentAxis:R.alignmentAxis};return g&&typeof A=="number"&&(E=g==="end"?A*-1:A),b?{x:E*S,y:C*_}:{x:C*_,y:E*S}}const offset$2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:l,y:d,placement:f,middlewareData:g}=t,b=await convertValueToCoords(t,e);return f===((n=g.offset)==null?void 0:n.placement)&&(o=g.arrow)!=null&&o.alignmentOffset?{}:{x:l+b.x,y:d+b.y,data:{...b,placement:f}}}}},shift$3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:l}=t,{mainAxis:d=!0,crossAxis:f=!1,limiter:g={fn:I=>{let{x:j,y:q}=I;return{x:j,y:q}}},...b}=evaluate(e,t),_={x:n,y:o},S=await detectOverflow(t,b),R=getSideAxis(getSide$1(l)),C=getOppositeAxis(R);let E=_[C],A=_[R];if(d){const I=C==="y"?"top":"left",j=C==="y"?"bottom":"right",q=E+S[I],Q=E-S[j];E=clamp$1(q,E,Q)}if(f){const I=R==="y"?"top":"left",j=R==="y"?"bottom":"right",q=A+S[I],Q=A-S[j];A=clamp$1(q,A,Q)}const M=g.fn({...t,[C]:E,[R]:A});return{...M,data:{x:M.x-n,y:M.y-o,enabled:{[C]:d,[R]:f}}}}}},limitShift$2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:l,rects:d,middlewareData:f}=t,{offset:g=0,mainAxis:b=!0,crossAxis:_=!0}=evaluate(e,t),S={x:n,y:o},R=getSideAxis(l),C=getOppositeAxis(R);let E=S[C],A=S[R];const M=evaluate(g,t),I=typeof M=="number"?{mainAxis:M,crossAxis:0}:{mainAxis:0,crossAxis:0,...M};if(b){const Q=C==="y"?"height":"width",te=d.reference[C]-d.floating[Q]+I.mainAxis,F=d.reference[C]+d.reference[Q]-I.mainAxis;E<te?E=te:E>F&&(E=F)}if(_){var j,q;const Q=C==="y"?"width":"height",te=originSides.has(getSide$1(l)),F=d.reference[R]-d.floating[Q]+(te&&((j=f.offset)==null?void 0:j[R])||0)+(te?0:I.crossAxis),V=d.reference[R]+d.reference[Q]+(te?0:((q=f.offset)==null?void 0:q[R])||0)-(te?I.crossAxis:0);A<F?A=F:A>V&&(A=V)}return{[C]:E,[R]:A}}}},size$2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:l,rects:d,platform:f,elements:g}=t,{apply:b=()=>{},..._}=evaluate(e,t),S=await detectOverflow(t,_),R=getSide$1(l),C=getAlignment(l),E=getSideAxis(l)==="y",{width:A,height:M}=d.floating;let I,j;R==="top"||R==="bottom"?(I=R,j=C===(await(f.isRTL==null?void 0:f.isRTL(g.floating))?"start":"end")?"left":"right"):(j=R,I=C==="end"?"top":"bottom");const q=M-S.top-S.bottom,Q=A-S.left-S.right,te=min$4(M-S[I],q),F=min$4(A-S[j],Q),V=!t.middlewareData.shift;let ne=te,ae=F;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(ae=Q),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(ne=q),V&&!C){const $e=max$4(S.left,0),Ne=max$4(S.right,0),oe=max$4(S.top,0),Oe=max$4(S.bottom,0);E?ae=A-2*($e!==0||Ne!==0?$e+Ne:max$4(S.left,S.right)):ne=M-2*(oe!==0||Oe!==0?oe+Oe:max$4(S.top,S.bottom))}await b({...t,availableWidth:ae,availableHeight:ne});const se=await f.getDimensions(g.floating);return A!==se.width||M!==se.height?{reset:{rects:!0}}:{}}}};function hasWindow(){return typeof window<"u"}function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():"#document"}function getWindow(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function getDocumentElement(e){var t;return(t=(isNode(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function isNode(e){return hasWindow()?e instanceof Node||e instanceof getWindow(e).Node:!1}function isElement(e){return hasWindow()?e instanceof Element||e instanceof getWindow(e).Element:!1}function isHTMLElement$2(e){return hasWindow()?e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement:!1}function isShadowRoot(e){return!hasWindow()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot}const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:o,display:l}=getComputedStyle$1(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!invalidOverflowDisplayValues.has(l)}const tableElements=new Set(["table","td","th"]);function isTableElement(e){return tableElements.has(getNodeName(e))}const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(e){return topLayerSelectors.some(t=>{try{return e.matches(t)}catch{return!1}})}const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(e){const t=isWebKit(),n=isElement(e)?getComputedStyle$1(e):e;return transformProperties.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||willChangeValues.some(o=>(n.willChange||"").includes(o))||containValues.some(o=>(n.contain||"").includes(o))}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement$2(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;if(isTopLayer(t))return null;t=getParentNode(t)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(e){return lastTraversableNodeNames.has(getNodeName(e))}function getComputedStyle$1(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function getParentNode(e){if(getNodeName(e)==="html")return e;const t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument?e.ownerDocument.body:e.body:isHTMLElement$2(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const l=getNearestOverflowAncestor(e),d=l===((o=e.ownerDocument)==null?void 0:o.body),f=getWindow(l);if(d){const g=getFrameElement(f);return t.concat(f,f.visualViewport||[],isOverflowElement(l)?l:[],g&&n?getOverflowAncestors(g):[])}return t.concat(l,getOverflowAncestors(l,[],n))}function getFrameElement(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function getCssDimensions(e){const t=getComputedStyle$1(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const l=isHTMLElement$2(e),d=l?e.offsetWidth:n,f=l?e.offsetHeight:o,g=round$1(n)!==d||round$1(o)!==f;return g&&(n=d,o=f),{width:n,height:o,$:g}}function unwrapElement(e){return isElement(e)?e:e.contextElement}function getScale(e){const t=unwrapElement(e);if(!isHTMLElement$2(t))return createCoords(1);const n=t.getBoundingClientRect(),{width:o,height:l,$:d}=getCssDimensions(t);let f=(d?round$1(n.width):n.width)/o,g=(d?round$1(n.height):n.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!g||!Number.isFinite(g))&&(g=1),{x:f,y:g}}const noOffsets=createCoords(0);function getVisualOffsets(e){const t=getWindow(e);return!isWebKit()||!t.visualViewport?noOffsets:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function shouldAddVisualOffsets(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==getWindow(e)?!1:t}function getBoundingClientRect(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const l=e.getBoundingClientRect(),d=unwrapElement(e);let f=createCoords(1);t&&(o?isElement(o)&&(f=getScale(o)):f=getScale(e));const g=shouldAddVisualOffsets(d,n,o)?getVisualOffsets(d):createCoords(0);let b=(l.left+g.x)/f.x,_=(l.top+g.y)/f.y,S=l.width/f.x,R=l.height/f.y;if(d){const C=getWindow(d),E=o&&isElement(o)?getWindow(o):o;let A=C,M=getFrameElement(A);for(;M&&o&&E!==A;){const I=getScale(M),j=M.getBoundingClientRect(),q=getComputedStyle$1(M),Q=j.left+(M.clientLeft+parseFloat(q.paddingLeft))*I.x,te=j.top+(M.clientTop+parseFloat(q.paddingTop))*I.y;b*=I.x,_*=I.y,S*=I.x,R*=I.y,b+=Q,_+=te,A=getWindow(M),M=getFrameElement(A)}}return rectToClientRect({width:S,height:R,x:b,y:_})}function getWindowScrollBarX(e,t){const n=getNodeScroll(e).scrollLeft;return t?t.left+n:getBoundingClientRect(getDocumentElement(e)).left+n}function getHTMLOffset(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-getWindowScrollBarX(e,n),l=n.top+t.scrollTop;return{x:o,y:l}}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{elements:t,rect:n,offsetParent:o,strategy:l}=e;const d=l==="fixed",f=getDocumentElement(o),g=t?isTopLayer(t.floating):!1;if(o===f||g&&d)return n;let b={scrollLeft:0,scrollTop:0},_=createCoords(1);const S=createCoords(0),R=isHTMLElement$2(o);if((R||!R&&!d)&&((getNodeName(o)!=="body"||isOverflowElement(f))&&(b=getNodeScroll(o)),isHTMLElement$2(o))){const E=getBoundingClientRect(o);_=getScale(o),S.x=E.x+o.clientLeft,S.y=E.y+o.clientTop}const C=f&&!R&&!d?getHTMLOffset(f,b):createCoords(0);return{width:n.width*_.x,height:n.height*_.y,x:n.x*_.x-b.scrollLeft*_.x+S.x+C.x,y:n.y*_.y-b.scrollTop*_.y+S.y+C.y}}function getClientRects(e){return Array.from(e.getClientRects())}function getDocumentRect(e){const t=getDocumentElement(e),n=getNodeScroll(e),o=e.ownerDocument.body,l=max$4(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),d=max$4(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let f=-n.scrollLeft+getWindowScrollBarX(e);const g=-n.scrollTop;return getComputedStyle$1(o).direction==="rtl"&&(f+=max$4(t.clientWidth,o.clientWidth)-l),{width:l,height:d,x:f,y:g}}const SCROLLBAR_MAX=25;function getViewportRect(e,t){const n=getWindow(e),o=getDocumentElement(e),l=n.visualViewport;let d=o.clientWidth,f=o.clientHeight,g=0,b=0;if(l){d=l.width,f=l.height;const S=isWebKit();(!S||S&&t==="fixed")&&(g=l.offsetLeft,b=l.offsetTop)}const _=getWindowScrollBarX(o);if(_<=0){const S=o.ownerDocument,R=S.body,C=getComputedStyle(R),E=S.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,A=Math.abs(o.clientWidth-R.clientWidth-E);A<=SCROLLBAR_MAX&&(d-=A)}else _<=SCROLLBAR_MAX&&(d+=_);return{width:d,height:f,x:g,y:b}}const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,t==="fixed"),o=n.top+e.clientTop,l=n.left+e.clientLeft,d=isHTMLElement$2(e)?getScale(e):createCoords(1),f=e.clientWidth*d.x,g=e.clientHeight*d.y,b=l*d.x,_=o*d.y;return{width:f,height:g,x:b,y:_}}function getClientRectFromClippingAncestor(e,t,n){let o;if(t==="viewport")o=getViewportRect(e,n);else if(t==="document")o=getDocumentRect(getDocumentElement(e));else if(isElement(t))o=getInnerBoundingClientRect(t,n);else{const l=getVisualOffsets(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return rectToClientRect(o)}function hasFixedPositionAncestor(e,t){const n=getParentNode(e);return n===t||!isElement(n)||isLastTraversableNode(n)?!1:getComputedStyle$1(n).position==="fixed"||hasFixedPositionAncestor(n,t)}function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let o=getOverflowAncestors(e,[],!1).filter(g=>isElement(g)&&getNodeName(g)!=="body"),l=null;const d=getComputedStyle$1(e).position==="fixed";let f=d?getParentNode(e):e;for(;isElement(f)&&!isLastTraversableNode(f);){const g=getComputedStyle$1(f),b=isContainingBlock(f);!b&&g.position==="fixed"&&(l=null),(d?!b&&!l:!b&&g.position==="static"&&!!l&&absoluteOrFixed.has(l.position)||isOverflowElement(f)&&!b&&hasFixedPositionAncestor(e,f))?o=o.filter(S=>S!==f):l=g,f=getParentNode(f)}return t.set(e,o),o}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:o,strategy:l}=e;const f=[...n==="clippingAncestors"?isTopLayer(t)?[]:getClippingElementAncestors(t,this._c):[].concat(n),o],g=f[0],b=f.reduce((_,S)=>{const R=getClientRectFromClippingAncestor(t,S,l);return _.top=max$4(R.top,_.top),_.right=min$4(R.right,_.right),_.bottom=min$4(R.bottom,_.bottom),_.left=max$4(R.left,_.left),_},getClientRectFromClippingAncestor(t,g,l));return{width:b.right-b.left,height:b.bottom-b.top,x:b.left,y:b.top}}function getDimensions(e){const{width:t,height:n}=getCssDimensions(e);return{width:t,height:n}}function getRectRelativeToOffsetParent(e,t,n){const o=isHTMLElement$2(t),l=getDocumentElement(t),d=n==="fixed",f=getBoundingClientRect(e,!0,d,t);let g={scrollLeft:0,scrollTop:0};const b=createCoords(0);function _(){b.x=getWindowScrollBarX(l)}if(o||!o&&!d)if((getNodeName(t)!=="body"||isOverflowElement(l))&&(g=getNodeScroll(t)),o){const E=getBoundingClientRect(t,!0,d,t);b.x=E.x+t.clientLeft,b.y=E.y+t.clientTop}else l&&_();d&&!o&&l&&_();const S=l&&!o&&!d?getHTMLOffset(l,g):createCoords(0),R=f.left+g.scrollLeft-b.x-S.x,C=f.top+g.scrollTop-b.y-S.y;return{x:R,y:C,width:f.width,height:f.height}}function isStaticPositioned(e){return getComputedStyle$1(e).position==="static"}function getTrueOffsetParent(e,t){if(!isHTMLElement$2(e)||getComputedStyle$1(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return getDocumentElement(e)===n&&(n=n.ownerDocument.body),n}function getOffsetParent(e,t){const n=getWindow(e);if(isTopLayer(e))return n;if(!isHTMLElement$2(e)){let l=getParentNode(e);for(;l&&!isLastTraversableNode(l);){if(isElement(l)&&!isStaticPositioned(l))return l;l=getParentNode(l)}return n}let o=getTrueOffsetParent(e,t);for(;o&&isTableElement(o)&&isStaticPositioned(o);)o=getTrueOffsetParent(o,t);return o&&isLastTraversableNode(o)&&isStaticPositioned(o)&&!isContainingBlock(o)?n:o||getContainingBlock(e)||n}const getElementRects=async function(e){const t=this.getOffsetParent||getOffsetParent,n=this.getDimensions,o=await n(e.floating);return{reference:getRectRelativeToOffsetParent(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function isRTL(e){return getComputedStyle$1(e).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement,isRTL};function rectsAreEqual(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function observeMove(e,t){let n=null,o;const l=getDocumentElement(e);function d(){var g;clearTimeout(o),(g=n)==null||g.disconnect(),n=null}function f(g,b){g===void 0&&(g=!1),b===void 0&&(b=1),d();const _=e.getBoundingClientRect(),{left:S,top:R,width:C,height:E}=_;if(g||t(),!C||!E)return;const A=floor(R),M=floor(l.clientWidth-(S+C)),I=floor(l.clientHeight-(R+E)),j=floor(S),Q={rootMargin:-A+"px "+-M+"px "+-I+"px "+-j+"px",threshold:max$4(0,min$4(1,b))||1};let te=!0;function F(V){const ne=V[0].intersectionRatio;if(ne!==b){if(!te)return f();ne?f(!1,ne):o=setTimeout(()=>{f(!1,1e-7)},1e3)}ne===1&&!rectsAreEqual(_,e.getBoundingClientRect())&&f(),te=!1}try{n=new IntersectionObserver(F,{...Q,root:l.ownerDocument})}catch{n=new IntersectionObserver(F,Q)}n.observe(e)}return f(!0),d}function autoUpdate(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:l=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:g=typeof IntersectionObserver=="function",animationFrame:b=!1}=o,_=unwrapElement(e),S=l||d?[..._?getOverflowAncestors(_):[],...getOverflowAncestors(t)]:[];S.forEach(j=>{l&&j.addEventListener("scroll",n,{passive:!0}),d&&j.addEventListener("resize",n)});const R=_&&g?observeMove(_,n):null;let C=-1,E=null;f&&(E=new ResizeObserver(j=>{let[q]=j;q&&q.target===_&&E&&(E.unobserve(t),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var Q;(Q=E)==null||Q.observe(t)})),n()}),_&&!b&&E.observe(_),E.observe(t));let A,M=b?getBoundingClientRect(e):null;b&&I();function I(){const j=getBoundingClientRect(e);M&&!rectsAreEqual(M,j)&&n(),M=j,A=requestAnimationFrame(I)}return n(),()=>{var j;S.forEach(q=>{l&&q.removeEventListener("scroll",n),d&&q.removeEventListener("resize",n)}),R==null||R(),(j=E)==null||j.disconnect(),E=null,b&&cancelAnimationFrame(A)}}const offset$1=offset$2,shift$2=shift$3,flip$1=flip$2,size$1=size$2,hide$1=hide$2,arrow$3=arrow$4,limitShift$1=limitShift$2,computePosition=(e,t,n)=>{const o=new Map,l={platform,...n},d={...l.platform,_c:o};return computePosition$1(e,t,{...l,platform:d})};var isClient=typeof document<"u",noop$3=function(){},index=isClient?React.useLayoutEffect:noop$3;function deepEqual$3(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,o,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!deepEqual$3(e[o],t[o]))return!1;return!0}if(l=Object.keys(e),n=l.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,l[o]))return!1;for(o=n;o--!==0;){const d=l[o];if(!(d==="_owner"&&e.$$typeof)&&!deepEqual$3(e[d],t[d]))return!1}return!0}return e!==e&&t!==t}function getDPR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(e,t){const n=getDPR(e);return Math.round(t*n)/n}function useLatestRef(e){const t=React__namespace.useRef(e);return index(()=>{t.current=e}),t}function useFloating(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:l,elements:{reference:d,floating:f}={},transform:g=!0,whileElementsMounted:b,open:_}=e,[S,R]=React__namespace.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[C,E]=React__namespace.useState(o);deepEqual$3(C,o)||E(o);const[A,M]=React__namespace.useState(null),[I,j]=React__namespace.useState(null),q=React__namespace.useCallback(Ve=>{Ve!==V.current&&(V.current=Ve,M(Ve))},[]),Q=React__namespace.useCallback(Ve=>{Ve!==ne.current&&(ne.current=Ve,j(Ve))},[]),te=d||A,F=f||I,V=React__namespace.useRef(null),ne=React__namespace.useRef(null),ae=React__namespace.useRef(S),se=b!=null,$e=useLatestRef(b),Ne=useLatestRef(l),oe=useLatestRef(_),Oe=React__namespace.useCallback(()=>{if(!V.current||!ne.current)return;const Ve={placement:t,strategy:n,middleware:C};Ne.current&&(Ve.platform=Ne.current),computePosition(V.current,ne.current,Ve).then(Le=>{const Ue={...Le,isPositioned:oe.current!==!1};Ae.current&&!deepEqual$3(ae.current,Ue)&&(ae.current=Ue,ReactDOM__namespace.flushSync(()=>{R(Ue)}))})},[C,t,n,Ne,oe]);index(()=>{_===!1&&ae.current.isPositioned&&(ae.current.isPositioned=!1,R(Ve=>({...Ve,isPositioned:!1})))},[_]);const Ae=React__namespace.useRef(!1);index(()=>(Ae.current=!0,()=>{Ae.current=!1}),[]),index(()=>{if(te&&(V.current=te),F&&(ne.current=F),te&&F){if($e.current)return $e.current(te,F,Oe);Oe()}},[te,F,Oe,$e,se]);const je=React__namespace.useMemo(()=>({reference:V,floating:ne,setReference:q,setFloating:Q}),[q,Q]),Be=React__namespace.useMemo(()=>({reference:te,floating:F}),[te,F]),qe=React__namespace.useMemo(()=>{const Ve={position:n,left:0,top:0};if(!Be.floating)return Ve;const Le=roundByDPR(Be.floating,S.x),Ue=roundByDPR(Be.floating,S.y);return g?{...Ve,transform:"translate("+Le+"px, "+Ue+"px)",...getDPR(Be.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Le,top:Ue}},[n,g,Be.floating,S.x,S.y]);return React__namespace.useMemo(()=>({...S,update:Oe,refs:je,elements:Be,floatingStyles:qe}),[S,Oe,je,Be,qe])}const arrow$1=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:l}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?arrow$3({element:o.current,padding:l}).fn(n):{}:o?arrow$3({element:o,padding:l}).fn(n):{}}}},offset=(e,t)=>({...offset$1(e),options:[e,t]}),shift$1=(e,t)=>({...shift$2(e),options:[e,t]}),limitShift=(e,t)=>({...limitShift$1(e),options:[e,t]}),flip=(e,t)=>({...flip$1(e),options:[e,t]}),size=(e,t)=>({...size$1(e),options:[e,t]}),hide=(e,t)=>({...hide$1(e),options:[e,t]}),arrow$2=(e,t)=>({...arrow$1(e),options:[e,t]});var NAME$3="Arrow",Arrow$1=React__namespace.forwardRef((e,t)=>{const{children:n,width:o=10,height:l=5,...d}=e;return jsxRuntime.jsx(Primitive$4.svg,{...d,ref:t,width:o,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:jsxRuntime.jsx("polygon",{points:"0,0 30,0 15,10"})})});Arrow$1.displayName=NAME$3;var Root$9=Arrow$1,POPPER_NAME="Popper",[createPopperContext,createPopperScope]=createContextScope$2(POPPER_NAME),[PopperProvider,usePopperContext]=createPopperContext(POPPER_NAME),Popper=e=>{const{__scopePopper:t,children:n}=e,[o,l]=React__namespace.useState(null);return jsxRuntime.jsx(PopperProvider,{scope:t,anchor:o,onAnchorChange:l,children:n})};Popper.displayName=POPPER_NAME;var ANCHOR_NAME$2="PopperAnchor",PopperAnchor=React__namespace.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...l}=e,d=usePopperContext(ANCHOR_NAME$2,n),f=React__namespace.useRef(null),g=useComposedRefs(t,f),b=React__namespace.useRef(null);return React__namespace.useEffect(()=>{const _=b.current;b.current=(o==null?void 0:o.current)||f.current,_!==b.current&&d.onAnchorChange(b.current)}),o?null:jsxRuntime.jsx(Primitive$4.div,{...l,ref:g})});PopperAnchor.displayName=ANCHOR_NAME$2;var CONTENT_NAME$9="PopperContent",[PopperContentProvider,useContentContext]=createPopperContext(CONTENT_NAME$9),PopperContent=React__namespace.forwardRef((e,t)=>{var et,at,tt,ot,lt,Ge;const{__scopePopper:n,side:o="bottom",sideOffset:l=0,align:d="center",alignOffset:f=0,arrowPadding:g=0,avoidCollisions:b=!0,collisionBoundary:_=[],collisionPadding:S=0,sticky:R="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:A,...M}=e,I=usePopperContext(CONTENT_NAME$9,n),[j,q]=React__namespace.useState(null),Q=useComposedRefs(t,$t=>q($t)),[te,F]=React__namespace.useState(null),V=useSize(te),ne=(V==null?void 0:V.width)??0,ae=(V==null?void 0:V.height)??0,se=o+(d!=="center"?"-"+d:""),$e=typeof S=="number"?S:{top:0,right:0,bottom:0,left:0,...S},Ne=Array.isArray(_)?_:[_],oe=Ne.length>0,Oe={padding:$e,boundary:Ne.filter(isNotNull),altBoundary:oe},{refs:Ae,floatingStyles:je,placement:Be,isPositioned:qe,middlewareData:Ve}=useFloating({strategy:"fixed",placement:se,whileElementsMounted:(...$t)=>autoUpdate(...$t,{animationFrame:E==="always"}),elements:{reference:I.anchor},middleware:[offset({mainAxis:l+ae,alignmentAxis:f}),b&&shift$1({mainAxis:!0,crossAxis:!1,limiter:R==="partial"?limitShift():void 0,...Oe}),b&&flip({...Oe}),size({...Oe,apply:({elements:$t,rects:nt,availableWidth:Rt,availableHeight:dt})=>{const{width:It,height:Mt}=nt.reference,Ct=$t.floating.style;Ct.setProperty("--radix-popper-available-width",`${Rt}px`),Ct.setProperty("--radix-popper-available-height",`${dt}px`),Ct.setProperty("--radix-popper-anchor-width",`${It}px`),Ct.setProperty("--radix-popper-anchor-height",`${Mt}px`)}}),te&&arrow$2({element:te,padding:g}),transformOrigin({arrowWidth:ne,arrowHeight:ae}),C&&hide({strategy:"referenceHidden",...Oe})]}),[Le,Ue]=getSideAndAlignFromPlacement(Be),We=useCallbackRef$1(A);useLayoutEffect2(()=>{qe&&(We==null||We())},[qe,We]);const ze=(et=Ve.arrow)==null?void 0:et.x,Qe=(at=Ve.arrow)==null?void 0:at.y,rt=((tt=Ve.arrow)==null?void 0:tt.centerOffset)!==0,[Je,st]=React__namespace.useState();return useLayoutEffect2(()=>{j&&st(window.getComputedStyle(j).zIndex)},[j]),jsxRuntime.jsx("div",{ref:Ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...je,transform:qe?je.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Je,"--radix-popper-transform-origin":[(ot=Ve.transformOrigin)==null?void 0:ot.x,(lt=Ve.transformOrigin)==null?void 0:lt.y].join(" "),...((Ge=Ve.hide)==null?void 0:Ge.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:jsxRuntime.jsx(PopperContentProvider,{scope:n,placedSide:Le,onArrowChange:F,arrowX:ze,arrowY:Qe,shouldHideArrow:rt,children:jsxRuntime.jsx(Primitive$4.div,{"data-side":Le,"data-align":Ue,...M,ref:Q,style:{...M.style,animation:qe?void 0:"none"}})})})});PopperContent.displayName=CONTENT_NAME$9;var ARROW_NAME$5="PopperArrow",OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},PopperArrow=React__namespace.forwardRef(function(t,n){const{__scopePopper:o,...l}=t,d=useContentContext(ARROW_NAME$5,o),f=OPPOSITE_SIDE[d.placedSide];return jsxRuntime.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:jsxRuntime.jsx(Root$9,{...l,ref:n,style:{...l.style,display:"block"}})})});PopperArrow.displayName=ARROW_NAME$5;function isNotNull(e){return e!==null}var transformOrigin=e=>({name:"transformOrigin",options:e,fn(t){var I,j,q;const{placement:n,rects:o,middlewareData:l}=t,f=((I=l.arrow)==null?void 0:I.centerOffset)!==0,g=f?0:e.arrowWidth,b=f?0:e.arrowHeight,[_,S]=getSideAndAlignFromPlacement(n),R={start:"0%",center:"50%",end:"100%"}[S],C=(((j=l.arrow)==null?void 0:j.x)??0)+g/2,E=(((q=l.arrow)==null?void 0:q.y)??0)+b/2;let A="",M="";return _==="bottom"?(A=f?R:`${C}px`,M=`${-b}px`):_==="top"?(A=f?R:`${C}px`,M=`${o.floating.height+b}px`):_==="right"?(A=`${-b}px`,M=f?R:`${E}px`):_==="left"&&(A=`${o.floating.width+b}px`,M=f?R:`${E}px`),{data:{x:A,y:M}}}});function getSideAndAlignFromPlacement(e){const[t,n="center"]=e.split("-");return[t,n]}var Root2$7=Popper,Anchor=PopperAnchor,Content$2=PopperContent,Arrow=PopperArrow;function createSlot$3(e){const t=createSlotClone$3(e),n=React__namespace.forwardRef((o,l)=>{const{children:d,...f}=o,g=React__namespace.Children.toArray(d),b=g.find(isSlottable$3);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}function createSlotClone$3(e){const t=React__namespace.forwardRef((n,o)=>{const{children:l,...d}=n;if(React__namespace.isValidElement(l)){const f=getElementRef$3(l),g=mergeProps$3(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER$5=Symbol("radix.slottable");function isSlottable$3(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER$5}function mergeProps$3(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$3(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var SELECTION_KEYS$1=["Enter"," "],FIRST_KEYS=["ArrowDown","PageUp","Home"],LAST_KEYS=["ArrowUp","PageDown","End"],FIRST_LAST_KEYS=[...FIRST_KEYS,...LAST_KEYS],SUB_OPEN_KEYS={ltr:[...SELECTION_KEYS$1,"ArrowRight"],rtl:[...SELECTION_KEYS$1,"ArrowLeft"]},SUB_CLOSE_KEYS={ltr:["ArrowLeft"],rtl:["ArrowRight"]},MENU_NAME="Menu",[Collection$3,useCollection$3,createCollectionScope$3]=createCollection(MENU_NAME),[createMenuContext,createMenuScope]=createContextScope$2(MENU_NAME,[createCollectionScope$3,createPopperScope,createRovingFocusGroupScope]),usePopperScope$3=createPopperScope(),useRovingFocusGroupScope$1=createRovingFocusGroupScope(),[MenuProvider,useMenuContext]=createMenuContext(MENU_NAME),[MenuRootProvider,useMenuRootContext]=createMenuContext(MENU_NAME),Menu=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:l,onOpenChange:d,modal:f=!0}=e,g=usePopperScope$3(t),[b,_]=React__namespace.useState(null),S=React__namespace.useRef(!1),R=useCallbackRef$1(d),C=useDirection(l);return React__namespace.useEffect(()=>{const E=()=>{S.current=!0,document.addEventListener("pointerdown",A,{capture:!0,once:!0}),document.addEventListener("pointermove",A,{capture:!0,once:!0})},A=()=>S.current=!1;return document.addEventListener("keydown",E,{capture:!0}),()=>{document.removeEventListener("keydown",E,{capture:!0}),document.removeEventListener("pointerdown",A,{capture:!0}),document.removeEventListener("pointermove",A,{capture:!0})}},[]),jsxRuntime.jsx(Root2$7,{...g,children:jsxRuntime.jsx(MenuProvider,{scope:t,open:n,onOpenChange:R,content:b,onContentChange:_,children:jsxRuntime.jsx(MenuRootProvider,{scope:t,onClose:React__namespace.useCallback(()=>R(!1),[R]),isUsingKeyboardRef:S,dir:C,modal:f,children:o})})})};Menu.displayName=MENU_NAME;var ANCHOR_NAME$1="MenuAnchor",MenuAnchor=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,l=usePopperScope$3(n);return jsxRuntime.jsx(Anchor,{...l,...o,ref:t})});MenuAnchor.displayName=ANCHOR_NAME$1;var PORTAL_NAME$5="MenuPortal",[PortalProvider$2,usePortalContext$2]=createMenuContext(PORTAL_NAME$5,{forceMount:void 0}),MenuPortal=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:l}=e,d=useMenuContext(PORTAL_NAME$5,t);return jsxRuntime.jsx(PortalProvider$2,{scope:t,forceMount:n,children:jsxRuntime.jsx(Presence,{present:n||d.open,children:jsxRuntime.jsx(Portal$5,{asChild:!0,container:l,children:o})})})};MenuPortal.displayName=PORTAL_NAME$5;var CONTENT_NAME$8="MenuContent",[MenuContentProvider,useMenuContentContext]=createMenuContext(CONTENT_NAME$8),MenuContent=React__namespace.forwardRef((e,t)=>{const n=usePortalContext$2(CONTENT_NAME$8,e.__scopeMenu),{forceMount:o=n.forceMount,...l}=e,d=useMenuContext(CONTENT_NAME$8,e.__scopeMenu),f=useMenuRootContext(CONTENT_NAME$8,e.__scopeMenu);return jsxRuntime.jsx(Collection$3.Provider,{scope:e.__scopeMenu,children:jsxRuntime.jsx(Presence,{present:o||d.open,children:jsxRuntime.jsx(Collection$3.Slot,{scope:e.__scopeMenu,children:f.modal?jsxRuntime.jsx(MenuRootContentModal,{...l,ref:t}):jsxRuntime.jsx(MenuRootContentNonModal,{...l,ref:t})})})})}),MenuRootContentModal=React__namespace.forwardRef((e,t)=>{const n=useMenuContext(CONTENT_NAME$8,e.__scopeMenu),o=React__namespace.useRef(null),l=useComposedRefs(t,o);return React__namespace.useEffect(()=>{const d=o.current;if(d)return hideOthers(d)},[]),jsxRuntime.jsx(MenuContentImpl,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:composeEventHandlers(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),MenuRootContentNonModal=React__namespace.forwardRef((e,t)=>{const n=useMenuContext(CONTENT_NAME$8,e.__scopeMenu);return jsxRuntime.jsx(MenuContentImpl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Slot$3=createSlot$3("MenuContent.ScrollLock"),MenuContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:l,onOpenAutoFocus:d,onCloseAutoFocus:f,disableOutsidePointerEvents:g,onEntryFocus:b,onEscapeKeyDown:_,onPointerDownOutside:S,onFocusOutside:R,onInteractOutside:C,onDismiss:E,disableOutsideScroll:A,...M}=e,I=useMenuContext(CONTENT_NAME$8,n),j=useMenuRootContext(CONTENT_NAME$8,n),q=usePopperScope$3(n),Q=useRovingFocusGroupScope$1(n),te=useCollection$3(n),[F,V]=React__namespace.useState(null),ne=React__namespace.useRef(null),ae=useComposedRefs(t,ne,I.onContentChange),se=React__namespace.useRef(0),$e=React__namespace.useRef(""),Ne=React__namespace.useRef(0),oe=React__namespace.useRef(null),Oe=React__namespace.useRef("right"),Ae=React__namespace.useRef(0),je=A?ReactRemoveScroll:React__namespace.Fragment,Be=A?{as:Slot$3,allowPinchZoom:!0}:void 0,qe=Le=>{var et,at;const Ue=$e.current+Le,We=te().filter(tt=>!tt.disabled),ze=document.activeElement,Qe=(et=We.find(tt=>tt.ref.current===ze))==null?void 0:et.textValue,rt=We.map(tt=>tt.textValue),Je=getNextMatch(rt,Ue,Qe),st=(at=We.find(tt=>tt.textValue===Je))==null?void 0:at.ref.current;(function tt(ot){$e.current=ot,window.clearTimeout(se.current),ot!==""&&(se.current=window.setTimeout(()=>tt(""),1e3))})(Ue),st&&setTimeout(()=>st.focus())};React__namespace.useEffect(()=>()=>window.clearTimeout(se.current),[]),useFocusGuards();const Ve=React__namespace.useCallback(Le=>{var We,ze;return Oe.current===((We=oe.current)==null?void 0:We.side)&&isPointerInGraceArea(Le,(ze=oe.current)==null?void 0:ze.area)},[]);return jsxRuntime.jsx(MenuContentProvider,{scope:n,searchRef:$e,onItemEnter:React__namespace.useCallback(Le=>{Ve(Le)&&Le.preventDefault()},[Ve]),onItemLeave:React__namespace.useCallback(Le=>{var Ue;Ve(Le)||((Ue=ne.current)==null||Ue.focus(),V(null))},[Ve]),onTriggerLeave:React__namespace.useCallback(Le=>{Ve(Le)&&Le.preventDefault()},[Ve]),pointerGraceTimerRef:Ne,onPointerGraceIntentChange:React__namespace.useCallback(Le=>{oe.current=Le},[]),children:jsxRuntime.jsx(je,{...Be,children:jsxRuntime.jsx(FocusScope,{asChild:!0,trapped:l,onMountAutoFocus:composeEventHandlers(d,Le=>{var Ue;Le.preventDefault(),(Ue=ne.current)==null||Ue.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:jsxRuntime.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:_,onPointerDownOutside:S,onFocusOutside:R,onInteractOutside:C,onDismiss:E,children:jsxRuntime.jsx(Root$c,{asChild:!0,...Q,dir:j.dir,orientation:"vertical",loop:o,currentTabStopId:F,onCurrentTabStopIdChange:V,onEntryFocus:composeEventHandlers(b,Le=>{j.isUsingKeyboardRef.current||Le.preventDefault()}),preventScrollOnEntryFocus:!0,children:jsxRuntime.jsx(Content$2,{role:"menu","aria-orientation":"vertical","data-state":getOpenState(I.open),"data-radix-menu-content":"",dir:j.dir,...q,...M,ref:ae,style:{outline:"none",...M.style},onKeyDown:composeEventHandlers(M.onKeyDown,Le=>{const We=Le.target.closest("[data-radix-menu-content]")===Le.currentTarget,ze=Le.ctrlKey||Le.altKey||Le.metaKey,Qe=Le.key.length===1;We&&(Le.key==="Tab"&&Le.preventDefault(),!ze&&Qe&&qe(Le.key));const rt=ne.current;if(Le.target!==rt||!FIRST_LAST_KEYS.includes(Le.key))return;Le.preventDefault();const st=te().filter(et=>!et.disabled).map(et=>et.ref.current);LAST_KEYS.includes(Le.key)&&st.reverse(),focusFirst$1(st)}),onBlur:composeEventHandlers(e.onBlur,Le=>{Le.currentTarget.contains(Le.target)||(window.clearTimeout(se.current),$e.current="")}),onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(Le=>{const Ue=Le.target,We=Ae.current!==Le.clientX;if(Le.currentTarget.contains(Ue)&&We){const ze=Le.clientX>Ae.current?"right":"left";Oe.current=ze,Ae.current=Le.clientX}}))})})})})})})});MenuContent.displayName=CONTENT_NAME$8;var GROUP_NAME$2="MenuGroup",MenuGroup=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{role:"group",...o,ref:t})});MenuGroup.displayName=GROUP_NAME$2;var LABEL_NAME$2="MenuLabel",MenuLabel=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{...o,ref:t})});MenuLabel.displayName=LABEL_NAME$2;var ITEM_NAME$3="MenuItem",ITEM_SELECT="menu.itemSelect",MenuItem=React__namespace.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...l}=e,d=React__namespace.useRef(null),f=useMenuRootContext(ITEM_NAME$3,e.__scopeMenu),g=useMenuContentContext(ITEM_NAME$3,e.__scopeMenu),b=useComposedRefs(t,d),_=React__namespace.useRef(!1),S=()=>{const R=d.current;if(!n&&R){const C=new CustomEvent(ITEM_SELECT,{bubbles:!0,cancelable:!0});R.addEventListener(ITEM_SELECT,E=>o==null?void 0:o(E),{once:!0}),dispatchDiscreteCustomEvent(R,C),C.defaultPrevented?_.current=!1:f.onClose()}};return jsxRuntime.jsx(MenuItemImpl,{...l,ref:b,disabled:n,onClick:composeEventHandlers(e.onClick,S),onPointerDown:R=>{var C;(C=e.onPointerDown)==null||C.call(e,R),_.current=!0},onPointerUp:composeEventHandlers(e.onPointerUp,R=>{var C;_.current||(C=R.currentTarget)==null||C.click()}),onKeyDown:composeEventHandlers(e.onKeyDown,R=>{const C=g.searchRef.current!=="";n||C&&R.key===" "||SELECTION_KEYS$1.includes(R.key)&&(R.currentTarget.click(),R.preventDefault())})})});MenuItem.displayName=ITEM_NAME$3;var MenuItemImpl=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:l,...d}=e,f=useMenuContentContext(ITEM_NAME$3,n),g=useRovingFocusGroupScope$1(n),b=React__namespace.useRef(null),_=useComposedRefs(t,b),[S,R]=React__namespace.useState(!1),[C,E]=React__namespace.useState("");return React__namespace.useEffect(()=>{const A=b.current;A&&E((A.textContent??"").trim())},[d.children]),jsxRuntime.jsx(Collection$3.ItemSlot,{scope:n,disabled:o,textValue:l??C,children:jsxRuntime.jsx(Item$3,{asChild:!0,...g,focusable:!o,children:jsxRuntime.jsx(Primitive$4.div,{role:"menuitem","data-highlighted":S?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...d,ref:_,onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(A=>{o?f.onItemLeave(A):(f.onItemEnter(A),A.defaultPrevented||A.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:composeEventHandlers(e.onPointerLeave,whenMouse(A=>f.onItemLeave(A))),onFocus:composeEventHandlers(e.onFocus,()=>R(!0)),onBlur:composeEventHandlers(e.onBlur,()=>R(!1))})})})}),CHECKBOX_ITEM_NAME$1="MenuCheckboxItem",MenuCheckboxItem=React__namespace.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...l}=e;return jsxRuntime.jsx(ItemIndicatorProvider,{scope:e.__scopeMenu,checked:n,children:jsxRuntime.jsx(MenuItem,{role:"menuitemcheckbox","aria-checked":isIndeterminate$1(n)?"mixed":n,...l,ref:t,"data-state":getCheckedState(n),onSelect:composeEventHandlers(l.onSelect,()=>o==null?void 0:o(isIndeterminate$1(n)?!0:!n),{checkForDefaultPrevented:!1})})})});MenuCheckboxItem.displayName=CHECKBOX_ITEM_NAME$1;var RADIO_GROUP_NAME$1="MenuRadioGroup",[RadioGroupProvider,useRadioGroupContext]=createMenuContext(RADIO_GROUP_NAME$1,{value:void 0,onValueChange:()=>{}}),MenuRadioGroup=React__namespace.forwardRef((e,t)=>{const{value:n,onValueChange:o,...l}=e,d=useCallbackRef$1(o);return jsxRuntime.jsx(RadioGroupProvider,{scope:e.__scopeMenu,value:n,onValueChange:d,children:jsxRuntime.jsx(MenuGroup,{...l,ref:t})})});MenuRadioGroup.displayName=RADIO_GROUP_NAME$1;var RADIO_ITEM_NAME$1="MenuRadioItem",MenuRadioItem=React__namespace.forwardRef((e,t)=>{const{value:n,...o}=e,l=useRadioGroupContext(RADIO_ITEM_NAME$1,e.__scopeMenu),d=n===l.value;return jsxRuntime.jsx(ItemIndicatorProvider,{scope:e.__scopeMenu,checked:d,children:jsxRuntime.jsx(MenuItem,{role:"menuitemradio","aria-checked":d,...o,ref:t,"data-state":getCheckedState(d),onSelect:composeEventHandlers(o.onSelect,()=>{var f;return(f=l.onValueChange)==null?void 0:f.call(l,n)},{checkForDefaultPrevented:!1})})})});MenuRadioItem.displayName=RADIO_ITEM_NAME$1;var ITEM_INDICATOR_NAME$1="MenuItemIndicator",[ItemIndicatorProvider,useItemIndicatorContext]=createMenuContext(ITEM_INDICATOR_NAME$1,{checked:!1}),MenuItemIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...l}=e,d=useItemIndicatorContext(ITEM_INDICATOR_NAME$1,n);return jsxRuntime.jsx(Presence,{present:o||isIndeterminate$1(d.checked)||d.checked===!0,children:jsxRuntime.jsx(Primitive$4.span,{...l,ref:t,"data-state":getCheckedState(d.checked)})})});MenuItemIndicator.displayName=ITEM_INDICATOR_NAME$1;var SEPARATOR_NAME$2="MenuSeparator",MenuSeparator=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});MenuSeparator.displayName=SEPARATOR_NAME$2;var ARROW_NAME$4="MenuArrow",MenuArrow=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,l=usePopperScope$3(n);return jsxRuntime.jsx(Arrow,{...l,...o,ref:t})});MenuArrow.displayName=ARROW_NAME$4;var SUB_NAME="MenuSub",[MenuSubProvider,useMenuSubContext]=createMenuContext(SUB_NAME),MenuSub=e=>{const{__scopeMenu:t,children:n,open:o=!1,onOpenChange:l}=e,d=useMenuContext(SUB_NAME,t),f=usePopperScope$3(t),[g,b]=React__namespace.useState(null),[_,S]=React__namespace.useState(null),R=useCallbackRef$1(l);return React__namespace.useEffect(()=>(d.open===!1&&R(!1),()=>R(!1)),[d.open,R]),jsxRuntime.jsx(Root2$7,{...f,children:jsxRuntime.jsx(MenuProvider,{scope:t,open:o,onOpenChange:R,content:_,onContentChange:S,children:jsxRuntime.jsx(MenuSubProvider,{scope:t,contentId:useId(),triggerId:useId(),trigger:g,onTriggerChange:b,children:n})})})};MenuSub.displayName=SUB_NAME;var SUB_TRIGGER_NAME$1="MenuSubTrigger",MenuSubTrigger=React__namespace.forwardRef((e,t)=>{const n=useMenuContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),o=useMenuRootContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),l=useMenuSubContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),d=useMenuContentContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),f=React__namespace.useRef(null),{pointerGraceTimerRef:g,onPointerGraceIntentChange:b}=d,_={__scopeMenu:e.__scopeMenu},S=React__namespace.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null},[]);return React__namespace.useEffect(()=>S,[S]),React__namespace.useEffect(()=>{const R=g.current;return()=>{window.clearTimeout(R),b(null)}},[g,b]),jsxRuntime.jsx(MenuAnchor,{asChild:!0,..._,children:jsxRuntime.jsx(MenuItemImpl,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":l.contentId,"data-state":getOpenState(n.open),...e,ref:composeRefs(t,l.onTriggerChange),onClick:R=>{var C;(C=e.onClick)==null||C.call(e,R),!(e.disabled||R.defaultPrevented)&&(R.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(R=>{d.onItemEnter(R),!R.defaultPrevented&&!e.disabled&&!n.open&&!f.current&&(d.onPointerGraceIntentChange(null),f.current=window.setTimeout(()=>{n.onOpenChange(!0),S()},100))})),onPointerLeave:composeEventHandlers(e.onPointerLeave,whenMouse(R=>{var E,A;S();const C=(E=n.content)==null?void 0:E.getBoundingClientRect();if(C){const M=(A=n.content)==null?void 0:A.dataset.side,I=M==="right",j=I?-5:5,q=C[I?"left":"right"],Q=C[I?"right":"left"];d.onPointerGraceIntentChange({area:[{x:R.clientX+j,y:R.clientY},{x:q,y:C.top},{x:Q,y:C.top},{x:Q,y:C.bottom},{x:q,y:C.bottom}],side:M}),window.clearTimeout(g.current),g.current=window.setTimeout(()=>d.onPointerGraceIntentChange(null),300)}else{if(d.onTriggerLeave(R),R.defaultPrevented)return;d.onPointerGraceIntentChange(null)}})),onKeyDown:composeEventHandlers(e.onKeyDown,R=>{var E;const C=d.searchRef.current!=="";e.disabled||C&&R.key===" "||SUB_OPEN_KEYS[o.dir].includes(R.key)&&(n.onOpenChange(!0),(E=n.content)==null||E.focus(),R.preventDefault())})})})});MenuSubTrigger.displayName=SUB_TRIGGER_NAME$1;var SUB_CONTENT_NAME$1="MenuSubContent",MenuSubContent=React__namespace.forwardRef((e,t)=>{const n=usePortalContext$2(CONTENT_NAME$8,e.__scopeMenu),{forceMount:o=n.forceMount,...l}=e,d=useMenuContext(CONTENT_NAME$8,e.__scopeMenu),f=useMenuRootContext(CONTENT_NAME$8,e.__scopeMenu),g=useMenuSubContext(SUB_CONTENT_NAME$1,e.__scopeMenu),b=React__namespace.useRef(null),_=useComposedRefs(t,b);return jsxRuntime.jsx(Collection$3.Provider,{scope:e.__scopeMenu,children:jsxRuntime.jsx(Presence,{present:o||d.open,children:jsxRuntime.jsx(Collection$3.Slot,{scope:e.__scopeMenu,children:jsxRuntime.jsx(MenuContentImpl,{id:g.contentId,"aria-labelledby":g.triggerId,...l,ref:_,align:"start",side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:S=>{var R;f.isUsingKeyboardRef.current&&((R=b.current)==null||R.focus()),S.preventDefault()},onCloseAutoFocus:S=>S.preventDefault(),onFocusOutside:composeEventHandlers(e.onFocusOutside,S=>{S.target!==g.trigger&&d.onOpenChange(!1)}),onEscapeKeyDown:composeEventHandlers(e.onEscapeKeyDown,S=>{f.onClose(),S.preventDefault()}),onKeyDown:composeEventHandlers(e.onKeyDown,S=>{var E;const R=S.currentTarget.contains(S.target),C=SUB_CLOSE_KEYS[f.dir].includes(S.key);R&&C&&(d.onOpenChange(!1),(E=g.trigger)==null||E.focus(),S.preventDefault())})})})})})});MenuSubContent.displayName=SUB_CONTENT_NAME$1;function getOpenState(e){return e?"open":"closed"}function isIndeterminate$1(e){return e==="indeterminate"}function getCheckedState(e){return isIndeterminate$1(e)?"indeterminate":e?"checked":"unchecked"}function focusFirst$1(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function wrapArray$1(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function getNextMatch(e,t,n){const l=t.length>1&&Array.from(t).every(_=>_===t[0])?t[0]:t,d=n?e.indexOf(n):-1;let f=wrapArray$1(e,Math.max(d,0));l.length===1&&(f=f.filter(_=>_!==n));const b=f.find(_=>_.toLowerCase().startsWith(l.toLowerCase()));return b!==n?b:void 0}function isPointInPolygon$1(e,t){const{x:n,y:o}=e;let l=!1;for(let d=0,f=t.length-1;d<t.length;f=d++){const g=t[d],b=t[f],_=g.x,S=g.y,R=b.x,C=b.y;S>o!=C>o&&n<(R-_)*(o-S)/(C-S)+_&&(l=!l)}return l}function isPointerInGraceArea(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return isPointInPolygon$1(n,t)}function whenMouse(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Root3$1=Menu,Anchor2$1=MenuAnchor,Portal$3=MenuPortal,Content2$6=MenuContent,Group$1=MenuGroup,Label$4=MenuLabel,Item2$1=MenuItem,CheckboxItem=MenuCheckboxItem,RadioGroup=MenuRadioGroup,RadioItem=MenuRadioItem,ItemIndicator$1=MenuItemIndicator,Separator$3=MenuSeparator,Arrow2=MenuArrow,Sub=MenuSub,SubTrigger=MenuSubTrigger,SubContent=MenuSubContent,DROPDOWN_MENU_NAME="DropdownMenu",[createDropdownMenuContext]=createContextScope$2(DROPDOWN_MENU_NAME,[createMenuScope]),useMenuScope=createMenuScope(),[DropdownMenuProvider,useDropdownMenuContext]=createDropdownMenuContext(DROPDOWN_MENU_NAME),DropdownMenu$1=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:l,defaultOpen:d,onOpenChange:f,modal:g=!0}=e,b=useMenuScope(t),_=React__namespace.useRef(null),[S,R]=useControllableState({prop:l,defaultProp:d??!1,onChange:f,caller:DROPDOWN_MENU_NAME});return jsxRuntime.jsx(DropdownMenuProvider,{scope:t,triggerId:useId(),triggerRef:_,contentId:useId(),open:S,onOpenChange:R,onOpenToggle:React__namespace.useCallback(()=>R(C=>!C),[R]),modal:g,children:jsxRuntime.jsx(Root3$1,{...b,open:S,onOpenChange:R,dir:o,modal:g,children:n})})};DropdownMenu$1.displayName=DROPDOWN_MENU_NAME;var TRIGGER_NAME$8="DropdownMenuTrigger",DropdownMenuTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...l}=e,d=useDropdownMenuContext(TRIGGER_NAME$8,n),f=useMenuScope(n);return jsxRuntime.jsx(Anchor2$1,{asChild:!0,...f,children:jsxRuntime.jsx(Primitive$4.button,{type:"button",id:d.triggerId,"aria-haspopup":"menu","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":d.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...l,ref:composeRefs(t,d.triggerRef),onPointerDown:composeEventHandlers(e.onPointerDown,g=>{!o&&g.button===0&&g.ctrlKey===!1&&(d.onOpenToggle(),d.open||g.preventDefault())}),onKeyDown:composeEventHandlers(e.onKeyDown,g=>{o||(["Enter"," "].includes(g.key)&&d.onOpenToggle(),g.key==="ArrowDown"&&d.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})});DropdownMenuTrigger$1.displayName=TRIGGER_NAME$8;var PORTAL_NAME$4="DropdownMenuPortal",DropdownMenuPortal$1=e=>{const{__scopeDropdownMenu:t,...n}=e,o=useMenuScope(t);return jsxRuntime.jsx(Portal$3,{...o,...n})};DropdownMenuPortal$1.displayName=PORTAL_NAME$4;var CONTENT_NAME$7="DropdownMenuContent",DropdownMenuContent$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useDropdownMenuContext(CONTENT_NAME$7,n),d=useMenuScope(n),f=React__namespace.useRef(!1);return jsxRuntime.jsx(Content2$6,{id:l.contentId,"aria-labelledby":l.triggerId,...d,...o,ref:t,onCloseAutoFocus:composeEventHandlers(e.onCloseAutoFocus,g=>{var b;f.current||(b=l.triggerRef.current)==null||b.focus(),f.current=!1,g.preventDefault()}),onInteractOutside:composeEventHandlers(e.onInteractOutside,g=>{const b=g.detail.originalEvent,_=b.button===0&&b.ctrlKey===!0,S=b.button===2||_;(!l.modal||S)&&(f.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)"}})});DropdownMenuContent$1.displayName=CONTENT_NAME$7;var GROUP_NAME$1="DropdownMenuGroup",DropdownMenuGroup$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Group$1,{...l,...o,ref:t})});DropdownMenuGroup$1.displayName=GROUP_NAME$1;var LABEL_NAME$1="DropdownMenuLabel",DropdownMenuLabel$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Label$4,{...l,...o,ref:t})});DropdownMenuLabel$1.displayName=LABEL_NAME$1;var ITEM_NAME$2="DropdownMenuItem",DropdownMenuItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Item2$1,{...l,...o,ref:t})});DropdownMenuItem$1.displayName=ITEM_NAME$2;var CHECKBOX_ITEM_NAME="DropdownMenuCheckboxItem",DropdownMenuCheckboxItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(CheckboxItem,{...l,...o,ref:t})});DropdownMenuCheckboxItem$1.displayName=CHECKBOX_ITEM_NAME;var RADIO_GROUP_NAME="DropdownMenuRadioGroup",DropdownMenuRadioGroup$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(RadioGroup,{...l,...o,ref:t})});DropdownMenuRadioGroup$1.displayName=RADIO_GROUP_NAME;var RADIO_ITEM_NAME="DropdownMenuRadioItem",DropdownMenuRadioItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(RadioItem,{...l,...o,ref:t})});DropdownMenuRadioItem$1.displayName=RADIO_ITEM_NAME;var INDICATOR_NAME$2="DropdownMenuItemIndicator",DropdownMenuItemIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(ItemIndicator$1,{...l,...o,ref:t})});DropdownMenuItemIndicator.displayName=INDICATOR_NAME$2;var SEPARATOR_NAME$1="DropdownMenuSeparator",DropdownMenuSeparator$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Separator$3,{...l,...o,ref:t})});DropdownMenuSeparator$1.displayName=SEPARATOR_NAME$1;var ARROW_NAME$3="DropdownMenuArrow",DropdownMenuArrow=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Arrow2,{...l,...o,ref:t})});DropdownMenuArrow.displayName=ARROW_NAME$3;var DropdownMenuSub$1=e=>{const{__scopeDropdownMenu:t,children:n,open:o,onOpenChange:l,defaultOpen:d}=e,f=useMenuScope(t),[g,b]=useControllableState({prop:o,defaultProp:d??!1,onChange:l,caller:"DropdownMenuSub"});return jsxRuntime.jsx(Sub,{...f,open:g,onOpenChange:b,children:n})},SUB_TRIGGER_NAME="DropdownMenuSubTrigger",DropdownMenuSubTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(SubTrigger,{...l,...o,ref:t})});DropdownMenuSubTrigger$1.displayName=SUB_TRIGGER_NAME;var SUB_CONTENT_NAME="DropdownMenuSubContent",DropdownMenuSubContent$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(SubContent,{...l,...o,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)"}})});DropdownMenuSubContent$1.displayName=SUB_CONTENT_NAME;var Root2$6=DropdownMenu$1,Trigger$5=DropdownMenuTrigger$1,Portal2$1=DropdownMenuPortal$1,Content2$5=DropdownMenuContent$1,Group2=DropdownMenuGroup$1,Label2=DropdownMenuLabel$1,Item2=DropdownMenuItem$1,CheckboxItem2=DropdownMenuCheckboxItem$1,RadioGroup2=DropdownMenuRadioGroup$1,RadioItem2=DropdownMenuRadioItem$1,ItemIndicator2=DropdownMenuItemIndicator,Separator2=DropdownMenuSeparator$1,Sub2=DropdownMenuSub$1,SubTrigger2=DropdownMenuSubTrigger$1,SubContent2=DropdownMenuSubContent$1;const DropdownMenu=Root2$6,DropdownMenuTrigger=Trigger$5,DropdownMenuGroup=Group2,DropdownMenuPortal=Portal2$1,DropdownMenuSub=Sub2,DropdownMenuRadioGroup=RadioGroup2,DropdownMenuSubTrigger=React__namespace.forwardRef(({className:e,inset:t,children:n,...o},l)=>jsxRuntime.jsxs(SubTrigger2,{ref:l,className:cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[n,jsxRuntime.jsx(ChevronRight,{className:"ml-auto"})]}));DropdownMenuSubTrigger.displayName=SubTrigger2.displayName;const DropdownMenuSubContent=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(SubContent2,{ref:n,className:cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));DropdownMenuSubContent.displayName=SubContent2.displayName;const DropdownMenuContent=React__namespace.forwardRef(({className:e,sideOffset:t=4,...n},o)=>jsxRuntime.jsx(Portal2$1,{children:jsxRuntime.jsx(Content2$5,{ref:o,sideOffset:t,className:cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...n})}));DropdownMenuContent.displayName=Content2$5.displayName;const DropdownMenuItem=React__namespace.forwardRef(({className:e,inset:t,...n},o)=>jsxRuntime.jsx(Item2,{ref:o,className:cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));DropdownMenuItem.displayName=Item2.displayName;const DropdownMenuCheckboxItem=React__namespace.forwardRef(({className:e,children:t,checked:n,...o},l)=>jsxRuntime.jsxs(CheckboxItem2,{ref:l,className:cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ItemIndicator2,{children:jsxRuntime.jsx(Check,{className:"h-4 w-4"})})}),t]}));DropdownMenuCheckboxItem.displayName=CheckboxItem2.displayName;const DropdownMenuRadioItem=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsxs(RadioItem2,{ref:o,className:cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ItemIndicator2,{children:jsxRuntime.jsx(Circle,{className:"h-2 w-2 fill-current"})})}),t]}));DropdownMenuRadioItem.displayName=RadioItem2.displayName;const DropdownMenuLabel=React__namespace.forwardRef(({className:e,inset:t,...n},o)=>jsxRuntime.jsx(Label2,{ref:o,className:cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));DropdownMenuLabel.displayName=Label2.displayName;const DropdownMenuSeparator=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Separator2,{ref:n,className:cn("-mx-1 my-1 h-px bg-muted",e),...t}));DropdownMenuSeparator.displayName=Separator2.displayName;const DropdownMenuShortcut=({className:e,...t})=>jsxRuntime.jsx("span",{className:cn("ml-auto text-xs tracking-widest opacity-60",e),...t});DropdownMenuShortcut.displayName="DropdownMenuShortcut";var REACT_LAZY_TYPE=Symbol.for("react.lazy"),use=React__namespace[" use ".trim().toString()];function isPromiseLike(e){return typeof e=="object"&&e!==null&&"then"in e}function isLazyComponent(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===REACT_LAZY_TYPE&&"_payload"in e&&isPromiseLike(e._payload)}function createSlot$2(e){const t=createSlotClone$2(e),n=React__namespace.forwardRef((o,l)=>{let{children:d,...f}=o;isLazyComponent(d)&&typeof use=="function"&&(d=use(d._payload));const g=React__namespace.Children.toArray(d),b=g.find(isSlottable$2);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}var Slot$2=createSlot$2("Slot");function createSlotClone$2(e){const t=React__namespace.forwardRef((n,o)=>{let{children:l,...d}=n;if(isLazyComponent(l)&&typeof use=="function"&&(l=use(l._payload)),React__namespace.isValidElement(l)){const f=getElementRef$2(l),g=mergeProps$2(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER$4=Symbol("radix.slottable");function isSlottable$2(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER$4}function mergeProps$2(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$2(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const falsyToString=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cx=clsx,cva=(e,t)=>n=>{var o;if((t==null?void 0:t.variants)==null)return cx(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:d}=t,f=Object.keys(l).map(_=>{const S=n==null?void 0:n[_],R=d==null?void 0:d[_];if(S===null)return null;const C=falsyToString(S)||falsyToString(R);return l[_][C]}),g=n&&Object.entries(n).reduce((_,S)=>{let[R,C]=S;return C===void 0||(_[R]=C),_},{}),b=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((_,S)=>{let{class:R,className:C,...E}=S;return Object.entries(E).every(A=>{let[M,I]=A;return Array.isArray(I)?I.includes({...d,...g}[M]):{...d,...g}[M]===I})?[..._,R,C]:_},[]);return cx(e,f,b,n==null?void 0:n.class,n==null?void 0:n.className)},buttonVariants=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",outline:"border border-input text-foreground bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",defaultOutline:"border border-red-600/30 text-red-600 bg-background shadow-xs hover:bg-red-600/5 ",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",blue:"bg-randmar-blue text-gray-100 shadow-sm hover:bg-randmar-blue/90",red:"bg-randmar-red text-gray-100 shadow-sm hover:bg-randmar-red/90",purple:"bg-randmar-purple text-gray-100 shadow-sm hover:bg-randmar-purple/90",none:""},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Button$1=React__namespace.forwardRef(({className:e,variant:t,size:n,asChild:o=!1,confirmationDialog:l,onClick:d,...f},g)=>{const b=o?Slot$2:"button";if(!l)return jsxRuntime.jsx(b,{className:cn(buttonVariants({variant:t,size:n,className:e})),ref:g,onClick:d,...f});d&&console.warn("Button: You provided both onClick and confirmationDialog props. The onClick prop will be ignored. Use the onConfirm callback in confirmationDialog instead.");const{title:_,content:S,onConfirm:R,confirmText:C="Confirm",cancelText:E="Cancel"}=l,A=()=>{R()};return jsxRuntime.jsxs(Dialog,{children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsx(b,{className:cn(buttonVariants({variant:t,size:n,className:e})),ref:g,...f})}),jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:_}),jsxRuntime.jsx(DialogDescription,{children:S})]}),jsxRuntime.jsxs(DialogFooter,{className:"flex justify-end gap-2 pt-4",children:[jsxRuntime.jsx(DialogClose,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"outline",children:E})}),jsxRuntime.jsx(DialogClose,{asChild:!0,children:jsxRuntime.jsx(Button$1,{onClick:A,children:C})})]})]})]})});Button$1.displayName="Button";function formatProdErrorMessage$1(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var randomString=()=>Math.random().toString(36).substring(7).split("").join("."),ActionTypes={INIT:`@@redux/INIT${randomString()}`,REPLACE:`@@redux/REPLACE${randomString()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString()}`},actionTypes_default=ActionTypes;function isPlainObject$4(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function miniKindOf(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(isDate$1(e))return"date";if(isError(e))return"error";const n=ctorName(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function ctorName(e){return typeof e.constructor=="function"?e.constructor.name:null}function isError(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function isDate$1(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function kindOf(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=miniKindOf(e)),t}function warning(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function getUnexpectedStateShapeWarningMessage(e,t,n,o){const l=Object.keys(t),d=n&&n.type===actionTypes_default.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(l.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!isPlainObject$4(e))return`The ${d} has unexpected type of "${kindOf(e)}". Expected argument to be an object with the following keys: "${l.join('", "')}"`;const f=Object.keys(e).filter(g=>!t.hasOwnProperty(g)&&!o[g]);if(f.forEach(g=>{o[g]=!0}),!(n&&n.type===actionTypes_default.REPLACE)&&f.length>0)return`Unexpected ${f.length>1?"keys":"key"} "${f.join('", "')}" found in ${d}. Expected to find one of the known reducer keys instead: "${l.join('", "')}". Unexpected keys will be ignored.`}function assertReducerShape(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:actionTypes_default.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?formatProdErrorMessage$1(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:actionTypes_default.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?formatProdErrorMessage$1(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function combineReducers(e){const t=Object.keys(e),n={};for(let f=0;f<t.length;f++){const g=t[f];process.env.NODE_ENV!=="production"&&typeof e[g]>"u"&&warning(`No reducer provided for key "${g}"`),typeof e[g]=="function"&&(n[g]=e[g])}const o=Object.keys(n);let l;process.env.NODE_ENV!=="production"&&(l={});let d;try{assertReducerShape(n)}catch(f){d=f}return function(g={},b){if(d)throw d;if(process.env.NODE_ENV!=="production"){const R=getUnexpectedStateShapeWarningMessage(g,n,b,l);R&&warning(R)}let _=!1;const S={};for(let R=0;R<o.length;R++){const C=o[R],E=n[C],A=g[C],M=E(A,b);if(typeof M>"u"){const I=b&&b.type;throw new Error(process.env.NODE_ENV==="production"?formatProdErrorMessage$1(14):`When called with an action of type ${I?`"${String(I)}"`:"(unknown type)"}, the slice reducer for key "${C}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}S[C]=M,_=_||M!==A}return _=_||o.length!==Object.keys(g).length,_?S:g}}function isAction(e){return isPlainObject$4(e)&&"type"in e&&typeof e.type=="string"}var NOTHING=Symbol.for("immer-nothing"),DRAFTABLE=Symbol.for("immer-draftable"),DRAFT_STATE=Symbol.for("immer-state"),errors=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function die(e,...t){if(process.env.NODE_ENV!=="production"){const n=errors[e],o=isFunction$6(n)?n.apply(null,t):n;throw new Error(`[Immer] ${o}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var O=Object,getPrototypeOf$1=O.getPrototypeOf,CONSTRUCTOR="constructor",PROTOTYPE="prototype",CONFIGURABLE="configurable",ENUMERABLE="enumerable",WRITABLE="writable",VALUE="value",isDraft=e=>!!e&&!!e[DRAFT_STATE];function isDraftable(e){var t;return e?isPlainObject$3(e)||isArray$3(e)||!!e[DRAFTABLE]||!!((t=e[CONSTRUCTOR])!=null&&t[DRAFTABLE])||isMap(e)||isSet(e):!1}var objectCtorString=O[PROTOTYPE][CONSTRUCTOR].toString(),cachedCtorStrings=new WeakMap;function isPlainObject$3(e){if(!e||!isObjectish(e))return!1;const t=getPrototypeOf$1(e);if(t===null||t===O[PROTOTYPE])return!0;const n=O.hasOwnProperty.call(t,CONSTRUCTOR)&&t[CONSTRUCTOR];if(n===Object)return!0;if(!isFunction$6(n))return!1;let o=cachedCtorStrings.get(n);return o===void 0&&(o=Function.toString.call(n),cachedCtorStrings.set(n,o)),o===objectCtorString}function original(e){return isDraft(e)||die(15,e),e[DRAFT_STATE].base_}function each(e,t,n=!0){getArchtype(e)===0?(n?Reflect.ownKeys(e):O.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((o,l)=>t(l,o,e))}function getArchtype(e){const t=e[DRAFT_STATE];return t?t.type_:isArray$3(e)?1:isMap(e)?2:isSet(e)?3:0}var has$1=(e,t,n=getArchtype(e))=>n===2?e.has(t):O[PROTOTYPE].hasOwnProperty.call(e,t),get$3=(e,t,n=getArchtype(e))=>n===2?e.get(t):e[t],set$2=(e,t,n,o=getArchtype(e))=>{o===2?e.set(t,n):o===3?e.add(n):e[t]=n};function is$1(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var isArray$3=Array.isArray,isMap=e=>e instanceof Map,isSet=e=>e instanceof Set,isObjectish=e=>typeof e=="object",isFunction$6=e=>typeof e=="function",isBoolean$2=e=>typeof e=="boolean",getProxyDraft=e=>isObjectish(e)?e==null?void 0:e[DRAFT_STATE]:null,latest=e=>e.copy_||e.base_,getFinalValue=e=>e.modified_?e.copy_:e.base_;function shallowCopy(e,t){if(isMap(e))return new Map(e);if(isSet(e))return new Set(e);if(isArray$3(e))return Array[PROTOTYPE].slice.call(e);const n=isPlainObject$3(e);if(t===!0||t==="class_only"&&!n){const o=O.getOwnPropertyDescriptors(e);delete o[DRAFT_STATE];let l=Reflect.ownKeys(o);for(let d=0;d<l.length;d++){const f=l[d],g=o[f];g[WRITABLE]===!1&&(g[WRITABLE]=!0,g[CONFIGURABLE]=!0),(g.get||g.set)&&(o[f]={[CONFIGURABLE]:!0,[WRITABLE]:!0,[ENUMERABLE]:g[ENUMERABLE],[VALUE]:e[f]})}return O.create(getPrototypeOf$1(e),o)}else{const o=getPrototypeOf$1(e);if(o!==null&&n)return{...e};const l=O.create(o);return O.assign(l,e)}}function freeze$1(e,t=!1){return isFrozen$1(e)||isDraft(e)||!isDraftable(e)||(getArchtype(e)>1&&O.defineProperties(e,{set:dontMutateMethodOverride,add:dontMutateMethodOverride,clear:dontMutateMethodOverride,delete:dontMutateMethodOverride}),O.freeze(e),t&&each(e,(n,o)=>{freeze$1(o,!0)},!1)),e}function dontMutateFrozenCollections(){die(2)}var dontMutateMethodOverride={[VALUE]:dontMutateFrozenCollections};function isFrozen$1(e){return e===null||!isObjectish(e)?!0:O.isFrozen(e)}var PluginMapSet="MapSet",PluginPatches="Patches",plugins={};function getPlugin(e){const t=plugins[e];return t||die(0,e),t}var isPluginLoaded=e=>!!plugins[e];function loadPlugin(e,t){plugins[e]||(plugins[e]=t)}var currentScope,getCurrentScope=()=>currentScope,createScope=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:isPluginLoaded(PluginMapSet)?getPlugin(PluginMapSet):void 0});function usePatchesInScope(e,t){t&&(e.patchPlugin_=getPlugin(PluginPatches),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function revokeScope(e){leaveScope(e),e.drafts_.forEach(revokeDraft),e.drafts_=null}function leaveScope(e){e===currentScope&&(currentScope=e.parent_)}var enterScope=e=>currentScope=createScope(currentScope,e);function revokeDraft(e){const t=e[DRAFT_STATE];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function processResult(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[DRAFT_STATE].modified_&&(revokeScope(t),die(4)),isDraftable(e)&&(e=finalize(t,e));const{patchPlugin_:l}=t;l&&l.generateReplacementPatches_(n[DRAFT_STATE].base_,e,t)}else e=finalize(t,n);return maybeFreeze(t,e,!0),revokeScope(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==NOTHING?e:void 0}function finalize(e,t){if(isFrozen$1(t))return t;const n=t[DRAFT_STATE];if(!n)return handleValue(t,e.handledSet_,e);if(!isSameScope(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(e);generatePatchesAndFinalize(n,e)}return n.copy_}function maybeFreeze(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&freeze$1(t,n)}function markStateFinalized(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var isSameScope=(e,t)=>e.scope_===t,EMPTY_LOCATIONS_RESULT=[];function updateDraftInParent(e,t,n,o){const l=latest(e),d=e.type_;if(o!==void 0&&get$3(l,o,d)===t){set$2(l,o,n,d);return}if(!e.draftLocations_){const g=e.draftLocations_=new Map;each(l,(b,_)=>{if(isDraft(_)){const S=g.get(_)||[];S.push(b),g.set(_,S)}})}const f=e.draftLocations_.get(t)??EMPTY_LOCATIONS_RESULT;for(const g of f)set$2(l,g,n,d)}function registerChildFinalizationCallback(e,t,n){e.callbacks_.push(function(l){var g;const d=t;if(!d||!isSameScope(d,l))return;(g=l.mapSetPlugin_)==null||g.fixSetContents(d);const f=getFinalValue(d);updateDraftInParent(e,d.draft_??d,f,n),generatePatchesAndFinalize(d,l)})}function generatePatchesAndFinalize(e,t){var o;if(e.modified_&&!e.finalized_&&(e.type_===3||(((o=e.assigned_)==null?void 0:o.size)??0)>0)){const{patchPlugin_:l}=t;if(l){const d=l.getPath(e);d&&l.generatePatches_(e,d,t)}markStateFinalized(e)}}function handleCrossReference(e,t,n){const{scope_:o}=e;if(isDraft(n)){const l=n[DRAFT_STATE];isSameScope(l,o)&&l.callbacks_.push(function(){prepareCopy(e);const f=getFinalValue(l);updateDraftInParent(e,n,f,t)})}else isDraftable(n)&&e.callbacks_.push(function(){const d=latest(e);get$3(d,t,e.type_)===n&&o.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&handleValue(get$3(e.copy_,t,e.type_),o.handledSet_,o)})}function handleValue(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||isDraft(e)||t.has(e)||!isDraftable(e)||isFrozen$1(e)||(t.add(e),each(e,(o,l)=>{if(isDraft(l)){const d=l[DRAFT_STATE];if(isSameScope(d,n)){const f=getFinalValue(d);set$2(e,o,f,e.type_),markStateFinalized(d)}}else isDraftable(l)&&handleValue(l,t,n)})),e}function createProxyProxy(e,t){const n=isArray$3(e),o={type_:n?1:0,scope_:t?t.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let l=o,d=objectTraps;n&&(l=[o],d=arrayTraps);const{revoke:f,proxy:g}=Proxy.revocable(l,d);return o.draft_=g,o.revoke_=f,[g,o]}var objectTraps={get(e,t){if(t===DRAFT_STATE)return e;const n=latest(e);if(!has$1(n,t,e.type_))return readPropFromProto(e,n,t);const o=n[t];if(e.finalized_||!isDraftable(o))return o;if(o===peek(e.base_,t)){prepareCopy(e);const l=e.type_===1?+t:t,d=createProxy(e.scope_,o,e,l);return e.copy_[l]=d}return o},has(e,t){return t in latest(e)},ownKeys(e){return Reflect.ownKeys(latest(e))},set(e,t,n){const o=getDescriptorFromProto(latest(e),t);if(o!=null&&o.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const l=peek(latest(e),t),d=l==null?void 0:l[DRAFT_STATE];if(d&&d.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(is$1(n,l)&&(n!==void 0||has$1(e.base_,t,e.type_)))return!0;prepareCopy(e),markChanged(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),handleCrossReference(e,t,n)),!0},deleteProperty(e,t){return prepareCopy(e),peek(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),markChanged(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=latest(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{[WRITABLE]:!0,[CONFIGURABLE]:e.type_!==1||t!=="length",[ENUMERABLE]:o[ENUMERABLE],[VALUE]:n[t]}},defineProperty(){die(11)},getPrototypeOf(e){return getPrototypeOf$1(e.base_)},setPrototypeOf(){die(12)}},arrayTraps={};each(objectTraps,(e,t)=>{arrayTraps[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}),arrayTraps.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&die(13),arrayTraps.set.call(this,e,t,void 0)},arrayTraps.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&die(14),objectTraps.set.call(this,e[0],t,n,e[0])};function peek(e,t){const n=e[DRAFT_STATE];return(n?latest(n):e)[t]}function readPropFromProto(e,t,n){var l;const o=getDescriptorFromProto(t,n);return o?VALUE in o?o[VALUE]:(l=o.get)==null?void 0:l.call(e.draft_):void 0}function getDescriptorFromProto(e,t){if(!(t in e))return;let n=getPrototypeOf$1(e);for(;n;){const o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=getPrototypeOf$1(n)}}function markChanged(e){e.modified_||(e.modified_=!0,e.parent_&&markChanged(e.parent_))}function prepareCopy(e){e.copy_||(e.assigned_=new Map,e.copy_=shallowCopy(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,o)=>{if(isFunction$6(t)&&!isFunction$6(n)){const d=n;n=t;const f=this;return function(b=d,..._){return f.produce(b,S=>n.call(this,S,..._))}}isFunction$6(n)||die(6),o!==void 0&&!isFunction$6(o)&&die(7);let l;if(isDraftable(t)){const d=enterScope(this),f=createProxy(d,t,void 0);let g=!0;try{l=n(f),g=!1}finally{g?revokeScope(d):leaveScope(d)}return usePatchesInScope(d,o),processResult(l,d)}else if(!t||!isObjectish(t)){if(l=n(t),l===void 0&&(l=t),l===NOTHING&&(l=void 0),this.autoFreeze_&&freeze$1(l,!0),o){const d=[],f=[];getPlugin(PluginPatches).generateReplacementPatches_(t,l,{patches_:d,inversePatches_:f}),o(d,f)}return l}else die(1,t)},this.produceWithPatches=(t,n)=>{if(isFunction$6(t))return(f,...g)=>this.produceWithPatches(f,b=>t(b,...g));let o,l;return[this.produce(t,n,(f,g)=>{o=f,l=g}),o,l]},isBoolean$2(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),isBoolean$2(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),isBoolean$2(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){isDraftable(e)||die(8),isDraft(e)&&(e=current(e));const t=enterScope(this),n=createProxy(t,e,void 0);return n[DRAFT_STATE].isManual_=!0,leaveScope(t),n}finishDraft(e,t){const n=e&&e[DRAFT_STATE];(!n||!n.isManual_)&&die(9);const{scope_:o}=n;return usePatchesInScope(o,t),processResult(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const l=t[n];if(l.path.length===0&&l.op==="replace"){e=l.value;break}}n>-1&&(t=t.slice(n+1));const o=getPlugin(PluginPatches).applyPatches_;return isDraft(e)?o(e,t):this.produce(e,l=>o(l,t))}};function createProxy(e,t,n,o){const[l,d]=isMap(t)?getPlugin(PluginMapSet).proxyMap_(t,n):isSet(t)?getPlugin(PluginMapSet).proxySet_(t,n):createProxyProxy(t,n);return((n==null?void 0:n.scope_)??getCurrentScope()).drafts_.push(l),d.callbacks_=(n==null?void 0:n.callbacks_)??[],d.key_=o,n&&o!==void 0?registerChildFinalizationCallback(n,d,o):d.callbacks_.push(function(b){var S;(S=b.mapSetPlugin_)==null||S.fixSetContents(d);const{patchPlugin_:_}=b;d.modified_&&_&&_.generatePatches_(d,[],b)}),l}function current(e){return isDraft(e)||die(10,e),currentImpl(e)}function currentImpl(e){if(!isDraftable(e)||isFrozen$1(e))return e;const t=e[DRAFT_STATE];let n,o=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=shallowCopy(e,t.scope_.immer_.useStrictShallowCopy_),o=t.scope_.immer_.shouldUseStrictIteration()}else n=shallowCopy(e,!0);return each(n,(l,d)=>{set$2(n,l,currentImpl(d))},o),t&&(t.finalized_=!1),n}function enablePatches(){process.env.NODE_ENV!=="production"&&errors.push('Sets cannot have "replace" patches.',function(A){return"Unsupported patch operation: "+A},function(A){return"Cannot apply patch, path doesn't resolve: "+A},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");function t(A,M=[]){if("key_"in A&&A.key_!==void 0){const I=A.parent_.copy_??A.parent_.base_,j=getProxyDraft(get$3(I,A.key_)),q=get$3(I,A.key_);if(q===void 0||q!==A.draft_&&q!==A.base_&&q!==A.copy_||j!=null&&j.base_!==A.base_)return null;const Q=A.parent_.type_===3;let te;if(Q){const F=A.parent_;te=Array.from(F.drafts_.keys()).indexOf(A.key_)}else te=A.key_;if(!(Q&&I.size>te||has$1(I,te)))return null;M.push(te)}if(A.parent_)return t(A.parent_,M);M.reverse();try{n(A.copy_,M)}catch{return null}return M}function n(A,M){let I=A;for(let j=0;j<M.length-1;j++){const q=M[j];if(I=get$3(I,q),!isObjectish(I)||I===null)throw new Error(`Cannot resolve path at '${M.join("/")}'`)}return I}const o="replace",l="add",d="remove";function f(A,M,I){if(A.scope_.processedForPatches_.has(A))return;A.scope_.processedForPatches_.add(A);const{patches_:j,inversePatches_:q}=I;switch(A.type_){case 0:case 2:return b(A,M,j,q);case 1:return g(A,M,j,q);case 3:return _(A,M,j,q)}}function g(A,M,I,j){let{base_:q,assigned_:Q}=A,te=A.copy_;te.length<q.length&&([q,te]=[te,q],[I,j]=[j,I]);for(let F=0;F<q.length;F++){const V=te[F],ne=q[F];if(Q!=null&&Q.get(F.toString())&&V!==ne){const ae=V==null?void 0:V[DRAFT_STATE];if(ae&&ae.modified_)continue;const se=M.concat([F]);I.push({op:o,path:se,value:E(V)}),j.push({op:o,path:se,value:E(ne)})}}for(let F=q.length;F<te.length;F++){const V=M.concat([F]);I.push({op:l,path:V,value:E(te[F])})}for(let F=te.length-1;q.length<=F;--F){const V=M.concat([F]);j.push({op:d,path:V})}}function b(A,M,I,j){const{base_:q,copy_:Q,type_:te}=A;each(A.assigned_,(F,V)=>{const ne=get$3(q,F,te),ae=get$3(Q,F,te),se=V?has$1(q,F)?o:l:d;if(ne===ae&&se===o)return;const $e=M.concat(F);I.push(se===d?{op:se,path:$e}:{op:se,path:$e,value:E(ae)}),j.push(se===l?{op:d,path:$e}:se===d?{op:l,path:$e,value:E(ne)}:{op:o,path:$e,value:E(ne)})})}function _(A,M,I,j){let{base_:q,copy_:Q}=A,te=0;q.forEach(F=>{if(!Q.has(F)){const V=M.concat([te]);I.push({op:d,path:V,value:F}),j.unshift({op:l,path:V,value:F})}te++}),te=0,Q.forEach(F=>{if(!q.has(F)){const V=M.concat([te]);I.push({op:l,path:V,value:F}),j.unshift({op:d,path:V,value:F})}te++})}function S(A,M,I){const{patches_:j,inversePatches_:q}=I;j.push({op:o,path:[],value:M===NOTHING?void 0:M}),q.push({op:o,path:[],value:A})}function R(A,M){return M.forEach(I=>{const{path:j,op:q}=I;let Q=A;for(let ne=0;ne<j.length-1;ne++){const ae=getArchtype(Q);let se=j[ne];typeof se!="string"&&typeof se!="number"&&(se=""+se),(ae===0||ae===1)&&(se==="__proto__"||se===CONSTRUCTOR)&&die(19),isFunction$6(Q)&&se===PROTOTYPE&&die(19),Q=get$3(Q,se),isObjectish(Q)||die(18,j.join("/"))}const te=getArchtype(Q),F=C(I.value),V=j[j.length-1];switch(q){case o:switch(te){case 2:return Q.set(V,F);case 3:die(16);default:return Q[V]=F}case l:switch(te){case 1:return V==="-"?Q.push(F):Q.splice(V,0,F);case 2:return Q.set(V,F);case 3:return Q.add(F);default:return Q[V]=F}case d:switch(te){case 1:return Q.splice(V,1);case 2:return Q.delete(V);case 3:return Q.delete(I.value);default:return delete Q[V]}default:die(17,q)}}),A}function C(A){if(!isDraftable(A))return A;if(isArray$3(A))return A.map(C);if(isMap(A))return new Map(Array.from(A.entries()).map(([I,j])=>[I,C(j)]));if(isSet(A))return new Set(Array.from(A).map(C));const M=Object.create(getPrototypeOf$1(A));for(const I in A)M[I]=C(A[I]);return has$1(A,DRAFTABLE)&&(M[DRAFTABLE]=A[DRAFTABLE]),M}function E(A){return isDraft(A)?C(A):A}loadPlugin(PluginPatches,{applyPatches_:R,generatePatches_:f,generateReplacementPatches_:S,getPath:t})}var immer=new Immer2,produce=immer.produce,produceWithPatches=immer.produceWithPatches.bind(immer),applyPatches=immer.applyPatches.bind(immer),runIdentityFunctionCheck=(e,t,n)=>{if(t.length===1&&t[0]===n){let o=!1;try{const l={};e(l)===l&&(o=!0)}catch{}if(o){let l;try{throw new Error}catch(d){({stack:l}=d)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
519
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return React__namespace.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},DESCRIPTION_WARNING_NAME="DialogDescriptionWarning",DescriptionWarning$1=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;return React__namespace.useEffect(()=>{var d;const l=(d=e.current)==null?void 0:d.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Root$a=Dialog$1,Trigger$6=DialogTrigger$1,Portal$4=DialogPortal$1,Overlay=DialogOverlay$1,Content$3=DialogContent$1,Title$1=DialogTitle$1,Description$1=DialogDescription$1,Close$1=DialogClose$1;const Dialog=({modal:e=!1,...t})=>jsxRuntime.jsx(Root$a,{modal:e,...t});Dialog.displayName=Root$a.displayName;const DialogTrigger=Trigger$6,DialogPortal=Portal$4,DialogClose=Close$1,DialogOverlay=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Overlay,{ref:n,className:cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));DialogOverlay.displayName=Overlay.displayName;const DialogContent=React__namespace.forwardRef(({className:e,children:t,animateExit:n=!0,overlayClassName:o,...l},d)=>jsxRuntime.jsxs(DialogPortal,{forceMount:l.forceMount,children:[jsxRuntime.jsx(DialogOverlay,{className:o}),jsxRuntime.jsxs(Content$3,{ref:d,className:cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl shadow-primary duration-200 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n&&"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]",e),...l,children:[t,jsxRuntime.jsxs(Close$1,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[jsxRuntime.jsx(X$1,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));DialogContent.displayName=Content$3.displayName;const DialogHeader=({className:e,...t})=>jsxRuntime.jsx("div",{className:cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});DialogHeader.displayName="DialogHeader";const DialogFooter=({className:e,...t})=>jsxRuntime.jsx("div",{className:cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});DialogFooter.displayName="DialogFooter";const DialogTitle=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Title$1,{ref:n,className:cn("text-lg font-semibold leading-none tracking-tight",e),...t}));DialogTitle.displayName=Title$1.displayName;const DialogDescription=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Description$1,{ref:n,className:cn("text-sm text-muted-foreground",e),...t}));DialogDescription.displayName=Description$1.displayName;const sides=["top","right","bottom","left"],min$4=Math.min,max$4=Math.max,round$1=Math.round,floor=Math.floor,createCoords=e=>({x:e,y:e}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$1(e,t,n){return max$4(e,min$4(t,n))}function evaluate(e,t){return typeof e=="function"?e(t):e}function getSide$1(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getOppositeAxis(e){return e==="x"?"y":"x"}function getAxisLength(e){return e==="y"?"height":"width"}const yAxisSides=new Set(["top","bottom"]);function getSideAxis(e){return yAxisSides.has(getSide$1(e))?"y":"x"}function getAlignmentAxis(e){return getOppositeAxis(getSideAxis(e))}function getAlignmentSides(e,t,n){n===void 0&&(n=!1);const o=getAlignment(e),l=getAlignmentAxis(e),d=getAxisLength(l);let f=l==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[d]>t.floating[d]&&(f=getOppositePlacement(f)),[f,getOppositePlacement(f)]}function getExpandedPlacements(e){const t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}function getOppositeAlignmentPlacement(e){return e.replace(/start|end/g,t=>oppositeAlignmentMap[t])}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(e,t,n){switch(e){case"top":case"bottom":return n?t?rlPlacement:lrPlacement:t?lrPlacement:rlPlacement;case"left":case"right":return t?tbPlacement:btPlacement;default:return[]}}function getOppositeAxisPlacements(e,t,n,o){const l=getAlignment(e);let d=getSideList(getSide$1(e),n==="start",o);return l&&(d=d.map(f=>f+"-"+l),t&&(d=d.concat(d.map(getOppositeAlignmentPlacement)))),d}function getOppositePlacement(e){return e.replace(/left|right|bottom|top/g,t=>oppositeSideMap[t])}function expandPaddingObject(e){return{top:0,right:0,bottom:0,left:0,...e}}function getPaddingObject(e){return typeof e!="number"?expandPaddingObject(e):{top:e,right:e,bottom:e,left:e}}function rectToClientRect(e){const{x:t,y:n,width:o,height:l}=e;return{width:o,height:l,top:n,left:t,right:t+o,bottom:n+l,x:t,y:n}}function computeCoordsFromPlacement(e,t,n){let{reference:o,floating:l}=e;const d=getSideAxis(t),f=getAlignmentAxis(t),g=getAxisLength(f),b=getSide$1(t),_=d==="y",S=o.x+o.width/2-l.width/2,R=o.y+o.height/2-l.height/2,C=o[g]/2-l[g]/2;let E;switch(b){case"top":E={x:S,y:o.y-l.height};break;case"bottom":E={x:S,y:o.y+o.height};break;case"right":E={x:o.x+o.width,y:R};break;case"left":E={x:o.x-l.width,y:R};break;default:E={x:o.x,y:o.y}}switch(getAlignment(t)){case"start":E[f]-=C*(n&&_?-1:1);break;case"end":E[f]+=C*(n&&_?-1:1);break}return E}const computePosition$1=async(e,t,n)=>{const{placement:o="bottom",strategy:l="absolute",middleware:d=[],platform:f}=n,g=d.filter(Boolean),b=await(f.isRTL==null?void 0:f.isRTL(t));let _=await f.getElementRects({reference:e,floating:t,strategy:l}),{x:S,y:R}=computeCoordsFromPlacement(_,o,b),C=o,E={},A=0;for(let M=0;M<g.length;M++){const{name:I,fn:j}=g[M],{x:q,y:Q,data:te,reset:F}=await j({x:S,y:R,initialPlacement:o,placement:C,strategy:l,middlewareData:E,rects:_,platform:f,elements:{reference:e,floating:t}});S=q??S,R=Q??R,E={...E,[I]:{...E[I],...te}},F&&A<=50&&(A++,typeof F=="object"&&(F.placement&&(C=F.placement),F.rects&&(_=F.rects===!0?await f.getElementRects({reference:e,floating:t,strategy:l}):F.rects),{x:S,y:R}=computeCoordsFromPlacement(_,C,b)),M=-1)}return{x:S,y:R,placement:C,strategy:l,middlewareData:E}};async function detectOverflow(e,t){var n;t===void 0&&(t={});const{x:o,y:l,platform:d,rects:f,elements:g,strategy:b}=e,{boundary:_="clippingAncestors",rootBoundary:S="viewport",elementContext:R="floating",altBoundary:C=!1,padding:E=0}=evaluate(t,e),A=getPaddingObject(E),I=g[C?R==="floating"?"reference":"floating":R],j=rectToClientRect(await d.getClippingRect({element:(n=await(d.isElement==null?void 0:d.isElement(I)))==null||n?I:I.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(g.floating)),boundary:_,rootBoundary:S,strategy:b})),q=R==="floating"?{x:o,y:l,width:f.floating.width,height:f.floating.height}:f.reference,Q=await(d.getOffsetParent==null?void 0:d.getOffsetParent(g.floating)),te=await(d.isElement==null?void 0:d.isElement(Q))?await(d.getScale==null?void 0:d.getScale(Q))||{x:1,y:1}:{x:1,y:1},F=rectToClientRect(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:g,rect:q,offsetParent:Q,strategy:b}):q);return{top:(j.top-F.top+A.top)/te.y,bottom:(F.bottom-j.bottom+A.bottom)/te.y,left:(j.left-F.left+A.left)/te.x,right:(F.right-j.right+A.right)/te.x}}const arrow$4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:l,rects:d,platform:f,elements:g,middlewareData:b}=t,{element:_,padding:S=0}=evaluate(e,t)||{};if(_==null)return{};const R=getPaddingObject(S),C={x:n,y:o},E=getAlignmentAxis(l),A=getAxisLength(E),M=await f.getDimensions(_),I=E==="y",j=I?"top":"left",q=I?"bottom":"right",Q=I?"clientHeight":"clientWidth",te=d.reference[A]+d.reference[E]-C[E]-d.floating[A],F=C[E]-d.reference[E],V=await(f.getOffsetParent==null?void 0:f.getOffsetParent(_));let ne=V?V[Q]:0;(!ne||!await(f.isElement==null?void 0:f.isElement(V)))&&(ne=g.floating[Q]||d.floating[A]);const ae=te/2-F/2,se=ne/2-M[A]/2-1,$e=min$4(R[j],se),Ne=min$4(R[q],se),oe=$e,Oe=ne-M[A]-Ne,Ae=ne/2-M[A]/2+ae,je=clamp$1(oe,Ae,Oe),Be=!b.arrow&&getAlignment(l)!=null&&Ae!==je&&d.reference[A]/2-(Ae<oe?$e:Ne)-M[A]/2<0,qe=Be?Ae<oe?Ae-oe:Ae-Oe:0;return{[E]:C[E]+qe,data:{[E]:je,centerOffset:Ae-je-qe,...Be&&{alignmentOffset:qe}},reset:Be}}}),flip$2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:l,middlewareData:d,rects:f,initialPlacement:g,platform:b,elements:_}=t,{mainAxis:S=!0,crossAxis:R=!0,fallbackPlacements:C,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:M=!0,...I}=evaluate(e,t);if((n=d.arrow)!=null&&n.alignmentOffset)return{};const j=getSide$1(l),q=getSideAxis(g),Q=getSide$1(g)===g,te=await(b.isRTL==null?void 0:b.isRTL(_.floating)),F=C||(Q||!M?[getOppositePlacement(g)]:getExpandedPlacements(g)),V=A!=="none";!C&&V&&F.push(...getOppositeAxisPlacements(g,M,A,te));const ne=[g,...F],ae=await detectOverflow(t,I),se=[];let $e=((o=d.flip)==null?void 0:o.overflows)||[];if(S&&se.push(ae[j]),R){const Ae=getAlignmentSides(l,f,te);se.push(ae[Ae[0]],ae[Ae[1]])}if($e=[...$e,{placement:l,overflows:se}],!se.every(Ae=>Ae<=0)){var Ne,oe;const Ae=(((Ne=d.flip)==null?void 0:Ne.index)||0)+1,je=ne[Ae];if(je&&(!(R==="alignment"?q!==getSideAxis(je):!1)||$e.every(Ve=>getSideAxis(Ve.placement)===q?Ve.overflows[0]>0:!0)))return{data:{index:Ae,overflows:$e},reset:{placement:je}};let Be=(oe=$e.filter(qe=>qe.overflows[0]<=0).sort((qe,Ve)=>qe.overflows[1]-Ve.overflows[1])[0])==null?void 0:oe.placement;if(!Be)switch(E){case"bestFit":{var Oe;const qe=(Oe=$e.filter(Ve=>{if(V){const Le=getSideAxis(Ve.placement);return Le===q||Le==="y"}return!0}).map(Ve=>[Ve.placement,Ve.overflows.filter(Le=>Le>0).reduce((Le,Ue)=>Le+Ue,0)]).sort((Ve,Le)=>Ve[1]-Le[1])[0])==null?void 0:Oe[0];qe&&(Be=qe);break}case"initialPlacement":Be=g;break}if(l!==Be)return{reset:{placement:Be}}}return{}}}};function getSideOffsets(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function isAnySideFullyClipped(e){return sides.some(t=>e[t]>=0)}const hide$2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...l}=evaluate(e,t);switch(o){case"referenceHidden":{const d=await detectOverflow(t,{...l,elementContext:"reference"}),f=getSideOffsets(d,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:isAnySideFullyClipped(f)}}}case"escaped":{const d=await detectOverflow(t,{...l,altBoundary:!0}),f=getSideOffsets(d,n.floating);return{data:{escapedOffsets:f,escaped:isAnySideFullyClipped(f)}}}default:return{}}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(e,t){const{placement:n,platform:o,elements:l}=e,d=await(o.isRTL==null?void 0:o.isRTL(l.floating)),f=getSide$1(n),g=getAlignment(n),b=getSideAxis(n)==="y",_=originSides.has(f)?-1:1,S=d&&b?-1:1,R=evaluate(t,e);let{mainAxis:C,crossAxis:E,alignmentAxis:A}=typeof R=="number"?{mainAxis:R,crossAxis:0,alignmentAxis:null}:{mainAxis:R.mainAxis||0,crossAxis:R.crossAxis||0,alignmentAxis:R.alignmentAxis};return g&&typeof A=="number"&&(E=g==="end"?A*-1:A),b?{x:E*S,y:C*_}:{x:C*_,y:E*S}}const offset$2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:l,y:d,placement:f,middlewareData:g}=t,b=await convertValueToCoords(t,e);return f===((n=g.offset)==null?void 0:n.placement)&&(o=g.arrow)!=null&&o.alignmentOffset?{}:{x:l+b.x,y:d+b.y,data:{...b,placement:f}}}}},shift$3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:l}=t,{mainAxis:d=!0,crossAxis:f=!1,limiter:g={fn:I=>{let{x:j,y:q}=I;return{x:j,y:q}}},...b}=evaluate(e,t),_={x:n,y:o},S=await detectOverflow(t,b),R=getSideAxis(getSide$1(l)),C=getOppositeAxis(R);let E=_[C],A=_[R];if(d){const I=C==="y"?"top":"left",j=C==="y"?"bottom":"right",q=E+S[I],Q=E-S[j];E=clamp$1(q,E,Q)}if(f){const I=R==="y"?"top":"left",j=R==="y"?"bottom":"right",q=A+S[I],Q=A-S[j];A=clamp$1(q,A,Q)}const M=g.fn({...t,[C]:E,[R]:A});return{...M,data:{x:M.x-n,y:M.y-o,enabled:{[C]:d,[R]:f}}}}}},limitShift$2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:l,rects:d,middlewareData:f}=t,{offset:g=0,mainAxis:b=!0,crossAxis:_=!0}=evaluate(e,t),S={x:n,y:o},R=getSideAxis(l),C=getOppositeAxis(R);let E=S[C],A=S[R];const M=evaluate(g,t),I=typeof M=="number"?{mainAxis:M,crossAxis:0}:{mainAxis:0,crossAxis:0,...M};if(b){const Q=C==="y"?"height":"width",te=d.reference[C]-d.floating[Q]+I.mainAxis,F=d.reference[C]+d.reference[Q]-I.mainAxis;E<te?E=te:E>F&&(E=F)}if(_){var j,q;const Q=C==="y"?"width":"height",te=originSides.has(getSide$1(l)),F=d.reference[R]-d.floating[Q]+(te&&((j=f.offset)==null?void 0:j[R])||0)+(te?0:I.crossAxis),V=d.reference[R]+d.reference[Q]+(te?0:((q=f.offset)==null?void 0:q[R])||0)-(te?I.crossAxis:0);A<F?A=F:A>V&&(A=V)}return{[C]:E,[R]:A}}}},size$2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:l,rects:d,platform:f,elements:g}=t,{apply:b=()=>{},..._}=evaluate(e,t),S=await detectOverflow(t,_),R=getSide$1(l),C=getAlignment(l),E=getSideAxis(l)==="y",{width:A,height:M}=d.floating;let I,j;R==="top"||R==="bottom"?(I=R,j=C===(await(f.isRTL==null?void 0:f.isRTL(g.floating))?"start":"end")?"left":"right"):(j=R,I=C==="end"?"top":"bottom");const q=M-S.top-S.bottom,Q=A-S.left-S.right,te=min$4(M-S[I],q),F=min$4(A-S[j],Q),V=!t.middlewareData.shift;let ne=te,ae=F;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(ae=Q),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(ne=q),V&&!C){const $e=max$4(S.left,0),Ne=max$4(S.right,0),oe=max$4(S.top,0),Oe=max$4(S.bottom,0);E?ae=A-2*($e!==0||Ne!==0?$e+Ne:max$4(S.left,S.right)):ne=M-2*(oe!==0||Oe!==0?oe+Oe:max$4(S.top,S.bottom))}await b({...t,availableWidth:ae,availableHeight:ne});const se=await f.getDimensions(g.floating);return A!==se.width||M!==se.height?{reset:{rects:!0}}:{}}}};function hasWindow(){return typeof window<"u"}function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():"#document"}function getWindow(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function getDocumentElement(e){var t;return(t=(isNode(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function isNode(e){return hasWindow()?e instanceof Node||e instanceof getWindow(e).Node:!1}function isElement(e){return hasWindow()?e instanceof Element||e instanceof getWindow(e).Element:!1}function isHTMLElement$2(e){return hasWindow()?e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement:!1}function isShadowRoot(e){return!hasWindow()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot}const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:o,display:l}=getComputedStyle$1(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!invalidOverflowDisplayValues.has(l)}const tableElements=new Set(["table","td","th"]);function isTableElement(e){return tableElements.has(getNodeName(e))}const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(e){return topLayerSelectors.some(t=>{try{return e.matches(t)}catch{return!1}})}const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(e){const t=isWebKit(),n=isElement(e)?getComputedStyle$1(e):e;return transformProperties.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||willChangeValues.some(o=>(n.willChange||"").includes(o))||containValues.some(o=>(n.contain||"").includes(o))}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement$2(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;if(isTopLayer(t))return null;t=getParentNode(t)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(e){return lastTraversableNodeNames.has(getNodeName(e))}function getComputedStyle$1(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function getParentNode(e){if(getNodeName(e)==="html")return e;const t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument?e.ownerDocument.body:e.body:isHTMLElement$2(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const l=getNearestOverflowAncestor(e),d=l===((o=e.ownerDocument)==null?void 0:o.body),f=getWindow(l);if(d){const g=getFrameElement(f);return t.concat(f,f.visualViewport||[],isOverflowElement(l)?l:[],g&&n?getOverflowAncestors(g):[])}return t.concat(l,getOverflowAncestors(l,[],n))}function getFrameElement(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function getCssDimensions(e){const t=getComputedStyle$1(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const l=isHTMLElement$2(e),d=l?e.offsetWidth:n,f=l?e.offsetHeight:o,g=round$1(n)!==d||round$1(o)!==f;return g&&(n=d,o=f),{width:n,height:o,$:g}}function unwrapElement(e){return isElement(e)?e:e.contextElement}function getScale(e){const t=unwrapElement(e);if(!isHTMLElement$2(t))return createCoords(1);const n=t.getBoundingClientRect(),{width:o,height:l,$:d}=getCssDimensions(t);let f=(d?round$1(n.width):n.width)/o,g=(d?round$1(n.height):n.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!g||!Number.isFinite(g))&&(g=1),{x:f,y:g}}const noOffsets=createCoords(0);function getVisualOffsets(e){const t=getWindow(e);return!isWebKit()||!t.visualViewport?noOffsets:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function shouldAddVisualOffsets(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==getWindow(e)?!1:t}function getBoundingClientRect(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const l=e.getBoundingClientRect(),d=unwrapElement(e);let f=createCoords(1);t&&(o?isElement(o)&&(f=getScale(o)):f=getScale(e));const g=shouldAddVisualOffsets(d,n,o)?getVisualOffsets(d):createCoords(0);let b=(l.left+g.x)/f.x,_=(l.top+g.y)/f.y,S=l.width/f.x,R=l.height/f.y;if(d){const C=getWindow(d),E=o&&isElement(o)?getWindow(o):o;let A=C,M=getFrameElement(A);for(;M&&o&&E!==A;){const I=getScale(M),j=M.getBoundingClientRect(),q=getComputedStyle$1(M),Q=j.left+(M.clientLeft+parseFloat(q.paddingLeft))*I.x,te=j.top+(M.clientTop+parseFloat(q.paddingTop))*I.y;b*=I.x,_*=I.y,S*=I.x,R*=I.y,b+=Q,_+=te,A=getWindow(M),M=getFrameElement(A)}}return rectToClientRect({width:S,height:R,x:b,y:_})}function getWindowScrollBarX(e,t){const n=getNodeScroll(e).scrollLeft;return t?t.left+n:getBoundingClientRect(getDocumentElement(e)).left+n}function getHTMLOffset(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-getWindowScrollBarX(e,n),l=n.top+t.scrollTop;return{x:o,y:l}}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{elements:t,rect:n,offsetParent:o,strategy:l}=e;const d=l==="fixed",f=getDocumentElement(o),g=t?isTopLayer(t.floating):!1;if(o===f||g&&d)return n;let b={scrollLeft:0,scrollTop:0},_=createCoords(1);const S=createCoords(0),R=isHTMLElement$2(o);if((R||!R&&!d)&&((getNodeName(o)!=="body"||isOverflowElement(f))&&(b=getNodeScroll(o)),isHTMLElement$2(o))){const E=getBoundingClientRect(o);_=getScale(o),S.x=E.x+o.clientLeft,S.y=E.y+o.clientTop}const C=f&&!R&&!d?getHTMLOffset(f,b):createCoords(0);return{width:n.width*_.x,height:n.height*_.y,x:n.x*_.x-b.scrollLeft*_.x+S.x+C.x,y:n.y*_.y-b.scrollTop*_.y+S.y+C.y}}function getClientRects(e){return Array.from(e.getClientRects())}function getDocumentRect(e){const t=getDocumentElement(e),n=getNodeScroll(e),o=e.ownerDocument.body,l=max$4(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),d=max$4(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let f=-n.scrollLeft+getWindowScrollBarX(e);const g=-n.scrollTop;return getComputedStyle$1(o).direction==="rtl"&&(f+=max$4(t.clientWidth,o.clientWidth)-l),{width:l,height:d,x:f,y:g}}const SCROLLBAR_MAX=25;function getViewportRect(e,t){const n=getWindow(e),o=getDocumentElement(e),l=n.visualViewport;let d=o.clientWidth,f=o.clientHeight,g=0,b=0;if(l){d=l.width,f=l.height;const S=isWebKit();(!S||S&&t==="fixed")&&(g=l.offsetLeft,b=l.offsetTop)}const _=getWindowScrollBarX(o);if(_<=0){const S=o.ownerDocument,R=S.body,C=getComputedStyle(R),E=S.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,A=Math.abs(o.clientWidth-R.clientWidth-E);A<=SCROLLBAR_MAX&&(d-=A)}else _<=SCROLLBAR_MAX&&(d+=_);return{width:d,height:f,x:g,y:b}}const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,t==="fixed"),o=n.top+e.clientTop,l=n.left+e.clientLeft,d=isHTMLElement$2(e)?getScale(e):createCoords(1),f=e.clientWidth*d.x,g=e.clientHeight*d.y,b=l*d.x,_=o*d.y;return{width:f,height:g,x:b,y:_}}function getClientRectFromClippingAncestor(e,t,n){let o;if(t==="viewport")o=getViewportRect(e,n);else if(t==="document")o=getDocumentRect(getDocumentElement(e));else if(isElement(t))o=getInnerBoundingClientRect(t,n);else{const l=getVisualOffsets(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return rectToClientRect(o)}function hasFixedPositionAncestor(e,t){const n=getParentNode(e);return n===t||!isElement(n)||isLastTraversableNode(n)?!1:getComputedStyle$1(n).position==="fixed"||hasFixedPositionAncestor(n,t)}function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let o=getOverflowAncestors(e,[],!1).filter(g=>isElement(g)&&getNodeName(g)!=="body"),l=null;const d=getComputedStyle$1(e).position==="fixed";let f=d?getParentNode(e):e;for(;isElement(f)&&!isLastTraversableNode(f);){const g=getComputedStyle$1(f),b=isContainingBlock(f);!b&&g.position==="fixed"&&(l=null),(d?!b&&!l:!b&&g.position==="static"&&!!l&&absoluteOrFixed.has(l.position)||isOverflowElement(f)&&!b&&hasFixedPositionAncestor(e,f))?o=o.filter(S=>S!==f):l=g,f=getParentNode(f)}return t.set(e,o),o}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:o,strategy:l}=e;const f=[...n==="clippingAncestors"?isTopLayer(t)?[]:getClippingElementAncestors(t,this._c):[].concat(n),o],g=f[0],b=f.reduce((_,S)=>{const R=getClientRectFromClippingAncestor(t,S,l);return _.top=max$4(R.top,_.top),_.right=min$4(R.right,_.right),_.bottom=min$4(R.bottom,_.bottom),_.left=max$4(R.left,_.left),_},getClientRectFromClippingAncestor(t,g,l));return{width:b.right-b.left,height:b.bottom-b.top,x:b.left,y:b.top}}function getDimensions(e){const{width:t,height:n}=getCssDimensions(e);return{width:t,height:n}}function getRectRelativeToOffsetParent(e,t,n){const o=isHTMLElement$2(t),l=getDocumentElement(t),d=n==="fixed",f=getBoundingClientRect(e,!0,d,t);let g={scrollLeft:0,scrollTop:0};const b=createCoords(0);function _(){b.x=getWindowScrollBarX(l)}if(o||!o&&!d)if((getNodeName(t)!=="body"||isOverflowElement(l))&&(g=getNodeScroll(t)),o){const E=getBoundingClientRect(t,!0,d,t);b.x=E.x+t.clientLeft,b.y=E.y+t.clientTop}else l&&_();d&&!o&&l&&_();const S=l&&!o&&!d?getHTMLOffset(l,g):createCoords(0),R=f.left+g.scrollLeft-b.x-S.x,C=f.top+g.scrollTop-b.y-S.y;return{x:R,y:C,width:f.width,height:f.height}}function isStaticPositioned(e){return getComputedStyle$1(e).position==="static"}function getTrueOffsetParent(e,t){if(!isHTMLElement$2(e)||getComputedStyle$1(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return getDocumentElement(e)===n&&(n=n.ownerDocument.body),n}function getOffsetParent(e,t){const n=getWindow(e);if(isTopLayer(e))return n;if(!isHTMLElement$2(e)){let l=getParentNode(e);for(;l&&!isLastTraversableNode(l);){if(isElement(l)&&!isStaticPositioned(l))return l;l=getParentNode(l)}return n}let o=getTrueOffsetParent(e,t);for(;o&&isTableElement(o)&&isStaticPositioned(o);)o=getTrueOffsetParent(o,t);return o&&isLastTraversableNode(o)&&isStaticPositioned(o)&&!isContainingBlock(o)?n:o||getContainingBlock(e)||n}const getElementRects=async function(e){const t=this.getOffsetParent||getOffsetParent,n=this.getDimensions,o=await n(e.floating);return{reference:getRectRelativeToOffsetParent(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function isRTL(e){return getComputedStyle$1(e).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement,isRTL};function rectsAreEqual(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function observeMove(e,t){let n=null,o;const l=getDocumentElement(e);function d(){var g;clearTimeout(o),(g=n)==null||g.disconnect(),n=null}function f(g,b){g===void 0&&(g=!1),b===void 0&&(b=1),d();const _=e.getBoundingClientRect(),{left:S,top:R,width:C,height:E}=_;if(g||t(),!C||!E)return;const A=floor(R),M=floor(l.clientWidth-(S+C)),I=floor(l.clientHeight-(R+E)),j=floor(S),Q={rootMargin:-A+"px "+-M+"px "+-I+"px "+-j+"px",threshold:max$4(0,min$4(1,b))||1};let te=!0;function F(V){const ne=V[0].intersectionRatio;if(ne!==b){if(!te)return f();ne?f(!1,ne):o=setTimeout(()=>{f(!1,1e-7)},1e3)}ne===1&&!rectsAreEqual(_,e.getBoundingClientRect())&&f(),te=!1}try{n=new IntersectionObserver(F,{...Q,root:l.ownerDocument})}catch{n=new IntersectionObserver(F,Q)}n.observe(e)}return f(!0),d}function autoUpdate(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:l=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:g=typeof IntersectionObserver=="function",animationFrame:b=!1}=o,_=unwrapElement(e),S=l||d?[..._?getOverflowAncestors(_):[],...getOverflowAncestors(t)]:[];S.forEach(j=>{l&&j.addEventListener("scroll",n,{passive:!0}),d&&j.addEventListener("resize",n)});const R=_&&g?observeMove(_,n):null;let C=-1,E=null;f&&(E=new ResizeObserver(j=>{let[q]=j;q&&q.target===_&&E&&(E.unobserve(t),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var Q;(Q=E)==null||Q.observe(t)})),n()}),_&&!b&&E.observe(_),E.observe(t));let A,M=b?getBoundingClientRect(e):null;b&&I();function I(){const j=getBoundingClientRect(e);M&&!rectsAreEqual(M,j)&&n(),M=j,A=requestAnimationFrame(I)}return n(),()=>{var j;S.forEach(q=>{l&&q.removeEventListener("scroll",n),d&&q.removeEventListener("resize",n)}),R==null||R(),(j=E)==null||j.disconnect(),E=null,b&&cancelAnimationFrame(A)}}const offset$1=offset$2,shift$2=shift$3,flip$1=flip$2,size$1=size$2,hide$1=hide$2,arrow$3=arrow$4,limitShift$1=limitShift$2,computePosition=(e,t,n)=>{const o=new Map,l={platform,...n},d={...l.platform,_c:o};return computePosition$1(e,t,{...l,platform:d})};var isClient=typeof document<"u",noop$3=function(){},index=isClient?React.useLayoutEffect:noop$3;function deepEqual$3(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,o,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!deepEqual$3(e[o],t[o]))return!1;return!0}if(l=Object.keys(e),n=l.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,l[o]))return!1;for(o=n;o--!==0;){const d=l[o];if(!(d==="_owner"&&e.$$typeof)&&!deepEqual$3(e[d],t[d]))return!1}return!0}return e!==e&&t!==t}function getDPR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(e,t){const n=getDPR(e);return Math.round(t*n)/n}function useLatestRef(e){const t=React__namespace.useRef(e);return index(()=>{t.current=e}),t}function useFloating(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:l,elements:{reference:d,floating:f}={},transform:g=!0,whileElementsMounted:b,open:_}=e,[S,R]=React__namespace.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[C,E]=React__namespace.useState(o);deepEqual$3(C,o)||E(o);const[A,M]=React__namespace.useState(null),[I,j]=React__namespace.useState(null),q=React__namespace.useCallback(Ve=>{Ve!==V.current&&(V.current=Ve,M(Ve))},[]),Q=React__namespace.useCallback(Ve=>{Ve!==ne.current&&(ne.current=Ve,j(Ve))},[]),te=d||A,F=f||I,V=React__namespace.useRef(null),ne=React__namespace.useRef(null),ae=React__namespace.useRef(S),se=b!=null,$e=useLatestRef(b),Ne=useLatestRef(l),oe=useLatestRef(_),Oe=React__namespace.useCallback(()=>{if(!V.current||!ne.current)return;const Ve={placement:t,strategy:n,middleware:C};Ne.current&&(Ve.platform=Ne.current),computePosition(V.current,ne.current,Ve).then(Le=>{const Ue={...Le,isPositioned:oe.current!==!1};Ae.current&&!deepEqual$3(ae.current,Ue)&&(ae.current=Ue,ReactDOM__namespace.flushSync(()=>{R(Ue)}))})},[C,t,n,Ne,oe]);index(()=>{_===!1&&ae.current.isPositioned&&(ae.current.isPositioned=!1,R(Ve=>({...Ve,isPositioned:!1})))},[_]);const Ae=React__namespace.useRef(!1);index(()=>(Ae.current=!0,()=>{Ae.current=!1}),[]),index(()=>{if(te&&(V.current=te),F&&(ne.current=F),te&&F){if($e.current)return $e.current(te,F,Oe);Oe()}},[te,F,Oe,$e,se]);const je=React__namespace.useMemo(()=>({reference:V,floating:ne,setReference:q,setFloating:Q}),[q,Q]),Be=React__namespace.useMemo(()=>({reference:te,floating:F}),[te,F]),qe=React__namespace.useMemo(()=>{const Ve={position:n,left:0,top:0};if(!Be.floating)return Ve;const Le=roundByDPR(Be.floating,S.x),Ue=roundByDPR(Be.floating,S.y);return g?{...Ve,transform:"translate("+Le+"px, "+Ue+"px)",...getDPR(Be.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Le,top:Ue}},[n,g,Be.floating,S.x,S.y]);return React__namespace.useMemo(()=>({...S,update:Oe,refs:je,elements:Be,floatingStyles:qe}),[S,Oe,je,Be,qe])}const arrow$1=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:l}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?arrow$3({element:o.current,padding:l}).fn(n):{}:o?arrow$3({element:o,padding:l}).fn(n):{}}}},offset=(e,t)=>({...offset$1(e),options:[e,t]}),shift$1=(e,t)=>({...shift$2(e),options:[e,t]}),limitShift=(e,t)=>({...limitShift$1(e),options:[e,t]}),flip=(e,t)=>({...flip$1(e),options:[e,t]}),size=(e,t)=>({...size$1(e),options:[e,t]}),hide=(e,t)=>({...hide$1(e),options:[e,t]}),arrow$2=(e,t)=>({...arrow$1(e),options:[e,t]});var NAME$3="Arrow",Arrow$1=React__namespace.forwardRef((e,t)=>{const{children:n,width:o=10,height:l=5,...d}=e;return jsxRuntime.jsx(Primitive$4.svg,{...d,ref:t,width:o,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:jsxRuntime.jsx("polygon",{points:"0,0 30,0 15,10"})})});Arrow$1.displayName=NAME$3;var Root$9=Arrow$1,POPPER_NAME="Popper",[createPopperContext,createPopperScope]=createContextScope$2(POPPER_NAME),[PopperProvider,usePopperContext]=createPopperContext(POPPER_NAME),Popper=e=>{const{__scopePopper:t,children:n}=e,[o,l]=React__namespace.useState(null);return jsxRuntime.jsx(PopperProvider,{scope:t,anchor:o,onAnchorChange:l,children:n})};Popper.displayName=POPPER_NAME;var ANCHOR_NAME$2="PopperAnchor",PopperAnchor=React__namespace.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...l}=e,d=usePopperContext(ANCHOR_NAME$2,n),f=React__namespace.useRef(null),g=useComposedRefs(t,f),b=React__namespace.useRef(null);return React__namespace.useEffect(()=>{const _=b.current;b.current=(o==null?void 0:o.current)||f.current,_!==b.current&&d.onAnchorChange(b.current)}),o?null:jsxRuntime.jsx(Primitive$4.div,{...l,ref:g})});PopperAnchor.displayName=ANCHOR_NAME$2;var CONTENT_NAME$9="PopperContent",[PopperContentProvider,useContentContext]=createPopperContext(CONTENT_NAME$9),PopperContent=React__namespace.forwardRef((e,t)=>{var et,at,tt,ot,lt,Ge;const{__scopePopper:n,side:o="bottom",sideOffset:l=0,align:d="center",alignOffset:f=0,arrowPadding:g=0,avoidCollisions:b=!0,collisionBoundary:_=[],collisionPadding:S=0,sticky:R="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:A,...M}=e,I=usePopperContext(CONTENT_NAME$9,n),[j,q]=React__namespace.useState(null),Q=useComposedRefs(t,$t=>q($t)),[te,F]=React__namespace.useState(null),V=useSize(te),ne=(V==null?void 0:V.width)??0,ae=(V==null?void 0:V.height)??0,se=o+(d!=="center"?"-"+d:""),$e=typeof S=="number"?S:{top:0,right:0,bottom:0,left:0,...S},Ne=Array.isArray(_)?_:[_],oe=Ne.length>0,Oe={padding:$e,boundary:Ne.filter(isNotNull),altBoundary:oe},{refs:Ae,floatingStyles:je,placement:Be,isPositioned:qe,middlewareData:Ve}=useFloating({strategy:"fixed",placement:se,whileElementsMounted:(...$t)=>autoUpdate(...$t,{animationFrame:E==="always"}),elements:{reference:I.anchor},middleware:[offset({mainAxis:l+ae,alignmentAxis:f}),b&&shift$1({mainAxis:!0,crossAxis:!1,limiter:R==="partial"?limitShift():void 0,...Oe}),b&&flip({...Oe}),size({...Oe,apply:({elements:$t,rects:nt,availableWidth:Rt,availableHeight:dt})=>{const{width:It,height:Mt}=nt.reference,Ct=$t.floating.style;Ct.setProperty("--radix-popper-available-width",`${Rt}px`),Ct.setProperty("--radix-popper-available-height",`${dt}px`),Ct.setProperty("--radix-popper-anchor-width",`${It}px`),Ct.setProperty("--radix-popper-anchor-height",`${Mt}px`)}}),te&&arrow$2({element:te,padding:g}),transformOrigin({arrowWidth:ne,arrowHeight:ae}),C&&hide({strategy:"referenceHidden",...Oe})]}),[Le,Ue]=getSideAndAlignFromPlacement(Be),We=useCallbackRef$1(A);useLayoutEffect2(()=>{qe&&(We==null||We())},[qe,We]);const ze=(et=Ve.arrow)==null?void 0:et.x,Qe=(at=Ve.arrow)==null?void 0:at.y,rt=((tt=Ve.arrow)==null?void 0:tt.centerOffset)!==0,[Je,st]=React__namespace.useState();return useLayoutEffect2(()=>{j&&st(window.getComputedStyle(j).zIndex)},[j]),jsxRuntime.jsx("div",{ref:Ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...je,transform:qe?je.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Je,"--radix-popper-transform-origin":[(ot=Ve.transformOrigin)==null?void 0:ot.x,(lt=Ve.transformOrigin)==null?void 0:lt.y].join(" "),...((Ge=Ve.hide)==null?void 0:Ge.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:jsxRuntime.jsx(PopperContentProvider,{scope:n,placedSide:Le,onArrowChange:F,arrowX:ze,arrowY:Qe,shouldHideArrow:rt,children:jsxRuntime.jsx(Primitive$4.div,{"data-side":Le,"data-align":Ue,...M,ref:Q,style:{...M.style,animation:qe?void 0:"none"}})})})});PopperContent.displayName=CONTENT_NAME$9;var ARROW_NAME$5="PopperArrow",OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},PopperArrow=React__namespace.forwardRef(function(t,n){const{__scopePopper:o,...l}=t,d=useContentContext(ARROW_NAME$5,o),f=OPPOSITE_SIDE[d.placedSide];return jsxRuntime.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:jsxRuntime.jsx(Root$9,{...l,ref:n,style:{...l.style,display:"block"}})})});PopperArrow.displayName=ARROW_NAME$5;function isNotNull(e){return e!==null}var transformOrigin=e=>({name:"transformOrigin",options:e,fn(t){var I,j,q;const{placement:n,rects:o,middlewareData:l}=t,f=((I=l.arrow)==null?void 0:I.centerOffset)!==0,g=f?0:e.arrowWidth,b=f?0:e.arrowHeight,[_,S]=getSideAndAlignFromPlacement(n),R={start:"0%",center:"50%",end:"100%"}[S],C=(((j=l.arrow)==null?void 0:j.x)??0)+g/2,E=(((q=l.arrow)==null?void 0:q.y)??0)+b/2;let A="",M="";return _==="bottom"?(A=f?R:`${C}px`,M=`${-b}px`):_==="top"?(A=f?R:`${C}px`,M=`${o.floating.height+b}px`):_==="right"?(A=`${-b}px`,M=f?R:`${E}px`):_==="left"&&(A=`${o.floating.width+b}px`,M=f?R:`${E}px`),{data:{x:A,y:M}}}});function getSideAndAlignFromPlacement(e){const[t,n="center"]=e.split("-");return[t,n]}var Root2$7=Popper,Anchor=PopperAnchor,Content$2=PopperContent,Arrow=PopperArrow;function createSlot$3(e){const t=createSlotClone$3(e),n=React__namespace.forwardRef((o,l)=>{const{children:d,...f}=o,g=React__namespace.Children.toArray(d),b=g.find(isSlottable$3);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}function createSlotClone$3(e){const t=React__namespace.forwardRef((n,o)=>{const{children:l,...d}=n;if(React__namespace.isValidElement(l)){const f=getElementRef$3(l),g=mergeProps$3(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER$5=Symbol("radix.slottable");function isSlottable$3(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER$5}function mergeProps$3(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$3(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var SELECTION_KEYS$1=["Enter"," "],FIRST_KEYS=["ArrowDown","PageUp","Home"],LAST_KEYS=["ArrowUp","PageDown","End"],FIRST_LAST_KEYS=[...FIRST_KEYS,...LAST_KEYS],SUB_OPEN_KEYS={ltr:[...SELECTION_KEYS$1,"ArrowRight"],rtl:[...SELECTION_KEYS$1,"ArrowLeft"]},SUB_CLOSE_KEYS={ltr:["ArrowLeft"],rtl:["ArrowRight"]},MENU_NAME="Menu",[Collection$3,useCollection$3,createCollectionScope$3]=createCollection(MENU_NAME),[createMenuContext,createMenuScope]=createContextScope$2(MENU_NAME,[createCollectionScope$3,createPopperScope,createRovingFocusGroupScope]),usePopperScope$3=createPopperScope(),useRovingFocusGroupScope$1=createRovingFocusGroupScope(),[MenuProvider,useMenuContext]=createMenuContext(MENU_NAME),[MenuRootProvider,useMenuRootContext]=createMenuContext(MENU_NAME),Menu=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:l,onOpenChange:d,modal:f=!0}=e,g=usePopperScope$3(t),[b,_]=React__namespace.useState(null),S=React__namespace.useRef(!1),R=useCallbackRef$1(d),C=useDirection(l);return React__namespace.useEffect(()=>{const E=()=>{S.current=!0,document.addEventListener("pointerdown",A,{capture:!0,once:!0}),document.addEventListener("pointermove",A,{capture:!0,once:!0})},A=()=>S.current=!1;return document.addEventListener("keydown",E,{capture:!0}),()=>{document.removeEventListener("keydown",E,{capture:!0}),document.removeEventListener("pointerdown",A,{capture:!0}),document.removeEventListener("pointermove",A,{capture:!0})}},[]),jsxRuntime.jsx(Root2$7,{...g,children:jsxRuntime.jsx(MenuProvider,{scope:t,open:n,onOpenChange:R,content:b,onContentChange:_,children:jsxRuntime.jsx(MenuRootProvider,{scope:t,onClose:React__namespace.useCallback(()=>R(!1),[R]),isUsingKeyboardRef:S,dir:C,modal:f,children:o})})})};Menu.displayName=MENU_NAME;var ANCHOR_NAME$1="MenuAnchor",MenuAnchor=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,l=usePopperScope$3(n);return jsxRuntime.jsx(Anchor,{...l,...o,ref:t})});MenuAnchor.displayName=ANCHOR_NAME$1;var PORTAL_NAME$5="MenuPortal",[PortalProvider$2,usePortalContext$2]=createMenuContext(PORTAL_NAME$5,{forceMount:void 0}),MenuPortal=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:l}=e,d=useMenuContext(PORTAL_NAME$5,t);return jsxRuntime.jsx(PortalProvider$2,{scope:t,forceMount:n,children:jsxRuntime.jsx(Presence,{present:n||d.open,children:jsxRuntime.jsx(Portal$5,{asChild:!0,container:l,children:o})})})};MenuPortal.displayName=PORTAL_NAME$5;var CONTENT_NAME$8="MenuContent",[MenuContentProvider,useMenuContentContext]=createMenuContext(CONTENT_NAME$8),MenuContent=React__namespace.forwardRef((e,t)=>{const n=usePortalContext$2(CONTENT_NAME$8,e.__scopeMenu),{forceMount:o=n.forceMount,...l}=e,d=useMenuContext(CONTENT_NAME$8,e.__scopeMenu),f=useMenuRootContext(CONTENT_NAME$8,e.__scopeMenu);return jsxRuntime.jsx(Collection$3.Provider,{scope:e.__scopeMenu,children:jsxRuntime.jsx(Presence,{present:o||d.open,children:jsxRuntime.jsx(Collection$3.Slot,{scope:e.__scopeMenu,children:f.modal?jsxRuntime.jsx(MenuRootContentModal,{...l,ref:t}):jsxRuntime.jsx(MenuRootContentNonModal,{...l,ref:t})})})})}),MenuRootContentModal=React__namespace.forwardRef((e,t)=>{const n=useMenuContext(CONTENT_NAME$8,e.__scopeMenu),o=React__namespace.useRef(null),l=useComposedRefs(t,o);return React__namespace.useEffect(()=>{const d=o.current;if(d)return hideOthers(d)},[]),jsxRuntime.jsx(MenuContentImpl,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:composeEventHandlers(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),MenuRootContentNonModal=React__namespace.forwardRef((e,t)=>{const n=useMenuContext(CONTENT_NAME$8,e.__scopeMenu);return jsxRuntime.jsx(MenuContentImpl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Slot$3=createSlot$3("MenuContent.ScrollLock"),MenuContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:l,onOpenAutoFocus:d,onCloseAutoFocus:f,disableOutsidePointerEvents:g,onEntryFocus:b,onEscapeKeyDown:_,onPointerDownOutside:S,onFocusOutside:R,onInteractOutside:C,onDismiss:E,disableOutsideScroll:A,...M}=e,I=useMenuContext(CONTENT_NAME$8,n),j=useMenuRootContext(CONTENT_NAME$8,n),q=usePopperScope$3(n),Q=useRovingFocusGroupScope$1(n),te=useCollection$3(n),[F,V]=React__namespace.useState(null),ne=React__namespace.useRef(null),ae=useComposedRefs(t,ne,I.onContentChange),se=React__namespace.useRef(0),$e=React__namespace.useRef(""),Ne=React__namespace.useRef(0),oe=React__namespace.useRef(null),Oe=React__namespace.useRef("right"),Ae=React__namespace.useRef(0),je=A?ReactRemoveScroll:React__namespace.Fragment,Be=A?{as:Slot$3,allowPinchZoom:!0}:void 0,qe=Le=>{var et,at;const Ue=$e.current+Le,We=te().filter(tt=>!tt.disabled),ze=document.activeElement,Qe=(et=We.find(tt=>tt.ref.current===ze))==null?void 0:et.textValue,rt=We.map(tt=>tt.textValue),Je=getNextMatch(rt,Ue,Qe),st=(at=We.find(tt=>tt.textValue===Je))==null?void 0:at.ref.current;(function tt(ot){$e.current=ot,window.clearTimeout(se.current),ot!==""&&(se.current=window.setTimeout(()=>tt(""),1e3))})(Ue),st&&setTimeout(()=>st.focus())};React__namespace.useEffect(()=>()=>window.clearTimeout(se.current),[]),useFocusGuards();const Ve=React__namespace.useCallback(Le=>{var We,ze;return Oe.current===((We=oe.current)==null?void 0:We.side)&&isPointerInGraceArea(Le,(ze=oe.current)==null?void 0:ze.area)},[]);return jsxRuntime.jsx(MenuContentProvider,{scope:n,searchRef:$e,onItemEnter:React__namespace.useCallback(Le=>{Ve(Le)&&Le.preventDefault()},[Ve]),onItemLeave:React__namespace.useCallback(Le=>{var Ue;Ve(Le)||((Ue=ne.current)==null||Ue.focus(),V(null))},[Ve]),onTriggerLeave:React__namespace.useCallback(Le=>{Ve(Le)&&Le.preventDefault()},[Ve]),pointerGraceTimerRef:Ne,onPointerGraceIntentChange:React__namespace.useCallback(Le=>{oe.current=Le},[]),children:jsxRuntime.jsx(je,{...Be,children:jsxRuntime.jsx(FocusScope,{asChild:!0,trapped:l,onMountAutoFocus:composeEventHandlers(d,Le=>{var Ue;Le.preventDefault(),(Ue=ne.current)==null||Ue.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:jsxRuntime.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:_,onPointerDownOutside:S,onFocusOutside:R,onInteractOutside:C,onDismiss:E,children:jsxRuntime.jsx(Root$c,{asChild:!0,...Q,dir:j.dir,orientation:"vertical",loop:o,currentTabStopId:F,onCurrentTabStopIdChange:V,onEntryFocus:composeEventHandlers(b,Le=>{j.isUsingKeyboardRef.current||Le.preventDefault()}),preventScrollOnEntryFocus:!0,children:jsxRuntime.jsx(Content$2,{role:"menu","aria-orientation":"vertical","data-state":getOpenState(I.open),"data-radix-menu-content":"",dir:j.dir,...q,...M,ref:ae,style:{outline:"none",...M.style},onKeyDown:composeEventHandlers(M.onKeyDown,Le=>{const We=Le.target.closest("[data-radix-menu-content]")===Le.currentTarget,ze=Le.ctrlKey||Le.altKey||Le.metaKey,Qe=Le.key.length===1;We&&(Le.key==="Tab"&&Le.preventDefault(),!ze&&Qe&&qe(Le.key));const rt=ne.current;if(Le.target!==rt||!FIRST_LAST_KEYS.includes(Le.key))return;Le.preventDefault();const st=te().filter(et=>!et.disabled).map(et=>et.ref.current);LAST_KEYS.includes(Le.key)&&st.reverse(),focusFirst$1(st)}),onBlur:composeEventHandlers(e.onBlur,Le=>{Le.currentTarget.contains(Le.target)||(window.clearTimeout(se.current),$e.current="")}),onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(Le=>{const Ue=Le.target,We=Ae.current!==Le.clientX;if(Le.currentTarget.contains(Ue)&&We){const ze=Le.clientX>Ae.current?"right":"left";Oe.current=ze,Ae.current=Le.clientX}}))})})})})})})});MenuContent.displayName=CONTENT_NAME$8;var GROUP_NAME$2="MenuGroup",MenuGroup=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{role:"group",...o,ref:t})});MenuGroup.displayName=GROUP_NAME$2;var LABEL_NAME$2="MenuLabel",MenuLabel=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{...o,ref:t})});MenuLabel.displayName=LABEL_NAME$2;var ITEM_NAME$3="MenuItem",ITEM_SELECT="menu.itemSelect",MenuItem=React__namespace.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...l}=e,d=React__namespace.useRef(null),f=useMenuRootContext(ITEM_NAME$3,e.__scopeMenu),g=useMenuContentContext(ITEM_NAME$3,e.__scopeMenu),b=useComposedRefs(t,d),_=React__namespace.useRef(!1),S=()=>{const R=d.current;if(!n&&R){const C=new CustomEvent(ITEM_SELECT,{bubbles:!0,cancelable:!0});R.addEventListener(ITEM_SELECT,E=>o==null?void 0:o(E),{once:!0}),dispatchDiscreteCustomEvent(R,C),C.defaultPrevented?_.current=!1:f.onClose()}};return jsxRuntime.jsx(MenuItemImpl,{...l,ref:b,disabled:n,onClick:composeEventHandlers(e.onClick,S),onPointerDown:R=>{var C;(C=e.onPointerDown)==null||C.call(e,R),_.current=!0},onPointerUp:composeEventHandlers(e.onPointerUp,R=>{var C;_.current||(C=R.currentTarget)==null||C.click()}),onKeyDown:composeEventHandlers(e.onKeyDown,R=>{const C=g.searchRef.current!=="";n||C&&R.key===" "||SELECTION_KEYS$1.includes(R.key)&&(R.currentTarget.click(),R.preventDefault())})})});MenuItem.displayName=ITEM_NAME$3;var MenuItemImpl=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:l,...d}=e,f=useMenuContentContext(ITEM_NAME$3,n),g=useRovingFocusGroupScope$1(n),b=React__namespace.useRef(null),_=useComposedRefs(t,b),[S,R]=React__namespace.useState(!1),[C,E]=React__namespace.useState("");return React__namespace.useEffect(()=>{const A=b.current;A&&E((A.textContent??"").trim())},[d.children]),jsxRuntime.jsx(Collection$3.ItemSlot,{scope:n,disabled:o,textValue:l??C,children:jsxRuntime.jsx(Item$3,{asChild:!0,...g,focusable:!o,children:jsxRuntime.jsx(Primitive$4.div,{role:"menuitem","data-highlighted":S?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...d,ref:_,onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(A=>{o?f.onItemLeave(A):(f.onItemEnter(A),A.defaultPrevented||A.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:composeEventHandlers(e.onPointerLeave,whenMouse(A=>f.onItemLeave(A))),onFocus:composeEventHandlers(e.onFocus,()=>R(!0)),onBlur:composeEventHandlers(e.onBlur,()=>R(!1))})})})}),CHECKBOX_ITEM_NAME$1="MenuCheckboxItem",MenuCheckboxItem=React__namespace.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...l}=e;return jsxRuntime.jsx(ItemIndicatorProvider,{scope:e.__scopeMenu,checked:n,children:jsxRuntime.jsx(MenuItem,{role:"menuitemcheckbox","aria-checked":isIndeterminate$1(n)?"mixed":n,...l,ref:t,"data-state":getCheckedState(n),onSelect:composeEventHandlers(l.onSelect,()=>o==null?void 0:o(isIndeterminate$1(n)?!0:!n),{checkForDefaultPrevented:!1})})})});MenuCheckboxItem.displayName=CHECKBOX_ITEM_NAME$1;var RADIO_GROUP_NAME$1="MenuRadioGroup",[RadioGroupProvider,useRadioGroupContext]=createMenuContext(RADIO_GROUP_NAME$1,{value:void 0,onValueChange:()=>{}}),MenuRadioGroup=React__namespace.forwardRef((e,t)=>{const{value:n,onValueChange:o,...l}=e,d=useCallbackRef$1(o);return jsxRuntime.jsx(RadioGroupProvider,{scope:e.__scopeMenu,value:n,onValueChange:d,children:jsxRuntime.jsx(MenuGroup,{...l,ref:t})})});MenuRadioGroup.displayName=RADIO_GROUP_NAME$1;var RADIO_ITEM_NAME$1="MenuRadioItem",MenuRadioItem=React__namespace.forwardRef((e,t)=>{const{value:n,...o}=e,l=useRadioGroupContext(RADIO_ITEM_NAME$1,e.__scopeMenu),d=n===l.value;return jsxRuntime.jsx(ItemIndicatorProvider,{scope:e.__scopeMenu,checked:d,children:jsxRuntime.jsx(MenuItem,{role:"menuitemradio","aria-checked":d,...o,ref:t,"data-state":getCheckedState(d),onSelect:composeEventHandlers(o.onSelect,()=>{var f;return(f=l.onValueChange)==null?void 0:f.call(l,n)},{checkForDefaultPrevented:!1})})})});MenuRadioItem.displayName=RADIO_ITEM_NAME$1;var ITEM_INDICATOR_NAME$1="MenuItemIndicator",[ItemIndicatorProvider,useItemIndicatorContext]=createMenuContext(ITEM_INDICATOR_NAME$1,{checked:!1}),MenuItemIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...l}=e,d=useItemIndicatorContext(ITEM_INDICATOR_NAME$1,n);return jsxRuntime.jsx(Presence,{present:o||isIndeterminate$1(d.checked)||d.checked===!0,children:jsxRuntime.jsx(Primitive$4.span,{...l,ref:t,"data-state":getCheckedState(d.checked)})})});MenuItemIndicator.displayName=ITEM_INDICATOR_NAME$1;var SEPARATOR_NAME$2="MenuSeparator",MenuSeparator=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});MenuSeparator.displayName=SEPARATOR_NAME$2;var ARROW_NAME$4="MenuArrow",MenuArrow=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,l=usePopperScope$3(n);return jsxRuntime.jsx(Arrow,{...l,...o,ref:t})});MenuArrow.displayName=ARROW_NAME$4;var SUB_NAME="MenuSub",[MenuSubProvider,useMenuSubContext]=createMenuContext(SUB_NAME),MenuSub=e=>{const{__scopeMenu:t,children:n,open:o=!1,onOpenChange:l}=e,d=useMenuContext(SUB_NAME,t),f=usePopperScope$3(t),[g,b]=React__namespace.useState(null),[_,S]=React__namespace.useState(null),R=useCallbackRef$1(l);return React__namespace.useEffect(()=>(d.open===!1&&R(!1),()=>R(!1)),[d.open,R]),jsxRuntime.jsx(Root2$7,{...f,children:jsxRuntime.jsx(MenuProvider,{scope:t,open:o,onOpenChange:R,content:_,onContentChange:S,children:jsxRuntime.jsx(MenuSubProvider,{scope:t,contentId:useId(),triggerId:useId(),trigger:g,onTriggerChange:b,children:n})})})};MenuSub.displayName=SUB_NAME;var SUB_TRIGGER_NAME$1="MenuSubTrigger",MenuSubTrigger=React__namespace.forwardRef((e,t)=>{const n=useMenuContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),o=useMenuRootContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),l=useMenuSubContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),d=useMenuContentContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),f=React__namespace.useRef(null),{pointerGraceTimerRef:g,onPointerGraceIntentChange:b}=d,_={__scopeMenu:e.__scopeMenu},S=React__namespace.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null},[]);return React__namespace.useEffect(()=>S,[S]),React__namespace.useEffect(()=>{const R=g.current;return()=>{window.clearTimeout(R),b(null)}},[g,b]),jsxRuntime.jsx(MenuAnchor,{asChild:!0,..._,children:jsxRuntime.jsx(MenuItemImpl,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":l.contentId,"data-state":getOpenState(n.open),...e,ref:composeRefs(t,l.onTriggerChange),onClick:R=>{var C;(C=e.onClick)==null||C.call(e,R),!(e.disabled||R.defaultPrevented)&&(R.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(R=>{d.onItemEnter(R),!R.defaultPrevented&&!e.disabled&&!n.open&&!f.current&&(d.onPointerGraceIntentChange(null),f.current=window.setTimeout(()=>{n.onOpenChange(!0),S()},100))})),onPointerLeave:composeEventHandlers(e.onPointerLeave,whenMouse(R=>{var E,A;S();const C=(E=n.content)==null?void 0:E.getBoundingClientRect();if(C){const M=(A=n.content)==null?void 0:A.dataset.side,I=M==="right",j=I?-5:5,q=C[I?"left":"right"],Q=C[I?"right":"left"];d.onPointerGraceIntentChange({area:[{x:R.clientX+j,y:R.clientY},{x:q,y:C.top},{x:Q,y:C.top},{x:Q,y:C.bottom},{x:q,y:C.bottom}],side:M}),window.clearTimeout(g.current),g.current=window.setTimeout(()=>d.onPointerGraceIntentChange(null),300)}else{if(d.onTriggerLeave(R),R.defaultPrevented)return;d.onPointerGraceIntentChange(null)}})),onKeyDown:composeEventHandlers(e.onKeyDown,R=>{var E;const C=d.searchRef.current!=="";e.disabled||C&&R.key===" "||SUB_OPEN_KEYS[o.dir].includes(R.key)&&(n.onOpenChange(!0),(E=n.content)==null||E.focus(),R.preventDefault())})})})});MenuSubTrigger.displayName=SUB_TRIGGER_NAME$1;var SUB_CONTENT_NAME$1="MenuSubContent",MenuSubContent=React__namespace.forwardRef((e,t)=>{const n=usePortalContext$2(CONTENT_NAME$8,e.__scopeMenu),{forceMount:o=n.forceMount,...l}=e,d=useMenuContext(CONTENT_NAME$8,e.__scopeMenu),f=useMenuRootContext(CONTENT_NAME$8,e.__scopeMenu),g=useMenuSubContext(SUB_CONTENT_NAME$1,e.__scopeMenu),b=React__namespace.useRef(null),_=useComposedRefs(t,b);return jsxRuntime.jsx(Collection$3.Provider,{scope:e.__scopeMenu,children:jsxRuntime.jsx(Presence,{present:o||d.open,children:jsxRuntime.jsx(Collection$3.Slot,{scope:e.__scopeMenu,children:jsxRuntime.jsx(MenuContentImpl,{id:g.contentId,"aria-labelledby":g.triggerId,...l,ref:_,align:"start",side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:S=>{var R;f.isUsingKeyboardRef.current&&((R=b.current)==null||R.focus()),S.preventDefault()},onCloseAutoFocus:S=>S.preventDefault(),onFocusOutside:composeEventHandlers(e.onFocusOutside,S=>{S.target!==g.trigger&&d.onOpenChange(!1)}),onEscapeKeyDown:composeEventHandlers(e.onEscapeKeyDown,S=>{f.onClose(),S.preventDefault()}),onKeyDown:composeEventHandlers(e.onKeyDown,S=>{var E;const R=S.currentTarget.contains(S.target),C=SUB_CLOSE_KEYS[f.dir].includes(S.key);R&&C&&(d.onOpenChange(!1),(E=g.trigger)==null||E.focus(),S.preventDefault())})})})})})});MenuSubContent.displayName=SUB_CONTENT_NAME$1;function getOpenState(e){return e?"open":"closed"}function isIndeterminate$1(e){return e==="indeterminate"}function getCheckedState(e){return isIndeterminate$1(e)?"indeterminate":e?"checked":"unchecked"}function focusFirst$1(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function wrapArray$1(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function getNextMatch(e,t,n){const l=t.length>1&&Array.from(t).every(_=>_===t[0])?t[0]:t,d=n?e.indexOf(n):-1;let f=wrapArray$1(e,Math.max(d,0));l.length===1&&(f=f.filter(_=>_!==n));const b=f.find(_=>_.toLowerCase().startsWith(l.toLowerCase()));return b!==n?b:void 0}function isPointInPolygon$1(e,t){const{x:n,y:o}=e;let l=!1;for(let d=0,f=t.length-1;d<t.length;f=d++){const g=t[d],b=t[f],_=g.x,S=g.y,R=b.x,C=b.y;S>o!=C>o&&n<(R-_)*(o-S)/(C-S)+_&&(l=!l)}return l}function isPointerInGraceArea(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return isPointInPolygon$1(n,t)}function whenMouse(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Root3$1=Menu,Anchor2$1=MenuAnchor,Portal$3=MenuPortal,Content2$6=MenuContent,Group$1=MenuGroup,Label$4=MenuLabel,Item2$1=MenuItem,CheckboxItem=MenuCheckboxItem,RadioGroup=MenuRadioGroup,RadioItem=MenuRadioItem,ItemIndicator$1=MenuItemIndicator,Separator$3=MenuSeparator,Arrow2=MenuArrow,Sub=MenuSub,SubTrigger=MenuSubTrigger,SubContent=MenuSubContent,DROPDOWN_MENU_NAME="DropdownMenu",[createDropdownMenuContext]=createContextScope$2(DROPDOWN_MENU_NAME,[createMenuScope]),useMenuScope=createMenuScope(),[DropdownMenuProvider,useDropdownMenuContext]=createDropdownMenuContext(DROPDOWN_MENU_NAME),DropdownMenu$1=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:l,defaultOpen:d,onOpenChange:f,modal:g=!0}=e,b=useMenuScope(t),_=React__namespace.useRef(null),[S,R]=useControllableState({prop:l,defaultProp:d??!1,onChange:f,caller:DROPDOWN_MENU_NAME});return jsxRuntime.jsx(DropdownMenuProvider,{scope:t,triggerId:useId(),triggerRef:_,contentId:useId(),open:S,onOpenChange:R,onOpenToggle:React__namespace.useCallback(()=>R(C=>!C),[R]),modal:g,children:jsxRuntime.jsx(Root3$1,{...b,open:S,onOpenChange:R,dir:o,modal:g,children:n})})};DropdownMenu$1.displayName=DROPDOWN_MENU_NAME;var TRIGGER_NAME$8="DropdownMenuTrigger",DropdownMenuTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...l}=e,d=useDropdownMenuContext(TRIGGER_NAME$8,n),f=useMenuScope(n);return jsxRuntime.jsx(Anchor2$1,{asChild:!0,...f,children:jsxRuntime.jsx(Primitive$4.button,{type:"button",id:d.triggerId,"aria-haspopup":"menu","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":d.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...l,ref:composeRefs(t,d.triggerRef),onPointerDown:composeEventHandlers(e.onPointerDown,g=>{!o&&g.button===0&&g.ctrlKey===!1&&(d.onOpenToggle(),d.open||g.preventDefault())}),onKeyDown:composeEventHandlers(e.onKeyDown,g=>{o||(["Enter"," "].includes(g.key)&&d.onOpenToggle(),g.key==="ArrowDown"&&d.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})});DropdownMenuTrigger$1.displayName=TRIGGER_NAME$8;var PORTAL_NAME$4="DropdownMenuPortal",DropdownMenuPortal$1=e=>{const{__scopeDropdownMenu:t,...n}=e,o=useMenuScope(t);return jsxRuntime.jsx(Portal$3,{...o,...n})};DropdownMenuPortal$1.displayName=PORTAL_NAME$4;var CONTENT_NAME$7="DropdownMenuContent",DropdownMenuContent$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useDropdownMenuContext(CONTENT_NAME$7,n),d=useMenuScope(n),f=React__namespace.useRef(!1);return jsxRuntime.jsx(Content2$6,{id:l.contentId,"aria-labelledby":l.triggerId,...d,...o,ref:t,onCloseAutoFocus:composeEventHandlers(e.onCloseAutoFocus,g=>{var b;f.current||(b=l.triggerRef.current)==null||b.focus(),f.current=!1,g.preventDefault()}),onInteractOutside:composeEventHandlers(e.onInteractOutside,g=>{const b=g.detail.originalEvent,_=b.button===0&&b.ctrlKey===!0,S=b.button===2||_;(!l.modal||S)&&(f.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)"}})});DropdownMenuContent$1.displayName=CONTENT_NAME$7;var GROUP_NAME$1="DropdownMenuGroup",DropdownMenuGroup$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Group$1,{...l,...o,ref:t})});DropdownMenuGroup$1.displayName=GROUP_NAME$1;var LABEL_NAME$1="DropdownMenuLabel",DropdownMenuLabel$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Label$4,{...l,...o,ref:t})});DropdownMenuLabel$1.displayName=LABEL_NAME$1;var ITEM_NAME$2="DropdownMenuItem",DropdownMenuItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Item2$1,{...l,...o,ref:t})});DropdownMenuItem$1.displayName=ITEM_NAME$2;var CHECKBOX_ITEM_NAME="DropdownMenuCheckboxItem",DropdownMenuCheckboxItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(CheckboxItem,{...l,...o,ref:t})});DropdownMenuCheckboxItem$1.displayName=CHECKBOX_ITEM_NAME;var RADIO_GROUP_NAME="DropdownMenuRadioGroup",DropdownMenuRadioGroup$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(RadioGroup,{...l,...o,ref:t})});DropdownMenuRadioGroup$1.displayName=RADIO_GROUP_NAME;var RADIO_ITEM_NAME="DropdownMenuRadioItem",DropdownMenuRadioItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(RadioItem,{...l,...o,ref:t})});DropdownMenuRadioItem$1.displayName=RADIO_ITEM_NAME;var INDICATOR_NAME$2="DropdownMenuItemIndicator",DropdownMenuItemIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(ItemIndicator$1,{...l,...o,ref:t})});DropdownMenuItemIndicator.displayName=INDICATOR_NAME$2;var SEPARATOR_NAME$1="DropdownMenuSeparator",DropdownMenuSeparator$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Separator$3,{...l,...o,ref:t})});DropdownMenuSeparator$1.displayName=SEPARATOR_NAME$1;var ARROW_NAME$3="DropdownMenuArrow",DropdownMenuArrow=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Arrow2,{...l,...o,ref:t})});DropdownMenuArrow.displayName=ARROW_NAME$3;var DropdownMenuSub$1=e=>{const{__scopeDropdownMenu:t,children:n,open:o,onOpenChange:l,defaultOpen:d}=e,f=useMenuScope(t),[g,b]=useControllableState({prop:o,defaultProp:d??!1,onChange:l,caller:"DropdownMenuSub"});return jsxRuntime.jsx(Sub,{...f,open:g,onOpenChange:b,children:n})},SUB_TRIGGER_NAME="DropdownMenuSubTrigger",DropdownMenuSubTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(SubTrigger,{...l,...o,ref:t})});DropdownMenuSubTrigger$1.displayName=SUB_TRIGGER_NAME;var SUB_CONTENT_NAME="DropdownMenuSubContent",DropdownMenuSubContent$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(SubContent,{...l,...o,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)"}})});DropdownMenuSubContent$1.displayName=SUB_CONTENT_NAME;var Root2$6=DropdownMenu$1,Trigger$5=DropdownMenuTrigger$1,Portal2$1=DropdownMenuPortal$1,Content2$5=DropdownMenuContent$1,Group2=DropdownMenuGroup$1,Label2=DropdownMenuLabel$1,Item2=DropdownMenuItem$1,CheckboxItem2=DropdownMenuCheckboxItem$1,RadioGroup2=DropdownMenuRadioGroup$1,RadioItem2=DropdownMenuRadioItem$1,ItemIndicator2=DropdownMenuItemIndicator,Separator2=DropdownMenuSeparator$1,Sub2=DropdownMenuSub$1,SubTrigger2=DropdownMenuSubTrigger$1,SubContent2=DropdownMenuSubContent$1;const DropdownMenu=Root2$6,DropdownMenuTrigger=Trigger$5,DropdownMenuGroup=Group2,DropdownMenuPortal=Portal2$1,DropdownMenuSub=Sub2,DropdownMenuRadioGroup=RadioGroup2,DropdownMenuSubTrigger=React__namespace.forwardRef(({className:e,inset:t,children:n,...o},l)=>jsxRuntime.jsxs(SubTrigger2,{ref:l,className:cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[n,jsxRuntime.jsx(ChevronRight,{className:"ml-auto"})]}));DropdownMenuSubTrigger.displayName=SubTrigger2.displayName;const DropdownMenuSubContent=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(SubContent2,{ref:n,className:cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));DropdownMenuSubContent.displayName=SubContent2.displayName;const DropdownMenuContent=React__namespace.forwardRef(({className:e,sideOffset:t=4,...n},o)=>jsxRuntime.jsx(Portal2$1,{children:jsxRuntime.jsx(Content2$5,{ref:o,sideOffset:t,className:cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...n})}));DropdownMenuContent.displayName=Content2$5.displayName;const DropdownMenuItem=React__namespace.forwardRef(({className:e,inset:t,...n},o)=>jsxRuntime.jsx(Item2,{ref:o,className:cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));DropdownMenuItem.displayName=Item2.displayName;const DropdownMenuCheckboxItem=React__namespace.forwardRef(({className:e,children:t,checked:n,...o},l)=>jsxRuntime.jsxs(CheckboxItem2,{ref:l,className:cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ItemIndicator2,{children:jsxRuntime.jsx(Check,{className:"h-4 w-4"})})}),t]}));DropdownMenuCheckboxItem.displayName=CheckboxItem2.displayName;const DropdownMenuRadioItem=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsxs(RadioItem2,{ref:o,className:cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ItemIndicator2,{children:jsxRuntime.jsx(Circle,{className:"h-2 w-2 fill-current"})})}),t]}));DropdownMenuRadioItem.displayName=RadioItem2.displayName;const DropdownMenuLabel=React__namespace.forwardRef(({className:e,inset:t,...n},o)=>jsxRuntime.jsx(Label2,{ref:o,className:cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));DropdownMenuLabel.displayName=Label2.displayName;const DropdownMenuSeparator=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Separator2,{ref:n,className:cn("-mx-1 my-1 h-px bg-muted",e),...t}));DropdownMenuSeparator.displayName=Separator2.displayName;const DropdownMenuShortcut=({className:e,...t})=>jsxRuntime.jsx("span",{className:cn("ml-auto text-xs tracking-widest opacity-60",e),...t});DropdownMenuShortcut.displayName="DropdownMenuShortcut";var REACT_LAZY_TYPE=Symbol.for("react.lazy"),use=React__namespace[" use ".trim().toString()];function isPromiseLike(e){return typeof e=="object"&&e!==null&&"then"in e}function isLazyComponent(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===REACT_LAZY_TYPE&&"_payload"in e&&isPromiseLike(e._payload)}function createSlot$2(e){const t=createSlotClone$2(e),n=React__namespace.forwardRef((o,l)=>{let{children:d,...f}=o;isLazyComponent(d)&&typeof use=="function"&&(d=use(d._payload));const g=React__namespace.Children.toArray(d),b=g.find(isSlottable$2);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}var Slot$2=createSlot$2("Slot");function createSlotClone$2(e){const t=React__namespace.forwardRef((n,o)=>{let{children:l,...d}=n;if(isLazyComponent(l)&&typeof use=="function"&&(l=use(l._payload)),React__namespace.isValidElement(l)){const f=getElementRef$2(l),g=mergeProps$2(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER$4=Symbol("radix.slottable");function isSlottable$2(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER$4}function mergeProps$2(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$2(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const falsyToString=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cx=clsx,cva=(e,t)=>n=>{var o;if((t==null?void 0:t.variants)==null)return cx(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:d}=t,f=Object.keys(l).map(_=>{const S=n==null?void 0:n[_],R=d==null?void 0:d[_];if(S===null)return null;const C=falsyToString(S)||falsyToString(R);return l[_][C]}),g=n&&Object.entries(n).reduce((_,S)=>{let[R,C]=S;return C===void 0||(_[R]=C),_},{}),b=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((_,S)=>{let{class:R,className:C,...E}=S;return Object.entries(E).every(A=>{let[M,I]=A;return Array.isArray(I)?I.includes({...d,...g}[M]):{...d,...g}[M]===I})?[..._,R,C]:_},[]);return cx(e,f,b,n==null?void 0:n.class,n==null?void 0:n.className)},buttonVariants=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",outline:"border border-input text-foreground bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",defaultOutline:"border border-red-600/30 text-red-600 bg-background shadow-xs hover:bg-red-600/5 ",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",blue:"bg-randmar-blue text-gray-100 shadow-sm hover:bg-randmar-blue/90",red:"bg-randmar-red text-gray-100 shadow-sm hover:bg-randmar-red/90",purple:"bg-randmar-purple text-gray-100 shadow-sm hover:bg-randmar-purple/90",none:""},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Button$1=React__namespace.forwardRef(({className:e,variant:t,size:n,asChild:o=!1,confirmationDialog:l,onClick:d,...f},g)=>{const b=o?Slot$2:"button";if(!l)return jsxRuntime.jsx(b,{className:cn(buttonVariants({variant:t,size:n,className:e})),ref:g,onClick:d,...f});d&&console.warn("Button: You provided both onClick and confirmationDialog props. The onClick prop will be ignored. Use the onConfirm callback in confirmationDialog instead.");const{title:_,content:S,onConfirm:R,confirmText:C="Confirm",cancelText:E="Cancel"}=l,A=()=>{R()};return jsxRuntime.jsxs(Dialog,{children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsx(b,{className:cn(buttonVariants({variant:t,size:n,className:e})),ref:g,...f})}),jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:_}),jsxRuntime.jsx(DialogDescription,{children:S})]}),jsxRuntime.jsxs(DialogFooter,{className:"flex justify-end gap-2 pt-4",children:[jsxRuntime.jsx(DialogClose,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"outline",children:E})}),jsxRuntime.jsx(DialogClose,{asChild:!0,children:jsxRuntime.jsx(Button$1,{onClick:A,children:C})})]})]})]})});Button$1.displayName="Button";function formatProdErrorMessage$1(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var randomString=()=>Math.random().toString(36).substring(7).split("").join("."),ActionTypes={INIT:`@@redux/INIT${randomString()}`,REPLACE:`@@redux/REPLACE${randomString()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString()}`},actionTypes_default=ActionTypes;function isPlainObject$4(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function miniKindOf(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(isDate$1(e))return"date";if(isError(e))return"error";const n=ctorName(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function ctorName(e){return typeof e.constructor=="function"?e.constructor.name:null}function isError(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function isDate$1(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function kindOf(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=miniKindOf(e)),t}function warning(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function getUnexpectedStateShapeWarningMessage(e,t,n,o){const l=Object.keys(t),d=n&&n.type===actionTypes_default.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(l.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!isPlainObject$4(e))return`The ${d} has unexpected type of "${kindOf(e)}". Expected argument to be an object with the following keys: "${l.join('", "')}"`;const f=Object.keys(e).filter(g=>!t.hasOwnProperty(g)&&!o[g]);if(f.forEach(g=>{o[g]=!0}),!(n&&n.type===actionTypes_default.REPLACE)&&f.length>0)return`Unexpected ${f.length>1?"keys":"key"} "${f.join('", "')}" found in ${d}. Expected to find one of the known reducer keys instead: "${l.join('", "')}". Unexpected keys will be ignored.`}function assertReducerShape(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:actionTypes_default.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?formatProdErrorMessage$1(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:actionTypes_default.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?formatProdErrorMessage$1(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function combineReducers(e){const t=Object.keys(e),n={};for(let f=0;f<t.length;f++){const g=t[f];process.env.NODE_ENV!=="production"&&typeof e[g]>"u"&&warning(`No reducer provided for key "${g}"`),typeof e[g]=="function"&&(n[g]=e[g])}const o=Object.keys(n);let l;process.env.NODE_ENV!=="production"&&(l={});let d;try{assertReducerShape(n)}catch(f){d=f}return function(g={},b){if(d)throw d;if(process.env.NODE_ENV!=="production"){const R=getUnexpectedStateShapeWarningMessage(g,n,b,l);R&&warning(R)}let _=!1;const S={};for(let R=0;R<o.length;R++){const C=o[R],E=n[C],A=g[C],M=E(A,b);if(typeof M>"u"){const I=b&&b.type;throw new Error(process.env.NODE_ENV==="production"?formatProdErrorMessage$1(14):`When called with an action of type ${I?`"${String(I)}"`:"(unknown type)"}, the slice reducer for key "${C}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}S[C]=M,_=_||M!==A}return _=_||o.length!==Object.keys(g).length,_?S:g}}function isAction(e){return isPlainObject$4(e)&&"type"in e&&typeof e.type=="string"}var NOTHING=Symbol.for("immer-nothing"),DRAFTABLE=Symbol.for("immer-draftable"),DRAFT_STATE=Symbol.for("immer-state"),errors=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function die(e,...t){if(process.env.NODE_ENV!=="production"){const n=errors[e],o=isFunction$6(n)?n.apply(null,t):n;throw new Error(`[Immer] ${o}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var O=Object,getPrototypeOf$1=O.getPrototypeOf,CONSTRUCTOR="constructor",PROTOTYPE="prototype",CONFIGURABLE="configurable",ENUMERABLE="enumerable",WRITABLE="writable",VALUE="value",isDraft=e=>!!e&&!!e[DRAFT_STATE];function isDraftable(e){var t;return e?isPlainObject$3(e)||isArray$3(e)||!!e[DRAFTABLE]||!!((t=e[CONSTRUCTOR])!=null&&t[DRAFTABLE])||isMap(e)||isSet(e):!1}var objectCtorString=O[PROTOTYPE][CONSTRUCTOR].toString(),cachedCtorStrings=new WeakMap;function isPlainObject$3(e){if(!e||!isObjectish(e))return!1;const t=getPrototypeOf$1(e);if(t===null||t===O[PROTOTYPE])return!0;const n=O.hasOwnProperty.call(t,CONSTRUCTOR)&&t[CONSTRUCTOR];if(n===Object)return!0;if(!isFunction$6(n))return!1;let o=cachedCtorStrings.get(n);return o===void 0&&(o=Function.toString.call(n),cachedCtorStrings.set(n,o)),o===objectCtorString}function original(e){return isDraft(e)||die(15,e),e[DRAFT_STATE].base_}function each(e,t,n=!0){getArchtype(e)===0?(n?Reflect.ownKeys(e):O.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((o,l)=>t(l,o,e))}function getArchtype(e){const t=e[DRAFT_STATE];return t?t.type_:isArray$3(e)?1:isMap(e)?2:isSet(e)?3:0}var has$1=(e,t,n=getArchtype(e))=>n===2?e.has(t):O[PROTOTYPE].hasOwnProperty.call(e,t),get$3=(e,t,n=getArchtype(e))=>n===2?e.get(t):e[t],set$2=(e,t,n,o=getArchtype(e))=>{o===2?e.set(t,n):o===3?e.add(n):e[t]=n};function is$1(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var isArray$3=Array.isArray,isMap=e=>e instanceof Map,isSet=e=>e instanceof Set,isObjectish=e=>typeof e=="object",isFunction$6=e=>typeof e=="function",isBoolean$2=e=>typeof e=="boolean",getProxyDraft=e=>isObjectish(e)?e==null?void 0:e[DRAFT_STATE]:null,latest=e=>e.copy_||e.base_,getFinalValue=e=>e.modified_?e.copy_:e.base_;function shallowCopy(e,t){if(isMap(e))return new Map(e);if(isSet(e))return new Set(e);if(isArray$3(e))return Array[PROTOTYPE].slice.call(e);const n=isPlainObject$3(e);if(t===!0||t==="class_only"&&!n){const o=O.getOwnPropertyDescriptors(e);delete o[DRAFT_STATE];let l=Reflect.ownKeys(o);for(let d=0;d<l.length;d++){const f=l[d],g=o[f];g[WRITABLE]===!1&&(g[WRITABLE]=!0,g[CONFIGURABLE]=!0),(g.get||g.set)&&(o[f]={[CONFIGURABLE]:!0,[WRITABLE]:!0,[ENUMERABLE]:g[ENUMERABLE],[VALUE]:e[f]})}return O.create(getPrototypeOf$1(e),o)}else{const o=getPrototypeOf$1(e);if(o!==null&&n)return{...e};const l=O.create(o);return O.assign(l,e)}}function freeze$1(e,t=!1){return isFrozen$1(e)||isDraft(e)||!isDraftable(e)||(getArchtype(e)>1&&O.defineProperties(e,{set:dontMutateMethodOverride,add:dontMutateMethodOverride,clear:dontMutateMethodOverride,delete:dontMutateMethodOverride}),O.freeze(e),t&&each(e,(n,o)=>{freeze$1(o,!0)},!1)),e}function dontMutateFrozenCollections(){die(2)}var dontMutateMethodOverride={[VALUE]:dontMutateFrozenCollections};function isFrozen$1(e){return e===null||!isObjectish(e)?!0:O.isFrozen(e)}var PluginMapSet="MapSet",PluginPatches="Patches",plugins={};function getPlugin(e){const t=plugins[e];return t||die(0,e),t}var isPluginLoaded=e=>!!plugins[e];function loadPlugin(e,t){plugins[e]||(plugins[e]=t)}var currentScope,getCurrentScope=()=>currentScope,createScope=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:isPluginLoaded(PluginMapSet)?getPlugin(PluginMapSet):void 0});function usePatchesInScope(e,t){t&&(e.patchPlugin_=getPlugin(PluginPatches),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function revokeScope(e){leaveScope(e),e.drafts_.forEach(revokeDraft),e.drafts_=null}function leaveScope(e){e===currentScope&&(currentScope=e.parent_)}var enterScope=e=>currentScope=createScope(currentScope,e);function revokeDraft(e){const t=e[DRAFT_STATE];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function processResult(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[DRAFT_STATE].modified_&&(revokeScope(t),die(4)),isDraftable(e)&&(e=finalize(t,e));const{patchPlugin_:l}=t;l&&l.generateReplacementPatches_(n[DRAFT_STATE].base_,e,t)}else e=finalize(t,n);return maybeFreeze(t,e,!0),revokeScope(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==NOTHING?e:void 0}function finalize(e,t){if(isFrozen$1(t))return t;const n=t[DRAFT_STATE];if(!n)return handleValue(t,e.handledSet_,e);if(!isSameScope(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(e);generatePatchesAndFinalize(n,e)}return n.copy_}function maybeFreeze(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&freeze$1(t,n)}function markStateFinalized(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var isSameScope=(e,t)=>e.scope_===t,EMPTY_LOCATIONS_RESULT=[];function updateDraftInParent(e,t,n,o){const l=latest(e),d=e.type_;if(o!==void 0&&get$3(l,o,d)===t){set$2(l,o,n,d);return}if(!e.draftLocations_){const g=e.draftLocations_=new Map;each(l,(b,_)=>{if(isDraft(_)){const S=g.get(_)||[];S.push(b),g.set(_,S)}})}const f=e.draftLocations_.get(t)??EMPTY_LOCATIONS_RESULT;for(const g of f)set$2(l,g,n,d)}function registerChildFinalizationCallback(e,t,n){e.callbacks_.push(function(l){var g;const d=t;if(!d||!isSameScope(d,l))return;(g=l.mapSetPlugin_)==null||g.fixSetContents(d);const f=getFinalValue(d);updateDraftInParent(e,d.draft_??d,f,n),generatePatchesAndFinalize(d,l)})}function generatePatchesAndFinalize(e,t){var o;if(e.modified_&&!e.finalized_&&(e.type_===3||(((o=e.assigned_)==null?void 0:o.size)??0)>0)){const{patchPlugin_:l}=t;if(l){const d=l.getPath(e);d&&l.generatePatches_(e,d,t)}markStateFinalized(e)}}function handleCrossReference(e,t,n){const{scope_:o}=e;if(isDraft(n)){const l=n[DRAFT_STATE];isSameScope(l,o)&&l.callbacks_.push(function(){prepareCopy(e);const f=getFinalValue(l);updateDraftInParent(e,n,f,t)})}else isDraftable(n)&&e.callbacks_.push(function(){const d=latest(e);get$3(d,t,e.type_)===n&&o.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&handleValue(get$3(e.copy_,t,e.type_),o.handledSet_,o)})}function handleValue(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||isDraft(e)||t.has(e)||!isDraftable(e)||isFrozen$1(e)||(t.add(e),each(e,(o,l)=>{if(isDraft(l)){const d=l[DRAFT_STATE];if(isSameScope(d,n)){const f=getFinalValue(d);set$2(e,o,f,e.type_),markStateFinalized(d)}}else isDraftable(l)&&handleValue(l,t,n)})),e}function createProxyProxy(e,t){const n=isArray$3(e),o={type_:n?1:0,scope_:t?t.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let l=o,d=objectTraps;n&&(l=[o],d=arrayTraps);const{revoke:f,proxy:g}=Proxy.revocable(l,d);return o.draft_=g,o.revoke_=f,[g,o]}var objectTraps={get(e,t){if(t===DRAFT_STATE)return e;const n=latest(e);if(!has$1(n,t,e.type_))return readPropFromProto(e,n,t);const o=n[t];if(e.finalized_||!isDraftable(o))return o;if(o===peek(e.base_,t)){prepareCopy(e);const l=e.type_===1?+t:t,d=createProxy(e.scope_,o,e,l);return e.copy_[l]=d}return o},has(e,t){return t in latest(e)},ownKeys(e){return Reflect.ownKeys(latest(e))},set(e,t,n){const o=getDescriptorFromProto(latest(e),t);if(o!=null&&o.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const l=peek(latest(e),t),d=l==null?void 0:l[DRAFT_STATE];if(d&&d.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(is$1(n,l)&&(n!==void 0||has$1(e.base_,t,e.type_)))return!0;prepareCopy(e),markChanged(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),handleCrossReference(e,t,n)),!0},deleteProperty(e,t){return prepareCopy(e),peek(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),markChanged(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=latest(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{[WRITABLE]:!0,[CONFIGURABLE]:e.type_!==1||t!=="length",[ENUMERABLE]:o[ENUMERABLE],[VALUE]:n[t]}},defineProperty(){die(11)},getPrototypeOf(e){return getPrototypeOf$1(e.base_)},setPrototypeOf(){die(12)}},arrayTraps={};each(objectTraps,(e,t)=>{arrayTraps[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}),arrayTraps.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&die(13),arrayTraps.set.call(this,e,t,void 0)},arrayTraps.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&die(14),objectTraps.set.call(this,e[0],t,n,e[0])};function peek(e,t){const n=e[DRAFT_STATE];return(n?latest(n):e)[t]}function readPropFromProto(e,t,n){var l;const o=getDescriptorFromProto(t,n);return o?VALUE in o?o[VALUE]:(l=o.get)==null?void 0:l.call(e.draft_):void 0}function getDescriptorFromProto(e,t){if(!(t in e))return;let n=getPrototypeOf$1(e);for(;n;){const o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=getPrototypeOf$1(n)}}function markChanged(e){e.modified_||(e.modified_=!0,e.parent_&&markChanged(e.parent_))}function prepareCopy(e){e.copy_||(e.assigned_=new Map,e.copy_=shallowCopy(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,o)=>{if(isFunction$6(t)&&!isFunction$6(n)){const d=n;n=t;const f=this;return function(b=d,..._){return f.produce(b,S=>n.call(this,S,..._))}}isFunction$6(n)||die(6),o!==void 0&&!isFunction$6(o)&&die(7);let l;if(isDraftable(t)){const d=enterScope(this),f=createProxy(d,t,void 0);let g=!0;try{l=n(f),g=!1}finally{g?revokeScope(d):leaveScope(d)}return usePatchesInScope(d,o),processResult(l,d)}else if(!t||!isObjectish(t)){if(l=n(t),l===void 0&&(l=t),l===NOTHING&&(l=void 0),this.autoFreeze_&&freeze$1(l,!0),o){const d=[],f=[];getPlugin(PluginPatches).generateReplacementPatches_(t,l,{patches_:d,inversePatches_:f}),o(d,f)}return l}else die(1,t)},this.produceWithPatches=(t,n)=>{if(isFunction$6(t))return(f,...g)=>this.produceWithPatches(f,b=>t(b,...g));let o,l;return[this.produce(t,n,(f,g)=>{o=f,l=g}),o,l]},isBoolean$2(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),isBoolean$2(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),isBoolean$2(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){isDraftable(e)||die(8),isDraft(e)&&(e=current(e));const t=enterScope(this),n=createProxy(t,e,void 0);return n[DRAFT_STATE].isManual_=!0,leaveScope(t),n}finishDraft(e,t){const n=e&&e[DRAFT_STATE];(!n||!n.isManual_)&&die(9);const{scope_:o}=n;return usePatchesInScope(o,t),processResult(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const l=t[n];if(l.path.length===0&&l.op==="replace"){e=l.value;break}}n>-1&&(t=t.slice(n+1));const o=getPlugin(PluginPatches).applyPatches_;return isDraft(e)?o(e,t):this.produce(e,l=>o(l,t))}};function createProxy(e,t,n,o){const[l,d]=isMap(t)?getPlugin(PluginMapSet).proxyMap_(t,n):isSet(t)?getPlugin(PluginMapSet).proxySet_(t,n):createProxyProxy(t,n);return((n==null?void 0:n.scope_)??getCurrentScope()).drafts_.push(l),d.callbacks_=(n==null?void 0:n.callbacks_)??[],d.key_=o,n&&o!==void 0?registerChildFinalizationCallback(n,d,o):d.callbacks_.push(function(b){var S;(S=b.mapSetPlugin_)==null||S.fixSetContents(d);const{patchPlugin_:_}=b;d.modified_&&_&&_.generatePatches_(d,[],b)}),l}function current(e){return isDraft(e)||die(10,e),currentImpl(e)}function currentImpl(e){if(!isDraftable(e)||isFrozen$1(e))return e;const t=e[DRAFT_STATE];let n,o=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=shallowCopy(e,t.scope_.immer_.useStrictShallowCopy_),o=t.scope_.immer_.shouldUseStrictIteration()}else n=shallowCopy(e,!0);return each(n,(l,d)=>{set$2(n,l,currentImpl(d))},o),t&&(t.finalized_=!1),n}function enablePatches(){process.env.NODE_ENV!=="production"&&errors.push('Sets cannot have "replace" patches.',function(A){return"Unsupported patch operation: "+A},function(A){return"Cannot apply patch, path doesn't resolve: "+A},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");function t(A,M=[]){if("key_"in A&&A.key_!==void 0){const I=A.parent_.copy_??A.parent_.base_,j=getProxyDraft(get$3(I,A.key_)),q=get$3(I,A.key_);if(q===void 0||q!==A.draft_&&q!==A.base_&&q!==A.copy_||j!=null&&j.base_!==A.base_)return null;const Q=A.parent_.type_===3;let te;if(Q){const F=A.parent_;te=Array.from(F.drafts_.keys()).indexOf(A.key_)}else te=A.key_;if(!(Q&&I.size>te||has$1(I,te)))return null;M.push(te)}if(A.parent_)return t(A.parent_,M);M.reverse();try{n(A.copy_,M)}catch{return null}return M}function n(A,M){let I=A;for(let j=0;j<M.length-1;j++){const q=M[j];if(I=get$3(I,q),!isObjectish(I)||I===null)throw new Error(`Cannot resolve path at '${M.join("/")}'`)}return I}const o="replace",l="add",d="remove";function f(A,M,I){if(A.scope_.processedForPatches_.has(A))return;A.scope_.processedForPatches_.add(A);const{patches_:j,inversePatches_:q}=I;switch(A.type_){case 0:case 2:return b(A,M,j,q);case 1:return g(A,M,j,q);case 3:return _(A,M,j,q)}}function g(A,M,I,j){let{base_:q,assigned_:Q}=A,te=A.copy_;te.length<q.length&&([q,te]=[te,q],[I,j]=[j,I]);for(let F=0;F<q.length;F++){const V=te[F],ne=q[F];if(Q!=null&&Q.get(F.toString())&&V!==ne){const ae=V==null?void 0:V[DRAFT_STATE];if(ae&&ae.modified_)continue;const se=M.concat([F]);I.push({op:o,path:se,value:E(V)}),j.push({op:o,path:se,value:E(ne)})}}for(let F=q.length;F<te.length;F++){const V=M.concat([F]);I.push({op:l,path:V,value:E(te[F])})}for(let F=te.length-1;q.length<=F;--F){const V=M.concat([F]);j.push({op:d,path:V})}}function b(A,M,I,j){const{base_:q,copy_:Q,type_:te}=A;each(A.assigned_,(F,V)=>{const ne=get$3(q,F,te),ae=get$3(Q,F,te),se=V?has$1(q,F)?o:l:d;if(ne===ae&&se===o)return;const $e=M.concat(F);I.push(se===d?{op:se,path:$e}:{op:se,path:$e,value:E(ae)}),j.push(se===l?{op:d,path:$e}:se===d?{op:l,path:$e,value:E(ne)}:{op:o,path:$e,value:E(ne)})})}function _(A,M,I,j){let{base_:q,copy_:Q}=A,te=0;q.forEach(F=>{if(!Q.has(F)){const V=M.concat([te]);I.push({op:d,path:V,value:F}),j.unshift({op:l,path:V,value:F})}te++}),te=0,Q.forEach(F=>{if(!q.has(F)){const V=M.concat([te]);I.push({op:l,path:V,value:F}),j.unshift({op:d,path:V,value:F})}te++})}function S(A,M,I){const{patches_:j,inversePatches_:q}=I;j.push({op:o,path:[],value:M===NOTHING?void 0:M}),q.push({op:o,path:[],value:A})}function R(A,M){return M.forEach(I=>{const{path:j,op:q}=I;let Q=A;for(let ne=0;ne<j.length-1;ne++){const ae=getArchtype(Q);let se=j[ne];typeof se!="string"&&typeof se!="number"&&(se=""+se),(ae===0||ae===1)&&(se==="__proto__"||se===CONSTRUCTOR)&&die(19),isFunction$6(Q)&&se===PROTOTYPE&&die(19),Q=get$3(Q,se),isObjectish(Q)||die(18,j.join("/"))}const te=getArchtype(Q),F=C(I.value),V=j[j.length-1];switch(q){case o:switch(te){case 2:return Q.set(V,F);case 3:die(16);default:return Q[V]=F}case l:switch(te){case 1:return V==="-"?Q.push(F):Q.splice(V,0,F);case 2:return Q.set(V,F);case 3:return Q.add(F);default:return Q[V]=F}case d:switch(te){case 1:return Q.splice(V,1);case 2:return Q.delete(V);case 3:return Q.delete(I.value);default:return delete Q[V]}default:die(17,q)}}),A}function C(A){if(!isDraftable(A))return A;if(isArray$3(A))return A.map(C);if(isMap(A))return new Map(Array.from(A.entries()).map(([I,j])=>[I,C(j)]));if(isSet(A))return new Set(Array.from(A).map(C));const M=Object.create(getPrototypeOf$1(A));for(const I in A)M[I]=C(A[I]);return has$1(A,DRAFTABLE)&&(M[DRAFTABLE]=A[DRAFTABLE]),M}function E(A){return isDraft(A)?C(A):A}loadPlugin(PluginPatches,{applyPatches_:R,generatePatches_:f,generateReplacementPatches_:S,getPath:t})}var immer=new Immer2,produce=immer.produce,produceWithPatches=immer.produceWithPatches.bind(immer),applyPatches=immer.applyPatches.bind(immer),runIdentityFunctionCheck=(e,t,n)=>{if(t.length===1&&t[0]===n){let o=!1;try{const l={};e(l)===l&&(o=!0)}catch{}if(o){let l;try{throw new Error}catch(d){({stack:l}=d)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
520
520
|
\`createSelector([state => state.todos], todos => todos)\`
|
|
521
521
|
This could lead to inefficient memoization and unnecessary re-renders.
|
|
522
522
|
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:l})}}},runInputStabilityCheck=(e,t,n)=>{const{memoize:o,memoizeOptions:l}=t,{inputSelectorResults:d,inputSelectorResultsCopy:f}=e,g=o(()=>({}),...l);if(!(g.apply(null,d)===g.apply(null,f))){let _;try{throw new Error}catch(S){({stack:_}=S)}console.warn(`An input selector returned a different result when passed same arguments.
|
|
@@ -1370,7 +1370,7 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
|
|
|
1370
1370
|
${S.description}`:S.summary||`${_.toUpperCase()} ${R[R.length-1]}`,parameters:{type:Type.OBJECT,properties:M,required:I}},Q=async ne=>{var se;let ae=`https://api.randmar.io${f}`;try{j.forEach(je=>{const Be=`{${je}}`,qe=je;ae=ae.replace(Be,ne[qe])});const $e=localStorage.getItem("access_token"),Ne={method:_.toUpperCase(),headers:{Authorization:$e?`Bearer ${$e}`:"","Content-Type":"application/json"}},oe=[];if((((se=S.parameters)==null?void 0:se.filter(je=>je.in==="query"))||[]).forEach(je=>{const Be=je.name,qe=ne[Be];qe!=null&&oe.push(`${je.name}=${encodeURIComponent(qe)}`)}),oe.length>0&&(ae+=`?${oe.join("&")}`),_==="post"||_==="put"){const Be=ne[bodyKey];Be&&(Ne.body=Be)}const Ae=await fetch(ae,Ne);if(!Ae.ok){const je=await Ae.text();throw console.error(`[API Function] Error response: ${je}`),new Error(`Error ${Ae.status}: ${je}`)}return await Ae.text()}catch($e){return console.error(`Error in ${A}:`,$e),`I'm sorry, I couldn't retrieve the requested information. Error: ${$e instanceof Error?$e.message:"Unknown error"}`}},te=((n=S.tags)==null?void 0:n.at(0))??"Partner",F=(_==="get"?"Fetching data":"Updating data")+` - Randmar ${te} API.`,V=`${_} ${f}`;d.push({declaration:q,handler:Q,prettyName:F,details:V})}}return deduplicateApiFunctions(d)}catch(o){return console.error("Error fetching API functions:",o),[]}}function promisifyRequest(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function createStore(e,t){let n;const o=()=>{if(n)return n;const l=indexedDB.open(e);return l.onupgradeneeded=()=>l.result.createObjectStore(t),n=promisifyRequest(l),n.then(d=>{d.onclose=()=>n=void 0},()=>{}),n};return(l,d)=>o().then(f=>d(f.transaction(t,l).objectStore(t)))}let defaultGetStoreFunc;function defaultGetStore(){return defaultGetStoreFunc||(defaultGetStoreFunc=createStore("keyval-store","keyval")),defaultGetStoreFunc}function get(e,t=defaultGetStore()){return t("readonly",n=>promisifyRequest(n.get(e)))}function set(e,t,n=defaultGetStore()){return n("readwrite",o=>(o.put(t,e),promisifyRequest(o.transaction)))}const useCachedHeavyApiCalls=(e,t)=>{const[n,o]=React.useState({topProducts:[],updatedAtSecondsSinceEpoch:0}),[l,d]=React.useState(!1),f=12,[g]=useLazyGetV4PartnerByRouteApplicationIdProductsQuery();return React.useEffect(()=>{if(!t){o({topProducts:[],updatedAtSecondsSinceEpoch:0}),d(!1);return}const b=`heavy_api_cache_v5_${e}`,_=f*60*60,S=async()=>{d(!0);try{const C=await g({routeApplicationId:e});if(C.data){const E={topProducts:C.data.filter(A=>(A.OverallPercentileRank??0)>=95).sort((A,M)=>(A.RandmarSKU??"").localeCompare(M.RandmarSKU??"")),updatedAtSecondsSinceEpoch:Math.floor(Date.now()/1e3)};await set(b,E),o(E)}}catch(C){console.error("Failed to fetch products:",C)}finally{d(!1)}},R=async()=>{const C=await get(b);C?Math.floor(Date.now()/1e3)-C.updatedAtSecondsSinceEpoch>_?await S():(o(C),d(!1)):await S()};d(!0),R().catch(C=>{console.error("Failed to process cache, fetching new data",C),S()})},[e,t,g]),{...n,isLoading:l}};function useAIAssistant({userId:e,config:t}){const[n,o]=React.useState(""),[l,d]=React.useState([]),[f,g]=React.useState([]),[b,_]=React.useState([]),[S,R]=React.useState(!1),[C,E]=React.useState([]),[A,M]=React.useState([]),[I,j]=React.useState(0),[q]=useLazyGetV4PartnerByApplicationIdAccountQuery(),[Q]=usePostV4PartnerByApplicationIdGenerationRandmarAssistantMutation(),[te]=usePostV4PartnerByApplicationIdGenerationUploadMutation(),{topProducts:F,isLoading:V}=useCachedHeavyApiCalls(e,t.assistantCachedPreloading);React.useEffect(()=>{const je=async()=>{R(!0);try{const Be=await fetchApiFunctions(),qe={declaration:{name:"set_on_behalf_id",description:"Call this function when the user wants to act on behalf of another one. It will return to you important flags such as: is user specified by the user ID a reseller, manufacturer or an agency?",parameters:{type:Type.OBJECT,properties:{user_id:{type:Type.STRING,description:"The user ID to use going forward."}},required:["user_id"]}},prettyName:"Fetching account details",details:"GET Partner Account",handler:async Ve=>{const Ue=await q({applicationId:Ve.user_id});return JSON.stringify(Ue.data)}};E([...Be,qe])}catch(Be){console.error("Error loading API functions:",Be)}R(!1)};C.length===0&&!S&&je()},[C,S]),React.useEffect(()=>{t.assistantCachedPreloading&&(V?g(je=>[...je,"Preloading Best-Sellers..."]):F.length>0&&g(je=>[...je,"Best-Sellers preloaded."]))},[V,F.length,t.assistantCachedPreloading]),React.useEffect(()=>{if(n||b.length===0)return;o("Handling message...");const[je,Be]=b[0];_(qe=>qe.slice(1)),$e(je,Be)},[n,b]),React.useEffect(()=>{Ae()},[t.assistantThinkHarder,t.assistantCachedPreloading]);const ne=async je=>{const Be=C.find(qe=>qe.declaration.name===je.name);if(!Be){const qe=`Function ${je.name} not found`;return console.error(qe),JSON.stringify({error:qe})}try{return g(qe=>[...qe,[Be.prettyName,`${Be.details} where ${JSON.stringify(je.args,null,2)}`]]),await Be.handler(je.args)}catch(qe){const Ve=`${je.name} failed.`;return console.error(Ve,qe),JSON.stringify({error:Ve,details:qe instanceof Error?qe.message:String(qe)})}},ae=async(je,Be)=>{var qe,Ve,Le;if(Be===0){oe({content:"I've reached my action limit for this request. Please let me know if you'd like me to continue.",timestamp:new Date}),o("");return}try{o("Thinking...");const Ue=await Q({applicationId:e,body:je}).unwrap(),We=Ue.Content,ze=[...je,We],Qe=Ue.ContextUtilization??0;M(ze),j(Qe);const rt=(Ve=(qe=We.Parts)==null?void 0:qe.find(st=>st.Text))==null?void 0:Ve.Text;rt&&oe({content:rt,timestamp:new Date});const Je=((Le=We.Parts)==null?void 0:Le.map(st=>st.FunctionCall).filter(Boolean))??[];if(Je.length>0){o("Using Randmar API...");const st=[];for(const et of Je)if(et!=null&&et.Name){const at=await ne({name:et.Name,args:et.Args??{}});st.push({FunctionResponse:{Name:et.Name,Content:at}})}if(st.length>0){const et={Role:"user",Parts:st},at=[...ze,et];M(at),o("Composing response..."),await ae(at,Be-1);return}}o("")}catch(Ue){console.error("Error during AI interaction:",Ue),oe({content:"I'm sorry, I encountered an error. Please write continue or try again.",timestamp:new Date}),o("")}},se=je=>je==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"||je==="application/vnd.ms-excel"?"text/plain":je,$e=async(je,Be)=>{try{const qe=[{Text:je.trim()}];if(Be){o("Receiving attached file...");const Ue=new File([await Be.arrayBuffer()],Be.name,{type:Be.type}),We=await te({applicationId:e,body:{file:Ue}}).unwrap();qe.push({FileData:{FileUri:We,MimeType:se(Be.type)}})}const Ve={Role:"user",Parts:qe},Le=[...A,Ve];M(Le),await ae(Le,100)}catch(qe){console.error("Error processing user request:",qe),oe({content:"I'm sorry, there was an issue with your request, especially if a file was attached. Please try again.",timestamp:new Date}),o("")}},Ne=(je,Be)=>{if(C.length>0&&!V){if(A.length===0){const Ve=[];if(t.assistantCachedPreloading&&F.length>0){const Le=F.map(Ue=>({RandmarSKU:Ue.RandmarSKU,RandmarTitle:Ue.RandmarTitle,CategoryCode:Ue.Category,UPC:Ue.UPC,ManufName:Ue.ManufacturerName,CategoryName:Ue.ProductType,Desc:Ue.BodyHTML,MAP:Ue.MAP,MSRP:Ue.MSRP,ManufID:Ue.ManufacturerId,MPN:Ue.MPN}));Ve.push(`Here are the current best-selling products: ${JSON.stringify(Le)}.`)}Ve.length>0&&M([{Role:"user",Parts:[{Text:Ve.join(`
|
|
1371
1371
|
|
|
1372
1372
|
`)}]}])}_(Ve=>[...Ve,[je,Be]])}},oe=je=>d(Be=>[...Be,je]),Oe=()=>d([]),Ae=()=>{M([]),_([]),g([]),d([]),o("")};return{handleSubmitToBot:Ne,botMessages:l,clearBotMessages:Oe,botReady:C.length>0&&!V,botStatus:n,debugMessages:f,reset:Ae,contextUsage:I,chatHistory:A}}const DebugMessageDisplay=({debugMessages:e})=>{const[t,n]=React.useState({}),o=l=>{n(d=>({...d,[l]:!d[l]}))};return jsxRuntime.jsx("div",{children:e.map((l,d)=>{if(typeof l=="string")return jsxRuntime.jsx("p",{className:"text-slate-600",children:l},d);{const f=t[d];return jsxRuntime.jsxs("div",{className:"cursor-pointer",onClick:()=>o(d),children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("p",{className:"text-slate-600 mr-2",children:l[0]}),jsxRuntime.jsx("span",{className:"text-slate-500 text-xs",children:f?"▲":"▼"})]}),f&&jsxRuntime.jsx("p",{className:"text-slate-400 pl-4",children:l[1]})]},d)}})})},STORAGE_KEY="appConfig",COOKIE_NAME="appConfig",COOKIE_DOMAIN=".randmar.io",COOKIE_MAX_AGE_DAYS=365,defaultConfig={assistantThinkHarder:!1,assistantCachedPreloading:!1};function setCookie(e,t,n,o){try{const l=new Date(Date.now()+n*24*60*60*1e3).toUTCString(),d=o?`; domain=${o}`:"";document.cookie=`${encodeURIComponent(e)}=${encodeURIComponent(t)}; expires=${l}; path=/${d}; Secure; SameSite=Lax`}catch(l){console.warn("Unable to set cookie",l)}}function getCookie(e){try{const t=document.cookie?document.cookie.split("; "):[];for(const n of t){const[o,...l]=n.split("=");if(decodeURIComponent(o)===e)return decodeURIComponent(l.join("="))}return null}catch(t){return console.warn("Unable to read cookie",t),null}}const useConfig=()=>{const[e,t]=React.useState(()=>{try{const n=getCookie(COOKIE_NAME);if(n){const l=JSON.parse(n);return{...defaultConfig,...l}}const o=window.localStorage.getItem(STORAGE_KEY);if(o){const l=JSON.parse(o);return{...defaultConfig,...l}}return defaultConfig}catch(n){return console.warn("Error reading configuration from storage:",n),defaultConfig}});return React.useEffect(()=>{try{const n=JSON.stringify(e);setCookie(COOKIE_NAME,n,COOKIE_MAX_AGE_DAYS,COOKIE_DOMAIN),window.localStorage.setItem(STORAGE_KEY,n)}catch(n){console.warn("Error persisting configuration:",n)}},[e]),[e,t]},ASSISTANT_ID="RandmarAIChatAssistant",AIChatLayout=React.forwardRef(({userId:e,userName:t,inputRef:n,className:o},l)=>{const[d,f]=React.useState(!1),[g,b]=React.useState(!1),[_]=usePostV4PartnerByApplicationIdAccountDebugFeedbackMutation(),[S,R]=useConfig(),[C,E]=React.useState([]),{handleSubmitToBot:A,botMessages:M,clearBotMessages:I,botReady:j,debugMessages:q,botStatus:Q,reset:te,contextUsage:F,chatHistory:V}=useAIAssistant({userId:e,config:S});React.useEffect(()=>{$e([{partner1:e,partner2:ASSISTANT_ID,name:"Randmar Assistant",unread:0,pending:!1,messages:[],conversationID:-1,lastMessageTime:null}]),b(!0),setTimeout(()=>{var Ze;return(Ze=qe.current)==null?void 0:Ze.focus()},50)},[e]);const[ne,ae]=React.useState(""),[se,$e]=React.useState([]),Ne=React.useRef(null),oe=React.useRef(null),[Oe,Ae]=React.useState(null),[je,Be]=React.useState([]),qe=n||oe,Ve=React.useRef(null),{toast:Le}=useToast(),[Ue]=useLazyGetV4PartnerByApplicationIdGenerationRandmarAssistantInstructionsQuery(),We=()=>se.find(Ye=>!!Ye);React.useEffect(()=>{var Ye;Oe!==null&&(Le({title:"File attached",description:"Add your instruction before sending.",variant:"success"}),(Ye=qe.current)==null||Ye.focus())},[Oe]),React.useEffect(()=>{M.length!==0&&(M.forEach(Ye=>{if(!Ye||Ye.isComponent)return;const Ze={id:Ye.timestamp.toString(),fromPartnerID:ASSISTANT_ID,toPartnerID:e,senderName:"Assistant",timestamp:Ye.timestamp.getTime(),content:Ye.content};ze(Ze)}),I())},[M]);const ze=Ye=>E(Ze=>[...Ze,Ye]);React.useEffect(()=>{C.length!=0&&(console.log(C.length,"unprocessedMessages detected"),C.forEach(Ye=>{$e(Ze=>Ze.map(ct=>ct.messages.some(mt=>mt.id===Ye.id)?ct:(setTimeout(()=>{var mt;return(mt=Ne.current)==null?void 0:mt.scrollIntoView({behavior:"smooth"})},50),{...ct,messages:[...ct.messages,Ye]})))}),E([]))},[C,E,$e]);const Qe=(Ye,Ze)=>{Ze=Ze.replace(/\n/g,`
|
|
1373
|
-
`),console.log("doSend",Ze),console.log("target",Ye);const ct={id:crypto.randomUUID(),senderName:t,fromPartnerID:e,toPartnerID:Ye.partner1===e?Ye.partner2:Ye.partner1,content:Ze+(Oe?` (${Oe==null?void 0:Oe.name} attached)`:""),timestamp:Date.now()};ze(ct),A(ct.content,Oe??void 0),Oe&&Be(mt=>[...mt,Oe.name]),ae(""),Ae(null),Ve.current&&(Ve.current.value="")},[rt,Je]=React.useState(null),st=Ye=>Je(Ye),et=Ye=>{nt(),Je(Ye)};React.useEffect(()=>{if(rt===null)return;const Ye=We();if(!Ye||!j)return;const Ze=rt;Je(null),Ze&&Qe(Ye,Ze)},[rt,se,j]),React.useImperativeHandle(l,()=>({sendMessageToAssistant:st,sendMessageToAssistantWithClear:et}));const at=Ye=>{var ct;const Ze=(ct=Ye.clipboardData)==null?void 0:ct.items;if(Ze){for(let mt=0;mt<Ze.length;mt++)if(Ze[mt].type.indexOf("image")!==-1){const ft=Ze[mt].getAsFile();if(ft){Ae(ft);return}}}},tt=()=>{let Ye=ne.trim();!Ye&&Oe&&(Ye="consider this"),!(!dt||!Ye)&&Qe(dt,Ye)},ot=Ye=>{Ye.target.files&&Ye.target.files[0]?Ae(Ye.target.files[0]):Ae(null)},lt=()=>{var Ye;(Ye=Ve.current)==null||Ye.click()},Ge=()=>{var Ye;Ae(null),Le({title:"File removed",description:"No file will be sent to the assistant.",variant:"secondary"}),(Ye=qe.current)==null||Ye.focus()},$t=()=>{const Ze={messages:We(),debug:q};f(!0),_({applicationId:e,emailAddress:t,body:Ze}).then(ct=>{if(ct.error){console.error(ct.error),Le({title:"Error",description:"Could not send your feedback. Please try again later.",variant:"destructive"});return}Le({title:"Success",description:"Your feedback has been successfully sent. Thank you!",variant:"success"})}).catch(ct=>{console.error(ct),Le({title:"Error",description:"Could not send your feedback. Please try again later.",variant:"destructive"})}).finally(()=>{f(!1)})},nt=()=>{$e(Ye=>Ye.map(ct=>ct.partner1!==ASSISTANT_ID&&ct.partner2!==ASSISTANT_ID?ct:{...ct,messages:[]})),Be([]),te()},Rt=()=>{try{let Ye=V.map(ct=>{const ft=(Array.isArray(ct==null?void 0:ct.Parts)?ct.Parts:[]).map(yt=>{const qt=typeof(yt==null?void 0:yt.Text)=="string"?yt.Text:null,Kt=!!(qt&&qt.length>0),un=(yt==null?void 0:yt.FunctionResponse)!=null,mn=(yt==null?void 0:yt.FileData)!=null;return!Kt&&!un&&!mn?null:{...Kt?{Text:qt}:{},...un?{FunctionResponse:yt.FunctionResponse}:{},...mn?{FileData:yt.FileData}:{}}}).filter(Boolean);return{Role:(ct==null?void 0:ct.Role)??null,Parts:ft}});(async()=>{try{Ye={SystemInstructions:(await Ue({applicationId:e})).data??"",ChatMessages:Ye};const mt=JSON.stringify(Ye,null,2);if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(mt),Le({title:"Chat JSON copied",description:"The chat history has been copied to your clipboard.",variant:"success"});else{const ft=document.createElement("textarea");ft.value=mt,ft.style.position="fixed",ft.style.left="-9999px",document.body.appendChild(ft),ft.focus(),ft.select();const yt=document.execCommand("copy");if(document.body.removeChild(ft),yt)Le({title:"Chat JSON copied",description:"The chat history has been copied to your clipboard.",variant:"success"});else throw new Error("execCommand copy failed")}}catch(ct){console.error("Failed to copy chat JSON",ct),Le({title:"Error copying JSON",description:"Could not copy to clipboard. See console for details.",variant:"destructive"})}})()}catch(Ye){console.error("Failed to print chat JSON",Ye),Le({title:"Error printing JSON",description:"See console for details.",variant:"destructive"})}},dt=We(),It=(Ye,Ze)=>{R(ct=>({...ct,[Ye]:Ze})),nt()},Mt=React.useRef(null);React.useEffect(()=>{var Ye;(Ye=Mt.current)==null||Ye.scrollIntoView({behavior:"smooth"})},[q]);const Ct=({className:Ye="h-4 w-4"})=>jsxRuntime.jsxs("svg",{style:{flex:"none",lineHeight:1},viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",className:Ye,children:[jsxRuntime.jsx("title",{children:"Gemini"}),jsxRuntime.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"#3186FF"}),jsxRuntime.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"url(#lobe-icons-gemini-fill-0)"}),jsxRuntime.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"url(#lobe-icons-gemini-fill-1)"}),jsxRuntime.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"url(#lobe-icons-gemini-fill-2)"}),jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lobe-icons-gemini-fill-0",x1:"7",x2:"11",y1:"15.5",y2:"12",children:[jsxRuntime.jsx("stop",{stopColor:"#08B962"}),jsxRuntime.jsx("stop",{offset:"1",stopColor:"#08B962",stopOpacity:"0"})]}),jsxRuntime.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lobe-icons-gemini-fill-1",x1:"8",x2:"11.5",y1:"5.5",y2:"11",children:[jsxRuntime.jsx("stop",{stopColor:"#F94543"}),jsxRuntime.jsx("stop",{offset:"1",stopColor:"#F94543",stopOpacity:"0"})]}),jsxRuntime.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lobe-icons-gemini-fill-2",x1:"3.5",x2:"17.5",y1:"13.5",y2:"12",children:[jsxRuntime.jsx("stop",{stopColor:"#FABC12"}),jsxRuntime.jsx("stop",{offset:".46",stopColor:"#FABC12",stopOpacity:"0"})]})]})]}),Ke=jsxRuntime.jsx("div",{className:"flex h-full items-center justify-center",children:jsxRuntime.jsxs("div",{className:"text-center text-muted-foreground",children:[jsxRuntime.jsx(LoaderCircle,{className:"h-12 w-12 animate-spin mx-auto mb-4"}),jsxRuntime.jsx("p",{children:"Loading API functions..."})]})});return g?jsxRuntime.jsxs("div",{className:cn("flex grow-1 overflow-hidden",o),children:[jsxRuntime.jsx("div",{className:"flex-5 flex flex-col",children:We()?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"flex items-center p-4 border-b",children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Avatar,{className:"h-8 w-8 flex-shrink-0 rounded-none",children:jsxRuntime.jsx(Bot,{className:"text-primary fill-white min-h-full"})}),jsxRuntime.jsx("div",{className:"ml-3 font-medium",children:"Randmar Assistant"}),jsxRuntime.jsx(Button$1,{variant:"ghost",size:"sm",className:"ml-auto",confirmationDialog:{title:"Report Issue",content:"This action will send a copy of your chat to Randmar. Send it?",onConfirm:()=>$t()},disabled:d,children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-5 w-5 mr-2 animate-spin"}),"Sending Feedback..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(MessageSquareShare,{className:"h-5 w-5 mr-2"}),"Report Issue"]})}),jsxRuntime.jsxs(Button$1,{className:"ml-1",onClick:()=>nt(),children:[jsxRuntime.jsx(MessageCircleX,{className:"h-5 w-5"})," Clear Conversation"]})]})}),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ScrollArea,{className:"flex-1 pl-2 pr-2 bg-slate-50",children:j?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ChatMessages,{messages:(dt==null?void 0:dt.messages)??[],appID:e,isAssistantChat:!0,botStatus:Q}),jsxRuntime.jsx("div",{ref:Ne})]}):Ke}),jsxRuntime.jsxs("div",{className:"p-4 border-t border-r flex",children:[jsxRuntime.jsx(Textarea,{ref:qe,placeholder:"Type a message...",value:ne,onPaste:at,onChange:Ye=>ae(Ye.target.value),onKeyDown:Ye=>{Ye.key!=="Enter"||Ye.shiftKey||(Ye.preventDefault(),!(!j||Q)&&tt())},className:"flex-1 resize-none field-sizing-content max-h-[30em]"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Button$1,{size:"icon",variant:"default",className:dt!=null&&dt.pending?"collapse":"ml-2 h-8 w-8",disabled:!j||!!Q,onClick:tt,children:jsxRuntime.jsx(Send,{className:"h-6 w-6"})}),jsxRuntime.jsx(Input,{type:"file",onChange:ot,className:"hidden",ref:Ve}),jsxRuntime.jsx(Button$1,{size:"icon",variant:"default",onClick:lt,className:dt!=null&&dt.pending?"collapse":"ml-2 h-8 w-8",disabled:!j||Q!==""||(dt==null?void 0:dt.pending)||!!Oe,children:jsxRuntime.jsx(Paperclip,{className:"h-5 w-5"})}),jsxRuntime.jsx(Button$1,{size:"icon",variant:"default",onClick:Ge,className:dt!=null&&dt.pending?"collapse":"ml-2 h-8 w-8",disabled:!j||Q!==""||(dt==null?void 0:dt.pending)||!Oe,children:jsxRuntime.jsx(Trash,{className:"h-5 w-5"})})]})]})]})]}):Ke}),jsxRuntime.jsx("div",{"data-thin":!0,className:"flex border-l flex-1",children:jsxRuntime.jsxs("div",{className:"flex h-full flex-col border-r bg-slate-50 text-slate-800 rounded-r-lg",children:[jsxRuntime.jsxs("div",{className:"p-4 space-y-4 border-b border-slate-200/80",children:[jsxRuntime.jsxs("h4",{className:"flex items-center text-xs font-semibold tracking-wider text-slate-500 uppercase",children:[jsxRuntime.jsx(Settings,{className:"w-4 h-4 mr-2"}),"Assistant Settings"]}),jsxRuntime.jsx("div",{className:"space-y-5",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"space-y-1.5 pr-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"preload-bestsellers-switch",children:"Preload Best-Sellers"}),jsxRuntime.jsx("p",{className:"text-xs text-slate-600",children:"Adds top products to the AI's context for faster answers."})]}),jsxRuntime.jsx(Switch,{id:"preload-bestsellers-switch",checked:S.assistantCachedPreloading,onCheckedChange:Ye=>It("assistantCachedPreloading",Ye)})]})})]}),jsxRuntime.jsxs("div",{className:"flex flex-col border-b border-slate-200/80 h-32",children:[jsxRuntime.jsxs("h4",{className:"flex-shrink-0 flex items-center p-4 pb-2 text-xs font-semibold tracking-wider text-slate-500 uppercase",children:[jsxRuntime.jsx(File$1,{className:"w-4 h-4 mr-2"}),"Attached Files"]}),jsxRuntime.jsx(ScrollArea,{className:"flex-1 px-4",children:jsxRuntime.jsx("div",{className:"py-2 text-sm",children:Oe||je.length>0?jsxRuntime.jsxs("div",{className:"space-y-2",children:[Oe&&jsxRuntime.jsxs("div",{className:"flex items-center text-blue-600",children:[jsxRuntime.jsx(File$1,{className:"w-4 h-4 mr-2 flex-shrink-0"}),jsxRuntime.jsxs("span",{className:"truncate",children:[Oe.name," (pending)"]})]}),je.slice().reverse().map((Ye,Ze)=>jsxRuntime.jsxs("div",{className:"flex items-center text-slate-700 hover:text-slate-900 transition-colors duration-150",children:[jsxRuntime.jsx(File$1,{className:"w-4 h-4 mr-2 flex-shrink-0"}),jsxRuntime.jsx("span",{className:"truncate",children:Ye})]},Ze))]}):jsxRuntime.jsx("p",{className:"text-slate-500 text-xs italic",children:"No files attached yet."})})})]}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[jsxRuntime.jsxs("h4",{className:"flex-shrink-0 flex items-center p-4 pb-2 text-xs font-semibold tracking-wider text-slate-500 uppercase",children:[jsxRuntime.jsx(CodeXml,{className:"w-4 h-4 mr-2"}),"Developer Log"]}),jsxRuntime.jsx(ScrollArea,{className:"flex-1 px-4",children:jsxRuntime.jsxs("div",{className:"py-2 text-xs font-mono",children:[jsxRuntime.jsx(DebugMessageDisplay,{debugMessages:q}),jsxRuntime.jsx("div",{ref:Mt})]})})]}),jsxRuntime.jsx("div",{className:"p-3 border-t border-slate-200/80",children:jsxRuntime.jsxs(Button$1,{className:"w-full",variant:"secondary",onClick:Rt,children:[jsxRuntime.jsx(CodeXml,{className:"h-4 w-4 mr-2"}),"Export Chat JSON"]})}),jsxRuntime.jsx("div",{className:"mt-auto p-3 border-t border-slate-200/80",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-center space-x-3 w-full",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("p",{className:"text-xs text-slate-500",children:"Powered by Gemini"}),jsxRuntime.jsx(Ct,{})]}),jsxRuntime.jsxs("div",{className:"flex-1 max-w-[160px]",children:[jsxRuntime.jsx(Progress,{value:Math.round((F||0)*100),className:"h-2"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-[10px] text-slate-400 mt-1",children:[jsxRuntime.jsx("span",{children:"Context"}),jsxRuntime.jsxs("span",{children:[Math.round((F||0)*100),"%"]})]})]})]})})]})})]}):jsxRuntime.jsx(LoaderCircle,{className:"h-12 w-12 animate-spin mx-auto mb-4"})}),Navbar=React.forwardRef(({routes:e,footer:t,dashboardTitle:n,chatUserName:o,appID:l,chatRoutePath:d},f)=>{const g=e.filter(E=>E.showInNav),b=React.useRef(null),_=React.useRef(null),S=React.useRef(null),{data:R}=useGetV4PartnerByRouteApplicationIdBusinessDevelopmentConversationsHasUnreadsQuery({routeApplicationId:l}),{hasUnreads:C}=useChat();return React.useImperativeHandle(f,()=>({sendMessageToAssistant:E=>{var A;(A=S.current)==null||A.click(),setTimeout(()=>{var M;(M=b.current)==null||M.focus(),_.current&&_.current.sendMessageToAssistant(E)},100)},sendMessageToAssistantWithClear(E){var A;(A=S.current)==null||A.click(),setTimeout(()=>{var M;(M=b.current)==null||M.focus(),_.current&&_.current.sendMessageToAssistantWithClear(E)},100)}})),jsxRuntime.jsxs(Sidebar,{className:"border-r border-sidebar-border",children:[jsxRuntime.jsx(SidebarHeader,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center",children:jsxRuntime.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),jsxRuntime.jsx("span",{className:"font-semibold text-lg",children:n})]})}),jsxRuntime.jsx(SidebarContent,{className:"py-4 bg-sidebar text-sidebar-foreground",children:jsxRuntime.jsx(SidebarMenu,{children:g.map(E=>{const A=E.icon,M=`/${E.path}`;return jsxRuntime.jsx(SidebarMenuItem,{children:jsxRuntime.jsx(SidebarMenuButton,{asChild:!0,children:jsxRuntime.jsxs(reactRouterDom.Link,{to:M,className:"transition-colors hover:bg-muted px-6",children:[A&&jsxRuntime.jsx(A,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:E.label})]})})},E.key)})})}),jsxRuntime.jsxs(SidebarFooter,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:[jsxRuntime.jsxs(Dialog,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{ref:S,size:"lg",className:"collapse md:visible flex-grow",onClick:()=>setTimeout(()=>{var E;return(E=b.current)==null?void 0:E.focus()},50),children:[jsxRuntime.jsx(Bot,{}),"Assistant"]})}),jsxRuntime.jsx(reactRouterDom.Link,{to:d,children:jsxRuntime.jsx(Button$1,{size:"icon",className:C||(R==null?void 0:R.HasUnreads)===!0?"pulse-glow bg-white hover:bg-gray-200 text-black":"",children:jsxRuntime.jsx(MessageSquare,{className:"h-5 w-5"})})})]}),jsxRuntime.jsx(DialogContent,{className:"max-w-[85vw] p-0 data-[state=open]:visible data-[state=closed]:invisible",forceMount:!0,animateExit:!1,children:jsxRuntime.jsx(AIChatLayout,{className:"h-[85vh]",ref:_,inputRef:b,userId:l,userName:o??"Unknown user"})})]}),t]})]})}),Layout=React.forwardRef(({children:e,appID:t,rightMenu:n,routes:o,footer:l,handleValidSearch:d,dashboardTitle:f,onSignOut:g,searchPlaceholder:b,chatUserName:_,chatRef:S,chatRoutePath:R},C)=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(SidebarProvider,{children:jsxRuntime.jsxs("div",{className:"flex grow",children:[jsxRuntime.jsx(Navbar,{appID:t,routes:o,footer:l,dashboardTitle:f,chatUserName:_,ref:S,chatRoutePath:R}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col",children:[jsxRuntime.jsx(Topbar,{ref:C,appID:t,onSignOut:g,rightMenu:n,handleValidSearch:d,searchPlaceholder:b}),jsxRuntime.jsx("main",{className:"flex-1 mt-16",children:e}),jsxRuntime.jsx(Toaster,{})]})]})})}));Layout.displayName="Layout";const salesChannels=[{id:"online-store",label:"Online store (Shopify, Amazon, etc.)"},{id:"brick-and-mortar",label:"Brick-and-mortar (Physical Store)"},{id:"marketplace",label:"Marketplace seller (eBay, Walmart, etc.)"},{id:"b2b",label:"B2B wholesale"},{id:"other-channel",label:"Other (please specify)"}],markets=[{id:"canada",label:"Canada - Nationwide"},{id:"ontario",label:"Ontario & Quebec"},{id:"atlantic",label:"Atlantic Provinces (NS, NB, PEI, NL)"},{id:"prairie",label:"Prairie (Saskatchewan, Manitoba)"},{id:"western",label:"Western Provinces (BC, Alberta, etc.)"},{id:"united-states",label:"United States"},{id:"other-market",label:"Other (please specify)"}];function ManufacturerGetStartedButton({applicationId:e,manufacturer:t}){const{toast:n}=useToast(),[o,l]=React.useState(!1),[d,f]=React.useState(!1),[g,b]=React.useState(!1),[_,S]=React.useState(""),[R,C]=React.useState(""),[E,A]=React.useState(!1),[M,I]=React.useState(""),[j,q]=React.useState(""),[Q,te]=React.useState([]),[F,V]=React.useState(""),[ne,ae]=React.useState(""),[se,$e]=React.useState([]),[Ne,oe]=React.useState(""),[Oe,Ae]=React.useState(""),[je]=usePostV4PartnerByRouteApplicationIdBusinessDevelopmentConversationPartnerAndPartnerIdMutation(),Be=()=>{S(""),C("")},qe=()=>{I(""),q(""),te([]),V(""),ae(""),$e([]),oe(""),Ae("")},Ve=()=>{t.PartnerRegistrationLink?l(!0):t.OpenToWork&&f(!0)},Le=Je=>{if(Je.preventDefault(),!g){if(!_.trim()){C("Qualification ID is required");return}b(!0),je({routeApplicationId:e,partnerId:t.ManufacturerId??"",message:`Hello! I'd like to get started with you. Here's my Qualification ID: ${_}`}).then(st=>{if(st.error){console.error(st.error),n({title:"Could not initiate chat",description:"Try again later.",variant:"destructive"});return}n({title:"Information sent to the manufacturer",description:"Check your chats later.",variant:"success"}),l(!1),Be()}).catch(st=>{console.error(st),n({title:"Could not initiate chat",description:"Try again later.",variant:"destructive"})}).finally(()=>{b(!1)})}},Ue=Je=>{if(Je.preventDefault(),E)return;q(""),V(""),oe("");let st=!1;if(M.trim().length<10&&(q("Please provide a brief description of your business (minimum 10 characters)"),st=!0),Q.length===0&&(V("Please select at least one sales channel"),st=!0),se.length===0&&(oe("Please select at least one market"),st=!0),st)return;const et=salesChannels.filter(ot=>Q.includes(ot.id)).map(ot=>ot.label);ne&&et.push(`Other: ${ne}`);const at=markets.filter(ot=>se.includes(ot.id)).map(ot=>ot.label);Oe&&at.push(`Other: ${Oe}`);const tt=["Hello! I'd like to introduce my business:",`**Business Description:** ${M}`,`**Sales Channels:** ${et.join(", ")}`,`**Markets:** ${at.join(", ")}`].join(`
|
|
1373
|
+
`),console.log("doSend",Ze),console.log("target",Ye);const ct={id:crypto.randomUUID(),senderName:t,fromPartnerID:e,toPartnerID:Ye.partner1===e?Ye.partner2:Ye.partner1,content:Ze+(Oe?` (${Oe==null?void 0:Oe.name} attached)`:""),timestamp:Date.now()};ze(ct),A(ct.content,Oe??void 0),Oe&&Be(mt=>[...mt,Oe.name]),ae(""),Ae(null),Ve.current&&(Ve.current.value="")},[rt,Je]=React.useState(null),st=Ye=>Je(Ye),et=Ye=>{nt(),Je(Ye)};React.useEffect(()=>{if(rt===null)return;const Ye=We();if(!Ye||!j)return;const Ze=rt;Je(null),Ze&&Qe(Ye,Ze)},[rt,se,j]),React.useImperativeHandle(l,()=>({sendMessageToAssistant:st,sendMessageToAssistantWithClear:et}));const at=Ye=>{var ct;const Ze=(ct=Ye.clipboardData)==null?void 0:ct.items;if(Ze){for(let mt=0;mt<Ze.length;mt++)if(Ze[mt].type.indexOf("image")!==-1){const ft=Ze[mt].getAsFile();if(ft){Ae(ft);return}}}},tt=()=>{let Ye=ne.trim();!Ye&&Oe&&(Ye="consider this"),!(!dt||!Ye)&&Qe(dt,Ye)},ot=Ye=>{Ye.target.files&&Ye.target.files[0]?Ae(Ye.target.files[0]):Ae(null)},lt=()=>{var Ye;(Ye=Ve.current)==null||Ye.click()},Ge=()=>{var Ye;Ae(null),Le({title:"File removed",description:"No file will be sent to the assistant.",variant:"secondary"}),(Ye=qe.current)==null||Ye.focus()},$t=()=>{const Ze={messages:We(),debug:q};f(!0),_({applicationId:e,emailAddress:t,body:Ze}).then(ct=>{if(ct.error){console.error(ct.error),Le({title:"Error",description:"Could not send your feedback. Please try again later.",variant:"destructive"});return}Le({title:"Success",description:"Your feedback has been successfully sent. Thank you!",variant:"success"})}).catch(ct=>{console.error(ct),Le({title:"Error",description:"Could not send your feedback. Please try again later.",variant:"destructive"})}).finally(()=>{f(!1)})},nt=()=>{$e(Ye=>Ye.map(ct=>ct.partner1!==ASSISTANT_ID&&ct.partner2!==ASSISTANT_ID?ct:{...ct,messages:[]})),Be([]),te()},Rt=()=>{try{let Ye=V.map(ct=>{const ft=(Array.isArray(ct==null?void 0:ct.Parts)?ct.Parts:[]).map(yt=>{const qt=typeof(yt==null?void 0:yt.Text)=="string"?yt.Text:null,Kt=!!(qt&&qt.length>0),un=(yt==null?void 0:yt.FunctionResponse)!=null,mn=(yt==null?void 0:yt.FileData)!=null;return!Kt&&!un&&!mn?null:{...Kt?{Text:qt}:{},...un?{FunctionResponse:yt.FunctionResponse}:{},...mn?{FileData:yt.FileData}:{}}}).filter(Boolean);return{Role:(ct==null?void 0:ct.Role)??null,Parts:ft}});(async()=>{try{Ye={SystemInstructions:(await Ue({applicationId:e})).data??"",ChatMessages:Ye};const mt=JSON.stringify(Ye,null,2);if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(mt),Le({title:"Chat JSON copied",description:"The chat history has been copied to your clipboard.",variant:"success"});else{const ft=document.createElement("textarea");ft.value=mt,ft.style.position="fixed",ft.style.left="-9999px",document.body.appendChild(ft),ft.focus(),ft.select();const yt=document.execCommand("copy");if(document.body.removeChild(ft),yt)Le({title:"Chat JSON copied",description:"The chat history has been copied to your clipboard.",variant:"success"});else throw new Error("execCommand copy failed")}}catch(ct){console.error("Failed to copy chat JSON",ct),Le({title:"Error copying JSON",description:"Could not copy to clipboard. See console for details.",variant:"destructive"})}})()}catch(Ye){console.error("Failed to print chat JSON",Ye),Le({title:"Error printing JSON",description:"See console for details.",variant:"destructive"})}},dt=We(),It=(Ye,Ze)=>{R(ct=>({...ct,[Ye]:Ze})),nt()},Mt=React.useRef(null);React.useEffect(()=>{var Ye;(Ye=Mt.current)==null||Ye.scrollIntoView({behavior:"smooth"})},[q]);const Ct=({className:Ye="h-4 w-4"})=>jsxRuntime.jsxs("svg",{style:{flex:"none",lineHeight:1},viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",className:Ye,children:[jsxRuntime.jsx("title",{children:"Gemini"}),jsxRuntime.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"#3186FF"}),jsxRuntime.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"url(#lobe-icons-gemini-fill-0)"}),jsxRuntime.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"url(#lobe-icons-gemini-fill-1)"}),jsxRuntime.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"url(#lobe-icons-gemini-fill-2)"}),jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lobe-icons-gemini-fill-0",x1:"7",x2:"11",y1:"15.5",y2:"12",children:[jsxRuntime.jsx("stop",{stopColor:"#08B962"}),jsxRuntime.jsx("stop",{offset:"1",stopColor:"#08B962",stopOpacity:"0"})]}),jsxRuntime.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lobe-icons-gemini-fill-1",x1:"8",x2:"11.5",y1:"5.5",y2:"11",children:[jsxRuntime.jsx("stop",{stopColor:"#F94543"}),jsxRuntime.jsx("stop",{offset:"1",stopColor:"#F94543",stopOpacity:"0"})]}),jsxRuntime.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lobe-icons-gemini-fill-2",x1:"3.5",x2:"17.5",y1:"13.5",y2:"12",children:[jsxRuntime.jsx("stop",{stopColor:"#FABC12"}),jsxRuntime.jsx("stop",{offset:".46",stopColor:"#FABC12",stopOpacity:"0"})]})]})]}),Ke=jsxRuntime.jsx("div",{className:"flex h-full items-center justify-center",children:jsxRuntime.jsxs("div",{className:"text-center text-muted-foreground",children:[jsxRuntime.jsx(LoaderCircle,{className:"h-12 w-12 animate-spin mx-auto mb-4"}),jsxRuntime.jsx("p",{children:"Loading API functions..."})]})});return g?jsxRuntime.jsxs("div",{className:cn("flex grow-1 overflow-hidden",o),children:[jsxRuntime.jsx("div",{className:"flex-5 flex flex-col",children:We()?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"flex items-center p-4 border-b",children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Avatar,{className:"h-8 w-8 flex-shrink-0 rounded-none",children:jsxRuntime.jsx(Bot,{className:"text-primary fill-white min-h-full"})}),jsxRuntime.jsx("div",{className:"ml-3 font-medium",children:"Randmar Assistant"}),jsxRuntime.jsx(Button$1,{variant:"ghost",size:"sm",className:"ml-auto",confirmationDialog:{title:"Report Issue",content:"This action will send a copy of your chat to Randmar. Send it?",onConfirm:()=>$t()},disabled:d,children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-5 w-5 mr-2 animate-spin"}),"Sending Feedback..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(MessageSquareShare,{className:"h-5 w-5 mr-2"}),"Report Issue"]})}),jsxRuntime.jsxs(Button$1,{className:"ml-1",onClick:()=>nt(),children:[jsxRuntime.jsx(MessageCircleX,{className:"h-5 w-5"})," Clear Conversation"]})]})}),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ScrollArea,{className:"flex-1 pl-2 pr-2 bg-slate-50",children:j?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ChatMessages,{messages:(dt==null?void 0:dt.messages)??[],appID:e,isAssistantChat:!0,botStatus:Q}),jsxRuntime.jsx("div",{ref:Ne})]}):Ke}),jsxRuntime.jsxs("div",{className:"p-4 border-t border-r flex",children:[jsxRuntime.jsx(Textarea,{ref:qe,placeholder:"Type a message...",value:ne,onPaste:at,onChange:Ye=>ae(Ye.target.value),onKeyDown:Ye=>{Ye.key!=="Enter"||Ye.shiftKey||(Ye.preventDefault(),!(!j||Q)&&tt())},className:"flex-1 resize-none field-sizing-content max-h-[30em]"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Button$1,{size:"icon",variant:"default",className:dt!=null&&dt.pending?"collapse":"ml-2 h-8 w-8",disabled:!j||!!Q,onClick:tt,children:jsxRuntime.jsx(Send,{className:"h-6 w-6"})}),jsxRuntime.jsx(Input,{type:"file",onChange:ot,className:"hidden",ref:Ve}),jsxRuntime.jsx(Button$1,{size:"icon",variant:"default",onClick:lt,className:dt!=null&&dt.pending?"collapse":"ml-2 h-8 w-8",disabled:!j||Q!==""||(dt==null?void 0:dt.pending)||!!Oe,children:jsxRuntime.jsx(Paperclip,{className:"h-5 w-5"})}),jsxRuntime.jsx(Button$1,{size:"icon",variant:"default",onClick:Ge,className:dt!=null&&dt.pending?"collapse":"ml-2 h-8 w-8",disabled:!j||Q!==""||(dt==null?void 0:dt.pending)||!Oe,children:jsxRuntime.jsx(Trash,{className:"h-5 w-5"})})]})]})]})]}):Ke}),jsxRuntime.jsx("div",{"data-thin":!0,className:"flex border-l flex-1",children:jsxRuntime.jsxs("div",{className:"flex h-full flex-col border-r bg-slate-50 text-slate-800 rounded-r-lg",children:[jsxRuntime.jsxs("div",{className:"p-4 space-y-4 border-b border-slate-200/80",children:[jsxRuntime.jsxs("h4",{className:"flex items-center text-xs font-semibold tracking-wider text-slate-500 uppercase",children:[jsxRuntime.jsx(Settings,{className:"w-4 h-4 mr-2"}),"Assistant Settings"]}),jsxRuntime.jsx("div",{className:"space-y-5",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"space-y-1.5 pr-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"preload-bestsellers-switch",children:"Preload Best-Sellers"}),jsxRuntime.jsx("p",{className:"text-xs text-slate-600",children:"Adds top products to the AI's context for faster answers."})]}),jsxRuntime.jsx(Switch,{id:"preload-bestsellers-switch",checked:S.assistantCachedPreloading,onCheckedChange:Ye=>It("assistantCachedPreloading",Ye)})]})})]}),jsxRuntime.jsxs("div",{className:"flex flex-col border-b border-slate-200/80 h-32",children:[jsxRuntime.jsxs("h4",{className:"flex-shrink-0 flex items-center p-4 pb-2 text-xs font-semibold tracking-wider text-slate-500 uppercase",children:[jsxRuntime.jsx(File$1,{className:"w-4 h-4 mr-2"}),"Attached Files"]}),jsxRuntime.jsx(ScrollArea,{className:"flex-1 px-4",children:jsxRuntime.jsx("div",{className:"py-2 text-sm",children:Oe||je.length>0?jsxRuntime.jsxs("div",{className:"space-y-2",children:[Oe&&jsxRuntime.jsxs("div",{className:"flex items-center text-blue-600",children:[jsxRuntime.jsx(File$1,{className:"w-4 h-4 mr-2 flex-shrink-0"}),jsxRuntime.jsxs("span",{className:"truncate",children:[Oe.name," (pending)"]})]}),je.slice().reverse().map((Ye,Ze)=>jsxRuntime.jsxs("div",{className:"flex items-center text-slate-700 hover:text-slate-900 transition-colors duration-150",children:[jsxRuntime.jsx(File$1,{className:"w-4 h-4 mr-2 flex-shrink-0"}),jsxRuntime.jsx("span",{className:"truncate",children:Ye})]},Ze))]}):jsxRuntime.jsx("p",{className:"text-slate-500 text-xs italic",children:"No files attached yet."})})})]}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[jsxRuntime.jsxs("h4",{className:"flex-shrink-0 flex items-center p-4 pb-2 text-xs font-semibold tracking-wider text-slate-500 uppercase",children:[jsxRuntime.jsx(CodeXml,{className:"w-4 h-4 mr-2"}),"Developer Log"]}),jsxRuntime.jsx(ScrollArea,{className:"flex-1 px-4",children:jsxRuntime.jsxs("div",{className:"py-2 text-xs font-mono",children:[jsxRuntime.jsx(DebugMessageDisplay,{debugMessages:q}),jsxRuntime.jsx("div",{ref:Mt})]})})]}),jsxRuntime.jsx("div",{className:"p-3 border-t border-slate-200/80",children:jsxRuntime.jsxs(Button$1,{className:"w-full",variant:"secondary",onClick:Rt,children:[jsxRuntime.jsx(CodeXml,{className:"h-4 w-4 mr-2"}),"Export Chat JSON"]})}),jsxRuntime.jsx("div",{className:"mt-auto p-3 border-t border-slate-200/80",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-center space-x-3 w-full",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("p",{className:"text-xs text-slate-500",children:"Powered by Gemini"}),jsxRuntime.jsx(Ct,{})]}),jsxRuntime.jsxs("div",{className:"flex-1 max-w-[160px]",children:[jsxRuntime.jsx(Progress,{value:Math.round((F||0)*100),className:"h-2"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-[10px] text-slate-400 mt-1",children:[jsxRuntime.jsx("span",{children:"Context"}),jsxRuntime.jsxs("span",{children:[Math.round((F||0)*100),"%"]})]})]})]})})]})})]}):jsxRuntime.jsx(LoaderCircle,{className:"h-12 w-12 animate-spin mx-auto mb-4"})}),Navbar=React.forwardRef(({routes:e,footer:t,dashboardTitle:n,chatUserName:o,appID:l,chatRoutePath:d},f)=>{const g=e.filter(E=>E.showInNav),b=React.useRef(null),_=React.useRef(null),S=React.useRef(null),{data:R}=useGetV4PartnerByRouteApplicationIdBusinessDevelopmentConversationsHasUnreadsQuery({routeApplicationId:l}),{hasUnreads:C}=useChat();return React.useImperativeHandle(f,()=>({sendMessageToAssistant:E=>{var A;(A=S.current)==null||A.click(),setTimeout(()=>{var M;(M=b.current)==null||M.focus(),_.current&&_.current.sendMessageToAssistant(E)},100)},sendMessageToAssistantWithClear(E){var A;(A=S.current)==null||A.click(),setTimeout(()=>{var M;(M=b.current)==null||M.focus(),_.current&&_.current.sendMessageToAssistantWithClear(E)},100)}})),jsxRuntime.jsxs(Sidebar,{className:"border-r border-sidebar-border",children:[jsxRuntime.jsx(SidebarHeader,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center",children:jsxRuntime.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),jsxRuntime.jsx("span",{className:"font-semibold text-lg",children:n})]})}),jsxRuntime.jsx(SidebarContent,{className:"py-4 bg-sidebar text-sidebar-foreground",children:jsxRuntime.jsx(SidebarMenu,{children:g.map(E=>{const A=E.icon,M=`/${E.path}`;return jsxRuntime.jsx(SidebarMenuItem,{children:jsxRuntime.jsx(SidebarMenuButton,{asChild:!0,children:jsxRuntime.jsxs(reactRouterDom.Link,{to:M,className:"transition-colors hover:bg-muted px-6",children:[A&&jsxRuntime.jsx(A,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:E.label})]})})},E.key)})})}),jsxRuntime.jsxs(SidebarFooter,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:[jsxRuntime.jsxs(Dialog,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{ref:S,size:"lg",className:"collapse md:visible flex-grow",onClick:()=>setTimeout(()=>{var E;return(E=b.current)==null?void 0:E.focus()},50),children:[jsxRuntime.jsx(Bot,{}),"Assistant"]})}),jsxRuntime.jsx(reactRouterDom.Link,{to:d,children:jsxRuntime.jsx(Button$1,{size:"icon",className:C||(R==null?void 0:R.HasUnreads)===!0?"pulse-glow bg-white hover:bg-gray-200 text-black":"",children:jsxRuntime.jsx(MessageSquare,{className:"h-5 w-5"})})})]}),jsxRuntime.jsx(DialogContent,{overlayClassName:"randmar-assistant-backdrop",className:"max-w-[85vw] p-0 data-[state=open]:visible data-[state=closed]:invisible bg-background/95 shadow-[0_30px_120px_-25px_rgba(0,0,0,0.75)] ring-1 ring-primary/20",forceMount:!0,animateExit:!1,children:jsxRuntime.jsx(AIChatLayout,{className:"h-[85vh]",ref:_,inputRef:b,userId:l,userName:o??"Unknown user"})})]}),t]})]})}),Layout=React.forwardRef(({children:e,appID:t,rightMenu:n,routes:o,footer:l,handleValidSearch:d,dashboardTitle:f,onSignOut:g,searchPlaceholder:b,chatUserName:_,chatRef:S,chatRoutePath:R},C)=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(SidebarProvider,{children:jsxRuntime.jsxs("div",{className:"flex grow",children:[jsxRuntime.jsx(Navbar,{appID:t,routes:o,footer:l,dashboardTitle:f,chatUserName:_,ref:S,chatRoutePath:R}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col",children:[jsxRuntime.jsx(Topbar,{ref:C,appID:t,onSignOut:g,rightMenu:n,handleValidSearch:d,searchPlaceholder:b}),jsxRuntime.jsx("main",{className:"flex-1 mt-16",children:e}),jsxRuntime.jsx(Toaster,{})]})]})})}));Layout.displayName="Layout";const salesChannels=[{id:"online-store",label:"Online store (Shopify, Amazon, etc.)"},{id:"brick-and-mortar",label:"Brick-and-mortar (Physical Store)"},{id:"marketplace",label:"Marketplace seller (eBay, Walmart, etc.)"},{id:"b2b",label:"B2B wholesale"},{id:"other-channel",label:"Other (please specify)"}],markets=[{id:"canada",label:"Canada - Nationwide"},{id:"ontario",label:"Ontario & Quebec"},{id:"atlantic",label:"Atlantic Provinces (NS, NB, PEI, NL)"},{id:"prairie",label:"Prairie (Saskatchewan, Manitoba)"},{id:"western",label:"Western Provinces (BC, Alberta, etc.)"},{id:"united-states",label:"United States"},{id:"other-market",label:"Other (please specify)"}];function ManufacturerGetStartedButton({applicationId:e,manufacturer:t}){const{toast:n}=useToast(),[o,l]=React.useState(!1),[d,f]=React.useState(!1),[g,b]=React.useState(!1),[_,S]=React.useState(""),[R,C]=React.useState(""),[E,A]=React.useState(!1),[M,I]=React.useState(""),[j,q]=React.useState(""),[Q,te]=React.useState([]),[F,V]=React.useState(""),[ne,ae]=React.useState(""),[se,$e]=React.useState([]),[Ne,oe]=React.useState(""),[Oe,Ae]=React.useState(""),[je]=usePostV4PartnerByRouteApplicationIdBusinessDevelopmentConversationPartnerAndPartnerIdMutation(),Be=()=>{S(""),C("")},qe=()=>{I(""),q(""),te([]),V(""),ae(""),$e([]),oe(""),Ae("")},Ve=()=>{t.PartnerRegistrationLink?l(!0):t.OpenToWork&&f(!0)},Le=Je=>{if(Je.preventDefault(),!g){if(!_.trim()){C("Qualification ID is required");return}b(!0),je({routeApplicationId:e,partnerId:t.ManufacturerId??"",message:`Hello! I'd like to get started with you. Here's my Qualification ID: ${_}`}).then(st=>{if(st.error){console.error(st.error),n({title:"Could not initiate chat",description:"Try again later.",variant:"destructive"});return}n({title:"Information sent to the manufacturer",description:"Check your chats later.",variant:"success"}),l(!1),Be()}).catch(st=>{console.error(st),n({title:"Could not initiate chat",description:"Try again later.",variant:"destructive"})}).finally(()=>{b(!1)})}},Ue=Je=>{if(Je.preventDefault(),E)return;q(""),V(""),oe("");let st=!1;if(M.trim().length<10&&(q("Please provide a brief description of your business (minimum 10 characters)"),st=!0),Q.length===0&&(V("Please select at least one sales channel"),st=!0),se.length===0&&(oe("Please select at least one market"),st=!0),st)return;const et=salesChannels.filter(ot=>Q.includes(ot.id)).map(ot=>ot.label);ne&&et.push(`Other: ${ne}`);const at=markets.filter(ot=>se.includes(ot.id)).map(ot=>ot.label);Oe&&at.push(`Other: ${Oe}`);const tt=["Hello! I'd like to introduce my business:",`**Business Description:** ${M}`,`**Sales Channels:** ${et.join(", ")}`,`**Markets:** ${at.join(", ")}`].join(`
|
|
1374
1374
|
|
|
1375
1375
|
`);A(!0),je({routeApplicationId:e,partnerId:t.ManufacturerId??"",message:tt}).then(ot=>{if(ot.error){console.error(ot.error),n({title:"Could not initiate chat",description:"Try again later.",variant:"destructive"});return}n({title:"Information sent to the manufacturer",description:"Check your chats later.",variant:"success"}),f(!1),qe()}).catch(ot=>{console.error(ot),n({title:"Could not initiate chat",description:"Try again later.",variant:"destructive"})}).finally(()=>{A(!1)})},We=(Je,st)=>{te(et=>st?[...et,Je]:et.filter(at=>at!==Je)),V("")},ze=(Je,st)=>{$e(et=>st?[...et,Je]:et.filter(at=>at!==Je)),oe("")},Qe=Q.includes("other-channel"),rt=se.includes("other-market");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!t.Qualification&&jsxRuntime.jsxs(Button$1,{onClick:Ve,disabled:!t.PartnerRegistrationLink&&!t.OpenToWork,children:[jsxRuntime.jsx(Check,{className:"mr-2 h-4 w-4"}),"Get Started"]}),t.PartnerRegistrationLink&&jsxRuntime.jsx(Dialog,{open:o,onOpenChange:Je=>{l(Je)},children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[400px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:t.PublicName}),jsxRuntime.jsxs(DialogDescription,{children:[jsxRuntime.jsx("span",{className:"font-bold",children:"Already qualified?"})," Provide your Qualification ID."]})]}),jsxRuntime.jsxs("form",{onSubmit:Le,className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"qualificationId",children:"Qualification ID"}),jsxRuntime.jsx(Input,{id:"qualificationId",placeholder:"Enter your qualification ID",value:_,onChange:Je=>{S(Je.target.value),C("")}}),R&&jsxRuntime.jsx("p",{className:"text-sm font-medium text-destructive",children:R})]}),jsxRuntime.jsx(DialogFooter,{children:jsxRuntime.jsx(Button$1,{type:"submit",className:"w-full",disabled:g,children:g?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Applying..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Check,{className:"mr-2 h-4 w-4"}),"Apply for Qualification"]})})})]}),jsxRuntime.jsx(Separator$1,{className:"my-4"}),jsxRuntime.jsxs("div",{className:"text-center space-y-2",children:[jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Don't have a qualification ID?"}),jsxRuntime.jsx(reactRouterDom.Link,{to:t.PartnerRegistrationLink,target:"_blank",children:jsxRuntime.jsxs(Button$1,{variant:"outline",className:"w-full",disabled:!t.PartnerRegistrationLink,children:[jsxRuntime.jsx(ExternalLink,{className:"mr-2 h-4 w-4"}),"Register here"]})})]})]})}),jsxRuntime.jsx(Dialog,{open:d,onOpenChange:Je=>{f(Je)},children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[768px]",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsx(DialogTitle,{children:"Introduce Yourself"})}),jsxRuntime.jsxs("form",{onSubmit:Ue,className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(Label$2,{htmlFor:"businessDescription",children:["Tell Us About Your Business ",jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground",children:"(Briefly describe your business)"})]}),jsxRuntime.jsx(Textarea,{id:"businessDescription",placeholder:"We are an online retailer specializing in office supplies, serving businesses since 2018...",className:"min-h-[100px]",value:M,onChange:Je=>{I(Je.target.value),q("")}}),j&&jsxRuntime.jsx("p",{className:"text-sm font-medium text-destructive",children:j})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(Label$2,{children:["Sales Channel(s) ",jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground",children:"(Multi-Select where you currently sell your products)"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:salesChannels.map(Je=>jsxRuntime.jsxs("div",{className:"flex items-start space-x-2",children:[jsxRuntime.jsx(Checkbox,{id:`channel-${Je.id}`,checked:Q.includes(Je.id),onCheckedChange:st=>We(Je.id,st===!0)}),jsxRuntime.jsx(Label$2,{htmlFor:`channel-${Je.id}`,className:"text-sm font-normal",children:Je.label})]},Je.id))}),Qe&&jsxRuntime.jsx(Input,{placeholder:"Please specify",value:ne,onChange:Je=>ae(Je.target.value)}),F&&jsxRuntime.jsx("p",{className:"text-sm font-medium text-destructive",children:F})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(Label$2,{children:["Your Primary Market(s) ",jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground",children:"(Multi-Select which regions you sell to)"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:markets.map(Je=>jsxRuntime.jsxs("div",{className:"flex items-start space-x-2",children:[jsxRuntime.jsx(Checkbox,{id:`market-${Je.id}`,checked:se.includes(Je.id),onCheckedChange:st=>ze(Je.id,st===!0)}),jsxRuntime.jsx(Label$2,{htmlFor:`market-${Je.id}`,className:"text-sm font-normal",children:Je.label})]},Je.id))}),rt&&jsxRuntime.jsx(Input,{placeholder:"Please specify",value:Oe,onChange:Je=>Ae(Je.target.value)}),Ne&&jsxRuntime.jsx("p",{className:"text-sm font-medium text-destructive",children:Ne})]}),jsxRuntime.jsx(DialogFooter,{children:jsxRuntime.jsx(Button$1,{type:"submit",disabled:E,children:E?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Submitting..."]}):"Submit"})})]})]})})]})}const DAYS_OF_WEEK=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function ManufacturerReorderingCard({manufacturer:e,onSave:t,loading:n=!1,saving:o=!1,readonly:l=!1}){const[d,f]=React.useState({...e}),[g,b]=React.useState({...e});React.useEffect(()=>{b({...e}),f({...e})},[e]);const _=(j,q)=>{l||f(Q=>({...Q,[j]:q}))},S=(j,q)=>{l||f(Q=>({...Q,[j]:q}))},R=(j,q)=>{l||f(Q=>({...Q,[j]:q}))},C=()=>{const j={};return Object.keys(d).forEach(q=>{const Q=q;JSON.stringify(d[Q])!==JSON.stringify(g[Q])&&(j[Q]=d[Q])}),j},E=()=>{if(!o&&!l){const j=C();Object.keys(j).length>0&&t(j)}},A=j=>j===-1?"ASAP":j===void 0||j<0||j>6?"Sunday":DAYS_OF_WEEK[j],M=j=>j==="ASAP"?-1:DAYS_OF_WEEK.indexOf(j),I=Object.keys(C()).length>0;return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[n?jsxRuntime.jsx(Skeleton,{className:"h-8 w-32"}):jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Reordering"}),n?jsxRuntime.jsx(Skeleton,{className:"h-4 w-full mt-2"}):jsxRuntime.jsx(CardDescription,{className:"text-sm",children:"Adjust your reordering settings to control lead times, stocking weeks, minimum orders, and reorder dates, enhancing efficiency in restocking processes."})]}),jsxRuntime.jsx(CardContent,{className:"space-y-6",children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-10"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx("div",{className:"ml-2 w-12"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx("div",{className:"ml-2 w-12"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Switch,{id:"automatic-reordering",checked:d.AutoUpdate,onCheckedChange:j=>_("AutoUpdate",j),disabled:o||l}),jsxRuntime.jsx(Label$2,{htmlFor:"automatic-reordering",children:"Automatic Reordering"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"reorder-date",children:"Automatic Reorder Date"}),jsxRuntime.jsxs(Select$1,{value:A(d.AutoReorderDate),onValueChange:j=>S("AutoReorderDate",M(j)),disabled:o||l,children:[jsxRuntime.jsx(SelectTrigger,{id:"reorder-date",children:jsxRuntime.jsx(SelectValue,{placeholder:"Select day"})}),jsxRuntime.jsxs(SelectContent,{children:[jsxRuntime.jsx(SelectItem,{value:"ASAP",children:"ASAP"}),DAYS_OF_WEEK.map(j=>jsxRuntime.jsx(SelectItem,{value:j,children:j},j))]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"weeks-stocking",children:"Default Weeks of Stocking"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Input,{id:"weeks-stocking",type:"number",value:d.DefaultWeeksOfStocking||"",onChange:j=>S("DefaultWeeksOfStocking",Number(j.target.value)),disabled:o||l}),jsxRuntime.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"weeks"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"minimum-order",children:"Default Minimum Order"}),jsxRuntime.jsxs("div",{className:"flex items-center relative",children:[jsxRuntime.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2",children:"$"}),jsxRuntime.jsx(Input,{id:"minimum-order",type:"number",className:"pl-6",value:d.DefaultMinimumOrder||"",onChange:j=>S("DefaultMinimumOrder",Number(j.target.value)),disabled:o||l})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"lead-time",children:"Default Lead Time"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Input,{id:"lead-time",type:"number",value:d.DefaultLeadTime||"",onChange:j=>S("DefaultLeadTime",Number(j.target.value)),disabled:o||l}),jsxRuntime.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"days"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"maximum-inventory-value",children:"Default Maximum Inventory Value"}),jsxRuntime.jsxs("div",{className:"flex items-center relative",children:[jsxRuntime.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2",children:"$"}),jsxRuntime.jsx(Input,{id:"maximum-inventory-value",type:"number",className:"pl-6",value:d.DefaultMaxInventoryValue||"",onChange:j=>S("DefaultMaxInventoryValue",Number(j.target.value)),disabled:o||l})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"order-confirmations",children:"Send Order Confirmations To"}),jsxRuntime.jsx(Input,{id:"order-confirmations",type:"email",value:d.POEmail||"",onChange:j=>R("POEmail",j.target.value),placeholder:"email@example.com",disabled:o||l})]})]})]})}),!l&&jsxRuntime.jsx(CardFooter,{className:"flex justify-end",children:n?jsxRuntime.jsx(Skeleton,{className:"h-10 w-20"}):jsxRuntime.jsxs(Button$1,{onClick:E,disabled:o||!I,children:[o&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]})})]})}function createSlot(e){const t=createSlotClone(e),n=React__namespace.forwardRef((o,l)=>{const{children:d,...f}=o,g=React__namespace.Children.toArray(d),b=g.find(isSlottable);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}function createSlotClone(e){const t=React__namespace.forwardRef((n,o)=>{const{children:l,...d}=n;if(React__namespace.isValidElement(l)){const f=getElementRef(l),g=mergeProps(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER$1=Symbol("radix.slottable");function isSlottable(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER$1}function mergeProps(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var POPOVER_NAME="Popover",[createPopoverContext]=createContextScope$2(POPOVER_NAME,[createPopperScope]),usePopperScope=createPopperScope(),[PopoverProvider,usePopoverContext]=createPopoverContext(POPOVER_NAME),Popover$1=e=>{const{__scopePopover:t,children:n,open:o,defaultOpen:l,onOpenChange:d,modal:f=!1}=e,g=usePopperScope(t),b=React__namespace.useRef(null),[_,S]=React__namespace.useState(!1),[R,C]=useControllableState({prop:o,defaultProp:l??!1,onChange:d,caller:POPOVER_NAME});return jsxRuntime.jsx(Root2$7,{...g,children:jsxRuntime.jsx(PopoverProvider,{scope:t,contentId:useId(),triggerRef:b,open:R,onOpenChange:C,onOpenToggle:React__namespace.useCallback(()=>C(E=>!E),[C]),hasCustomAnchor:_,onCustomAnchorAdd:React__namespace.useCallback(()=>S(!0),[]),onCustomAnchorRemove:React__namespace.useCallback(()=>S(!1),[]),modal:f,children:n})})};Popover$1.displayName=POPOVER_NAME;var ANCHOR_NAME="PopoverAnchor",PopoverAnchor$1=React__namespace.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,l=usePopoverContext(ANCHOR_NAME,n),d=usePopperScope(n),{onCustomAnchorAdd:f,onCustomAnchorRemove:g}=l;return React__namespace.useEffect(()=>(f(),()=>g()),[f,g]),jsxRuntime.jsx(Anchor,{...d,...o,ref:t})});PopoverAnchor$1.displayName=ANCHOR_NAME;var TRIGGER_NAME$3="PopoverTrigger",PopoverTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,l=usePopoverContext(TRIGGER_NAME$3,n),d=usePopperScope(n),f=useComposedRefs(t,l.triggerRef),g=jsxRuntime.jsx(Primitive$4.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":getState$2(l.open),...o,ref:f,onClick:composeEventHandlers(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?g:jsxRuntime.jsx(Anchor,{asChild:!0,...d,children:g})});PopoverTrigger$1.displayName=TRIGGER_NAME$3;var PORTAL_NAME$1="PopoverPortal",[PortalProvider,usePortalContext]=createPopoverContext(PORTAL_NAME$1,{forceMount:void 0}),PopoverPortal=e=>{const{__scopePopover:t,forceMount:n,children:o,container:l}=e,d=usePopoverContext(PORTAL_NAME$1,t);return jsxRuntime.jsx(PortalProvider,{scope:t,forceMount:n,children:jsxRuntime.jsx(Presence,{present:n||d.open,children:jsxRuntime.jsx(Portal$5,{asChild:!0,container:l,children:o})})})};PopoverPortal.displayName=PORTAL_NAME$1;var CONTENT_NAME$3="PopoverContent",PopoverContent$1=React__namespace.forwardRef((e,t)=>{const n=usePortalContext(CONTENT_NAME$3,e.__scopePopover),{forceMount:o=n.forceMount,...l}=e,d=usePopoverContext(CONTENT_NAME$3,e.__scopePopover);return jsxRuntime.jsx(Presence,{present:o||d.open,children:d.modal?jsxRuntime.jsx(PopoverContentModal,{...l,ref:t}):jsxRuntime.jsx(PopoverContentNonModal,{...l,ref:t})})});PopoverContent$1.displayName=CONTENT_NAME$3;var Slot=createSlot("PopoverContent.RemoveScroll"),PopoverContentModal=React__namespace.forwardRef((e,t)=>{const n=usePopoverContext(CONTENT_NAME$3,e.__scopePopover),o=React__namespace.useRef(null),l=useComposedRefs(t,o),d=React__namespace.useRef(!1);return React__namespace.useEffect(()=>{const f=o.current;if(f)return hideOthers(f)},[]),jsxRuntime.jsx(ReactRemoveScroll,{as:Slot,allowPinchZoom:!0,children:jsxRuntime.jsx(PopoverContentImpl,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:composeEventHandlers(e.onCloseAutoFocus,f=>{var g;f.preventDefault(),d.current||(g=n.triggerRef.current)==null||g.focus()}),onPointerDownOutside:composeEventHandlers(e.onPointerDownOutside,f=>{const g=f.detail.originalEvent,b=g.button===0&&g.ctrlKey===!0,_=g.button===2||b;d.current=_},{checkForDefaultPrevented:!1}),onFocusOutside:composeEventHandlers(e.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1})})})}),PopoverContentNonModal=React__namespace.forwardRef((e,t)=>{const n=usePopoverContext(CONTENT_NAME$3,e.__scopePopover),o=React__namespace.useRef(!1),l=React__namespace.useRef(!1);return jsxRuntime.jsx(PopoverContentImpl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var f,g;(f=e.onCloseAutoFocus)==null||f.call(e,d),d.defaultPrevented||(o.current||(g=n.triggerRef.current)==null||g.focus(),d.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:d=>{var b,_;(b=e.onInteractOutside)==null||b.call(e,d),d.defaultPrevented||(o.current=!0,d.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=d.target;((_=n.triggerRef.current)==null?void 0:_.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&l.current&&d.preventDefault()}})}),PopoverContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:d,disableOutsidePointerEvents:f,onEscapeKeyDown:g,onPointerDownOutside:b,onFocusOutside:_,onInteractOutside:S,...R}=e,C=usePopoverContext(CONTENT_NAME$3,n),E=usePopperScope(n);return useFocusGuards(),jsxRuntime.jsx(FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:d,children:jsxRuntime.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:f,onInteractOutside:S,onEscapeKeyDown:g,onPointerDownOutside:b,onFocusOutside:_,onDismiss:()=>C.onOpenChange(!1),children:jsxRuntime.jsx(Content$2,{"data-state":getState$2(C.open),role:"dialog",id:C.contentId,...E,...R,ref:t,style:{...R.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)"}})})})}),CLOSE_NAME="PopoverClose",PopoverClose=React__namespace.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,l=usePopoverContext(CLOSE_NAME,n);return jsxRuntime.jsx(Primitive$4.button,{type:"button",...o,ref:t,onClick:composeEventHandlers(e.onClick,()=>l.onOpenChange(!1))})});PopoverClose.displayName=CLOSE_NAME;var ARROW_NAME="PopoverArrow",PopoverArrow=React__namespace.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,l=usePopperScope(n);return jsxRuntime.jsx(Arrow,{...l,...o,ref:t})});PopoverArrow.displayName=ARROW_NAME;function getState$2(e){return e?"open":"closed"}var Root2$2=Popover$1,Anchor2=PopoverAnchor$1,Trigger$1=PopoverTrigger$1,Portal=PopoverPortal,Content2$2=PopoverContent$1;const Popover=Root2$2,PopoverTrigger=Trigger$1,PopoverAnchor=Anchor2,PopoverContent=React__namespace.forwardRef(({className:e,align:t="center",sideOffset:n=4,...o},l)=>jsxRuntime.jsx(Portal,{children:jsxRuntime.jsx(Content2$2,{ref:l,align:t,sideOffset:n,className:cn("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...o})}));PopoverContent.displayName=Content2$2.displayName;function MultiSelect({options:e,selected:t,onChange:n,placeholder:o="Select items...",disabled:l=!1}){const[d,f]=React__namespace.useState(!1),[g,b]=React__namespace.useState(""),_=React__namespace.useRef(null),[S,R]=React__namespace.useState(void 0),C=React__namespace.useCallback(()=>{_.current&&R(_.current.offsetWidth)},[]);React__namespace.useLayoutEffect(()=>{C()},[C]),React__namespace.useEffect(()=>(window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)),[C]);const E=I=>{n(t.filter(j=>j!==I))},A=I=>{f(!1),t.includes(I)?n(t.filter(j=>j!==I)):n([...t,I])},M=I=>{I.key==="Enter"&&g&&!e.includes(g)&&!t.includes(g)&&(I.preventDefault(),A(g),b(""))};return jsxRuntime.jsxs(Popover,{open:d,onOpenChange:f,children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{ref:_,variant:"outline",role:"combobox","aria-expanded":d,className:"w-full justify-between h-auto min-h-[40px] py-2",disabled:l,children:[jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 items-center",children:t.length>0?t.map(I=>jsxRuntime.jsxs(Badge,{variant:"outline",className:"mr-1 mb-1",children:[I,jsxRuntime.jsx("span",{className:"ml-1 cursor-pointer ring-offset-background rounded-full outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:j=>{j.preventDefault(),j.stopPropagation(),E(I)},children:jsxRuntime.jsx(X$1,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},I)):jsxRuntime.jsx("span",{className:"text-muted-foreground",children:o})}),jsxRuntime.jsx(ChevronsUpDown,{className:"h-4 w-4 shrink-0 opacity-50 ml-2"})]})}),jsxRuntime.jsx(PopoverContent,{className:"w-full p-0",style:{width:S},children:jsxRuntime.jsxs(Command,{onKeyDown:M,children:[jsxRuntime.jsx(CommandInput,{placeholder:"Search or add custom item...",value:g,onValueChange:b}),jsxRuntime.jsxs(CommandList,{children:[jsxRuntime.jsx(CommandEmpty,{children:"No item found."}),jsxRuntime.jsxs(CommandGroup,{children:[e.filter(I=>!t.includes(I)).map(I=>jsxRuntime.jsxs(CommandItem,{onSelect:()=>A(I),children:[jsxRuntime.jsx(Check,{className:cn("mr-2 h-4 w-4",t.includes(I)?"opacity-100":"opacity-0")}),I]},I)),g&&!e.includes(g)&&!t.includes(g)&&jsxRuntime.jsxs(CommandItem,{onSelect:()=>A(g),children:['Add "',g,'"']})]})]})]})})]})}const imgSizeMap={sm:100,md:200,lg:300,xl:400},Placeholder=({size:e})=>jsxRuntime.jsx("div",{className:"rounded-md bg-muted flex items-center justify-center",style:{width:e,height:e},"aria-label":"Image not available",children:jsxRuntime.jsx(ImageOff,{className:"h-1/2 w-1/2 text-muted-foreground"})}),VideoSkeleton=()=>jsxRuntime.jsx(Skeleton,{className:"w-full",style:{aspectRatio:"16/9"}});function ProductImage({randmarSKU:e,size:t="md",alt:n,secondaryContent:o}){const[l,d]=React__namespace.useState(!1),[f,g]=React__namespace.useState(!1),[b,_]=React__namespace.useState(!1),S=imgSizeMap[t],R=React.useRef(null),C=useIntersectionObserver({elementRef:R,threshold:.1,rootMargin:"100px"}),{data:E,isFetching:A}=useGetProductByProductNumberImageExistsQuery({productNumber:e},{skip:!e||!C}),{data:M,isFetching:I}=useGetProductByRandmarSkuImageQuery({randmarSku:e,width:S*1.5,height:S*1.5},{skip:!E}),{data:j}=useGetProductByProductNumberVideoExistsQuery({productNumber:e},{skip:!e||!C}),{data:q,isFetching:Q}=useGetProductByProductNumberVideoQuery({productNumber:e},{skip:!j||!l}),te=A||I;async function F(){if(q){_(!0);try{const se=await(await fetch(q)).blob(),$e=window.URL.createObjectURL(se),Ne=document.createElement("a");Ne.href=$e,Ne.download=`${e||"product"}-video.mp4`,document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),window.URL.revokeObjectURL($e)}catch(ae){console.error("Error downloading video:",ae)}finally{_(!1)}}}function V(){navigator.clipboard.writeText(`https://api.randmar.io/Product/${e}/Video`),g(!0),setTimeout(()=>g(!1),2e3)}function ne(){j&&d(!0)}return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Dialog,{open:l,onOpenChange:d,children:jsxRuntime.jsx(DialogContent,{className:"max-w-4xl p-0 overflow-hidden",children:Q||!q?jsxRuntime.jsx(VideoSkeleton,{}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:o?jsxRuntime.jsxs("div",{className:"flex flex-row",children:[jsxRuntime.jsxs("video",{className:"w-full rounded-l-lg max-h-[720px] object-contain",controls:!0,autoPlay:!0,muted:!0,loop:!0,children:[jsxRuntime.jsx("source",{src:q,type:"video/mp4"}),"Your browser does not support the video tag."]}),jsxRuntime.jsx("div",{className:"flex-grow min-w-[400px] h-[70vh] p-6",children:o})]}):jsxRuntime.jsxs("div",{className:"w-full relative",children:[jsxRuntime.jsxs("video",{className:"w-full max-h-[720px] object-contain",controls:!0,autoPlay:!0,children:[jsxRuntime.jsx("source",{src:q,type:"video/mp4"}),"Your browser does not support the video tag."]}),jsxRuntime.jsxs("div",{className:"absolute top-2 right-12 flex gap-1",children:[jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"secondary",size:"icon",onClick:V,children:f?jsxRuntime.jsx(Check,{className:"h-4 w-4"}):jsxRuntime.jsx(Copy,{className:"h-4 w-4"})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Copy video link"})})]})}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"secondary",size:"icon",onClick:F,disabled:b,children:jsxRuntime.jsx(Download,{className:"h-4 w-4"})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Download video"})})]})})]})]})})})}),jsxRuntime.jsxs("div",{className:"relative w-max h-max",ref:R,children:[te?jsxRuntime.jsx(Skeleton,{className:"rounded-md",style:{width:S,height:S}}):M?jsxRuntime.jsx("img",{alt:n||`Product ${e}`,className:`rounded-md ${j?"cursor-pointer":""}`,onClick:ne,src:M,width:S,height:S}):jsxRuntime.jsx(Placeholder,{size:S}),j==!0&&jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"secondary",size:"icon",className:"absolute top-2 right-2",onClick:ne,children:jsxRuntime.jsx(Play,{className:"h-4 w-4"})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Play video"})})]})})]})]})}function ResellerBillingOverviewCard({reseller:e,actions:t,loading:n=!1}){return n||!e?jsxRuntime.jsx(ResellerBillingOverviewSkeleton,{}):jsxRuntime.jsx(ResellerBillingOverviewData,{reseller:e,actions:t})}function ResellerBillingOverviewSkeleton(){return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:jsxRuntime.jsx(Skeleton,{className:"h-6 w-40"})})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4",children:[jsxRuntime.jsx("div",{className:"space-y-4",children:Array(3).fill(0).map((e,t)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-28"})]})]},t))}),jsxRuntime.jsx("div",{className:"space-y-4",children:Array(2).fill(0).map((e,t)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-28"})]})]},t))})]}),jsxRuntime.jsx("div",{className:"flex justify-end mt-4",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-28 rounded-md"})})]})]})}function ResellerBillingOverviewData({reseller:e,actions:t}){const n=e.Statement||{},o=[{title:"0 - 30 Days",amount:n.Over0||0,icon:jsxRuntime.jsx(Calendar$1,{className:"h-5 w-5 text-white"}),color:"bg-primary"},{title:"31 - 45 Days",amount:n.Over30||0,icon:jsxRuntime.jsx(Calendar$1,{className:"h-5 w-5 text-white"}),color:"bg-primary"},{title:"45+ Days",amount:n.Over45||0,icon:jsxRuntime.jsx(Calendar$1,{className:"h-5 w-5 text-white"}),color:"bg-primary"}],l=[{title:"Total",amount:n.Total||0,icon:jsxRuntime.jsx(DollarSign,{className:"h-5 w-5 text-white"}),color:"bg-green-500"},{title:"Credit Limit",amount:e.CreditLimit||0,icon:jsxRuntime.jsx(CreditCard,{className:"h-5 w-5 text-white"}),color:"bg-blue-500"}];return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Billing Overview"})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4",children:[jsxRuntime.jsx("div",{className:"space-y-4",children:o.map((d,f)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("h3",{className:"text-sm sm:text-base font-medium",children:d.title}),jsxRuntime.jsx("div",{className:`p-2 rounded-full ${d.color}`,children:d.icon})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx("p",{className:"text-base sm:text-lg font-bold",children:formatMoney(d.amount)})})]},f))}),jsxRuntime.jsx("div",{className:"space-y-4",children:l.map((d,f)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("h3",{className:"text-sm sm:text-base font-medium",children:d.title}),jsxRuntime.jsx("div",{className:`p-2 rounded-full ${d.color}`,children:d.icon})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx("p",{className:"text-base sm:text-lg font-bold",children:formatMoney(d.amount)})})]},f))})]}),t&&jsxRuntime.jsx("div",{className:"flex justify-end mt-4",children:t})]})]})}function ResellerQualificationsCard({qualifications:e=[],loading:t=!1}){return t?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Qualifications"})}),jsxRuntime.jsx(CardContent,{className:"p-6",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 @sm:grid-cols-3 @md:grid-cols-4 @lg:grid-cols-5 gap-4 gap-y-8",children:Array.from({length:10}).map((n,o)=>jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-24 rounded-md mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"})]},o))})})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Qualifications"})}),jsxRuntime.jsx(CardContent,{children:e&&e.length>0?jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx("div",{className:"flex grid grid-cols-2 @sm:grid-cols-3 @md:grid-cols-4 @lg:grid-cols-5 gap-4 gap-y-8",children:e.map((n,o)=>jsxRuntime.jsx(ManufacturerLogo,{manufacturerId:n.ManufacturerId,opportunityNumber:n.DefaultOpportunityNumber},`${n.ManufacturerId}-${o}`))})}):jsxRuntime.jsx("p",{children:"No qualification available."})})]})}function ManufacturerLogo({manufacturerId:e,opportunityNumber:t}){return jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx("div",{className:"h-12 w-full items-center justify-center mb-2",children:jsxRuntime.jsx(PartnerLogo,{id:e,width:96,height:48})}),t&&jsxRuntime.jsx(Badge,{variant:"outline",className:"text-xs",children:t})]})}function SalesOverviewCard({salesData:e,salesStatistics:t=[],loading:n=!1}){return n||!e?jsxRuntime.jsx(SalesOverviewSkeleton,{}):jsxRuntime.jsx(SalesOverviewData,{salesData:e,salesStatistics:t})}function SalesOverviewSkeleton(){return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg @sm:text-xl",children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-40"})})}),jsxRuntime.jsxs(CardContent,{className:"pt-4 px-3 @sm:px-6",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 gap-4",children:Array(3).fill(0).map((e,t)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-28"})]})]},t))}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-[250px] w-full rounded-lg"})]})})]})]})}function SalesOverviewData({salesData:e,salesStatistics:t=[]}){const n=[{title:"Last 30 days",amount:e.SalesLast30Days||0,icon:jsxRuntime.jsx(Calendar$1,{className:"h-5 w-5 text-white"}),color:"bg-blue-500"},{title:"Last 3 months",amount:e.SalesLast3Months||0,icon:jsxRuntime.jsx(Calendar$1,{className:"h-5 w-5 text-white"}),color:"bg-amber-500"},{title:"Year to date",amount:e.SalesYearToDay||0,icon:jsxRuntime.jsx(Calendar$1,{className:"h-5 w-5 text-white"}),color:"bg-emerald-500"}];return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg @sm:text-xl",children:"Sales Overview"})}),jsxRuntime.jsxs(CardContent,{className:"pt-4 px-3 @sm:px-6",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 gap-4",children:n.map((o,l)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"text-sm @sm:text-base font-medium",children:o.title}),jsxRuntime.jsx("div",{className:`p-2 rounded-full ${o.color}`,children:o.icon})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base @sm:text-lg font-bold",children:formatMoney(o.amount)})]})]},l))}),jsxRuntime.jsx("div",{className:"mt-6",children:t&&t.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("h3",{className:"text-sm font-medium mb-4",children:"Sales Trend"}),jsxRuntime.jsx("div",{className:"space-y-6",children:jsxRuntime.jsx(SalesChart,{statistics:t,chartHeight:300,mode:"week"})})]})})]})]})}var SLOTTABLE_IDENTIFIER=Symbol("radix.slottable");function createSlottable(e){const t=({children:n})=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=SLOTTABLE_IDENTIFIER,t}var ROOT_NAME="AlertDialog",[createAlertDialogContext]=createContextScope$2(ROOT_NAME,[createDialogScope]),useDialogScope=createDialogScope(),AlertDialog$1=e=>{const{__scopeAlertDialog:t,...n}=e,o=useDialogScope(t);return jsxRuntime.jsx(Root$a,{...o,...n,modal:!0})};AlertDialog$1.displayName=ROOT_NAME;var TRIGGER_NAME$2="AlertDialogTrigger",AlertDialogTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,l=useDialogScope(n);return jsxRuntime.jsx(Trigger$6,{...l,...o,ref:t})});AlertDialogTrigger$1.displayName=TRIGGER_NAME$2;var PORTAL_NAME="AlertDialogPortal",AlertDialogPortal$1=e=>{const{__scopeAlertDialog:t,...n}=e,o=useDialogScope(t);return jsxRuntime.jsx(Portal$4,{...o,...n})};AlertDialogPortal$1.displayName=PORTAL_NAME;var OVERLAY_NAME="AlertDialogOverlay",AlertDialogOverlay$1=React__namespace.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,l=useDialogScope(n);return jsxRuntime.jsx(Overlay,{...l,...o,ref:t})});AlertDialogOverlay$1.displayName=OVERLAY_NAME;var CONTENT_NAME$2="AlertDialogContent",[AlertDialogContentProvider,useAlertDialogContentContext]=createAlertDialogContext(CONTENT_NAME$2),Slottable=createSlottable("AlertDialogContent"),AlertDialogContent$1=React__namespace.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:o,...l}=e,d=useDialogScope(n),f=React__namespace.useRef(null),g=useComposedRefs(t,f),b=React__namespace.useRef(null);return jsxRuntime.jsx(WarningProvider,{contentName:CONTENT_NAME$2,titleName:TITLE_NAME,docsSlug:"alert-dialog",children:jsxRuntime.jsx(AlertDialogContentProvider,{scope:n,cancelRef:b,children:jsxRuntime.jsxs(Content$3,{role:"alertdialog",...d,...l,ref:g,onOpenAutoFocus:composeEventHandlers(l.onOpenAutoFocus,_=>{var S;_.preventDefault(),(S=b.current)==null||S.focus({preventScroll:!0})}),onPointerDownOutside:_=>_.preventDefault(),onInteractOutside:_=>_.preventDefault(),children:[jsxRuntime.jsx(Slottable,{children:o}),jsxRuntime.jsx(DescriptionWarning,{contentRef:f})]})})})});AlertDialogContent$1.displayName=CONTENT_NAME$2;var TITLE_NAME="AlertDialogTitle",AlertDialogTitle$1=React__namespace.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,l=useDialogScope(n);return jsxRuntime.jsx(Title$1,{...l,...o,ref:t})});AlertDialogTitle$1.displayName=TITLE_NAME;var DESCRIPTION_NAME="AlertDialogDescription",AlertDialogDescription$1=React__namespace.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,l=useDialogScope(n);return jsxRuntime.jsx(Description$1,{...l,...o,ref:t})});AlertDialogDescription$1.displayName=DESCRIPTION_NAME;var ACTION_NAME="AlertDialogAction",AlertDialogAction$1=React__namespace.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,l=useDialogScope(n);return jsxRuntime.jsx(Close$1,{...l,...o,ref:t})});AlertDialogAction$1.displayName=ACTION_NAME;var CANCEL_NAME="AlertDialogCancel",AlertDialogCancel$1=React__namespace.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:l}=useAlertDialogContentContext(CANCEL_NAME,n),d=useDialogScope(n),f=useComposedRefs(t,l);return jsxRuntime.jsx(Close$1,{...d,...o,ref:f})});AlertDialogCancel$1.displayName=CANCEL_NAME;var DescriptionWarning=({contentRef:e})=>{const t=`\`${CONTENT_NAME$2}\` requires a description for the component to be accessible for screen reader users.
|
|
1376
1376
|
|
package/dist/style.css
CHANGED
|
@@ -123,6 +123,21 @@ body {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
.randmar-assistant-backdrop {
|
|
127
|
+
background-color: rgba(4, 6, 10, 0.72);
|
|
128
|
+
background:
|
|
129
|
+
radial-gradient(circle at 18% 18%, color-mix(in oklch, var(--randmar-red) 60%, transparent) 0%, transparent 42%),
|
|
130
|
+
radial-gradient(circle at 78% 14%, color-mix(in oklch, var(--randmar-blue) 58%, transparent) 0%, transparent 46%),
|
|
131
|
+
radial-gradient(circle at 30% 78%, color-mix(in oklch, var(--randmar-purple) 55%, transparent) 0%, transparent 50%),
|
|
132
|
+
radial-gradient(circle at 82% 72%, color-mix(in oklch, var(--randmar-yellow) 50%, transparent) 0%, transparent 48%),
|
|
133
|
+
linear-gradient(145deg, color-mix(in oklch, var(--sidebar) 70%, black 30%), color-mix(in oklch, var(--sidebar) 55%, var(--randmar-black) 45%));
|
|
134
|
+
background-blend-mode: screen, screen, screen, screen, multiply;
|
|
135
|
+
backdrop-filter: blur(22px) saturate(1.15);
|
|
136
|
+
-webkit-backdrop-filter: blur(22px) saturate(1.15);
|
|
137
|
+
box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--sidebar-border) 35%, transparent);
|
|
138
|
+
opacity: 0.98;
|
|
139
|
+
}
|
|
140
|
+
|
|
126
141
|
@keyframes pulse-glow {
|
|
127
142
|
0%, 100% {
|
|
128
143
|
transform: scale(1);
|