'use client';'use strict';

var chunkRDNUAI55_cjs = require('./chunk-RDNUAI55.cjs');
var chunk6U6JVUY3_cjs = require('./chunk-6U6JVUY3.cjs');
var chunkIFXORR66_cjs = require('./chunk-IFXORR66.cjs');
var chunkQOC26J56_cjs = require('./chunk-QOC26J56.cjs');
var chunk4IQP4J4C_cjs = require('./chunk-4IQP4J4C.cjs');
var chunkKWKPXJMQ_cjs = require('./chunk-KWKPXJMQ.cjs');
var chunk5XB54L7P_cjs = require('./chunk-5XB54L7P.cjs');
var css = require('@onbeam/styled-system/css');
var recipes = require('@onbeam/styled-system/recipes');
var jsxRuntime = require('react/jsx-runtime');
var react = require('react');
var reactDialog = require('@radix-ui/react-dialog');

var u=chunk5XB54L7P_cjs.a(({as:x="div",id:b,name:N,subname:l,logo:n,detailCaption:m,detailLabel:i,className:y,isSelected:p,isDisabled:f,onClick:v,action:a,address:g,chainId:C,...k},P)=>{let e=recipes.selectModal(),r=f||p;return jsxRuntime.jsxs(x,{ref:P,tabIndex:r?-1:0,"aria-disabled":r,className:css.cx(e.listItem,e.listItemHover,y),onClick:r?void 0:()=>v?.(b),...k,children:[jsxRuntime.jsxs("div",{className:e.token,children:[jsxRuntime.jsx(chunkRDNUAI55_cjs.a,{as:"div",disabled:r,disableChevron:!0,icon:n,children:N}),l&&jsxRuntime.jsx("span",{className:e.tokenSubname,children:l})]}),a&&jsxRuntime.jsxs("div",{className:e.action,children:[jsxRuntime.jsx("p",{children:a.title}),jsxRuntime.jsx("div",{onClick:d=>d.stopPropagation(),onKeyDown:d=>d.stopPropagation(),children:jsxRuntime.jsx(chunk6U6JVUY3_cjs.a,{as:"span",role:"button",tabIndex:0,onClick:a.onClick,className:e.actionButton,children:a.buttonLabel})})]}),(i||m)&&jsxRuntime.jsxs("div",{className:e.detail,children:[i&&jsxRuntime.jsx("span",{className:e.detailLabel,"data-selected":p,children:i}),m&&jsxRuntime.jsx("span",{className:e.detailCaption,children:m})]})]})});u.displayName="SelectModalItem";var _=chunk5XB54L7P_cjs.a(({as:x="div",label:b,searchPlaceholder:N="search",items:l=[],selectedId:n,title:m,listTitle:i,onChange:y,onOpenChange:p,searchQuery:f,onSearch:v,sort:a,filter:g,selectButtonProps:C,...k},P)=>{let[e,r]=react.useState(l.find(t=>t.id===n)),d=g?l.filter(g):l,B=a?[...d].sort(a):d,c=recipes.selectModal();return react.useEffect(()=>{r(l.find(t=>t.id===n));},[l,n]),jsxRuntime.jsx(chunkKWKPXJMQ_cjs.a,{description:"select an item",hideDescription:!0,trigger:jsxRuntime.jsx(chunkRDNUAI55_cjs.a,{icon:e?.logo,label:jsxRuntime.jsx(chunkQOC26J56_cjs.a,{children:b}),...C,children:e?.name||"select"}),title:m,onOpenChange:t=>p?.(t),children:jsxRuntime.jsxs("div",{ref:P,...k,children:[v&&f!==void 0&&jsxRuntime.jsx(chunk4IQP4J4C_cjs.a,{type:"search",placeholder:N,className:c.search,value:f,onChange:t=>{v(t.currentTarget.value);}}),i&&jsxRuntime.jsx("span",{className:c.listTitle,children:i}),jsxRuntime.jsx("div",{className:css.cx(recipes.gridBackground(),recipes.noiseBackground(),c.box),children:jsxRuntime.jsxs("ul",{children:[B.map((t,E)=>jsxRuntime.jsxs("li",{children:[E!==0&&jsxRuntime.jsx(chunkIFXORR66_cjs.a,{}),jsxRuntime.jsx(u,{as:reactDialog.Close,onClick:F=>y?.(F,t),isSelected:t.id===e?.id,...t})]},t.id)),!B.length&&jsxRuntime.jsx("li",{className:css.cx(c.listItem,c.emptyText),children:"no results were found"})]})})]})})});_.displayName="SelectModal";var V={Item:u};

exports.a = _;
exports.b = V;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-5VYVKDGI.cjs.map