@gearbox-protocol/permissionless-ui 1.26.5 → 1.26.7

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),m=require("react"),p=require("@fortawesome/free-solid-svg-icons"),f=require("../icons/fa-icon.cjs");require("@gearbox-protocol/sdk");const s=require("../../utils/cn.cjs");require("sonner");require("luxon");require("../../utils/z-index.cjs");function d(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const b=d(m),i=b.forwardRef(({className:r,children:t,checked:e,onCheckedChange:n,disabled:c,...a},l)=>o.jsxs("label",{ref:l,className:s.cn("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors","hover:bg-secondary",c&&"pointer-events-none opacity-50",r),...a,children:[o.jsx("input",{type:"checkbox",checked:e,onChange:u=>n?.(u.target.checked),disabled:c,className:"sr-only"}),o.jsx("span",{className:s.cn("absolute left-2 flex h-4 w-4 items-center justify-center rounded-[4px] border border-primary shadow transition-colors",e&&"bg-primary text-primary-foreground"),children:e&&o.jsx(f.FaIcon,{icon:p.faCheck,className:"size-4"})}),t]}));i.displayName="CheckboxItem";exports.CheckboxItem=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),m=require("react"),p=require("@fortawesome/free-solid-svg-icons"),f=require("../icons/fa-icon.cjs");require("@gearbox-protocol/sdk");const s=require("../../utils/cn.cjs");require("sonner");require("luxon");require("../../utils/z-index.cjs");function d(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const b=d(m),i=b.forwardRef(({className:r,children:t,checked:e,onCheckedChange:n,disabled:c,...a},l)=>o.jsxs("label",{ref:l,className:s.cn("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors","hover:bg-secondary",c&&"pointer-events-none opacity-50",r),...a,children:[o.jsx("input",{type:"checkbox",checked:e,onChange:u=>n?.(u.target.checked),disabled:c,className:"sr-only"}),o.jsx("span",{className:s.cn("absolute left-2 flex h-4 w-4 items-center justify-center rounded-[4px] border border-primary shadow transition-colors",e&&"bg-primary text-primary-foreground"),children:e&&o.jsx(f.FaIcon,{icon:p.faCheck,className:"size-3!"})}),t]}));i.displayName="CheckboxItem";exports.CheckboxItem=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("@radix-ui/react-dropdown-menu"),f=require("react"),m=require("@fortawesome/free-solid-svg-icons"),p=require("../icons/fa-icon.cjs");require("@gearbox-protocol/sdk");const b=require("../../utils/cn.cjs");require("sonner");require("luxon");require("../../utils/z-index.cjs");function s(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const c=s(d),x=s(f),i=x.forwardRef(({className:e,children:o,checked:t,onCheckedChange:n,disabled:a,...u},l)=>r.jsxs(c.CheckboxItem,{ref:l,className:b.cn("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors hover:text-foreground hover:bg-secondary focus-visible:outline-none focus:bg-secondary focus:text-foreground data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:t,onCheckedChange:n,disabled:a,...u,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(c.ItemIndicator,{children:r.jsx(p.FaIcon,{icon:m.faCheck,className:"size-4"})})}),o]}));i.displayName=c.CheckboxItem.displayName;exports.DropdownMenuCheckboxItem=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("@radix-ui/react-dropdown-menu"),f=require("react"),m=require("@fortawesome/free-solid-svg-icons"),p=require("../icons/fa-icon.cjs");require("@gearbox-protocol/sdk");const b=require("../../utils/cn.cjs");require("sonner");require("luxon");require("../../utils/z-index.cjs");function s(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const c=s(d),x=s(f),i=x.forwardRef(({className:e,children:o,checked:t,onCheckedChange:n,disabled:a,...u},l)=>r.jsxs(c.CheckboxItem,{ref:l,className:b.cn("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors hover:text-foreground hover:bg-secondary focus-visible:outline-none focus:bg-secondary focus:text-foreground data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:t,onCheckedChange:n,disabled:a,...u,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(c.ItemIndicator,{children:r.jsx(p.FaIcon,{icon:m.faCheck,className:"size-3!"})})}),o]}));i.displayName=c.CheckboxItem.displayName;exports.DropdownMenuCheckboxItem=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),c=require("@radix-ui/react-dropdown-menu"),u=require("react");require("@gearbox-protocol/sdk");const d=require("../../utils/cn.cjs");require("sonner");require("luxon");require("../../utils/z-index.cjs");function n(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const i=n(c),l=n(u),s=l.forwardRef(({className:e,inset:r,...t},o)=>a.jsx(i.Item,{ref:o,className:d.cn("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:text-foreground hover:bg-secondary focus-visible:outline-none focus:bg-secondary focus:text-foreground data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",r&&"pl-8",e),...t}));s.displayName=i.Item.displayName;exports.DropdownMenuItem=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),c=require("@radix-ui/react-dropdown-menu"),u=require("react");require("@gearbox-protocol/sdk");const d=require("../../utils/cn.cjs");require("sonner");require("luxon");require("../../utils/z-index.cjs");function n(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const i=n(c),l=n(u),s=l.forwardRef(({className:e,inset:r,...t},o)=>a.jsx(i.Item,{ref:o,className:d.cn("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:text-foreground hover:bg-secondary focus-visible:outline-none focus:bg-secondary focus:text-foreground data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-3! [&>svg]:shrink-0",r&&"pl-8",e),...t}));s.displayName=i.Item.displayName;exports.DropdownMenuItem=s;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),G=require("react");require("../buttons/back-button/back-button.cjs");const _=require("../buttons/button/button.cjs");require("../buttons/copy-button/copy-button.cjs");require("../buttons/external-button/external-button.cjs");require("../buttons/filter-button/filter-button.cjs");require("../buttons/navigation-button/navigation-button.cjs");require("@gearbox-protocol/sdk");const D=require("../../utils/cn.cjs");require("sonner");const j=require("../../utils/react.cjs");require("luxon");require("../../utils/z-index.cjs");require("../buttons/tab-button/tab-button.cjs");const A=require("../checkbox-item/checkbox-item.cjs");require("../modal/modal.cjs");const J=require("../dialog/dialog.cjs");require("../dialog/dialog-container.cjs");const K=require("../dialog/dialog-content.cjs");require("../dialog/dialog-description.cjs");const U=require("../dialog/dialog-footer.cjs"),W=require("../dialog/dialog-header.cjs"),X=require("../dialog/dialog-title.cjs");require("../dialog/dialog-modal-container.cjs");require("../dialog/dialog-overlay.cjs");require("viem");require("../input/input.cjs");require("../label/label.cjs");const Y=require("../search-line/search-line.cjs"),y=require("../tabs/tabs.cjs");function Z(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const l in s)if(l!=="default"){const p=Object.getOwnPropertyDescriptor(s,l);Object.defineProperty(t,l,p.get?p:{enumerable:!0,get:()=>s[l]})}}return t.default=s,Object.freeze(t)}const o=Z(G);function m(s,t){return s?Array.isArray(s)?s.includes(t):s.has(t):!1}function $({title:s,state:t,modalShow:l,onOpen:p,onClose:g,onReset:T,options:h,tabbedOptions:a,onSelect:C,className:F,optionsClassName:R,resetLabel:z="Reset",applyLabel:N="Apply",showApplyButton:I=!1,showSearch:B=!1}){const[u,k]=o.useState(""),[b,P]=o.useState([]),[q,V]=o.useState([]),H=o.useCallback(()=>{T()},[T]),Q=o.useCallback(()=>{g()},[g]),S=o.useMemo(()=>{if(!b)return[];if(!u.trim())return b;const e=u.toLowerCase().trim();return b.filter(n=>j.extractTextFromLabel(n.label).toLowerCase().includes(e))},[b,u]),d=o.useMemo(()=>{if(!q)return[];if(!u.trim())return q;const e=u.toLowerCase().trim();return q.map(n=>({...n,options:n.options.filter(i=>j.extractTextFromLabel(i.label).toLowerCase().includes(e))})).filter(n=>n.options.length>0)},[q,u]),w=o.useMemo(()=>d.length>0?d[0].tab:"",[d]),M=o.useRef(l);o.useEffect(()=>{const e=M.current,n=l;if(!e&&n){if(h){const i=[...h].sort((c,f)=>{const v=m(t,c.value),x=m(t,f.value);return v&&!x?-1:!v&&x?1:0});P(i)}if(a){const i=a.map(c=>({...c,options:[...c.options].sort((f,v)=>{const x=m(t,f.value),O=m(t,v.value);return x&&!O?-1:!x&&O?1:0})}));V(i)}}else e&&!n&&k("");M.current=l},[l,t,h,a]);const L=o.useMemo(()=>a?a.reduce((e,n)=>e+n.options.length,0):h?.length??0,[h,a]),E=o.useMemo(()=>({value:u,handleInput:e=>{k(e.target.value)},handleSubmit:e=>{e.preventDefault()}}),[u]);return r.jsx(J.Dialog,{open:l,onOpenChange:e=>e?p():g(),children:r.jsxs(K.DialogContent,{className:D.cn("max-w-md",F),children:[r.jsx(W.DialogHeader,{children:r.jsx(X.DialogTitle,{children:s})}),B&&r.jsx(Y.SearchLine,{searchState:E,placeholder:"Search options...",size:"full"}),r.jsx("div",{className:D.cn(a?"":"max-h-[60vh] overflow-y-auto",R),children:a?d.length===0?r.jsx("div",{className:"text-center text-sm text-muted-foreground",children:L===0?"No options available":"No options match your search"}):r.jsxs(y.Tabs,{defaultValue:w,className:"w-full",children:[r.jsx(y.TabsList,{className:"w-full justify-start",children:d.map(e=>r.jsx(y.TabsTrigger,{value:e.tab,children:e.label},e.tab))}),d.map(e=>r.jsx(y.TabsContent,{value:e.tab,className:"mt-4 max-h-[60vh] overflow-y-auto",children:e.options.length===0?r.jsx("div",{className:"text-center text-sm text-muted-foreground",children:"No options available"}):r.jsx("div",{className:"space-y-1",children:e.options.map(n=>{const i=m(t,n.value),c=j.serializeValue(n.value);return r.jsx(A.CheckboxItem,{checked:i,onCheckedChange:f=>C(n.value,f),children:n.label},c)})})},e.tab))]},w):S.length===0?r.jsx("div",{className:"text-center text-sm text-muted-foreground",children:L===0?"No options available":"No options match your search"}):r.jsx("div",{className:"space-y-1",children:S.map(e=>{const n=m(t,e.value),i=j.serializeValue(e.value);return r.jsx(A.CheckboxItem,{checked:n,onCheckedChange:c=>C(e.value,c),children:e.label},i)})})}),r.jsxs(U.DialogFooter,{className:"flex-row justify-between gap-2 sm:justify-between",children:[r.jsx(_.Button,{type:"button",variant:"outline",onClick:H,disabled:!t||(Array.isArray(t)?t.length===0:t.size===0),children:z}),I?r.jsx(_.Button,{type:"button",onClick:Q,children:N}):r.jsx(_.Button,{type:"button",variant:"default",onClick:g,children:N})]})]})})}exports.FilterModal=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),U=require("react");require("../buttons/back-button/back-button.cjs");const _=require("../buttons/button/button.cjs");require("../buttons/copy-button/copy-button.cjs");require("../buttons/external-button/external-button.cjs");require("../buttons/filter-button/filter-button.cjs");require("../buttons/navigation-button/navigation-button.cjs");require("@gearbox-protocol/sdk");const A=require("../../utils/cn.cjs");require("sonner");const j=require("../../utils/react.cjs");require("luxon");require("../../utils/z-index.cjs");require("../buttons/tab-button/tab-button.cjs");const D=require("../checkbox-item/checkbox-item.cjs");require("../modal/modal.cjs");const W=require("../dialog/dialog.cjs");require("../dialog/dialog-container.cjs");const X=require("../dialog/dialog-content.cjs");require("../dialog/dialog-description.cjs");const Y=require("../dialog/dialog-footer.cjs"),Z=require("../dialog/dialog-header.cjs"),$=require("../dialog/dialog-title.cjs");require("../dialog/dialog-modal-container.cjs");require("../dialog/dialog-overlay.cjs");require("viem");require("../input/input.cjs");require("../label/label.cjs");const ee=require("../search-line/search-line.cjs"),M=require("../tabs/tabs.cjs"),te=require("../typed-intl/index.cjs");function re(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const a in n)if(a!=="default"){const x=Object.getOwnPropertyDescriptor(n,a);Object.defineProperty(r,a,x.get?x:{enumerable:!0,get:()=>n[a]})}}return r.default=n,Object.freeze(r)}const o=re(U);function m(n,r){return n?Array.isArray(n)?n.includes(r):n.has(r):!1}function se({title:n,state:r,modalShow:a,onOpen:x,onClose:b,onReset:T,options:p,tabbedOptions:c,onSelect:C,className:R,optionsClassName:F,resetLabel:z,applyLabel:P,showApplyButton:B=!1,showSearch:V=!1}){const{formatMessage:u}=te.useIntlTyped(),[d,N]=o.useState(""),H=z??u({messageId:"components.filterModal.reset",defaultMessage:"Reset"}),S=P??u({messageId:"components.filterModal.apply",defaultMessage:"Apply"}),[v,Q]=o.useState([]),[q,E]=o.useState([]),G=o.useCallback(()=>{T()},[T]),J=o.useCallback(()=>{b()},[b]),k=o.useMemo(()=>{if(!v)return[];if(!d.trim())return v;const e=d.toLowerCase().trim();return v.filter(s=>j.extractTextFromLabel(s.label).toLowerCase().includes(e))},[v,d]),f=o.useMemo(()=>{if(!q)return[];if(!d.trim())return q;const e=d.toLowerCase().trim();return q.map(s=>({...s,options:s.options.filter(l=>j.extractTextFromLabel(l.label).toLowerCase().includes(e))})).filter(s=>s.options.length>0)},[q,d]),I=o.useMemo(()=>f.length>0?f[0].tab:"",[f]),O=o.useRef(a);o.useEffect(()=>{const e=O.current,s=a;if(!e&&s){if(p){const l=[...p].sort((i,h)=>{const y=m(r,i.value),g=m(r,h.value);return y&&!g?-1:!y&&g?1:0});Q(l)}if(c){const l=c.map(i=>({...i,options:[...i.options].sort((h,y)=>{const g=m(r,h.value),w=m(r,y.value);return g&&!w?-1:!g&&w?1:0})}));E(l)}}else e&&!s&&N("");O.current=a},[a,r,p,c]);const L=o.useMemo(()=>c?c.reduce((e,s)=>e+s.options.length,0):p?.length??0,[p,c]),K=o.useMemo(()=>({value:d,handleInput:e=>{N(e.target.value)},handleSubmit:e=>{e.preventDefault()}}),[d]);return t.jsx(W.Dialog,{open:a,onOpenChange:e=>e?x():b(),children:t.jsxs(X.DialogContent,{className:A.cn("max-w-lg",R),children:[t.jsx(Z.DialogHeader,{children:t.jsx($.DialogTitle,{children:n})}),V&&t.jsx(ee.SearchLine,{searchState:K,placeholder:u({messageId:"components.filterModal.searchPlaceholder",defaultMessage:"Search options..."}),size:"full"}),t.jsx("div",{className:A.cn(c?"":"max-h-[60vh] overflow-y-auto",F),children:c?f.length===0?t.jsx("div",{className:"text-center text-sm text-muted-foreground",children:u(L===0?{messageId:"components.filterModal.noOptionsAvailable",defaultMessage:"No options available"}:{messageId:"components.filterModal.noOptionsMatchSearch",defaultMessage:"No options match your search"})}):t.jsxs(M.Tabs,{defaultValue:I,className:"w-full",children:[t.jsx(M.TabsList,{className:"w-full justify-start",children:f.map(e=>t.jsx(M.TabsTrigger,{value:e.tab,children:e.label},e.tab))}),f.map(e=>t.jsx(M.TabsContent,{value:e.tab,className:"mt-4 max-h-[60vh] overflow-y-auto",children:e.options.length===0?t.jsx("div",{className:"text-center text-sm text-muted-foreground",children:u({messageId:"components.filterModal.noOptionsAvailable",defaultMessage:"No options available"})}):t.jsx("div",{className:"space-y-1",children:e.options.map(s=>{const l=m(r,s.value),i=j.serializeValue(s.value);return t.jsx(D.CheckboxItem,{checked:l,onCheckedChange:h=>C(s.value,h),children:s.label},i)})})},e.tab))]},I):k.length===0?t.jsx("div",{className:"text-center text-sm text-muted-foreground",children:u(L===0?{messageId:"components.filterModal.noOptionsAvailable",defaultMessage:"No options available"}:{messageId:"components.filterModal.noOptionsMatchSearch",defaultMessage:"No options match your search"})}):t.jsx("div",{className:"space-y-1",children:k.map(e=>{const s=m(r,e.value),l=j.serializeValue(e.value);return t.jsx(D.CheckboxItem,{checked:s,onCheckedChange:i=>C(e.value,i),children:e.label},l)})})}),t.jsxs(Y.DialogFooter,{className:"flex-row justify-between gap-2 sm:justify-between",children:[t.jsx(_.Button,{type:"button",variant:"outline",onClick:G,disabled:!r||(Array.isArray(r)?r.length===0:r.size===0),children:H}),B?t.jsx(_.Button,{type:"button",onClick:J,children:S}):t.jsx(_.Button,{type:"button",variant:"default",onClick:b,children:S})]})]})})}exports.FilterModal=se;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("lightweight-charts"),D=require("luxon"),u=require("../../utils/format-number.cjs"),{MIN_DISPLAY_THRESHOLD:g,MAX_EXPONENTIAL_THRESHOLD:b}=u.FORMAT_CONSTANTS,O=(t,e,a="full")=>{if(u.isBelowDisplayThreshold(t))return e?`<${g}${e}`:`<${g}`;if(t===0)return e?`0${e}`:"0";const n=u.formatNumberWithSuffix(t,{maxExponentialThreshold:b,minimumFractionDigits:0,maximumFractionDigits:a==="short"?1:0,format:a,adaptiveDecimals:a==="short"});return e?`${n}${e}`:n},X=2,y=(t,e)=>{if(u.isBelowDisplayThreshold(t))return e?`<${g}${e}`:`<${g}`;if(t===0)return e?`0${e}`:"0";const a=u.toSignificantDigits(t,X);return e?`${a}${e}`:a},w=4,V=t=>{if(u.isBelowDisplayThreshold(t))return`<${g}`;if(t===0)return"0";const e=Math.round(t),a=Math.abs(t-e);return a>0&&a<.01?t.toFixed(12).replace(/0+$/,"").replace(/\.$/,""):u.toSignificantDigits(t,w)},G=(t,e)=>{if(u.isBelowDisplayThreshold(t))return e?`<${g} ${e}`:`<${g}`;if(t===0)return e?`0 ${e}`:"0";const a=Number.isInteger(t),n=Math.abs(t),m=a&&n>=1e3,s=Math.round(t),o=Math.abs(t-s);if(o>0&&o<.01&&!m){const $=t.toFixed(12).replace(/0+$/,"").replace(/\.$/,"");return e?`${$} ${e}`:$}const F=u.formatNumberWithSuffix(t,{maxExponentialThreshold:b,minimumFractionDigits:a?0:2,maximumFractionDigits:m?1:a?0:2,format:m?"short":"full",adaptiveDecimals:m});return e?`${F} ${e}`:F},N={"%":y,$:O,token:G,none:V},P=t=>N[t]||N.token;function U(t,e,a=4){if(t===0)return e?`0 ${e}`:"0";const n=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:a});return e?`${n} ${e}`:n}function C(t,e,a){const n=a?.yScaleMin;let m=t.length>0?Math.min(...t):0,s=t.length>0?Math.max(...t):0,o=[];const d=()=>{const r=s-m,i=(m+s)/2;let f=1,c="";i>=1e9?(f=1e9,c="B"):i>=1e6?(f=1e6,c="M"):i>=1e3&&(f=1e3,c="K");const x=r/10/f;let h=1;if(x>0){const k=Math.floor(Math.log10(x));h=Math.max(1,-k),h=Math.min(h,4)}return{scale:f,suffix:c,decimals:h}},F=(r,i,f)=>{const c=i>1?r/i:r,l=Math.abs(c)>=1?1:4;return i>1?`${(r/i).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:l,useGrouping:!1})}${f}`:r.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:l,useGrouping:!1})},$=.02,L=r=>{if(n!==void 0&&r<n)return"";if(r===0)return"0";const{scale:i,suffix:f,decimals:c}=d(),l=s-m,S=l>0?o.filter(M=>Math.abs(M)>=l*$):o,h=(l>0?l/10:0)*.05,k=Math.abs(r)*1e-10||1e-10;if(S.some(M=>Math.abs(M-r)<k))return F(r,i,f);if(S.length>0&&h>0){const M=S.reduce((p,E)=>Math.abs(E-r)<Math.abs(p-r)?E:p);if(Math.abs(r-M)<h)return F(M,i,f)}const R=i>1?r/i:r,A=Math.abs(R)>=1?Math.min(1,c):c;return i>1?`${(r/i).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:A,useGrouping:!1})}${f}`:r.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:A,useGrouping:!1})};return{formatter:r=>L(r),tickmarksFormatter:r=>{const i=new Set;return r.map(f=>{const c=L(f);return!c||i.has(c)?"":(i.add(c),c)})},updateVisibleRange:r=>{r.length>0&&(m=Math.min(...r),s=Math.max(...r))},updateLastValues:r=>{o=[...r]}}}const H=t=>D.DateTime.fromSeconds(Number(t)).toFormat("dd/LL/yyyy HH:mm"),Y=t=>D.DateTime.fromSeconds(Number(t)).toFormat("HH:mm"),B=(t,e)=>y(Number(t),e),_={time:H,"%":B};function W(t){const e=new Map;return(a,n,m)=>{const s=D.DateTime.fromSeconds(Number(a));let o;if(t===0)o=s.toFormat("HH:mm");else switch(n){case T.TickMarkType.Year:o=s.toFormat("yyyy");break;case T.TickMarkType.Month:o=s.toFormat("MMM yy");break;case T.TickMarkType.DayOfMonth:o=t>365?s.toFormat("dd MMM yy"):s.toFormat("dd MMM");break;case T.TickMarkType.Time:case T.TickMarkType.TimeWithSeconds:o=s.toFormat("HH:mm");break;default:o=s.toFormat("dd MMM")}let d=e.get(n);return d||(d=new Set,e.set(n,d)),d.has(o)?" ":(d.add(o),o)}}const I=(t,e)=>{if(t==="time"&&e&&e.length>0){const n=D.DateTime.fromSeconds(Number(e[0].time)),m=D.DateTime.fromSeconds(Number(e[e.length-1].time)),s=n.hasSame(m,"day"),o=s?0:Math.ceil(m.diff(n,"days").days);return{timeFormatter:s?Y:H,tickMarkFormatter:W(o)}}const a=_[t]||_.time;return{timeFormatter:a,tickMarkFormatter:n=>a(n,void 0)}},q=(t,e)=>I(t,e).timeFormatter;exports.createAdaptiveYAxisFormatter=C;exports.formatExactValue=U;exports.getXFormatter=q;exports.getXFormatters=I;exports.getYFormatter=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("lightweight-charts"),D=require("luxon"),u=require("../../utils/format-number.cjs"),{MIN_DISPLAY_THRESHOLD:g,MAX_EXPONENTIAL_THRESHOLD:b}=u.FORMAT_CONSTANTS,O=(t,e,a="full")=>{if(u.isBelowDisplayThreshold(t))return e?`<${g}${e}`:`<${g}`;if(t===0)return e?`0${e}`:"0";const n=u.formatNumberWithSuffix(t,{maxExponentialThreshold:b,minimumFractionDigits:0,maximumFractionDigits:a==="short"?1:0,format:a,adaptiveDecimals:a==="short"});return e?`${n}${e}`:n},X=2,H=(t,e)=>{if(u.isBelowDisplayThreshold(t))return e?`<${g}${e}`:`<${g}`;if(t===0)return e?`0${e}`:"0";const a=u.toSignificantDigits(t,X);return e?`${a}${e}`:a},w=4,V=t=>{if(u.isBelowDisplayThreshold(t))return`<${g}`;if(t===0)return"0";const e=Math.round(t),a=Math.abs(t-e);return a>0&&a<.01?t.toFixed(12).replace(/0+$/,"").replace(/\.$/,""):u.toSignificantDigits(t,w)},G=(t,e)=>{if(u.isBelowDisplayThreshold(t))return e?`<${g} ${e}`:`<${g}`;if(t===0)return e?`0 ${e}`:"0";const a=Number.isInteger(t),n=Math.abs(t),c=a&&n>=1e3,s=Math.round(t),o=Math.abs(t-s);if(o>0&&o<.01&&!c){const $=t.toFixed(12).replace(/0+$/,"").replace(/\.$/,"");return e?`${$} ${e}`:$}const F=u.formatNumberWithSuffix(t,{maxExponentialThreshold:b,minimumFractionDigits:a?0:2,maximumFractionDigits:c?1:a?0:2,format:c?"short":"full",adaptiveDecimals:c});return e?`${F} ${e}`:F},N={"%":H,$:O,token:G,none:V},P=t=>N[t]||N.token;function U(t,e,a=4){if(t===0)return e?`0 ${e}`:"0";const n=e&&Math.abs(t)>=1e3?0:a,c=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:n});return e?`${c} ${e}`:c}function C(t,e,a){const n=a?.yScaleMin;let c=t.length>0?Math.min(...t):0,s=t.length>0?Math.max(...t):0,o=[];const d=()=>{const r=s-c,i=(c+s)/2;let f=1,m="";i>=1e9?(f=1e9,m="B"):i>=1e6?(f=1e6,m="M"):i>=1e3&&(f=1e3,m="K");const x=r/10/f;let l=1;if(x>0){const k=Math.floor(Math.log10(x));l=Math.max(1,-k),l=Math.min(l,4)}return{scale:f,suffix:m,decimals:l}},F=(r,i,f)=>{const m=i>1?r/i:r,h=Math.abs(m)>=1?1:4;return i>1?`${(r/i).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:h,useGrouping:!1})}${f}`:r.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:h,useGrouping:!1})},$=.02,L=r=>{if(n!==void 0&&r<n)return"";if(r===0)return"0";const{scale:i,suffix:f,decimals:m}=d(),h=s-c,S=h>0?o.filter(M=>Math.abs(M)>=h*$):o,l=(h>0?h/10:0)*.05,k=Math.abs(r)*1e-10||1e-10;if(S.some(M=>Math.abs(M-r)<k))return F(r,i,f);if(S.length>0&&l>0){const M=S.reduce((p,E)=>Math.abs(E-r)<Math.abs(p-r)?E:p);if(Math.abs(r-M)<l)return F(M,i,f)}const R=i>1?r/i:r,A=Math.abs(R)>=1?Math.min(1,m):m;return i>1?`${(r/i).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:A,useGrouping:!1})}${f}`:r.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:A,useGrouping:!1})};return{formatter:r=>L(r),tickmarksFormatter:r=>{const i=new Set;return r.map(f=>{const m=L(f);return!m||i.has(m)?"":(i.add(m),m)})},updateVisibleRange:r=>{r.length>0&&(c=Math.min(...r),s=Math.max(...r))},updateLastValues:r=>{o=[...r]}}}const I=t=>D.DateTime.fromSeconds(Number(t)).toFormat("dd/LL/yyyy HH:mm"),Y=t=>D.DateTime.fromSeconds(Number(t)).toFormat("HH:mm"),B=(t,e)=>H(Number(t),e),_={time:I,"%":B};function W(t){const e=new Map;return(a,n,c)=>{const s=D.DateTime.fromSeconds(Number(a));let o;if(t===0)o=s.toFormat("HH:mm");else switch(n){case T.TickMarkType.Year:o=s.toFormat("yyyy");break;case T.TickMarkType.Month:o=s.toFormat("MMM yy");break;case T.TickMarkType.DayOfMonth:o=t>365?s.toFormat("dd MMM yy"):s.toFormat("dd MMM");break;case T.TickMarkType.Time:case T.TickMarkType.TimeWithSeconds:o=s.toFormat("HH:mm");break;default:o=s.toFormat("dd MMM")}let d=e.get(n);return d||(d=new Set,e.set(n,d)),d.has(o)?" ":(d.add(o),o)}}const y=(t,e)=>{if(t==="time"&&e&&e.length>0){const n=D.DateTime.fromSeconds(Number(e[0].time)),c=D.DateTime.fromSeconds(Number(e[e.length-1].time)),s=n.hasSame(c,"day"),o=s?0:Math.ceil(c.diff(n,"days").days);return{timeFormatter:s?Y:I,tickMarkFormatter:W(o)}}const a=_[t]||_.time;return{timeFormatter:a,tickMarkFormatter:n=>a(n,void 0)}},q=(t,e)=>y(t,e).timeFormatter;exports.createAdaptiveYAxisFormatter=C;exports.formatExactValue=U;exports.getXFormatter=q;exports.getXFormatters=y;exports.getYFormatter=P;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("@gearbox-protocol/sdk"),p=require("react"),b=require("../../token-symbol/token-symbol.cjs"),s=require("../../typed-intl/index.cjs"),j=require("../../../hooks/use-media-query.cjs"),o=require("../../../utils/cn.cjs");function y({tokensList:r,graphParams:l,data:a,prices:n,editedPrices:c}){const{fixedBalances:i}=l,u=p.useMemo(()=>m.AssetUtils.constructAssetRecord(i),[i]),x=j.useIsMobile();return!a||!a.length?e.jsx("div",{className:"w-full flex items-center justify-center py-8 text-sm text-muted-foreground",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.noData",defaultMessage:"No data"})}):e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:o.cn("grid w-full px-3 sm:px-4 gap-1 sm:gap-2 items-center","h-7 sm:h-8 md:h-[30px]","relative after:absolute after:bottom-0 after:left-2 sm:after:left-3 after:right-2 sm:after:right-3 after:h-px after:border-b after:border-border"),style:{gridTemplateColumns:"1fr 1fr 1fr"},children:[e.jsx("div",{className:"text-left text-xs sm:text-sm font-medium text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.asset"})}),e.jsx("div",{className:"text-right text-xs sm:text-sm font-medium text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.currentPrice"})}),e.jsx("div",{className:"text-right text-xs sm:text-sm font-medium text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.modelPrice"})})]}),a.map((t,f,g)=>{const h=g.length-1===f;return e.jsxs("div",{className:o.cn("grid w-full px-3 sm:px-4 gap-1 sm:gap-2 items-center relative","h-12 sm:h-14 md:h-[51px]",!h&&"after:absolute after:bottom-0 after:left-2 sm:after:left-3 after:right-2 sm:after:right-3 after:h-px after:border-b after:border-border"),style:{gridTemplateColumns:"1fr 1fr 1fr"},children:[e.jsx("div",{className:"text-left min-w-0",children:e.jsx(b.TokenSymbol,{size:x?18:24,token:r[t.token],showSymbol:!0,maxLength:6,className:"gap-1.5 sm:gap-2"})}),e.jsxs("div",{className:"text-right text-xs sm:text-sm md:text-base truncate",children:["$",d(n[t.token])]}),e.jsx("div",{className:"text-right min-w-0",children:u[t.token]?e.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.seeGraph"})}):e.jsxs("span",{className:"text-xs sm:text-sm md:text-base text-muted-foreground truncate",children:["$",d(c[t.token]||n[t.token])]})})]},t.token)})]})}function d(r){return(Number(r||0n)/Number(m.PRICE_DECIMALS)).toFixed(2)}exports.LiquidationModellingAssetsTable=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("@gearbox-protocol/sdk"),p=require("react"),b=require("../../token-symbol/token-symbol.cjs"),s=require("../../typed-intl/index.cjs"),j=require("../../../hooks/use-media-query.cjs"),o=require("../../../utils/cn.cjs");function y({tokensList:r,graphParams:l,data:a,prices:n,editedPrices:c}){const{fixedBalances:i}=l,u=p.useMemo(()=>m.AssetUtils.constructAssetRecord(i),[i]),x=j.useIsMobile();return!a||!a.length?e.jsx("div",{className:"w-full flex items-center justify-center py-8 text-sm text-muted-foreground",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.noData",defaultMessage:"No data"})}):e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:o.cn("grid w-full px-3 sm:px-4 gap-1 sm:gap-2 items-center","h-7 sm:h-8 md:h-[30px]","relative after:absolute after:bottom-0 after:left-2 sm:after:left-3 after:right-2 sm:after:right-3 after:h-px after:border-b after:border-border"),style:{gridTemplateColumns:"1fr 1fr 1fr"},children:[e.jsx("div",{className:"text-left text-xs sm:text-sm font-medium text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.asset"})}),e.jsx("div",{className:"text-right text-xs sm:text-sm font-medium text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.currentPrice"})}),e.jsx("div",{className:"text-right text-xs sm:text-sm font-medium text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.modelPrice"})})]}),a.map((t,f,g)=>{const h=g.length-1===f;return e.jsxs("div",{className:o.cn("grid w-full px-3 sm:px-4 gap-1 sm:gap-2 items-center relative","h-12 sm:h-14 md:h-[51px]",!h&&"after:absolute after:bottom-0 after:left-2 sm:after:left-3 after:right-2 sm:after:right-3 after:h-px after:border-b after:border-border"),style:{gridTemplateColumns:"1fr 1fr 1fr"},children:[e.jsx("div",{className:"text-left min-w-0",children:e.jsx(b.TokenSymbol,{size:x?18:24,token:r[t.token],showSymbol:!0,maxLength:12,className:"gap-1.5 sm:gap-2"})}),e.jsxs("div",{className:"text-right text-xs sm:text-sm md:text-base truncate",children:["$",d(n[t.token])]}),e.jsx("div",{className:"text-right min-w-0",children:u[t.token]?e.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.seeGraph"})}):e.jsxs("span",{className:"text-xs sm:text-sm md:text-base text-muted-foreground truncate",children:["$",d(c[t.token]||n[t.token])]})})]},t.token)})]})}function d(r){return(Number(r||0n)/Number(m.PRICE_DECIMALS)).toFixed(2)}exports.LiquidationModellingAssetsTable=y;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("react"),te=require("sonner"),re=require("../../hooks/use-media-query.cjs");require("@gearbox-protocol/sdk");const oe=require("../../utils/cn.cjs");require("luxon");require("../../utils/z-index.cjs");const ne=require("../buttons/range-buttons/range-buttons.cjs"),j=require("../graph/graph.cjs"),ie=require("../graph/graph-view.cjs"),se=require("./graph-dropdown.cjs"),le=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Expand fullscreen",children:[o.jsx("title",{children:"Expand fullscreen"}),o.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})]}),ue=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Exit fullscreen",children:[o.jsx("title",{children:"Exit fullscreen"}),o.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})]}),k="permissionless-ui:tradingview-series-colors:";function A(e){if(typeof window>"u"||!window.localStorage)return new Map;try{const t=window.localStorage.getItem(k+e);if(!t)return new Map;const l=JSON.parse(t);return l==null||typeof l!="object"?new Map:new Map(Object.entries(l).filter(([,u])=>typeof u=="number"&&u>=0&&u<j.DEFAULT_SERIES_COLORS.length))}catch{return new Map}}function ce(e,t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(k+e,JSON.stringify(Object.fromEntries(t)))}catch{}}function O(e,t){if(t.size===0)return;const l=A(e);for(const[u,g]of t)l.set(u,g);ce(e,l)}function ae({data:e,yMeasureUnit:t,height:l=306,defaultGraph:u,onGraphSelected:g,graphs:f,isMultipleSelect:q,range:N,rangeList:E,setRange:T,onGraphExpanded:y,isGraphExpanded:V,onUnselectSeries:B,graphsWithNoData:F,loadingGraphs:z,noDataMessage:M="No data available for this graph",currentValueDecimals:D,containerClassName:W,useSharedPriceScale:H,showCurrentValue:J,yScaleMin:$,yScaleMinMultiple:Q,seriesColorPersistenceKey:c,...X}){const b=x.useMemo(()=>Array.isArray(e)?e:e?[e]:[],[e]),I=x.useMemo(()=>Array.isArray(e)&&e.length>1,[e]),R=re.useIsMobile(),Y=x.useCallback((w,v)=>{te.toast.error(M)},[M]),Z=x.useMemo(()=>{if(t)return Array.isArray(t)?t[0]:t},[t]),U=(!R&&y||E.length>0||g&&f&&u)&&o.jsxs("div",{className:"z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2",children:[o.jsx("div",{children:g&&f&&u&&o.jsx(se.GraphDropdown,{onSelected:g,items:f,defaultItem:u,multiple:q,graphsWithNoData:F,loadingGraphs:z,onNoDataSelected:Y})}),o.jsxs("div",{className:"flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1",children:[o.jsx(ne.RangeButtons,{range:N,rangeList:E,setRange:T}),!R&&y&&o.jsx("button",{type:"button",className:"px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",onClick:y,children:V?o.jsx(ue,{size:16}):o.jsx(le,{size:16})})]})]}),i=x.useRef(new Map),m=x.useRef(0),C=x.useRef(!1);if(f&&f.length>0&&!C.current){C.current=!0;const w=c?A(c):new Map,v=String(f[0].value);i.current.set(v,0),m.current=1;for(let r=1;r<f.length;r++){const a=String(f[r].value);if(i.current.has(a))continue;const p=w.get(a)??r;i.current.set(a,p),m.current=Math.max(m.current,p+1)}c&&O(c,i.current)}const G=x.useMemo(()=>{const w=Array.isArray(t)?t:void 0;if(c){const r=A(c);for(const[a,h]of r)i.current.has(a)||(i.current.set(a,h),m.current=Math.max(m.current,h+1))}const v=b.map((r,a)=>{const h=r?.title||`Series ${a+1}`,p=r?.id||h;if(!i.current.has(p)){const n=new Set(Array.from(i.current.values()));let s=m.current;for(let d=0;d<j.DEFAULT_SERIES_COLORS.length;d++){const S=(m.current+d)%j.DEFAULT_SERIES_COLORS.length;if(!n.has(S)){s=S;break}}i.current.set(p,s),m.current=s+1}const K=i.current.get(p)??0,_=j.getSeriesColorPalette(K),ee=[...r?.data||[]].sort((n,s)=>{const d=typeof n.time=="number"?n.time:Number(n.time),S=typeof s.time=="number"?s.time:Number(s.time);return d-S}).reduce((n,s)=>{const d=s.time;return n.length===0||n[n.length-1].time!==d?n.push({time:d,value:s.value}):n[n.length-1]={time:d,value:s.value},n},[]),L=r?.lineColor??r?.color??void 0;return{data:ee,label:h,yMeasureUnit:w?.[a]??(Array.isArray(t)?void 0:t),...L!=null?{lineColor:L,...r?.topColor!=null&&{topColor:r.topColor},...r?.bottomColor!=null&&{bottomColor:r.bottomColor}}:{color:_.line,topColor:_.top,bottomColor:_.bottom}}});return c&&i.current.size>0&&O(c,i.current),v},[b,t,c]),P=I&&b.length>0?b.some(w=>!w):!e;return o.jsx("div",{style:{width:"100%",height:l?`${l}px`:void 0},className:"w-full",children:o.jsx(ie.GraphViewWithData,{series:G,loading:P,toolbar:U,size:l?"full":"default",containerClassName:oe.cn("h-full",W),showLegend:I,onUnselectSeries:B,yMeasureUnit:Z,currentValueDecimals:D,useSharedPriceScale:H,showCurrentValue:J,yScaleMin:$,yScaleMinMultiple:Q,...X})})}exports.TradingView=ae;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("react"),re=require("sonner"),ne=require("../../hooks/use-media-query.cjs");require("@gearbox-protocol/sdk");const oe=require("../../utils/cn.cjs");require("luxon");require("../../utils/z-index.cjs");const ie=require("../buttons/range-buttons/range-buttons.cjs"),j=require("../graph/graph.cjs"),se=require("../graph/graph-view.cjs"),le=require("./graph-dropdown.cjs"),ce=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Expand fullscreen",children:[o.jsx("title",{children:"Expand fullscreen"}),o.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})]}),ue=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Exit fullscreen",children:[o.jsx("title",{children:"Exit fullscreen"}),o.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})]}),q="permissionless-ui:tradingview-series-colors:";function E(e){if(typeof window>"u"||!window.localStorage)return new Map;try{const t=window.localStorage.getItem(q+e);if(!t)return new Map;const c=JSON.parse(t);return c==null||typeof c!="object"?new Map:new Map(Object.entries(c).filter(([,r])=>typeof r=="number"&&r>=0&&r<j.DEFAULT_SERIES_COLORS.length))}catch{return new Map}}function ae(e,t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(q+e,JSON.stringify(Object.fromEntries(t)))}catch{}}function k(e,t){if(t.size===0)return;const c=E(e);for(const[r,b]of t)c.set(r,b);ae(e,c)}function de({data:e,yMeasureUnit:t,height:c=306,defaultGraph:r,onGraphSelected:b,graphs:m,isMultipleSelect:N,range:T,rangeList:M,setRange:V,onGraphExpanded:y,isGraphExpanded:F,onUnselectSeries:B,graphsWithNoData:D,loadingGraphs:z,noDataMessage:I="No data available for this graph",currentValueDecimals:W,containerClassName:H,useSharedPriceScale:J,showCurrentValue:$,yScaleMin:Q,yScaleMinMultiple:X,seriesColorPersistenceKey:u,...Y}){const v=x.useMemo(()=>Array.isArray(e)?e:e?[e]:[],[e]),R=x.useMemo(()=>Array.isArray(e)&&e.length>1,[e]),C=ne.useIsMobile(),Z=x.useCallback((w,p)=>{re.toast.error(I)},[I]),U=x.useMemo(()=>{if(t)return Array.isArray(t)?t[0]:t},[t]),P=(!C&&y||M.length>0||b&&m&&r)&&o.jsxs("div",{className:"z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2",children:[o.jsx("div",{children:b&&m&&r&&o.jsx(le.GraphDropdown,{onSelected:b,items:m,defaultItem:r,multiple:N,graphsWithNoData:D,loadingGraphs:z,onNoDataSelected:Z})}),o.jsxs("div",{className:"flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1",children:[o.jsx(ie.RangeButtons,{range:T,rangeList:M,setRange:V}),!C&&y&&o.jsx("button",{type:"button",className:"px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",onClick:y,children:F?o.jsx(ue,{size:16}):o.jsx(ce,{size:16})})]})]}),s=x.useRef(new Map),f=x.useRef(0),L=x.useRef(!1);if(m&&m.length>0&&!L.current){L.current=!0;const w=u?E(u):new Map,p=String(m[0].value);s.current.set(p,0),f.current=1;for(let n=1;n<m.length;n++){const a=String(m[n].value);if(s.current.has(a))continue;const h=w.get(a)??n;s.current.set(a,h),f.current=Math.max(f.current,h+1)}u&&k(u,s.current)}const K=x.useMemo(()=>{const w=Array.isArray(t)?t:void 0;if(u){const n=E(u);for(const[a,g]of n)s.current.has(a)||(s.current.set(a,g),f.current=Math.max(f.current,g+1))}const p=v.map((n,a)=>{const g=n?.title||`Series ${a+1}`,h=r!=null?Array.isArray(r)?r[0]?.value??r[0]:typeof r=="object"&&"value"in r?r.value:r:null,A=v.length===1?h!=null?String(h):"single":n?.id||g;if(!s.current.has(A)){const i=new Set(Array.from(s.current.values()));let l=f.current;for(let d=0;d<j.DEFAULT_SERIES_COLORS.length;d++){const S=(f.current+d)%j.DEFAULT_SERIES_COLORS.length;if(!i.has(S)){l=S;break}}s.current.set(A,l),f.current=l+1}const ee=s.current.get(A)??0,_=j.getSeriesColorPalette(ee),te=[...n?.data||[]].sort((i,l)=>{const d=typeof i.time=="number"?i.time:Number(i.time),S=typeof l.time=="number"?l.time:Number(l.time);return d-S}).reduce((i,l)=>{const d=l.time;return i.length===0||i[i.length-1].time!==d?i.push({time:d,value:l.value}):i[i.length-1]={time:d,value:l.value},i},[]),O=n?.lineColor??n?.color??void 0;return{data:te,label:g,yMeasureUnit:w?.[a]??(Array.isArray(t)?void 0:t),...O!=null?{lineColor:O,...n?.topColor!=null&&{topColor:n.topColor},...n?.bottomColor!=null&&{bottomColor:n.bottomColor}}:{color:_.line,topColor:_.top,bottomColor:_.bottom}}});return u&&s.current.size>0&&k(u,s.current),p},[v,r,t,u]),G=R&&v.length>0?v.some(w=>!w):!e;return o.jsx("div",{style:{width:"100%",height:c?`${c}px`:void 0},className:"w-full",children:o.jsx(se.GraphViewWithData,{series:K,loading:G,toolbar:P,size:c?"full":"default",containerClassName:oe.cn("h-full",H),showLegend:R,onUnselectSeries:B,yMeasureUnit:U,currentValueDecimals:W,useSharedPriceScale:J,showCurrentValue:$,yScaleMin:Q,yScaleMinMultiple:X,...Y})})}exports.TradingView=de;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),o=require("react-intl"),c=e=>r.jsx("strong",{children:e});function d({messageId:e,values:t,defaultMessage:s}){return r.jsx(o.FormattedMessage,{id:e,defaultMessage:s,values:{strong:c,...t}})}function i(){const e=o.useIntl(),t=n.useCallback(({messageId:a},u)=>e.formatMessage({id:a},u),[e]);return n.useMemo(()=>({formatMessage:t,intl:e}),[e,t])}exports.FormattedMessageTyped=d;exports.useIntlTyped=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),o=require("react-intl"),d=e=>r.jsx("strong",{children:e});function i({messageId:e,values:t,defaultMessage:s}){return r.jsx(o.FormattedMessage,{id:e,defaultMessage:s,values:{strong:d,...t}})}function l(){const e=o.useIntl(),t=n.useCallback(({messageId:a,defaultMessage:u},c)=>e.formatMessage({id:a,defaultMessage:u},c),[e]);return n.useMemo(()=>({formatMessage:t,intl:e}),[e,t])}exports.FormattedMessageTyped=i;exports.useIntlTyped=l;
@@ -1 +1 @@
1
- "use strict";const e={"errors.networkError":"Network error. Can't fetch data","errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no opened Credit Accounts. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.notFound":"Not found","errors.tooManyRequests":"Too many requests","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.footer.terms":"Terms of Service","components.footer.disclosure":"Risk Disclosure Statement","components.footer.legalNotice":"Legal Notice","components.footer.legal":"Legal Info","components.footer.gearbox":"Copyright © Gearbox Foundation 2023-2026.","components.footer.built":"Built at ETHGlobal MarketMake hackathon.","components.footer.version":"Version {value}","components.liquidationPrice.check":"Check Area","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.smartNumberInput.balance":"Balance","components.smartNumberInput.inputTitle":"Token Amount","components.smartNumberInput.confirm.input":"Input","components.tipWindow.title":"Tip","components.healthFactor.low":"Extremely low! This HF may not cover possible oracle deviations.","components.headCell":"Sort by {value}","components.graphView.noData":"Can't get data for this graph","components.filterBlock.reset":"Reset All","components.APY.tip":"These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.","components.creditSessionDetailedLiquidation.graph.noData":"No data","components.creditSessionDetailedLiquidation.graph.legend.point":"Current price","components.creditSessionDetailedLiquidation.graph.legend.area":"Liquidation Area","components.creditSessionDetailedLiquidation.graph.tip.hf":"Health Factor","components.creditSessionDetailedLiquidation.graph.tip.price":"Price","components.creditSessionDetailedLiquidation.table.noData":"No data","components.creditSessionDetailedLiquidation.table.seeGraph":"See graph","components.creditSessionDetailedLiquidation.table.asset":"Asset","components.creditSessionDetailedLiquidation.table.currentPrice":"Current price","components.creditSessionDetailedLiquidation.table.modelPrice":"Model price","components.apyParts.features.points":"Points","components.apyParts.features.incent":"Incent.","components.apyParts.supplyAPY":"Organic APY","components.apyParts.title":"APY type","components.apyParts.supplyAPY.tip":"Yield from lending funds","components.apyParts.tokenYield":"Intrinsic APY","components.apyParts.tokenYield.tip":"Yield from holding wstETH","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.extraAPY.tip":"Calculated at the current rate","components.apyParts.totalAPY":"Overall APY","components.apyParts.points":"{symbol} Incentive","components.apyParts.points.condition.crossDeposit":"For cross-chain deposits made via Omni","components.openCopyButtons.copy":"Copy to clipboard"};module.exports=e;
1
+ "use strict";const e={"errors.networkError":"Network error. Can't fetch data","errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no opened Credit Accounts. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.notFound":"Not found","errors.tooManyRequests":"Too many requests","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.footer.terms":"Terms of Service","components.footer.disclosure":"Risk Disclosure Statement","components.footer.legalNotice":"Legal Notice","components.footer.legal":"Legal Info","components.footer.gearbox":"Copyright © Gearbox Foundation 2023-2026.","components.footer.built":"Built at ETHGlobal MarketMake hackathon.","components.footer.version":"Version {value}","components.liquidationPrice.check":"Check Area","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.smartNumberInput.balance":"Balance","components.smartNumberInput.inputTitle":"Token Amount","components.smartNumberInput.confirm.input":"Input","components.tipWindow.title":"Tip","components.healthFactor.low":"Extremely low! This HF may not cover possible oracle deviations.","components.headCell":"Sort by {value}","components.graphView.noData":"Can't get data for this graph","components.filterBlock.reset":"Reset All","components.filterModal.searchPlaceholder":"Search options...","components.filterModal.noOptionsAvailable":"No options available","components.filterModal.noOptionsMatchSearch":"No options match your search","components.filterModal.reset":"Reset","components.filterModal.apply":"Apply","components.APY.tip":"These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.","components.creditSessionDetailedLiquidation.graph.noData":"No data","components.creditSessionDetailedLiquidation.graph.legend.point":"Current price","components.creditSessionDetailedLiquidation.graph.legend.area":"Liquidation Area","components.creditSessionDetailedLiquidation.graph.tip.hf":"Health Factor","components.creditSessionDetailedLiquidation.graph.tip.price":"Price","components.creditSessionDetailedLiquidation.table.noData":"No data","components.creditSessionDetailedLiquidation.table.seeGraph":"See graph","components.creditSessionDetailedLiquidation.table.asset":"Asset","components.creditSessionDetailedLiquidation.table.currentPrice":"Current price","components.creditSessionDetailedLiquidation.table.modelPrice":"Model price","components.apyParts.features.points":"Points","components.apyParts.features.incent":"Incent.","components.apyParts.supplyAPY":"Organic APY","components.apyParts.title":"APY type","components.apyParts.supplyAPY.tip":"Yield from lending funds","components.apyParts.tokenYield":"Intrinsic APY","components.apyParts.tokenYield.tip":"Yield from holding wstETH","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.extraAPY.tip":"Calculated at the current rate","components.apyParts.totalAPY":"Overall APY","components.apyParts.points":"{symbol} Incentive","components.apyParts.points.condition.crossDeposit":"For cross-chain deposits made via Omni","components.openCopyButtons.copy":"Copy to clipboard"};module.exports=e;
@@ -37,7 +37,7 @@ const d = l.forwardRef(
37
37
  "absolute left-2 flex h-4 w-4 items-center justify-center rounded-[4px] border border-primary shadow transition-colors",
38
38
  e && "bg-primary text-primary-foreground"
39
39
  ),
