PageSourceSearch

https://sherwood.news/_next/static/chunks/pages/_preview/dashboard/options-data-829b2ff56af02b971320.js

js sherwood.news collected 2026-09-24 15:23:20 UTC 56,522 bytes, 1 lines download raw bytes

1(globalThis.webpackChunk_N_E=globalThis.webpackChunk_N_E||[]).push([[69342],{11575:function(t,e,n){"use strict";n.d(e,{a:function(){return a}});var r=n(81118),o=n(57953),a=function(t){var e=t.title;return(0,o.tZ)(r.default,null,(0,o.tZ)("meta",{content:"noindex,nofollow",name:"robots"}),(0,o.tZ)("title",null,"Editorial Dashboard - ",e),(0,o.tZ)("link",{key:"favicon:ico:32",href:"https://cdn.robinhood.com/assets/sherwood/favicon/stars.svg",rel:"icon",type:"image/svg+xml"}),(0,o.tZ)("link",{key:"favicon:ico:16",href:"https://cdn.robinhood.com/assets/sherwood/favicon/stars.svg",rel:"icon",type:"image/svg+xml"}))}},71535:function(t,e,n){"use strict";n.d(e,{x:function(){return m}});var r,o,a=n(2356),l=n(57953),i=n(30176),c=n(61585),u=n(82787),s=n(53538),d=n(57521);var p={link:(0,l.iv)((r={"&[data-active=true]":{backgroundColor:"#E3E9ED"},":hover":{backgroundColor:"#E3E9ED"},border:"none"},(0,a.Z)(r,u.Ax,{"&:last-of-type":{borderRight:"1px solid ".concat(d.E.black)},border:"1px solid ".concat(d.E.black),borderRight:"none"}),(0,a.Z)(r,"fontSize",15),(0,a.Z)(r,"fontWeight",700),(0,a.Z)(r,"letterSpacing","-0.3px"),(0,a.Z)(r,"lineHeight",1),(0,a.Z)(r,"padding","5px 10px"),(0,a.Z)(r,"textDecoration","none"),r),""),links:(0,l.iv)((o={},(0,a.Z)(o,u.Ax,{flexDirection:"row",marginTop:0}),(0,a.Z)(o,"display","flex"),(0,a.Z)(o,"flexDirection","column"),(0,a.Z)(o,"marginTop",15),o),""),logo:{name:"1i30uc2",styles:"width:225px"}},m=function(){var t=(0,i.useRouter)();return(0,l.tZ)(u.Jn,{verticallyAlign:"center"},(0,l.tZ)(u.C4,{lgSpan:4,mdSpan:6,span:4},(0,l.tZ)("div",{css:p.logo},(0,l.tZ)(s.J,null))),(0,l.tZ)(u.C4,{lgSpan:8,mdSpan:6,span:4},(0,l.tZ)("div",{css:p.links},[{label:"Breaking News",slug:"breaking-news"},{label:"Breaking News History",slug:"breaking-news-history"},{label:"Event Contracts",slug:"event-contracts"},{label:"Events List",slug:"events-list"},{label:"Push Notifications",slug:"push-notifications"},{label:"Asset Media",slug:"asset-media"},{label:"Options Data",slug:"options-data"}].map((function(e){var n=e.label,r=e.slug;return(0,l.tZ)(c.A,{key:r,css:p.link,"data-active":t.pathname==="/_preview/dashboard/".concat(r),href:"/_preview/dashboard/".concat(r,"/")},n)})))))}},17891:function(t,e,n){"use strict";n.d(e,{cD:function(){return d},PN:function(){return p},vn:function(){return m},Rn:function(){return f}
1,W2:function(){return g}});var r,o,a,l=n(2356),i=n(57953),c=n(82787),u=n(57521);var s=(0,i.F4)({from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}),d="#22C55E",p="#EF4444",m="#86EFAC",f="#FCA5A5",g={assetTypeFieldset:(0,i.iv)({border:"none",input:{cursor:"pointer",margin:"0 8px 0 0"},label:{"&:last-child":{marginBottom:0},alignItems:"center",cursor:"pointer",display:"flex",fontFamily:u.UW,fontSize:15,marginBottom:4},legend:{fontFamily:u.UW,fontSize:15,fontWeight:700,marginBottom:10},marginBottom:20,padding:0},""),btn:(0,i.iv)((r={},(0,l.Z)(r,c.Ax,{padding:"1px 17px"}),(0,l.Z)(r,"padding","1px 10px"),r),""),btnText:(0,i.iv)({fontFamily:"".concat(u.UW," !important"),fontSize:"15px !important"},""),customTimeInput:(0,i.iv)({border:"1px solid ".concat(u.E.grey3),borderRadius:4,fontFamily:u.UW,fontSize:14,padding:"6px 8px"},""),customTimeInputs:(0,i.iv)({backgroundColor:u.E.grey1,borderRadius:4,display:"flex",gap:15,marginTop:10,padding:10},""),customTimeLabel:(0,i.iv)({fontFamily:u.UW,fontSize:13,fontWeight:700},""),customTimeRow:{name:"19er0v9",styles:"align-items:center;display:flex;gap:8px"},databentoButton:(0,i.iv)({"&:disabled":{backgroundColor:u.E.grey3,cursor:"not-allowed"},backgroundColor:u.E.black,border:"none",borderRadius:4,color:u.E.white,cursor:"pointer",fontFamily:u.UW,fontSize:16,fontWeight:700,padding:"12px 24px"},""),databentoError:{name:"1ejtjhd",styles:"background-color:#FEE;border:1px solid #F00;border-radius:4px;color:#C00;padding:15px"},databentoForm:{name:"x6qdks",styles:"display:flex;flex-direction:column;gap:15px"},databentoInput:(0,i.iv)({border:"1px solid ".concat(u.E.grey3),borderRadius:4,fontFamily:u.UW,fontSize:16,padding:"10px 12px",width:"100%"},""),databentoLabel:(0,i.iv)({display:"block",fontFamily:u.UW,fontSize:14,fontWeight:700,marginBottom:5},""),databentoLoading:{name:"15k94xq",styles:"background-color:#E8F4FD;border-radius:4px;color:#0066CC;padding:15px"},databentoTable:(0,i.iv)({backgroundColor:"#fff",border:"1px solid ".concat(u.E.grey2),borderCollapse:"collapse",fontFamily:u.UW,fontSize:14,td:{border:"none",padding:"5px"},th:{backgroundColor:u.E.grey2,borderBottom:"2px solid ".concat(u.E.grey3),padding:"10px 8px",textAlign:"left"},tr:{"&:nth-child(even)":{backgroundColor:u.E.grey1}},width:"100%"},""),datasetFieldset:(0,i.iv)({border:"none",input:{cursor:"pointer",margin:"0 8px 0 0"},label:{"&:last-child":{marginBottom:0},alignItems:"center",cursor:"pointer",display:"flex",fontFamily:u.UW,fontSize:15,marginBottom:4},legend:{fontFamily:u.UW,fontSize:14,fontWeight:700,marginBottom:10},margin:0,padding:0},""),dateInput:{name:"rk0b4q",styles:"font-size:16px;padding:5px"},gridContainerRoot:{name:"f9812x",styles:"display:flex;flex-direction:column;row-gap:25px"},linksSection:(0,i.iv)((o={},(0,l.Z)(o,c.Ax,{padding:"15px 0"}),(0,l.Z)(o,"li",{"&:last-child":{marginBottom:0},listStyle:"none",marginBottom:15}),(0,l.Z)(o,"padding","15px 0 0 0"),(0,l.Z)(o,"ul",{listStyle:"none",margin:"0 0 20px 0",padding:0}),o),""),loadingMessage:(0,i.iv)({alignItems:"center",display:"flex",fontFamily:u.UW,fontSize:14,gap:10},""),meta:(0,i.iv)((a={alignItems:"flex-start"},(0,l.Z)(a,c.Ax,{marginTop:0}),(0,l.Z)(a,"display","flex"),(0,l.Z)(a,"flexDirection","row"),(0,l.Z)(a,"justifyContent","space-between"),(0,l.Z)(a,"marginTop",25),a),""),root:(0,i.iv)({backgroundColor:u.E.grey1,color:u.E.black,display:"flex",flexDirection:"column",h1:{margin:0},h2:{margin:0},h3:{fontSize:15,margin:0},minHeight:"100vh",paddingTop:25},""),schemaFieldset:(0,i.iv)({border:"none",input:{cursor:"pointer",margin:"0 8px 0 0"},label:{"&:last-child":{marginBottom:0},alignItems:"center",cursor:"pointer",display:"flex",fontFamily:u.UW,fontSize:15,marginBottom:4},legend:{fontFamily:u.UW,fontSize:14,fontWeight:700,marginBottom:10},margin:0,padding:0},""),schemaWarning:(0,i.iv)({backgroundColor:"#FFF3CD",border:"1px solid #FFCA2C",borderRadius:4,color:"#664D03",fontFamily:u.UW,fontSize:12,lineHeight:1.4,margin:"10px 0 0 0",padding:10},""),smallSubtitle:(0,i.iv)({color:u.E.grey4,fontSize:14,lineHeight:1.4,margin:"5px 0 0 0"},""),spinner:(0,i.iv)({animation:"".concat(s," 0.75s linear infinite"),border:"2px s
1olid ".concat(u.E.grey3),borderRadius:"50%",borderTopColor:u.E.black,flexShrink:0,height:18,width:18},""),timeRangeFieldset:(0,i.iv)({"& > label":{"&:last-of-type":{marginBottom:0},alignItems:"center",cursor:"pointer",display:"flex",fontFamily:u.UW,fontSize:15,marginBottom:4},border:"none",'input[type="radio"]':{cursor:"pointer",margin:"0 8px 0 0"},legend:{fontFamily:u.UW,fontSize:14,fontWeight:700,marginBottom:10},margin:0,padding:0},"")}},24506:function(t,e,n){"use strict";n.d(e,{T:function(){return g}});var r=n(78465),o=n(2356),a=n(19015),l=n(35697),i=n(684),c=n.n(i),u=n(55650),s=n(25735),d=n(57953);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f=function(t){var e=t.quality,n=t.src,r=t.width,o=new URL(n),a=o.searchParams;return a.set("auto","compress,format"),a.set("cs","srgb"),a.set("fit",a.get("fit")||"max"),a.set("w",a.get("w")||r.toString()),e&&a.set("q",e.toString()),o.href},g=function(t){var e=t.imageProps,n=(0,a.Z)(t,["imageProps"]),o="height"in e&&"width"in e&&1===e.height&&1===e.width,i=function(t,e){var n=new URL(t);return n.search="",(0,s.useQuery)([n.href],(0,u.Z)(c().mark((function t(){var e,r,o;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("".concat(n.href,"?fm=json"));case 2:return t.next=4,t.sent.json();case 4:return e=t.sent,r=e.PixelHeight,o=e.PixelWidth,t.abrupt("return",{height:r,width:o});case 7:case"end":return t.stop()}}),t)}))),{enabled:e,refetchOnWindowFocus:!1})}(e.src,o).data,p=o&&i?m(m({},e),i):e,g=p.openInNewTab,y=(0,a.Z)(p,["openInNewTab"]);return g?(0,d.tZ)("a",(0,r.Z)({},n,{href:e.src,target:"_blank",title:e.alt}),(0,d.tZ)(l.default,(0,r.Z)({loader:f},y))):(0,d.tZ)("div",n,(0,d.tZ)(l.default,(0,r.Z)({loader:f},y)))}},53538:function(t,e,n){"use strict";n.d(e,{J:function(){return i}});var r=n(24506),o=n(57521),a=n(26130),l=n(57953),i=function(t){var e=t.color,n=t.primaryCategory,i=Object.keys(a.n).find((function(t){return a.n[t]===e})),c=n?"-".concat(n.fields.slug):"",u="".concat(o.og,"/logos/shwd").concat(c).concat(i?"-".concat(i):"",".png");return(0,l.tZ)(r.T,{imageProps:{alt:n?n.fields.title:"Sherwood",height:58,layout:"responsive",src:u,width:225}})}},26130:function(t,e,n){"use strict";n.d(e,{n:function(){return o}});var r=n(57521),o={green:r.E.green1,pink:"#FF007A",soylent:r.E.soylent1,white:"#FFFFFF"}},52460:function(t,e,n){"use strict";n.r(e),n.d(e,{__N_SSP:function(){return et},default:function(){return nt}});var r=n(684),o=n.n(r),a=n(55650),l=n(57953),i=n(54176),c=n(95292),u=n(82787),s=n(57521);var d={container:{name:"1x1kkjm",styles:"background-color:#E8F4FD;border-radius:8px;padding:16px"},header:{name:"c65djo",styles:"align-items:center;display:flex;justify-content:space-between;margin-bottom:12px"},percentage:(0,l.iv)({color:"#0066CC",fontFamily:s.UW,fontSize:14,fontWeight:700},""),progressBar:{name:"103bl0z",styles:"background-color:#0066CC;border-radius:4px;height:100%;transition:width 0.3s ease"},progressBarContainer:{name:"1ky9vif",styles:"background-color:#B8D4E8;border-radius:4px;height:8px;margin-bottom:12px;overflow:hidden"},separator:(0,l.iv)({color:s.E.grey3},""),statDot:{name:"zlfyvo",styles:"border-radius:50%;display:inline-block;height:6px;width:6px"},statItem:{name:"1fq4qgt",styles:"align-items:center;display:flex;gap:4px"},stats:(0,l.iv)({alignItems:"center",color:s.E.grey4,display:"flex",flexWrap:"wrap",fontFamily:s.UW,fontSize:12,gap:8},""),title:(0,l.iv)({color:"#0066CC",fontFamily:s.UW,fontSize:14,fontWeight:700,margin:0},"")},p=function(t){var e=t.currentDate,n=t.currentDay,r=t.status,o=t.symbol,a=t.totalDays;if("idle"===r)return null;var i=a>0?Math.round(n/a*100):0;return(0,l.tZ)("div",{css:d.container},(0,l.tZ)("div",{css:d.header},(0,l.tZ)("p",{css:d.title},o&&"".concat(o.toUpperCase()," \xb7 "),function(){switch(r){case"fetching":return 0===n?"Starting...":"Fetching day ".concat(n,"/").concat(a,": ").concat(e);case"complete":return"Processing complete";case"error":return"Error occurred";default:return"Loading..."}}()),"fetching"===r&&a>0&&(0,l.tZ)("span",{css:d.percentage},i,"%")),"fetching"===r&&a>0&&(0,l.tZ)("div",{css:d.progressBarContainer},(0,l.tZ)("div",{css:d.progressBar,style:{width:"".concat(i,"%")}})),"fetching"===r&&n>0&&(0,l.tZ)("div",{css:d.stats},(0,l.tZ)("span",{css:d.statItem},a-n," days remaining")),"complete"===r&&(0,l.tZ)("div",{css:d.stats},(0,l.tZ)("span",{css:d.statItem},a," days processed")))},m=n(82458),f=n(21045),g=n(17891);var y={chartContainer:(0,l.iv)({backgroundColor:s.E.white,border:"1px solid ".concat(s.E.grey2),borderRadius:8,marginBottom:20,padding:20,position:"relative"},""),chartSubtitle:(0,l.iv)({color:s.E.grey4,fontFamily:s.UW,fontSize:12,marginBottom:15},""),chartTitle:(0,l.iv)({fontFamily:s.UW,fontSize:16,fontWeight:700,marginBottom:4},""),legend:(0,l.iv)({alignItems:"center",display:"flex",fontFamily:s.UW,fontSize:12,gap:20,justifyContent:"center",marginTop:10},""),legendItem:{name:"3xksoi",styles:"align-items:center;display:flex;gap:6px"}
1,legendSwatch:{name:"1b1ppc8",styles:"border-radius:2px;height:12px;width:12px"},tooltip:(0,l.iv)({backgroundColor:"rgba(0, 0, 0, 0.85)",borderRadius:6,color:"white",fontFamily:s.UW,fontSize:12,padding:"10px 14px",pointerEvents:"none",position:"absolute",transform:"translate(-50%, -100%)",whiteSpace:"nowrap",zIndex:10},""),tooltipLabel:{name:"1p2bjd8",styles:"font-weight:700;margin-bottom:6px"},tooltipRow:{name:"1m99pfv",styles:"align-items:center;display:flex;gap:6px;margin-bottom:2px"},tooltipSwatch:{name:"17oklih",styles:"border-radius:2px;height:8px;width:8px"}},v=function(t){var e=t.comparisonData,n=t.historicalData,r=t.symbol,o=t.timeRange,a=(0,i.useRef)(null),c=(0,i.useRef)(null),u=(0,i.useState)(0),d=u[0],p=u[1],v=(0,i.useState)(null),b=v[0],h=v[1];return(0,i.useEffect)((function(){if(c.current){var t=new ResizeObserver((function(t){p(t[0].contentRect.width)}));return t.observe(c.current),function(){return t.disconnect()}}}),[]),(0,i.useEffect)((function(){if(a.current&&c.current&&0!==d){var t=60,r=20,o=d-40,l=o-t-20,i=200-r-40,u=(0,m.Ys)(a.current);u.selectAll("*").remove(),u.attr("width",o).attr("height",200);var p=u.append("g").attr("transform","translate(".concat(t,",").concat(r,")")),y=[{data:n,label:(0,f.K8)(n.date)},{data:e,label:"Today (".concat((0,f.K8)(e.date),")")}],v=(0,m.tiA)().domain(y.map((function(t){return t.label}))).range([0,l]).padding(.3),b=(0,m.tiA)().domain(["calls","puts"]).range([0,v.bandwidth()]).padding(.1),x=(0,m.Fp7)(y,(function(t){return Math.max(t.data.callVolume,t.data.putVolume)}))||0,Z=(0,m.BYU)().domain([0,1.1*x]).range([i,0]);p.append("g").attr("transform","translate(0,".concat(i,")")).call((0,m.LLu)(v)).selectAll("text").style("font-family",s.UW).style("font-size","11px"),p.append("g").call((0,m.y4O)(Z).tickFormat((function(t){var e=t;return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(0),"K"):e.toString()}))).selectAll("text").style("font-family",s.UW).style("font-size","11px");var w=function(t,e){var n,r=t.currentTarget.getBoundingClientRect(),o=null===(n=c.current)||void 0===n?void 0:n.getBoundingClientRect();o&&h({callVolume:e.data.callVolume,label:e.label,putVolume:e.data.putVolume,x:r.left-o.left+r.width/2,y:r.top-o.top})};y.forEach((function(t){var e=p.append("g").attr("transform","translate(".concat(v(t.label),",0)"));e.append("rect").attr("x",b("calls")||0).attr("y",Z(t.data.callVolume)).attr("width",b.bandwidth()).attr("height",i-Z(t.data.callVolume)).attr("fill",g.cD).attr("rx",2).style("cursor","pointer").on("mouseenter",(function(e){return w(e,t)})).on("mouseleave",(function(){return h(null)})),e.append("rect").attr("x",b("puts")||0).attr("y",Z(t.data.putVolume)).attr("width",b.bandwidth()).attr("height",i-Z(t.data.putVolume)).attr("fill",g.PN).attr("rx",2).style("cursor","pointer").on("mouseenter",(function(e){return w(e,t)})).on("mouseleave",(function(){return h(null)}))}))}}),[d,n,e]),(0,l.tZ)("div",{ref:c,css:y.chartContainer},(0,l.tZ)("div",{css:y.chartTitle},r?"".concat(r," "):"","Volume Comparison"),(0,l.tZ)("div",{css:y.chartSubtitle},n.date," vs Today",o?" \xb7 ".concat(o):""),(0,l.tZ)("svg",{ref:a}),(0,l.tZ)("div",{css:y.legend},(0,l.tZ)("div",{css:y.legendItem},(0,l.tZ)("div",{css:y.legendSwatch,style:{backgroundColor:g.cD}}),(0,l.tZ)("span",null,"Calls")),(0,l.tZ)("div",{css:y.legendItem},(0,l.tZ)("div",{css:y.legendSwatch,style:{backgroundColor:g.PN}}),(0,l.tZ)("span",null,"Puts"))),b&&(0,l.tZ)("div",{css:y.tooltip,style:{left:b.x,top:b.y-8}},(0,l.tZ)("div",{css:y.tooltipLabel},b.label),(0,l.tZ)("div",{css:y.tooltipRow},(0,l.tZ)("div",{css:y.tooltipSwatch,style:{backgroundColor:g.cD}}),(0,l.tZ)("span",null,"Calls: ",b.callVolume.toLocaleString())),(0,l.tZ)("div",{css:y.tooltipRow},(0,l.tZ)("div",{css:y.tooltipSwatch,style:{backgroundColor:g.PN}}),(0,l.tZ)("span",null,"Puts: ",b.putVolume.toLocaleString())),(0,l.tZ)("div",{css:y.tooltipRow,style:{fontWeight:700,marginTop:6}},(0,l.tZ)("span",null,"P/C Ratio:"," ",b.callVolume>0?(b.putVolume/b.callVolume).toFixed(2):"N/A"))))},b=n(11575),h=n(71535),x=n(74871);function Z(t,e,n){return(0,x.E)(t,-e,n)}var w=n(21066),S=n(66397),C=function(t){var e=t.disabled,n=t.endDate,r=t.onEndDateChange,o=t.onStartDateChange,a=t.startDate,c=(0,i.useMemo)((function(){return(0,S.lY)()}),[]),u="startDate-".concat(c),s="endDate-".concat(c),d=Z(new Date,1),p=(0,w.WU)(d,"yyyy-MM-dd"),m=(0,w.WU)(d,"yyyy-MM-dd");return(0,l.tZ)(i.Fragment,null,(0,l.tZ)("div",null,(0,l.tZ)("label",{css:g.W2.databentoLabel,htmlFor:u},"Start Date"),(0,l.tZ)("input",{css:g.W2.databentoInput,disabled:e,id:u,max:p,onChange:function(t){return o(t.target.value)},type:"date",value:a})),(0,l.tZ)("div",null,(0,l.tZ)("label",{css:g.W2.databentoLabel,htmlFor:s},"End Date"),(0,l.tZ)("input",{css:g.W2.databentoInput,disabled:e,id:s,max:m,onChange:function(t){return r(t.target.value)},type:"date",value:n})))},V=n(2356);function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};
1e%2?T(Object(n),!0).forEach((function(e){(0,V.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function k(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return D(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,i=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){i=!0,a=t},f:function(){try{l||null==n.return||n.return()}finally{if(i)throw a}}}}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var O={chartContainer:(0,l.iv)({backgroundColor:s.E.white,border:"1px solid ".concat(s.E.grey2),borderRadius:8,marginBottom:20,padding:20,position:"relative"},""),chartSubtitle:(0,l.iv)({color:s.E.grey4,fontFamily:s.UW,fontSize:13,marginBottom:15},""),chartTitle:(0,l.iv)({fontFamily:s.UW,fontSize:16,fontWeight:700,marginBottom:4},""),comparisonBadge:(0,l.iv)({alignItems:"center",backgroundColor:s.E.grey2,borderRadius:4,display:"inline-flex",fontFamily:s.UW,fontSize:11,gap:6,marginLeft:10,padding:"4px 8px"},""),legend:(0,l.iv)({alignItems:"center",display:"flex",fontFamily:s.UW,fontSize:12,gap:20,justifyContent:"center",marginTop:10},""),legendItem:{name:"3xksoi",styles:"align-items:center;display:flex;gap:6px"},legendSwatch:{name:"1b1ppc8",styles:"border-radius:2px;height:12px;width:12px"},tooltip:(0,l.iv)({backgroundColor:"rgba(0, 0, 0, 0.85)",borderRadius:4,color:"white",fontFamily:s.UW,fontSize:12,padding:"8px 12px",pointerEvents:"none",position:"absolute",transform:"translate(-50%, -100%)",whiteSpace:"nowrap",zIndex:10},""),tooltipLabel:{name:"17653ju",styles:"color:rgba(255, 255, 255, 0.7);font-size:10px;margin-bottom:2px"},tooltipRow:{name:"17henyy",styles:"align-items:center;display:flex;gap:8px;margin-top:4px"},tooltipSwatch:{name:"17oklih",styles:"border-radius:2px;height:8px;width:8px"}},R=function(t){var e=t.comparisonData,n=t.data,r=t.endDate,o=t.startDate,a=t.symbol,c=t.timeRange,u=(0,i.useRef)(null),d=(0,i.useRef)(null),p=(0,i.useState)(null),y=p[0],v=p[1],b=(0,i.useState)(0),h=b[0],x=b[1];if((0,i.useEffect)((function(){if(d.current){var t=new ResizeObserver((function(t){var e,n=k(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;x(r.contentRect.width)}}catch(o){n.e(o)}finally{n.f()}}));return t.observe(d.current),function(){return t.disconnect()}}}),[]),(0,i.useEffect)((function(){if(u.current&&d.current&&0!==n.length){var t=50,r=55,o=20,a=20,l=d.current.getBoundingClientRect().width-40,i=l-r-o,c=250-a-t,p=(0,m.Ys)(u.current);p.selectAll("*").remove(),p.attr("width",l).attr("height",250);var f=p.append("g").attr("transform","translate(".concat(r,",").concat(a,")")),y=(0,m.q2y)().domain(n.map((function(t){return t.date}))).range([0,i]).padding(.5),b=(0,m.Fp7)(n,(function(t){return Math.max(t.callVolume,t.putVolume)}))||0;e&&(b=Math.max(b,e.callVolume,e.putVolume));
1var h=(0,m.BYU)().domain([0,1.1*b]).range([c,0]);f.append("g").attr("transform","translate(0,".concat(c,")")).call((0,m.LLu)(y).tickFormat((function(t){var e=new Date("".concat(t,"T00:00:00"));return"".concat(["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][e.getDay()]," ").concat(e.getMonth()+1,"/").concat(e.getDate())}))).selectAll("text").style("font-family",s.UW).style("font-size","10px").attr("transform","rotate(-45)").style("text-anchor","end"),f.append("g").call((0,m.y4O)(h).tickFormat((function(t){var e=Number(t);return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(0),"K"):e.toString()}))).selectAll("text").style("font-family",s.UW).style("font-size","11px"),e&&(f.append("line").attr("x1",0).attr("x2",i).attr("y1",h(e.callVolume)).attr("y2",h(e.callVolume)).attr("stroke",g.vn).attr("stroke-width",2).attr("stroke-dasharray","6,4"),f.append("line").attr("x1",0).attr("x2",i).attr("y1",h(e.putVolume)).attr("y2",h(e.putVolume)).attr("stroke",g.Rn).attr("stroke-width",2).attr("stroke-dasharray","6,4"));var x=(0,m.jvg)().x((function(t){return y(t.date)||0})).y((function(t){return h(t.callVolume)})),Z=(0,m.jvg)().x((function(t){return y(t.date)||0})).y((function(t){return h(t.putVolume)}));f.append("path").datum(n).attr("fill","none").attr("stroke",g.cD).attr("stroke-width",2.5).attr("d",x),f.append("path").datum(n).attr("fill","none").attr("stroke",g.PN).attr("stroke-width",2.5).attr("d",Z);var w=function(t,e){var n,r=t.currentTarget,o=null===(n=d.current)||void 0===n?void 0:n.getBoundingClientRect(),a=r.getBoundingClientRect();o&&v(E(E({},e),{},{x:a.left-o.left+a.width/2,y:a.top-o.top}))};f.selectAll(".dot-call").data(n).enter().append("circle").attr("class","dot-call").attr("cx",(function(t){return y(t.date)||0})).attr("cy",(function(t){return h(t.callVolume)})).attr("r",5).attr("fill",g.cD).style("cursor","pointer").on("mouseenter",w).on("mouseleave",(function(){return v(null)})),f.selectAll(".dot-put").data(n).enter().append("circle").attr("class","dot-put").attr("cx",(function(t){return y(t.date)||0})).attr("cy",(function(t){return h(t.putVolume)})).attr("r",5).attr("fill",g.PN).style("cursor","pointer").on("mouseenter",w).on("mouseleave",(function(){return v(null)}))}}),[n,h,e]),0===n.length)return null;var Z=function(){var t=[];return o&&r&&(o===r?t.push((0,f.CW)(o)):t.push("".concat((0,f.CW)(o)," \u2013 ").concat((0,f.CW)(r)))),c&&t.push(c),t.join(" \xb7 ")}();return(0,l.tZ)("div",{ref:d,css:O.chartContainer},(0,l.tZ)("div",{style:{alignItems:"center",display:"flex"}},(0,l.tZ)("div",{css:O.chartTitle},a?"".concat(a," "):"","Volume Over Time"),e&&(0,l.tZ)("span",{css:O.comparisonBadge},"vs ",(0,f.K8)(e.date))),Z&&(0,l.tZ)("div",{css:O.chartSubtitle},Z),(0,l.tZ)("svg",{ref:u}),(0,l.tZ)("div",{css:O.legend},(0,l.tZ)("div",{css:O.legendItem},(0,l.tZ)("div",{css:O.legendSwatch,style:{backgroundColor:g.cD}}),(0,l.tZ)("span",null,"Calls")),(0,l.tZ)("div",{css:O.legendItem},(0,l.tZ)("div",{css:O.legendSwatch,style:{backgroundColor:g.PN}}),(0,l.tZ)("span",null,"Puts")),e&&(0,l.tZ)(i.Fragment,null,(0,l.tZ)("div",{css:O.legendItem},(0,l.tZ)("div",{css:O.legendSwatch,style:{background:"repeating-linear-gradient(90deg, ".concat(g.vn,", ").concat(g.vn," 4px, transparent 4px, transparent 6px)")}}),(0,l.tZ)("span",null,"Today Calls")),(0,l.tZ)("div",{css:O.legendItem},(0,l.tZ)("div",{css:O.legendSwatch,style:{background:"repeating-linear-gradient(90deg, ".concat(g.Rn,", ").concat(g.Rn," 4px, transparent 4px, transparent 6px)")}}),(0,l.tZ)("span",null,"Today Puts")))),y&&(0,l.tZ)("div",{css:O.tooltip,style:{left:y.x,top:y.y-8}},(0,l.tZ)("div",{css:O.tooltipLabel},y.date),(0,l.tZ)("div",{css:O.tooltipRow},(0,l.tZ)("div",{css:O.tooltipSwatch,style:{backgroundColor:g.cD}}),(0,l.tZ)("span",null,"Calls: ",y.callVolume.toLocaleString())),(0,l.tZ)("div",{css:O.tooltipRow},(0,l.tZ)("div",{css:O.tooltipSwatch,style:{backgroundColor:g.PN}}),(0,l.tZ)("span",null,"Puts: ",y.putVolume.toLocaleString())),(0,l.tZ)("div",{css:O.tooltipRow,style:{fontWeight:700,marginTop:6}},(0,l.tZ)("span",null,"P/C Ratio:"," ",y.callVolume>0?(y.putVolume/y.callVolume).toFixed(2):"N/A")),(0,l.tZ)("div",{css:O.tooltipRow,style:{color:"rgba(255,255,255,0.7)"}}
1,(0,l.tZ)("span",null,(y.callTrades+y.putTrades).toLocaleString()," trades")),e&&(0,l.tZ)(i.Fragment,null,(0,l.tZ)("div",{css:O.tooltipLabel,style:{borderTop:"1px solid rgba(255,255,255,0.2)",marginTop:8,paddingTop:8}},"Today (",e.date,")"),(0,l.tZ)("div",{css:O.tooltipRow},(0,l.tZ)("div",{css:O.tooltipSwatch,style:{backgroundColor:g.vn}}),(0,l.tZ)("span",null,"Calls: ",e.callVolume.toLocaleString())),(0,l.tZ)("div",{css:O.tooltipRow},(0,l.tZ)("div",{css:O.tooltipSwatch,style:{backgroundColor:g.Rn}}),(0,l.tZ)("span",null,"Puts: ",e.putVolume.toLocaleString())))))},P=[{endTime:"23:59:59",label:"Full Day",startTime:"00:00:00"},{endTime:"16:00:00",label:"Market Hours",startTime:"09:30:00"},{endTime:"09:30:00",label:"Pre-market",startTime:"04:00:00"},{endTime:"20:00:00",label:"After-hours",startTime:"16:00:00"}],F=function(t,e,n){if("Custom"===t)return{endTime:n?"".concat(n,":00"):"16:00:00",startTime:e?"".concat(e,":00"):"09:30:00"};var r=P.find((function(e){return e.label===t}))||P[0];return{endTime:r.endTime,startTime:r.startTime}},W=function(t){var e=t.customEndTime,n=void 0===e?"":e,r=t.customStartTime,o=void 0===r?"":r,a=t.disabled,c=t.onChange,u=t.onCustomEndTimeChange,s=t.onCustomStartTimeChange,d=t.selectedPreset,p="Custom"===d,m=(0,i.useMemo)((function(){return(0,S.lY)()}),[]),f="customStartTime-".concat(m),y="customEndTime-".concat(m);return(0,l.tZ)("fieldset",{css:g.W2.timeRangeFieldset},(0,l.tZ)("legend",null,"Time Range (ET)"),P.map((function(t){return(0,l.tZ)("label",{key:t.label},(0,l.tZ)("input",{checked:d===t.label,disabled:a,name:"timeRange",onChange:function(){return c(t.label)},type:"radio",value:t.label}),t.label)})),(0,l.tZ)("label",null,(0,l.tZ)("input",{checked:p,disabled:a,name:"timeRange",onChange:function(){return c("Custom")},type:"radio",value:"Custom"}),"Custom"),p&&(0,l.tZ)("div",{css:g.W2.customTimeInputs},(0,l.tZ)("div",{css:g.W2.customTimeRow},(0,l.tZ)("label",{css:g.W2.customTimeLabel,htmlFor:f},"Start"),(0,l.tZ)("input",{css:g.W2.customTimeInput,disabled:a,id:f,onChange:function(t){return null===s||void 0===s?void 0:s(t.target.value)},type:"time",value:o})),(0,l.tZ)("div",{css:g.W2.customTimeRow},(0,l.tZ)("label",{css:g.W2.customTimeLabel,htmlFor:y},"End"),(0,l.tZ)("input",{css:g.W2.customTimeInput,disabled:a,id:y,onChange:function(t){return null===u||void 0===u?void 0:u(t.target.value)},type:"time",value:n}))))},M=n(47982),j=n(53765),L=n(92011);function U(t,e){return 0===(0,L.Q)(t,e?.in).getDay()}function z(t,e){return 6===(0,L.Q)(t,e?.in).getDay()}var B=n(54940);function A(t,e){const n=(0,L.Q)(t,e?.in).getDay();return 0===n||6===n}
1var N="America/New_York";function I(t,e,n,r){var o=n-new Date(t,e,1).getDay();return o<0&&(o+=7),new Date(t,e,1+o+7*(r-1))}function _(t){var e=[],n=new Date(t,0,1);U(n)&&(n=(0,x.E)(n,1)),z(n)&&(n=Z(n,1)),e.push(n),e.push(I(t,0,1,3)),e.push(I(t,1,1,3));var r=Z(function(t){var e=t%19,n=Math.floor(t/100),r=t%100,o=Math.floor(n/4),a=n%4,l=Math.floor((n+8)/25),i=(19*e+n-o-Math.floor((n-l+1)/3)+15)%30,c=(32+2*a+2*Math.floor(r/4)-i-r%4)%7,u=Math.floor((e+11*i+22*c)/451),s=Math.floor((i+c-7*u+114)/31)-1;return new Date(t,s,(i+c-7*u+114)%31+1)}(t),2);e.push(r),e.push(function(t,e,n){var r=new Date(t,e+1,0).getDay()-n;return r<0&&(r+=7),new Date(t,e+1,-r)}(t,4,1));var o=new Date(t,5,19);U(o)&&(o=(0,x.E)(o,1)),z(o)&&(o=Z(o,1)),e.push(o);var a=new Date(t,6,4);U(a)&&(a=(0,x.E)(a,1)),z(a)&&(a=Z(a,1)),e.push(a),e.push(I(t,8,1,1)),e.push(I(t,10,4,4));var l=new Date(t,11,25);return U(l)&&(l=(0,x.E)(l,1)),z(l)&&(l=Z(l,1)),e.push(l),new Set(e.map((function(t){return(0,w.WU)(t,"yyyy-MM-dd")})))}function H(t){var e=(0,B.Qc)(t,"yyyy-MM-dd",new Date);return!A(e)&&!_(e.getFullYear()).has(t)}function Y(t){var e=(0,B.Qc)(t,"yyyy-MM-dd",new Date);for(e=Z(e,1);!H((0,w.WU)(e,"yyyy-MM-dd"));)e=Z(e,1);return(0,w.WU)(e,"yyyy-MM-dd")}function X(t){return(0,w.WU)(j.N9.tz(N),"HH:mm")>=t}function J(t){var e=(0,B.Qc)(t,"yyyy-MM-dd",new Date),n=(0,j.IH)(N,e),r=n<0?"-":"+",o=Math.abs(n),a=String(Math.floor(o/60)).padStart(2,"0"),l=String(o%60).padStart(2,"0");return"".concat(r).concat(a,":").concat(l)}function Q(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function q(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Q(Object(n),!0).forEach((function(e){(0,V.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function K(t,e){for(var n=[],r=new Date("".concat(t,"T12:00:00")),o=new Date("".concat(e,"T12:00:00"));r<=o;){var a=r.toISOString().split("T")[0];H(a)&&n.push(a),r.setDate(r.getDate()+1)}return n}var G=n(48834);function $(t,e){var n=new Blob([t],{type:"text/csv"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=e,o.click(),URL.revokeObjectURL(r)}var tt={callText:(0,l.iv)({color:g.cD},""),comparisonCard:(0,l.iv)({backgroundColor:s.E.grey2,borderRadius:8,marginBottom:20,padding:20},""),comparisonLabel:{name:"15wn16s",styles:"font-size:14px;text-align:left"},comparisonLabelBold:{name:"1au90mr",styles:"font-size:14px;font-weight:700;text-align:left"},comparisonNote:(0,l.iv)({color:s.E.grey4,fontSize:11,marginTop:8},""),comparisonRow:{name:"1bfxy08",styles:"&:last-child{margin-bottom:0;}align-items:center;display:grid;gap:10px;grid-template-columns:1fr 100px 100px 80px;margin-bottom:8px"},comparisonRowHeader:(0,l.iv)({color:s.E.grey4,fontSize:10,fontWeight:700,textAlign:"right",textTransform:"uppercase"},""),comparisonRowHeaderLeft:(0,l.iv)({color:s.E.grey4,fontSize:10,fontWeight:700,textTransform:"uppercase"},""),comparisonTitle:{name:"cj74o2",styles:"font-size:14px;font-weight:700;margin:0"},comparisonValue:{name:"13xco7d",styles:"font-size:14px;text-align:right"},comparisonValueBold:{name:"1585nic",styles:"font-size:14px;font-weight:700;text-align:right"},exportButton:(0,l.iv)({"&:hover":{backgroundColor:s.E.grey3},backgroundColor:s.E.white,border:"1px solid ".concat(s.E.grey3),borderRadius:4,color:s.E.black,cursor:"pointer",fontSize:11,fontWeight:700,padding:"6px 12px",transition:"background-color 0.2s ease"},""),exportRow:{name:"16cz7qc",styles:"display:flex;gap:8px;margin-top:15px"},fetchMetadata:(0,l.iv)({color:s.E.grey4,fontSize:11,marginTop:24,textAlign:"right"},""),metric:(0,l.iv)({backgroundColor:s.E.grey2,borderRadius:8,flex:1,minWidth:150,padding:20,textAlign:"center"},""),metricLabel:(0,l.iv)({color:s.E.grey4,fontSize:12,fontWeight:700,marginBottom:5,textTransform:"uppercase"},""),metricValue:{name:"cknbf7",styles:"font-size:28px;font-weight:700"},metricsRow:{name:"1tadvzm",styles:"display:flex;flex-wrap:wrap;gap:15px;margin-bottom:20px"},metricsTitle:{name:"aocze8",styles:"font-size:14px;font-weight:700;margin:0 0 5px 0"},mutedText:(0,l.iv)({color:s.E.grey4},""),percentChange:{name:"lfnkbm",styles:"font-size:12px;font-weight:700;text-align:right"},putText:(0,l.iv)({color:g.PN},""),ratioBar:(0,l.iv)({backgroundColor:s.E.grey2,borderRadius:4,display:"flex",height:40,marginBottom:20,overflow:"hidden"},""),ratioBarCall:(0,l.iv)({alignItems:"center",backgroundColor:g.cD,color:"white",display:"flex",fontSize:14,fontWeight:700,justifyContent:"center",transition:"width 0.3s ease"},""),ratioBarPut:(0,l.iv)({alignItems:"center",backgroundColor:g.PN,color:"white",display:"flex",fontSize:14,fontWeight:700,justifyContent:"center",transition:"width 0.3s ease"},""),sectionHeader:{name:"fm3jsy",styles:"align-items:center;display:flex;justify-content:space-between;margin-bottom:10px;margin-top:20px"},sectionTitle:{name:"ti75j2",styles:"margin:0"},tradeCounts:(0,l.iv)({color:s.E.grey4,marginBottom:15},"")},et=!0,nt=function(){var t=(0,i.useState)(""),e=t[0],n=t[1],r=(0,i.useState)(""),d=r[0],m=r[1],f=(0,i.useState)(""),y=f[0],x=f[1],Z=(0,i.useState)(!1),V=Z[0],T=Z[1],E=(0,i.useState)(!1),k=E[0],D=E[1],O=(0,i.useState)(null),P=O[0],L=O[1],U=(0,i.useState)(null),z=U[0],B=U[1],A=(0,i.useState)(""),I=A[0],_=A[1],Q=(0,i.useState)(""),et=Q[0],nt=Q[1],rt=(0,i.useState)(""),ot=rt[0],at=rt[1],lt=(0,i.useState)(""),it=lt[0],ct=lt[1],ut=(0,i.useState)("10:30"),st=ut[0],dt=ut[1],pt=(0,i.useState)("09:30"),mt=pt[0],ft=pt[1],gt=(0,i.useState)("Custom"),yt=gt[0],vt=gt[1],bt=(0,i.useState)(null),ht=bt[0],xt=bt[1],Zt=(0,i.useState)(null),wt=Zt[0],St=Zt[1],Ct=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,i.useState)({currentDate:"",currentDay:0,data:null,debug:null,elapsedSeconds:null,error:null,status:"idle",totalDays:0}),n=e[0],r=e[1],l=(0,i.useRef)(t),c=(0,i.useRef)(null);l.current=t;var u=(0,i.useRef)(null),s=(0,i.useCallback)(function(){var t=(0,a.Z)(o().mark((function t(e){var n,a,i,s,d,p,m,f,g,y,v,b,h,x,Z,w,S,C,V,T,E,k,D;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u.current&&u.current.abort(),u.current=ne
1w AbortController,n=u.current.signal,0!==(a=K(e.startDate,e.endDate)).length){t.next=8;break}return r((function(t){return q(q({},t),{},{error:"No trading days in the selected date range",status:"error"})})),null===(i=(s=l.current).onError)||void 0===i||i.call(s,"No trading days in the selected date range"),t.abrupt("return");case 8:c.current=Date.now(),r({currentDate:"",currentDay:0,data:null,debug:null,elapsedSeconds:null,error:null,status:"fetching",totalDays:a.length}),d=0,p=0,m=0,f=0,g=0,y=0,v={},b={},t.prev=18,Z=o().mark((function t(l){var i,c,u,s,h,x,Z,w,S,C,V,T;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.aborted){t.next=3;break}return console.log("Fetch aborted"),t.abrupt("return",{v:void 0});case 3:return i=a[l],r((function(t){return q(q({},t),{},{currentDate:i,currentDay:l+1})})),c=new URLSearchParams({date:i,endTime:e.endTime,startTime:e.startTime,symbol:e.symbol}),t.next=8,fetch("/api/databento/options/daily/?".concat(c),{signal:n});case 8:if((u=t.sent).ok){t.next=14;break}return t.next=12,u.json();case 12:throw s=t.sent,new Error(s.error||"Failed to fetch ".concat(i));case 14:return t.next=16,u.json();case 16:if(!(h=t.sent).error){t.next=19;break}throw new Error(h.error);case 19:if((x=h.data)&&(d+=x.callVolume,p+=x.putVolume,m+=x.callTrades,f+=x.putTrades,b[i]={callTrades:x.callTrades,callVolume:x.callVolume,date:i,putTrades:x.putTrades,putVolume:x.putVolume},x.byStrike))for(Z=0,w=Object.entries(x.byStrike);Z<w.length;Z++)S=(0,M.Z)(w[Z],2),C=S[0],V=S[1],T=V,v[C]||(v[C]={callVolume:0,expiration:T.expiration,putVolume:0,strike:T.strike}),v[C].callVolume+=T.callVolume,v[C].putVolume+=T.putVolume;h.debug&&(g+=h.debug.definitionCount,y+=h.debug.tradeCount);case 22:case"end":return t.stop()}}),t)})),w=0;case 21:if(!(w<a.length)){t.next=29;break}return t.delegateYield(Z(w),"t0",23);case 23:if("object"!==typeof(S=t.t0)){t.next=26;break}return t.abrupt("return",S.v);case 26:w+=1,t.next=21;break;case 29:C={byDate:b,byStrike:v,callTrades:m,callVolume:d,putTrades:f,putVolume:p,ratio:p>0?d/p:0},V={batchCount:a.length,definitionCount:g,rawRecordCount:y},T=c.current?Math.round((Date.now()-c.current)/1e3):null,r((function(t){return q(q({},t),{},{data:C,debug:V,elapsedSeconds:T,status:"complete"})})),null===(h=(x=l.current).onComplete)||void 0===h||h.call(x,C,V),t.next=44;break;case 37:if(t.prev=37,t.t1=t.catch(18),!n.aborted){t.next=41;break}return t.abrupt("return");case 41:D=t.t1 instanceof Error?t.t1.message:"Unknown error",r((function(t){return q(q({},t),{},{error:D,status:"error"})})),null===(E=(k=l.current).onError)||void 0===E||E.call(k,D);case 44:case"end":return t.stop()}}),t,null,[[18,37]])})));return function(e){return t.apply(this,arguments)}}(),[]),d=(0,i.useCallback)((function(){u.current&&(u.current.abort(),u.current=null),r((function(t){return q(q({},t),{},{status:"idle"})}))}),[]),p=(0,i.useCallback)((function(){u.current&&(u.current.abort(),u.current=null),c.current=null,r({currentDate:"",currentDay:0,data:null,debug:null,elapsedSeconds:null,error:null,status:"idle",totalDays:0})}),[]);return q({cancel:d,reset:p,startFetch:s},n)}(),Vt="fetching"===Ct.status,Tt=(0,i.useRef)(!1),Et=(0,i.useMemo)((function(){return(0,S.lY)()}),[]),kt="symbol-".concat(Et),Dt=(0,i.useCallback)(function(){var t=(0,a.Z)(o().mark((function t(e,n,r,a){var l,i,c,u,s,d,p,m,f,g,y;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return D(!0),xt(null),t.prev=2,l=(0,w.WU)(j.N9.tz(N),"yyyy-MM-dd"),i=F(n,r,a),c=l,u=!1,H(l)?X(i.endTime)||(c=Y(l),u=!0,s="The selected time window (".concat(i.startTime," - ").concat(i.endTime," ET) hasn't completed yet today. Using ").concat(c," instead.")):(c=Y(l),u=!0,s="Today is not a trading day. Using ".concat(c," instead.")),d="".concat(c,"T").concat(i.startTime).concat(J(c)),p="".concat(c,"T").concat(i.endTime).concat(J(c)),m=new URLSearchParams({end:p,start:d,symbol:e.trim().toUpperCase()}),t.next=13,fetch("/api/databento/options/?".concat(m));case 13:return f=t.sent,t.next=16,f.json();case 16:if(g=t.sent,f.ok&&!g.error){t.next=19;break}throw new Error(g.error||"Failed to fetch comparison data");case 19:(y=g.data)&&St({callTrades:y.callTrades,callVolume:y.callVolume,date:c,message:s,putTrades:y.putTrades,putVolume:y.putVolume,ratio:y.ratio,usedPreviousDay:u}),t.next=26;break;case 23:t.prev=23,t.t0=t.catch(2),xt(t.t0 instanceof Error?t.t0.message:"Failed to fetch comparison data");case 26:return t.prev=26,D(!1),t.finish(26);case 29:case"end":return t.stop()}}),t,null,[[2,23,26,29]])}
1)));return function(e,n,r,o){return t.apply(this,arguments)}}(),[]),Ot=(0,i.useCallback)((function(t){B(t),Dt(I,yt,mt,st)}),[I,yt,mt,st,Dt]),Rt=(0,i.useCallback)((function(t){L(t)}),[]),Pt=(0,i.useCallback)((function(t){t.preventDefault(),L(null),B(null),St(null),xt(null),Tt.current=!1;var n=e.trim().toUpperCase();_(n),nt(y),at(d);var r=F(yt,mt,st),o="Custom"===yt?"".concat(mt," \u2013 ").concat(st," ET"):"".concat(yt," (ET)");ct(o),Ct.startFetch({endDate:d,endTime:r.endTime,startDate:y,startTime:r.startTime,symbol:n})}),[e,y,d,yt,mt,st,Ct]);(0,i.useEffect)((function(){"complete"===Ct.status&&Ct.data&&!Tt.current&&(Tt.current=!0,Ot(Ct.data)),"error"===Ct.status&&Ct.error&&Rt(Ct.error)}),[Ct.status,Ct.data,Ct.error,Ot,Rt]);var Ft=(0,i.useCallback)((function(){null!==z&&void 0!==z&&z.byDate&&function(t,e,n,r){var o=Object.values(t).sort((function(t,e){return t.date.localeCompare(e.date)})).map((function(t){return[t.date,t.callVolume,t.putVolume,t.callVolume>0?(t.putVolume/t.callVolume).toFixed(2):"N/A",t.callTrades+t.putTrades]}));$([["Date","Call Volume","Put Volume","P/C Ratio","Trades"]].concat((0,G.Z)(o)).map((function(t){return t.join(",")})).join("\n"),"options_bydate_".concat(e,"_").concat(n,"_").concat(r,".csv"))}(z.byDate,I,et,ot)}),[z,I,et,ot]),Wt=(0,i.useCallback)((function(){if(null===z||void 0===z||!z.byDate||!wt)return null;var t=Object.values(z.byDate).sort((function(t,e){return t.date.localeCompare(e.date)}));if(0===t.length)return null;var e=t.reduce((function(t,e){return t+e.callVolume}),0),n=t.reduce((function(t,e){return t+e.putVolume}),0),r=e/t.length,o=n/t.length,a=r+o,l=wt.callVolume+wt.putVolume,i=wt.callVolume>0?wt.putVolume/wt.callVolume:0,c=r>0?o/r:0,u=function(t,e){return 0===e?null:Number(((t-e)/e*100).toFixed(1))},s=u(i,c),p="\u2014";null!==s&&(s>10?p="\u2191 Put bias":s<-10&&(p="\u2193 Call bias"));var m=F(yt,mt,st);return{comparison:{historicalAvg:{callVolume:Math.round(r),pcRatio:Number(c.toFixed(2)),putVolume:Math.round(o),totalVolume:Math.round(a)},pcRatioChange:s,pcRatioSentiment:p,pcThresholdPct:10,percentChange:{callVolume:u(wt.callVolume,r),putVolume:u(wt.putVolume,o),totalVolume:u(l,a)},today:{callVolume:wt.callVolume,pcRatio:Number(i.toFixed(2)),putVolume:wt.putVolume,totalVolume:l}},dailyBreakdown:t.map((function(t){return{callVolume:t.callVolume,date:t.date,pcRatio:t.callVolume>0?Number((t.putVolume/t.callVolume).toFixed(2)):null,putVolume:t.putVolume,totalVolume:t.callVolume+t.putVolume}})),metadata:{comparisonDate:wt.date,generatedAt:(new Date).toISOString(),historicalRange:{end:d,start:y,tradingDays:t.length},symbol:I,timeWindow:"Custom"===yt?"".concat(m.startTime.slice(0,5)," - ").concat(m.endTime.slice(0,5)," ET"):"".concat(yt," (ET)"),usedPreviousTradingDay:wt.usedPreviousDay}}}),[z,wt,I,y,d,yt,mt,st]),Mt=(0,i.useCallback)((function(){var t=Wt();if(t){var e=JSON.stringify(t,null,2),n=new Blob([e],{type:"application/json"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download="options_analysis_".concat(I,"_").concat((null===wt||void 0===wt?void 0:wt.date)||"today",".json"),o.click()}}),[Wt,I,wt]),jt=(0,i.useCallback)((0,a.Z)(o().mark((function t(){var e,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=Wt()){t.next=3;break}return t.abrupt("return");case 3:return n=JSON.stringify(e,null,2),t.prev=4,t.next=7,navigator.clipboard.writeText(n);case 7:T(!0),setTimeout((function(){return T(!1)}),2e3),t.next=13;break;case 11:t.prev=11,t.t0=t.catch(4);case 13:case"end":return t.stop()}}),t,null,[[4,11]])}))),[Wt]),Lt=e&&y&&d,Ut=(0,i.useMemo)((function(){if(null===z||void 0===z||!z.byDate)return null;var t=Object.values(z.byDate);if(0===t.length)return null;var e=t.reduce((function(t,e){return t+e.callVolume}),0),n=t.reduce((function(t,e){return t+e.putVolume}),0),r=t.reduce((function(t,e){return t+e.callTrades}),0),o=t.reduce((function(t,e){return t+e.putTrades}),0);return{avgCallTrades:r/t.length,avgCallVolume:e/t.length,avgPutTrades:o/t.length,avgPutVolume:n/t.length,dayCount:t.length}}),[z]),zt=function(t,e){if(0===e)return"N/A";var n=(t-e)/e*100;return"".concat(n>=0?"+":"").concat(n.toFixed(1),"%")},Bt=function(t,e){if(0===e)return s.E.grey4;var n=(t-e)/e*100;return n>0?g.cD:n<0?g.PN:s.E.grey4},At=function(t,e){if(0===e||0===t)return{color:s.E.grey4,text:"\u2014"};var n=(t-e)/e*100;return n>10?{color:g.PN,text:"\u2191 Put bias"}:n<-10?{color:g.cD,text:"\u2193 Call bias"}:{color:s.E.grey4,text:"\u2014"}},Nt=z?z.callVolume/(z.callVolume+z.putVolume)*100:50,It=z?z.putVolume/(z.callVolume+z.putVolume)*100:50,_t=null!==z&&void 0!==z&&z.byDate?Object.values(z.byDate).sort((function(t,e){return t.date.localeCompare(e.date)})):[];return(0,l.tZ)("main",{css:g.W2.root},(0,l.tZ)(c.c,null,(0,l.tZ)(b.a,{title:"Options Volume"}),(0,l.tZ)(u.T5,{overrideRootStyles:g.W2.gridContainerRoot},(0,l.tZ)(h.x,null),(0,l.tZ)(u.Jn,null,(0,l.tZ)(u.C4,{lgSpan:4,mdSpan:6,span:4},(0,l.tZ)("h1",null,"Options Volume"),(0,l.tZ)("h2",null,"Call vs Put (OPRA)"))),(0,l.tZ)(u.Jn,null,(0,l.tZ)(u.C4,{lgSpan:4,mdSpan:6,span:4},(0,l.tZ)("form",{css:g.W2.databentoForm,onSubmit:Pt},(0,l.tZ)("div",null,(0,l.tZ)("label",{css:g.W2.databentoLabel,htmlFor:kt},"Underlying Symbol"),(0,l.tZ)("input",{css:g.W2.databentoInput,disabled:Vt,id:kt,onChange:function(t){return n(t.target.value)},placeholder:"AAPL",type:"text",value:e})),(0,l.tZ)(C,{disabled:Vt,endDate:d,onEndDateChange:m,onStartDateChange:x,startDate:y}),(0,l.tZ)(W,{customEndTime:st,customStartTime:mt,disabled:Vt,onChange:vt,onCustomEndTimeChange:dt,onCustomStartTimeChange:ft,selectedPreset:yt}),(0,l.tZ)("button",{css:g.W2.databentoButton,disabled:!Lt||Vt,type:"submit"},Vt?"Loading...":"Get Volume"))),(0,l.tZ)(u.C4,{lgSpan:8,mdSpan:6,span:4},P&&(0,l.tZ)("div",{css:g.W2.databentoError},P),Vt&&(0,l.tZ)(p,{currentDate:Ct.currentDate,currentDay:Ct.currentDay,status:Ct.status,symbol:I,totalDays:Ct.totalDays}),z&&(0,l.tZ)(i.Fragment,null,(0,l.tZ)("h4",{css:tt.metricsTitle},"Historical Volume (",et," \u2013 ",ot,")"),(0,l.tZ)("div",{css:tt.metricsRow},(0,l.tZ)("div",{css:tt.metric},(0,l.tZ)("div",{css:tt.metricLabel},"Call Volume"),(0,l.tZ)("div",{css:[tt.metricValue,tt.callText,""]}
1,z.callVolume.toLocaleString())),(0,l.tZ)("div",{css:tt.metric},(0,l.tZ)("div",{css:tt.metricLabel},"Put Volume"),(0,l.tZ)("div",{css:[tt.metricValue,tt.putText,""]},z.putVolume.toLocaleString())),(0,l.tZ)("div",{css:tt.metric},(0,l.tZ)("div",{css:tt.metricLabel},"P/C Ratio"),(0,l.tZ)("div",{css:tt.metricValue},z.ratio>0?(1/z.ratio).toFixed(2):"N/A"))),(0,l.tZ)("div",{css:tt.ratioBar},(0,l.tZ)("div",{css:tt.ratioBarCall,style:{width:"".concat(Nt,"%")}},Nt>10?"Calls ".concat(Nt.toFixed(0),"%"):""),(0,l.tZ)("div",{css:tt.ratioBarPut,style:{width:"".concat(It,"%")}},It>10?"Puts ".concat(It.toFixed(0),"%"):"")),(0,l.tZ)("p",{css:tt.tradeCounts},z.callTrades.toLocaleString()," call trades,"," ",z.putTrades.toLocaleString()," put trades"),k&&(0,l.tZ)("div",{css:g.W2.databentoLoading},"Fetching today's comparison data..."),ht&&(0,l.tZ)("div",{css:g.W2.databentoError},"Comparison: ",ht),wt&&Ut&&(0,l.tZ)("div",{css:tt.comparisonCard},(0,l.tZ)("h4",{css:tt.comparisonTitle},"Today vs Historical (",Ut.dayCount,"-day avg)"),(0,l.tZ)("div",{css:tt.comparisonRow},(0,l.tZ)("div",{css:tt.comparisonRowHeaderLeft},"Metric"),(0,l.tZ)("div",{css:tt.comparisonRowHeader},wt.date),(0,l.tZ)("div",{css:tt.comparisonRowHeader},"Hist. Avg"),(0,l.tZ)("div",{css:tt.comparisonRowHeader},"Change")),(0,l.tZ)("div",{css:tt.comparisonRow},(0,l.tZ)("div",{css:[tt.comparisonLabel,tt.callText,""]},"Call Volume"),(0,l.tZ)("div",{css:tt.comparisonValue},wt.callVolume.toLocaleString()),(0,l.tZ)("div",{css:tt.comparisonValue},Math.round(Ut.avgCallVolume).toLocaleString()),(0,l.tZ)("div",{css:tt.percentChange,style:{color:Bt(wt.callVolume,Ut.avgCallVolume)}},zt(wt.callVolume,Ut.avgCallVolume))),(0,l.tZ)("div",{css:tt.comparisonRow},(0,l.tZ)("div",{css:[tt.comparisonLabel,tt.putText,""]},"Put Volume"),(0,l.tZ)("div",{css:tt.comparisonValue},wt.putVolume.toLocaleString()),(0,l.tZ)("div",{css:tt.comparisonValue},Math.round(Ut.avgPutVolume).toLocaleString()),(0,l.tZ)("div",{css:tt.percentChange,style:{color:Bt(wt.putVolume,Ut.avgPutVolume)}},zt(wt.putVolume,Ut.avgPutVolume))),(0,l.tZ)("div",{css:tt.comparisonRow},(0,l.tZ)("div",{css:tt.comparisonLabelBold},"Total Volume"),(0,l.tZ)("div",{css:tt.comparisonValueBold},(wt.callVolume+wt.putVolume).toLocaleString()),(0,l.tZ)("div",{css:tt.comparisonValueBold},Math.round(Ut.avgCallVolume+Ut.avgPutVolume).toLocaleString()),(0,l.tZ)("div",{css:tt.percentChange,style:{color:Bt(wt.callVolume+wt.putVolume,Ut.avgCallVolume+Ut.avgPutVolume)}},zt(wt.callVolume+wt.putVolume,Ut.avgCallVolume+Ut.avgPutVolume))),(0,l.tZ)("div",{css:tt.comparisonRow},(0,l.tZ)("div",{css:tt.comparisonLabel},"P/C Ratio"),(0,l.tZ)("div",{css:tt.comparisonValue},wt.callVolume>0?(wt.putVolume/wt.callVolume).toFixed(2):"N/A"),(0,l.tZ)("div",{css:tt.comparisonValue},Ut.avgCallVolume>0?(Ut.avgPutVolume/Ut.avgCallVolume).toFixed(2):"N/A"),(0,l.tZ)("div",{css:tt.percentChange,style:{color:At(wt.callVolume>0?wt.putVolume/wt.callVolume:0,Ut.avgCallVolume>0?Ut.avgPutVolume/Ut.avgCallVolume:0).color}},At(wt.callVolume>0?wt.putVolume/wt.callVolume:0,Ut.avgCallVolume>0?Ut.avgPutVolume/Ut.avgCallVolume:0).text)),wt.message&&(0,l.tZ)("div",{css:tt.comparisonNote},wt.message),(0,l.tZ)("div",{css:tt.exportRow},(0,l.tZ)("button",{css:tt.exportButton,onClick:Mt,type:"button"},"Export JSON"),(0,l.tZ)("button",{css:tt.exportButton,onClick:jt,type:"button"},V?"Copied!":"Copy to Clipboard")))))),z&&_t.length>1&&(0,l.tZ)(u.Jn,null,(0,l.tZ)(u.C4,{lgSpan:12,mdSpan:6,span:4},(0,l.tZ)(R,{comparisonData:wt?{callTrades:wt.callTrades,callVolume:wt.callVolume,date:wt.date,putTrades:wt.putTrades,putVolume:wt.putVolume}:void 0,data:_t,endDate:d,startDate:y,symbol:I,timeRange:it}))),z&&1===_t.length&&wt&&(0,l.tZ)(u.Jn,null,(0,l.tZ)(u.C4,{lgSpan:12,mdSpan:6,span:4},(0,l.tZ)(v,{comparisonData:{callVolume:wt.callVolume,date:wt.date,putVolume:wt.putVolume},historicalData:{callVolume:_t[0].callVolume,date:_t[0].date,putVolume:_t[0].putVolume},symbol:I,timeRange:it}))),_t.length>0&&(0,l.tZ)(u.Jn,null,(0,l.tZ)(u.C4,{lgSpan:12,mdSpan:6,span:4},(0,l.tZ)("div",{css:tt.sectionHeader},(0,l.tZ)("h3",{css:tt.sectionTitle},"Volume by Date"),(0,l.tZ)("button",{css:tt.exportButton,onClick:Ft,type:"button"},"Export CSV")),(0,l.tZ)("table",{css:g.W2.databentoTable},(0,l.tZ)("thead",null,(0,l.tZ)("tr",null,(0,l.tZ)("th",null,"Date"),(0,l.tZ)("th",null,"Call Vol"),(0,l.tZ)("th",null,"Put Vol"),(0,l.tZ)("th",null,"P/C Ratio"),(0,l.tZ)("th",null,"Trades"))),(0,l.tZ)("tbody",null,_t.map((function(t){return(0,l.tZ)("tr",{key:t.date},(0,l.tZ)("td",null,t.date),(0,l.tZ)("td",{css:tt.callText}
1,t.callVolume.toLocaleString()),(0,l.tZ)("td",{css:tt.putText},t.putVolume.toLocaleString()),(0,l.tZ)("td",null,t.callVolume>0?(t.putVolume/t.callVolume).toFixed(2):"N/A"),(0,l.tZ)("td",null,(t.callTrades+t.putTrades).toLocaleString()))})))))),z&&null!=Ct.elapsedSeconds&&(0,l.tZ)(u.Jn,null,(0,l.tZ)(u.C4,{lgSpan:12,mdSpan:6,span:4},(0,l.tZ)("p",{css:tt.fetchMetadata},Ct.totalDays," trading days fetched in"," ",Math.floor(Ct.elapsedSeconds/60),"m"," ",Ct.elapsedSeconds%60,"s"))))))}},21045:function(t,e,n){"use strict";n.d(e,{pH:function(){return d},f8:function(){return p},BK:function(){return m},Wt:function(){return y},oJ:function(){return v},aB:function(){return b},Tw:function(){return h},eD:function(){return x},CW:function(){return Z},K8:function(){return w},ao:function(){return C},Ep:function(){return V}});var r=n(53765),o=n(21066),a=n(21554),l=n(47847),i=n(54940),c=n(74871),u="America/New_York",s=function(t,e){return(0,o.WU)(S(t),e)};function d(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e?S(t):new Date(t);return(0,o.WU)(n,"EEEE, MMMM dd, yyyy")}function p(t){return s(t,"EEE-MMM dd-yyyy")}var m=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/",r="M".concat(n,"d").concat(n,"yy"),i=e?"".concat(r," h:mmaa"):r,c=S(new Date),u=S(t),s=(0,a.j)(c,u);return s>=1?(0,o.WU)(u,i):(0,l.H)(u,c,{addSuffix:!0,locale:{formatDistance:g}})},f={aboutXHours:"{{count}}h",aboutXMonths:"{{count}}m",aboutXWeeks:"{{count}}w",aboutXYears:"{{count}}y",almostXYears:"{{count}}y",halfAMinute:"30s",lessThanXMinutes:"{{count}}m",lessThanXSeconds:"{{count}}s",overXYears:"{{count}}y",xDays:"{{count}}d",xHours:"{{count}}h",xMinutes:"{{count}}m",xMonths:"{{count}}m",xSeconds:"{{count}}s",xWeeks:"{{count}}w",xYears:"{{count}}y"},g=function(t,e){return f[t].replace("{{count}}",e)};function y(t){return s(t,"EEE MM.dd.yy")}function v(t){return s(t,"MM.dd.yy")}function b(t){return s(t,"EEEE MMM.dd, yyyy")}var h=function(t){return s(t,"MMM d, yyyy")},x=function(t){return s(t,"MMMM d, yyyy h:mmaa")},Z=function(t){return t?(0,o.WU)((0,i.Qc)(t,"yyyy-MM-dd",new Date),"MMM d, yyyy"):""},w=function(t){return(0,o.WU)((0,i.Qc)(t,"yyyy-MM-dd",new Date),"MMM d")},S=function(t){return new r.N9(t instanceof Date?t:new Date(t),u)},C=function(t){var e="yyyy-MM-dd",n=(0,i.Qc)(t,e,new Date),r=(0,c.E)(n,1);return(0,o.WU)(r,e)};function V(){var t=r.N9.tz(u),e=(0,r.PC)(u,t,"short");return"".concat((0,o.WU)(t,"EEE, MMM d~h:mmaa")," ").concat(e)}},95292:function(t,e,n){"use strict";n.d(e,{mh:function(){return g},Xv:function(){return y},c:function(){return x}});var r=n(2356),o=n(47982),a=n(39075),l=n(54176),i=n(21613),c=n(42739),u=n.n(c),s=n(80336);function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){d(t,e,n[e])}))}return t}function m(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}
1(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t}function f(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function g(t){var e=t.children,n=t.DANGEROUSLY_SET_Z_INDEX;return v(p({isActive:!0},f(t,["children","DANGEROUSLY_SET_Z_INDEX"]))),(0,a.tZ)(b,{zIndex:n,children:e})}function y(t){var e=t.children,n=t.DANGEROUSLY_SET_Z_INDEX,r=f(t,["children","DANGEROUSLY_SET_Z_INDEX"]);return v(r),(0,a.tZ)(b,{isActive:r.isActive,zIndex:n,children:e})}function v(t){var e=l.useRef(),n=Z();l.useEffect((function(){var r=n.addLayer(t);return e.current=r,function(){return n.removeLayer(r)}}),[]),l.useEffect((function(){var r=e.current;r&&n.updateLayer(r,t)}),[t])}function b(t){var e=t.children,n=t.isActive,r=void 0===n||n,o=t.zIndex,l=void 0===o?"auto":o,c=(0,s.Fg)(),u=Z().container;return u?(0,i.createPortal)((0,a.tZ)(s.f6,{theme:c,children:function(t){var n=t.rootClassName;return(0,a.tZ)("div",{className:n,css:[!r&&{display:"none"},{left:0,position:"absolute",top:0,zIndex:l}],children:e})}}),u):null}var h=l.createContext(null);function x(t){var e=t.children,n=l.useState({}),i=(0,o.Z)(n,2),c=i[0],s=i[1],d=l.useState([]),g=(0,o.Z)(d,2),y=g[0],v=g[1],b=l.useState(null),x=(0,o.Z)(b,2),Z=x[0],w=x[1],S=l.useCallback((function(t){v((function(e){return e.includes(t)?e:e.concat(t)}))}),[]),C=l.useCallback((function(t){v((function(e){return e.includes(t)?e.filter((function(e){return e!==t})):e}))}),[]),V=l.useMemo((function(){return{addLayer:function(t){var e=t.isActive,n=void 0===e||e,o=f(t,["isActive"]),a=u()();return n&&S(a),s((function(t){return m(p({},t),(0,r.Z)({},a,p({id:a},o)))})),a},container:Z,removeLayer:function(t){C(t),s((function(e){var n=p({},e);return delete n[t],n}))},updateLayer:function(t,e){var n=e.isActive,o=f(e,["isActive"]);s((function(e){return m(p({},e),(0,r.Z)({},t,p({},e[t],o)))})),!0===n?S(t):!1===n&&C(t)}}}),[Z,S,C]),T=y.findLast((function(t){var e;return!!(null===(e=c[t])||void 0===e?void 0:e.onDocumentClick)})),E=T?c[T]:void 0,k=y.findLast((function(t){var e;return!!(null===(e=c[t])||void 0===e?void 0:e.onEscape)})),D=k?c[k]:void 0;return l.useEffect((function(){function t(t){var e;null===E||void 0===E||null===(e=E.onDocumentClick)||void 0===e||e.call(E,t)}function e(t){if("Escape"===t.key||"Esc"===t.key){var e;if((document.activeElement instanceof HTMLInputElement||document.activeElement instanceof HTMLTextAreaElement)&&document.activeElement===t.target)return void document.activeElement.blur();null===D||void 0===D||null===(e=D.onEscape)||void 0===e||e.call(D,t)}}return setTimeout((function(){document.addEventListener("click",t)})),document.addEventListener("keyup",e),function(){setTimeout((function(){document.removeEventListener("click",t)})),document.removeEventListener("keyup",e)}}),[E,D]),(0,a.BX)(h.Provider,{value:V,children:[e,(0,a.tZ)("div",{ref:w})]})}function Z(){var t=l.useContext(h);if(!t)throw new Error("This component must be rendered inside of a <LayersProvider>");return t}},70175:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_preview/dashboard/options-data",function(){return n(52460)}])}},function(t){t.O(0,[75092,3051,21066,80336,18503,31012,29910,92888,40179],(function(){return e=70175,t(t.s=e);var e}));var e=t.O();_N_E=e}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.