@babylonlabs-io/core-ui 1.10.1 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),v=require("react"),C=require("tailwind-merge"),Cn=require("react-dom");function Nn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ae=Nn(v),Wi=Nn(Cn);function Ze({value:e,defaultValue:t,onStateChange:r}={}){const[n,i]=v.useState(t),{current:s}=v.useRef(e!=null),a=s?e:n,o=v.useCallback(l=>{s||i(l),r==null||r(l)},[s,r,i]);return[a,o]}const fr=v.createContext({disabled:!1,expanded:!1});function Ui({expanded:e,defaultExpanded:t,onChange:r,className:n,disabled:i=!1,children:s}){const[a=!1,o]=Ze({value:e,defaultValue:t,onStateChange:r}),l=v.useCallback(()=>{o(!a)},[o,a]),f=v.useMemo(()=>({defaultExpanded:t,disabled:i,expanded:a&&!i,toggle:i?void 0:l}),[t,a,i,l]);return c.jsx(fr.Provider,{value:f,children:c.jsx("div",{className:C.twJoin("bbn-accordion",i&&"bbn-accordion-disabled",n),children:s})})}const Ge=v.forwardRef(({variant:e="contained",size:t="large",color:r="primary",fluid:n=!1,className:i,disabled:s,...a},o)=>c.jsx("button",{...a,disabled:s,ref:o,className:C.twJoin("bbn-btn",`bbn-btn-${e}`,`bbn-btn-${r}`,`bbn-btn-${t}`,n&&"bbn-btn-fluid",i)}));Ge.displayName="Button";const dr=({className:e,...t})=>c.jsx("button",{...t,className:C.twJoin("bbn-btn-icon",e)}),On=v.forwardRef(({className:e,...t},r)=>c.jsx(Ge,{...t,ref:r,variant:"contained",className:C.twJoin("!bg-error-main text-white font-medium !text-sm hover:!bg-error-main/90 transition-colors",e)}));On.displayName="WalletDisconnectButton";function Ji({className:e,iconClassName:t,children:r,renderIcon:n=()=>null}){const{expanded:i,toggle:s}=v.useContext(fr),a=n(i);return c.jsxs("div",{className:C.twJoin("bbn-accordion-summary",e),onClick:s,children:[r,a&&c.jsx(dr,{className:C.twJoin("bbn-accordion-icon",t),children:a})]})}function hr(e,t){return typeof e!="number"?typeof t=="number"?hr(t):t:`${e}px`}function qi(e=!0){const[t,r]=v.useState("0px"),[n,i]=v.useState(),s=v.useRef(null);return v.useEffect(()=>{const a=new ResizeObserver(o=>{const[l]=o;r(hr(l.target.clientHeight)??"0px")});i(a)},[]),v.useEffect(function(){const{current:o}=s;if(!(!e||!o))return n==null||n.observe(o),()=>{n==null||n.unobserve(o)}},[e,n]),{height:t,ref:s}}function zi({unmountOnExit:e=!1,animationDuration:t=200,className:r,wrapperClassName:n,children:i}){const{expanded:s}=v.useContext(fr),[a,o]=v.useState(s),l=a||!e,{height:f,ref:u}=qi(l);return v.useEffect(function(){if(s===a)return;if(s){o(!0);return}const p=setTimeout(o,t,!1);return()=>{clearTimeout(p)}},[s,a,t]),c.jsx("div",{className:C.twJoin("bbn-accordion-details",n),style:{height:s?f:"0px",visibility:a?"visible":"hidden",transitionDuration:`${t}ms`},children:l?c.jsx("div",{ref:u,className:C.twJoin("bbn-accordion-content",r),children:i}):null})}const q=v.forwardRef(({variant:e="body1",as:t="p",children:r,className:n,...i},s)=>v.createElement(t,{...i,ref:s,className:C.twJoin(`bbn-text-${e}`,n)},r));q.displayName="Text";const Xt=v.forwardRef(({variant:e,as:t=e,children:r,className:n,...i},s)=>v.createElement(t,{...i,ref:s,className:C.twJoin(`bbn-${e}`,n)},r));Xt.displayName="Heading";function It({className:e,style:t,size:r="large",variant:n="circular",alt:i,url:s,children:a}){return c.jsx("div",{style:t,className:C.twJoin("bbn-avatar",`bbn-avatar-${r}`,`bbn-avatar-${n}`,e),children:s?c.jsx("img",{className:"bbn-avatar-img",src:s,alt:i}):a})}const Zi=({max:e=1/0,className:t,children:r,avatarClassName:n,variant:i,...s})=>{const a=v.Children.count(r);return c.jsxs("div",{className:C.twJoin("bbn-avatar-group",t),children:[v.Children.map(r,(o,l)=>v.isValidElement(o)&&l+1<=e?v.cloneElement(o,{...s,className:C.twMerge(n,o.props.className),variant:i}):null),a>e&&c.jsxs(It,{size:s.size,variant:i,className:n,children:["+",a-e]})]})},kn=v.forwardRef(function({label:t,checked:r,defaultChecked:n=!1,inputProps:i,orientation:s="left",disabled:a=!1,className:o,inputType:l,labelClassName:f,renderIcon:u,onChange:d,...p},g){const[N=!1,x]=Ze({value:r,defaultValue:n,onStateChange:d});function y(w){var _;x(w.currentTarget.checked),(_=i==null?void 0:i.onChange)==null||_.call(i,w)}const M=c.jsxs("span",{className:C.twJoin("bbn-switcher",a&&"bbn-switcher-disabled",o),children:[u(N),c.jsx("input",{ref:g,type:l,disabled:a,className:"bbn-switcher-input",...p,...i,checked:N,onChange:y})]});return t?c.jsxs(q,{as:"label",variant:"body1",className:C.twJoin("bbn-switcher-label",s==="left"?"bbn-switcher-left":"bbn-switcher-right",f),children:[M,t]}):M}),Gi={false:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.jsx("path",{d:"M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z",fill:"currentColor"})}),true:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.jsx("path",{d:"M19 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.11 21 21 20.1 21 19V5C21 3.9 20.11 3 19 3ZM10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",fill:"currentColor"})})},Sn=v.forwardRef(function(t,r){return c.jsx(kn,{ref:r,...t,inputType:"checkbox",renderIcon:n=>Gi[n.toString()]})}),Xi={true:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.jsx("path",{d:"M12 7C9.24 7 7 9.24 7 12C7 14.76 9.24 17 12 17C14.76 17 17 14.76 17 12C17 9.24 14.76 7 12 7ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z",fill:"currentColor"})}),false:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z",fill:"currentColor"})})},En=v.forwardRef(function(t,r){return c.jsx(kn,{ref:r,...t,inputType:"radio",renderIcon:n=>Xi[n.toString()]})});var Fn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},qr=v.createContext&&v.createContext(Fn),Yi=["attr","size","title"];function Ki(e,t){if(e==null)return{};var r=Qi(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Qi(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$t.apply(this,arguments)}function zr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zr(Object(r),!0).forEach(function(n){es(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function es(e,t,r){return t=ts(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ts(e){var t=rs(e,"string");return typeof t=="symbol"?t:t+""}function rs(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function An(e){return e&&e.map((t,r)=>v.createElement(t.tag,Ht({key:r},t.attr),An(t.child)))}function wt(e){return t=>v.createElement(ns,$t({attr:Ht({},e.attr)},t),An(e.child))}function ns(e){var t=r=>{var{attr:n,size:i,title:s}=e,a=Ki(e,Yi),o=i||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),v.createElement("svg",$t({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,a,{className:l,style:Ht(Ht({color:e.color||r.color},r.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&v.createElement("title",null,s),e.children)};return qr!==void 0?v.createElement(qr.Consumer,null,r=>t(r)):t(Fn)}function is(e){return wt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 16L6 10H18L12 16Z"},child:[]}]})(e)}function ss(e){return wt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"},child:[]}]})(e)}function os(e){return wt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 8L18 14H6L12 8Z"},child:[]}]})(e)}var Zr=function(t){return t.reduce(function(r,n){var i=n[0],s=n[1];return r[i]=s,r},{})},Gr=typeof window<"u"&&window.document&&window.document.createElement?Ae.useLayoutEffect:Ae.useEffect,le="top",me="bottom",ve="right",ce="left",pr="auto",jt=[le,me,ve,ce],rt="start",bt="end",as="clippingParents",Ln="viewport",ft="popper",ls="reference",Xr=jt.reduce(function(e,t){return e.concat([t+"-"+rt,t+"-"+bt])},[]),Vn=[].concat(jt,[pr]).reduce(function(e,t){return e.concat([t,t+"-"+rt,t+"-"+bt])},[]),cs="beforeRead",us="read",fs="afterRead",ds="beforeMain",hs="main",ps="afterMain",ms="beforeWrite",vs="write",gs="afterWrite",bs=[cs,us,fs,ds,hs,ps,ms,vs,gs];function ke(e){return e?(e.nodeName||"").toLowerCase():null}function de(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xe(e){var t=de(e).Element;return e instanceof t||e instanceof Element}function pe(e){var t=de(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function mr(e){if(typeof ShadowRoot>"u")return!1;var t=de(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function xs(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},i=t.attributes[r]||{},s=t.elements[r];!pe(s)||!ke(s)||(Object.assign(s.style,n),Object.keys(i).forEach(function(a){var o=i[a];o===!1?s.removeAttribute(a):s.setAttribute(a,o===!0?"":o)}))})}function ys(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var i=t.elements[n],s=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),o=a.reduce(function(l,f){return l[f]="",l},{});!pe(i)||!ke(i)||(Object.assign(i.style,o),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}}const ws={name:"applyStyles",enabled:!0,phase:"write",fn:xs,effect:ys,requires:["computeStyles"]};function Oe(e){return e.split("-")[0]}var qe=Math.max,Wt=Math.min,nt=Math.round;function lr(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Mn(){return!/^((?!chrome|android).)*safari/i.test(lr())}function it(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),i=1,s=1;t&&pe(e)&&(i=e.offsetWidth>0&&nt(n.width)/e.offsetWidth||1,s=e.offsetHeight>0&&nt(n.height)/e.offsetHeight||1);var a=Xe(e)?de(e):window,o=a.visualViewport,l=!Mn()&&r,f=(n.left+(l&&o?o.offsetLeft:0))/i,u=(n.top+(l&&o?o.offsetTop:0))/s,d=n.width/i,p=n.height/s;return{width:d,height:p,top:u,right:f+d,bottom:u+p,left:f,x:f,y:u}}function vr(e){var t=it(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Dn(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&mr(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ve(e){return de(e).getComputedStyle(e)}function js(e){return["table","td","th"].indexOf(ke(e))>=0}function Pe(e){return((Xe(e)?e.ownerDocument:e.document)||window.document).documentElement}function Yt(e){return ke(e)==="html"?e:e.assignedSlot||e.parentNode||(mr(e)?e.host:null)||Pe(e)}function Yr(e){return!pe(e)||Ve(e).position==="fixed"?null:e.offsetParent}function Cs(e){var t=/firefox/i.test(lr()),r=/Trident/i.test(lr());if(r&&pe(e)){var n=Ve(e);if(n.position==="fixed")return null}var i=Yt(e);for(mr(i)&&(i=i.host);pe(i)&&["html","body"].indexOf(ke(i))<0;){var s=Ve(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function Ct(e){for(var t=de(e),r=Yr(e);r&&js(r)&&Ve(r).position==="static";)r=Yr(r);return r&&(ke(r)==="html"||ke(r)==="body"&&Ve(r).position==="static")?t:r||Cs(e)||t}function gr(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function pt(e,t,r){return qe(e,Wt(t,r))}function Ns(e,t,r){var n=pt(e,t,r);return n>r?r:n}function _n(){return{top:0,right:0,bottom:0,left:0}}function Tn(e){return Object.assign({},_n(),e)}function Rn(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var Os=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Tn(typeof t!="number"?t:Rn(t,jt))};function ks(e){var t,r=e.state,n=e.name,i=e.options,s=r.elements.arrow,a=r.modifiersData.popperOffsets,o=Oe(r.placement),l=gr(o),f=[ce,ve].indexOf(o)>=0,u=f?"height":"width";if(!(!s||!a)){var d=Os(i.padding,r),p=vr(s),g=l==="y"?le:ce,N=l==="y"?me:ve,x=r.rects.reference[u]+r.rects.reference[l]-a[l]-r.rects.popper[u],y=a[l]-r.rects.reference[l],M=Ct(s),w=M?l==="y"?M.clientHeight||0:M.clientWidth||0:0,_=x/2-y/2,E=d[g],A=w-p[u]-d[N],L=w/2-p[u]/2+_,O=pt(E,L,A),I=l;r.modifiersData[n]=(t={},t[I]=O,t.centerOffset=O-L,t)}}function Ss(e){var t=e.state,r=e.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Dn(t.elements.popper,i)&&(t.elements.arrow=i))}const Es={name:"arrow",enabled:!0,phase:"main",fn:ks,effect:Ss,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function st(e){return e.split("-")[1]}var Fs={top:"auto",right:"auto",bottom:"auto",left:"auto"};function As(e,t){var r=e.x,n=e.y,i=t.devicePixelRatio||1;return{x:nt(r*i)/i||0,y:nt(n*i)/i||0}}function Kr(e){var t,r=e.popper,n=e.popperRect,i=e.placement,s=e.variation,a=e.offsets,o=e.position,l=e.gpuAcceleration,f=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=a.x,g=p===void 0?0:p,N=a.y,x=N===void 0?0:N,y=typeof u=="function"?u({x:g,y:x}):{x:g,y:x};g=y.x,x=y.y;var M=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),_=ce,E=le,A=window;if(f){var L=Ct(r),O="clientHeight",I="clientWidth";if(L===de(r)&&(L=Pe(r),Ve(L).position!=="static"&&o==="absolute"&&(O="scrollHeight",I="scrollWidth")),L=L,i===le||(i===ce||i===ve)&&s===bt){E=me;var B=d&&L===A&&A.visualViewport?A.visualViewport.height:L[O];x-=B-n.height,x*=l?1:-1}if(i===ce||(i===le||i===me)&&s===bt){_=ve;var $=d&&L===A&&A.visualViewport?A.visualViewport.width:L[I];g-=$-n.width,g*=l?1:-1}}var R=Object.assign({position:o},f&&Fs),V=u===!0?As({x:g,y:x},de(r)):{x:g,y:x};if(g=V.x,x=V.y,l){var P;return Object.assign({},R,(P={},P[E]=w?"0":"",P[_]=M?"0":"",P.transform=(A.devicePixelRatio||1)<=1?"translate("+g+"px, "+x+"px)":"translate3d("+g+"px, "+x+"px, 0)",P))}return Object.assign({},R,(t={},t[E]=w?x+"px":"",t[_]=M?g+"px":"",t.transform="",t))}function Ls(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=n===void 0?!0:n,s=r.adaptive,a=s===void 0?!0:s,o=r.roundOffsets,l=o===void 0?!0:o,f={placement:Oe(t.placement),variation:st(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Kr(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Kr(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Vs={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ls,data:{}};var _t={passive:!0};function Ms(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,s=i===void 0?!0:i,a=n.resize,o=a===void 0?!0:a,l=de(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&f.forEach(function(u){u.addEventListener("scroll",r.update,_t)}),o&&l.addEventListener("resize",r.update,_t),function(){s&&f.forEach(function(u){u.removeEventListener("scroll",r.update,_t)}),o&&l.removeEventListener("resize",r.update,_t)}}const Ds={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Ms,data:{}};var _s={left:"right",right:"left",bottom:"top",top:"bottom"};function Rt(e){return e.replace(/left|right|bottom|top/g,function(t){return _s[t]})}var Ts={start:"end",end:"start"};function Qr(e){return e.replace(/start|end/g,function(t){return Ts[t]})}function br(e){var t=de(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function xr(e){return it(Pe(e)).left+br(e).scrollLeft}function Rs(e,t){var r=de(e),n=Pe(e),i=r.visualViewport,s=n.clientWidth,a=n.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;var f=Mn();(f||!f&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o+xr(e),y:l}}function Ps(e){var t,r=Pe(e),n=br(e),i=(t=e.ownerDocument)==null?void 0:t.body,s=qe(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=qe(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),o=-n.scrollLeft+xr(e),l=-n.scrollTop;return Ve(i||r).direction==="rtl"&&(o+=qe(r.clientWidth,i?i.clientWidth:0)-s),{width:s,height:a,x:o,y:l}}function yr(e){var t=Ve(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function Pn(e){return["html","body","#document"].indexOf(ke(e))>=0?e.ownerDocument.body:pe(e)&&yr(e)?e:Pn(Yt(e))}function mt(e,t){var r;t===void 0&&(t=[]);var n=Pn(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),s=de(n),a=i?[s].concat(s.visualViewport||[],yr(n)?n:[]):n,o=t.concat(a);return i?o:o.concat(mt(Yt(a)))}function cr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Bs(e,t){var r=it(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function en(e,t,r){return t===Ln?cr(Rs(e,r)):Xe(t)?Bs(t,r):cr(Ps(Pe(e)))}function Is(e){var t=mt(Yt(e)),r=["absolute","fixed"].indexOf(Ve(e).position)>=0,n=r&&pe(e)?Ct(e):e;return Xe(n)?t.filter(function(i){return Xe(i)&&Dn(i,n)&&ke(i)!=="body"}):[]}function $s(e,t,r,n){var i=t==="clippingParents"?Is(e):[].concat(t),s=[].concat(i,[r]),a=s[0],o=s.reduce(function(l,f){var u=en(e,f,n);return l.top=qe(u.top,l.top),l.right=Wt(u.right,l.right),l.bottom=Wt(u.bottom,l.bottom),l.left=qe(u.left,l.left),l},en(e,a,n));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Bn(e){var t=e.reference,r=e.element,n=e.placement,i=n?Oe(n):null,s=n?st(n):null,a=t.x+t.width/2-r.width/2,o=t.y+t.height/2-r.height/2,l;switch(i){case le:l={x:a,y:t.y-r.height};break;case me:l={x:a,y:t.y+t.height};break;case ve:l={x:t.x+t.width,y:o};break;case ce:l={x:t.x-r.width,y:o};break;default:l={x:t.x,y:t.y}}var f=i?gr(i):null;if(f!=null){var u=f==="y"?"height":"width";switch(s){case rt:l[f]=l[f]-(t[u]/2-r[u]/2);break;case bt:l[f]=l[f]+(t[u]/2-r[u]/2);break}}return l}function xt(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=n===void 0?e.placement:n,s=r.strategy,a=s===void 0?e.strategy:s,o=r.boundary,l=o===void 0?as:o,f=r.rootBoundary,u=f===void 0?Ln:f,d=r.elementContext,p=d===void 0?ft:d,g=r.altBoundary,N=g===void 0?!1:g,x=r.padding,y=x===void 0?0:x,M=Tn(typeof y!="number"?y:Rn(y,jt)),w=p===ft?ls:ft,_=e.rects.popper,E=e.elements[N?w:p],A=$s(Xe(E)?E:E.contextElement||Pe(e.elements.popper),l,u,a),L=it(e.elements.reference),O=Bn({reference:L,element:_,placement:i}),I=cr(Object.assign({},_,O)),B=p===ft?I:L,$={top:A.top-B.top+M.top,bottom:B.bottom-A.bottom+M.bottom,left:A.left-B.left+M.left,right:B.right-A.right+M.right},R=e.modifiersData.offset;if(p===ft&&R){var V=R[i];Object.keys($).forEach(function(P){var W=[ve,me].indexOf(P)>=0?1:-1,Y=[le,me].indexOf(P)>=0?"y":"x";$[P]+=V[Y]*W})}return $}function Hs(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=r.boundary,s=r.rootBoundary,a=r.padding,o=r.flipVariations,l=r.allowedAutoPlacements,f=l===void 0?Vn:l,u=st(n),d=u?o?Xr:Xr.filter(function(N){return st(N)===u}):jt,p=d.filter(function(N){return f.indexOf(N)>=0});p.length===0&&(p=d);var g=p.reduce(function(N,x){return N[x]=xt(e,{placement:x,boundary:i,rootBoundary:s,padding:a})[Oe(x)],N},{});return Object.keys(g).sort(function(N,x){return g[N]-g[x]})}function Ws(e){if(Oe(e)===pr)return[];var t=Rt(e);return[Qr(e),t,Qr(t)]}function Us(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,s=i===void 0?!0:i,a=r.altAxis,o=a===void 0?!0:a,l=r.fallbackPlacements,f=r.padding,u=r.boundary,d=r.rootBoundary,p=r.altBoundary,g=r.flipVariations,N=g===void 0?!0:g,x=r.allowedAutoPlacements,y=t.options.placement,M=Oe(y),w=M===y,_=l||(w||!N?[Rt(y)]:Ws(y)),E=[y].concat(_).reduce(function(Me,be){return Me.concat(Oe(be)===pr?Hs(t,{placement:be,boundary:u,rootBoundary:d,padding:f,flipVariations:N,allowedAutoPlacements:x}):be)},[]),A=t.rects.reference,L=t.rects.popper,O=new Map,I=!0,B=E[0],$=0;$<E.length;$++){var R=E[$],V=Oe(R),P=st(R)===rt,W=[le,me].indexOf(V)>=0,Y=W?"width":"height",z=xt(t,{placement:R,boundary:u,rootBoundary:d,altBoundary:p,padding:f}),K=W?P?ve:ce:P?me:le;A[Y]>L[Y]&&(K=Rt(K));var we=Rt(K),oe=[];if(s&&oe.push(z[V]<=0),o&&oe.push(z[K]<=0,z[we]<=0),oe.every(function(Me){return Me})){B=R,I=!1;break}O.set(R,oe)}if(I)for(var Ee=N?3:1,et=function(be){var He=E.find(function(De){var je=O.get(De);if(je)return je.slice(0,be).every(function(We){return We})});if(He)return B=He,"break"},Ie=Ee;Ie>0;Ie--){var $e=et(Ie);if($e==="break")break}t.placement!==B&&(t.modifiersData[n]._skip=!0,t.placement=B,t.reset=!0)}}const Js={name:"flip",enabled:!0,phase:"main",fn:Us,requiresIfExists:["offset"],data:{_skip:!1}};function tn(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function rn(e){return[le,ve,me,ce].some(function(t){return e[t]>=0})}function qs(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,s=t.modifiersData.preventOverflow,a=xt(t,{elementContext:"reference"}),o=xt(t,{altBoundary:!0}),l=tn(a,n),f=tn(o,i,s),u=rn(l),d=rn(f);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const zs={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:qs};function Zs(e,t,r){var n=Oe(e),i=[ce,le].indexOf(n)>=0?-1:1,s=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,a=s[0],o=s[1];return a=a||0,o=(o||0)*i,[ce,ve].indexOf(n)>=0?{x:o,y:a}:{x:a,y:o}}function Gs(e){var t=e.state,r=e.options,n=e.name,i=r.offset,s=i===void 0?[0,0]:i,a=Vn.reduce(function(u,d){return u[d]=Zs(d,t.rects,s),u},{}),o=a[t.placement],l=o.x,f=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=f),t.modifiersData[n]=a}const Xs={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Gs};function Ys(e){var t=e.state,r=e.name;t.modifiersData[r]=Bn({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Ks={name:"popperOffsets",enabled:!0,phase:"read",fn:Ys,data:{}};function Qs(e){return e==="x"?"y":"x"}function eo(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,s=i===void 0?!0:i,a=r.altAxis,o=a===void 0?!1:a,l=r.boundary,f=r.rootBoundary,u=r.altBoundary,d=r.padding,p=r.tether,g=p===void 0?!0:p,N=r.tetherOffset,x=N===void 0?0:N,y=xt(t,{boundary:l,rootBoundary:f,padding:d,altBoundary:u}),M=Oe(t.placement),w=st(t.placement),_=!w,E=gr(M),A=Qs(E),L=t.modifiersData.popperOffsets,O=t.rects.reference,I=t.rects.popper,B=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,$=typeof B=="number"?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(L){if(s){var P,W=E==="y"?le:ce,Y=E==="y"?me:ve,z=E==="y"?"height":"width",K=L[E],we=K+y[W],oe=K-y[Y],Ee=g?-I[z]/2:0,et=w===rt?O[z]:I[z],Ie=w===rt?-I[z]:-O[z],$e=t.elements.arrow,Me=g&&$e?vr($e):{width:0,height:0},be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:_n(),He=be[W],De=be[Y],je=pt(0,O[z],Me[z]),We=_?O[z]/2-Ee-je-He-$.mainAxis:et-je-He-$.mainAxis,ct=_?-O[z]/2+Ee+je+De+$.mainAxis:Ie+je+De+$.mainAxis,ut=t.elements.arrow&&Ct(t.elements.arrow),St=ut?E==="y"?ut.clientTop||0:ut.clientLeft||0:0,Et=(P=R==null?void 0:R[E])!=null?P:0,Ft=K+We-Et-St,At=K+ct-Et,Lt=pt(g?Wt(we,Ft):we,K,g?qe(oe,At):oe);L[E]=Lt,V[E]=Lt-K}if(o){var Vt,Wr=E==="x"?le:ce,Mt=E==="x"?me:ve,h=L[A],m=A==="y"?"height":"width",b=h+y[Wr],F=h-y[Mt],k=[le,ce].indexOf(M)!==-1,j=(Vt=R==null?void 0:R[A])!=null?Vt:0,T=k?b:h-O[m]-I[m]-j+$.altAxis,H=k?h+O[m]+I[m]-j-$.altAxis:F,U=g&&k?Ns(T,h,H):pt(g?T:b,h,g?H:F);L[A]=U,V[A]=U-h}t.modifiersData[n]=V}}const to={name:"preventOverflow",enabled:!0,phase:"main",fn:eo,requiresIfExists:["offset"]};function ro(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function no(e){return e===de(e)||!pe(e)?br(e):ro(e)}function io(e){var t=e.getBoundingClientRect(),r=nt(t.width)/e.offsetWidth||1,n=nt(t.height)/e.offsetHeight||1;return r!==1||n!==1}function so(e,t,r){r===void 0&&(r=!1);var n=pe(t),i=pe(t)&&io(t),s=Pe(t),a=it(e,i,r),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((ke(t)!=="body"||yr(s))&&(o=no(t)),pe(t)?(l=it(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=xr(s))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function oo(e){var t=new Map,r=new Set,n=[];e.forEach(function(s){t.set(s.name,s)});function i(s){r.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(o){if(!r.has(o)){var l=t.get(o);l&&i(l)}}),n.push(s)}return e.forEach(function(s){r.has(s.name)||i(s)}),n}function ao(e){var t=oo(e);return bs.reduce(function(r,n){return r.concat(t.filter(function(i){return i.phase===n}))},[])}function lo(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function co(e){var t=e.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var nn={placement:"bottom",modifiers:[],strategy:"absolute"};function sn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function uo(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,i=t.defaultOptions,s=i===void 0?nn:i;return function(o,l,f){f===void 0&&(f=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},nn,s),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],p=!1,g={state:u,setOptions:function(M){var w=typeof M=="function"?M(u.options):M;x(),u.options=Object.assign({},s,u.options,w),u.scrollParents={reference:Xe(o)?mt(o):o.contextElement?mt(o.contextElement):[],popper:mt(l)};var _=ao(co([].concat(n,u.options.modifiers)));return u.orderedModifiers=_.filter(function(E){return E.enabled}),N(),g.update()},forceUpdate:function(){if(!p){var M=u.elements,w=M.reference,_=M.popper;if(sn(w,_)){u.rects={reference:so(w,Ct(_),u.options.strategy==="fixed"),popper:vr(_)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function($){return u.modifiersData[$.name]=Object.assign({},$.data)});for(var E=0;E<u.orderedModifiers.length;E++){if(u.reset===!0){u.reset=!1,E=-1;continue}var A=u.orderedModifiers[E],L=A.fn,O=A.options,I=O===void 0?{}:O,B=A.name;typeof L=="function"&&(u=L({state:u,options:I,name:B,instance:g})||u)}}}},update:lo(function(){return new Promise(function(y){g.forceUpdate(),y(u)})}),destroy:function(){x(),p=!0}};if(!sn(o,l))return g;g.setOptions(f).then(function(y){!p&&f.onFirstUpdate&&f.onFirstUpdate(y)});function N(){u.orderedModifiers.forEach(function(y){var M=y.name,w=y.options,_=w===void 0?{}:w,E=y.effect;if(typeof E=="function"){var A=E({state:u,name:M,instance:g,options:_}),L=function(){};d.push(A||L)}})}function x(){d.forEach(function(y){return y()}),d=[]}return g}}var fo=[Ds,Ks,Vs,ws,Xs,Js,to,Es,zs],ho=uo({defaultModifiers:fo}),Tt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function In(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var po=typeof Element<"u",mo=typeof Map=="function",vo=typeof Set=="function",go=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Pt(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Pt(e[n],t[n]))return!1;return!0}var s;if(mo&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;for(s=e.entries();!(n=s.next()).done;)if(!Pt(n.value[1],t.get(n.value[0])))return!1;return!0}if(vo&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(go&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;if(po&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!Pt(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}var bo=function(t,r){try{return Pt(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const xo=In(bo);var yo=[],wo=function(t,r,n){n===void 0&&(n={});var i=Ae.useRef(null),s={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||yo},a=Ae.useState({styles:{popper:{position:s.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],l=a[1],f=Ae.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(g){var N=g.state,x=Object.keys(N.elements);Wi.flushSync(function(){l({styles:Zr(x.map(function(y){return[y,N.styles[y]||{}]})),attributes:Zr(x.map(function(y){return[y,N.attributes[y]]}))})})},requires:["computeStyles"]}},[]),u=Ae.useMemo(function(){var p={onFirstUpdate:s.onFirstUpdate,placement:s.placement,strategy:s.strategy,modifiers:[].concat(s.modifiers,[f,{name:"applyStyles",enabled:!1}])};return xo(i.current,p)?i.current||p:(i.current=p,p)},[s.onFirstUpdate,s.placement,s.strategy,s.modifiers,f]),d=Ae.useRef();return Gr(function(){d.current&&d.current.setOptions(u)},[u]),Gr(function(){if(!(t==null||r==null)){var p=n.createPopper||ho,g=p(t,r,u);return d.current=g,function(){g.destroy(),d.current=null}}},[t,r,n.createPopper]),{state:d.current?d.current.state:null,styles:o.styles,attributes:o.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};function Nt({children:e,mounted:t=!1,rootClassName:r="portal-root"}){const[n,i]=v.useState(null);return v.useEffect(()=>{if(!t){i(null);return}const s=document.createElement("div");s.className=r,i(s),document.body.appendChild(s);const a=()=>{document.documentElement.classList.contains("dark")||document.body.classList.contains("dark")||document.documentElement.getAttribute("data-mode")==="dark"||document.body.getAttribute("data-mode")==="dark"?(s.classList.add("dark"),s.setAttribute("data-mode","dark")):(s.classList.remove("dark"),s.setAttribute("data-mode","light"))};a();const o=new MutationObserver(a);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-mode"]}),o.observe(document.body,{attributes:!0,attributeFilter:["class","data-mode"]}),()=>{o.disconnect(),document.body.removeChild(s)}},[t]),n?Cn.createPortal(e,n):null}function jo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function $n(e){const t=v.useRef(e);return jo(t.current,e)||(t.current=e),t.current}function Hn(e,t=()=>null,{enabled:r=!0}={}){const n=Array.isArray(e)?e:[e],i=$n(n);v.useEffect(()=>{function s(a){r&&i.every(o=>!(o!=null&&o.contains(a.target)))&&t()}return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[i,r,t])}function wr({open:e=!1,className:t,anchorEl:r,placement:n="bottom-start",offset:i=[0,0],children:s,style:a,onClickOutside:o}){const[l,f]=v.useState(null),{styles:u}=wo(r,l,{placement:n,modifiers:[{name:"offset",options:{offset:i}}]});return Hn([l,r],o,{enabled:e}),c.jsx(Nt,{mounted:e,children:c.jsx("div",{ref:f,style:{...u.popper,...a},className:C.twJoin("bbn-popover",t),children:s})})}function Wn(e){const[t,r]=v.useState({width:0,height:0});return v.useEffect(()=>{if(!e){r({width:0,height:0});return}const n=new ResizeObserver(([i])=>{r({width:i.target.clientWidth,height:i.target.clientHeight})});return n.observe(e),()=>{n.unobserve(e)}},[e]),t}const Co=e=>e.label,jr=v.forwardRef(({disabled:e,className:t,value:r,defaultValue:n,placeholder:i="Select option",open:s,defaultOpen:a,options:o=[],optionClassName:l,popoverClassName:f,state:u="default",onOpen:d,onSelect:p,onClose:g,renderSelectedOption:N=Co,...x},y)=>{const M=v.useRef(null);v.useImperativeHandle(y,()=>M.current,[]);const{width:w}=Wn(M.current),[_,E]=Ze({value:s,defaultValue:a,onStateChange:R=>void(R?d==null?void 0:d():g==null?void 0:g())}),[A,L]=Ze({value:r,defaultValue:n,onStateChange:p}),O=v.useMemo(()=>o.find(R=>R.value===A),[o,A]),I=v.useCallback(R=>{L(R.value),E(!1)},[L,E]),B=v.useCallback(()=>{E(!1)},[E]),$=v.useCallback(()=>{e||E(!_)},[_,e,E]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{ref:M,className:C.twJoin("bbn-select",e&&"bbn-select-disabled",`bbn-select-${u}`,t),onClick:$,tabIndex:e?-1:0,...x,children:[c.jsx("span",{children:O?N(O):i}),c.jsx(ss,{className:C.twJoin("bbn-select-icon",_&&"bbn-select-icon-open"),size:20})]}),c.jsx(wr,{anchorEl:M.current,className:C.twJoin("bbn-select-menu custom-scrollbar",f),open:_&&!e,onClickOutside:B,offset:[0,4],placement:"bottom-start",style:{width:w},children:o.map(R=>c.jsx("div",{className:C.twJoin("bbn-select-option",(O==null?void 0:O.value)===R.value&&"bbn-select-option-selected",l),onClick:()=>I(R),children:R.label},R.value))})]})});jr.displayName="Select";const Kt=v.forwardRef(({className:e,prefix:t,suffix:r,disabled:n=!1,state:i="default",...s},a)=>c.jsxs("div",{className:C.twJoin("bbn-input",n&&"bbn-input-disabled",`bbn-input-${i}`),children:[t&&c.jsx("div",{className:"bbn-input-prefix",children:t}),c.jsx("input",{ref:a,className:C.twJoin("bbn-input-field",e),disabled:n,...s}),r&&c.jsx("div",{className:"bbn-input-suffix",children:r})]}));Kt.displayName="Input";function Ot({children:e,label:t,hint:r,state:n="default",className:i}){return c.jsxs("div",{className:C.twJoin("bbn-form-control",i),children:[t?c.jsxs("label",{className:"bbn-form-control-label",children:[c.jsx("div",{className:"bbn-form-control-title",children:t}),e]}):e,r&&c.jsx("div",{className:C.twJoin("bbn-form-control-hint",`bbn-form-control-hint-${n}`),children:r})]})}const Un=v.createContext({removeDialog:()=>null,updateDialog:()=>null});function No({children:e}){const[t,r]=v.useState({}),n=v.useMemo(()=>Object.values(t).some(o=>o),[t]);v.useEffect(function(){if(n){const l=document.body.offsetWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=document.body.offsetWidth-l>=1?hr(document.body.offsetWidth-l)??"":document.body.style.paddingRight}else document.body.style.overflow="",document.body.style.paddingRight=""},[n]);const i=v.useCallback(o=>{r(l=>Reflect.deleteProperty(l,o)?{...l}:l)},[]),s=v.useCallback((o,l)=>{r(f=>({...f,[o]:l}))},[]),a=v.useMemo(()=>({removeDialog:i,updateDialog:s}),[i,s]);return c.jsx(Un.Provider,{value:a,children:e})}function Cr({open:e=!1}={}){const t=v.useId(),[r,n]=v.useState(e),{updateDialog:i,removeDialog:s}=v.useContext(Un),a=e||r;v.useEffect(()=>()=>{s(t)},[t]),v.useEffect(()=>{i(t,a)},[t,a,i]),v.useEffect(()=>{e&&n(!0)},[e]);const o=v.useCallback(()=>{e||n(!1)},[e]);return{mounted:r,unmount:o}}const Jn=({open:e=!1,...t})=>c.jsx("div",{...t,className:C.twJoin("bbn-backdrop",e?"animate-backdrop-in":"animate-backdrop-out",t.className)}),qn=({children:e,open:t=!1,className:r,onClose:n,hasBackdrop:i=!0,backdropClassName:s,dialogClassName:a,...o})=>{const{mounted:l,unmount:f}=Cr({open:t});return c.jsxs(Nt,{mounted:l,children:[c.jsx("div",{...o,className:C.twJoin("bbn-dialog-wrapper",r),children:c.jsx("div",{className:C.twJoin("bbn-dialog",t?"animate-modal-in":"animate-modal-out",a),onAnimationEnd:f,children:e})}),i&&c.jsx(Jn,{className:s,open:t,onClick:n})]})},Qt=({children:e,className:t="",size:r=40,variant:n="default",background:i=!1,rounded:s=!1})=>{const a={default:"text-accent-secondary",primary:"text-primary-light",secondary:"text-accent-secondary",error:"text-error-main",success:"text-success-main","accent-primary":"text-accent-primary","accent-secondary":"text-accent-secondary"},o={default:"bg-accent-secondary/10",primary:"bg-primary-light/10 dark:bg-[#47484A]",secondary:"bg-accent-secondary/10",error:"bg-error-main/10",success:"bg-success-main/10","accent-primary":"bg-accent-primary/10","accent-secondary":"bg-accent-secondary/10"};return c.jsx("div",{className:C.twJoin("flex items-center justify-center",i&&o[n],s&&"rounded-full",i?"[&_svg]:w-4 [&_svg]:h-4":"[&_svg]:w-full [&_svg]:h-full","[&_svg_path]:fill-current",i&&"dark:[&_svg_path]:fill-white",a[n],t),style:{width:r,height:r},children:e})},Oo=({className:e="",size:t=24,variant:r="primary"})=>c.jsx(Qt,{variant:r,background:!0,rounded:!0,className:e,children:c.jsx("svg",{style:{width:t,height:t*.545},viewBox:"0 0 22 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M20 4H11.65C10.83 1.67 8.61 0 6 0C2.69 0 0 2.69 0 6C0 9.31 2.69 12 6 12C8.61 12 10.83 10.33 11.65 8H12L14 10L16 8L18 10L22 5.96L20 4ZM6 9C4.35 9 3 7.65 3 6C3 4.35 4.35 3 6 3C7.65 3 9 4.35 9 6C9 7.65 7.65 9 6 9Z"})})}),ko=({className:e="",size:t=24,variant:r="primary"})=>c.jsx(Qt,{variant:r,background:!0,rounded:!0,className:e,children:c.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 20 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M15 0H11V2H15C16.65 2 18 3.35 18 5C18 6.65 16.65 8 15 8H11V10H15C17.76 10 20 7.76 20 5C20 2.24 17.76 0 15 0ZM9 8H5C3.35 8 2 6.65 2 5C2 3.35 3.35 2 5 2H9V0H5C2.24 0 0 2.24 0 5C0 7.76 2.24 10 5 10H9V8ZM6 4H14V6H6V4Z"})})}),So=({className:e="",size:t=24,variant:r="primary"})=>c.jsx(Qt,{variant:r,background:!0,rounded:!0,className:e,children:c.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 18C5.58 18 2 14.42 2 10C2 5.58 5.58 2 10 2C14.42 2 18 5.58 18 10C18 14.42 14.42 18 10 18Z"}),c.jsx("path",{d:"M10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5C7.23858 5 5 7.23858 5 10C5 12.7614 7.23858 15 10 15Z"})]})}),Eo=({className:e="",size:t=16,variant:r="default",color:n})=>{const i=n||Nr[r];return c.jsx("svg",{style:{width:t,height:t*1.143},viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:C.twJoin("transition-opacity duration-200",i,e),children:c.jsx("path",{d:"M9.99984 0.666626H1.99984C1.2665 0.666626 0.666504 1.26663 0.666504 1.99996V11.3333H1.99984V1.99996H9.99984V0.666626ZM11.9998 3.33329H4.6665C3.93317 3.33329 3.33317 3.93329 3.33317 4.66663V14C3.33317 14.7333 3.93317 15.3333 4.6665 15.3333H11.9998C12.7332 15.3333 13.3332 14.7333 13.3332 14V4.66663C13.3332 3.93329 12.7332 3.33329 11.9998 3.33329ZM11.9998 14H4.6665V4.66663H11.9998V14Z",fill:"currentColor"})})},zn=({className:e="",size:t=14,variant:r="default",color:n})=>{const i=n||Nr[r];return c.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:C.twJoin("transition-opacity duration-200",i,e),children:c.jsx("path",{d:"M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z",fill:"currentColor"})})},Nr={default:"text-accent-primary",primary:"text-primary-light",secondary:"text-accent-secondary",error:"text-error-main",success:"text-success-main","accent-primary":"text-accent-primary","accent-secondary":"text-accent-secondary"},Or=({children:e,open:t=!1,className:r,onClose:n,...i})=>{const{mounted:s,unmount:a}=Cr({open:t});return c.jsxs(Nt,{mounted:s,children:[c.jsxs("div",{...i,className:C.twJoin("bbn-dialog-mobile",t?"animate-mobile-modal-in":"animate-mobile-modal-out",r),onAnimationEnd:a,children:[n&&c.jsx("button",{onClick:n,className:"absolute top-4 left-4 z-10 p-1.5 rounded-full bg-surface-tertiary hover:bg-surface-quaternary transition-colors","aria-label":"Close",children:c.jsx(zn,{size:14,variant:"accent-primary"})}),e]}),c.jsx(Jn,{open:t,onClick:n})]})},Zn=({className:e,children:t,title:r,onClose:n})=>c.jsxs("div",{className:C.twJoin("bbn-dialog-header",e),children:[c.jsxs("div",{className:"bbn-dialog-title",children:[c.jsx(Xt,{variant:"h5",children:r}),!!n&&c.jsx(dr,{className:"shrink-0",onClick:n,children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.jsx("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",fill:"currentColor"})})})]}),t]}),Gn=e=>c.jsx("div",{...e,className:C.twJoin("bbn-dialog-body",e.className)}),Xn=e=>c.jsx("div",{...e,className:C.twJoin("bbn-dialog-footer",e.className)});function Fo({className:e,...t}){return c.jsx("span",{...t,className:C.twJoin("bbn-chip",e)})}function Ao({size:e=40,className:t}){return c.jsx("span",{className:C.twMerge("bbn-loader text-current",t),style:{width:e,height:e},children:c.jsx("svg",{viewBox:"22 22 44 44",children:c.jsx("circle",{cx:"44",cy:"44",r:"20.2",fill:"none",stroke:"currentColor",strokeWidth:"3.6"})})})}var Yn="Expected a function",on=NaN,Lo="[object Symbol]",Vo=/^\s+|\s+$/g,Mo=/^[-+]0x[0-9a-f]+$/i,Do=/^0b[01]+$/i,_o=/^0o[0-7]+$/i,To=parseInt,Ro=typeof Tt=="object"&&Tt&&Tt.Object===Object&&Tt,Po=typeof self=="object"&&self&&self.Object===Object&&self,Bo=Ro||Po||Function("return this")(),Io=Object.prototype,$o=Io.toString,Ho=Math.max,Wo=Math.min,sr=function(){return Bo.Date.now()};function Uo(e,t,r){var n,i,s,a,o,l,f=0,u=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(Yn);t=an(t)||0,Ut(r)&&(u=!!r.leading,d="maxWait"in r,s=d?Ho(an(r.maxWait)||0,t):s,p="trailing"in r?!!r.trailing:p);function g(L){var O=n,I=i;return n=i=void 0,f=L,a=e.apply(I,O),a}function N(L){return f=L,o=setTimeout(M,t),u?g(L):a}function x(L){var O=L-l,I=L-f,B=t-O;return d?Wo(B,s-I):B}function y(L){var O=L-l,I=L-f;return l===void 0||O>=t||O<0||d&&I>=s}function M(){var L=sr();if(y(L))return w(L);o=setTimeout(M,x(L))}function w(L){return o=void 0,p&&n?g(L):(n=i=void 0,a)}function _(){o!==void 0&&clearTimeout(o),f=0,n=l=i=o=void 0}function E(){return o===void 0?a:w(sr())}function A(){var L=sr(),O=y(L);if(n=arguments,i=this,l=L,O){if(o===void 0)return N(l);if(d)return o=setTimeout(M,t),g(l)}return o===void 0&&(o=setTimeout(M,t)),a}return A.cancel=_,A.flush=E,A}function Jo(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(Yn);return Ut(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Uo(e,t,{leading:n,maxWait:t,trailing:i})}function Ut(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function qo(e){return!!e&&typeof e=="object"}function zo(e){return typeof e=="symbol"||qo(e)&&$o.call(e)==Lo}function an(e){if(typeof e=="number")return e;if(zo(e))return on;if(Ut(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ut(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Vo,"");var r=Do.test(e);return r||_o.test(e)?To(e.slice(2),r?2:8):Mo.test(e)?on:+e}var Zo=Jo;const Kn=In(Zo);function Qn(e,{onLoadMore:t,hasMore:r=!1,loading:n=!1}={}){const[i,s]=v.useState(!1);return v.useEffect(()=>{const a=Kn(l=>{const f=l.target;s(f.scrollTop>0),!n&&r&&f.scrollHeight-f.scrollTop<=f.clientHeight+100&&(t==null||t())},100),o=e.current;if(o)return o.addEventListener("scroll",a),()=>o.removeEventListener("scroll",a)},[n,r,t,e]),{isScrolledTop:i}}const ei=v.createContext({data:[],columns:[],sortStates:{},onColumnSort:void 0,onRowSelect:void 0});function ti({name:e,className:t,children:r,sorter:n,...i}){const{columns:s,sortStates:a,onColumnSort:o}=v.useContext(ei),l=a[e??""],f=l==null?void 0:l.direction;return c.jsx(q,{variant:"caption",as:"th",className:C.twJoin("bbn-cell-left",n&&"bbn-table-sortable",t),onClick:()=>{if(n&&e){const u=s.find(d=>d.key===e);o==null||o(e,u==null?void 0:u.sorter)}},"data-column":e,...i,children:c.jsxs("div",{className:"flex items-center justify-between gap-1",children:[c.jsx("span",{children:r}),n&&c.jsxs("span",{className:"bbn-table-sort-icons",children:[c.jsx(os,{className:C.twJoin("bbn-sort-icon bbn-sort-icon-up",f==="asc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")}),c.jsx(is,{className:C.twJoin("bbn-sort-icon bbn-sort-icon-down",f==="desc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")})]})]})})}function ri(e,t){const[r,n]=v.useState({}),i=v.useCallback((a,o)=>{o&&n(l=>{var p;const f=((p=l[a])==null?void 0:p.direction)??null,u=f===null?"asc":f==="asc"?"desc":null;if(u===null)return Object.fromEntries(Object.entries(l).filter(([g])=>g!==a).map(([g,N])=>[g,{...N,priority:N.priority>l[a].priority?N.priority-1:N.priority}]));const d=Math.max(0,...Object.values(l).map(g=>g.priority));return{...l,[a]:{direction:u,priority:d+1}}})},[]),s=v.useMemo(()=>{const a=Object.entries(r).filter(([,o])=>o.direction!==null).toSorted((o,l)=>l[1].priority-o[1].priority).map(([o,l])=>({column:t.find(f=>f.key===o),direction:l.direction})).filter(({column:o})=>o==null?void 0:o.sorter);return a.length===0?e:e.toSorted((o,l)=>{for(const{column:f,direction:u}of a){const d=f.sorter(o,l);if(d!==0)return u==="asc"?d:-d}return 0})},[e,t,r]);return{sortStates:r,handleColumnSort:i,sortedData:s}}function ni({className:e,render:t,value:r,columnName:n,...i}){return c.jsx(q,{variant:"body2",as:"td",className:C.twJoin("bbn-cell-left",e),"data-column":n,...i,children:t?t(r):r})}function Go({row:e,columns:t,isSelected:r,isSelectable:n,onSelect:i}){return c.jsx("tr",{className:C.twJoin(r&&"selected",!!i&&n&&"cursor-pointer",!n&&"opacity-50"),onClick:()=>i(e),children:t.map(s=>c.jsx(ni,{value:e[s.key],columnName:s.key,className:s.cellClassName,render:s.render?a=>s.render(a,e):void 0},s.key))})}function Xo({data:e,columns:t,className:r,wrapperClassName:n,hasMore:i=!1,loading:s=!1,onLoadMore:a,onRowSelect:o,isRowSelectable:l,selectedRow:f,defaultSelectedRow:u,onSelectedRowChange:d,...p},g){const N=v.useRef(null);v.useImperativeHandle(g,()=>N.current,[]);const{sortStates:x,handleColumnSort:y,sortedData:M}=ri(e,t),{isScrolledTop:w}=Qn(N,{onLoadMore:a,hasMore:i,loading:s}),[_,E]=Ze({value:f,defaultValue:u??null,onStateChange:d}),A=v.useCallback(O=>{if(!o||l&&!l(O))return;const I=_===O.id?null:O.id;E(I),o(I===null?null:O)},[o,l,_,E]),L=v.useMemo(()=>({data:M,columns:t,sortStates:x,onColumnSort:y,onRowSelect:A}),[M,t,x,y,A]);return c.jsx(ei.Provider,{value:L,children:c.jsx("div",{ref:N,className:C.twJoin("bbn-table-wrapper",n),children:c.jsxs("table",{className:C.twJoin("bbn-table",r),...p,children:[c.jsx("thead",{className:C.twJoin("bbn-table-header",w&&"scrolled-top"),children:c.jsx("tr",{children:t.map(O=>c.jsx(ti,{className:O.headerClassName,name:O.key,sorter:O.sorter,children:O.header},O.key))})}),c.jsx("tbody",{className:"bbn-table-body",children:M.map(O=>c.jsx(Go,{row:O,columns:t,isSelected:_===O.id,isSelectable:l?l(O):!0,onSelect:A},O.id))})]})})})}const Yo=v.forwardRef(Xo);function ii({as:e="div",className:t,children:r}){return v.createElement(e,{className:C.twJoin("bbn-card",t)},r)}function Ko(e){const[t=!1,r]=Ze({value:e.value,defaultValue:e.defaultValue,onStateChange:e.onChange});return c.jsxs("div",{className:"bbn-toggle",onClick:()=>void r(!t),children:[c.jsx("span",{className:"bbn-toggle-bg",children:e.activeIcon}),c.jsx("span",{className:C.twJoin("bbn-toggle-control",t&&"bbn-toggle-control-active")}),c.jsx("span",{className:"bbn-toggle-bg",children:e.inactiveIcon})]})}const Qo={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function ea({className:e,orientation:t="vertical",children:r}){return c.jsx("div",{className:C.twMerge("bbn-list",`bbn-list-${t}`,e),children:v.Children.map(r,n=>v.isValidElement(n)?v.cloneElement(n,{orientation:Qo[t]}):n)})}function ta({className:e,orientation:t="horizontal",title:r,value:n,suffix:i}){return c.jsxs("div",{className:C.twJoin("bbn-list-item",`bbn-list-item-${t}`,e),children:[c.jsx(q,{as:"div",className:C.twJoin("bbn-list-title",`bbn-list-title-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),c.jsxs(q,{as:"div",className:C.twJoin("bbn-list-value",`bbn-list-value-${t}`),variant:"body1",children:[n,i]})]})}function ra({children:e,count:t=0,max:r=99,position:n="bottom-right",color:i="error",className:s,badgeClassName:a,contentClassName:o}){const l=typeof t=="number"?t>0:t!=null,f=typeof t=="number"&&t>r?`${r}+`:t,u=`bbn-badge-${n}`,d=`bbn-badge-${i}`;return c.jsxs("div",{className:C.twJoin("bbn-badge",s),children:[e,l&&c.jsx("span",{className:C.twJoin("bbn-badge-indicator",u,d,a),children:c.jsx("span",{className:C.twJoin("bbn-badge-content",o),children:f})})]})}const er=({children:e,style:t,className:r})=>c.jsx("div",{className:C.twJoin("flex rounded bg-secondary-highlight p-4 text-accent-primary",r),style:t,children:e});function na(e){return wt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z"},child:[]},{tag:"path",attr:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z"},child:[]}]})(e)}function si({counter:e,max:t,onAdd:r,alwaysShowCounter:n=!1}){const i=e<t,s=0<e||n&&e===0;return c.jsxs("div",{className:C.twJoin("bg-primary-highlight flex overflow-hidden rounded-md border border-accent-primary w-fit",i&&"cursor-pointer",!s&&!i&&"hidden",!s&&"w-10"),onClick:i?r:void 0,children:[i&&c.jsx("div",{className:"flex h-10 w-10 items-center justify-center",children:c.jsx(na,{size:20})}),s&&c.jsxs("div",{className:C.twJoin("flex h-10 items-center px-2 text-sm sm:px-4 sm:text-base",i&&"border-l border-accent-primary"),children:[e,"/",t]})]})}const oi=v.createContext(void 0),kr=()=>v.useContext(oi),ia=({children:e,value:t})=>c.jsx(oi.Provider,{value:t,children:e}),Sr=({isOpen:e,onClose:t,title:r,children:n,className:i="",titleAlign:s="left",backIcon:a,fullHeight:o=!1,fullWidth:l=!1,showBackButton:f=!0,showDivider:u=!0,onBackdropClick:d})=>{const p={left:"text-left",center:"text-center",right:"text-right"},g=()=>f||r?c.jsxs("div",{className:C.twJoin("flex items-center p-4",u&&"border-b border-[#38708533] dark:border-[#404040]"),children:[f&&c.jsx("button",{onClick:t,className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded transition-colors hover:bg-accent-secondary/10","aria-label":"Go back",children:a||c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-accent-primary",children:c.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),r&&c.jsx("h3",{className:C.twJoin("flex-1 text-sm font-medium text-accent-primary",f?"ml-3":"",p[s]),children:r})]}):null,N=()=>c.jsxs(c.Fragment,{children:[g(),c.jsx("div",{className:"flex-1 overflow-y-auto",children:n})]});return o?c.jsxs(Nt,{mounted:!0,rootClassName:"menu-drawer-portal",children:[d&&c.jsx("div",{className:C.twJoin("fixed inset-0 z-40 bg-black/50 transition-opacity duration-300",e?"opacity-100":"pointer-events-none opacity-0"),onClick:d}),c.jsx("div",{className:C.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]","fixed inset-y-0 right-0 z-50",l?"w-full":"w-full max-w-sm",e?"translate-x-0":"translate-x-full",i),children:N()})]}):c.jsx("div",{className:C.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]","absolute inset-0 rounded-lg",e?"translate-x-0":"translate-x-full",i),children:N()})};function Er(e=768,t=100){const[r,n]=v.useState(()=>typeof window<"u"?window.innerWidth<e:!1),i=v.useRef(),s=v.useCallback(()=>{n(window.innerWidth<e)},[e]);return v.useEffect(()=>(i.current=Kn(s,t),s(),window.addEventListener("resize",i.current),()=>{i.current&&(window.removeEventListener("resize",i.current),i.current.cancel())}),[s,t]),r}const ai=({children:e,trigger:t,open:r,onOpenChange:n,placement:i="bottom-end",offset:s=[0,8],className:a,mobileMode:o="dialog"})=>{const[l,f]=v.useState(!1),u=v.useRef(null),d=Er(),p=r!==void 0?r:l,g=M=>{r===void 0&&f(M),n==null||n(M)},N=()=>g(!1),x=c.jsx("div",{className:"relative w-full overflow-hidden",children:e}),y=t||c.jsx("button",{className:"rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-800",onClick:()=>g(!p),children:"Menu"});return c.jsxs(ia,{value:{isOpen:p,setIsOpen:g,onClose:N,isMobile:d},children:[c.jsx("div",{ref:u,className:"inline-block",children:v.isValidElement(y)&&v.cloneElement(y,{onClick:()=>g(!p),"aria-haspopup":"true","aria-expanded":p})}),d?o==="dialog"?c.jsx(Or,{open:p,onClose:N,className:C.twJoin("relative bg-[#FFFFFF] dark:bg-[#252525] text-primary-main",a),children:x}):c.jsx(Sr,{isOpen:p,onClose:N,onBackdropClick:N,fullHeight:!0,fullWidth:!0,showBackButton:!0,showDivider:!1,children:x}):c.jsx(wr,{anchorEl:u.current,open:p,offset:s,placement:i,onClickOutside:N,className:C.twJoin("rounded-lg border border-[#38708533] bg-[#FFFFFF] shadow-lg dark:border-[#404040] dark:bg-[#252525]","min-w-[294px]",a),children:x})]})},li=({icon:e,name:t,description:r,onClick:n,disabled:i=!1,className:s,children:a,suffix:o,selected:l=!1,role:f="menuitem"})=>{const u=kr(),d=()=>{i||!n||(n(),u&&!o&&u.onClose())};return a?c.jsx("button",{onClick:d,disabled:i,className:C.twJoin("w-full text-left",i&&"cursor-not-allowed opacity-50",s),children:a}):c.jsxs("button",{onClick:d,disabled:i,className:C.twJoin("flex w-full items-center justify-between p-6","transition-colors hover:bg-accent-secondary/5","text-left","focus:outline-none",l&&"bg-accent-secondary/10",i&&"cursor-not-allowed opacity-50",s),role:f,"aria-selected":l,tabIndex:i?-1:0,children:[c.jsxs("div",{className:"flex items-center gap-3",children:[e&&c.jsx("div",{className:"flex-shrink-0",children:e}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("div",{className:"text-sm font-medium text-accent-primary",children:t}),r&&c.jsx("div",{className:"text-xs text-accent-secondary",children:r})]})]}),o]})},ci=({children:e,name:t,description:r,icon:n,backIcon:i,suffix:s,className:a,contentClassName:o,titleAlign:l="left"})=>{const[f,u]=v.useState(!1),d=kr(),p=c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-accent-primary",children:c.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),g=c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-accent-primary",children:c.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:()=>u(!0),className:C.twJoin("flex w-full items-center justify-between p-6","transition-colors hover:bg-accent-secondary/5","text-left focus:outline-none",a),role:"menuitem",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[n&&c.jsx("div",{className:"flex-shrink-0",children:n}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-sm font-medium text-accent-primary",children:t}),r&&c.jsx("span",{className:"mt-0.5 text-xs text-accent-secondary",children:r})]})]}),s||g]}),c.jsx(Sr,{isOpen:f,onClose:()=>u(!1),title:t||"",titleAlign:l,backIcon:i||p,fullHeight:d==null?void 0:d.isMobile,fullWidth:d==null?void 0:d.isMobile,onBackdropClick:d!=null&&d.isMobile?void 0:()=>u(!1),className:C.twJoin(d!=null&&d.isMobile?"z-60":"z-50",o),children:e})]})},sa=({label:e,description:t,onClick:r,selected:n=!1,className:i,suffix:s,disabled:a=!1})=>{const o=c.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M16.6667 5L7.5 14.1667L3.33333 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return c.jsxs("button",{role:"menuitem",onClick:r,disabled:a,className:C.twJoin("flex w-full items-center justify-between p-4","transition-colors hover:bg-accent-secondary/5","text-left focus:outline-none",n&&"bg-accent-secondary/10",a&&"cursor-not-allowed opacity-50",i),"aria-selected":n,tabIndex:a?-1:0,children:[c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("span",{className:"font-medium text-accent-primary",children:e}),t&&c.jsx("span",{className:"text-sm text-accent-secondary",children:t})]}),n&&(s||o)]})};function oa(e,t=8){if(!e||e.length<=t*2)return e;const r=e.slice(0,t),n=e.slice(-t);return`${r}...${n}`}const aa=({value:e,symbols:t=8,size:r="body2",className:n})=>e?c.jsx(q,{variant:r,className:C.twJoin("text-accent-primary",n),children:c.jsx("span",{children:oa(e,t)??e})}):null;function ui(e={}){const{copiedText:t="Copied ✓",timeout:r=2e3}=e,[n,i]=v.useState({}),[s,a]=v.useState({}),o=v.useCallback((d,p)=>{!d||!p||(navigator.clipboard.writeText(p),i(g=>({...g,[d]:!0})),a(g=>({...g,[d]:t})))},[t]),l=v.useCallback(d=>{d&&(i(p=>({...p,[d]:!1})),a(p=>({...p,[d]:""})))},[]),f=v.useCallback(d=>d&&n[d]||!1,[n]),u=v.useCallback(d=>d&&s[d]||"",[s]);return v.useEffect(()=>{const d={};return Object.entries(n).forEach(([p,g])=>{g&&(d[p]=setTimeout(()=>{l(p)},r))}),()=>{Object.values(d).forEach(p=>clearTimeout(p))}},[n,r,l]),{isCopied:f,copiedText:u,copyToClipboard:o}}const la=({children:e,value:t,className:r,onCopy:n,isCopied:i,copiedText:s,timeout:a=2e3})=>{const o=v.useId(),l={copiedText:s,timeout:a},{isCopied:f,copiedText:u,copyToClipboard:d}=ui(l),p=i!==void 0,g=p?i:f(o),N=p?s||"Copied ✓":u(o),x=y=>{y.stopPropagation(),p&&n?n(t):d(o,t)};return c.jsx("div",{className:C.twMerge("inline-flex items-center cursor-pointer hover:opacity-100 transition-opacity duration-200",r),onClick:x,children:c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:C.twMerge("transition-opacity duration-300 ease-in-out",g&&"opacity-0"),children:e}),g&&c.jsx("div",{className:C.twMerge("absolute inset-0 flex items-center transition-opacity duration-300 ease-in-out text-green-600","opacity-100"),children:N})]})})};var kt=e=>e.type==="checkbox",Je=e=>e instanceof Date,se=e=>e==null;const fi=e=>typeof e=="object";var ee=e=>!se(e)&&!Array.isArray(e)&&fi(e)&&!Je(e),di=e=>ee(e)&&e.target?kt(e.target)?e.target.checked:e.target.value:e,ca=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,hi=(e,t)=>e.has(ca(t)),ua=e=>{const t=e.constructor&&e.constructor.prototype;return ee(t)&&t.hasOwnProperty("isPrototypeOf")},Fr=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ne(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Fr&&(e instanceof Blob||n))&&(r||ee(e)))if(t=r?[]:{},!r&&!ua(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=ne(e[i]));else return e;return t}var tr=e=>/^\w*$/.test(e),Q=e=>e===void 0,Ar=e=>Array.isArray(e)?e.filter(Boolean):[],Lr=e=>Ar(e.replace(/["|']|\]/g,"").split(/\.|\[/)),S=(e,t,r)=>{if(!t||!ee(e))return r;const n=(tr(t)?[t]:Lr(t)).reduce((i,s)=>se(i)?i:i[s],e);return Q(n)||n===e?Q(e[t])?r:e[t]:n},ue=e=>typeof e=="boolean",J=(e,t,r)=>{let n=-1;const i=tr(t)?[t]:Lr(t),s=i.length,a=s-1;for(;++n<s;){const o=i[n];let l=r;if(n!==a){const f=e[o];l=ee(f)||Array.isArray(f)?f:isNaN(+i[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;e[o]=l,e=e[o]}};const Jt={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xe={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Fe={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Vr=v.createContext(null);Vr.displayName="HookFormContext";const Ke=()=>v.useContext(Vr),fa=e=>{const{children:t,...r}=e;return v.createElement(Vr.Provider,{value:r},t)};var pi=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(i,s,{get:()=>{const a=s;return t._proxyFormState[a]!==xe.all&&(t._proxyFormState[a]=!n||xe.all),r&&(r[a]=!0),e[a]}});return i};const Mr=typeof window<"u"?Ae.useLayoutEffect:Ae.useEffect;function Dr(e){const t=Ke(),{control:r=t.control,disabled:n,name:i,exact:s}=e||{},[a,o]=v.useState(r._formState),l=v.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Mr(()=>r._subscribe({name:i,formState:l.current,exact:s,callback:f=>{!n&&o({...r._formState,...f})}}),[i,n,s]),v.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),v.useMemo(()=>pi(a,r,l.current,!1),[a,r])}var Ce=e=>typeof e=="string",mi=(e,t,r,n,i)=>Ce(e)?(n&&t.watch.add(e),S(r,e,i)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),S(r,s))):(n&&(t.watchAll=!0),r);function _r(e){const t=Ke(),{control:r=t.control,name:n,defaultValue:i,disabled:s,exact:a}=e||{},o=v.useRef(i),[l,f]=v.useState(r._getWatch(n,o.current));return Mr(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:u=>!s&&f(mi(n,r._names,u.values||r._formValues,!1,o.current))}),[n,r,s,a]),v.useEffect(()=>r._removeUnmounted()),l}function da(e){const t=Ke(),{name:r,disabled:n,control:i=t.control,shouldUnregister:s}=e,a=hi(i._names.array,r),o=_r({control:i,name:r,defaultValue:S(i._formValues,r,S(i._defaultValues,r,e.defaultValue)),exact:!0}),l=Dr({control:i,name:r,exact:!0}),f=v.useRef(e),u=v.useRef(i.register(r,{...e.rules,value:o,...ue(e.disabled)?{disabled:e.disabled}:{}})),d=v.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!S(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!S(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!S(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!S(l.validatingFields,r)},error:{enumerable:!0,get:()=>S(l.errors,r)}}),[l,r]),p=v.useCallback(y=>u.current.onChange({target:{value:di(y),name:r},type:Jt.CHANGE}),[r]),g=v.useCallback(()=>u.current.onBlur({target:{value:S(i._formValues,r),name:r},type:Jt.BLUR}),[r,i._formValues]),N=v.useCallback(y=>{const M=S(i._fields,r);M&&y&&(M._f.ref={focus:()=>y.focus&&y.focus(),select:()=>y.select&&y.select(),setCustomValidity:w=>y.setCustomValidity(w),reportValidity:()=>y.reportValidity()})},[i._fields,r]),x=v.useMemo(()=>({name:r,value:o,...ue(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:p,onBlur:g,ref:N}),[r,n,l.disabled,p,g,N,o]);return v.useEffect(()=>{const y=i._options.shouldUnregister||s;i.register(r,{...f.current.rules,...ue(f.current.disabled)?{disabled:f.current.disabled}:{}});const M=(w,_)=>{const E=S(i._fields,w);E&&E._f&&(E._f.mount=_)};if(M(r,!0),y){const w=ne(S(i._options.defaultValues,r));J(i._defaultValues,r,w),Q(S(i._formValues,r))&&J(i._formValues,r,w)}return!a&&i.register(r),()=>{(a?y&&!i._state.action:y)?i.unregister(r):M(r,!1)}},[r,i,a,s]),v.useEffect(()=>{i._setDisabledField({disabled:n,name:r})},[n,r,i]),v.useMemo(()=>({field:x,formState:l,fieldState:d}),[x,l,d])}var vi=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},vt=e=>Array.isArray(e)?e:[e],ln=()=>{let e=[];return{get observers(){return e},next:i=>{for(const s of e)s.next&&s.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(s=>s!==i)}}),unsubscribe:()=>{e=[]}}},ur=e=>se(e)||!fi(e);function Re(e,t,r=new WeakSet){if(ur(e)||ur(t))return e===t;if(Je(e)&&Je(t))return e.getTime()===t.getTime();const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const s of n){const a=e[s];if(!i.includes(s))return!1;if(s!=="ref"){const o=t[s];if(Je(a)&&Je(o)||ee(a)&&ee(o)||Array.isArray(a)&&Array.isArray(o)?!Re(a,o,r):a!==o)return!1}}return!0}var ae=e=>ee(e)&&!Object.keys(e).length,Tr=e=>e.type==="file",ye=e=>typeof e=="function",qt=e=>{if(!Fr)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},gi=e=>e.type==="select-multiple",Rr=e=>e.type==="radio",ha=e=>Rr(e)||kt(e),or=e=>qt(e)&&e.isConnected;function pa(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Q(e)?n++:e[t[n++]];return e}function ma(e){for(const t in e)if(e.hasOwnProperty(t)&&!Q(e[t]))return!1;return!0}function te(e,t){const r=Array.isArray(t)?t:tr(t)?[t]:Lr(t),n=r.length===1?e:pa(e,r),i=r.length-1,s=r[i];return n&&delete n[s],i!==0&&(ee(n)&&ae(n)||Array.isArray(n)&&ma(n))&&te(e,r.slice(0,-1)),e}var bi=e=>{for(const t in e)if(ye(e[t]))return!0;return!1};function zt(e,t={}){const r=Array.isArray(e);if(ee(e)||r)for(const n in e)Array.isArray(e[n])||ee(e[n])&&!bi(e[n])?(t[n]=Array.isArray(e[n])?[]:{},zt(e[n],t[n])):se(e[n])||(t[n]=!0);return t}function xi(e,t,r){const n=Array.isArray(e);if(ee(e)||n)for(const i in e)Array.isArray(e[i])||ee(e[i])&&!bi(e[i])?Q(t)||ur(r[i])?r[i]=Array.isArray(e[i])?zt(e[i],[]):{...zt(e[i])}:xi(e[i],se(t)?{}:t[i],r[i]):r[i]=!Re(e[i],t[i]);return r}var dt=(e,t)=>xi(e,t,zt(t));const cn={value:!1,isValid:!1},un={value:!0,isValid:!0};var yi=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Q(e[0].attributes.value)?Q(e[0].value)||e[0].value===""?un:{value:e[0].value,isValid:!0}:un:cn}return cn},wi=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Q(e)?e:t?e===""?NaN:e&&+e:r&&Ce(e)?new Date(e):n?n(e):e;const fn={isValid:!1,value:null};var ji=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,fn):fn;function dn(e){const t=e.ref;return Tr(t)?t.files:Rr(t)?ji(e.refs).value:gi(t)?[...t.selectedOptions].map(({value:r})=>r):kt(t)?yi(e.refs).value:wi(Q(t.value)?e.ref.value:t.value,e)}var va=(e,t,r,n)=>{const i={};for(const s of e){const a=S(t,s);a&&J(i,s,a._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Zt=e=>e instanceof RegExp,ht=e=>Q(e)?e:Zt(e)?e.source:ee(e)?Zt(e.value)?e.value.source:e.value:e,hn=e=>({isOnSubmit:!e||e===xe.onSubmit,isOnBlur:e===xe.onBlur,isOnChange:e===xe.onChange,isOnAll:e===xe.all,isOnTouch:e===xe.onTouched});const pn="AsyncFunction";var ga=e=>!!e&&!!e.validate&&!!(ye(e.validate)&&e.validate.constructor.name===pn||ee(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===pn)),ba=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),mn=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const gt=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const s=S(e,i);if(s){const{_f:a,...o}=s;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(gt(o,t))break}else if(ee(o)&&gt(o,t))break}}};function vn(e,t,r){const n=S(e,r);if(n||tr(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const s=i.join("."),a=S(t,s),o=S(e,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(o&&o.type)return{name:s,error:o};if(o&&o.root&&o.root.type)return{name:`${s}.root`,error:o.root};i.pop()}return{name:r}}var xa=(e,t,r,n)=>{r(e);const{name:i,...s}=e;return ae(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(a=>t[a]===(!n||xe.all))},ya=(e,t,r)=>!e||!t||e===t||vt(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),wa=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,ja=(e,t)=>!Ar(S(e,t)).length&&te(e,t),Ca=(e,t,r)=>{const n=vt(S(e,r));return J(n,"root",t[r]),J(e,r,n),e},Bt=e=>Ce(e);function gn(e,t,r="validate"){if(Bt(e)||Array.isArray(e)&&e.every(Bt)||ue(e)&&!e)return{type:r,message:Bt(e)?e:"",ref:t}}var tt=e=>ee(e)&&!Zt(e)?e:{value:e,message:""},bn=async(e,t,r,n,i,s)=>{const{ref:a,refs:o,required:l,maxLength:f,minLength:u,min:d,max:p,pattern:g,validate:N,name:x,valueAsNumber:y,mount:M}=e._f,w=S(r,x);if(!M||t.has(x))return{};const _=o?o[0]:a,E=V=>{i&&_.reportValidity&&(_.setCustomValidity(ue(V)?"":V||""),_.reportValidity())},A={},L=Rr(a),O=kt(a),I=L||O,B=(y||Tr(a))&&Q(a.value)&&Q(w)||qt(a)&&a.value===""||w===""||Array.isArray(w)&&!w.length,$=vi.bind(null,x,n,A),R=(V,P,W,Y=Fe.maxLength,z=Fe.minLength)=>{const K=V?P:W;A[x]={type:V?Y:z,message:K,ref:a,...$(V?Y:z,K)}};if(s?!Array.isArray(w)||!w.length:l&&(!I&&(B||se(w))||ue(w)&&!w||O&&!yi(o).isValid||L&&!ji(o).isValid)){const{value:V,message:P}=Bt(l)?{value:!!l,message:l}:tt(l);if(V&&(A[x]={type:Fe.required,message:P,ref:_,...$(Fe.required,P)},!n))return E(P),A}if(!B&&(!se(d)||!se(p))){let V,P;const W=tt(p),Y=tt(d);if(!se(w)&&!isNaN(w)){const z=a.valueAsNumber||w&&+w;se(W.value)||(V=z>W.value),se(Y.value)||(P=z<Y.value)}else{const z=a.valueAsDate||new Date(w),K=Ee=>new Date(new Date().toDateString()+" "+Ee),we=a.type=="time",oe=a.type=="week";Ce(W.value)&&w&&(V=we?K(w)>K(W.value):oe?w>W.value:z>new Date(W.value)),Ce(Y.value)&&w&&(P=we?K(w)<K(Y.value):oe?w<Y.value:z<new Date(Y.value))}if((V||P)&&(R(!!V,W.message,Y.message,Fe.max,Fe.min),!n))return E(A[x].message),A}if((f||u)&&!B&&(Ce(w)||s&&Array.isArray(w))){const V=tt(f),P=tt(u),W=!se(V.value)&&w.length>+V.value,Y=!se(P.value)&&w.length<+P.value;if((W||Y)&&(R(W,V.message,P.message),!n))return E(A[x].message),A}if(g&&!B&&Ce(w)){const{value:V,message:P}=tt(g);if(Zt(V)&&!w.match(V)&&(A[x]={type:Fe.pattern,message:P,ref:a,...$(Fe.pattern,P)},!n))return E(P),A}if(N){if(ye(N)){const V=await N(w,r),P=gn(V,_);if(P&&(A[x]={...P,...$(Fe.validate,P.message)},!n))return E(P.message),A}else if(ee(N)){let V={};for(const P in N){if(!ae(V)&&!n)break;const W=gn(await N[P](w,r),_,P);W&&(V={...W,...$(P,W.message)},E(W.message),n&&(A[x]=V))}if(!ae(V)&&(A[x]={ref:_,...V},!n))return A}}return E(!0),A};const Na={mode:xe.onSubmit,reValidateMode:xe.onChange,shouldFocusError:!0};function Oa(e={}){let t={...Na,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:ye(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=ee(t.defaultValues)||ee(t.values)?ne(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:ne(i),a={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,f=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const p={array:ln(),state:ln()},g=t.criteriaMode===xe.all,N=h=>m=>{clearTimeout(f),f=setTimeout(h,m)},x=async h=>{if(!t.disabled&&(u.isValid||d.isValid||h)){const m=t.resolver?ae((await O()).errors):await B(n,!0);m!==r.isValid&&p.state.next({isValid:m})}},y=(h,m)=>{!t.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((h||Array.from(o.mount)).forEach(b=>{b&&(m?J(r.validatingFields,b,m):te(r.validatingFields,b))}),p.state.next({validatingFields:r.validatingFields,isValidating:!ae(r.validatingFields)}))},M=(h,m=[],b,F,k=!0,j=!0)=>{if(F&&b&&!t.disabled){if(a.action=!0,j&&Array.isArray(S(n,h))){const T=b(S(n,h),F.argA,F.argB);k&&J(n,h,T)}if(j&&Array.isArray(S(r.errors,h))){const T=b(S(r.errors,h),F.argA,F.argB);k&&J(r.errors,h,T),ja(r.errors,h)}if((u.touchedFields||d.touchedFields)&&j&&Array.isArray(S(r.touchedFields,h))){const T=b(S(r.touchedFields,h),F.argA,F.argB);k&&J(r.touchedFields,h,T)}(u.dirtyFields||d.dirtyFields)&&(r.dirtyFields=dt(i,s)),p.state.next({name:h,isDirty:R(h,m),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else J(s,h,m)},w=(h,m)=>{J(r.errors,h,m),p.state.next({errors:r.errors})},_=h=>{r.errors=h,p.state.next({errors:r.errors,isValid:!1})},E=(h,m,b,F)=>{const k=S(n,h);if(k){const j=S(s,h,Q(b)?S(i,h):b);Q(j)||F&&F.defaultChecked||m?J(s,h,m?j:dn(k._f)):W(h,j),a.mount&&x()}},A=(h,m,b,F,k)=>{let j=!1,T=!1;const H={name:h};if(!t.disabled){if(!b||F){(u.isDirty||d.isDirty)&&(T=r.isDirty,r.isDirty=H.isDirty=R(),j=T!==H.isDirty);const U=Re(S(i,h),m);T=!!S(r.dirtyFields,h),U?te(r.dirtyFields,h):J(r.dirtyFields,h,!0),H.dirtyFields=r.dirtyFields,j=j||(u.dirtyFields||d.dirtyFields)&&T!==!U}if(b){const U=S(r.touchedFields,h);U||(J(r.touchedFields,h,b),H.touchedFields=r.touchedFields,j=j||(u.touchedFields||d.touchedFields)&&U!==b)}j&&k&&p.state.next(H)}return j?H:{}},L=(h,m,b,F)=>{const k=S(r.errors,h),j=(u.isValid||d.isValid)&&ue(m)&&r.isValid!==m;if(t.delayError&&b?(l=N(()=>w(h,b)),l(t.delayError)):(clearTimeout(f),l=null,b?J(r.errors,h,b):te(r.errors,h)),(b?!Re(k,b):k)||!ae(F)||j){const T={...F,...j&&ue(m)?{isValid:m}:{},errors:r.errors,name:h};r={...r,...T},p.state.next(T)}},O=async h=>{y(h,!0);const m=await t.resolver(s,t.context,va(h||o.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return y(h),m},I=async h=>{const{errors:m}=await O(h);if(h)for(const b of h){const F=S(m,b);F?J(r.errors,b,F):te(r.errors,b)}else r.errors=m;return m},B=async(h,m,b={valid:!0})=>{for(const F in h){const k=h[F];if(k){const{_f:j,...T}=k;if(j){const H=o.array.has(j.name),U=k._f&&ga(k._f);U&&u.validatingFields&&y([F],!0);const he=await bn(k,o.disabled,s,g,t.shouldUseNativeValidation&&!m,H);if(U&&u.validatingFields&&y([F]),he[j.name]&&(b.valid=!1,m))break;!m&&(S(he,j.name)?H?Ca(r.errors,he,j.name):J(r.errors,j.name,he[j.name]):te(r.errors,j.name))}!ae(T)&&await B(T,m,b)}}return b.valid},$=()=>{for(const h of o.unMount){const m=S(n,h);m&&(m._f.refs?m._f.refs.every(b=>!or(b)):!or(m._f.ref))&&De(h)}o.unMount=new Set},R=(h,m)=>!t.disabled&&(h&&m&&J(s,h,m),!Re(Ee(),i)),V=(h,m,b)=>mi(h,o,{...a.mount?s:Q(m)?i:Ce(h)?{[h]:m}:m},b,m),P=h=>Ar(S(a.mount?s:i,h,t.shouldUnregister?S(i,h,[]):[])),W=(h,m,b={})=>{const F=S(n,h);let k=m;if(F){const j=F._f;j&&(!j.disabled&&J(s,h,wi(m,j)),k=qt(j.ref)&&se(m)?"":m,gi(j.ref)?[...j.ref.options].forEach(T=>T.selected=k.includes(T.value)):j.refs?kt(j.ref)?j.refs.forEach(T=>{(!T.defaultChecked||!T.disabled)&&(Array.isArray(k)?T.checked=!!k.find(H=>H===T.value):T.checked=k===T.value||!!k)}):j.refs.forEach(T=>T.checked=T.value===k):Tr(j.ref)?j.ref.value="":(j.ref.value=k,j.ref.type||p.state.next({name:h,values:ne(s)})))}(b.shouldDirty||b.shouldTouch)&&A(h,k,b.shouldTouch,b.shouldDirty,!0),b.shouldValidate&&oe(h)},Y=(h,m,b)=>{for(const F in m){if(!m.hasOwnProperty(F))return;const k=m[F],j=h+"."+F,T=S(n,j);(o.array.has(h)||ee(k)||T&&!T._f)&&!Je(k)?Y(j,k,b):W(j,k,b)}},z=(h,m,b={})=>{const F=S(n,h),k=o.array.has(h),j=ne(m);J(s,h,j),k?(p.array.next({name:h,values:ne(s)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&b.shouldDirty&&p.state.next({name:h,dirtyFields:dt(i,s),isDirty:R(h,j)})):F&&!F._f&&!se(j)?Y(h,j,b):W(h,j,b),mn(h,o)&&p.state.next({...r}),p.state.next({name:a.mount?h:void 0,values:ne(s)})},K=async h=>{a.mount=!0;const m=h.target;let b=m.name,F=!0;const k=S(n,b),j=U=>{F=Number.isNaN(U)||Je(U)&&isNaN(U.getTime())||Re(U,S(s,b,U))},T=hn(t.mode),H=hn(t.reValidateMode);if(k){let U,he;const Dt=m.type?dn(k._f):di(h),_e=h.type===Jt.BLUR||h.type===Jt.FOCUS_OUT,Ii=!ba(k._f)&&!t.resolver&&!S(r.errors,b)&&!k._f.deps||wa(_e,S(r.touchedFields,b),r.isSubmitted,H,T),nr=mn(b,o,_e);J(s,b,Dt),_e?(k._f.onBlur&&k._f.onBlur(h),l&&l(0)):k._f.onChange&&k._f.onChange(h);const ir=A(b,Dt,_e),$i=!ae(ir)||nr;if(!_e&&p.state.next({name:b,type:h.type,values:ne(s)}),Ii)return(u.isValid||d.isValid)&&(t.mode==="onBlur"?_e&&x():_e||x()),$i&&p.state.next({name:b,...nr?{}:ir});if(!_e&&nr&&p.state.next({...r}),t.resolver){const{errors:Ur}=await O([b]);if(j(Dt),F){const Hi=vn(r.errors,n,b),Jr=vn(Ur,n,Hi.name||b);U=Jr.error,b=Jr.name,he=ae(Ur)}}else y([b],!0),U=(await bn(k,o.disabled,s,g,t.shouldUseNativeValidation))[b],y([b]),j(Dt),F&&(U?he=!1:(u.isValid||d.isValid)&&(he=await B(n,!0)));F&&(k._f.deps&&oe(k._f.deps),L(b,he,U,ir))}},we=(h,m)=>{if(S(r.errors,m)&&h.focus)return h.focus(),1},oe=async(h,m={})=>{let b,F;const k=vt(h);if(t.resolver){const j=await I(Q(h)?h:k);b=ae(j),F=h?!k.some(T=>S(j,T)):b}else h?(F=(await Promise.all(k.map(async j=>{const T=S(n,j);return await B(T&&T._f?{[j]:T}:T)}))).every(Boolean),!(!F&&!r.isValid)&&x()):F=b=await B(n);return p.state.next({...!Ce(h)||(u.isValid||d.isValid)&&b!==r.isValid?{}:{name:h},...t.resolver||!h?{isValid:b}:{},errors:r.errors}),m.shouldFocus&&!F&&gt(n,we,h?k:o.mount),F},Ee=h=>{const m={...a.mount?s:i};return Q(h)?m:Ce(h)?S(m,h):h.map(b=>S(m,b))},et=(h,m)=>({invalid:!!S((m||r).errors,h),isDirty:!!S((m||r).dirtyFields,h),error:S((m||r).errors,h),isValidating:!!S(r.validatingFields,h),isTouched:!!S((m||r).touchedFields,h)}),Ie=h=>{h&&vt(h).forEach(m=>te(r.errors,m)),p.state.next({errors:h?r.errors:{}})},$e=(h,m,b)=>{const F=(S(n,h,{_f:{}})._f||{}).ref,k=S(r.errors,h)||{},{ref:j,message:T,type:H,...U}=k;J(r.errors,h,{...U,...m,ref:F}),p.state.next({name:h,errors:r.errors,isValid:!1}),b&&b.shouldFocus&&F&&F.focus&&F.focus()},Me=(h,m)=>ye(h)?p.state.subscribe({next:b=>h(V(void 0,m),b)}):V(h,m,!0),be=h=>p.state.subscribe({next:m=>{ya(h.name,m.name,h.exact)&&xa(m,h.formState||u,Vt,h.reRenderRoot)&&h.callback({values:{...s},...r,...m})}}).unsubscribe,He=h=>(a.mount=!0,d={...d,...h.formState},be({...h,formState:d})),De=(h,m={})=>{for(const b of h?vt(h):o.mount)o.mount.delete(b),o.array.delete(b),m.keepValue||(te(n,b),te(s,b)),!m.keepError&&te(r.errors,b),!m.keepDirty&&te(r.dirtyFields,b),!m.keepTouched&&te(r.touchedFields,b),!m.keepIsValidating&&te(r.validatingFields,b),!t.shouldUnregister&&!m.keepDefaultValue&&te(i,b);p.state.next({values:ne(s)}),p.state.next({...r,...m.keepDirty?{isDirty:R()}:{}}),!m.keepIsValid&&x()},je=({disabled:h,name:m})=>{(ue(h)&&a.mount||h||o.disabled.has(m))&&(h?o.disabled.add(m):o.disabled.delete(m))},We=(h,m={})=>{let b=S(n,h);const F=ue(m.disabled)||ue(t.disabled);return J(n,h,{...b||{},_f:{...b&&b._f?b._f:{ref:{name:h}},name:h,mount:!0,...m}}),o.mount.add(h),b?je({disabled:ue(m.disabled)?m.disabled:t.disabled,name:h}):E(h,!0,m.value),{...F?{disabled:m.disabled||t.disabled}:{},...t.progressive?{required:!!m.required,min:ht(m.min),max:ht(m.max),minLength:ht(m.minLength),maxLength:ht(m.maxLength),pattern:ht(m.pattern)}:{},name:h,onChange:K,onBlur:K,ref:k=>{if(k){We(h,m),b=S(n,h);const j=Q(k.value)&&k.querySelectorAll&&k.querySelectorAll("input,select,textarea")[0]||k,T=ha(j),H=b._f.refs||[];if(T?H.find(U=>U===j):j===b._f.ref)return;J(n,h,{_f:{...b._f,...T?{refs:[...H.filter(or),j,...Array.isArray(S(i,h))?[{}]:[]],ref:{type:j.type,name:h}}:{ref:j}}}),E(h,!1,void 0,j)}else b=S(n,h,{}),b._f&&(b._f.mount=!1),(t.shouldUnregister||m.shouldUnregister)&&!(hi(o.array,h)&&a.action)&&o.unMount.add(h)}}},ct=()=>t.shouldFocusError&&gt(n,we,o.mount),ut=h=>{ue(h)&&(p.state.next({disabled:h}),gt(n,(m,b)=>{const F=S(n,b);F&&(m.disabled=F._f.disabled||h,Array.isArray(F._f.refs)&&F._f.refs.forEach(k=>{k.disabled=F._f.disabled||h}))},0,!1))},St=(h,m)=>async b=>{let F;b&&(b.preventDefault&&b.preventDefault(),b.persist&&b.persist());let k=ne(s);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:j,values:T}=await O();r.errors=j,k=ne(T)}else await B(n);if(o.disabled.size)for(const j of o.disabled)te(k,j);if(te(r.errors,"root"),ae(r.errors)){p.state.next({errors:{}});try{await h(k,b)}catch(j){F=j}}else m&&await m({...r.errors},b),ct(),setTimeout(ct);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ae(r.errors)&&!F,submitCount:r.submitCount+1,errors:r.errors}),F)throw F},Et=(h,m={})=>{S(n,h)&&(Q(m.defaultValue)?z(h,ne(S(i,h))):(z(h,m.defaultValue),J(i,h,ne(m.defaultValue))),m.keepTouched||te(r.touchedFields,h),m.keepDirty||(te(r.dirtyFields,h),r.isDirty=m.defaultValue?R(h,ne(S(i,h))):R()),m.keepError||(te(r.errors,h),u.isValid&&x()),p.state.next({...r}))},Ft=(h,m={})=>{const b=h?ne(h):i,F=ne(b),k=ae(h),j=k?i:F;if(m.keepDefaultValues||(i=b),!m.keepValues){if(m.keepDirtyValues){const T=new Set([...o.mount,...Object.keys(dt(i,s))]);for(const H of Array.from(T))S(r.dirtyFields,H)?J(j,H,S(s,H)):z(H,S(j,H))}else{if(Fr&&Q(h))for(const T of o.mount){const H=S(n,T);if(H&&H._f){const U=Array.isArray(H._f.refs)?H._f.refs[0]:H._f.ref;if(qt(U)){const he=U.closest("form");if(he){he.reset();break}}}}if(m.keepFieldsRef)for(const T of o.mount)z(T,S(j,T));else n={}}s=t.shouldUnregister?m.keepDefaultValues?ne(i):{}:ne(j),p.array.next({values:{...j}}),p.state.next({values:{...j}})}o={mount:m.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!m.keepIsValid||!!m.keepDirtyValues,a.watch=!!t.shouldUnregister,p.state.next({submitCount:m.keepSubmitCount?r.submitCount:0,isDirty:k?!1:m.keepDirty?r.isDirty:!!(m.keepDefaultValues&&!Re(h,i)),isSubmitted:m.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:k?{}:m.keepDirtyValues?m.keepDefaultValues&&s?dt(i,s):r.dirtyFields:m.keepDefaultValues&&h?dt(i,h):m.keepDirty?r.dirtyFields:{},touchedFields:m.keepTouched?r.touchedFields:{},errors:m.keepErrors?r.errors:{},isSubmitSuccessful:m.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},At=(h,m)=>Ft(ye(h)?h(s):h,m),Lt=(h,m={})=>{const b=S(n,h),F=b&&b._f;if(F){const k=F.refs?F.refs[0]:F.ref;k.focus&&(k.focus(),m.shouldSelect&&ye(k.select)&&k.select())}},Vt=h=>{r={...r,...h}},Mt={control:{register:We,unregister:De,getFieldState:et,handleSubmit:St,setError:$e,_subscribe:be,_runSchema:O,_focusError:ct,_getWatch:V,_getDirty:R,_setValid:x,_setFieldArray:M,_setDisabledField:je,_setErrors:_,_getFieldArray:P,_reset:Ft,_resetDefaultValues:()=>ye(t.defaultValues)&&t.defaultValues().then(h=>{At(h,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:ut,_subjects:p,_proxyFormState:u,get _fields(){return n},get _formValues(){return s},get _state(){return a},set _state(h){a=h},get _defaultValues(){return i},get _names(){return o},set _names(h){o=h},get _formState(){return r},get _options(){return t},set _options(h){t={...t,...h}}},subscribe:He,trigger:oe,register:We,handleSubmit:St,watch:Me,setValue:z,getValues:Ee,reset:At,resetField:Et,clearErrors:Ie,unregister:De,setError:$e,setFocus:Lt,getFieldState:et};return{...Mt,formControl:Mt}}function ka(e={}){const t=v.useRef(void 0),r=v.useRef(void 0),[n,i]=v.useState({isDirty:!1,isValidating:!1,isLoading:ye(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:ye(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!ye(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...o}=Oa(e);t.current={...o,formState:n}}const s=t.current.control;return s._options=e,Mr(()=>{const a=s._subscribe({formState:s._proxyFormState,callback:()=>i({...s._formState}),reRenderRoot:!0});return i(o=>({...o,isReady:!0})),s._formState.isReady=!0,a},[s]),v.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),v.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),v.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),v.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),v.useEffect(()=>{if(s._proxyFormState.isDirty){const a=s._getDirty();a!==n.isDirty&&s._subjects.state.next({isDirty:a})}},[s,n.isDirty]),v.useEffect(()=>{e.values&&!Re(e.values,r.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),r.current=e.values,i(a=>({...a}))):s._resetDefaultValues()},[s,e.values]),v.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=pi(n,s),t.current}const xn=(e,t,r)=>{if(e&&"reportValidity"in e){const n=S(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Ci=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?xn(n.ref,r,e):n.refs&&n.refs.forEach(i=>xn(i,r,e))}},Sa=(e,t)=>{t.shouldUseNativeValidation&&Ci(e,t);const r={};for(const n in e){const i=S(t.fields,n),s=Object.assign(e[n]||{},{ref:i&&i.ref});if(Ea(t.names||Object.keys(e),n)){const a=Object.assign({},S(r,n));J(a,"root",s),J(r,n,a)}else J(r,n,s)}return r},Ea=(e,t)=>e.some(r=>r.startsWith(t+"."));function Fa(e,t,r){return t===void 0&&(t={}),r===void 0&&(r={}),function(n,i,s){try{return Promise.resolve(function(a,o){try{var l=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[r.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:i}))).then(function(f){return s.shouldUseNativeValidation&&Ci({},s),{values:r.raw?n:f,errors:{}}}))}catch(f){return o(f)}return l&&l.then?l.then(void 0,o):l}(0,function(a){if(!a.inner)throw a;return{values:{},errors:Sa((o=a,l=!s.shouldUseNativeValidation&&s.criteriaMode==="all",(o.inner||[]).reduce(function(f,u){if(f[u.path]||(f[u.path]={message:u.message,type:u.type}),l){var d=f[u.path].types,p=d&&d[u.type];f[u.path]=vi(u.path,l,f,u.type,p?[].concat(p,u.message):u.message)}return f},{})),s)};var o,l}))}catch(a){return Promise.reject(a)}}}function Aa({className:e,name:t,children:r,mode:n="onBlur",reValidateMode:i="onBlur",defaultValues:s,schema:a,formProps:o,onSubmit:l=()=>null,onChange:f}){const u=ka({mode:n,reValidateMode:i,defaultValues:s,resolver:a?Fa(a):void 0});return v.useEffect(()=>{if(!f)return;const{unsubscribe:d}=u.watch(f);return d},[f,u.watch]),c.jsx(fa,{...u,children:c.jsx("form",{className:C.twJoin("bbn-form",e),name:t,onSubmit:u.handleSubmit(l),...o,children:r})})}function Qe({name:e,defaultValue:t,disabled:r=!1,autoFocus:n=!1,shouldUnregister:i=!1,validateOnMount:s=!0}){const{setFocus:a,trigger:o}=Ke(),{field:l,fieldState:f}=da({name:e,defaultValue:t,disabled:r,shouldUnregister:i}),{invalid:u,isTouched:d,error:p}=f;return v.useEffect(()=>{s?o(e,{shouldFocus:n}):n&&a(e)},[e,s]),{...l,value:l.value,invalid:u&&d,error:(p==null?void 0:p.message)??""}}function La(e){const{getFieldState:t}=Ke(),r=Dr({name:e});return Array.isArray(e)?e.map(i=>t(i,r)):t(e,r)}const Va=/^-?\d*\.?\d*$/;function Ma({name:e,id:t=e,label:r,hint:n,className:i,controlClassName:s,disabled:a,autoFocus:o,defaultValue:l,placeholder:f,type:u,suffix:d,prefix:p,shouldUnregister:g,state:N,validateOnMount:x}){const{ref:y,value:M="",error:w,invalid:_,onChange:E,onBlur:A}=Qe({name:e,defaultValue:l,autoFocus:o,shouldUnregister:g,validateOnMount:x}),L=_?"error":N,O=_?w:n,I=B=>{Va.test(B.target.value)&&E(B.target.value)};return c.jsx(Ot,{label:r,className:s,state:L,hint:O,children:c.jsx(Kt,{inputMode:"decimal",pattern:"^-?\\d*\\.?\\d*$",ref:y,value:M,id:t,name:e,type:u,className:i,disabled:a,autoFocus:o,placeholder:f,suffix:d,prefix:p,state:L,onChange:I,onBlur:A})})}function Da({name:e,id:t=e,label:r,hint:n,className:i,controlClassName:s,disabled:a,autoFocus:o,defaultValue:l,placeholder:f,type:u,suffix:d,prefix:p,shouldUnregister:g,state:N,validateOnMount:x}){const{ref:y,value:M="",error:w,invalid:_,onChange:E,onBlur:A}=Qe({name:e,defaultValue:l,autoFocus:o,shouldUnregister:g,validateOnMount:x}),L=_?"error":N,O=_?w:n;return c.jsx(Ot,{label:r,className:s,state:L,hint:O,children:c.jsx(Kt,{ref:y,value:M,id:t,name:e,type:u,className:i,disabled:a,autoFocus:o,placeholder:f,suffix:d,prefix:p,state:L,onChange:E,onBlur:A})})}function _a({name:e,id:t=e,label:r,className:n,disabled:i,value:s,defaultChecked:a,labelClassName:o,orientation:l}){const{ref:f,value:u=!1,onChange:d,onBlur:p}=Qe({name:e});return c.jsx(Sn,{ref:f,name:e,checked:u,id:t,label:r,className:n,disabled:i,value:s,defaultChecked:a,labelClassName:o,orientation:l,inputProps:{onChange:d,onBlur:p}})}function Ta({name:e,id:t=e,label:r,className:n,disabled:i,value:s,defaultChecked:a,labelClassName:o,orientation:l}){const{ref:f,value:u,onChange:d,onBlur:p}=Qe({name:e,disabled:i,defaultValue:a?s:void 0});return c.jsx(En,{ref:f,name:e,id:t,label:r,className:n,disabled:i,checked:u===s,value:s,labelClassName:o,orientation:l,inputProps:{onChange:d,onBlur:p}})}function Ra({open:e,defaultOpen:t,options:r,optionClassName:n,popoverClassName:i,name:s,id:a=s,label:o,hint:l,className:f,controlClassName:u,disabled:d,autoFocus:p,defaultValue:g,placeholder:N,shouldUnregister:x,state:y,validateOnMount:M,onOpen:w,onClose:_,renderSelectedOption:E}){const{ref:A,value:L="",error:O,invalid:I,onChange:B,onBlur:$}=Qe({name:s,defaultValue:g,autoFocus:p,shouldUnregister:x,validateOnMount:M}),R=I?"error":y,V=I?O:l,P=()=>{$==null||$(),_==null||_()};return c.jsx(Ot,{label:o,className:u,state:R,hint:V,children:c.jsx(jr,{open:e,defaultOpen:t,options:r,ref:A,value:L,id:a,name:s,className:f,disabled:d,placeholder:N,state:R,optionClassName:n,popoverClassName:i,onSelect:B,onBlur:$,onOpen:w,onClose:P,renderSelectedOption:E})})}function Ni({displayError:e=!1,...t}){const{error:r,value:n,onChange:i,onBlur:s,disabled:a,name:o,ref:l}=Qe(t),f=c.jsx("input",{ref:l,type:"hidden",name:o,disabled:a,value:n,onChange:i,onBlur:s});if(e){const u=e?"error":"default",d=e?r:"";return c.jsx(Ot,{hint:d,state:u,children:f})}return f}const Pa={lg:{logo:"size-10",subLogo:"text-[0.8rem]"},md:{logo:"size-6",subLogo:"text-[0.5rem]"},sm:{logo:"size-5",subLogo:"text-[0.4rem]"}},Oi=({logoUrl:e,rank:t,moniker:r,size:n="md",className:i})=>{const[s,a]=v.useState(!1),o=Pa[n],l=(r==null?void 0:r.charAt(0).toUpperCase())??String(t);return c.jsx("span",{className:C.twMerge("relative inline-block",o.logo,i),children:e&&!s?c.jsx("img",{src:e,alt:r||`Finality Provider ${t}`,className:"h-full w-full rounded-full object-cover",onError:()=>a(!0)}):c.jsx(q,{as:"span",className:"inline-flex h-full w-full items-center justify-center rounded-full bg-secondary-main text-[1rem] text-accent-contrast",children:l})})};function Pr({bsnId:e,bsnName:t,bsnLogoUrl:r,address:n,provider:i,onRemove:s}){var f,u;if(!i)return null;const a=()=>{if(r)return c.jsx(It,{url:r,alt:t,variant:"rounded",size:"tiny",className:"mr-1"});const d=(t==null?void 0:t.charAt(0).toUpperCase())||"?";return c.jsx(It,{variant:"rounded",size:"tiny",className:"mr-1",children:c.jsx(q,{as:"span",className:"inline-flex h-full w-full items-center justify-center bg-secondary-main text-xs text-accent-contrast",children:d})})},o=d=>!d||d.length<=6*2?d:`${d.slice(0,6)}...${d.slice(-6)}`,l=()=>n?c.jsx("div",{className:"text-xs text-accent-secondary",children:o(n)}):c.jsxs("div",{className:"flex items-center text-xs text-accent-secondary",children:[a(),t]});return c.jsxs("div",{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{className:"flex h-10 flex-row gap-2",children:[c.jsx("div",{className:"shrink-0",children:c.jsx(Oi,{logoUrl:i.logo_url,rank:i.rank,moniker:(f=i.description)==null?void 0:f.moniker,size:"lg"})}),c.jsxs("div",{className:"flex flex-col justify-center text-accent-primary",children:[l(),c.jsx(q,{as:"div",className:"text-base font-medium text-accent-primary",children:(u=i.description)==null?void 0:u.moniker})]})]}),s?c.jsx("button",{onClick:()=>s(e),className:"ml-[10px] cursor-pointer rounded bg-accent-secondary/20 px-2 py-0.5 text-xs tracking-[0.4px] text-accent-primary",children:"Remove"}):null]})}const Ba=({attributes:e,providerItemProps:t,isSelected:r=!1,isSelectable:n=!0,onSelect:i})=>c.jsxs("div",{className:"bg-secondary-highlight h-[316px] overflow-hidden p-4 flex flex-col rounded justify-between",children:[c.jsx(Pr,{...t}),c.jsx("div",{className:"w-full h-px bg-secondary-strokeLight"}),Object.entries(e).map(([s,a])=>c.jsxs("div",{className:"text-sm flex flex-row justify-between first:mt-0 mt-1",children:[c.jsx("div",{className:"text-accent-secondary",children:s}),c.jsx("div",{className:"text-accent-primary font-medium",children:a})]},s)),i&&c.jsx(Ge,{className:"mt-4",onClick:i,disabled:!n,variant:r?"contained":"outlined",children:r?"Selected":"Select"})]});var at=1e9,Ia={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Ir,X=!0,ge="[DecimalError] ",ze=ge+"Invalid argument: ",Br=ge+"Exponent out of range: ",lt=Math.floor,Ue=Math.pow,$a=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fe,ie=1e7,G=7,ki=9007199254740991,Gt=lt(ki/G),D={};D.absoluteValue=D.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};D.comparedTo=D.cmp=function(e){var t,r,n,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(n=s.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return n===i?0:n>i^s.s<0?1:-1};D.decimalPlaces=D.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*G;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};D.dividedBy=D.div=function(e){return Le(this,new this.constructor(e))};D.dividedToIntegerBy=D.idiv=function(e){var t=this,r=t.constructor;return Z(Le(t,new r(e),0,1),r.precision)};D.equals=D.eq=function(e){return!this.cmp(e)};D.exponent=function(){return re(this)};D.greaterThan=D.gt=function(e){return this.cmp(e)>0};D.greaterThanOrEqualTo=D.gte=function(e){return this.cmp(e)>=0};D.isInteger=D.isint=function(){return this.e>this.d.length-2};D.isNegative=D.isneg=function(){return this.s<0};D.isPositive=D.ispos=function(){return this.s>0};D.isZero=function(){return this.s===0};D.lessThan=D.lt=function(e){return this.cmp(e)<0};D.lessThanOrEqualTo=D.lte=function(e){return this.cmp(e)<1};D.logarithm=D.log=function(e){var t,r=this,n=r.constructor,i=n.precision,s=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(fe))throw Error(ge+"NaN");if(r.s<1)throw Error(ge+(r.s?"NaN":"-Infinity"));return r.eq(fe)?new n(0):(X=!1,t=Le(yt(r,s),yt(e,s),s),X=!0,Z(t,i))};D.minus=D.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Fi(t,e):Si(t,(e.s=-e.s,e))};D.modulo=D.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(ge+"NaN");return r.s?(X=!1,t=Le(r,e,0,1).times(e),X=!0,r.minus(t)):Z(new n(r),i)};D.naturalExponential=D.exp=function(){return Ei(this)};D.naturalLogarithm=D.ln=function(){return yt(this)};D.negated=D.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};D.plus=D.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Si(t,e):Fi(t,(e.s=-e.s,e))};D.precision=D.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ze+e);if(t=re(i)+1,n=i.d.length-1,r=n*G+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};D.squareRoot=D.sqrt=function(){var e,t,r,n,i,s,a,o=this,l=o.constructor;if(o.s<1){if(!o.s)return new l(0);throw Error(ge+"NaN")}for(e=re(o),X=!1,i=Math.sqrt(+o),i==0||i==1/0?(t=Ne(o.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=lt((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=a=r+3;;)if(s=n,n=s.plus(Le(o,s,a+2)).times(.5),Ne(s.d).slice(0,a)===(t=Ne(n.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(Z(s,r+1,0),s.times(s).eq(o)){n=s;break}}else if(t!="9999")break;a+=4}return X=!0,Z(n,r)};D.times=D.mul=function(e){var t,r,n,i,s,a,o,l,f,u=this,d=u.constructor,p=u.d,g=(e=new d(e)).d;if(!u.s||!e.s)return new d(0);for(e.s*=u.s,r=u.e+e.e,l=p.length,f=g.length,l<f&&(s=p,p=g,g=s,a=l,l=f,f=a),s=[],a=l+f,n=a;n--;)s.push(0);for(n=f;--n>=0;){for(t=0,i=l+n;i>n;)o=s[i]+g[n]*p[i-n-1]+t,s[i--]=o%ie|0,t=o/ie|0;s[i]=(s[i]+t)%ie|0}for(;!s[--a];)s.pop();return t?++r:s.shift(),e.d=s,e.e=r,X?Z(e,d.precision):e};D.toDecimalPlaces=D.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Se(e,0,at),t===void 0?t=n.rounding:Se(t,0,8),Z(r,e+re(r)+1,t))};D.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ye(n,!0):(Se(e,0,at),t===void 0?t=i.rounding:Se(t,0,8),n=Z(new i(n),e+1,t),r=Ye(n,!0,e+1)),r};D.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?Ye(i):(Se(e,0,at),t===void 0?t=s.rounding:Se(t,0,8),n=Z(new s(i),e+re(i)+1,t),r=Ye(n.abs(),!1,e+re(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};D.toInteger=D.toint=function(){var e=this,t=e.constructor;return Z(new t(e),re(e)+1,t.rounding)};D.toNumber=function(){return+this};D.toPower=D.pow=function(e){var t,r,n,i,s,a,o=this,l=o.constructor,f=12,u=+(e=new l(e));if(!e.s)return new l(fe);if(o=new l(o),!o.s){if(e.s<1)throw Error(ge+"Infinity");return o}if(o.eq(fe))return o;if(n=l.precision,e.eq(fe))return Z(o,n);if(t=e.e,r=e.d.length-1,a=t>=r,s=o.s,a){if((r=u<0?-u:u)<=ki){for(i=new l(fe),t=Math.ceil(n/G+4),X=!1;r%2&&(i=i.times(o),wn(i.d,t)),r=lt(r/2),r!==0;)o=o.times(o),wn(o.d,t);return X=!0,e.s<0?new l(fe).div(i):Z(i,n)}}else if(s<0)throw Error(ge+"NaN");return s=s<0&&e.d[Math.max(t,r)]&1?-1:1,o.s=1,X=!1,i=e.times(yt(o,n+f)),X=!0,i=Ei(i),i.s=s,i};D.toPrecision=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?(r=re(i),n=Ye(i,r<=s.toExpNeg||r>=s.toExpPos)):(Se(e,1,at),t===void 0?t=s.rounding:Se(t,0,8),i=Z(new s(i),e,t),r=re(i),n=Ye(i,e<=r||r<=s.toExpNeg,e)),n};D.toSignificantDigits=D.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Se(e,1,at),t===void 0?t=n.rounding:Se(t,0,8)),Z(new n(r),e,t)};D.toString=D.valueOf=D.val=D.toJSON=D[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=re(e),r=e.constructor;return Ye(e,t<=r.toExpNeg||t>=r.toExpPos)};function Si(e,t){var r,n,i,s,a,o,l,f,u=e.constructor,d=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),X?Z(t,d):t;if(l=e.d,f=t.d,a=e.e,i=t.e,l=l.slice(),s=a-i,s){for(s<0?(n=l,s=-s,o=f.length):(n=f,i=a,o=l.length),a=Math.ceil(d/G),o=a>o?a+1:o+1,s>o&&(s=o,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(o=l.length,s=f.length,o-s<0&&(s=o,n=f,f=l,l=n),r=0;s;)r=(l[--s]=l[s]+f[s]+r)/ie|0,l[s]%=ie;for(r&&(l.unshift(r),++i),o=l.length;l[--o]==0;)l.pop();return t.d=l,t.e=i,X?Z(t,d):t}function Se(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ze+e)}function Ne(e){var t,r,n,i=e.length-1,s="",a=e[0];if(i>0){for(s+=a,t=1;t<i;t++)n=e[t]+"",r=G-n.length,r&&(s+=Te(r)),s+=n;a=e[t],n=a+"",r=G-n.length,r&&(s+=Te(r))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}var Le=function(){function e(n,i){var s,a=0,o=n.length;for(n=n.slice();o--;)s=n[o]*i+a,n[o]=s%ie|0,a=s/ie|0;return a&&n.unshift(a),n}function t(n,i,s,a){var o,l;if(s!=a)l=s>a?1:-1;else for(o=l=0;o<s;o++)if(n[o]!=i[o]){l=n[o]>i[o]?1:-1;break}return l}function r(n,i,s){for(var a=0;s--;)n[s]-=a,a=n[s]<i[s]?1:0,n[s]=a*ie+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,a){var o,l,f,u,d,p,g,N,x,y,M,w,_,E,A,L,O,I,B=n.constructor,$=n.s==i.s?1:-1,R=n.d,V=i.d;if(!n.s)return new B(n);if(!i.s)throw Error(ge+"Division by zero");for(l=n.e-i.e,O=V.length,A=R.length,g=new B($),N=g.d=[],f=0;V[f]==(R[f]||0);)++f;if(V[f]>(R[f]||0)&&--l,s==null?w=s=B.precision:a?w=s+(re(n)-re(i))+1:w=s,w<0)return new B(0);if(w=w/G+2|0,f=0,O==1)for(u=0,V=V[0],w++;(f<A||u)&&w--;f++)_=u*ie+(R[f]||0),N[f]=_/V|0,u=_%V|0;else{for(u=ie/(V[0]+1)|0,u>1&&(V=e(V,u),R=e(R,u),O=V.length,A=R.length),E=O,x=R.slice(0,O),y=x.length;y<O;)x[y++]=0;I=V.slice(),I.unshift(0),L=V[0],V[1]>=ie/2&&++L;do u=0,o=t(V,x,O,y),o<0?(M=x[0],O!=y&&(M=M*ie+(x[1]||0)),u=M/L|0,u>1?(u>=ie&&(u=ie-1),d=e(V,u),p=d.length,y=x.length,o=t(d,x,p,y),o==1&&(u--,r(d,O<p?I:V,p))):(u==0&&(o=u=1),d=V.slice()),p=d.length,p<y&&d.unshift(0),r(x,d,y),o==-1&&(y=x.length,o=t(V,x,O,y),o<1&&(u++,r(x,O<y?I:V,y))),y=x.length):o===0&&(u++,x=[0]),N[f++]=u,o&&x[0]?x[y++]=R[E]||0:(x=[R[E]],y=1);while((E++<A||x[0]!==void 0)&&w--)}return N[0]||N.shift(),g.e=l,Z(g,a?s+re(g)+1:s)}}();function Ei(e,t){var r,n,i,s,a,o,l=0,f=0,u=e.constructor,d=u.precision;if(re(e)>16)throw Error(Br+re(e));if(!e.s)return new u(fe);for(X=!1,o=d,a=new u(.03125);e.abs().gte(.1);)e=e.times(a),f+=5;for(n=Math.log(Ue(2,f))/Math.LN10*2+5|0,o+=n,r=i=s=new u(fe),u.precision=o;;){if(i=Z(i.times(e),o),r=r.times(++l),a=s.plus(Le(i,r,o)),Ne(a.d).slice(0,o)===Ne(s.d).slice(0,o)){for(;f--;)s=Z(s.times(s),o);return u.precision=d,t==null?(X=!0,Z(s,d)):s}s=a}}function re(e){for(var t=e.e*G,r=e.d[0];r>=10;r/=10)t++;return t}function ar(e,t,r){if(t>e.LN10.sd())throw X=!0,r&&(e.precision=r),Error(ge+"LN10 precision limit exceeded");return Z(new e(e.LN10),t)}function Te(e){for(var t="";e--;)t+="0";return t}function yt(e,t){var r,n,i,s,a,o,l,f,u,d=1,p=10,g=e,N=g.d,x=g.constructor,y=x.precision;if(g.s<1)throw Error(ge+(g.s?"NaN":"-Infinity"));if(g.eq(fe))return new x(0);if(t==null?(X=!1,f=y):f=t,g.eq(10))return t==null&&(X=!0),ar(x,f);if(f+=p,x.precision=f,r=Ne(N),n=r.charAt(0),s=re(g),Math.abs(s)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=Ne(g.d),n=r.charAt(0),d++;s=re(g),n>1?(g=new x("0."+r),s++):g=new x(n+"."+r.slice(1))}else return l=ar(x,f+2,y).times(s+""),g=yt(new x(n+"."+r.slice(1)),f-p).plus(l),x.precision=y,t==null?(X=!0,Z(g,y)):g;for(o=a=g=Le(g.minus(fe),g.plus(fe),f),u=Z(g.times(g),f),i=3;;){if(a=Z(a.times(u),f),l=o.plus(Le(a,new x(i),f)),Ne(l.d).slice(0,f)===Ne(o.d).slice(0,f))return o=o.times(2),s!==0&&(o=o.plus(ar(x,f+2,y).times(s+""))),o=Le(o,new x(d),f),x.precision=y,t==null?(X=!0,Z(o,y)):o;o=l,i+=2}}function yn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=lt(r/G),e.d=[],n=(r+1)%G,r<0&&(n+=G),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=G;n<i;)e.d.push(+t.slice(n,n+=G));t=t.slice(n),n=G-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),X&&(e.e>Gt||e.e<-Gt))throw Error(Br+r)}else e.s=0,e.e=0,e.d=[0];return e}function Z(e,t,r){var n,i,s,a,o,l,f,u,d=e.d;for(a=1,s=d[0];s>=10;s/=10)a++;if(n=t-a,n<0)n+=G,i=t,f=d[u=0];else{if(u=Math.ceil((n+1)/G),s=d.length,u>=s)return e;for(f=s=d[u],a=1;s>=10;s/=10)a++;n%=G,i=n-G+a}if(r!==void 0&&(s=Ue(10,a-i-1),o=f/s%10|0,l=t<0||d[u+1]!==void 0||f%s,l=r<4?(o||l)&&(r==0||r==(e.s<0?3:2)):o>5||o==5&&(r==4||l||r==6&&(n>0?i>0?f/Ue(10,a-i):0:d[u-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(s=re(e),d.length=1,t=t-s-1,d[0]=Ue(10,(G-t%G)%G),e.e=lt(-t/G)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=u,s=1,u--):(d.length=u+1,s=Ue(10,G-n),d[u]=i>0?(f/Ue(10,a-i)%Ue(10,i)|0)*s:0),l)for(;;)if(u==0){(d[0]+=s)==ie&&(d[0]=1,++e.e);break}else{if(d[u]+=s,d[u]!=ie)break;d[u--]=0,s=1}for(n=d.length;d[--n]===0;)d.pop();if(X&&(e.e>Gt||e.e<-Gt))throw Error(Br+re(e));return e}function Fi(e,t){var r,n,i,s,a,o,l,f,u,d,p=e.constructor,g=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),X?Z(t,g):t;if(l=e.d,d=t.d,n=t.e,f=e.e,l=l.slice(),a=f-n,a){for(u=a<0,u?(r=l,a=-a,o=d.length):(r=d,n=f,o=l.length),i=Math.max(Math.ceil(g/G),o)+2,a>i&&(a=i,r.length=1),r.reverse(),i=a;i--;)r.push(0);r.reverse()}else{for(i=l.length,o=d.length,u=i<o,u&&(o=i),i=0;i<o;i++)if(l[i]!=d[i]){u=l[i]<d[i];break}a=0}for(u&&(r=l,l=d,d=r,t.s=-t.s),o=l.length,i=d.length-o;i>0;--i)l[o++]=0;for(i=d.length;i>a;){if(l[--i]<d[i]){for(s=i;s&&l[--s]===0;)l[s]=ie-1;--l[s],l[i]+=ie}l[i]-=d[i]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(t.d=l,t.e=n,X?Z(t,g):t):new p(0)}function Ye(e,t,r){var n,i=re(e),s=Ne(e.d),a=s.length;return t?(r&&(n=r-a)>0?s=s.charAt(0)+"."+s.slice(1)+Te(n):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Te(-i-1)+s,r&&(n=r-a)>0&&(s+=Te(n))):i>=a?(s+=Te(i+1-a),r&&(n=r-i-1)>0&&(s=s+"."+Te(n))):((n=i+1)<a&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-a)>0&&(i+1===a&&(s+="."),s+=Te(n))),e.s<0?"-"+s:s}function wn(e,t){if(e.length>t)return e.length=t,!0}function Ai(e){var t,r,n;function i(s){var a=this;if(!(a instanceof i))return new i(s);if(a.constructor=i,s instanceof i){a.s=s.s,a.e=s.e,a.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(ze+s);if(s>0)a.s=1;else if(s<0)s=-s,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(s===~~s&&s<1e7){a.e=0,a.d=[s];return}return yn(a,s.toString())}else if(typeof s!="string")throw Error(ze+s);if(s.charCodeAt(0)===45?(s=s.slice(1),a.s=-1):a.s=1,$a.test(s))yn(a,s);else throw Error(ze+s)}if(i.prototype=D,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Ai,i.config=i.set=Ha,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function Ha(e){if(!e||typeof e!="object")throw Error(ge+"Object expected");var t,r,n,i=["precision",1,at,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(lt(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(ze+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ze+r+": "+n);return this}var Ir=Ai(Ia);fe=new Ir(1);const Wa={prefix:"$",precision:2,zeroDisplay:"-",format:{minimumFractionDigits:2,maximumFractionDigits:2}};function Ua(e,t={}){const{prefix:r,precision:n,zeroDisplay:i,format:s}={...Wa,...t};if(e===0)return i;const a=e.toLocaleString("en",s??{maximumFractionDigits:n});return`${r}${a}`}function Ja(e,t,r){const n=e*t;return Ua(n,r)}const qa=(e,t,r)=>new Ir(e).toDecimalPlaces(t,r).toNumber(),$r=8,za=5,Za=({fieldName:e,currencyIcon:t,currencyName:r,displayBalance:n,placeholder:i="Enter Amount",balanceDetails:s,min:a="0",step:o="any",autoFocus:l=!0})=>{const f=_r({name:e,defaultValue:""}),{setValue:u}=Ke(),d=parseFloat(f||"0"),p=Ja(d,(s==null?void 0:s.price)??0,{zeroDisplay:"$0.00"}),g=x=>{u(e,x.target.value,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},N=x=>{(x.key==="ArrowUp"||x.key==="ArrowDown")&&x.preventDefault()};return c.jsxs(er,{className:"flex w-full flex-col content-center justify-between gap-4",children:[c.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("img",{src:t,alt:r,className:"h-10 max-h-[2.5rem] w-10 max-w-[2.5rem]"}),c.jsx("div",{className:"text-lg",children:r})]}),c.jsx("input",{type:"number",value:f??"",min:a,step:o,onChange:g,onKeyDown:N,placeholder:i,autoFocus:l,className:"w-2/3 bg-transparent text-right text-lg outline-none appearance-none [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"})]}),c.jsx(Ni,{name:e,defaultValue:""}),s&&n?c.jsxs("div",{className:"flex w-full flex-row content-center justify-between text-sm",children:[c.jsxs("div",{children:["Stakable:"," ",c.jsx("span",{className:"cursor-default",children:qa(Number(s.balance),s.decimals??$r)})," ",s.symbol]}),s.displayUSD&&s.price!==void 0&&c.jsxs("div",{children:[p," USD"]})]}):null]})};function Ga({items:e,onRemove:t}){const r=v.useMemo(()=>e,[e]);return r.length===0?null:c.jsx("div",{className:"flex flex-col gap-8",children:r.map(({bsnId:n,bsnName:i,bsnLogoUrl:s,provider:a})=>c.jsx(Pr,{bsnId:n,bsnName:i,bsnLogoUrl:s,provider:a,onRemove:t},`${n}-${a.rank}`))})}function Xa({max:e,items:t=[],actionText:r,onAdd:n,onRemove:i}){const s=v.useMemo(()=>t.length,[t]);return c.jsx(er,{children:c.jsxs("div",{className:"flex w-full flex-col gap-4",children:[c.jsx("div",{className:"flex flex-row",children:c.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[c.jsx("span",{className:"text-sm sm:text-base",children:r}),c.jsx(si,{counter:s,max:e,onAdd:n})]})}),s>0&&c.jsx(Ga,{items:t,onRemove:i})]})})}function rr({title:e,children:t,className:r,hint:n}){return c.jsxs("div",{className:C.twMerge("flex flex-row items-center justify-between text-accent-primary",n&&"items-start",r),children:[c.jsx(q,{as:"div",variant:"body1",children:e}),n?c.jsxs("div",{className:"flex flex-col items-end",children:[c.jsx(q,{as:"div",className:"flex items-center gap-2",children:t}),c.jsx(q,{as:"div",variant:"body2",className:"text-accent-secondary",children:n})]}):c.jsx(q,{as:"div",className:"flex items-center gap-2",children:t})]})}function Ya(e){return wt({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"},child:[]}]})(e)}function Li({value:e,onEdit:t,title:r="Network Fee Rate",className:n}){return c.jsxs(rr,{title:r,className:n,children:[c.jsxs("span",{children:[e," sats/vB"]}),t&&c.jsx(Ge,{size:"small",variant:"outlined",className:"h-6 w-6 pl-1 text-secondary-strokeDark",onClick:t,children:c.jsx(Ya,{size:16,className:"text-secondary-strokeDark"})})]})}function Vi({amount:e,coinSymbol:t,hint:r,title:n,className:i,decimals:s=$r}){let a;return typeof e=="number"?e===0?a="0":a=e.toFixed(s).replace(/0+$/,"").replace(/\.$/,""):a=e,c.jsxs(rr,{title:n??`${t} Network Fee`,hint:r,className:i,children:[a," ",t]})}function Mi({amount:e,coinSymbol:t,hint:r,title:n,className:i,decimals:s=za}){const a=typeof e=="number"?e.toFixed(s):e;return c.jsxs(rr,{title:n??`${t} Network Fee`,hint:r,className:i,children:[a," ",t]})}function Di({total:e,coinSymbol:t,hint:r,title:n="Total",className:i,decimals:s=$r}){let a;return typeof e=="number"?e===0?a="0":a=e.toFixed(s).replace(/0+$/,"").replace(/\.$/,""):a=e,c.jsxs("div",{className:C.twMerge("flex flex-row items-start justify-between text-accent-primary",i),children:[c.jsx(q,{variant:"body1",className:"font-bold",children:n}),c.jsxs("div",{className:"flex flex-col items-end justify-center",children:[c.jsxs(q,{variant:"body1",className:"font-bold",children:[a," ",t]}),r&&c.jsx(q,{variant:"body1",className:"text-sm text-accent-secondary",children:r})]})]})}function Ka({className:e,feeRate:t,onFeeRateEdit:r,feeAmount:n,coinSymbol:i,feeAmountHint:s,total:a,totalHint:o,bbnFeeAmount:l,bbnCoinSymbol:f,bbnFeeAmountHint:u,bbnFeeDecimals:d}){return c.jsx(er,{className:C.twMerge("flex w-full flex-col content-center justify-between gap-4",e),children:c.jsxs("div",{className:"flex flex-col gap-6 p-4",children:[c.jsx(Li,{value:t,onEdit:r}),c.jsx(Vi,{amount:n,coinSymbol:i,hint:s}),l!==void 0&&f?c.jsx(Mi,{amount:l,coinSymbol:f,hint:u,decimals:d}):null,c.jsx("div",{className:"divider my-4"}),c.jsx(Di,{total:a,coinSymbol:i,hint:o})]})})}const jn=e=>{let t="";for(let r=0;r<e.length;r++){const n=e[r].toLowerCase();n>="a"&&n<="z"||n>="0"&&n<="9"?t+=n:t.length>0&&t[t.length-1]!=="-"&&(t+="-")}return t.endsWith("-")&&(t=t.slice(0,-1)),t},Qa=640;function el({className:e,...t}){const n=Er(Qa)?Or:qn;return c.jsx(n,{...t,className:C.twMerge("w-[41.25rem] max-w-full",e)})}const tl=({open:e,processing:t=!1,onClose:r,onProceed:n,bsns:i,finalityProviders:s,details:a})=>{const o=[{label:"Stake Amount",value:a.stakeAmount},{label:"Fee Rate",value:a.feeRate},{label:"Transaction Fees",value:a.transactionFees},{label:"Term",value:c.jsxs(c.Fragment,{children:[a.term.blocks,c.jsx("br",{}),c.jsx("span",{className:"text-md text-secondary",children:a.term.duration})]})},{label:"Unbonding",value:a.unbonding},{label:"Unbonding Fee",value:a.unbondingFee}];return c.jsxs(el,{open:e,onClose:r,children:[c.jsx(Zn,{title:"Preview",onClose:r,className:"text-accent-primary"}),c.jsxs(Gn,{className:"no-scrollbar mb-8 mt-4 flex max-h-[calc(100vh-12rem)] flex-col gap-4 overflow-y-auto text-accent-primary",children:[c.jsx(ii,{className:"p-6 pt-4",children:c.jsxs("div",{className:"flex flex-col",children:[i.length>1?c.jsxs("div",{className:"grid grid-cols-2 items-center gap-4 pb-4",children:[c.jsx(q,{variant:"caption",className:"text-secondary text-center",children:"BSNs"}),c.jsx(q,{variant:"caption",className:"text-secondary text-center",children:"Finality Provider"})]}):null,c.jsxs("div",{className:"grid grid-cols-2 items-center gap-4 rounded bg-primary-contrast p-4",children:[c.jsx("div",{className:"flex flex-col gap-3",children:i.map((l,f)=>c.jsxs("div",{className:"flex w-full items-center justify-center gap-2 py-1",children:[l.icon,c.jsx(q,{variant:"body2",className:"font-medium",children:l.name})]},`bsn-${jn(l.name)}-${f}`))}),c.jsx("div",{className:"flex flex-col gap-3",children:s.map((l,f)=>c.jsxs("div",{className:"flex w-full items-center justify-center gap-2 py-1",children:[l.icon,c.jsx(q,{variant:"body2",className:"font-medium",children:l.name})]},`fp-${jn(l.name)}-${f}`))})]})]})}),c.jsx("div",{className:"flex flex-col",children:o.map((l,f)=>c.jsxs("div",{className:"flex flex-row items-center justify-between py-3",children:[c.jsx(q,{variant:"body1",className:"text-secondary font-normal",children:l.label}),c.jsx(q,{variant:"body1",className:"text-right font-normal",children:l.value})]},f))}),c.jsx("div",{className:"border-divider w-full border-t"}),c.jsxs("div",{className:"pt-2",children:[c.jsx(Xt,{variant:"h6",className:"text-primary mb-2",children:"Attention!"}),c.jsx(q,{variant:"body2",className:"text-secondary",children:"1. No third party possesses your staked BTC. You are the only one who can unbond and withdraw your stake."}),c.jsx(q,{variant:"body2",className:"text-secondary",children:"2. Your stake will first be sent to Babylon Genesis for verification (~20 seconds), then you will be prompted to submit it to the Bitcoin ledger. It will be marked as 'Pending' until it receives 10 Bitcoin confirmations."})]})]}),c.jsxs(Xn,{className:"flex flex-col gap-4 pb-8 pt-0 sm:flex-row",children:[c.jsx(Ge,{variant:"contained",color:"primary",onClick:n,className:"w-full sm:flex-1 sm:order-2",disabled:t,children:t?"Processing...":"Proceed to Signing"}),c.jsx(Ge,{variant:"outlined",color:"primary",onClick:r,className:"w-full sm:flex-1 sm:order-1",children:"Cancel"})]})]})},rl=({size:e="md"})=>{const t={sm:"mt-2",md:"mt-4",lg:"mt-6"};return c.jsx("div",{className:t[e]})},nl=()=>c.jsx("svg",{width:"29",height:"28",viewBox:"0 0 29 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M24.9127 15.3708C24.9711 14.9333 25.0002 14.4812 25.0002 14C25.0002 13.5333 24.9711 13.0667 24.8982 12.6292L27.8586 10.325C28.1211 10.1208 28.194 9.72708 28.0336 9.43542L25.2336 4.59375C25.0586 4.27292 24.694 4.17083 24.3732 4.27292L20.8877 5.67292C20.1586 5.11875 19.3857 4.65208 18.5252 4.30208L18.0002 0.597916C17.9419 0.247916 17.6502 0 17.3002 0H11.7002C11.3502 0 11.0732 0.247916 11.0148 0.597916L10.4898 4.30208C9.62941 4.65208 8.84191 5.13333 8.12732 5.67292L4.64191 4.27292C4.32107 4.15625 3.95649 4.27292 3.78149 4.59375L0.996075 9.43542C0.821075 9.74167 0.879408 10.1208 1.17107 10.325L4.13149 12.6292C4.05857 13.0667 4.00024 13.5479 4.00024 14C4.00024 14.4521 4.02941 14.9333 4.10232 15.3708L1.14191 17.675C0.879408 17.8792 0.806491 18.2729 0.966908 18.5646L3.76691 23.4062C3.94191 23.7271 4.30649 23.8292 4.62732 23.7271L8.11274 22.3271C8.84191 22.8812 9.61482 23.3479 10.4752 23.6979L11.0002 27.4021C11.0732 27.7521 11.3502 28 11.7002 28H17.3002C17.6502 28 17.9419 27.7521 17.9857 27.4021L18.5107 23.6979C19.3711 23.3479 20.1586 22.8812 20.8732 22.3271L24.3586 23.7271C24.6794 23.8438 25.044 23.7271 25.219 23.4062L28.019 18.5646C28.194 18.2437 28.1211 17.8792 27.844 17.675L24.9127 15.3708ZM14.5002 19.25C11.6127 19.25 9.25024 16.8875 9.25024 14C9.25024 11.1125 11.6127 8.75 14.5002 8.75C17.3877 8.75 19.7502 11.1125 19.7502 14C19.7502 16.8875 17.3877 19.25 14.5002 19.25Z",fill:"#9E9E9E"})}),_i=()=>c.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Ti=({children:e,className:t=""})=>c.jsx(q,{variant:"body1",className:C.twJoin("px-7 pb-6 text-accent-primary md:hidden",t),children:e}),Ri=({background:e="none",backgroundClassName:t="",className:r="",children:n})=>{const i=()=>{switch(e){case"secondary":return"mx-[21px] rounded-lg bg-secondary-highlight md:mx-0 md:bg-transparent";case"custom":return t;default:return""}};return c.jsx("div",{className:C.twJoin(i(),r),children:n})},ot=({children:e})=>c.jsx(c.Fragment,{children:e}),Hr=({icon:e,suffix:t,onClick:r,disabled:n=!1,selected:i=!1,className:s="",children:a})=>{const o=v.Children.toArray(a),l=o.find(p=>typeof p=="string"||v.isValidElement(p)&&p.type!==ot),f=o.find(p=>v.isValidElement(p)&&p.type===ot),u=typeof l=="string"?l:"",d=r?c.jsx(_i,{}):void 0;return c.jsx(li,{icon:e,name:u,description:f?f.props.children:void 0,onClick:r,disabled:n,selected:i,className:s,suffix:t||d})},Pi=({icon:e,className:t="",children:r})=>{const n=v.Children.toArray(r),i=n.find(l=>typeof l=="string"||v.isValidElement(l)&&l.type!==ot),s=n.find(l=>v.isValidElement(l)&&l.type===ot),a=n.filter(l=>v.isValidElement(l)&&l.type===Hr),o=typeof i=="string"?i:"";return c.jsx(ci,{icon:e,name:o,description:s?s.props.children:void 0,className:t,suffix:c.jsx(_i,{}),children:a})},Bi=({children:e,className:t=""})=>c.jsx("div",{className:t,children:e}),il=({trigger:e,open:t,onOpenChange:r,placement:n="bottom-end",className:i,offset:s=[0,8],children:a})=>{const o=c.jsx("button",{className:"flex h-10 w-10 items-center justify-center rounded-lg transition-colors hover:bg-accent-primary/10","aria-label":"Settings menu",children:c.jsx(nl,{})});return c.jsx(ai,{trigger:e||o,open:t,onOpenChange:r,placement:n,className:i,offset:s,children:a})},Be=il;Be.Title=Ti;Be.Group=Ri;Be.Item=Hr;Be.SubMenu=Pi;Be.Description=ot;Be.CustomContent=Bi;Be.Spacer=rl;const sl={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function ol({className:e,orientation:t="vertical",children:r}){return c.jsx("div",{className:C.twMerge("bbn-list-legacy",`bbn-list-legacy-${t}`,e),children:v.Children.map(r,n=>v.isValidElement(n)?v.cloneElement(n,{orientation:sl[t]}):n)})}function al({className:e,orientation:t="horizontal",title:r,value:n,suffix:i}){return c.jsxs("div",{className:C.twJoin("bbn-list-item-legacy",`bbn-list-item-legacy-${t}`,e),children:[c.jsx(q,{as:"div",className:C.twJoin("bbn-list-title-legacy",`bbn-list-title-legacy-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),c.jsxs(q,{as:"div",className:C.twJoin("bbn-list-value-legacy",`bbn-list-value-legacy-${t}`),variant:"body1",children:[n,i]})]})}exports.Accordion=Ui;exports.AccordionDetails=zi;exports.AccordionSummary=Ji;exports.AmountSubsection=Za;exports.Avatar=It;exports.AvatarGroup=Zi;exports.BBNFeeAmount=Mi;exports.BTCFeeAmount=Vi;exports.BTCFeeRate=Li;exports.Badge=ra;exports.BitcoinPublicKeyIcon=Oo;exports.Button=Ge;exports.Card=ii;exports.Cell=ni;exports.Checkbox=Sn;exports.CheckboxField=_a;exports.Chip=Fo;exports.CloseIcon=zn;exports.Column=ti;exports.Copy=la;exports.CopyIcon=Eo;exports.CounterButton=si;exports.Dialog=qn;exports.DialogBody=Gn;exports.DialogFooter=Xn;exports.DialogHeader=Zn;exports.DisplayHash=aa;exports.FeeItem=rr;exports.FeesSection=Ka;exports.FinalityProviderItem=Pr;exports.FinalityProviderLogo=Oi;exports.FinalityProviderSubsection=Xa;exports.Form=Aa;exports.FormControl=Ot;exports.Heading=Xt;exports.HiddenField=Ni;exports.IconButton=dr;exports.Input=Kt;exports.LinkWalletIcon=ko;exports.List=ea;exports.ListItem=ta;exports.ListItemLegacy=al;exports.ListLegacy=ol;exports.Loader=Ao;exports.Menu=ai;exports.MenuDrawer=Sr;exports.MenuItem=li;exports.MobileDialog=Or;exports.NumberField=Ma;exports.Popover=wr;exports.Portal=Nt;exports.PreviewModal=tl;exports.Radio=En;exports.RadioField=Ta;exports.ScrollLocker=No;exports.Select=jr;exports.SelectField=Ra;exports.SettingMenu=Be;exports.SettingMenuCustomContent=Bi;exports.SettingMenuDescription=ot;exports.SettingMenuGroup=Ri;exports.SettingMenuItem=Hr;exports.SettingMenuSubMenu=Pi;exports.SettingMenuTitle=Ti;exports.SubMenu=ci;exports.SubMenuItem=sa;exports.SubSection=er;exports.Table=Yo;exports.TableElement=Ba;exports.Text=q;exports.TextField=Da;exports.ThemedIcon=Qt;exports.Toggle=Ko;exports.Total=Di;exports.UsingInscriptionIcon=So;exports.WalletDisconnectButton=On;exports.iconColorVariants=Nr;exports.useClickOutside=Hn;exports.useControlledState=Ze;exports.useCopy=ui;exports.useField=Qe;exports.useFieldState=La;exports.useFormContext=Ke;exports.useFormState=Dr;exports.useIsMobile=Er;exports.useMemoizedArray=$n;exports.useMenuContext=kr;exports.useModalManager=Cr;exports.useResizeObserver=Wn;exports.useTableScroll=Qn;exports.useTableSort=ri;exports.useWatch=_r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),v=require("react"),w=require("tailwind-merge"),An=require("react-dom");function Ln(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ae=Ln(v),Ks=Ln(An);function Ze({value:e,defaultValue:t,onStateChange:r}={}){const[n,s]=v.useState(t),{current:i}=v.useRef(e!=null),o=i?e:n,a=v.useCallback(l=>{i||s(l),r==null||r(l)},[i,r,s]);return[o,a]}const hr=v.createContext({disabled:!1,expanded:!1});function Qs({expanded:e,defaultExpanded:t,onChange:r,className:n,disabled:s=!1,children:i}){const[o=!1,a]=Ze({value:e,defaultValue:t,onStateChange:r}),l=v.useCallback(()=>{a(!o)},[a,o]),f=v.useMemo(()=>({defaultExpanded:t,disabled:s,expanded:o&&!s,toggle:s?void 0:l}),[t,o,s,l]);return c.jsx(hr.Provider,{value:f,children:c.jsx("div",{className:w.twJoin("bbn-accordion",s&&"bbn-accordion-disabled",n),children:i})})}const Ge=v.forwardRef(({variant:e="contained",size:t="large",color:r="primary",fluid:n=!1,className:s,disabled:i,...o},a)=>c.jsx("button",{...o,disabled:i,ref:a,className:w.twJoin("bbn-btn",`bbn-btn-${e}`,`bbn-btn-${r}`,`bbn-btn-${t}`,n&&"bbn-btn-fluid",s)}));Ge.displayName="Button";const mr=({className:e,...t})=>c.jsx("button",{...t,className:w.twJoin("bbn-btn-icon",e)}),pr=v.forwardRef(({className:e,...t},r)=>c.jsx(Ge,{...t,ref:r,variant:"contained",className:w.twJoin("!bg-error-main text-white font-medium !text-sm hover:!bg-error-main/90 transition-colors",e)}));pr.displayName="WalletDisconnectButton";function ei({className:e,iconClassName:t,children:r,renderIcon:n=()=>null}){const{expanded:s,toggle:i}=v.useContext(hr),o=n(s);return c.jsxs("div",{className:w.twJoin("bbn-accordion-summary",e),onClick:i,children:[r,o&&c.jsx(mr,{className:w.twJoin("bbn-accordion-icon",t),children:o})]})}function vr(e,t){return typeof e!="number"?typeof t=="number"?vr(t):t:`${e}px`}function ti(e=!0){const[t,r]=v.useState("0px"),[n,s]=v.useState(),i=v.useRef(null);return v.useEffect(()=>{const o=new ResizeObserver(a=>{const[l]=a;r(vr(l.target.clientHeight)??"0px")});s(o)},[]),v.useEffect(function(){const{current:a}=i;if(!(!e||!a))return n==null||n.observe(a),()=>{n==null||n.unobserve(a)}},[e,n]),{height:t,ref:i}}function ri({unmountOnExit:e=!1,animationDuration:t=200,className:r,wrapperClassName:n,children:s}){const{expanded:i}=v.useContext(hr),[o,a]=v.useState(i),l=o||!e,{height:f,ref:u}=ti(l);return v.useEffect(function(){if(i===o)return;if(i){a(!0);return}const m=setTimeout(a,t,!1);return()=>{clearTimeout(m)}},[i,o,t]),c.jsx("div",{className:w.twJoin("bbn-accordion-details",n),style:{height:i?f:"0px",visibility:o?"visible":"hidden",transitionDuration:`${t}ms`},children:l?c.jsx("div",{ref:u,className:w.twJoin("bbn-accordion-content",r),children:s}):null})}const H=v.forwardRef(({variant:e="body1",as:t="p",children:r,className:n,...s},i)=>v.createElement(t,{...s,ref:i,className:w.twJoin(`bbn-text-${e}`,n)},r));H.displayName="Text";const Xt=v.forwardRef(({variant:e,as:t=e,children:r,className:n,...s},i)=>v.createElement(t,{...s,ref:i,className:w.twJoin(`bbn-${e}`,n)},r));Xt.displayName="Heading";function xt({className:e,style:t,size:r="large",variant:n="circular",alt:s,url:i,children:o}){return c.jsx("div",{style:t,className:w.twJoin("bbn-avatar",`bbn-avatar-${r}`,`bbn-avatar-${n}`,e),children:i?c.jsx("img",{className:"bbn-avatar-img",src:i,alt:s}):o})}const ni=({max:e=1/0,className:t,children:r,avatarClassName:n,variant:s,...i})=>{const o=v.Children.count(r);return c.jsxs("div",{className:w.twJoin("bbn-avatar-group",t),children:[v.Children.map(r,(a,l)=>v.isValidElement(a)&&l+1<=e?v.cloneElement(a,{...i,className:w.twMerge(n,a.props.className),variant:s}):null),o>e&&c.jsxs(xt,{size:i.size,variant:s,className:n,children:["+",o-e]})]})},Mn=v.forwardRef(function({label:t,checked:r,defaultChecked:n=!1,inputProps:s,orientation:i="left",disabled:o=!1,className:a,inputType:l,labelClassName:f,renderIcon:u,onChange:d,...m},g){const[C=!1,y]=Ze({value:r,defaultValue:n,onStateChange:d});function b(j){var D;y(j.currentTarget.checked),(D=s==null?void 0:s.onChange)==null||D.call(s,j)}const M=c.jsxs("span",{className:w.twJoin("bbn-switcher",o&&"bbn-switcher-disabled",a),children:[u(C),c.jsx("input",{ref:g,type:l,disabled:o,className:"bbn-switcher-input",...m,...s,checked:C,onChange:b})]});return t?c.jsxs(H,{as:"label",variant:"body1",className:w.twJoin("bbn-switcher-label",i==="left"?"bbn-switcher-left":"bbn-switcher-right",f),children:[M,t]}):M}),si={false:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.jsx("path",{d:"M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z",fill:"currentColor"})}),true:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.jsx("path",{d:"M19 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.11 21 21 20.1 21 19V5C21 3.9 20.11 3 19 3ZM10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",fill:"currentColor"})})},Vn=v.forwardRef(function(t,r){return c.jsx(Mn,{ref:r,...t,inputType:"checkbox",renderIcon:n=>si[n.toString()]})}),ii={true:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.jsx("path",{d:"M12 7C9.24 7 7 9.24 7 12C7 14.76 9.24 17 12 17C14.76 17 17 14.76 17 12C17 9.24 14.76 7 12 7ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z",fill:"currentColor"})}),false:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z",fill:"currentColor"})})},_n=v.forwardRef(function(t,r){return c.jsx(Mn,{ref:r,...t,inputType:"radio",renderIcon:n=>ii[n.toString()]})});var Dn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Qr=v.createContext&&v.createContext(Dn),oi=["attr","size","title"];function ai(e,t){if(e==null)return{};var r=li(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function li(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$t.apply(this,arguments)}function en(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?en(Object(r),!0).forEach(function(n){ci(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):en(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ci(e,t,r){return t=ui(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ui(e){var t=fi(e,"string");return typeof t=="symbol"?t:t+""}function fi(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tn(e){return e&&e.map((t,r)=>v.createElement(t.tag,Ht({key:r},t.attr),Tn(t.child)))}function jt(e){return t=>v.createElement(di,$t({attr:Ht({},e.attr)},t),Tn(e.child))}function di(e){var t=r=>{var{attr:n,size:s,title:i}=e,o=ai(e,oi),a=s||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),v.createElement("svg",$t({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,o,{className:l,style:Ht(Ht({color:e.color||r.color},r.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),i&&v.createElement("title",null,i),e.children)};return Qr!==void 0?v.createElement(Qr.Consumer,null,r=>t(r)):t(Dn)}function hi(e){return jt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 16L6 10H18L12 16Z"},child:[]}]})(e)}function mi(e){return jt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"},child:[]}]})(e)}function pi(e){return jt({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 8L18 14H6L12 8Z"},child:[]}]})(e)}var tn=function(t){return t.reduce(function(r,n){var s=n[0],i=n[1];return r[s]=i,r},{})},rn=typeof window<"u"&&window.document&&window.document.createElement?Ae.useLayoutEffect:Ae.useEffect,le="top",pe="bottom",ve="right",ce="left",gr="auto",Ct=[le,pe,ve,ce],rt="start",bt="end",vi="clippingParents",Rn="viewport",ft="popper",gi="reference",nn=Ct.reduce(function(e,t){return e.concat([t+"-"+rt,t+"-"+bt])},[]),Pn=[].concat(Ct,[gr]).reduce(function(e,t){return e.concat([t,t+"-"+rt,t+"-"+bt])},[]),xi="beforeRead",bi="read",yi="afterRead",wi="beforeMain",ji="main",Ci="afterMain",Ni="beforeWrite",ki="write",Si="afterWrite",Oi=[xi,bi,yi,wi,ji,Ci,Ni,ki,Si];function Se(e){return e?(e.nodeName||"").toLowerCase():null}function de(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xe(e){var t=de(e).Element;return e instanceof t||e instanceof Element}function me(e){var t=de(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function xr(e){if(typeof ShadowRoot>"u")return!1;var t=de(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Ei(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},s=t.attributes[r]||{},i=t.elements[r];!me(i)||!Se(i)||(Object.assign(i.style,n),Object.keys(s).forEach(function(o){var a=s[o];a===!1?i.removeAttribute(o):i.setAttribute(o,a===!0?"":a)}))})}function Fi(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var s=t.elements[n],i=t.attributes[n]||{},o=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),a=o.reduce(function(l,f){return l[f]="",l},{});!me(s)||!Se(s)||(Object.assign(s.style,a),Object.keys(i).forEach(function(l){s.removeAttribute(l)}))})}}const Ai={name:"applyStyles",enabled:!0,phase:"write",fn:Ei,effect:Fi,requires:["computeStyles"]};function ke(e){return e.split("-")[0]}var qe=Math.max,Wt=Math.min,nt=Math.round;function lr(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Bn(){return!/^((?!chrome|android).)*safari/i.test(lr())}function st(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),s=1,i=1;t&&me(e)&&(s=e.offsetWidth>0&&nt(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&nt(n.height)/e.offsetHeight||1);var o=Xe(e)?de(e):window,a=o.visualViewport,l=!Bn()&&r,f=(n.left+(l&&a?a.offsetLeft:0))/s,u=(n.top+(l&&a?a.offsetTop:0))/i,d=n.width/s,m=n.height/i;return{width:d,height:m,top:u,right:f+d,bottom:u+m,left:f,x:f,y:u}}function br(e){var t=st(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function In(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&xr(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Me(e){return de(e).getComputedStyle(e)}function Li(e){return["table","td","th"].indexOf(Se(e))>=0}function Pe(e){return((Xe(e)?e.ownerDocument:e.document)||window.document).documentElement}function Yt(e){return Se(e)==="html"?e:e.assignedSlot||e.parentNode||(xr(e)?e.host:null)||Pe(e)}function sn(e){return!me(e)||Me(e).position==="fixed"?null:e.offsetParent}function Mi(e){var t=/firefox/i.test(lr()),r=/Trident/i.test(lr());if(r&&me(e)){var n=Me(e);if(n.position==="fixed")return null}var s=Yt(e);for(xr(s)&&(s=s.host);me(s)&&["html","body"].indexOf(Se(s))<0;){var i=Me(s);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return s;s=s.parentNode}return null}function Nt(e){for(var t=de(e),r=sn(e);r&&Li(r)&&Me(r).position==="static";)r=sn(r);return r&&(Se(r)==="html"||Se(r)==="body"&&Me(r).position==="static")?t:r||Mi(e)||t}function yr(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function mt(e,t,r){return qe(e,Wt(t,r))}function Vi(e,t,r){var n=mt(e,t,r);return n>r?r:n}function $n(){return{top:0,right:0,bottom:0,left:0}}function Hn(e){return Object.assign({},$n(),e)}function Wn(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var _i=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Hn(typeof t!="number"?t:Wn(t,Ct))};function Di(e){var t,r=e.state,n=e.name,s=e.options,i=r.elements.arrow,o=r.modifiersData.popperOffsets,a=ke(r.placement),l=yr(a),f=[ce,ve].indexOf(a)>=0,u=f?"height":"width";if(!(!i||!o)){var d=_i(s.padding,r),m=br(i),g=l==="y"?le:ce,C=l==="y"?pe:ve,y=r.rects.reference[u]+r.rects.reference[l]-o[l]-r.rects.popper[u],b=o[l]-r.rects.reference[l],M=Nt(i),j=M?l==="y"?M.clientHeight||0:M.clientWidth||0:0,D=y/2-b/2,O=d[g],F=j-m[u]-d[C],A=j/2-m[u]/2+D,k=mt(O,A,F),I=l;r.modifiersData[n]=(t={},t[I]=k,t.centerOffset=k-A,t)}}function Ti(e){var t=e.state,r=e.options,n=r.element,s=n===void 0?"[data-popper-arrow]":n;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||In(t.elements.popper,s)&&(t.elements.arrow=s))}const Ri={name:"arrow",enabled:!0,phase:"main",fn:Di,effect:Ti,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function it(e){return e.split("-")[1]}var Pi={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Bi(e,t){var r=e.x,n=e.y,s=t.devicePixelRatio||1;return{x:nt(r*s)/s||0,y:nt(n*s)/s||0}}function on(e){var t,r=e.popper,n=e.popperRect,s=e.placement,i=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,f=e.adaptive,u=e.roundOffsets,d=e.isFixed,m=o.x,g=m===void 0?0:m,C=o.y,y=C===void 0?0:C,b=typeof u=="function"?u({x:g,y}):{x:g,y};g=b.x,y=b.y;var M=o.hasOwnProperty("x"),j=o.hasOwnProperty("y"),D=ce,O=le,F=window;if(f){var A=Nt(r),k="clientHeight",I="clientWidth";if(A===de(r)&&(A=Pe(r),Me(A).position!=="static"&&a==="absolute"&&(k="scrollHeight",I="scrollWidth")),A=A,s===le||(s===ce||s===ve)&&i===bt){O=pe;var B=d&&A===F&&F.visualViewport?F.visualViewport.height:A[k];y-=B-n.height,y*=l?1:-1}if(s===ce||(s===le||s===pe)&&i===bt){D=ve;var $=d&&A===F&&F.visualViewport?F.visualViewport.width:A[I];g-=$-n.width,g*=l?1:-1}}var R=Object.assign({position:a},f&&Pi),V=u===!0?Bi({x:g,y},de(r)):{x:g,y};if(g=V.x,y=V.y,l){var P;return Object.assign({},R,(P={},P[O]=j?"0":"",P[D]=M?"0":"",P.transform=(F.devicePixelRatio||1)<=1?"translate("+g+"px, "+y+"px)":"translate3d("+g+"px, "+y+"px, 0)",P))}return Object.assign({},R,(t={},t[O]=j?y+"px":"",t[D]=M?g+"px":"",t.transform="",t))}function Ii(e){var t=e.state,r=e.options,n=r.gpuAcceleration,s=n===void 0?!0:n,i=r.adaptive,o=i===void 0?!0:i,a=r.roundOffsets,l=a===void 0?!0:a,f={placement:ke(t.placement),variation:it(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,on(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,on(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const $i={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ii,data:{}};var Tt={passive:!0};function Hi(e){var t=e.state,r=e.instance,n=e.options,s=n.scroll,i=s===void 0?!0:s,o=n.resize,a=o===void 0?!0:o,l=de(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach(function(u){u.addEventListener("scroll",r.update,Tt)}),a&&l.addEventListener("resize",r.update,Tt),function(){i&&f.forEach(function(u){u.removeEventListener("scroll",r.update,Tt)}),a&&l.removeEventListener("resize",r.update,Tt)}}const Wi={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Hi,data:{}};var Ji={left:"right",right:"left",bottom:"top",top:"bottom"};function Pt(e){return e.replace(/left|right|bottom|top/g,function(t){return Ji[t]})}var Ui={start:"end",end:"start"};function an(e){return e.replace(/start|end/g,function(t){return Ui[t]})}function wr(e){var t=de(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function jr(e){return st(Pe(e)).left+wr(e).scrollLeft}function qi(e,t){var r=de(e),n=Pe(e),s=r.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;var f=Bn();(f||!f&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:i,height:o,x:a+jr(e),y:l}}function zi(e){var t,r=Pe(e),n=wr(e),s=(t=e.ownerDocument)==null?void 0:t.body,i=qe(r.scrollWidth,r.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=qe(r.scrollHeight,r.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+jr(e),l=-n.scrollTop;return Me(s||r).direction==="rtl"&&(a+=qe(r.clientWidth,s?s.clientWidth:0)-i),{width:i,height:o,x:a,y:l}}function Cr(e){var t=Me(e),r=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+s+n)}function Jn(e){return["html","body","#document"].indexOf(Se(e))>=0?e.ownerDocument.body:me(e)&&Cr(e)?e:Jn(Yt(e))}function pt(e,t){var r;t===void 0&&(t=[]);var n=Jn(e),s=n===((r=e.ownerDocument)==null?void 0:r.body),i=de(n),o=s?[i].concat(i.visualViewport||[],Cr(n)?n:[]):n,a=t.concat(o);return s?a:a.concat(pt(Yt(o)))}function cr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Zi(e,t){var r=st(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function ln(e,t,r){return t===Rn?cr(qi(e,r)):Xe(t)?Zi(t,r):cr(zi(Pe(e)))}function Gi(e){var t=pt(Yt(e)),r=["absolute","fixed"].indexOf(Me(e).position)>=0,n=r&&me(e)?Nt(e):e;return Xe(n)?t.filter(function(s){return Xe(s)&&In(s,n)&&Se(s)!=="body"}):[]}function Xi(e,t,r,n){var s=t==="clippingParents"?Gi(e):[].concat(t),i=[].concat(s,[r]),o=i[0],a=i.reduce(function(l,f){var u=ln(e,f,n);return l.top=qe(u.top,l.top),l.right=Wt(u.right,l.right),l.bottom=Wt(u.bottom,l.bottom),l.left=qe(u.left,l.left),l},ln(e,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Un(e){var t=e.reference,r=e.element,n=e.placement,s=n?ke(n):null,i=n?it(n):null,o=t.x+t.width/2-r.width/2,a=t.y+t.height/2-r.height/2,l;switch(s){case le:l={x:o,y:t.y-r.height};break;case pe:l={x:o,y:t.y+t.height};break;case ve:l={x:t.x+t.width,y:a};break;case ce:l={x:t.x-r.width,y:a};break;default:l={x:t.x,y:t.y}}var f=s?yr(s):null;if(f!=null){var u=f==="y"?"height":"width";switch(i){case rt:l[f]=l[f]-(t[u]/2-r[u]/2);break;case bt:l[f]=l[f]+(t[u]/2-r[u]/2);break}}return l}function yt(e,t){t===void 0&&(t={});var r=t,n=r.placement,s=n===void 0?e.placement:n,i=r.strategy,o=i===void 0?e.strategy:i,a=r.boundary,l=a===void 0?vi:a,f=r.rootBoundary,u=f===void 0?Rn:f,d=r.elementContext,m=d===void 0?ft:d,g=r.altBoundary,C=g===void 0?!1:g,y=r.padding,b=y===void 0?0:y,M=Hn(typeof b!="number"?b:Wn(b,Ct)),j=m===ft?gi:ft,D=e.rects.popper,O=e.elements[C?j:m],F=Xi(Xe(O)?O:O.contextElement||Pe(e.elements.popper),l,u,o),A=st(e.elements.reference),k=Un({reference:A,element:D,placement:s}),I=cr(Object.assign({},D,k)),B=m===ft?I:A,$={top:F.top-B.top+M.top,bottom:B.bottom-F.bottom+M.bottom,left:F.left-B.left+M.left,right:B.right-F.right+M.right},R=e.modifiersData.offset;if(m===ft&&R){var V=R[s];Object.keys($).forEach(function(P){var J=[ve,pe].indexOf(P)>=0?1:-1,Y=[le,pe].indexOf(P)>=0?"y":"x";$[P]+=V[Y]*J})}return $}function Yi(e,t){t===void 0&&(t={});var r=t,n=r.placement,s=r.boundary,i=r.rootBoundary,o=r.padding,a=r.flipVariations,l=r.allowedAutoPlacements,f=l===void 0?Pn:l,u=it(n),d=u?a?nn:nn.filter(function(C){return it(C)===u}):Ct,m=d.filter(function(C){return f.indexOf(C)>=0});m.length===0&&(m=d);var g=m.reduce(function(C,y){return C[y]=yt(e,{placement:y,boundary:s,rootBoundary:i,padding:o})[ke(y)],C},{});return Object.keys(g).sort(function(C,y){return g[C]-g[y]})}function Ki(e){if(ke(e)===gr)return[];var t=Pt(e);return[an(e),t,an(t)]}function Qi(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var s=r.mainAxis,i=s===void 0?!0:s,o=r.altAxis,a=o===void 0?!0:o,l=r.fallbackPlacements,f=r.padding,u=r.boundary,d=r.rootBoundary,m=r.altBoundary,g=r.flipVariations,C=g===void 0?!0:g,y=r.allowedAutoPlacements,b=t.options.placement,M=ke(b),j=M===b,D=l||(j||!C?[Pt(b)]:Ki(b)),O=[b].concat(D).reduce(function(Ve,xe){return Ve.concat(ke(xe)===gr?Yi(t,{placement:xe,boundary:u,rootBoundary:d,padding:f,flipVariations:C,allowedAutoPlacements:y}):xe)},[]),F=t.rects.reference,A=t.rects.popper,k=new Map,I=!0,B=O[0],$=0;$<O.length;$++){var R=O[$],V=ke(R),P=it(R)===rt,J=[le,pe].indexOf(V)>=0,Y=J?"width":"height",z=yt(t,{placement:R,boundary:u,rootBoundary:d,altBoundary:m,padding:f}),K=J?P?ve:ce:P?pe:le;F[Y]>A[Y]&&(K=Pt(K));var we=Pt(K),oe=[];if(i&&oe.push(z[V]<=0),a&&oe.push(z[K]<=0,z[we]<=0),oe.every(function(Ve){return Ve})){B=R,I=!1;break}k.set(R,oe)}if(I)for(var Ee=C?3:1,et=function(xe){var He=O.find(function(_e){var je=k.get(_e);if(je)return je.slice(0,xe).every(function(We){return We})});if(He)return B=He,"break"},Ie=Ee;Ie>0;Ie--){var $e=et(Ie);if($e==="break")break}t.placement!==B&&(t.modifiersData[n]._skip=!0,t.placement=B,t.reset=!0)}}const eo={name:"flip",enabled:!0,phase:"main",fn:Qi,requiresIfExists:["offset"],data:{_skip:!1}};function cn(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function un(e){return[le,ve,pe,ce].some(function(t){return e[t]>=0})}function to(e){var t=e.state,r=e.name,n=t.rects.reference,s=t.rects.popper,i=t.modifiersData.preventOverflow,o=yt(t,{elementContext:"reference"}),a=yt(t,{altBoundary:!0}),l=cn(o,n),f=cn(a,s,i),u=un(l),d=un(f);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const ro={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:to};function no(e,t,r){var n=ke(e),s=[ce,le].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,o=i[0],a=i[1];return o=o||0,a=(a||0)*s,[ce,ve].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}function so(e){var t=e.state,r=e.options,n=e.name,s=r.offset,i=s===void 0?[0,0]:s,o=Pn.reduce(function(u,d){return u[d]=no(d,t.rects,i),u},{}),a=o[t.placement],l=a.x,f=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=f),t.modifiersData[n]=o}const io={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:so};function oo(e){var t=e.state,r=e.name;t.modifiersData[r]=Un({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const ao={name:"popperOffsets",enabled:!0,phase:"read",fn:oo,data:{}};function lo(e){return e==="x"?"y":"x"}function co(e){var t=e.state,r=e.options,n=e.name,s=r.mainAxis,i=s===void 0?!0:s,o=r.altAxis,a=o===void 0?!1:o,l=r.boundary,f=r.rootBoundary,u=r.altBoundary,d=r.padding,m=r.tether,g=m===void 0?!0:m,C=r.tetherOffset,y=C===void 0?0:C,b=yt(t,{boundary:l,rootBoundary:f,padding:d,altBoundary:u}),M=ke(t.placement),j=it(t.placement),D=!j,O=yr(M),F=lo(O),A=t.modifiersData.popperOffsets,k=t.rects.reference,I=t.rects.popper,B=typeof y=="function"?y(Object.assign({},t.rects,{placement:t.placement})):y,$=typeof B=="number"?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(A){if(i){var P,J=O==="y"?le:ce,Y=O==="y"?pe:ve,z=O==="y"?"height":"width",K=A[O],we=K+b[J],oe=K-b[Y],Ee=g?-I[z]/2:0,et=j===rt?k[z]:I[z],Ie=j===rt?-I[z]:-k[z],$e=t.elements.arrow,Ve=g&&$e?br($e):{width:0,height:0},xe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:$n(),He=xe[J],_e=xe[Y],je=mt(0,k[z],Ve[z]),We=D?k[z]/2-Ee-je-He-$.mainAxis:et-je-He-$.mainAxis,ct=D?-k[z]/2+Ee+je+_e+$.mainAxis:Ie+je+_e+$.mainAxis,ut=t.elements.arrow&&Nt(t.elements.arrow),Et=ut?O==="y"?ut.clientTop||0:ut.clientLeft||0:0,Ft=(P=R==null?void 0:R[O])!=null?P:0,At=K+We-Ft-Et,Lt=K+ct-Ft,Mt=mt(g?Wt(we,At):we,K,g?qe(oe,Lt):oe);A[O]=Mt,V[O]=Mt-K}if(a){var Vt,Xr=O==="x"?le:ce,_t=O==="x"?pe:ve,h=A[F],p=F==="y"?"height":"width",x=h+b[Xr],L=h-b[_t],S=[le,ce].indexOf(M)!==-1,N=(Vt=R==null?void 0:R[F])!=null?Vt:0,T=S?x:h-k[p]-I[p]-N+$.altAxis,W=S?h+k[p]+I[p]-N-$.altAxis:L,U=g&&S?Vi(T,h,W):mt(g?T:x,h,g?W:L);A[F]=U,V[F]=U-h}t.modifiersData[n]=V}}const uo={name:"preventOverflow",enabled:!0,phase:"main",fn:co,requiresIfExists:["offset"]};function fo(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function ho(e){return e===de(e)||!me(e)?wr(e):fo(e)}function mo(e){var t=e.getBoundingClientRect(),r=nt(t.width)/e.offsetWidth||1,n=nt(t.height)/e.offsetHeight||1;return r!==1||n!==1}function po(e,t,r){r===void 0&&(r=!1);var n=me(t),s=me(t)&&mo(t),i=Pe(t),o=st(e,s,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((Se(t)!=="body"||Cr(i))&&(a=ho(t)),me(t)?(l=st(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=jr(i))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function vo(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function s(i){r.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(a){if(!r.has(a)){var l=t.get(a);l&&s(l)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||s(i)}),n}function go(e){var t=vo(e);return Oi.reduce(function(r,n){return r.concat(t.filter(function(s){return s.phase===n}))},[])}function xo(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function bo(e){var t=e.reduce(function(r,n){var s=r[n.name];return r[n.name]=s?Object.assign({},s,n,{options:Object.assign({},s.options,n.options),data:Object.assign({},s.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var fn={placement:"bottom",modifiers:[],strategy:"absolute"};function dn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function yo(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,s=t.defaultOptions,i=s===void 0?fn:s;return function(a,l,f){f===void 0&&(f=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},fn,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],m=!1,g={state:u,setOptions:function(M){var j=typeof M=="function"?M(u.options):M;y(),u.options=Object.assign({},i,u.options,j),u.scrollParents={reference:Xe(a)?pt(a):a.contextElement?pt(a.contextElement):[],popper:pt(l)};var D=go(bo([].concat(n,u.options.modifiers)));return u.orderedModifiers=D.filter(function(O){return O.enabled}),C(),g.update()},forceUpdate:function(){if(!m){var M=u.elements,j=M.reference,D=M.popper;if(dn(j,D)){u.rects={reference:po(j,Nt(D),u.options.strategy==="fixed"),popper:br(D)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function($){return u.modifiersData[$.name]=Object.assign({},$.data)});for(var O=0;O<u.orderedModifiers.length;O++){if(u.reset===!0){u.reset=!1,O=-1;continue}var F=u.orderedModifiers[O],A=F.fn,k=F.options,I=k===void 0?{}:k,B=F.name;typeof A=="function"&&(u=A({state:u,options:I,name:B,instance:g})||u)}}}},update:xo(function(){return new Promise(function(b){g.forceUpdate(),b(u)})}),destroy:function(){y(),m=!0}};if(!dn(a,l))return g;g.setOptions(f).then(function(b){!m&&f.onFirstUpdate&&f.onFirstUpdate(b)});function C(){u.orderedModifiers.forEach(function(b){var M=b.name,j=b.options,D=j===void 0?{}:j,O=b.effect;if(typeof O=="function"){var F=O({state:u,name:M,instance:g,options:D}),A=function(){};d.push(F||A)}})}function y(){d.forEach(function(b){return b()}),d=[]}return g}}var wo=[Wi,ao,$i,Ai,io,eo,uo,Ri,ro],jo=yo({defaultModifiers:wo}),Rt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Co=typeof Element<"u",No=typeof Map=="function",ko=typeof Set=="function",So=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Bt(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Bt(e[n],t[n]))return!1;return!0}var i;if(No&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;for(i=e.entries();!(n=i.next()).done;)if(!Bt(n.value[1],t.get(n.value[0])))return!1;return!0}if(ko&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(So&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(Co&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!Bt(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var Oo=function(t,r){try{return Bt(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const Eo=qn(Oo);var Fo=[],Ao=function(t,r,n){n===void 0&&(n={});var s=Ae.useRef(null),i={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||Fo},o=Ae.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=o[0],l=o[1],f=Ae.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(g){var C=g.state,y=Object.keys(C.elements);Ks.flushSync(function(){l({styles:tn(y.map(function(b){return[b,C.styles[b]||{}]})),attributes:tn(y.map(function(b){return[b,C.attributes[b]]}))})})},requires:["computeStyles"]}},[]),u=Ae.useMemo(function(){var m={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[f,{name:"applyStyles",enabled:!1}])};return Eo(s.current,m)?s.current||m:(s.current=m,m)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,f]),d=Ae.useRef();return rn(function(){d.current&&d.current.setOptions(u)},[u]),rn(function(){if(!(t==null||r==null)){var m=n.createPopper||jo,g=m(t,r,u);return d.current=g,function(){g.destroy(),d.current=null}}},[t,r,n.createPopper]),{state:d.current?d.current.state:null,styles:a.styles,attributes:a.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};function kt({children:e,mounted:t=!1,rootClassName:r="portal-root"}){const[n,s]=v.useState(null);return v.useEffect(()=>{if(!t){s(null);return}const i=document.createElement("div");i.className=r,s(i),document.body.appendChild(i);const o=()=>{document.documentElement.classList.contains("dark")||document.body.classList.contains("dark")||document.documentElement.getAttribute("data-mode")==="dark"||document.body.getAttribute("data-mode")==="dark"?(i.classList.add("dark"),i.setAttribute("data-mode","dark")):(i.classList.remove("dark"),i.setAttribute("data-mode","light"))};o();const a=new MutationObserver(o);return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-mode"]}),a.observe(document.body,{attributes:!0,attributeFilter:["class","data-mode"]}),()=>{a.disconnect(),document.body.removeChild(i)}},[t]),n?An.createPortal(e,n):null}function Lo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function zn(e){const t=v.useRef(e);return Lo(t.current,e)||(t.current=e),t.current}function Zn(e,t=()=>null,{enabled:r=!0}={}){const n=Array.isArray(e)?e:[e],s=zn(n);v.useEffect(()=>{function i(o){r&&s.every(a=>!(a!=null&&a.contains(o.target)))&&t()}return document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[s,r,t])}function Nr({open:e=!1,className:t,anchorEl:r,placement:n="bottom-start",offset:s=[0,0],children:i,style:o,onClickOutside:a}){const[l,f]=v.useState(null),{styles:u}=Ao(r,l,{placement:n,modifiers:[{name:"offset",options:{offset:s}}]});return Zn([l,r],a,{enabled:e}),c.jsx(kt,{mounted:e,children:c.jsx("div",{ref:f,style:{...u.popper,...o},className:w.twJoin("bbn-popover",t),children:i})})}function Gn(e){const[t,r]=v.useState({width:0,height:0});return v.useEffect(()=>{if(!e){r({width:0,height:0});return}const n=new ResizeObserver(([s])=>{r({width:s.target.clientWidth,height:s.target.clientHeight})});return n.observe(e),()=>{n.unobserve(e)}},[e]),t}const Mo=e=>e.label,kr=v.forwardRef(({disabled:e,className:t,value:r,defaultValue:n,placeholder:s="Select option",open:i,defaultOpen:o,options:a=[],optionClassName:l,popoverClassName:f,state:u="default",onOpen:d,onSelect:m,onClose:g,renderSelectedOption:C=Mo,...y},b)=>{const M=v.useRef(null);v.useImperativeHandle(b,()=>M.current,[]);const{width:j}=Gn(M.current),[D,O]=Ze({value:i,defaultValue:o,onStateChange:R=>void(R?d==null?void 0:d():g==null?void 0:g())}),[F,A]=Ze({value:r,defaultValue:n,onStateChange:m}),k=v.useMemo(()=>a.find(R=>R.value===F),[a,F]),I=v.useCallback(R=>{A(R.value),O(!1)},[A,O]),B=v.useCallback(()=>{O(!1)},[O]),$=v.useCallback(()=>{e||O(!D)},[D,e,O]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{ref:M,className:w.twJoin("bbn-select",e&&"bbn-select-disabled",`bbn-select-${u}`,t),onClick:$,tabIndex:e?-1:0,...y,children:[c.jsx("span",{children:k?C(k):s}),c.jsx(mi,{className:w.twJoin("bbn-select-icon",D&&"bbn-select-icon-open"),size:20})]}),c.jsx(Nr,{anchorEl:M.current,className:w.twJoin("bbn-select-menu custom-scrollbar",f),open:D&&!e,onClickOutside:B,offset:[0,4],placement:"bottom-start",style:{width:j},children:a.map(R=>c.jsx("div",{className:w.twJoin("bbn-select-option",(k==null?void 0:k.value)===R.value&&"bbn-select-option-selected",l),onClick:()=>I(R),children:R.label},R.value))})]})});kr.displayName="Select";const Kt=v.forwardRef(({className:e,prefix:t,suffix:r,disabled:n=!1,state:s="default",...i},o)=>c.jsxs("div",{className:w.twJoin("bbn-input",n&&"bbn-input-disabled",`bbn-input-${s}`),children:[t&&c.jsx("div",{className:"bbn-input-prefix",children:t}),c.jsx("input",{ref:o,className:w.twJoin("bbn-input-field",e),disabled:n,...i}),r&&c.jsx("div",{className:"bbn-input-suffix",children:r})]}));Kt.displayName="Input";function St({children:e,label:t,hint:r,state:n="default",className:s}){return c.jsxs("div",{className:w.twJoin("bbn-form-control",s),children:[t?c.jsxs("label",{className:"bbn-form-control-label",children:[c.jsx("div",{className:"bbn-form-control-title",children:t}),e]}):e,r&&c.jsx("div",{className:w.twJoin("bbn-form-control-hint",`bbn-form-control-hint-${n}`),children:r})]})}const Xn=v.createContext({removeDialog:()=>null,updateDialog:()=>null});function Vo({children:e}){const[t,r]=v.useState({}),n=v.useMemo(()=>Object.values(t).some(a=>a),[t]);v.useEffect(function(){if(n){const l=document.body.offsetWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=document.body.offsetWidth-l>=1?vr(document.body.offsetWidth-l)??"":document.body.style.paddingRight}else document.body.style.overflow="",document.body.style.paddingRight=""},[n]);const s=v.useCallback(a=>{r(l=>Reflect.deleteProperty(l,a)?{...l}:l)},[]),i=v.useCallback((a,l)=>{r(f=>({...f,[a]:l}))},[]),o=v.useMemo(()=>({removeDialog:s,updateDialog:i}),[s,i]);return c.jsx(Xn.Provider,{value:o,children:e})}function Sr({open:e=!1}={}){const t=v.useId(),[r,n]=v.useState(e),{updateDialog:s,removeDialog:i}=v.useContext(Xn),o=e||r;v.useEffect(()=>()=>{i(t)},[t]),v.useEffect(()=>{s(t,o)},[t,o,s]),v.useEffect(()=>{e&&n(!0)},[e]);const a=v.useCallback(()=>{e||n(!1)},[e]);return{mounted:r,unmount:a}}const Yn=({open:e=!1,...t})=>c.jsx("div",{...t,className:w.twJoin("bbn-backdrop",e?"animate-backdrop-in":"animate-backdrop-out",t.className)}),Kn=({children:e,open:t=!1,className:r,onClose:n,hasBackdrop:s=!0,backdropClassName:i,dialogClassName:o,...a})=>{const{mounted:l,unmount:f}=Sr({open:t});return c.jsxs(kt,{mounted:l,children:[c.jsx("div",{...a,className:w.twJoin("bbn-dialog-wrapper",r),children:c.jsx("div",{className:w.twJoin("bbn-dialog",t?"animate-modal-in":"animate-modal-out",o),onAnimationEnd:f,children:e})}),s&&c.jsx(Yn,{className:i,open:t,onClick:n})]})},Qt=({children:e,className:t="",size:r=40,variant:n="default",background:s=!1,rounded:i=!1})=>{const o={default:"text-accent-secondary",primary:"text-primary-light",secondary:"text-accent-secondary",error:"text-error-main",success:"text-success-main","accent-primary":"text-accent-primary","accent-secondary":"text-accent-secondary"},a={default:"bg-accent-secondary/10",primary:"bg-primary-light/10 dark:bg-[#47484A]",secondary:"bg-accent-secondary/10",error:"bg-error-main/10",success:"bg-success-main/10","accent-primary":"bg-accent-primary/10","accent-secondary":"bg-accent-secondary/10"};return c.jsx("div",{className:w.twJoin("flex items-center justify-center",s&&a[n],i&&"rounded-full",s?"[&_svg]:w-4 [&_svg]:h-4":"[&_svg]:w-full [&_svg]:h-full","[&_svg_path]:fill-current",s&&"dark:[&_svg_path]:fill-white",o[n],t),style:{width:r,height:r},children:e})},Qn=({className:e="",size:t=24,variant:r="primary"})=>c.jsx(Qt,{variant:r,background:!0,rounded:!0,className:e,children:c.jsx("svg",{style:{width:t,height:t*.545},viewBox:"0 0 22 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M20 4H11.65C10.83 1.67 8.61 0 6 0C2.69 0 0 2.69 0 6C0 9.31 2.69 12 6 12C8.61 12 10.83 10.33 11.65 8H12L14 10L16 8L18 10L22 5.96L20 4ZM6 9C4.35 9 3 7.65 3 6C3 4.35 4.35 3 6 3C7.65 3 9 4.35 9 6C9 7.65 7.65 9 6 9Z"})})}),es=({className:e="",size:t=24,variant:r="primary"})=>c.jsx(Qt,{variant:r,background:!0,rounded:!0,className:e,children:c.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 20 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M15 0H11V2H15C16.65 2 18 3.35 18 5C18 6.65 16.65 8 15 8H11V10H15C17.76 10 20 7.76 20 5C20 2.24 17.76 0 15 0ZM9 8H5C3.35 8 2 6.65 2 5C2 3.35 3.35 2 5 2H9V0H5C2.24 0 0 2.24 0 5C0 7.76 2.24 10 5 10H9V8ZM6 4H14V6H6V4Z"})})}),ts=({className:e="",size:t=24,variant:r="primary"})=>c.jsx(Qt,{variant:r,background:!0,rounded:!0,className:e,children:c.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 18C5.58 18 2 14.42 2 10C2 5.58 5.58 2 10 2C14.42 2 18 5.58 18 10C18 14.42 14.42 18 10 18Z"}),c.jsx("path",{d:"M10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5C7.23858 5 5 7.23858 5 10C5 12.7614 7.23858 15 10 15Z"})]})}),Or=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||Er[r];return c.jsx("svg",{style:{width:t,height:t*1.143},viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:w.twJoin("transition-opacity duration-200",s,e),children:c.jsx("path",{d:"M9.99984 0.666626H1.99984C1.2665 0.666626 0.666504 1.26663 0.666504 1.99996V11.3333H1.99984V1.99996H9.99984V0.666626ZM11.9998 3.33329H4.6665C3.93317 3.33329 3.33317 3.93329 3.33317 4.66663V14C3.33317 14.7333 3.93317 15.3333 4.6665 15.3333H11.9998C12.7332 15.3333 13.3332 14.7333 13.3332 14V4.66663C13.3332 3.93329 12.7332 3.33329 11.9998 3.33329ZM11.9998 14H4.6665V4.66663H11.9998V14Z",fill:"currentColor"})})},rs=({className:e="",size:t=14,variant:r="default",color:n})=>{const s=n||Er[r];return c.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:w.twJoin("transition-opacity duration-200",s,e),children:c.jsx("path",{d:"M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z",fill:"currentColor"})})},Er={default:"text-accent-primary",primary:"text-primary-light",secondary:"text-accent-secondary",error:"text-error-main",success:"text-success-main","accent-primary":"text-accent-primary","accent-secondary":"text-accent-secondary"},Fr=({children:e,open:t=!1,className:r,onClose:n,...s})=>{const{mounted:i,unmount:o}=Sr({open:t});return c.jsxs(kt,{mounted:i,children:[c.jsxs("div",{...s,className:w.twJoin("bbn-dialog-mobile",t?"animate-mobile-modal-in":"animate-mobile-modal-out",r),onAnimationEnd:o,children:[n&&c.jsx("button",{onClick:n,className:"absolute top-4 left-4 z-10 p-1.5 rounded-full bg-surface-tertiary hover:bg-surface-quaternary transition-colors","aria-label":"Close",children:c.jsx(rs,{size:14,variant:"accent-primary"})}),e]}),c.jsx(Yn,{open:t,onClick:n})]})},ns=({className:e,children:t,title:r,onClose:n})=>c.jsxs("div",{className:w.twJoin("bbn-dialog-header",e),children:[c.jsxs("div",{className:"bbn-dialog-title",children:[c.jsx(Xt,{variant:"h5",children:r}),!!n&&c.jsx(mr,{className:"shrink-0",onClick:n,children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:c.jsx("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",fill:"currentColor"})})})]}),t]}),ss=e=>c.jsx("div",{...e,className:w.twJoin("bbn-dialog-body",e.className)}),is=e=>c.jsx("div",{...e,className:w.twJoin("bbn-dialog-footer",e.className)});function _o({className:e,...t}){return c.jsx("span",{...t,className:w.twJoin("bbn-chip",e)})}function Do({size:e=40,className:t}){return c.jsx("span",{className:w.twMerge("bbn-loader text-current",t),style:{width:e,height:e},children:c.jsx("svg",{viewBox:"22 22 44 44",children:c.jsx("circle",{cx:"44",cy:"44",r:"20.2",fill:"none",stroke:"currentColor",strokeWidth:"3.6"})})})}var os="Expected a function",hn=NaN,To="[object Symbol]",Ro=/^\s+|\s+$/g,Po=/^[-+]0x[0-9a-f]+$/i,Bo=/^0b[01]+$/i,Io=/^0o[0-7]+$/i,$o=parseInt,Ho=typeof Rt=="object"&&Rt&&Rt.Object===Object&&Rt,Wo=typeof self=="object"&&self&&self.Object===Object&&self,Jo=Ho||Wo||Function("return this")(),Uo=Object.prototype,qo=Uo.toString,zo=Math.max,Zo=Math.min,ir=function(){return Jo.Date.now()};function Go(e,t,r){var n,s,i,o,a,l,f=0,u=!1,d=!1,m=!0;if(typeof e!="function")throw new TypeError(os);t=mn(t)||0,Jt(r)&&(u=!!r.leading,d="maxWait"in r,i=d?zo(mn(r.maxWait)||0,t):i,m="trailing"in r?!!r.trailing:m);function g(A){var k=n,I=s;return n=s=void 0,f=A,o=e.apply(I,k),o}function C(A){return f=A,a=setTimeout(M,t),u?g(A):o}function y(A){var k=A-l,I=A-f,B=t-k;return d?Zo(B,i-I):B}function b(A){var k=A-l,I=A-f;return l===void 0||k>=t||k<0||d&&I>=i}function M(){var A=ir();if(b(A))return j(A);a=setTimeout(M,y(A))}function j(A){return a=void 0,m&&n?g(A):(n=s=void 0,o)}function D(){a!==void 0&&clearTimeout(a),f=0,n=l=s=a=void 0}function O(){return a===void 0?o:j(ir())}function F(){var A=ir(),k=b(A);if(n=arguments,s=this,l=A,k){if(a===void 0)return C(l);if(d)return a=setTimeout(M,t),g(l)}return a===void 0&&(a=setTimeout(M,t)),o}return F.cancel=D,F.flush=O,F}function Xo(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(os);return Jt(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),Go(e,t,{leading:n,maxWait:t,trailing:s})}function Jt(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Yo(e){return!!e&&typeof e=="object"}function Ko(e){return typeof e=="symbol"||Yo(e)&&qo.call(e)==To}function mn(e){if(typeof e=="number")return e;if(Ko(e))return hn;if(Jt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Jt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Ro,"");var r=Bo.test(e);return r||Io.test(e)?$o(e.slice(2),r?2:8):Po.test(e)?hn:+e}var Qo=Xo;const as=qn(Qo);function ls(e,{onLoadMore:t,hasMore:r=!1,loading:n=!1}={}){const[s,i]=v.useState(!1);return v.useEffect(()=>{const o=as(l=>{const f=l.target;i(f.scrollTop>0),!n&&r&&f.scrollHeight-f.scrollTop<=f.clientHeight+100&&(t==null||t())},100),a=e.current;if(a)return a.addEventListener("scroll",o),()=>a.removeEventListener("scroll",o)},[n,r,t,e]),{isScrolledTop:s}}const cs=v.createContext({data:[],columns:[],sortStates:{},onColumnSort:void 0,onRowSelect:void 0});function us({name:e,className:t,children:r,sorter:n,...s}){const{columns:i,sortStates:o,onColumnSort:a}=v.useContext(cs),l=o[e??""],f=l==null?void 0:l.direction;return c.jsx(H,{variant:"caption",as:"th",className:w.twJoin("bbn-cell-left",n&&"bbn-table-sortable",t),onClick:()=>{if(n&&e){const u=i.find(d=>d.key===e);a==null||a(e,u==null?void 0:u.sorter)}},"data-column":e,...s,children:c.jsxs("div",{className:"flex items-center justify-between gap-1",children:[c.jsx("span",{children:r}),n&&c.jsxs("span",{className:"bbn-table-sort-icons",children:[c.jsx(pi,{className:w.twJoin("bbn-sort-icon bbn-sort-icon-up",f==="asc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")}),c.jsx(hi,{className:w.twJoin("bbn-sort-icon bbn-sort-icon-down",f==="desc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")})]})]})})}function fs(e,t){const[r,n]=v.useState({}),s=v.useCallback((o,a)=>{a&&n(l=>{var m;const f=((m=l[o])==null?void 0:m.direction)??null,u=f===null?"asc":f==="asc"?"desc":null;if(u===null)return Object.fromEntries(Object.entries(l).filter(([g])=>g!==o).map(([g,C])=>[g,{...C,priority:C.priority>l[o].priority?C.priority-1:C.priority}]));const d=Math.max(0,...Object.values(l).map(g=>g.priority));return{...l,[o]:{direction:u,priority:d+1}}})},[]),i=v.useMemo(()=>{const o=Object.entries(r).filter(([,a])=>a.direction!==null).toSorted((a,l)=>l[1].priority-a[1].priority).map(([a,l])=>({column:t.find(f=>f.key===a),direction:l.direction})).filter(({column:a})=>a==null?void 0:a.sorter);return o.length===0?e:e.toSorted((a,l)=>{for(const{column:f,direction:u}of o){const d=f.sorter(a,l);if(d!==0)return u==="asc"?d:-d}return 0})},[e,t,r]);return{sortStates:r,handleColumnSort:s,sortedData:i}}function ds({className:e,render:t,value:r,columnName:n,...s}){return c.jsx(H,{variant:"body2",as:"td",className:w.twJoin("bbn-cell-left",e),"data-column":n,...s,children:t?t(r):r})}function ea({row:e,columns:t,isSelected:r,isSelectable:n,onSelect:s}){return c.jsx("tr",{className:w.twJoin(r&&"selected",!!s&&n&&"cursor-pointer",!n&&"opacity-50"),onClick:()=>s(e),children:t.map(i=>c.jsx(ds,{value:e[i.key],columnName:i.key,className:i.cellClassName,render:i.render?o=>i.render(o,e):void 0},i.key))})}function ta({data:e,columns:t,className:r,wrapperClassName:n,hasMore:s=!1,loading:i=!1,onLoadMore:o,onRowSelect:a,isRowSelectable:l,selectedRow:f,defaultSelectedRow:u,onSelectedRowChange:d,...m},g){const C=v.useRef(null);v.useImperativeHandle(g,()=>C.current,[]);const{sortStates:y,handleColumnSort:b,sortedData:M}=fs(e,t),{isScrolledTop:j}=ls(C,{onLoadMore:o,hasMore:s,loading:i}),[D,O]=Ze({value:f,defaultValue:u??null,onStateChange:d}),F=v.useCallback(k=>{if(!a||l&&!l(k))return;const I=D===k.id?null:k.id;O(I),a(I===null?null:k)},[a,l,D,O]),A=v.useMemo(()=>({data:M,columns:t,sortStates:y,onColumnSort:b,onRowSelect:F}),[M,t,y,b,F]);return c.jsx(cs.Provider,{value:A,children:c.jsx("div",{ref:C,className:w.twJoin("bbn-table-wrapper",n),children:c.jsxs("table",{className:w.twJoin("bbn-table",r),...m,children:[c.jsx("thead",{className:w.twJoin("bbn-table-header",j&&"scrolled-top"),children:c.jsx("tr",{children:t.map(k=>c.jsx(us,{className:k.headerClassName,name:k.key,sorter:k.sorter,children:k.header},k.key))})}),c.jsx("tbody",{className:"bbn-table-body",children:M.map(k=>c.jsx(ea,{row:k,columns:t,isSelected:D===k.id,isSelectable:l?l(k):!0,onSelect:F},k.id))})]})})})}const ra=v.forwardRef(ta);function hs({as:e="div",className:t,children:r}){return v.createElement(e,{className:w.twJoin("bbn-card",t)},r)}function na(e){const[t=!1,r]=Ze({value:e.value,defaultValue:e.defaultValue,onStateChange:e.onChange});return c.jsxs("div",{className:"bbn-toggle",onClick:()=>void r(!t),children:[c.jsx("span",{className:"bbn-toggle-bg",children:e.activeIcon}),c.jsx("span",{className:w.twJoin("bbn-toggle-control",t&&"bbn-toggle-control-active")}),c.jsx("span",{className:"bbn-toggle-bg",children:e.inactiveIcon})]})}const sa={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function ia({className:e,orientation:t="vertical",children:r}){return c.jsx("div",{className:w.twMerge("bbn-list",`bbn-list-${t}`,e),children:v.Children.map(r,n=>v.isValidElement(n)?v.cloneElement(n,{orientation:sa[t]}):n)})}function oa({className:e,orientation:t="horizontal",title:r,value:n,suffix:s}){return c.jsxs("div",{className:w.twJoin("bbn-list-item",`bbn-list-item-${t}`,e),children:[c.jsx(H,{as:"div",className:w.twJoin("bbn-list-title",`bbn-list-title-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),c.jsxs(H,{as:"div",className:w.twJoin("bbn-list-value",`bbn-list-value-${t}`),variant:"body1",children:[n,s]})]})}function aa({children:e,count:t=0,max:r=99,position:n="bottom-right",color:s="error",className:i,badgeClassName:o,contentClassName:a}){const l=typeof t=="number"?t>0:t!=null,f=typeof t=="number"&&t>r?`${r}+`:t,u=`bbn-badge-${n}`,d=`bbn-badge-${s}`;return c.jsxs("div",{className:w.twJoin("bbn-badge",i),children:[e,l&&c.jsx("span",{className:w.twJoin("bbn-badge-indicator",u,d,o),children:c.jsx("span",{className:w.twJoin("bbn-badge-content",a),children:f})})]})}const er=({children:e,style:t,className:r})=>c.jsx("div",{className:w.twJoin("flex rounded bg-secondary-highlight p-4 text-accent-primary",r),style:t,children:e});function la(e){return jt({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z"},child:[]},{tag:"path",attr:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z"},child:[]}]})(e)}function ms({counter:e,max:t,onAdd:r,alwaysShowCounter:n=!1}){const s=e<t,i=0<e||n&&e===0;return c.jsxs("div",{className:w.twJoin("bg-primary-highlight flex overflow-hidden rounded-md border border-accent-primary w-fit",s&&"cursor-pointer",!i&&!s&&"hidden",!i&&"w-10"),onClick:s?r:void 0,children:[s&&c.jsx("div",{className:"flex h-10 w-10 items-center justify-center",children:c.jsx(la,{size:20})}),i&&c.jsxs("div",{className:w.twJoin("flex h-10 items-center px-2 text-sm sm:px-4 sm:text-base",s&&"border-l border-accent-primary"),children:[e,"/",t]})]})}const ps=v.createContext(void 0),Ar=()=>v.useContext(ps),ca=({children:e,value:t})=>c.jsx(ps.Provider,{value:t,children:e}),Lr=({isOpen:e,onClose:t,title:r,children:n,className:s="",titleAlign:i="left",backIcon:o,fullHeight:a=!1,fullWidth:l=!1,showBackButton:f=!0,showDivider:u=!0,onBackdropClick:d})=>{const m={left:"text-left",center:"text-center",right:"text-right"},g=()=>f||r?c.jsxs("div",{className:w.twJoin("flex items-center p-4",u&&"border-b border-[#38708533] dark:border-[#404040]"),children:[f&&c.jsx("button",{onClick:t,className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded transition-colors hover:bg-accent-secondary/10","aria-label":"Go back",children:o||c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-accent-primary",children:c.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),r&&c.jsx("h3",{className:w.twJoin("flex-1 text-sm font-medium text-accent-primary",f?"ml-3":"",m[i]),children:r})]}):null,C=()=>c.jsxs(c.Fragment,{children:[g(),c.jsx("div",{className:"flex-1 overflow-y-auto",children:n})]});return a?c.jsxs(kt,{mounted:!0,rootClassName:"menu-drawer-portal",children:[d&&c.jsx("div",{className:w.twJoin("fixed inset-0 z-40 bg-black/50 transition-opacity duration-300",e?"opacity-100":"pointer-events-none opacity-0"),onClick:d}),c.jsx("div",{className:w.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]","fixed inset-y-0 right-0 z-50",l?"w-full":"w-full max-w-sm",e?"translate-x-0":"translate-x-full",s),children:C()})]}):c.jsx("div",{className:w.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]","absolute inset-0 rounded-lg",e?"translate-x-0":"translate-x-full",s),children:C()})};function Mr(e=768,t=100){const[r,n]=v.useState(()=>typeof window<"u"?window.innerWidth<e:!1),s=v.useRef(),i=v.useCallback(()=>{n(window.innerWidth<e)},[e]);return v.useEffect(()=>(s.current=as(i,t),i(),window.addEventListener("resize",s.current),()=>{s.current&&(window.removeEventListener("resize",s.current),s.current.cancel())}),[i,t]),r}const Vr=({children:e,trigger:t,open:r,onOpenChange:n,placement:s="bottom-end",offset:i=[0,8],className:o,mobileMode:a="dialog"})=>{const[l,f]=v.useState(!1),u=v.useRef(null),d=Mr(),m=r!==void 0?r:l,g=M=>{r===void 0&&f(M),n==null||n(M)},C=()=>g(!1),y=c.jsx("div",{className:"relative w-full overflow-hidden",children:e}),b=t||c.jsx("button",{className:"rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-800",onClick:()=>g(!m),children:"Menu"});return c.jsxs(ca,{value:{isOpen:m,setIsOpen:g,onClose:C,isMobile:d},children:[c.jsx("div",{ref:u,className:"inline-block",children:v.isValidElement(b)&&v.cloneElement(b,{onClick:()=>g(!m),"aria-haspopup":"true","aria-expanded":m})}),d?a==="dialog"?c.jsx(Fr,{open:m,onClose:C,className:w.twJoin("relative bg-[#FFFFFF] dark:bg-[#252525] text-primary-main",o),children:y}):c.jsx(Lr,{isOpen:m,onClose:C,onBackdropClick:C,fullHeight:!0,fullWidth:!0,showBackButton:!0,showDivider:!1,children:y}):c.jsx(Nr,{anchorEl:u.current,open:m,offset:i,placement:s,onClickOutside:C,className:w.twJoin("rounded-lg border border-[#38708533] bg-[#FFFFFF] shadow-lg dark:border-[#404040] dark:bg-[#252525]","min-w-[294px]",o),children:y})]})},vs=({icon:e,name:t,description:r,onClick:n,disabled:s=!1,className:i,children:o,suffix:a,selected:l=!1,role:f="menuitem"})=>{const u=Ar(),d=()=>{s||!n||(n(),u&&!a&&u.onClose())};return o?c.jsx("button",{onClick:d,disabled:s,className:w.twJoin("w-full text-left",s&&"cursor-not-allowed opacity-50",i),children:o}):c.jsxs("button",{onClick:d,disabled:s,className:w.twJoin("flex w-full items-center justify-between p-6","transition-colors hover:bg-accent-secondary/5","text-left","focus:outline-none",l&&"bg-accent-secondary/10",s&&"cursor-not-allowed opacity-50",i),role:f,"aria-selected":l,tabIndex:s?-1:0,children:[c.jsxs("div",{className:"flex items-center gap-3",children:[e&&c.jsx("div",{className:"flex-shrink-0",children:e}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("div",{className:"text-sm font-medium text-accent-primary",children:t}),r&&c.jsx("div",{className:"text-xs text-accent-secondary",children:r})]})]}),a]})},gs=({children:e,name:t,description:r,icon:n,backIcon:s,suffix:i,className:o,contentClassName:a,titleAlign:l="left"})=>{const[f,u]=v.useState(!1),d=Ar(),m=c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-accent-primary",children:c.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),g=c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-accent-primary",children:c.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return c.jsxs(c.Fragment,{children:[c.jsxs("button",{onClick:()=>u(!0),className:w.twJoin("flex w-full items-center justify-between p-6","transition-colors hover:bg-accent-secondary/5","text-left focus:outline-none",o),role:"menuitem",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[n&&c.jsx("div",{className:"flex-shrink-0",children:n}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-sm font-medium text-accent-primary",children:t}),r&&c.jsx("span",{className:"mt-0.5 text-xs text-accent-secondary",children:r})]})]}),i||g]}),c.jsx(Lr,{isOpen:f,onClose:()=>u(!1),title:t||"",titleAlign:l,backIcon:s||m,fullHeight:d==null?void 0:d.isMobile,fullWidth:d==null?void 0:d.isMobile,onBackdropClick:d!=null&&d.isMobile?void 0:()=>u(!1),className:w.twJoin(d!=null&&d.isMobile?"z-60":"z-50",a),children:e})]})},ua=({label:e,description:t,onClick:r,selected:n=!1,className:s,suffix:i,disabled:o=!1})=>{const a=c.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M16.6667 5L7.5 14.1667L3.33333 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return c.jsxs("button",{role:"menuitem",onClick:r,disabled:o,className:w.twJoin("flex w-full items-center justify-between p-4","transition-colors hover:bg-accent-secondary/5","text-left focus:outline-none",n&&"bg-accent-secondary/10",o&&"cursor-not-allowed opacity-50",s),"aria-selected":n,tabIndex:o?-1:0,children:[c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("span",{className:"font-medium text-accent-primary",children:e}),t&&c.jsx("span",{className:"text-sm text-accent-secondary",children:t})]}),n&&(i||a)]})};function fa(e,t=8){if(!e||e.length<=t*2)return e;const r=e.slice(0,t),n=e.slice(-t);return`${r}...${n}`}const _r=({value:e,symbols:t=8,size:r="body2",className:n})=>e?c.jsx(H,{variant:r,className:w.twJoin("text-accent-primary",n),children:c.jsx("span",{children:fa(e,t)??e})}):null;function Dr(e={}){const{copiedText:t="Copied ✓",timeout:r=2e3}=e,[n,s]=v.useState({}),[i,o]=v.useState({}),a=v.useCallback((d,m)=>{!d||!m||(navigator.clipboard.writeText(m),s(g=>({...g,[d]:!0})),o(g=>({...g,[d]:t})))},[t]),l=v.useCallback(d=>{d&&(s(m=>({...m,[d]:!1})),o(m=>({...m,[d]:""})))},[]),f=v.useCallback(d=>d&&n[d]||!1,[n]),u=v.useCallback(d=>d&&i[d]||"",[i]);return v.useEffect(()=>{const d={};return Object.entries(n).forEach(([m,g])=>{g&&(d[m]=setTimeout(()=>{l(m)},r))}),()=>{Object.values(d).forEach(m=>clearTimeout(m))}},[n,r,l]),{isCopied:f,copiedText:u,copyToClipboard:a}}const da=({children:e,value:t,className:r,onCopy:n,isCopied:s,copiedText:i,timeout:o=2e3})=>{const a=v.useId(),l={copiedText:i,timeout:o},{isCopied:f,copiedText:u,copyToClipboard:d}=Dr(l),m=s!==void 0,g=m?s:f(a),C=m?i||"Copied ✓":u(a),y=b=>{b.stopPropagation(),m&&n?n(t):d(a,t)};return c.jsx("div",{className:w.twMerge("inline-flex items-center cursor-pointer hover:opacity-100 transition-opacity duration-200",r),onClick:y,children:c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:w.twMerge("transition-opacity duration-300 ease-in-out",g&&"opacity-0"),children:e}),g&&c.jsx("div",{className:w.twMerge("absolute inset-0 flex items-center transition-opacity duration-300 ease-in-out text-green-600","opacity-100"),children:C})]})})};var Ot=e=>e.type==="checkbox",Ue=e=>e instanceof Date,ie=e=>e==null;const xs=e=>typeof e=="object";var ee=e=>!ie(e)&&!Array.isArray(e)&&xs(e)&&!Ue(e),bs=e=>ee(e)&&e.target?Ot(e.target)?e.target.checked:e.target.value:e,ha=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,ys=(e,t)=>e.has(ha(t)),ma=e=>{const t=e.constructor&&e.constructor.prototype;return ee(t)&&t.hasOwnProperty("isPrototypeOf")},Tr=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ne(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Tr&&(e instanceof Blob||n))&&(r||ee(e)))if(t=r?[]:{},!r&&!ma(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=ne(e[s]));else return e;return t}var tr=e=>/^\w*$/.test(e),Q=e=>e===void 0,Rr=e=>Array.isArray(e)?e.filter(Boolean):[],Pr=e=>Rr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),E=(e,t,r)=>{if(!t||!ee(e))return r;const n=(tr(t)?[t]:Pr(t)).reduce((s,i)=>ie(s)?s:s[i],e);return Q(n)||n===e?Q(e[t])?r:e[t]:n},ue=e=>typeof e=="boolean",q=(e,t,r)=>{let n=-1;const s=tr(t)?[t]:Pr(t),i=s.length,o=i-1;for(;++n<i;){const a=s[n];let l=r;if(n!==o){const f=e[a];l=ee(f)||Array.isArray(f)?f:isNaN(+s[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=l,e=e[a]}};const Ut={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},be={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Fe={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Br=v.createContext(null);Br.displayName="HookFormContext";const Ke=()=>v.useContext(Br),pa=e=>{const{children:t,...r}=e;return v.createElement(Br.Provider,{value:r},t)};var ws=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const o=i;return t._proxyFormState[o]!==be.all&&(t._proxyFormState[o]=!n||be.all),r&&(r[o]=!0),e[o]}});return s};const Ir=typeof window<"u"?Ae.useLayoutEffect:Ae.useEffect;function $r(e){const t=Ke(),{control:r=t.control,disabled:n,name:s,exact:i}=e||{},[o,a]=v.useState(r._formState),l=v.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Ir(()=>r._subscribe({name:s,formState:l.current,exact:i,callback:f=>{!n&&a({...r._formState,...f})}}),[s,n,i]),v.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),v.useMemo(()=>ws(o,r,l.current,!1),[o,r])}var Ce=e=>typeof e=="string",js=(e,t,r,n,s)=>Ce(e)?(n&&t.watch.add(e),E(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),E(r,i))):(n&&(t.watchAll=!0),r);function Hr(e){const t=Ke(),{control:r=t.control,name:n,defaultValue:s,disabled:i,exact:o}=e||{},a=v.useRef(s),[l,f]=v.useState(r._getWatch(n,a.current));return Ir(()=>r._subscribe({name:n,formState:{values:!0},exact:o,callback:u=>!i&&f(js(n,r._names,u.values||r._formValues,!1,a.current))}),[n,r,i,o]),v.useEffect(()=>r._removeUnmounted()),l}function va(e){const t=Ke(),{name:r,disabled:n,control:s=t.control,shouldUnregister:i}=e,o=ys(s._names.array,r),a=Hr({control:s,name:r,defaultValue:E(s._formValues,r,E(s._defaultValues,r,e.defaultValue)),exact:!0}),l=$r({control:s,name:r,exact:!0}),f=v.useRef(e),u=v.useRef(s.register(r,{...e.rules,value:a,...ue(e.disabled)?{disabled:e.disabled}:{}})),d=v.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!E(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!E(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!E(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!E(l.validatingFields,r)},error:{enumerable:!0,get:()=>E(l.errors,r)}}),[l,r]),m=v.useCallback(b=>u.current.onChange({target:{value:bs(b),name:r},type:Ut.CHANGE}),[r]),g=v.useCallback(()=>u.current.onBlur({target:{value:E(s._formValues,r),name:r},type:Ut.BLUR}),[r,s._formValues]),C=v.useCallback(b=>{const M=E(s._fields,r);M&&b&&(M._f.ref={focus:()=>b.focus&&b.focus(),select:()=>b.select&&b.select(),setCustomValidity:j=>b.setCustomValidity(j),reportValidity:()=>b.reportValidity()})},[s._fields,r]),y=v.useMemo(()=>({name:r,value:a,...ue(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:m,onBlur:g,ref:C}),[r,n,l.disabled,m,g,C,a]);return v.useEffect(()=>{const b=s._options.shouldUnregister||i;s.register(r,{...f.current.rules,...ue(f.current.disabled)?{disabled:f.current.disabled}:{}});const M=(j,D)=>{const O=E(s._fields,j);O&&O._f&&(O._f.mount=D)};if(M(r,!0),b){const j=ne(E(s._options.defaultValues,r));q(s._defaultValues,r,j),Q(E(s._formValues,r))&&q(s._formValues,r,j)}return!o&&s.register(r),()=>{(o?b&&!s._state.action:b)?s.unregister(r):M(r,!1)}},[r,s,o,i]),v.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),v.useMemo(()=>({field:y,formState:l,fieldState:d}),[y,l,d])}var Cs=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},vt=e=>Array.isArray(e)?e:[e],pn=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}},ur=e=>ie(e)||!xs(e);function Re(e,t,r=new WeakSet){if(ur(e)||ur(t))return e===t;if(Ue(e)&&Ue(t))return e.getTime()===t.getTime();const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const o=e[i];if(!s.includes(i))return!1;if(i!=="ref"){const a=t[i];if(Ue(o)&&Ue(a)||ee(o)&&ee(a)||Array.isArray(o)&&Array.isArray(a)?!Re(o,a,r):o!==a)return!1}}return!0}var ae=e=>ee(e)&&!Object.keys(e).length,Wr=e=>e.type==="file",ye=e=>typeof e=="function",qt=e=>{if(!Tr)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ns=e=>e.type==="select-multiple",Jr=e=>e.type==="radio",ga=e=>Jr(e)||Ot(e),or=e=>qt(e)&&e.isConnected;function xa(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Q(e)?n++:e[t[n++]];return e}function ba(e){for(const t in e)if(e.hasOwnProperty(t)&&!Q(e[t]))return!1;return!0}function te(e,t){const r=Array.isArray(t)?t:tr(t)?[t]:Pr(t),n=r.length===1?e:xa(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(ee(n)&&ae(n)||Array.isArray(n)&&ba(n))&&te(e,r.slice(0,-1)),e}var ks=e=>{for(const t in e)if(ye(e[t]))return!0;return!1};function zt(e,t={}){const r=Array.isArray(e);if(ee(e)||r)for(const n in e)Array.isArray(e[n])||ee(e[n])&&!ks(e[n])?(t[n]=Array.isArray(e[n])?[]:{},zt(e[n],t[n])):ie(e[n])||(t[n]=!0);return t}function Ss(e,t,r){const n=Array.isArray(e);if(ee(e)||n)for(const s in e)Array.isArray(e[s])||ee(e[s])&&!ks(e[s])?Q(t)||ur(r[s])?r[s]=Array.isArray(e[s])?zt(e[s],[]):{...zt(e[s])}:Ss(e[s],ie(t)?{}:t[s],r[s]):r[s]=!Re(e[s],t[s]);return r}var dt=(e,t)=>Ss(e,t,zt(t));const vn={value:!1,isValid:!1},gn={value:!0,isValid:!0};var Os=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Q(e[0].attributes.value)?Q(e[0].value)||e[0].value===""?gn:{value:e[0].value,isValid:!0}:gn:vn}return vn},Es=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Q(e)?e:t?e===""?NaN:e&&+e:r&&Ce(e)?new Date(e):n?n(e):e;const xn={isValid:!1,value:null};var Fs=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,xn):xn;function bn(e){const t=e.ref;return Wr(t)?t.files:Jr(t)?Fs(e.refs).value:Ns(t)?[...t.selectedOptions].map(({value:r})=>r):Ot(t)?Os(e.refs).value:Es(Q(t.value)?e.ref.value:t.value,e)}var ya=(e,t,r,n)=>{const s={};for(const i of e){const o=E(t,i);o&&q(s,i,o._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Zt=e=>e instanceof RegExp,ht=e=>Q(e)?e:Zt(e)?e.source:ee(e)?Zt(e.value)?e.value.source:e.value:e,yn=e=>({isOnSubmit:!e||e===be.onSubmit,isOnBlur:e===be.onBlur,isOnChange:e===be.onChange,isOnAll:e===be.all,isOnTouch:e===be.onTouched});const wn="AsyncFunction";var wa=e=>!!e&&!!e.validate&&!!(ye(e.validate)&&e.validate.constructor.name===wn||ee(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===wn)),ja=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),jn=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const gt=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=E(e,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(gt(a,t))break}else if(ee(a)&&gt(a,t))break}}};function Cn(e,t,r){const n=E(e,r);if(n||tr(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),o=E(t,i),a=E(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(a&&a.type)return{name:i,error:a};if(a&&a.root&&a.root.type)return{name:`${i}.root`,error:a.root};s.pop()}return{name:r}}var Ca=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return ae(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!n||be.all))},Na=(e,t,r)=>!e||!t||e===t||vt(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),ka=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,Sa=(e,t)=>!Rr(E(e,t)).length&&te(e,t),Oa=(e,t,r)=>{const n=vt(E(e,r));return q(n,"root",t[r]),q(e,r,n),e},It=e=>Ce(e);function Nn(e,t,r="validate"){if(It(e)||Array.isArray(e)&&e.every(It)||ue(e)&&!e)return{type:r,message:It(e)?e:"",ref:t}}var tt=e=>ee(e)&&!Zt(e)?e:{value:e,message:""},kn=async(e,t,r,n,s,i)=>{const{ref:o,refs:a,required:l,maxLength:f,minLength:u,min:d,max:m,pattern:g,validate:C,name:y,valueAsNumber:b,mount:M}=e._f,j=E(r,y);if(!M||t.has(y))return{};const D=a?a[0]:o,O=V=>{s&&D.reportValidity&&(D.setCustomValidity(ue(V)?"":V||""),D.reportValidity())},F={},A=Jr(o),k=Ot(o),I=A||k,B=(b||Wr(o))&&Q(o.value)&&Q(j)||qt(o)&&o.value===""||j===""||Array.isArray(j)&&!j.length,$=Cs.bind(null,y,n,F),R=(V,P,J,Y=Fe.maxLength,z=Fe.minLength)=>{const K=V?P:J;F[y]={type:V?Y:z,message:K,ref:o,...$(V?Y:z,K)}};if(i?!Array.isArray(j)||!j.length:l&&(!I&&(B||ie(j))||ue(j)&&!j||k&&!Os(a).isValid||A&&!Fs(a).isValid)){const{value:V,message:P}=It(l)?{value:!!l,message:l}:tt(l);if(V&&(F[y]={type:Fe.required,message:P,ref:D,...$(Fe.required,P)},!n))return O(P),F}if(!B&&(!ie(d)||!ie(m))){let V,P;const J=tt(m),Y=tt(d);if(!ie(j)&&!isNaN(j)){const z=o.valueAsNumber||j&&+j;ie(J.value)||(V=z>J.value),ie(Y.value)||(P=z<Y.value)}else{const z=o.valueAsDate||new Date(j),K=Ee=>new Date(new Date().toDateString()+" "+Ee),we=o.type=="time",oe=o.type=="week";Ce(J.value)&&j&&(V=we?K(j)>K(J.value):oe?j>J.value:z>new Date(J.value)),Ce(Y.value)&&j&&(P=we?K(j)<K(Y.value):oe?j<Y.value:z<new Date(Y.value))}if((V||P)&&(R(!!V,J.message,Y.message,Fe.max,Fe.min),!n))return O(F[y].message),F}if((f||u)&&!B&&(Ce(j)||i&&Array.isArray(j))){const V=tt(f),P=tt(u),J=!ie(V.value)&&j.length>+V.value,Y=!ie(P.value)&&j.length<+P.value;if((J||Y)&&(R(J,V.message,P.message),!n))return O(F[y].message),F}if(g&&!B&&Ce(j)){const{value:V,message:P}=tt(g);if(Zt(V)&&!j.match(V)&&(F[y]={type:Fe.pattern,message:P,ref:o,...$(Fe.pattern,P)},!n))return O(P),F}if(C){if(ye(C)){const V=await C(j,r),P=Nn(V,D);if(P&&(F[y]={...P,...$(Fe.validate,P.message)},!n))return O(P.message),F}else if(ee(C)){let V={};for(const P in C){if(!ae(V)&&!n)break;const J=Nn(await C[P](j,r),D,P);J&&(V={...J,...$(P,J.message)},O(J.message),n&&(F[y]=V))}if(!ae(V)&&(F[y]={ref:D,...V},!n))return F}}return O(!0),F};const Ea={mode:be.onSubmit,reValidateMode:be.onChange,shouldFocusError:!0};function Fa(e={}){let t={...Ea,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:ye(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=ee(t.defaultValues)||ee(t.values)?ne(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:ne(s),o={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,f=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const m={array:pn(),state:pn()},g=t.criteriaMode===be.all,C=h=>p=>{clearTimeout(f),f=setTimeout(h,p)},y=async h=>{if(!t.disabled&&(u.isValid||d.isValid||h)){const p=t.resolver?ae((await k()).errors):await B(n,!0);p!==r.isValid&&m.state.next({isValid:p})}},b=(h,p)=>{!t.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((h||Array.from(a.mount)).forEach(x=>{x&&(p?q(r.validatingFields,x,p):te(r.validatingFields,x))}),m.state.next({validatingFields:r.validatingFields,isValidating:!ae(r.validatingFields)}))},M=(h,p=[],x,L,S=!0,N=!0)=>{if(L&&x&&!t.disabled){if(o.action=!0,N&&Array.isArray(E(n,h))){const T=x(E(n,h),L.argA,L.argB);S&&q(n,h,T)}if(N&&Array.isArray(E(r.errors,h))){const T=x(E(r.errors,h),L.argA,L.argB);S&&q(r.errors,h,T),Sa(r.errors,h)}if((u.touchedFields||d.touchedFields)&&N&&Array.isArray(E(r.touchedFields,h))){const T=x(E(r.touchedFields,h),L.argA,L.argB);S&&q(r.touchedFields,h,T)}(u.dirtyFields||d.dirtyFields)&&(r.dirtyFields=dt(s,i)),m.state.next({name:h,isDirty:R(h,p),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else q(i,h,p)},j=(h,p)=>{q(r.errors,h,p),m.state.next({errors:r.errors})},D=h=>{r.errors=h,m.state.next({errors:r.errors,isValid:!1})},O=(h,p,x,L)=>{const S=E(n,h);if(S){const N=E(i,h,Q(x)?E(s,h):x);Q(N)||L&&L.defaultChecked||p?q(i,h,p?N:bn(S._f)):J(h,N),o.mount&&y()}},F=(h,p,x,L,S)=>{let N=!1,T=!1;const W={name:h};if(!t.disabled){if(!x||L){(u.isDirty||d.isDirty)&&(T=r.isDirty,r.isDirty=W.isDirty=R(),N=T!==W.isDirty);const U=Re(E(s,h),p);T=!!E(r.dirtyFields,h),U?te(r.dirtyFields,h):q(r.dirtyFields,h,!0),W.dirtyFields=r.dirtyFields,N=N||(u.dirtyFields||d.dirtyFields)&&T!==!U}if(x){const U=E(r.touchedFields,h);U||(q(r.touchedFields,h,x),W.touchedFields=r.touchedFields,N=N||(u.touchedFields||d.touchedFields)&&U!==x)}N&&S&&m.state.next(W)}return N?W:{}},A=(h,p,x,L)=>{const S=E(r.errors,h),N=(u.isValid||d.isValid)&&ue(p)&&r.isValid!==p;if(t.delayError&&x?(l=C(()=>j(h,x)),l(t.delayError)):(clearTimeout(f),l=null,x?q(r.errors,h,x):te(r.errors,h)),(x?!Re(S,x):S)||!ae(L)||N){const T={...L,...N&&ue(p)?{isValid:p}:{},errors:r.errors,name:h};r={...r,...T},m.state.next(T)}},k=async h=>{b(h,!0);const p=await t.resolver(i,t.context,ya(h||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return b(h),p},I=async h=>{const{errors:p}=await k(h);if(h)for(const x of h){const L=E(p,x);L?q(r.errors,x,L):te(r.errors,x)}else r.errors=p;return p},B=async(h,p,x={valid:!0})=>{for(const L in h){const S=h[L];if(S){const{_f:N,...T}=S;if(N){const W=a.array.has(N.name),U=S._f&&wa(S._f);U&&u.validatingFields&&b([L],!0);const he=await kn(S,a.disabled,i,g,t.shouldUseNativeValidation&&!p,W);if(U&&u.validatingFields&&b([L]),he[N.name]&&(x.valid=!1,p))break;!p&&(E(he,N.name)?W?Oa(r.errors,he,N.name):q(r.errors,N.name,he[N.name]):te(r.errors,N.name))}!ae(T)&&await B(T,p,x)}}return x.valid},$=()=>{for(const h of a.unMount){const p=E(n,h);p&&(p._f.refs?p._f.refs.every(x=>!or(x)):!or(p._f.ref))&&_e(h)}a.unMount=new Set},R=(h,p)=>!t.disabled&&(h&&p&&q(i,h,p),!Re(Ee(),s)),V=(h,p,x)=>js(h,a,{...o.mount?i:Q(p)?s:Ce(h)?{[h]:p}:p},x,p),P=h=>Rr(E(o.mount?i:s,h,t.shouldUnregister?E(s,h,[]):[])),J=(h,p,x={})=>{const L=E(n,h);let S=p;if(L){const N=L._f;N&&(!N.disabled&&q(i,h,Es(p,N)),S=qt(N.ref)&&ie(p)?"":p,Ns(N.ref)?[...N.ref.options].forEach(T=>T.selected=S.includes(T.value)):N.refs?Ot(N.ref)?N.refs.forEach(T=>{(!T.defaultChecked||!T.disabled)&&(Array.isArray(S)?T.checked=!!S.find(W=>W===T.value):T.checked=S===T.value||!!S)}):N.refs.forEach(T=>T.checked=T.value===S):Wr(N.ref)?N.ref.value="":(N.ref.value=S,N.ref.type||m.state.next({name:h,values:ne(i)})))}(x.shouldDirty||x.shouldTouch)&&F(h,S,x.shouldTouch,x.shouldDirty,!0),x.shouldValidate&&oe(h)},Y=(h,p,x)=>{for(const L in p){if(!p.hasOwnProperty(L))return;const S=p[L],N=h+"."+L,T=E(n,N);(a.array.has(h)||ee(S)||T&&!T._f)&&!Ue(S)?Y(N,S,x):J(N,S,x)}},z=(h,p,x={})=>{const L=E(n,h),S=a.array.has(h),N=ne(p);q(i,h,N),S?(m.array.next({name:h,values:ne(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&x.shouldDirty&&m.state.next({name:h,dirtyFields:dt(s,i),isDirty:R(h,N)})):L&&!L._f&&!ie(N)?Y(h,N,x):J(h,N,x),jn(h,a)&&m.state.next({...r}),m.state.next({name:o.mount?h:void 0,values:ne(i)})},K=async h=>{o.mount=!0;const p=h.target;let x=p.name,L=!0;const S=E(n,x),N=U=>{L=Number.isNaN(U)||Ue(U)&&isNaN(U.getTime())||Re(U,E(i,x,U))},T=yn(t.mode),W=yn(t.reValidateMode);if(S){let U,he;const Dt=p.type?bn(S._f):bs(h),De=h.type===Ut.BLUR||h.type===Ut.FOCUS_OUT,Gs=!ja(S._f)&&!t.resolver&&!E(r.errors,x)&&!S._f.deps||ka(De,E(r.touchedFields,x),r.isSubmitted,W,T),nr=jn(x,a,De);q(i,x,Dt),De?(S._f.onBlur&&S._f.onBlur(h),l&&l(0)):S._f.onChange&&S._f.onChange(h);const sr=F(x,Dt,De),Xs=!ae(sr)||nr;if(!De&&m.state.next({name:x,type:h.type,values:ne(i)}),Gs)return(u.isValid||d.isValid)&&(t.mode==="onBlur"?De&&y():De||y()),Xs&&m.state.next({name:x,...nr?{}:sr});if(!De&&nr&&m.state.next({...r}),t.resolver){const{errors:Yr}=await k([x]);if(N(Dt),L){const Ys=Cn(r.errors,n,x),Kr=Cn(Yr,n,Ys.name||x);U=Kr.error,x=Kr.name,he=ae(Yr)}}else b([x],!0),U=(await kn(S,a.disabled,i,g,t.shouldUseNativeValidation))[x],b([x]),N(Dt),L&&(U?he=!1:(u.isValid||d.isValid)&&(he=await B(n,!0)));L&&(S._f.deps&&oe(S._f.deps),A(x,he,U,sr))}},we=(h,p)=>{if(E(r.errors,p)&&h.focus)return h.focus(),1},oe=async(h,p={})=>{let x,L;const S=vt(h);if(t.resolver){const N=await I(Q(h)?h:S);x=ae(N),L=h?!S.some(T=>E(N,T)):x}else h?(L=(await Promise.all(S.map(async N=>{const T=E(n,N);return await B(T&&T._f?{[N]:T}:T)}))).every(Boolean),!(!L&&!r.isValid)&&y()):L=x=await B(n);return m.state.next({...!Ce(h)||(u.isValid||d.isValid)&&x!==r.isValid?{}:{name:h},...t.resolver||!h?{isValid:x}:{},errors:r.errors}),p.shouldFocus&&!L&&gt(n,we,h?S:a.mount),L},Ee=h=>{const p={...o.mount?i:s};return Q(h)?p:Ce(h)?E(p,h):h.map(x=>E(p,x))},et=(h,p)=>({invalid:!!E((p||r).errors,h),isDirty:!!E((p||r).dirtyFields,h),error:E((p||r).errors,h),isValidating:!!E(r.validatingFields,h),isTouched:!!E((p||r).touchedFields,h)}),Ie=h=>{h&&vt(h).forEach(p=>te(r.errors,p)),m.state.next({errors:h?r.errors:{}})},$e=(h,p,x)=>{const L=(E(n,h,{_f:{}})._f||{}).ref,S=E(r.errors,h)||{},{ref:N,message:T,type:W,...U}=S;q(r.errors,h,{...U,...p,ref:L}),m.state.next({name:h,errors:r.errors,isValid:!1}),x&&x.shouldFocus&&L&&L.focus&&L.focus()},Ve=(h,p)=>ye(h)?m.state.subscribe({next:x=>h(V(void 0,p),x)}):V(h,p,!0),xe=h=>m.state.subscribe({next:p=>{Na(h.name,p.name,h.exact)&&Ca(p,h.formState||u,Vt,h.reRenderRoot)&&h.callback({values:{...i},...r,...p})}}).unsubscribe,He=h=>(o.mount=!0,d={...d,...h.formState},xe({...h,formState:d})),_e=(h,p={})=>{for(const x of h?vt(h):a.mount)a.mount.delete(x),a.array.delete(x),p.keepValue||(te(n,x),te(i,x)),!p.keepError&&te(r.errors,x),!p.keepDirty&&te(r.dirtyFields,x),!p.keepTouched&&te(r.touchedFields,x),!p.keepIsValidating&&te(r.validatingFields,x),!t.shouldUnregister&&!p.keepDefaultValue&&te(s,x);m.state.next({values:ne(i)}),m.state.next({...r,...p.keepDirty?{isDirty:R()}:{}}),!p.keepIsValid&&y()},je=({disabled:h,name:p})=>{(ue(h)&&o.mount||h||a.disabled.has(p))&&(h?a.disabled.add(p):a.disabled.delete(p))},We=(h,p={})=>{let x=E(n,h);const L=ue(p.disabled)||ue(t.disabled);return q(n,h,{...x||{},_f:{...x&&x._f?x._f:{ref:{name:h}},name:h,mount:!0,...p}}),a.mount.add(h),x?je({disabled:ue(p.disabled)?p.disabled:t.disabled,name:h}):O(h,!0,p.value),{...L?{disabled:p.disabled||t.disabled}:{},...t.progressive?{required:!!p.required,min:ht(p.min),max:ht(p.max),minLength:ht(p.minLength),maxLength:ht(p.maxLength),pattern:ht(p.pattern)}:{},name:h,onChange:K,onBlur:K,ref:S=>{if(S){We(h,p),x=E(n,h);const N=Q(S.value)&&S.querySelectorAll&&S.querySelectorAll("input,select,textarea")[0]||S,T=ga(N),W=x._f.refs||[];if(T?W.find(U=>U===N):N===x._f.ref)return;q(n,h,{_f:{...x._f,...T?{refs:[...W.filter(or),N,...Array.isArray(E(s,h))?[{}]:[]],ref:{type:N.type,name:h}}:{ref:N}}}),O(h,!1,void 0,N)}else x=E(n,h,{}),x._f&&(x._f.mount=!1),(t.shouldUnregister||p.shouldUnregister)&&!(ys(a.array,h)&&o.action)&&a.unMount.add(h)}}},ct=()=>t.shouldFocusError&&gt(n,we,a.mount),ut=h=>{ue(h)&&(m.state.next({disabled:h}),gt(n,(p,x)=>{const L=E(n,x);L&&(p.disabled=L._f.disabled||h,Array.isArray(L._f.refs)&&L._f.refs.forEach(S=>{S.disabled=L._f.disabled||h}))},0,!1))},Et=(h,p)=>async x=>{let L;x&&(x.preventDefault&&x.preventDefault(),x.persist&&x.persist());let S=ne(i);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:N,values:T}=await k();r.errors=N,S=ne(T)}else await B(n);if(a.disabled.size)for(const N of a.disabled)te(S,N);if(te(r.errors,"root"),ae(r.errors)){m.state.next({errors:{}});try{await h(S,x)}catch(N){L=N}}else p&&await p({...r.errors},x),ct(),setTimeout(ct);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ae(r.errors)&&!L,submitCount:r.submitCount+1,errors:r.errors}),L)throw L},Ft=(h,p={})=>{E(n,h)&&(Q(p.defaultValue)?z(h,ne(E(s,h))):(z(h,p.defaultValue),q(s,h,ne(p.defaultValue))),p.keepTouched||te(r.touchedFields,h),p.keepDirty||(te(r.dirtyFields,h),r.isDirty=p.defaultValue?R(h,ne(E(s,h))):R()),p.keepError||(te(r.errors,h),u.isValid&&y()),m.state.next({...r}))},At=(h,p={})=>{const x=h?ne(h):s,L=ne(x),S=ae(h),N=S?s:L;if(p.keepDefaultValues||(s=x),!p.keepValues){if(p.keepDirtyValues){const T=new Set([...a.mount,...Object.keys(dt(s,i))]);for(const W of Array.from(T))E(r.dirtyFields,W)?q(N,W,E(i,W)):z(W,E(N,W))}else{if(Tr&&Q(h))for(const T of a.mount){const W=E(n,T);if(W&&W._f){const U=Array.isArray(W._f.refs)?W._f.refs[0]:W._f.ref;if(qt(U)){const he=U.closest("form");if(he){he.reset();break}}}}if(p.keepFieldsRef)for(const T of a.mount)z(T,E(N,T));else n={}}i=t.shouldUnregister?p.keepDefaultValues?ne(s):{}:ne(N),m.array.next({values:{...N}}),m.state.next({values:{...N}})}a={mount:p.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!p.keepIsValid||!!p.keepDirtyValues,o.watch=!!t.shouldUnregister,m.state.next({submitCount:p.keepSubmitCount?r.submitCount:0,isDirty:S?!1:p.keepDirty?r.isDirty:!!(p.keepDefaultValues&&!Re(h,s)),isSubmitted:p.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:S?{}:p.keepDirtyValues?p.keepDefaultValues&&i?dt(s,i):r.dirtyFields:p.keepDefaultValues&&h?dt(s,h):p.keepDirty?r.dirtyFields:{},touchedFields:p.keepTouched?r.touchedFields:{},errors:p.keepErrors?r.errors:{},isSubmitSuccessful:p.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Lt=(h,p)=>At(ye(h)?h(i):h,p),Mt=(h,p={})=>{const x=E(n,h),L=x&&x._f;if(L){const S=L.refs?L.refs[0]:L.ref;S.focus&&(S.focus(),p.shouldSelect&&ye(S.select)&&S.select())}},Vt=h=>{r={...r,...h}},_t={control:{register:We,unregister:_e,getFieldState:et,handleSubmit:Et,setError:$e,_subscribe:xe,_runSchema:k,_focusError:ct,_getWatch:V,_getDirty:R,_setValid:y,_setFieldArray:M,_setDisabledField:je,_setErrors:D,_getFieldArray:P,_reset:At,_resetDefaultValues:()=>ye(t.defaultValues)&&t.defaultValues().then(h=>{Lt(h,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:ut,_subjects:m,_proxyFormState:u,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(h){o=h},get _defaultValues(){return s},get _names(){return a},set _names(h){a=h},get _formState(){return r},get _options(){return t},set _options(h){t={...t,...h}}},subscribe:He,trigger:oe,register:We,handleSubmit:Et,watch:Ve,setValue:z,getValues:Ee,reset:Lt,resetField:Ft,clearErrors:Ie,unregister:_e,setError:$e,setFocus:Mt,getFieldState:et};return{..._t,formControl:_t}}function Aa(e={}){const t=v.useRef(void 0),r=v.useRef(void 0),[n,s]=v.useState({isDirty:!1,isValidating:!1,isLoading:ye(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:ye(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!ye(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...a}=Fa(e);t.current={...a,formState:n}}const i=t.current.control;return i._options=e,Ir(()=>{const o=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),i._formState.isReady=!0,o},[i]),v.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),v.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),v.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),v.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),v.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==n.isDirty&&i._subjects.state.next({isDirty:o})}},[i,n.isDirty]),v.useEffect(()=>{e.values&&!Re(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),r.current=e.values,s(o=>({...o}))):i._resetDefaultValues()},[i,e.values]),v.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=ws(n,i),t.current}const Sn=(e,t,r)=>{if(e&&"reportValidity"in e){const n=E(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},As=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Sn(n.ref,r,e):n.refs&&n.refs.forEach(s=>Sn(s,r,e))}},La=(e,t)=>{t.shouldUseNativeValidation&&As(e,t);const r={};for(const n in e){const s=E(t.fields,n),i=Object.assign(e[n]||{},{ref:s&&s.ref});if(Ma(t.names||Object.keys(e),n)){const o=Object.assign({},E(r,n));q(o,"root",i),q(r,n,o)}else q(r,n,i)}return r},Ma=(e,t)=>e.some(r=>r.startsWith(t+"."));function Va(e,t,r){return t===void 0&&(t={}),r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(o,a){try{var l=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[r.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:s}))).then(function(f){return i.shouldUseNativeValidation&&As({},i),{values:r.raw?n:f,errors:{}}}))}catch(f){return a(f)}return l&&l.then?l.then(void 0,a):l}(0,function(o){if(!o.inner)throw o;return{values:{},errors:La((a=o,l=!i.shouldUseNativeValidation&&i.criteriaMode==="all",(a.inner||[]).reduce(function(f,u){if(f[u.path]||(f[u.path]={message:u.message,type:u.type}),l){var d=f[u.path].types,m=d&&d[u.type];f[u.path]=Cs(u.path,l,f,u.type,m?[].concat(m,u.message):u.message)}return f},{})),i)};var a,l}))}catch(o){return Promise.reject(o)}}}function _a({className:e,name:t,children:r,mode:n="onBlur",reValidateMode:s="onBlur",defaultValues:i,schema:o,formProps:a,onSubmit:l=()=>null,onChange:f}){const u=Aa({mode:n,reValidateMode:s,defaultValues:i,resolver:o?Va(o):void 0});return v.useEffect(()=>{if(!f)return;const{unsubscribe:d}=u.watch(f);return d},[f,u.watch]),c.jsx(pa,{...u,children:c.jsx("form",{className:w.twJoin("bbn-form",e),name:t,onSubmit:u.handleSubmit(l),...a,children:r})})}function Qe({name:e,defaultValue:t,disabled:r=!1,autoFocus:n=!1,shouldUnregister:s=!1,validateOnMount:i=!0}){const{setFocus:o,trigger:a}=Ke(),{field:l,fieldState:f}=va({name:e,defaultValue:t,disabled:r,shouldUnregister:s}),{invalid:u,isTouched:d,error:m}=f;return v.useEffect(()=>{i?a(e,{shouldFocus:n}):n&&o(e)},[e,i]),{...l,value:l.value,invalid:u&&d,error:(m==null?void 0:m.message)??""}}function Da(e){const{getFieldState:t}=Ke(),r=$r({name:e});return Array.isArray(e)?e.map(s=>t(s,r)):t(e,r)}const Ta=/^-?\d*\.?\d*$/;function Ra({name:e,id:t=e,label:r,hint:n,className:s,controlClassName:i,disabled:o,autoFocus:a,defaultValue:l,placeholder:f,type:u,suffix:d,prefix:m,shouldUnregister:g,state:C,validateOnMount:y}){const{ref:b,value:M="",error:j,invalid:D,onChange:O,onBlur:F}=Qe({name:e,defaultValue:l,autoFocus:a,shouldUnregister:g,validateOnMount:y}),A=D?"error":C,k=D?j:n,I=B=>{Ta.test(B.target.value)&&O(B.target.value)};return c.jsx(St,{label:r,className:i,state:A,hint:k,children:c.jsx(Kt,{inputMode:"decimal",pattern:"^-?\\d*\\.?\\d*$",ref:b,value:M,id:t,name:e,type:u,className:s,disabled:o,autoFocus:a,placeholder:f,suffix:d,prefix:m,state:A,onChange:I,onBlur:F})})}function Pa({name:e,id:t=e,label:r,hint:n,className:s,controlClassName:i,disabled:o,autoFocus:a,defaultValue:l,placeholder:f,type:u,suffix:d,prefix:m,shouldUnregister:g,state:C,validateOnMount:y}){const{ref:b,value:M="",error:j,invalid:D,onChange:O,onBlur:F}=Qe({name:e,defaultValue:l,autoFocus:a,shouldUnregister:g,validateOnMount:y}),A=D?"error":C,k=D?j:n;return c.jsx(St,{label:r,className:i,state:A,hint:k,children:c.jsx(Kt,{ref:b,value:M,id:t,name:e,type:u,className:s,disabled:o,autoFocus:a,placeholder:f,suffix:d,prefix:m,state:A,onChange:O,onBlur:F})})}function Ba({name:e,id:t=e,label:r,className:n,disabled:s,value:i,defaultChecked:o,labelClassName:a,orientation:l}){const{ref:f,value:u=!1,onChange:d,onBlur:m}=Qe({name:e});return c.jsx(Vn,{ref:f,name:e,checked:u,id:t,label:r,className:n,disabled:s,value:i,defaultChecked:o,labelClassName:a,orientation:l,inputProps:{onChange:d,onBlur:m}})}function Ia({name:e,id:t=e,label:r,className:n,disabled:s,value:i,defaultChecked:o,labelClassName:a,orientation:l}){const{ref:f,value:u,onChange:d,onBlur:m}=Qe({name:e,disabled:s,defaultValue:o?i:void 0});return c.jsx(_n,{ref:f,name:e,id:t,label:r,className:n,disabled:s,checked:u===i,value:i,labelClassName:a,orientation:l,inputProps:{onChange:d,onBlur:m}})}function $a({open:e,defaultOpen:t,options:r,optionClassName:n,popoverClassName:s,name:i,id:o=i,label:a,hint:l,className:f,controlClassName:u,disabled:d,autoFocus:m,defaultValue:g,placeholder:C,shouldUnregister:y,state:b,validateOnMount:M,onOpen:j,onClose:D,renderSelectedOption:O}){const{ref:F,value:A="",error:k,invalid:I,onChange:B,onBlur:$}=Qe({name:i,defaultValue:g,autoFocus:m,shouldUnregister:y,validateOnMount:M}),R=I?"error":b,V=I?k:l,P=()=>{$==null||$(),D==null||D()};return c.jsx(St,{label:a,className:u,state:R,hint:V,children:c.jsx(kr,{open:e,defaultOpen:t,options:r,ref:F,value:A,id:o,name:i,className:f,disabled:d,placeholder:C,state:R,optionClassName:n,popoverClassName:s,onSelect:B,onBlur:$,onOpen:j,onClose:P,renderSelectedOption:O})})}function Ls({displayError:e=!1,...t}){const{error:r,value:n,onChange:s,onBlur:i,disabled:o,name:a,ref:l}=Qe(t),f=c.jsx("input",{ref:l,type:"hidden",name:a,disabled:o,value:n,onChange:s,onBlur:i});if(e){const u=e?"error":"default",d=e?r:"";return c.jsx(St,{hint:d,state:u,children:f})}return f}const Ha={lg:{logo:"size-10",subLogo:"text-[0.8rem]"},md:{logo:"size-6",subLogo:"text-[0.5rem]"},sm:{logo:"size-5",subLogo:"text-[0.4rem]"}},Ms=({logoUrl:e,rank:t,moniker:r,size:n="md",className:s})=>{const[i,o]=v.useState(!1),a=Ha[n],l=(r==null?void 0:r.charAt(0).toUpperCase())??String(t);return c.jsx("span",{className:w.twMerge("relative inline-block",a.logo,s),children:e&&!i?c.jsx("img",{src:e,alt:r||`Finality Provider ${t}`,className:"h-full w-full rounded-full object-cover",onError:()=>o(!0)}):c.jsx(H,{as:"span",className:"inline-flex h-full w-full items-center justify-center rounded-full bg-secondary-main text-[1rem] text-accent-contrast",children:l})})};function Ur({bsnId:e,bsnName:t,bsnLogoUrl:r,address:n,provider:s,onRemove:i}){var f,u;if(!s)return null;const o=()=>{if(r)return c.jsx(xt,{url:r,alt:t,variant:"rounded",size:"tiny",className:"mr-1"});const d=(t==null?void 0:t.charAt(0).toUpperCase())||"?";return c.jsx(xt,{variant:"rounded",size:"tiny",className:"mr-1",children:c.jsx(H,{as:"span",className:"inline-flex h-full w-full items-center justify-center bg-secondary-main text-xs text-accent-contrast",children:d})})},a=d=>!d||d.length<=6*2?d:`${d.slice(0,6)}...${d.slice(-6)}`,l=()=>n?c.jsx("div",{className:"text-xs text-accent-secondary",children:a(n)}):c.jsxs("div",{className:"flex items-center text-xs text-accent-secondary",children:[o(),t]});return c.jsxs("div",{className:"flex flex-row items-center justify-between",children:[c.jsxs("div",{className:"flex h-10 flex-row gap-2",children:[c.jsx("div",{className:"shrink-0",children:c.jsx(Ms,{logoUrl:s.logo_url,rank:s.rank,moniker:(f=s.description)==null?void 0:f.moniker,size:"lg"})}),c.jsxs("div",{className:"flex flex-col justify-center text-accent-primary",children:[l(),c.jsx(H,{as:"div",className:"text-base font-medium text-accent-primary",children:(u=s.description)==null?void 0:u.moniker})]})]}),i?c.jsx("button",{onClick:()=>i(e),className:"ml-[10px] cursor-pointer rounded bg-accent-secondary/20 px-2 py-0.5 text-xs tracking-[0.4px] text-accent-primary",children:"Remove"}):null]})}const Wa=({attributes:e,providerItemProps:t,isSelected:r=!1,isSelectable:n=!0,onSelect:s})=>c.jsxs("div",{className:"bg-secondary-highlight h-[316px] overflow-hidden p-4 flex flex-col rounded justify-between",children:[c.jsx(Ur,{...t}),c.jsx("div",{className:"w-full h-px bg-secondary-strokeLight"}),Object.entries(e).map(([i,o])=>c.jsxs("div",{className:"text-sm flex flex-row justify-between first:mt-0 mt-1",children:[c.jsx("div",{className:"text-accent-secondary",children:i}),c.jsx("div",{className:"text-accent-primary font-medium",children:o})]},i)),s&&c.jsx(Ge,{className:"mt-4",onClick:s,disabled:!n,variant:r?"contained":"outlined",children:r?"Selected":"Select"})]}),Ja=({amount:e,currencyIcon:t,currencyName:r,placeholder:n="Enter Amount",subtitle:s,displayBalance:i,balanceDetails:o,min:a,step:l,autoFocus:f,onChange:u,onKeyDown:d,amountUsd:m,disabled:g=!1})=>c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("img",{src:t,alt:r,className:"h-10 max-h-[2.5rem] w-10 max-w-[2.5rem]"}),c.jsx("div",{className:"text-lg",children:r})]}),c.jsx("input",{type:"number",value:e??"",min:a,step:l,onChange:u,onKeyDown:d,disabled:g,placeholder:n,autoFocus:f,className:"w-2/3 bg-transparent text-right text-lg outline-none appearance-none [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"})]}),o&&i?c.jsxs("div",{className:"flex w-full flex-row content-center justify-between text-sm",children:[c.jsx("span",{className:"cursor-default",children:s}),o.displayUSD&&o.price!==void 0&&c.jsxs("div",{children:[m," USD"]})]}):null]});var at=1e9,Ua={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},zr,X=!0,ge="[DecimalError] ",ze=ge+"Invalid argument: ",qr=ge+"Exponent out of range: ",lt=Math.floor,Je=Math.pow,qa=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fe,se=1e7,G=7,Vs=9007199254740991,Gt=lt(Vs/G),_={};_.absoluteValue=_.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};_.comparedTo=_.cmp=function(e){var t,r,n,s,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,s=e.d.length,t=0,r=n<s?n:s;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===s?0:n>s^i.s<0?1:-1};_.decimalPlaces=_.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*G;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};_.dividedBy=_.div=function(e){return Le(this,new this.constructor(e))};_.dividedToIntegerBy=_.idiv=function(e){var t=this,r=t.constructor;return Z(Le(t,new r(e),0,1),r.precision)};_.equals=_.eq=function(e){return!this.cmp(e)};_.exponent=function(){return re(this)};_.greaterThan=_.gt=function(e){return this.cmp(e)>0};_.greaterThanOrEqualTo=_.gte=function(e){return this.cmp(e)>=0};_.isInteger=_.isint=function(){return this.e>this.d.length-2};_.isNegative=_.isneg=function(){return this.s<0};_.isPositive=_.ispos=function(){return this.s>0};_.isZero=function(){return this.s===0};_.lessThan=_.lt=function(e){return this.cmp(e)<0};_.lessThanOrEqualTo=_.lte=function(e){return this.cmp(e)<1};_.logarithm=_.log=function(e){var t,r=this,n=r.constructor,s=n.precision,i=s+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(fe))throw Error(ge+"NaN");if(r.s<1)throw Error(ge+(r.s?"NaN":"-Infinity"));return r.eq(fe)?new n(0):(X=!1,t=Le(wt(r,i),wt(e,i),i),X=!0,Z(t,s))};_.minus=_.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Ts(t,e):_s(t,(e.s=-e.s,e))};_.modulo=_.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(ge+"NaN");return r.s?(X=!1,t=Le(r,e,0,1).times(e),X=!0,r.minus(t)):Z(new n(r),s)};_.naturalExponential=_.exp=function(){return Ds(this)};_.naturalLogarithm=_.ln=function(){return wt(this)};_.negated=_.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};_.plus=_.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_s(t,e):Ts(t,(e.s=-e.s,e))};_.precision=_.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ze+e);if(t=re(s)+1,n=s.d.length-1,r=n*G+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};_.squareRoot=_.sqrt=function(){var e,t,r,n,s,i,o,a=this,l=a.constructor;if(a.s<1){if(!a.s)return new l(0);throw Error(ge+"NaN")}for(e=re(a),X=!1,s=Math.sqrt(+a),s==0||s==1/0?(t=Ne(a.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=lt((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(s.toString()),r=l.precision,s=o=r+3;;)if(i=n,n=i.plus(Le(a,i,o+2)).times(.5),Ne(i.d).slice(0,o)===(t=Ne(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(Z(i,r+1,0),i.times(i).eq(a)){n=i;break}}else if(t!="9999")break;o+=4}return X=!0,Z(n,r)};_.times=_.mul=function(e){var t,r,n,s,i,o,a,l,f,u=this,d=u.constructor,m=u.d,g=(e=new d(e)).d;if(!u.s||!e.s)return new d(0);for(e.s*=u.s,r=u.e+e.e,l=m.length,f=g.length,l<f&&(i=m,m=g,g=i,o=l,l=f,f=o),i=[],o=l+f,n=o;n--;)i.push(0);for(n=f;--n>=0;){for(t=0,s=l+n;s>n;)a=i[s]+g[n]*m[s-n-1]+t,i[s--]=a%se|0,t=a/se|0;i[s]=(i[s]+t)%se|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,X?Z(e,d.precision):e};_.toDecimalPlaces=_.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Oe(e,0,at),t===void 0?t=n.rounding:Oe(t,0,8),Z(r,e+re(r)+1,t))};_.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=Ye(n,!0):(Oe(e,0,at),t===void 0?t=s.rounding:Oe(t,0,8),n=Z(new s(n),e+1,t),r=Ye(n,!0,e+1)),r};_.toFixed=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?Ye(s):(Oe(e,0,at),t===void 0?t=i.rounding:Oe(t,0,8),n=Z(new i(s),e+re(s)+1,t),r=Ye(n.abs(),!1,e+re(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};_.toInteger=_.toint=function(){var e=this,t=e.constructor;return Z(new t(e),re(e)+1,t.rounding)};_.toNumber=function(){return+this};_.toPower=_.pow=function(e){var t,r,n,s,i,o,a=this,l=a.constructor,f=12,u=+(e=new l(e));if(!e.s)return new l(fe);if(a=new l(a),!a.s){if(e.s<1)throw Error(ge+"Infinity");return a}if(a.eq(fe))return a;if(n=l.precision,e.eq(fe))return Z(a,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=a.s,o){if((r=u<0?-u:u)<=Vs){for(s=new l(fe),t=Math.ceil(n/G+4),X=!1;r%2&&(s=s.times(a),En(s.d,t)),r=lt(r/2),r!==0;)a=a.times(a),En(a.d,t);return X=!0,e.s<0?new l(fe).div(s):Z(s,n)}}else if(i<0)throw Error(ge+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,a.s=1,X=!1,s=e.times(wt(a,n+f)),X=!0,s=Ds(s),s.s=i,s};_.toPrecision=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?(r=re(s),n=Ye(s,r<=i.toExpNeg||r>=i.toExpPos)):(Oe(e,1,at),t===void 0?t=i.rounding:Oe(t,0,8),s=Z(new i(s),e,t),r=re(s),n=Ye(s,e<=r||r<=i.toExpNeg,e)),n};_.toSignificantDigits=_.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Oe(e,1,at),t===void 0?t=n.rounding:Oe(t,0,8)),Z(new n(r),e,t)};_.toString=_.valueOf=_.val=_.toJSON=_[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=re(e),r=e.constructor;return Ye(e,t<=r.toExpNeg||t>=r.toExpPos)};function _s(e,t){var r,n,s,i,o,a,l,f,u=e.constructor,d=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),X?Z(t,d):t;if(l=e.d,f=t.d,o=e.e,s=t.e,l=l.slice(),i=o-s,i){for(i<0?(n=l,i=-i,a=f.length):(n=f,s=o,a=l.length),o=Math.ceil(d/G),a=o>a?o+1:a+1,i>a&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(a=l.length,i=f.length,a-i<0&&(i=a,n=f,f=l,l=n),r=0;i;)r=(l[--i]=l[i]+f[i]+r)/se|0,l[i]%=se;for(r&&(l.unshift(r),++s),a=l.length;l[--a]==0;)l.pop();return t.d=l,t.e=s,X?Z(t,d):t}function Oe(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ze+e)}function Ne(e){var t,r,n,s=e.length-1,i="",o=e[0];if(s>0){for(i+=o,t=1;t<s;t++)n=e[t]+"",r=G-n.length,r&&(i+=Te(r)),i+=n;o=e[t],n=o+"",r=G-n.length,r&&(i+=Te(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Le=function(){function e(n,s){var i,o=0,a=n.length;for(n=n.slice();a--;)i=n[a]*s+o,n[a]=i%se|0,o=i/se|0;return o&&n.unshift(o),n}function t(n,s,i,o){var a,l;if(i!=o)l=i>o?1:-1;else for(a=l=0;a<i;a++)if(n[a]!=s[a]){l=n[a]>s[a]?1:-1;break}return l}function r(n,s,i){for(var o=0;i--;)n[i]-=o,o=n[i]<s[i]?1:0,n[i]=o*se+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,i,o){var a,l,f,u,d,m,g,C,y,b,M,j,D,O,F,A,k,I,B=n.constructor,$=n.s==s.s?1:-1,R=n.d,V=s.d;if(!n.s)return new B(n);if(!s.s)throw Error(ge+"Division by zero");for(l=n.e-s.e,k=V.length,F=R.length,g=new B($),C=g.d=[],f=0;V[f]==(R[f]||0);)++f;if(V[f]>(R[f]||0)&&--l,i==null?j=i=B.precision:o?j=i+(re(n)-re(s))+1:j=i,j<0)return new B(0);if(j=j/G+2|0,f=0,k==1)for(u=0,V=V[0],j++;(f<F||u)&&j--;f++)D=u*se+(R[f]||0),C[f]=D/V|0,u=D%V|0;else{for(u=se/(V[0]+1)|0,u>1&&(V=e(V,u),R=e(R,u),k=V.length,F=R.length),O=k,y=R.slice(0,k),b=y.length;b<k;)y[b++]=0;I=V.slice(),I.unshift(0),A=V[0],V[1]>=se/2&&++A;do u=0,a=t(V,y,k,b),a<0?(M=y[0],k!=b&&(M=M*se+(y[1]||0)),u=M/A|0,u>1?(u>=se&&(u=se-1),d=e(V,u),m=d.length,b=y.length,a=t(d,y,m,b),a==1&&(u--,r(d,k<m?I:V,m))):(u==0&&(a=u=1),d=V.slice()),m=d.length,m<b&&d.unshift(0),r(y,d,b),a==-1&&(b=y.length,a=t(V,y,k,b),a<1&&(u++,r(y,k<b?I:V,b))),b=y.length):a===0&&(u++,y=[0]),C[f++]=u,a&&y[0]?y[b++]=R[O]||0:(y=[R[O]],b=1);while((O++<F||y[0]!==void 0)&&j--)}return C[0]||C.shift(),g.e=l,Z(g,o?i+re(g)+1:i)}}();function Ds(e,t){var r,n,s,i,o,a,l=0,f=0,u=e.constructor,d=u.precision;if(re(e)>16)throw Error(qr+re(e));if(!e.s)return new u(fe);for(X=!1,a=d,o=new u(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(n=Math.log(Je(2,f))/Math.LN10*2+5|0,a+=n,r=s=i=new u(fe),u.precision=a;;){if(s=Z(s.times(e),a),r=r.times(++l),o=i.plus(Le(s,r,a)),Ne(o.d).slice(0,a)===Ne(i.d).slice(0,a)){for(;f--;)i=Z(i.times(i),a);return u.precision=d,t==null?(X=!0,Z(i,d)):i}i=o}}function re(e){for(var t=e.e*G,r=e.d[0];r>=10;r/=10)t++;return t}function ar(e,t,r){if(t>e.LN10.sd())throw X=!0,r&&(e.precision=r),Error(ge+"LN10 precision limit exceeded");return Z(new e(e.LN10),t)}function Te(e){for(var t="";e--;)t+="0";return t}function wt(e,t){var r,n,s,i,o,a,l,f,u,d=1,m=10,g=e,C=g.d,y=g.constructor,b=y.precision;if(g.s<1)throw Error(ge+(g.s?"NaN":"-Infinity"));if(g.eq(fe))return new y(0);if(t==null?(X=!1,f=b):f=t,g.eq(10))return t==null&&(X=!0),ar(y,f);if(f+=m,y.precision=f,r=Ne(C),n=r.charAt(0),i=re(g),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=Ne(g.d),n=r.charAt(0),d++;i=re(g),n>1?(g=new y("0."+r),i++):g=new y(n+"."+r.slice(1))}else return l=ar(y,f+2,b).times(i+""),g=wt(new y(n+"."+r.slice(1)),f-m).plus(l),y.precision=b,t==null?(X=!0,Z(g,b)):g;for(a=o=g=Le(g.minus(fe),g.plus(fe),f),u=Z(g.times(g),f),s=3;;){if(o=Z(o.times(u),f),l=a.plus(Le(o,new y(s),f)),Ne(l.d).slice(0,f)===Ne(a.d).slice(0,f))return a=a.times(2),i!==0&&(a=a.plus(ar(y,f+2,b).times(i+""))),a=Le(a,new y(d),f),y.precision=b,t==null?(X=!0,Z(a,b)):a;a=l,s+=2}}function On(e,t){var r,n,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(n,s),t){if(s-=n,r=r-n-1,e.e=lt(r/G),e.d=[],n=(r+1)%G,r<0&&(n+=G),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=G;n<s;)e.d.push(+t.slice(n,n+=G));t=t.slice(n),n=G-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),X&&(e.e>Gt||e.e<-Gt))throw Error(qr+r)}else e.s=0,e.e=0,e.d=[0];return e}function Z(e,t,r){var n,s,i,o,a,l,f,u,d=e.d;for(o=1,i=d[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=G,s=t,f=d[u=0];else{if(u=Math.ceil((n+1)/G),i=d.length,u>=i)return e;for(f=i=d[u],o=1;i>=10;i/=10)o++;n%=G,s=n-G+o}if(r!==void 0&&(i=Je(10,o-s-1),a=f/i%10|0,l=t<0||d[u+1]!==void 0||f%i,l=r<4?(a||l)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||l||r==6&&(n>0?s>0?f/Je(10,o-s):0:d[u-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(i=re(e),d.length=1,t=t-i-1,d[0]=Je(10,(G-t%G)%G),e.e=lt(-t/G)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=u,i=1,u--):(d.length=u+1,i=Je(10,G-n),d[u]=s>0?(f/Je(10,o-s)%Je(10,s)|0)*i:0),l)for(;;)if(u==0){(d[0]+=i)==se&&(d[0]=1,++e.e);break}else{if(d[u]+=i,d[u]!=se)break;d[u--]=0,i=1}for(n=d.length;d[--n]===0;)d.pop();if(X&&(e.e>Gt||e.e<-Gt))throw Error(qr+re(e));return e}function Ts(e,t){var r,n,s,i,o,a,l,f,u,d,m=e.constructor,g=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),X?Z(t,g):t;if(l=e.d,d=t.d,n=t.e,f=e.e,l=l.slice(),o=f-n,o){for(u=o<0,u?(r=l,o=-o,a=d.length):(r=d,n=f,a=l.length),s=Math.max(Math.ceil(g/G),a)+2,o>s&&(o=s,r.length=1),r.reverse(),s=o;s--;)r.push(0);r.reverse()}else{for(s=l.length,a=d.length,u=s<a,u&&(a=s),s=0;s<a;s++)if(l[s]!=d[s]){u=l[s]<d[s];break}o=0}for(u&&(r=l,l=d,d=r,t.s=-t.s),a=l.length,s=d.length-a;s>0;--s)l[a++]=0;for(s=d.length;s>o;){if(l[--s]<d[s]){for(i=s;i&&l[--i]===0;)l[i]=se-1;--l[i],l[s]+=se}l[s]-=d[s]}for(;l[--a]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(t.d=l,t.e=n,X?Z(t,g):t):new m(0)}function Ye(e,t,r){var n,s=re(e),i=Ne(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+Te(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Te(-s-1)+i,r&&(n=r-o)>0&&(i+=Te(n))):s>=o?(i+=Te(s+1-o),r&&(n=r-s-1)>0&&(i=i+"."+Te(n))):((n=s+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(s+1===o&&(i+="."),i+=Te(n))),e.s<0?"-"+i:i}function En(e,t){if(e.length>t)return e.length=t,!0}function Rs(e){var t,r,n;function s(i){var o=this;if(!(o instanceof s))return new s(i);if(o.constructor=s,i instanceof s){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(ze+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return On(o,i.toString())}else if(typeof i!="string")throw Error(ze+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,qa.test(i))On(o,i);else throw Error(ze+i)}if(s.prototype=_,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=Rs,s.config=s.set=za,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return s.config(e),s}function za(e){if(!e||typeof e!="object")throw Error(ge+"Object expected");var t,r,n,s=["precision",1,at,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((n=e[r=s[t]])!==void 0)if(lt(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(ze+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ze+r+": "+n);return this}var zr=Rs(Ua);fe=new zr(1);const Za={prefix:"$",precision:2,zeroDisplay:"-",format:{minimumFractionDigits:2,maximumFractionDigits:2}};function Ga(e,t={}){const{prefix:r,precision:n,zeroDisplay:s,format:i}={...Za,...t};if(e===0)return s;const o=e.toLocaleString("en",i??{maximumFractionDigits:n});return`${r}${o}`}function Xa(e,t,r){const n=e*t;return Ga(n,r)}const Ya=(e,t,r)=>new zr(e).toDecimalPlaces(t,r).toNumber(),Zr=8,Ka=5,Qa=({fieldName:e,currencyIcon:t,currencyName:r,displayBalance:n,placeholder:s="Enter Amount",balanceDetails:i,min:o="0",step:a="any",autoFocus:l=!0})=>{const f=Hr({name:e,defaultValue:""}),{setValue:u}=Ke(),d=parseFloat(f||"0"),m=Xa(d,(i==null?void 0:i.price)??0,{zeroDisplay:"$0.00"}),g=b=>{u(e,b.target.value,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},C=b=>{(b.key==="ArrowUp"||b.key==="ArrowDown")&&b.preventDefault()},y=`Stakable: ${Ya(Number(i==null?void 0:i.balance),(i==null?void 0:i.decimals)??Zr)} ${i==null?void 0:i.symbol}`;return c.jsxs(c.Fragment,{children:[c.jsx(Ls,{name:e,defaultValue:""}),c.jsx(er,{className:"flex w-full flex-col content-center justify-between gap-4",children:c.jsx(Ja,{amount:f,currencyIcon:t,currencyName:r,placeholder:s,displayBalance:n,balanceDetails:i,min:o,step:a,autoFocus:l,onChange:g,onKeyDown:C,amountUsd:m,subtitle:y})})]})};function el({items:e,onRemove:t}){const r=v.useMemo(()=>e,[e]);return r.length===0?null:c.jsx("div",{className:"flex flex-col gap-8",children:r.map(({bsnId:n,bsnName:s,bsnLogoUrl:i,provider:o})=>c.jsx(Ur,{bsnId:n,bsnName:s,bsnLogoUrl:i,provider:o,onRemove:t},`${n}-${o.rank}`))})}function tl({max:e,items:t=[],actionText:r,onAdd:n,onRemove:s}){const i=v.useMemo(()=>t.length,[t]);return c.jsx(er,{children:c.jsxs("div",{className:"flex w-full flex-col gap-4",children:[c.jsx("div",{className:"flex flex-row",children:c.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[c.jsx("span",{className:"text-sm sm:text-base",children:r}),c.jsx(ms,{counter:i,max:e,onAdd:n})]})}),i>0&&c.jsx(el,{items:t,onRemove:s})]})})}function rr({title:e,children:t,className:r,hint:n}){return c.jsxs("div",{className:w.twMerge("flex flex-row items-center justify-between text-accent-primary",n&&"items-start",r),children:[c.jsx(H,{as:"div",variant:"body1",children:e}),n?c.jsxs("div",{className:"flex flex-col items-end",children:[c.jsx(H,{as:"div",className:"flex items-center gap-2",children:t}),c.jsx(H,{as:"div",variant:"body2",className:"text-accent-secondary",children:n})]}):c.jsx(H,{as:"div",className:"flex items-center gap-2",children:t})]})}function rl(e){return jt({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"},child:[]}]})(e)}function Ps({value:e,onEdit:t,title:r="Network Fee Rate",className:n}){return c.jsxs(rr,{title:r,className:n,children:[c.jsxs("span",{children:[e," sats/vB"]}),t&&c.jsx(Ge,{size:"small",variant:"outlined",className:"h-6 w-6 pl-1 text-secondary-strokeDark",onClick:t,children:c.jsx(rl,{size:16,className:"text-secondary-strokeDark"})})]})}function Bs({amount:e,coinSymbol:t,hint:r,title:n,className:s,decimals:i=Zr}){let o;return typeof e=="number"?e===0?o="0":o=e.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):o=e,c.jsxs(rr,{title:n??`${t} Network Fee`,hint:r,className:s,children:[o," ",t]})}function Is({amount:e,coinSymbol:t,hint:r,title:n,className:s,decimals:i=Ka}){const o=typeof e=="number"?e.toFixed(i):e;return c.jsxs(rr,{title:n??`${t} Network Fee`,hint:r,className:s,children:[o," ",t]})}function $s({total:e,coinSymbol:t,hint:r,title:n="Total",className:s,decimals:i=Zr}){let o;return typeof e=="number"?e===0?o="0":o=e.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):o=e,c.jsxs("div",{className:w.twMerge("flex flex-row items-start justify-between text-accent-primary",s),children:[c.jsx(H,{variant:"body1",className:"font-bold",children:n}),c.jsxs("div",{className:"flex flex-col items-end justify-center",children:[c.jsxs(H,{variant:"body1",className:"font-bold",children:[o," ",t]}),r&&c.jsx(H,{variant:"body1",className:"text-sm text-accent-secondary",children:r})]})]})}function nl({className:e,feeRate:t,onFeeRateEdit:r,feeAmount:n,coinSymbol:s,feeAmountHint:i,total:o,totalHint:a,bbnFeeAmount:l,bbnCoinSymbol:f,bbnFeeAmountHint:u,bbnFeeDecimals:d}){return c.jsx(er,{className:w.twMerge("flex w-full flex-col content-center justify-between gap-4",e),children:c.jsxs("div",{className:"flex flex-col gap-6 p-4",children:[c.jsx(Ps,{value:t,onEdit:r}),c.jsx(Bs,{amount:n,coinSymbol:s,hint:i}),l!==void 0&&f?c.jsx(Is,{amount:l,coinSymbol:f,hint:u,decimals:d}):null,c.jsx("div",{className:"divider my-4"}),c.jsx($s,{total:o,coinSymbol:s,hint:a})]})})}const Fn=e=>{let t="";for(let r=0;r<e.length;r++){const n=e[r].toLowerCase();n>="a"&&n<="z"||n>="0"&&n<="9"?t+=n:t.length>0&&t[t.length-1]!=="-"&&(t+="-")}return t.endsWith("-")&&(t=t.slice(0,-1)),t},sl=640;function il({className:e,...t}){const n=Mr(sl)?Fr:Kn;return c.jsx(n,{...t,className:w.twMerge("w-[41.25rem] max-w-full",e)})}const ol=({open:e,processing:t=!1,onClose:r,onProceed:n,bsns:s,finalityProviders:i,details:o})=>{const a=[{label:"Stake Amount",value:o.stakeAmount},{label:"Fee Rate",value:o.feeRate},{label:"Transaction Fees",value:o.transactionFees},{label:"Term",value:c.jsxs(c.Fragment,{children:[o.term.blocks,c.jsx("br",{}),c.jsx("span",{className:"text-md text-secondary",children:o.term.duration})]})},{label:"Unbonding",value:o.unbonding},{label:"Unbonding Fee",value:o.unbondingFee}];return c.jsxs(il,{open:e,onClose:r,children:[c.jsx(ns,{title:"Preview",onClose:r,className:"text-accent-primary"}),c.jsxs(ss,{className:"no-scrollbar mb-8 mt-4 flex max-h-[calc(100vh-12rem)] flex-col gap-4 overflow-y-auto text-accent-primary",children:[c.jsx(hs,{className:"p-6 pt-4",children:c.jsxs("div",{className:"flex flex-col",children:[s.length>1?c.jsxs("div",{className:"grid grid-cols-2 items-center gap-4 pb-4",children:[c.jsx(H,{variant:"caption",className:"text-secondary text-center",children:"BSNs"}),c.jsx(H,{variant:"caption",className:"text-secondary text-center",children:"Finality Provider"})]}):null,c.jsxs("div",{className:"grid grid-cols-2 items-center gap-4 rounded bg-primary-contrast p-4",children:[c.jsx("div",{className:"flex flex-col gap-3",children:s.map((l,f)=>c.jsxs("div",{className:"flex w-full items-center justify-center gap-2 py-1",children:[l.icon,c.jsx(H,{variant:"body2",className:"font-medium",children:l.name})]},`bsn-${Fn(l.name)}-${f}`))}),c.jsx("div",{className:"flex flex-col gap-3",children:i.map((l,f)=>c.jsxs("div",{className:"flex w-full items-center justify-center gap-2 py-1",children:[l.icon,c.jsx(H,{variant:"body2",className:"font-medium",children:l.name})]},`fp-${Fn(l.name)}-${f}`))})]})]})}),c.jsx("div",{className:"flex flex-col",children:a.map((l,f)=>c.jsxs("div",{className:"flex flex-row items-center justify-between py-3",children:[c.jsx(H,{variant:"body1",className:"text-secondary font-normal",children:l.label}),c.jsx(H,{variant:"body1",className:"text-right font-normal",children:l.value})]},f))}),c.jsx("div",{className:"border-divider w-full border-t"}),c.jsxs("div",{className:"pt-2",children:[c.jsx(Xt,{variant:"h6",className:"text-primary mb-2",children:"Attention!"}),c.jsx(H,{variant:"body2",className:"text-secondary",children:"1. No third party possesses your staked BTC. You are the only one who can unbond and withdraw your stake."}),c.jsx(H,{variant:"body2",className:"text-secondary",children:"2. Your stake will first be sent to Babylon Genesis for verification (~20 seconds), then you will be prompted to submit it to the Bitcoin ledger. It will be marked as 'Pending' until it receives 10 Bitcoin confirmations."})]})]}),c.jsxs(is,{className:"flex flex-col gap-4 pb-8 pt-0 sm:flex-row",children:[c.jsx(Ge,{variant:"contained",color:"primary",onClick:n,className:"w-full sm:flex-1 sm:order-2",disabled:t,children:t?"Processing...":"Proceed to Signing"}),c.jsx(Ge,{variant:"outlined",color:"primary",onClick:r,className:"w-full sm:flex-1 sm:order-1",children:"Cancel"})]})]})},al=({size:e="md"})=>{const t={sm:"mt-2",md:"mt-4",lg:"mt-6"};return c.jsx("div",{className:t[e]})},ll=()=>c.jsx("svg",{width:"29",height:"28",viewBox:"0 0 29 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M24.9127 15.3708C24.9711 14.9333 25.0002 14.4812 25.0002 14C25.0002 13.5333 24.9711 13.0667 24.8982 12.6292L27.8586 10.325C28.1211 10.1208 28.194 9.72708 28.0336 9.43542L25.2336 4.59375C25.0586 4.27292 24.694 4.17083 24.3732 4.27292L20.8877 5.67292C20.1586 5.11875 19.3857 4.65208 18.5252 4.30208L18.0002 0.597916C17.9419 0.247916 17.6502 0 17.3002 0H11.7002C11.3502 0 11.0732 0.247916 11.0148 0.597916L10.4898 4.30208C9.62941 4.65208 8.84191 5.13333 8.12732 5.67292L4.64191 4.27292C4.32107 4.15625 3.95649 4.27292 3.78149 4.59375L0.996075 9.43542C0.821075 9.74167 0.879408 10.1208 1.17107 10.325L4.13149 12.6292C4.05857 13.0667 4.00024 13.5479 4.00024 14C4.00024 14.4521 4.02941 14.9333 4.10232 15.3708L1.14191 17.675C0.879408 17.8792 0.806491 18.2729 0.966908 18.5646L3.76691 23.4062C3.94191 23.7271 4.30649 23.8292 4.62732 23.7271L8.11274 22.3271C8.84191 22.8812 9.61482 23.3479 10.4752 23.6979L11.0002 27.4021C11.0732 27.7521 11.3502 28 11.7002 28H17.3002C17.6502 28 17.9419 27.7521 17.9857 27.4021L18.5107 23.6979C19.3711 23.3479 20.1586 22.8812 20.8732 22.3271L24.3586 23.7271C24.6794 23.8438 25.044 23.7271 25.219 23.4062L28.019 18.5646C28.194 18.2437 28.1211 17.8792 27.844 17.675L24.9127 15.3708ZM14.5002 19.25C11.6127 19.25 9.25024 16.8875 9.25024 14C9.25024 11.1125 11.6127 8.75 14.5002 8.75C17.3877 8.75 19.7502 11.1125 19.7502 14C19.7502 16.8875 17.3877 19.25 14.5002 19.25Z",fill:"#9E9E9E"})}),Hs=()=>c.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Ws=({children:e,className:t=""})=>c.jsx(H,{variant:"body1",className:w.twJoin("px-7 pb-6 text-accent-primary md:hidden",t),children:e}),Js=({background:e="none",backgroundClassName:t="",className:r="",children:n})=>{const s=()=>{switch(e){case"secondary":return"mx-[21px] rounded-lg bg-secondary-highlight md:mx-0 md:bg-transparent";case"custom":return t;default:return""}};return c.jsx("div",{className:w.twJoin(s(),r),children:n})},ot=({children:e})=>c.jsx(c.Fragment,{children:e}),Gr=({icon:e,suffix:t,onClick:r,disabled:n=!1,selected:s=!1,className:i="",children:o})=>{const a=v.Children.toArray(o),l=a.find(m=>typeof m=="string"||v.isValidElement(m)&&m.type!==ot),f=a.find(m=>v.isValidElement(m)&&m.type===ot),u=typeof l=="string"?l:"",d=r?c.jsx(Hs,{}):void 0;return c.jsx(vs,{icon:e,name:u,description:f?f.props.children:void 0,onClick:r,disabled:n,selected:s,className:i,suffix:t||d})},Us=({icon:e,className:t="",children:r})=>{const n=v.Children.toArray(r),s=n.find(l=>typeof l=="string"||v.isValidElement(l)&&l.type!==ot),i=n.find(l=>v.isValidElement(l)&&l.type===ot),o=n.filter(l=>v.isValidElement(l)&&l.type===Gr),a=typeof s=="string"?s:"";return c.jsx(gs,{icon:e,name:a,description:i?i.props.children:void 0,className:t,suffix:c.jsx(Hs,{}),children:o})},qs=({children:e,className:t=""})=>c.jsx("div",{className:t,children:e}),cl=({trigger:e,open:t,onOpenChange:r,placement:n="bottom-end",className:s,offset:i=[0,8],children:o})=>{const a=c.jsx("button",{className:"flex h-10 w-10 items-center justify-center rounded-lg transition-colors hover:bg-accent-primary/10","aria-label":"Settings menu",children:c.jsx(ll,{})});return c.jsx(Vr,{trigger:e||a,open:t,onOpenChange:r,placement:n,className:s,offset:i,children:o})},Be=cl;Be.Title=Ws;Be.Group=Js;Be.Item=Gr;Be.SubMenu=Us;Be.Description=ot;Be.CustomContent=qs;Be.Spacer=al;const fr=({walletType:e,walletName:t,walletIcon:r,address:n,isCopied:s,onCopy:i,className:o})=>c.jsx("div",{className:w.twJoin("bg-secondary-highlight dark:bg-secondary-strokeLight rounded-[4px] p-3 flex-1 md:p-4",o),children:c.jsxs("div",{className:"flex flex-col w-full",children:[c.jsx("div",{className:"flex justify-start mb-2 md:mb-3",children:c.jsx(xt,{alt:t||e,url:r||"",size:"large",className:"w-8 h-8 md:w-10 md:h-10"})}),c.jsx("div",{className:"flex justify-start mb-[1px]",children:c.jsxs(H,{variant:"body1",className:"text-accent-secondary font-medium !text-xs",children:[e," Wallet"]})}),c.jsxs("div",{className:"flex items-center justify-between w-full",children:[c.jsx("div",{className:"flex-1 min-w-0",children:s?c.jsx(H,{className:"text-accent-primary !text-sm truncate whitespace-nowrap",children:"Copied ✓"}):c.jsx(_r,{className:"text-accent-primary !text-sm",value:n,symbols:6})}),c.jsx("button",{onClick:i,className:"flex-shrink-0 ml-3 p-1 rounded hover:bg-surface-tertiary transition-colors h-6 w-6 flex items-center justify-center hover:opacity-80",children:c.jsx(Or,{size:14,className:"md:w-4 md:h-4"})})]})]})}),zs=({value:e,onChange:t,className:r="",disabled:n=!1})=>{const s=()=>{n||t(!e)};return c.jsx("button",{type:"button",onClick:s,disabled:n,className:w.twJoin("relative inline-flex h-[31px] w-[55px] items-center rounded-full transition-colors duration-300 ease-in-out","focus:outline-none focus:ring-2 focus:ring-primary-main focus:ring-offset-2",e?"bg-primary-main dark:bg-primary-light":"bg-[#78788029]",n&&"opacity-50 cursor-not-allowed",r),style:{border:"none"},"aria-pressed":e,"aria-label":"Toggle",children:c.jsx("span",{className:w.twJoin("inline-block w-[27px] h-[27px] transform rounded-full bg-white transition-transform duration-300 ease-in-out","flex items-center justify-center shadow-sm",e?"translate-x-[26px]":"translate-x-[2px]")})})},dr=({icon:e,title:t,status:r,value:n,onChange:s,className:i})=>c.jsxs("div",{className:w.twJoin("flex items-center justify-between w-full bg-secondary-highlight dark:bg-secondary-strokeLight rounded-[4px] p-3 md:bg-transparent md:dark:bg-transparent md:p-0 md:mb-0",i),children:[c.jsxs("div",{className:"flex items-center gap-4",children:[e,c.jsxs("div",{className:"flex flex-col",children:[c.jsx(H,{variant:"body2",className:"text-accent-primary font-medium",children:t}),c.jsx(H,{className:"text-accent-secondary !text-xs",children:r})]})]}),c.jsx(zs,{value:n,onChange:s})]}),Zs=({title:e,value:t,isCopied:r,onCopy:n,className:s,icon:i})=>c.jsx("div",{className:w.twJoin("flex items-center justify-between w-full bg-secondary-highlight dark:bg-secondary-strokeLight rounded-[4px] p-3 md:bg-transparent md:dark:bg-transparent md:p-0 md:mb-0",s),children:c.jsx("div",{className:"flex flex-col w-full",children:c.jsxs("div",{className:"flex items-center gap-4 mb-3",children:[i&&c.jsx("div",{className:"flex-shrink-0",children:i}),c.jsxs("div",{className:"flex w-full",children:[c.jsxs("div",{className:"flex flex-col w-full",children:[c.jsx(H,{variant:"body2",className:"text-accent-primary font-medium text-xs",children:e}),c.jsx("div",{className:"flex items-center justify-between w-full",children:c.jsx("div",{className:"flex-1 min-w-0",children:r?c.jsx(H,{className:"text-accent-secondary !text-xs truncate whitespace-nowrap",children:"Copied ✓"}):c.jsx(_r,{className:"text-accent-secondary !text-xs",value:t,symbols:6})})})]}),c.jsx("button",{onClick:n,className:"flex-shrink-0 ml-3 p-1 rounded hover:bg-surface-tertiary transition-colors h-6 w-6 flex items-center justify-center hover:opacity-80 self-center",children:c.jsx(Or,{size:16})})]})]})})}),ul=({trigger:e,btcAddress:t,bbnAddress:r,selectedWallets:n,ordinalsExcluded:s,linkedDelegationsVisibility:i,onIncludeOrdinals:o,onExcludeOrdinals:a,onDisplayLinkedDelegations:l,publicKeyNoCoord:f,onDisconnect:u,forceOpen:d=!1,onOpenChange:m})=>{var D,O,F,A;const{copyToClipboard:g,isCopied:C}=Dr(),[y,b]=v.useState(d),M=v.useCallback(k=>{b(k),m==null||m(k)},[m]),j=v.useCallback(()=>{b(!1),u()},[u]);return c.jsx(Vr,{trigger:e,open:y,onOpenChange:M,mobileMode:"dialog",className:"shadow-lg border border-[#38708533] bg-[#FFFFFF] dark:bg-[#252525] dark:border-[#404040] rounded-lg",children:c.jsxs("div",{className:"p-4 space-y-6 w-full text-primary-main",children:[c.jsxs("div",{className:"flex flex-row gap-2 w-full md:flex-col overflow-x-auto",children:[c.jsx(fr,{walletType:"Bitcoin",walletName:(D=n.BTC)==null?void 0:D.name,walletIcon:(O=n.BTC)==null?void 0:O.icon,address:t,isCopied:C("btc"),onCopy:()=>g("btc",t)}),c.jsx(fr,{walletType:"Babylon",walletName:(F=n.BBN)==null?void 0:F.name,walletIcon:(A=n.BBN)==null?void 0:A.icon,address:r,isCopied:C("bbn"),onCopy:()=>g("bbn",r)})]}),c.jsxs("div",{className:"flex flex-col gap-8 w-full",children:[c.jsx(dr,{icon:c.jsx(ts,{}),title:"Using Inscriptions",status:s?"Off":"On",value:!s,onChange:k=>k?o():a()}),c.jsx(dr,{icon:c.jsx(es,{}),title:"Linked Wallet Stakes",status:i?"On":"Off",value:i,onChange:l}),c.jsx(Zs,{title:"Bitcoin Public Key",value:f,isCopied:C("publicKey"),onCopy:()=>g("publicKey",f),icon:c.jsx(Qn,{})})]}),c.jsx("div",{className:"pt-2",children:c.jsx(pr,{onClick:j,fluid:!0,children:"Disconnect Wallets"})})]})})},fl={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function dl({className:e,orientation:t="vertical",children:r}){return c.jsx("div",{className:w.twMerge("bbn-list-legacy",`bbn-list-legacy-${t}`,e),children:v.Children.map(r,n=>v.isValidElement(n)?v.cloneElement(n,{orientation:fl[t]}):n)})}function hl({className:e,orientation:t="horizontal",title:r,value:n,suffix:s}){return c.jsxs("div",{className:w.twJoin("bbn-list-item-legacy",`bbn-list-item-legacy-${t}`,e),children:[c.jsx(H,{as:"div",className:w.twJoin("bbn-list-title-legacy",`bbn-list-title-legacy-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),c.jsxs(H,{as:"div",className:w.twJoin("bbn-list-value-legacy",`bbn-list-value-legacy-${t}`),variant:"body1",children:[n,s]})]})}exports.Accordion=Qs;exports.AccordionDetails=ri;exports.AccordionSummary=ei;exports.AmountSubsection=Qa;exports.Avatar=xt;exports.AvatarGroup=ni;exports.BBNFeeAmount=Is;exports.BTCFeeAmount=Bs;exports.BTCFeeRate=Ps;exports.Badge=aa;exports.BitcoinPublicKeyIcon=Qn;exports.Button=Ge;exports.Card=hs;exports.Cell=ds;exports.Checkbox=Vn;exports.CheckboxField=Ba;exports.Chip=_o;exports.CloseIcon=rs;exports.Column=us;exports.Copy=da;exports.CopyIcon=Or;exports.CounterButton=ms;exports.Dialog=Kn;exports.DialogBody=ss;exports.DialogFooter=is;exports.DialogHeader=ns;exports.DisplayHash=_r;exports.FeeItem=rr;exports.FeesSection=nl;exports.FinalityProviderItem=Ur;exports.FinalityProviderLogo=Ms;exports.FinalityProviderSubsection=tl;exports.Form=_a;exports.FormControl=St;exports.Heading=Xt;exports.HiddenField=Ls;exports.IconButton=mr;exports.Input=Kt;exports.LinkWalletIcon=es;exports.List=ia;exports.ListItem=oa;exports.ListItemLegacy=hl;exports.ListLegacy=dl;exports.Loader=Do;exports.Menu=Vr;exports.MenuDrawer=Lr;exports.MenuItem=vs;exports.MobileDialog=Fr;exports.NumberField=Ra;exports.Popover=Nr;exports.Portal=kt;exports.PreviewModal=ol;exports.Radio=_n;exports.RadioField=Ia;exports.ScrollLocker=Vo;exports.Select=kr;exports.SelectField=$a;exports.SettingMenu=Be;exports.SettingMenuCustomContent=qs;exports.SettingMenuDescription=ot;exports.SettingMenuGroup=Js;exports.SettingMenuItem=Gr;exports.SettingMenuSubMenu=Us;exports.SettingMenuTitle=Ws;exports.SubMenu=gs;exports.SubMenuItem=ua;exports.SubSection=er;exports.Table=ra;exports.TableElement=Wa;exports.Text=H;exports.TextField=Pa;exports.ThemedIcon=Qt;exports.Toggle=na;exports.Total=$s;exports.UsingInscriptionIcon=ts;exports.WalletDisconnectButton=pr;exports.WalletInfoCard=fr;exports.WalletInfoSection=Zs;exports.WalletMenu=ul;exports.WalletSettingItem=dr;exports.WalletToggle=zs;exports.iconColorVariants=Er;exports.useClickOutside=Zn;exports.useControlledState=Ze;exports.useCopy=Dr;exports.useField=Qe;exports.useFieldState=Da;exports.useFormContext=Ke;exports.useFormState=$r;exports.useIsMobile=Mr;exports.useMemoizedArray=zn;exports.useMenuContext=Ar;exports.useModalManager=Sr;exports.useResizeObserver=Gn;exports.useTableScroll=ls;exports.useTableSort=fs;exports.useWatch=Hr;
2
2
  //# sourceMappingURL=index.cjs.js.map