40
- children: e && /* @__PURE__ */ r(x, { icon: f, className: "size-4" })
40
+ children: e && /* @__PURE__ */ r(x, { icon: f, className: "size-3!" })
41
41
  }
42
42
  ),
43
43
  s
@@ -22,7 +22,7 @@ const u = d.forwardRef(
22
22
  disabled: s,
23
23
  ...a,
24
24
  children: [
25
- /* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(o.ItemIndicator, { children: /* @__PURE__ */ e(p, { icon: l, className: "size-4" }) }) }),
25
+ /* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(o.ItemIndicator, { children: /* @__PURE__ */ e(p, { icon: l, className: "size-3!" }) }) }),
26
26
  t
27
27
  ]
28
28
  }
@@ -11,7 +11,7 @@ const m = n.forwardRef(({ className: e, inset: r, ...t }, s) => /* @__PURE__ */
11
11
  {
12
12
  ref: s,
13
13
  className: a(
14
- "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:text-foreground hover:bg-secondary focus-visible:outline-none focus:bg-secondary focus:text-foreground data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
14
+ "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:text-foreground hover:bg-secondary focus-visible:outline-none focus:bg-secondary focus:text-foreground data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-3! [&>svg]:shrink-0",
15
15
  r && "pl-8",
16
16
  e
17
17
  ),
@@ -1,4 +1,4 @@
1
- import { jsx as t, jsxs as b } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as x } from "react/jsx-runtime";
2
2
  import * as l from "react";
3
3
  import "../buttons/back-button/back-button.js";
4
4
  import { Button as N } from "../buttons/button/button.js";
@@ -7,94 +7,101 @@ import "../buttons/external-button/external-button.js";
7
7
  import "../buttons/filter-button/filter-button.js";
8
8
  import "../buttons/navigation-button/navigation-button.js";
9
9
  import "@gearbox-protocol/sdk";
10
- import { cn as j } from "../../utils/cn.js";
10
+ import { cn as D } from "../../utils/cn.js";
11
11
  import "sonner";
12
- import { extractTextFromLabel as R, serializeValue as z } from "../../utils/react.js";
12
+ import { extractTextFromLabel as j, serializeValue as R } from "../../utils/react.js";
13
13
  import "luxon";
14
14
  import "../../utils/z-index.js";
15
15
  import "../buttons/tab-button/tab-button.js";
16
- import { CheckboxItem as F } from "../checkbox-item/checkbox-item.js";
16
+ import { CheckboxItem as z } from "../checkbox-item/checkbox-item.js";
17
17
  import "../modal/modal.js";
18
- import { Dialog as P } from "../dialog/dialog.js";
18
+ import { Dialog as X } from "../dialog/dialog.js";
19
19
  import "../dialog/dialog-container.js";
20
- import { DialogContent as U } from "../dialog/dialog-content.js";
20
+ import { DialogContent as Y } from "../dialog/dialog-content.js";
21
21
  import "../dialog/dialog-description.js";
22
- import { DialogFooter as W } from "../dialog/dialog-footer.js";
23
- import { DialogHeader as X } from "../dialog/dialog-header.js";
24
- import { DialogTitle as Y } from "../dialog/dialog-title.js";
22
+ import { DialogFooter as Z } from "../dialog/dialog-footer.js";
23
+ import { DialogHeader as _ } from "../dialog/dialog-header.js";
24
+ import { DialogTitle as $ } from "../dialog/dialog-title.js";
25
25
  import "../dialog/dialog-modal-container.js";
26
26
  import "../dialog/dialog-overlay.js";
27
27
  import "viem";
28
28
  import "../input/input.js";
29
29
  import "../label/label.js";
30
- import { SearchLine as Z } from "../search-line/search-line.js";
31
- import { Tabs as _, TabsList as $, TabsTrigger as ee, TabsContent as re } from "../tabs/tabs.js";
32
- function m(c, o) {
33
- return c ? Array.isArray(c) ? c.includes(o) : c.has(o) : !1;
30
+ import { SearchLine as ee } from "../search-line/search-line.js";
31
+ import { Tabs as te, TabsList as re, TabsTrigger as oe, TabsContent as le } from "../tabs/tabs.js";
32
+ import { useIntlTyped as ae } from "../typed-intl/index.js";
33
+ function d(m, o) {
34
+ return m ? Array.isArray(m) ? m.includes(o) : m.has(o) : !1;
34
35
  }
35
- function Re({
36
- title: c,
36
+ function qe({
37
+ title: m,
37
38
  state: o,
38
- modalShow: d,
39
- onOpen: O,
39
+ modalShow: f,
40
+ onOpen: F,
40
41
  onClose: v,
41
- onReset: C,
42
- options: f,
43
- tabbedOptions: a,
44
- onSelect: T,
42
+ onReset: T,
43
+ options: p,
44
+ tabbedOptions: n,
45
+ onSelect: C,
45
46
  className: q,
46
- optionsClassName: I,
47
- resetLabel: Q = "Reset",
48
- applyLabel: k = "Apply",
49
- showApplyButton: V = !1,
50
- showSearch: B = !1
47
+ optionsClassName: Q,
48
+ resetLabel: V,
49
+ applyLabel: B,
50
+ showApplyButton: E = !1,
51
+ showSearch: H = !1
51
52
  }) {
52
- const [s, S] = l.useState(""), [g, E] = l.useState([]), [x, H] = l.useState([]), G = l.useCallback(() => {
53
- C();
54
- }, [C]), J = l.useCallback(() => {
53
+ const { formatMessage: i } = ae(), [c, S] = l.useState(""), P = V ?? i({
54
+ messageId: "components.filterModal.reset",
55
+ defaultMessage: "Reset"
56
+ }), k = B ?? i({
57
+ messageId: "components.filterModal.apply",
58
+ defaultMessage: "Apply"
59
+ }), [y, G] = l.useState([]), [M, J] = l.useState([]), K = l.useCallback(() => {
60
+ T();
61
+ }, [T]), U = l.useCallback(() => {
55
62
  v();
56
- }, [v]), w = l.useMemo(() => {
57
- if (!g) return [];
58
- if (!s.trim())
59
- return g;
60
- const e = s.toLowerCase().trim();
61
- return g.filter((r) => R(r.label).toLowerCase().includes(e));
62
- }, [g, s]), u = l.useMemo(() => {
63
- if (!x) return [];
64
- if (!s.trim())
65
- return x;
66
- const e = s.toLowerCase().trim();
67
- return x.map((r) => ({
68
- ...r,
69
- options: r.options.filter((n) => R(n.label).toLowerCase().includes(e))
70
- })).filter((r) => r.options.length > 0);
71
- }, [x, s]), A = l.useMemo(() => u.length > 0 ? u[0].tab : "", [u]), M = l.useRef(d);
63
+ }, [v]), A = l.useMemo(() => {
64
+ if (!y) return [];
65
+ if (!c.trim())
66
+ return y;
67
+ const e = c.toLowerCase().trim();
68
+ return y.filter((t) => j(t.label).toLowerCase().includes(e));
69
+ }, [y, c]), u = l.useMemo(() => {
70
+ if (!M) return [];
71
+ if (!c.trim())
72
+ return M;
73
+ const e = c.toLowerCase().trim();
74
+ return M.map((t) => ({
75
+ ...t,
76
+ options: t.options.filter((a) => j(a.label).toLowerCase().includes(e))
77
+ })).filter((t) => t.options.length > 0);
78
+ }, [M, c]), I = l.useMemo(() => u.length > 0 ? u[0].tab : "", [u]), w = l.useRef(f);
72
79
  l.useEffect(() => {
73
- const e = M.current, r = d;
74
- if (!e && r) {
75
- if (f) {
76
- const n = [...f].sort((i, p) => {
77
- const y = m(o, i.value), h = m(o, p.value);
78
- return y && !h ? -1 : !y && h ? 1 : 0;
80
+ const e = w.current, t = f;
81
+ if (!e && t) {
82
+ if (p) {
83
+ const a = [...p].sort((s, h) => {
84
+ const b = d(o, s.value), g = d(o, h.value);
85
+ return b && !g ? -1 : !b && g ? 1 : 0;
79
86
  });
80
- E(n);
87
+ G(a);
81
88
  }
82
- if (a) {
83
- const n = a.map((i) => ({
84
- ...i,
85
- options: [...i.options].sort((p, y) => {
86
- const h = m(o, p.value), L = m(o, y.value);
87
- return h && !L ? -1 : !h && L ? 1 : 0;
89
+ if (n) {
90
+ const a = n.map((s) => ({
91
+ ...s,
92
+ options: [...s.options].sort((h, b) => {
93
+ const g = d(o, h.value), O = d(o, b.value);
94
+ return g && !O ? -1 : !g && O ? 1 : 0;
88
95
  })
89
96
  }));
90
- H(n);
97
+ J(a);
91
98
  }
92
- } else e && !r && S("");
93
- M.current = d;
94
- }, [d, o, f, a]);
95
- const D = l.useMemo(() => a ? a.reduce((e, r) => e + r.options.length, 0) : f?.length ?? 0, [f, a]), K = l.useMemo(
99
+ } else e && !t && S("");
100
+ w.current = f;
101
+ }, [f, o, p, n]);
102
+ const L = l.useMemo(() => n ? n.reduce((e, t) => e + t.options.length, 0) : p?.length ?? 0, [p, n]), W = l.useMemo(
96
103
  () => ({
97
- value: s,
104
+ value: c,
98
105
  handleInput: (e) => {
99
106
  S(e.target.value);
100
107
  },
@@ -102,52 +109,64 @@ function Re({
102
109
  e.preventDefault();
103
110
  }
104
111
  }),
105
- [s]
112
+ [c]
106
113
  );
107
- return /* @__PURE__ */ t(
108
- P,
114
+ return /* @__PURE__ */ r(
115
+ X,
109
116
  {
110
- open: d,
111
- onOpenChange: (e) => e ? O() : v(),
112
- children: /* @__PURE__ */ b(U, { className: j("max-w-md", q), children: [
113
- /* @__PURE__ */ t(X, { children: /* @__PURE__ */ t(Y, { children: c }) }),
114
- B && /* @__PURE__ */ t(
115
- Z,
117
+ open: f,
118
+ onOpenChange: (e) => e ? F() : v(),
119
+ children: /* @__PURE__ */ x(Y, { className: D("max-w-lg", q), children: [
120
+ /* @__PURE__ */ r(_, { children: /* @__PURE__ */ r($, { children: m }) }),
121
+ H && /* @__PURE__ */ r(
122
+ ee,
116
123
  {
117
- searchState: K,
118
- placeholder: "Search options...",
124
+ searchState: W,
125
+ placeholder: i({
126
+ messageId: "components.filterModal.searchPlaceholder",
127
+ defaultMessage: "Search options..."
128
+ }),
119
129
  size: "full"
120
130
  }
121
131
  ),
122
- /* @__PURE__ */ t(
132
+ /* @__PURE__ */ r(
123
133
  "div",
124
134
  {
125
- className: j(
126
- a ? "" : "max-h-[60vh] overflow-y-auto",
127
- I
135
+ className: D(
136
+ n ? "" : "max-h-[60vh] overflow-y-auto",
137
+ Q
128
138
  ),
129
- children: a ? u.length === 0 ? /* @__PURE__ */ t("div", { className: "text-center text-sm text-muted-foreground", children: D === 0 ? "No options available" : "No options match your search" }) : /* @__PURE__ */ b(
130
- _,
139
+ children: n ? u.length === 0 ? /* @__PURE__ */ r("div", { className: "text-center text-sm text-muted-foreground", children: i(L === 0 ? {
140
+ messageId: "components.filterModal.noOptionsAvailable",
141
+ defaultMessage: "No options available"
142
+ } : {
143
+ messageId: "components.filterModal.noOptionsMatchSearch",
144
+ defaultMessage: "No options match your search"
145
+ }) }) : /* @__PURE__ */ x(
146
+ te,
131
147
  {
132
- defaultValue: A,
148
+ defaultValue: I,
133
149
  className: "w-full",
134
150
  children: [
135
- /* @__PURE__ */ t($, { className: "w-full justify-start", children: u.map((e) => /* @__PURE__ */ t(ee, { value: e.tab, children: e.label }, e.tab)) }),
136
- u.map((e) => /* @__PURE__ */ t(
137
- re,
151
+ /* @__PURE__ */ r(re, { className: "w-full justify-start", children: u.map((e) => /* @__PURE__ */ r(oe, { value: e.tab, children: e.label }, e.tab)) }),
152
+ u.map((e) => /* @__PURE__ */ r(
153
+ le,
138
154
  {
139
155
  value: e.tab,
140
156
  className: "mt-4 max-h-[60vh] overflow-y-auto",
141
- children: e.options.length === 0 ? /* @__PURE__ */ t("div", { className: "text-center text-sm text-muted-foreground", children: "No options available" }) : /* @__PURE__ */ t("div", { className: "space-y-1", children: e.options.map((r) => {
142
- const n = m(o, r.value), i = z(r.value);
143
- return /* @__PURE__ */ t(
144
- F,
157
+ children: e.options.length === 0 ? /* @__PURE__ */ r("div", { className: "text-center text-sm text-muted-foreground", children: i({
158
+ messageId: "components.filterModal.noOptionsAvailable",
159
+ defaultMessage: "No options available"
160
+ }) }) : /* @__PURE__ */ r("div", { className: "space-y-1", children: e.options.map((t) => {
161
+ const a = d(o, t.value), s = R(t.value);
162
+ return /* @__PURE__ */ r(
163
+ z,
145
164
  {
146
- checked: n,
147
- onCheckedChange: (p) => T(r.value, p),
148
- children: r.label
165
+ checked: a,
166
+ onCheckedChange: (h) => C(t.value, h),
167
+ children: t.label
149
168
  },
150
- i
169
+ s
151
170
  );
152
171
  }) })
153
172
  },
@@ -155,38 +174,44 @@ function Re({
155
174
  ))
156
175
  ]
157
176
  },
158
- A
159
- ) : w.length === 0 ? /* @__PURE__ */ t("div", { className: "text-center text-sm text-muted-foreground", children: D === 0 ? "No options available" : "No options match your search" }) : /* @__PURE__ */ t("div", { className: "space-y-1", children: w.map((e) => {
160
- const r = m(o, e.value), n = z(e.value);
161
- return /* @__PURE__ */ t(
162
- F,
177
+ I
178
+ ) : A.length === 0 ? /* @__PURE__ */ r("div", { className: "text-center text-sm text-muted-foreground", children: i(L === 0 ? {
179
+ messageId: "components.filterModal.noOptionsAvailable",
180
+ defaultMessage: "No options available"
181
+ } : {
182
+ messageId: "components.filterModal.noOptionsMatchSearch",
183
+ defaultMessage: "No options match your search"
184
+ }) }) : /* @__PURE__ */ r("div", { className: "space-y-1", children: A.map((e) => {
185
+ const t = d(o, e.value), a = R(e.value);
186
+ return /* @__PURE__ */ r(
187
+ z,
163
188
  {
164
- checked: r,
165
- onCheckedChange: (i) => T(e.value, i),
189
+ checked: t,
190
+ onCheckedChange: (s) => C(e.value, s),
166
191
  children: e.label
167
192
  },
168
- n
193
+ a
169
194
  );
170
195
  }) })
171
196
  }
172
197
  ),
173
- /* @__PURE__ */ b(W, { className: "flex-row justify-between gap-2 sm:justify-between", children: [
174
- /* @__PURE__ */ t(
198
+ /* @__PURE__ */ x(Z, { className: "flex-row justify-between gap-2 sm:justify-between", children: [
199
+ /* @__PURE__ */ r(
175
200
  N,
176
201
  {
177
202
  type: "button",
178
203
  variant: "outline",
179
- onClick: G,
204
+ onClick: K,
180
205
  disabled: !o || (Array.isArray(o) ? o.length === 0 : o.size === 0),
181
- children: Q
206
+ children: P
182
207
  }
183
208
  ),
184
- V ? /* @__PURE__ */ t(N, { type: "button", onClick: J, children: k }) : /* @__PURE__ */ t(N, { type: "button", variant: "default", onClick: v, children: k })
209
+ E ? /* @__PURE__ */ r(N, { type: "button", onClick: U, children: k }) : /* @__PURE__ */ r(N, { type: "button", variant: "default", onClick: v, children: k })
185
210
  ] })
186
211
  ] })
187
212
  }
188
213
  );
189
214
  }
190
215
  export {
191
- Re as FilterModal
216
+ qe as FilterModal
192
217
  };
@@ -55,11 +55,11 @@ const { MIN_DISPLAY_THRESHOLD: g, MAX_EXPONENTIAL_THRESHOLD: R } = U, V = (t, e,
55
55
  function et(t, e, n = 4) {
56
56
  if (t === 0)
57
57
  return e ? `0 ${e}` : "0";
58
- const a = t.toLocaleString("en-US", {
58
+ const a = e && Math.abs(t) >= 1e3 ? 0 : n, c = t.toLocaleString("en-US", {
59
59
  minimumFractionDigits: 0,
60
- maximumFractionDigits: n
60
+ maximumFractionDigits: a
61
61
  });
62
- return e ? `${a} ${e}` : a;
62
+ return e ? `${c} ${e}` : c;
63
63
  }
64
64
  function rt(t, e, n) {
65
65
  const a = n?.yScaleMin;
@@ -56,7 +56,7 @@ function q({
56
56
  size: u ? 18 : 24,
57
57
  token: a[t.token],
58
58
  showSymbol: !0,
59
- maxLength: 6,
59
+ maxLength: 12,
60
60
  className: "gap-1.5 sm:gap-2"
61
61
  }
62
62
  ) }),