diff --git a/urbit/bus/vegas/build/.gitkeep b/urbit/bus/vegas/build/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/urbit/bus/vegas/build/1x.png b/urbit/bus/vegas/build/1x.png new file mode 100644 index 000000000..1ffbdd9c9 Binary files /dev/null and b/urbit/bus/vegas/build/1x.png differ diff --git a/urbit/bus/vegas/build/2x.png b/urbit/bus/vegas/build/2x.png new file mode 100644 index 000000000..8aa5fb7c8 Binary files /dev/null and b/urbit/bus/vegas/build/2x.png differ diff --git a/urbit/bus/vegas/build/3x.png b/urbit/bus/vegas/build/3x.png new file mode 100644 index 000000000..7e35f3318 Binary files /dev/null and b/urbit/bus/vegas/build/3x.png differ diff --git a/urbit/bus/vegas/build/404.html b/urbit/bus/vegas/build/404.html new file mode 100644 index 000000000..486413663 --- /dev/null +++ b/urbit/bus/vegas/build/404.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/urbit/bus/vegas/build/_next/static/9-KahasGeWDA7JQs41ULs/_buildmanifest.js b/urbit/bus/vegas/build/_next/static/9-KahasGeWDA7JQs41ULs/_buildmanifest.js new file mode 100644 index 000000000..46a628e7e --- /dev/null +++ b/urbit/bus/vegas/build/_next/static/9-KahasGeWDA7JQs41ULs/_buildmanifest.js @@ -0,0 +1 @@ +self.__BUILD_MANIFEST={__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":["static/chunks/pages/index-b1defe4bc9bdb384.js"],"/_error":["static/chunks/pages/_error-538d45aa2e76147a.js"],sortedPages:["/","/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/urbit/bus/vegas/build/_next/static/9-KahasGeWDA7JQs41ULs/_ssgmanifest.js b/urbit/bus/vegas/build/_next/static/9-KahasGeWDA7JQs41ULs/_ssgmanifest.js new file mode 100644 index 000000000..0511aa895 --- /dev/null +++ b/urbit/bus/vegas/build/_next/static/9-KahasGeWDA7JQs41ULs/_ssgmanifest.js @@ -0,0 +1 @@ +self.__SSG_MANIFEST=new Set,self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB(); \ No newline at end of file diff --git a/urbit/bus/vegas/build/_next/static/chunks/140.1fc98c766ddfc658.js b/urbit/bus/vegas/build/_next/static/chunks/140.1fc98c766ddfc658.js new file mode 100644 index 000000000..41370d292 --- /dev/null +++ b/urbit/bus/vegas/build/_next/static/chunks/140.1fc98c766ddfc658.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[140],{88656:function(e,t,r){var n=r(26548);e.exports=function(e,t,r,i){return n(e,function(e,n,s){t(i,r(e),n,s)}),i}},40933:function(e,t,r){var n=r(88656);e.exports=function(e,t){return function(r,i){return n(r,e,t(i),{})}}},35380:function(e,t,r){var n=r(86874),i=r(40933),s=r(23059),a=Object.prototype.toString,l=i(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=a.call(t)),e[t]=r},n(s));e.exports=l},54014:function(e){var t=Array.prototype.reverse;e.exports=function(e){return null==e?e:t.call(e)}},57140:function(e,t,r){"use strict";let n,i;r.r(t),r.d(t,{default:function(){return rT}});var s,a,l=r(52322),o=r(2784),d=r(95783),c=r(6017),u=r(91233),m=r(27834),h=r(27909),p=r(99862),v=r(74248),g=r(72779),f=r.n(g);n="undefined"!=typeof window?window:"undefined"!=typeof self?self:r.g;let x=null,I=null,_=n.clearTimeout,b=n.setTimeout,j=n.cancelAnimationFrame||n.mozCancelAnimationFrame||n.webkitCancelAnimationFrame,k=n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame;null==j||null==k?(x=_,I=function(e){return b(e,20)}):(x=function([e,t]){j(e),_(t)},I=function(e){let t=k(function(){_(r),e()}),r=b(function(){j(t),e()},20);return[t,r]});class y extends o.Component{constructor(...e){super(...e),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;let{disableHeight:e,disableWidth:t,onResize:r}=this.props;if(this._parentNode){var n,i,s,a;let l=window.getComputedStyle(this._parentNode)||{},o=parseFloat(null!==(n=l.paddingLeft)&&void 0!==n?n:"0"),d=parseFloat(null!==(i=l.paddingRight)&&void 0!==i?i:"0"),c=parseFloat(null!==(s=l.paddingTop)&&void 0!==s?s:"0"),u=parseFloat(null!==(a=l.paddingBottom)&&void 0!==a?a:"0"),m=this._parentNode.getBoundingClientRect(),h=m.height-c-u,p=m.width-o-d,v=this._parentNode.offsetHeight-c-u,g=this._parentNode.offsetWidth-o-d;(e||this.state.height===v&&this.state.scaledHeight===h)&&(t||this.state.width===g&&this.state.scaledWidth===p)||(this.setState({height:v,width:g,scaledHeight:h,scaledWidth:p}),"function"==typeof r&&r({height:v,scaledHeight:h,scaledWidth:p,width:g}))}},this._setRef=e=>{this._autoSizer=e}}componentDidMount(){let{nonce:e}=this.props;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,null!=this._parentNode&&("undefined"!=typeof ResizeObserver?(this._resizeObserver=new ResizeObserver(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(this._parentNode)):(this._detectElementResize=function(e){let t,r,i,s,a,l;let o="undefined"!=typeof document&&document.attachEvent;if(!o){a=function(e){let t=e.__resizeTriggers__,r=t.firstElementChild,n=t.lastElementChild,i=r.firstElementChild;n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,i.style.width=r.offsetWidth+1+"px",i.style.height=r.offsetHeight+1+"px",r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight},l=function(e){if(e.target.className&&"function"==typeof e.target.className.indexOf&&0>e.target.className.indexOf("contract-trigger")&&0>e.target.className.indexOf("expand-trigger"))return;let t=this;a(this),this.__resizeRAF__&&x(this.__resizeRAF__),this.__resizeRAF__=I(function(){(t.offsetWidth!==t.__resizeLast__.width||t.offsetHeight!==t.__resizeLast__.height)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach(function(r){r.call(t,e)}))})};let e=!1,n="";i="animationstart";let o="Webkit Moz O ms".split(" "),d="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" ");{let t=document.createElement("fakeelement");if(void 0!==t.style.animationName&&(e=!0),!1===e){for(let r=0;r div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',i=r.head||r.getElementsByTagName("head")[0],a=r.createElement("style");a.id="detectElementResize",a.type="text/css",null!=e&&a.setAttribute("nonce",e),a.styleSheet?a.styleSheet.cssText=n:a.appendChild(r.createTextNode(n)),i.appendChild(a)}};return{addResizeListener:function(e,t){if(o)e.attachEvent("onresize",t);else{if(!e.__resizeTriggers__){let t=e.ownerDocument,s=n.getComputedStyle(e);s&&"static"===s.position&&(e.style.position="relative"),d(t),e.__resizeLast__={},e.__resizeListeners__=[],(e.__resizeTriggers__=t.createElement("div")).className="resize-triggers";let o=t.createElement("div");o.className="expand-trigger",o.appendChild(t.createElement("div"));let c=t.createElement("div");c.className="contract-trigger",e.__resizeTriggers__.appendChild(o),e.__resizeTriggers__.appendChild(c),e.appendChild(e.__resizeTriggers__),a(e),e.addEventListener("scroll",l,!0),i&&(e.__resizeTriggers__.__animationListener__=function(t){t.animationName===r&&a(e)},e.__resizeTriggers__.addEventListener(i,e.__resizeTriggers__.__animationListener__))}e.__resizeListeners__.push(t)}},removeResizeListener:function(e,t){if(o)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",l,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(i,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}(e),this._detectElementResize.addResizeListener(this._parentNode,this._onResize)),this._onResize()))}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),null!==this._timeoutId&&clearTimeout(this._timeoutId),this._resizeObserver&&(this._resizeObserver.observe(this._parentNode),this._resizeObserver.disconnect()))}render(){let{children:e,defaultHeight:t,defaultWidth:r,disableHeight:n=!1,disableWidth:i=!1,nonce:s,onResize:a,style:l={},tagName:d="div",...c}=this.props,{height:u,scaledHeight:m,scaledWidth:h,width:p}=this.state,v={overflow:"visible"},g={},f=!1;return n||(0===u&&(f=!0),v.height=0,g.height=u,g.scaledHeight=m),i||(0===p&&(f=!0),v.width=0,g.width=p,g.scaledWidth=h),(0,o.createElement)(d,{ref:this._setRef,style:{...v,...l},...c},!f&&e(g))}}var N=r(84693),P=r(24417),w=r(75190),S=r(81548);function R(){let e=(0,w.Z)(["\n fragment PriceLevelFields on PriceLevel {\n price\n volume\n numberOfOrders\n}\n "]);return R=function(){return e},e}function E(){let e=(0,w.Z)(["\n query MarketDepth($marketId: ID!) {\n market(id: $marketId) {\n id\n depth {\n sell {\n ...PriceLevelFields\n }\n buy {\n ...PriceLevelFields\n }\n sequenceNumber\n }\n }\n}\n ",""]);return E=function(){return e},e}function T(){let e=(0,w.Z)(["\n subscription MarketDepthUpdate($marketId: ID!) {\n marketsDepthUpdate(marketIds: [$marketId]) {\n marketId\n sell {\n ...PriceLevelFields\n }\n buy {\n ...PriceLevelFields\n }\n sequenceNumber\n previousSequenceNumber\n }\n}\n ",""]);return T=function(){return e},e}let D=(0,S.Ps)(R()),A=(0,S.Ps)(E(),D),O=(0,S.Ps)(T(),D);var L=r(96450),C=r(12436),V=r.n(C),z=r(3440),M=r.n(z);(s=a||(a={}))[s.bid=0]="bid",s[s.ask=1]="ask";let H=(e,t)=>{let r=BigInt(e),n=BigInt(t),i=r/n*n;return r-i>=t/2&&(i+=BigInt(t)),i.toString()},X=(e,t)=>{if(e.length){let r=e.length-1;if(t===a.bid)for(let t=0;t<=r;t++)e[t].cumulativeVol=e[t].volume+(0!==t?e[t-1].cumulativeVol:0);else for(let t=r;t>=0;t--)e[t].cumulativeVol=e[t].volume+(t!==r?e[t+1].cumulativeVol:0)}},F=(e,t,r)=>{let n=M()(e,e=>H(e.price,r)),i=[];return Object.keys(n).forEach(e=>{let{volume:t}=n[e].pop(),r=Number(t),s=n[e].pop();for(;s;)r+=Number(s.volume),s=n[e].pop();i.push({price:e,volume:r,cumulativeVol:0})}),i.sort((e,t)=>e===t?0:BigInt(e.price)>BigInt(t.price)?-1:1),X(i,t),i},$=function(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=[...e];return t.forEach(e=>{let t=n.findIndex(t=>t.price===e.price);-1!==t?"0"===e.volume?n.splice(t,1):n[t]=e:"0"!==e.volume&&(-1!==(t=n.findIndex(t=>r?BigInt(t.price)>BigInt(e.price):BigInt(t.price){let{numberOfSellRows:t,numberOfBuyRows:r,lastTradedPrice:n,overlap:i,bestStaticBidPrice:s,bestStaticOfferPrice:a}=e,l=Array(t).fill(void 0),o=Number(n)+(t-Math.ceil(i/2)+1),d=l.map((e,r)=>({price:(o-=1).toString(),volume:(t-r+1).toString(),numberOfOrders:""}));o+=i,l=Array(r).fill(void 0);let c=l.map((e,t)=>({price:(o-=1).toString(),volume:(t+2).toString(),numberOfOrders:""}));return{asks:d,bids:c,lastTradedPrice:n,bestStaticBidPrice:s.toString(),bestStaticOfferPrice:a.toString()}};var B=r(95876);let W=(e,t,r)=>{if(!e)return e;for(let s of t){var n,i;if(s.marketId!==e.id)continue;if(BigInt(s.sequenceNumber)<=BigInt(e.depth.sequenceNumber))break;if(s.previousSequenceNumber!==e.depth.sequenceNumber){(0,B.Tb)(Error("Sequence number gap between delta previousSequenceNumber and stored sequence number in marketsDepthUpdate for market ".concat(e.id,"; ").concat(s.previousSequenceNumber," !== ").concat(e.depth.sequenceNumber,", data provider reload"))),r();break}let t={...e,depth:{...e.depth}};return s.buy&&(t.depth.buy=$(null!==(n=e.depth.buy)&&void 0!==n?n:[],s.buy,!1)),s.sell&&(t.depth.sell=$(null!==(i=e.depth.sell)&&void 0!==i?i:[],s.sell,!0)),t.depth.sequenceNumber=s.sequenceNumber,t}return e},G=e=>(null==e?void 0:e.market)||null,K=(0,u.S8)({query:A,subscriptionQuery:O,update:W,getData:G,getDelta:e=>e.marketsDepthUpdate});var U=r(84636),Z=r.n(U),Y=r(54014),J=r.n(Y);let Q=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{price:Number((0,d.x$)(e.price,t)),volume:Number((0,d.x$)(e.volume,r))}},ee=function(e,t,r,n){let i=!(arguments.length>4)||void 0===arguments[4]||arguments[4];return Z()(J()(t||[]),"price").forEach(t=>{let s=Q(t,r,n),a=e.findIndex(e=>Math.abs(e.price-s.price)<10**-(r+1));-1!==a?"0"===t.volume?e.splice(a,1):Object.assign(e[a],s):"0"!==t.volume&&(-1!==(a=e.findIndex(e=>i?e.price>s.price:e.price(0,et.$G)("market-depth").t,en=(e,t)=>Number((0,d.x$)(e,t)),ei=(e,t,r)=>(null==t?void 0:t.length)&&(null==e?void 0:e.length)?en(((BigInt(t[0].price)+BigInt(e[0].price))/BigInt(2)).toString(),r):void 0,es=e=>{let{marketId:t}=e,r=er(),{theme:n}=(0,c.Ek)(),i=(0,o.useMemo)(()=>({marketId:t}),[t]),[s,a]=(0,o.useState)(null),p=(0,o.useRef)(null),v=(0,o.useRef)(null),g=(0,o.useRef)(null),f=(0,o.useRef)({sell:[],buy:[]}),{data:x,error:I,loading:_}=(0,u.x5)({dataProvider:h.cD,skipUpdates:!0,variables:i}),b=(0,o.useMemo)(()=>V()(()=>{var e,t;p.current&&v.current&&x&&(p.current={...p.current,midPrice:ei(null===(e=g.current)||void 0===e?void 0:e.depth.sell,null===(t=g.current)||void 0===t?void 0:t.depth.buy,x.decimalPlaces),data:{buy:f.current.buy.length?ee(p.current.data.buy,f.current.buy,x.decimalPlaces,x.positionDecimalPlaces,!1):p.current.data.buy,sell:f.current.sell.length?ee(p.current.data.sell,f.current.sell,x.decimalPlaces,x.positionDecimalPlaces,!0):p.current.data.sell}},f.current.buy=[],f.current.sell=[],a(p.current))},250),[x]);(0,o.useEffect)(()=>{f.current.buy=[],f.current.sell=[]},[t]);let j=(0,o.useCallback)(e=>{let{delta:r,data:n}=e;if(!p.current)return!1;for(let e of r||[])e.marketId===t&&(e.sell&&f.current.sell.push(...e.sell),e.buy&&f.current.buy.push(...e.buy),g.current=n,b());return!0},[t,b]),{data:k,error:y,loading:N}=(0,u.x5)({dataProvider:K,update:j,variables:i}),P=(0,o.useCallback)(e=>{let{data:t}=e;return v.current=t,b(),!0},[b]),{data:w,error:S,loading:R}=(0,u.x5)({dataProvider:h.wW,update:P,variables:i});!v.current&&w&&(v.current=w),(0,o.useEffect)(()=>{var e,t,r,n;if(w&&x&&k){if(!k){p.current=null,a(p.current);return}return p.current={midPrice:ei(k.depth.sell,k.depth.buy,x.decimalPlaces),data:{buy:null!==(r=null===(e=k.depth.buy)||void 0===e?void 0:e.map(e=>Q(e,x.decimalPlaces,x.positionDecimalPlaces)))&&void 0!==r?r:[],sell:null!==(n=null===(t=k.depth.sell)||void 0===t?void 0:t.map(e=>Q(e,x.decimalPlaces,x.positionDecimalPlaces)))&&void 0!==n?n:[]}},g.current=k,a(p.current),()=>{b.cancel()}}},[k,w,x,b]);let E=(0,o.useCallback)(e=>(0,d.uf)(e,(null==x?void 0:x.positionDecimalPlaces)||0),[null==x?void 0:x.positionDecimalPlaces]),T=(0,o.useCallback)(e=>(0,d.uf)(e,(null==x?void 0:x.decimalPlaces)||0),[null==x?void 0:x.decimalPlaces]);return(0,l.jsx)(m.MA,{loading:N||_||R,error:y||I||S,data:k,children:s&&(0,l.jsx)(L.ol,{...s,theme:n,volumeFormat:E,priceFormat:T,notEnoughDataText:(0,l.jsx)("span",{className:"text-center text-xs",children:r("No open orders")})})})};var ea=r(80150);let el=(0,o.memo)(e=>{let{volume:t,cumulativeVolume:r,decimalPlaces:n,positionDecimalPlaces:i,priceFormatDecimalPlaces:s,price:o,onClick:c,type:u,width:m,maxVol:h}=e,p=u===a.bid?"bid":"ask";return(0,l.jsxs)("div",{className:"relative px-1",children:[(0,l.jsx)(ed,{cumulativeVolume:r,type:u,maxVol:h}),(0,l.jsxs)("div",{"data-testid":"".concat(p,"-rows-container"),className:f()("grid gap-1 text-right","grid-cols-".concat(m>=260?3:m>=190?2:1)),children:[(0,l.jsx)(eo,{onClick:()=>c({price:(0,d.x$)(o,n)}),children:(0,l.jsx)(ea.dX,{testId:"price-".concat(o),value:BigInt(o),valueFormatted:(0,d.Gb)(o,n,s),className:f()({"text-market-red dark:text-market-red":u===a.ask,"text-market-green-600 dark:text-market-green":u===a.bid})})}),m>=190&&(0,l.jsx)(eo,{onClick:()=>c({size:(0,d.x$)(t,i)}),children:(0,l.jsx)(ea.dX,{testId:"".concat(p,"-vol-").concat(o),value:t,valueFormatted:(0,d.Gb)(t,null!=i?i:0)})}),m>=260&&(0,l.jsx)(eo,{onClick:()=>c({size:(0,d.x$)(r,i)}),children:(0,l.jsx)(ea.dX,{testId:"cumulative-vol-".concat(o),value:r,valueFormatted:(0,d.Gb)(r,i)})})]})]})});el.displayName="OrderbookRow";let eo=e=>{let{children:t,onClick:r}=e;return(0,l.jsx)("button",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-right hover:bg-neutral-200 hover:dark:bg-neutral-800",onClick:r,children:t})},ed=e=>{let{cumulativeVolume:t=0,type:r,maxVol:n}=e;return(0,l.jsx)("div",{"data-testid":"".concat(a.bid===r?"bid":"ask","-bar"),className:f()("absolute left-0 top-0 h-full",r===a.bid?"bg-market-green/10 dark:bg-market-green/10":"bg-market-red/10 dark:bg-market-red/10"),style:{width:"".concat(t/n*100,"%")}})},ec=e=>{let{lastTradedPrice:t,resolution:r,decimalPlaces:n,setResolution:i}=e,[s,a]=(0,o.useState)(!1),d=em(t,n),c=()=>{let e=d.indexOf(r);e{let e=d.indexOf(r);e>0&&i(d[e-1])};return(0,l.jsxs)("div",{className:"flex h-6",children:[(0,l.jsx)("button",{onClick:c,disabled:d.indexOf(r)>=d.length-1,className:"flex items-center px-2 border-r cursor-pointer border-default disabled:cursor-default","data-testid":"plus-button",children:(0,l.jsx)(m.rT,{size:12,name:m.RW.PLUS})}),(0,l.jsx)(m.f1,{open:s,onOpenChange:e=>a(e),trigger:(0,l.jsx)(m.o0,{"data-testid":"resolution",children:(0,l.jsxs)("button",{className:"flex items-center justify-between px-2 gap-1",style:{minWidth:"".concat(Math.max.apply(null,d.map(e=>eu(e,n).length))+5,"ch")},children:[(0,l.jsx)(m.rT,{size:12,name:s?m.RW.CHEVRON_UP:m.RW.CHEVRON_DOWN}),eu(r,n)]})}),children:(0,l.jsx)(m.LT,{align:"start",children:d.map(e=>(0,l.jsx)(m.WC,{onClick:()=>i(e),className:"justify-end",children:eu(e,n)},e))})}),(0,l.jsx)("button",{onClick:u,disabled:0>=d.indexOf(r),className:"flex items-center px-2 cursor-pointer border-x border-default disabled:cursor-default","data-testid":"minus-button",children:(0,l.jsx)(m.rT,{size:12,name:m.RW.MINUS})})]})},eu=(e,t)=>(0,d.lm)(e,t).replace(/\.?0+$/,""),em=(e,t)=>{var r;let n=Math.max(null!==(r=e.length)&&void 0!==r?r:0,t+1),i=Array(n).fill(null).map((e,t)=>Math.pow(10,t)),s=[2,5,20,50,200,500].concat(i);s.sort((e,t)=>e-t);let a=s.filter(e=>e<=i[i.length-1]);return a},eh=e=>{let{rows:t,resolution:r,type:n,decimalPlaces:i,positionDecimalPlaces:s,priceFormatDecimalPlaces:o,onClick:d,width:c,maxVol:u}=e;return(0,l.jsx)("div",{className:f()("flex flex-col",n===a.ask?"justify-end":"justify-start"),children:(0,l.jsx)("div",{className:"grid",style:{gridAutoRows:17,gap:1},children:t.map(e=>(0,l.jsx)(el,{price:e.price,onClick:d,decimalPlaces:i,positionDecimalPlaces:s,priceFormatDecimalPlaces:o,volume:e.volume,cumulativeVolume:e.cumulativeVol,type:n,width:c,maxVol:u},e.price))})})},ep=e=>{let{lastTradedPrice:t,decimalPlaces:r,assetSymbol:n,bestAskPrice:i,bestBidPrice:s}=e,a=er(),u=(0,c.D9)(t),h=(0,o.useRef)("none"),p=(BigInt(i)-BigInt(s)).toString();return u!==t&&(h.current=Number(u)>Number(t)?"down":"up"),(0,l.jsxs)("div",{className:"flex items-center justify-center text-base gap-2",children:["none"!==h.current&&(0,l.jsx)("span",{className:f()("flex flex-col justify-center",{"text-market-green-600 dark:text-market-green":"up"===h.current,"text-market-red dark:text-market-red":"down"===h.current}),children:(0,l.jsx)(m.rT,{name:"up"===h.current?m.RW.ARROW_UP:m.RW.ARROW_DOWN})}),(0,l.jsx)("span",{className:"font-mono text-[15px]","data-testid":"last-traded-".concat(t),title:a("Last traded price"),children:(0,d.lm)(t,r)}),(0,l.jsx)("span",{children:n}),(0,l.jsxs)("span",{title:a("Spread"),className:"font-mono text-xs text-muted","data-testid":"spread",children:["(",(0,d.lm)(p,r),")"]})]})},ev=e=>{let{decimalPlaces:t,positionDecimalPlaces:r,onClick:n,lastTradedPrice:i,asks:s,bids:d,assetSymbol:c}=e,u=er(),[h,p]=(0,o.useState)(1),v=(0,o.useMemo)(()=>F(s,a.ask,h),[s,h]),g=(0,o.useMemo)(()=>F(d,a.bid,h),[d,h]),f=s[0]?s[0].price:"0",x=d[0]?d[0].price:"0",I=Math.ceil(t-Math.log10(h));return(0,l.jsxs)("div",{className:"h-full text-xs grid grid-rows-[1fr_min-content] overflow-hidden",children:[(0,l.jsx)("div",{children:(0,l.jsx)(y,{children:e=>{let{width:s,height:o}=e,d=Math.max(1,Math.floor((o-30)/2/18)),p=v.slice(-1*d),_=g.slice(0,d),b=p[0],j=_[_.length-1],k=Math.max((null==b?void 0:b.cumulativeVol)||0,(null==j?void 0:j.cumulativeVol)||0);return(0,l.jsx)("div",{className:"overflow-hidden grid relative","data-testid":"orderbook-grid-element",style:{width:s,height:o,gridTemplateRows:"1fr ".concat(30,"px 1fr")},children:p.length||_.length?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eh,{rows:p,type:a.ask,resolution:h,decimalPlaces:t,positionDecimalPlaces:r,priceFormatDecimalPlaces:I,onClick:n,width:s,maxVol:k}),(0,l.jsx)(ep,{lastTradedPrice:i,decimalPlaces:t,assetSymbol:c,bestAskPrice:f,bestBidPrice:x}),(0,l.jsx)(eh,{rows:_,type:a.bid,resolution:h,decimalPlaces:t,positionDecimalPlaces:r,priceFormatDecimalPlaces:I,onClick:n,width:s,maxVol:k})]}):(0,l.jsx)("div",{className:"absolute inset-0",children:(0,l.jsx)(m.hX,{children:u("No open orders")})})})}})}),(0,l.jsx)("div",{className:"border-t border-default",children:(0,l.jsx)(ec,{lastTradedPrice:i,resolution:h,decimalPlaces:t,setResolution:p})})]})},eg=e=>{var t,r;let{marketId:n,onClick:i}=e,s={marketId:n},{data:a,error:o,loading:d,reload:c}=(0,u.x5)({dataProvider:K,variables:s}),{data:p,error:v,loading:g}=(0,u.x5)({dataProvider:h.cD,skipUpdates:!0,variables:s}),{data:f,error:x,loading:I}=(0,u.x5)({dataProvider:h.wW,variables:s});return(0,l.jsx)(m.MA,{loading:d||I||g,error:o||x||v,data:a,reload:c,children:p&&f&&(0,l.jsx)(ev,{bids:null!==(t=null==a?void 0:a.depth.buy)&&void 0!==t?t:[],asks:null!==(r=null==a?void 0:a.depth.sell)&&void 0!==r?r:[],decimalPlaces:p.decimalPlaces,positionDecimalPlaces:p.positionDecimalPlaces,assetSymbol:(0,h.ec)(p),onClick:i,lastTradedPrice:f.lastTradedPrice})})},ef=e=>{let{decimalPlaces:t,...r}=e;return(0,l.jsx)("div",{className:"absolute inset-0 bg-white dark:bg-black dark:text-neutral-200 text-neutral-800",children:(0,l.jsx)("div",{className:"absolute top-0 bottom-0 left-0",style:{width:"400px"},children:(0,l.jsx)(ev,{positionDecimalPlaces:0,decimalPlaces:t,...q({...r}),assetSymbol:"USD",onClick:()=>void 0})})})},ex=e=>(0,l.jsx)(ef,{...e}),eI=ex.bind({});eI.args={numberOfSellRows:100,numberOfBuyRows:100,bestStaticBidPrice:1e3,bestStaticOfferPrice:1e3,decimalPlaces:3,overlap:-1};let e_=ex.bind({});e_.args={numberOfSellRows:100,numberOfBuyRows:100,bestStaticBidPrice:122905,bestStaticOfferPrice:122895,decimalPlaces:3,overlap:10};let eb=ex.bind({});eb.args={numberOfSellRows:0,numberOfBuyRows:0,bestStaticBidPrice:0,bestStaticOfferPrice:0,decimalPlaces:3,overlap:0};var ej=r(62832),ek=r(34498),ey=r.n(ek);function eN(){let e=(0,w.Z)(["\n fragment TradeFields on Trade {\n id\n price\n size\n createdAt\n aggressor\n market {\n id\n }\n}\n "]);return eN=function(){return e},e}function eP(){let e=(0,w.Z)(["\n fragment TradeUpdateFields on TradeUpdate {\n id\n price\n size\n createdAt\n marketId\n aggressor\n}\n "]);return eP=function(){return e},e}function ew(){let e=(0,w.Z)(["\n query Trades($marketId: ID!, $pagination: Pagination) {\n trades(filter: {marketIds: [$marketId]}, pagination: $pagination) {\n edges {\n node {\n ...TradeFields\n }\n cursor\n }\n pageInfo {\n startCursor\n endCursor\n hasNextPage\n hasPreviousPage\n }\n }\n}\n ",""]);return ew=function(){return e},e}function eS(){let e=(0,w.Z)(["\n subscription TradesUpdate($marketId: ID!) {\n tradesStream(filter: {marketIds: [$marketId]}) {\n ...TradeUpdateFields\n }\n}\n ",""]);return eS=function(){return e},e}let eR=(0,S.Ps)(eN()),eE=(0,S.Ps)(eP()),eT=(0,S.Ps)(ew(),eR),eD=(0,S.Ps)(eS(),eE),eA=e=>{var t;return(null==e?void 0:null===(t=e.trades)||void 0===t?void 0:t.edges.map(e=>({...e.node,cursor:e.cursor})))||[]},eO=e=>(null==e?void 0:e.tradesStream)||[],eL=e=>{let{marketId:t,...r}=e;return{...r,__typename:"Trade",market:{__typename:"Market",id:t}}},eC=e=>t=>{let{market:r,...n}=eL(t);return{...n,market:e[r.id]}},eV=(e,t,r,n)=>{let i=e?[...e]:[];return ey()(t,"createdAt","desc").forEach(t=>{var r;let s=null!==(r=null==e?void 0:e.findIndex(e=>e.id===t.id))&&void 0!==r?r:-1;-1!==s?i[s]={...i[s],...n(t)}:(null==e?void 0:e.length)&&!(t.createdAt>=e[0].createdAt)||i.unshift(n(t))}),i.slice(0,500)},ez=e=>{var t;return(null==e?void 0:null===(t=e.trades)||void 0===t?void 0:t.pageInfo)||null},eM=(0,u.S8)({query:eT,subscriptionQuery:eD,update:(e,t,r,n)=>eV(e,t,n,eL),getData:eA,getDelta:eO,pagination:{getPageInfo:ez,append:u.Ao,last:500},fetchPolicy:"no-cache",getSubscriptionVariables:e=>{let{marketId:t}=e;return{marketId:t}}}),eH=(0,u.cv)([eM,(e,t)=>(0,h.Lq)(e,t,void 0)],(e,t,r,n)=>r&&n[0].isUpdate?eV(r,n[0].delta,t,eC(e[1])):(e[0]||[]).map(t=>({...t,market:e[1][t.market.id]})));var eX=r(7627);let eF=()=>(0,et.$G)("trades").t,e$=e=>{var t,r;let{node:n}=e,i="";return(null===(t=n.data)||void 0===t?void 0:t.aggressor)===eX.Side.SIDE_BUY?i="text-market-green-600 dark:text-market-green":(null===(r=n.data)||void 0===r?void 0:r.aggressor)===eX.Side.SIDE_SELL&&(i="text-market-red dark:text-market-red"),["font-mono text-right",i].join(" ")},eq=e=>{let{onClick:t,...r}=e,n=eF(),i=(0,o.useMemo)(()=>[{headerName:n("Price"),field:"price",type:"rightAligned",cellClass:e$,valueFormatter:e=>{let{value:t,data:r}=e;return t&&(null==r?void 0:r.market)?(0,d.lm)(t,r.market.decimalPlaces):""},cellRenderer:e=>{let{value:r,data:n}=e;return(null==n?void 0:n.market)&&r?(0,l.jsx)("button",{onClick:()=>{var e;return t&&t((0,d.x$)(r,(null===(e=n.market)||void 0===e?void 0:e.decimalPlaces)||0))},className:"hover:dark:bg-vega-cdark-800 hover:bg-vega-clight-800",children:(0,d.lm)(r,n.market.decimalPlaces)}):""}},{headerName:n("Size"),field:"size",type:"rightAligned",valueFormatter:e=>{let{value:t,data:r}=e;return t&&(null==r?void 0:r.market)?(0,d.lm)(t,r.market.positionDecimalPlaces):""},cellRenderer:ea.dX},{headerName:n("Created at"),field:"createdAt",type:"rightAligned",cellClass:"text-right",flex:1,valueFormatter:e=>{let{value:t}=e;return t&&(0,d.pv)().format(new Date(t))}}],[t,n]);return(0,l.jsx)(ea.cX,{getRowId:e=>{let{data:t}=e;return t.id},columnDefs:i,rowHeight:22,...r})};var eB=r(47535);let eW=e=>{let{marketId:t,gridProps:r}=e,n=eF(),i=(0,eB.kz)(e=>e.updateAll),{data:s,error:a}=(0,u.x5)({dataProvider:eH,variables:{marketId:t}});return(0,l.jsx)(eq,{rowData:s,onClick:e=>{i(t,{price:e})},overlayNoRowsTemplate:a?a.message:n("No trades"),...r})};var eG=r(2140),eK=r(12294),eU=r(47832);let eZ=e=>{let{marketId:t}=e,r=eY(e=>e.gridStore),n=eY(e=>e.updateGridStore),i=(0,ea.TO)(r,n);return(0,l.jsx)(eW,{marketId:t,gridProps:i})},eY=(0,eK.Ue)()((0,eU.tJ)(eG.V,{name:"vega_trades_store"}));var eJ=r(42028);let eQ=()=>(0,l.jsx)(eJ.Z,{updateGridStore:eY(e=>e.updateGridStore)});var e0=r(39626),e1=r(9834);let e5=e=>{let{marketId:t}=e,r=(0,e1.y)(),n=(0,eB.kz)(e=>e.updateAll),i=(0,e0.Ap)(e=>e.setViews);return(0,l.jsx)(eg,{marketId:t,onClick:e=>{n(t,e),i({type:e0.bW.Order},r)}})};var e2=r(95756),e4=r(34209),e3=r(65395),e8=r(73696),e6=r(60417),e7=r.n(e6),e9=r(829),te=r.n(e9);r(94167);var tt=r(55168);let tr=e=>{let t=new Date;switch(e){case tn.RANGE_1D:return new Date(t.setDate(t.getDate()-1)).toISOString();case tn.RANGE_7D:return new Date(t.setDate(t.getDate()-7)).toISOString();case tn.RANGE_1M:return new Date(t.setMonth(t.getMonth()-1)).toISOString();case tn.RANGE_3M:return new Date(t.setMonth(t.getMonth()-3)).toISOString();case tn.RANGE_1Y:return new Date(t.setFullYear(t.getFullYear()-1)).toISOString();case tn.RANGE_YTD:return new Date(t.setMonth(0)).toISOString();default:return}},tn={RANGE_1D:"1D",RANGE_7D:"7D",RANGE_1M:"1M",RANGE_3M:"3M",RANGE_1Y:"1Y",RANGE_YTD:"YTD",RANGE_ALL:"All"},ti=e=>"".concat((100*e).toFixed(4),"%"),ts=e=>{let{marketId:t}=e,r=(0,tt.N)(),{theme:n}=(0,c.Ek)(),i=(0,o.useMemo)(()=>({marketId:t||"",dateRange:{start:tr(tn.RANGE_7D)}}),[t]),{data:s}=(0,h.T_)({variables:i,skip:!t}),a=(0,o.useMemo)(()=>{if(!(null==s?void 0:s.fundingPeriods.edges.length))return null;let e=e7()(null==s?void 0:s.fundingPeriods.edges).filter(e=>e.node.endTime).reduce((e,t)=>(t.node.endTime&&(null==e||e.push({endTime:(0,d.vf)(t.node.endTime),fundingRate:Number(t.node.fundingRate)})),e),[]);return{cols:["Date",r("Funding rate")],rows:te()(e,"endTime").map(e=>[e.endTime,e.fundingRate])}},[null==s?void 0:s.fundingPeriods.edges,r]);return s&&(null==a?void 0:a.rows.length)?(0,l.jsx)(L.wW,{data:a,theme:n,priceFormat:ti,yAxisTickFormat:"%"}):(0,l.jsxs)(m.hX,{children:[" ",r("No funding history data")]})};var ta=r(58970),tl=r(1954),to=r(39494),td=r(39651);let tc=()=>{let e=(0,tt.N)(),{pubKey:t,isReadOnly:r}=(0,to.qt)(),n=(0,td.K)(!0),i=tu(e=>e.gridStore),s=tu(e=>e.updateGridStore),a=(0,ea.TO)(i,e=>{s(e)});return t?(0,l.jsx)(ej.sG,{partyId:t,onMarketClick:n,isReadOnly:r,gridProps:a}):(0,l.jsx)(m.hX,{children:e("Please connect Vega wallet")})},tu=(0,eK.Ue)()((0,eU.tJ)(eG.V,{name:"vega_stop_orders_store"})),tm=()=>(0,l.jsx)(eJ.Z,{updateGridStore:tu(e=>e.updateGridStore)});var th=r(22787),tp=r(17136),tv=r(35380),tg=r.n(tv);let tf="trading-view",tx=()=>(0,et.$G)(tf).t,tI=()=>(0,et.$G)(tf).i18n.language;var t_=r(56675);function tb(){let e=(0,w.Z)(["\n fragment Bar on Candle {\n periodStart\n lastUpdateInPeriod\n high\n low\n open\n close\n volume\n}\n "]);return tb=function(){return e},e}function tj(){let e=(0,w.Z)(["\n query GetBars($marketId: ID!, $interval: Interval!, $since: String!, $to: String) {\n market(id: $marketId) {\n id\n decimalPlaces\n positionDecimalPlaces\n candlesConnection(\n interval: $interval\n since: $since\n to: $to\n pagination: {last: 5000}\n ) {\n edges {\n node {\n ...Bar\n }\n }\n }\n }\n}\n ",""]);return tj=function(){return e},e}function tk(){let e=(0,w.Z)(["\n subscription LastBar($marketId: ID!, $interval: Interval!) {\n candles(marketId: $marketId, interval: $interval) {\n ...Bar\n }\n}\n ",""]);return tk=function(){return e},e}let ty=(0,S.Ps)(tb()),tN=(0,S.Ps)(tj(),ty),tP=(0,S.Ps)(tk(),ty);function tw(){let e=(0,w.Z)(["\n query Symbol($marketId: ID!) {\n market(id: $marketId) {\n id\n decimalPlaces\n positionDecimalPlaces\n tradableInstrument {\n instrument {\n code\n name\n metadata {\n tags\n }\n product {\n ... on Future {\n __typename\n }\n ... on Perpetual {\n __typename\n }\n }\n }\n }\n }\n}\n "]);return tw=function(){return e},e}let tS=(0,S.Ps)(tw()),tR="VEGA",tE={"1T":eX.Interval.INTERVAL_BLOCK,1:eX.Interval.INTERVAL_I1M,5:eX.Interval.INTERVAL_I5M,15:eX.Interval.INTERVAL_I15M,30:eX.Interval.INTERVAL_I30M,60:eX.Interval.INTERVAL_I1H,240:eX.Interval.INTERVAL_I4H,360:eX.Interval.INTERVAL_I6H,480:eX.Interval.INTERVAL_I8H,720:eX.Interval.INTERVAL_I12H,"1D":eX.Interval.INTERVAL_I1D,"1W":eX.Interval.INTERVAL_I7D},tT=Object.keys(tE),tD={supported_resolutions:tT},tA=e=>{let t=(0,o.useRef)(!1),r=(0,o.useRef)(),n=(0,t_.x)(),s=(0,o.useMemo)(()=>({setSymbol:e=>{i=e},onReady:t=>{i=e,setTimeout(()=>t(tD))},searchSymbols:()=>{},resolveSymbol:async(e,t,r)=>{try{let s=await n.query({query:tS,variables:{marketId:i||e}});if(!s.data.market){r("Cannot resolve symbol: market not found");return}let a=s.data.market,l=a.tradableInstrument.instrument,o=l.product.__typename;if(!o){r("Cannot resolve symbol: invalid product type");return}let c="undefined";"Future"===o||"Perpetual"===o?c="futures":"Spot"===o&&(c="spot");let u=(0,d.jF)(l.metadata.tags),m=u?Math.floor(u.getTime()/1e3):void 0,h={ticker:a.id,name:l.code,full_name:"".concat(tR,":").concat(l.code),description:l.name,listed_exchange:tR,expired:"Perpetual"!==o,expiration_date:m,format:"price",type:c,session:"24x7",timezone:"Etc/UTC",exchange:tR,minmov:1,pricescale:Number("1"+"0".repeat(a.decimalPlaces)),visible_plots_set:"ohlc",volume_precision:a.positionDecimalPlaces,data_status:"streaming",delay:1e3,has_intraday:!0,has_empty_bars:!0,has_ticks:!1,vegaDecimalPlaces:a.decimalPlaces,vegaPositionDecimalPlaces:a.positionDecimalPlaces};t(h)}catch(e){r("Cannot resolve symbol")}},getBars:async(e,r,i,s,a)=>{if(!e.ticker){a("No symbol.ticker");return}try{var l,o;let a=await n.query({query:tN,variables:{marketId:e.ticker,since:tL(i.from).toISOString(),to:tL(i.to).toISOString(),interval:tE[r]}}),d=e7()(null===(l=a.data.market)||void 0===l?void 0:null===(o=l.candlesConnection)||void 0===o?void 0:o.edges);if(!d.length){s([],{noData:!0});return}let c=d.map(t=>tO(t.node,e.vegaDecimalPlaces,e.vegaPositionDecimalPlaces));t.current=!0,s(c,{noData:!1})}catch(e){a(e instanceof Error?e.message:"Failed to get bars")}},subscribeBars:(e,i,s)=>{if(!e.ticker)throw Error("No symbolInfo.ticker");t.current&&(r.current=n.subscribe({query:tP,variables:{marketId:e.ticker,interval:tE[i]}}).subscribe(t=>{let{data:r}=t;if(r){let t=tO(r.candles,e.vegaDecimalPlaces,e.vegaPositionDecimalPlaces);s(t)}}))},unsubscribeBars:()=>{r.current&&r.current.unsubscribe()}}),[n,e]);return(0,o.useEffect)(()=>()=>{r.current&&r.current.unsubscribe()},[]),s},tO=(e,t,r)=>({time:new Date(e.periodStart).getTime(),low:(0,d._L)(e.low,t).toNumber(),high:(0,d._L)(e.high,t).toNumber(),open:(0,d._L)(e.open,t).toNumber(),close:(0,d._L)(e.close,t).toNumber(),volume:(0,d._L)(e.volume,r).toNumber()}),tL=e=>new Date(1e3*e),tC=()=>{},tV=e=>{let{marketId:t,libraryPath:r,interval:n,onIntervalChange:i}=e,{isMobile:s}=(0,c.bj)(),{theme:a}=(0,c.Ek)(),d=tI(),u=(0,o.useRef)(null),m=(0,o.useRef)(),h=(0,c.D9)(t),p=(0,c.D9)(a),v=tA(t);return(0,o.useEffect)(()=>{if(void 0!==m.current){t!==h&&(v.setSymbol(t),m.current.setSymbol(t,n||"15",tC)),a!==p&&m.current.changeTheme(a).then(()=>{m.current&&m.current.applyOverrides(tz(a))});return}if(!u.current)return;let e=tz(a),l=["header_symbol_search","header_compare","show_object_tree","timeframes_toolbar",...s?["left_toolbar"]:[]],o={symbol:t,datafeed:v,interval:n,container:u.current,library_path:r,custom_css_url:"vega_styles.css",locale:d.split("-")[0],enabled_features:["tick_resolution"],disabled_features:l,fullscreen:!1,autosize:!0,theme:a,overrides:e,loading_screen:{backgroundColor:e["paneProperties.background"]},auto_save_delay:1};m.current=new window.TradingView.widget(o),m.current.onChartReady(()=>{if(!m.current)return;let e=m.current.activeChart();e.createStudy("Volume"),e.onIntervalChanged().subscribe(null,i)})},[v,n,p,h,t,a,d,r,s,i]),(0,o.useEffect)(()=>()=>{m.current&&(m.current.remove(),m.current=void 0)},[]),(0,l.jsx)("div",{ref:u,className:"w-full h-full"})},tz=e=>({"paneProperties.background":"dark"===e?"#05060C":"#fff","paneProperties.backgroundType":"solid","paneProperties.legendProperties.showSeriesTitle":!1}),tM=["localhost","vegafairground.eth.limo","vegafairground.eth","vegaprotocol.eth","vegaprotocol.eth.limo"],tH={[eX.Interval.INTERVAL_BLOCK]:void 0,[eX.Interval.INTERVAL_I1M]:"1",[eX.Interval.INTERVAL_I5M]:"5",[eX.Interval.INTERVAL_I15M]:"15",[eX.Interval.INTERVAL_I30M]:"30",[eX.Interval.INTERVAL_I1H]:"60",[eX.Interval.INTERVAL_I4H]:"240",[eX.Interval.INTERVAL_I6H]:"360",[eX.Interval.INTERVAL_I8H]:"480",[eX.Interval.INTERVAL_I12H]:"720",[eX.Interval.INTERVAL_I1D]:"1D",[eX.Interval.INTERVAL_I7D]:"1W"},tX=e=>{let{libraryPath:t,libraryHash:r,marketId:n,interval:i,onIntervalChange:s}=e,a=tx(),o=(0,c.Gq)(t+"charting_library.standalone.js",r);return"loading"===o||"idle"===o?(0,l.jsx)(m.hX,{children:(0,l.jsx)("p",{children:a("Loading Trading View")})}):"error"===o?(0,l.jsx)(m.hX,{children:(0,l.jsx)("p",{children:a("Failed to initialize Trading view")})}):(0,l.jsx)(tV,{libraryPath:t,marketId:n,interval:i,onIntervalChange:s})};function tF(){let e=(0,w.Z)(["\n fragment CandleFields on Candle {\n periodStart\n lastUpdateInPeriod\n high\n low\n open\n close\n volume\n}\n "]);return tF=function(){return e},e}function t$(){let e=(0,w.Z)(["\n query Candles($marketId: ID!, $interval: Interval!, $since: String!) {\n market(id: $marketId) {\n id\n decimalPlaces\n positionDecimalPlaces\n tradableInstrument {\n instrument {\n id\n name\n code\n }\n }\n marketTimestamps {\n open\n }\n candlesConnection(interval: $interval, since: $since, pagination: {last: 5000}) {\n edges {\n node {\n ...CandleFields\n }\n }\n }\n }\n}\n ",""]);return t$=function(){return e},e}function tq(){let e=(0,w.Z)(["\n subscription CandlesEvents($marketId: ID!, $interval: Interval!) {\n candles(marketId: $marketId, interval: $interval) {\n ...CandleFields\n }\n}\n ",""]);return tq=function(){return e},e}let tB=(0,S.Ps)(tF()),tW=(0,S.Ps)(t$(),tB),tG=(0,S.Ps)(tq(),tB);function tK(){let e=(0,w.Z)(["\n query Chart($marketId: ID!) {\n market(id: $marketId) {\n decimalPlaces\n positionDecimalPlaces\n data {\n priceMonitoringBounds {\n minValidPrice\n maxValidPrice\n referencePrice\n }\n }\n }\n}\n "]);return tK=function(){return e},e}let tU=(0,S.Ps)(tK());var tZ=r(69466),tY=r(80659),tJ=r(12647),tQ=r(64173);let t0={[L.Xp.I1M]:eX.Interval.INTERVAL_I1M,[L.Xp.I5M]:eX.Interval.INTERVAL_I5M,[L.Xp.I15M]:eX.Interval.INTERVAL_I15M,[L.Xp.I30M]:eX.Interval.INTERVAL_I30M,[L.Xp.I1H]:eX.Interval.INTERVAL_I1H,[L.Xp.I4H]:eX.Interval.INTERVAL_I4H,[L.Xp.I6H]:eX.Interval.INTERVAL_I6H,[L.Xp.I8H]:eX.Interval.INTERVAL_I8H,[L.Xp.I12H]:eX.Interval.INTERVAL_I12H,[L.Xp.I1D]:eX.Interval.INTERVAL_I1D,[L.Xp.I7D]:eX.Interval.INTERVAL_I7D},t1={decimalPlaces:5,supportedIntervals:[L.Xp.I7D,L.Xp.I1D,L.Xp.I12H,L.Xp.I8H,L.Xp.I6H,L.Xp.I4H,L.Xp.I1H,L.Xp.I15M,L.Xp.I30M,L.Xp.I5M,L.Xp.I1M]};class t5{get decimalPlaces(){return this._decimalPlaces}get positionDecimalPlaces(){return this._positionDecimalPlaces}async onReady(){try{let{data:e}=await this.client.query({query:tU,variables:{marketId:this.marketId},fetchPolicy:"no-cache"});if(!e||!e.market||!e.market.data)return t1;{let t;return this._decimalPlaces=e.market.decimalPlaces,this._positionDecimalPlaces=e.market.positionDecimalPlaces,e.market.data.priceMonitoringBounds&&(t=e.market.data.priceMonitoringBounds.map(e=>({maxValidPrice:Number((0,d.x$)(e.maxValidPrice,this._decimalPlaces)),minValidPrice:Number((0,d.x$)(e.minValidPrice,this._decimalPlaces)),referencePrice:Number((0,d.x$)(e.referencePrice,this._decimalPlaces))}))),{decimalPlaces:this._decimalPlaces,positionDecimalPlaces:this._positionDecimalPlaces,supportedIntervals:[L.Xp.I7D,L.Xp.I1D,L.Xp.I12H,L.Xp.I8H,L.Xp.I6H,L.Xp.I4H,L.Xp.I1H,L.Xp.I15M,L.Xp.I30M,L.Xp.I5M,L.Xp.I1M],priceMonitoringBounds:t}}}catch(e){return t1}}async query(e,t){try{var r,n;this.from=new Date(t);let{data:i}=await this.client.query({query:tW,variables:{marketId:this.marketId,interval:t0[e],since:t},fetchPolicy:"no-cache"});if(null==i||null===(r=i.market)||void 0===r||null===(n=r.candlesConnection)||void 0===n||!n.edges)return[];{let t=i.market.decimalPlaces,r=i.market.positionDecimalPlaces,n=new Date("string"==typeof i.market.marketTimestamps.open&&i.market.marketTimestamps.open.length>0?i.market.marketTimestamps.open:0);this.fromnull==e?void 0:e.node).filter(e=>!!e).filter(e=>t6(e,n)&&!t7(e)).map(e=>t8(e,t,r)).reduce(t3(e),[]);return s}}catch(e){return[]}}subscribeData(e,t){let r=this.client.subscribe({query:tG,variables:{marketId:this.marketId,interval:t0[e]}});this.candlesSub=r.subscribe(e=>{let{data:r}=e;if(r){let e=t8(r.candles,this.decimalPlaces,this.positionDecimalPlaces);if(!this.from||e.date{switch(e){case"I7D":return{days:7*t};case"I1D":return{days:1*t};case"I1H":return{hours:1*t};case"I1M":return{minutes:1*t};case"I5M":return{minutes:5*t};case"I4H":return{hours:4*t};case"I6H":return{hours:6*t};case"I8H":return{hours:8*t};case"I12H":return{hours:12*t};case"I15M":return{minutes:15*t};case"I30M":return{minutes:30*t}}},t4=(e,t,r)=>{switch(e){case"I7D":return(0,tZ.Z)(r,t)/7;case"I1D":return(0,tZ.Z)(r,t);case"I12H":return(0,tY.Z)(r,t)/12;case"I8H":return(0,tY.Z)(r,t)/8;case"I6H":return(0,tY.Z)(r,t)/6;case"I4H":return(0,tY.Z)(r,t)/4;case"I1H":return(0,tY.Z)(r,t);case"I15M":return(0,tJ.Z)(r,t)/15;case"I30M":return(0,tJ.Z)(r,t)/30;case"I5M":return(0,tJ.Z)(r,t)/5;case"I1M":return(0,tJ.Z)(r,t)}},t3=e=>(t,r,n)=>{if(t.length&&n){let n=t[t.length-1],i=t4(e,n.date,r.date);if(i>1)for(let r=1;rnew Date(e.periodStart)>=t,t7=e=>""===e.high&&""===e.low;var t9=r(54073),re=r.n(t9);let rt=()=>(0,et.$G)("candles-chart").t,rr=e=>{let{marketId:t,interval:r,chartType:n,overlays:i,studies:s,studySizes:a,defaultStudySize:d,setStudies:u,setStudySizes:m,setOverlays:h}=e,p=(0,t_.x)(),{pubKey:v}=(0,to.qt)(),{theme:g}=(0,c.Ek)(),f=rt(),x=(0,o.useMemo)(()=>re()(e=>{m(e.filter((e,t)=>0!==t))},300),[m]),I=(0,o.useMemo)(()=>new t5(p,t,v),[p,t,v]);return(0,l.jsx)(y,{children:e=>{let{width:t,height:o}=e;return(0,l.jsx)("div",{style:{width:t,height:o},children:(0,l.jsx)(L.Ms,{dataSource:I,options:{chartType:n,overlays:i,studies:s,notEnoughDataText:(0,l.jsx)("span",{className:"text-xs text-center",children:f("No open orders")}),initialNumCandlesToDisplay:Math.floor(.2*t),studySize:d,studySizes:a},interval:r,theme:g,onOptionsChanged:e=>{u(e.studies),h(e.overlays)},onPaneChanged:x})})}})},rn={[eX.Interval.INTERVAL_BLOCK]:void 0,[eX.Interval.INTERVAL_I1M]:L.Xp.I1M,[eX.Interval.INTERVAL_I5M]:L.Xp.I5M,[eX.Interval.INTERVAL_I15M]:L.Xp.I15M,[eX.Interval.INTERVAL_I30M]:L.Xp.I30M,[eX.Interval.INTERVAL_I1H]:L.Xp.I1H,[eX.Interval.INTERVAL_I4H]:L.Xp.I4H,[eX.Interval.INTERVAL_I6H]:L.Xp.I6H,[eX.Interval.INTERVAL_I8H]:L.Xp.I8H,[eX.Interval.INTERVAL_I12H]:L.Xp.I12H,[eX.Interval.INTERVAL_I1D]:L.Xp.I1D,[eX.Interval.INTERVAL_I7D]:L.Xp.I7D};var ri=r(44247);let rs=[L.Ki.FORCE_INDEX,L.Ki.RELATIVE_STRENGTH_INDEX,L.Ki.ELDAR_RAY,L.Ki.MACD,L.Ki.VOLUME],ra={chartlib:"pennant",interval:eX.Interval.INTERVAL_I15M,type:L.oX.CANDLE,overlays:[L.aV.MOVING_AVERAGE],studies:[L.Ki.MACD,L.Ki.VOLUME],studySizes:{}},rl=(0,eK.Ue)()((0,eU.tJ)((0,ri.n)(e=>({...ra,setType:t=>e(e=>{e.type=t}),setInterval:t=>e(e=>{e.interval=t}),setOverlays:t=>{t&&e(e=>{e.overlays=t})},setStudies:t=>{t&&(t.sort((e,t)=>rs.indexOf(e)-rs.indexOf(t)),e(e=>{e.studies=t}))},setStudySizes:t=>{e(e=>{e.studies.forEach((r,n)=>{let i=t[n];e.studySizes[r]=i})})},setChartlib:t=>{e(e=>{e.chartlib=t})}})),{name:"vega_candles_chart_store"})),ro=()=>{let e=rl(),t=(0,c.Ri)(e.interval,Object.values(eX.Interval),eX.Interval.INTERVAL_I15M),r=(0,c.Ri)(e.type,Object.values(L.oX),L.oX.CANDLE),n=(0,c.p0)(e.overlays,Object.values(L.aV),[]),i=(0,c.p0)(e.studies,Object.values(L.Ki),[L.Ki.VOLUME]),s=i.map(t=>{let r=e.studySizes[t]||90;return r});return{chartlib:e.chartlib,interval:t,chartType:r,overlays:n,studies:i,studySizes:s,setInterval:e.setInterval,setType:e.setType,setStudies:e.setStudies,setOverlays:e.setOverlays,setStudySizes:e.setStudySizes,setChartlib:e.setChartlib}},rd=[eX.Interval.INTERVAL_I1M,eX.Interval.INTERVAL_I5M,eX.Interval.INTERVAL_I15M,eX.Interval.INTERVAL_I30M,eX.Interval.INTERVAL_I1H,eX.Interval.INTERVAL_I4H,eX.Interval.INTERVAL_I6H,eX.Interval.INTERVAL_I8H,eX.Interval.INTERVAL_I12H,eX.Interval.INTERVAL_I1D,eX.Interval.INTERVAL_I7D],rc=e=>{let{marketId:t}=e,{CHARTING_LIBRARY_PATH:r,CHARTING_LIBRARY_HASH:n}=(0,N.O7)(),{chartlib:i,interval:s,chartType:a,overlays:o,studies:d,studySizes:c,setInterval:u,setStudies:m,setStudySizes:h,setOverlays:p}=ro(),v=(0,l.jsx)(rr,{marketId:t,interval:rh(s),chartType:a,overlays:o,studies:d,studySizes:c,setStudySizes:h,setStudies:m,setOverlays:p,defaultStudySize:90});if(!tM.includes(window.location.hostname)||!r||!n)return v;switch(i){case"tradingview":return(0,l.jsx)(tX,{libraryPath:r,libraryHash:n,marketId:t,interval:ru(s),onIntervalChange:e=>{u(rm(e))}});case"pennant":return v;default:throw Error("invalid chart lib")}},ru=e=>{if(!rd.includes(e))throw Error("interval ".concat(e," is not supported"));let t=tH[e];if(!t)throw Error("failed to convert interval: ".concat(e," to valid resolution"));return t},rm=e=>{let t=tg()(tH)[e];if(!t)throw Error("failed to convert resolution: ".concat(e," to valid interval"));return t},rh=e=>{if(!rd.includes(e))throw Error("interval ".concat(e," is not supported"));let t=rn[e];if(!t)throw Error("failed to convert interval: ".concat(e," to valid pennant interval"));return t};var rp=r(5759);let rv=new Map([[L.oX.AREA,rp.jgM],[L.oX.CANDLE,rp.Ot2],[L.oX.LINE,rp.C1s],[L.oX.OHLC,rp.Ot2]]),rg=()=>{let{CHARTING_LIBRARY_PATH:e}=(0,N.O7)(),{chartlib:t,interval:r,chartType:n,studies:i,overlays:s,setChartlib:a,setInterval:o,setType:d,setStudies:c,setOverlays:u}=ro(),h=(0,tt.N)(),p="text-xs",v={size:"extra-small"},g="pennant"===t,f=(0,l.jsx)(m.ay,{onClick:()=>{a(g?"tradingview":"pennant")},size:"extra-small",testId:"chartlib-toggle-button",children:g?"TradingView":h("Vega chart")}),x=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.f1,{trigger:(0,l.jsx)(m.o0,{className:p,children:(0,l.jsx)(m.ay,{...v,children:h("Interval: {{interval}}",{interval:h(r)})})}),children:(0,l.jsx)(m.LT,{align:"end",children:(0,l.jsx)(m.Lu,{value:r,onValueChange:e=>{o(e)},children:rd.map(e=>(0,l.jsxs)(m.$W,{inset:!0,value:e,children:[h(e),(0,l.jsx)(m.P8,{})]},e))})})}),(0,l.jsx)(m.f1,{trigger:(0,l.jsx)(m.o0,{className:p,children:(0,l.jsx)(m.ay,{...v,children:(0,l.jsx)(m.JO,{name:rv.get(n)})})}),children:(0,l.jsx)(m.LT,{align:"end",children:(0,l.jsx)(m.Lu,{value:n,onValueChange:e=>{d(e)},children:Object.values(L.oX).map(e=>(0,l.jsxs)(m.$W,{inset:!0,value:e,children:[L.QE[e],(0,l.jsx)(m.P8,{})]},e))})})}),(0,l.jsx)(m.f1,{trigger:(0,l.jsx)(m.o0,{className:p,children:(0,l.jsx)(m.ay,{...v,children:h("Indicators")})}),children:(0,l.jsxs)(m.LT,{align:"end",children:[Object.values(L.aV).map(e=>(0,l.jsxs)(m.gv,{checked:s.includes(e),onCheckedChange:()=>{let t=[...s],r=s.findIndex(t=>t===e);-1!==r?t.splice(r,1):t.push(e),u(t)},children:[L.js[e],(0,l.jsx)(m.P8,{})]},e)),Object.values(L.Ki).map(e=>(0,l.jsxs)(m.gv,{checked:i.includes(e),onCheckedChange:()=>{let t=[...i],r=i.findIndex(t=>t===e);-1!==r?t.splice(r,1):t.push(e),c(t)},children:[L.OR[e],(0,l.jsx)(m.P8,{})]},e))]})})]}),I=(0,l.jsx)("p",{className:"text-xs mr-2 whitespace-nowrap",children:(0,l.jsx)(et.cC,{i18nKey:"Chart by <0>TradingView",components:[(0,l.jsx)("a",{className:"underline",target:"_blank",href:"https://www.tradingview.com"})]})});if(!tM.includes(window.location.hostname)||!e)return x;switch(t){case"tradingview":return(0,l.jsxs)(l.Fragment,{children:[I,f]});case"pennant":return(0,l.jsxs)(l.Fragment,{children:[x,f]});default:throw Error("invalid chart lib")}},rf={chart:{component:rc,menu:rg},depth:{component:es},liquidity:{component:e8.k},funding:{component:ts},fundingPayments:{component:ta.fQ,settings:ta.o2},orderbook:{component:e5},trades:{component:eZ,settings:eQ},positions:{component:e4.Lr,menu:tp.H,settings:e4.W7},activeOrders:{component:()=>(0,l.jsx)(tl.rx,{filter:ej.wn.Open}),menu:ej.MS,settings:()=>(0,l.jsx)(tl.n_,{filter:ej.wn.Open})},closedOrders:{component:()=>(0,l.jsx)(tl.rx,{filter:ej.wn.Closed}),settings:()=>(0,l.jsx)(tl.n_,{filter:ej.wn.Closed})},rejectedOrders:{component:()=>(0,l.jsx)(tl.rx,{filter:ej.wn.Rejected}),settings:()=>(0,l.jsx)(tl.n_,{filter:ej.wn.Rejected})},orders:{component:tl.rx,menu:ej.MS,settings:tl.n_},stopOrders:{component:tc,settings:tm},collateral:{component:e3.VJ,menu:th.v,settings:e3.bd},fills:{component:e2.tE,settings:e2.P8}};var rx=r(88484),rI=r(86199);let r_=(0,o.memo)(e=>{let{market:t,pinnedAsset:r}=e,n=(0,N.gV)(e=>e.flags),i=(0,tt.N)(),[s,a]=(0,P.Cc)({id:"top"}),[o,d]=(0,P.Cc)({id:"middle-1"});return(0,l.jsxs)(P.t9,{vertical:!0,onChange:a,children:[(0,l.jsx)(P.CV,{preferredSize:s[0],priority:v.g1.High,minSize:200,children:(0,l.jsxs)(P.t9,{onChange:d,children:[(0,l.jsx)(P.CV,{priority:v.g1.High,minSize:200,preferredSize:o[0]||"75%",children:(0,l.jsx)(rj,{children:(0,l.jsxs)(m.BK,{storageKey:"console-trade-grid-main-left",children:[(0,l.jsx)(m.OK,{id:"chart",overflowHidden:!0,name:i("Chart"),menu:(0,l.jsx)(rf.chart.menu,{}),children:(0,l.jsx)(rx.S,{feature:"chart",children:(0,l.jsx)(rf.chart.component,{marketId:t.id})})}),(0,l.jsx)(m.OK,{id:"depth",name:i("Depth"),children:(0,l.jsx)(rx.S,{feature:"depth",children:(0,l.jsx)(rf.depth.component,{marketId:t.id})})}),(0,l.jsx)(m.OK,{id:"liquidity",name:i("Liquidity"),children:(0,l.jsx)(rx.S,{feature:"liquidity",children:(0,l.jsx)(rf.liquidity.component,{marketId:t.id})})}),t&&"Perpetual"===t.tradableInstrument.instrument.product.__typename?(0,l.jsx)(m.OK,{id:"funding-history",name:i("Funding history"),children:(0,l.jsx)(rx.S,{feature:"funding-history",children:(0,l.jsx)(rf.funding.component,{marketId:t.id})})}):null,t&&"Perpetual"===t.tradableInstrument.instrument.product.__typename?(0,l.jsx)(m.OK,{id:"funding-payments",name:i("Funding payments"),settings:(0,l.jsx)(rf.fundingPayments.settings,{}),children:(0,l.jsx)(rx.S,{feature:"funding-payments",children:(0,l.jsx)(rf.fundingPayments.component,{marketId:t.id})})}):null]})})}),(0,l.jsx)(P.CV,{minSize:200,preferredSize:o[1]||275,children:(0,l.jsx)(rj,{children:(0,l.jsxs)(m.BK,{storageKey:"console-trade-grid-main-right",children:[(0,l.jsx)(m.OK,{id:"orderbook",name:i("Orderbook"),children:(0,l.jsx)(rx.S,{feature:"orderbook",children:(0,l.jsx)(rf.orderbook.component,{marketId:t.id})})}),(0,l.jsx)(m.OK,{id:"trades",name:i("Trades"),settings:(0,l.jsx)(rf.trades.settings,{}),children:(0,l.jsx)(rx.S,{feature:"trades",children:(0,l.jsx)(rf.trades.component,{marketId:t.id})})})]})})})]})}),(0,l.jsx)(P.CV,{preferredSize:s[1]||"25%",minSize:50,priority:v.g1.Low,children:(0,l.jsx)(rj,{children:(0,l.jsxs)(m.BK,{storageKey:"console-trade-grid-bottom",children:[(0,l.jsx)(m.OK,{id:"positions",name:i("Positions"),menu:(0,l.jsx)(rf.positions.menu,{}),settings:(0,l.jsx)(rf.positions.settings,{}),children:(0,l.jsx)(rx.S,{feature:"positions",children:(0,l.jsx)(rf.positions.component,{})})}),(0,l.jsx)(m.OK,{id:"open-orders",name:i("Open"),menu:(0,l.jsx)(rf.activeOrders.menu,{}),settings:(0,l.jsx)(rf.activeOrders.settings,{}),children:(0,l.jsx)(rx.S,{feature:"activeOrders",children:(0,l.jsx)(rf.activeOrders.component,{})})}),(0,l.jsx)(m.OK,{id:"closed-orders",name:i("Closed"),settings:(0,l.jsx)(rf.closedOrders.settings,{}),children:(0,l.jsx)(rx.S,{feature:"closedOrders",children:(0,l.jsx)(rf.closedOrders.component,{})})}),(0,l.jsx)(m.OK,{id:"rejected-orders",name:i("Rejected"),settings:(0,l.jsx)(rf.rejectedOrders.settings,{}),children:(0,l.jsx)(rx.S,{feature:"rejectedOrders",children:(0,l.jsx)(rf.rejectedOrders.component,{})})}),(0,l.jsx)(m.OK,{id:"orders",name:i("All"),menu:(0,l.jsx)(rf.orders.menu,{}),settings:(0,l.jsx)(rf.orders.settings,{}),children:(0,l.jsx)(rx.S,{feature:"orders",children:(0,l.jsx)(rf.orders.component,{})})}),n.STOP_ORDERS?(0,l.jsx)(m.OK,{id:"stop-orders",name:i("Stop orders"),settings:(0,l.jsx)(rf.stopOrders.settings,{}),children:(0,l.jsx)(rx.S,{feature:"stop-orders",children:(0,l.jsx)(rf.stopOrders.component,{})})}):null,(0,l.jsx)(m.OK,{id:"fills",name:i("Fills"),settings:(0,l.jsx)(rf.fills.settings,{}),children:(0,l.jsx)(rf.fills.component,{})}),(0,l.jsx)(m.OK,{id:"accounts",name:i("Collateral"),menu:(0,l.jsx)(rf.collateral.menu,{}),settings:(0,l.jsx)(rf.collateral.settings,{}),children:(0,l.jsx)(rx.S,{feature:"collateral",children:(0,l.jsx)(rf.collateral.component,{pinnedAsset:r})})})]})})})]})});r_.displayName="MainGrid";let rb=e=>{let{market:t,pinnedAsset:r}=e,n=f()("h-full grid","grid-rows-[min-content_1fr]");return(0,l.jsxs)("div",{className:n,children:[(0,l.jsx)("div",{children:(0,l.jsx)(rI.n,{market:t})}),(0,l.jsx)("div",{className:"min-h-0 p-0.5",children:(0,l.jsx)(r_,{market:t,pinnedAsset:r})})]})},rj=e=>{let{children:t}=e;return(0,l.jsx)("section",{className:"h-full p-1",children:(0,l.jsx)(y,{children:e=>{let{width:r,height:n}=e;return(0,l.jsx)("div",{style:{width:r,height:n},className:"border rounded-sm border-default",children:t})}})})},rk=e=>{let{market:t,pinnedAsset:r}=e,[n,i]=(0,o.useState)("chart"),s=rf[n],[a,d]=(0,o.useState)("positions"),c=rf[a],u=e=>{let n=rf[e].component;if(!n)throw Error("No component for view: ".concat(e));return t?(0,l.jsx)(rx.S,{feature:e,children:(0,l.jsx)(n,{marketId:null==t?void 0:t.id,pinnedAsset:r})}):(0,l.jsx)(ry,{})},h=e=>{if("menu"in e||"settings"in e)return(0,l.jsxs)("div",{className:"flex items-center justify-end gap-1 p-1 bg-vega-clight-800 dark:bg-vega-cdark-800 border-b border-default",children:["menu"in e?(0,l.jsx)(e.menu,{}):null,"settings"in e?(0,l.jsx)(m.J2,{align:"end",trigger:(0,l.jsx)("span",{className:"ml-1 flex items-center justify-center h-6 w-6",children:(0,l.jsx)(m.rT,{name:m.RW.COG,size:16})}),children:(0,l.jsx)("div",{className:"p-4 flex justify-end",children:(0,l.jsx)(e.settings,{})})}):null]})};return(0,l.jsxs)("div",{className:"h-full flex flex-col lg:grid grid-rows-[min-content_min-content_1fr_min-content]",children:[(0,l.jsxs)("div",{className:"flex flex-col w-full overflow-hidden",children:[(0,l.jsx)("div",{className:"flex flex-nowrap overflow-x-auto max-w-full border-t border-default",children:["chart","orderbook","depth","trades","liquidity","fundingPayments","funding"].filter(e=>(null==t?void 0:t.tradableInstrument.instrument.product.__typename)==="Perpetual"||!["funding","fundingPayments"].includes(e)).map(e=>(0,l.jsx)(rN,{view:e,isActive:n===e,onClick:()=>{i(e)}},e))}),(0,l.jsxs)("div",{className:"h-[50vh] lg:h-full relative",children:[(0,l.jsx)("div",{children:h(s)}),(0,l.jsx)("div",{className:"overflow-auto h-full",children:u(n)})]})]}),(0,l.jsxs)("div",{className:"flex flex-col w-full grow",children:[(0,l.jsx)("div",{className:"flex flex-nowrap overflow-x-auto max-w-full border-t border-default",children:["positions","activeOrders","closedOrders","rejectedOrders","orders","stopOrders","collateral","fills"].map(e=>(0,l.jsx)(rN,{view:e,isActive:a===e,onClick:()=>{d(e)}},e))}),(0,l.jsxs)("div",{className:"relative grow",children:[(0,l.jsx)("div",{className:"flex flex-col",children:h(c)}),(0,l.jsx)("div",{className:"overflow-auto h-full",children:u(a)})]})]})]})},ry=()=>{let e=(0,tt.N)();return(0,l.jsx)(m.hX,{children:e("No market")})},rN=e=>{let{view:t,isActive:r,onClick:n}=e,i=rP(t),s=f()("py-2 px-4 capitalize text-sm whitespace-nowrap",{"bg-vega-clight-500 dark:bg-vega-cdark-500":r});return(0,l.jsx)("button",{"data-testid":t,onClick:n,className:s,children:i})},rP=e=>{let t=(0,tt.N)(),r={chart:t("Chart"),depth:t("Depth"),liquidity:t("Liquidity"),funding:t("Funding history"),fundingPayments:t("Funding payments"),orderbook:t("Orderbook"),trades:t("Trades"),positions:t("Positions"),activeOrders:t("Active"),closedOrders:t("Closed"),rejectedOrders:t("Rejected"),orders:t("All"),stopOrders:t("Stop"),collateral:t("Collateral"),fills:t("Fills")};return r[e]};var rw=r(73557),rS=r(83594);let rR=(e,t)=>e&&t?(0,d.lm)(e,t):"-",rE=e=>{let{marketId:t,marketName:r,decimalPlaces:n}=e,i=(0,p.W)(e=>e.pageTitle),s=(0,p.W)(e=>e.updateTitle),{data:a}=(0,u.cu)({dataProvider:h.wW,variables:{marketId:t||""},skip:!t},1e3);return(0,o.useEffect)(()=>{let e=rR(null==a?void 0:a.markPrice,n);if(r){let t=(0,d.td)([r,e]);i!==t&&s(t)}},[n,r,null==a?void 0:a.markPrice,i,s]),null},rT=()=>{let e=(0,tt.N)(),{marketId:t}=(0,rw.UO)(),r=(0,rw.s0)(),{screenSize:n}=(0,c.bj)(),i=["lg","xl","xxl","xxxl"].includes(n),s=(0,p.s)(e=>e.update),a=(0,p.s)(e=>e.marketId),{data:d,loading:u}=(0,h.AD)(t);if((0,o.useEffect)(()=>{(null==d?void 0:d.id)&&d.id!==a&&s({marketId:d.id})},[s,a,null==d?void 0:d.id]),u)return(0,l.jsx)(m.hX,{children:(0,l.jsx)(m.aN,{})});if(!d)return(0,l.jsx)(m.hX,{children:(0,l.jsxs)("span",{className:"flex flex-col items-center gap-2",children:[(0,l.jsx)("p",{className:"justify-center text-sm",children:e("This market URL is not available any more.")}),(0,l.jsx)("p",{className:"justify-center text-sm",children:(0,l.jsx)(et.cC,{defaults:"Please choose another market from the <0>market list",ns:tt.ns,components:[(0,l.jsx)(m.rU,{className:"underline underline-offset-4 ",onClick:()=>r(rS.y.MARKETS()),children:"market list"},"link")]})})]})});let v=d&&(0,h.Nh)(d);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(rE,{marketId:null==d?void 0:d.id,marketName:null==d?void 0:d.tradableInstrument.instrument.name,decimalPlaces:null==d?void 0:d.decimalPlaces}),i?(0,l.jsx)(rb,{market:d,pinnedAsset:v}):(0,l.jsx)(rk,{market:d,pinnedAsset:v})]})}},94167:function(){}}]); \ No newline at end of file diff --git a/urbit/bus/vegas/build/_next/static/chunks/261.179cf5bb6a9f9364.js b/urbit/bus/vegas/build/_next/static/chunks/261.179cf5bb6a9f9364.js new file mode 100644 index 000000000..f1423583e --- /dev/null +++ b/urbit/bus/vegas/build/_next/static/chunks/261.179cf5bb6a9f9364.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[261],{65395:function(e,t,r){r.d(t,{VJ:function(){return k},bd:function(){return F}});var n=r(52322),l=r(2784),a=r(27834),s=r(74883),i=r(39494),d=r(82056),o=r(12294),u=r(47832),c=r(80150),m=r(2140),f=r(39626),p=r(39651),g=r(9834),v=r(55168),h=r(96291);let k=e=>{let{pinnedAsset:t}=e,r=(0,v.N)(),o=(0,p.K)(!0),{pubKey:u,isReadOnly:m}=(0,i.qt)(),{open:k}=(0,s.b1)(),x=(0,g.y)(),F=(0,f.Ap)(e=>e.setViews),S=(0,h.tX)(e=>e.saveValue),b=y(e=>e.gridStore),w=y(e=>e.updateGridStore),j=(0,c.TO)(b,e=>{w(e)}),N=(0,l.useCallback)(e=>{e&&k(e)},[k]);return u?(0,n.jsx)(d.Uk,{partyId:u,onClickAsset:N,onClickWithdraw:e=>{F({type:f.bW.Withdraw,assetId:e},x)},onClickDeposit:e=>{F({type:f.bW.Deposit},x),e&&S({assetId:e})},onClickTransfer:e=>{F({type:f.bW.Transfer,assetId:e},x)},onMarketClick:o,isReadOnly:m,pinnedAsset:t,gridProps:j}):(0,n.jsx)(a.hX,{children:(0,n.jsx)("p",{children:r("Please connect Vega wallet")})})},y=(0,o.Ue)()((0,u.tJ)(m.V,{name:"vega_accounts_store"}));var x=r(42028);let F=()=>(0,n.jsx)(x.Z,{updateGridStore:y(e=>e.updateGridStore)})},22787:function(e,t,r){r.d(t,{v:function(){return d}});var n=r(52322),l=r(27834),a=r(39626),s=r(9834),i=r(55168);let d=()=>{let e=(0,i.N)(),t=(0,s.y)(),r=(0,a.Ap)(e=>e.setViews);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.ay,{size:"extra-small","data-testid":"open-transfer",onClick:()=>r({type:a.bW.Transfer},t),children:e("Transfer")}),(0,n.jsx)(l.ay,{size:"extra-small",onClick:()=>r({type:a.bW.Deposit},t),children:e("Deposit")})]})}},95756:function(e,t,r){r.d(t,{tE:function(){return ed},P8:function(){return ec}});var n=r(52322),l=r(39494),a=r(2784),s=r(95783),i=r(7627),d=r(80150),o=r(72558),u=r(27834),c=r(50913);let m=()=>(0,c.$G)("fills").t,f=e=>{let{tradeId:t,buyOrderId:r,sellOrderId:l}=e,a=m();return(0,n.jsxs)(u.mx,{"data-testid":"fill-actions-content",children:[(0,n.jsx)(u.fP,{value:t,text:a("Copy trade ID")}),(0,n.jsx)(u.fP,{value:r,text:a("Copy buy order ID")}),(0,n.jsx)(u.fP,{value:l,text:a("Copy sell order ID")})]})};var p=r(27909);let g="Taker",v="Maker",h=e=>{let t,r,{data:n,partyId:l}=e;if((null==n?void 0:n.buyer.id)===l)n.aggressor===i.Side.SIDE_BUY?(t=g,r=null==n?void 0:n.buyerFee):n.aggressor===i.Side.SIDE_SELL?(t=v,r=null==n?void 0:n.sellerFee):(t="-",r=y(null==n?void 0:n.buyerFee)?n.sellerFee:n.buyerFee);else{if((null==n?void 0:n.seller.id)!==l)return{role:"-",fees:void 0};n.aggressor===i.Side.SIDE_SELL?(t=g,r=null==n?void 0:n.sellerFee):n.aggressor===i.Side.SIDE_BUY?(t=v,r=null==n?void 0:n.buyerFee):(t="-",r=y(n.sellerFee)?n.buyerFee:n.sellerFee)}let a=(null==n?void 0:n.buyerFee.makerFee)===n.sellerFee.makerFee&&new o.Z(null==n?void 0:n.buyerFee.makerFee).isZero()?i.MarketState.STATE_SUSPENDED:i.MarketState.STATE_ACTIVE;return{role:t,fees:r,marketState:a}},k=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.MarketState.STATE_ACTIVE,n=r===i.MarketState.STATE_ACTIVE,{makerFee:l,infrastructureFee:a,liquidityFee:s}=t,{makerFeeVolumeDiscount:d,makerFeeReferralDiscount:u,infrastructureFeeVolumeDiscount:c,infrastructureFeeReferralDiscount:m,liquidityFeeVolumeDiscount:f,liquidityFeeReferralDiscount:p}=t;n?e===v&&(l=new o.Z(t.makerFee).times(-1).toString(),a="0",s="0",m=m&&"0",c=c&&"0",p=p&&"0",f=f&&"0"):(a=new o.Z(a).dividedBy(2).toString(),s=new o.Z(s).dividedBy(2).toString(),l="0",m=m&&new o.Z(m).dividedBy(2).toString(),c=c&&new o.Z(c).dividedBy(2).toString(),p=p&&new o.Z(p).dividedBy(2).toString(),f=f&&new o.Z(f).dividedBy(2).toString(),u=u&&"0",d=d&&"0");let g=new o.Z(a).plus(l).plus(s).toString(),h=new o.Z(d||"0").plus(u||"0").plus(m||"0").plus(c||"0").plus(p||"0").plus(f||"0").toString();return{infrastructureFee:a,infrastructureFeeReferralDiscount:m,infrastructureFeeVolumeDiscount:c,liquidityFee:s,liquidityFeeReferralDiscount:p,liquidityFeeVolumeDiscount:f,makerFee:l,makerFeeReferralDiscount:u,makerFeeVolumeDiscount:d,totalFee:g,totalFeeDiscount:h}},y=e=>!e||"0"===e.liquidityFee&&"0"===e.makerFee&&"0"===e.infrastructureFee,x=(0,a.forwardRef)((e,t)=>{let{partyId:r,onMarketClick:l,...i}=e,o=m(),u=(0,a.useMemo)(()=>[{headerName:o("Market"),field:"market.tradableInstrument.instrument.code",cellRenderer:"MarketNameCell",cellRendererParams:{idPath:"market.id",onMarketClick:l},pinned:!0},{headerName:o("Size"),type:"rightAligned",field:"size",cellClassRules:{[d.Ms]:e=>{let{data:t}=e,n=b(t,r);return"buyer"===n},[d.MP]:e=>{let{data:t}=e,n=b(t,r);return"seller"===n}},valueFormatter:S(r)},{headerName:o("Price"),field:"price",valueFormatter:F,type:"rightAligned"},{headerName:o("Notional"),field:"price",valueFormatter:w,type:"rightAligned"},{headerName:o("Role"),field:"aggressor",valueFormatter:j(r)},{headerName:o("Fee"),colId:"fee",field:"market",valueFormatter:N(r),tooltipComponent:C,type:"rightAligned",tooltipField:"market",tooltipComponentParams:{partyId:r}},{headerName:o("Fee Discount"),colId:"fee-discount",field:"market",valueFormatter:D(r),tooltipValueGetter:e=>{let{valueFormatted:t,value:r}=e;return t&&/[1-9]/.test(t)?t:null},type:"rightAligned",cellRenderer:e=>{var t;let{value:r,valueFormatted:n}=e;return"".concat(n," ").concat(null===(t=r&&(0,p.Nh)(r))||void 0===t?void 0:t.symbol)},tooltipComponent:I,tooltipComponentParams:{partyId:r}},{headerName:o("Date"),filter:d.rQ,field:"createdAt",valueFormatter:e=>{let{value:t}=e;return t?(0,s.V$)().format(new Date(t)):""}},{colId:"fill-actions",cellRenderer:e=>{let{data:t}=e;return t?(0,n.jsx)(f,{buyOrderId:t.buyOrder,sellOrderId:t.sellOrder,tradeId:t.id}):null},...d.yQ.actions}],[l,r,o]);return(0,n.jsx)(d.cX,{ref:t,columnDefs:u,defaultColDef:d.yQ.default,overlayNoRowsTemplate:o("No fills"),getRowId:e=>{let{data:t}=e;return null==t?void 0:t.id},tooltipShowDelay:0,tooltipHideDelay:1e4,components:{MarketNameCell:d.Tr},...i})}),F=e=>{let{value:t,data:r}=e;if(!(null==r?void 0:r.market)||!(0,s.kE)(t))return"-";let n=(0,p.Nh)(r.market),l=(0,s.lm)(t,null==r?void 0:r.market.decimalPlaces);return"".concat(l," ").concat(n.symbol)},S=e=>t=>{let{value:r,data:n}=t;if(!(null==n?void 0:n.market)||!(0,s.kE)(r))return"-";let l="",a=b(n,e);"buyer"===a?l="+":"seller"===a&&(l="-");let i=(0,s.lm)(r,null==n?void 0:n.market.positionDecimalPlaces);return"".concat(l).concat(i)},b=(e,t)=>{let r;return(null==e?void 0:e.buyer.id)===t?r="buyer":(null==e?void 0:e.seller.id)===t&&(r="seller"),r},w=e=>{let{value:t,data:r}=e;if(!(null==r?void 0:r.market)||!(0,s.kE)(t))return"-";let{symbol:n,decimals:l}=(0,p.Nh)(r.market),a=new o.Z((0,s.x$)(null==r?void 0:r.size,null==r?void 0:r.market.positionDecimalPlaces)),i=new o.Z((0,s.x$)(t,null==r?void 0:r.market.decimalPlaces)),d=a.times(i).toString(),u=(0,s.uf)(d,l);return"".concat(u," ").concat(n)},j=e=>t=>{let{data:r}=t;if(!r)return"-";let{role:n}=h({data:r,partyId:e});return n},N=e=>t=>{let{value:r,data:n}=t;if(!r||!n)return"-";let l=(0,p.Nh)(r),{fees:a,role:i}=h({data:n,partyId:e});if(!a)return"-";let{totalFee:d}=k(i,a),o=(0,s.lm)(d,l.decimals);return"".concat(o," ").concat(l.symbol)},D=e=>t=>{let{value:r,data:n}=t;if(!r||!n)return"-";let l=(0,p.Nh)(r),{fees:a,role:i}=h({data:n,partyId:e});if(!a)return"-";let{totalFeeDiscount:d}=k(i,a);return(0,s.lm)(d,l.decimals)},C=e=>{var t;let{data:r,value:l,partyId:a}=e,d=m();if(!l||!r)return null;let o=(0,p.Nh)(l),{role:u,fees:c,marketState:f}=null!==(t=h({data:r,partyId:a}))&&void 0!==t?t:{};if(!c)return null;let{infrastructureFee:y,liquidityFee:x,makerFee:F,totalFee:S}=k(u,c,f);return(0,n.jsxs)("div",{"data-testid":"fee-breakdown-tooltip",className:"bg-vega-light-100 dark:bg-vega-dark-100 border-vega-light-200 dark:border-vega-dark-200 break-word z-20 max-w-sm rounded border px-4 py-2 text-xs text-black dark:text-white",children:[f&&(0,n.jsx)("p",{className:"mb-1 italic",children:d("If the market was {{state}}",{state:i.MarketStateMapping[f].toLowerCase()})}),u===v&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"mb-1",children:d("Fee revenue to be received by the maker, takers' fee discounts already applied.")}),(0,n.jsx)("p",{className:"mb-1",children:d("During continuous trading the maker pays no infrastructure and liquidity fees.")})]}),u===g&&(0,n.jsx)("p",{className:"mb-1",children:d("Fees to be paid by the taker; discounts are already applied.")}),("-"===u||f===i.MarketState.STATE_SUSPENDED)&&(0,n.jsx)("p",{className:"mb-1",children:d("During auction, half the infrastructure and liquidity fees will be paid.")}),(0,n.jsxs)("dl",{className:"grid grid-cols-2 gap-x-1",children:[(0,n.jsx)("dt",{className:"col-span-1",children:d("Infrastructure fee")}),(0,n.jsxs)("dd",{className:"col-span-1 text-right",children:[(0,s.lm)(y,o.decimals)," ",o.symbol]}),(0,n.jsx)("dt",{className:"col-span-1",children:d("Liquidity fee")}),(0,n.jsxs)("dd",{className:"col-span-1 text-right",children:[(0,s.lm)(x,o.decimals)," ",o.symbol]}),(0,n.jsx)("dt",{className:"col-span-1",children:d("Maker fee")}),(0,n.jsxs)("dd",{className:"col-span-1 text-right",children:[(0,s.lm)(F,o.decimals)," ",o.symbol]}),(0,n.jsx)("dt",{className:"col-span-1",children:d("Total fees")}),(0,n.jsxs)("dd",{className:"col-span-1 text-right",children:[(0,s.lm)(S,o.decimals)," ",o.symbol]})]})]})},T=e=>{let{value:t,label:r,asset:l}=e;return t&&"0"!==t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("dt",{className:"col-span-2",children:r}),(0,n.jsxs)("dd",{className:"col-span-2 text-right",children:[(0,s.lm)(t,l.decimals)," ",l.symbol]})]}):null},I=e=>{var t;let{data:r,partyId:l}=e,a=m();if(!r||!r.market)return null;let s=(0,p.Nh)(r.market),{fees:i,marketState:d,role:o}=null!==(t=h({data:r,partyId:l}))&&void 0!==t?t:{};if(!i)return null;let u=k(o,i,d);return(0,n.jsx)("div",{"data-testid":"fee-discount-breakdown-tooltip",className:"bg-vega-light-100 dark:bg-vega-dark-100 border-vega-light-200 dark:border-vega-dark-200 break-word z-20 max-w-sm rounded border px-4 py-2 text-sm text-black dark:text-white",children:(0,n.jsxs)("dl",{className:"grid grid-cols-6 gap-x-1 text-xs",children:["0"!==(u.infrastructureFeeReferralDiscount||"0")||"0"!==(u.infrastructureFeeVolumeDiscount||"0")?(0,n.jsx)("dt",{className:"col-span-2",children:a("Infrastructure Fee")}):null,(0,n.jsx)(T,{value:u.infrastructureFeeReferralDiscount,label:a("Referral Discount"),asset:s}),(0,n.jsx)(T,{value:u.infrastructureFeeVolumeDiscount,label:a("Volume Discount"),asset:s}),"0"!==(u.liquidityFeeReferralDiscount||"0")||"0"!==(u.liquidityFeeVolumeDiscount||"0")?(0,n.jsx)("dt",{className:"col-span-2",children:a("Liquidity Fee")}):null,(0,n.jsx)(T,{value:u.liquidityFeeReferralDiscount,label:a("Referral Discount"),asset:s}),(0,n.jsx)(T,{value:u.liquidityFeeVolumeDiscount,label:a("Volume Discount"),asset:s}),"0"!==(u.makerFeeReferralDiscount||"0")||"0"!==(u.makerFeeVolumeDiscount||"0")?(0,n.jsx)("dt",{className:"col-span-2",children:a("Maker Fee")}):null,(0,n.jsx)(T,{value:u.makerFeeReferralDiscount,label:a("Referral Discount"),asset:s}),(0,n.jsx)(T,{value:u.makerFeeVolumeDiscount,label:a("Volume Discount"),asset:s}),(0,n.jsx)("dt",{className:"col-span-2",children:a("Total Fee Discount")}),(0,n.jsx)(T,{value:u.totalFeeDiscount,label:"",asset:s})]})})};var P=r(91233),R=r(34498),M=r.n(R),_=r(75190),A=r(81548);function E(){let e=(0,_.Z)(["\n fragment TradeFeeFields on TradeFee {\n makerFee\n infrastructureFee\n liquidityFee\n makerFeeReferralDiscount\n makerFeeVolumeDiscount\n infrastructureFeeReferralDiscount\n infrastructureFeeVolumeDiscount\n liquidityFeeReferralDiscount\n liquidityFeeVolumeDiscount\n}\n "]);return E=function(){return e},e}function V(){let e=(0,_.Z)(["\n fragment FillFields on Trade {\n id\n market {\n id\n }\n createdAt\n price\n size\n buyOrder\n sellOrder\n aggressor\n buyer {\n id\n }\n seller {\n id\n }\n buyerFee {\n ...TradeFeeFields\n }\n sellerFee {\n ...TradeFeeFields\n }\n}\n ",""]);return V=function(){return e},e}function O(){let e=(0,_.Z)(["\n fragment FillEdge on TradeEdge {\n node {\n ...FillFields\n }\n cursor\n}\n ",""]);return O=function(){return e},e}function Z(){let e=(0,_.Z)(["\n fragment FillUpdateFields on TradeUpdate {\n id\n marketId\n buyOrder\n sellOrder\n buyerId\n sellerId\n aggressor\n price\n size\n createdAt\n type\n buyerFee {\n ...TradeFeeFields\n }\n sellerFee {\n ...TradeFeeFields\n }\n}\n ",""]);return Z=function(){return e},e}function U(){let e=(0,_.Z)(["\n query Fills($filter: TradesFilter, $pagination: Pagination, $dateRange: DateRange) {\n trades(filter: $filter, dateRange: $dateRange, pagination: $pagination) {\n edges {\n ...FillEdge\n }\n pageInfo {\n startCursor\n endCursor\n hasNextPage\n hasPreviousPage\n }\n }\n}\n ",""]);return U=function(){return e},e}function q(){let e=(0,_.Z)(["\n subscription FillsEvent($filter: TradesSubscriptionFilter!) {\n tradesStream(filter: $filter) {\n ...FillUpdateFields\n }\n}\n ",""]);return q=function(){return e},e}let L=(0,A.Ps)(E()),$=(0,A.Ps)(V(),L),G=(0,A.Ps)(O(),$),z=(0,A.Ps)(Z(),L),W=(0,A.Ps)(U(),G),B=(0,A.Ps)(q(),z),X=e=>{var t;return(null==e?void 0:null===(t=e.trades)||void 0===t?void 0:t.edges.map(e=>({...e.node,cursor:e.cursor})))||[]},J=e=>{var t;return(null==e?void 0:null===(t=e.trades)||void 0===t?void 0:t.pageInfo)||null},Q=e=>e.tradesStream||[],K=e=>{let{buyerId:t,sellerId:r,marketId:n,...l}=e;return{...l,__typename:"Trade",market:{__typename:"Market",id:n},buyer:{id:t,__typename:"Party"},seller:{id:r,__typename:"Party"}}},Y=e=>t=>{let{market:r,...n}=K(t);return{...n,market:e[r.id]}},H=(e,t,r,n)=>{let l=e?[...e]:[];return M()(t,"createdAt","desc").forEach(t=>{var r;let a=null!==(r=null==e?void 0:e.findIndex(e=>e.id===t.id))&&void 0!==r?r:-1;-1!==a?l[a]={...l[a],...n(t)}:(null==e?void 0:e.length)&&!(t.createdAt>=e[0].createdAt)||l.unshift(n(t))}),l},ee=(0,P.S8)({query:W,subscriptionQuery:B,update:(e,t,r,n)=>H(e,t,n,K),getData:X,getDelta:Q,pagination:{getPageInfo:J,append:P.Ao,first:100},getSubscriptionVariables:e=>{let{filter:t}=e,r={filter:{}};return t&&(r.filter={partyIds:t.partyIds,marketIds:t.marketIds}),r}}),et=(0,P.cv)([ee,(e,t)=>(0,p.Lq)(e,t,void 0)],(e,t,r,n)=>r&&n[0].isUpdate?H(r,n[0].delta,t,Y(e[1])):(e[0]||[]).map(t=>({...t,market:e[1][t.market.id]}))),er=e=>{let{partyId:t,onMarketClick:r,gridProps:l}=e,s=m(),i=(0,a.useRef)(null),[o,u]=(0,a.useState)(void 0),{onFilterChanged:c,...f}=l||{},p=(0,a.useCallback)(e=>{let{api:t}=e;u(!!t.getDisplayedRowCount())},[]),{data:g,error:v,load:h,pageInfo:k}=(0,P.x5)({dataProvider:et,variables:{filter:{partyIds:[t]}}});return(0,n.jsxs)("div",{className:"flex h-full flex-col",children:[(0,n.jsx)(x,{ref:i,rowData:g,onFilterChanged:e=>{p(e),c(e)},onRowDataUpdated:p,partyId:t,onMarketClick:r,overlayNoRowsTemplate:v?v.message:s("No fills"),...f}),(0,n.jsx)(d.tl,{count:(null==g?void 0:g.length)||0,pageInfo:k,showRetentionMessage:!0,onLoad:h,hasDisplayedRows:o||!1})]})};var en=r(12294),el=r(47832),ea=r(2140),es=r(39651),ei=r(55168);let ed=()=>{let e=(0,ei.N)(),t=(0,es.K)(!0),{pubKey:r}=(0,l.qt)(),a=eo(e=>e.gridStore),s=eo(e=>e.updateGridStore),i=(0,d.TO)(a,e=>{s(e)});return r?(0,n.jsx)(er,{partyId:r,onMarketClick:t,gridProps:i}):(0,n.jsx)(u.hX,{children:(0,n.jsx)("p",{children:e("Please connect Vega wallet")})})},eo=(0,en.Ue)()((0,el.tJ)(ea.V,{name:"vega_fills_store"}));var eu=r(42028);let ec=()=>(0,n.jsx)(eu.Z,{updateGridStore:eo(e=>e.updateGridStore)})},58970:function(e,t,r){r.d(t,{fQ:function(){return _},o2:function(){return V}});var n=r(52322),l=r(39494),a=r(2784),s=r(95783),i=r(80150),d=r(27909),o=r(72779),u=r.n(o),c=r(50913);let m=()=>(0,c.$G)("funding-payments").t,f={resizable:!0,sortable:!0},p=e=>{let{value:t,data:r}=e;if(!(null==r?void 0:r.market)||!(0,s.kE)(t))return"-";let{symbol:n,decimals:l}=(0,d.Nh)(r.market),a=(0,s.lm)(t,l);return"".concat(a," ").concat(n)},g=(0,a.forwardRef)((e,t)=>{let{onMarketClick:r,...l}=e,o=m(),c=(0,a.useMemo)(()=>[{headerName:o("Market"),field:"market.tradableInstrument.instrument.code",cellRenderer:"MarketNameCell",filter:!0,cellRendererParams:{idPath:"market.id",onMarketClick:r}},{headerName:o("Amount"),field:"amount",valueFormatter:p,type:"rightAligned",filter:"agNumberColumnFilter",valueGetter:e=>{let{data:t}=e;return(null==t?void 0:t.amount)&&(null==t?void 0:t.market)?(0,s._L)(t.amount,(0,d.Nh)(t.market).decimals).toNumber():0},cellRenderer:e=>{var t,r;let{data:l}=e;if(!(null==l?void 0:l.market)||!(0,s.kE)(l.amount))return"-";let{symbol:a,decimals:o}=(0,d.Nh)(l.market),c=(0,s.lm)(l.amount,o);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:u()({[i.Ms]:!(null==l?void 0:null===(t=l.amount)||void 0===t?void 0:t.startsWith("-")),[i.MP]:!!(null==l?void 0:null===(r=l.amount)||void 0===r?void 0:r.startsWith("-"))}),children:c})," ".concat(a)]})}},{headerName:o("Date"),field:"timestamp",type:"rightAligned",filter:i.rQ,valueFormatter:e=>{let{value:t}=e;return t?(0,s.V$)().format(new Date(t)):""}}],[r,o]);return(0,n.jsx)(i.cX,{ref:t,defaultColDef:f,columnDefs:c,overlayNoRowsTemplate:o("No funding payments"),getRowId:e=>{let{data:t}=e;return"".concat(null==t?void 0:t.marketId,"-").concat(null==t?void 0:t.fundingPeriodSeq)},components:{MarketNameCell:i.Tr},...l})});var v=r(91233),h=r(75190),k=r(81548);function y(){let e=(0,h.Z)(["\n fragment FundingPaymentFields on FundingPayment {\n marketId\n partyId\n fundingPeriodSeq\n amount\n timestamp\n}\n "]);return y=function(){return e},e}function x(){let e=(0,h.Z)(["\n query FundingPayments($partyId: ID!, $pagination: Pagination, $marketId: ID) {\n fundingPayments(partyId: $partyId, pagination: $pagination, marketId: $marketId) {\n edges {\n node {\n ...FundingPaymentFields\n }\n cursor\n }\n pageInfo {\n startCursor\n endCursor\n hasNextPage\n hasPreviousPage\n }\n }\n}\n ",""]);return x=function(){return e},e}let F=(0,k.Ps)(y()),S=(0,k.Ps)(x(),F),b=e=>{var t;return(null==e?void 0:null===(t=e.fundingPayments)||void 0===t?void 0:t.edges.map(e=>({...e.node,cursor:e.cursor})))||[]},w=e=>{var t;return(null==e?void 0:null===(t=e.fundingPayments)||void 0===t?void 0:t.pageInfo)||null},j=(0,v.S8)({query:S,getData:b,pagination:{getPageInfo:w,append:v.Ao,first:1e3}}),N=(0,v.cv)([j,(e,t)=>(0,d.Lq)(e,t,void 0)],e=>(e[0]||[]).map(t=>({...t,market:e[1][t.marketId]}))),D=e=>{let{partyId:t,marketId:r,onMarketClick:l,gridProps:s}=e,d=m(),o=(0,a.useRef)(null),[u,c]=(0,a.useState)(void 0),{onFilterChanged:f,...p}=s||{},h=(0,a.useCallback)(e=>{let{api:t}=e;c(!!t.getDisplayedRowCount())},[]),{data:k,error:y,load:x,pageInfo:F}=(0,v.x5)({dataProvider:N,update:e=>{var t,r;let{data:n}=e;return null!=n&&!!n.length&&null!==(t=o.current)&&void 0!==t&&!!t.api&&(null===(r=o.current)||void 0===r||r.api.setGridOption("rowData",n),!0)},variables:{partyId:t,marketId:r}});return(0,n.jsxs)("div",{className:"flex h-full flex-col",children:[(0,n.jsx)(g,{ref:o,rowData:k,onMarketClick:l,onFilterChanged:e=>{h(e),f(e)},onRowDataUpdated:h,overlayNoRowsTemplate:y?y.message:d("No funding payments"),...p}),(0,n.jsx)(i.tl,{count:(null==k?void 0:k.length)||0,pageInfo:F,onLoad:x,hasDisplayedRows:u||!1,showRetentionMessage:!0})]})};var C=r(12294),T=r(47832),I=r(27834),P=r(2140),R=r(39651),M=r(55168);let _=e=>{let{marketId:t}=e,r=(0,M.N)(),a=(0,R.K)(!0),{pubKey:s}=(0,l.qt)(),d=A(e=>e.gridStore),o=A(e=>e.updateGridStore),u=(0,i.TO)(d,e=>{o(e)});return s?(0,n.jsx)(D,{partyId:s,marketId:t,onMarketClick:a,gridProps:u}):(0,n.jsx)(I.hX,{children:(0,n.jsx)("p",{children:r("Please connect Vega wallet")})})},A=(0,C.Ue)()((0,T.tJ)(P.V,{name:"vega_funding_payments_store"}));var E=r(42028);let V=()=>(0,n.jsx)(E.Z,{updateGridStore:A(e=>e.updateGridStore)})},1954:function(e,t,r){r.d(t,{rx:function(){return y},n_:function(){return S}});var n=r(52322),l=r(80150),a=r(62832),s=r(27834),i=r(39494),d=r(39651),o=r(12294),u=r(47832),c=r(7627),m=r(83594),f=r(55168),p=r(42028);let g=(e,t)=>{switch(e){case a.wn.Open:return t("No open orders");case a.wn.Closed:return t("No closed orders");case a.wn.Rejected:return t("No rejected orders");default:return t("No orders")}},v={[a.wn.Open]:[c.OrderStatus.STATUS_ACTIVE,c.OrderStatus.STATUS_PARKED],[a.wn.Closed]:[c.OrderStatus.STATUS_CANCELLED,c.OrderStatus.STATUS_EXPIRED,c.OrderStatus.STATUS_FILLED,c.OrderStatus.STATUS_PARTIALLY_FILLED,c.OrderStatus.STATUS_STOPPED],[a.wn.Rejected]:[c.OrderStatus.STATUS_REJECTED]},h={[a.wn.Open]:{status:{value:v[a.wn.Open]}},[a.wn.Closed]:{status:{value:v[a.wn.Closed]}},[a.wn.Rejected]:{status:{value:v[a.wn.Rejected]}}},k=["instrument-code"],y=e=>{let{filter:t}=e,r=(0,f.N)(),{pubKey:o,isReadOnly:u}=(0,i.qt)(),c=(0,d.Z)(),{gridState:p,updateGridState:v}=F(t),y=(0,l.TO)(p,e=>{v(t,e)},k,t&&h[t]);if(!o)return(0,n.jsx)(s.hX,{children:r("Please connect Vega wallet")});let x=g(t,r);return(0,n.jsx)(a.BA,{partyId:o,filter:t,onMarketClick:(e,t)=>{c(m.y.MARKET(e),t)},onOrderTypeClick:(e,t)=>c(m.y.LIQUIDITY(e),t),isReadOnly:u,gridProps:y,noRowsMessage:x})},x=(0,o.Ue)()((0,u.tJ)(e=>({open:{},closed:{},rejected:{},all:{},update:(t,r)=>{switch(t){case a.wn.Open:e(e=>({open:{...e.open,...r}}));return;case a.wn.Closed:e(e=>({closed:{...e.closed,...r}}));return;case a.wn.Rejected:e(e=>({rejected:{...e.rejected,...r}}));return;case void 0:e(e=>({all:{...e.all,...r}}));return}}}),{name:"vega_order_list_store"})),F=e=>{let t=x(e=>e.update),r=x(t=>{switch(e){case a.wn.Open:return{columnState:t.open.columnState,filterModel:t.open.filterModel};case a.wn.Closed:return{columnState:t.closed.columnState,filterModel:t.closed.filterModel};case a.wn.Rejected:return{columnState:t.rejected.columnState,filterModel:t.rejected.filterModel};default:return t.all}});return{gridState:r,updateGridState:t}},S=e=>{let{filter:t}=e,r=x(e=>e.update);return(0,n.jsx)(p.Z,{updateGridStore:e=>r(t,e)})}},34209:function(e,t,r){r.d(t,{Lr:function(){return p},W7:function(){return k},ho:function(){return v}});var n=r(52322),l=r(80150),a=r(90834),s=r(27834),i=r(39494),d=r(2140),o=r(12294),u=r(47832),c=r(39651),m=r(55168);let f=["marketCode"],p=e=>{let{allKeys:t}=e,r=(0,m.N)(),d=(0,c.K)(!0),{pubKey:o,pubKeys:u,isReadOnly:p}=(0,i.qt)(),g=v(e=>e.showClosedMarkets),h=v(e=>e.gridStore),k=v(e=>e.updateGridStore),y=(0,l.TO)(h,k,f);if(!o)return(0,n.jsx)(s.hX,{children:(0,n.jsx)("p",{children:r("Please connect Vega wallet")})});let x=[o];return t&&u&&x.push(...u.map(e=>{let{publicKey:t}=e;return t}).filter(e=>e!==o)),(0,n.jsx)(a.bG,{partyIds:x,onMarketClick:d,isReadOnly:p,gridProps:y,showClosed:g})},g=e=>({showClosedMarkets:!1,toggleClosedMarkets:()=>{e(e=>({showClosedMarkets:!e.showClosedMarkets}))}}),v=(0,o.Ue)()((0,u.tJ)(function(){for(var e=arguments.length,t=Array(e),r=0;r(0,n.jsx)(h.Z,{updateGridStore:v(e=>e.updateGridStore)})},17136:function(e,t,r){r.d(t,{H:function(){return i}});var n=r(52322),l=r(27834),a=r(34209),s=r(55168);let i=()=>{let e=(0,s.N)(),t=(0,a.ho)(e=>e.showClosedMarkets),r=(0,a.ho)(e=>e.toggleClosedMarkets);return(0,n.jsx)(l.ay,{size:"extra-small","data-testid":"open-transfer",onClick:r,children:e(t?"Hide closed markets":"Show closed markets")})}},24417:function(e,t,r){r.d(t,{t9:function(){return l},CV:function(){return a},Cc:function(){return f}});var n=r(74248);r(15275);let l=n.oL,a=n.oL.Pane;var s=r(2784),i=r(54073),d=r.n(i),o=r(12294),u=r(47832),c=r(44247);let m=(0,o.Ue)()((0,u.tJ)((0,c.n)(e=>({sizes:{},valueSetter:(t,r)=>e(e=>(e.sizes[t]=r,e))})),{name:"vega_pane_store"})),f=e=>{let{id:t}=e,r=m(e=>e.sizes[t])||[],n=m(e=>e.valueSetter),l=(0,s.useCallback)(d()(e=>{if(e.length){let r=e.reduce((e,t)=>e+t,0),l=e.map(e=>"".concat(e/r*100,"%"));n(t,l)}},300),[n,t]);return[r,l]}}}]); \ No newline at end of file diff --git a/urbit/bus/vegas/build/_next/static/chunks/270ba5af.5d5e345e723b217b.js b/urbit/bus/vegas/build/_next/static/chunks/270ba5af.5d5e345e723b217b.js new file mode 100644 index 000000000..2dbaadb8a --- /dev/null +++ b/urbit/bus/vegas/build/_next/static/chunks/270ba5af.5d5e345e723b217b.js @@ -0,0 +1,10 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[471],{96450:function(t,i,n){let r;var s,o,a,l,h=n(2784),u=n(86522),c=(tN=Object.create(null),h&&Object.keys(h).forEach(function(t){if("default"!==t){var i=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(tN,t,i.get?i:{enumerable:!0,get:function(){return h[t]}})}}),tN.default=h,Object.freeze(tN));function f(t){return t.split("-")[1]}function d(t){return"y"===t?"height":"width"}function p(t){return t.split("-")[0]}function m(t){return["top","bottom"].includes(p(t))?"x":"y"}function v(t,i,n){let r,{reference:s,floating:o}=t,a=s.x+s.width/2-o.width/2,l=s.y+s.height/2-o.height/2,h=m(i),u=d(h),c=s[u]/2-o[u]/2,v="x"===h;switch(p(i)){case"top":r={x:a,y:s.y-o.height};break;case"bottom":r={x:a,y:s.y+s.height};break;case"right":r={x:s.x+s.width,y:l};break;case"left":r={x:s.x-o.width,y:l};break;default:r={x:s.x,y:s.y}}switch(f(i)){case"start":r[h]-=c*(n&&v?-1:1);break;case"end":r[h]+=c*(n&&v?-1:1)}return r}function g(t,i){return"function"==typeof t?t(i):t}function y(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function x(t,i){var n;void 0===i&&(i={});let{x:r,y:s,platform:o,rects:a,elements:l,strategy:h}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=g(i,t),m="number"!=typeof p?{top:0,right:0,bottom:0,left:0,...p}:{top:p,right:p,bottom:p,left:p},v=l[d?"floating"===f?"reference":"floating":f],x=y(await o.getClippingRect({element:null==(n=await (null==o.isElement?void 0:o.isElement(v)))||n?v:v.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:h})),w="floating"===f?{...a.floating,x:r,y:s}:a.reference,b=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),_=await (null==o.isElement?void 0:o.isElement(b))&&await (null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},S=y(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:b,strategy:h}):w);return{top:(x.top-S.top+m.top)/_.y,bottom:(S.bottom-x.bottom+m.bottom)/_.y,left:(x.left-S.left+m.left)/_.x,right:(S.right-x.right+m.right)/_.x}}let w=Math.min,b=Math.max,_={left:"right",right:"left",bottom:"top",top:"bottom"};function S(t){return t.replace(/left|right|bottom|top/g,t=>_[t])}let k={start:"end",end:"start"};function T(t){return t.replace(/start|end/g,t=>k[t])}let P=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(i){var n,r,s,o;let{placement:a,middlewareData:l,rects:h,initialPlacement:u,platform:c,elements:v}=i,{mainAxis:y=!0,crossAxis:w=!0,fallbackPlacements:b,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:P=!0,...M}=g(t,i),z=p(a),E=p(u)===u,A=await (null==c.isRTL?void 0:c.isRTL(v.floating)),C=b||(E||!P?[S(u)]:function(t){let i=S(t);return[T(t),i,T(i)]}(u));b||"none"===k||C.push(...function(t,i,n,r){let s=f(t),o=function(t,i,n){let r=["left","right"],s=["right","left"];switch(t){case"top":case"bottom":return n?i?s:r:i?r:s;case"left":case"right":return i?["top","bottom"]:["bottom","top"];default:return[]}}(p(t),"start"===n,r);return s&&(o=o.map(t=>t+"-"+s),i&&(o=o.concat(o.map(T)))),o}(u,P,k,A));let I=[u,...C],D=await x(i,M),L=[],O=(null==(n=l.flip)?void 0:n.overflows)||[];if(y&&L.push(D[z]),w){let{main:t,cross:i}=function(t,i,n){void 0===n&&(n=!1);let r=f(t),s=m(t),o=d(s),a="x"===s?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return i.reference[o]>i.floating[o]&&(a=S(a)),{main:a,cross:S(a)}}(a,h,A);L.push(D[t],D[i])}if(O=[...O,{placement:a,overflows:L}],!L.every(t=>t<=0)){let t=((null==(r=l.flip)?void 0:r.index)||0)+1,i=I[t];if(i)return{data:{index:t,overflows:O},reset:{placement:i}};let n=null==(s=O.filter(t=>t.overflows[0]<=0).sort((t,i)=>t.overflows[1]-i.overflows[1])[0])?void 0:s.placement;if(!n)switch(_){case"bestFit":{let t=null==(o=O.map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,i)=>t+i,0)]).sort((t,i)=>t[1]-i[1])[0])?void 0:o[0];t&&(n=t);break}case"initialPlacement":n=u}if(a!==n)return{reset:{placement:n}}}return{}}}},M=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(i){let{x:n,y:r}=i,s=await async function(t,i){let{placement:n,platform:r,elements:s}=t,o=await (null==r.isRTL?void 0:r.isRTL(s.floating)),a=p(n),l=f(n),h="x"===m(n),u=["left","top"].includes(a)?-1:1,c=o&&h?-1:1,d=g(i,t),{mainAxis:v,crossAxis:y,alignmentAxis:x}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return l&&"number"==typeof x&&(y="end"===l?-1*x:x),h?{x:y*c,y:v*u}:{x:v*u,y:y*c}}(i,t);return{x:n+s.x,y:r+s.y,data:s}}}},z=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(i){let{x:n,y:r,placement:s}=i,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:t=>{let{x:i,y:n}=t;return{x:i,y:n}}},...h}=g(t,i),u={x:n,y:r},c=await x(i,h),f=m(p(s)),d="x"===f?"y":"x",v=u[f],y=u[d];o&&(v=b(v+c["y"===f?"top":"left"],w(v,v-c["y"===f?"bottom":"right"]))),a&&(y=b(y+c["y"===d?"top":"left"],w(y,y-c["y"===d?"bottom":"right"])));let _=l.fn({...i,[f]:v,[d]:y});return{..._,data:{x:_.x-n,y:_.y-r}}}}};function E(t){var i;return(null==t||null==(i=t.ownerDocument)?void 0:i.defaultView)||window}function A(t){return E(t).getComputedStyle(t)}function C(t){return t instanceof E(t).Node}function I(t){return C(t)?(t.nodeName||"").toLowerCase():"#document"}function D(t){return t instanceof HTMLElement||t instanceof E(t).HTMLElement}function L(t){return"undefined"!=typeof ShadowRoot&&(t instanceof E(t).ShadowRoot||t instanceof ShadowRoot)}function O(t){let{overflow:i,overflowX:n,overflowY:r,display:s}=A(t);return/auto|scroll|overlay|hidden|clip/.test(i+r+n)&&!["inline","contents"].includes(s)}function N(t){let i=R(),n=A(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!i&&!!n.backdropFilter&&"none"!==n.backdropFilter||!i&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some(t=>(n.willChange||"").includes(t))||["paint","layout","strict","content"].some(t=>(n.contain||"").includes(t))}function R(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function F(t){return["html","body","#document"].includes(I(t))}let j=Math.min,V=Math.max,B=Math.round,Y=t=>({x:t,y:t});function Z(t){let i=A(t),n=parseFloat(i.width)||0,r=parseFloat(i.height)||0,s=D(t),o=s?t.offsetWidth:n,a=s?t.offsetHeight:r,l=B(n)!==o||B(r)!==a;return l&&(n=o,r=a),{width:n,height:r,$:l}}function W(t){return t instanceof Element||t instanceof E(t).Element}function H(t){return W(t)?t:t.contextElement}function X(t){let i=H(t);if(!D(i))return Y(1);let n=i.getBoundingClientRect(),{width:r,height:s,$:o}=Z(i),a=(o?B(n.width):n.width)/r,l=(o?B(n.height):n.height)/s;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}let U=Y(0);function G(t){let i=E(t);return R()&&i.visualViewport?{x:i.visualViewport.offsetLeft,y:i.visualViewport.offsetTop}:U}function $(t,i,n,r){var s;void 0===i&&(i=!1),void 0===n&&(n=!1);let o=t.getBoundingClientRect(),a=H(t),l=Y(1);i&&(r?W(r)&&(l=X(r)):l=X(t));let h=(void 0===(s=n)&&(s=!1),!(!r||s&&r!==E(a))&&s)?G(a):Y(0),u=(o.left+h.x)/l.x,c=(o.top+h.y)/l.y,f=o.width/l.x,d=o.height/l.y;if(a){let t=E(a),i=r&&W(r)?E(r):r,n=t.frameElement;for(;n&&r&&i!==t;){let t=X(n),i=n.getBoundingClientRect(),r=getComputedStyle(n),s=i.left+(n.clientLeft+parseFloat(r.paddingLeft))*t.x,o=i.top+(n.clientTop+parseFloat(r.paddingTop))*t.y;u*=t.x,c*=t.y,f*=t.x,d*=t.y,u+=s,c+=o,n=E(n).frameElement}}return y({width:f,height:d,x:u,y:c})}function q(t){return W(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function K(t){var i;return null==(i=(C(t)?t.ownerDocument:t.document)||window.document)?void 0:i.documentElement}function J(t){return $(K(t)).left+q(t).scrollLeft}function Q(t){if("html"===I(t))return t;let i=t.assignedSlot||t.parentNode||L(t)&&t.host||K(t);return L(i)?i.host:i}function tt(t,i,n){let r;if("viewport"===i)r=function(t,i){let n=E(t),r=K(t),s=n.visualViewport,o=r.clientWidth,a=r.clientHeight,l=0,h=0;if(s){o=s.width,a=s.height;let t=R();(!t||t&&"fixed"===i)&&(l=s.offsetLeft,h=s.offsetTop)}return{width:o,height:a,x:l,y:h}}(t,n);else if("document"===i)r=function(t){let i=K(t),n=q(t),r=t.ownerDocument.body,s=V(i.scrollWidth,i.clientWidth,r.scrollWidth,r.clientWidth),o=V(i.scrollHeight,i.clientHeight,r.scrollHeight,r.clientHeight),a=-n.scrollLeft+J(t),l=-n.scrollTop;return"rtl"===A(r).direction&&(a+=V(i.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:l}}(K(t));else if(W(i))r=function(t,i){let n=$(t,!0,"fixed"===i),r=n.top+t.clientTop,s=n.left+t.clientLeft,o=D(t)?X(t):Y(1);return{width:t.clientWidth*o.x,height:t.clientHeight*o.y,x:s*o.x,y:r*o.y}}(i,n);else{let n=G(t);r={...i,x:i.x-n.x,y:i.y-n.y}}return y(r)}function te(t,i){return D(t)&&"fixed"!==A(t).position?i?i(t):t.offsetParent:null}function ti(t,i){let n=E(t);if(!D(t))return n;let r=te(t,i);for(;r&&["table","td","th"].includes(I(r))&&"static"===A(r).position;)r=te(r,i);return r&&("html"===I(r)||"body"===I(r)&&"static"===A(r).position&&!N(r))?n:r||function(t){let i=Q(t);for(;D(i)&&!F(i);){if(N(i))return i;i=Q(i)}return null}(t)||n}let tn={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:i,offsetParent:n,strategy:r}=t,s=D(n),o=K(n);if(n===o)return i;let a={scrollLeft:0,scrollTop:0},l=Y(1),h=Y(0);if((s||!s&&"fixed"!==r)&&(("body"!==I(n)||O(o))&&(a=q(n)),D(n))){let t=$(n);l=X(n),h.x=t.x+n.clientLeft,h.y=t.y+n.clientTop}return{width:i.width*l.x,height:i.height*l.y,x:i.x*l.x-a.scrollLeft*l.x+h.x,y:i.y*l.y-a.scrollTop*l.y+h.y}},getDocumentElement:K,getClippingRect:function(t){let{element:i,boundary:n,rootBoundary:r,strategy:s}=t,o="clippingAncestors"===n?function(t,i){let n=i.get(t);if(n)return n;let r=(function t(i,n){var r;void 0===n&&(n=[]);let s=function t(i){let n=Q(i);return F(n)?i.ownerDocument?i.ownerDocument.body:i.body:D(n)&&O(n)?n:t(n)}(i),o=s===(null==(r=i.ownerDocument)?void 0:r.body),a=E(s);return o?n.concat(a,a.visualViewport||[],O(s)?s:[]):n.concat(s,t(s))})(t).filter(t=>W(t)&&"body"!==I(t)),s=null,o="fixed"===A(t).position,a=o?Q(t):t;for(;W(a)&&!F(a);){let i=A(a),n=N(a);n||"fixed"!==i.position||(s=null),(o?!n&&!s:!n&&"static"===i.position&&s&&["absolute","fixed"].includes(s.position)||O(a)&&!n&&function t(i,n){let r=Q(i);return!(r===n||!W(r)||F(r))&&("fixed"===A(r).position||t(r,n))}(t,a))?r=r.filter(t=>t!==a):s=i,a=Q(a)}return i.set(t,r),r}(i,this._c):[].concat(n),a=[...o,r],l=a[0],h=a.reduce((t,n)=>{let r=tt(i,n,s);return t.top=V(r.top,t.top),t.right=j(r.right,t.right),t.bottom=j(r.bottom,t.bottom),t.left=V(r.left,t.left),t},tt(i,l,s));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}},getOffsetParent:ti,getElementRects:async function(t){let{reference:i,floating:n,strategy:r}=t,s=this.getOffsetParent||ti,o=this.getDimensions;return{reference:function(t,i,n){let r=D(i),s=K(i),o="fixed"===n,a=$(t,!0,o,i),l={scrollLeft:0,scrollTop:0},h=Y(0);if(r||!r&&!o){if(("body"!==I(i)||O(s))&&(l=q(i)),D(i)){let t=$(i,!0,o,i);h.x=t.x+i.clientLeft,h.y=t.y+i.clientTop}else s&&(h.x=J(s))}return{x:a.left+l.scrollLeft-h.x,y:a.top+l.scrollTop-h.y,width:a.width,height:a.height}}(i,await s(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return Z(t)},getScale:X,isElement:W,isRTL:function(t){return"rtl"===getComputedStyle(t).direction}},tr=(t,i,n)=>{let r=new Map,s={platform:tn,...n},o={...s.platform,_c:r};return(async(t,i,n)=>{let{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,l=o.filter(Boolean),h=await (null==a.isRTL?void 0:a.isRTL(i)),u=await a.getElementRects({reference:t,floating:i,strategy:s}),{x:c,y:f}=v(u,r,h),d=r,p={},m=0;for(let n=0;n1?"s":"")+" required, but only "+i.length+" present")}function th(t){tl(1,arguments);var i=Object.prototype.toString.call(t);return t instanceof Date||"object"===u(t)&&"[object Date]"===i?new Date(t.getTime()):"number"==typeof t||"[object Number]"===i?new Date(t):("string"!=typeof t&&"[object String]"!==i||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}function tu(t,i){tl(2,arguments);var n=th(t).getTime(),r=ta(i);return new Date(n+r)}function tc(t,i){return tl(2,arguments),tu(t,36e5*ta(i))}var tf={};function td(t){return tl(1,arguments),(!!function(t){return tl(1,arguments),t instanceof Date||"object"===u(t)&&"[object Date]"===Object.prototype.toString.call(t)}(t)||"number"==typeof t)&&!isNaN(Number(th(t)))}function tp(t){tl(1,arguments);var i=th(t),n=i.getUTCDay();return i.setUTCDate(i.getUTCDate()-((n<1?7:0)+n-1)),i.setUTCHours(0,0,0,0),i}function tm(t){tl(1,arguments);var i=th(t),n=i.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var s=tp(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=tp(o);return i.getTime()>=s.getTime()?n+1:i.getTime()>=a.getTime()?n:n-1}function tv(t,i){tl(1,arguments);var n,r,s,o,a,l,h,u,c=ta(null!==(n=null!==(r=null!==(s=null!==(o=null==i?void 0:i.weekStartsOn)&&void 0!==o?o:null==i||null===(a=i.locale)||void 0===a||null===(l=a.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==s?s:tf.weekStartsOn)&&void 0!==r?r:null===(h=tf.locale)||void 0===h||null===(u=h.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==n?n:0);if(!(c>=0&&c<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=th(t),d=f.getUTCDay();return f.setUTCDate(f.getUTCDate()-((d=1&&d<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(f+1,0,d),p.setUTCHours(0,0,0,0);var m=tv(p,i),v=new Date(0);v.setUTCFullYear(f,0,d),v.setUTCHours(0,0,0,0);var g=tv(v,i);return c.getTime()>=m.getTime()?f+1:c.getTime()>=g.getTime()?f:f-1}function ty(t,i){for(var n=Math.abs(t).toString();n.length0?n:1-n;return ty("yy"===i?r%100:r,i.length)},M:function(t,i){var n=t.getUTCMonth();return"M"===i?String(n+1):ty(n+1,2)},d:function(t,i){return ty(t.getUTCDate(),i.length)},a:function(t,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(i){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(t,i){return ty(t.getUTCHours()%12||12,i.length)},H:function(t,i){return ty(t.getUTCHours(),i.length)},m:function(t,i){return ty(t.getUTCMinutes(),i.length)},s:function(t,i){return ty(t.getUTCSeconds(),i.length)},S:function(t,i){var n=i.length;return ty(Math.floor(t.getUTCMilliseconds()*Math.pow(10,n-3)),i.length)}};function tw(t,i){var n=t>0?"-":"+",r=Math.abs(t),s=Math.floor(r/60),o=r%60;return 0===o?n+String(s):n+String(s)+(i||"")+ty(o,2)}function tb(t,i){return t%60==0?(t>0?"-":"+")+ty(Math.abs(t)/60,2):t_(t,i)}function t_(t,i){var n=Math.abs(t);return(t>0?"-":"+")+ty(Math.floor(n/60),2)+(i||"")+ty(n%60,2)}var tS={G:function(t,i,n){var r=t.getUTCFullYear()>0?1:0;switch(i){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,i,n){if("yo"===i){var r=t.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return tx.y(t,i)},Y:function(t,i,n,r){var s=tg(t,r),o=s>0?s:1-s;return"YY"===i?ty(o%100,2):"Yo"===i?n.ordinalNumber(o,{unit:"year"}):ty(o,i.length)},R:function(t,i){return ty(tm(t),i.length)},u:function(t,i){return ty(t.getUTCFullYear(),i.length)},Q:function(t,i,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(i){case"Q":return String(r);case"QQ":return ty(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,i,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(i){case"q":return String(r);case"qq":return ty(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,i,n){var r=t.getUTCMonth();switch(i){case"M":case"MM":return tx.M(t,i);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,i,n){var r=t.getUTCMonth();switch(i){case"L":return String(r+1);case"LL":return ty(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,i,n,r){var s=function(t,i){tl(1,arguments);var n=th(t);return Math.round((tv(n,i).getTime()-(function(t,i){tl(1,arguments);var n,r,s,o,a,l,h,u,c=ta(null!==(n=null!==(r=null!==(s=null!==(o=null==i?void 0:i.firstWeekContainsDate)&&void 0!==o?o:null==i||null===(a=i.locale)||void 0===a||null===(l=a.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==s?s:tf.firstWeekContainsDate)&&void 0!==r?r:null===(h=tf.locale)||void 0===h||null===(u=h.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1),f=tg(t,i),d=new Date(0);return d.setUTCFullYear(f,0,c),d.setUTCHours(0,0,0,0),tv(d,i)})(n,i).getTime())/6048e5)+1}(t,r);return"wo"===i?n.ordinalNumber(s,{unit:"week"}):ty(s,i.length)},I:function(t,i,n){var r=function(t){tl(1,arguments);var i=th(t);return Math.round((tp(i).getTime()-(function(t){tl(1,arguments);var i=tm(t),n=new Date(0);return n.setUTCFullYear(i,0,4),n.setUTCHours(0,0,0,0),tp(n)})(i).getTime())/6048e5)+1}(t);return"Io"===i?n.ordinalNumber(r,{unit:"week"}):ty(r,i.length)},d:function(t,i,n){return"do"===i?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):tx.d(t,i)},D:function(t,i,n){var r=function(t){tl(1,arguments);var i=th(t),n=i.getTime();return i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0),Math.floor((n-i.getTime())/864e5)+1}(t);return"Do"===i?n.ordinalNumber(r,{unit:"dayOfYear"}):ty(r,i.length)},E:function(t,i,n){var r=t.getUTCDay();switch(i){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,i,n,r){var s=t.getUTCDay(),o=(s-r.weekStartsOn+8)%7||7;switch(i){case"e":return String(o);case"ee":return ty(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,i,n,r){var s=t.getUTCDay(),o=(s-r.weekStartsOn+8)%7||7;switch(i){case"c":return String(o);case"cc":return ty(o,i.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,i,n){var r=t.getUTCDay(),s=0===r?7:r;switch(i){case"i":return String(s);case"ii":return ty(s,i.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,i,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(i){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,i,n){var r,s=t.getUTCHours();switch(r=12===s?"noon":0===s?"midnight":s/12>=1?"pm":"am",i){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,i,n){var r,s=t.getUTCHours();switch(r=s>=17?"evening":s>=12?"afternoon":s>=4?"morning":"night",i){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,i,n){if("ho"===i){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return tx.h(t,i)},H:function(t,i,n){return"Ho"===i?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):tx.H(t,i)},K:function(t,i,n){var r=t.getUTCHours()%12;return"Ko"===i?n.ordinalNumber(r,{unit:"hour"}):ty(r,i.length)},k:function(t,i,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===i?n.ordinalNumber(r,{unit:"hour"}):ty(r,i.length)},m:function(t,i,n){return"mo"===i?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):tx.m(t,i)},s:function(t,i,n){return"so"===i?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):tx.s(t,i)},S:function(t,i){return tx.S(t,i)},X:function(t,i,n,r){var s=(r._originalDate||t).getTimezoneOffset();if(0===s)return"Z";switch(i){case"X":return tb(s);case"XXXX":case"XX":return t_(s);default:return t_(s,":")}},x:function(t,i,n,r){var s=(r._originalDate||t).getTimezoneOffset();switch(i){case"x":return tb(s);case"xxxx":case"xx":return t_(s);default:return t_(s,":")}},O:function(t,i,n,r){var s=(r._originalDate||t).getTimezoneOffset();switch(i){case"O":case"OO":case"OOO":return"GMT"+tw(s,":");default:return"GMT"+t_(s,":")}},z:function(t,i,n,r){var s=(r._originalDate||t).getTimezoneOffset();switch(i){case"z":case"zz":case"zzz":return"GMT"+tw(s,":");default:return"GMT"+t_(s,":")}},t:function(t,i,n,r){return ty(Math.floor((r._originalDate||t).getTime()/1e3),i.length)},T:function(t,i,n,r){return ty((r._originalDate||t).getTime(),i.length)}},tk=function(t,i){switch(t){case"P":return i.date({width:"short"});case"PP":return i.date({width:"medium"});case"PPP":return i.date({width:"long"});default:return i.date({width:"full"})}},tT=function(t,i){switch(t){case"p":return i.time({width:"short"});case"pp":return i.time({width:"medium"});case"ppp":return i.time({width:"long"});default:return i.time({width:"full"})}},tP={p:tT,P:function(t,i){var n,r=t.match(/(P+)(p+)?/)||[],s=r[1],o=r[2];if(!o)return tk(t,i);switch(s){case"P":n=i.dateTime({width:"short"});break;case"PP":n=i.dateTime({width:"medium"});break;case"PPP":n=i.dateTime({width:"long"});break;default:n=i.dateTime({width:"full"})}return n.replace("{{date}}",tk(s,i)).replace("{{time}}",tT(o,i))}},tM=["D","DD"],tz=["YY","YYYY"];function tE(t,i,n){if("YYYY"===t)throw RangeError("Use `yyyy` instead of `YYYY` (in `".concat(i,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw RangeError("Use `yy` instead of `YY` (in `".concat(i,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw RangeError("Use `d` instead of `D` (in `".concat(i,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw RangeError("Use `dd` instead of `DD` (in `".concat(i,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var tA={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function tC(t){return function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=i.width?String(i.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}var tI={date:tC({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:tC({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:tC({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},tD={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function tL(t){return function(i,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){var s=t.defaultFormattingWidth||t.defaultWidth,o=null!=n&&n.width?String(n.width):s;r=t.formattingValues[o]||t.formattingValues[s]}else{var a=t.defaultWidth,l=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[l]||t.values[a]}return r[t.argumentCallback?t.argumentCallback(i):i]}}function tO(t){return function(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=i.match(s);if(!o)return null;var a,l=o[0],h=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(h)?function(t,i){for(var n=0;n0?"in "+r:r+" ago":r},formatLong:tI,formatRelative:function(t,i,n,r){return tD[t]},localize:{ordinalNumber:function(t,i){var n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:tL({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:tL({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:tL({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:tL({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:tL({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(tR={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(tR.matchPattern);if(!n)return null;var r=n[0],s=t.match(tR.parsePattern);if(!s)return null;var o=tR.valueCallback?tR.valueCallback(s[0]):s[0];return{value:o=i.valueCallback?i.valueCallback(o):o,rest:t.slice(r.length)}}),era:tO({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:tO({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:tO({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:tO({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:tO({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},tj=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tB=/^'([^]*?)'?$/,tY=/''/g,tZ=/[a-zA-Z]/;function tW(t,i,n){tl(2,arguments);var r,s,o,a,l,h,u,c,f,d,p,m,v,g,y,x,w,b,_,S=String(i),k=null!==(s=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:tf.locale)&&void 0!==s?s:tF,T=ta(null!==(a=null!==(l=null!==(h=null!==(u=null==n?void 0:n.firstWeekContainsDate)&&void 0!==u?u:null==n||null===(c=n.locale)||void 0===c||null===(f=c.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==h?h:tf.firstWeekContainsDate)&&void 0!==l?l:null===(d=tf.locale)||void 0===d||null===(p=d.options)||void 0===p?void 0:p.firstWeekContainsDate)&&void 0!==a?a:1);if(!(T>=1&&T<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var P=ta(null!==(m=null!==(v=null!==(g=null!==(y=null==n?void 0:n.weekStartsOn)&&void 0!==y?y:null==n||null===(x=n.locale)||void 0===x||null===(w=x.options)||void 0===w?void 0:w.weekStartsOn)&&void 0!==g?g:tf.weekStartsOn)&&void 0!==v?v:null===(b=tf.locale)||void 0===b||null===(_=b.options)||void 0===_?void 0:_.weekStartsOn)&&void 0!==m?m:0);if(!(P>=0&&P<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw RangeError("locale must contain localize property");if(!k.formatLong)throw RangeError("locale must contain formatLong property");var M=th(t);if(!td(M))throw RangeError("Invalid time value");var z=((r=new Date(Date.UTC(M.getFullYear(),M.getMonth(),M.getDate(),M.getHours(),M.getMinutes(),M.getSeconds(),M.getMilliseconds()))).setUTCFullYear(M.getFullYear()),M.getTime()-r.getTime()),E=function(t,i){return tl(2,arguments),tu(t,-ta(i))}(M,z),A={firstWeekContainsDate:T,weekStartsOn:P,locale:k,_originalDate:M};return S.match(tV).map(function(t){var i=t[0];return"p"===i||"P"===i?(0,tP[i])(t,k.formatLong):t}).join("").match(tj).map(function(r){if("''"===r)return"'";var s,o=r[0];if("'"===o)return(s=r.match(tB))?s[1].replace(tY,"'"):r;var a=tS[o];if(a)return null!=n&&n.useAdditionalWeekYearTokens||-1===tz.indexOf(r)||tE(r,i,String(t)),null!=n&&n.useAdditionalDayOfYearTokens||-1===tM.indexOf(r)||tE(r,i,String(t)),a(E,r,k.localize,A);if(o.match(tZ))throw RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r}).join("")}var tH="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function tX(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var tU,tG={exports:{}},t$={};tG.exports=function(){if(tU)return t$;tU=1;var t=Symbol.for("react.element"),i=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,r=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(i,o,a){var l,h={},u=null,c=null;for(l in void 0!==a&&(u=""+a),void 0!==o.key&&(u=""+o.key),void 0!==o.ref&&(c=o.ref),o)n.call(o,l)&&!s.hasOwnProperty(l)&&(h[l]=o[l]);if(i&&i.defaultProps)for(l in o=i.defaultProps)void 0===h[l]&&(h[l]=o[l]);return{$$typeof:t,type:i,key:u,ref:c,props:h,_owner:r.current}}return t$.Fragment=i,t$.jsx=o,t$.jsxs=o,t$}();var tq=tG.exports;let tK=({title:t="Close",onClick:i})=>tq.jsx("a",{className:"close-button-module_closeButton__6XZN-",role:"button",title:t,"aria-label":t,onClick:()=>{i?.()},children:tq.jsx("svg",{className:"close-button-module_svgIcon__K3aw9",viewBox:"0 0 1024 1024",children:tq.jsx("path",{d:"M150 150a512 512 0 11724 724 512 512 0 01-724-724zm69.3 64.2A418.5 418.5 0 0095.9 512a418.5 418.5 0 00123.4 297.8A418.5 418.5 0 00517 933.2 418.5 418.5 0 00815 809.8 418.5 418.5 0 00938.4 512 418.5 418.5 0 00815 214.2 418.5 418.5 0 00517 90.8a418.5 418.5 0 00-297.8 123.4zM655 304a46 46 0 0165 65L577 512l143 143a46 46 0 11-65 65L512 577 369 720a46 46 0 11-65-65l143-143-143-143a46 46 0 0165-65l143 143 143-143z"})})}),tJ=(t,i,n=1)=>Array.from({length:(i-t)/n+1},(i,r)=>t+r*n);function tQ(t){return Math.max(3,Math.abs(t)/100)}function t0(t){return Math.max(3,Math.abs(t)/50)}let t1={AREA:"area",CANDLE:"candle",LINE:"line",OHLC:"ohlc"},t2={I1M:"I1M",I5M:"I5M",I15M:"I15M",I30M:"I30M",I1H:"I1H",I4H:"I4H",I6H:"I6H",I8H:"I8H",I12H:"I12H",I1D:"I1D",I7D:"I7D"};function t5(t,i){switch(t){case t2.I1M:return i;case t2.I5M:return 5*i;case t2.I15M:return 15*i;case t2.I30M:return 30*i;case t2.I1H:return 60*i;case t2.I4H:return 60*i*4;case t2.I6H:return 60*i*6;case t2.I8H:return 60*i*8;case t2.I12H:return 60*i*12;case t2.I1D:return 60*i*24;case t2.I7D:return 60*i*168;default:throw Error("Invalid interval")}}let t3=t=>{let i;let[n,r]=function(t){let i=t.match(/I(\d+)([MHD])/);if(!i)throw Error("Invalid interval value");return[parseInt(i[1],10),i[2]]}(t);switch(r){case"M":i=60*n*1e3;break;case"H":i=60*n*6e4;break;case"D":i=24*n*36e5;break;default:throw Error("Invalid interval unit")}return i};function t6(t,i,n){i.save(),i.resetTransform(),i.clearRect(0,0,t.width,t.height),n&&(i.fillStyle=n,i.fillRect(0,0,t.width,t.height)),i.restore()}let t4={GRAY:"#6a6a6a",VEGA_RED:"#ff261a",VEGA_ORANGE:"#d9822b",VEGA_GREEN:"#26ff8a",VEGA_YELLOW:"#daff0d"};function t7(t,i){let n=0,r=0,s=[...t].sort((t,i)=>t.date.getTime()-i.date.getTime()),o=[...i].sort((t,i)=>t.date.getTime()-i.date.getTime()),a=[];for(;no[r].date?a.push(o[r++]):(a.push(s[n++]),r++);for(;n0))return l;do l.push(a=new Date(+n)),i(n,o),t(n);while(a=i)for(;t(i),!n(i);)i.setTime(i-1)},function(t,r){if(t>=t){if(r<0)for(;++r<=0;)for(;i(t,-1),!n(t););else for(;--r>=0;)for(;i(t,1),!n(t););}})},n&&(s.count=function(i,r){return t9.setTime(+i),t8.setTime(+r),t(t9),t(t8),Math.floor(n(t9,t8))},s.every=function(t){return isFinite(t=Math.floor(t))&&t>0?t>1?s.filter(r?function(i){return r(i)%t==0}:function(i){return s.count(0,i)%t==0}):s:null}),s}var ee=et(function(){},function(t,i){t.setTime(+t+i)},function(t,i){return i-t});ee.every=function(t){return isFinite(t=Math.floor(t))&&t>0?t>1?et(function(i){i.setTime(Math.floor(i/t)*t)},function(i,n){i.setTime(+i+n*t)},function(i,n){return(n-i)/t}):ee:null},ee.range;var ei=et(function(t){t.setTime(t-t.getMilliseconds())},function(t,i){t.setTime(+t+1e3*i)},function(t,i){return(i-t)/1e3},function(t){return t.getUTCSeconds()});ei.range;var en=et(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},function(t,i){t.setTime(+t+6e4*i)},function(t,i){return(i-t)/6e4},function(t){return t.getMinutes()});en.range;var er=et(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())},function(t,i){t.setTime(+t+36e5*i)},function(t,i){return(i-t)/36e5},function(t){return t.getHours()});er.range;var es=et(t=>t.setHours(0,0,0,0),(t,i)=>t.setDate(t.getDate()+i),(t,i)=>(i-t-6e4*(i.getTimezoneOffset()-t.getTimezoneOffset()))/864e5,t=>t.getDate()-1);function eo(t){return et(function(i){i.setDate(i.getDate()-(i.getDay()+7-t)%7),i.setHours(0,0,0,0)},function(t,i){t.setDate(t.getDate()+7*i)},function(t,i){return(i-t-6e4*(i.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5})}es.range;var ea=eo(0),el=eo(1),eh=eo(2),eu=eo(3),ec=eo(4),ef=eo(5),ed=eo(6);ea.range,el.range,eh.range,eu.range,ec.range,ef.range,ed.range;var ep=et(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,i){t.setMonth(t.getMonth()+i)},function(t,i){return i.getMonth()-t.getMonth()+12*(i.getFullYear()-t.getFullYear())},function(t){return t.getMonth()});ep.range;var em=et(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,i){t.setFullYear(t.getFullYear()+i)},function(t,i){return i.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});em.every=function(t){return isFinite(t=Math.floor(t))&&t>0?et(function(i){i.setFullYear(Math.floor(i.getFullYear()/t)*t),i.setMonth(0,1),i.setHours(0,0,0,0)},function(i,n){i.setFullYear(i.getFullYear()+n*t)}):null},em.range;var ev=et(function(t){t.setUTCHours(0,0,0,0)},function(t,i){t.setUTCDate(t.getUTCDate()+i)},function(t,i){return(i-t)/864e5},function(t){return t.getUTCDate()-1});function eg(t){return et(function(i){i.setUTCDate(i.getUTCDate()-(i.getUTCDay()+7-t)%7),i.setUTCHours(0,0,0,0)},function(t,i){t.setUTCDate(t.getUTCDate()+7*i)},function(t,i){return(i-t)/6048e5})}ev.range;var ey=eg(0),ex=eg(1),ew=eg(2),eb=eg(3),e_=eg(4),eS=eg(5),ek=eg(6);ey.range,ex.range,ew.range,eb.range,e_.range,eS.range,ek.range;var eT=et(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,i){t.setUTCFullYear(t.getUTCFullYear()+i)},function(t,i){return i.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});eT.every=function(t){return isFinite(t=Math.floor(t))&&t>0?et(function(i){i.setUTCFullYear(Math.floor(i.getUTCFullYear()/t)*t),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)},function(i,n){i.setUTCFullYear(i.getUTCFullYear()+n*t)}):null},eT.range;var eP=Math.sqrt(50),eM=Math.sqrt(10),ez=Math.sqrt(2);function eE(t,i,n){var r=Math.abs(i-t)/Math.max(0,n),s=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/s;return o>=eP?s*=10:o>=eM?s*=5:o>=ez&&(s*=2),it).length&&(o=s,s=function(t,i){var n;return(n=o(t))i?1:n>=i?0:NaN}),{left:function(t,i,n,r){for(null==n&&(n=0),null==r&&(r=t.length);n>>1;0>s(t[o],i)?n=o+1:r=o}return n},right:function(t,i,n,r){for(null==n&&(n=0),null==r&&(r=t.length);n>>1;s(t[o],i)>0?r=o:n=o+1}return n}}).right(a,l);if(h===a.length)return t.every(eE(i/31536e6,n/31536e6,r));if(0===h)return ee.every(Math.max(eE(i,n,r),1));let[u,c]=a[l/a[h-1][2][t.toLowerCase(),i]))}function eH(t,i,n){var r=eF.exec(i.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function eX(t,i,n){var r=eF.exec(i.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function eU(t,i,n){var r=eF.exec(i.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function eG(t,i,n){var r=eF.exec(i.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function e$(t,i,n){var r=eF.exec(i.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function eq(t,i,n){var r=eF.exec(i.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function eK(t,i,n){var r=eF.exec(i.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function eJ(t,i,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(i.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function eQ(t,i,n){var r=eF.exec(i.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function e0(t,i,n){var r=eF.exec(i.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function e1(t,i,n){var r=eF.exec(i.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function e2(t,i,n){var r=eF.exec(i.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function e5(t,i,n){var r=eF.exec(i.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function e3(t,i,n){var r=eF.exec(i.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function e6(t,i,n){var r=eF.exec(i.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function e4(t,i,n){var r=eF.exec(i.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function e7(t,i,n){var r=eF.exec(i.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function e9(t,i,n){var r=ej.exec(i.slice(n,n+1));return r?n+r[0].length:-1}function e8(t,i,n){var r=eF.exec(i.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function it(t,i,n){var r=eF.exec(i.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function ie(t,i){return eB(t.getDate(),i,2)}function ii(t,i){return eB(t.getHours(),i,2)}function ir(t,i){return eB(t.getHours()%12||12,i,2)}function is(t,i){return eB(1+es.count(em(t),t),i,3)}function io(t,i){return eB(t.getMilliseconds(),i,3)}function ia(t,i){return io(t,i)+"000"}function il(t,i){return eB(t.getMonth()+1,i,2)}function ih(t,i){return eB(t.getMinutes(),i,2)}function iu(t,i){return eB(t.getSeconds(),i,2)}function ic(t){var i=t.getDay();return 0===i?7:i}function id(t,i){return eB(ea.count(em(t)-1,t),i,2)}function ip(t){var i=t.getDay();return i>=4||0===i?ec(t):ec.ceil(t)}function im(t,i){return t=ip(t),eB(ec.count(em(t),t)+(4===em(t).getDay()),i,2)}function iv(t){return t.getDay()}function ig(t,i){return eB(el.count(em(t)-1,t),i,2)}function iy(t,i){return eB(t.getFullYear()%100,i,2)}function ix(t,i){return eB((t=ip(t)).getFullYear()%100,i,2)}function iw(t,i){return eB(t.getFullYear()%1e4,i,4)}function ib(t,i){var n=t.getDay();return eB((t=n>=4||0===n?ec(t):ec.ceil(t)).getFullYear()%1e4,i,4)}function i_(t){var i=t.getTimezoneOffset();return(i>0?"-":(i*=-1,"+"))+eB(i/60|0,"0",2)+eB(i%60,"0",2)}function iS(t,i){return eB(t.getUTCDate(),i,2)}function ik(t,i){return eB(t.getUTCHours(),i,2)}function iT(t,i){return eB(t.getUTCHours()%12||12,i,2)}function iP(t,i){return eB(1+ev.count(eT(t),t),i,3)}function iM(t,i){return eB(t.getUTCMilliseconds(),i,3)}function iz(t,i){return iM(t,i)+"000"}function iE(t,i){return eB(t.getUTCMonth()+1,i,2)}function iA(t,i){return eB(t.getUTCMinutes(),i,2)}function iC(t,i){return eB(t.getUTCSeconds(),i,2)}function iI(t){var i=t.getUTCDay();return 0===i?7:i}function iD(t,i){return eB(ey.count(eT(t)-1,t),i,2)}function iL(t){var i=t.getUTCDay();return i>=4||0===i?e_(t):e_.ceil(t)}function iO(t,i){return t=iL(t),eB(e_.count(eT(t),t)+(4===eT(t).getUTCDay()),i,2)}function iN(t){return t.getUTCDay()}function iR(t,i){return eB(ex.count(eT(t)-1,t),i,2)}function iF(t,i){return eB(t.getUTCFullYear()%100,i,2)}function ij(t,i){return eB((t=iL(t)).getUTCFullYear()%100,i,2)}function iV(t,i){return eB(t.getUTCFullYear()%1e4,i,4)}function iB(t,i){var n=t.getUTCDay();return eB((t=n>=4||0===n?e_(t):e_.ceil(t)).getUTCFullYear()%1e4,i,4)}function iY(){return"+0000"}function iZ(){return"%"}function iW(t){return+t}function iH(t){return Math.floor(+t/1e3)}eN=(eO=function(t){var i=t.dateTime,n=t.date,r=t.time,s=t.periods,o=t.days,a=t.shortDays,l=t.months,h=t.shortMonths,u=eZ(s),c=eW(s),f=eZ(o),d=eW(o),p=eZ(a),m=eW(a),v=eZ(l),g=eW(l),y=eZ(h),x=eW(h),w={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return h[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:null,d:ie,e:ie,f:ia,g:ix,G:ib,H:ii,I:ir,j:is,L:io,m:il,M:ih,p:function(t){return s[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:iW,s:iH,S:iu,u:ic,U:id,V:im,w:iv,W:ig,x:null,X:null,y:iy,Y:iw,Z:i_,"%":iZ},b={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return h[t.getUTCMonth()]},B:function(t){return l[t.getUTCMonth()]},c:null,d:iS,e:iS,f:iz,g:ij,G:iB,H:ik,I:iT,j:iP,L:iM,m:iE,M:iA,p:function(t){return s[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:iW,s:iH,S:iC,u:iI,U:iD,V:iO,w:iN,W:iR,x:null,X:null,y:iF,Y:iV,Z:iY,"%":iZ},_={a:function(t,i,n){var r=p.exec(i.slice(n));return r?(t.w=m.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,i,n){var r=f.exec(i.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,i,n){var r=y.exec(i.slice(n));return r?(t.m=x.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,i,n){var r=v.exec(i.slice(n));return r?(t.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return T(t,i,n,r)},d:e1,e:e1,f:e7,g:eK,G:eq,H:e5,I:e5,j:e2,L:e4,m:e0,M:e3,p:function(t,i,n){var r=u.exec(i.slice(n));return r?(t.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:eQ,Q:e8,s:it,S:e6,u:eX,U:eU,V:eG,w:eH,W:e$,x:function(t,i,r){return T(t,n,i,r)},X:function(t,i,n){return T(t,r,i,n)},y:eK,Y:eq,Z:eJ,"%":e9};function S(t,i){return function(n){var r,s,o,a=[],l=-1,h=0,u=t.length;for(n instanceof Date||(n=new Date(+n));++l53)return null;"w"in o||(o.w=1),"Z"in o?(r=(s=(r=eD(eL(o.y,0,1))).getUTCDay())>4||0===s?ex.ceil(r):ex(r),r=ev.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(r=(s=(r=eI(eL(o.y,0,1))).getDay())>4||0===s?el.ceil(r):el(r),r=es.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),s="Z"in o?eD(eL(o.y,0,1)).getUTCDay():eI(eL(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(s+5)%7:o.w+7*o.U-(s+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,eD(o)):eI(o)}}function T(t,i,n,r){for(var s,o,a=0,l=i.length,h=n.length;a=h)return -1;if(37===(s=i.charCodeAt(a++))){if(!(o=_[(s=i.charAt(a++))in eR?i.charAt(a++):s])||(r=o(t,n,r))<0)return -1}else if(s!=n.charCodeAt(r++))return -1}return r}return w.x=S(n,w),w.X=S(r,w),w.c=S(i,w),b.x=S(n,b),b.X=S(r,b),b.c=S(i,b),{format:function(t){var i=S(t+="",w);return i.toString=function(){return t},i},parse:function(t){var i=k(t+="",!1);return i.toString=function(){return t},i},utcFormat:function(t){var i=S(t+="",b);return i.toString=function(){return t},i},utcParse:function(t){var i=k(t+="",!0);return i.toString=function(){return t},i}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,eO.parse,eO.utcFormat,eO.utcParse,eN(".%L"),eN(":%S");let iX=eN("%H:%M"),iU=eN("%H:%M"),iG=eN("%b %d");eN("%b %d"),eN("%B"),eN("%Y");let i$=(t,i=5)=>isNaN(t)?"-":(i=Math.max(0,i),new Intl.NumberFormat("default",{maximumFractionDigits:i,minimumFractionDigits:i}).format(t)),iq=t=>new Intl.NumberFormat("default",{maximumFractionDigits:t,minimumFractionDigits:t});function iK(t){return iq(2).format(t)}function iJ(t){return iq(2).format(t)}function iQ(t,i){let n=-1/0,r=[...t].sort((t,i)=>t-i),s=r.reduce((t,r)=>{let s=r;return r-ni?1:t>=i?0:NaN}function i1(t){let i=t,n=t;function r(t,i,r,s){for(null==r&&(r=0),null==s&&(s=t.length);r>>1;0>n(t[o],i)?r=o+1:s=o}return r}return 1===t.length&&(i=(i,n)=>t(i)-n,n=(i,n)=>i0(t(i),n)),{left:r,center:function(t,n,s,o){null==s&&(s=0),null==o&&(o=t.length);let a=r(t,n,s,o-1);return a>s&&i(t[a-1],n)>-i(t[a],n)?a-1:a},right:function(t,i,r,s){for(null==r&&(r=0),null==s&&(s=t.length);r>>1;n(t[o],i)>0?s=o:r=o+1}return r}}}let i2=i1(i0),i5=i2.right,i3=i2.left;function i6(t,i){let n,r;if(void 0===i)for(let i of t)null!=i&&(void 0===n?i>=i&&(n=r=i):(n>i&&(n=i),r=o&&(n=r=o):(n>o&&(n=o),r=i)&&(n=i);else{let r=-1;for(let s of t)null!=(s=i(s,++r,t))&&(n=s)&&(n=s)}return n}function i7(t,i){let n;if(void 0===i)for(let i of t)null!=i&&(n>i||void 0===n&&i>=i)&&(n=i);else{let r=-1;for(let s of t)null!=(s=i(s,++r,t))&&(n>s||void 0===n&&s>=s)&&(n=s)}return n}function i9(t,i){let n=0,r=0;if(void 0===i)for(let i of t)null!=i&&(i=+i)>=i&&(++n,r+=i);else{let s=-1;for(let o of t)null!=(o=i(o,++s,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function i8(t){return t.length}i1(function(t){return null===t?NaN:+t}).center;let nt=Math.PI,ne=2*nt,ni=ne-1e-6;function nn(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function nr(){return new nn}function ns(t){return function(){return t}}function no(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function na(t){this._context=t}function nl(t){return new na(t)}function nh(t){return t[0]}function nu(t){return t[1]}function nc(t,i){var n=ns(!0),r=null,s=nl,o=null;function a(a){var l,h,u,c=(a=no(a)).length,f=!1;for(null==r&&(o=s(u=nr())),l=0;l<=c;++l)!(l=c;--f)l.point(g[f],y[f]);l.lineEnd(),l.areaEnd()}}v&&(g[u]=+t(d,u,h),y[u]=+i(d,u,h),l.point(r?+r(d,u,h):g[u],n?+n(d,u,h):y[u]))}if(p)return l=null,p+""||null}function u(){return nc().defined(s).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?nh:ns(+t),i="function"==typeof i?i:ns(void 0===i?0:+i),n="function"==typeof n?n:void 0===n?nu:ns(+n),h.x=function(i){return arguments.length?(t="function"==typeof i?i:ns(+i),r=null,h):t},h.x0=function(i){return arguments.length?(t="function"==typeof i?i:ns(+i),h):t},h.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ns(+t),h):r},h.y=function(t){return arguments.length?(i="function"==typeof t?t:ns(+t),n=null,h):i},h.y0=function(t){return arguments.length?(i="function"==typeof t?t:ns(+t),h):i},h.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:ns(+t),h):n},h.lineX0=h.lineY0=function(){return u().x(t).y(i)},h.lineY1=function(){return u().x(t).y(n)},h.lineX1=function(){return u().x(r).y(i)},h.defined=function(t){return arguments.length?(s="function"==typeof t?t:ns(!!t),h):s},h.curve=function(t){return arguments.length?(a=t,null!=o&&(l=a(o)),h):a},h.context=function(t){return arguments.length?(null==t?o=l=null:l=a(o=t),h):o},h}function nd(t,i){this._context=t,this._t=i}function np(t){return new nd(t,0)}function nm(t){return new nd(t,1)}function nv(t,i){if((s=t.length)>1)for(var n,r,s,o=1,a=t[i[0]],l=a.length;o=0;)n[i]=i;return n}function ny(t,i){return t[i]}function nx(t){let i=[];return i.key=t,i}nn.prototype=nr.prototype={constructor:nn,moveTo:function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},quadraticCurveTo:function(t,i,n,r){this._+="Q"+ +t+","+ +i+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,i,n,r,s,o){this._+="C"+ +t+","+ +i+","+ +n+","+ +r+","+(this._x1=+s)+","+(this._y1=+o)},arcTo:function(t,i,n,r,s){t=+t,i=+i,n=+n,r=+r,s=+s;var o=this._x1,a=this._y1,l=n-t,h=r-i,u=o-t,c=a-i,f=u*u+c*c;if(s<0)throw Error("negative radius: "+s);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=i);else if(f>1e-6){if(Math.abs(c*l-h*u)>1e-6&&s){var d=n-o,p=r-a,m=l*l+h*h,v=Math.sqrt(m),g=Math.sqrt(f),y=s*Math.tan((nt-Math.acos((m+f-(d*d+p*p))/(2*v*g)))/2),x=y/g,w=y/v;Math.abs(x-1)>1e-6&&(this._+="L"+(t+x*u)+","+(i+x*c)),this._+="A"+s+","+s+",0,0,"+ +(c*d>u*p)+","+(this._x1=t+w*l)+","+(this._y1=i+w*h)}else this._+="L"+(this._x1=t)+","+(this._y1=i)}},arc:function(t,i,n,r,s,o){t=+t,i=+i,o=!!o;var a=(n=+n)*Math.cos(r),l=n*Math.sin(r),h=t+a,u=i+l,c=1^o,f=o?r-s:s-r;if(n<0)throw Error("negative radius: "+n);null===this._x1?this._+="M"+h+","+u:(Math.abs(this._x1-h)>1e-6||Math.abs(this._y1-u)>1e-6)&&(this._+="L"+h+","+u),n&&(f<0&&(f=f%ne+ne),f>ni?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(i-l)+"A"+n+","+n+",0,1,"+c+","+(this._x1=h)+","+(this._y1=u):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=nt)+","+c+","+(this._x1=t+n*Math.cos(s))+","+(this._y1=i+n*Math.sin(s))))},rect:function(t,i,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}},na.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:this._context.lineTo(t,i)}}},nd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,i),this._context.lineTo(t,i);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,i)}}this._x=t,this._y=i}};class nw{get x(){return this.points[0][0]}constructor(t){this.points=void 0,this.fill=void 0,this.line=void 0,this.areaGenerator=nf().curve(nl),this.lineGenerator=nc().curve(nl);let{points:i,fill:n,line:r}=t;this.points=i,this.fill=n,this.line=r}draw(t,i,n){let r;if(this.areaGenerator.x(t=>i(t[0])).y0(t=>n(t[1])).y1(t=>n(t[2])),this.lineGenerator.x(t=>i(t[0])).y(t=>n(t[2])),"string"==typeof this.fill)r=this.fill;else for(let i of(r=t.createLinearGradient(0,n.range()[1],0,n.range()[0]),this.fill.stops))r.addColorStop(i.offset,i.color);this.areaGenerator.context(t),this.lineGenerator.context(t),this.points.length>1&&(t.beginPath(),this.areaGenerator(this.points),t.fillStyle=r,t.globalAlpha=.7,t.fill(),t.globalAlpha=1,t.closePath(),this.line&&(t.beginPath(),this.lineGenerator(this.points),t.lineWidth=2,t.strokeStyle=this.line,t.stroke(),t.closePath()))}}class nb{constructor(t){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.fill=void 0,this.stroke=void 0,this.lineWidth=void 0;let{x:i,y:n,width:r,height:s,fill:o,stroke:a,lineWidth:l}=t;this.x=i,this.y=n,this.width=r,this.height=s,this.fill=o,this.stroke=a,this.lineWidth=l}draw(t,i,n,r=1){t.beginPath();let s=Math.max(i(this.width)-i(0),1/r);t.rect(i(this.x.getTime()-this.width/2),n(this.y),s,Math.abs(n(this.height)-n(0))),t.fillStyle=this.fill,t.fill(),this.stroke&&(t.lineWidth=this.lineWidth/r,t.strokeStyle=this.stroke,t.stroke())}}class n_{draw(t,i,n,r=1,s,o){!function(t,i,n,r,s){let o=r[0],a=r[1],l=i.range().map(Math.round),h=n.range().map(Math.round);t.save(),t.setLineDash([4,6]),t.lineWidth=1,t.strokeStyle=s,o&&(t.beginPath(),t.moveTo(Math.round(i(o)),h[0]),t.lineTo(Math.round(i(o)),h[1]),t.stroke(),t.closePath()),a&&(t.beginPath(),t.moveTo(l[0],Math.round(n(a))),t.lineTo(l[1],Math.round(n(a))),t.stroke(),t.closePath()),t.restore()}(t,i,n,s,o)}}class nS{constructor(t){this.x=void 0;let{x:i}=t;this.x=i}draw(t,i,n){}}class nk{draw(t,i,n,r=1,s){!function(t,i,n,r=1,s){let o=i.range().map(Math.round),a=n.range().map(Math.round),l=tQ(o[1]-o[0]),h=t0(a[1]-a[0]),u=i.ticks(l),c=n.ticks(h);for(let n of u)t.save(),t.beginPath(),t.strokeStyle=s,t.fillStyle="transparent",t.lineWidth=1/r,t.moveTo(i(n),a[0]),t.lineTo(i(n),a[1]),t.fill(),t.stroke(),t.closePath(),t.restore();for(let i of c)t.save(),t.beginPath(),t.strokeStyle=s,t.fillStyle="transparent",t.lineWidth=1/r,t.moveTo(o[0],n(i)),t.lineTo(o[1],n(i)),t.fill(),t.stroke(),t.closePath(),t.restore()}(t,i,n,r,s)}}class nT{constructor(t){this.labels=void 0;let{labels:i}=t;this.labels=[...i].sort((t,i)=>i.y-t.y)}draw(t,i,n,r=1,s){let o=iQ(this.labels.map(t=>n(t.y)),22);for(let a=0;at.measureText(i.label).width+8));t.beginPath(),t.setLineDash([2*r,3*r]),t.moveTo(h,o),t.lineTo(Math.max(i.range()[1]/2,h),n(s.y)),t.lineTo(i.range()[1],n(s.y)),t.stroke(),t.closePath()}(t,i,n,r,this.labels[a],o[a],s)}}class nP{get x(){return this.points[0][0]}constructor(t){this.points=void 0,this.color=void 0,this.lineGenerator=nc().curve(nl);let{points:i,color:n}=t;this.points=i,this.color=n}draw(t,i,n,r=1){this.lineGenerator.x(t=>i(t[0])).y(t=>n(t[1])),this.lineGenerator.context(t),this.points.length>1&&(t.beginPath(),this.lineGenerator(this.points),t.strokeStyle=this.color,t.lineCap="butt",t.lineWidth=2/r,t.stroke(),t.closePath())}}class nM{constructor(t){this.x=void 0,this.x2=void 0,this.y=void 0,this.y2=void 0,this.color=void 0;let{x:i,x2:n,y:r,y2:s,color:o}=t;this.x=i,this.x2=n,this.y=r,this.y2=s,this.color=o}draw(t,i,n,r=1){let s,o,a,l;null===this.x?(s=i.range()[0],o=i.range()[1],a=n(this.y),l=null===this.y2?a:n(this.y2)):null===this.y?(s=i(this.x),o=null===this.x2?s:i(this.x2),a=n.range()[0],l=n.range()[1]):(s=i(this.x),o=null===this.x2?s:i(this.x2),a=n(this.y),l=null===this.y2?a:n(this.y2)),t.beginPath(),t.moveTo(s,a),t.lineTo(o,l),t.strokeStyle=this.color,t.lineCap="butt",t.lineWidth=2/r,t.stroke(),t.closePath()}}class nz{constructor(t){this.x=void 0,this.y=void 0,this.width=void 0,this.color=void 0,this.orient=void 0;let{x:i,y:n,width:r,color:s,orient:o}=t;this.x=i,this.y=n,this.width=r,this.color=s,this.orient=o}draw(t,i,n,r=1){t.beginPath(),t.moveTo(i(this.x.getTime()-("left"===this.orient?this.width/2:0)),n(this.y)),t.lineTo(i(this.x.getTime()+("right"===this.orient?this.width/2:0)),n(this.y)),t.strokeStyle=this.color,t.lineCap="butt",t.lineWidth=2/r,t.stroke(),t.closePath()}}class nE{draw(t,i,n,r=1,s,o){!function(t,i,n,r,s){t.strokeStyle="#fff";let o=i.range(),a=tQ(o[1]-o[0]),l=i.ticks(a),h=function(t,i){switch(i){case t2.I1M:case t2.I5M:case t2.I15M:case t2.I30M:{let i=[];for(let n=0;n0&&t[n-1].getDay()===t[n].getDay()?i.push(tW(t[n],"HH:mm")):i.push(tW(t[n],"d"));return i}case t2.I1H:case t2.I4H:case t2.I6H:case t2.I8H:case t2.I12H:{let i=[];for(let n=0;n0&&t[n-1].getDay()===t[n].getDay()?i.push(tW(t[n],"HH:mm")):i.push(tW(t[n],"d"));return i}case t2.I7D:case t2.I1D:{let i=[];for(let n=0;n0&&t[n-1].getMonth()===t[n].getMonth()?i.push(tW(t[n],"d")):i.push(tW(t[n],"d LLL"));return i}}}(l,r);for(let n=0;ni.range()[1]&&(h=i.range()[1]-l/2),t.beginPath(),t.moveTo(n,.5),t.lineTo(n+5,5.5),t.lineTo(h+l/2,5.5),t.lineTo(h+l/2,24.5),t.lineTo(h-l/2,24.5),t.lineTo(h-l/2,5.5),t.lineTo(n-5,5.5),t.closePath(),t.fillStyle=o.backgroundSurface,t.strokeStyle=o.emphasis300,t.fill(),t.stroke(),t.closePath(),t.beginPath(),t.fillStyle=o.textPrimary,t.fillText(a??"",h,15),t.closePath()}}(t,i,0,s,o,a)}}let nC=((rM={}).RECT="Rectangle",rM.LINE="Line",rM.AREA="Area",rM.POLY="Polygon",rM.CIRCLE="Circle",rM);class nI{constructor(t=0,i=0,n=0,r=0){this.x=0,this.y=0,this.width=0,this.height=0,this.type=void 0,this.x=t,this.y=i,this.width=n,this.height=r,this.type=nC.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new nI(0,0,0,0)}clone(){return new nI(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,i){return!(this.width<=0||this.height<=0)&&t>=this.x&&t=this.y&&ii!=h>i&&t<(i-a)/(h-a)*(l-r)+r&&(n=!n)}return n}};class nN{constructor(t=0,i=0){this.x=0,this.y=0,this.x=t,this.y=i}clone(){return new nN(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,i=t){return this.x=t,this.y=i,this}}class nR{constructor(t=1,i=0,n=0,r=1,s=0,o=0){this.a=void 0,this.b=void 0,this.c=void 0,this.d=void 0,this.tx=void 0,this.ty=void 0,this.array=null,this.a=t,this.b=i,this.c=n,this.d=r,this.tx=s,this.ty=o}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,i,n,r,s,o){return this.a=t,this.b=i,this.c=n,this.d=r,this.tx=s,this.ty=o,this}toArray(t,i){this.array||(this.array=new Float32Array(9));let n=i||this.array;return t?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n}apply(t,i){i=i||new nN;let n=t.x,r=t.y;return i.x=this.a*n+this.c*r+this.tx,i.y=this.b*n+this.d*r+this.ty,i}applyInverse(t,i){i=i||new nN;let n=1/(this.a*this.d+-(this.c*this.b)),r=t.x,s=t.y;return i.x=this.d*n*r+-this.c*n*s+(this.ty*this.c-this.tx*this.d)*n,i.y=this.a*n*s+-this.b*n*r+(-this.ty*this.a+this.tx*this.b)*n,i}translate(t,i){return this.tx+=t,this.ty+=i,this}scale(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this}rotate(t){let i=Math.cos(t),n=Math.sin(t),r=this.a,s=this.c,o=this.tx;return this.a=r*i-this.b*n,this.b=r*n+this.b*i,this.c=s*i-this.d*n,this.d=s*n+this.d*i,this.tx=o*i-this.ty*n,this.ty=o*n+this.ty*i,this}append(t){let i=this.a,n=this.b,r=this.c,s=this.d;return this.a=t.a*i+t.b*r,this.b=t.a*n+t.b*s,this.c=t.c*i+t.d*r,this.d=t.c*n+t.d*s,this.tx=t.tx*i+t.ty*r+this.tx,this.ty=t.tx*n+t.ty*s+this.ty,this}setTransform(t,i,n,r,s,o,a,l,h){return this.a=Math.cos(a+h)*s,this.b=Math.sin(a+h)*s,this.c=-Math.sin(a-l)*o,this.d=Math.cos(a-l)*o,this.tx=t-(n*this.a+r*this.c),this.ty=i-(n*this.b+r*this.d),this}prepend(t){let i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){let i=this.a,n=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this}decompose(t){let i=this.a,n=this.b,r=this.c,s=this.d,o=t.pivot,a=-Math.atan2(-r,s),l=Math.atan2(n,i),h=Math.abs(a+l);return h<1e-5||1e-5>Math.abs(2*Math.PI-h)?(t.rotation=l,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=l),t.scale.x=Math.sqrt(i*i+n*n),t.scale.y=Math.sqrt(r*r+s*s),t.position.x=this.tx+(o.x*i+o.y*r),t.position.y=this.ty+(o.x*n+o.y*s),t}invert(){let t=this.a,i=this.b,n=this.c,r=this.d,s=this.tx,o=t*r-i*n;return this.a=r/o,this.b=-i/o,this.c=-n/o,this.d=t/o,this.tx=(n*this.ty-r*s)/o,this.ty=-(t*this.ty-i*s)/o,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){let t=new nR;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}static get IDENTITY(){return new nR}}var nF={exports:{}};nF.exports=function(){for(var t=function(t,i,n){return void 0===i&&(i=0),void 0===n&&(n=1),tn?n:t},i={},n=0,r=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];n255)&&(i._clipped=!0),i[n]=t(i[n],0,255)):3===n&&(i[n]=t(i[n],0,1));return i},limit:t,type:o,unpack:function(t,i){return void 0===i&&(i=null),t.length>=3?Array.prototype.slice.call(t):"object"==o(t[0])&&i?i.split("").filter(function(i){return void 0!==t[0][i]}).map(function(i){return t[0][i]}):t[0]},last:function(t){if(t.length<2)return null;var i=t.length-1;return"string"==o(t[i])?t[i].toLowerCase():null},PI:a,TWOPI:2*a,PITHIRD:a/3,DEG2RAD:a/180,RAD2DEG:180/a},h={format:{},autodetect:[]},u=l.last,c=l.clip_rgb,f=l.type,d=h,p=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=this;if("object"===f(t[0])&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];var r=u(t),s=!1;if(!r){s=!0,d.sorted||(d.autodetect=d.autodetect.sort(function(t,i){return i.p-t.p}),d.sorted=!0);for(var o=0,a=d.autodetect;o4?t[4]:1;return 1===o?[0,0,0,a]:[n>=1?0:255*(1-n)*(1-o),r>=1?0:255*(1-r)*(1-o),s>=1?0:255*(1-s)*(1-o),a]},_.autodetect.push({p:2,test:function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if("array"===k(t=S(t,"cmyk"))&&4===t.length)return"cmyk"}});var P=l.unpack,M=l.last,z=function(t){return Math.round(100*t)/100},E=l.unpack,A=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n,r,s=(t=E(t,"rgba"))[0],o=t[1],a=t[2],l=Math.min(s/=255,o/=255,a/=255),h=Math.max(s,o,a),u=(h+l)/2;return h===l?(n=0,r=Number.NaN):n=u<.5?(h-l)/(h+l):(h-l)/(2-h-l),s==h?r=(o-a)/(h-l):o==h?r=2+(a-s)/(h-l):a==h&&(r=4+(s-o)/(h-l)),(r*=60)<0&&(r+=360),t.length>3&&void 0!==t[3]?[r,n,u,t[3]]:[r,n,u]},C=l.unpack,I=l.last,D=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=P(t,"hsla"),r=M(t)||"lsa";return n[0]=z(n[0]||0),n[1]=z(100*n[1])+"%",n[2]=z(100*n[2])+"%","hsla"===r||n.length>3&&n[3]<1?(n[3]=n.length>3?n[3]:1,r="hsla"):n.length=3,r+"("+n.join(",")+")"},L=Math.round,O=l.unpack,N=Math.round,R=function(){for(var t,i=[],n=arguments.length;n--;)i[n]=arguments[n];var r,s,o,a=(i=O(i,"hsl"))[0],l=i[1],h=i[2];if(0===l)r=s=o=255*h;else{var u=[0,0,0],c=[0,0,0],f=h<.5?h*(1+l):h+l-h*l,d=2*h-f,p=a/360;u[0]=p+1/3,u[1]=p,u[2]=p-1/3;for(var m=0;m<3;m++)u[m]<0&&(u[m]+=1),u[m]>1&&(u[m]-=1),6*u[m]<1?c[m]=d+6*(f-d)*u[m]:2*u[m]<1?c[m]=f:3*u[m]<2?c[m]=d+(f-d)*(2/3-u[m])*6:c[m]=d;r=(t=[N(255*c[0]),N(255*c[1]),N(255*c[2])])[0],s=t[1],o=t[2]}return i.length>3?[r,s,o,i[3]]:[r,s,o,1]},F=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,j=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,V=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,B=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Y=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Z=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,W=Math.round,H=function(t){var i;if(t=t.toLowerCase().trim(),h.format.named)try{return h.format.named(t)}catch(t){}if(i=t.match(F)){for(var n=i.slice(1,4),r=0;r<3;r++)n[r]=+n[r];return n[3]=1,n}if(i=t.match(j)){for(var s=i.slice(1,5),o=0;o<4;o++)s[o]=+s[o];return s}if(i=t.match(V)){for(var a=i.slice(1,4),l=0;l<3;l++)a[l]=W(2.55*a[l]);return a[3]=1,a}if(i=t.match(B)){for(var u=i.slice(1,5),c=0;c<3;c++)u[c]=W(2.55*u[c]);return u[3]=+u[3],u}if(i=t.match(Y)){var f=i.slice(1,4);f[1]*=.01,f[2]*=.01;var d=R(f);return d[3]=1,d}if(i=t.match(Z)){var p=i.slice(1,4);p[1]*=.01,p[2]*=.01;var m=R(p);return m[3]=+i[4],m}};H.test=function(t){return F.test(t)||j.test(t)||V.test(t)||B.test(t)||Y.test(t)||Z.test(t)};var X=v,U=m,G=h,$=l.type,q=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=C(t,"rgba"),r=I(t)||"rgb";return"hsl"==r.substr(0,3)?D(A(n),r):(n[0]=L(n[0]),n[1]=L(n[1]),n[2]=L(n[2]),("rgba"===r||n.length>3&&n[3]<1)&&(n[3]=n.length>3?n[3]:1,r="rgba"),r+"("+n.slice(0,"rgb"===r?3:4).join(",")+")")};U.prototype.css=function(t){return q(this._rgb,t)},X.css=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(U,[null].concat(t,["css"])))},G.format.css=H,G.autodetect.push({p:5,test:function(t){for(var i=[],n=arguments.length-1;n-- >0;)i[n]=arguments[n+1];if(!i.length&&"string"===$(t)&&H.test(t))return"css"}});var K=m,J=v,Q=h,tt=l.unpack;Q.format.gl=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=tt(t,"rgba");return n[0]*=255,n[1]*=255,n[2]*=255,n},J.gl=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(K,[null].concat(t,["gl"])))},K.prototype.gl=function(){var t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};var te=l.unpack,ti=l.unpack,tn=Math.floor,tr=l.unpack,ts=l.type,to=v,ta=m,tl=h,th=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n,r=te(t,"rgb"),s=r[0],o=r[1],a=r[2],l=Math.min(s,o,a),h=Math.max(s,o,a),u=h-l;return 0===u?n=Number.NaN:(s===h&&(n=(o-a)/u),o===h&&(n=2+(a-s)/u),a===h&&(n=4+(s-o)/u),(n*=60)<0&&(n+=360)),[n,100*u/255,l/(255-u)*100]};ta.prototype.hcg=function(){return th(this._rgb)},to.hcg=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(ta,[null].concat(t,["hcg"])))},tl.format.hcg=function(){for(var t,i,n,r,s,o,a=[],l=arguments.length;l--;)a[l]=arguments[l];var h,u,c,f=(a=ti(a,"hcg"))[0],d=a[1],p=a[2];p*=255;var m=255*d;if(0===d)h=u=c=p;else{360===f&&(f=0),f>360&&(f-=360),f<0&&(f+=360);var v=tn(f/=60),g=f-v,y=p*(1-d),x=y+m*(1-g),w=y+m*g,b=y+m;switch(v){case 0:h=(t=[b,w,y])[0],u=t[1],c=t[2];break;case 1:h=(i=[x,b,y])[0],u=i[1],c=i[2];break;case 2:h=(n=[y,b,w])[0],u=n[1],c=n[2];break;case 3:h=(r=[y,x,b])[0],u=r[1],c=r[2];break;case 4:h=(s=[w,y,b])[0],u=s[1],c=s[2];break;case 5:h=(o=[b,y,x])[0],u=o[1],c=o[2]}}return[h,u,c,a.length>3?a[3]:1]},tl.autodetect.push({p:1,test:function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if("array"===ts(t=tr(t,"hcg"))&&3===t.length)return"hcg"}});var tu=l.unpack,tc=l.last,tf=Math.round,td=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=tu(t,"rgba"),r=n[0],s=n[1],o=n[2],a=n[3],l=tc(t)||"auto";void 0===a&&(a=1),"auto"===l&&(l=a<1?"rgba":"rgb");var h="000000"+((r=tf(r))<<16|(s=tf(s))<<8|(o=tf(o))).toString(16);h=h.substr(h.length-6);var u="0"+tf(255*a).toString(16);switch(u=u.substr(u.length-2),l.toLowerCase()){case"rgba":return"#"+h+u;case"argb":return"#"+u+h;default:return"#"+h}},tp=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,tm=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,tv=function(t){if(t.match(tp)){4!==t.length&&7!==t.length||(t=t.substr(1)),3===t.length&&(t=(t=t.split(""))[0]+t[0]+t[1]+t[1]+t[2]+t[2]);var i=parseInt(t,16);return[i>>16,i>>8&255,255&i,1]}if(t.match(tm)){5!==t.length&&9!==t.length||(t=t.substr(1)),4===t.length&&(t=(t=t.split(""))[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);var n=parseInt(t,16);return[n>>24&255,n>>16&255,n>>8&255,Math.round((255&n)/255*100)/100]}throw Error("unknown hex color: "+t)},tg=v,ty=m,tx=l.type,tw=h;ty.prototype.hex=function(t){return td(this._rgb,t)},tg.hex=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(ty,[null].concat(t,["hex"])))},tw.format.hex=tv,tw.autodetect.push({p:4,test:function(t){for(var i=[],n=arguments.length-1;n-- >0;)i[n]=arguments[n+1];if(!i.length&&"string"===tx(t)&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});var tb=l.unpack,t_=l.TWOPI,tS=Math.min,tk=Math.sqrt,tT=Math.acos,tP=l.unpack,tM=l.limit,tz=l.TWOPI,tE=l.PITHIRD,tA=Math.cos,tC=l.unpack,tI=l.type,tD=v,tL=m,tO=h,tN=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n,r=tb(t,"rgb"),s=r[0],o=r[1],a=r[2],l=tS(s/=255,o/=255,a/=255),h=(s+o+a)/3,u=h>0?1-l/h:0;return 0===u?n=NaN:(n=tT(n=(s-o+(s-a))/2/tk((s-o)*(s-o)+(s-a)*(o-a))),a>o&&(n=t_-n),n/=t_),[360*n,u,h]};tL.prototype.hsi=function(){return tN(this._rgb)},tD.hsi=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(tL,[null].concat(t,["hsi"])))},tO.format.hsi=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n,r,s,o=(t=tP(t,"hsi"))[0],a=t[1],l=t[2];return isNaN(o)&&(o=0),isNaN(a)&&(a=0),o>360&&(o-=360),o<0&&(o+=360),(o/=360)<1/3?r=1-((s=(1-a)/3)+(n=(1+a*tA(tz*o)/tA(tE-tz*o))/3)):o<2/3?s=1-((n=(1-a)/3)+(r=(1+a*tA(tz*(o-=1/3))/tA(tE-tz*o))/3)):n=1-((r=(1-a)/3)+(s=(1+a*tA(tz*(o-=2/3))/tA(tE-tz*o))/3)),[255*(n=tM(l*n*3)),255*(r=tM(l*r*3)),255*(s=tM(l*s*3)),t.length>3?t[3]:1]},tO.autodetect.push({p:2,test:function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if("array"===tI(t=tC(t,"hsi"))&&3===t.length)return"hsi"}});var tR=l.unpack,tF=l.type,tj=v,tV=m,tB=h;tV.prototype.hsl=function(){return A(this._rgb)},tj.hsl=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(tV,[null].concat(t,["hsl"])))},tB.format.hsl=R,tB.autodetect.push({p:2,test:function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if("array"===tF(t=tR(t,"hsl"))&&3===t.length)return"hsl"}});var tY=l.unpack,tZ=Math.min,tW=Math.max,tH=l.unpack,tX=Math.floor,tU=l.unpack,tG=l.type,t$=v,tq=m,tK=h,tJ=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n,r,s=(t=tY(t,"rgb"))[0],o=t[1],a=t[2],l=tZ(s,o,a),h=tW(s,o,a),u=h-l;return 0===h?(n=Number.NaN,r=0):(r=u/h,s===h&&(n=(o-a)/u),o===h&&(n=2+(a-s)/u),a===h&&(n=4+(s-o)/u),(n*=60)<0&&(n+=360)),[n,r,h/255]};tq.prototype.hsv=function(){return tJ(this._rgb)},t$.hsv=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(tq,[null].concat(t,["hsv"])))},tK.format.hsv=function(){for(var t,i,n,r,s,o,a=[],l=arguments.length;l--;)a[l]=arguments[l];var h,u,c,f=(a=tH(a,"hsv"))[0],d=a[1],p=a[2];if(p*=255,0===d)h=u=c=p;else{360===f&&(f=0),f>360&&(f-=360),f<0&&(f+=360);var m=tX(f/=60),v=f-m,g=p*(1-d),y=p*(1-d*v),x=p*(1-d*(1-v));switch(m){case 0:h=(t=[p,x,g])[0],u=t[1],c=t[2];break;case 1:h=(i=[y,p,g])[0],u=i[1],c=i[2];break;case 2:h=(n=[g,p,x])[0],u=n[1],c=n[2];break;case 3:h=(r=[g,y,p])[0],u=r[1],c=r[2];break;case 4:h=(s=[x,g,p])[0],u=s[1],c=s[2];break;case 5:h=(o=[p,g,y])[0],u=o[1],c=o[2]}}return[h,u,c,a.length>3?a[3]:1]},tK.autodetect.push({p:2,test:function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if("array"===tG(t=tU(t,"hsv"))&&3===t.length)return"hsv"}});var tQ={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},t0=l.unpack,t1=Math.pow,t2=function(t){return(t/=255)<=.04045?t/12.92:t1((t+.055)/1.055,2.4)},t5=function(t){return t>tQ.t3?t1(t,1/3):t/tQ.t2+tQ.t0},t3=function(){for(var t,i,n,r=[],s=arguments.length;s--;)r[s]=arguments[s];var o=t0(r,"rgb"),a=(t=o[0],i=o[1],n=o[2],[t5((.4124564*(t=t2(t))+.3575761*(i=t2(i))+.1804375*(n=t2(n)))/tQ.Xn),t5((.2126729*t+.7151522*i+.072175*n)/tQ.Yn),t5((.0193339*t+.119192*i+.9503041*n)/tQ.Zn)]),l=a[0],h=a[1],u=116*h-16;return[u<0?0:u,500*(l-h),200*(h-a[2])]},t6=l.unpack,t4=Math.pow,t7=function(t){return 255*(t<=.00304?12.92*t:1.055*t4(t,1/2.4)-.055)},t9=function(t){return t>tQ.t1?t*t*t:tQ.t2*(t-tQ.t0)},t8=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n,r,s,o=(t=t6(t,"lab"))[0],a=t[1],l=t[2];return r=(o+16)/116,n=isNaN(a)?r:r+a/500,s=isNaN(l)?r:r-l/200,r=tQ.Yn*t9(r),n=tQ.Xn*t9(n),s=tQ.Zn*t9(s),[t7(3.2404542*n-1.5371385*r-.4985314*s),t7(-.969266*n+1.8760108*r+.041556*s),t7(.0556434*n-.2040259*r+1.0572252*s),t.length>3?t[3]:1]},et=l.unpack,ee=l.type,ei=v,en=m,er=h;en.prototype.lab=function(){return t3(this._rgb)},ei.lab=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(en,[null].concat(t,["lab"])))},er.format.lab=t8,er.autodetect.push({p:2,test:function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if("array"===ee(t=et(t,"lab"))&&3===t.length)return"lab"}});var es=l.unpack,eo=l.RAD2DEG,ea=Math.sqrt,el=Math.atan2,eh=Math.round,eu=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=es(t,"lab"),r=n[0],s=n[1],o=n[2],a=ea(s*s+o*o),l=(el(o,s)*eo+360)%360;return 0===eh(1e4*a)&&(l=Number.NaN),[r,a,l]},ec=l.unpack,ef=l.unpack,ed=l.DEG2RAD,ep=Math.sin,em=Math.cos,ev=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=ef(t,"lch"),r=n[0],s=n[1],o=n[2];return isNaN(o)&&(o=0),[r,em(o*=ed)*s,ep(o)*s]},eg=l.unpack,ey=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=ev((t=eg(t,"lch"))[0],t[1],t[2]),r=t8(n[0],n[1],n[2]);return[r[0],r[1],r[2],t.length>3?t[3]:1]},ex=l.unpack,ew=l.unpack,eb=l.type,e_=v,eS=m,ek=h,eT=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=ec(t,"rgb"),r=t3(n[0],n[1],n[2]);return eu(r[0],r[1],r[2])};eS.prototype.lch=function(){return eT(this._rgb)},eS.prototype.hcl=function(){return eT(this._rgb).reverse()},e_.lch=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(eS,[null].concat(t,["lch"])))},e_.hcl=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(eS,[null].concat(t,["hcl"])))},ek.format.lch=ey,ek.format.hcl=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=ex(t,"hcl").reverse();return ey.apply(void 0,n)},["lch","hcl"].forEach(function(t){return ek.autodetect.push({p:2,test:function(){for(var i=[],n=arguments.length;n--;)i[n]=arguments[n];if("array"===eb(i=ew(i,t))&&3===i.length)return t}})});var eP={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},eM=m,ez=h,eE=l.type;eM.prototype.name=function(){for(var t=td(this._rgb,"rgb"),i=0,n=Object.keys(eP);i0;)i[n]=arguments[n+1];if(!i.length&&"string"===eE(t)&&eP[t.toLowerCase()])return"named"}});var eA=l.unpack,eC=l.type,eI=v,eD=m,eL=h,eO=l.type,eN=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=eA(t,"rgb");return(n[0]<<16)+(n[1]<<8)+n[2]};eD.prototype.num=function(){return eN(this._rgb)},eI.num=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(eD,[null].concat(t,["num"])))},eL.format.num=function(t){if("number"==eC(t)&&t>=0&&t<=16777215)return[t>>16,t>>8&255,255&t,1];throw Error("unknown num color: "+t)},eL.autodetect.push({p:5,test:function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if(1===t.length&&"number"===eO(t[0])&&t[0]>=0&&t[0]<=16777215)return"num"}});var eR=v,eF=m,ej=h,eV=l.unpack,eB=l.type,eY=Math.round;eF.prototype.rgb=function(t){return void 0===t&&(t=!0),!1===t?this._rgb.slice(0,3):this._rgb.slice(0,3).map(eY)},eF.prototype.rgba=function(t){return void 0===t&&(t=!0),this._rgb.slice(0,4).map(function(i,n){return n<3?!1===t?i:eY(i):i})},eR.rgb=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(eF,[null].concat(t,["rgb"])))},ej.format.rgb=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=eV(t,"rgba");return void 0===n[3]&&(n[3]=1),n},ej.autodetect.push({p:3,test:function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if("array"===eB(t=eV(t,"rgba"))&&(3===t.length||4===t.length&&"number"==eB(t[3])&&t[3]>=0&&t[3]<=1))return"rgb"}});var eZ=Math.log,eW=function(t){var i,n,r,s=t/100;return s<66?(i=255,n=s<6?0:-155.25485562709179-.44596950469579133*(n=s-2)+104.49216199393888*eZ(n),r=s<20?0:.8274096064007395*(r=s-10)-254.76935184120902+115.67994401066147*eZ(r)):(i=351.97690566805693+.114206453784165*(i=s-55)-40.25366309332127*eZ(i),n=325.4494125711974+.07943456536662342*(n=s-50)-28.0852963507957*eZ(n),r=255),[i,n,r,1]},eH=l.unpack,eX=Math.round,eU=v,eG=m,e$=h,eq=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var n,r=eH(t,"rgb"),s=r[0],o=r[2],a=1e3,l=4e4;l-a>.4;){var h=eW(n=.5*(l+a));h[2]/h[0]>=o/s?l=n:a=n}return eX(n)};eG.prototype.temp=eG.prototype.kelvin=eG.prototype.temperature=function(){return eq(this._rgb)},eU.temp=eU.kelvin=eU.temperature=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(eG,[null].concat(t,["temp"])))},e$.format.temp=e$.format.kelvin=e$.format.temperature=eW;var eK=l.unpack,eJ=Math.cbrt,eQ=Math.pow,e0=Math.sign,e1=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=eK(t,"rgb"),r=n[0],s=n[1],o=n[2],a=[e2(r/255),e2(s/255),e2(o/255)],l=a[0],h=a[1],u=a[2],c=eJ(.4122214708*l+.5363325363*h+.0514459929*u),f=eJ(.2119034982*l+.6806995451*h+.1073969566*u),d=eJ(.0883024619*l+.2817188376*h+.6299787005*u);return[.2104542553*c+.793617785*f-.0040720468*d,1.9779984951*c-2.428592205*f+.4505937099*d,.0259040371*c+.7827717662*f-.808675766*d]};function e2(t){var i=Math.abs(t);return i<.04045?t/12.92:(e0(t)||1)*eQ((i+.055)/1.055,2.4)}var e5=l.unpack,e3=Math.pow,e6=Math.sign,e4=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=(t=e5(t,"lab"))[0],r=t[1],s=t[2],o=e3(n+.3963377774*r+.2158037573*s,3),a=e3(n-.1055613458*r-.0638541728*s,3),l=e3(n-.0894841775*r-1.291485548*s,3);return[255*e7(4.0767416621*o-3.3077115913*a+.2309699292*l),255*e7(-1.2684380046*o+2.6097574011*a-.3413193965*l),255*e7(-.0041960863*o-.7034186147*a+1.707614701*l),t.length>3?t[3]:1]};function e7(t){var i=Math.abs(t);return i>.0031308?(e6(t)||1)*(1.055*e3(i,1/2.4)-.055):12.92*t}var e9=l.unpack,e8=l.type,it=v,ie=m,ii=h;ie.prototype.oklab=function(){return e1(this._rgb)},it.oklab=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(ie,[null].concat(t,["oklab"])))},ii.format.oklab=e4,ii.autodetect.push({p:3,test:function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if("array"===e8(t=e9(t,"oklab"))&&3===t.length)return"oklab"}});var ir=l.unpack,is=l.unpack,io=l.unpack,ia=l.type,il=v,ih=m,iu=h,ic=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=ir(t,"rgb"),r=e1(n[0],n[1],n[2]);return eu(r[0],r[1],r[2])};ih.prototype.oklch=function(){return ic(this._rgb)},il.oklch=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return new(Function.prototype.bind.apply(ih,[null].concat(t,["oklch"])))},iu.format.oklch=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];var n=ev((t=is(t,"lch"))[0],t[1],t[2]),r=e4(n[0],n[1],n[2]);return[r[0],r[1],r[2],t.length>3?t[3]:1]},iu.autodetect.push({p:3,test:function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if("array"===ia(t=io(t,"oklch"))&&3===t.length)return"oklch"}});var id=m,ip=l.type;id.prototype.alpha=function(t,i){return void 0===i&&(i=!1),void 0!==t&&"number"===ip(t)?i?(this._rgb[3]=t,this):new id([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]},m.prototype.clipped=function(){return this._rgb._clipped||!1};var im=m;im.prototype.darken=function(t){void 0===t&&(t=1);var i=this.lab();return i[0]-=tQ.Kn*t,new im(i,"lab").alpha(this.alpha(),!0)},im.prototype.brighten=function(t){return void 0===t&&(t=1),this.darken(-t)},im.prototype.darker=im.prototype.darken,im.prototype.brighter=im.prototype.brighten,m.prototype.get=function(t){var i=t.split("."),n=i[0],r=i[1],s=this[n]();if(r){var o=n.indexOf(r)-("ok"===n.substr(0,2)?2:0);if(o>-1)return s[o];throw Error("unknown channel "+r+" in mode "+n)}return s};var iv=m,ig=l.type,iy=Math.pow;iv.prototype.luminance=function(t){if(void 0!==t&&"number"===ig(t)){if(0===t)return new iv([0,0,0,this._rgb[3]],"rgb");if(1===t)return new iv([255,255,255,this._rgb[3]],"rgb");var i=this.luminance(),n=20,r=function(i,s){var o=i.interpolate(s,.5,"rgb"),a=o.luminance();return!(1e-7>Math.abs(t-a))&&n--?a>t?r(i,o):r(o,s):o},s=(i>t?r(new iv([0,0,0]),this):r(this,new iv([255,255,255]))).rgb();return new iv(s.concat([this._rgb[3]]))}return ix.apply(void 0,this._rgb.slice(0,3))};var ix=function(t,i,n){return .2126*(t=iw(t))+.7152*(i=iw(i))+.0722*(n=iw(n))},iw=function(t){return(t/=255)<=.03928?t/12.92:iy((t+.055)/1.055,2.4)},ib={},i_=l.type,iS=function(t,i,n){void 0===n&&(n=.5);for(var r=[],s=arguments.length-3;s-- >0;)r[s]=arguments[s+3];var o=r[0]||"lrgb";if(ib[o]||r.length||(o=Object.keys(ib)[0]),!ib[o])throw Error("interpolation mode "+o+" is not defined");return"object"!==i_(t)&&(t=new m(t)),"object"!==i_(i)&&(i=new m(i)),ib[o](t,i,n).alpha(t.alpha()+n*(i.alpha()-t.alpha()))},ik=m;ik.prototype.mix=ik.prototype.interpolate=function(t,i){void 0===i&&(i=.5);for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return iS.apply(void 0,[this,t,i].concat(n))};var iT=m;iT.prototype.premultiply=function(t){void 0===t&&(t=!1);var i=this._rgb,n=i[3];return t?(this._rgb=[i[0]*n,i[1]*n,i[2]*n,n],this):new iT([i[0]*n,i[1]*n,i[2]*n,n],"rgb")};var iP=m;iP.prototype.saturate=function(t){void 0===t&&(t=1);var i=this.lch();return i[1]+=tQ.Kn*t,i[1]<0&&(i[1]=0),new iP(i,"lch").alpha(this.alpha(),!0)},iP.prototype.desaturate=function(t){return void 0===t&&(t=1),this.saturate(-t)};var iM=m,iz=l.type;iM.prototype.set=function(t,i,n){void 0===n&&(n=!1);var r=t.split("."),s=r[0],o=r[1],a=this[s]();if(o){var l=s.indexOf(o)-("ok"===s.substr(0,2)?2:0);if(l>-1){if("string"==iz(i))switch(i.charAt(0)){case"+":case"-":a[l]+=+i;break;case"*":a[l]*=+i.substr(1);break;case"/":a[l]/=+i.substr(1);break;default:a[l]=+i}else{if("number"!==iz(i))throw Error("unsupported value for Color.set");a[l]=i}var h=new iM(a,s);return n?(this._rgb=h._rgb,this):h}throw Error("unknown channel "+o+" in mode "+s)}return a},ib.rgb=function(t,i,n){var r=t._rgb,s=i._rgb;return new m(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"rgb")};var iE=Math.sqrt,iA=Math.pow;ib.lrgb=function(t,i,n){var r=t._rgb,s=r[0],o=r[1],a=r[2],l=i._rgb,h=l[0],u=l[1],c=l[2];return new m(iE(iA(s,2)*(1-n)+iA(h,2)*n),iE(iA(o,2)*(1-n)+iA(u,2)*n),iE(iA(a,2)*(1-n)+iA(c,2)*n),"rgb")},ib.lab=function(t,i,n){var r=t.lab(),s=i.lab();return new m(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"lab")};var iC=function(t,i,n,r){var s,o,a,l,h,u,c,f,d,p,v,g,y;return"hsl"===r?(a=t.hsl(),l=i.hsl()):"hsv"===r?(a=t.hsv(),l=i.hsv()):"hcg"===r?(a=t.hcg(),l=i.hcg()):"hsi"===r?(a=t.hsi(),l=i.hsi()):"lch"===r||"hcl"===r?(r="hcl",a=t.hcl(),l=i.hcl()):"oklch"===r&&(a=t.oklch().reverse(),l=i.oklch().reverse()),"h"!==r.substr(0,1)&&"oklch"!==r||(h=(s=a)[0],c=s[1],d=s[2],u=(o=l)[0],f=o[1],p=o[2]),isNaN(h)||isNaN(u)?isNaN(h)?isNaN(u)?g=Number.NaN:(g=u,1!=d&&0!=d||"hsv"==r||(v=f)):(g=h,1!=p&&0!=p||"hsv"==r||(v=c)):g=h+n*(u>h&&u-h>180?u-(h+360):u180?u+360-h:u-h),void 0===v&&(v=c+n*(f-c)),y=d+n*(p-d),new m("oklch"===r?[y,v,g]:[g,v,y],r)},iI=function(t,i,n){return iC(t,i,n,"lch")};ib.lch=iI,ib.hcl=iI,ib.num=function(t,i,n){var r=t.num(),s=i.num();return new m(r+n*(s-r),"num")},ib.hcg=function(t,i,n){return iC(t,i,n,"hcg")},ib.hsi=function(t,i,n){return iC(t,i,n,"hsi")},ib.hsl=function(t,i,n){return iC(t,i,n,"hsl")},ib.hsv=function(t,i,n){return iC(t,i,n,"hsv")},ib.oklab=function(t,i,n){var r=t.oklab(),s=i.oklab();return new m(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"oklab")},ib.oklch=function(t,i,n){return iC(t,i,n,"oklch")};var iD=l.clip_rgb,iL=Math.pow,iO=Math.sqrt,iN=Math.PI,iR=Math.cos,iF=Math.sin,ij=Math.atan2,iV=function(t,i){for(var n=t.length,r=[0,0,0,0],s=0;s.9999999&&(r[3]=1),new m(iD(r))},iB=l.type,iY=Math.pow,iZ=function(t){var i="rgb",n=v("#ccc"),r=0,s=[0,1],o=[],a=[0,0],l=!1,h=[],u=!1,c=0,f=1,d=!1,p={},m=!0,g=1,y=function(t){if("string"===iB(t=t||["#fff","#000"])&&v.brewer&&v.brewer[t.toLowerCase()]&&(t=v.brewer[t.toLowerCase()]),"array"===iB(t)){1===t.length&&(t=[t[0],t[0]]),t=t.slice(0);for(var i=0;i=l[n];)n++;return n-1}return 0},w=function(t){return t},b=function(t){return t},_=function(t,r){if(null==r&&(r=!1),isNaN(t)||null===t)return n;u=b(u=r?t:l&&l.length>2?x(t)/(l.length-2):f!==c?(t-c)/(f-c):1),r||(u=w(u)),1!==g&&(u=iY(u,g));var s,u,d=Math.floor(1e4*(u=Math.min(1,Math.max(0,u=a[0]+u*(1-a[0]-a[1])))));if(m&&p[d])s=p[d];else{if("array"===iB(h))for(var y=0;y=_&&y===o.length-1){s=h[y];break}if(u>_&&u2){var u=t.map(function(i,n){return n/(t.length-1)}),d=t.map(function(t){return(t-c)/(f-c)});d.every(function(t,i){return u[i]===t})||(b=function(t){if(t<=0||t>=1)return t;for(var i=0;t>=d[i+1];)i++;var n=(t-d[i])/(d[i+1]-d[i]);return u[i]+n*(u[i+1]-u[i])})}}return s=[c,f],k},k.mode=function(t){return arguments.length?(i=t,S(),k):i},k.range=function(t,i){return y(t),k},k.out=function(t){return u=t,k},k.spread=function(t){return arguments.length?(r=t,k):r},k.correctLightness=function(t){return null==t&&(t=!0),d=t,S(),w=d?function(t){for(var i=_(0,!0).lab()[0],n=_(1,!0).lab()[0],r=i>n,s=_(t,!0).lab()[0],o=i+(n-i)*t,a=s-o,l=0,h=1,u=20;Math.abs(a)>.01&&u-- >0;)r&&(a*=-1),a<0?(l=t,t+=.5*(h-t)):(h=t,t+=.5*(l-t)),a=(s=_(t,!0).lab()[0])-o;return t}:function(t){return t},k},k.padding=function(t){return null!=t?("number"===iB(t)&&(t=[t,t]),a=t,k):a},k.colors=function(i,n){arguments.length<2&&(n="hex");var r=[];if(0==arguments.length)r=h.slice(0);else if(1===i)r=[k(.5)];else if(i>1){var o=s[0],a=s[1]-o;r=(function(t,i,n){for(var r=[],s=to;s?a++:a--)r.push(a);return r})(0,i,!1).map(function(t){return k(o+t/(i-1)*a)})}else{t=[];var u=[];if(l&&l.length>2)for(var c=1,f=l.length,d=1<=f;d?cf;d?c++:c--)u.push(.5*(l[c-1]+l[c]));else u=s;r=u.map(function(t){return k(t)})}return v[n]&&(r=r.map(function(t){return t[n]()})),r},k.cache=function(t){return null!=t?(m=t,k):m},k.gamma=function(t){return null!=t?(g=t,k):g},k.nodata=function(t){return null!=t?(n=v(t),k):n},k},iW=function(t){for(var i=[1,1],n=1;n=5))throw RangeError("No point in running bezier with only one color.");u=t.map(function(t){return t.lab()}),c=iW(f=t.length-1),s=function(t){var i=1-t,n=[0,1,2].map(function(n){return u.reduce(function(r,s,o){return r+c[o]*Math.pow(i,f-o)*Math.pow(t,o)*s[n]},0)});return new m(n,"lab")}}return s},iX=function(t,i,n){if(!iX[n])throw Error("unknown blend mode "+n);return iX[n](t,i)},iU=function(t){return function(i,n){var r=v(n).rgb(),s=v(i).rgb();return v.rgb(t(r,s))}},iG=function(t){return function(i,n){var r=[];return r[0]=t(i[0],n[0]),r[1]=t(i[1],n[1]),r[2]=t(i[2],n[2]),r}};iX.normal=iU(iG(function(t){return t})),iX.multiply=iU(iG(function(t,i){return t*i/255})),iX.screen=iU(iG(function(t,i){return 255*(1-(1-t/255)*(1-i/255))})),iX.overlay=iU(iG(function(t,i){return i<128?2*t*i/255:255*(1-2*(1-t/255)*(1-i/255))})),iX.darken=iU(iG(function(t,i){return t>i?i:t})),iX.lighten=iU(iG(function(t,i){return t>i?t:i})),iX.dodge=iU(iG(function(t,i){return 255===t||(t=i/255*255/(1-t/255))>255?255:t})),iX.burn=iU(iG(function(t,i){return 255*(1-(1-i/255)/(t/255))}));for(var i$=l.type,iq=l.clip_rgb,iK=l.TWOPI,iJ=Math.pow,iQ=Math.sin,i0=Math.cos,i1=Math.floor,i2=Math.random,i5=Math.log,i3=Math.pow,i6=Math.floor,i4=Math.abs,i7=function(t,i){void 0===i&&(i=null);var n={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===o(t)&&(t=Object.values(t)),t.forEach(function(t){i&&"object"===o(t)&&(t=t[i]),null==t||isNaN(t)||(n.values.push(t),n.sum+=t,tn.max&&(n.max=t),n.count+=1)}),n.domain=[n.min,n.max],n.limits=function(t,i){return i9(n,t,i)},n},i9=function(t,i,n){void 0===i&&(i="equal"),void 0===n&&(n=7),"array"==o(t)&&(t=i7(t));var r=t.min,s=t.max,a=t.values.sort(function(t,i){return t-i});if(1===n)return[r,s];var l=[];if("c"===i.substr(0,1)&&(l.push(r),l.push(s)),"e"===i.substr(0,1)){l.push(r);for(var h=1;h 0");var u=Math.LOG10E*i5(r),c=Math.LOG10E*i5(s);l.push(r);for(var f=1;f200&&(b=!1)}for(var R={},F=0;F=360;)v-=360;a[p]=v}else a[p]=a[p]/l[p];return d/=r,new m(a,i).alpha(d>.99999?1:d,!0)},np.bezier=function(t){var i=iH(t);return i.scale=function(){return iZ(i)},i},np.blend=iX,np.cubehelix=function(t,i,n,r,s){void 0===t&&(t=300),void 0===i&&(i=-1.5),void 0===n&&(n=1),void 0===r&&(r=1),void 0===s&&(s=[0,1]);var o,a=0;"array"===i$(s)?o=s[1]-s[0]:(o=0,s=[s,s]);var l=function(l){var h=iK*((t+120)/360+i*l),u=iJ(s[0]+o*l,r),c=(0!==a?n[0]+l*a:n)*u*(1-u)/2,f=i0(h),d=iQ(h);return v(iq([255*(u+c*(-.14861*f+1.78277*d)),255*(u+c*(-.29227*f-.90649*d)),255*(u+c*(1.97294*f)),1]))};return l.start=function(i){return null==i?t:(t=i,l)},l.rotations=function(t){return null==t?i:(i=t,l)},l.gamma=function(t){return null==t?r:(r=t,l)},l.hue=function(t){return null==t?n:("array"===i$(n=t)?0==(a=n[1]-n[0])&&(n=n[1]):a=0,l)},l.lightness=function(t){return null==t?s:("array"===i$(t)?(s=t,o=t[1]-t[0]):(s=[t,t],o=0),l)},l.scale=function(){return v.scale(l)},l.hue(n),l},np.mix=np.interpolate=iS,np.random=function(){for(var t="#",i=0;i<6;i++)t+="0123456789abcdef".charAt(i1(16*i2()));return new m(t,"hex")},np.scale=iZ,np.analyze=i8.analyze,np.contrast=function(t,i){t=new m(t),i=new m(i);var n=t.luminance(),r=i.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},np.deltaE=function(t,i,n,r,s){void 0===n&&(n=1),void 0===r&&(r=1),void 0===s&&(s=1);var o=function(t){return 360*t/(2*nh)},a=function(t){return 2*nh*t/360};t=new m(t),i=new m(i);var l=Array.from(t.lab()),h=l[0],u=l[1],c=l[2],f=Array.from(i.lab()),d=f[0],p=f[1],v=f[2],g=(h+d)/2,y=(nt(ne(u,2)+ne(c,2))+nt(ne(p,2)+ne(v,2)))/2,x=.5*(1-nt(ne(y,7)/(ne(y,7)+ne(25,7)))),w=u*(1+x),b=p*(1+x),_=nt(ne(w,2)+ne(c,2)),S=nt(ne(b,2)+ne(v,2)),k=(_+S)/2,T=o(nr(c,w)),P=o(nr(v,b)),M=T>=0?T:T+360,z=P>=0?P:P+360,E=ns(M-z)>180?(M+z+360)/2:(M+z)/2,A=1-.17*no(a(E-30))+.24*no(a(2*E))+.32*no(a(3*E+6))-.2*no(a(4*E-63)),C=z-M;C=180>=ns(C)?C:z<=M?C+360:C-360,C=2*nt(_*S)*na(a(C)/2);var I=S-_,D=1+.015*ne(g-50,2)/nt(20+ne(g-50,2)),L=1+.045*k,O=1+.015*k*A,N=30*nl(-ne((E-275)/25,2)),R=-2*nt(ne(k,7)/(ne(k,7)+ne(25,7)))*na(2*a(N));return nn(0,ni(100,nt(ne((d-h)/(n*D),2)+ne(I/(r*L),2)+ne(C/(s*O),2)+R*(I/(r*L))*(C/(s*O)))))},np.distance=function(t,i,n){void 0===n&&(n="lab"),t=new m(t),i=new m(i);var r=t.get(n),s=i.get(n),o=0;for(var a in r){var l=(r[a]||0)-(s[a]||0);o+=l*l}return Math.sqrt(o)},np.limits=i8.limits,np.valid=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];try{return new(Function.prototype.bind.apply(m,[null].concat(t))),!0}catch(t){return!1}},np.scales={cool:function(){return iZ([v.hsl(180,1,.9),v.hsl(250,.7,.4)])},hot:function(){return iZ(["#000","#f00","#ff0","#fff"]).mode("rgb")}},np.colors=eP,np.brewer=nu,np}();var nj=tX(nF.exports);function nV(t,i=[]){return i[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,i}function nB(t){let i=t.toString(16);return`#${i="000000".substr(0,6-i.length)+i}`}function nY(t){try{let i=nj(t).hex("rgb");return"#"===i[0]&&(i=i.substr(1)),parseInt(i,16)}catch(t){return 16777215}}function nZ(t){return 0===t?0:t<0?-1:1}class nW{constructor(t){this.resolution=void 0,this.view=void 0,this.screen=void 0,this.plugins={},this._backgroundColor=0,this._backgroundColorString="#000000",this._backgroundColorRgba=[0,0,0,1],this._lastObjectRendered=void 0,this.resolution=t?.resolution||1,this.screen=new nI(0,0,t?.width??800,t?.height??600),this.view=t?.view||document.createElement("canvas"),this.backgroundColor=t?.backgroundColor||this._backgroundColor,this.backgroundAlpha=t?.backgroundAlpha||1,this._lastObjectRendered=null}resize(t,i){this.screen.width=t,this.screen.height=i,this.view.width=t*this.resolution,this.view.height=i*this.resolution,this.view.style.width=`${t}px`,this.view.style.height=`${i}px`}destroy(){this.plugins.interaction.destroy(),this.plugins.interaction=null,this.plugins=null,this.view=null,this.screen=null,this._tempDisplayObjectParent=null,this.options=null,this._lastObjectRendered=null}get width(){return this.view.width}get height(){return this.view.height}get backgroundColor(){return this._backgroundColor}set backgroundColor(t){this._backgroundColor=t,this._backgroundColorString=nB(t),nV(t,this._backgroundColorRgba)}get backgroundAlpha(){return this._backgroundColorRgba[3]}set backgroundAlpha(t){this._backgroundColorRgba[3]=t}}class nH{}class nX extends nH{}var nU={exports:{}};!function(t){var i=Object.prototype.hasOwnProperty,n="~";function r(){}function s(t,i,n){this.fn=t,this.context=i,this.once=n||!1}function o(t,i,r,o,a){if("function"!=typeof r)throw TypeError("The listener must be a function");var l=new s(r,o||t,a),h=n?n+i:i;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],l]:t._events[h].push(l):(t._events[h]=l,t._eventsCount++),t}function a(t,i){0==--t._eventsCount?t._events=new r:delete t._events[i]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1)),l.prototype.eventNames=function(){var t,r,s=[];if(0===this._eventsCount)return s;for(r in t=this._events)i.call(t,r)&&s.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},l.prototype.listeners=function(t){var i=n?n+t:t,r=this._events[i];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,o=r.length,a=Array(o);sthis.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?nI.EMPTY:((t=t||new nI(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,i){let{a:n,b:r,c:s,d:o,tx:a,ty:l}=t,h=n*i.x+s*i.y+a,u=r*i.x+o*i.y+l;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,u),this.maxY=Math.max(this.maxY,u)}addQuad(t){let i=this.minX,n=this.minY,r=this.maxX,s=this.maxY,o=t[0],a=t[1];i=or?o:r,s=a>s?a:s,o=t[2],a=t[3],i=or?o:r,s=a>s?a:s,o=t[4],a=t[5],i=or?o:r,s=a>s?a:s,o=t[6],a=t[7],i=or?o:r,s=a>s?a:s,this.minX=i,this.minY=n,this.maxX=r,this.maxY=s}addFrame(t,i,n,r,s){this.addFrameMatrix(t.worldTransform,i,n,r,s)}addFrameMatrix(t,i,n,r,s){let o=t.a,a=t.b,l=t.c,h=t.d,u=t.tx,c=t.ty,f=this.minX,d=this.minY,p=this.maxX,m=this.maxY,v=o*i+l*n+u,g=a*i+h*n+c;f=vp?v:p,m=g>m?g:m,v=o*r+l*n+u,g=a*r+h*n+c,f=vp?v:p,m=g>m?g:m,v=o*i+l*s+u,g=a*i+h*s+c,f=vp?v:p,m=g>m?g:m,v=o*r+l*s+u,g=a*r+h*s+c,f=vp?v:p,m=g>m?g:m,this.minX=f,this.minY=d,this.maxX=p,this.maxY=m}addVertexData(t,i,n){let r=this.minX,s=this.minY,o=this.maxX,a=this.maxY;for(let l=i;lo?i:o,a=n>a?n:a}this.minX=r,this.minY=s,this.maxX=o,this.maxY=a}addVertices(t,i,n,r){this.addVerticesMatrix(t.worldTransform,i,n,r)}addVerticesMatrix(t,i,n,r,s=0,o=s){let a=t.a,l=t.b,h=t.c,u=t.d,c=t.tx,f=t.ty,d=this.minX,p=this.minY,m=this.maxX,v=this.maxY;for(let t=n;tr?t.maxX:r,this.maxY=t.maxY>s?t.maxY:s}addBoundsMask(t,i){let n=t.minX>i.minX?t.minX:i.minX,r=t.minY>i.minY?t.minY:i.minY,s=t.maxXa?s:a,this.maxY=o>l?o:l}}addBoundsMatrix(t,i){this.addFrameMatrix(i,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,i){let n=t.minX>i.x?t.minX:i.x,r=t.minY>i.y?t.minY:i.y,s=t.maxXa?s:a,this.maxY=o>l?o:l}}pad(t=0,i=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=i,this.maxY+=i)}addFramePad(t,i,n,r,s,o){t-=s,i-=o,n+=s,r+=o,this.minX=this.minXn?this.maxX:n,this.minY=this.minYr?this.maxY:r}}class nq extends nG{constructor(){super(),this.cursor=null,this.hitArea=void 0,this.interactive=void 0,this.interactiveChildren=void 0,this.parent=void 0,this.transform=void 0,this.visible=void 0,this._trackedPointers=void 0,this.isMask=!1,this._mask=null,this._bounds=new n$,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this.tempDisplayObjectParent=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!0,this.parent=null,this.transform=new class{constructor(){this.localTransform=void 0,this.pivot=void 0,this.position=void 0,this.scale=void 0,this.skew=void 0,this.worldTransform=void 0,this._rotation=void 0,this._cx=void 0,this._sx=void 0,this._cy=void 0,this._sy=void 0,this.localTransform=new nR,this.pivot=new nN(0,0),this.position=new nN(0,0),this.scale=new nN(1,1),this.skew=new nN(0,0),this.worldTransform=new nR,this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1}updateLocalTransform(){let t=this.localTransform;t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d)}updateTransform(t){let i=this.localTransform;i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d);let n=t.worldTransform,r=this.worldTransform;r.a=i.a*n.a+i.b*n.c,r.b=i.a*n.b+i.b*n.d,r.c=i.c*n.a+i.d*n.c,r.d=i.c*n.b+i.d*n.d,r.tx=i.tx*n.a+i.ty*n.c+n.tx,r.ty=i.tx*n.b+i.ty*n.d+n.ty}setFromMatrix(t){t.decompose(this)}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}},this.visible=!0}setParent(t){return t.addChild(this),t}updateTransform(){this.parent&&this.transform.updateTransform(this.parent.transform)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new nI),t=this._localBoundsRect),this._localBounds||(this._localBounds=new n$);let i=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;let r=this._bounds,s=this._boundsID;this._bounds=this._localBounds;let o=this.getBounds(!1,t);return this.parent=n,this.transform=i,this._bounds=r,this._bounds.updateID+=this._boundsID-s,o}getBounds(t,i){return t||(this.parent?this.updateTransform():(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),i||(this._boundsRect||(this._boundsRect=new nI),i=this._boundsRect),this._bounds.getRectangle(i)}destroy(){this.parent&&this.parent.removeChild(this),this.removeAllListeners(),this.parent=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1}get _tempDisplayObjectParent(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new nK),this.tempDisplayObjectParent}enableTempParent(){let t=this.parent;return this.parent=this._tempDisplayObjectParent,t}disableTempParent(t){this.parent=t}get x(){return this.position.x}set x(t){this.transform.position.x=t}get y(){return this.position.y}set y(t){this.transform.position.y=t}get position(){return this.transform.position}set position(t){this.transform.position.copyFrom(t)}get rotation(){return this.transform.rotation}set rotation(t){this.transform.rotation=t}get scale(){return this.transform.scale}set scale(t){this.transform.scale.copyFrom(t)}get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers}get worldTransform(){return this.transform.worldTransform}get mask(){return this._mask}set mask(t){this._mask!==t&&(this._mask=t,this._mask.isMask=!0)}}class nK extends nq{calculateBounds(){return null}removeChild(t){return null}render(t){return null}}class nJ extends nq{constructor(){super(),this.children=[],this.parent=null}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let t=0;t1)for(let i=0;i1)for(let i=0;i=s||0===n)return;let o=s-(n=i+n>s?s-i:n);for(r=i;r0&&r<=i){n=this.children.splice(t,r);for(let t=0;t0&&(this.graphicsData.length=0),this}drawShape(t,i=null,n=null,r=null){let s=new nQ(t,i,n,r);return this.graphicsData.push(s),this}containsPoint(t){let i=this.graphicsData;for(let n=0;n0;return i&&t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:i},t),this}lineStyle(t=null){return this.lineTextureStyle(t??{})}lineTextureStyle(t){t=Object.assign({alpha:1,width:0,color:0,lineDash:[]},t);let i=(t?.width??!1)&&(t?.alpha??!1);return Object.assign(this._lineStyle,{visible:i},t),this}drawArea(t,i=nl){return this.drawShape(new class t{constructor(t=[],i=nl,n=0){this.data=[],this.curve=void 0,this.y0=0,this.type=void 0,this.data=t,this.curve=i,this.y0=n,this.type=nC.AREA}clone(){return new t(this.data,this.curve,this.y0)}copyFrom(t){return this.data=t.data,this.curve=t.curve,this.y0=t.y0,this}copyTo(t){return t.data=this.data,t.curve=this.curve,t.y0=this.y0,t}contains(t,i){return!1}}(t,i))}drawCircle(t,i,n){return this.drawShape(new nD(t,i,n))}drawLine(t,i=nl){return this.drawShape(new nL(t,i))}drawRect(t,i,n,r){return this.drawShape(new nI(t,i,n,r))}moveTo(t,i){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=i,this}lineTo(t,i){return this.currentPath||this.moveTo(0,0),this.currentPath.points.push(t,i),this}closePath(){let t=this.currentPath;return t&&(t.closeStroke=!0),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this}containsPoint(t){return this.worldTransform.applyInverse(t,n3._TEMP_POINT),this._geometry.containsPoint(n3._TEMP_POINT)}_render(t){!0!==this.isMask&&t.plugins.graphics.render(this)}startPoly(){if(this.currentPath){let t=this.currentPath.points,i=this.currentPath.points.length;i>2&&(this.drawShape(this.currentPath),this.currentPath=new nO,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[i-2],t[i-1]))}else this.currentPath=new nO,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}get geometry(){return this._geometry}get tint(){return this._tint}set tint(t){this._tint=t}}n3._TEMP_POINT=new nN;let n6=null;class n4{constructor(t){this.renderer=void 0,this._tempMatrix=void 0,this.renderer=t,this._tempMatrix=new nR}render(t){let i,n;let r=this.renderer,s=r.context,o=t.transform.worldTransform;r.setContextTransform(o,!0,1);let a=t.geometry.graphicsData,l=(t.tint>>16&255)/255,h=(t.tint>>8&255)/255,u=(255&t.tint)/255;for(let t=0;t>16&255)/255*l*255<<16)+((m>>8&255)/255*h*255<<8)+(255&m)/255*u*255;i=this._calcCanvasStyle(d,g);let y=((v>>16&255)/255*l*255<<16)+((v>>8&255)/255*h*255<<8)+(255&v)/255*u*255;if(n=this._calcCanvasStyle(p,y),s.lineWidth=p?.width??0,c.type===nC.POLY){s.beginPath();let t=f.points;s.moveTo(t[0],t[1]);for(let i=2;it[1]).y1(t=>t[2]).context(s)(f.data),d.visible&&(s.globalAlpha=d.alpha,s.fillStyle=i,s.fill());else if(c.type===nC.RECT){if(d.visible&&(s.globalAlpha=d.alpha,s.fillStyle=i,s.fillRect(f.x,f.y,f.width,f.height)),p.visible){let t=-.5*(p?.width??0),i=f.width+2*t,r=f.height+2*t;s.strokeStyle=n,s.strokeRect(f.x-t,f.y-t,i,r)}}else c.type===nC.CIRCLE&&(s.beginPath(),s.arc(f.x,f.y,f.radius,0,2*Math.PI),s.closePath(),d.visible&&(s.globalAlpha=d.alpha,s.fillStyle=i,s.fill()),p.visible&&(s.globalAlpha=p.alpha,s.strokeStyle=n,s.stroke()))}}paintPolygonStroke(t,i,n,r){r.globalAlpha=i.alpha,r.strokeStyle=n,r.setLineDash(i.lineDash),r.stroke()}_calcCanvasStyle(t,i){return t.texture&&t.texture.baseTexture!==rf.WHITE.baseTexture?function(t,i){let n;if(`00000${(0|(i=function(t){let i=nV(t);return i[0]=Math.min(255,i[0]/8*8),i[1]=Math.min(255,i[1]/8*8),i[2]=Math.min(255,i[2]/8*8),(255*i[0]<<16)+(255*i[1]<<8)+(255*i[2]|0)}(i))).toString(16)}`.substr(-6),n6||(n6=document.createElement("canvas")),n6){!function(t,i,n){let r=n.getContext("2d"),s=t._frame.clone(),o=t.baseTexture.resolution;if(s.x*=o,s.y*=o,s.width*=o,s.height*=o,n.width=Math.ceil(s.width),n.height=Math.ceil(s.height),r){r.save(),r.fillStyle=`#${`00000${(0|i).toString(16)}`.substr(-6)}`,r.fillRect(0,0,s.width,s.height),r.globalCompositeOperation="multiply";let n=t.baseTexture.getDrawableSource();r.drawImage(n,s.x,s.y,s.width,s.height,0,0,s.width,s.height),r.globalCompositeOperation="destination-atop",r.drawImage(n,s.x,s.y,s.width,s.height,0,0,s.width,s.height),r.restore()}}(t,i,n6);let r=n6.getContext("2d");r&&(n=r.createPattern(n6,"repeat"))}return n}(t.texture,i):`#${`00000${(0|i).toString(16)}`.substr(-6)}`}}class n7{constructor(){this.button=0,this.global=void 0,this.identifier=void 0,this.target=void 0,this.originalEvent=null,this.pointerType=null,this.global=new nN,this.identifier=null,this.target=null}copyEvent(t){"pointerType"in t&&(this.pointerType=t.pointerType)}reset(){}}class n9{constructor(){this.stopped=void 0,this.stopsPropagatingAt=void 0,this.stopPropagationHint=void 0,this.target=void 0,this.currentTarget=void 0,this.type=void 0,this.data=void 0,this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}stopPropagation(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget}reset(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null}}class n8{constructor(t){this._pointerId=void 0,this._flags=void 0,this._pointerId=t,this._flags=n8.FLAGS.NONE}_doSet(t,i){this._flags=i?this._flags|t:this._flags&~t}get pointerId(){return this._pointerId}get flags(){return this._flags}set flags(t){this._flags=t}get none(){return this._flags===n8.FLAGS.NONE}get over(){return 0!=(this._flags&n8.FLAGS.OVER)}set over(t){this._doSet(n8.FLAGS.OVER,t)}get rightDown(){return 0!=(this._flags&n8.FLAGS.RIGHT_DOWN)}set rightDown(t){this._doSet(n8.FLAGS.RIGHT_DOWN,t)}get leftDown(){return 0!=(this._flags&n8.FLAGS.LEFT_DOWN)}set leftDown(t){this._doSet(n8.FLAGS.LEFT_DOWN,t)}}n8.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4});class rt{constructor(){this._tempPoint=void 0,this._tempPoint=new nN}recursiveFindHit(t,i,n,r,s){if(!i||!i.visible||!t.data)return!1;let o=t.data.global,a=!1,l=s=i.interactive||s,h=!0;if(i.hitArea&&(r&&(i.worldTransform.applyInverse(o,this._tempPoint),i.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:(r=!1,h=!1)),l=!1),h&&i.interactiveChildren&&i.children){let s=i.children;for(let i=s.length-1;i>=0;i--){let o=s[i],h=this.recursiveFindHit(t,o,n,r,l);if(h){if(!o.parent)continue;l=!1,h&&(t.target&&(r=!1),a=!0)}}}return s&&(r&&!t.target&&!i.hitArea&&i.containsPoint&&i.containsPoint(o)&&(a=!0),i.interactive&&(a&&!t.target&&(t.target=i),n&&n(t,i,!!a))),a}findHit(t,i,n,r){return this.recursiveFindHit(t,i,n,r,!1)}}class re extends nG{constructor(t,i){super(),this.activeInteractionData=void 0,this.supportsTouchEvents=void 0,this.supportsPointerEvents=void 0,this.cursor=null,this.delayedEvents=[],this.interactionDataPool=void 0,this.interactionFrequency=void 0,this.moveWhenInside=!1,this.renderer=void 0,this.resolution=void 0,this.search=new rt,this.cursorStyles={default:"inherit",grab:"grab",pointer:"pointer"},this.currentCursorMode=null,this.eventData=void 0,this.mouse=void 0,this.interactionDOMElement=void 0,this.mouseOverRenderer=void 0,this._tempDisplayObject=new nK,this._eventListenerOptions={capture:!0,passive:!1},this.onPointerMove=t=>{let i=this.normalizeToPointerData(t);for(let n of("mouse"!==i[0].pointerType&&"pen"!==i[0].pointerType||(this.cursor=null),i)){let i=this.getInteractionDataForPointerId(n),r=this.configureInteractionEventForDOMEvent(this.eventData,n,i);r.data.originalEvent=t,this.processInteractive(r,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",r)}"mouse"===i[0].pointerType&&this.setCursorMode(this.cursor)},this.processPointerMove=(t,i,n)=>{let r=t.data,s="touch"===r?.pointerType,o="mouse"===r?.pointerType||"pen"===r?.pointerType;o&&this.processPointerOverOut(t,i,n),n&&(this.dispatchEvent(i,"pointermove",t),s&&this.dispatchEvent(i,"touchmove",t),o&&this.dispatchEvent(i,"mousemove",t))},this.processPointerOverOut=(t,i,n)=>{let r=t.data,s=t?.data?.identifier??-1,o="mouse"===r?.pointerType||"pen"===r?.pointerType,a=i.trackedPointers[s];n&&!a&&(a=i.trackedPointers[s]=new n8(s)),void 0!==a&&(n&&this.mouseOverRenderer?(a.over||(a.over=!0,this.delayDispatchEvent(i,"pointerover",t),o&&this.delayDispatchEvent(i,"mouseover",t)),o&&null===this.cursor&&(this.cursor=i.cursor)):a.over&&(a.over=!1,this.dispatchEvent(i,"pointerout",this.eventData),o&&this.dispatchEvent(i,"mouseout",t),a.none&&delete i.trackedPointers[s]))},this.onPointerDown=t=>{let i=this.normalizeToPointerData(t);for(let n of i){let i=this.getInteractionDataForPointerId(n),r=this.configureInteractionEventForDOMEvent(this.eventData,n,i);if(r.data.originalEvent=t,this.processInteractive(r,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",r),"touch"===n.pointerType)this.emit("touchstart",r);else if("mouse"===n.pointerType||"pen"===n.pointerType){let t=2===n.button;this.emit(t?"rightdown":"mousedown",this.eventData)}}},this.processPointerDown=(t,i,n)=>{let r=t.data,s=t?.data?.identifier??-1;if(n){if(i.trackedPointers[s]||(i.trackedPointers[s]=new n8(s)),this.dispatchEvent(i,"pointerdown",t),"touch"===r?.pointerType)this.dispatchEvent(i,"touchstart",t);else if("mouse"===r?.pointerType||"pen"===r?.pointerType){let n=2===r.button;n?i.trackedPointers[s].rightDown=!0:i.trackedPointers[s].leftDown=!0,this.dispatchEvent(i,n?"rightdown":"mousedown",t)}}},this.onPointerOut=t=>{let i=this.normalizeToPointerData(t)[0];"mouse"===i.pointerType&&(this.mouseOverRenderer=!1,this.setCursorMode(null));let n=this.getInteractionDataForPointerId(i),r=this.configureInteractionEventForDOMEvent(this.eventData,i,n);r.data.originalEvent=i,this.processInteractive(r,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",r),"mouse"===i.pointerType||"pen"===i.pointerType?this.emit("mouseout",r):this.releaseInteractionDataForPointerId(n.identifier)},this.onPointerOver=t=>{let i=this.normalizeToPointerData(t)[0],n=this.getInteractionDataForPointerId(i),r=this.configureInteractionEventForDOMEvent(this.eventData,i,n);r.data.originalEvent=i,"mouse"===i.pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",r),"mouse"!==i.pointerType&&"pen"!==i.pointerType||this.emit("mouseover",r)},this.onPointerUp=t=>{this.onPointerComplete(t,!1,this.processPointerUp)},this.processPointerUp=(t,i,n)=>{let r=t.data,s=t?.data?.identifier??-1,o=i.trackedPointers[s],a="touch"===r?.pointerType,l="mouse"===r?.pointerType||"pen"===r?.pointerType,h=!1;if(l){let s=2===r?.button,a=n8.FLAGS,l=s?a.RIGHT_DOWN:a.LEFT_DOWN,u=void 0!==o&&o.flags&l;n?(this.dispatchEvent(i,s?"rightup":"mouseup",t),u&&(this.dispatchEvent(i,s?"rightclick":"click",t),h=!0)):u&&this.dispatchEvent(i,s?"rightupoutside":"mouseupoutside",t),o&&(s?o.rightDown=!1:o.leftDown=!1)}n?(this.dispatchEvent(i,"pointerup",t),a&&this.dispatchEvent(i,"touchend",t),o&&(l&&!h||this.dispatchEvent(i,"pointertap",t),a&&(this.dispatchEvent(i,"tap",t),o.over=!1))):o&&(this.dispatchEvent(i,"pointerupoutside",t),a&&this.dispatchEvent(i,"touchendoutside",t)),o&&o.none&&delete i.trackedPointers[s]},this.onPointerComplete=(t,i,n)=>{let r=this.normalizeToPointerData(t),s=r.length,o=t.target!==this.interactionDOMElement?"outside":"";for(let a=0;a{let i=this.normalizeToPointerData(t)[0],n=this.getInteractionDataForPointerId(i),r=this.configureInteractionEventForDOMEvent(this.eventData,i,n);r.data.originalEvent=t,this.processInteractive(r,this.lastObjectRendered,this.processDblClick,!0)},this.processDblClick=(t,i,n)=>{n&&(t.data?.originalEvent?.preventDefault(),this.dispatchEvent(i,"dblclick",t))},this.onWheel=t=>{let i=this.normalizeToPointerData(t);for(let n of("mouse"!==i[0].pointerType&&"pen"!==i[0].pointerType||(this.cursor=null),i)){let i=this.getInteractionDataForPointerId(n),r=this.configureInteractionEventForDOMEvent(this.eventData,n,i);r.data.originalEvent=t,this.processInteractive(r,this.lastObjectRendered,this.processWheel,!0),this.emit("pointermove",r)}},this.processWheel=(t,i,n)=>{n&&(t.data?.originalEvent?.preventDefault(),this.dispatchEvent(i,"wheel",t))},this.interactionFrequency=i?.interactionFrequency??10,this.mouse=new n7,this.mouse.identifier=1,this.mouse.global.set(-999999),this.activeInteractionData={},this.activeInteractionData[1]=this.mouse,this.renderer=t,this.resolution=1,this.mouseOverRenderer=!("PointerEvent"in self),this.supportsTouchEvents="ontouchstart"in self,this.supportsPointerEvents=!!self.PointerEvent,this.interactionDataPool=[],this.eventData=new n9,this.interactionDOMElement=null,this.setTargetElement(this.renderer.view,this.renderer.resolution)}setTargetElement(t,i=1){this.removeEvents(),this.interactionDOMElement=t,this.resolution=i,this.addEvents()}processInteractive(t,i,n,r){let s=this.search.findHit(t,i,n,r),o=this.delayedEvents;if(!o.length)return s;t.stopPropagationHint=!1;let a=o.length;this.delayedEvents=[];for(let t=0;t0){let t=i.canvasContext?.activeContext;t?.beginPath();for(let t=0;tthis.baseTexture.width,a=n+s>this.baseTexture.height;if(o||a){let t=`X: ${i} + ${r} = ${i+r} > ${this.baseTexture.width}`,l=`Y: ${n} + ${s} = ${n+s} > ${this.baseTexture.height}`;throw Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${t} ${o&&a?"and":"or"} ${l}`)}this.orig=t}get resolution(){return this.baseTexture.resolution}static from(t,i={}){return new rf(new rc(t,i))}}rf.EMPTY=new rf(new rc),rf.WHITE=new rf(new rc);class rd extends nJ{constructor(t){super(),this._height=void 0,this._texture=rf.EMPTY,this._width=void 0,this._anchor=void 0,this._roundPixels=void 0,this._anchor=new nN(t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),this._height=0,this._width=0,this.texture=t??rf.EMPTY,this._roundPixels=!0}_render(t){t.plugins.sprite.render(this)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){let i=nZ(this.scale.x)||1;this.scale.x=i*t/this._texture.orig.width,this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){let i=nZ(this.scale.y)||1;this.scale.y=i*t/this._texture.orig.height,this._height=t}get anchor(){return this._anchor}set anchor(t){this._anchor.copyFrom(t)}set roundPixels(t){this._roundPixels=t}get roundPixels(){return this._roundPixels}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t??rf.EMPTY)}}let rp=((rz={})[rz.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",rz[rz.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",rz);class rm{constructor(t,i,n,r,s,o,a,l,h){this.text=void 0,this.style=void 0,this.width=void 0,this.height=void 0,this.lines=void 0,this.lineWidths=void 0,this.lineHeight=void 0,this.maxLineWidth=void 0,this.fontProperties=void 0,this.text=t,this.style=i,this.width=n,this.height=r,this.lines=s,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=l,this.fontProperties=h}static measureText(t,i,n,r=rm._canvas){n=null==n?i.wordWrap:n;let s=i.toFontString(),o=rm.measureFont(s);0===o.fontSize&&(o.fontSize=i.fontSize,o.ascent=i.fontSize);let a=r.getContext("2d");a.font=s;let l=(n?rm.wordWrap(t,i,r):t).split(/(?:\r\n|\r|\n)/),h=Array(l.length),u=0;for(let t=0;tp){if(""!==o&&(a+=rm.addLine(o),o="",s=0),rm.canBreakWords(n,i.breakWords)){let t=rm.wordWrapSplit(n);for(let u=0;up&&(a+=rm.addLine(o),d=!1,o="",s=0),o+=c,s+=f}}else{o.length>0&&(a+=rm.addLine(o),o="",s=0);let i=t===m.length-1;a+=rm.addLine(n,!i),d=!1,o="",s=0}}else u+s>p&&(d=!1,a+=rm.addLine(o),o="",s=0),(o.length>0||!rm.isBreakingSpace(n)||d)&&(o+=n,s+=u)}return a+rm.addLine(o,!1)}static addLine(t,i=!0){return t=rm.trimRight(t),t=i?`${t} +`:t}static getFromCache(t,i,n,r){let s=n[t];if("number"!=typeof s){let o=t.length*i;s=r.measureText(t).width+o,n[t]=s}return s}static collapseSpaces(t){return"normal"===t||"pre-line"===t}static collapseNewlines(t){return"normal"===t}static trimRight(t){if("string"!=typeof t)return"";for(let i=t.length-1;i>=0;i--){let n=t[i];if(!rm.isBreakingSpace(n))break;t=t.slice(0,-1)}return t}static isNewline(t){return"string"==typeof t&&rm._newlines.indexOf(t.charCodeAt(0))>=0}static isBreakingSpace(t,i){return"string"==typeof t&&rm._breakingSpaces.indexOf(t.charCodeAt(0))>=0}static tokenize(t){let i=[],n="";if("string"!=typeof t)return i;for(let r=0;ra;--f){for(let t=0;t{try{let t=new OffscreenCanvas(0,0),i=t.getContext("2d");return i&&i.measureText?t:document.createElement("canvas")}catch(t){return document.createElement("canvas")}})()).width=rv.height=10,rm._canvas=rv,rm._context=rv.getContext("2d")),rm._fonts={},rm.METRICS_STRING="|\xc9q\xc5",rm.BASELINE_SYMBOL="M",rm.BASELINE_MULTIPLIER=1.4,rm.HEIGHT_MULTIPLIER=2,rm._newlines=[10,13],rm._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let rg={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:rp.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},ry=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];class rx{constructor(t){this.styleID=void 0,this._align=void 0,this._breakWords=void 0,this._dropShadow=void 0,this._dropShadowAlpha=void 0,this._dropShadowAngle=void 0,this._dropShadowBlur=void 0,this._dropShadowColor=void 0,this._dropShadowDistance=void 0,this._fill=void 0,this._fillGradientType=void 0,this._fillGradientStops=void 0,this._fontFamily=void 0,this._fontSize=void 0,this._fontStyle=void 0,this._fontVariant=void 0,this._fontWeight=void 0,this._letterSpacing=void 0,this._lineHeight=void 0,this._lineJoin=void 0,this._miterLimit=void 0,this._padding=void 0,this._stroke=void 0,this._strokeThickness=void 0,this._textBaseline=void 0,this._trim=void 0,this._whiteSpace=void 0,this._wordWrap=void 0,this._wordWrapWidth=void 0,this._leading=void 0,this.styleID=0,this.reset(),r_(this,t,t)}clone(){let t={};return r_(t,this,rg),new rx(t)}reset(){r_(this,rg,rg)}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(t){let i=rb(t);this._dropShadowColor!==i&&(this._dropShadowColor=i,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}get fill(){return this._fill}set fill(t){let i=rb(t);this._fill!==i&&(this._fill=i,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(t){(function(t,i){if(!Array.isArray(t)||!Array.isArray(i)||t.length!==i.length)return!1;for(let n=0;n=0;t--){let n=i[t].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&0>ry.indexOf(n)&&(n=`"${n}"`),i[t]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${i.join(",")}`}}function rw(t){return"number"==typeof t?nB(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function rb(t){if(Array.isArray(t)){for(let i=0;i255*t);t.fillStyle=`rgba(${c[0]},${c[1]},${c[2]},0.8)`,t.fillRect(i.range()[1]-92,a[1],92,a[0]-a[1]),t.closePath(),t.strokeStyle="#ffffff",t.fillStyle=s.textSecondary,t.textBaseline="middle",t.textAlign="left",t.font="12px monospace",h.forEach(function(i){t.beginPath(),t.fillText(u(i),o[1]-92+6,Math.round(n(i))),t.closePath()});let f=t.createLinearGradient(0,0,0,6);f.addColorStop(0,`rgba(${c[0]},${c[1]},${c[2]},1)`),f.addColorStop(1,`rgba(${c[0]},${c[1]},${c[2]},0)`),t.fillStyle=f,t.fillRect(o[1]-92,0,92,6);let d=t.createLinearGradient(0,a[0]-6,0,a[0]);d.addColorStop(0,`rgba(${c[0]},${c[1]},${c[2]},0)`),d.addColorStop(1,`rgba(${c[0]},${c[1]},${c[2]},1)`),t.fillStyle=d,t.fillRect(o[1]-92,n.range()[0]-6,92,6),t.beginPath(),t.strokeStyle=s.emphasis300,t.moveTo(o[1]-92,a[0]),t.lineTo(o[1]-92,a[1]),t.stroke(),t.closePath()}(t,i,n,0,s)}}class rT{constructor(t,i){this.decimalPlaces=void 0,this.position=void 0,this.position=t,this.decimalPlaces=i}draw(t,i,n,r=1,s,o){!function(t,i,n,r,s,o){if(r){let a=i.range()[1];t.font="12px monospace",t.textAlign="left",t.textBaseline="middle";let l=i$(r,s),h=n(r);t.save(),t.setLineDash([2,2]),t.strokeStyle=o.textSecondary,t.beginPath(),t.moveTo(i.range()[0],h+.5),t.lineTo(i.range()[1],h+.5),t.stroke(),t.closePath(),t.restore(),t.beginPath(),t.moveTo(a-92-10,h),t.lineTo(a-92,h-9),t.lineTo(a,h-9),t.lineTo(a,h+9),t.lineTo(a-92,h+9),t.closePath(),t.fillStyle=o.backgroundSurface,t.strokeStyle=o.emphasis300,t.fill(),t.stroke(),t.closePath(),t.beginPath(),t.fillStyle=o.textPrimary,t.fillText(l,a-92+5,h),t.closePath()}}(t,i,n,this.position,this.decimalPlaces,o)}}class rP{constructor(t){this.decimalPlaces=void 0,this.decimalPlaces=t}draw(t,i,n,r=1,s,o){!function(t,i,n,r,s,o){if(r){let a=i.range()[1];t.font="12px monospace",t.textAlign="left",t.textBaseline="middle";let l=i$(r,s),h=n(r);t.beginPath(),t.moveTo(a-92-10,h),t.lineTo(a-92,h-9),t.lineTo(a,h-9),t.lineTo(a,h+9),t.lineTo(a-92,h+9),t.closePath(),t.fillStyle=o.backgroundSurface,t.strokeStyle=o.emphasis300,t.fill(),t.stroke(),t.closePath(),t.beginPath(),t.fillStyle=o.textPrimary,t.fillText(l,a-92+5,h),t.closePath()}}(t,i,n,s,this.decimalPlaces,o)}}var rM,rz,rE,rA={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/rE=rA,function(){var t={}.hasOwnProperty;function i(){for(var n=[],r=0;ri.y-t.y)}draw(t,i,n){let r=this.labels.map(t=>n(t.y)),s=iQ(r,22),o=this.labels.map((t,i)=>({...t,y:s[i]})),a=t.selectAll("div.annotation").data(o,t=>t.id).join(t=>t.append("div").style("left","0px").style("height","22px").style("position","absolute").style("pointer-events","auto")).attr("class",t=>`annotation intent-${t.intent}`).style("top",t=>t.y-11+"px");a.selectAll("span.cell").data(t=>t.cells.filter(t=>!("onClick"in t))).join("span").attr("class",t=>rC("cell",{fill:t.fill},{stroke:t.stroke},{numeric:t.numeric},{[`cell-intent-${t.intent}`]:t.intent})).text(t=>t.label),a.selectAll("div.cell").data(t=>t.cells.filter(t=>"onClick"in t)).join(t=>{let i=t.append("div").attr("class","cell");return i.append("button").attr("class","content action").on("click",(t,i)=>{i.onClick?.()}).style("visibility",t=>t.spinner?"hidden":"visible").text(t=>t.label),i.append("div").attr("class",t=>rC("content","spinner-animation",{"no-spin":!t.spinner})).style("visibility",t=>t.spinner?"visible":"hidden").selectAll("svg").data(t=>[t]).join("svg").attr("width",14).attr("height",14).attr("viewBox",`${rI} ${rI} ${rD} ${rD}`).selectAll("path").data([null,null]).join("path").attr("d","M 50,50 m 0,-45 a 45,45 0 1 1 0,90 a 45,45 0 1 1 0,-90").attr("class",(t,i)=>1===i?"spinner-head":"spinner-track").attr("stroke-width",16).attr("fill-opacity",0).attr("pathLength",(t,i)=>1===i?"280":null).attr("stroke-dasharray",(t,i)=>1===i?"280 280":null).attr("stroke-dashoffset",(t,i)=>1===i?"210":null),i},t=>(t.select("button").style("visibility",t=>t.spinner?"hidden":"visible"),t.select("div").attr("class",t=>rC("content","spinner-animation",{"no-spin":!t.spinner})).style("visibility",t=>t.spinner?"visible":"hidden"),t))}}class rO{constructor(t){this._children=[],this._parent=null,t&&(this.parent=t)}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}addChild(t,i){this._children.includes(t)||this._children.push(t)}}class rN extends rO{constructor(t){super(null),this._data=void 0,this._data={values:t.values}}dependentFields(){return new Set}producedFields(){return new Set}get data(){return this._data}}class rR extends rO{constructor(t,i){super(t),this.transform=i,this.transform=i}dependentFields(){return new Set(this.transform.on)}producedFields(){return new Set(this.transform.as)}assemble(){let{indicator:t,on:i,as:n,...r}=this.transform;return{type:"technical-indicator",method:t,on:i,as:n}}}class rF{constructor(t,i){this.parent=i,this.data=void 0,this.transforms=void 0,this.component=void 0,this.children=[],this.data=t.data??null,this.transforms=t.transform??[],this.component={data:{outputNodes:i?i.component.data.outputNodes:{}}}}parse(){this.parseData()}parseData(){let t;this.component.data=(t=new rN(null===this.data?{values:[]}:this.data),this.component.data,this.data,this.transforms.length>0&&(t=function(t,i){for(let n of i.transforms)"indicator"in n&&(t=new rR(t,n));return t}(t,this)),{...this.component.data,outputNodes:{data:t}})}}let rj={area:"area",bar:"bar",line:"line",rule:"rule"};function rV(t,i){if("area"===t)return new nw(i);if("bar"===t)return new nb(i);if("line"===t)return new nP(i);if("rule"===t)return new nM(i);if("tick"===t)return new nz(i);throw Error(`Element type not recognized: ${t}`)}function rB(t){let i;if(void 0===t)i=()=>null;else if("condition"in t){let n=t.condition?.test;if(void 0!==n.equal){let r="string"==typeof n.equal?t=>t[n.equal]:()=>n.equal;i=i=>i[n.field]===r(i)?t.condition.value??t4.GRAY:t.value??t4.GRAY}else if(void 0!==n.lt){let r="string"==typeof n.lt?t=>t[n.lt]:()=>n.lt;i=i=>i[n.field]t[n.gt]:()=>n.gt;i=i=>i[n.field]>r(i)?t.condition.value??t4.GRAY:t.value??t4.GRAY}else i=()=>null}else i="value"in t?()=>t.value:()=>null;return i}async function rY(t){if(t.current){let i=t.current.getBoundingClientRect(),n=t.current.querySelectorAll(".pane__pane"),r=[];for(let t of n)r.push({plotArea:t.querySelector(".plot-area canvas"),yAxis:t.querySelector(".y-axis canvas")});let s=t.current.querySelector(".x-axis canvas"),o=window.devicePixelRatio,a=o*i.width,l=o*i.height,h="OffscreenCanvas"in window?new OffscreenCanvas(a,l):function(t,i){let n=document.createElement("canvas");return n.width=t,n.height=i,n}(a,l),u=h.getContext("2d");if(u){let t=0;for(let i of r)u.drawImage(i.plotArea,0,t),u.drawImage(i.yAxis,0,t),t+=i.plotArea.height,u.save(),u.lineWidth=2,u.beginPath(),u.moveTo(0,t+.5),u.lineTo(a,t+.5),u.strokeStyle="#fff",u.stroke(),u.closePath(),u.restore();return u.drawImage(s,0,t),"OffscreenCanvas"in window?await h.convertToBlob():new Promise(function(t,i){h.toBlob(function(i){t(i)})})}}return null}function rZ(t){let i=t?getComputedStyle(t):null;return{buyFill:i?.getPropertyValue("--pennant-color-buy-fill").trim()||"#16452d",buyStroke:i?.getPropertyValue("--pennant-color-buy-stroke").trim()||"#26ff8a",sellFill:i?.getPropertyValue("--pennant-color-sell-fill").trim()||"#800700",sellStroke:i?.getPropertyValue("--pennant-color-sell-stroke").trim()||"#ff261a",textPrimary:i?.getPropertyValue("--pennant-font-color-base").trim()||"#ffffff",textSecondary:i?.getPropertyValue("--pennant-font-color-secondary").trim()||"#fafafa",backgroundSurface:i?.getPropertyValue("--pennant-background-surface-color").trim()||"#d9822b",emphasis100:i?.getPropertyValue("--pennant-color-emphasis-100").trim()||"#EDEDED",emphasis300:i?.getPropertyValue("--pennant-color-emphasis-300").trim()||"#494949",emphasis400:i?.getPropertyValue("--pennant-color-emphasis-400").trim()||"#494949",emphasis500:i?.getPropertyValue("--pennant-color-emphasis-500").trim()||"#494949",emphasis900:i?.getPropertyValue("--pennant-color-emphasis-900").trim()||"#333333",vegaGreen:i?.getPropertyValue("--vega-orange").trim()||t4.VEGA_GREEN,vegaOrange:i?.getPropertyValue("--vega-orange").trim()||t4.VEGA_ORANGE,vegaYellow:i?.getPropertyValue("--vega-yellow").trim()||t4.VEGA_YELLOW,accent1:i?.getPropertyValue("--pennant-accent1").trim()||t4.VEGA_ORANGE,accent2:i?.getPropertyValue("--pennant-accent2").trim()||t4.VEGA_YELLOW,accent3:i?.getPropertyValue("--pennant-accent3").trim()||t4.VEGA_RED,accent4:i?.getPropertyValue("--pennant-accent4").trim()||t4.VEGA_YELLOW,accent5:i?.getPropertyValue("--pennant-accent5").trim()||t4.VEGA_ORANGE,accent6:i?.getPropertyValue("--pennant-accent6").trim()||t4.VEGA_RED,eldarRayBearPower:i?.getPropertyValue("--pennant-color-eldar-ray-bear-power").trim()||t4.VEGA_RED,eldarRayBullPower:i?.getPropertyValue("--pennant-color-eldar-ray-bull-power").trim()||t4.VEGA_GREEN,forceIndex:i?.getPropertyValue("--pennant-color-force-index").trim()||t4.VEGA_ORANGE,macdDivergenceBuy:i?.getPropertyValue("--pennant-color-macd-divergence-buy").trim()||t4.VEGA_GREEN,macdDivergenceSell:i?.getPropertyValue("--pennant-color-macd-divergence-sell").trim()||t4.VEGA_RED,macdSignal:i?.getPropertyValue("--pennant-color-macd-signal").trim()||t4.VEGA_ORANGE,macdMacd:i?.getPropertyValue("--pennant-color-macd-macd").trim()||t4.VEGA_YELLOW,relativeStrengthIndex:i?.getPropertyValue("--pennant-color-relative-strength-index").trim()||t4.GRAY,volumeBuy:i?.getPropertyValue("--pennant-color-volume-buy").trim()||t4.VEGA_GREEN,volumeSell:i?.getPropertyValue("--pennant-color-volume-sell").trim()||t4.VEGA_RED}}function rW(t){return"accent"+(1+t%6)}function rH(){let t=2,i=function(i){let n=i.slice(0,t);return i.map((i,r)=>(r>=t&&(n.shift(),n.push(i)),r!(null!==t))?NaN:(n[n.length-1]-n[0])/n[0]))};return i.period=n=>(t=n,i),i}function rX(t,i=1){let n=i;return!function(t,i){let n=t.length,r=n-i.length;return r>=0&&t.slice(r,n)===i}(t,"px")?"number"==typeof Number.parseFloat(t)&&(n=Number.parseFloat(t)):n=Number(t.slice(0,-2)),n}function rU(t){return t instanceof Date}function rG(t){return t[0]instanceof Date}class r$ extends c.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,i){console.error("Uncaught error:",t,i)}render(){return this.state.hasError?tq.jsx("h1",{children:"Sorry... there was an error."}):this.props.children}}let rq=({title:t,info:i,noTrading:n=!0,closeable:r=!1,onClose:s})=>tq.jsxs("div",{className:"indicator-info-wrapper",children:[t&&tq.jsx("span",{className:"text-muted",children:`${t}: `}),i.filter(t=>!n||t.displayWhileNoTrading).map(t=>tq.jsxs("div",{className:"indicator-info__item",children:[t.label&&tq.jsx("span",{className:"text-muted",children:`${t.label} `}),tq.jsx("span",{className:rC("monospace-text",{success:"success"===t.intent},{danger:"danger"===t.intent}),...t.color&&{style:{color:t.color}},children:t.value})]},t.id)),n?tq.jsx("span",{className:"text-muted",children:"No trading"}):null,r&&tq.jsx(tK,{title:"Remove",onClick:s})]});var rK={exports:{}};!function(t,i){(function(){var n,r="Expected a function",s="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],a="[object Arguments]",l="[object Array]",h="[object Boolean]",u="[object Date]",c="[object Error]",f="[object Function]",d="[object GeneratorFunction]",p="[object Map]",m="[object Number]",v="[object Object]",g="[object RegExp]",y="[object Set]",x="[object String]",w="[object Symbol]",b="[object WeakMap]",_="[object ArrayBuffer]",S="[object DataView]",k="[object Float32Array]",T="[object Float64Array]",P="[object Int8Array]",M="[object Int16Array]",z="[object Int32Array]",E="[object Uint8Array]",A="[object Uint16Array]",C="[object Uint32Array]",I=/\b__p \+= '';/g,D=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,O=/&(?:amp|lt|gt|quot|#39);/g,N=/[&<>"']/g,R=RegExp(O.source),F=RegExp(N.source),j=/<%-([\s\S]+?)%>/g,V=/<%([\s\S]+?)%>/g,B=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/[\\^$.*+?()[\]{}|]/g,X=RegExp(H.source),U=/^\s+/,G=/\s/,$=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,q=/\{\n\/\* \[wrapped with (.+)\] \*/,K=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Q=/[()=,{}\[\]\/\s]/,tt=/\\(\\)?/g,te=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ti=/\w*$/,tn=/^[-+]0x[0-9a-f]+$/i,tr=/^0b[01]+$/i,ts=/^\[object .+?Constructor\]$/,to=/^0o[0-7]+$/i,ta=/^(?:0|[1-9]\d*)$/,tl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,th=/($^)/,tu=/['\n\r\u2028\u2029\\]/g,tc="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",tf="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",td="["+tf+"]",tp="["+tc+"]",tm="[a-z\\xdf-\\xf6\\xf8-\\xff]",tv="[^\ud800-\udfff"+tf+"\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",tg="\ud83c[\udffb-\udfff]",ty="[^\ud800-\udfff]",tx="(?:\ud83c[\udde6-\uddff]){2}",tw="[\ud800-\udbff][\udc00-\udfff]",tb="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t_="(?:"+tm+"|"+tv+")",tS="(?:"+tp+"|"+tg+")?",tk="[\\ufe0e\\ufe0f]?"+tS+("(?:\\u200d(?:"+[ty,tx,tw].join("|"))+")[\\ufe0e\\ufe0f]?"+tS+")*",tT="(?:"+["[\\u2700-\\u27bf]",tx,tw].join("|")+")"+tk,tP="(?:"+[ty+tp+"?",tp,tx,tw,"[\ud800-\udfff]"].join("|")+")",tM=RegExp("['’]","g"),tz=RegExp(tp,"g"),tE=RegExp(tg+"(?="+tg+")|"+tP+tk,"g"),tA=RegExp([tb+"?"+tm+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[td,tb,"$"].join("|")+")","(?:"+tb+"|"+tv+")+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[td,tb+t_,"$"].join("|")+")",tb+"?"+t_+"+(?:['’](?:d|ll|m|re|s|t|ve))?",tb+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",tT].join("|"),"g"),tC=RegExp("[\\u200d\ud800-\udfff"+tc+"\\ufe0e\\ufe0f]"),tI=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tD=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tL=-1,tO={};tO[k]=tO[T]=tO[P]=tO[M]=tO[z]=tO[E]=tO["[object Uint8ClampedArray]"]=tO[A]=tO[C]=!0,tO[a]=tO[l]=tO[_]=tO[h]=tO[S]=tO[u]=tO[c]=tO[f]=tO[p]=tO[m]=tO[v]=tO[g]=tO[y]=tO[x]=tO[b]=!1;var tN={};tN[a]=tN[l]=tN[_]=tN[S]=tN[h]=tN[u]=tN[k]=tN[T]=tN[P]=tN[M]=tN[z]=tN[p]=tN[m]=tN[v]=tN[g]=tN[y]=tN[x]=tN[w]=tN[E]=tN["[object Uint8ClampedArray]"]=tN[A]=tN[C]=!0,tN[c]=tN[f]=tN[b]=!1;var tR={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tF=parseFloat,tj=parseInt,tV="object"==typeof tH&&tH&&tH.Object===Object&&tH,tB="object"==typeof self&&self&&self.Object===Object&&self,tY=tV||tB||Function("return this")(),tZ=i&&!i.nodeType&&i,tW=tZ&&t&&!t.nodeType&&t,tX=tW&&tW.exports===tZ,tU=tX&&tV.process,tG=function(){try{return tW&&tW.require&&tW.require("util").types||tU&&tU.binding&&tU.binding("util")}catch(t){}}(),t$=tG&&tG.isArrayBuffer,tq=tG&&tG.isDate,tK=tG&&tG.isMap,tJ=tG&&tG.isRegExp,tQ=tG&&tG.isSet,t0=tG&&tG.isTypedArray;function t1(t,i,n){switch(n.length){case 0:return t.call(i);case 1:return t.call(i,n[0]);case 2:return t.call(i,n[0],n[1]);case 3:return t.call(i,n[0],n[1],n[2])}return t.apply(i,n)}function t2(t,i,n,r){for(var s=-1,o=null==t?0:t.length;++s-1}function t9(t,i,n){for(var r=-1,s=null==t?0:t.length;++r-1;);return n}function eb(t,i){for(var n=t.length;n--&&ea(i,t[n],0)>-1;);return n}var e_=ef({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),eS=ef({"&":"&","<":"<",">":">",'"':""","'":"'"});function ek(t){return"\\"+tR[t]}function eT(t){return tC.test(t)}function eP(t){var i=-1,n=Array(t.size);return t.forEach(function(t,r){n[++i]=[r,t]}),n}function eM(t,i){return function(n){return t(i(n))}}function ez(t,i){for(var n=-1,r=t.length,o=0,a=[];++n",""":'"',"'":"'"}),eL=function t(i){var G,tc=(i=null==i?tY:eL.defaults(tY.Object(),i,eL.pick(tY,tD))).Array,tf=i.Date,td=i.Error,tp=i.Function,tm=i.Math,tv=i.Object,tg=i.RegExp,ty=i.String,tx=i.TypeError,tw=tc.prototype,tb=tp.prototype,t_=tv.prototype,tS=i["__core-js_shared__"],tk=tb.toString,tT=t_.hasOwnProperty,tP=0,tE=(G=/[^.]+$/.exec(tS&&tS.keys&&tS.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"",tC=t_.toString,tR=tk.call(tv),tV=tY._,tB=tg("^"+tk.call(tT).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tZ=tX?i.Buffer:n,tW=i.Symbol,tH=i.Uint8Array,tU=tZ?tZ.allocUnsafe:n,tG=eM(tv.getPrototypeOf,tv),er=tv.create,ef=t_.propertyIsEnumerable,eO=tw.splice,eN=tW?tW.isConcatSpreadable:n,eR=tW?tW.iterator:n,eF=tW?tW.toStringTag:n,ej=function(){try{var t=rf(tv,"defineProperty");return t({},"",{}),t}catch(t){}}(),eV=i.clearTimeout!==tY.clearTimeout&&i.clearTimeout,eB=tf&&tf.now!==tY.Date.now&&tf.now,eY=i.setTimeout!==tY.setTimeout&&i.setTimeout,eZ=tm.ceil,eW=tm.floor,eH=tv.getOwnPropertySymbols,eX=tZ?tZ.isBuffer:n,eU=i.isFinite,eG=tw.join,e$=eM(tv.keys,tv),eq=tm.max,eK=tm.min,eJ=tf.now,eQ=i.parseInt,e0=tm.random,e1=tw.reverse,e2=rf(i,"DataView"),e5=rf(i,"Map"),e3=rf(i,"Promise"),e6=rf(i,"Set"),e4=rf(i,"WeakMap"),e7=rf(tv,"create"),e9=e4&&new e4,e8={},it=rR(e2),ie=rR(e5),ii=rR(e3),ir=rR(e6),is=rR(e4),io=tW?tW.prototype:n,ia=io?io.valueOf:n,il=io?io.toString:n;function ih(t){if(sW(t)&&!sD(t)&&!(t instanceof ip)){if(t instanceof id)return t;if(tT.call(t,"__wrapped__"))return rF(t)}return new id(t)}var iu=function(){function t(){}return function(i){if(!sZ(i))return{};if(er)return er(i);t.prototype=i;var r=new t;return t.prototype=n,r}}();function ic(){}function id(t,i){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=n}function ip(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function im(t){var i=-1,n=null==t?0:t.length;for(this.clear();++i=i?t:i)),t}function iI(t,i,r,s,o,l){var c,b=1&i,I=2&i;if(r&&(c=o?r(t,s,o,l):r(t)),c!==n)return c;if(!sZ(t))return t;var D=sD(t);if(D){if(L=t.length,O=new t.constructor(L),L&&"string"==typeof t[0]&&tT.call(t,"index")&&(O.index=t.index,O.input=t.input),c=O,!b)return nV(t,c)}else{var L,O,N,R,F,j=rm(t),V=j==f||j==d;if(sR(t))return nL(t,b);if(j==v||j==a||V&&!o){if(c=I||V?{}:rg(t),!b)return I?(R=(N=c)&&nB(t,oc(t),N),nB(t,rp(t),R)):(F=iz(c,t),nB(t,rd(t),F))}else{if(!tN[j])return o?t:{};c=function(t,i,n){var r,s,o=t.constructor;switch(i){case _:return nO(t);case h:case u:return new o(+t);case S:return r=n?nO(t.buffer):t.buffer,new t.constructor(r,t.byteOffset,t.byteLength);case k:case T:case P:case M:case z:case E:case"[object Uint8ClampedArray]":case A:case C:return nN(t,n);case p:return new o;case m:case x:return new o(t);case g:return(s=new t.constructor(t.source,ti.exec(t))).lastIndex=t.lastIndex,s;case y:return new o;case w:return ia?tv(ia.call(t)):{}}}(t,j,b)}}l||(l=new ix);var B=l.get(t);if(B)return B;l.set(t,c),s$(t)?t.forEach(function(n){c.add(iI(n,i,r,n,t,l))}):sH(t)&&t.forEach(function(n,s){c.set(s,iI(n,i,r,s,t,l))});var Y=D?n:(4&i?I?rs:rr:I?oc:ou)(t);return t5(Y||t,function(n,s){Y&&(n=t[s=n]),iT(c,s,iI(n,i,r,s,t,l))}),c}function iD(t,i,r){var s=r.length;if(null==t)return!s;for(t=tv(t);s--;){var o=r[s],a=i[o],l=t[o];if(l===n&&!(o in t)||!a(l))return!1}return!0}function iL(t,i,s){if("function"!=typeof t)throw new tx(r);return rA(function(){t.apply(n,s)},i)}function iO(t,i,n,r){var s=-1,o=t7,a=!0,l=t.length,h=[],u=i.length;if(!l)return h;n&&(i=t8(i,eg(n))),r?(o=t9,a=!1):i.length>=200&&(o=ex,a=!1,i=new iy(i));t:for(;++s-1},iv.prototype.set=function(t,i){var n=this.__data__,r=iP(n,t);return r<0?(++this.size,n.push([t,i])):n[r][1]=i,this},ig.prototype.clear=function(){this.size=0,this.__data__={hash:new im,map:new(e5||iv),string:new im}},ig.prototype.delete=function(t){var i=ru(this,t).delete(t);return this.size-=i?1:0,i},ig.prototype.get=function(t){return ru(this,t).get(t)},ig.prototype.has=function(t){return ru(this,t).has(t)},ig.prototype.set=function(t,i){var n=ru(this,t),r=n.size;return n.set(t,i),this.size+=n.size==r?0:1,this},iy.prototype.add=iy.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},iy.prototype.has=function(t){return this.__data__.has(t)},ix.prototype.clear=function(){this.__data__=new iv,this.size=0},ix.prototype.delete=function(t){var i=this.__data__,n=i.delete(t);return this.size=i.size,n},ix.prototype.get=function(t){return this.__data__.get(t)},ix.prototype.has=function(t){return this.__data__.has(t)},ix.prototype.set=function(t,i){var n=this.__data__;if(n instanceof iv){var r=n.__data__;if(!e5||r.length<199)return r.push([t,i]),this.size=++n.size,this;n=this.__data__=new ig(r)}return n.set(t,i),this.size=n.size,this};var iN=nW(iW),iR=nW(iH,!0);function iF(t,i){var n=!0;return iN(t,function(t,r,s){return n=!!i(t,r,s)}),n}function ij(t,i,r){for(var s=-1,o=t.length;++s0&&n(l)?i>1?iB(l,i-1,n,r,s):et(s,l):r||(s[s.length]=l)}return s}var iY=nH(),iZ=nH(!0);function iW(t,i){return t&&iY(t,i,ou)}function iH(t,i){return t&&iZ(t,i,ou)}function iX(t,i){return t4(i,function(i){return sV(t[i])})}function iU(t,i){for(var r=0,s=(i=nC(i,t)).length;null!=t&&ri}function iK(t,i){return null!=t&&tT.call(t,i)}function iJ(t,i){return null!=t&&i in tv(t)}function iQ(t,i,r){for(var s=r?t9:t7,o=t[0].length,a=t.length,l=a,h=tc(a),u=1/0,c=[];l--;){var f=t[l];l&&i&&(f=t8(f,eg(i))),u=eK(f.length,u),h[l]=!r&&(i||o>=120&&f.length>=120)?new iy(l&&f):n}f=t[0];var d=-1,p=h[0];t:for(;++d=l?h:h*("desc"==n[r]?-1:1)}return t.index-i.index}(t,i,n)})}function nr(t,i,n){for(var r=-1,s=i.length,o={};++r-1;)l!==t&&eO.call(l,h,1),eO.call(t,h,1);return t}function no(t,i){for(var n=t?i.length:0,r=n-1;n--;){var s=i[n];if(n==r||s!==o){var o=s;rx(s)?eO.call(t,s,1):nS(t,s)}}return t}function na(t,i){return t+eW(e0()*(i-t+1))}function nl(t,i){var n="";if(!t||i<1||i>9007199254740991)return n;do i%2&&(n+=t),(i=eW(i/2))&&(t+=t);while(i);return n}function nh(t,i){return rC(rP(t,i,oN),t+"")}function nu(t){return ib(ox(t))}function nc(t,i){var n=ox(t);return rL(n,iC(i,0,n.length))}function nf(t,i,r,s){if(!sZ(t))return t;for(var o=-1,a=(i=nC(i,t)).length,l=a-1,h=t;null!=h&&++os?0:s+i),(n=n>s?s:n)<0&&(n+=s),s=i>n?0:n-i>>>0,i>>>=0;for(var o=tc(s);++r>>1,a=t[o];null!==a&&!sK(a)&&(n?a<=i:a=200){var u=i?null:n4(t);if(u)return eE(u);a=!1,s=ex,h=new iy}else h=i?[]:l;t:for(;++r=s?t:nm(t,i,r)}var nD=eV||function(t){return tY.clearTimeout(t)};function nL(t,i){if(i)return t.slice();var n=t.length,r=tU?tU(n):new t.constructor(n);return t.copy(r),r}function nO(t){var i=new t.constructor(t.byteLength);return new tH(i).set(new tH(t)),i}function nN(t,i){var n=i?nO(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function nR(t,i){if(t!==i){var r=t!==n,s=null===t,o=t==t,a=sK(t),l=i!==n,h=null===i,u=i==i,c=sK(i);if(!h&&!c&&!a&&t>i||a&&l&&u&&!h&&!c||s&&l&&u||!r&&u||!o)return 1;if(!s&&!a&&!c&&t1?r[o-1]:n,l=o>2?r[2]:n;for(a=t.length>3&&"function"==typeof a?(o--,a):n,l&&rw(r[0],r[1],l)&&(a=o<3?n:a,o=1),i=tv(i);++s-1?o[a?i[l]:l]:n}}function nq(t){return rn(function(i){var s=i.length,o=s,a=id.prototype.thru;for(t&&i.reverse();o--;){var l=i[o];if("function"!=typeof l)throw new tx(r);if(a&&!h&&"wrapper"==ra(l))var h=new id([],!0)}for(o=h?o:s;++o1&&w.reverse(),f&&uh))return!1;var c=a.get(t),f=a.get(i);if(c&&f)return c==i&&f==t;var d=-1,p=!0,m=2&r?new iy:n;for(a.set(t,i),a.set(i,t);++d-1&&t%1==0&&t1?"& ":"")+i[r],i=i.join(n>2?", ":" "),t.replace($,"{\n/* [wrapped with "+i+"] */\n")}(a,(s=(r=a.match(q))?r[1].split(K):[],t5(o,function(t){var i="_."+t[0];n&t[1]&&!t7(s,i)&&s.push(i)}),s.sort())))}function rD(t){var i=0,r=0;return function(){var s=eJ(),o=16-(s-r);if(r=s,o>0){if(++i>=800)return arguments[0]}else i=0;return t.apply(n,arguments)}}function rL(t,i){var r=-1,s=t.length,o=s-1;for(i=i===n?s:i;++r1?t[i-1]:n;return r="function"==typeof r?(t.pop(),r):n,r3(t,r)});function se(t){var i=ih(t);return i.__chain__=!0,i}function si(t,i){return i(t)}var sn=rn(function(t){var i=t.length,r=i?t[0]:0,s=this.__wrapped__,o=function(i){return iA(i,t)};return!(i>1||this.__actions__.length)&&s instanceof ip&&rx(r)?((s=s.slice(r,+r+(i?1:0))).__actions__.push({func:si,args:[o],thisArg:n}),new id(s,this.__chain__).thru(function(t){return i&&!t.length&&t.push(n),t})):this.thru(o)}),sr=nY(function(t,i,n){tT.call(t,n)?++t[n]:iE(t,n,1)}),ss=n$(rY),so=n$(rZ);function sa(t,i){return(sD(t)?t5:iN)(t,rh(i,3))}function sl(t,i){return(sD(t)?t3:iR)(t,rh(i,3))}var sh=nY(function(t,i,n){tT.call(t,n)?t[n].push(i):iE(t,n,[i])}),su=nh(function(t,i,n){var r=-1,s="function"==typeof i,o=sO(t)?tc(t.length):[];return iN(t,function(t){o[++r]=s?t1(i,t,n):i0(t,i,n)}),o}),sc=nY(function(t,i,n){iE(t,n,i)});function sf(t,i){return(sD(t)?t8:i9)(t,rh(i,3))}var sd=nY(function(t,i,n){t[n?0:1].push(i)},function(){return[[],[]]}),sp=nh(function(t,i){if(null==t)return[];var n=i.length;return n>1&&rw(t,i[0],i[1])?i=[]:n>2&&rw(i[0],i[1],i[2])&&(i=[i[0]]),nn(t,iB(i,1),[])}),sm=eB||function(){return tY.Date.now()};function sv(t,i,r){return i=r?n:i,i=t&&null==i?t.length:i,n9(t,128,n,n,n,n,i)}function sg(t,i){var s;if("function"!=typeof i)throw new tx(r);return t=s5(t),function(){return--t>0&&(s=i.apply(this,arguments)),t<=1&&(i=n),s}}var sy=nh(function(t,i,n){var r=1;if(n.length){var s=ez(n,rl(sy));r|=32}return n9(t,r,i,n,s)}),sx=nh(function(t,i,n){var r=3;if(n.length){var s=ez(n,rl(sx));r|=32}return n9(i,r,t,n,s)});function sw(t,i,s){var o,a,l,h,u,c,f=0,d=!1,p=!1,m=!0;if("function"!=typeof t)throw new tx(r);function v(i){var r=o,s=a;return o=a=n,f=i,h=t.apply(s,r)}function g(t){var r=t-c;return c===n||r>=i||r<0||p&&t-f>=l}function y(){var t,n=sm();if(g(n))return x(n);u=rA(y,(t=i-(n-c),p?eK(t,l-(n-f)):t))}function x(t){return u=n,m&&o?v(t):(o=a=n,h)}function w(){var t,r=sm(),s=g(r);if(o=arguments,a=this,c=r,s){if(u===n)return f=t=c,u=rA(y,i),d?v(t):h;if(p)return nD(u),u=rA(y,i),v(c)}return u===n&&(u=rA(y,i)),h}return i=s6(i)||0,sZ(s)&&(d=!!s.leading,l=(p="maxWait"in s)?eq(s6(s.maxWait)||0,i):l,m="trailing"in s?!!s.trailing:m),w.cancel=function(){u!==n&&nD(u),f=0,o=c=a=u=n},w.flush=function(){return u===n?h:x(sm())},w}var sb=nh(function(t,i){return iL(t,1,i)}),s_=nh(function(t,i,n){return iL(t,s6(i)||0,n)});function sS(t,i){if("function"!=typeof t||null!=i&&"function"!=typeof i)throw new tx(r);var n=function(){var r=arguments,s=i?i.apply(this,r):r[0],o=n.cache;if(o.has(s))return o.get(s);var a=t.apply(this,r);return n.cache=o.set(s,a)||o,a};return n.cache=new(sS.Cache||ig),n}function sk(t){if("function"!=typeof t)throw new tx(r);return function(){var i=arguments;switch(i.length){case 0:return!t.call(this);case 1:return!t.call(this,i[0]);case 2:return!t.call(this,i[0],i[1]);case 3:return!t.call(this,i[0],i[1],i[2])}return!t.apply(this,i)}}sS.Cache=ig;var sT=nh(function(t,i){var n=(i=1==i.length&&sD(i[0])?t8(i[0],eg(rh())):t8(iB(i,1),eg(rh()))).length;return nh(function(r){for(var s=-1,o=eK(r.length,n);++s=i}),sI=i1(function(){return arguments}())?i1:function(t){return sW(t)&&tT.call(t,"callee")&&!ef.call(t,"callee")},sD=tc.isArray,sL=t$?eg(t$):function(t){return sW(t)&&i$(t)==_};function sO(t){return null!=t&&sY(t.length)&&!sV(t)}function sN(t){return sW(t)&&sO(t)}var sR=eX||o$,sF=tq?eg(tq):function(t){return sW(t)&&i$(t)==u};function sj(t){if(!sW(t))return!1;var i=i$(t);return i==c||"[object DOMException]"==i||"string"==typeof t.message&&"string"==typeof t.name&&!sU(t)}function sV(t){if(!sZ(t))return!1;var i=i$(t);return i==f||i==d||"[object AsyncFunction]"==i||"[object Proxy]"==i}function sB(t){return"number"==typeof t&&t==s5(t)}function sY(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function sZ(t){var i=typeof t;return null!=t&&("object"==i||"function"==i)}function sW(t){return null!=t&&"object"==typeof t}var sH=tK?eg(tK):function(t){return sW(t)&&rm(t)==p};function sX(t){return"number"==typeof t||sW(t)&&i$(t)==m}function sU(t){if(!sW(t)||i$(t)!=v)return!1;var i=tG(t);if(null===i)return!0;var n=tT.call(i,"constructor")&&i.constructor;return"function"==typeof n&&n instanceof n&&tk.call(n)==tR}var sG=tJ?eg(tJ):function(t){return sW(t)&&i$(t)==g},s$=tQ?eg(tQ):function(t){return sW(t)&&rm(t)==y};function sq(t){return"string"==typeof t||!sD(t)&&sW(t)&&i$(t)==x}function sK(t){return"symbol"==typeof t||sW(t)&&i$(t)==w}var sJ=t0?eg(t0):function(t){return sW(t)&&sY(t.length)&&!!tO[i$(t)]},sQ=n5(i7),s0=n5(function(t,i){return t<=i});function s1(t){if(!t)return[];if(sO(t))return sq(t)?eC(t):nV(t);if(eR&&t[eR])return function(t){for(var i,n=[];!(i=t.next()).done;)n.push(i.value);return n}(t[eR]());var i=rm(t);return(i==p?eP:i==y?eE:ox)(t)}function s2(t){return t?1/0===(t=s6(t))||-1/0===t?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function s5(t){var i=s2(t),n=i%1;return i==i?n?i-n:i:0}function s3(t){return t?iC(s5(t),0,4294967295):0}function s6(t){if("number"==typeof t)return t;if(sK(t))return NaN;if(sZ(t)){var i="function"==typeof t.valueOf?t.valueOf():t;t=sZ(i)?i+"":i}if("string"!=typeof t)return 0===t?t:+t;t=ev(t);var n=tr.test(t);return n||to.test(t)?tj(t.slice(2),n?2:8):tn.test(t)?NaN:+t}function s4(t){return nB(t,oc(t))}function s7(t){return null==t?"":nb(t)}var s9=nZ(function(t,i){if(rk(i)||sO(i))nB(i,ou(i),t);else for(var n in i)tT.call(i,n)&&iT(t,n,i[n])}),s8=nZ(function(t,i){nB(i,oc(i),t)}),ot=nZ(function(t,i,n,r){nB(i,oc(i),t,r)}),oe=nZ(function(t,i,n,r){nB(i,ou(i),t,r)}),oi=rn(iA),on=nh(function(t,i){t=tv(t);var r=-1,s=i.length,o=s>2?i[2]:n;for(o&&rw(i[0],i[1],o)&&(s=1);++r1),i}),nB(t,rs(t),n),r&&(n=iI(n,7,re));for(var s=i.length;s--;)nS(n,i[s]);return n}),om=rn(function(t,i){return null==t?{}:nr(t,i,function(i,n){return oo(t,n)})});function ov(t,i){if(null==t)return{};var n=t8(rs(t),function(t){return[t]});return i=rh(i),nr(t,n,function(t,n){return i(t,n[0])})}var og=n7(ou),oy=n7(oc);function ox(t){return null==t?[]:ey(t,ou(t))}var ow=nU(function(t,i,n){return i=i.toLowerCase(),t+(n?ob(i):i)});function ob(t){return oE(s7(t).toLowerCase())}function o_(t){return(t=s7(t))&&t.replace(tl,e_).replace(tz,"")}var oS=nU(function(t,i,n){return t+(n?"-":"")+i.toLowerCase()}),ok=nU(function(t,i,n){return t+(n?" ":"")+i.toLowerCase()}),oT=nX("toLowerCase"),oP=nU(function(t,i,n){return t+(n?"_":"")+i.toLowerCase()}),oM=nU(function(t,i,n){return t+(n?" ":"")+oE(i)}),oz=nU(function(t,i,n){return t+(n?" ":"")+i.toUpperCase()}),oE=nX("toUpperCase");function oA(t,i,r){var s;return t=s7(t),(i=r?n:i)===n?(s=t,tI.test(s))?t.match(tA)||[]:t.match(J)||[]:t.match(i)||[]}var oC=nh(function(t,i){try{return t1(t,n,i)}catch(t){return sj(t)?t:new td(t)}}),oI=rn(function(t,i){return t5(i,function(i){iE(t,i=rN(i),sy(t[i],t))}),t});function oD(t){return function(){return t}}var oL=nq(),oO=nq(!0);function oN(t){return t}function oR(t){return i6("function"==typeof t?t:iI(t,1))}var oF=nh(function(t,i){return function(n){return i0(n,t,i)}}),oj=nh(function(t,i){return function(n){return i0(t,n,i)}});function oV(t,i,n){var r=ou(i),s=iX(i,r);null!=n||sZ(i)&&(s.length||!r.length)||(n=i,i=t,t=this,s=iX(i,ou(i)));var o=!(sZ(n)&&"chain"in n&&!n.chain),a=sV(t);return t5(s,function(n){var r=i[n];t[n]=r,a&&(t.prototype[n]=function(){var i=this.__chain__;if(o||i){var n=t(this.__wrapped__);return(n.__actions__=nV(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=i,n}return r.apply(t,et([this.value()],arguments))})}),t}function oB(){}var oY=n0(t8),oZ=n0(t6),oW=n0(en);function oH(t){return rb(t)?ec(rN(t)):function(i){return iU(i,t)}}var oX=n2(),oU=n2(!0);function oG(){return[]}function o$(){return!1}var oq,oK,oJ,oQ=nQ(function(t,i){return t+i},0),o0=n6("ceil"),o1=nQ(function(t,i){return t/i},1),o2=n6("floor"),o5=nQ(function(t,i){return t*i},1),o3=n6("round"),o6=nQ(function(t,i){return t-i},0);return ih.after=function(t,i){if("function"!=typeof i)throw new tx(r);return t=s5(t),function(){if(--t<1)return i.apply(this,arguments)}},ih.ary=sv,ih.assign=s9,ih.assignIn=s8,ih.assignInWith=ot,ih.assignWith=oe,ih.at=oi,ih.before=sg,ih.bind=sy,ih.bindAll=oI,ih.bindKey=sx,ih.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return sD(t)?t:[t]},ih.chain=se,ih.chunk=function(t,i,r){i=(r?rw(t,i,r):i===n)?1:eq(s5(i),0);var s=null==t?0:t.length;if(!s||i<1)return[];for(var o=0,a=0,l=tc(eZ(s/i));oo?0:o+r),(s=s===n||s>o?o:s5(s))<0&&(s+=o),s=r>s?0:s3(s);r>>0)?(t=s7(t))&&("string"==typeof i||null!=i&&!sG(i))&&!(i=nb(i))&&eT(t)?nI(eC(t),0,r):t.split(i,r):[]},ih.spread=function(t,i){if("function"!=typeof t)throw new tx(r);return i=null==i?0:eq(s5(i),0),nh(function(n){var r=n[i],s=nI(n,0,i);return r&&et(s,r),t1(t,this,s)})},ih.tail=function(t){var i=null==t?0:t.length;return i?nm(t,1,i):[]},ih.take=function(t,i,r){return t&&t.length?nm(t,0,(i=r||i===n?1:s5(i))<0?0:i):[]},ih.takeRight=function(t,i,r){var s=null==t?0:t.length;return s?nm(t,(i=s-(i=r||i===n?1:s5(i)))<0?0:i,s):[]},ih.takeRightWhile=function(t,i){return t&&t.length?nT(t,rh(i,3),!1,!0):[]},ih.takeWhile=function(t,i){return t&&t.length?nT(t,rh(i,3)):[]},ih.tap=function(t,i){return i(t),t},ih.throttle=function(t,i,n){var s=!0,o=!0;if("function"!=typeof t)throw new tx(r);return sZ(n)&&(s="leading"in n?!!n.leading:s,o="trailing"in n?!!n.trailing:o),sw(t,i,{leading:s,maxWait:i,trailing:o})},ih.thru=si,ih.toArray=s1,ih.toPairs=og,ih.toPairsIn=oy,ih.toPath=function(t){return sD(t)?t8(t,rN):sK(t)?[t]:nV(rO(s7(t)))},ih.toPlainObject=s4,ih.transform=function(t,i,n){var r=sD(t),s=r||sR(t)||sJ(t);if(i=rh(i,4),null==n){var o=t&&t.constructor;n=s?r?new o:[]:sZ(t)&&sV(o)?iu(tG(t)):{}}return(s?t5:iW)(t,function(t,r,s){return i(n,t,r,s)}),n},ih.unary=function(t){return sv(t,1)},ih.union=r0,ih.unionBy=r1,ih.unionWith=r2,ih.uniq=function(t){return t&&t.length?n_(t):[]},ih.uniqBy=function(t,i){return t&&t.length?n_(t,rh(i,2)):[]},ih.uniqWith=function(t,i){return i="function"==typeof i?i:n,t&&t.length?n_(t,n,i):[]},ih.unset=function(t,i){return null==t||nS(t,i)},ih.unzip=r5,ih.unzipWith=r3,ih.update=function(t,i,n){return null==t?t:nk(t,i,nA(n))},ih.updateWith=function(t,i,r,s){return s="function"==typeof s?s:n,null==t?t:nk(t,i,nA(r),s)},ih.values=ox,ih.valuesIn=function(t){return null==t?[]:ey(t,oc(t))},ih.without=r6,ih.words=oA,ih.wrap=function(t,i){return sP(nA(i),t)},ih.xor=r4,ih.xorBy=r7,ih.xorWith=r9,ih.zip=r8,ih.zipObject=function(t,i){return nz(t||[],i||[],iT)},ih.zipObjectDeep=function(t,i){return nz(t||[],i||[],nf)},ih.zipWith=st,ih.entries=og,ih.entriesIn=oy,ih.extend=s8,ih.extendWith=ot,oV(ih,ih),ih.add=oQ,ih.attempt=oC,ih.camelCase=ow,ih.capitalize=ob,ih.ceil=o0,ih.clamp=function(t,i,r){return r===n&&(r=i,i=n),r!==n&&(r=(r=s6(r))==r?r:0),i!==n&&(i=(i=s6(i))==i?i:0),iC(s6(t),i,r)},ih.clone=function(t){return iI(t,4)},ih.cloneDeep=function(t){return iI(t,5)},ih.cloneDeepWith=function(t,i){return iI(t,5,i="function"==typeof i?i:n)},ih.cloneWith=function(t,i){return iI(t,4,i="function"==typeof i?i:n)},ih.conformsTo=function(t,i){return null==i||iD(t,i,ou(i))},ih.deburr=o_,ih.defaultTo=function(t,i){return null==t||t!=t?i:t},ih.divide=o1,ih.endsWith=function(t,i,r){t=s7(t),i=nb(i);var s=t.length,o=r=r===n?s:iC(s5(r),0,s);return(r-=i.length)>=0&&t.slice(r,o)==i},ih.eq=sE,ih.escape=function(t){return(t=s7(t))&&F.test(t)?t.replace(N,eS):t},ih.escapeRegExp=function(t){return(t=s7(t))&&X.test(t)?t.replace(H,"\\$&"):t},ih.every=function(t,i,r){var s=sD(t)?t6:iF;return r&&rw(t,i,r)&&(i=n),s(t,rh(i,3))},ih.find=ss,ih.findIndex=rY,ih.findKey=function(t,i){return es(t,rh(i,3),iW)},ih.findLast=so,ih.findLastIndex=rZ,ih.findLastKey=function(t,i){return es(t,rh(i,3),iH)},ih.floor=o2,ih.forEach=sa,ih.forEachRight=sl,ih.forIn=function(t,i){return null==t?t:iY(t,rh(i,3),oc)},ih.forInRight=function(t,i){return null==t?t:iZ(t,rh(i,3),oc)},ih.forOwn=function(t,i){return t&&iW(t,rh(i,3))},ih.forOwnRight=function(t,i){return t&&iH(t,rh(i,3))},ih.get=os,ih.gt=sA,ih.gte=sC,ih.has=function(t,i){return null!=t&&rv(t,i,iK)},ih.hasIn=oo,ih.head=rH,ih.identity=oN,ih.includes=function(t,i,n,r){t=sO(t)?t:ox(t),n=n&&!r?s5(n):0;var s=t.length;return n<0&&(n=eq(s+n,0)),sq(t)?n<=s&&t.indexOf(i,n)>-1:!!s&&ea(t,i,n)>-1},ih.indexOf=function(t,i,n){var r=null==t?0:t.length;if(!r)return -1;var s=null==n?0:s5(n);return s<0&&(s=eq(r+s,0)),ea(t,i,s)},ih.inRange=function(t,i,r){var s,o,a;return i=s2(i),r===n?(r=i,i=0):r=s2(r),(s=t=s6(t))>=eK(o=i,a=r)&&s=-9007199254740991&&t<=9007199254740991},ih.isSet=s$,ih.isString=sq,ih.isSymbol=sK,ih.isTypedArray=sJ,ih.isUndefined=function(t){return t===n},ih.isWeakMap=function(t){return sW(t)&&rm(t)==b},ih.isWeakSet=function(t){return sW(t)&&"[object WeakSet]"==i$(t)},ih.join=function(t,i){return null==t?"":eG.call(t,i)},ih.kebabCase=oS,ih.last=r$,ih.lastIndexOf=function(t,i,r){var s=null==t?0:t.length;if(!s)return -1;var o=s;return r!==n&&(o=(o=s5(r))<0?eq(s+o,0):eK(o,s-1)),i==i?function(t,i,n){for(var r=n+1;r--&&t[r]!==i;);return r}(t,i,o):eo(t,eh,o,!0)},ih.lowerCase=ok,ih.lowerFirst=oT,ih.lt=sQ,ih.lte=s0,ih.max=function(t){return t&&t.length?ij(t,oN,iq):n},ih.maxBy=function(t,i){return t&&t.length?ij(t,rh(i,2),iq):n},ih.mean=function(t){return eu(t,oN)},ih.meanBy=function(t,i){return eu(t,rh(i,2))},ih.min=function(t){return t&&t.length?ij(t,oN,i7):n},ih.minBy=function(t,i){return t&&t.length?ij(t,rh(i,2),i7):n},ih.stubArray=oG,ih.stubFalse=o$,ih.stubObject=function(){return{}},ih.stubString=function(){return""},ih.stubTrue=function(){return!0},ih.multiply=o5,ih.nth=function(t,i){return t&&t.length?ni(t,s5(i)):n},ih.noConflict=function(){return tY._===this&&(tY._=tV),this},ih.noop=oB,ih.now=sm,ih.pad=function(t,i,n){t=s7(t);var r=(i=s5(i))?eA(t):0;if(!i||r>=i)return t;var s=(i-r)/2;return n1(eW(s),n)+t+n1(eZ(s),n)},ih.padEnd=function(t,i,n){t=s7(t);var r=(i=s5(i))?eA(t):0;return i&&ri){var s=t;t=i,i=s}if(r||t%1||i%1){var o=e0();return eK(t+o*(i-t+tF("1e-"+((o+"").length-1))),i)}return na(t,i)},ih.reduce=function(t,i,n){var r=sD(t)?ee:ed,s=arguments.length<3;return r(t,rh(i,4),n,s,iN)},ih.reduceRight=function(t,i,n){var r=sD(t)?ei:ed,s=arguments.length<3;return r(t,rh(i,4),n,s,iR)},ih.repeat=function(t,i,r){return i=(r?rw(t,i,r):i===n)?1:s5(i),nl(s7(t),i)},ih.replace=function(){var t=arguments,i=s7(t[0]);return t.length<3?i:i.replace(t[1],t[2])},ih.result=function(t,i,r){var s=-1,o=(i=nC(i,t)).length;for(o||(o=1,t=n);++s9007199254740991)return[];var n=4294967295,r=eK(t,4294967295);t-=4294967295;for(var s=em(r,i=rh(i));++n=a)return t;var h=r-eA(s);if(h<1)return s;var u=l?nI(l,0,h).join(""):t.slice(0,h);if(o===n)return u+s;if(l&&(h+=u.length-h),sG(o)){if(t.slice(h).search(o)){var c,f=u;for(o.global||(o=tg(o.source,s7(ti.exec(o))+"g")),o.lastIndex=0;c=o.exec(f);)var d=c.index;u=u.slice(0,d===n?h:d)}}else if(t.indexOf(nb(o),h)!=h){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+s},ih.unescape=function(t){return(t=s7(t))&&R.test(t)?t.replace(O,eD):t},ih.uniqueId=function(t){var i=++tP;return s7(t)+i},ih.upperCase=oz,ih.upperFirst=oE,ih.each=sa,ih.eachRight=sl,ih.first=rH,oV(ih,(oJ={},iW(ih,function(t,i){tT.call(ih.prototype,i)||(oJ[i]=t)}),oJ),{chain:!1}),ih.VERSION="4.17.21",t5(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){ih[t].placeholder=ih}),t5(["drop","take"],function(t,i){ip.prototype[t]=function(r){r=r===n?1:eq(s5(r),0);var s=this.__filtered__&&!i?new ip(this):this.clone();return s.__filtered__?s.__takeCount__=eK(r,s.__takeCount__):s.__views__.push({size:eK(r,4294967295),type:t+(s.__dir__<0?"Right":"")}),s},ip.prototype[t+"Right"]=function(i){return this.reverse()[t](i).reverse()}}),t5(["filter","map","takeWhile"],function(t,i){var n=i+1,r=1==n||3==n;ip.prototype[t]=function(t){var i=this.clone();return i.__iteratees__.push({iteratee:rh(t,3),type:n}),i.__filtered__=i.__filtered__||r,i}}),t5(["head","last"],function(t,i){var n="take"+(i?"Right":"");ip.prototype[t]=function(){return this[n](1).value()[0]}}),t5(["initial","tail"],function(t,i){var n="drop"+(i?"":"Right");ip.prototype[t]=function(){return this.__filtered__?new ip(this):this[n](1)}}),ip.prototype.compact=function(){return this.filter(oN)},ip.prototype.find=function(t){return this.filter(t).head()},ip.prototype.findLast=function(t){return this.reverse().find(t)},ip.prototype.invokeMap=nh(function(t,i){return"function"==typeof t?new ip(this):this.map(function(n){return i0(n,t,i)})}),ip.prototype.reject=function(t){return this.filter(sk(rh(t)))},ip.prototype.slice=function(t,i){t=s5(t);var r=this;return r.__filtered__&&(t>0||i<0)?new ip(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),i!==n&&(r=(i=s5(i))<0?r.dropRight(-i):r.take(i-t)),r)},ip.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},ip.prototype.toArray=function(){return this.take(4294967295)},iW(ip.prototype,function(t,i){var r=/^(?:filter|find|map|reject)|While$/.test(i),s=/^(?:head|last)$/.test(i),o=ih[s?"take"+("last"==i?"Right":""):i],a=s||/^find/.test(i);o&&(ih.prototype[i]=function(){var i=this.__wrapped__,l=s?[1]:arguments,h=i instanceof ip,u=l[0],c=h||sD(i),f=function(t){var i=o.apply(ih,et([t],l));return s&&d?i[0]:i};c&&r&&"function"==typeof u&&1!=u.length&&(h=c=!1);var d=this.__chain__,p=!!this.__actions__.length,m=a&&!d,v=h&&!p;if(!a&&c){i=v?i:new ip(this);var g=t.apply(i,l);return g.__actions__.push({func:si,args:[f],thisArg:n}),new id(g,d)}return m&&v?t.apply(this,l):(g=this.thru(f),m?s?g.value()[0]:g.value():g)})}),t5(["pop","push","shift","sort","splice","unshift"],function(t){var i=tw[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);ih.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var s=this.value();return i.apply(sD(s)?s:[],t)}return this[n](function(n){return i.apply(sD(n)?n:[],t)})}}),iW(ip.prototype,function(t,i){var n=ih[i];if(n){var r=n.name+"";tT.call(e8,r)||(e8[r]=[]),e8[r].push({name:i,func:n})}}),e8[nK(n,2).name]=[{name:"wrapper",func:n}],ip.prototype.clone=function(){var t=new ip(this.__wrapped__);return t.__actions__=nV(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=nV(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=nV(this.__views__),t},ip.prototype.reverse=function(){if(this.__filtered__){var t=new ip(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},ip.prototype.value=function(){var t=this.__wrapped__.value(),i=this.__dir__,n=sD(t),r=i<0,s=n?t.length:0,o=function(t,i,n){for(var r=-1,s=n.length;++r=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},ih.prototype.plant=function(t){for(var i,r=this;r instanceof ic;){var s=rF(r);s.__index__=0,s.__values__=n,i?o.__wrapped__=s:i=s;var o=s;r=r.__wrapped__}return o.__wrapped__=t,i},ih.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof ip){var i=t;return this.__actions__.length&&(i=new ip(this)),(i=i.reverse()).__actions__.push({func:si,args:[rQ],thisArg:n}),new id(i,this.__chain__)}return this.thru(rQ)},ih.prototype.toJSON=ih.prototype.valueOf=ih.prototype.value=function(){return nP(this.__wrapped__,this.__actions__)},ih.prototype.first=ih.prototype.head,eR&&(ih.prototype[eR]=function(){return this}),ih}();tW?((tW.exports=eL)._=eL,tZ._=eL):tY._=eL}).call(tH)}(rK,rK.exports);var rJ=rK.exports;let rQ=!1;function r0(t){let[i,n]=h.useState({width:void 0,height:void 0,devicePixelContentBoxSizeInlineSize:void 0,devicePixelContentBoxSizeBlockSize:void 0}),r=h.useMemo(()=>rJ.throttle(n,t),[t]),{ref:s}=function(t={}){let i=t.onResize,n=h.useRef(void 0);n.current=i;let r=h.useRef(),[s,o]=h.useState({width:void 0,height:void 0,devicePixelContentBoxSizeInlineSize:void 0,devicePixelContentBoxSizeBlockSize:void 0}),a=h.useRef(!1);h.useEffect(()=>()=>{a.current=!0},[]);let l=h.useRef({width:void 0,height:void 0,devicePixelContentBoxSizeInlineSize:void 0,devicePixelContentBoxSizeBlockSize:void 0}),u=function(t,i){let n=h.useRef(null),r=h.useCallback(t=>{n.current=t,a()},[]),s=h.useRef(null),o=h.useRef(),a=()=>{let r=null;n.current?r=n.current:i&&(r=i instanceof HTMLElement?i:i.current),s.current!==r&&(o.current&&(o.current(),o.current=null),s.current=r,r&&(o.current=t(r)))};return h.useEffect(()=>{a()},[i]),r}(t=>(r.current||(r.current=new ResizeObserver(t=>{if(!Array.isArray(t))return;let i=t[0];if(i){let t=Math.round(i.contentRect.width),r=Math.round(i.contentRect.height),s=i.devicePixelContentBoxSize?.[0].inlineSize,h=i.devicePixelContentBoxSize?.[0].blockSize;if(l.current.width!==t||l.current.height!==r||l.current.devicePixelContentBoxSizeInlineSize!==s||l.current.devicePixelContentBoxSizeBlockSize!==h){let i={width:t,height:r,devicePixelContentBoxSizeInlineSize:s,devicePixelContentBoxSizeBlockSize:h};n.current?n.current(i):(l.current.width=t,l.current.height=r,l.current.devicePixelContentBoxSizeInlineSize=s,l.current.devicePixelContentBoxSizeBlockSize=h,a.current||o(i))}}})),r.current.observe(t,rQ?{box:"device-pixel-content-box"}:{}),()=>{r.current&&r.current.unobserve(t)}),t.ref);return h.useMemo(()=>({ref:u,width:s.width,height:s.height,devicePixelContentBoxSizeInlineSize:s.devicePixelContentBoxSizeInlineSize,devicePixelContentBoxSizeBlockSize:s.devicePixelContentBoxSizeBlockSize}),[u,s?s.width:null,s?s.height:null,s?s.devicePixelContentBoxSizeInlineSize:null,s?s.devicePixelContentBoxSizeBlockSize:null])}({onResize:r});return{ref:s,...i}}new Promise(t=>{let i=new ResizeObserver(n=>{t(n.every(t=>"devicePixelContentBoxSize"in t)),i.disconnect()});i.observe(document.body,{box:["device-pixel-content-box"]})}).catch(()=>!1).then(t=>{t&&(rQ=!0)});let r1=({delay:t=1e3,description:i,title:n})=>{let r=((t=300)=>{let[i,n]=h.useState(!1);return h.useEffect(()=>{let i=setTimeout(()=>n(!0),t);return()=>clearTimeout(i)},[t]),i})(t);return tq.jsx("div",{className:rC("non-ideal-state"),children:tq.jsxs("div",{className:rC("content",{hide:!r}),children:[tq.jsx("div",{className:"non-ideal-state-visual"}),tq.jsx("h4",{className:"heading",children:n}),i&&tq.jsx("div",{children:i})]})})};function r2(t,i){if((n=(t=i?t.toExponential(i-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function r5(t){return(t=r2(Math.abs(t)))?t[1]:NaN}var r3,r6=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function r4(t){var i;if(!(i=r6.exec(t)))throw Error("invalid format: "+t);return new r7({fill:i[1],align:i[2],sign:i[3],symbol:i[4],zero:i[5],width:i[6],comma:i[7],precision:i[8]&&i[8].slice(1),trim:i[9],type:i[10]})}function r7(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function r9(t,i){var n=r2(t,i);if(!n)return t+"";var r=n[0],s=n[1];return s<0?"0."+Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+Array(s-r.length+2).join("0")}r4.prototype=r7.prototype,r7.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var r8={"%":(t,i)=>(100*t).toFixed(i),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,i)=>t.toExponential(i),f:(t,i)=>t.toFixed(i),g:(t,i)=>t.toPrecision(i),o:t=>Math.round(t).toString(8),p:(t,i)=>r9(100*t,i),r:r9,s:function(t,i){var n=r2(t,i);if(!n)return t+"";var r=n[0],s=n[1],o=s-(r3=3*Math.max(-8,Math.min(8,Math.floor(s/3))))+1,a=r.length;return o===a?r:o>a?r+Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+Array(1-o).join("0")+r2(t,Math.max(0,i+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function st(t){return t}var se,si,sn,sr=Array.prototype.map,ss=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function so(t,i,n){let r=t.length;return 0===r?NaN:null===i||i>=r||i<0?t[r-1][n]:t[i][n]}si=(se=function(t){var i,n,r,s=void 0===t.grouping||void 0===t.thousands?st:(n=sr.call(t.grouping,Number),r=t.thousands+"",function(t,i){for(var s=t.length,o=[],a=0,l=n[0],h=0;s>0&&l>0&&(h+l+1>i&&(l=Math.max(1,i-h)),o.push(t.substring(s-=l,s+l)),!((h+=l+1)>i));)l=n[a=(a+1)%n.length];return o.reverse().join(r)}),o=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",l=void 0===t.decimal?".":t.decimal+"",h=void 0===t.numerals?st:(i=sr.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return i[+t]})}),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",f=void 0===t.nan?"NaN":t.nan+"";function d(t){var i=(t=r4(t)).fill,n=t.align,r=t.sign,d=t.symbol,p=t.zero,m=t.width,v=t.comma,g=t.precision,y=t.trim,x=t.type;"n"===x?(v=!0,x="g"):r8[x]||(void 0===g&&(g=12),y=!0,x="g"),(p||"0"===i&&"="===n)&&(p=!0,i="0",n="=");var w="$"===d?o:"#"===d&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",b="$"===d?a:/[%p]/.test(x)?u:"",_=r8[x],S=/[defgprs%]/.test(x);function k(t){var o,a,u,d=w,k=b;if("c"===x)k=_(t)+k,t="";else{var T=(t=+t)<0||1/t<0;if(t=isNaN(t)?f:_(Math.abs(t),g),y&&(t=function(t){e:for(var i,n=t.length,r=1,s=-1;r0&&(s=0)}return s>0?t.slice(0,s)+t.slice(i+1):t}(t)),T&&0==+t&&"+"!==r&&(T=!1),d=(T?"("===r?r:c:"-"===r||"("===r?"":r)+d,k=("s"===x?ss[8+r3/3]:"")+k+(T&&"("===r?")":""),S){for(o=-1,a=t.length;++o(u=t.charCodeAt(o))||u>57){k=(46===u?l+t.slice(o+1):t.slice(o))+k,t=t.slice(0,o);break}}}v&&!p&&(t=s(t,1/0));var P=d.length+t.length+k.length,M=P>1)+d+t+k+M.slice(P);break;default:t=M+d+t+k}return h(t)}return g=void 0===g?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return t+""},k}return{format:d,formatPrefix:function(t,i){var n=d(((t=r4(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(r5(i)/3))),s=Math.pow(10,-r),o=ss[8+r/3];return function(t){return n(s*t)+o}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,sn=se.formatPrefix;let sa={main:{label:"",fields:[{id:"date",label:"",format:t=>tW(t,"HH:mm dd MMM yyyy"),displayWhileNoTrading:!0},{id:"open",label:"O"},{id:"high",label:"H"},{id:"low",label:"L"},{id:"close",label:"C"},{id:"absoluteChange",label:"Change",format:(t,i)=>isNaN(t)?"-":si(`+.${i}f`)(t),intent:!0},{id:"percentageChange",label:"",format:t=>isNaN(t)?"-":`(${si("+.2%")(t)})`,intent:!0}]},simple:{label:"",fields:[{id:"close",label:""},{id:"percentageChangeData24",label:"",format:t=>isNaN(t)?"-":si("+.2%")(t),intent:!0}]},bollinger:{label:"Bollinger",fields:[{id:"bollingerUpper",label:"Upper"},{id:"bollingerLower",label:"Lower"}]},eldarRay:{label:"Eldar-ray",fields:[{id:"bullPower",label:"Bull"},{id:"bearPower",label:"Bear"}]},envelope:{label:"Envelope",fields:[{id:"envelopeUpper",label:"Upper"},{id:"envelopeLower",label:"Lower"}]},exponentialMovingAverage:{label:"EMA",fields:[{id:"exponentialMovingAverage",label:""}]},forceIndex:{label:"Force index",fields:[{id:"forceIndex",label:""}]},macd:{label:"MACD",fields:[{id:"signal",label:"S"},{id:"divergence",label:"D"},{id:"macd",label:"MACD"}]},movingAverage:{label:"Moving average",fields:[{id:"movingAverage",label:""}]},priceMonitoringBounds1:{label:"Price Monitoring Bounds 1",fields:[{id:"minValidPrice_1",label:"Min"},{id:"maxValidPrice_1",label:"Max"},{id:"referencePrice_1",label:"Reference"}]},priceMonitoringBounds2:{label:"Price Monitoring Bounds 2",fields:[{id:"minValidPrice_2",label:"Min"},{id:"maxValidPrice_2",label:"Max"},{id:"referencePrice_2",label:"Reference"}]},priceMonitoringBounds3:{label:"Price Monitoring Bounds 3",fields:[{id:"minValidPrice_3",label:"Min"},{id:"maxValidPrice_3",label:"Max"},{id:"referencePrice_3",label:"Reference"}]},priceMonitoringBounds4:{label:"Price Monitoring Bounds 4",fields:[{id:"minValidPrice_4",label:"Min"},{id:"maxValidPrice_4",label:"Max"},{id:"referencePrice_4",label:"Reference"}]},relativeStrengthIndex:{label:"RSI",fields:[{id:"relativeStrengthIndex",label:""}]},volume:{label:"Volume",fields:[{id:"volume",label:""}]}},sl=h.forwardRef(({bounds:t,colors:i,dataIndex:n,decimalPlaces:r,positionDecimalPlaces:s,priceMonitoringBounds:o,overlays:a,pane:l,simple:u,onClosePane:c,onRemoveOverlay:f},d)=>{let[p,m]=h.useState(null),v=0===so(l.originalData,n,"volume"),g=0;return tq.jsxs("div",{ref:d,className:"pane__pane",onMouseOver:()=>m(l.id),onMouseOut:()=>m(null),children:[tq.jsx("d3fc-canvas",{class:"plot-area","use-device-pixel-ratio":!0}),!u&&tq.jsx("d3fc-svg",{class:"plot-area-interaction"}),tq.jsx("div",{className:"plot-area-annotations"}),tq.jsx("d3fc-canvas",{class:"y-axis","use-device-pixel-ratio":!0,style:{width:u?0:"100%"}}),tq.jsx("d3fc-svg",{class:"y-axis-interaction",style:{width:u?0:"92px"}}),"main"!==l.id&&!u&&tq.jsx("div",{className:"pane__close-button-wrapper",style:{right:"92px",opacity:p===l.id?1:0,visibility:p===l.id?"visible":"hidden"},children:tq.jsx("div",{className:"pane__close-button",children:tq.jsx(tK,{onClick:()=>{c(l.id)}})})}),tq.jsxs("div",{className:"pane__info-overlay",style:{alignItems:u?"flex-end":"flex-start"},children:[tq.jsx(rq,{title:sa[u?"simple":l.id].label,info:sa[u?"simple":l.id].fields.map(t=>{let i=so(l.originalData,n,t.id),o="volume"===t.id?s:r;return{id:t.id,label:t.label,value:t.format?t.format(i,o):i$(i,o),displayWhileNoTrading:t.displayWhileNoTrading,intent:function(t,i){if(t.intent&&!isNaN(i)&&0!==i)return i>0?"success":"danger"}(t,i)}}),noTrading:v}),"main"===l.id&&a.map(t=>"priceMonitoringBounds"===t?o.slice(0,4).map((s,o)=>tq.jsx(rq,{title:sa[`priceMonitoringBounds${o+1}`].label,info:sa[`priceMonitoringBounds${o+1}`].fields.map(t=>{let s=so(l.originalData,n,t.id);return{id:t.id,label:t.label,value:t.format?t.format(s,r):i$(s,r),color:i[rW(g++)]}}),noTrading:v,closeable:!0,onClose:()=>{f(t)}},sa[`priceMonitoringBounds${o+1}`].label)):tq.jsx(rq,{title:sa[t].label,info:sa[t].fields.map(t=>{let s=so(l.originalData,n,t.id);return{id:t.id,label:t.label,value:t.format?t.format(s,r):i$(s,r),color:i[rW(g++)]}}),noTrading:v,closeable:!0,onClose:()=>{f(t)}},sa[t].label))]})]})}),sh="d3fc-canvas,d3fc-svg{position:relative;display:block}d3fc-canvas>canvas,d3fc-svg>svg{position:absolute;height:100%;width:100%}d3fc-svg>svg{overflow:visible}";if("undefined"!=typeof window){let t=document.createElement("style");t.setAttribute("type","text/css"),document.querySelector("head").appendChild(t),t.styleSheet?t.styleSheet.cssText+=sh:t.textContent+=sh}let su="__d3fc-elements__",sc=t=>t[su]||{},sf=(t,i)=>{t[su]=i},sd=t=>"D3FC-GROUP"===t.tagName?[t,...t.querySelectorAll("d3fc-canvas, d3fc-group, d3fc-svg")]:[t],sp=t=>{let{width:i,height:n}=sc(t),r=t.useDevicePixelRatio&&null!=window.devicePixelRatio?window.devicePixelRatio:1,s=t.clientWidth*r,o=t.clientHeight*r,a=t.children[0];sf(t,{pixelRatio:r,width:s,height:o,resized:s!==i||o!==n,child:a})},sm=t=>{let i=sc(t),n=new CustomEvent("measure",{detail:i});t.dispatchEvent(n)},sv=t=>{let i=sc(t),n=new CustomEvent("draw",{detail:i});t.dispatchEvent(n)},sg=t=>sc(t.ownerDocument).queue||[],sy=(t,i)=>{let{requestId:n}=sc(t.ownerDocument);null==n&&(n=requestAnimationFrame(()=>{(t=>{let i=t.map(sd).reduce((t,i)=>t.concat(i));i.forEach(sp),i.forEach(sm),i.forEach(sv)})(sg(t)),sx(t)})),sf(t.ownerDocument,{queue:i,requestId:n})},sx=t=>{var i;return i=t.ownerDocument,delete i[su]},sw=(t,i)=>{let n=t;do if(n.parentNode===i)return!0;while(n=n.parentNode);return!1};var sb=t=>{let i=sg(t);if(i.indexOf(t)>-1||i.some(i=>sw(t,i)))return;let n=i.filter(i=>!sw(i,t));n.push(t),sy(t,n)};let s_=class{};"undefined"!=typeof window&&(s_=HTMLElement);var sS=(t,i)=>class extends s_{static get observedAttributes(){return["use-device-pixel-ratio"]}attributeChangedCallback(t){"use-device-pixel-ratio"===t&&this.requestRedraw()}connectedCallback(){var i;0===this.childNodes.length&&this.appendChild(t()),i=this,null==i.__measureListener__&&(i.__measureListener__=t=>i.setMeasurements(t.detail),i.addEventListener("measure",i.__measureListener__))}disconnectedCallback(){var t;t=this,null!=t.__measureListener__&&(t.removeEventListener("measure",t.__measureListener__),t.__measureListener__=null)}setMeasurements({width:t,height:n}){let{childNodes:[r,...s]}=this;if(s.length>0)throw Error("A d3fc-svg/canvas element must only contain a single svg/canvas element.");i(this,r,{width:t,height:n})}get useDevicePixelRatio(){return this.hasAttribute("use-device-pixel-ratio")&&"false"!==this.getAttribute("use-device-pixel-ratio")}set useDevicePixelRatio(t){t&&!this.useDevicePixelRatio?this.setAttribute("use-device-pixel-ratio",""):!t&&this.useDevicePixelRatio&&this.removeAttribute("use-device-pixel-ratio"),this.requestRedraw()}requestRedraw(){sb(this)}};class sk extends sS(()=>document.createElement("canvas"),(t,i,{width:n,height:r})=>{i.setAttribute("width",n),i.setAttribute("height",r),t.setWebglViewport&&i.getContext("webgl").viewport(0,0,n,r)}){get setWebglViewport(){return this.hasAttribute("set-webgl-viewport")&&"false"!==this.getAttribute("set-webgl-viewport")}set setWebglViewport(t){t&&!this.setWebglViewport?this.setAttribute("set-webgl-viewport",""):!t&&this.setWebglViewport&&this.removeAttribute("set-webgl-viewport"),this.requestRedraw()}}let sT=t=>{t.autoResize?sP(t):sM(t)},sP=t=>{null==t.__autoResizeListener__&&(t.__autoResizeListener__=()=>sb(t),addEventListener("resize",t.__autoResizeListener__))},sM=t=>{null!=t.__autoResizeListener__&&(removeEventListener("resize",t.__autoResizeListener__),t.__autoResizeListener__=null)},sz=class{};"undefined"!=typeof window&&(sz=HTMLElement);var sE=sS(()=>document.createElementNS("http://www.w3.org/2000/svg","svg"),(t,i,{width:n,height:r})=>{i.setAttribute("viewBox",`0 0 ${n} ${r}`)});"object"==typeof customElements&&"function"==typeof customElements.define&&(customElements.define("d3fc-canvas",sk),customElements.define("d3fc-group",class extends sz{connectedCallback(){sT(this)}disconnectedCallback(){sM(this)}requestRedraw(){sb(this)}get autoResize(){return this.hasAttribute("auto-resize")&&"false"!==this.getAttribute("auto-resize")}set autoResize(t){t&&!this.autoResize?this.setAttribute("auto-resize",""):!t&&this.autoResize&&this.removeAttribute("auto-resize"),sT(this)}static get observedAttributes(){return["auto-resize"]}attributeChangedCallback(t){"auto-resize"===t&&sT(this)}}),customElements.define("d3fc-svg",sE));var sA={value:()=>{}};function sC(){for(var t,i=0,n=arguments.length,r={};ii?1:t>=i?0:NaN}sI.prototype=sC.prototype={constructor:sI,on:function(t,i){var n,r=this._,s=(t+"").trim().split(/^|\s+/).map(function(t){var i="",n=t.indexOf(".");if(n>=0&&(i=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw Error("unknown type: "+t);return{type:t,name:i}}),o=-1,a=s.length;if(!(arguments.length<2)){if(null!=i&&"function"!=typeof i)throw Error("invalid callback: "+i);for(;++o0)for(var n,r,s=Array(n),o=0;o>>1;0>sN(t[s],i)?n=s+1:r=s}return n},right:function(t,i,n,r){for(null==n&&(n=0),null==r&&(r=t.length);n>>1;sN(t[s],i)>0?r=s:n=s+1}return n}}).right,sF=Math.sqrt(50),sj=Math.sqrt(10),sV=Math.sqrt(2);function sB(t,i,n){var r=(i-t)/Math.max(0,n),s=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,s);return s>=0?(o>=sF?10:o>=sj?5:o>=sV?2:1)*Math.pow(10,s):-Math.pow(10,-s)/(o>=sF?10:o>=sj?5:o>=sV?2:1)}function sY(t,i){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(i).domain(t)}return this}function sZ(t,i,n){t.prototype=i.prototype=n,n.constructor=t}function sW(t,i){var n=Object.create(t.prototype);for(var r in i)n[r]=i[r];return n}function sH(){}var sX=1/.7,sU="\\s*([+-]?\\d+)\\s*",sG="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",s$="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sq=/^#([0-9a-f]{3,8})$/,sK=RegExp("^rgb\\("+[sU,sU,sU]+"\\)$"),sJ=RegExp("^rgb\\("+[s$,s$,s$]+"\\)$"),sQ=RegExp("^rgba\\("+[sU,sU,sU,sG]+"\\)$"),s0=RegExp("^rgba\\("+[s$,s$,s$,sG]+"\\)$"),s1=RegExp("^hsl\\("+[sG,s$,s$]+"\\)$"),s2=RegExp("^hsla\\("+[sG,s$,s$,sG]+"\\)$"),s5={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function s3(){return this.rgb().formatHex()}function s6(){return this.rgb().formatRgb()}function s4(t){var i,n;return t=(t+"").trim().toLowerCase(),(i=sq.exec(t))?(n=i[1].length,i=parseInt(i[1],16),6===n?s7(i):3===n?new ot(i>>8&15|i>>4&240,i>>4&15|240&i,(15&i)<<4|15&i,1):8===n?s9(i>>24&255,i>>16&255,i>>8&255,(255&i)/255):4===n?s9(i>>12&15|i>>8&240,i>>8&15|i>>4&240,i>>4&15|240&i,((15&i)<<4|15&i)/255):null):(i=sK.exec(t))?new ot(i[1],i[2],i[3],1):(i=sJ.exec(t))?new ot(255*i[1]/100,255*i[2]/100,255*i[3]/100,1):(i=sQ.exec(t))?s9(i[1],i[2],i[3],i[4]):(i=s0.exec(t))?s9(255*i[1]/100,255*i[2]/100,255*i[3]/100,i[4]):(i=s1.exec(t))?or(i[1],i[2]/100,i[3]/100,1):(i=s2.exec(t))?or(i[1],i[2]/100,i[3]/100,i[4]):s5.hasOwnProperty(t)?s7(s5[t]):"transparent"===t?new ot(NaN,NaN,NaN,0):null}function s7(t){return new ot(t>>16&255,t>>8&255,255&t,1)}function s9(t,i,n,r){return r<=0&&(t=i=n=NaN),new ot(t,i,n,r)}function s8(t,i,n,r){var s;return 1==arguments.length?((s=t)instanceof sH||(s=s4(s)),s?new ot((s=s.rgb()).r,s.g,s.b,s.opacity):new ot):new ot(t,i,n,null==r?1:r)}function ot(t,i,n,r){this.r=+t,this.g=+i,this.b=+n,this.opacity=+r}function oe(){return"#"+on(this.r)+on(this.g)+on(this.b)}function oi(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function on(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function or(t,i,n,r){return r<=0?t=i=n=NaN:n<=0||n>=1?t=i=NaN:i<=0&&(t=NaN),new oo(t,i,n,r)}function os(t){if(t instanceof oo)return new oo(t.h,t.s,t.l,t.opacity);if(t instanceof sH||(t=s4(t)),!t)return new oo;if(t instanceof oo)return t;var i=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,s=Math.min(i,n,r),o=Math.max(i,n,r),a=NaN,l=o-s,h=(o+s)/2;return l?(a=i===o?(n-r)/l+6*(n0&&h<1?0:a,new oo(a,l,h,t.opacity)}function oo(t,i,n,r){this.h=+t,this.s=+i,this.l=+n,this.opacity=+r}function oa(t,i,n){return 255*(t<60?i+(n-i)*t/60:t<180?n:t<240?i+(n-i)*(240-t)/60:i)}sZ(sH,s4,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:s3,formatHex:s3,formatHsl:function(){return os(this).formatHsl()},formatRgb:s6,toString:s6}),sZ(ot,s8,sW(sH,{brighter:function(t){return t=null==t?sX:Math.pow(sX,t),new ot(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new ot(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oe,formatHex:oe,formatRgb:oi,toString:oi})),sZ(oo,function(t,i,n,r){return 1==arguments.length?os(t):new oo(t,i,n,null==r?1:r)},sW(sH,{brighter:function(t){return t=null==t?sX:Math.pow(sX,t),new oo(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new oo(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),i=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*i,s=2*n-r;return new ot(oa(t>=240?t-240:t+120,s,r),oa(t,s,r),oa(t<120?t+240:t-120,s,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var ol=t=>()=>t;function oh(t,i){var n=i-t;return n?function(i){return t+i*n}:ol(isNaN(t)?i:t)}var ou=function t(i){var n,r=1==(n=+(n=i))?oh:function(t,i){var r,s,o;return i-t?(r=t,s=i,r=Math.pow(r,o=n),s=Math.pow(s,o)-r,o=1/o,function(t){return Math.pow(r+t*s,o)}):ol(isNaN(t)?i:t)};function s(t,i){var n=r((t=s8(t)).r,(i=s8(i)).r),s=r(t.g,i.g),o=r(t.b,i.b),a=oh(t.opacity,i.opacity);return function(i){return t.r=n(i),t.g=s(i),t.b=o(i),t.opacity=a(i),t+""}}return s.gamma=t,s}(1);function oc(t,i){i||(i=[]);var n,r=t?Math.min(i.length,t.length):0,s=i.slice();return function(o){for(n=0;nl&&(a=i.slice(l,a),u[h]?u[h]+=a:u[++h]=a),(s=s[0])===(o=o[0])?u[h]?u[h]+=o:u[++h]=o:(u[++h]=null,c.push({i:h,x:op(s,o)})),l=og.lastIndex;return l180?h+=360:h-l>180&&(l+=360),d.push({i:f.push(s(f)+"rotate(",null,r)-2,x:op(l,h)})):h&&f.push(s(f)+"rotate("+h+r),(u=o.skewX)!==(c=a.skewX)?d.push({i:f.push(s(f)+"skewX(",null,r)-2,x:op(u,c)}):c&&f.push(s(f)+"skewX("+c+r),function(t,i,n,r,o,a){if(t!==n||i!==r){var l=o.push(s(o)+"scale(",null,",",null,")");a.push({i:l-4,x:op(t,n)},{i:l-2,x:op(i,r)})}else 1===n&&1===r||o.push(s(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,f,d),o=a=null,function(t){for(var i,n=-1,r=d.length;++n(i=a[h-1])&&(n=t,t=i,i=n),u=function(n){return Math.max(t,Math.min(i,n))}),r=h>2?oO:oL,s=o=null,f}function f(i){return null==i||isNaN(i=+i)?n:(s||(s=r(a.map(t),l,h)))(t(u(i)))}return f.invert=function(n){return u(i((o||(o=r(l,a.map(t),op)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,oA),c()):a.slice()},f.range=function(t){return arguments.length?(l=Array.from(t),c()):l.slice()},f.rangeRound=function(t){return l=Array.from(t),h=ow,c()},f.clamp=function(t){return arguments.length?(u=!!t||oI,c()):u!==oI},f.interpolate=function(t){return arguments.length?(h=t,c()):h},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,i=r,c()}})()(oI,oI)}function oF(){var t,i,n=oR();return n.copy=function(){return oN(n,oF())},sY.apply(n,arguments),i=(t=n).domain,t.ticks=function(t){var n=i();return function(t,i,n){var r,s,o,a,l=-1;if(n=+n,(t=+t)==(i=+i)&&n>0)return[t];if((r=i0)for(t=Math.ceil(t/a),o=Array(s=Math.ceil((i=Math.floor(i/a))-t+1));++l=sF?a*=10:l>=sj?a*=5:l>=sV&&(a*=2),i0;){if((s=sB(h,u,n))===r)return o[a]=h,o[l]=u,i(o);if(s>0)h=Math.floor(h/s)*s,u=Math.ceil(u/s)*s;else{if(!(s<0))break;h=Math.ceil(h*s)/s,u=Math.floor(u*s)/s}r=s}return t},t}function oj(t){return new Date(t)}function oV(t){return t instanceof Date?+t:+new Date(+t)}function oB(){return sY.apply((function t(i,n,r,s,o,a,l,h,u,c){var f=oR(),d=f.invert,p=f.domain,m=c(".%L"),v=c(":%S"),g=c("%I:%M"),y=c("%I %p"),x=c("%a %d"),w=c("%b %d"),b=c("%B"),_=c("%Y");function S(t){return(u(t)=0&&"xmlns"!==(i=t.slice(0,n))&&(t=t.slice(n+1)),oZ.hasOwnProperty(i)?{space:oZ[i],local:t}:t}function oH(t){return function(){var i=this.ownerDocument,n=this.namespaceURI;return n===oY&&i.documentElement.namespaceURI===oY?i.createElement(t):i.createElementNS(n,t)}}function oX(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function oU(t){var i=oW(t);return(i.local?oX:oH)(i)}function oG(){}function o$(t){return null==t?oG:function(){return this.querySelector(t)}}function oq(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function oK(){return[]}function oJ(t){return null==t?oK:function(){return this.querySelectorAll(t)}}function oQ(t){return function(){return this.matches(t)}}function o0(t){return function(i){return i.matches(t)}}var o1=Array.prototype.find;function o2(){return this.firstElementChild}var o5=Array.prototype.filter;function o3(){return this.children}function o6(t){return Array(t.length)}function o4(t,i){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=i}function o7(t,i,n,r,s,o){for(var a,l=0,h=i.length,u=o.length;li?1:t>=i?0:NaN}function ae(t){return function(){this.removeAttribute(t)}}function ai(t){return function(){this.removeAttributeNS(t.space,t.local)}}function an(t,i){return function(){this.setAttribute(t,i)}}function ar(t,i){return function(){this.setAttributeNS(t.space,t.local,i)}}function as(t,i){return function(){var n=i.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function ao(t,i){return function(){var n=i.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function aa(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function al(t){return function(){this.style.removeProperty(t)}}function ah(t,i,n){return function(){this.style.setProperty(t,i,n)}}function au(t,i,n){return function(){var r=i.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function ac(t,i){return t.style.getPropertyValue(i)||aa(t).getComputedStyle(t,null).getPropertyValue(i)}function af(t){return function(){delete this[t]}}function ad(t,i){return function(){this[t]=i}}function ap(t,i){return function(){var n=i.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function am(t){return t.trim().split(/^|\s+/)}function av(t){return t.classList||new ag(t)}function ag(t){this._node=t,this._names=am(t.getAttribute("class")||"")}function ay(t,i){for(var n=av(t),r=-1,s=i.length;++rthis._names.indexOf(t)&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var i=this._names.indexOf(t);i>=0&&(this._names.splice(i,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var aV=[null];function aB(t,i){this._groups=t,this._parents=i}function aY(){return new aB([[document.documentElement]],aV)}function aZ(t){return"string"==typeof t?new aB([[document.querySelector(t)]],[document.documentElement]):new aB([[t]],aV)}function aW(t){let i;for(;i=t.sourceEvent;)t=i;return t}function aH(t,i){if(t=aW(t),void 0===i&&(i=t.currentTarget),i){var n=i.ownerSVGElement||i;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(i.getScreenCTM().inverse())).x,r.y]}if(i.getBoundingClientRect){var s=i.getBoundingClientRect();return[t.clientX-s.left-i.clientLeft,t.clientY-s.top-i.clientTop]}}return[t.pageX,t.pageY]}function aX(t){t.stopImmediatePropagation()}function aU(t){t.preventDefault(),t.stopImmediatePropagation()}function aG(t){var i=t.document.documentElement,n=aZ(t).on("dragstart.drag",aU,!0);"onselectstart"in i?n.on("selectstart.drag",aU,!0):(i.__noselect=i.style.MozUserSelect,i.style.MozUserSelect="none")}function a$(t,i){var n=t.document.documentElement,r=aZ(t).on("dragstart.drag",null);i&&(r.on("click.drag",aU,!0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}aB.prototype=aY.prototype={constructor:aB,select:function(t){"function"!=typeof t&&(t=o$(t));for(var i=this._groups,n=i.length,r=Array(n),s=0;s=_&&(_=b+1);!(w=g[_])&&++_=0;)(r=s[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function i(i,n){return i&&n?t(i.__data__,n.__data__):!i-!n}t||(t=at);for(var n=this._groups,r=n.length,s=Array(r),o=0;o1?this.each((null==i?al:"function"==typeof i?au:ah)(t,i,null==n?"":n)):ac(this.node(),t)},property:function(t,i){return arguments.length>1?this.each((null==i?af:"function"==typeof i?ap:ad)(t,i)):this.node()[t]},classed:function(t,i){var n=am(t+"");if(arguments.length<2){for(var r=av(this.node()),s=-1,o=n.length;++s=0&&(i=t.slice(n+1),t=t.slice(0,n)),{type:t,name:i}}),a=o.length;if(!(arguments.length<2)){for(l=i?aN:aO,r=0;r()=>t;function aK(t,{sourceEvent:i,subject:n,target:r,identifier:s,active:o,x:a,y:l,dx:h,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:i,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}function aJ(t){return!t.ctrlKey&&!t.button}function aQ(){return this.parentNode}function a0(t,i){return null==i?{x:t.x,y:t.y}:i}function a1(){return navigator.maxTouchPoints||"ontouchstart"in this}function a2(){var t,i,n,r,s=aJ,o=aQ,a=a0,l=a1,h={},u=sC("start","drag","end"),c=0,f=0;function d(t){t.on("mousedown.drag",p).filter(l).on("touchstart.drag",g).on("touchmove.drag",y).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,l){if(!r&&s.call(this,a,l)){var h=w(this,o.call(this,a,l),a,l,"mouse");h&&(aZ(a.view).on("mousemove.drag",m,!0).on("mouseup.drag",v,!0),aG(a.view),aX(a),n=!1,t=a.clientX,i=a.clientY,h("start",a))}}function m(r){if(aU(r),!n){var s=r.clientX-t,o=r.clientY-i;n=s*s+o*o>f}h.mouse("drag",r)}function v(t){aZ(t.view).on("mousemove.drag mouseup.drag",null),a$(t.view,n),aU(t),h.mouse("end",t)}function g(t,i){if(s.call(this,t,i)){var n,r,a=t.changedTouches,l=o.call(this,t,i),h=a.length;for(n=0;n=0&&i._call.call(null,t),i=i._next;--a6}()}finally{a6=0,function(){for(var t,i,n=a5,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(i=n._next,n._next=null,n=t?t._next=i:a5=i);a3=t,lh(r)}(),a8=0}}function ll(){var t=le.now(),i=t-a9;i>1e3&&(lt-=i,a9=t)}function lh(t){a6||(a4&&(a4=clearTimeout(a4)),t-a8>24?(t<1/0&&(a4=setTimeout(la,t-le.now()-lt)),a7&&(a7=clearInterval(a7))):(a7||(a9=le.now(),a7=setInterval(ll,1e3)),a6=1,li(la)))}function lu(t,i,n){var r=new ls;return i=null==i?0:+i,r.restart(n=>{r.stop(),t(n+i)},i,n),r}ls.prototype=lo.prototype={constructor:ls,restart:function(t,i,n){if("function"!=typeof t)throw TypeError("callback is not a function");n=(null==n?ln():+n)+(null==i?0:+i),this._next||a3===this||(a3?a3._next=this:a5=this,a3=this),this._call=t,this._time=n,lh()},stop:function(){this._call&&(this._call=null,this._time=1/0,lh())}};var lc=sC("start","end","cancel","interrupt"),lf=[];function ld(t,i,n,r,s,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,i,n){var r,s=t.__transition;function o(h){var u,c,f,d;if(1!==n.state)return l();for(u in s)if((d=s[u]).name===n.name){if(3===d.state)return lu(o);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete s[u]):+u0)throw Error("too late; already scheduled");return n}function lm(t,i){var n=lv(t,i);if(n.state>3)throw Error("too late; already running");return n}function lv(t,i){var n=t.__transition;if(!n||!(n=n[i]))throw Error("transition not found");return n}function lg(t,i){var n,r,s,o=t.__transition,a=!0;if(o){for(s in i=null==i?null:i+"",o)(n=o[s]).name===i?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[s]):a=!1;a&&delete t.__transition}}function ly(t,i){var n,r;return function(){var s=lm(this,t),o=s.tween;if(o!==n){for(var a=0,l=(r=n=o).length;a=0&&(t=t.slice(0,i)),!t||"start"===t})?lp:lm,function(){var a=s(this,o),l=a.on;l!==n&&(r=(n=l).copy()).on(t,i),a.on=r}))},attr:function(t,i){var n=oW(t),r="transform"===n?oM:lb;return this.attrTween(t,"function"==typeof i?(n.local?lM:lP)(n,r,lw(this,"attr."+t,i)):null==i?(n.local?lS:l_)(n):(n.local?lT:lk)(n,r,i))},attrTween:function(t,i){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==i)return this.tween(n,null);if("function"!=typeof i)throw Error();var r=oW(t);return this.tween(n,(r.local?lz:lE)(r,i))},style:function(t,i,n){var r,s,o,a,l,h,u,c,f,d,p,m,v,g,y,x,w,b,_,S,k,T="transform"==(t+="")?oP:lb;return null==i?this.styleTween(t,(r=t,function(){var t=ac(this,r),i=(this.style.removeProperty(r),ac(this,r));return t===i?null:t===s&&i===o?a:a=T(s=t,o=i)})).on("end.style."+t,lO(t)):"function"==typeof i?this.styleTween(t,(l=t,h=lw(this,"style."+t,i),function(){var t=ac(this,l),i=h(this),n=i+"";return null==i&&(this.style.removeProperty(l),n=i=ac(this,l)),t===n?null:t===u&&n===c?f:(c=n,f=T(u=t,i))})).each((d=this._id,w="end."+(x="style."+(p=t)),function(){var t=lm(this,d),i=t.on,n=null==t.value[x]?y||(y=lO(p)):void 0;i===m&&g===n||(v=(m=i).copy()).on(w,g=n),t.on=v})):this.styleTween(t,(b=t,k=i+"",function(){var t=ac(this,b);return t===k?null:t===_?S:S=T(_=t,i)}),n).on("end.style."+t,null)},styleTween:function(t,i,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==i)return this.tween(r,null);if("function"!=typeof i)throw Error();return this.tween(r,function(t,i,n){var r,s;function o(){var o=i.apply(this,arguments);return o!==s&&(r=(s=o)&&function(i){this.style.setProperty(t,o.call(this,i),n)}),r}return o._value=i,o}(t,i,null==n?"":n))},text:function(t){var i,n;return this.tween("text","function"==typeof t?(i=lw(this,"text",t),function(){var t=i(this);this.textContent=null==t?"":t}):(n=null==t?"":t+"",function(){this.textContent=n}))},textTween:function(t){var i="text";if(arguments.length<1)return(i=this.tween(i))&&i._value;if(null==t)return this.tween(i,null);if("function"!=typeof t)throw Error();return this.tween(i,function(t){var i,n;function r(){var r=t.apply(this,arguments);return r!==n&&(i=(n=r)&&function(t){this.textContent=r.call(this,t)}),i}return r._value=t,r}(t))},remove:function(){var t;return this.on("end.remove",(t=this._id,function(){var i=this.parentNode;for(var n in this.__transition)if(+n!==t)return;i&&i.removeChild(this)}))},tween:function(t,i){var n=this._id;if(t+="",arguments.length<2){for(var r,s=lv(this.node(),n).tween,o=0,a=s.length;o()=>t;function lB(t,{sourceEvent:i,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:i,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function lY(t,i,n){this.k=t,this.x=i,this.y=n}lY.prototype={constructor:lY,scale:function(t){return 1===t?this:new lY(this.k*t,this.x,this.y)},translate:function(t,i){return 0===t&0===i?this:new lY(this.k,this.x+this.k*t,this.y+this.k*i)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var lZ=new lY(1,0,0);function lW(t){for(;!t.__zoom;)if(!(t=t.parentNode))return lZ;return t.__zoom}function lH(t){t.stopImmediatePropagation()}function lX(t){t.preventDefault(),t.stopImmediatePropagation()}function lU(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function lG(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function l$(){return this.__zoom||lZ}function lq(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function lK(){return navigator.maxTouchPoints||"ontouchstart"in this}function lJ(t,i,n){var r=t.invertX(i[0][0])-n[0][0],s=t.invertX(i[1][0])-n[1][0],o=t.invertY(i[0][1])-n[0][1],a=t.invertY(i[1][1])-n[1][1];return t.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function lQ(){var t,i,n,r=lU,s=lG,o=lJ,a=lq,l=lK,h=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,f=oE,d=sC("start","zoom","end"),p=0,m=10;function v(t){t.property("__zoom",l$).on("wheel.zoom",S).on("mousedown.zoom",k).on("dblclick.zoom",T).filter(l).on("touchstart.zoom",P).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,i){return(i=Math.max(h[0],Math.min(h[1],i)))===t.k?t:new lY(i,t.x,t.y)}function y(t,i,n){var r=i[0]-n[0]*t.k,s=i[1]-n[1]*t.k;return r===t.x&&s===t.y?t:new lY(t.k,r,s)}function x(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,i,n,r){t.on("start.zoom",function(){b(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).event(r).end()}).tween("zoom",function(){var t=arguments,o=b(this,t).event(r),a=s.apply(this,t),l=null==n?x(a):"function"==typeof n?n.apply(this,t):n,h=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=this.__zoom,c="function"==typeof i?i.apply(this,t):i,d=f(u.invert(l).concat(h/u.k),c.invert(l).concat(h/c.k));return function(t){if(1===t)t=c;else{var i=d(t),n=h/i[2];t=new lY(n,l[0]-i[0]*n,l[1]-i[1]*n)}o.zoom(null,t)}})}function b(t,i,n){return!n&&t.__zooming||new _(t,i)}function _(t,i){this.that=t,this.args=i,this.active=0,this.sourceEvent=null,this.extent=s.apply(t,i),this.taps=0}function S(t,...i){if(r.apply(this,arguments)){var n=b(this,i).event(t),s=this.__zoom,l=Math.max(h[0],Math.min(h[1],s.k*Math.pow(2,a.apply(this,arguments)))),c=aH(t);if(n.wheel)n.mouse[0][0]===c[0]&&n.mouse[0][1]===c[1]||(n.mouse[1]=s.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(s.k===l)return;n.mouse=[c,s.invert(c)],lg(this),n.start()}lX(t),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",o(y(g(s,l),n.mouse[0],n.mouse[1]),n.extent,u))}}function k(t,...i){if(!n&&r.apply(this,arguments)){var s=b(this,i,!0).event(t),a=aZ(t.view).on("mousemove.zoom",function(t){if(lX(t),!s.moved){var i=t.clientX-c,n=t.clientY-f;s.moved=i*i+n*n>p}s.event(t).zoom("mouse",o(y(s.that.__zoom,s.mouse[0]=aH(t,h),s.mouse[1]),s.extent,u))},!0).on("mouseup.zoom",function(t){a.on("mousemove.zoom mouseup.zoom",null),a$(t.view,s.moved),lX(t),s.event(t).end()},!0),l=aH(t,h),h=t.currentTarget,c=t.clientX,f=t.clientY;aG(t.view),lH(t),s.mouse=[l,this.__zoom.invert(l)],lg(this),s.start()}}function T(t,...i){if(r.apply(this,arguments)){var n=this.__zoom,a=aH(t.changedTouches?t.changedTouches[0]:t,this),l=n.invert(a),h=n.k*(t.shiftKey?.5:2),f=o(y(g(n,h),a,l),s.apply(this,i),u);lX(t),c>0?aZ(this).transition().duration(c).call(w,f,a,t):aZ(this).call(v.transform,f,a,t)}}function P(n,...s){if(r.apply(this,arguments)){var o,a,l,h,u=n.touches,c=u.length,f=b(this,s,n.changedTouches.length===c).event(n);for(lH(n),a=0;a{hi(a,t,i,n,c,l,u)}),_(!1);else{let n=a().k*v.k,r=(t.range()[1]-122)/n;o.translateExtent([[t(m[0])-r,-1/0],[t(m[m.length-1])+r,1/0]]);let h=a().rescaleX(t)(m[m.length-1]);s.call(o.scaleBy,v.k,f?[h,0]:g),d||Object.keys(c).forEach(n=>{hi(a,t,i,n,c,l,u)})}let S=a().rescaleX(t),k=h[y]().rescaleY(i[y]);for(let t of(n.xScale(S),Object.values(c)))t.xScale(S);c[y].yScale(k),r[y].yScale(k);let T=S.domain(),P=T[1].getTime()-T[0].getTime();if(m[0].getTime()+P>T[0].getTime()){let t=m[0];b(new Date(m[0].getTime()-P),t)}w(),x(S.domain())}function hi(t,i,n,r,s,o,a){let l=t().rescaleX(i).domain(),h=n[r].range(),u=s[r].extent(l),c=Math.abs(h[0]-h[1]),f=Math.abs(n[r](u[1])-n[r](u[0]));o[r].call(a[r].transform,lZ.translate(0,c/2).scale(c/f).translate(0,-(n[r](u[0])+n[r](u[1]))/2))}lW.prototype=lY.prototype;class hn{constructor(t,i,n,r,s,o,a,l){this.colors=void 0,this._crosshair=new n_,this.ctx=null,this._data=void 0,this.gridline=new nk,this._labels=void 0,this.latestPriceCrosshair=new n_,this.latestPricePosition=null,this._pixelRatio=1,this.position=[null,null],this._renderableElements=void 0,this._xScale=void 0,this._yEncodingFields=void 0,this._yScale=void 0,this.isSimple=!1,this._xScale=t.copy(),this._yScale=i.copy(),this._renderableElements=n,this._data=r,this._yEncodingFields=s,this._labels=o,this.isSimple=a,this.colors=l}context(t){return this.ctx=t,this}crosshair(t){return this.position=t,this}data(t){return this._data=t,this}draw(){if(this.ctx){for(let t of(t6(this.ctx.canvas,this.ctx,this.colors.backgroundSurface),this.gridline.draw(this.ctx,this._xScale,this._yScale,this._pixelRatio,this.colors.emphasis100),this._renderableElements[0].draw(this.ctx,this._xScale,this._yScale,this._pixelRatio),this._renderableElements))t.draw(this.ctx,this._xScale,this._yScale,this._pixelRatio);for(let t of(this.isSimple||this.latestPriceCrosshair.draw(this.ctx,this._xScale,this._yScale,this._pixelRatio,[null,this.latestPricePosition],this.colors.textPrimary),this._crosshair.draw(this.ctx,this._xScale,this._yScale,this._pixelRatio,this.position,this.colors.textPrimary),this._labels))t.draw(this.ctx,this._xScale,this._yScale,this._pixelRatio,this.colors)}}extent(t){let i=i6(t?this._data.filter(i=>i.date>=t[0]&&i.date<=t[1]).flatMap(t=>this._yEncodingFields?.map(i=>t[i])):this._data.flatMap(t=>this._yEncodingFields?.map(i=>t[i]))),n=Math.abs(i[1]-i[0]);return[i[0]-.1*n,i[1]+.2*n]}getIndex(t){let i=this._xScale.invert(t);if(!td(i))return null;let n=i1(t=>t.date).left(this._data,i);if(0===this._data.length)return null;let r=this._data[Math.max(0,n-1)].date,s=this._data[Math.min(this._data.length-1,n)].date,o=0;o=r&&s?function(t,i){tl(2,arguments);var n=th(t);if(isNaN(Number(n)))return NaN;var r,s,o=n.getTime();return(null==i?[]:"function"==typeof i.forEach?i:Array.prototype.slice.call(i)).forEach(function(t,i){var n=th(t);if(isNaN(Number(n)))return r=NaN,void(s=NaN);var a=Math.abs(o-n.getTime());(null==r||a(this._labels=t,this),this.xScale=t=>(this._xScale=t.copy(),this),this.yScale=t=>(this._yScale=t.copy(),this),this._xScale=t.copy(),this._yScale=i.copy(),this._labels=n}draw(t){for(let i of this._labels)i.draw(t,this._xScale,this._yScale)}on(t,i){return this.listeners.on(t,i),this}}class hs{constructor(t,i){this.listeners=sC("contextmenu","dblclick","mousemove","mouseout","zoom","zoomend","zoomstart"),this._xScale=void 0,this._yScale=void 0,this.z=lZ,this.zoom=void 0,this.tempTransform=lZ,this.xScale=t=>(this._xScale=t.copy(),this),this.yScale=t=>(this._yScale=t.copy(),this),this._xScale=t.copy(),this._yScale=i.copy(),this.zoom=lQ().filter(t=>"dblclick"!==t.type||(this.listeners.call("dblclick",this,t),!1)).on("zoom",t=>{let i=t.transform,n=i.k/this.z.k,r=this.center(t);this.listeners.call("zoom",this,t,{x:i.x-this.z.x,y:i.y-this.z.y,k:n},r),this.z=i}).on("start",t=>{this.tempTransform=t.transform,this.listeners.call("zoomstart",this)}).on("end",t=>{t.transform.k===this.tempTransform.k&&t.transform.x===this.tempTransform.x&&t.transform.y===this.tempTransform.y||this.listeners.call("zoomend",this,[t.sourceEvent.offsetX,t.sourceEvent.offsetY])})}center(t){var i,n;if(t.sourceEvent){let r=((i=t).target&&(i=aW(i),void 0===n&&(n=i.currentTarget),i=i.touches||[i]),Array.from(i,t=>aH(t,n)));return[i9(r,t=>t[0]),i9(r,t=>t[1])]}return[(this._xScale.range()[1]-this._xScale.range()[0])/2,(this._yScale.range()[0]-this._yScale.range()[1])/2]}draw(t){t.call(this.zoom),t.on("mousemove",t=>this.listeners.call("mousemove",this,[t.offsetX,t.offsetY])).on("mouseout",()=>this.listeners.call("mouseout",this)).on("contextmenu",t=>{t.preventDefault(),this.listeners.call("contextmenu",this,{position:[t.pageX,t.pageY],price:this._yScale.invert(t.offsetY)})})}on(t,i){return this.listeners.on(t,i),this}}class ho{constructor(t,i,n){this.colors=void 0,this.axis=new nE,this.ctx=null,this._interval=void 0,this._pixelRatio=1,this.position=null,this.tooltip=new nA,this._xScale=void 0,this._interval=i,this._xScale=t.copy(),this.colors=n}context(t){return this.ctx=t,this}crosshair(t){return this.position=t,this}draw(){this.ctx&&(t6(this.ctx.canvas,this.ctx,this.colors.backgroundSurface),this.axis.draw(this.ctx,this._xScale,null,this._pixelRatio,this._interval,this.colors.textSecondary),this.tooltip.draw(this.ctx,this._xScale,null,this._pixelRatio,this.position,this._interval,this.colors))}interval(t){return this._interval=t,this}pixelRatio(t){return this._pixelRatio=t,this}xScale(t){return this._xScale=t.copy(),this}}class ha{constructor(){this.drag=a2().on("drag",t=>{this.listeners.call("drag",this,t)}),this.listeners=sC("dblclick","drag")}draw(t){t.call(this.drag).on("dblclick",()=>{this.listeners.call("dblclick")})}on(t,i){return this.listeners.on(t,i),this}}class hl{constructor(t,i,n=5,r){this.colors=void 0,this.axis=new rk,this.ctx=null,this.latestPricePosition=null,this._pixelRatio=1,this.position=null,this.tooltip=void 0,this.latestPriceTooltip=void 0,this._xScale=void 0,this._yScale=void 0,this._xScale=t.copy(),this._yScale=i.copy(),this.tooltip=new rP(n),this.latestPriceTooltip=new rP(n),this.colors=r}context(t){return this.ctx=t,this}crosshair(t){return this.position=t,this}draw(){this.ctx&&(this.axis.draw(this.ctx,this._xScale,this._yScale,this._pixelRatio,this.colors),this.latestPriceTooltip.draw(this.ctx,this._xScale,this._yScale,this._pixelRatio,this.latestPricePosition,this.colors),this.tooltip.draw(this.ctx,this._xScale,this._yScale,this._pixelRatio,this.position,this.colors))}latestPrice(t){return this.latestPricePosition=t,this}pixelRatio(t){return this._pixelRatio=t,this}xScale(t){return this._xScale=t.copy(),this}yScale(t){return this._yScale=t.copy(),this}}class hh{constructor(){this.drag=a2().on("drag",t=>{this.listeners.call("drag",this,t)}),this.listeners=sC("dblclick","drag")}draw(t){t.call(this.drag).on("dblclick",()=>{this.listeners.call("dblclick")})}on(t,i){return this.listeners.on(t,i),this}}function hu(t,i){return(t?0:92)+(t?.5:3)*i}class hc{constructor(t,i,n,r=5,s=0,o=!1,a=24,l){this.listeners=sC("bounds_changed","click","contextmenu","dblclick","drag","dragend","dragstart","fetch_data","mousemove","mouseout","mouseover","redraw","rightclick","viewport_changed"),this._interval=t2.I1M,this._decimalPlaces=5,this._positionDecimalPlaces=3,this.initialNumCandles=ts,this.isPinned=!0,this.isFreePan=!1,this.isSimple=!1,this._colors=void 0,this.dates=void 0,this.xAxis=void 0,this.xAxisInteraction=void 0,this.xElement=void 0,this.xScale=void 0,this.xTransform=void 0,this.xZoom=void 0,this.yAxes=void 0,this.yAxisInteractions=void 0,this.yElements=void 0,this.yScales=void 0,this.yTransforms=void 0,this.yZooms=void 0,this.plotAreas=void 0,this.plotAreaInteractions=void 0,this.plotAreaAnnotations=void 0,this.plotAreaElements=void 0,this._decimalPlaces=r,this._positionDecimalPlaces=s,this.isSimple=o,this.initialNumCandles=a,this._colors=l,this.dates=i.data,this.xScale=oB(),this.xZoom=lQ().scaleExtent([.1,10]),this.xElement=aZ(i.ref.current).select(".x-axis").style("pointer-events","none"),this.xAxis=new ho(this.xScale,this._interval,l),this.xAxisInteraction=new ha().on("drag",t=>{!function(t,i,n,r,s,o,a,l,h,u,c){t.call(i.scaleBy,Math.pow(2,-n.dx/(r.range()[1]-r.range()[0])),[s?r.range()[1]-92:(r.range()[1]-r.range()[0])/2,0]);let f=o().rescaleX(r);for(let t of(a.xScale(f),Object.values(l)))t.xScale(f);for(let t of Object.values(h))t.xScale(f);u(f.domain()),c()}(this.xElement,this.xZoom,t,this.xScale,this.isPinned,this.xTransform,this.xAxis,this.plotAreas,this.yAxes,t=>this.listeners.call("bounds_changed",this,t),()=>this.listeners.call("redraw"))}).on("dblclick",()=>{this.resetXAxis(),this.isPinned=!0,this.listeners.call("redraw")}),this.xTransform=()=>lW(this.xElement.node()),this.yScales=Object.fromEntries(Object.keys(t).map(t=>[t,oF()])),this.yAxes=Object.fromEntries(Object.entries(this.yScales).map(([t,i])=>[t,new hl(this.xScale,i,"volume"===t?this._positionDecimalPlaces:this._decimalPlaces,this._colors)])),this.yAxisInteractions=Object.fromEntries(Object.keys(t).map(t=>[t,new hh().on("drag",i=>{l0(this.yElements[t],this.yZooms[t],i,this.yScales[t],this.yTransforms[t],this.plotAreas[t],this.yAxes[t],t=>{this.isFreePan=t},()=>this.listeners.call("redraw"))}).on("dblclick",()=>{this.resetYAxis(t),this.isFreePan=!1,this.listeners.call("redraw")})])),this.yElements=Object.fromEntries(Object.entries(t).map(([t,i])=>[t,aZ(i.ref.current).select(".y-axis").style("pointer-events","none")])),this.plotAreas=Object.fromEntries(Object.entries(t).map(([t,i])=>[i.id,new hn(this.xScale,this.yScales[t],i.renderableElements.flat(1),i.data,i.yEncodingFields,i.labelLines,this.isSimple,this._colors)])),this.plotAreaInteractions=Object.fromEntries(Object.keys(t).map(t=>[t,new hs(this.xScale,this.yScales[t]).on("zoom",(i,n,r)=>{he(this.xScale,this.yScales,this.xAxis,this.yAxes,this.xElement,this.xZoom,this.xTransform,this.yElements,this.yTransforms,this.yZooms,this.plotAreas,this.isPinned,this.isFreePan,this.isSimple,this.dates,n,r,t,t=>{this.listeners.call("bounds_changed",this,t)},()=>this.listeners.call("redraw"),(t,i)=>this.listeners.call("fetch_data",this,t,i),t=>{this.isPinned=t})}).on("zoomstart",()=>{l3(this.plotAreas,this.yAxes,this.xAxis)}).on("zoomend",i=>{l5(this.plotAreas,i,this.yTransforms[t]().rescaleY(this.yScales[t]),this.xAxis,this.yAxes[t],t,()=>this.listeners.call("redraw"))}).on("dblclick",()=>{this.reset(),this.listeners.call("dblclick",this)}).on("mousemove",i=>{ht(this.plotAreas,i,this.yTransforms[t]().rescaleY(this.yScales[t]),this.yAxes,this.xAxis,t,(t,i)=>this.listeners.call("mousemove",this,t,i),()=>this.listeners.call("redraw"))}).on("mouseout",()=>{l8(this.plotAreas,this.xAxis,this.yAxes,()=>this.listeners.call("redraw"),()=>this.listeners.call("mouseout",this))}).on("contextmenu",t=>{this.listeners.call("contextmenu",this,t)})])),this.plotAreaAnnotations=Object.fromEntries(Object.entries(t).map(([i,n])=>[n.id,new hr(this.xScale,this.yScales[i],t[i].labels)])),this.plotAreaElements=Object.fromEntries(Object.entries(t).map(([t,i])=>[t,aZ(i.ref.current).select(".plot-area").style("pointer-events","none")])),this.yTransforms=Object.fromEntries(Object.entries(this.yElements).map(([t,i])=>[t,()=>lW(i.node())])),Object.entries(this.yScales).forEach(([t,i])=>{i.domain(this.plotAreas[t].extent())}),this.yZooms=Object.fromEntries(Object.keys(t).map(t=>[t,lQ()])),this.xElement.call(this.xZoom),Object.entries(this.plotAreaElements).forEach(([t,i])=>i.call(this.yZooms[t])),aZ(i.ref.current).select(".x-axis").on("measure",t=>{l1(t,this.xScale,this.xZoom,this.xTransform,this.xAxis,this.yAxes,this.plotAreas,this.dates,t=>{this.listeners.call("bounds_changed",this,t)})}).on("draw",t=>{l2(t,this.xAxis)}),aZ(i.ref.current).select(".x-axis-interaction").on("draw",t=>{this.xAxisInteraction.draw(aZ(t.currentTarget).select("svg"))}),Object.entries(this.yScales).map(([i,n])=>aZ(t[i].ref.current).select(".y-axis").on("measure",t=>{l6(t,n,this.yTransforms[i],this.plotAreas[i],this.plotAreaInteractions[i],this.plotAreaAnnotations[i],this.yAxes[i],this.isFreePan,i,this.resetYAxis.bind(this))}).on("draw",t=>{l9(t,this.yAxes[i])})),Object.entries(t).forEach(([t,i])=>aZ(i.ref.current).select(".y-axis-interaction").on("draw",i=>{this.yAxisInteractions[t].draw(aZ(i.currentTarget).select("svg"))})),Object.entries(t).forEach(([t,i])=>{let n=aZ(i.ref.current).select(".plot-area-annotations");aZ(i.ref.current).select(".plot-area").on("draw",i=>{l7(i,this.plotAreas[t]),this.plotAreaAnnotations[t].draw(n)})}),Object.entries(t).forEach(([t,i])=>{aZ(i.ref.current).select(".plot-area-interaction").on("draw",i=>{l4(i,this.plotAreaInteractions[t])})});let h=t.main.data[t.main.data.length-1].close;this.yAxes.main.latestPrice(h),this.plotAreas.main.latestPrice(h)}draw(){this.listeners.call("redraw")}interval(t){return this._interval=t,this.xAxis.interval(t),this.initialize(),this}on(t,i){return this.listeners.on(t,i),this}panBy(t){let i=this.xTransform().rescaleX(this.xScale);this.xElement.call(this.xZoom.translateBy,-(this.xScale(6e4*t5(this._interval,t))-this.xScale(0)),0),this.xAxis.xScale(i),Object.entries(this.plotAreas).forEach(([t,n])=>{n.xScale(i),this.isFreePan||hi(this.xTransform,this.xScale,this.yScales,t,this.plotAreas,this.yElements,this.yZooms)}),this.isPinned=!1,this.listeners.call("redraw"),this.listeners.call("bounds_changed",this,i.domain())}initialize(t){t||this.dates[this.dates.length-1],this.resetXAxis(),Object.keys(this.yAxes).map(t=>{this.resetYAxis(t)}),this.isPinned=!0,this.isFreePan=!1,this.listeners.call("redraw"),this.listeners.call("bounds_changed",this,this.xTransform().rescaleX(this.xScale).domain())}reset(){this.resetXAxis(),Object.keys(this.yAxes).map(t=>{this.resetYAxis(t)}),this.isPinned=!0,this.isFreePan=!1,this.listeners.call("redraw")}pinXAxis(){let t=((this.xScale.range()[1]-this.xScale.range()[0])/this.initialNumCandles)??10,i=this.xTransform().rescaleX(this.xScale),n=this.dates[this.dates.length-1],r=i.invert(i.range()[1]-hu(this.isSimple,t));if(1===function(t,i){tl(2,arguments);var n=th(t),r=th(i),s=n.getTime()-r.getTime();return s<0?-1:s>0?1:s}(n,r)){let t=i(n)-i(r);this.xElement.call(this.xZoom.translateBy,-t,0)}}resetXAxis(){let t=this.dates[this.dates.length-1],i=this.xScale.range()[1]-this.xScale.range()[0],n=(i/this.initialNumCandles)??10,r=i/(this.xScale.range()[1]-hu(this.isSimple,n)-this.xScale.range()[0]),s=new Date(t.getTime()-Math.abs(this.xScale.range()[1]-this.xScale.range()[0]-hu(this.isSimple,n))/n*6e4*t5(this._interval,1)),o=[s,new Date(t.getTime()+(t.getTime()-s.getTime())*(r-1))];this.xScale.domain(o),this.xElement.call(this.xZoom.transform,lZ)}resetYAxis(t){let i=this.plotAreas[t].extent(this.xTransform().rescaleX(this.xScale).domain());this.yScales[t].domain(i),this.yElements[t].call(this.yZooms[t].transform,lZ)}update(t,i){let n=Object.keys(this.plotAreas),r=Object.keys(t),s=rJ.difference(r,n),o=rJ.intersection(r,n);for(let a of rJ.union(n,r))if(o.includes(a))this.plotAreas[a].data(t[a].data).renderableElements(t[a].renderableElements).yEncodingFields(t[a].yEncodingFields).labels(t[a].labelLines),this.plotAreaAnnotations[a].labels(t[a].labels);else if(s.includes(a)){this.yScales[a]=oF(),this.yElements[a]=aZ(t[a].ref.current).select(".y-axis").style("pointer-events","none"),this.yAxes[a]=new hl(this.xTransform().rescaleX(this.xScale),this.yScales[a],"volume"===a?this._positionDecimalPlaces:this._decimalPlaces,this._colors),this.yAxisInteractions[a]=new hh().on("drag",t=>{l0(this.yElements[a],this.yZooms[a],t,this.yScales[a],this.yTransforms[a],this.plotAreas[a],this.yAxes[a],t=>{this.isFreePan=t},()=>this.listeners.call("redraw"))}).on("dblclick",()=>{this.resetYAxis(a),this.isFreePan=!1,this.listeners.call("redraw")}),this.plotAreas[a]=new hn(this.xTransform().rescaleX(this.xScale),this.yScales[a],t[a].renderableElements,t[a].data,t[a].yEncodingFields,t[a].labelLines,this.isSimple,this._colors),this.plotAreaInteractions[a]=new hs(this.xTransform().rescaleX(this.xScale),this.yScales[a]).on("zoom",(t,i,n)=>{he(this.xScale,this.yScales,this.xAxis,this.yAxes,this.xElement,this.xZoom,this.xTransform,this.yElements,this.yTransforms,this.yZooms,this.plotAreas,this.isPinned,this.isFreePan,this.isSimple,this.dates,i,n,a,t=>{this.listeners.call("bounds_changed",this,t)},()=>this.listeners.call("redraw"),(t,i)=>this.listeners.call("fetch_data",this,t,i),t=>{this.isPinned=t})}).on("zoomstart",()=>{l3(this.plotAreas,this.yAxes,this.xAxis)}).on("zoomend",t=>{l5(this.plotAreas,t,this.yTransforms[a]().rescaleY(this.yScales[a]),this.xAxis,this.yAxes[a],a,()=>this.listeners.call("redraw"))}).on("dblclick",()=>{this.reset(),this.listeners.call("dblclick",this)}).on("mousemove",t=>{ht(this.plotAreas,t,this.yTransforms[a]().rescaleY(this.yScales[a]),this.yAxes,this.xAxis,a,(t,i)=>this.listeners.call("mousemove",this,t,i),()=>this.listeners.call("redraw"))}).on("mouseout",()=>{l8(this.plotAreas,this.xAxis,this.yAxes,()=>this.listeners.call("mouseout",this),()=>this.listeners.call("redraw"))}).on("contextmenu",t=>{this.listeners.call("contextmenu",this,[t.pageX,t.pageY])}),this.plotAreaAnnotations[a]=new hr(this.xScale,this.yScales[a],t[a].labels);let n=this.xTransform().rescaleX(this.xScale).domain(),r=this.plotAreas[a].extent(n);this.yZooms[a]=lQ(),this.plotAreaElements[a]=aZ(t[a].ref.current),this.yTransforms[a]=()=>lW(this.yElements[a].node()),this.yScales[a].domain(r),this.yScales[a].range(),aZ(i.ref.current).select(".x-axis").on("measure",t=>{l1(t,this.xScale,this.xZoom,this.xTransform,this.xAxis,this.yAxes,this.plotAreas,this.dates,t=>{this.listeners.call("bounds_changed",this,t)})}).on("draw",t=>{l2(t,this.xAxis)}),aZ(t[a].ref.current).select(".y-axis").on("measure",t=>{l6(t,this.yScales[a],this.yTransforms[a],this.plotAreas[a],this.plotAreaInteractions[a],this.plotAreaAnnotations[a],this.yAxes[a],this.isFreePan,a,this.resetYAxis.bind(this))}).on("draw",t=>{l9(t,this.yAxes[a])}),aZ(t[a].ref.current).select(".y-axis-interaction").on("draw",t=>{this.yAxisInteractions[a].draw(aZ(t.currentTarget).select("svg"))}),aZ(t[a].ref.current).select(".plot-area").on("draw",i=>{l7(i,this.plotAreas[a]),this.plotAreaAnnotations[a].draw(aZ(t[a].ref.current).select(".plot-area-annotations"))}),aZ(t[a].ref.current).select(".plot-area-interaction").on("draw",t=>{l4(t,this.plotAreaInteractions[a])}),this.resetYAxis(a)}else this.yScales=rJ.omit(this.yScales,a),this.yAxes=rJ.omit(this.yAxes,a),this.yAxisInteractions=rJ.omit(this.yAxisInteractions,a),this.yElements=rJ.omit(this.yElements,a),this.yTransforms=rJ.omit(this.yTransforms,a),this.yZooms=rJ.omit(this.yZooms,a),this.plotAreas=rJ.omit(this.plotAreas,a),this.plotAreaInteractions=rJ.omit(this.plotAreaInteractions,a),this.plotAreaElements=rJ.omit(this.plotAreaElements,a);this.dates=i.data;let a=t.main.data[t.main.data.length-1].close;return this.yAxes.main.latestPrice(a),this.plotAreas.main.latestPrice(a),this.isPinned&&this.pinXAxis(),this}zoom(t){let i=this.xTransform().rescaleX(this.xScale);this.xElement.call(this.xZoom.scaleBy,2**t,[this.isPinned?this.xScale.range()[1]-hu(this.isSimple,10):(this.xScale.range()[0]+this.xScale.range()[1])/2,0]),this.xAxis.xScale(i),Object.entries(this.plotAreas).forEach(([t,n])=>{n.xScale(i),this.isFreePan||hi(this.xTransform,this.xScale,this.yScales,t,this.plotAreas,this.yElements,this.yZooms)}),this.listeners.call("redraw"),this.listeners.call("bounds_changed",this,i.domain())}zoomIn(t){this.zoom(t)}zoomOut(t){this.zoom(-t)}set colors(t){this._colors=t,Object.values(this.plotAreas).forEach(i=>{i.colors=t}),Object.values(this.yAxes).map(i=>{i.colors=t}),this.xAxis.colors=t,this.listeners.call("redraw")}}function hf(){return(hf=Object.assign?Object.assign.bind():function(t){for(var i=1;i=s?r:s)),r},hT="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},hP={};!function(t,i){var n="__lodash_hash_undefined__",r="[object Arguments]",s="[object Array]",o="[object Boolean]",a="[object Date]",l="[object Error]",h="[object Function]",u="[object Map]",c="[object Number]",f="[object Object]",d="[object Promise]",p="[object RegExp]",m="[object Set]",v="[object String]",g="[object WeakMap]",y="[object ArrayBuffer]",x="[object DataView]",w=/^\[object .+?Constructor\]$/,b=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[r]=_[s]=_[y]=_[o]=_[x]=_[a]=_[l]=_[h]=_[u]=_[c]=_[f]=_[p]=_[m]=_[v]=_[g]=!1;var S="object"==typeof hT&&hT&&hT.Object===Object&&hT,k="object"==typeof self&&self&&self.Object===Object&&self,T=S||k||Function("return this")(),P=i&&!i.nodeType&&i,M=P&&t&&!t.nodeType&&t,z=M&&M.exports===P,E=z&&S.process,A=function(){try{return E&&E.binding&&E.binding("util")}catch(t){}}(),C=A&&A.isTypedArray;function I(t){var i=-1,n=Array(t.size);return t.forEach(function(t,r){n[++i]=[r,t]}),n}function D(t){var i=-1,n=Array(t.size);return t.forEach(function(t){n[++i]=t}),n}var L,O,N,R=Array.prototype,F=Function.prototype,j=Object.prototype,V=T["__core-js_shared__"],B=F.toString,Y=j.hasOwnProperty,Z=(L=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"",W=j.toString,H=RegExp("^"+B.call(Y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),X=z?T.Buffer:void 0,U=T.Symbol,G=T.Uint8Array,$=j.propertyIsEnumerable,q=R.splice,K=U?U.toStringTag:void 0,J=Object.getOwnPropertySymbols,Q=X?X.isBuffer:void 0,tt=(O=Object.keys,N=Object,function(t){return O(N(t))}),te=tT(T,"DataView"),ti=tT(T,"Map"),tn=tT(T,"Promise"),tr=tT(T,"Set"),ts=tT(T,"WeakMap"),to=tT(Object,"create"),ta=tz(te),tl=tz(ti),th=tz(tn),tu=tz(tr),tc=tz(ts),tf=U?U.prototype:void 0,td=tf?tf.valueOf:void 0;function tp(t){var i=-1,n=null==t?0:t.length;for(this.clear();++il))return!1;var u=o.get(t);if(u&&o.get(i))return u==i;var c=-1,f=!0,d=2&n?new tg:void 0;for(o.set(t,i),o.set(i,t);++c-1&&n%1==0&&n-1},tm.prototype.set=function(t,i){var n=this.__data__,r=tx(n,t);return r<0?(++this.size,n.push([t,i])):n[r][1]=i,this},tv.prototype.clear=function(){this.size=0,this.__data__={hash:new tp,map:new(ti||tm),string:new tp}},tv.prototype.delete=function(t){var i=tk(this,t).delete(t);return this.size-=i?1:0,i},tv.prototype.get=function(t){return tk(this,t).get(t)},tv.prototype.has=function(t){return tk(this,t).has(t)},tv.prototype.set=function(t,i){var n=tk(this,t),r=n.size;return n.set(t,i),this.size+=n.size==r?0:1,this},tg.prototype.add=tg.prototype.push=function(t){return this.__data__.set(t,n),this},tg.prototype.has=function(t){return this.__data__.has(t)},ty.prototype.clear=function(){this.__data__=new tm,this.size=0},ty.prototype.delete=function(t){var i=this.__data__,n=i.delete(t);return this.size=i.size,n},ty.prototype.get=function(t){return this.__data__.get(t)},ty.prototype.has=function(t){return this.__data__.has(t)},ty.prototype.set=function(t,i){var n=this.__data__;if(n instanceof tm){var r=n.__data__;if(!ti||r.length<199)return r.push([t,i]),this.size=++n.size,this;n=this.__data__=new tv(r)}return n.set(t,i),this.size=n.size,this};var tP=J?function(t){return null==t?[]:function(t,i){for(var n=-1,r=null==t?0:t.length,s=0,o=[];++n-1&&t%1==0&&t<=9007199254740991}function tO(t){var i=typeof t;return null!=t&&("object"==i||"function"==i)}function tN(t){return null!=t&&"object"==typeof t}var tR=C?function(t){return C(t)}:function(t){return tN(t)&&tL(t.length)&&!!_[tw(t)]};t.exports=function(t,i){return function t(i,n,h,d,g){return i===n||(null!=i&&null!=n&&(tN(i)||tN(n))?function(t,i,n,h,d,g){var w=tC(t),b=tC(i),_=w?s:tM(t),S=b?s:tM(i),k=(_=_==r?f:_)==f,T=(S=S==r?f:S)==f,P=_==S;if(P&&tI(t)){if(!tI(i))return!1;w=!0,k=!1}if(P&&!k)return g||(g=new ty),w||tR(t)?t_(t,i,n,h,d,g):function(t,i,n,r,s,h,f){switch(n){case x:if(t.byteLength!=i.byteLength||t.byteOffset!=i.byteOffset)break;t=t.buffer,i=i.buffer;case y:return!(t.byteLength!=i.byteLength||!h(new G(t),new G(i)));case o:case a:case c:return tE(+t,+i);case l:return t.name==i.name&&t.message==i.message;case p:case v:return t==i+"";case u:var d=I;case m:var g=1&r;if(d||(d=D),t.size!=i.size&&!g)break;var w=f.get(t);if(w)return w==i;r|=2,f.set(t,i);var b=t_(d(t),d(i),r,s,h,f);return f.delete(t),b;case"[object Symbol]":if(td)return td.call(t)==td.call(i)}return!1}(t,i,_,n,h,d,g);if(!(1&n)){var M=k&&Y.call(t,"__wrapped__"),z=T&&Y.call(i,"__wrapped__");if(M||z){var E=M?t.value():t,A=z?i.value():i;return g||(g=new ty),d(E,A,n,h,g)}}return!!P&&(g||(g=new ty),function(t,i,n,r,s,o){var a=1&n,l=tS(t),h=l.length;if(h!=tS(i).length&&!a)return!1;for(var u=h;u--;){var c=l[u];if(!(a?c in i:Y.call(i,c)))return!1}var f=o.get(t);if(f&&o.get(i))return f==i;var d=!0;o.set(t,i),o.set(i,t);for(var p=a;++u=0,hC=(hA.indexOf("Macintosh")>=0||hA.indexOf("iPad")>=0||hA.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0);let hD=hC,hL=hI,hO="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?h.useLayoutEffect:h.useEffect;class hN{constructor(){this._size=void 0}getSize(){return this._size}setSize(t){this._size=t}}function hR(t,i){let n=t.length,r=n-i.length;return r>=0&&t.slice(r,n)===i}var hF={};function hj(t,i){let n=t.indexOf(i);n>-1&&(t.splice(n,1),t.unshift(i))}function hV(t,i){let n=t.indexOf(i);n>-1&&(t.splice(n,1),t.push(i))}function hB(t,i,n=1){let r=Math.max(0,Math.ceil((i-t)/n)),s=Array(r),o=-1;for(;++o=i||n<0||f&&t-u>=o}function v(){var t,n=hQ();if(m(n))return g(n);l=setTimeout(v,(t=i-(n-h),f?hJ(t,o-(n-u)):t))}function g(t){return l=void 0,d&&r?p(t):(r=s=void 0,a)}function y(){var t,n=hQ(),o=m(n);if(r=arguments,s=this,h=n,o){if(void 0===l)return u=t=h,l=setTimeout(v,i),c?p(t):a;if(f)return l=setTimeout(v,i),p(h)}return void 0===l&&(l=setTimeout(v,i)),a}return i=h1(i)||0,h0(n)&&(c=!!n.leading,o=(f="maxWait"in n)?hK(h1(n.maxWait)||0,i):o,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==l&&clearTimeout(l),u=0,r=h=s=l=void 0},y.flush=function(){return void 0===l?a:g(hQ())},y},h5="sash-module_vertical__pB-rs",h3="sash-module_horizontal__kFbiw",h6="sash-module_hover__80W6I",h4="sash-module_active__bJspD";let h7=((a={}).Vertical="VERTICAL",a.Horizontal="HORIZONTAL",a),h9=((s={}).Disabled="DISABLED",s.Minimum="MINIMUM",s.Maximum="MAXIMUM",s.Enabled="ENABLED",s),h8=hD?20:8,ut=new hF;class ue extends hF{get state(){return this._state}set state(t){this._state!==t&&(this.el.classList.toggle("sash-module_disabled__Hm-wx",t===h9.Disabled),this.el.classList.toggle("dash-disabled",t===h9.Disabled),this.el.classList.toggle("sash-module_minimum__-UKxp",t===h9.Minimum),this.el.classList.toggle("sash-minimum",t===h9.Minimum),this.el.classList.toggle("sash-module_maximum__TCWxD",t===h9.Maximum),this.el.classList.toggle("sash-maximum",t===h9.Maximum),this._state=t,this.emit("enablementChange",t))}constructor(t,i,n){var r;super(),this.el=void 0,this.layoutProvider=void 0,this.orientation=void 0,this.size=void 0,this.hoverDelay=300,this.hoverDelayer=h2(t=>t.classList.add("sash-hover",h6),this.hoverDelay),this._state=h9.Enabled,this.onPointerStart=t=>{let i=t.pageX,n=t.pageY;this.el.classList.add("sash-active",h4),this.emit("start",{startX:i,currentX:i,startY:n,currentY:n}),this.el.setPointerCapture(t.pointerId);let r=t=>{t.preventDefault();let r={startX:i,currentX:t.pageX,startY:n,currentY:t.pageY};this.emit("change",r)},s=t=>{t.preventDefault(),this.el.classList.remove("sash-active",h4),this.hoverDelayer.cancel(),this.emit("end"),this.el.releasePointerCapture(t.pointerId),window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",s)};window.addEventListener("pointermove",r),window.addEventListener("pointerup",s)},this.onPointerDoublePress=()=>{this.emit("reset")},this.onMouseEnter=()=>{this.el.classList.contains(h4)?(this.hoverDelayer.cancel(),this.el.classList.add("sash-hover",h6)):this.hoverDelayer(this.el)},this.onMouseLeave=()=>{this.hoverDelayer.cancel(),this.el.classList.remove("sash-hover",h6)},this.el=document.createElement("div"),this.el.classList.add("sash","sash-module_sash__K-9lB"),this.el.dataset.testid="sash",t.append(this.el),hL&&this.el.classList.add("sash-mac","sash-module_mac__Jf6OJ"),this.el.addEventListener("pointerdown",this.onPointerStart),this.el.addEventListener("dblclick",this.onPointerDoublePress),this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseleave",this.onMouseLeave),"number"==typeof n.size?(this.size=n.size,n.orientation===h7.Vertical?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=h8,ut.on("onDidChangeGlobalSize",t=>{this.size=t,this.layout()})),this.layoutProvider=i,this.orientation=null!=(r=n.orientation)?r:h7.Vertical,this.orientation===h7.Horizontal?(this.el.classList.add("sash-horizontal",h3),this.el.classList.remove("sash-vertical",h5)):(this.el.classList.remove("sash-horizontal",h3),this.el.classList.add("sash-vertical",h5)),this.layout()}layout(){if(this.orientation===h7.Vertical){let t=this.layoutProvider;this.el.style.left=t.getVerticalSashLeft(this)-this.size/2+"px",t.getVerticalSashTop&&(this.el.style.top=t.getVerticalSashTop(this)+"px"),t.getVerticalSashHeight&&(this.el.style.height=t.getVerticalSashHeight(this)+"px")}else{let t=this.layoutProvider;this.el.style.top=t.getHorizontalSashTop(this)-this.size/2+"px",t.getHorizontalSashLeft&&(this.el.style.left=t.getHorizontalSashLeft(this)+"px"),t.getHorizontalSashWidth&&(this.el.style.width=t.getHorizontalSashWidth(this)+"px")}}dispose(){this.el.removeEventListener("pointerdown",this.onPointerStart),this.el.removeEventListener("dblclick",this.onPointerDoublePress),this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseleave",()=>this.onMouseLeave),this.el.remove()}}(l=r||(r={})).Distribute={type:"distribute"},l.Split=function(t){return{type:"split",index:t}},l.Invisible=function(t){return{type:"invisible",cachedVisibleSize:t}};let ui=((o={}).Normal="NORMAL",o.Low="LOW",o.High="HIGH",o);class un{constructor(t,i,n){this.container=void 0,this.view=void 0,this._size=void 0,this._cachedVisibleSize=void 0,this.container=t,this.view=i,this.container.classList.add("split-view-view",hE),this.container.dataset.testid="split-view-view","number"==typeof n?(this._size=n,this._cachedVisibleSize=void 0,t.classList.add("split-view-view-visible")):(this._size=0,this._cachedVisibleSize=n.cachedVisibleSize)}set size(t){this._size=t}get size(){return this._size}get priority(){return this.view.priority}get snap(){return!!this.view.snap}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return void 0===this._cachedVisibleSize}setVisible(t,i){t!==this.visible&&(t?(this.size=hk(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof i?i:this.size,this.size=0),this.container.classList.toggle("split-view-view-visible",t),this.view.setVisible&&this.view.setVisible(t))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}set enabled(t){this.container.style.pointerEvents=t?"":"none"}layout(t){this.layoutContainer(t),this.view.layout(this.size,t)}}class ur extends un{layoutContainer(t){this.container.style.left=`${t}px`,this.container.style.width=`${this.size}px`}}class us extends un{layoutContainer(t){this.container.style.top=`${t}px`,this.container.style.height=`${this.size}px`}}class uo extends hF{get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(t){this._startSnappingEnabled!==t&&(this._startSnappingEnabled=t,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(t){this._endSnappingEnabled!==t&&(this._endSnappingEnabled=t,this.updateSashEnablement())}constructor(t,i={},n,r,s){var o,a;if(super(),this.onDidChange=void 0,this.onDidDragStart=void 0,this.onDidDragEnd=void 0,this.orientation=void 0,this.sashContainer=void 0,this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.sashDragState=void 0,this.proportionalLayout=void 0,this.getSashOrthogonalSize=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onSashEnd=t=>{for(let i of(this.emit("sashchange",t),this.saveProportions(),this.viewItems))i.enabled=!0},this.orientation=null!=(o=i.orientation)?o:h7.Vertical,this.proportionalLayout=null==(a=i.proportionalLayout)||a,this.getSashOrthogonalSize=i.getSashOrthogonalSize,n&&(this.onDidChange=n),r&&(this.onDidDragStart=r),s&&(this.onDidDragEnd=s),this.sashContainer=document.createElement("div"),this.sashContainer.classList.add("sash-container","allotment-module_sashContainer__fzwJF"),t.prepend(this.sashContainer),i.descriptor){for(let[t,n]of(this.size=i.descriptor.size,i.descriptor.views.entries())){let i=n.size,r=n.container,s=n.view;this.addView(r,s,i,t,!0)}this.contentSize=this.viewItems.reduce((t,i)=>t+i.size,0),this.saveProportions()}}addView(t,i,n,r=this.viewItems.length,s){let o;o="number"==typeof n?n:"split"===n.type?this.getViewSize(n.index)/2:"invisible"===n.type?{cachedVisibleSize:n.cachedVisibleSize}:i.minimumSize;let a=this.orientation===h7.Vertical?new us(t,i,o):new ur(t,i,o);if(this.viewItems.splice(r,0,a),this.viewItems.length>1){let t=this.orientation===h7.Vertical?new ue(this.sashContainer,{getHorizontalSashTop:t=>this.getSashPosition(t),getHorizontalSashWidth:this.getSashOrthogonalSize},{orientation:h7.Horizontal}):new ue(this.sashContainer,{getVerticalSashLeft:t=>this.getSashPosition(t),getVerticalSashHeight:this.getSashOrthogonalSize},{orientation:h7.Vertical}),i=this.orientation===h7.Vertical?i=>({sash:t,start:i.startY,current:i.currentY}):i=>({sash:t,start:i.startX,current:i.currentX});t.on("start",t=>{var n;this.emit("sashDragStart"),this.onSashStart(i(t));let r=this.viewItems.map(t=>t.size);null==(n=this.onDidDragStart)||n.call(this,r)}),t.on("change",t=>this.onSashChange(i(t))),t.on("end",()=>{var i;this.emit("sashDragEnd"),this.onSashEnd(this.sashItems.findIndex(i=>i.sash===t));let n=this.viewItems.map(t=>t.size);null==(i=this.onDidDragEnd)||i.call(this,n)}),t.on("reset",()=>{let i=this.sashItems.findIndex(i=>i.sash===t),n=hB(i,-1,-1),r=hB(i+1,this.viewItems.length),s=this.findFirstSnapIndex(n),o=this.findFirstSnapIndex(r);("number"!=typeof s||this.viewItems[s].visible)&&("number"!=typeof o||this.viewItems[o].visible)&&this.emit("sashreset",i)}),this.sashItems.splice(r-1,0,{sash:t})}s||this.relayout(),s||"number"==typeof n||"distribute"!==n.type||this.distributeViewSizes()}removeView(t,i){if(t<0||t>=this.viewItems.length)throw Error("Index out of bounds");let n=this.viewItems.splice(t,1)[0].view;return this.viewItems.length>=1&&this.sashItems.splice(Math.max(t-1,0),1)[0].sash.dispose(),this.relayout(),i&&"distribute"===i.type&&this.distributeViewSizes(),n}moveView(t,i,n){let s=this.getViewCachedVisibleSize(i),o=void 0===s?this.getViewSize(i):r.Invisible(s),a=this.removeView(i);this.addView(t,a,o,n)}getViewCachedVisibleSize(t){if(t<0||t>=this.viewItems.length)throw Error("Index out of bounds");return this.viewItems[t].cachedVisibleSize}layout(t=this.size){let i=Math.max(this.size,this.contentSize);if(this.size=t,this.proportions)for(let i=0;ithis.viewItems[t].priority===ui.Low),s=n.filter(t=>this.viewItems[t].priority===ui.High);this.resize(this.viewItems.length-1,t-i,void 0,r,s)}this.distributeEmptySpace(),this.layoutViews()}resizeView(t,i){if(t<0||t>=this.viewItems.length)return;let n=hB(0,this.viewItems.length).filter(i=>i!==t),r=[...n.filter(t=>this.viewItems[t].priority===ui.Low),t],s=n.filter(t=>this.viewItems[t].priority===ui.High),o=this.viewItems[t];i=hk(i=Math.round(i),o.minimumSize,Math.min(o.maximumSize,this.size)),o.size=i,this.relayout(r,s)}resizeViews(t){for(let i=0;it+i.size,0),this.saveProportions(),this.layout(this.size)}getViewSize(t){return t<0||t>=this.viewItems.length?-1:this.viewItems[t].size}isViewVisible(t){if(t<0||t>=this.viewItems.length)throw Error("Index out of bounds");return this.viewItems[t].visible}setViewVisible(t,i){if(t<0||t>=this.viewItems.length)throw Error("Index out of bounds");this.viewItems[t].setVisible(i),this.distributeEmptySpace(t),this.layoutViews(),this.saveProportions()}distributeViewSizes(){let t=[],i=0;for(let n of this.viewItems)n.maximumSize-n.minimumSize>0&&(t.push(n),i+=n.size);let n=Math.floor(i/t.length);for(let i of t)i.size=hk(n,i.minimumSize,i.maximumSize);let r=hB(0,this.viewItems.length),s=r.filter(t=>this.viewItems[t].priority===ui.Low),o=r.filter(t=>this.viewItems[t].priority===ui.High);this.relayout(s,o)}dispose(){this.sashItems.forEach(t=>t.sash.dispose()),this.sashItems=[],this.sashContainer.remove()}relayout(t,i){let n=this.viewItems.reduce((t,i)=>t+i.size,0);this.resize(this.viewItems.length-1,this.size-n,void 0,t,i),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}onSashStart({sash:t,start:i}){let n=this.sashItems.findIndex(i=>i.sash===t);(t=>{let i=this.viewItems.map(t=>t.size),r,s,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l=hB(n,-1,-1),h=hB(n+1,this.viewItems.length),u=l.reduce((t,n)=>t+(this.viewItems[n].minimumSize-i[n]),0),c=l.reduce((t,n)=>t+(this.viewItems[n].viewMaximumSize-i[n]),0),f=0===h.length?Number.POSITIVE_INFINITY:h.reduce((t,n)=>t+(i[n]-this.viewItems[n].minimumSize),0),d=0===h.length?Number.NEGATIVE_INFINITY:h.reduce((t,n)=>t+(i[n]-this.viewItems[n].viewMaximumSize),0);o=Math.max(u,d),a=Math.min(f,c);let p=this.findFirstSnapIndex(l),m=this.findFirstSnapIndex(h);if("number"==typeof p){let t=this.viewItems[p],i=Math.floor(t.viewMinimumSize/2);r={index:p,limitDelta:t.visible?o-i:o+i,size:t.size}}if("number"==typeof m){let t=this.viewItems[m],i=Math.floor(t.viewMinimumSize/2);s={index:m,limitDelta:t.visible?a+i:a-i,size:t.size}}this.sashDragState={start:t,current:t,index:n,sizes:i,minDelta:o,maxDelta:a,snapBefore:r,snapAfter:s}})(i)}onSashChange({current:t}){let{index:i,start:n,sizes:r,minDelta:s,maxDelta:o,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=t,this.resize(i,t-n,r,void 0,void 0,s,o,a,l),this.distributeEmptySpace(),this.layoutViews()}getSashPosition(t){let i=0;for(let n=0;nt.size),r,s,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,h){if(t<0||t>=this.viewItems.length)return 0;let u=hB(t,-1,-1),c=hB(t+1,this.viewItems.length);if(s)for(let t of s)hj(u,t),hj(c,t);if(r)for(let t of r)hV(u,t),hV(c,t);let f=u.map(t=>this.viewItems[t]),d=u.map(t=>n[t]),p=c.map(t=>this.viewItems[t]),m=c.map(t=>n[t]),v=u.reduce((t,i)=>t+(this.viewItems[i].minimumSize-n[i]),0),g=u.reduce((t,i)=>t+(this.viewItems[i].maximumSize-n[i]),0),y=0===c.length?Number.POSITIVE_INFINITY:c.reduce((t,i)=>t+(n[i]-this.viewItems[i].minimumSize),0),x=0===c.length?Number.NEGATIVE_INFINITY:c.reduce((t,i)=>t+(n[i]-this.viewItems[i].maximumSize),0),w=!1;if(l){let t=this.viewItems[l.index],n=i>=l.limitDelta;w=n!==t.visible,t.setVisible(n,l.size)}if(!w&&h){let t=this.viewItems[h.index],n=it+i.size,0),n=this.size-i,r=hB(this.viewItems.length-1,-1,-1);"number"==typeof t&&hV(r,t);for(let t=0;0!==n&&tt+i.size,0);let i=0;for(let t of this.viewItems)t.layout(i),i+=t.size;null!=(t=this.onDidChange)&&t.call(this,this.viewItems.map(t=>t.size)),this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(t=>t.size/this.contentSize))}updateSashEnablement(){let t=!1,i=this.viewItems.map(i=>t=i.size-i.minimumSize>0||t);t=!1;let n=this.viewItems.map(i=>t=i.maximumSize-i.size>0||t),r=[...this.viewItems].reverse();t=!1;let s=r.map(i=>t=i.size-i.minimumSize>0||t).reverse();t=!1;let o=r.map(i=>t=i.maximumSize-i.size>0||t).reverse(),a=0;for(let t=0;t0||this.startSnappingEnabled)?r.state=h9.Minimum:c&&i[t]&&(a0)return;if(!t.visible&&t.snap)return i}}}class ua{constructor(t){this.size=void 0,this.size=t}getPreferredSize(){return this.size}}class ul{constructor(t,i){this.proportion=void 0,this.layoutService=void 0,this.proportion=t,this.layoutService=i}getPreferredSize(){return this.proportion*this.layoutService.getSize()}}class uh{getPreferredSize(){}}class uu{get preferredSize(){return this.layoutStrategy.getPreferredSize()}set preferredSize(t){if("number"==typeof t)this.layoutStrategy=new ua(t);else if("string"==typeof t){let i=t.trim();if(hR(i,"%")){let t=Number(i.slice(0,-1))/100;this.layoutStrategy=new ul(t,this.layoutService)}else if(hR(i,"px")){let t=Number(i.slice(0,-2))/100;this.layoutStrategy=new ua(t)}else if("number"==typeof Number.parseFloat(i)){let t=Number.parseFloat(i);this.layoutStrategy=new ua(t)}else this.layoutStrategy=new uh}else this.layoutStrategy=new uh}constructor(t,i){var n;if(this.minimumSize=0,this.maximumSize=Number.POSITIVE_INFINITY,this.element=void 0,this.priority=void 0,this.snap=void 0,this.layoutService=void 0,this.layoutStrategy=void 0,this.layoutService=t,this.element=i.element,this.minimumSize="number"==typeof i.minimumSize?i.minimumSize:30,this.maximumSize="number"==typeof i.maximumSize?i.maximumSize:Number.POSITIVE_INFINITY,"number"==typeof i.preferredSize)this.layoutStrategy=new ua(i.preferredSize);else if("string"==typeof i.preferredSize){let t=i.preferredSize.trim();if(hR(t,"%")){let i=Number(t.slice(0,-1))/100;this.layoutStrategy=new ul(i,this.layoutService)}else if(hR(t,"px")){let i=Number(t.slice(0,-2));this.layoutStrategy=new ua(i)}else if("number"==typeof Number.parseFloat(t)){let i=Number.parseFloat(t);this.layoutStrategy=new ua(i)}else this.layoutStrategy=new uh}else this.layoutStrategy=new uh;this.priority=null!=(n=i.priority)?n:ui.Normal,this.snap="boolean"==typeof i.snap&&i.snap}layout(t){}}function uc(t){return void 0!==t.minSize||void 0!==t.maxSize||void 0!==t.preferredSize||void 0!==t.priority||void 0!==t.visible}let uf=h.forwardRef(({className:t,children:i},n)=>h.createElement("div",{ref:n,className:hm("split-view-view",hE,t)},i));uf.displayName="Allotment.Pane";let ud=h.forwardRef(({children:t,className:i,maxSize:n=1/0,minSize:s=30,proportionalLayout:o=!0,separator:a=!0,sizes:l,defaultSizes:u=l,snap:c=!1,vertical:f=!1,onChange:d,onReset:p,onVisibleChange:m,onDragStart:v,onDragEnd:g},y)=>{var x,w,b,_,S,k,T,P,M,z,E,A,C,I,D,L,O;let N=h.useRef(null),R=h.useRef([]),F=h.useRef(new Map),j=h.useRef(null),V=h.useRef(new Map),B=h.useRef(new hN),Y=h.useRef([]),[Z,W]=h.useState(!1),H=h.useMemo(()=>h.Children.toArray(t).filter(h.isValidElement),[t]),X=h.useCallback(t=>{var i,n;let r=null==(i=Y.current)?void 0:i[t];return"number"==typeof(null==r?void 0:r.preferredSize)&&(null!=(n=j.current)&&n.resizeView(t,Math.round(r.preferredSize)),!0)},[]);return h.useImperativeHandle(y,()=>({reset:()=>{if(p)p();else{var t;null==(t=j.current)||t.distributeViewSizes();for(let t=0;t{var i;null==(i=j.current)||i.resizeViews(t)}})),hO(()=>{let t=!0;u&&V.current.size!==u.length&&(t=!1,console.warn(`Expected ${u.length} children based on defaultSizes but found ${V.current.size}`)),t&&u&&(R.current=H.map(t=>t.key));let i=hf({orientation:f?h7.Vertical:h7.Horizontal,proportionalLayout:o},t&&u&&{descriptor:{size:u.reduce((t,i)=>t+i,0),views:u.map((t,i)=>{var r,o,a,l;let h=F.current.get(R.current[i]),u=new uu(B.current,hf({element:document.createElement("div"),minimumSize:null!=(r=null==h?void 0:h.minSize)?r:s,maximumSize:null!=(o=null==h?void 0:h.maxSize)?o:n,priority:null!=(a=null==h?void 0:h.priority)?a:ui.Normal},(null==h?void 0:h.preferredSize)&&{preferredSize:null==h?void 0:h.preferredSize},{snap:null!=(l=null==h?void 0:h.snap)?l:c}));return Y.current.push(u),{container:[...V.current.values()][i],size:t,view:u}})}});j.current=new uo(N.current,i,d,v,g),j.current.on("sashDragStart",()=>{var t;null==(t=N.current)||t.classList.add("split-view-sash-dragging")}),j.current.on("sashDragEnd",()=>{var t;null==(t=N.current)||t.classList.remove("split-view-sash-dragging")}),j.current.on("sashchange",t=>{if(m&&j.current){let t=H.map(t=>t.key);for(let i=0;i{if(p)p();else{var i;if(X(t)||X(t+1))return;null==(i=j.current)||i.distributeViewSizes()}});let r=j.current;return()=>{r.dispose()}},[]),hO(()=>{if(Z){var t,i,o,a,l,h,u,f,d,p,m;let v=H.map(t=>t.key),g=[...R.current],y=v.filter(t=>!R.current.includes(t)),x=v.filter(t=>R.current.includes(t)),w=R.current.map(t=>!v.includes(t));for(let i=w.length-1;i>=0;i--)w[i]&&(null!=(t=j.current)&&t.removeView(i),g.splice(i,1),Y.current.splice(i,1));for(let t of y){let u=F.current.get(t),f=new uu(B.current,hf({element:document.createElement("div"),minimumSize:null!=(i=null==u?void 0:u.minSize)?i:s,maximumSize:null!=(o=null==u?void 0:u.maxSize)?o:n,priority:null!=(a=null==u?void 0:u.priority)?a:ui.Normal},(null==u?void 0:u.preferredSize)&&{preferredSize:null==u?void 0:u.preferredSize},{snap:null!=(l=null==u?void 0:u.snap)?l:c}));null!=(h=j.current)&&h.addView(V.current.get(t),f,r.Distribute,v.findIndex(i=>i===t)),g.splice(v.findIndex(i=>i===t),0,t),Y.current.splice(v.findIndex(i=>i===t),0,f)}for(;!hM(v,g);)for(let[t,i]of v.entries()){let n=g.findIndex(t=>t===i);if(n!==t){null==(u=j.current)||u.moveView(V.current.get(i),n,t);let r=g[n];g.splice(n,1),g.splice(t,0,r);break}}for(let t of y){let i=v.findIndex(i=>i===t),n=Y.current[i].preferredSize;void 0!==n&&(null==(f=j.current)||f.resizeView(i,n))}for(let t of[...y,...x]){let i=F.current.get(t),n=v.findIndex(i=>i===t);i&&uc(i)&&void 0!==i.visible&&(null==(d=j.current)?void 0:d.isViewVisible(n))!==i.visible&&(null==(p=j.current)||p.setViewVisible(n,i.visible))}for(let t of x){let i=F.current.get(t),n=v.findIndex(i=>i===t);if(i&&uc(i)){void 0!==i.preferredSize&&Y.current[n].preferredSize!==i.preferredSize&&(Y.current[n].preferredSize=i.preferredSize);let t=!1;void 0!==i.minSize&&Y.current[n].minimumSize!==i.minSize&&(Y.current[n].minimumSize=i.minSize,t=!0),void 0!==i.maxSize&&Y.current[n].maximumSize!==i.maxSize&&(Y.current[n].maximumSize=i.maxSize,t=!0),t&&(null==(m=j.current)||m.layout())}}(y.length>0||w.length>0)&&(R.current=v)}},[H,Z,n,s,c]),h.useEffect(()=>{j.current&&(j.current.onDidChange=d)},[d]),h.useEffect(()=>{j.current&&(j.current.onDidDragStart=v)},[v]),h.useEffect(()=>{j.current&&(j.current.onDidDragEnd=g)},[g]),w=(x={ref:N,onResize:({width:t,height:i})=>{var n;t&&i&&(null!=(n=j.current)&&n.layout(f?i:t),B.current.setSize(f?i:t),W(!0))}}).onResize,(b=h.useRef(void 0)).current=w,_=x.round||Math.round,S=h.useRef(),T=(k=h.useState({width:void 0,height:void 0}))[0],P=k[1],M=h.useRef(!1),h.useEffect(function(){return M.current=!1,function(){M.current=!0}},[]),L=h.useRef({width:void 0,height:void 0}),z=h.useCallback(function(t){return S.current&&S.current.box===x.box&&S.current.round===_||(S.current={box:x.box,round:_,instance:new ResizeObserver(function(t){var i=t[0],n="border-box"===x.box?"borderBoxSize":"device-pixel-content-box"===x.box?"devicePixelContentBoxSize":"contentBoxSize",r=hz(i,n,"inlineSize"),s=hz(i,n,"blockSize"),o=r?_(r):void 0,a=s?_(s):void 0;if(L.current.width!==o||L.current.height!==a){var l={width:o,height:a};L.current.width=o,L.current.height=a,b.current?b.current(l):M.current||P(l)}})}),S.current.instance.observe(t,{box:x.box}),function(){S.current&&S.current.instance.unobserve(t)}},[x.box,_]),E=x.ref,A=h.useRef(null),(C=h.useRef(null)).current=E,I=h.useRef(null),h.useEffect(function(){D()}),D=h.useCallback(function(){var t=I.current,i=C.current,n=t||(i?i instanceof Element?i:i.current:null);A.current&&A.current.element===n&&A.current.subscriber===z||(A.current&&A.current.cleanup&&A.current.cleanup(),A.current={element:n,subscriber:z,cleanup:n?z(n):void 0})},[z]),h.useEffect(function(){return function(){A.current&&A.current.cleanup&&(A.current.cleanup(),A.current=null)}},[]),O=h.useCallback(function(t){I.current=t,D()},[D]),h.useMemo(function(){return{ref:O,width:T.width,height:T.height}},[O,T.width,T.height]),hO(()=>{if(!Z){var t;let{height:i,width:n}=N.current.getBoundingClientRect();null!=(t=j.current)&&t.layout(f?i:n),B.current.setSize(f?i:n),W(!0)}},[Z,f]),h.useEffect(()=>{hD&&function(t){let i=hk(t,4,20),n=hk(t,1,8);document.documentElement.style.setProperty("--sash-size",i+"px"),document.documentElement.style.setProperty("--sash-hover-size",n+"px"),h8=i,ut.emit("onDidChangeGlobalSize",i)}(20)},[]),h.createElement("div",{ref:N,className:hm("split-view",f?"split-view-vertical":"split-view-horizontal",{"split-view-separator-border":a},"allotment-module_splitView__L-yRc",f?"allotment-module_vertical__WSwwa":"allotment-module_horizontal__7doS8",{"allotment-module_separatorBorder__x-rDS":a},i)},h.createElement("div",{className:hm("split-view-container","allotment-module_splitViewContainer__rQnVa")},h.Children.toArray(t).map(t=>{if(!h.isValidElement(t))return null;let i=t.key;return"Allotment.Pane"===t.type.displayName?(F.current.set(i,t.props),h.cloneElement(t,{key:i,ref:t=>{t?V.current.set(i,t):V.current.delete(i)}})):h.createElement(uf,{key:i,ref:t=>{t?V.current.set(i,t):V.current.delete(i)}},t)})))});ud.displayName="Allotment";var up=Object.assign(ud,{Pane:uf});let um=h.forwardRef(({scenegraph:t,interval:i,initialViewport:n,decimalPlaces:r,positionDecimalPlaces:s,priceMonitoringBounds:o,overlays:a,simple:l,initialNumCandles:u,colors:c,studySize:f,studySizes:d,drawThrottleMs:p,onViewportChanged:m=()=>{},onBoundsChanged:v=()=>{},onRightClick:g=()=>{},onGetDataRange:y=()=>{},onClosePane:x,onChangePane:w,onRemoveOverlay:b},_)=>{h.useImperativeHandle(_,()=>({panBy:t=>{j.current?.panBy(t)},reset:()=>{j.current?.reset()},snapshot:async()=>k(),zoomIn:t=>{j.current?.zoomIn(t)},zoomOut:t=>{j.current?.zoomOut(t)}}));let S=h.useMemo(()=>rJ.throttle(y,800),[y]),k=h.useCallback(()=>rY(E),[]),[T,P]=h.useState(null),[M,z]=h.useState(null),E=h.useRef(null),A=h.useRef(null),C=h.useRef(null),I=h.useCallback(()=>{E.current?.requestRedraw()},[]),D=h.useMemo(()=>rJ.throttle(I,p),[I]),L=h.useCallback(t=>{P(t),v?.(t)},[v]),O=h.useMemo(()=>rJ.throttle(L,p),[L]),N=h.useMemo(()=>rJ.throttle(z,p),[]),R=h.useMemo(()=>rJ.throttle(m,p),[m]),F=h.useMemo(()=>t.panes.map(t=>t.id).reduce((t,i)=>(t[i]=h.createRef(),t),{}),[t.panes]),j=h.useRef(null);h.useEffect(()=>{j.current=new hc(Object.fromEntries(t.panes.map(t=>[t.id,{id:String(t.id),ref:F[t.id],data:t.originalData,renderableElements:t.renderableElements.flat(1),yEncodingFields:t.yEncodingFields,labels:t.labels??[],labelLines:t.labelLines??[]}])),{ref:A,data:t.panes[0].originalData.map(t=>t.date)},n,r,s,l,u,c).interval(i).on("redraw",()=>{D()}).on("bounds_changed",t=>{O(t)}).on("viewport_changed",t=>{R(t)}).on("mousemove",(t,i)=>{N(t)}).on("mouseout",()=>{N(null)}).on("fetch_data",(t,n)=>{S(t,n,i)}).on("contextmenu",t=>{g(t)}),D(),requestAnimationFrame(()=>j.current?.initialize(n))},[]),h.useEffect(()=>{j.current&&j.current.interval(i).on("fetch_data",(t,n)=>{S(t,n,i)})},[i,S]),h.useEffect(()=>{j.current&&(j.current.update(Object.fromEntries(t.panes.map(t=>[t.id,{id:String(t.id),ref:F[t.id],data:t.originalData,renderableElements:t.renderableElements.flat(1),yEncodingFields:t.yEncodingFields,labels:t.labels??[],labelLines:t.labelLines??[]}])),{ref:A,data:t.panes[0].originalData.map(t=>t.date)}),D())},[j,F,t.panes,D]),h.useEffect(()=>{j.current&&j.current.interval(i)},[i]),h.useEffect(()=>{j.current&&(j.current.colors=c)},[c]);let V=t.panes.length;return h.useEffect(()=>{C.current.reset()},[V,f]),tq.jsxs("d3fc-group",{ref:E,class:"plot-container__chart",children:[tq.jsx(up,{ref:C,minSize:20,vertical:!0,proportionalLayout:!1,onChange:t=>{D(),w(t)},children:t.panes.map((t,i)=>{let n=0===i,h=function(t,i,n,r){if(r)return"100%";if(void 0!==t)return t;if("string"!=typeof i)return i;{let t=i.trim();if(t.endsWith("%")){let i=1/(Number(t.slice(0,-1))/100);return(1-i/(i+(n-1)))/Math.max(n-1,1)*100+"%"}if(t.endsWith("px"))return Number(t.slice(0,-2));if("number"==typeof Number.parseFloat(t))return Number.parseFloat(t)}}(n?void 0:d[i-1],f,V,n);return tq.jsx(up.Pane,{preferredSize:h,priority:n?ui.High:ui.Low,children:tq.jsx(sl,{ref:F[t.id],bounds:T,colors:c,dataIndex:M,decimalPlaces:r,positionDecimalPlaces:s,priceMonitoringBounds:o,overlays:a,pane:t,simple:l,onClosePane:x,onRemoveOverlay:b})},t.id)})}),tq.jsx(ug,{ref:A,simple:l})]})}),uv=({label:t,series:i})=>tq.jsxs("div",{className:"tooltip-module_tooltip__J6uoz",children:[tq.jsxs("div",{className:"tooltip-module_date__EuGqu",children:[t.primary?tq.jsx("div",{className:"tooltip-module_primary__1Eadh",children:t.primary}):null,t.sub?tq.jsx("div",{className:"tooltip-module_sub__7Bg6X",children:t.sub}):null]}),i.map(t=>tq.jsxs("div",{className:"tooltip-module_series__-bQAW",children:[tq.jsxs("div",{children:[tq.jsx("div",{className:"tooltip-module_indicator__DstXq",style:{backgroundColor:t.color}}),tq.jsx("span",{className:"tooltip-module_name__WS4zM",children:t.name})]}),tq.jsx("span",{className:"tooltip-module_value__I8eEt",children:t.value})]},t.name))]}),ug=h.forwardRef(({simple:t=!1},i)=>tq.jsxs("div",{ref:i,className:"x-axis-container",style:{height:t?0:"24px",visibility:t?"hidden":"visible"},children:[tq.jsx("d3fc-canvas",{class:"x-axis","use-device-pixel-ratio":!0}),tq.jsx("d3fc-svg",{class:"x-axis-interaction"})]}));var uy="area-chart-module_container__zLnde",ux="area-chart-module_canvas__zInZl";let uw=class{constructor(t){this.that=void 0,this.active=0,this.taps=0,this.touch0=null,this.touch1=null,this.sourceEvent=null,this.wheel=null,this.wheelHorizontal=!1,this.mouse=[null,null],this.zooming=!1,this.that=t}start(t){this.that.emit("zoomstart",t)}zoom(t,i){this.that.zoom.__zoom=t,this.that.emit("zoom",{transform:t,point:[i[0],i[1]]})}end(){this.that.emit("zoomend")}};class ub{constructor(t,i,n){this.k=void 0,this.x=void 0,this.y=void 0,this.k=t,this.x=i,this.y=n}scale(t){return 1===t?this:new ub(this.k*t,this.x,this.y)}translate(t,i){return 0===t&&0===i?this:new ub(this.k,this.x+this.k*t,this.y+this.k*i)}apply(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]}applyX(t){return t*this.k+this.x}applyY(t){return t*this.k+this.y}invert(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]}invertX(t){return(t-this.x)/this.k}invertY(t){return(t-this.y)/this.k}rescaleX(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))}rescaleY(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))}toString(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}}let u_=new ub(1,0,0);function uS(t,i,n){let r=t.invertX(i[0][0])-n[0][0],s=t.invertX(i[1][0])-n[1][0],o=t.invertY(i[0][1])-n[0][1],a=t.invertY(i[1][1])-n[1][1];return t.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}class uk{constructor(){this.__zoom=u_,this.constrain=uS,this.scaleExtent=[0,1/0],this.translateExtent=[[-1/0,-1/0],[1/0,1/0]],this.extent=[[0,0],[1e4,1e4]]}scaleBy(t,i){this.scaleTo(this.__zoom.k*t,i)}scaleTo(t,i){this.transform(this.constrain(this.translate(this.scale(this.__zoom,t),i,this.__zoom.invert(i)),this.extent,this.translateExtent))}translateBy(t,i){this.transform(this.constrain(this.__zoom.translate(t,i),this.extent,this.translateExtent))}translateTo(t,i,n){this.transform(this.constrain(u_.translate(n[0],n[1]).scale(this.__zoom.k).translate(-t,-i),this.extent,this.translateExtent))}transform(t){this.__zoom=t}wheeled(t,i,n){let r=this.__zoom,s=Math.max(this.scaleExtent[0],Math.min(this.scaleExtent[1],r.k*Math.pow(2,t)));this.scaleTo(s,i)}scale(t,i){let n=Math.max(this.scaleExtent[0],Math.min(this.scaleExtent[1],i));return n===t.k?t:new ub(n,t.x,t.y)}translate(t,i,n){let r=i[0]-n[0]*t.k,s=i[1]-n[1]*t.k;return r===t.x&&s===t.y?t:new ub(t.k,r,s)}}let uT=rJ.memoize((t,i,n,r=0,s=!1)=>{let o=function(t,i,n=600,r=0,s=!1){s||(r=0);let o=document.createElement("canvas");o.width=1,o.height=Math.max(1,Math.abs(n+r));let a=o.getContext("2d"),l=a.createLinearGradient(0,r,0,n+r);return l.addColorStop(0,nB(s?i:t)),l.addColorStop(1,nB(s?t:i)),a.fillStyle=l,a.fillRect(0,r,1,n+r),rf.from(o)}(t,i,n,r,s);return o.orig=new nI(0,0,1,Math.max(1,Math.abs(n+r))),o._frame=new nI(0,0,1,Math.max(1,Math.abs(n+r))),o},(...t)=>rJ.values(t).join("_"));class uP extends nJ{constructor(t=0,i=16777215,n=16777215,r=np){super(),this.area=new n3,this.line=new n3,this.stroke=void 0,this.fill=void 0,this.backgroundSurface=void 0,this.curve=void 0,this.stroke=t,this.fill=i,this.backgroundSurface=n,this.curve=r,this.area.lineStyle({width:0}),this.line.lineStyle({width:4,color:t,alpha:.5}),this.addChild(this.area),this.addChild(this.line)}update(t,i,n=1,r=16777215,s=0,o=0,a,l){this.fill=r,this.stroke=s,this.backgroundSurface=o,this.area.clear(),this.area.beginTextureFill({alpha:.5,texture:uT(this.stroke,this.backgroundSurface,i,l,a)}),this.area.drawArea(t.map(t=>[t[0],l,t[1]]),this.curve),this.area.endFill(),this.line.clear(),this.line.lineStyle({width:4,color:this.stroke}),this.line.drawLine(t,this.curve)}}class uM extends nJ{constructor(t){super(),this.priceCurvePositive=void 0,this.maskPositive=void 0,this.priceCurveNegative=void 0,this.maskNegative=void 0,this.colors=void 0,this.colors=t,this.priceCurvePositive=new uP(t.positiveStroke,t.positiveFill,t.backgroundSurface,nl),this.maskPositive=new n3,this.maskPositive.beginFill(),this.maskPositive.drawRect(0,-1e3,3200,1e3),this.maskPositive.endFill(),this.priceCurveNegative=new uP(t.negativeStroke,t.negativeFill,t.backgroundSurface,nl),this.maskNegative=new n3,this.maskNegative.beginFill(16777215),this.maskNegative.drawRect(0,0,3200,1e3),this.maskNegative.endFill(),this.priceCurvePositive.mask=this.maskPositive,this.priceCurveNegative.mask=this.maskNegative,this.addChild(this.priceCurveNegative),this.priceCurveNegative.addChild(this.maskNegative),this.addChild(this.priceCurvePositive),this.priceCurvePositive.addChild(this.maskPositive)}update(t,i,n,r,s,o=1){this.maskPositive.y=r,this.maskNegative.y=r,this.priceCurvePositive.update(n,r,o,this.colors.positiveFill,this.colors.positiveStroke,this.colors.backgroundSurface,!1,r),this.priceCurveNegative.update(n,s-r,o,this.colors.negativeFill,this.colors.negativeStroke,this.colors.backgroundSurface,!0,r)}}class uz extends n3{constructor(t=1,i=16777215,n=[]){super(),this.width=void 0,this.color=void 0,this.lineDash=void 0,this.width=t,this.color=i,this.lineDash=n}update(t,i,n=1){this.clear(),this.lineStyle({width:this.width,color:this.color,lineDash:this.lineDash}),this.moveTo(0,.5),this.lineTo(i,.5),this.endFill(),this.y=t}}function uE(t,i){let n=n=>r+=+i(n,s++,t)||0;void 0===i&&(n=t=>r+=+t||0);var r=0,s=0;return Float64Array.from(t,n)}class uA extends nJ{constructor(t=16777215,i=0,n=1,r=np){super(),this.area=new n3,this.line=new n3,this.fill=void 0,this.stroke=void 0,this.width=void 0,this.curve=void 0,this.fill=t,this.stroke=i,this.width=n,this.curve=r,this.area.lineStyle({width:0}),this.line.lineStyle({width:n,color:i,alpha:.5}),this.addChild(this.area),this.addChild(this.line)}update(t,i,n=1,r=16777215,s=0,o=1){this.fill=r,this.stroke=s,this.width=o,this.area.clear(),this.area.beginFill(this.fill,1),this.area.drawArea(t.map(t=>[t[0],i-n*cl,t[1]]),this.curve),this.area.endFill(),this.line.clear(),this.line.lineStyle({width:this.width,color:this.stroke}),this.line.drawLine(t,this.curve)}}let uC=class extends nJ{constructor(){super(),this.nodeByKeyValue=new Map}update(t,i,n,r=1,s){let o=i/r/200,a=t.ticks(o),l=t.tickFormat(o),h=a.filter(t=>!this.nodeByKeyValue.has(l(t))),u=a.filter(t=>this.nodeByKeyValue.has(l(t))),c=[...this.nodeByKeyValue.keys()].filter(t=>!(-1!==a.map(l).indexOf(t)));for(let i of h){let o=new rS(l(i),{fill:s.textSecondary,fontFamily:"monospace",fontSize:ca});o.x=t(i),o.y=n-r*cl/2,o.anchor.set(.5,.5),o.updateText(),this.nodeByKeyValue.set(l(i),o),this.addChild(o)}for(let i of u){let o=this.nodeByKeyValue.get(l(i));o.style.fill=s.textSecondary,o.x=t(i),o.y=n-r*cl/2}for(let t of c){let i=this.nodeByKeyValue.get(t);this.nodeByKeyValue.delete(t),this.removeChild(i)}}},uI=class extends nJ{constructor(t=16777215){super(),this.circle=new n3,this.line=new n3,this.color=void 0,this.color=t,this.circle.beginFill(t),this.circle.drawCircle(0,0,4),this.circle.endFill(),this.addChild(this.line),this.addChild(this.circle),this.visible=!1}update(t,i,n){this.circle.x=t,this.circle.y=i,this.line.clear(),this.line.lineStyle({width:1,color:this.color,lineDash:[3,3]}),this.line.moveTo(t,0),this.line.lineTo(t,i),this.line.lineTo(n/2,i),this.line.endFill()}},uD=class extends nJ{constructor(){super(),this.text=new rS("",{fill:16777215,fontFamily:"monospace",fontSize:12}),this.background=new n3,this.addChild(this.background),this.addChild(this.text)}update(t,i,n,r,s=1,o){this.text.x=i,this.text.y=n,this.text.text=t,this.text.anchor.x=r.x,this.text.anchor.y=r.y,this.text.style.fill=o.textPrimary;let a=s*this.text.width,l=s*this.text.height,h=r.x,u=r.y,c=1.5*s;this.background.clear(),this.background.beginFill(o.backgroundSurface,1),this.background.drawRect(i-(h*a+c),n-(u*l+c),a+2*c,l+2*c),this.background.endFill()}get width(){return this.text.width}get height(){return this.text.height}};class uL extends nJ{constructor(t){super(),this.price=void 0,this.label=void 0,this.background=new n3,this.price=new rS("9999",{fill:t.textPrimary,fontSize:18}),this.label=new rS("Mid Market Price",{fill:t.textSecondary,fontSize:ca}),this.addChild(this.background),this.addChild(this.label),this.addChild(this.price)}update(t,i,n,r=1,s,o,a){this.price.x=t,this.price.y=i,this.price.anchor.x=n.x,this.price.anchor.y=n.y,this.price.style.fill=s.textPrimary,o&&(this.price.text=o),this.label.x=t,this.label.anchor.x=n.x,this.label.anchor.y=n.y,this.label.style.fill=s.textSecondary,a&&(this.label.text=a);let l=r*Math.max(this.price.width,this.label.width),h=r*(this.price.height+this.label.height);this.label.y=i+r*this.price.height;let u=n.x,c=n.y,f=4*r;this.background.clear(),this.background.beginFill(s.backgroundSurface,.9),this.background.drawRect(t-(u*l+f),i-(c*h+f),l+2*f,h+2*f),this.background.endFill()}get width(){return this.price.width}get height(){return this.price.height+this.label.height}}let uO=class extends nJ{constructor(){super(),this.nodeByKeyValue=new Map}update(t,i,n,r=1,s){let o=n/r/50,a=t.ticks(o).filter(t=>0!==t),l=t.tickFormat(o),h=a.filter(t=>!this.nodeByKeyValue.has(l(t))),u=a.filter(t=>this.nodeByKeyValue.has(l(t))),c=[...this.nodeByKeyValue.keys()].filter(t=>!(-1!==a.map(l).indexOf(t)));for(let n of h){let o=new rS(l(n),{fill:s.textSecondary,fontFamily:"monospace",fontSize:ca});o.x=i-7*r,o.y=t(n),o.anchor.set(1,.5),o.updateText(),this.nodeByKeyValue.set(l(n),o),this.addChild(o)}for(let n of u){let o=this.nodeByKeyValue.get(l(n));o.style.fill=s.textSecondary,o.x=i-7*r,o.y=t(n)}for(let t of c){let i=this.nodeByKeyValue.get(t);this.nodeByKeyValue.delete(t),this.removeChild(i)}}};function uN(t,i,n,r,s){let o,a,l,h,u=i[0],c=r[0],f=0,d=0;c>u==c>-u?(o=u,u=i[++f]):(o=c,c=r[++d]);let p=0;if(fu==c>-u?(a=u+o,l=o-(a-u),u=i[++f]):(a=c+o,l=o-(a-c),c=r[++d]),o=a,0!==l&&(s[p++]=l);fu==c>-u?(h=(a=o+u)-o,l=o-(a-h)+(u-h),u=i[++f]):(h=(a=o+c)-o,l=o-(a-h)+(c-h),c=r[++d]),o=a,0!==l&&(s[p++]=l);for(;f=33306690738754716e-32*u?h:-function(t,i,n,r,s,o,a){let l,h,u,c,f,d,p,m,v,g,y,x,w,b,_,S,k,T;let P=t-s,M=n-s,z=i-o,E=r-o;b=P*E,p=(d=134217729*P)-(d-P),m=P-p,v=(d=134217729*E)-(d-E),_=m*(g=E-v)-(b-p*v-m*v-p*g),S=z*M,p=(d=134217729*z)-(d-z),m=z-p,v=(d=134217729*M)-(d-M),y=_-(k=m*(g=M-v)-(S-p*v-m*v-p*g)),f=_-y,uF[0]=_-(y+f)+(f-k),f=(x=b+y)-b,y=(w=b-(x-f)+(y-f))-S,f=w-y,uF[1]=w-(y+f)+(f-S),f=(T=x+y)-x,uF[2]=x-(T-f)+(y-f),uF[3]=T;let A=function(t,i){let n=i[0];for(let t=1;t<4;t++)n+=i[t];return n}(0,uF),C=22204460492503146e-32*a;if(A>=C||-A>=C||(f=t-P,l=t-(P+f)+(f-s),f=n-M,u=n-(M+f)+(f-s),f=i-z,h=i-(z+f)+(f-o),f=r-E,c=r-(E+f)+(f-o),0===l&&0===h&&0===u&&0===c)||(C=11093356479670487e-47*a+33306690738754706e-32*Math.abs(A),(A+=P*c+E*l-(z*u+M*h))>=C||-A>=C))return A;b=l*E,p=(d=134217729*l)-(d-l),m=l-p,v=(d=134217729*E)-(d-E),_=m*(g=E-v)-(b-p*v-m*v-p*g),S=h*M,p=(d=134217729*h)-(d-h),m=h-p,v=(d=134217729*M)-(d-M),y=_-(k=m*(g=M-v)-(S-p*v-m*v-p*g)),f=_-y,uY[0]=_-(y+f)+(f-k),f=(x=b+y)-b,y=(w=b-(x-f)+(y-f))-S,f=w-y,uY[1]=w-(y+f)+(f-S),f=(T=x+y)-x,uY[2]=x-(T-f)+(y-f),uY[3]=T;let I=uN(4,uF,4,uY,uj);b=P*c,p=(d=134217729*P)-(d-P),m=P-p,v=(d=134217729*c)-(d-c),_=m*(g=c-v)-(b-p*v-m*v-p*g),S=z*u,p=(d=134217729*z)-(d-z),m=z-p,v=(d=134217729*u)-(d-u),y=_-(k=m*(g=u-v)-(S-p*v-m*v-p*g)),f=_-y,uY[0]=_-(y+f)+(f-k),f=(x=b+y)-b,y=(w=b-(x-f)+(y-f))-S,f=w-y,uY[1]=w-(y+f)+(f-S),f=(T=x+y)-x,uY[2]=x-(T-f)+(y-f),uY[3]=T;let D=uN(I,uj,4,uY,uV);b=l*c,p=(d=134217729*l)-(d-l),m=l-p,v=(d=134217729*c)-(d-c),_=m*(g=c-v)-(b-p*v-m*v-p*g),S=h*u,p=(d=134217729*h)-(d-h),m=h-p,v=(d=134217729*u)-(d-u),y=_-(k=m*(g=u-v)-(S-p*v-m*v-p*g)),f=_-y,uY[0]=_-(y+f)+(f-k),f=(x=b+y)-b,y=(w=b-(x-f)+(y-f))-S,f=w-y,uY[1]=w-(y+f)+(f-S),f=(T=x+y)-x,uY[2]=x-(T-f)+(y-f),uY[3]=T;let L=uN(D,uV,4,uY,uB);return uB[L-1]}(t,i,n,r,s,o,u)}let uW=new Uint32Array(512);class uH{static from(t,i=u$,n=uq){let r=t.length,s=new Float64Array(2*r);for(let o=0;o>1;if(i>0&&"number"!=typeof t[0])throw Error("Expected coords to contain numbers.");this.coords=t;let n=Math.max(2*i-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(i)),this._hullPrev=new Uint32Array(i),this._hullNext=new Uint32Array(i),this._hullTri=new Uint32Array(i),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(i),this._dists=new Float64Array(i),this.update()}update(){let{coords:t,_hullPrev:i,_hullNext:n,_hullTri:r,_hullHash:s}=this,o=t.length>>1,a=1/0,l=1/0,h=-1/0,u=-1/0;for(let i=0;ih&&(h=n),r>u&&(u=r),this._ids[i]=i}let c=(a+h)/2,f=(l+u)/2,d,p,m,v=1/0;for(let i=0;i0&&(p=i,v=n)}let x=t[2*p],w=t[2*p+1],b=1/0;for(let i=0;ir&&(i[n++]=s,r=this._dists[s])}return this.hull=i.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(0>uZ(g,y,x,w,_,S)){let t=p,i=x,n=w;p=m,x=_,w=S,m=t,_=i,S=n}let k=function(t,i,n,r,s,o){let a=n-t,l=r-i,h=s-t,u=o-i,c=a*a+l*l,f=h*h+u*u,d=.5/(a*u-l*h);return{x:t+(u*c-l*f)*d,y:i+(a*f-h*c)*d}}(g,y,x,w,_,S);this._cx=k.x,this._cy=k.y;for(let i=0;i0&&2220446049250313e-31>=Math.abs(u-o)&&2220446049250313e-31>=Math.abs(c-a)||(o=u,a=c,h===d||h===p||h===m))continue;let f=0;for(let t=0,i=this._hashKey(u,c);t=0;)if((g=v)===f){g=-1;break}if(-1===g)continue;let y=this._addTriangle(g,h,n[g],-1,-1,r[g]);r[h]=this._legalize(y+2),r[g]=y,T++;let x=n[g];for(;v=n[x],0>uZ(u,c,t[2*x],t[2*x+1],t[2*v],t[2*v+1]);)y=this._addTriangle(x,h,v,r[h],-1,r[x]),r[h]=this._legalize(y+2),n[x]=x,T--,x=v;if(g===f)for(;0>uZ(u,c,t[2*(v=i[g])],t[2*v+1],t[2*g],t[2*g+1]);)y=this._addTriangle(v,h,g,-1,r[g],r[v]),this._legalize(y+2),r[v]=y,n[g]=g,T--,g=v;this._hullStart=i[h]=g,n[g]=i[x]=h,n[h]=x,s[this._hashKey(u,c)]=h,s[this._hashKey(t[2*g],t[2*g+1])]=g}this.hull=new Uint32Array(T);for(let t=0,i=this._hullStart;t0?3-n:1+n)/4}(t-this._cx,i-this._cy)*this._hashSize)%this._hashSize}_legalize(t){let{_triangles:i,_halfedges:n,coords:r}=this,s=0,o=0;for(;;){let a=n[t],l=t-t%3;if(o=l+(t+2)%3,-1===a){if(0===s)break;t=uW[--s];continue}let h=a-a%3,u=l+(t+1)%3,c=h+(a+2)%3,f=i[o],d=i[t],p=i[u],m=i[c];if(function(t,i,n,r,s,o,a,l){let h=t-a,u=i-l,c=n-a,f=r-l,d=s-a,p=o-l,m=c*c+f*f,v=d*d+p*p;return h*(f*v-m*p)-u*(c*v-m*d)+(h*h+u*u)*(c*p-f*d)<0}(r[2*f],r[2*f+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1],r[2*m],r[2*m+1])){i[t]=m,i[a]=f;let r=n[c];if(-1===r){let i=this._hullStart;do{if(this._hullTri[i]===c){this._hullTri[i]=t;break}i=this._hullPrev[i]}while(i!==this._hullStart)}this._link(t,r),this._link(a,n[o]),this._link(o,c);let l=h+(a+1)%3;s=n&&i[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let s=n+1,o=r;uG(t,n+r>>1,s),i[t[n]]>i[t[r]]&&uG(t,n,r),i[t[s]]>i[t[r]]&&uG(t,s,r),i[t[n]]>i[t[s]]&&uG(t,n,s);let a=t[s],l=i[a];for(;;){do s++;while(i[t[s]]l);if(o=o-n?(uU(t,i,s,r),uU(t,i,n,o-1)):(uU(t,i,n,o-1),uU(t,i,s,r))}}function uG(t,i,n){let r=t[i];t[i]=t[n],t[n]=r}function u$(t){return t[0]}function uq(t){return t[1]}class uK{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+i}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,i){this._+=`L${this._x1=+t},${this._y1=+i}`}arc(t,i,n){let r=(t=+t)+(n=+n),s=i=+i;if(n<0)throw Error("negative radius");null===this._x1?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>1e-6||Math.abs(this._y1-s)>1e-6)&&(this._+="L"+r+","+s),n&&(this._+=`A${n},${n},0,1,1,${t-n},${i}A${n},${n},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,i,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+i}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class uJ{constructor(){this._=[]}moveTo(t,i){this._.push([t,i])}closePath(){this._.push(this._[0].slice())}lineTo(t,i){this._.push([t,i])}value(){return this._.length?this._:null}}class uQ{constructor(t,[i,n,r,s]=[0,0,960,500]){if(!((r=+r)>=(i=+i)&&(s=+s)>=(n=+n)))throw Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=i,this.ymax=s,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let t,i;let{delaunay:{points:n,hull:r,triangles:s},vectors:o}=this,a=this.circumcenters=this._circumcenters.subarray(0,s.length/3*2);for(let o,l,h=0,u=0,c=s.length;hMath.abs(k)){if(void 0===t){for(let s of(t=i=0,r))t+=n[2*s],i+=n[2*s+1];t/=r.length,i/=r.length}let s=1e9*Math.sign((t-p)*S-(i-m)*_);o=(p+y)/2-s*S,l=(m+x)/2+s*_}else{let t=1/k,i=w*w+b*b,n=_*_+S*S;o=p+(S*i-b*n)*t,l=m+(w*n-_*i)*t}a[u]=o,a[u+1]=l}let l,h,u,c=r[r.length-1],f=4*c,d=n[2*c],p=n[2*c+1];o.fill(0);for(let t=0;t1;)s-=2;for(let t=2;t0){if(i>=this.ymax)return null;(s=(this.ymax-i)/r)0){if(t>=this.xmax)return null;(s=(this.xmax-t)/n)this.xmax?2:0)|(ithis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let i=0;i2&&function(t){let{triangles:i,coords:n}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:i.length/2},(t,i)=>i).sort((t,n)=>i[2*t]-i[2*n]||i[2*t+1]-i[2*n+1]);let t=this.collinear[0],s=this.collinear[this.collinear.length-1],o=[i[2*t],i[2*t+1],i[2*s],i[2*s+1]],a=1e-8*Math.hypot(o[3]-o[1],o[2]-o[0]);for(let t=0,s=i.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=o[0],l[o[0]]=1,2===o.length&&(l[o[1]]=0,this.triangles[1]=o[1],this.triangles[2]=o[1]))}voronoi(t){return new uQ(this,t)}*neighbors(t){let{inedges:i,hull:n,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){let i=a.indexOf(t);return i>0&&(yield a[i-1]),void(i=0&&r!==n&&r!==s;)n=r;return r}_step(t,i,n){let{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:l,points:h}=this;if(-1===r[t]||!h.length)return(t+1)%(h.length>>1);let u=t,c=u1(i-h[2*t],2)+u1(n-h[2*t+1],2),f=r[t],d=f;do{let r=l[d],f=u1(i-h[2*r],2)+u1(n-h[2*r+1],2);if(fi?1:t>=i?0:NaN}function u4(t){let i=t,n=t;function r(t,i,r,s){for(null==r&&(r=0),null==s&&(s=t.length);r>>1;0>n(t[o],i)?r=o+1:s=o}return r}return 1===t.length&&(i=(i,n)=>t(i)-n,n=(i,n)=>u6(t(i),n)),{left:r,center:function(t,n,s,o){null==s&&(s=0),null==o&&(o=t.length);let a=r(t,n,s,o-1);return a>s&&i(t[a-1],n)>-i(t[a],n)?a-1:a},right:function(t,i,r,s){for(null==r&&(r=0),null==s&&(s=t.length);r>>1;n(t[o],i)>0?s=o:r=o+1}return r}}}u4(u6);let u7=u4(function(t){return null===t?NaN:+t}).center;function u9(t){let i=t.target,n=i.getBoundingClientRect();return[t.clientX-n.left-i.clientLeft,t.clientY-n.top-i.clientTop]}class u8{constructor(t){this.that=void 0,this.active=0,this.taps=0,this.touch0=null,this.touch1=null,this.sourceEvent=null,this.wheel=null,this.zooming=!1,this.that=t}start(){this.that.emit("zoomstart")}zoom(t){this.that.emit("zoom",t)}end(){this.that.emit("zoomend")}}let ct=class extends nG{constructor(t){super(),this.stage=new nJ,this.renderer=void 0,this.scaleExtent=[0,1/0],this.colors=void 0,this.prices=[],this.volumes=[],this.priceLabels=[],this.volumeLabels=[],this.priceScale=oF(),this.midPrice=0,this._indicativePrice=0,this.transform=1,this.horizontalAxis=new uC,this.verticalAxis=new uO,this.buyIndicator=void 0,this.sellIndicator=void 0,this.auctionIndicator=new uI(13421772),this.buyPriceText=new uD,this.buyVolumeText=new uD,this.sellPriceText=new uD,this.sellVolumeText=new uD,this.auctionPriceText=new uD,this.auctionVolumeText=new uD,this.buyOverlay=new cx(0,.05),this.sellOverlay=new cx(0,.05),this.midMarketPriceLabel=void 0,this.midPriceLine=new cu(1,4802889),this.separator=new uz(1,4802889),this.lastEvent=null,this.gesture=new u8(this),this.originalTransform=1,this.onPointerMove=t=>{if("ontouchstart"in self)return;this.lastEvent=t;let i=t.data?.global.x;if(i&&this.prices.length>1){let n=this.renderer.resolution;i*=n;let r=this.renderer.view.width,s=this.renderer.view.height;if(this._indicativePrice){let o=t.data?.global.y*n,a=function(){return function(t){if(!(s=t.length))return[];for(var i=-1,n=i7(t,i8),r=Array(n);++ir/2?this.prices[l]-r/2>n*this.auctionVolumeText.width+6*n?r/2+3*n:this.prices[l]+6:r/2-this.prices[l]>n*this.auctionVolumeText.width+6?r/2-2*n:this.prices[l]-6,Math.min(Math.max(this.volumes[l],this.auctionVolumeText.height/2+2),s-n*cl-this.auctionVolumeText.height/2-2),{x:this.prices[l]>r/2?0:1,y:.5},n,this.colors),this.auctionIndicator.update(this.prices[l],this.volumes[l],r),this.auctionPriceText.visible=!0,this.auctionVolumeText.visible=!0,this.auctionIndicator.visible=!0):(this.auctionPriceText.visible=!1,this.auctionVolumeText.visible=!1,this.auctionIndicator.visible=!1)}else{let t,o,a,l;let h=u7(this.prices,i),u=this.prices[h];i>r/2?(t=this.prices[0]>=r/2?-1:i3(this.prices,2*this.priceScale(this.midPrice)-u),o=h,a=2*this.priceScale(this.midPrice)-u,l=u):(t=h,o=this.prices[this.prices.length-1]<=r/2?-1:i5(this.prices,2*this.priceScale(this.midPrice)-u)-1,a=u,l=2*this.priceScale(this.midPrice)-u),this.buyPriceText.update(this.priceLabels[t],Math.min(Math.max(a,n*this.buyPriceText.width/2+2),r/2-n*this.buyPriceText.width/2-2*n),s-n*cl/2,{x:.5,y:.5},n,this.colors),this.buyVolumeText.update(this.volumeLabels[t],r/2-a>n*this.buyVolumeText.width+6?r/2-2*n:a-6,Math.min(Math.max(this.volumes[t],n*this.buyVolumeText.height/2+2),s-n*cl-n*this.buyVolumeText.height/2-2),{x:1,y:.5},n,this.colors),this.sellPriceText.update(this.priceLabels[o],Math.max(Math.min(l,r-n*this.sellPriceText.width/2-2),r/2+n*this.sellPriceText.width/2+2*n),s-n*cl/2,{x:.5,y:.5},n,this.colors),this.sellVolumeText.update(this.volumeLabels[o],l-r/2>n*this.sellVolumeText.width+6?r/2+3*n:l+6,Math.min(Math.max(this.volumes[o],n*this.sellVolumeText.height/2+2),s-n*cl-n*this.sellVolumeText.height/2-2),{x:0,y:.5},n,this.colors);let c=this.prices[this.prices.length-1]>r/2,f=this.prices[0]this.priceScale.domain()[0]&&f&&-1!==t?(this.buyPriceText.visible=!0,this.buyVolumeText.visible=!0,this.buyIndicator.visible=!0,this.buyOverlay.visible=!0):(this.buyPriceText.visible=!1,this.buyVolumeText.visible=!1,this.buyIndicator.visible=!1,this.buyOverlay.visible=!1),this.priceScale.invert(l){this.buyPriceText.visible=!1,this.buyVolumeText.visible=!1,this.sellPriceText.visible=!1,this.sellVolumeText.visible=!1,this.buyIndicator.visible=!1,this.sellIndicator.visible=!1,this.buyOverlay.visible=!1,this.sellOverlay.visible=!1,this.lastEvent=null,this.render()},this.renderer=new ra({view:t.view,resolution:t.resolution,width:t.width,height:t.height}),this.colors=t.colors,this.buyIndicator=new uI(t.colors.buyStroke),this.sellIndicator=new uI(t.colors.sellStroke),this.midMarketPriceLabel=new uL(t.colors);let i=this.renderer.resolution;this.separator.update(t.height-i*cl,t.width),this.buyPriceText.visible=!1,this.buyVolumeText.visible=!1,this.sellPriceText.visible=!1,this.sellVolumeText.visible=!1,this.auctionPriceText.visible=!1,this.auctionVolumeText.visible=!1,this.stage.addChild(this.buyOverlay),this.stage.addChild(this.sellOverlay),this.stage.addChild(this.buyIndicator),this.stage.addChild(this.sellIndicator),this.stage.addChild(this.auctionIndicator),this.stage.addChild(this.horizontalAxis),this.stage.addChild(this.verticalAxis),this.stage.addChild(this.midPriceLine),this.stage.addChild(this.midMarketPriceLabel),this.stage.addChild(this.buyPriceText),this.stage.addChild(this.buyVolumeText),this.stage.addChild(this.sellPriceText),this.stage.addChild(this.sellVolumeText),this.stage.addChild(this.auctionPriceText),this.stage.addChild(this.auctionVolumeText),this.stage.addChild(this.separator),this.stage.interactive=!0,this.stage.hitArea=new nI(0,0,t.width,t.height),this.stage.on("wheel",t=>{let i=t.data?.originalEvent;this.gesture.wheel?window.clearTimeout(this.gesture.wheel):this.gesture.start();let n=Math.pow(2,-(.002*i.deltaY)*(i.ctrlKey?10:1));this.transform=rJ.clamp(this.transform*n,this.scaleExtent[0],this.scaleExtent[1]),this.gesture.wheel=window.setTimeout(()=>{this.gesture.wheel=null,this.gesture.end()},150),this.emit("zoom",this.transform)}).on("touchstart",t=>{if(t.data.originalEvent instanceof TouchEvent){let i=t.data.originalEvent,n=i.touches,r=!1;for(let t of(i.stopImmediatePropagation(),n)){let i=u9(t);this.gesture.touch0?this.gesture.touch1||this.gesture.touch0.identifier===t.identifier||(this.gesture.touch1={point:i,originalPoint:i,identifier:t.identifier},this.gesture.taps=0):(this.gesture.touch0={point:i,originalPoint:i,identifier:t.identifier},r=!0)}r&&(this.originalTransform=this.transform,this.gesture.start())}}).on("touchmove",t=>{if(t.data.originalEvent instanceof TouchEvent){t.data.originalEvent.preventDefault(),t.data.originalEvent.stopImmediatePropagation();let i=t.data.originalEvent.changedTouches??[];for(let t of i)this.gesture.touch0&&this.gesture.touch0.identifier===t.identifier?this.gesture.touch0.point=u9(t):this.gesture.touch1&&this.gesture.touch1.identifier===t.identifier&&(this.gesture.touch1.point=u9(t));if(this.gesture.touch1){let t=this.gesture.touch0.point,i=this.gesture.touch1.point,n=this.gesture.touch0.originalPoint,r=this.gesture.touch1.originalPoint,s=(i[0]-t[0])**2+(i[1]-t[1])**2,o=(r[0]-n[0])**2+(r[1]-n[1])**2;this.transform=rJ.clamp(this.originalTransform*Math.sqrt(s/o),this.scaleExtent[0],this.scaleExtent[1]),this.gesture.zoom(rJ.clamp(this.transform,this.scaleExtent[0],this.scaleExtent[1]))}}}).on("touchend",t=>{if(t.data.originalEvent instanceof TouchEvent){let i=t.data.originalEvent.changedTouches??[];for(let t of i)this.gesture.touch0&&this.gesture.touch0.identifier===t.identifier?this.gesture.touch0=null:this.gesture.touch1&&this.gesture.touch1.identifier===t.identifier&&(this.gesture.touch1=null);this.gesture.touch1&&!this.gesture.touch0&&(this.gesture.touch0=null,this.gesture.touch1=null),this.gesture.end()}}).on("pointermove",this.onPointerMove).on("pointerout",this.onPointerOut)}render(){this.renderer.render(this.stage)}update(t,i,n,r,s,o,a,l,h){this.prices=t,this.volumes=i,this.midPrice=n,this.priceLabels=r,this.volumeLabels=s,this.priceScale=l;let u=this.renderer.view.width,c=this.renderer.view.height,f=this.renderer.resolution;this.horizontalAxis.update(this.priceScale,u,c,f,this.colors),this.verticalAxis.update(h,u,c,f,this.colors),this.midMarketPriceLabel.update(u/2,10,{x:.5,y:0},f,this.colors,o,a),this.midPriceLine.update(u/2,c,f),this.separator.update(c-f*cl,u),this.stage.hitArea=new nI(0,0,this.renderer.screen.width,this.renderer.screen.height),this.lastEvent&&this.onPointerMove(this.lastEvent)}updatePrice(t){let i=new n9;i.data=new n7,i.data.global.x=this.priceScale(t),this.onPointerMove(i)}clearPrice(){this.onPointerOut()}destroy(){this.stage.destroy(),this.renderer.destroy()}set indicativePrice(t){this._indicativePrice=t}},ce=class extends nG{constructor(t){super(),this.chart=void 0,this.axis=void 0,this.prices=[],this.volumes=[],this.priceLabels=[],this.volumeLabels=[],this._span=1,this.initialSpan=1,this.maxPriceDifference=0,this.initialPriceDifference=0,this._data={buy:[],sell:[]},this._indicativePrice=0,this._midPrice=0,this.priceFormat=void 0,this.volumeFormat=void 0,this._colors=void 0,this._dimensions=void 0,this.priceFormat=t.priceFormat,this.volumeFormat=t.volumeFormat,this._colors=t.colors,this._dimensions=t.dimensions,this.chart=new class{constructor(t){this.stage=new nJ,this.renderer=void 0,this.buyCurve=void 0,this.sellCurve=void 0,this.colors=void 0,this.dimensions=void 0,this.renderer=new ra({view:t.view,resolution:t.resolution,width:t.width,height:t.height}),this.colors=t.colors,this.dimensions=t.dimensions,this.buyCurve=new uA(t.colors.buyFill,t.colors.buyStroke,t.dimensions.strokeWidth,nm),this.sellCurve=new uA(t.colors.sellFill,t.colors.sellStroke,t.dimensions.strokeWidth,nm),this.stage.addChild(this.buyCurve),this.stage.addChild(this.sellCurve)}render(){this.renderer.render(this.stage)}update(t,i){let n=this.renderer.resolution;this.buyCurve.update(t,this.renderer.view.height,n,this.colors.buyFill,this.colors.buyStroke,this.dimensions.strokeWidth),this.sellCurve.update(i,this.renderer.view.height,n,this.colors.sellFill,this.colors.sellStroke,this.dimensions.strokeWidth)}}({view:t.chartView,resolution:t.resolution,width:t.width,height:t.height,colors:t.colors,dimensions:t.dimensions}),this.axis=new ct({view:t.axisView,resolution:t.resolution,width:t.width,height:t.height,colors:t.colors}),this.axis.on("zoomstart",()=>{this.emit("zoomstart")}).on("zoom",t=>{this.span=this.initialSpan/t,this.emit("zoom")}).on("zoomend",()=>{this.emit("zoomend")})}updatePrice(t){this.axis.updatePrice(t)}clearPrice(){this.axis.clearPrice()}render(){this.chart.render(),this.axis.render()}resize(t,i){this.chart.renderer.resize(t,i),this.axis.renderer.resize(t,i)}destroy(){this.axis.destroy()}update(){var t,i,n,r;let s=this.axis.renderer.resolution,o=rJ.zip(this._data.buy.map(t=>t.price),uE(this._data.buy.map(t=>t.volume))),a=rJ.zip(this._data.sell.map(t=>t.price),uE(this._data.sell.map(t=>t.volume))),l=(t=this._indicativePrice,i=this._midPrice,n=this._data.buy?.[0]?.price,r=this._data.sell?.[0]?.price,t||i||i9([n,r]));if(this.maxPriceDifference=i4(this.prices.map(t=>Math.abs(t-l)))??0,!this.initialPriceDifference){let t=rJ.orderBy(this._data.buy,["price"]),i=rJ.orderBy(this._data.sell,["price"]);for(;t.length>2&&Math.abs((t[0].price-t[1].price)/(t[0].price-l))/(t[0].volume/o[o.length-1][1])>100;)t.splice(0,1);for(;i.length>2;){let t=i.length-1;if(!(Math.abs((i[t].price-i[t-1].price)/(i[t].price-l))/(i[t].volume/a[a.length-1][1])>100))break;i.splice(-1,1)}this.initialPriceDifference=i4([...t,...i].map(t=>Math.abs(t.price-l)))??0,this.initialSpan=this.initialPriceDifference/this.maxPriceDifference,this._span=this.initialSpan}let h=[l-this._span*this.maxPriceDifference,l+this._span*this.maxPriceDifference],u=i6(rJ.orderBy([...this._data.buy,...this._data.sell],["price"]).map((t,i)=>({...t,index:i})).filter(t=>t.price>=h[0]&&t.price<=h[1]).map(t=>t.index)),c=[0,2*(i4(this.volumes.slice(u[0],u[1]))??0)],f=oF().domain(h).range([0,this.width]),d=oF().domain(c).range([this.height-s*cl,0]);if(o.length>0&&o.push([l-this.maxPriceDifference,o[o.length-1][1]]),a.length>0&&a.push([l+this.maxPriceDifference,a[a.length-1][1]]),this.chart.colors=this._colors,this.chart.dimensions=this._dimensions,this.chart.update(o.map(t=>[f(t[0]),d(t[1])]),a.map(t=>[f(t[0]),d(t[1])])),this._data.buy.length>0&&this._data.sell.length>0){let t=i7(this.prices.filter(t=>l-t>0).map(t=>l-t))??0+i7(this.prices.filter(t=>t-l>0).map(t=>t-l))??0;this.axis.scaleExtent=[this.initialSpan,this.maxPriceDifference/(2*(t??this.maxPriceDifference/10))]}this.axis.colors=this._colors,this.axis.update(this.prices.map(t=>f(t)),this.volumes.map(t=>d(t)),l,this.priceLabels,this.volumeLabels,this.priceFormat(l),this._indicativePrice>0?"Indicative price":"Mid Market Price",f,d)}set colors(t){this._colors=t,this.update(),this.render()}set dimensions(t){this._dimensions=t,this.update(),this.render()}get data(){return this._data}set data(t){this._data=t,this._data.buy=rJ.sortBy(this._data.buy,t=>-t.price),this._data.sell=rJ.sortBy(this._data.sell,t=>t.price),this.prices=rJ.sortBy([...this._data.buy.map(t=>t.price),...this._data.sell.map(t=>t.price)]),this.priceLabels=this.prices.map(t=>this.priceFormat(t));let i=rJ.zip(this._data.buy.map(t=>t.price),uE(this._data.buy.map(t=>t.volume))),n=rJ.zip(this._data.sell.map(t=>t.price),uE(this._data.sell.map(t=>t.volume)));this.volumes=rJ.orderBy([...i,...n],["0"]).map(t=>t[1]),this.volumeLabels=this.volumes.map(t=>this.volumeFormat(t)),this.update(),this.render()}set indicativePrice(t){this._indicativePrice=t,this.axis.indicativePrice=t,this.update(),this.render()}set midPrice(t){this._midPrice=t,this.update(),this.render()}get height(){return this.chart.renderer.view.height}get width(){return this.chart.renderer.view.width}get span(){return this._span}set span(t){this._span=t,this.update(),this.render()}};var ci="depth-chart-module_container__INk9v",cn="depth-chart-module_canvas__PB4Cf";function cr(t){let i=t?getComputedStyle(t):null;return{buyFill:nY(i?.getPropertyValue("--pennant-color-depth-buy-fill").trim()||"#16452d"),buyStroke:nY(i?.getPropertyValue("--pennant-color-depth-buy-stroke").trim()||"#26ff8a"),sellFill:nY(i?.getPropertyValue("--pennant-color-depth-sell-fill").trim()||"#800700"),sellStroke:nY(i?.getPropertyValue("--pennant-color-depth-sell-stroke").trim()||"#ff261a"),textPrimary:nY(i?.getPropertyValue("--pennant-font-color-base").trim()||"#ffffff"),textSecondary:nY(i?.getPropertyValue("--pennant-font-color-secondary").trim()||"#fafafa"),backgroundSurface:nY(i?.getPropertyValue("--pennant-background-surface-color").trim()||"#0a0a0a")}}function cs(t){let i=t?getComputedStyle(t):null;return{strokeWidth:rX(i?.getPropertyValue("--pennant-depth-stroke-width").trim()||"1px")}}function co(t){return iq(0).format(t)}let ca=12,cl=ca+5,ch=h.forwardRef(({data:t,priceFormat:i=iK,volumeFormat:n=co,indicativePrice:r=0,midPrice:s=0,notEnoughDataText:o="No data",theme:a="dark"},l)=>{let u=h.useRef(null),c=h.useRef(null),f=h.useRef(null),d=h.useRef(null),{ref:p,width:m=0,height:v=0,devicePixelContentBoxSizeInlineSize:g,devicePixelContentBoxSizeBlockSize:y}=r0(50);return h.useEffect(()=>{let t=cr(d?.current),r=cs(d?.current);return f.current=new ce({chartView:u.current,axisView:c.current,resolution:window.devicePixelRatio,width:0,height:0,priceFormat:i,volumeFormat:n,colors:t,dimensions:r}),()=>{f.current.destroy()}},[]),h.useEffect(()=>{f.current.resize(g?g/window.devicePixelRatio:m,y?y/window.devicePixelRatio:v),f.current.data=t,f.current.render()},[v,m,t,g,y]),h.useEffect(()=>{f.current.indicativePrice=r},[r]),h.useEffect(()=>{f.current.midPrice=s},[s]),h.useEffect(()=>{requestAnimationFrame(()=>{f.current.colors=cr(d?.current),f.current.dimensions=cs(d?.current)})},[a]),h.useImperativeHandle(l,()=>({update(t){f.current.updatePrice(t)},clear(){f.current.clearPrice()}})),0===t.buy.length&&0===t.sell.length?tq.jsx("div",{ref:d,className:ci,"data-theme":a,children:tq.jsx(r1,{title:o})}):tq.jsx("div",{ref:d,className:ci,"data-theme":a,children:tq.jsxs("div",{ref:p,className:"depth-chart-module_canvasContainer__LeU2-",children:[tq.jsx("canvas",{ref:u,className:cn}),tq.jsx("canvas",{ref:c,className:cn})]})})});ch.displayName="DepthChart";class cu extends n3{constructor(t=1,i=16777215,n=[]){super(),this.width=void 0,this.color=void 0,this.lineDash=void 0,this.width=t,this.color=i,this.lineDash=n}update(t,i,n=1){this.clear(),this.lineStyle({width:this.width,color:this.color,lineDash:this.lineDash}),this.moveTo(.5,0),this.lineTo(.5,i-n*cl),this.endFill(),this.x=t}}class cc extends nJ{constructor(t=1,i=16777215,n=[]){super(),this.horizontalLine=void 0,this.verticalLine=void 0,this.horizontalLine=new uz(t,i,n),this.verticalLine=new cu(t,i,n),this.addChild(this.horizontalLine),this.addChild(this.verticalLine)}update(t,i,n,r,s=1){null!==t?(this.verticalLine.visible=!0,this.verticalLine.update(t,r,s)):this.verticalLine.visible=!1,null!==i?(this.horizontalLine.visible=!0,this.horizontalLine.update(i,n,s)):this.horizontalLine.visible=!1}}function cf(t,i=1){let n=t.target,r=n.getBoundingClientRect();return[i*(t.clientX-r.left-n.clientLeft),i*(t.clientY-r.top-n.clientTop)]}class cd extends nJ{constructor(t){super(),this.renderer=void 0,this.zoom=new uk,this.gesture=new uw(this),this.firstPoint=[0,0],this.overlay=new n3,this.nodeByKeyValue=new Map,this.onWheel=t=>{let i=t.data?.originalEvent,n=cf(i,this.renderer.resolution);this.gesture.wheel?window.clearTimeout(this.gesture.wheel):(this.gesture.mouse=[n,n],this.gesture.start()),this.gesture.wheel=window.setTimeout(()=>{this.gesture.wheel=null,this.gesture.end()},150),this.zoom.wheeled(-(.002*i.deltaY)*(i.ctrlKey?10:1),this.gesture.mouse[0]??[0,0],[[0,0],[100,100]]),this.emit("zoom",{transform:this.zoom.__zoom,point:n})},this.onPointerDown=t=>{let i=this.renderer.resolution,n=cf(t.data?.originalEvent,i);this.firstPoint=n??[0,0],t.data?.identifier&&this.renderer.context.canvas.setPointerCapture(t.data?.identifier),this.gesture.mouse=[n,this.zoom.__zoom.invert(n)],this.gesture.start();let r=t=>{t.preventDefault(),this.gesture.mouse[0]=cf(t,i),this.gesture.mouse[1]&&this.gesture.zoom(this.zoom.constrain(this.zoom.translate(this.zoom.__zoom,this.gesture.mouse[0],this.gesture.mouse[1]),[[0,0],[100,100]],this.zoom.translateExtent),this.firstPoint)},s=t=>{t.preventDefault(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s),t.data?.identifier&&this.renderer.context.canvas.releasePointerCapture(t.data?.identifier),this.gesture.end()};window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)},this.onPointerMove=t=>{let i=t.data?.originalEvent,n=cf(i,this.renderer.resolution);i.target===this.renderer.context.canvas&&this.emit("mousemove",n)},this.onPointerOut=t=>{this.emit("mouseout")},this.renderer=t,this.addChild(this.overlay),this.on("wheel",this.onWheel).on("pointerdown",this.onPointerDown).on("pointermove",this.onPointerMove).on("pointerout",this.onPointerOut)}update(t,i,n,r=1,s,o){this.overlay.clear(),this.overlay.beginFill(s.backgroundSurface,.7),this.overlay.drawRect(i-72*r,0,72*r,n),this.overlay.endFill();let a=n/r/50,l=t.ticks(a),h=t.tickFormat(a,o),u=l.filter(t=>!this.nodeByKeyValue.has(h(t))),c=l.filter(t=>this.nodeByKeyValue.has(h(t))),f=[...this.nodeByKeyValue.keys()].filter(t=>!(-1!==l.map(h).indexOf(t)));for(let n of u){let o=new rS(h(n),{fill:s.textSecondary,fontFamily:"monospace",fontSize:12});o.x=i-7*r,o.y=t(n),o.anchor.set(1,.5),o.updateText(),this.nodeByKeyValue.set(h(n),o),this.addChild(o)}for(let n of c){let o=this.nodeByKeyValue.get(h(n));o.style.fill=s.textSecondary,o.x=i-7*r,o.y=t(n)}for(let t of f){let i=this.nodeByKeyValue.get(t);this.nodeByKeyValue.delete(t),this.removeChild(i)}}}class cp extends nJ{constructor(t){super(),this.renderer=void 0,this.zoom=new uk,this.gesture=new uw(this),this.firstPoint=[0,0],this.overlay=new n3,this.tickNodes=[],this.onWheel=t=>{let i=t.data?.originalEvent,n=cf(i,this.renderer.resolution);this.gesture.wheel?window.clearTimeout(this.gesture.wheel):(this.gesture.mouse=[n,n],this.gesture.start(this.zoom.__zoom)),this.gesture.wheel=window.setTimeout(()=>{this.gesture.wheel=null,this.gesture.end()},150),this.zoom.wheeled(-(.002*i.deltaY)*(i.ctrlKey?10:1),this.gesture.mouse[0]??[0,0],[[0,0],[100,100]]),this.emit("zoom",{transform:this.zoom.__zoom,point:n})},this.onPointerDown=t=>{let i=this.renderer.resolution,n=cf(t.data?.originalEvent,i);this.firstPoint=n??[0,0],t.data?.identifier&&this.renderer.context.canvas.setPointerCapture(t.data?.identifier),this.gesture.mouse=[n,this.zoom.__zoom.invert(n)],this.gesture.start(this.zoom.constrain(this.zoom.translate(this.zoom.__zoom,this.gesture.mouse[0],this.gesture.mouse[1]),[[0,0],[100,100]],this.zoom.translateExtent));let r=t=>{t.preventDefault(),this.gesture.mouse[0]=cf(t,i),this.gesture.mouse[1]&&this.gesture.zoom(this.zoom.constrain(this.zoom.translate(this.zoom.__zoom,this.gesture.mouse[0],this.gesture.mouse[1]),[[0,0],[100,100]],this.zoom.translateExtent),this.firstPoint)},s=t=>{t.preventDefault(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s),t.data?.identifier&&this.renderer.context.canvas.releasePointerCapture(t.data?.identifier),this.gesture.end()};window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)},this.onPointerMove=t=>{let i=t.data?.originalEvent,n=cf(i,this.renderer.resolution);i.target===this.renderer.context.canvas&&this.emit("mousemove",n)},this.onPointerOut=t=>{this.emit("mouseout")},this.renderer=t,this.addChild(this.overlay),this.on("wheel",this.onWheel).on("pointerdown",this.onPointerDown).on("pointermove",this.onPointerMove).on("pointerout",this.onPointerOut),this.tickNodes=tJ(0,20).map(()=>new rS("",{fill:16777215,fontFamily:"monospace",fontSize:12}));for(let t=0;t!this.nodeByKeyValue.has(t.getTime())):l.filter(t=>!this.nodeByKeyValue.has(t)),o=rG(l)?l.filter(t=>this.nodeByKeyValue.has(t.getTime())):l.filter(t=>this.nodeByKeyValue.has(t)),a=rG(l)?[...this.nodeByKeyValue.keys()].filter(t=>!(-1!==l.map(t=>t.getTime()).indexOf(t))):[...this.nodeByKeyValue.keys()].filter(t=>!(-1!==l.map(t=>t).indexOf(t))),s)){let r=new n3;r.clear(),r.lineStyle({width:1,color:this.color,lineDash:[]}),r.moveTo(.5,0),r.lineTo(.5,n),r.endFill(),r.x=t(i),this.nodeByKeyValue.set(rU(i)?i.getTime():i,r),this.addChild(r)}for(let i of o){let r=this.nodeByKeyValue.get(rU(i)?i.getTime():i);r.clear(),r.lineStyle({width:1,color:this.color,lineDash:[]}),r.moveTo(.5,0),r.lineTo(.5,n),r.endFill(),r.x=t(i),r.x=Math.round(t(i))}for(let t of a){let i=this.nodeByKeyValue.get(t);this.nodeByKeyValue.delete(t),this.removeChild(i)}}}class cv extends nJ{constructor(t=16777215){super(),this.innerCircle=new n3,this.outerCircle=new n3,this.color=void 0,this.color=t,this.outerCircle.beginFill(16777215),this.outerCircle.drawCircle(0,0,12),this.outerCircle.endFill(),this.innerCircle.beginFill(t),this.innerCircle.drawCircle(0,0,8),this.innerCircle.endFill(),this.addChild(this.outerCircle),this.addChild(this.innerCircle),this.visible=!1}update(t,i,n){this.outerCircle.x=t,this.outerCircle.y=i,this.innerCircle.x=t,this.innerCircle.y=i,this.color!==n&&(this.color=n,this.innerCircle.clear(),this.innerCircle.beginFill(n),this.innerCircle.drawCircle(0,0,8),this.innerCircle.endFill())}}class cg extends nJ{constructor(){super(),this.text=new rS("",{fill:16777215,fontFamily:"monospace",fontSize:12}),this.background=new n3,this.addChild(this.background),this.addChild(this.text)}update(t,i,n,r,s=1,o){this.text.x=i,this.text.y=n,this.text.text=t,this.text.anchor.x=r.x,this.text.anchor.y=r.y,this.text.style.fill=o.textPrimary;let a=s*this.text.width,l=s*this.text.height,h=r.x,u=r.y,c=1.2*s;this.background.clear(),this.background.beginFill(o.backgroundSurface,1),this.background.drawRect(i-(h*a+c),n-(u*l+c),a+2*c,l+2*c),this.background.endFill()}get width(){return this.text.width}get height(){return this.text.height}}rJ.memoize((t,i,n,r=0,s=!1)=>{let o=function(t,i,n=600,r=0,s=!1){s||(r=0);let o=document.createElement("canvas");o.width=1,o.height=n+r;let a=o.getContext("2d"),l=a.createLinearGradient(0,r,0,n+r);return l.addColorStop(0,nB(s?i:t)),l.addColorStop(1,nB(s?t:i)),a.fillStyle=l,a.fillRect(0,r,1,n+r),rf.from(o)}(t,i,n,r,s);return o.orig=new nI(0,0,1,n+r),o._frame=new nI(0,0,1,n+r),o},(...t)=>rJ.values(t).join("_"));class cy extends nJ{constructor(t=0,i=16777215,n=16777215,r=nl){super(),this.line=new n3,this.stroke=void 0,this.backgroundSurface=void 0,this.curve=void 0,this.stroke=t,this.backgroundSurface=n,this.curve=r,this.line.lineStyle({width:4,color:t,alpha:.5}),this.addChild(this.line)}update(t,i,n=1,r=16777215,s=0,o=0,a,l){this.stroke=s,this.backgroundSurface=o,this.line.clear(),this.line.lineStyle({width:4,color:this.stroke}),this.line.drawLine(t,this.curve)}}class cx extends n3{constructor(t=16777215,i=1){super(),this.alpha=1,this.color=16777215,this.color=t,this.alpha=i}update(t,i,n,r,s){this.color=s,this.clear(),this.beginFill(this.color,this.alpha),this.drawRect(t,i,n,r),this.endFill()}}class cw extends nJ{constructor(t=4013373){super(),this.nodeByKeyValue=new Map,this.color=void 0,this.color=t}update(t,i,n,r=1){let s=n/r/50,o=t.ticks(s),a=t.tickFormat(s),l=o.filter(t=>!this.nodeByKeyValue.has(a(t))),h=o.filter(t=>this.nodeByKeyValue.has(a(t))),u=[...this.nodeByKeyValue.keys()].filter(t=>!(-1!==o.map(a).indexOf(t)));for(let n of l){let r=new n3;r.clear(),r.lineStyle({width:1,color:this.color,lineDash:[]}),r.moveTo(0,.5),r.lineTo(i,.5),r.endFill(),r.y=t(n),this.nodeByKeyValue.set(a(n),r),this.addChild(r)}for(let n of h){let r=this.nodeByKeyValue.get(a(n));r.clear(),r.lineStyle({width:1,color:this.color,lineDash:[]}),r.moveTo(0,.5),r.lineTo(i,.5),r.endFill(),r.y=t(n)}for(let t of u){let i=this.nodeByKeyValue.get(t);this.nodeByKeyValue.delete(t),this.removeChild(i)}}}let cb=rJ.memoize((t,i,n)=>{let r=function(t,i,n=600){let r=document.createElement("canvas");r.width=1,r.height=n;let s=r.getContext("2d"),o=s.createLinearGradient(0,0,0,n);return o.addColorStop(0,nB(t)),o.addColorStop(1,nB(i)),s.fillStyle=o,s.fillRect(0,0,1,n),rf.from(r)}(t,i,n);return r.orig=new nI(0,0,1,n),r._frame=new nI(0,0,1,n),r},(...t)=>rJ.values(t).join("_"));class c_ extends nJ{constructor(t=0,i=16777215,n=16777215,r=nl){super(),this.area=new n3,this.line=new n3,this.stroke=void 0,this.fill=void 0,this.backgroundSurface=void 0,this.curve=void 0,this.stroke=t,this.fill=i,this.backgroundSurface=n,this.curve=r,this.area.lineStyle({width:0}),this.line.lineStyle({width:4,color:t,alpha:.5}),this.addChild(this.area),this.addChild(this.line)}update(t,i,n=1,r=16777215,s=0,o=0){this.fill=r,this.stroke=s,this.backgroundSurface=o,this.area.clear(),this.area.beginTextureFill({alpha:.5,texture:cb(this.stroke,this.backgroundSurface,i)}),this.area.drawArea(t,this.curve),this.area.endFill(),this.line.clear(),this.line.lineStyle({width:4,color:this.stroke}),this.line.drawLine(t.map(t=>[t[0],t[2]]),this.curve)}}let cS=class extends nG{constructor(t){super(),this.colors=void 0,this.renderer=void 0,this.scaleExtent=[0,1/0],this.stage=new nJ,this.zoom=new uk,this._interactive=!0,this.data=[],this.lastPriceZoomTransform=u_,this.lastXZoomTransform=u_,this.priceScale=oF(),this.priceZoom=new uk,this.xScale=null,this.xZoom=new uk,this.firstPoint=null,this.gesture=new uw(this),this.isZooming=!1,this.lastEvent=null,this.horizontalAxis=void 0,this.verticalAxis=void 0,this.verticalAxisSeparator=new n3,this.horizontalAxisSeparator=new n3,this.crosshair=new cc(1,8947848,[3,3]),this.indicator=rJ.range(0,6).map(()=>new cv(16711680)),this.priceLabel=new cg,this.xLabel=new cg,this.hitBox=new nJ,this.priceFormat=void 0,this.xFormat=void 0,this.onWheel=t=>{if(this._interactive){let i=t.data?.originalEvent,n=cf(i,this.renderer.resolution);this.isZooming=!0,this.hideTooltips(),this.emit("mouseout"),this.gesture.wheel?window.clearTimeout(this.gesture.wheel):(this.gesture.mouse=[n,n],this.gesture.start(this.zoom.__zoom)),this.gesture.wheel=window.setTimeout(()=>{this.isZooming=!1,this.lastEvent&&this.onPointerMove(this.lastEvent),this.gesture.wheel=null,this.gesture.end()},150),this.zoom.wheeled(-(.002*i.deltaY)*(i.ctrlKey?10:1),this.gesture.mouse[0]??[0,0],[[0,0],[100,100]]);let r=this.zoom.__zoom,s=r.k/this.lastXZoomTransform.k;1===s?this.xZoom.scaleBy(Math.pow(2,-(r.x-this.lastXZoomTransform.x)/1/(this.xScale.range()[1]-this.xScale.range()[0])),[Math.abs(this.xScale.range()[1]-this.xScale.range()[0])/2,0]):this.xZoom.scaleBy(s,[(this.xScale.range()[1]-this.xScale.range()[0])/2,0]),this.lastXZoomTransform=r,this.emit("zoom.horizontalAxis",this.zoom.__zoom,n)}},this.onPointerDown=t=>{if(this._interactive){let i=this.renderer.resolution,n=cf(t.data?.originalEvent,i);this.firstPoint=n??[0,0],t.data?.identifier&&this.renderer.context.canvas.setPointerCapture(t.data?.identifier),this.gesture.mouse=[n,this.zoom.__zoom.invert(n)],this.gesture.start(this.zoom.constrain(this.zoom.translate(this.zoom.__zoom,this.gesture.mouse[0],this.gesture.mouse[1]),[[0,0],[100,100]],this.zoom.translateExtent)),this.isZooming=!0,this.hideTooltips(),this.emit("mouseout"),this.hitBox.cursor="grabbing",this.render();let r=t=>{t.preventDefault(),this.gesture.mouse[0]=cf(t,i),this.gesture.mouse[1]&&this.gesture.zoom(this.zoom.constrain(this.zoom.translate(this.zoom.__zoom,this.gesture.mouse[0],this.gesture.mouse[1]),[[0,0],[100,100]],this.zoom.translateExtent),this.firstPoint)},s=t=>{t.preventDefault(),this.hitBox.cursor="default",window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s),t.data?.identifier&&this.renderer.context.canvas.releasePointerCapture(t.data?.identifier),this.gesture.end(),this.isZooming=!1,this.lastEvent&&this.onPointerMove(this.lastEvent)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)}},this.onPointerMove=t=>{if("ontouchstart"in self)return;this.crosshair.visible=!0,this.priceLabel.visible=!0,this.xLabel.visible=!0;for(let t=0;t1){let r=this.renderer.resolution;i*=r;let s=this.renderer.view.width,o=this.renderer.view.height,a=u7(this.data[0].i.map(t=>this.xScale(t)),i),l=this.data[0].i[a];this.crosshair.update(this.xScale(l),r*n,s,o,r);for(let t=0;t({color:nB(this.colors[`accent${t+1}`]),name:this.data[t].key,value:this.priceFormat(this.data[t][a].data[this.data[t].key])}))}),this.lastEvent=t}},this.onZoomStartHorizontalAxis=t=>{this.emit("zoomstart.horizontalAxis",t)},this.onZoomHorizontalAxis=({transform:t,point:i})=>{let n=t.k/this.lastXZoomTransform.k;1===n?this.xZoom.scaleBy(Math.pow(2,-(t.x-this.lastXZoomTransform.x)/(this.xScale.range()[1]-this.xScale.range()[0])),[Math.abs(this.xScale.range()[1]-this.xScale.range()[0])/2,0]):this.xZoom.scaleBy(n,[(this.xScale.range()[1]-this.xScale.range()[0])/2,0]),this.lastXZoomTransform=t,this.emit("zoom.horizontalAxis",this.xZoom.__zoom,i)},this.onZoomVerticalAxis=({transform:t,point:i})=>{let n=t.k/this.lastPriceZoomTransform.k;1===n?this.priceZoom.scaleBy(Math.pow(2,-(t.y-this.lastPriceZoomTransform.y)/1/(this.priceScale.range()[1]-this.priceScale.range()[0])),[0,Math.abs(this.priceScale.range()[1]-this.priceScale.range()[0])/2]):this.priceZoom.scaleBy(n,[0,(this.priceScale.range()[1]-this.priceScale.range()[0])/2]),this.lastPriceZoomTransform=t,this.emit("zoom.verticalAxis",this.priceZoom.__zoom,i)},this.hideTooltips=()=>{this.crosshair.visible=!1,this.priceLabel.visible=!1,this.xLabel.visible=!1;for(let t=0;t{this.hideTooltips(),this.emit("mouseout"),this.lastEvent=null,this.render()},this.renderer=new ra({view:t.view,resolution:t.resolution,width:t.width,height:t.height}),this.priceFormat=t.priceFormat,this.xFormat=t.xFormat,this.colors=t.colors,this.horizontalAxis=new cp(this.renderer),this.verticalAxis=new cd(this.renderer),this.stage.addChild(this.horizontalAxis),this.stage.addChild(this.verticalAxis),this.stage.addChild(this.verticalAxisSeparator),this.stage.addChild(this.horizontalAxisSeparator),this.stage.addChild(this.crosshair),this.stage.addChild(...this.indicator),this.stage.addChild(this.priceLabel),this.stage.addChild(this.xLabel),this.stage.addChild(this.hitBox),this.hitBox.interactive=!0,this.hitBox.cursor="default",this.hitBox.hitArea=new nI(0,0,300,300),this.hitBox.on("wheel",this.onWheel).on("pointerdown",this.onPointerDown).on("pointermove",this.onPointerMove).on("pointerout",this.onPointerOut),this.horizontalAxis.interactive=!0,this.horizontalAxis.cursor="ew-resize",this.horizontalAxis.hitArea=new nI(t.width-72,0,72,t.height),this.horizontalAxis.on("zoomstart",this.onZoomStartHorizontalAxis).on("zoom",this.onZoomHorizontalAxis).on("dblclick",()=>this.emit("reset")),this.verticalAxis.interactive=!0,this.verticalAxis.cursor="ns-resize",this.verticalAxis.hitArea=new nI(t.width-100,0,100,t.height),this.verticalAxis.on("zoom",this.onZoomVerticalAxis).on("dblclick",()=>this.emit("reset"))}render(){this.renderer.render(this.stage)}update(t,i,n,r,s){this.data=t,this.xScale=i,this.xFormat=n,this.priceScale=r,this.priceFormat=s;let o=this.renderer.view.width,a=this.renderer.view.height,l=this.renderer.resolution;this.hitBox.hitArea=new nI(0,0,this.renderer.screen.width-72,this.renderer.screen.height-17),this.horizontalAxis.hitArea=new nI(0,this.renderer.screen.height-17,this.renderer.screen.width-72,17),this.horizontalAxis.update(this.xScale,o,a,l,this.colors),this.verticalAxis.hitArea=new nI(this.renderer.screen.width-72,0,72,this.renderer.screen.height-17),this.verticalAxis.update(r,o,a-17*l,l,this.colors),this.verticalAxisSeparator.clear(),this.verticalAxisSeparator.lineStyle({width:1,color:this.colors.emphasis200}),this.verticalAxisSeparator.moveTo(l*this.renderer.screen.width-72*l,0),this.verticalAxisSeparator.lineTo(l*this.renderer.screen.width-72*l,l*this.renderer.screen.height),this.verticalAxisSeparator.endFill(),this.horizontalAxisSeparator.clear(),this.horizontalAxisSeparator.lineStyle({width:1,color:this.colors.emphasis200}),this.horizontalAxisSeparator.moveTo(0,l*this.renderer.screen.height-17*l),this.horizontalAxisSeparator.lineTo(l*this.renderer.screen.width,l*this.renderer.screen.height-17*l),this.horizontalAxisSeparator.endFill()}destroy(){this.stage.destroy(),this.renderer.destroy()}set interactive(t){this._interactive=t,this.horizontalAxis.interactive=t,this.verticalAxis.interactive=t}},ck=class extends nG{constructor(t){super(),this.contents=void 0,this.ui=void 0,this.priceScale=oF(),this.priceZoom=new uk,this.lastPriceZoomTransform=lZ,this.xScale=null,this.xZoom=new uk,this.lastXZoomTransform=lZ,this.series=[],this.priceFormat=void 0,this.xFormat=void 0,this._colors=void 0,this.onZoomStart=t=>{this.lastXZoomTransform=t,this.emit("zoomstart")},this.onZoomEnd=()=>{this.emit("zoomend")},this.onZoom=({transform:t})=>{let i=this.xZoom.__zoom.k,n=t.x-this.lastXZoomTransform.x;this.xZoom.translateBy(n/i,0),this.lastXZoomTransform=t,this.update(),this.render(),this.emit("zoom")},this.onMouseMove=t=>this.emit("mousemove",t),this.onMouseOut=()=>this.emit("mouseout"),this.onZoomStartHorizontalAxis=t=>{this.lastXZoomTransform=t},this.onZoomHorizontalAxis=(t,i)=>{let n=t.k/this.lastXZoomTransform.k;this.xZoom.scaleBy(n,[i[0],0]),this.lastXZoomTransform=t,this.update(),this.render()},this.onZoomVerticalAxis=t=>{let i=t.k/this.lastPriceZoomTransform.k;this.priceZoom.scaleBy(i,[(this.height-17*this.ui.renderer.resolution)/2,0]),this.lastPriceZoomTransform=t,this.update(),this.render()},this.priceFormat=t.priceFormat,this.xFormat=t.xFormat,this._colors=t.colors,this.contents=new class{constructor(t){this.stage=new nJ,this.renderer=void 0,this.horizontalGrid=void 0,this.verticalgrid=void 0,this.series=void 0,this.colors=void 0,this.renderer=new ra({view:t.view,resolution:t.resolution,width:t.width,height:t.height}),this.colors=t.colors,this.horizontalGrid=new cm(this.colors.emphasis100),this.verticalgrid=new cw(this.colors.emphasis100),this.series=tJ(0,5).map(()=>new c_),this.stage.addChild(this.horizontalGrid),this.stage.addChild(this.verticalgrid),this.stage.addChild(...this.series)}render(){this.renderer.render(this.stage)}update(t,i,n,r){let s=this.renderer.resolution;this.horizontalGrid.update(i,this.renderer.width,this.renderer.height-17*s,s),this.verticalgrid.update(t,this.renderer.width-72*s,this.renderer.height,s);for(let o=0;o[i(n[o].i[s]),t(r[0]),t(r[1])]),r,s,void 0,this.colors[`accent${o+1}`],this.colors.backgroundSurface),this.series[o].visible=!0):this.series[o].visible=!1}}({view:t.chartView,resolution:t.resolution,width:t.width,height:t.height,colors:t.colors}),this.ui=new cS({view:t.axisView,resolution:t.resolution,width:t.width,height:t.height,colors:t.colors,priceFormat:this.priceFormat,xFormat:this.xFormat}),this.ui.on("zoomstart",this.onZoomStart).on("zoom",this.onZoom).on("zoomend",this.onZoomEnd).on("mousemove",this.onMouseMove).on("mouseout",this.onMouseOut).on("zoomstart.horizontalAxis",this.onZoomStartHorizontalAxis).on("zoom.horizontalAxis",this.onZoomHorizontalAxis).on("zoom.verticalAxis",this.onZoomVerticalAxis).on("reset",()=>this.reset())}render(){this.contents.render(),this.ui.render()}resize(t,i){this.contents.renderer.resize(t,i),this.ui.renderer.resize(t,i)}reset(){this.priceZoom.transform(lZ),this.xZoom.transform(lZ),this.lastPriceZoomTransform=lZ,this.lastXZoomTransform=lZ,this.update(),this.render()}destroy(){this.ui.destroy()}update(){let t=this.ui.renderer.resolution;this.priceScale.range([this.height-17*t,0]),this.xScale.range([0,this.width-72*t]);let i=this.xZoom.__zoom.rescaleX(this.xScale);i6(this.series.flat(2));let n=this.priceZoom.__zoom.rescaleX(this.priceScale);this.contents.colors=this._colors,this.contents.update(n,i,this.series,this.height),this.ui.colors=this._colors,this.ui.update(this.series,i,this.xFormat,n,this.priceFormat)}set colors(t){this._colors=t,this.update(),this.render()}set data(t){let i;i=1===t.rows.length?{cols:t.cols,rows:[t.rows[0],t.rows[0]]}:t;let n=this.ui.renderer.resolution;if(t.rows.length>0){let r=(function(){var t=ns([]),i=ng,n=nv,r=ny;function s(s){var o,a,l=Array.from(t.apply(this,arguments),nx),h=l.length,u=-1;for(let t of s)for(o=0,++u;oObject.fromEntries(i.cols.map((i,n)=>[i,t[n]])))).map(t=>Object.assign(t,{i:i.rows.map(t=>t[0])}));let s=i6(this.series.flat(2)),o=Math.abs(s[1]-s[0])/10,a=[t.rows[0][0],t.rows[t.rows.length-1][0]];a[0]===a[1]&&(a[0]=tc(a[0],-1),a[1]=tc(a[1],1)),this.priceScale=this.priceScale.domain([s[0]-o,s[1]+o]),this.xScale="number"!=typeof t.rows[0][0]?oB():oF(),this.xScale.domain(a),this.priceScale.range([0,this.height-17*n]),this.xScale.range([0,this.width-72*n]),this.xZoom.extent=[[0,0],[this.width-72*n,this.height]],this.xZoom.scaleExtent=[1,10],this.xZoom.translateExtent=[[this.xScale(t.rows[0][0]),-1/0],[this.xScale(t.rows[t.rows.length-1][0]),1/0]]}this.update(),this.render()}get height(){return this.contents.renderer.view.height}get width(){return this.contents.renderer.view.width}set interactive(t){this.ui.interactive=t}};function cT(t){let i=t?getComputedStyle(t):null;return{backgroundSurface:nY(i?.getPropertyValue("--pennant-background-surface-color").trim()||"#0a0a0a"),positiveFill:nY(i?.getPropertyValue("--pennant-color-price-positive-fill").trim()||"#16452d"),positiveStroke:nY(i?.getPropertyValue("--pennant-color-price-positive-stroke").trim()||"#26ff8a"),emphasis100:nY(i?.getPropertyValue("--pennant-color-emphasis-100").trim()||"ff268a"),emphasis200:nY(i?.getPropertyValue("--pennant-color-emphasis-200").trim()||"ff268a"),negativeFill:nY(i?.getPropertyValue("--pennant-color-price-negative-fill").trim()||"#800700"),negativeStroke:nY(i?.getPropertyValue("--pennant-color-price-negative-stroke").trim()||"#ff261a"),textPrimary:nY(i?.getPropertyValue("--pennant-font-color-base").trim()||"#ffffff"),textSecondary:nY(i?.getPropertyValue("--pennant-font-color-secondary").trim()||"#fafafa"),accent1:nY(i?.getPropertyValue("--pennant-accent1").trim()||t4.VEGA_ORANGE),accent2:nY(i?.getPropertyValue("--pennant-accent2").trim()||t4.VEGA_YELLOW),accent3:nY(i?.getPropertyValue("--pennant-accent3").trim()||t4.VEGA_RED),accent4:nY(i?.getPropertyValue("--pennant-accent4").trim()||t4.VEGA_YELLOW),accent5:nY(i?.getPropertyValue("--pennant-accent5").trim()||t4.VEGA_ORANGE),accent6:nY(i?.getPropertyValue("--pennant-accent6").trim()||t4.VEGA_RED)}}function cP(t,i){let n=0,r=0;if(void 0===i)for(let i of t)null!=i&&(i=+i)>=i&&(++n,r+=i);else{let s=-1;for(let o of t)null!=(o=i(o,++s,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function cM(t,i){return[t,i]}function cz(t){return t.length}function cE(){return function(t){if(!(s=t.length))return[];for(var i=-1,n=function(t,i){let n;if(void 0===i)for(let i of t)null!=i&&(n>i||void 0===n&&i>=i)&&(n=i);else{let r=-1;for(let s of t)null!=(s=i(s,++r,t))&&(n>s||void 0===n&&s>=s)&&(n=s)}return n}(t,cz),r=Array(n);++i{let r=i[n];if("function"!=typeof r)throw Error(`Attempt to rebind ${n} which isn't a function on the source object`);return(...n)=>{var s=r.apply(i,n);return s===i?t:s}},cC=(t,i,...n)=>{for(let r of n)t[r]=cA(t,i,r);return t},cI=(t,i,...n)=>{let r=t=>n.reduce((t,i)=>t&&i(t),t);for(let n of Object.keys(i)){let s=r(n);s&&(t[s]=cA(t,i,n))}return t},cD=t=>i=>t[i];function cL(t){return t}function cO(t){}function cN(t){return"function"==typeof t?t:()=>t}function cR(t){return"number"==typeof t&&isNaN(t)?void 0:t}function cF(){let t=()=>10,i=cO,n=cL,r=t=>null!=t;var s=function(s){let o=t.apply(this,arguments),a=s.slice(0,o).map(n);return s.map((t,s)=>(s>=o&&(a.shift(),a.push(n(t,s))),s!r(t))?i(void 0,s):i(a,s)))};return s.period=(...i)=>i.length?(t=cN(i[0]),s):t,s.accumulator=(...t)=>t.length?(i=t[0],s):i,s.defined=(...t)=>t.length?(r=t[0],s):r,s.value=(...t)=>t.length?(n=t[0],s):n,s}function cj(){let t=cL,i=()=>9,n=function(n){let r,s;let o=i.apply(this,arguments),a=2/(o+1),l=(s=[],t=>{let i;return s.length=o&&(i=cP(s)),i});return n.map((i,n)=>{let s=t(i,n);return cR(r=void 0===r?l(s):s*a+(1-a)*r)})};return n.period=(...t)=>t.length?(i=cN(t[0]),n):i,n.value=(...i)=>i.length?(t=i[0],n):t,n}function cV(t){let i=[];if(t?.encoding&&(t.encoding.y?.field&&i.push(t.encoding.y.field),t.encoding.y2?.field&&i.push(t.encoding.y2.field)),t?.layer)for(let n of t.layer)i.push(...cV(n));return i}let cB=()=>{},cY=h.forwardRef(({dataSource:t,interval:i,options:n={chartType:t1.CANDLE,studies:[],overlays:[],initialNumCandlesToDisplay:ts,initialNumCandlesToFetch:to,studySize:"50%",studySizes:[]},initialViewport:r,theme:s="dark",drawThrottleMs:o=16.67,onOptionsChanged:a=cB,onPaneChanged:l=cB,onViewportChanged:u=cB},c)=>{let{chartType:f=t1.CANDLE,studies:d=[],overlays:p=[],simple:m=!1,initialNumCandlesToDisplay:v=ts,initialNumCandlesToFetch:g=to,notEnoughDataText:y,studySize:x="50%",studySizes:w=[]}=n;h.useImperativeHandle(c,()=>({panBy:t=>{S.current.panBy(t)},reset:()=>{S.current.reset()},snapshot:async()=>S.current?await S.current.snapshot():null,subscribe:(t,i)=>{T.current.on(t,i)},zoomIn:t=>{S.current.zoomIn(t)},zoomOut:t=>{S.current.zoomOut(t)}}));let[b,_]=h.useState(400),S=h.useRef(null),k=h.useRef(null),T=h.useRef(sC("contextmenu")),[P,M]=h.useState([]),[z,E]=h.useState([]),[A,C]=h.useState(i),[I,D]=h.useState(rZ(null)),L=function(t){let i=t?getComputedStyle(t):null,n=rX(i?.getPropertyValue("--pennant-candlestick-stroke-width").trim()||"1px"),r=rX(i?.getPropertyValue("--pennant-candlestick-inner-padding").trim()||"0.4"),s=rX(i?.getPropertyValue("--pennant-candlestick-max-padding-in-pixels").trim()||"2px");return h.useMemo(()=>({strokeWidth:n,innerPadding:r,maxPaddingInPixels:s}),[n,r,s])}(k.current),[O,N]=h.useState(!0),R=h.useCallback(async(i,n,r,s=!0)=>{let o=await t.query(r,i.toISOString(),n.toISOString());M(t=>t7(o,s?t:[])),N(!1)},[t]),{ready:F,configuration:j}=function(t){let[i,n]=h.useState(!0),[r,s]=h.useState(null);return h.useEffect(()=>{(async()=>{n(!0);let i=await t.onReady();s(i),n(!1)})()},[t]),{ready:i,configuration:r}}(t),V=h.useMemo(()=>(function(t,i,n,r,s,o){let a=[],l=[],h=0,u={name:"main",layer:function(t,i){switch(t){case t1.AREA:return[{encoding:{y:{field:"close",type:"quantitative"}},mark:{type:"area",line:{color:"#009cff"},color:{gradient:"linear",stops:[{offset:0,color:"#044e80"},{offset:1,color:i.backgroundSurface}]}}}];case t1.LINE:return[{encoding:{y:{field:"close",type:"quantitative"}},mark:{type:"line",color:"#009cff"}}];case t1.OHLC:return[{encoding:{y:{field:"low",type:"quantitative"},y2:{field:"high",type:"quantitative"},color:{condition:{test:{field:"open",lt:"close"},value:i.buyStroke},value:i.sellStroke}},mark:{type:"rule"}},{encoding:{y:{field:"open",type:"quantitative"},color:{condition:{test:{field:"open",lt:"close"},value:i.buyStroke},value:i.sellStroke}},mark:{type:"tick",orient:"left"}},{encoding:{y:{field:"close",type:"quantitative"},color:{condition:{test:{field:"open",lt:"close"},value:i.buyStroke},value:i.sellStroke}},mark:{type:"tick",orient:"right"}}];case t1.CANDLE:return[{encoding:{y:{field:"low",type:"quantitative"},y2:{field:"high",type:"quantitative"},color:{condition:{test:{field:"open",lt:"close"},value:i.buyStroke},value:i.sellStroke}},mark:{type:"rule"}},{encoding:{y:{field:"open",type:"quantitative"},y2:{field:"close",type:"quantitative"},fill:{condition:{test:{field:"open",lt:"close"},value:i.buyFill},value:i.sellStroke},stroke:{condition:{test:{field:"open",lt:"close"},value:i.buyStroke},value:i.sellStroke}},mark:{type:"bar"}},{encoding:{y:{field:"open",type:"quantitative"},y2:{field:"close",type:"quantitative"},fill:{condition:{test:{field:"volume",equal:0},value:i.emphasis500},value:"#00000000"},stroke:{condition:{test:{field:"volume",equal:0},value:i.emphasis500},value:"#00000000"},strokeWidth:{value:4}},mark:{type:"bar"}}]}}(i,n)};if(r&&r.length)for(let t of r)l.push(...function(t){switch(t){case"bollinger":return[{indicator:"bollinger",on:["close"],as:["bollingerUpper","bollingerAverage","bollingerLower"]}];case"envelope":return[{indicator:"envelope",on:["close"],as:["envelopeUpper","envelopeLower"]}];case"exponentialMovingAverage":return[{indicator:"exponentialMovingAverage",on:["close"],as:["exponentialMovingAverage"]}];case"movingAverage":return[{indicator:"movingAverage",on:["close"],as:["movingAverage"]}];default:return[]}}(t)),u.layer?.push(...function(t){switch(t){case"bollinger":return[{encoding:{y:{field:"bollingerLower",type:"quantitative"}},mark:{type:"line",color:n[rW(h++)]}},{encoding:{y:{field:"bollingerUpper",type:"quantitative"}},mark:{type:"line",color:n[rW(h++)]}}];case"envelope":return[{encoding:{y:{field:"envelopeLower",type:"quantitative"}},mark:{type:"line",color:n[rW(h++)]}},{encoding:{y:{field:"envelopeUpper",type:"quantitative"}},mark:{type:"line",color:n[rW(h++)]}}];case"exponentialMovingAverage":return[{encoding:{y:{field:"exponentialMovingAverage",type:"quantitative"}},mark:{type:"line",color:n[rW(h++)]}}];case"movingAverage":return[{encoding:{y:{field:"movingAverage",type:"quantitative"}},mark:{type:"line",color:n[rW(h++)]}}];case"priceMonitoringBounds":return o?o.flatMap((t,i)=>[{encoding:{y:{field:`minValidPrice_${i+1}`,type:"quantitative"}},mark:{type:"line",color:n[rW(h++)]}},{encoding:{y:{field:`maxValidPrice_${i+1}`,type:"quantitative"}},mark:{type:"line",color:n[rW(h++)]}},{encoding:{y:{field:`referencePrice_${i+1}`,type:"quantitative"}},mark:{type:"line",color:n[rW(h++)]}}]):[];default:return[]}}(t));if(a.push(u),s&&s.length>0)for(let t of s){l.push(...function(t){switch(t){case"eldarRay":return[{indicator:"eldarRay",on:["close","high","low"],as:["bullPower","bearPower"]}];case"forceIndex":return[{indicator:"forceIndex",on:["close","volume"],as:["forceIndex"]}];case"macd":return[{indicator:"macd",on:["close"],as:["macd","signal","divergence"]}];case"relativeStrengthIndex":return[{indicator:"relativeStrengthIndex",on:["close"],as:["relativeStrengthIndex"]}];default:return[]}}(t));let i={name:t,layer:function(t,i){switch(t){case"eldarRay":return[{encoding:{y:{field:"bullPower",type:"quantitative"},fill:{value:i.eldarRayBullPower}},mark:{type:"bar"}},{encoding:{y:{field:"bearPower",type:"quantitative"},fill:{value:i.eldarRayBearPower}},mark:{type:"bar"}}];case"forceIndex":return[{encoding:{y:{field:"forceIndex",type:"quantitative"}},mark:{type:"line",color:i.forceIndex}}];case"macd":return[{encoding:{y:{field:"divergence",type:"quantitative"},fill:{condition:{test:{field:"divergence",gt:0},value:i.macdDivergenceBuy},value:i.macdDivergenceSell}},mark:{type:"bar"}},{encoding:{y:{field:"signal",type:"quantitative"}},mark:{type:"line",color:i.macdSignal}},{encoding:{y:{field:"macd",type:"quantitative"}},mark:{type:"line",color:i.macdMacd}}];case"relativeStrengthIndex":return[{encoding:{y:{field:"relativeStrengthIndex",type:"quantitative"}},mark:{type:"line",color:i.relativeStrengthIndex}}];case"volume":return[{encoding:{y:{field:"volume",type:"quantitative"},fill:{condition:{test:{field:"open",lt:"close"},value:i.volumeBuy},value:i.volumeSell}},mark:{type:"bar"}}];default:return[]}}(t,n)};a.push(i)}let c=rH().period(2)(t.map(t=>t.close)),f=rH().period(25)(t.map(t=>t.close)),d=(function(){let t=2,i=function(i){let n=i.slice(0,t);return i.map((i,r)=>(r>=t&&(n.shift(),n.push(i)),r!(null!==t))?NaN:n[n.length-1]-n[0]))};return i.period=n=>(t=n,i),i})().period(2)(t.map(t=>t.close));if(t=t.map((t,i)=>({...t,percentageChange:c[i],percentageChangeData24:f[i],absoluteChange:d[i]})),o)for(let i=0;i({...t,[`maxValidPrice_${i+1}`]:o[i].maxValidPrice,[`minValidPrice_${i+1}`]:o[i].minValidPrice,[`referencePrice_${i+1}`]:o[i].referencePrice}));return{data:{values:t},transform:l,encoding:{x:{field:"date",type:"temporal"}},vconcat:a}})(P,f,I,p,d,j?.priceMonitoringBounds),[P,f,I,p,d,j?.priceMonitoringBounds]),B=t3(A),[Y,Z]=h.useState(v*B),W=Y/b,H=h.useMemo(()=>(function(t,i,n,r,s,o){if(0===t.data?.values.length)return null;let a=t?.data?.values??[],l=function(t){let i=new rF(t,null);return i.parse(),i}(t).component.data.outputNodes.data,h=[...a];for(;null!==l;){if(l instanceof rR)switch(l.assemble().method){case"bollinger":{let t=(function(){let t=2,i=cF().accumulator(i=>{let n=i&&function(t,i){let n=function(t,i){let n,r=0,s=0,o=0;if(void 0===i)for(let i of t)null!=i&&(i=+i)>=i&&(n=i-s,s+=n/++r,o+=n*(i-s));else{let a=-1;for(let l of t)null!=(l=i(l,++a,t))&&(l=+l)>=l&&(n=l-s,s+=n/++r,o+=n*(l-s))}if(r>1)return o/(r-1)}(t,void 0);return n?Math.sqrt(n):n}(i),r=i&&cP(i);return{average:r,upper:cR(r+t*n),lower:cR(r-t*n)}}),n=t=>i(t);return n.multiplier=(...i)=>i.length?(t=i[0],n):t,cC(n,i,"period","value"),n})().value(t=>t.close)(a);h=h.map((i,n)=>({...i,bollingerUpper:t[n].upper,bollingerAverage:t[n].average,bollingerLower:t[n].lower}))}break;case"eldarRay":{let t=(function(){let t=(t,i)=>t.close,i=(t,i)=>t.high,n=(t,i)=>t.low,r=cj().period(13),s=s=>(r.value(t),cE(s,r(s)).map(t=>({bullPower:cR(i(t[0])-t[1]),bearPower:cR(n(t[0])-t[1])})));return s.closeValue=(...i)=>i.length?(t=i[0],s):t,s.highValue=(...t)=>t.length?(i=t[0],s):i,s.lowValue=(...t)=>t.length?(n=t[0],s):n,cC(s,r,"period"),s})()(a);h=h.map((i,n)=>({...i,...t[n]}))}break;case"envelope":{let t=(function(){let t=.1,i=cL,n=n=>n.map(n=>({lower:cR(i(n)*(1-t)),upper:cR(i(n)*(1+t))}));return n.factor=(...i)=>i.length?(t=i[0],n):t,n.value=(...t)=>t.length?(i=t[0],n):i,n})().value(t=>t.close)(a);h=h.map((i,n)=>({...i,envelopeUpper:t[n].upper,envelopeLower:t[n].lower}))}break;case"exponentialMovingAverage":{let t=cj().value(t=>t.close)(a);h=h.map((i,n)=>({...i,exponentialMovingAverage:t[n]}))}break;case"forceIndex":{let t=(function(){let t=(t,i)=>t.volume,i=(t,i)=>t.close,n=cj().period(13),r=cF().period(2).defined(n=>null!=i(n)&&null!=t(n)).accumulator(n=>n&&cR((i(n[1])-i(n[0]))*t(n[1]))),s=t=>{let i=r(t);return n(i)};return s.volumeValue=(...i)=>i.length?(t=i[0],s):t,s.closeValue=(...t)=>t.length?(i=t[0],s):i,cC(s,n,"period"),s})()(a);h=h.map((i,n)=>({...i,forceIndex:t[n]}))}break;case"movingAverage":{let t=(function(){let t=cF().accumulator(t=>t&&cP(t)),i=i=>t(i);return cC(i,t,"period","value"),i})().value(t=>t.close)(a);h=h.map((i,n)=>({...i,movingAverage:t[n]}))}break;case"macd":{let t=(function(){let t=cL,i=cj().period(12),n=cj().period(26),r=cj().period(9),s=s=>{i.value(t),n.value(t);let o=cE(i(s),n(s)).map(t=>void 0!==t[0]&&void 0!==t[1]?t[0]-t[1]:void 0);return cE(o,r(o)).map(t=>({macd:t[0],signal:t[1],divergence:void 0!==t[0]&&void 0!==t[1]?t[0]-t[1]:void 0}))};return s.value=(...i)=>i.length?(t=i[0],s):t,cI(s,i,cD({period:"fastPeriod"})),cI(s,n,cD({period:"slowPeriod"})),cI(s,r,cD({period:"signalPeriod"})),s})().value(t=>t.close)(a);h=h.map((i,n)=>({...i,...t[n]}))}break;case"relativeStrengthIndex":{let t=(function(){let t=cF().period(14),i=([t,i])=>tt>i?0:i-t,r=(t,i)=>void 0!==i?i+(t[t.length-1]-i)/t.length:cP(t),s=()=>{let t,s,o;return a=>{if(!a)return void(void 0!==t&&(t=NaN));if(void 0===t)return void(t=a[0]);let l=function(t,i=cM){let n=[],r,s=!1;for(let o of t)s&&n.push(i(r,o)),r=o,s=!0;return n}([t,...a]);return s=r(l.map(i),s),o=r(l.map(n),o),cR(100-100/(1+(isNaN(t)?NaN:o/s)))}};var o=i=>{let n=s();return t.accumulator(n),t(i)};return cC(o,t,"period","value"),o})().value(t=>t.close)(a);h=h.map((i,n)=>({...i,relativeStrengthIndex:t[n]}))}}l=l.parent}return t.data={values:h},{panes:"vconcat"in t?t.vconcat.map((a,l)=>({id:a.name??"",renderableElements:function t(i,n,r,s,o,a){var l,h,u,c,f,d,p,m,v,g,y,x,w;let b;let _=[],S=n,k=r;if(i?.data&&(S=i.data),i?.encoding&&(k={...r,...i.encoding}),i?.mark&&_.push((l=S,h=k,"area"===(b="object"==typeof(u=i.mark)?u.type:u)&&"object"==typeof rj?(c=l?.values,f=h.x?.field,d=h.y?.field,p=h.y2?.field,m=u?.color,v=u?.line?.color,[rV("area",void 0===p?{points:c.map(t=>[t[f],0,t[d]]),fill:m??t4.GRAY,line:v}:{points:c.map(t=>[t[f],t[d],t[p]]),fill:m??t4.GRAY,line:v})]):"line"===b?(g=l?.values,y=h.x?.field,x=h.y?.field,w=u?.color,[rV("line",{points:g.map(t=>[t[y],t[x]]),color:w})]):l?.values?.map(t=>{var i,n,r,l,c,f,d,p,m;let v={};return"bar"===b?v=function(t,i,n,r,s,o,a,l,h=.4,u=2,c=1e3){let f=0;return r&&(f=t[r]),{x:t[i],y:Math.max(t[n],f),height:Math.abs(f-t[n]),width:s-Math.min(s*h,u*c+(a&&l?2*l*c:0)),fill:o,stroke:a,lineWidth:l??1}}(t,h.x?.field,h.y?.field,h.y2?.field,s,rB(h.fill)(t),rB(h.stroke)(t),h.strokeWidth?.value??o.strokeWidth,o.innerPadding,o.maxPaddingInPixels,a):"rule"===b?(i=h.x?.field,n=h.x2?.field,r=h.y?.field,l=h.y2?.field,c=rB(h?.color)(t),v=void 0===i?{x:null,x2:null,y:t[r],y2:void 0!==l?t[l]:null,color:c}:void 0===r?{x:t[i],x2:void 0!==n?t[n]:null,y:null,y2:null,color:c}:{x:t[i],x2:void 0!==n?t[n]:null,y:t[r],y2:t[l],color:c}):"tick"===b&&(f=h.x?.field,d=h.y?.field,p=rB(h?.color)(t),m=u.orient??"left",v={x:t[f],y:t[d],width:.6*s,color:p,orient:m}),rV(b??"bar",v)}).filter(t=>void 0!==t.x))),i?.layer)for(let n of i.layer)_.push(...t(n,S,k,s,o,a));return _}(a,{values:h},t.encoding??{},i,n,r),bounds:function(t,i,n){if(!t)return[0,1];if(n){let t=n.flatMap(t=>i.map(i=>i[t])),r=i6(t),s=Math.abs(r[1]-r[0]);return[r[0]-.1*s,r[1]+.2*s]}return[0,1]}(a,h,cV(a)),originalData:h??[],grid:new nk,axis:new rk,crosshair:new n_,axisTooltip:new rP(s),annotations:0===l?[new rT(h[h.length-1].close,s)]:[],labels:0===l?[new rL({labels:o})]:[],labelLines:0===l?[new nT({labels:o})]:[],yEncodingFields:cV(a),yDomain:function(t,i){let n=cV(t).flatMap(t=>i.map(i=>i[t])),r=i6(n),s=Math.abs(r[1]-r[0]);return[r[0]-.1*s,r[1]+.2*s]}(a,h)})):[],xAxis:{id:"x-axis",originalData:a,renderableElements:[a.map(t=>new nS({x:t.date}))],axis:new nE,axisTooltip:new nA,yEncodingFields:[]}}})(V,B,L,W,t.decimalPlaces,z),[z,t.decimalPlaces,L,V,W,B]);h.useEffect(()=>{if(!F)return(async t=>{await R(new Date(new Date().getTime()-6e4*t5(t,g)),new Date,t,!1),C(t)})(i),t.subscribeData(i,t=>{M(i=>t7([t],i))}),()=>{t.unsubscribeData(),M([])}},[t,F,g,i,R]),h.useEffect(()=>{if(!F)return t.subscribeAnnotations&&!m&&t.subscribeAnnotations(t=>{E(t)}),()=>{t.unsubscribeAnnotations&&t.unsubscribeAnnotations(),E([])}},[t,F,m]),h.useEffect(()=>{requestAnimationFrame(()=>{D(rZ(k?.current))})},[s]);let X=h.useCallback(t=>{Z(t[1].getTime()-t[0].getTime()),_(k.current?.getBoundingClientRect().width??0)},[]),U=h.useCallback(t=>{u(t)},[u]),G=h.useCallback((t,i,n)=>{R(t,i,n)},[R]),$=h.useCallback(t=>{a({...n,studies:d.filter(i=>i!==t)})},[a,n,d]),q=h.useCallback(t=>{a({...n,overlays:p.filter(i=>i!==t)})},[a,n,p]),K=h.useMemo(()=>r??{date:P.length>0?P[P.length-1].date:new Date,intervalWidth:10},[P,r]);return O?tq.jsx("div",{ref:k,className:"chart__wrapper","data-theme":s,children:tq.jsx(r1,{title:"Loading"})}):H?tq.jsx(r$,{children:tq.jsx("div",{ref:k,className:"chart__wrapper","data-theme":s,children:tq.jsx(um,{ref:S,width:400,height:300,decimalPlaces:t.decimalPlaces,positionDecimalPlaces:t.positionDecimalPlaces,priceMonitoringBounds:j?.priceMonitoringBounds??[],scenegraph:H,interval:A,initialViewport:K,overlays:p,simple:m,initialNumCandles:v,colors:I,studySize:x,studySizes:w,drawThrottleMs:o,onViewportChanged:U,onGetDataRange:G,onClosePane:$,onChangePane:l,onRemoveOverlay:q,onRightClick:t=>{T.current.call("contextmenu",void 0,t)},onBoundsChanged:X})})}):tq.jsx("div",{ref:k,className:"chart__wrapper","data-theme":s,children:tq.jsx(r1,{title:y||"No data found"})})}),cZ=class extends nG{constructor(t){super(),this.colors=void 0,this.renderer=void 0,this.scaleExtent=[0,1/0],this.stage=new nJ,this.zoom=new uk,this._interactive=!0,this.data={cols:[],rows:[]},this.lastPriceZoomTransform=u_,this.lastXZoomTransform=u_,this.priceScale=oF(),this.priceZoom=new uk,this.xScale=null,this.xZoom=new uk,this.firstPoint=null,this.gesture=new uw(this),this.isZooming=!1,this.lastEvent=null,this.horizontalAxis=void 0,this.verticalAxis=void 0,this.verticalAxisSeparator=new n3,this.horizontalAxisSeparator=new n3,this.crosshair=new cc(1,8947848,[3,3]),this.indicator=rJ.range(0,6).map(()=>new cv(16711680)),this.priceLabel=new cg,this.xLabel=new cg,this.hitBox=new nJ,this.priceFormat=void 0,this.xFormat=void 0,this.onWheel=t=>{if(this._interactive){let i=t.data?.originalEvent,n=cf(i,this.renderer.resolution);this.isZooming=!0,this.hideTooltips(),this.emit("mouseout"),this.gesture.wheel?window.clearTimeout(this.gesture.wheel):(this.gesture.mouse=[n,n],this.gesture.start(this.zoom.__zoom)),this.gesture.wheel=window.setTimeout(()=>{this.isZooming=!1,this.lastEvent&&this.onPointerMove(this.lastEvent),this.gesture.wheel=null,this.gesture.end()},150),this.zoom.wheeled(-(.002*i.deltaY)*(i.ctrlKey?10:1),this.gesture.mouse[0]??[0,0],[[0,0],[100,100]]);let r=this.zoom.__zoom,s=r.k/this.lastXZoomTransform.k;1===s?this.xZoom.scaleBy(Math.pow(2,-(r.x-this.lastXZoomTransform.x)/1/(this.xScale.range()[1]-this.xScale.range()[0])),[Math.abs(this.xScale.range()[1]-this.xScale.range()[0])/2,0]):this.xZoom.scaleBy(s,[(this.xScale.range()[1]-this.xScale.range()[0])/2,0]),this.lastXZoomTransform=r,this.emit("zoom.horizontalAxis",this.zoom.__zoom,n)}},this.onPointerDown=t=>{if(this._interactive){let i=this.renderer.resolution,n=cf(t.data?.originalEvent,i);this.firstPoint=n??[0,0],t.data?.identifier&&this.renderer.context.canvas.setPointerCapture(t.data?.identifier),this.gesture.mouse=[n,this.zoom.__zoom.invert(n)],this.gesture.start(this.zoom.constrain(this.zoom.translate(this.zoom.__zoom,this.gesture.mouse[0],this.gesture.mouse[1]),[[0,0],[100,100]],this.zoom.translateExtent)),this.isZooming=!0,this.hideTooltips(),this.emit("mouseout"),this.hitBox.cursor="grabbing",this.render();let r=t=>{t.preventDefault(),this.gesture.mouse[0]=cf(t,i),this.gesture.mouse[1]&&this.gesture.zoom(this.zoom.constrain(this.zoom.translate(this.zoom.__zoom,this.gesture.mouse[0],this.gesture.mouse[1]),[[0,0],[100,100]],this.zoom.translateExtent),this.firstPoint)},s=t=>{t.preventDefault(),this.hitBox.cursor="default",window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s),t.data?.identifier&&this.renderer.context.canvas.releasePointerCapture(t.data?.identifier),this.gesture.end(),this.isZooming=!1,this.lastEvent&&this.onPointerMove(this.lastEvent)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)}},this.onPointerMove=t=>{if("ontouchstart"in self)return;this.crosshair.visible=!0,this.priceLabel.visible=!0,this.xLabel.visible=!0;for(let t=0;t1){let r=this.renderer.resolution;i*=r;let s=this.renderer.view.width,o=this.renderer.view.height,a=u7(this.data.rows.map(t=>this.xScale(t[0])),i),l=this.data.rows[a];this.crosshair.update(this.xScale(l[0]),r*n,s,o,r);for(let t=0;t({color:nB(this.colors[`accent${t+1}`]),name:this.data.cols[t+1],value:this.priceFormat(l[t+1])}))}),this.lastEvent=t}},this.onZoomStartHorizontalAxis=t=>{this.emit("zoomstart.horizontalAxis",t)},this.onZoomHorizontalAxis=({transform:t,point:i})=>{let n=t.k/this.lastXZoomTransform.k;1===n?this.xZoom.scaleBy(Math.pow(2,-(t.x-this.lastXZoomTransform.x)/(this.xScale.range()[1]-this.xScale.range()[0])),[Math.abs(this.xScale.range()[1]-this.xScale.range()[0])/2,0]):this.xZoom.scaleBy(n,[(this.xScale.range()[1]-this.xScale.range()[0])/2,0]),this.lastXZoomTransform=t,this.emit("zoom.horizontalAxis",this.xZoom.__zoom,i)},this.onZoomVerticalAxis=({transform:t,point:i})=>{let n=t.k/this.lastPriceZoomTransform.k;1===n?this.priceZoom.scaleBy(Math.pow(2,-(t.y-this.lastPriceZoomTransform.y)/1/(this.priceScale.range()[1]-this.priceScale.range()[0])),[0,Math.abs(this.priceScale.range()[1]-this.priceScale.range()[0])/2]):this.priceZoom.scaleBy(n,[0,(this.priceScale.range()[1]-this.priceScale.range()[0])/2]),this.lastPriceZoomTransform=t,this.emit("zoom.verticalAxis",this.priceZoom.__zoom,i)},this.hideTooltips=()=>{this.crosshair.visible=!1,this.priceLabel.visible=!1,this.xLabel.visible=!1;for(let t=0;t{this.hideTooltips(),this.emit("mouseout"),this.lastEvent=null,this.render()},this.renderer=new ra({view:t.view,resolution:t.resolution,width:t.width,height:t.height}),this.priceFormat=t.priceFormat,this.xFormat=t.xFormat,this.colors=t.colors,this.horizontalAxis=new cp(this.renderer),this.verticalAxis=new cd(this.renderer),this.stage.addChild(this.horizontalAxis),this.stage.addChild(this.verticalAxis),this.stage.addChild(this.verticalAxisSeparator),this.stage.addChild(this.horizontalAxisSeparator),this.stage.addChild(this.crosshair),this.stage.addChild(...this.indicator),this.stage.addChild(this.priceLabel),this.stage.addChild(this.xLabel),this.stage.addChild(this.hitBox),this.hitBox.interactive=!0,this.hitBox.cursor="default",this.hitBox.hitArea=new nI(0,0,300,300),this.hitBox.on("wheel",this.onWheel).on("pointerdown",this.onPointerDown).on("pointermove",this.onPointerMove).on("pointerout",this.onPointerOut),this.horizontalAxis.interactive=!0,this.horizontalAxis.cursor="ew-resize",this.horizontalAxis.hitArea=new nI(t.width-72,0,72,t.height),this.horizontalAxis.on("zoomstart",this.onZoomStartHorizontalAxis).on("zoom",this.onZoomHorizontalAxis).on("dblclick",()=>this.emit("reset")),this.verticalAxis.interactive=!0,this.verticalAxis.cursor="ns-resize",this.verticalAxis.hitArea=new nI(t.width-100,0,100,t.height),this.verticalAxis.on("zoom",this.onZoomVerticalAxis).on("dblclick",()=>this.emit("reset"))}render(){this.renderer.render(this.stage)}update(t,i,n,r,s,o){this.data=t,this.xScale=i,this.xFormat=n,this.priceScale=r,this.priceFormat=s;let a=this.renderer.view.width,l=this.renderer.view.height,h=this.renderer.resolution;this.hitBox.hitArea=new nI(0,0,this.renderer.screen.width-72,this.renderer.screen.height-17),this.horizontalAxis.hitArea=new nI(0,this.renderer.screen.height-17,this.renderer.screen.width-72,17),this.horizontalAxis.update(this.xScale,a,l,h,this.colors),this.verticalAxis.hitArea=new nI(this.renderer.screen.width-72,0,72,this.renderer.screen.height-17),this.verticalAxis.update(r,a,l-17*h,h,this.colors,o),this.verticalAxisSeparator.clear(),this.verticalAxisSeparator.lineStyle({width:1,color:this.colors.emphasis200}),this.verticalAxisSeparator.moveTo(h*this.renderer.screen.width-72*h,0),this.verticalAxisSeparator.lineTo(h*this.renderer.screen.width-72*h,h*this.renderer.screen.height),this.verticalAxisSeparator.endFill(),this.horizontalAxisSeparator.clear(),this.horizontalAxisSeparator.lineStyle({width:1,color:this.colors.emphasis200}),this.horizontalAxisSeparator.moveTo(0,h*this.renderer.screen.height-17*h),this.horizontalAxisSeparator.lineTo(h*this.renderer.screen.width,h*this.renderer.screen.height-17*h),this.horizontalAxisSeparator.endFill()}destroy(){this.stage.destroy(),this.renderer.destroy()}set interactive(t){this._interactive=t,this.horizontalAxis.interactive=t,this.verticalAxis.interactive=t}},cW=class extends nG{constructor(t){super(),this.contents=void 0,this.ui=void 0,this.priceScale=oF(),this.priceZoom=new uk,this.lastPriceZoomTransform=lZ,this.xScale=null,this.xZoom=new uk,this.lastXZoomTransform=lZ,this._data={cols:[],rows:[]},this.priceFormat=void 0,this.yAxisTickFormat=void 0,this.xFormat=void 0,this._colors=void 0,this.onZoomStart=t=>{this.lastXZoomTransform=t,this.emit("zoomstart")},this.onZoomEnd=()=>{this.emit("zoomend")},this.onZoom=({transform:t})=>{let i=this.xZoom.__zoom.k,n=t.x-this.lastXZoomTransform.x;this.xZoom.translateBy(n/i,0),this.lastXZoomTransform=t,this.update(),this.render(),this.emit("zoom")},this.onMouseMove=t=>this.emit("mousemove",t),this.onMouseOut=()=>this.emit("mouseout"),this.onZoomStartHorizontalAxis=t=>{this.lastXZoomTransform=t},this.onZoomHorizontalAxis=(t,i)=>{let n=t.k/this.lastXZoomTransform.k;this.xZoom.scaleBy(n,[i[0],0]),this.lastXZoomTransform=t,this.update(),this.render()},this.onZoomVerticalAxis=t=>{let i=t.k/this.lastPriceZoomTransform.k;this.priceZoom.scaleBy(i,[(this.height-17*this.ui.renderer.resolution)/2,0]),this.lastPriceZoomTransform=t,this.update(),this.render()},this.priceFormat=t.priceFormat,this.yAxisTickFormat=t.yAxisTickFormat,this.xFormat=t.xFormat,this._colors=t.colors,this.contents=new class{constructor(t){this.stage=new nJ,this.renderer=void 0,this.horizontalGrid=void 0,this.verticalgrid=void 0,this.series=void 0,this.colors=void 0,this.renderer=new ra({view:t.view,resolution:t.resolution,width:t.width,height:t.height}),this.colors=t.colors,this.horizontalGrid=new cm(this.colors.emphasis100),this.verticalgrid=new cw(this.colors.emphasis100),this.series=tJ(0,5).map(()=>new cy),this.stage.addChild(this.horizontalGrid),this.stage.addChild(this.verticalgrid),this.stage.addChild(...this.series)}render(){this.renderer.render(this.stage)}update(t,i,n,r,s){let o=this.renderer.resolution;this.horizontalGrid.update(i,this.renderer.width,this.renderer.height-17*o,o),this.verticalgrid.update(t,this.renderer.width-72*o,this.renderer.height,o);for(let t=0;t[i[0],i[t+1]]),s,o,void 0,this.colors[`accent${t+1}`],this.colors.backgroundSurface,!1,r)):this.series[t].visible=!1}}({view:t.chartView,resolution:t.resolution,width:t.width,height:t.height,colors:t.colors}),this.ui=new cZ({view:t.axisView,resolution:t.resolution,width:t.width,height:t.height,colors:t.colors,priceFormat:this.priceFormat,xFormat:this.xFormat}),this.ui.on("zoomstart",this.onZoomStart).on("zoom",this.onZoom).on("zoomend",this.onZoomEnd).on("mousemove",this.onMouseMove).on("mouseout",this.onMouseOut).on("zoomstart.horizontalAxis",this.onZoomStartHorizontalAxis).on("zoom.horizontalAxis",this.onZoomHorizontalAxis).on("zoom.verticalAxis",this.onZoomVerticalAxis).on("reset",()=>this.reset())}render(){this.contents.render(),this.ui.render()}resize(t,i){this.contents.renderer.resize(t,i),this.ui.renderer.resize(t,i)}reset(){this.priceZoom.transform(lZ),this.xZoom.transform(lZ),this.lastPriceZoomTransform=lZ,this.lastXZoomTransform=lZ,this.update(),this.render()}destroy(){this.ui.destroy()}update(){let t=this.ui.renderer.resolution;this.priceScale.range([this.height-17*t,0]),this.xScale.range([0,this.width-72*t]);let i=this.xZoom.__zoom.rescaleX(this.xScale);i6(this._data.rows.flatMap(t=>t.slice(1)));let n=this.priceZoom.__zoom.rescaleX(this.priceScale);this.contents.colors=this._colors,this.contents.update(n,i,this._data.rows.map(t=>[i(t[0]),...t.slice(1).map(t=>n(t))]),n(this._data.rows[0][1]),this.height),this.ui.colors=this._colors,this.ui.update(this._data,i,this.xFormat,n,this.priceFormat,this.yAxisTickFormat)}set colors(t){this._colors=t,this.update(),this.render()}get data(){return this._data}set data(t){1===t.rows.length?this._data={cols:t.cols,rows:[t.rows[0],t.rows[0]]}:this._data=t;let i=this.ui.renderer.resolution;if(t.rows.length>0){let n=i6(t.rows.flatMap(t=>t.slice(1))),r=Math.abs(n[1]-n[0])/10,s=[t.rows[0][0],t.rows[t.rows.length-1][0]];s[0]===s[1]&&(s[0]=tc(s[0],-1),s[1]=tc(s[1],1)),this.priceScale=this.priceScale.domain([n[0]-r,n[1]+r]),this.xScale="number"!=typeof t.rows[0][0]?oB():oF(),this.xScale.domain(s),this.priceScale.range([0,this.height-17*i]),this.xScale.range([0,this.width-72*i]),this.xZoom.extent=[[0,0],[this.width-72*i,this.height]],this.xZoom.scaleExtent=[1,10],this.xZoom.translateExtent=[[this.xScale(t.rows[0][0]),-1/0],[this.xScale(t.rows[t.rows.length-1][0]),1/0]]}this.update(),this.render()}get height(){return this.contents.renderer.view.height}get width(){return this.contents.renderer.view.width}set interactive(t){this.ui.interactive=t}};function cH(t){let i=t?getComputedStyle(t):null;return{backgroundSurface:nY(i?.getPropertyValue("--pennant-background-surface-color").trim()||"#0a0a0a"),positiveFill:nY(i?.getPropertyValue("--pennant-color-price-positive-fill").trim()||"#16452d"),positiveStroke:nY(i?.getPropertyValue("--pennant-color-price-positive-stroke").trim()||"#26ff8a"),emphasis100:nY(i?.getPropertyValue("--pennant-color-emphasis-100").trim()||"ff268a"),emphasis200:nY(i?.getPropertyValue("--pennant-color-emphasis-200").trim()||"ff268a"),negativeFill:nY(i?.getPropertyValue("--pennant-color-price-negative-fill").trim()||"#800700"),negativeStroke:nY(i?.getPropertyValue("--pennant-color-price-negative-stroke").trim()||"#ff261a"),textPrimary:nY(i?.getPropertyValue("--pennant-font-color-base").trim()||"#ffffff"),textSecondary:nY(i?.getPropertyValue("--pennant-font-color-secondary").trim()||"#fafafa"),accent1:nY(i?.getPropertyValue("--pennant-accent1").trim()||t4.VEGA_ORANGE),accent2:nY(i?.getPropertyValue("--pennant-accent2").trim()||t4.VEGA_YELLOW),accent3:nY(i?.getPropertyValue("--pennant-accent3").trim()||t4.VEGA_RED),accent4:nY(i?.getPropertyValue("--pennant-accent4").trim()||t4.VEGA_YELLOW),accent5:nY(i?.getPropertyValue("--pennant-accent5").trim()||t4.VEGA_ORANGE),accent6:nY(i?.getPropertyValue("--pennant-accent6").trim()||t4.VEGA_RED)}}var cX="line-chart-module_container__0ayZx",cU="line-chart-module_canvas__oukR-";class cG{constructor(t){this.stage=new nJ,this.renderer=void 0,this.horizontalGrid=void 0,this.verticalgrid=void 0,this.priceCurve=void 0,this.colors=void 0,this.renderer=new ra({view:t.view,resolution:t.resolution,width:t.width,height:t.height}),this.colors=t.colors,this.horizontalGrid=new cm(this.colors.emphasis100),this.verticalgrid=new cw(this.colors.emphasis100),this.priceCurve=new uM(t.colors),this.stage.addChild(this.horizontalGrid),this.stage.addChild(this.verticalgrid),this.stage.addChild(this.priceCurve)}render(){this.renderer.render(this.stage)}update(t,i,n,r,s){let o=this.renderer.resolution;this.horizontalGrid.update(i,this.renderer.width,this.renderer.height-17*o,o),this.verticalgrid.update(t,this.renderer.width-72*o,this.renderer.height,o),this.priceCurve.visible=!0,this.priceCurve.colors=this.colors,this.priceCurve.update(t,i,n.map(t=>[t[0],t[1]]),r,s,o)}}class c$ extends nG{constructor(t){super(),this.colors=void 0,this.renderer=void 0,this.scaleExtent=[0,1/0],this.stage=new nJ,this.zoom=new uk,this._interactive=!0,this.data={cols:["col1","col2"],rows:[]},this.lastPriceZoomTransform=u_,this.lastTimeZoomTransform=u_,this.priceScale=oF(),this.priceZoom=new uk,this.startPrice=0,this.timeScale=oB(),this.timeZoom=new uk,this.firstPoint=null,this.gesture=new uw(this),this.isZooming=!1,this.lastEvent=null,this.horizontalAxis=void 0,this.verticalAxis=void 0,this.startPriceLine=new n3,this.verticalAxisSeparator=new n3,this.horizontalAxisSeparator=new n3,this.crosshair=new cc(1,8947848,[3,3]),this.indicator=rJ.range(0,6).map(()=>new cv(16711680)),this.priceLabel=new cg,this.timeLabel=new cg,this.startPriceLabel=new cg,this.hitBox=new nJ,this.priceFormat=void 0,this.onWheel=t=>{if(this._interactive){let i=t.data?.originalEvent,n=cf(i,this.renderer.resolution);this.isZooming=!0,this.hideTooltips(),this.emit("mouseout"),this.gesture.wheel?window.clearTimeout(this.gesture.wheel):(this.gesture.mouse=[n,n],this.gesture.start(this.zoom.__zoom)),this.gesture.wheel=window.setTimeout(()=>{this.isZooming=!1,this.lastEvent&&this.onPointerMove(this.lastEvent),this.gesture.wheel=null,this.gesture.end()},150),this.zoom.wheeled(-(.002*i.deltaY)*(i.ctrlKey?10:1),this.gesture.mouse[0]??[0,0],[[0,0],[100,100]]);let r=this.zoom.__zoom,s=r.k/this.lastTimeZoomTransform.k;1===s?this.timeZoom.scaleBy(Math.pow(2,-(r.x-this.lastTimeZoomTransform.x)/1/(this.timeScale.range()[1]-this.timeScale.range()[0])),[Math.abs(this.timeScale.range()[1]-this.timeScale.range()[0])/2,0]):this.timeZoom.scaleBy(s,[(this.timeScale.range()[1]-this.timeScale.range()[0])/2,0]),this.lastTimeZoomTransform=r,this.emit("zoom.horizontalAxis",this.zoom.__zoom,n)}},this.onPointerDown=t=>{if(this._interactive){let i=this.renderer.resolution,n=cf(t.data?.originalEvent,i);this.firstPoint=n??[0,0],t.data?.identifier&&this.renderer.context.canvas.setPointerCapture(t.data?.identifier),this.gesture.mouse=[n,this.zoom.__zoom.invert(n)],this.gesture.start(this.zoom.constrain(this.zoom.translate(this.zoom.__zoom,this.gesture.mouse[0],this.gesture.mouse[1]),[[0,0],[100,100]],this.zoom.translateExtent)),this.isZooming=!0,this.hideTooltips(),this.emit("mouseout"),this.hitBox.cursor="grabbing",this.render();let r=t=>{t.preventDefault(),this.gesture.mouse[0]=cf(t,i),this.gesture.mouse[1]&&this.gesture.zoom(this.zoom.constrain(this.zoom.translate(this.zoom.__zoom,this.gesture.mouse[0],this.gesture.mouse[1]),[[0,0],[100,100]],this.zoom.translateExtent),this.firstPoint)},s=t=>{t.preventDefault(),this.hitBox.cursor="default",window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",s),t.data?.identifier&&this.renderer.context.canvas.releasePointerCapture(t.data?.identifier),this.gesture.end(),this.isZooming=!1,this.lastEvent&&this.onPointerMove(this.lastEvent)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",s)}},this.onPointerMove=t=>{if("ontouchstart"in self)return;this.crosshair.visible=!0,this.priceLabel.visible=!0,this.timeLabel.visible=!0;for(let t=0;t1){let r=this.renderer.resolution;i*=r;let s=this.renderer.view.width,o=this.renderer.view.height,a=u7(this.data.rows.map(t=>this.timeScale(t[0])),i),l=this.data.rows[a];this.crosshair.update(this.timeScale(l[0]),r*n,s,o,r);for(let t=0;tthis.startPrice?this.colors.positiveStroke:this.colors.negativeStroke:this.colors[`accent${t+1}`]):this.indicator[t].visible=!1;if(this.priceLabel.update(this.priceFormat(this.priceScale.invert(r*n)),s-7*r,r*n,{x:1,y:.5},r,{...this.colors,backgroundSurface:this.colors.emphasis100}),this.timeLabel.update(tW(l[0],"dd/MM/yyyy HH:mm a"),this.timeScale(l[0]),o-17*r/2,{x:.5,y:.5},r,{...this.colors,backgroundSurface:this.colors.emphasis100}),this.render(),this.isZooming)this.onPointerOut();else{let t={index:a,point:[this.timeScale(l[0])/r,n],value:l[0],series:rJ.range(0,this.data.cols.length-1).map(t=>({color:2===this.data.cols.length?l[t+1]>this.startPrice?nB(this.colors.positiveStroke):nB(this.colors.negativeStroke):nB(this.colors[`accent${t+1}`]),name:this.data.cols[t+1],value:this.priceFormat(l[t+1])}))};this.emit("mousemove",t)}this.lastEvent=t}},this.onZoomStartHorizontalAxis=t=>{this.emit("zoomstart.horizontalAxis",t)},this.onZoomHorizontalAxis=({transform:t,point:i})=>{let n=t.k/this.lastTimeZoomTransform.k;1===n?this.timeZoom.scaleBy(Math.pow(2,-(t.x-this.lastTimeZoomTransform.x)/(this.timeScale.range()[1]-this.timeScale.range()[0])),[Math.abs(this.timeScale.range()[1]-this.timeScale.range()[0])/2,0]):this.timeZoom.scaleBy(n,[(this.timeScale.range()[1]-this.timeScale.range()[0])/2,0]),this.lastTimeZoomTransform=t,this.emit("zoom.horizontalAxis",this.timeZoom.__zoom,i)},this.onZoomVerticalAxis=({transform:t,point:i})=>{let n=t.k/this.lastPriceZoomTransform.k;1===n?this.priceZoom.scaleBy(Math.pow(2,-(t.y-this.lastPriceZoomTransform.y)/1/(this.priceScale.range()[1]-this.priceScale.range()[0])),[0,Math.abs(this.priceScale.range()[1]-this.priceScale.range()[0])/2]):this.priceZoom.scaleBy(n,[0,(this.priceScale.range()[1]-this.priceScale.range()[0])/2]),this.lastPriceZoomTransform=t,this.emit("zoom.verticalAxis",this.priceZoom.__zoom,i)},this.hideTooltips=()=>{this.crosshair.visible=!1,this.priceLabel.visible=!1,this.timeLabel.visible=!1;for(let t=0;t{this.hideTooltips(),this.emit("mouseout"),this.lastEvent=null,this.render()},this.renderer=new ra({view:t.view,resolution:t.resolution,width:t.width,height:t.height}),this.priceFormat=t.priceFormat,this.colors=t.colors,this.horizontalAxis=new cp(this.renderer),this.verticalAxis=new cd(this.renderer),this.stage.addChild(this.horizontalAxis),this.stage.addChild(this.verticalAxis),this.stage.addChild(this.startPriceLine),this.stage.addChild(this.verticalAxisSeparator),this.stage.addChild(this.horizontalAxisSeparator),this.stage.addChild(this.crosshair),this.stage.addChild(...this.indicator),this.stage.addChild(this.startPriceLabel),this.stage.addChild(this.priceLabel),this.stage.addChild(this.timeLabel),this.stage.addChild(this.hitBox),this.hitBox.interactive=!0,this.hitBox.cursor="default",this.hitBox.hitArea=new nI(0,0,300,300),this.hitBox.on("wheel",this.onWheel).on("pointerdown",this.onPointerDown).on("pointermove",this.onPointerMove).on("pointerout",this.onPointerOut),this.horizontalAxis.interactive=!0,this.horizontalAxis.cursor="ew-resize",this.horizontalAxis.hitArea=new nI(t.width-72,0,72,t.height),this.horizontalAxis.on("zoomstart",this.onZoomStartHorizontalAxis).on("zoom",this.onZoomHorizontalAxis).on("dblclick",()=>this.emit("reset")),this.verticalAxis.interactive=!0,this.verticalAxis.cursor="ns-resize",this.verticalAxis.hitArea=new nI(t.width-100,0,100,t.height),this.verticalAxis.on("zoom",this.onZoomVerticalAxis).on("dblclick",()=>this.emit("reset"))}render(){this.renderer.render(this.stage)}update(t,i,n,r,s){this.data=t,this.timeScale=i,this.priceScale=n,this.startPrice=r,this.priceFormat=s;let o=this.renderer.view.width,a=this.renderer.view.height,l=this.renderer.resolution;this.hitBox.hitArea=new nI(0,0,this.renderer.screen.width-72,this.renderer.screen.height-17),this.horizontalAxis.hitArea=new nI(0,this.renderer.screen.height-17,this.renderer.screen.width-72,17),this.horizontalAxis.update(this.timeScale,o,a,l,this.colors),this.verticalAxis.hitArea=new nI(this.renderer.screen.width-72,0,72,this.renderer.screen.height-17),this.verticalAxis.update(n,o,a-17*l,l,this.colors),this.startPriceLine.clear(),this.startPriceLine.lineStyle({width:2,color:this.colors.textPrimary,lineDash:[6,3]}),this.startPriceLine.moveTo(0,n(r)),this.startPriceLine.lineTo(l*this.renderer.screen.width,n(r)),this.startPriceLine.endFill(),this.data.cols.length>2?(this.startPriceLine.visible=!1,this.startPriceLabel.visible=!1):(this.startPriceLine.visible=!0,this.startPriceLabel.visible=!0),this.priceScale.tickFormat(a/l/50),this.startPriceLabel.update(s(r),l*this.renderer.screen.width-7*l,n(r),{x:1,y:.5},l,{backgroundSurface:this.colors.emphasis200,textPrimary:this.colors.textPrimary}),this.verticalAxisSeparator.clear(),this.verticalAxisSeparator.lineStyle({width:1,color:this.colors.emphasis200}),this.verticalAxisSeparator.moveTo(l*this.renderer.screen.width-72*l,0),this.verticalAxisSeparator.lineTo(l*this.renderer.screen.width-72*l,l*this.renderer.screen.height),this.verticalAxisSeparator.endFill(),this.horizontalAxisSeparator.clear(),this.horizontalAxisSeparator.lineStyle({width:1,color:this.colors.emphasis200}),this.horizontalAxisSeparator.moveTo(0,l*this.renderer.screen.height-17*l),this.horizontalAxisSeparator.lineTo(l*this.renderer.screen.width,l*this.renderer.screen.height-17*l),this.horizontalAxisSeparator.endFill()}destroy(){this.stage.destroy(),this.renderer.destroy()}set interactive(t){this._interactive=t,this.horizontalAxis.interactive=t,this.verticalAxis.interactive=t}}class cq extends nG{constructor(t){super(),this.contents=void 0,this.ui=void 0,this.priceScale=oF(),this.priceZoom=new uk,this.lastPriceZoomTransform=lZ,this.timeScale=oB(),this.timeZoom=new uk,this.lastTimeZoomTransform=lZ,this._data={cols:["col1","col2"],rows:[]},this.priceFormat=void 0,this._colors=void 0,this.onZoomStart=t=>{this.lastTimeZoomTransform=t,this.emit("zoomstart")},this.onZoomEnd=()=>{this.emit("zoomend")},this.onZoom=({transform:t})=>{let i=this.timeZoom.__zoom.k,n=t.x-this.lastTimeZoomTransform.x;this.timeZoom.translateBy(n/i,0),this.lastTimeZoomTransform=t,this.update(),this.render(),this.emit("zoom")},this.onMouseMove=t=>this.emit("mousemove",t),this.onMouseOut=()=>this.emit("mouseout"),this.onZoomStartHorizontalAxis=t=>{this.lastTimeZoomTransform=t},this.onZoomHorizontalAxis=(t,i)=>{let n=t.k/this.lastTimeZoomTransform.k;this.timeZoom.scaleBy(n,[i[0],0]),this.lastTimeZoomTransform=t,this.update(),this.render()},this.onZoomVerticalAxis=t=>{let i=t.k/this.lastPriceZoomTransform.k;this.priceZoom.scaleBy(i,[(this.height-17*this.ui.renderer.resolution)/2,0]),this.lastPriceZoomTransform=t,this.update(),this.render()},this.priceFormat=t.priceFormat,this._colors=t.colors,this.contents=new cG({view:t.chartView,resolution:t.resolution,width:t.width,height:t.height,colors:t.colors}),this.ui=new c$({view:t.axisView,resolution:t.resolution,width:t.width,height:t.height,colors:t.colors,priceFormat:this.priceFormat}),this.ui.on("zoomstart",this.onZoomStart).on("zoom",this.onZoom).on("zoomend",this.onZoomEnd).on("mousemove",this.onMouseMove).on("mouseout",this.onMouseOut).on("zoomstart.horizontalAxis",this.onZoomStartHorizontalAxis).on("zoom.horizontalAxis",this.onZoomHorizontalAxis).on("zoom.verticalAxis",this.onZoomVerticalAxis).on("reset",()=>this.reset())}render(){this.contents.render(),this.ui.render()}resize(t,i){this.contents.renderer.resize(t,i),this.ui.renderer.resize(t,i)}reset(){this.priceZoom.transform(lZ),this.timeZoom.transform(lZ),this.lastPriceZoomTransform=lZ,this.lastTimeZoomTransform=lZ,this.update(),this.render()}destroy(){this.ui.destroy()}update(){let t=this.ui.renderer.resolution;this.priceScale.range([this.height-17*t,0]),this.timeScale.range([0,this.width-72*t]);let i=this.timeZoom.__zoom.rescaleX(this.timeScale);i6(this._data.rows.flatMap(t=>t.slice(1)));let n=this.priceZoom.__zoom.rescaleX(this.priceScale);this.contents.colors=this._colors,this.contents.update(n,i,this._data.rows.map(t=>[i(t[0]),n(t[1])]),n(this._data.rows[0][1]),this.height),this.ui.colors=this._colors,this.ui.update(this._data,i,n,this._data.rows[0][1],this.priceFormat)}set colors(t){this._colors=t,this.update(),this.render()}get data(){return this._data}set data(t){1===t.rows.length?this._data={cols:t.cols,rows:[t.rows[0],t.rows[0]]}:this._data=t;let i=this.ui.renderer.resolution;if(t.rows.length>0){let n=i6(t.rows.flatMap(t=>t.slice(1))),r=Math.abs(n[1]-n[0])/10,s=[t.rows[0][0],t.rows[t.rows.length-1][0]];s[0]===s[1]&&(s[0]=tc(s[0],-1),s[1]=tc(s[1],1)),this.priceScale=this.priceScale.domain([n[0]-r,n[1]+r]),this.timeScale=this.timeScale.domain(s),this.priceScale.range([0,this.height-17*i]),this.timeScale.range([0,this.width-72*i]),this.timeZoom.extent=[[0,0],[this.width-72*i,this.height]],this.timeZoom.scaleExtent=[1,10],this.timeZoom.translateExtent=[[this.timeScale(t.rows[0][0]),-1/0],[this.timeScale(t.rows[t.rows.length-1][0]),1/0]]}this.update(),this.render()}get height(){return this.contents.renderer.view.height}get width(){return this.contents.renderer.view.width}set interactive(t){this.ui.interactive=t}}function cK(t){let i=t?getComputedStyle(t):null;return{backgroundSurface:nY(i?.getPropertyValue("--pennant-background-surface-color").trim()||"#0a0a0a"),positiveFill:nY(i?.getPropertyValue("--pennant-color-price-positive-fill").trim()||"#16452d"),positiveStroke:nY(i?.getPropertyValue("--pennant-color-price-positive-stroke").trim()||"#26ff8a"),emphasis100:nY(i?.getPropertyValue("--pennant-color-emphasis-100").trim()||"ff268a"),emphasis200:nY(i?.getPropertyValue("--pennant-color-emphasis-200").trim()||"ff268a"),negativeFill:nY(i?.getPropertyValue("--pennant-color-price-negative-fill").trim()||"#800700"),negativeStroke:nY(i?.getPropertyValue("--pennant-color-price-negative-stroke").trim()||"#ff261a"),textPrimary:nY(i?.getPropertyValue("--pennant-font-color-base").trim()||"#ffffff"),textSecondary:nY(i?.getPropertyValue("--pennant-font-color-secondary").trim()||"#fafafa"),accent1:nY(i?.getPropertyValue("--pennant-accent1").trim()||t4.VEGA_ORANGE),accent2:nY(i?.getPropertyValue("--pennant-accent2").trim()||t4.VEGA_YELLOW),accent3:nY(i?.getPropertyValue("--pennant-accent3").trim()||t4.VEGA_RED),accent4:nY(i?.getPropertyValue("--pennant-accent4").trim()||t4.VEGA_YELLOW),accent5:nY(i?.getPropertyValue("--pennant-accent5").trim()||t4.VEGA_ORANGE),accent6:nY(i?.getPropertyValue("--pennant-accent6").trim()||t4.VEGA_RED)}}var cJ="price-chart-module_container__lRKvJ",cQ="price-chart-module_canvas__gkqM-";i.Ms=cY,i.oX=t1,i.ol=ch,i.Xp=t2,i.wW=({data:t,annotations:i,interactive:n=!0,notEnoughDataText:r="Not enough data",priceFormat:s=iK,theme:o="dark",tooltip:a,xFormat:l=iJ,yAxisTickFormat:u})=>{let c=h.useRef(null),f=h.useRef(null),d=h.useRef(null),p=h.useRef(null),m=h.useRef(null),[v,g]=h.useState(null),{ref:y,width:x=300,height:w=300,devicePixelContentBoxSizeInlineSize:b,devicePixelContentBoxSizeBlockSize:_}=r0(50);return h.useEffect(()=>{let n=cH(p?.current);return d.current=new cW({chartView:c.current,axisView:f.current,resolution:window.devicePixelRatio,width:300,height:300,priceFormat:s,yAxisTickFormat:u,xFormat:l,colors:n}),d.current.on("mousemove",n=>{let r=n.point,s=p.current.getBoundingClientRect();tr({getBoundingClientRect:()=>({width:0,height:0,x:r[0]+s.x,y:r[1]+s.y,top:r[1]+s.y,left:r[0]+s.x,right:r[0]+s.x,bottom:r[1]+s.y})},m.current,{placement:"right",middleware:[M(16),P(),z()]}).then(({x:r,y:s})=>{Object.assign(m.current.style,{left:0,top:0,transform:`translate(${Math.round(r)}px,${Math.round(s)}px)`,visibility:"visible"}),g({value:n.value,label:{primary:rU(n.value)?tW(n.value,"dd/MM/yyyy"):t.cols[0],sub:rU(n.value)?tW(n.value,"HH:mm a"):l(n.value)},series:n.series,annotations:i?.[n.index]})})}).on("mouseout",()=>{Object.assign(m.current.style,{visibility:"hidden"}),g(null)}),()=>{d.current.destroy()}},[i,t.cols,s,l,u]),h.useEffect(()=>{d.current.resize(b?b/window.devicePixelRatio:x,_?_/window.devicePixelRatio:w),d.current.data=t,d.current.render()},[w,x,t,b,_]),h.useEffect(()=>{requestAnimationFrame(()=>d.current.colors=cH(p?.current))},[o]),h.useEffect(()=>{d.current.reset()},[t]),h.useEffect(()=>{d.current.interactive=n},[n]),t.rows.length<2?tq.jsx("div",{ref:p,className:cX,"data-theme":o,children:tq.jsx(r1,{delay:0,title:r})}):tq.jsxs("div",{ref:p,className:cX,"data-theme":o,children:[tq.jsxs("div",{ref:y,className:"line-chart-module_canvasContainer__M7fxl",children:[tq.jsx("canvas",{ref:c,className:cU}),tq.jsx("canvas",{ref:f,className:cU})]}),tq.jsx("div",{ref:m,className:"line-chart-module_tooltipContainer__6yKeq",children:v&&(a?a(v):tq.jsx(uv,{...v}))})]})},i.aV={BOLLINGER:"bollinger",ENVELOPE:"envelope",EXPONENTIAL_MOVING_AVERAGE:"exponentialMovingAverage",MOVING_AVERAGE:"movingAverage",PRICE_MONITORING_BOUNDS:"priceMonitoringBounds"},i.Ki={ELDAR_RAY:"eldarRay",FORCE_INDEX:"forceIndex",MACD:"macd",RELATIVE_STRENGTH_INDEX:"relativeStrengthIndex",VOLUME:"volume"},i.QE={area:"Mountain",candle:"Candlestick",line:"Line",ohlc:"OHLC"},i.js={bollinger:"Bollinger bands",envelope:"Envelope",exponentialMovingAverage:"EMA",movingAverage:"Moving average",priceMonitoringBounds:"Price monitoring bounds"},i.OR={eldarRay:"Eldar-ray",forceIndex:"Force index",macd:"MACD",relativeStrengthIndex:"RSI",volume:"Volume"}}}]); \ No newline at end of file diff --git a/urbit/bus/vegas/build/_next/static/chunks/521.c5e178f5b03c508e.js b/urbit/bus/vegas/build/_next/static/chunks/521.c5e178f5b03c508e.js new file mode 100644 index 000000000..2a4d6c50d --- /dev/null +++ b/urbit/bus/vegas/build/_next/static/chunks/521.c5e178f5b03c508e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[521],{11492:function(e,s,l){l.r(s),l.d(s,{default:function(){return _}});var t=l(52322),r=l(2784),i=l(74248),n=l(75720),a=l(27834),d=l(65395),o=l(96291),c=l(91233),x=l(39494),h=l(55168);let j=()=>{let e=(0,h.N)(),{pubKey:s}=(0,x.qt)(),{data:l,error:r}=(0,c.x5)({dataProvider:o.Jg,variables:{partyId:s||""},skip:!s});return s?(0,t.jsx)(o.x4,{rowData:l,overlayNoRowsTemplate:r?r.message:e("No deposits")}):(0,t.jsx)(a.hX,{children:e("Please connect Vega wallet")})};var u=l(95756),p=l(58970),f=l(34209),g=l(17136);let m=()=>{let e=(0,h.N)(),{pubKey:s}=(0,x.qt)(),{data:l,error:r}=(0,c.x5)({dataProvider:n.WS,variables:{partyId:s||""},skip:!s}),{ready:i,delayed:d}=(0,n.Xh)();return s?(0,t.jsx)(n.P7,{"data-testid":"withdrawals-history",rowData:l,overlayNoRowsTemplate:r?r.message:e("No withdrawals"),ready:i,delayed:d}):(0,t.jsx)(a.hX,{children:e("Please connect Vega wallet")})};var v=l(1954),y=l(69022),w=l(84693),b=l(74883);let N=()=>{var e,s,l;let r=(0,h.N)(),i=(0,w.O7)(e=>e.VEGA_URL),{pubKey:n}=(0,x.qt)(),{data:d,loading:o}=(0,b.qg)({variables:{partyId:n||""},skip:!n}),c=(null!==(l=null==d?void 0:null===(e=d.party)||void 0===e?void 0:null===(s=e.accountsConnection)||void 0===s?void 0:s.edges)&&void 0!==l?l:[]).map(e=>{var s;return null==e?void 0:null===(s=e.node)||void 0===s?void 0:s.asset}).filter(e=>!!(null==e?void 0:e.id)).reduce((e,s)=>Object.assign(e,{[s.id]:s.symbol}),{});return n?i?o?(0,t.jsx)("div",{className:"relative flex items-center justify-center w-full h-full",children:(0,t.jsx)(a.aN,{})}):Object.keys(c).length?(0,t.jsx)(y.qy,{partyId:n,vegaUrl:i,assets:c}):(0,t.jsx)(a.hX,{children:(0,t.jsx)("p",{children:r("No ledger entries to export")})}):(0,t.jsx)(a.hX,{children:(0,t.jsx)("p",{children:r("Environment not configured")})}):(0,t.jsx)(a.hX,{children:(0,t.jsx)("p",{children:r("Please connect Vega wallet")})})};var k=l(24417),K=l(39626),O=l(22787),S=l(9834);let C=()=>{let e=(0,h.N)(),s=(0,S.y)(),l=(0,K.Ap)(e=>e.setViews);return(0,t.jsx)(a.ay,{size:"extra-small",onClick:()=>l({type:K.bW.Deposit},s),"data-testid":"deposit-button",children:e("Deposit")})},P=()=>{let e=(0,h.N)(),s=(0,K.Ap)(e=>e.setViews),l=(0,S.y)();return(0,t.jsx)(a.ay,{size:"extra-small",onClick:()=>s({type:K.bW.Withdraw},l),"data-testid":"withdraw-dialog-button",children:e("Make withdrawal")})};var V=l(88484),W=l(55338);let X=()=>{let{ready:e}=(0,n.Xh)();return e&&0!==e.length?(0,t.jsx)("span",{className:"p-1 leading-none rounded bg-vega-clight-500 dark:bg-vega-cdark-500 text-default",children:e.length}):null},E=()=>{let e=(0,S.y)(),{getView:s,setViews:l}=(0,K.Ap)(),t=s(e);return(0,r.useEffect)(()=>{void 0===t&&l({type:K.bW.Transfer},e)},[t,l,e]),null},_=()=>{let e=(0,h.N)();(0,W.T)(e("Portfolio"));let[s,l]=(0,k.Cc)({id:"portfolio"});return(0,t.jsxs)("div",{className:"p-0.5 h-full max-h-full flex flex-col",children:[(0,t.jsx)(E,{}),(0,t.jsxs)(k.t9,{vertical:!0,onChange:l,children:[(0,t.jsx)(k.CV,{minSize:75,children:(0,t.jsx)(q,{children:(0,t.jsxs)(a.BK,{storageKey:"console-portfolio-top-1",children:[(0,t.jsx)(a.OK,{id:"positions",name:e("Positions"),menu:(0,t.jsx)(g.H,{}),settings:(0,t.jsx)(f.W7,{}),children:(0,t.jsx)(V.S,{feature:"portfolio-positions",children:(0,t.jsx)(f.Lr,{allKeys:!0})})}),(0,t.jsx)(a.OK,{id:"orders",name:e("Orders"),settings:(0,t.jsx)(v.n_,{}),children:(0,t.jsx)(V.S,{feature:"portfolio-orders",children:(0,t.jsx)(v.rx,{})})}),(0,t.jsx)(a.OK,{id:"fills",name:e("Fills"),settings:(0,t.jsx)(u.P8,{}),children:(0,t.jsx)(V.S,{feature:"portfolio-fills",children:(0,t.jsx)(u.tE,{})})}),(0,t.jsx)(a.OK,{id:"funding-payments",name:e("Funding payments"),settings:(0,t.jsx)(p.o2,{}),children:(0,t.jsx)(V.S,{feature:"portfolio-funding-payments",children:(0,t.jsx)(p.fQ,{})})}),(0,t.jsx)(a.OK,{id:"ledger-entries",name:e("Ledger entries"),children:(0,t.jsx)(V.S,{feature:"portfolio-ledger",children:(0,t.jsx)(N,{})})})]})})}),(0,t.jsx)(k.CV,{priority:i.g1.Low,preferredSize:s[1]||300,minSize:50,children:(0,t.jsx)(q,{children:(0,t.jsxs)(a.BK,{storageKey:"console-portfolio-bottom",children:[(0,t.jsx)(a.OK,{id:"collateral",name:e("Collateral"),settings:(0,t.jsx)(d.bd,{}),menu:(0,t.jsx)(O.v,{}),children:(0,t.jsx)(V.S,{feature:"portfolio-accounts",children:(0,t.jsx)(d.VJ,{})})}),(0,t.jsx)(a.OK,{id:"deposits",name:e("Deposits"),menu:(0,t.jsx)(C,{}),children:(0,t.jsx)(V.S,{feature:"portfolio-deposit",children:(0,t.jsx)(j,{})})}),(0,t.jsx)(a.OK,{id:"withdrawals",name:e("Withdrawals"),indicator:(0,t.jsx)(X,{}),menu:(0,t.jsx)(P,{}),children:(0,t.jsx)(V.S,{feature:"portfolio-deposit",children:(0,t.jsx)(m,{})})})]})})})]})]})},q=e=>{let{children:s}=e;return(0,t.jsx)("section",{className:"h-full p-1",children:(0,t.jsx)("div",{className:"h-full border rounded-sm border-default",children:s})})}}}]); \ No newline at end of file diff --git a/urbit/bus/vegas/build/_next/static/chunks/894.15761102f8647872.js b/urbit/bus/vegas/build/_next/static/chunks/894.15761102f8647872.js new file mode 100644 index 000000000..e3d2f840a --- /dev/null +++ b/urbit/bus/vegas/build/_next/static/chunks/894.15761102f8647872.js @@ -0,0 +1,5 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[894],{15275:function(){},74248:function(e,t,i){"use strict";let r;i.d(t,{g1:function(){return em},oL:function(){return ex}});var n,s,o,a,l=i(2784);function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t=n?r:n)),r}),x={exports:{}};!function(e,t){var i="__lodash_hash_undefined__",r="[object Arguments]",n="[object Array]",s="[object Boolean]",o="[object Date]",a="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",f="[object Object]",m="[object Promise]",d="[object RegExp]",v="[object Set]",p="[object String]",y="[object WeakMap]",b="[object ArrayBuffer]",g="[object DataView]",z=/^\[object .+?Constructor\]$/,S=/^(?:0|[1-9]\d*)$/,w={};w["[object Float32Array]"]=w["[object Float64Array]"]=w["[object Int8Array]"]=w["[object Int16Array]"]=w["[object Int32Array]"]=w["[object Uint8Array]"]=w["[object Uint8ClampedArray]"]=w["[object Uint16Array]"]=w["[object Uint32Array]"]=!0,w[r]=w[n]=w[b]=w[s]=w[g]=w[o]=w[a]=w[l]=w[u]=w[c]=w[f]=w[d]=w[v]=w[p]=w[y]=!1;var _="object"==typeof h&&h&&h.Object===Object&&h,I="object"==typeof self&&self&&self.Object===Object&&self,x=_||I||Function("return this")(),E=t&&!t.nodeType&&t,V=E&&e&&!e.nodeType&&e,j=V&&V.exports===E,L=j&&_.process,O=function(){try{return L&&L.binding&&L.binding("util")}catch(e){}}(),D=O&&O.isTypedArray;function N(e){var t=-1,i=Array(e.size);return e.forEach(function(e,r){i[++t]=[r,e]}),i}function M(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var P,A,C,T=Array.prototype,k=Function.prototype,F=Object.prototype,R=x["__core-js_shared__"],H=k.toString,$=F.hasOwnProperty,Y=(P=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"",B=F.toString,W=RegExp("^"+H.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),G=j?x.Buffer:void 0,U=x.Symbol,X=x.Uint8Array,J=F.propertyIsEnumerable,K=T.splice,Z=U?U.toStringTag:void 0,Q=Object.getOwnPropertySymbols,q=G?G.isBuffer:void 0,ee=(A=Object.keys,C=Object,function(e){return A(C(e))}),et=ex(x,"DataView"),ei=ex(x,"Map"),er=ex(x,"Promise"),en=ex(x,"Set"),es=ex(x,"WeakMap"),eo=ex(Object,"create"),ea=ej(et),el=ej(ei),eu=ej(er),eh=ej(en),ec=ej(es),ef=U?U.prototype:void 0,em=ef?ef.valueOf:void 0;function ed(e){var t=-1,i=null==e?0:e.length;for(this.clear();++ta))return!1;var u=s.get(e);if(u&&s.get(t))return u==t;var h=-1,c=!0,f=2&i?new ey:void 0;for(s.set(e,t),s.set(t,e);++h-1&&i%1==0&&i-1},ev.prototype.set=function(e,t){var i=this.__data__,r=eg(i,e);return r<0?(++this.size,i.push([e,t])):i[r][1]=t,this},ep.prototype.clear=function(){this.size=0,this.__data__={hash:new ed,map:new(ei||ev),string:new ed}},ep.prototype.delete=function(e){var t=eI(this,e).delete(e);return this.size-=t?1:0,t},ep.prototype.get=function(e){return eI(this,e).get(e)},ep.prototype.has=function(e){return eI(this,e).has(e)},ep.prototype.set=function(e,t){var i=eI(this,e),r=i.size;return i.set(e,t),this.size+=i.size==r?0:1,this},ey.prototype.add=ey.prototype.push=function(e){return this.__data__.set(e,i),this},ey.prototype.has=function(e){return this.__data__.has(e)},eb.prototype.clear=function(){this.__data__=new ev,this.size=0},eb.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},eb.prototype.get=function(e){return this.__data__.get(e)},eb.prototype.has=function(e){return this.__data__.has(e)},eb.prototype.set=function(e,t){var i=this.__data__;if(i instanceof ev){var r=i.__data__;if(!ei||r.length<199)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new ep(r)}return i.set(e,t),this.size=i.size,this};var eE=Q?function(e){return null==e?[]:function(e,t){for(var i=-1,r=null==e?0:e.length,n=0,s=[];++i-1&&e%1==0&&e<=9007199254740991}function eA(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function eC(e){return null!=e&&"object"==typeof e}var eT=D?function(e){return D(e)}:function(e){return eC(e)&&eP(e.length)&&!!w[ez(e)]};e.exports=function(e,t){return function e(t,i,l,h,m){return t===i||(null!=t&&null!=i&&(eC(t)||eC(i))?function(e,t,i,l,h,m){var y=eD(e),z=eD(t),S=y?n:eV(e),w=z?n:eV(t),_=(S=S==r?f:S)==f,I=(w=w==r?f:w)==f,x=S==w;if(x&&eN(e)){if(!eN(t))return!1;y=!0,_=!1}if(x&&!_)return m||(m=new eb),y||eT(e)?ew(e,t,i,l,h,m):function(e,t,i,r,n,l,h){switch(i){case g:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case b:return!(e.byteLength!=t.byteLength||!l(new X(e),new X(t)));case s:case o:case c:return eL(+e,+t);case a:return e.name==t.name&&e.message==t.message;case d:case p:return e==t+"";case u:var f=N;case v:var m=1&r;if(f||(f=M),e.size!=t.size&&!m)break;var y=h.get(e);if(y)return y==t;r|=2,h.set(e,t);var z=ew(f(e),f(t),r,n,l,h);return h.delete(e),z;case"[object Symbol]":if(em)return em.call(e)==em.call(t)}return!1}(e,t,S,i,l,h,m);if(!(1&i)){var E=_&&$.call(e,"__wrapped__"),V=I&&$.call(t,"__wrapped__");if(E||V){var j=E?e.value():e,L=V?t.value():t;return m||(m=new eb),h(j,L,i,l,m)}}return!!x&&(m||(m=new eb),function(e,t,i,r,n,s){var o=1&i,a=e_(e),l=a.length;if(l!=e_(t).length&&!o)return!1;for(var u=l;u--;){var h=a[u];if(!(o?h in t:$.call(t,h)))return!1}var c=s.get(e);if(c&&s.get(t))return c==t;var f=!0;s.set(e,t),s.set(t,e);for(var m=o;++u=0,O=(L.indexOf("Macintosh")>=0||L.indexOf("iPad")>=0||L.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0);let N=O,M=D,P="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;class A{constructor(){this._size=void 0}getSize(){return this._size}setSize(e){this._size=e}}function C(e,t){let i=e.length,r=i-t.length;return r>=0&&e.slice(r,i)===t}var T={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function r(){}function n(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,r,s,o){if("function"!=typeof r)throw TypeError("The listener must be a function");var a=new n(r,s||e,o),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(i=!1)),a.prototype.eventNames=function(){var e,r,n=[];if(0===this._eventsCount)return n;for(r in e=this._events)t.call(e,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},a.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,s=r.length,o=Array(s);n-1&&(e.splice(i,1),e.unshift(t))}function R(e,t){let i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function H(e,t,i=1){let r=Math.max(0,Math.ceil((t-e)/i)),n=Array(r),s=-1;for(;++s=t||i<0||c&&e-u>=s}function v(){var e,i=ee();if(d(i))return p(i);a=setTimeout(v,(e=t-(i-l),c?q(e,s-(i-u)):e))}function p(e){return a=void 0,f&&r?m(e):(r=n=void 0,o)}function y(){var e,i=ee(),s=d(i);if(r=arguments,n=this,l=i,s){if(void 0===a)return u=e=l,a=setTimeout(v,t),h?m(e):o;if(c)return a=setTimeout(v,t),m(l)}return void 0===a&&(a=setTimeout(v,t)),o}return t=ei(t)||0,et(i)&&(h=!!i.leading,s=(c="maxWait"in i)?Q(ei(i.maxWait)||0,t):s,f="trailing"in i?!!i.trailing:f),y.cancel=function(){void 0!==a&&clearTimeout(a),u=0,r=l=n=a=void 0},y.flush=function(){return void 0===a?o:p(ee())},y}),en="sash-module_vertical__pB-rs",es="sash-module_horizontal__kFbiw",eo="sash-module_hover__80W6I",ea="sash-module_active__bJspD";let el=((n={}).Vertical="VERTICAL",n.Horizontal="HORIZONTAL",n),eu=((s={}).Disabled="DISABLED",s.Minimum="MINIMUM",s.Maximum="MAXIMUM",s.Enabled="ENABLED",s),eh=N?20:8,ec=new k;class ef extends k{get state(){return this._state}set state(e){this._state!==e&&(this.el.classList.toggle("sash-module_disabled__Hm-wx",e===eu.Disabled),this.el.classList.toggle("dash-disabled",e===eu.Disabled),this.el.classList.toggle("sash-module_minimum__-UKxp",e===eu.Minimum),this.el.classList.toggle("sash-minimum",e===eu.Minimum),this.el.classList.toggle("sash-module_maximum__TCWxD",e===eu.Maximum),this.el.classList.toggle("sash-maximum",e===eu.Maximum),this._state=e,this.emit("enablementChange",e))}constructor(e,t,i){var r;super(),this.el=void 0,this.layoutProvider=void 0,this.orientation=void 0,this.size=void 0,this.hoverDelay=300,this.hoverDelayer=er(e=>e.classList.add("sash-hover",eo),this.hoverDelay),this._state=eu.Enabled,this.onPointerStart=e=>{let t=e.pageX,i=e.pageY;this.el.classList.add("sash-active",ea),this.emit("start",{startX:t,currentX:t,startY:i,currentY:i}),this.el.setPointerCapture(e.pointerId);let r=e=>{e.preventDefault();let r={startX:t,currentX:e.pageX,startY:i,currentY:e.pageY};this.emit("change",r)},n=e=>{e.preventDefault(),this.el.classList.remove("sash-active",ea),this.hoverDelayer.cancel(),this.emit("end"),this.el.releasePointerCapture(e.pointerId),window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",n)};window.addEventListener("pointermove",r),window.addEventListener("pointerup",n)},this.onPointerDoublePress=()=>{this.emit("reset")},this.onMouseEnter=()=>{this.el.classList.contains(ea)?(this.hoverDelayer.cancel(),this.el.classList.add("sash-hover",eo)):this.hoverDelayer(this.el)},this.onMouseLeave=()=>{this.hoverDelayer.cancel(),this.el.classList.remove("sash-hover",eo)},this.el=document.createElement("div"),this.el.classList.add("sash","sash-module_sash__K-9lB"),this.el.dataset.testid="sash",e.append(this.el),M&&this.el.classList.add("sash-mac","sash-module_mac__Jf6OJ"),this.el.addEventListener("pointerdown",this.onPointerStart),this.el.addEventListener("dblclick",this.onPointerDoublePress),this.el.addEventListener("mouseenter",this.onMouseEnter),this.el.addEventListener("mouseleave",this.onMouseLeave),"number"==typeof i.size?(this.size=i.size,i.orientation===el.Vertical?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=eh,ec.on("onDidChangeGlobalSize",e=>{this.size=e,this.layout()})),this.layoutProvider=t,this.orientation=null!=(r=i.orientation)?r:el.Vertical,this.orientation===el.Horizontal?(this.el.classList.add("sash-horizontal",es),this.el.classList.remove("sash-vertical",en)):(this.el.classList.remove("sash-horizontal",es),this.el.classList.add("sash-vertical",en)),this.layout()}layout(){if(this.orientation===el.Vertical){let e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{let e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}dispose(){this.el.removeEventListener("pointerdown",this.onPointerStart),this.el.removeEventListener("dblclick",this.onPointerDoublePress),this.el.removeEventListener("mouseenter",this.onMouseEnter),this.el.removeEventListener("mouseleave",()=>this.onMouseLeave),this.el.remove()}}(a=r||(r={})).Distribute={type:"distribute"},a.Split=function(e){return{type:"split",index:e}},a.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}};let em=((o={}).Normal="NORMAL",o.Low="LOW",o.High="HIGH",o);class ed{constructor(e,t,i){this.container=void 0,this.view=void 0,this._size=void 0,this._cachedVisibleSize=void 0,this.container=e,this.view=t,this.container.classList.add("split-view-view",j),this.container.dataset.testid="split-view-view","number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("split-view-view-visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}set size(e){this._size=e}get size(){return this._size}get priority(){return this.view.priority}get snap(){return!!this.view.snap}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){e!==this.visible&&(e?(this.size=I(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("split-view-view-visible",e),this.view.setVisible&&this.view.setVisible(e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}set enabled(e){this.container.style.pointerEvents=e?"":"none"}layout(e){this.layoutContainer(e),this.view.layout(this.size,e)}}class ev extends ed{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}class ep extends ed{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class ey extends k{get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={},i,r,n){var s,o;if(super(),this.onDidChange=void 0,this.onDidDragStart=void 0,this.onDidDragEnd=void 0,this.orientation=void 0,this.sashContainer=void 0,this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.sashDragState=void 0,this.proportionalLayout=void 0,this.getSashOrthogonalSize=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onSashEnd=e=>{for(let t of(this.emit("sashchange",e),this.saveProportions(),this.viewItems))t.enabled=!0},this.orientation=null!=(s=t.orientation)?s:el.Vertical,this.proportionalLayout=null==(o=t.proportionalLayout)||o,this.getSashOrthogonalSize=t.getSashOrthogonalSize,i&&(this.onDidChange=i),r&&(this.onDidDragStart=r),n&&(this.onDidDragEnd=n),this.sashContainer=document.createElement("div"),this.sashContainer.classList.add("sash-container","allotment-module_sashContainer__fzwJF"),e.prepend(this.sashContainer),t.descriptor){for(let[e,i]of(this.size=t.descriptor.size,t.descriptor.views.entries())){let t=i.size,r=i.container,n=i.view;this.addView(r,n,t,e,!0)}this.contentSize=this.viewItems.reduce((e,t)=>e+t.size,0),this.saveProportions()}}addView(e,t,i,r=this.viewItems.length,n){let s;s="number"==typeof i?i:"split"===i.type?this.getViewSize(i.index)/2:"invisible"===i.type?{cachedVisibleSize:i.cachedVisibleSize}:t.minimumSize;let o=this.orientation===el.Vertical?new ep(e,t,s):new ev(e,t,s);if(this.viewItems.splice(r,0,o),this.viewItems.length>1){let e=this.orientation===el.Vertical?new ef(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},{orientation:el.Horizontal}):new ef(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},{orientation:el.Vertical}),t=this.orientation===el.Vertical?t=>({sash:e,start:t.startY,current:t.currentY}):t=>({sash:e,start:t.startX,current:t.currentX});e.on("start",e=>{var i;this.emit("sashDragStart"),this.onSashStart(t(e));let r=this.viewItems.map(e=>e.size);null==(i=this.onDidDragStart)||i.call(this,r)}),e.on("change",e=>this.onSashChange(t(e))),e.on("end",()=>{var t;this.emit("sashDragEnd"),this.onSashEnd(this.sashItems.findIndex(t=>t.sash===e));let i=this.viewItems.map(e=>e.size);null==(t=this.onDidDragEnd)||t.call(this,i)}),e.on("reset",()=>{let t=this.sashItems.findIndex(t=>t.sash===e),i=H(t,-1,-1),r=H(t+1,this.viewItems.length),n=this.findFirstSnapIndex(i),s=this.findFirstSnapIndex(r);("number"!=typeof n||this.viewItems[n].visible)&&("number"!=typeof s||this.viewItems[s].visible)&&this.emit("sashreset",t)}),this.sashItems.splice(r-1,0,{sash:e})}n||this.relayout(),n||"number"==typeof i||"distribute"!==i.type||this.distributeViewSizes()}removeView(e,t){if(e<0||e>=this.viewItems.length)throw Error("Index out of bounds");let i=this.viewItems.splice(e,1)[0].view;return this.viewItems.length>=1&&this.sashItems.splice(Math.max(e-1,0),1)[0].sash.dispose(),this.relayout(),t&&"distribute"===t.type&&this.distributeViewSizes(),i}moveView(e,t,i){let n=this.getViewCachedVisibleSize(t),s=void 0===n?this.getViewSize(t):r.Invisible(n),o=this.removeView(t);this.addView(e,o,s,i)}getViewCachedVisibleSize(e){if(e<0||e>=this.viewItems.length)throw Error("Index out of bounds");return this.viewItems[e].cachedVisibleSize}layout(e=this.size){let t=Math.max(this.size,this.contentSize);if(this.size=e,this.proportions)for(let t=0;tthis.viewItems[e].priority===em.Low),n=i.filter(e=>this.viewItems[e].priority===em.High);this.resize(this.viewItems.length-1,e-t,void 0,r,n)}this.distributeEmptySpace(),this.layoutViews()}resizeView(e,t){if(e<0||e>=this.viewItems.length)return;let i=H(0,this.viewItems.length).filter(t=>t!==e),r=[...i.filter(e=>this.viewItems[e].priority===em.Low),e],n=i.filter(e=>this.viewItems[e].priority===em.High),s=this.viewItems[e];t=I(t=Math.round(t),s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(r,n)}resizeViews(e){for(let t=0;te+t.size,0),this.saveProportions(),this.layout(this.size)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}isViewVisible(e){if(e<0||e>=this.viewItems.length)throw Error("Index out of bounds");return this.viewItems[e].visible}setViewVisible(e,t){if(e<0||e>=this.viewItems.length)throw Error("Index out of bounds");this.viewItems[e].setVisible(t),this.distributeEmptySpace(e),this.layoutViews(),this.saveProportions()}distributeViewSizes(){let e=[],t=0;for(let i of this.viewItems)i.maximumSize-i.minimumSize>0&&(e.push(i),t+=i.size);let i=Math.floor(t/e.length);for(let t of e)t.size=I(i,t.minimumSize,t.maximumSize);let r=H(0,this.viewItems.length),n=r.filter(e=>this.viewItems[e].priority===em.Low),s=r.filter(e=>this.viewItems[e].priority===em.High);this.relayout(n,s)}dispose(){this.sashItems.forEach(e=>e.sash.dispose()),this.sashItems=[],this.sashContainer.remove()}relayout(e,t){let i=this.viewItems.reduce((e,t)=>e+t.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}onSashStart({sash:e,start:t}){let i=this.sashItems.findIndex(t=>t.sash===e);(e=>{let t=this.viewItems.map(e=>e.size),r,n,s=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=H(i,-1,-1),l=H(i+1,this.viewItems.length),u=a.reduce((e,i)=>e+(this.viewItems[i].minimumSize-t[i]),0),h=a.reduce((e,i)=>e+(this.viewItems[i].viewMaximumSize-t[i]),0),c=0===l.length?Number.POSITIVE_INFINITY:l.reduce((e,i)=>e+(t[i]-this.viewItems[i].minimumSize),0),f=0===l.length?Number.NEGATIVE_INFINITY:l.reduce((e,i)=>e+(t[i]-this.viewItems[i].viewMaximumSize),0);s=Math.max(u,f),o=Math.min(c,h);let m=this.findFirstSnapIndex(a),d=this.findFirstSnapIndex(l);if("number"==typeof m){let e=this.viewItems[m],t=Math.floor(e.viewMinimumSize/2);r={index:m,limitDelta:e.visible?s-t:s+t,size:e.size}}if("number"==typeof d){let e=this.viewItems[d],t=Math.floor(e.viewMinimumSize/2);n={index:d,limitDelta:e.visible?o+t:o-t,size:e.size}}this.sashDragState={start:e,current:e,index:i,sizes:t,minDelta:s,maxDelta:o,snapBefore:r,snapAfter:n}})(t)}onSashChange({current:e}){let{index:t,start:i,sizes:r,minDelta:n,maxDelta:s,snapBefore:o,snapAfter:a}=this.sashDragState;this.sashDragState.current=e,this.resize(t,e-i,r,void 0,void 0,n,s,o,a),this.distributeEmptySpace(),this.layoutViews()}getSashPosition(e){let t=0;for(let i=0;ie.size),r,n,s=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;let u=H(e,-1,-1),h=H(e+1,this.viewItems.length);if(n)for(let e of n)F(u,e),F(h,e);if(r)for(let e of r)R(u,e),R(h,e);let c=u.map(e=>this.viewItems[e]),f=u.map(e=>i[e]),m=h.map(e=>this.viewItems[e]),d=h.map(e=>i[e]),v=u.reduce((e,t)=>e+(this.viewItems[t].minimumSize-i[t]),0),p=u.reduce((e,t)=>e+(this.viewItems[t].maximumSize-i[t]),0),y=0===h.length?Number.POSITIVE_INFINITY:h.reduce((e,t)=>e+(i[t]-this.viewItems[t].minimumSize),0),b=0===h.length?Number.NEGATIVE_INFINITY:h.reduce((e,t)=>e+(i[t]-this.viewItems[t].maximumSize),0),g=!1;if(a){let e=this.viewItems[a.index],i=t>=a.limitDelta;g=i!==e.visible,e.setVisible(i,a.size)}if(!g&&l){let e=this.viewItems[l.index],i=te+t.size,0),i=this.size-t,r=H(this.viewItems.length-1,-1,-1);"number"==typeof e&&R(r,e);for(let e=0;0!==i&&ee+t.size,0);let t=0;for(let e of this.viewItems)e.layout(t),t+=e.size;null!=(e=this.onDidChange)&&e.call(this,this.viewItems.map(e=>e.size)),this.sashItems.forEach(e=>e.sash.layout()),this.updateSashEnablement()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.size/this.contentSize))}updateSashEnablement(){let e=!1,t=this.viewItems.map(t=>e=t.size-t.minimumSize>0||e);e=!1;let i=this.viewItems.map(t=>e=t.maximumSize-t.size>0||e),r=[...this.viewItems].reverse();e=!1;let n=r.map(t=>e=t.size-t.minimumSize>0||e).reverse();e=!1;let s=r.map(t=>e=t.maximumSize-t.size>0||e).reverse(),o=0;for(let e=0;e0||this.startSnappingEnabled)?r.state=eu.Minimum:h&&t[e]&&(o0)return;if(!e.visible&&e.snap)return t}}}class eb{constructor(e){this.size=void 0,this.size=e}getPreferredSize(){return this.size}}class eg{constructor(e,t){this.proportion=void 0,this.layoutService=void 0,this.proportion=e,this.layoutService=t}getPreferredSize(){return this.proportion*this.layoutService.getSize()}}class ez{getPreferredSize(){}}class eS{get preferredSize(){return this.layoutStrategy.getPreferredSize()}set preferredSize(e){if("number"==typeof e)this.layoutStrategy=new eb(e);else if("string"==typeof e){let t=e.trim();if(C(t,"%")){let e=Number(t.slice(0,-1))/100;this.layoutStrategy=new eg(e,this.layoutService)}else if(C(t,"px")){let e=Number(t.slice(0,-2))/100;this.layoutStrategy=new eb(e)}else if("number"==typeof Number.parseFloat(t)){let e=Number.parseFloat(t);this.layoutStrategy=new eb(e)}else this.layoutStrategy=new ez}else this.layoutStrategy=new ez}constructor(e,t){var i;if(this.minimumSize=0,this.maximumSize=Number.POSITIVE_INFINITY,this.element=void 0,this.priority=void 0,this.snap=void 0,this.layoutService=void 0,this.layoutStrategy=void 0,this.layoutService=e,this.element=t.element,this.minimumSize="number"==typeof t.minimumSize?t.minimumSize:30,this.maximumSize="number"==typeof t.maximumSize?t.maximumSize:Number.POSITIVE_INFINITY,"number"==typeof t.preferredSize)this.layoutStrategy=new eb(t.preferredSize);else if("string"==typeof t.preferredSize){let e=t.preferredSize.trim();if(C(e,"%")){let t=Number(e.slice(0,-1))/100;this.layoutStrategy=new eg(t,this.layoutService)}else if(C(e,"px")){let t=Number(e.slice(0,-2));this.layoutStrategy=new eb(t)}else if("number"==typeof Number.parseFloat(e)){let t=Number.parseFloat(e);this.layoutStrategy=new eb(t)}else this.layoutStrategy=new ez}else this.layoutStrategy=new ez;this.priority=null!=(i=t.priority)?i:em.Normal,this.snap="boolean"==typeof t.snap&&t.snap}layout(e){}}function ew(e){return void 0!==e.minSize||void 0!==e.maxSize||void 0!==e.preferredSize||void 0!==e.priority||void 0!==e.visible}let e_=(0,l.forwardRef)(({className:e,children:t},i)=>l.createElement("div",{ref:i,className:d("split-view-view",j,e)},t));e_.displayName="Allotment.Pane";let eI=(0,l.forwardRef)(({children:e,className:t,maxSize:i=1/0,minSize:n=30,proportionalLayout:s=!0,separator:o=!0,sizes:a,defaultSizes:h=a,snap:c=!1,vertical:f=!1,onChange:m,onReset:v,onVisibleChange:p,onDragStart:y,onDragEnd:b},g)=>{var z,S,w,_,x,j,L,O,D,M,C,T,k,F,R,H,$;let Y=(0,l.useRef)(null),B=(0,l.useRef)([]),W=(0,l.useRef)(new Map),G=(0,l.useRef)(null),U=(0,l.useRef)(new Map),X=(0,l.useRef)(new A),J=(0,l.useRef)([]),[K,Z]=(0,l.useState)(!1),Q=(0,l.useMemo)(()=>l.Children.toArray(e).filter(l.isValidElement),[e]),q=(0,l.useCallback)(e=>{var t,i;let r=null==(t=J.current)?void 0:t[e];return"number"==typeof(null==r?void 0:r.preferredSize)&&(null!=(i=G.current)&&i.resizeView(e,Math.round(r.preferredSize)),!0)},[]);return(0,l.useImperativeHandle)(g,()=>({reset:()=>{if(v)v();else{var e;null==(e=G.current)||e.distributeViewSizes();for(let e=0;e{var t;null==(t=G.current)||t.resizeViews(e)}})),P(()=>{let e=!0;h&&U.current.size!==h.length&&(e=!1,console.warn(`Expected ${h.length} children based on defaultSizes but found ${U.current.size}`)),e&&h&&(B.current=Q.map(e=>e.key));let t=u({orientation:f?el.Vertical:el.Horizontal,proportionalLayout:s},e&&h&&{descriptor:{size:h.reduce((e,t)=>e+t,0),views:h.map((e,t)=>{var r,s,o,a;let l=W.current.get(B.current[t]),h=new eS(X.current,u({element:document.createElement("div"),minimumSize:null!=(r=null==l?void 0:l.minSize)?r:n,maximumSize:null!=(s=null==l?void 0:l.maxSize)?s:i,priority:null!=(o=null==l?void 0:l.priority)?o:em.Normal},(null==l?void 0:l.preferredSize)&&{preferredSize:null==l?void 0:l.preferredSize},{snap:null!=(a=null==l?void 0:l.snap)?a:c}));return J.current.push(h),{container:[...U.current.values()][t],size:e,view:h}})}});G.current=new ey(Y.current,t,m,y,b),G.current.on("sashDragStart",()=>{var e;null==(e=Y.current)||e.classList.add("split-view-sash-dragging")}),G.current.on("sashDragEnd",()=>{var e;null==(e=Y.current)||e.classList.remove("split-view-sash-dragging")}),G.current.on("sashchange",e=>{if(p&&G.current){let e=Q.map(e=>e.key);for(let t=0;t{if(v)v();else{var t;if(q(e)||q(e+1))return;null==(t=G.current)||t.distributeViewSizes()}});let r=G.current;return()=>{r.dispose()}},[]),P(()=>{if(K){var e,t,s,o,a,l,h,f,m,d,v;let p=Q.map(e=>e.key),y=[...B.current],b=p.filter(e=>!B.current.includes(e)),g=p.filter(e=>B.current.includes(e)),z=B.current.map(e=>!p.includes(e));for(let t=z.length-1;t>=0;t--)z[t]&&(null!=(e=G.current)&&e.removeView(t),y.splice(t,1),J.current.splice(t,1));for(let e of b){let h=W.current.get(e),f=new eS(X.current,u({element:document.createElement("div"),minimumSize:null!=(t=null==h?void 0:h.minSize)?t:n,maximumSize:null!=(s=null==h?void 0:h.maxSize)?s:i,priority:null!=(o=null==h?void 0:h.priority)?o:em.Normal},(null==h?void 0:h.preferredSize)&&{preferredSize:null==h?void 0:h.preferredSize},{snap:null!=(a=null==h?void 0:h.snap)?a:c}));null!=(l=G.current)&&l.addView(U.current.get(e),f,r.Distribute,p.findIndex(t=>t===e)),y.splice(p.findIndex(t=>t===e),0,e),J.current.splice(p.findIndex(t=>t===e),0,f)}for(;!E(p,y);)for(let[e,t]of p.entries()){let i=y.findIndex(e=>e===t);if(i!==e){null==(h=G.current)||h.moveView(U.current.get(t),i,e);let r=y[i];y.splice(i,1),y.splice(e,0,r);break}}for(let e of b){let t=p.findIndex(t=>t===e),i=J.current[t].preferredSize;void 0!==i&&(null==(f=G.current)||f.resizeView(t,i))}for(let e of[...b,...g]){let t=W.current.get(e),i=p.findIndex(t=>t===e);t&&ew(t)&&void 0!==t.visible&&(null==(m=G.current)?void 0:m.isViewVisible(i))!==t.visible&&(null==(d=G.current)||d.setViewVisible(i,t.visible))}for(let e of g){let t=W.current.get(e),i=p.findIndex(t=>t===e);if(t&&ew(t)){void 0!==t.preferredSize&&J.current[i].preferredSize!==t.preferredSize&&(J.current[i].preferredSize=t.preferredSize);let e=!1;void 0!==t.minSize&&J.current[i].minimumSize!==t.minSize&&(J.current[i].minimumSize=t.minSize,e=!0),void 0!==t.maxSize&&J.current[i].maximumSize!==t.maxSize&&(J.current[i].maximumSize=t.maxSize,e=!0),e&&(null==(v=G.current)||v.layout())}}(b.length>0||z.length>0)&&(B.current=p)}},[Q,K,i,n,c]),(0,l.useEffect)(()=>{G.current&&(G.current.onDidChange=m)},[m]),(0,l.useEffect)(()=>{G.current&&(G.current.onDidDragStart=y)},[y]),(0,l.useEffect)(()=>{G.current&&(G.current.onDidDragEnd=b)},[b]),S=(z={ref:Y,onResize:({width:e,height:t})=>{var i;e&&t&&(null!=(i=G.current)&&i.layout(f?t:e),X.current.setSize(f?t:e),Z(!0))}}).onResize,(w=(0,l.useRef)(void 0)).current=S,_=z.round||Math.round,x=(0,l.useRef)(),L=(j=(0,l.useState)({width:void 0,height:void 0}))[0],O=j[1],D=(0,l.useRef)(!1),(0,l.useEffect)(function(){return D.current=!1,function(){D.current=!0}},[]),H=(0,l.useRef)({width:void 0,height:void 0}),M=(0,l.useCallback)(function(e){return x.current&&x.current.box===z.box&&x.current.round===_||(x.current={box:z.box,round:_,instance:new ResizeObserver(function(e){var t=e[0],i="border-box"===z.box?"borderBoxSize":"device-pixel-content-box"===z.box?"devicePixelContentBoxSize":"contentBoxSize",r=V(t,i,"inlineSize"),n=V(t,i,"blockSize"),s=r?_(r):void 0,o=n?_(n):void 0;if(H.current.width!==s||H.current.height!==o){var a={width:s,height:o};H.current.width=s,H.current.height=o,w.current?w.current(a):D.current||O(a)}})}),x.current.instance.observe(e,{box:z.box}),function(){x.current&&x.current.instance.unobserve(e)}},[z.box,_]),C=z.ref,T=(0,l.useRef)(null),(k=(0,l.useRef)(null)).current=C,F=(0,l.useRef)(null),(0,l.useEffect)(function(){R()}),R=(0,l.useCallback)(function(){var e=F.current,t=k.current,i=e||(t?t instanceof Element?t:t.current:null);T.current&&T.current.element===i&&T.current.subscriber===M||(T.current&&T.current.cleanup&&T.current.cleanup(),T.current={element:i,subscriber:M,cleanup:i?M(i):void 0})},[M]),(0,l.useEffect)(function(){return function(){T.current&&T.current.cleanup&&(T.current.cleanup(),T.current=null)}},[]),$=(0,l.useCallback)(function(e){F.current=e,R()},[R]),(0,l.useMemo)(function(){return{ref:$,width:L.width,height:L.height}},[$,L.width,L.height]),P(()=>{if(!K){var e;let{height:t,width:i}=Y.current.getBoundingClientRect();null!=(e=G.current)&&e.layout(f?t:i),X.current.setSize(f?t:i),Z(!0)}},[K,f]),(0,l.useEffect)(()=>{N&&function(e){let t=I(e,4,20),i=I(e,1,8);document.documentElement.style.setProperty("--sash-size",t+"px"),document.documentElement.style.setProperty("--sash-hover-size",i+"px"),eh=t,ec.emit("onDidChangeGlobalSize",t)}(20)},[]),l.createElement("div",{ref:Y,className:d("split-view",f?"split-view-vertical":"split-view-horizontal",{"split-view-separator-border":o},"allotment-module_splitView__L-yRc",f?"allotment-module_vertical__WSwwa":"allotment-module_horizontal__7doS8",{"allotment-module_separatorBorder__x-rDS":o},t)},l.createElement("div",{className:d("split-view-container","allotment-module_splitViewContainer__rQnVa")},l.Children.toArray(e).map(e=>{if(!l.isValidElement(e))return null;let t=e.key;return"Allotment.Pane"===e.type.displayName?(W.current.set(t,e.props),l.cloneElement(e,{key:t,ref:i=>{let r=e.ref;r&&(r.current=i),i?U.current.set(t,i):U.current.delete(t)}})):l.createElement(e_,{key:t,ref:e=>{e?U.current.set(t,e):U.current.delete(t)}},e)})))});eI.displayName="Allotment";var ex=Object.assign(eI,{Pane:e_})}}]); \ No newline at end of file diff --git a/urbit/bus/vegas/build/_next/static/chunks/94.7655f1b000c3f026.js b/urbit/bus/vegas/build/_next/static/chunks/94.7655f1b000c3f026.js new file mode 100644 index 000000000..29076561e --- /dev/null +++ b/urbit/bus/vegas/build/_next/static/chunks/94.7655f1b000c3f026.js @@ -0,0 +1,26 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[94],{35599:function(t){"use strict";t.exports=function(t){for(var e=[],r=t.length,o=0;o=55296&&i<=56319&&r>o+1){var n=t.charCodeAt(o+1);n>=56320&&n<=57343&&(i=(i-55296)*1024+n-56320+65536,o+=1)}if(i<128){e.push(i);continue}if(i<2048){e.push(i>>6|192),e.push(63&i|128);continue}if(i<55296||i>=57344&&i<65536){e.push(i>>12|224),e.push(i>>6&63|128),e.push(63&i|128);continue}if(i>=65536&&i<=1114111){e.push(i>>18|240),e.push(i>>12&63|128),e.push(i>>6&63|128),e.push(63&i|128);continue}e.push(239,191,189)}return new Uint8Array(e).buffer}},74061:function(t,e,r){let o=r(69919),i=r(10585),n=r(97637),l=r(37568);function a(t,e,r,n,l){let a=[].slice.call(arguments,1),s=a.length,c="function"==typeof a[s-1];if(!c&&!o())throw Error("Callback required as last argument");if(c){if(s<2)throw Error("Too few arguments provided");2===s?(l=r,r=e,e=n=void 0):3===s&&(e.getContext&&void 0===l?(l=n,n=void 0):(l=n,n=r,r=e,e=void 0))}else{if(s<1)throw Error("Too few arguments provided");return 1===s?(r=e,e=n=void 0):2!==s||e.getContext||(n=r,r=e,e=void 0),new Promise(function(o,l){try{let l=i.create(r,n);o(t(l,e,n))}catch(t){l(t)}})}try{let o=i.create(r,n);l(null,t(o,e,n))}catch(t){l(t)}}e.create=i.create,e.toCanvas=a.bind(null,n.render),e.toDataURL=a.bind(null,n.renderToDataURL),e.toString=a.bind(null,function(t,e,r){return l.render(t,r)})},69919:function(t){t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},44812:function(t,e,r){let o=r(61850).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];let e=Math.floor(t/7)+2,r=o(t),i=145===r?26:2*Math.ceil((r-13)/(2*e-2)),n=[r-7];for(let t=1;t>>7-t%8&1)==1},put:function(t,e){for(let r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=e},61589:function(t){function e(t){if(!t||t<1)throw Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}e.prototype.set=function(t,e,r,o){let i=t*this.size+e;this.data[i]=r,o&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,e){return this.data[t*this.size+e]},e.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},e.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},t.exports=e},38469:function(t,e,r){let o=r(35599),i=r(3771);function n(t){this.mode=i.BYTE,"string"==typeof t&&(t=o(t)),this.data=new Uint8Array(t)}n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(let e=0,r=this.data.length;e=0&&t.bit<4},e.from=function(t,r){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw Error("Param is not a string");let r=t.toLowerCase();switch(r){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw Error("Unknown EC Level: "+t)}}(t)}catch(t){return r}}},33292:function(t,e,r){let o=r(61850).getSymbolSize;e.getPositions=function(t){let e=o(t);return[[0,0],[e-7,0],[0,e-7]]}},34194:function(t,e,r){let o=r(61850),i=o.getBCHDigit(1335);e.getEncodedBits=function(t,e){let r=t.bit<<3|e,n=r<<10;for(;o.getBCHDigit(n)-i>=0;)n^=1335<=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r=(r>>>8&255)*192+(255&r),t.put(r,13)}},t.exports=n},25622:function(t,e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};let r={N1:3,N2:3,N3:40,N4:10};e.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){let e=t.size,o=0,i=0,n=0,l=null,a=null;for(let s=0;s=5&&(o+=r.N1+(i-5)),l=e,i=1),(e=t.get(c,s))===a?n++:(n>=5&&(o+=r.N1+(n-5)),a=e,n=1)}i>=5&&(o+=r.N1+(i-5)),n>=5&&(o+=r.N1+(n-5))}return o},e.getPenaltyN2=function(t){let e=t.size,o=0;for(let r=0;r=10&&(1488===i||93===i)&&o++,n=n<<1&2047|t.get(l,r),l>=10&&(1488===n||93===n)&&o++}return o*r.N3},e.getPenaltyN4=function(t){let e=0,o=t.data.length;for(let r=0;r=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},e.getBestModeForData=function(t){return i.testNumeric(t)?e.NUMERIC:i.testAlphanumeric(t)?e.ALPHANUMERIC:i.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(t){if(t&&t.id)return t.id;throw Error("Invalid mode")},e.isValid=function(t){return t&&t.bit&&t.ccBits},e.from=function(t,r){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw Error("Param is not a string");let r=t.toLowerCase();switch(r){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw Error("Unknown mode: "+t)}}(t)}catch(t){return r}}},45016:function(t,e,r){let o=r(3771);function i(t){this.mode=o.NUMERIC,this.data=t.toString()}i.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let e,r;for(e=0;e+3<=this.data.length;e+=3)r=parseInt(this.data.substr(e,3),10),t.put(r,10);let o=this.data.length-e;o>0&&(r=parseInt(this.data.substr(e),10),t.put(r,3*o+1))},t.exports=i},59792:function(t,e,r){let o=r(89040);e.mul=function(t,e){let r=new Uint8Array(t.length+e.length-1);for(let i=0;i=0;){let t=r[0];for(let i=0;i>o&1)==1,o<6?t.set(o,8,i,!0):o<8?t.set(o+1,8,i,!0):t.set(n-15+o,8,i,!0),o<8?t.set(8,n-o-1,i,!0):o<9?t.set(8,15-o-1+1,i,!0):t.set(8,15-o-1,i,!0);t.set(n-8,8,1,!0)}e.create=function(t,e){let r,m;if(void 0===t||""===t)throw Error("No input text");let w=i.M;return void 0!==e&&(w=i.from(e.errorCorrectionLevel,i.M),r=u.from(e.version),m=c.from(e.maskPattern),e.toSJISFunc&&o.setToSJISFunction(e.toSJISFunc)),function(t,e,r,i){let m;if(Array.isArray(t))m=g.fromArray(t);else if("string"==typeof t){let o=e;if(!o){let e=g.rawSplit(t);o=u.getBestVersionForData(e,r)}m=g.fromString(t,o||40)}else throw Error("Invalid data");let w=u.getBestVersionForData(m,r);if(!w)throw Error("The amount of data is too big to be stored in a QR Code");if(e){if(e=0&&e<=6&&(0===o||6===o)||o>=0&&o<=6&&(0===e||6===e)||e>=2&&e<=4&&o>=2&&o<=4?t.set(i+e,n+o,!0,!0):t.set(i+e,n+o,!1,!0))}}(y,e),function(t){let e=t.size;for(let r=8;r=7&&function(t,e){let r,o,i;let n=t.size,l=u.getEncodedBits(e);for(let e=0;e<18;e++)r=Math.floor(e/3),o=e%3+n-8-3,i=(l>>e&1)==1,t.set(r,o,i,!0),t.set(o,r,i,!0)}(y,e),function(t,e){let r=t.size,o=-1,i=r-1,n=7,l=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!t.isReserved(i,a-r)){let o=!1;l>>n&1)==1),t.set(i,a-r,o),-1==--n&&(l++,n=7)}if((i+=o)<0||r<=i){i-=o,o=-o;break}}}(y,v),isNaN(i)&&(i=c.getBestMask(y,f.bind(null,y,r))),c.applyMask(i,y),f(y,r,i),{modules:y,version:e,errorCorrectionLevel:r,maskPattern:i,segments:m}}(t,r,w,m)}},41806:function(t,e,r){let o=r(59792);function i(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(t){this.degree=t,this.genPoly=o.generateECPolynomial(this.degree)},i.prototype.encode=function(t){if(!this.genPoly)throw Error("Encoder not initialized");let e=new Uint8Array(t.length+this.degree);e.set(t);let r=o.mod(e,this.genPoly),i=this.degree-r.length;if(i>0){let t=new Uint8Array(this.degree);return t.set(r,i),t}return r},t.exports=i},74558:function(t,e){let r="[0-9]+",o="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";o=o.replace(/u/g,"\\u");let i="(?:(?![A-Z0-9 $%*+\\-./:]|"+o+")(?:.|[\r\n]))+";e.KANJI=RegExp(o,"g"),e.BYTE_KANJI=RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=RegExp(i,"g"),e.NUMERIC=RegExp(r,"g"),e.ALPHANUMERIC=RegExp("[A-Z $%*+\\-./:]+","g");let n=RegExp("^"+o+"$"),l=RegExp("^"+r+"$"),a=RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return n.test(t)},e.testNumeric=function(t){return l.test(t)},e.testAlphanumeric=function(t){return a.test(t)}},56041:function(t,e,r){let o=r(3771),i=r(45016),n=r(79953),l=r(38469),a=r(11296),s=r(74558),c=r(61850),d=r(44271);function h(t){return unescape(encodeURIComponent(t)).length}function u(t,e,r){let o;let i=[];for(;null!==(o=t.exec(r));)i.push({data:o[0],index:o.index,mode:e,length:o[0].length});return i}function m(t){let e,r;let i=u(s.NUMERIC,o.NUMERIC,t),n=u(s.ALPHANUMERIC,o.ALPHANUMERIC,t);c.isKanjiModeEnabled()?(e=u(s.BYTE,o.BYTE,t),r=u(s.KANJI,o.KANJI,t)):(e=u(s.BYTE_KANJI,o.BYTE,t),r=[]);let l=i.concat(n,e,r);return l.sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function p(t,e){switch(e){case o.NUMERIC:return i.getBitsLength(t);case o.ALPHANUMERIC:return n.getBitsLength(t);case o.KANJI:return a.getBitsLength(t);case o.BYTE:return l.getBitsLength(t)}}function g(t,e){let r;let s=o.getBestModeForData(t);if((r=o.from(e,s))!==o.BYTE&&r.bit=0?t[t.length-1]:null;return r&&r.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[]))},e.rawSplit=function(t){return e.fromArray(m(t,c.isKanjiModeEnabled()))}},61850:function(t,e){let r;let o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(t){if(!t)throw Error('"version" cannot be null or undefined');if(t<1||t>40)throw Error('"version" should be in range from 1 to 40');return 4*t+17},e.getSymbolTotalCodewords=function(t){return o[t]},e.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},e.setToSJISFunction=function(t){if("function"!=typeof t)throw Error('"toSJISFunc" is not a valid function.');r=t},e.isKanjiModeEnabled=function(){return void 0!==r},e.toSJIS=function(t){return r(t)}},19638:function(t,e){e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},12616:function(t,e,r){let o=r(61850),i=r(71535),n=r(26939),l=r(3771),a=r(19638),s=o.getBCHDigit(7973);function c(t,e){return l.getCharCountIndicator(t,e)+4}e.from=function(t,e){return a.isValid(t)?parseInt(t,10):e},e.getCapacity=function(t,e,r){if(!a.isValid(t))throw Error("Invalid QR Code version");void 0===r&&(r=l.BYTE);let n=o.getSymbolTotalCodewords(t),s=i.getTotalCodewordsCount(t,e),d=(n-s)*8;if(r===l.MIXED)return d;let h=d-c(r,t);switch(r){case l.NUMERIC:return Math.floor(h/10*3);case l.ALPHANUMERIC:return Math.floor(h/11*2);case l.KANJI:return Math.floor(h/13);case l.BYTE:default:return Math.floor(h/8)}},e.getBestVersionForData=function(t,r){let o;let i=n.from(r,n.M);if(Array.isArray(t)){if(t.length>1)return function(t,r){for(let o=1;o<=40;o++){let i=function(t,e){let r=0;return t.forEach(function(t){let o=c(t.mode,e);r+=o+t.getBitsLength()}),r}(t,o);if(i<=e.getCapacity(o,r,l.MIXED))return o}}(t,i);if(0===t.length)return 1;o=t[0]}else o=t;return function(t,r,o){for(let i=1;i<=40;i++)if(r<=e.getCapacity(i,o,t))return i}(o.mode,o.getLength(),i)},e.getEncodedBits=function(t){if(!a.isValid(t)||t<7)throw Error("Invalid QR Code version");let e=t<<12;for(;o.getBCHDigit(e)-s>=0;)e^=7973<':"",h="0&&c>0&&t[s-1]||(o+=l?n("M",c+r,.5+d+r):n("m",i,0),i=0,l=!1),c+1',u=l.width?'width="'+l.width+'" height="'+l.width+'" ':"",m=''+d+h+"\n";return"function"==typeof r&&r(null,m),m}},9283:function(t,e){function r(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw Error("Invalid hex color: "+t);(3===e.length||4===e.length)&&(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");let r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+e.slice(0,6).join("")}}e.getOptions=function(t){t||(t={}),t.color||(t.color={});let e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,o=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:o,scale:o?4:i,margin:e,color:{dark:r(t.color.dark||"#000000ff"),light:r(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},e.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},e.getImageWidth=function(t,r){let o=e.getScale(t,r);return Math.floor((t+2*r.margin)*o)},e.qrToImageData=function(t,r,o){let i=r.modules.size,n=r.modules.data,l=e.getScale(i,o),a=Math.floor((i+2*o.margin)*l),s=o.margin*l,c=[o.color.light,o.color.dark];for(let e=0;e=s&&r>=s&&enew a("string"==typeof t?t:t+"",void 0,n),c=(t,...e)=>{let r=1===t.length?t[0]:e.reduce((e,r,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[o+1],t[0]);return new a(r,t,n)},d=(t,e)=>{i?t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(e=>{let r=document.createElement("style"),i=o.litNonce;void 0!==i&&r.setAttribute("nonce",i),r.textContent=e.cssText,t.appendChild(r)})},h=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return s(e)})(t):t,u=window,m=u.trustedTypes,p=m?m.emptyScript:"",g=u.reactiveElementPolyfillSupport,f={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},w=(t,e)=>e!==t&&(e==e||t==t),v={attribute:!0,type:String,converter:f,reflect:!1,hasChanged:w},b="finalized";class y extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,r)=>{let o=this._$Ep(r,e);void 0!==o&&(this._$Ev.set(o,r),t.push(o))}),t}static createProperty(t,e=v){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let r="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,r,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,r){return{get(){return this[e]},set(o){let i=this[t];this[e]=o,this.requestUpdate(t,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||v}static finalize(){if(this.hasOwnProperty(b))return!1;this[b]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let r of e)this.createProperty(r,t[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let t of r)e.unshift(h(t))}else void 0!==t&&e.push(h(t));return e}static _$Ep(t,e){let r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach(t=>t(this))}addController(t){var e,r;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(r=t.hostConnected)||void 0===r||r.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;let e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return d(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EO(t,e,r=v){var o;let i=this.constructor._$Ep(t,r);if(void 0!==i&&!0===r.reflect){let n=(void 0!==(null===(o=r.converter)||void 0===o?void 0:o.toAttribute)?r.converter:f).toAttribute(e,r.type);this._$El=t,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$El=null}}_$AK(t,e){var r;let o=this.constructor,i=o._$Ev.get(t);if(void 0!==i&&this._$El!==i){let t=o.getPropertyOptions(i),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(r=t.converter)||void 0===r?void 0:r.fromAttribute)?t.converter:f;this._$El=i,this[i]=n.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,r){let o=!0;void 0!==t&&(((r=r||this.constructor.getPropertyOptions(t)).hasChanged||w)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===r.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,r))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((t,e)=>this[e]=t),this._$Ei=void 0);let e=!1,r=this._$AL;try{(e=this.shouldUpdate(r))?(this.willUpdate(r),null===(t=this._$ES)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)}),this.update(r)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(r)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach(t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach((t,e)=>this._$EO(e,this[e],t)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}y[b]=!0,y.elementProperties=new Map,y.elementStyles=[],y.shadowRootOptions={mode:"open"},null==g||g({ReactiveElement:y}),(null!==(tb=u.reactiveElementVersions)&&void 0!==tb?tb:u.reactiveElementVersions=[]).push("1.6.3");let x=window,$=x.trustedTypes,C=$?$.createPolicy("lit-html",{createHTML:t=>t}):void 0,A="$lit$",E=`lit$${(Math.random()+"").slice(9)}$`,k="?"+E,_=`<${k}>`,O=document,I=()=>O.createComment(""),T=t=>null===t||"object"!=typeof t&&"function"!=typeof t,M=Array.isArray,P=t=>M(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),R="[ \n\f\r]",N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,S=/-->/g,L=/>/g,D=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,U=/"/g,j=/^(?:script|style|textarea|title)$/i,W=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),z=W(1),H=W(2),V=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),F=new WeakMap,q=O.createTreeWalker(O,129,null,!1);function K(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(e):e}let Y=(t,e)=>{let r=t.length-1,o=[],i,n=2===e?"":"",l=N;for(let e=0;e"===s[0]?(l=null!=i?i:N,c=-1):void 0===s[1]?c=-2:(c=l.lastIndex-s[2].length,a=s[1],l=void 0===s[3]?D:'"'===s[3]?U:B):l===U||l===B?l=D:l===S||l===L?l=N:(l=D,i=void 0);let h=l===D&&t[e+1].startsWith("/>")?" ":"";n+=l===N?r+_:c>=0?(o.push(a),r.slice(0,c)+A+r.slice(c)+E+h):r+E+(-2===c?(o.push(void 0),e):h)}return[K(t,n+(t[r]||"")+(2===e?"":"")),o]};class J{constructor({strings:t,_$litType$:e},r){let o;this.parts=[];let i=0,n=0,l=t.length-1,a=this.parts,[s,c]=Y(t,e);if(this.el=J.createElement(s,r),q.currentNode=this.el.content,2===e){let t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=q.nextNode())&&a.length0){o.textContent=$?$.emptyScript:"";for(let r=0;r2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Z}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,r,o){let i=this.strings,n=!1;if(void 0===i)(n=!T(t=Q(this,t,e,0))||t!==this._$AH&&t!==V)&&(this._$AH=t);else{let o,l;let a=t;for(t=i[0],o=0;o{var o,i;let n=null!==(o=null==r?void 0:r.renderBefore)&&void 0!==o?o:e,l=n._$litPart$;if(void 0===l){let t=null!==(i=null==r?void 0:r.renderBefore)&&void 0!==i?i:null;n._$litPart$=l=new X(e.insertBefore(I(),t),t,void 0,null!=r?r:{})}return l._$AI(t),l};class ts extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;let r=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=r.firstChild),r}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ta(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return V}}ts.finalized=!0,ts._$litElement$=!0,null===(tx=globalThis.litElementHydrateSupport)||void 0===tx||tx.call(globalThis,{LitElement:ts});let tc=globalThis.litElementPolyfillSupport;null==tc||tc({LitElement:ts}),(null!==(t$=globalThis.litElementVersions)&&void 0!==t$?t$:globalThis.litElementVersions=[]).push("3.3.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let td=t=>e=>"function"==typeof e?(customElements.define(t,e),e):((t,e)=>{let{kind:r,elements:o}=e;return{kind:r,elements:o,finisher(e){customElements.define(t,e)}}})(t,e),th=(t,e)=>"method"!==e.kind||!e.descriptor||"value"in e.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}}:{...e,finisher(r){r.createProperty(e.key,t)}},tu=(t,e,r)=>{e.constructor.createProperty(r,t)};function tm(t){return(e,r)=>void 0!==r?tu(t,e,r):th(t,e)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function tp(t){return tm({...t,state:!0})}null!=(null===(tC=window.HTMLSlotElement)||void 0===tC?void 0:tC.prototype.assignedElements)||((t,e)=>t.assignedNodes(e).filter(t=>t.nodeType===Node.ELEMENT_NODE));/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let tg={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6};class tf{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let tw=(tv=class extends tf{constructor(t){var e;if(super(t),t.type!==tg.ATTRIBUTE||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,o;if(void 0===this.it){for(let o in this.it=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t))),e)!e[o]||(null===(r=this.nt)||void 0===r?void 0:r.has(o))||this.it.add(o);return this.render(e)}let i=t.element.classList;for(let t in this.it.forEach(t=>{t in e||(i.remove(t),this.it.delete(t))}),e){let r=!!e[t];r===this.it.has(t)||(null===(o=this.nt)||void 0===o?void 0:o.has(t))||(r?(i.add(t),this.it.add(t)):(i.remove(t),this.it.delete(t)))}return V}},(...t)=>({_$litDirective$:tv,values:t}));var tv,tb,ty,tx,t$,tC,tA=r(86135);let tE={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},tk={ms:t=>1e3*t,s:t=>t/1e3},t_=()=>{},tO=t=>t;function tI(t,e=!0){if(t&&"finished"!==t.playState)try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch(t){}}let tT=t=>t(),tM=(t,e,r=tE.duration)=>new Proxy({animations:t.map(tT).filter(Boolean),duration:r,options:e},tR),tP=t=>t.animations[0],tR={get:(t,e)=>{let r=tP(t);switch(e){case"duration":return t.duration;case"currentTime":return tk.s((null==r?void 0:r[e])||0);case"playbackRate":case"playState":return null==r?void 0:r[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(tN)).catch(t_)),t.finished;case"stop":return()=>{t.animations.forEach(t=>tI(t))};case"forEachNative":return e=>{t.animations.forEach(r=>e(r,t))};default:return void 0===(null==r?void 0:r[e])?void 0:()=>t.animations.forEach(t=>t[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=tk.ms(r);case"playbackRate":for(let o=0;ot.finished,tS=t=>"object"==typeof t&&!!t.createAnimation,tL=t=>"number"==typeof t,tD=t=>Array.isArray(t)&&!tL(t[0]),tB=(t,e,r)=>-r*t+r*e+t,tU=(t,e,r)=>e-t==0?1:(r-t)/(e-t);function tj(t,e){let r=t[t.length-1];for(let o=1;o<=e;o++){let i=tU(0,e,o);t.push(tB(r,1,i))}}let tW=(t,e,r)=>{let o=e-t;return((r-t)%o+o)%o+t},tz=(t,e,r)=>Math.min(Math.max(r,t),e),tH=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t;function tV(t,e,r,o){if(t===e&&r===o)return tO;let i=e=>(function(t,e,r,o,i){let n,l;let a=0;do(n=tH(l=e+(r-e)/2,o,i)-t)>0?r=l:e=l;while(Math.abs(n)>1e-7&&++a<12);return l})(e,0,1,t,r);return t=>0===t||1===t?t:tH(i(t),e,o)}let tZ=(t,e="end")=>r=>{r="end"===e?Math.min(r,.999):Math.max(r,.001);let o=r*t;return tz(0,1,("end"===e?Math.floor(o):Math.ceil(o))/t)},tF=t=>"function"==typeof t,tq=t=>Array.isArray(t)&&tL(t[0]),tK={ease:tV(.25,.1,.25,1),"ease-in":tV(.42,0,1,1),"ease-in-out":tV(.42,0,.58,1),"ease-out":tV(0,0,.58,1)},tY=/\((.*?)\)/;function tJ(t){if(tF(t))return t;if(tq(t))return tV(...t);if(tK[t])return tK[t];if(t.startsWith("steps")){let e=tY.exec(t);if(e){let t=e[1].split(",");return tZ(parseFloat(t[0]),t[1].trim())}}return tO}class tQ{constructor(t,e=[0,1],{easing:r,duration:o=tE.duration,delay:i=tE.delay,endDelay:n=tE.endDelay,repeat:l=tE.repeat,offset:a,direction:s="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=tO,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((t,e)=>{this.resolve=t,this.reject=e}),tS(r=r||tE.easing)){let t=r.createAnimation(e);r=t.easing,e=t.keyframes||e,o=t.duration||o}this.repeat=l,this.easing=tD(r)?tO:tJ(r),this.updateDuration(o);let c=function(t,e=function(t){let e=[0];return tj(e,t-1),e}(t.length),r=tO){let o=t.length,i=o-e.length;return i>0&&tj(e,i),i=>{var n;let l=0;for(;l{var r;let o=0;o=void 0!==this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate,this.t=o,o/=1e3,o=Math.max(o-i,0),"finished"===this.playState&&void 0===this.pauseTime&&(o=this.totalDuration);let l=o/this.duration,a=Math.floor(l),d=l%1;!d&&l>=1&&(d=1),1===d&&a--;let h=a%2;("reverse"===s||"alternate"===s&&h||"alternate-reverse"===s&&!h)&&(d=1-d);let u=o>=this.totalDuration?1:Math.min(d,1),m=c(this.easing(u));t(m);let p=void 0===this.pauseTime&&("finished"===this.playState||o>=this.totalDuration+n);p?(this.playState="finished",null===(r=this.resolve)||void 0===r||r.call(this,m)):"idle"!==this.playState&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){let t=performance.now();this.playState="running",void 0!==this.pauseTime?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",void 0!==this.frameRequestId&&cancelAnimationFrame(this.frameRequestId),null===(t=this.reject)||void 0===t||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){void 0!==this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}var tG=function(){};class tX{setAnimation(t){this.animation=t,null==t||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}let t0=new WeakMap;function t1(t){return t0.has(t)||t0.set(t,{transforms:[],values:new Map}),t0.get(t)}let t2=["","X","Y","Z"],t5={x:"translateX",y:"translateY",z:"translateZ"},t3={syntax:"",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},t4={translate:{syntax:"",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:t3,scale:{syntax:"",initialValue:1,toDefaultUnit:tO},skew:t3},t7=new Map,t6=t=>`--motion-${t}`,t8=["x","y","z"];["translate","scale","rotate","skew"].forEach(t=>{t2.forEach(e=>{t8.push(t+e),t7.set(t6(t+e),t4[t])})});let t9=(t,e)=>t8.indexOf(t)-t8.indexOf(e),et=new Set(t8),ee=t=>et.has(t),er=(t,e)=>{var r;t5[e]&&(e=t5[e]);let{transforms:o}=t1(t);r=e,-1===o.indexOf(r)&&o.push(r),t.style.transform=eo(o)},eo=t=>t.sort(t9).reduce(ei,"").trim(),ei=(t,e)=>`${t} ${e}(var(${t6(e)}))`,en=t=>t.startsWith("--"),el=new Set,ea=(t,e)=>document.createElement("div").animate(t,e),es={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{ea({opacity:[1]})}catch(t){return!1}return!0},finished:()=>!!ea({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{ea({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}},ec={},ed={};for(let t in es)ed[t]=()=>(void 0===ec[t]&&(ec[t]=es[t]()),ec[t]);let eh=(t,e)=>{let r="",o=Math.round(e/.015);for(let e=0;etF(t)?ed.linearEasing()?`linear(${eh(t,e)})`:tE.easing:tq(t)?em(t):t,em=([t,e,r,o])=>`cubic-bezier(${t}, ${e}, ${r}, ${o})`,ep=t=>Array.isArray(t)?t:[t];function eg(t){return t5[t]&&(t=t5[t]),ee(t)?t6(t):t}let ef={get:(t,e)=>{let r=en(e=eg(e))?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&0!==r){let t=t7.get(e);t&&(r=t.initialValue)}return r},set:(t,e,r)=>{en(e=eg(e))?t.style.setProperty(e,r):t.style[e]=r}},ew=t=>"string"==typeof t,ev=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t),eb=function(t,e,r={}){var o,i,n,l,a;"string"==typeof(o=t)?i?(null!==(n=i[o])&&void 0!==n||(i[o]=document.querySelectorAll(o)),o=i[o]):o=document.querySelectorAll(o):o instanceof Element&&(o=[o]),t=Array.from(o||[]);let s=t.length;tG(!!s,"No valid element provided."),tG(!!e,"No keyframes defined.");let c=[];for(let o=0;o{let n=()=>{var e,r;return null!==(r=null!==(e=ef.get(t,x))&&void 0!==e?e:null==C?void 0:C.initialValue)&&void 0!==r?r:0},v=function(t,e){for(let r=0;re+t)}return o}(v,C);if(tS(m)){let t=m.createAnimation(v,"opacity"!==e,n,x,$);m=t.easing,v=t.keyframes||v,c=t.duration||c}if(en(x)&&(ed.cssRegisterProperty()?function(t){if(!el.has(t)){el.add(t);try{let{syntax:e,initialValue:r}=t7.has(t)?t7.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch(t){}}}(x):y=!1),b&&!ed.linearEasing()&&(tF(m)||tD(m)&&m.some(tF))&&(y=!1),y){C&&(v=v.map(t=>tL(t)?C.toDefaultUnit(t):t)),1===v.length&&(!ed.partialKeyframes()||s)&&v.unshift(n());let e={delay:tk.ms(d),duration:tk.ms(c),endDelay:tk.ms(h),easing:tD(m)?void 0:eu(m,c),direction:g,iterations:u+1,fill:"both"};(l=t.animate({[x]:v,offset:f,easing:tD(m)?m.map(t=>eu(t,c)):void 0},e)).finished||(l.finished=new Promise((t,e)=>{l.onfinish=t,l.oncancel=e}));let r=v[v.length-1];l.finished.then(()=>{p||(ef.set(t,x,r),l.cancel())}).catch(t_),w||(l.playbackRate=1.000001)}else if(i&&b)1===(v=v.map(t=>"string"==typeof t?parseFloat(t):t)).length&&v.unshift(parseFloat(n())),l=new i(e=>{ef.set(t,x,A?A(e):e)},v,Object.assign(Object.assign({},o),{duration:c,easing:m}));else{let e=v[v.length-1];ef.set(t,x,C&&tL(e)?C.toDefaultUnit(e):e)}return s&&a(t,e,v,{duration:c,delay:d,easing:m,repeat:u,offset:f},"motion-one"),$.setAnimation(l),l}}(i,t,e[t],n,tQ);c.push(d)}}return tM(c,r,r.duration)};function ey(t,e={}){return tM([()=>{let r=new tQ(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function ex(t,e,r){let o=tF(t)?ey:eb;return o(t,e,r)}/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let e$=t=>null!=t?t:Z;var eC=r(74061),eA=Object.defineProperty,eE=Object.getOwnPropertySymbols,ek=Object.prototype.hasOwnProperty,e_=Object.prototype.propertyIsEnumerable,eO=(t,e,r)=>e in t?eA(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,eI=(t,e)=>{for(var r in e||(e={}))ek.call(e,r)&&eO(t,r,e[r]);if(eE)for(var r of eE(e))e_.call(e,r)&&eO(t,r,e[r]);return t};function eT(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}let eM={getPreset:t=>eT()[t],setTheme(){let t=document.querySelector(":root"),{themeVariables:e}=tA.Ic.state;if(t){let r=eI(eI(eI({},function(){var t;let e=null!=(t=tA.Ic.state.themeMode)?t:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--wcm-color-fg-1":r.foreground[1],"--wcm-color-fg-2":r.foreground[2],"--wcm-color-fg-3":r.foreground[3],"--wcm-color-bg-1":r.background[1],"--wcm-color-bg-2":r.background[2],"--wcm-color-bg-3":r.background[3],"--wcm-color-overlay":r.overlay}}()),eT()),e);Object.entries(r).forEach(([e,r])=>t.style.setProperty(e,r))}},globalCss:c`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},eP=c`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var eR=Object.defineProperty,eN=Object.getOwnPropertyDescriptor,eS=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?eN(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&eR(e,r,n),n};let eL=class extends ts{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){let t={"wcm-icon-left":void 0!==this.iconLeft,"wcm-icon-right":void 0!==this.iconRight,"wcm-ghost":"ghost"===this.variant,"wcm-outline":"outline"===this.variant},e="inverse";return"ghost"===this.variant&&(e="secondary"),"outline"===this.variant&&(e="accent"),z``}};eL.styles=[eM.globalCss,eP],eS([tm({type:Boolean})],eL.prototype,"disabled",2),eS([tm()],eL.prototype,"iconLeft",2),eS([tm()],eL.prototype,"iconRight",2),eS([tm()],eL.prototype,"onClick",2),eS([tm()],eL.prototype,"variant",2),eL=eS([td("wcm-button")],eL);let eD=c`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var eB=Object.defineProperty,eU=Object.getOwnPropertyDescriptor,ej=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?eU(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&eB(e,r,n),n};let eW=class extends ts{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){let t={"wcm-secondary":"secondary"===this.variant};return z``}};eW.styles=[eM.globalCss,eD],ej([tm({type:Boolean})],eW.prototype,"disabled",2),ej([tm()],eW.prototype,"variant",2),eW=ej([td("wcm-button-big")],eW);let ez=c`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var eH=Object.defineProperty,eV=Object.getOwnPropertyDescriptor;let eZ=class extends ts{render(){return z`
`}};eZ.styles=[eM.globalCss,ez],eZ=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?eV(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&eH(e,r,n),n})([td("wcm-info-footer")],eZ);let eF={CROSS_ICON:H``,WALLET_CONNECT_LOGO:H``,WALLET_CONNECT_ICON:H``,WALLET_CONNECT_ICON_COLORED:H``,BACK_ICON:H``,COPY_ICON:H``,RETRY_ICON:H``,DESKTOP_ICON:H``,MOBILE_ICON:H``,ARROW_DOWN_ICON:H``,ARROW_UP_RIGHT_ICON:H``,ARROW_RIGHT_ICON:H``,QRCODE_ICON:H``,SCAN_ICON:H``,CHECKMARK_ICON:H``,SEARCH_ICON:H``,WALLET_PLACEHOLDER:H``,GLOBE_ICON:H``},eq=c`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var eK=Object.defineProperty,eY=Object.getOwnPropertyDescriptor;let eJ=class extends ts{render(){return z`
${eF.WALLET_CONNECT_LOGO}
`}};eJ.styles=[eM.globalCss,eq],eJ=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?eY(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&eK(e,r,n),n})([td("wcm-modal-backcard")],eJ);let eQ=c`main{padding:20px;padding-top:0;width:100%}`;var eG=Object.defineProperty,eX=Object.getOwnPropertyDescriptor;let e0=class extends ts{render(){return z`
`}};e0.styles=[eM.globalCss,eQ],e0=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?eX(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&eG(e,r,n),n})([td("wcm-modal-content")],e0);let e1=c`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var e2=Object.defineProperty,e5=Object.getOwnPropertyDescriptor;let e3=class extends ts{render(){return z`
`}};e3.styles=[eM.globalCss,e1],e3=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?e5(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&e2(e,r,n),n})([td("wcm-modal-footer")],e3);let e4=c`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var e7=Object.defineProperty,e6=Object.getOwnPropertyDescriptor,e8=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?e6(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&e7(e,r,n),n};let e9=class extends ts{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return z``}actionBtnTemplate(){return z``}render(){let t={"wcm-border":this.border},e=tA.AV.state.history.length>1,r=this.title?z`${this.title}`:z``;return z`
${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}
`}};e9.styles=[eM.globalCss,e4],e8([tm()],e9.prototype,"title",2),e8([tm()],e9.prototype,"onAction",2),e8([tm()],e9.prototype,"actionIcon",2),e8([tm({type:Boolean})],e9.prototype,"border",2),e9=e8([td("wcm-modal-header")],e9);let rt={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(t,e){let r=t.renderRoot.querySelector(e);if(!r)throw Error(`${e} not found`);return r},getWalletIcon({id:t,image_id:e}){let{walletImages:r}=tA.t0.state;return null!=r&&r[t]?r[t]:e?tA.uc.getWalletImageUrl(e):""},getWalletName:(t,e=!1)=>e&&t.length>8?`${t.substring(0,8)}..`:t,isMobileAnimation:()=>window.innerWidth<=rt.MOBILE_BREAKPOINT,async preloadImage(t){let e=new Promise((e,r)=>{let o=new Image;o.onload=e,o.onerror=r,o.crossOrigin="anonymous",o.src=t});return Promise.race([e,tA.zv.wait(3e3)])},getErrorMessage:t=>t instanceof Error?t.message:"Unknown Error",debounce(t,e=500){let r;return(...o)=>{r&&clearTimeout(r),r=setTimeout(function(){t(...o)},e)}},handleMobileLinking(t){let e;let{walletConnectUri:r}=tA.zb.state,{mobile:o,name:i}=t,n=o?.native,l=o?.universal;rt.setRecentWallet(t),r&&(e="",n?e=tA.zv.formatUniversalUrl(n,r,i):l&&(e=tA.zv.formatNativeUrl(l,r,i)),tA.zv.openHref(e,"_self"))},handleAndroidLinking(){let{walletConnectUri:t}=tA.zb.state;t&&(tA.zv.setWalletConnectAndroidDeepLink(t),tA.zv.openHref(t,"_self"))},async handleUriCopy(){let{walletConnectUri:t}=tA.zb.state;if(t)try{await navigator.clipboard.writeText(t),tA.Vs.openToast("Link copied","success")}catch{tA.Vs.openToast("Failed to copy","error")}},getCustomImageUrls(){let{walletImages:t}=tA.t0.state,e=Object.values(t??{});return Object.values(e)},truncate:(t,e=8)=>t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`,setRecentWallet(t){try{localStorage.setItem(rt.WCM_RECENT_WALLET_DATA,JSON.stringify(t))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{let t=localStorage.getItem(rt.WCM_RECENT_WALLET_DATA);return t?JSON.parse(t):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes:(t,e)=>t.toUpperCase().includes(e.toUpperCase()),openWalletExplorerUrl(){tA.zv.openHref(rt.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){let{desktop:t,mobile:e}=tA.zv.getWalletRouterData(),r=!!t?.native,o=!!t?.universal,i=!!e?.native||!!e?.universal;return{isDesktop:r,isMobile:i,isWeb:o}},goToConnectingView(t){tA.AV.setData({Wallet:t});let e=tA.zv.isMobile(),{isDesktop:r,isWeb:o,isMobile:i}=rt.getCachedRouterWalletPlatforms();e?i?tA.AV.push("MobileConnecting"):o?tA.AV.push("WebConnecting"):tA.AV.push("InstallWallet"):r?tA.AV.push("DesktopConnecting"):o?tA.AV.push("WebConnecting"):i?tA.AV.push("MobileQrcodeConnecting"):tA.AV.push("InstallWallet")}},re=c`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var rr=Object.defineProperty,ro=Object.getOwnPropertyDescriptor,ri=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?ro(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&rr(e,r,n),n};let rn=class extends ts{constructor(){super(),this.view=tA.AV.state.view,this.prevView=tA.AV.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=tA.AV.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{let e=`${t.contentRect.height}px`;"0px"!==this.oldHeight&&ex(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;null==(t=this.unsubscribe)||t.call(this),null==(e=this.resizeObserver)||e.disconnect()}get routerEl(){return rt.getShadowRootElement(this,".wcm-router")}get contentEl(){return rt.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return z``;case"DesktopConnecting":return z``;case"MobileConnecting":return z``;case"WebConnecting":return z``;case"MobileQrcodeConnecting":return z``;case"WalletExplorer":return z``;case"Qrcode":return z``;case"InstallWallet":return z``;default:return z`
Not Found
`}}async onChangeRoute(){await ex(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=tA.AV.state.view,ex(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return z`
${this.viewTemplate()}
`}};rn.styles=[eM.globalCss,re],ri([tp()],rn.prototype,"view",2),ri([tp()],rn.prototype,"prevView",2),rn=ri([td("wcm-modal-router")],rn);let rl=c`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var ra=Object.defineProperty,rs=Object.getOwnPropertyDescriptor,rc=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?rs(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&ra(e,r,n),n};let rd=class extends ts{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=tA.Vs.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>tA.Vs.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;null==(t=this.unsubscribe)||t.call(this),clearTimeout(this.timeout),tA.Vs.closeToast()}render(){let{message:t,variant:e}=tA.Vs.state;return this.open?z`
${"success"===e?eF.CHECKMARK_ICON:null} ${"error"===e?eF.CROSS_ICON:null}${t}
`:null}};function rh(t,e,r){return t!==e&&(t-e<0?e-t:t-e)<=r+.1}rd.styles=[eM.globalCss,rl],rc([tp()],rd.prototype,"open",2),rd=rc([td("wcm-modal-toast")],rd);let ru={generate(t,e,r){let o="#141414",i=[],n=function(t,e){let r=Array.prototype.slice.call(eC.create(t,{errorCorrectionLevel:"Q"}).modules.data,0),o=Math.sqrt(r.length);return r.reduce((t,e,r)=>(r%o==0?t.push([e]):t[t.length-1].push(e))&&t,[])}(t,0),l=e/n.length,a=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];a.forEach(({x:t,y:e})=>{let r=(n.length-7)*l*t,s=(n.length-7)*l*e;for(let t=0;t`)}});let s=Math.floor((r+25)/l),c=n.length/2-s/2,d=n.length/2+s/2-1,h=[];n.forEach((t,e)=>{t.forEach((t,r)=>{!n[e][r]||e<7&&r<7||e>n.length-8&&r<7||e<7&&r>n.length-8||e>c&&ec&&r{u[t]?u[t].push(e):u[t]=[e]}),Object.entries(u).map(([t,e])=>{let r=e.filter(t=>e.every(e=>!rh(t,e,l)));return[Number(t),r]}).forEach(([t,e])=>{e.forEach(e=>{i.push(H``)})}),Object.entries(u).filter(([t,e])=>e.length>1).map(([t,e])=>{let r=e.filter(t=>e.some(e=>rh(t,e,l)));return[Number(t),r]}).map(([t,e])=>{e.sort((t,e)=>te.some(e=>rh(t,e,l)));e?e.push(t):r.push([t])}return[t,r.map(t=>[t[0],t[t.length-1]])]}).forEach(([t,e])=>{e.forEach(([e,r])=>{i.push(H``)})}),i}},rm=c`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var rp=Object.defineProperty,rg=Object.getOwnPropertyDescriptor,rf=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?rg(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&rp(e,r,n),n};let rw=class extends ts{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){let t="light"===tA.Ic.state.themeMode?this.size:this.size-36;return H`${ru.generate(this.uri,t,t/4)}`}render(){let t={"wcm-dark":"dark"===tA.Ic.state.themeMode};return z`
${this.walletId||this.imageUrl?z``:eF.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`}};rw.styles=[eM.globalCss,rm],rf([tm()],rw.prototype,"uri",2),rf([tm({type:Number})],rw.prototype,"size",2),rf([tm()],rw.prototype,"imageId",2),rf([tm()],rw.prototype,"walletId",2),rf([tm()],rw.prototype,"imageUrl",2),rw=rf([td("wcm-qrcode")],rw);let rv=c`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var rb=Object.defineProperty,ry=Object.getOwnPropertyDescriptor,rx=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?ry(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&rb(e,r,n),n};let r$=class extends ts{constructor(){super(...arguments),this.onChange=()=>null}render(){return z` ${eF.SEARCH_ICON}`}};r$.styles=[eM.globalCss,rv],rx([tm()],r$.prototype,"onChange",2),r$=rx([td("wcm-search-input")],r$);let rC=c`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;var rA=Object.defineProperty,rE=Object.getOwnPropertyDescriptor;let rk=class extends ts{render(){return z``}};rk.styles=[eM.globalCss,rC],rk=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?rE(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&rA(e,r,n),n})([td("wcm-spinner")],rk);let r_=c`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var rO=Object.defineProperty,rI=Object.getOwnPropertyDescriptor,rT=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?rI(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&rO(e,r,n),n};let rM=class extends ts{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){let t={"wcm-big-bold":"big-bold"===this.variant,"wcm-medium-regular":"medium-regular"===this.variant,"wcm-small-regular":"small-regular"===this.variant,"wcm-small-thin":"small-thin"===this.variant,"wcm-xsmall-regular":"xsmall-regular"===this.variant,"wcm-xsmall-bold":"xsmall-bold"===this.variant,"wcm-color-primary":"primary"===this.color,"wcm-color-secondary":"secondary"===this.color,"wcm-color-tertiary":"tertiary"===this.color,"wcm-color-inverse":"inverse"===this.color,"wcm-color-accnt":"accent"===this.color,"wcm-color-error":"error"===this.color};return z``}};rM.styles=[eM.globalCss,r_],rT([tm()],rM.prototype,"variant",2),rT([tm()],rM.prototype,"color",2),rM=rT([td("wcm-text")],rM);let rP=c`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var rR=Object.defineProperty,rN=Object.getOwnPropertyDescriptor,rS=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?rN(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&rR(e,r,n),n};let rL=class extends ts{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?z`RECENT`:this.installed?z`INSTALLED`:null}handleClick(){tA.uA.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return z``}};rL.styles=[eM.globalCss,rP],rS([tm()],rL.prototype,"onClick",2),rS([tm()],rL.prototype,"name",2),rS([tm()],rL.prototype,"walletId",2),rS([tm()],rL.prototype,"label",2),rS([tm()],rL.prototype,"imageId",2),rS([tm({type:Boolean})],rL.prototype,"installed",2),rS([tm({type:Boolean})],rL.prototype,"recent",2),rL=rS([td("wcm-wallet-button")],rL);let rD=c`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var rB=Object.defineProperty,rU=Object.getOwnPropertyDescriptor,rj=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?rU(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&rB(e,r,n),n};let rW=class extends ts{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;let e=null!=(t=this.imageUrl)&&t.length?this.imageUrl:rt.getWalletIcon({id:this.walletId,image_id:this.imageId});return z`${e.length?z`
${this.id}
`:eF.WALLET_PLACEHOLDER}`}};rW.styles=[eM.globalCss,rD],rj([tm()],rW.prototype,"walletId",2),rj([tm()],rW.prototype,"imageId",2),rj([tm()],rW.prototype,"imageUrl",2),rW=rj([td("wcm-wallet-image")],rW);var rz=Object.defineProperty,rH=Object.getOwnPropertyDescriptor,rV=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?rH(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&rz(e,r,n),n};let rZ=class extends ts{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{null!=t&&t.length&&await Promise.all(t.map(async t=>rt.preloadImage(t)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){if(tA.t0.state.enableExplorer){await tA.uc.getRecomendedWallets(),tA.zb.setIsDataLoaded(!0);let{recomendedWallets:t}=tA.uc.state,e=t.map(t=>rt.getWalletIcon(t));await this.loadImages(e)}else tA.zb.setIsDataLoaded(!0)}async preloadCustomImages(){let t=rt.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),tA.Vs.openToast("Failed preloading","error")}}};rV([tp()],rZ.prototype,"preload",2),rZ=rV([td("wcm-explorer-context")],rZ);var rF=Object.defineProperty,rq=Object.getOwnPropertyDescriptor;let rK=class extends ts{constructor(){super(),this.unsubscribeTheme=void 0,eM.setTheme(),this.unsubscribeTheme=tA.Ic.subscribe(eM.setTheme)}disconnectedCallback(){var t;null==(t=this.unsubscribeTheme)||t.call(this)}};rK=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?rq(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&rF(e,r,n),n})([td("wcm-theme-context")],rK);let rY=c`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var rJ=Object.defineProperty,rQ=Object.getOwnPropertyDescriptor;let rG=class extends ts{onGoToQrcode(){tA.AV.push("Qrcode")}render(){let{recomendedWallets:t}=tA.uc.state,e=[...t,...t],r=2*tA.zv.RECOMMENDED_WALLET_AMOUNT;return z`
${eF.MOBILE_ICON}WalletConnect
${[...Array(r)].map((t,r)=>{let o=e[r%e.length];return o?z``:eF.WALLET_PLACEHOLDER})}
Select Wallet
Choose WalletConnect to see supported apps on your device`}};rG.styles=[eM.globalCss,rY],rG=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?rQ(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&rJ(e,r,n),n})([td("wcm-android-wallet-selection")],rG);let rX=c`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var r0=Object.defineProperty,r1=Object.getOwnPropertyDescriptor,r2=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?r1(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&r0(e,r,n),n};let r5=class extends ts{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;let r=null!=(e=null==(t=tA.Ic.state.themeVariables)?void 0:t["--wcm-wallet-icon-large-border-radius"])?e:eM.getPreset("--wcm-wallet-icon-large-border-radius"),o=0;o=(r.includes("%")?.88*parseInt(r,10):parseInt(r,10))*1.17;let i=317-1.57*o,n=425-1.8*o;return z``}render(){let t={"wcm-error":this.isError,"wcm-stale":this.isStale};return z`
${this.svgLoaderTemplate()}
${this.isError?"Connection declined":this.label}`}};r5.styles=[eM.globalCss,rX],r2([tm()],r5.prototype,"walletId",2),r2([tm()],r5.prototype,"imageId",2),r2([tm({type:Boolean})],r5.prototype,"isError",2),r2([tm({type:Boolean})],r5.prototype,"isStale",2),r2([tm()],r5.prototype,"label",2),r5=r2([td("wcm-connector-waiting")],r5);let r3={manualWallets(){var t,e;let{mobileWallets:r,desktopWallets:o}=tA.t0.state,i=null==(t=r3.recentWallet())?void 0:t.id,n=tA.zv.isMobile()?r:o,l=n?.filter(t=>i!==t.id);return null!=(e=tA.zv.isMobile()?l?.map(({id:t,name:e,links:r})=>({id:t,name:e,mobile:r,links:r})):l?.map(({id:t,name:e,links:r})=>({id:t,name:e,desktop:r,links:r})))?e:[]},recentWallet:()=>rt.getRecentWallet(),recomendedWallets(t=!1){var e;let r=t||null==(e=r3.recentWallet())?void 0:e.id,{recomendedWallets:o}=tA.uc.state;return o.filter(t=>r!==t.id)}},r4={onConnecting(t){rt.goToConnectingView(t)},manualWalletsTemplate(){return r3.manualWallets().map(t=>z``)},recomendedWalletsTemplate(t=!1){return r3.recomendedWallets(t).map(t=>z``)},recentWalletTemplate(){let t=r3.recentWallet();if(t)return z``}},r7=c`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var r6=Object.defineProperty,r8=Object.getOwnPropertyDescriptor;let r9=class extends ts{render(){let{explorerExcludedWalletIds:t,enableExplorer:e}=tA.t0.state,r=r4.manualWalletsTemplate(),o=r4.recomendedWalletsTemplate(),i=[r4.recentWalletTemplate(),...r,...o];i=i.filter(Boolean);let n=i.length>4||"ALL"!==t&&e,l=[];l=n?i.slice(0,3):i;let a=!!l.length;return z`
${eF.MOBILE_ICON}Mobile
${eF.SCAN_ICON}Scan with your wallet
${a?z`
${eF.DESKTOP_ICON}Desktop
${l} ${n?z``:null}
`:null}`}};r9.styles=[eM.globalCss,r7],r9=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?r8(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&r6(e,r,n),n})([td("wcm-desktop-wallet-selection")],r9);let ot=c`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var oe=Object.defineProperty,or=Object.getOwnPropertyDescriptor;let oo=class extends ts{render(){let{termsOfServiceUrl:t,privacyPolicyUrl:e}=tA.t0.state;return t??e?z`
By connecting your wallet to this app, you agree to the app's ${t?z`Terms of Service`:null} ${t&&e?"and":null} ${e?z`Privacy Policy`:null}
`:null}};oo.styles=[eM.globalCss,ot],oo=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?or(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&oe(e,r,n),n})([td("wcm-legal-notice")],oo);let oi=c`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var on=Object.defineProperty,ol=Object.getOwnPropertyDescriptor;let oa=class extends ts{onQrcode(){tA.AV.push("Qrcode")}render(){let{explorerExcludedWalletIds:t,enableExplorer:e}=tA.t0.state,r=r4.manualWalletsTemplate(),o=r4.recomendedWalletsTemplate(),i=[r4.recentWalletTemplate(),...r,...o];i=i.filter(Boolean);let n=i.length>8||"ALL"!==t&&e,l=[];l=n?i.slice(0,7):i;let a=!!l.length;return z`${a?z`
${l} ${n?z``:null}
`:null}`}};oa.styles=[eM.globalCss,oi],oa=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?ol(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&on(e,r,n),n})([td("wcm-mobile-wallet-selection")],oa);let os=c`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var oc=Object.defineProperty,od=Object.getOwnPropertyDescriptor,oh=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?od(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&oc(e,r,n),n};let ou=class extends ts{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=tA.jb.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;null==(t=this.unsubscribeModal)||t.call(this)}get overlayEl(){return rt.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return rt.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(t){if(document.querySelector("body")){if(t){let t=document.getElementById("wcm-styles");t?.remove()}else document.head.insertAdjacentHTML("beforeend",'')}}onCloseModal(t){t.target===t.currentTarget&&tA.jb.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{let t=rt.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]};await Promise.all([ex(this.overlayEl,{opacity:[0,1]},{delay:.1,duration:.2}).finished,ex(this.containerEl,t,{delay:.1,duration:.2}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();let t=rt.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]};await Promise.all([ex(this.overlayEl,{opacity:[1,0]},{duration:.2}).finished,ex(this.containerEl,t,{duration:.2}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;"Escape"===t.key?tA.jb.close():"Tab"===t.key&&(null!=(e=t.target)&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;null==(t=this.abortController)||t.abort(),this.abortController=void 0}render(){let t={"wcm-overlay":!0,"wcm-active":this.active};return z`
${this.open?z`
`:null}
`}};ou.styles=[eM.globalCss,os],oh([tp()],ou.prototype,"open",2),oh([tp()],ou.prototype,"active",2),ou=oh([td("wcm-modal")],ou);let om=c`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var op=Object.defineProperty,og=Object.getOwnPropertyDescriptor,of=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?og(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&op(e,r,n),n};let ow=class extends ts{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){tA.zv.isMobile()?tA.AV.replace("MobileConnecting"):tA.AV.replace("MobileQrcodeConnecting")}onDesktop(){tA.AV.replace("DesktopConnecting")}onWeb(){tA.AV.replace("WebConnecting")}render(){return z`
${this.isRetry?z``:null} ${this.isMobile?z`Mobile`:null} ${this.isDesktop?z`Desktop`:null} ${this.isWeb?z`Web`:null}
`}};ow.styles=[eM.globalCss,om],of([tm({type:Boolean})],ow.prototype,"isMobile",2),of([tm({type:Boolean})],ow.prototype,"isDesktop",2),of([tm({type:Boolean})],ow.prototype,"isWeb",2),of([tm({type:Boolean})],ow.prototype,"isRetry",2),ow=of([td("wcm-platform-selection")],ow);let ov=c`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var ob=Object.defineProperty,oy=Object.getOwnPropertyDescriptor;let ox=class extends ts{onClick(){tA.AV.push("WalletExplorer")}render(){let{recomendedWallets:t}=tA.uc.state,e=r3.manualWallets(),r=[...t,...e].reverse().slice(0,4);return z``}};ox.styles=[eM.globalCss,ov],ox=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?oy(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&ob(e,r,n),n})([td("wcm-view-all-wallets-button")],ox);let o$=c`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var oC=Object.defineProperty,oA=Object.getOwnPropertyDescriptor,oE=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?oA(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&oC(e,r,n),n};let ok=class extends ts{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{let{walletConnectUri:t}=tA.zb.state;this.uri=t},0)}get overlayEl(){return rt.getShadowRootElement(this,".wcm-qr-container")}render(){return z`
${this.uri?z``:z``}
`}};ok.styles=[eM.globalCss,o$],oE([tm()],ok.prototype,"walletId",2),oE([tm()],ok.prototype,"imageId",2),oE([tp()],ok.prototype,"uri",2),ok=oE([td("wcm-walletconnect-qr")],ok);var o_=Object.defineProperty,oO=Object.getOwnPropertyDescriptor;let oI=class extends ts{viewTemplate(){return tA.zv.isAndroid()?z``:tA.zv.isMobile()?z``:z``}render(){return z`${this.viewTemplate()}`}};oI.styles=[eM.globalCss],oI=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?oO(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&o_(e,r,n),n})([td("wcm-connect-wallet-view")],oI);let oT=c`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var oM=Object.defineProperty,oP=Object.getOwnPropertyDescriptor,oR=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?oP(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&oM(e,r,n),n};let oN=class extends ts{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(t){let{desktop:e,name:r}=tA.zv.getWalletRouterData(),o=e?.native;if(o){let e=tA.zv.formatNativeUrl(o,t,r);tA.zv.openHref(e,"_self")}}openDesktopApp(){let{walletConnectUri:t}=tA.zb.state,e=tA.zv.getWalletRouterData();rt.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){let{name:t,id:e,image_id:r}=tA.zv.getWalletRouterData(),{isMobile:o,isWeb:i}=rt.getCachedRouterWalletPlatforms();return z`${`Connection can continue loading if ${t} is not installed on your device`}Retry`}};oN.styles=[eM.globalCss,oT],oR([tp()],oN.prototype,"isError",2),oN=oR([td("wcm-desktop-connecting-view")],oN);let oS=c`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var oL=Object.defineProperty,oD=Object.getOwnPropertyDescriptor;let oB=class extends ts{onInstall(t){t&&tA.zv.openHref(t,"_blank")}render(){let{name:t,id:e,image_id:r,homepage:o}=tA.zv.getWalletRouterData();return z`${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}Download`}};oB.styles=[eM.globalCss,oS],oB=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?oD(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&oL(e,r,n),n})([td("wcm-install-wallet-view")],oB);let oU=c`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var oj=Object.defineProperty,oW=Object.getOwnPropertyDescriptor,oz=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?oW(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&oj(e,r,n),n};let oH=class extends ts{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(t,e=!1){let{mobile:r,name:o}=tA.zv.getWalletRouterData(),i=r?.native,n=r?.universal;if(i&&!e){let e=tA.zv.formatNativeUrl(i,t,o);tA.zv.openHref(e,"_self")}else if(n){let e=tA.zv.formatUniversalUrl(n,t,o);tA.zv.openHref(e,"_self")}}openMobileApp(t=!1){let{walletConnectUri:e}=tA.zb.state,r=tA.zv.getWalletRouterData();rt.setRecentWallet(r),e&&this.onFormatAndRedirect(e,t)}onGoToAppStore(t){t&&tA.zv.openHref(t,"_blank")}render(){let{name:t,id:e,image_id:r,app:o,mobile:i}=tA.zv.getWalletRouterData(),{isWeb:n}=rt.getCachedRouterWalletPlatforms(),l=o?.ios,a=i?.universal;return z`Retry${a?z`Still doesn't work? Try this alternate link`:null}
${`Get ${t}`}
App Store
`}};oH.styles=[eM.globalCss,oU],oz([tp()],oH.prototype,"isError",2),oH=oz([td("wcm-mobile-connecting-view")],oH);let oV=c`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var oZ=Object.defineProperty,oF=Object.getOwnPropertyDescriptor;let oq=class extends ts{render(){let{name:t,id:e,image_id:r}=tA.zv.getWalletRouterData(),{isDesktop:o,isWeb:i}=rt.getCachedRouterWalletPlatforms();return z`${`Scan this QR Code with your phone's camera or inside ${t} app`}`}};oq.styles=[eM.globalCss,oV],oq=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?oF(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&oZ(e,r,n),n})([td("wcm-mobile-qr-connecting-view")],oq);var oK=Object.defineProperty,oY=Object.getOwnPropertyDescriptor;let oJ=class extends ts{render(){return z``}};oJ.styles=[eM.globalCss],oJ=((t,e,r,o)=>{for(var i,n=o>1?void 0:o?oY(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&oK(e,r,n),n})([td("wcm-qrcode-view")],oJ);let oQ=c`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var oG=Object.defineProperty,oX=Object.getOwnPropertyDescriptor,o0=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?oX(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&oG(e,r,n),n};let o1=class extends ts{constructor(){super(...arguments),this.loading=!tA.uc.state.wallets.listings.length,this.firstFetch=!tA.uc.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=rt.debounce(t=>{t.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=t,tA.uc.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),tA.uc.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;null==(t=this.intersectionObserver)||t.disconnect()}get placeholderEl(){return rt.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){let{wallets:t,search:e}=tA.uc.state,{listings:r,total:o}=this.search?e:t;return o<=40||r.length>=o}async fetchWallets(){var t;let{wallets:e,search:r}=tA.uc.state,{listings:o,total:i,page:n}=this.search?r:e;if(!this.endReached&&(this.firstFetch||i>40&&o.lengthrt.getWalletIcon(t));await Promise.all([...o.map(async t=>rt.preloadImage(t)),tA.zv.wait(300)]),this.endReached=this.isLastPage()}catch(t){console.error(t),tA.Vs.openToast(rt.getErrorMessage(t),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){tA.zv.isAndroid()?rt.handleMobileLinking(t):rt.goToConnectingView(t)}onSearchChange(t){let{value:e}=t.target;this.searchDebounce(e)}render(){let{wallets:t,search:e}=tA.uc.state,{listings:r}=this.search?e:t,o=this.loading&&!r.length,i=this.search.length>=3,n=r4.manualWalletsTemplate(),l=r4.recomendedWalletsTemplate(!0);i&&(n=n.filter(({values:t})=>rt.caseSafeIncludes(t[0],this.search)),l=l.filter(({values:t})=>rt.caseSafeIncludes(t[0],this.search)));let a=!this.loading&&!r.length&&!l.length,s={"wcm-loading":o,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":a};return z`
${o?null:n} ${o?null:l} ${o?null:r.map(t=>z`${t?z``:null}`)}
${a?z`No results found`:null} ${!a&&this.loading?z``:null}
`}};o1.styles=[eM.globalCss,oQ],o0([tp()],o1.prototype,"loading",2),o0([tp()],o1.prototype,"firstFetch",2),o0([tp()],o1.prototype,"search",2),o0([tp()],o1.prototype,"endReached",2),o1=o0([td("wcm-wallet-explorer-view")],o1);let o2=c`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var o5=Object.defineProperty,o3=Object.getOwnPropertyDescriptor,o4=(t,e,r,o)=>{for(var i,n=o>1?void 0:o?o3(e,r):e,l=t.length-1;l>=0;l--)(i=t[l])&&(n=(o?i(e,r,n):i(n))||n);return o&&n&&o5(e,r,n),n};let o7=class extends ts{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(t){let{desktop:e,name:r}=tA.zv.getWalletRouterData(),o=e?.universal;if(o){let e=tA.zv.formatUniversalUrl(o,t,r);tA.zv.openHref(e,"_blank")}}openWebWallet(){let{walletConnectUri:t}=tA.zb.state,e=tA.zv.getWalletRouterData();rt.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){let{name:t,id:e,image_id:r}=tA.zv.getWalletRouterData(),{isMobile:o,isDesktop:i}=rt.getCachedRouterWalletPlatforms(),n=tA.zv.isMobile();return z`${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}Retry`}};o7.styles=[eM.globalCss,o2],o4([tp()],o7.prototype,"isError",2),o7=o4([td("wcm-web-connecting-view")],o7)}}]); \ No newline at end of file diff --git a/urbit/bus/vegas/build/_next/static/chunks/framework-43c6850fc1bd386a.js b/urbit/bus/vegas/build/_next/static/chunks/framework-43c6850fc1bd386a.js new file mode 100644 index 000000000..8e43aa817 --- /dev/null +++ b/urbit/bus/vegas/build/_next/static/chunks/framework-43c6850fc1bd386a.js @@ -0,0 +1,49 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[774],{1350:function(e,t,n){/** + * @license React + * react-dom-server-legacy.browser.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var r=n(2784);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n