randmarcomps 1.159.0 → 1.161.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.
@@ -46,6 +46,7 @@ export declare function AiGeneratedContent(props: AiGeneratedContentProps): JSX.
46
46
  export declare interface AiGeneratedContentProps {
47
47
  prompt: string;
48
48
  data: any;
49
+ smartAndSlow?: boolean;
49
50
  }
50
51
 
51
52
  declare interface ApiKeyContextType {
@@ -59666,12 +59666,12 @@ const complexComponents = [
59666
59666
  '<Tabs defaultValue="eg1"> <TabsList> <TabsTrigger value="eg1">Example1</TabsTrigger> <TabsTrigger value="eg2">Example2</TabsTrigger> </TabsList> <TabsContent value="eg1"> ... </TabsContent> <TabsContent value="eg2"> ... </TabsContent> </Tabs>',
59667
59667
  "<ScrollArea>...</ScrollArea>",
59668
59668
  "<ScrollArea orientation='horizontal'>...</ScrollArea>"
59669
- ], GetJSXFromAI = async (e, t, n, o = 3) => {
59670
- const l = "In addition to basic html tags, You have access to these beautiful Handmade Components:", u = "You also have access to these few Shadcn UI components:", d = "Here is the data to display to the user (If a Handmade Component is a good fit for the data, use it. Otherwise, use regular html tags) (You have access to this data object in React via the data variable):", f = "Only output a single JSX code snippet. Start with <> and end with </>. All other code will be ignored, so make sure to place all CSS styles inline. Use CSS flex layouts when there is a lot of stuff to display.", p = JSON.stringify(n), m = [t, l, ...complexComponents, u, ...basicComponents, f, d, p, f].join(`\r
59671
- `), _ = await new GoogleGenAI({ apiKey: e }).chats.create({
59672
- model: "gemini-2.0-flash-lite"
59673
- }).sendMessage({ message: m }), S = trimJSXString(_.text ?? "");
59674
- return S || (o == 0 ? "<p>Failed to generate. Reload the page.</p>" : await GetJSXFromAI(e, t, n, o - 1));
59669
+ ], GetJSXFromAI = async (e, t, n, o, l = 3) => {
59670
+ const u = "In addition to basic html tags, You have access to these beautiful Handmade Components:", d = "You also have access to these few Shadcn UI components:", f = "Here is the data to display to the user (If a Handmade Component is a good fit for the data, use it. Otherwise, use regular html tags) (You have access to this data object in React via the data variable):", p = "Only output a single JSX code snippet. Start with <> and end with </>. All other code will be ignored, so make sure to place all CSS styles inline. Use CSS flex layouts when there is a lot of stuff to display.", m = JSON.stringify(n), g = [t, u, ...complexComponents, d, ...basicComponents, p, f, m, p].join(`\r
59671
+ `), S = await new GoogleGenAI({ apiKey: e }).chats.create({
59672
+ model: o ? "gemini-2.5-pro-preview-03-25" : "gemini-2.0-flash-lite"
59673
+ }).sendMessage({ message: g }), T = trimJSXString(S.text ?? "");
59674
+ return T || (l == 0 ? "<p>Failed to generate. Reload the page.</p>" : await GetJSXFromAI(e, t, n, o, l - 1));
59675
59675
  };
59676
59676
  function trimJSXString(e) {
59677
59677
  const t = e.indexOf("<"), n = e.lastIndexOf("</");
@@ -59683,12 +59683,12 @@ function AiGeneratedContent(e) {
59683
59683
  if (!o || !e.prompt || !e.data) return;
59684
59684
  n("");
59685
59685
  let l = !1;
59686
- return GetJSXFromAI(o, e.prompt, e.data).then((u) => {
59686
+ return GetJSXFromAI(o, e.prompt, e.data, e.smartAndSlow === !0).then((u) => {
59687
59687
  l || n(u);
59688
59688
  }), () => {
59689
59689
  l = !0;
59690
59690
  };
59691
- }, [e.prompt, e.data, n, o]), t ? /* @__PURE__ */ jsx(
59691
+ }, [e.prompt, e.data, n, o, e.smartAndSlow]), t ? /* @__PURE__ */ jsx(
59692
59692
  source_default,
59693
59693
  {
59694
59694
  bindings: {
@@ -887,5 +887,5 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
887
887
  Use both <PartnerCard account={data} action={<></>}> and <ManufacturerCard manufacturer={data.Manufacturer}>`,`----
888
888
  ProductCard, for data that fits this shape:
889
889
  { "RandmarSKU": "3007864", "RandmarTitle": "CTTN450 COMPATIBLE TN450 TONER", "Category": "CT", "UnitWeight": 1.5500, "UPC": "628277000035", "ManufacturerName": "Balloon Brand", "ProductType": "Toners", "AutoUpdate": 1, "CreatedBy": "", "LastMaintainedDate": 20190314.0, "Title": "CTTN450 COMPATIBLE TN450 TONER", "BodyHTML": "<p>CTTN450 COMPATIBLE TN450 TONER</p>", "MAP": 17.5500, "ManufacturerId": "90200", "State": "Active", "MPN": "CTTN450", "MasterCarton": 12, "SkidQuantity": null, "SerialNumber": true, "OpportunityOnly": false, "VoiceoverCaption": "example...", "SceneName": "Top of Clouds", "Require3DScan": false, "TransparencyCode": false, "CountryCodeOfOrigin": null, "UnitLength": null, "UnitWidth": null, "UnitHeight": null, "Distribution": { "Price": 14.29, "RegularPrice": 14.29, "MAP": 17.55, "Currency": "CAD", "ExchangeRate": 1.000000000, "Inventory": [ { "RandmarSKU": "3007864", "WarehouseId": "EDM", "WarehouseType": "Fulfillment Center", "Name": "Randmar Edmonton", "City": "Edmonton", "Province": "AB", "Country": "CA", "AvailableQuantity": 7, "PurchaseOrderQuantity": 0, "BinLocation": "" }, { "RandmarSKU": "3007864", "WarehouseId": "MTL", "WarehouseType": "Fulfillment Center", "Name": "Randmar Montreal", "City": "Pierrefonds", "Province": "QC", "Country": "CA", "AvailableQuantity": 45, "PurchaseOrderQuantity": 0, "BinLocation": "C3EB" }, { "RandmarSKU": "3007864", "WarehouseId": "TOR", "WarehouseType": "Fulfillment Center", "Name": "Randmar Toronto", "City": "Mississauga", "Province": "ON", "Country": "CA", "AvailableQuantity": 15, "PurchaseOrderQuantity": 0, "BinLocation": "A6A" }, { "RandmarSKU": "3007864", "WarehouseId": "VAN", "WarehouseType": "Fulfillment Center", "Name": "Randmar Vancouver", "City": "Richmond", "Province": "BC", "Country": "CA", "AvailableQuantity": 8, "PurchaseOrderQuantity": 0, "BinLocation": "" } ] }, "ManufacturerCategory": { "ManufacturerId": "90200", "CategoryCode": "CT", "CategoryName": "Toners", "Starred": false, "AutoReorder": true, "QualificationRequired": false, "Niche": "Print" }, "InstantRebate": null, "Opportunities": null, "AvailableToBuy": true }
890
- Use <ProductCard item={data}>`],basicComponents=["<Card> <CardHeader> <CardTitle>...</CardTitle> <CardDescription>...</CardDescription> </CardHeader> <CardContent> ... </CardContent> </Card>","<Badge>...</Badge>",'<Tabs defaultValue="eg1"> <TabsList> <TabsTrigger value="eg1">Example1</TabsTrigger> <TabsTrigger value="eg2">Example2</TabsTrigger> </TabsList> <TabsContent value="eg1"> ... </TabsContent> <TabsContent value="eg2"> ... </TabsContent> </Tabs>',"<ScrollArea>...</ScrollArea>","<ScrollArea orientation='horizontal'>...</ScrollArea>"],GetJSXFromAI=async(e,t,n,o=3)=>{const l="In addition to basic html tags, You have access to these beautiful Handmade Components:",u="You also have access to these few Shadcn UI components:",p="Here is the data to display to the user (If a Handmade Component is a good fit for the data, use it. Otherwise, use regular html tags) (You have access to this data object in React via the data variable):",d="Only output a single JSX code snippet. Start with <> and end with </>. All other code will be ignored, so make sure to place all CSS styles inline. Use CSS flex layouts when there is a lot of stuff to display.",f=JSON.stringify(n),m=[t,l,...complexComponents,u,...basicComponents,d,p,f,d].join(`\r
891
- `),_=await new GoogleGenAI({apiKey:e}).chats.create({model:"gemini-2.0-flash-lite"}).sendMessage({message:m}),S=trimJSXString(_.text??"");return S||(o==0?"<p>Failed to generate. Reload the page.</p>":await GetJSXFromAI(e,t,n,o-1))};function trimJSXString(e){const t=e.indexOf("<"),n=e.lastIndexOf("</");return t===-1||n===-1?"":e.slice(t,e.indexOf(">",n)+1)}function AiGeneratedContent(e){const[t,n]=React.useState(""),{apiKey:o}=useApiKey();return React.useEffect(()=>{if(!o||!e.prompt||!e.data)return;n("");let l=!1;return GetJSXFromAI(o,e.prompt,e.data).then(u=>{l||n(u)}),()=>{l=!0}},[e.prompt,e.data,n,o]),t?jsxRuntime.jsx(source_default,{bindings:{data:e.data},components:{ResellerCard,ManufacturerCard,PartnerCard,ProductCard,Card,CardHeader,CardTitle,CardContent,CardDescription,Badge,Tabs,TabsList,TabsContent,TabsTrigger,ScrollArea},jsx:t}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(Skeleton,{className:"h-32 w-32",children:jsxRuntime.jsx(Bot,{className:"m-auto align-middle h-full"})})})}function GeneralDocumentCard({document:e,loading:t=!1}){return t?jsxRuntime.jsx("div",{children:"loading..."}):jsxRuntime.jsxs("div",{children:["GENERAL DOCUMENT CARD - ",e==null?void 0:e.OrderNumber," for P.O. ",e==null?void 0:e.PONumber]})}const Navbar=React.forwardRef(({routes:e,footer:t,dashboardTitle:n,withRandmarAssistant:o,chatUserName:l,chatApiKey:u},p)=>{const{appID:d}=reactRouterDom.useParams(),f=e.filter(_=>_.showInNav),m=React.useRef(null),g=React.useRef(null),b=React.useRef(null);return React.useImperativeHandle(p,()=>({setActiveChatAndSendMessage:(_,S)=>{var E;return(E=b.current)==null||E.click(),setTimeout(()=>{var C;(C=m.current)==null||C.focus(),g.current&&g.current.setActiveChatAndSendMessage(_,S)},100),!0}})),jsxRuntime.jsxs(Sidebar,{className:"border-r border-sidebar-border",children:[jsxRuntime.jsx(SidebarHeader,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center",children:jsxRuntime.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),jsxRuntime.jsx("span",{className:"font-semibold text-lg",children:n})]})}),jsxRuntime.jsx(SidebarContent,{className:"py-4 bg-sidebar text-sidebar-foreground",children:jsxRuntime.jsx(SidebarMenu,{children:f.map(_=>{const S=_.icon,E=`/${_.path.replace(":appID",d??"")}`;return jsxRuntime.jsx(SidebarMenuItem,{children:jsxRuntime.jsx(SidebarMenuButton,{asChild:!0,children:jsxRuntime.jsxs(reactRouterDom.Link,{to:E,className:"transition-colors hover:bg-muted px-6",children:[S&&jsxRuntime.jsx(S,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:_.label})]})})},_.key)})})}),jsxRuntime.jsxs(SidebarFooter,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:[o===!0&&jsxRuntime.jsxs(Dialog,{children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{ref:b,size:"lg",className:"collapse md:visible",onClick:()=>setTimeout(()=>{var _;return(_=m.current)==null?void 0:_.focus()},50),children:[jsxRuntime.jsx(Bot,{}),"Assistant"]})}),jsxRuntime.jsx(DialogContent,{className:"max-w-[85vw] p-0 data-[state=open]:visible data-[state=closed]:invisible",forceMount:!0,animateExit:!1,children:jsxRuntime.jsx(ChatLayout,{ref:g,inputRef:m,userId:d??"2",userName:l??"Unknown user",apiKey:u??""})})]}),t]})]})}),Layout=React.forwardRef(({children:e,rightMenu:t,routes:n,footer:o,handleValidSearch:l,dashboardTitle:u,onSignOut:p,searchPlaceholder:d,withRandmarAssistant:f,chatUserName:m,chatApiKey:g,chatRef:b},_)=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(SidebarProvider,{children:jsxRuntime.jsxs("div",{className:"flex grow",children:[jsxRuntime.jsx(Navbar,{routes:n,footer:o,dashboardTitle:u,withRandmarAssistant:f,chatUserName:m,chatApiKey:g,ref:b}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[jsxRuntime.jsx(Topbar,{ref:_,onSignOut:p,rightMenu:t,handleValidSearch:l,searchPlaceholder:d}),jsxRuntime.jsx("main",{className:"flex-1 overflow-auto mt-16",children:e}),jsxRuntime.jsx(Toaster,{})]})]})})}));Layout.displayName="Layout";function usePrevious(e){const t=React__namespace.useRef({value:e,previous:e});return React__namespace.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var OPEN_KEYS=[" ","Enter","ArrowUp","ArrowDown"],SELECTION_KEYS=[" ","Enter"],SELECT_NAME="Select",[Collection,useCollection,createCollectionScope]=createCollection(SELECT_NAME),[createSelectContext,createSelectScope]=createContextScope(SELECT_NAME,[createCollectionScope,createPopperScope]),usePopperScope=createPopperScope(),[SelectProvider,useSelectContext]=createSelectContext(SELECT_NAME),[SelectNativeOptionsProvider,useSelectNativeOptionsContext]=createSelectContext(SELECT_NAME),Select$1=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:l,onOpenChange:u,value:p,defaultValue:d,onValueChange:f,dir:m,name:g,autoComplete:b,disabled:_,required:S,form:E}=e,C=usePopperScope(t),[R,A]=React__namespace.useState(null),[N,O]=React__namespace.useState(null),[V,M]=React__namespace.useState(!1),I=useDirection(m),[j,B]=useControllableState({prop:o,defaultProp:l??!1,onChange:u,caller:SELECT_NAME}),[L,q]=useControllableState({prop:p,defaultProp:d,onChange:f,caller:SELECT_NAME}),F=React__namespace.useRef(null),H=R?E||!!R.closest("form"):!0,[U,G]=React__namespace.useState(new Set),J=Array.from(U).map(Z=>Z.props.value).join(";");return jsxRuntime.jsx(Root2$4,{...C,children:jsxRuntime.jsxs(SelectProvider,{required:S,scope:t,trigger:R,onTriggerChange:A,valueNode:N,onValueNodeChange:O,valueNodeHasChildren:V,onValueNodeHasChildrenChange:M,contentId:useId(),value:L,onValueChange:q,open:j,onOpenChange:B,dir:I,triggerPointerDownPosRef:F,disabled:_,children:[jsxRuntime.jsx(Collection.Provider,{scope:t,children:jsxRuntime.jsx(SelectNativeOptionsProvider,{scope:e.__scopeSelect,onNativeOptionAdd:React__namespace.useCallback(Z=>{G(ae=>new Set(ae).add(Z))},[]),onNativeOptionRemove:React__namespace.useCallback(Z=>{G(ae=>{const W=new Set(ae);return W.delete(Z),W})},[]),children:n})}),H?jsxRuntime.jsxs(SelectBubbleInput,{"aria-hidden":!0,required:S,tabIndex:-1,name:g,autoComplete:b,value:L,onChange:Z=>q(Z.target.value),disabled:_,form:E,children:[L===void 0?jsxRuntime.jsx("option",{value:""}):null,Array.from(U)]},J):null]})})};Select$1.displayName=SELECT_NAME;var TRIGGER_NAME="SelectTrigger",SelectTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...l}=e,u=usePopperScope(n),p=useSelectContext(TRIGGER_NAME,n),d=p.disabled||o,f=useComposedRefs(t,p.onTriggerChange),m=useCollection(n),g=React__namespace.useRef("touch"),[b,_,S]=useTypeaheadSearch(C=>{const R=m().filter(O=>!O.disabled),A=R.find(O=>O.value===p.value),N=findNextItem(R,C,A);N!==void 0&&p.onValueChange(N.value)}),E=C=>{d||(p.onOpenChange(!0),S()),C&&(p.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return jsxRuntime.jsx(Anchor,{asChild:!0,...u,children:jsxRuntime.jsx(Primitive.button,{type:"button",role:"combobox","aria-controls":p.contentId,"aria-expanded":p.open,"aria-required":p.required,"aria-autocomplete":"none",dir:p.dir,"data-state":p.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":shouldShowPlaceholder(p.value)?"":void 0,...l,ref:f,onClick:composeEventHandlers(l.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&E(C)}),onPointerDown:composeEventHandlers(l.onPointerDown,C=>{g.current=C.pointerType;const R=C.target;R.hasPointerCapture(C.pointerId)&&R.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(E(C),C.preventDefault())}),onKeyDown:composeEventHandlers(l.onKeyDown,C=>{const R=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&_(C.key),!(R&&C.key===" ")&&OPEN_KEYS.includes(C.key)&&(E(),C.preventDefault())})})})});SelectTrigger$1.displayName=TRIGGER_NAME;var VALUE_NAME="SelectValue",SelectValue$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:l,children:u,placeholder:p="",...d}=e,f=useSelectContext(VALUE_NAME,n),{onValueNodeHasChildrenChange:m}=f,g=u!==void 0,b=useComposedRefs(t,f.onValueNodeChange);return useLayoutEffect2(()=>{m(g)},[m,g]),jsxRuntime.jsx(Primitive.span,{...d,ref:b,style:{pointerEvents:"none"},children:shouldShowPlaceholder(f.value)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:p}):u})});SelectValue$1.displayName=VALUE_NAME;var ICON_NAME="SelectIcon",SelectIcon=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...l}=e;return jsxRuntime.jsx(Primitive.span,{"aria-hidden":!0,...l,ref:t,children:o||"▼"})});SelectIcon.displayName=ICON_NAME;var PORTAL_NAME="SelectPortal",SelectPortal=e=>jsxRuntime.jsx(Portal$4,{asChild:!0,...e});SelectPortal.displayName=PORTAL_NAME;var CONTENT_NAME="SelectContent",SelectContent$1=React__namespace.forwardRef((e,t)=>{const n=useSelectContext(CONTENT_NAME,e.__scopeSelect),[o,l]=React__namespace.useState();if(useLayoutEffect2(()=>{l(new DocumentFragment)},[]),!n.open){const u=o;return u?ReactDOM__namespace.createPortal(jsxRuntime.jsx(SelectContentProvider,{scope:e.__scopeSelect,children:jsxRuntime.jsx(Collection.Slot,{scope:e.__scopeSelect,children:jsxRuntime.jsx("div",{children:e.children})})}),u):null}return jsxRuntime.jsx(SelectContentImpl,{...e,ref:t})});SelectContent$1.displayName=CONTENT_NAME;var CONTENT_MARGIN=10,[SelectContentProvider,useSelectContentContext]=createSelectContext(CONTENT_NAME),CONTENT_IMPL_NAME="SelectContentImpl",Slot=createSlot("SelectContent.RemoveScroll"),SelectContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:p,side:d,sideOffset:f,align:m,alignOffset:g,arrowPadding:b,collisionBoundary:_,collisionPadding:S,sticky:E,hideWhenDetached:C,avoidCollisions:R,...A}=e,N=useSelectContext(CONTENT_NAME,n),[O,V]=React__namespace.useState(null),[M,I]=React__namespace.useState(null),j=useComposedRefs(t,he=>V(he)),[B,L]=React__namespace.useState(null),[q,F]=React__namespace.useState(null),H=useCollection(n),[U,G]=React__namespace.useState(!1),J=React__namespace.useRef(!1);React__namespace.useEffect(()=>{if(O)return hideOthers(O)},[O]),useFocusGuards();const Z=React__namespace.useCallback(he=>{const[ye,...de]=H().map(te=>te.ref.current),[le]=de.slice(-1),se=document.activeElement;for(const te of he)if(te===se||(te==null||te.scrollIntoView({block:"nearest"}),te===ye&&M&&(M.scrollTop=0),te===le&&M&&(M.scrollTop=M.scrollHeight),te==null||te.focus(),document.activeElement!==se))return},[H,M]),ae=React__namespace.useCallback(()=>Z([B,O]),[Z,B,O]);React__namespace.useEffect(()=>{U&&ae()},[U,ae]);const{onOpenChange:W,triggerPointerDownPosRef:Q}=N;React__namespace.useEffect(()=>{if(O){let he={x:0,y:0};const ye=le=>{var se,te;he={x:Math.abs(Math.round(le.pageX)-(((se=Q.current)==null?void 0:se.x)??0)),y:Math.abs(Math.round(le.pageY)-(((te=Q.current)==null?void 0:te.y)??0))}},de=le=>{he.x<=10&&he.y<=10?le.preventDefault():O.contains(le.target)||W(!1),document.removeEventListener("pointermove",ye),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",de,{capture:!0})}}},[O,W,Q]),React__namespace.useEffect(()=>{const he=()=>W(!1);return window.addEventListener("blur",he),window.addEventListener("resize",he),()=>{window.removeEventListener("blur",he),window.removeEventListener("resize",he)}},[W]);const[ee,ie]=useTypeaheadSearch(he=>{const ye=H().filter(se=>!se.disabled),de=ye.find(se=>se.ref.current===document.activeElement),le=findNextItem(ye,he,de);le&&setTimeout(()=>le.ref.current.focus())}),ce=React__namespace.useCallback((he,ye,de)=>{const le=!J.current&&!de;(N.value!==void 0&&N.value===ye||le)&&(L(he),le&&(J.current=!0))},[N.value]),ue=React__namespace.useCallback(()=>O==null?void 0:O.focus(),[O]),fe=React__namespace.useCallback((he,ye,de)=>{const le=!J.current&&!de;(N.value!==void 0&&N.value===ye||le)&&F(he)},[N.value]),pe=o==="popper"?SelectPopperPosition:SelectItemAlignedPosition,ve=pe===SelectPopperPosition?{side:d,sideOffset:f,align:m,alignOffset:g,arrowPadding:b,collisionBoundary:_,collisionPadding:S,sticky:E,hideWhenDetached:C,avoidCollisions:R}:{};return jsxRuntime.jsx(SelectContentProvider,{scope:n,content:O,viewport:M,onViewportChange:I,itemRefCallback:ce,selectedItem:B,onItemLeave:ue,itemTextRefCallback:fe,focusSelectedItem:ae,selectedItemText:q,position:o,isPositioned:U,searchRef:ee,children:jsxRuntime.jsx(ReactRemoveScroll,{as:Slot,allowPinchZoom:!0,children:jsxRuntime.jsx(FocusScope,{asChild:!0,trapped:N.open,onMountAutoFocus:he=>{he.preventDefault()},onUnmountAutoFocus:composeEventHandlers(l,he=>{var ye;(ye=N.trigger)==null||ye.focus({preventScroll:!0}),he.preventDefault()}),children:jsxRuntime.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:he=>he.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:jsxRuntime.jsx(pe,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:he=>he.preventDefault(),...A,...ve,onPlaced:()=>G(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:composeEventHandlers(A.onKeyDown,he=>{const ye=he.ctrlKey||he.altKey||he.metaKey;if(he.key==="Tab"&&he.preventDefault(),!ye&&he.key.length===1&&ie(he.key),["ArrowUp","ArrowDown","Home","End"].includes(he.key)){let le=H().filter(se=>!se.disabled).map(se=>se.ref.current);if(["ArrowUp","End"].includes(he.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(he.key)){const se=he.target,te=le.indexOf(se);le=le.slice(te+1)}setTimeout(()=>Z(le)),he.preventDefault()}})})})})})})});SelectContentImpl.displayName=CONTENT_IMPL_NAME;var ITEM_ALIGNED_POSITION_NAME="SelectItemAlignedPosition",SelectItemAlignedPosition=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...l}=e,u=useSelectContext(CONTENT_NAME,n),p=useSelectContentContext(CONTENT_NAME,n),[d,f]=React__namespace.useState(null),[m,g]=React__namespace.useState(null),b=useComposedRefs(t,j=>g(j)),_=useCollection(n),S=React__namespace.useRef(!1),E=React__namespace.useRef(!0),{viewport:C,selectedItem:R,selectedItemText:A,focusSelectedItem:N}=p,O=React__namespace.useCallback(()=>{if(u.trigger&&u.valueNode&&d&&m&&C&&R&&A){const j=u.trigger.getBoundingClientRect(),B=m.getBoundingClientRect(),L=u.valueNode.getBoundingClientRect(),q=A.getBoundingClientRect();if(u.dir!=="rtl"){const se=q.left-B.left,te=L.left-se,xe=j.left-te,oe=j.width+xe,be=Math.max(oe,B.width),_e=window.innerWidth-CONTENT_MARGIN,Ce=clamp(te,[CONTENT_MARGIN,Math.max(CONTENT_MARGIN,_e-be)]);d.style.minWidth=oe+"px",d.style.left=Ce+"px"}else{const se=B.right-q.right,te=window.innerWidth-L.right-se,xe=window.innerWidth-j.right-te,oe=j.width+xe,be=Math.max(oe,B.width),_e=window.innerWidth-CONTENT_MARGIN,Ce=clamp(te,[CONTENT_MARGIN,Math.max(CONTENT_MARGIN,_e-be)]);d.style.minWidth=oe+"px",d.style.right=Ce+"px"}const F=_(),H=window.innerHeight-CONTENT_MARGIN*2,U=C.scrollHeight,G=window.getComputedStyle(m),J=parseInt(G.borderTopWidth,10),Z=parseInt(G.paddingTop,10),ae=parseInt(G.borderBottomWidth,10),W=parseInt(G.paddingBottom,10),Q=J+Z+U+W+ae,ee=Math.min(R.offsetHeight*5,Q),ie=window.getComputedStyle(C),ce=parseInt(ie.paddingTop,10),ue=parseInt(ie.paddingBottom,10),fe=j.top+j.height/2-CONTENT_MARGIN,pe=H-fe,ve=R.offsetHeight/2,he=R.offsetTop+ve,ye=J+Z+he,de=Q-ye;if(ye<=fe){const se=F.length>0&&R===F[F.length-1].ref.current;d.style.bottom="0px";const te=m.clientHeight-C.offsetTop-C.offsetHeight,xe=Math.max(pe,ve+(se?ue:0)+te+ae),oe=ye+xe;d.style.height=oe+"px"}else{const se=F.length>0&&R===F[0].ref.current;d.style.top="0px";const xe=Math.max(fe,J+C.offsetTop+(se?ce:0)+ve)+de;d.style.height=xe+"px",C.scrollTop=ye-fe+C.offsetTop}d.style.margin=`${CONTENT_MARGIN}px 0`,d.style.minHeight=ee+"px",d.style.maxHeight=H+"px",o==null||o(),requestAnimationFrame(()=>S.current=!0)}},[_,u.trigger,u.valueNode,d,m,C,R,A,u.dir,o]);useLayoutEffect2(()=>O(),[O]);const[V,M]=React__namespace.useState();useLayoutEffect2(()=>{m&&M(window.getComputedStyle(m).zIndex)},[m]);const I=React__namespace.useCallback(j=>{j&&E.current===!0&&(O(),N==null||N(),E.current=!1)},[O,N]);return jsxRuntime.jsx(SelectViewportProvider,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:S,onScrollButtonChange:I,children:jsxRuntime.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:V},children:jsxRuntime.jsx(Primitive.div,{...l,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});SelectItemAlignedPosition.displayName=ITEM_ALIGNED_POSITION_NAME;var POPPER_POSITION_NAME="SelectPopperPosition",SelectPopperPosition=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:l=CONTENT_MARGIN,...u}=e,p=usePopperScope(n);return jsxRuntime.jsx(Content$1,{...p,...u,ref:t,align:o,collisionPadding:l,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});SelectPopperPosition.displayName=POPPER_POSITION_NAME;var[SelectViewportProvider,useSelectViewportContext]=createSelectContext(CONTENT_NAME,{}),VIEWPORT_NAME="SelectViewport",SelectViewport=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...l}=e,u=useSelectContentContext(VIEWPORT_NAME,n),p=useSelectViewportContext(VIEWPORT_NAME,n),d=useComposedRefs(t,u.onViewportChange),f=React__namespace.useRef(0);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),jsxRuntime.jsx(Collection.Slot,{scope:n,children:jsxRuntime.jsx(Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:composeEventHandlers(l.onScroll,m=>{const g=m.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:_}=p;if(_!=null&&_.current&&b){const S=Math.abs(f.current-g.scrollTop);if(S>0){const E=window.innerHeight-CONTENT_MARGIN*2,C=parseFloat(b.style.minHeight),R=parseFloat(b.style.height),A=Math.max(C,R);if(A<E){const N=A+S,O=Math.min(E,N),V=N-O;b.style.height=O+"px",b.style.bottom==="0px"&&(g.scrollTop=V>0?V:0,b.style.justifyContent="flex-end")}}}f.current=g.scrollTop})})})]})});SelectViewport.displayName=VIEWPORT_NAME;var GROUP_NAME="SelectGroup",[SelectGroupContextProvider,useSelectGroupContext]=createSelectContext(GROUP_NAME),SelectGroup=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,l=useId();return jsxRuntime.jsx(SelectGroupContextProvider,{scope:n,id:l,children:jsxRuntime.jsx(Primitive.div,{role:"group","aria-labelledby":l,...o,ref:t})})});SelectGroup.displayName=GROUP_NAME;var LABEL_NAME="SelectLabel",SelectLabel$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,l=useSelectGroupContext(LABEL_NAME,n);return jsxRuntime.jsx(Primitive.div,{id:l.id,...o,ref:t})});SelectLabel$1.displayName=LABEL_NAME;var ITEM_NAME="SelectItem",[SelectItemContextProvider,useSelectItemContext]=createSelectContext(ITEM_NAME),SelectItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:l=!1,textValue:u,...p}=e,d=useSelectContext(ITEM_NAME,n),f=useSelectContentContext(ITEM_NAME,n),m=d.value===o,[g,b]=React__namespace.useState(u??""),[_,S]=React__namespace.useState(!1),E=useComposedRefs(t,N=>{var O;return(O=f.itemRefCallback)==null?void 0:O.call(f,N,o,l)}),C=useId(),R=React__namespace.useRef("touch"),A=()=>{l||(d.onValueChange(o),d.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return jsxRuntime.jsx(SelectItemContextProvider,{scope:n,value:o,disabled:l,textId:C,isSelected:m,onItemTextChange:React__namespace.useCallback(N=>{b(O=>O||((N==null?void 0:N.textContent)??"").trim())},[]),children:jsxRuntime.jsx(Collection.ItemSlot,{scope:n,value:o,disabled:l,textValue:g,children:jsxRuntime.jsx(Primitive.div,{role:"option","aria-labelledby":C,"data-highlighted":_?"":void 0,"aria-selected":m&&_,"data-state":m?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...p,ref:E,onFocus:composeEventHandlers(p.onFocus,()=>S(!0)),onBlur:composeEventHandlers(p.onBlur,()=>S(!1)),onClick:composeEventHandlers(p.onClick,()=>{R.current!=="mouse"&&A()}),onPointerUp:composeEventHandlers(p.onPointerUp,()=>{R.current==="mouse"&&A()}),onPointerDown:composeEventHandlers(p.onPointerDown,N=>{R.current=N.pointerType}),onPointerMove:composeEventHandlers(p.onPointerMove,N=>{var O;R.current=N.pointerType,l?(O=f.onItemLeave)==null||O.call(f):R.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:composeEventHandlers(p.onPointerLeave,N=>{var O;N.currentTarget===document.activeElement&&((O=f.onItemLeave)==null||O.call(f))}),onKeyDown:composeEventHandlers(p.onKeyDown,N=>{var V;((V=f.searchRef)==null?void 0:V.current)!==""&&N.key===" "||(SELECTION_KEYS.includes(N.key)&&A(),N.key===" "&&N.preventDefault())})})})})});SelectItem$1.displayName=ITEM_NAME;var ITEM_TEXT_NAME="SelectItemText",SelectItemText=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:l,...u}=e,p=useSelectContext(ITEM_TEXT_NAME,n),d=useSelectContentContext(ITEM_TEXT_NAME,n),f=useSelectItemContext(ITEM_TEXT_NAME,n),m=useSelectNativeOptionsContext(ITEM_TEXT_NAME,n),[g,b]=React__namespace.useState(null),_=useComposedRefs(t,A=>b(A),f.onItemTextChange,A=>{var N;return(N=d.itemTextRefCallback)==null?void 0:N.call(d,A,f.value,f.disabled)}),S=g==null?void 0:g.textContent,E=React__namespace.useMemo(()=>jsxRuntime.jsx("option",{value:f.value,disabled:f.disabled,children:S},f.value),[f.disabled,f.value,S]),{onNativeOptionAdd:C,onNativeOptionRemove:R}=m;return useLayoutEffect2(()=>(C(E),()=>R(E)),[C,R,E]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Primitive.span,{id:f.textId,...u,ref:_}),f.isSelected&&p.valueNode&&!p.valueNodeHasChildren?ReactDOM__namespace.createPortal(u.children,p.valueNode):null]})});SelectItemText.displayName=ITEM_TEXT_NAME;var ITEM_INDICATOR_NAME="SelectItemIndicator",SelectItemIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return useSelectItemContext(ITEM_INDICATOR_NAME,n).isSelected?jsxRuntime.jsx(Primitive.span,{"aria-hidden":!0,...o,ref:t}):null});SelectItemIndicator.displayName=ITEM_INDICATOR_NAME;var SCROLL_UP_BUTTON_NAME="SelectScrollUpButton",SelectScrollUpButton$1=React__namespace.forwardRef((e,t)=>{const n=useSelectContentContext(SCROLL_UP_BUTTON_NAME,e.__scopeSelect),o=useSelectViewportContext(SCROLL_UP_BUTTON_NAME,e.__scopeSelect),[l,u]=React__namespace.useState(!1),p=useComposedRefs(t,o.onScrollButtonChange);return useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=f.scrollTop>0;u(m)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),l?jsxRuntime.jsx(SelectScrollButtonImpl,{...e,ref:p,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop-f.offsetHeight)}}):null});SelectScrollUpButton$1.displayName=SCROLL_UP_BUTTON_NAME;var SCROLL_DOWN_BUTTON_NAME="SelectScrollDownButton",SelectScrollDownButton$1=React__namespace.forwardRef((e,t)=>{const n=useSelectContentContext(SCROLL_DOWN_BUTTON_NAME,e.__scopeSelect),o=useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME,e.__scopeSelect),[l,u]=React__namespace.useState(!1),p=useComposedRefs(t,o.onScrollButtonChange);return useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=f.scrollHeight-f.clientHeight,g=Math.ceil(f.scrollTop)<m;u(g)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),l?jsxRuntime.jsx(SelectScrollButtonImpl,{...e,ref:p,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop+f.offsetHeight)}}):null});SelectScrollDownButton$1.displayName=SCROLL_DOWN_BUTTON_NAME;var SelectScrollButtonImpl=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...l}=e,u=useSelectContentContext("SelectScrollButton",n),p=React__namespace.useRef(null),d=useCollection(n),f=React__namespace.useCallback(()=>{p.current!==null&&(window.clearInterval(p.current),p.current=null)},[]);return React__namespace.useEffect(()=>()=>f(),[f]),useLayoutEffect2(()=>{var g;const m=d().find(b=>b.ref.current===document.activeElement);(g=m==null?void 0:m.ref.current)==null||g.scrollIntoView({block:"nearest"})},[d]),jsxRuntime.jsx(Primitive.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:composeEventHandlers(l.onPointerDown,()=>{p.current===null&&(p.current=window.setInterval(o,50))}),onPointerMove:composeEventHandlers(l.onPointerMove,()=>{var m;(m=u.onItemLeave)==null||m.call(u),p.current===null&&(p.current=window.setInterval(o,50))}),onPointerLeave:composeEventHandlers(l.onPointerLeave,()=>{f()})})}),SEPARATOR_NAME="SelectSeparator",SelectSeparator$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return jsxRuntime.jsx(Primitive.div,{"aria-hidden":!0,...o,ref:t})});SelectSeparator$1.displayName=SEPARATOR_NAME;var ARROW_NAME="SelectArrow",SelectArrow=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,l=usePopperScope(n),u=useSelectContext(ARROW_NAME,n),p=useSelectContentContext(ARROW_NAME,n);return u.open&&p.position==="popper"?jsxRuntime.jsx(Arrow,{...l,...o,ref:t}):null});SelectArrow.displayName=ARROW_NAME;var BUBBLE_INPUT_NAME$1="SelectBubbleInput",SelectBubbleInput=React__namespace.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const l=React__namespace.useRef(null),u=useComposedRefs(o,l),p=usePrevious(t);return React__namespace.useEffect(()=>{const d=l.current;if(!d)return;const f=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(f,"value").set;if(p!==t&&g){const b=new Event("change",{bubbles:!0});g.call(d,t),d.dispatchEvent(b)}},[p,t]),jsxRuntime.jsx(Primitive.select,{...n,style:{...VISUALLY_HIDDEN_STYLES,...n.style},ref:u,defaultValue:t})});SelectBubbleInput.displayName=BUBBLE_INPUT_NAME$1;function shouldShowPlaceholder(e){return e===""||e===void 0}function useTypeaheadSearch(e){const t=useCallbackRef$1(e),n=React__namespace.useRef(""),o=React__namespace.useRef(0),l=React__namespace.useCallback(p=>{const d=n.current+p;t(d),function f(m){n.current=m,window.clearTimeout(o.current),m!==""&&(o.current=window.setTimeout(()=>f(""),1e3))}(d)},[t]),u=React__namespace.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return React__namespace.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,l,u]}function findNextItem(e,t,n){const l=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,u=n?e.indexOf(n):-1;let p=wrapArray(e,Math.max(u,0));l.length===1&&(p=p.filter(m=>m!==n));const f=p.find(m=>m.textValue.toLowerCase().startsWith(l.toLowerCase()));return f!==n?f:void 0}function wrapArray(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Root2=Select$1,Trigger=SelectTrigger$1,Value=SelectValue$1,Icon=SelectIcon,Portal=SelectPortal,Content2=SelectContent$1,Viewport=SelectViewport,Label=SelectLabel$1,Item=SelectItem$1,ItemText=SelectItemText,ItemIndicator=SelectItemIndicator,ScrollUpButton=SelectScrollUpButton$1,ScrollDownButton=SelectScrollDownButton$1,Separator=SelectSeparator$1;const Select=Root2,SelectValue=Value,SelectTrigger=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsxs(Trigger,{ref:o,className:cn("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,jsxRuntime.jsx(Icon,{asChild:!0,children:jsxRuntime.jsx(ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));SelectTrigger.displayName=Trigger.displayName;const SelectScrollUpButton=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(ScrollUpButton,{ref:n,className:cn("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(ChevronUp,{className:"h-4 w-4"})}));SelectScrollUpButton.displayName=ScrollUpButton.displayName;const SelectScrollDownButton=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(ScrollDownButton,{ref:n,className:cn("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(ChevronDown,{className:"h-4 w-4"})}));SelectScrollDownButton.displayName=ScrollDownButton.displayName;const SelectContent=React__namespace.forwardRef(({className:e,children:t,position:n="popper",...o},l)=>jsxRuntime.jsx(Portal,{children:jsxRuntime.jsxs(Content2,{ref:l,className:cn("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:[jsxRuntime.jsx(SelectScrollUpButton,{}),jsxRuntime.jsx(Viewport,{className:cn("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),jsxRuntime.jsx(SelectScrollDownButton,{})]})}));SelectContent.displayName=Content2.displayName;const SelectLabel=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Label,{ref:n,className:cn("px-2 py-1.5 text-sm font-semibold",e),...t}));SelectLabel.displayName=Label.displayName;const SelectItem=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsxs(Item,{ref:o,className:cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[jsxRuntime.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ItemIndicator,{children:jsxRuntime.jsx(Check,{className:"h-4 w-4"})})}),jsxRuntime.jsx(ItemText,{children:t})]}));SelectItem.displayName=Item.displayName;const SelectSeparator=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Separator,{ref:n,className:cn("-mx-1 my-1 h-px bg-muted",e),...t}));SelectSeparator.displayName=Separator.displayName;var SWITCH_NAME="Switch",[createSwitchContext,createSwitchScope]=createContextScope(SWITCH_NAME),[SwitchProvider,useSwitchContext]=createSwitchContext(SWITCH_NAME),Switch$1=React__namespace.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:l,defaultChecked:u,required:p,disabled:d,value:f="on",onCheckedChange:m,form:g,...b}=e,[_,S]=React__namespace.useState(null),E=useComposedRefs(t,O=>S(O)),C=React__namespace.useRef(!1),R=_?g||!!_.closest("form"):!0,[A,N]=useControllableState({prop:l,defaultProp:u??!1,onChange:m,caller:SWITCH_NAME});return jsxRuntime.jsxs(SwitchProvider,{scope:n,checked:A,disabled:d,children:[jsxRuntime.jsx(Primitive.button,{type:"button",role:"switch","aria-checked":A,"aria-required":p,"data-state":getState(A),"data-disabled":d?"":void 0,disabled:d,value:f,...b,ref:E,onClick:composeEventHandlers(e.onClick,O=>{N(V=>!V),R&&(C.current=O.isPropagationStopped(),C.current||O.stopPropagation())})}),R&&jsxRuntime.jsx(SwitchBubbleInput,{control:_,bubbles:!C.current,name:o,value:f,checked:A,required:p,disabled:d,form:g,style:{transform:"translateX(-100%)"}})]})});Switch$1.displayName=SWITCH_NAME;var THUMB_NAME="SwitchThumb",SwitchThumb=React__namespace.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,l=useSwitchContext(THUMB_NAME,n);return jsxRuntime.jsx(Primitive.span,{"data-state":getState(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:t})});SwitchThumb.displayName=THUMB_NAME;var BUBBLE_INPUT_NAME="SwitchBubbleInput",SwitchBubbleInput=React__namespace.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...l},u)=>{const p=React__namespace.useRef(null),d=useComposedRefs(p,u),f=usePrevious(n),m=useSize(t);return React__namespace.useEffect(()=>{const g=p.current;if(!g)return;const b=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(b,"checked").set;if(f!==n&&S){const E=new Event("click",{bubbles:o});S.call(g,n),g.dispatchEvent(E)}},[f,n,o]),jsxRuntime.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...l,tabIndex:-1,ref:d,style:{...l.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SwitchBubbleInput.displayName=BUBBLE_INPUT_NAME;function getState(e){return e?"checked":"unchecked"}var Root=Switch$1,Thumb=SwitchThumb;const Switch=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Root,{className:cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:jsxRuntime.jsx(Thumb,{className:cn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Switch.displayName=Root.displayName;const DAYS_OF_WEEK=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function ManufacturerReorderingCard({manufacturer:e,onSave:t,loading:n=!1,saving:o=!1}){const[l,u]=React.useState({...e}),p=(_,S)=>{u(E=>({...E,[_]:S}))},d=(_,S)=>{u(E=>({...E,[_]:S}))},f=(_,S)=>{u(E=>({...E,[_]:S}))},m=()=>{o||t(l)},g=_=>_===-1?"ASAP":_===void 0||_<0||_>6?"Sunday":DAYS_OF_WEEK[_],b=_=>_==="ASAP"?-1:DAYS_OF_WEEK.indexOf(_);return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[n?jsxRuntime.jsx(Skeleton,{className:"h-8 w-32"}):jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Reordering"}),n?jsxRuntime.jsx(Skeleton,{className:"h-4 w-full mt-2"}):jsxRuntime.jsx(CardDescription,{className:"text-sm",children:"Adjust your reordering settings to control lead times, stocking weeks, minimum orders, and reorder dates, enhancing efficiency in restocking processes."})]}),jsxRuntime.jsx(CardContent,{className:"space-y-6",children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-10"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx("div",{className:"ml-2 w-12"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx("div",{className:"ml-2 w-12"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Switch,{id:"automatic-reordering",checked:l.AutoUpdate,onCheckedChange:_=>p("AutoUpdate",_),disabled:o}),jsxRuntime.jsx(Label$2,{htmlFor:"automatic-reordering",children:"Automatic Reordering"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"reorder-date",children:"Automatic Reorder Date"}),jsxRuntime.jsxs(Select,{value:g(l.AutoReorderDate),onValueChange:_=>d("AutoReorderDate",b(_)),disabled:o,children:[jsxRuntime.jsx(SelectTrigger,{id:"reorder-date",children:jsxRuntime.jsx(SelectValue,{placeholder:"Select day"})}),jsxRuntime.jsxs(SelectContent,{children:[jsxRuntime.jsx(SelectItem,{value:"ASAP",children:"ASAP"}),DAYS_OF_WEEK.map(_=>jsxRuntime.jsx(SelectItem,{value:_,children:_},_))]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"weeks-stocking",children:"Default Weeks of Stocking"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Input,{id:"weeks-stocking",type:"number",value:l.DefaultWeeksOfStocking||"",onChange:_=>d("DefaultWeeksOfStocking",Number(_.target.value)),disabled:o}),jsxRuntime.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"weeks"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"minimum-order",children:"Default Minimum Order"}),jsxRuntime.jsxs("div",{className:"flex items-center relative",children:[jsxRuntime.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2",children:"$"}),jsxRuntime.jsx(Input,{id:"minimum-order",type:"number",className:"pl-6",value:l.DefaultMinimumOrder||"",onChange:_=>d("DefaultMinimumOrder",Number(_.target.value)),disabled:o})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"lead-time",children:"Default Lead Time"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Input,{id:"lead-time",type:"number",value:l.DefaultLeadTime||"",onChange:_=>d("DefaultLeadTime",Number(_.target.value)),disabled:o}),jsxRuntime.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"days"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"maximum-inventory-value",children:"Default Maximum Inventory Value"}),jsxRuntime.jsxs("div",{className:"flex items-center relative",children:[jsxRuntime.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2",children:"$"}),jsxRuntime.jsx(Input,{id:"maximum-inventory-value",type:"number",className:"pl-6",value:l.DefaultMaxInventoryValue||"",onChange:_=>d("DefaultMaxInventoryValue",Number(_.target.value)),disabled:o})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"order-confirmations",children:"Send Order Confirmations To"}),jsxRuntime.jsx(Input,{id:"order-confirmations",type:"email",value:l.POEmail||"",onChange:_=>f("POEmail",_.target.value),placeholder:"email@example.com",disabled:o})]})]})]})}),jsxRuntime.jsx(CardFooter,{className:"flex justify-end",children:n?jsxRuntime.jsx(Skeleton,{className:"h-10 w-20"}):jsxRuntime.jsxs(Button,{onClick:m,disabled:o,children:[o&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]})})]})}function ResellerBillingOverviewCard({reseller:e,actions:t,loading:n=!1}){return n||!e?jsxRuntime.jsx(ResellerBillingOverviewSkeleton,{}):jsxRuntime.jsx(ResellerBillingOverviewData,{reseller:e,actions:t})}function ResellerBillingOverviewSkeleton(){return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:jsxRuntime.jsx(Skeleton,{className:"h-6 w-40"})})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsx("div",{className:"space-y-4",children:Array(3).fill(0).map((e,t)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-28"})]})]},t))}),jsxRuntime.jsx("div",{className:"space-y-4",children:Array(2).fill(0).map((e,t)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-28"})]})]},t))})]}),jsxRuntime.jsx("div",{className:"flex justify-end mt-4",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-28 rounded-md"})})]})]})}function ResellerBillingOverviewData({reseller:e,actions:t}){const n=p=>p===void 0?"$0.00":new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:2,maximumFractionDigits:2}).format(p),o=e.Statement||{},l=[{title:"0 - 30 Days",amount:o.Over0||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-primary"},{title:"31 - 45 Days",amount:o.Over30||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-primary"},{title:"45+ Days",amount:o.Over45||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-primary"}],u=[{title:"Total",amount:o.Total||0,icon:jsxRuntime.jsx(DollarSign,{className:"h-5 w-5 text-white"}),color:"bg-green-500"},{title:"Credit Limit",amount:e.CreditLimit||0,icon:jsxRuntime.jsx(CreditCard,{className:"h-5 w-5 text-white"}),color:"bg-blue-500"}];return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Billing Overview"})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsx("div",{className:"space-y-4",children:l.map((p,d)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("h3",{className:"text-sm sm:text-base font-medium",children:p.title}),jsxRuntime.jsx("div",{className:`p-2 rounded-full ${p.color}`,children:p.icon})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx("p",{className:"text-base sm:text-lg font-bold",children:n(p.amount)})})]},d))}),jsxRuntime.jsx("div",{className:"space-y-4",children:u.map((p,d)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("h3",{className:"text-sm sm:text-base font-medium",children:p.title}),jsxRuntime.jsx("div",{className:`p-2 rounded-full ${p.color}`,children:p.icon})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx("p",{className:"text-base sm:text-lg font-bold",children:n(p.amount)})})]},d))})]}),t&&jsxRuntime.jsx("div",{className:"flex justify-end mt-4",children:t})]})]})}function ResellerQualificationsCard({qualifications:e=[],loading:t=!1}){return t?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Qualifications"})}),jsxRuntime.jsx(CardContent,{className:"p-6",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 gap-y-8",children:Array.from({length:10}).map((n,o)=>jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-24 rounded-md mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"})]},o))})})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Qualifications"})}),jsxRuntime.jsx(CardContent,{className:"p-6",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 gap-y-8",children:e.map((n,o)=>jsxRuntime.jsx(ManufacturerLogo,{manufacturerId:n.ManufacturerId,opportunityNumber:n.DefaultOpportunityNumber},`${n.ManufacturerId}-${o}`))})})]})}function ManufacturerLogo({manufacturerId:e,opportunityNumber:t}){const[n,o]=React.useState(null),[l,u]=React.useState(!0),[p,d]=React.useState(!1),[f,m]=React.useState(null),g=React.useMemo(()=>e?{logoUrl:`https://api.randmar.io/V4/Partner/${e}/Account/Logo?width=96&height=48`,logoExistsUrl:`https://api.randmar.io/V4/Partner/${e}/Account/Logo/Exists`}:null,[e]);return React.useEffect(()=>{if(!g)return;let b=!0;m(null);const _=async()=>{try{const C=await fetch(g.logoExistsUrl);if(C.ok){const A=(await C.text()).toLowerCase()==="true";return b&&d(A),A}return!1}catch(C){return console.error("Failed to check if logo exists:",C),b&&d(!1),!1}},S=async()=>{b&&u(!0);try{const C=await fetch(g.logoUrl);if(C.ok){const R=await C.blob();b&&(n&&URL.revokeObjectURL(n),o(URL.createObjectURL(R)))}else throw new Error(`Failed to load logo: ${C.status}`)}catch(C){console.error("Failed to load logo:",C),b&&m("Failed to load manufacturer logo")}finally{b&&u(!1)}};return(async()=>{await _()?S():u(!1)})(),()=>{b=!1,n&&URL.revokeObjectURL(n)}},[g]),jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx("div",{className:"h-12 flex items-center justify-center mb-2",children:l?jsxRuntime.jsx(Skeleton,{className:"h-12 w-24 rounded-md"}):p&&n?jsxRuntime.jsx("img",{src:n,alt:"Manufacturer logo",className:"max-h-12 max-w-24 object-contain",onError:()=>m("Failed to load logo")}):jsxRuntime.jsx("div",{className:"h-12 w-24 flex items-center justify-center bg-slate-100 rounded-md text-xs text-slate-500",children:e?e.substring(0,8):"No ID"})}),t&&jsxRuntime.jsx(Badge,{variant:"outline",className:"text-xs",children:t}),f&&jsxRuntime.jsx("div",{className:"text-red-500 text-xs mt-1",role:"alert",children:f})]})}function SalesOverviewCard({salesData:e,salesStatistics:t=[],loading:n=!1}){return n||!e?jsxRuntime.jsx(SalesOverviewSkeleton,{}):jsxRuntime.jsx(SalesOverviewData,{salesData:e,salesStatistics:t})}function SalesOverviewSkeleton(){return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg sm:text-xl",children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-40"})})}),jsxRuntime.jsxs(CardContent,{className:"pt-4 px-3 sm:px-6",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Array(3).fill(0).map((e,t)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-28"})]})]},t))}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-[250px] w-full rounded-lg"})]})})]})]})}function SalesOverviewData({salesData:e,salesStatistics:t=[]}){const n=u=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:2,maximumFractionDigits:2}).format(u),o=[{title:"Last 30 days",amount:e.SalesLast30Days||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-blue-500"},{title:"Last 3 months",amount:e.SalesLast3Months||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-amber-500"},{title:"Year to date",amount:e.SalesYearToDay||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-emerald-500"}],l=React.useMemo(()=>{const u=new Map;return t.forEach(p=>{var f;const d=((f=p.Day)==null?void 0:f.toString())||"";if(d.length===8){const m=parseInt(d.substring(0,4),10),g=parseInt(d.substring(4,6),10)-1,b=parseInt(d.substring(6,8),10),_=new Date(m,g,b),S=new Date(_),E=_.getDay();S.setDate(_.getDate()-E);const C=`${S.getFullYear()}-${String(S.getMonth()+1).padStart(2,"0")}-${String(S.getDate()).padStart(2,"0")}`,R=p.ExtendedPrice||0;u.has(C)?u.set(C,u.get(C)+R):u.set(C,R)}}),Array.from(u).sort(([p],[d])=>p.localeCompare(d)).map(([p,d])=>({date:`${p.substring(5,7)}/${p.substring(8,10)}`,amount:d}))},[t]);return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg sm:text-xl",children:"Sales Overview"})}),jsxRuntime.jsxs(CardContent,{className:"pt-4 px-3 sm:px-6",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:o.map((u,p)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"text-sm sm:text-base font-medium",children:u.title}),jsxRuntime.jsx("div",{className:`p-2 rounded-full ${u.color}`,children:u.icon})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base sm:text-lg font-bold",children:n(u.amount)})]})]},p))}),jsxRuntime.jsx("div",{className:"mt-6",children:t&&t.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("h3",{className:"text-sm font-medium mb-4",children:"Sales Trend"}),jsxRuntime.jsx("div",{className:"space-y-6",children:jsxRuntime.jsx(AreaChart,{data:l,units:"$",unitsPosition:"left",height:200})})]})})]})]})}exports.ActiveOrdersCard=ActiveOrdersCard,exports.AiGeneratedContent=AiGeneratedContent,exports.ApiKeyProvider=ApiKeyProvider,exports.AreaChart=AreaChart,exports.Avatar=Avatar,exports.AvatarFallback=AvatarFallback,exports.AvatarFooter=AvatarFooter,exports.AvatarImage=AvatarImage,exports.Badge=Badge,exports.Button=Button,exports.Card=Card,exports.CardContent=CardContent,exports.CardDescription=CardDescription,exports.CardFooter=CardFooter,exports.CardHeader=CardHeader,exports.CardTitle=CardTitle,exports.ChatLayout=ChatLayout,exports.CountryFlag=CountryFlag,exports.Dialog=Dialog,exports.DialogClose=DialogClose,exports.DialogContent=DialogContent,exports.DialogDescription=DialogDescription,exports.DialogFooter=DialogFooter,exports.DialogHeader=DialogHeader,exports.DialogOverlay=DialogOverlay,exports.DialogPortal=DialogPortal,exports.DialogTitle=DialogTitle,exports.DialogTrigger=DialogTrigger,exports.DropdownMenu=DropdownMenu,exports.DropdownMenuCheckboxItem=DropdownMenuCheckboxItem,exports.DropdownMenuContent=DropdownMenuContent,exports.DropdownMenuGroup=DropdownMenuGroup,exports.DropdownMenuItem=DropdownMenuItem,exports.DropdownMenuLabel=DropdownMenuLabel,exports.DropdownMenuPortal=DropdownMenuPortal,exports.DropdownMenuRadioGroup=DropdownMenuRadioGroup,exports.DropdownMenuRadioItem=DropdownMenuRadioItem,exports.DropdownMenuSeparator=DropdownMenuSeparator,exports.DropdownMenuShortcut=DropdownMenuShortcut,exports.DropdownMenuSub=DropdownMenuSub,exports.DropdownMenuSubContent=DropdownMenuSubContent,exports.DropdownMenuSubTrigger=DropdownMenuSubTrigger,exports.DropdownMenuTrigger=DropdownMenuTrigger,exports.GeneralDocumentCard=GeneralDocumentCard,exports.Input=Input,exports.InputOTP=InputOTP,exports.InputOTPGroup=InputOTPGroup,exports.InputOTPSeparator=InputOTPSeparator,exports.InputOTPSlot=InputOTPSlot,exports.Label=Label$2,exports.Layout=Layout,exports.ManufacturerCard=ManufacturerCard,exports.ManufacturerReorderingCard=ManufacturerReorderingCard,exports.Navbar=Navbar,exports.PartnerCard=PartnerCard,exports.Preloader=Preloader,exports.ProductCard=ProductCard,exports.ProductImage=ProductImage,exports.ProductInventoryGrid=ProductInventoryGrid,exports.ResellerBillingOverviewCard=ResellerBillingOverviewCard,exports.ResellerCard=ResellerCard,exports.ResellerQualificationsCard=ResellerQualificationsCard,exports.SalesOverviewCard=SalesOverviewCard,exports.ScrollArea=ScrollArea,exports.ScrollBar=ScrollBar,exports.Select=Select,exports.SelectScrollDownButton=SelectScrollDownButton,exports.SelectScrollUpButton=SelectScrollUpButton,exports.Separator=Separator$1,exports.Sheet=Sheet,exports.SheetClose=SheetClose,exports.SheetContent=SheetContent,exports.SheetDescription=SheetDescription,exports.SheetFooter=SheetFooter,exports.SheetHeader=SheetHeader,exports.SheetOverlay=SheetOverlay,exports.SheetPortal=SheetPortal,exports.SheetTitle=SheetTitle,exports.SheetTrigger=SheetTrigger,exports.Sidebar=Sidebar,exports.SidebarContent=SidebarContent,exports.SidebarFooter=SidebarFooter,exports.SidebarGroup=SidebarGroup,exports.SidebarGroupAction=SidebarGroupAction,exports.SidebarGroupContent=SidebarGroupContent,exports.SidebarGroupLabel=SidebarGroupLabel,exports.SidebarHeader=SidebarHeader,exports.SidebarInput=SidebarInput,exports.SidebarInset=SidebarInset,exports.SidebarMenu=SidebarMenu,exports.SidebarMenuAction=SidebarMenuAction,exports.SidebarMenuBadge=SidebarMenuBadge,exports.SidebarMenuButton=SidebarMenuButton,exports.SidebarMenuItem=SidebarMenuItem,exports.SidebarMenuSkeleton=SidebarMenuSkeleton,exports.SidebarMenuSub=SidebarMenuSub,exports.SidebarMenuSubButton=SidebarMenuSubButton,exports.SidebarMenuSubItem=SidebarMenuSubItem,exports.SidebarProvider=SidebarProvider,exports.SidebarRail=SidebarRail,exports.SidebarSeparator=SidebarSeparator,exports.SidebarTrigger=SidebarTrigger,exports.Skeleton=Skeleton,exports.Switch=Switch,exports.Tabs=Tabs,exports.TabsContent=TabsContent,exports.TabsList=TabsList,exports.TabsTrigger=TabsTrigger,exports.Textarea=Textarea,exports.Toast=Toast,exports.ToastAction=ToastAction,exports.ToastClose=ToastClose,exports.ToastDescription=ToastDescription,exports.ToastProvider=ToastProvider,exports.ToastTitle=ToastTitle,exports.ToastViewport=ToastViewport,exports.Toaster=Toaster,exports.Tooltip=Tooltip$1,exports.TooltipContent=TooltipContent,exports.TooltipProvider=TooltipProvider,exports.TooltipTrigger=TooltipTrigger,exports.Topbar=Topbar,exports.badgeVariants=badgeVariants,exports.buttonVariants=buttonVariants,exports.toast=toast,exports.useApiKey=useApiKey,exports.useIsMobile=useIsMobile,exports.useSidebar=useSidebar,exports.useToast=useToast,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
890
+ Use <ProductCard item={data}>`],basicComponents=["<Card> <CardHeader> <CardTitle>...</CardTitle> <CardDescription>...</CardDescription> </CardHeader> <CardContent> ... </CardContent> </Card>","<Badge>...</Badge>",'<Tabs defaultValue="eg1"> <TabsList> <TabsTrigger value="eg1">Example1</TabsTrigger> <TabsTrigger value="eg2">Example2</TabsTrigger> </TabsList> <TabsContent value="eg1"> ... </TabsContent> <TabsContent value="eg2"> ... </TabsContent> </Tabs>',"<ScrollArea>...</ScrollArea>","<ScrollArea orientation='horizontal'>...</ScrollArea>"],GetJSXFromAI=async(e,t,n,o,l=3)=>{const u="In addition to basic html tags, You have access to these beautiful Handmade Components:",p="You also have access to these few Shadcn UI components:",d="Here is the data to display to the user (If a Handmade Component is a good fit for the data, use it. Otherwise, use regular html tags) (You have access to this data object in React via the data variable):",f="Only output a single JSX code snippet. Start with <> and end with </>. All other code will be ignored, so make sure to place all CSS styles inline. Use CSS flex layouts when there is a lot of stuff to display.",m=JSON.stringify(n),g=[t,u,...complexComponents,p,...basicComponents,f,d,m,f].join(`\r
891
+ `),S=await new GoogleGenAI({apiKey:e}).chats.create({model:o?"gemini-2.5-pro-preview-03-25":"gemini-2.0-flash-lite"}).sendMessage({message:g}),E=trimJSXString(S.text??"");return E||(l==0?"<p>Failed to generate. Reload the page.</p>":await GetJSXFromAI(e,t,n,o,l-1))};function trimJSXString(e){const t=e.indexOf("<"),n=e.lastIndexOf("</");return t===-1||n===-1?"":e.slice(t,e.indexOf(">",n)+1)}function AiGeneratedContent(e){const[t,n]=React.useState(""),{apiKey:o}=useApiKey();return React.useEffect(()=>{if(!o||!e.prompt||!e.data)return;n("");let l=!1;return GetJSXFromAI(o,e.prompt,e.data,e.smartAndSlow===!0).then(u=>{l||n(u)}),()=>{l=!0}},[e.prompt,e.data,n,o,e.smartAndSlow]),t?jsxRuntime.jsx(source_default,{bindings:{data:e.data},components:{ResellerCard,ManufacturerCard,PartnerCard,ProductCard,Card,CardHeader,CardTitle,CardContent,CardDescription,Badge,Tabs,TabsList,TabsContent,TabsTrigger,ScrollArea},jsx:t}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(Skeleton,{className:"h-32 w-32",children:jsxRuntime.jsx(Bot,{className:"m-auto align-middle h-full"})})})}function GeneralDocumentCard({document:e,loading:t=!1}){return t?jsxRuntime.jsx("div",{children:"loading..."}):jsxRuntime.jsxs("div",{children:["GENERAL DOCUMENT CARD - ",e==null?void 0:e.OrderNumber," for P.O. ",e==null?void 0:e.PONumber]})}const Navbar=React.forwardRef(({routes:e,footer:t,dashboardTitle:n,withRandmarAssistant:o,chatUserName:l,chatApiKey:u},p)=>{const{appID:d}=reactRouterDom.useParams(),f=e.filter(_=>_.showInNav),m=React.useRef(null),g=React.useRef(null),b=React.useRef(null);return React.useImperativeHandle(p,()=>({setActiveChatAndSendMessage:(_,S)=>{var E;return(E=b.current)==null||E.click(),setTimeout(()=>{var C;(C=m.current)==null||C.focus(),g.current&&g.current.setActiveChatAndSendMessage(_,S)},100),!0}})),jsxRuntime.jsxs(Sidebar,{className:"border-r border-sidebar-border",children:[jsxRuntime.jsx(SidebarHeader,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center",children:jsxRuntime.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),jsxRuntime.jsx("span",{className:"font-semibold text-lg",children:n})]})}),jsxRuntime.jsx(SidebarContent,{className:"py-4 bg-sidebar text-sidebar-foreground",children:jsxRuntime.jsx(SidebarMenu,{children:f.map(_=>{const S=_.icon,E=`/${_.path.replace(":appID",d??"")}`;return jsxRuntime.jsx(SidebarMenuItem,{children:jsxRuntime.jsx(SidebarMenuButton,{asChild:!0,children:jsxRuntime.jsxs(reactRouterDom.Link,{to:E,className:"transition-colors hover:bg-muted px-6",children:[S&&jsxRuntime.jsx(S,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:_.label})]})})},_.key)})})}),jsxRuntime.jsxs(SidebarFooter,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:[o===!0&&jsxRuntime.jsxs(Dialog,{children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{ref:b,size:"lg",className:"collapse md:visible",onClick:()=>setTimeout(()=>{var _;return(_=m.current)==null?void 0:_.focus()},50),children:[jsxRuntime.jsx(Bot,{}),"Assistant"]})}),jsxRuntime.jsx(DialogContent,{className:"max-w-[85vw] p-0 data-[state=open]:visible data-[state=closed]:invisible",forceMount:!0,animateExit:!1,children:jsxRuntime.jsx(ChatLayout,{ref:g,inputRef:m,userId:d??"2",userName:l??"Unknown user",apiKey:u??""})})]}),t]})]})}),Layout=React.forwardRef(({children:e,rightMenu:t,routes:n,footer:o,handleValidSearch:l,dashboardTitle:u,onSignOut:p,searchPlaceholder:d,withRandmarAssistant:f,chatUserName:m,chatApiKey:g,chatRef:b},_)=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(SidebarProvider,{children:jsxRuntime.jsxs("div",{className:"flex grow",children:[jsxRuntime.jsx(Navbar,{routes:n,footer:o,dashboardTitle:u,withRandmarAssistant:f,chatUserName:m,chatApiKey:g,ref:b}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[jsxRuntime.jsx(Topbar,{ref:_,onSignOut:p,rightMenu:t,handleValidSearch:l,searchPlaceholder:d}),jsxRuntime.jsx("main",{className:"flex-1 overflow-auto mt-16",children:e}),jsxRuntime.jsx(Toaster,{})]})]})})}));Layout.displayName="Layout";function usePrevious(e){const t=React__namespace.useRef({value:e,previous:e});return React__namespace.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var OPEN_KEYS=[" ","Enter","ArrowUp","ArrowDown"],SELECTION_KEYS=[" ","Enter"],SELECT_NAME="Select",[Collection,useCollection,createCollectionScope]=createCollection(SELECT_NAME),[createSelectContext,createSelectScope]=createContextScope(SELECT_NAME,[createCollectionScope,createPopperScope]),usePopperScope=createPopperScope(),[SelectProvider,useSelectContext]=createSelectContext(SELECT_NAME),[SelectNativeOptionsProvider,useSelectNativeOptionsContext]=createSelectContext(SELECT_NAME),Select$1=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:l,onOpenChange:u,value:p,defaultValue:d,onValueChange:f,dir:m,name:g,autoComplete:b,disabled:_,required:S,form:E}=e,C=usePopperScope(t),[R,A]=React__namespace.useState(null),[N,O]=React__namespace.useState(null),[V,M]=React__namespace.useState(!1),I=useDirection(m),[j,B]=useControllableState({prop:o,defaultProp:l??!1,onChange:u,caller:SELECT_NAME}),[L,q]=useControllableState({prop:p,defaultProp:d,onChange:f,caller:SELECT_NAME}),F=React__namespace.useRef(null),H=R?E||!!R.closest("form"):!0,[U,G]=React__namespace.useState(new Set),J=Array.from(U).map(Z=>Z.props.value).join(";");return jsxRuntime.jsx(Root2$4,{...C,children:jsxRuntime.jsxs(SelectProvider,{required:S,scope:t,trigger:R,onTriggerChange:A,valueNode:N,onValueNodeChange:O,valueNodeHasChildren:V,onValueNodeHasChildrenChange:M,contentId:useId(),value:L,onValueChange:q,open:j,onOpenChange:B,dir:I,triggerPointerDownPosRef:F,disabled:_,children:[jsxRuntime.jsx(Collection.Provider,{scope:t,children:jsxRuntime.jsx(SelectNativeOptionsProvider,{scope:e.__scopeSelect,onNativeOptionAdd:React__namespace.useCallback(Z=>{G(ae=>new Set(ae).add(Z))},[]),onNativeOptionRemove:React__namespace.useCallback(Z=>{G(ae=>{const W=new Set(ae);return W.delete(Z),W})},[]),children:n})}),H?jsxRuntime.jsxs(SelectBubbleInput,{"aria-hidden":!0,required:S,tabIndex:-1,name:g,autoComplete:b,value:L,onChange:Z=>q(Z.target.value),disabled:_,form:E,children:[L===void 0?jsxRuntime.jsx("option",{value:""}):null,Array.from(U)]},J):null]})})};Select$1.displayName=SELECT_NAME;var TRIGGER_NAME="SelectTrigger",SelectTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...l}=e,u=usePopperScope(n),p=useSelectContext(TRIGGER_NAME,n),d=p.disabled||o,f=useComposedRefs(t,p.onTriggerChange),m=useCollection(n),g=React__namespace.useRef("touch"),[b,_,S]=useTypeaheadSearch(C=>{const R=m().filter(O=>!O.disabled),A=R.find(O=>O.value===p.value),N=findNextItem(R,C,A);N!==void 0&&p.onValueChange(N.value)}),E=C=>{d||(p.onOpenChange(!0),S()),C&&(p.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return jsxRuntime.jsx(Anchor,{asChild:!0,...u,children:jsxRuntime.jsx(Primitive.button,{type:"button",role:"combobox","aria-controls":p.contentId,"aria-expanded":p.open,"aria-required":p.required,"aria-autocomplete":"none",dir:p.dir,"data-state":p.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":shouldShowPlaceholder(p.value)?"":void 0,...l,ref:f,onClick:composeEventHandlers(l.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&E(C)}),onPointerDown:composeEventHandlers(l.onPointerDown,C=>{g.current=C.pointerType;const R=C.target;R.hasPointerCapture(C.pointerId)&&R.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(E(C),C.preventDefault())}),onKeyDown:composeEventHandlers(l.onKeyDown,C=>{const R=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&_(C.key),!(R&&C.key===" ")&&OPEN_KEYS.includes(C.key)&&(E(),C.preventDefault())})})})});SelectTrigger$1.displayName=TRIGGER_NAME;var VALUE_NAME="SelectValue",SelectValue$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:l,children:u,placeholder:p="",...d}=e,f=useSelectContext(VALUE_NAME,n),{onValueNodeHasChildrenChange:m}=f,g=u!==void 0,b=useComposedRefs(t,f.onValueNodeChange);return useLayoutEffect2(()=>{m(g)},[m,g]),jsxRuntime.jsx(Primitive.span,{...d,ref:b,style:{pointerEvents:"none"},children:shouldShowPlaceholder(f.value)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:p}):u})});SelectValue$1.displayName=VALUE_NAME;var ICON_NAME="SelectIcon",SelectIcon=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...l}=e;return jsxRuntime.jsx(Primitive.span,{"aria-hidden":!0,...l,ref:t,children:o||"▼"})});SelectIcon.displayName=ICON_NAME;var PORTAL_NAME="SelectPortal",SelectPortal=e=>jsxRuntime.jsx(Portal$4,{asChild:!0,...e});SelectPortal.displayName=PORTAL_NAME;var CONTENT_NAME="SelectContent",SelectContent$1=React__namespace.forwardRef((e,t)=>{const n=useSelectContext(CONTENT_NAME,e.__scopeSelect),[o,l]=React__namespace.useState();if(useLayoutEffect2(()=>{l(new DocumentFragment)},[]),!n.open){const u=o;return u?ReactDOM__namespace.createPortal(jsxRuntime.jsx(SelectContentProvider,{scope:e.__scopeSelect,children:jsxRuntime.jsx(Collection.Slot,{scope:e.__scopeSelect,children:jsxRuntime.jsx("div",{children:e.children})})}),u):null}return jsxRuntime.jsx(SelectContentImpl,{...e,ref:t})});SelectContent$1.displayName=CONTENT_NAME;var CONTENT_MARGIN=10,[SelectContentProvider,useSelectContentContext]=createSelectContext(CONTENT_NAME),CONTENT_IMPL_NAME="SelectContentImpl",Slot=createSlot("SelectContent.RemoveScroll"),SelectContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:p,side:d,sideOffset:f,align:m,alignOffset:g,arrowPadding:b,collisionBoundary:_,collisionPadding:S,sticky:E,hideWhenDetached:C,avoidCollisions:R,...A}=e,N=useSelectContext(CONTENT_NAME,n),[O,V]=React__namespace.useState(null),[M,I]=React__namespace.useState(null),j=useComposedRefs(t,he=>V(he)),[B,L]=React__namespace.useState(null),[q,F]=React__namespace.useState(null),H=useCollection(n),[U,G]=React__namespace.useState(!1),J=React__namespace.useRef(!1);React__namespace.useEffect(()=>{if(O)return hideOthers(O)},[O]),useFocusGuards();const Z=React__namespace.useCallback(he=>{const[ye,...de]=H().map(te=>te.ref.current),[le]=de.slice(-1),se=document.activeElement;for(const te of he)if(te===se||(te==null||te.scrollIntoView({block:"nearest"}),te===ye&&M&&(M.scrollTop=0),te===le&&M&&(M.scrollTop=M.scrollHeight),te==null||te.focus(),document.activeElement!==se))return},[H,M]),ae=React__namespace.useCallback(()=>Z([B,O]),[Z,B,O]);React__namespace.useEffect(()=>{U&&ae()},[U,ae]);const{onOpenChange:W,triggerPointerDownPosRef:Q}=N;React__namespace.useEffect(()=>{if(O){let he={x:0,y:0};const ye=le=>{var se,te;he={x:Math.abs(Math.round(le.pageX)-(((se=Q.current)==null?void 0:se.x)??0)),y:Math.abs(Math.round(le.pageY)-(((te=Q.current)==null?void 0:te.y)??0))}},de=le=>{he.x<=10&&he.y<=10?le.preventDefault():O.contains(le.target)||W(!1),document.removeEventListener("pointermove",ye),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",de,{capture:!0})}}},[O,W,Q]),React__namespace.useEffect(()=>{const he=()=>W(!1);return window.addEventListener("blur",he),window.addEventListener("resize",he),()=>{window.removeEventListener("blur",he),window.removeEventListener("resize",he)}},[W]);const[ee,ie]=useTypeaheadSearch(he=>{const ye=H().filter(se=>!se.disabled),de=ye.find(se=>se.ref.current===document.activeElement),le=findNextItem(ye,he,de);le&&setTimeout(()=>le.ref.current.focus())}),ce=React__namespace.useCallback((he,ye,de)=>{const le=!J.current&&!de;(N.value!==void 0&&N.value===ye||le)&&(L(he),le&&(J.current=!0))},[N.value]),ue=React__namespace.useCallback(()=>O==null?void 0:O.focus(),[O]),fe=React__namespace.useCallback((he,ye,de)=>{const le=!J.current&&!de;(N.value!==void 0&&N.value===ye||le)&&F(he)},[N.value]),pe=o==="popper"?SelectPopperPosition:SelectItemAlignedPosition,ve=pe===SelectPopperPosition?{side:d,sideOffset:f,align:m,alignOffset:g,arrowPadding:b,collisionBoundary:_,collisionPadding:S,sticky:E,hideWhenDetached:C,avoidCollisions:R}:{};return jsxRuntime.jsx(SelectContentProvider,{scope:n,content:O,viewport:M,onViewportChange:I,itemRefCallback:ce,selectedItem:B,onItemLeave:ue,itemTextRefCallback:fe,focusSelectedItem:ae,selectedItemText:q,position:o,isPositioned:U,searchRef:ee,children:jsxRuntime.jsx(ReactRemoveScroll,{as:Slot,allowPinchZoom:!0,children:jsxRuntime.jsx(FocusScope,{asChild:!0,trapped:N.open,onMountAutoFocus:he=>{he.preventDefault()},onUnmountAutoFocus:composeEventHandlers(l,he=>{var ye;(ye=N.trigger)==null||ye.focus({preventScroll:!0}),he.preventDefault()}),children:jsxRuntime.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:he=>he.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:jsxRuntime.jsx(pe,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:he=>he.preventDefault(),...A,...ve,onPlaced:()=>G(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:composeEventHandlers(A.onKeyDown,he=>{const ye=he.ctrlKey||he.altKey||he.metaKey;if(he.key==="Tab"&&he.preventDefault(),!ye&&he.key.length===1&&ie(he.key),["ArrowUp","ArrowDown","Home","End"].includes(he.key)){let le=H().filter(se=>!se.disabled).map(se=>se.ref.current);if(["ArrowUp","End"].includes(he.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(he.key)){const se=he.target,te=le.indexOf(se);le=le.slice(te+1)}setTimeout(()=>Z(le)),he.preventDefault()}})})})})})})});SelectContentImpl.displayName=CONTENT_IMPL_NAME;var ITEM_ALIGNED_POSITION_NAME="SelectItemAlignedPosition",SelectItemAlignedPosition=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...l}=e,u=useSelectContext(CONTENT_NAME,n),p=useSelectContentContext(CONTENT_NAME,n),[d,f]=React__namespace.useState(null),[m,g]=React__namespace.useState(null),b=useComposedRefs(t,j=>g(j)),_=useCollection(n),S=React__namespace.useRef(!1),E=React__namespace.useRef(!0),{viewport:C,selectedItem:R,selectedItemText:A,focusSelectedItem:N}=p,O=React__namespace.useCallback(()=>{if(u.trigger&&u.valueNode&&d&&m&&C&&R&&A){const j=u.trigger.getBoundingClientRect(),B=m.getBoundingClientRect(),L=u.valueNode.getBoundingClientRect(),q=A.getBoundingClientRect();if(u.dir!=="rtl"){const se=q.left-B.left,te=L.left-se,xe=j.left-te,oe=j.width+xe,be=Math.max(oe,B.width),_e=window.innerWidth-CONTENT_MARGIN,Ce=clamp(te,[CONTENT_MARGIN,Math.max(CONTENT_MARGIN,_e-be)]);d.style.minWidth=oe+"px",d.style.left=Ce+"px"}else{const se=B.right-q.right,te=window.innerWidth-L.right-se,xe=window.innerWidth-j.right-te,oe=j.width+xe,be=Math.max(oe,B.width),_e=window.innerWidth-CONTENT_MARGIN,Ce=clamp(te,[CONTENT_MARGIN,Math.max(CONTENT_MARGIN,_e-be)]);d.style.minWidth=oe+"px",d.style.right=Ce+"px"}const F=_(),H=window.innerHeight-CONTENT_MARGIN*2,U=C.scrollHeight,G=window.getComputedStyle(m),J=parseInt(G.borderTopWidth,10),Z=parseInt(G.paddingTop,10),ae=parseInt(G.borderBottomWidth,10),W=parseInt(G.paddingBottom,10),Q=J+Z+U+W+ae,ee=Math.min(R.offsetHeight*5,Q),ie=window.getComputedStyle(C),ce=parseInt(ie.paddingTop,10),ue=parseInt(ie.paddingBottom,10),fe=j.top+j.height/2-CONTENT_MARGIN,pe=H-fe,ve=R.offsetHeight/2,he=R.offsetTop+ve,ye=J+Z+he,de=Q-ye;if(ye<=fe){const se=F.length>0&&R===F[F.length-1].ref.current;d.style.bottom="0px";const te=m.clientHeight-C.offsetTop-C.offsetHeight,xe=Math.max(pe,ve+(se?ue:0)+te+ae),oe=ye+xe;d.style.height=oe+"px"}else{const se=F.length>0&&R===F[0].ref.current;d.style.top="0px";const xe=Math.max(fe,J+C.offsetTop+(se?ce:0)+ve)+de;d.style.height=xe+"px",C.scrollTop=ye-fe+C.offsetTop}d.style.margin=`${CONTENT_MARGIN}px 0`,d.style.minHeight=ee+"px",d.style.maxHeight=H+"px",o==null||o(),requestAnimationFrame(()=>S.current=!0)}},[_,u.trigger,u.valueNode,d,m,C,R,A,u.dir,o]);useLayoutEffect2(()=>O(),[O]);const[V,M]=React__namespace.useState();useLayoutEffect2(()=>{m&&M(window.getComputedStyle(m).zIndex)},[m]);const I=React__namespace.useCallback(j=>{j&&E.current===!0&&(O(),N==null||N(),E.current=!1)},[O,N]);return jsxRuntime.jsx(SelectViewportProvider,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:S,onScrollButtonChange:I,children:jsxRuntime.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:V},children:jsxRuntime.jsx(Primitive.div,{...l,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});SelectItemAlignedPosition.displayName=ITEM_ALIGNED_POSITION_NAME;var POPPER_POSITION_NAME="SelectPopperPosition",SelectPopperPosition=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:l=CONTENT_MARGIN,...u}=e,p=usePopperScope(n);return jsxRuntime.jsx(Content$1,{...p,...u,ref:t,align:o,collisionPadding:l,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});SelectPopperPosition.displayName=POPPER_POSITION_NAME;var[SelectViewportProvider,useSelectViewportContext]=createSelectContext(CONTENT_NAME,{}),VIEWPORT_NAME="SelectViewport",SelectViewport=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...l}=e,u=useSelectContentContext(VIEWPORT_NAME,n),p=useSelectViewportContext(VIEWPORT_NAME,n),d=useComposedRefs(t,u.onViewportChange),f=React__namespace.useRef(0);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),jsxRuntime.jsx(Collection.Slot,{scope:n,children:jsxRuntime.jsx(Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:composeEventHandlers(l.onScroll,m=>{const g=m.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:_}=p;if(_!=null&&_.current&&b){const S=Math.abs(f.current-g.scrollTop);if(S>0){const E=window.innerHeight-CONTENT_MARGIN*2,C=parseFloat(b.style.minHeight),R=parseFloat(b.style.height),A=Math.max(C,R);if(A<E){const N=A+S,O=Math.min(E,N),V=N-O;b.style.height=O+"px",b.style.bottom==="0px"&&(g.scrollTop=V>0?V:0,b.style.justifyContent="flex-end")}}}f.current=g.scrollTop})})})]})});SelectViewport.displayName=VIEWPORT_NAME;var GROUP_NAME="SelectGroup",[SelectGroupContextProvider,useSelectGroupContext]=createSelectContext(GROUP_NAME),SelectGroup=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,l=useId();return jsxRuntime.jsx(SelectGroupContextProvider,{scope:n,id:l,children:jsxRuntime.jsx(Primitive.div,{role:"group","aria-labelledby":l,...o,ref:t})})});SelectGroup.displayName=GROUP_NAME;var LABEL_NAME="SelectLabel",SelectLabel$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,l=useSelectGroupContext(LABEL_NAME,n);return jsxRuntime.jsx(Primitive.div,{id:l.id,...o,ref:t})});SelectLabel$1.displayName=LABEL_NAME;var ITEM_NAME="SelectItem",[SelectItemContextProvider,useSelectItemContext]=createSelectContext(ITEM_NAME),SelectItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:l=!1,textValue:u,...p}=e,d=useSelectContext(ITEM_NAME,n),f=useSelectContentContext(ITEM_NAME,n),m=d.value===o,[g,b]=React__namespace.useState(u??""),[_,S]=React__namespace.useState(!1),E=useComposedRefs(t,N=>{var O;return(O=f.itemRefCallback)==null?void 0:O.call(f,N,o,l)}),C=useId(),R=React__namespace.useRef("touch"),A=()=>{l||(d.onValueChange(o),d.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return jsxRuntime.jsx(SelectItemContextProvider,{scope:n,value:o,disabled:l,textId:C,isSelected:m,onItemTextChange:React__namespace.useCallback(N=>{b(O=>O||((N==null?void 0:N.textContent)??"").trim())},[]),children:jsxRuntime.jsx(Collection.ItemSlot,{scope:n,value:o,disabled:l,textValue:g,children:jsxRuntime.jsx(Primitive.div,{role:"option","aria-labelledby":C,"data-highlighted":_?"":void 0,"aria-selected":m&&_,"data-state":m?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...p,ref:E,onFocus:composeEventHandlers(p.onFocus,()=>S(!0)),onBlur:composeEventHandlers(p.onBlur,()=>S(!1)),onClick:composeEventHandlers(p.onClick,()=>{R.current!=="mouse"&&A()}),onPointerUp:composeEventHandlers(p.onPointerUp,()=>{R.current==="mouse"&&A()}),onPointerDown:composeEventHandlers(p.onPointerDown,N=>{R.current=N.pointerType}),onPointerMove:composeEventHandlers(p.onPointerMove,N=>{var O;R.current=N.pointerType,l?(O=f.onItemLeave)==null||O.call(f):R.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:composeEventHandlers(p.onPointerLeave,N=>{var O;N.currentTarget===document.activeElement&&((O=f.onItemLeave)==null||O.call(f))}),onKeyDown:composeEventHandlers(p.onKeyDown,N=>{var V;((V=f.searchRef)==null?void 0:V.current)!==""&&N.key===" "||(SELECTION_KEYS.includes(N.key)&&A(),N.key===" "&&N.preventDefault())})})})})});SelectItem$1.displayName=ITEM_NAME;var ITEM_TEXT_NAME="SelectItemText",SelectItemText=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:l,...u}=e,p=useSelectContext(ITEM_TEXT_NAME,n),d=useSelectContentContext(ITEM_TEXT_NAME,n),f=useSelectItemContext(ITEM_TEXT_NAME,n),m=useSelectNativeOptionsContext(ITEM_TEXT_NAME,n),[g,b]=React__namespace.useState(null),_=useComposedRefs(t,A=>b(A),f.onItemTextChange,A=>{var N;return(N=d.itemTextRefCallback)==null?void 0:N.call(d,A,f.value,f.disabled)}),S=g==null?void 0:g.textContent,E=React__namespace.useMemo(()=>jsxRuntime.jsx("option",{value:f.value,disabled:f.disabled,children:S},f.value),[f.disabled,f.value,S]),{onNativeOptionAdd:C,onNativeOptionRemove:R}=m;return useLayoutEffect2(()=>(C(E),()=>R(E)),[C,R,E]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Primitive.span,{id:f.textId,...u,ref:_}),f.isSelected&&p.valueNode&&!p.valueNodeHasChildren?ReactDOM__namespace.createPortal(u.children,p.valueNode):null]})});SelectItemText.displayName=ITEM_TEXT_NAME;var ITEM_INDICATOR_NAME="SelectItemIndicator",SelectItemIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return useSelectItemContext(ITEM_INDICATOR_NAME,n).isSelected?jsxRuntime.jsx(Primitive.span,{"aria-hidden":!0,...o,ref:t}):null});SelectItemIndicator.displayName=ITEM_INDICATOR_NAME;var SCROLL_UP_BUTTON_NAME="SelectScrollUpButton",SelectScrollUpButton$1=React__namespace.forwardRef((e,t)=>{const n=useSelectContentContext(SCROLL_UP_BUTTON_NAME,e.__scopeSelect),o=useSelectViewportContext(SCROLL_UP_BUTTON_NAME,e.__scopeSelect),[l,u]=React__namespace.useState(!1),p=useComposedRefs(t,o.onScrollButtonChange);return useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=f.scrollTop>0;u(m)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),l?jsxRuntime.jsx(SelectScrollButtonImpl,{...e,ref:p,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop-f.offsetHeight)}}):null});SelectScrollUpButton$1.displayName=SCROLL_UP_BUTTON_NAME;var SCROLL_DOWN_BUTTON_NAME="SelectScrollDownButton",SelectScrollDownButton$1=React__namespace.forwardRef((e,t)=>{const n=useSelectContentContext(SCROLL_DOWN_BUTTON_NAME,e.__scopeSelect),o=useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME,e.__scopeSelect),[l,u]=React__namespace.useState(!1),p=useComposedRefs(t,o.onScrollButtonChange);return useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=f.scrollHeight-f.clientHeight,g=Math.ceil(f.scrollTop)<m;u(g)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),l?jsxRuntime.jsx(SelectScrollButtonImpl,{...e,ref:p,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop+f.offsetHeight)}}):null});SelectScrollDownButton$1.displayName=SCROLL_DOWN_BUTTON_NAME;var SelectScrollButtonImpl=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...l}=e,u=useSelectContentContext("SelectScrollButton",n),p=React__namespace.useRef(null),d=useCollection(n),f=React__namespace.useCallback(()=>{p.current!==null&&(window.clearInterval(p.current),p.current=null)},[]);return React__namespace.useEffect(()=>()=>f(),[f]),useLayoutEffect2(()=>{var g;const m=d().find(b=>b.ref.current===document.activeElement);(g=m==null?void 0:m.ref.current)==null||g.scrollIntoView({block:"nearest"})},[d]),jsxRuntime.jsx(Primitive.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:composeEventHandlers(l.onPointerDown,()=>{p.current===null&&(p.current=window.setInterval(o,50))}),onPointerMove:composeEventHandlers(l.onPointerMove,()=>{var m;(m=u.onItemLeave)==null||m.call(u),p.current===null&&(p.current=window.setInterval(o,50))}),onPointerLeave:composeEventHandlers(l.onPointerLeave,()=>{f()})})}),SEPARATOR_NAME="SelectSeparator",SelectSeparator$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return jsxRuntime.jsx(Primitive.div,{"aria-hidden":!0,...o,ref:t})});SelectSeparator$1.displayName=SEPARATOR_NAME;var ARROW_NAME="SelectArrow",SelectArrow=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,l=usePopperScope(n),u=useSelectContext(ARROW_NAME,n),p=useSelectContentContext(ARROW_NAME,n);return u.open&&p.position==="popper"?jsxRuntime.jsx(Arrow,{...l,...o,ref:t}):null});SelectArrow.displayName=ARROW_NAME;var BUBBLE_INPUT_NAME$1="SelectBubbleInput",SelectBubbleInput=React__namespace.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const l=React__namespace.useRef(null),u=useComposedRefs(o,l),p=usePrevious(t);return React__namespace.useEffect(()=>{const d=l.current;if(!d)return;const f=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(f,"value").set;if(p!==t&&g){const b=new Event("change",{bubbles:!0});g.call(d,t),d.dispatchEvent(b)}},[p,t]),jsxRuntime.jsx(Primitive.select,{...n,style:{...VISUALLY_HIDDEN_STYLES,...n.style},ref:u,defaultValue:t})});SelectBubbleInput.displayName=BUBBLE_INPUT_NAME$1;function shouldShowPlaceholder(e){return e===""||e===void 0}function useTypeaheadSearch(e){const t=useCallbackRef$1(e),n=React__namespace.useRef(""),o=React__namespace.useRef(0),l=React__namespace.useCallback(p=>{const d=n.current+p;t(d),function f(m){n.current=m,window.clearTimeout(o.current),m!==""&&(o.current=window.setTimeout(()=>f(""),1e3))}(d)},[t]),u=React__namespace.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return React__namespace.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,l,u]}function findNextItem(e,t,n){const l=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,u=n?e.indexOf(n):-1;let p=wrapArray(e,Math.max(u,0));l.length===1&&(p=p.filter(m=>m!==n));const f=p.find(m=>m.textValue.toLowerCase().startsWith(l.toLowerCase()));return f!==n?f:void 0}function wrapArray(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Root2=Select$1,Trigger=SelectTrigger$1,Value=SelectValue$1,Icon=SelectIcon,Portal=SelectPortal,Content2=SelectContent$1,Viewport=SelectViewport,Label=SelectLabel$1,Item=SelectItem$1,ItemText=SelectItemText,ItemIndicator=SelectItemIndicator,ScrollUpButton=SelectScrollUpButton$1,ScrollDownButton=SelectScrollDownButton$1,Separator=SelectSeparator$1;const Select=Root2,SelectValue=Value,SelectTrigger=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsxs(Trigger,{ref:o,className:cn("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,jsxRuntime.jsx(Icon,{asChild:!0,children:jsxRuntime.jsx(ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));SelectTrigger.displayName=Trigger.displayName;const SelectScrollUpButton=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(ScrollUpButton,{ref:n,className:cn("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(ChevronUp,{className:"h-4 w-4"})}));SelectScrollUpButton.displayName=ScrollUpButton.displayName;const SelectScrollDownButton=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(ScrollDownButton,{ref:n,className:cn("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(ChevronDown,{className:"h-4 w-4"})}));SelectScrollDownButton.displayName=ScrollDownButton.displayName;const SelectContent=React__namespace.forwardRef(({className:e,children:t,position:n="popper",...o},l)=>jsxRuntime.jsx(Portal,{children:jsxRuntime.jsxs(Content2,{ref:l,className:cn("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:[jsxRuntime.jsx(SelectScrollUpButton,{}),jsxRuntime.jsx(Viewport,{className:cn("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),jsxRuntime.jsx(SelectScrollDownButton,{})]})}));SelectContent.displayName=Content2.displayName;const SelectLabel=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Label,{ref:n,className:cn("px-2 py-1.5 text-sm font-semibold",e),...t}));SelectLabel.displayName=Label.displayName;const SelectItem=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsxs(Item,{ref:o,className:cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[jsxRuntime.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ItemIndicator,{children:jsxRuntime.jsx(Check,{className:"h-4 w-4"})})}),jsxRuntime.jsx(ItemText,{children:t})]}));SelectItem.displayName=Item.displayName;const SelectSeparator=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Separator,{ref:n,className:cn("-mx-1 my-1 h-px bg-muted",e),...t}));SelectSeparator.displayName=Separator.displayName;var SWITCH_NAME="Switch",[createSwitchContext,createSwitchScope]=createContextScope(SWITCH_NAME),[SwitchProvider,useSwitchContext]=createSwitchContext(SWITCH_NAME),Switch$1=React__namespace.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:l,defaultChecked:u,required:p,disabled:d,value:f="on",onCheckedChange:m,form:g,...b}=e,[_,S]=React__namespace.useState(null),E=useComposedRefs(t,O=>S(O)),C=React__namespace.useRef(!1),R=_?g||!!_.closest("form"):!0,[A,N]=useControllableState({prop:l,defaultProp:u??!1,onChange:m,caller:SWITCH_NAME});return jsxRuntime.jsxs(SwitchProvider,{scope:n,checked:A,disabled:d,children:[jsxRuntime.jsx(Primitive.button,{type:"button",role:"switch","aria-checked":A,"aria-required":p,"data-state":getState(A),"data-disabled":d?"":void 0,disabled:d,value:f,...b,ref:E,onClick:composeEventHandlers(e.onClick,O=>{N(V=>!V),R&&(C.current=O.isPropagationStopped(),C.current||O.stopPropagation())})}),R&&jsxRuntime.jsx(SwitchBubbleInput,{control:_,bubbles:!C.current,name:o,value:f,checked:A,required:p,disabled:d,form:g,style:{transform:"translateX(-100%)"}})]})});Switch$1.displayName=SWITCH_NAME;var THUMB_NAME="SwitchThumb",SwitchThumb=React__namespace.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,l=useSwitchContext(THUMB_NAME,n);return jsxRuntime.jsx(Primitive.span,{"data-state":getState(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:t})});SwitchThumb.displayName=THUMB_NAME;var BUBBLE_INPUT_NAME="SwitchBubbleInput",SwitchBubbleInput=React__namespace.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...l},u)=>{const p=React__namespace.useRef(null),d=useComposedRefs(p,u),f=usePrevious(n),m=useSize(t);return React__namespace.useEffect(()=>{const g=p.current;if(!g)return;const b=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(b,"checked").set;if(f!==n&&S){const E=new Event("click",{bubbles:o});S.call(g,n),g.dispatchEvent(E)}},[f,n,o]),jsxRuntime.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...l,tabIndex:-1,ref:d,style:{...l.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SwitchBubbleInput.displayName=BUBBLE_INPUT_NAME;function getState(e){return e?"checked":"unchecked"}var Root=Switch$1,Thumb=SwitchThumb;const Switch=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Root,{className:cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:jsxRuntime.jsx(Thumb,{className:cn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Switch.displayName=Root.displayName;const DAYS_OF_WEEK=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function ManufacturerReorderingCard({manufacturer:e,onSave:t,loading:n=!1,saving:o=!1}){const[l,u]=React.useState({...e}),p=(_,S)=>{u(E=>({...E,[_]:S}))},d=(_,S)=>{u(E=>({...E,[_]:S}))},f=(_,S)=>{u(E=>({...E,[_]:S}))},m=()=>{o||t(l)},g=_=>_===-1?"ASAP":_===void 0||_<0||_>6?"Sunday":DAYS_OF_WEEK[_],b=_=>_==="ASAP"?-1:DAYS_OF_WEEK.indexOf(_);return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[n?jsxRuntime.jsx(Skeleton,{className:"h-8 w-32"}):jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Reordering"}),n?jsxRuntime.jsx(Skeleton,{className:"h-4 w-full mt-2"}):jsxRuntime.jsx(CardDescription,{className:"text-sm",children:"Adjust your reordering settings to control lead times, stocking weeks, minimum orders, and reorder dates, enhancing efficiency in restocking processes."})]}),jsxRuntime.jsx(CardContent,{className:"space-y-6",children:n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-10"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx("div",{className:"ml-2 w-12"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx("div",{className:"ml-2 w-12"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Switch,{id:"automatic-reordering",checked:l.AutoUpdate,onCheckedChange:_=>p("AutoUpdate",_),disabled:o}),jsxRuntime.jsx(Label$2,{htmlFor:"automatic-reordering",children:"Automatic Reordering"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"reorder-date",children:"Automatic Reorder Date"}),jsxRuntime.jsxs(Select,{value:g(l.AutoReorderDate),onValueChange:_=>d("AutoReorderDate",b(_)),disabled:o,children:[jsxRuntime.jsx(SelectTrigger,{id:"reorder-date",children:jsxRuntime.jsx(SelectValue,{placeholder:"Select day"})}),jsxRuntime.jsxs(SelectContent,{children:[jsxRuntime.jsx(SelectItem,{value:"ASAP",children:"ASAP"}),DAYS_OF_WEEK.map(_=>jsxRuntime.jsx(SelectItem,{value:_,children:_},_))]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"weeks-stocking",children:"Default Weeks of Stocking"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Input,{id:"weeks-stocking",type:"number",value:l.DefaultWeeksOfStocking||"",onChange:_=>d("DefaultWeeksOfStocking",Number(_.target.value)),disabled:o}),jsxRuntime.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"weeks"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"minimum-order",children:"Default Minimum Order"}),jsxRuntime.jsxs("div",{className:"flex items-center relative",children:[jsxRuntime.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2",children:"$"}),jsxRuntime.jsx(Input,{id:"minimum-order",type:"number",className:"pl-6",value:l.DefaultMinimumOrder||"",onChange:_=>d("DefaultMinimumOrder",Number(_.target.value)),disabled:o})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"lead-time",children:"Default Lead Time"}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(Input,{id:"lead-time",type:"number",value:l.DefaultLeadTime||"",onChange:_=>d("DefaultLeadTime",Number(_.target.value)),disabled:o}),jsxRuntime.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"days"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"maximum-inventory-value",children:"Default Maximum Inventory Value"}),jsxRuntime.jsxs("div",{className:"flex items-center relative",children:[jsxRuntime.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2",children:"$"}),jsxRuntime.jsx(Input,{id:"maximum-inventory-value",type:"number",className:"pl-6",value:l.DefaultMaxInventoryValue||"",onChange:_=>d("DefaultMaxInventoryValue",Number(_.target.value)),disabled:o})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"order-confirmations",children:"Send Order Confirmations To"}),jsxRuntime.jsx(Input,{id:"order-confirmations",type:"email",value:l.POEmail||"",onChange:_=>f("POEmail",_.target.value),placeholder:"email@example.com",disabled:o})]})]})]})}),jsxRuntime.jsx(CardFooter,{className:"flex justify-end",children:n?jsxRuntime.jsx(Skeleton,{className:"h-10 w-20"}):jsxRuntime.jsxs(Button,{onClick:m,disabled:o,children:[o&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]})})]})}function ResellerBillingOverviewCard({reseller:e,actions:t,loading:n=!1}){return n||!e?jsxRuntime.jsx(ResellerBillingOverviewSkeleton,{}):jsxRuntime.jsx(ResellerBillingOverviewData,{reseller:e,actions:t})}function ResellerBillingOverviewSkeleton(){return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:jsxRuntime.jsx(Skeleton,{className:"h-6 w-40"})})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsx("div",{className:"space-y-4",children:Array(3).fill(0).map((e,t)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-28"})]})]},t))}),jsxRuntime.jsx("div",{className:"space-y-4",children:Array(2).fill(0).map((e,t)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-28"})]})]},t))})]}),jsxRuntime.jsx("div",{className:"flex justify-end mt-4",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-28 rounded-md"})})]})]})}function ResellerBillingOverviewData({reseller:e,actions:t}){const n=p=>p===void 0?"$0.00":new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:2,maximumFractionDigits:2}).format(p),o=e.Statement||{},l=[{title:"0 - 30 Days",amount:o.Over0||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-primary"},{title:"31 - 45 Days",amount:o.Over30||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-primary"},{title:"45+ Days",amount:o.Over45||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-primary"}],u=[{title:"Total",amount:o.Total||0,icon:jsxRuntime.jsx(DollarSign,{className:"h-5 w-5 text-white"}),color:"bg-green-500"},{title:"Credit Limit",amount:e.CreditLimit||0,icon:jsxRuntime.jsx(CreditCard,{className:"h-5 w-5 text-white"}),color:"bg-blue-500"}];return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Billing Overview"})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsx("div",{className:"space-y-4",children:l.map((p,d)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("h3",{className:"text-sm sm:text-base font-medium",children:p.title}),jsxRuntime.jsx("div",{className:`p-2 rounded-full ${p.color}`,children:p.icon})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx("p",{className:"text-base sm:text-lg font-bold",children:n(p.amount)})})]},d))}),jsxRuntime.jsx("div",{className:"space-y-4",children:u.map((p,d)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("h3",{className:"text-sm sm:text-base font-medium",children:p.title}),jsxRuntime.jsx("div",{className:`p-2 rounded-full ${p.color}`,children:p.icon})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx("p",{className:"text-base sm:text-lg font-bold",children:n(p.amount)})})]},d))})]}),t&&jsxRuntime.jsx("div",{className:"flex justify-end mt-4",children:t})]})]})}function ResellerQualificationsCard({qualifications:e=[],loading:t=!1}){return t?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Qualifications"})}),jsxRuntime.jsx(CardContent,{className:"p-6",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 gap-y-8",children:Array.from({length:10}).map((n,o)=>jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-24 rounded-md mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"})]},o))})})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Qualifications"})}),jsxRuntime.jsx(CardContent,{className:"p-6",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 gap-y-8",children:e.map((n,o)=>jsxRuntime.jsx(ManufacturerLogo,{manufacturerId:n.ManufacturerId,opportunityNumber:n.DefaultOpportunityNumber},`${n.ManufacturerId}-${o}`))})})]})}function ManufacturerLogo({manufacturerId:e,opportunityNumber:t}){const[n,o]=React.useState(null),[l,u]=React.useState(!0),[p,d]=React.useState(!1),[f,m]=React.useState(null),g=React.useMemo(()=>e?{logoUrl:`https://api.randmar.io/V4/Partner/${e}/Account/Logo?width=96&height=48`,logoExistsUrl:`https://api.randmar.io/V4/Partner/${e}/Account/Logo/Exists`}:null,[e]);return React.useEffect(()=>{if(!g)return;let b=!0;m(null);const _=async()=>{try{const C=await fetch(g.logoExistsUrl);if(C.ok){const A=(await C.text()).toLowerCase()==="true";return b&&d(A),A}return!1}catch(C){return console.error("Failed to check if logo exists:",C),b&&d(!1),!1}},S=async()=>{b&&u(!0);try{const C=await fetch(g.logoUrl);if(C.ok){const R=await C.blob();b&&(n&&URL.revokeObjectURL(n),o(URL.createObjectURL(R)))}else throw new Error(`Failed to load logo: ${C.status}`)}catch(C){console.error("Failed to load logo:",C),b&&m("Failed to load manufacturer logo")}finally{b&&u(!1)}};return(async()=>{await _()?S():u(!1)})(),()=>{b=!1,n&&URL.revokeObjectURL(n)}},[g]),jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx("div",{className:"h-12 flex items-center justify-center mb-2",children:l?jsxRuntime.jsx(Skeleton,{className:"h-12 w-24 rounded-md"}):p&&n?jsxRuntime.jsx("img",{src:n,alt:"Manufacturer logo",className:"max-h-12 max-w-24 object-contain",onError:()=>m("Failed to load logo")}):jsxRuntime.jsx("div",{className:"h-12 w-24 flex items-center justify-center bg-slate-100 rounded-md text-xs text-slate-500",children:e?e.substring(0,8):"No ID"})}),t&&jsxRuntime.jsx(Badge,{variant:"outline",className:"text-xs",children:t}),f&&jsxRuntime.jsx("div",{className:"text-red-500 text-xs mt-1",role:"alert",children:f})]})}function SalesOverviewCard({salesData:e,salesStatistics:t=[],loading:n=!1}){return n||!e?jsxRuntime.jsx(SalesOverviewSkeleton,{}):jsxRuntime.jsx(SalesOverviewData,{salesData:e,salesStatistics:t})}function SalesOverviewSkeleton(){return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg sm:text-xl",children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-40"})})}),jsxRuntime.jsxs(CardContent,{className:"pt-4 px-3 sm:px-6",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Array(3).fill(0).map((e,t)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-28"})]})]},t))}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-[250px] w-full rounded-lg"})]})})]})]})}function SalesOverviewData({salesData:e,salesStatistics:t=[]}){const n=u=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:2,maximumFractionDigits:2}).format(u),o=[{title:"Last 30 days",amount:e.SalesLast30Days||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-blue-500"},{title:"Last 3 months",amount:e.SalesLast3Months||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-amber-500"},{title:"Year to date",amount:e.SalesYearToDay||0,icon:jsxRuntime.jsx(Calendar,{className:"h-5 w-5 text-white"}),color:"bg-emerald-500"}],l=React.useMemo(()=>{const u=new Map;return t.forEach(p=>{var f;const d=((f=p.Day)==null?void 0:f.toString())||"";if(d.length===8){const m=parseInt(d.substring(0,4),10),g=parseInt(d.substring(4,6),10)-1,b=parseInt(d.substring(6,8),10),_=new Date(m,g,b),S=new Date(_),E=_.getDay();S.setDate(_.getDate()-E);const C=`${S.getFullYear()}-${String(S.getMonth()+1).padStart(2,"0")}-${String(S.getDate()).padStart(2,"0")}`,R=p.ExtendedPrice||0;u.has(C)?u.set(C,u.get(C)+R):u.set(C,R)}}),Array.from(u).sort(([p],[d])=>p.localeCompare(d)).map(([p,d])=>({date:`${p.substring(5,7)}/${p.substring(8,10)}`,amount:d}))},[t]);return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg sm:text-xl",children:"Sales Overview"})}),jsxRuntime.jsxs(CardContent,{className:"pt-4 px-3 sm:px-6",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:o.map((u,p)=>jsxRuntime.jsxs("div",{className:"border rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"text-sm sm:text-base font-medium",children:u.title}),jsxRuntime.jsx("div",{className:`p-2 rounded-full ${u.color}`,children:u.icon})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base sm:text-lg font-bold",children:n(u.amount)})]})]},p))}),jsxRuntime.jsx("div",{className:"mt-6",children:t&&t.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("h3",{className:"text-sm font-medium mb-4",children:"Sales Trend"}),jsxRuntime.jsx("div",{className:"space-y-6",children:jsxRuntime.jsx(AreaChart,{data:l,units:"$",unitsPosition:"left",height:200})})]})})]})]})}exports.ActiveOrdersCard=ActiveOrdersCard,exports.AiGeneratedContent=AiGeneratedContent,exports.ApiKeyProvider=ApiKeyProvider,exports.AreaChart=AreaChart,exports.Avatar=Avatar,exports.AvatarFallback=AvatarFallback,exports.AvatarFooter=AvatarFooter,exports.AvatarImage=AvatarImage,exports.Badge=Badge,exports.Button=Button,exports.Card=Card,exports.CardContent=CardContent,exports.CardDescription=CardDescription,exports.CardFooter=CardFooter,exports.CardHeader=CardHeader,exports.CardTitle=CardTitle,exports.ChatLayout=ChatLayout,exports.CountryFlag=CountryFlag,exports.Dialog=Dialog,exports.DialogClose=DialogClose,exports.DialogContent=DialogContent,exports.DialogDescription=DialogDescription,exports.DialogFooter=DialogFooter,exports.DialogHeader=DialogHeader,exports.DialogOverlay=DialogOverlay,exports.DialogPortal=DialogPortal,exports.DialogTitle=DialogTitle,exports.DialogTrigger=DialogTrigger,exports.DropdownMenu=DropdownMenu,exports.DropdownMenuCheckboxItem=DropdownMenuCheckboxItem,exports.DropdownMenuContent=DropdownMenuContent,exports.DropdownMenuGroup=DropdownMenuGroup,exports.DropdownMenuItem=DropdownMenuItem,exports.DropdownMenuLabel=DropdownMenuLabel,exports.DropdownMenuPortal=DropdownMenuPortal,exports.DropdownMenuRadioGroup=DropdownMenuRadioGroup,exports.DropdownMenuRadioItem=DropdownMenuRadioItem,exports.DropdownMenuSeparator=DropdownMenuSeparator,exports.DropdownMenuShortcut=DropdownMenuShortcut,exports.DropdownMenuSub=DropdownMenuSub,exports.DropdownMenuSubContent=DropdownMenuSubContent,exports.DropdownMenuSubTrigger=DropdownMenuSubTrigger,exports.DropdownMenuTrigger=DropdownMenuTrigger,exports.GeneralDocumentCard=GeneralDocumentCard,exports.Input=Input,exports.InputOTP=InputOTP,exports.InputOTPGroup=InputOTPGroup,exports.InputOTPSeparator=InputOTPSeparator,exports.InputOTPSlot=InputOTPSlot,exports.Label=Label$2,exports.Layout=Layout,exports.ManufacturerCard=ManufacturerCard,exports.ManufacturerReorderingCard=ManufacturerReorderingCard,exports.Navbar=Navbar,exports.PartnerCard=PartnerCard,exports.Preloader=Preloader,exports.ProductCard=ProductCard,exports.ProductImage=ProductImage,exports.ProductInventoryGrid=ProductInventoryGrid,exports.ResellerBillingOverviewCard=ResellerBillingOverviewCard,exports.ResellerCard=ResellerCard,exports.ResellerQualificationsCard=ResellerQualificationsCard,exports.SalesOverviewCard=SalesOverviewCard,exports.ScrollArea=ScrollArea,exports.ScrollBar=ScrollBar,exports.Select=Select,exports.SelectScrollDownButton=SelectScrollDownButton,exports.SelectScrollUpButton=SelectScrollUpButton,exports.Separator=Separator$1,exports.Sheet=Sheet,exports.SheetClose=SheetClose,exports.SheetContent=SheetContent,exports.SheetDescription=SheetDescription,exports.SheetFooter=SheetFooter,exports.SheetHeader=SheetHeader,exports.SheetOverlay=SheetOverlay,exports.SheetPortal=SheetPortal,exports.SheetTitle=SheetTitle,exports.SheetTrigger=SheetTrigger,exports.Sidebar=Sidebar,exports.SidebarContent=SidebarContent,exports.SidebarFooter=SidebarFooter,exports.SidebarGroup=SidebarGroup,exports.SidebarGroupAction=SidebarGroupAction,exports.SidebarGroupContent=SidebarGroupContent,exports.SidebarGroupLabel=SidebarGroupLabel,exports.SidebarHeader=SidebarHeader,exports.SidebarInput=SidebarInput,exports.SidebarInset=SidebarInset,exports.SidebarMenu=SidebarMenu,exports.SidebarMenuAction=SidebarMenuAction,exports.SidebarMenuBadge=SidebarMenuBadge,exports.SidebarMenuButton=SidebarMenuButton,exports.SidebarMenuItem=SidebarMenuItem,exports.SidebarMenuSkeleton=SidebarMenuSkeleton,exports.SidebarMenuSub=SidebarMenuSub,exports.SidebarMenuSubButton=SidebarMenuSubButton,exports.SidebarMenuSubItem=SidebarMenuSubItem,exports.SidebarProvider=SidebarProvider,exports.SidebarRail=SidebarRail,exports.SidebarSeparator=SidebarSeparator,exports.SidebarTrigger=SidebarTrigger,exports.Skeleton=Skeleton,exports.Switch=Switch,exports.Tabs=Tabs,exports.TabsContent=TabsContent,exports.TabsList=TabsList,exports.TabsTrigger=TabsTrigger,exports.Textarea=Textarea,exports.Toast=Toast,exports.ToastAction=ToastAction,exports.ToastClose=ToastClose,exports.ToastDescription=ToastDescription,exports.ToastProvider=ToastProvider,exports.ToastTitle=ToastTitle,exports.ToastViewport=ToastViewport,exports.Toaster=Toaster,exports.Tooltip=Tooltip$1,exports.TooltipContent=TooltipContent,exports.TooltipProvider=TooltipProvider,exports.TooltipTrigger=TooltipTrigger,exports.Topbar=Topbar,exports.badgeVariants=badgeVariants,exports.buttonVariants=buttonVariants,exports.toast=toast,exports.useApiKey=useApiKey,exports.useIsMobile=useIsMobile,exports.useSidebar=useSidebar,exports.useToast=useToast,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "randmarcomps",
3
3
  "private": false,
4
- "version": "1.159.0",
4
+ "version": "1.161.0",
5
5
  "description": "The UI library enabling speed and consistency in Randmar frontends.",
6
6
  "type": "module",
7
7
  "files": [