codexmeter 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,7 +24,7 @@ yyyy`);var r=Os(t),i=n?`getUTC`:`get`,a=r[i+`FullYear`](),o=r[i+`Month`]()+1,s=r
|
|
|
24
24
|
|
|
25
25
|
`:`<br/>`,m=l.join(p);this._showOrMove(a,function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(a,d,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(a,m,s,Math.random()+``,i[0],i[1],d,null,u)})},t.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=ad(t),a=i.seriesIndex,o=r.getSeriesByIndex(a),s=i.dataModel||o,c=i.dataIndex,l=i.dataType,u=s.getData(l),d=this._renderMode,f=e.positionDefault,p=GP([u.getItemModel(c),s,o&&(o.coordinateSystem||{}).model],this._tooltipModel,f?{position:f}:null),m=p.get(`trigger`);if(!(m!=null&&m!==`item`)){var h=s.getDataParams(c,l),g=new eb;h.marker=g.makeTooltipMarker(`item`,Sg(h.color),d);var _=ty(s.formatTooltip(c,!1,l)),v=p.get(`order`),y=p.get(`valueFormatter`),b=_.frag,x=b?Gy(y?I({valueFormatter:y},b):b,g,d,v,r.get(`useUTC`),p.get(`textStyle`)):_.text,S=`item_`+s.name+`_`+c;this._showOrMove(p,function(){this._showTooltipContent(p,x,h,S,e.offsetX,e.offsetY,e.position,e.target,g)}),n({type:`showTip`,dataIndexInside:c,dataIndex:u.getRawIndex(c),seriesIndex:a,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var r=this._renderMode===`html`,i=ad(t),a=i.tooltipConfig.option||{},o=a.encodeHTMLContent;if(U(a)){var s=a;a={content:s,formatter:s},o=!0}o&&r&&a.content&&(a=at(a),a.content=In(a.content));var c=[a],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&c.push(l),c.push({formatter:a.content});var u=e.positionDefault,d=GP(c,this._tooltipModel,u?{position:u}:null),f=d.get(`content`),p=Math.random()+``,m=new eb;this._showOrMove(d,function(){var n=at(d.get(`formatterParams`)||{});this._showTooltipContent(d,f,n,p,e.offsetX,e.offsetY,e.position,t,m)}),n({type:`showTip`,from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,r,i,a,o,s,c){if(this._ticket=``,!(!e.get(`showContent`)||!e.get(`show`))){var l=this._tooltipContent;l.setEnterable(e.get(`enterable`));var u=e.get(`formatter`);o||=e.get(`position`);var d=t,f=this._getNearestPoint([i,a],n,e.get(`trigger`),e.get(`borderColor`),e.get(`defaultBorderColor`,!0)).color;if(u)if(U(u)){var p=e.ecModel.get(`useUTC`),m=V(n)?n[0]:n,h=m&&m.axisType&&m.axisType.indexOf(`time`)>=0;d=u,h&&(d=qh(m.axisValue,d,p)),d=vg(d,n,!0)}else if(H(u)){var g=B(function(t,r){t===this._ticket&&(l.setContent(r,c,e,f,o),this._updatePosition(e,o,i,a,l,n,s))},this);this._ticket=r,d=u(n,r,g)}else d=u;l.setContent(d,c,e,f,o),l.show(e,f),this._updatePosition(e,o,i,a,l,n,s)}},t.prototype._getNearestPoint=function(e,t,n,r,i){if(n===`axis`||V(t))return{color:r||i};if(!V(t))return{color:r||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,r,i,a,o){var s=this._api.getWidth(),c=this._api.getHeight();t||=e.get(`position`);var l=i.getSize(),u=e.get(`align`),d=e.get(`verticalAlign`),f=o&&o.getBoundingRect().clone();if(o&&f.applyTransform(o.transform),H(t)&&(t=t([n,r],a,i.el,f,{viewSize:[s,c],contentSize:l.slice()})),V(t))n=ps(t[0],s),r=ps(t[1],c);else if(W(t)){var p=t;p.width=l[0],p.height=l[1];var m=Ug(p,{width:s,height:c});n=m.x,r=m.y,u=null,d=null}else if(U(t)&&o){var h=YP(t,f,l,e.get(`borderWidth`));n=h[0],r=h[1]}else{var h=qP(n,r,i,s,c,u?null:20,d?null:20);n=h[0],r=h[1]}if(u&&(n-=XP(u)?l[0]/2:u===`right`?l[0]:0),d&&(r-=XP(d)?l[1]/2:d===`bottom`?l[1]:0),SP(e)){var h=JP(n,r,i,s,c);n=h[0],r=h[1]}i.moveTo(n,r)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&R(n,function(n,a){var o=n.dataByAxis||[],s=(e[a]||{}).dataByAxis||[];i&&=o.length===s.length,i&&R(o,function(e,n){var a=s[n]||{},o=e.seriesDataIndices||[],c=a.seriesDataIndices||[];i=i&&e.value===a.value&&e.axisType===a.axisType&&e.axisId===a.axisId&&o.length===c.length,i&&R(o,function(e,t){var n=c[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),r&&R(e.seriesDataIndices,function(e){var n=e.seriesIndex,a=t[n],o=r[n];a&&o&&o.data!==a.data&&(i=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:`hideTip`,from:this.uid})},t.prototype.dispose=function(e,t){Pe.node||!t.getDom()||(kb(this,`_updatePosition`),this._tooltipContent.dispose(),xN(`itemTooltip`,t))},t.type=`tooltip`,t}(mb);function GP(e,t,n){var r=t.ecModel,i;n?(i=new lh(n,r,r),i=new lh(t.option,i,r)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof lh&&(o=o.get(`tooltip`,!0)),U(o)&&(o={formatter:o}),o&&(i=new lh(o,i,r)))}return i}function KP(e,t){return e.dispatchAction||B(t.dispatchAction,t)}function qP(e,t,n,r,i,a,o){var s=n.getSize(),c=s[0],l=s[1];return a!=null&&(e+c+a+2>r?e-=c+a:e+=a),o!=null&&(t+l+o>i?t-=l+o:t+=o),[e,t]}function JP(e,t,n,r,i){var a=n.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,r)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function YP(e,t,n,r){var i=n[0],a=n[1],o=Math.ceil(Math.SQRT2*r)+8,s=0,c=0,l=t.width,u=t.height;switch(e){case`inside`:s=t.x+l/2-i/2,c=t.y+u/2-a/2;break;case`top`:s=t.x+l/2-i/2,c=t.y-a-o;break;case`bottom`:s=t.x+l/2-i/2,c=t.y+u+o;break;case`left`:s=t.x-i-o,c=t.y+u/2-a/2;break;case`right`:s=t.x+l+o,c=t.y+u/2-a/2}return[s,c]}function XP(e){return e===`center`||e===`middle`}function ZP(e,t,n){var r=_c(e).queryOptionMap,i=r.keys()[0];if(!(!i||i===`series`)){var a=bc(t,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a){var o=n.getViewOfComponentModel(a),s;if(o.group.traverse(function(t){var n=ad(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0}),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}}}function QP(e){BE(IN),e.registerComponentModel(xP),e.registerComponentView(WP),e.registerAction({type:`showTip`,event:`showTip`,update:`tooltip:manuallyShowTip`},Wt),e.registerAction({type:`hideTip`,event:`hideTip`,update:`tooltip:manuallyHideTip`},Wt)}F();var $P=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:`box`,ignoreSize:!0},n}return t.type=`title`,t.defaultOption={z:6,show:!0,text:``,target:`blank`,subtext:``,subtarget:`blank`,left:`center`,top:Z.size.m,backgroundColor:Z.color.transparent,borderColor:Z.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:`bold`,color:Z.color.primary},subtextStyle:{fontSize:12,color:Z.color.quaternary}},t}(Qg),eF=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get(`show`)){var r=this.group,i=e.getModel(`textStyle`),a=e.getModel(`subtextStyle`),o=e.get(`textAlign`),s=G(e.get(`textBaseline`),e.get(`textVerticalAlign`)),c=new X({style:Vm(i,{text:e.get(`text`),fill:i.getTextColor()},{disableBox:!0}),z2:10}),l=c.getBoundingRect(),u=e.get(`subtext`),d=new X({style:Vm(a,{text:u,fill:a.getTextColor(),y:l.height+e.get(`itemGap`),verticalAlign:`top`},{disableBox:!0}),z2:10}),f=e.get(`link`),p=e.get(`sublink`),m=e.get(`triggerEvent`,!0);c.silent=!f&&!m,d.silent=!p&&!m,f&&c.on(`click`,function(){Cg(f,`_`+e.get(`target`))}),p&&d.on(`click`,function(){Cg(p,`_`+e.get(`subtarget`))}),ad(c).eventData=ad(d).eventData=m?{componentType:`title`,componentIndex:e.componentIndex}:null,r.add(c),u&&r.add(d);var h=r.getBoundingRect(),g=e.getBoxLayoutParams();g.width=h.width,g.height=h.height;var _=Ug(g,Gg(e,n).refContainer,e.get(`padding`));o||(o=e.get(`left`)||e.get(`right`),o===`middle`&&(o=`center`),o===`right`?_.x+=_.width:o===`center`&&(_.x+=_.width/2)),s||(s=e.get(`top`)||e.get(`bottom`),s===`center`&&(s=`middle`),s===`bottom`?_.y+=_.height:s===`middle`&&(_.y+=_.height/2),s||=`top`),r.x=_.x,r.y=_.y,r.markRedraw();var v={align:o,verticalAlign:s};c.setStyle(v),d.setStyle(v),h=r.getBoundingRect();var y=_.margin,b=e.getItemStyle([`color`,`opacity`]);b.fill=e.get(`backgroundColor`);var x=new Vu({shape:{x:h.x-y[3],y:h.y-y[0],width:h.width+y[1]+y[3],height:h.height+y[0]+y[2],r:e.get(`borderRadius`)},style:b,subPixelOptimize:!0,silent:!0});r.add(x)}},t.type=`title`,t}(mb);function tF(e){e.registerComponentModel($P),e.registerComponentView(eF)}F();var nF=function(e,t){if(t===`all`)return{type:`all`,title:e.getLocaleModel().get([`legend`,`selector`,`all`])};if(t===`inverse`)return{type:`inverse`,title:e.getLocaleModel().get([`legend`,`selector`,`inverse`])}},rF=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:`box`,ignoreSize:!0},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;t===!0&&(t=e.selector=[`all`,`inverse`]),V(t)&&R(t,function(e,r){U(e)&&(e={type:e}),t[r]=ot(e,nF(n,e.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&this.get(`selectedMode`)===`single`){for(var t=!1,n=0;n<e.length;n++){var r=e[n].get(`name`);if(this.isSelected(r)){this.select(r),t=!0;break}}!t&&this.select(e[0].get(`name`))}},t.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries(function(r){var i=r.name;n.push(i);var a;if(r.legendVisualProvider){var o=r.legendVisualProvider.getAllNames();e.isSeriesFiltered(r)||(n=n.concat(o)),o.length?t=t.concat(o):a=!0}else a=!0;a&&lc(r)&&t.push(r.name)}),this._availableNames=n;var r=this.get(`data`)||t,i=K();this._data=mt(z(r,function(e){return(U(e)||bt(e))&&(e={name:e}),i.get(e.name)?null:(i.set(e.name,!0),new lh(e,this,this.ecModel))},this),function(e){return!!e})},t.prototype.getData=function(){return this._data},t.prototype.select=function(e){var t=this.option.selected;if(this.get(`selectedMode`)===`single`){var n=this._data;R(n,function(e){t[e.get(`name`)]=!1})}t[e]=!0},t.prototype.unSelect=function(e){this.get(`selectedMode`)!==`single`&&(this.option.selected[e]=!1)},t.prototype.toggleSelected=function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?`unSelect`:`select`](e)},t.prototype.allSelect=function(){var e=this._data,t=this.option.selected;R(e,function(e){t[e.get(`name`,!0)]=!0})},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;R(e,function(e){var n=e.get(`name`,!0);t.hasOwnProperty(n)||(t[n]=!0),t[n]=!t[n]})},t.prototype.isSelected=function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&<(this._availableNames,e)>=0},t.prototype.getOrient=function(){return this.get(`orient`)===`vertical`?{index:1,name:`vertical`}:{index:0,name:`horizontal`}},t.type=`legend.plain`,t.dependencies=[`series`],t.defaultOption={z:4,show:!0,orient:`horizontal`,left:`center`,bottom:Z.size.m,align:`auto`,backgroundColor:Z.color.transparent,borderColor:Z.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:`inherit`,symbolKeepAspect:!0,inactiveColor:Z.color.disabled,inactiveBorderColor:Z.color.disabled,inactiveBorderWidth:`auto`,itemStyle:{color:`inherit`,opacity:`inherit`,borderColor:`inherit`,borderWidth:`auto`,borderCap:`inherit`,borderJoin:`inherit`,borderDashOffset:`inherit`,borderMiterLimit:`inherit`},lineStyle:{width:`auto`,color:`inherit`,inactiveColor:Z.color.disabled,inactiveWidth:2,opacity:`inherit`,type:`inherit`,cap:`inherit`,join:`inherit`,dashOffset:`inherit`,miterLimit:`inherit`},textStyle:{color:Z.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:`sans-serif`,color:Z.color.tertiary,borderWidth:1,borderColor:Z.color.border},emphasis:{selectorLabel:{show:!0,color:Z.color.quaternary}},selectorPosition:`auto`,selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(Qg);F();var iF=vt,aF=R,oF=Wo,sF=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return t.prototype.init=function(){this.group.add(this._contentGroup=new oF),this.group.add(this._selectorGroup=new oF),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get(`show`,!0)){var i=e.get(`align`),a=e.get(`orient`);(!i||i===`auto`)&&(i=e.get(`left`)===`right`&&a===`vertical`?`right`:`left`);var o=e.get(`selector`,!0),s=e.get(`selectorPosition`,!0);o&&(!s||s===`auto`)&&(s=a===`horizontal`?`end`:`start`),this.renderInner(i,e,t,n,o,a,s);var c=Gg(e,n).refContainer,l=e.getBoxLayoutParams(),u=e.get(`padding`),d=Ug(l,c,u),f=this.layoutInner(e,i,d,r,o,s),p=Ug(L({width:f.width,height:f.height},l),c,u);this.group.x=p.x-f.x,this.group.y=p.y-f.y,this.group.markRedraw(),this.group.add(this._backgroundEl=bP(f,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,r,i,a,o){var s=this.getContentGroup(),c=K(),l=t.get(`selectedMode`),u=t.get(`triggerEvent`),d=[];n.eachRawSeries(function(e){!e.get(`legendHoverLink`)&&d.push(e.id)}),aF(t.getData(),function(i,a){var o=this,f=i.get(`name`);if(!this.newlineDisabled&&(f===``||f===`
|
|
26
26
|
`)){var p=new oF;p.newline=!0,s.add(p);return}var m=n.getSeriesByName(f)[0];if(!c.get(f))if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,iF(uF,f,null,r,d)).on(`mouseover`,iF(fF,m.name,null,r,d)).on(`mouseout`,iF(pF,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=ad(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=Gi(h.fill);_&&_[3]===0&&(_[3]=.2,h=I(I({},h),{fill:na(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,iF(uF,null,f,r,d)).on(`mouseover`,iF(fF,null,f,r,d)).on(`mouseout`,iF(pF,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=ad(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this)},this),i&&this._createSelector(i,t,r,a,o)},t.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};ad(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();aF(e,function(e){var r=e.type,i=new X({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),zm(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),tf(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=cF(c,r,o,s,d,m,u),y=new oF,b=r.getModel(`textStyle`);if(H(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(lF({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;U(w)&&w?T=w.replace(`{name}`,t??``):H(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new X({style:Vm(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new Vu({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&Tm({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),tf(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();zg(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){zg(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}else return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(mb);function cF(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),aF(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var c=t.getModel(`itemStyle`),l=c.getItemStyle(),u=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,d=c.getShallow(`decal`);l.decal=!d||d===`inherit`?r.decal:gS(d,o),l.fill===`inherit`&&(l.fill=r[i]),l.stroke===`inherit`&&(l.stroke=r[u]),l.opacity===`inherit`&&(l.opacity=(i===`fill`?r:n).opacity),s(l,r);var f=t.getModel(`lineStyle`),p=f.getLineStyle();if(s(p,n),l.fill===`auto`&&(l.fill=r.fill),l.stroke===`auto`&&(l.stroke=r.fill),p.stroke===`auto`&&(p.stroke=r.fill),!a){var m=t.get(`inactiveBorderWidth`),h=l[u];l.lineWidth=m===`auto`?r.lineWidth>0&&h?2:0:l.lineWidth,l.fill=t.get(`inactiveColor`),l.stroke=t.get(`inactiveBorderColor`),p.stroke=f.get(`inactiveColor`),p.lineWidth=f.get(`inactiveWidth`)}return{itemStyle:l,lineStyle:p}}function lF(e){var t=e.icon||`roundRect`,n=Dx(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=Z.color.neutral00,n.style.lineWidth=2),n}function uF(e,t,n,r){pF(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),fF(e,t,n,r)}function dF(e){for(var t=e.getZr().storage.getDisplayList(),n,r=0,i=t.length;r<i&&!(n=t[r].states.emphasis);)r++;return n&&n.hoverLayer}function fF(e,t,n,r){dF(n)||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function pF(e,t,n,r){dF(n)||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function mF(e){var t=e.findComponents({mainType:`legend`});t&&t.length&&e.filterSeries(function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0})}function hF(e,t,n){var r=e===`allSelect`||e===`inverseSelect`,i={},a=[];n.eachComponent({mainType:`legend`,query:t},function(n){r?n[e]():n[e](t.name),gF(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){R(i,function(t,n){e[t?`select`:`unSelect`](n)}),gF(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function gF(e,t){var n=t||{};return R(e.getData(),function(t){var r=t.get(`name`);if(!(r===`
|
|
27
|
-
`||r===``)){var i=e.isSelected(r);q(n,r)?n[r]=n[r]&&i:n[r]=i}}),n}function _F(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,vt(hF,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,vt(hF,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,vt(hF,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,vt(hF,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,vt(hF,`unSelect`))}function vF(e){e.registerComponentModel(rF),e.registerComponentView(sF),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,mF),e.registerSubTypeDefaulter(`legend`,function(){return`plain`}),_F(e)}F();var yF=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,r){var i=Yg(t);e.prototype.init.call(this,t,n,r),bF(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),bF(this,this.option,t)},t.type=`legend.scroll`,t.defaultOption=mh(rF.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:`end`,pageFormatter:`{current}/{total}`,pageIcons:{horizontal:[`M0,0L12,-10L12,10z`,`M0,0L-12,-10L-12,10z`],vertical:[`M0,0L20,0L10,-20z`,`M0,0L20,0L10,20z`]},pageIconColor:Z.color.accent50,pageIconInactiveColor:Z.color.accent10,pageIconSize:15,pageTextStyle:{color:Z.color.tertiary},animationDurationUpdate:800}),t}(rF);function bF(e,t,n){var r=e.getOrient(),i=[1,1];i[r.index]=0,Jg(t,n,{type:`box`,ignoreSize:!!i})}F();var xF=Wo,SF=[`width`,`height`],CF=[`x`,`y`],wF=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new xF),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new xF)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,r,i,a,o,s){var c=this;e.prototype.renderInner.call(this,t,n,r,i,a,o,s);var l=this._controllerGroup,u=n.get(`pageIconSize`,!0),d=V(u)?u:[u,u];p(`pagePrev`,0);var f=n.getModel(`pageTextStyle`);l.add(new X({name:`pageText`,style:{text:`xx/xx`,fill:f.getTextColor(),font:f.getFont(),verticalAlign:`middle`,align:`center`},silent:!0})),p(`pageNext`,1);function p(e,t){var r=e+`DataIndex`,a=_m(n.get(`pageIcons`,!0)[n.getOrient().name][t],{onclick:B(c._pageGo,c,r,n,i)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});a.name=e,l.add(a)}},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getSelectorGroup(),s=e.getOrient().index,c=SF[s],l=CF[s],u=SF[1-s],d=CF[1-s];i&&zg(`horizontal`,o,e.get(`selectorItemGap`,!0));var f=e.get(`selectorButtonGap`,!0),p=o.getBoundingRect(),m=[-p.x,-p.y],h=at(n);i&&(h[c]=n[c]-p[c]-f);var g=this._layoutContentAndController(e,r,h,s,c,u,d,l);if(i){if(a===`end`)m[s]+=g[c]+f;else{var _=p[c]+f;m[s]-=_,g[l]-=_}g[c]+=p[c]+f,m[1-s]+=g[d]+g[u]/2-p[u]/2,g[u]=Math.max(g[u],p[u]),g[d]=Math.min(g[d],p[d]+m[1-s]),o.x=m[0],o.y=m[1],o.markRedraw()}return g},t.prototype._layoutContentAndController=function(e,t,n,r,i,a,o,s){var c=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;zg(e.get(`orient`),c,e.get(`itemGap`),r?n.width:null,r?null:n.height),zg(`horizontal`,u,e.get(`pageButtonItemGap`,!0));var d=c.getBoundingRect(),f=u.getBoundingRect(),p=this._showController=d[i]>n[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=G(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new Vu({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&zp(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;R([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,U(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=SF[i],o=CF[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=u?1:0,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i<g.i&&(g=h,f.pagePrevDataIndex??=h.i,++f.pageCount,++f.pageIndex),h=_;return f;function v(e){if(e){var t=e.getBoundingRect(),n=t[o]+e[o];return{s:n,e:n+t[a],i:e.__legendDataIndex}}}function y(e,t){return e.e>=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}(sF);function TF(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function EF(e){BE(vF),e.registerComponentModel(yF),e.registerComponentView(wF),TF(e)}function DF(e){BE(vF),BE(EF)}F();var OF=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.inside`,t.defaultOption=mh(lP.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(lP),kF=mc();function AF(e,t,n){kF(e).coordSysRecordMap.each(function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)})}function jF(e,t){for(var n=kF(e).coordSysRecordMap,r=n.keys(),i=0;i<r.length;i++){var a=r[i],o=n.get(a),s=o.dataZoomInfoMap;if(s){var c=t.uid;s.get(c)&&(s.removeKey(c),s.keys().length||MF(n,o))}}}function MF(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function NF(e,t){var n={model:t,containsPoint:vt(FF,t),dispatchAction:vt(PF,e),dataZoomInfoMap:null,controller:null},r=n.controller=new iM(e.getZr());return R([`pan`,`zoom`,`scrollMove`],function(e){r.on(e,function(t){var r=[];n.dataZoomInfoMap.each(function(i){if(t.isAvailableBehavior(i.model.option)){var a=(i.getRange||{})[e],o=a&&a(i.dzReferCoordSysInfo,n.model.mainType,n.controller,t);!i.model.get(`disabled`,!0)&&o&&r.push({dataZoomId:i.model.id,start:o[0],end:o[1]})}}),r.length&&n.dispatchAction(r)})}),n}function PF(e,t){e.isDisposed()||e.dispatchAction({type:`dataZoom`,animation:{easing:`cubicOut`,duration:100},batch:t})}function FF(e,t,n,r){return e.coordinateSystem.containPoint([n,r])}function IF(e,t,n){var r,i=`type_`,a={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0;return e.each(function(e){var t=e.model,n=t.get(`disabled`,!0)?!1:t.get(`zoomLock`,!0)?`move`:!0;a[i+n]>a[i+r]&&(r=n),o&&=t.get(`preventDefaultMouseMove`,!0)}),{controlType:r,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:n,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint}}}}function LF(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=kF(t),r=n.coordSysRecordMap||=K();r.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:`dataZoom`,subType:`inside`},function(e){R(sP(e).infoList,function(n){var i=n.model.uid,a=r.get(i)||r.set(i,NF(t,n.model));(a.dataZoomInfoMap||=K()).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),r.each(function(e){var n=e.controller,i,a=e.dataZoomInfoMap;if(a){var o=a.keys()[0];o!=null&&(i=a.get(o))}if(!i){MF(r,e);return}var s=IF(a,e,t);n.enable(s.controlType,s.opt),Ob(e,`dispatchAction`,i.model.get(`throttle`,!0),`fixRate`)})})}F();var RF=function(e){D(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`dataZoom.inside`,t}return t.prototype.render=function(t,n,r){if(e.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),AF(r,t,{pan:B(zF.pan,this),zoom:B(zF.zoom,this),scrollMove:B(zF.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){jF(this.api,this.dataZoomModel),this.range=null},t.type=`dataZoom.inside`,t}(dP),zF={zoom:function(e,t,n,r){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=VF[t](null,[r.originX,r.originY],o,n,e),c=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],l=Math.max(1/r.scale,0);a[0]=(a[0]-c)*l+c,a[1]=(a[1]-c)*l+c;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(mM(0,a,[0,100],0,u.minSpan,u.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:BF(function(e,t,n,r,i,a){var o=VF[r]([a.oldX,a.oldY],[a.newX,a.newY],t,i,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:BF(function(e,t,n,r,i,a){return VF[r]([0,0],[a.scrollDelta,a.scrollDelta],t,i,n).signal*(e[1]-e[0])*a.scrollDelta})};function BF(e){return function(t,n,r,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s&&(mM(e(o,s,t,n,r,i),o,[0,100],`all`),this.range=o,a[0]!==o[0]||a[1]!==o[1]))return o}}var VF={grid:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem.getRect();return e||=[0,0],a.dim===`x`?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem,c=s.getRadiusAxis().getExtent(),l=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),n.mainType===`radiusAxis`?(o.pixel=t[0]-e[0],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,r,i){var a=n.axis,o=i.model.coordinateSystem.getRect(),s={};return e||=[0,0],a.orient===`horizontal`?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function HF(e){yP(e),e.registerComponentModel(OF),e.registerComponentView(RF),LF(e)}F();var UF=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.slider`,t.layoutMode=`box`,t.defaultOption=mh(lP.defaultOption,{show:!0,right:`ph`,top:`ph`,width:`ph`,height:`ph`,left:null,bottom:null,borderColor:Z.color.accent10,borderRadius:0,backgroundColor:Z.color.transparent,dataBackground:{lineStyle:{color:Z.color.accent30,width:.5},areaStyle:{color:Z.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:Z.color.accent40,width:.5},areaStyle:{color:Z.color.accent20,opacity:.3}},fillerColor:`rgba(135,175,274,0.2)`,handleIcon:`path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z`,handleSize:`100%`,handleStyle:{color:Z.color.neutral00,borderColor:Z.color.accent20},moveHandleSize:7,moveHandleIcon:`path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z`,moveHandleStyle:{color:Z.color.accent40,opacity:.5},showDetail:!0,showDataShadow:`auto`,realtime:!0,zoomLock:!1,textStyle:{color:Z.color.tertiary},brushSelect:!0,brushStyle:{color:Z.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:Z.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(lP);F();var WF=Vu,GF=1,KF=30,qF=7,JF=`horizontal`,YF=`vertical`,XF=5,ZF=[`line`,`bar`,`candlestick`,`scatter`],QF={easing:`cubicOut`,duration:100,delay:0},$F=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return t.prototype.init=function(e,t){this.api=t,this._onBrush=B(this._onBrush,this),this._onBrushEnd=B(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),Ob(this,`_dispatchZoomAction`,t.get(`throttle`),`fixRate`),this._orient=t.getOrient(),t.get(`show`)===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!i||i.type!==`dataZoom`||i.from!==this.uid)&&this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){kb(this,`_dispatchZoomAction`);var e=this.api.getZr();e.off(`mousemove`,this._onBrush),e.off(`mouseup`,this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Wo;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get(`brushSelect`)?qF:0,r=Gg(e,t).refContainer,i=this._findCoordRect(),a=e.get(`defaultLocationEdgeGap`,!0)||0,o=this._orient===JF?{right:r.width-i.x-i.width,top:r.height-KF-a-n,width:i.width,height:KF}:{right:a,top:i.y,width:KF,height:i.height},s=Yg(e.option);R([`right`,`top`,`width`,`height`],function(e){s[e]===`ph`&&(s[e]=o[e])});var c=Ug(s,r);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===YF&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get(`inverse`),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n===JF&&!i?{scaleY:o?1:-1,scaleX:1}:n===JF&&i?{scaleY:o?1:-1,scaleX:-1}:n===YF&&!i?{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2});var s=e.getBoundingRect([a]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get(`brushSelect`);n.add(new WF({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get(`backgroundColor`)},z2:-40}));var i=new WF({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:`transparent`},z2:0,onclick:B(this._onClickPanel,this)}),a=this.api.getZr();r?(i.on(`mousedown`,this._onBrushStart,this),i.cursor=`crosshair`,a.on(`mousemove`,this._onBrush),a.on(`mouseup`,this._onBrushEnd)):(a.off(`mousemove`,this._onBrush),a.off(`mouseup`,this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!e)return;var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),a=r.getShadowDim&&r.getShadowDim(),o=a&&i.getDimensionInfo(a)?r.getShadowDim():e.otherDim;if(o==null)return;var s=this._shadowPolygonPts,c=this._shadowPolylinePts;if(i!==this._shadowData||o!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var l=i.getDataExtent(e.thisDim),u=i.getDataExtent(o),d=(u[1]-u[0])*.3;u=[u[0]-d,u[1]+d];var f=[0,t[1]],p=[0,t[0]],m=[[t[0],0],[0,0]],h=[],g=p[1]/Math.max(1,i.count()-1),_=t[0]/(l[1]-l[0]),v=e.thisAxis.type===`time`,y=-g,b=Math.round(i.count()/t[0]),x;i.each([e.thisDim,o],function(e,t,n){if(b>0&&n%b){v||(y+=g);return}y=v?(+e-l[0])*_:y+g;var r=t==null||isNaN(t)||t===``,i=r?0:fs(t,u,f,!0);r&&!x&&n?(m.push([m[m.length-1][0],0]),h.push([h[h.length-1][0],0])):!r&&x&&(m.push([y,0]),h.push([y,0])),r||(m.push([y,i]),h.push([y,i])),x=r}),s=this._shadowPolygonPts=m,c=this._shadowPolylinePts=h}this._shadowData=i,this._shadowDim=o,this._shadowSize=[t[0],t[1]];var S=this.dataZoomModel;function C(e){var t=S.getModel(e?`selectedDataBackground`:`dataBackground`),n=new Wo,r=new lp({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel(`areaStyle`).getAreaStyle(),silent:!0,z2:-20}),i=new dp({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel(`lineStyle`).getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}for(var w=0;w<3;w++){var T=C(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get(`showDataShadow`);if(t!==!1){var n,r=this.ecModel;return e.eachTargetAxis(function(i,a){R(e.getAxisProxy(i,a).getTargetSeriesModels(),function(e){if(!n&&!(t!==!0&<(ZF,e.get(`type`))<0)){var o=r.getComponent(aP(i),a).axis,s=eI(i),c,l=e.coordinateSystem;s!=null&&l.getOtherAxis&&(c=l.getOtherAxis(o).inverse),s=e.getData().mapDimension(s),n={thisAxis:o,series:e,thisDim:e.getData().mapDimension(i),otherDim:s,otherAxisInverse:c}}},this)},this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,c=o.get(`borderRadius`)||0,l=o.get(`brushSelect`),u=t.filler=new WF({silent:l,style:{fill:o.get(`fillerColor`)},textConfig:{position:`inside`}});i.add(u),i.add(new WF({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:c},style:{stroke:o.get(`dataBackgroundColor`)||o.get(`borderColor`),lineWidth:GF,fill:Z.color.transparent}})),R([0,1],function(t){var a=o.get(`handleIcon`);!Cx[a]&&a.indexOf(`path://`)<0&&a.indexOf(`image://`)<0&&(a=`path://`+a);var s=Dx(a,-1,0,2,2,null,!0);s.attr({cursor:tI(this._orient),draggable:!0,drift:B(this._onDragMove,this,t),ondragend:B(this._onDragEnd,this),onmouseover:B(this._showDataInfo,this,!0),onmouseout:B(this._showDataInfo,this,!1),z2:5});var c=s.getBoundingRect();this._handleHeight=ps(o.get(`handleSize`),this._size[1]),this._handleWidth=c.width/c.height*this._handleHeight,s.setStyle(o.getModel(`handleStyle`).getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState(`emphasis`).style=o.getModel([`emphasis`,`handleStyle`]).getItemStyle(),tf(s);var l=o.get(`handleColor`);l!=null&&(s.style.fill=l),i.add(n[t]=s);var u=o.getModel(`textStyle`),d=(o.get(`handleLabel`)||{}).show||!1;e.add(r[t]=new X({silent:!0,invisible:!d,style:Vm(u,{x:0,y:0,text:``,verticalAlign:`middle`,align:`center`,fill:u.getTextColor(),font:u.getFont()}),z2:10}))},this);var d=u;if(l){var f=ps(o.get(`moveHandleSize`),a[1]),p=t.moveHandle=new Vu({style:o.getModel(`moveHandleStyle`).getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:f}}),m=f*.8,h=t.moveHandleIcon=Dx(o.get(`moveHandleIcon`),-m/2,-m/2,m,m,Z.color.neutral00,!0);h.silent=!0,h.y=a[1]+f/2-.5,p.ensureState(`emphasis`).style=o.getModel([`emphasis`,`moveHandleStyle`]).getItemStyle();var g=Math.min(a[1]/2,Math.max(f,10));d=t.moveZone=new Vu({invisible:!0,shape:{y:a[1]-g,height:f+g}}),d.on(`mouseover`,function(){s.enterEmphasis(p)}).on(`mouseout`,function(){s.leaveEmphasis(p)}),i.add(p),i.add(h),i.add(d)}d.attr({draggable:!0,cursor:`default`,drift:B(this._onDragMove,this,`all`),ondragstart:B(this._showDataInfo,this,!0),ondragend:B(this._onDragEnd,this),onmouseover:B(this._showDataInfo,this,!0),onmouseout:B(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[fs(e[0],[0,100],t,!0),fs(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];mM(t,r,i,n.get(`zoomLock`)?`all`:e,a.minSpan==null?null:fs(a.minSpan,o,i,!0),a.maxSpan==null?null:fs(a.maxSpan,o,i,!0));var s=this._range,c=this._range=_s([fs(r[0],i,o,!0),fs(r[1],i,o,!0)]);return!s||s[0]!==c[0]||s[1]!==c[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=_s(n.slice()),i=this._size;R([0,1],function(e){var r=t.handles[e],a=this._handleHeight;r.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:i[1]/2-a/2})},this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var a={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr(`x`,a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],c=0;c<o.length;c++){var l=o[c],u=l.getClipPath();u||(u=new Vu,l.setClipPath(u)),u.setShape({x:s[c],y:0,width:s[c+1]-s[c],height:i[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=this._orient,a=[``,``];if(t.get(`showDetail`)){var o=t.findRepresentativeAxisProxy();if(o){var s=o.getAxisModel().axis,c=this._range,l=e?o.calculateDataWindow({start:c[0],end:c[1]}).valueWindow:o.getDataValueWindow();a=[this._formatLabel(l[0],s),this._formatLabel(l[1],s)]}}var u=_s(this._handleEnds.slice());d.call(this,0),d.call(this,1);function d(e){var t=lm(n.handles[e].parent,this.group),o=dm(e===0?`right`:`left`,t),s=this._handleWidth/2+XF,c=um([u[e]+(e===0?-s:s),this._size[1]/2],t);r[e].setStyle({x:c[0],y:c[1],verticalAlign:i===JF?`middle`:o,align:i===JF?o:`center`,text:a[e]})}},t.prototype._formatLabel=function(e,t){var n=this.dataZoomModel,r=n.get(`labelFormatter`),i=n.get(`labelPrecision`);(i==null||i===`auto`)&&(i=t.getPixelPrecision());var a=e==null||isNaN(e)?``:t.type===`category`||t.type===`time`?t.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(i,20));return H(r)?r(e,a):U(r)?r.replace(`{value}`,a):a},t.prototype._showDataInfo=function(e){var t=(this.dataZoomModel.get(`handleLabel`)||{}).show||!1,n=this.dataZoomModel.getModel([`emphasis`,`handleLabel`]).get(`show`)||!1,r=e||this._dragging?n:t,i=this._displayables,a=i.handleLabels;a[0].attr(`invisible`,!r),a[1].attr(`invisible`,!r),i.moveHandle&&this.api[r?`enterEmphasis`:`leaveEmphasis`](i.moveHandle,1)},t.prototype._onDragMove=function(e,t,n,r){this._dragging=!0,qn(r.event);var i=this._displayables.sliderGroup.getLocalTransform(),a=um([t,n],i,!0),o=this._updateInterval(e,a[0]),s=this.dataZoomModel.get(`realtime`);this._updateView(!s),o&&s&&this._dispatchZoomAction(!0)},t.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get(`realtime`)&&this._dispatchZoomAction(!1)},t.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0||n[0]>t[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,a=this._updateInterval(`all`,n[0]-i);this._updateView(),a&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new lr(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr(`ignore`,!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100],a=this._handleEnds=[n.x,n.x+n.width],o=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();mM(0,a,r,0,o.minSpan==null?null:fs(o.minSpan,i,r,!0),o.maxSpan==null?null:fs(o.maxSpan,i,r,!0)),this._range=_s([fs(a[0],r,i,!0),fs(a[1],r,i,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(qn(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new WF({silent:!0,style:r.getModel(`brushStyle`).getItemStyle()}),n.sliderGroup.add(i)),i.attr(`ignore`,!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),c=o.transformCoordToLocal(a.x,a.y),l=this._size;s[0]=Math.max(Math.min(l[0],s[0]),0),i.setShape({x:c[0],y:0,width:s[0]-c[0],height:l[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:`dataZoom`,from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?QF:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=sP(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:r*.2,y:i*.2,width:r*.6,height:i*.6}}return e},t.type=`dataZoom.slider`,t}(dP);function eI(e){return{x:`y`,y:`x`,radius:`angle`,angle:`radius`}[e]}function tI(e){return e===`vertical`?`ns-resize`:`ew-resize`}function nI(e){e.registerComponentModel(UF),e.registerComponentView($F),yP(e)}function rI(e){BE(HF),BE(nI)}F();function iI(e,t,n){var r=He.createCanvas(),i=t.getWidth(),a=t.getHeight(),o=r.style;return o&&(o.position=`absolute`,o.left=`0`,o.top=`0`,o.width=i+`px`,o.height=a+`px`,r.setAttribute(`data-zr-dom-id`,e)),r.width=i*n,r.height=a*n,r}var aI=function(e){D(t,e);function t(t,n,r){var i=e.call(this)||this;i.motionBlur=!1,i.lastFrameAlpha=.7,i.dpr=1,i.virtual=!1,i.config={},i.incremental=!1,i.zlevel=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__used=!1,i.__drawIndex=0,i.__startIndex=0,i.__endIndex=0,i.__prevStartIndex=null,i.__prevEndIndex=null;var a;r||=eo,typeof t==`string`?a=iI(t,n,r):W(t)&&(a=t,t=a.id),i.id=t,i.dom=a;var o=a.style;return o&&(Ut(a),a.onselectstart=function(){return!1},o.padding=`0`,o.margin=`0`,o.borderWidth=`0`),i.painter=n,i.dpr=r,i}return t.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},t.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},t.prototype.initContext=function(){this.ctx=this.dom.getContext(`2d`),this.ctx.dpr=this.dpr},t.prototype.setUnpainted=function(){this.__firstTimePaint=!0},t.prototype.createBackBuffer=function(){var e=this.dpr;this.domBack=iI(`back-`+this.id,this.painter,e),this.ctxBack=this.domBack.getContext(`2d`),e!==1&&this.ctxBack.scale(e,e)},t.prototype.createRepaintRects=function(e,t,n,r){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var i=[],a=this.maxRepaintRectCount,o=!1,s=new J(0,0,0,0);function c(e){if(!(!e.isFinite()||e.isZero()))if(i.length===0){var t=new J(0,0,0,0);t.copy(e),i.push(t)}else{for(var n=!1,r=1/0,c=0,l=0;l<i.length;++l){var u=i[l];if(u.intersect(e)){var d=new J(0,0,0,0);d.copy(u),d.union(e),i[l]=d,n=!0;break}else if(o){s.copy(e),s.union(u);var f=e.width*e.height,p=u.width*u.height,m=s.width*s.height-f-p;m<r&&(r=m,c=l)}}if(o&&(i[c].union(e),n=!0),!n){var t=new J(0,0,0,0);t.copy(e),i.push(t)}o||=i.length>=a}}for(var l=this.__startIndex;l<this.__endIndex;++l){var u=e[l];if(u){var d=u.shouldBePainted(n,r,!0,!0),f=u.__isRendered&&(u.__dirty&1||!d)?u.getPrevPaintRect():null;f&&c(f);var p=d&&(u.__dirty&1||!u.__isRendered)?u.getPaintRect():null;p&&c(p)}}for(var l=this.__prevStartIndex;l<this.__prevEndIndex;++l){var u=t[l],d=u&&u.shouldBePainted(n,r,!0,!0);if(u&&(!d||!u.__zr)&&u.__isRendered){var f=u.getPrevPaintRect();f&&c(f)}}var m;do{m=!1;for(var l=0;l<i.length;){if(i[l].isZero()){i.splice(l,1);continue}for(var h=l+1;h<i.length;)i[l].intersect(i[h])?(m=!0,i[l].union(i[h]),i.splice(h,1)):h++;l++}}while(m);return this._paintRects=i,i},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(e,t){var n=this.dpr,r=this.dom,i=r.style,a=this.domBack;i&&(i.width=e+`px`,i.height=t+`px`),r.width=e*n,r.height=t*n,a&&(a.width=e*n,a.height=t*n,n!==1&&this.ctxBack.scale(n,n))},t.prototype.clear=function(e,t,n){var r=this.dom,i=this.ctx,a=r.width,o=r.height;t||=this.clearColor;var s=this.motionBlur&&!e,c=this.lastFrameAlpha,l=this.dpr,u=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation=`copy`,this.ctxBack.drawImage(r,0,0,a/l,o/l));var d=this.domBack;function f(e,n,r,a){if(i.clearRect(e,n,r,a),t&&t!==`transparent`){var o=void 0;wt(t)?(o=(t.global||t.__width===r&&t.__height===a)&&t.__canvasGradient||Nx(i,t,{x:0,y:0,width:r,height:a}),t.__canvasGradient=o,t.__width=r,t.__height=a):Tt(t)&&(t.scaleX=t.scaleX||l,t.scaleY=t.scaleY||l,o=Gx(i,t,{dirty:function(){u.setUnpainted(),u.painter.refresh()}})),i.save(),i.fillStyle=o||t,i.fillRect(e,n,r,a),i.restore()}s&&(i.save(),i.globalAlpha=c,i.drawImage(d,e,n,r,a),i.restore())}!n||s?f(0,0,a,o):n.length&&R(n,function(e){f(e.x*l,e.y*l,e.width*l,e.height*l)})},t}(Sn),oI=1e5,sI=314159,cI=.01,lI=.001;function uI(e){return e?e.__builtin__?!0:!(typeof e.resize!=`function`||typeof e.refresh!=`function`):!1}function dI(e,t){var n=document.createElement(`div`);return n.style.cssText=[`position:relative`,`width:`+e+`px`,`height:`+t+`px`,`padding:0`,`margin:0`,`border-width:0`].join(`;`)+`;`,n}var fI=function(){function e(e,t,n,r){this.type=`canvas`,this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type=`canvas`;var i=!e.nodeName||e.nodeName.toUpperCase()===`CANVAS`;this._opts=n=I({},n||{}),this.dpr=n.devicePixelRatio||eo,this._singleCanvas=i,this.root=e,e.style&&(Ut(e),e.innerHTML=``),this.storage=t;var a=this._zlevelList;this._prevDisplayList=[];var o=this._layers;if(i){var s=e,c=s.width,l=s.height;n.width!=null&&(c=n.width),n.height!=null&&(l=n.height),this.dpr=n.devicePixelRatio||1,s.width=c*this.dpr,s.height=l*this.dpr,this._width=c,this._height=l;var u=new aI(s,this,this.dpr);u.__builtin__=!0,u.initContext(),o[sI]=u,u.zlevel=sI,a.push(sI),this._domRoot=e}else{this._width=Ix(e,0,n),this._height=Ix(e,1,n);var d=this._domRoot=dI(this._width,this._height);e.appendChild(d)}}return e.prototype.getType=function(){return`canvas`},e.prototype.isSingleCanvas=function(){return this._singleCanvas},e.prototype.getViewportRoot=function(){return this._domRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(e){var t=this.storage.getDisplayList(!0),n=this._prevDisplayList,r=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,n,e,this._redrawId);for(var i=0;i<r.length;i++){var a=r[i],o=this._layers[a];if(!o.__builtin__&&o.refresh){var s=i===0?this._backgroundColor:null;o.refresh(s)}}return this._opts.useDirtyRect&&(this._prevDisplayList=t.slice()),this},e.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},e.prototype._paintHoverList=function(e){var t=e.length,n=this._hoverlayer;if(n&&n.clear(),t){for(var r={inHover:!0,viewWidth:this._width,viewHeight:this._height},i,a=0;a<t;a++){var o=e[a];o.__inHover&&(n||=this._hoverlayer=this.getLayer(oI),i||(i=n.ctx,i.save()),dS(i,o,r,a===t-1))}i&&i.restore()}},e.prototype.getHoverLayer=function(){return this.getLayer(oI)},e.prototype.paintOne=function(e,t){uS(e,t)},e.prototype._paintList=function(e,t,n,r){if(this._redrawId===r){n||=!1,this._updateLayerStatus(e);var i=this._doPaintList(e,t,n),a=i.finished,o=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),o&&this._paintHoverList(e),a)this.eachLayer(function(e){e.afterBrush&&e.afterBrush()});else{var s=this;Qr(function(){s._paintList(e,t,n,r)})}}},e.prototype._compositeManually=function(){var e=this.getLayer(sI).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),this.eachBuiltinLayer(function(r){r.virtual&&e.drawImage(r.dom,0,0,t,n)})},e.prototype._doPaintList=function(e,t,n){for(var r=this,i=[],a=this._opts.useDirtyRect,o=0;o<this._zlevelList.length;o++){var s=this._zlevelList[o],c=this._layers[s];c.__builtin__&&c!==this._hoverlayer&&(c.__dirty||n)&&i.push(c)}for(var l=!0,u=!1,d=function(o){var s=i[o],c=s.ctx,d=a&&s.createRepaintRects(e,t,f._width,f._height),p=n?s.__startIndex:s.__drawIndex,m=!n&&s.incremental&&Date.now,h=m&&Date.now(),g=s.zlevel===f._zlevelList[0]?f._backgroundColor:null;if(s.__startIndex===s.__endIndex)s.clear(!1,g,d);else if(p===s.__startIndex){var _=e[p];(!_.incremental||!_.notClear||n)&&s.clear(!1,g,d)}p===-1&&(console.error(`For some unknown reason. drawIndex is -1`),p=s.__startIndex);var v,y=function(t){var n={inHover:!1,allClipped:!1,prevEl:null,viewWidth:r._width,viewHeight:r._height};for(v=p;v<s.__endIndex;v++){var i=e[v];if(i.__inHover&&(u=!0),r._doPaintEl(i,s,a,t,n,v===s.__endIndex-1),m&&Date.now()-h>15)break}n.prevElClipPaths&&c.restore()};if(d)if(d.length===0)v=s.__endIndex;else for(var b=f.dpr,x=0;x<d.length;++x){var S=d[x];c.save(),c.beginPath(),c.rect(S.x*b,S.y*b,S.width*b,S.height*b),c.clip(),y(S),c.restore()}else c.save(),y(),c.restore();s.__drawIndex=v,s.__drawIndex<s.__endIndex&&(l=!1)},f=this,p=0;p<i.length;p++)d(p);return Pe.wxa&&R(this._layers,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),{finished:l,needsRefreshHover:u}},e.prototype._doPaintEl=function(e,t,n,r,i,a){var o=t.ctx;if(n){var s=e.getPaintRect();(!r||s&&s.intersect(r))&&(dS(o,e,i,a),e.setPrevPaintRect(s))}else dS(o,e,i,a)},e.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=sI);var n=this._layers[e];return n||(n=new aI(`zr_`+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?ot(n,this._layerConfig[e],!0):this._layerConfig[e-cI]&&ot(n,this._layerConfig[e-cI],!0),t&&(n.virtual=t),this.insertLayer(e,n),n.initContext()),n},e.prototype.insertLayer=function(e,t){var n=this._layers,r=this._zlevelList,i=r.length,a=this._domRoot,o=null,s=-1;if(!n[e]&&uI(t)){if(i>0&&e>r[0]){for(s=0;s<i-1&&!(r[s]<e&&r[s+1]>e);s++);o=n[r[s]]}if(r.splice(s+1,0,e),n[e]=t,!t.virtual)if(o){var c=o.dom;c.nextSibling?a.insertBefore(t.dom,c.nextSibling):a.appendChild(t.dom)}else a.firstChild?a.insertBefore(t.dom,a.firstChild):a.appendChild(t.dom);t.painter||=this}},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r];e.call(t,this._layers[i],i)}},e.prototype.eachBuiltinLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],a=this._layers[i];a.__builtin__&&e.call(t,a,i)}},e.prototype.eachOtherLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],a=this._layers[i];a.__builtin__||e.call(t,a,i)}},e.prototype.getLayers=function(){return this._layers},e.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(e,t){e.__dirty=e.__used=!1});function t(e){i&&(i.__endIndex!==e&&(i.__dirty=!0),i.__endIndex=e)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var r=e[n];if(r.zlevel!==e[n-1].zlevel||r.incremental){this._needsManuallyCompositing=!0;break}}var i=null,a=0,o,s;for(s=0;s<e.length;s++){var r=e[s],c=r.zlevel,l=void 0;o!==c&&(o=c,a=0),r.incremental?(l=this.getLayer(c+lI,this._needsManuallyCompositing),l.incremental=!0,a=1):l=this.getLayer(c+(a>0?cI:0),this._needsManuallyCompositing),l.__builtin__||it(`ZLevel `+c+` has been used by unkown layer `+l.id),l!==i&&(l.__used=!0,l.__startIndex!==s&&(l.__dirty=!0),l.__startIndex=s,l.incremental?l.__drawIndex=-1:l.__drawIndex=s,t(s),i=l),r.__dirty&1&&!r.__inHover&&(l.__dirty=!0,l.incremental&&l.__drawIndex<0&&(l.__drawIndex=s))}t(s),this.eachBuiltinLayer(function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)})},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,R(this._layers,function(e){e.setUnpainted()})},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?ot(n[e],t,!0):n[e]=t;for(var r=0;r<this._zlevelList.length;r++){var i=this._zlevelList[r];if(i===e||i===e+cI){var a=this._layers[i];ot(a,n[e],!0)}}}},e.prototype.delLayer=function(e){var t=this._layers,n=this._zlevelList,r=t[e];r&&(r.dom.parentNode.removeChild(r.dom),delete t[e],n.splice(lt(n,e),1))},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display=`none`;var r=this._opts,i=this.root;if(e!=null&&(r.width=e),t!=null&&(r.height=t),e=Ix(i,0,r),t=Ix(i,1,r),n.style.display=``,this._width!==e||t!==this._height){for(var a in n.style.width=e+`px`,n.style.height=t+`px`,this._layers)this._layers.hasOwnProperty(a)&&this._layers[a].resize(e,t);this.refresh(!0)}this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this.getLayer(sI).resize(e,t)}return this},e.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},e.prototype.dispose=function(){this.root.innerHTML=``,this.root=this.storage=this._domRoot=this._layers=null},e.prototype.getRenderedCanvas=function(e){if(e||={},this._singleCanvas&&!this._compositeManually)return this._layers[sI].dom;var t=new aI(`image`,this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var r=t.dom.width,i=t.dom.height;this.eachLayer(function(e){e.__builtin__?n.drawImage(e.dom,0,0,r,i):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())})}else for(var a={inHover:!1,viewWidth:this._width,viewHeight:this._height},o=this.storage.getDisplayList(!0),s=0,c=o.length;s<c;s++){var l=o[s];dS(n,l,a,s===c-1)}return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}();function pI(e){e.registerPainter(`canvas`,fI)}function mI(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}var hI=[`#6366f1`,`#f59e0b`,`#10b981`,`#ef4444`,`#8b5cf6`,`#ec4899`,`#06b6d4`,`#f97316`,`#14b8a6`,`#a855f7`,`#84cc16`,`#e879f9`,`#22d3ee`,`#fb923c`,`#34d399`,`#c084fc`,`#fbbf24`,`#2dd4bf`,`#f472b6`,`#a3e635`],gI={"gpt-5.4":`#f472b6`,"gpt-5.3-codex":`#f59e0b`,"gpt-5.3-codex-spark":`#fbbf24`,"gpt-5.2-codex":`#6366f1`,"gpt-5.2":`#818cf8`,"gpt-5.1-codex-mini":`#a78bfa`,"gpt-4.1":`#06b6d4`,"gpt-4.1-mini":`#14b8a6`,"gpt-4.1-nano":`#2dd4bf`,o3:`#a855f7`,"o3-mini":`#c084fc`,"o4-mini":`#e879f9`,"gpt-4o":`#ec4899`,"gpt-4o-mini":`#22d3ee`,"gpt-4-turbo":`#ef4444`,"gpt-4":`#f97316`,"gpt-3.5-turbo":`#84cc16`,unknown:`#475569`},_I={review:`#06b6d4`,exploration:`#f97316`,planning:`#eab308`,memory:`#ec4899`,generic:`#64748b`},vI={low:`#10b981`,medium:`#06b6d4`,high:`#f59e0b`,xhigh:`#a855f7`,"x-high":`#a855f7`,unknown:`#64748b`};function yI(e){if(!e)return`unknown`;let t=String(e).toLowerCase().trim().replace(/-/g,``);return t===`low`?`low`:t===`medium`?`medium`:t===`high`?`high`:t===`xhigh`?`xhigh`:t===`unknown`?`unknown`:t}function bI(e){return hI[mI(e)%hI.length]}function xI(e){let t=e.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!t)return`#ffffff`;let n=parseInt(t[1],16)/255,r=parseInt(t[2],16)/255,i=parseInt(t[3],16)/255;return .2126*n+.7152*r+.0722*i>.5?`#1f2937`:`#ffffff`}function SI(e,t,n){t/=100,n/=100;let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,o=0,s=0,c=0;e<60?(o=r,s=i):e<120?(o=i,s=r):e<180?(s=r,c=i):e<240?(s=i,c=r):e<300?(o=i,c=r):(o=r,c=i);let l=e=>Math.round((e+a)*255).toString(16).padStart(2,`0`);return`#`+l(o)+l(s)+l(c)}function CI(e){return gI[e]?gI[e]:SI(mI(e)%300,72,62)}function wI(e){return _I[e]||`#64748b`}function TI(e){return vI[yI(e)]??`#64748b`}function EI(e){if(e==null||!Number.isFinite(e))return`—`;let t=Math.abs(e);return t>=1e9?DI(e,1e9,`B`):t>=1e6?DI(e,1e6,`M`):t>=1e3?DI(e,1e3,`K`):Math.round(e).toLocaleString()}function DI(e,t,n){let r=e/t,i=Math.abs(r)>=100?0:1;return`${r.toFixed(i)}${n}`}var OI=`auto`,kI={speed:1,live:{frameIntervalMs:33,overviewHz:20,dayKeysPerEmit:1},main:{presentationDurationMs:220,chartAppearDurationMs:0,chartUpdateDurationMs:200,easing:`linear`,easingUpdate:`linear`},tail:{enabled:!0,startPercent:.5,durationMs:OI,durationScale:10,easing:`cubicOut`,overviewHz:10},daily:{chartAppearDurationMs:OI,chartUpdateDurationMs:60,easing:OI,easingUpdate:OI},bars:{chartAppearDurationMs:OI,chartUpdateDurationMs:20,easing:OI,easingUpdate:OI},donuts:{chartAppearDurationMs:OI,chartUpdateDurationMs:OI,easing:OI,easingUpdate:`linear`,seriesAnimation:!1},heatmap:{popDurationMs:380,settleThreshold:.998,intensityRiseThreshold:.08,whiteThreshold:.88,nearMaxRatio:.985},videoExport:{width:1080,height:864,fps:60,frontloadSettledFrameCount:1,introFadeEnabled:!0,introFadeStartOpacity:.95,introContentStartOpacity:.05,introFadeDurationMs:400,introFadeDelayMs:0,introFadeEasing:`cubicOut`,startHoldDurationMs:100,replayDurationMs:1e4,tailDurationMs:5e3,replayEasing:`cubicIn`,tailSourceFraction:.55,tailEasing:`cubicOut`,finalHoldDurationMs:5e3,finalFlashDurationMs:1e3,finalFlashMaxOpacity:.35,displayTweenStartMs:200,displayTweenBaseMs:240,displayTweenLateMs:420,displayTweenLateWindowMs:2200,barsChartUpdateDurationMs:50,barsChartTailUpdateDurationMs:240,donutsChartUpdateDurationMs:50,donutsChartTailUpdateDurationMs:240,supersampleScale:2,captureFormat:`png`,jpegQuality:92,crf:5,encoderPreset:`veryfast`}},AI={animationDuration:750,animationDurationUpdate:220,animationEasing:`cubicOut`,animationEasingUpdate:`cubicOut`},jI={show:!0,animationDuration:250,animationDurationUpdate:220,animationDelay:250,animationDelayUpdate:180,animationEasing:`cubicOut`,animationEasingUpdate:`cubicOut`},MI={...AI,animationDurationUpdate:200,animationDelayUpdate:0,animationEasingUpdate:`cubicOut`},NI={animationDuration:700,animationDurationUpdate:220,animationDelay:250,animationDelayUpdate:140,animationEasing:`cubicOut`,animationEasingUpdate:`cubicOut`},PI={...jI,animationDelay:950,animationDelayUpdate:360};function FI(e){return Number.isFinite(e)&&e>0?e:1}function II(e){return Math.max(0,Math.round(e/FI(kI.speed)))}function LI(e,t){return e===`auto`?II(t):e}function RI(e,t){return e===`auto`?t:e}function zI(e){return{animation:!0,animationDuration:LI(e.chartAppearDurationMs,kI.main.chartAppearDurationMs),animationDurationUpdate:LI(e.chartUpdateDurationMs,kI.main.chartUpdateDurationMs),animationEasing:RI(e.easing,kI.main.easing),animationEasingUpdate:RI(e.easingUpdate,kI.main.easingUpdate)}}var BI=II(kI.main.presentationDurationMs);function VI(e=0,t=!1){let n=BI,r=kI.tail;if(!t||!r?.enabled)return n;let i=Math.min(Math.max(r.startPercent??.9,0),.999),a=Math.min(Math.max(e||0,0),1);if(a<=i)return n;let o=(a-i)/Math.max(1-i,.001),s=r.durationMs===`auto`?Math.round(n*Math.max(r.durationScale||1,1)):r.durationMs;return Math.round(n+(s-n)*JI(o))}function HI(e=0,t=!1){let n=kI.tail;if(!t||!n?.enabled)return`linear`;let r=Math.min(Math.max(n.startPercent??.9,0),.999);return Math.min(Math.max(e||0,0),1)<=r?`linear`:n.easing||`cubicOut`}function UI(e=0,t=!1){let n=kI.tail;if(!t||!n?.enabled)return!1;let r=Math.min(Math.max(n.startPercent??.9,0),.999);return Math.min(Math.max(e||0,0),1)>r}zI({chartAppearDurationMs:OI,chartUpdateDurationMs:OI,easing:OI,easingUpdate:OI});var WI=zI(kI.daily),GI=zI(kI.bars),KI=zI(kI.donuts),qI=kI.donuts.seriesAnimation;function JI(e){return 1-(1-Math.min(Math.max(e,0),1))**3}function YI(e,t,n){return e+(t-e)*n}function XI(e){return Number.isFinite(e)?e:0}function ZI(e,t){return Array.isArray(e?.data)?e.data:Array.isArray(e)?e:e?.data?.[t]||e?.data?.total||[]}function QI(e,t){return t?.length?e===`d7`?t.slice(-7):e===`d30`?t.slice(-30):t:[]}function $I(e,t,n){return e.map(e=>({key:e?.[t]||``,label:e?.[n]||``,tokens:XI(e?.tokens)})).filter(e=>e.key)}function eL(e,t){let n=Array.isArray(e?.data)?e.data:Array.isArray(e)?e:[];if(!n.length)return{dates:[],series:[]};let r=QI(t,n.map(e=>e.date)),i=new Map(n.map(e=>[e.date,e])),a=new Set;for(let e of r){let t=i.get(e);for(let e of Object.keys(t?.by_model||{}))a.add(e)}return{dates:r,series:[...a].map(e=>({key:e,label:e,data:r.map(t=>XI(i.get(t)?.by_model?.[e]?.tokens))}))}}function tL(e){let t=e?.data&&typeof e.data==`object`?e.data:{},n={};for(let[e,r]of Object.entries(t))n[e]={tokens:XI(r?.tokens),elapsed:XI(r?.elapsed),cost:XI(r?.cost)};return n}function nL({overview:e,heatmap:t,daily:n,families:r,repos:i,models:a,range:o}){let s=e?.data;if(!s)return{ready:!0,stats:{tokens:0,elapsed:0,cost:0,sessions:0,enriched:0,priced:0,exactPriced:0,fallbackPriced:0,unpriced:0,days:1},topRepos:[],topFamilies:[],topModels:[],daily:{dates:[],series:[]},heatmap:{}};let c=s?.[o]||s?.total||{},l=c.coverage||{},u=XI(l.thread_rows??l.total),d=XI(l.root_sessions??c.total_sessions),f=XI(l.priced),p=XI(l.priced_exact),m=XI(l.priced_fallback),h=XI(l.unpriced??Math.max(u-f,0)),g=c.date_range,_=g?.from!=null&&g?.to!=null?Math.max(1,Math.ceil((g.to-g.from)/86400)):1;return{ready:!0,stats:{tokens:XI(c.total_tokens),elapsed:XI(c.total_elapsed_seconds),cost:XI(c.total_cost),sessions:d,enriched:XI(l.enriched),priced:f,exactPriced:p,fallbackPriced:m,unpriced:h,days:_},topRepos:$I(ZI(i,o).slice(0,6),`repo_label`,`repo_label`),topFamilies:$I(ZI(r,o),`family`,`family`),topModels:$I(ZI(a,o).slice(0,6),`model_name`,`model_name`),daily:eL(n,o),heatmap:tL(t)}}function rL(e,t,n){let r=new Map((e||[]).map(e=>[e.key,e])),i=new Map((t||[]).map(e=>[e.key,e])),a=[],o=new Set;for(let e of t||[])o.has(e.key)||(o.add(e.key),a.push(e.key));for(let t of e||[])o.has(t.key)||(o.add(t.key),a.push(t.key));let s=[];for(let e of a){let t=r.get(e),a=i.get(e),o=a?.label||t?.label||e,c=YI(XI(t?.tokens),XI(a?.tokens),n);c<=.001&&!a||s.push({key:e,label:o,tokens:c})}return s}function iL(e,t,n){let r=(t?.dates?.length?t.dates:e?.dates||[]).slice(),i=new Map((e?.series||[]).map(e=>[e.key,e])),a=new Map((t?.series||[]).map(e=>[e.key,e])),o=new Set([...i.keys(),...a.keys()]),s=[];for(let c of o){let o=i.get(c),l=a.get(c),u=new Map((o?.data||[]).map((t,n)=>[e?.dates?.[n],t])),d=new Map((l?.data||[]).map((e,n)=>[t?.dates?.[n],e])),f=r.map(e=>YI(XI(u.get(e)),XI(d.get(e)),n));f.every(e=>e<=.001)&&!l||s.push({key:c,label:l?.label||o?.label||c,data:f})}return{dates:r,series:s}}function aL(e,t,n){let r=new Set([...Object.keys(e||{}),...Object.keys(t||{})]),i={};for(let a of r){let r=e?.[a],o=t?.[a];i[a]={tokens:YI(XI(r?.tokens),XI(o?.tokens),n),elapsed:YI(XI(r?.elapsed),XI(o?.elapsed),n),cost:YI(XI(r?.cost),XI(o?.cost),n)}}return i}function oL(e,t,n){return{ready:t.ready,stats:{tokens:YI(XI(e?.stats?.tokens),XI(t?.stats?.tokens),n),elapsed:YI(XI(e?.stats?.elapsed),XI(t?.stats?.elapsed),n),cost:YI(XI(e?.stats?.cost),XI(t?.stats?.cost),n),sessions:YI(XI(e?.stats?.sessions),XI(t?.stats?.sessions),n),enriched:YI(XI(e?.stats?.enriched),XI(t?.stats?.enriched),n),priced:YI(XI(e?.stats?.priced),XI(t?.stats?.priced),n),exactPriced:YI(XI(e?.stats?.exactPriced),XI(t?.stats?.exactPriced),n),fallbackPriced:YI(XI(e?.stats?.fallbackPriced),XI(t?.stats?.fallbackPriced),n),unpriced:YI(XI(e?.stats?.unpriced),XI(t?.stats?.unpriced),n),days:XI(t?.stats?.days)||1},topRepos:rL(e?.topRepos,t?.topRepos,n),topFamilies:rL(e?.topFamilies,t?.topFamilies,n),topModels:rL(e?.topModels,t?.topModels,n),daily:iL(e?.daily,t?.daily,n),heatmap:aL(e?.heatmap,t?.heatmap,n)}}function sL(e,{duration:t=BI,onSettledChange:n,ingestProgress:r=0,isIngestActive:i=!1,clockNowMs:a=null}={}){let o=(0,b.useMemo)(()=>nL(e),[e.overview,e.heatmap,e.daily,e.families,e.repos,e.models,e.range]),[s,c]=(0,b.useState)(o),l=(0,b.useRef)(o),u=(0,b.useRef)(o),d=(0,b.useRef)(0),f=(0,b.useRef)(0),p=(0,b.useRef)(s),m=(0,b.useRef)(!0),h=(0,b.useRef)(n),g=(0,b.useRef)(0),_=(0,b.useRef)(o),v=(0,b.useRef)(o),y=(0,b.useRef)(`smooth`);(0,b.useEffect)(()=>{h.current=n},[n]);let x=e=>{m.current!==e&&(m.current=e,h.current?.(e))};(0,b.useEffect)(()=>{p.current=s},[s]);let S=e=>{l.current=e,u.current=e,p.current=e,c(e),x(!0),f.current=0,g.current=0,_.current=e,v.current=e},C=e=>{u.current=e,x(!1);let t=UI(r,i)?`tail`:`smooth`;y.current!==t&&(y.current=t,g.current=0),t===`tail`&&(_.current=l.current,v.current=e,g.current=0)},w=(e,n)=>{e<f.current&&(f.current=0,g.current=0,_.current=l.current,v.current=n),f.current||=e;let a=Math.max(1,e-f.current);f.current=e;let o=VI(r,i)||t,s=l.current,u=UI(r,i)?`tail`:`smooth`;y.current!==u&&(y.current=u,g.current=0);let d,m;if(u===`tail`){v.current!==n&&(_.current=s,v.current=n,g.current=e),g.current||=e;let t=Math.max(0,e-g.current),a=Math.min(1,t/Math.max(o,1)),c=cL(a,HI(r,i));d=oL(_.current,v.current,c),m=a>=1||lL(d,n)<=.002}else{let e=cL(1-Math.exp(-a/Math.max(o,1)),HI(r,i));d=oL(s,n,e),m=e>=.999||lL(d,n)<=.002}return l.current=d,m?(l.current=n,p.current=n,c(n),x(!0),g.current=0,_.current=n,v.current=n,n):(p.current=d,c(d),d)};return(0,b.useLayoutEffect)(()=>{if(a!=null){if(t<=0){S(o);return}C(o),w(a,o)}},[o,t,r,i,a]),(0,b.useEffect)(()=>{if(a!=null)return;if(u.current=o,t<=0){S(o);return}if(C(o),d.current)return;let e=t=>{if(w(t,u.current)===u.current&&m.current){d.current=0,f.current=0;return}d.current=requestAnimationFrame(e)};d.current=requestAnimationFrame(e)},[o,t,r,i,a]),(0,b.useEffect)(()=>()=>{d.current&&cancelAnimationFrame(d.current),d.current=0,f.current=0},[]),s}function cL(e,t){let n=Math.min(Math.max(e,0),1);return t===`cubicOut`?1-(1-n)**3:n}function lL(e,t){if(!e||!t)return 0;let n=Math.max(Math.abs((e.stats?.tokens||0)-(t.stats?.tokens||0)),Math.abs((e.stats?.elapsed||0)-(t.stats?.elapsed||0)),Math.abs((e.stats?.cost||0)-(t.stats?.cost||0)),Math.abs((e.stats?.sessions||0)-(t.stats?.sessions||0))),r=uL(e.topRepos,t.topRepos),i=uL(e.topFamilies,t.topFamilies),a=uL(e.topModels,t.topModels),o=dL(e.daily,t.daily);return Math.max(n,r,i,a,o)/Math.max(1,t.stats?.tokens||1)}function uL(e=[],t=[]){let n=new Map(e.map(e=>[e.key,e.tokens||0])),r=0;for(let e of t)r=Math.max(r,Math.abs((n.get(e.key)||0)-(e.tokens||0)));return r}function dL(e,t){let n=new Map((e?.series||[]).map(e=>[e.key,e])),r=0;for(let e of t?.series||[]){let t=n.get(e.key);for(let n=0;n<e.data.length;n+=1)r=Math.max(r,Math.abs((t?.data?.[n]||0)-(e.data[n]||0)))}return r}var fL=s((e=>{var t=Symbol.for(`react.transitional.element`);function n(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.jsx=n,e.jsxs=n})),$=s(((e,t)=>{t.exports=fL()}))();BE([Uk,dA,LN,QP,tF,DF,pI]);function pL(e){return EI(e)}function mL(e){return e==null?`—`:e>=1e3?`$`+(e/1e3).toFixed(1)+`K`:`$`+e.toFixed(2)}function hL(e){return e?(e/3600).toFixed(1)+`h`:`0h`}function gL(e,t=16){if(!e)return``;let n=String(e).split(/([-/])/).filter(Boolean),r=[``];for(let e of n){let n=r[r.length-1];if(!n.length||(n+e).length<=t){r[r.length-1]=n+e;continue}if(r.length===2){r[1]+=e;break}r.push(e)}return r.join(`
|
|
27
|
+
`||r===``)){var i=e.isSelected(r);q(n,r)?n[r]=n[r]&&i:n[r]=i}}),n}function _F(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,vt(hF,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,vt(hF,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,vt(hF,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,vt(hF,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,vt(hF,`unSelect`))}function vF(e){e.registerComponentModel(rF),e.registerComponentView(sF),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,mF),e.registerSubTypeDefaulter(`legend`,function(){return`plain`}),_F(e)}F();var yF=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,r){var i=Yg(t);e.prototype.init.call(this,t,n,r),bF(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),bF(this,this.option,t)},t.type=`legend.scroll`,t.defaultOption=mh(rF.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:`end`,pageFormatter:`{current}/{total}`,pageIcons:{horizontal:[`M0,0L12,-10L12,10z`,`M0,0L-12,-10L-12,10z`],vertical:[`M0,0L20,0L10,-20z`,`M0,0L20,0L10,20z`]},pageIconColor:Z.color.accent50,pageIconInactiveColor:Z.color.accent10,pageIconSize:15,pageTextStyle:{color:Z.color.tertiary},animationDurationUpdate:800}),t}(rF);function bF(e,t,n){var r=e.getOrient(),i=[1,1];i[r.index]=0,Jg(t,n,{type:`box`,ignoreSize:!!i})}F();var xF=Wo,SF=[`width`,`height`],CF=[`x`,`y`],wF=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new xF),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new xF)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,r,i,a,o,s){var c=this;e.prototype.renderInner.call(this,t,n,r,i,a,o,s);var l=this._controllerGroup,u=n.get(`pageIconSize`,!0),d=V(u)?u:[u,u];p(`pagePrev`,0);var f=n.getModel(`pageTextStyle`);l.add(new X({name:`pageText`,style:{text:`xx/xx`,fill:f.getTextColor(),font:f.getFont(),verticalAlign:`middle`,align:`center`},silent:!0})),p(`pageNext`,1);function p(e,t){var r=e+`DataIndex`,a=_m(n.get(`pageIcons`,!0)[n.getOrient().name][t],{onclick:B(c._pageGo,c,r,n,i)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});a.name=e,l.add(a)}},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getSelectorGroup(),s=e.getOrient().index,c=SF[s],l=CF[s],u=SF[1-s],d=CF[1-s];i&&zg(`horizontal`,o,e.get(`selectorItemGap`,!0));var f=e.get(`selectorButtonGap`,!0),p=o.getBoundingRect(),m=[-p.x,-p.y],h=at(n);i&&(h[c]=n[c]-p[c]-f);var g=this._layoutContentAndController(e,r,h,s,c,u,d,l);if(i){if(a===`end`)m[s]+=g[c]+f;else{var _=p[c]+f;m[s]-=_,g[l]-=_}g[c]+=p[c]+f,m[1-s]+=g[d]+g[u]/2-p[u]/2,g[u]=Math.max(g[u],p[u]),g[d]=Math.min(g[d],p[d]+m[1-s]),o.x=m[0],o.y=m[1],o.markRedraw()}return g},t.prototype._layoutContentAndController=function(e,t,n,r,i,a,o,s){var c=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;zg(e.get(`orient`),c,e.get(`itemGap`),r?n.width:null,r?null:n.height),zg(`horizontal`,u,e.get(`pageButtonItemGap`,!0));var d=c.getBoundingRect(),f=u.getBoundingRect(),p=this._showController=d[i]>n[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=G(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new Vu({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&zp(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;R([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,U(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=SF[i],o=CF[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=u?1:0,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i<g.i&&(g=h,f.pagePrevDataIndex??=h.i,++f.pageCount,++f.pageIndex),h=_;return f;function v(e){if(e){var t=e.getBoundingRect(),n=t[o]+e[o];return{s:n,e:n+t[a],i:e.__legendDataIndex}}}function y(e,t){return e.e>=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}(sF);function TF(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function EF(e){BE(vF),e.registerComponentModel(yF),e.registerComponentView(wF),TF(e)}function DF(e){BE(vF),BE(EF)}F();var OF=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.inside`,t.defaultOption=mh(lP.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(lP),kF=mc();function AF(e,t,n){kF(e).coordSysRecordMap.each(function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)})}function jF(e,t){for(var n=kF(e).coordSysRecordMap,r=n.keys(),i=0;i<r.length;i++){var a=r[i],o=n.get(a),s=o.dataZoomInfoMap;if(s){var c=t.uid;s.get(c)&&(s.removeKey(c),s.keys().length||MF(n,o))}}}function MF(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function NF(e,t){var n={model:t,containsPoint:vt(FF,t),dispatchAction:vt(PF,e),dataZoomInfoMap:null,controller:null},r=n.controller=new iM(e.getZr());return R([`pan`,`zoom`,`scrollMove`],function(e){r.on(e,function(t){var r=[];n.dataZoomInfoMap.each(function(i){if(t.isAvailableBehavior(i.model.option)){var a=(i.getRange||{})[e],o=a&&a(i.dzReferCoordSysInfo,n.model.mainType,n.controller,t);!i.model.get(`disabled`,!0)&&o&&r.push({dataZoomId:i.model.id,start:o[0],end:o[1]})}}),r.length&&n.dispatchAction(r)})}),n}function PF(e,t){e.isDisposed()||e.dispatchAction({type:`dataZoom`,animation:{easing:`cubicOut`,duration:100},batch:t})}function FF(e,t,n,r){return e.coordinateSystem.containPoint([n,r])}function IF(e,t,n){var r,i=`type_`,a={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0;return e.each(function(e){var t=e.model,n=t.get(`disabled`,!0)?!1:t.get(`zoomLock`,!0)?`move`:!0;a[i+n]>a[i+r]&&(r=n),o&&=t.get(`preventDefaultMouseMove`,!0)}),{controlType:r,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:n,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint}}}}function LF(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=kF(t),r=n.coordSysRecordMap||=K();r.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:`dataZoom`,subType:`inside`},function(e){R(sP(e).infoList,function(n){var i=n.model.uid,a=r.get(i)||r.set(i,NF(t,n.model));(a.dataZoomInfoMap||=K()).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),r.each(function(e){var n=e.controller,i,a=e.dataZoomInfoMap;if(a){var o=a.keys()[0];o!=null&&(i=a.get(o))}if(!i){MF(r,e);return}var s=IF(a,e,t);n.enable(s.controlType,s.opt),Ob(e,`dispatchAction`,i.model.get(`throttle`,!0),`fixRate`)})})}F();var RF=function(e){D(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`dataZoom.inside`,t}return t.prototype.render=function(t,n,r){if(e.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),AF(r,t,{pan:B(zF.pan,this),zoom:B(zF.zoom,this),scrollMove:B(zF.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){jF(this.api,this.dataZoomModel),this.range=null},t.type=`dataZoom.inside`,t}(dP),zF={zoom:function(e,t,n,r){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=VF[t](null,[r.originX,r.originY],o,n,e),c=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],l=Math.max(1/r.scale,0);a[0]=(a[0]-c)*l+c,a[1]=(a[1]-c)*l+c;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(mM(0,a,[0,100],0,u.minSpan,u.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:BF(function(e,t,n,r,i,a){var o=VF[r]([a.oldX,a.oldY],[a.newX,a.newY],t,i,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:BF(function(e,t,n,r,i,a){return VF[r]([0,0],[a.scrollDelta,a.scrollDelta],t,i,n).signal*(e[1]-e[0])*a.scrollDelta})};function BF(e){return function(t,n,r,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s&&(mM(e(o,s,t,n,r,i),o,[0,100],`all`),this.range=o,a[0]!==o[0]||a[1]!==o[1]))return o}}var VF={grid:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem.getRect();return e||=[0,0],a.dim===`x`?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem,c=s.getRadiusAxis().getExtent(),l=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),n.mainType===`radiusAxis`?(o.pixel=t[0]-e[0],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,r,i){var a=n.axis,o=i.model.coordinateSystem.getRect(),s={};return e||=[0,0],a.orient===`horizontal`?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function HF(e){yP(e),e.registerComponentModel(OF),e.registerComponentView(RF),LF(e)}F();var UF=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.slider`,t.layoutMode=`box`,t.defaultOption=mh(lP.defaultOption,{show:!0,right:`ph`,top:`ph`,width:`ph`,height:`ph`,left:null,bottom:null,borderColor:Z.color.accent10,borderRadius:0,backgroundColor:Z.color.transparent,dataBackground:{lineStyle:{color:Z.color.accent30,width:.5},areaStyle:{color:Z.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:Z.color.accent40,width:.5},areaStyle:{color:Z.color.accent20,opacity:.3}},fillerColor:`rgba(135,175,274,0.2)`,handleIcon:`path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z`,handleSize:`100%`,handleStyle:{color:Z.color.neutral00,borderColor:Z.color.accent20},moveHandleSize:7,moveHandleIcon:`path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z`,moveHandleStyle:{color:Z.color.accent40,opacity:.5},showDetail:!0,showDataShadow:`auto`,realtime:!0,zoomLock:!1,textStyle:{color:Z.color.tertiary},brushSelect:!0,brushStyle:{color:Z.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:Z.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(lP);F();var WF=Vu,GF=1,KF=30,qF=7,JF=`horizontal`,YF=`vertical`,XF=5,ZF=[`line`,`bar`,`candlestick`,`scatter`],QF={easing:`cubicOut`,duration:100,delay:0},$F=function(e){D(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return t.prototype.init=function(e,t){this.api=t,this._onBrush=B(this._onBrush,this),this._onBrushEnd=B(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),Ob(this,`_dispatchZoomAction`,t.get(`throttle`),`fixRate`),this._orient=t.getOrient(),t.get(`show`)===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!i||i.type!==`dataZoom`||i.from!==this.uid)&&this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){kb(this,`_dispatchZoomAction`);var e=this.api.getZr();e.off(`mousemove`,this._onBrush),e.off(`mouseup`,this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Wo;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get(`brushSelect`)?qF:0,r=Gg(e,t).refContainer,i=this._findCoordRect(),a=e.get(`defaultLocationEdgeGap`,!0)||0,o=this._orient===JF?{right:r.width-i.x-i.width,top:r.height-KF-a-n,width:i.width,height:KF}:{right:a,top:i.y,width:KF,height:i.height},s=Yg(e.option);R([`right`,`top`,`width`,`height`],function(e){s[e]===`ph`&&(s[e]=o[e])});var c=Ug(s,r);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===YF&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get(`inverse`),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n===JF&&!i?{scaleY:o?1:-1,scaleX:1}:n===JF&&i?{scaleY:o?1:-1,scaleX:-1}:n===YF&&!i?{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2});var s=e.getBoundingRect([a]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get(`brushSelect`);n.add(new WF({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get(`backgroundColor`)},z2:-40}));var i=new WF({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:`transparent`},z2:0,onclick:B(this._onClickPanel,this)}),a=this.api.getZr();r?(i.on(`mousedown`,this._onBrushStart,this),i.cursor=`crosshair`,a.on(`mousemove`,this._onBrush),a.on(`mouseup`,this._onBrushEnd)):(a.off(`mousemove`,this._onBrush),a.off(`mouseup`,this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!e)return;var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),a=r.getShadowDim&&r.getShadowDim(),o=a&&i.getDimensionInfo(a)?r.getShadowDim():e.otherDim;if(o==null)return;var s=this._shadowPolygonPts,c=this._shadowPolylinePts;if(i!==this._shadowData||o!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var l=i.getDataExtent(e.thisDim),u=i.getDataExtent(o),d=(u[1]-u[0])*.3;u=[u[0]-d,u[1]+d];var f=[0,t[1]],p=[0,t[0]],m=[[t[0],0],[0,0]],h=[],g=p[1]/Math.max(1,i.count()-1),_=t[0]/(l[1]-l[0]),v=e.thisAxis.type===`time`,y=-g,b=Math.round(i.count()/t[0]),x;i.each([e.thisDim,o],function(e,t,n){if(b>0&&n%b){v||(y+=g);return}y=v?(+e-l[0])*_:y+g;var r=t==null||isNaN(t)||t===``,i=r?0:fs(t,u,f,!0);r&&!x&&n?(m.push([m[m.length-1][0],0]),h.push([h[h.length-1][0],0])):!r&&x&&(m.push([y,0]),h.push([y,0])),r||(m.push([y,i]),h.push([y,i])),x=r}),s=this._shadowPolygonPts=m,c=this._shadowPolylinePts=h}this._shadowData=i,this._shadowDim=o,this._shadowSize=[t[0],t[1]];var S=this.dataZoomModel;function C(e){var t=S.getModel(e?`selectedDataBackground`:`dataBackground`),n=new Wo,r=new lp({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel(`areaStyle`).getAreaStyle(),silent:!0,z2:-20}),i=new dp({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel(`lineStyle`).getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}for(var w=0;w<3;w++){var T=C(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get(`showDataShadow`);if(t!==!1){var n,r=this.ecModel;return e.eachTargetAxis(function(i,a){R(e.getAxisProxy(i,a).getTargetSeriesModels(),function(e){if(!n&&!(t!==!0&<(ZF,e.get(`type`))<0)){var o=r.getComponent(aP(i),a).axis,s=eI(i),c,l=e.coordinateSystem;s!=null&&l.getOtherAxis&&(c=l.getOtherAxis(o).inverse),s=e.getData().mapDimension(s),n={thisAxis:o,series:e,thisDim:e.getData().mapDimension(i),otherDim:s,otherAxisInverse:c}}},this)},this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,c=o.get(`borderRadius`)||0,l=o.get(`brushSelect`),u=t.filler=new WF({silent:l,style:{fill:o.get(`fillerColor`)},textConfig:{position:`inside`}});i.add(u),i.add(new WF({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:c},style:{stroke:o.get(`dataBackgroundColor`)||o.get(`borderColor`),lineWidth:GF,fill:Z.color.transparent}})),R([0,1],function(t){var a=o.get(`handleIcon`);!Cx[a]&&a.indexOf(`path://`)<0&&a.indexOf(`image://`)<0&&(a=`path://`+a);var s=Dx(a,-1,0,2,2,null,!0);s.attr({cursor:tI(this._orient),draggable:!0,drift:B(this._onDragMove,this,t),ondragend:B(this._onDragEnd,this),onmouseover:B(this._showDataInfo,this,!0),onmouseout:B(this._showDataInfo,this,!1),z2:5});var c=s.getBoundingRect();this._handleHeight=ps(o.get(`handleSize`),this._size[1]),this._handleWidth=c.width/c.height*this._handleHeight,s.setStyle(o.getModel(`handleStyle`).getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState(`emphasis`).style=o.getModel([`emphasis`,`handleStyle`]).getItemStyle(),tf(s);var l=o.get(`handleColor`);l!=null&&(s.style.fill=l),i.add(n[t]=s);var u=o.getModel(`textStyle`),d=(o.get(`handleLabel`)||{}).show||!1;e.add(r[t]=new X({silent:!0,invisible:!d,style:Vm(u,{x:0,y:0,text:``,verticalAlign:`middle`,align:`center`,fill:u.getTextColor(),font:u.getFont()}),z2:10}))},this);var d=u;if(l){var f=ps(o.get(`moveHandleSize`),a[1]),p=t.moveHandle=new Vu({style:o.getModel(`moveHandleStyle`).getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:f}}),m=f*.8,h=t.moveHandleIcon=Dx(o.get(`moveHandleIcon`),-m/2,-m/2,m,m,Z.color.neutral00,!0);h.silent=!0,h.y=a[1]+f/2-.5,p.ensureState(`emphasis`).style=o.getModel([`emphasis`,`moveHandleStyle`]).getItemStyle();var g=Math.min(a[1]/2,Math.max(f,10));d=t.moveZone=new Vu({invisible:!0,shape:{y:a[1]-g,height:f+g}}),d.on(`mouseover`,function(){s.enterEmphasis(p)}).on(`mouseout`,function(){s.leaveEmphasis(p)}),i.add(p),i.add(h),i.add(d)}d.attr({draggable:!0,cursor:`default`,drift:B(this._onDragMove,this,`all`),ondragstart:B(this._showDataInfo,this,!0),ondragend:B(this._onDragEnd,this),onmouseover:B(this._showDataInfo,this,!0),onmouseout:B(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[fs(e[0],[0,100],t,!0),fs(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];mM(t,r,i,n.get(`zoomLock`)?`all`:e,a.minSpan==null?null:fs(a.minSpan,o,i,!0),a.maxSpan==null?null:fs(a.maxSpan,o,i,!0));var s=this._range,c=this._range=_s([fs(r[0],i,o,!0),fs(r[1],i,o,!0)]);return!s||s[0]!==c[0]||s[1]!==c[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=_s(n.slice()),i=this._size;R([0,1],function(e){var r=t.handles[e],a=this._handleHeight;r.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:i[1]/2-a/2})},this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var a={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr(`x`,a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],c=0;c<o.length;c++){var l=o[c],u=l.getClipPath();u||(u=new Vu,l.setClipPath(u)),u.setShape({x:s[c],y:0,width:s[c+1]-s[c],height:i[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=this._orient,a=[``,``];if(t.get(`showDetail`)){var o=t.findRepresentativeAxisProxy();if(o){var s=o.getAxisModel().axis,c=this._range,l=e?o.calculateDataWindow({start:c[0],end:c[1]}).valueWindow:o.getDataValueWindow();a=[this._formatLabel(l[0],s),this._formatLabel(l[1],s)]}}var u=_s(this._handleEnds.slice());d.call(this,0),d.call(this,1);function d(e){var t=lm(n.handles[e].parent,this.group),o=dm(e===0?`right`:`left`,t),s=this._handleWidth/2+XF,c=um([u[e]+(e===0?-s:s),this._size[1]/2],t);r[e].setStyle({x:c[0],y:c[1],verticalAlign:i===JF?`middle`:o,align:i===JF?o:`center`,text:a[e]})}},t.prototype._formatLabel=function(e,t){var n=this.dataZoomModel,r=n.get(`labelFormatter`),i=n.get(`labelPrecision`);(i==null||i===`auto`)&&(i=t.getPixelPrecision());var a=e==null||isNaN(e)?``:t.type===`category`||t.type===`time`?t.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(i,20));return H(r)?r(e,a):U(r)?r.replace(`{value}`,a):a},t.prototype._showDataInfo=function(e){var t=(this.dataZoomModel.get(`handleLabel`)||{}).show||!1,n=this.dataZoomModel.getModel([`emphasis`,`handleLabel`]).get(`show`)||!1,r=e||this._dragging?n:t,i=this._displayables,a=i.handleLabels;a[0].attr(`invisible`,!r),a[1].attr(`invisible`,!r),i.moveHandle&&this.api[r?`enterEmphasis`:`leaveEmphasis`](i.moveHandle,1)},t.prototype._onDragMove=function(e,t,n,r){this._dragging=!0,qn(r.event);var i=this._displayables.sliderGroup.getLocalTransform(),a=um([t,n],i,!0),o=this._updateInterval(e,a[0]),s=this.dataZoomModel.get(`realtime`);this._updateView(!s),o&&s&&this._dispatchZoomAction(!0)},t.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get(`realtime`)&&this._dispatchZoomAction(!1)},t.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0||n[0]>t[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,a=this._updateInterval(`all`,n[0]-i);this._updateView(),a&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new lr(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr(`ignore`,!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100],a=this._handleEnds=[n.x,n.x+n.width],o=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();mM(0,a,r,0,o.minSpan==null?null:fs(o.minSpan,i,r,!0),o.maxSpan==null?null:fs(o.maxSpan,i,r,!0)),this._range=_s([fs(a[0],r,i,!0),fs(a[1],r,i,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(qn(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new WF({silent:!0,style:r.getModel(`brushStyle`).getItemStyle()}),n.sliderGroup.add(i)),i.attr(`ignore`,!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),c=o.transformCoordToLocal(a.x,a.y),l=this._size;s[0]=Math.max(Math.min(l[0],s[0]),0),i.setShape({x:c[0],y:0,width:s[0]-c[0],height:l[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:`dataZoom`,from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?QF:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=sP(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:r*.2,y:i*.2,width:r*.6,height:i*.6}}return e},t.type=`dataZoom.slider`,t}(dP);function eI(e){return{x:`y`,y:`x`,radius:`angle`,angle:`radius`}[e]}function tI(e){return e===`vertical`?`ns-resize`:`ew-resize`}function nI(e){e.registerComponentModel(UF),e.registerComponentView($F),yP(e)}function rI(e){BE(HF),BE(nI)}F();function iI(e,t,n){var r=He.createCanvas(),i=t.getWidth(),a=t.getHeight(),o=r.style;return o&&(o.position=`absolute`,o.left=`0`,o.top=`0`,o.width=i+`px`,o.height=a+`px`,r.setAttribute(`data-zr-dom-id`,e)),r.width=i*n,r.height=a*n,r}var aI=function(e){D(t,e);function t(t,n,r){var i=e.call(this)||this;i.motionBlur=!1,i.lastFrameAlpha=.7,i.dpr=1,i.virtual=!1,i.config={},i.incremental=!1,i.zlevel=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__used=!1,i.__drawIndex=0,i.__startIndex=0,i.__endIndex=0,i.__prevStartIndex=null,i.__prevEndIndex=null;var a;r||=eo,typeof t==`string`?a=iI(t,n,r):W(t)&&(a=t,t=a.id),i.id=t,i.dom=a;var o=a.style;return o&&(Ut(a),a.onselectstart=function(){return!1},o.padding=`0`,o.margin=`0`,o.borderWidth=`0`),i.painter=n,i.dpr=r,i}return t.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},t.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},t.prototype.initContext=function(){this.ctx=this.dom.getContext(`2d`),this.ctx.dpr=this.dpr},t.prototype.setUnpainted=function(){this.__firstTimePaint=!0},t.prototype.createBackBuffer=function(){var e=this.dpr;this.domBack=iI(`back-`+this.id,this.painter,e),this.ctxBack=this.domBack.getContext(`2d`),e!==1&&this.ctxBack.scale(e,e)},t.prototype.createRepaintRects=function(e,t,n,r){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var i=[],a=this.maxRepaintRectCount,o=!1,s=new J(0,0,0,0);function c(e){if(!(!e.isFinite()||e.isZero()))if(i.length===0){var t=new J(0,0,0,0);t.copy(e),i.push(t)}else{for(var n=!1,r=1/0,c=0,l=0;l<i.length;++l){var u=i[l];if(u.intersect(e)){var d=new J(0,0,0,0);d.copy(u),d.union(e),i[l]=d,n=!0;break}else if(o){s.copy(e),s.union(u);var f=e.width*e.height,p=u.width*u.height,m=s.width*s.height-f-p;m<r&&(r=m,c=l)}}if(o&&(i[c].union(e),n=!0),!n){var t=new J(0,0,0,0);t.copy(e),i.push(t)}o||=i.length>=a}}for(var l=this.__startIndex;l<this.__endIndex;++l){var u=e[l];if(u){var d=u.shouldBePainted(n,r,!0,!0),f=u.__isRendered&&(u.__dirty&1||!d)?u.getPrevPaintRect():null;f&&c(f);var p=d&&(u.__dirty&1||!u.__isRendered)?u.getPaintRect():null;p&&c(p)}}for(var l=this.__prevStartIndex;l<this.__prevEndIndex;++l){var u=t[l],d=u&&u.shouldBePainted(n,r,!0,!0);if(u&&(!d||!u.__zr)&&u.__isRendered){var f=u.getPrevPaintRect();f&&c(f)}}var m;do{m=!1;for(var l=0;l<i.length;){if(i[l].isZero()){i.splice(l,1);continue}for(var h=l+1;h<i.length;)i[l].intersect(i[h])?(m=!0,i[l].union(i[h]),i.splice(h,1)):h++;l++}}while(m);return this._paintRects=i,i},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(e,t){var n=this.dpr,r=this.dom,i=r.style,a=this.domBack;i&&(i.width=e+`px`,i.height=t+`px`),r.width=e*n,r.height=t*n,a&&(a.width=e*n,a.height=t*n,n!==1&&this.ctxBack.scale(n,n))},t.prototype.clear=function(e,t,n){var r=this.dom,i=this.ctx,a=r.width,o=r.height;t||=this.clearColor;var s=this.motionBlur&&!e,c=this.lastFrameAlpha,l=this.dpr,u=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation=`copy`,this.ctxBack.drawImage(r,0,0,a/l,o/l));var d=this.domBack;function f(e,n,r,a){if(i.clearRect(e,n,r,a),t&&t!==`transparent`){var o=void 0;wt(t)?(o=(t.global||t.__width===r&&t.__height===a)&&t.__canvasGradient||Nx(i,t,{x:0,y:0,width:r,height:a}),t.__canvasGradient=o,t.__width=r,t.__height=a):Tt(t)&&(t.scaleX=t.scaleX||l,t.scaleY=t.scaleY||l,o=Gx(i,t,{dirty:function(){u.setUnpainted(),u.painter.refresh()}})),i.save(),i.fillStyle=o||t,i.fillRect(e,n,r,a),i.restore()}s&&(i.save(),i.globalAlpha=c,i.drawImage(d,e,n,r,a),i.restore())}!n||s?f(0,0,a,o):n.length&&R(n,function(e){f(e.x*l,e.y*l,e.width*l,e.height*l)})},t}(Sn),oI=1e5,sI=314159,cI=.01,lI=.001;function uI(e){return e?e.__builtin__?!0:!(typeof e.resize!=`function`||typeof e.refresh!=`function`):!1}function dI(e,t){var n=document.createElement(`div`);return n.style.cssText=[`position:relative`,`width:`+e+`px`,`height:`+t+`px`,`padding:0`,`margin:0`,`border-width:0`].join(`;`)+`;`,n}var fI=function(){function e(e,t,n,r){this.type=`canvas`,this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type=`canvas`;var i=!e.nodeName||e.nodeName.toUpperCase()===`CANVAS`;this._opts=n=I({},n||{}),this.dpr=n.devicePixelRatio||eo,this._singleCanvas=i,this.root=e,e.style&&(Ut(e),e.innerHTML=``),this.storage=t;var a=this._zlevelList;this._prevDisplayList=[];var o=this._layers;if(i){var s=e,c=s.width,l=s.height;n.width!=null&&(c=n.width),n.height!=null&&(l=n.height),this.dpr=n.devicePixelRatio||1,s.width=c*this.dpr,s.height=l*this.dpr,this._width=c,this._height=l;var u=new aI(s,this,this.dpr);u.__builtin__=!0,u.initContext(),o[sI]=u,u.zlevel=sI,a.push(sI),this._domRoot=e}else{this._width=Ix(e,0,n),this._height=Ix(e,1,n);var d=this._domRoot=dI(this._width,this._height);e.appendChild(d)}}return e.prototype.getType=function(){return`canvas`},e.prototype.isSingleCanvas=function(){return this._singleCanvas},e.prototype.getViewportRoot=function(){return this._domRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(e){var t=this.storage.getDisplayList(!0),n=this._prevDisplayList,r=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,n,e,this._redrawId);for(var i=0;i<r.length;i++){var a=r[i],o=this._layers[a];if(!o.__builtin__&&o.refresh){var s=i===0?this._backgroundColor:null;o.refresh(s)}}return this._opts.useDirtyRect&&(this._prevDisplayList=t.slice()),this},e.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},e.prototype._paintHoverList=function(e){var t=e.length,n=this._hoverlayer;if(n&&n.clear(),t){for(var r={inHover:!0,viewWidth:this._width,viewHeight:this._height},i,a=0;a<t;a++){var o=e[a];o.__inHover&&(n||=this._hoverlayer=this.getLayer(oI),i||(i=n.ctx,i.save()),dS(i,o,r,a===t-1))}i&&i.restore()}},e.prototype.getHoverLayer=function(){return this.getLayer(oI)},e.prototype.paintOne=function(e,t){uS(e,t)},e.prototype._paintList=function(e,t,n,r){if(this._redrawId===r){n||=!1,this._updateLayerStatus(e);var i=this._doPaintList(e,t,n),a=i.finished,o=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),o&&this._paintHoverList(e),a)this.eachLayer(function(e){e.afterBrush&&e.afterBrush()});else{var s=this;Qr(function(){s._paintList(e,t,n,r)})}}},e.prototype._compositeManually=function(){var e=this.getLayer(sI).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),this.eachBuiltinLayer(function(r){r.virtual&&e.drawImage(r.dom,0,0,t,n)})},e.prototype._doPaintList=function(e,t,n){for(var r=this,i=[],a=this._opts.useDirtyRect,o=0;o<this._zlevelList.length;o++){var s=this._zlevelList[o],c=this._layers[s];c.__builtin__&&c!==this._hoverlayer&&(c.__dirty||n)&&i.push(c)}for(var l=!0,u=!1,d=function(o){var s=i[o],c=s.ctx,d=a&&s.createRepaintRects(e,t,f._width,f._height),p=n?s.__startIndex:s.__drawIndex,m=!n&&s.incremental&&Date.now,h=m&&Date.now(),g=s.zlevel===f._zlevelList[0]?f._backgroundColor:null;if(s.__startIndex===s.__endIndex)s.clear(!1,g,d);else if(p===s.__startIndex){var _=e[p];(!_.incremental||!_.notClear||n)&&s.clear(!1,g,d)}p===-1&&(console.error(`For some unknown reason. drawIndex is -1`),p=s.__startIndex);var v,y=function(t){var n={inHover:!1,allClipped:!1,prevEl:null,viewWidth:r._width,viewHeight:r._height};for(v=p;v<s.__endIndex;v++){var i=e[v];if(i.__inHover&&(u=!0),r._doPaintEl(i,s,a,t,n,v===s.__endIndex-1),m&&Date.now()-h>15)break}n.prevElClipPaths&&c.restore()};if(d)if(d.length===0)v=s.__endIndex;else for(var b=f.dpr,x=0;x<d.length;++x){var S=d[x];c.save(),c.beginPath(),c.rect(S.x*b,S.y*b,S.width*b,S.height*b),c.clip(),y(S),c.restore()}else c.save(),y(),c.restore();s.__drawIndex=v,s.__drawIndex<s.__endIndex&&(l=!1)},f=this,p=0;p<i.length;p++)d(p);return Pe.wxa&&R(this._layers,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),{finished:l,needsRefreshHover:u}},e.prototype._doPaintEl=function(e,t,n,r,i,a){var o=t.ctx;if(n){var s=e.getPaintRect();(!r||s&&s.intersect(r))&&(dS(o,e,i,a),e.setPrevPaintRect(s))}else dS(o,e,i,a)},e.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=sI);var n=this._layers[e];return n||(n=new aI(`zr_`+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?ot(n,this._layerConfig[e],!0):this._layerConfig[e-cI]&&ot(n,this._layerConfig[e-cI],!0),t&&(n.virtual=t),this.insertLayer(e,n),n.initContext()),n},e.prototype.insertLayer=function(e,t){var n=this._layers,r=this._zlevelList,i=r.length,a=this._domRoot,o=null,s=-1;if(!n[e]&&uI(t)){if(i>0&&e>r[0]){for(s=0;s<i-1&&!(r[s]<e&&r[s+1]>e);s++);o=n[r[s]]}if(r.splice(s+1,0,e),n[e]=t,!t.virtual)if(o){var c=o.dom;c.nextSibling?a.insertBefore(t.dom,c.nextSibling):a.appendChild(t.dom)}else a.firstChild?a.insertBefore(t.dom,a.firstChild):a.appendChild(t.dom);t.painter||=this}},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r];e.call(t,this._layers[i],i)}},e.prototype.eachBuiltinLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],a=this._layers[i];a.__builtin__&&e.call(t,a,i)}},e.prototype.eachOtherLayer=function(e,t){for(var n=this._zlevelList,r=0;r<n.length;r++){var i=n[r],a=this._layers[i];a.__builtin__||e.call(t,a,i)}},e.prototype.getLayers=function(){return this._layers},e.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(e,t){e.__dirty=e.__used=!1});function t(e){i&&(i.__endIndex!==e&&(i.__dirty=!0),i.__endIndex=e)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var r=e[n];if(r.zlevel!==e[n-1].zlevel||r.incremental){this._needsManuallyCompositing=!0;break}}var i=null,a=0,o,s;for(s=0;s<e.length;s++){var r=e[s],c=r.zlevel,l=void 0;o!==c&&(o=c,a=0),r.incremental?(l=this.getLayer(c+lI,this._needsManuallyCompositing),l.incremental=!0,a=1):l=this.getLayer(c+(a>0?cI:0),this._needsManuallyCompositing),l.__builtin__||it(`ZLevel `+c+` has been used by unkown layer `+l.id),l!==i&&(l.__used=!0,l.__startIndex!==s&&(l.__dirty=!0),l.__startIndex=s,l.incremental?l.__drawIndex=-1:l.__drawIndex=s,t(s),i=l),r.__dirty&1&&!r.__inHover&&(l.__dirty=!0,l.incremental&&l.__drawIndex<0&&(l.__drawIndex=s))}t(s),this.eachBuiltinLayer(function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)})},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,R(this._layers,function(e){e.setUnpainted()})},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?ot(n[e],t,!0):n[e]=t;for(var r=0;r<this._zlevelList.length;r++){var i=this._zlevelList[r];if(i===e||i===e+cI){var a=this._layers[i];ot(a,n[e],!0)}}}},e.prototype.delLayer=function(e){var t=this._layers,n=this._zlevelList,r=t[e];r&&(r.dom.parentNode.removeChild(r.dom),delete t[e],n.splice(lt(n,e),1))},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display=`none`;var r=this._opts,i=this.root;if(e!=null&&(r.width=e),t!=null&&(r.height=t),e=Ix(i,0,r),t=Ix(i,1,r),n.style.display=``,this._width!==e||t!==this._height){for(var a in n.style.width=e+`px`,n.style.height=t+`px`,this._layers)this._layers.hasOwnProperty(a)&&this._layers[a].resize(e,t);this.refresh(!0)}this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this.getLayer(sI).resize(e,t)}return this},e.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},e.prototype.dispose=function(){this.root.innerHTML=``,this.root=this.storage=this._domRoot=this._layers=null},e.prototype.getRenderedCanvas=function(e){if(e||={},this._singleCanvas&&!this._compositeManually)return this._layers[sI].dom;var t=new aI(`image`,this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var r=t.dom.width,i=t.dom.height;this.eachLayer(function(e){e.__builtin__?n.drawImage(e.dom,0,0,r,i):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())})}else for(var a={inHover:!1,viewWidth:this._width,viewHeight:this._height},o=this.storage.getDisplayList(!0),s=0,c=o.length;s<c;s++){var l=o[s];dS(n,l,a,s===c-1)}return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}();function pI(e){e.registerPainter(`canvas`,fI)}function mI(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}var hI=[`#6366f1`,`#f59e0b`,`#10b981`,`#ef4444`,`#8b5cf6`,`#ec4899`,`#06b6d4`,`#f97316`,`#14b8a6`,`#a855f7`,`#84cc16`,`#e879f9`,`#22d3ee`,`#fb923c`,`#34d399`,`#c084fc`,`#fbbf24`,`#2dd4bf`,`#f472b6`,`#a3e635`],gI={"gpt-5.4":`#f472b6`,"gpt-5-mini":`#fb7185`,"gpt-5.4-nano":`#fda4af`,"gpt-5.3-codex":`#f59e0b`,"gpt-5.3-codex-spark":`#fbbf24`,"gpt-5.2-codex":`#6366f1`,"gpt-5.2":`#818cf8`,"gpt-5.1-codex-mini":`#a78bfa`,"gpt-4.1":`#06b6d4`,"gpt-4.1-mini":`#14b8a6`,"gpt-4.1-nano":`#2dd4bf`,o3:`#a855f7`,"o3-mini":`#c084fc`,"o4-mini":`#e879f9`,"gpt-4o":`#ec4899`,"gpt-4o-mini":`#22d3ee`,"gpt-4-turbo":`#ef4444`,"gpt-4":`#f97316`,"gpt-3.5-turbo":`#84cc16`,unknown:`#475569`},_I={review:`#06b6d4`,exploration:`#f97316`,planning:`#eab308`,memory:`#ec4899`,generic:`#64748b`},vI={low:`#10b981`,medium:`#06b6d4`,high:`#f59e0b`,xhigh:`#a855f7`,"x-high":`#a855f7`,unknown:`#64748b`};function yI(e){if(!e)return`unknown`;let t=String(e).toLowerCase().trim().replace(/-/g,``);return t===`low`?`low`:t===`medium`?`medium`:t===`high`?`high`:t===`xhigh`?`xhigh`:t===`unknown`?`unknown`:t}function bI(e){return hI[mI(e)%hI.length]}function xI(e){let t=e.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!t)return`#ffffff`;let n=parseInt(t[1],16)/255,r=parseInt(t[2],16)/255,i=parseInt(t[3],16)/255;return .2126*n+.7152*r+.0722*i>.5?`#1f2937`:`#ffffff`}function SI(e,t,n){t/=100,n/=100;let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,o=0,s=0,c=0;e<60?(o=r,s=i):e<120?(o=i,s=r):e<180?(s=r,c=i):e<240?(s=i,c=r):e<300?(o=i,c=r):(o=r,c=i);let l=e=>Math.round((e+a)*255).toString(16).padStart(2,`0`);return`#`+l(o)+l(s)+l(c)}function CI(e){return gI[e]?gI[e]:SI(mI(e)%300,72,62)}function wI(e){return _I[e]||`#64748b`}function TI(e){return vI[yI(e)]??`#64748b`}function EI(e){if(e==null||!Number.isFinite(e))return`—`;let t=Math.abs(e);return t>=1e9?DI(e,1e9,`B`):t>=1e6?DI(e,1e6,`M`):t>=1e3?DI(e,1e3,`K`):Math.round(e).toLocaleString()}function DI(e,t,n){let r=e/t,i=Math.abs(r)>=100?0:1;return`${r.toFixed(i)}${n}`}var OI=`auto`,kI={speed:1,live:{frameIntervalMs:33,overviewHz:20,dayKeysPerEmit:1},main:{presentationDurationMs:220,chartAppearDurationMs:0,chartUpdateDurationMs:200,easing:`linear`,easingUpdate:`linear`},tail:{enabled:!0,startPercent:.5,durationMs:OI,durationScale:10,easing:`cubicOut`,overviewHz:10},daily:{chartAppearDurationMs:OI,chartUpdateDurationMs:60,easing:OI,easingUpdate:OI},bars:{chartAppearDurationMs:OI,chartUpdateDurationMs:20,easing:OI,easingUpdate:OI},donuts:{chartAppearDurationMs:OI,chartUpdateDurationMs:OI,easing:OI,easingUpdate:`linear`,seriesAnimation:!1},heatmap:{popDurationMs:380,settleThreshold:.998,intensityRiseThreshold:.08,whiteThreshold:.88,nearMaxRatio:.985},videoExport:{width:1080,height:864,fps:60,frontloadSettledFrameCount:1,introFadeEnabled:!0,introFadeStartOpacity:.95,introContentStartOpacity:.05,introFadeDurationMs:400,introFadeDelayMs:0,introFadeEasing:`cubicOut`,startHoldDurationMs:100,replayDurationMs:1e4,tailDurationMs:5e3,replayEasing:`cubicIn`,tailSourceFraction:.55,tailEasing:`cubicOut`,finalHoldDurationMs:5e3,finalFlashDurationMs:1e3,finalFlashMaxOpacity:.35,displayTweenStartMs:200,displayTweenBaseMs:240,displayTweenLateMs:420,displayTweenLateWindowMs:2200,barsChartUpdateDurationMs:50,barsChartTailUpdateDurationMs:240,donutsChartUpdateDurationMs:50,donutsChartTailUpdateDurationMs:240,supersampleScale:2,captureFormat:`png`,jpegQuality:92,crf:5,encoderPreset:`veryfast`}},AI={animationDuration:750,animationDurationUpdate:220,animationEasing:`cubicOut`,animationEasingUpdate:`cubicOut`},jI={show:!0,animationDuration:250,animationDurationUpdate:220,animationDelay:250,animationDelayUpdate:180,animationEasing:`cubicOut`,animationEasingUpdate:`cubicOut`},MI={...AI,animationDurationUpdate:200,animationDelayUpdate:0,animationEasingUpdate:`cubicOut`},NI={animationDuration:700,animationDurationUpdate:220,animationDelay:250,animationDelayUpdate:140,animationEasing:`cubicOut`,animationEasingUpdate:`cubicOut`},PI={...jI,animationDelay:950,animationDelayUpdate:360};function FI(e){return Number.isFinite(e)&&e>0?e:1}function II(e){return Math.max(0,Math.round(e/FI(kI.speed)))}function LI(e,t){return e===`auto`?II(t):e}function RI(e,t){return e===`auto`?t:e}function zI(e){return{animation:!0,animationDuration:LI(e.chartAppearDurationMs,kI.main.chartAppearDurationMs),animationDurationUpdate:LI(e.chartUpdateDurationMs,kI.main.chartUpdateDurationMs),animationEasing:RI(e.easing,kI.main.easing),animationEasingUpdate:RI(e.easingUpdate,kI.main.easingUpdate)}}var BI=II(kI.main.presentationDurationMs);function VI(e=0,t=!1){let n=BI,r=kI.tail;if(!t||!r?.enabled)return n;let i=Math.min(Math.max(r.startPercent??.9,0),.999),a=Math.min(Math.max(e||0,0),1);if(a<=i)return n;let o=(a-i)/Math.max(1-i,.001),s=r.durationMs===`auto`?Math.round(n*Math.max(r.durationScale||1,1)):r.durationMs;return Math.round(n+(s-n)*JI(o))}function HI(e=0,t=!1){let n=kI.tail;if(!t||!n?.enabled)return`linear`;let r=Math.min(Math.max(n.startPercent??.9,0),.999);return Math.min(Math.max(e||0,0),1)<=r?`linear`:n.easing||`cubicOut`}function UI(e=0,t=!1){let n=kI.tail;if(!t||!n?.enabled)return!1;let r=Math.min(Math.max(n.startPercent??.9,0),.999);return Math.min(Math.max(e||0,0),1)>r}zI({chartAppearDurationMs:OI,chartUpdateDurationMs:OI,easing:OI,easingUpdate:OI});var WI=zI(kI.daily),GI=zI(kI.bars),KI=zI(kI.donuts),qI=kI.donuts.seriesAnimation;function JI(e){return 1-(1-Math.min(Math.max(e,0),1))**3}function YI(e,t,n){return e+(t-e)*n}function XI(e){return Number.isFinite(e)?e:0}function ZI(e,t){return Array.isArray(e?.data)?e.data:Array.isArray(e)?e:e?.data?.[t]||e?.data?.total||[]}function QI(e,t){return t?.length?e===`d7`?t.slice(-7):e===`d30`?t.slice(-30):t:[]}function $I(e,t,n){return e.map(e=>({key:e?.[t]||``,label:e?.[n]||``,tokens:XI(e?.tokens)})).filter(e=>e.key)}function eL(e,t){let n=Array.isArray(e?.data)?e.data:Array.isArray(e)?e:[];if(!n.length)return{dates:[],series:[]};let r=QI(t,n.map(e=>e.date)),i=new Map(n.map(e=>[e.date,e])),a=new Set;for(let e of r){let t=i.get(e);for(let e of Object.keys(t?.by_model||{}))a.add(e)}return{dates:r,series:[...a].map(e=>({key:e,label:e,data:r.map(t=>XI(i.get(t)?.by_model?.[e]?.tokens))}))}}function tL(e){let t=e?.data&&typeof e.data==`object`?e.data:{},n={};for(let[e,r]of Object.entries(t))n[e]={tokens:XI(r?.tokens),elapsed:XI(r?.elapsed),cost:XI(r?.cost)};return n}function nL({overview:e,heatmap:t,daily:n,families:r,repos:i,models:a,range:o}){let s=e?.data;if(!s)return{ready:!0,stats:{tokens:0,elapsed:0,cost:0,sessions:0,enriched:0,priced:0,exactPriced:0,fallbackPriced:0,unpriced:0,days:1},topRepos:[],topFamilies:[],topModels:[],daily:{dates:[],series:[]},heatmap:{}};let c=s?.[o]||s?.total||{},l=c.coverage||{},u=XI(l.thread_rows??l.total),d=XI(l.root_sessions??c.total_sessions),f=XI(l.priced),p=XI(l.priced_exact),m=XI(l.priced_fallback),h=XI(l.unpriced??Math.max(u-f,0)),g=c.date_range,_=g?.from!=null&&g?.to!=null?Math.max(1,Math.ceil((g.to-g.from)/86400)):1;return{ready:!0,stats:{tokens:XI(c.total_tokens),elapsed:XI(c.total_elapsed_seconds),cost:XI(c.total_cost),sessions:d,enriched:XI(l.enriched),priced:f,exactPriced:p,fallbackPriced:m,unpriced:h,days:_},topRepos:$I(ZI(i,o).slice(0,6),`repo_label`,`repo_label`),topFamilies:$I(ZI(r,o),`family`,`family`),topModels:$I(ZI(a,o).slice(0,6),`model_name`,`model_name`),daily:eL(n,o),heatmap:tL(t)}}function rL(e,t,n){let r=new Map((e||[]).map(e=>[e.key,e])),i=new Map((t||[]).map(e=>[e.key,e])),a=[],o=new Set;for(let e of t||[])o.has(e.key)||(o.add(e.key),a.push(e.key));for(let t of e||[])o.has(t.key)||(o.add(t.key),a.push(t.key));let s=[];for(let e of a){let t=r.get(e),a=i.get(e),o=a?.label||t?.label||e,c=YI(XI(t?.tokens),XI(a?.tokens),n);c<=.001&&!a||s.push({key:e,label:o,tokens:c})}return s}function iL(e,t,n){let r=(t?.dates?.length?t.dates:e?.dates||[]).slice(),i=new Map((e?.series||[]).map(e=>[e.key,e])),a=new Map((t?.series||[]).map(e=>[e.key,e])),o=new Set([...i.keys(),...a.keys()]),s=[];for(let c of o){let o=i.get(c),l=a.get(c),u=new Map((o?.data||[]).map((t,n)=>[e?.dates?.[n],t])),d=new Map((l?.data||[]).map((e,n)=>[t?.dates?.[n],e])),f=r.map(e=>YI(XI(u.get(e)),XI(d.get(e)),n));f.every(e=>e<=.001)&&!l||s.push({key:c,label:l?.label||o?.label||c,data:f})}return{dates:r,series:s}}function aL(e,t,n){let r=new Set([...Object.keys(e||{}),...Object.keys(t||{})]),i={};for(let a of r){let r=e?.[a],o=t?.[a];i[a]={tokens:YI(XI(r?.tokens),XI(o?.tokens),n),elapsed:YI(XI(r?.elapsed),XI(o?.elapsed),n),cost:YI(XI(r?.cost),XI(o?.cost),n)}}return i}function oL(e,t,n){return{ready:t.ready,stats:{tokens:YI(XI(e?.stats?.tokens),XI(t?.stats?.tokens),n),elapsed:YI(XI(e?.stats?.elapsed),XI(t?.stats?.elapsed),n),cost:YI(XI(e?.stats?.cost),XI(t?.stats?.cost),n),sessions:YI(XI(e?.stats?.sessions),XI(t?.stats?.sessions),n),enriched:YI(XI(e?.stats?.enriched),XI(t?.stats?.enriched),n),priced:YI(XI(e?.stats?.priced),XI(t?.stats?.priced),n),exactPriced:YI(XI(e?.stats?.exactPriced),XI(t?.stats?.exactPriced),n),fallbackPriced:YI(XI(e?.stats?.fallbackPriced),XI(t?.stats?.fallbackPriced),n),unpriced:YI(XI(e?.stats?.unpriced),XI(t?.stats?.unpriced),n),days:XI(t?.stats?.days)||1},topRepos:rL(e?.topRepos,t?.topRepos,n),topFamilies:rL(e?.topFamilies,t?.topFamilies,n),topModels:rL(e?.topModels,t?.topModels,n),daily:iL(e?.daily,t?.daily,n),heatmap:aL(e?.heatmap,t?.heatmap,n)}}function sL(e,{duration:t=BI,onSettledChange:n,ingestProgress:r=0,isIngestActive:i=!1,clockNowMs:a=null}={}){let o=(0,b.useMemo)(()=>nL(e),[e.overview,e.heatmap,e.daily,e.families,e.repos,e.models,e.range]),[s,c]=(0,b.useState)(o),l=(0,b.useRef)(o),u=(0,b.useRef)(o),d=(0,b.useRef)(0),f=(0,b.useRef)(0),p=(0,b.useRef)(s),m=(0,b.useRef)(!0),h=(0,b.useRef)(n),g=(0,b.useRef)(0),_=(0,b.useRef)(o),v=(0,b.useRef)(o),y=(0,b.useRef)(`smooth`);(0,b.useEffect)(()=>{h.current=n},[n]);let x=e=>{m.current!==e&&(m.current=e,h.current?.(e))};(0,b.useEffect)(()=>{p.current=s},[s]);let S=e=>{l.current=e,u.current=e,p.current=e,c(e),x(!0),f.current=0,g.current=0,_.current=e,v.current=e},C=e=>{u.current=e,x(!1);let t=UI(r,i)?`tail`:`smooth`;y.current!==t&&(y.current=t,g.current=0),t===`tail`&&(_.current=l.current,v.current=e,g.current=0)},w=(e,n)=>{e<f.current&&(f.current=0,g.current=0,_.current=l.current,v.current=n),f.current||=e;let a=Math.max(1,e-f.current);f.current=e;let o=VI(r,i)||t,s=l.current,u=UI(r,i)?`tail`:`smooth`;y.current!==u&&(y.current=u,g.current=0);let d,m;if(u===`tail`){v.current!==n&&(_.current=s,v.current=n,g.current=e),g.current||=e;let t=Math.max(0,e-g.current),a=Math.min(1,t/Math.max(o,1)),c=cL(a,HI(r,i));d=oL(_.current,v.current,c),m=a>=1||lL(d,n)<=.002}else{let e=cL(1-Math.exp(-a/Math.max(o,1)),HI(r,i));d=oL(s,n,e),m=e>=.999||lL(d,n)<=.002}return l.current=d,m?(l.current=n,p.current=n,c(n),x(!0),g.current=0,_.current=n,v.current=n,n):(p.current=d,c(d),d)};return(0,b.useLayoutEffect)(()=>{if(a!=null){if(t<=0){S(o);return}C(o),w(a,o)}},[o,t,r,i,a]),(0,b.useEffect)(()=>{if(a!=null)return;if(u.current=o,t<=0){S(o);return}if(C(o),d.current)return;let e=t=>{if(w(t,u.current)===u.current&&m.current){d.current=0,f.current=0;return}d.current=requestAnimationFrame(e)};d.current=requestAnimationFrame(e)},[o,t,r,i,a]),(0,b.useEffect)(()=>()=>{d.current&&cancelAnimationFrame(d.current),d.current=0,f.current=0},[]),s}function cL(e,t){let n=Math.min(Math.max(e,0),1);return t===`cubicOut`?1-(1-n)**3:n}function lL(e,t){if(!e||!t)return 0;let n=Math.max(Math.abs((e.stats?.tokens||0)-(t.stats?.tokens||0)),Math.abs((e.stats?.elapsed||0)-(t.stats?.elapsed||0)),Math.abs((e.stats?.cost||0)-(t.stats?.cost||0)),Math.abs((e.stats?.sessions||0)-(t.stats?.sessions||0))),r=uL(e.topRepos,t.topRepos),i=uL(e.topFamilies,t.topFamilies),a=uL(e.topModels,t.topModels),o=dL(e.daily,t.daily);return Math.max(n,r,i,a,o)/Math.max(1,t.stats?.tokens||1)}function uL(e=[],t=[]){let n=new Map(e.map(e=>[e.key,e.tokens||0])),r=0;for(let e of t)r=Math.max(r,Math.abs((n.get(e.key)||0)-(e.tokens||0)));return r}function dL(e,t){let n=new Map((e?.series||[]).map(e=>[e.key,e])),r=0;for(let e of t?.series||[]){let t=n.get(e.key);for(let n=0;n<e.data.length;n+=1)r=Math.max(r,Math.abs((t?.data?.[n]||0)-(e.data[n]||0)))}return r}var fL=s((e=>{var t=Symbol.for(`react.transitional.element`);function n(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.jsx=n,e.jsxs=n})),$=s(((e,t)=>{t.exports=fL()}))();BE([Uk,dA,LN,QP,tF,DF,pI]);function pL(e){return EI(e)}function mL(e){return e==null?`—`:e>=1e3?`$`+(e/1e3).toFixed(1)+`K`:`$`+e.toFixed(2)}function hL(e){return e?(e/3600).toFixed(1)+`h`:`0h`}function gL(e,t=16){if(!e)return``;let n=String(e).split(/([-/])/).filter(Boolean),r=[``];for(let e of n){let n=r[r.length-1];if(!n.length||(n+e).length<=t){r[r.length-1]=n+e;continue}if(r.length===2){r[1]+=e;break}r.push(e)}return r.join(`
|
|
28
28
|
`)}function _L(e){return e<=7?{barWidth:`72%`,barMaxWidth:28}:e<=30?{barWidth:`54%`,barMaxWidth:18}:{barWidth:null,barMaxWidth:12}}function vL(e,t){return e.map(e=>{let n=t(e.key);return{name:e.label,value:e.tokens,itemStyle:{color:n},label:{show:!0,color:n},labelLine:{show:!0}}})}function yL(e){return e.length===1?e=>{let t=e.rect||{x:0,y:0,width:0,height:0},n=e.labelRect||{width:0,height:0};return{x:t.x+t.width+14,y:t.y+t.height/2-n.height/2,align:`left`,verticalAlign:`middle`,moveOverlap:`shiftY`,hideOverlap:!1}}:null}function bL({daily:e,exportMode:t=!1}){if(!e?.dates?.length)return(0,$.jsxs)(`div`,{className:`overview-daily-spark overview-daily-spark-empty`,children:[(0,$.jsx)(`span`,{className:`overview-daily-spark-title`,children:`Daily Usage`}),(0,$.jsx)(`span`,{className:`overview-daily-spark-empty-text`,children:`No daily data`})]});let{barWidth:n,barMaxWidth:r}=_L(e.dates.length),i={backgroundColor:`transparent`,...WI,tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},appendToBody:!0,confine:!0,formatter:e=>{if(!e?.length)return``;let t=`<b>${e[0].axisValue}</b><br/>`,n=0,r=[...e].filter(e=>e.value>0).sort((e,t)=>(t.value||0)-(e.value||0));for(let e of r)t+=`${e.marker} ${e.seriesName}: ${pL(e.value)}<br/>`,n+=e.value;return t+=`<b>Total: ${pL(n)}</b>`,t}},grid:{left:4,right:4,top:4,bottom:4},xAxis:{type:`category`,data:e.dates,show:!1},yAxis:{type:`value`,show:!1,scale:!1,min:0},series:e.series.map(e=>({name:e.label,type:`bar`,stack:`total`,data:e.data,itemStyle:{color:CI(e.key)},...n?{barWidth:n}:{},barMaxWidth:r}))};return(0,$.jsxs)(`div`,{className:`overview-daily-spark`,children:[(0,$.jsx)(`span`,{className:`overview-daily-spark-title`,children:`Daily Usage`}),(0,$.jsx)(`div`,{className:`overview-daily-spark-chart`,children:(0,$.jsx)(Me,{echarts:mO,option:i,style:{width:`100%`,height:`100%`},theme:`dark`,lazyUpdate:!1,notMerge:t})})]})}var xL=[{key:`tokens`,label:`Tokens`,fmt:pL},{key:`elapsed`,label:`Time`,fmt:e=>hL(e)},{key:`cost`,label:`Cost`,fmt:mL}],SL=kI.heatmap?.popDurationMs??380,CL=kI.heatmap?.settleThreshold??.998;function wL({heatmapData:e,isIngestActive:t=!1,ingestProgress:n=0}){let[r,i]=(0,b.useState)(`tokens`),[a,o]=(0,b.useState)(new Set),[s,c]=(0,b.useState)(new Set),l=(0,b.useRef)({}),u=(0,b.useRef)(1),d=e||{},f=new Date,p=[],m=[];for(let e=364;e>=0;e--){let t=new Date(f);t.setDate(t.getDate()-e);let n=t.toLocaleDateString(`en-CA`),i=d[n]&&d[n][r]||0;p.push({key:n,val:i,date:t}),t.getDate()===1&&m.push({idx:364-e,label:t.toLocaleDateString(`en-US`,{month:`short`})})}let h=Math.max(...p.map(e=>e.val),1);(0,b.useEffect)(()=>{if(!t||n>=CL){l.current={},u.current=1;return}let e=new Date,i=l.current,a=u.current,s=new Set,f=new Set,p=Math.max(.05,Math.min(a,h)*.002),m=kI.heatmap?.intensityRiseThreshold??.08,g=kI.heatmap?.whiteThreshold??.88,_=kI.heatmap?.nearMaxRatio??.985;for(let t=364;t>=0;t--){let n=new Date(e);n.setDate(n.getDate()-t);let o=n.toLocaleDateString(`en-CA`),c=d[o]&&d[o][r]||0,l=i[o]??0,u=a>0?l/a:0,v=h>0?c/h:0,y=h>a+p&&c>=h*_&&(l<h*_||l===void 0),b=v>=g&&u<g,x=c>l+p,S=v>u+m;y||b||x||S?s.add(o):(c<l-p||c>0&&a>0&&h>a+p&&u>=.85&&v<u-.02)&&f.add(o),i[o]=c}if(u.current=h,s.size>0||f.size>0){o(s),c(f);let e=setTimeout(()=>{o(new Set),c(new Set)},SL);return()=>clearTimeout(e)}},[d,r,t,n,h]);function g(e){if(e===0)return`var(--bg-elevated)`;let t=e/h,n=1/4;return t<n?`rgba(99, 102, 241, 0.14)`:t<2*n?`rgba(99, 102, 241, 0.38)`:t<3*n?`rgba(99, 102, 241, 0.62)`:t<1?`rgba(99, 102, 241, 0.88)`:`#fff`}let _=p[0]?.date.getDay()||0,v=Array(_).fill(null).concat(p);return(0,$.jsxs)(`div`,{className:`heatmap-wrap`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`0.75rem`},children:[(0,$.jsx)(`span`,{className:`chart-title`,children:`Activity`}),(0,$.jsx)(`div`,{className:`btn-group`,children:xL.map(e=>(0,$.jsx)(`button`,{className:`btn ${r===e.key?`active`:``}`,onClick:()=>i(e.key),children:e.label},e.key))})]}),(0,$.jsx)(`div`,{className:`heatmap-grid`,style:{gridTemplateRows:`repeat(7, 1fr)`},children:v.map((e,t)=>e?(0,$.jsx)(`div`,{className:`heatmap-cell ${e.val>0?`active`:``} ${a.has(e.key)?`heatmap-cell-pop`:``} ${s.has(e.key)?`heatmap-cell-pop-dim`:``}`,style:{background:g(e.val)},title:`${e.key}: ${xL.find(e=>e.key===r).fmt(e.val)}`},e.key):(0,$.jsx)(`div`,{className:`heatmap-cell`,style:{visibility:`hidden`}},`pad-${t}`))}),(0,$.jsx)(`div`,{className:`heatmap-labels`,children:m.slice(-12).map((e,t)=>(0,$.jsx)(`span`,{children:e.label},t))})]})}function TL({presentation:e,rawPresentation:t=null,ingestProgress:n=0,isIngestActive:r=!1,exportMode:i=!1,exportPlayback:a=!1,exportPhase:o=null}){if(!e?.ready)return null;let s=a&&o===`replay`&&t?.ready?t:e,c=r&&t?.heatmap?t.heatmap:e.heatmap,{stats:l,topRepos:u,topFamilies:d,topModels:f}=e,p=s.topRepos||[],m=s.topFamilies||[],h=s.topModels||[],g=[...p.slice(0,6)].reverse(),_=Math.max(...p.slice(0,6).map(e=>e.tokens||0),1),v=[...m].sort((e,t)=>String(e.label).localeCompare(String(t.label))),y=[...h.slice(0,6)].sort((e,t)=>String(e.label).localeCompare(String(t.label))),b=o===`tail`||o===`final_hold`?kI.videoExport?.barsChartTailUpdateDurationMs??kI.videoExport?.barsChartUpdateDurationMs??240:kI.videoExport?.barsChartUpdateDurationMs??30,x=o===`tail`||o===`final_hold`?kI.videoExport?.donutsChartTailUpdateDurationMs??kI.videoExport?.donutsChartUpdateDurationMs??240:kI.videoExport?.donutsChartUpdateDurationMs??30,S={backgroundColor:`transparent`,...GI,...i?{animation:!1}:{},...a?{animationDurationUpdate:b,animationEasingUpdate:`cubicOut`}:{},tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},appendToBody:!0,confine:!0,formatter:e=>e?.length?`${e[0].axisValue}: ${pL(e[0].value)} tokens`:``},grid:{left:100,right:5,top:5,bottom:5},xAxis:{type:`value`,show:!1,max:_||1},yAxis:{type:`category`,data:g.map(e=>e.label),axisLabel:{color:`#8b949e`,fontSize:11,formatter:e=>gL(e)},axisTick:{show:!1},axisLine:{show:!1}},series:[{type:`bar`,data:g.map(e=>{let t=e.tokens||0,n=t/_>=.7,r=bI(e.label);return{value:t,itemStyle:{color:r,borderRadius:[0,3,3,0]},label:{show:!0,position:n?`insideRight`:`right`,distance:5,offset:[0,1.5],formatter:()=>pL(t),color:n?xI(r):`#8b949e`,fontSize:10}}}),barWidth:`80%`}]},C=v.reduce((e,t)=>e+(t.tokens||0),0),w=v.filter(e=>C>0?(e.tokens||0)/C>=.01:!1),T=yL(w),E={backgroundColor:`transparent`,...KI,...i?{animation:!1}:{},...a?{animationDurationUpdate:x,animationEasingUpdate:`cubicOut`}:{},tooltip:{trigger:`item`,appendToBody:!0,confine:!0,formatter:e=>`${e.name}: ${pL(e.value)} tokens (${e.percent}%)`},series:[{type:`pie`,animation:i?!1:qI,avoidLabelOverlap:!T,radius:[`48%`,`72%`],center:[`50%`,`50%`],label:{show:!0,color:`#8b949e`,fontSize:11,formatter:`{b}`,alignTo:`edge`,edgeDistance:5,bleedMargin:5,distanceToLabelLine:5},labelLine:{lineStyle:{color:`#30363d`},length:8,length2:6},itemStyle:{borderColor:`#161b22`,borderWidth:2},...T?{labelLayout:T}:{},data:vL(w,wI)}]},D=y.reduce((e,t)=>e+(t.tokens||0),0),O=y.filter(e=>D>0?(e.tokens||0)/D>=.01:!1),k=yL(O),A={backgroundColor:`transparent`,...KI,...i?{animation:!1}:{},...a?{animationDurationUpdate:x,animationEasingUpdate:`cubicOut`}:{},tooltip:{trigger:`item`,appendToBody:!0,confine:!0,formatter:e=>`${e.name}: ${pL(e.value)} tokens (${e.percent}%)`},series:[{type:`pie`,animation:i?!1:qI,avoidLabelOverlap:!k,radius:[`48%`,`72%`],center:[`50%`,`50%`],label:{show:!0,color:`#8b949e`,fontSize:11,formatter:`{b}`,alignTo:`edge`,edgeDistance:5,bleedMargin:5,distanceToLabelLine:5},labelLine:{lineStyle:{color:`#30363d`},length:8,length2:6},itemStyle:{borderColor:`#161b22`,borderWidth:2},...k?{labelLayout:k}:{},data:vL(O,CI)}]};return(0,$.jsxs)(`div`,{className:`animate-in`,children:[(0,$.jsxs)(`div`,{className:`stat-row`,children:[(0,$.jsxs)(`div`,{className:`stat-cards`,children:[(0,$.jsxs)(`div`,{className:`stat-card`,children:[(0,$.jsx)(`div`,{className:`stat-label`,children:`Tokens`}),(0,$.jsx)(`div`,{className:`stat-value`,children:pL(l.tokens)}),(0,$.jsxs)(`div`,{className:`stat-per-day`,children:[(0,$.jsx)(`span`,{className:`stat-per-day-value`,children:pL(l.tokens/l.days)}),` per day`]})]}),(0,$.jsxs)(`div`,{className:`stat-card`,children:[(0,$.jsx)(`div`,{className:`stat-label`,children:`Agent Time`}),(0,$.jsx)(`div`,{className:`stat-value`,children:hL(l.elapsed)}),(0,$.jsxs)(`div`,{className:`stat-per-day`,children:[(0,$.jsx)(`span`,{className:`stat-per-day-value`,children:hL(l.elapsed/l.days)}),` per day`]})]}),(0,$.jsxs)(`div`,{className:`stat-card`,children:[(0,$.jsx)(`div`,{className:`stat-label`,children:`Est. API Cost`}),(0,$.jsx)(`div`,{className:`stat-value`,children:mL(l.cost)}),(0,$.jsxs)(`div`,{className:`stat-per-day`,children:[(0,$.jsx)(`span`,{className:`stat-per-day-value`,children:mL(l.cost/l.days)}),` per day`]})]}),(0,$.jsxs)(`div`,{className:`stat-card`,children:[(0,$.jsx)(`div`,{className:`stat-label`,children:`Sessions`}),(0,$.jsx)(`div`,{className:`stat-value`,children:Math.round(l.sessions).toLocaleString()}),(0,$.jsxs)(`div`,{className:`stat-per-day`,children:[(0,$.jsx)(`span`,{className:`stat-per-day-value`,children:(l.sessions/l.days).toFixed(1)}),` per day`]})]})]}),(0,$.jsx)(bL,{daily:e.daily,exportMode:i})]}),(0,$.jsx)(wL,{heatmapData:c,isIngestActive:r,ingestProgress:n}),(0,$.jsxs)(`div`,{className:`grid-3`,children:[(0,$.jsxs)(`div`,{className:`chart-card overview-donut-card`,children:[(0,$.jsx)(`div`,{className:`chart-title`,style:{marginBottom:`0.5rem`},children:`Top Repos`}),u.length>0?(0,$.jsx)(Me,{echarts:mO,option:S,style:{height:180},theme:`dark`,lazyUpdate:!1,notMerge:i}):(0,$.jsx)(`div`,{style:{color:`var(--text-muted)`,padding:`2rem 0`,textAlign:`center`},children:`No data`})]}),(0,$.jsxs)(`div`,{className:`chart-card overview-donut-card`,children:[(0,$.jsx)(`div`,{className:`chart-title`,style:{marginBottom:`0.5rem`},children:`Work Type`}),d.length>0?(0,$.jsx)(Me,{echarts:mO,option:E,style:{height:180},theme:`dark`,lazyUpdate:!1,notMerge:!0}):(0,$.jsx)(`div`,{style:{color:`var(--text-muted)`,padding:`2rem 0`,textAlign:`center`},children:`No data`})]}),(0,$.jsxs)(`div`,{className:`chart-card`,children:[(0,$.jsx)(`div`,{className:`chart-title`,style:{marginBottom:`0.5rem`},children:`Models`}),f.length>0?(0,$.jsx)(Me,{echarts:mO,option:A,style:{height:180},theme:`dark`,lazyUpdate:!1,notMerge:!0}):(0,$.jsx)(`div`,{style:{color:`var(--text-muted)`,padding:`2rem 0`,textAlign:`center`},children:`No data`})]})]}),(0,$.jsxs)(`div`,{className:`coverage-subtle`,children:[(0,$.jsx)(`span`,{style:{fontWeight:500},children:`Session coverage:`}),(0,$.jsxs)(`span`,{className:`coverage-item`,children:[(0,$.jsx)(`span`,{className:`coverage-dot`,style:{background:`#22c55e`}}),(0,$.jsx)(`span`,{className:`coverage-nums`,children:Math.round(l.exactPriced)}),` `,`exact-priced`]}),(0,$.jsxs)(`span`,{className:`coverage-item`,children:[(0,$.jsx)(`span`,{className:`coverage-dot`,style:{background:`#c084fc`}}),(0,$.jsx)(`span`,{className:`coverage-nums`,children:Math.round(l.fallbackPriced)}),` `,`fallback-priced`]}),(0,$.jsxs)(`span`,{className:`coverage-item`,children:[(0,$.jsx)(`span`,{className:`coverage-dot`,style:{background:`#64748b`}}),(0,$.jsx)(`span`,{className:`coverage-nums`,children:Math.round(l.unpriced)}),` `,`unpriced`]})]})]})}function EL({data:e,heatmap:t,daily:n,families:r,repos:i,models:a,range:o=`total`,onPresentationSettledChange:s=null,ingestProgress:c=0,isIngestActive:l=!1,clockNowMs:u=null}){return(0,$.jsx)(TL,{presentation:sL({overview:e,heatmap:t,daily:n,families:r,repos:i,models:a,range:o},{duration:BI,onSettledChange:s,ingestProgress:c,isIngestActive:l,clockNowMs:u}),rawPresentation:b.useMemo(()=>nL({overview:e,heatmap:t,daily:n,families:r,repos:i,models:a,range:o}),[e,t,n,r,i,a,o]),ingestProgress:c,isIngestActive:l})}function DL(e,t){return e.data===t.data&&e.heatmap===t.heatmap&&e.daily===t.daily&&e.families===t.families&&e.repos===t.repos&&e.models===t.models&&e.range===t.range&&e.onPresentationSettledChange===t.onPresentationSettledChange&&e.ingestProgress===t.ingestProgress&&e.isIngestActive===t.isIngestActive&&e.clockNowMs===t.clockNowMs}var OL=(0,b.memo)(EL,DL);function kL(e,t){return e===`default`?t:e}function AL(e,t=`tokens`){return Object.entries(e||{}).map(([e,t])=>({key:e,...t})).sort((e,n)=>(n[t]||0)-(e[t]||0))}function jL({title:e,rows:t,valueKey:n=`tokens`,colorForKey:r,valueFormatter:i,chartMode:a=`default`,defaultMode:o=`bar`,emptyLabel:s=`No data`,renderTitleInChart:c=!0,barLabelProgress:l=1}){let u=kL(a,o),d=(t||[]).map((e,t)=>{let n=e?.key??e?.repo_label??e?.model_name??e?.family??null;return n?{...e,key:String(n),_idx:t}:null}).filter(Boolean),f={xAxis:{show:!1},yAxis:{show:!1},series:[],graphic:{type:`text`,left:`center`,top:`60%`,style:{text:s,fill:`#484f58`,fontSize:11}}};if(c&&(f.title={text:e,left:`center`,top:`middle`,textStyle:{fontSize:12,color:`#484f58`,fontWeight:`normal`}}),!d.length)return f;if(u===`donut`){let t=d.reduce((e,t)=>e+(t[n]||0),0),a={backgroundColor:`transparent`,...MI,tooltip:{trigger:`item`,appendToBody:!0,confine:!0,formatter:e=>`${e.name}: ${i(e.value)} (${e.percent}%)`},series:[{type:`pie`,...MI,radius:[`40%`,`62%`],center:[`50%`,`52%`],label:{show:!0,color:`#8b949e`,fontSize:10,formatter:`{b}`,overflow:`truncate`,width:90,...jI},labelLine:{lineStyle:{color:`#30363d`}},itemStyle:{borderColor:`#161b22`,borderWidth:2},data:d.map(e=>{let i=e[n]||0,a=(t>0?i/t:0)>=.01;return{name:e.key,value:i,itemStyle:{color:r(e.key)},label:{show:a,color:r(e.key)},labelLine:{show:a}}})}]};return c&&(a.title={text:e,left:`center`,top:8,textStyle:{fontSize:11,color:`#8b949e`,fontWeight:`normal`}}),a}let p=[...d].reverse(),m=Math.max(...d.map(e=>e[n]||0),0),h={backgroundColor:`transparent`,...NI,tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},appendToBody:!0,confine:!0,formatter:e=>{let t=p[e?.[0]?.dataIndex];return t?`${t.key}: ${i(t[n]||0)}`:``}},grid:{left:65,right:50,top:c?35:20,bottom:20},xAxis:{type:`value`,splitNumber:4,max:m||1,axisLabel:{formatter:e=>i(e),color:`#484f58`,fontSize:10,showMinLabel:!0,showMaxLabel:!0},splitLine:{lineStyle:{color:[`transparent`,`#21262d`,`#21262d`,`#21262d`,`transparent`]}}},yAxis:{type:`category`,data:p.map(e=>e.key),axisLabel:{color:`#8b949e`,fontSize:10,overflow:`truncate`,width:55},axisTick:{show:!1},axisLine:{show:!1}},series:[{type:`bar`,data:p.map(e=>({value:e[n]||0,itemStyle:{color:r(e.key),borderRadius:[0,3,3,0]}})),barMaxWidth:14,label:{show:!0,position:`right`,formatter:e=>i((e.value??0)*l),color:`#8b949e`,fontSize:9,...PI}}]};return c&&(h.title={text:e,left:`center`,top:8,textStyle:{fontSize:11,color:`#8b949e`,fontWeight:`normal`}}),h}BE([Uk,dA,LN,QP,tF,pI]);function ML(e){return EI(e)}function NL(e){return e==null||e===0?`—`:e>=1e3?`$`+(e/1e3).toFixed(1)+`K`:`$`+e.toFixed(2)}var PL=[`all`,`review`,`exploration`,`planning`,`memory`,`generic`],FL=[`review`,`exploration`,`planning`,`memory`,`generic`];function IL(e){if(!e.current)return;let t=e.current.getEchartsInstance().getDataURL({type:`png`,pixelRatio:2,backgroundColor:`#06080f`});Object.assign(document.createElement(`a`),{href:t,download:`codexmeter-repos.png`}).click()}function LL(e,t=`total`){let n=e?.data;return Array.isArray(n)?n:n?.[t]||n?.total||[]}function RL({repo:e,chartMode:t}){let[n,r]=(0,b.useState)(!1),i=(0,b.useMemo)(()=>AL(e.by_model),[e.by_model]),a=(0,b.useMemo)(()=>AL(e.by_family),[e.by_family]),o=jL({title:`Models in repo`,rows:i,valueKey:`tokens`,colorForKey:CI,valueFormatter:ML,chartMode:t,defaultMode:`donut`,renderTitleInChart:!1}),s=jL({title:`Work type in repo`,rows:a,valueKey:`tokens`,colorForKey:wI,valueFormatter:ML,chartMode:t,defaultMode:`donut`,renderTitleInChart:!1}),c=[...i.slice(0,4).map(e=>({...e,scope:`model`})),...a.slice(0,4).map(e=>({...e,scope:`family`}))];return(0,$.jsxs)(`div`,{className:`model-detail-wrap`,children:[(0,$.jsxs)(`div`,{className:`model-detail-charts`,children:[(0,$.jsxs)(`div`,{className:`model-detail-donut`,children:[(0,$.jsx)(`div`,{className:`chart-title`,style:{marginBottom:`0.5rem`},children:`Models in repo`}),(0,$.jsx)(Me,{echarts:mO,option:o,style:{width:`100%`,height:`100%`},theme:`dark`,lazyUpdate:!0,notMerge:!1})]}),(0,$.jsxs)(`div`,{className:`model-detail-donut`,children:[(0,$.jsx)(`div`,{className:`chart-title`,style:{marginBottom:`0.5rem`},children:`Work type in repo`}),(0,$.jsx)(Me,{echarts:mO,option:s,style:{width:`100%`,height:`100%`},theme:`dark`,lazyUpdate:!0,notMerge:!1})]})]}),(0,$.jsx)(`div`,{className:`model-detail-footer`,children:(0,$.jsxs)(`button`,{type:`button`,className:`model-detail-toggle`,onClick:()=>r(e=>!e),"aria-expanded":n,children:[(0,$.jsx)(`span`,{className:`model-detail-toggle-text`,children:n?`Hide details`:`Show details`}),(0,$.jsx)(`span`,{className:`model-detail-toggle-arrow ${n?`expanded`:``}`,"aria-hidden":!0,children:`▼`})]})}),(0,$.jsx)(`div`,{className:`model-detail-summary-wrap ${n?`expanded`:``}`,children:(0,$.jsx)(`div`,{className:`model-detail-summary`,children:c.map(e=>(0,$.jsxs)(`div`,{className:`model-detail-summary-card`,children:[(0,$.jsxs)(`div`,{className:`model-detail-summary-head`,children:[(0,$.jsx)(`span`,{className:`model-detail-swatch`,style:{background:e.scope===`model`?CI(e.key):wI(e.key)}}),(0,$.jsx)(`span`,{className:`model-detail-summary-name`,title:e.key,children:e.key})]}),(0,$.jsxs)(`div`,{className:`model-detail-summary-line`,children:[ML(e.tokens),` tokens`]}),(0,$.jsxs)(`div`,{className:`model-detail-summary-line`,children:[e.sessions||0,` sessions`]}),(0,$.jsx)(`div`,{className:`model-detail-summary-line`,children:NL(e.cost)})]},`${e.scope}-${e.key}`))})})]})}function zL({data:e,range:t=`total`,chartMode:n=`default`}){let[r,i]=(0,b.useState)(`all`),[a,o]=(0,b.useState)(null),s=(0,b.useRef)(null),c=(0,b.useMemo)(()=>LL(e,t),[e,t]),l=(0,b.useMemo)(()=>c?.length?r===`all`?c:c.map(e=>{let t=e.by_family?.[r];return t?{...e,tokens:t.tokens,cost:t.cost,sessions:t.sessions}:null}).filter(Boolean).sort((e,t)=>t.tokens-e.tokens):[],[c,r]);if((0,b.useEffect)(()=>{a&&(l.some(e=>e.repo_key===a)||o(null))},[a,l]),!c?.length)return(0,$.jsx)(`div`,{style:{color:`var(--text-muted)`,padding:`2rem`},children:`No data`});let u=l.slice(0,15),d=[...u].reverse(),f=Math.max(...u.map(e=>e.tokens||0),0),p=Math.max(250,u.length*28),m=(0,b.useMemo)(()=>({backgroundColor:`transparent`,...AI,tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},appendToBody:!0,confine:!0,formatter:e=>{let t=u[u.length-1-e[0].dataIndex];return t?`<b>${t.repo_label}</b><br/>Tokens: ${ML(t.tokens)}<br/>Cost: ${NL(t.cost)}<br/>Sessions: ${t.sessions}`:``}},grid:{left:150,right:50,top:8,bottom:8},xAxis:{type:`value`,splitNumber:4,max:f||1,axisLabel:{formatter:e=>ML(e),color:`#484f58`,showMinLabel:!0,showMaxLabel:!0},splitLine:{lineStyle:{color:[`transparent`,`#21262d`,`#21262d`,`#21262d`,`transparent`]}}},yAxis:{type:`category`,data:d.map(e=>e.repo_label),axisLabel:{color:`#8b949e`,fontSize:11},axisTick:{show:!1},axisLine:{show:!1}},series:[{id:`repos-range-bars`,type:`bar`,universalTransition:!0,data:d.map(e=>({id:e.repo_key,name:e.repo_label,value:e.tokens,itemStyle:{color:bI(e.repo_label),borderRadius:[0,3,3,0]}})),barMaxWidth:16,label:{show:!0,position:`right`,formatter:e=>ML(e.value??0),color:`#8b949e`,fontSize:10,...jI}}]}),[f,d,u]),h=(0,b.useMemo)(()=>({click:e=>{if(e?.componentType===`series`&&e?.dataIndex!=null){let t=u[u.length-1-e.dataIndex];t&&o(e=>e===t.repo_key?null:t.repo_key)}}}),[u]);return(0,$.jsxs)(`div`,{className:`animate-in`,children:[(0,$.jsxs)(`div`,{className:`section-header`,children:[(0,$.jsx)(`span`,{className:`section-title`,children:`Repos`}),(0,$.jsx)(`div`,{className:`btn-group`,children:PL.map(e=>(0,$.jsx)(`button`,{className:`btn ${r===e?`active`:``}`,onClick:()=>i(e),children:e},e))})]}),(0,$.jsxs)(`div`,{className:`chart-card`,children:[(0,$.jsx)(`button`,{className:`export-btn`,onClick:()=>IL(s),children:`PNG`}),(0,$.jsx)(`div`,{style:{height:p,transition:`height 220ms cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,$.jsx)(Me,{ref:s,echarts:mO,option:m,style:{height:`100%`},theme:`dark`,lazyUpdate:!0,notMerge:!1,onEvents:h})})]}),(0,$.jsx)(`div`,{className:`table-wrap`,children:(0,$.jsxs)(`table`,{children:[(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{children:[(0,$.jsx)(`th`,{children:`Repo`}),(0,$.jsx)(`th`,{children:`Tokens`}),(0,$.jsx)(`th`,{children:`Cost`}),(0,$.jsx)(`th`,{children:`Sessions`}),(0,$.jsx)(`th`,{style:{width:200},children:`Families`})]})}),(0,$.jsx)(`tbody`,{children:l.map(e=>(0,$.jsxs)(b.Fragment,{children:[(0,$.jsxs)(`tr`,{onClick:()=>o(a===e.repo_key?null:e.repo_key),style:{cursor:`pointer`},children:[(0,$.jsxs)(`td`,{style:{fontWeight:500,color:`var(--text-primary)`},children:[(0,$.jsx)(`span`,{style:{display:`inline-block`,width:8,height:8,borderRadius:2,background:bI(e.repo_label),marginRight:8}}),e.repo_label]}),(0,$.jsx)(`td`,{style:{fontFamily:`var(--font-mono)`},children:ML(e.tokens)}),(0,$.jsx)(`td`,{style:{fontFamily:`var(--font-mono)`},children:NL(e.cost)}),(0,$.jsx)(`td`,{children:e.sessions}),(0,$.jsx)(`td`,{children:Object.entries(e.by_family||{}).sort(([e],[t])=>{let n=FL.indexOf(e),r=FL.indexOf(t);return(n===-1?999:n)-(r===-1?999:r)}).slice(0,3).map(([e])=>(0,$.jsx)(`span`,{className:`tag tag-${e}`,style:{marginRight:3},children:e},e))})]}),a===e.repo_key&&(0,$.jsx)(`tr`,{children:(0,$.jsx)(`td`,{colSpan:5,style:{background:`var(--bg-surface)`,padding:`0.75rem 1rem`},children:(0,$.jsx)(RL,{repo:e,chartMode:n})})})]},e.repo_key))})]})})]})}BE([Uk,dA,LN,QP,tF,pI]);function BL(e){return EI(e)}function VL(e){return e==null||e===0?`—`:e>=1e3?`$`+(e/1e3).toFixed(1)+`K`:`$`+e.toFixed(2)}var HL=[`low`,`medium`,`high`,`xhigh`,`unknown`];function UL(e){return[...e].sort(([e],[t])=>{let n=HL.indexOf((e||``).toLowerCase()),r=HL.indexOf((t||``).toLowerCase());return(n===-1?999:n)-(r===-1?999:r)})}function WL({model:e,fmt:t,chartMode:n}){let[r,i]=(0,b.useState)(!1),a=(0,b.useMemo)(()=>UL(Object.entries(e.by_effort||{})),[e.by_effort]);if(!a.length)return null;let o=a.map(([e,t])=>({effort:e,sessions:t.sessions,tokens:t.tokens,avgTokens:t.sessions?Math.round(t.tokens/t.sessions):0,cost:t.cost,exactPriced:t.exact_priced||0,fallbackPriced:t.heuristic_priced||0})),s=o.map(e=>({key:e.effort,sessions:e.sessions,tokens:e.tokens,avgTokens:e.avgTokens})),c=jL({title:`Sessions by effort`,rows:s,valueKey:`sessions`,colorForKey:TI,valueFormatter:e=>Math.round(e).toLocaleString(),chartMode:n,defaultMode:`donut`,renderTitleInChart:!1}),l=jL({title:`Tokens by effort`,rows:s,valueKey:`tokens`,colorForKey:TI,valueFormatter:t,chartMode:n,defaultMode:`donut`,renderTitleInChart:!1}),u=jL({title:`Avg tokens per session`,rows:s,valueKey:`avgTokens`,colorForKey:TI,valueFormatter:t,chartMode:n,defaultMode:`bar`,renderTitleInChart:!1});return(0,$.jsxs)(`div`,{className:`model-detail-wrap`,children:[(0,$.jsxs)(`div`,{className:`model-detail-charts`,children:[(0,$.jsxs)(`div`,{className:`model-detail-donut`,children:[(0,$.jsx)(`div`,{className:`chart-title`,style:{marginBottom:`0.5rem`},children:`Sessions by effort`}),(0,$.jsx)(Me,{echarts:mO,option:c,style:{width:`100%`,height:`100%`},theme:`dark`,lazyUpdate:!0,notMerge:!1})]}),(0,$.jsxs)(`div`,{className:`model-detail-donut`,children:[(0,$.jsx)(`div`,{className:`chart-title`,style:{marginBottom:`0.5rem`},children:`Tokens by effort`}),(0,$.jsx)(Me,{echarts:mO,option:l,style:{width:`100%`,height:`100%`},theme:`dark`,lazyUpdate:!0,notMerge:!1})]}),(0,$.jsxs)(`div`,{className:`model-detail-bar`,children:[(0,$.jsx)(`div`,{className:`chart-title`,style:{marginBottom:`0.5rem`},children:`Avg tokens per session`}),(0,$.jsx)(Me,{echarts:mO,option:u,style:{width:`100%`,height:`100%`},theme:`dark`,lazyUpdate:!0,notMerge:!1})]})]}),(0,$.jsx)(`div`,{className:`model-detail-footer`,children:(0,$.jsxs)(`button`,{type:`button`,className:`model-detail-toggle`,onClick:()=>i(e=>!e),"aria-expanded":r,children:[(0,$.jsx)(`span`,{className:`model-detail-toggle-text`,children:r?`Hide details`:`Show details`}),(0,$.jsx)(`span`,{className:`model-detail-toggle-arrow ${r?`expanded`:``}`,"aria-hidden":!0,children:`▼`})]})}),(0,$.jsx)(`div`,{className:`model-detail-summary-wrap ${r?`expanded`:``}`,children:(0,$.jsx)(`div`,{className:`model-detail-summary`,children:o.map(e=>(0,$.jsxs)(`div`,{className:`model-detail-summary-card`,children:[(0,$.jsxs)(`div`,{className:`model-detail-summary-head`,children:[(0,$.jsx)(`span`,{className:`model-detail-swatch`,style:{background:TI(e.effort)}}),(0,$.jsx)(`span`,{className:`model-detail-summary-name`,title:e.effort,children:e.effort})]}),(0,$.jsxs)(`div`,{className:`model-detail-summary-line`,children:[e.sessions,` sessions`]}),(0,$.jsxs)(`div`,{className:`model-detail-summary-line`,children:[t(e.tokens),` tokens`]}),(0,$.jsxs)(`div`,{className:`model-detail-summary-line`,children:[t(e.avgTokens),` avg/session`]}),(0,$.jsxs)(`div`,{className:`model-detail-summary-line`,children:[VL(e.cost),` cost`]}),(0,$.jsxs)(`div`,{className:`model-detail-summary-line`,children:[e.exactPriced,` exact · `,e.fallbackPriced,` fallback`]})]},e.effort))})})]})}function GL(e){if(!e.current)return;let t=e.current.getEchartsInstance().getDataURL({type:`png`,pixelRatio:2,backgroundColor:`#06080f`});Object.assign(document.createElement(`a`),{href:t,download:`codexmeter-models.png`}).click()}function KL(e,t=`total`){let n=e?.data;return Array.isArray(n)?n:n?.[t]||n?.total||[]}function qL({data:e,range:t=`total`,chartMode:n=`default`}){let[r,i]=(0,b.useState)(null),a=(0,b.useRef)(null),o=(0,b.useMemo)(()=>KL(e,t),[e,t]);if((0,b.useEffect)(()=>{r&&(o.some(e=>e.model_name===r)||i(null))},[r,o]),!o?.length)return(0,$.jsx)(`div`,{style:{color:`var(--text-muted)`,padding:`2rem`},children:`No data`});let s=[...o].reverse(),c=Math.max(...o.map(e=>e.tokens||0),0),l=Math.max(180,o.length*34),u=(0,b.useMemo)(()=>({backgroundColor:`transparent`,...AI,tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},appendToBody:!0,confine:!0,formatter:e=>{let t=o[o.length-1-e[0].dataIndex];return`<b>${t.model_name}</b><br/>Tokens: ${BL(t.tokens)}<br/>Cost: ${VL(t.cost)}<br/>Sessions: ${t.sessions}`}},grid:{left:160,right:50,top:8,bottom:8},xAxis:{type:`value`,splitNumber:4,max:c||1,axisLabel:{formatter:e=>BL(e),color:`#484f58`,fontSize:10,showMinLabel:!0,showMaxLabel:!0},splitLine:{lineStyle:{color:[`transparent`,`#21262d`,`#21262d`,`#21262d`,`transparent`]}}},yAxis:{type:`category`,data:s.map(e=>e.model_name),axisLabel:{color:`#8b949e`,fontSize:11},axisTick:{show:!1},axisLine:{show:!1}},series:[{id:`models-range-bars`,type:`bar`,universalTransition:!0,data:s.map(e=>({id:e.model_name,name:e.model_name,value:e.tokens,itemStyle:{color:CI(e.model_name),borderRadius:[0,3,3,0]}})),barMaxWidth:18,label:{show:!0,position:`right`,formatter:e=>BL(e.value??0),color:`#8b949e`,fontSize:10,...jI}}]}),[c,o,s]),d=(0,b.useMemo)(()=>({click:e=>{if(e?.componentType===`series`&&e?.dataIndex!=null){let t=o[o.length-1-e.dataIndex];t&&i(e=>e===t.model_name?null:t.model_name)}}}),[o]);return(0,$.jsxs)(`div`,{className:`animate-in`,children:[(0,$.jsx)(`div`,{className:`section-header`,children:(0,$.jsx)(`span`,{className:`section-title`,children:`Models`})}),(0,$.jsxs)(`div`,{className:`chart-card`,children:[(0,$.jsx)(`button`,{className:`export-btn`,onClick:()=>GL(a),children:`PNG`}),(0,$.jsx)(`div`,{style:{height:l,transition:`height 220ms cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,$.jsx)(Me,{ref:a,echarts:mO,option:u,style:{height:`100%`},theme:`dark`,lazyUpdate:!0,notMerge:!1,onEvents:d})})]}),(0,$.jsx)(`div`,{className:`table-wrap`,children:(0,$.jsxs)(`table`,{children:[(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{children:[(0,$.jsx)(`th`,{children:`Model`}),(0,$.jsx)(`th`,{children:`Tokens`}),(0,$.jsx)(`th`,{children:`Cost`}),(0,$.jsx)(`th`,{children:`Sessions`}),(0,$.jsx)(`th`,{children:`Effort Levels`})]})}),(0,$.jsx)(`tbody`,{children:o.map(e=>(0,$.jsxs)(b.Fragment,{children:[(0,$.jsxs)(`tr`,{onClick:()=>i(r===e.model_name?null:e.model_name),style:{cursor:`pointer`},children:[(0,$.jsxs)(`td`,{style:{fontWeight:500,color:`var(--text-primary)`,fontFamily:`var(--font-mono)`},children:[(0,$.jsx)(`span`,{style:{display:`inline-block`,width:8,height:8,borderRadius:2,background:CI(e.model_name),marginRight:8}}),e.model_name]}),(0,$.jsx)(`td`,{style:{fontFamily:`var(--font-mono)`},children:BL(e.tokens)}),(0,$.jsx)(`td`,{style:{fontFamily:`var(--font-mono)`},children:VL(e.cost)}),(0,$.jsx)(`td`,{children:e.sessions}),(0,$.jsx)(`td`,{children:Object.keys(e.by_effort).length})]}),r===e.model_name&&(0,$.jsx)(`tr`,{children:(0,$.jsx)(`td`,{colSpan:5,style:{background:`var(--bg-surface)`,padding:`0.75rem 1rem`},children:(0,$.jsx)(WL,{model:e,fmt:BL,chartMode:n})})})]},e.model_name))})]})})]})}BE([Uk,lk,dA,LN,QP,tF,DF,rI,tP,pI]);function JL(e){return EI(e)}function YL(e){return e==null||e===0?`$0`:`$`+e.toFixed(2)}function XL(e){return e?(e/3600).toFixed(1)+`h`:`0h`}var ZL=[{key:`tokens`,label:`Tokens`,fn:JL},{key:`elapsed_seconds`,label:`Time`,fn:XL},{key:`cost`,label:`Cost`,fn:YL}],QL=[{key:`model`,label:`By Model`},{key:`family`,label:`By Work`}],$L=[{key:`absolute`,label:`Absolute`},{key:`relative`,label:`Relative`}];function eR(e){if(!e.current)return;let t=e.current.getEchartsInstance().getDataURL({type:`png`,pixelRatio:2,backgroundColor:`#06080f`});Object.assign(document.createElement(`a`),{href:t,download:`codexmeter-daily.png`}).click()}function tR(e,t){return t?e===`d7`?Math.max(0,100-7/t*100):e===`d30`?Math.max(0,100-30/t*100):0:0}function nR(e,t){return e===`d7`?44:e===`d30`?22:t<=14?36:t<=31?18:14}function rR(e,t){return e===`d7`?`72%`:e===`d30`?`54%`:t<=14?`64%`:t<=31?`48%`:`36%`}function iR(e,t){let n=e.length;if(n===0)return null;let r=Array(n),i=Array(n),a=[];for(let t=0;t<n;t++){for(;a.length&&e[a[a.length-1]]>=e[t];)a.pop();r[t]=a.length?a[a.length-1]:-1,a.push(t)}a.length=0;for(let t=n-1;t>=0;t--){for(;a.length&&e[a[a.length-1]]>=e[t];)a.pop();i[t]=a.length?a[a.length-1]:n,a.push(t)}let o=0,s=0;for(let t=0;t<n;t++){let n=(i[t]-r[t]-1)*e[t];n>o&&(o=n,s=t)}return[(r[s]+i[s])/2,t[s]+e[s]/2]}function aR({day:e,chartMode:t}){let n=(0,b.useMemo)(()=>AL(e.by_model),[e.by_model]),r=(0,b.useMemo)(()=>AL(e.by_repo),[e.by_repo]),i=(0,b.useMemo)(()=>AL(e.by_family),[e.by_family]),a=jL({title:`Models`,rows:n,valueKey:`tokens`,colorForKey:CI,valueFormatter:JL,chartMode:t,defaultMode:`donut`,renderTitleInChart:!1}),o=jL({title:`Repos`,rows:r,valueKey:`tokens`,colorForKey:bI,valueFormatter:JL,chartMode:t,defaultMode:`donut`,renderTitleInChart:!1}),s=jL({title:`Work Type`,rows:i,valueKey:`tokens`,colorForKey:wI,valueFormatter:JL,chartMode:t,defaultMode:`donut`,renderTitleInChart:!1});return(0,$.jsx)(`div`,{className:`model-detail-wrap`,children:(0,$.jsxs)(`div`,{className:`model-detail-charts`,children:[(0,$.jsxs)(`div`,{className:`model-detail-donut`,children:[(0,$.jsx)(`div`,{className:`chart-title`,style:{marginBottom:`0.5rem`},children:`Repos`}),(0,$.jsx)(Me,{echarts:mO,option:o,style:{width:`100%`,height:`100%`},theme:`dark`,lazyUpdate:!0,notMerge:!1})]}),(0,$.jsxs)(`div`,{className:`model-detail-donut`,children:[(0,$.jsx)(`div`,{className:`chart-title`,style:{marginBottom:`0.5rem`},children:`Models`}),(0,$.jsx)(Me,{echarts:mO,option:a,style:{width:`100%`,height:`100%`},theme:`dark`,lazyUpdate:!0,notMerge:!1})]}),(0,$.jsxs)(`div`,{className:`model-detail-donut`,children:[(0,$.jsx)(`div`,{className:`chart-title`,style:{marginBottom:`0.5rem`},children:`Work Type`}),(0,$.jsx)(Me,{echarts:mO,option:s,style:{width:`100%`,height:`100%`},theme:`dark`,lazyUpdate:!0,notMerge:!1})]})]})})}var oR=b.memo(function({daily:e,range:t,metric:n,split:r,displayMode:i,onSelectDate:a}){let[o,s]=(0,b.useState)({start:0,end:100}),c=(0,b.useRef)(null),l=e.map(e=>e.date),u=ZL.find(e=>e.key===n),d=(0,b.useMemo)(()=>tR(t,l.length),[t,l.length]);(0,b.useEffect)(()=>{s({start:d,end:100})},[d]);let f=(0,b.useMemo)(()=>{if(!l.length)return 0;let e=Math.max(0,Math.min(100,o.start??d)),t=Math.max(e,Math.min(100,o.end??100)),n=Math.max(0,Math.floor(e/100*l.length)),r=Math.min(l.length-1,Math.ceil(t/100*l.length)-1);return Math.max(1,r-n+1)},[l.length,o,d]),p=(0,b.useMemo)(()=>nR(t,f),[t,f]),m=(0,b.useMemo)(()=>rR(t,f),[t,f]),h=(0,b.useMemo)(()=>{let t=new Set;for(let n of e){let e=r===`model`?n.by_model:n.by_family||{};for(let n of Object.keys(e))t.add(n)}return[...t]},[e,r]),g=(0,b.useMemo)(()=>h.map(t=>({name:t,values:e.map(e=>{let i=(r===`model`?e.by_model:e.by_family||{})[t];return i?n===`elapsed_seconds`?i.elapsed_seconds||0:n===`cost`?i.cost||0:i.tokens||0:0})})),[h,e,r,n]),_=(0,b.useMemo)(()=>e.map((e,t)=>{let n=0;for(let e of g)n+=e.values[t]||0;return n}),[e,g]),v=(0,b.useMemo)(()=>Math.max(..._,0),[_]),y=i===`relative`,x=null;if(y){let e=g.map(e=>{let t=e.values.map((e,t)=>_[t]>0?e/_[t]*100:0);for(let e=1;e<t.length;e++)_[e]===0&&(t[e]=t[e-1]);return t}),t=e[0].map(()=>0);x=e.map((e,n)=>{let r=[...t];return t=t.map((t,n)=>t+e[n]),{values:e,prevStack:r}})}let S=g.map((e,t)=>{let n=r===`model`?CI(e.name):wI(e.name),i;if(y){let r=x[t];i=r.values,xI(n);let a=0,o=0;for(let e=0;e<i.length;e++)i[e]>o&&(o=i[e],a=e);return o>=8&&r.prevStack[a]+i[a]/2,{name:e.name,type:`line`,stack:`total`,smooth:.2,areaStyle:{opacity:1},lineStyle:{width:0},symbol:`none`,data:i,itemStyle:{color:n}}}return i=e.values,{name:e.name,type:`bar`,stack:`total`,data:i,itemStyle:{color:n},barWidth:m,barMaxWidth:p,barMinWidth:Math.min(10,p)}}),C=(0,b.useMemo)(()=>!y||!x?[]:x.map((e,t)=>{let n=g[t],i=xI(r===`model`?CI(n.name):wI(n.name)),a=iR(e.values,e.prevStack);return!a||Math.max(...e.values)<8?null:{name:n.name,labelColor:i,coord:a}}).filter(Boolean),[y,x,g,r]),w=(0,b.useCallback)(()=>{if(!c.current)return;let e=c.current.getEchartsInstance();if(!y||C.length===0){e.setOption({graphic:{elements:[]}},{notMerge:!1});return}let t=C.map(t=>{let[n,r]=e.convertToPixel({xAxisIndex:0,yAxisIndex:0},t.coord);return{type:`text`,left:n,top:r,style:{text:t.name,fill:t.labelColor,fontSize:10,fontWeight:500,textAlign:`center`,textVerticalAlign:`middle`},z:10,silent:!0}});e.setOption({graphic:{elements:t}},{notMerge:!1})},[y,C]);(0,b.useEffect)(()=>{let e=setTimeout(w,150);return()=>clearTimeout(e)},[y,C,w]),(0,b.useEffect)(()=>{let e=()=>w();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[w]);let T={backgroundColor:`transparent`,tooltip:{trigger:`axis`,axisPointer:{type:y?`line`:`shadow`},appendToBody:!0,confine:!0,formatter:e=>{let t=e?.[0]?.dataIndex,n=t==null?0:_[t],r=t;if(i===`relative`&&n===0&&t!=null){for(let e=t-1;e>=0;e--)if(_[e]>0){r=e;break}}let a=i===`relative`&&n===0?_[r]??0:n,o=`<b>${e[0].axisValue}</b><br/>`,s=[...e].filter(e=>e.seriesName!==`__day_click_overlay__`&&e.value>0).sort((e,t)=>(t.value||0)-(e.value||0));for(let e of s){let t=i===`relative`?g.find(t=>t.name===e.seriesName)?.values[r]??0:e.value;i===`relative`?o+=`${e.marker} ${e.seriesName}: ${e.value.toFixed(1)}% (${u.fn(t)})<br/>`:o+=`${e.marker} ${e.seriesName}: ${u.fn(e.value)}<br/>`}return o+=i===`relative`?`<b>Total: 100% (${u.fn(a)})</b>`:`<b>Total: ${u.fn(n)}</b>`,o}},legend:{data:h,textStyle:{color:`#8b949e`,fontSize:10},top:0,itemWidth:10,itemHeight:10},grid:{left:70,right:20,top:35,bottom:55},dataZoom:[{type:`slider`,start:o.start,end:o.end,borderColor:`#30363d`,fillerColor:`rgba(99, 102, 241, 0.08)`,handleStyle:{color:`#6366f1`},textStyle:{color:`#484f58`}}],xAxis:{type:`category`,data:l,axisLabel:{color:`#484f58`,fontSize:10,rotate:45},axisTick:{show:!1},axisLine:{lineStyle:{color:`#30363d`}}},yAxis:{type:`value`,min:i===`relative`?0:void 0,max:i===`relative`?100:void 0,axisLabel:{formatter:i===`relative`?e=>e+`%`:e=>u.fn(e),color:`#484f58`},splitLine:{lineStyle:{color:`#21262d`}}},series:[...S,{name:`__day_click_overlay__`,type:`bar`,data:_.map(()=>i===`relative`?100:v),barWidth:`96%`,barGap:`-100%`,itemStyle:{color:`rgba(0,0,0,0)`},emphasis:{disabled:!0},tooltip:{show:!1},z:100,animation:!1}],...AI};return(0,$.jsxs)(`div`,{className:`chart-card`,children:[(0,$.jsx)(`button`,{className:`export-btn`,onClick:()=>eR(c),children:`PNG`}),(0,$.jsx)(Me,{ref:c,echarts:mO,option:T,style:{height:400},theme:`dark`,notMerge:!1,replaceMerge:[`series`,`legend`,`graphic`],lazyUpdate:!0,onChartReady:w,onEvents:{click:e=>{let t=e?.axisValue||e?.name;t&&a(t)},datazoom:()=>{let e=(c.current?.getEchartsInstance())?.getOption()?.dataZoom?.[0];e&&s({start:typeof e.start==`number`?e.start:d,end:typeof e.end==`number`?e.end:100}),requestAnimationFrame(()=>w())}}})]})});function sR({data:e,range:t=`total`,chartMode:n=`default`}){let[r,i]=(0,b.useState)(`tokens`),[a,o]=(0,b.useState)(`model`),[s,c]=(0,b.useState)(`absolute`),[l,u]=(0,b.useState)(null);if(!e?.data?.length)return(0,$.jsx)(`div`,{style:{color:`var(--text-muted)`,padding:`2rem`},children:`No data`});let d=e.data;(0,b.useEffect)(()=>{!l&&d[0]&&u(d[d.length-1]?.date||d[0]?.date)},[d,l]);let f=(0,b.useCallback)(e=>{e&&u(e)},[]),p=d.find(e=>e.date===l)||null;return(0,$.jsxs)(`div`,{className:`animate-in`,children:[(0,$.jsxs)(`div`,{className:`section-header`,children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`0.75rem`},children:(0,$.jsx)(`span`,{className:`section-title`,children:`Daily Usage`})}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:`0.5rem`},children:[(0,$.jsx)(`div`,{className:`btn-group`,children:ZL.map(e=>(0,$.jsx)(`button`,{className:`btn ${r===e.key?`active`:``}`,onClick:()=>i(e.key),children:e.label},e.key))}),(0,$.jsx)(`div`,{className:`btn-group`,children:QL.map(e=>(0,$.jsx)(`button`,{className:`btn ${a===e.key?`active`:``}`,onClick:()=>o(e.key),children:e.label},e.key))}),(0,$.jsx)(`div`,{className:`btn-group`,children:$L.map(e=>(0,$.jsx)(`button`,{className:`btn ${s===e.key?`active`:``}`,onClick:()=>c(e.key),children:e.label},e.key))})]})]}),(0,$.jsx)(oR,{daily:d,range:t,metric:r,split:a,displayMode:s,onSelectDate:f}),p&&(0,$.jsxs)(`div`,{className:`chart-card`,children:[(0,$.jsxs)(`div`,{className:`chart-title`,style:{marginBottom:`0.75rem`},children:[`Day detail: `,p.date]}),(0,$.jsx)(aR,{day:p,chartMode:n})]})]})}function cR(){return{accessor:(e,t)=>typeof e==`function`?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function lR(e,t){return typeof e==`function`?e(t):e}function uR(e,t){return n=>{t.setState(t=>({...t,[e]:lR(n,t[e])}))}}function dR(e){return e instanceof Function}function fR(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function pR(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i!=null&&i.length&&r(i)})};return r(e),n}function mR(e,t,n){let r=[],i;return a=>{let o;n.key&&n.debug&&(o=Date.now());let s=e(a);if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
|
|
29
29
|
font-size: .6rem;
|
|
30
30
|
font-weight: bold;
|
package/dist/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-B1DauiX5.js"></script>
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/assets/index-CVvcsIkn.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
package/package.json
CHANGED
package/server/cost-catalog.js
CHANGED
|
@@ -77,7 +77,7 @@ export function getModelPricing(modelName) {
|
|
|
77
77
|
return getPricing()[modelName] || null;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
export const CATALOG_VERSION = '2026-03-
|
|
80
|
+
export const CATALOG_VERSION = '2026-03-17';
|
|
81
81
|
export const CACHE_ASSUMPTIONS = {
|
|
82
82
|
input_fraction: INPUT_FRACTION,
|
|
83
83
|
output_fraction: OUTPUT_FRACTION,
|
package/server/normalize.js
CHANGED
|
@@ -63,6 +63,12 @@ export function isSubagent(agentRole) {
|
|
|
63
63
|
const MODEL_ALIASES = {
|
|
64
64
|
'codex-mini-latest': 'o4-mini',
|
|
65
65
|
'gpt-5.2': 'gpt-5.2-codex',
|
|
66
|
+
'gpt-5 mini': 'gpt-5-mini',
|
|
67
|
+
'gpt-5.4-mini': 'gpt-5-mini',
|
|
68
|
+
'gpt-5.4 mini': 'gpt-5-mini',
|
|
69
|
+
'gpt-5 nano': 'gpt-5.4-nano',
|
|
70
|
+
'gpt-5-nano': 'gpt-5.4-nano',
|
|
71
|
+
'gpt-5.4 nano': 'gpt-5.4-nano',
|
|
66
72
|
};
|
|
67
73
|
|
|
68
74
|
export function normalizeModelName(rawModel) {
|
package/server/pricing-fetch.js
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
// Local pricing catalog for models used in codex-cli/codex app lifetime.
|
|
2
2
|
const FALLBACK = {
|
|
3
|
-
'gpt-5.4': { input: 2.50, output: 15.00, cached_input: 0.25 },
|
|
4
|
-
'gpt-5
|
|
5
|
-
'gpt-5.
|
|
6
|
-
'gpt-5.
|
|
7
|
-
'gpt-5.
|
|
8
|
-
'gpt-5.
|
|
9
|
-
'gpt-
|
|
10
|
-
'gpt-
|
|
11
|
-
'gpt-4.1
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'gpt-
|
|
18
|
-
'gpt-
|
|
19
|
-
'gpt-
|
|
20
|
-
}
|
|
21
|
-
|
|
3
|
+
'gpt-5.4': { input: 2.50, output: 15.00, cached_input: 0.25 },
|
|
4
|
+
'gpt-5-mini': { input: 0.75, output: 4.50, cached_input: 0.075},
|
|
5
|
+
'gpt-5.4-nano': { input: 0.15, output: 0.60, cached_input: 0.015},
|
|
6
|
+
'gpt-5.3-codex': { input: 2.00, output: 10.00, cached_input: 0.20 },
|
|
7
|
+
'gpt-5.3-codex-spark': { input: 2.00, output: 10.00, cached_input: 0.20 },
|
|
8
|
+
'gpt-5.2-codex': { input: 2.00, output: 10.00, cached_input: 0.20 },
|
|
9
|
+
'gpt-5.2': { input: 2.00, output: 10.00, cached_input: 0.20 },
|
|
10
|
+
'gpt-5.1-codex-mini': { input: 0.25, output: 2.00, cached_input: 0.025},
|
|
11
|
+
'gpt-4.1': { input: 2.00, output: 8.00, cached_input: 0.50 },
|
|
12
|
+
'gpt-4.1-mini': { input: 0.40, output: 1.60, cached_input: 0.10 },
|
|
13
|
+
'gpt-4.1-nano': { input: 0.10, output: 0.40, cached_input: 0.025 },
|
|
14
|
+
'o3': { input: 2.00, output: 8.00, cached_input: 0.50 },
|
|
15
|
+
'o3-mini': { input: 1.10, output: 4.40, cached_input: 0.275},
|
|
16
|
+
'o4-mini': { input: 1.10, output: 4.40, cached_input: 0.275},
|
|
17
|
+
'gpt-4o': { input: 2.50, output: 10.00, cached_input: 1.25 },
|
|
18
|
+
'gpt-4o-mini': { input: 0.15, output: 0.60, cached_input: 0.075},
|
|
19
|
+
'gpt-4-turbo': { input: 10.00, output: 30.00, cached_input: 1.00 },
|
|
20
|
+
'gpt-4': { input: 30.00, output: 60.00, cached_input: 3.00 },
|
|
21
|
+
'gpt-3.5-turbo': { input: 0.50, output: 1.50, cached_input: 0.05 },
|
|
22
|
+
};
|
|
23
|
+
|
|
22
24
|
const PRICING_URL = process.env.CODEXMETER_PRICING_URL || null;
|
|
23
|
-
|
|
24
|
-
function normalizeEntry(entry) {
|
|
25
|
-
if (!entry || typeof entry !== 'object' || entry.input == null || entry.output == null) return null;
|
|
26
|
-
const cached = entry.cached_input ?? entry.cachedInput ?? entry.input * 0.1;
|
|
27
|
-
return { input: entry.input, output: entry.output, cached_input: cached };
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function normalizePricing(raw) {
|
|
31
|
-
const models = raw?.models && typeof raw.models === 'object' ? raw.models : raw;
|
|
32
|
-
if (!models || typeof models !== 'object') return null;
|
|
33
|
-
const out = {};
|
|
34
|
-
for (const [name, entry] of Object.entries(models)) {
|
|
35
|
-
const norm = normalizeEntry(entry);
|
|
36
|
-
if (norm) out[name] = norm;
|
|
37
|
-
}
|
|
38
|
-
return Object.keys(out).length > 0 ? out : null;
|
|
39
|
-
}
|
|
40
|
-
|
|
25
|
+
|
|
26
|
+
function normalizeEntry(entry) {
|
|
27
|
+
if (!entry || typeof entry !== 'object' || entry.input == null || entry.output == null) return null;
|
|
28
|
+
const cached = entry.cached_input ?? entry.cachedInput ?? entry.input * 0.1;
|
|
29
|
+
return { input: entry.input, output: entry.output, cached_input: cached };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function normalizePricing(raw) {
|
|
33
|
+
const models = raw?.models && typeof raw.models === 'object' ? raw.models : raw;
|
|
34
|
+
if (!models || typeof models !== 'object') return null;
|
|
35
|
+
const out = {};
|
|
36
|
+
for (const [name, entry] of Object.entries(models)) {
|
|
37
|
+
const norm = normalizeEntry(entry);
|
|
38
|
+
if (norm) out[name] = norm;
|
|
39
|
+
}
|
|
40
|
+
return Object.keys(out).length > 0 ? out : null;
|
|
41
|
+
}
|
|
42
|
+
|
|
41
43
|
export async function fetchPricing() {
|
|
42
44
|
if (!PRICING_URL) return FALLBACK;
|
|
43
45
|
|
|
@@ -45,15 +47,15 @@ export async function fetchPricing() {
|
|
|
45
47
|
const ctrl = new AbortController();
|
|
46
48
|
const t = setTimeout(() => ctrl.abort(), 3000);
|
|
47
49
|
const res = await fetch(PRICING_URL, { signal: ctrl.signal });
|
|
48
|
-
clearTimeout(t);
|
|
49
|
-
if (!res.ok) return FALLBACK;
|
|
50
|
-
const data = await res.json();
|
|
51
|
-
const normalized = normalizePricing(data);
|
|
52
|
-
if (normalized) {
|
|
53
|
-
return { ...FALLBACK, ...normalized };
|
|
54
|
-
}
|
|
55
|
-
} catch {
|
|
56
|
-
// timeout, network error, invalid JSON - use fallback
|
|
57
|
-
}
|
|
58
|
-
return FALLBACK;
|
|
59
|
-
}
|
|
50
|
+
clearTimeout(t);
|
|
51
|
+
if (!res.ok) return FALLBACK;
|
|
52
|
+
const data = await res.json();
|
|
53
|
+
const normalized = normalizePricing(data);
|
|
54
|
+
if (normalized) {
|
|
55
|
+
return { ...FALLBACK, ...normalized };
|
|
56
|
+
}
|
|
57
|
+
} catch {
|
|
58
|
+
// timeout, network error, invalid JSON - use fallback
|
|
59
|
+
}
|
|
60
|
+
return FALLBACK;
|
|
61
|
+
}
|