'use client';'use strict';

var chunkQOC26J56_cjs = require('./chunk-QOC26J56.cjs');
var chunkX2HUCXTW_cjs = require('./chunk-X2HUCXTW.cjs');
var chunk4W5NLZYL_cjs = require('./chunk-4W5NLZYL.cjs');
var chunkYF5YSZHI_cjs = require('./chunk-YF5YSZHI.cjs');
var icons = require('@onbeam/icons');
var css = require('@onbeam/styled-system/css');
var react = require('react');
var recipes = require('@onbeam/styled-system/recipes');
var utils = require('@onbeam/utils');
var jsxRuntime = require('react/jsx-runtime');

var o=(e=>(e[e.MIN=.1]="MIN",e[e.DEFAULT=.5]="DEFAULT",e[e.MAX=1]="MAX",e))(o||{});var y=Object.keys(o).filter(n=>Number.isNaN(Number(n))),i=2,m=10**i,g=n=>n.toFixed(i),c=n=>g(n/m);var I=react.forwardRef(({className:n,value:a,onChange:x,...e},b)=>{let[h,v]=react.useState(""),s=recipes.transactionSlippageSettings(),l=t=>{v(t);let p=utils.parseFloatToInt(t,i);!utils.isDefined(p)||p>=5e3||p<0||x(p);};return jsxRuntime.jsxs("div",{className:css.cx(s.slippage,n),children:[jsxRuntime.jsx(chunkYF5YSZHI_cjs.a,{ref:b,value:h,onChange:t=>l(t.currentTarget.value),onBlur:()=>l(c(a)),placeholder:c(a),inputMode:"numeric",size:"sm",rightAddon:"%",label:jsxRuntime.jsxs(chunkQOC26J56_cjs.a,{children:[jsxRuntime.jsx("span",{children:"slippage tolerance"}),jsxRuntime.jsx(chunkX2HUCXTW_cjs.a,{width:250,label:"your transaction will revert if the price change unfavorably by more than this percentage",children:jsxRuntime.jsx(icons.TooltipGreyIcon,{height:16,width:16})})]}),...e}),jsxRuntime.jsx("div",{className:s.slippageButtonContainer,children:y.map(t=>jsxRuntime.jsxs(chunk4W5NLZYL_cjs.a,{type:"button",size:"sm",variant:a/m===o[t]?"primary":"secondary",className:s.slippageButton,onClick:()=>l(g(o[t])),children:[o[t],"%"]},t))})]})});I.displayName="TransactionSlippageSettings";

exports.a = o;
exports.b = I;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-CXZ4S26T.cjs.map