(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4681],{3226:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/cryptoFearAndGreed",function(){return a(8451)}])},8451:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return CryptoFearAndGreed}});var i=a(5893),l=a(9008),n=a.n(l),r=a(7294),s=a(7626),o=a(5912),c=a(6005),d=a(6720),x=a(1526),m=a(2379),h=a(9599),p=a(2171),f=a(6204);function CryptoFearAndGreed(){let e;let[t,a]=(0,r.useState)(0),[l,o]=(0,r.useState)({}),[g,u]=(0,r.useState)(new Date().getFullYear()),[w,y]=(0,r.useState)(0),[b,v]=(0,r.useState)(!0),[j,C]=(0,r.useState)(!1),[S,T]=(0,r.useState)(!0),[E,N]=(0,r.useState)("isInfoVisible"),{isFullScreen:k}=(0,m.O)(),[D,R]=(0,r.useState)([]),[A,F]=(0,r.useState)({value:"BTC",label:"BTC",logo:"https://lcw.nyc3.cdn.digitaloceanspaces.com/production/currencies/64/btc.png"}),L=w*Math.PI/180;(e=new Image).src="/assets/images/mainLogoLetters.png";let O=(0,r.useRef)(null);(0,r.useEffect)(()=>{let fetchTokens=async()=>{let e=await fetchAvailableTokens();R(e)};fetchTokens()},[]);let handleTokenChange=e=>{F(e)};(0,r.useEffect)(()=>{let fetchData=async()=>{let e=await fetch("https://api.alternative.me/fng/?limit=10000"),t=await e.json(),i=Number(t.data[0].value);a(i),y(2*i-90);let l=t.data.map(e=>({...e,date:new Date(1e3*Number(e.timestamp))})),n=l.reduce((e,t)=>{let a=t.date.getFullYear(),i=t.date.getMonth();return e[a]||(e[a]={}),e[a][i]||(e[a][i]=[]),e[a][i].push(t.value_classification),e},{}),r={};for(let e in n)for(let t in r[e]={},n[e]){let a=n[e][t].reduce((e,t)=>(e[t]||(e[t]=0),e[t]++,e),{});r[e][t]=Object.keys(a).reduce((e,t)=>a[e]>a[t]?e:t)}o(r),v(!1)};fetchData()},[]);let handleYearClick=e=>{u(e)},{transform:I}=(0,c.q_)({from:{transform:"rotate(-130deg)"},to:{transform:"rotate(".concat(2*t-90,"deg)")},config:{tension:75,friction:7}});function getStatus(e){return e>=0&&e<=24?"EXTREME FEAR":e>=25&&e<=39?"FEAR":e>=40&&e<=54?"NEUTRAL":e>=55&&e<=75?"GREED":e>=76&&e<=100?"EXTREME GREED":"Invalid index"}function getStatusColor(e){if(!e)return"grey";switch("string"==typeof e&&(e=e.toUpperCase()),e){case"EXTREME FEAR":return"#782727";case"FEAR":return"#C03D3D";case"NEUTRAL":return"#e1b12c";case"GREED":return"#427444";case"EXTREME GREED":return"#253D26";default:return"white"}}let fetchAvailableTokens=async()=>{let e=await fetch("https://api.binance.com/api/v3/ticker/price"),t=await e.json(),a=t.filter(e=>e.symbol.endsWith("USDT")&&"USDT"!==e.symbol).map(e=>{let t=e.symbol.replace("USDT","");return{value:t,label:t,logo:"https://lcw.nyc3.cdn.digitaloceanspaces.com/production/currencies/64/".concat(t.toLowerCase(),".png")}}).sort((e,t)=>e.label.localeCompare(t.label));return console.log("Fetched Tokens:",a),a};(0,r.useEffect)(()=>{let e=window.location.pathname,t="isInfoVisible_".concat(e);N(t);let a=localStorage.getItem(t);null!==a&&T("false"!==a)},[]);let toggleInfo=()=>{let e=!S;localStorage.setItem(E,e.toString()),T(e)};(0,r.useEffect)(()=>{let processData=e=>{let t=[],a=[];e.forEach(e=>{t.push(1e3*e.timestamp),a.push(parseFloat(e.value))});let i=t.map((e,t)=>({date:e,value:a[t]}));i.sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime());let l=i.map(e=>e.date),n=i.map(e=>e.value);return{dates:l,values:n}},fetchAllPriceData=async(e,t,a)=>{let i=[],l=new Date(t).getTime(),n=new Date(a).getTime(),r=e.value+"USDT";for(;l<n;){let e=await fetch("https://api.binance.com/api/v3/klines?symbol=".concat(r,"&interval=1d&startTime=").concat(l,"&endTime=").concat(n,"&limit=1000")),t=await e.json();if(0===t.length)break;i.push(...t),l=t[t.length-1][0]+864e5}return i.map(e=>({date:new Date(e[0]).toISOString().split("T")[0],closePrice:parseFloat(e[4])}))},drawChart=(t,a,i)=>{let l=O.current;if(!l)return;let n=l.getContext("2d"),r=l.parentElement,s=r.clientWidth,o=r.clientHeight;l.width=2*s,l.height=2*o,l.style.width="".concat(s,"px"),l.style.height="".concat(o,"px"),n.scale(2,2),n.clearRect(0,0,l.width,l.height),n.fillStyle="#212125",n.fillRect(0,0,l.width,l.height);let c=(s-40-40)/a.length,d=Math.max(...a),x=Math.min(...a),m=(o-20-20)/(d-x),h=Math.max(...i.map(e=>e.closePrice)),p=Math.min(...i.map(e=>e.closePrice)),f=(o-20-20)/(h-p),g=a.map((e,a)=>{let i=o-20-(e-x)*m+5;return{x:40+a*c,y:i,width:c-1,height:(e-x)*m,date:t[a],value:e}}),drawYAxisLabels=()=>{let e=Math.ceil((d-x)/5);n.fillStyle="lightgrey",n.textAlign="right",n.font="10px Oxanium, Helvetica, Verdana, Tahoma, sans-serif",n.textBaseline="middle";for(let t=x;t<=d;t+=e){let e=o-20-(t-x)*m;n.fillText(t,32,e),t!==x&&(n.strokeStyle="rgba(255, 255, 255, 0.3)",n.lineWidth=.25,n.setLineDash([5,5]),n.beginPath(),n.moveTo(40,e),n.lineTo(s-40,e),n.stroke(),n.setLineDash([]))}},drawBTCPriceLabels=()=>{let e;e=h>500?Math.ceil((h-p)/5):h>1?(h-p)/5:(h-p)/2,n.fillStyle="lightgrey",n.textAlign="left",n.textBaseline="middle";for(let t=p;t<=h;t+=e){let e=o-20-(t-p)*f,a=0;t<1e3&&(a=1),t<500&&(a=2),t<.1&&(a=4),n.fillText("".concat(t.toFixed(a)),s-40+8,e)}},u=window.innerWidth<550,drawXAxisLabels=()=>{n.fillStyle="lightgrey",n.textAlign="center";let e=Math.floor(t.length/(u?3:10));n.font="".concat(8,"px Oxanium, Helvetica, Verdana, Tahoma, sans-serif");for(let a=0;a<t.length;a+=e){let e=new Date(t[a]).toLocaleDateString(),i=40+a*c+c/2-0;n.fillText(e,i,o-5)}},drawAll=()=>{if(drawYAxisLabels(),drawBTCPriceLabels(),drawXAxisLabels(),g.forEach(e=>{let t=getStatus(e.value),a=getStatusColor(t);n.fillStyle=a,n.globalAlpha=1,n.fillRect(e.x,e.y,e.width,e.height)}),i.length>0&&(n.strokeStyle="yellow",n.lineWidth=2,n.beginPath(),i.forEach((e,t)=>{let a=40+t*c+c/2,l=o-20-(e.closePrice-p)*f;if(0===t)n.moveTo(a,l);else{let e=i[t-1],r=40+(t-1)*c+c/2,s=o-20-(e.closePrice-p)*f,d=r+(a-r)/3,x=a-(a-r)/3;n.bezierCurveTo(d,s,x,l,a,l)}}),n.stroke()),e.complete){let t=o-20-30.2;n.globalAlpha=.75,n.drawImage(e,50,t,101.4,30.2),n.globalAlpha=1}};drawAll(),l.addEventListener("mousemove",function(e){let t=l.getBoundingClientRect(),a=e.clientX-t.left,r=e.clientY-t.top,c=document.getElementById("tooltip");if(a<0||a>l.width/2||r<0||r>l.height/2){n.clearRect(0,0,l.width,l.height),drawAll(),c.style.display="none";return}c.style.display="none";let m=g.reduce((e,t)=>{let i=t.x+t.width/2,l=Math.abs(a-i);return l<e.distance?{bar:t,distance:l}:e},{bar:null,distance:1/0}).bar;if(m){var u;let e=m.x+m.width/2;c.style.display="block",c.style.left="".concat(a+10,"px"),c.style.top="".concat(r+10,"px"),a+50+c.offsetWidth>s?c.style.left="".concat(a-c.offsetWidth-60,"px"):c.style.left="".concat(a+10,"px"),r+10+c.offsetHeight>o?c.style.top="".concat(r-c.offsetHeight-10,"px"):c.style.top="".concat(r+10,"px");let t=null===(u=i.find(e=>new Date(e.date).getTime()===new Date(m.date).getTime()))||void 0===u?void 0:u.closePrice;if(c.innerHTML=getTooltipContent(m.date,m.value,t,A),n.save(),n.clearRect(0,0,l.width,l.height),drawAll(),n.restore(),n.strokeStyle="rgba(255, 255, 255, 0.5)",n.setLineDash([5,5]),n.beginPath(),n.moveTo(a,0),n.lineTo(a,o),n.moveTo(0,r),n.lineTo(s,r),n.stroke(),n.setLineDash([]),r<o-20){let e=d-(r-20)*(d-x)/(o-20-20),t="".concat(e.toFixed(1));n.fillStyle="rgba(0, 0, 0, 0.7)";let a=n.measureText(t).width;n.fillRect(40-a-6-25,r-10,a+36,20),n.fillStyle="white",n.textAlign="right",n.font="10px Oxanium, Helvetica, Verdana, Tahoma, sans-serif",n.fillText(t,40,r)}let g=new Date(m.date).toLocaleDateString(),w=n.measureText(g).width,y=o-20+15;if(n.fillStyle="rgba(0, 0, 0, 0.7)",n.fillRect(a-w/2-4-4,y-10,w+16,20),n.fillStyle="white",n.textAlign="center",n.fillText(g,a,y),t){let a=o-20-(t-p)*f;n.fillStyle="#fbbf24",n.strokeStyle="#f4f4f5",n.lineWidth=2,n.beginPath(),n.arc(e,a,5,0,2*Math.PI),n.fill(),n.stroke();let i=h-(r-20)/(o-20-20)*(h-p);r<o-20&&function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-45,i=0;t<1e3&&(i=1),t<500&&(i=2),t<.1&&(i=4);let l="".concat(t.toFixed(i));n.fillStyle="rgba(0, 0, 0, 0.7)";let r=n.measureText(l).width;n.fillRect(s-40-a-r-12,e-10,r+12,20),n.fillStyle="white",n.textAlign="left",n.fillText(l,s-40-a-r-6,e)}(r,i)}setTimeout(()=>{c.classList.remove("hidden"),c.classList.add("visible")},10)}}),l.addEventListener("mouseout",()=>{let e=document.getElementById("tooltip");e.style.display="none",n.clearRect(0,0,l.width,l.height),drawAll()})},initializeChart=async function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];let e=await fetchFNGData(),t=await fetchAllPriceData(A,"2018-02-01",new Date().toISOString().split("T")[0]),{alignedBtcData:a,alignedFngData:i}=alignPriceDataWithDates(t,e),{dates:l,values:n}=processData(i),r=O.current;if(r){let e=r.parentElement,t=e.clientWidth,a=e.clientHeight;r.width=2*t,r.height=2*a,r.style.width="".concat(t,"px"),r.style.height="".concat(a,"px");let i=r.getContext("2d");i.scale(2,2)}drawChart(l,n,a)};initializeChart();let handleResize=()=>{initializeChart()};return window.addEventListener("resize",handleResize),()=>{window.removeEventListener("resize",handleResize)}},[A]);let fetchFNGData=async()=>{let e=await fetch("https://api.alternative.me/fng/?limit=10000"),t=await e.json();return t.data},alignPriceDataWithDates=(e,t)=>{let a=new Set(e.map(e=>e.date)),i=t.filter(e=>a.has(new Date(1e3*e.timestamp).toISOString().split("T")[0]));return{alignedBtcData:e,alignedFngData:i.reverse()}},getTooltipContent=(e,t,a,i)=>{let l=i.value,n=i.logo;return'\n    <div style="display: flex; align-items: center;">\n      <img src="'.concat(n,'" alt="').concat(l,'" style="width: 20px; height: 20px; margin-right: 4px;"/>\n      <div>').concat(l,"</div>\n    </div>\n    <div>Date: ").concat(new Date(e).toLocaleDateString(),"</div>\n    <div>Fear & Greed Index: ").concat(t,"</div>\n    <div>").concat(l," Price: ").concat(a?"$".concat(a.toLocaleString()):"N/A","</div>\n  ")},drawExtraContent=(e,t,a)=>{let i,l,n,r;let s=window.innerWidth;s>640?(i=28,l=14,n=75,r=35):(i=18,l=12,n=47,r=20),e.font="".concat(l,"px Oxanium"),e.fillStyle="#e4e4e7";let o="Created at TradingDigits.io",c=e.measureText(o).width;e.fillText(o,(t-c)/2,r),e.font="".concat(i,"px Oxanium");let d="".concat(a,", ").concat(new Date().toLocaleDateString()),x=e.measureText(d).width;e.fillText(d,(t-x)/2,n)},downloadChart=(e,t)=>{let a=e.current;a.getContext("2d");let i=document.createElement("canvas"),l=a.width+40,n=a.height+20+40+100;i.width=l,i.height=n;let r=i.getContext("2d");r.fillStyle="#212125",r.fillRect(0,0,i.width,i.height),drawExtraContent(r,i.width,t),r.drawImage(a,20,100);let s=document.createElement("a");s.download="".concat(t.replace(/\s+/g,"_").toLowerCase(),".png"),s.href=i.toDataURL("image/png"),s.click()},copyChartToClipboard=async(e,t)=>{let a=e.current;a.getContext("2d");let i=document.createElement("canvas"),l=a.width+40,n=a.height+20+40+100;i.width=l,i.height=n;let r=i.getContext("2d");r.fillStyle="#212125",r.fillRect(0,0,i.width,i.height),drawExtraContent(r,i.width,t),r.drawImage(a,20,100),i.toBlob(async e=>{try{let t=new ClipboardItem({"image/png":e});await navigator.clipboard.write([t]),C(!0),setTimeout(()=>C(!1),1e3)}catch(e){console.error("Failed to copy chart: ",e)}})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(()=>(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(n(),{children:[(0,i.jsx)("title",{children:"Bitcoin Fear and Greed Index: Crypto Market Sentiment"}),(0,i.jsx)("meta",{name:"description",content:"Our crypto Fear and Greed index will help you see the current market sentiment clearer and make better investment and trading decisions"}),(0,i.jsx)("meta",{name:"keywords",content:"crypto, fear, and, greed, index, bitcoin, btc, market, sentiment, today"}),(0,i.jsx)("meta",{property:"og:title",content:"Bitcoin Fear and Greed Index: Crypto Market Sentiment"}),(0,i.jsx)("meta",{property:"og:description",content:"Our crypto Fear and Greed index will help you see the current market sentiment clearer and make better investment and trading decisions"}),(0,i.jsx)("meta",{property:"og:image",content:"https://tradingdigits.io/assets/images/ogImage.jpg"}),(0,i.jsx)("meta",{property:"og:url",content:"https://www.tradingdigits.io/cryptoFearAndGreed"}),(0,i.jsx)("meta",{name:"twitter:title",content:"Bitcoin Fear and Greed Index: Crypto Market Sentiment"}),(0,i.jsx)("meta",{name:"twitter:description",content:"Our crypto Fear and Greed index will help you see the current market sentiment clearer and make better investment and trading decisions"}),(0,i.jsx)("meta",{name:"twitter:image",content:"https://tradingdigits.io/assets/images/ogImage.jpg"}),(0,i.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,i.jsx)("meta",{name:"twitter:image:alt",content:"Promotional image with crypto-related illustration on black background, company name, and catchphrase about Trading Digits"}),(0,i.jsx)("meta",{name:"twitter:site",content:"@trading_digits"}),(0,i.jsx)("link",{rel:"canonical",href:"https://www.tradingdigits.io/cryptoFearAndGreed"})]})}),{}),(0,i.jsx)("div",{className:"mt-10 md:mt-[95px] sm:mt-[90px] mt-[80px]",children:(0,i.jsxs)("div",{className:"pt-2 sm:pt-1 ".concat(b?"h-screen":"h-full"," ").concat(k&&"h-screen"," ").concat(S?"pb-32":"pb-48"," min-[1540px]:h-screen"),children:[(0,i.jsxs)("div",{className:"flex items-center ".concat(S?"lg:justify-start":"lg:justify-center"," justify-center my-1.75 text-center"),children:[(0,i.jsx)("h1",{className:"pl-2 sm:text-2xl text-xl font-[Oxanium-Regular]",children:"BITCOIN FEAR AND GREED INDEX"}),(0,i.jsx)(x.M,{children:!S&&(0,i.jsx)(d.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"ml-3",children:(0,i.jsx)("i",{onClick:toggleInfo,className:"fa-solid fa-circle-info fa-lg text-zinc-200 cursor-pointer hover:text-amber-400 transition duration-300"})})})]}),(0,i.jsx)(x.M,{children:S&&(0,i.jsxs)(d.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"relative px-2 py-2 flex items-center mr-0 bg-[#404142] justify-center w-full ".concat(S?"mb-6":"mb-2"),children:[(0,i.jsx)("i",{className:"fa-solid fa-circle-info fa-2xl mr-3 text-zinc-200"}),(0,i.jsx)("div",{className:"font-[Oxanium-Regular] sm:text-sm text-xs pr-4",children:(0,i.jsx)("p",{children:"This Bitcoin Fear and Greed Index is based upon five different measurements—market volatility, momentum and volume, social media sentiment, BTC Dominance, and Google Trends sentiment—in order to provide you with a clearer picture on the current crypto market feel and make it easier for you to sell at the top and buy at the bottom and not the other way around."})}),(0,i.jsx)("div",{onClick:toggleInfo,className:"absolute top-0 right-0 flex items-start hover:bg-zinc-500 cursor-pointer py-0.5 px-1 transition duration-300",children:(0,i.jsx)("i",{className:"fa-solid fa-xmark"})})]})}),(0,i.jsx)("div",{children:b?(0,i.jsx)("div",{className:"flex w-full items-center justify-center mt-32",children:(0,i.jsx)("img",{src:s.Y.logoLoading,className:"quick-pulse w-48 ",alt:"Loading..."})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex xl:flex-row flex-col w-full px-0.25 font-[Oxanium-Regular] ".concat(S?"mt-16":"mt-12"),children:[(0,i.jsxs)("div",{className:"flex xl:w-1/2 w-full justify-between flex-col text-center ",children:[(0,i.jsx)("h2",{className:"text-2xl font-[Oxanium-Regular] max-[540px]:text-xl max-[470px]:text-lg max-[430px]:text-base xl:mb-0 mb-6",children:"REAL-TIME BTC FEAR AND GREED INDEX"}),(0,i.jsxs)("div",{className:"flex justify-around pb-8",children:[(0,i.jsx)("div",{className:"flex items-center justify-center pb-4",children:(0,i.jsxs)("svg",{viewBox:"-12 5 140 28",className:"sm:w-[320px] sm:h-[200px] w-48 h-36 ",children:[(0,i.jsx)("defs",{children:(0,i.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,i.jsx)("stop",{offset:"0%",style:{stopColor:"#ff0000",stopOpacity:1}}),(0,i.jsx)("stop",{offset:"40%",style:{stopColor:"#F79F1F",stopOpacity:1}}),(0,i.jsx)("stop",{offset:"60%",style:{stopColor:"#F79F1F",stopOpacity:1}}),(0,i.jsx)("stop",{offset:"100%",style:{stopColor:"#009432",stopOpacity:1}})]})}),(0,i.jsx)("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"url(#gradient)",strokeWidth:"9"}),(0,i.jsx)(c.q.path,{d:"M47.5 50 L52.5 50 L52.5 20 L49 20 Z",fill:"white",style:{transform:I,transformOrigin:"50px 50px"}}),(0,i.jsx)("image",{href:s.Y.bitcoinLogoIcon,height:"12",width:"12",x:"44",y:"44"}),(0,i.jsx)("circle",{cx:"50",cy:"-12.25",r:"8",fill:"#384151",stroke:getStatusColor(getStatus(t)),strokeWidth:"1",transform:"rotate(".concat(w,", 50, 50)")}),(0,i.jsx)("text",{x:0*Math.cos(L)- -62.25*Math.sin(L)+50,y:0*Math.sin(L)+-62.25*Math.cos(L)+50+2.2,fill:"white",textAnchor:"middle",fontSize:"7",children:t})]})}),(0,i.jsxs)("div",{className:"flex flex-col justify-around items-center pt-6 max-[500px]:justify-between gap-4",children:[(0,i.jsx)("div",{className:"px-4 lg:py-10 xl:py-4 py-6 bg-zinc-700 border-solid rounded w-32 xl:w-32 lg:w-64 text-lg max-[500px]:w-24",style:{borderColor:getStatusColor(getStatus(t)),borderWidth:"3px",borderStyle:"solid"},children:(0,i.jsx)("p",{className:"lg:text-3xl xl:text-xl text-xl max-[500px]:text-sm font-[Oxanium-Medium]",children:getStatus(t)})}),(0,i.jsx)("div",{className:"px-2 py-4 bg-zinc-700 border-gray-900 rounded text-xs w-32 xl:w-32 lg:w-64 max-[500px]:w-24",children:(0,i.jsx)("p",{className:"lg:text-sm xl:text-xs max-[500px]:text-xxs font-[Oxanium-Regular]",children:"Powered by alternative.me APIs"})})]})]})]}),(0,i.jsx)("div",{className:"self-stretch xl:mb-0 mb-8 border border-1 border-gray-800"}),(0,i.jsxs)("div",{className:"flex xl:w-1/2 w-full justify-center flex-col text-center items-center px-1",children:[(0,i.jsx)("h2",{className:"text-2xl font-[Oxanium-Regular] mb-6 max-[540px]:text-xl max-[470px]:text-lg max-[430px]:text-base",children:"MONTHLY HISTORICAL PERFORMANCE"}),(0,i.jsx)("div",{className:"mb-4 flex justify-between xl:w-5/6 w-full 2xl:text-base xl:text-sm max-[520px]:text-xs ",children:[2018,2019,2020,2021,2022,2023,2024].map(e=>(0,i.jsx)("button",{className:"px-3 py-2 max-[480px]:px-2.5 transition font-[Oxanium-Regular] ".concat(e===g?"bg-zinc-700 text-white border-2 border-zinc-500":"bg-zinc-700 text-white hover:bg-gray-500 "),onClick:()=>handleYearClick(e),children:e},e))}),(0,i.jsx)("div",{className:"flex flex-wrap justify-between xl:w-5/6 w-full font-[Oxanium-Light]",children:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"].map((e,t)=>(0,i.jsxs)("div",{className:"w-1/4 h-20 p-2 flex items-center justify-between text-center overflow-hidden hover:brightness-110 transition border-[#0f0f0f] border",style:{backgroundColor:getStatusColor(l[g]&&l[g][t])},children:[(0,i.jsx)("h3",{className:"font-medium text-xs writing-vertical-rl",children:e}),(0,i.jsx)("div",{className:"flex-grow flex items-center justify-center",children:(0,i.jsx)("p",{className:"uppercase px-3 py-4 text-md font-[Oxanium-SemiBold] xl:text-sm 2xl:text-base sm:text-base text-xs max-[480px]:text-xxs",children:l[g]&&l[g][t]})})]},e))})]})]}),(0,i.jsx)("div",{className:"flex flex-col items-center w-full mt-10 max-[450px]:mt-16",children:(0,i.jsxs)("div",{className:"sm:w-5/6 w-full h-96 flex flex-col justify-center items-center mt-16 relative",children:[(0,i.jsxs)("div",{className:"text-2xl font-[Oxanium-Semibold] mb-5 text-center max-[450px]:text-xl",children:["Historical Fear & Greed vs ",A.value," Price Correlation Chart"]}),(0,i.jsxs)("div",{className:"flex w-full items-center justify-between pl-5 max-[450px]:flex-col max-[450px]:gap-4",children:[(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)("div",{className:"text-sm text-zinc-200 mr-3",children:"COIN"}),(0,i.jsx)(h.default,{options:D,onChange:e=>handleTokenChange(e),value:A,formatOptionLabel:e=>e.logo?(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",fontSize:"13px"},children:[(0,i.jsx)("img",{src:e.logo,alt:e.label,style:{width:"20px",height:"20px",marginRight:"10px"}}),e.label]}):null,getOptionValue:e=>e.value,styles:{control:(e,t)=>({...e,backgroundColor:"#212125",color:"white",borderColor:"#3f3f46",minWidth:"200px",outline:"none !important",boxShadow:"none !important","&:focus":{outline:"none !important",boxShadow:"none !important"},"&:active":{outline:"none !important",boxShadow:"none !important"}}),singleValue:e=>({...e,color:"white"}),indicatorSeparator:()=>({display:"none"}),menu:e=>({...e,width:"300px",position:"absolute",zIndex:1e3,backgroundColor:"#212125",color:"white"}),menuList:e=>({...e,maxHeight:"200px",overflowY:"auto",backgroundColor:"#212125",color:"white"}),option:(e,t)=>({...e,backgroundColor:t.isSelected?"#3f3f46":t.isFocused?"#3f3f46":"#212125",color:"white"}),placeholder:e=>({...e,color:"white"}),input:e=>({...e,color:"white",outline:"none !important",boxShadow:"none !important"})},components:{MenuList:e=>{let{options:t,children:a,maxHeight:l,getValue:n}=e,[r]=n(),s=t.indexOf(r)>=0?35*t.indexOf(r):0;return(0,i.jsx)(d.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},...e,children:(0,i.jsx)(p.t7,{height:l,itemCount:a.length,itemSize:35,initialScrollOffset:s,width:"100%",children:e=>{let{index:t,style:l}=e;return(0,i.jsx)("div",{style:l,children:a[t]})}})})}}})]}),(0,i.jsxs)("div",{className:"flex gap-1 mb-2",children:[(0,i.jsx)("button",{className:"px-2 py-2 rounded bg-zinc-800 hover:bg-zinc-700 transition duration-300 flex items-center justify-center ".concat(j?"animate-flip":""),onClick:()=>copyChartToClipboard(O,"Fear and Greed vs ".concat(A.value," Price Correlation Chart")),children:(0,i.jsx)(f.esY,{className:"text-zinc-300 text-xl"})}),(0,i.jsx)("button",{className:"px-2 py-2 rounded bg-zinc-800 hover:bg-zinc-700 transition duration-300 flex items-center justify-center",onClick:()=>downloadChart(O,"Fear and Greed vs ".concat(A.value," Price Correlation Chart")),children:(0,i.jsx)(f.aBF,{className:"text-zinc-300 text-xl"})})]})]}),(0,i.jsx)("canvas",{ref:O,className:"w-full h-full"}),(0,i.jsx)("div",{id:"tooltip",style:{position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.7)",color:"white",padding:"5px",borderRadius:"5px",pointerEvents:"none",display:"none"}})]})})]})})]})})]})}CryptoFearAndGreed.layout=o.Z}},function(e){e.O(0,[8391,4738,4817,2510,4396,5372,9599,2171,6005,5912,9774,2888,179],function(){return e(e.s=3226)}),_N_E=e.O()}]);