randmarcomps 1.71.0 → 1.72.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.js
CHANGED
|
@@ -8495,7 +8495,7 @@ function Zf({
|
|
|
8495
8495
|
]
|
|
8496
8496
|
}
|
|
8497
8497
|
) }),
|
|
8498
|
-
/* @__PURE__ */ x(Jt, { className: "
|
|
8498
|
+
/* @__PURE__ */ x(Jt, { className: "max-w-4xl", children: [
|
|
8499
8499
|
/* @__PURE__ */ i(Jn, { children: /* @__PURE__ */ x(er, { className: "flex items-center", children: [
|
|
8500
8500
|
/* @__PURE__ */ i(xr, { className: "mr-2", size: 18 }),
|
|
8501
8501
|
"Inventory Information"
|
|
@@ -183,4 +183,4 @@ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHid
|
|
|
183
183
|
|
|
184
184
|
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},jc="DialogDescriptionWarning",Hc=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ta(jc).contentName}}.`;return l.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},$r=Vo,ra=Ho,na=Go,Lt=Ko,$t=qo,Ft=Xo,zt=Zo,Bt=Ro;const dt=({modal:e=!1,...t})=>a.jsx($r,{modal:e,...t});dt.displayName=$r.displayName;const Fr=ra,oa=na,zr=Bt,Br=l.forwardRef(({className:e,...t},r)=>a.jsx(Lt,{ref:r,className:O("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}));Br.displayName=Lt.displayName;const ut=l.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(oa,{children:[a.jsx(Br,{}),a.jsxs($t,{ref:n,className:O("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,a.jsxs(Bt,{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:[a.jsx(hr,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ut.displayName=$t.displayName;const Wt=({className:e,...t})=>a.jsx("div",{className:O("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Wt.displayName="DialogHeader";const Wr=({className:e,...t})=>a.jsx("div",{className:O("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Wr.displayName="DialogFooter";const Vt=l.forwardRef(({className:e,...t},r)=>a.jsx(Ft,{ref:r,className:O("text-lg font-semibold leading-none tracking-tight",e),...t}));Vt.displayName=Ft.displayName;const Vr=l.forwardRef(({className:e,...t},r)=>a.jsx(zt,{ref:r,className:O("text-sm text-muted-foreground",e),...t}));Vr.displayName=zt.displayName;const aa=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,sa=Zn,ft=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return sa(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(d=>{const p=r==null?void 0:r[d],h=s==null?void 0:s[d];if(p===null)return null;const m=aa(p)||aa(h);return o[d][m]}),c=r&&Object.entries(r).reduce((d,p)=>{let[h,m]=p;return m===void 0||(d[h]=m),d},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,p)=>{let{class:h,className:m,...v}=p;return Object.entries(v).every(y=>{let[f,g]=y;return Array.isArray(g)?g.includes({...s,...c}[f]):{...s,...c}[f]===g})?[...d,h,m]:d},[]);return sa(e,i,u,r==null?void 0:r.class,r==null?void 0:r.className)},jr=ft("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"}}),oe=l.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,confirmationDialog:o,onClick:s,...i},c)=>{const u=n?ge:"button";if(!o)return a.jsx(u,{className:O(jr({variant:t,size:r,className:e})),ref:c,onClick:s,...i});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:p,onConfirm:h,confirmText:m="Confirm",cancelText:v="Cancel"}=o,y=()=>{h()};return a.jsxs(dt,{children:[a.jsx(Fr,{asChild:!0,children:a.jsx(u,{className:O(jr({variant:t,size:r,className:e})),ref:c,...i})}),a.jsxs(ut,{children:[a.jsxs(Wt,{children:[a.jsx(Vt,{children:d}),a.jsx(Vr,{children:p})]}),a.jsxs(Wr,{className:"flex justify-end gap-2 pt-4",children:[a.jsx(zr,{asChild:!0,children:a.jsx(oe,{variant:"outline",children:v})}),a.jsx(zr,{asChild:!0,children:a.jsx(oe,{onClick:y,children:m})})]})]})]})});oe.displayName="Button";const Uc=["top","right","bottom","left"],Oe=Math.min,ue=Math.max,jt=Math.round,Ht=Math.floor,xe=e=>({x:e,y:e}),Gc={left:"right",right:"left",bottom:"top",top:"bottom"},Kc={start:"end",end:"start"};function Hr(e,t,r){return ue(e,Oe(t,r))}function Ee(e,t){return typeof e=="function"?e(t):e}function Te(e){return e.split("-")[0]}function Re(e){return e.split("-")[1]}function Ur(e){return e==="x"?"y":"x"}function Gr(e){return e==="y"?"height":"width"}function De(e){return["top","bottom"].includes(Te(e))?"y":"x"}function Kr(e){return Ur(De(e))}function qc(e,t,r){r===void 0&&(r=!1);const n=Re(e),o=Kr(e),s=Gr(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Ut(i)),[i,Ut(i)]}function Yc(e){const t=Ut(e);return[qr(e),t,qr(t)]}function qr(e){return e.replace(/start|end/g,t=>Kc[t])}function Xc(e,t,r){const n=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?s:i;default:return[]}}function Qc(e,t,r,n){const o=Re(e);let s=Xc(Te(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(qr)))),s}function Ut(e){return e.replace(/left|right|bottom|top/g,t=>Gc[t])}function Zc(e){return{top:0,right:0,bottom:0,left:0,...e}}function ia(e){return typeof e!="number"?Zc(e):{top:e,right:e,bottom:e,left:e}}function Gt(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function la(e,t,r){let{reference:n,floating:o}=e;const s=De(t),i=Kr(t),c=Gr(i),u=Te(t),d=s==="y",p=n.x+n.width/2-o.width/2,h=n.y+n.height/2-o.height/2,m=n[c]/2-o[c]/2;let v;switch(u){case"top":v={x:p,y:n.y-o.height};break;case"bottom":v={x:p,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:h};break;case"left":v={x:n.x-o.width,y:h};break;default:v={x:n.x,y:n.y}}switch(Re(t)){case"start":v[i]-=m*(r&&d?-1:1);break;case"end":v[i]+=m*(r&&d?-1:1);break}return v}const Jc=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,c=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:h}=la(d,n,u),m=n,v={},y=0;for(let f=0;f<c.length;f++){const{name:g,fn:b}=c[f],{x:w,y:x,data:N,reset:S}=await b({x:p,y:h,initialPlacement:n,placement:m,strategy:o,middlewareData:v,rects:d,platform:i,elements:{reference:e,floating:t}});p=w??p,h=x??h,v={...v,[g]:{...v[g],...N}},S&&y<=50&&(y++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(d=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:p,y:h}=la(d,m,u)),f=-1)}return{x:p,y:h,placement:m,strategy:o,middlewareData:v}};async function pt(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:m=!1,padding:v=0}=Ee(t,e),y=ia(v),g=c[m?h==="floating"?"reference":"floating":h],b=Gt(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(g)))==null||r?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:p,strategy:u})),w=h==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.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},S=Gt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:x,strategy:u}):w);return{top:(b.top-S.top+y.top)/N.y,bottom:(S.bottom-b.bottom+y.bottom)/N.y,left:(b.left-S.left+y.left)/N.x,right:(S.right-b.right+y.right)/N.x}}const Rc=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:c,middlewareData:u}=t,{element:d,padding:p=0}=Ee(e,t)||{};if(d==null)return{};const h=ia(p),m={x:r,y:n},v=Kr(o),y=Gr(v),f=await i.getDimensions(d),g=v==="y",b=g?"top":"left",w=g?"bottom":"right",x=g?"clientHeight":"clientWidth",N=s.reference[y]+s.reference[v]-m[v]-s.floating[y],S=m[v]-s.reference[v],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let T=C?C[x]:0;(!T||!await(i.isElement==null?void 0:i.isElement(C)))&&(T=c.floating[x]||s.floating[y]);const B=N/2-S/2,I=T/2-f[y]/2-1,W=Oe(h[b],I),G=Oe(h[w],I),V=W,_=T-f[y]-G,P=T/2-f[y]/2+B,j=Hr(V,P,_),k=!u.arrow&&Re(o)!=null&&P!==j&&s.reference[y]/2-(P<V?W:G)-f[y]/2<0,U=k?P<V?P-V:P-_:0;return{[v]:m[v]+U,data:{[v]:j,centerOffset:P-j-U,...k&&{alignmentOffset:U}},reset:k}}}),ed=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:f=!0,...g}=Ee(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const b=Te(o),w=De(c),x=Te(c)===c,N=await(u.isRTL==null?void 0:u.isRTL(d.floating)),S=m||(x||!f?[Ut(c)]:Yc(c)),C=y!=="none";!m&&C&&S.push(...Qc(c,f,y,N));const T=[c,...S],B=await pt(t,g),I=[];let W=((n=s.flip)==null?void 0:n.overflows)||[];if(p&&I.push(B[b]),h){const P=qc(o,i,N);I.push(B[P[0]],B[P[1]])}if(W=[...W,{placement:o,overflows:I}],!I.every(P=>P<=0)){var G,V;const P=(((G=s.flip)==null?void 0:G.index)||0)+1,j=T[P];if(j)return{data:{index:P,overflows:W},reset:{placement:j}};let k=(V=W.filter(U=>U.overflows[0]<=0).sort((U,D)=>U.overflows[1]-D.overflows[1])[0])==null?void 0:V.placement;if(!k)switch(v){case"bestFit":{var _;const U=(_=W.filter(D=>{if(C){const F=De(D.placement);return F===w||F==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(F=>F>0).reduce((F,Z)=>F+Z,0)]).sort((D,F)=>D[1]-F[1])[0])==null?void 0:_[0];U&&(k=U);break}case"initialPlacement":k=c;break}if(o!==k)return{reset:{placement:k}}}return{}}}};function ca(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function da(e){return Uc.some(t=>e[t]>=0)}const td=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Ee(e,t);switch(n){case"referenceHidden":{const s=await pt(t,{...o,elementContext:"reference"}),i=ca(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:da(i)}}}case"escaped":{const s=await pt(t,{...o,altBoundary:!0}),i=ca(s,r.floating);return{data:{escapedOffsets:i,escaped:da(i)}}}default:return{}}}}};async function rd(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Te(r),c=Re(r),u=De(r)==="y",d=["left","top"].includes(i)?-1:1,p=s&&u?-1:1,h=Ee(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof y=="number"&&(v=c==="end"?y*-1:y),u?{x:v*p,y:m*d}:{x:m*d,y:v*p}}const nd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:i,middlewareData:c}=t,u=await rd(t,e);return i===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},od=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:g=>{let{x:b,y:w}=g;return{x:b,y:w}}},...u}=Ee(e,t),d={x:r,y:n},p=await pt(t,u),h=De(Te(o)),m=Ur(h);let v=d[m],y=d[h];if(s){const g=m==="y"?"top":"left",b=m==="y"?"bottom":"right",w=v+p[g],x=v-p[b];v=Hr(w,v,x)}if(i){const g=h==="y"?"top":"left",b=h==="y"?"bottom":"right",w=y+p[g],x=y-p[b];y=Hr(w,y,x)}const f=c.fn({...t,[m]:v,[h]:y});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:s,[h]:i}}}}}},ad=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Ee(e,t),p={x:r,y:n},h=De(o),m=Ur(h);let v=p[m],y=p[h];const f=Ee(c,t),g=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(u){const x=m==="y"?"height":"width",N=s.reference[m]-s.floating[x]+g.mainAxis,S=s.reference[m]+s.reference[x]-g.mainAxis;v<N?v=N:v>S&&(v=S)}if(d){var b,w;const x=m==="y"?"width":"height",N=["top","left"].includes(Te(o)),S=s.reference[h]-s.floating[x]+(N&&((b=i.offset)==null?void 0:b[h])||0)+(N?0:g.crossAxis),C=s.reference[h]+s.reference[x]+(N?0:((w=i.offset)==null?void 0:w[h])||0)-(N?g.crossAxis:0);y<S?y=S:y>C&&(y=C)}return{[m]:v,[h]:y}}}},sd=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:u=()=>{},...d}=Ee(e,t),p=await pt(t,d),h=Te(o),m=Re(o),v=De(o)==="y",{width:y,height:f}=s.floating;let g,b;h==="top"||h==="bottom"?(g=h,b=m===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(b=h,g=m==="end"?"top":"bottom");const w=f-p.top-p.bottom,x=y-p.left-p.right,N=Oe(f-p[g],w),S=Oe(y-p[b],x),C=!t.middlewareData.shift;let T=N,B=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(B=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=w),C&&!m){const W=ue(p.left,0),G=ue(p.right,0),V=ue(p.top,0),_=ue(p.bottom,0);v?B=y-2*(W!==0||G!==0?W+G:ue(p.left,p.right)):T=f-2*(V!==0||_!==0?V+_:ue(p.top,p.bottom))}await u({...t,availableWidth:B,availableHeight:T});const I=await i.getDimensions(c.floating);return y!==I.width||f!==I.height?{reset:{rects:!0}}:{}}}};function Kt(){return typeof window<"u"}function et(e){return ua(e)?(e.nodeName||"").toLowerCase():"#document"}function fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ne(e){var t;return(t=(ua(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ua(e){return Kt()?e instanceof Node||e instanceof fe(e).Node:!1}function me(e){return Kt()?e instanceof Element||e instanceof fe(e).Element:!1}function Ce(e){return Kt()?e instanceof HTMLElement||e instanceof fe(e).HTMLElement:!1}function fa(e){return!Kt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fe(e).ShadowRoot}function ht(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=be(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function id(e){return["table","td","th"].includes(et(e))}function qt(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Yr(e){const t=Xr(),r=me(e)?be(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 ld(e){let t=_e(e);for(;Ce(t)&&!tt(t);){if(Yr(t))return t;if(qt(t))return null;t=_e(t)}return null}function Xr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function tt(e){return["html","body","#document"].includes(et(e))}function be(e){return fe(e).getComputedStyle(e)}function Yt(e){return me(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _e(e){if(et(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fa(e)&&e.host||Ne(e);return fa(t)?t.host:t}function pa(e){const t=_e(e);return tt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ce(t)&&ht(t)?t:pa(t)}function gt(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=pa(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=fe(o);if(s){const c=Qr(i);return t.concat(i,i.visualViewport||[],ht(o)?o:[],c&&r?gt(c):[])}return t.concat(o,gt(o,[],r))}function Qr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ha(e){const t=be(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Ce(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,c=jt(r)!==s||jt(n)!==i;return c&&(r=s,n=i),{width:r,height:n,$:c}}function Zr(e){return me(e)?e:e.contextElement}function rt(e){const t=Zr(e);if(!Ce(t))return xe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=ha(t);let i=(s?jt(r.width):r.width)/n,c=(s?jt(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const cd=xe(0);function ga(e){const t=fe(e);return!Xr()||!t.visualViewport?cd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dd(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==fe(e)?!1:t}function We(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=Zr(e);let i=xe(1);t&&(n?me(n)&&(i=rt(n)):i=rt(e));const c=dd(s,r,n)?ga(s):xe(0);let u=(o.left+c.x)/i.x,d=(o.top+c.y)/i.y,p=o.width/i.x,h=o.height/i.y;if(s){const m=fe(s),v=n&&me(n)?fe(n):n;let y=m,f=Qr(y);for(;f&&n&&v!==y;){const g=rt(f),b=f.getBoundingClientRect(),w=be(f),x=b.left+(f.clientLeft+parseFloat(w.paddingLeft))*g.x,N=b.top+(f.clientTop+parseFloat(w.paddingTop))*g.y;u*=g.x,d*=g.y,p*=g.x,h*=g.y,u+=x,d+=N,y=fe(f),f=Qr(y)}}return Gt({width:p,height:h,x:u,y:d})}function Jr(e,t){const r=Yt(e).scrollLeft;return t?t.left+r:We(Ne(e)).left+r}function va(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:Jr(e,n)),s=n.top+t.scrollTop;return{x:o,y:s}}function ud(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",i=Ne(n),c=t?qt(t.floating):!1;if(n===i||c&&s)return r;let u={scrollLeft:0,scrollTop:0},d=xe(1);const p=xe(0),h=Ce(n);if((h||!h&&!s)&&((et(n)!=="body"||ht(i))&&(u=Yt(n)),Ce(n))){const v=We(n);d=rt(n),p.x=v.x+n.clientLeft,p.y=v.y+n.clientTop}const m=i&&!h&&!s?va(i,u,!0):xe(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+p.x+m.x,y:r.y*d.y-u.scrollTop*d.y+p.y+m.y}}function fd(e){return Array.from(e.getClientRects())}function pd(e){const t=Ne(e),r=Yt(e),n=e.ownerDocument.body,o=ue(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ue(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Jr(e);const c=-r.scrollTop;return be(n).direction==="rtl"&&(i+=ue(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:c}}function hd(e,t){const r=fe(e),n=Ne(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,c=0,u=0;if(o){s=o.width,i=o.height;const d=Xr();(!d||d&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:c,y:u}}function gd(e,t){const r=We(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=Ce(e)?rt(e):xe(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,u=o*s.x,d=n*s.y;return{width:i,height:c,x:u,y:d}}function ma(e,t,r){let n;if(t==="viewport")n=hd(e,r);else if(t==="document")n=pd(Ne(e));else if(me(t))n=gd(t,r);else{const o=ga(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Gt(n)}function ba(e,t){const r=_e(e);return r===t||!me(r)||tt(r)?!1:be(r).position==="fixed"||ba(r,t)}function vd(e,t){const r=t.get(e);if(r)return r;let n=gt(e,[],!1).filter(c=>me(c)&&et(c)!=="body"),o=null;const s=be(e).position==="fixed";let i=s?_e(e):e;for(;me(i)&&!tt(i);){const c=be(i),u=Yr(i);!u&&c.position==="fixed"&&(o=null),(s?!u&&!o:!u&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ht(i)&&!u&&ba(e,i))?n=n.filter(p=>p!==i):o=c,i=_e(i)}return t.set(e,n),n}function md(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?qt(t)?[]:vd(t,this._c):[].concat(r),n],c=i[0],u=i.reduce((d,p)=>{const h=ma(t,p,o);return d.top=ue(h.top,d.top),d.right=Oe(h.right,d.right),d.bottom=Oe(h.bottom,d.bottom),d.left=ue(h.left,d.left),d},ma(t,c,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function bd(e){const{width:t,height:r}=ha(e);return{width:t,height:r}}function yd(e,t,r){const n=Ce(t),o=Ne(t),s=r==="fixed",i=We(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=xe(0);if(n||!n&&!s)if((et(t)!=="body"||ht(o))&&(c=Yt(t)),n){const m=We(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&(u.x=Jr(o));const d=o&&!n&&!s?va(o,c):xe(0),p=i.left+c.scrollLeft-u.x-d.x,h=i.top+c.scrollTop-u.y-d.y;return{x:p,y:h,width:i.width,height:i.height}}function Rr(e){return be(e).position==="static"}function ya(e,t){if(!Ce(e)||be(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ne(e)===r&&(r=r.ownerDocument.body),r}function wa(e,t){const r=fe(e);if(qt(e))return r;if(!Ce(e)){let o=_e(e);for(;o&&!tt(o);){if(me(o)&&!Rr(o))return o;o=_e(o)}return r}let n=ya(e,t);for(;n&&id(n)&&Rr(n);)n=ya(n,t);return n&&tt(n)&&Rr(n)&&!Yr(n)?r:n||ld(e)||r}const wd=async function(e){const t=this.getOffsetParent||wa,r=this.getDimensions,n=await r(e.floating);return{reference:yd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function xd(e){return be(e).direction==="rtl"}const Nd={convertOffsetParentRelativeRectToViewportRelativeRect:ud,getDocumentElement:Ne,getClippingRect:md,getOffsetParent:wa,getElementRects:wd,getClientRects:fd,getDimensions:bd,getScale:rt,isElement:me,isRTL:xd};function xa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cd(e,t){let r=null,n;const o=Ne(e);function s(){var c;clearTimeout(n),(c=r)==null||c.disconnect(),r=null}function i(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:p,top:h,width:m,height:v}=d;if(c||t(),!m||!v)return;const y=Ht(h),f=Ht(o.clientWidth-(p+m)),g=Ht(o.clientHeight-(h+v)),b=Ht(p),x={rootMargin:-y+"px "+-f+"px "+-g+"px "+-b+"px",threshold:ue(0,Oe(1,u))||1};let N=!0;function S(C){const T=C[0].intersectionRatio;if(T!==u){if(!N)return i();T?i(!1,T):n=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!xa(d,e.getBoundingClientRect())&&i(),N=!1}try{r=new IntersectionObserver(S,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(S,x)}r.observe(e)}return i(!0),s}function Sd(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=Zr(e),p=o||s?[...d?gt(d):[],...gt(t)]:[];p.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),s&&b.addEventListener("resize",r)});const h=d&&c?Cd(d,r):null;let m=-1,v=null;i&&(v=new ResizeObserver(b=>{let[w]=b;w&&w.target===d&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=v)==null||x.observe(t)})),r()}),d&&!u&&v.observe(d),v.observe(t));let y,f=u?We(e):null;u&&g();function g(){const b=We(e);f&&!xa(f,b)&&r(),f=b,y=requestAnimationFrame(g)}return r(),()=>{var b;p.forEach(w=>{o&&w.removeEventListener("scroll",r),s&&w.removeEventListener("resize",r)}),h==null||h(),(b=v)==null||b.disconnect(),v=null,u&&cancelAnimationFrame(y)}}const Ed=nd,Td=od,Pd=ed,Ad=sd,Md=td,Na=Rc,kd=ad,Od=(e,t,r)=>{const n=new Map,o={platform:Nd,...r},s={...o.platform,_c:n};return Jc(e,t,{...o,platform:s})};var Xt=typeof document<"u"?K.useLayoutEffect:K.useEffect;function Qt(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,o;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(!Qt(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!Qt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ca(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sa(e,t){const r=Ca(e);return Math.round(t*r)/r}function en(e){const t=l.useRef(e);return Xt(()=>{t.current=e}),t}function Dd(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[p,h]=l.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=l.useState(n);Qt(m,n)||v(n);const[y,f]=l.useState(null),[g,b]=l.useState(null),w=l.useCallback(D=>{D!==C.current&&(C.current=D,f(D))},[]),x=l.useCallback(D=>{D!==T.current&&(T.current=D,b(D))},[]),N=s||y,S=i||g,C=l.useRef(null),T=l.useRef(null),B=l.useRef(p),I=u!=null,W=en(u),G=en(o),V=en(d),_=l.useCallback(()=>{if(!C.current||!T.current)return;const D={placement:t,strategy:r,middleware:m};G.current&&(D.platform=G.current),Od(C.current,T.current,D).then(F=>{const Z={...F,isPositioned:V.current!==!1};P.current&&!Qt(B.current,Z)&&(B.current=Z,pr.flushSync(()=>{h(Z)}))})},[m,t,r,G,V]);Xt(()=>{d===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,h(D=>({...D,isPositioned:!1})))},[d]);const P=l.useRef(!1);Xt(()=>(P.current=!0,()=>{P.current=!1}),[]),Xt(()=>{if(N&&(C.current=N),S&&(T.current=S),N&&S){if(W.current)return W.current(N,S,_);_()}},[N,S,_,W,I]);const j=l.useMemo(()=>({reference:C,floating:T,setReference:w,setFloating:x}),[w,x]),k=l.useMemo(()=>({reference:N,floating:S}),[N,S]),U=l.useMemo(()=>{const D={position:r,left:0,top:0};if(!k.floating)return D;const F=Sa(k.floating,p.x),Z=Sa(k.floating,p.y);return c?{...D,transform:"translate("+F+"px, "+Z+"px)",...Ca(k.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:F,top:Z}},[r,c,k.floating,p.x,p.y]);return l.useMemo(()=>({...p,update:_,refs:j,elements:k,floatingStyles:U}),[p,_,j,k,U])}const _d=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Na({element:n.current,padding:o}).fn(r):{}:n?Na({element:n,padding:o}).fn(r):{}}}},Id=(e,t)=>({...Ed(e),options:[e,t]}),Ld=(e,t)=>({...Td(e),options:[e,t]}),$d=(e,t)=>({...kd(e),options:[e,t]}),Fd=(e,t)=>({...Pd(e),options:[e,t]}),zd=(e,t)=>({...Ad(e),options:[e,t]}),Bd=(e,t)=>({...Md(e),options:[e,t]}),Wd=(e,t)=>({..._d(e),options:[e,t]});var Vd="Arrow",Ea=l.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return a.jsx(J.svg,{...s,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ea.displayName=Vd;var jd=Ea;function Hd(e){const[t,r]=l.useState(void 0);return Me(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,c;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,c=d.blockSize}else i=e.offsetWidth,c=e.offsetHeight;r({width:i,height:c})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var tn="Popper",[Ta,Pa]=ct(tn),[Ud,Aa]=Ta(tn),Ma=e=>{const{__scopePopper:t,children:r}=e,[n,o]=l.useState(null);return a.jsx(Ud,{scope:t,anchor:n,onAnchorChange:o,children:r})};Ma.displayName=tn;var ka="PopperAnchor",Oa=l.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=Aa(ka,r),i=l.useRef(null),c=le(t,i);return l.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:a.jsx(J.div,{...o,ref:c})});Oa.displayName=ka;var rn="PopperContent",[Gd,Kd]=Ta(rn),Da=l.forwardRef((e,t)=>{var se,yt,cr,wt,dr,it;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:y,...f}=e,g=Aa(rn,r),[b,w]=l.useState(null),x=le(t,je=>w(je)),[N,S]=l.useState(null),C=Hd(N),T=(C==null?void 0:C.width)??0,B=(C==null?void 0:C.height)??0,I=n+(s!=="center"?"-"+s:""),W=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},G=Array.isArray(d)?d:[d],V=G.length>0,_={padding:W,boundary:G.filter(Yd),altBoundary:V},{refs:P,floatingStyles:j,placement:k,isPositioned:U,middlewareData:D}=Dd({strategy:"fixed",placement:I,whileElementsMounted:(...je)=>Sd(...je,{animationFrame:v==="always"}),elements:{reference:g.anchor},middleware:[Id({mainAxis:o+B,alignmentAxis:i}),u&&Ld({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?$d():void 0,..._}),u&&Fd({..._}),zd({..._,apply:({elements:je,rects:$,availableWidth:z,availableHeight:ie})=>{const{width:ce,height:de}=$.reference,q=je.floating.style;q.setProperty("--radix-popper-available-width",`${z}px`),q.setProperty("--radix-popper-available-height",`${ie}px`),q.setProperty("--radix-popper-anchor-width",`${ce}px`),q.setProperty("--radix-popper-anchor-height",`${de}px`)}}),N&&Wd({element:N,padding:c}),Xd({arrowWidth:T,arrowHeight:B}),m&&Bd({strategy:"referenceHidden",..._})]}),[F,Z]=La(k),ee=he(y);Me(()=>{U&&(ee==null||ee())},[U,ee]);const ae=(se=D.arrow)==null?void 0:se.x,te=(yt=D.arrow)==null?void 0:yt.y,ne=((cr=D.arrow)==null?void 0:cr.centerOffset)!==0,[L,Y]=l.useState();return Me(()=>{b&&Y(window.getComputedStyle(b).zIndex)},[b]),a.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:U?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:L,"--radix-popper-transform-origin":[(wt=D.transformOrigin)==null?void 0:wt.x,(dr=D.transformOrigin)==null?void 0:dr.y].join(" "),...((it=D.hide)==null?void 0:it.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Gd,{scope:r,placedSide:F,onArrowChange:S,arrowX:ae,arrowY:te,shouldHideArrow:ne,children:a.jsx(J.div,{"data-side":F,"data-align":Z,...f,ref:x,style:{...f.style,animation:U?void 0:"none"}})})})});Da.displayName=rn;var _a="PopperArrow",qd={top:"bottom",right:"left",bottom:"top",left:"right"},Ia=l.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Kd(_a,n),i=qd[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]: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:a.jsx(jd,{...o,ref:r,style:{...o.style,display:"block"}})})});Ia.displayName=_a;function Yd(e){return e!==null}var Xd=e=>({name:"transformOrigin",options:e,fn(t){var g,b,w;const{placement:r,rects:n,middlewareData:o}=t,i=((g=o.arrow)==null?void 0:g.centerOffset)!==0,c=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[d,p]=La(r),h={start:"0%",center:"50%",end:"100%"}[p],m=(((b=o.arrow)==null?void 0:b.x)??0)+c/2,v=(((w=o.arrow)==null?void 0:w.y)??0)+u/2;let y="",f="";return d==="bottom"?(y=i?h:`${m}px`,f=`${-u}px`):d==="top"?(y=i?h:`${m}px`,f=`${n.floating.height+u}px`):d==="right"?(y=`${-u}px`,f=i?h:`${v}px`):d==="left"&&(y=`${n.floating.width+u}px`,f=i?h:`${v}px`),{data:{x:y,y:f}}}});function La(e){const[t,r="center"]=e.split("-");return[t,r]}var Qd=Ma,Zd=Oa,Jd=Da,Rd=Ia,eu="VisuallyHidden",Zt=l.forwardRef((e,t)=>a.jsx(J.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}}));Zt.displayName=eu;var tu=Zt,[Jt,Wf]=ct("Tooltip",[Pa]),Rt=Pa(),$a="TooltipProvider",ru=700,nn="tooltip.open",[nu,on]=Jt($a),Fa=e=>{const{__scopeTooltip:t,delayDuration:r=ru,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:s}=e,[i,c]=l.useState(!0),u=l.useRef(!1),d=l.useRef(0);return l.useEffect(()=>{const p=d.current;return()=>window.clearTimeout(p)},[]),a.jsx(nu,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:l.useCallback(()=>{window.clearTimeout(d.current),c(!1)},[]),onClose:l.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>c(!0),n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:l.useCallback(p=>{u.current=p},[]),disableHoverableContent:o,children:s})};Fa.displayName=$a;var er="Tooltip",[ou,vt]=Jt(er),za=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:c}=e,u=on(er,e.__scopeTooltip),d=Rt(t),[p,h]=l.useState(null),m=Ct(),v=l.useRef(0),y=i??u.disableHoverableContent,f=c??u.delayDuration,g=l.useRef(!1),[b=!1,w]=xr({prop:n,defaultProp:o,onChange:T=>{T?(u.onOpen(),document.dispatchEvent(new CustomEvent(nn))):u.onClose(),s==null||s(T)}}),x=l.useMemo(()=>b?g.current?"delayed-open":"instant-open":"closed",[b]),N=l.useCallback(()=>{window.clearTimeout(v.current),v.current=0,g.current=!1,w(!0)},[w]),S=l.useCallback(()=>{window.clearTimeout(v.current),v.current=0,w(!1)},[w]),C=l.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{g.current=!0,w(!0),v.current=0},f)},[f,w]);return l.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),a.jsx(Qd,{...d,children:a.jsx(ou,{scope:t,contentId:m,open:b,stateAttribute:x,trigger:p,onTriggerChange:h,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayed?C():N()},[u.isOpenDelayed,C,N]),onTriggerLeave:l.useCallback(()=>{y?S():(window.clearTimeout(v.current),v.current=0)},[S,y]),onOpen:N,onClose:S,disableHoverableContent:y,children:r})})};za.displayName=er;var an="TooltipTrigger",Ba=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=vt(an,r),s=on(an,r),i=Rt(r),c=l.useRef(null),u=le(t,c,o.onTriggerChange),d=l.useRef(!1),p=l.useRef(!1),h=l.useCallback(()=>d.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),a.jsx(Zd,{asChild:!0,...i,children:a.jsx(J.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:u,onPointerMove:Q(e.onPointerMove,m=>{m.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:Q(e.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:Q(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Q(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:Q(e.onBlur,o.onClose),onClick:Q(e.onClick,o.onClose)})})});Ba.displayName=an;var sn="TooltipPortal",[au,su]=Jt(sn,{forceMount:void 0}),Wa=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,s=vt(sn,t);return a.jsx(au,{scope:t,forceMount:r,children:a.jsx(ze,{present:r||s.open,children:a.jsx(Et,{asChild:!0,container:o,children:n})})})};Wa.displayName=sn;var nt="TooltipContent",Va=l.forwardRef((e,t)=>{const r=su(nt,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...s}=e,i=vt(nt,e.__scopeTooltip);return a.jsx(ze,{present:n||i.open,children:i.disableHoverableContent?a.jsx(ja,{side:o,...s,ref:t}):a.jsx(iu,{side:o,...s,ref:t})})}),iu=l.forwardRef((e,t)=>{const r=vt(nt,e.__scopeTooltip),n=on(nt,e.__scopeTooltip),o=l.useRef(null),s=le(t,o),[i,c]=l.useState(null),{trigger:u,onClose:d}=r,p=o.current,{onPointerInTransitChange:h}=n,m=l.useCallback(()=>{c(null),h(!1)},[h]),v=l.useCallback((y,f)=>{const g=y.currentTarget,b={x:y.clientX,y:y.clientY},w=uu(b,g.getBoundingClientRect()),x=fu(b,w),N=pu(f.getBoundingClientRect()),S=gu([...x,...N]);c(S),h(!0)},[h]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(u&&p){const y=g=>v(g,p),f=g=>v(g,u);return u.addEventListener("pointerleave",y),p.addEventListener("pointerleave",f),()=>{u.removeEventListener("pointerleave",y),p.removeEventListener("pointerleave",f)}}},[u,p,v,m]),l.useEffect(()=>{if(i){const y=f=>{const g=f.target,b={x:f.clientX,y:f.clientY},w=(u==null?void 0:u.contains(g))||(p==null?void 0:p.contains(g)),x=!hu(b,i);w?m():x&&(m(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,p,i,d,m]),a.jsx(ja,{...e,ref:s})}),[lu,cu]=Jt(er,{isInside:!1}),ja=l.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...c}=e,u=vt(nt,r),d=Rt(r),{onClose:p}=u;return l.useEffect(()=>(document.addEventListener(nn,p),()=>document.removeEventListener(nn,p)),[p]),l.useEffect(()=>{if(u.trigger){const h=m=>{const v=m.target;v!=null&&v.contains(u.trigger)&&p()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,p]),a.jsx(St,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:p,children:a.jsxs(Jd,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.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:[a.jsx(fo,{children:n}),a.jsx(lu,{scope:r,isInside:!0,children:a.jsx(tu,{id:u.contentId,role:"tooltip",children:o||n})})]})})});Va.displayName=nt;var Ha="TooltipArrow",du=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Rt(r);return cu(Ha,r).isInside?null:a.jsx(Rd,{...o,...n,ref:t})});du.displayName=Ha;function uu(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,o,s)){case s:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function fu(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 pu(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function hu(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const c=t[s].x,u=t[s].y,d=t[i].x,p=t[i].y;u>n!=p>n&&r<(d-c)*(n-u)/(p-u)+c&&(o=!o)}return o}function gu(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),vu(t)}function vu(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const s=r[r.length-1],i=r[r.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}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 mu=Fa,bu=za,yu=Ba,wu=Wa,Ua=Va;const ot=mu,at=bu,st=yu,Ve=l.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(wu,{children:a.jsx(Ua,{ref:n,sideOffset:t,className:O("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})}));Ve.displayName=Ua.displayName;const tr=l.forwardRef(({className:e,type:t,mask:r,onChange:n,placeholder:o,...s},i)=>{const[c,u]=l.useState(!1),d=l.useRef(null),h=o||(r==="phone"?"(999) 999-9999":r==="postal-code-ca"?"A9A 9A9":r==="zip-code-us"?"99999":""),m=()=>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.":"",v=()=>{u(!0),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{u(!1)},3e3)};l.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const y=f=>{if(r){const g=f.target.value;let b=g;if(g.length>0){const w=g[g.length-1];/[^a-zA-Z0-9]/.test(w)&&(console.log("Non-alphanumeric detected:",w),v())}if(r==="phone"){const w=g.replace(/\D/g,"");w.length<=3?b=w:w.length<=6?b=`(${w.slice(0,3)}) ${w.slice(3)}`:b=`(${w.slice(0,3)}) ${w.slice(3,6)}-${w.slice(6,10)}`}else if(r==="postal-code-ca"){const w=g.replace(/[^a-zA-Z0-9]/g,"").toUpperCase();let x="";for(let N=0;N<Math.min(w.length,6);N++){const S=w[N];N===0||N===2||N===4?/[A-Z]/.test(S)&&(x+=S):(N===1||N===3||N===5)&&/[0-9]/.test(S)&&(x+=S)}x.length<=3?b=x:b=`${x.slice(0,3)} ${x.slice(3,6)}`}else if(r==="zip-code-us"){const w=g.replace(/\D/g,"");w.length<=5?b=w:b=`${w.slice(0,5)}-${w.slice(5,9)}`}f.target.value=b}n==null||n(f)};return a.jsx(ot,{children:a.jsxs(at,{open:c&&!!r,children:[a.jsx(st,{asChild:!0,children:a.jsx("input",{type:t,className:O("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:y,placeholder:h,ref:i,...s})}),a.jsx(Ve,{side:"top",className:"bg-sidebar text-sidebar-foreground",children:m()})]})})});tr.displayName="Input";var xu="Separator",Ga="horizontal",Nu=["horizontal","vertical"],Ka=l.forwardRef((e,t)=>{const{decorative:r,orientation:n=Ga,...o}=e,s=Cu(n)?n:Ga,c=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return a.jsx(J.div,{"data-orientation":s,...c,...o,ref:t})});Ka.displayName=xu;function Cu(e){return Nu.includes(e)}var qa=Ka;const ln=l.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},o)=>a.jsx(qa,{ref:o,decorative:r,orientation:t,className:O("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));ln.displayName=qa.displayName;const Ya=$r,Su=ra,Eu=Bt,Xa=na,cn=l.forwardRef(({className:e,...t},r)=>a.jsx(Lt,{className:O("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}));cn.displayName=Lt.displayName;const Tu=ft("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"}}),dn=l.forwardRef(({side:e="right",className:t,children:r,...n},o)=>a.jsxs(Xa,{children:[a.jsx(cn,{}),a.jsxs($t,{ref:o,className:O(Tu({side:e}),t),...n,children:[a.jsxs(Bt,{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:[a.jsx(hr,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));dn.displayName=$t.displayName;const Qa=({className:e,...t})=>a.jsx("div",{className:O("flex flex-col space-y-2 text-center sm:text-left",e),...t});Qa.displayName="SheetHeader";const Za=({className:e,...t})=>a.jsx("div",{className:O("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Za.displayName="SheetFooter";const Ja=l.forwardRef(({className:e,...t},r)=>a.jsx(Ft,{ref:r,className:O("text-lg font-semibold text-foreground",e),...t}));Ja.displayName=Ft.displayName;const Ra=l.forwardRef(({className:e,...t},r)=>a.jsx(zt,{ref:r,className:O("text-sm text-muted-foreground",e),...t}));Ra.displayName=zt.displayName;function Pu({onClick:e,publicName:t,applicationName:r,partnerId:n}){const o=`https://api.randmar.io/v4/Partner/${n}/Account/Logo?height=72&width=72`,[s,i]=K.useState(!1),c=()=>{i(!0)};return a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-muted "+(e!==void 0?"cursor-pointer":""),children:s?a.jsx(oe,{asChild:!0,size:"icon",onClick:e,children:a.jsx(Mi,{className:"h-5 w-5 text-muted-foreground !bg-sidebar"})}):a.jsx(oe,{asChild:!0,size:"icon",onClick:e,children:a.jsx("img",{src:o,alt:"Partner logo",className:"h-9 w-9 object-cover !bg-sidebar",onError:c})})}),a.jsxs("div",{className:"flex flex-1 flex-col",children:[a.jsx("span",{className:"text-sm font-medium",children:t||"Partner"}),a.jsx("span",{className:"text-xs text-neutral-400",children:r})]})]})}var Au="Label",es=l.forwardRef((e,t)=>a.jsx(J.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));es.displayName=Au;var Mu=es;function ku({className:e,...t}){return a.jsx(Mu,{"data-slot":"label",className:O("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 un=1024;function ts(){const[e,t]=l.useState(void 0);return l.useEffect(()=>{const r=window.matchMedia(`(max-width: ${un-1}px)`),n=()=>{t(window.innerWidth<un)};return r.addEventListener("change",n),t(window.innerWidth<un),()=>r.removeEventListener("change",n)},[]),!!e}function X({className:e,...t}){return a.jsx("div",{className:O("animate-pulse rounded-md bg-primary/20",e),...t})}const Ou="sidebar:state",Du=60*60*24*7,_u="16rem",Iu="18rem",Lu="3rem",$u="b",rs=l.createContext(null);function mt(){const e=l.useContext(rs);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const fn=l.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:o,children:s,...i},c)=>{const u=ts(),[d,p]=l.useState(!1),[h,m]=l.useState(e),v=t??h,y=l.useCallback(w=>{const x=typeof w=="function"?w(v):w;r?r(x):m(x),document.cookie=`${Ou}=${x}; path=/; max-age=${Du}`},[r,v]),f=l.useCallback(()=>u?p(w=>!w):y(w=>!w),[u,y,p]);l.useEffect(()=>{const w=x=>{x.key===$u&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),f())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[f]);const g=v?"expanded":"collapsed",b=l.useMemo(()=>({state:g,open:v,setOpen:y,isMobile:u,openMobile:d,setOpenMobile:p,toggleSidebar:f}),[g,v,y,u,d,p,f]);return a.jsx(rs.Provider,{value:b,children:a.jsx(ot,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":_u,"--sidebar-width-icon":Lu,...o},className:O("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",n),ref:c,...i,children:s})})})});fn.displayName="SidebarProvider";const pn=l.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:o,...s},i)=>{const{isMobile:c,state:u,openMobile:d,setOpenMobile:p}=mt();return r==="none"?a.jsx("div",{className:O("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",n),ref:i,...s,children:o}):c?a.jsx(Ya,{open:d,onOpenChange:p,...s,children:a.jsx(dn,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Iu},side:e,children:a.jsx("div",{className:"flex h-full w-full flex-col",children:o})})}):a.jsxs("div",{ref:i,className:"group peer hidden md:block text-sidebar-foreground","data-state":u,"data-collapsible":u==="collapsed"?r:"","data-variant":t,"data-side":e,children:[a.jsx("div",{className:O("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)")}),a.jsx("div",{className:O("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:a.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:o})})]})});pn.displayName="Sidebar";const hn=l.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:o}=mt();return a.jsxs(oe,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:O("h-7 w-7 text-sidebar-foreground",e),onClick:s=>{t==null||t(s),o()},...r,children:[a.jsx(Ni,{}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});hn.displayName="SidebarTrigger";const ns=l.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=mt();return a.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:O("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})});ns.displayName="SidebarRail";const os=l.forwardRef(({className:e,...t},r)=>a.jsx("main",{ref:r,className:O("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}));os.displayName="SidebarInset";const as=l.forwardRef(({className:e,...t},r)=>a.jsx(tr,{ref:r,"data-sidebar":"input",className:O("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));as.displayName="SidebarInput";const gn=l.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"header",className:O("flex flex-col gap-2 p-2",e),...t}));gn.displayName="SidebarHeader";const vn=l.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"footer",className:O("flex flex-col gap-2 p-2",e),...t}));vn.displayName="SidebarFooter";const ss=l.forwardRef(({className:e,...t},r)=>a.jsx(ln,{ref:r,"data-sidebar":"separator",className:O("mx-2 w-auto bg-sidebar-border",e),...t}));ss.displayName="SidebarSeparator";const mn=l.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"content",className:O("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));mn.displayName="SidebarContent";const is=l.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"group",className:O("relative flex w-full min-w-0 flex-col p-2",e),...t}));is.displayName="SidebarGroup";const ls=l.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const o=t?ge:"div";return a.jsx(o,{ref:n,"data-sidebar":"group-label",className:O("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})});ls.displayName="SidebarGroupLabel";const cs=l.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const o=t?ge:"button";return a.jsx(o,{ref:n,"data-sidebar":"group-action",className:O("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})});cs.displayName="SidebarGroupAction";const ds=l.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"group-content",className:O("w-full text-sm",e),...t}));ds.displayName="SidebarGroupContent";const bn=l.forwardRef(({className:e,...t},r)=>a.jsx("ul",{ref:r,"data-sidebar":"menu",className:O("flex w-full min-w-0 flex-col gap-1",e),...t}));bn.displayName="SidebarMenu";const yn=l.forwardRef(({className:e,...t},r)=>a.jsx("li",{ref:r,"data-sidebar":"menu-item",className:O("group/menu-item relative",e),...t}));yn.displayName="SidebarMenuItem";const Fu=ft("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"}}),wn=l.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:o,className:s,...i},c)=>{const u=e?ge:"button",{isMobile:d,state:p}=mt(),h=a.jsx(u,{ref:c,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:O(Fu({variant:r,size:n}),s),...i});return o?(typeof o=="string"&&(o={children:o}),a.jsxs(at,{children:[a.jsx(st,{asChild:!0,children:h}),a.jsx(Ve,{side:"right",align:"center",hidden:p!=="collapsed"||d,...o})]})):h});wn.displayName="SidebarMenuButton";const us=l.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},o)=>{const s=t?ge:"button";return a.jsx(s,{ref:o,"data-sidebar":"menu-action",className:O("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})});us.displayName="SidebarMenuAction";const fs=l.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:O("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}));fs.displayName="SidebarMenuBadge";const ps=l.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const o=l.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:O("rounded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&a.jsx(X,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),a.jsx(X,{className:"h-4 flex-1 max-w-(--skeleton-width)","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});ps.displayName="SidebarMenuSkeleton";const hs=l.forwardRef(({className:e,...t},r)=>a.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:O("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}));hs.displayName="SidebarMenuSub";const gs=l.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));gs.displayName="SidebarMenuSubItem";const vs=l.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...o},s)=>{const i=e?ge:"a";return a.jsx(i,{ref:s,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:O("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),...o})});vs.displayName="SidebarMenuSubButton";function zu(e){const t=e+"CollectionProvider",[r,n]=ct(t),[o,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:y,children:f}=v,g=K.useRef(null),b=K.useRef(new Map).current;return a.jsx(o,{scope:y,itemMap:b,collectionRef:g,children:f})};i.displayName=t;const c=e+"CollectionSlot",u=K.forwardRef((v,y)=>{const{scope:f,children:g}=v,b=s(c,f),w=le(y,b.collectionRef);return a.jsx(ge,{ref:w,children:g})});u.displayName=c;const d=e+"CollectionItemSlot",p="data-radix-collection-item",h=K.forwardRef((v,y)=>{const{scope:f,children:g,...b}=v,w=K.useRef(null),x=le(y,w),N=s(d,f);return K.useEffect(()=>(N.itemMap.set(w,{ref:w,...b}),()=>void N.itemMap.delete(w))),a.jsx(ge,{[p]:"",ref:x,children:g})});h.displayName=d;function m(v){const y=s(e+"CollectionConsumer",v);return K.useCallback(()=>{const g=y.collectionRef.current;if(!g)return[];const b=Array.from(g.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((N,S)=>b.indexOf(N.ref.current)-b.indexOf(S.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:h},m,n]}var xn="ToastProvider",[Nn,Bu,Wu]=zu("Toast"),[ms,Vf]=ct("Toast",[Wu]),[Vu,rr]=ms(xn),bs=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[c,u]=l.useState(null),[d,p]=l.useState(0),h=l.useRef(!1),m=l.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${xn}\`. Expected non-empty \`string\`.`),a.jsx(Nn.Provider,{scope:t,children:a.jsx(Vu,{scope:t,label:r,duration:n,swipeDirection:o,swipeThreshold:s,toastCount:d,viewport:c,onViewportChange:u,onToastAdd:l.useCallback(()=>p(v=>v+1),[]),onToastRemove:l.useCallback(()=>p(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:m,children:i})})};bs.displayName=xn;var ys="ToastViewport",ju=["F8"],Cn="toast.viewportPause",Sn="toast.viewportResume",ws=l.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=ju,label:o="Notifications ({hotkey})",...s}=e,i=rr(ys,r),c=Bu(r),u=l.useRef(null),d=l.useRef(null),p=l.useRef(null),h=l.useRef(null),m=le(t,h,i.onViewportChange),v=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=i.toastCount>0;l.useEffect(()=>{const g=b=>{var x;n.length!==0&&n.every(N=>b[N]||b.code===N)&&((x=h.current)==null||x.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),l.useEffect(()=>{const g=u.current,b=h.current;if(y&&g&&b){const w=()=>{if(!i.isClosePausedRef.current){const C=new CustomEvent(Cn);b.dispatchEvent(C),i.isClosePausedRef.current=!0}},x=()=>{if(i.isClosePausedRef.current){const C=new CustomEvent(Sn);b.dispatchEvent(C),i.isClosePausedRef.current=!1}},N=C=>{!g.contains(C.relatedTarget)&&x()},S=()=>{g.contains(document.activeElement)||x()};return g.addEventListener("focusin",w),g.addEventListener("focusout",N),g.addEventListener("pointermove",w),g.addEventListener("pointerleave",S),window.addEventListener("blur",w),window.addEventListener("focus",x),()=>{g.removeEventListener("focusin",w),g.removeEventListener("focusout",N),g.removeEventListener("pointermove",w),g.removeEventListener("pointerleave",S),window.removeEventListener("blur",w),window.removeEventListener("focus",x)}}},[y,i.isClosePausedRef]);const f=l.useCallback(({tabbingDirection:g})=>{const w=c().map(x=>{const N=x.ref.current,S=[N,...tf(N)];return g==="forwards"?S:S.reverse()});return(g==="forwards"?w.reverse():w).flat()},[c]);return l.useEffect(()=>{const g=h.current;if(g){const b=w=>{var S,C,T;const x=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!x){const B=document.activeElement,I=w.shiftKey;if(w.target===g&&I){(S=d.current)==null||S.focus();return}const V=f({tabbingDirection:I?"backwards":"forwards"}),_=V.findIndex(P=>P===B);Pn(V.slice(_+1))?w.preventDefault():I?(C=d.current)==null||C.focus():(T=p.current)==null||T.focus()}};return g.addEventListener("keydown",b),()=>g.removeEventListener("keydown",b)}},[c,f]),a.jsxs(Fl,{ref:u,role:"region","aria-label":o.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&a.jsx(En,{ref:d,onFocusFromOutsideViewport:()=>{const g=f({tabbingDirection:"forwards"});Pn(g)}}),a.jsx(Nn.Slot,{scope:r,children:a.jsx(J.ol,{tabIndex:-1,...s,ref:m})}),y&&a.jsx(En,{ref:p,onFocusFromOutsideViewport:()=>{const g=f({tabbingDirection:"backwards"});Pn(g)}})]})});ws.displayName=ys;var xs="ToastFocusProxy",En=l.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,s=rr(xs,r);return a.jsx(Zt,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var d;const c=i.relatedTarget;!((d=s.viewport)!=null&&d.contains(c))&&n()}})});En.displayName=xs;var nr="Toast",Hu="toast.swipeStart",Uu="toast.swipeMove",Gu="toast.swipeCancel",Ku="toast.swipeEnd",Ns=l.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:o,onOpenChange:s,...i}=e,[c=!0,u]=xr({prop:n,defaultProp:o,onChange:s});return a.jsx(ze,{present:r||c,children:a.jsx(Xu,{open:c,...i,ref:t,onClose:()=>u(!1),onPause:he(e.onPause),onResume:he(e.onResume),onSwipeStart:Q(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Q(e.onSwipeMove,d=>{const{x:p,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:Q(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:Q(e.onSwipeEnd,d=>{const{x:p,y:h}=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",`${p}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),u(!1)})})})});Ns.displayName=nr;var[qu,Yu]=ms(nr,{onClose(){}}),Xu=l.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:c,onPause:u,onResume:d,onSwipeStart:p,onSwipeMove:h,onSwipeCancel:m,onSwipeEnd:v,...y}=e,f=rr(nr,r),[g,b]=l.useState(null),w=le(t,P=>b(P)),x=l.useRef(null),N=l.useRef(null),S=o||f.duration,C=l.useRef(0),T=l.useRef(S),B=l.useRef(0),{onToastAdd:I,onToastRemove:W}=f,G=he(()=>{var j;(g==null?void 0:g.contains(document.activeElement))&&((j=f.viewport)==null||j.focus()),i()}),V=l.useCallback(P=>{!P||P===1/0||(window.clearTimeout(B.current),C.current=new Date().getTime(),B.current=window.setTimeout(G,P))},[G]);l.useEffect(()=>{const P=f.viewport;if(P){const j=()=>{V(T.current),d==null||d()},k=()=>{const U=new Date().getTime()-C.current;T.current=T.current-U,window.clearTimeout(B.current),u==null||u()};return P.addEventListener(Cn,k),P.addEventListener(Sn,j),()=>{P.removeEventListener(Cn,k),P.removeEventListener(Sn,j)}}},[f.viewport,S,u,d,V]),l.useEffect(()=>{s&&!f.isClosePausedRef.current&&V(S)},[s,S,f.isClosePausedRef,V]),l.useEffect(()=>(I(),()=>W()),[I,W]);const _=l.useMemo(()=>g?Ms(g):null,[g]);return f.viewport?a.jsxs(a.Fragment,{children:[_&&a.jsx(Qu,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:_}),a.jsx(qu,{scope:r,onClose:G,children:pr.createPortal(a.jsx(Nn.ItemSlot,{scope:r,children:a.jsx($l,{asChild:!0,onEscapeKeyDown:Q(c,()=>{f.isFocusedToastEscapeKeyDownRef.current||G(),f.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(J.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":f.swipeDirection,...y,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Q(e.onKeyDown,P=>{P.key==="Escape"&&(c==null||c(P.nativeEvent),P.nativeEvent.defaultPrevented||(f.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:Q(e.onPointerDown,P=>{P.button===0&&(x.current={x:P.clientX,y:P.clientY})}),onPointerMove:Q(e.onPointerMove,P=>{if(!x.current)return;const j=P.clientX-x.current.x,k=P.clientY-x.current.y,U=!!N.current,D=["left","right"].includes(f.swipeDirection),F=["left","up"].includes(f.swipeDirection)?Math.min:Math.max,Z=D?F(0,j):0,ee=D?0:F(0,k),ae=P.pointerType==="touch"?10:2,te={x:Z,y:ee},ne={originalEvent:P,delta:te};U?(N.current=te,or(Uu,h,ne,{discrete:!1})):ks(te,f.swipeDirection,ae)?(N.current=te,or(Hu,p,ne,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(j)>ae||Math.abs(k)>ae)&&(x.current=null)}),onPointerUp:Q(e.onPointerUp,P=>{const j=N.current,k=P.target;if(k.hasPointerCapture(P.pointerId)&&k.releasePointerCapture(P.pointerId),N.current=null,x.current=null,j){const U=P.currentTarget,D={originalEvent:P,delta:j};ks(j,f.swipeDirection,f.swipeThreshold)?or(Ku,v,D,{discrete:!0}):or(Gu,m,D,{discrete:!0}),U.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),f.viewport)})]}):null}),Qu=e=>{const{__scopeToast:t,children:r,...n}=e,o=rr(nr,t),[s,i]=l.useState(!1),[c,u]=l.useState(!1);return Ru(()=>i(!0)),l.useEffect(()=>{const d=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(d)},[]),c?null:a.jsx(Et,{asChild:!0,children:a.jsx(Zt,{...n,children:s&&a.jsxs(a.Fragment,{children:[o.label," ",r]})})})},Zu="ToastTitle",Cs=l.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return a.jsx(J.div,{...n,ref:t})});Cs.displayName=Zu;var Ju="ToastDescription",Ss=l.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return a.jsx(J.div,{...n,ref:t})});Ss.displayName=Ju;var Es="ToastAction",Ts=l.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?a.jsx(As,{altText:r,asChild:!0,children:a.jsx(Tn,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Es}\`. Expected non-empty \`string\`.`),null)});Ts.displayName=Es;var Ps="ToastClose",Tn=l.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,o=Yu(Ps,r);return a.jsx(As,{asChild:!0,children:a.jsx(J.button,{type:"button",...n,ref:t,onClick:Q(e.onClick,o.onClose)})})});Tn.displayName=Ps;var As=l.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...o}=e;return a.jsx(J.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:t})});function Ms(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),ef(n)){const o=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...Ms(n))}}),t}function or(e,t,r,{discrete:n}){const o=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?po(o,s):o.dispatchEvent(s)}var ks=(e,t,r=0)=>{const n=Math.abs(e.x),o=Math.abs(e.y),s=n>o;return t==="left"||t==="right"?s&&n>r:!s&&o>r};function Ru(e=()=>{}){const t=he(e);Me(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function ef(e){return e.nodeType===e.ELEMENT_NODE}function tf(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Pn(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var rf=bs,Os=ws,Ds=Ns,_s=Cs,Is=Ss,Ls=Ts,$s=Tn;const Fs=rf,An=l.forwardRef(({className:e,...t},r)=>a.jsx(Os,{ref:r,className:O("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}));An.displayName=Os.displayName;const nf=ft("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"}}),Mn=l.forwardRef(({className:e,variant:t,...r},n)=>a.jsx(Ds,{ref:n,className:O(nf({variant:t}),e),...r}));Mn.displayName=Ds.displayName;const zs=l.forwardRef(({className:e,...t},r)=>a.jsx(Ls,{ref:r,className:O("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}));zs.displayName=Ls.displayName;const kn=l.forwardRef(({className:e,...t},r)=>a.jsx($s,{ref:r,className:O("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:a.jsx(hr,{className:"h-4 w-4"})}));kn.displayName=$s.displayName;const On=l.forwardRef(({className:e,...t},r)=>a.jsx(_s,{ref:r,className:O("text-sm font-semibold [&+div]:text-xs",e),...t}));On.displayName=_s.displayName;const Dn=l.forwardRef(({className:e,...t},r)=>a.jsx(Is,{ref:r,className:O("text-sm opacity-90",e),...t}));Dn.displayName=Is.displayName;const of=1,af=1e6;let _n=0;function sf(){return _n=(_n+1)%Number.MAX_SAFE_INTEGER,_n.toString()}const In=new Map,Bs=e=>{if(In.has(e))return;const t=setTimeout(()=>{In.delete(e),bt({type:"REMOVE_TOAST",toastId:e})},af);In.set(e,t)},lf=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,of)};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?Bs(r):e.toasts.forEach(n=>Bs(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):[]}}},ar=[];let sr={toasts:[]};function bt(e){sr=lf(sr,e),ar.forEach(t=>t(sr))}function Ws({...e}){const t=sf(),r=o=>bt({type:"UPDATE_TOAST",toast:{...o,id:t}}),n=()=>bt({type:"DISMISS_TOAST",toastId:t});return bt({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||n()}}}),{id:t,dismiss:n,update:r}}function Ln(){const[e,t]=l.useState(sr);return l.useEffect(()=>(ar.push(t),()=>{const r=ar.indexOf(t);r>-1&&ar.splice(r,1)}),[]),{...e,toast:Ws,dismiss:r=>bt({type:"DISMISS_TOAST",toastId:r})}}function Vs(){const{toasts:e}=Ln();return a.jsxs(Fs,{children:[e.map(function({id:t,title:r,description:n,action:o,...s}){return a.jsxs(Mn,{...s,children:[a.jsxs("div",{className:"grid gap-1",children:[r&&a.jsx(On,{children:r}),n&&a.jsx(Dn,{children:n})]}),o,a.jsx(kn,{})]},t)}),a.jsx(An,{})]})}function js({onSignOut:e,handleValidSearch:t,rightMenu:r,searchPlaceholder:n}){const[o,s]=K.useState(""),i=fr.useLocation(),{toast:c}=Ln();K.useEffect(()=>{const h=new URLSearchParams(i.search).get("q");h&&s(h)},[i.search]);const u=()=>{const p=o.trim();if(!p||p.length<2){c({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}t(p)},d=p=>{p.key==="Enter"&&u()};return a.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:[a.jsx(hn,{className:"lg:hidden",children:a.jsx(wi,{className:"h-6 w-6"})}),a.jsx("div",{className:"flex flex-1 items-center gap-4",children:a.jsx("div",{className:"relative w-full max-w-sm",children:a.jsxs("div",{children:[a.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:u,"aria-label":"Search",children:a.jsx(Ti,{className:"h-4 w-4 text-muted-foreground"})}),a.jsx(tr,{placeholder:n??"Search...",className:"w-full pl-8 bg-white text-black",value:o,onChange:p=>s(p.target.value),onKeyDown:d},"topbar-search")]})})}),r||a.jsx(a.Fragment,{}),e&&a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs(oe,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:e,children:[a.jsx(yi,{className:"h-4 w-4 text-sidebar-foreground"}),a.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})}const Hs=ft("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"}}),Se=l.forwardRef(({className:e,variant:t,size:r,icon:n,children:o,...s},i)=>a.jsxs("div",{ref:i,className:O(Hs({variant:t,size:r}),e),...s,children:[n&&a.jsx("span",{className:"mr-1",children:n}),o]}));Se.displayName="Badge";const ir=l.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:O("rounded-md border bg-card text-card-foreground shadow-sm",e),...t}));ir.displayName="Card";const Us=l.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:O("flex flex-col space-y-1.5 p-6",e),...t}));Us.displayName="CardHeader";const Gs=l.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:O("font-semibold leading-none tracking-tight",e),...t}));Gs.displayName="CardTitle";const Ks=l.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:O("text-sm text-muted-foreground",e),...t}));Ks.displayName="CardDescription";const lr=l.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:O("p-6 pt-0",e),...t}));lr.displayName="CardContent";const qs=l.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:O("flex items-center p-6 pt-0",e),...t}));qs.displayName="CardFooter";const Ys=({countryCode:e,className:t=""})=>{const[r,n]=K.useState(null),[o,s]=K.useState(!1);return K.useEffect(()=>{if(!e)return;const c=`https://purecatamphetamine.github.io/country-flag-icons/3x2/${e.toUpperCase()}.svg`;fetch(c,{method:"HEAD"}).then(u=>{u.ok?(n(c),s(!1)):s(!0)}).catch(()=>{s(!0)})},[e]),o||!r?a.jsx("span",{className:t,children:e}):a.jsx("img",{src:r,alt:`${e} flag`,className:`inline-block ${t}`,style:{width:"24px",height:"auto"}})};function Xs({routes:e,footer:t,dashboardTitle:r}){const{appID:n}=fr.useParams(),o=e.filter(s=>s.showInNav);return a.jsxs(pn,{className:"border-r border-sidebar-border",children:[a.jsx(gn,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex items-center justify-center",children:a.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),a.jsx("span",{className:"font-semibold text-lg",children:r})]})}),a.jsx(mn,{className:"py-4 bg-sidebar text-sidebar-foreground",children:a.jsx(bn,{children:o.map(s=>{const i=s.icon,c=`/${s.path.replace(":appID",n)}`;return a.jsx(yn,{children:a.jsx(wn,{asChild:!0,children:a.jsxs(fr.Link,{to:c,className:"transition-colors hover:bg-muted px-6",children:[i&&a.jsx(i,{className:"h-4 w-4"}),a.jsx("span",{children:s.label})]})})},s.key)})})}),a.jsx(vn,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:t})]})}function cf({children:e,rightMenu:t,routes:r,footer:n,handleValidSearch:o,dashboardTitle:s,onSignOut:i,searchPlaceholder:c}){return a.jsx(a.Fragment,{children:a.jsx(fn,{children:a.jsxs("div",{className:"flex grow",children:[a.jsx(Xs,{routes:r,footer:n,dashboardTitle:s}),a.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[a.jsx(js,{onSignOut:i,rightMenu:t,handleValidSearch:o,searchPlaceholder:c}),a.jsx("main",{className:"flex-1 overflow-auto mt-16",children:e}),a.jsx(Vs,{})]})]})})})}const df={sm:100,md:200,lg:300,xl:400};function Qs({randmarSKU:e,size:t="md",alt:r,secondaryContent:n}){const[o,s]=l.useState(!1),[i,c]=l.useState(!1),[u,d]=l.useState(!1),[p,h]=l.useState(!1),m=`https://api.randmar.io/Product/${e}/Video`;l.useEffect(()=>{(async()=>{try{const x=await(await fetch(m+"/Exists")).json();c(x)}catch(w){console.error("Error checking for video:",w),c(!1)}})()},[e,m]);async function v(){if(i){h(!0);try{const w=await(await fetch(m)).blob(),x=window.URL.createObjectURL(w),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(b){console.error("Error downloading video:",b)}finally{h(!1)}}}function y(){navigator.clipboard.writeText(m),d(!0),setTimeout(()=>{d(!1)},2e3)}function f(){s(!0)}const g=df[t||"xl"];return a.jsxs(a.Fragment,{children:[a.jsx(dt,{open:o,onOpenChange:s,children:a.jsx(ut,{className:"max-w-4xl p-0 overflow-hidden",children:n?a.jsxs("div",{className:"flex flex-row",children:[a.jsxs("video",{className:"w-full rounded-l-lg max-h-[720px] object-contain",controls:!0,autoPlay:!0,muted:!0,loop:!0,children:[a.jsx("source",{src:m,type:"video/mp4"}),"Your browser does not support the video tag."]}),a.jsx("div",{className:"flex-grow min-w-[400px] h-[70vh] p-6",children:n})]}):a.jsxs("div",{className:"w-full relative",children:[a.jsxs("video",{className:"w-full max-h-[720px] object-contain",controls:!0,autoPlay:!0,children:[a.jsx("source",{src:m,type:"video/mp4"}),"Your browser does not support the video tag."]}),a.jsxs("div",{className:"absolute top-2 right-12 flex gap-1",children:[a.jsx(ot,{children:a.jsxs(at,{children:[a.jsx(st,{asChild:!0,children:a.jsx(oe,{variant:"secondary",size:"icon",onClick:y,children:u?a.jsx(Kn,{className:"h-4 w-4"}):a.jsx(vi,{className:"h-4 w-4"})})}),a.jsx(Ve,{children:a.jsx("p",{children:"Copy video link"})})]})}),a.jsx(ot,{children:a.jsxs(at,{children:[a.jsx(st,{asChild:!0,children:a.jsx(oe,{variant:"secondary",size:"icon",onClick:v,disabled:p,children:a.jsx(mi,{className:"h-4 w-4"})})}),a.jsx(Ve,{children:a.jsx("p",{children:"Download video"})})]})})]})]})})}),a.jsxs("div",{className:"relative w-max h-max",children:[a.jsx("img",{alt:r||`Product ${e}`,className:`rounded-md ${i?"cursor-pointer":""}`,onClick:i?f:void 0,src:`https://api.randmar.io/Product/${e}/Image?width=${g*1.5}&height=${g*1.5}`,width:g,height:g}),i&&a.jsx(ot,{children:a.jsxs(at,{children:[a.jsx(st,{asChild:!0,children:a.jsx(oe,{variant:"secondary",size:"icon",className:"absolute top-2 right-2",onClick:f,children:a.jsx(Ci,{className:"h-4 w-4"})})}),a.jsx(Ve,{children:a.jsx("p",{children:"Play video"})})]})})]})]})}function uf({inventory:e}){const t=["MTL","TOR"],r=["VAN","EDM"],n=[...e].sort((f,g)=>(f.Name||"").localeCompare(g.Name||"")),o=n.filter(f=>f.Country==="US"),s=n.filter(f=>f.Country==="CA"),i=n.filter(f=>r.includes(f.WarehouseId||"")),c=n.filter(f=>t.includes(f.WarehouseId||"")),u=s.filter(f=>!t.includes(f.WarehouseId||"")&&!r.includes(f.WarehouseId||"")),d=f=>f.reduce((g,b)=>g+(b.AvailableQuantity||0),0),p=d(s),h=d(c),m=d(i),v=d(o),y=p+v;return a.jsxs("div",{className:"border rounded-md overflow-hidden",children:[s.length>0&&o.length>0&&a.jsxs("div",{className:"grid grid-cols-2 border-b",children:[a.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[a.jsx("span",{children:"Total"}),a.jsx("span",{children:y})]}),a.jsx("div",{className:"p-3"})]}),s.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-2 border-b bg-gray-50",children:[a.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[a.jsx("span",{children:"Canada"}),a.jsx("span",{children:p})]}),a.jsx("div",{className:"p-3"})]}),a.jsxs("div",{className:"grid grid-cols-2",children:[a.jsxs("div",{className:"border-r",children:[a.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[a.jsx("span",{children:"West"}),a.jsx("span",{children:m})]}),i.map((f,g)=>a.jsxs("div",{className:`p-3 text-sm ${g>0?"border-t":""}`,children:[a.jsxs("div",{className:"flex justify-between font-medium",children:[a.jsx("span",{children:f.Name}),a.jsx("span",{children:f.AvailableQuantity})]}),a.jsxs("div",{className:"flex justify-between mt-1 text-xs text-gray-600",children:[a.jsx("span",{children:"Expecting"}),a.jsx("span",{children:f.PurchaseOrderQuantity||"-"})]})]},`west-${g}`))]}),a.jsxs("div",{children:[a.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[a.jsx("span",{children:"East"}),a.jsx("span",{children:h})]}),c.map((f,g)=>a.jsxs("div",{className:`p-3 text-sm ${g>0?"border-t":""}`,children:[a.jsxs("div",{className:"flex justify-between font-medium",children:[a.jsx("span",{children:f.Name}),a.jsx("span",{children:f.AvailableQuantity})]}),a.jsxs("div",{className:"flex justify-between mt-1 text-xs text-gray-600",children:[a.jsx("span",{children:"Expecting"}),a.jsx("span",{children:f.PurchaseOrderQuantity||"-"})]})]},`east-${g}`))]})]}),u.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"border-t p-3 font-semibold text-sm",children:a.jsx("span",{children:"Other"})}),a.jsx("div",{className:"grid grid-cols-2",children:u.map((f,g)=>a.jsxs("div",{className:`p-3 text-sm border-t ${g%2===0?"border-r":""}`,children:[a.jsxs("div",{className:"flex justify-between font-medium",children:[a.jsx("span",{children:f.Name}),a.jsx("span",{children:f.AvailableQuantity})]}),a.jsxs("div",{className:"flex justify-between mt-1 text-xs text-gray-600",children:[a.jsx("span",{children:"Expecting"}),a.jsx("span",{children:f.PurchaseOrderQuantity||"-"})]})]},`other-${g}`))})]})]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-2 border-t bg-gray-50",children:[a.jsxs("div",{className:"p-3 font-semibold text-sm flex justify-between",children:[a.jsx("span",{children:"United States"}),a.jsx("span",{children:v})]}),a.jsx("div",{className:"p-3"})]}),a.jsx("div",{className:"grid grid-cols-2",children:o.map((f,g)=>a.jsxs("div",{className:`p-3 text-sm border-t ${g%2===0?"border-r":""}`,children:[a.jsxs("div",{className:"flex justify-between font-medium",children:[a.jsx("span",{children:f.Name}),a.jsx("span",{children:f.AvailableQuantity})]}),a.jsxs("div",{className:"flex justify-between mt-1 text-xs text-gray-600",children:[a.jsx("span",{children:"Expecting"}),a.jsx("span",{children:f.PurchaseOrderQuantity||"-"})]})]},`usa-${g}`))})]}),e.length===0&&a.jsx("div",{className:"p-6 text-center text-gray-500",children:"No inventory information available"})]})}function ff({item:e,addToCart:t=!1,syncToShopify:r=!1,defaultOpportunityNumber:n="",viewProductAction:o,addToCartAction:s,isAddToCartActionLoading:i=!1,syncToShopifyAction:c,isSyncToShopifyActionLoading:u=!1}){var k,U,D,F,Z,ee,ae,te,ne;const[d,p]=K.useState(1),[h,m]=K.useState(null),[v,y]=K.useState(0),[f,g]=K.useState(!1),b=((k=e==null?void 0:e.Distribution)==null?void 0:k.RegularPrice)||0,w=((U=e==null?void 0:e.Distribution)==null?void 0:U.Price)||0,[x,N]=K.useState(null),[S,C]=K.useState(!1);if(K.useEffect(()=>{const L=async()=>{if(e!=null&&e.ManufacturerId){C(!0);try{const Y=await fetch(`https://api.randmar.io/V4/Partner/${e.ManufacturerId}/Account/Logo?width=60&height=40`);if(Y.ok){const se=await Y.blob();N(URL.createObjectURL(se))}}catch(Y){console.error("Failed to load logo:",Y)}finally{C(!1)}}};e!=null&&e.ManufacturerId&&L()},[e==null?void 0:e.ManufacturerId]),K.useEffect(()=>{var L;if(e&&n){const Y=(L=e.Opportunities)==null?void 0:L.find(se=>se.BidNumber==n);Y&&m(Y)}},[e,n]),K.useEffect(()=>{if(!e)return;const L=h!=null&&h.Price?h.Price:w;y(b>0?Math.round((b-L)/b*100):0)},[e,h,w,b]),K.useEffect(()=>{i||p(1)},[i]),!e)return a.jsx(ir,{className:"hover:shadow-lg transition-shadow",children:a.jsxs(lr,{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-start mb-3",children:[a.jsx(X,{className:"h-7 w-3/4"}),a.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:a.jsx(X,{className:"h-10 w-24 rounded-md"})})]}),a.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[a.jsx(X,{className:"h-6 w-20 rounded-full"}),a.jsx(X,{className:"h-6 w-24 rounded-full"}),a.jsx(X,{className:"h-6 w-28 rounded-full"})]}),a.jsxs("div",{className:"flex gap-6",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[a.jsxs("div",{children:[a.jsx(X,{className:"h-4 w-12 mb-1"}),a.jsx(X,{className:"h-5 w-20"})]}),a.jsxs("div",{children:[a.jsx(X,{className:"h-4 w-12 mb-1"}),a.jsx(X,{className:"h-5 w-24"})]}),a.jsxs("div",{children:[a.jsx(X,{className:"h-4 w-20 mb-1"}),a.jsx(X,{className:"h-5 w-16"})]}),a.jsxs("div",{children:[a.jsx(X,{className:"h-4 w-12 mb-1"}),a.jsx(X,{className:"h-5 w-20"})]})]}),a.jsx("div",{className:"flex flex-col",children:a.jsx("div",{className:"w-60 h-40",children:a.jsx(X,{className:"w-full h-full rounded-lg"})})})]}),a.jsxs("div",{className:"flex gap-6 mt-4",children:[a.jsx("div",{className:"flex flex-1",children:a.jsxs("div",{className:"w-full",children:[a.jsx(X,{className:"h-4 w-24 mb-3"}),a.jsx(X,{className:"h-16 w-full rounded-md"})]})}),a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx(X,{className:"h-10 w-32 rounded-md"}),a.jsx(X,{className:"h-5 w-24 mt-4"})]})]}),a.jsxs("div",{className:"flex gap-6 mt-4",children:[a.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[a.jsx(X,{className:"h-8 w-32"}),a.jsx(X,{className:"h-6 w-24"})]}),a.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[a.jsx(X,{className:"h-10 w-24 rounded-md"}),a.jsx(X,{className:"h-10 flex-1 rounded-md"})]})]})]})});const T=(e==null?void 0:e.Opportunities)||[],B=T.length>0,I=()=>{if(d==null){p(1);return}d>1&&p(d-1)},W=()=>{if(d==null){p(1);return}p(d+1)},G=L=>{const Y=parseInt(L.target.value,10);if(!isNaN(Y)&&Y>0){p(Y);return}p(void 0)},V=()=>{(d==null||d<1)&&p(1)},_=((F=(D=e.Distribution)==null?void 0:D.Inventory)==null?void 0:F.reduce((L,Y)=>L+(Y.AvailableQuantity||0),0))||0,P=L=>{try{return new Date(L).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(Y){return console.error(Y),L.split("T")[0]||"N/A"}},j=()=>{s&&s({quantity:d??1,bidNumber:(h==null?void 0:h.BidNumber)??null})};return a.jsx(ir,{className:"hover:shadow-lg transition-shadow",children:a.jsxs(lr,{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-start mb-3",children:[a.jsx("h3",{className:"font-semibold text-xl",children:e.Title||e.RandmarTitle}),a.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:S?a.jsx(X,{className:"h-10 w-24 rounded-md"}):x&&a.jsx("img",{src:x||"/placeholder.svg",alt:e.ManufacturerName,className:"max-h-10 max-w-24 object-contain"})})]}),a.jsxs("div",{className:"flex gap-6",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.State&&a.jsxs(Se,{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:[a.jsx(Kn,{size:"12",className:"mr-1.5"})," ",e.State]}),a.jsxs(Se,{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:[a.jsx(Si,{size:"12",className:"mr-1.5"})," ",e.SerialNumber?"Serialized":"Unserialized"]}),e.TransparencyCode&&a.jsxs(Se,{variant:"outline",className:"rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50",children:[a.jsx(gi,{size:"12",className:"mr-1.5"})," Transparency Code"]}),a.jsxs(Se,{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:[a.jsx(Pi,{size:"12",className:"mr-1.5"})," ",(Z=e.ManufacturerCategory)!=null&&Z.QualificationRequired?e.AvailableToBuy?"Qualified":"Not Qualified":"No Qualification Required"]}),e.ManufacturerId&&a.jsxs(Se,{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:[a.jsx(Ei,{size:"12",className:"mr-1.5"})," ",e.AutoUpdate?`Automatic Reorder (${e.MasterCarton})`:"Manually Reorders"]}),a.jsxs(Se,{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:[a.jsx(Ai,{size:"12",className:"mr-1.5"})," ",e.BodyHTML&&e.Title&&e.MAP?"Shopify Ready":"Not Shopify Ready"]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 flex-1",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),a.jsx("div",{className:"font-medium",children:e.MPN||"N/A"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),a.jsx("div",{className:"font-medium",children:e.UPC||"N/A"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),a.jsx("div",{className:"font-medium",children:e.UnitWeight?`${e.UnitWeight} lbs`:"N/A"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"MAP"}),a.jsx("div",{className:"font-medium",children:e.MAP?"$"+e.MAP.toFixed(2):"N/A"})]}),e.CountryCodeOfOrigin&&a.jsxs("div",{children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"Origin"}),a.jsxs("div",{className:"font-medium flex items-center",children:[a.jsx(Ys,{countryCode:e.CountryCodeOfOrigin,className:"mr-2"}),e.CountryCodeOfOrigin]})]})]})]}),a.jsx("div",{className:"flex flex-col",children:a.jsx(Qs,{randmarSKU:e.RandmarSKU||"",alt:e.RandmarTitle||""})})]}),a.jsxs("div",{className:"flex gap-6 mt-4",children:[a.jsx("div",{className:"flex flex-1",children:B&&e.Distribution&&a.jsxs("div",{className:"w-full",children:[a.jsx("div",{className:"flex items-center",children:"You have "+T.length+(T.length>1?" opportunities":" opportunity")+" for this product:"}),a.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1",children:T.map((L,Y)=>{var se;return a.jsxs("div",{className:`flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted
|
|
185
185
|
${L.BidNumber==(h==null?void 0:h.BidNumber)?"cursor-pointer border-2 border-purple-900":L.Active?"hover:bg-purple-200 cursor-pointer":"!bg-neutral-50"}
|
|
186
|
-
`,onClick:()=>{L.Active===!0&&m(L.BidNumber!=(h==null?void 0:h.BidNumber)?L:null)},children:[a.jsx("div",{className:"flex items-center",children:a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"font-medium text-sm",children:L.Opportunity}),a.jsx("span",{className:"text-xs text-neutral-900",children:L.BidNumber})]})}),a.jsxs("div",{className:"flex flex-col items-end",children:[a.jsxs("span",{className:"font-semibold",children:["$",(se=L.Price)==null?void 0:se.toFixed(2)]}),L.Rebate&&L.Rebate>0&&a.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: $",L.Rebate.toFixed(2)]}),L.EndDate&&a.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",P(L.EndDate)]}),!L.Active&&a.jsx(Se,{variant:"outline",className:"text-xs px-2 py-0 h-5 mt-1 bg-gray-100",children:"Inactive"})]})]},Y)})})]})}),a.jsxs("div",{className:"flex flex-col items-center",children:[o&&a.jsxs(oe,{variant:"secondary",onClick:o,children:[a.jsx(bi,{className:"mr-2"}),"View Product"]}),((ee=e.Distribution)==null?void 0:ee.Inventory)&&a.jsx("div",{className:"mt-4",children:a.jsxs(dt,{open:f,onOpenChange:g,children:[a.jsx(Fr,{asChild:!0,children:a.jsxs(oe,{variant:"ghost",className:`flex items-center text-sm ${_>0?"text-green-700":"text-red-700"}`,children:[a.jsx(Xn,{size:"16",className:"mr-2"}),_>0?a.jsxs(a.Fragment,{children:[_," in stock"]}):a.jsx(a.Fragment,{children:"Out of stock"})]})}),a.jsxs(ut,{className:"
|
|
186
|
+
`,onClick:()=>{L.Active===!0&&m(L.BidNumber!=(h==null?void 0:h.BidNumber)?L:null)},children:[a.jsx("div",{className:"flex items-center",children:a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"font-medium text-sm",children:L.Opportunity}),a.jsx("span",{className:"text-xs text-neutral-900",children:L.BidNumber})]})}),a.jsxs("div",{className:"flex flex-col items-end",children:[a.jsxs("span",{className:"font-semibold",children:["$",(se=L.Price)==null?void 0:se.toFixed(2)]}),L.Rebate&&L.Rebate>0&&a.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: $",L.Rebate.toFixed(2)]}),L.EndDate&&a.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",P(L.EndDate)]}),!L.Active&&a.jsx(Se,{variant:"outline",className:"text-xs px-2 py-0 h-5 mt-1 bg-gray-100",children:"Inactive"})]})]},Y)})})]})}),a.jsxs("div",{className:"flex flex-col items-center",children:[o&&a.jsxs(oe,{variant:"secondary",onClick:o,children:[a.jsx(bi,{className:"mr-2"}),"View Product"]}),((ee=e.Distribution)==null?void 0:ee.Inventory)&&a.jsx("div",{className:"mt-4",children:a.jsxs(dt,{open:f,onOpenChange:g,children:[a.jsx(Fr,{asChild:!0,children:a.jsxs(oe,{variant:"ghost",className:`flex items-center text-sm ${_>0?"text-green-700":"text-red-700"}`,children:[a.jsx(Xn,{size:"16",className:"mr-2"}),_>0?a.jsxs(a.Fragment,{children:[_," in stock"]}):a.jsx(a.Fragment,{children:"Out of stock"})]})}),a.jsxs(ut,{className:"max-w-4xl",children:[a.jsx(Wt,{children:a.jsxs(Vt,{className:"flex items-center",children:[a.jsx(Xn,{className:"mr-2",size:18}),"Inventory Information"]})}),a.jsx(uf,{inventory:e.Distribution.Inventory})]})]})})]})]}),e.Distribution&&a.jsxs("div",{className:"flex justify-between items-end mt-4",children:[a.jsxs("div",{className:"flex-shrink-1 flex flex-col items-start gap-1",children:[a.jsxs("div",{className:"flex items-center flex-wrap",children:[a.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:[a.jsx("span",{children:"$"}),h?(te=(ae=e.Opportunities)==null?void 0:ae.find(L=>L.BidNumber==h.BidNumber))==null?void 0:te.Price:w.toFixed(2),a.jsx("span",{children:" CAD"})]}),v>0&&a.jsxs("span",{className:"text-muted-foreground line-through ml-2 whitespace-nowrap",children:["$",b.toFixed(2)]})]}),v>0&&a.jsx("div",{className:"flex items-center",children:a.jsxs(Se,{variant:"outline",className:"bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap",children:[a.jsxs("span",{children:[v,"% OFF"]}),((ne=e.InstantRebate)==null?void 0:ne.EndDate)&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",e.InstantRebate.EndDate.split("T")[0]]}),(h==null?void 0:h.EndDate)&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",h.EndDate.split("T")[0]]})]})})]}),a.jsxs("div",{className:"flex flex-shrink-0 gap-2 ml-4",children:[typeof t<"u"&&t&&a.jsxs("div",{className:"flex items-center border rounded-md",children:[a.jsx(oe,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:I,disabled:typeof d<"u"&&(d<=1||!e.AvailableToBuy||i||!s),children:"-"}),a.jsx("input",{value:d,onChange:G,onBlur:V,onClick:L=>L.currentTarget.select(),className:`w-12 text-center border-0 focus:ring-0 focus:outline-none ${!e.AvailableToBuy||i||!s?"text-gray-400":""}`,disabled:!e.AvailableToBuy||i||!s}),a.jsx(oe,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:W,disabled:!e.AvailableToBuy||i||!s,children:"+"})]}),typeof t<"u"&&t&&a.jsx(oe,{className:"gap-2 whitespace-nowrap",onClick:j,disabled:!e.AvailableToBuy||i||!s,children:i?a.jsxs(a.Fragment,{children:[a.jsx(qn,{className:"h-4 w-4 animate-spin"}),"Adding..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Yn,{className:"mr-2"}),"Add to Cart"]})}),r&&a.jsx(oe,{className:"gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",onClick:c,disabled:u||!c,children:u?a.jsxs(a.Fragment,{children:[a.jsx(qn,{className:"h-4 w-4 animate-spin"}),"Syncing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Yn,{className:"mr-2"}),"Sync to Shopify"]})})]})]})]})})}E.AvatarFooter=Pu,E.Badge=Se,E.Button=oe,E.Card=ir,E.CardContent=lr,E.CardDescription=Ks,E.CardFooter=qs,E.CardHeader=Us,E.CardTitle=Gs,E.CountryFlag=Ys,E.Dialog=dt,E.DialogClose=zr,E.DialogContent=ut,E.DialogDescription=Vr,E.DialogFooter=Wr,E.DialogHeader=Wt,E.DialogOverlay=Br,E.DialogPortal=oa,E.DialogTitle=Vt,E.DialogTrigger=Fr,E.Input=tr,E.InputOTP=vl,E.InputOTPGroup=ml,E.InputOTPSeparator=yl,E.InputOTPSlot=bl,E.Label=ku,E.Layout=cf,E.Navbar=Xs,E.ProductCard=ff,E.ProductImage=Qs,E.Separator=ln,E.Sheet=Ya,E.SheetClose=Eu,E.SheetContent=dn,E.SheetDescription=Ra,E.SheetFooter=Za,E.SheetHeader=Qa,E.SheetOverlay=cn,E.SheetPortal=Xa,E.SheetTitle=Ja,E.SheetTrigger=Su,E.Sidebar=pn,E.SidebarContent=mn,E.SidebarFooter=vn,E.SidebarGroup=is,E.SidebarGroupAction=cs,E.SidebarGroupContent=ds,E.SidebarGroupLabel=ls,E.SidebarHeader=gn,E.SidebarInput=as,E.SidebarInset=os,E.SidebarMenu=bn,E.SidebarMenuAction=us,E.SidebarMenuBadge=fs,E.SidebarMenuButton=wn,E.SidebarMenuItem=yn,E.SidebarMenuSkeleton=ps,E.SidebarMenuSub=hs,E.SidebarMenuSubButton=vs,E.SidebarMenuSubItem=gs,E.SidebarProvider=fn,E.SidebarRail=ns,E.SidebarSeparator=ss,E.SidebarTrigger=hn,E.Skeleton=X,E.Toast=Mn,E.ToastAction=zs,E.ToastClose=kn,E.ToastDescription=Dn,E.ToastProvider=Fs,E.ToastTitle=On,E.ToastViewport=An,E.Toaster=Vs,E.Tooltip=at,E.TooltipContent=Ve,E.TooltipProvider=ot,E.TooltipTrigger=st,E.Topbar=js,E.badgeVariants=Hs,E.buttonVariants=jr,E.toast=Ws,E.useIsMobile=ts,E.useSidebar=mt,E.useToast=Ln,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|