randmarcomps 1.84.0 → 1.85.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 +7 -65
- package/dist/randmarcomps.js +1 -1
- package/dist/randmarcomps.umd.cjs +1 -1
- package/package.json +2 -1
package/dist/randmarcomps.d.ts
CHANGED
|
@@ -3,8 +3,10 @@ import { ClassProp } from 'class-variance-authority/types';
|
|
|
3
3
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
4
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
5
5
|
import { FC } from 'react';
|
|
6
|
+
import { FlatProduct } from 'randmar-api-client';
|
|
6
7
|
import { ForwardRefExoticComponent } from 'react';
|
|
7
8
|
import { InputProps as InputProps_2 } from './input';
|
|
9
|
+
import { Inventory } from 'randmar-api-client';
|
|
8
10
|
import { JSX } from 'react/jsx-runtime';
|
|
9
11
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
10
12
|
import { MouseEventHandler } from 'react';
|
|
@@ -34,7 +36,7 @@ export declare interface BadgeProps extends React_2.HTMLAttributes<HTMLDivElemen
|
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
export declare const badgeVariants: (props?: ({
|
|
37
|
-
variant?: "default" | "
|
|
39
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "success" | "warning" | "info" | "randmarRed" | "randmarBlue" | "randmarPurple" | "randmarGreen" | "randmarBlack" | "randmarYellow" | null | undefined;
|
|
38
40
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
39
41
|
} & ClassProp) | undefined) => string;
|
|
40
42
|
|
|
@@ -46,7 +48,7 @@ export declare interface ButtonProps extends React_2.ButtonHTMLAttributes<HTMLBu
|
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
export declare const buttonVariants: (props?: ({
|
|
49
|
-
variant?: "link" | "default" | "none" | "
|
|
51
|
+
variant?: "link" | "default" | "none" | "destructive" | "outline" | "defaultOutline" | "secondary" | "ghost" | "blue" | "red" | null | undefined;
|
|
50
52
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
51
53
|
} & ClassProp) | undefined) => string;
|
|
52
54
|
|
|
@@ -210,38 +212,10 @@ declare interface PartnerCardProps {
|
|
|
210
212
|
loading?: boolean;
|
|
211
213
|
}
|
|
212
214
|
|
|
213
|
-
declare interface Product {
|
|
214
|
-
Title?: string;
|
|
215
|
-
RandmarTitle?: string;
|
|
216
|
-
RandmarSKU?: string;
|
|
217
|
-
ManufacturerId?: string;
|
|
218
|
-
ManufacturerName?: string;
|
|
219
|
-
MPN?: string;
|
|
220
|
-
UPC?: string;
|
|
221
|
-
UnitWeight?: number;
|
|
222
|
-
MAP?: number;
|
|
223
|
-
CountryCodeOfOrigin?: string;
|
|
224
|
-
State?: string;
|
|
225
|
-
SerialNumber?: boolean;
|
|
226
|
-
TransparencyCode?: boolean;
|
|
227
|
-
AvailableToBuy?: boolean;
|
|
228
|
-
AutoUpdate?: boolean;
|
|
229
|
-
MasterCarton?: number;
|
|
230
|
-
BodyHTML?: string;
|
|
231
|
-
Distribution?: ProductDistribution;
|
|
232
|
-
Opportunities?: Array<ProductOpportunity>;
|
|
233
|
-
InstantRebate?: {
|
|
234
|
-
EndDate?: string;
|
|
235
|
-
};
|
|
236
|
-
ManufacturerCategory?: {
|
|
237
|
-
QualificationRequired?: boolean;
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
|
|
241
215
|
export declare function ProductCard({ item, addToCart, syncToShopify, customAction, defaultOpportunityNumber, viewProductAction, addToCartAction, isAddToCartActionLoading, syncToShopifyAction, isSyncToShopifyActionLoading, }: ProductCardProps): JSX.Element;
|
|
242
216
|
|
|
243
217
|
export declare interface ProductCardProps {
|
|
244
|
-
item?:
|
|
218
|
+
item?: FlatProduct;
|
|
245
219
|
addToCart?: boolean;
|
|
246
220
|
syncToShopify?: boolean;
|
|
247
221
|
defaultOpportunityNumber?: string;
|
|
@@ -256,13 +230,6 @@ export declare interface ProductCardProps {
|
|
|
256
230
|
customAction?: React.ReactNode;
|
|
257
231
|
}
|
|
258
232
|
|
|
259
|
-
export declare interface ProductDistribution {
|
|
260
|
-
Price?: number;
|
|
261
|
-
RegularPrice?: number;
|
|
262
|
-
Cost?: number;
|
|
263
|
-
Inventory?: Array<WarehouseInventory>;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
233
|
export declare function ProductImage({ randmarSKU, size, alt, secondaryContent }: ProductImageProps): JSX.Element;
|
|
267
234
|
|
|
268
235
|
export declare interface ProductImageProps {
|
|
@@ -275,22 +242,10 @@ export declare interface ProductImageProps {
|
|
|
275
242
|
export declare function ProductInventoryGrid({ inventory, showBinLocation }: ProductInventoryGridProps): JSX.Element;
|
|
276
243
|
|
|
277
244
|
declare interface ProductInventoryGridProps {
|
|
278
|
-
inventory:
|
|
245
|
+
inventory: Inventory[];
|
|
279
246
|
showBinLocation?: boolean;
|
|
280
247
|
}
|
|
281
248
|
|
|
282
|
-
export declare interface ProductOpportunity {
|
|
283
|
-
Active?: boolean;
|
|
284
|
-
BidNumber?: string;
|
|
285
|
-
StartDate?: string;
|
|
286
|
-
EndDate?: string;
|
|
287
|
-
Opportunity?: string;
|
|
288
|
-
ManufacturerId?: string;
|
|
289
|
-
Price?: number;
|
|
290
|
-
RandmarSKU?: string;
|
|
291
|
-
Rebate?: number;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
249
|
export declare const Separator: React_2.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
295
250
|
|
|
296
251
|
export declare const Sheet: React_2.FC<DialogPrimitive.DialogProps>;
|
|
@@ -415,7 +370,7 @@ export declare const SidebarTrigger: React_2.ForwardRefExoticComponent<Omit<Butt
|
|
|
415
370
|
export declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
416
371
|
|
|
417
372
|
export declare const Toast: React_2.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React_2.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
|
|
418
|
-
variant?: "default" | "
|
|
373
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "success" | "warning" | "info" | null | undefined;
|
|
419
374
|
} & ClassProp) | undefined) => string> & React_2.RefAttributes<HTMLLIElement>>;
|
|
420
375
|
|
|
421
376
|
export declare function toast({ ...props }: Toast_2): {
|
|
@@ -478,17 +433,4 @@ export declare function useToast(): {
|
|
|
478
433
|
toasts: ToasterToast[];
|
|
479
434
|
};
|
|
480
435
|
|
|
481
|
-
declare interface WarehouseInventory {
|
|
482
|
-
RandmarSKU?: string;
|
|
483
|
-
WarehouseId?: string;
|
|
484
|
-
WarehouseType?: string;
|
|
485
|
-
Name?: string;
|
|
486
|
-
City?: string;
|
|
487
|
-
Province?: string;
|
|
488
|
-
Country?: string;
|
|
489
|
-
AvailableQuantity?: number;
|
|
490
|
-
PurchaseOrderQuantity?: number;
|
|
491
|
-
BinLocation?: string;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
436
|
export { }
|
package/dist/randmarcomps.js
CHANGED
|
@@ -191,6 +191,6 @@
|
|
|
191
191
|
|
|
192
192
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
193
193
|
|
|
194
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},zu="DialogDescriptionWarning",Bu=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Oa(zu).contentName}}.`;return i.useEffect(()=>{var s;const a=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},rn=ya,La=Na,Fa=Sa,Zt=Ea,Jt=Ta,Rt=Pa,er=_a,tr=Ia;const St=({modal:e=!1,...t})=>o.jsx(rn,{modal:e,...t});St.displayName=rn.displayName;const nn=La,$a=Fa,on=tr,an=i.forwardRef(({className:e,...t},r)=>o.jsx(Zt,{ref:r,className:_("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}));an.displayName=Zt.displayName;const Et=i.forwardRef(({className:e,children:t,...r},n)=>o.jsxs($a,{children:[o.jsx(an,{}),o.jsxs(Jt,{ref:n,className:_("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=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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,o.jsxs(tr,{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:[o.jsx(Ir,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Et.displayName=Jt.displayName;const rr=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});rr.displayName="DialogHeader";const sn=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});sn.displayName="DialogFooter";const nr=i.forwardRef(({className:e,...t},r)=>o.jsx(Rt,{ref:r,className:_("text-lg font-semibold leading-none tracking-tight",e),...t}));nr.displayName=Rt.displayName;const cn=i.forwardRef(({className:e,...t},r)=>o.jsx(er,{ref:r,className:_("text-sm text-muted-foreground",e),...t}));cn.displayName=er.displayName;function ln(e){const t=e+"CollectionProvider",[r,n]=Be(t),[a,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),c=m=>{const{scope:b,children:g}=m,w=H.useRef(null),v=H.useRef(new Map).current;return o.jsx(a,{scope:b,itemMap:v,collectionRef:w,children:g})};c.displayName=t;const l=e+"CollectionSlot",u=H.forwardRef((m,b)=>{const{scope:g,children:w}=m,v=s(l,g),y=oe(b,v.collectionRef);return o.jsx(ye,{ref:y,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=H.forwardRef((m,b)=>{const{scope:g,children:w,...v}=m,y=H.useRef(null),x=oe(b,y),N=s(d,g);return H.useEffect(()=>(N.itemMap.set(y,{ref:y,...v}),()=>void N.itemMap.delete(y))),o.jsx(ye,{[f]:"",ref:x,children:w})});p.displayName=d;function h(m){const b=s(e+"CollectionConsumer",m);return H.useCallback(()=>{const w=b.collectionRef.current;if(!w)return[];const v=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((N,E)=>v.indexOf(N.ref.current)-v.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:c,Slot:u,ItemSlot:p},h,n]}var Wu=i.createContext(void 0);function za(e){const t=i.useContext(Wu);return e||t||"ltr"}const Vu=["top","right","bottom","left"],Ge=Math.min,me=Math.max,or=Math.round,ar=Math.floor,De=e=>({x:e,y:e}),Gu={left:"right",right:"left",bottom:"top",top:"bottom"},Uu={start:"end",end:"start"};function dn(e,t,r){return me(e,Ge(t,r))}function Le(e,t){return typeof e=="function"?e(t):e}function Fe(e){return e.split("-")[0]}function ut(e){return e.split("-")[1]}function un(e){return e==="x"?"y":"x"}function fn(e){return e==="y"?"height":"width"}function Ue(e){return["top","bottom"].includes(Fe(e))?"y":"x"}function pn(e){return un(Ue(e))}function ju(e,t,r){r===void 0&&(r=!1);const n=ut(e),a=pn(e),s=fn(a);let c=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=sr(c)),[c,sr(c)]}function Hu(e){const t=sr(e);return[hn(e),t,hn(t)]}function hn(e){return e.replace(/start|end/g,t=>Uu[t])}function Ku(e,t,r){const n=["left","right"],a=["right","left"],s=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return r?t?a:n:t?n:a;case"left":case"right":return t?s:c;default:return[]}}function Yu(e,t,r,n){const a=ut(e);let s=Ku(Fe(e),r==="start",n);return a&&(s=s.map(c=>c+"-"+a),t&&(s=s.concat(s.map(hn)))),s}function sr(e){return e.replace(/left|right|bottom|top/g,t=>Gu[t])}function qu(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ba(e){return typeof e!="number"?qu(e):{top:e,right:e,bottom:e,left:e}}function ir(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Wa(e,t,r){let{reference:n,floating:a}=e;const s=Ue(t),c=pn(t),l=fn(c),u=Fe(t),d=s==="y",f=n.x+n.width/2-a.width/2,p=n.y+n.height/2-a.height/2,h=n[l]/2-a[l]/2;let m;switch(u){case"top":m={x:f,y:n.y-a.height};break;case"bottom":m={x:f,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:p};break;case"left":m={x:n.x-a.width,y:p};break;default:m={x:n.x,y:n.y}}switch(ut(t)){case"start":m[c]-=h*(r&&d?-1:1);break;case"end":m[c]+=h*(r&&d?-1:1);break}return m}const Xu=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:c}=r,l=s.filter(Boolean),u=await(c.isRTL==null?void 0:c.isRTL(t));let d=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:f,y:p}=Wa(d,n,u),h=n,m={},b=0;for(let g=0;g<l.length;g++){const{name:w,fn:v}=l[g],{x:y,y:x,data:N,reset:E}=await v({x:f,y:p,initialPlacement:n,placement:h,strategy:a,middlewareData:m,rects:d,platform:c,elements:{reference:e,floating:t}});f=y??f,p=x??p,m={...m,[w]:{...m[w],...N}},E&&b<=50&&(b++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(d=E.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):E.rects),{x:f,y:p}=Wa(d,h,u)),g=-1)}return{x:f,y:p,placement:h,strategy:a,middlewareData:m}};async function Tt(e,t){var r;t===void 0&&(t={});const{x:n,y:a,platform:s,rects:c,elements:l,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=Le(t,e),b=Ba(m),w=l[h?p==="floating"?"reference":"floating":p],v=ir(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(w)))==null||r?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),y=p==="floating"?{x:n,y:a,width:c.floating.width,height:c.floating.height}:c.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),N=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},E=ir(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:u}):y);return{top:(v.top-E.top+b.top)/N.y,bottom:(E.bottom-v.bottom+b.bottom)/N.y,left:(v.left-E.left+b.left)/N.x,right:(E.right-v.right+b.right)/N.x}}const Qu=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:s,platform:c,elements:l,middlewareData:u}=t,{element:d,padding:f=0}=Le(e,t)||{};if(d==null)return{};const p=Ba(f),h={x:r,y:n},m=pn(a),b=fn(m),g=await c.getDimensions(d),w=m==="y",v=w?"top":"left",y=w?"bottom":"right",x=w?"clientHeight":"clientWidth",N=s.reference[b]+s.reference[m]-h[m]-s.floating[b],E=h[m]-s.reference[m],C=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let T=C?C[x]:0;(!T||!await(c.isElement==null?void 0:c.isElement(C)))&&(T=l.floating[x]||s.floating[b]);const $=N/2-E/2,O=T/2-g[b]/2-1,B=Ge(p[v],O),K=Ge(p[y],O),F=B,L=T-g[b]-K,P=T/2-g[b]/2+$,V=dn(F,P,L),A=!u.arrow&&ut(a)!=null&&P!==V&&s.reference[b]/2-(P<F?B:K)-g[b]/2<0,X=A?P<F?P-F:P-L:0;return{[m]:h[m]+X,data:{[m]:V,centerOffset:P-V-X,...A&&{alignmentOffset:X}},reset:A}}}),Zu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:s,rects:c,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:g=!0,...w}=Le(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const v=Fe(a),y=Ue(l),x=Fe(l)===l,N=await(u.isRTL==null?void 0:u.isRTL(d.floating)),E=h||(x||!g?[sr(l)]:Hu(l)),C=b!=="none";!h&&C&&E.push(...Yu(l,g,b,N));const T=[l,...E],$=await Tt(t,w),O=[];let B=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&O.push($[v]),p){const P=ju(a,c,N);O.push($[P[0]],$[P[1]])}if(B=[...B,{placement:a,overflows:O}],!O.every(P=>P<=0)){var K,F;const P=(((K=s.flip)==null?void 0:K.index)||0)+1,V=T[P];if(V)return{data:{index:P,overflows:B},reset:{placement:V}};let A=(F=B.filter(X=>X.overflows[0]<=0).sort((X,D)=>X.overflows[1]-D.overflows[1])[0])==null?void 0:F.placement;if(!A)switch(m){case"bestFit":{var L;const X=(L=B.filter(D=>{if(C){const M=Ue(D.placement);return M===y||M==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(M=>M>0).reduce((M,Y)=>M+Y,0)]).sort((D,M)=>D[1]-M[1])[0])==null?void 0:L[0];X&&(A=X);break}case"initialPlacement":A=l;break}if(a!==A)return{reset:{placement:A}}}return{}}}};function Va(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ga(e){return Vu.some(t=>e[t]>=0)}const Ju=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=Le(e,t);switch(n){case"referenceHidden":{const s=await Tt(t,{...a,elementContext:"reference"}),c=Va(s,r.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Ga(c)}}}case"escaped":{const s=await Tt(t,{...a,altBoundary:!0}),c=Va(s,r.floating);return{data:{escapedOffsets:c,escaped:Ga(c)}}}default:return{}}}}};async function Ru(e,t){const{placement:r,platform:n,elements:a}=e,s=await(n.isRTL==null?void 0:n.isRTL(a.floating)),c=Fe(r),l=ut(r),u=Ue(r)==="y",d=["left","top"].includes(c)?-1:1,f=s&&u?-1:1,p=Le(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(m=l==="end"?b*-1:b),u?{x:m*f,y:h*d}:{x:h*d,y:m*f}}const ef=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:s,placement:c,middlewareData:l}=t,u=await Ru(t,e);return c===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+u.x,y:s+u.y,data:{...u,placement:c}}}}},tf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:w=>{let{x:v,y}=w;return{x:v,y}}},...u}=Le(e,t),d={x:r,y:n},f=await Tt(t,u),p=Ue(Fe(a)),h=un(p);let m=d[h],b=d[p];if(s){const w=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=m+f[w],x=m-f[v];m=dn(y,m,x)}if(c){const w=p==="y"?"top":"left",v=p==="y"?"bottom":"right",y=b+f[w],x=b-f[v];b=dn(y,b,x)}const g=l.fn({...t,[h]:m,[p]:b});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[h]:s,[p]:c}}}}}},rf=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:s,middlewareData:c}=t,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Le(e,t),f={x:r,y:n},p=Ue(a),h=un(p);let m=f[h],b=f[p];const g=Le(l,t),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(u){const x=h==="y"?"height":"width",N=s.reference[h]-s.floating[x]+w.mainAxis,E=s.reference[h]+s.reference[x]-w.mainAxis;m<N?m=N:m>E&&(m=E)}if(d){var v,y;const x=h==="y"?"width":"height",N=["top","left"].includes(Fe(a)),E=s.reference[p]-s.floating[x]+(N&&((v=c.offset)==null?void 0:v[p])||0)+(N?0:w.crossAxis),C=s.reference[p]+s.reference[x]+(N?0:((y=c.offset)==null?void 0:y[p])||0)-(N?w.crossAxis:0);b<E?b=E:b>C&&(b=C)}return{[h]:m,[p]:b}}}},nf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:s,platform:c,elements:l}=t,{apply:u=()=>{},...d}=Le(e,t),f=await Tt(t,d),p=Fe(a),h=ut(a),m=Ue(a)==="y",{width:b,height:g}=s.floating;let w,v;p==="top"||p==="bottom"?(w=p,v=h===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,w=h==="end"?"top":"bottom");const y=g-f.top-f.bottom,x=b-f.left-f.right,N=Ge(g-f[w],y),E=Ge(b-f[v],x),C=!t.middlewareData.shift;let T=N,$=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&($=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=y),C&&!h){const B=me(f.left,0),K=me(f.right,0),F=me(f.top,0),L=me(f.bottom,0);m?$=b-2*(B!==0||K!==0?B+K:me(f.left,f.right)):T=g-2*(F!==0||L!==0?F+L:me(f.top,f.bottom))}await u({...t,availableWidth:$,availableHeight:T});const O=await c.getDimensions(l.floating);return b!==O.width||g!==O.height?{reset:{rects:!0}}:{}}}};function cr(){return typeof window<"u"}function ft(e){return Ua(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(Ua(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ua(e){return cr()?e instanceof Node||e instanceof be(e).Node:!1}function Se(e){return cr()?e instanceof Element||e instanceof be(e).Element:!1}function ke(e){return cr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function ja(e){return!cr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}function Mt(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(a)}function of(e){return["table","td","th"].includes(ft(e))}function lr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function gn(e){const t=vn(),r=Se(e)?Ee(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function af(e){let t=je(e);for(;ke(t)&&!pt(t);){if(gn(t))return t;if(lr(t))return null;t=je(t)}return null}function vn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pt(e){return["html","body","#document"].includes(ft(e))}function Ee(e){return be(e).getComputedStyle(e)}function dr(e){return Se(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function je(e){if(ft(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ja(e)&&e.host||Ie(e);return ja(t)?t.host:t}function Ha(e){const t=je(e);return pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ke(t)&&Mt(t)?t:Ha(t)}function Pt(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=Ha(e),s=a===((n=e.ownerDocument)==null?void 0:n.body),c=be(a);if(s){const l=mn(c);return t.concat(c,c.visualViewport||[],Mt(a)?a:[],l&&r?Pt(l):[])}return t.concat(a,Pt(a,[],r))}function mn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ka(e){const t=Ee(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=ke(e),s=a?e.offsetWidth:r,c=a?e.offsetHeight:n,l=or(r)!==s||or(n)!==c;return l&&(r=s,n=c),{width:r,height:n,$:l}}function bn(e){return Se(e)?e:e.contextElement}function ht(e){const t=bn(e);if(!ke(t))return De(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=Ka(t);let c=(s?or(r.width):r.width)/n,l=(s?or(r.height):r.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}const sf=De(0);function Ya(e){const t=be(e);return!vn()||!t.visualViewport?sf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cf(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function Ze(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),s=bn(e);let c=De(1);t&&(n?Se(n)&&(c=ht(n)):c=ht(e));const l=cf(s,r,n)?Ya(s):De(0);let u=(a.left+l.x)/c.x,d=(a.top+l.y)/c.y,f=a.width/c.x,p=a.height/c.y;if(s){const h=be(s),m=n&&Se(n)?be(n):n;let b=h,g=mn(b);for(;g&&n&&m!==b;){const w=ht(g),v=g.getBoundingClientRect(),y=Ee(g),x=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*w.x,N=v.top+(g.clientTop+parseFloat(y.paddingTop))*w.y;u*=w.x,d*=w.y,f*=w.x,p*=w.y,u+=x,d+=N,b=be(g),g=mn(b)}}return ir({width:f,height:p,x:u,y:d})}function wn(e,t){const r=dr(e).scrollLeft;return t?t.left+r:Ze(Ie(e)).left+r}function qa(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-(r?0:wn(e,n)),s=n.top+t.scrollTop;return{x:a,y:s}}function lf(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s=a==="fixed",c=Ie(n),l=t?lr(t.floating):!1;if(n===c||l&&s)return r;let u={scrollLeft:0,scrollTop:0},d=De(1);const f=De(0),p=ke(n);if((p||!p&&!s)&&((ft(n)!=="body"||Mt(c))&&(u=dr(n)),ke(n))){const m=Ze(n);d=ht(n),f.x=m.x+n.clientLeft,f.y=m.y+n.clientTop}const h=c&&!p&&!s?qa(c,u,!0):De(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+f.x+h.x,y:r.y*d.y-u.scrollTop*d.y+f.y+h.y}}function df(e){return Array.from(e.getClientRects())}function uf(e){const t=Ie(e),r=dr(e),n=e.ownerDocument.body,a=me(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=me(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let c=-r.scrollLeft+wn(e);const l=-r.scrollTop;return Ee(n).direction==="rtl"&&(c+=me(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:c,y:l}}function ff(e,t){const r=be(e),n=Ie(e),a=r.visualViewport;let s=n.clientWidth,c=n.clientHeight,l=0,u=0;if(a){s=a.width,c=a.height;const d=vn();(!d||d&&t==="fixed")&&(l=a.offsetLeft,u=a.offsetTop)}return{width:s,height:c,x:l,y:u}}function pf(e,t){const r=Ze(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=ke(e)?ht(e):De(1),c=e.clientWidth*s.x,l=e.clientHeight*s.y,u=a*s.x,d=n*s.y;return{width:c,height:l,x:u,y:d}}function Xa(e,t,r){let n;if(t==="viewport")n=ff(e,r);else if(t==="document")n=uf(Ie(e));else if(Se(t))n=pf(t,r);else{const a=Ya(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return ir(n)}function Qa(e,t){const r=je(e);return r===t||!Se(r)||pt(r)?!1:Ee(r).position==="fixed"||Qa(r,t)}function hf(e,t){const r=t.get(e);if(r)return r;let n=Pt(e,[],!1).filter(l=>Se(l)&&ft(l)!=="body"),a=null;const s=Ee(e).position==="fixed";let c=s?je(e):e;for(;Se(c)&&!pt(c);){const l=Ee(c),u=gn(c);!u&&l.position==="fixed"&&(a=null),(s?!u&&!a:!u&&l.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||Mt(c)&&!u&&Qa(e,c))?n=n.filter(f=>f!==c):a=l,c=je(c)}return t.set(e,n),n}function gf(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const c=[...r==="clippingAncestors"?lr(t)?[]:hf(t,this._c):[].concat(r),n],l=c[0],u=c.reduce((d,f)=>{const p=Xa(t,f,a);return d.top=me(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=me(p.left,d.left),d},Xa(t,l,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function vf(e){const{width:t,height:r}=Ka(e);return{width:t,height:r}}function mf(e,t,r){const n=ke(t),a=Ie(t),s=r==="fixed",c=Ze(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=De(0);if(n||!n&&!s)if((ft(t)!=="body"||Mt(a))&&(l=dr(t)),n){const h=Ze(t,!0,s,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else a&&(u.x=wn(a));const d=a&&!n&&!s?qa(a,l):De(0),f=c.left+l.scrollLeft-u.x-d.x,p=c.top+l.scrollTop-u.y-d.y;return{x:f,y:p,width:c.width,height:c.height}}function yn(e){return Ee(e).position==="static"}function Za(e,t){if(!ke(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ie(e)===r&&(r=r.ownerDocument.body),r}function Ja(e,t){const r=be(e);if(lr(e))return r;if(!ke(e)){let a=je(e);for(;a&&!pt(a);){if(Se(a)&&!yn(a))return a;a=je(a)}return r}let n=Za(e,t);for(;n&&of(n)&&yn(n);)n=Za(n,t);return n&&pt(n)&&yn(n)&&!gn(n)?r:n||af(e)||r}const bf=async function(e){const t=this.getOffsetParent||Ja,r=this.getDimensions,n=await r(e.floating);return{reference:mf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function wf(e){return Ee(e).direction==="rtl"}const yf={convertOffsetParentRelativeRectToViewportRelativeRect:lf,getDocumentElement:Ie,getClippingRect:gf,getOffsetParent:Ja,getElementRects:bf,getClientRects:df,getDimensions:vf,getScale:ht,isElement:Se,isRTL:wf};function Ra(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xf(e,t){let r=null,n;const a=Ie(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function c(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:f,top:p,width:h,height:m}=d;if(l||t(),!h||!m)return;const b=ar(p),g=ar(a.clientWidth-(f+h)),w=ar(a.clientHeight-(p+m)),v=ar(f),x={rootMargin:-b+"px "+-g+"px "+-w+"px "+-v+"px",threshold:me(0,Ge(1,u))||1};let N=!0;function E(C){const T=C[0].intersectionRatio;if(T!==u){if(!N)return c();T?c(!1,T):n=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!Ra(d,e.getBoundingClientRect())&&c(),N=!1}try{r=new IntersectionObserver(E,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(E,x)}r.observe(e)}return c(!0),s}function Nf(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=bn(e),f=a||s?[...d?Pt(d):[],...Pt(t)]:[];f.forEach(v=>{a&&v.addEventListener("scroll",r,{passive:!0}),s&&v.addEventListener("resize",r)});const p=d&&l?xf(d,r):null;let h=-1,m=null;c&&(m=new ResizeObserver(v=>{let[y]=v;y&&y.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),r()}),d&&!u&&m.observe(d),m.observe(t));let b,g=u?Ze(e):null;u&&w();function w(){const v=Ze(e);g&&!Ra(g,v)&&r(),g=v,b=requestAnimationFrame(w)}return r(),()=>{var v;f.forEach(y=>{a&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),p==null||p(),(v=m)==null||v.disconnect(),m=null,u&&cancelAnimationFrame(b)}}const Cf=ef,Sf=tf,Ef=Zu,Tf=nf,Mf=Ju,es=Qu,Pf=rf,Af=(e,t,r)=>{const n=new Map,a={platform:yf,...r},s={...a.platform,_c:n};return Xu(e,t,{...a,platform:s})};var ur=typeof document<"u"?H.useLayoutEffect:H.useEffect;function fr(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 r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!fr(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const s=a[n];if(!(s==="_owner"&&e.$$typeof)&&!fr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ts(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rs(e,t){const r=ts(e);return Math.round(t*r)/r}function xn(e){const t=i.useRef(e);return ur(()=>{t.current=e}),t}function _f(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=i.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=i.useState(n);fr(h,n)||m(n);const[b,g]=i.useState(null),[w,v]=i.useState(null),y=i.useCallback(D=>{D!==C.current&&(C.current=D,g(D))},[]),x=i.useCallback(D=>{D!==T.current&&(T.current=D,v(D))},[]),N=s||b,E=c||w,C=i.useRef(null),T=i.useRef(null),$=i.useRef(f),O=u!=null,B=xn(u),K=xn(a),F=xn(d),L=i.useCallback(()=>{if(!C.current||!T.current)return;const D={placement:t,strategy:r,middleware:h};K.current&&(D.platform=K.current),Af(C.current,T.current,D).then(M=>{const Y={...M,isPositioned:F.current!==!1};P.current&&!fr($.current,Y)&&($.current=Y,_r.flushSync(()=>{p(Y)}))})},[h,t,r,K,F]);ur(()=>{d===!1&&$.current.isPositioned&&($.current.isPositioned=!1,p(D=>({...D,isPositioned:!1})))},[d]);const P=i.useRef(!1);ur(()=>(P.current=!0,()=>{P.current=!1}),[]),ur(()=>{if(N&&(C.current=N),E&&(T.current=E),N&&E){if(B.current)return B.current(N,E,L);L()}},[N,E,L,B,O]);const V=i.useMemo(()=>({reference:C,floating:T,setReference:y,setFloating:x}),[y,x]),A=i.useMemo(()=>({reference:N,floating:E}),[N,E]),X=i.useMemo(()=>{const D={position:r,left:0,top:0};if(!A.floating)return D;const M=rs(A.floating,f.x),Y=rs(A.floating,f.y);return l?{...D,transform:"translate("+M+"px, "+Y+"px)",...ts(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:M,top:Y}},[r,l,A.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:L,refs:V,elements:A,floatingStyles:X}),[f,L,V,A,X])}const Df=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?es({element:n.current,padding:a}).fn(r):{}:n?es({element:n,padding:a}).fn(r):{}}}},If=(e,t)=>({...Cf(e),options:[e,t]}),kf=(e,t)=>({...Sf(e),options:[e,t]}),Of=(e,t)=>({...Pf(e),options:[e,t]}),Lf=(e,t)=>({...Ef(e),options:[e,t]}),Ff=(e,t)=>({...Tf(e),options:[e,t]}),$f=(e,t)=>({...Mf(e),options:[e,t]}),zf=(e,t)=>({...Df(e),options:[e,t]});var Bf="Arrow",ns=i.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...s}=e;return o.jsx(Z.svg,{...s,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});ns.displayName=Bf;var Wf=ns;function Vf(e){const[t,r]=i.useState(void 0);return We(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const s=a[0];let c,l;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;c=d.inlineSize,l=d.blockSize}else c=e.offsetWidth,l=e.offsetHeight;r({width:c,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Nn="Popper",[os,pr]=Be(Nn),[Gf,as]=os(Nn),ss=e=>{const{__scopePopper:t,children:r}=e,[n,a]=i.useState(null);return o.jsx(Gf,{scope:t,anchor:n,onAnchorChange:a,children:r})};ss.displayName=Nn;var is="PopperAnchor",cs=i.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,s=as(is,r),c=i.useRef(null),l=oe(t,c);return i.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||c.current)}),n?null:o.jsx(Z.div,{...a,ref:l})});cs.displayName=is;var Cn="PopperContent",[Uf,jf]=os(Cn),ls=i.forwardRef((e,t)=>{var ae,Me,de,Pe,G,J;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:b,...g}=e,w=as(Cn,r),[v,y]=i.useState(null),x=oe(t,he=>y(he)),[N,E]=i.useState(null),C=Vf(N),T=(C==null?void 0:C.width)??0,$=(C==null?void 0:C.height)??0,O=n+(s!=="center"?"-"+s:""),B=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},K=Array.isArray(d)?d:[d],F=K.length>0,L={padding:B,boundary:K.filter(Kf),altBoundary:F},{refs:P,floatingStyles:V,placement:A,isPositioned:X,middlewareData:D}=_f({strategy:"fixed",placement:O,whileElementsMounted:(...he)=>Nf(...he,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[If({mainAxis:a+$,alignmentAxis:c}),u&&kf({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Of():void 0,...L}),u&&Lf({...L}),Ff({...L,apply:({elements:he,rects:W,availableWidth:j,availableHeight:ue})=>{const{width:ge,height:ve}=W.reference,R=he.floating.style;R.setProperty("--radix-popper-available-width",`${j}px`),R.setProperty("--radix-popper-available-height",`${ue}px`),R.setProperty("--radix-popper-anchor-width",`${ge}px`),R.setProperty("--radix-popper-anchor-height",`${ve}px`)}}),N&&zf({element:N,padding:l}),Yf({arrowWidth:T,arrowHeight:$}),h&&$f({strategy:"referenceHidden",...L})]}),[M,Y]=fs(A),Q=fe(b);We(()=>{X&&(Q==null||Q())},[X,Q]);const ee=(ae=D.arrow)==null?void 0:ae.x,te=(Me=D.arrow)==null?void 0:Me.y,ne=((de=D.arrow)==null?void 0:de.centerOffset)!==0,[se,le]=i.useState();return We(()=>{v&&le(window.getComputedStyle(v).zIndex)},[v]),o.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:X?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Pe=D.transformOrigin)==null?void 0:Pe.x,(G=D.transformOrigin)==null?void 0:G.y].join(" "),...((J=D.hide)==null?void 0:J.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(Uf,{scope:r,placedSide:M,onArrowChange:E,arrowX:ee,arrowY:te,shouldHideArrow:ne,children:o.jsx(Z.div,{"data-side":M,"data-align":Y,...g,ref:x,style:{...g.style,animation:X?void 0:"none"}})})})});ls.displayName=Cn;var ds="PopperArrow",Hf={top:"bottom",right:"left",bottom:"top",left:"right"},us=i.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=jf(ds,n),c=Hf[s.placedSide];return o.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:o.jsx(Wf,{...a,ref:r,style:{...a.style,display:"block"}})})});us.displayName=ds;function Kf(e){return e!==null}var Yf=e=>({name:"transformOrigin",options:e,fn(t){var w,v,y;const{placement:r,rects:n,middlewareData:a}=t,c=((w=a.arrow)==null?void 0:w.centerOffset)!==0,l=c?0:e.arrowWidth,u=c?0:e.arrowHeight,[d,f]=fs(r),p={start:"0%",center:"50%",end:"100%"}[f],h=(((v=a.arrow)==null?void 0:v.x)??0)+l/2,m=(((y=a.arrow)==null?void 0:y.y)??0)+u/2;let b="",g="";return d==="bottom"?(b=c?p:`${h}px`,g=`${-u}px`):d==="top"?(b=c?p:`${h}px`,g=`${n.floating.height+u}px`):d==="right"?(b=`${-u}px`,g=c?p:`${m}px`):d==="left"&&(b=`${n.floating.width+u}px`,g=c?p:`${m}px`),{data:{x:b,y:g}}}});function fs(e){const[t,r="center"]=e.split("-");return[t,r]}var Sn=ss,ps=cs,hs=ls,gs=us,En="rovingFocusGroup.onEntryFocus",qf={bubbles:!1,cancelable:!0},hr="RovingFocusGroup",[Tn,vs,Xf]=ln(hr),[Qf,ms]=Be(hr,[Xf]),[Zf,Jf]=Qf(hr),bs=i.forwardRef((e,t)=>o.jsx(Tn.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Tn.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Rf,{...e,ref:t})})}));bs.displayName=hr;var Rf=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,h=i.useRef(null),m=oe(t,h),b=za(s),[g=null,w]=st({prop:c,defaultProp:l,onChange:u}),[v,y]=i.useState(!1),x=fe(d),N=vs(r),E=i.useRef(!1),[C,T]=i.useState(0);return i.useEffect(()=>{const $=h.current;if($)return $.addEventListener(En,x),()=>$.removeEventListener(En,x)},[x]),o.jsx(Zf,{scope:r,orientation:n,dir:b,loop:a,currentTabStopId:g,onItemFocus:i.useCallback($=>w($),[w]),onItemShiftTab:i.useCallback(()=>y(!0),[]),onFocusableItemAdd:i.useCallback(()=>T($=>$+1),[]),onFocusableItemRemove:i.useCallback(()=>T($=>$-1),[]),children:o.jsx(Z.div,{tabIndex:v||C===0?-1:0,"data-orientation":n,...p,ref:m,style:{outline:"none",...e.style},onMouseDown:z(e.onMouseDown,()=>{E.current=!0}),onFocus:z(e.onFocus,$=>{const O=!E.current;if($.target===$.currentTarget&&O&&!v){const B=new CustomEvent(En,qf);if($.currentTarget.dispatchEvent(B),!B.defaultPrevented){const K=N().filter(A=>A.focusable),F=K.find(A=>A.active),L=K.find(A=>A.id===g),V=[F,L,...K].filter(Boolean).map(A=>A.ref.current);xs(V,f)}}E.current=!1}),onBlur:z(e.onBlur,()=>y(!1))})})}),ws="RovingFocusGroupItem",ys=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:s,...c}=e,l=Oe(),u=s||l,d=Jf(ws,r),f=d.currentTabStopId===u,p=vs(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=d;return i.useEffect(()=>{if(n)return h(),()=>m()},[n,h,m]),o.jsx(Tn.ItemSlot,{scope:r,id:u,focusable:n,active:a,children:o.jsx(Z.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:z(e.onMouseDown,b=>{n?d.onItemFocus(u):b.preventDefault()}),onFocus:z(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:z(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const g=rp(b,d.orientation,d.dir);if(g!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let v=p().filter(y=>y.focusable).map(y=>y.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const y=v.indexOf(b.currentTarget);v=d.loop?np(v,y+1):v.slice(y+1)}setTimeout(()=>xs(v))}})})})});ys.displayName=ws;var ep={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tp(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function rp(e,t,r){const n=tp(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return ep[n]}function xs(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function np(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var op=bs,ap=ys,Mn=["Enter"," "],sp=["ArrowDown","PageUp","Home"],Ns=["ArrowUp","PageDown","End"],ip=[...sp,...Ns],cp={ltr:[...Mn,"ArrowRight"],rtl:[...Mn,"ArrowLeft"]},lp={ltr:["ArrowLeft"],rtl:["ArrowRight"]},At="Menu",[_t,dp,up]=ln(At),[Je,Cs]=Be(At,[up,pr,ms]),Dt=pr(),Ss=ms(),[Es,He]=Je(At),[fp,It]=Je(At),Ts=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:s,modal:c=!0}=e,l=Dt(t),[u,d]=i.useState(null),f=i.useRef(!1),p=fe(s),h=za(a);return i.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),o.jsx(Sn,{...l,children:o.jsx(Es,{scope:t,open:r,onOpenChange:p,content:u,onContentChange:d,children:o.jsx(fp,{scope:t,onClose:i.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:h,modal:c,children:n})})})};Ts.displayName=At;var pp="MenuAnchor",Pn=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=Dt(r);return o.jsx(ps,{...a,...n,ref:t})});Pn.displayName=pp;var An="MenuPortal",[hp,Ms]=Je(An,{forceMount:void 0}),Ps=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:a}=e,s=He(An,t);return o.jsx(hp,{scope:t,forceMount:r,children:o.jsx(Ne,{present:r||s.open,children:o.jsx(Ct,{asChild:!0,container:a,children:n})})})};Ps.displayName=An;var xe="MenuContent",[gp,_n]=Je(xe),As=i.forwardRef((e,t)=>{const r=Ms(xe,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,s=He(xe,e.__scopeMenu),c=It(xe,e.__scopeMenu);return o.jsx(_t.Provider,{scope:e.__scopeMenu,children:o.jsx(Ne,{present:n||s.open,children:o.jsx(_t.Slot,{scope:e.__scopeMenu,children:c.modal?o.jsx(vp,{...a,ref:t}):o.jsx(mp,{...a,ref:t})})})})}),vp=i.forwardRef((e,t)=>{const r=He(xe,e.__scopeMenu),n=i.useRef(null),a=oe(t,n);return i.useEffect(()=>{const s=n.current;if(s)return ba(s)},[]),o.jsx(Dn,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),mp=i.forwardRef((e,t)=>{const r=He(xe,e.__scopeMenu);return o.jsx(Dn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Dn=i.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:m,disableOutsideScroll:b,...g}=e,w=He(xe,r),v=It(xe,r),y=Dt(r),x=Ss(r),N=dp(r),[E,C]=i.useState(null),T=i.useRef(null),$=oe(t,T,w.onContentChange),O=i.useRef(0),B=i.useRef(""),K=i.useRef(0),F=i.useRef(null),L=i.useRef("right"),P=i.useRef(0),V=b?Qr:i.Fragment,A=b?{as:ye,allowPinchZoom:!0}:void 0,X=M=>{var ae,Me;const Y=B.current+M,Q=N().filter(de=>!de.disabled),ee=document.activeElement,te=(ae=Q.find(de=>de.ref.current===ee))==null?void 0:ae.textValue,ne=Q.map(de=>de.textValue),se=Ap(ne,Y,te),le=(Me=Q.find(de=>de.textValue===se))==null?void 0:Me.ref.current;(function de(Pe){B.current=Pe,window.clearTimeout(O.current),Pe!==""&&(O.current=window.setTimeout(()=>de(""),1e3))})(Y),le&&setTimeout(()=>le.focus())};i.useEffect(()=>()=>window.clearTimeout(O.current),[]),na();const D=i.useCallback(M=>{var Q,ee;return L.current===((Q=F.current)==null?void 0:Q.side)&&Dp(M,(ee=F.current)==null?void 0:ee.area)},[]);return o.jsx(gp,{scope:r,searchRef:B,onItemEnter:i.useCallback(M=>{D(M)&&M.preventDefault()},[D]),onItemLeave:i.useCallback(M=>{var Y;D(M)||((Y=T.current)==null||Y.focus(),C(null))},[D]),onTriggerLeave:i.useCallback(M=>{D(M)&&M.preventDefault()},[D]),pointerGraceTimerRef:K,onPointerGraceIntentChange:i.useCallback(M=>{F.current=M},[]),children:o.jsx(V,{...A,children:o.jsx(jr,{asChild:!0,trapped:a,onMountAutoFocus:z(s,M=>{var Y;M.preventDefault(),(Y=T.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:o.jsx(Nt,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:m,children:o.jsx(op,{asChild:!0,...x,dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:C,onEntryFocus:z(u,M=>{v.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(hs,{role:"menu","aria-orientation":"vertical","data-state":Ys(w.open),"data-radix-menu-content":"",dir:v.dir,...y,...g,ref:$,style:{outline:"none",...g.style},onKeyDown:z(g.onKeyDown,M=>{const Q=M.target.closest("[data-radix-menu-content]")===M.currentTarget,ee=M.ctrlKey||M.altKey||M.metaKey,te=M.key.length===1;Q&&(M.key==="Tab"&&M.preventDefault(),!ee&&te&&X(M.key));const ne=T.current;if(M.target!==ne||!ip.includes(M.key))return;M.preventDefault();const le=N().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);Ns.includes(M.key)&&le.reverse(),Mp(le)}),onBlur:z(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(O.current),B.current="")}),onPointerMove:z(e.onPointerMove,Ot(M=>{const Y=M.target,Q=P.current!==M.clientX;if(M.currentTarget.contains(Y)&&Q){const ee=M.clientX>P.current?"right":"left";L.current=ee,P.current=M.clientX}}))})})})})})})});As.displayName=xe;var bp="MenuGroup",In=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(Z.div,{role:"group",...n,ref:t})});In.displayName=bp;var wp="MenuLabel",_s=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(Z.div,{...n,ref:t})});_s.displayName=wp;var gr="MenuItem",Ds="menu.itemSelect",vr=i.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...a}=e,s=i.useRef(null),c=It(gr,e.__scopeMenu),l=_n(gr,e.__scopeMenu),u=oe(t,s),d=i.useRef(!1),f=()=>{const p=s.current;if(!r&&p){const h=new CustomEvent(Ds,{bubbles:!0,cancelable:!0});p.addEventListener(Ds,m=>n==null?void 0:n(m),{once:!0}),Wr(p,h),h.defaultPrevented?d.current=!1:c.onClose()}};return o.jsx(Is,{...a,ref:u,disabled:r,onClick:z(e.onClick,f),onPointerDown:p=>{var h;(h=e.onPointerDown)==null||h.call(e,p),d.current=!0},onPointerUp:z(e.onPointerUp,p=>{var h;d.current||(h=p.currentTarget)==null||h.click()}),onKeyDown:z(e.onKeyDown,p=>{const h=l.searchRef.current!=="";r||h&&p.key===" "||Mn.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});vr.displayName=gr;var Is=i.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...s}=e,c=_n(gr,r),l=Ss(r),u=i.useRef(null),d=oe(t,u),[f,p]=i.useState(!1),[h,m]=i.useState("");return i.useEffect(()=>{const b=u.current;b&&m((b.textContent??"").trim())},[s.children]),o.jsx(_t.ItemSlot,{scope:r,disabled:n,textValue:a??h,children:o.jsx(ap,{asChild:!0,...l,focusable:!n,children:o.jsx(Z.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:d,onPointerMove:z(e.onPointerMove,Ot(b=>{n?c.onItemLeave(b):(c.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,Ot(b=>c.onItemLeave(b))),onFocus:z(e.onFocus,()=>p(!0)),onBlur:z(e.onBlur,()=>p(!1))})})})}),yp="MenuCheckboxItem",ks=i.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...a}=e;return o.jsx(zs,{scope:e.__scopeMenu,checked:r,children:o.jsx(vr,{role:"menuitemcheckbox","aria-checked":mr(r)?"mixed":r,...a,ref:t,"data-state":Ln(r),onSelect:z(a.onSelect,()=>n==null?void 0:n(mr(r)?!0:!r),{checkForDefaultPrevented:!1})})})});ks.displayName=yp;var Os="MenuRadioGroup",[xp,Np]=Je(Os,{value:void 0,onValueChange:()=>{}}),Ls=i.forwardRef((e,t)=>{const{value:r,onValueChange:n,...a}=e,s=fe(n);return o.jsx(xp,{scope:e.__scopeMenu,value:r,onValueChange:s,children:o.jsx(In,{...a,ref:t})})});Ls.displayName=Os;var Fs="MenuRadioItem",$s=i.forwardRef((e,t)=>{const{value:r,...n}=e,a=Np(Fs,e.__scopeMenu),s=r===a.value;return o.jsx(zs,{scope:e.__scopeMenu,checked:s,children:o.jsx(vr,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":Ln(s),onSelect:z(n.onSelect,()=>{var c;return(c=a.onValueChange)==null?void 0:c.call(a,r)},{checkForDefaultPrevented:!1})})})});$s.displayName=Fs;var kn="MenuItemIndicator",[zs,Cp]=Je(kn,{checked:!1}),Bs=i.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...a}=e,s=Cp(kn,r);return o.jsx(Ne,{present:n||mr(s.checked)||s.checked===!0,children:o.jsx(Z.span,{...a,ref:t,"data-state":Ln(s.checked)})})});Bs.displayName=kn;var Sp="MenuSeparator",Ws=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(Z.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Ws.displayName=Sp;var Ep="MenuArrow",Vs=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=Dt(r);return o.jsx(gs,{...a,...n,ref:t})});Vs.displayName=Ep;var On="MenuSub",[Tp,Gs]=Je(On),Us=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:a}=e,s=He(On,t),c=Dt(t),[l,u]=i.useState(null),[d,f]=i.useState(null),p=fe(a);return i.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),o.jsx(Sn,{...c,children:o.jsx(Es,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:o.jsx(Tp,{scope:t,contentId:Oe(),triggerId:Oe(),trigger:l,onTriggerChange:u,children:r})})})};Us.displayName=On;var kt="MenuSubTrigger",js=i.forwardRef((e,t)=>{const r=He(kt,e.__scopeMenu),n=It(kt,e.__scopeMenu),a=Gs(kt,e.__scopeMenu),s=_n(kt,e.__scopeMenu),c=i.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},f=i.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return i.useEffect(()=>f,[f]),i.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),u(null)}},[l,u]),o.jsx(Pn,{asChild:!0,...d,children:o.jsx(Is,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":Ys(r.open),...e,ref:Vt(t,a.onTriggerChange),onClick:p=>{var h;(h=e.onClick)==null||h.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,Ot(p=>{s.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!r.open&&!c.current&&(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:z(e.onPointerLeave,Ot(p=>{var m,b;f();const h=(m=r.content)==null?void 0:m.getBoundingClientRect();if(h){const g=(b=r.content)==null?void 0:b.dataset.side,w=g==="right",v=w?-5:5,y=h[w?"left":"right"],x=h[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:p.clientX+v,y:p.clientY},{x:y,y:h.top},{x,y:h.top},{x,y:h.bottom},{x:y,y:h.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(p),p.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,p=>{var m;const h=s.searchRef.current!=="";e.disabled||h&&p.key===" "||cp[n.dir].includes(p.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),p.preventDefault())})})})});js.displayName=kt;var Hs="MenuSubContent",Ks=i.forwardRef((e,t)=>{const r=Ms(xe,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,s=He(xe,e.__scopeMenu),c=It(xe,e.__scopeMenu),l=Gs(Hs,e.__scopeMenu),u=i.useRef(null),d=oe(t,u);return o.jsx(_t.Provider,{scope:e.__scopeMenu,children:o.jsx(Ne,{present:n||s.open,children:o.jsx(_t.Slot,{scope:e.__scopeMenu,children:o.jsx(Dn,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var p;c.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:z(e.onFocusOutside,f=>{f.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,f=>{c.onClose(),f.preventDefault()}),onKeyDown:z(e.onKeyDown,f=>{var m;const p=f.currentTarget.contains(f.target),h=lp[c.dir].includes(f.key);p&&h&&(s.onOpenChange(!1),(m=l.trigger)==null||m.focus(),f.preventDefault())})})})})})});Ks.displayName=Hs;function Ys(e){return e?"open":"closed"}function mr(e){return e==="indeterminate"}function Ln(e){return mr(e)?"indeterminate":e?"checked":"unchecked"}function Mp(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Pp(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function Ap(e,t,r){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let c=Pp(e,Math.max(s,0));a.length===1&&(c=c.filter(d=>d!==r));const u=c.find(d=>d.toLowerCase().startsWith(a.toLowerCase()));return u!==r?u:void 0}function _p(e,t){const{x:r,y:n}=e;let a=!1;for(let s=0,c=t.length-1;s<t.length;c=s++){const l=t[s].x,u=t[s].y,d=t[c].x,f=t[c].y;u>n!=f>n&&r<(d-l)*(n-u)/(f-u)+l&&(a=!a)}return a}function Dp(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return _p(r,t)}function Ot(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Ip=Ts,kp=Pn,Op=Ps,Lp=As,Fp=In,$p=_s,zp=vr,Bp=ks,Wp=Ls,Vp=$s,Gp=Bs,Up=Ws,jp=Vs,Hp=Us,Kp=js,Yp=Ks,Fn="DropdownMenu",[qp,sv]=Be(Fn,[Cs]),pe=Cs(),[Xp,qs]=qp(Fn),Xs=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=pe(t),d=i.useRef(null),[f=!1,p]=st({prop:a,defaultProp:s,onChange:c});return o.jsx(Xp,{scope:t,triggerId:Oe(),triggerRef:d,contentId:Oe(),open:f,onOpenChange:p,onOpenToggle:i.useCallback(()=>p(h=>!h),[p]),modal:l,children:o.jsx(Ip,{...u,open:f,onOpenChange:p,dir:n,modal:l,children:r})})};Xs.displayName=Fn;var Qs="DropdownMenuTrigger",Zs=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,s=qs(Qs,r),c=pe(r);return o.jsx(kp,{asChild:!0,...c,children:o.jsx(Z.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:Vt(t,s.triggerRef),onPointerDown:z(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:z(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});Zs.displayName=Qs;var Qp="DropdownMenuPortal",Js=e=>{const{__scopeDropdownMenu:t,...r}=e,n=pe(t);return o.jsx(Op,{...n,...r})};Js.displayName=Qp;var Rs="DropdownMenuContent",ei=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=qs(Rs,r),s=pe(r),c=i.useRef(!1);return o.jsx(Lp,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...n,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,l=>{var u;c.current||(u=a.triggerRef.current)==null||u.focus(),c.current=!1,l.preventDefault()}),onInteractOutside:z(e.onInteractOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!a.modal||f)&&(c.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)"}})});ei.displayName=Rs;var Zp="DropdownMenuGroup",ti=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Fp,{...a,...n,ref:t})});ti.displayName=Zp;var Jp="DropdownMenuLabel",ri=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx($p,{...a,...n,ref:t})});ri.displayName=Jp;var Rp="DropdownMenuItem",ni=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(zp,{...a,...n,ref:t})});ni.displayName=Rp;var eh="DropdownMenuCheckboxItem",oi=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Bp,{...a,...n,ref:t})});oi.displayName=eh;var th="DropdownMenuRadioGroup",ai=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Wp,{...a,...n,ref:t})});ai.displayName=th;var rh="DropdownMenuRadioItem",si=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Vp,{...a,...n,ref:t})});si.displayName=rh;var nh="DropdownMenuItemIndicator",ii=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Gp,{...a,...n,ref:t})});ii.displayName=nh;var oh="DropdownMenuSeparator",ci=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Up,{...a,...n,ref:t})});ci.displayName=oh;var ah="DropdownMenuArrow",sh=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(jp,{...a,...n,ref:t})});sh.displayName=ah;var ih=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:a,defaultOpen:s}=e,c=pe(t),[l=!1,u]=st({prop:n,defaultProp:s,onChange:a});return o.jsx(Hp,{...c,open:l,onOpenChange:u,children:r})},ch="DropdownMenuSubTrigger",li=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Kp,{...a,...n,ref:t})});li.displayName=ch;var lh="DropdownMenuSubContent",di=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Yp,{...a,...n,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)"}})});di.displayName=lh;var dh=Xs,uh=Zs,ui=Js,fi=ei,fh=ti,pi=ri,hi=ni,gi=oi,ph=ai,vi=si,mi=ii,bi=ci,hh=ih,wi=li,yi=di;const gh=dh,vh=uh,mh=fh,bh=ui,wh=hh,yh=ph,xi=i.forwardRef(({className:e,inset:t,children:r,...n},a)=>o.jsxs(wi,{ref:a,className:_("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),...n,children:[r,o.jsx(fl,{className:"ml-auto"})]}));xi.displayName=wi.displayName;const Ni=i.forwardRef(({className:e,...t},r)=>o.jsx(yi,{ref:r,className:_("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}));Ni.displayName=yi.displayName;const Ci=i.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(ui,{children:o.jsx(fi,{ref:n,sideOffset:t,className:_("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),...r})}));Ci.displayName=fi.displayName;const Si=i.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(hi,{ref:n,className:_("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),...r}));Si.displayName=hi.displayName;const Ei=i.forwardRef(({className:e,children:t,checked:r,...n},a)=>o.jsxs(gi,{ref:a,className:_("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(mi,{children:o.jsx(Dr,{className:"h-4 w-4"})})}),t]}));Ei.displayName=gi.displayName;const Ti=i.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(vi,{ref:n,className:_("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(mi,{children:o.jsx(hl,{className:"h-2 w-2 fill-current"})})}),t]}));Ti.displayName=vi.displayName;const Mi=i.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(pi,{ref:n,className:_("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Mi.displayName=pi.displayName;const Pi=i.forwardRef(({className:e,...t},r)=>o.jsx(bi,{ref:r,className:_("-mx-1 my-1 h-px bg-muted",e),...t}));Pi.displayName=bi.displayName;const Ai=({className:e,...t})=>o.jsx("span",{className:_("ml-auto text-xs tracking-widest opacity-60",e),...t});Ai.displayName="DropdownMenuShortcut";function _i({inventory:e,showBinLocation:t}){const r=(v,y,x=!1,N=!0)=>o.jsxs("div",{className:`p-3 text-sm ${N&&y>0?"border-t":""} ${x?"border-r":""}`,children:[o.jsxs("div",{className:"flex justify-between font-medium",children:[o.jsx("span",{children:v.Name}),o.jsx("span",{children:v.AvailableQuantity})]}),o.jsxs("div",{className:"flex justify-between mt-1 text-xs text-gray-600",children:[o.jsx("span",{children:"Expecting"}),o.jsx("span",{children:v.PurchaseOrderQuantity||"-"})]}),t&&o.jsxs("div",{className:"flex justify-between mt-1 text-xs text-gray-600",children:[o.jsx("span",{children:"Bin Location"}),o.jsx("span",{children:v.BinLocation||"-"})]})]},`warehouse-${v.WarehouseId}`),n=["MTL","TOR"],a=["VAN","EDM"],s=[...e].sort((v,y)=>(v.Name||"").localeCompare(y.Name||"")),c=s.filter(v=>v.Country==="US"),l=s.filter(v=>v.Country==="CA"),u=s.filter(v=>a.includes(v.WarehouseId||"")),d=s.filter(v=>n.includes(v.WarehouseId||"")),f=l.filter(v=>!n.includes(v.WarehouseId||"")&&!a.includes(v.WarehouseId||"")),p=v=>v.reduce((y,x)=>y+(x.AvailableQuantity||0),0),h=p(l),m=p(d),b=p(u),g=p(c),w=h+g;return o.jsxs("div",{className:"border rounded-md overflow-hidden",children:[l.length>0&&c.length>0&&o.jsxs("div",{className:"grid grid-cols-2 border-b",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"Total"}),o.jsx("span",{children:w})]}),o.jsx("div",{className:"p-3"})]}),l.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 border-b bg-gray-50",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"Canada"}),o.jsx("span",{children:h})]}),o.jsx("div",{className:"p-3"})]}),o.jsxs("div",{className:"grid grid-cols-2",children:[o.jsxs("div",{className:"border-r",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"West"}),o.jsx("span",{children:b})]}),u.map((v,y)=>r(v,y))]}),o.jsxs("div",{children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"East"}),o.jsx("span",{children:m})]}),d.map((v,y)=>r(v,y))]})]}),f.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t p-3 font-semibold text-sm",children:o.jsx("span",{children:"Other"})}),o.jsx("div",{className:"grid grid-cols-2",children:f.map((v,y)=>r(v,y,y%2===0,!0))})]})]}),c.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 border-t bg-gray-50",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"United States"}),o.jsx("span",{children:g})]}),o.jsx("div",{className:"p-3"})]}),o.jsx("div",{className:"grid grid-cols-2",children:c.map((v,y)=>r(v,y,y%2===0,!0))})]}),e.length===0&&o.jsx("div",{className:"p-6 text-center text-gray-500",children:"No inventory information available"})]})}const Di=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ii=ko,Lt=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Ii(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:s}=t,c=Object.keys(a).map(d=>{const f=r==null?void 0:r[d],p=s==null?void 0:s[d];if(f===null)return null;const h=Di(f)||Di(p);return a[d][h]}),l=r&&Object.entries(r).reduce((d,f)=>{let[p,h]=f;return h===void 0||(d[p]=h),d},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,f)=>{let{class:p,className:h,...m}=f;return Object.entries(m).every(b=>{let[g,w]=b;return Array.isArray(w)?w.includes({...s,...l}[g]):{...s,...l}[g]===w})?[...d,p,h]:d},[]);return Ii(e,c,u,r==null?void 0:r.class,r==null?void 0:r.className)},$n=Lt("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 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",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"}}),ce=i.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,confirmationDialog:a,onClick:s,...c},l)=>{const u=n?ye:"button";if(!a)return o.jsx(u,{className:_($n({variant:t,size:r,className:e})),ref:l,onClick:s,...c});s&&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:d,content:f,onConfirm:p,confirmText:h="Confirm",cancelText:m="Cancel"}=a,b=()=>{p()};return o.jsxs(St,{children:[o.jsx(nn,{asChild:!0,children:o.jsx(u,{className:_($n({variant:t,size:r,className:e})),ref:l,...c})}),o.jsxs(Et,{children:[o.jsxs(rr,{children:[o.jsx(nr,{children:d}),o.jsx(cn,{children:f})]}),o.jsxs(sn,{className:"flex justify-end gap-2 pt-4",children:[o.jsx(on,{asChild:!0,children:o.jsx(ce,{variant:"outline",children:m})}),o.jsx(on,{asChild:!0,children:o.jsx(ce,{onClick:b,children:h})})]})]})]})});ce.displayName="Button";var xh="VisuallyHidden",br=i.forwardRef((e,t)=>o.jsx(Z.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));br.displayName=xh;var Nh=br,[wr,iv]=Be("Tooltip",[pr]),yr=pr(),ki="TooltipProvider",Ch=700,zn="tooltip.open",[Sh,Bn]=wr(ki),Oi=e=>{const{__scopeTooltip:t,delayDuration:r=Ch,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:s}=e,[c,l]=i.useState(!0),u=i.useRef(!1),d=i.useRef(0);return i.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),o.jsx(Sh,{scope:t,isOpenDelayed:c,delayDuration:r,onOpen:i.useCallback(()=>{window.clearTimeout(d.current),l(!1)},[]),onClose:i.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(!0),n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:i.useCallback(f=>{u.current=f},[]),disableHoverableContent:a,children:s})};Oi.displayName=ki;var xr="Tooltip",[Eh,Ft]=wr(xr),Li=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a=!1,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=Bn(xr,e.__scopeTooltip),d=yr(t),[f,p]=i.useState(null),h=Oe(),m=i.useRef(0),b=c??u.disableHoverableContent,g=l??u.delayDuration,w=i.useRef(!1),[v=!1,y]=st({prop:n,defaultProp:a,onChange:T=>{T?(u.onOpen(),document.dispatchEvent(new CustomEvent(zn))):u.onClose(),s==null||s(T)}}),x=i.useMemo(()=>v?w.current?"delayed-open":"instant-open":"closed",[v]),N=i.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w.current=!1,y(!0)},[y]),E=i.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),C=i.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,y(!0),m.current=0},g)},[g,y]);return i.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),o.jsx(Sn,{...d,children:o.jsx(Eh,{scope:t,contentId:h,open:v,stateAttribute:x,trigger:f,onTriggerChange:p,onTriggerEnter:i.useCallback(()=>{u.isOpenDelayed?C():N()},[u.isOpenDelayed,C,N]),onTriggerLeave:i.useCallback(()=>{b?E():(window.clearTimeout(m.current),m.current=0)},[E,b]),onOpen:N,onClose:E,disableHoverableContent:b,children:r})})};Li.displayName=xr;var Wn="TooltipTrigger",Fi=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=Ft(Wn,r),s=Bn(Wn,r),c=yr(r),l=i.useRef(null),u=oe(t,l,a.onTriggerChange),d=i.useRef(!1),f=i.useRef(!1),p=i.useCallback(()=>d.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),o.jsx(ps,{asChild:!0,...c,children:o.jsx(Z.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:u,onPointerMove:z(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),f.current=!0)}),onPointerLeave:z(e.onPointerLeave,()=>{a.onTriggerLeave(),f.current=!1}),onPointerDown:z(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:z(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:z(e.onBlur,a.onClose),onClick:z(e.onClick,a.onClose)})})});Fi.displayName=Wn;var Vn="TooltipPortal",[Th,Mh]=wr(Vn,{forceMount:void 0}),$i=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,s=Ft(Vn,t);return o.jsx(Th,{scope:t,forceMount:r,children:o.jsx(Ne,{present:r||s.open,children:o.jsx(Ct,{asChild:!0,container:a,children:n})})})};$i.displayName=Vn;var gt="TooltipContent",zi=i.forwardRef((e,t)=>{const r=Mh(gt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...s}=e,c=Ft(gt,e.__scopeTooltip);return o.jsx(Ne,{present:n||c.open,children:c.disableHoverableContent?o.jsx(Bi,{side:a,...s,ref:t}):o.jsx(Ph,{side:a,...s,ref:t})})}),Ph=i.forwardRef((e,t)=>{const r=Ft(gt,e.__scopeTooltip),n=Bn(gt,e.__scopeTooltip),a=i.useRef(null),s=oe(t,a),[c,l]=i.useState(null),{trigger:u,onClose:d}=r,f=a.current,{onPointerInTransitChange:p}=n,h=i.useCallback(()=>{l(null),p(!1)},[p]),m=i.useCallback((b,g)=>{const w=b.currentTarget,v={x:b.clientX,y:b.clientY},y=Ih(v,w.getBoundingClientRect()),x=kh(v,y),N=Oh(g.getBoundingClientRect()),E=Fh([...x,...N]);l(E),p(!0)},[p]);return i.useEffect(()=>()=>h(),[h]),i.useEffect(()=>{if(u&&f){const b=w=>m(w,f),g=w=>m(w,u);return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",g),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",g)}}},[u,f,m,h]),i.useEffect(()=>{if(c){const b=g=>{const w=g.target,v={x:g.clientX,y:g.clientY},y=(u==null?void 0:u.contains(w))||(f==null?void 0:f.contains(w)),x=!Lh(v,c);y?h():x&&(h(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,c,d,h]),o.jsx(Bi,{...e,ref:s})}),[Ah,_h]=wr(xr,{isInside:!1}),Bi=i.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=Ft(gt,r),d=yr(r),{onClose:f}=u;return i.useEffect(()=>(document.addEventListener(zn,f),()=>document.removeEventListener(zn,f)),[f]),i.useEffect(()=>{if(u.trigger){const p=h=>{const m=h.target;m!=null&&m.contains(u.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,f]),o.jsx(Nt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:o.jsxs(hs,{"data-state":u.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(Ko,{children:n}),o.jsx(Ah,{scope:r,isInside:!0,children:o.jsx(Nh,{id:u.contentId,role:"tooltip",children:a||n})})]})})});zi.displayName=gt;var Wi="TooltipArrow",Dh=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=yr(r);return _h(Wi,r).isInside?null:o.jsx(gs,{...a,...n,ref:t})});Dh.displayName=Wi;function Ih(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,a,s)){case s:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function kh(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Oh(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function Lh(e,t){const{x:r,y:n}=e;let a=!1;for(let s=0,c=t.length-1;s<t.length;c=s++){const l=t[s].x,u=t[s].y,d=t[c].x,f=t[c].y;u>n!=f>n&&r<(d-l)*(n-u)/(f-u)+l&&(a=!a)}return a}function Fh(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),$h(t)}function $h(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const a=e[n];for(;t.length>=2;){const s=t[t.length-1],c=t[t.length-2];if((s.x-c.x)*(a.y-c.y)>=(s.y-c.y)*(a.x-c.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;r.length>=2;){const s=r[r.length-1],c=r[r.length-2];if((s.x-c.x)*(a.y-c.y)>=(s.y-c.y)*(a.x-c.x))r.pop();else break}r.push(a)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var zh=Oi,Bh=Li,Wh=Fi,Vh=$i,Vi=zi;const vt=zh,mt=Bh,bt=Wh,Re=i.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(Vh,{children:o.jsx(Vi,{ref:n,sideOffset:t,className:_("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Re.displayName=Vi.displayName;const Nr=i.forwardRef(({className:e,type:t,mask:r,onChange:n,placeholder:a,...s},c)=>{const[l,u]=i.useState(!1),d=i.useRef(null),p=a||(r==="phone"?"(999) 999-9999":r==="postal-code-ca"?"A9A 9A9":r==="zip-code-us"?"99999":""),h=()=>r==="phone"?"Only enter numbers. Formatting will be added automatically.":r==="postal-code-ca"?"Enter letters and numbers only. Spacing will be applied automatically.":r==="zip-code-us"?"Only enter numbers. Formatting will be added automatically.":"",m=()=>{u(!0),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{u(!1)},3e3)};i.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const b=g=>{if(r){const w=g.target.value;let v=w;if(w.length>0){const y=w[w.length-1];/[^a-zA-Z0-9]/.test(y)&&(console.log("Non-alphanumeric detected:",y),m())}if(r==="phone"){const y=w.replace(/\D/g,"");y.length<=3?v=y:y.length<=6?v=`(${y.slice(0,3)}) ${y.slice(3)}`:v=`(${y.slice(0,3)}) ${y.slice(3,6)}-${y.slice(6,10)}`}else if(r==="postal-code-ca"){const y=w.replace(/[^a-zA-Z0-9]/g,"").toUpperCase();let x="";for(let N=0;N<Math.min(y.length,6);N++){const E=y[N];N===0||N===2||N===4?/[A-Z]/.test(E)&&(x+=E):(N===1||N===3||N===5)&&/[0-9]/.test(E)&&(x+=E)}x.length<=3?v=x:v=`${x.slice(0,3)} ${x.slice(3,6)}`}else if(r==="zip-code-us"){const y=w.replace(/\D/g,"");y.length<=5?v=y:v=`${y.slice(0,5)}-${y.slice(5,9)}`}g.target.value=v}n==null||n(g)};return o.jsx(vt,{children:o.jsxs(mt,{open:l&&!!r,children:[o.jsx(bt,{asChild:!0,children:o.jsx("input",{type:t,className:_("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),onChange:b,placeholder:p,ref:c,...s})}),o.jsx(Re,{side:"top",className:"bg-sidebar text-sidebar-foreground",children:h()})]})})});Nr.displayName="Input";var Gh="Separator",Gi="horizontal",Uh=["horizontal","vertical"],Ui=i.forwardRef((e,t)=>{const{decorative:r,orientation:n=Gi,...a}=e,s=jh(n)?n:Gi,l=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return o.jsx(Z.div,{"data-orientation":s,...l,...a,ref:t})});Ui.displayName=Gh;function jh(e){return Uh.includes(e)}var ji=Ui;const Gn=i.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},a)=>o.jsx(ji,{ref:a,decorative:r,orientation:t,className:_("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Gn.displayName=ji.displayName;const Hi=rn,Hh=La,Kh=tr,Ki=Fa,Un=i.forwardRef(({className:e,...t},r)=>o.jsx(Zt,{className:_("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,ref:r}));Un.displayName=Zt.displayName;const Yh=Lt("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),jn=i.forwardRef(({side:e="right",className:t,children:r,...n},a)=>o.jsxs(Ki,{children:[o.jsx(Un,{}),o.jsxs(Jt,{ref:a,className:_(Yh({side:e}),t),...n,children:[o.jsxs(tr,{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-secondary",children:[o.jsx(Ir,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));jn.displayName=Jt.displayName;const Yi=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col space-y-2 text-center sm:text-left",e),...t});Yi.displayName="SheetHeader";const qi=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});qi.displayName="SheetFooter";const Xi=i.forwardRef(({className:e,...t},r)=>o.jsx(Rt,{ref:r,className:_("text-lg font-semibold text-foreground",e),...t}));Xi.displayName=Rt.displayName;const Qi=i.forwardRef(({className:e,...t},r)=>o.jsx(er,{ref:r,className:_("text-sm text-muted-foreground",e),...t}));Qi.displayName=er.displayName;function qh({onClick:e,publicName:t,applicationName:r,partnerId:n}){const a=`https://api.randmar.io/v4/Partner/${n}/Account/Logo?height=72&width=72`,[s,c]=H.useState(!1),l=()=>{c(!0)};return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-muted "+(e!==void 0?"cursor-pointer":""),children:s?o.jsx(ce,{asChild:!0,size:"icon",onClick:e,children:o.jsx(Ml,{className:"h-5 w-5 text-muted-foreground !bg-sidebar"})}):o.jsx(ce,{asChild:!0,size:"icon",onClick:e,children:o.jsx("img",{src:a,alt:"Partner logo",className:"h-9 w-9 object-cover !bg-sidebar",onError:l})})}),o.jsxs("div",{className:"flex flex-1 flex-col",children:[o.jsx("span",{className:"text-sm font-medium",children:t||"Partner"}),o.jsx("span",{className:"text-xs text-neutral-400",children:r})]})]})}var Xh="Label",Zi=i.forwardRef((e,t)=>o.jsx(Z.label,{...e,ref:t,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Zi.displayName=Xh;var Qh=Zi;function Zh({className:e,...t}){return o.jsx(Qh,{"data-slot":"label",className:_("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const Hn=1024;function Ji(){const[e,t]=i.useState(void 0);return i.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Hn-1}px)`),n=()=>{t(window.innerWidth<Hn)};return r.addEventListener("change",n),t(window.innerWidth<Hn),()=>r.removeEventListener("change",n)},[]),!!e}function U({className:e,...t}){return o.jsx("div",{className:_("animate-pulse rounded-md bg-primary/20",e),...t})}const Jh="sidebar:state",Rh=60*60*24*7,eg="16rem",tg="18rem",rg="3rem",ng="b",Ri=i.createContext(null);function $t(){const e=i.useContext(Ri);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Kn=i.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:a,children:s,...c},l)=>{const u=Ji(),[d,f]=i.useState(!1),[p,h]=i.useState(e),m=t??p,b=i.useCallback(y=>{const x=typeof y=="function"?y(m):y;r?r(x):h(x),document.cookie=`${Jh}=${x}; path=/; max-age=${Rh}`},[r,m]),g=i.useCallback(()=>u?f(y=>!y):b(y=>!y),[u,b,f]);i.useEffect(()=>{const y=x=>{x.key===ng&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[g]);const w=m?"expanded":"collapsed",v=i.useMemo(()=>({state:w,open:m,setOpen:b,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:g}),[w,m,b,u,d,f,g]);return o.jsx(Ri.Provider,{value:v,children:o.jsx(vt,{delayDuration:0,children:o.jsx("div",{style:{"--sidebar-width":eg,"--sidebar-width-icon":rg,...a},className:_("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",n),ref:l,...c,children:s})})})});Kn.displayName="SidebarProvider";const Yn=i.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:a,...s},c)=>{const{isMobile:l,state:u,openMobile:d,setOpenMobile:f}=$t();return r==="none"?o.jsx("div",{className:_("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",n),ref:c,...s,children:a}):l?o.jsx(Hi,{open:d,onOpenChange:f,...s,children:o.jsx(jn,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":tg},side:e,children:o.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):o.jsxs("div",{ref:c,className:"group peer hidden md:block text-sidebar-foreground","data-state":u,"data-collapsible":u==="collapsed"?r:"","data-variant":t,"data-side":e,children:[o.jsx("div",{className:_("duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),o.jsx("div",{className:_("duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...s,children:o.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:a})})]})});Yn.displayName="Sidebar";const qn=i.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:a}=$t();return o.jsxs(ce,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:_("h-7 w-7 text-sidebar-foreground",e),onClick:s=>{t==null||t(s),a()},...r,children:[o.jsx(xl,{}),o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});qn.displayName="SidebarTrigger";const ec=i.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=$t();return o.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:_("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});ec.displayName="SidebarRail";const tc=i.forwardRef(({className:e,...t},r)=>o.jsx("main",{ref:r,className:_("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",e),...t}));tc.displayName="SidebarInset";const rc=i.forwardRef(({className:e,...t},r)=>o.jsx(Nr,{ref:r,"data-sidebar":"input",className:_("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));rc.displayName="SidebarInput";const Xn=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"header",className:_("flex flex-col gap-2 p-2",e),...t}));Xn.displayName="SidebarHeader";const Qn=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"footer",className:_("flex flex-col gap-2 p-2",e),...t}));Qn.displayName="SidebarFooter";const nc=i.forwardRef(({className:e,...t},r)=>o.jsx(Gn,{ref:r,"data-sidebar":"separator",className:_("mx-2 w-auto bg-sidebar-border",e),...t}));nc.displayName="SidebarSeparator";const Zn=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"content",className:_("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));Zn.displayName="SidebarContent";const oc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"group",className:_("relative flex w-full min-w-0 flex-col p-2",e),...t}));oc.displayName="SidebarGroup";const ac=i.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const a=t?ye:"div";return o.jsx(a,{ref:n,"data-sidebar":"group-label",className:_("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});ac.displayName="SidebarGroupLabel";const sc=i.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const a=t?ye:"button";return o.jsx(a,{ref:n,"data-sidebar":"group-action",className:_("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...r})});sc.displayName="SidebarGroupAction";const ic=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"group-content",className:_("w-full text-sm",e),...t}));ic.displayName="SidebarGroupContent";const Jn=i.forwardRef(({className:e,...t},r)=>o.jsx("ul",{ref:r,"data-sidebar":"menu",className:_("flex w-full min-w-0 flex-col gap-1",e),...t}));Jn.displayName="SidebarMenu";const Rn=i.forwardRef(({className:e,...t},r)=>o.jsx("li",{ref:r,"data-sidebar":"menu-item",className:_("group/menu-item relative",e),...t}));Rn.displayName="SidebarMenuItem";const og=Lt("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),eo=i.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:a,className:s,...c},l)=>{const u=e?ye:"button",{isMobile:d,state:f}=$t(),p=o.jsx(u,{ref:l,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:_(og({variant:r,size:n}),s),...c});return a?(typeof a=="string"&&(a={children:a}),o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:p}),o.jsx(Re,{side:"right",align:"center",hidden:f!=="collapsed"||d,...a})]})):p});eo.displayName="SidebarMenuButton";const cc=i.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},a)=>{const s=t?ye:"button";return o.jsx(s,{ref:a,"data-sidebar":"menu-action",className:_("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});cc.displayName="SidebarMenuAction";const lc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:_("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));lc.displayName="SidebarMenuBadge";const dc=i.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const a=i.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return o.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:_("rounded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&o.jsx(U,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),o.jsx(U,{className:"h-4 flex-1 max-w-(--skeleton-width)","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});dc.displayName="SidebarMenuSkeleton";const uc=i.forwardRef(({className:e,...t},r)=>o.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:_("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));uc.displayName="SidebarMenuSub";const fc=i.forwardRef(({...e},t)=>o.jsx("li",{ref:t,...e}));fc.displayName="SidebarMenuSubItem";const pc=i.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...a},s)=>{const c=e?ye:"a";return o.jsx(c,{ref:s,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:_("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...a})});pc.displayName="SidebarMenuSubButton";var to="ToastProvider",[ro,ag,sg]=ln("Toast"),[hc,cv]=Be("Toast",[sg]),[ig,Cr]=hc(to),gc=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:a="right",swipeThreshold:s=50,children:c}=e,[l,u]=i.useState(null),[d,f]=i.useState(0),p=i.useRef(!1),h=i.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${to}\`. Expected non-empty \`string\`.`),o.jsx(ro.Provider,{scope:t,children:o.jsx(ig,{scope:t,label:r,duration:n,swipeDirection:a,swipeThreshold:s,toastCount:d,viewport:l,onViewportChange:u,onToastAdd:i.useCallback(()=>f(m=>m+1),[]),onToastRemove:i.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:h,children:c})})};gc.displayName=to;var vc="ToastViewport",cg=["F8"],no="toast.viewportPause",oo="toast.viewportResume",mc=i.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=cg,label:a="Notifications ({hotkey})",...s}=e,c=Cr(vc,r),l=ag(r),u=i.useRef(null),d=i.useRef(null),f=i.useRef(null),p=i.useRef(null),h=oe(t,p,c.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=c.toastCount>0;i.useEffect(()=>{const w=v=>{var x;n.length!==0&&n.every(N=>v[N]||v.code===N)&&((x=p.current)==null||x.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),i.useEffect(()=>{const w=u.current,v=p.current;if(b&&w&&v){const y=()=>{if(!c.isClosePausedRef.current){const C=new CustomEvent(no);v.dispatchEvent(C),c.isClosePausedRef.current=!0}},x=()=>{if(c.isClosePausedRef.current){const C=new CustomEvent(oo);v.dispatchEvent(C),c.isClosePausedRef.current=!1}},N=C=>{!w.contains(C.relatedTarget)&&x()},E=()=>{w.contains(document.activeElement)||x()};return w.addEventListener("focusin",y),w.addEventListener("focusout",N),w.addEventListener("pointermove",y),w.addEventListener("pointerleave",E),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{w.removeEventListener("focusin",y),w.removeEventListener("focusout",N),w.removeEventListener("pointermove",y),w.removeEventListener("pointerleave",E),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[b,c.isClosePausedRef]);const g=i.useCallback(({tabbingDirection:w})=>{const y=l().map(x=>{const N=x.ref.current,E=[N,...xg(N)];return w==="forwards"?E:E.reverse()});return(w==="forwards"?y.reverse():y).flat()},[l]);return i.useEffect(()=>{const w=p.current;if(w){const v=y=>{var E,C,T;const x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){const $=document.activeElement,O=y.shiftKey;if(y.target===w&&O){(E=d.current)==null||E.focus();return}const F=g({tabbingDirection:O?"backwards":"forwards"}),L=F.findIndex(P=>P===$);io(F.slice(L+1))?y.preventDefault():O?(C=d.current)==null||C.focus():(T=f.current)==null||T.focus()}};return w.addEventListener("keydown",v),()=>w.removeEventListener("keydown",v)}},[l,g]),o.jsxs(Ld,{ref:u,role:"region","aria-label":a.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&o.jsx(ao,{ref:d,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"forwards"});io(w)}}),o.jsx(ro.Slot,{scope:r,children:o.jsx(Z.ol,{tabIndex:-1,...s,ref:h})}),b&&o.jsx(ao,{ref:f,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"backwards"});io(w)}})]})});mc.displayName=vc;var bc="ToastFocusProxy",ao=i.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...a}=e,s=Cr(bc,r);return o.jsx(br,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:c=>{var d;const l=c.relatedTarget;!((d=s.viewport)!=null&&d.contains(l))&&n()}})});ao.displayName=bc;var Sr="Toast",lg="toast.swipeStart",dg="toast.swipeMove",ug="toast.swipeCancel",fg="toast.swipeEnd",wc=i.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:a,onOpenChange:s,...c}=e,[l=!0,u]=st({prop:n,defaultProp:a,onChange:s});return o.jsx(Ne,{present:r||l,children:o.jsx(gg,{open:l,...c,ref:t,onClose:()=>u(!1),onPause:fe(e.onPause),onResume:fe(e.onResume),onSwipeStart:z(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:z(e.onSwipeMove,d=>{const{x:f,y:p}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:z(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:z(e.onSwipeEnd,d=>{const{x:f,y:p}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),u(!1)})})})});wc.displayName=Sr;var[pg,hg]=hc(Sr,{onClose(){}}),gg=i.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:a,open:s,onClose:c,onEscapeKeyDown:l,onPause:u,onResume:d,onSwipeStart:f,onSwipeMove:p,onSwipeCancel:h,onSwipeEnd:m,...b}=e,g=Cr(Sr,r),[w,v]=i.useState(null),y=oe(t,P=>v(P)),x=i.useRef(null),N=i.useRef(null),E=a||g.duration,C=i.useRef(0),T=i.useRef(E),$=i.useRef(0),{onToastAdd:O,onToastRemove:B}=g,K=fe(()=>{var V;(w==null?void 0:w.contains(document.activeElement))&&((V=g.viewport)==null||V.focus()),c()}),F=i.useCallback(P=>{!P||P===1/0||(window.clearTimeout($.current),C.current=new Date().getTime(),$.current=window.setTimeout(K,P))},[K]);i.useEffect(()=>{const P=g.viewport;if(P){const V=()=>{F(T.current),d==null||d()},A=()=>{const X=new Date().getTime()-C.current;T.current=T.current-X,window.clearTimeout($.current),u==null||u()};return P.addEventListener(no,A),P.addEventListener(oo,V),()=>{P.removeEventListener(no,A),P.removeEventListener(oo,V)}}},[g.viewport,E,u,d,F]),i.useEffect(()=>{s&&!g.isClosePausedRef.current&&F(E)},[s,E,g.isClosePausedRef,F]),i.useEffect(()=>(O(),()=>B()),[O,B]);const L=i.useMemo(()=>w?Tc(w):null,[w]);return g.viewport?o.jsxs(o.Fragment,{children:[L&&o.jsx(vg,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),o.jsx(pg,{scope:r,onClose:K,children:_r.createPortal(o.jsx(ro.ItemSlot,{scope:r,children:o.jsx(Od,{asChild:!0,onEscapeKeyDown:z(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||K(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(Z.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":g.swipeDirection,...b,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:z(e.onKeyDown,P=>{P.key==="Escape"&&(l==null||l(P.nativeEvent),P.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:z(e.onPointerDown,P=>{P.button===0&&(x.current={x:P.clientX,y:P.clientY})}),onPointerMove:z(e.onPointerMove,P=>{if(!x.current)return;const V=P.clientX-x.current.x,A=P.clientY-x.current.y,X=!!N.current,D=["left","right"].includes(g.swipeDirection),M=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,Y=D?M(0,V):0,Q=D?0:M(0,A),ee=P.pointerType==="touch"?10:2,te={x:Y,y:Q},ne={originalEvent:P,delta:te};X?(N.current=te,Er(dg,p,ne,{discrete:!1})):Mc(te,g.swipeDirection,ee)?(N.current=te,Er(lg,f,ne,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(V)>ee||Math.abs(A)>ee)&&(x.current=null)}),onPointerUp:z(e.onPointerUp,P=>{const V=N.current,A=P.target;if(A.hasPointerCapture(P.pointerId)&&A.releasePointerCapture(P.pointerId),N.current=null,x.current=null,V){const X=P.currentTarget,D={originalEvent:P,delta:V};Mc(V,g.swipeDirection,g.swipeThreshold)?Er(fg,m,D,{discrete:!0}):Er(ug,h,D,{discrete:!0}),X.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),vg=e=>{const{__scopeToast:t,children:r,...n}=e,a=Cr(Sr,t),[s,c]=i.useState(!1),[l,u]=i.useState(!1);return wg(()=>c(!0)),i.useEffect(()=>{const d=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:o.jsx(Ct,{asChild:!0,children:o.jsx(br,{...n,children:s&&o.jsxs(o.Fragment,{children:[a.label," ",r]})})})},mg="ToastTitle",yc=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return o.jsx(Z.div,{...n,ref:t})});yc.displayName=mg;var bg="ToastDescription",xc=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return o.jsx(Z.div,{...n,ref:t})});xc.displayName=bg;var Nc="ToastAction",Cc=i.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?o.jsx(Ec,{altText:r,asChild:!0,children:o.jsx(so,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Nc}\`. Expected non-empty \`string\`.`),null)});Cc.displayName=Nc;var Sc="ToastClose",so=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,a=hg(Sc,r);return o.jsx(Ec,{asChild:!0,children:o.jsx(Z.button,{type:"button",...n,ref:t,onClick:z(e.onClick,a.onClose)})})});so.displayName=Sc;var Ec=i.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...a}=e;return o.jsx(Z.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...a,ref:t})});function Tc(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),yg(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!a)if(s){const c=n.dataset.radixToastAnnounceAlt;c&&t.push(c)}else t.push(...Tc(n))}}),t}function Er(e,t,r,{discrete:n}){const a=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?Wr(a,s):a.dispatchEvent(s)}var Mc=(e,t,r=0)=>{const n=Math.abs(e.x),a=Math.abs(e.y),s=n>a;return t==="left"||t==="right"?s&&n>r:!s&&a>r};function wg(e=()=>{}){const t=fe(e);We(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function yg(e){return e.nodeType===e.ELEMENT_NODE}function xg(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function io(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Ng=gc,Pc=mc,Ac=wc,_c=yc,Dc=xc,Ic=Cc,kc=so;const Oc=Ng,co=i.forwardRef(({className:e,...t},r)=>o.jsx(Pc,{ref:r,className:_("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));co.displayName=Pc.displayName;const Cg=Lt("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-600 bg-green-600 text-white",warning:"border-yellow-500 bg-yellow-500 text-white",info:"border-blue-500 bg-blue-500 text-white",secondary:"border-secondary bg-secondary text-secondary-foreground",outline:"border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}}),lo=i.forwardRef(({className:e,variant:t,...r},n)=>o.jsx(Ac,{ref:n,className:_(Cg({variant:t}),e),...r}));lo.displayName=Ac.displayName;const Lc=i.forwardRef(({className:e,...t},r)=>o.jsx(Ic,{ref:r,className:_("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:group-[.destructive]:ring-destructive",e),...t}));Lc.displayName=Ic.displayName;const uo=i.forwardRef(({className:e,...t},r)=>o.jsx(kc,{ref:r,className:_("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-50 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600",e),"toast-close":"",...t,children:o.jsx(Ir,{className:"h-4 w-4"})}));uo.displayName=kc.displayName;const fo=i.forwardRef(({className:e,...t},r)=>o.jsx(_c,{ref:r,className:_("text-sm font-semibold [&+div]:text-xs",e),...t}));fo.displayName=_c.displayName;const po=i.forwardRef(({className:e,...t},r)=>o.jsx(Dc,{ref:r,className:_("text-sm opacity-90",e),...t}));po.displayName=Dc.displayName;const Sg=1,Eg=1e6;let ho=0;function Tg(){return ho=(ho+1)%Number.MAX_SAFE_INTEGER,ho.toString()}const go=new Map,Fc=e=>{if(go.has(e))return;const t=setTimeout(()=>{go.delete(e),zt({type:"REMOVE_TOAST",toastId:e})},Eg);go.set(e,t)},Mg=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Sg)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Fc(r):e.toasts.forEach(n=>Fc(n.id)),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return{...e,toasts:t.toastId?e.toasts.filter(r=>r.id!==t.toastId):[]}}},Tr=[];let Mr={toasts:[]};function zt(e){Mr=Mg(Mr,e),Tr.forEach(t=>t(Mr))}function $c({...e}){const t=Tg(),r=a=>zt({type:"UPDATE_TOAST",toast:{...a,id:t}}),n=()=>zt({type:"DISMISS_TOAST",toastId:t});return zt({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||n()}}}),{id:t,dismiss:n,update:r}}function vo(){const[e,t]=i.useState(Mr);return i.useEffect(()=>(Tr.push(t),()=>{const r=Tr.indexOf(t);r>-1&&Tr.splice(r,1)}),[]),{...e,toast:$c,dismiss:r=>zt({type:"DISMISS_TOAST",toastId:r})}}function zc(){const{toasts:e}=vo();return o.jsxs(Oc,{children:[e.map(function({id:t,title:r,description:n,action:a,...s}){return o.jsxs(lo,{...s,children:[o.jsxs("div",{className:"grid gap-1",children:[r&&o.jsx(fo,{children:r}),n&&o.jsx(po,{children:n})]}),a,o.jsx(uo,{})]},t)}),o.jsx(co,{})]})}const mo=H.forwardRef(({onSignOut:e,handleValidSearch:t,rightMenu:r,searchPlaceholder:n},a)=>{const[s,c]=H.useState(""),l=Ar.useLocation(),{toast:u}=vo();H.useEffect(()=>{const h=new URLSearchParams(l.search).get("q");h&&c(h)},[l.search]);const d=()=>{const p=s.trim();if(!p||p.length<2){u({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}t(p)},f=p=>{p.key==="Enter"&&d()};return o.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[o.jsx(qn,{className:"lg:hidden",children:o.jsx(wl,{className:"h-6 w-6"})}),o.jsx("div",{className:"flex flex-1 items-center gap-4",children:o.jsx("div",{className:"relative w-full max-w-sm",children:o.jsxs("div",{children:[o.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:d,"aria-label":"Search",children:o.jsx(El,{className:"h-4 w-4 text-muted-foreground"})}),o.jsx(Nr,{placeholder:n??"Search...",className:"w-full pl-8 bg-white text-black",value:s,onChange:p=>c(p.target.value),onKeyDown:f,ref:a},"topbar-search")]})})}),r||o.jsx(o.Fragment,{}),e&&o.jsx("div",{className:"flex items-center gap-4",children:o.jsxs(ce,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:e,children:[o.jsx(bl,{className:"h-4 w-4 text-sidebar-foreground"}),o.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})});mo.displayName="Topbar";const Bc=Lt("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input hover:bg-accent hover:text-accent-foreground",success:"bg-green-600 text-white hover:bg-green-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",ghost:"bg-background hover:bg-accent hover:text-accent-foreground",randmarRed:"bg-randmar-red text-white hover:bg-randmar-red/80",randmarBlue:"bg-randmar-blue text-white hover:bg-randmar-blue/80",randmarPurple:"bg-randmar-purple text-white hover:bg-randmar-purple/80",randmarGreen:"bg-randmar-green text-black hover:bg-randmar-green/80",randmarBlack:"bg-randmar-black text-white hover:bg-randmar-black/80",randmarYellow:"bg-randmar-yellow text-black hover:bg-randmar-yellow/80"},size:{default:"h-6",sm:"h-5 text-[10px]",lg:"h-7 px-3"}},defaultVariants:{variant:"default",size:"default"}}),Te=i.forwardRef(({className:e,variant:t,size:r,icon:n,children:a,...s},c)=>o.jsxs("div",{ref:c,className:_(Bc({variant:t,size:r}),e),...s,children:[n&&o.jsx("span",{className:"mr-1",children:n}),a]}));Te.displayName="Badge";const wt=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("rounded-md border bg-card text-card-foreground shadow-sm",e),...t}));wt.displayName="Card";const Wc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("flex flex-col space-y-1.5 p-6",e),...t}));Wc.displayName="CardHeader";const Vc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("font-semibold leading-none tracking-tight",e),...t}));Vc.displayName="CardTitle";const Gc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("text-sm text-muted-foreground",e),...t}));Gc.displayName="CardDescription";const yt=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("p-6 pt-0",e),...t}));yt.displayName="CardContent";const Uc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("flex items-center p-6 pt-0",e),...t}));Uc.displayName="CardFooter";const jc=({countryCode:e,className:t=""})=>{const[r,n]=H.useState(null),[a,s]=H.useState(!1);return H.useEffect(()=>{if(!e)return;const l=`https://purecatamphetamine.github.io/country-flag-icons/3x2/${e.toUpperCase()}.svg`;fetch(l,{method:"HEAD"}).then(u=>{u.ok?(n(l),s(!1)):s(!0)}).catch(()=>{s(!0)})},[e]),a||!r?o.jsx("span",{className:t,children:e}):o.jsx("img",{src:r,alt:`${e} flag`,className:`inline-block ${t}`,style:{width:"24px",height:"auto"}})};function Hc({routes:e,footer:t,dashboardTitle:r}){const{appID:n}=Ar.useParams(),a=e.filter(s=>s.showInNav);return o.jsxs(Yn,{className:"border-r border-sidebar-border",children:[o.jsx(Xn,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex items-center justify-center",children:o.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),o.jsx("span",{className:"font-semibold text-lg",children:r})]})}),o.jsx(Zn,{className:"py-4 bg-sidebar text-sidebar-foreground",children:o.jsx(Jn,{children:a.map(s=>{const c=s.icon,l=`/${s.path.replace(":appID",n)}`;return o.jsx(Rn,{children:o.jsx(eo,{asChild:!0,children:o.jsxs(Ar.Link,{to:l,className:"transition-colors hover:bg-muted px-6",children:[c&&o.jsx(c,{className:"h-4 w-4"}),o.jsx("span",{children:s.label})]})})},s.key)})})}),o.jsx(Qn,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:t})]})}const Kc=H.forwardRef(({children:e,rightMenu:t,routes:r,footer:n,handleValidSearch:a,dashboardTitle:s,onSignOut:c,searchPlaceholder:l},u)=>o.jsx(o.Fragment,{children:o.jsx(Kn,{children:o.jsxs("div",{className:"flex grow",children:[o.jsx(Hc,{routes:r,footer:n,dashboardTitle:s}),o.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.jsx(mo,{ref:u,onSignOut:c,rightMenu:t,handleValidSearch:a,searchPlaceholder:l}),o.jsx("main",{className:"flex-1 overflow-auto mt-16",children:e}),o.jsx(zc,{})]})]})})}));Kc.displayName="Layout";const Pg={sm:100,md:200,lg:300,xl:400};function Yc({randmarSKU:e,size:t="md",alt:r,secondaryContent:n}){const[a,s]=i.useState(!1),[c,l]=i.useState(!1),[u,d]=i.useState(!1),[f,p]=i.useState(!1),h=`https://api.randmar.io/Product/${e}/Video`;i.useEffect(()=>{(async()=>{try{const x=await(await fetch(h+"/Exists")).json();l(x)}catch(y){console.error("Error checking for video:",y),l(!1)}})()},[e,h]);async function m(){if(c){p(!0);try{const y=await(await fetch(h)).blob(),x=window.URL.createObjectURL(y),N=document.createElement("a");N.href=x,N.download=`${e||"product"}-video.mp4`,document.body.appendChild(N),N.click(),document.body.removeChild(N),window.URL.revokeObjectURL(x)}catch(v){console.error("Error downloading video:",v)}finally{p(!1)}}}function b(){navigator.clipboard.writeText(h),d(!0),setTimeout(()=>{d(!1)},2e3)}function g(){s(!0)}const w=Pg[t||"xl"];return o.jsxs(o.Fragment,{children:[o.jsx(St,{open:a,onOpenChange:s,children:o.jsx(Et,{className:"max-w-4xl p-0 overflow-hidden",children:n?o.jsxs("div",{className:"flex flex-row",children:[o.jsxs("video",{className:"w-full rounded-l-lg max-h-[720px] object-contain",controls:!0,autoPlay:!0,muted:!0,loop:!0,children:[o.jsx("source",{src:h,type:"video/mp4"}),"Your browser does not support the video tag."]}),o.jsx("div",{className:"flex-grow min-w-[400px] h-[70vh] p-6",children:n})]}):o.jsxs("div",{className:"w-full relative",children:[o.jsxs("video",{className:"w-full max-h-[720px] object-contain",controls:!0,autoPlay:!0,children:[o.jsx("source",{src:h,type:"video/mp4"}),"Your browser does not support the video tag."]}),o.jsxs("div",{className:"absolute top-2 right-12 flex gap-1",children:[o.jsx(vt,{children:o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:o.jsx(ce,{variant:"secondary",size:"icon",onClick:b,children:u?o.jsx(Dr,{className:"h-4 w-4"}):o.jsx(gl,{className:"h-4 w-4"})})}),o.jsx(Re,{children:o.jsx("p",{children:"Copy video link"})})]})}),o.jsx(vt,{children:o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:o.jsx(ce,{variant:"secondary",size:"icon",onClick:m,disabled:f,children:o.jsx(vl,{className:"h-4 w-4"})})}),o.jsx(Re,{children:o.jsx("p",{children:"Download video"})})]})})]})]})})}),o.jsxs("div",{className:"relative w-max h-max",children:[o.jsx("img",{alt:r||`Product ${e}`,className:`rounded-md ${c?"cursor-pointer":""}`,onClick:c?g:void 0,src:`https://api.randmar.io/Product/${e}/Image?width=${w*1.5}&height=${w*1.5}`,width:w,height:w}),c&&o.jsx(vt,{children:o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:o.jsx(ce,{variant:"secondary",size:"icon",className:"absolute top-2 right-2",onClick:g,children:o.jsx(Nl,{className:"h-4 w-4"})})}),o.jsx(Re,{children:o.jsx("p",{children:"Play video"})})]})})]})]})}function Ag({item:e,addToCart:t=!1,syncToShopify:r=!1,customAction:n=o.jsx(o.Fragment,{}),defaultOpportunityNumber:a="",viewProductAction:s,addToCartAction:c,isAddToCartActionLoading:l=!1,syncToShopifyAction:u,isSyncToShopifyActionLoading:d=!1}){var M,Y,Q,ee,te,ne,se,le,ae,Me,de,Pe;const[f,p]=H.useState(1),[h,m]=H.useState(null),[b,g]=H.useState(0),[w,v]=H.useState(!1),y=((M=e==null?void 0:e.Distribution)==null?void 0:M.Cost)||0,x=((Y=e==null?void 0:e.Distribution)==null?void 0:Y.RegularPrice)||0,N=((Q=e==null?void 0:e.Distribution)==null?void 0:Q.Price)||0,[E,C]=H.useState(null),[T,$]=H.useState(!1);H.useEffect(()=>{const G=async()=>{if(e!=null&&e.ManufacturerId){$(!0);try{const J=await fetch(`https://api.randmar.io/V4/Partner/${e.ManufacturerId}/Account/Logo?width=60&height=40`);if(J.ok){const he=await J.blob();C(URL.createObjectURL(he))}}catch(J){console.error("Failed to load logo:",J)}finally{$(!1)}}};e!=null&&e.ManufacturerId&&G()},[e==null?void 0:e.ManufacturerId]),H.useEffect(()=>{var G;if(e&&a){const J=(G=e.Opportunities)==null?void 0:G.find(he=>he.BidNumber==a);J&&m(J)}},[e,a]),H.useEffect(()=>{if(!e)return;const G=h!=null&&h.Price?h.Price:N;g(x>0?Math.round((x-G)/x*100):0)},[e,h,N,x]),H.useEffect(()=>{l||p(1)},[l]);const O=G=>{if(G.Active!==!0)return!1;const J=new Date().toISOString().split("T")[0];return!(G.EndDate&&G.EndDate<J||G.StartDate&&G.StartDate>J)};if(!e)return o.jsx(wt,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(yt,{className:"p-6",children:[o.jsxs("div",{className:"flex justify-between items-start mb-3",children:[o.jsx(U,{className:"h-7 w-3/4"}),o.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:o.jsx(U,{className:"h-10 w-24 rounded-md"})})]}),o.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[o.jsx(U,{className:"h-6 w-20 rounded-full"}),o.jsx(U,{className:"h-6 w-24 rounded-full"}),o.jsx(U,{className:"h-6 w-28 rounded-full"})]}),o.jsxs("div",{className:"flex gap-6",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[o.jsxs("div",{children:[o.jsx(U,{className:"h-4 w-12 mb-1"}),o.jsx(U,{className:"h-5 w-20"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-4 w-12 mb-1"}),o.jsx(U,{className:"h-5 w-24"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-4 w-20 mb-1"}),o.jsx(U,{className:"h-5 w-16"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-4 w-12 mb-1"}),o.jsx(U,{className:"h-5 w-20"})]})]}),o.jsx("div",{className:"flex flex-col",children:o.jsx("div",{className:"w-60 h-40",children:o.jsx(U,{className:"w-full h-full rounded-lg"})})})]}),o.jsxs("div",{className:"flex gap-6 mt-4",children:[o.jsx("div",{className:"flex flex-1",children:o.jsxs("div",{className:"w-full",children:[o.jsx(U,{className:"h-4 w-24 mb-3"}),o.jsx(U,{className:"h-16 w-full rounded-md"})]})}),o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx(U,{className:"h-10 w-32 rounded-md"}),o.jsx(U,{className:"h-5 w-24 mt-4"})]})]}),o.jsxs("div",{className:"flex gap-6 mt-4",children:[o.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[o.jsx(U,{className:"h-8 w-32"}),o.jsx(U,{className:"h-6 w-24"})]}),o.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[o.jsx(U,{className:"h-10 w-24 rounded-md"}),o.jsx(U,{className:"h-10 flex-1 rounded-md"})]})]})]})});const B=(e==null?void 0:e.Opportunities)||[],K=B.length>0,F=()=>{if(f==null){p(1);return}f>1&&p(f-1)},L=()=>{if(f==null){p(1);return}p(f+1)},P=G=>{const J=parseInt(G.target.value,10);if(!isNaN(J)&&J>0){p(J);return}p(void 0)},V=()=>{(f==null||f<1)&&p(1)},A=((te=(ee=e.Distribution)==null?void 0:ee.Inventory)==null?void 0:te.reduce((G,J)=>G+(J.AvailableQuantity||0),0))||0,X=G=>{try{return new Date(G).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(J){return console.error(J),G.split("T")[0]||"N/A"}},D=()=>{c&&c({quantity:f??1,bidNumber:(h==null?void 0:h.BidNumber)??null})};return o.jsx(wt,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(yt,{className:"p-6",children:[o.jsxs("div",{className:"flex justify-between items-start mb-3",children:[o.jsx("h3",{className:"font-semibold text-xl",children:e.Title||e.RandmarTitle}),o.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:T?o.jsx(U,{className:"h-10 w-24 rounded-md"}):E&&o.jsx("img",{src:E||"/placeholder.svg",alt:e.ManufacturerName,className:"max-h-10 max-w-24 object-contain"})})]}),o.jsxs("div",{className:"flex gap-6",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.State&&o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.State==="Active"?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Dr,{size:"12",className:"mr-1.5"})," ",e.State]}),o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.SerialNumber?"bg-green-50 text-green-700 hover:bg-green-50":"bg-yellow-50 text-yellow-700 hover:bg-yellow-50"}`,children:[o.jsx(Cl,{size:"12",className:"mr-1.5"})," ",e.SerialNumber?"Serialized":"Unserialized"]}),e.TransparencyCode&&o.jsxs(Te,{variant:"outline",className:"rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50",children:[o.jsx(pl,{size:"12",className:"mr-1.5"})," Transparency Code"]}),e.AvailableToBuy===void 0?o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${(ne=e.ManufacturerCategory)!=null&&ne.QualificationRequired?"bg-blue-50 text-blue-700 hover:bg-blue-50":"bg-neutral-50 text-neutral-700 hover:bg-neutral-50"}`,children:[o.jsx(Ao,{size:"12",className:"mr-1.5"})," ",(se=e.ManufacturerCategory)!=null&&se.QualificationRequired?"Qualification Enforced":"No Qualification Needed"]}):o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.AvailableToBuy?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Ao,{size:"12",className:"mr-1.5"})," ",(le=e.ManufacturerCategory)!=null&&le.QualificationRequired?e.AvailableToBuy?"Qualified":"Not Qualified":"No Qualification Required"]}),e.ManufacturerId&&o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.AutoUpdate?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Sl,{size:"12",className:"mr-1.5"})," ",e.AutoUpdate?`Automatic Reorder (${e.MasterCarton})`:"Manually Reorders"]}),o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.BodyHTML&&e.Title&&e.MAP?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Tl,{size:"12",className:"mr-1.5"})," ",e.BodyHTML&&e.Title&&e.MAP?"Shopify Ready":"Not Shopify Ready"]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 flex-1",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),o.jsx("div",{className:"font-medium",children:e.MPN||"N/A"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),o.jsx("div",{className:"font-medium",children:e.UPC||"N/A"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),o.jsx("div",{className:"font-medium",children:e.UnitWeight?`${e.UnitWeight} lbs`:"N/A"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"MAP"}),o.jsx("div",{className:"font-medium",children:e.MAP?"$"+e.MAP.toFixed(2):"N/A"})]}),e.CountryCodeOfOrigin&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Origin"}),o.jsxs("div",{className:"font-medium flex items-center",children:[o.jsx(jc,{countryCode:e.CountryCodeOfOrigin,className:"mr-2"}),e.CountryCodeOfOrigin]})]})]})]}),o.jsx("div",{className:"flex flex-col",children:o.jsx(Yc,{randmarSKU:e.RandmarSKU||"",alt:e.RandmarTitle||""})})]}),o.jsxs("div",{className:"flex gap-6 mt-4",children:[o.jsx("div",{className:"flex flex-1",children:K&&e.Distribution&&o.jsxs("div",{className:"w-full",children:[o.jsx("div",{className:"flex items-center",children:"You have "+B.length+(B.length>1?" opportunities":" opportunity")+" for this product:"}),o.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1",children:B.map((G,J)=>{var he;return o.jsxs("div",{className:`flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted
|
|
194
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},zu="DialogDescriptionWarning",Bu=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Oa(zu).contentName}}.`;return i.useEffect(()=>{var s;const a=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},rn=ya,La=Na,Fa=Sa,Zt=Ea,Jt=Ta,Rt=Pa,er=_a,tr=Ia;const St=({modal:e=!1,...t})=>o.jsx(rn,{modal:e,...t});St.displayName=rn.displayName;const nn=La,$a=Fa,on=tr,an=i.forwardRef(({className:e,...t},r)=>o.jsx(Zt,{ref:r,className:_("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}));an.displayName=Zt.displayName;const Et=i.forwardRef(({className:e,children:t,...r},n)=>o.jsxs($a,{children:[o.jsx(an,{}),o.jsxs(Jt,{ref:n,className:_("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=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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,o.jsxs(tr,{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:[o.jsx(Ir,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Et.displayName=Jt.displayName;const rr=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});rr.displayName="DialogHeader";const sn=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});sn.displayName="DialogFooter";const nr=i.forwardRef(({className:e,...t},r)=>o.jsx(Rt,{ref:r,className:_("text-lg font-semibold leading-none tracking-tight",e),...t}));nr.displayName=Rt.displayName;const cn=i.forwardRef(({className:e,...t},r)=>o.jsx(er,{ref:r,className:_("text-sm text-muted-foreground",e),...t}));cn.displayName=er.displayName;function ln(e){const t=e+"CollectionProvider",[r,n]=Be(t),[a,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),c=m=>{const{scope:b,children:g}=m,w=H.useRef(null),v=H.useRef(new Map).current;return o.jsx(a,{scope:b,itemMap:v,collectionRef:w,children:g})};c.displayName=t;const l=e+"CollectionSlot",u=H.forwardRef((m,b)=>{const{scope:g,children:w}=m,v=s(l,g),y=oe(b,v.collectionRef);return o.jsx(ye,{ref:y,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=H.forwardRef((m,b)=>{const{scope:g,children:w,...v}=m,y=H.useRef(null),x=oe(b,y),N=s(d,g);return H.useEffect(()=>(N.itemMap.set(y,{ref:y,...v}),()=>void N.itemMap.delete(y))),o.jsx(ye,{[f]:"",ref:x,children:w})});p.displayName=d;function h(m){const b=s(e+"CollectionConsumer",m);return H.useCallback(()=>{const w=b.collectionRef.current;if(!w)return[];const v=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((N,E)=>v.indexOf(N.ref.current)-v.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:c,Slot:u,ItemSlot:p},h,n]}var Wu=i.createContext(void 0);function za(e){const t=i.useContext(Wu);return e||t||"ltr"}const Vu=["top","right","bottom","left"],Ge=Math.min,me=Math.max,or=Math.round,ar=Math.floor,De=e=>({x:e,y:e}),Gu={left:"right",right:"left",bottom:"top",top:"bottom"},Uu={start:"end",end:"start"};function dn(e,t,r){return me(e,Ge(t,r))}function Le(e,t){return typeof e=="function"?e(t):e}function Fe(e){return e.split("-")[0]}function ut(e){return e.split("-")[1]}function un(e){return e==="x"?"y":"x"}function fn(e){return e==="y"?"height":"width"}function Ue(e){return["top","bottom"].includes(Fe(e))?"y":"x"}function pn(e){return un(Ue(e))}function ju(e,t,r){r===void 0&&(r=!1);const n=ut(e),a=pn(e),s=fn(a);let c=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=sr(c)),[c,sr(c)]}function Hu(e){const t=sr(e);return[hn(e),t,hn(t)]}function hn(e){return e.replace(/start|end/g,t=>Uu[t])}function Ku(e,t,r){const n=["left","right"],a=["right","left"],s=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return r?t?a:n:t?n:a;case"left":case"right":return t?s:c;default:return[]}}function Yu(e,t,r,n){const a=ut(e);let s=Ku(Fe(e),r==="start",n);return a&&(s=s.map(c=>c+"-"+a),t&&(s=s.concat(s.map(hn)))),s}function sr(e){return e.replace(/left|right|bottom|top/g,t=>Gu[t])}function qu(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ba(e){return typeof e!="number"?qu(e):{top:e,right:e,bottom:e,left:e}}function ir(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Wa(e,t,r){let{reference:n,floating:a}=e;const s=Ue(t),c=pn(t),l=fn(c),u=Fe(t),d=s==="y",f=n.x+n.width/2-a.width/2,p=n.y+n.height/2-a.height/2,h=n[l]/2-a[l]/2;let m;switch(u){case"top":m={x:f,y:n.y-a.height};break;case"bottom":m={x:f,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:p};break;case"left":m={x:n.x-a.width,y:p};break;default:m={x:n.x,y:n.y}}switch(ut(t)){case"start":m[c]-=h*(r&&d?-1:1);break;case"end":m[c]+=h*(r&&d?-1:1);break}return m}const Xu=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:c}=r,l=s.filter(Boolean),u=await(c.isRTL==null?void 0:c.isRTL(t));let d=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:f,y:p}=Wa(d,n,u),h=n,m={},b=0;for(let g=0;g<l.length;g++){const{name:w,fn:v}=l[g],{x:y,y:x,data:N,reset:E}=await v({x:f,y:p,initialPlacement:n,placement:h,strategy:a,middlewareData:m,rects:d,platform:c,elements:{reference:e,floating:t}});f=y??f,p=x??p,m={...m,[w]:{...m[w],...N}},E&&b<=50&&(b++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(d=E.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):E.rects),{x:f,y:p}=Wa(d,h,u)),g=-1)}return{x:f,y:p,placement:h,strategy:a,middlewareData:m}};async function Tt(e,t){var r;t===void 0&&(t={});const{x:n,y:a,platform:s,rects:c,elements:l,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=Le(t,e),b=Ba(m),w=l[h?p==="floating"?"reference":"floating":p],v=ir(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(w)))==null||r?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),y=p==="floating"?{x:n,y:a,width:c.floating.width,height:c.floating.height}:c.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),N=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},E=ir(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:u}):y);return{top:(v.top-E.top+b.top)/N.y,bottom:(E.bottom-v.bottom+b.bottom)/N.y,left:(v.left-E.left+b.left)/N.x,right:(E.right-v.right+b.right)/N.x}}const Qu=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:s,platform:c,elements:l,middlewareData:u}=t,{element:d,padding:f=0}=Le(e,t)||{};if(d==null)return{};const p=Ba(f),h={x:r,y:n},m=pn(a),b=fn(m),g=await c.getDimensions(d),w=m==="y",v=w?"top":"left",y=w?"bottom":"right",x=w?"clientHeight":"clientWidth",N=s.reference[b]+s.reference[m]-h[m]-s.floating[b],E=h[m]-s.reference[m],C=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let T=C?C[x]:0;(!T||!await(c.isElement==null?void 0:c.isElement(C)))&&(T=l.floating[x]||s.floating[b]);const $=N/2-E/2,O=T/2-g[b]/2-1,B=Ge(p[v],O),K=Ge(p[y],O),F=B,L=T-g[b]-K,P=T/2-g[b]/2+$,V=dn(F,P,L),A=!u.arrow&&ut(a)!=null&&P!==V&&s.reference[b]/2-(P<F?B:K)-g[b]/2<0,X=A?P<F?P-F:P-L:0;return{[m]:h[m]+X,data:{[m]:V,centerOffset:P-V-X,...A&&{alignmentOffset:X}},reset:A}}}),Zu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:s,rects:c,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:g=!0,...w}=Le(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const v=Fe(a),y=Ue(l),x=Fe(l)===l,N=await(u.isRTL==null?void 0:u.isRTL(d.floating)),E=h||(x||!g?[sr(l)]:Hu(l)),C=b!=="none";!h&&C&&E.push(...Yu(l,g,b,N));const T=[l,...E],$=await Tt(t,w),O=[];let B=((n=s.flip)==null?void 0:n.overflows)||[];if(f&&O.push($[v]),p){const P=ju(a,c,N);O.push($[P[0]],$[P[1]])}if(B=[...B,{placement:a,overflows:O}],!O.every(P=>P<=0)){var K,F;const P=(((K=s.flip)==null?void 0:K.index)||0)+1,V=T[P];if(V)return{data:{index:P,overflows:B},reset:{placement:V}};let A=(F=B.filter(X=>X.overflows[0]<=0).sort((X,D)=>X.overflows[1]-D.overflows[1])[0])==null?void 0:F.placement;if(!A)switch(m){case"bestFit":{var L;const X=(L=B.filter(D=>{if(C){const M=Ue(D.placement);return M===y||M==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(M=>M>0).reduce((M,Y)=>M+Y,0)]).sort((D,M)=>D[1]-M[1])[0])==null?void 0:L[0];X&&(A=X);break}case"initialPlacement":A=l;break}if(a!==A)return{reset:{placement:A}}}return{}}}};function Va(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ga(e){return Vu.some(t=>e[t]>=0)}const Ju=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=Le(e,t);switch(n){case"referenceHidden":{const s=await Tt(t,{...a,elementContext:"reference"}),c=Va(s,r.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Ga(c)}}}case"escaped":{const s=await Tt(t,{...a,altBoundary:!0}),c=Va(s,r.floating);return{data:{escapedOffsets:c,escaped:Ga(c)}}}default:return{}}}}};async function Ru(e,t){const{placement:r,platform:n,elements:a}=e,s=await(n.isRTL==null?void 0:n.isRTL(a.floating)),c=Fe(r),l=ut(r),u=Ue(r)==="y",d=["left","top"].includes(c)?-1:1,f=s&&u?-1:1,p=Le(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(m=l==="end"?b*-1:b),u?{x:m*f,y:h*d}:{x:h*d,y:m*f}}const ef=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:s,placement:c,middlewareData:l}=t,u=await Ru(t,e);return c===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+u.x,y:s+u.y,data:{...u,placement:c}}}}},tf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:w=>{let{x:v,y}=w;return{x:v,y}}},...u}=Le(e,t),d={x:r,y:n},f=await Tt(t,u),p=Ue(Fe(a)),h=un(p);let m=d[h],b=d[p];if(s){const w=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=m+f[w],x=m-f[v];m=dn(y,m,x)}if(c){const w=p==="y"?"top":"left",v=p==="y"?"bottom":"right",y=b+f[w],x=b-f[v];b=dn(y,b,x)}const g=l.fn({...t,[h]:m,[p]:b});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[h]:s,[p]:c}}}}}},rf=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:s,middlewareData:c}=t,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Le(e,t),f={x:r,y:n},p=Ue(a),h=un(p);let m=f[h],b=f[p];const g=Le(l,t),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(u){const x=h==="y"?"height":"width",N=s.reference[h]-s.floating[x]+w.mainAxis,E=s.reference[h]+s.reference[x]-w.mainAxis;m<N?m=N:m>E&&(m=E)}if(d){var v,y;const x=h==="y"?"width":"height",N=["top","left"].includes(Fe(a)),E=s.reference[p]-s.floating[x]+(N&&((v=c.offset)==null?void 0:v[p])||0)+(N?0:w.crossAxis),C=s.reference[p]+s.reference[x]+(N?0:((y=c.offset)==null?void 0:y[p])||0)-(N?w.crossAxis:0);b<E?b=E:b>C&&(b=C)}return{[h]:m,[p]:b}}}},nf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:s,platform:c,elements:l}=t,{apply:u=()=>{},...d}=Le(e,t),f=await Tt(t,d),p=Fe(a),h=ut(a),m=Ue(a)==="y",{width:b,height:g}=s.floating;let w,v;p==="top"||p==="bottom"?(w=p,v=h===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,w=h==="end"?"top":"bottom");const y=g-f.top-f.bottom,x=b-f.left-f.right,N=Ge(g-f[w],y),E=Ge(b-f[v],x),C=!t.middlewareData.shift;let T=N,$=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&($=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=y),C&&!h){const B=me(f.left,0),K=me(f.right,0),F=me(f.top,0),L=me(f.bottom,0);m?$=b-2*(B!==0||K!==0?B+K:me(f.left,f.right)):T=g-2*(F!==0||L!==0?F+L:me(f.top,f.bottom))}await u({...t,availableWidth:$,availableHeight:T});const O=await c.getDimensions(l.floating);return b!==O.width||g!==O.height?{reset:{rects:!0}}:{}}}};function cr(){return typeof window<"u"}function ft(e){return Ua(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(Ua(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ua(e){return cr()?e instanceof Node||e instanceof be(e).Node:!1}function Se(e){return cr()?e instanceof Element||e instanceof be(e).Element:!1}function ke(e){return cr()?e instanceof HTMLElement||e instanceof be(e).HTMLElement:!1}function ja(e){return!cr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof be(e).ShadowRoot}function Mt(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(a)}function of(e){return["table","td","th"].includes(ft(e))}function lr(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function gn(e){const t=vn(),r=Se(e)?Ee(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function af(e){let t=je(e);for(;ke(t)&&!pt(t);){if(gn(t))return t;if(lr(t))return null;t=je(t)}return null}function vn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pt(e){return["html","body","#document"].includes(ft(e))}function Ee(e){return be(e).getComputedStyle(e)}function dr(e){return Se(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function je(e){if(ft(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ja(e)&&e.host||Ie(e);return ja(t)?t.host:t}function Ha(e){const t=je(e);return pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ke(t)&&Mt(t)?t:Ha(t)}function Pt(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=Ha(e),s=a===((n=e.ownerDocument)==null?void 0:n.body),c=be(a);if(s){const l=mn(c);return t.concat(c,c.visualViewport||[],Mt(a)?a:[],l&&r?Pt(l):[])}return t.concat(a,Pt(a,[],r))}function mn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ka(e){const t=Ee(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=ke(e),s=a?e.offsetWidth:r,c=a?e.offsetHeight:n,l=or(r)!==s||or(n)!==c;return l&&(r=s,n=c),{width:r,height:n,$:l}}function bn(e){return Se(e)?e:e.contextElement}function ht(e){const t=bn(e);if(!ke(t))return De(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=Ka(t);let c=(s?or(r.width):r.width)/n,l=(s?or(r.height):r.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}const sf=De(0);function Ya(e){const t=be(e);return!vn()||!t.visualViewport?sf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cf(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==be(e)?!1:t}function Ze(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),s=bn(e);let c=De(1);t&&(n?Se(n)&&(c=ht(n)):c=ht(e));const l=cf(s,r,n)?Ya(s):De(0);let u=(a.left+l.x)/c.x,d=(a.top+l.y)/c.y,f=a.width/c.x,p=a.height/c.y;if(s){const h=be(s),m=n&&Se(n)?be(n):n;let b=h,g=mn(b);for(;g&&n&&m!==b;){const w=ht(g),v=g.getBoundingClientRect(),y=Ee(g),x=v.left+(g.clientLeft+parseFloat(y.paddingLeft))*w.x,N=v.top+(g.clientTop+parseFloat(y.paddingTop))*w.y;u*=w.x,d*=w.y,f*=w.x,p*=w.y,u+=x,d+=N,b=be(g),g=mn(b)}}return ir({width:f,height:p,x:u,y:d})}function wn(e,t){const r=dr(e).scrollLeft;return t?t.left+r:Ze(Ie(e)).left+r}function qa(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-(r?0:wn(e,n)),s=n.top+t.scrollTop;return{x:a,y:s}}function lf(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s=a==="fixed",c=Ie(n),l=t?lr(t.floating):!1;if(n===c||l&&s)return r;let u={scrollLeft:0,scrollTop:0},d=De(1);const f=De(0),p=ke(n);if((p||!p&&!s)&&((ft(n)!=="body"||Mt(c))&&(u=dr(n)),ke(n))){const m=Ze(n);d=ht(n),f.x=m.x+n.clientLeft,f.y=m.y+n.clientTop}const h=c&&!p&&!s?qa(c,u,!0):De(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+f.x+h.x,y:r.y*d.y-u.scrollTop*d.y+f.y+h.y}}function df(e){return Array.from(e.getClientRects())}function uf(e){const t=Ie(e),r=dr(e),n=e.ownerDocument.body,a=me(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=me(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let c=-r.scrollLeft+wn(e);const l=-r.scrollTop;return Ee(n).direction==="rtl"&&(c+=me(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:c,y:l}}function ff(e,t){const r=be(e),n=Ie(e),a=r.visualViewport;let s=n.clientWidth,c=n.clientHeight,l=0,u=0;if(a){s=a.width,c=a.height;const d=vn();(!d||d&&t==="fixed")&&(l=a.offsetLeft,u=a.offsetTop)}return{width:s,height:c,x:l,y:u}}function pf(e,t){const r=Ze(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=ke(e)?ht(e):De(1),c=e.clientWidth*s.x,l=e.clientHeight*s.y,u=a*s.x,d=n*s.y;return{width:c,height:l,x:u,y:d}}function Xa(e,t,r){let n;if(t==="viewport")n=ff(e,r);else if(t==="document")n=uf(Ie(e));else if(Se(t))n=pf(t,r);else{const a=Ya(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return ir(n)}function Qa(e,t){const r=je(e);return r===t||!Se(r)||pt(r)?!1:Ee(r).position==="fixed"||Qa(r,t)}function hf(e,t){const r=t.get(e);if(r)return r;let n=Pt(e,[],!1).filter(l=>Se(l)&&ft(l)!=="body"),a=null;const s=Ee(e).position==="fixed";let c=s?je(e):e;for(;Se(c)&&!pt(c);){const l=Ee(c),u=gn(c);!u&&l.position==="fixed"&&(a=null),(s?!u&&!a:!u&&l.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||Mt(c)&&!u&&Qa(e,c))?n=n.filter(f=>f!==c):a=l,c=je(c)}return t.set(e,n),n}function gf(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const c=[...r==="clippingAncestors"?lr(t)?[]:hf(t,this._c):[].concat(r),n],l=c[0],u=c.reduce((d,f)=>{const p=Xa(t,f,a);return d.top=me(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=me(p.left,d.left),d},Xa(t,l,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function vf(e){const{width:t,height:r}=Ka(e);return{width:t,height:r}}function mf(e,t,r){const n=ke(t),a=Ie(t),s=r==="fixed",c=Ze(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=De(0);if(n||!n&&!s)if((ft(t)!=="body"||Mt(a))&&(l=dr(t)),n){const h=Ze(t,!0,s,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else a&&(u.x=wn(a));const d=a&&!n&&!s?qa(a,l):De(0),f=c.left+l.scrollLeft-u.x-d.x,p=c.top+l.scrollTop-u.y-d.y;return{x:f,y:p,width:c.width,height:c.height}}function yn(e){return Ee(e).position==="static"}function Za(e,t){if(!ke(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ie(e)===r&&(r=r.ownerDocument.body),r}function Ja(e,t){const r=be(e);if(lr(e))return r;if(!ke(e)){let a=je(e);for(;a&&!pt(a);){if(Se(a)&&!yn(a))return a;a=je(a)}return r}let n=Za(e,t);for(;n&&of(n)&&yn(n);)n=Za(n,t);return n&&pt(n)&&yn(n)&&!gn(n)?r:n||af(e)||r}const bf=async function(e){const t=this.getOffsetParent||Ja,r=this.getDimensions,n=await r(e.floating);return{reference:mf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function wf(e){return Ee(e).direction==="rtl"}const yf={convertOffsetParentRelativeRectToViewportRelativeRect:lf,getDocumentElement:Ie,getClippingRect:gf,getOffsetParent:Ja,getElementRects:bf,getClientRects:df,getDimensions:vf,getScale:ht,isElement:Se,isRTL:wf};function Ra(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xf(e,t){let r=null,n;const a=Ie(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function c(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:f,top:p,width:h,height:m}=d;if(l||t(),!h||!m)return;const b=ar(p),g=ar(a.clientWidth-(f+h)),w=ar(a.clientHeight-(p+m)),v=ar(f),x={rootMargin:-b+"px "+-g+"px "+-w+"px "+-v+"px",threshold:me(0,Ge(1,u))||1};let N=!0;function E(C){const T=C[0].intersectionRatio;if(T!==u){if(!N)return c();T?c(!1,T):n=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!Ra(d,e.getBoundingClientRect())&&c(),N=!1}try{r=new IntersectionObserver(E,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(E,x)}r.observe(e)}return c(!0),s}function Nf(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=bn(e),f=a||s?[...d?Pt(d):[],...Pt(t)]:[];f.forEach(v=>{a&&v.addEventListener("scroll",r,{passive:!0}),s&&v.addEventListener("resize",r)});const p=d&&l?xf(d,r):null;let h=-1,m=null;c&&(m=new ResizeObserver(v=>{let[y]=v;y&&y.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),r()}),d&&!u&&m.observe(d),m.observe(t));let b,g=u?Ze(e):null;u&&w();function w(){const v=Ze(e);g&&!Ra(g,v)&&r(),g=v,b=requestAnimationFrame(w)}return r(),()=>{var v;f.forEach(y=>{a&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),p==null||p(),(v=m)==null||v.disconnect(),m=null,u&&cancelAnimationFrame(b)}}const Cf=ef,Sf=tf,Ef=Zu,Tf=nf,Mf=Ju,es=Qu,Pf=rf,Af=(e,t,r)=>{const n=new Map,a={platform:yf,...r},s={...a.platform,_c:n};return Xu(e,t,{...a,platform:s})};var ur=typeof document<"u"?H.useLayoutEffect:H.useEffect;function fr(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 r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!fr(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const s=a[n];if(!(s==="_owner"&&e.$$typeof)&&!fr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ts(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rs(e,t){const r=ts(e);return Math.round(t*r)/r}function xn(e){const t=i.useRef(e);return ur(()=>{t.current=e}),t}function _f(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=i.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=i.useState(n);fr(h,n)||m(n);const[b,g]=i.useState(null),[w,v]=i.useState(null),y=i.useCallback(D=>{D!==C.current&&(C.current=D,g(D))},[]),x=i.useCallback(D=>{D!==T.current&&(T.current=D,v(D))},[]),N=s||b,E=c||w,C=i.useRef(null),T=i.useRef(null),$=i.useRef(f),O=u!=null,B=xn(u),K=xn(a),F=xn(d),L=i.useCallback(()=>{if(!C.current||!T.current)return;const D={placement:t,strategy:r,middleware:h};K.current&&(D.platform=K.current),Af(C.current,T.current,D).then(M=>{const Y={...M,isPositioned:F.current!==!1};P.current&&!fr($.current,Y)&&($.current=Y,_r.flushSync(()=>{p(Y)}))})},[h,t,r,K,F]);ur(()=>{d===!1&&$.current.isPositioned&&($.current.isPositioned=!1,p(D=>({...D,isPositioned:!1})))},[d]);const P=i.useRef(!1);ur(()=>(P.current=!0,()=>{P.current=!1}),[]),ur(()=>{if(N&&(C.current=N),E&&(T.current=E),N&&E){if(B.current)return B.current(N,E,L);L()}},[N,E,L,B,O]);const V=i.useMemo(()=>({reference:C,floating:T,setReference:y,setFloating:x}),[y,x]),A=i.useMemo(()=>({reference:N,floating:E}),[N,E]),X=i.useMemo(()=>{const D={position:r,left:0,top:0};if(!A.floating)return D;const M=rs(A.floating,f.x),Y=rs(A.floating,f.y);return l?{...D,transform:"translate("+M+"px, "+Y+"px)",...ts(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:M,top:Y}},[r,l,A.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:L,refs:V,elements:A,floatingStyles:X}),[f,L,V,A,X])}const Df=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?es({element:n.current,padding:a}).fn(r):{}:n?es({element:n,padding:a}).fn(r):{}}}},If=(e,t)=>({...Cf(e),options:[e,t]}),kf=(e,t)=>({...Sf(e),options:[e,t]}),Of=(e,t)=>({...Pf(e),options:[e,t]}),Lf=(e,t)=>({...Ef(e),options:[e,t]}),Ff=(e,t)=>({...Tf(e),options:[e,t]}),$f=(e,t)=>({...Mf(e),options:[e,t]}),zf=(e,t)=>({...Df(e),options:[e,t]});var Bf="Arrow",ns=i.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...s}=e;return o.jsx(Z.svg,{...s,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});ns.displayName=Bf;var Wf=ns;function Vf(e){const[t,r]=i.useState(void 0);return We(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const s=a[0];let c,l;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;c=d.inlineSize,l=d.blockSize}else c=e.offsetWidth,l=e.offsetHeight;r({width:c,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Nn="Popper",[os,pr]=Be(Nn),[Gf,as]=os(Nn),ss=e=>{const{__scopePopper:t,children:r}=e,[n,a]=i.useState(null);return o.jsx(Gf,{scope:t,anchor:n,onAnchorChange:a,children:r})};ss.displayName=Nn;var is="PopperAnchor",cs=i.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,s=as(is,r),c=i.useRef(null),l=oe(t,c);return i.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||c.current)}),n?null:o.jsx(Z.div,{...a,ref:l})});cs.displayName=is;var Cn="PopperContent",[Uf,jf]=os(Cn),ls=i.forwardRef((e,t)=>{var ae,Me,de,Pe,G,J;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:s="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:b,...g}=e,w=as(Cn,r),[v,y]=i.useState(null),x=oe(t,he=>y(he)),[N,E]=i.useState(null),C=Vf(N),T=(C==null?void 0:C.width)??0,$=(C==null?void 0:C.height)??0,O=n+(s!=="center"?"-"+s:""),B=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},K=Array.isArray(d)?d:[d],F=K.length>0,L={padding:B,boundary:K.filter(Kf),altBoundary:F},{refs:P,floatingStyles:V,placement:A,isPositioned:X,middlewareData:D}=_f({strategy:"fixed",placement:O,whileElementsMounted:(...he)=>Nf(...he,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[If({mainAxis:a+$,alignmentAxis:c}),u&&kf({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Of():void 0,...L}),u&&Lf({...L}),Ff({...L,apply:({elements:he,rects:W,availableWidth:j,availableHeight:ue})=>{const{width:ge,height:ve}=W.reference,R=he.floating.style;R.setProperty("--radix-popper-available-width",`${j}px`),R.setProperty("--radix-popper-available-height",`${ue}px`),R.setProperty("--radix-popper-anchor-width",`${ge}px`),R.setProperty("--radix-popper-anchor-height",`${ve}px`)}}),N&&zf({element:N,padding:l}),Yf({arrowWidth:T,arrowHeight:$}),h&&$f({strategy:"referenceHidden",...L})]}),[M,Y]=fs(A),Q=fe(b);We(()=>{X&&(Q==null||Q())},[X,Q]);const ee=(ae=D.arrow)==null?void 0:ae.x,te=(Me=D.arrow)==null?void 0:Me.y,ne=((de=D.arrow)==null?void 0:de.centerOffset)!==0,[se,le]=i.useState();return We(()=>{v&&le(window.getComputedStyle(v).zIndex)},[v]),o.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:X?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Pe=D.transformOrigin)==null?void 0:Pe.x,(G=D.transformOrigin)==null?void 0:G.y].join(" "),...((J=D.hide)==null?void 0:J.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(Uf,{scope:r,placedSide:M,onArrowChange:E,arrowX:ee,arrowY:te,shouldHideArrow:ne,children:o.jsx(Z.div,{"data-side":M,"data-align":Y,...g,ref:x,style:{...g.style,animation:X?void 0:"none"}})})})});ls.displayName=Cn;var ds="PopperArrow",Hf={top:"bottom",right:"left",bottom:"top",left:"right"},us=i.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=jf(ds,n),c=Hf[s.placedSide];return o.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:o.jsx(Wf,{...a,ref:r,style:{...a.style,display:"block"}})})});us.displayName=ds;function Kf(e){return e!==null}var Yf=e=>({name:"transformOrigin",options:e,fn(t){var w,v,y;const{placement:r,rects:n,middlewareData:a}=t,c=((w=a.arrow)==null?void 0:w.centerOffset)!==0,l=c?0:e.arrowWidth,u=c?0:e.arrowHeight,[d,f]=fs(r),p={start:"0%",center:"50%",end:"100%"}[f],h=(((v=a.arrow)==null?void 0:v.x)??0)+l/2,m=(((y=a.arrow)==null?void 0:y.y)??0)+u/2;let b="",g="";return d==="bottom"?(b=c?p:`${h}px`,g=`${-u}px`):d==="top"?(b=c?p:`${h}px`,g=`${n.floating.height+u}px`):d==="right"?(b=`${-u}px`,g=c?p:`${m}px`):d==="left"&&(b=`${n.floating.width+u}px`,g=c?p:`${m}px`),{data:{x:b,y:g}}}});function fs(e){const[t,r="center"]=e.split("-");return[t,r]}var Sn=ss,ps=cs,hs=ls,gs=us,En="rovingFocusGroup.onEntryFocus",qf={bubbles:!1,cancelable:!0},hr="RovingFocusGroup",[Tn,vs,Xf]=ln(hr),[Qf,ms]=Be(hr,[Xf]),[Zf,Jf]=Qf(hr),bs=i.forwardRef((e,t)=>o.jsx(Tn.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Tn.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Rf,{...e,ref:t})})}));bs.displayName=hr;var Rf=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,h=i.useRef(null),m=oe(t,h),b=za(s),[g=null,w]=st({prop:c,defaultProp:l,onChange:u}),[v,y]=i.useState(!1),x=fe(d),N=vs(r),E=i.useRef(!1),[C,T]=i.useState(0);return i.useEffect(()=>{const $=h.current;if($)return $.addEventListener(En,x),()=>$.removeEventListener(En,x)},[x]),o.jsx(Zf,{scope:r,orientation:n,dir:b,loop:a,currentTabStopId:g,onItemFocus:i.useCallback($=>w($),[w]),onItemShiftTab:i.useCallback(()=>y(!0),[]),onFocusableItemAdd:i.useCallback(()=>T($=>$+1),[]),onFocusableItemRemove:i.useCallback(()=>T($=>$-1),[]),children:o.jsx(Z.div,{tabIndex:v||C===0?-1:0,"data-orientation":n,...p,ref:m,style:{outline:"none",...e.style},onMouseDown:z(e.onMouseDown,()=>{E.current=!0}),onFocus:z(e.onFocus,$=>{const O=!E.current;if($.target===$.currentTarget&&O&&!v){const B=new CustomEvent(En,qf);if($.currentTarget.dispatchEvent(B),!B.defaultPrevented){const K=N().filter(A=>A.focusable),F=K.find(A=>A.active),L=K.find(A=>A.id===g),V=[F,L,...K].filter(Boolean).map(A=>A.ref.current);xs(V,f)}}E.current=!1}),onBlur:z(e.onBlur,()=>y(!1))})})}),ws="RovingFocusGroupItem",ys=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:s,...c}=e,l=Oe(),u=s||l,d=Jf(ws,r),f=d.currentTabStopId===u,p=vs(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=d;return i.useEffect(()=>{if(n)return h(),()=>m()},[n,h,m]),o.jsx(Tn.ItemSlot,{scope:r,id:u,focusable:n,active:a,children:o.jsx(Z.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:z(e.onMouseDown,b=>{n?d.onItemFocus(u):b.preventDefault()}),onFocus:z(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:z(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const g=rp(b,d.orientation,d.dir);if(g!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let v=p().filter(y=>y.focusable).map(y=>y.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const y=v.indexOf(b.currentTarget);v=d.loop?np(v,y+1):v.slice(y+1)}setTimeout(()=>xs(v))}})})})});ys.displayName=ws;var ep={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tp(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function rp(e,t,r){const n=tp(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return ep[n]}function xs(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function np(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var op=bs,ap=ys,Mn=["Enter"," "],sp=["ArrowDown","PageUp","Home"],Ns=["ArrowUp","PageDown","End"],ip=[...sp,...Ns],cp={ltr:[...Mn,"ArrowRight"],rtl:[...Mn,"ArrowLeft"]},lp={ltr:["ArrowLeft"],rtl:["ArrowRight"]},At="Menu",[_t,dp,up]=ln(At),[Je,Cs]=Be(At,[up,pr,ms]),Dt=pr(),Ss=ms(),[Es,He]=Je(At),[fp,It]=Je(At),Ts=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:s,modal:c=!0}=e,l=Dt(t),[u,d]=i.useState(null),f=i.useRef(!1),p=fe(s),h=za(a);return i.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),o.jsx(Sn,{...l,children:o.jsx(Es,{scope:t,open:r,onOpenChange:p,content:u,onContentChange:d,children:o.jsx(fp,{scope:t,onClose:i.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:h,modal:c,children:n})})})};Ts.displayName=At;var pp="MenuAnchor",Pn=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=Dt(r);return o.jsx(ps,{...a,...n,ref:t})});Pn.displayName=pp;var An="MenuPortal",[hp,Ms]=Je(An,{forceMount:void 0}),Ps=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:a}=e,s=He(An,t);return o.jsx(hp,{scope:t,forceMount:r,children:o.jsx(Ne,{present:r||s.open,children:o.jsx(Ct,{asChild:!0,container:a,children:n})})})};Ps.displayName=An;var xe="MenuContent",[gp,_n]=Je(xe),As=i.forwardRef((e,t)=>{const r=Ms(xe,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,s=He(xe,e.__scopeMenu),c=It(xe,e.__scopeMenu);return o.jsx(_t.Provider,{scope:e.__scopeMenu,children:o.jsx(Ne,{present:n||s.open,children:o.jsx(_t.Slot,{scope:e.__scopeMenu,children:c.modal?o.jsx(vp,{...a,ref:t}):o.jsx(mp,{...a,ref:t})})})})}),vp=i.forwardRef((e,t)=>{const r=He(xe,e.__scopeMenu),n=i.useRef(null),a=oe(t,n);return i.useEffect(()=>{const s=n.current;if(s)return ba(s)},[]),o.jsx(Dn,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),mp=i.forwardRef((e,t)=>{const r=He(xe,e.__scopeMenu);return o.jsx(Dn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Dn=i.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:m,disableOutsideScroll:b,...g}=e,w=He(xe,r),v=It(xe,r),y=Dt(r),x=Ss(r),N=dp(r),[E,C]=i.useState(null),T=i.useRef(null),$=oe(t,T,w.onContentChange),O=i.useRef(0),B=i.useRef(""),K=i.useRef(0),F=i.useRef(null),L=i.useRef("right"),P=i.useRef(0),V=b?Qr:i.Fragment,A=b?{as:ye,allowPinchZoom:!0}:void 0,X=M=>{var ae,Me;const Y=B.current+M,Q=N().filter(de=>!de.disabled),ee=document.activeElement,te=(ae=Q.find(de=>de.ref.current===ee))==null?void 0:ae.textValue,ne=Q.map(de=>de.textValue),se=Ap(ne,Y,te),le=(Me=Q.find(de=>de.textValue===se))==null?void 0:Me.ref.current;(function de(Pe){B.current=Pe,window.clearTimeout(O.current),Pe!==""&&(O.current=window.setTimeout(()=>de(""),1e3))})(Y),le&&setTimeout(()=>le.focus())};i.useEffect(()=>()=>window.clearTimeout(O.current),[]),na();const D=i.useCallback(M=>{var Q,ee;return L.current===((Q=F.current)==null?void 0:Q.side)&&Dp(M,(ee=F.current)==null?void 0:ee.area)},[]);return o.jsx(gp,{scope:r,searchRef:B,onItemEnter:i.useCallback(M=>{D(M)&&M.preventDefault()},[D]),onItemLeave:i.useCallback(M=>{var Y;D(M)||((Y=T.current)==null||Y.focus(),C(null))},[D]),onTriggerLeave:i.useCallback(M=>{D(M)&&M.preventDefault()},[D]),pointerGraceTimerRef:K,onPointerGraceIntentChange:i.useCallback(M=>{F.current=M},[]),children:o.jsx(V,{...A,children:o.jsx(jr,{asChild:!0,trapped:a,onMountAutoFocus:z(s,M=>{var Y;M.preventDefault(),(Y=T.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:o.jsx(Nt,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:h,onDismiss:m,children:o.jsx(op,{asChild:!0,...x,dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:C,onEntryFocus:z(u,M=>{v.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(hs,{role:"menu","aria-orientation":"vertical","data-state":Ys(w.open),"data-radix-menu-content":"",dir:v.dir,...y,...g,ref:$,style:{outline:"none",...g.style},onKeyDown:z(g.onKeyDown,M=>{const Q=M.target.closest("[data-radix-menu-content]")===M.currentTarget,ee=M.ctrlKey||M.altKey||M.metaKey,te=M.key.length===1;Q&&(M.key==="Tab"&&M.preventDefault(),!ee&&te&&X(M.key));const ne=T.current;if(M.target!==ne||!ip.includes(M.key))return;M.preventDefault();const le=N().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);Ns.includes(M.key)&&le.reverse(),Mp(le)}),onBlur:z(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(O.current),B.current="")}),onPointerMove:z(e.onPointerMove,Ot(M=>{const Y=M.target,Q=P.current!==M.clientX;if(M.currentTarget.contains(Y)&&Q){const ee=M.clientX>P.current?"right":"left";L.current=ee,P.current=M.clientX}}))})})})})})})});As.displayName=xe;var bp="MenuGroup",In=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(Z.div,{role:"group",...n,ref:t})});In.displayName=bp;var wp="MenuLabel",_s=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(Z.div,{...n,ref:t})});_s.displayName=wp;var gr="MenuItem",Ds="menu.itemSelect",vr=i.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...a}=e,s=i.useRef(null),c=It(gr,e.__scopeMenu),l=_n(gr,e.__scopeMenu),u=oe(t,s),d=i.useRef(!1),f=()=>{const p=s.current;if(!r&&p){const h=new CustomEvent(Ds,{bubbles:!0,cancelable:!0});p.addEventListener(Ds,m=>n==null?void 0:n(m),{once:!0}),Wr(p,h),h.defaultPrevented?d.current=!1:c.onClose()}};return o.jsx(Is,{...a,ref:u,disabled:r,onClick:z(e.onClick,f),onPointerDown:p=>{var h;(h=e.onPointerDown)==null||h.call(e,p),d.current=!0},onPointerUp:z(e.onPointerUp,p=>{var h;d.current||(h=p.currentTarget)==null||h.click()}),onKeyDown:z(e.onKeyDown,p=>{const h=l.searchRef.current!=="";r||h&&p.key===" "||Mn.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});vr.displayName=gr;var Is=i.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...s}=e,c=_n(gr,r),l=Ss(r),u=i.useRef(null),d=oe(t,u),[f,p]=i.useState(!1),[h,m]=i.useState("");return i.useEffect(()=>{const b=u.current;b&&m((b.textContent??"").trim())},[s.children]),o.jsx(_t.ItemSlot,{scope:r,disabled:n,textValue:a??h,children:o.jsx(ap,{asChild:!0,...l,focusable:!n,children:o.jsx(Z.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:d,onPointerMove:z(e.onPointerMove,Ot(b=>{n?c.onItemLeave(b):(c.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,Ot(b=>c.onItemLeave(b))),onFocus:z(e.onFocus,()=>p(!0)),onBlur:z(e.onBlur,()=>p(!1))})})})}),yp="MenuCheckboxItem",ks=i.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...a}=e;return o.jsx(zs,{scope:e.__scopeMenu,checked:r,children:o.jsx(vr,{role:"menuitemcheckbox","aria-checked":mr(r)?"mixed":r,...a,ref:t,"data-state":Ln(r),onSelect:z(a.onSelect,()=>n==null?void 0:n(mr(r)?!0:!r),{checkForDefaultPrevented:!1})})})});ks.displayName=yp;var Os="MenuRadioGroup",[xp,Np]=Je(Os,{value:void 0,onValueChange:()=>{}}),Ls=i.forwardRef((e,t)=>{const{value:r,onValueChange:n,...a}=e,s=fe(n);return o.jsx(xp,{scope:e.__scopeMenu,value:r,onValueChange:s,children:o.jsx(In,{...a,ref:t})})});Ls.displayName=Os;var Fs="MenuRadioItem",$s=i.forwardRef((e,t)=>{const{value:r,...n}=e,a=Np(Fs,e.__scopeMenu),s=r===a.value;return o.jsx(zs,{scope:e.__scopeMenu,checked:s,children:o.jsx(vr,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":Ln(s),onSelect:z(n.onSelect,()=>{var c;return(c=a.onValueChange)==null?void 0:c.call(a,r)},{checkForDefaultPrevented:!1})})})});$s.displayName=Fs;var kn="MenuItemIndicator",[zs,Cp]=Je(kn,{checked:!1}),Bs=i.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...a}=e,s=Cp(kn,r);return o.jsx(Ne,{present:n||mr(s.checked)||s.checked===!0,children:o.jsx(Z.span,{...a,ref:t,"data-state":Ln(s.checked)})})});Bs.displayName=kn;var Sp="MenuSeparator",Ws=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx(Z.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Ws.displayName=Sp;var Ep="MenuArrow",Vs=i.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=Dt(r);return o.jsx(gs,{...a,...n,ref:t})});Vs.displayName=Ep;var On="MenuSub",[Tp,Gs]=Je(On),Us=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:a}=e,s=He(On,t),c=Dt(t),[l,u]=i.useState(null),[d,f]=i.useState(null),p=fe(a);return i.useEffect(()=>(s.open===!1&&p(!1),()=>p(!1)),[s.open,p]),o.jsx(Sn,{...c,children:o.jsx(Es,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:o.jsx(Tp,{scope:t,contentId:Oe(),triggerId:Oe(),trigger:l,onTriggerChange:u,children:r})})})};Us.displayName=On;var kt="MenuSubTrigger",js=i.forwardRef((e,t)=>{const r=He(kt,e.__scopeMenu),n=It(kt,e.__scopeMenu),a=Gs(kt,e.__scopeMenu),s=_n(kt,e.__scopeMenu),c=i.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},f=i.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return i.useEffect(()=>f,[f]),i.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),u(null)}},[l,u]),o.jsx(Pn,{asChild:!0,...d,children:o.jsx(Is,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":Ys(r.open),...e,ref:Vt(t,a.onTriggerChange),onClick:p=>{var h;(h=e.onClick)==null||h.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,Ot(p=>{s.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!r.open&&!c.current&&(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{r.onOpenChange(!0),f()},100))})),onPointerLeave:z(e.onPointerLeave,Ot(p=>{var m,b;f();const h=(m=r.content)==null?void 0:m.getBoundingClientRect();if(h){const g=(b=r.content)==null?void 0:b.dataset.side,w=g==="right",v=w?-5:5,y=h[w?"left":"right"],x=h[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:p.clientX+v,y:p.clientY},{x:y,y:h.top},{x,y:h.top},{x,y:h.bottom},{x:y,y:h.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(p),p.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,p=>{var m;const h=s.searchRef.current!=="";e.disabled||h&&p.key===" "||cp[n.dir].includes(p.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),p.preventDefault())})})})});js.displayName=kt;var Hs="MenuSubContent",Ks=i.forwardRef((e,t)=>{const r=Ms(xe,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,s=He(xe,e.__scopeMenu),c=It(xe,e.__scopeMenu),l=Gs(Hs,e.__scopeMenu),u=i.useRef(null),d=oe(t,u);return o.jsx(_t.Provider,{scope:e.__scopeMenu,children:o.jsx(Ne,{present:n||s.open,children:o.jsx(_t.Slot,{scope:e.__scopeMenu,children:o.jsx(Dn,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var p;c.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:z(e.onFocusOutside,f=>{f.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,f=>{c.onClose(),f.preventDefault()}),onKeyDown:z(e.onKeyDown,f=>{var m;const p=f.currentTarget.contains(f.target),h=lp[c.dir].includes(f.key);p&&h&&(s.onOpenChange(!1),(m=l.trigger)==null||m.focus(),f.preventDefault())})})})})})});Ks.displayName=Hs;function Ys(e){return e?"open":"closed"}function mr(e){return e==="indeterminate"}function Ln(e){return mr(e)?"indeterminate":e?"checked":"unchecked"}function Mp(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Pp(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function Ap(e,t,r){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let c=Pp(e,Math.max(s,0));a.length===1&&(c=c.filter(d=>d!==r));const u=c.find(d=>d.toLowerCase().startsWith(a.toLowerCase()));return u!==r?u:void 0}function _p(e,t){const{x:r,y:n}=e;let a=!1;for(let s=0,c=t.length-1;s<t.length;c=s++){const l=t[s].x,u=t[s].y,d=t[c].x,f=t[c].y;u>n!=f>n&&r<(d-l)*(n-u)/(f-u)+l&&(a=!a)}return a}function Dp(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return _p(r,t)}function Ot(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Ip=Ts,kp=Pn,Op=Ps,Lp=As,Fp=In,$p=_s,zp=vr,Bp=ks,Wp=Ls,Vp=$s,Gp=Bs,Up=Ws,jp=Vs,Hp=Us,Kp=js,Yp=Ks,Fn="DropdownMenu",[qp,sv]=Be(Fn,[Cs]),pe=Cs(),[Xp,qs]=qp(Fn),Xs=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:s,onOpenChange:c,modal:l=!0}=e,u=pe(t),d=i.useRef(null),[f=!1,p]=st({prop:a,defaultProp:s,onChange:c});return o.jsx(Xp,{scope:t,triggerId:Oe(),triggerRef:d,contentId:Oe(),open:f,onOpenChange:p,onOpenToggle:i.useCallback(()=>p(h=>!h),[p]),modal:l,children:o.jsx(Ip,{...u,open:f,onOpenChange:p,dir:n,modal:l,children:r})})};Xs.displayName=Fn;var Qs="DropdownMenuTrigger",Zs=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,s=qs(Qs,r),c=pe(r);return o.jsx(kp,{asChild:!0,...c,children:o.jsx(Z.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:Vt(t,s.triggerRef),onPointerDown:z(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:z(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});Zs.displayName=Qs;var Qp="DropdownMenuPortal",Js=e=>{const{__scopeDropdownMenu:t,...r}=e,n=pe(t);return o.jsx(Op,{...n,...r})};Js.displayName=Qp;var Rs="DropdownMenuContent",ei=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=qs(Rs,r),s=pe(r),c=i.useRef(!1);return o.jsx(Lp,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...n,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,l=>{var u;c.current||(u=a.triggerRef.current)==null||u.focus(),c.current=!1,l.preventDefault()}),onInteractOutside:z(e.onInteractOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;(!a.modal||f)&&(c.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)"}})});ei.displayName=Rs;var Zp="DropdownMenuGroup",ti=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Fp,{...a,...n,ref:t})});ti.displayName=Zp;var Jp="DropdownMenuLabel",ri=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx($p,{...a,...n,ref:t})});ri.displayName=Jp;var Rp="DropdownMenuItem",ni=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(zp,{...a,...n,ref:t})});ni.displayName=Rp;var eh="DropdownMenuCheckboxItem",oi=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Bp,{...a,...n,ref:t})});oi.displayName=eh;var th="DropdownMenuRadioGroup",ai=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Wp,{...a,...n,ref:t})});ai.displayName=th;var rh="DropdownMenuRadioItem",si=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Vp,{...a,...n,ref:t})});si.displayName=rh;var nh="DropdownMenuItemIndicator",ii=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Gp,{...a,...n,ref:t})});ii.displayName=nh;var oh="DropdownMenuSeparator",ci=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Up,{...a,...n,ref:t})});ci.displayName=oh;var ah="DropdownMenuArrow",sh=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(jp,{...a,...n,ref:t})});sh.displayName=ah;var ih=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:a,defaultOpen:s}=e,c=pe(t),[l=!1,u]=st({prop:n,defaultProp:s,onChange:a});return o.jsx(Hp,{...c,open:l,onOpenChange:u,children:r})},ch="DropdownMenuSubTrigger",li=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Kp,{...a,...n,ref:t})});li.displayName=ch;var lh="DropdownMenuSubContent",di=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=pe(r);return o.jsx(Yp,{...a,...n,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)"}})});di.displayName=lh;var dh=Xs,uh=Zs,ui=Js,fi=ei,fh=ti,pi=ri,hi=ni,gi=oi,ph=ai,vi=si,mi=ii,bi=ci,hh=ih,wi=li,yi=di;const gh=dh,vh=uh,mh=fh,bh=ui,wh=hh,yh=ph,xi=i.forwardRef(({className:e,inset:t,children:r,...n},a)=>o.jsxs(wi,{ref:a,className:_("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),...n,children:[r,o.jsx(fl,{className:"ml-auto"})]}));xi.displayName=wi.displayName;const Ni=i.forwardRef(({className:e,...t},r)=>o.jsx(yi,{ref:r,className:_("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}));Ni.displayName=yi.displayName;const Ci=i.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(ui,{children:o.jsx(fi,{ref:n,sideOffset:t,className:_("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),...r})}));Ci.displayName=fi.displayName;const Si=i.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(hi,{ref:n,className:_("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),...r}));Si.displayName=hi.displayName;const Ei=i.forwardRef(({className:e,children:t,checked:r,...n},a)=>o.jsxs(gi,{ref:a,className:_("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(mi,{children:o.jsx(Dr,{className:"h-4 w-4"})})}),t]}));Ei.displayName=gi.displayName;const Ti=i.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(vi,{ref:n,className:_("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(mi,{children:o.jsx(hl,{className:"h-2 w-2 fill-current"})})}),t]}));Ti.displayName=vi.displayName;const Mi=i.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(pi,{ref:n,className:_("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Mi.displayName=pi.displayName;const Pi=i.forwardRef(({className:e,...t},r)=>o.jsx(bi,{ref:r,className:_("-mx-1 my-1 h-px bg-muted",e),...t}));Pi.displayName=bi.displayName;const Ai=({className:e,...t})=>o.jsx("span",{className:_("ml-auto text-xs tracking-widest opacity-60",e),...t});Ai.displayName="DropdownMenuShortcut";function _i({inventory:e,showBinLocation:t}){const r=(v,y,x=!1,N=!0)=>o.jsxs("div",{className:`p-3 text-sm ${N&&y>0?"border-t":""} ${x?"border-r":""}`,children:[o.jsxs("div",{className:"flex justify-between font-medium",children:[o.jsx("span",{children:v.Name}),o.jsx("span",{children:v.AvailableQuantity})]}),o.jsxs("div",{className:"flex justify-between mt-1 text-xs text-gray-600",children:[o.jsx("span",{children:"Expecting"}),o.jsx("span",{children:v.PurchaseOrderQuantity||"-"})]}),t&&o.jsxs("div",{className:"flex justify-between mt-1 text-xs text-gray-600",children:[o.jsx("span",{children:"Bin Location"}),o.jsx("span",{children:v.BinLocation||"-"})]})]},`warehouse-${v.WarehouseId}`),n=["MTL","TOR"],a=["VAN","EDM"],s=[...e].sort((v,y)=>(v.Name||"").localeCompare(y.Name||"")),c=s.filter(v=>v.Country==="US"),l=s.filter(v=>v.Country==="CA"),u=s.filter(v=>a.includes(v.WarehouseId||"")),d=s.filter(v=>n.includes(v.WarehouseId||"")),f=l.filter(v=>!n.includes(v.WarehouseId||"")&&!a.includes(v.WarehouseId||"")),p=v=>v.reduce((y,x)=>y+(x.AvailableQuantity||0),0),h=p(l),m=p(d),b=p(u),g=p(c),w=h+g;return o.jsxs("div",{className:"border rounded-md overflow-hidden",children:[l.length>0&&c.length>0&&o.jsxs("div",{className:"grid grid-cols-2 border-b",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"Total"}),o.jsx("span",{children:w})]}),o.jsx("div",{className:"p-3"})]}),l.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 border-b bg-gray-50",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"Canada"}),o.jsx("span",{children:h})]}),o.jsx("div",{className:"p-3"})]}),o.jsxs("div",{className:"grid grid-cols-2",children:[o.jsxs("div",{className:"border-r",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"West"}),o.jsx("span",{children:b})]}),u.map((v,y)=>r(v,y))]}),o.jsxs("div",{children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"East"}),o.jsx("span",{children:m})]}),d.map((v,y)=>r(v,y))]})]}),f.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t p-3 font-semibold text-sm",children:o.jsx("span",{children:"Other"})}),o.jsx("div",{className:"grid grid-cols-2",children:f.map((v,y)=>r(v,y,y%2===0,!0))})]})]}),c.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 border-t bg-gray-50",children:[o.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[o.jsx("span",{children:"United States"}),o.jsx("span",{children:g})]}),o.jsx("div",{className:"p-3"})]}),o.jsx("div",{className:"grid grid-cols-2",children:c.map((v,y)=>r(v,y,y%2===0,!0))})]}),e.length===0&&o.jsx("div",{className:"p-6 text-center text-gray-500",children:"No inventory information available"})]})}const Di=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ii=ko,Lt=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Ii(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:s}=t,c=Object.keys(a).map(d=>{const f=r==null?void 0:r[d],p=s==null?void 0:s[d];if(f===null)return null;const h=Di(f)||Di(p);return a[d][h]}),l=r&&Object.entries(r).reduce((d,f)=>{let[p,h]=f;return h===void 0||(d[p]=h),d},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,f)=>{let{class:p,className:h,...m}=f;return Object.entries(m).every(b=>{let[g,w]=b;return Array.isArray(w)?w.includes({...s,...l}[g]):{...s,...l}[g]===w})?[...d,p,h]:d},[]);return Ii(e,c,u,r==null?void 0:r.class,r==null?void 0:r.className)},$n=Lt("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 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",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"}}),ce=i.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,confirmationDialog:a,onClick:s,...c},l)=>{const u=n?ye:"button";if(!a)return o.jsx(u,{className:_($n({variant:t,size:r,className:e})),ref:l,onClick:s,...c});s&&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:d,content:f,onConfirm:p,confirmText:h="Confirm",cancelText:m="Cancel"}=a,b=()=>{p()};return o.jsxs(St,{children:[o.jsx(nn,{asChild:!0,children:o.jsx(u,{className:_($n({variant:t,size:r,className:e})),ref:l,...c})}),o.jsxs(Et,{children:[o.jsxs(rr,{children:[o.jsx(nr,{children:d}),o.jsx(cn,{children:f})]}),o.jsxs(sn,{className:"flex justify-end gap-2 pt-4",children:[o.jsx(on,{asChild:!0,children:o.jsx(ce,{variant:"outline",children:m})}),o.jsx(on,{asChild:!0,children:o.jsx(ce,{onClick:b,children:h})})]})]})]})});ce.displayName="Button";var xh="VisuallyHidden",br=i.forwardRef((e,t)=>o.jsx(Z.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));br.displayName=xh;var Nh=br,[wr,iv]=Be("Tooltip",[pr]),yr=pr(),ki="TooltipProvider",Ch=700,zn="tooltip.open",[Sh,Bn]=wr(ki),Oi=e=>{const{__scopeTooltip:t,delayDuration:r=Ch,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:s}=e,[c,l]=i.useState(!0),u=i.useRef(!1),d=i.useRef(0);return i.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),o.jsx(Sh,{scope:t,isOpenDelayed:c,delayDuration:r,onOpen:i.useCallback(()=>{window.clearTimeout(d.current),l(!1)},[]),onClose:i.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(!0),n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:i.useCallback(f=>{u.current=f},[]),disableHoverableContent:a,children:s})};Oi.displayName=ki;var xr="Tooltip",[Eh,Ft]=wr(xr),Li=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a=!1,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=Bn(xr,e.__scopeTooltip),d=yr(t),[f,p]=i.useState(null),h=Oe(),m=i.useRef(0),b=c??u.disableHoverableContent,g=l??u.delayDuration,w=i.useRef(!1),[v=!1,y]=st({prop:n,defaultProp:a,onChange:T=>{T?(u.onOpen(),document.dispatchEvent(new CustomEvent(zn))):u.onClose(),s==null||s(T)}}),x=i.useMemo(()=>v?w.current?"delayed-open":"instant-open":"closed",[v]),N=i.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w.current=!1,y(!0)},[y]),E=i.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),C=i.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,y(!0),m.current=0},g)},[g,y]);return i.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),o.jsx(Sn,{...d,children:o.jsx(Eh,{scope:t,contentId:h,open:v,stateAttribute:x,trigger:f,onTriggerChange:p,onTriggerEnter:i.useCallback(()=>{u.isOpenDelayed?C():N()},[u.isOpenDelayed,C,N]),onTriggerLeave:i.useCallback(()=>{b?E():(window.clearTimeout(m.current),m.current=0)},[E,b]),onOpen:N,onClose:E,disableHoverableContent:b,children:r})})};Li.displayName=xr;var Wn="TooltipTrigger",Fi=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=Ft(Wn,r),s=Bn(Wn,r),c=yr(r),l=i.useRef(null),u=oe(t,l,a.onTriggerChange),d=i.useRef(!1),f=i.useRef(!1),p=i.useCallback(()=>d.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),o.jsx(ps,{asChild:!0,...c,children:o.jsx(Z.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:u,onPointerMove:z(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),f.current=!0)}),onPointerLeave:z(e.onPointerLeave,()=>{a.onTriggerLeave(),f.current=!1}),onPointerDown:z(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:z(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:z(e.onBlur,a.onClose),onClick:z(e.onClick,a.onClose)})})});Fi.displayName=Wn;var Vn="TooltipPortal",[Th,Mh]=wr(Vn,{forceMount:void 0}),$i=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,s=Ft(Vn,t);return o.jsx(Th,{scope:t,forceMount:r,children:o.jsx(Ne,{present:r||s.open,children:o.jsx(Ct,{asChild:!0,container:a,children:n})})})};$i.displayName=Vn;var gt="TooltipContent",zi=i.forwardRef((e,t)=>{const r=Mh(gt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...s}=e,c=Ft(gt,e.__scopeTooltip);return o.jsx(Ne,{present:n||c.open,children:c.disableHoverableContent?o.jsx(Bi,{side:a,...s,ref:t}):o.jsx(Ph,{side:a,...s,ref:t})})}),Ph=i.forwardRef((e,t)=>{const r=Ft(gt,e.__scopeTooltip),n=Bn(gt,e.__scopeTooltip),a=i.useRef(null),s=oe(t,a),[c,l]=i.useState(null),{trigger:u,onClose:d}=r,f=a.current,{onPointerInTransitChange:p}=n,h=i.useCallback(()=>{l(null),p(!1)},[p]),m=i.useCallback((b,g)=>{const w=b.currentTarget,v={x:b.clientX,y:b.clientY},y=Ih(v,w.getBoundingClientRect()),x=kh(v,y),N=Oh(g.getBoundingClientRect()),E=Fh([...x,...N]);l(E),p(!0)},[p]);return i.useEffect(()=>()=>h(),[h]),i.useEffect(()=>{if(u&&f){const b=w=>m(w,f),g=w=>m(w,u);return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",g),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",g)}}},[u,f,m,h]),i.useEffect(()=>{if(c){const b=g=>{const w=g.target,v={x:g.clientX,y:g.clientY},y=(u==null?void 0:u.contains(w))||(f==null?void 0:f.contains(w)),x=!Lh(v,c);y?h():x&&(h(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,c,d,h]),o.jsx(Bi,{...e,ref:s})}),[Ah,_h]=wr(xr,{isInside:!1}),Bi=i.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=Ft(gt,r),d=yr(r),{onClose:f}=u;return i.useEffect(()=>(document.addEventListener(zn,f),()=>document.removeEventListener(zn,f)),[f]),i.useEffect(()=>{if(u.trigger){const p=h=>{const m=h.target;m!=null&&m.contains(u.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,f]),o.jsx(Nt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:o.jsxs(hs,{"data-state":u.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(Ko,{children:n}),o.jsx(Ah,{scope:r,isInside:!0,children:o.jsx(Nh,{id:u.contentId,role:"tooltip",children:a||n})})]})})});zi.displayName=gt;var Wi="TooltipArrow",Dh=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=yr(r);return _h(Wi,r).isInside?null:o.jsx(gs,{...a,...n,ref:t})});Dh.displayName=Wi;function Ih(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,a,s)){case s:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function kh(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Oh(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function Lh(e,t){const{x:r,y:n}=e;let a=!1;for(let s=0,c=t.length-1;s<t.length;c=s++){const l=t[s].x,u=t[s].y,d=t[c].x,f=t[c].y;u>n!=f>n&&r<(d-l)*(n-u)/(f-u)+l&&(a=!a)}return a}function Fh(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),$h(t)}function $h(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const a=e[n];for(;t.length>=2;){const s=t[t.length-1],c=t[t.length-2];if((s.x-c.x)*(a.y-c.y)>=(s.y-c.y)*(a.x-c.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;r.length>=2;){const s=r[r.length-1],c=r[r.length-2];if((s.x-c.x)*(a.y-c.y)>=(s.y-c.y)*(a.x-c.x))r.pop();else break}r.push(a)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var zh=Oi,Bh=Li,Wh=Fi,Vh=$i,Vi=zi;const vt=zh,mt=Bh,bt=Wh,Re=i.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(Vh,{children:o.jsx(Vi,{ref:n,sideOffset:t,className:_("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Re.displayName=Vi.displayName;const Nr=i.forwardRef(({className:e,type:t,mask:r,onChange:n,placeholder:a,...s},c)=>{const[l,u]=i.useState(!1),d=i.useRef(null),p=a||(r==="phone"?"(999) 999-9999":r==="postal-code-ca"?"A9A 9A9":r==="zip-code-us"?"99999":""),h=()=>r==="phone"?"Only enter numbers. Formatting will be added automatically.":r==="postal-code-ca"?"Enter letters and numbers only. Spacing will be applied automatically.":r==="zip-code-us"?"Only enter numbers. Formatting will be added automatically.":"",m=()=>{u(!0),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{u(!1)},3e3)};i.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const b=g=>{if(r){const w=g.target.value;let v=w;if(w.length>0){const y=w[w.length-1];/[^a-zA-Z0-9]/.test(y)&&(console.log("Non-alphanumeric detected:",y),m())}if(r==="phone"){const y=w.replace(/\D/g,"");y.length<=3?v=y:y.length<=6?v=`(${y.slice(0,3)}) ${y.slice(3)}`:v=`(${y.slice(0,3)}) ${y.slice(3,6)}-${y.slice(6,10)}`}else if(r==="postal-code-ca"){const y=w.replace(/[^a-zA-Z0-9]/g,"").toUpperCase();let x="";for(let N=0;N<Math.min(y.length,6);N++){const E=y[N];N===0||N===2||N===4?/[A-Z]/.test(E)&&(x+=E):(N===1||N===3||N===5)&&/[0-9]/.test(E)&&(x+=E)}x.length<=3?v=x:v=`${x.slice(0,3)} ${x.slice(3,6)}`}else if(r==="zip-code-us"){const y=w.replace(/\D/g,"");y.length<=5?v=y:v=`${y.slice(0,5)}-${y.slice(5,9)}`}g.target.value=v}n==null||n(g)};return o.jsx(vt,{children:o.jsxs(mt,{open:l&&!!r,children:[o.jsx(bt,{asChild:!0,children:o.jsx("input",{type:t,className:_("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),onChange:b,placeholder:p,ref:c,...s})}),o.jsx(Re,{side:"top",className:"bg-sidebar text-sidebar-foreground",children:h()})]})})});Nr.displayName="Input";var Gh="Separator",Gi="horizontal",Uh=["horizontal","vertical"],Ui=i.forwardRef((e,t)=>{const{decorative:r,orientation:n=Gi,...a}=e,s=jh(n)?n:Gi,l=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return o.jsx(Z.div,{"data-orientation":s,...l,...a,ref:t})});Ui.displayName=Gh;function jh(e){return Uh.includes(e)}var ji=Ui;const Gn=i.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},a)=>o.jsx(ji,{ref:a,decorative:r,orientation:t,className:_("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Gn.displayName=ji.displayName;const Hi=rn,Hh=La,Kh=tr,Ki=Fa,Un=i.forwardRef(({className:e,...t},r)=>o.jsx(Zt,{className:_("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,ref:r}));Un.displayName=Zt.displayName;const Yh=Lt("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),jn=i.forwardRef(({side:e="right",className:t,children:r,...n},a)=>o.jsxs(Ki,{children:[o.jsx(Un,{}),o.jsxs(Jt,{ref:a,className:_(Yh({side:e}),t),...n,children:[o.jsxs(tr,{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-secondary",children:[o.jsx(Ir,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));jn.displayName=Jt.displayName;const Yi=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col space-y-2 text-center sm:text-left",e),...t});Yi.displayName="SheetHeader";const qi=({className:e,...t})=>o.jsx("div",{className:_("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});qi.displayName="SheetFooter";const Xi=i.forwardRef(({className:e,...t},r)=>o.jsx(Rt,{ref:r,className:_("text-lg font-semibold text-foreground",e),...t}));Xi.displayName=Rt.displayName;const Qi=i.forwardRef(({className:e,...t},r)=>o.jsx(er,{ref:r,className:_("text-sm text-muted-foreground",e),...t}));Qi.displayName=er.displayName;function qh({onClick:e,publicName:t,applicationName:r,partnerId:n}){const a=`https://api.randmar.io/v4/Partner/${n}/Account/Logo?height=72&width=72`,[s,c]=H.useState(!1),l=()=>{c(!0)};return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-muted "+(e!==void 0?"cursor-pointer":""),children:s?o.jsx(ce,{asChild:!0,size:"icon",onClick:e,children:o.jsx(Ml,{className:"h-5 w-5 text-muted-foreground !bg-sidebar"})}):o.jsx(ce,{asChild:!0,size:"icon",onClick:e,children:o.jsx("img",{src:a,alt:"Partner logo",className:"h-9 w-9 object-cover !bg-sidebar",onError:l})})}),o.jsxs("div",{className:"flex flex-1 flex-col",children:[o.jsx("span",{className:"text-sm font-medium",children:t||"Partner"}),o.jsx("span",{className:"text-xs text-neutral-400",children:r})]})]})}var Xh="Label",Zi=i.forwardRef((e,t)=>o.jsx(Z.label,{...e,ref:t,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Zi.displayName=Xh;var Qh=Zi;function Zh({className:e,...t}){return o.jsx(Qh,{"data-slot":"label",className:_("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const Hn=1024;function Ji(){const[e,t]=i.useState(void 0);return i.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Hn-1}px)`),n=()=>{t(window.innerWidth<Hn)};return r.addEventListener("change",n),t(window.innerWidth<Hn),()=>r.removeEventListener("change",n)},[]),!!e}function U({className:e,...t}){return o.jsx("div",{className:_("animate-pulse rounded-md bg-primary/20",e),...t})}const Jh="sidebar:state",Rh=60*60*24*7,eg="16rem",tg="18rem",rg="3rem",ng="b",Ri=i.createContext(null);function $t(){const e=i.useContext(Ri);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Kn=i.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:a,children:s,...c},l)=>{const u=Ji(),[d,f]=i.useState(!1),[p,h]=i.useState(e),m=t??p,b=i.useCallback(y=>{const x=typeof y=="function"?y(m):y;r?r(x):h(x),document.cookie=`${Jh}=${x}; path=/; max-age=${Rh}`},[r,m]),g=i.useCallback(()=>u?f(y=>!y):b(y=>!y),[u,b,f]);i.useEffect(()=>{const y=x=>{x.key===ng&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[g]);const w=m?"expanded":"collapsed",v=i.useMemo(()=>({state:w,open:m,setOpen:b,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:g}),[w,m,b,u,d,f,g]);return o.jsx(Ri.Provider,{value:v,children:o.jsx(vt,{delayDuration:0,children:o.jsx("div",{style:{"--sidebar-width":eg,"--sidebar-width-icon":rg,...a},className:_("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",n),ref:l,...c,children:s})})})});Kn.displayName="SidebarProvider";const Yn=i.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:a,...s},c)=>{const{isMobile:l,state:u,openMobile:d,setOpenMobile:f}=$t();return r==="none"?o.jsx("div",{className:_("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",n),ref:c,...s,children:a}):l?o.jsx(Hi,{open:d,onOpenChange:f,...s,children:o.jsx(jn,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":tg},side:e,children:o.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):o.jsxs("div",{ref:c,className:"group peer hidden md:block text-sidebar-foreground","data-state":u,"data-collapsible":u==="collapsed"?r:"","data-variant":t,"data-side":e,children:[o.jsx("div",{className:_("duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),o.jsx("div",{className:_("duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...s,children:o.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:a})})]})});Yn.displayName="Sidebar";const qn=i.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:a}=$t();return o.jsxs(ce,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:_("h-7 w-7 text-sidebar-foreground",e),onClick:s=>{t==null||t(s),a()},...r,children:[o.jsx(xl,{}),o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});qn.displayName="SidebarTrigger";const ec=i.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=$t();return o.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:_("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});ec.displayName="SidebarRail";const tc=i.forwardRef(({className:e,...t},r)=>o.jsx("main",{ref:r,className:_("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",e),...t}));tc.displayName="SidebarInset";const rc=i.forwardRef(({className:e,...t},r)=>o.jsx(Nr,{ref:r,"data-sidebar":"input",className:_("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));rc.displayName="SidebarInput";const Xn=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"header",className:_("flex flex-col gap-2 p-2",e),...t}));Xn.displayName="SidebarHeader";const Qn=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"footer",className:_("flex flex-col gap-2 p-2",e),...t}));Qn.displayName="SidebarFooter";const nc=i.forwardRef(({className:e,...t},r)=>o.jsx(Gn,{ref:r,"data-sidebar":"separator",className:_("mx-2 w-auto bg-sidebar-border",e),...t}));nc.displayName="SidebarSeparator";const Zn=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"content",className:_("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));Zn.displayName="SidebarContent";const oc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"group",className:_("relative flex w-full min-w-0 flex-col p-2",e),...t}));oc.displayName="SidebarGroup";const ac=i.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const a=t?ye:"div";return o.jsx(a,{ref:n,"data-sidebar":"group-label",className:_("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});ac.displayName="SidebarGroupLabel";const sc=i.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const a=t?ye:"button";return o.jsx(a,{ref:n,"data-sidebar":"group-action",className:_("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...r})});sc.displayName="SidebarGroupAction";const ic=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"group-content",className:_("w-full text-sm",e),...t}));ic.displayName="SidebarGroupContent";const Jn=i.forwardRef(({className:e,...t},r)=>o.jsx("ul",{ref:r,"data-sidebar":"menu",className:_("flex w-full min-w-0 flex-col gap-1",e),...t}));Jn.displayName="SidebarMenu";const Rn=i.forwardRef(({className:e,...t},r)=>o.jsx("li",{ref:r,"data-sidebar":"menu-item",className:_("group/menu-item relative",e),...t}));Rn.displayName="SidebarMenuItem";const og=Lt("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),eo=i.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:a,className:s,...c},l)=>{const u=e?ye:"button",{isMobile:d,state:f}=$t(),p=o.jsx(u,{ref:l,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:_(og({variant:r,size:n}),s),...c});return a?(typeof a=="string"&&(a={children:a}),o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:p}),o.jsx(Re,{side:"right",align:"center",hidden:f!=="collapsed"||d,...a})]})):p});eo.displayName="SidebarMenuButton";const cc=i.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},a)=>{const s=t?ye:"button";return o.jsx(s,{ref:a,"data-sidebar":"menu-action",className:_("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});cc.displayName="SidebarMenuAction";const lc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:_("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));lc.displayName="SidebarMenuBadge";const dc=i.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const a=i.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return o.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:_("rounded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&o.jsx(U,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),o.jsx(U,{className:"h-4 flex-1 max-w-(--skeleton-width)","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});dc.displayName="SidebarMenuSkeleton";const uc=i.forwardRef(({className:e,...t},r)=>o.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:_("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));uc.displayName="SidebarMenuSub";const fc=i.forwardRef(({...e},t)=>o.jsx("li",{ref:t,...e}));fc.displayName="SidebarMenuSubItem";const pc=i.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...a},s)=>{const c=e?ye:"a";return o.jsx(c,{ref:s,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:_("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...a})});pc.displayName="SidebarMenuSubButton";var to="ToastProvider",[ro,ag,sg]=ln("Toast"),[hc,cv]=Be("Toast",[sg]),[ig,Cr]=hc(to),gc=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:a="right",swipeThreshold:s=50,children:c}=e,[l,u]=i.useState(null),[d,f]=i.useState(0),p=i.useRef(!1),h=i.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${to}\`. Expected non-empty \`string\`.`),o.jsx(ro.Provider,{scope:t,children:o.jsx(ig,{scope:t,label:r,duration:n,swipeDirection:a,swipeThreshold:s,toastCount:d,viewport:l,onViewportChange:u,onToastAdd:i.useCallback(()=>f(m=>m+1),[]),onToastRemove:i.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:h,children:c})})};gc.displayName=to;var vc="ToastViewport",cg=["F8"],no="toast.viewportPause",oo="toast.viewportResume",mc=i.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=cg,label:a="Notifications ({hotkey})",...s}=e,c=Cr(vc,r),l=ag(r),u=i.useRef(null),d=i.useRef(null),f=i.useRef(null),p=i.useRef(null),h=oe(t,p,c.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=c.toastCount>0;i.useEffect(()=>{const w=v=>{var x;n.length!==0&&n.every(N=>v[N]||v.code===N)&&((x=p.current)==null||x.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),i.useEffect(()=>{const w=u.current,v=p.current;if(b&&w&&v){const y=()=>{if(!c.isClosePausedRef.current){const C=new CustomEvent(no);v.dispatchEvent(C),c.isClosePausedRef.current=!0}},x=()=>{if(c.isClosePausedRef.current){const C=new CustomEvent(oo);v.dispatchEvent(C),c.isClosePausedRef.current=!1}},N=C=>{!w.contains(C.relatedTarget)&&x()},E=()=>{w.contains(document.activeElement)||x()};return w.addEventListener("focusin",y),w.addEventListener("focusout",N),w.addEventListener("pointermove",y),w.addEventListener("pointerleave",E),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{w.removeEventListener("focusin",y),w.removeEventListener("focusout",N),w.removeEventListener("pointermove",y),w.removeEventListener("pointerleave",E),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[b,c.isClosePausedRef]);const g=i.useCallback(({tabbingDirection:w})=>{const y=l().map(x=>{const N=x.ref.current,E=[N,...xg(N)];return w==="forwards"?E:E.reverse()});return(w==="forwards"?y.reverse():y).flat()},[l]);return i.useEffect(()=>{const w=p.current;if(w){const v=y=>{var E,C,T;const x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){const $=document.activeElement,O=y.shiftKey;if(y.target===w&&O){(E=d.current)==null||E.focus();return}const F=g({tabbingDirection:O?"backwards":"forwards"}),L=F.findIndex(P=>P===$);io(F.slice(L+1))?y.preventDefault():O?(C=d.current)==null||C.focus():(T=f.current)==null||T.focus()}};return w.addEventListener("keydown",v),()=>w.removeEventListener("keydown",v)}},[l,g]),o.jsxs(Ld,{ref:u,role:"region","aria-label":a.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&o.jsx(ao,{ref:d,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"forwards"});io(w)}}),o.jsx(ro.Slot,{scope:r,children:o.jsx(Z.ol,{tabIndex:-1,...s,ref:h})}),b&&o.jsx(ao,{ref:f,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"backwards"});io(w)}})]})});mc.displayName=vc;var bc="ToastFocusProxy",ao=i.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...a}=e,s=Cr(bc,r);return o.jsx(br,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:c=>{var d;const l=c.relatedTarget;!((d=s.viewport)!=null&&d.contains(l))&&n()}})});ao.displayName=bc;var Sr="Toast",lg="toast.swipeStart",dg="toast.swipeMove",ug="toast.swipeCancel",fg="toast.swipeEnd",wc=i.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:a,onOpenChange:s,...c}=e,[l=!0,u]=st({prop:n,defaultProp:a,onChange:s});return o.jsx(Ne,{present:r||l,children:o.jsx(gg,{open:l,...c,ref:t,onClose:()=>u(!1),onPause:fe(e.onPause),onResume:fe(e.onResume),onSwipeStart:z(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:z(e.onSwipeMove,d=>{const{x:f,y:p}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:z(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:z(e.onSwipeEnd,d=>{const{x:f,y:p}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),u(!1)})})})});wc.displayName=Sr;var[pg,hg]=hc(Sr,{onClose(){}}),gg=i.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:a,open:s,onClose:c,onEscapeKeyDown:l,onPause:u,onResume:d,onSwipeStart:f,onSwipeMove:p,onSwipeCancel:h,onSwipeEnd:m,...b}=e,g=Cr(Sr,r),[w,v]=i.useState(null),y=oe(t,P=>v(P)),x=i.useRef(null),N=i.useRef(null),E=a||g.duration,C=i.useRef(0),T=i.useRef(E),$=i.useRef(0),{onToastAdd:O,onToastRemove:B}=g,K=fe(()=>{var V;(w==null?void 0:w.contains(document.activeElement))&&((V=g.viewport)==null||V.focus()),c()}),F=i.useCallback(P=>{!P||P===1/0||(window.clearTimeout($.current),C.current=new Date().getTime(),$.current=window.setTimeout(K,P))},[K]);i.useEffect(()=>{const P=g.viewport;if(P){const V=()=>{F(T.current),d==null||d()},A=()=>{const X=new Date().getTime()-C.current;T.current=T.current-X,window.clearTimeout($.current),u==null||u()};return P.addEventListener(no,A),P.addEventListener(oo,V),()=>{P.removeEventListener(no,A),P.removeEventListener(oo,V)}}},[g.viewport,E,u,d,F]),i.useEffect(()=>{s&&!g.isClosePausedRef.current&&F(E)},[s,E,g.isClosePausedRef,F]),i.useEffect(()=>(O(),()=>B()),[O,B]);const L=i.useMemo(()=>w?Tc(w):null,[w]);return g.viewport?o.jsxs(o.Fragment,{children:[L&&o.jsx(vg,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),o.jsx(pg,{scope:r,onClose:K,children:_r.createPortal(o.jsx(ro.ItemSlot,{scope:r,children:o.jsx(Od,{asChild:!0,onEscapeKeyDown:z(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||K(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(Z.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":g.swipeDirection,...b,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:z(e.onKeyDown,P=>{P.key==="Escape"&&(l==null||l(P.nativeEvent),P.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,K()))}),onPointerDown:z(e.onPointerDown,P=>{P.button===0&&(x.current={x:P.clientX,y:P.clientY})}),onPointerMove:z(e.onPointerMove,P=>{if(!x.current)return;const V=P.clientX-x.current.x,A=P.clientY-x.current.y,X=!!N.current,D=["left","right"].includes(g.swipeDirection),M=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,Y=D?M(0,V):0,Q=D?0:M(0,A),ee=P.pointerType==="touch"?10:2,te={x:Y,y:Q},ne={originalEvent:P,delta:te};X?(N.current=te,Er(dg,p,ne,{discrete:!1})):Mc(te,g.swipeDirection,ee)?(N.current=te,Er(lg,f,ne,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(V)>ee||Math.abs(A)>ee)&&(x.current=null)}),onPointerUp:z(e.onPointerUp,P=>{const V=N.current,A=P.target;if(A.hasPointerCapture(P.pointerId)&&A.releasePointerCapture(P.pointerId),N.current=null,x.current=null,V){const X=P.currentTarget,D={originalEvent:P,delta:V};Mc(V,g.swipeDirection,g.swipeThreshold)?Er(fg,m,D,{discrete:!0}):Er(ug,h,D,{discrete:!0}),X.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),vg=e=>{const{__scopeToast:t,children:r,...n}=e,a=Cr(Sr,t),[s,c]=i.useState(!1),[l,u]=i.useState(!1);return wg(()=>c(!0)),i.useEffect(()=>{const d=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:o.jsx(Ct,{asChild:!0,children:o.jsx(br,{...n,children:s&&o.jsxs(o.Fragment,{children:[a.label," ",r]})})})},mg="ToastTitle",yc=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return o.jsx(Z.div,{...n,ref:t})});yc.displayName=mg;var bg="ToastDescription",xc=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return o.jsx(Z.div,{...n,ref:t})});xc.displayName=bg;var Nc="ToastAction",Cc=i.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?o.jsx(Ec,{altText:r,asChild:!0,children:o.jsx(so,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Nc}\`. Expected non-empty \`string\`.`),null)});Cc.displayName=Nc;var Sc="ToastClose",so=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,a=hg(Sc,r);return o.jsx(Ec,{asChild:!0,children:o.jsx(Z.button,{type:"button",...n,ref:t,onClick:z(e.onClick,a.onClose)})})});so.displayName=Sc;var Ec=i.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...a}=e;return o.jsx(Z.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...a,ref:t})});function Tc(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),yg(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!a)if(s){const c=n.dataset.radixToastAnnounceAlt;c&&t.push(c)}else t.push(...Tc(n))}}),t}function Er(e,t,r,{discrete:n}){const a=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?Wr(a,s):a.dispatchEvent(s)}var Mc=(e,t,r=0)=>{const n=Math.abs(e.x),a=Math.abs(e.y),s=n>a;return t==="left"||t==="right"?s&&n>r:!s&&a>r};function wg(e=()=>{}){const t=fe(e);We(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function yg(e){return e.nodeType===e.ELEMENT_NODE}function xg(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function io(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Ng=gc,Pc=mc,Ac=wc,_c=yc,Dc=xc,Ic=Cc,kc=so;const Oc=Ng,co=i.forwardRef(({className:e,...t},r)=>o.jsx(Pc,{ref:r,className:_("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));co.displayName=Pc.displayName;const Cg=Lt("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-600 bg-green-600 text-white",warning:"border-yellow-500 bg-yellow-500 text-white",info:"border-blue-500 bg-blue-500 text-white",secondary:"border-secondary bg-secondary text-secondary-foreground",outline:"border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}}),lo=i.forwardRef(({className:e,variant:t,...r},n)=>o.jsx(Ac,{ref:n,className:_(Cg({variant:t}),e),...r}));lo.displayName=Ac.displayName;const Lc=i.forwardRef(({className:e,...t},r)=>o.jsx(Ic,{ref:r,className:_("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:group-[.destructive]:ring-destructive",e),...t}));Lc.displayName=Ic.displayName;const uo=i.forwardRef(({className:e,...t},r)=>o.jsx(kc,{ref:r,className:_("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-50 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600",e),"toast-close":"",...t,children:o.jsx(Ir,{className:"h-4 w-4"})}));uo.displayName=kc.displayName;const fo=i.forwardRef(({className:e,...t},r)=>o.jsx(_c,{ref:r,className:_("text-sm font-semibold [&+div]:text-xs",e),...t}));fo.displayName=_c.displayName;const po=i.forwardRef(({className:e,...t},r)=>o.jsx(Dc,{ref:r,className:_("text-sm opacity-90",e),...t}));po.displayName=Dc.displayName;const Sg=1,Eg=1e6;let ho=0;function Tg(){return ho=(ho+1)%Number.MAX_SAFE_INTEGER,ho.toString()}const go=new Map,Fc=e=>{if(go.has(e))return;const t=setTimeout(()=>{go.delete(e),zt({type:"REMOVE_TOAST",toastId:e})},Eg);go.set(e,t)},Mg=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Sg)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Fc(r):e.toasts.forEach(n=>Fc(n.id)),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return{...e,toasts:t.toastId?e.toasts.filter(r=>r.id!==t.toastId):[]}}},Tr=[];let Mr={toasts:[]};function zt(e){Mr=Mg(Mr,e),Tr.forEach(t=>t(Mr))}function $c({...e}){const t=Tg(),r=a=>zt({type:"UPDATE_TOAST",toast:{...a,id:t}}),n=()=>zt({type:"DISMISS_TOAST",toastId:t});return zt({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||n()}}}),{id:t,dismiss:n,update:r}}function vo(){const[e,t]=i.useState(Mr);return i.useEffect(()=>(Tr.push(t),()=>{const r=Tr.indexOf(t);r>-1&&Tr.splice(r,1)}),[]),{...e,toast:$c,dismiss:r=>zt({type:"DISMISS_TOAST",toastId:r})}}function zc(){const{toasts:e}=vo();return o.jsxs(Oc,{children:[e.map(function({id:t,title:r,description:n,action:a,...s}){return o.jsxs(lo,{...s,children:[o.jsxs("div",{className:"grid gap-1",children:[r&&o.jsx(fo,{children:r}),n&&o.jsx(po,{children:n})]}),a,o.jsx(uo,{})]},t)}),o.jsx(co,{})]})}const mo=H.forwardRef(({onSignOut:e,handleValidSearch:t,rightMenu:r,searchPlaceholder:n},a)=>{const[s,c]=H.useState(""),l=Ar.useLocation(),{toast:u}=vo();H.useEffect(()=>{const h=new URLSearchParams(l.search).get("q");h&&c(h)},[l.search]);const d=()=>{const p=s.trim();if(!p||p.length<2){u({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}t(p)},f=p=>{p.key==="Enter"&&d()};return o.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[o.jsx(qn,{className:"lg:hidden",children:o.jsx(wl,{className:"h-6 w-6"})}),o.jsx("div",{className:"flex flex-1 items-center gap-4",children:o.jsx("div",{className:"relative w-full max-w-sm",children:o.jsxs("div",{children:[o.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:d,"aria-label":"Search",children:o.jsx(El,{className:"h-4 w-4 text-muted-foreground"})}),o.jsx(Nr,{placeholder:n??"Search...",className:"w-full pl-8 bg-white text-black",value:s,onChange:p=>c(p.target.value),onKeyDown:f,ref:a},"topbar-search")]})})}),r||o.jsx(o.Fragment,{}),e&&o.jsx("div",{className:"flex items-center gap-4",children:o.jsxs(ce,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:e,children:[o.jsx(bl,{className:"h-4 w-4 text-sidebar-foreground"}),o.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})});mo.displayName="Topbar";const Bc=Lt("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input hover:bg-accent hover:text-accent-foreground",success:"bg-green-600 text-white hover:bg-green-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",ghost:"bg-background hover:bg-accent hover:text-accent-foreground",randmarRed:"bg-randmar-red text-white hover:bg-randmar-red/80",randmarBlue:"bg-randmar-blue text-white hover:bg-randmar-blue/80",randmarPurple:"bg-randmar-purple text-white hover:bg-randmar-purple/80",randmarGreen:"bg-randmar-green text-black hover:bg-randmar-green/80",randmarBlack:"bg-randmar-black text-white hover:bg-randmar-black/80",randmarYellow:"bg-randmar-yellow text-black hover:bg-randmar-yellow/80"},size:{default:"h-6",sm:"h-5 text-[10px]",lg:"h-7 px-3"}},defaultVariants:{variant:"default",size:"default"}}),Te=i.forwardRef(({className:e,variant:t,size:r,icon:n,children:a,...s},c)=>o.jsxs("div",{ref:c,className:_(Bc({variant:t,size:r}),e),...s,children:[n&&o.jsx("span",{className:"mr-1",children:n}),a]}));Te.displayName="Badge";const wt=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("rounded-md border bg-card text-card-foreground shadow-sm",e),...t}));wt.displayName="Card";const Wc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("flex flex-col space-y-1.5 p-6",e),...t}));Wc.displayName="CardHeader";const Vc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("font-semibold leading-none tracking-tight",e),...t}));Vc.displayName="CardTitle";const Gc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("text-sm text-muted-foreground",e),...t}));Gc.displayName="CardDescription";const yt=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("p-6 pt-0",e),...t}));yt.displayName="CardContent";const Uc=i.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:_("flex items-center p-6 pt-0",e),...t}));Uc.displayName="CardFooter";const jc=({countryCode:e,className:t=""})=>{const[r,n]=H.useState(null),[a,s]=H.useState(!1);return H.useEffect(()=>{if(!e)return;const l=`https://purecatamphetamine.github.io/country-flag-icons/3x2/${e.toUpperCase()}.svg`;fetch(l,{method:"HEAD"}).then(u=>{u.ok?(n(l),s(!1)):s(!0)}).catch(()=>{s(!0)})},[e]),a||!r?o.jsx("span",{className:t,children:e}):o.jsx("img",{src:r,alt:`${e} flag`,className:`inline-block ${t}`,style:{width:"24px",height:"auto"}})};function Hc({routes:e,footer:t,dashboardTitle:r}){const{appID:n}=Ar.useParams(),a=e.filter(s=>s.showInNav);return o.jsxs(Yn,{className:"border-r border-sidebar-border",children:[o.jsx(Xn,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex items-center justify-center",children:o.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),o.jsx("span",{className:"font-semibold text-lg",children:r})]})}),o.jsx(Zn,{className:"py-4 bg-sidebar text-sidebar-foreground",children:o.jsx(Jn,{children:a.map(s=>{const c=s.icon,l=`/${s.path.replace(":appID",n)}`;return o.jsx(Rn,{children:o.jsx(eo,{asChild:!0,children:o.jsxs(Ar.Link,{to:l,className:"transition-colors hover:bg-muted px-6",children:[c&&o.jsx(c,{className:"h-4 w-4"}),o.jsx("span",{children:s.label})]})})},s.key)})})}),o.jsx(Qn,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:t})]})}const Kc=H.forwardRef(({children:e,rightMenu:t,routes:r,footer:n,handleValidSearch:a,dashboardTitle:s,onSignOut:c,searchPlaceholder:l},u)=>o.jsx(o.Fragment,{children:o.jsx(Kn,{children:o.jsxs("div",{className:"flex grow",children:[o.jsx(Hc,{routes:r,footer:n,dashboardTitle:s}),o.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.jsx(mo,{ref:u,onSignOut:c,rightMenu:t,handleValidSearch:a,searchPlaceholder:l}),o.jsx("main",{className:"flex-1 overflow-auto mt-16",children:e}),o.jsx(zc,{})]})]})})}));Kc.displayName="Layout";const Pg={sm:100,md:200,lg:300,xl:400};function Yc({randmarSKU:e,size:t="md",alt:r,secondaryContent:n}){const[a,s]=i.useState(!1),[c,l]=i.useState(!1),[u,d]=i.useState(!1),[f,p]=i.useState(!1),h=`https://api.randmar.io/Product/${e}/Video`;i.useEffect(()=>{(async()=>{try{const x=await(await fetch(h+"/Exists")).json();l(x)}catch(y){console.error("Error checking for video:",y),l(!1)}})()},[e,h]);async function m(){if(c){p(!0);try{const y=await(await fetch(h)).blob(),x=window.URL.createObjectURL(y),N=document.createElement("a");N.href=x,N.download=`${e||"product"}-video.mp4`,document.body.appendChild(N),N.click(),document.body.removeChild(N),window.URL.revokeObjectURL(x)}catch(v){console.error("Error downloading video:",v)}finally{p(!1)}}}function b(){navigator.clipboard.writeText(h),d(!0),setTimeout(()=>{d(!1)},2e3)}function g(){s(!0)}const w=Pg[t||"xl"];return o.jsxs(o.Fragment,{children:[o.jsx(St,{open:a,onOpenChange:s,children:o.jsx(Et,{className:"max-w-4xl p-0 overflow-hidden",children:n?o.jsxs("div",{className:"flex flex-row",children:[o.jsxs("video",{className:"w-full rounded-l-lg max-h-[720px] object-contain",controls:!0,autoPlay:!0,muted:!0,loop:!0,children:[o.jsx("source",{src:h,type:"video/mp4"}),"Your browser does not support the video tag."]}),o.jsx("div",{className:"flex-grow min-w-[400px] h-[70vh] p-6",children:n})]}):o.jsxs("div",{className:"w-full relative",children:[o.jsxs("video",{className:"w-full max-h-[720px] object-contain",controls:!0,autoPlay:!0,children:[o.jsx("source",{src:h,type:"video/mp4"}),"Your browser does not support the video tag."]}),o.jsxs("div",{className:"absolute top-2 right-12 flex gap-1",children:[o.jsx(vt,{children:o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:o.jsx(ce,{variant:"secondary",size:"icon",onClick:b,children:u?o.jsx(Dr,{className:"h-4 w-4"}):o.jsx(gl,{className:"h-4 w-4"})})}),o.jsx(Re,{children:o.jsx("p",{children:"Copy video link"})})]})}),o.jsx(vt,{children:o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:o.jsx(ce,{variant:"secondary",size:"icon",onClick:m,disabled:f,children:o.jsx(vl,{className:"h-4 w-4"})})}),o.jsx(Re,{children:o.jsx("p",{children:"Download video"})})]})})]})]})})}),o.jsxs("div",{className:"relative w-max h-max",children:[o.jsx("img",{alt:r||`Product ${e}`,className:`rounded-md ${c?"cursor-pointer":""}`,onClick:c?g:void 0,src:`https://api.randmar.io/Product/${e}/Image?width=${w*1.5}&height=${w*1.5}`,width:w,height:w}),c&&o.jsx(vt,{children:o.jsxs(mt,{children:[o.jsx(bt,{asChild:!0,children:o.jsx(ce,{variant:"secondary",size:"icon",className:"absolute top-2 right-2",onClick:g,children:o.jsx(Nl,{className:"h-4 w-4"})})}),o.jsx(Re,{children:o.jsx("p",{children:"Play video"})})]})})]})]})}function Ag({item:e,addToCart:t=!1,syncToShopify:r=!1,customAction:n=o.jsx(o.Fragment,{}),defaultOpportunityNumber:a="",viewProductAction:s,addToCartAction:c,isAddToCartActionLoading:l=!1,syncToShopifyAction:u,isSyncToShopifyActionLoading:d=!1}){var M,Y,Q,ee,te,ne,se,le,ae,Me,de,Pe;const[f,p]=H.useState(1),[h,m]=H.useState(null),[b,g]=H.useState(0),[w,v]=H.useState(!1),y=((M=e==null?void 0:e.Distribution)==null?void 0:M.Cost)||0,x=((Y=e==null?void 0:e.Distribution)==null?void 0:Y.RegularPrice)||0,N=((Q=e==null?void 0:e.Distribution)==null?void 0:Q.Price)||0,[E,C]=H.useState(null),[T,$]=H.useState(!1);H.useEffect(()=>{const G=async()=>{if(e!=null&&e.ManufacturerId){$(!0);try{const J=await fetch(`https://api.randmar.io/V4/Partner/${e.ManufacturerId}/Account/Logo?width=60&height=40`);if(J.ok){const he=await J.blob();C(URL.createObjectURL(he))}}catch(J){console.error("Failed to load logo:",J)}finally{$(!1)}}};e!=null&&e.ManufacturerId&&G()},[e==null?void 0:e.ManufacturerId]),H.useEffect(()=>{var G;if(e&&a){const J=(G=e.Opportunities)==null?void 0:G.find(he=>he.BidNumber==a);J&&m(J)}},[e,a]),H.useEffect(()=>{if(!e)return;const G=h!=null&&h.Price?h.Price:N;g(x>0?Math.round((x-G)/x*100):0)},[e,h,N,x]),H.useEffect(()=>{l||p(1)},[l]);const O=G=>{if(G.Active!==!0)return!1;const J=new Date().toISOString().split("T")[0];return!(G.EndDate&&G.EndDate<J||G.StartDate&&G.StartDate>J)};if(!e)return o.jsx(wt,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(yt,{className:"p-6",children:[o.jsxs("div",{className:"flex justify-between items-start mb-3",children:[o.jsx(U,{className:"h-7 w-3/4"}),o.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:o.jsx(U,{className:"h-10 w-24 rounded-md"})})]}),o.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[o.jsx(U,{className:"h-6 w-20 rounded-full"}),o.jsx(U,{className:"h-6 w-24 rounded-full"}),o.jsx(U,{className:"h-6 w-28 rounded-full"})]}),o.jsxs("div",{className:"flex gap-6",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[o.jsxs("div",{children:[o.jsx(U,{className:"h-4 w-12 mb-1"}),o.jsx(U,{className:"h-5 w-20"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-4 w-12 mb-1"}),o.jsx(U,{className:"h-5 w-24"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-4 w-20 mb-1"}),o.jsx(U,{className:"h-5 w-16"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-4 w-12 mb-1"}),o.jsx(U,{className:"h-5 w-20"})]})]}),o.jsx("div",{className:"flex flex-col",children:o.jsx("div",{className:"w-60 h-40",children:o.jsx(U,{className:"w-full h-full rounded-lg"})})})]}),o.jsxs("div",{className:"flex gap-6 mt-4",children:[o.jsx("div",{className:"flex flex-1",children:o.jsxs("div",{className:"w-full",children:[o.jsx(U,{className:"h-4 w-24 mb-3"}),o.jsx(U,{className:"h-16 w-full rounded-md"})]})}),o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx(U,{className:"h-10 w-32 rounded-md"}),o.jsx(U,{className:"h-5 w-24 mt-4"})]})]}),o.jsxs("div",{className:"flex gap-6 mt-4",children:[o.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[o.jsx(U,{className:"h-8 w-32"}),o.jsx(U,{className:"h-6 w-24"})]}),o.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[o.jsx(U,{className:"h-10 w-24 rounded-md"}),o.jsx(U,{className:"h-10 flex-1 rounded-md"})]})]})]})});const B=(e==null?void 0:e.Opportunities)||[],K=B.length>0,F=()=>{if(f==null){p(1);return}f>1&&p(f-1)},L=()=>{if(f==null){p(1);return}p(f+1)},P=G=>{const J=parseInt(G.target.value,10);if(!isNaN(J)&&J>0){p(J);return}p(void 0)},V=()=>{(f==null||f<1)&&p(1)},A=((te=(ee=e.Distribution)==null?void 0:ee.Inventory)==null?void 0:te.reduce((G,J)=>G+(J.AvailableQuantity||0),0))||0,X=G=>{try{return new Date(G).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(J){return console.error(J),G.split("T")[0]||"N/A"}},D=()=>{c&&c({quantity:f??1,bidNumber:(h==null?void 0:h.BidNumber)??null})};return o.jsx(wt,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(yt,{className:"p-6",children:[o.jsxs("div",{className:"flex justify-between items-start mb-3",children:[o.jsx("h3",{className:"font-semibold text-xl",children:e.Title||e.RandmarTitle}),o.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:T?o.jsx(U,{className:"h-10 w-24 rounded-md"}):E&&o.jsx("img",{src:E||"/placeholder.svg",alt:e.ManufacturerName??"",className:"max-h-10 max-w-24 object-contain"})})]}),o.jsxs("div",{className:"flex gap-6",children:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.State&&o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.State==="Active"?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Dr,{size:"12",className:"mr-1.5"})," ",e.State]}),o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.SerialNumber?"bg-green-50 text-green-700 hover:bg-green-50":"bg-yellow-50 text-yellow-700 hover:bg-yellow-50"}`,children:[o.jsx(Cl,{size:"12",className:"mr-1.5"})," ",e.SerialNumber?"Serialized":"Unserialized"]}),e.TransparencyCode&&o.jsxs(Te,{variant:"outline",className:"rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50",children:[o.jsx(pl,{size:"12",className:"mr-1.5"})," Transparency Code"]}),e.AvailableToBuy===void 0?o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${(ne=e.ManufacturerCategory)!=null&&ne.QualificationRequired?"bg-blue-50 text-blue-700 hover:bg-blue-50":"bg-neutral-50 text-neutral-700 hover:bg-neutral-50"}`,children:[o.jsx(Ao,{size:"12",className:"mr-1.5"})," ",(se=e.ManufacturerCategory)!=null&&se.QualificationRequired?"Qualification Enforced":"No Qualification Needed"]}):o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.AvailableToBuy?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Ao,{size:"12",className:"mr-1.5"})," ",(le=e.ManufacturerCategory)!=null&&le.QualificationRequired?e.AvailableToBuy?"Qualified":"Not Qualified":"No Qualification Required"]}),e.ManufacturerId&&o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.AutoUpdate?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Sl,{size:"12",className:"mr-1.5"})," ",e.AutoUpdate?`Automatic Reorder (${e.MasterCarton})`:"Manually Reorders"]}),o.jsxs(Te,{variant:"outline",className:`rounded-full px-3 ${e.BodyHTML&&e.Title&&e.MAP?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[o.jsx(Tl,{size:"12",className:"mr-1.5"})," ",e.BodyHTML&&e.Title&&e.MAP?"Shopify Ready":"Not Shopify Ready"]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 flex-1",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),o.jsx("div",{className:"font-medium",children:e.MPN||"N/A"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),o.jsx("div",{className:"font-medium",children:e.UPC||"N/A"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),o.jsx("div",{className:"font-medium",children:e.UnitWeight?`${e.UnitWeight} lbs`:"N/A"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"MAP"}),o.jsx("div",{className:"font-medium",children:e.MAP?"$"+e.MAP.toFixed(2):"N/A"})]}),e.CountryCodeOfOrigin&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Origin"}),o.jsxs("div",{className:"font-medium flex items-center",children:[o.jsx(jc,{countryCode:e.CountryCodeOfOrigin,className:"mr-2"}),e.CountryCodeOfOrigin]})]})]})]}),o.jsx("div",{className:"flex flex-col",children:o.jsx(Yc,{randmarSKU:e.RandmarSKU||"",alt:e.RandmarTitle||""})})]}),o.jsxs("div",{className:"flex gap-6 mt-4",children:[o.jsx("div",{className:"flex flex-1",children:K&&e.Distribution&&o.jsxs("div",{className:"w-full",children:[o.jsx("div",{className:"flex items-center",children:"You have "+B.length+(B.length>1?" opportunities":" opportunity")+" for this product:"}),o.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1",children:B.map((G,J)=>{var he;return o.jsxs("div",{className:`flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted
|
|
195
195
|
${G.BidNumber==(h==null?void 0:h.BidNumber)?"cursor-pointer border-2 border-purple-900":O(G)?"hover:bg-purple-200 cursor-pointer":"!bg-neutral-50"}
|
|
196
196
|
`,onClick:()=>{O(G)&&m(G.BidNumber!=(h==null?void 0:h.BidNumber)?G:null)},children:[o.jsx("div",{className:"flex items-center",children:o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"font-medium text-sm",children:G.Opportunity}),o.jsxs("span",{className:"text-xs text-neutral-900",children:[G.BidNumber," ",!O(G)&&o.jsx(Te,{variant:"outline",className:"text-xs mx-1 h-5 bg-gray-100",children:"Currently unavailable"})]})]})}),o.jsxs("div",{className:"flex flex-col items-end",children:[o.jsxs("span",{className:"font-semibold",children:["$",(he=G.Price)==null?void 0:he.toFixed(2)]}),G.Rebate&&G.Rebate>0&&o.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: $",G.Rebate.toFixed(2)]}),G.EndDate&&o.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",X(G.EndDate)]})]})]},J)})})]})}),o.jsxs("div",{className:"flex flex-col items-center",children:[s&&o.jsxs(ce,{variant:"secondary",onClick:s,children:[o.jsx(ml,{className:"mr-2"}),"View Product"]}),((ae=e.Distribution)==null?void 0:ae.Inventory)&&o.jsx("div",{className:"mt-4",children:o.jsxs(St,{open:w,onOpenChange:v,children:[o.jsx(nn,{asChild:!0,children:o.jsxs(ce,{variant:"ghost",className:`flex items-center text-sm ${A>0?"text-green-700":"text-red-700"}`,children:[o.jsx(Do,{size:"16",className:"mr-2"}),A>0?o.jsxs(o.Fragment,{children:[A," in stock"]}):o.jsx(o.Fragment,{children:"Out of stock"})]})}),o.jsxs(Et,{className:"max-w-4xl",children:[o.jsx(rr,{children:o.jsxs(nr,{className:"flex items-center",children:[o.jsx(Do,{className:"mr-2",size:18}),"Inventory Information"]})}),o.jsx(_i,{inventory:e.Distribution.Inventory})]})]})})]})]}),e.Distribution&&o.jsxs("div",{className:"flex justify-between items-end mt-4",children:[o.jsx("div",{className:"flex-shrink-1 flex flex-col items-start gap-1",children:y>0?o.jsx("div",{className:"flex items-center",children:o.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:[o.jsx("span",{children:"Cost: $"}),y.toFixed(2),o.jsx("span",{children:" CAD"})]})}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center flex-wrap",children:[o.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:[o.jsx("span",{children:"$"}),h?(de=(Me=e.Opportunities)==null?void 0:Me.find(G=>G.BidNumber==h.BidNumber))==null?void 0:de.Price:N.toFixed(2),o.jsx("span",{children:" CAD"})]}),b>0&&o.jsxs("span",{className:"text-muted-foreground line-through ml-2 whitespace-nowrap",children:["$",x.toFixed(2)]})]}),b>0&&o.jsx("div",{className:"flex items-center",children:o.jsxs(Te,{variant:"outline",className:"bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap",children:[o.jsxs("span",{children:[b,"% OFF"]}),((Pe=e.InstantRebate)==null?void 0:Pe.EndDate)&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",e.InstantRebate.EndDate.split("T")[0]]}),(h==null?void 0:h.EndDate)&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",h.EndDate.split("T")[0]]})]})})]})}),o.jsxs("div",{className:"flex flex-shrink-0 gap-2 ml-4",children:[typeof t<"u"&&t&&o.jsxs("div",{className:"flex items-center border rounded-md",children:[o.jsx(ce,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:F,disabled:typeof f<"u"&&(f<=1||!e.AvailableToBuy||l||!c),children:"-"}),o.jsx("input",{value:f,onChange:P,onBlur:V,onClick:G=>G.currentTarget.select(),className:`w-12 text-center border-0 focus:ring-0 focus:outline-none ${!e.AvailableToBuy||l||!c?"text-gray-400":""}`,disabled:!e.AvailableToBuy||l||!c}),o.jsx(ce,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:L,disabled:!e.AvailableToBuy||l||!c,children:"+"})]}),typeof t<"u"&&t&&o.jsx(ce,{className:"gap-2 whitespace-nowrap",onClick:D,disabled:!e.AvailableToBuy||l||!c,children:l?o.jsxs(o.Fragment,{children:[o.jsx(Po,{className:"h-4 w-4 animate-spin"}),"Adding..."]}):o.jsxs(o.Fragment,{children:[o.jsx(_o,{className:"mr-2"}),"Add to Cart"]})}),r&&o.jsx(ce,{className:"gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",onClick:u,disabled:d||!u,children:d?o.jsxs(o.Fragment,{children:[o.jsx(Po,{className:"h-4 w-4 animate-spin"}),"Syncing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(_o,{className:"mr-2"}),"Sync to Shopify"]})}),n]})]})]})})}function _g({id:e,name:t,about:r,voiceName:n,voiceStyle:a,sceneName:s,action:c,loading:l=!1}){const u=`https://api.randmar.io/V4/Partner/${e}/Account/Video`,d=`https://api.randmar.io/V4/Partner/${e}/Account/Video/Exists`,f=`https://api.randmar.io/V4/Partner/${e}/Account/Logo?width=64&height=64`,p=`https://api.randmar.io/V4/Partner/${e}/Account/Logo/Exists`,h=!!(n||a||s),[m,b]=H.useState(null),[g,w]=H.useState(!1),[v,y]=H.useState(!1),[x,N]=H.useState(!1),[E,C]=H.useState(!0);H.useEffect(()=>{if(!e||l)return;const $=async()=>{try{const F=await fetch(p);if(F.ok){const P=(await F.text()).toLowerCase()==="true";return y(P),P}return!1}catch(F){return console.error("Failed to check if logo exists:",F),y(!1),!1}},O=async()=>{w(!0);try{const F=await fetch(f);if(F.ok){const L=await F.blob();b(URL.createObjectURL(L))}}catch(F){console.error("Failed to load logo:",F)}finally{w(!1)}},B=async()=>{try{const F=await fetch(d);if(F.ok){const L=await F.text();N(L.toLowerCase()==="true")}}catch(F){console.error("Failed to check if video exists:",F),N(!1)}};(async()=>{await $()&&O(),B()})()},[e,f,p,d,l]);const T=()=>{C(!1)};return l?o.jsx(wt,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(yt,{className:"p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start gap-4 mb-4",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx("div",{className:"h-10 flex items-center justify-center mr-4",children:o.jsx(U,{className:"h-10 w-10 rounded-md"})}),o.jsx(U,{className:"h-7 w-40"})]}),o.jsx("div",{className:"w-full sm:w-auto",children:o.jsx(U,{className:"h-9 w-24"})})]}),o.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[o.jsxs("div",{className:"flex-1 flex flex-col order-1 md:order-1",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(U,{className:"h-4 w-full"}),o.jsx(U,{className:"h-4 w-full"}),o.jsx(U,{className:"h-4 w-3/4"}),o.jsx(U,{className:"h-4 w-5/6"})]}),o.jsx("div",{className:"mt-4 p-3 bg-slate-50 rounded-md",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[o.jsxs("div",{children:[o.jsx(U,{className:"h-3 w-20 mb-1"}),o.jsx(U,{className:"h-5 w-24"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-3 w-20 mb-1"}),o.jsx(U,{className:"h-5 w-24"})]}),o.jsxs("div",{children:[o.jsx(U,{className:"h-3 w-20 mb-1"}),o.jsx(U,{className:"h-5 w-24"})]})]})})]}),o.jsx("div",{className:"flex flex-col order-1 md:order-1 md:w-auto",children:o.jsx("div",{className:"w-[180px] h-[320px] rounded-md overflow-hidden",children:o.jsx(U,{className:"w-full h-full"})})})]})]})}):o.jsx(wt,{className:"hover:shadow-lg transition-shadow",children:o.jsxs(yt,{className:"p-6",children:[o.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start gap-4 mb-4",children:[o.jsxs("div",{className:"flex items-center",children:[v&&o.jsx("div",{className:"h-10 flex items-center justify-center mr-4",children:g?o.jsx(U,{className:"h-10 w-10 rounded-md"}):m&&o.jsx("img",{src:m||"/placeholder.svg",alt:`${t} logo`,className:"max-h-10 w-auto object-contain"})}),o.jsx("h3",{className:"font-semibold text-xl",children:t})]}),c&&o.jsx("div",{className:"w-full sm:w-auto",children:c})]}),o.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[o.jsxs("div",{className:"flex-1 flex flex-col order-1 md:order-1",children:[o.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:r}}),h&&o.jsx("div",{className:"mt-4 p-3 bg-slate-50 rounded-md",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[n&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Voice Name"}),o.jsx("div",{className:"font-medium",children:n})]}),a&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Voice Style"}),o.jsx("div",{className:"font-medium",children:a})]}),s&&o.jsxs("div",{children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Scene Name"}),o.jsx("div",{className:"font-medium",children:s})]})]})})]}),x&&o.jsx("div",{className:"flex flex-col order-1 md:order-1 md:w-auto",children:o.jsxs("div",{className:"w-[180px] h-[320px] rounded-md overflow-hidden",children:[E&&o.jsx(U,{className:"w-full h-full"}),o.jsx("video",{src:u,controls:!0,preload:"auto",playsInline:!0,className:`w-full h-full object-contain ${E?"invisible":"visible"}`,style:{objectPosition:"center",imageRendering:"auto"},onLoadedData:T,onError:()=>C(!1)})]})})]})]})})}S.AvatarFooter=qh,S.Badge=Te,S.Button=ce,S.Card=wt,S.CardContent=yt,S.CardDescription=Gc,S.CardFooter=Uc,S.CardHeader=Wc,S.CardTitle=Vc,S.CountryFlag=jc,S.Dialog=St,S.DialogClose=on,S.DialogContent=Et,S.DialogDescription=cn,S.DialogFooter=sn,S.DialogHeader=rr,S.DialogOverlay=an,S.DialogPortal=$a,S.DialogTitle=nr,S.DialogTrigger=nn,S.DropdownMenu=gh,S.DropdownMenuCheckboxItem=Ei,S.DropdownMenuContent=Ci,S.DropdownMenuGroup=mh,S.DropdownMenuItem=Si,S.DropdownMenuLabel=Mi,S.DropdownMenuPortal=bh,S.DropdownMenuRadioGroup=yh,S.DropdownMenuRadioItem=Ti,S.DropdownMenuSeparator=Pi,S.DropdownMenuShortcut=Ai,S.DropdownMenuSub=wh,S.DropdownMenuSubContent=Ni,S.DropdownMenuSubTrigger=xi,S.DropdownMenuTrigger=vh,S.Input=Nr,S.InputOTP=hd,S.InputOTPGroup=gd,S.InputOTPSeparator=md,S.InputOTPSlot=vd,S.Label=Zh,S.Layout=Kc,S.Navbar=Hc,S.PartnerCard=_g,S.ProductCard=Ag,S.ProductImage=Yc,S.ProductInventoryGrid=_i,S.Separator=Gn,S.Sheet=Hi,S.SheetClose=Kh,S.SheetContent=jn,S.SheetDescription=Qi,S.SheetFooter=qi,S.SheetHeader=Yi,S.SheetOverlay=Un,S.SheetPortal=Ki,S.SheetTitle=Xi,S.SheetTrigger=Hh,S.Sidebar=Yn,S.SidebarContent=Zn,S.SidebarFooter=Qn,S.SidebarGroup=oc,S.SidebarGroupAction=sc,S.SidebarGroupContent=ic,S.SidebarGroupLabel=ac,S.SidebarHeader=Xn,S.SidebarInput=rc,S.SidebarInset=tc,S.SidebarMenu=Jn,S.SidebarMenuAction=cc,S.SidebarMenuBadge=lc,S.SidebarMenuButton=eo,S.SidebarMenuItem=Rn,S.SidebarMenuSkeleton=dc,S.SidebarMenuSub=uc,S.SidebarMenuSubButton=pc,S.SidebarMenuSubItem=fc,S.SidebarProvider=Kn,S.SidebarRail=ec,S.SidebarSeparator=nc,S.SidebarTrigger=qn,S.Skeleton=U,S.Toast=lo,S.ToastAction=Lc,S.ToastClose=uo,S.ToastDescription=po,S.ToastProvider=Oc,S.ToastTitle=fo,S.ToastViewport=co,S.Toaster=zc,S.Tooltip=mt,S.TooltipContent=Re,S.TooltipProvider=vt,S.TooltipTrigger=bt,S.Topbar=mo,S.badgeVariants=Bc,S.buttonVariants=$n,S.toast=$c,S.useIsMobile=Ji,S.useSidebar=$t,S.useToast=vo,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "randmarcomps",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.85.0",
|
|
5
5
|
"description": "The UI library enabling speed and consistency in Randmar frontends.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"clsx": "^2.1.1",
|
|
83
83
|
"input-otp": "^1.4.2",
|
|
84
84
|
"lucide-react": "^0.479.0",
|
|
85
|
+
"randmar-api-client": "^1.5.0",
|
|
85
86
|
"tailwind-merge": "^3.0.2"
|
|
86
87
|
},
|
|
87
88
|
"eslintConfig": {
|