@dodoex/widgets 3.0.2-zetachain.24 → 3.0.2-zetachain.26
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/{helper-BJWViNGA.cjs → helper-BjElSybD.cjs} +1 -1
- package/dist/{helper-CqVYcunS.js → helper-D2gRfZE2.js} +1 -1
- package/dist/index-CW7dbGMb.cjs +40 -0
- package/dist/{index-B2e5jMRC.cjs → index-CbVGPuuN.cjs} +3 -3
- package/dist/{index-P0I7mT2T.cjs → index-Ct-aEpbu.cjs} +2 -2
- package/dist/{index-CNogQ3nw.js → index-D-KAe_lf.js} +1 -1
- package/dist/index-DeShJXSX.js +40 -0
- package/dist/{index-Bf7osrkq.js → index-YzpFVkAf.js} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/types/utils/btc.d.ts +13 -0
- package/dist/types/utils/solana.d.ts +4 -1
- package/package.json +4 -3
- package/dist/index-Cfn7WKzq.js +0 -40
- package/dist/index-h3O0jv8i.cjs +0 -40
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("bignumber.js"),t=require("lodash"),i=require("react"),r=require("@emotion/styled"),o=require("@emotion/react"),n=require("react-konva"),s=require("./helper-
|
|
1
|
+
"use strict";var e=require("bignumber.js"),t=require("lodash"),i=require("react"),r=require("@emotion/styled"),o=require("@emotion/react"),n=require("react-konva"),s=require("./helper-BjElSybD.cjs"),l=require("./index-CW7dbGMb.cjs"),a=require("@dodoex/api");require("@lingui/core"),require("react-dom"),require("@lingui/react"),require("@dodoex/components"),require("@reown/appkit-utils"),require("@solana/web3.js"),require("@reown/appkit/networks"),require("@ethersproject/bignumber"),require("@tanstack/react-query"),require("zustand"),require("@web3-react/core"),require("@dodoex/dodo-contract-request"),require("@reown/appkit/react"),require("@web3-react/eip1193"),require("@web3-react/walletconnect-v2"),require("@web3-react/metamask"),require("@web3-react/types"),require("axios"),require("@ethersproject/contracts"),require("identicon.js"),require("bitcoinjs-lib"),require("@bitcoinerlab/secp256k1"),require("dayjs"),require("react-transition-group"),require("@dodoex/contract-request"),require("recharts"),require("react-window"),require("jsbi"),require("tiny-invariant"),require("@ethersproject/units"),require("@uniswap/sdk-core"),require("@uniswap/v2-sdk"),require("react-infinite-scroller"),require("d3"),require("rmc-date-picker");var u={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},c=i.createContext&&i.createContext(u),p=["attr","size","title"];function d(e,t){if(null==e)return{};var i,r,o=function(e,t){if(null==e)return{};var i,r,o={},n=Object.keys(e);for(r=0;r<n.length;r++)i=n[r],t.indexOf(i)>=0||(o[i]=e[i]);return o}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)i=n[r],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i])}return o}function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},m.apply(this,arguments)}function g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function x(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?g(Object(i),!0).forEach((function(t){h(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function h(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function b(e){return e&&e.map(((e,t)=>i.createElement(e.tag,x({key:t},e.attr),b(e.child))))}function f(e){return t=>i.createElement(M,m({attr:x({},e.attr)},t),b(e.child))}function M(e){var t=t=>{var r,{attr:o,size:n,title:s}=e,l=d(e,p),a=n||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),i.createElement("svg",m({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,l,{className:r,style:x(x({color:e.color||t.color},t.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&i.createElement("title",null,s),e.children)};return void 0!==c?i.createElement(c.Consumer,null,(e=>t(e))):t(u)}function v(e){return f({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13.293 6.293 7.586 12l5.707 5.707 1.414-1.414L10.414 12l4.293-4.293z"},child:[]}]})(e)}function j(e){return f({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10.707 17.707 16.414 12l-5.707-5.707-1.414 1.414L13.586 12l-4.293 4.293z"},child:[]}]})(e)}function y(e){return f({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5 11h14v2H5z"},child:[]}]})(e)}function P(e){return f({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"},child:[]}]})(e)}const w=r.input`
|
|
2
2
|
margin: 4px 10px 4px 6px;
|
|
3
3
|
border-radius: 10px;
|
|
4
4
|
border: 1px solid #373739;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
border-color: red;
|
|
18
18
|
`}
|
|
19
19
|
}
|
|
20
|
-
`;const L="rgba(38, 39, 41, 0.3)";function E({width:r,height:o,midPrice:a,pmmModel:u,params:c,baseTokenSymbol:p,quoteTokenSymbol:d,baseMinAndZoomMultiples:m,colorMap:g,setBaseMinAndZoomMultiples:x}){const h=t.merge({grid:"#2A2A2D",midPriceLine:"#313335",leftBg:[0,L,1,"#31645d"],leftLine:"#55f6db",leftColor:"",rightBg:[0,L,1,"#67303d"],rightLine:"#ff4f73",rightColor:"",tooltipBg:"#121212",tooltipColor:void 0},g),
|
|
20
|
+
`;const L="rgba(38, 39, 41, 0.3)";function E({width:r,height:o,midPrice:a,pmmModel:u,params:c,baseTokenSymbol:p,quoteTokenSymbol:d,baseMinAndZoomMultiples:m,colorMap:g,setBaseMinAndZoomMultiples:x}){const h=t.merge({grid:"#2A2A2D",midPriceLine:"#313335",leftBg:[0,L,1,"#31645d"],leftLine:"#55f6db",leftColor:"",rightBg:[0,L,1,"#67303d"],rightLine:"#ff4f73",rightColor:"",tooltipBg:"#121212",tooltipColor:void 0},g),b=r,f=o-18,M=b/7,{buyBaseVert:v,sellBaseVert:j}=s.computeBaseVert({midPrice:a,q:c.q,q0:c.q0,pmmModel:u}),y=v.div(f),P=j.div(f),w=i.useRef(null),E=i.useRef(null),{current:q}=w,z=i.useRef(0),B=i.useRef(),{horizontalGridLines:k,verticalGridLines:T}=function({chartHeight:e,chartWidth:t,horizontalLineCount:r,verticalLineCount:o}){return i.useMemo((()=>{const i=[],n=e/(r+1),s=[],l=t/o;for(let e=0;e<r;e++){const r=n*(e+1);i.push([0,r,t,r])}for(let t=0;t<o;t++){const i=l*t+l/2;s.push([i,0,i,e])}return{horizontalGridLines:i,verticalGridLines:s}}),[e,t,r,o])}({chartHeight:f,chartWidth:b,horizontalLineCount:9,verticalLineCount:7}),{horizontalLabelTickPoints:R,horizontalLabelTextPoints:C}=function({chartHeight:e,chartWidth:t,xAxisPoints:r,oneXPx:o,baseMinAndZoomMultiples:n}){return i.useMemo((()=>{const i=s.computeXPortion(t,n.zoomMultiples),a=[],u=[];for(let t=0;t<r;t++){a.push([t*o+o/2,e,t*o+o/2,e+4]);const r=i.multipliedBy(t).multipliedBy(o).plus(i.multipliedBy(o/2)).toNumber(),s=n.baseMin.multipliedBy(10**r),c=t*o,p=e+2+4,d=l.formatShortNumber(s);u.push({x:c,y:p,text:d})}return{horizontalLabelTickPoints:a,horizontalLabelTextPoints:u}}),[n.baseMin,n.zoomMultiples,e,t,o,r])}({chartHeight:f,chartWidth:b,xAxisPoints:7,oneXPx:M,baseMinAndZoomMultiples:m}),{quoteLinePoints:S,quoteLineAreaPoints:N,quoteLineAreaLinearGradientEndPointY:O,baseLinePoints:A,baseLineAreaPoints:X,baseLineAreaLinearGradientEndPointY:Z,midPriceLinePoints:W}=function({chartHeight:t,chartWidth:r,midPrice:o,xPoints:n,pmmModel:l,baseMinAndZoomMultiples:a,buyYPortion:u,sellYPortion:c}){return i.useMemo((()=>{const i=[],p=[],d=[],{baseMin:m,zoomMultiples:g}=a,x=s.computeXPortion(r,g),h=2*g,b=new e(h).div(n);let f=new e(Math.log(o.div(m).toNumber())/Math.log(10));f=e.minimum(h,f),f=e.maximum(0,f);for(let r=new e(0);r.lte(f);){const e=m.multipliedBy(10**r.toNumber()),n=s.evalPoint({val:e,model:l,midPrice:o});if(!n.vert.isNaN()){const e=r.div(x).toNumber(),o=t-n.vert.div(u).toNumber();i.push(e,o)}r=r.plus(b)}for(let e=f;e.lte(h);){const i=m.multipliedBy(10**e.toNumber()),r=s.evalPoint({val:i,model:l,midPrice:o});if(!r.vert.isNaN()){const i=e.div(x).toNumber(),o=t-r.vert.div(c).toNumber();p.push(i,o)}e=e.plus(b)}const M=f.div(x).toNumber(),[,v]=i,j=l.k.eq(0);j&&i.push(M,v||t),i.push(M,t),d.push(M,t,M,0);const y=s.evalPoint({val:m.multipliedBy(10**h),model:l,midPrice:o});let P=t;const w=new e(h).div(x).toNumber();return y.vert.isNaN()||(P=t-y.vert.div(c).toNumber()),j&&p.length>=2&&(p.unshift(M,P),p.unshift(M,t)),p.push(w,P),f.lte(0)&&p.unshift(0,t),{quoteLinePoints:i,quoteLineAreaPoints:[0,t,0,v,...i],quoteLineAreaLinearGradientEndPointY:v,baseLinePoints:p,baseLineAreaPoints:[...p,w,t],baseLineAreaLinearGradientEndPointY:P,midPriceLinePoints:d}}),[a,r,n,o,l,t,u,c])}({chartHeight:f,chartWidth:b,midPrice:a,xPoints:50,pmmModel:u,baseMinAndZoomMultiples:m,buyYPortion:y,sellYPortion:P}),F=e=>{var t;const i=e.target;if(i&&q){const e=null===(t=i.getStage())||void 0===t?void 0:t.getPointerPosition();if(e){const{x:t}=e;if(t>b)return void q.hide();s.updateTooltip({x:t,tooltip:q,buyBaseVert:v,sellBaseVert:j,chartWidth:b,chartHeight:f,midPrice:a,pmmModel:u,baseTokenSymbol:p,quoteTokenSymbol:d,baseMinAndZoomMultiples:m,t:s.chartT,isHover:!0,color:h.tooltipColor,leftColor:h.leftLine,rightColor:h.rightLine})}}},H=i.useMemo((()=>t.throttle((e=>{const{target:t}=e,i=t.getStage();if(i){i.container().style.cursor="grabbing";const e=null==i?void 0:i.getPointerPosition();if(e){const t=e.x-z.current;z.current=e.x,B.current=e.x,x((e=>void 0===e.baseMin?e:{baseMin:s.computeBaseMinByDistance({dragDistance:t,prevBaseMin:e.baseMin,chartWidth:b,zoomMultiples:e.zoomMultiples}),zoomMultiples:e.zoomMultiples,targetMarginPriceX:0}))}}}),100)),[b,x]),D=i.useMemo((()=>t.throttle((e=>{e.cancelBubble=!0,e.evt.preventDefault();const t=e.evt.deltaY<0;x((e=>{const i=s.computeZoomMultiplesWhenZoom({zoomIn:t,prevZoomMultiples:e.zoomMultiples});return{baseMin:s.computeBaseAfterZoom({midPrice:a,zoomMultiples:i}),zoomMultiples:i,targetMarginPriceX:e.targetMarginPriceX}}))}),100)),[a,x]);return i.useEffect((()=>{m.targetMarginPriceX>0&&null!==q?s.updateTooltip({x:m.targetMarginPriceX,tooltip:q,buyBaseVert:v,sellBaseVert:j,chartWidth:b,chartHeight:f,midPrice:a,pmmModel:u,baseTokenSymbol:p,quoteTokenSymbol:d,baseMinAndZoomMultiples:m,t:s.chartT,color:h.tooltipColor,leftColor:h.leftLine,rightColor:h.rightLine}):void 0!==B.current&&null!==q&&s.updateTooltip({x:B.current,tooltip:q,buyBaseVert:v,sellBaseVert:j,chartWidth:b,chartHeight:f,midPrice:a,pmmModel:u,baseTokenSymbol:p,quoteTokenSymbol:d,baseMinAndZoomMultiples:m,t:s.chartT,isHover:!0,color:h.tooltipColor,leftColor:h.leftLine,rightColor:h.rightLine})}),[m,p,v,f,b,h.leftLine,h.rightLine,h.tooltipColor,a,u,d,j,q]),l.jsxRuntimeExports.jsxs(n.Stage,{ref:E,width:r,offsetY:-s.chartOffsetYBCToolTip,height:o+s.chartOffsetYBCToolTip,draggable:!0,dragBoundFunc:function(){return{x:this.absolutePosition().x,y:this.absolutePosition().y}},onMouseMove:F,onMouseOver:F,onMouseOut:()=>{q&&q.hide()},onDragStart:function(e){const{target:t}=e,i=t.getStage();if(i){const e=i.getPointerPosition();e&&(z.current=e.x)}},onDragMove:H,onDragEnd:e=>{const{target:t}=e,i=t.getStage();i&&(i.container().style.cursor="pointer")},onWheel:D,children:[l.jsxRuntimeExports.jsxs(n.Layer,{children:[l.jsxRuntimeExports.jsx(n.Rect,{x:0,y:0,width:r,height:f,stroke:h.grid,strokeWidth:1}),k.map(((e,t)=>l.jsxRuntimeExports.jsx(n.Line,{points:e,stroke:h.grid,strokeWidth:1,lineCap:"round",lineJoin:"round",listening:!1},t))),T.map(((e,t)=>l.jsxRuntimeExports.jsx(n.Line,{points:e,stroke:h.grid,strokeWidth:1,lineCap:"round",lineJoin:"round",listening:!1},t))),R.map(((e,t)=>l.jsxRuntimeExports.jsx(n.Line,{points:e,stroke:"#9d9d9d",strokeWidth:1,lineCap:"round",lineJoin:"round",listening:!1},t))),C.map(((e,t)=>l.jsxRuntimeExports.jsx(n.Text,{x:e.x,y:e.y,text:e.text,fontFamily:"Manrope",fontSize:12,fill:"#9d9d9d",width:M,padding:0,align:"center",verticalAlign:"bottom",listening:!1},t))),l.jsxRuntimeExports.jsx(n.Line,{points:N,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:f},fillLinearGradientEndPoint:{x:0,y:O},fillLinearGradientColorStops:h.leftBg}),l.jsxRuntimeExports.jsx(n.Line,{points:S,stroke:h.leftLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1}),l.jsxRuntimeExports.jsx(n.Line,{points:X,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:b,y:f},fillLinearGradientEndPoint:{x:b,y:Z},fillLinearGradientColorStops:h.rightBg}),l.jsxRuntimeExports.jsx(n.Line,{points:A,stroke:h.rightLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1}),l.jsxRuntimeExports.jsx(n.Line,{points:W,stroke:h.midPriceLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]}),l.jsxRuntimeExports.jsxs(n.Layer,{ref:w,visible:!1,listening:!1,children:[l.jsxRuntimeExports.jsx(n.Line,{points:[],stroke:"#ff4f73",strokeWidth:1,lineCap:"round",lineJoin:"round",dash:[4,6],id:"toolTipVertLine"}),l.jsxRuntimeExports.jsx(n.Line,{points:[],stroke:"ff4f73",strokeWidth:1,lineCap:"round",lineJoin:"round",dash:[4,6],id:"toolTipHoriLine"}),l.jsxRuntimeExports.jsx(n.Circle,{x:0,y:0,radius:5,fill:"#FF5072",stroke:"rgba(255, 80, 114, 0.3)",strokeWidth:12,id:"joinCircle"}),l.jsxRuntimeExports.jsxs(n.Label,{x:0,y:0,id:"priceTextLabel",children:[l.jsxRuntimeExports.jsx(n.Tag,{fill:h.tooltipBg,id:"priceTextLabel-tag"}),l.jsxRuntimeExports.jsx(n.Text,{text:"",fontSize:12,fontFamily:"Manrope",padding:4,fill:"#FF5072",id:"priceTextLabel-text"})]}),l.jsxRuntimeExports.jsxs(n.Label,{x:0,y:0,id:"slippageTextLabel",children:[l.jsxRuntimeExports.jsx(n.Tag,{fill:h.tooltipBg,id:"slippageTextLabel-tag"}),l.jsxRuntimeExports.jsx(n.Text,{text:"",fontSize:12,fontFamily:"Manrope",padding:4,fill:"#FF5072",id:"slippageTextLabel-text"})]}),l.jsxRuntimeExports.jsxs(n.Label,{x:0,y:0,id:"toolTip",children:[l.jsxRuntimeExports.jsx(n.Tag,{fill:h.tooltipBg,pointerDirection:"down",pointerWidth:15,pointerHeight:8,cornerRadius:8,lineJoin:"round",id:"toolTip-tag"}),l.jsxRuntimeExports.jsx(n.Text,{text:"-",fontSize:12,lineHeight:17/12,padding:s.labelPadding,fontFamily:"Manrope",fill:"#FFFFFF",id:"toolTip-text"})]})]})]})}const q=r.button`
|
|
21
21
|
margin: 0;
|
|
22
22
|
border: none;
|
|
23
23
|
padding: 0;
|
|
@@ -75,4 +75,4 @@
|
|
|
75
75
|
&:hover {
|
|
76
76
|
color: #fff;
|
|
77
77
|
}
|
|
78
|
-
`;function S({params:t,target:i,isBuy:r=!0}){const o=new e(t.b),n=new e(t.q);let s=new e(t.b0);const l=new e(t.q0),u=new e(t.i),c=new e(t.k),{R:p}=t;1===p&&s.eq(o)&&(s=a.solveQuadraticFunctionForTarget(o,n.minus(l),new e(1).div(u),c));const d=r?o.plus(i):o.minus(i);if(d.lt(s)||o.eq(s)){let t=s.multipliedBy(s).div(d).div(d);return t=new e(1).minus(c).plus(c.multipliedBy(t)),u.multipliedBy(t)}const m=new a.PMMModel;m.RStatus=p,m.B=o,m.B0=s,m.Q=n,m.Q0=l,m.i=u,m.k=c,m.mtFeeRate=new e(0),m.lpFeeRate=new e(0);let g=new e(0);g=r?m.querySellBase(i):m.queryBuyBase(i);const x=r?n.minus(g):n.plus(g);let h=l.multipliedBy(l).div(x).div(x);return h=new e(1).minus(c).plus(c.multipliedBy(h)),u.div(h)}exports.default=({chartId:r,width:o=834,height:n=460,baseTokenSymbol:a,quoteTokenSymbol:u,pmmModel:c,pmmParams:p,midPrice:d=new e(0),colorMap:m,notShowAmountInput:g})=>{(({id:e})=>{i.useEffect((()=>{function t(e){e.preventDefault()}let i=!1;try{const e={get passive(){return i=!0,!1}};window.addEventListener("test",(()=>{}),e),window.removeEventListener("test",(()=>{}))}catch(e){i=!1}const r=document.getElementById(e),o=!!i&&{passive:!1};return null==r||r.addEventListener("wheel",t,o),()=>{null==r||r.removeEventListener("wheel",t)}}),[e])})({id:r});const[x,h]=i.useState(""),[f
|
|
78
|
+
`;function S({params:t,target:i,isBuy:r=!0}){const o=new e(t.b),n=new e(t.q);let s=new e(t.b0);const l=new e(t.q0),u=new e(t.i),c=new e(t.k),{R:p}=t;1===p&&s.eq(o)&&(s=a.solveQuadraticFunctionForTarget(o,n.minus(l),new e(1).div(u),c));const d=r?o.plus(i):o.minus(i);if(d.lt(s)||o.eq(s)){let t=s.multipliedBy(s).div(d).div(d);return t=new e(1).minus(c).plus(c.multipliedBy(t)),u.multipliedBy(t)}const m=new a.PMMModel;m.RStatus=p,m.B=o,m.B0=s,m.Q=n,m.Q0=l,m.i=u,m.k=c,m.mtFeeRate=new e(0),m.lpFeeRate=new e(0);let g=new e(0);g=r?m.querySellBase(i):m.queryBuyBase(i);const x=r?n.minus(g):n.plus(g);let h=l.multipliedBy(l).div(x).div(x);return h=new e(1).minus(c).plus(c.multipliedBy(h)),u.div(h)}exports.default=({chartId:r,width:o=834,height:n=460,baseTokenSymbol:a,quoteTokenSymbol:u,pmmModel:c,pmmParams:p,midPrice:d=new e(0),colorMap:m,notShowAmountInput:g})=>{(({id:e})=>{i.useEffect((()=>{function t(e){e.preventDefault()}let i=!1;try{const e={get passive(){return i=!0,!1}};window.addEventListener("test",(()=>{}),e),window.removeEventListener("test",(()=>{}))}catch(e){i=!1}const r=document.getElementById(e),o=!!i&&{passive:!1};return null==r||r.addEventListener("wheel",t,o),()=>{null==r||r.removeEventListener("wheel",t)}}),[e])})({id:r});const[x,h]=i.useState(""),[b,f]=i.useState(""),[M,L]=i.useState("-"),[q,N]=i.useState("-"),[O,A]=i.useState({baseMin:new e(0),zoomMultiples:s.baseZoomMultiples,targetMarginPriceX:0});i.useEffect((()=>{void 0!==d&&A((e=>({baseMin:s.computeBaseAfterZoom({midPrice:d,zoomMultiples:e.zoomMultiples}),zoomMultiples:e.zoomMultiples,targetMarginPriceX:e.targetMarginPriceX})))}),[d]);const X=i.useMemo((()=>t.debounce((({type:t,amount:i})=>{""===i&&d&&(A({baseMin:s.computeBaseAfterZoom({midPrice:d,zoomMultiples:s.baseZoomMultiples}),zoomMultiples:s.baseZoomMultiples,targetMarginPriceX:0}),"buy"===t?L("-"):N("-"));const r=new e(i);if(!r.lte(0)&&!r.isNaN()&&(null==p?void 0:p.b)&&!r.gte(p.b)&&d)if("buy"===t){const e=S({params:p,target:r});A((i=>{const r=s.beforePriceImpactEffect({currentBaseMinAndZoomMultiples:i,targetPrice:e,midPrice:d,width:o});if(r.isSkip)return{baseMin:i.baseMin,zoomMultiples:i.zoomMultiples,targetMarginPriceX:r.targetX};if(r.targetX>0)return{baseMin:r.baseMin,zoomMultiples:r.zoomMultiples,targetMarginPriceX:r.targetX};const n=s.computeTargetXByTargetPrice({midPrice:d,width:o,type:t,targetPrice:e}),l=n.zoomMultiples.dp(6).toNumber();return{baseMin:s.computeBaseAfterZoom({midPrice:d,zoomMultiples:l}),zoomMultiples:l,targetMarginPriceX:n.targetX}})),L(`${l.formatPercentageNumber({input:e.minus(d).div(d)})}`)}else{const e=function({params:e,target:t}){return S({params:e,target:t,isBuy:!1})}({params:p,target:r});A((i=>{const r=s.beforePriceImpactEffect({currentBaseMinAndZoomMultiples:i,targetPrice:e,midPrice:d,width:o});if(r.isSkip)return{baseMin:i.baseMin,zoomMultiples:i.zoomMultiples,targetMarginPriceX:r.targetX};if(r.targetX>0)return{baseMin:r.baseMin,zoomMultiples:r.zoomMultiples,targetMarginPriceX:r.targetX};const n=s.computeTargetXByTargetPrice({midPrice:d,width:o,type:t,targetPrice:e}),l=n.zoomMultiples.dp(6).toNumber();return{baseMin:s.computeBaseAfterZoom({midPrice:d,zoomMultiples:l}),zoomMultiples:l,targetMarginPriceX:n.targetX}})),N(`+${l.formatPercentageNumber({input:e.minus(d).div(d)})}`)}}),300)),[p,d,o]);i.useEffect((()=>{void 0!==x&&X({type:"buy",amount:x})}),[X,x]),i.useEffect((()=>{void 0!==b&&X({type:"sell",amount:b})}),[X,b]);const Z=e=>{let t=0;t=e?-.1*o:.1*o,A((e=>void 0===e.baseMin?e:{baseMin:s.computeBaseMinByDistance({dragDistance:t,prevBaseMin:e.baseMin,chartWidth:o,zoomMultiples:e.zoomMultiples}),zoomMultiples:e.zoomMultiples,targetMarginPriceX:e.targetMarginPriceX}))},W=e=>{A((t=>{const i=s.computeZoomMultiplesWhenZoom({zoomIn:null!=e&&e,prevZoomMultiples:t.zoomMultiples});return{baseMin:s.computeBaseAfterZoom({midPrice:d,zoomMultiples:i}),zoomMultiples:i,targetMarginPriceX:t.targetMarginPriceX}}))},F=i.useMemo((()=>{if(""===x)return!1;const t=new e(x);return!(!t.lte(0)&&!t.isNaN()&&(null==p?void 0:p.b)&&!t.gte(p.b))}),[x,p]),H=i.useMemo((()=>{if(""===b)return!1;const t=new e(b);return!(!t.lte(0)&&!t.isNaN()&&(null==p?void 0:p.b)&&!t.gte(p.b))}),[b,p]);return l.jsxRuntimeExports.jsxs(z,{id:r,children:[g?"":l.jsxRuntimeExports.jsxs(B,{children:[l.jsxRuntimeExports.jsxs(k,{borderColor:m&&m.grid,children:[s.chartT("pool.chart.buy-amount",{symbol:a}),l.jsxRuntimeExports.jsx(w,{value:x,error:F,onChange:e=>{const t=l.fixedInputStringToFormattedNumber(e.target.value,2);null!==t&&h(t)}}),l.jsxRuntimeExports.jsx(T,{children:s.chartT("pool.chart.price-impact",{amount:M})})]}),l.jsxRuntimeExports.jsxs(k,{borderColor:m&&m.grid,children:[s.chartT("pool.chart.sell-amount",{symbol:a}),l.jsxRuntimeExports.jsx(w,{value:b,error:H,onChange:e=>{const t=l.fixedInputStringToFormattedNumber(e.target.value,2);null!==t&&f(t)}}),l.jsxRuntimeExports.jsx(T,{children:s.chartT("pool.chart.price-impact",{amount:q})})]})]}),void 0!==p&&void 0!==d&&void 0!==c&&void 0!==O.baseMin&&void 0!==d&&l.jsxRuntimeExports.jsx(E,{width:o,height:n,params:p,midPrice:d,pmmModel:c,baseTokenSymbol:a,quoteTokenSymbol:u,baseMinAndZoomMultiples:O,colorMap:m,setBaseMinAndZoomMultiples:A}),l.jsxRuntimeExports.jsxs(R,{className:"operate-btn-wrapper",children:[l.jsxRuntimeExports.jsx(C,{onClick:()=>Z(!0),children:l.jsxRuntimeExports.jsx(v,{})}),l.jsxRuntimeExports.jsx(C,{onClick:()=>W(!1),children:l.jsxRuntimeExports.jsx(y,{})}),l.jsxRuntimeExports.jsx(C,{onClick:()=>W(!0),children:l.jsxRuntimeExports.jsx(P,{})}),l.jsxRuntimeExports.jsx(C,{onClick:()=>Z(!1),children:l.jsxRuntimeExports.jsx(j,{})})]})]})};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("@emotion/styled"),t=require("lodash"),i=require("react"),r=require("./helper-
|
|
1
|
+
"use strict";var e=require("@emotion/styled"),t=require("lodash"),i=require("react"),r=require("./helper-BjElSybD.cjs"),n=require("react-konva"),o=require("./index-CW7dbGMb.cjs"),s=require("bignumber.js"),l=require("@dodoex/api");require("@lingui/core"),require("react-dom"),require("@lingui/react"),require("@dodoex/components"),require("@reown/appkit-utils"),require("@solana/web3.js"),require("@reown/appkit/networks"),require("@ethersproject/bignumber"),require("@tanstack/react-query"),require("zustand"),require("@web3-react/core"),require("@dodoex/dodo-contract-request"),require("@reown/appkit/react"),require("@web3-react/eip1193"),require("@web3-react/walletconnect-v2"),require("@web3-react/metamask"),require("@web3-react/types"),require("axios"),require("@ethersproject/contracts"),require("identicon.js"),require("bitcoinjs-lib"),require("@bitcoinerlab/secp256k1"),require("dayjs"),require("react-transition-group"),require("@dodoex/contract-request"),require("recharts"),require("react-window"),require("jsbi"),require("tiny-invariant"),require("@ethersproject/units"),require("@uniswap/sdk-core"),require("@uniswap/v2-sdk"),require("react-infinite-scroller"),require("d3"),require("rmc-date-picker");const a=e.div`
|
|
2
2
|
height: 100%;
|
|
3
3
|
position: relative;
|
|
4
4
|
`,u=e.div`
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
font-size: 12px;
|
|
10
10
|
line-height: 17px;
|
|
11
11
|
font-weight: 400;
|
|
12
|
-
`,d=36;function g({maxHeight:e,gridAreaHeight:t,value:i}){const r=new s(t).minus(d),n=r.div(e);return r.minus(i.multipliedBy(n)).plus(d).toNumber()}function m({targetPrice:e,areaPoints:t,isLeft:i}){for(let r=0;r<t.length;r++){const n=t[r],o=r<t.length-1?t[r+1]:null;if(!o)return{targetAreaStatPoint:n,targetAreaStatPoints:t};if(i){if(e.lte(n.middlePrice)&&e.gte(o.middlePrice))return{targetAreaStatPoint:n,targetAreaStatPoints:t.slice(0,r+1)}}else if(e.gte(n.middlePrice)&&e.lte(o.middlePrice))return{targetAreaStatPoint:n,targetAreaStatPoints:t.slice(0,r+1)}}return{targetAreaStatPoint:null,targetAreaStatPoints:[]}}function p({x:e,width:t,minXLN10:i,maxXLN10:r}){const n=new s(e).div(t).multipliedBy(r.minus(i)).plus(i);return new s(10**n.toNumber())}function c({width:e,targetLN10:t,minXLN10:i,maxXLN10:r}){return t.minus(i).div(r.minus(i)).multipliedBy(e).toNumber()}function h({target:e}){return new s(Math.log10(e.toNumber()))}const x="rgba(38, 39, 41, 0.3)";function f({width:e,height:a,params:u,baseTokenSymbol:d,quoteTokenSymbol:f,colorMap:L}){const{maxLeftHeight:j,maxRightHeight:b,leftStatAreaPoints:w,rightStatAreaPoints:A,minXLN10:N,maxXLN10:y}=function({params:e}){return i.useMemo((()=>{const t=new s(e.b),i=new s(e.q);let r=new s(e.b0);const n=new s(e.q0),o=new s(e.i),a=new s(e.k),{R:u}=e;1===u&&r.eq(t)&&(r=l.solveQuadraticFunctionForTarget(t,i.minus(n),new s(1).div(o),a));const d=new l.PMMState({i:o,K:a,B:t,Q:i,B0:r,Q0:n,R:u,mtFeeRate:new s(0),lpFeeRate:new s(0)}),g=new l.PMMHelper,m=new s(d.B),p=[],c=[];let h=new s(0),x=new s(0);const f=g.GetMidPrice(d),L=i.gt(0)?t.div(i):new s(1);for(let e=0;e<=250;e++){let t=m.multipliedBy(e/100).multipliedBy(f.multipliedBy(L).multipliedBy(4));0===e&&(t=m.multipliedBy(1e-11));const i=null==g?void 0:g.QuerySellBase(t,d);if(i.isNaN()||!i.gt(0))p.push({giveAmount:t,getAmount:new s(0),price:new s(0)});else{const e=i.div(t);p.push({giveAmount:t,getAmount:i,price:e})}}for(let e=0;e<=250;e++){let t=m.multipliedBy(e/100).multipliedBy(f.multipliedBy(4));0===e&&(t=m.multipliedBy(1e-11));const i=null==g?void 0:g.QuerySellQuote(t,d);if(i.isNaN()||!i.gt(0))c.push({giveAmount:t,getAmount:new s(0),price:new s(0)});else{const e=t.dividedBy(i);c.push({giveAmount:t,getAmount:i,price:e})}}if(p.length<2&&c.length<2)return{leftStatAreaPoints:[],rightStatAreaPoints:[],maxLeftHeight:new s(10).multipliedBy(1.2),maxRightHeight:new s(10).multipliedBy(1.2),middlePriceLN10:new s(0),minXLN10:new s(-1),maxXLN10:new s(1)};const j=[];for(let e=1;e<p.length;e++){const t=p[e],{giveAmount:i,getAmount:r,price:n}=t,o=p[e-1];if(!n.isNaN()&&n.gt(0)&&o){const t=n.minus(o.price).abs(),l=i.minus(o.giveAmount).abs(),a=r.minus(o.getAmount).abs().multipliedBy(l);1===e&&j.push({area:r,price:n,middlePrice:n.plus(t.div(1.1)),rectangleHeight:a.plus(a.multipliedBy(.03))}),j.push({area:r,price:n,middlePrice:n.plus(t.div(2)),rectangleHeight:a}),h=s.max(a,h)}}const b=[];for(let e=1;e<c.length;e++){const t=c[e],{giveAmount:i,getAmount:r,price:n}=t,o=c[e-1],l=o.price,a=o.giveAmount,u=o.getAmount;if(!n.isNaN()&&n.gt(0)&&o){const t=n.minus(l).abs(),o=i.minus(a).abs(),d=r.minus(u).abs().multipliedBy(o);1===e&&b.push({area:r,price:n,middlePrice:n.minus(t.div(1.1)),rectangleHeight:d.plus(d.multipliedBy(.03))}),b.push({area:r,price:n,middlePrice:n.minus(t.div(2)),rectangleHeight:d}),x=s.max(d,x)}}const w=p.length>0?p[p.length-1]:c[0],A=c.length>0?c[0]:p[0],N=c.length>0?c[c.length-1]:p[0],y=w.price,P=N.price,q=A.price,R=new s(Math.log10(q.toNumber()));let v=y.gt(0)?new s(Math.log10(y.toNumber())):new s(-Math.log10(P.toNumber())),S=P.gt(0)?new s(Math.log10(P.toNumber())):new s(-Math.log10(y.toNumber()));const H=s.max(R.minus(v).abs(),S.minus(R).abs());return v=R.minus(H),S=R.plus(H),{leftStatAreaPoints:j,rightStatAreaPoints:b,maxLeftHeight:h.multipliedBy(1.2),maxRightHeight:x.multipliedBy(1.2),minXLN10:v,maxXLN10:S,middlePriceLN10:R}}),[e])}({params:u}),P=a-30.13,q=i.useRef(null),R=t.merge({grid:"#2A2A2D",midPriceLine:"#313335",leftBg:[0,x,1,"#31645d"],leftLine:"#55f6db",leftColor:"",rightBg:[0,x,1,"#67303d"],rightLine:"#ff4f73",rightColor:"",tooltipBg:"#121212",tooltipColor:void 0,textColor:"#606066"},L),v=t=>{var i;const{current:n}=q,s=t.target;if(s&&n){const t=null===(i=s.getStage())||void 0===i?void 0:i.getPointerPosition();if(t){const{x:i}=t,s=e/2;if(Math.abs(i-s)<=2)return;if(i<=2||e-i<=2)return;const l=p({x:i,width:e,minXLN10:N,maxXLN10:y});let a=null,u=[];const x=i<s;if(x){const e=m({areaPoints:w,targetPrice:l,isLeft:x});a=e.targetAreaStatPoint,u=e.targetAreaStatPoints}else{const e=m({areaPoints:A,targetPrice:l,isLeft:x});a=e.targetAreaStatPoint,u=e.targetAreaStatPoints}if(a){const t=h({target:a.middlePrice}),s=c({minXLN10:N,maxXLN10:y,width:e,targetLN10:t}),l=g({maxHeight:x?j:b,gridAreaHeight:P,value:a.rectangleHeight}),m=n.findOne("#tooltip"),p=n.findOne("#toolTipVertLine"),L=n.findOne("#joinCircle"),w=n.findOne("#tooltip-Text"),A=n.findOne("#tooltip-tag"),q=n.findOne("#priceTextLabel"),v=null==q?void 0:q.findOne("#priceTextLabel-text"),S=n.findOne("#area");null==m||m.position({x:s,y:l-5-6}),null==w||w.fill(R.tooltipColor||(x?"#00FAD9":"#FF5072")),null==w||w.text(x?r.chartT("pool.chart.liquidity-chart-buy",{amount:o.formatShortNumber(a.area),symbol:d,price:o.formatShortNumber(a.price)}):r.chartT("pool.chart.liquidity-chart-sell",{amount:o.formatShortNumber(a.area),symbol:f,price:o.formatShortNumber(a.price)})),m&&A&&(m.width()/2>i?(A.pointerDirection("left"),A.pointerHeight(15),A.pointerWidth(8),m.offsetX(-11),m.offsetY(-11)):m.width()/2+i>e?(A.pointerDirection("right"),A.pointerHeight(15),A.pointerWidth(8),m.offsetX(11),m.offsetY(-11)):(A.pointerDirection("down"),A.pointerHeight(8),A.pointerWidth(15),m.offsetX(0),m.offsetY(0))),null==p||p.points([s,P,s,l]),null==p||p.stroke(x?"#55f6db":"#ff4f73");let H=x?"rgb(86, 246, 218)":"#FF5072",E=x?"rgba(86, 246, 218, 0.3)":"rgba(255, 80, 114, 0.3)";R.leftLine&&R.rightLine&&(H=x?R.leftLine:R.rightLine,E=x?`rgba(${r.colorRgb(R.leftLine)}, 0.4)`:`rgba(${r.colorRgb(R.rightLine)}, 0.4)`),L&&(L.x(s),L.y(l),L.fill(H),L.stroke(E)),q&&(q.x(s),q.y(P+8.08+1),q.offsetX(q.width()/2),q.x()-q.width()/2<0?q.x(q.width()/2):q.x()+q.width()/2>e?q.x(e-q.width()/2):q.x(i)),v&&(v.fill(R.tooltipColor||(x?"#00FAD9":"#FF5072")),v.text(o.formatShortNumber(a.price)));const k=[];for(const t of u){const{middlePrice:i,rectangleHeight:r}=t,n=h({target:i}),o=c({minXLN10:N,maxXLN10:y,width:e,targetLN10:n}),s=g({maxHeight:x?j:b,gridAreaHeight:P,value:r});k.push(o,s+1)}const X=k.slice(),[M,B]=X;x?(X.push(s,l),X.push(s,P),X.push(M,P),X.push(M,B)):(X.unshift(M,P),X.unshift(s,P),X.unshift(s,l)),S&&(S.points(X),S.fill(x?R.leftLine||"#2c5b56":R.rightLine||"#7b3a48")),n.show()}}}},S=function({gridAreaHeight:e,gridAreaWidth:t,horizontalLineCount:r,verticalLineCount:s,color:l="#2A2A2D"}){return i.useMemo((()=>{const i=[],a=e/(r+1),u=[],d=t/(s+1);for(let e=0;e<r;e++){const r=a*(e+1);i.push([0,r,t,r])}for(let t=0;t<s;t++){const i=d*(t+1);u.push([i,0,i,e])}return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[i.map(((e,t)=>o.jsxRuntimeExports.jsx(n.Line,{points:e,stroke:l,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1},t))),u.map(((e,t)=>o.jsxRuntimeExports.jsx(n.Line,{points:e,stroke:l,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1},t)))]})}),[e,t,r,s,l])}({gridAreaHeight:P,gridAreaWidth:e,horizontalLineCount:9,verticalLineCount:7,color:R.grid}),H=function({minXLN10:e,maxXLN10:t,labelCount:r,gridAreaHeight:s,gridAreaWidth:l,color:a="#606066"}){return i.useMemo((()=>{const i=l/(r+1),u=[],d=[];for(let n=0;n<r;n++){const r=i/2+i*n;u.push({x:r,y:s+10.08+1,text:o.formatShortNumber(p({x:i*(n+1),width:l,minXLN10:e,maxXLN10:t}))});const a=i*(n+1);d.push([a,s+1,a,s+4+1])}return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[u.map(((e,t)=>o.jsxRuntimeExports.jsx(n.Text,{x:e.x,y:e.y,text:e.text,fontSize:14,fontFamily:"Manrope",fill:a,width:i,padding:0,align:"center",verticalAlign:"bottom",listening:!1},t))),d.map(((e,t)=>o.jsxRuntimeExports.jsx(n.Line,{points:e,stroke:a,strokeWidth:1,lineCap:"butt",lineJoin:"miter",tension:1,listening:!1},t)))]})}),[e,t,s,l,r])}({gridAreaHeight:P,gridAreaWidth:e,labelCount:7,minXLN10:N,maxXLN10:y,color:R.textColor}),E=function({gridAreaHeight:e,gridAreaWidth:t,color:r="#606066"}){return i.useMemo((()=>{const i=t/2;return o.jsxRuntimeExports.jsx(n.Line,{points:[i,0,i,e-1],stroke:r,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1})}),[e,t,r])}({gridAreaHeight:P,gridAreaWidth:e,color:R.midPriceLine}),{leftLine:k,rightLine:X}=function({leftStatAreaPoints:e,rightStatAreaPoints:t,minXLN10:r,maxXLN10:s,maxLeftHeight:l,maxRightHeight:a,gridAreaWidth:u,gridAreaHeight:d,colorMap:m}){return{leftLine:i.useMemo((()=>{if(e.length<1)return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{});const t=[];let i=d;for(const n of e){const{middlePrice:e,rectangleHeight:o}=n,a=h({target:e}),m=c({minXLN10:r,maxXLN10:s,width:u,targetLN10:a}),p=g({maxHeight:l,gridAreaHeight:d,value:o});t.push(m,p),p<i&&(i=p)}const a=t.slice(),[p,x]=a,f=a[a.length-1],L=a[a.length-2];return a.push(L,f),a.push(L,d),a.push(p,d),a.push(p,x),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(n.Line,{points:a,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:d},fillLinearGradientEndPoint:{x:0,y:i},fillLinearGradientColorStops:m.leftBg}),o.jsxRuntimeExports.jsx(n.Line,{points:t,stroke:m.leftLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]})}),[e,u,r,s,d,l]),rightLine:i.useMemo((()=>{if(t.length<1)return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{});const e=[];let i=d;for(const n of t){const{middlePrice:t,rectangleHeight:o}=n,l=h({target:t}),m=c({minXLN10:r,maxXLN10:s,width:u,targetLN10:l}),p=g({maxHeight:a,gridAreaHeight:d,value:o});e.push(m,p),p<i&&(i=p)}const l=e.slice(),[p]=l;return l.unshift(p,d),l.unshift(u,d),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(n.Line,{points:l,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:d},fillLinearGradientEndPoint:{x:0,y:i},fillLinearGradientColorStops:m.rightBg}),o.jsxRuntimeExports.jsx(n.Line,{points:e,stroke:m.rightLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]})}),[t,u,r,s,d,a])}}({leftStatAreaPoints:w,rightStatAreaPoints:A,minXLN10:N,maxXLN10:y,maxLeftHeight:j,maxRightHeight:b,gridAreaWidth:e,gridAreaHeight:P,colorMap:R});return o.jsxRuntimeExports.jsxs(n.Stage,{width:e,height:a,onMouseMove:v,onMouseOver:v,onMouseEnter:v,onMouseOut:()=>{const{current:e}=q;e&&e.hide()},children:[o.jsxRuntimeExports.jsxs(n.Layer,{children:[o.jsxRuntimeExports.jsx(n.Rect,{x:0,y:0,width:e,height:P,stroke:R.grid,strokeWidth:1}),S,H,k,X,E]}),o.jsxRuntimeExports.jsxs(n.Layer,{ref:q,visible:!1,children:[o.jsxRuntimeExports.jsx(n.Line,{points:[],closed:!0,listening:!1,lineCap:"round",lineJoin:"round",id:"area"}),o.jsxRuntimeExports.jsx(n.Line,{points:[],strokeWidth:1,stroke:"#ff4f73",lineJoin:"round",lineCap:"round",dash:[4,6],id:"toolTipVertLine"}),o.jsxRuntimeExports.jsx(n.Circle,{x:0,y:0,radius:5,fill:"#FF5072",stroke:"rgba(255, 80, 114, 0.3)",strokeWidth:12,id:"joinCircle"}),o.jsxRuntimeExports.jsxs(n.Label,{listening:!1,x:0,y:0,id:"priceTextLabel",children:[o.jsxRuntimeExports.jsx(n.Tag,{fill:R.tooltipBg,id:"priceTextLabel-tag"}),o.jsxRuntimeExports.jsx(n.Text,{text:"-",fontSize:14,fontFamily:"Manrope",padding:2,fill:"#FF5072",id:"priceTextLabel-text"})]}),o.jsxRuntimeExports.jsxs(n.Label,{listening:!1,id:"tooltip",children:[o.jsxRuntimeExports.jsx(n.Tag,{fill:R.tooltipBg,pointerDirection:"down",pointerWidth:15,pointerHeight:8,cornerRadius:8,lineJoin:"round",id:"tooltip-tag"}),o.jsxRuntimeExports.jsx(n.Text,{text:"",fontFamily:"Manrope",fontSize:12,lineHeight:17/12,padding:r.labelPadding,fill:"#FF5072",id:"tooltip-Text"})]})]})]})}exports.default=({width:e=834,height:t=462,baseTokenSymbol:i,quoteTokenSymbol:n,pmmModel:s,pmmParams:l,midPrice:d,notShowTipText:g,colorMap:m})=>o.jsxRuntimeExports.jsxs(a,{children:[void 0!==l&&void 0!==d&&void 0!==s&&void 0!==d&&o.jsxRuntimeExports.jsx(f,{width:e,height:t,params:l,midPrice:d,pmmModel:s,baseTokenSymbol:i,quoteTokenSymbol:n,colorMap:m}),g?"":o.jsxRuntimeExports.jsxs(u,{children:["* ",r.chartT("pool.chart.liquidity-chart-tip",{baseTokenSymbol:i})]})]});
|
|
12
|
+
`,d=36;function g({maxHeight:e,gridAreaHeight:t,value:i}){const r=new s(t).minus(d),n=r.div(e);return r.minus(i.multipliedBy(n)).plus(d).toNumber()}function m({targetPrice:e,areaPoints:t,isLeft:i}){for(let r=0;r<t.length;r++){const n=t[r],o=r<t.length-1?t[r+1]:null;if(!o)return{targetAreaStatPoint:n,targetAreaStatPoints:t};if(i){if(e.lte(n.middlePrice)&&e.gte(o.middlePrice))return{targetAreaStatPoint:n,targetAreaStatPoints:t.slice(0,r+1)}}else if(e.gte(n.middlePrice)&&e.lte(o.middlePrice))return{targetAreaStatPoint:n,targetAreaStatPoints:t.slice(0,r+1)}}return{targetAreaStatPoint:null,targetAreaStatPoints:[]}}function c({x:e,width:t,minXLN10:i,maxXLN10:r}){const n=new s(e).div(t).multipliedBy(r.minus(i)).plus(i);return new s(10**n.toNumber())}function p({width:e,targetLN10:t,minXLN10:i,maxXLN10:r}){return t.minus(i).div(r.minus(i)).multipliedBy(e).toNumber()}function h({target:e}){return new s(Math.log10(e.toNumber()))}const x="rgba(38, 39, 41, 0.3)";function f({width:e,height:a,params:u,baseTokenSymbol:d,quoteTokenSymbol:f,colorMap:L}){const{maxLeftHeight:b,maxRightHeight:j,leftStatAreaPoints:w,rightStatAreaPoints:A,minXLN10:N,maxXLN10:y}=function({params:e}){return i.useMemo((()=>{const t=new s(e.b),i=new s(e.q);let r=new s(e.b0);const n=new s(e.q0),o=new s(e.i),a=new s(e.k),{R:u}=e;1===u&&r.eq(t)&&(r=l.solveQuadraticFunctionForTarget(t,i.minus(n),new s(1).div(o),a));const d=new l.PMMState({i:o,K:a,B:t,Q:i,B0:r,Q0:n,R:u,mtFeeRate:new s(0),lpFeeRate:new s(0)}),g=new l.PMMHelper,m=new s(d.B),c=[],p=[];let h=new s(0),x=new s(0);const f=g.GetMidPrice(d),L=i.gt(0)?t.div(i):new s(1);for(let e=0;e<=250;e++){let t=m.multipliedBy(e/100).multipliedBy(f.multipliedBy(L).multipliedBy(4));0===e&&(t=m.multipliedBy(1e-11));const i=null==g?void 0:g.QuerySellBase(t,d);if(i.isNaN()||!i.gt(0))c.push({giveAmount:t,getAmount:new s(0),price:new s(0)});else{const e=i.div(t);c.push({giveAmount:t,getAmount:i,price:e})}}for(let e=0;e<=250;e++){let t=m.multipliedBy(e/100).multipliedBy(f.multipliedBy(4));0===e&&(t=m.multipliedBy(1e-11));const i=null==g?void 0:g.QuerySellQuote(t,d);if(i.isNaN()||!i.gt(0))p.push({giveAmount:t,getAmount:new s(0),price:new s(0)});else{const e=t.dividedBy(i);p.push({giveAmount:t,getAmount:i,price:e})}}if(c.length<2&&p.length<2)return{leftStatAreaPoints:[],rightStatAreaPoints:[],maxLeftHeight:new s(10).multipliedBy(1.2),maxRightHeight:new s(10).multipliedBy(1.2),middlePriceLN10:new s(0),minXLN10:new s(-1),maxXLN10:new s(1)};const b=[];for(let e=1;e<c.length;e++){const t=c[e],{giveAmount:i,getAmount:r,price:n}=t,o=c[e-1];if(!n.isNaN()&&n.gt(0)&&o){const t=n.minus(o.price).abs(),l=i.minus(o.giveAmount).abs(),a=r.minus(o.getAmount).abs().multipliedBy(l);1===e&&b.push({area:r,price:n,middlePrice:n.plus(t.div(1.1)),rectangleHeight:a.plus(a.multipliedBy(.03))}),b.push({area:r,price:n,middlePrice:n.plus(t.div(2)),rectangleHeight:a}),h=s.max(a,h)}}const j=[];for(let e=1;e<p.length;e++){const t=p[e],{giveAmount:i,getAmount:r,price:n}=t,o=p[e-1],l=o.price,a=o.giveAmount,u=o.getAmount;if(!n.isNaN()&&n.gt(0)&&o){const t=n.minus(l).abs(),o=i.minus(a).abs(),d=r.minus(u).abs().multipliedBy(o);1===e&&j.push({area:r,price:n,middlePrice:n.minus(t.div(1.1)),rectangleHeight:d.plus(d.multipliedBy(.03))}),j.push({area:r,price:n,middlePrice:n.minus(t.div(2)),rectangleHeight:d}),x=s.max(d,x)}}const w=c.length>0?c[c.length-1]:p[0],A=p.length>0?p[0]:c[0],N=p.length>0?p[p.length-1]:c[0],y=w.price,P=N.price,q=A.price,R=new s(Math.log10(q.toNumber()));let v=y.gt(0)?new s(Math.log10(y.toNumber())):new s(-Math.log10(P.toNumber())),S=P.gt(0)?new s(Math.log10(P.toNumber())):new s(-Math.log10(y.toNumber()));const H=s.max(R.minus(v).abs(),S.minus(R).abs());return v=R.minus(H),S=R.plus(H),{leftStatAreaPoints:b,rightStatAreaPoints:j,maxLeftHeight:h.multipliedBy(1.2),maxRightHeight:x.multipliedBy(1.2),minXLN10:v,maxXLN10:S,middlePriceLN10:R}}),[e])}({params:u}),P=a-30.13,q=i.useRef(null),R=t.merge({grid:"#2A2A2D",midPriceLine:"#313335",leftBg:[0,x,1,"#31645d"],leftLine:"#55f6db",leftColor:"",rightBg:[0,x,1,"#67303d"],rightLine:"#ff4f73",rightColor:"",tooltipBg:"#121212",tooltipColor:void 0,textColor:"#606066"},L),v=t=>{var i;const{current:n}=q,s=t.target;if(s&&n){const t=null===(i=s.getStage())||void 0===i?void 0:i.getPointerPosition();if(t){const{x:i}=t,s=e/2;if(Math.abs(i-s)<=2)return;if(i<=2||e-i<=2)return;const l=c({x:i,width:e,minXLN10:N,maxXLN10:y});let a=null,u=[];const x=i<s;if(x){const e=m({areaPoints:w,targetPrice:l,isLeft:x});a=e.targetAreaStatPoint,u=e.targetAreaStatPoints}else{const e=m({areaPoints:A,targetPrice:l,isLeft:x});a=e.targetAreaStatPoint,u=e.targetAreaStatPoints}if(a){const t=h({target:a.middlePrice}),s=p({minXLN10:N,maxXLN10:y,width:e,targetLN10:t}),l=g({maxHeight:x?b:j,gridAreaHeight:P,value:a.rectangleHeight}),m=n.findOne("#tooltip"),c=n.findOne("#toolTipVertLine"),L=n.findOne("#joinCircle"),w=n.findOne("#tooltip-Text"),A=n.findOne("#tooltip-tag"),q=n.findOne("#priceTextLabel"),v=null==q?void 0:q.findOne("#priceTextLabel-text"),S=n.findOne("#area");null==m||m.position({x:s,y:l-5-6}),null==w||w.fill(R.tooltipColor||(x?"#00FAD9":"#FF5072")),null==w||w.text(x?r.chartT("pool.chart.liquidity-chart-buy",{amount:o.formatShortNumber(a.area),symbol:d,price:o.formatShortNumber(a.price)}):r.chartT("pool.chart.liquidity-chart-sell",{amount:o.formatShortNumber(a.area),symbol:f,price:o.formatShortNumber(a.price)})),m&&A&&(m.width()/2>i?(A.pointerDirection("left"),A.pointerHeight(15),A.pointerWidth(8),m.offsetX(-11),m.offsetY(-11)):m.width()/2+i>e?(A.pointerDirection("right"),A.pointerHeight(15),A.pointerWidth(8),m.offsetX(11),m.offsetY(-11)):(A.pointerDirection("down"),A.pointerHeight(8),A.pointerWidth(15),m.offsetX(0),m.offsetY(0))),null==c||c.points([s,P,s,l]),null==c||c.stroke(x?"#55f6db":"#ff4f73");let H=x?"rgb(86, 246, 218)":"#FF5072",E=x?"rgba(86, 246, 218, 0.3)":"rgba(255, 80, 114, 0.3)";R.leftLine&&R.rightLine&&(H=x?R.leftLine:R.rightLine,E=x?`rgba(${r.colorRgb(R.leftLine)}, 0.4)`:`rgba(${r.colorRgb(R.rightLine)}, 0.4)`),L&&(L.x(s),L.y(l),L.fill(H),L.stroke(E)),q&&(q.x(s),q.y(P+8.08+1),q.offsetX(q.width()/2),q.x()-q.width()/2<0?q.x(q.width()/2):q.x()+q.width()/2>e?q.x(e-q.width()/2):q.x(i)),v&&(v.fill(R.tooltipColor||(x?"#00FAD9":"#FF5072")),v.text(o.formatShortNumber(a.price)));const k=[];for(const t of u){const{middlePrice:i,rectangleHeight:r}=t,n=h({target:i}),o=p({minXLN10:N,maxXLN10:y,width:e,targetLN10:n}),s=g({maxHeight:x?b:j,gridAreaHeight:P,value:r});k.push(o,s+1)}const X=k.slice(),[M,B]=X;x?(X.push(s,l),X.push(s,P),X.push(M,P),X.push(M,B)):(X.unshift(M,P),X.unshift(s,P),X.unshift(s,l)),S&&(S.points(X),S.fill(x?R.leftLine||"#2c5b56":R.rightLine||"#7b3a48")),n.show()}}}},S=function({gridAreaHeight:e,gridAreaWidth:t,horizontalLineCount:r,verticalLineCount:s,color:l="#2A2A2D"}){return i.useMemo((()=>{const i=[],a=e/(r+1),u=[],d=t/(s+1);for(let e=0;e<r;e++){const r=a*(e+1);i.push([0,r,t,r])}for(let t=0;t<s;t++){const i=d*(t+1);u.push([i,0,i,e])}return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[i.map(((e,t)=>o.jsxRuntimeExports.jsx(n.Line,{points:e,stroke:l,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1},t))),u.map(((e,t)=>o.jsxRuntimeExports.jsx(n.Line,{points:e,stroke:l,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1},t)))]})}),[e,t,r,s,l])}({gridAreaHeight:P,gridAreaWidth:e,horizontalLineCount:9,verticalLineCount:7,color:R.grid}),H=function({minXLN10:e,maxXLN10:t,labelCount:r,gridAreaHeight:s,gridAreaWidth:l,color:a="#606066"}){return i.useMemo((()=>{const i=l/(r+1),u=[],d=[];for(let n=0;n<r;n++){const r=i/2+i*n;u.push({x:r,y:s+10.08+1,text:o.formatShortNumber(c({x:i*(n+1),width:l,minXLN10:e,maxXLN10:t}))});const a=i*(n+1);d.push([a,s+1,a,s+4+1])}return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[u.map(((e,t)=>o.jsxRuntimeExports.jsx(n.Text,{x:e.x,y:e.y,text:e.text,fontSize:14,fontFamily:"Manrope",fill:a,width:i,padding:0,align:"center",verticalAlign:"bottom",listening:!1},t))),d.map(((e,t)=>o.jsxRuntimeExports.jsx(n.Line,{points:e,stroke:a,strokeWidth:1,lineCap:"butt",lineJoin:"miter",tension:1,listening:!1},t)))]})}),[e,t,s,l,r])}({gridAreaHeight:P,gridAreaWidth:e,labelCount:7,minXLN10:N,maxXLN10:y,color:R.textColor}),E=function({gridAreaHeight:e,gridAreaWidth:t,color:r="#606066"}){return i.useMemo((()=>{const i=t/2;return o.jsxRuntimeExports.jsx(n.Line,{points:[i,0,i,e-1],stroke:r,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1})}),[e,t,r])}({gridAreaHeight:P,gridAreaWidth:e,color:R.midPriceLine}),{leftLine:k,rightLine:X}=function({leftStatAreaPoints:e,rightStatAreaPoints:t,minXLN10:r,maxXLN10:s,maxLeftHeight:l,maxRightHeight:a,gridAreaWidth:u,gridAreaHeight:d,colorMap:m}){return{leftLine:i.useMemo((()=>{if(e.length<1)return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{});const t=[];let i=d;for(const n of e){const{middlePrice:e,rectangleHeight:o}=n,a=h({target:e}),m=p({minXLN10:r,maxXLN10:s,width:u,targetLN10:a}),c=g({maxHeight:l,gridAreaHeight:d,value:o});t.push(m,c),c<i&&(i=c)}const a=t.slice(),[c,x]=a,f=a[a.length-1],L=a[a.length-2];return a.push(L,f),a.push(L,d),a.push(c,d),a.push(c,x),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(n.Line,{points:a,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:d},fillLinearGradientEndPoint:{x:0,y:i},fillLinearGradientColorStops:m.leftBg}),o.jsxRuntimeExports.jsx(n.Line,{points:t,stroke:m.leftLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]})}),[e,u,r,s,d,l]),rightLine:i.useMemo((()=>{if(t.length<1)return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{});const e=[];let i=d;for(const n of t){const{middlePrice:t,rectangleHeight:o}=n,l=h({target:t}),m=p({minXLN10:r,maxXLN10:s,width:u,targetLN10:l}),c=g({maxHeight:a,gridAreaHeight:d,value:o});e.push(m,c),c<i&&(i=c)}const l=e.slice(),[c]=l;return l.unshift(c,d),l.unshift(u,d),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(n.Line,{points:l,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:d},fillLinearGradientEndPoint:{x:0,y:i},fillLinearGradientColorStops:m.rightBg}),o.jsxRuntimeExports.jsx(n.Line,{points:e,stroke:m.rightLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]})}),[t,u,r,s,d,a])}}({leftStatAreaPoints:w,rightStatAreaPoints:A,minXLN10:N,maxXLN10:y,maxLeftHeight:b,maxRightHeight:j,gridAreaWidth:e,gridAreaHeight:P,colorMap:R});return o.jsxRuntimeExports.jsxs(n.Stage,{width:e,height:a,onMouseMove:v,onMouseOver:v,onMouseEnter:v,onMouseOut:()=>{const{current:e}=q;e&&e.hide()},children:[o.jsxRuntimeExports.jsxs(n.Layer,{children:[o.jsxRuntimeExports.jsx(n.Rect,{x:0,y:0,width:e,height:P,stroke:R.grid,strokeWidth:1}),S,H,k,X,E]}),o.jsxRuntimeExports.jsxs(n.Layer,{ref:q,visible:!1,children:[o.jsxRuntimeExports.jsx(n.Line,{points:[],closed:!0,listening:!1,lineCap:"round",lineJoin:"round",id:"area"}),o.jsxRuntimeExports.jsx(n.Line,{points:[],strokeWidth:1,stroke:"#ff4f73",lineJoin:"round",lineCap:"round",dash:[4,6],id:"toolTipVertLine"}),o.jsxRuntimeExports.jsx(n.Circle,{x:0,y:0,radius:5,fill:"#FF5072",stroke:"rgba(255, 80, 114, 0.3)",strokeWidth:12,id:"joinCircle"}),o.jsxRuntimeExports.jsxs(n.Label,{listening:!1,x:0,y:0,id:"priceTextLabel",children:[o.jsxRuntimeExports.jsx(n.Tag,{fill:R.tooltipBg,id:"priceTextLabel-tag"}),o.jsxRuntimeExports.jsx(n.Text,{text:"-",fontSize:14,fontFamily:"Manrope",padding:2,fill:"#FF5072",id:"priceTextLabel-text"})]}),o.jsxRuntimeExports.jsxs(n.Label,{listening:!1,id:"tooltip",children:[o.jsxRuntimeExports.jsx(n.Tag,{fill:R.tooltipBg,pointerDirection:"down",pointerWidth:15,pointerHeight:8,cornerRadius:8,lineJoin:"round",id:"tooltip-tag"}),o.jsxRuntimeExports.jsx(n.Text,{text:"",fontFamily:"Manrope",fontSize:12,lineHeight:17/12,padding:r.labelPadding,fill:"#FF5072",id:"tooltip-Text"})]})]})]})}exports.default=({width:e=834,height:t=462,baseTokenSymbol:i,quoteTokenSymbol:n,pmmModel:s,pmmParams:l,midPrice:d,notShowTipText:g,colorMap:m})=>o.jsxRuntimeExports.jsxs(a,{children:[void 0!==l&&void 0!==d&&void 0!==s&&void 0!==d&&o.jsxRuntimeExports.jsx(f,{width:e,height:t,params:l,midPrice:d,pmmModel:s,baseTokenSymbol:i,quoteTokenSymbol:n,colorMap:m}),g?"":o.jsxRuntimeExports.jsxs(u,{children:["* ",r.chartT("pool.chart.liquidity-chart-tip",{baseTokenSymbol:i})]})]});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import t from"bignumber.js";import{merge as e,throttle as i,debounce as o}from"lodash";import r,{useEffect as n,useMemo as l,useRef as s,useState as a}from"react";import d from"@emotion/styled";import{css as c}from"@emotion/react";import{Stage as u,Layer as p,Rect as m,Line as g,Text as h,Circle as b,Label as f,Tag as M}from"react-konva";import{c as x,e as v,a as y,b as P,d as w,f as j,u as z,g as L,h as k,l as B,i as C,j as S,k as N}from"./helper-
|
|
1
|
+
import t from"bignumber.js";import{merge as e,throttle as i,debounce as o}from"lodash";import r,{useEffect as n,useMemo as l,useRef as s,useState as a}from"react";import d from"@emotion/styled";import{css as c}from"@emotion/react";import{Stage as u,Layer as p,Rect as m,Line as g,Text as h,Circle as b,Label as f,Tag as M}from"react-konva";import{c as x,e as v,a as y,b as P,d as w,f as j,u as z,g as L,h as k,l as B,i as C,j as S,k as N}from"./helper-D2gRfZE2.js";import{f as O,j as X,a as T,b as A}from"./index-DeShJXSX.js";import{solveQuadraticFunctionForTarget as q,PMMModel as W}from"@dodoex/api";import"@lingui/core";import"react-dom";import"@lingui/react";import"@dodoex/components";import"@reown/appkit-utils";import"@solana/web3.js";import"@reown/appkit/networks";import"@ethersproject/bignumber";import"@tanstack/react-query";import"zustand";import"@web3-react/core";import"@dodoex/dodo-contract-request";import"@reown/appkit/react";import"@web3-react/eip1193";import"@web3-react/walletconnect-v2";import"@web3-react/metamask";import"@web3-react/types";import"axios";import"@ethersproject/contracts";import"identicon.js";import"bitcoinjs-lib";import"@bitcoinerlab/secp256k1";import"dayjs";import"react-transition-group";import"@dodoex/contract-request";import"recharts";import"react-window";import"jsbi";import"tiny-invariant";import"@ethersproject/units";import"@uniswap/sdk-core";import"@uniswap/v2-sdk";import"react-infinite-scroller";import"d3";import"rmc-date-picker";var E={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},F=r.createContext&&r.createContext(E),H=["attr","size","title"];function Z(t,e){if(null==t)return{};var i,o,r=function(t,e){if(null==t)return{};var i,o,r={},n=Object.keys(t);for(o=0;o<n.length;o++)i=n[o],e.indexOf(i)>=0||(r[i]=t[i]);return r}(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(o=0;o<n.length;o++)i=n[o],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}function G(){return G=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},G.apply(this,arguments)}function D(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function J(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?D(Object(i),!0).forEach((function(e){V(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function V(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,e||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Y(t){return t&&t.map(((t,e)=>r.createElement(t.tag,J({key:e},t.attr),Y(t.child))))}function I(t){return e=>r.createElement(R,G({attr:J({},t.attr)},e),Y(t.child))}function R(t){var e=e=>{var i,{attr:o,size:n,title:l}=t,s=Z(t,H),a=n||e.size||"1em";return e.className&&(i=e.className),t.className&&(i=(i?i+" ":"")+t.className),r.createElement("svg",G({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,o,s,{className:i,style:J(J({color:t.color||e.color},e.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),l&&r.createElement("title",null,l),t.children)};return void 0!==F?r.createElement(F.Consumer,null,(t=>e(t))):e(E)}function $(t){return I({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13.293 6.293 7.586 12l5.707 5.707 1.414-1.414L10.414 12l4.293-4.293z"},child:[]}]})(t)}function Q(t){return I({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10.707 17.707 16.414 12l-5.707-5.707-1.414 1.414L13.586 12l-4.293 4.293z"},child:[]}]})(t)}function K(t){return I({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5 11h14v2H5z"},child:[]}]})(t)}function U(t){return I({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"},child:[]}]})(t)}const _=d.input`
|
|
2
2
|
margin: 4px 10px 4px 6px;
|
|
3
3
|
border-radius: 10px;
|
|
4
4
|
border: 1px solid #373739;
|