@babylonlabs-io/core-ui 1.30.0 → 1.31.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/components/Icons/common/ThemeIcon.d.ts +2 -0
- package/dist/components/Icons/common/ThemeIcon.js +7 -0
- package/dist/components/Icons/index.d.ts +1 -0
- package/dist/components/Icons/index.js +1 -0
- package/dist/components/Menu/MenuItem.d.ts +14 -0
- package/dist/components/Menu/MenuItem.js +14 -7
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1011 -971
- package/dist/index.es.js.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/widgets/sections/SettingMenu/SettingMenu.stories.d.ts +1 -0
- package/dist/widgets/sections/SettingMenu/SettingMenu.stories.js +15 -1
- package/dist/widgets/sections/SettingMenu/components/SettingMenuItem.d.ts +15 -0
- package/dist/widgets/sections/SettingMenu/components/SettingMenuItem.js +3 -3
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),p=require("react"),j=require("tailwind-merge"),Rn=require("react-dom");function Bn(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 qe=Bn(p),gi=Bn(Rn);function Ye({value:e,defaultValue:t,onStateChange:r}={}){const[n,s]=p.useState(t),{current:i}=p.useRef(e!=null),l=i?e:n,a=p.useCallback(c=>{i||s(c),r==null||r(c)},[i,r,s]);return[l,a]}const Sr=p.createContext({disabled:!1,expanded:!1});function bi({expanded:e,defaultExpanded:t,onChange:r,className:n,disabled:s=!1,fluid:i=!1,children:l}){const[a=!1,c]=Ye({value:e,defaultValue:t,onStateChange:r}),f=p.useCallback(()=>{c(!a)},[c,a]),u=p.useMemo(()=>({defaultExpanded:t,disabled:s,expanded:a&&!s,toggle:s?void 0:f}),[t,a,s,f]);return o.jsx(Sr.Provider,{value:u,children:o.jsx("div",{className:j.twJoin("bbn-accordion",s&&"bbn-accordion-disabled",i&&"bbn-accordion-fluid",n),children:l})})}const ue=p.forwardRef(({variant:e="contained",size:t="large",color:r="primary",fluid:n=!1,className:s,disabled:i,...l},a)=>o.jsx("button",{...l,disabled:i,ref:a,className:j.twJoin("bbn-btn",`bbn-btn-${e}`,`bbn-btn-${r}`,`bbn-btn-${t}`,n&&"bbn-btn-fluid",s)}));ue.displayName="Button";const kr=p.forwardRef(({variant:e="outlined",size:t="large",className:r,...n},s)=>o.jsx("button",{...n,ref:s,className:j.twJoin("bbn-btn-icon",`bbn-btn-icon-${e}`,`bbn-btn-icon-${t}`,r)})),Er=p.forwardRef(({className:e,...t},r)=>o.jsx(ue,{...t,ref:r,variant:"contained",className:j.twJoin("!bg-error-main text-white font-medium !text-sm hover:!bg-error-main/90 transition-colors",e)}));Er.displayName="WalletDisconnectButton";function yi({className:e,iconClassName:t,iconProps:r,children:n,renderIcon:s=()=>null}){const{expanded:i,toggle:l}=p.useContext(Sr),a=s(i);return o.jsxs("div",{className:j.twJoin("bbn-accordion-summary",e),onClick:l,children:[n,a&&o.jsx(kr,{className:j.twJoin("bbn-accordion-icon",t),...r,children:a})]})}function Or(e,t){return typeof e!="number"?typeof t=="number"?Or(t):t:`${e}px`}function wi(e=!0){const[t,r]=p.useState("0px"),[n,s]=p.useState(),i=p.useRef(null);return p.useEffect(()=>{const l=new ResizeObserver(a=>{const[c]=a;r(Or(c.target.clientHeight)??"0px")});s(l)},[]),p.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 ji({unmountOnExit:e=!1,animationDuration:t=200,className:r,wrapperClassName:n,children:s}){const{expanded:i}=p.useContext(Sr),[l,a]=p.useState(i),c=l||!e,{height:f,ref:u}=wi(c);return p.useEffect(function(){if(i===l)return;if(i){a(!0);return}const m=setTimeout(a,t,!1);return()=>{clearTimeout(m)}},[i,l,t]),o.jsx("div",{className:j.twJoin("bbn-accordion-details",n),style:{height:i?f:"0px",visibility:l?"visible":"hidden",transitionDuration:`${t}ms`},children:c?o.jsx("div",{ref:u,className:j.twJoin("bbn-accordion-content",r),children:s}):null})}const H=p.forwardRef(({variant:e="body1",as:t="p",children:r,className:n,...s},i)=>p.createElement(t,{...s,ref:i,className:j.twJoin(`bbn-text-${e}`,n)},r));H.displayName="Text";const ir=p.forwardRef(({variant:e,as:t=e,children:r,className:n,...s},i)=>p.createElement(t,{...s,ref:i,className:j.twJoin(`bbn-${e}`,n)},r));ir.displayName="Heading";function ot({className:e,style:t,size:r="large",variant:n="circular",alt:s,url:i,children:l}){return o.jsx("div",{style:t,className:j.twJoin("bbn-avatar",`bbn-avatar-${r}`,`bbn-avatar-${n}`,e),children:i?o.jsx("img",{className:"bbn-avatar-img",src:i,alt:s}):l})}const Ci=({max:e=1/0,className:t,children:r,avatarClassName:n,variant:s,...i})=>{const l=p.Children.count(r);return o.jsxs("div",{className:j.twJoin("bbn-avatar-group",t),children:[p.Children.map(r,(a,c)=>p.isValidElement(a)&&c+1<=e?p.cloneElement(a,{...i,className:j.twMerge(n,a.props.className),variant:s}):null),l>e&&o.jsxs(ot,{size:i.size,variant:s,className:n,children:["+",l-e]})]})};function Ni({url:e,name:t,variant:r="rounded",size:n="large",...s}){return o.jsx(ot,{...s,url:e,alt:t,variant:r,size:n,children:o.jsx(H,{as:"span",className:"inline-flex h-full w-full items-center justify-center bg-secondary-main text-xs text-accent-contrast",children:(t==null?void 0:t.charAt(0).toUpperCase())||"?"})})}const Pn=p.forwardRef(function({label:t,checked:r,defaultChecked:n=!1,inputProps:s,orientation:i="left",disabled:l=!1,className:a,inputType:c,labelClassName:f,renderIcon:u,onChange:d,...m},x){const[C=!1,g]=Ye({value:r,defaultValue:n,onStateChange:d});function y(w){var M;g(w.currentTarget.checked),(M=s==null?void 0:s.onChange)==null||M.call(s,w)}const V=o.jsxs("span",{className:j.twJoin("bbn-switcher",l&&"bbn-switcher-disabled",a),children:[u(C),o.jsx("input",{ref:x,type:c,disabled:l,className:"bbn-switcher-input",...m,...s,checked:C,onChange:y})]});return t?o.jsxs(H,{as:"label",variant:"body1",className:j.twJoin("bbn-switcher-label",i==="left"?"bbn-switcher-left":"bbn-switcher-right",f),children:[V,t]}):V}),Si={false:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.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:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.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"})})},$n=p.forwardRef(function(t,r){return o.jsx(Pn,{ref:r,...t,inputType:"checkbox",renderIcon:n=>Si[n.toString()]})}),ki={true:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.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:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.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"})})},Hn=p.forwardRef(function(t,r){return o.jsx(Pn,{ref:r,...t,inputType:"radio",renderIcon:n=>ki[n.toString()]})});var Wn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ln=p.createContext&&p.createContext(Wn),Ei=["attr","size","title"];function Oi(e,t){if(e==null)return{};var r=Ai(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 Ai(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 Xt(){return Xt=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},Xt.apply(this,arguments)}function cn(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 Yt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cn(Object(r),!0).forEach(function(n){Fi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fi(e,t,r){return t=Li(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Li(e){var t=Mi(e,"string");return typeof t=="symbol"?t:t+""}function Mi(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 Jn(e){return e&&e.map((t,r)=>p.createElement(t.tag,Yt({key:r},t.attr),Jn(t.child)))}function Re(e){return t=>p.createElement(Vi,Xt({attr:Yt({},e.attr)},t),Jn(e.child))}function Vi(e){var t=r=>{var{attr:n,size:s,title:i}=e,l=Oi(e,Ei),a=s||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),p.createElement("svg",Xt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,l,{className:c,style:Yt(Yt({color:e.color||r.color},r.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),i&&p.createElement("title",null,i),e.children)};return ln!==void 0?p.createElement(ln.Consumer,null,r=>t(r)):t(Wn)}function Di(e){return Re({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 16L6 10H18L12 16Z"},child:[]}]})(e)}function Ti(e){return Re({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 _i(e){return Re({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 8L18 14H6L12 8Z"},child:[]}]})(e)}function Ii(e){return Re({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"},child:[]}]})(e)}var un=function(t){return t.reduce(function(r,n){var s=n[0],i=n[1];return r[s]=i,r},{})},fn=typeof window<"u"&&window.document&&window.document.createElement?qe.useLayoutEffect:qe.useEffect,le="top",ve="bottom",xe="right",ce="left",Ar="auto",Ot=[le,ve,xe,ce],at="start",St="end",Ri="clippingParents",Un="viewport",gt="popper",Bi="reference",dn=Ot.reduce(function(e,t){return e.concat([t+"-"+at,t+"-"+St])},[]),zn=[].concat(Ot,[Ar]).reduce(function(e,t){return e.concat([t,t+"-"+at,t+"-"+St])},[]),Pi="beforeRead",$i="read",Hi="afterRead",Wi="beforeMain",Ji="main",Ui="afterMain",zi="beforeWrite",qi="write",Zi="afterWrite",Gi=[Pi,$i,Hi,Wi,Ji,Ui,zi,qi,Zi];function Ee(e){return e?(e.nodeName||"").toLowerCase():null}function he(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ke(e){var t=he(e).Element;return e instanceof t||e instanceof Element}function pe(e){var t=he(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Fr(e){if(typeof ShadowRoot>"u")return!1;var t=he(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Xi(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];!pe(i)||!Ee(i)||(Object.assign(i.style,n),Object.keys(s).forEach(function(l){var a=s[l];a===!1?i.removeAttribute(l):i.setAttribute(l,a===!0?"":a)}))})}function Yi(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]||{},l=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),a=l.reduce(function(c,f){return c[f]="",c},{});!pe(s)||!Ee(s)||(Object.assign(s.style,a),Object.keys(i).forEach(function(c){s.removeAttribute(c)}))})}}const Ki={name:"applyStyles",enabled:!0,phase:"write",fn:Xi,effect:Yi,requires:["computeStyles"]};function ke(e){return e.split("-")[0]}var Ge=Math.max,Kt=Math.min,lt=Math.round;function br(){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 qn(){return!/^((?!chrome|android).)*safari/i.test(br())}function ct(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),s=1,i=1;t&&pe(e)&&(s=e.offsetWidth>0&<(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&<(n.height)/e.offsetHeight||1);var l=Ke(e)?he(e):window,a=l.visualViewport,c=!qn()&&r,f=(n.left+(c&&a?a.offsetLeft:0))/s,u=(n.top+(c&&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 Lr(e){var t=ct(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 Zn(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Fr(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 he(e).getComputedStyle(e)}function Qi(e){return["table","td","th"].indexOf(Ee(e))>=0}function Be(e){return((Ke(e)?e.ownerDocument:e.document)||window.document).documentElement}function or(e){return Ee(e)==="html"?e:e.assignedSlot||e.parentNode||(Fr(e)?e.host:null)||Be(e)}function hn(e){return!pe(e)||Ve(e).position==="fixed"?null:e.offsetParent}function eo(e){var t=/firefox/i.test(br()),r=/Trident/i.test(br());if(r&&pe(e)){var n=Ve(e);if(n.position==="fixed")return null}var s=or(e);for(Fr(s)&&(s=s.host);pe(s)&&["html","body"].indexOf(Ee(s))<0;){var i=Ve(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 At(e){for(var t=he(e),r=hn(e);r&&Qi(r)&&Ve(r).position==="static";)r=hn(r);return r&&(Ee(r)==="html"||Ee(r)==="body"&&Ve(r).position==="static")?t:r||eo(e)||t}function Mr(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function wt(e,t,r){return Ge(e,Kt(t,r))}function to(e,t,r){var n=wt(e,t,r);return n>r?r:n}function Gn(){return{top:0,right:0,bottom:0,left:0}}function Xn(e){return Object.assign({},Gn(),e)}function Yn(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var ro=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Xn(typeof t!="number"?t:Yn(t,Ot))};function no(e){var t,r=e.state,n=e.name,s=e.options,i=r.elements.arrow,l=r.modifiersData.popperOffsets,a=ke(r.placement),c=Mr(a),f=[ce,xe].indexOf(a)>=0,u=f?"height":"width";if(!(!i||!l)){var d=ro(s.padding,r),m=Lr(i),x=c==="y"?le:ce,C=c==="y"?ve:xe,g=r.rects.reference[u]+r.rects.reference[c]-l[c]-r.rects.popper[u],y=l[c]-r.rects.reference[c],V=At(i),w=V?c==="y"?V.clientHeight||0:V.clientWidth||0:0,M=g/2-y/2,S=d[x],k=w-m[u]-d[C],O=w/2-m[u]/2+M,T=wt(S,O,k),B=c;r.modifiersData[n]=(t={},t[B]=T,t.centerOffset=T-O,t)}}function so(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)||Zn(t.elements.popper,s)&&(t.elements.arrow=s))}const io={name:"arrow",enabled:!0,phase:"main",fn:no,effect:so,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ut(e){return e.split("-")[1]}var oo={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ao(e,t){var r=e.x,n=e.y,s=t.devicePixelRatio||1;return{x:lt(r*s)/s||0,y:lt(n*s)/s||0}}function mn(e){var t,r=e.popper,n=e.popperRect,s=e.placement,i=e.variation,l=e.offsets,a=e.position,c=e.gpuAcceleration,f=e.adaptive,u=e.roundOffsets,d=e.isFixed,m=l.x,x=m===void 0?0:m,C=l.y,g=C===void 0?0:C,y=typeof u=="function"?u({x,y:g}):{x,y:g};x=y.x,g=y.y;var V=l.hasOwnProperty("x"),w=l.hasOwnProperty("y"),M=ce,S=le,k=window;if(f){var O=At(r),T="clientHeight",B="clientWidth";if(O===he(r)&&(O=Be(r),Ve(O).position!=="static"&&a==="absolute"&&(T="scrollHeight",B="scrollWidth")),O=O,s===le||(s===ce||s===xe)&&i===St){S=ve;var R=d&&O===k&&k.visualViewport?k.visualViewport.height:O[T];g-=R-n.height,g*=c?1:-1}if(s===ce||(s===le||s===ve)&&i===St){M=xe;var $=d&&O===k&&k.visualViewport?k.visualViewport.width:O[B];x-=$-n.width,x*=c?1:-1}}var A=Object.assign({position:a},f&&oo),L=u===!0?ao({x,y:g},he(r)):{x,y:g};if(x=L.x,g=L.y,c){var P;return Object.assign({},A,(P={},P[S]=w?"0":"",P[M]=V?"0":"",P.transform=(k.devicePixelRatio||1)<=1?"translate("+x+"px, "+g+"px)":"translate3d("+x+"px, "+g+"px, 0)",P))}return Object.assign({},A,(t={},t[S]=w?g+"px":"",t[M]=V?x+"px":"",t.transform="",t))}function lo(e){var t=e.state,r=e.options,n=r.gpuAcceleration,s=n===void 0?!0:n,i=r.adaptive,l=i===void 0?!0:i,a=r.roundOffsets,c=a===void 0?!0:a,f={placement:ke(t.placement),variation:ut(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,mn(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,mn(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const co={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:lo,data:{}};var Ut={passive:!0};function uo(e){var t=e.state,r=e.instance,n=e.options,s=n.scroll,i=s===void 0?!0:s,l=n.resize,a=l===void 0?!0:l,c=he(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach(function(u){u.addEventListener("scroll",r.update,Ut)}),a&&c.addEventListener("resize",r.update,Ut),function(){i&&f.forEach(function(u){u.removeEventListener("scroll",r.update,Ut)}),a&&c.removeEventListener("resize",r.update,Ut)}}const fo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:uo,data:{}};var ho={left:"right",right:"left",bottom:"top",top:"bottom"};function qt(e){return e.replace(/left|right|bottom|top/g,function(t){return ho[t]})}var mo={start:"end",end:"start"};function pn(e){return e.replace(/start|end/g,function(t){return mo[t]})}function Vr(e){var t=he(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Dr(e){return ct(Be(e)).left+Vr(e).scrollLeft}function po(e,t){var r=he(e),n=Be(e),s=r.visualViewport,i=n.clientWidth,l=n.clientHeight,a=0,c=0;if(s){i=s.width,l=s.height;var f=qn();(f||!f&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:l,x:a+Dr(e),y:c}}function vo(e){var t,r=Be(e),n=Vr(e),s=(t=e.ownerDocument)==null?void 0:t.body,i=Ge(r.scrollWidth,r.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),l=Ge(r.scrollHeight,r.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Dr(e),c=-n.scrollTop;return Ve(s||r).direction==="rtl"&&(a+=Ge(r.clientWidth,s?s.clientWidth:0)-i),{width:i,height:l,x:a,y:c}}function Tr(e){var t=Ve(e),r=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+s+n)}function Kn(e){return["html","body","#document"].indexOf(Ee(e))>=0?e.ownerDocument.body:pe(e)&&Tr(e)?e:Kn(or(e))}function jt(e,t){var r;t===void 0&&(t=[]);var n=Kn(e),s=n===((r=e.ownerDocument)==null?void 0:r.body),i=he(n),l=s?[i].concat(i.visualViewport||[],Tr(n)?n:[]):n,a=t.concat(l);return s?a:a.concat(jt(or(l)))}function yr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function xo(e,t){var r=ct(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 vn(e,t,r){return t===Un?yr(po(e,r)):Ke(t)?xo(t,r):yr(vo(Be(e)))}function go(e){var t=jt(or(e)),r=["absolute","fixed"].indexOf(Ve(e).position)>=0,n=r&&pe(e)?At(e):e;return Ke(n)?t.filter(function(s){return Ke(s)&&Zn(s,n)&&Ee(s)!=="body"}):[]}function bo(e,t,r,n){var s=t==="clippingParents"?go(e):[].concat(t),i=[].concat(s,[r]),l=i[0],a=i.reduce(function(c,f){var u=vn(e,f,n);return c.top=Ge(u.top,c.top),c.right=Kt(u.right,c.right),c.bottom=Kt(u.bottom,c.bottom),c.left=Ge(u.left,c.left),c},vn(e,l,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Qn(e){var t=e.reference,r=e.element,n=e.placement,s=n?ke(n):null,i=n?ut(n):null,l=t.x+t.width/2-r.width/2,a=t.y+t.height/2-r.height/2,c;switch(s){case le:c={x:l,y:t.y-r.height};break;case ve:c={x:l,y:t.y+t.height};break;case xe:c={x:t.x+t.width,y:a};break;case ce:c={x:t.x-r.width,y:a};break;default:c={x:t.x,y:t.y}}var f=s?Mr(s):null;if(f!=null){var u=f==="y"?"height":"width";switch(i){case at:c[f]=c[f]-(t[u]/2-r[u]/2);break;case St:c[f]=c[f]+(t[u]/2-r[u]/2);break}}return c}function kt(e,t){t===void 0&&(t={});var r=t,n=r.placement,s=n===void 0?e.placement:n,i=r.strategy,l=i===void 0?e.strategy:i,a=r.boundary,c=a===void 0?Ri:a,f=r.rootBoundary,u=f===void 0?Un:f,d=r.elementContext,m=d===void 0?gt:d,x=r.altBoundary,C=x===void 0?!1:x,g=r.padding,y=g===void 0?0:g,V=Xn(typeof y!="number"?y:Yn(y,Ot)),w=m===gt?Bi:gt,M=e.rects.popper,S=e.elements[C?w:m],k=bo(Ke(S)?S:S.contextElement||Be(e.elements.popper),c,u,l),O=ct(e.elements.reference),T=Qn({reference:O,element:M,placement:s}),B=yr(Object.assign({},M,T)),R=m===gt?B:O,$={top:k.top-R.top+V.top,bottom:R.bottom-k.bottom+V.bottom,left:k.left-R.left+V.left,right:R.right-k.right+V.right},A=e.modifiersData.offset;if(m===gt&&A){var L=A[s];Object.keys($).forEach(function(P){var J=[xe,ve].indexOf(P)>=0?1:-1,Y=[le,ve].indexOf(P)>=0?"y":"x";$[P]+=L[Y]*J})}return $}function yo(e,t){t===void 0&&(t={});var r=t,n=r.placement,s=r.boundary,i=r.rootBoundary,l=r.padding,a=r.flipVariations,c=r.allowedAutoPlacements,f=c===void 0?zn:c,u=ut(n),d=u?a?dn:dn.filter(function(C){return ut(C)===u}):Ot,m=d.filter(function(C){return f.indexOf(C)>=0});m.length===0&&(m=d);var x=m.reduce(function(C,g){return C[g]=kt(e,{placement:g,boundary:s,rootBoundary:i,padding:l})[ke(g)],C},{});return Object.keys(x).sort(function(C,g){return x[C]-x[g]})}function wo(e){if(ke(e)===Ar)return[];var t=qt(e);return[pn(e),t,pn(t)]}function jo(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,l=r.altAxis,a=l===void 0?!0:l,c=r.fallbackPlacements,f=r.padding,u=r.boundary,d=r.rootBoundary,m=r.altBoundary,x=r.flipVariations,C=x===void 0?!0:x,g=r.allowedAutoPlacements,y=t.options.placement,V=ke(y),w=V===y,M=c||(w||!C?[qt(y)]:wo(y)),S=[y].concat(M).reduce(function(De,be){return De.concat(ke(be)===Ar?yo(t,{placement:be,boundary:u,rootBoundary:d,padding:f,flipVariations:C,allowedAutoPlacements:g}):be)},[]),k=t.rects.reference,O=t.rects.popper,T=new Map,B=!0,R=S[0],$=0;$<S.length;$++){var A=S[$],L=ke(A),P=ut(A)===at,J=[le,ve].indexOf(L)>=0,Y=J?"width":"height",q=kt(t,{placement:A,boundary:u,rootBoundary:d,altBoundary:m,padding:f}),K=J?P?xe:ce:P?ve:le;k[Y]>O[Y]&&(K=qt(K));var je=qt(K),oe=[];if(i&&oe.push(q[L]<=0),a&&oe.push(q[K]<=0,q[je]<=0),oe.every(function(De){return De})){R=A,B=!1;break}T.set(A,oe)}if(B)for(var Ae=C?3:1,st=function(be){var Je=S.find(function(Te){var Ce=T.get(Te);if(Ce)return Ce.slice(0,be).every(function(Ue){return Ue})});if(Je)return R=Je,"break"},He=Ae;He>0;He--){var We=st(He);if(We==="break")break}t.placement!==R&&(t.modifiersData[n]._skip=!0,t.placement=R,t.reset=!0)}}const Co={name:"flip",enabled:!0,phase:"main",fn:jo,requiresIfExists:["offset"],data:{_skip:!1}};function xn(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 gn(e){return[le,xe,ve,ce].some(function(t){return e[t]>=0})}function No(e){var t=e.state,r=e.name,n=t.rects.reference,s=t.rects.popper,i=t.modifiersData.preventOverflow,l=kt(t,{elementContext:"reference"}),a=kt(t,{altBoundary:!0}),c=xn(l,n),f=xn(a,s,i),u=gn(c),d=gn(f);t.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const So={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:No};function ko(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,l=i[0],a=i[1];return l=l||0,a=(a||0)*s,[ce,xe].indexOf(n)>=0?{x:a,y:l}:{x:l,y:a}}function Eo(e){var t=e.state,r=e.options,n=e.name,s=r.offset,i=s===void 0?[0,0]:s,l=zn.reduce(function(u,d){return u[d]=ko(d,t.rects,i),u},{}),a=l[t.placement],c=a.x,f=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=f),t.modifiersData[n]=l}const Oo={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Eo};function Ao(e){var t=e.state,r=e.name;t.modifiersData[r]=Qn({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Fo={name:"popperOffsets",enabled:!0,phase:"read",fn:Ao,data:{}};function Lo(e){return e==="x"?"y":"x"}function Mo(e){var t=e.state,r=e.options,n=e.name,s=r.mainAxis,i=s===void 0?!0:s,l=r.altAxis,a=l===void 0?!1:l,c=r.boundary,f=r.rootBoundary,u=r.altBoundary,d=r.padding,m=r.tether,x=m===void 0?!0:m,C=r.tetherOffset,g=C===void 0?0:C,y=kt(t,{boundary:c,rootBoundary:f,padding:d,altBoundary:u}),V=ke(t.placement),w=ut(t.placement),M=!w,S=Mr(V),k=Lo(S),O=t.modifiersData.popperOffsets,T=t.rects.reference,B=t.rects.popper,R=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,$=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(O){if(i){var P,J=S==="y"?le:ce,Y=S==="y"?ve:xe,q=S==="y"?"height":"width",K=O[S],je=K+y[J],oe=K-y[Y],Ae=x?-B[q]/2:0,st=w===at?T[q]:B[q],He=w===at?-B[q]:-T[q],We=t.elements.arrow,De=x&&We?Lr(We):{width:0,height:0},be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Gn(),Je=be[J],Te=be[Y],Ce=wt(0,T[q],De[q]),Ue=M?T[q]/2-Ae-Ce-Je-$.mainAxis:st-Ce-Je-$.mainAxis,vt=M?-T[q]/2+Ae+Ce+Te+$.mainAxis:He+Ce+Te+$.mainAxis,xt=t.elements.arrow&&At(t.elements.arrow),It=xt?S==="y"?xt.clientTop||0:xt.clientLeft||0:0,Rt=(P=A==null?void 0:A[S])!=null?P:0,Bt=K+Ue-Rt-It,Pt=K+vt-Rt,$t=wt(x?Kt(je,Bt):je,K,x?Ge(oe,Pt):oe);O[S]=$t,L[S]=$t-K}if(a){var Ht,sn=S==="x"?le:ce,Wt=S==="x"?ve:xe,h=O[k],v=k==="y"?"height":"width",b=h+y[sn],D=h-y[Wt],E=[le,ce].indexOf(V)!==-1,N=(Ht=A==null?void 0:A[k])!=null?Ht:0,I=E?b:h-T[v]-B[v]-N+$.altAxis,W=E?h+T[v]+B[v]-N-$.altAxis:D,U=x&&E?to(I,h,W):wt(x?I:b,h,x?W:D);O[k]=U,L[k]=U-h}t.modifiersData[n]=L}}const Vo={name:"preventOverflow",enabled:!0,phase:"main",fn:Mo,requiresIfExists:["offset"]};function Do(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function To(e){return e===he(e)||!pe(e)?Vr(e):Do(e)}function _o(e){var t=e.getBoundingClientRect(),r=lt(t.width)/e.offsetWidth||1,n=lt(t.height)/e.offsetHeight||1;return r!==1||n!==1}function Io(e,t,r){r===void 0&&(r=!1);var n=pe(t),s=pe(t)&&_o(t),i=Be(t),l=ct(e,s,r),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((Ee(t)!=="body"||Tr(i))&&(a=To(t)),pe(t)?(c=ct(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=Dr(i))),{x:l.left+a.scrollLeft-c.x,y:l.top+a.scrollTop-c.y,width:l.width,height:l.height}}function Ro(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 l=[].concat(i.requires||[],i.requiresIfExists||[]);l.forEach(function(a){if(!r.has(a)){var c=t.get(a);c&&s(c)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||s(i)}),n}function Bo(e){var t=Ro(e);return Gi.reduce(function(r,n){return r.concat(t.filter(function(s){return s.phase===n}))},[])}function Po(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function $o(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 bn={placement:"bottom",modifiers:[],strategy:"absolute"};function yn(){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 Ho(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,s=t.defaultOptions,i=s===void 0?bn:s;return function(a,c,f){f===void 0&&(f=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},bn,i),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},d=[],m=!1,x={state:u,setOptions:function(V){var w=typeof V=="function"?V(u.options):V;g(),u.options=Object.assign({},i,u.options,w),u.scrollParents={reference:Ke(a)?jt(a):a.contextElement?jt(a.contextElement):[],popper:jt(c)};var M=Bo($o([].concat(n,u.options.modifiers)));return u.orderedModifiers=M.filter(function(S){return S.enabled}),C(),x.update()},forceUpdate:function(){if(!m){var V=u.elements,w=V.reference,M=V.popper;if(yn(w,M)){u.rects={reference:Io(w,At(M),u.options.strategy==="fixed"),popper:Lr(M)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function($){return u.modifiersData[$.name]=Object.assign({},$.data)});for(var S=0;S<u.orderedModifiers.length;S++){if(u.reset===!0){u.reset=!1,S=-1;continue}var k=u.orderedModifiers[S],O=k.fn,T=k.options,B=T===void 0?{}:T,R=k.name;typeof O=="function"&&(u=O({state:u,options:B,name:R,instance:x})||u)}}}},update:Po(function(){return new Promise(function(y){x.forceUpdate(),y(u)})}),destroy:function(){g(),m=!0}};if(!yn(a,c))return x;x.setOptions(f).then(function(y){!m&&f.onFirstUpdate&&f.onFirstUpdate(y)});function C(){u.orderedModifiers.forEach(function(y){var V=y.name,w=y.options,M=w===void 0?{}:w,S=y.effect;if(typeof S=="function"){var k=S({state:u,name:V,instance:x,options:M}),O=function(){};d.push(k||O)}})}function g(){d.forEach(function(y){return y()}),d=[]}return x}}var Wo=[fo,Fo,co,Ki,Oo,Co,Vo,io,So],Jo=Ho({defaultModifiers:Wo}),zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function es(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Uo=typeof Element<"u",zo=typeof Map=="function",qo=typeof Set=="function",Zo=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Zt(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(!Zt(e[n],t[n]))return!1;return!0}var i;if(zo&&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(!Zt(n.value[1],t.get(n.value[0])))return!1;return!0}if(qo&&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(Zo&&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(Uo&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!Zt(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var Go=function(t,r){try{return Zt(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=es(Go);var Yo=[],Ko=function(t,r,n){n===void 0&&(n={});var s=qe.useRef(null),i={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||Yo},l=qe.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=l[0],c=l[1],f=qe.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(x){var C=x.state,g=Object.keys(C.elements);gi.flushSync(function(){c({styles:un(g.map(function(y){return[y,C.styles[y]||{}]})),attributes:un(g.map(function(y){return[y,C.attributes[y]]}))})})},requires:["computeStyles"]}},[]),u=qe.useMemo(function(){var m={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[f,{name:"applyStyles",enabled:!1}])};return Xo(s.current,m)?s.current||m:(s.current=m,m)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,f]),d=qe.useRef();return fn(function(){d.current&&d.current.setOptions(u)},[u]),fn(function(){if(!(t==null||r==null)){var m=n.createPopper||Jo,x=m(t,r,u);return d.current=x,function(){x.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}};const ts=p.createContext({portalContainer:null}),rs=()=>p.useContext(ts);function Qo({children:e,portalContainer:t=null}){return o.jsx(ts.Provider,{value:{portalContainer:t},children:e})}function Ft({children:e,mounted:t=!1,rootClassName:r="portal-root",inheritViewport:n=!0,pointerEvents:s="auto"}){const[i,l]=p.useState(null),{portalContainer:a}=rs(),c=s==="none";return p.useEffect(()=>{if(!t){l(null);return}const f=document.createElement("div");if(f.className=r,n)if(r.includes("popover"))f.style.zIndex="9999",f.style.pointerEvents=c?"none":"auto";else{const d={position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",zIndex:"9999",pointerEvents:c?"none":"auto"};Object.assign(f.style,d)}const u=a||document.body;return u.appendChild(f),l(f),()=>{u.contains(f)&&u.removeChild(f)}},[t,r,n,c,a]),i?Rn.createPortal(e,i):null}function ea(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 ns(e){const t=p.useRef(e);return ea(t.current,e)||(t.current=e),t.current}function ss(e,t=()=>null,{enabled:r=!0}={}){const n=Array.isArray(e)?e:[e],s=ns(n);p.useEffect(()=>{function i(l){r&&s.every(a=>!(a!=null&&a.contains(l.target)))&&t()}return document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[s,r,t])}function ar({open:e=!1,className:t,anchorEl:r,placement:n="bottom-start",offset:s=[0,0],children:i,style:l,onClickOutside:a}){const[c,f]=p.useState(null),{styles:u}=Ko(r,c,{placement:n,modifiers:[{name:"offset",options:{offset:s}}]});return ss([c,r],a,{enabled:e}),o.jsx(Ft,{mounted:e,rootClassName:"popover-portal",children:o.jsx("div",{ref:f,style:{...u.popper,...l,pointerEvents:"auto"},className:j.twJoin("bbn-popover",t),children:i})})}function is(e){const[t,r]=p.useState({width:0,height:0});return p.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 ta=e=>e.label,_r=p.forwardRef(({disabled:e,className:t,value:r,defaultValue:n,placeholder:s="Select option",open:i,defaultOpen:l,options:a=[],optionClassName:c,popoverClassName:f,state:u="default",onOpen:d,onSelect:m,onClose:x,renderSelectedOption:C=ta,...g},y)=>{const V=p.useRef(null);p.useImperativeHandle(y,()=>V.current,[]);const{width:w}=is(V.current),[M,S]=Ye({value:i,defaultValue:l,onStateChange:A=>void(A?d==null?void 0:d():x==null?void 0:x())}),[k,O]=Ye({value:r,defaultValue:n,onStateChange:m}),T=p.useMemo(()=>a.find(A=>A.value===k),[a,k]),B=p.useCallback(A=>{O(A.value),S(!1)},[O,S]),R=p.useCallback(()=>{S(!1)},[S]),$=p.useCallback(()=>{e||S(!M)},[M,e,S]);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{ref:V,className:j.twJoin("bbn-select",e&&"bbn-select-disabled",`bbn-select-${u}`,t),onClick:$,tabIndex:e?-1:0,...g,children:[o.jsx("span",{children:T?C(T):s}),o.jsx(Ti,{className:j.twJoin("bbn-select-icon",M&&"bbn-select-icon-open"),size:20})]}),o.jsx(ar,{anchorEl:V.current,className:j.twJoin("bbn-select-menu custom-scrollbar",f),open:M&&!e,onClickOutside:R,offset:[0,4],placement:"bottom-start",style:{width:w},children:a.map(A=>o.jsx("div",{className:j.twJoin("bbn-select-option",(T==null?void 0:T.value)===A.value&&"bbn-select-option-selected",c),onClick:()=>B(A),children:A.label},A.value))})]})});_r.displayName="Select";const Lt=p.forwardRef(({className:e,prefix:t,suffix:r,disabled:n=!1,state:s="default",...i},l)=>o.jsxs("div",{className:j.twJoin("bbn-input",`bbn-input-${s}`,n&&"bbn-input-disabled",r&&"bbn-input-has-suffix"),children:[t&&o.jsx("div",{className:"bbn-input-prefix",children:t}),o.jsx("input",{ref:l,className:j.twJoin("bbn-input-field",e),disabled:n,...i}),r&&o.jsx("div",{className:"bbn-input-suffix",children:r})]}));Lt.displayName="Input";function Mt({children:e,label:t,hint:r,state:n="default",className:s}){return o.jsxs("div",{className:j.twJoin("bbn-form-control",s),children:[t?o.jsxs("label",{className:"bbn-form-control-label",children:[o.jsx("div",{className:"bbn-form-control-title",children:t}),e]}):e,r&&o.jsx("div",{className:j.twJoin("bbn-form-control-hint",`bbn-form-control-hint-${n}`),children:r})]})}const os=p.createContext({removeDialog:()=>null,updateDialog:()=>null});function ra({children:e}){const[t,r]=p.useState({}),n=p.useMemo(()=>Object.values(t).some(a=>a),[t]);p.useEffect(function(){if(n){const c=document.body.offsetWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=document.body.offsetWidth-c>=1?Or(document.body.offsetWidth-c)??"":document.body.style.paddingRight}else document.body.style.overflow="",document.body.style.paddingRight=""},[n]);const s=p.useCallback(a=>{r(c=>Reflect.deleteProperty(c,a)?{...c}:c)},[]),i=p.useCallback((a,c)=>{r(f=>({...f,[a]:c}))},[]),l=p.useMemo(()=>({removeDialog:s,updateDialog:i}),[s,i]);return o.jsx(os.Provider,{value:l,children:e})}function Ir({open:e=!1}={}){const t=p.useId(),[r,n]=p.useState(e),{updateDialog:s,removeDialog:i}=p.useContext(os),l=e||r;p.useEffect(()=>()=>{i(t)},[t]),p.useEffect(()=>{s(t,l)},[t,l,s]),p.useEffect(()=>{e&&n(!0)},[e]);const a=p.useCallback(()=>{e||n(!1)},[e]);return{mounted:r,unmount:a}}const as=({open:e=!1,...t})=>o.jsx("div",{...t,className:j.twJoin("bbn-backdrop",e?"animate-backdrop-in":"animate-backdrop-out",t.className)}),Vt=({children:e,open:t=!1,className:r,onClose:n,hasBackdrop:s=!0,backdropClassName:i,dialogClassName:l,...a})=>{const{mounted:c,unmount:f}=Ir({open:t});return o.jsxs(Ft,{mounted:c,children:[o.jsx("div",{...a,className:j.twJoin("bbn-dialog-wrapper",r),children:o.jsx("div",{className:j.twJoin("bbn-dialog",t?"animate-modal-in":"animate-modal-out",l),onAnimationEnd:f,children:e})}),s&&o.jsx(as,{className:i,open:t,onClick:n})]})},lr=({children:e,className:t="",size:r=40,variant:n="default",background:s=!1,rounded:i=!1})=>{const l={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 o.jsx("div",{className:j.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",l[n],t),style:{width:r,height:r},children:e})},ls=({className:e="",size:t=24,variant:r="primary"})=>o.jsx(lr,{variant:r,background:!0,rounded:!0,className:e,children:o.jsx("svg",{style:{width:t,height:t*.545},viewBox:"0 0 22 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.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"})})}),cs=({className:e="",size:t=24,variant:r="primary"})=>o.jsx(lr,{variant:r,background:!0,rounded:!0,className:e,children:o.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 20 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.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"})})}),us=({className:e="",size:t=24,variant:r="primary"})=>o.jsx(lr,{variant:r,background:!0,rounded:!0,className:e,children:o.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.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"}),o.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"})]})}),cr=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||Pe[r];return o.jsx("svg",{style:{width:t,height:t*1.143},viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:j.twJoin("transition-opacity duration-200",s,e),children:o.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"})})},Rr=({className:e="",size:t=14,variant:r="default",color:n})=>{const s=n||Pe[r];return o.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:j.twJoin("transition-opacity duration-200",s,e),children:o.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"})})},fs=({className:e="",size:t=22,variant:r="default",color:n})=>{const s=n||Pe[r],i=22/20;return o.jsx("svg",{style:{width:t,height:t*i},viewBox:"0 0 22 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:j.twJoin("transition-opacity duration-200",s,e),children:o.jsx("path",{d:"M0 19.5H22L11 0.5L0 19.5ZM12 16.5H10V14.5H12V16.5ZM12 12.5H10V8.5H12V12.5Z",fill:"currentColor"})})},ds=({className:e="",size:t=20,variant:r="default",color:n})=>{const s=n||Pe[r];return o.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:j.twJoin("transition-opacity duration-200",s,e),children:[o.jsx("rect",{x:"0.5",y:"0.5",width:"19",height:"19",rx:"3.5",stroke:"currentColor"}),o.jsx("path",{d:"M14.0832 10.5846H5.9165V9.41797H14.0832V10.5846Z",fill:"currentColor"})]})},hs=({className:e="",size:t=20,variant:r="default",color:n})=>{const s=n||Pe[r];return o.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:j.twJoin("transition-opacity duration-200",s,e),children:[o.jsx("rect",{x:"0.5",y:"0.5",width:"19",height:"19",rx:"3.5",stroke:"currentColor"}),o.jsx("path",{d:"M14 10.5714H10.5714V14H9.42857V10.5714H6V9.42857H9.42857V6H10.5714V9.42857H14V10.5714Z",fill:"currentColor"})]})},na=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||Pe[r];return o.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:j.twJoin("transition-opacity duration-200",s,e),children:o.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},sa=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||Pe[r];return o.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 16 16.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:j.twJoin("transition-opacity duration-200",s,e),children:o.jsx("path",{d:"M11.865 5.5H4.135L0.5 9.135V11.865L4.135 15.5H11.865L15.5 11.865V9.135L11.865 5.5ZM8 13.15C7.28 13.15 6.85 12.72 6.85 12C6.85 11.28 7.28 10.85 8 10.85C8.72 10.85 9.15 11.28 9.15 12C9.15 12.72 8.72 13.15 8 13.15ZM9 10.5H7V7.5H9V10.5Z",fill:"currentColor"})})},Pe={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"},et=({children:e,open:t=!1,className:r,onClose:n,...s})=>{const{mounted:i,unmount:l}=Ir({open:t});return o.jsxs(Ft,{mounted:i,children:[o.jsxs("div",{...s,className:j.twJoin("bbn-dialog-mobile",t?"animate-mobile-modal-in":"animate-mobile-modal-out",r),onAnimationEnd:l,children:[n&&o.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:o.jsx(Rr,{size:14,variant:"accent-primary"})}),e]}),o.jsx(as,{open:t,onClick:n})]})},Dt=({className:e,children:t,title:r,onClose:n})=>o.jsxs("div",{className:j.twJoin("bbn-dialog-header",e),children:[o.jsxs("div",{className:"bbn-dialog-title",children:[o.jsx(ir,{variant:"h5",children:r}),!!n&&o.jsx(kr,{className:"shrink-0",onClick:n,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.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]}),Tt=e=>o.jsx("div",{...e,className:j.twJoin("bbn-dialog-body",e.className)}),ur=e=>o.jsx("div",{...e,className:j.twJoin("bbn-dialog-footer",e.className)});function ia({className:e,...t}){return o.jsx("span",{...t,className:j.twJoin("bbn-chip",e)})}function oa({size:e=40,className:t}){return o.jsx("span",{className:j.twMerge("bbn-loader text-current",t),style:{width:e,height:e},children:o.jsx("svg",{viewBox:"22 22 44 44",children:o.jsx("circle",{cx:"44",cy:"44",r:"20.2",fill:"none",stroke:"currentColor",strokeWidth:"3.6"})})})}var ms="Expected a function",wn=NaN,aa="[object Symbol]",la=/^\s+|\s+$/g,ca=/^[-+]0x[0-9a-f]+$/i,ua=/^0b[01]+$/i,fa=/^0o[0-7]+$/i,da=parseInt,ha=typeof zt=="object"&&zt&&zt.Object===Object&&zt,ma=typeof self=="object"&&self&&self.Object===Object&&self,pa=ha||ma||Function("return this")(),va=Object.prototype,xa=va.toString,ga=Math.max,ba=Math.min,vr=function(){return pa.Date.now()};function ya(e,t,r){var n,s,i,l,a,c,f=0,u=!1,d=!1,m=!0;if(typeof e!="function")throw new TypeError(ms);t=jn(t)||0,Qt(r)&&(u=!!r.leading,d="maxWait"in r,i=d?ga(jn(r.maxWait)||0,t):i,m="trailing"in r?!!r.trailing:m);function x(O){var T=n,B=s;return n=s=void 0,f=O,l=e.apply(B,T),l}function C(O){return f=O,a=setTimeout(V,t),u?x(O):l}function g(O){var T=O-c,B=O-f,R=t-T;return d?ba(R,i-B):R}function y(O){var T=O-c,B=O-f;return c===void 0||T>=t||T<0||d&&B>=i}function V(){var O=vr();if(y(O))return w(O);a=setTimeout(V,g(O))}function w(O){return a=void 0,m&&n?x(O):(n=s=void 0,l)}function M(){a!==void 0&&clearTimeout(a),f=0,n=c=s=a=void 0}function S(){return a===void 0?l:w(vr())}function k(){var O=vr(),T=y(O);if(n=arguments,s=this,c=O,T){if(a===void 0)return C(c);if(d)return a=setTimeout(V,t),x(c)}return a===void 0&&(a=setTimeout(V,t)),l}return k.cancel=M,k.flush=S,k}function wa(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(ms);return Qt(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),ya(e,t,{leading:n,maxWait:t,trailing:s})}function Qt(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ja(e){return!!e&&typeof e=="object"}function Ca(e){return typeof e=="symbol"||ja(e)&&xa.call(e)==aa}function jn(e){if(typeof e=="number")return e;if(Ca(e))return wn;if(Qt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Qt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(la,"");var r=ua.test(e);return r||fa.test(e)?da(e.slice(2),r?2:8):ca.test(e)?wn:+e}var Na=wa;const ps=es(Na);function vs(e,{onLoadMore:t,hasMore:r=!1,loading:n=!1}={}){const[s,i]=p.useState(!1);return p.useEffect(()=>{const l=ps(c=>{const f=c.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",l),()=>a.removeEventListener("scroll",l)},[n,r,t,e]),{isScrolledTop:s}}function xs(e){const[t,r]=p.useState(!1),[n,s]=p.useState(!1);return p.useEffect(()=>{const i=e.current;if(!i)return;const l=()=>{const{scrollLeft:a,scrollWidth:c,clientWidth:f}=i;r(a>0);const u=c-f;s(u>0&&a<u)};return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)},[e]),{isLeftScrolled:t,isRightScrolled:n}}const gs=p.createContext({data:[],columns:[],sortStates:{},onColumnSort:void 0,onRowSelect:void 0});function bs({name:e,className:t,children:r,sorter:n,frozen:s,showFrozenShadow:i,...l}){const{columns:a,sortStates:c,onColumnSort:f}=p.useContext(gs),u=c[e??""],d=u==null?void 0:u.direction,m=s?`bbn-table-frozen bbn-table-frozen-${s}`:"",x=s&&i?"bbn-frozen-shadow":"";return o.jsx(H,{variant:"caption",as:"th",className:j.twJoin("bbn-cell-left",n&&"bbn-table-sortable",m,x,t),onClick:()=>{if(n&&e){const C=a.find(g=>g.key===e);f==null||f(e,C==null?void 0:C.sorter)}},"data-column":e,...l,children:o.jsxs("div",{className:"flex items-center justify-between gap-1",children:[o.jsx("span",{children:r}),n&&o.jsxs("span",{className:"bbn-table-sort-icons",children:[o.jsx(_i,{className:j.twJoin("bbn-sort-icon bbn-sort-icon-up",d==="asc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")}),o.jsx(Di,{className:j.twJoin("bbn-sort-icon bbn-sort-icon-down",d==="desc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")})]})]})})}function ys(e,t){const[r,n]=p.useState({}),s=p.useCallback((l,a)=>{a&&n(c=>{var m;const f=((m=c[l])==null?void 0:m.direction)??null,u=f===null?"asc":f==="asc"?"desc":null;if(u===null)return Object.fromEntries(Object.entries(c).filter(([x])=>x!==l).map(([x,C])=>[x,{...C,priority:C.priority>c[l].priority?C.priority-1:C.priority}]));const d=Math.max(0,...Object.values(c).map(x=>x.priority));return{...c,[l]:{direction:u,priority:d+1}}})},[]),i=p.useMemo(()=>{const l=Object.entries(r).filter(([,a])=>a.direction!==null).toSorted((a,c)=>c[1].priority-a[1].priority).map(([a,c])=>({column:t.find(f=>f.key===a),direction:c.direction})).filter(({column:a})=>a==null?void 0:a.sorter);return l.length===0?e:e.toSorted((a,c)=>{for(const{column:f,direction:u}of l){const d=f.sorter(a,c);if(d!==0)return u==="asc"?d:-d}return 0})},[e,t,r]);return{sortStates:r,handleColumnSort:s,sortedData:i}}function ws({className:e,render:t,value:r,columnName:n,frozen:s,showFrozenShadow:i,...l}){const a=s?`bbn-table-frozen bbn-table-frozen-${s}`:"",c=s&&i?"bbn-frozen-shadow":"";return o.jsx(H,{variant:"body2",as:"td",className:j.twJoin("bbn-cell-left",a,c,e),"data-column":n,...l,children:t?t(r):r})}function Sa({row:e,columns:t,isSelected:r,isSelectable:n,onSelect:s,isLeftScrolled:i,isRightScrolled:l}){return o.jsx("tr",{className:j.twJoin(r&&"selected",!!s&&n&&"cursor-pointer",!n&&"opacity-50"),onClick:()=>s(e),children:t.map(a=>o.jsx(ws,{value:e[a.key],columnName:a.key,className:a.cellClassName,frozen:a.frozen,showFrozenShadow:a.frozen==="left"&&i||a.frozen==="right"&&l,render:a.render?c=>a.render(c,e):void 0},a.key))})}function ka({data:e,columns:t,className:r,wrapperClassName:n,fluid:s=!1,hasMore:i=!1,loading:l=!1,onLoadMore:a,onRowSelect:c,isRowSelectable:f,selectedRow:u,defaultSelectedRow:d,onSelectedRowChange:m,...x},C){const g=p.useRef(null);p.useImperativeHandle(C,()=>g.current,[]);const{sortStates:y,handleColumnSort:V,sortedData:w}=ys(e,t),{isScrolledTop:M}=vs(g,{onLoadMore:a,hasMore:i,loading:l}),{isLeftScrolled:S,isRightScrolled:k}=xs(g),[O,T]=Ye({value:u,defaultValue:d??null,onStateChange:m}),B=p.useCallback(A=>{if(!c||f&&!f(A))return;const L=O===A.id?null:A.id;T(L),c(L===null?null:A)},[c,f,O,T]),R=p.useMemo(()=>({data:w,columns:t,sortStates:y,onColumnSort:V,onRowSelect:B}),[w,t,y,V,B]),$=p.useMemo(()=>t.some(A=>A.header&&A.header!==""),[t]);return o.jsx(gs.Provider,{value:R,children:o.jsx("div",{ref:g,className:j.twJoin("bbn-table-wrapper",s&&"bbn-table-wrapper-fluid",n),children:o.jsxs("table",{className:j.twJoin("bbn-table",s&&"bbn-table-fluid",r),...x,children:[o.jsx("thead",{className:j.twJoin("bbn-table-header",M&&"scrolled-top",!$&&"hidden"),children:o.jsx("tr",{children:t.map(A=>o.jsx(bs,{className:A.headerClassName,name:A.key,sorter:A.sorter,frozen:A.frozen,showFrozenShadow:A.frozen==="left"&&S||A.frozen==="right"&&k,children:A.header},A.key))})}),o.jsx("tbody",{className:"bbn-table-body",children:w.map(A=>o.jsx(Sa,{row:A,columns:t,isSelected:O===A.id,isSelectable:f?f(A):!0,onSelect:B,isLeftScrolled:S,isRightScrolled:k},A.id))})]})})})}const js=p.forwardRef(ka);function Cs({as:e="div",className:t,children:r}){return p.createElement(e,{className:j.twJoin("bbn-card",t)},r)}function Ea(e){const[t=!1,r]=Ye({value:e.value,defaultValue:e.defaultValue,onStateChange:e.onChange});return o.jsxs("div",{className:"bbn-toggle",onClick:()=>void r(!t),children:[o.jsx("span",{className:"bbn-toggle-bg",children:e.activeIcon}),o.jsx("span",{className:j.twJoin("bbn-toggle-control",t&&"bbn-toggle-control-active")}),o.jsx("span",{className:"bbn-toggle-bg",children:e.inactiveIcon})]})}const Oa={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Aa({className:e,orientation:t="vertical",children:r}){return o.jsx("div",{className:j.twMerge("bbn-list",`bbn-list-${t}`,e),children:p.Children.map(r,n=>p.isValidElement(n)?p.cloneElement(n,{orientation:Oa[t]}):n)})}function Ns({className:e,orientation:t="horizontal",title:r,value:n,suffix:s}){return o.jsxs("div",{className:j.twJoin("bbn-list-item",`bbn-list-item-${t}`,e),children:[o.jsx(H,{as:"div",className:j.twJoin("bbn-list-title",`bbn-list-title-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),o.jsxs(H,{as:"div",className:j.twJoin("bbn-list-value",`bbn-list-value-${t}`),variant:"body1",children:[n,s]})]})}function Cn(e){return Re({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]},{tag:"path",attr:{d:"M464 336a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"},child:[]}]})(e)}function Fa(e){return Re({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 Br(e={}){const{copiedText:t="Copied ✓",timeout:r=2e3}=e,[n,s]=p.useState({}),i=p.useRef({}),l=p.useCallback(u=>{u&&s(d=>({...d,[u]:!1}))},[]),a=p.useCallback((u,d)=>{if(!u||!d)return;navigator.clipboard.writeText(d).catch(()=>{}),s(x=>({...x,[u]:!0}));const m=i.current[u];m&&clearTimeout(m),r>0&&(i.current[u]=setTimeout(()=>{i.current[u]=void 0,l(u)},r))},[r,l]),c=p.useCallback(u=>u&&n[u]||!1,[n]),f=p.useCallback(u=>u&&n[u]?t:"",[n,t]);return p.useEffect(()=>()=>{Object.values(i.current).forEach(u=>u&&clearTimeout(u)),i.current={}},[]),{isCopied:c,copiedText:f,copyToClipboard:a}}function tt(e=768,t=100){const[r,n]=p.useState(()=>typeof window<"u"?window.innerWidth<e:!1),s=p.useRef(),i=p.useCallback(()=>{n(window.innerWidth<e)},[e]);return p.useEffect(()=>(s.current=ps(i,t),i(),window.addEventListener("resize",s.current),()=>{s.current&&(window.removeEventListener("resize",s.current),s.current.cancel())}),[i,t]),r}function Ss({isOpen:e}){const[t,r]=p.useState(!1),[n,s]=p.useState(!1);p.useEffect(()=>{e&&!t&&(r(!0),s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{s(!0)})}))},[e,t]),p.useEffect(()=>{!e&&t&&s(!1)},[e,t]);const i=p.useCallback(()=>{!e&&t&&r(!1)},[e,t]);return{mounted:t,shouldShowOpen:n,handleAnimationEnd:i}}const La=({hidden:e=!1,loading:t,title:r,value:n,tooltip:s,loadingStyle:i="spinner",...l})=>{const a=p.useId(),c=tt(),[f,u]=p.useState(!1),[d,m]=p.useState(null);if(p.useEffect(()=>{!c&&f&&u(!1)},[c,f]),e)return null;const x=o.jsxs("div",{className:"inline-flex items-center gap-2",children:[o.jsx("span",{className:"loader size-5"}),i==="spinner-and-value"&&o.jsx("span",{className:"opacity-50",children:n})]}),C=s?c?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block size-5 cursor-pointer text-xs",onClick:()=>u(!0),children:o.jsx(Cn,{size:20})}),o.jsxs(et,{open:f,onClose:()=>u(!1),children:[o.jsx("div",{className:"px-4 py-2 text-accent-primary",children:s}),o.jsx("div",{className:"p-4",children:o.jsx(ue,{variant:"contained",fluid:!0,onClick:()=>u(!1),children:"Done"})})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block size-5 cursor-pointer text-xs",onMouseEnter:g=>m(g.currentTarget),onMouseLeave:()=>m(null),"aria-describedby":a,children:o.jsx(Cn,{size:20})}),o.jsx(ar,{open:!!d,anchorEl:d,placement:"top",offset:[0,8],children:o.jsx("div",{className:"tooltip-wrap",children:s})})]}):void 0;return o.jsx(Ns,{...l,title:r,value:t?x:n,suffix:C})};function Ma({children:e,count:t=0,max:r=99,position:n="bottom-right",color:s="error",className:i,badgeClassName:l,contentClassName:a}){const c=typeof t=="number"?t>0:t!=null,f=typeof t=="number"&&t>r?`${r}+`:t,u=`bbn-badge-${n}`,d=`bbn-badge-${s}`;return o.jsxs("div",{className:j.twJoin("bbn-badge",i),children:[e,c&&o.jsx("span",{className:j.twJoin("bbn-badge-indicator",u,d,l),children:o.jsx("span",{className:j.twJoin("bbn-badge-content",a),children:f})})]})}const ht=({children:e,style:t,variant:r="contained",className:n})=>o.jsx("div",{className:j.twJoin("bbn-subsection",`bbn-subsection-${r}`,n),style:t,children:e});function ks({counter:e,max:t,onAdd:r,alwaysShowCounter:n=!1}){const s=e<t,i=0<e||n&&e===0;return o.jsxs("div",{className:j.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&&o.jsx("div",{className:"flex h-10 w-10 items-center justify-center",children:o.jsx(Fa,{size:20})}),i&&o.jsxs("div",{className:j.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 Es=p.createContext(void 0),Pr=()=>p.useContext(Es),Va=({children:e,value:t})=>o.jsx(Es.Provider,{value:t,children:e}),$r=({isOpen:e,onClose:t,title:r,children:n,className:s="",titleAlign:i="left",backIcon:l,fullHeight:a=!1,fullWidth:c=!1,showBackButton:f=!0,showDivider:u=!0,onBackdropClick:d})=>{const{mounted:m,shouldShowOpen:x,handleAnimationEnd:C}=Ss({isOpen:e}),g={left:"text-left",center:"text-center",right:"text-right"},y=()=>f||r?o.jsxs("div",{className:j.twJoin("flex items-center p-4",u&&"border-b border-[#38708533] dark:border-[#404040]"),children:[f&&o.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:l||o.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:o.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),r&&o.jsx("h3",{className:j.twJoin("flex-1 text-sm font-medium text-accent-primary",f?"ml-3":"",g[i]),children:r})]}):null,V=()=>o.jsxs(o.Fragment,{children:[y(),o.jsx("div",{className:"flex-1 overflow-y-auto",children:n})]});return a?o.jsxs(Ft,{mounted:m,rootClassName:"menu-drawer-portal",children:[d&&o.jsx("div",{className:j.twJoin("fixed inset-0 z-40 bg-black/50 transition-opacity duration-300",x?"opacity-100":"pointer-events-none opacity-0"),onClick:d}),o.jsx("div",{className:j.twJoin("transform transition-transform duration-300 ease-in-out","bg-[#FFFFFF] dark:bg-[#252525]","fixed inset-y-0 right-0 z-50",c?"w-full":"w-full max-w-sm",x?"translate-x-0":"translate-x-full",s),onTransitionEnd:C,children:V()})]}):o.jsx("div",{className:j.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:V()})},Hr=({children:e,trigger:t,open:r,onOpenChange:n,placement:s="bottom-end",offset:i=[0,8],className:l,mobileMode:a="dialog"})=>{const[c,f]=p.useState(!1),u=p.useRef(null),d=tt(),m=r!==void 0?r:c,x=V=>{r===void 0&&f(V),n==null||n(V)},C=()=>x(!1),g=o.jsx("div",{className:"relative w-full overflow-hidden",children:e}),y=t||o.jsx("button",{className:"rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-800",onClick:()=>x(!m),children:"Menu"});return o.jsxs(Va,{value:{isOpen:m,setIsOpen:x,onClose:C,isMobile:d},children:[o.jsx("div",{ref:u,className:"inline-block",children:p.isValidElement(y)&&p.cloneElement(y,{onClick:()=>x(!m),"aria-haspopup":"true","aria-expanded":m})}),d?a==="dialog"?o.jsx(et,{open:m,onClose:C,className:j.twJoin("bg-[#FFFFFF] dark:bg-[#252525] text-primary-main",l),children:g}):o.jsx($r,{isOpen:m,onClose:C,onBackdropClick:C,fullHeight:!0,fullWidth:!0,showBackButton:!0,showDivider:!1,children:g}):o.jsx(ar,{anchorEl:u.current,open:m,offset:i,placement:s,onClickOutside:C,className:j.twJoin("rounded-lg border border-[#38708533] bg-[#FFFFFF] shadow-lg dark:border-[#404040] dark:bg-[#252525]","min-w-[294px]",l),children:g})]})},Os=({icon:e,name:t,description:r,onClick:n,disabled:s=!1,className:i,children:l,suffix:a,selected:c=!1,role:f="menuitem"})=>{const u=Pr(),d=()=>{s||!n||(n(),u&&!a&&u.onClose())};return l?o.jsx("button",{onClick:d,disabled:s,className:j.twJoin("w-full text-left",s&&"cursor-not-allowed opacity-50",i),children:l}):o.jsxs("button",{onClick:d,disabled:s,className:j.twJoin("flex w-full items-center justify-between p-6","transition-colors hover:bg-accent-secondary/5","text-left","focus:outline-none",c&&"bg-accent-secondary/10",s&&"cursor-not-allowed opacity-50",i),role:f,"aria-selected":c,tabIndex:s?-1:0,children:[o.jsxs("div",{className:"flex items-center gap-3",children:[e&&o.jsx("div",{className:"flex-shrink-0",children:e}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("div",{className:"text-sm font-medium text-accent-primary",children:t}),r&&o.jsx("div",{className:"text-xs text-accent-secondary",children:r})]})]}),a]})},As=({children:e,name:t,description:r,icon:n,backIcon:s,suffix:i,className:l,contentClassName:a,titleAlign:c="left"})=>{const[f,u]=p.useState(!1),d=Pr(),m=o.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:o.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),x=o.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:o.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return o.jsxs(o.Fragment,{children:[o.jsxs("button",{onClick:()=>u(!0),className:j.twJoin("flex w-full items-center justify-between p-6","transition-colors hover:bg-accent-secondary/5","text-left focus:outline-none",l),role:"menuitem",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[n&&o.jsx("div",{className:"flex-shrink-0",children:n}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-sm font-medium text-accent-primary",children:t}),r&&o.jsx("span",{className:"mt-0.5 text-xs text-accent-secondary",children:r})]})]}),i||x]}),o.jsx($r,{isOpen:f,onClose:()=>u(!1),title:t||"",titleAlign:c,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:j.twJoin(d!=null&&d.isMobile?"z-60":"z-50",a),children:e})]})},Da=({label:e,description:t,onClick:r,selected:n=!1,className:s,suffix:i,disabled:l=!1})=>{const a=o.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M16.6667 5L7.5 14.1667L3.33333 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return o.jsxs("button",{role:"menuitem",onClick:r,disabled:l,className:j.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",l&&"cursor-not-allowed opacity-50",s),"aria-selected":n,tabIndex:l?-1:0,children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"font-medium text-accent-primary",children:e}),t&&o.jsx("span",{className:"text-sm text-accent-secondary",children:t})]}),n&&(i||a)]})},fr=({amount:e,currencyIcon:t,currencyName:r,placeholder:n="Enter Amount",subtitle:s,displayBalance:i,balanceDetails:l,min:a,step:c,autoFocus:f,onChange:u,onKeyDown:d,amountUsd:m,disabled:x=!1})=>o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("img",{src:t,alt:r,className:"h-10 max-h-[2.5rem] w-10 max-w-[2.5rem]"}),o.jsx("div",{className:"text-lg",children:r})]}),o.jsx("input",{type:"number",value:e??"",min:a,step:c,onChange:u,onKeyDown:d,disabled:x,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"})]}),l&&i?o.jsxs("div",{className:"flex w-full flex-row content-center justify-between text-sm",children:[o.jsx("span",{className:"cursor-default",children:s}),l.displayUSD&&l.price!==void 0&&o.jsxs("div",{children:[m," USD"]})]}):null]});function Ta(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 Wr=({value:e,symbols:t=8,size:r="body2",className:n})=>e?o.jsx(H,{variant:r,className:j.twJoin("text-accent-primary",n),children:o.jsx("span",{children:Ta(e,t)??e})}):null,Fs=({children:e,value:t,className:r,onCopy:n,isCopied:s,copiedText:i,timeout:l=2e3})=>{const a=p.useId(),c={copiedText:i,timeout:l},{isCopied:f,copiedText:u,copyToClipboard:d}=Br(c),m=s!==void 0,x=m?s:f(a),C=m?i||"Copied ✓":u(a),g=y=>{y.stopPropagation(),m&&n?n(t):d(a,t)};return o.jsx("div",{className:j.twMerge("inline-flex items-center cursor-pointer hover:opacity-100 transition-opacity duration-200",r),onClick:g,children:o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:j.twMerge("transition-opacity duration-300 ease-in-out",x&&"opacity-0"),children:e}),x&&o.jsx("div",{className:j.twMerge("absolute inset-0 flex items-center transition-opacity duration-300 ease-in-out text-green-600","opacity-100"),children:C})]})})};function Ls({children:e,className:t,iconClassName:r,messageClassName:n}){return o.jsxs("div",{className:j.twJoin("bbn-warning",t),children:[o.jsx(fs,{variant:"secondary",size:22,className:j.twJoin("bbn-warning-icon",r)}),o.jsx("p",{className:j.twJoin("bbn-warning-message",n),children:e})]})}var _t=e=>e.type==="checkbox",Ze=e=>e instanceof Date,ie=e=>e==null;const Ms=e=>typeof e=="object";var ee=e=>!ie(e)&&!Array.isArray(e)&&Ms(e)&&!Ze(e),Vs=e=>ee(e)&&e.target?_t(e.target)?e.target.checked:e.target.value:e,_a=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Ds=(e,t)=>e.has(_a(t)),Ia=e=>{const t=e.constructor&&e.constructor.prototype;return ee(t)&&t.hasOwnProperty("isPrototypeOf")},Jr=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(!(Jr&&(e instanceof Blob||n))&&(r||ee(e)))if(t=r?[]:{},!r&&!Ia(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=ne(e[s]));else return e;return t}var dr=e=>/^\w*$/.test(e),Q=e=>e===void 0,Ur=e=>Array.isArray(e)?e.filter(Boolean):[],zr=e=>Ur(e.replace(/["|']|\]/g,"").split(/\.|\[/)),F=(e,t,r)=>{if(!t||!ee(e))return r;const n=(dr(t)?[t]:zr(t)).reduce((s,i)=>ie(s)?s:s[i],e);return Q(n)||n===e?Q(e[t])?r:e[t]:n},fe=e=>typeof e=="boolean",z=(e,t,r)=>{let n=-1;const s=dr(t)?[t]:zr(t),i=s.length,l=i-1;for(;++n<i;){const a=s[n];let c=r;if(n!==l){const f=e[a];c=ee(f)||Array.isArray(f)?f:isNaN(+s[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const er={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ye={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"},qr=p.createContext(null);qr.displayName="HookFormContext";const rt=()=>p.useContext(qr),Ra=e=>{const{children:t,...r}=e;return p.createElement(qr.Provider,{value:r},t)};var Ts=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const l=i;return t._proxyFormState[l]!==ye.all&&(t._proxyFormState[l]=!n||ye.all),r&&(r[l]=!0),e[l]}});return s};const Zr=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Gr(e){const t=rt(),{control:r=t.control,disabled:n,name:s,exact:i}=e||{},[l,a]=p.useState(r._formState),c=p.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Zr(()=>r._subscribe({name:s,formState:c.current,exact:i,callback:f=>{!n&&a({...r._formState,...f})}}),[s,n,i]),p.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),p.useMemo(()=>Ts(l,r,c.current,!1),[l,r])}var Ne=e=>typeof e=="string",_s=(e,t,r,n,s)=>Ne(e)?(n&&t.watch.add(e),F(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),F(r,i))):(n&&(t.watchAll=!0),r),wr=e=>ie(e)||!Ms(e);function Le(e,t,r=new WeakSet){if(wr(e)||wr(t))return e===t;if(Ze(e)&&Ze(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 l=e[i];if(!s.includes(i))return!1;if(i!=="ref"){const a=t[i];if(Ze(l)&&Ze(a)||ee(l)&&ee(a)||Array.isArray(l)&&Array.isArray(a)?!Le(l,a,r):l!==a)return!1}}return!0}function Xr(e){const t=rt(),{control:r=t.control,name:n,defaultValue:s,disabled:i,exact:l,compute:a}=e||{},c=p.useRef(s),f=p.useRef(a),u=p.useRef(void 0);f.current=a;const d=p.useMemo(()=>r._getWatch(n,c.current),[r,n]),[m,x]=p.useState(f.current?f.current(d):d);return Zr(()=>r._subscribe({name:n,formState:{values:!0},exact:l,callback:C=>{if(!i){const g=_s(n,r._names,C.values||r._formValues,!1,c.current);if(f.current){const y=f.current(g);Le(y,u.current)||(x(y),u.current=y)}else x(g)}}}),[r,i,n,l]),p.useEffect(()=>r._removeUnmounted()),m}function Ba(e){const t=rt(),{name:r,disabled:n,control:s=t.control,shouldUnregister:i,defaultValue:l}=e,a=Ds(s._names.array,r),c=p.useMemo(()=>F(s._formValues,r,F(s._defaultValues,r,l)),[s,r,l]),f=Xr({control:s,name:r,defaultValue:c,exact:!0}),u=Gr({control:s,name:r,exact:!0}),d=p.useRef(e),m=p.useRef(s.register(r,{...e.rules,value:f,...fe(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;const x=p.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!F(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!F(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!F(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!F(u.validatingFields,r)},error:{enumerable:!0,get:()=>F(u.errors,r)}}),[u,r]),C=p.useCallback(w=>m.current.onChange({target:{value:Vs(w),name:r},type:er.CHANGE}),[r]),g=p.useCallback(()=>m.current.onBlur({target:{value:F(s._formValues,r),name:r},type:er.BLUR}),[r,s._formValues]),y=p.useCallback(w=>{const M=F(s._fields,r);M&&w&&(M._f.ref={focus:()=>w.focus&&w.focus(),select:()=>w.select&&w.select(),setCustomValidity:S=>w.setCustomValidity(S),reportValidity:()=>w.reportValidity()})},[s._fields,r]),V=p.useMemo(()=>({name:r,value:f,...fe(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:C,onBlur:g,ref:y}),[r,n,u.disabled,C,g,y,f]);return p.useEffect(()=>{const w=s._options.shouldUnregister||i;s.register(r,{...d.current.rules,...fe(d.current.disabled)?{disabled:d.current.disabled}:{}});const M=(S,k)=>{const O=F(s._fields,S);O&&O._f&&(O._f.mount=k)};if(M(r,!0),w){const S=ne(F(s._options.defaultValues,r));z(s._defaultValues,r,S),Q(F(s._formValues,r))&&z(s._formValues,r,S)}return!a&&s.register(r),()=>{(a?w&&!s._state.action:w)?s.unregister(r):M(r,!1)}},[r,s,a,i]),p.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),p.useMemo(()=>({field:V,formState:u,fieldState:x}),[V,u,x])}var Is=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Ct=e=>Array.isArray(e)?e:[e],Nn=()=>{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=[]}}},ae=e=>ee(e)&&!Object.keys(e).length,Yr=e=>e.type==="file",we=e=>typeof e=="function",tr=e=>{if(!Jr)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Rs=e=>e.type==="select-multiple",Kr=e=>e.type==="radio",Pa=e=>Kr(e)||_t(e),xr=e=>tr(e)&&e.isConnected;function $a(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 Ha(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:dr(t)?[t]:zr(t),n=r.length===1?e:$a(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(ee(n)&&ae(n)||Array.isArray(n)&&Ha(n))&&te(e,r.slice(0,-1)),e}var Bs=e=>{for(const t in e)if(we(e[t]))return!0;return!1};function rr(e,t={}){const r=Array.isArray(e);if(ee(e)||r)for(const n in e)Array.isArray(e[n])||ee(e[n])&&!Bs(e[n])?(t[n]=Array.isArray(e[n])?[]:{},rr(e[n],t[n])):ie(e[n])||(t[n]=!0);return t}function Ps(e,t,r){const n=Array.isArray(e);if(ee(e)||n)for(const s in e)Array.isArray(e[s])||ee(e[s])&&!Bs(e[s])?Q(t)||wr(r[s])?r[s]=Array.isArray(e[s])?rr(e[s],[]):{...rr(e[s])}:Ps(e[s],ie(t)?{}:t[s],r[s]):r[s]=!Le(e[s],t[s]);return r}var bt=(e,t)=>Ps(e,t,rr(t));const Sn={value:!1,isValid:!1},kn={value:!0,isValid:!0};var $s=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===""?kn:{value:e[0].value,isValid:!0}:kn:Sn}return Sn},Hs=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Q(e)?e:t?e===""?NaN:e&&+e:r&&Ne(e)?new Date(e):n?n(e):e;const En={isValid:!1,value:null};var Ws=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,En):En;function On(e){const t=e.ref;return Yr(t)?t.files:Kr(t)?Ws(e.refs).value:Rs(t)?[...t.selectedOptions].map(({value:r})=>r):_t(t)?$s(e.refs).value:Hs(Q(t.value)?e.ref.value:t.value,e)}var Wa=(e,t,r,n)=>{const s={};for(const i of e){const l=F(t,i);l&&z(s,i,l._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},nr=e=>e instanceof RegExp,yt=e=>Q(e)?e:nr(e)?e.source:ee(e)?nr(e.value)?e.value.source:e.value:e,An=e=>({isOnSubmit:!e||e===ye.onSubmit,isOnBlur:e===ye.onBlur,isOnChange:e===ye.onChange,isOnAll:e===ye.all,isOnTouch:e===ye.onTouched});const Fn="AsyncFunction";var Ja=e=>!!e&&!!e.validate&&!!(we(e.validate)&&e.validate.constructor.name===Fn||ee(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Fn)),Ua=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Ln=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Nt=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=F(e,s);if(i){const{_f:l,...a}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],s)&&!n)return!0;if(l.ref&&t(l.ref,l.name)&&!n)return!0;if(Nt(a,t))break}else if(ee(a)&&Nt(a,t))break}}};function Mn(e,t,r){const n=F(e,r);if(n||dr(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),l=F(t,i),a=F(e,i);if(l&&!Array.isArray(l)&&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 za=(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(l=>t[l]===(!n||ye.all))},qa=(e,t,r)=>!e||!t||e===t||Ct(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),Za=(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,Ga=(e,t)=>!Ur(F(e,t)).length&&te(e,t),Xa=(e,t,r)=>{const n=Ct(F(e,r));return z(n,"root",t[r]),z(e,r,n),e},Gt=e=>Ne(e);function Vn(e,t,r="validate"){if(Gt(e)||Array.isArray(e)&&e.every(Gt)||fe(e)&&!e)return{type:r,message:Gt(e)?e:"",ref:t}}var it=e=>ee(e)&&!nr(e)?e:{value:e,message:""},Dn=async(e,t,r,n,s,i)=>{const{ref:l,refs:a,required:c,maxLength:f,minLength:u,min:d,max:m,pattern:x,validate:C,name:g,valueAsNumber:y,mount:V}=e._f,w=F(r,g);if(!V||t.has(g))return{};const M=a?a[0]:l,S=L=>{s&&M.reportValidity&&(M.setCustomValidity(fe(L)?"":L||""),M.reportValidity())},k={},O=Kr(l),T=_t(l),B=O||T,R=(y||Yr(l))&&Q(l.value)&&Q(w)||tr(l)&&l.value===""||w===""||Array.isArray(w)&&!w.length,$=Is.bind(null,g,n,k),A=(L,P,J,Y=Fe.maxLength,q=Fe.minLength)=>{const K=L?P:J;k[g]={type:L?Y:q,message:K,ref:l,...$(L?Y:q,K)}};if(i?!Array.isArray(w)||!w.length:c&&(!B&&(R||ie(w))||fe(w)&&!w||T&&!$s(a).isValid||O&&!Ws(a).isValid)){const{value:L,message:P}=Gt(c)?{value:!!c,message:c}:it(c);if(L&&(k[g]={type:Fe.required,message:P,ref:M,...$(Fe.required,P)},!n))return S(P),k}if(!R&&(!ie(d)||!ie(m))){let L,P;const J=it(m),Y=it(d);if(!ie(w)&&!isNaN(w)){const q=l.valueAsNumber||w&&+w;ie(J.value)||(L=q>J.value),ie(Y.value)||(P=q<Y.value)}else{const q=l.valueAsDate||new Date(w),K=Ae=>new Date(new Date().toDateString()+" "+Ae),je=l.type=="time",oe=l.type=="week";Ne(J.value)&&w&&(L=je?K(w)>K(J.value):oe?w>J.value:q>new Date(J.value)),Ne(Y.value)&&w&&(P=je?K(w)<K(Y.value):oe?w<Y.value:q<new Date(Y.value))}if((L||P)&&(A(!!L,J.message,Y.message,Fe.max,Fe.min),!n))return S(k[g].message),k}if((f||u)&&!R&&(Ne(w)||i&&Array.isArray(w))){const L=it(f),P=it(u),J=!ie(L.value)&&w.length>+L.value,Y=!ie(P.value)&&w.length<+P.value;if((J||Y)&&(A(J,L.message,P.message),!n))return S(k[g].message),k}if(x&&!R&&Ne(w)){const{value:L,message:P}=it(x);if(nr(L)&&!w.match(L)&&(k[g]={type:Fe.pattern,message:P,ref:l,...$(Fe.pattern,P)},!n))return S(P),k}if(C){if(we(C)){const L=await C(w,r),P=Vn(L,M);if(P&&(k[g]={...P,...$(Fe.validate,P.message)},!n))return S(P.message),k}else if(ee(C)){let L={};for(const P in C){if(!ae(L)&&!n)break;const J=Vn(await C[P](w,r),M,P);J&&(L={...J,...$(P,J.message)},S(J.message),n&&(k[g]=L))}if(!ae(L)&&(k[g]={ref:M,...L},!n))return k}}return S(!0),k};const Ya={mode:ye.onSubmit,reValidateMode:ye.onChange,shouldFocusError:!0};function Ka(e={}){let t={...Ya,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:we(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),l={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,f=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const m={array:Nn(),state:Nn()},x=t.criteriaMode===ye.all,C=h=>v=>{clearTimeout(f),f=setTimeout(h,v)},g=async h=>{if(!t.disabled&&(u.isValid||d.isValid||h)){const v=t.resolver?ae((await T()).errors):await R(n,!0);v!==r.isValid&&m.state.next({isValid:v})}},y=(h,v)=>{!t.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((h||Array.from(a.mount)).forEach(b=>{b&&(v?z(r.validatingFields,b,v):te(r.validatingFields,b))}),m.state.next({validatingFields:r.validatingFields,isValidating:!ae(r.validatingFields)}))},V=(h,v=[],b,D,E=!0,N=!0)=>{if(D&&b&&!t.disabled){if(l.action=!0,N&&Array.isArray(F(n,h))){const I=b(F(n,h),D.argA,D.argB);E&&z(n,h,I)}if(N&&Array.isArray(F(r.errors,h))){const I=b(F(r.errors,h),D.argA,D.argB);E&&z(r.errors,h,I),Ga(r.errors,h)}if((u.touchedFields||d.touchedFields)&&N&&Array.isArray(F(r.touchedFields,h))){const I=b(F(r.touchedFields,h),D.argA,D.argB);E&&z(r.touchedFields,h,I)}(u.dirtyFields||d.dirtyFields)&&(r.dirtyFields=bt(s,i)),m.state.next({name:h,isDirty:A(h,v),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else z(i,h,v)},w=(h,v)=>{z(r.errors,h,v),m.state.next({errors:r.errors})},M=h=>{r.errors=h,m.state.next({errors:r.errors,isValid:!1})},S=(h,v,b,D)=>{const E=F(n,h);if(E){const N=F(i,h,Q(b)?F(s,h):b);Q(N)||D&&D.defaultChecked||v?z(i,h,v?N:On(E._f)):J(h,N),l.mount&&g()}},k=(h,v,b,D,E)=>{let N=!1,I=!1;const W={name:h};if(!t.disabled){if(!b||D){(u.isDirty||d.isDirty)&&(I=r.isDirty,r.isDirty=W.isDirty=A(),N=I!==W.isDirty);const U=Le(F(s,h),v);I=!!F(r.dirtyFields,h),U?te(r.dirtyFields,h):z(r.dirtyFields,h,!0),W.dirtyFields=r.dirtyFields,N=N||(u.dirtyFields||d.dirtyFields)&&I!==!U}if(b){const U=F(r.touchedFields,h);U||(z(r.touchedFields,h,b),W.touchedFields=r.touchedFields,N=N||(u.touchedFields||d.touchedFields)&&U!==b)}N&&E&&m.state.next(W)}return N?W:{}},O=(h,v,b,D)=>{const E=F(r.errors,h),N=(u.isValid||d.isValid)&&fe(v)&&r.isValid!==v;if(t.delayError&&b?(c=C(()=>w(h,b)),c(t.delayError)):(clearTimeout(f),c=null,b?z(r.errors,h,b):te(r.errors,h)),(b?!Le(E,b):E)||!ae(D)||N){const I={...D,...N&&fe(v)?{isValid:v}:{},errors:r.errors,name:h};r={...r,...I},m.state.next(I)}},T=async h=>{y(h,!0);const v=await t.resolver(i,t.context,Wa(h||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return y(h),v},B=async h=>{const{errors:v}=await T(h);if(h)for(const b of h){const D=F(v,b);D?z(r.errors,b,D):te(r.errors,b)}else r.errors=v;return v},R=async(h,v,b={valid:!0})=>{for(const D in h){const E=h[D];if(E){const{_f:N,...I}=E;if(N){const W=a.array.has(N.name),U=E._f&&Ja(E._f);U&&u.validatingFields&&y([D],!0);const me=await Dn(E,a.disabled,i,x,t.shouldUseNativeValidation&&!v,W);if(U&&u.validatingFields&&y([D]),me[N.name]&&(b.valid=!1,v))break;!v&&(F(me,N.name)?W?Xa(r.errors,me,N.name):z(r.errors,N.name,me[N.name]):te(r.errors,N.name))}!ae(I)&&await R(I,v,b)}}return b.valid},$=()=>{for(const h of a.unMount){const v=F(n,h);v&&(v._f.refs?v._f.refs.every(b=>!xr(b)):!xr(v._f.ref))&&Te(h)}a.unMount=new Set},A=(h,v)=>!t.disabled&&(h&&v&&z(i,h,v),!Le(Ae(),s)),L=(h,v,b)=>_s(h,a,{...l.mount?i:Q(v)?s:Ne(h)?{[h]:v}:v},b,v),P=h=>Ur(F(l.mount?i:s,h,t.shouldUnregister?F(s,h,[]):[])),J=(h,v,b={})=>{const D=F(n,h);let E=v;if(D){const N=D._f;N&&(!N.disabled&&z(i,h,Hs(v,N)),E=tr(N.ref)&&ie(v)?"":v,Rs(N.ref)?[...N.ref.options].forEach(I=>I.selected=E.includes(I.value)):N.refs?_t(N.ref)?N.refs.forEach(I=>{(!I.defaultChecked||!I.disabled)&&(Array.isArray(E)?I.checked=!!E.find(W=>W===I.value):I.checked=E===I.value||!!E)}):N.refs.forEach(I=>I.checked=I.value===E):Yr(N.ref)?N.ref.value="":(N.ref.value=E,N.ref.type||m.state.next({name:h,values:ne(i)})))}(b.shouldDirty||b.shouldTouch)&&k(h,E,b.shouldTouch,b.shouldDirty,!0),b.shouldValidate&&oe(h)},Y=(h,v,b)=>{for(const D in v){if(!v.hasOwnProperty(D))return;const E=v[D],N=h+"."+D,I=F(n,N);(a.array.has(h)||ee(E)||I&&!I._f)&&!Ze(E)?Y(N,E,b):J(N,E,b)}},q=(h,v,b={})=>{const D=F(n,h),E=a.array.has(h),N=ne(v);z(i,h,N),E?(m.array.next({name:h,values:ne(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&b.shouldDirty&&m.state.next({name:h,dirtyFields:bt(s,i),isDirty:A(h,N)})):D&&!D._f&&!ie(N)?Y(h,N,b):J(h,N,b),Ln(h,a)&&m.state.next({...r,name:h}),m.state.next({name:l.mount?h:void 0,values:ne(i)})},K=async h=>{l.mount=!0;const v=h.target;let b=v.name,D=!0;const E=F(n,b),N=U=>{D=Number.isNaN(U)||Ze(U)&&isNaN(U.getTime())||Le(U,F(i,b,U))},I=An(t.mode),W=An(t.reValidateMode);if(E){let U,me;const Jt=v.type?On(E._f):Vs(h),_e=h.type===er.BLUR||h.type===er.FOCUS_OUT,pi=!Ua(E._f)&&!t.resolver&&!F(r.errors,b)&&!E._f.deps||Za(_e,F(r.touchedFields,b),r.isSubmitted,W,I),mr=Ln(b,a,_e);z(i,b,Jt),_e?(E._f.onBlur&&E._f.onBlur(h),c&&c(0)):E._f.onChange&&E._f.onChange(h);const pr=k(b,Jt,_e),vi=!ae(pr)||mr;if(!_e&&m.state.next({name:b,type:h.type,values:ne(i)}),pi)return(u.isValid||d.isValid)&&(t.mode==="onBlur"?_e&&g():_e||g()),vi&&m.state.next({name:b,...mr?{}:pr});if(!_e&&mr&&m.state.next({...r}),t.resolver){const{errors:on}=await T([b]);if(N(Jt),D){const xi=Mn(r.errors,n,b),an=Mn(on,n,xi.name||b);U=an.error,b=an.name,me=ae(on)}}else y([b],!0),U=(await Dn(E,a.disabled,i,x,t.shouldUseNativeValidation))[b],y([b]),N(Jt),D&&(U?me=!1:(u.isValid||d.isValid)&&(me=await R(n,!0)));D&&(E._f.deps&&oe(E._f.deps),O(b,me,U,pr))}},je=(h,v)=>{if(F(r.errors,v)&&h.focus)return h.focus(),1},oe=async(h,v={})=>{let b,D;const E=Ct(h);if(t.resolver){const N=await B(Q(h)?h:E);b=ae(N),D=h?!E.some(I=>F(N,I)):b}else h?(D=(await Promise.all(E.map(async N=>{const I=F(n,N);return await R(I&&I._f?{[N]:I}:I)}))).every(Boolean),!(!D&&!r.isValid)&&g()):D=b=await R(n);return m.state.next({...!Ne(h)||(u.isValid||d.isValid)&&b!==r.isValid?{}:{name:h},...t.resolver||!h?{isValid:b}:{},errors:r.errors}),v.shouldFocus&&!D&&Nt(n,je,h?E:a.mount),D},Ae=h=>{const v={...l.mount?i:s};return Q(h)?v:Ne(h)?F(v,h):h.map(b=>F(v,b))},st=(h,v)=>({invalid:!!F((v||r).errors,h),isDirty:!!F((v||r).dirtyFields,h),error:F((v||r).errors,h),isValidating:!!F(r.validatingFields,h),isTouched:!!F((v||r).touchedFields,h)}),He=h=>{h&&Ct(h).forEach(v=>te(r.errors,v)),m.state.next({errors:h?r.errors:{}})},We=(h,v,b)=>{const D=(F(n,h,{_f:{}})._f||{}).ref,E=F(r.errors,h)||{},{ref:N,message:I,type:W,...U}=E;z(r.errors,h,{...U,...v,ref:D}),m.state.next({name:h,errors:r.errors,isValid:!1}),b&&b.shouldFocus&&D&&D.focus&&D.focus()},De=(h,v)=>we(h)?m.state.subscribe({next:b=>"values"in b&&h(L(void 0,v),b)}):L(h,v,!0),be=h=>m.state.subscribe({next:v=>{qa(h.name,v.name,h.exact)&&za(v,h.formState||u,Ht,h.reRenderRoot)&&h.callback({values:{...i},...r,...v,defaultValues:s})}}).unsubscribe,Je=h=>(l.mount=!0,d={...d,...h.formState},be({...h,formState:d})),Te=(h,v={})=>{for(const b of h?Ct(h):a.mount)a.mount.delete(b),a.array.delete(b),v.keepValue||(te(n,b),te(i,b)),!v.keepError&&te(r.errors,b),!v.keepDirty&&te(r.dirtyFields,b),!v.keepTouched&&te(r.touchedFields,b),!v.keepIsValidating&&te(r.validatingFields,b),!t.shouldUnregister&&!v.keepDefaultValue&&te(s,b);m.state.next({values:ne(i)}),m.state.next({...r,...v.keepDirty?{isDirty:A()}:{}}),!v.keepIsValid&&g()},Ce=({disabled:h,name:v})=>{(fe(h)&&l.mount||h||a.disabled.has(v))&&(h?a.disabled.add(v):a.disabled.delete(v))},Ue=(h,v={})=>{let b=F(n,h);const D=fe(v.disabled)||fe(t.disabled);return z(n,h,{...b||{},_f:{...b&&b._f?b._f:{ref:{name:h}},name:h,mount:!0,...v}}),a.mount.add(h),b?Ce({disabled:fe(v.disabled)?v.disabled:t.disabled,name:h}):S(h,!0,v.value),{...D?{disabled:v.disabled||t.disabled}:{},...t.progressive?{required:!!v.required,min:yt(v.min),max:yt(v.max),minLength:yt(v.minLength),maxLength:yt(v.maxLength),pattern:yt(v.pattern)}:{},name:h,onChange:K,onBlur:K,ref:E=>{if(E){Ue(h,v),b=F(n,h);const N=Q(E.value)&&E.querySelectorAll&&E.querySelectorAll("input,select,textarea")[0]||E,I=Pa(N),W=b._f.refs||[];if(I?W.find(U=>U===N):N===b._f.ref)return;z(n,h,{_f:{...b._f,...I?{refs:[...W.filter(xr),N,...Array.isArray(F(s,h))?[{}]:[]],ref:{type:N.type,name:h}}:{ref:N}}}),S(h,!1,void 0,N)}else b=F(n,h,{}),b._f&&(b._f.mount=!1),(t.shouldUnregister||v.shouldUnregister)&&!(Ds(a.array,h)&&l.action)&&a.unMount.add(h)}}},vt=()=>t.shouldFocusError&&Nt(n,je,a.mount),xt=h=>{fe(h)&&(m.state.next({disabled:h}),Nt(n,(v,b)=>{const D=F(n,b);D&&(v.disabled=D._f.disabled||h,Array.isArray(D._f.refs)&&D._f.refs.forEach(E=>{E.disabled=D._f.disabled||h}))},0,!1))},It=(h,v)=>async b=>{let D;b&&(b.preventDefault&&b.preventDefault(),b.persist&&b.persist());let E=ne(i);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:N,values:I}=await T();r.errors=N,E=ne(I)}else await R(n);if(a.disabled.size)for(const N of a.disabled)te(E,N);if(te(r.errors,"root"),ae(r.errors)){m.state.next({errors:{}});try{await h(E,b)}catch(N){D=N}}else v&&await v({...r.errors},b),vt(),setTimeout(vt);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ae(r.errors)&&!D,submitCount:r.submitCount+1,errors:r.errors}),D)throw D},Rt=(h,v={})=>{F(n,h)&&(Q(v.defaultValue)?q(h,ne(F(s,h))):(q(h,v.defaultValue),z(s,h,ne(v.defaultValue))),v.keepTouched||te(r.touchedFields,h),v.keepDirty||(te(r.dirtyFields,h),r.isDirty=v.defaultValue?A(h,ne(F(s,h))):A()),v.keepError||(te(r.errors,h),u.isValid&&g()),m.state.next({...r}))},Bt=(h,v={})=>{const b=h?ne(h):s,D=ne(b),E=ae(h),N=E?s:D;if(v.keepDefaultValues||(s=b),!v.keepValues){if(v.keepDirtyValues){const I=new Set([...a.mount,...Object.keys(bt(s,i))]);for(const W of Array.from(I))F(r.dirtyFields,W)?z(N,W,F(i,W)):q(W,F(N,W))}else{if(Jr&&Q(h))for(const I of a.mount){const W=F(n,I);if(W&&W._f){const U=Array.isArray(W._f.refs)?W._f.refs[0]:W._f.ref;if(tr(U)){const me=U.closest("form");if(me){me.reset();break}}}}if(v.keepFieldsRef)for(const I of a.mount)q(I,F(N,I));else n={}}i=t.shouldUnregister?v.keepDefaultValues?ne(s):{}:ne(N),m.array.next({values:{...N}}),m.state.next({values:{...N}})}a={mount:v.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!u.isValid||!!v.keepIsValid||!!v.keepDirtyValues,l.watch=!!t.shouldUnregister,m.state.next({submitCount:v.keepSubmitCount?r.submitCount:0,isDirty:E?!1:v.keepDirty?r.isDirty:!!(v.keepDefaultValues&&!Le(h,s)),isSubmitted:v.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:E?{}:v.keepDirtyValues?v.keepDefaultValues&&i?bt(s,i):r.dirtyFields:v.keepDefaultValues&&h?bt(s,h):v.keepDirty?r.dirtyFields:{},touchedFields:v.keepTouched?r.touchedFields:{},errors:v.keepErrors?r.errors:{},isSubmitSuccessful:v.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Pt=(h,v)=>Bt(we(h)?h(i):h,v),$t=(h,v={})=>{const b=F(n,h),D=b&&b._f;if(D){const E=D.refs?D.refs[0]:D.ref;E.focus&&(E.focus(),v.shouldSelect&&we(E.select)&&E.select())}},Ht=h=>{r={...r,...h}},Wt={control:{register:Ue,unregister:Te,getFieldState:st,handleSubmit:It,setError:We,_subscribe:be,_runSchema:T,_focusError:vt,_getWatch:L,_getDirty:A,_setValid:g,_setFieldArray:V,_setDisabledField:Ce,_setErrors:M,_getFieldArray:P,_reset:Bt,_resetDefaultValues:()=>we(t.defaultValues)&&t.defaultValues().then(h=>{Pt(h,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:xt,_subjects:m,_proxyFormState:u,get _fields(){return n},get _formValues(){return i},get _state(){return l},set _state(h){l=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:Je,trigger:oe,register:Ue,handleSubmit:It,watch:De,setValue:q,getValues:Ae,reset:Pt,resetField:Rt,clearErrors:He,unregister:Te,setError:We,setFocus:$t,getFieldState:st};return{...Wt,formControl:Wt}}function Qa(e={}){const t=p.useRef(void 0),r=p.useRef(void 0),[n,s]=p.useState({isDirty:!1,isValidating:!1,isLoading:we(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:we(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!we(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...a}=Ka(e);t.current={...a,formState:n}}const i=t.current.control;return i._options=e,Zr(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),i._formState.isReady=!0,l},[i]),p.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),p.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),p.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),p.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),p.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==n.isDirty&&i._subjects.state.next({isDirty:l})}},[i,n.isDirty]),p.useEffect(()=>{e.values&&!Le(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),r.current=e.values,s(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),p.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=Ts(n,i),t.current}const Tn=(e,t,r)=>{if(e&&"reportValidity"in e){const n=F(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Js=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Tn(n.ref,r,e):n.refs&&n.refs.forEach(s=>Tn(s,r,e))}},el=(e,t)=>{t.shouldUseNativeValidation&&Js(e,t);const r={};for(const n in e){const s=F(t.fields,n),i=Object.assign(e[n]||{},{ref:s&&s.ref});if(tl(t.names||Object.keys(e),n)){const l=Object.assign({},F(r,n));z(l,"root",i),z(r,n,l)}else z(r,n,i)}return r},tl=(e,t)=>e.some(r=>r.startsWith(t+"."));function rl(e,t,r){return t===void 0&&(t={}),r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(l,a){try{var c=(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&&Js({},i),{values:r.raw?n:f,errors:{}}}))}catch(f){return a(f)}return c&&c.then?c.then(void 0,a):c}(0,function(l){if(!l.inner)throw l;return{values:{},errors:el((a=l,c=!i.shouldUseNativeValidation&&i.criteriaMode==="all",(a.inner||[]).reduce(function(f,u){if(f[u.path]||(f[u.path]={message:u.message,type:u.type}),c){var d=f[u.path].types,m=d&&d[u.type];f[u.path]=Is(u.path,c,f,u.type,m?[].concat(m,u.message):u.message)}return f},{})),i)};var a,c}))}catch(l){return Promise.reject(l)}}}function nl({className:e,name:t,children:r,mode:n="onBlur",reValidateMode:s="onBlur",defaultValues:i,schema:l,formProps:a,onSubmit:c=()=>null,onChange:f}){const u=Qa({mode:n,reValidateMode:s,defaultValues:i,resolver:l?rl(l):void 0});return p.useEffect(()=>{if(!f)return;const{unsubscribe:d}=u.watch(f);return d},[f,u.watch]),o.jsx(Ra,{...u,children:o.jsx("form",{className:j.twJoin("bbn-form",e),name:t,onSubmit:u.handleSubmit(c),...a,children:r})})}function nt({name:e,defaultValue:t,disabled:r=!1,autoFocus:n=!1,shouldUnregister:s=!1,validateOnMount:i=!0}){const{setFocus:l,trigger:a}=rt(),{field:c,fieldState:f}=Ba({name:e,defaultValue:t,disabled:r,shouldUnregister:s}),{invalid:u,isTouched:d,error:m}=f;return p.useEffect(()=>{i?a(e,{shouldFocus:n}):n&&l(e)},[e,i]),{...c,value:c.value,invalid:u&&d,error:(m==null?void 0:m.message)??""}}function sl(e){const{getFieldState:t}=rt(),r=Gr({name:e});return Array.isArray(e)?e.map(s=>t(s,r)):t(e,r)}const il=/^-?\d*\.?\d*$/;function ol({name:e,id:t=e,label:r,hint:n,className:s,controlClassName:i,disabled:l,autoFocus:a,defaultValue:c,placeholder:f,type:u,suffix:d,prefix:m,shouldUnregister:x,state:C,validateOnMount:g}){const{ref:y,value:V="",error:w,invalid:M,onChange:S,onBlur:k}=nt({name:e,defaultValue:c,autoFocus:a,shouldUnregister:x,validateOnMount:g}),O=M?"error":C,T=M?w:n,B=R=>{il.test(R.target.value)&&S(R.target.value)};return o.jsx(Mt,{label:r,className:i,state:O,hint:T,children:o.jsx(Lt,{inputMode:"decimal",pattern:"^-?\\d*\\.?\\d*$",ref:y,value:V,id:t,name:e,type:u,className:s,disabled:l,autoFocus:a,placeholder:f,suffix:d,prefix:m,state:O,onChange:B,onBlur:k})})}function al({name:e,id:t=e,label:r,hint:n,className:s,controlClassName:i,disabled:l,autoFocus:a,defaultValue:c,placeholder:f,type:u,suffix:d,prefix:m,shouldUnregister:x,state:C,validateOnMount:g}){const{ref:y,value:V="",error:w,invalid:M,onChange:S,onBlur:k}=nt({name:e,defaultValue:c,autoFocus:a,shouldUnregister:x,validateOnMount:g}),O=M?"error":C,T=M?w:n;return o.jsx(Mt,{label:r,className:i,state:O,hint:T,children:o.jsx(Lt,{ref:y,value:V,id:t,name:e,type:u,className:s,disabled:l,autoFocus:a,placeholder:f,suffix:d,prefix:m,state:O,onChange:S,onBlur:k})})}function ll({name:e,id:t=e,label:r,className:n,disabled:s,value:i,defaultChecked:l,labelClassName:a,orientation:c}){const{ref:f,value:u=!1,onChange:d,onBlur:m}=nt({name:e});return o.jsx($n,{ref:f,name:e,checked:u,id:t,label:r,className:n,disabled:s,value:i,defaultChecked:l,labelClassName:a,orientation:c,inputProps:{onChange:d,onBlur:m}})}function cl({name:e,id:t=e,label:r,className:n,disabled:s,value:i,defaultChecked:l,labelClassName:a,orientation:c}){const{ref:f,value:u,onChange:d,onBlur:m}=nt({name:e,disabled:s,defaultValue:l?i:void 0});return o.jsx(Hn,{ref:f,name:e,id:t,label:r,className:n,disabled:s,checked:u===i,value:i,labelClassName:a,orientation:c,inputProps:{onChange:d,onBlur:m}})}function ul({open:e,defaultOpen:t,options:r,optionClassName:n,popoverClassName:s,name:i,id:l=i,label:a,hint:c,className:f,controlClassName:u,disabled:d,autoFocus:m,defaultValue:x,placeholder:C,shouldUnregister:g,state:y,validateOnMount:V,onOpen:w,onClose:M,renderSelectedOption:S}){const{ref:k,value:O="",error:T,invalid:B,onChange:R,onBlur:$}=nt({name:i,defaultValue:x,autoFocus:m,shouldUnregister:g,validateOnMount:V}),A=B?"error":y,L=B?T:c,P=()=>{$==null||$(),M==null||M()};return o.jsx(Mt,{label:a,className:u,state:A,hint:L,children:o.jsx(_r,{open:e,defaultOpen:t,options:r,ref:k,value:O,id:l,name:i,className:f,disabled:d,placeholder:C,state:A,optionClassName:n,popoverClassName:s,onSelect:R,onBlur:$,onOpen:w,onClose:P,renderSelectedOption:S})})}function Us({displayError:e=!1,...t}){const{error:r,value:n,onChange:s,onBlur:i,disabled:l,name:a,ref:c}=nt(t),f=o.jsx("input",{ref:c,type:"hidden",name:a,disabled:l,value:n,onChange:s,onBlur:i});if(e){const u=e?"error":"default",d=e?r:"";return o.jsx(Mt,{hint:d,state:u,children:f})}return f}const fl={lg:{logo:"size-10",subLogo:"text-[0.8rem]"},md:{logo:"size-6",subLogo:"text-[0.5rem]"},sm:{logo:"size-5",subLogo:"text-[0.4rem]"}},zs=({logoUrl:e,rank:t,moniker:r,size:n="md",className:s})=>{const[i,l]=p.useState(!1),a=fl[n],c=(r==null?void 0:r.charAt(0).toUpperCase())??String(t);return o.jsx("span",{className:j.twMerge("relative inline-block",a.logo,s),children:e&&!i?o.jsx("img",{src:e,alt:r||`Finality Provider ${t}`,className:"h-full w-full rounded-full object-cover",onError:()=>l(!0)}):o.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:c})})};function Qr({bsnId:e,bsnName:t,bsnLogoUrl:r,address:n,provider:s,onRemove:i,showChain:l=!0}){var u,d;if(!s)return null;const a=()=>{if(r)return o.jsx(ot,{url:r,alt:t,variant:"rounded",size:"tiny",className:"mr-1"});const m=(t==null?void 0:t.charAt(0).toUpperCase())||"?";return o.jsx(ot,{variant:"rounded",size:"tiny",className:"mr-1",children:o.jsx(H,{as:"span",className:"inline-flex h-full w-full items-center justify-center bg-secondary-main text-xs text-accent-contrast",children:m})})},c=m=>!m||m.length<=12?m:`${m.slice(0,6)}...${m.slice(-6)}`,f=()=>l?n?o.jsxs("div",{className:"flex items-center gap-1 text-xs text-accent-secondary",children:[c(n),o.jsx(Fs,{value:n,className:"cursor-pointer",copiedText:"✓",children:o.jsx(cr,{size:12})})]}):o.jsxs("div",{className:"flex items-center text-xs text-accent-secondary",children:[a(),t]}):null;return o.jsxs("div",{className:"flex flex-row items-center justify-between",children:[o.jsxs("div",{className:"flex h-10 flex-row gap-2",children:[o.jsx("div",{className:"shrink-0",children:o.jsx(zs,{logoUrl:s.logo_url,rank:s.rank,moniker:(u=s.description)==null?void 0:u.moniker,size:"lg"})}),o.jsxs("div",{className:"flex flex-col justify-center text-accent-primary",children:[f(),o.jsx(H,{as:"div",className:"text-base font-medium text-accent-primary",children:(d=s.description)==null?void 0:d.moniker})]})]}),i?o.jsx("button",{onClick:()=>i(e),className:"ml-[10px] flex items-center justify-center cursor-pointer p-1",children:o.jsx(Rr,{size:12})}):null]})}const dl=({attributes:e,providerItemProps:t,isSelected:r=!1,isSelectable:n=!0,onSelect:s})=>o.jsxs("div",{className:"bg-secondary-highlight h-[316px] overflow-hidden p-4 flex flex-col rounded justify-between",children:[o.jsx(Qr,{...t}),o.jsx("div",{className:"w-full h-px bg-secondary-strokeLight"}),Object.entries(e).map(([i,l])=>o.jsxs("div",{className:"text-sm flex flex-row justify-between first:mt-0 mt-1",children:[o.jsx("div",{className:"text-accent-secondary",children:i}),o.jsx("div",{className:"text-accent-primary font-medium",children:l})]},i)),s&&o.jsx(ue,{className:"mt-4",onClick:s,disabled:!n,variant:r?"contained":"outlined",children:r?"Selected":"Select"})]}),en=8,hl=5,hr=640,qs=500;function ml(e){return Re({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"},child:[]}]})(e)}function pl({className:e,...t}){const n=tt(hr)?et:Vt;return o.jsx(n,{...t,className:j.twMerge("w-[41.25rem] max-w-full",e)})}const vl=({open:e,validators:t,columns:r,onClose:n,onSelect:s,title:i="",description:l})=>{const[a,c]=p.useState(""),f=()=>{c("")},u=a?o.jsx("button",{onClick:f,className:"opacity-60 hover:opacity-100 transition-opacity",children:o.jsx(ml,{size:18,className:"text-secondary-strokeDark"})}):o.jsx("span",{className:"text-secondary-strokeDark",children:o.jsx(Ii,{size:20})}),d=p.useMemo(()=>a.trim()?t.filter(m=>m.name.toLowerCase().includes(a.toLowerCase())):t,[t,a]);return o.jsxs(pl,{open:e,onClose:n,children:[o.jsx(Dt,{title:i,onClose:n,className:"text-accent-primary"}),o.jsxs(Tt,{style:{maxHeight:qs},className:"no-scrollbar mt-4 flex flex-col gap-6 overflow-y-auto text-accent-primary",children:[l&&o.jsx("div",{children:o.jsx(H,{variant:"body2",className:"text-accent-secondary",children:l})}),o.jsx("div",{children:o.jsx(Lt,{placeholder:"Search",value:a,onChange:m=>c(m.target.value),prefix:u,className:"w-full"})}),o.jsx(js,{data:d,columns:r,className:"w-full",wrapperClassName:"w-full",onRowSelect:m=>{m&&(s(m),n())}})]})]})};var mt=1e9,xl={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},rn,X=!0,ge="[DecimalError] ",Xe=ge+"Invalid argument: ",tn=ge+"Exponent out of range: ",pt=Math.floor,ze=Math.pow,gl=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,de,se=1e7,G=7,Zs=9007199254740991,sr=pt(Zs/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 Me(this,new this.constructor(e))};_.dividedToIntegerBy=_.idiv=function(e){var t=this,r=t.constructor;return Z(Me(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(de))throw Error(ge+"NaN");if(r.s<1)throw Error(ge+(r.s?"NaN":"-Infinity"));return r.eq(de)?new n(0):(X=!1,t=Me(Et(r,i),Et(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?Ys(t,e):Gs(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=Me(r,e,0,1).times(e),X=!0,r.minus(t)):Z(new n(r),s)};_.naturalExponential=_.exp=function(){return Xs(this)};_.naturalLogarithm=_.ln=function(){return Et(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?Gs(t,e):Ys(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(Xe+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,l,a=this,c=a.constructor;if(a.s<1){if(!a.s)return new c(0);throw Error(ge+"NaN")}for(e=re(a),X=!1,s=Math.sqrt(+a),s==0||s==1/0?(t=Se(a.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=pt((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 c(t)):n=new c(s.toString()),r=c.precision,s=l=r+3;;)if(i=n,n=i.plus(Me(a,i,l+2)).times(.5),Se(i.d).slice(0,l)===(t=Se(n.d)).slice(0,l)){if(t=t.slice(l-3,l+1),s==l&&t=="4999"){if(Z(i,r+1,0),i.times(i).eq(a)){n=i;break}}else if(t!="9999")break;l+=4}return X=!0,Z(n,r)};_.times=_.mul=function(e){var t,r,n,s,i,l,a,c,f,u=this,d=u.constructor,m=u.d,x=(e=new d(e)).d;if(!u.s||!e.s)return new d(0);for(e.s*=u.s,r=u.e+e.e,c=m.length,f=x.length,c<f&&(i=m,m=x,x=i,l=c,c=f,f=l),i=[],l=c+f,n=l;n--;)i.push(0);for(n=f;--n>=0;){for(t=0,s=c+n;s>n;)a=i[s]+x[n]*m[s-n-1]+t,i[s--]=a%se|0,t=a/se|0;i[s]=(i[s]+t)%se|0}for(;!i[--l];)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,mt),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=Qe(n,!0):(Oe(e,0,mt),t===void 0?t=s.rounding:Oe(t,0,8),n=Z(new s(n),e+1,t),r=Qe(n,!0,e+1)),r};_.toFixed=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?Qe(s):(Oe(e,0,mt),t===void 0?t=i.rounding:Oe(t,0,8),n=Z(new i(s),e+re(s)+1,t),r=Qe(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,l,a=this,c=a.constructor,f=12,u=+(e=new c(e));if(!e.s)return new c(de);if(a=new c(a),!a.s){if(e.s<1)throw Error(ge+"Infinity");return a}if(a.eq(de))return a;if(n=c.precision,e.eq(de))return Z(a,n);if(t=e.e,r=e.d.length-1,l=t>=r,i=a.s,l){if((r=u<0?-u:u)<=Zs){for(s=new c(de),t=Math.ceil(n/G+4),X=!1;r%2&&(s=s.times(a),In(s.d,t)),r=pt(r/2),r!==0;)a=a.times(a),In(a.d,t);return X=!0,e.s<0?new c(de).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(Et(a,n+f)),X=!0,s=Xs(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=Qe(s,r<=i.toExpNeg||r>=i.toExpPos)):(Oe(e,1,mt),t===void 0?t=i.rounding:Oe(t,0,8),s=Z(new i(s),e,t),r=re(s),n=Qe(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,mt),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 Qe(e,t<=r.toExpNeg||t>=r.toExpPos)};function Gs(e,t){var r,n,s,i,l,a,c,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(c=e.d,f=t.d,l=e.e,s=t.e,c=c.slice(),i=l-s,i){for(i<0?(n=c,i=-i,a=f.length):(n=f,s=l,a=c.length),l=Math.ceil(d/G),a=l>a?l+1:a+1,i>a&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(a=c.length,i=f.length,a-i<0&&(i=a,n=f,f=c,c=n),r=0;i;)r=(c[--i]=c[i]+f[i]+r)/se|0,c[i]%=se;for(r&&(c.unshift(r),++s),a=c.length;c[--a]==0;)c.pop();return t.d=c,t.e=s,X?Z(t,d):t}function Oe(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Xe+e)}function Se(e){var t,r,n,s=e.length-1,i="",l=e[0];if(s>0){for(i+=l,t=1;t<s;t++)n=e[t]+"",r=G-n.length,r&&(i+=Ie(r)),i+=n;l=e[t],n=l+"",r=G-n.length,r&&(i+=Ie(r))}else if(l===0)return"0";for(;l%10===0;)l/=10;return i+l}var Me=function(){function e(n,s){var i,l=0,a=n.length;for(n=n.slice();a--;)i=n[a]*s+l,n[a]=i%se|0,l=i/se|0;return l&&n.unshift(l),n}function t(n,s,i,l){var a,c;if(i!=l)c=i>l?1:-1;else for(a=c=0;a<i;a++)if(n[a]!=s[a]){c=n[a]>s[a]?1:-1;break}return c}function r(n,s,i){for(var l=0;i--;)n[i]-=l,l=n[i]<s[i]?1:0,n[i]=l*se+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,i,l){var a,c,f,u,d,m,x,C,g,y,V,w,M,S,k,O,T,B,R=n.constructor,$=n.s==s.s?1:-1,A=n.d,L=s.d;if(!n.s)return new R(n);if(!s.s)throw Error(ge+"Division by zero");for(c=n.e-s.e,T=L.length,k=A.length,x=new R($),C=x.d=[],f=0;L[f]==(A[f]||0);)++f;if(L[f]>(A[f]||0)&&--c,i==null?w=i=R.precision:l?w=i+(re(n)-re(s))+1:w=i,w<0)return new R(0);if(w=w/G+2|0,f=0,T==1)for(u=0,L=L[0],w++;(f<k||u)&&w--;f++)M=u*se+(A[f]||0),C[f]=M/L|0,u=M%L|0;else{for(u=se/(L[0]+1)|0,u>1&&(L=e(L,u),A=e(A,u),T=L.length,k=A.length),S=T,g=A.slice(0,T),y=g.length;y<T;)g[y++]=0;B=L.slice(),B.unshift(0),O=L[0],L[1]>=se/2&&++O;do u=0,a=t(L,g,T,y),a<0?(V=g[0],T!=y&&(V=V*se+(g[1]||0)),u=V/O|0,u>1?(u>=se&&(u=se-1),d=e(L,u),m=d.length,y=g.length,a=t(d,g,m,y),a==1&&(u--,r(d,T<m?B:L,m))):(u==0&&(a=u=1),d=L.slice()),m=d.length,m<y&&d.unshift(0),r(g,d,y),a==-1&&(y=g.length,a=t(L,g,T,y),a<1&&(u++,r(g,T<y?B:L,y))),y=g.length):a===0&&(u++,g=[0]),C[f++]=u,a&&g[0]?g[y++]=A[S]||0:(g=[A[S]],y=1);while((S++<k||g[0]!==void 0)&&w--)}return C[0]||C.shift(),x.e=c,Z(x,l?i+re(x)+1:i)}}();function Xs(e,t){var r,n,s,i,l,a,c=0,f=0,u=e.constructor,d=u.precision;if(re(e)>16)throw Error(tn+re(e));if(!e.s)return new u(de);for(X=!1,a=d,l=new u(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(n=Math.log(ze(2,f))/Math.LN10*2+5|0,a+=n,r=s=i=new u(de),u.precision=a;;){if(s=Z(s.times(e),a),r=r.times(++c),l=i.plus(Me(s,r,a)),Se(l.d).slice(0,a)===Se(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=l}}function re(e){for(var t=e.e*G,r=e.d[0];r>=10;r/=10)t++;return t}function gr(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 Ie(e){for(var t="";e--;)t+="0";return t}function Et(e,t){var r,n,s,i,l,a,c,f,u,d=1,m=10,x=e,C=x.d,g=x.constructor,y=g.precision;if(x.s<1)throw Error(ge+(x.s?"NaN":"-Infinity"));if(x.eq(de))return new g(0);if(t==null?(X=!1,f=y):f=t,x.eq(10))return t==null&&(X=!0),gr(g,f);if(f+=m,g.precision=f,r=Se(C),n=r.charAt(0),i=re(x),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)x=x.times(e),r=Se(x.d),n=r.charAt(0),d++;i=re(x),n>1?(x=new g("0."+r),i++):x=new g(n+"."+r.slice(1))}else return c=gr(g,f+2,y).times(i+""),x=Et(new g(n+"."+r.slice(1)),f-m).plus(c),g.precision=y,t==null?(X=!0,Z(x,y)):x;for(a=l=x=Me(x.minus(de),x.plus(de),f),u=Z(x.times(x),f),s=3;;){if(l=Z(l.times(u),f),c=a.plus(Me(l,new g(s),f)),Se(c.d).slice(0,f)===Se(a.d).slice(0,f))return a=a.times(2),i!==0&&(a=a.plus(gr(g,f+2,y).times(i+""))),a=Me(a,new g(d),f),g.precision=y,t==null?(X=!0,Z(a,y)):a;a=c,s+=2}}function _n(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=pt(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>sr||e.e<-sr))throw Error(tn+r)}else e.s=0,e.e=0,e.d=[0];return e}function Z(e,t,r){var n,s,i,l,a,c,f,u,d=e.d;for(l=1,i=d[0];i>=10;i/=10)l++;if(n=t-l,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],l=1;i>=10;i/=10)l++;n%=G,s=n-G+l}if(r!==void 0&&(i=ze(10,l-s-1),a=f/i%10|0,c=t<0||d[u+1]!==void 0||f%i,c=r<4?(a||c)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||c||r==6&&(n>0?s>0?f/ze(10,l-s):0:d[u-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return c?(i=re(e),d.length=1,t=t-i-1,d[0]=ze(10,(G-t%G)%G),e.e=pt(-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=ze(10,G-n),d[u]=s>0?(f/ze(10,l-s)%ze(10,s)|0)*i:0),c)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>sr||e.e<-sr))throw Error(tn+re(e));return e}function Ys(e,t){var r,n,s,i,l,a,c,f,u,d,m=e.constructor,x=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),X?Z(t,x):t;if(c=e.d,d=t.d,n=t.e,f=e.e,c=c.slice(),l=f-n,l){for(u=l<0,u?(r=c,l=-l,a=d.length):(r=d,n=f,a=c.length),s=Math.max(Math.ceil(x/G),a)+2,l>s&&(l=s,r.length=1),r.reverse(),s=l;s--;)r.push(0);r.reverse()}else{for(s=c.length,a=d.length,u=s<a,u&&(a=s),s=0;s<a;s++)if(c[s]!=d[s]){u=c[s]<d[s];break}l=0}for(u&&(r=c,c=d,d=r,t.s=-t.s),a=c.length,s=d.length-a;s>0;--s)c[a++]=0;for(s=d.length;s>l;){if(c[--s]<d[s]){for(i=s;i&&c[--i]===0;)c[i]=se-1;--c[i],c[s]+=se}c[s]-=d[s]}for(;c[--a]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,X?Z(t,x):t):new m(0)}function Qe(e,t,r){var n,s=re(e),i=Se(e.d),l=i.length;return t?(r&&(n=r-l)>0?i=i.charAt(0)+"."+i.slice(1)+Ie(n):l>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Ie(-s-1)+i,r&&(n=r-l)>0&&(i+=Ie(n))):s>=l?(i+=Ie(s+1-l),r&&(n=r-s-1)>0&&(i=i+"."+Ie(n))):((n=s+1)<l&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-l)>0&&(s+1===l&&(i+="."),i+=Ie(n))),e.s<0?"-"+i:i}function In(e,t){if(e.length>t)return e.length=t,!0}function Ks(e){var t,r,n;function s(i){var l=this;if(!(l instanceof s))return new s(i);if(l.constructor=s,i instanceof s){l.s=i.s,l.e=i.e,l.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Xe+i);if(i>0)l.s=1;else if(i<0)i=-i,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(i===~~i&&i<1e7){l.e=0,l.d=[i];return}return _n(l,i.toString())}else if(typeof i!="string")throw Error(Xe+i);if(i.charCodeAt(0)===45?(i=i.slice(1),l.s=-1):l.s=1,gl.test(i))_n(l,i);else throw Error(Xe+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=Ks,s.config=s.set=bl,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 bl(e){if(!e||typeof e!="object")throw Error(ge+"Object expected");var t,r,n,s=["precision",1,mt,"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(pt(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(Xe+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Xe+r+": "+n);return this}var rn=Ks(xl);de=new rn(1);const yl={prefix:"$",precision:2,zeroDisplay:"-",format:{minimumFractionDigits:2,maximumFractionDigits:2}};function wl(e,t={}){const{prefix:r,precision:n,zeroDisplay:s,format:i}={...yl,...t};if(e===0)return s;const l=e.toLocaleString("en",i??{maximumFractionDigits:n});return`${r}${l}`}function Qs(e,t,r){const n=e*t;return wl(n,r)}const jl=(e,t,r)=>new rn(e).toDecimalPlaces(t,r).toNumber(),Cl=({fieldName:e,currencyIcon:t,currencyName:r,displayBalance:n,placeholder:s="Enter Amount",balanceDetails:i,prefix:l,min:a="0",step:c="any",autoFocus:f=!0,decimals:u})=>{const d=Xr({name:e,defaultValue:""}),{setValue:m}=rt(),x=parseFloat(d||"0"),C=Qs(x,(i==null?void 0:i.price)??0,{zeroDisplay:"$0.00"}),g=w=>{let M=w.target.value;if(u!==void 0&&u>=0){const[S,k]=M.split(".",2);k!==void 0&&k.length>u?M=S+"."+k.slice(0,u):k!==void 0?M=S+"."+k:M.includes(".")&&(M=S)}m(e,M,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},y=w=>{(w.key==="ArrowUp"||w.key==="ArrowDown")&&w.preventDefault()};let V;return i&&(V=`${jl(Number(i.balance),i.decimals??en)} ${i.symbol}`,l&&(V=`${l}: ${V}`)),o.jsxs(o.Fragment,{children:[o.jsx(Us,{name:e,defaultValue:""}),o.jsx(ht,{className:"flex w-full flex-col content-center justify-between gap-4",children:o.jsx(fr,{amount:d,currencyIcon:t,currencyName:r,placeholder:s,displayBalance:n,balanceDetails:i,min:a,step:c,autoFocus:f,onChange:g,onKeyDown:y,amountUsd:C,subtitle:V})})]})};function Nl({items:e,onRemove:t,showChain:r=!0}){const n=p.useMemo(()=>e,[e]);return n.length===0?null:o.jsx("div",{className:"flex flex-col gap-8",children:n.map(({bsnId:s,bsnName:i,bsnLogoUrl:l,provider:a})=>o.jsx(Qr,{bsnId:s,bsnName:i,bsnLogoUrl:l,provider:a,onRemove:t,showChain:r},`${s}-${a.rank}`))})}function Sl({max:e,items:t=[],actionText:r,onAdd:n,onRemove:s,showChain:i=!0}){const l=p.useMemo(()=>t.length,[t]);return o.jsx(ht,{children:o.jsxs("div",{className:"flex w-full flex-col gap-4",children:[o.jsx("div",{className:"flex flex-row",children:o.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[o.jsx("span",{className:"text-sm sm:text-base",children:r}),o.jsx(ks,{counter:l,max:e,onAdd:n})]})}),l>0&&o.jsx(Nl,{items:t,onRemove:s,showChain:i})]})})}function ft({title:e,children:t,className:r,hint:n}){return o.jsxs("div",{className:j.twMerge("flex flex-row items-center justify-between text-accent-primary",n&&"items-start",r),children:[o.jsx(H,{as:"div",variant:"body1",children:e}),n?o.jsxs("div",{className:"flex flex-col items-end",children:[o.jsx(H,{as:"div",className:"flex items-center gap-2",children:t}),o.jsx(H,{as:"div",variant:"body2",className:"text-accent-secondary",children:n})]}):o.jsx(H,{as:"div",className:"flex items-center gap-2",children:t})]})}function kl(e){return Re({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 ei({value:e,onEdit:t,title:r="Network Fee Rate",className:n}){return o.jsxs(ft,{title:r,className:n,children:[o.jsxs("span",{children:[e," sats/vB"]}),t&&o.jsx(ue,{size:"small",variant:"outlined",className:"h-6 w-6 pl-1 text-secondary-strokeDark",onClick:t,children:o.jsx(kl,{size:16,className:"text-secondary-strokeDark"})})]})}function ti({amount:e,coinSymbol:t,hint:r,title:n,className:s,decimals:i=en}){let l;return typeof e=="number"?e===0?l="0":l=e.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):l=e,o.jsxs(ft,{title:n??`${t} Network Fee`,hint:r,className:s,children:[l," ",t]})}function ri({amount:e,coinSymbol:t,hint:r,title:n,className:s,decimals:i=hl}){const l=typeof e=="number"?e.toFixed(i):e;return o.jsxs(ft,{title:n??`${t} Network Fee`,hint:r,className:s,children:[l," ",t]})}function ni({total:e,coinSymbol:t,hint:r,title:n="Total",className:s,decimals:i=en}){let l;return typeof e=="number"?e===0?l="0":l=e.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):l=e,o.jsxs("div",{className:j.twMerge("flex flex-row items-start justify-between text-accent-primary",s),children:[o.jsx(H,{variant:"body1",className:"font-bold",children:n}),o.jsxs("div",{className:"flex flex-col items-end justify-center",children:[o.jsxs(H,{variant:"body1",className:"font-bold",children:[l," ",t]}),r&&o.jsx(H,{variant:"body1",className:"text-sm text-accent-secondary",children:r})]})]})}function El({className:e,feeRate:t,onFeeRateEdit:r,feeAmount:n,coinSymbol:s,feeAmountHint:i,total:l,totalHint:a,bbnFeeAmount:c,bbnCoinSymbol:f,bbnFeeAmountHint:u,bbnFeeDecimals:d}){return o.jsx(ht,{className:j.twMerge("flex w-full flex-col content-center justify-between gap-4",e),children:o.jsxs("div",{className:"flex flex-col gap-6 p-4",children:[t!==void 0&&o.jsx(ei,{value:t,onEdit:r}),n!==void 0&&s!==void 0&&o.jsx(ti,{amount:n,coinSymbol:s,hint:i}),c!==void 0&&f?o.jsx(ri,{amount:c,coinSymbol:f,hint:u,decimals:d}):null,l!==void 0&&s!==void 0&&o.jsx("div",{className:"divider my-4"}),l!==void 0&&s!==void 0&&o.jsx(ni,{total:l,coinSymbol:s,hint:a})]})})}const Ol=({data:e})=>{if(!e||e.length===0)return null;const t=e[0],r=e.slice(1),s={gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`};return o.jsx(Cs,{className:"p-6 pt-4",children:o.jsxs("div",{className:"flex flex-col",children:[o.jsx("div",{className:"items-center gap-4 pb-4 grid",style:s,children:t.map((i,l)=>o.jsx(H,{variant:"caption",className:"text-secondary px-2.5",children:i},`header-${l}`))}),r.map((i,l)=>o.jsx("div",{className:"items-center gap-4 rounded bg-primary-contrast p-1 grid",style:s,children:i.map((a,c)=>o.jsx("div",{className:"flex w-full items-center gap-2 py-1 px-2.5",children:a},`cell-${l}-${c}`))},`row-${l}`))]})})};function Al({className:e,...t}){const n=tt(hr)?et:Vt;return o.jsx(n,{...t,className:j.twMerge("w-[41.25rem] max-w-full",e)})}const Fl=({open:e,processing:t=!1,onClose:r,onProceed:n,bsns:s,finalityProviders:i,details:l,visibleFields:a,attentionText:c,proceedLabel:f="Proceed to Signing"})=>{const u=[{label:"Stake Amount",value:l.stakeAmount},{label:"Fee Rate",value:l.feeRate},{label:"Transaction Fees",value:l.transactionFees},{label:"Term",value:o.jsxs(o.Fragment,{children:[l.term.blocks,o.jsx("br",{}),o.jsx("span",{className:"text-md text-secondary",children:l.term.duration})]})},{label:"Unbonding",value:l.unbonding},{label:"Unbonding Fee",value:l.unbondingFee}],d=a&&a.length>0?u.filter(C=>a.includes(C.label)):u,x=!i||i.length===0?[["Validator"],...s.map((C,g)=>[o.jsxs("div",{className:"flex w-full items-center gap-2 py-1",children:[C.icon,o.jsx(H,{variant:"body2",className:"font-medium",children:C.name})]},`validator-${g}`)])]:[["BSNs","Finality Provider"],...s.map((C,g)=>{const y=i[g];return[o.jsxs("div",{className:"flex w-full items-center gap-2 py-1",children:[C.icon,o.jsx(H,{variant:"body2",className:"font-medium",children:C.name})]},`bsn-${g}`),y?o.jsxs("div",{className:"flex w-full items-center gap-2 py-1",children:[y.icon,o.jsx(H,{variant:"body2",className:"font-medium",children:y.name})]},`fp-${g}`):o.jsx("div",{},`fp-${g}`)]})];return o.jsxs(Al,{open:e,onClose:r,children:[o.jsx(Dt,{title:"Preview",onClose:r,className:"text-accent-primary"}),o.jsxs(Tt,{className:"no-scrollbar mb-8 mt-4 flex max-h-[calc(100vh-12rem)] flex-col gap-4 overflow-y-auto text-accent-primary",children:[o.jsx(Ol,{data:x}),o.jsx("div",{className:"flex flex-col",children:d.map((C,g)=>o.jsxs("div",{className:"flex flex-row items-center justify-between py-3",children:[o.jsx(H,{variant:"body1",className:"text-secondary font-normal",children:C.label}),o.jsx(H,{variant:"body1",className:"text-right font-normal",children:C.value})]},g))}),o.jsx("div",{className:"border-divider w-full border-t"}),o.jsxs("div",{className:"pt-2",children:[o.jsx(ir,{variant:"h6",className:"text-primary mb-2",children:"Attention!"}),c?o.jsx(H,{variant:"body2",className:"text-secondary",children:c}):o.jsxs(o.Fragment,{children:[o.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."}),o.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."})]})]})]}),o.jsxs(ur,{className:"flex flex-col gap-4 pb-8 pt-0 sm:flex-row",children:[o.jsx(ue,{variant:"contained",color:"primary",onClick:n,className:"w-full sm:flex-1 sm:order-2",disabled:t,children:t?"Processing...":f}),o.jsx(ue,{variant:"outlined",color:"primary",onClick:r,className:"w-full sm:flex-1 sm:order-1",children:"Cancel"})]})]})};function si({actions:e}){return o.jsx("div",{className:"mt-4 sm:mt-6 flex gap-2",children:e.map((t,r)=>o.jsx(ue,{variant:t.variant||"outlined",className:`sm:bbn-btn-medium flex-1 ${t.className||""}`,onClick:t.onClick,fluid:!0,children:t.label},`${t.label}-${r}`))})}function ii({formattedAmount:e,icon:t,iconAlt:r,chainName:n,chainIcon:s,chainIconAlt:i}){return o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[t&&(typeof t=="string"?o.jsx("img",{src:t,alt:r||"icon",className:"w-6 h-6 sm:w-8 sm:h-8"}):t),o.jsx("span",{className:"text-base sm:text-lg font-medium text-accent-primary",children:e})]}),n&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-base sm:text-lg font-medium text-accent-primary",children:n}),s&&(typeof s=="string"?o.jsx("img",{src:s,alt:i||"chain icon",className:"w-6 h-6 sm:w-8 sm:h-8"}):s)]})]})}function oi({item:e,className:t}){return o.jsxs("div",{className:j.twMerge("flex items-center gap-2 min-w-0",t),children:[o.jsx("span",{className:"text-xs sm:text-sm text-accent-primary font-medium truncate flex items-center",children:e.name}),e.icon&&o.jsx("div",{className:"flex items-center w-4 h-4 flex-shrink-0 justify-center text-xs sm:text-sm",children:typeof e.icon=="string"?o.jsx("img",{src:e.icon,alt:e.iconAlt||e.name,className:"w-full h-full rounded-full object-cover"}):e.icon})]})}function jr({label:e,value:t,collapsible:r=!1,nestedDetails:n}){const[s,i]=p.useState(!1),l=()=>{i(!s)};return r?o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 min-w-0 overflow-x-auto",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[o.jsx("span",{className:"text-xs sm:text-sm text-accent-secondary",children:e}),o.jsx("button",{onClick:l,className:"w-5 h-5 flex-shrink-0 hover:opacity-70 transition-opacity","aria-label":s?"Collapse":"Expand",children:s?o.jsx(ds,{size:20,variant:"secondary"}):o.jsx(hs,{size:20,variant:"secondary"})})]}),o.jsx("span",{className:"text-xs sm:text-sm text-accent-primary font-medium text-right min-w-0 overflow-x-auto whitespace-nowrap",children:t})]}),s&&n&&o.jsx("div",{className:"bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto",children:n.map((a,c)=>o.jsx(jr,{label:a.label,value:a.value,collapsible:a.collapsible,nestedDetails:a.nestedDetails},c))})]}):o.jsxs("div",{className:"flex items-center justify-between gap-2 min-w-0 overflow-x-auto",children:[o.jsx("span",{className:"text-xs sm:text-sm text-accent-secondary flex-shrink-0",children:e}),o.jsx("span",{className:"text-xs sm:text-sm text-accent-primary font-medium text-right min-w-0 overflow-x-auto whitespace-nowrap",children:t})]})}function ai({details:e,optionalDetails:t,listItems:r}){const n=t&&t.length>0,s=r&&r.length>0;return o.jsxs("div",{className:"space-y-3 sm:space-y-4 overflow-x-auto",children:[o.jsx("div",{className:"space-y-4 sm:space-y-6",children:e.map((i,l)=>o.jsx(jr,{label:i.label,value:i.value,collapsible:i.collapsible,nestedDetails:i.nestedDetails},l))}),s&&o.jsx("div",{className:"space-y-3 sm:space-y-4",children:r.map((i,l)=>o.jsx("div",{className:"bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto",children:o.jsxs("div",{className:"flex justify-between items-start gap-2",children:[o.jsx("span",{className:"text-xs sm:text-sm text-accent-secondary",children:i.label}),o.jsx("div",{className:"flex flex-wrap gap-2",children:i.items.map((a,c)=>o.jsx(oi,{item:a},a.id||c))})]})},l))}),n&&o.jsx("div",{className:"bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto",children:t.map((i,l)=>o.jsx(jr,{label:i.label,value:i.value,collapsible:i.collapsible,nestedDetails:i.nestedDetails},l))})]})}function Ll({data:e,className:t}){return o.jsxs("div",{className:`w-full bg-secondary-highlight p-3 sm:p-4 rounded flex flex-col justify-between ${t||""}`,children:[o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsx(ii,{formattedAmount:e.formattedAmount,icon:e.icon,iconAlt:e.iconAlt,chainName:e.chainName,chainIcon:e.chainIcon,chainIconAlt:e.chainIconAlt}),o.jsx(ai,{details:e.details,optionalDetails:e.optionalDetails,listItems:e.listItems}),e.secondaryActions&&e.secondaryActions.length>0&&o.jsx(si,{actions:e.secondaryActions})]}),e.primaryAction&&o.jsx(ue,{variant:"outlined",className:`mt-4 ${e.primaryAction.className||""}`,onClick:e.primaryAction.onClick,fluid:e.primaryAction.fullWidth!==!1,children:e.primaryAction.label})]})}function Ml({className:e,...t}){const n=tt(hr)?et:Vt;return o.jsx(n,{...t,className:j.twMerge("w-[41.25rem] max-w-full",e)})}const Vl=({open:e,processing:t=!1,title:r,onClose:n,onProceed:s,tokens:i,transactionFees:l})=>o.jsxs(Ml,{open:e,onClose:n,children:[o.jsx(Dt,{title:r,className:"text-accent-primary"}),o.jsx(Tt,{className:"no-scrollbar mb-[40px] mt-8 flex max-h-[calc(100vh-12rem)] flex-col overflow-y-auto text-accent-primary",children:o.jsxs("div",{className:"flex flex-col",children:[o.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:i.map((a,c)=>{var f,u;return o.jsxs("div",{children:[o.jsx(ft,{title:a.name,hint:(f=a.amount)==null?void 0:f.usd,children:o.jsxs("div",{className:"flex items-center gap-2",children:[a.icon,(u=a.amount)==null?void 0:u.token]})}),c<i.length-1&&o.jsx("div",{className:"h-4"})]},`token-${c}`)})}),o.jsx("div",{className:"pt-6 pb-6",children:o.jsx("div",{className:"border-divider w-full border-t"})}),o.jsx(ft,{title:"Transaction Fees",hint:l.usd,children:l.token})]})}),o.jsxs(ur,{className:"flex flex-col gap-4 pt-0 sm:flex-row",children:[o.jsx(ue,{variant:"contained",color:"primary",onClick:s,className:"w-full sm:flex-1 sm:order-2",disabled:t,children:t?"Processing...":"Proceed"}),o.jsx(ue,{variant:"outlined",color:"primary",onClick:n,className:"w-full sm:flex-1 sm:order-1",children:"Cancel"})]})]}),Dl=({rewards:e,onClick:t,disabled:r})=>o.jsxs(ht,{className:"flex w-full flex-col content-center justify-between gap-4",children:[e.map((n,s)=>{var a;const i=parseFloat(String(n.amount)),l=Qs(i,((a=n.balanceDetails)==null?void 0:a.price)??0,{zeroDisplay:"$0.00"});return o.jsx(fr,{amount:n.amount,currencyIcon:n.currencyIcon,currencyName:n.currencyName,placeholder:n.placeholder??"Enter Amount",displayBalance:n.displayBalance,balanceDetails:n.balanceDetails,min:n.min??"0",step:n.step??"any",autoFocus:!1,onChange:()=>{},onKeyDown:()=>{},amountUsd:l,disabled:!0,subtitle:n.chainName},s)}),o.jsx(ue,{onClick:t,disabled:r,children:"Claim"})]}),Tl=({size:e="md"})=>{const t={sm:"mt-2",md:"mt-4",lg:"mt-6"};return o.jsx("div",{className:t[e]})},_l=()=>o.jsx("svg",{width:"29",height:"28",viewBox:"0 0 29 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.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"})}),li=()=>o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),ci=({children:e,className:t=""})=>o.jsx(H,{variant:"body1",className:j.twJoin("px-7 pb-6 text-accent-primary md:hidden",t),children:e}),ui=({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 o.jsx("div",{className:j.twJoin(s(),r),children:n})},dt=({children:e})=>o.jsx(o.Fragment,{children:e}),nn=({icon:e,suffix:t,onClick:r,disabled:n=!1,selected:s=!1,className:i="",children:l})=>{const a=p.Children.toArray(l),c=a.find(m=>typeof m=="string"||p.isValidElement(m)&&m.type!==dt),f=a.find(m=>p.isValidElement(m)&&m.type===dt),u=typeof c=="string"?c:"",d=r?o.jsx(li,{}):void 0;return o.jsx(Os,{icon:e,name:u,description:f?f.props.children:void 0,onClick:r,disabled:n,selected:s,className:i,suffix:t||d})},fi=({icon:e,className:t="",children:r})=>{const n=p.Children.toArray(r),s=n.find(c=>typeof c=="string"||p.isValidElement(c)&&c.type!==dt),i=n.find(c=>p.isValidElement(c)&&c.type===dt),l=n.filter(c=>p.isValidElement(c)&&c.type===nn),a=typeof s=="string"?s:"";return o.jsx(As,{icon:e,name:a,description:i?i.props.children:void 0,className:t,suffix:o.jsx(li,{}),children:l})},di=({children:e,className:t=""})=>o.jsx("div",{className:t,children:e}),Il=({trigger:e,open:t,onOpenChange:r,placement:n="bottom-end",className:s,offset:i=[0,8],children:l})=>{const a=o.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:o.jsx(_l,{})});return o.jsx(Hr,{trigger:e||a,open:t,onOpenChange:r,placement:n,className:j.twJoin("relative",s),offset:i,mobileMode:"drawer",children:l})},$e=Il;$e.Title=ci;$e.Group=ui;$e.Item=nn;$e.SubMenu=fi;$e.Description=dt;$e.CustomContent=di;$e.Spacer=Tl;const Cr=({walletType:e,walletName:t,walletIcon:r,address:n,isCopied:s,onCopy:i,className:l})=>o.jsx("div",{className:j.twJoin("bg-[#F9F9F9] dark:bg-[#2F2F2F] rounded-[4px] p-3 flex-1 md:p-4",l),children:o.jsxs("div",{className:"flex flex-col w-full",children:[o.jsx("div",{className:"flex justify-start mb-2 md:mb-3",children:o.jsx(ot,{alt:t||e,url:r||"",size:"large",className:"w-8 h-8 md:w-10 md:h-10"})}),o.jsx("div",{className:"flex justify-start mb-[1px]",children:o.jsxs(H,{variant:"body1",className:"text-accent-secondary font-medium !text-xs",children:[e," Wallet"]})}),o.jsxs("div",{className:"flex items-center justify-between w-full",children:[o.jsx("div",{className:"flex-1 min-w-0",children:s?o.jsx(H,{className:"text-accent-primary !text-sm truncate whitespace-nowrap",children:"Copied ✓"}):o.jsx(Wr,{className:"text-accent-primary !text-sm",value:n,symbols:6})}),o.jsx("button",{onClick:i,className:"flex-shrink-0 ml-3 p-1 rounded hover:bg-[#d7e1e7] dark:hover:bg-[#252525] transition-colors h-6 w-6 flex items-center justify-center hover:opacity-80",children:o.jsx(cr,{size:14,className:"md:w-4 md:h-4"})})]})]})}),hi=({value:e,onChange:t,className:r="",disabled:n=!1})=>{const s=()=>{n||t(!e)};return o.jsx("button",{type:"button",onClick:s,disabled:n,className:j.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:o.jsx("span",{className:j.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]")})})},Nr=({icon:e,title:t,status:r,value:n,onChange:s,className:i})=>o.jsxs("div",{className:j.twJoin("flex items-center justify-between w-full p-3 md:p-0 md:mb-0",i),children:[o.jsxs("div",{className:"flex items-center gap-4",children:[e,o.jsxs("div",{className:"flex flex-col",children:[o.jsx(H,{variant:"body2",className:"text-accent-primary font-medium",children:t}),o.jsx(H,{className:"text-accent-secondary !text-xs",children:r})]})]}),o.jsx(hi,{value:n,onChange:s})]}),mi=({title:e,value:t,isCopied:r,onCopy:n,className:s,icon:i})=>o.jsx("div",{className:j.twJoin("flex items-center justify-between w-full p-3 md:p-0 md:mb-0",s),children:o.jsx("div",{className:"flex flex-col w-full",children:o.jsxs("div",{className:"flex items-center gap-4",children:[i&&o.jsx("div",{className:"flex-shrink-0",children:i}),o.jsxs("div",{className:"flex w-full",children:[o.jsxs("div",{className:"flex flex-col w-full",children:[o.jsx(H,{variant:"body2",className:"text-accent-primary font-medium text-xs",children:e}),o.jsx("div",{className:"flex items-center justify-between w-full",children:o.jsx("div",{className:"flex-1 min-w-0",children:r?o.jsx(H,{className:"text-accent-secondary !text-xs truncate whitespace-nowrap",children:"Copied ✓"}):o.jsx(Wr,{className:"text-accent-secondary !text-xs",value:t,symbols:6})})})]}),o.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:o.jsx(cr,{size:16})})]})]})})}),Rl=({trigger:e,btcAddress:t,bbnAddress:r,selectedWallets:n,ordinalsExcluded:s,linkedDelegationsVisibility:i,onIncludeOrdinals:l,onExcludeOrdinals:a,onDisplayLinkedDelegations:c,publicKeyNoCoord:f,onDisconnect:u,forceOpen:d=!1,onOpenChange:m,className:x,mobileMode:C="dialog",copy:g})=>{var B,R,$,A;const{copyToClipboard:y,isCopied:V}=Br({timeout:g==null?void 0:g.timeout}),w=(g==null?void 0:g.isCopied)??V,M=(g==null?void 0:g.copyToClipboard)??y,[S,k]=p.useState(d),O=p.useCallback(L=>{k(L),m==null||m(L)},[m]),T=p.useCallback(()=>{k(!1),u()},[u]);return o.jsx(Hr,{trigger:e,open:S,onOpenChange:O,mobileMode:C,className:j.twJoin("shadow-lg border border-[#38708533] bg-[#FFFFFF] dark:bg-[#252525] dark:border-[#404040] rounded-lg",x),children:o.jsxs("div",{className:"p-4 space-y-6 w-full text-primary-main",children:[o.jsxs("div",{className:"flex flex-row gap-2 w-full md:flex-col overflow-x-auto",children:[o.jsx(Cr,{walletType:"Bitcoin",walletName:(B=n.BTC)==null?void 0:B.name,walletIcon:(R=n.BTC)==null?void 0:R.icon,address:t,isCopied:w("btc"),onCopy:()=>M("btc",t)}),o.jsx(Cr,{walletType:"Babylon",walletName:($=n.BBN)==null?void 0:$.name,walletIcon:(A=n.BBN)==null?void 0:A.icon,address:r,isCopied:w("bbn"),onCopy:()=>M("bbn",r)})]}),o.jsxs("div",{className:"flex flex-col w-full bg-[#F9F9F9] dark:bg-[#2F2F2F] rounded-lg md:bg-transparent md:dark:bg-transparent md:border-none md:gap-8",children:[o.jsx(Nr,{icon:o.jsx(us,{}),title:"Using Inscriptions",status:s?"Off":"On",value:!s,onChange:L=>L?l():a()}),o.jsx(Nr,{icon:o.jsx(cs,{}),title:"Linked Wallet Stakes",status:i?"On":"Off",value:i,onChange:c}),o.jsx(mi,{title:"Bitcoin Public Key",value:f,isCopied:w("publicKey"),onCopy:()=>M("publicKey",f),icon:o.jsx(ls,{}),className:"rounded-b-lg rounded-t-none md:rounded-none"})]}),o.jsx("div",{className:"pt-2",children:o.jsx(Er,{onClick:T,fluid:!0,children:"Disconnect Wallets"})})]})})};function Bl({className:e,...t}){const n=tt(hr)?et:Vt;return o.jsx(n,{...t,className:j.twMerge("w-[41.25rem] max-w-full",e)})}const Pl=({open:e,onClose:t,title:r="Unbonding",description:n,reward:s,amountUsd:i="",onChange:l=()=>{},onKeyDown:a=()=>{},disabled:c=!1,warningText:f,actionButtonText:u="Unbond",onActionClick:d})=>o.jsxs(Bl,{open:e,onClose:t,children:[o.jsx(Dt,{title:r,onClose:t,className:"text-accent-primary"}),o.jsxs(Tt,{style:{maxHeight:qs},className:"no-scrollbar mt-4 flex flex-col gap-6 overflow-y-auto text-accent-primary",children:[n&&o.jsx("div",{children:o.jsx(H,{variant:"body2",className:"text-accent-secondary whitespace-pre-line",children:n})}),o.jsx(ht,{className:"flex w-full flex-col content-center justify-between gap-4",children:o.jsx(fr,{amount:s.amount,currencyIcon:s.currencyIcon,currencyName:s.currencyName,placeholder:s.placeholder??"Enter Amount",displayBalance:s.displayBalance,balanceDetails:s.balanceDetails,min:s.min??"0",step:s.step??"any",autoFocus:!1,onChange:l,onKeyDown:a,amountUsd:i,disabled:c,subtitle:`Staked: ${s.stakedAmount||0} ${s.stakedTokenName||s.currencyName}`})}),f&&o.jsx(Ls,{children:f})]}),u&&o.jsx(ur,{className:"flex justify-end mt-[80px]",children:o.jsx(ue,{onClick:d,children:u})})]}),$l={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Hl({className:e,orientation:t="vertical",children:r}){return o.jsx("div",{className:j.twMerge("bbn-list-legacy",`bbn-list-legacy-${t}`,e),children:p.Children.map(r,n=>p.isValidElement(n)?p.cloneElement(n,{orientation:$l[t]}):n)})}function Wl({className:e,orientation:t="horizontal",title:r,value:n,suffix:s}){return o.jsxs("div",{className:j.twJoin("bbn-list-item-legacy",`bbn-list-item-legacy-${t}`,e),children:[o.jsx(H,{as:"div",className:j.twJoin("bbn-list-title-legacy",`bbn-list-title-legacy-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),o.jsxs(H,{as:"div",className:j.twJoin("bbn-list-value-legacy",`bbn-list-value-legacy-${t}`),variant:"body1",children:[n,s]})]})}exports.Accordion=bi;exports.AccordionDetails=ji;exports.AccordionSummary=yi;exports.ActivityCard=Ll;exports.ActivityCardActionSection=si;exports.ActivityCardAmountSection=ii;exports.ActivityCardDetailsSection=ai;exports.ActivityListItem=oi;exports.AmountItem=fr;exports.AmountSubsection=Cl;exports.Avatar=ot;exports.AvatarGroup=Ci;exports.BBNFeeAmount=ri;exports.BTCFeeAmount=ti;exports.BTCFeeRate=ei;exports.Badge=Ma;exports.BitcoinPublicKeyIcon=ls;exports.BugReportIcon=sa;exports.Button=ue;exports.Card=Cs;exports.Cell=ws;exports.Checkbox=$n;exports.CheckboxField=ll;exports.ChevronLeftIcon=na;exports.Chip=ia;exports.CloseIcon=Rr;exports.CollapseIcon=ds;exports.Column=bs;exports.Copy=Fs;exports.CopyIcon=cr;exports.CoreUIProvider=Qo;exports.CounterButton=ks;exports.Dialog=Vt;exports.DialogBody=Tt;exports.DialogFooter=ur;exports.DialogHeader=Dt;exports.DisplayHash=Wr;exports.FeeItem=ft;exports.FeesSection=El;exports.FinalityProviderItem=Qr;exports.FinalityProviderLogo=zs;exports.FinalityProviderSubsection=Sl;exports.Form=nl;exports.FormControl=Mt;exports.Heading=ir;exports.HiddenField=Us;exports.IconButton=kr;exports.Input=Lt;exports.LinkWalletIcon=cs;exports.List=Aa;exports.ListItem=Ns;exports.ListItemLegacy=Wl;exports.ListLegacy=Hl;exports.Loader=oa;exports.Menu=Hr;exports.MenuDrawer=$r;exports.MenuItem=Os;exports.MobileDialog=et;exports.NumberField=ol;exports.OpenIcon=hs;exports.Popover=ar;exports.Portal=Ft;exports.PreviewModal=Fl;exports.Radio=Hn;exports.RadioField=cl;exports.RewardsPreviewModal=Vl;exports.RewardsSubsection=Dl;exports.ScrollLocker=ra;exports.Select=_r;exports.SelectField=ul;exports.SettingMenu=$e;exports.SettingMenuCustomContent=di;exports.SettingMenuDescription=dt;exports.SettingMenuGroup=ui;exports.SettingMenuItem=nn;exports.SettingMenuSubMenu=fi;exports.SettingMenuTitle=ci;exports.StatItem=La;exports.SubMenu=As;exports.SubMenuItem=Da;exports.SubSection=ht;exports.Table=js;exports.TableElement=dl;exports.Text=H;exports.TextField=al;exports.ThemedIcon=lr;exports.Toggle=Ea;exports.Total=ni;exports.UnbondingModal=Pl;exports.UsingInscriptionIcon=us;exports.ValidatorAvatar=Ni;exports.ValidatorSelector=vl;exports.WalletDisconnectButton=Er;exports.WalletInfoCard=Cr;exports.WalletInfoSection=mi;exports.WalletMenu=Rl;exports.WalletSettingItem=Nr;exports.WalletToggle=hi;exports.Warning=Ls;exports.WarningIcon=fs;exports.iconColorVariants=Pe;exports.useClickOutside=ss;exports.useControlledState=Ye;exports.useCopy=Br;exports.useCoreUI=rs;exports.useDrawerAnimation=Ss;exports.useField=nt;exports.useFieldState=sl;exports.useFormContext=rt;exports.useFormState=Gr;exports.useFrozenColumns=xs;exports.useIsMobile=tt;exports.useMemoizedArray=ns;exports.useMenuContext=Pr;exports.useModalManager=Ir;exports.useResizeObserver=is;exports.useTableScroll=vs;exports.useTableSort=ys;exports.useWatch=Xr;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),p=require("react"),C=require("tailwind-merge"),Rn=require("react-dom");function Bn(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 qe=Bn(p),bi=Bn(Rn);function Ye({value:e,defaultValue:t,onStateChange:r}={}){const[n,s]=p.useState(t),{current:i}=p.useRef(e!=null),l=i?e:n,a=p.useCallback(c=>{i||s(c),r==null||r(c)},[i,r,s]);return[l,a]}const Sr=p.createContext({disabled:!1,expanded:!1});function yi({expanded:e,defaultExpanded:t,onChange:r,className:n,disabled:s=!1,fluid:i=!1,children:l}){const[a=!1,c]=Ye({value:e,defaultValue:t,onStateChange:r}),f=p.useCallback(()=>{c(!a)},[c,a]),u=p.useMemo(()=>({defaultExpanded:t,disabled:s,expanded:a&&!s,toggle:s?void 0:f}),[t,a,s,f]);return o.jsx(Sr.Provider,{value:u,children:o.jsx("div",{className:C.twJoin("bbn-accordion",s&&"bbn-accordion-disabled",i&&"bbn-accordion-fluid",n),children:l})})}const ue=p.forwardRef(({variant:e="contained",size:t="large",color:r="primary",fluid:n=!1,className:s,disabled:i,...l},a)=>o.jsx("button",{...l,disabled:i,ref:a,className:C.twJoin("bbn-btn",`bbn-btn-${e}`,`bbn-btn-${r}`,`bbn-btn-${t}`,n&&"bbn-btn-fluid",s)}));ue.displayName="Button";const kr=p.forwardRef(({variant:e="outlined",size:t="large",className:r,...n},s)=>o.jsx("button",{...n,ref:s,className:C.twJoin("bbn-btn-icon",`bbn-btn-icon-${e}`,`bbn-btn-icon-${t}`,r)})),Er=p.forwardRef(({className:e,...t},r)=>o.jsx(ue,{...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)}));Er.displayName="WalletDisconnectButton";function wi({className:e,iconClassName:t,iconProps:r,children:n,renderIcon:s=()=>null}){const{expanded:i,toggle:l}=p.useContext(Sr),a=s(i);return o.jsxs("div",{className:C.twJoin("bbn-accordion-summary",e),onClick:l,children:[n,a&&o.jsx(kr,{className:C.twJoin("bbn-accordion-icon",t),...r,children:a})]})}function Or(e,t){return typeof e!="number"?typeof t=="number"?Or(t):t:`${e}px`}function ji(e=!0){const[t,r]=p.useState("0px"),[n,s]=p.useState(),i=p.useRef(null);return p.useEffect(()=>{const l=new ResizeObserver(a=>{const[c]=a;r(Or(c.target.clientHeight)??"0px")});s(l)},[]),p.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 Ci({unmountOnExit:e=!1,animationDuration:t=200,className:r,wrapperClassName:n,children:s}){const{expanded:i}=p.useContext(Sr),[l,a]=p.useState(i),c=l||!e,{height:f,ref:u}=ji(c);return p.useEffect(function(){if(i===l)return;if(i){a(!0);return}const m=setTimeout(a,t,!1);return()=>{clearTimeout(m)}},[i,l,t]),o.jsx("div",{className:C.twJoin("bbn-accordion-details",n),style:{height:i?f:"0px",visibility:l?"visible":"hidden",transitionDuration:`${t}ms`},children:c?o.jsx("div",{ref:u,className:C.twJoin("bbn-accordion-content",r),children:s}):null})}const H=p.forwardRef(({variant:e="body1",as:t="p",children:r,className:n,...s},i)=>p.createElement(t,{...s,ref:i,className:C.twJoin(`bbn-text-${e}`,n)},r));H.displayName="Text";const ir=p.forwardRef(({variant:e,as:t=e,children:r,className:n,...s},i)=>p.createElement(t,{...s,ref:i,className:C.twJoin(`bbn-${e}`,n)},r));ir.displayName="Heading";function ot({className:e,style:t,size:r="large",variant:n="circular",alt:s,url:i,children:l}){return o.jsx("div",{style:t,className:C.twJoin("bbn-avatar",`bbn-avatar-${r}`,`bbn-avatar-${n}`,e),children:i?o.jsx("img",{className:"bbn-avatar-img",src:i,alt:s}):l})}const Ni=({max:e=1/0,className:t,children:r,avatarClassName:n,variant:s,...i})=>{const l=p.Children.count(r);return o.jsxs("div",{className:C.twJoin("bbn-avatar-group",t),children:[p.Children.map(r,(a,c)=>p.isValidElement(a)&&c+1<=e?p.cloneElement(a,{...i,className:C.twMerge(n,a.props.className),variant:s}):null),l>e&&o.jsxs(ot,{size:i.size,variant:s,className:n,children:["+",l-e]})]})};function Si({url:e,name:t,variant:r="rounded",size:n="large",...s}){return o.jsx(ot,{...s,url:e,alt:t,variant:r,size:n,children:o.jsx(H,{as:"span",className:"inline-flex h-full w-full items-center justify-center bg-secondary-main text-xs text-accent-contrast",children:(t==null?void 0:t.charAt(0).toUpperCase())||"?"})})}const Pn=p.forwardRef(function({label:t,checked:r,defaultChecked:n=!1,inputProps:s,orientation:i="left",disabled:l=!1,className:a,inputType:c,labelClassName:f,renderIcon:u,onChange:d,...m},v){const[j=!1,g]=Ye({value:r,defaultValue:n,onStateChange:d});function y(w){var L;g(w.currentTarget.checked),(L=s==null?void 0:s.onChange)==null||L.call(s,w)}const V=o.jsxs("span",{className:C.twJoin("bbn-switcher",l&&"bbn-switcher-disabled",a),children:[u(j),o.jsx("input",{ref:v,type:c,disabled:l,className:"bbn-switcher-input",...m,...s,checked:j,onChange:y})]});return t?o.jsxs(H,{as:"label",variant:"body1",className:C.twJoin("bbn-switcher-label",i==="left"?"bbn-switcher-left":"bbn-switcher-right",f),children:[V,t]}):V}),ki={false:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.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:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.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"})})},$n=p.forwardRef(function(t,r){return o.jsx(Pn,{ref:r,...t,inputType:"checkbox",renderIcon:n=>ki[n.toString()]})}),Ei={true:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.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:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.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"})})},Hn=p.forwardRef(function(t,r){return o.jsx(Pn,{ref:r,...t,inputType:"radio",renderIcon:n=>Ei[n.toString()]})});var Wn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ln=p.createContext&&p.createContext(Wn),Oi=["attr","size","title"];function Ai(e,t){if(e==null)return{};var r=Fi(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 Fi(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 Xt(){return Xt=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},Xt.apply(this,arguments)}function cn(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 Yt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cn(Object(r),!0).forEach(function(n){Mi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mi(e,t,r){return t=Li(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Li(e){var t=Vi(e,"string");return typeof t=="symbol"?t:t+""}function Vi(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 Jn(e){return e&&e.map((t,r)=>p.createElement(t.tag,Yt({key:r},t.attr),Jn(t.child)))}function Be(e){return t=>p.createElement(Di,Xt({attr:Yt({},e.attr)},t),Jn(e.child))}function Di(e){var t=r=>{var{attr:n,size:s,title:i}=e,l=Ai(e,Oi),a=s||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),p.createElement("svg",Xt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,l,{className:c,style:Yt(Yt({color:e.color||r.color},r.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),i&&p.createElement("title",null,i),e.children)};return ln!==void 0?p.createElement(ln.Consumer,null,r=>t(r)):t(Wn)}function Ti(e){return Be({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 16L6 10H18L12 16Z"},child:[]}]})(e)}function _i(e){return Be({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 Ii(e){return Be({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M12 8L18 14H6L12 8Z"},child:[]}]})(e)}function Ri(e){return Be({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"},child:[]}]})(e)}var un=function(t){return t.reduce(function(r,n){var s=n[0],i=n[1];return r[s]=i,r},{})},fn=typeof window<"u"&&window.document&&window.document.createElement?qe.useLayoutEffect:qe.useEffect,le="top",ve="bottom",xe="right",ce="left",Ar="auto",Ot=[le,ve,xe,ce],at="start",St="end",Bi="clippingParents",Un="viewport",gt="popper",Pi="reference",dn=Ot.reduce(function(e,t){return e.concat([t+"-"+at,t+"-"+St])},[]),zn=[].concat(Ot,[Ar]).reduce(function(e,t){return e.concat([t,t+"-"+at,t+"-"+St])},[]),$i="beforeRead",Hi="read",Wi="afterRead",Ji="beforeMain",Ui="main",zi="afterMain",qi="beforeWrite",Zi="write",Gi="afterWrite",Xi=[$i,Hi,Wi,Ji,Ui,zi,qi,Zi,Gi];function Ee(e){return e?(e.nodeName||"").toLowerCase():null}function he(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ke(e){var t=he(e).Element;return e instanceof t||e instanceof Element}function pe(e){var t=he(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Fr(e){if(typeof ShadowRoot>"u")return!1;var t=he(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Yi(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];!pe(i)||!Ee(i)||(Object.assign(i.style,n),Object.keys(s).forEach(function(l){var a=s[l];a===!1?i.removeAttribute(l):i.setAttribute(l,a===!0?"":a)}))})}function Ki(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]||{},l=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),a=l.reduce(function(c,f){return c[f]="",c},{});!pe(s)||!Ee(s)||(Object.assign(s.style,a),Object.keys(i).forEach(function(c){s.removeAttribute(c)}))})}}const Qi={name:"applyStyles",enabled:!0,phase:"write",fn:Yi,effect:Ki,requires:["computeStyles"]};function ke(e){return e.split("-")[0]}var Ge=Math.max,Kt=Math.min,lt=Math.round;function br(){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 qn(){return!/^((?!chrome|android).)*safari/i.test(br())}function ct(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),s=1,i=1;t&&pe(e)&&(s=e.offsetWidth>0&<(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&<(n.height)/e.offsetHeight||1);var l=Ke(e)?he(e):window,a=l.visualViewport,c=!qn()&&r,f=(n.left+(c&&a?a.offsetLeft:0))/s,u=(n.top+(c&&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 Mr(e){var t=ct(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 Zn(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Fr(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 he(e).getComputedStyle(e)}function eo(e){return["table","td","th"].indexOf(Ee(e))>=0}function Pe(e){return((Ke(e)?e.ownerDocument:e.document)||window.document).documentElement}function or(e){return Ee(e)==="html"?e:e.assignedSlot||e.parentNode||(Fr(e)?e.host:null)||Pe(e)}function hn(e){return!pe(e)||Ve(e).position==="fixed"?null:e.offsetParent}function to(e){var t=/firefox/i.test(br()),r=/Trident/i.test(br());if(r&&pe(e)){var n=Ve(e);if(n.position==="fixed")return null}var s=or(e);for(Fr(s)&&(s=s.host);pe(s)&&["html","body"].indexOf(Ee(s))<0;){var i=Ve(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 At(e){for(var t=he(e),r=hn(e);r&&eo(r)&&Ve(r).position==="static";)r=hn(r);return r&&(Ee(r)==="html"||Ee(r)==="body"&&Ve(r).position==="static")?t:r||to(e)||t}function Lr(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function wt(e,t,r){return Ge(e,Kt(t,r))}function ro(e,t,r){var n=wt(e,t,r);return n>r?r:n}function Gn(){return{top:0,right:0,bottom:0,left:0}}function Xn(e){return Object.assign({},Gn(),e)}function Yn(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var no=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Xn(typeof t!="number"?t:Yn(t,Ot))};function so(e){var t,r=e.state,n=e.name,s=e.options,i=r.elements.arrow,l=r.modifiersData.popperOffsets,a=ke(r.placement),c=Lr(a),f=[ce,xe].indexOf(a)>=0,u=f?"height":"width";if(!(!i||!l)){var d=no(s.padding,r),m=Mr(i),v=c==="y"?le:ce,j=c==="y"?ve:xe,g=r.rects.reference[u]+r.rects.reference[c]-l[c]-r.rects.popper[u],y=l[c]-r.rects.reference[c],V=At(i),w=V?c==="y"?V.clientHeight||0:V.clientWidth||0:0,L=g/2-y/2,S=d[v],k=w-m[u]-d[j],O=w/2-m[u]/2+L,T=wt(S,O,k),B=c;r.modifiersData[n]=(t={},t[B]=T,t.centerOffset=T-O,t)}}function io(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)||Zn(t.elements.popper,s)&&(t.elements.arrow=s))}const oo={name:"arrow",enabled:!0,phase:"main",fn:so,effect:io,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ut(e){return e.split("-")[1]}var ao={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lo(e,t){var r=e.x,n=e.y,s=t.devicePixelRatio||1;return{x:lt(r*s)/s||0,y:lt(n*s)/s||0}}function mn(e){var t,r=e.popper,n=e.popperRect,s=e.placement,i=e.variation,l=e.offsets,a=e.position,c=e.gpuAcceleration,f=e.adaptive,u=e.roundOffsets,d=e.isFixed,m=l.x,v=m===void 0?0:m,j=l.y,g=j===void 0?0:j,y=typeof u=="function"?u({x:v,y:g}):{x:v,y:g};v=y.x,g=y.y;var V=l.hasOwnProperty("x"),w=l.hasOwnProperty("y"),L=ce,S=le,k=window;if(f){var O=At(r),T="clientHeight",B="clientWidth";if(O===he(r)&&(O=Pe(r),Ve(O).position!=="static"&&a==="absolute"&&(T="scrollHeight",B="scrollWidth")),O=O,s===le||(s===ce||s===xe)&&i===St){S=ve;var R=d&&O===k&&k.visualViewport?k.visualViewport.height:O[T];g-=R-n.height,g*=c?1:-1}if(s===ce||(s===le||s===ve)&&i===St){L=xe;var $=d&&O===k&&k.visualViewport?k.visualViewport.width:O[B];v-=$-n.width,v*=c?1:-1}}var A=Object.assign({position:a},f&&ao),M=u===!0?lo({x:v,y:g},he(r)):{x:v,y:g};if(v=M.x,g=M.y,c){var P;return Object.assign({},A,(P={},P[S]=w?"0":"",P[L]=V?"0":"",P.transform=(k.devicePixelRatio||1)<=1?"translate("+v+"px, "+g+"px)":"translate3d("+v+"px, "+g+"px, 0)",P))}return Object.assign({},A,(t={},t[S]=w?g+"px":"",t[L]=V?v+"px":"",t.transform="",t))}function co(e){var t=e.state,r=e.options,n=r.gpuAcceleration,s=n===void 0?!0:n,i=r.adaptive,l=i===void 0?!0:i,a=r.roundOffsets,c=a===void 0?!0:a,f={placement:ke(t.placement),variation:ut(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,mn(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,mn(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const uo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:co,data:{}};var Ut={passive:!0};function fo(e){var t=e.state,r=e.instance,n=e.options,s=n.scroll,i=s===void 0?!0:s,l=n.resize,a=l===void 0?!0:l,c=he(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach(function(u){u.addEventListener("scroll",r.update,Ut)}),a&&c.addEventListener("resize",r.update,Ut),function(){i&&f.forEach(function(u){u.removeEventListener("scroll",r.update,Ut)}),a&&c.removeEventListener("resize",r.update,Ut)}}const ho={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fo,data:{}};var mo={left:"right",right:"left",bottom:"top",top:"bottom"};function qt(e){return e.replace(/left|right|bottom|top/g,function(t){return mo[t]})}var po={start:"end",end:"start"};function pn(e){return e.replace(/start|end/g,function(t){return po[t]})}function Vr(e){var t=he(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Dr(e){return ct(Pe(e)).left+Vr(e).scrollLeft}function vo(e,t){var r=he(e),n=Pe(e),s=r.visualViewport,i=n.clientWidth,l=n.clientHeight,a=0,c=0;if(s){i=s.width,l=s.height;var f=qn();(f||!f&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:l,x:a+Dr(e),y:c}}function xo(e){var t,r=Pe(e),n=Vr(e),s=(t=e.ownerDocument)==null?void 0:t.body,i=Ge(r.scrollWidth,r.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),l=Ge(r.scrollHeight,r.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Dr(e),c=-n.scrollTop;return Ve(s||r).direction==="rtl"&&(a+=Ge(r.clientWidth,s?s.clientWidth:0)-i),{width:i,height:l,x:a,y:c}}function Tr(e){var t=Ve(e),r=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+s+n)}function Kn(e){return["html","body","#document"].indexOf(Ee(e))>=0?e.ownerDocument.body:pe(e)&&Tr(e)?e:Kn(or(e))}function jt(e,t){var r;t===void 0&&(t=[]);var n=Kn(e),s=n===((r=e.ownerDocument)==null?void 0:r.body),i=he(n),l=s?[i].concat(i.visualViewport||[],Tr(n)?n:[]):n,a=t.concat(l);return s?a:a.concat(jt(or(l)))}function yr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function go(e,t){var r=ct(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 vn(e,t,r){return t===Un?yr(vo(e,r)):Ke(t)?go(t,r):yr(xo(Pe(e)))}function bo(e){var t=jt(or(e)),r=["absolute","fixed"].indexOf(Ve(e).position)>=0,n=r&&pe(e)?At(e):e;return Ke(n)?t.filter(function(s){return Ke(s)&&Zn(s,n)&&Ee(s)!=="body"}):[]}function yo(e,t,r,n){var s=t==="clippingParents"?bo(e):[].concat(t),i=[].concat(s,[r]),l=i[0],a=i.reduce(function(c,f){var u=vn(e,f,n);return c.top=Ge(u.top,c.top),c.right=Kt(u.right,c.right),c.bottom=Kt(u.bottom,c.bottom),c.left=Ge(u.left,c.left),c},vn(e,l,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Qn(e){var t=e.reference,r=e.element,n=e.placement,s=n?ke(n):null,i=n?ut(n):null,l=t.x+t.width/2-r.width/2,a=t.y+t.height/2-r.height/2,c;switch(s){case le:c={x:l,y:t.y-r.height};break;case ve:c={x:l,y:t.y+t.height};break;case xe:c={x:t.x+t.width,y:a};break;case ce:c={x:t.x-r.width,y:a};break;default:c={x:t.x,y:t.y}}var f=s?Lr(s):null;if(f!=null){var u=f==="y"?"height":"width";switch(i){case at:c[f]=c[f]-(t[u]/2-r[u]/2);break;case St:c[f]=c[f]+(t[u]/2-r[u]/2);break}}return c}function kt(e,t){t===void 0&&(t={});var r=t,n=r.placement,s=n===void 0?e.placement:n,i=r.strategy,l=i===void 0?e.strategy:i,a=r.boundary,c=a===void 0?Bi:a,f=r.rootBoundary,u=f===void 0?Un:f,d=r.elementContext,m=d===void 0?gt:d,v=r.altBoundary,j=v===void 0?!1:v,g=r.padding,y=g===void 0?0:g,V=Xn(typeof y!="number"?y:Yn(y,Ot)),w=m===gt?Pi:gt,L=e.rects.popper,S=e.elements[j?w:m],k=yo(Ke(S)?S:S.contextElement||Pe(e.elements.popper),c,u,l),O=ct(e.elements.reference),T=Qn({reference:O,element:L,placement:s}),B=yr(Object.assign({},L,T)),R=m===gt?B:O,$={top:k.top-R.top+V.top,bottom:R.bottom-k.bottom+V.bottom,left:k.left-R.left+V.left,right:R.right-k.right+V.right},A=e.modifiersData.offset;if(m===gt&&A){var M=A[s];Object.keys($).forEach(function(P){var J=[xe,ve].indexOf(P)>=0?1:-1,Y=[le,ve].indexOf(P)>=0?"y":"x";$[P]+=M[Y]*J})}return $}function wo(e,t){t===void 0&&(t={});var r=t,n=r.placement,s=r.boundary,i=r.rootBoundary,l=r.padding,a=r.flipVariations,c=r.allowedAutoPlacements,f=c===void 0?zn:c,u=ut(n),d=u?a?dn:dn.filter(function(j){return ut(j)===u}):Ot,m=d.filter(function(j){return f.indexOf(j)>=0});m.length===0&&(m=d);var v=m.reduce(function(j,g){return j[g]=kt(e,{placement:g,boundary:s,rootBoundary:i,padding:l})[ke(g)],j},{});return Object.keys(v).sort(function(j,g){return v[j]-v[g]})}function jo(e){if(ke(e)===Ar)return[];var t=qt(e);return[pn(e),t,pn(t)]}function Co(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,l=r.altAxis,a=l===void 0?!0:l,c=r.fallbackPlacements,f=r.padding,u=r.boundary,d=r.rootBoundary,m=r.altBoundary,v=r.flipVariations,j=v===void 0?!0:v,g=r.allowedAutoPlacements,y=t.options.placement,V=ke(y),w=V===y,L=c||(w||!j?[qt(y)]:jo(y)),S=[y].concat(L).reduce(function(Te,be){return Te.concat(ke(be)===Ar?wo(t,{placement:be,boundary:u,rootBoundary:d,padding:f,flipVariations:j,allowedAutoPlacements:g}):be)},[]),k=t.rects.reference,O=t.rects.popper,T=new Map,B=!0,R=S[0],$=0;$<S.length;$++){var A=S[$],M=ke(A),P=ut(A)===at,J=[le,ve].indexOf(M)>=0,Y=J?"width":"height",q=kt(t,{placement:A,boundary:u,rootBoundary:d,altBoundary:m,padding:f}),K=J?P?xe:ce:P?ve:le;k[Y]>O[Y]&&(K=qt(K));var je=qt(K),oe=[];if(i&&oe.push(q[M]<=0),a&&oe.push(q[K]<=0,q[je]<=0),oe.every(function(Te){return Te})){R=A,B=!1;break}T.set(A,oe)}if(B)for(var Ae=j?3:1,st=function(be){var Je=S.find(function(_e){var Ce=T.get(_e);if(Ce)return Ce.slice(0,be).every(function(Ue){return Ue})});if(Je)return R=Je,"break"},He=Ae;He>0;He--){var We=st(He);if(We==="break")break}t.placement!==R&&(t.modifiersData[n]._skip=!0,t.placement=R,t.reset=!0)}}const No={name:"flip",enabled:!0,phase:"main",fn:Co,requiresIfExists:["offset"],data:{_skip:!1}};function xn(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 gn(e){return[le,xe,ve,ce].some(function(t){return e[t]>=0})}function So(e){var t=e.state,r=e.name,n=t.rects.reference,s=t.rects.popper,i=t.modifiersData.preventOverflow,l=kt(t,{elementContext:"reference"}),a=kt(t,{altBoundary:!0}),c=xn(l,n),f=xn(a,s,i),u=gn(c),d=gn(f);t.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const ko={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:So};function Eo(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,l=i[0],a=i[1];return l=l||0,a=(a||0)*s,[ce,xe].indexOf(n)>=0?{x:a,y:l}:{x:l,y:a}}function Oo(e){var t=e.state,r=e.options,n=e.name,s=r.offset,i=s===void 0?[0,0]:s,l=zn.reduce(function(u,d){return u[d]=Eo(d,t.rects,i),u},{}),a=l[t.placement],c=a.x,f=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=f),t.modifiersData[n]=l}const Ao={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Oo};function Fo(e){var t=e.state,r=e.name;t.modifiersData[r]=Qn({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Mo={name:"popperOffsets",enabled:!0,phase:"read",fn:Fo,data:{}};function Lo(e){return e==="x"?"y":"x"}function Vo(e){var t=e.state,r=e.options,n=e.name,s=r.mainAxis,i=s===void 0?!0:s,l=r.altAxis,a=l===void 0?!1:l,c=r.boundary,f=r.rootBoundary,u=r.altBoundary,d=r.padding,m=r.tether,v=m===void 0?!0:m,j=r.tetherOffset,g=j===void 0?0:j,y=kt(t,{boundary:c,rootBoundary:f,padding:d,altBoundary:u}),V=ke(t.placement),w=ut(t.placement),L=!w,S=Lr(V),k=Lo(S),O=t.modifiersData.popperOffsets,T=t.rects.reference,B=t.rects.popper,R=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,$=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(O){if(i){var P,J=S==="y"?le:ce,Y=S==="y"?ve:xe,q=S==="y"?"height":"width",K=O[S],je=K+y[J],oe=K-y[Y],Ae=v?-B[q]/2:0,st=w===at?T[q]:B[q],He=w===at?-B[q]:-T[q],We=t.elements.arrow,Te=v&&We?Mr(We):{width:0,height:0},be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Gn(),Je=be[J],_e=be[Y],Ce=wt(0,T[q],Te[q]),Ue=L?T[q]/2-Ae-Ce-Je-$.mainAxis:st-Ce-Je-$.mainAxis,vt=L?-T[q]/2+Ae+Ce+_e+$.mainAxis:He+Ce+_e+$.mainAxis,xt=t.elements.arrow&&At(t.elements.arrow),It=xt?S==="y"?xt.clientTop||0:xt.clientLeft||0:0,Rt=(P=A==null?void 0:A[S])!=null?P:0,Bt=K+Ue-Rt-It,Pt=K+vt-Rt,$t=wt(v?Kt(je,Bt):je,K,v?Ge(oe,Pt):oe);O[S]=$t,M[S]=$t-K}if(a){var Ht,sn=S==="x"?le:ce,Wt=S==="x"?ve:xe,h=O[k],x=k==="y"?"height":"width",b=h+y[sn],D=h-y[Wt],E=[le,ce].indexOf(V)!==-1,N=(Ht=A==null?void 0:A[k])!=null?Ht:0,I=E?b:h-T[x]-B[x]-N+$.altAxis,W=E?h+T[x]+B[x]-N-$.altAxis:D,U=v&&E?ro(I,h,W):wt(v?I:b,h,v?W:D);O[k]=U,M[k]=U-h}t.modifiersData[n]=M}}const Do={name:"preventOverflow",enabled:!0,phase:"main",fn:Vo,requiresIfExists:["offset"]};function To(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function _o(e){return e===he(e)||!pe(e)?Vr(e):To(e)}function Io(e){var t=e.getBoundingClientRect(),r=lt(t.width)/e.offsetWidth||1,n=lt(t.height)/e.offsetHeight||1;return r!==1||n!==1}function Ro(e,t,r){r===void 0&&(r=!1);var n=pe(t),s=pe(t)&&Io(t),i=Pe(t),l=ct(e,s,r),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((Ee(t)!=="body"||Tr(i))&&(a=_o(t)),pe(t)?(c=ct(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=Dr(i))),{x:l.left+a.scrollLeft-c.x,y:l.top+a.scrollTop-c.y,width:l.width,height:l.height}}function Bo(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 l=[].concat(i.requires||[],i.requiresIfExists||[]);l.forEach(function(a){if(!r.has(a)){var c=t.get(a);c&&s(c)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||s(i)}),n}function Po(e){var t=Bo(e);return Xi.reduce(function(r,n){return r.concat(t.filter(function(s){return s.phase===n}))},[])}function $o(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function Ho(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 bn={placement:"bottom",modifiers:[],strategy:"absolute"};function yn(){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 Wo(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,s=t.defaultOptions,i=s===void 0?bn:s;return function(a,c,f){f===void 0&&(f=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},bn,i),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},d=[],m=!1,v={state:u,setOptions:function(V){var w=typeof V=="function"?V(u.options):V;g(),u.options=Object.assign({},i,u.options,w),u.scrollParents={reference:Ke(a)?jt(a):a.contextElement?jt(a.contextElement):[],popper:jt(c)};var L=Po(Ho([].concat(n,u.options.modifiers)));return u.orderedModifiers=L.filter(function(S){return S.enabled}),j(),v.update()},forceUpdate:function(){if(!m){var V=u.elements,w=V.reference,L=V.popper;if(yn(w,L)){u.rects={reference:Ro(w,At(L),u.options.strategy==="fixed"),popper:Mr(L)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function($){return u.modifiersData[$.name]=Object.assign({},$.data)});for(var S=0;S<u.orderedModifiers.length;S++){if(u.reset===!0){u.reset=!1,S=-1;continue}var k=u.orderedModifiers[S],O=k.fn,T=k.options,B=T===void 0?{}:T,R=k.name;typeof O=="function"&&(u=O({state:u,options:B,name:R,instance:v})||u)}}}},update:$o(function(){return new Promise(function(y){v.forceUpdate(),y(u)})}),destroy:function(){g(),m=!0}};if(!yn(a,c))return v;v.setOptions(f).then(function(y){!m&&f.onFirstUpdate&&f.onFirstUpdate(y)});function j(){u.orderedModifiers.forEach(function(y){var V=y.name,w=y.options,L=w===void 0?{}:w,S=y.effect;if(typeof S=="function"){var k=S({state:u,name:V,instance:v,options:L}),O=function(){};d.push(k||O)}})}function g(){d.forEach(function(y){return y()}),d=[]}return v}}var Jo=[ho,Mo,uo,Qi,Ao,No,Do,oo,ko],Uo=Wo({defaultModifiers:Jo}),zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function es(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zo=typeof Element<"u",qo=typeof Map=="function",Zo=typeof Set=="function",Go=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Zt(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(!Zt(e[n],t[n]))return!1;return!0}var i;if(qo&&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(!Zt(n.value[1],t.get(n.value[0])))return!1;return!0}if(Zo&&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(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(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(zo&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!Zt(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var Xo=function(t,r){try{return Zt(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 Yo=es(Xo);var Ko=[],Qo=function(t,r,n){n===void 0&&(n={});var s=qe.useRef(null),i={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||Ko},l=qe.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=l[0],c=l[1],f=qe.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(v){var j=v.state,g=Object.keys(j.elements);bi.flushSync(function(){c({styles:un(g.map(function(y){return[y,j.styles[y]||{}]})),attributes:un(g.map(function(y){return[y,j.attributes[y]]}))})})},requires:["computeStyles"]}},[]),u=qe.useMemo(function(){var m={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[f,{name:"applyStyles",enabled:!1}])};return Yo(s.current,m)?s.current||m:(s.current=m,m)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,f]),d=qe.useRef();return fn(function(){d.current&&d.current.setOptions(u)},[u]),fn(function(){if(!(t==null||r==null)){var m=n.createPopper||Uo,v=m(t,r,u);return d.current=v,function(){v.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}};const ts=p.createContext({portalContainer:null}),rs=()=>p.useContext(ts);function ea({children:e,portalContainer:t=null}){return o.jsx(ts.Provider,{value:{portalContainer:t},children:e})}function Ft({children:e,mounted:t=!1,rootClassName:r="portal-root",inheritViewport:n=!0,pointerEvents:s="auto"}){const[i,l]=p.useState(null),{portalContainer:a}=rs(),c=s==="none";return p.useEffect(()=>{if(!t){l(null);return}const f=document.createElement("div");if(f.className=r,n)if(r.includes("popover"))f.style.zIndex="9999",f.style.pointerEvents=c?"none":"auto";else{const d={position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",zIndex:"9999",pointerEvents:c?"none":"auto"};Object.assign(f.style,d)}const u=a||document.body;return u.appendChild(f),l(f),()=>{u.contains(f)&&u.removeChild(f)}},[t,r,n,c,a]),i?Rn.createPortal(e,i):null}function ta(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 ns(e){const t=p.useRef(e);return ta(t.current,e)||(t.current=e),t.current}function ss(e,t=()=>null,{enabled:r=!0}={}){const n=Array.isArray(e)?e:[e],s=ns(n);p.useEffect(()=>{function i(l){r&&s.every(a=>!(a!=null&&a.contains(l.target)))&&t()}return document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[s,r,t])}function ar({open:e=!1,className:t,anchorEl:r,placement:n="bottom-start",offset:s=[0,0],children:i,style:l,onClickOutside:a}){const[c,f]=p.useState(null),{styles:u}=Qo(r,c,{placement:n,modifiers:[{name:"offset",options:{offset:s}}]});return ss([c,r],a,{enabled:e}),o.jsx(Ft,{mounted:e,rootClassName:"popover-portal",children:o.jsx("div",{ref:f,style:{...u.popper,...l,pointerEvents:"auto"},className:C.twJoin("bbn-popover",t),children:i})})}function is(e){const[t,r]=p.useState({width:0,height:0});return p.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 ra=e=>e.label,_r=p.forwardRef(({disabled:e,className:t,value:r,defaultValue:n,placeholder:s="Select option",open:i,defaultOpen:l,options:a=[],optionClassName:c,popoverClassName:f,state:u="default",onOpen:d,onSelect:m,onClose:v,renderSelectedOption:j=ra,...g},y)=>{const V=p.useRef(null);p.useImperativeHandle(y,()=>V.current,[]);const{width:w}=is(V.current),[L,S]=Ye({value:i,defaultValue:l,onStateChange:A=>void(A?d==null?void 0:d():v==null?void 0:v())}),[k,O]=Ye({value:r,defaultValue:n,onStateChange:m}),T=p.useMemo(()=>a.find(A=>A.value===k),[a,k]),B=p.useCallback(A=>{O(A.value),S(!1)},[O,S]),R=p.useCallback(()=>{S(!1)},[S]),$=p.useCallback(()=>{e||S(!L)},[L,e,S]);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{ref:V,className:C.twJoin("bbn-select",e&&"bbn-select-disabled",`bbn-select-${u}`,t),onClick:$,tabIndex:e?-1:0,...g,children:[o.jsx("span",{children:T?j(T):s}),o.jsx(_i,{className:C.twJoin("bbn-select-icon",L&&"bbn-select-icon-open"),size:20})]}),o.jsx(ar,{anchorEl:V.current,className:C.twJoin("bbn-select-menu custom-scrollbar",f),open:L&&!e,onClickOutside:R,offset:[0,4],placement:"bottom-start",style:{width:w},children:a.map(A=>o.jsx("div",{className:C.twJoin("bbn-select-option",(T==null?void 0:T.value)===A.value&&"bbn-select-option-selected",c),onClick:()=>B(A),children:A.label},A.value))})]})});_r.displayName="Select";const Mt=p.forwardRef(({className:e,prefix:t,suffix:r,disabled:n=!1,state:s="default",...i},l)=>o.jsxs("div",{className:C.twJoin("bbn-input",`bbn-input-${s}`,n&&"bbn-input-disabled",r&&"bbn-input-has-suffix"),children:[t&&o.jsx("div",{className:"bbn-input-prefix",children:t}),o.jsx("input",{ref:l,className:C.twJoin("bbn-input-field",e),disabled:n,...i}),r&&o.jsx("div",{className:"bbn-input-suffix",children:r})]}));Mt.displayName="Input";function Lt({children:e,label:t,hint:r,state:n="default",className:s}){return o.jsxs("div",{className:C.twJoin("bbn-form-control",s),children:[t?o.jsxs("label",{className:"bbn-form-control-label",children:[o.jsx("div",{className:"bbn-form-control-title",children:t}),e]}):e,r&&o.jsx("div",{className:C.twJoin("bbn-form-control-hint",`bbn-form-control-hint-${n}`),children:r})]})}const os=p.createContext({removeDialog:()=>null,updateDialog:()=>null});function na({children:e}){const[t,r]=p.useState({}),n=p.useMemo(()=>Object.values(t).some(a=>a),[t]);p.useEffect(function(){if(n){const c=document.body.offsetWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=document.body.offsetWidth-c>=1?Or(document.body.offsetWidth-c)??"":document.body.style.paddingRight}else document.body.style.overflow="",document.body.style.paddingRight=""},[n]);const s=p.useCallback(a=>{r(c=>Reflect.deleteProperty(c,a)?{...c}:c)},[]),i=p.useCallback((a,c)=>{r(f=>({...f,[a]:c}))},[]),l=p.useMemo(()=>({removeDialog:s,updateDialog:i}),[s,i]);return o.jsx(os.Provider,{value:l,children:e})}function Ir({open:e=!1}={}){const t=p.useId(),[r,n]=p.useState(e),{updateDialog:s,removeDialog:i}=p.useContext(os),l=e||r;p.useEffect(()=>()=>{i(t)},[t]),p.useEffect(()=>{s(t,l)},[t,l,s]),p.useEffect(()=>{e&&n(!0)},[e]);const a=p.useCallback(()=>{e||n(!1)},[e]);return{mounted:r,unmount:a}}const as=({open:e=!1,...t})=>o.jsx("div",{...t,className:C.twJoin("bbn-backdrop",e?"animate-backdrop-in":"animate-backdrop-out",t.className)}),Vt=({children:e,open:t=!1,className:r,onClose:n,hasBackdrop:s=!0,backdropClassName:i,dialogClassName:l,...a})=>{const{mounted:c,unmount:f}=Ir({open:t});return o.jsxs(Ft,{mounted:c,children:[o.jsx("div",{...a,className:C.twJoin("bbn-dialog-wrapper",r),children:o.jsx("div",{className:C.twJoin("bbn-dialog",t?"animate-modal-in":"animate-modal-out",l),onAnimationEnd:f,children:e})}),s&&o.jsx(as,{className:i,open:t,onClick:n})]})},lr=({children:e,className:t="",size:r=40,variant:n="default",background:s=!1,rounded:i=!1})=>{const l={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 o.jsx("div",{className:C.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",l[n],t),style:{width:r,height:r},children:e})},ls=({className:e="",size:t=24,variant:r="primary"})=>o.jsx(lr,{variant:r,background:!0,rounded:!0,className:e,children:o.jsx("svg",{style:{width:t,height:t*.545},viewBox:"0 0 22 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.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"})})}),cs=({className:e="",size:t=24,variant:r="primary"})=>o.jsx(lr,{variant:r,background:!0,rounded:!0,className:e,children:o.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 20 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.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"})})}),us=({className:e="",size:t=24,variant:r="primary"})=>o.jsx(lr,{variant:r,background:!0,rounded:!0,className:e,children:o.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.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"}),o.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"})]})}),cr=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||De[r];return o.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",s,e),children:o.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"})})},Rr=({className:e="",size:t=14,variant:r="default",color:n})=>{const s=n||De[r];return o.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",s,e),children:o.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"})})},fs=({className:e="",size:t=22,variant:r="default",color:n})=>{const s=n||De[r],i=22/20;return o.jsx("svg",{style:{width:t,height:t*i},viewBox:"0 0 22 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:C.twJoin("transition-opacity duration-200",s,e),children:o.jsx("path",{d:"M0 19.5H22L11 0.5L0 19.5ZM12 16.5H10V14.5H12V16.5ZM12 12.5H10V8.5H12V12.5Z",fill:"currentColor"})})},ds=({className:e="",size:t=20,variant:r="default",color:n})=>{const s=n||De[r];return o.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:C.twJoin("transition-opacity duration-200",s,e),children:[o.jsx("rect",{x:"0.5",y:"0.5",width:"19",height:"19",rx:"3.5",stroke:"currentColor"}),o.jsx("path",{d:"M14.0832 10.5846H5.9165V9.41797H14.0832V10.5846Z",fill:"currentColor"})]})},hs=({className:e="",size:t=20,variant:r="default",color:n})=>{const s=n||De[r];return o.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:C.twJoin("transition-opacity duration-200",s,e),children:[o.jsx("rect",{x:"0.5",y:"0.5",width:"19",height:"19",rx:"3.5",stroke:"currentColor"}),o.jsx("path",{d:"M14 10.5714H10.5714V14H9.42857V10.5714H6V9.42857H9.42857V6H10.5714V9.42857H14V10.5714Z",fill:"currentColor"})]})},sa=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||De[r];return o.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:C.twJoin("transition-opacity duration-200",s,e),children:o.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},ia=({className:e="",size:t=16,variant:r="default",color:n})=>{const s=n||De[r];return o.jsx("svg",{style:{width:t,height:t},viewBox:"0 0 16 16.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:C.twJoin("transition-opacity duration-200",s,e),children:o.jsx("path",{d:"M11.865 5.5H4.135L0.5 9.135V11.865L4.135 15.5H11.865L15.5 11.865V9.135L11.865 5.5ZM8 13.15C7.28 13.15 6.85 12.72 6.85 12C6.85 11.28 7.28 10.85 8 10.85C8.72 10.85 9.15 11.28 9.15 12C9.15 12.72 8.72 13.15 8 13.15ZM9 10.5H7V7.5H9V10.5Z",fill:"currentColor"})})},oa=({className:e="",size:t=40,variant:r="default",color:n})=>{const s=n||De[r];return o.jsxs("svg",{style:{width:t,height:t},viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:C.twJoin("transition-opacity duration-200",e),children:[o.jsx("rect",{width:"40",height:"40",rx:"20",fill:"currentColor",fillOpacity:"0.12"}),o.jsx("path",{d:"M20 30C25.52 30 30 25.52 30 20C30 14.48 25.52 10 20 10C14.48 10 10 14.48 10 20C10 25.52 14.48 30 20 30ZM21 12.07C24.94 12.56 28 15.92 28 20C28 24.08 24.95 27.44 21 27.93V12.07Z",fill:"currentColor",className:s})]})},De={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"},et=({children:e,open:t=!1,className:r,onClose:n,...s})=>{const{mounted:i,unmount:l}=Ir({open:t});return o.jsxs(Ft,{mounted:i,children:[o.jsxs("div",{...s,className:C.twJoin("bbn-dialog-mobile",t?"animate-mobile-modal-in":"animate-mobile-modal-out",r),onAnimationEnd:l,children:[n&&o.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:o.jsx(Rr,{size:14,variant:"accent-primary"})}),e]}),o.jsx(as,{open:t,onClick:n})]})},Dt=({className:e,children:t,title:r,onClose:n})=>o.jsxs("div",{className:C.twJoin("bbn-dialog-header",e),children:[o.jsxs("div",{className:"bbn-dialog-title",children:[o.jsx(ir,{variant:"h5",children:r}),!!n&&o.jsx(kr,{className:"shrink-0",onClick:n,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:o.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]}),Tt=e=>o.jsx("div",{...e,className:C.twJoin("bbn-dialog-body",e.className)}),ur=e=>o.jsx("div",{...e,className:C.twJoin("bbn-dialog-footer",e.className)});function aa({className:e,...t}){return o.jsx("span",{...t,className:C.twJoin("bbn-chip",e)})}function la({size:e=40,className:t}){return o.jsx("span",{className:C.twMerge("bbn-loader text-current",t),style:{width:e,height:e},children:o.jsx("svg",{viewBox:"22 22 44 44",children:o.jsx("circle",{cx:"44",cy:"44",r:"20.2",fill:"none",stroke:"currentColor",strokeWidth:"3.6"})})})}var ms="Expected a function",wn=NaN,ca="[object Symbol]",ua=/^\s+|\s+$/g,fa=/^[-+]0x[0-9a-f]+$/i,da=/^0b[01]+$/i,ha=/^0o[0-7]+$/i,ma=parseInt,pa=typeof zt=="object"&&zt&&zt.Object===Object&&zt,va=typeof self=="object"&&self&&self.Object===Object&&self,xa=pa||va||Function("return this")(),ga=Object.prototype,ba=ga.toString,ya=Math.max,wa=Math.min,vr=function(){return xa.Date.now()};function ja(e,t,r){var n,s,i,l,a,c,f=0,u=!1,d=!1,m=!0;if(typeof e!="function")throw new TypeError(ms);t=jn(t)||0,Qt(r)&&(u=!!r.leading,d="maxWait"in r,i=d?ya(jn(r.maxWait)||0,t):i,m="trailing"in r?!!r.trailing:m);function v(O){var T=n,B=s;return n=s=void 0,f=O,l=e.apply(B,T),l}function j(O){return f=O,a=setTimeout(V,t),u?v(O):l}function g(O){var T=O-c,B=O-f,R=t-T;return d?wa(R,i-B):R}function y(O){var T=O-c,B=O-f;return c===void 0||T>=t||T<0||d&&B>=i}function V(){var O=vr();if(y(O))return w(O);a=setTimeout(V,g(O))}function w(O){return a=void 0,m&&n?v(O):(n=s=void 0,l)}function L(){a!==void 0&&clearTimeout(a),f=0,n=c=s=a=void 0}function S(){return a===void 0?l:w(vr())}function k(){var O=vr(),T=y(O);if(n=arguments,s=this,c=O,T){if(a===void 0)return j(c);if(d)return a=setTimeout(V,t),v(c)}return a===void 0&&(a=setTimeout(V,t)),l}return k.cancel=L,k.flush=S,k}function Ca(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(ms);return Qt(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),ja(e,t,{leading:n,maxWait:t,trailing:s})}function Qt(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Na(e){return!!e&&typeof e=="object"}function Sa(e){return typeof e=="symbol"||Na(e)&&ba.call(e)==ca}function jn(e){if(typeof e=="number")return e;if(Sa(e))return wn;if(Qt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Qt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(ua,"");var r=da.test(e);return r||ha.test(e)?ma(e.slice(2),r?2:8):fa.test(e)?wn:+e}var ka=Ca;const ps=es(ka);function vs(e,{onLoadMore:t,hasMore:r=!1,loading:n=!1}={}){const[s,i]=p.useState(!1);return p.useEffect(()=>{const l=ps(c=>{const f=c.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",l),()=>a.removeEventListener("scroll",l)},[n,r,t,e]),{isScrolledTop:s}}function xs(e){const[t,r]=p.useState(!1),[n,s]=p.useState(!1);return p.useEffect(()=>{const i=e.current;if(!i)return;const l=()=>{const{scrollLeft:a,scrollWidth:c,clientWidth:f}=i;r(a>0);const u=c-f;s(u>0&&a<u)};return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)},[e]),{isLeftScrolled:t,isRightScrolled:n}}const gs=p.createContext({data:[],columns:[],sortStates:{},onColumnSort:void 0,onRowSelect:void 0});function bs({name:e,className:t,children:r,sorter:n,frozen:s,showFrozenShadow:i,...l}){const{columns:a,sortStates:c,onColumnSort:f}=p.useContext(gs),u=c[e??""],d=u==null?void 0:u.direction,m=s?`bbn-table-frozen bbn-table-frozen-${s}`:"",v=s&&i?"bbn-frozen-shadow":"";return o.jsx(H,{variant:"caption",as:"th",className:C.twJoin("bbn-cell-left",n&&"bbn-table-sortable",m,v,t),onClick:()=>{if(n&&e){const j=a.find(g=>g.key===e);f==null||f(e,j==null?void 0:j.sorter)}},"data-column":e,...l,children:o.jsxs("div",{className:"flex items-center justify-between gap-1",children:[o.jsx("span",{children:r}),n&&o.jsxs("span",{className:"bbn-table-sort-icons",children:[o.jsx(Ii,{className:C.twJoin("bbn-sort-icon bbn-sort-icon-up",d==="asc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")}),o.jsx(Ti,{className:C.twJoin("bbn-sort-icon bbn-sort-icon-down",d==="desc"?"bbn-sort-icon-active":"bbn-sort-icon-inactive")})]})]})})}function ys(e,t){const[r,n]=p.useState({}),s=p.useCallback((l,a)=>{a&&n(c=>{var m;const f=((m=c[l])==null?void 0:m.direction)??null,u=f===null?"asc":f==="asc"?"desc":null;if(u===null)return Object.fromEntries(Object.entries(c).filter(([v])=>v!==l).map(([v,j])=>[v,{...j,priority:j.priority>c[l].priority?j.priority-1:j.priority}]));const d=Math.max(0,...Object.values(c).map(v=>v.priority));return{...c,[l]:{direction:u,priority:d+1}}})},[]),i=p.useMemo(()=>{const l=Object.entries(r).filter(([,a])=>a.direction!==null).toSorted((a,c)=>c[1].priority-a[1].priority).map(([a,c])=>({column:t.find(f=>f.key===a),direction:c.direction})).filter(({column:a})=>a==null?void 0:a.sorter);return l.length===0?e:e.toSorted((a,c)=>{for(const{column:f,direction:u}of l){const d=f.sorter(a,c);if(d!==0)return u==="asc"?d:-d}return 0})},[e,t,r]);return{sortStates:r,handleColumnSort:s,sortedData:i}}function ws({className:e,render:t,value:r,columnName:n,frozen:s,showFrozenShadow:i,...l}){const a=s?`bbn-table-frozen bbn-table-frozen-${s}`:"",c=s&&i?"bbn-frozen-shadow":"";return o.jsx(H,{variant:"body2",as:"td",className:C.twJoin("bbn-cell-left",a,c,e),"data-column":n,...l,children:t?t(r):r})}function Ea({row:e,columns:t,isSelected:r,isSelectable:n,onSelect:s,isLeftScrolled:i,isRightScrolled:l}){return o.jsx("tr",{className:C.twJoin(r&&"selected",!!s&&n&&"cursor-pointer",!n&&"opacity-50"),onClick:()=>s(e),children:t.map(a=>o.jsx(ws,{value:e[a.key],columnName:a.key,className:a.cellClassName,frozen:a.frozen,showFrozenShadow:a.frozen==="left"&&i||a.frozen==="right"&&l,render:a.render?c=>a.render(c,e):void 0},a.key))})}function Oa({data:e,columns:t,className:r,wrapperClassName:n,fluid:s=!1,hasMore:i=!1,loading:l=!1,onLoadMore:a,onRowSelect:c,isRowSelectable:f,selectedRow:u,defaultSelectedRow:d,onSelectedRowChange:m,...v},j){const g=p.useRef(null);p.useImperativeHandle(j,()=>g.current,[]);const{sortStates:y,handleColumnSort:V,sortedData:w}=ys(e,t),{isScrolledTop:L}=vs(g,{onLoadMore:a,hasMore:i,loading:l}),{isLeftScrolled:S,isRightScrolled:k}=xs(g),[O,T]=Ye({value:u,defaultValue:d??null,onStateChange:m}),B=p.useCallback(A=>{if(!c||f&&!f(A))return;const M=O===A.id?null:A.id;T(M),c(M===null?null:A)},[c,f,O,T]),R=p.useMemo(()=>({data:w,columns:t,sortStates:y,onColumnSort:V,onRowSelect:B}),[w,t,y,V,B]),$=p.useMemo(()=>t.some(A=>A.header&&A.header!==""),[t]);return o.jsx(gs.Provider,{value:R,children:o.jsx("div",{ref:g,className:C.twJoin("bbn-table-wrapper",s&&"bbn-table-wrapper-fluid",n),children:o.jsxs("table",{className:C.twJoin("bbn-table",s&&"bbn-table-fluid",r),...v,children:[o.jsx("thead",{className:C.twJoin("bbn-table-header",L&&"scrolled-top",!$&&"hidden"),children:o.jsx("tr",{children:t.map(A=>o.jsx(bs,{className:A.headerClassName,name:A.key,sorter:A.sorter,frozen:A.frozen,showFrozenShadow:A.frozen==="left"&&S||A.frozen==="right"&&k,children:A.header},A.key))})}),o.jsx("tbody",{className:"bbn-table-body",children:w.map(A=>o.jsx(Ea,{row:A,columns:t,isSelected:O===A.id,isSelectable:f?f(A):!0,onSelect:B,isLeftScrolled:S,isRightScrolled:k},A.id))})]})})})}const js=p.forwardRef(Oa);function Cs({as:e="div",className:t,children:r}){return p.createElement(e,{className:C.twJoin("bbn-card",t)},r)}function Ns(e){const[t=!1,r]=Ye({value:e.value,defaultValue:e.defaultValue,onStateChange:e.onChange});return o.jsxs("div",{className:"bbn-toggle",onClick:()=>void r(!t),children:[o.jsx("span",{className:"bbn-toggle-bg",children:e.activeIcon}),o.jsx("span",{className:C.twJoin("bbn-toggle-control",t&&"bbn-toggle-control-active")}),o.jsx("span",{className:"bbn-toggle-bg",children:e.inactiveIcon})]})}const Aa={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Fa({className:e,orientation:t="vertical",children:r}){return o.jsx("div",{className:C.twMerge("bbn-list",`bbn-list-${t}`,e),children:p.Children.map(r,n=>p.isValidElement(n)?p.cloneElement(n,{orientation:Aa[t]}):n)})}function Ss({className:e,orientation:t="horizontal",title:r,value:n,suffix:s}){return o.jsxs("div",{className:C.twJoin("bbn-list-item",`bbn-list-item-${t}`,e),children:[o.jsx(H,{as:"div",className:C.twJoin("bbn-list-title",`bbn-list-title-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),o.jsxs(H,{as:"div",className:C.twJoin("bbn-list-value",`bbn-list-value-${t}`),variant:"body1",children:[n,s]})]})}function Cn(e){return Be({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"},child:[]},{tag:"path",attr:{d:"M464 336a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"},child:[]}]})(e)}function Ma(e){return Be({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 Br(e={}){const{copiedText:t="Copied ✓",timeout:r=2e3}=e,[n,s]=p.useState({}),i=p.useRef({}),l=p.useCallback(u=>{u&&s(d=>({...d,[u]:!1}))},[]),a=p.useCallback((u,d)=>{if(!u||!d)return;navigator.clipboard.writeText(d).catch(()=>{}),s(v=>({...v,[u]:!0}));const m=i.current[u];m&&clearTimeout(m),r>0&&(i.current[u]=setTimeout(()=>{i.current[u]=void 0,l(u)},r))},[r,l]),c=p.useCallback(u=>u&&n[u]||!1,[n]),f=p.useCallback(u=>u&&n[u]?t:"",[n,t]);return p.useEffect(()=>()=>{Object.values(i.current).forEach(u=>u&&clearTimeout(u)),i.current={}},[]),{isCopied:c,copiedText:f,copyToClipboard:a}}function tt(e=768,t=100){const[r,n]=p.useState(()=>typeof window<"u"?window.innerWidth<e:!1),s=p.useRef(),i=p.useCallback(()=>{n(window.innerWidth<e)},[e]);return p.useEffect(()=>(s.current=ps(i,t),i(),window.addEventListener("resize",s.current),()=>{s.current&&(window.removeEventListener("resize",s.current),s.current.cancel())}),[i,t]),r}function ks({isOpen:e}){const[t,r]=p.useState(!1),[n,s]=p.useState(!1);p.useEffect(()=>{e&&!t&&(r(!0),s(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{s(!0)})}))},[e,t]),p.useEffect(()=>{!e&&t&&s(!1)},[e,t]);const i=p.useCallback(()=>{!e&&t&&r(!1)},[e,t]);return{mounted:t,shouldShowOpen:n,handleAnimationEnd:i}}const La=({hidden:e=!1,loading:t,title:r,value:n,tooltip:s,loadingStyle:i="spinner",...l})=>{const a=p.useId(),c=tt(),[f,u]=p.useState(!1),[d,m]=p.useState(null);if(p.useEffect(()=>{!c&&f&&u(!1)},[c,f]),e)return null;const v=o.jsxs("div",{className:"inline-flex items-center gap-2",children:[o.jsx("span",{className:"loader size-5"}),i==="spinner-and-value"&&o.jsx("span",{className:"opacity-50",children:n})]}),j=s?c?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block size-5 cursor-pointer text-xs",onClick:()=>u(!0),children:o.jsx(Cn,{size:20})}),o.jsxs(et,{open:f,onClose:()=>u(!1),children:[o.jsx("div",{className:"px-4 py-2 text-accent-primary",children:s}),o.jsx("div",{className:"p-4",children:o.jsx(ue,{variant:"contained",fluid:!0,onClick:()=>u(!1),children:"Done"})})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block size-5 cursor-pointer text-xs",onMouseEnter:g=>m(g.currentTarget),onMouseLeave:()=>m(null),"aria-describedby":a,children:o.jsx(Cn,{size:20})}),o.jsx(ar,{open:!!d,anchorEl:d,placement:"top",offset:[0,8],children:o.jsx("div",{className:"tooltip-wrap",children:s})})]}):void 0;return o.jsx(Ss,{...l,title:r,value:t?v:n,suffix:j})};function Va({children:e,count:t=0,max:r=99,position:n="bottom-right",color:s="error",className:i,badgeClassName:l,contentClassName:a}){const c=typeof t=="number"?t>0:t!=null,f=typeof t=="number"&&t>r?`${r}+`:t,u=`bbn-badge-${n}`,d=`bbn-badge-${s}`;return o.jsxs("div",{className:C.twJoin("bbn-badge",i),children:[e,c&&o.jsx("span",{className:C.twJoin("bbn-badge-indicator",u,d,l),children:o.jsx("span",{className:C.twJoin("bbn-badge-content",a),children:f})})]})}const ht=({children:e,style:t,variant:r="contained",className:n})=>o.jsx("div",{className:C.twJoin("bbn-subsection",`bbn-subsection-${r}`,n),style:t,children:e});function Es({counter:e,max:t,onAdd:r,alwaysShowCounter:n=!1}){const s=e<t,i=0<e||n&&e===0;return o.jsxs("div",{className:C.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&&o.jsx("div",{className:"flex h-10 w-10 items-center justify-center",children:o.jsx(Ma,{size:20})}),i&&o.jsxs("div",{className:C.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 Os=p.createContext(void 0),Pr=()=>p.useContext(Os),Da=({children:e,value:t})=>o.jsx(Os.Provider,{value:t,children:e}),$r=({isOpen:e,onClose:t,title:r,children:n,className:s="",titleAlign:i="left",backIcon:l,fullHeight:a=!1,fullWidth:c=!1,showBackButton:f=!0,showDivider:u=!0,onBackdropClick:d})=>{const{mounted:m,shouldShowOpen:v,handleAnimationEnd:j}=ks({isOpen:e}),g={left:"text-left",center:"text-center",right:"text-right"},y=()=>f||r?o.jsxs("div",{className:C.twJoin("flex items-center p-4",u&&"border-b border-[#38708533] dark:border-[#404040]"),children:[f&&o.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:l||o.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:o.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),r&&o.jsx("h3",{className:C.twJoin("flex-1 text-sm font-medium text-accent-primary",f?"ml-3":"",g[i]),children:r})]}):null,V=()=>o.jsxs(o.Fragment,{children:[y(),o.jsx("div",{className:"flex-1 overflow-y-auto",children:n})]});return a?o.jsxs(Ft,{mounted:m,rootClassName:"menu-drawer-portal",children:[d&&o.jsx("div",{className:C.twJoin("fixed inset-0 z-40 bg-black/50 transition-opacity duration-300",v?"opacity-100":"pointer-events-none opacity-0"),onClick:d}),o.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",c?"w-full":"w-full max-w-sm",v?"translate-x-0":"translate-x-full",s),onTransitionEnd:j,children:V()})]}):o.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",s),children:V()})},Hr=({children:e,trigger:t,open:r,onOpenChange:n,placement:s="bottom-end",offset:i=[0,8],className:l,mobileMode:a="dialog"})=>{const[c,f]=p.useState(!1),u=p.useRef(null),d=tt(),m=r!==void 0?r:c,v=V=>{r===void 0&&f(V),n==null||n(V)},j=()=>v(!1),g=o.jsx("div",{className:"relative w-full overflow-hidden",children:e}),y=t||o.jsx("button",{className:"rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-800",onClick:()=>v(!m),children:"Menu"});return o.jsxs(Da,{value:{isOpen:m,setIsOpen:v,onClose:j,isMobile:d},children:[o.jsx("div",{ref:u,className:"inline-block",children:p.isValidElement(y)&&p.cloneElement(y,{onClick:()=>v(!m),"aria-haspopup":"true","aria-expanded":m})}),d?a==="dialog"?o.jsx(et,{open:m,onClose:j,className:C.twJoin("bg-[#FFFFFF] dark:bg-[#252525] text-primary-main",l),children:g}):o.jsx($r,{isOpen:m,onClose:j,onBackdropClick:j,fullHeight:!0,fullWidth:!0,showBackButton:!0,showDivider:!1,children:g}):o.jsx(ar,{anchorEl:u.current,open:m,offset:i,placement:s,onClickOutside:j,className:C.twJoin("rounded-lg border border-[#38708533] bg-[#FFFFFF] shadow-lg dark:border-[#404040] dark:bg-[#252525]","min-w-[294px]",l),children:g})]})},As=({icon:e,name:t,description:r,onClick:n,disabled:s=!1,className:i,children:l,suffix:a,selected:c=!1,role:f="menuitem",toggle:u})=>{const d=Pr(),m=u?o.jsx(Ns,{value:u.value,defaultValue:u.defaultValue,onChange:u.onChange}):null,v=m||a,j=()=>{s||m||(n&&n(),d&&!v&&d.onClose())};return l?o.jsx("button",{onClick:j,disabled:s,className:C.twJoin("w-full text-left",s&&"cursor-not-allowed opacity-50",i),children:l}):o.jsxs("div",{className:C.twJoin("flex w-full items-center justify-between p-6","transition-colors",!m&&"cursor-pointer hover:bg-accent-secondary/5","text-left",c&&"bg-accent-secondary/10",s&&"cursor-not-allowed opacity-50",m&&"cursor-default",i),role:f,"aria-selected":c,onClick:j,children:[o.jsxs("div",{className:"flex items-center gap-3",children:[e&&o.jsx("div",{className:"flex-shrink-0",children:e}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("div",{className:"text-sm font-medium text-accent-primary",children:t}),r&&o.jsx("div",{className:"text-xs text-accent-secondary",children:r})]})]}),v&&o.jsx("div",{className:"flex-shrink-0",children:v})]})},Fs=({children:e,name:t,description:r,icon:n,backIcon:s,suffix:i,className:l,contentClassName:a,titleAlign:c="left"})=>{const[f,u]=p.useState(!1),d=Pr(),m=o.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:o.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),v=o.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:o.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return o.jsxs(o.Fragment,{children:[o.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",l),role:"menuitem",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[n&&o.jsx("div",{className:"flex-shrink-0",children:n}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-sm font-medium text-accent-primary",children:t}),r&&o.jsx("span",{className:"mt-0.5 text-xs text-accent-secondary",children:r})]})]}),i||v]}),o.jsx($r,{isOpen:f,onClose:()=>u(!1),title:t||"",titleAlign:c,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:C.twJoin(d!=null&&d.isMobile?"z-60":"z-50",a),children:e})]})},Ta=({label:e,description:t,onClick:r,selected:n=!1,className:s,suffix:i,disabled:l=!1})=>{const a=o.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M16.6667 5L7.5 14.1667L3.33333 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});return o.jsxs("button",{role:"menuitem",onClick:r,disabled:l,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",l&&"cursor-not-allowed opacity-50",s),"aria-selected":n,tabIndex:l?-1:0,children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"font-medium text-accent-primary",children:e}),t&&o.jsx("span",{className:"text-sm text-accent-secondary",children:t})]}),n&&(i||a)]})},fr=({amount:e,currencyIcon:t,currencyName:r,placeholder:n="Enter Amount",subtitle:s,displayBalance:i,balanceDetails:l,min:a,step:c,autoFocus:f,onChange:u,onKeyDown:d,amountUsd:m,disabled:v=!1})=>o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("img",{src:t,alt:r,className:"h-10 max-h-[2.5rem] w-10 max-w-[2.5rem]"}),o.jsx("div",{className:"text-lg",children:r})]}),o.jsx("input",{type:"number",value:e??"",min:a,step:c,onChange:u,onKeyDown:d,disabled:v,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"})]}),l&&i?o.jsxs("div",{className:"flex w-full flex-row content-center justify-between text-sm",children:[o.jsx("span",{className:"cursor-default",children:s}),l.displayUSD&&l.price!==void 0&&o.jsxs("div",{children:[m," USD"]})]}):null]});function _a(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 Wr=({value:e,symbols:t=8,size:r="body2",className:n})=>e?o.jsx(H,{variant:r,className:C.twJoin("text-accent-primary",n),children:o.jsx("span",{children:_a(e,t)??e})}):null,Ms=({children:e,value:t,className:r,onCopy:n,isCopied:s,copiedText:i,timeout:l=2e3})=>{const a=p.useId(),c={copiedText:i,timeout:l},{isCopied:f,copiedText:u,copyToClipboard:d}=Br(c),m=s!==void 0,v=m?s:f(a),j=m?i||"Copied ✓":u(a),g=y=>{y.stopPropagation(),m&&n?n(t):d(a,t)};return o.jsx("div",{className:C.twMerge("inline-flex items-center cursor-pointer hover:opacity-100 transition-opacity duration-200",r),onClick:g,children:o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:C.twMerge("transition-opacity duration-300 ease-in-out",v&&"opacity-0"),children:e}),v&&o.jsx("div",{className:C.twMerge("absolute inset-0 flex items-center transition-opacity duration-300 ease-in-out text-green-600","opacity-100"),children:j})]})})};function Ls({children:e,className:t,iconClassName:r,messageClassName:n}){return o.jsxs("div",{className:C.twJoin("bbn-warning",t),children:[o.jsx(fs,{variant:"secondary",size:22,className:C.twJoin("bbn-warning-icon",r)}),o.jsx("p",{className:C.twJoin("bbn-warning-message",n),children:e})]})}var _t=e=>e.type==="checkbox",Ze=e=>e instanceof Date,ie=e=>e==null;const Vs=e=>typeof e=="object";var ee=e=>!ie(e)&&!Array.isArray(e)&&Vs(e)&&!Ze(e),Ds=e=>ee(e)&&e.target?_t(e.target)?e.target.checked:e.target.value:e,Ia=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Ts=(e,t)=>e.has(Ia(t)),Ra=e=>{const t=e.constructor&&e.constructor.prototype;return ee(t)&&t.hasOwnProperty("isPrototypeOf")},Jr=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(!(Jr&&(e instanceof Blob||n))&&(r||ee(e)))if(t=r?[]:{},!r&&!Ra(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=ne(e[s]));else return e;return t}var dr=e=>/^\w*$/.test(e),Q=e=>e===void 0,Ur=e=>Array.isArray(e)?e.filter(Boolean):[],zr=e=>Ur(e.replace(/["|']|\]/g,"").split(/\.|\[/)),F=(e,t,r)=>{if(!t||!ee(e))return r;const n=(dr(t)?[t]:zr(t)).reduce((s,i)=>ie(s)?s:s[i],e);return Q(n)||n===e?Q(e[t])?r:e[t]:n},fe=e=>typeof e=="boolean",z=(e,t,r)=>{let n=-1;const s=dr(t)?[t]:zr(t),i=s.length,l=i-1;for(;++n<i;){const a=s[n];let c=r;if(n!==l){const f=e[a];c=ee(f)||Array.isArray(f)?f:isNaN(+s[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const er={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ye={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"},qr=p.createContext(null);qr.displayName="HookFormContext";const rt=()=>p.useContext(qr),Ba=e=>{const{children:t,...r}=e;return p.createElement(qr.Provider,{value:r},t)};var _s=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const l=i;return t._proxyFormState[l]!==ye.all&&(t._proxyFormState[l]=!n||ye.all),r&&(r[l]=!0),e[l]}});return s};const Zr=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Gr(e){const t=rt(),{control:r=t.control,disabled:n,name:s,exact:i}=e||{},[l,a]=p.useState(r._formState),c=p.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Zr(()=>r._subscribe({name:s,formState:c.current,exact:i,callback:f=>{!n&&a({...r._formState,...f})}}),[s,n,i]),p.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),p.useMemo(()=>_s(l,r,c.current,!1),[l,r])}var Ne=e=>typeof e=="string",Is=(e,t,r,n,s)=>Ne(e)?(n&&t.watch.add(e),F(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),F(r,i))):(n&&(t.watchAll=!0),r),wr=e=>ie(e)||!Vs(e);function Me(e,t,r=new WeakSet){if(wr(e)||wr(t))return e===t;if(Ze(e)&&Ze(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 l=e[i];if(!s.includes(i))return!1;if(i!=="ref"){const a=t[i];if(Ze(l)&&Ze(a)||ee(l)&&ee(a)||Array.isArray(l)&&Array.isArray(a)?!Me(l,a,r):l!==a)return!1}}return!0}function Xr(e){const t=rt(),{control:r=t.control,name:n,defaultValue:s,disabled:i,exact:l,compute:a}=e||{},c=p.useRef(s),f=p.useRef(a),u=p.useRef(void 0);f.current=a;const d=p.useMemo(()=>r._getWatch(n,c.current),[r,n]),[m,v]=p.useState(f.current?f.current(d):d);return Zr(()=>r._subscribe({name:n,formState:{values:!0},exact:l,callback:j=>{if(!i){const g=Is(n,r._names,j.values||r._formValues,!1,c.current);if(f.current){const y=f.current(g);Me(y,u.current)||(v(y),u.current=y)}else v(g)}}}),[r,i,n,l]),p.useEffect(()=>r._removeUnmounted()),m}function Pa(e){const t=rt(),{name:r,disabled:n,control:s=t.control,shouldUnregister:i,defaultValue:l}=e,a=Ts(s._names.array,r),c=p.useMemo(()=>F(s._formValues,r,F(s._defaultValues,r,l)),[s,r,l]),f=Xr({control:s,name:r,defaultValue:c,exact:!0}),u=Gr({control:s,name:r,exact:!0}),d=p.useRef(e),m=p.useRef(s.register(r,{...e.rules,value:f,...fe(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;const v=p.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!F(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!F(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!F(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!F(u.validatingFields,r)},error:{enumerable:!0,get:()=>F(u.errors,r)}}),[u,r]),j=p.useCallback(w=>m.current.onChange({target:{value:Ds(w),name:r},type:er.CHANGE}),[r]),g=p.useCallback(()=>m.current.onBlur({target:{value:F(s._formValues,r),name:r},type:er.BLUR}),[r,s._formValues]),y=p.useCallback(w=>{const L=F(s._fields,r);L&&w&&(L._f.ref={focus:()=>w.focus&&w.focus(),select:()=>w.select&&w.select(),setCustomValidity:S=>w.setCustomValidity(S),reportValidity:()=>w.reportValidity()})},[s._fields,r]),V=p.useMemo(()=>({name:r,value:f,...fe(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:j,onBlur:g,ref:y}),[r,n,u.disabled,j,g,y,f]);return p.useEffect(()=>{const w=s._options.shouldUnregister||i;s.register(r,{...d.current.rules,...fe(d.current.disabled)?{disabled:d.current.disabled}:{}});const L=(S,k)=>{const O=F(s._fields,S);O&&O._f&&(O._f.mount=k)};if(L(r,!0),w){const S=ne(F(s._options.defaultValues,r));z(s._defaultValues,r,S),Q(F(s._formValues,r))&&z(s._formValues,r,S)}return!a&&s.register(r),()=>{(a?w&&!s._state.action:w)?s.unregister(r):L(r,!1)}},[r,s,a,i]),p.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),p.useMemo(()=>({field:V,formState:u,fieldState:v}),[V,u,v])}var Rs=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Ct=e=>Array.isArray(e)?e:[e],Nn=()=>{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=[]}}},ae=e=>ee(e)&&!Object.keys(e).length,Yr=e=>e.type==="file",we=e=>typeof e=="function",tr=e=>{if(!Jr)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Bs=e=>e.type==="select-multiple",Kr=e=>e.type==="radio",$a=e=>Kr(e)||_t(e),xr=e=>tr(e)&&e.isConnected;function Ha(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 Wa(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:dr(t)?[t]:zr(t),n=r.length===1?e:Ha(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(ee(n)&&ae(n)||Array.isArray(n)&&Wa(n))&&te(e,r.slice(0,-1)),e}var Ps=e=>{for(const t in e)if(we(e[t]))return!0;return!1};function rr(e,t={}){const r=Array.isArray(e);if(ee(e)||r)for(const n in e)Array.isArray(e[n])||ee(e[n])&&!Ps(e[n])?(t[n]=Array.isArray(e[n])?[]:{},rr(e[n],t[n])):ie(e[n])||(t[n]=!0);return t}function $s(e,t,r){const n=Array.isArray(e);if(ee(e)||n)for(const s in e)Array.isArray(e[s])||ee(e[s])&&!Ps(e[s])?Q(t)||wr(r[s])?r[s]=Array.isArray(e[s])?rr(e[s],[]):{...rr(e[s])}:$s(e[s],ie(t)?{}:t[s],r[s]):r[s]=!Me(e[s],t[s]);return r}var bt=(e,t)=>$s(e,t,rr(t));const Sn={value:!1,isValid:!1},kn={value:!0,isValid:!0};var Hs=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===""?kn:{value:e[0].value,isValid:!0}:kn:Sn}return Sn},Ws=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Q(e)?e:t?e===""?NaN:e&&+e:r&&Ne(e)?new Date(e):n?n(e):e;const En={isValid:!1,value:null};var Js=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,En):En;function On(e){const t=e.ref;return Yr(t)?t.files:Kr(t)?Js(e.refs).value:Bs(t)?[...t.selectedOptions].map(({value:r})=>r):_t(t)?Hs(e.refs).value:Ws(Q(t.value)?e.ref.value:t.value,e)}var Ja=(e,t,r,n)=>{const s={};for(const i of e){const l=F(t,i);l&&z(s,i,l._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},nr=e=>e instanceof RegExp,yt=e=>Q(e)?e:nr(e)?e.source:ee(e)?nr(e.value)?e.value.source:e.value:e,An=e=>({isOnSubmit:!e||e===ye.onSubmit,isOnBlur:e===ye.onBlur,isOnChange:e===ye.onChange,isOnAll:e===ye.all,isOnTouch:e===ye.onTouched});const Fn="AsyncFunction";var Ua=e=>!!e&&!!e.validate&&!!(we(e.validate)&&e.validate.constructor.name===Fn||ee(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Fn)),za=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 Nt=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=F(e,s);if(i){const{_f:l,...a}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],s)&&!n)return!0;if(l.ref&&t(l.ref,l.name)&&!n)return!0;if(Nt(a,t))break}else if(ee(a)&&Nt(a,t))break}}};function Ln(e,t,r){const n=F(e,r);if(n||dr(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),l=F(t,i),a=F(e,i);if(l&&!Array.isArray(l)&&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 qa=(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(l=>t[l]===(!n||ye.all))},Za=(e,t,r)=>!e||!t||e===t||Ct(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),Ga=(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,Xa=(e,t)=>!Ur(F(e,t)).length&&te(e,t),Ya=(e,t,r)=>{const n=Ct(F(e,r));return z(n,"root",t[r]),z(e,r,n),e},Gt=e=>Ne(e);function Vn(e,t,r="validate"){if(Gt(e)||Array.isArray(e)&&e.every(Gt)||fe(e)&&!e)return{type:r,message:Gt(e)?e:"",ref:t}}var it=e=>ee(e)&&!nr(e)?e:{value:e,message:""},Dn=async(e,t,r,n,s,i)=>{const{ref:l,refs:a,required:c,maxLength:f,minLength:u,min:d,max:m,pattern:v,validate:j,name:g,valueAsNumber:y,mount:V}=e._f,w=F(r,g);if(!V||t.has(g))return{};const L=a?a[0]:l,S=M=>{s&&L.reportValidity&&(L.setCustomValidity(fe(M)?"":M||""),L.reportValidity())},k={},O=Kr(l),T=_t(l),B=O||T,R=(y||Yr(l))&&Q(l.value)&&Q(w)||tr(l)&&l.value===""||w===""||Array.isArray(w)&&!w.length,$=Rs.bind(null,g,n,k),A=(M,P,J,Y=Fe.maxLength,q=Fe.minLength)=>{const K=M?P:J;k[g]={type:M?Y:q,message:K,ref:l,...$(M?Y:q,K)}};if(i?!Array.isArray(w)||!w.length:c&&(!B&&(R||ie(w))||fe(w)&&!w||T&&!Hs(a).isValid||O&&!Js(a).isValid)){const{value:M,message:P}=Gt(c)?{value:!!c,message:c}:it(c);if(M&&(k[g]={type:Fe.required,message:P,ref:L,...$(Fe.required,P)},!n))return S(P),k}if(!R&&(!ie(d)||!ie(m))){let M,P;const J=it(m),Y=it(d);if(!ie(w)&&!isNaN(w)){const q=l.valueAsNumber||w&&+w;ie(J.value)||(M=q>J.value),ie(Y.value)||(P=q<Y.value)}else{const q=l.valueAsDate||new Date(w),K=Ae=>new Date(new Date().toDateString()+" "+Ae),je=l.type=="time",oe=l.type=="week";Ne(J.value)&&w&&(M=je?K(w)>K(J.value):oe?w>J.value:q>new Date(J.value)),Ne(Y.value)&&w&&(P=je?K(w)<K(Y.value):oe?w<Y.value:q<new Date(Y.value))}if((M||P)&&(A(!!M,J.message,Y.message,Fe.max,Fe.min),!n))return S(k[g].message),k}if((f||u)&&!R&&(Ne(w)||i&&Array.isArray(w))){const M=it(f),P=it(u),J=!ie(M.value)&&w.length>+M.value,Y=!ie(P.value)&&w.length<+P.value;if((J||Y)&&(A(J,M.message,P.message),!n))return S(k[g].message),k}if(v&&!R&&Ne(w)){const{value:M,message:P}=it(v);if(nr(M)&&!w.match(M)&&(k[g]={type:Fe.pattern,message:P,ref:l,...$(Fe.pattern,P)},!n))return S(P),k}if(j){if(we(j)){const M=await j(w,r),P=Vn(M,L);if(P&&(k[g]={...P,...$(Fe.validate,P.message)},!n))return S(P.message),k}else if(ee(j)){let M={};for(const P in j){if(!ae(M)&&!n)break;const J=Vn(await j[P](w,r),L,P);J&&(M={...J,...$(P,J.message)},S(J.message),n&&(k[g]=M))}if(!ae(M)&&(k[g]={ref:L,...M},!n))return k}}return S(!0),k};const Ka={mode:ye.onSubmit,reValidateMode:ye.onChange,shouldFocusError:!0};function Qa(e={}){let t={...Ka,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:we(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),l={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,f=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const m={array:Nn(),state:Nn()},v=t.criteriaMode===ye.all,j=h=>x=>{clearTimeout(f),f=setTimeout(h,x)},g=async h=>{if(!t.disabled&&(u.isValid||d.isValid||h)){const x=t.resolver?ae((await T()).errors):await R(n,!0);x!==r.isValid&&m.state.next({isValid:x})}},y=(h,x)=>{!t.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((h||Array.from(a.mount)).forEach(b=>{b&&(x?z(r.validatingFields,b,x):te(r.validatingFields,b))}),m.state.next({validatingFields:r.validatingFields,isValidating:!ae(r.validatingFields)}))},V=(h,x=[],b,D,E=!0,N=!0)=>{if(D&&b&&!t.disabled){if(l.action=!0,N&&Array.isArray(F(n,h))){const I=b(F(n,h),D.argA,D.argB);E&&z(n,h,I)}if(N&&Array.isArray(F(r.errors,h))){const I=b(F(r.errors,h),D.argA,D.argB);E&&z(r.errors,h,I),Xa(r.errors,h)}if((u.touchedFields||d.touchedFields)&&N&&Array.isArray(F(r.touchedFields,h))){const I=b(F(r.touchedFields,h),D.argA,D.argB);E&&z(r.touchedFields,h,I)}(u.dirtyFields||d.dirtyFields)&&(r.dirtyFields=bt(s,i)),m.state.next({name:h,isDirty:A(h,x),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else z(i,h,x)},w=(h,x)=>{z(r.errors,h,x),m.state.next({errors:r.errors})},L=h=>{r.errors=h,m.state.next({errors:r.errors,isValid:!1})},S=(h,x,b,D)=>{const E=F(n,h);if(E){const N=F(i,h,Q(b)?F(s,h):b);Q(N)||D&&D.defaultChecked||x?z(i,h,x?N:On(E._f)):J(h,N),l.mount&&g()}},k=(h,x,b,D,E)=>{let N=!1,I=!1;const W={name:h};if(!t.disabled){if(!b||D){(u.isDirty||d.isDirty)&&(I=r.isDirty,r.isDirty=W.isDirty=A(),N=I!==W.isDirty);const U=Me(F(s,h),x);I=!!F(r.dirtyFields,h),U?te(r.dirtyFields,h):z(r.dirtyFields,h,!0),W.dirtyFields=r.dirtyFields,N=N||(u.dirtyFields||d.dirtyFields)&&I!==!U}if(b){const U=F(r.touchedFields,h);U||(z(r.touchedFields,h,b),W.touchedFields=r.touchedFields,N=N||(u.touchedFields||d.touchedFields)&&U!==b)}N&&E&&m.state.next(W)}return N?W:{}},O=(h,x,b,D)=>{const E=F(r.errors,h),N=(u.isValid||d.isValid)&&fe(x)&&r.isValid!==x;if(t.delayError&&b?(c=j(()=>w(h,b)),c(t.delayError)):(clearTimeout(f),c=null,b?z(r.errors,h,b):te(r.errors,h)),(b?!Me(E,b):E)||!ae(D)||N){const I={...D,...N&&fe(x)?{isValid:x}:{},errors:r.errors,name:h};r={...r,...I},m.state.next(I)}},T=async h=>{y(h,!0);const x=await t.resolver(i,t.context,Ja(h||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return y(h),x},B=async h=>{const{errors:x}=await T(h);if(h)for(const b of h){const D=F(x,b);D?z(r.errors,b,D):te(r.errors,b)}else r.errors=x;return x},R=async(h,x,b={valid:!0})=>{for(const D in h){const E=h[D];if(E){const{_f:N,...I}=E;if(N){const W=a.array.has(N.name),U=E._f&&Ua(E._f);U&&u.validatingFields&&y([D],!0);const me=await Dn(E,a.disabled,i,v,t.shouldUseNativeValidation&&!x,W);if(U&&u.validatingFields&&y([D]),me[N.name]&&(b.valid=!1,x))break;!x&&(F(me,N.name)?W?Ya(r.errors,me,N.name):z(r.errors,N.name,me[N.name]):te(r.errors,N.name))}!ae(I)&&await R(I,x,b)}}return b.valid},$=()=>{for(const h of a.unMount){const x=F(n,h);x&&(x._f.refs?x._f.refs.every(b=>!xr(b)):!xr(x._f.ref))&&_e(h)}a.unMount=new Set},A=(h,x)=>!t.disabled&&(h&&x&&z(i,h,x),!Me(Ae(),s)),M=(h,x,b)=>Is(h,a,{...l.mount?i:Q(x)?s:Ne(h)?{[h]:x}:x},b,x),P=h=>Ur(F(l.mount?i:s,h,t.shouldUnregister?F(s,h,[]):[])),J=(h,x,b={})=>{const D=F(n,h);let E=x;if(D){const N=D._f;N&&(!N.disabled&&z(i,h,Ws(x,N)),E=tr(N.ref)&&ie(x)?"":x,Bs(N.ref)?[...N.ref.options].forEach(I=>I.selected=E.includes(I.value)):N.refs?_t(N.ref)?N.refs.forEach(I=>{(!I.defaultChecked||!I.disabled)&&(Array.isArray(E)?I.checked=!!E.find(W=>W===I.value):I.checked=E===I.value||!!E)}):N.refs.forEach(I=>I.checked=I.value===E):Yr(N.ref)?N.ref.value="":(N.ref.value=E,N.ref.type||m.state.next({name:h,values:ne(i)})))}(b.shouldDirty||b.shouldTouch)&&k(h,E,b.shouldTouch,b.shouldDirty,!0),b.shouldValidate&&oe(h)},Y=(h,x,b)=>{for(const D in x){if(!x.hasOwnProperty(D))return;const E=x[D],N=h+"."+D,I=F(n,N);(a.array.has(h)||ee(E)||I&&!I._f)&&!Ze(E)?Y(N,E,b):J(N,E,b)}},q=(h,x,b={})=>{const D=F(n,h),E=a.array.has(h),N=ne(x);z(i,h,N),E?(m.array.next({name:h,values:ne(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&b.shouldDirty&&m.state.next({name:h,dirtyFields:bt(s,i),isDirty:A(h,N)})):D&&!D._f&&!ie(N)?Y(h,N,b):J(h,N,b),Mn(h,a)&&m.state.next({...r,name:h}),m.state.next({name:l.mount?h:void 0,values:ne(i)})},K=async h=>{l.mount=!0;const x=h.target;let b=x.name,D=!0;const E=F(n,b),N=U=>{D=Number.isNaN(U)||Ze(U)&&isNaN(U.getTime())||Me(U,F(i,b,U))},I=An(t.mode),W=An(t.reValidateMode);if(E){let U,me;const Jt=x.type?On(E._f):Ds(h),Ie=h.type===er.BLUR||h.type===er.FOCUS_OUT,vi=!za(E._f)&&!t.resolver&&!F(r.errors,b)&&!E._f.deps||Ga(Ie,F(r.touchedFields,b),r.isSubmitted,W,I),mr=Mn(b,a,Ie);z(i,b,Jt),Ie?(E._f.onBlur&&E._f.onBlur(h),c&&c(0)):E._f.onChange&&E._f.onChange(h);const pr=k(b,Jt,Ie),xi=!ae(pr)||mr;if(!Ie&&m.state.next({name:b,type:h.type,values:ne(i)}),vi)return(u.isValid||d.isValid)&&(t.mode==="onBlur"?Ie&&g():Ie||g()),xi&&m.state.next({name:b,...mr?{}:pr});if(!Ie&&mr&&m.state.next({...r}),t.resolver){const{errors:on}=await T([b]);if(N(Jt),D){const gi=Ln(r.errors,n,b),an=Ln(on,n,gi.name||b);U=an.error,b=an.name,me=ae(on)}}else y([b],!0),U=(await Dn(E,a.disabled,i,v,t.shouldUseNativeValidation))[b],y([b]),N(Jt),D&&(U?me=!1:(u.isValid||d.isValid)&&(me=await R(n,!0)));D&&(E._f.deps&&oe(E._f.deps),O(b,me,U,pr))}},je=(h,x)=>{if(F(r.errors,x)&&h.focus)return h.focus(),1},oe=async(h,x={})=>{let b,D;const E=Ct(h);if(t.resolver){const N=await B(Q(h)?h:E);b=ae(N),D=h?!E.some(I=>F(N,I)):b}else h?(D=(await Promise.all(E.map(async N=>{const I=F(n,N);return await R(I&&I._f?{[N]:I}:I)}))).every(Boolean),!(!D&&!r.isValid)&&g()):D=b=await R(n);return m.state.next({...!Ne(h)||(u.isValid||d.isValid)&&b!==r.isValid?{}:{name:h},...t.resolver||!h?{isValid:b}:{},errors:r.errors}),x.shouldFocus&&!D&&Nt(n,je,h?E:a.mount),D},Ae=h=>{const x={...l.mount?i:s};return Q(h)?x:Ne(h)?F(x,h):h.map(b=>F(x,b))},st=(h,x)=>({invalid:!!F((x||r).errors,h),isDirty:!!F((x||r).dirtyFields,h),error:F((x||r).errors,h),isValidating:!!F(r.validatingFields,h),isTouched:!!F((x||r).touchedFields,h)}),He=h=>{h&&Ct(h).forEach(x=>te(r.errors,x)),m.state.next({errors:h?r.errors:{}})},We=(h,x,b)=>{const D=(F(n,h,{_f:{}})._f||{}).ref,E=F(r.errors,h)||{},{ref:N,message:I,type:W,...U}=E;z(r.errors,h,{...U,...x,ref:D}),m.state.next({name:h,errors:r.errors,isValid:!1}),b&&b.shouldFocus&&D&&D.focus&&D.focus()},Te=(h,x)=>we(h)?m.state.subscribe({next:b=>"values"in b&&h(M(void 0,x),b)}):M(h,x,!0),be=h=>m.state.subscribe({next:x=>{Za(h.name,x.name,h.exact)&&qa(x,h.formState||u,Ht,h.reRenderRoot)&&h.callback({values:{...i},...r,...x,defaultValues:s})}}).unsubscribe,Je=h=>(l.mount=!0,d={...d,...h.formState},be({...h,formState:d})),_e=(h,x={})=>{for(const b of h?Ct(h):a.mount)a.mount.delete(b),a.array.delete(b),x.keepValue||(te(n,b),te(i,b)),!x.keepError&&te(r.errors,b),!x.keepDirty&&te(r.dirtyFields,b),!x.keepTouched&&te(r.touchedFields,b),!x.keepIsValidating&&te(r.validatingFields,b),!t.shouldUnregister&&!x.keepDefaultValue&&te(s,b);m.state.next({values:ne(i)}),m.state.next({...r,...x.keepDirty?{isDirty:A()}:{}}),!x.keepIsValid&&g()},Ce=({disabled:h,name:x})=>{(fe(h)&&l.mount||h||a.disabled.has(x))&&(h?a.disabled.add(x):a.disabled.delete(x))},Ue=(h,x={})=>{let b=F(n,h);const D=fe(x.disabled)||fe(t.disabled);return z(n,h,{...b||{},_f:{...b&&b._f?b._f:{ref:{name:h}},name:h,mount:!0,...x}}),a.mount.add(h),b?Ce({disabled:fe(x.disabled)?x.disabled:t.disabled,name:h}):S(h,!0,x.value),{...D?{disabled:x.disabled||t.disabled}:{},...t.progressive?{required:!!x.required,min:yt(x.min),max:yt(x.max),minLength:yt(x.minLength),maxLength:yt(x.maxLength),pattern:yt(x.pattern)}:{},name:h,onChange:K,onBlur:K,ref:E=>{if(E){Ue(h,x),b=F(n,h);const N=Q(E.value)&&E.querySelectorAll&&E.querySelectorAll("input,select,textarea")[0]||E,I=$a(N),W=b._f.refs||[];if(I?W.find(U=>U===N):N===b._f.ref)return;z(n,h,{_f:{...b._f,...I?{refs:[...W.filter(xr),N,...Array.isArray(F(s,h))?[{}]:[]],ref:{type:N.type,name:h}}:{ref:N}}}),S(h,!1,void 0,N)}else b=F(n,h,{}),b._f&&(b._f.mount=!1),(t.shouldUnregister||x.shouldUnregister)&&!(Ts(a.array,h)&&l.action)&&a.unMount.add(h)}}},vt=()=>t.shouldFocusError&&Nt(n,je,a.mount),xt=h=>{fe(h)&&(m.state.next({disabled:h}),Nt(n,(x,b)=>{const D=F(n,b);D&&(x.disabled=D._f.disabled||h,Array.isArray(D._f.refs)&&D._f.refs.forEach(E=>{E.disabled=D._f.disabled||h}))},0,!1))},It=(h,x)=>async b=>{let D;b&&(b.preventDefault&&b.preventDefault(),b.persist&&b.persist());let E=ne(i);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:N,values:I}=await T();r.errors=N,E=ne(I)}else await R(n);if(a.disabled.size)for(const N of a.disabled)te(E,N);if(te(r.errors,"root"),ae(r.errors)){m.state.next({errors:{}});try{await h(E,b)}catch(N){D=N}}else x&&await x({...r.errors},b),vt(),setTimeout(vt);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ae(r.errors)&&!D,submitCount:r.submitCount+1,errors:r.errors}),D)throw D},Rt=(h,x={})=>{F(n,h)&&(Q(x.defaultValue)?q(h,ne(F(s,h))):(q(h,x.defaultValue),z(s,h,ne(x.defaultValue))),x.keepTouched||te(r.touchedFields,h),x.keepDirty||(te(r.dirtyFields,h),r.isDirty=x.defaultValue?A(h,ne(F(s,h))):A()),x.keepError||(te(r.errors,h),u.isValid&&g()),m.state.next({...r}))},Bt=(h,x={})=>{const b=h?ne(h):s,D=ne(b),E=ae(h),N=E?s:D;if(x.keepDefaultValues||(s=b),!x.keepValues){if(x.keepDirtyValues){const I=new Set([...a.mount,...Object.keys(bt(s,i))]);for(const W of Array.from(I))F(r.dirtyFields,W)?z(N,W,F(i,W)):q(W,F(N,W))}else{if(Jr&&Q(h))for(const I of a.mount){const W=F(n,I);if(W&&W._f){const U=Array.isArray(W._f.refs)?W._f.refs[0]:W._f.ref;if(tr(U)){const me=U.closest("form");if(me){me.reset();break}}}}if(x.keepFieldsRef)for(const I of a.mount)q(I,F(N,I));else n={}}i=t.shouldUnregister?x.keepDefaultValues?ne(s):{}:ne(N),m.array.next({values:{...N}}),m.state.next({values:{...N}})}a={mount:x.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!u.isValid||!!x.keepIsValid||!!x.keepDirtyValues,l.watch=!!t.shouldUnregister,m.state.next({submitCount:x.keepSubmitCount?r.submitCount:0,isDirty:E?!1:x.keepDirty?r.isDirty:!!(x.keepDefaultValues&&!Me(h,s)),isSubmitted:x.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:E?{}:x.keepDirtyValues?x.keepDefaultValues&&i?bt(s,i):r.dirtyFields:x.keepDefaultValues&&h?bt(s,h):x.keepDirty?r.dirtyFields:{},touchedFields:x.keepTouched?r.touchedFields:{},errors:x.keepErrors?r.errors:{},isSubmitSuccessful:x.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Pt=(h,x)=>Bt(we(h)?h(i):h,x),$t=(h,x={})=>{const b=F(n,h),D=b&&b._f;if(D){const E=D.refs?D.refs[0]:D.ref;E.focus&&(E.focus(),x.shouldSelect&&we(E.select)&&E.select())}},Ht=h=>{r={...r,...h}},Wt={control:{register:Ue,unregister:_e,getFieldState:st,handleSubmit:It,setError:We,_subscribe:be,_runSchema:T,_focusError:vt,_getWatch:M,_getDirty:A,_setValid:g,_setFieldArray:V,_setDisabledField:Ce,_setErrors:L,_getFieldArray:P,_reset:Bt,_resetDefaultValues:()=>we(t.defaultValues)&&t.defaultValues().then(h=>{Pt(h,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:xt,_subjects:m,_proxyFormState:u,get _fields(){return n},get _formValues(){return i},get _state(){return l},set _state(h){l=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:Je,trigger:oe,register:Ue,handleSubmit:It,watch:Te,setValue:q,getValues:Ae,reset:Pt,resetField:Rt,clearErrors:He,unregister:_e,setError:We,setFocus:$t,getFieldState:st};return{...Wt,formControl:Wt}}function el(e={}){const t=p.useRef(void 0),r=p.useRef(void 0),[n,s]=p.useState({isDirty:!1,isValidating:!1,isLoading:we(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:we(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!we(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...a}=Qa(e);t.current={...a,formState:n}}const i=t.current.control;return i._options=e,Zr(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),i._formState.isReady=!0,l},[i]),p.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),p.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),p.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),p.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),p.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==n.isDirty&&i._subjects.state.next({isDirty:l})}},[i,n.isDirty]),p.useEffect(()=>{e.values&&!Me(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),r.current=e.values,s(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),p.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=_s(n,i),t.current}const Tn=(e,t,r)=>{if(e&&"reportValidity"in e){const n=F(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Us=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Tn(n.ref,r,e):n.refs&&n.refs.forEach(s=>Tn(s,r,e))}},tl=(e,t)=>{t.shouldUseNativeValidation&&Us(e,t);const r={};for(const n in e){const s=F(t.fields,n),i=Object.assign(e[n]||{},{ref:s&&s.ref});if(rl(t.names||Object.keys(e),n)){const l=Object.assign({},F(r,n));z(l,"root",i),z(r,n,l)}else z(r,n,i)}return r},rl=(e,t)=>e.some(r=>r.startsWith(t+"."));function nl(e,t,r){return t===void 0&&(t={}),r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(l,a){try{var c=(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&&Us({},i),{values:r.raw?n:f,errors:{}}}))}catch(f){return a(f)}return c&&c.then?c.then(void 0,a):c}(0,function(l){if(!l.inner)throw l;return{values:{},errors:tl((a=l,c=!i.shouldUseNativeValidation&&i.criteriaMode==="all",(a.inner||[]).reduce(function(f,u){if(f[u.path]||(f[u.path]={message:u.message,type:u.type}),c){var d=f[u.path].types,m=d&&d[u.type];f[u.path]=Rs(u.path,c,f,u.type,m?[].concat(m,u.message):u.message)}return f},{})),i)};var a,c}))}catch(l){return Promise.reject(l)}}}function sl({className:e,name:t,children:r,mode:n="onBlur",reValidateMode:s="onBlur",defaultValues:i,schema:l,formProps:a,onSubmit:c=()=>null,onChange:f}){const u=el({mode:n,reValidateMode:s,defaultValues:i,resolver:l?nl(l):void 0});return p.useEffect(()=>{if(!f)return;const{unsubscribe:d}=u.watch(f);return d},[f,u.watch]),o.jsx(Ba,{...u,children:o.jsx("form",{className:C.twJoin("bbn-form",e),name:t,onSubmit:u.handleSubmit(c),...a,children:r})})}function nt({name:e,defaultValue:t,disabled:r=!1,autoFocus:n=!1,shouldUnregister:s=!1,validateOnMount:i=!0}){const{setFocus:l,trigger:a}=rt(),{field:c,fieldState:f}=Pa({name:e,defaultValue:t,disabled:r,shouldUnregister:s}),{invalid:u,isTouched:d,error:m}=f;return p.useEffect(()=>{i?a(e,{shouldFocus:n}):n&&l(e)},[e,i]),{...c,value:c.value,invalid:u&&d,error:(m==null?void 0:m.message)??""}}function il(e){const{getFieldState:t}=rt(),r=Gr({name:e});return Array.isArray(e)?e.map(s=>t(s,r)):t(e,r)}const ol=/^-?\d*\.?\d*$/;function al({name:e,id:t=e,label:r,hint:n,className:s,controlClassName:i,disabled:l,autoFocus:a,defaultValue:c,placeholder:f,type:u,suffix:d,prefix:m,shouldUnregister:v,state:j,validateOnMount:g}){const{ref:y,value:V="",error:w,invalid:L,onChange:S,onBlur:k}=nt({name:e,defaultValue:c,autoFocus:a,shouldUnregister:v,validateOnMount:g}),O=L?"error":j,T=L?w:n,B=R=>{ol.test(R.target.value)&&S(R.target.value)};return o.jsx(Lt,{label:r,className:i,state:O,hint:T,children:o.jsx(Mt,{inputMode:"decimal",pattern:"^-?\\d*\\.?\\d*$",ref:y,value:V,id:t,name:e,type:u,className:s,disabled:l,autoFocus:a,placeholder:f,suffix:d,prefix:m,state:O,onChange:B,onBlur:k})})}function ll({name:e,id:t=e,label:r,hint:n,className:s,controlClassName:i,disabled:l,autoFocus:a,defaultValue:c,placeholder:f,type:u,suffix:d,prefix:m,shouldUnregister:v,state:j,validateOnMount:g}){const{ref:y,value:V="",error:w,invalid:L,onChange:S,onBlur:k}=nt({name:e,defaultValue:c,autoFocus:a,shouldUnregister:v,validateOnMount:g}),O=L?"error":j,T=L?w:n;return o.jsx(Lt,{label:r,className:i,state:O,hint:T,children:o.jsx(Mt,{ref:y,value:V,id:t,name:e,type:u,className:s,disabled:l,autoFocus:a,placeholder:f,suffix:d,prefix:m,state:O,onChange:S,onBlur:k})})}function cl({name:e,id:t=e,label:r,className:n,disabled:s,value:i,defaultChecked:l,labelClassName:a,orientation:c}){const{ref:f,value:u=!1,onChange:d,onBlur:m}=nt({name:e});return o.jsx($n,{ref:f,name:e,checked:u,id:t,label:r,className:n,disabled:s,value:i,defaultChecked:l,labelClassName:a,orientation:c,inputProps:{onChange:d,onBlur:m}})}function ul({name:e,id:t=e,label:r,className:n,disabled:s,value:i,defaultChecked:l,labelClassName:a,orientation:c}){const{ref:f,value:u,onChange:d,onBlur:m}=nt({name:e,disabled:s,defaultValue:l?i:void 0});return o.jsx(Hn,{ref:f,name:e,id:t,label:r,className:n,disabled:s,checked:u===i,value:i,labelClassName:a,orientation:c,inputProps:{onChange:d,onBlur:m}})}function fl({open:e,defaultOpen:t,options:r,optionClassName:n,popoverClassName:s,name:i,id:l=i,label:a,hint:c,className:f,controlClassName:u,disabled:d,autoFocus:m,defaultValue:v,placeholder:j,shouldUnregister:g,state:y,validateOnMount:V,onOpen:w,onClose:L,renderSelectedOption:S}){const{ref:k,value:O="",error:T,invalid:B,onChange:R,onBlur:$}=nt({name:i,defaultValue:v,autoFocus:m,shouldUnregister:g,validateOnMount:V}),A=B?"error":y,M=B?T:c,P=()=>{$==null||$(),L==null||L()};return o.jsx(Lt,{label:a,className:u,state:A,hint:M,children:o.jsx(_r,{open:e,defaultOpen:t,options:r,ref:k,value:O,id:l,name:i,className:f,disabled:d,placeholder:j,state:A,optionClassName:n,popoverClassName:s,onSelect:R,onBlur:$,onOpen:w,onClose:P,renderSelectedOption:S})})}function zs({displayError:e=!1,...t}){const{error:r,value:n,onChange:s,onBlur:i,disabled:l,name:a,ref:c}=nt(t),f=o.jsx("input",{ref:c,type:"hidden",name:a,disabled:l,value:n,onChange:s,onBlur:i});if(e){const u=e?"error":"default",d=e?r:"";return o.jsx(Lt,{hint:d,state:u,children:f})}return f}const dl={lg:{logo:"size-10",subLogo:"text-[0.8rem]"},md:{logo:"size-6",subLogo:"text-[0.5rem]"},sm:{logo:"size-5",subLogo:"text-[0.4rem]"}},qs=({logoUrl:e,rank:t,moniker:r,size:n="md",className:s})=>{const[i,l]=p.useState(!1),a=dl[n],c=(r==null?void 0:r.charAt(0).toUpperCase())??String(t);return o.jsx("span",{className:C.twMerge("relative inline-block",a.logo,s),children:e&&!i?o.jsx("img",{src:e,alt:r||`Finality Provider ${t}`,className:"h-full w-full rounded-full object-cover",onError:()=>l(!0)}):o.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:c})})};function Qr({bsnId:e,bsnName:t,bsnLogoUrl:r,address:n,provider:s,onRemove:i,showChain:l=!0}){var u,d;if(!s)return null;const a=()=>{if(r)return o.jsx(ot,{url:r,alt:t,variant:"rounded",size:"tiny",className:"mr-1"});const m=(t==null?void 0:t.charAt(0).toUpperCase())||"?";return o.jsx(ot,{variant:"rounded",size:"tiny",className:"mr-1",children:o.jsx(H,{as:"span",className:"inline-flex h-full w-full items-center justify-center bg-secondary-main text-xs text-accent-contrast",children:m})})},c=m=>!m||m.length<=12?m:`${m.slice(0,6)}...${m.slice(-6)}`,f=()=>l?n?o.jsxs("div",{className:"flex items-center gap-1 text-xs text-accent-secondary",children:[c(n),o.jsx(Ms,{value:n,className:"cursor-pointer",copiedText:"✓",children:o.jsx(cr,{size:12})})]}):o.jsxs("div",{className:"flex items-center text-xs text-accent-secondary",children:[a(),t]}):null;return o.jsxs("div",{className:"flex flex-row items-center justify-between",children:[o.jsxs("div",{className:"flex h-10 flex-row gap-2",children:[o.jsx("div",{className:"shrink-0",children:o.jsx(qs,{logoUrl:s.logo_url,rank:s.rank,moniker:(u=s.description)==null?void 0:u.moniker,size:"lg"})}),o.jsxs("div",{className:"flex flex-col justify-center text-accent-primary",children:[f(),o.jsx(H,{as:"div",className:"text-base font-medium text-accent-primary",children:(d=s.description)==null?void 0:d.moniker})]})]}),i?o.jsx("button",{onClick:()=>i(e),className:"ml-[10px] flex items-center justify-center cursor-pointer p-1",children:o.jsx(Rr,{size:12})}):null]})}const hl=({attributes:e,providerItemProps:t,isSelected:r=!1,isSelectable:n=!0,onSelect:s})=>o.jsxs("div",{className:"bg-secondary-highlight h-[316px] overflow-hidden p-4 flex flex-col rounded justify-between",children:[o.jsx(Qr,{...t}),o.jsx("div",{className:"w-full h-px bg-secondary-strokeLight"}),Object.entries(e).map(([i,l])=>o.jsxs("div",{className:"text-sm flex flex-row justify-between first:mt-0 mt-1",children:[o.jsx("div",{className:"text-accent-secondary",children:i}),o.jsx("div",{className:"text-accent-primary font-medium",children:l})]},i)),s&&o.jsx(ue,{className:"mt-4",onClick:s,disabled:!n,variant:r?"contained":"outlined",children:r?"Selected":"Select"})]}),en=8,ml=5,hr=640,Zs=500;function pl(e){return Be({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"},child:[]}]})(e)}function vl({className:e,...t}){const n=tt(hr)?et:Vt;return o.jsx(n,{...t,className:C.twMerge("w-[41.25rem] max-w-full",e)})}const xl=({open:e,validators:t,columns:r,onClose:n,onSelect:s,title:i="",description:l})=>{const[a,c]=p.useState(""),f=()=>{c("")},u=a?o.jsx("button",{onClick:f,className:"opacity-60 hover:opacity-100 transition-opacity",children:o.jsx(pl,{size:18,className:"text-secondary-strokeDark"})}):o.jsx("span",{className:"text-secondary-strokeDark",children:o.jsx(Ri,{size:20})}),d=p.useMemo(()=>a.trim()?t.filter(m=>m.name.toLowerCase().includes(a.toLowerCase())):t,[t,a]);return o.jsxs(vl,{open:e,onClose:n,children:[o.jsx(Dt,{title:i,onClose:n,className:"text-accent-primary"}),o.jsxs(Tt,{style:{maxHeight:Zs},className:"no-scrollbar mt-4 flex flex-col gap-6 overflow-y-auto text-accent-primary",children:[l&&o.jsx("div",{children:o.jsx(H,{variant:"body2",className:"text-accent-secondary",children:l})}),o.jsx("div",{children:o.jsx(Mt,{placeholder:"Search",value:a,onChange:m=>c(m.target.value),prefix:u,className:"w-full"})}),o.jsx(js,{data:d,columns:r,className:"w-full",wrapperClassName:"w-full",onRowSelect:m=>{m&&(s(m),n())}})]})]})};var mt=1e9,gl={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},rn,X=!0,ge="[DecimalError] ",Xe=ge+"Invalid argument: ",tn=ge+"Exponent out of range: ",pt=Math.floor,ze=Math.pow,bl=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,de,se=1e7,G=7,Gs=9007199254740991,sr=pt(Gs/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(de))throw Error(ge+"NaN");if(r.s<1)throw Error(ge+(r.s?"NaN":"-Infinity"));return r.eq(de)?new n(0):(X=!1,t=Le(Et(r,i),Et(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?Ks(t,e):Xs(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 Ys(this)};_.naturalLogarithm=_.ln=function(){return Et(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?Xs(t,e):Ks(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(Xe+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,l,a=this,c=a.constructor;if(a.s<1){if(!a.s)return new c(0);throw Error(ge+"NaN")}for(e=re(a),X=!1,s=Math.sqrt(+a),s==0||s==1/0?(t=Se(a.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=pt((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 c(t)):n=new c(s.toString()),r=c.precision,s=l=r+3;;)if(i=n,n=i.plus(Le(a,i,l+2)).times(.5),Se(i.d).slice(0,l)===(t=Se(n.d)).slice(0,l)){if(t=t.slice(l-3,l+1),s==l&&t=="4999"){if(Z(i,r+1,0),i.times(i).eq(a)){n=i;break}}else if(t!="9999")break;l+=4}return X=!0,Z(n,r)};_.times=_.mul=function(e){var t,r,n,s,i,l,a,c,f,u=this,d=u.constructor,m=u.d,v=(e=new d(e)).d;if(!u.s||!e.s)return new d(0);for(e.s*=u.s,r=u.e+e.e,c=m.length,f=v.length,c<f&&(i=m,m=v,v=i,l=c,c=f,f=l),i=[],l=c+f,n=l;n--;)i.push(0);for(n=f;--n>=0;){for(t=0,s=c+n;s>n;)a=i[s]+v[n]*m[s-n-1]+t,i[s--]=a%se|0,t=a/se|0;i[s]=(i[s]+t)%se|0}for(;!i[--l];)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,mt),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=Qe(n,!0):(Oe(e,0,mt),t===void 0?t=s.rounding:Oe(t,0,8),n=Z(new s(n),e+1,t),r=Qe(n,!0,e+1)),r};_.toFixed=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?Qe(s):(Oe(e,0,mt),t===void 0?t=i.rounding:Oe(t,0,8),n=Z(new i(s),e+re(s)+1,t),r=Qe(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,l,a=this,c=a.constructor,f=12,u=+(e=new c(e));if(!e.s)return new c(de);if(a=new c(a),!a.s){if(e.s<1)throw Error(ge+"Infinity");return a}if(a.eq(de))return a;if(n=c.precision,e.eq(de))return Z(a,n);if(t=e.e,r=e.d.length-1,l=t>=r,i=a.s,l){if((r=u<0?-u:u)<=Gs){for(s=new c(de),t=Math.ceil(n/G+4),X=!1;r%2&&(s=s.times(a),In(s.d,t)),r=pt(r/2),r!==0;)a=a.times(a),In(a.d,t);return X=!0,e.s<0?new c(de).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(Et(a,n+f)),X=!0,s=Ys(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=Qe(s,r<=i.toExpNeg||r>=i.toExpPos)):(Oe(e,1,mt),t===void 0?t=i.rounding:Oe(t,0,8),s=Z(new i(s),e,t),r=re(s),n=Qe(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,mt),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 Qe(e,t<=r.toExpNeg||t>=r.toExpPos)};function Xs(e,t){var r,n,s,i,l,a,c,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(c=e.d,f=t.d,l=e.e,s=t.e,c=c.slice(),i=l-s,i){for(i<0?(n=c,i=-i,a=f.length):(n=f,s=l,a=c.length),l=Math.ceil(d/G),a=l>a?l+1:a+1,i>a&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(a=c.length,i=f.length,a-i<0&&(i=a,n=f,f=c,c=n),r=0;i;)r=(c[--i]=c[i]+f[i]+r)/se|0,c[i]%=se;for(r&&(c.unshift(r),++s),a=c.length;c[--a]==0;)c.pop();return t.d=c,t.e=s,X?Z(t,d):t}function Oe(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Xe+e)}function Se(e){var t,r,n,s=e.length-1,i="",l=e[0];if(s>0){for(i+=l,t=1;t<s;t++)n=e[t]+"",r=G-n.length,r&&(i+=Re(r)),i+=n;l=e[t],n=l+"",r=G-n.length,r&&(i+=Re(r))}else if(l===0)return"0";for(;l%10===0;)l/=10;return i+l}var Le=function(){function e(n,s){var i,l=0,a=n.length;for(n=n.slice();a--;)i=n[a]*s+l,n[a]=i%se|0,l=i/se|0;return l&&n.unshift(l),n}function t(n,s,i,l){var a,c;if(i!=l)c=i>l?1:-1;else for(a=c=0;a<i;a++)if(n[a]!=s[a]){c=n[a]>s[a]?1:-1;break}return c}function r(n,s,i){for(var l=0;i--;)n[i]-=l,l=n[i]<s[i]?1:0,n[i]=l*se+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,i,l){var a,c,f,u,d,m,v,j,g,y,V,w,L,S,k,O,T,B,R=n.constructor,$=n.s==s.s?1:-1,A=n.d,M=s.d;if(!n.s)return new R(n);if(!s.s)throw Error(ge+"Division by zero");for(c=n.e-s.e,T=M.length,k=A.length,v=new R($),j=v.d=[],f=0;M[f]==(A[f]||0);)++f;if(M[f]>(A[f]||0)&&--c,i==null?w=i=R.precision:l?w=i+(re(n)-re(s))+1:w=i,w<0)return new R(0);if(w=w/G+2|0,f=0,T==1)for(u=0,M=M[0],w++;(f<k||u)&&w--;f++)L=u*se+(A[f]||0),j[f]=L/M|0,u=L%M|0;else{for(u=se/(M[0]+1)|0,u>1&&(M=e(M,u),A=e(A,u),T=M.length,k=A.length),S=T,g=A.slice(0,T),y=g.length;y<T;)g[y++]=0;B=M.slice(),B.unshift(0),O=M[0],M[1]>=se/2&&++O;do u=0,a=t(M,g,T,y),a<0?(V=g[0],T!=y&&(V=V*se+(g[1]||0)),u=V/O|0,u>1?(u>=se&&(u=se-1),d=e(M,u),m=d.length,y=g.length,a=t(d,g,m,y),a==1&&(u--,r(d,T<m?B:M,m))):(u==0&&(a=u=1),d=M.slice()),m=d.length,m<y&&d.unshift(0),r(g,d,y),a==-1&&(y=g.length,a=t(M,g,T,y),a<1&&(u++,r(g,T<y?B:M,y))),y=g.length):a===0&&(u++,g=[0]),j[f++]=u,a&&g[0]?g[y++]=A[S]||0:(g=[A[S]],y=1);while((S++<k||g[0]!==void 0)&&w--)}return j[0]||j.shift(),v.e=c,Z(v,l?i+re(v)+1:i)}}();function Ys(e,t){var r,n,s,i,l,a,c=0,f=0,u=e.constructor,d=u.precision;if(re(e)>16)throw Error(tn+re(e));if(!e.s)return new u(de);for(X=!1,a=d,l=new u(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(n=Math.log(ze(2,f))/Math.LN10*2+5|0,a+=n,r=s=i=new u(de),u.precision=a;;){if(s=Z(s.times(e),a),r=r.times(++c),l=i.plus(Le(s,r,a)),Se(l.d).slice(0,a)===Se(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=l}}function re(e){for(var t=e.e*G,r=e.d[0];r>=10;r/=10)t++;return t}function gr(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 Re(e){for(var t="";e--;)t+="0";return t}function Et(e,t){var r,n,s,i,l,a,c,f,u,d=1,m=10,v=e,j=v.d,g=v.constructor,y=g.precision;if(v.s<1)throw Error(ge+(v.s?"NaN":"-Infinity"));if(v.eq(de))return new g(0);if(t==null?(X=!1,f=y):f=t,v.eq(10))return t==null&&(X=!0),gr(g,f);if(f+=m,g.precision=f,r=Se(j),n=r.charAt(0),i=re(v),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=Se(v.d),n=r.charAt(0),d++;i=re(v),n>1?(v=new g("0."+r),i++):v=new g(n+"."+r.slice(1))}else return c=gr(g,f+2,y).times(i+""),v=Et(new g(n+"."+r.slice(1)),f-m).plus(c),g.precision=y,t==null?(X=!0,Z(v,y)):v;for(a=l=v=Le(v.minus(de),v.plus(de),f),u=Z(v.times(v),f),s=3;;){if(l=Z(l.times(u),f),c=a.plus(Le(l,new g(s),f)),Se(c.d).slice(0,f)===Se(a.d).slice(0,f))return a=a.times(2),i!==0&&(a=a.plus(gr(g,f+2,y).times(i+""))),a=Le(a,new g(d),f),g.precision=y,t==null?(X=!0,Z(a,y)):a;a=c,s+=2}}function _n(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=pt(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>sr||e.e<-sr))throw Error(tn+r)}else e.s=0,e.e=0,e.d=[0];return e}function Z(e,t,r){var n,s,i,l,a,c,f,u,d=e.d;for(l=1,i=d[0];i>=10;i/=10)l++;if(n=t-l,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],l=1;i>=10;i/=10)l++;n%=G,s=n-G+l}if(r!==void 0&&(i=ze(10,l-s-1),a=f/i%10|0,c=t<0||d[u+1]!==void 0||f%i,c=r<4?(a||c)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||c||r==6&&(n>0?s>0?f/ze(10,l-s):0:d[u-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return c?(i=re(e),d.length=1,t=t-i-1,d[0]=ze(10,(G-t%G)%G),e.e=pt(-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=ze(10,G-n),d[u]=s>0?(f/ze(10,l-s)%ze(10,s)|0)*i:0),c)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>sr||e.e<-sr))throw Error(tn+re(e));return e}function Ks(e,t){var r,n,s,i,l,a,c,f,u,d,m=e.constructor,v=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),X?Z(t,v):t;if(c=e.d,d=t.d,n=t.e,f=e.e,c=c.slice(),l=f-n,l){for(u=l<0,u?(r=c,l=-l,a=d.length):(r=d,n=f,a=c.length),s=Math.max(Math.ceil(v/G),a)+2,l>s&&(l=s,r.length=1),r.reverse(),s=l;s--;)r.push(0);r.reverse()}else{for(s=c.length,a=d.length,u=s<a,u&&(a=s),s=0;s<a;s++)if(c[s]!=d[s]){u=c[s]<d[s];break}l=0}for(u&&(r=c,c=d,d=r,t.s=-t.s),a=c.length,s=d.length-a;s>0;--s)c[a++]=0;for(s=d.length;s>l;){if(c[--s]<d[s]){for(i=s;i&&c[--i]===0;)c[i]=se-1;--c[i],c[s]+=se}c[s]-=d[s]}for(;c[--a]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,X?Z(t,v):t):new m(0)}function Qe(e,t,r){var n,s=re(e),i=Se(e.d),l=i.length;return t?(r&&(n=r-l)>0?i=i.charAt(0)+"."+i.slice(1)+Re(n):l>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Re(-s-1)+i,r&&(n=r-l)>0&&(i+=Re(n))):s>=l?(i+=Re(s+1-l),r&&(n=r-s-1)>0&&(i=i+"."+Re(n))):((n=s+1)<l&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-l)>0&&(s+1===l&&(i+="."),i+=Re(n))),e.s<0?"-"+i:i}function In(e,t){if(e.length>t)return e.length=t,!0}function Qs(e){var t,r,n;function s(i){var l=this;if(!(l instanceof s))return new s(i);if(l.constructor=s,i instanceof s){l.s=i.s,l.e=i.e,l.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Xe+i);if(i>0)l.s=1;else if(i<0)i=-i,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(i===~~i&&i<1e7){l.e=0,l.d=[i];return}return _n(l,i.toString())}else if(typeof i!="string")throw Error(Xe+i);if(i.charCodeAt(0)===45?(i=i.slice(1),l.s=-1):l.s=1,bl.test(i))_n(l,i);else throw Error(Xe+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=Qs,s.config=s.set=yl,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 yl(e){if(!e||typeof e!="object")throw Error(ge+"Object expected");var t,r,n,s=["precision",1,mt,"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(pt(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(Xe+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Xe+r+": "+n);return this}var rn=Qs(gl);de=new rn(1);const wl={prefix:"$",precision:2,zeroDisplay:"-",format:{minimumFractionDigits:2,maximumFractionDigits:2}};function jl(e,t={}){const{prefix:r,precision:n,zeroDisplay:s,format:i}={...wl,...t};if(e===0)return s;const l=e.toLocaleString("en",i??{maximumFractionDigits:n});return`${r}${l}`}function ei(e,t,r){const n=e*t;return jl(n,r)}const Cl=(e,t,r)=>new rn(e).toDecimalPlaces(t,r).toNumber(),Nl=({fieldName:e,currencyIcon:t,currencyName:r,displayBalance:n,placeholder:s="Enter Amount",balanceDetails:i,prefix:l,min:a="0",step:c="any",autoFocus:f=!0,decimals:u})=>{const d=Xr({name:e,defaultValue:""}),{setValue:m}=rt(),v=parseFloat(d||"0"),j=ei(v,(i==null?void 0:i.price)??0,{zeroDisplay:"$0.00"}),g=w=>{let L=w.target.value;if(u!==void 0&&u>=0){const[S,k]=L.split(".",2);k!==void 0&&k.length>u?L=S+"."+k.slice(0,u):k!==void 0?L=S+"."+k:L.includes(".")&&(L=S)}m(e,L,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})},y=w=>{(w.key==="ArrowUp"||w.key==="ArrowDown")&&w.preventDefault()};let V;return i&&(V=`${Cl(Number(i.balance),i.decimals??en)} ${i.symbol}`,l&&(V=`${l}: ${V}`)),o.jsxs(o.Fragment,{children:[o.jsx(zs,{name:e,defaultValue:""}),o.jsx(ht,{className:"flex w-full flex-col content-center justify-between gap-4",children:o.jsx(fr,{amount:d,currencyIcon:t,currencyName:r,placeholder:s,displayBalance:n,balanceDetails:i,min:a,step:c,autoFocus:f,onChange:g,onKeyDown:y,amountUsd:j,subtitle:V})})]})};function Sl({items:e,onRemove:t,showChain:r=!0}){const n=p.useMemo(()=>e,[e]);return n.length===0?null:o.jsx("div",{className:"flex flex-col gap-8",children:n.map(({bsnId:s,bsnName:i,bsnLogoUrl:l,provider:a})=>o.jsx(Qr,{bsnId:s,bsnName:i,bsnLogoUrl:l,provider:a,onRemove:t,showChain:r},`${s}-${a.rank}`))})}function kl({max:e,items:t=[],actionText:r,onAdd:n,onRemove:s,showChain:i=!0}){const l=p.useMemo(()=>t.length,[t]);return o.jsx(ht,{children:o.jsxs("div",{className:"flex w-full flex-col gap-4",children:[o.jsx("div",{className:"flex flex-row",children:o.jsxs("div",{className:"flex w-full flex-row content-center items-center justify-between font-normal",children:[o.jsx("span",{className:"text-sm sm:text-base",children:r}),o.jsx(Es,{counter:l,max:e,onAdd:n})]})}),l>0&&o.jsx(Sl,{items:t,onRemove:s,showChain:i})]})})}function ft({title:e,children:t,className:r,hint:n}){return o.jsxs("div",{className:C.twMerge("flex flex-row items-center justify-between text-accent-primary",n&&"items-start",r),children:[o.jsx(H,{as:"div",variant:"body1",children:e}),n?o.jsxs("div",{className:"flex flex-col items-end",children:[o.jsx(H,{as:"div",className:"flex items-center gap-2",children:t}),o.jsx(H,{as:"div",variant:"body2",className:"text-accent-secondary",children:n})]}):o.jsx(H,{as:"div",className:"flex items-center gap-2",children:t})]})}function El(e){return Be({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 ti({value:e,onEdit:t,title:r="Network Fee Rate",className:n}){return o.jsxs(ft,{title:r,className:n,children:[o.jsxs("span",{children:[e," sats/vB"]}),t&&o.jsx(ue,{size:"small",variant:"outlined",className:"h-6 w-6 pl-1 text-secondary-strokeDark",onClick:t,children:o.jsx(El,{size:16,className:"text-secondary-strokeDark"})})]})}function ri({amount:e,coinSymbol:t,hint:r,title:n,className:s,decimals:i=en}){let l;return typeof e=="number"?e===0?l="0":l=e.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):l=e,o.jsxs(ft,{title:n??`${t} Network Fee`,hint:r,className:s,children:[l," ",t]})}function ni({amount:e,coinSymbol:t,hint:r,title:n,className:s,decimals:i=ml}){const l=typeof e=="number"?e.toFixed(i):e;return o.jsxs(ft,{title:n??`${t} Network Fee`,hint:r,className:s,children:[l," ",t]})}function si({total:e,coinSymbol:t,hint:r,title:n="Total",className:s,decimals:i=en}){let l;return typeof e=="number"?e===0?l="0":l=e.toFixed(i).replace(/0+$/,"").replace(/\.$/,""):l=e,o.jsxs("div",{className:C.twMerge("flex flex-row items-start justify-between text-accent-primary",s),children:[o.jsx(H,{variant:"body1",className:"font-bold",children:n}),o.jsxs("div",{className:"flex flex-col items-end justify-center",children:[o.jsxs(H,{variant:"body1",className:"font-bold",children:[l," ",t]}),r&&o.jsx(H,{variant:"body1",className:"text-sm text-accent-secondary",children:r})]})]})}function Ol({className:e,feeRate:t,onFeeRateEdit:r,feeAmount:n,coinSymbol:s,feeAmountHint:i,total:l,totalHint:a,bbnFeeAmount:c,bbnCoinSymbol:f,bbnFeeAmountHint:u,bbnFeeDecimals:d}){return o.jsx(ht,{className:C.twMerge("flex w-full flex-col content-center justify-between gap-4",e),children:o.jsxs("div",{className:"flex flex-col gap-6 p-4",children:[t!==void 0&&o.jsx(ti,{value:t,onEdit:r}),n!==void 0&&s!==void 0&&o.jsx(ri,{amount:n,coinSymbol:s,hint:i}),c!==void 0&&f?o.jsx(ni,{amount:c,coinSymbol:f,hint:u,decimals:d}):null,l!==void 0&&s!==void 0&&o.jsx("div",{className:"divider my-4"}),l!==void 0&&s!==void 0&&o.jsx(si,{total:l,coinSymbol:s,hint:a})]})})}const Al=({data:e})=>{if(!e||e.length===0)return null;const t=e[0],r=e.slice(1),s={gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`};return o.jsx(Cs,{className:"p-6 pt-4",children:o.jsxs("div",{className:"flex flex-col",children:[o.jsx("div",{className:"items-center gap-4 pb-4 grid",style:s,children:t.map((i,l)=>o.jsx(H,{variant:"caption",className:"text-secondary px-2.5",children:i},`header-${l}`))}),r.map((i,l)=>o.jsx("div",{className:"items-center gap-4 rounded bg-primary-contrast p-1 grid",style:s,children:i.map((a,c)=>o.jsx("div",{className:"flex w-full items-center gap-2 py-1 px-2.5",children:a},`cell-${l}-${c}`))},`row-${l}`))]})})};function Fl({className:e,...t}){const n=tt(hr)?et:Vt;return o.jsx(n,{...t,className:C.twMerge("w-[41.25rem] max-w-full",e)})}const Ml=({open:e,processing:t=!1,onClose:r,onProceed:n,bsns:s,finalityProviders:i,details:l,visibleFields:a,attentionText:c,proceedLabel:f="Proceed to Signing"})=>{const u=[{label:"Stake Amount",value:l.stakeAmount},{label:"Fee Rate",value:l.feeRate},{label:"Transaction Fees",value:l.transactionFees},{label:"Term",value:o.jsxs(o.Fragment,{children:[l.term.blocks,o.jsx("br",{}),o.jsx("span",{className:"text-md text-secondary",children:l.term.duration})]})},{label:"Unbonding",value:l.unbonding},{label:"Unbonding Fee",value:l.unbondingFee}],d=a&&a.length>0?u.filter(j=>a.includes(j.label)):u,v=!i||i.length===0?[["Validator"],...s.map((j,g)=>[o.jsxs("div",{className:"flex w-full items-center gap-2 py-1",children:[j.icon,o.jsx(H,{variant:"body2",className:"font-medium",children:j.name})]},`validator-${g}`)])]:[["BSNs","Finality Provider"],...s.map((j,g)=>{const y=i[g];return[o.jsxs("div",{className:"flex w-full items-center gap-2 py-1",children:[j.icon,o.jsx(H,{variant:"body2",className:"font-medium",children:j.name})]},`bsn-${g}`),y?o.jsxs("div",{className:"flex w-full items-center gap-2 py-1",children:[y.icon,o.jsx(H,{variant:"body2",className:"font-medium",children:y.name})]},`fp-${g}`):o.jsx("div",{},`fp-${g}`)]})];return o.jsxs(Fl,{open:e,onClose:r,children:[o.jsx(Dt,{title:"Preview",onClose:r,className:"text-accent-primary"}),o.jsxs(Tt,{className:"no-scrollbar mb-8 mt-4 flex max-h-[calc(100vh-12rem)] flex-col gap-4 overflow-y-auto text-accent-primary",children:[o.jsx(Al,{data:v}),o.jsx("div",{className:"flex flex-col",children:d.map((j,g)=>o.jsxs("div",{className:"flex flex-row items-center justify-between py-3",children:[o.jsx(H,{variant:"body1",className:"text-secondary font-normal",children:j.label}),o.jsx(H,{variant:"body1",className:"text-right font-normal",children:j.value})]},g))}),o.jsx("div",{className:"border-divider w-full border-t"}),o.jsxs("div",{className:"pt-2",children:[o.jsx(ir,{variant:"h6",className:"text-primary mb-2",children:"Attention!"}),c?o.jsx(H,{variant:"body2",className:"text-secondary",children:c}):o.jsxs(o.Fragment,{children:[o.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."}),o.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."})]})]})]}),o.jsxs(ur,{className:"flex flex-col gap-4 pb-8 pt-0 sm:flex-row",children:[o.jsx(ue,{variant:"contained",color:"primary",onClick:n,className:"w-full sm:flex-1 sm:order-2",disabled:t,children:t?"Processing...":f}),o.jsx(ue,{variant:"outlined",color:"primary",onClick:r,className:"w-full sm:flex-1 sm:order-1",children:"Cancel"})]})]})};function ii({actions:e}){return o.jsx("div",{className:"mt-4 sm:mt-6 flex gap-2",children:e.map((t,r)=>o.jsx(ue,{variant:t.variant||"outlined",className:`sm:bbn-btn-medium flex-1 ${t.className||""}`,onClick:t.onClick,fluid:!0,children:t.label},`${t.label}-${r}`))})}function oi({formattedAmount:e,icon:t,iconAlt:r,chainName:n,chainIcon:s,chainIconAlt:i}){return o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[t&&(typeof t=="string"?o.jsx("img",{src:t,alt:r||"icon",className:"w-6 h-6 sm:w-8 sm:h-8"}):t),o.jsx("span",{className:"text-base sm:text-lg font-medium text-accent-primary",children:e})]}),n&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-base sm:text-lg font-medium text-accent-primary",children:n}),s&&(typeof s=="string"?o.jsx("img",{src:s,alt:i||"chain icon",className:"w-6 h-6 sm:w-8 sm:h-8"}):s)]})]})}function ai({item:e,className:t}){return o.jsxs("div",{className:C.twMerge("flex items-center gap-2 min-w-0",t),children:[o.jsx("span",{className:"text-xs sm:text-sm text-accent-primary font-medium truncate flex items-center",children:e.name}),e.icon&&o.jsx("div",{className:"flex items-center w-4 h-4 flex-shrink-0 justify-center text-xs sm:text-sm",children:typeof e.icon=="string"?o.jsx("img",{src:e.icon,alt:e.iconAlt||e.name,className:"w-full h-full rounded-full object-cover"}):e.icon})]})}function jr({label:e,value:t,collapsible:r=!1,nestedDetails:n}){const[s,i]=p.useState(!1),l=()=>{i(!s)};return r?o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 min-w-0 overflow-x-auto",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[o.jsx("span",{className:"text-xs sm:text-sm text-accent-secondary",children:e}),o.jsx("button",{onClick:l,className:"w-5 h-5 flex-shrink-0 hover:opacity-70 transition-opacity","aria-label":s?"Collapse":"Expand",children:s?o.jsx(ds,{size:20,variant:"secondary"}):o.jsx(hs,{size:20,variant:"secondary"})})]}),o.jsx("span",{className:"text-xs sm:text-sm text-accent-primary font-medium text-right min-w-0 overflow-x-auto whitespace-nowrap",children:t})]}),s&&n&&o.jsx("div",{className:"bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto",children:n.map((a,c)=>o.jsx(jr,{label:a.label,value:a.value,collapsible:a.collapsible,nestedDetails:a.nestedDetails},c))})]}):o.jsxs("div",{className:"flex items-center justify-between gap-2 min-w-0 overflow-x-auto",children:[o.jsx("span",{className:"text-xs sm:text-sm text-accent-secondary flex-shrink-0",children:e}),o.jsx("span",{className:"text-xs sm:text-sm text-accent-primary font-medium text-right min-w-0 overflow-x-auto whitespace-nowrap",children:t})]})}function li({details:e,optionalDetails:t,listItems:r}){const n=t&&t.length>0,s=r&&r.length>0;return o.jsxs("div",{className:"space-y-3 sm:space-y-4 overflow-x-auto",children:[o.jsx("div",{className:"space-y-4 sm:space-y-6",children:e.map((i,l)=>o.jsx(jr,{label:i.label,value:i.value,collapsible:i.collapsible,nestedDetails:i.nestedDetails},l))}),s&&o.jsx("div",{className:"space-y-3 sm:space-y-4",children:r.map((i,l)=>o.jsx("div",{className:"bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto",children:o.jsxs("div",{className:"flex justify-between items-start gap-2",children:[o.jsx("span",{className:"text-xs sm:text-sm text-accent-secondary",children:i.label}),o.jsx("div",{className:"flex flex-wrap gap-2",children:i.items.map((a,c)=>o.jsx(ai,{item:a},a.id||c))})]})},l))}),n&&o.jsx("div",{className:"bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto",children:t.map((i,l)=>o.jsx(jr,{label:i.label,value:i.value,collapsible:i.collapsible,nestedDetails:i.nestedDetails},l))})]})}function Ll({data:e,className:t}){return o.jsxs("div",{className:`w-full bg-secondary-highlight p-3 sm:p-4 rounded flex flex-col justify-between ${t||""}`,children:[o.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[o.jsx(oi,{formattedAmount:e.formattedAmount,icon:e.icon,iconAlt:e.iconAlt,chainName:e.chainName,chainIcon:e.chainIcon,chainIconAlt:e.chainIconAlt}),o.jsx(li,{details:e.details,optionalDetails:e.optionalDetails,listItems:e.listItems}),e.secondaryActions&&e.secondaryActions.length>0&&o.jsx(ii,{actions:e.secondaryActions})]}),e.primaryAction&&o.jsx(ue,{variant:"outlined",className:`mt-4 ${e.primaryAction.className||""}`,onClick:e.primaryAction.onClick,fluid:e.primaryAction.fullWidth!==!1,children:e.primaryAction.label})]})}function Vl({className:e,...t}){const n=tt(hr)?et:Vt;return o.jsx(n,{...t,className:C.twMerge("w-[41.25rem] max-w-full",e)})}const Dl=({open:e,processing:t=!1,title:r,onClose:n,onProceed:s,tokens:i,transactionFees:l})=>o.jsxs(Vl,{open:e,onClose:n,children:[o.jsx(Dt,{title:r,className:"text-accent-primary"}),o.jsx(Tt,{className:"no-scrollbar mb-[40px] mt-8 flex max-h-[calc(100vh-12rem)] flex-col overflow-y-auto text-accent-primary",children:o.jsxs("div",{className:"flex flex-col",children:[o.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:i.map((a,c)=>{var f,u;return o.jsxs("div",{children:[o.jsx(ft,{title:a.name,hint:(f=a.amount)==null?void 0:f.usd,children:o.jsxs("div",{className:"flex items-center gap-2",children:[a.icon,(u=a.amount)==null?void 0:u.token]})}),c<i.length-1&&o.jsx("div",{className:"h-4"})]},`token-${c}`)})}),o.jsx("div",{className:"pt-6 pb-6",children:o.jsx("div",{className:"border-divider w-full border-t"})}),o.jsx(ft,{title:"Transaction Fees",hint:l.usd,children:l.token})]})}),o.jsxs(ur,{className:"flex flex-col gap-4 pt-0 sm:flex-row",children:[o.jsx(ue,{variant:"contained",color:"primary",onClick:s,className:"w-full sm:flex-1 sm:order-2",disabled:t,children:t?"Processing...":"Proceed"}),o.jsx(ue,{variant:"outlined",color:"primary",onClick:n,className:"w-full sm:flex-1 sm:order-1",children:"Cancel"})]})]}),Tl=({rewards:e,onClick:t,disabled:r})=>o.jsxs(ht,{className:"flex w-full flex-col content-center justify-between gap-4",children:[e.map((n,s)=>{var a;const i=parseFloat(String(n.amount)),l=ei(i,((a=n.balanceDetails)==null?void 0:a.price)??0,{zeroDisplay:"$0.00"});return o.jsx(fr,{amount:n.amount,currencyIcon:n.currencyIcon,currencyName:n.currencyName,placeholder:n.placeholder??"Enter Amount",displayBalance:n.displayBalance,balanceDetails:n.balanceDetails,min:n.min??"0",step:n.step??"any",autoFocus:!1,onChange:()=>{},onKeyDown:()=>{},amountUsd:l,disabled:!0,subtitle:n.chainName},s)}),o.jsx(ue,{onClick:t,disabled:r,children:"Claim"})]}),_l=({size:e="md"})=>{const t={sm:"mt-2",md:"mt-4",lg:"mt-6"};return o.jsx("div",{className:t[e]})},Il=()=>o.jsx("svg",{width:"29",height:"28",viewBox:"0 0 29 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.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"})}),ci=()=>o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),ui=({children:e,className:t=""})=>o.jsx(H,{variant:"body1",className:C.twJoin("px-7 pb-6 text-accent-primary md:hidden",t),children:e}),fi=({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 o.jsx("div",{className:C.twJoin(s(),r),children:n})},dt=({children:e})=>o.jsx(o.Fragment,{children:e}),nn=({icon:e,suffix:t,onClick:r,disabled:n=!1,selected:s=!1,className:i="",toggle:l,children:a})=>{const c=p.Children.toArray(a),f=c.find(v=>typeof v=="string"||p.isValidElement(v)&&v.type!==dt),u=c.find(v=>p.isValidElement(v)&&v.type===dt),d=typeof f=="string"?f:"",m=r&&!l?o.jsx(ci,{}):void 0;return o.jsx(As,{icon:e,name:d,description:u?u.props.children:void 0,onClick:r,disabled:n,selected:s,className:i,suffix:t||m,toggle:l})},di=({icon:e,className:t="",children:r})=>{const n=p.Children.toArray(r),s=n.find(c=>typeof c=="string"||p.isValidElement(c)&&c.type!==dt),i=n.find(c=>p.isValidElement(c)&&c.type===dt),l=n.filter(c=>p.isValidElement(c)&&c.type===nn),a=typeof s=="string"?s:"";return o.jsx(Fs,{icon:e,name:a,description:i?i.props.children:void 0,className:t,suffix:o.jsx(ci,{}),children:l})},hi=({children:e,className:t=""})=>o.jsx("div",{className:t,children:e}),Rl=({trigger:e,open:t,onOpenChange:r,placement:n="bottom-end",className:s,offset:i=[0,8],children:l})=>{const a=o.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:o.jsx(Il,{})});return o.jsx(Hr,{trigger:e||a,open:t,onOpenChange:r,placement:n,className:C.twJoin("relative",s),offset:i,mobileMode:"drawer",children:l})},$e=Rl;$e.Title=ui;$e.Group=fi;$e.Item=nn;$e.SubMenu=di;$e.Description=dt;$e.CustomContent=hi;$e.Spacer=_l;const Cr=({walletType:e,walletName:t,walletIcon:r,address:n,isCopied:s,onCopy:i,className:l})=>o.jsx("div",{className:C.twJoin("bg-[#F9F9F9] dark:bg-[#2F2F2F] rounded-[4px] p-3 flex-1 md:p-4",l),children:o.jsxs("div",{className:"flex flex-col w-full",children:[o.jsx("div",{className:"flex justify-start mb-2 md:mb-3",children:o.jsx(ot,{alt:t||e,url:r||"",size:"large",className:"w-8 h-8 md:w-10 md:h-10"})}),o.jsx("div",{className:"flex justify-start mb-[1px]",children:o.jsxs(H,{variant:"body1",className:"text-accent-secondary font-medium !text-xs",children:[e," Wallet"]})}),o.jsxs("div",{className:"flex items-center justify-between w-full",children:[o.jsx("div",{className:"flex-1 min-w-0",children:s?o.jsx(H,{className:"text-accent-primary !text-sm truncate whitespace-nowrap",children:"Copied ✓"}):o.jsx(Wr,{className:"text-accent-primary !text-sm",value:n,symbols:6})}),o.jsx("button",{onClick:i,className:"flex-shrink-0 ml-3 p-1 rounded hover:bg-[#d7e1e7] dark:hover:bg-[#252525] transition-colors h-6 w-6 flex items-center justify-center hover:opacity-80",children:o.jsx(cr,{size:14,className:"md:w-4 md:h-4"})})]})]})}),mi=({value:e,onChange:t,className:r="",disabled:n=!1})=>{const s=()=>{n||t(!e)};return o.jsx("button",{type:"button",onClick:s,disabled:n,className:C.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:o.jsx("span",{className:C.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]")})})},Nr=({icon:e,title:t,status:r,value:n,onChange:s,className:i})=>o.jsxs("div",{className:C.twJoin("flex items-center justify-between w-full p-3 md:p-0 md:mb-0",i),children:[o.jsxs("div",{className:"flex items-center gap-4",children:[e,o.jsxs("div",{className:"flex flex-col",children:[o.jsx(H,{variant:"body2",className:"text-accent-primary font-medium",children:t}),o.jsx(H,{className:"text-accent-secondary !text-xs",children:r})]})]}),o.jsx(mi,{value:n,onChange:s})]}),pi=({title:e,value:t,isCopied:r,onCopy:n,className:s,icon:i})=>o.jsx("div",{className:C.twJoin("flex items-center justify-between w-full p-3 md:p-0 md:mb-0",s),children:o.jsx("div",{className:"flex flex-col w-full",children:o.jsxs("div",{className:"flex items-center gap-4",children:[i&&o.jsx("div",{className:"flex-shrink-0",children:i}),o.jsxs("div",{className:"flex w-full",children:[o.jsxs("div",{className:"flex flex-col w-full",children:[o.jsx(H,{variant:"body2",className:"text-accent-primary font-medium text-xs",children:e}),o.jsx("div",{className:"flex items-center justify-between w-full",children:o.jsx("div",{className:"flex-1 min-w-0",children:r?o.jsx(H,{className:"text-accent-secondary !text-xs truncate whitespace-nowrap",children:"Copied ✓"}):o.jsx(Wr,{className:"text-accent-secondary !text-xs",value:t,symbols:6})})})]}),o.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:o.jsx(cr,{size:16})})]})]})})}),Bl=({trigger:e,btcAddress:t,bbnAddress:r,selectedWallets:n,ordinalsExcluded:s,linkedDelegationsVisibility:i,onIncludeOrdinals:l,onExcludeOrdinals:a,onDisplayLinkedDelegations:c,publicKeyNoCoord:f,onDisconnect:u,forceOpen:d=!1,onOpenChange:m,className:v,mobileMode:j="dialog",copy:g})=>{var B,R,$,A;const{copyToClipboard:y,isCopied:V}=Br({timeout:g==null?void 0:g.timeout}),w=(g==null?void 0:g.isCopied)??V,L=(g==null?void 0:g.copyToClipboard)??y,[S,k]=p.useState(d),O=p.useCallback(M=>{k(M),m==null||m(M)},[m]),T=p.useCallback(()=>{k(!1),u()},[u]);return o.jsx(Hr,{trigger:e,open:S,onOpenChange:O,mobileMode:j,className:C.twJoin("shadow-lg border border-[#38708533] bg-[#FFFFFF] dark:bg-[#252525] dark:border-[#404040] rounded-lg",v),children:o.jsxs("div",{className:"p-4 space-y-6 w-full text-primary-main",children:[o.jsxs("div",{className:"flex flex-row gap-2 w-full md:flex-col overflow-x-auto",children:[o.jsx(Cr,{walletType:"Bitcoin",walletName:(B=n.BTC)==null?void 0:B.name,walletIcon:(R=n.BTC)==null?void 0:R.icon,address:t,isCopied:w("btc"),onCopy:()=>L("btc",t)}),o.jsx(Cr,{walletType:"Babylon",walletName:($=n.BBN)==null?void 0:$.name,walletIcon:(A=n.BBN)==null?void 0:A.icon,address:r,isCopied:w("bbn"),onCopy:()=>L("bbn",r)})]}),o.jsxs("div",{className:"flex flex-col w-full bg-[#F9F9F9] dark:bg-[#2F2F2F] rounded-lg md:bg-transparent md:dark:bg-transparent md:border-none md:gap-8",children:[o.jsx(Nr,{icon:o.jsx(us,{}),title:"Using Inscriptions",status:s?"Off":"On",value:!s,onChange:M=>M?l():a()}),o.jsx(Nr,{icon:o.jsx(cs,{}),title:"Linked Wallet Stakes",status:i?"On":"Off",value:i,onChange:c}),o.jsx(pi,{title:"Bitcoin Public Key",value:f,isCopied:w("publicKey"),onCopy:()=>L("publicKey",f),icon:o.jsx(ls,{}),className:"rounded-b-lg rounded-t-none md:rounded-none"})]}),o.jsx("div",{className:"pt-2",children:o.jsx(Er,{onClick:T,fluid:!0,children:"Disconnect Wallets"})})]})})};function Pl({className:e,...t}){const n=tt(hr)?et:Vt;return o.jsx(n,{...t,className:C.twMerge("w-[41.25rem] max-w-full",e)})}const $l=({open:e,onClose:t,title:r="Unbonding",description:n,reward:s,amountUsd:i="",onChange:l=()=>{},onKeyDown:a=()=>{},disabled:c=!1,warningText:f,actionButtonText:u="Unbond",onActionClick:d})=>o.jsxs(Pl,{open:e,onClose:t,children:[o.jsx(Dt,{title:r,onClose:t,className:"text-accent-primary"}),o.jsxs(Tt,{style:{maxHeight:Zs},className:"no-scrollbar mt-4 flex flex-col gap-6 overflow-y-auto text-accent-primary",children:[n&&o.jsx("div",{children:o.jsx(H,{variant:"body2",className:"text-accent-secondary whitespace-pre-line",children:n})}),o.jsx(ht,{className:"flex w-full flex-col content-center justify-between gap-4",children:o.jsx(fr,{amount:s.amount,currencyIcon:s.currencyIcon,currencyName:s.currencyName,placeholder:s.placeholder??"Enter Amount",displayBalance:s.displayBalance,balanceDetails:s.balanceDetails,min:s.min??"0",step:s.step??"any",autoFocus:!1,onChange:l,onKeyDown:a,amountUsd:i,disabled:c,subtitle:`Staked: ${s.stakedAmount||0} ${s.stakedTokenName||s.currencyName}`})}),f&&o.jsx(Ls,{children:f})]}),u&&o.jsx(ur,{className:"flex justify-end mt-[80px]",children:o.jsx(ue,{onClick:d,children:u})})]}),Hl={adaptive:"adaptive",horizontal:"vertical",vertical:"horizontal"};function Wl({className:e,orientation:t="vertical",children:r}){return o.jsx("div",{className:C.twMerge("bbn-list-legacy",`bbn-list-legacy-${t}`,e),children:p.Children.map(r,n=>p.isValidElement(n)?p.cloneElement(n,{orientation:Hl[t]}):n)})}function Jl({className:e,orientation:t="horizontal",title:r,value:n,suffix:s}){return o.jsxs("div",{className:C.twJoin("bbn-list-item-legacy",`bbn-list-item-legacy-${t}`,e),children:[o.jsx(H,{as:"div",className:C.twJoin("bbn-list-title-legacy",`bbn-list-title-legacy-${t}`),variant:t==="horizontal"?"body1":"body2",children:r}),o.jsxs(H,{as:"div",className:C.twJoin("bbn-list-value-legacy",`bbn-list-value-legacy-${t}`),variant:"body1",children:[n,s]})]})}exports.Accordion=yi;exports.AccordionDetails=Ci;exports.AccordionSummary=wi;exports.ActivityCard=Ll;exports.ActivityCardActionSection=ii;exports.ActivityCardAmountSection=oi;exports.ActivityCardDetailsSection=li;exports.ActivityListItem=ai;exports.AmountItem=fr;exports.AmountSubsection=Nl;exports.Avatar=ot;exports.AvatarGroup=Ni;exports.BBNFeeAmount=ni;exports.BTCFeeAmount=ri;exports.BTCFeeRate=ti;exports.Badge=Va;exports.BitcoinPublicKeyIcon=ls;exports.BugReportIcon=ia;exports.Button=ue;exports.Card=Cs;exports.Cell=ws;exports.Checkbox=$n;exports.CheckboxField=cl;exports.ChevronLeftIcon=sa;exports.Chip=aa;exports.CloseIcon=Rr;exports.CollapseIcon=ds;exports.Column=bs;exports.Copy=Ms;exports.CopyIcon=cr;exports.CoreUIProvider=ea;exports.CounterButton=Es;exports.Dialog=Vt;exports.DialogBody=Tt;exports.DialogFooter=ur;exports.DialogHeader=Dt;exports.DisplayHash=Wr;exports.FeeItem=ft;exports.FeesSection=Ol;exports.FinalityProviderItem=Qr;exports.FinalityProviderLogo=qs;exports.FinalityProviderSubsection=kl;exports.Form=sl;exports.FormControl=Lt;exports.Heading=ir;exports.HiddenField=zs;exports.IconButton=kr;exports.Input=Mt;exports.LinkWalletIcon=cs;exports.List=Fa;exports.ListItem=Ss;exports.ListItemLegacy=Jl;exports.ListLegacy=Wl;exports.Loader=la;exports.Menu=Hr;exports.MenuDrawer=$r;exports.MenuItem=As;exports.MobileDialog=et;exports.NumberField=al;exports.OpenIcon=hs;exports.Popover=ar;exports.Portal=Ft;exports.PreviewModal=Ml;exports.Radio=Hn;exports.RadioField=ul;exports.RewardsPreviewModal=Dl;exports.RewardsSubsection=Tl;exports.ScrollLocker=na;exports.Select=_r;exports.SelectField=fl;exports.SettingMenu=$e;exports.SettingMenuCustomContent=hi;exports.SettingMenuDescription=dt;exports.SettingMenuGroup=fi;exports.SettingMenuItem=nn;exports.SettingMenuSubMenu=di;exports.SettingMenuTitle=ui;exports.StatItem=La;exports.SubMenu=Fs;exports.SubMenuItem=Ta;exports.SubSection=ht;exports.Table=js;exports.TableElement=hl;exports.Text=H;exports.TextField=ll;exports.ThemeIcon=oa;exports.ThemedIcon=lr;exports.Toggle=Ns;exports.Total=si;exports.UnbondingModal=$l;exports.UsingInscriptionIcon=us;exports.ValidatorAvatar=Si;exports.ValidatorSelector=xl;exports.WalletDisconnectButton=Er;exports.WalletInfoCard=Cr;exports.WalletInfoSection=pi;exports.WalletMenu=Bl;exports.WalletSettingItem=Nr;exports.WalletToggle=mi;exports.Warning=Ls;exports.WarningIcon=fs;exports.iconColorVariants=De;exports.useClickOutside=ss;exports.useControlledState=Ye;exports.useCopy=Br;exports.useCoreUI=rs;exports.useDrawerAnimation=ks;exports.useField=nt;exports.useFieldState=il;exports.useFormContext=rt;exports.useFormState=Gr;exports.useFrozenColumns=xs;exports.useIsMobile=tt;exports.useMemoizedArray=ns;exports.useMenuContext=Pr;exports.useModalManager=Ir;exports.useResizeObserver=is;exports.useTableScroll=vs;exports.useTableSort=ys;exports.useWatch=Xr;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|