@webority/ui-elements 0.173.1 → 0.174.1

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.
Files changed (165) hide show
  1. package/dist/{WuiCarousel-CFKmFVzc.js → WuiCarousel-B0yPDH5I.js} +1 -1
  2. package/dist/WuiCodeBlock-BJ14DaLH.js +1 -0
  3. package/dist/{WuiCommandPalette-BQCy0bon.js → WuiCommandPalette-u1XD5WMv.js} +2 -2
  4. package/dist/WuiCommentThread-ChTsQWet.js +1 -0
  5. package/dist/{WuiConsentBanner-DlAE3DTf.js → WuiConsentBanner-nTua-kEd.js} +1 -1
  6. package/dist/{WuiDataTable-B-JaTsrI.js → WuiDataTable-3Vd8EAMV.js} +1 -1
  7. package/dist/{WuiDatePicker-4tdWakGX.js → WuiDatePicker-CPr0Yni3.js} +1 -1
  8. package/dist/{WuiDateRange-D7LJuY2F.js → WuiDateRange-DvuE4wfG.js} +1 -1
  9. package/dist/{WuiDateTime-BSJfyZ0q.js → WuiDateTime-Vimu6grS.js} +1 -1
  10. package/dist/{WuiDrawer-D-XfW1kl.js → WuiDrawer-BsY0fs_u.js} +1 -1
  11. package/dist/WuiGantt-DJat5idS.js +1 -0
  12. package/dist/{WuiImageCrop-CIAjHOGk.js → WuiImageCrop-UakcSM2k.js} +1 -1
  13. package/dist/{WuiInlineEdit-C9FxCWCk.js → WuiInlineEdit-Bfe_m5px.js} +1 -1
  14. package/dist/{WuiLeadPopup-KyguGV-q.js → WuiLeadPopup-DaYZ2zCJ.js} +1 -1
  15. package/dist/{WuiLightbox-CBiqJmGE.js → WuiLightbox-CuzbFBck.js} +1 -1
  16. package/dist/WuiMentionInput-Dmtm3N62.js +1 -0
  17. package/dist/{WuiNotificationCenter-DZariS2K.js → WuiNotificationCenter-1Hw7W0st.js} +1 -1
  18. package/dist/{WuiOrgTree-CFxoY9Vr.js → WuiOrgTree-DYMNCGTh.js} +1 -1
  19. package/dist/{WuiOverflow-CXYk2ubC.js → WuiOverflow-fZKqdsr-.js} +1 -1
  20. package/dist/{WuiPhone-BI438y4S.js → WuiPhone-BEyz-J2q.js} +1 -1
  21. package/dist/{WuiRecordPager-DAyoD650.js → WuiRecordPager-BXoe4KfU.js} +1 -1
  22. package/dist/{WuiRelativeTime-CPzs4tjM.js → WuiRelativeTime-CSg9vzfk.js} +1 -1
  23. package/dist/{WuiSavedViews-BAqHgVj2.js → WuiSavedViews-OjB-ZiCo.js} +1 -1
  24. package/dist/WuiSelect-C_nfrNr5.js +1 -0
  25. package/dist/{WuiShortcuts-DWzmRKEG.js → WuiShortcuts-CRCctX82.js} +1 -1
  26. package/dist/{WuiShowMore-DyfGnrob.js → WuiShowMore-BoYCrYYf.js} +1 -1
  27. package/dist/{WuiSlider-LE2wquOo.js → WuiSlider-R_mTula0.js} +1 -1
  28. package/dist/{WuiSortable-DxwYjicc.js → WuiSortable-x8Mg0tOv.js} +1 -1
  29. package/dist/{WuiTimePicker-xrPYytjq.js → WuiTimePicker-Bcc1PfCT.js} +1 -1
  30. package/dist/{WuiTour-D-H5sMJS.js → WuiTour-C71Wmed-.js} +1 -1
  31. package/dist/WuiTree-BQk23SSF.js +1 -0
  32. package/dist/WuiTreePicker-DP1lCno3.js +1 -0
  33. package/dist/{WuiWizardStep-n8Ge5GDI.js → WuiWizardStep-Uag__kTu.js} +1 -1
  34. package/dist/buttonClass-C8BRtTk8.js +1 -0
  35. package/dist/{calendarMath-rI1aBVRd.js → calendarMath-CT99RyhR.js} +1 -1
  36. package/dist/chips-BaB5xZXq.js +2 -0
  37. package/dist/{country-B7jmc--B.js → country-T7AfpJpN.js} +1 -1
  38. package/dist/{customRule-BXJdj57A.js → customRule-BpwcjVLb.js} +1 -1
  39. package/dist/{dataTable-Bz6HxUx0.js → dataTable-VB3nBucm.js} +1 -1
  40. package/dist/drawerDiscard-DGmosZR2.js +1 -0
  41. package/dist/elements/carousel.js +1 -1
  42. package/dist/elements/code-block.js +1 -1
  43. package/dist/elements/command-palette.js +1 -1
  44. package/dist/elements/comment-thread.js +1 -1
  45. package/dist/elements/consent-banner.js +1 -1
  46. package/dist/elements/data-table.js +1 -1
  47. package/dist/elements/date-range.js +1 -1
  48. package/dist/elements/date-time.js +1 -1
  49. package/dist/elements/datepicker.js +1 -1
  50. package/dist/elements/drawer.js +1 -1
  51. package/dist/elements/filter-popover.js +1 -1
  52. package/dist/elements/gantt.js +1 -1
  53. package/dist/elements/image-crop.js +1 -1
  54. package/dist/elements/inline-edit.js +1 -1
  55. package/dist/elements/kanban.js +1 -1
  56. package/dist/elements/lead-popup.js +1 -1
  57. package/dist/elements/lightbox.js +1 -1
  58. package/dist/elements/mention-input.js +1 -1
  59. package/dist/elements/notification-center.js +1 -1
  60. package/dist/elements/org-tree.js +1 -1
  61. package/dist/elements/overflow.js +1 -1
  62. package/dist/elements/phone.js +1 -1
  63. package/dist/elements/record-pager.js +1 -1
  64. package/dist/elements/relative-time.js +1 -1
  65. package/dist/elements/saved-views.js +1 -1
  66. package/dist/elements/select.js +1 -1
  67. package/dist/elements/shortcuts.js +1 -1
  68. package/dist/elements/show-more.js +1 -1
  69. package/dist/elements/slider.js +1 -1
  70. package/dist/elements/sortable.js +1 -1
  71. package/dist/elements/timepicker.js +1 -1
  72. package/dist/elements/tour.js +1 -1
  73. package/dist/elements/tree-picker.js +1 -1
  74. package/dist/elements/tree.js +1 -1
  75. package/dist/elements/wizard.js +1 -1
  76. package/dist/fileViewer.g-DupSpQYS.js +1 -0
  77. package/dist/{fileViewerImage-ItX9j9U9.js → fileViewerImage-CCtdOYm3.js} +1 -1
  78. package/dist/{fileViewerMedia-BCqp2Z96.js → fileViewerMedia-Dbwn694I.js} +1 -1
  79. package/dist/{fileViewerPdf-aaI2R2nB.js → fileViewerPdf-Lu6vcnYW.js} +1 -1
  80. package/dist/{filterPopover-D7LGrhnO.js → filterPopover-DskHFNLi.js} +1 -1
  81. package/dist/{formatters-DikbTYA4.js → formatters-DTW53DjY.js} +1 -1
  82. package/dist/hasOwn-CJsplJ62.js +1 -0
  83. package/dist/helpers.js +1 -1
  84. package/dist/iconGlyphs.g-Dj8sa1HF.js +1 -0
  85. package/dist/{inlineEditText-C6g6qhye.js → inlineEditText-DRBhMnam.js} +1 -1
  86. package/dist/kanban-DlVHIpxL.js +1 -0
  87. package/dist/{kanbanModel-CuMgMnSc.js → kanbanModel-BzXK4SkM.js} +1 -1
  88. package/dist/{loader-B3lirubB.js → loader-C2hgZrCR.js} +1 -1
  89. package/dist/{notificationDays-grsj1DtM.js → notificationDays-wMr8rZko.js} +1 -1
  90. package/dist/{optionLabel-CmrOSHbD.js → optionLabel-CghX6DYo.js} +1 -1
  91. package/dist/{recents-BQ0fD7Y0.js → recents-B9efQ1Au.js} +1 -1
  92. package/dist/{relativeTime-vdCXtfKg.js → relativeTime-CNgauvqB.js} +1 -1
  93. package/dist/{search-DwboX91o.js → search-Cj1eEPIN.js} +1 -1
  94. package/dist/server.js +1 -1
  95. package/dist/{shortcutKeys-6iLc6oDR.js → shortcutKeys-BMTWgV2g.js} +1 -1
  96. package/dist/text.js +1 -1
  97. package/dist/textStore-DBplASiZ.js +1 -0
  98. package/dist/{themeTransition-D7HJ4A4m.js → themeTransition-CRnGw929.js} +1 -1
  99. package/dist/ui-calendar.global.js +1 -1
  100. package/dist/ui-calendar.js +1 -1
  101. package/dist/ui-chart.global.js +2 -2
  102. package/dist/ui-chart.js +2 -2
  103. package/dist/ui-consent-banner.global.js +1 -1
  104. package/dist/ui-elements/carousel.global.js +1 -1
  105. package/dist/ui-elements/code-block.global.js +1 -1
  106. package/dist/ui-elements/command-palette.global.js +2 -2
  107. package/dist/ui-elements/comment-thread.global.js +1 -1
  108. package/dist/ui-elements/consent-banner.global.js +1 -1
  109. package/dist/ui-elements/context-menu.global.js +1 -1
  110. package/dist/ui-elements/date-range.global.js +1 -1
  111. package/dist/ui-elements/date-time.global.js +1 -1
  112. package/dist/ui-elements/datepicker.global.js +1 -1
  113. package/dist/ui-elements/drawer.global.js +1 -1
  114. package/dist/ui-elements/dropdown.global.js +1 -1
  115. package/dist/ui-elements/entry-grid.global.js +1 -1
  116. package/dist/ui-elements/gantt.global.js +1 -1
  117. package/dist/ui-elements/glyphs.global.js +1 -1
  118. package/dist/ui-elements/image-crop.global.js +1 -1
  119. package/dist/ui-elements/inline-edit.global.js +1 -1
  120. package/dist/ui-elements/kanban.global.js +1 -1
  121. package/dist/ui-elements/lead-popup.global.js +1 -1
  122. package/dist/ui-elements/lightbox.global.js +1 -1
  123. package/dist/ui-elements/markdown.global.js +1 -1
  124. package/dist/ui-elements/org-tree.global.js +1 -1
  125. package/dist/ui-elements/phone.global.js +1 -1
  126. package/dist/ui-elements/popover.global.js +1 -1
  127. package/dist/ui-elements/saved-views.global.js +1 -1
  128. package/dist/ui-elements/select-chips.global.js +2 -2
  129. package/dist/ui-elements/select-recents.global.js +1 -1
  130. package/dist/ui-elements/select-search.global.js +1 -1
  131. package/dist/ui-elements/select-window.global.js +1 -1
  132. package/dist/ui-elements/slider.global.js +1 -1
  133. package/dist/ui-elements/sortable.global.js +1 -1
  134. package/dist/ui-elements/status-icon.global.js +1 -1
  135. package/dist/ui-elements/table-export.global.js +1 -1
  136. package/dist/ui-elements/timepicker.global.js +1 -1
  137. package/dist/ui-elements/tour.global.js +1 -1
  138. package/dist/ui-elements/tree-picker.global.js +1 -1
  139. package/dist/ui-elements/tree.global.js +1 -1
  140. package/dist/ui-elements/wizard.global.js +1 -1
  141. package/dist/ui-elements.global.js +1 -1
  142. package/dist/ui-elements.js +1 -1
  143. package/dist/ui-file-viewer.global.js +10 -10
  144. package/dist/ui-file-viewer.js +1 -1
  145. package/dist/ui-lead-popup.global.js +1 -1
  146. package/dist/ui-rich-text.global.js +51 -51
  147. package/dist/ui-rich-text.js +53 -53
  148. package/dist/ui-tour.global.js +1 -1
  149. package/package.json +5 -5
  150. package/types/global/shared.d.ts +2 -0
  151. package/types/hasOwn.d.ts +1 -0
  152. package/dist/WuiCodeBlock-fBc3Uwsw.js +0 -1
  153. package/dist/WuiCommentThread-B58UyYGD.js +0 -1
  154. package/dist/WuiGantt-XMvgsZsn.js +0 -1
  155. package/dist/WuiMentionInput-CktKQjQc.js +0 -1
  156. package/dist/WuiSelect-htggZB0v.js +0 -1
  157. package/dist/WuiTree-BnlK9fYL.js +0 -1
  158. package/dist/WuiTreePicker-Bx9nvRrC.js +0 -1
  159. package/dist/buttonClass-GtEi8hAY.js +0 -1
  160. package/dist/chips-DrTvHdbb.js +0 -2
  161. package/dist/drawerDiscard-B33Oc_Sv.js +0 -1
  162. package/dist/fileViewer.g-B6N9K2xi.js +0 -1
  163. package/dist/iconGlyphs.g-P04RJkSE.js +0 -1
  164. package/dist/kanban-CX6DyApZ.js +0 -1
  165. package/dist/textStore-opIEM4lu.js +0 -1
@@ -17,5 +17,5 @@ var WeborityChart=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value
17
17
  `)){var p=new aV;p.newline=!0,s.add(p)}else{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`,rV(lV,f,null,r,d)).on(`mouseover`,rV(uV,m.name,null,r,d)).on(`mouseout`,rV(dV,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=Qc(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`),_=Vr(h.fill);_&&_[3]===0&&(_[3]=.2,h=A(A({},h),{fill:Yr(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,rV(lV,null,f,r,d)).on(`mouseover`,rV(uV,null,f,r,d)).on(`mouseout`,rV(dV,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=Qc(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};Qc(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();iV(e,function(e){var r=e.type,i=new Go({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),Xf(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),su(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=sV(c,r,o,s,d,m,u),y=new aV,b=r.getModel(`textStyle`);if(V(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(cV({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;H(w)&&w?T=w.replace(`{name}`,t??``):V(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new Go({style:Qf(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new Bo({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&Mf({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),su(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();a_(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){a_(`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]),_}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}(yO);function sV(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),iV(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:eA(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 cV(e){var t=e.icon||`roundRect`,n=Lv(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=J.color.neutral00,n.style.lineWidth=2),n}function lV(e,t,n,r){dV(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),uV(e,t,n,r)}function uV(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function dV(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function fV(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),pV(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){F(i,function(t,n){e[t?`select`:`unSelect`](n)}),pV(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function pV(e,t){var n=t||{};return F(e.getData(),function(t){var r=t.get(`name`);if(r!==`
18
18
  `&&r!==``){var i=e.isSelected(r);n[r]=Ae(n,r)?n[r]&&i:i}}),n}function mV(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,z(fV,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,z(fV,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,z(fV,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,z(fV,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,z(fV,`unSelect`))}var hV=Zc(gV);function gV(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 _V(e){e.registerComponentModel(nV),e.registerComponentView(oV),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,hV),e.registerSubTypeDefaulter(`legend`,function(){return`plain`}),mV(e)}var vV=function(e){a(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=g_(t);e.prototype.init.call(this,t,n,r),yV(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),yV(this,this.option,t)},t.type=`legend.scroll`,t.defaultOption=kh(nV.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:J.color.accent50,pageIconInactiveColor:J.color.accent10,pageIconSize:15,pageTextStyle:{color:J.color.tertiary},animationDurationUpdate:800}),t}(nV);function yV(e,t,n){var r=e.getOrient(),i=[1,1];i[r.index]=0,h_(t,n,{type:`box`,ignoreSize:!!i})}var bV=Hu,xV=[`width`,`height`],SV=[`x`,`y`],CV=function(e){a(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 bV),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new bV)},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=B(u)?u:[u,u];p(`pagePrev`,0);var f=n.getModel(`pageTextStyle`);l.add(new Go({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=wf(n.get(`pageIcons`,!0)[n.getOrient().name][t],{onclick:R(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=xV[s],l=SV[s],u=xV[1-s],d=SV[1-s];i&&a_(`horizontal`,o,e.get(`selectorItemGap`,!0));var f=e.get(`selectorButtonGap`,!0),p=o.getBoundingRect(),m=[-p.x,-p.y],h=O(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;a_(e.get(`orient`),c,e.get(`itemGap`),r?n.width:null,r?null:n.height),a_(`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],_=W(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 Bo({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&&Gd(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;F([`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`,H(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=xV[i],o=SV[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=+!!u,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}(oV);function wV(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 TV(e){Bj(_V),e.registerComponentModel(vV),e.registerComponentView(CV),wV(e)}function EV(e){Bj(_V),Bj(TV)}var DV=function(e){a(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=kh(Nz.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Nz),OV=xc();function kV(e,t,n){OV(e).coordSysRecordMap.each(function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)})}function AV(e,t){for(var n=OV(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||jV(n,o))}}}function jV(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function MV(e,t){var n={model:t,containsPoint:z(PV,t),dispatchAction:z(NV,e),dataZoomInfoMap:null,controller:null},r=n.controller=new aN(e.getZr());return F([`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 NV(e,t){e.isDisposed()||e.dispatchAction({type:`dataZoom`,animation:{easing:`cubicOut`,duration:100},batch:t})}function PV(e,t,n,r){return e.coordinateSystem.containPoint([n,r])}function FV(e,t,n){var r,i=`type_`,a={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0,s,c;return e.each(function(e){var t=e.model,n=t.get(`disabled`,!0)?!1:!t.get(`zoomLock`,!0)||`move`;a[i+n]>a[i+r]&&(r=n),o&&=t.get(`preventDefaultMouseMove`,!0),s=W(t.get(`cursorGrab`,!0),s),c=W(t.get(`cursorGrabbing`,!0),c)}),{controlType:r,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:n,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint},cursorGrab:s,cursorGrabbing:c}}}function IV(e){e.registerUpdateLifecycle(`coordsys:aftercreate`,function(e,t){var n=OV(t),r=n.coordSysRecordMap||=G();r.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:`dataZoom`,subType:`inside`},function(e){F(Dz(e).infoList,function(n){var i=n.model.uid,a=r.get(i)||r.set(i,MV(t,n.model));(a.dataZoomInfoMap||=G()).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)jV(r,e);else{var s=FV(a,e,t);n.enable(s.controlType,s.opt),ww(e,`dispatchAction`,i.model.get(`throttle`,!0),`fixRate`)}})})}var LV=function(e){a(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){e.prototype.render.apply(this,arguments),t.noTarget()?this._clear():(this.range=t.getPercentRange(),kV(r,t,{pan:R(RV.pan,this),zoom:R(RV.zoom,this),scrollMove:R(RV.scrollMove,this)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){AV(this.api,this.dataZoomModel),this.range=null},t.type=`dataZoom.inside`,t}(Fz),RV={zoom:function(e,t,n,r){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=BV[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(VI(0,a,[0,100],0,u.minSpan,u.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:zV(function(e,t,n,r,i,a){var o=BV[r]([a.oldX,a.oldY],[a.newX,a.newY],t,i,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:zV(function(e,t,n,r,i,a){return BV[r]([0,0],[a.scrollDelta,a.scrollDelta],t,i,n).signal*(e[1]-e[0])*a.scrollDelta})};function zV(e){return function(t,n,r,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s&&(VI(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 BV={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 VV(e){Bz(e),e.registerComponentModel(DV),e.registerComponentView(LV),IV(e)}var HV=function(e){a(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=kh(Nz.defaultOption,{show:!0,right:`ph`,top:`ph`,width:`ph`,height:`ph`,left:null,bottom:null,borderColor:J.color.accent10,borderRadius:0,backgroundColor:J.color.transparent,dataBackground:{lineStyle:{color:J.color.accent30,width:.5},areaStyle:{color:J.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:J.color.accent40,width:.5},areaStyle:{color:J.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:J.color.neutral00,borderColor:J.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:J.color.accent40,opacity:.5},showDetail:!0,showDataShadow:`auto`,realtime:!0,zoomLock:!1,textStyle:{color:J.color.tertiary},brushSelect:!0,brushStyle:{color:J.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:J.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(Nz),UV=Bo,WV=1,GV=30,KV=7,qV=`horizontal`,JV=`vertical`,YV=5,XV=[`line`,`bar`,`candlestick`,`scatter`],ZV={easing:`cubicOut`,duration:100,delay:0},QV=function(e){a(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=R(this._onBrush,this),this._onBrushEnd=R(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){e.prototype.render.apply(this,arguments),ww(this,`_dispatchZoomAction`,t.get(`throttle`),`fixRate`),this._orient=t.getOrient(),t.get(`show`)===!1?this.group.removeAll():t.noTarget()?(this._clear(),this.group.removeAll()):(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(){Tw(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 Hu;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`)?KV:0,r=d_(e,t).refContainer,i=this._findCoordRect(),a=e.get(`defaultLocationEdgeGap`,!0)||0,o=this._orient===qV?{right:r.width-i.x-i.width,top:r.height-GV-a-n,width:i.width,height:GV}:{right:a,top:i.y,width:GV,height:i.height},s=g_(e.option);F([`right`,`top`,`width`,`height`],function(e){s[e]===`ph`&&(s[e]=o[e])});var c=l_(s,r);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===JV&&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===qV&&!i?{scaleY:o?1:-1,scaleX:1}:n===qV&&i?{scaleY:o?1:-1,scaleX:-1}:n===JV&&!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]),c=isNaN(s.x)?0:s.x,l=isNaN(s.y)?0:s.y;e.x=t.x-c,e.y=t.y-l,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 UV({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get(`backgroundColor`)},z2:-40}));var i=new UV({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:`transparent`},z2:0,onclick:R(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);else{y=v?(+e-l[0])*_:y+g;var r=t==null||isNaN(t)||t===``,i=r?0:ys(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 Hu,r=new hd({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel(`areaStyle`).getAreaStyle(),silent:!0,z2:-20}),i=new _d({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){F(e.getAxisProxy(i,a).getTargetSeriesModels(),function(e){if(!n&&!(t!==!0&&N(XV,e.get(`type`))<0)){var o=r.getComponent(Tz(i),a).axis,s=eH(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 UV({silent:l,style:{fill:o.get(`fillerColor`)},textConfig:{position:`inside`}});i.add(u),i.add(new UV({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:WV,fill:J.color.transparent}})),F([0,1],function(t){var a=o.get(`handleIcon`);!Pv[a]&&a.indexOf(`path://`)<0&&a.indexOf(`image://`)<0&&(a=`path://`+a);var s=Lv(a,-1,0,2,2,null,!0);s.attr({cursor:tH(this._orient),draggable:!0,drift:R(this._onDragMove,this,t),ondragend:R(this._onDragEnd,this),onmouseover:R(this._onOverDataInfoTriggerArea,this,!0),onmouseout:R(this._onOverDataInfoTriggerArea,this,!1),z2:5});var c=s.getBoundingRect(),l=o.get(`handleSize`);this._handleHeight=q(l,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(),su(s);var u=o.get(`handleColor`);u!=null&&(s.style.fill=u),i.add(n[t]=s);var d=o.getModel(`textStyle`),f=(o.get(`handleLabel`)||{}).show||!1;e.add(r[t]=new Go({silent:!0,invisible:!f,style:Qf(d,{x:0,y:0,text:``,verticalAlign:`middle`,align:`center`,fill:d.getTextColor(),font:d.getFont()}),z2:10}))},this);var d=u;if(l){var f=q(o.get(`moveHandleSize`),a[1]),p=t.moveHandle=new Bo({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=Lv(o.get(`moveHandleIcon`),-m/2,-m/2,m,m,J.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 Bo({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:`grab`,drift:R(this._onActualMoveZoneDrift,this),ondragstart:R(this._onActualMoveZoneDragStart,this),ondragend:R(this._onActualMoveZoneDragEnd,this),onmouseover:R(this._onOverDataInfoTriggerArea,this,!0),onmouseout:R(this._onOverDataInfoTriggerArea,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[ys(e[0],[0,100],t,!0),ys(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];VI(t,r,i,n.get(`zoomLock`)?`all`:e,a.minSpan==null?null:ys(a.minSpan,o,i,!0),a.maxSpan==null?null:ys(a.maxSpan,o,i,!0));var s=this._range,c=this._range=Ts([ys(r[0],i,o,!0),ys(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=Ts(n.slice()),i=this._size;F([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 Bo,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(),s=o.getAxisModel().axis.scale;if(o){var c=this._range,l;if(e){var u={start:c[0],end:c[1]},d=jz(t,o);if(d){var f=d.calculateDataWindow(u).percentInverted;u={start:f[0],end:f[1]}}l=o.calculateDataWindow(u)}else l=o.getWindow();a=[$V(t,0,l,s),$V(t,1,l,s)]}}var p=Ts(this._handleEnds.slice());m.call(this,0),m.call(this,1);function m(e){var t=gf(n.handles[e].parent,this.group),o=vf(e===0?`right`:`left`,t),s=this._handleWidth/2+YV,c=_f([p[e]+(e===0?-s:s),this._size[1]/2],t);r[e].setStyle({x:c[0],y:c[1],verticalAlign:i===qV?`middle`:o,align:i===qV?o:`center`,text:a[e]})}},t.prototype._onOverDataInfoTriggerArea=function(e){this._isOverDataInfoTriggerArea=e,this._showDataInfo(e)},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._onActualMoveZoneDrift=function(e,t,n){this.api.getZr().setCursorStyle(`grabbing`),this._onDragMove(`all`,e,t,n)},t.prototype._onActualMoveZoneDragStart=function(e){e.target.attr(`cursor`,`grabbing`),this._showDataInfo(!0)},t.prototype._onActualMoveZoneDragEnd=function(e){e.target.attr(`cursor`,`grab`),this._onDragEnd()},t.prototype._onDragMove=function(e,t,n,r){this._dragging=!0,pE(r.event);var i=this._displayables.sliderGroup.getLocalTransform(),a=_f([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._isOverDataInfoTriggerArea||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 Nt(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();VI(0,a,r,0,o.minSpan==null?null:ys(o.minSpan,i,r,!0),o.maxSpan==null?null:ys(o.maxSpan,i,r,!0)),this._range=Ts([ys(a[0],r,i,!0),ys(a[1],r,i,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(pE(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 UV({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?ZV:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=Dz(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}(Fz);function $V(e,t,n,r){var i=e.get(`labelFormatter`),a=e.get(`labelPrecision`);(a==null||a===`auto`)&&(a=n.valuePrecision);var o=n.value[t],s=o==null||isNaN(o)?``:Xy(r)||Jy(r)?r.getLabel({value:Math.round(o)}):isFinite(a)?ws(o,a,!0):o+``;return V(i)?i(o,s):H(i)?i.replace(`{value}`,s):s}function eH(e){return{x:`y`,y:`x`,radius:`angle`,angle:`radius`}[e]}function tH(e){return e===`vertical`?`ns-resize`:`ew-resize`}function nH(e){e.registerComponentModel(HV),e.registerComponentView(QV),Bz(e)}function rH(e){Bj(VV),Bj(nH)}var iH={get:function(e,t,n){var r=O((aH[e]||{})[t]);return n&&B(r)?r[r.length-1]:r}},aH={color:{active:[`#006edd`,`#e0ffff`],inactive:[J.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:[`circle`,`roundRect`,`diamond`],inactive:[`none`]},symbolSize:{active:[10,50],inactive:[0,0]}},oH=OF.mapVisual,sH=OF.eachVisual,cH=B,lH=F,uH=Ts,dH=ys,fH=function(e){a(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=[`inRange`,`outOfRange`],n.replacableOptionKeys=[`inRange`,`outOfRange`,`target`,`controller`,`color`],n.layoutMode={type:`box`,ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&CB(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel(`textStyle`),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=R(e,this),this.controllerVisuals=SB(this.option.controller,t,e),this.targetVisuals=SB(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this,t=this.option.seriesTargets;if(t){var n=[];return lH(t,function(t){if(t.seriesIndex!=null)n.push(t.seriesIndex);else if(t.seriesId!=null){var r;e.ecModel.eachSeries(function(e){e.id===t.seriesId&&(r=e)}),r&&n.push(r.componentIndex)}}),n}var r=this.option.seriesId,i=this.option.seriesIndex;i==null&&r==null&&(i=`all`);var a=Dc(this.ecModel,`series`,{index:i,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return I(a,function(e){return e.componentIndex})},t.prototype.eachTargetSeries=function(e,t){F(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r=this.option,i=r.precision,a=this.dataBound,o=r.formatter,s;n||=[`<`,`>`],B(e)&&(e=e.slice(),s=!0);var c=t?e:s?[l(e[0]),l(e[1])]:l(e);return H(o)?o.replace(`{value}`,s?c[0]:c).replace(`{value2}`,s?c[1]:c):V(o)?s?o(e[0],e[1]):o(e):s?e[0]===a[0]?n[0]+` `+c[1]:e[1]===a[1]?n[1]+` `+c[0]:c[0]+` - `+c[1]:c;function l(e){return e===a[0]?`min`:e===a[1]?`max`:(+e).toFixed(Math.min(i,20))}},t.prototype.resetExtent=function(){var e=this.option,t=uH([e.min,e.max]);this._dataExtent=t},t.prototype.getDimension=function(e){var t=this,n=this.option.seriesTargets;if(n){var r=ie(n,function(n){return n.seriesIndex!=null&&n.seriesIndex===e||n.seriesId!=null&&n.seriesId===t.ecModel.getSeriesByIndex(e).id});if(r)return r.dimension}return this.option.dimension},t.prototype.getDataDimensionIndex=function(e){var t=e.hostModel.seriesIndex,n=this.getDimension(t);if(n!=null)return e.getDimensionIndex(n);for(var r=e.dimensions,i=r.length-1;i>=0;i--){var a=r[i],o=e.getDimensionInfo(a);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||={},i=t.controller||={};k(r,n),k(i,n);var a=this.isCategory();o.call(this,r),o.call(this,i),s.call(this,r,`inRange`,`outOfRange`),c.call(this,i);function o(n){cH(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get(`gradientColor`)}}function s(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},lH(r,function(e,t){if(OF.isValidType(t)){var n=iH.get(t,`inactive`,a);n!=null&&(i[t]=n,t===`color`&&!i.hasOwnProperty(`opacity`)&&!i.hasOwnProperty(`colorAlpha`)&&(i.opacity=[0,0]))}}))}function c(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get(`inactiveColor`),i=this.getItemSymbol()||`roundRect`;lH(this.stateList,function(o){var s=this.itemSize,c=e[o];c||=e[o]={color:a?r:[r]},c.symbol??(c.symbol=t&&O(t)||(a?i:[i])),c.symbolSize??(c.symbolSize=n&&O(n)||(a?s[0]:[s[0],s[0]])),c.symbol=oH(c.symbol,function(e){return e===`none`?i:e});var l=c.symbolSize;if(l!=null){var u=-1/0;sH(l,function(e){e>u&&(u=e)}),c.symbolSize=oH(l,function(e){return dH(e,[0,u],[0,s[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get(`itemWidth`)),parseFloat(this.get(`itemHeight`))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type=`visualMap`,t.dependencies=[`series`],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:`vertical`,backgroundColor:J.color.transparent,borderColor:J.color.borderTint,contentColor:J.color.theme[0],inactiveColor:J.color.disabled,borderWidth:0,padding:J.size.m,textGap:10,precision:0,textStyle:{color:J.color.secondary}},t}(y_),pH=function(e){a(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,r){this.visualMapModel=e,e.get(`show`)===!1?this.group.removeAll():this.doRender(e,t,n,r)},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=Kg(t.get(`padding`)||0),r=e.getBoundingRect();e.add(new Bo({z2:-1,silent:!0,shape:{x:r.x-n[3],y:r.y-n[0],width:r.width+n[3]+n[1],height:r.height+n[0]+n[2]},style:{fill:t.get(`backgroundColor`),stroke:t.get(`borderColor`),lineWidth:t.get(`borderWidth`)}}))},t.prototype.getControllerVisual=function(e,t,n){n||={};var r=n.forceState,i=this.visualMapModel,a={};t===`color`&&(a.color=i.get(`contentColor`));function o(e){return a[e]}function s(e,t){a[e]=t}var c=i.controllerVisuals[r||i.getValueState(e)];return F(OF.prepareVisualTypes(c),function(r){var i=c[r];n.convertOpacityToAlpha&&r===`opacity`&&(r=`colorAlpha`,i=c.__alphaForOpacity),OF.dependsOn(r,t)&&i&&i.applyVisual(e,o,s)}),a[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api,r=d_(t,n).refContainer;f_(e,t.getBoxLayoutParams(),r)},t.prototype.doRender=function(e,t,n,r){},t.type=`visualMap`,t}(yO),mH=[[`left`,`right`,`width`],[`top`,`bottom`,`height`]];function hH(e,t,n){var r=e.option,i=r.align;if(i!=null&&i!==`auto`)return i;for(var a={width:t.getWidth(),height:t.getHeight()},o=+(r.orient===`horizontal`),s=mH[o],c=[0,null,10],l={},u=0;u<3;u++)l[mH[1-o][u]]=c[u],l[s[u]]=u===2?n[0]:r[s[u]];var d=[[`x`,`width`,3],[`y`,`height`,0]][o],f=l_(l,a,r.padding);return s[(f.margin[d[2]]||0)+f[d[0]]+f[d[1]]*.5<a[d[1]]*.5?0:1]}function gH(e,t){return F(e||[],function(e){e.dataIndex!=null&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey=`visualMap`+(t?t.componentIndex:``)}),e}var _H={type:`selectDataRange`,event:`dataRangeSelected`,update:`update`},vH=function(e,t){t.eachComponent({mainType:`visualMap`,query:e},function(t){t.setSelected(e.selected)})},yH=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent(`visualMap`,function(t){var r=e.pipelineContext;!t.isTargetSeries(e)||r&&r.large||n.push(wB(t.stateList,t.targetVisuals,R(t.getValueState,t),t.getDataDimensionIndex(e.getData())))}),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),r=[];t.eachComponent(`visualMap`,function(t){if(t.isTargetSeries(e)){var i=t.getVisualMeta(R(bH,null,e,t))||{stops:[],outerColors:[]},a=t.getDataDimensionIndex(n);a>=0&&(i.dimension=a,r.push(i))}}),e.getData().setVisual(`visualMeta`,r)}}];function bH(e,t,n,r){for(var i=t.targetVisuals[r],a=OF.prepareVisualTypes(i),o={color:nk(e.getData(),`color`)},s=0,c=a.length;s<c;s++){var l=a[s],u=i[l===`opacity`?`__alphaForOpacity`:l];u&&u.applyVisual(n,d,f)}return o.color;function d(e){return o[e]}function f(e,t){o[e]=t}}var xH=F;function SH(e){var t=e&&e.visualMap;B(t)||(t=t?[t]:[]),xH(t,function(e){if(e){CH(e,`splitList`)&&!CH(e,`pieces`)&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&B(t)&&xH(t,function(e){U(e)&&(CH(e,`start`)&&!CH(e,`min`)&&(e.min=e.start),CH(e,`end`)&&!CH(e,`max`)&&(e.max=e.end))})}})}function CH(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var wH=!1;function TH(e){wH||(wH=!0,e.registerSubTypeDefaulter(`visualMap`,function(e){return!e.categories&&(!(e.pieces?e.pieces.length>0:e.splitNumber>0)||e.calculable)?`continuous`:`piecewise`}),e.registerAction(_H,vH),F(yH,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(SH))}var EH=function(e){a(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],DH[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){r===`categories`?(e.mappingMethod=`category`,e.categories=O(i)):(e.dataExtent=this.getExtent(),e.mappingMethod=`piecewise`,e.pieceList=I(this._pieceList,function(e){return e=O(e),t!==`inRange`&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=OF.listVisualTypes(),i=this.isCategory();F(t.pieces,function(e){F(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),F(n,function(e,n){var r=!1;F(this.stateList,function(e){r=r||a(t,e,n)||a(t.target,e,n)},this),!r&&F(this.stateList,function(e){(t[e]||(t[e]={}))[n]=iH.get(n,e===`inRange`?`active`:`inactive`,i)})},this);function a(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,F(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),n.selectedMode===`single`){var a=!1;F(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(a?i[n]=!1:a=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get(`itemSymbol`)},t.prototype.getSelectedMapKey=function(e){return this._mode===`categories`?e.value+``:e.index+``},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?`pieces`:this.option.categories?`categories`:`splitNumber`},t.prototype.setSelected=function(e){this.option.selected=O(e)},t.prototype.getValueState=function(e){var t=OF.findPieceIndex(e,this._pieceList);return t==null?`outOfRange`:this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],a=r.getData();a.each(this.getDataDimensionIndex(a),function(t,r){OF.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(e.value!=null)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var t=[],n=[``,``],r=this;function i(i,a){var o=r.getRepresentValue({interval:i});a||=r.getValueState(o);var s=e(o,a);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}var a=this._pieceList.slice();if(!a.length)a.push({interval:[-1/0,1/0]});else{var o=a[0].interval[0];o!==-1/0&&a.unshift({interval:[-1/0,o]}),o=a[a.length-1].interval[1],o!==1/0&&a.push({interval:[o,1/0]})}var s=-1/0;return F(a,function(e){var t=e.interval;t&&(t[0]>s&&i([s,t[0]],`outOfRange`),i(t.slice()),s=t[1])},this),{stops:t,outerColors:n}},t.type=`visualMap.piecewise`,t.defaultOption=kh(fH.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:`auto`,itemWidth:20,itemHeight:14,itemSymbol:`roundRect`,pieces:null,categories:null,splitNumber:5,selectedMode:`multiple`,itemGap:10,hoverLink:!0}),t}(fH),DH={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o<i;s+=a,o++){var c=o===i-1?r[1]:s+a;e.push({interval:[s,c],close:[1,1]})}t.maxOpen&&e.push({interval:[r[1],1/0],close:[0,0]}),zs(e),F(e,function(e,t){e.index=t,e.text=this.formatValueText(e.interval)},this)},categories:function(e){var t=this.option;F(t.categories,function(t){e.push({text:this.formatValueText(t,!0),value:t})},this),OH(t,e)},pieces:function(e){var t=this.option;F(t.pieces,function(t,n){U(t)||(t={value:t});var r={text:``,index:n};if(t.label!=null&&(r.text=t.label),t.hasOwnProperty(`value`)){var i=r.value=t.value;r.interval=[i,i],r.close=[1,1]}else{for(var a=r.interval=[],o=r.close=[0,0],s=[1,0,1],c=[-1/0,1/0],l=[],u=0;u<2;u++){for(var d=[[`gte`,`gt`,`min`],[`lte`,`lt`,`max`]][u],f=0;f<3&&a[u]==null;f++)a[u]=t[d[f]],o[u]=s[f],l[u]=f===2;a[u]??(a[u]=c[u])}l[0]&&a[1]===1/0&&(o[0]=0),l[1]&&a[0]===-1/0&&(o[1]=0),a[0]===a[1]&&o[0]&&o[1]&&(r.value=a[0])}r.visual=OF.retrieveVisuals(t),e.push(r)},this),OH(t,e),zs(e),F(e,function(e){var t=e.close,n=[[`<`,`≤`][t[1]],[`>`,`≥`][t[0]]];e.text=e.text||this.formatValueText(e.value==null?e.interval:e.value,!1,n)},this)}};function OH(e,t){var n=e.inverse;(e.orient===`vertical`?!n:n)&&t.reverse()}var kH=function(e){a(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get(`textGap`),r=t.textStyleModel,i=this._getItemAlign(),a=t.itemSize,o=this._getViewData(),s=o.endsText,c=me(t.get(`showLabel`,!0),!s),l=!t.get(`selectedMode`);s&&this._renderEndsText(e,s[0],a,c,i),F(o.viewPieceList,function(o){var s=o.piece,u=new Hu;u.onclick=R(this._onItemClick,this,s),this._enableHoverLink(u,o.indexInModelPieceList);var d=t.getRepresentValue(s);if(this._createItemSymbol(u,d,[0,0,a[0],a[1]],l),c){var f=this.visualMapModel.getValueState(d),p=r.get(`align`)||i;u.add(new Go({style:Qf(r,{x:p===`right`?-n:a[0]+n,y:a[1]/2,text:s.text,verticalAlign:r.get(`verticalAlign`)||`middle`,align:p,opacity:W(r.get(`opacity`),f===`outOfRange`?.5:1)}),silent:l}))}e.add(u)},this),s&&this._renderEndsText(e,s[1],a,c,i),a_(t.get(`orient`),e,t.get(`itemGap`)),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on(`mouseover`,function(){return r(`highlight`)}).on(`mouseout`,function(){return r(`downplay`)});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:gH(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if(t.orient===`vertical`)return hH(e,this.api,e.itemSize);var n=t.align;return n&&n!==`auto`||(n=`left`),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var a=new Hu,o=this.visualMapModel.textStyleModel;a.add(new Go({style:Qf(o,{x:r?i===`right`?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:`middle`,align:r?i:`center`,text:t})})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=I(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get(`text`),r=e.get(`orient`),i=e.get(`inverse`);return(r===`horizontal`?i:!i)?t.reverse():n&&=n.slice().reverse(),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n,r){var i=Lv(this.getControllerVisual(t,`symbol`),n[0],n[1],n[2],n[3],this.getControllerVisual(t,`color`));i.silent=r,e.add(i)},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=O(n.selected),a=t.getSelectedMapKey(e);r===`single`||r===!0?(i[a]=!0,F(i,function(e,t){i[t]=t===a})):i[a]=!i[a],this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type=`visualMap.piecewise`,t}(pH);function AH(e){e.registerComponentModel(EH),e.registerComponentView(kH),TH(e)}function jH(e){if(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].slice());return t}}function MH(e,t){var n=e.label,r=t&&t.getTextGuideLine();return{dataIndex:e.dataIndex,dataType:e.dataType,seriesIndex:e.seriesModel.seriesIndex,text:e.label.style.text,rect:e.hostRect,labelRect:e.rect,align:n.style.align,verticalAlign:n.style.verticalAlign,labelLinePoints:jH(r&&r.shape.points)}}var NH=[`align`,`verticalAlign`,`width`,`height`,`fontSize`],PH=new Jn,FH=xc(),IH=xc();function LH(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];t[i]!=null&&(e[i]=t[i])}}var RH=[`x`,`y`,`rotation`],zH=function(){function e(){this._labelList=[],this._chartViewList=[]}return e.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},e.prototype._addLabel=function(e,t,n,r,i){var a=r.style,o=r.__hostTarget.textConfig||{},s=r.getComputedTransform(),c=r.getBoundingRect().plain();K.applyTransform(c,c,s),s?PH.setLocalTransform(s):(PH.x=PH.y=PH.rotation=PH.originX=PH.originY=0,PH.scaleX=PH.scaleY=1),PH.rotation=ao(PH.rotation);var l=r.__hostTarget,u;if(l){u=l.getBoundingRect().plain();var d=l.getComputedTransform();K.applyTransform(u,u,d)}var f=u&&l.getTextGuideLine();this._labelList.push({label:r,labelLine:f,seriesModel:n,dataIndex:e,dataType:t,layoutOptionOrCb:i,layoutOption:null,rect:c,hostRect:u,priority:u?u.width*u.height:0,defaultAttr:{ignore:r.ignore,labelGuideIgnore:f&&f.ignore,x:PH.x,y:PH.y,scaleX:PH.scaleX,scaleY:PH.scaleY,rotation:PH.rotation,style:{x:a.x,y:a.y,align:a.align,verticalAlign:a.verticalAlign,width:a.width,height:a.height,fontSize:a.fontSize},cursor:r.cursor,attachedPos:o.position,attachedRot:o.rotation}})},e.prototype.addLabelsOfSeries=function(e){var t=this;this._chartViewList.push(e);var n=e.__model,r=n.get(`labelLayout`);(V(r)||L(r).length)&&e.group.traverse(function(e){if(e.ignore)return!0;var i=e.getTextContent(),a=Qc(e);i&&!i.disableLabelLayout&&t._addLabel(a.dataIndex,a.dataType,n,i,r)})},e.prototype.updateLayoutConfig=function(e){var t=e.getWidth(),n=e.getHeight();function r(e,t){return function(){OT(e,t)}}for(var i=0;i<this._labelList.length;i++){var a=this._labelList[i],o=a.label,s=o.__hostTarget,c=a.defaultAttr,l=void 0;l=V(a.layoutOptionOrCb)?a.layoutOptionOrCb(MH(a,s)):a.layoutOptionOrCb,l||={},a.layoutOption=l;var u=Math.PI/180;s&&s.setTextConfig({local:!1,position:l.x!=null||l.y!=null?null:c.attachedPos,rotation:l.rotate==null?c.attachedRot:l.rotate*u,offset:[l.dx||0,l.dy||0]});var d=!1;if(l.x==null?(o.x=c.x,o.setStyle(`x`,c.style.x)):(o.x=q(l.x,t),o.setStyle(`x`,0),d=!0),l.y==null?(o.y=c.y,o.setStyle(`y`,c.style.y)):(o.y=q(l.y,n),o.setStyle(`y`,0),d=!0),l.labelLinePoints){var f=s.getTextGuideLine();f&&(f.setShape({points:l.labelLinePoints}),d=!1)}var p=FH(o);p.needsUpdateLabelLine=d,o.rotation=l.rotate==null?c.rotation:l.rotate*u,o.scaleX=c.scaleX,o.scaleY=c.scaleY;for(var m=0;m<NH.length;m++){var h=NH[m];o.setStyle(h,l[h]==null?c.style[h]:l[h])}if(l.draggable){if(o.draggable=!0,o.cursor=`move`,s){var g=a.seriesModel;a.dataIndex!=null&&(g=a.seriesModel.getData(a.dataType).getItemModel(a.dataIndex)),o.on(`drag`,r(s,g.getModel(`labelLine`)))}}else o.off(`drag`),o.cursor=c.cursor}},e.prototype.layout=function(e){var t=e.getWidth(),n=e.getHeight(),r=[];F(this._labelList,function(e){e.defaultAttr.ignore||r.push(kS({},e))});var i=re(r,function(e){return e.layoutOption.moveOverlap===`shiftX`}),a=re(r,function(e){return e.layoutOption.moveOverlap===`shiftY`});jS(i,0,0,t),jS(a,1,0,n);var o=re(r,function(e){return e.layoutOption.hideOverlap});MS(o),NS(o)},e.prototype.processLabelsOverall=function(){var e=this;F(this._chartViewList,function(t){var n=t.__model,r=t.ignoreLabelLineUpdate,i=n.isAnimationEnabled();t.group.traverse(function(t){if(t.ignore&&!t.forceLabelAnimation)return!0;var a=!r,o=t.getTextContent();!a&&o&&(a=FH(o).needsUpdateLabelLine),a&&e._updateLabelLine(t,n),i&&e._animateLabels(t,n)})})},e.prototype._updateLabelLine=function(e,t){var n=e.getTextContent(),r=Qc(e),i=r.dataIndex;if(n&&i!=null){var a=t.getData(r.dataType),o=a.getItemModel(i),s={},c=a.getItemVisual(i,`style`);c&&(s.stroke=c[a.getVisual(`drawType`)]);var l=o.getModel(`labelLine`);FT(e,IT(o),s),OT(e,l)}},e.prototype._animateLabels=function(e,t){var n=e.getTextContent(),r=e.getTextGuideLine();if(n&&(e.forceLabelAnimation||!n.ignore&&!n.invisible&&!e.disableLabelAnimation&&!qd(e))){var i=FH(n),a=i.oldLayout,o=Qc(e),s=o.dataIndex,c={x:n.x,y:n.y,rotation:n.rotation},l=t.getData(o.dataType);if(a){n.attr(a);var u=e.prevStates;u&&(N(u,`select`)>=0&&n.attr(i.oldLayoutSelect),N(u,`emphasis`)>=0&&n.attr(i.oldLayoutEmphasis)),Gd(n,c,t,s)}else if(n.attr(c),!sp(n).valueAnimation){var d=W(n.style.opacity,1);n.style.opacity=0,Kd(n,{style:{opacity:d}},t,s)}if(i.oldLayout=c,n.states.select){var f=i.oldLayoutSelect={};LH(f,c,RH),LH(f,n.states.select,RH)}if(n.states.emphasis){var p=i.oldLayoutEmphasis={};LH(p,c,RH),LH(p,n.states.emphasis,RH)}lp(n,s,l,t,t)}if(r&&!r.ignore&&!r.invisible){var i=IH(r),a=i.oldLayout,m={points:r.shape.points};a?(r.attr({shape:a}),Gd(r,{shape:m},t)):(r.setShape(m),r.style.strokePercent=0,Kd(r,{style:{strokePercent:1}},t)),i.oldLayout=m}},e}(),BH=xc();function VH(e){e.registerUpdateLifecycle(`series:beforeupdate`,function(e,t,n){var r=BH(t).labelManager;r||=BH(t).labelManager=new zH,r.clearLabels()}),e.registerUpdateLifecycle(`series:layoutlabels`,function(e,t,n){var r=BH(t).labelManager;F(n.updatedSeries,function(e){r.addLabelsOfSeries(t.getViewOfSeriesModel(e))}),r.updateLayoutConfig(t),r.layout(t),r.processLabelsOverall()})}var HH=function(){function e(t,n){Ly(this,e.decoratedMethods),this._outOfBrk=Uy(null,n);var r=this._linear=Uy(null,n);Ry(this,r),this.breaks=t&&t.breaks||[]}return e.prototype.hasBreaks=function(){return!!this.breaks.length},e.prototype.calcNiceTickMultiple=function(e,t){for(var n=0;n<this.breaks.length;n++){var r=this.breaks[n];if(r.vmin<e&&e<r.vmax)return t(e,r.vmax)}return 0},e.decoratedMethods={needTransform:function(){return!this.breaks.length},getExtent:function(){return this._outOfBrk.getExtent()},getExtentUnsafe:function(e,t){return t==null||t===2?this._outOfBrk.getExtentUnsafe(e,null):this._linear.getExtentUnsafe(e,null)},setExtent:function(e,t){this.setExtent2(0,e,t)},setExtent2:function(e,t,n){Bc(t,n)&&(e===0&&KH(this,[t,n]),this._outOfBrk.setExtent2(e,t,n),this._linear.setExtent2(e,this.transformIn(t,null),this.transformIn(n,null)))},normalize:function(e){return this._linear.normalize(this.transformIn(e,null))},scale:function(e){return this.transformOut(this._linear.scale(e),null)},contain:function(e){return this._outOfBrk.contain(e)},transformIn:function(e,t){if(t&&t.depth===2)return e;for(var n=WH,r=GH,i=!0,a=0;a<this.breaks.length;a++){var o=this.breaks[a];if(e<=o.vmax){e>o.vmin?n+=o.vmin-r+(e-o.vmin)/(o.vmax-o.vmin)*o.gapReal:n+=e-r,r=o.vmax,i=!1;break}n+=o.vmin-r+o.gapReal,r=o.vmax}return i&&(n+=e-r),n},transformOut:function(e,t){if(t&&t.depth===2)return e;for(var n=WH,r=GH,i=!0,a=0,o=0;o<this.breaks.length;o++){var s=this.breaks[o],c=n+s.vmin-r,l=c+s.gapReal;if(e<=l){a=e>c?s.vmin+(e-c)/(l-c)*(s.vmax-s.vmin):r+e-n,r=s.vmax,i=!1;break}n=l,r=s.vmax}return i&&(a=r+e-n),a}},e}();function UH(e,t){return new HH(e,t)}var WH=0,GH=0;function KH(e,t){var n=0,r={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};F(e.breaks,function(e){var i=e.gapParsed;i.type===`tpPrct`&&(n+=i.val);var o=YH(e,t);if(o){var s=o.vmin!==e.vmin,c=o.vmax!==e.vmax,l=o.vmax-o.vmin;if(!(s&&c)){if(s||c){var u=s?`S`:`E`;a[u][i.type].has=!0,a[u][i.type].span=l,a[u][i.type].inExtFrac=l/(e.vmax-e.vmin),a[u][i.type].val=i.val}else r[i.type].span+=l,r[i.type].val+=i.val}}});var o=n*(0+(t[1]-t[0])+(r.tpAbs.val-r.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-r.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-r.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));F(e.breaks,function(e){var t=e.gapParsed;t.type===`tpPrct`&&(e.gapReal=n===0?0:ls(o,0)*t.val/n),t.type===`tpAbs`&&(e.gapReal=t.val),e.gapReal??=0})}function qH(e,t,n,r,i,a){e!==`no`&&F(n,function(n){var o=YH(n,a);if(o)for(var s=t.length-1;s>=0;s--){var c=t[s],l=r(c),u=i*3/4;l>o.vmin-u&&l<o.vmax+u&&(e!==`preserve_extent_bound`||l!==a[0]&&l!==a[1])&&t.splice(s,1)}})}function JH(e,t,n,r){F(t,function(t){var i=YH(t,n);i&&(e.push({value:i.vmin,break:{type:`vmin`,parsedBreak:i},time:r?r(i):void 0}),e.push({value:i.vmax,break:{type:`vmax`,parsedBreak:i},time:r?r(i):void 0}))}),t.length&&e.sort(function(e,t){return e.value-t.value})}function YH(e,t){var n=ls(e.vmin,t[0]),r=cs(e.vmax,t[1]);return n<r||n===r&&n>t[0]&&n<t[1]?{vmin:n,vmax:r,breakOption:e.breakOption,gapParsed:e.gapParsed,gapReal:e.gapReal}:null}function XH(e,t,n){var r=[];if(!e)return{breaks:r};function i(e,t){return e>=0&&e<.99999}F(e,function(e){if(e&&e.start!=null&&e.end!=null&&!e.isExpanded){var a={breakOption:O(e),vmin:t.parse(e.start),vmax:t.parse(e.end),gapParsed:{type:`tpAbs`,val:0},gapReal:null};if(e.gap!=null){var o=!1;if(H(e.gap)){var s=ye(e.gap);if(s.match(/%$/)){var c=parseFloat(s)/100;i(c,`Percent gap`)||(c=0),a.gapParsed.type=`tpPrct`,a.gapParsed.val=c,o=!0}}if(!o){var l=t.parse(e.gap);(!isFinite(l)||l<0)&&(l=0),a.gapParsed.type=`tpAbs`,a.gapParsed.val=l}}if(a.vmin===a.vmax&&(a.gapParsed.type=`tpAbs`,a.gapParsed.val=0),n&&n.noNegative&&F([`vmin`,`vmax`],function(e){a[e]<0&&(a[e]=0)}),a.vmin>a.vmax){var u=a.vmax;a.vmax=a.vmin,a.vmin=u}r.push(a)}}),r.sort(function(e,t){return e.vmin-t.vmin});var a=-1/0;return F(r,function(e,t){a>e.vmin&&(r[t]=null),a=e.vmax}),{breaks:re(r,function(e){return!!e})}}function ZH(e,t){return QH(t)===QH(e)}function QH(e){return e.start+`_\0_`+e.end}function $H(e,t,n){var r=[];F(e,function(e,n){var i=t(e);i&&i.type===`vmin`&&r.push([n])}),F(e,function(n,i){var a=t(n);if(a&&a.type===`vmax`){var o=ie(r,function(n){return ZH(t(e[n[0]]).parsedBreak.breakOption,a.parsedBreak.breakOption)});o&&o.push(i)}});var i=[];return F(r,function(t){t.length===2&&i.push(n?t:[e[t[0]],e[t[1]]])}),i}function eU(e,t,n,r){if(t.break){var i=t.break.parsedBreak,a=ie(n,function(e){return ZH(e.breakOption,t.break.parsedBreak.breakOption)}),o={lookup:r,depth:2},s={vmin:e.transformOut(i.vmin,o),vmax:e.transformOut(i.vmax,o),breakOption:i.breakOption,gapParsed:O(a.gapParsed),gapReal:i.gapReal};return{tickVal:s[t.break.type],vBreak:{type:t.break.type,parsedBreak:s}}}}function tU(e,t,n,r,i){i.original=XH(e,t,n);var a=i.transformed=XH(e,t,n),o=i.lookup;a.breaks=I(a.breaks,function(e,n){var i={depth:2},a=t.transformIn(e.vmin,i),s=t.transformIn(e.vmax,i),c={type:e.gapParsed.type,val:e.gapParsed.type===`tpAbs`?t.transformIn(e.vmin+e.gapParsed.val,i)-a:e.gapParsed.val};return o.from[r+n]=a,o.to[r+n]=e.vmin,o.from[r+n+1]=s,o.to[r+n+1]=e.vmax,{vmin:a,vmax:s,gapParsed:c,gapReal:e.gapReal,breakOption:e.breakOption}})}var nU={vmin:`start`,vmax:`end`};function rU(e,t){return t&&(e||={},e.break={type:nU[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function iU(){rg({createBreakScaleMapper:UH,pruneTicksByBreak:qH,addBreaksToTicks:JH,parseAxisBreakOption:XH,identifyAxisBreak:ZH,serializeAxisBreakIdentifier:QH,retrieveAxisBreakPairs:$H,getTicksBreakOutwardTransform:eU,parseAxisBreakOptionInwardTransform:tU,makeAxisLabelFormatterParamBreak:rU})}var aU=xc();function oU(e,t){var n=ie(e,function(e){return ig().identifyAxisBreak(e.parsedBreak.breakOption,t.breakOption)});return n||e.push(n={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),n}function sU(e){F(e,function(e){return e.shouldRemove=!0})}function cU(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function lU(e,t,n,r,i){var a=n.axis;if(a.scale.isBlank()||!ig())return;var o=ig().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:`only_break`}),function(e){return e.break},!1);if(!o.length)return;var s=n.getModel(`breakArea`),c=s.get(`zigzagAmplitude`),l=s.get(`zigzagMinSpan`),u=s.get(`zigzagMaxSpan`);l=Math.max(2,l||0),u=Math.max(l,u||0);var d=s.get(`expandOnClick`),f=s.get(`zigzagZ`),p=s.getModel(`itemStyle`).getItemStyle(),m=p.stroke,h=p.lineWidth,g=p.lineDash,_=p.fill,v=new Hu({ignoreModelZ:!0}),y=a.isHorizontal(),b=aU(t).visualList||(aU(t).visualList=[]);sU(b);for(var x=function(e){var t=o[e][0].break.parsedBreak,r=[];r[0]=a.toGlobalCoord(a.dataToCoord(t.vmin,!0)),r[1]=a.toGlobalCoord(a.dataToCoord(t.vmax,!0)),r[1]<r[0]&&r.reverse();var s=oU(b,t);s.shouldRemove=!1;var c=new Hu;C(s.zigzagRandomList,c,r[0],r[1],y,t),d&&c.on(`click`,function(){var e={type:RS,breaks:[{start:t.breakOption.start,end:t.breakOption.end}]};e[a.dim+`AxisIndex`]=n.componentIndex,i.dispatchAction(e)}),c.silent=!d,v.add(c)},S=0;S<o.length;S++)x(S);e.add(v),cU(b);function C(e,t,n,i,a,o){var s={stroke:m,lineWidth:h,lineDash:g,fill:`none`},d=+!a,v=1-d,y=r[ef[v]]+r[tf[v]];function b(e){var t=[],n=[];t[d]=n[d]=e,t[v]=r[ef[v]],n[v]=y;var i={x1:t[0],y1:t[1],x2:n[0],y2:n[1]};return Fo(i,i,{lineWidth:1}),t[0]=i.x1,t[1]=i.y1,t[d]}n=b(n),i=b(i);for(var x=[],S=[],C=!0,w=r[ef[v]],T=0;;T++){var E=w===r[ef[v]],D=w>=y;D&&(w=y);var O=[],k=[];O[d]=n,k[d]=i,!E&&!D&&(O[d]+=C?-c:c,k[d]-=C?c:-c),O[v]=w,k[v]=w,x.push(O),S.push(k);var A=void 0;if(T<e.length?A=e[T]:(A=Math.random(),e.push(A)),w+=A*(u-l)+l,C=!C,D)break}var j=ig().serializeAxisBreakIdentifier(o.breakOption);if(t.add(new _d({anid:`break_a_`+j,shape:{points:x},style:s,z:f})),o.gapReal!==0){t.add(new _d({anid:`break_b_`+j,shape:{points:S},style:s,z:f}));var M=S.slice();M.reverse();var N=x.concat(M);t.add(new hd({anid:`break_c_`+j,shape:{points:N},style:{fill:_,opacity:p.opacity},z:f}))}}}function uU(e,t,n,r){var i=e.axis,a=n.transform;ve(r.style);var o=i.getExtent();i.inverse&&(o=o.slice(),o.reverse());var s=I(ig().retrieveAxisBreakPairs(i.scale.getTicks({breakTicks:`only_break`}),function(e){return e.break},!1),function(e){var t=e[0].break.parsedBreak,n=[i.dataToCoord(t.vmin,!0),i.dataToCoord(t.vmax,!0)];return n[0]>n[1]&&n.reverse(),{coordPair:n,brkId:ig().serializeAxisBreakIdentifier(t.breakOption)}});s.sort(function(e,t){return e.coordPair[0]-t.coordPair[0]});for(var c=o[0],l=null,u=0;u<s.length;u++){var d=s[u],f=Math.max(d.coordPair[0],o[0]),p=Math.min(d.coordPair[1],o[1]);c<=f&&m(c,f,l,d),c=p,l=d}c<=o[1]&&m(c,o[1],l,null);function m(e,n,i,o){function s(e,t){a&&(At(e,e,a),At(t,t,a))}function c(e,t){var n={x1:e[0],y1:e[1],x2:t[0],y2:t[1]};Fo(n,n,r.style),e[0]=n.x1,e[1]=n.y1,t[0]=n.x2,t[1]=n.y2}var l=[e,0],u=[n,0],d=[e,5],f=[n,5];s(l,d),c(l,d),s(u,f),c(u,f),c(l,u);var p=new bd(A({shape:{x1:l[0],y1:l[1],x2:u[0],y2:u[1]}},r));t.add(p),p.anid=`breakLine_`+(i?i.brkId:`\0`)+`_\0_`+(o?o.brkId:`\0`)}}function dU(e,t,n){if(ie(n,function(e){return!e}))return;var r=new Nt;if(!PS(n[0],n[1],r,{direction:-(e?t+Math.PI:t),touchThreshold:0,bidirectional:!1}))return;var i=st();ft(i,i,-t);var a=I(n,function(e){return e.transform?ut(st(),i,e.transform):i});function o(e){var t=n[0].localRect,r=new Nt(t[tf[e]]*a[0][0],t[tf[e]]*a[0][1]);return Math.abs(r.y)<1e-5}var s=.5;if(o(0)||o(1)){var c=I(n,function(e,t){var n=e.localRect.clone();return n.applyTransform(a[t]),n}),l=new Nt;l.copy(n[0].label).add(n[1].label).scale(.5),l.transform(i);var u=r.clone().transform(i),d=(c[0].x+c[1].x+(u.x>=0?c[0].width:c[1].width)+u.x)/2-l.x,f=Math.min(d,d-u.x),p=Math.max(d,d-u.x);s=(d-(p<0?p:f>0?f:0))/u.x}var m=new Nt,h=new Nt;Nt.scale(m,r,-s),Nt.scale(h,r,1-s),OS(n[0],m),OS(n[1],h)}function fU(e,t){var n={breaks:[]};return F(t.breaks,function(r){if(r){var i=ie(e.get(`breaks`,!0),function(e){return ig().identifyAxisBreak(e,r)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===`expandAxisBreak`?!0:a===`collapseAxisBreak`?!1:a===`toggleAxisBreak`?!i.isExpanded:i.isExpanded,n.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),n}function pU(){IS({adjustBreakLabelPair:dU,buildAxisBreakLine:uU,rectCoordBuildBreakAxis:lU,updateModelAxisBreak:fU})}function mU(e){KS(e),iU(),pU()}var hU=Math.sin,gU=Math.cos,_U=Math.PI,vU=Math.PI*2,yU=180/_U,bU=function(){function e(){}return e.prototype.reset=function(e){this._start=!0,this._d=[],this._str=``,this._p=10**(e||4)},e.prototype.moveTo=function(e,t){this._add(`M`,e,t)},e.prototype.lineTo=function(e,t){this._add(`L`,e,t)},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){this._add(`C`,e,t,n,r,i,a)},e.prototype.quadraticCurveTo=function(e,t,n,r){this._add(`Q`,e,t,n,r)},e.prototype.arc=function(e,t,n,r,i,a){this.ellipse(e,t,n,n,0,r,i,a)},e.prototype.ellipse=function(e,t,n,r,i,a,o,s){var c=o-a,l=!s,u=Math.abs(c),d=ni(u-vU)||(l?c>=vU:-c>=vU),f=c>0?c%vU:c%vU+vU,p=!1;p=d?!0:!ni(u)&&f>=_U==!!l;var m=e+n*gU(a),h=t+r*hU(a);this._start&&this._add(`M`,m,h);var g=Math.round(i*yU);if(d){var _=1/this._p,v=(l?1:-1)*(vU-_);this._add(`A`,n,r,g,1,+l,e+n*gU(a+v),t+r*hU(a+v)),_>.01&&this._add(`A`,n,r,g,0,+l,m,h)}else{var y=e+n*gU(o),b=t+r*hU(o);this._add(`A`,n,r,g,+p,+l,y,b)}},e.prototype.rect=function(e,t,n,r){this._add(`M`,e,t),this._add(`l`,n,0),this._add(`l`,0,r),this._add(`l`,-n,0),this._add(`Z`)},e.prototype.closePath=function(){this._d.length>0&&this._add(`Z`)},e.prototype._add=function(e,t,n,r,i,a,o,s,c){for(var l=[],u=this._p,d=1;d<arguments.length;d++){var f=arguments[d];if(isNaN(f)){this._invalid=!0;return}l.push(Math.round(f*u)/u)}this._d.push(e+l.join(` `)),this._start=e===`Z`},e.prototype.generateStr=function(){this._str=this._invalid?``:this._d.join(``),this._d=[]},e.prototype.getStr=function(){return this._str},e}(),xU=`none`,SU=Math.round;function CU(e){var t=e.fill;return t!=null&&t!==xU}function wU(e){var t=e.stroke;return t!=null&&t!==xU}var TU=[`lineCap`,`miterLimit`,`lineJoin`],EU=I(TU,function(e){return`stroke-`+e.toLowerCase()});function DU(e,t,n,r){var i=t.opacity==null?1:t.opacity;if(n instanceof Mo)e(`opacity`,i);else{if(CU(t)){var a=ei(t.fill);e(`fill`,a.color);var o=t.fillOpacity==null?a.opacity*i:t.fillOpacity*a.opacity*i;(r||o<1)&&e(`fill-opacity`,o)}else e(`fill`,xU);if(wU(t)){var s=ei(t.stroke);e(`stroke`,s.color);var c=t.strokeNoScale?n.getLineScale():1,l=c?(t.lineWidth||0)/c:0,u=t.strokeOpacity==null?s.opacity*i:t.strokeOpacity*s.opacity*i,d=t.strokeFirst;if((r||l!==1)&&e(`stroke-width`,l),(r||d)&&e(`paint-order`,d?`stroke`:`fill`),(r||u<1)&&e(`stroke-opacity`,u),t.lineDash){var f=Sk(n),p=f[0],m=f[1];p&&(m=SU(m||0),e(`stroke-dasharray`,p.join(`,`)),(m||r)&&e(`stroke-dashoffset`,m))}else r&&e(`stroke-dasharray`,xU);for(var h=0;h<TU.length;h++){var g=TU[h];if(r||t[g]!==Co[g]){var _=t[g]||Co[g];_&&e(EU[h],_)}}}else r&&e(`stroke`,xU)}}var OU=`http://www.w3.org/2000/svg`,kU=`http://www.w3.org/1999/xlink`,AU=`http://www.w3.org/2000/xmlns/`,jU=`http://www.w3.org/XML/1998/namespace`,MU=`ecmeta_`;function NU(e){return document.createElementNS(OU,e)}function PU(e,t,n,r,i){return{tag:e,attrs:n||{},children:r,text:i,key:t}}function FU(e,t){var n=[];if(t)for(var r in t){var i=t[r],a=r;i!==!1&&(i!==!0&&i!=null&&(a+=`="`+i+`"`),n.push(a))}return`<`+e+` `+n.join(` `)+`>`}function IU(e){return`</`+e+`>`}function LU(e,t){t||={};var n=t.newline?`
19
19
  `:``;function r(e){var t=e.children,i=e.tag,a=e.attrs,o=e.text;return FU(i,a)+(i===`style`?o||``:Uh(o))+(t?``+n+I(t,function(e){return r(e)}).join(n)+n:``)+IU(i)}return r(e)}function RU(e,t,n){n||={};var r=n.newline?`
20
- `:``,i=` {`+r,a=r+`}`,o=I(L(e),function(t){return t+i+I(L(e[t]),function(n){return n+`:`+e[t][n]+`;`}).join(r)+a}).join(r),s=I(L(t),function(e){return`@keyframes `+e+i+I(L(t[e]),function(n){return n+i+I(L(t[e][n]),function(r){var i=t[e][n][r];return r===`d`&&(i=`path("`+i+`")`),r+`:`+i+`;`}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?``:[`<![CDATA[`,o,s,`]]>`].join(r)}function zU(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function BU(e,t,n,r){return PU(`svg`,`root`,{width:e,height:t,xmlns:OU,"xmlns:xlink":kU,version:`1.1`,baseProfile:`full`,viewBox:r?`0 0 `+e+` `+t:!1},n)}var VU=0;function HU(){return VU++}var UU={cubicIn:`0.32,0,0.67,0`,cubicOut:`0.33,1,0.68,1`,cubicInOut:`0.65,0,0.35,1`,quadraticIn:`0.11,0,0.5,0`,quadraticOut:`0.5,1,0.89,1`,quadraticInOut:`0.45,0,0.55,1`,quarticIn:`0.5,0,0.75,0`,quarticOut:`0.25,1,0.5,1`,quarticInOut:`0.76,0,0.24,1`,quinticIn:`0.64,0,0.78,0`,quinticOut:`0.22,1,0.36,1`,quinticInOut:`0.83,0,0.17,1`,sinusoidalIn:`0.12,0,0.39,0`,sinusoidalOut:`0.61,1,0.88,1`,sinusoidalInOut:`0.37,0,0.63,1`,exponentialIn:`0.7,0,0.84,0`,exponentialOut:`0.16,1,0.3,1`,exponentialInOut:`0.87,0,0.13,1`,circularIn:`0.55,0,1,0.45`,circularOut:`0,0.55,0.45,1`,circularInOut:`0.85,0,0.15,1`},WU=`transform-origin`;function GU(e,t,n){var r=A({},e.shape);A(r,t),e.buildPath(n,r);var i=new bU;return i.reset(_i(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function KU(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[WU]=n+`px `+r+`px`)}var qU={fill:`fill`,opacity:`opacity`,lineWidth:`stroke-width`,lineDashOffset:`stroke-dashoffset`};function JU(e,t){var n=t.zrId+`-ani-`+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function YU(e,t,n){var r=e.shape.paths,i={},a,o;if(F(r,function(e){var t=zU(n.zrId);t.animation=!0,ZU(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,c=L(r),l=c.length;if(l){o=c[l-1];var u=r[o];for(var d in u){var f=u[d];i[d]=i[d]||{d:``},i[d].d+=f.d||``}for(var p in s){var m=s[p].animation;m.indexOf(o)>=0&&(a=m)}}}),a){t.d=!1;var s=JU(i,n);return a.replace(o,s)}}function XU(e){return H(e)?UU[e]?`cubic-bezier(`+UU[e]+`)`:Er(e)?e:``:``}function ZU(e,t,n,r){var i=e.animators,a=i.length,o=[];if(e instanceof Dd){var s=YU(e,t,n);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var c={},l=0;l<a;l++){var u=i[l],d=[u.getMaxTime()/1e3+`s`],f=XU(u.getClip().easing),p=u.getDelay();f?d.push(f):d.push(`linear`),p&&d.push(p/1e3+`s`),u.getLoop()&&d.push(`infinite`);var m=d.join(` `);c[m]=c[m]||[m,[]],c[m][1].push(u)}function h(i){var a=i[1],o=a.length,s={},c={},l={},u=`animation-timing-function`;function d(e,t,n){for(var r=e.getTracks(),i=e.getMaxTime(),a=0;a<r.length;a++){var o=r[a];if(o.needsAnimate()){var s=o.keyframes,c=o.propName;if(n&&(c=n(c)),c)for(var l=0;l<s.length;l++){var d=s[l],f=Math.round(d.time/i*100)+`%`,p=XU(d.easing),m=d.rawValue;(H(m)||se(m))&&(t[f]=t[f]||{},t[f][c]=d.rawValue,p&&(t[f][u]=p))}}}}for(var f=0;f<o;f++){var p=a[f],m=p.targetName;m?m===`shape`&&d(p,c):!r&&d(p,s)}for(var h in s){var g={};Qn(g,e),A(g,s[h]);var _=vi(g),v=s[h][u];l[h]=_?{transform:_}:{},KU(l[h],g),v&&(l[h][u]=v)}var y,b=!0;for(var h in c){l[h]=l[h]||{};var x=!y,v=c[h][u];x&&(y=new eo);var S=y.len();y.reset(),l[h].d=GU(e,c[h],y);var C=y.len();if(!x&&S!==C){b=!1;break}v&&(l[h][u]=v)}if(!b)for(var h in l)delete l[h].d;if(!r)for(var f=0;f<o;f++){var p=a[f],m=p.targetName;m===`style`&&d(p,l,function(e){return qU[e]})}for(var w=L(l),T=!0,E,f=1;f<w.length;f++){var D=w[f-1],O=w[f];if(l[D][WU]!==l[O][WU]){T=!1;break}E=l[D][WU]}if(T&&E){for(var h in l)l[h][WU]&&delete l[h][WU];t[WU]=E}if(re(w,function(e){return L(l[e]).length>0}).length)return JU(l,n)+` `+i[0]+` both`}for(var g in c){var s=h(c[g]);s&&o.push(s)}if(o.length){var _=n.zrId+`-cls-`+HU();n.cssNodes[`.`+_]={animation:o.join(`,`)},t.class=_}}function QU(e,t,n){if(!e.ignore){if(e.isSilent()){var r={"pointer-events":`none`};$U(r,t,n,!0)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,c=e.currentStates.indexOf(`select`)>=0&&s||o;c&&(a=Qr(c))}var l=i.lineWidth;if(l){var u=!i.strokeNoScale&&e.transform?e.transform[0]:1;l/=u}var r={cursor:`pointer`};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),l&&(r[`stroke-width`]=l),$U(r,t,n,!0)}}}function $U(e,t,n,r){var i=JSON.stringify(e),a=n.cssStyleCache[i];a||(a=n.zrId+`-cls-`+HU(),n.cssStyleCache[i]=a,n.cssNodes[`.`+a+(r?`:hover`:``)]=e),t.class=t.class?t.class+` `+a:a}var eW=Math.round;function tW(e){return e&&H(e.src)}function nW(e){return e&&V(e.toDataURL)}function rW(e,t,n,r){DU(function(i,a){var o=i===`fill`||i===`stroke`;o&&hi(a)?vW(t,e,i,r):o&&fi(a)?yW(n,e,i,r):e[i]=a,o&&r.ssr&&a===`none`&&(e[`pointer-events`]=`visible`)},t,n,!1),_W(n,e,r)}function iW(e,t){var n=bD(t);n&&(n.each(function(t,n){t!=null&&(e[(`ecmeta_`+n).toLowerCase()]=t+``)}),t.isSilent()&&(e[MU+`silent`]=`true`))}function aW(e){return ni(e[0]-1)&&ni(e[1])&&ni(e[2])&&ni(e[3]-1)}function oW(e){return ni(e[4])&&ni(e[5])}function sW(e,t,n){if(t&&!(oW(t)&&aW(t))){var r=n?10:1e4;e.transform=aW(t)?`translate(`+eW(t[4]*r)/r+` `+eW(t[5]*r)/r+`)`:ai(t)}}function cW(e,t,n){for(var r=e.points,i=[],a=0;a<r.length;a++)i.push(eW(r[a][0]*n)/n),i.push(eW(r[a][1]*n)/n);t.points=i.join(` `)}function lW(e){return!e.smooth}function uW(e){var t=I(e,function(e){return typeof e==`string`?[e,e]:e});return function(e,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=e[a[0]];o!=null&&(n[a[1]]=eW(o*r)/r)}}}var dW={circle:[uW([`cx`,`cy`,`r`])],polyline:[cW,lW],polygon:[cW,lW]};function fW(e){for(var t=e.animators,n=0;n<t.length;n++)if(t[n].targetName===`shape`)return!0;return!1}function pW(e,t){var n=e.style,r=e.shape,i=dW[e.type],a={},o=t.animation,s=`path`,c=e.style.strokePercent,l=t.compress&&_i(e)||4;if(i&&!t.willUpdate&&(!i[1]||i[1](r))&&!(o&&fW(e))&&!(c<1)){s=e.type;var u=10**l;i[0](r,a,u)}else{var d=!e.path||e.shapeChanged();e.path||e.createPathProxy();var f=e.path;d&&(f.beginPath(),e.buildPath(f,e.shape),e.pathUpdated());var p=f.getVersion(),m=e,h=m.__svgPathBuilder;m.__svgPathVersion===p&&h&&c===m.__svgPathStrokePercent||(h||=m.__svgPathBuilder=new bU,h.reset(l),f.rebuildPath(h,c),h.generateStr(),m.__svgPathVersion=p,m.__svgPathStrokePercent=c),a.d=h.getStr()}return sW(a,e.transform),rW(a,n,e,t),iW(a,e),t.animation&&ZU(e,a,t),t.emphasis&&QU(e,a,t),PU(s,e.id+``,a)}function mW(e,t){var n=e.style,r=n.image;if(r&&!H(r)&&(tW(r)?r=r.src:nW(r)&&(r=r.toDataURL())),r){var i=n.x||0,a=n.y||0,o=n.width,s=n.height,c={href:r,width:o,height:s};return i&&(c.x=i),a&&(c.y=a),sW(c,e.transform),rW(c,n,e,t),iW(c,e),t.animation&&ZU(e,c,t),PU(`image`,e.id+``,c)}}function hW(e,t){var n=e.style,r=n.text;if(r!=null&&(r+=``),!(!r||isNaN(n.x)||isNaN(n.y))){var i=n.font||`12px sans-serif`,a=n.x||0,o=si(n.y||0,gn(i),n.textBaseline),s={"dominant-baseline":`central`,"text-anchor":oi[n.textAlign]||n.textAlign};if(Zo(n)){var c=``,l=n.fontStyle,u=Yo(n.fontSize);if(!parseFloat(u))return;var d=n.fontFamily||`sans-serif`,f=n.fontWeight;c+=`font-size:`+u+`;font-family:`+d+`;`,l&&l!==`normal`&&(c+=`font-style:`+l+`;`),f&&f!==`normal`&&(c+=`font-weight:`+f+`;`),s.style=c}else s.style=`font: `+i;return r.match(/\s/)&&(s[`xml:space`]=`preserve`),a&&(s.x=a),o&&(s.y=o),sW(s,e.transform),rW(s,n,e,t),iW(s,e),t.animation&&ZU(e,s,t),PU(`text`,e.id+``,s,void 0,r)}}function gW(e,t){if(e instanceof Eo)return pW(e,t);if(e instanceof Mo)return mW(e,t);if(e instanceof Oo)return hW(e,t)}function _W(e,t,n){var r=e.style;if(ci(r)){var i=li(e),a=n.shadowCache,o=a[i];if(!o){var s=e.getGlobalScale(),c=s[0],l=s[1];if(!c||!l)return;var u=r.shadowOffsetX||0,d=r.shadowOffsetY||0,f=r.shadowBlur,p=ei(r.shadowColor),m=p.opacity,h=p.color,g=f/2/c,_=f/2/l,v=g+` `+_;o=n.zrId+`-s`+n.shadowIdx++,n.defs[o]=PU(`filter`,o,{id:o,x:`-100%`,y:`-100%`,width:`300%`,height:`300%`},[PU(`feDropShadow`,``,{dx:u/c,dy:d/l,stdDeviation:v,"flood-color":h,"flood-opacity":m})]),a[i]=o}t.filter=gi(o)}}function vW(e,t,n,r){var i=e[n],a,o={gradientUnits:i.global?`userSpaceOnUse`:`objectBoundingBox`};if(pi(i))a=`linearGradient`,o.x1=i.x,o.y1=i.y,o.x2=i.x2,o.y2=i.y2;else if(mi(i))a=`radialGradient`,o.cx=W(i.x,.5),o.cy=W(i.y,.5),o.r=W(i.r,.5);else return;for(var s=i.colorStops,c=[],l=0,u=s.length;l<u;++l){var d=ii(s[l].offset)*100+`%`,f=s[l].color,p=ei(f),m=p.color,h=p.opacity,g={offset:d};g[`stop-color`]=m,h<1&&(g[`stop-opacity`]=h),c.push(PU(`stop`,l+``,g))}var _=LU(PU(a,``,o,c)),v=r.gradientCache,y=v[_];y||(y=r.zrId+`-g`+r.gradientIdx++,v[_]=y,o.id=y,r.defs[y]=PU(a,y,o,c)),t[n]=gi(y)}function yW(e,t,n,r){var i=e.style[n],a=e.getBoundingRect(),o={},s=i.repeat,c=s===`no-repeat`,l=s===`repeat-x`,u=s===`repeat-y`,d;if(ui(i)){var f=i.imageWidth,p=i.imageHeight,m=void 0,h=i.image;if(H(h)?m=h:tW(h)?m=h.src:nW(h)&&(m=h.toDataURL()),typeof Image>`u`){var g=`Image width/height must been given explictly in svg-ssr renderer.`;ve(f,g),ve(p,g)}else if(f==null||p==null){var _=function(e,t){if(e){var n=e.elm,r=f||t.width,i=p||t.height;e.tag===`pattern`&&(l?(i=1,r/=a.width):u&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute(`width`,r),n.setAttribute(`height`,i))}},v=it(m,null,e,function(e){c||_(S,e),_(d,e)});v&&v.width&&v.height&&(f||=v.width,p||=v.height)}d=PU(`image`,`img`,{href:m,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=O(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var y,b;c?y=b=1:l?(b=1,y=o.width/a.width):u?(y=1,b=o.height/a.height):o.patternUnits=`userSpaceOnUse`,y!=null&&!isNaN(y)&&(o.width=y),b!=null&&!isNaN(b)&&(o.height=b);var x=vi(i);x&&(o.patternTransform=x);var S=PU(`pattern`,``,o,[d]),C=LU(S),w=r.patternCache,T=w[C];T||(T=r.zrId+`-p`+r.patternIdx++,w[C]=T,o.id=T,S=r.defs[T]=PU(`pattern`,T,o,[d])),t[n]=gi(T)}}function bW(e,t,n){var r=n.clipPathCache,i=n.defs,a=r[e.id];if(!a){a=n.zrId+`-c`+n.clipPathIdx++;var o={id:a};r[e.id]=a,i[a]=PU(`clipPath`,a,o,[pW(e,n)])}t[`clip-path`]=gi(a)}function xW(e){return document.createTextNode(e)}function SW(e,t,n){e.insertBefore(t,n)}function CW(e,t){e.removeChild(t)}function wW(e,t){e.appendChild(t)}function TW(e){return e.parentNode}function EW(e){return e.nextSibling}function DW(e,t){e.textContent=t}var OW=58,kW=120,AW=PU(``,``);function jW(e){return e===void 0}function MW(e){return e!==void 0}function NW(e,t,n){for(var r={},i=t;i<=n;++i){var a=e[i].key;a!==void 0&&(r[a]=i)}return r}function PW(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function FW(e){var t,n=e.children,r=e.tag;if(MW(r)){var i=e.elm=NU(r);if(RW(AW,e),B(n))for(t=0;t<n.length;++t){var a=n[t];a!=null&&wW(i,FW(a))}else MW(e.text)&&!U(e.text)&&wW(i,xW(e.text))}else e.elm=xW(e.text);return e.elm}function IW(e,t,n,r,i){for(;r<=i;++r){var a=n[r];a!=null&&SW(e,FW(a),t)}}function LW(e,t,n,r){for(;n<=r;++n){var i=t[n];i!=null&&(MW(i.tag)?CW(TW(i.elm),i.elm):CW(e,i.elm))}}function RW(e,t){var n,r=t.elm,i=e&&e.attrs||{},a=t.attrs||{};if(i!==a){for(n in a){var o=a[n];i[n]!==o&&(o===!0?r.setAttribute(n,``):o===!1?r.removeAttribute(n):n===`style`?r.style.cssText=o:n.charCodeAt(0)===kW?n===`xmlns:xlink`||n===`xmlns`?r.setAttributeNS(AU,n,o):n.charCodeAt(3)===OW?r.setAttributeNS(jU,n,o):n.charCodeAt(5)===OW?r.setAttributeNS(kU,n,o):r.setAttribute(n,o):r.setAttribute(n,o))}for(n in i)n in a||r.removeAttribute(n)}}function zW(e,t,n){for(var r=0,i=0,a=t.length-1,o=t[0],s=t[a],c=n.length-1,l=n[0],u=n[c],d,f,p,m;r<=a&&i<=c;)o==null?o=t[++r]:s==null?s=t[--a]:l==null?l=n[++i]:u==null?u=n[--c]:PW(o,l)?(BW(o,l),o=t[++r],l=n[++i]):PW(s,u)?(BW(s,u),s=t[--a],u=n[--c]):PW(o,u)?(BW(o,u),SW(e,o.elm,EW(s.elm)),o=t[++r],u=n[--c]):PW(s,l)?(BW(s,l),SW(e,s.elm,o.elm),s=t[--a],l=n[++i]):(jW(d)&&(d=NW(t,r,a)),f=d[l.key],jW(f)?SW(e,FW(l),o.elm):(p=t[f],p.tag===l.tag?(BW(p,l),t[f]=void 0,SW(e,p.elm,o.elm)):SW(e,FW(l),o.elm)),l=n[++i]);(r<=a||i<=c)&&(r>a?(m=n[c+1]==null?null:n[c+1].elm,IW(e,m,n,i,c)):LW(e,t,r,a))}function BW(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(RW(e,t),jW(t.text)?MW(r)&&MW(i)?r!==i&&zW(n,r,i):MW(i)?(MW(e.text)&&DW(n,``),IW(n,null,i,0,i.length-1)):MW(r)?LW(n,r,0,r.length-1):MW(e.text)&&DW(n,``):e.text!==t.text&&(MW(r)&&LW(n,r,0,r.length-1),DW(n,t.text)))}function VW(e,t){if(PW(e,t))BW(e,t);else{var n=e.elm,r=TW(n);FW(t),r!==null&&(SW(r,t.elm,EW(n)),LW(r,[e],0,0))}return t}var HW=0,UW=function(){function e(e,t,n){if(this.type=`svg`,this.configLayer=WW(`configLayer`),this.storage=t,this._opts=n=A({},n),this.root=e,this._id=`zr`+HW++,this._oldVNode=BU(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden`;var i=this._svgDom=this._oldVNode.elm=NU(`svg`);RW(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style=`position:absolute;left:0;top:0;user-select:none`,VW(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return gW(e,zU(this._id))},e.prototype.renderToVNode=function(e){e||={};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=zU(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var a=[],o=this._bgVNode=GW(n,r,this._backgroundColor,i);o&&a.push(o);var s=e.compress?null:this._mainVNode=PU(`g`,`main`,{},[]);this._paintList(t,i,s?s.children:a),s&&a.push(s);var c=I(L(i.defs),function(e){return i.defs[e]});if(c.length&&a.push(PU(`defs`,`defs`,{},c)),e.animation){var l=RU(i.cssNodes,i.cssAnims,{newline:!0});if(l){var u=PU(`style`,`stl`,{},[],l);a.push(u)}}return BU(n,r,a,e.useViewBox)},e.prototype.renderToString=function(e){return e||={},LU(this.renderToVNode({animation:W(e.cssAnimation,!0),emphasis:W(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:W(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r=e.length,i=[],a=0,o,s,c=0,l=0;l<r;l++){var u=e[l];if(!u.invisible){var d=u.__clipPaths,f=d&&d.length||0,p=s&&s.length||0,m=void 0;for(m=Math.max(f-1,p-1);m>=0&&!(d&&s&&d[m]===s[m]);m--);for(var h=p-1;h>m;h--)a--,o=i[a-1];for(var g=m+1;g<f;g++){var _={};bW(d[g],_,t);var v=PU(`g`,`clip-g-`+c++,_,[]);(o?o.children:n).push(v),i[a++]=v,o=v}s=d;var y=gW(u,t);y&&(o?o.children:n).push(y)}}},e.prototype.resize=function(e,t){var n=this._opts,r=this.root,i=this._viewport;if(e!=null&&(n.width=e),t!=null&&(n.height=t),r&&i&&(i.style.display=`none`,e=bk(r,0,n),t=bk(r,1,n),i.style.display=``),this._width!==e||this._height!==t){if(this._width=e,this._height=t,i){var a=i.style;a.width=e+`px`,a.height=t+`px`}if(fi(this._backgroundColor))this.refresh();else{var o=this._svgDom;o&&(o.setAttribute(`width`,e),o.setAttribute(`height`,t));var s=this._bgVNode&&this._bgVNode.elm;s&&(s.setAttribute(`width`,e),s.setAttribute(`height`,t))}}},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.dispose=function(){this.root&&(this.root.innerHTML=``),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},e.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},e.prototype.toDataURL=function(e){var t=this.renderToString(),n=`data:image/svg+xml;`;return e?(t=yi(t),t&&n+`base64,`+t):n+`charset=UTF-8,`+encodeURIComponent(t)},e}();function WW(e){return function(){}}function GW(e,t,n,r){var i;if(n&&n!==`none`){if(i=PU(`rect`,`bg`,{width:e,height:t,x:`0`,y:`0`}),hi(n))vW({fill:n},i.attrs,`fill`,r);else if(fi(n))yW({style:{fill:n},dirty:je,getBoundingRect:function(){return{width:e,height:t}}},i.attrs,`fill`,r);else{var a=ei(n),o=a.color,s=a.opacity;i.attrs.fill=o,s<1&&(i.attrs[`fill-opacity`]=s)}}return i}function KW(e){e.registerPainter(`svg`,UW)}function qW(e,t,n){var r=f.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}function JW(e){return!e.__cursors.get(0)}function YW(e){var t=e.__cursors.get(0);return{startIdx:t?t.startIdx:0,endIdx:t?t.endIdx:0}}var XW=function(e){a(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.zlevel=0,i.zlevel2=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__prevIdx={startIdx:0,endIdx:0};var a;r||=Gi,typeof t==`string`?a=qW(t,n,r):U(t)&&(a=t,t=a.id),i.id=t,i.dom=a;var o=a.style;return o&&(ke(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.afterBrush=function(){this.__prevIdx=YW(this)},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=qW(`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 K(0,0,0,0);function c(e){if(e.isFinite()&&!e.isZero()){if(i.length===0){var t=new K(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 K(0,0,0,0);d.copy(u),d.union(e),i[l]=d,n=!0;break}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 K(0,0,0,0);t.copy(e),i.push(t)}o||=i.length>=a}}}for(var l=YW(this),u=l.startIdx;u<l.endIdx;++u){var d=e[u];if(d){var f=d.shouldBePainted(n,r,!0,!0),p=d.__isRendered&&(d.__dirty&1||!f)?d.getPrevPaintRect():null;p&&c(p);var m=f&&(d.__dirty&1||!d.__isRendered)?d.getPaintRect():null;m&&c(m)}}for(var h=this.__prevIdx,u=h.startIdx;u<h.endIdx;++u){var d=t[u],f=d&&d.shouldBePainted(n,r,!0,!0);if(d&&(!f||!d.__zr)&&d.__isRendered){var p=d.getPrevPaintRect();p&&c(p)}}var g;do{g=!1;for(var u=0;u<i.length;)if(i[u].isZero())i.splice(u,1);else{for(var _=u+1;_<i.length;)i[u].intersect(i[_])?(g=!0,i[u].union(i[_]),i.splice(_,1)):_++;u++}}while(g);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;de(t)?(o=(t.global||t.__width===r&&t.__height===a)&&t.__canvasGradient||_k(i,t,{x:0,y:0,width:r,height:a}),t.__canvasGradient=o,t.__width=r,t.__height=a):fe(t)&&(t.scaleX=t.scaleX||l,t.scaleY=t.scaleY||l,o=kk(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&&F(n,function(e){f(e.x*l,e.y*l,e.width*l,e.height*l)})},t}(Ui),ZW=1e5,QW=314159,$W=void 0,eG=1,tG=2;function nG(e){return e?e.__builtin__?!0:typeof e.resize==`function`&&typeof e.refresh==`function`:!1}function rG(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}function iG(e,t,n,r){var i=new XW(e,t,t.dpr);return i.zlevel=n,i.zlevel2=r,i.__builtin__=!0,aG(i),i}function aG(e){e.__cursorStack=[],e.__cursors=G()}function oG(e){return e.startIdx=e.drawIdx=e.endIdx=e.endIdxNew=0,e.used=!1,e.first=e.last=NaN,e.notClearIdx=-1,e}function sG(e,t){var n=e.__cursors,r=+t;return n.get(r)||(e.__cursorStack.push(r),n.set(r,oG({key:r})))}function cG(e,t){for(var n=e.__cursorStack,r=0;r<n.length;r++)t(e.__cursors.get(n[r]))}function lG(e,t){var n=e.layers;return n[t]||(n[t]=[,,,])}function uG(e,t,n){for(var r=e.layerStack,i=0;i<r.length;i++){var a=r[i].zl,o=r[i].zl2,s=e.layers[a][o];n&&(n&dG&&!s.__builtin__||n&fG&&s.__builtin__||n&pG&&s===e.hoverlayer)||t(s,a,o,i)}}var dG=1,fG=2,pG=4,mG=dG|pG,hG=function(){function e(e,t,n,r){this.type=`canvas`,this._prevDisplayList=[],this._layerConfig={},this._needsManuallyCompositing=!1,this.type=`canvas`,this._i={layerStack:[],layers:[]};var i=!e.nodeName||e.nodeName.toUpperCase()===`CANVAS`;if(this._opts=n=A({},n||{}),this.dpr=n.devicePixelRatio||Gi,this._singleCanvas=i,this.root=e,e.style&&(ke(e),e.innerHTML=``),this.storage=t,this._prevDisplayList=[],i){var a=e,o=a.width,s=a.height;n.width!=null&&(o=n.width),n.height!=null&&(s=n.height),this.dpr=n.devicePixelRatio||1,a.width=o*this.dpr,a.height=s*this.dpr,this._width=o,this._height=s;var c=iG(a,this,QW,0);c.initContext(),this._insertLayer(c,QW,0,!0),this._domRoot=e}else{this._width=bk(e,0,n),this._height=bk(e,1,n);var l=this._domRoot=rG(this._width,this._height);e.appendChild(l)}}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=e&&!U(e)?{paintAll:!!e}:e||{},n=W(t.refresh,!0),r=W(t.refreshHover,!1);if(r&&(this._hoverLayerDirty=tG),!n)return r&&this._paintHoverList(this.storage.getDisplayList(!1)),this;var i=this.storage.getDisplayList(!0);this._updateLayerStatus(i,t.paintAll),this._redrawId=Math.random();var a=this._prevDisplayList;this._paintList(i,a,this._redrawId);var o=this._backgroundColor;return uG(this._i,function(e,t,n,r){e.refresh&&e.refresh(r===0?o:null)},fG),this._opts.useDirtyRect&&(this._prevDisplayList=i.slice()),this},e.prototype._paintHoverList=function(e){var t=this._i.hoverlayer,n=this._hoverLayerDirty;if(this._hoverLayerDirty=$W,n!==$W&&(!t&&n===tG&&(t=this._i.hoverlayer=this._ensureLayer(ZW)),t)){t.clear();for(var r={inHover:!0,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},i,a=0,o=e.length;a<o;a++){var s=e[a];if(s.__inHover){i||(i=t.ctx,i.save());var c=s.__hoverStyle,l=void 0;c&&(l=s.style,s.style=c),Jk(i,s,r),c&&(s.style=l)}}i&&(Yk(i,r),i.restore())}},e.prototype.getHoverLayer=function(){return this._ensureLayer(ZW)},e.prototype.paintOne=function(e,t){qk(e,t)},e.prototype._paintList=function(e,t,n){if(this._redrawId===n){var r=this._doPaintList(e,t);if(this._needsManuallyCompositing&&this._compositeManually(),r)uG(this._i,function(e){e.afterBrush&&e.afterBrush()},mG),this._paintHoverList(e);else{var i=this;WE(function(){i._paintList(e,t,n)})}}},e.prototype._compositeManually=function(){var e=this._ensureLayer(QW).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),uG(this._i,function(r){r.virtual&&e.drawImage(r.dom,0,0,t,n)},dG)},e.prototype._doPaintList=function(e,t){var n=this,r=!0;return uG(this._i,function(i){var a=!1;if(cG(i,function(e){(e.drawIdx<e.endIdx||e.notClearIdx>=0)&&(a=!0)}),a||i.__dirty){var o=n._opts.useDirtyRect&&!JW(i)?i.createRepaintRects(e,t,n._width,n._height):null,s=n._i.layerStack[0],c=!0;if(i.__dirty){c=!1,i.__dirty=!1;var l=i.zlevel===s.zl&&i.zlevel2===s.zl2?n._backgroundColor:null;i.clear(!1,l,o)}cG(i,function(t){var a=n._paintPerCursor(i,t,e,o,c);r&&=a})}},mG),Pe.wxa&&uG(this._i,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),r},e.prototype._paintPerCursor=function(e,t,n,r,i){var a=e.ctx;if(r){if(!r.length)t.drawIdx=t.endIdx;else for(var o=this.dpr,s=0;s<r.length;++s){var c=r[s];a.save(),a.beginPath(),a.rect(c.x*o,c.y*o,c.width*o,c.height*o),a.clip(),this._paintPerCursorInRect(e,t,n,c,i),a.restore()}}else a.save(),this._paintPerCursorInRect(e,t,n,null,i),a.restore();return t.drawIdx>=t.endIdx},e.prototype._paintPerCursorInRect=function(e,t,n,r,i){for(var a={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:i}},o=e.ctx,s=JW(e),c=s&&f.getTime(),l=t.drawIdx,u=t.notClearIdx,d=u>=0?Math.min(u,l):l;d<t.endIdx;d++){var p=n[d];if(!(d<l&&!p.notClear)){if(p.__inHover&&(this._hoverLayerDirty=tG),r!=null){var m=p.getPaintRect();m&&m.intersect(r)&&(Jk(o,p,a),p.setPrevPaintRect(m))}else Jk(o,p,a);if(s&&f.getTime()-c>15){d++;break}}}Yk(o,a),t.drawIdx=Math.max(d,l)},e.prototype.getLayer=function(e,t){return this._ensureLayer(e,0,t)},e.prototype._ensureLayer=function(e,t,n){t||=0;var r=this._singleCanvas;r&&!this._needsManuallyCompositing&&(e=QW,t=0);var i=lG(this._i,e)[t];return i||(i=iG(`zr_`+e+`.`+t,this,e,t),this._layerConfig[e]&&k(i,this._layerConfig[e],!0),(n||r&&e!==QW)&&(i.virtual=!0),this._insertLayer(i,e,t,!1),i.initContext()),i},e.prototype.insertLayer=function(e,t){this._insertLayer(t,e,0,!1)},e.prototype._insertLayer=function(e,t,n,r){var i=this._i,a=i.layers,o=i.layerStack,s=this._domRoot,c=null;if(!(a[t]&&a[t][n])&&nG(e)){for(var l=o.length,u=0;u<l&&(o[u].zl<t||o[u].zl===t&&o[u].zl2<n);)u++;if(u>0&&(c=lG(i,o[u-1].zl)[o[u-1].zl2]),o.splice(u,0,{zl:t,zl2:n}),lG(i,t)[n]=e,!r&&!e.virtual){if(c){var d=c.dom;d.nextSibling?s.insertBefore(e.dom,d.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}e.painter||=this}},e.prototype.eachLayer=function(e,t){return uG(this._i,function(n,r){e.call(t,n,r)})},e.prototype.eachBuiltinLayer=function(e,t){return uG(this._i,function(n,r){e.call(t,n,r)},dG)},e.prototype.eachOtherLayer=function(e,t){return uG(this._i,function(n,r){e.call(t,n,r)},fG)},e.prototype.getLayers=function(){var e={};return uG(this._i,function(t,n,r){e[t.id]=t}),e},e.prototype._updateLayerStatus=function(e,t){var n=this;if(n._singleCanvas)for(var r=1;r<e.length;r++){var i=e[r];if(i.zlevel!==e[r-1].zlevel||i.incremental){n._needsManuallyCompositing=!0;break}}uG(n._i,function(e){e.__dirty=!1,cG(e,function(e){e.used=!1,e.endIdxNew=0,e.notClearIdx=-1})},mG);for(var a,o=null,s=null,c=!1,l=0,u=e.length;l<u;l++){var i=e[l],d=i.zlevel,f=i.incremental,p=void 0;if(a!==d&&(a=d,c=!1),f?(c=!0,p=1):p=c?2:0,(!o||d!==o.zlevel||p!==o.zlevel2)&&(o=n._ensureLayer(d,p),s=null,!o.__builtin__))D(`ZLevel `+d+` has been used by unknown layer `+o.id);else{if((!s||f!==s.key)&&(s=sG(o,f),!s.used)){if(s.used=!0,!t&&s.first===i.id){var m=l-s.startIdx;s.startIdx=l,s.drawIdx+=m,s.endIdx+=m}else o.__dirty=!0,s.first=i.id,s.startIdx=s.drawIdx=l,s.endIdx=l+1}s.endIdxNew=l+1,i.__dirty&1&&!i.__inHover&&((!f||!i.notClear&&l<s.drawIdx)&&(o.__dirty=!0),f&&i.notClear&&s.notClearIdx<0&&(s.notClearIdx=l))}}uG(n._i,function(t){for(var r=t.__cursorStack,i=t.__cursors,a=r.length-1;a>=0;a--){var o=i.get(r[a]);if(!o.used)t.__dirty=!0,i.removeKey(r[a]),r.splice(a,1);else{var s=o.endIdxNew;(JW(t)?s<o.drawIdx:s!==o.endIdx||!s||e[s-1].id!==o.last)&&(t.__dirty=!0),o.endIdx=o.endIdxNew,o.last=s?e[s-1].id:NaN}}t.__dirty&&(cG(t,function(e){e.drawIdx=e.startIdx}),n._hoverLayerDirty===$W&&(n._hoverLayerDirty=eG))},mG)},e.prototype.clear=function(){return uG(this._i,function(e){e.clear(),aG(e)},dG),this},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,uG(this._i,function(e){e.setUnpainted()})},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?k(n[e],t,!0):n[e]=t,uG(this._i,function(e,t){k(e,n[t],!0)})}},e.prototype.delLayer=function(e){for(var t=this._i.layerStack,n=this._i.layers,r=t.length-1;r>=0;r--){var i=t[r];if(i.zl===e){var a=n[e][i.zl2];if(a.__builtin__)continue;if(t.splice(r,1),n[e][i.zl2]=void 0,!a.virtual){var o=a.dom.parentNode;o&&o.removeChild(a.dom)}}}},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;e!=null&&(r.width=e),t!=null&&(r.height=t),e=bk(i,0,r),t=bk(i,1,r),n.style.display=``,(this._width!==e||t!==this._height)&&(n.style.width=e+`px`,n.style.height=t+`px`,uG(this._i,function(n){n.resize(e,t)}),this.refresh({paintAll:!0})),this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this._ensureLayer(QW).resize(e,t)}return this},e.prototype.clearLayer=function(e){F(this._i.layers[e],function(e){e&&!e.__builtin__&&e.clear()})},e.prototype.dispose=function(){this.root.innerHTML=``,this.root=this.storage=this._domRoot=this._i=null},e.prototype.getRenderedCanvas=function(e){if(e||={},this._singleCanvas&&!this._compositeManually)return this._i.layers[QW][0].dom;var t=new XW(`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;uG(this._i,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,beforeBrushParam:{}},o=this.storage.getDisplayList(!0),s=0,c=o.length;s<c;s++){var l=o[s];Jk(n,l,a)}Yk(n,a)}return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}();function gG(e){e.registerPainter(`canvas`,hG)}var _G=Object.freeze({INR:`₹`,USD:`$`,EUR:`€`,GBP:`£`,JPY:`¥`}),vG=e=>typeof e==`string`&&/^[A-Z]{3}$/.test(e),yG=(e=`INR`)=>_G[e]??`${e} `;function bG(e,...t){console.warn(e,...t)}function xG(e,...t){console.error(e,...t)}function SG(e,t){if(e==null)throw Error(t);return e}function CG(e,t,...n){if(e.toLowerCase()===`svg`)throw Error(`make() builds HTML elements; use svgRoot for svg`);let r=document.createElement(e);for(let[e,n]of Object.entries(t??{}))n===!0?r.setAttribute(e,``):(typeof n==`string`||typeof n==`number`)&&r.setAttribute(e,String(n));let i=[];for(let e of n)e instanceof Node?i.push(e):(typeof e==`string`||typeof e==`number`)&&i.push(document.createTextNode(String(e)));return r.append(...i),r}var wG=`en-IN`,TG=/\{([A-Za-z0-9_]+)\}/g,EG,DG=new Map,OG=0,kG=new Map;function AG(e,t){let n=DG.get(e);if(n===void 0)return t;let r=kG.get(e);if(r!==void 0&&r.version===OG&&r.english===t&&FG(r.merged,t))return r.merged;let i=PG(e,n,t);return kG.set(e,{version:OG,english:t,merged:i}),i}function jG(){return EG??wG}function MG(e,t){return e.replace(TG,(e,n)=>Object.hasOwn(t,n)?String(t[n]):e)}function NG(e,t,n,r){let i=`${t}Other`;if(!Object.hasOwn(e,i))throw RangeError(`Plural text ${t} has no ${i} key; every plural needs its Other form.`);let a=new Intl.PluralRules(jG()).select(n),o=`${t}${a.charAt(0).toUpperCase()}${a.slice(1)}`,s=e[Object.hasOwn(e,o)?o:i];if(s===void 0)throw RangeError(`Plural text ${t} has no ${o} key.`);return MG(s,{count:n,...r})}function PG(e,t,n){let r={};for(let[i,a]of Object.entries(t)){let t=Object.hasOwn(n,i)?n[i]:void 0;if(t===void 0)throw RangeError(`Text ${e}.${i} is not a key of the English text. Allowed keys: ${Object.keys(n).join(`, `)}.`);let o=IG(t);for(let t of IG(a))if(!o.includes(t))throw RangeError(`Text ${e}.${i} uses {${t}}, which the English text does not have. Allowed placeholders: ${o.length===0?`none`:o.map(e=>`{${e}}`).join(`, `)}.`);r[i]=a}return Object.assign({},n,r)}function FG(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(t=>Object.hasOwn(e,t))}function IG(e){return Array.from(e.matchAll(TG),e=>e[1]??``)}var LG={aprShortLabel:`Apr`,aprilLabel:`April`,augShortLabel:`Aug`,augustLabel:`August`,decShortLabel:`Dec`,decemberLabel:`December`,emptyValueLabel:`-`,febShortLabel:`Feb`,februaryLabel:`February`,friMinLabel:`Fr`,friShortLabel:`Fri`,fridayLabel:`Friday`,janShortLabel:`Jan`,januaryLabel:`January`,julShortLabel:`Jul`,julyLabel:`July`,junShortLabel:`Jun`,juneLabel:`June`,marShortLabel:`Mar`,marchLabel:`March`,mayLabel:`May`,mayShortLabel:`May`,monMinLabel:`Mo`,monShortLabel:`Mon`,mondayLabel:`Monday`,novShortLabel:`Nov`,novemberLabel:`November`,octShortLabel:`Oct`,octoberLabel:`October`,satMinLabel:`Sa`,satShortLabel:`Sat`,saturdayLabel:`Saturday`,sepShortLabel:`Sep`,septemberLabel:`September`,sunMinLabel:`Su`,sunShortLabel:`Sun`,sundayLabel:`Sunday`,thuMinLabel:`Th`,thuShortLabel:`Thu`,thursdayLabel:`Thursday`,tueMinLabel:`Tu`,tueShortLabel:`Tue`,tuesdayLabel:`Tuesday`,wedMinLabel:`We`,wedShortLabel:`Wed`,wednesdayLabel:`Wednesday`},RG=`Asia/Kolkata`,zG=198e5,BG=new Map;function VG(e){let t=BG.get(e);return t||(t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),BG.set(e,t)),t}function HG(e){if(typeof e!=`string`||e===``)return!1;try{return VG(e),!0}catch{return!1}}function UG(e,t=RG){if(t===`Asia/Kolkata`){let t=new Date(e+zG);return{year:t.getUTCFullYear(),month:t.getUTCMonth(),day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds()}}let n=Object.fromEntries(VG(t).formatToParts(e).map(e=>[e.type,Number(e.value)]));return{year:Number(n.year),month:Number(n.month)-1,day:Number(n.day),hour:Number(n.hour)%24,minute:Number(n.minute),second:Number(n.second)}}function WG(e,t=RG){if(t===`Asia/Kolkata`)return zG;let n=UG(e,t),r=new Date(0);return r.setUTCFullYear(n.year,n.month,n.day),r.setUTCHours(n.hour,n.minute,n.second,0),r.getTime()-Math.floor(e/1e3)*1e3}function GG(e,t=RG){let n=e-WG(e,t);return n=e-WG(n,t),n}var KG=[`number`,`currency`,`percent`,`compact`,`duration`,`date`],qG=[`rupees`,`paise`],JG=[`ms`,`s`,`min`,`h`],YG=[`day`,`month`,`year`,`datetime`,`time`],XG=()=>AG(`formatters`,LG),ZG=()=>XG().emptyValueLabel,QG=`−`,$G=[`janShortLabel`,`febShortLabel`,`marShortLabel`,`aprShortLabel`,`mayShortLabel`,`junShortLabel`,`julShortLabel`,`augShortLabel`,`sepShortLabel`,`octShortLabel`,`novShortLabel`,`decShortLabel`],eK={short:[`sunShortLabel`,`monShortLabel`,`tueShortLabel`,`wedShortLabel`,`thuShortLabel`,`friShortLabel`,`satShortLabel`],long:[`sundayLabel`,`mondayLabel`,`tuesdayLabel`,`wednesdayLabel`,`thursdayLabel`,`fridayLabel`,`saturdayLabel`],min:[`sunMinLabel`,`monMinLabel`,`tueMinLabel`,`wedMinLabel`,`thuMinLabel`,`friMinLabel`,`satMinLabel`]},tK=(e,t)=>XG()[SG(e[t],`no date name at index ${t}`)],nK=e=>tK($G,e);function rK(e,t){return tK(eK[t],e)}var iK=(e,t)=>SG(e[t],`no compact unit at index ${t}`),aK=[[1e7,`Cr`],[1e5,`L`],[1e3,`K`]],oK=[[1e9,`B`],[1e6,`M`],[1e3,`K`]],sK=e=>!e||e===`INR`?`en-IN`:`en-US`,cK=(e,t)=>typeof e==`number`&&Number.isInteger(e)&&e>=0&&e<=20?e:t,lK=new Map,uK=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=lK.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:e}),lK.set(n,r)),r},dK=new Map,fK=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=dK.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:e,maximumFractionDigits:e}),dK.set(n,r)),r},pK=e=>typeof e==`number`&&Number.isFinite(e),mK=e=>e<0&&!Object.is(Math.abs(e),0)?QG:``;function hK(e){if(!Number.isInteger(e))throw Error(`A paise amount must be a whole number, got ${e}`);let t=BigInt(Math.abs(e)).toString().padStart(3,`0`);return`${e<0?`-`:``}${t.slice(0,-2)}.${t.slice(-2)}`}var gK=(e,t)=>t===`paise`?Number(hK(e)):e,_K=2,vK=(e,t,n)=>{let r=Math.min(t,_K),i=10n**BigInt(_K-r),a=(BigInt(hK(e).replace(`.`,``))+i/2n)/i,o=10n**BigInt(r),s=fK(0,n).format(a/o);return t===0?s:`${s}.${(a%o).toString().padStart(r,`0`)}${`0`.repeat(t-r)}`};function yK(e,{decimals:t}={}){if(!pK(e))return ZG();let n=uK(cK(t,2)).format(Math.abs(e));return n===`0`?`0`:mK(e)+n}function bK(e,t){if(!t?.currency)throw TypeError(`[@webority/ui-elements] formatCurrency needs options.currency, an ISO 4217 code such as "INR".`);if(!pK(e))return ZG();let{unit:n=`rupees`,decimals:r,currency:i}=t,a=cK(r,0),o=sK(i),s=n===`paise`?vK(Math.abs(e),a,o):fK(a,o).format(Math.abs(e));return(Number(s.replace(/,/g,``))===0?``:mK(e))+yG(i)+s}var xK=e=>e>0&&e<.1?Math.min(20,1-Math.floor(Math.log10(e))):2;function SK(e,{currency:t,unit:n=`rupees`}={}){if(!pK(e))return ZG();let r=t?gK(e,n):e,i=t?yG(t):``,a=t?sK(t):`en-IN`,o=a===`en-IN`?aK:oK,s=Math.abs(r),c=o.findIndex(([e])=>s>=e);if(c===-1){let e=uK(xK(s),a).format(s);if(e!==`1,000`)return(e===`0`?``:mK(r))+i+e;c=o.length-1}let[l,u]=iK(o,c),d=s/l,f=d>=100?0:d>=10?1:2,p=Number(d.toFixed(f));return p>=100&&c>0&&(--c,[l,u]=iK(o,c),d=s/l,f=d>=100?0:d>=10?1:2,p=Number(d.toFixed(f))),`${mK(r)}${i}${uK(f,a).format(p)} ${u}`}function CK(e,{decimals:t}={}){return pK(e)?`${yK(e*100,{decimals:cK(t,1)})}%`:ZG()}var wK={ms:1,s:1e3,min:6e4,h:36e5};function TK(e,{unit:t=`s`}={}){if(!pK(e))return ZG();let n=wK[t]??1e3,r=Math.abs(e*n),i=mK(e);if(Math.round(r)<1e3)return`${i}${uK(0).format(r)} ms`;let a=r/1e3;if(a<10)return`${i}${uK(1).format(a)}s`;let o=Math.round(a);if(o<60)return`${i}${o}s`;let s=e=>String(e).padStart(2,`0`),c=Math.floor(o/60);if(c<60)return`${i}${c}m ${s(o%60)}s`;let l=Math.floor(c/60);return`${i}${uK(0).format(l)}h ${s(c%60)}m`}function EK(e,t=RG){if(e instanceof Date)return e.getTime();if(pK(e))return e;if(typeof e!=`string`)return NaN;let n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(n){let[e,r,i]=[Number(n[1]),Number(n[2]),Number(n[3])],a=new Date(Date.UTC(2e3,r-1,i));return a.setUTCFullYear(e),a.getUTCFullYear()===e&&a.getUTCMonth()===r-1&&a.getUTCDate()===i?GG(a.getTime(),t):NaN}return Date.parse(e)}function DK(e,t=RG){let{year:n,month:r,day:i,hour:a,minute:o}=UG(e,t);return{year:n,month:r,day:i,hour:a,minute:o}}function OK(e,{pattern:t=`day`,timeZone:n=RG}={}){let r=EK(e,n);if(!Number.isFinite(r))return ZG();let i=DK(r,n),a=e=>String(e).padStart(2,`0`),o=`${a(i.day)}-${nK(i.month)}-${i.year}`,s=`${a(i.hour)}:${a(i.minute)}`;switch(t){case`month`:return`${nK(i.month)}-${i.year}`;case`year`:return String(i.year);case`datetime`:return`${o} ${s}`;case`time`:return s;default:return o}}function kK(e,{timeZone:t=RG}={}){let n=EK(e,t);if(!Number.isFinite(n))return ZG();let r=DK(n,t);return`${String(r.day).padStart(2,`0`)}-${nK(r.month)}`}function X(e,t){if(e==null||e===``)return ZG();let n=t?.style;if(n===`date`)return OK(e,t);if(typeof e!=`number`)return String(e);switch(n){case`currency`:return bK(e,{...t,currency:t?.currency??``});case`percent`:return CK(e,t);case`compact`:return SK(e,t);case`duration`:return TK(e,t);default:return yK(e,t)}}function AK(e){let t=e?.style;if(t===`currency`){if(!e?.currency)throw TypeError(`[@webority/ui-elements] a currency format needs a currency, an ISO 4217 code such as "INR".`);return{style:`compact`,currency:e.currency,unit:e.unit}}return!t||t===`number`?{style:`compact`}:e??{}}var jK={aboveLabel:`Above`,areaChartLabel:`Area chart`,arrowKeysText:`{title}: use the arrow keys to read the values`,bandLabel:`Band`,barChartLabel:`Bar chart`,belowLabel:`Below`,bubbleChartLabel:`Bubble chart`,calendarHeatmapLabel:`Calendar heatmap`,calendarRangeText:`, from {first} to {last}`,calendarSummaryTextOne:`Calendar heatmap of {label}, {n} day.`,calendarSummaryTextOther:`Calendar heatmap of {label}, {n} days{range}.`,categoryLabel:`Category`,centerLabel:`Total`,changeLabel:`Change`,chartLabel:`chart`,columnChartLabel:`Column chart`,columnFallbackLabel:`column`,columnXLabel:`X`,constantSpanText:`{label} is {lo}.`,currencyFormatText:`This chart's currency format needs a currency code, such as "INR", in its currency field.`,dataSuffixLabel:`data`,dateLabel:`Date`,donutChartLabel:`Donut chart`,donutLargestText:`{top} is the largest, at {share}.`,donutSummaryTextOne:`Donut chart of {label} in {rows} part, {total} in all.`,donutSummaryTextOther:`Donut chart of {label} in {rows} parts, {total} in all.`,emptyText:`No data to show for this chart.`,errorText:`This chart couldn't load. Try again in a moment.`,everySeriesHiddenText:`Every series is hidden.`,firstStageLabel:`first stage`,fromLabel:`From`,funnelChartLabel:`Funnel chart`,funnelPreviousStepText:`{share} of previous step`,funnelStartText:`{first} is {firstValue} and {last} is {lastValue}, {share} of the start.`,funnelSummaryText:`Funnel chart of {label} in {n} stages.`,gaugeBandText:`, in the {band} band`,gaugeLabel:`Gauge`,gaugeSummaryText:`{type}: {label} is {value} on a scale from {min} to {max}{band}.`,groupLabel:`Group`,groupsTextOne:` in {count} group: {groups}`,groupsTextOther:` in {count} groups: {groups}`,heatmapLabel:`Heatmap`,heatmapSummaryText:`Heatmap of {label} by {group} and {x}, {n} cells.`,highestAtLowestAtText:`Highest is {highValue} at {highGroup}, {high}; lowest is {lowValue} at {lowGroup}, {low}.`,highestLowestText:`Highest is {maxValue} on {max}; lowest is {minValue} on {min}.`,itemLabel:`Item`,largestFallText:`The largest fall is {xText}, {signed}.`,largestFlowText:`The largest flow is {xText} to {toText}, {fmtAt}.`,largestRiseText:`The largest rise is {xText}, {signed}.`,latestText:`Latest {latest}`,legendLabel:`Legend`,lessLabel:`Less`,lineChartLabel:`Line chart`,loadingText:`Loading chart`,measureLabel:`Measure`,moreLabel:`More`,ofFirstStepText:`Of {first}`,ofPreviousStepLabel:`Of previous step`,openingShareText:`{share} of opening`,opensAtClosesAtText:`It opens at {opening} and closes at {closing}.`,otherLabel:`Other`,pointsSummaryTextOne:`{n} point, {first}.`,pointsSummaryTextOther:`{n} points, from {first} to {last}.`,rangeSpanText:`{label} runs from {lo} to {hi}.`,rowFallbackLabel:`row`,rowLabel:`Row`,runningTotalLabel:`Running total`,sankeyLabel:`Sankey diagram`,sankeySummaryText:`Sankey diagram of {label}: {n} flows between {nodes} places.`,scaleLabel:`Scale`,scaleRangeText:`{min} to {max}`,scatterPlotLabel:`Scatter plot`,scatterSummaryText:`{type} of {label} against {xLabel}, {count} points{groups}.`,shareLabel:`Share`,shareOfAllLabel:`Share of all`,shareOfGroupLabel:`Share of group`,shareOfParentText:`Share of {parent}`,shareOfStepText:`{share} of {first}`,sharedAxisText:`, sharing one x axis`,showingFirstRowsDownloadText:`Showing the first {rows} of {total} rows. Download the CSV for all of them.`,smallMultiplesLabel:`Small multiples`,stackedPercentText:`, stacked to 100%`,stackedText:`, stacked`,stageLabel:`Stage`,stepLabel:`Step`,summaryText:`{type} of {series}{stacked}{sharedAxis}.`,targetGapText:`{direction} {label} by {gap}`,targetLabel:`target`,toLabel:`To`,tooManyGroupsText:`This chart has more groups than it can show clearly.`,tooManySeriesText:`This chart has more series than it can show clearly.`,totalText:`Total {total}`,treemapEmptyText:`Treemap of {label}: no items.`,treemapLabel:`Treemap`,treemapLargestGroupText:`{name} is the largest group, at {share}.`,treemapSummaryText:`Treemap of {label}: {n} items in {totals} groups, {total} in all.`,trendLabel:`Trend`,untitledLabel:`Chart`,waterfallLabel:`Waterfall chart`,waterfallSummaryText:`Waterfall chart of {label}.`},Z=()=>AG(`chart`,jK),MK=[`line`,`area`,`column`,`bar`,`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`,`multiples`],NK=[`none`,`stacked`,`percent`],PK=[`category`,`time`,`value`],FK=[`auto`,`svg`,`canvas`],IK=[`ready`,`loading`,`empty`,`error`],LK=[`chart`,`table`],RK=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`],zK=8,BK=6,VK={line:`lineChartLabel`,area:`areaChartLabel`,column:`columnChartLabel`,bar:`barChartLabel`,donut:`donutChartLabel`,heatmap:`heatmapLabel`,calendar:`calendarHeatmapLabel`,funnel:`funnelChartLabel`,gauge:`gaugeLabel`,waterfall:`waterfallLabel`,treemap:`treemapLabel`,sankey:`sankeyLabel`,scatter:`scatterPlotLabel`,bubble:`bubbleChartLabel`,multiples:`smallMultiplesLabel`},HK=e=>Z()[VK[e]],UK=[`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`],WK=e=>UK.includes(e),GK=[`area`,`column`,`bar`],KK=[`line`,`area`,`column`,`bar`,`multiples`],qK={line:[`category`,`time`],area:[`category`,`time`],column:[`category`,`time`],bar:[`category`,`time`],multiples:[`category`,`time`],calendar:[`time`],scatter:[`value`],bubble:[`value`]},JK={group:[`heatmap`,`treemap`,`scatter`,`bubble`],to:[`sankey`],size:[`bubble`],trend:[`scatter`,`bubble`],zoom:[`line`,`area`],bands:[`gauge`],centerLabel:[`donut`],sliceValues:[`donut`],valueLabels:[`line`,`column`,`bar`]},YK={gauge:240,calendar:200,treemap:340,sankey:340},XK=100,ZK=72,QK=32,$K=[`type`,`title`,`description`,`data`,`x`,`series`,`group`,`to`,`size`,`trend`,`zoom`,`bands`,`stack`,`y`,`target`,`centerLabel`,`sliceValues`,`valueLabels`,`height`,`state`,`emptyText`,`errorText`,`loadingText`,`renderer`,`timeZone`],eq=[`key`,`kind`,`format`,`label`,`labelFit`],tq=[`auto`,`all`,`rotate`,`ellipsis`],nq=[`key`,`label`,`format`,`colour`],rq=[`key`,`label`],iq=[`key`,`label`,`format`],aq=[`upTo`,`label`],oq=[`label`,`format`,`min`,`max`,`wholeNumbers`],sq=[`value`,`label`],cq=[`style`,`currency`,`unit`,`decimals`,`pattern`],lq=[...qG,...JG],uq=new Set;function dq(e){uq.has(e)||(uq.add(e),bG(`[@webority/ui-elements] <wui-chart> ${e}`))}var fq=e=>e.map(e=>`"${e}"`).join(` | `),pq=e=>typeof e==`number`&&Number.isFinite(e),mq=e=>typeof e==`object`&&!!e&&!Array.isArray(e),hq=(e,t)=>Reflect.get(e,t),gq=e=>e===null||typeof e==`string`||typeof e==`number`,_q=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,gq(t)?t:null]));function vq(e,t){if(e==null)throw Error(`${t} missing`);return e}var yq=(e,t)=>e.some(e=>e===t);function bq(e,t,n){t==null||n.includes(t)||dq(`received ${e}="${String(t)}", which is not one of ${fq(n)}. The chart uses its default instead.`)}function xq(e,t,n){for(let r of Object.keys(t))n.includes(r)||(/^(y2|secondary)/i.test(r)?dq(`ignores ${e}.${r}: a chart has one value axis by design. Show the second measure as its own chart.`):dq(`ignores the unknown key ${e}.${r}. Known keys: ${n.join(`, `)}.`))}function Sq(e,t){if(t==null)return;if(typeof t!=`object`){dq(`expects ${e} to be an object such as { style: "currency" }.`);return}xq(e,t,cq);let n=hq(t,`style`);bq(`${e}.style`,n,KG);let r=hq(t,`currency`);r!=null&&!vG(r)&&dq(`received ${e}.currency="${String(r)}", which is not an ISO 4217 code such as "INR", so the format has no currency.`);let i=hq(t,`unit`);i!=null&&bq(`${e}.unit`,i,n===`duration`?JG:qG);let a=hq(t,`pattern`);bq(`${e}.pattern`,a,YG);let o=hq(t,`decimals`);o!=null&&!(typeof o==`number`&&Number.isInteger(o)&&o>=0&&o<=20)&&dq(`received ${e}.decimals=${String(o)}, which is not a whole number from 0 to 20. The chart uses its default instead.`);let s={style:yq(KG,n)?n:`number`};return typeof r==`string`&&vG(r)&&(s.currency=r),yq(lq,i)&&(s.unit=i),typeof o==`number`&&(s.decimals=o),yq(YG,a)&&(s.pattern=a),s}function Cq(e,t){return t?.style!==`currency`||t.currency?null:`${e} is a currency format with no valid currency: set ${e}.currency to an ISO 4217 code such as "INR".`}function wq(e){let t=(e,t=Z().errorText)=>(xG(`[@webority/ui-elements] <wui-chart> ${e}`),{spec:null,problem:t});if(!mq(e))return t('has no spec: set the `spec` property or add a <script type="application/json"> child.');let n=e;xq(`spec`,n,$K);let r=hq(n,`type`);if(bq(`type`,r,MK),!yq(MK,r))return t(`cannot draw type "${String(r)}".`);let i=r,a=hq(n,`title`);typeof a==`string`&&a.trim()||dq("needs a `title`: it names the chart for screen readers and names exported files.");for(let[e,t]of Object.entries(JK))hq(n,e)!=null&&!t.includes(i)&&dq(`ignores spec.${e} on a ${i} chart: it applies to ${t.join(`, `)}.`);let o=hq(n,`x`),s=mq(o)?o:{};xq(`spec.x`,s,eq);let c=qK[i]??[`category`],l=hq(s,`kind`);bq(`x.kind`,l,PK),yq(PK,l)&&!c.includes(l)&&dq(`ignores x.kind="${l}" on a ${i} chart: it takes ${fq(c)}.`);let u=hq(s,`labelFit`);bq(`x.labelFit`,u,tq);let d=Sq(`x.format`,hq(s,`format`)),f=hq(s,`key`);typeof f!=`string`&&i!==`gauge`&&dq("needs `x.key`, the column holding each row's x value or slice name.");let p=typeof f==`string`?f:``,m=hq(n,`y`),h=mq(m)?m:{};xq(`spec.y`,h,oq);let g=Sq(`y.format`,hq(h,`format`)),_=Cq(`x.format`,d);if(_)return t(_,Z().currencyFormatText);let v=Cq(`y.format`,g);if(v)return t(v,Z().currencyFormatText);let y=hq(n,`series`),b=Array.isArray(y)?y.filter(mq):[],x=[];for(let[e,n]of b.entries()){xq(`spec.series[${e}]`,n,nq);let r=Sq(`series[${e}].format`,hq(n,`format`)),i=Cq(`series[${e}].format`,r);if(i)return t(i,Z().currencyFormatText);let a=hq(n,`key`);typeof a!=`string`&&dq(`needs series[${e}].key, the column holding that series' values.`);let o=hq(n,`label`),s=hq(n,`colour`);bq(`series[${e}].colour`,s,RK),x.push({key:String(a),named:typeof a==`string`,label:typeof o==`string`&&o?o:String(a),format:r,colour:yq(RK,s)?s:void 0})}let S=x[0];if(!S)return t(`has no series to draw.`);let C=x.filter(e=>e.named).map(e=>e.key),w=C.find((e,t)=>C.indexOf(e)!==t);if(w!==void 0)return t(`has two series with the key "${w}": each series needs its own key.`);if(x.length>8)return t(`refuses ${x.length} series: 8 is the most that stay distinguishable. Fold the smallest into an Other series, or split the chart.`,Z().tooManySeriesText);let T=WK(i);if(T&&x.length>1){let e=i===`donut`?`Compare parts across groups with a percent-stacked column instead.`:`Show the other measures as their own charts, or use small multiples.`;dq(`draws one series as a ${i}; it got ${x.length} and shows the first. ${e}`)}let E=(e,t,n,r)=>{if(t==null)return null;if(!mq(t))return dq(`expects ${e} to be an object such as { key: "column" }.`),null;xq(e,t,n);let i=hq(t,`key`);if(typeof i!=`string`)return dq(`needs ${e}.key, the column holding ${r}.`),null;let a=Sq(`${e}.format`,hq(t,`format`)),o=hq(t,`label`);return{key:i,label:typeof o==`string`?o:``,format:a}},D=JK.group.includes(i)?E(`spec.group`,hq(n,`group`),rq,`each row's group`):null,O=i===`sankey`?E(`spec.to`,hq(n,`to`),rq,`where each flow ends`):null,k=i===`bubble`?E(`spec.size`,hq(n,`size`),iq,`each bubble's size`):null,A=Cq(`group.format`,D?.format)??Cq(`to.format`,O?.format)??Cq(`size.format`,k?.format);if(A)return t(A,Z().currencyFormatText);if((i===`heatmap`||i===`treemap`)&&!D)return t(`needs \`group.key\` to draw a ${i}: the column holding each ${i===`heatmap`?`row`:`parent`}.`);if(i===`sankey`&&!O)return t("needs `to.key` to draw a sankey: the column holding where each flow ends.");if(i===`bubble`&&!k)return t("needs `size.key` to draw a bubble chart: the column holding each bubble's size.");let j=GK.includes(i)?NK:[`none`],M=hq(n,`stack`);bq(`stack`,M,j);let N=hq(n,`state`);bq(`state`,N,IK);let ee=hq(n,`renderer`);bq(`renderer`,ee,FK);let P=hq(n,`timeZone`);P!=null&&!HG(P)&&dq(`received timeZone="${String(P)}", which is not a time zone this browser knows. The chart uses Asia/Kolkata instead.`);let te=HG(P)?P:RG,F=hq(n,`target`),I=mq(F)?hq(F,`value`):void 0;F!=null&&(mq(F)&&xq(`spec.target`,F,sq),mq(F)&&pq(I)||dq("ignores a `target` without a numeric `value`."));let ne=hq(n,`trend`);ne!=null&&typeof ne!=`boolean`&&dq("expects `trend` to be true or false.");let re=hq(n,`zoom`);re!=null&&typeof re!=`boolean`&&dq("expects `zoom` to be true or false.");let ie=[],L=hq(n,`bands`);if(i===`gauge`&&L!=null){let e=Array.isArray(L)?L.filter(mq):[];for(let t of e)xq(`spec.bands[]`,t,aq);ie=e.map(e=>({upTo:hq(e,`upTo`),label:hq(e,`label`)})).filter(e=>pq(e.upTo)&&typeof e.label==`string`&&e.label!==``).sort((e,t)=>e.upTo-t.upTo),Array.isArray(L)&&ie.length===e.length||dq("ignores a gauge band without a numeric `upTo` and a `label`.")}let ae=g??S.format,R=(T?x.slice(0,1):x).map(e=>({key:e.key,label:e.label,format:e.format??ae,colour:e.colour})),z=yq(c,l)?l:c[0],B=hq(n,`data`),V=Array.isArray(B)?B:[],H=V.filter(mq).map(_q),oe=-1,se=null,U=S.key;i===`donut`&&H.length>6&&(se=H,{data:H,otherIndex:oe}=Dq(H,p,U),dq(`draws at most 6 donut slices; the smallest ${V.length-5} are shown as "${Z().otherLabel}". Send fewer rows, or use a bar chart for many parts.`));let ce=(e,t)=>{let n=H.filter(e);n.length!==H.length&&dq(`leaves out ${H.length-n.length} row(s) ${t}.`),H=n},le=e=>e!=null&&e!==``,ue=e=>pq(e)&&e>0;if(z===`time`&&KK.includes(i)&&ce(e=>Number.isFinite(EK(e[p],te)),`without a readable date`),i===`gauge`&&H.length>1)dq(`draws one value as a gauge; it got ${H.length} rows and shows the first.`),H=H.slice(0,1);else if(i===`scatter`||i===`bubble`){ce(e=>pq(e[p])&&pq(e[U])&&(i!==`bubble`||k!=null&&ue(e[k.key])),`without a number for x and y (and a positive size)`);let e=new Set(D?H.map(e=>String(e[D.key]??``)):[]);if(e.size>3)return t(`refuses ${e.size} colour groups on a ${i} chart: 3 is the most that stay tellable apart. Keep the three that matter and fold the rest into one, or split the chart.`,Z().tooManyGroupsText)}else if(i===`calendar`)ce(e=>Number.isFinite(EK(e[p],te)),`without a readable date`);else if(i===`heatmap`&&D)ce(e=>le(e[p])&&le(e[D.key]),`without a column or a row`);else if(i===`treemap`&&D){ce(e=>le(e[p])&&le(e[D.key])&&ue(e[U]),`without a name, a parent and a positive size`);let e=new Set(H.map(e=>String(e[D.key])));if(e.size>8)return t(`refuses ${e.size} parents in a treemap: 8 is the most that keep their own colour. Fold the smallest into one, or split the chart.`,Z().tooManyGroupsText)}else if(i===`sankey`&&O){ce(e=>le(e[p])&&le(e[O.key])&&ue(e[U]),`without a start, an end and a positive size`);let e=Tq(H,p,O.key);if(e)return t(e.reason,e.text)}else if(i===`waterfall`){let e=Eq(H,U);if(e?.refuse)return t(e.refuse);e?.warn&&dq(e.warn)}let de=hq(n,`height`),fe=pq(de)&&de>0?de:null;if(i===`multiples`){let e=ZK*R.length+QK;fe!=null&&fe<e&&(dq(`needs at least ${e}px of height for ${R.length} small charts; it got ${fe}px and draws at ${e}px.`),fe=e),fe??=XK*R.length+40}fe??=YK[i]??320;let pe=yq(j,M)?M:`none`,me=JK.valueLabels.includes(i)&&(hq(n,`valueLabels`)??i===`line`)===!0;me&&pe!==`none`&&dq(`ignores valueLabels on a stacked chart.`);let W=me&&pe===`none`,he=JK.sliceValues.includes(i)&&(hq(n,`sliceValues`)??!0)===!0,ge=hq(n,`description`),_e=hq(s,`label`),ve=hq(h,`label`),ye=hq(h,`min`),be=hq(h,`max`),xe=hq(n,`centerLabel`),Se=(e,t)=>typeof e==`string`&&e?e:t;return{problem:null,spec:{type:i,title:typeof a==`string`?a.trim():``,description:typeof ge==`string`?ge:``,data:H,allData:se??H,x:{key:p,kind:z,format:d??(z===`time`?{style:`date`}:z===`value`?{style:`number`}:void 0),label:typeof _e==`string`?_e:``,labelFit:yq(tq,u)?u:`auto`},series:R,group:D,to:O,size:k,trend:JK.trend.includes(i)&&ne===!0,zoom:JK.zoom.includes(i)?(re??H.length>5e3)===!0:!1,bands:ie,stack:pe,y:{label:typeof ve==`string`?ve:``,format:ae,min:pq(ye)?ye:void 0,max:pq(be)?be:void 0,wholeNumbers:hq(h,`wholeNumbers`)===!0},target:mq(F)&&pq(I)?{value:I,label:String(hq(F,`label`)??``)}:null,centerLabel:i===`donut`&&typeof xe==`string`&&xe.trim()?xe.trim():``,sliceValues:he,valueLabels:W,height:fe,state:yq(IK,N)?N:`ready`,emptyText:Se(hq(n,`emptyText`),Z().emptyText),errorText:Se(hq(n,`errorText`),Z().errorText),loadingText:Se(hq(n,`loadingText`),Z().loadingText),renderer:yq(FK,ee)?ee:`auto`,timeZone:te,otherIndex:oe}}}function Tq(e,t,n){let r=e.map(e=>[String(e[t]),String(e[n])]),i=new Map;for(let[e,t]of r)i.has(e)||i.set(e,0),i.set(t,(i.get(t)??0)+1);let a=[...i].filter(([,e])=>e===0).map(([e])=>e);if(a.length>8)return{reason:`refuses ${a.length} flow starts in a sankey: 8 is the most that keep their own colour. Fold the smallest into one, or split the chart.`,text:Z().tooManyGroupsText};let o=0;for(;a.length;){let e=a.pop();o+=1;for(let[t,n]of r){if(t!==e)continue;let r=(i.get(n)??0)-1;i.set(n,r),r===0&&a.push(n)}}return o<i.size?{reason:`cannot draw a sankey whose flows loop back on themselves.`,text:Z().errorText}:null}function Eq(e,t){let n=e.map(e=>pq(e[t])?e[t]:0),r=n[n.length-1]??0,i=n[0]??0,a=i;for(let e of n.slice(1,-1))i+=e,a=Math.min(a,i);return a<0||n.length>1&&r<0?{refuse:`cannot draw a waterfall whose running total goes below zero.`}:n.length>2&&Math.abs(r-i)>.5?{warn:`draws the waterfall's closing total (${r}) as given, though the opening total plus the steps is ${i}.`}:null}function Dq(e,t,n){let r=new Set(e.map((e,t)=>({i:t,v:pq(e[n])?e[n]:0})).sort((e,t)=>t.v-e.v).slice(0,5).map(e=>e.i)),i=e.reduce((e,t,i)=>r.has(i)||!pq(t[n])?e:e+t[n],0),a=e.filter((e,t)=>r.has(t)),o=new Set(a.map(e=>String(e[t]))),s=Z().otherLabel;for(let e=2;o.has(s);e+=1)s=`${Z().otherLabel} (${e})`;return a.push({[t]:s,[n]:i}),{data:a,otherIndex:a.length-1}}function Oq(e){return vq(e.series[0],`series`)}function kq(e,t){return vq(e.data[t],`row ${t}`)}function Q(e,t,n){let r=e.data[n]?.[t];return pq(r)?r:null}function Aq(e){return e.type===`gauge`||e.series.some(t=>e.data.some((n,r)=>Q(e,t.key,r)!=null))}function $(e,t){let n=e.data[t]?.[e.x.key];return n==null||n===``?ZG():e.x.format?X(n,{...e.x.format,timeZone:e.timeZone}):String(n)}function jq(e,t){return EK(e.data[t]?.[e.x.key],e.timeZone)}function Mq(e,t){let n=e.group?e.data[t]?.[e.group.key]:null;return n==null||n===``?ZG():String(n)}function Nq(e,t){let n=e.to?e.data[t]?.[e.to.key]:null;return n==null||n===``?ZG():String(n)}var Pq=e=>[...new Set(e)];function Fq(e){return e.group?Pq(e.data.map((t,n)=>Mq(e,n))):[]}function Iq(e){return WK(e.type)?e.data.length:e.data.length*e.series.length}function Lq(e){return e.renderer===`auto`?Iq(e)>5e3?`canvas`:`svg`:e.renderer}function Rq(e){switch(e.type){case`donut`:return e.data.map((t,n)=>$(e,n));case`scatter`:case`bubble`:return Fq(e);case`line`:case`area`:case`column`:case`bar`:return e.series.map(e=>e.key);default:return[]}}function zq(e){return[`line`,`area`,`column`,`bar`].includes(e.type)?e.series.map(e=>e.label):Rq(e)}function Bq(e,t,n){return e.type===`donut`?n.has($(e,t)):(e.type===`scatter`||e.type===`bubble`)&&e.group?n.has(Mq(e,t)):!1}function Vq(e,t){return e.data.map((n,r)=>{let i=e.series.filter(e=>!t.has(e.key)).reduce((t,n)=>t+Math.abs(Q(e,n.key,r)??0),0);return Object.fromEntries(e.series.map(t=>{let n=Q(e,t.key,r);return[t.key,i&&n!=null?n/i:null]}))})}function Hq(e,t=RG){return`${rK(new Date(e+WG(e,t)).getUTCDay(),`short`)}, ${OK(e,{timeZone:t})}`}var Uq=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.min(e,t),1/0),Wq=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.max(e,t),-1/0),Gq=(e,t)=>e.data.map((n,r)=>Q(e,t,r)).filter(e=>e!=null),Kq=(e,t)=>t?X((e??0)/t,{style:`percent`}):ZG();function qq(e,t){let n=e.filter(pq);if(!n.length)return[];let r=Uq(n),i=Wq(n),a=[t[1],t[2],t[3],t[5],t[6]];if(r===i)return[{from:r,to:i,colour:a[2]}];let o=(i-r)/a.length;return a.map((e,t)=>({from:r+o*t,to:t===a.length-1?i:r+o*(t+1),colour:e}))}function Jq(e,t){if(t==null||!e.length)return;let n=e.length-1,r=e.findIndex((e,r)=>t>=e.from&&(r===n?t<=e.to:t<e.to));return e[r<0?n:r]?.colour}function Yq(e,t){return Array.from({length:e},(n,r)=>t[e===1?6:Math.round(6-r*4/(e-1))])}function Xq(e,t){return e.bands.find(e=>t<=e.upTo)??e.bands[e.bands.length-1]??null}var Zq=(e,t)=>t==null?ZG():vq(Xq(e,t),`gauge band`).label;function Qq(e){return{min:e.y.min??0,max:e.y.max??100}}function $q(e){let t=Oq(e).key,n=e.data.length-1,r=0;return e.data.map((i,a)=>{let o=Q(e,t,a)??0,s=a===0||a===n,c=s?0:r,l=s?o:r+o;return a===0?r=o:s||(r=l),{index:a,total:s,value:o,from:c,to:l,level:s?o:l}})}function eJ(e,t){let n=Oq(e).key,r=vq(e.to,`to column`).key,i=e.data.map((t,i)=>({from:String(t[e.x.key]),to:String(t[r]),value:Q(e,n,i)??0})),a=new Map;for(let e of i)a.has(e.from)||a.set(e.from,[]),a.set(e.to,[...a.get(e.to)??[],e]);let o=new Map,s=0;for(let[e,n]of a)n.length||o.set(e,t[s++%t.length]);let c=[...o.keys()],l=new Map([...a].filter(([,e])=>e.length).map(([e,t])=>[e,t.length]));for(;c.length;){let e=c.shift();for(let t of i.filter(t=>t.from===e)){let e=(l.get(t.to)??0)-1;if(l.set(t.to,e),e>0)continue;let n=vq((a.get(t.to)??[]).reduce((e,t)=>e===null||t.value>e.value?t:e,null),`sankey inflow`);o.set(t.to,o.get(n.from)),c.push(t.to)}}return o}function tJ(e){let t=Oq(e).key,n=new Map(Fq(e).map(e=>[e,0]));return e.data.forEach((r,i)=>{n.set(Mq(e,i),(n.get(Mq(e,i))??0)+(Q(e,t,i)??0))}),n}function nJ(e,t,n){let{palette:r,neutral:i,seq:a,rise:o,fall:s}=n,c=Oq(e).key;switch(e.type){case`donut`:return aJ(e,t,n);case`funnel`:return Yq(e.data.length,vq(a,`sequential colours`))[t];case`heatmap`:case`calendar`:return Jq(qq(Gq(e,c),vq(a,`sequential colours`)),Q(e,c,t));case`gauge`:return r[0];case`waterfall`:{let n=vq($q(e)[t],`waterfall bar ${t}`);return n.total?r[0]:n.value>=0?o:s}case`treemap`:return r[[...tJ(e).keys()].indexOf(Mq(e,t))%r.length];case`sankey`:return eJ(e,r).get(String(kq(e,t)[e.x.key]));case`scatter`:case`bubble`:return r[Math.max(0,Fq(e).indexOf(Mq(e,t)))];default:return r[oJ(Oq(e),0)]??i}}function rJ(e,t,n,r){let i=Oq(e),a=Q(e,i.key,t),o=()=>nJ(e,t,r);switch(e.type){case`donut`:{let r=e.data.reduce((t,r,a)=>t+(n.has($(e,a))?0:Q(e,i.key,a)??0),0);return{title:$(e,t),rows:[{color:o(),label:i.label,value:X(a,i.format)},{label:Z().shareLabel,value:r&&a!=null?X(a/r,{style:`percent`}):ZG()}],foot:``}}case`heatmap`:return{title:`${Mq(e,t)}, ${$(e,t)}`,rows:[{color:o(),label:i.label,value:X(a,i.format)}],foot:``};case`calendar`:return{title:Hq(jq(e,t),e.timeZone),rows:[{color:o(),label:i.label,value:X(a,i.format)}],foot:``};case`funnel`:{let n=Q(e,i.key,0),r=t?Q(e,i.key,t-1):null,s=[{color:o(),label:i.label,value:X(a,i.format)}];return t&&s.push({label:Z().ofPreviousStepLabel,value:Kq(a,r)}),s.push({label:MG(Z().ofFirstStepText,{first:$(e,0)}),value:Kq(a,n)}),{title:$(e,t),rows:s,foot:``}}case`gauge`:{let{min:n,max:r}=Qq(e),s=a==null?null:Xq(e,a),c=[{color:o(),label:i.label,value:X(a,i.format)}];return c.push({label:Z().scaleLabel,value:MG(Z().scaleRangeText,{min:X(n,i.format),max:X(r,i.format)})}),s&&c.push({label:Z().bandLabel,value:s.label}),{title:e.data[t]?.[e.x.key]==null?i.label:$(e,t),rows:c,foot:``}}case`waterfall`:{let n=$q(e),r=vq(n[t],`waterfall bar ${t}`),a=vq(n[0],`waterfall opening bar`).value,s=r.total?[{color:o(),label:i.label,value:X(r.value,i.format)}]:[{color:o(),label:Z().changeLabel,value:iJ(r.value,i.format)},{label:Z().runningTotalLabel,value:X(r.level,i.format)}],c=!r.total&&a?MG(Z().openingShareText,{share:iJ(r.value/a*100,{style:`number`,decimals:2},`%`)}):``;return{title:$(e,t),rows:s,foot:c}}case`treemap`:{let n=Mq(e,t),r=tJ(e).get(n);return{title:`${n} / ${$(e,t)}`,rows:[{color:o(),label:i.label,value:X(a,i.format)},{label:MG(Z().shareOfParentText,{parent:n}),value:Kq(a,r)}],foot:``}}case`sankey`:{let n=String(kq(e,t)[e.x.key]),r=e.data.reduce((t,r,a)=>String(r[e.x.key])===n?t+(Q(e,i.key,a)??0):t,0);return{title:MG(Z().scaleRangeText,{min:n,max:Nq(e,t)}),rows:[{color:o(),label:i.label,value:X(a,i.format)},{label:MG(Z().shareOfParentText,{parent:n}),value:Kq(a,r)}],foot:``}}case`scatter`:case`bubble`:{let n=[{color:o(),label:e.x.label||String(e.x.key),value:$(e,t)},{label:i.label,value:X(a,i.format)}];return e.size&&n.push({label:e.size.label||String(e.size.key),value:X(kq(e,t)[e.size.key],e.size.format)}),{title:e.group?Mq(e,t):i.label,rows:n,foot:``}}}let s=e.stack===`percent`?Vq(e,n)[t]:null,c=e.series.map((e,t)=>({s:e,i:t})).filter(({s:e})=>!n.has(e.key)),l=c.map(({s:n,i})=>{let a=Q(e,n.key,t),o=X(a,n.format);return{color:e.type===`multiples`?r.palette[0]:r.palette[oJ(n,i)],line:e.type===`line`||e.type===`multiples`,label:n.label,value:s&&a!=null?`${o} (${X(s[n.key],{style:`percent`})})`:o}}),u=``,d=c[0];if(e.stack!==`none`&&d&&c.length>1){let n=c.reduce((n,{s:r})=>n+(Q(e,r.key,t)??0),0);u=MG(Z().totalText,{total:X(n,d.s.format)})}if(e.target&&d&&c.length===1){let n=Q(e,d.s.key,t);if(n!=null){let t=n-e.target.value,r=e.target.label||Z().targetLabel;u=MG(Z().targetGapText,{direction:t>=0?Z().aboveLabel:Z().belowLabel,label:r,gap:X(Math.abs(t),d.s.format)})}}return{title:$(e,t),rows:l,foot:u}}function iJ(e,t,n=``){let r=`${X(Math.abs(e),t)}${n}`;return e>0?`+${r}`:e<0?`−${r}`:r}function aJ(e,t,n){return t===e.otherIndex?n.neutral:n.palette[t%n.palette.length]}function oJ(e,t){return e.colour?Number(e.colour.slice(6))-1:t}function sJ(e){let t=CG(`div`,{class:`wui-chart-tooltip-body`});e.title&&t.append(CG(`div`,{class:`wui-chart-tooltip-title`},e.title));for(let n of e.rows){let e=CG(`div`,{class:`wui-chart-tooltip-row`});if(n.color){let t=document.createElement(`span`);t.className=n.line?`wui-chart-tooltip-swatch wui-chart-tooltip-swatch-line`:`wui-chart-tooltip-swatch`,t.style.background=n.color,e.append(t)}let r=document.createElement(`span`);r.className=`wui-chart-tooltip-label`,r.textContent=n.label;let i=document.createElement(`span`);i.className=`wui-chart-tooltip-value`,i.textContent=n.value,e.append(r,i),t.append(e)}return e.foot&&t.append(CG(`div`,{class:`wui-chart-tooltip-foot`},e.foot)),t}function cJ(e){let t=[e.title,...e.rows.map(e=>`${e.label} ${e.value}`)];return e.foot&&t.push(e.foot),t.filter(Boolean).join(`. `)}function lJ(e){return e.x.label?e.x.label:{gauge:Z().measureLabel,funnel:Z().stageLabel,waterfall:Z().stepLabel,sankey:Z().fromLabel,scatter:Z().columnXLabel,bubble:Z().columnXLabel}[e.type]??(e.x.kind===`time`?Z().dateLabel:Z().categoryLabel)}function uJ(e){let t=e.allData&&e.allData!==e.data?{...e,data:e.allData}:e,n=Oq(t),r=(e,r=n)=>X(Q(t,r.key,e),r.format),i=(e,n,r=n.length)=>({caption:t.title,head:e,rows:n.slice(0,500),total:r,truncated:r>500}),a=t.data.map((e,t)=>t);switch(t.type){case`heatmap`:{let e=Pq(a.map(e=>$(t,e))),n=Fq(t),o=new Map(a.map(e=>[`${Mq(t,e)}\u0000${$(t,e)}`,r(e)]));return i([vq(t.group,`group column`).label||Z().rowLabel,...e],n.map(t=>({head:t,cells:e.map(e=>o.get(`${t}\u0000${e}`)??ZG())})))}case`funnel`:{let e=Q(t,n.key,0);return i([lJ(t),n.label,Z().ofPreviousStepLabel,MG(Z().ofFirstStepText,{first:$(t,0)})],a.map(i=>({head:$(t,i),cells:[r(i),i?Kq(Q(t,n.key,i),Q(t,n.key,i-1)):ZG(),Kq(Q(t,n.key,i),e)]})))}case`gauge`:return i([lJ(t),n.label,...t.bands.length?[Z().bandLabel]:[]],a.map(e=>({head:kq(t,e)[t.x.key]==null?n.label:$(t,e),cells:[r(e),...t.bands.length?[Zq(t,Q(t,n.key,e))]:[]]})));case`waterfall`:return i([lJ(t),Z().changeLabel,Z().runningTotalLabel],$q(t).map(e=>({head:$(t,e.index),cells:[e.total?ZG():iJ(e.value,n.format),X(e.level,n.format)]})));case`treemap`:{let e=tJ(t);return i([vq(t.group,`group column`).label||Z().groupLabel,t.x.label||Z().itemLabel,n.label,Z().shareOfGroupLabel],a.map(i=>({head:Mq(t,i),cells:[$(t,i),r(i),Kq(Q(t,n.key,i),e.get(Mq(t,i)))]})))}case`sankey`:return i([lJ(t),vq(t.to,`to column`).label||Z().toLabel,n.label],a.map(e=>({head:$(t,e),cells:[Nq(t,e),r(e)]})));case`scatter`:case`bubble`:return i([lJ(t),n.label,...t.size?[t.size.label||t.size.key]:[],...t.group?[t.group.label||Z().groupLabel]:[]],a.map(e=>({head:$(t,e),cells:[r(e),...t.size?[X(kq(t,e)[t.size.key],t.size.format)]:[],...t.group?[Mq(t,e)]:[]]})))}let o=t.type===`donut`,s=o?t.data.reduce((e,r,i)=>e+(Q(t,n.key,i)??0),0):0,c=[lJ(t),...t.series.map(e=>e.label)];return o&&c.push(Z().shareLabel),i(c,a.slice(0,500).map(e=>{let i=t.series.map(t=>r(e,t));if(o){let r=Q(t,n.key,e);i.push(s&&r!=null?X(r/s,{style:`percent`}):ZG())}return{head:$(t,e),cells:i}}),t.data.length)}function dJ(e){switch(e?.style){case`currency`:case`compact`:return e.currency?` (${e.currency})`:``;case`percent`:return` (%)`;case`duration`:return` (${e.unit??`s`})`;default:return``}}function fJ(e,t){return e==null?e:t?.unit===`paise`?Number(hK(e)):t?.style===`percent`?Number((e*100).toPrecision(12)):e}function pJ(e){let t=e.allData&&e.allData!==e.data?{...e,data:e.allData}:e,n=e=>{if(e==null)return``;let t=String(e);return typeof e==`string`&&/^[=+\-@\t\r]/.test(t)&&(t=`'${t}`),/[",\r\n]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t},r={head:t.x.label||t.x.key,value:e=>{let n=e[t.x.key];return t.x.kind===`time`?OK(n,{pattern:t.x.format?.pattern??`day`,timeZone:t.timeZone}):n}},i=t.series.map(e=>({head:`${e.label}${dJ(e.format)}`,value:t=>{let n=t[e.key];return fJ(pq(n)?n:null,e.format)}})),a=t.group,o=a?{head:a.label||a.key,value:e=>e[a.key]}:null,s;switch(t.type){case`heatmap`:s=[r,vq(o,`group column`),...i];break;case`treemap`:s=[vq(o,`group column`),r,...i];break;case`sankey`:{let e=vq(t.to,`to column`);s=[r,{head:e.label||e.key,value:t=>t[e.key]},...i];break}case`bubble`:{let e=vq(t.size,`size column`);s=[r,...i,{head:`${e.label||e.key}${dJ(e.format)}`,value:t=>{let n=t[e.key];return fJ(pq(n)?n:null,e.format)}},...o?[o]:[]];break}case`scatter`:s=[r,...i,...o?[o]:[]];break;case`gauge`:s=t.x.key===``?i:[r,...i];break;default:s=[r,...i]}let c=[s.map(e=>n(e.head)).join(`,`)];for(let e of t.data)c.push(s.map(t=>n(t.value(e))).join(`,`));return`${c.join(`\r
21
- `)}`}function mJ(e){return(e?.title??``).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``)||`chart`}var hJ=(e,t,n)=>{if(!t.length)return null;let r=Uq(t),i=Wq(t);return r===i?MG(Z().constantSpanText,{label:e,lo:X(r,n)}):MG(Z().rangeSpanText,{label:e,lo:X(r,n),hi:X(i,n)})};function gJ(e,t=new Set){let n=[];e.description&&n.push(e.description.replace(/\.?\s*$/,`.`));let r=Rq(e);if(r.length&&r.every(e=>t.has(e)))return n.push(Z().everySeriesHiddenText),n.join(` `);let i=e.data.length,a=e.data.map((e,t)=>t).filter(n=>!Bq(e,n,t)),o=Oq(e),s=Gq(e,o.key),c=s.reduce((e,t)=>e+t,0),l=()=>e.data.reduce((t,n,r)=>(Q(e,o.key,r)??-1/0)>(Q(e,o.key,t)??-1/0)?r:t,0),u=()=>e.data.reduce((t,n,r)=>(Q(e,o.key,r)??1/0)<(Q(e,o.key,t)??1/0)?r:t,0);switch(e.type){case`donut`:{let t=a.reduce((t,n)=>t+(Q(e,o.key,n)??0),0);if(n.push(NG(Z(),`donutSummaryText`,a.length,{rows:a.length,label:o.label,total:X(t,o.format)})),a.length&&t){let r=a.reduce((t,n)=>(Q(e,o.key,n)??-1/0)>(Q(e,o.key,t)??-1/0)?n:t,vq(a[0],`first slice`));n.push(MG(Z().donutLargestText,{top:$(e,r),share:X((Q(e,o.key,r)??0)/t,{style:`percent`})}))}return n.join(` `)}case`heatmap`:if(n.push(MG(Z().heatmapSummaryText,{label:o.label,group:vq(e.group,`group column`).label||Z().rowFallbackLabel,x:e.x.label||Z().columnFallbackLabel,n:i})),s.length){let t=l(),r=u();n.push(MG(Z().highestAtLowestAtText,{highValue:_J(e,t),highGroup:Mq(e,t),high:$(e,t),lowValue:_J(e,r),lowGroup:Mq(e,r),low:$(e,r)}))}return n.join(` `);case`calendar`:return n.push(i===1?MG(Z().calendarSummaryTextOne,{label:o.label,n:i}):MG(Z().calendarSummaryTextOther,{label:o.label,n:i,range:i>1?MG(Z().calendarRangeText,{first:$(e,0),last:$(e,i-1)}):``})),s.length&&n.push(MG(Z().highestLowestText,{maxValue:_J(e,l()),max:$(e,l()),minValue:_J(e,u()),min:$(e,u())})),n.join(` `);case`funnel`:return n.push(MG(Z().funnelSummaryText,{label:o.label,n:i})),i>1&&n.push(MG(Z().funnelStartText,{first:$(e,0),firstValue:_J(e,0),last:$(e,i-1),lastValue:_J(e,i-1),share:Kq(Q(e,o.key,i-1),Q(e,o.key,0))})),n.join(` `);case`gauge`:{let t=Q(e,o.key,0),{min:r,max:i}=Qq(e),a=t==null?null:Xq(e,t);return n.push(MG(Z().gaugeSummaryText,{type:HK(`gauge`),label:o.label,value:X(t,o.format),min:X(r,o.format),max:X(i,o.format),band:a?MG(Z().gaugeBandText,{band:a.label}):``})),n.join(` `)}case`waterfall`:{let t=$q(e);if(n.push(MG(Z().waterfallSummaryText,{label:o.label})),i>1){let r=t.filter(e=>!e.total);n.push(MG(Z().opensAtClosesAtText,{opening:X(vq(t[0],`waterfall opening bar`).value,o.format),closing:X(vq(t[i-1],`waterfall closing bar`).value,o.format)}));let a=r.reduce((e,t)=>t.value>(e?.value??0)?t:e,null),s=r.reduce((e,t)=>t.value<(e?.value??0)?t:e,null);a&&n.push(MG(Z().largestRiseText,{xText:$(e,a.index),signed:iJ(a.value,o.format)})),s&&n.push(MG(Z().largestFallText,{xText:$(e,s.index),signed:iJ(s.value,o.format)}))}return n.join(` `)}case`treemap`:{let t=tJ(e);if(!t.size)return MG(Z().treemapEmptyText,{label:o.label});let[r,a]=[...t].reduce((e,t)=>t[1]>e[1]?t:e);return n.push(MG(Z().treemapSummaryText,{label:o.label,n:i,totals:t.size,total:X(c,o.format)})),n.push(MG(Z().treemapLargestGroupText,{name:r,share:Kq(a,c)})),n.join(` `)}case`sankey`:{let t=vq(e.to,`to column`).key,r=Pq(e.data.flatMap(n=>[String(n[e.x.key]),String(n[t])])),a=l();return n.push(MG(Z().sankeySummaryText,{label:o.label,n:i,nodes:r.length})),n.push(MG(Z().largestFlowText,{xText:$(e,a),toText:Nq(e,a),fmtAt:_J(e,a)})),n.join(` `)}case`scatter`:case`bubble`:{let r=Fq(e).filter(e=>!t.has(e));n.push(MG(Z().scatterSummaryText,{type:HK(e.type),label:o.label,xLabel:e.x.label||e.x.key,count:a.length,groups:r.length?NG(Z(),`groupsText`,r.length,{groups:r.join(`, `)}):``}));let i=a.map(t=>kq(e,t)[e.x.key]).filter(pq),s=a.map(t=>Q(e,o.key,t)).filter(e=>e!=null);for(let t of[hJ(e.x.label||String(e.x.key),i,e.x.format),hJ(o.label,s,o.format)])t&&n.push(t);return n.join(` `)}}let d=e.stack===`percent`?Z().stackedPercentText:e.stack===`stacked`?Z().stackedText:``,f=e.series.filter(e=>!t.has(e.key));n.push(MG(Z().summaryText,{type:HK(e.type),series:f.map(e=>e.label).join(`, `),stacked:d,sharedAxis:e.type===`multiples`?Z().sharedAxisText:``})),i&&n.push(i===1?MG(Z().pointsSummaryTextOne,{n:i,first:$(e,0)}):MG(Z().pointsSummaryTextOther,{n:i,first:$(e,0),last:$(e,i-1)}));for(let t of f){let r=hJ(t.label,Gq(e,t.key),t.format);r&&n.push(r)}return n.join(` `)}var _J=(e,t)=>{let n=Oq(e);return X(Q(e,n.key,t),n.format)};function vJ(e){return e.stack===`percent`?{style:`percent`,decimals:0}:AK(e.y.format)}var yJ=864e5,bJ={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1},xJ=e=>bJ[e]??0,SJ=[`donut`,`funnel`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`];function CJ(e,t){let n=e.data.map((e,t)=>t).filter(n=>!Bq(e,n,t));if(e.type!==`scatter`&&e.type!==`bubble`)return n;let r=t=>Q(e,e.x.key,t)??0;return n.sort((e,t)=>r(e)-r(t)||e-t)}function wJ(e){let t=Pq(e.data.map((t,n)=>$(e,n))),n=Fq(e),r=new Map(e.data.map((r,i)=>[`${t.indexOf($(e,i))},${n.indexOf(Mq(e,i))}`,i]));return{columns:t.length,rows:n.length,at:r,position:r=>[t.indexOf($(e,r)),n.indexOf(Mq(e,r))]}}function TJ(e,t,n,r){if(n===`Escape`)return null;let i=e.data.length;if(!i)return t;if(e.type===`gauge`)return n in bJ||n===`Home`||n===`End`?{index:0,series:0}:t;if(e.type===`heatmap`||e.type===`calendar`)return EJ(e,t,n);let a=SJ.includes(e.type),o=e.series.map((e,t)=>r.has(e.key)?-1:t).filter(e=>e>=0),s=a?CJ(e,r):[];if(a?!s.length:!o.length)return t;let c=t??{index:a?vq(s[0],`first mark`):0,series:a?0:vq(o[0],`first visible series`)};if(t==null&&n in bJ)return c;if(a){let e=Math.max(0,s.indexOf(c.index));return n===`Home`?{index:vq(s[0],`first mark`),series:0}:n===`End`?{index:vq(s[s.length-1],`last mark`),series:0}:n in bJ?{index:vq(s[(e+xJ(n)+s.length)%s.length],`next mark`),series:0}:t}if(n===`Home`)return{...c,index:0};if(n===`End`)return{...c,index:i-1};if(!(n in bJ))return t;if(e.type===`bar`?n===`ArrowUp`||n===`ArrowDown`:n===`ArrowLeft`||n===`ArrowRight`)return{...c,index:Math.min(i-1,Math.max(0,c.index+xJ(n)))};let l=Math.max(0,o.indexOf(c.series)),u=e.type===`bar`?xJ(n):-xJ(n);return{...c,series:vq(o[Math.min(o.length-1,Math.max(0,l+u))],`series`)}}function EJ(e,t,n){let r=e.data.length,i=e.type===`calendar`,a=i?e.data.map((e,t)=>t).sort((t,n)=>jq(e,t)-jq(e,n)):[],o=i?null:wJ(e),s=t??{index:i?vq(a[0],`first day`):0,series:0};if(t==null&&n in bJ)return s;if(n===`Home`)return{index:i?vq(a[0],`first day`):0,series:0};if(n===`End`)return{index:i?vq(a[r-1],`last day`):r-1,series:0};if(!(n in bJ))return t;if(i){let t=n===`ArrowDown`||n===`ArrowUp`?xJ(n):xJ(n)*7,r=t=>{let n=jq(e,t);return Math.floor((n+WG(n,e.timeZone))/yJ)},i=r(s.index),o=a.filter(e=>t>0?r(e)>i:r(e)<i);if(!o.length)return{index:s.index,series:0};let c=i+t;return{index:o.reduce((e,t)=>Math.abs(r(t)-c)<Math.abs(r(e)-c)?t:e),series:0}}if(!o)throw Error(`heat grid missing`);let[c,l]=o.position(s.index),[u,d]=n===`ArrowLeft`||n===`ArrowRight`?[xJ(n),0]:[0,xJ(n)];return{index:o.at.get(`${c+u},${l+d}`)??s.index,series:0}}var DJ=()=>AG(`chart`,jK);Bj([mx,iT,eE,kL,BI,kI,$F,SL,eN,YR,yB,EV,eV,bz,nz,AH,rH,DB,mU,VH,KW,gG]);function OJ(e){let t=e.series[0];if(!t)throw Error(`chart spec has no series`);return t}var kJ=e=>typeof e==`number`;function AJ(e,t){let n=e.data[t];if(!n)throw Error(`chart row ${t} missing`);return n}function jJ(e){if(!e.to)throw Error("chart spec has no `to` column");return e.to.key}function MJ(e){if(!e.size)throw Error("chart spec has no `size` column");return e.size.key}function NJ(e,t,n){let r=e[t];if(!r)throw Error(`percent shares for row ${t} missing`);return r[n]??null}function PJ(e,t,n){let r=e?.[t];if(!r)throw Error(`bar radii for row ${t} missing`);return r[n]}var FJ=e=>kJ(e)?e:null;function IJ(e){return typeof e==`object`&&e&&`row`in e?FJ(e.row):null}function LJ(e){if(typeof e!=`object`||!e||!(`dataZoom`in e)||!Array.isArray(e.dataZoom))return null;let t=e.dataZoom[0];if(typeof t!=`object`||!t||!(`start`in t)||!(`end`in t))return null;let{start:n,end:r}=t;return kJ(n)&&Number.isFinite(n)&&kJ(r)&&Number.isFinite(r)?{start:n,end:r}:null}function RJ(e){if(!e)throw Error(`chart has not been drawn`);return e}var zJ=[`series`,`graphic`,`grid`,`xAxis`,`yAxis`,`title`,`visualMap`,`calendar`,`dataZoom`],BJ=e=>String(e).replace(/[{}]/g,e=>e===`{`?`{`:`}`);function VJ(e){return e.wholeNumbers===!0||e.format?.style===`currency`&&e.format.unit===`paise`}function HJ(e,t,n,r,i=!1){let a=AK(e);if(i)return a.currency?{style:`currency`,currency:a.currency,unit:a.unit,decimals:0}:{style:`number`,decimals:0};if(a.style!==`compact`||!Number.isFinite(t)||!Number.isFinite(n))return a;let o=(n-t)/r;if(!(o>0)||o>=Math.max(Math.abs(t),Math.abs(n))*.02)return a;let s=Math.min(6,Math.max(0,Math.ceil(-Math.log10(o))));return a.currency?{style:`currency`,currency:a.currency,unit:a.unit,decimals:s}:{style:`number`,decimals:s}}var UJ=(e,t)=>{let n=e.filter(e=>typeof e==`number`&&Number.isFinite(e));return[Math.min(...t?[0,...n]:n),Math.max(...t?[0,...n]:n)]},WJ=24,GJ=4,KJ=.6,qJ=(e,t)=>String(e).length*t*KJ,JJ=(e,t)=>{let n=e[t];if(n===void 0)throw Error(`chart palette has no colour at slot ${t}`);return n};function YJ(e){let t=String(e??``).trim(),n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);if(n){let e=n[1]??``,t=e.length===3?[...e].map(e=>e+e).join(``):e;return[0,2,4].map(e=>Number.parseInt(t.slice(e,e+2),16))}let r=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(t);return r?r.slice(1,4).map(Number):null}function XJ(e,t){let n=YJ(e);return n?`rgba(${n.join(`,`)},${t})`:String(e??``).trim()}function ZJ(e,t,n){let r=YJ(e),i=YJ(t);return r&&i?`rgb(${r.map((e,t)=>Math.round(e+((i[t]??0)-e)*n)).join(`,`)})`:e}var QJ=[.2126,.7152,.0722],$J=e=>e.map(e=>e/255).map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4).reduce((e,t,n)=>e+t*(QJ[n]??0),0),eY=(e,t)=>(Math.max(e,t)+.05)/(Math.min(e,t)+.05);function tY(e,t){let n=YJ(e),r=YJ(t.text),i=YJ(t.surface);return!n||!r||!i||eY($J(n),$J(r))>=eY($J(n),$J(i))?t.text:t.surface}var nY=(e,t)=>({type:`linear`,x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:XJ(e,t)},{offset:1,color:XJ(e,0)}]}),rY=(e,t)=>e+WG(e,t);function iY(e){let t=e.x.format?.pattern;return n=>{let r=GG(n,e.timeZone);if(t===`month`||t===`year`)return OK(r,{pattern:t,timeZone:e.timeZone});let i=UG(r,e.timeZone);return i.hour||i.minute?OK(r,{pattern:`time`,timeZone:e.timeZone}):kK(r,{timeZone:e.timeZone})}}function aY(e,t,n){let r=GJ,i=e=>n?e?[r,0,0,r]:[0,r,r,0]:e?[0,0,r,r]:[r,r,0,0];return e.data.map((n,r)=>{let a={};if(e.stack===`none`){for(let t of e.series)a[t.key]=i((Q(e,t.key,r)??0)<0);return a}let o=null,s=null;for(let n of e.series){let i=Q(e,n.key,r);t.has(n.key)||i==null||i===0||(i>0?o=n.key:s=n.key)}for(let t of e.series)a[t.key]=t.key===o?i(!1):t.key===s?i(!0):0;return a})}function oY(e,t,n,r){let i=n.width<576,a=r.animation!==!1&&!t.reducedMotion&&Iq(e)<=5e3,o=Rq(e),s=Object.fromEntries(o.map(e=>[e,!r.hidden.has(e)])),c={palette:t.palette,neutral:t.neutral,rise:t.rise,fall:t.fall,seq:t.seq},l={backgroundColor:t.surface,borderColor:t.grid,borderWidth:1,padding:[10,12],confine:!0,className:`wui-chart-tooltip`,extraCssText:`box-shadow:${t.shadow};border-radius:10px;`,textStyle:{fontFamily:t.font,color:t.textBody,fontSize:12},transitionDuration:a?.25:0},u={backgroundColor:`transparent`,animation:a,animationDuration:1e3,animationEasing:`cubicOut`,animationDurationUpdate:650,animationEasingUpdate:`cubicInOut`,textStyle:{fontFamily:t.font,color:t.label},color:t.palette,legend:{show:!1,data:o,selected:s}},d={base:u,tooltipBase:l,colours:c,compact:i,animate:a},f=$Y[e.type];if(f)return f(e,t,n,r,d);let p=e.type===`bar`,m=e.x.kind===`time`,h=e.stack===`percent`?Vq(e,r.hidden):null,g=p||e.type===`column`?aY(e,r.hidden,p):null,_=e.series.length===1,v=r.renderer===`canvas`,[y,b]=UJ(e.series.flatMap(t=>e.data.map((n,r)=>Q(e,t.key,r))),!0),x=e.stack===`percent`?vJ(e):HJ(e.y.format,e.y.min??y,e.y.max??b,i?3:4,e.y.wholeNumbers),S=h?.some(e=>Object.values(e).some(e=>e!=null&&e<0))?-1:0,C=e.series.findIndex(e=>!r.hidden.has(e.key)),w=e.series.filter(e=>!r.hidden.has(e.key)),T=m&&!e.valueLabels?[]:e.data.map((t,n)=>$(e,n)),E=()=>{let t=e.stack===`percent`?[1,S]:[e.y.max??b,e.y.min??y];return n.width-Math.max(...t.map(e=>qJ(X(e,x),12)))-20},D=!1;if(e.valueLabels){let t=e.data.length>jY?E():AY(T.length,E()),r=p?n.width-bY(T.map(e=>qJ(e,12)))-20:e.type===`line`?t:AY(T.length,E())/Math.max(1,w.length);D=w.flatMap(t=>e.type===`line`?[...MY(e,t.key)].map(n=>Q(e,t.key,n)):e.data.map((n,r)=>Q(e,t.key,r))).filter(e=>e!=null).every(e=>qJ(X(e,x),12)<=r)}let O={type:m?`time`:`category`,boundaryGap:!m&&(e.type===`column`||p),inverse:p,axisLine:{show:!0,lineStyle:{color:t.axis}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{color:t.label,fontSize:12,margin:12,...m||e.type!==`column`||e.x.labelFit===`auto`?{hideOverlap:!0}:PY(e.x.labelFit,T,E()),...m?{formatter:iY(e)}:{}},...m?{}:{data:T}},k={type:`value`,splitNumber:i?3:4,min:e.stack===`percent`?S:e.y.min,max:e.stack===`percent`?1:e.y.max,minInterval:VJ(e.y)?1:void 0,interval:e.stack===`percent`?.25:void 0,axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:t.grid,type:`solid`,width:1}},axisLabel:{color:t.label,fontSize:12,formatter:e=>X(e,x)},...e.y.label?{name:e.y.label,nameLocation:`end`,nameGap:12,nameTextStyle:{color:t.label,fontSize:12,align:p?`right`:`left`}}:{}},A=e.zoom,j=_&&e.type!==`column`&&!p&&!i&&!e.valueLabels,M=e.series.map((n,r)=>{let o=JJ(t.palette,oJ(n,r)%t.palette.length),s=e.data.some((t,r)=>Q(e,n.key,r)!=null&&Q(e,n.key,r-1)==null&&Q(e,n.key,r+1)==null),c=t=>{let r=Q(e,n.key,t),i=h?NJ(h,t,n.key):r;return m?[rY(jq(e,t),e.timeZone),i]:i},l={id:n.key,name:n.key,stack:e.stack===`none`?void 0:`total`,emphasis:{focus:_?`none`:`series`,blurScope:`coordinateSystem`},blur:{itemStyle:{opacity:.22},lineStyle:{opacity:.22},areaStyle:{opacity:.08}}};if(e.type===`line`||e.type===`area`){let i=e.type===`area`?_||e.stack!==`none`?t.dark?.34:.22:.1:0,u=e.valueLabels?MY(e,n.key):null;return{...l,type:`line`,data:e.data.map((e,t)=>c(t)),smooth:.35,smoothMonotone:`x`,connectNulls:!1,symbol:`circle`,showSymbol:s||e.valueLabels,label:e.valueLabels?{show:D,position:`top`,distance:6,fontFamily:t.font,fontSize:12,fontWeight:600,color:t.text,formatter:e=>e.value==null||!u?.has(e.dataIndex)?``:X(Array.isArray(e.value)?e.value[1]:e.value,x)}:void 0,symbolSize:8,sampling:v?`lttb`:void 0,lineStyle:{width:2,color:o,..._&&!v?{shadowColor:XJ(o,.35),shadowBlur:10,shadowOffsetY:6}:{}},itemStyle:{color:o,borderColor:t.surface,borderWidth:2},areaStyle:i?{color:nY(o,i)}:void 0,endLabel:j?{show:!0,formatter:e=>X(Array.isArray(e.value)?e.value[1]:e.value,x),color:o,fontWeight:600,fontSize:12,distance:8,fontFamily:t.font,valueAnimation:a}:void 0,markLine:r===C?sY(e,t,!1,a):void 0}}return{...l,type:`bar`,barMaxWidth:WJ,barCategoryGap:i?`28%`:`38%`,itemStyle:{color:o,borderColor:t.surface,borderWidth:e.stack===`none`?0:1},animationDelay:a?e=>e*45+r*110:0,data:e.data.map((e,t)=>({value:c(t),itemStyle:{borderRadius:PJ(g,t,n.key)}})),label:e.valueLabels?{show:D,position:p?`right`:`top`,distance:6,fontFamily:t.font,fontSize:12,fontWeight:600,color:t.text,formatter:e=>e.value==null?``:X(e.value,x)}:void 0,markLine:r===C?sY(e,t,p,a):void 0}});return{...u,useUTC:m,grid:{left:4,right:j?64:i?8:16,top:e.y.label?28:D&&(e.type===`column`||e.type===`line`)?24:12,bottom:A?44:4,outerBoundsMode:`same`},dataZoom:A?XY(e,t,JJ(t.palette,0),r.zoom):void 0,tooltip:{...l,trigger:`axis`,axisPointer:e.type===`line`||e.type===`area`?{type:`line`,lineStyle:{color:t.axis}}:{type:`shadow`,shadowStyle:{color:XJ(t.neutral,t.dark?.12:.1)}},formatter:t=>sJ(rJ(e,(Array.isArray(t)?t:[t])[0]?.dataIndex??0,r.hidden,c))},xAxis:p?k:O,yAxis:p?O:k,series:M}}function sY(e,t,n,r){if(!e.target)return;let i=OJ(e).format;return{silent:!0,symbol:`none`,animation:r,lineStyle:{color:t.label,type:[5,4],width:1},label:{position:`insideEndTop`,formatter:()=>[e.target?.label,X(e.target?.value,i)].filter(Boolean).join(` `),color:t.textMuted,fontSize:12,fontFamily:t.font,backgroundColor:t.surface,padding:[2,6],borderRadius:4},data:[n?{xAxis:e.target.value}:{yAxis:e.target.value}]}}function cY(e,t,n,r,i){let{base:a,tooltipBase:o,colours:s,compact:c}=i,l=OJ(e),u=e.data.map((t,n)=>$(e,n)),d=e.data.reduce((t,n,i)=>t+(r.hidden.has($(e,i))?0:Q(e,l.key,i)??0),0);return{...a,tooltip:{...o,trigger:`item`,formatter:t=>sJ(rJ(e,t.dataIndex,r.hidden,s))},graphic:[{type:`group`,left:`center`,top:`middle`,silent:!0,children:[{type:`text`,style:{text:X(d,AK(l.format)),x:0,y:-10,align:`center`,verticalAlign:`middle`,fill:t.text,fontSize:c?18:22,fontWeight:650,fontFamily:t.font}},{type:`text`,style:{text:e.centerLabel||DJ().centerLabel,x:0,y:14,align:`center`,verticalAlign:`middle`,fill:t.label,fontSize:12,fontFamily:t.font}}]}],series:[{id:l.key,name:l.key,type:`pie`,radius:c?[`50%`,`70%`]:[`54%`,`72%`],center:[`50%`,`50%`],padAngle:1.6,minAngle:3,startAngle:90,avoidLabelOverlap:!0,itemStyle:{borderRadius:6,borderColor:t.surface,borderWidth:2},animationType:`expansion`,animationDuration:1100,label:e.sliceValues?{show:!0,position:`outside`,color:t.label,fontFamily:t.font,fontSize:12,lineHeight:16,formatter:e=>`${e.name}\n${X(Number(e.value),l.format)} (${X(e.percent/100,{style:`percent`,decimals:0})})`}:c?{show:!1}:{show:!0,position:`outside`,color:t.label,fontFamily:t.font,fontSize:12,lineHeight:16,formatter:e=>`${e.name}\n${X(e.percent/100,{style:`percent`,decimals:0})}`},labelLine:{length:10,length2:8,smooth:.2,lineStyle:{color:t.axis}},labelLayout:{hideOverlap:!e.sliceValues},emphasis:{scale:!0,scaleSize:6,itemStyle:{shadowBlur:16,shadowColor:`rgba(0,0,0,0.18)`}},data:e.data.map((t,n)=>({name:u[n],value:Q(e,l.key,n)??0,itemStyle:{color:aJ(e,n,s)}}))}]}}var lY=e=>[...new Set(e)],uY=(e,t)=>e.data.map((n,r)=>Q(e,t,r));function dY(e,t){return{...e,trigger:`item`,formatter:e=>t(e)}}var fY=(e,t,n={})=>({type:`category`,data:t,axisLine:{lineStyle:{color:e.axis}},axisTick:{show:!1},axisLabel:{color:e.label,fontSize:12,margin:12,hideOverlap:!0},...n}),pY=(e,t,n={})=>({type:`value`,splitNumber:4,axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:e.grid,type:`solid`,width:1}},axisLabel:{color:e.label,fontSize:12,formatter:t},...n});function mY(e,t,n={}){return{type:`piecewise`,orient:`horizontal`,right:4,bottom:0,pieces:t.map((e,n)=>({gte:e.from,[n===t.length-1?`lte`:`lt`]:e.to,color:e.colour})),itemWidth:11,itemHeight:11,itemGap:3,itemSymbol:`roundRect`,showLabel:!1,text:[DJ().moreLabel,DJ().lessLabel],textGap:8,selectedMode:!1,textStyle:{color:e.label,fontSize:12,fontFamily:e.font},...n}}function hY(e,t,n,r,i){let a=OJ(e),o=lY(e.data.map((t,n)=>$(e,n))),s=Fq(e),c=qq(uY(e,a.key),t.seq);return{...i.base,grid:{left:4,right:4,top:8,bottom:40,outerBoundsMode:`same`},tooltip:dY(i.tooltipBase,t=>sJ(rJ(e,t.dataIndex,r.hidden,i.colours))),xAxis:fY(t,o,{axisLine:{show:!1},splitArea:{show:!1}}),yAxis:fY(t,s,{inverse:!0,axisLine:{show:!1}}),visualMap:mY(t,c),series:[{type:`heatmap`,data:e.data.map((t,n)=>[o.indexOf($(e,n)),s.indexOf(Mq(e,n)),Q(e,a.key,n)??`-`]),itemStyle:{borderColor:t.surface,borderWidth:2,borderRadius:4},emphasis:{itemStyle:{borderColor:t.text,borderWidth:1.5}},progressive:0,animationDuration:800}]}}var gY=6048e5,_Y=(e,t)=>{let n=UG(e,t);return`${n.year}-${String(n.month+1).padStart(2,`0`)}-${String(n.day).padStart(2,`0`)}`};function vY(e,t){let n=e.data.map((t,n)=>jq(e,n)).filter(Number.isFinite),r=yY(n),i=bY(n),a=Math.ceil((i-r)/gY)+1,o=Math.floor((t.height-62)/7),s=Math.max(xY,Math.min(SY,o,Math.floor((t.width-44)/a))),c=Math.max(1,Math.floor((t.width-44)/s));return{cell:s,from:a>c?i-(c-1)*gY:r,to:i}}var yY=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.min(t,e),1/0),bY=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.max(t,e),-1/0),xY=9,SY=24;function CY(e,t,n,r,i){let a=OJ(e),{cell:o,from:s,to:c}=vY(e,n),l=qq(uY(e,a.key),t.seq);return{...i.base,tooltip:dY(i.tooltipBase,t=>sJ(rJ(e,t.dataIndex,r.hidden,i.colours))),visualMap:mY(t,l,{right:4}),calendar:{range:[_Y(s,e.timeZone),_Y(c,e.timeZone)],top:24,left:34,cellSize:[o,o],splitLine:{show:!1},itemStyle:{color:t.seq[0],borderColor:t.surface,borderWidth:o<16?2:3},dayLabel:{firstDay:1,nameMap:[``,rK(1,`short`),``,rK(3,`short`),``,rK(5,`short`),``],color:t.label,fontSize:12,fontFamily:t.font,margin:8},monthLabel:{color:t.label,fontSize:12,fontFamily:t.font,margin:8},yearLabel:{show:!1}},series:[{type:`heatmap`,coordinateSystem:`calendar`,data:e.data.map((t,n)=>[_Y(jq(e,n),e.timeZone),Q(e,a.key,n)??`-`]),itemStyle:{borderRadius:3,borderColor:t.surface,borderWidth:2},emphasis:{itemStyle:{borderColor:t.text,borderWidth:1.5}}}]}}function wY(e,t,n,r,i){let a=OJ(e),o=Yq(e.data.length,t.seq),s=Q(e,a.key,0);return{...i.base,tooltip:dY(i.tooltipBase,t=>sJ(rJ(e,t.dataIndex,r.hidden,i.colours))),series:[{type:`funnel`,sort:`none`,gap:3,left:0,right:0,top:4,bottom:4,minSize:`38%`,maxSize:`100%`,funnelAlign:`center`,animationDuration:900,itemStyle:{borderColor:t.surface,borderWidth:0,borderRadius:6},emphasis:{itemStyle:{shadowBlur:14,shadowColor:`rgba(0,0,0,0.18)`}},label:{show:!0,position:`inside`,fontFamily:t.font,lineHeight:17},data:e.data.map((n,r)=>{let i=tY(o[r],t),c=Q(e,a.key,r),l=r?MG(DJ().funnelPreviousStepText,{share:Kq(c,Q(e,a.key,r-1))}):MG(DJ().shareOfStepText,{share:Kq(c,s),first:BJ($(e,0))});return{name:$(e,r),value:c??0,itemStyle:{color:o[r]},label:{formatter:`{n|${BJ($(e,r))}} {v|${BJ(X(c,a.format))}}\n{p|${r?l:DJ().firstStageLabel}}`,rich:{n:{color:i,fontSize:12.5,fontWeight:500,fontFamily:t.font},v:{color:i,fontSize:13,fontWeight:700,fontFamily:t.font},p:{color:XJ(i,.78),fontSize:12,fontFamily:t.font}}}}})}]}}function TY(e,t,n,r,i){let a=OJ(e),{min:o,max:s}=Qq(e),c=Q(e,a.key,0),l=c??o,u=c==null?null:Xq(e,c),d=JJ(t.palette,0),f=s-o||1,p=e.bands.length?e.bands.map((e,n)=>[Math.min(1,Math.max(0,(e.upTo-o)/f)),t.seq[1+Math.min(n,3)]]):[[1,t.grid]];return e.bands.length&&(p[p.length-1]?.[0]??1)<1&&p.push([1,t.grid]),{...i.base,tooltip:dY(i.tooltipBase,()=>sJ(rJ(e,0,r.hidden,i.colours))),series:[{type:`gauge`,startAngle:215,endAngle:-35,min:o,max:s,radius:`96%`,center:[`50%`,`58%`],splitNumber:10,pointer:{show:!1},anchor:{show:!1},progress:{show:c!=null,width:14,roundCap:!0,itemStyle:{color:d,shadowBlur:i.animate?12:0,shadowColor:XJ(d,.35)}},axisLine:{roundCap:!0,lineStyle:{width:14,color:p}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},title:{offsetCenter:[0,`30%`],color:t.label,fontSize:12.5,fontFamily:t.font},detail:{valueAnimation:i.animate,offsetCenter:[0,`-4%`],fontFamily:t.font,formatter:e=>`{v|${BJ(c==null?X(null):X(e,a.format))}}{u|/${BJ(X(s,a.format))}}${u?`\n{s|${BJ(u.label)}}`:``}`,rich:{v:{fontSize:36,fontWeight:650,color:t.text,fontFamily:t.font,padding:[0,2,0,0]},u:{fontSize:14,color:t.label,fontFamily:t.font,padding:[12,0,0,0]},s:{fontSize:12,color:t.label,fontFamily:t.font,padding:[8,0,0,0]}}},data:[{value:l,name:e.data[0]?.[e.x.key]==null?a.label:$(e,0)}]}]}}function EY(e){let t=bY(e.map(e=>e.level).concat(e.map(e=>e.from),e.map(e=>e.to))),n=yY(e.filter(e=>!e.total).map(e=>Math.min(e.from,e.to)).concat(e.filter(e=>e.total).map(e=>e.value))),r=bY(e.filter(e=>!e.total).map(e=>Math.abs(e.value)));if(!(t>0)||!(n>t*.4)||!(r<t*.15))return null;let i=10**Math.floor(Math.log10(t))/10,a=Math.round(t*.08/i)*i,o=Math.floor(n*.965/i)*i;return o>a?{start:a,end:o}:null}var DY=4,OY=72,kY=12,AY=(e,t)=>Math.floor(t/Math.max(1,e)-DY),jY=12;function MY(e,t){let n=e.data.map((e,t)=>t).filter(n=>Q(e,t,n)!=null);if(e.data.length<=jY||!n.length)return new Set(n);let r=n=>Q(e,t,n)??0,i=n.reduce((e,t)=>r(t)>r(e)?t:e),a=n.reduce((e,t)=>r(t)<r(e)?t:e);return new Set([n[0],n[n.length-1],i,a].filter(kJ))}function NY(e,t){return bY(e.flatMap(e=>String(e).split(/\s+/)).map(e=>qJ(e,kY)))<=t?{interval:0,width:t,overflow:`break`}:{interval:0,rotate:45,width:OY,overflow:`truncate`}}function PY(e,t,n){let r=AY(t.length,n);return e===`all`?{...NY(t,r),hideOverlap:!1}:e===`rotate`?{interval:0,rotate:45,width:OY,overflow:`truncate`,hideOverlap:!1}:e===`ellipsis`?{interval:0,rotate:0,width:Math.max(1,r),overflow:`truncate`,hideOverlap:!1}:{hideOverlap:!0}}function FY(e,t,n){let r=AY(e.length,n),i=NY(e,r);return{nameSize:kY,valueSize:12,category:`rotate`in i?{...i,hideOverlap:!0}:i,showValues:t.every(e=>qJ(e,12)<=r)}}function IY(e,t,n,r,i){let a=OJ(e),o=$q(e),s=vJ(e),c=EY(o),l=t=>nJ(e,t.index,i.colours),u=o.map(t=>$(e,t.index)),d=o.map(e=>e.total?X(e.value,s):iJ(e.value,s)),f=o.flatMap(e=>[e.from,e.to]),p=Math.max(qJ(X(bY(f),s),11),qJ(X(yY(f),s),11))+8,m=FY(u,d,n.width-p-12);return{...i.base,grid:{left:4,right:8,top:28,bottom:4,outerBoundsMode:`same`},tooltip:{...i.tooltipBase,trigger:`axis`,axisPointer:{type:`shadow`,shadowStyle:{color:XJ(t.neutral,.1)}},formatter:t=>sJ(rJ(e,(Array.isArray(t)?t:[t])[0]?.dataIndex??0,r.hidden,i.colours))},xAxis:fY(t,u,{axisLabel:{color:t.label,fontSize:m.nameSize,margin:12,...m.category}}),yAxis:pY(t,e=>X(e,s),{min:0,minInterval:VJ(e.y)?1:void 0,splitNumber:5,...c?{breaks:[{start:c.start,end:c.end,gap:`6%`}],breakArea:{show:!0,itemStyle:{color:t.surface,borderColor:t.axis,borderWidth:1,borderType:`solid`,opacity:1},zigzagAmplitude:3,zigzagZ:200}}:{}}),series:[{type:`line`,step:`end`,data:o.map(e=>e.level),symbol:`none`,silent:!0,z:1,lineStyle:{color:t.axis,width:1},tooltip:{show:!1},animation:!1,emphasis:{disabled:!0}},{type:`bar`,stack:`w`,data:o.map(e=>Math.min(e.from,e.to)),silent:!0,itemStyle:{color:`transparent`},emphasis:{disabled:!0},tooltip:{show:!1},barMaxWidth:48},{name:a.key,type:`bar`,stack:`w`,z:3,barMaxWidth:48,barCategoryGap:`34%`,itemStyle:{borderRadius:5},emphasis:{itemStyle:{shadowBlur:10,shadowColor:`rgba(0,0,0,0.15)`}},animationDelay:i.animate?e=>e*140:0,label:{show:m.showValues,position:`top`,distance:6,fontFamily:t.font,fontSize:m.valueSize,fontWeight:600,color:t.text,formatter:e=>d[e.dataIndex]},data:o.map(e=>({value:Math.abs(e.to-e.from),itemStyle:{color:l(e)}}))}]}}function LY(e){let t=OJ(e).key;return Fq(e).map(n=>({name:n,rows:e.data.map((e,t)=>t).filter(t=>Mq(e,t)===n).sort((n,r)=>(Q(e,t,r)??0)-(Q(e,t,n)??0)||n-r)}))}function RY(e,t,n,r,i){let a=OJ(e),o=tJ(e),s=[...o.values()].reduce((e,t)=>e+t,0),c=(e,t)=>{let r=(e??0)/s*n.width*n.height*.82;return r>5200&&Math.max(qJ(t[0],12),qJ(t[1],11.5))+20<=Math.sqrt(r)},l=LY(e).map(({name:n,rows:r},i)=>{let s=o.get(n),l=JJ(t.palette,i%t.palette.length),u=tY(l,t);return{name:n,value:s,itemStyle:{color:l,borderColor:l},upperLabel:{color:u,formatter:`{n|${BJ(n)}} {v|${BJ(X(s,a.format))}}`,rich:{n:{fontWeight:600,fontSize:12,color:u,fontFamily:t.font},v:{fontSize:12,color:XJ(u,.8),fontFamily:t.font}}},children:r.map((n,r)=>{let i=ZJ(l,t.surface,Math.min(.55,r*.14)),o=tY(i,t),s=Q(e,a.key,n);return{name:$(e,n),value:s,row:n,itemStyle:{color:i},label:{show:c(s,[$(e,n),X(s,a.format)]),formatter:`{n|${BJ($(e,n))}}\n{v|${BJ(X(s,a.format))}}`,rich:{n:{color:o,fontSize:12,fontWeight:500,fontFamily:t.font,lineHeight:16},v:{color:XJ(o,.82),fontSize:12,fontFamily:t.font}}}}})}});return{...i.base,tooltip:dY(i.tooltipBase,t=>t.data?.row==null?sJ({title:t.name,rows:[{color:t.color,label:a.label,value:X(t.value,a.format)},{label:DJ().shareOfAllLabel,value:Kq(FJ(t.value),s)}],foot:``}):sJ(rJ(e,t.data.row,r.hidden,i.colours))),series:[{type:`treemap`,roam:!1,nodeClick:!1,breadcrumb:{show:!1},left:0,right:0,top:0,bottom:0,animationDurationUpdate:700,label:{show:!0,position:`insideTopLeft`,padding:[8,10],overflow:`truncate`,fontFamily:t.font},upperLabel:{show:!0,height:28,padding:[0,10],fontFamily:t.font},levels:[{itemStyle:{borderWidth:0,gapWidth:4,borderColor:t.surface}},{itemStyle:{borderWidth:3,gapWidth:2,borderRadius:8}},{itemStyle:{borderWidth:0,gapWidth:0,borderRadius:5},emphasis:{itemStyle:{borderColor:t.text,borderWidth:0}}}],data:l}]}}function zY(e){let t=jJ(e),n=e.data.map(n=>[String(n[e.x.key]),String(n[t])]),r=new Map(n.flatMap(([e,t])=>[[e,0],[t,0]]));for(let e=0;e<r.size;e+=1)for(let[e,t]of n)r.set(t,Math.max(r.get(t)??0,(r.get(e)??0)+1));return r}function BY(e,t,n,r,i){let a=OJ(e),o=jJ(e),s=eJ(e,t.palette),c=zY(e),l=bY([...c.values()]),u=new Map,d=new Map;e.data.forEach((t,n)=>{let r=Q(e,a.key,n)??0;u.set(String(t[e.x.key]),(u.get(String(t[e.x.key]))??0)+r),d.set(String(t[o]),(d.get(String(t[o]))??0)+r)});let f=e=>d.get(e)??u.get(e)??0,p=e=>({position:e,color:t.text,fontFamily:t.font,fontSize:12,formatter:e=>`{n|${BJ(e.name)}}\n{v|${X(f(e.name),{style:`compact`})}}`,rich:{n:{color:t.textBody,fontSize:12,fontFamily:t.font,lineHeight:15},v:{color:t.label,fontSize:12,fontFamily:t.font}}});return{...i.base,tooltip:dY(i.tooltipBase,t=>sJ(t.dataType===`edge`?rJ(e,t.dataIndex,r.hidden,i.colours):{title:t.name,rows:[{color:t.color,label:a.label,value:X(f(t.name),a.format)}],foot:``})),series:[{type:`sankey`,left:0,right:0,top:6,bottom:6,nodeWidth:10,nodeGap:i.compact?10:14,nodeAlign:`justify`,draggable:!1,layoutIterations:64,animationDuration:1200,emphasis:{focus:`adjacency`,lineStyle:{opacity:.55}},itemStyle:{borderWidth:0,borderRadius:3},lineStyle:{curveness:.5},levels:Array.from({length:l+1},(e,t)=>({depth:t,label:p(t===l&&l>0?`left`:`right`)})),data:[...c.keys()].map(e=>({name:e,itemStyle:{color:s.get(e)}})),links:e.data.map(n=>({source:String(n[e.x.key]),target:String(n[o]),value:n[a.key],lineStyle:{color:s.get(String(n[e.x.key])),opacity:t.dark?.32:.26}}))}]}}function VY(e){let t=e.length,n=e.reduce((e,t)=>e+t[0],0)/t,r=e.reduce((e,t)=>e+t[1],0)/t,i=e.reduce((e,t)=>e+(t[0]-n)**2,0);if(!t||!i)return null;let a=e.reduce((e,t)=>e+(t[0]-n)*(t[1]-r),0)/i,o=yY(e.map(e=>e[1])),s=bY(e.map(e=>e[1])),c=e=>{let t=r+a*(e-n);return t<o?[e+(o-t)/a,o]:t>s?[e+(s-t)/a,s]:[e,t]};return[c(yY(e.map(e=>e[0]))),c(bY(e.map(e=>e[0])))]}var HY=44,UY=28,WY=8;function GY(e,t,n,r,i){let a=OJ(e),o=Fq(e),s=e.type===`bubble`,c=bY(s?e.data.map(t=>t[MJ(e)]).filter(kJ):[]),l=e=>Math.max(WY,(i.compact?UY:HY)*Math.sqrt(e/c)),u=t=>e.data.map((e,t)=>t).filter(n=>!e.group||Mq(e,n)===t),d=(e.group?o:[null]).filter(e=>e==null||!r.hidden.has(e)).flatMap(e=>u(e)),f=e.trend?VY(d.flatMap(t=>{let n=AJ(e,t)[e.x.key],r=Q(e,a.key,t);return kJ(n)&&r!=null?[[n,r]]:[]})):null,p=e.data.map(t=>t[e.x.key]),m=e.data.map((t,n)=>Q(e,a.key,n)),[h,g]=UJ(p,!1),[_,v]=UJ(m,!1),y=HJ(e.y.format,e.y.min??_,e.y.max??v,4),b=HJ(e.x.format,h,g,4),x=(e.group?o:[null]).map((n,r)=>({name:n??a.key,type:`scatter`,symbolSize:s?e=>l(e[2]??NaN):i.compact?8:10,itemStyle:{color:XJ(t.palette[r],.85),borderColor:t.surface,borderWidth:1.5},emphasis:{focus:`series`,scale:1.5,itemStyle:{color:t.palette[r]}},blur:{itemStyle:{opacity:.15}},animationDelay:i.animate?e=>e*6+r*120:0,data:u(n).map(t=>({value:[AJ(e,t)[e.x.key],Q(e,a.key,t),...s?[AJ(e,t)[MJ(e)]]:[]],row:t}))}));return f&&x.push({name:DJ().trendLabel,type:`line`,data:f,symbol:`none`,silent:!0,z:1,tooltip:{show:!1},lineStyle:{color:t.label,width:1.5,type:[6,4]},emphasis:{disabled:!0},endLabel:{show:!0,formatter:DJ().trendLabel,color:t.label,fontSize:12,fontFamily:t.font,offset:[-30,-12]}}),{...i.base,grid:{left:4,right:16,top:e.y.label?28:12,bottom:e.x.label?24:4,outerBoundsMode:`same`},tooltip:dY(i.tooltipBase,t=>t.data?.row==null?``:sJ(rJ(e,t.data.row,r.hidden,i.colours))),xAxis:pY(t,e=>X(e,b),{scale:!0,minInterval:VJ(e.x)?1:void 0,splitLine:{show:!1},axisLine:{show:!0,lineStyle:{color:t.axis}},...e.x.label?{name:e.x.label,nameLocation:`middle`,nameGap:28,nameTextStyle:{color:t.label,fontSize:12,fontFamily:t.font}}:{}}),yAxis:pY(t,e=>X(e,y),{min:e.y.min,max:e.y.max,minInterval:VJ(e.y)?1:void 0,...e.y.label?{name:e.y.label,nameLocation:`end`,nameGap:12,nameTextStyle:{color:t.label,fontSize:12,fontFamily:t.font,align:`left`}}:{}}),series:x}}var KY=32,qY=8,JY=26;function YY(e,t,n,r,i){let a=e.x.kind===`time`,o=e.series.length,s=(n.height-6-JY)/o,c=s-KY-qY,l=JJ(t.palette,0),u=e.data.map((t,n)=>$(e,n)),d=e.series.flatMap((n,r)=>{let i=uY(e,n.key).filter(e=>e!=null).pop();return[{text:n.label,left:0,top:6+r*s,textStyle:{fontSize:12.5,fontWeight:600,color:t.text,fontFamily:t.font}},{text:MG(DJ().latestText,{latest:X(i,n.format)}),right:8,top:7+r*s,textStyle:{fontSize:12,fontWeight:500,color:t.label,fontFamily:t.font}}]}),f=(t,n)=>{let r=Q(e,t.key,n);return a?[rY(jq(e,n),e.timeZone),r]:r};return{...i.base,useUTC:a,title:d,grid:e.series.map((e,t)=>({left:52,right:8,top:6+t*s+KY,height:c})),axisPointer:{link:[{xAxisIndex:`all`}],lineStyle:{color:t.axis},label:{show:!1}},tooltip:{...i.tooltipBase,trigger:`axis`,axisPointer:{type:`line`,lineStyle:{color:t.axis}},formatter:t=>sJ(rJ(e,(Array.isArray(t)?t:[t])[0]?.dataIndex??0,r.hidden,i.colours))},xAxis:e.series.map((n,r)=>({...a?{type:`time`}:fY(t,u,{boundaryGap:!1}),gridIndex:r,axisLine:{lineStyle:{color:r===o-1?t.axis:t.grid}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:r===o-1,color:t.label,fontSize:12,hideOverlap:!0,margin:10,...a?{formatter:iY(e)}:{}}})),yAxis:e.series.map((n,r)=>{let[i,a]=UJ(uY(e,n.key),!1),o=HJ(n.format,e.y.min??i,e.y.max??a,2);return pY(t,e=>X(e,o),{gridIndex:r,splitNumber:2,scale:e.y.min==null,min:e.y.min,max:e.y.max,minInterval:VJ(n)?1:void 0,axisLabel:{color:t.label,fontSize:12,formatter:e=>X(e,o)}})}),series:e.series.map((n,r)=>({id:n.key,name:n.key,type:`line`,xAxisIndex:r,yAxisIndex:r,data:e.data.map((e,t)=>f(n,t)),smooth:.3,symbol:`circle`,showSymbol:!1,symbolSize:7,lineStyle:{width:1.75,color:l},itemStyle:{color:l,borderColor:t.surface,borderWidth:2},areaStyle:{color:nY(l,t.dark?.26:.16)},animationDelay:i.animate?r*160:0,emphasis:{disabled:!0}}))}}function XY(e,t,n,r){let i=r?.start??(e.data.length>5e3?70:0),a=r?.end??100;return[{type:`inside`,start:i,end:a},{type:`slider`,start:i,end:a,height:26,bottom:8,left:52,right:12,borderColor:`transparent`,backgroundColor:t.grid,borderRadius:6,fillerColor:XJ(n,t.dark?.22:.12),handleStyle:{color:t.surface,borderColor:t.axis},moveHandleSize:0,brushSelect:!1,dataBackground:{lineStyle:{color:t.axis,width:.75},areaStyle:{color:XJ(t.neutral,.15)}},selectedDataBackground:{lineStyle:{color:n,width:.75},areaStyle:{color:XJ(n,.18)}},textStyle:{color:t.label,fontSize:12,fontFamily:t.font}}]}function ZY(e,t,n){switch(e.type){case`scatter`:case`bubble`:{if(!e.group)return{seriesIndex:0,dataIndex:n};let t=Mq(e,n),r=e.data.map((e,t)=>t).filter(n=>Mq(e,n)===t);return{seriesIndex:Fq(e).indexOf(t),dataIndex:r.indexOf(n)}}case`waterfall`:return{seriesIndex:2,dataIndex:n};case`sankey`:return{seriesIndex:0,dataIndex:n,dataType:`edge`,tip:!1};case`treemap`:{let t=1;for(let r of LY(e)){let e=r.rows.indexOf(n);if(e>=0)return{seriesIndex:0,dataIndex:t+1+e};t+=1+r.rows.length}return{seriesIndex:0,dataIndex:n}}case`gauge`:case`donut`:case`heatmap`:case`calendar`:case`funnel`:return{seriesIndex:0,dataIndex:n};default:return{seriesIndex:t,dataIndex:n}}}function QY(e,t){switch(e.type){case`scatter`:case`bubble`:case`treemap`:{let e=IJ(t.data);return e==null?null:{series:0,row:e}}case`sankey`:return t.dataType===`edge`?{series:0,row:t.dataIndex}:null;case`waterfall`:return t.seriesIndex===2?{series:0,row:t.dataIndex}:null;case`line`:case`area`:case`column`:case`bar`:case`multiples`:return t.seriesIndex==null?null:{series:t.seriesIndex,row:t.dataIndex};default:return{series:0,row:t.dataIndex}}}var $Y={donut:cY,heatmap:hY,calendar:CY,funnel:wY,gauge:TY,waterfall:IY,treemap:RY,sankey:BY,scatter:GY,bubble:GY,multiples:YY};function eX(e,t,n,r,{pixelRatio:i=2}={}){let a=document.createElement(`div`);a.style.cssText=`position:fixed;left:-10000px;top:0;width:${n.width}px;height:${n.height}px;`,document.body.append(a);let o=bj(a,null,{renderer:`canvas`,devicePixelRatio:i,width:n.width,height:n.height});try{return o.setOption(oY(e,t,n,{...r,renderer:`canvas`,animation:!1})),o.getDataURL({type:`png`,pixelRatio:i,backgroundColor:t.surface})}finally{o.dispose(),a.remove()}}function tX(e,{renderer:t}){let n=bj(e,null,{renderer:t}),r=!1,i=null;return{renderer:t,render(e,t,a,o,{replace:s=!1}={}){let c=r&&!s?LJ(n.getOption()):null,l=oY(e,t,a,{...o,zoom:c});i=e,n.setOption(l,s||!r?{notMerge:!0}:{replaceMerge:zJ}),r=!0},focusPoint(e,t){let{tip:r=!0,...a}=ZY(RJ(i),e,t);n.dispatchAction({type:`downplay`}),n.dispatchAction({type:`highlight`,...a}),r&&n.dispatchAction({type:`showTip`,...a})},clearFocus(){n.dispatchAction({type:`hideTip`}),n.dispatchAction({type:`downplay`})},resize(){n.resize()},flush(){n.getZr().flush()},onSelect(e){n.on(`click`,t=>{if(t.componentType!==`series`)return;let n=QY(RJ(i),t);n&&e({seriesIndex:n.series,dataIndex:n.row})})},onFinished(e){n.on(`finished`,e)},dispose(){n.dispose()}}}var nX=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(nX);var rX=HTMLElement;function iX(e){return e.key===`Enter`&&e.isComposing!==!0&&e.keyCode!==229}function aX(e){return getComputedStyle(e).direction===`rtl`}function oX(e,t){return t?e===`ArrowRight`?`ArrowLeft`:e===`ArrowLeft`?`ArrowRight`:e:e}var sX=()=>AG(`chart`,jK),cX=`wui-chart:select`,lX=`wui-chart:legend-change`,uX=`wui-chart:ready`,dX=[`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`,`Escape`],fX=`(prefers-color-scheme: dark)`,pX=`(prefers-reduced-motion: reduce)`,mX=`(forced-colors: active)`,hX=`(prefers-contrast: more)`,gX=`print`,_X=e=>typeof window.matchMedia==`function`?window.matchMedia(e):null,vX=!1,yX=new Map;function bX(e,t){let n=[...new Set(t)].filter(e=>e&&!yX.has(e));if(!n.length)return;let r=document.createElement(`span`);r.hidden=!0;let i=n.map(e=>{let t=document.createElement(`span`);return t.style.setProperty(`forced-color-adjust`,`none`),t.style.color=e,r.append(t),[e,t]});e.append(r);for(let[e,t]of i)yX.set(e,getComputedStyle(t).color);r.remove()}var xX=[...[1,2,3,4,5,6,7,8].map(e=>`--color-chart-${e}`),...[0,1,2,3,4,5,6].map(e=>`--color-chart-seq-${e}`),`--color-chart-neutral`,`--wui-chart-rise`,`--wui-chart-fall`,`--color-chart-grid`,`--color-chart-axis`,`--color-chart-label`,`--color-surface`,`--color-text`,`--color-text-body`,`--color-text-muted`];function SX(e){let t=getComputedStyle(e),n=!!_X(mX)?.matches,r=e=>t.getPropertyValue(e).trim();n&&bX(e,xX.map(r));let i=e=>n?yX.get(r(e))??r(e):r(e),a=e.closest(`[data-bs-theme], [data-theme]`)??document.documentElement,o=a.getAttribute(`data-bs-theme`)||a.getAttribute(`data-theme`),s={palette:[1,2,3,4,5,6,7,8].map(e=>i(`--color-chart-${e}`)),seq:[0,1,2,3,4,5,6].map(e=>i(`--color-chart-seq-${e}`)),neutral:i(`--color-chart-neutral`),rise:i(`--wui-chart-rise`),fall:i(`--wui-chart-fall`),grid:i(`--color-chart-grid`),axis:i(`--color-chart-axis`),label:i(`--color-chart-label`),surface:i(`--color-surface`),text:i(`--color-text`),textBody:i(`--color-text-body`),textMuted:i(`--color-text-muted`),shadow:r(`--wui-shadow-popover`),font:t.fontFamily,dark:o===`dark`||o===`auto`&&!!_X(fX)?.matches,reducedMotion:!!_X(pX)?.matches};return!s.palette[0]&&!vX&&(vX=!0,bG(`[@webority/ui-elements] <wui-chart> found no --color-chart-* colours: load @webority/theme on the page.`)),s}var CX=new Set,wX=null;function TX(e){if(CX.add(e),wX)return;let t=()=>{yX.clear();for(let e of CX)e._themeChanged()},n=()=>{yX.clear();for(let e of CX)e._themeChanged(!0)},r=new MutationObserver(t);r.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`,`data-bs-theme`,`class`]});let i=new MutationObserver(t);i.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:[`data-theme`,`data-bs-theme`]});let a=[[fX,t],[pX,t],[mX,t],[hX,t],[gX,n]],o=[];for(let[e,t]of a){let n=_X(e);n&&o.push([n,t])}for(let[e,t]of o)e.addEventListener?.(`change`,t);window.addEventListener(`beforeprint`,n),window.addEventListener(`afterprint`,t),wX=()=>{r.disconnect(),i.disconnect();for(let[e,t]of o)e.removeEventListener?.(`change`,t);window.removeEventListener(`beforeprint`,n),window.removeEventListener(`afterprint`,t),wX=null}}function EX(e){CX.delete(e),CX.size||wX?.()}function DX(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.append(n),n.click(),n.remove()}var OX=0,kX=class extends rX{uid;_spec;_normal;_hidden;_focus;_awaitingSpec=!1;_parts=null;_theme=null;_width=null;_visible=!1;_resizeObserver=null;_intersection=null;_engine=null;_drawn=!1;_drawnType=null;_announcedReady=!1;_legendSignature=null;_tableSpec=null;static get observedAttributes(){return[`view`]}constructor(){super(),OX+=1,this.uid=`wui-chart-${OX}`,this._spec=null,this._normal=null,this._hidden=new Set,this._focus=null}get spec(){return this._spec}set spec(e){this._spec=e??null,this._normal=null,this._clearFocus(),this._parts&&this._update()}get view(){return this.getAttribute(`view`)===`table`?`table`:`chart`}set view(e){this.setAttribute(`view`,String(e??`chart`))}connectedCallback(){if(Object.hasOwn(this,`spec`)){let e=this.spec;delete this.spec,this._spec=e??null}if(this._spec??=this._readScript(),this._spec==null&&!this.querySelector(`:scope > script[type='application/json']`)&&(this._awaitingSpec=!0,queueMicrotask(()=>{this._awaitingSpec=!1,this._parts&&this._update()})),this._build(),TX(this),this._theme=SX(this),this._width=this.clientWidth,this._resizeObserver=new ResizeObserver(()=>this._resized()),this._resizeObserver.observe(this),typeof IntersectionObserver==`function`){this._visible=!1;let e=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&(e.disconnect(),this._visible=!0,this._update())},{threshold:.05});this._intersection=e,e.observe(this)}else this._visible=!0;this._update()}disconnectedCallback(){EX(this),this._resizeObserver?.disconnect(),this._intersection?.disconnect(),this._engine?.dispose(),this._engine=null,this._drawn=!1,this._parts=null,this.removeAttribute(`data-ready`)}attributeChangedCallback(e,t,n){t!==n&&this._parts&&(bq(`view`,n,LK),this._update())}toCsv(){let{spec:e}=this._normalized();return e?pJ(e):``}toPng(){let{spec:e}=this._normalized();return e?eX(e,this._theme??SX(this),this._size(e),{hidden:this._hidden,renderer:Lq(e)}):``}exportCsv(e){let t=URL.createObjectURL(new Blob([this.toCsv()],{type:`text/csv;charset=utf-8`}));DX(t,e??`${mJ(this._normalized().spec)}.csv`),setTimeout(()=>URL.revokeObjectURL(t),2e3)}exportPng(e){let t=this.toPng();t&&DX(t,e??`${mJ(this._normalized().spec)}.png`)}_readScript(){let e=this.querySelector(`:scope > script[type="application/json"]`);if(!(e instanceof HTMLScriptElement))return null;try{return JSON.parse(String(e.textContent))}catch(e){return xG(`[@webority/ui-elements] <wui-chart> could not read its JSON spec:`,e instanceof Error?e.message:void 0),null}}_normalized(){return this._normal??=wq(this._spec),this._normal}_build(){let e=CG(`div`,{class:`wui-chart-legend`});e.setAttribute(`role`,`group`),e.setAttribute(`aria-label`,sX().legendLabel),e.hidden=!0,e.addEventListener(`click`,e=>{let t=e.target instanceof Element?e.target.closest(`.wui-chart-legend-item`):null;t instanceof HTMLElement&&this._toggle(t.dataset.key)});let t=CG(`div`,{class:`wui-chart-surface`});t.tabIndex=0,t.setAttribute(`role`,`group`),t.setAttribute(`aria-roledescription`,sX().chartLabel),t.addEventListener(`keydown`,e=>this._onKey(e)),t.addEventListener(`blur`,()=>this._clearFocus());let n=CG(`div`,{class:`wui-chart-canvas`});n.setAttribute(`aria-hidden`,`true`),t.append(n);let r=CG(`div`,{class:`wui-chart-state`});r.setAttribute(`role`,`status`),r.hidden=!0;let i=CG(`div`,{class:`wui-chart-table-wrap visually-hidden`}),a=CG(`p`,{class:`visually-hidden`});a.id=`${this.uid}-summary`;let o=CG(`div`,{class:`visually-hidden`});o.setAttribute(`aria-live`,`polite`),this.replaceChildren(e,t,r,i,a,o),this.setAttribute(`role`,`figure`),this.setAttribute(`aria-describedby`,a.id),this._parts={legend:e,surface:t,canvas:n,state:r,tableWrap:i,summary:a,live:o},this._legendSignature=null,this._tableSpec=null}_size(e){return{width:this._parts?.surface.clientWidth||this.clientWidth||800,height:e.height}}_update(){if(!this._parts||this._awaitingSpec&&this._spec==null)return;let{spec:e,problem:t}=this._normalized(),n=this._parts,r=e===null?`error`:e.state===`ready`&&(!e.data.length||!Aq(e))?`empty`:e.state,i=`${e?.height??320}px`,a=this.view===`table`,o=e!==null&&(r===`ready`||r===`loading`&&this._drawn),s=r===`loading`&&o;if(this.setAttribute(`aria-label`,e?.title||sX().untitledLabel),r===`loading`?this.setAttribute(`aria-busy`,`true`):this.removeAttribute(`aria-busy`),this.setAttribute(`data-state`,r),n.surface.setAttribute(`aria-label`,MG(sX().arrowKeysText,{title:e?.title||sX().untitledLabel})),n.summary.textContent=e?gJ(e,this._hidden):``,e){if(!s){let t=new Set(Rq(e));for(let e of this._hidden)t.has(e)||this._hidden.delete(e)}this._renderTable(e)}else n.tableWrap.replaceChildren();s||this._renderLegend(e,o&&!a),this._renderState(r,e===null?t:r===`error`?e.errorText:r===`loading`?e.loadingText??sX().loadingText:e.emptyText,i,o);let c=r===`ready`&&!a;s||this.toggleAttribute(`data-ready`,!c);let l=n.surface.hidden&&o&&!a;n.surface.hidden=!o||a,n.surface.style.height=i,n.tableWrap.className=a&&e?`wui-chart-table-wrap`:`wui-chart-table-wrap visually-hidden`,n.tableWrap.style.height=a&&e?i:``,a&&e?(n.tableWrap.tabIndex=0,n.tableWrap.setAttribute(`role`,`region`),n.tableWrap.setAttribute(`aria-label`,`${e.title||sX().untitledLabel} ${sX().dataSuffixLabel}`)):(n.tableWrap.removeAttribute(`tabindex`),n.tableWrap.removeAttribute(`role`),n.tableWrap.removeAttribute(`aria-label`)),l&&this._engine?.resize(),r===`ready`&&!a&&this._visible&&this._draw()}_renderState(e,t,n,r){let i=this._parts?.state;if(!i)return;let a=!r&&e!==`ready`;i.hidden=!a,a?(i.style.height=n,e===`loading`?i.replaceChildren(CG(`div`,{class:`skeleton wui-chart-skeleton`}),CG(`span`,{class:`visually-hidden`},t)):i.replaceChildren(CG(`p`,{class:`wui-chart-state-text`},t))):i.replaceChildren()}_colour(e,t){let n=this._theme;if(!n)return;if(e.type===`donut`)return nJ(e,t,n);let r=e.series[t],i=e.type===`line`||e.type===`area`||e.type===`column`||e.type===`bar`;return n.palette[r&&i?oJ(r,t):t]}_renderLegend(e,t){let n=this._parts?.legend;if(!n)return;let r=e?Rq(e):[],i=!!e&&t&&r.length>=2;if(n.hidden=!i,!e||!i)return;let a=zq(e),o=r.map((t,n)=>this._colour(e,n)),s=JSON.stringify([e.type,r,a,o]);s!==this._legendSignature&&(this._legendSignature=s,n.replaceChildren(...r.map((t,n)=>{let r=CG(`button`,{class:`wui-chart-legend-item`});r.type=`button`,r.dataset.key=t;let i=CG(`span`,{class:e.type===`line`?`wui-chart-legend-swatch wui-chart-legend-swatch-line`:`wui-chart-legend-swatch`}),s=o[n];return s!==void 0&&(i.style.background=s),r.append(i,CG(`span`,{class:`wui-chart-legend-label`},a[n])),r})));for(let e of n.children){if(!(e instanceof HTMLElement))throw Error(`Expected a legend item to be an HTMLElement.`);let t=e.dataset.key;e.setAttribute(`aria-pressed`,String(t===void 0||!this._hidden.has(t)))}}_renderTable(e){if(this._tableSpec===e||!this._parts)return;this._tableSpec=e;let t=uJ(e),n=CG(`table`,{class:`wui-chart-table`});n.append(CG(`caption`,{class:`visually-hidden`},t.caption));let r=CG(`tr`);t.head.forEach((e,t)=>{let n=CG(`th`,t?{class:`wui-chart-num`}:null,e);n.scope=`col`,r.append(n)});let i=CG(`thead`);i.append(r),n.append(i);let a=CG(`tbody`);for(let e of t.rows){let t=CG(`tr`),n=CG(`th`,null,e.head);n.scope=`row`,t.append(n,...e.cells.map(e=>CG(`td`,{class:`wui-chart-num`},e))),a.append(t)}n.append(a);let o=[n];t.truncated&&o.push(CG(`p`,{class:`wui-chart-table-note`},MG(sX().showingFirstRowsDownloadText,{rows:t.rows.length,total:t.total}))),this._parts.tableWrap.replaceChildren(...o)}_draw(){let{spec:e}=this._normalized();if(!e||!this._parts||!this._theme)return;let t=Lq(e),n=e.type!==this._drawnType;this._engine&&this._engine.renderer!==t&&(this._engine.dispose(),this._engine=null);let r=`${e.height}px`,i=this._parts.canvas.style.height!==r;this._parts.canvas.style.height=r,i&&this._engine?.resize(),this._engine||(this._engine=tX(this._parts.canvas,{renderer:t}),this._engine.onSelect(({seriesIndex:e,dataIndex:t})=>this._select(e,t)),this._engine.onFinished(()=>{this.setAttribute(`data-ready`,``),this._announcedReady||(this._announcedReady=!0,this.dispatchEvent(new CustomEvent(uX,{bubbles:!0,detail:{renderer:t}})))}),n=!0),this._engine.render(e,this._theme,this._size(e),{hidden:this._hidden,renderer:t},{replace:n}),this._drawnType=e.type,this._drawn=!0}_themeChanged(e=!1){if(!this._parts)return;let t=SX(this);JSON.stringify(t)!==JSON.stringify(this._theme)&&(this._theme=t,this._update(),e&&this._engine?.flush())}_resized(){let e=this.clientWidth;e!==this._width&&(this._width=e,this._engine&&this._drawn&&this._parts&&(this._parts.surface.hidden||this._engine.resize(),this._update()))}_toggle(e){let{spec:t}=this._normalized();if(!t||e==null)return;this._hidden.has(e)?this._hidden.delete(e):this._hidden.add(e),this._clearFocus(),this._update();let n=Object.fromEntries(Rq(t).map(e=>[e,!this._hidden.has(e)]));this.dispatchEvent(new CustomEvent(lX,{bubbles:!0,detail:{visible:n}}))}_onKey(e){let{spec:t}=this._normalized();if(!t||!this._engine||!this._theme||this.view===`table`||e.altKey||e.ctrlKey||e.metaKey)return;if(iX(e)){if(!this._focus)return;e.preventDefault(),this._select(this._focus.series,this._focus.index);return}if(!dX.includes(e.key)||e.key===`Escape`&&!this._focus)return;e.preventDefault();let n=TJ(t,this._focus,oX(e.key,aX(this)),this._hidden);n?(this._focus=n,this._engine.focusPoint(n.series,n.index),this._announce(cJ(rJ(t,n.index,this._hidden,this._theme)))):this._clearFocus()}_announce(e){let t=this._parts?.live;t&&(t.textContent=e===t.textContent?`${e} `:e)}_clearFocus(){this._focus&&(this._focus=null,this._engine?.clearFocus(),this._parts&&(this._parts.live.textContent=``))}_select(e,t){let{spec:n}=this._normalized();if(!n)return;let r=n.series[WK(n.type)?0:e];if(!r)return;let i=n.data[t]??null;this.dispatchEvent(new CustomEvent(cX,{bubbles:!0,detail:{series:r.key,label:r.label,x:i?.[n.x.key]??null,value:Q(n,r.key,t),row:i,index:t}}))}};return r(`wui-chart`,kX),e.CHART_STATES=IK,e.CHART_TYPES=MK,e.CHART_VIEWS=LK,e.MAX_SERIES=zK,e.MAX_SLICES=BK,e.RENDERERS=FK,e.STACK_MODES=NK,e.WuiChart=kX,e.X_KINDS=PK,e.formatValue=X,e.normalizeSpec=wq,e})({});
20
+ `:``,i=` {`+r,a=r+`}`,o=I(L(e),function(t){return t+i+I(L(e[t]),function(n){return n+`:`+e[t][n]+`;`}).join(r)+a}).join(r),s=I(L(t),function(e){return`@keyframes `+e+i+I(L(t[e]),function(n){return n+i+I(L(t[e][n]),function(r){var i=t[e][n][r];return r===`d`&&(i=`path("`+i+`")`),r+`:`+i+`;`}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?``:[`<![CDATA[`,o,s,`]]>`].join(r)}function zU(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function BU(e,t,n,r){return PU(`svg`,`root`,{width:e,height:t,xmlns:OU,"xmlns:xlink":kU,version:`1.1`,baseProfile:`full`,viewBox:r?`0 0 `+e+` `+t:!1},n)}var VU=0;function HU(){return VU++}var UU={cubicIn:`0.32,0,0.67,0`,cubicOut:`0.33,1,0.68,1`,cubicInOut:`0.65,0,0.35,1`,quadraticIn:`0.11,0,0.5,0`,quadraticOut:`0.5,1,0.89,1`,quadraticInOut:`0.45,0,0.55,1`,quarticIn:`0.5,0,0.75,0`,quarticOut:`0.25,1,0.5,1`,quarticInOut:`0.76,0,0.24,1`,quinticIn:`0.64,0,0.78,0`,quinticOut:`0.22,1,0.36,1`,quinticInOut:`0.83,0,0.17,1`,sinusoidalIn:`0.12,0,0.39,0`,sinusoidalOut:`0.61,1,0.88,1`,sinusoidalInOut:`0.37,0,0.63,1`,exponentialIn:`0.7,0,0.84,0`,exponentialOut:`0.16,1,0.3,1`,exponentialInOut:`0.87,0,0.13,1`,circularIn:`0.55,0,1,0.45`,circularOut:`0,0.55,0.45,1`,circularInOut:`0.85,0,0.15,1`},WU=`transform-origin`;function GU(e,t,n){var r=A({},e.shape);A(r,t),e.buildPath(n,r);var i=new bU;return i.reset(_i(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function KU(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[WU]=n+`px `+r+`px`)}var qU={fill:`fill`,opacity:`opacity`,lineWidth:`stroke-width`,lineDashOffset:`stroke-dashoffset`};function JU(e,t){var n=t.zrId+`-ani-`+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function YU(e,t,n){var r=e.shape.paths,i={},a,o;if(F(r,function(e){var t=zU(n.zrId);t.animation=!0,ZU(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,c=L(r),l=c.length;if(l){o=c[l-1];var u=r[o];for(var d in u){var f=u[d];i[d]=i[d]||{d:``},i[d].d+=f.d||``}for(var p in s){var m=s[p].animation;m.indexOf(o)>=0&&(a=m)}}}),a){t.d=!1;var s=JU(i,n);return a.replace(o,s)}}function XU(e){return H(e)?UU[e]?`cubic-bezier(`+UU[e]+`)`:Er(e)?e:``:``}function ZU(e,t,n,r){var i=e.animators,a=i.length,o=[];if(e instanceof Dd){var s=YU(e,t,n);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var c={},l=0;l<a;l++){var u=i[l],d=[u.getMaxTime()/1e3+`s`],f=XU(u.getClip().easing),p=u.getDelay();f?d.push(f):d.push(`linear`),p&&d.push(p/1e3+`s`),u.getLoop()&&d.push(`infinite`);var m=d.join(` `);c[m]=c[m]||[m,[]],c[m][1].push(u)}function h(i){var a=i[1],o=a.length,s={},c={},l={},u=`animation-timing-function`;function d(e,t,n){for(var r=e.getTracks(),i=e.getMaxTime(),a=0;a<r.length;a++){var o=r[a];if(o.needsAnimate()){var s=o.keyframes,c=o.propName;if(n&&(c=n(c)),c)for(var l=0;l<s.length;l++){var d=s[l],f=Math.round(d.time/i*100)+`%`,p=XU(d.easing),m=d.rawValue;(H(m)||se(m))&&(t[f]=t[f]||{},t[f][c]=d.rawValue,p&&(t[f][u]=p))}}}}for(var f=0;f<o;f++){var p=a[f],m=p.targetName;m?m===`shape`&&d(p,c):!r&&d(p,s)}for(var h in s){var g={};Qn(g,e),A(g,s[h]);var _=vi(g),v=s[h][u];l[h]=_?{transform:_}:{},KU(l[h],g),v&&(l[h][u]=v)}var y,b=!0;for(var h in c){l[h]=l[h]||{};var x=!y,v=c[h][u];x&&(y=new eo);var S=y.len();y.reset(),l[h].d=GU(e,c[h],y);var C=y.len();if(!x&&S!==C){b=!1;break}v&&(l[h][u]=v)}if(!b)for(var h in l)delete l[h].d;if(!r)for(var f=0;f<o;f++){var p=a[f],m=p.targetName;m===`style`&&d(p,l,function(e){return qU[e]})}for(var w=L(l),T=!0,E,f=1;f<w.length;f++){var D=w[f-1],O=w[f];if(l[D][WU]!==l[O][WU]){T=!1;break}E=l[D][WU]}if(T&&E){for(var h in l)l[h][WU]&&delete l[h][WU];t[WU]=E}if(re(w,function(e){return L(l[e]).length>0}).length)return JU(l,n)+` `+i[0]+` both`}for(var g in c){var s=h(c[g]);s&&o.push(s)}if(o.length){var _=n.zrId+`-cls-`+HU();n.cssNodes[`.`+_]={animation:o.join(`,`)},t.class=_}}function QU(e,t,n){if(!e.ignore){if(e.isSilent()){var r={"pointer-events":`none`};$U(r,t,n,!0)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,c=e.currentStates.indexOf(`select`)>=0&&s||o;c&&(a=Qr(c))}var l=i.lineWidth;if(l){var u=!i.strokeNoScale&&e.transform?e.transform[0]:1;l/=u}var r={cursor:`pointer`};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),l&&(r[`stroke-width`]=l),$U(r,t,n,!0)}}}function $U(e,t,n,r){var i=JSON.stringify(e),a=n.cssStyleCache[i];a||(a=n.zrId+`-cls-`+HU(),n.cssStyleCache[i]=a,n.cssNodes[`.`+a+(r?`:hover`:``)]=e),t.class=t.class?t.class+` `+a:a}var eW=Math.round;function tW(e){return e&&H(e.src)}function nW(e){return e&&V(e.toDataURL)}function rW(e,t,n,r){DU(function(i,a){var o=i===`fill`||i===`stroke`;o&&hi(a)?vW(t,e,i,r):o&&fi(a)?yW(n,e,i,r):e[i]=a,o&&r.ssr&&a===`none`&&(e[`pointer-events`]=`visible`)},t,n,!1),_W(n,e,r)}function iW(e,t){var n=bD(t);n&&(n.each(function(t,n){t!=null&&(e[(`ecmeta_`+n).toLowerCase()]=t+``)}),t.isSilent()&&(e[MU+`silent`]=`true`))}function aW(e){return ni(e[0]-1)&&ni(e[1])&&ni(e[2])&&ni(e[3]-1)}function oW(e){return ni(e[4])&&ni(e[5])}function sW(e,t,n){if(t&&!(oW(t)&&aW(t))){var r=n?10:1e4;e.transform=aW(t)?`translate(`+eW(t[4]*r)/r+` `+eW(t[5]*r)/r+`)`:ai(t)}}function cW(e,t,n){for(var r=e.points,i=[],a=0;a<r.length;a++)i.push(eW(r[a][0]*n)/n),i.push(eW(r[a][1]*n)/n);t.points=i.join(` `)}function lW(e){return!e.smooth}function uW(e){var t=I(e,function(e){return typeof e==`string`?[e,e]:e});return function(e,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=e[a[0]];o!=null&&(n[a[1]]=eW(o*r)/r)}}}var dW={circle:[uW([`cx`,`cy`,`r`])],polyline:[cW,lW],polygon:[cW,lW]};function fW(e){for(var t=e.animators,n=0;n<t.length;n++)if(t[n].targetName===`shape`)return!0;return!1}function pW(e,t){var n=e.style,r=e.shape,i=dW[e.type],a={},o=t.animation,s=`path`,c=e.style.strokePercent,l=t.compress&&_i(e)||4;if(i&&!t.willUpdate&&(!i[1]||i[1](r))&&!(o&&fW(e))&&!(c<1)){s=e.type;var u=10**l;i[0](r,a,u)}else{var d=!e.path||e.shapeChanged();e.path||e.createPathProxy();var f=e.path;d&&(f.beginPath(),e.buildPath(f,e.shape),e.pathUpdated());var p=f.getVersion(),m=e,h=m.__svgPathBuilder;m.__svgPathVersion===p&&h&&c===m.__svgPathStrokePercent||(h||=m.__svgPathBuilder=new bU,h.reset(l),f.rebuildPath(h,c),h.generateStr(),m.__svgPathVersion=p,m.__svgPathStrokePercent=c),a.d=h.getStr()}return sW(a,e.transform),rW(a,n,e,t),iW(a,e),t.animation&&ZU(e,a,t),t.emphasis&&QU(e,a,t),PU(s,e.id+``,a)}function mW(e,t){var n=e.style,r=n.image;if(r&&!H(r)&&(tW(r)?r=r.src:nW(r)&&(r=r.toDataURL())),r){var i=n.x||0,a=n.y||0,o=n.width,s=n.height,c={href:r,width:o,height:s};return i&&(c.x=i),a&&(c.y=a),sW(c,e.transform),rW(c,n,e,t),iW(c,e),t.animation&&ZU(e,c,t),PU(`image`,e.id+``,c)}}function hW(e,t){var n=e.style,r=n.text;if(r!=null&&(r+=``),!(!r||isNaN(n.x)||isNaN(n.y))){var i=n.font||`12px sans-serif`,a=n.x||0,o=si(n.y||0,gn(i),n.textBaseline),s={"dominant-baseline":`central`,"text-anchor":oi[n.textAlign]||n.textAlign};if(Zo(n)){var c=``,l=n.fontStyle,u=Yo(n.fontSize);if(!parseFloat(u))return;var d=n.fontFamily||`sans-serif`,f=n.fontWeight;c+=`font-size:`+u+`;font-family:`+d+`;`,l&&l!==`normal`&&(c+=`font-style:`+l+`;`),f&&f!==`normal`&&(c+=`font-weight:`+f+`;`),s.style=c}else s.style=`font: `+i;return r.match(/\s/)&&(s[`xml:space`]=`preserve`),a&&(s.x=a),o&&(s.y=o),sW(s,e.transform),rW(s,n,e,t),iW(s,e),t.animation&&ZU(e,s,t),PU(`text`,e.id+``,s,void 0,r)}}function gW(e,t){if(e instanceof Eo)return pW(e,t);if(e instanceof Mo)return mW(e,t);if(e instanceof Oo)return hW(e,t)}function _W(e,t,n){var r=e.style;if(ci(r)){var i=li(e),a=n.shadowCache,o=a[i];if(!o){var s=e.getGlobalScale(),c=s[0],l=s[1];if(!c||!l)return;var u=r.shadowOffsetX||0,d=r.shadowOffsetY||0,f=r.shadowBlur,p=ei(r.shadowColor),m=p.opacity,h=p.color,g=f/2/c,_=f/2/l,v=g+` `+_;o=n.zrId+`-s`+n.shadowIdx++,n.defs[o]=PU(`filter`,o,{id:o,x:`-100%`,y:`-100%`,width:`300%`,height:`300%`},[PU(`feDropShadow`,``,{dx:u/c,dy:d/l,stdDeviation:v,"flood-color":h,"flood-opacity":m})]),a[i]=o}t.filter=gi(o)}}function vW(e,t,n,r){var i=e[n],a,o={gradientUnits:i.global?`userSpaceOnUse`:`objectBoundingBox`};if(pi(i))a=`linearGradient`,o.x1=i.x,o.y1=i.y,o.x2=i.x2,o.y2=i.y2;else if(mi(i))a=`radialGradient`,o.cx=W(i.x,.5),o.cy=W(i.y,.5),o.r=W(i.r,.5);else return;for(var s=i.colorStops,c=[],l=0,u=s.length;l<u;++l){var d=ii(s[l].offset)*100+`%`,f=s[l].color,p=ei(f),m=p.color,h=p.opacity,g={offset:d};g[`stop-color`]=m,h<1&&(g[`stop-opacity`]=h),c.push(PU(`stop`,l+``,g))}var _=LU(PU(a,``,o,c)),v=r.gradientCache,y=v[_];y||(y=r.zrId+`-g`+r.gradientIdx++,v[_]=y,o.id=y,r.defs[y]=PU(a,y,o,c)),t[n]=gi(y)}function yW(e,t,n,r){var i=e.style[n],a=e.getBoundingRect(),o={},s=i.repeat,c=s===`no-repeat`,l=s===`repeat-x`,u=s===`repeat-y`,d;if(ui(i)){var f=i.imageWidth,p=i.imageHeight,m=void 0,h=i.image;if(H(h)?m=h:tW(h)?m=h.src:nW(h)&&(m=h.toDataURL()),typeof Image>`u`){var g=`Image width/height must been given explictly in svg-ssr renderer.`;ve(f,g),ve(p,g)}else if(f==null||p==null){var _=function(e,t){if(e){var n=e.elm,r=f||t.width,i=p||t.height;e.tag===`pattern`&&(l?(i=1,r/=a.width):u&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute(`width`,r),n.setAttribute(`height`,i))}},v=it(m,null,e,function(e){c||_(S,e),_(d,e)});v&&v.width&&v.height&&(f||=v.width,p||=v.height)}d=PU(`image`,`img`,{href:m,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=O(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var y,b;c?y=b=1:l?(b=1,y=o.width/a.width):u?(y=1,b=o.height/a.height):o.patternUnits=`userSpaceOnUse`,y!=null&&!isNaN(y)&&(o.width=y),b!=null&&!isNaN(b)&&(o.height=b);var x=vi(i);x&&(o.patternTransform=x);var S=PU(`pattern`,``,o,[d]),C=LU(S),w=r.patternCache,T=w[C];T||(T=r.zrId+`-p`+r.patternIdx++,w[C]=T,o.id=T,S=r.defs[T]=PU(`pattern`,T,o,[d])),t[n]=gi(T)}}function bW(e,t,n){var r=n.clipPathCache,i=n.defs,a=r[e.id];if(!a){a=n.zrId+`-c`+n.clipPathIdx++;var o={id:a};r[e.id]=a,i[a]=PU(`clipPath`,a,o,[pW(e,n)])}t[`clip-path`]=gi(a)}function xW(e){return document.createTextNode(e)}function SW(e,t,n){e.insertBefore(t,n)}function CW(e,t){e.removeChild(t)}function wW(e,t){e.appendChild(t)}function TW(e){return e.parentNode}function EW(e){return e.nextSibling}function DW(e,t){e.textContent=t}var OW=58,kW=120,AW=PU(``,``);function jW(e){return e===void 0}function MW(e){return e!==void 0}function NW(e,t,n){for(var r={},i=t;i<=n;++i){var a=e[i].key;a!==void 0&&(r[a]=i)}return r}function PW(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function FW(e){var t,n=e.children,r=e.tag;if(MW(r)){var i=e.elm=NU(r);if(RW(AW,e),B(n))for(t=0;t<n.length;++t){var a=n[t];a!=null&&wW(i,FW(a))}else MW(e.text)&&!U(e.text)&&wW(i,xW(e.text))}else e.elm=xW(e.text);return e.elm}function IW(e,t,n,r,i){for(;r<=i;++r){var a=n[r];a!=null&&SW(e,FW(a),t)}}function LW(e,t,n,r){for(;n<=r;++n){var i=t[n];i!=null&&(MW(i.tag)?CW(TW(i.elm),i.elm):CW(e,i.elm))}}function RW(e,t){var n,r=t.elm,i=e&&e.attrs||{},a=t.attrs||{};if(i!==a){for(n in a){var o=a[n];i[n]!==o&&(o===!0?r.setAttribute(n,``):o===!1?r.removeAttribute(n):n===`style`?r.style.cssText=o:n.charCodeAt(0)===kW?n===`xmlns:xlink`||n===`xmlns`?r.setAttributeNS(AU,n,o):n.charCodeAt(3)===OW?r.setAttributeNS(jU,n,o):n.charCodeAt(5)===OW?r.setAttributeNS(kU,n,o):r.setAttribute(n,o):r.setAttribute(n,o))}for(n in i)n in a||r.removeAttribute(n)}}function zW(e,t,n){for(var r=0,i=0,a=t.length-1,o=t[0],s=t[a],c=n.length-1,l=n[0],u=n[c],d,f,p,m;r<=a&&i<=c;)o==null?o=t[++r]:s==null?s=t[--a]:l==null?l=n[++i]:u==null?u=n[--c]:PW(o,l)?(BW(o,l),o=t[++r],l=n[++i]):PW(s,u)?(BW(s,u),s=t[--a],u=n[--c]):PW(o,u)?(BW(o,u),SW(e,o.elm,EW(s.elm)),o=t[++r],u=n[--c]):PW(s,l)?(BW(s,l),SW(e,s.elm,o.elm),s=t[--a],l=n[++i]):(jW(d)&&(d=NW(t,r,a)),f=d[l.key],jW(f)?SW(e,FW(l),o.elm):(p=t[f],p.tag===l.tag?(BW(p,l),t[f]=void 0,SW(e,p.elm,o.elm)):SW(e,FW(l),o.elm)),l=n[++i]);(r<=a||i<=c)&&(r>a?(m=n[c+1]==null?null:n[c+1].elm,IW(e,m,n,i,c)):LW(e,t,r,a))}function BW(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(RW(e,t),jW(t.text)?MW(r)&&MW(i)?r!==i&&zW(n,r,i):MW(i)?(MW(e.text)&&DW(n,``),IW(n,null,i,0,i.length-1)):MW(r)?LW(n,r,0,r.length-1):MW(e.text)&&DW(n,``):e.text!==t.text&&(MW(r)&&LW(n,r,0,r.length-1),DW(n,t.text)))}function VW(e,t){if(PW(e,t))BW(e,t);else{var n=e.elm,r=TW(n);FW(t),r!==null&&(SW(r,t.elm,EW(n)),LW(r,[e],0,0))}return t}var HW=0,UW=function(){function e(e,t,n){if(this.type=`svg`,this.configLayer=WW(`configLayer`),this.storage=t,this._opts=n=A({},n),this.root=e,this._id=`zr`+HW++,this._oldVNode=BU(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden`;var i=this._svgDom=this._oldVNode.elm=NU(`svg`);RW(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style=`position:absolute;left:0;top:0;user-select:none`,VW(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return gW(e,zU(this._id))},e.prototype.renderToVNode=function(e){e||={};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=zU(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var a=[],o=this._bgVNode=GW(n,r,this._backgroundColor,i);o&&a.push(o);var s=e.compress?null:this._mainVNode=PU(`g`,`main`,{},[]);this._paintList(t,i,s?s.children:a),s&&a.push(s);var c=I(L(i.defs),function(e){return i.defs[e]});if(c.length&&a.push(PU(`defs`,`defs`,{},c)),e.animation){var l=RU(i.cssNodes,i.cssAnims,{newline:!0});if(l){var u=PU(`style`,`stl`,{},[],l);a.push(u)}}return BU(n,r,a,e.useViewBox)},e.prototype.renderToString=function(e){return e||={},LU(this.renderToVNode({animation:W(e.cssAnimation,!0),emphasis:W(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:W(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r=e.length,i=[],a=0,o,s,c=0,l=0;l<r;l++){var u=e[l];if(!u.invisible){var d=u.__clipPaths,f=d&&d.length||0,p=s&&s.length||0,m=void 0;for(m=Math.max(f-1,p-1);m>=0&&!(d&&s&&d[m]===s[m]);m--);for(var h=p-1;h>m;h--)a--,o=i[a-1];for(var g=m+1;g<f;g++){var _={};bW(d[g],_,t);var v=PU(`g`,`clip-g-`+c++,_,[]);(o?o.children:n).push(v),i[a++]=v,o=v}s=d;var y=gW(u,t);y&&(o?o.children:n).push(y)}}},e.prototype.resize=function(e,t){var n=this._opts,r=this.root,i=this._viewport;if(e!=null&&(n.width=e),t!=null&&(n.height=t),r&&i&&(i.style.display=`none`,e=bk(r,0,n),t=bk(r,1,n),i.style.display=``),this._width!==e||this._height!==t){if(this._width=e,this._height=t,i){var a=i.style;a.width=e+`px`,a.height=t+`px`}if(fi(this._backgroundColor))this.refresh();else{var o=this._svgDom;o&&(o.setAttribute(`width`,e),o.setAttribute(`height`,t));var s=this._bgVNode&&this._bgVNode.elm;s&&(s.setAttribute(`width`,e),s.setAttribute(`height`,t))}}},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.dispose=function(){this.root&&(this.root.innerHTML=``),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},e.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},e.prototype.toDataURL=function(e){var t=this.renderToString(),n=`data:image/svg+xml;`;return e?(t=yi(t),t&&n+`base64,`+t):n+`charset=UTF-8,`+encodeURIComponent(t)},e}();function WW(e){return function(){}}function GW(e,t,n,r){var i;if(n&&n!==`none`){if(i=PU(`rect`,`bg`,{width:e,height:t,x:`0`,y:`0`}),hi(n))vW({fill:n},i.attrs,`fill`,r);else if(fi(n))yW({style:{fill:n},dirty:je,getBoundingRect:function(){return{width:e,height:t}}},i.attrs,`fill`,r);else{var a=ei(n),o=a.color,s=a.opacity;i.attrs.fill=o,s<1&&(i.attrs[`fill-opacity`]=s)}}return i}function KW(e){e.registerPainter(`svg`,UW)}function qW(e,t,n){var r=f.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}function JW(e){return!e.__cursors.get(0)}function YW(e){var t=e.__cursors.get(0);return{startIdx:t?t.startIdx:0,endIdx:t?t.endIdx:0}}var XW=function(e){a(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.zlevel=0,i.zlevel2=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__prevIdx={startIdx:0,endIdx:0};var a;r||=Gi,typeof t==`string`?a=qW(t,n,r):U(t)&&(a=t,t=a.id),i.id=t,i.dom=a;var o=a.style;return o&&(ke(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.afterBrush=function(){this.__prevIdx=YW(this)},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=qW(`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 K(0,0,0,0);function c(e){if(e.isFinite()&&!e.isZero()){if(i.length===0){var t=new K(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 K(0,0,0,0);d.copy(u),d.union(e),i[l]=d,n=!0;break}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 K(0,0,0,0);t.copy(e),i.push(t)}o||=i.length>=a}}}for(var l=YW(this),u=l.startIdx;u<l.endIdx;++u){var d=e[u];if(d){var f=d.shouldBePainted(n,r,!0,!0),p=d.__isRendered&&(d.__dirty&1||!f)?d.getPrevPaintRect():null;p&&c(p);var m=f&&(d.__dirty&1||!d.__isRendered)?d.getPaintRect():null;m&&c(m)}}for(var h=this.__prevIdx,u=h.startIdx;u<h.endIdx;++u){var d=t[u],f=d&&d.shouldBePainted(n,r,!0,!0);if(d&&(!f||!d.__zr)&&d.__isRendered){var p=d.getPrevPaintRect();p&&c(p)}}var g;do{g=!1;for(var u=0;u<i.length;)if(i[u].isZero())i.splice(u,1);else{for(var _=u+1;_<i.length;)i[u].intersect(i[_])?(g=!0,i[u].union(i[_]),i.splice(_,1)):_++;u++}}while(g);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;de(t)?(o=(t.global||t.__width===r&&t.__height===a)&&t.__canvasGradient||_k(i,t,{x:0,y:0,width:r,height:a}),t.__canvasGradient=o,t.__width=r,t.__height=a):fe(t)&&(t.scaleX=t.scaleX||l,t.scaleY=t.scaleY||l,o=kk(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&&F(n,function(e){f(e.x*l,e.y*l,e.width*l,e.height*l)})},t}(Ui),ZW=1e5,QW=314159,$W=void 0,eG=1,tG=2;function nG(e){return e?e.__builtin__?!0:typeof e.resize==`function`&&typeof e.refresh==`function`:!1}function rG(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}function iG(e,t,n,r){var i=new XW(e,t,t.dpr);return i.zlevel=n,i.zlevel2=r,i.__builtin__=!0,aG(i),i}function aG(e){e.__cursorStack=[],e.__cursors=G()}function oG(e){return e.startIdx=e.drawIdx=e.endIdx=e.endIdxNew=0,e.used=!1,e.first=e.last=NaN,e.notClearIdx=-1,e}function sG(e,t){var n=e.__cursors,r=+t;return n.get(r)||(e.__cursorStack.push(r),n.set(r,oG({key:r})))}function cG(e,t){for(var n=e.__cursorStack,r=0;r<n.length;r++)t(e.__cursors.get(n[r]))}function lG(e,t){var n=e.layers;return n[t]||(n[t]=[,,,])}function uG(e,t,n){for(var r=e.layerStack,i=0;i<r.length;i++){var a=r[i].zl,o=r[i].zl2,s=e.layers[a][o];n&&(n&dG&&!s.__builtin__||n&fG&&s.__builtin__||n&pG&&s===e.hoverlayer)||t(s,a,o,i)}}var dG=1,fG=2,pG=4,mG=dG|pG,hG=function(){function e(e,t,n,r){this.type=`canvas`,this._prevDisplayList=[],this._layerConfig={},this._needsManuallyCompositing=!1,this.type=`canvas`,this._i={layerStack:[],layers:[]};var i=!e.nodeName||e.nodeName.toUpperCase()===`CANVAS`;if(this._opts=n=A({},n||{}),this.dpr=n.devicePixelRatio||Gi,this._singleCanvas=i,this.root=e,e.style&&(ke(e),e.innerHTML=``),this.storage=t,this._prevDisplayList=[],i){var a=e,o=a.width,s=a.height;n.width!=null&&(o=n.width),n.height!=null&&(s=n.height),this.dpr=n.devicePixelRatio||1,a.width=o*this.dpr,a.height=s*this.dpr,this._width=o,this._height=s;var c=iG(a,this,QW,0);c.initContext(),this._insertLayer(c,QW,0,!0),this._domRoot=e}else{this._width=bk(e,0,n),this._height=bk(e,1,n);var l=this._domRoot=rG(this._width,this._height);e.appendChild(l)}}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=e&&!U(e)?{paintAll:!!e}:e||{},n=W(t.refresh,!0),r=W(t.refreshHover,!1);if(r&&(this._hoverLayerDirty=tG),!n)return r&&this._paintHoverList(this.storage.getDisplayList(!1)),this;var i=this.storage.getDisplayList(!0);this._updateLayerStatus(i,t.paintAll),this._redrawId=Math.random();var a=this._prevDisplayList;this._paintList(i,a,this._redrawId);var o=this._backgroundColor;return uG(this._i,function(e,t,n,r){e.refresh&&e.refresh(r===0?o:null)},fG),this._opts.useDirtyRect&&(this._prevDisplayList=i.slice()),this},e.prototype._paintHoverList=function(e){var t=this._i.hoverlayer,n=this._hoverLayerDirty;if(this._hoverLayerDirty=$W,n!==$W&&(!t&&n===tG&&(t=this._i.hoverlayer=this._ensureLayer(ZW)),t)){t.clear();for(var r={inHover:!0,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},i,a=0,o=e.length;a<o;a++){var s=e[a];if(s.__inHover){i||(i=t.ctx,i.save());var c=s.__hoverStyle,l=void 0;c&&(l=s.style,s.style=c),Jk(i,s,r),c&&(s.style=l)}}i&&(Yk(i,r),i.restore())}},e.prototype.getHoverLayer=function(){return this._ensureLayer(ZW)},e.prototype.paintOne=function(e,t){qk(e,t)},e.prototype._paintList=function(e,t,n){if(this._redrawId===n){var r=this._doPaintList(e,t);if(this._needsManuallyCompositing&&this._compositeManually(),r)uG(this._i,function(e){e.afterBrush&&e.afterBrush()},mG),this._paintHoverList(e);else{var i=this;WE(function(){i._paintList(e,t,n)})}}},e.prototype._compositeManually=function(){var e=this._ensureLayer(QW).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),uG(this._i,function(r){r.virtual&&e.drawImage(r.dom,0,0,t,n)},dG)},e.prototype._doPaintList=function(e,t){var n=this,r=!0;return uG(this._i,function(i){var a=!1;if(cG(i,function(e){(e.drawIdx<e.endIdx||e.notClearIdx>=0)&&(a=!0)}),a||i.__dirty){var o=n._opts.useDirtyRect&&!JW(i)?i.createRepaintRects(e,t,n._width,n._height):null,s=n._i.layerStack[0],c=!0;if(i.__dirty){c=!1,i.__dirty=!1;var l=i.zlevel===s.zl&&i.zlevel2===s.zl2?n._backgroundColor:null;i.clear(!1,l,o)}cG(i,function(t){var a=n._paintPerCursor(i,t,e,o,c);r&&=a})}},mG),Pe.wxa&&uG(this._i,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),r},e.prototype._paintPerCursor=function(e,t,n,r,i){var a=e.ctx;if(r){if(!r.length)t.drawIdx=t.endIdx;else for(var o=this.dpr,s=0;s<r.length;++s){var c=r[s];a.save(),a.beginPath(),a.rect(c.x*o,c.y*o,c.width*o,c.height*o),a.clip(),this._paintPerCursorInRect(e,t,n,c,i),a.restore()}}else a.save(),this._paintPerCursorInRect(e,t,n,null,i),a.restore();return t.drawIdx>=t.endIdx},e.prototype._paintPerCursorInRect=function(e,t,n,r,i){for(var a={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:i}},o=e.ctx,s=JW(e),c=s&&f.getTime(),l=t.drawIdx,u=t.notClearIdx,d=u>=0?Math.min(u,l):l;d<t.endIdx;d++){var p=n[d];if(!(d<l&&!p.notClear)){if(p.__inHover&&(this._hoverLayerDirty=tG),r!=null){var m=p.getPaintRect();m&&m.intersect(r)&&(Jk(o,p,a),p.setPrevPaintRect(m))}else Jk(o,p,a);if(s&&f.getTime()-c>15){d++;break}}}Yk(o,a),t.drawIdx=Math.max(d,l)},e.prototype.getLayer=function(e,t){return this._ensureLayer(e,0,t)},e.prototype._ensureLayer=function(e,t,n){t||=0;var r=this._singleCanvas;r&&!this._needsManuallyCompositing&&(e=QW,t=0);var i=lG(this._i,e)[t];return i||(i=iG(`zr_`+e+`.`+t,this,e,t),this._layerConfig[e]&&k(i,this._layerConfig[e],!0),(n||r&&e!==QW)&&(i.virtual=!0),this._insertLayer(i,e,t,!1),i.initContext()),i},e.prototype.insertLayer=function(e,t){this._insertLayer(t,e,0,!1)},e.prototype._insertLayer=function(e,t,n,r){var i=this._i,a=i.layers,o=i.layerStack,s=this._domRoot,c=null;if(!(a[t]&&a[t][n])&&nG(e)){for(var l=o.length,u=0;u<l&&(o[u].zl<t||o[u].zl===t&&o[u].zl2<n);)u++;if(u>0&&(c=lG(i,o[u-1].zl)[o[u-1].zl2]),o.splice(u,0,{zl:t,zl2:n}),lG(i,t)[n]=e,!r&&!e.virtual){if(c){var d=c.dom;d.nextSibling?s.insertBefore(e.dom,d.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}e.painter||=this}},e.prototype.eachLayer=function(e,t){return uG(this._i,function(n,r){e.call(t,n,r)})},e.prototype.eachBuiltinLayer=function(e,t){return uG(this._i,function(n,r){e.call(t,n,r)},dG)},e.prototype.eachOtherLayer=function(e,t){return uG(this._i,function(n,r){e.call(t,n,r)},fG)},e.prototype.getLayers=function(){var e={};return uG(this._i,function(t,n,r){e[t.id]=t}),e},e.prototype._updateLayerStatus=function(e,t){var n=this;if(n._singleCanvas)for(var r=1;r<e.length;r++){var i=e[r];if(i.zlevel!==e[r-1].zlevel||i.incremental){n._needsManuallyCompositing=!0;break}}uG(n._i,function(e){e.__dirty=!1,cG(e,function(e){e.used=!1,e.endIdxNew=0,e.notClearIdx=-1})},mG);for(var a,o=null,s=null,c=!1,l=0,u=e.length;l<u;l++){var i=e[l],d=i.zlevel,f=i.incremental,p=void 0;if(a!==d&&(a=d,c=!1),f?(c=!0,p=1):p=c?2:0,(!o||d!==o.zlevel||p!==o.zlevel2)&&(o=n._ensureLayer(d,p),s=null,!o.__builtin__))D(`ZLevel `+d+` has been used by unknown layer `+o.id);else{if((!s||f!==s.key)&&(s=sG(o,f),!s.used)){if(s.used=!0,!t&&s.first===i.id){var m=l-s.startIdx;s.startIdx=l,s.drawIdx+=m,s.endIdx+=m}else o.__dirty=!0,s.first=i.id,s.startIdx=s.drawIdx=l,s.endIdx=l+1}s.endIdxNew=l+1,i.__dirty&1&&!i.__inHover&&((!f||!i.notClear&&l<s.drawIdx)&&(o.__dirty=!0),f&&i.notClear&&s.notClearIdx<0&&(s.notClearIdx=l))}}uG(n._i,function(t){for(var r=t.__cursorStack,i=t.__cursors,a=r.length-1;a>=0;a--){var o=i.get(r[a]);if(!o.used)t.__dirty=!0,i.removeKey(r[a]),r.splice(a,1);else{var s=o.endIdxNew;(JW(t)?s<o.drawIdx:s!==o.endIdx||!s||e[s-1].id!==o.last)&&(t.__dirty=!0),o.endIdx=o.endIdxNew,o.last=s?e[s-1].id:NaN}}t.__dirty&&(cG(t,function(e){e.drawIdx=e.startIdx}),n._hoverLayerDirty===$W&&(n._hoverLayerDirty=eG))},mG)},e.prototype.clear=function(){return uG(this._i,function(e){e.clear(),aG(e)},dG),this},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,uG(this._i,function(e){e.setUnpainted()})},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?k(n[e],t,!0):n[e]=t,uG(this._i,function(e,t){k(e,n[t],!0)})}},e.prototype.delLayer=function(e){for(var t=this._i.layerStack,n=this._i.layers,r=t.length-1;r>=0;r--){var i=t[r];if(i.zl===e){var a=n[e][i.zl2];if(a.__builtin__)continue;if(t.splice(r,1),n[e][i.zl2]=void 0,!a.virtual){var o=a.dom.parentNode;o&&o.removeChild(a.dom)}}}},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;e!=null&&(r.width=e),t!=null&&(r.height=t),e=bk(i,0,r),t=bk(i,1,r),n.style.display=``,(this._width!==e||t!==this._height)&&(n.style.width=e+`px`,n.style.height=t+`px`,uG(this._i,function(n){n.resize(e,t)}),this.refresh({paintAll:!0})),this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this._ensureLayer(QW).resize(e,t)}return this},e.prototype.clearLayer=function(e){F(this._i.layers[e],function(e){e&&!e.__builtin__&&e.clear()})},e.prototype.dispose=function(){this.root.innerHTML=``,this.root=this.storage=this._domRoot=this._i=null},e.prototype.getRenderedCanvas=function(e){if(e||={},this._singleCanvas&&!this._compositeManually)return this._i.layers[QW][0].dom;var t=new XW(`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;uG(this._i,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,beforeBrushParam:{}},o=this.storage.getDisplayList(!0),s=0,c=o.length;s<c;s++){var l=o[s];Jk(n,l,a)}Yk(n,a)}return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}();function gG(e){e.registerPainter(`canvas`,hG)}var _G=Object.freeze({INR:`₹`,USD:`$`,EUR:`€`,GBP:`£`,JPY:`¥`}),vG=e=>typeof e==`string`&&/^[A-Z]{3}$/.test(e),yG=(e=`INR`)=>_G[e]??`${e} `;function bG(e,...t){console.warn(e,...t)}function xG(e,...t){console.error(e,...t)}function SG(e,t){if(e==null)throw Error(t);return e}function CG(e,t,...n){if(e.toLowerCase()===`svg`)throw Error(`make() builds HTML elements; use svgRoot for svg`);let r=document.createElement(e);for(let[e,n]of Object.entries(t??{}))n===!0?r.setAttribute(e,``):(typeof n==`string`||typeof n==`number`)&&r.setAttribute(e,String(n));let i=[];for(let e of n)e instanceof Node?i.push(e):(typeof e==`string`||typeof e==`number`)&&i.push(document.createTextNode(String(e)));return r.append(...i),r}var wG=`en-IN`,TG=/\{([A-Za-z0-9_]+)\}/g,EG=(e,t)=>Object.getOwnPropertyDescriptor(e,t)!==void 0,DG,OG=new Map,kG=0,AG=new Map;function jG(e,t){let n=OG.get(e);if(n===void 0)return t;let r=AG.get(e);if(r!==void 0&&r.version===kG&&r.english===t&&IG(r.merged,t))return r.merged;let i=FG(e,n,t);return AG.set(e,{version:kG,english:t,merged:i}),i}function MG(){return DG??wG}function NG(e,t){return e.replace(TG,(e,n)=>EG(t,n)?String(t[n]):e)}function PG(e,t,n,r){let i=`${t}Other`;if(!EG(e,i))throw RangeError(`Plural text ${t} has no ${i} key; every plural needs its Other form.`);let a=new Intl.PluralRules(MG()).select(n),o=`${t}${a.charAt(0).toUpperCase()}${a.slice(1)}`,s=e[EG(e,o)?o:i];if(s===void 0)throw RangeError(`Plural text ${t} has no ${o} key.`);return NG(s,{count:n,...r})}function FG(e,t,n){let r={};for(let[i,a]of Object.entries(t)){let t=EG(n,i)?n[i]:void 0;if(t===void 0)throw RangeError(`Text ${e}.${i} is not a key of the English text. Allowed keys: ${Object.keys(n).join(`, `)}.`);let o=LG(t);for(let t of LG(a))if(!o.includes(t))throw RangeError(`Text ${e}.${i} uses {${t}}, which the English text does not have. Allowed placeholders: ${o.length===0?`none`:o.map(e=>`{${e}}`).join(`, `)}.`);r[i]=a}return Object.assign({},n,r)}function IG(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(t=>EG(e,t))}function LG(e){return Array.from(e.matchAll(TG),e=>e[1]??``)}var RG={aprShortLabel:`Apr`,aprilLabel:`April`,augShortLabel:`Aug`,augustLabel:`August`,decShortLabel:`Dec`,decemberLabel:`December`,emptyValueLabel:`-`,febShortLabel:`Feb`,februaryLabel:`February`,friMinLabel:`Fr`,friShortLabel:`Fri`,fridayLabel:`Friday`,janShortLabel:`Jan`,januaryLabel:`January`,julShortLabel:`Jul`,julyLabel:`July`,junShortLabel:`Jun`,juneLabel:`June`,marShortLabel:`Mar`,marchLabel:`March`,mayLabel:`May`,mayShortLabel:`May`,monMinLabel:`Mo`,monShortLabel:`Mon`,mondayLabel:`Monday`,novShortLabel:`Nov`,novemberLabel:`November`,octShortLabel:`Oct`,octoberLabel:`October`,satMinLabel:`Sa`,satShortLabel:`Sat`,saturdayLabel:`Saturday`,sepShortLabel:`Sep`,septemberLabel:`September`,sunMinLabel:`Su`,sunShortLabel:`Sun`,sundayLabel:`Sunday`,thuMinLabel:`Th`,thuShortLabel:`Thu`,thursdayLabel:`Thursday`,tueMinLabel:`Tu`,tueShortLabel:`Tue`,tuesdayLabel:`Tuesday`,wedMinLabel:`We`,wedShortLabel:`Wed`,wednesdayLabel:`Wednesday`},zG=`Asia/Kolkata`,BG=198e5,VG=new Map;function HG(e){let t=VG.get(e);return t||(t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),VG.set(e,t)),t}function UG(e){if(typeof e!=`string`||e===``)return!1;try{return HG(e),!0}catch{return!1}}function WG(e,t=zG){if(t===`Asia/Kolkata`){let t=new Date(e+BG);return{year:t.getUTCFullYear(),month:t.getUTCMonth(),day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds()}}let n=Object.fromEntries(HG(t).formatToParts(e).map(e=>[e.type,Number(e.value)]));return{year:Number(n.year),month:Number(n.month)-1,day:Number(n.day),hour:Number(n.hour)%24,minute:Number(n.minute),second:Number(n.second)}}function GG(e,t=zG){if(t===`Asia/Kolkata`)return BG;let n=WG(e,t),r=new Date(0);return r.setUTCFullYear(n.year,n.month,n.day),r.setUTCHours(n.hour,n.minute,n.second,0),r.getTime()-Math.floor(e/1e3)*1e3}function KG(e,t=zG){let n=e-GG(e,t);return n=e-GG(n,t),n}var qG=[`number`,`currency`,`percent`,`compact`,`duration`,`date`],JG=[`rupees`,`paise`],YG=[`ms`,`s`,`min`,`h`],XG=[`day`,`month`,`year`,`datetime`,`time`],ZG=()=>jG(`formatters`,RG),QG=()=>ZG().emptyValueLabel,$G=`−`,eK=[`janShortLabel`,`febShortLabel`,`marShortLabel`,`aprShortLabel`,`mayShortLabel`,`junShortLabel`,`julShortLabel`,`augShortLabel`,`sepShortLabel`,`octShortLabel`,`novShortLabel`,`decShortLabel`],tK={short:[`sunShortLabel`,`monShortLabel`,`tueShortLabel`,`wedShortLabel`,`thuShortLabel`,`friShortLabel`,`satShortLabel`],long:[`sundayLabel`,`mondayLabel`,`tuesdayLabel`,`wednesdayLabel`,`thursdayLabel`,`fridayLabel`,`saturdayLabel`],min:[`sunMinLabel`,`monMinLabel`,`tueMinLabel`,`wedMinLabel`,`thuMinLabel`,`friMinLabel`,`satMinLabel`]},nK=(e,t)=>ZG()[SG(e[t],`no date name at index ${t}`)],rK=e=>nK(eK,e);function iK(e,t){return nK(tK[t],e)}var aK=(e,t)=>SG(e[t],`no compact unit at index ${t}`),oK=[[1e7,`Cr`],[1e5,`L`],[1e3,`K`]],sK=[[1e9,`B`],[1e6,`M`],[1e3,`K`]],cK=e=>!e||e===`INR`?`en-IN`:`en-US`,lK=(e,t)=>typeof e==`number`&&Number.isInteger(e)&&e>=0&&e<=20?e:t,uK=new Map,dK=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=uK.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:e}),uK.set(n,r)),r},fK=new Map,pK=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=fK.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:e,maximumFractionDigits:e}),fK.set(n,r)),r},mK=e=>typeof e==`number`&&Number.isFinite(e),hK=e=>e<0&&!Object.is(Math.abs(e),0)?$G:``;function gK(e){if(!Number.isInteger(e))throw Error(`A paise amount must be a whole number, got ${e}`);let t=BigInt(Math.abs(e)).toString().padStart(3,`0`);return`${e<0?`-`:``}${t.slice(0,-2)}.${t.slice(-2)}`}var _K=(e,t)=>t===`paise`?Number(gK(e)):e,vK=2,yK=(e,t,n)=>{let r=Math.min(t,vK),i=10n**BigInt(vK-r),a=(BigInt(gK(e).replace(`.`,``))+i/2n)/i,o=10n**BigInt(r),s=pK(0,n).format(a/o);return t===0?s:`${s}.${(a%o).toString().padStart(r,`0`)}${`0`.repeat(t-r)}`};function bK(e,{decimals:t}={}){if(!mK(e))return QG();let n=dK(lK(t,2)).format(Math.abs(e));return n===`0`?`0`:hK(e)+n}function xK(e,t){if(!t?.currency)throw TypeError(`[@webority/ui-elements] formatCurrency needs options.currency, an ISO 4217 code such as "INR".`);if(!mK(e))return QG();let{unit:n=`rupees`,decimals:r,currency:i}=t,a=lK(r,0),o=cK(i),s=n===`paise`?yK(Math.abs(e),a,o):pK(a,o).format(Math.abs(e));return(Number(s.replace(/,/g,``))===0?``:hK(e))+yG(i)+s}var SK=e=>e>0&&e<.1?Math.min(20,1-Math.floor(Math.log10(e))):2;function CK(e,{currency:t,unit:n=`rupees`}={}){if(!mK(e))return QG();let r=t?_K(e,n):e,i=t?yG(t):``,a=t?cK(t):`en-IN`,o=a===`en-IN`?oK:sK,s=Math.abs(r),c=o.findIndex(([e])=>s>=e);if(c===-1){let e=dK(SK(s),a).format(s);if(e!==`1,000`)return(e===`0`?``:hK(r))+i+e;c=o.length-1}let[l,u]=aK(o,c),d=s/l,f=d>=100?0:d>=10?1:2,p=Number(d.toFixed(f));return p>=100&&c>0&&(--c,[l,u]=aK(o,c),d=s/l,f=d>=100?0:d>=10?1:2,p=Number(d.toFixed(f))),`${hK(r)}${i}${dK(f,a).format(p)} ${u}`}function wK(e,{decimals:t}={}){return mK(e)?`${bK(e*100,{decimals:lK(t,1)})}%`:QG()}var TK={ms:1,s:1e3,min:6e4,h:36e5};function EK(e,{unit:t=`s`}={}){if(!mK(e))return QG();let n=TK[t]??1e3,r=Math.abs(e*n),i=hK(e);if(Math.round(r)<1e3)return`${i}${dK(0).format(r)} ms`;let a=r/1e3;if(a<10)return`${i}${dK(1).format(a)}s`;let o=Math.round(a);if(o<60)return`${i}${o}s`;let s=e=>String(e).padStart(2,`0`),c=Math.floor(o/60);if(c<60)return`${i}${c}m ${s(o%60)}s`;let l=Math.floor(c/60);return`${i}${dK(0).format(l)}h ${s(c%60)}m`}function DK(e,t=zG){if(e instanceof Date)return e.getTime();if(mK(e))return e;if(typeof e!=`string`)return NaN;let n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(n){let[e,r,i]=[Number(n[1]),Number(n[2]),Number(n[3])],a=new Date(Date.UTC(2e3,r-1,i));return a.setUTCFullYear(e),a.getUTCFullYear()===e&&a.getUTCMonth()===r-1&&a.getUTCDate()===i?KG(a.getTime(),t):NaN}return Date.parse(e)}function OK(e,t=zG){let{year:n,month:r,day:i,hour:a,minute:o}=WG(e,t);return{year:n,month:r,day:i,hour:a,minute:o}}function kK(e,{pattern:t=`day`,timeZone:n=zG}={}){let r=DK(e,n);if(!Number.isFinite(r))return QG();let i=OK(r,n),a=e=>String(e).padStart(2,`0`),o=`${a(i.day)}-${rK(i.month)}-${i.year}`,s=`${a(i.hour)}:${a(i.minute)}`;switch(t){case`month`:return`${rK(i.month)}-${i.year}`;case`year`:return String(i.year);case`datetime`:return`${o} ${s}`;case`time`:return s;default:return o}}function AK(e,{timeZone:t=zG}={}){let n=DK(e,t);if(!Number.isFinite(n))return QG();let r=OK(n,t);return`${String(r.day).padStart(2,`0`)}-${rK(r.month)}`}function X(e,t){if(e==null||e===``)return QG();let n=t?.style;if(n===`date`)return kK(e,t);if(typeof e!=`number`)return String(e);switch(n){case`currency`:return xK(e,{...t,currency:t?.currency??``});case`percent`:return wK(e,t);case`compact`:return CK(e,t);case`duration`:return EK(e,t);default:return bK(e,t)}}function jK(e){let t=e?.style;if(t===`currency`){if(!e?.currency)throw TypeError(`[@webority/ui-elements] a currency format needs a currency, an ISO 4217 code such as "INR".`);return{style:`compact`,currency:e.currency,unit:e.unit}}return!t||t===`number`?{style:`compact`}:e??{}}var MK={aboveLabel:`Above`,areaChartLabel:`Area chart`,arrowKeysText:`{title}: use the arrow keys to read the values`,bandLabel:`Band`,barChartLabel:`Bar chart`,belowLabel:`Below`,bubbleChartLabel:`Bubble chart`,calendarHeatmapLabel:`Calendar heatmap`,calendarRangeText:`, from {first} to {last}`,calendarSummaryTextOne:`Calendar heatmap of {label}, {n} day.`,calendarSummaryTextOther:`Calendar heatmap of {label}, {n} days{range}.`,categoryLabel:`Category`,centerLabel:`Total`,changeLabel:`Change`,chartLabel:`chart`,columnChartLabel:`Column chart`,columnFallbackLabel:`column`,columnXLabel:`X`,constantSpanText:`{label} is {lo}.`,currencyFormatText:`This chart's currency format needs a currency code, such as "INR", in its currency field.`,dataSuffixLabel:`data`,dateLabel:`Date`,donutChartLabel:`Donut chart`,donutLargestText:`{top} is the largest, at {share}.`,donutSummaryTextOne:`Donut chart of {label} in {rows} part, {total} in all.`,donutSummaryTextOther:`Donut chart of {label} in {rows} parts, {total} in all.`,emptyText:`No data to show for this chart.`,errorText:`This chart couldn't load. Try again in a moment.`,everySeriesHiddenText:`Every series is hidden.`,firstStageLabel:`first stage`,fromLabel:`From`,funnelChartLabel:`Funnel chart`,funnelPreviousStepText:`{share} of previous step`,funnelStartText:`{first} is {firstValue} and {last} is {lastValue}, {share} of the start.`,funnelSummaryText:`Funnel chart of {label} in {n} stages.`,gaugeBandText:`, in the {band} band`,gaugeLabel:`Gauge`,gaugeSummaryText:`{type}: {label} is {value} on a scale from {min} to {max}{band}.`,groupLabel:`Group`,groupsTextOne:` in {count} group: {groups}`,groupsTextOther:` in {count} groups: {groups}`,heatmapLabel:`Heatmap`,heatmapSummaryText:`Heatmap of {label} by {group} and {x}, {n} cells.`,highestAtLowestAtText:`Highest is {highValue} at {highGroup}, {high}; lowest is {lowValue} at {lowGroup}, {low}.`,highestLowestText:`Highest is {maxValue} on {max}; lowest is {minValue} on {min}.`,itemLabel:`Item`,largestFallText:`The largest fall is {xText}, {signed}.`,largestFlowText:`The largest flow is {xText} to {toText}, {fmtAt}.`,largestRiseText:`The largest rise is {xText}, {signed}.`,latestText:`Latest {latest}`,legendLabel:`Legend`,lessLabel:`Less`,lineChartLabel:`Line chart`,loadingText:`Loading chart`,measureLabel:`Measure`,moreLabel:`More`,ofFirstStepText:`Of {first}`,ofPreviousStepLabel:`Of previous step`,openingShareText:`{share} of opening`,opensAtClosesAtText:`It opens at {opening} and closes at {closing}.`,otherLabel:`Other`,pointsSummaryTextOne:`{n} point, {first}.`,pointsSummaryTextOther:`{n} points, from {first} to {last}.`,rangeSpanText:`{label} runs from {lo} to {hi}.`,rowFallbackLabel:`row`,rowLabel:`Row`,runningTotalLabel:`Running total`,sankeyLabel:`Sankey diagram`,sankeySummaryText:`Sankey diagram of {label}: {n} flows between {nodes} places.`,scaleLabel:`Scale`,scaleRangeText:`{min} to {max}`,scatterPlotLabel:`Scatter plot`,scatterSummaryText:`{type} of {label} against {xLabel}, {count} points{groups}.`,shareLabel:`Share`,shareOfAllLabel:`Share of all`,shareOfGroupLabel:`Share of group`,shareOfParentText:`Share of {parent}`,shareOfStepText:`{share} of {first}`,sharedAxisText:`, sharing one x axis`,showingFirstRowsDownloadText:`Showing the first {rows} of {total} rows. Download the CSV for all of them.`,smallMultiplesLabel:`Small multiples`,stackedPercentText:`, stacked to 100%`,stackedText:`, stacked`,stageLabel:`Stage`,stepLabel:`Step`,summaryText:`{type} of {series}{stacked}{sharedAxis}.`,targetGapText:`{direction} {label} by {gap}`,targetLabel:`target`,toLabel:`To`,tooManyGroupsText:`This chart has more groups than it can show clearly.`,tooManySeriesText:`This chart has more series than it can show clearly.`,totalText:`Total {total}`,treemapEmptyText:`Treemap of {label}: no items.`,treemapLabel:`Treemap`,treemapLargestGroupText:`{name} is the largest group, at {share}.`,treemapSummaryText:`Treemap of {label}: {n} items in {totals} groups, {total} in all.`,trendLabel:`Trend`,untitledLabel:`Chart`,waterfallLabel:`Waterfall chart`,waterfallSummaryText:`Waterfall chart of {label}.`},Z=()=>jG(`chart`,MK),NK=[`line`,`area`,`column`,`bar`,`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`,`multiples`],PK=[`none`,`stacked`,`percent`],FK=[`category`,`time`,`value`],IK=[`auto`,`svg`,`canvas`],LK=[`ready`,`loading`,`empty`,`error`],RK=[`chart`,`table`],zK=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`],BK=8,VK=6,HK={line:`lineChartLabel`,area:`areaChartLabel`,column:`columnChartLabel`,bar:`barChartLabel`,donut:`donutChartLabel`,heatmap:`heatmapLabel`,calendar:`calendarHeatmapLabel`,funnel:`funnelChartLabel`,gauge:`gaugeLabel`,waterfall:`waterfallLabel`,treemap:`treemapLabel`,sankey:`sankeyLabel`,scatter:`scatterPlotLabel`,bubble:`bubbleChartLabel`,multiples:`smallMultiplesLabel`},UK=e=>Z()[HK[e]],WK=[`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`],GK=e=>WK.includes(e),KK=[`area`,`column`,`bar`],qK=[`line`,`area`,`column`,`bar`,`multiples`],JK={line:[`category`,`time`],area:[`category`,`time`],column:[`category`,`time`],bar:[`category`,`time`],multiples:[`category`,`time`],calendar:[`time`],scatter:[`value`],bubble:[`value`]},YK={group:[`heatmap`,`treemap`,`scatter`,`bubble`],to:[`sankey`],size:[`bubble`],trend:[`scatter`,`bubble`],zoom:[`line`,`area`],bands:[`gauge`],centerLabel:[`donut`],sliceValues:[`donut`],valueLabels:[`line`,`column`,`bar`]},XK={gauge:240,calendar:200,treemap:340,sankey:340},ZK=100,QK=72,$K=32,eq=[`type`,`title`,`description`,`data`,`x`,`series`,`group`,`to`,`size`,`trend`,`zoom`,`bands`,`stack`,`y`,`target`,`centerLabel`,`sliceValues`,`valueLabels`,`height`,`state`,`emptyText`,`errorText`,`loadingText`,`renderer`,`timeZone`],tq=[`key`,`kind`,`format`,`label`,`labelFit`],nq=[`auto`,`all`,`rotate`,`ellipsis`],rq=[`key`,`label`,`format`,`colour`],iq=[`key`,`label`],aq=[`key`,`label`,`format`],oq=[`upTo`,`label`],sq=[`label`,`format`,`min`,`max`,`wholeNumbers`],cq=[`value`,`label`],lq=[`style`,`currency`,`unit`,`decimals`,`pattern`],uq=[...JG,...YG],dq=new Set;function fq(e){dq.has(e)||(dq.add(e),bG(`[@webority/ui-elements] <wui-chart> ${e}`))}var pq=e=>e.map(e=>`"${e}"`).join(` | `),mq=e=>typeof e==`number`&&Number.isFinite(e),hq=e=>typeof e==`object`&&!!e&&!Array.isArray(e),gq=(e,t)=>Reflect.get(e,t),_q=e=>e===null||typeof e==`string`||typeof e==`number`,vq=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,_q(t)?t:null]));function yq(e,t){if(e==null)throw Error(`${t} missing`);return e}var bq=(e,t)=>e.some(e=>e===t);function xq(e,t,n){t==null||n.includes(t)||fq(`received ${e}="${String(t)}", which is not one of ${pq(n)}. The chart uses its default instead.`)}function Sq(e,t,n){for(let r of Object.keys(t))n.includes(r)||(/^(y2|secondary)/i.test(r)?fq(`ignores ${e}.${r}: a chart has one value axis by design. Show the second measure as its own chart.`):fq(`ignores the unknown key ${e}.${r}. Known keys: ${n.join(`, `)}.`))}function Cq(e,t){if(t==null)return;if(typeof t!=`object`){fq(`expects ${e} to be an object such as { style: "currency" }.`);return}Sq(e,t,lq);let n=gq(t,`style`);xq(`${e}.style`,n,qG);let r=gq(t,`currency`);r!=null&&!vG(r)&&fq(`received ${e}.currency="${String(r)}", which is not an ISO 4217 code such as "INR", so the format has no currency.`);let i=gq(t,`unit`);i!=null&&xq(`${e}.unit`,i,n===`duration`?YG:JG);let a=gq(t,`pattern`);xq(`${e}.pattern`,a,XG);let o=gq(t,`decimals`);o!=null&&!(typeof o==`number`&&Number.isInteger(o)&&o>=0&&o<=20)&&fq(`received ${e}.decimals=${String(o)}, which is not a whole number from 0 to 20. The chart uses its default instead.`);let s={style:bq(qG,n)?n:`number`};return typeof r==`string`&&vG(r)&&(s.currency=r),bq(uq,i)&&(s.unit=i),typeof o==`number`&&(s.decimals=o),bq(XG,a)&&(s.pattern=a),s}function wq(e,t){return t?.style!==`currency`||t.currency?null:`${e} is a currency format with no valid currency: set ${e}.currency to an ISO 4217 code such as "INR".`}function Tq(e){let t=(e,t=Z().errorText)=>(xG(`[@webority/ui-elements] <wui-chart> ${e}`),{spec:null,problem:t});if(!hq(e))return t('has no spec: set the `spec` property or add a <script type="application/json"> child.');let n=e;Sq(`spec`,n,eq);let r=gq(n,`type`);if(xq(`type`,r,NK),!bq(NK,r))return t(`cannot draw type "${String(r)}".`);let i=r,a=gq(n,`title`);typeof a==`string`&&a.trim()||fq("needs a `title`: it names the chart for screen readers and names exported files.");for(let[e,t]of Object.entries(YK))gq(n,e)!=null&&!t.includes(i)&&fq(`ignores spec.${e} on a ${i} chart: it applies to ${t.join(`, `)}.`);let o=gq(n,`x`),s=hq(o)?o:{};Sq(`spec.x`,s,tq);let c=JK[i]??[`category`],l=gq(s,`kind`);xq(`x.kind`,l,FK),bq(FK,l)&&!c.includes(l)&&fq(`ignores x.kind="${l}" on a ${i} chart: it takes ${pq(c)}.`);let u=gq(s,`labelFit`);xq(`x.labelFit`,u,nq);let d=Cq(`x.format`,gq(s,`format`)),f=gq(s,`key`);typeof f!=`string`&&i!==`gauge`&&fq("needs `x.key`, the column holding each row's x value or slice name.");let p=typeof f==`string`?f:``,m=gq(n,`y`),h=hq(m)?m:{};Sq(`spec.y`,h,sq);let g=Cq(`y.format`,gq(h,`format`)),_=wq(`x.format`,d);if(_)return t(_,Z().currencyFormatText);let v=wq(`y.format`,g);if(v)return t(v,Z().currencyFormatText);let y=gq(n,`series`),b=Array.isArray(y)?y.filter(hq):[],x=[];for(let[e,n]of b.entries()){Sq(`spec.series[${e}]`,n,rq);let r=Cq(`series[${e}].format`,gq(n,`format`)),i=wq(`series[${e}].format`,r);if(i)return t(i,Z().currencyFormatText);let a=gq(n,`key`);typeof a!=`string`&&fq(`needs series[${e}].key, the column holding that series' values.`);let o=gq(n,`label`),s=gq(n,`colour`);xq(`series[${e}].colour`,s,zK),x.push({key:String(a),named:typeof a==`string`,label:typeof o==`string`&&o?o:String(a),format:r,colour:bq(zK,s)?s:void 0})}let S=x[0];if(!S)return t(`has no series to draw.`);let C=x.filter(e=>e.named).map(e=>e.key),w=C.find((e,t)=>C.indexOf(e)!==t);if(w!==void 0)return t(`has two series with the key "${w}": each series needs its own key.`);if(x.length>8)return t(`refuses ${x.length} series: 8 is the most that stay distinguishable. Fold the smallest into an Other series, or split the chart.`,Z().tooManySeriesText);let T=GK(i);if(T&&x.length>1){let e=i===`donut`?`Compare parts across groups with a percent-stacked column instead.`:`Show the other measures as their own charts, or use small multiples.`;fq(`draws one series as a ${i}; it got ${x.length} and shows the first. ${e}`)}let E=(e,t,n,r)=>{if(t==null)return null;if(!hq(t))return fq(`expects ${e} to be an object such as { key: "column" }.`),null;Sq(e,t,n);let i=gq(t,`key`);if(typeof i!=`string`)return fq(`needs ${e}.key, the column holding ${r}.`),null;let a=Cq(`${e}.format`,gq(t,`format`)),o=gq(t,`label`);return{key:i,label:typeof o==`string`?o:``,format:a}},D=YK.group.includes(i)?E(`spec.group`,gq(n,`group`),iq,`each row's group`):null,O=i===`sankey`?E(`spec.to`,gq(n,`to`),iq,`where each flow ends`):null,k=i===`bubble`?E(`spec.size`,gq(n,`size`),aq,`each bubble's size`):null,A=wq(`group.format`,D?.format)??wq(`to.format`,O?.format)??wq(`size.format`,k?.format);if(A)return t(A,Z().currencyFormatText);if((i===`heatmap`||i===`treemap`)&&!D)return t(`needs \`group.key\` to draw a ${i}: the column holding each ${i===`heatmap`?`row`:`parent`}.`);if(i===`sankey`&&!O)return t("needs `to.key` to draw a sankey: the column holding where each flow ends.");if(i===`bubble`&&!k)return t("needs `size.key` to draw a bubble chart: the column holding each bubble's size.");let j=KK.includes(i)?PK:[`none`],M=gq(n,`stack`);xq(`stack`,M,j);let N=gq(n,`state`);xq(`state`,N,LK);let ee=gq(n,`renderer`);xq(`renderer`,ee,IK);let P=gq(n,`timeZone`);P!=null&&!UG(P)&&fq(`received timeZone="${String(P)}", which is not a time zone this browser knows. The chart uses Asia/Kolkata instead.`);let te=UG(P)?P:zG,F=gq(n,`target`),I=hq(F)?gq(F,`value`):void 0;F!=null&&(hq(F)&&Sq(`spec.target`,F,cq),hq(F)&&mq(I)||fq("ignores a `target` without a numeric `value`."));let ne=gq(n,`trend`);ne!=null&&typeof ne!=`boolean`&&fq("expects `trend` to be true or false.");let re=gq(n,`zoom`);re!=null&&typeof re!=`boolean`&&fq("expects `zoom` to be true or false.");let ie=[],L=gq(n,`bands`);if(i===`gauge`&&L!=null){let e=Array.isArray(L)?L.filter(hq):[];for(let t of e)Sq(`spec.bands[]`,t,oq);ie=e.map(e=>({upTo:gq(e,`upTo`),label:gq(e,`label`)})).filter(e=>mq(e.upTo)&&typeof e.label==`string`&&e.label!==``).sort((e,t)=>e.upTo-t.upTo),Array.isArray(L)&&ie.length===e.length||fq("ignores a gauge band without a numeric `upTo` and a `label`.")}let ae=g??S.format,R=(T?x.slice(0,1):x).map(e=>({key:e.key,label:e.label,format:e.format??ae,colour:e.colour})),z=bq(c,l)?l:c[0],B=gq(n,`data`),V=Array.isArray(B)?B:[],H=V.filter(hq).map(vq),oe=-1,se=null,U=S.key;i===`donut`&&H.length>6&&(se=H,{data:H,otherIndex:oe}=Oq(H,p,U),fq(`draws at most 6 donut slices; the smallest ${V.length-5} are shown as "${Z().otherLabel}". Send fewer rows, or use a bar chart for many parts.`));let ce=(e,t)=>{let n=H.filter(e);n.length!==H.length&&fq(`leaves out ${H.length-n.length} row(s) ${t}.`),H=n},le=e=>e!=null&&e!==``,ue=e=>mq(e)&&e>0;if(z===`time`&&qK.includes(i)&&ce(e=>Number.isFinite(DK(e[p],te)),`without a readable date`),i===`gauge`&&H.length>1)fq(`draws one value as a gauge; it got ${H.length} rows and shows the first.`),H=H.slice(0,1);else if(i===`scatter`||i===`bubble`){ce(e=>mq(e[p])&&mq(e[U])&&(i!==`bubble`||k!=null&&ue(e[k.key])),`without a number for x and y (and a positive size)`);let e=new Set(D?H.map(e=>String(e[D.key]??``)):[]);if(e.size>3)return t(`refuses ${e.size} colour groups on a ${i} chart: 3 is the most that stay tellable apart. Keep the three that matter and fold the rest into one, or split the chart.`,Z().tooManyGroupsText)}else if(i===`calendar`)ce(e=>Number.isFinite(DK(e[p],te)),`without a readable date`);else if(i===`heatmap`&&D)ce(e=>le(e[p])&&le(e[D.key]),`without a column or a row`);else if(i===`treemap`&&D){ce(e=>le(e[p])&&le(e[D.key])&&ue(e[U]),`without a name, a parent and a positive size`);let e=new Set(H.map(e=>String(e[D.key])));if(e.size>8)return t(`refuses ${e.size} parents in a treemap: 8 is the most that keep their own colour. Fold the smallest into one, or split the chart.`,Z().tooManyGroupsText)}else if(i===`sankey`&&O){ce(e=>le(e[p])&&le(e[O.key])&&ue(e[U]),`without a start, an end and a positive size`);let e=Eq(H,p,O.key);if(e)return t(e.reason,e.text)}else if(i===`waterfall`){let e=Dq(H,U);if(e?.refuse)return t(e.refuse);e?.warn&&fq(e.warn)}let de=gq(n,`height`),fe=mq(de)&&de>0?de:null;if(i===`multiples`){let e=QK*R.length+$K;fe!=null&&fe<e&&(fq(`needs at least ${e}px of height for ${R.length} small charts; it got ${fe}px and draws at ${e}px.`),fe=e),fe??=ZK*R.length+40}fe??=XK[i]??320;let pe=bq(j,M)?M:`none`,me=YK.valueLabels.includes(i)&&(gq(n,`valueLabels`)??i===`line`)===!0;me&&pe!==`none`&&fq(`ignores valueLabels on a stacked chart.`);let W=me&&pe===`none`,he=YK.sliceValues.includes(i)&&(gq(n,`sliceValues`)??!0)===!0,ge=gq(n,`description`),_e=gq(s,`label`),ve=gq(h,`label`),ye=gq(h,`min`),be=gq(h,`max`),xe=gq(n,`centerLabel`),Se=(e,t)=>typeof e==`string`&&e?e:t;return{problem:null,spec:{type:i,title:typeof a==`string`?a.trim():``,description:typeof ge==`string`?ge:``,data:H,allData:se??H,x:{key:p,kind:z,format:d??(z===`time`?{style:`date`}:z===`value`?{style:`number`}:void 0),label:typeof _e==`string`?_e:``,labelFit:bq(nq,u)?u:`auto`},series:R,group:D,to:O,size:k,trend:YK.trend.includes(i)&&ne===!0,zoom:YK.zoom.includes(i)?(re??H.length>5e3)===!0:!1,bands:ie,stack:pe,y:{label:typeof ve==`string`?ve:``,format:ae,min:mq(ye)?ye:void 0,max:mq(be)?be:void 0,wholeNumbers:gq(h,`wholeNumbers`)===!0},target:hq(F)&&mq(I)?{value:I,label:String(gq(F,`label`)??``)}:null,centerLabel:i===`donut`&&typeof xe==`string`&&xe.trim()?xe.trim():``,sliceValues:he,valueLabels:W,height:fe,state:bq(LK,N)?N:`ready`,emptyText:Se(gq(n,`emptyText`),Z().emptyText),errorText:Se(gq(n,`errorText`),Z().errorText),loadingText:Se(gq(n,`loadingText`),Z().loadingText),renderer:bq(IK,ee)?ee:`auto`,timeZone:te,otherIndex:oe}}}function Eq(e,t,n){let r=e.map(e=>[String(e[t]),String(e[n])]),i=new Map;for(let[e,t]of r)i.has(e)||i.set(e,0),i.set(t,(i.get(t)??0)+1);let a=[...i].filter(([,e])=>e===0).map(([e])=>e);if(a.length>8)return{reason:`refuses ${a.length} flow starts in a sankey: 8 is the most that keep their own colour. Fold the smallest into one, or split the chart.`,text:Z().tooManyGroupsText};let o=0;for(;a.length;){let e=a.pop();o+=1;for(let[t,n]of r){if(t!==e)continue;let r=(i.get(n)??0)-1;i.set(n,r),r===0&&a.push(n)}}return o<i.size?{reason:`cannot draw a sankey whose flows loop back on themselves.`,text:Z().errorText}:null}function Dq(e,t){let n=e.map(e=>mq(e[t])?e[t]:0),r=n[n.length-1]??0,i=n[0]??0,a=i;for(let e of n.slice(1,-1))i+=e,a=Math.min(a,i);return a<0||n.length>1&&r<0?{refuse:`cannot draw a waterfall whose running total goes below zero.`}:n.length>2&&Math.abs(r-i)>.5?{warn:`draws the waterfall's closing total (${r}) as given, though the opening total plus the steps is ${i}.`}:null}function Oq(e,t,n){let r=new Set(e.map((e,t)=>({i:t,v:mq(e[n])?e[n]:0})).sort((e,t)=>t.v-e.v).slice(0,5).map(e=>e.i)),i=e.reduce((e,t,i)=>r.has(i)||!mq(t[n])?e:e+t[n],0),a=e.filter((e,t)=>r.has(t)),o=new Set(a.map(e=>String(e[t]))),s=Z().otherLabel;for(let e=2;o.has(s);e+=1)s=`${Z().otherLabel} (${e})`;return a.push({[t]:s,[n]:i}),{data:a,otherIndex:a.length-1}}function kq(e){return yq(e.series[0],`series`)}function Aq(e,t){return yq(e.data[t],`row ${t}`)}function Q(e,t,n){let r=e.data[n]?.[t];return mq(r)?r:null}function jq(e){return e.type===`gauge`||e.series.some(t=>e.data.some((n,r)=>Q(e,t.key,r)!=null))}function $(e,t){let n=e.data[t]?.[e.x.key];return n==null||n===``?QG():e.x.format?X(n,{...e.x.format,timeZone:e.timeZone}):String(n)}function Mq(e,t){return DK(e.data[t]?.[e.x.key],e.timeZone)}function Nq(e,t){let n=e.group?e.data[t]?.[e.group.key]:null;return n==null||n===``?QG():String(n)}function Pq(e,t){let n=e.to?e.data[t]?.[e.to.key]:null;return n==null||n===``?QG():String(n)}var Fq=e=>[...new Set(e)];function Iq(e){return e.group?Fq(e.data.map((t,n)=>Nq(e,n))):[]}function Lq(e){return GK(e.type)?e.data.length:e.data.length*e.series.length}function Rq(e){return e.renderer===`auto`?Lq(e)>5e3?`canvas`:`svg`:e.renderer}function zq(e){switch(e.type){case`donut`:return e.data.map((t,n)=>$(e,n));case`scatter`:case`bubble`:return Iq(e);case`line`:case`area`:case`column`:case`bar`:return e.series.map(e=>e.key);default:return[]}}function Bq(e){return[`line`,`area`,`column`,`bar`].includes(e.type)?e.series.map(e=>e.label):zq(e)}function Vq(e,t,n){return e.type===`donut`?n.has($(e,t)):(e.type===`scatter`||e.type===`bubble`)&&e.group?n.has(Nq(e,t)):!1}function Hq(e,t){return e.data.map((n,r)=>{let i=e.series.filter(e=>!t.has(e.key)).reduce((t,n)=>t+Math.abs(Q(e,n.key,r)??0),0);return Object.fromEntries(e.series.map(t=>{let n=Q(e,t.key,r);return[t.key,i&&n!=null?n/i:null]}))})}function Uq(e,t=zG){return`${iK(new Date(e+GG(e,t)).getUTCDay(),`short`)}, ${kK(e,{timeZone:t})}`}var Wq=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.min(e,t),1/0),Gq=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.max(e,t),-1/0),Kq=(e,t)=>e.data.map((n,r)=>Q(e,t,r)).filter(e=>e!=null),qq=(e,t)=>t?X((e??0)/t,{style:`percent`}):QG();function Jq(e,t){let n=e.filter(mq);if(!n.length)return[];let r=Wq(n),i=Gq(n),a=[t[1],t[2],t[3],t[5],t[6]];if(r===i)return[{from:r,to:i,colour:a[2]}];let o=(i-r)/a.length;return a.map((e,t)=>({from:r+o*t,to:t===a.length-1?i:r+o*(t+1),colour:e}))}function Yq(e,t){if(t==null||!e.length)return;let n=e.length-1,r=e.findIndex((e,r)=>t>=e.from&&(r===n?t<=e.to:t<e.to));return e[r<0?n:r]?.colour}function Xq(e,t){return Array.from({length:e},(n,r)=>t[e===1?6:Math.round(6-r*4/(e-1))])}function Zq(e,t){return e.bands.find(e=>t<=e.upTo)??e.bands[e.bands.length-1]??null}var Qq=(e,t)=>t==null?QG():yq(Zq(e,t),`gauge band`).label;function $q(e){return{min:e.y.min??0,max:e.y.max??100}}function eJ(e){let t=kq(e).key,n=e.data.length-1,r=0;return e.data.map((i,a)=>{let o=Q(e,t,a)??0,s=a===0||a===n,c=s?0:r,l=s?o:r+o;return a===0?r=o:s||(r=l),{index:a,total:s,value:o,from:c,to:l,level:s?o:l}})}function tJ(e,t){let n=kq(e).key,r=yq(e.to,`to column`).key,i=e.data.map((t,i)=>({from:String(t[e.x.key]),to:String(t[r]),value:Q(e,n,i)??0})),a=new Map;for(let e of i)a.has(e.from)||a.set(e.from,[]),a.set(e.to,[...a.get(e.to)??[],e]);let o=new Map,s=0;for(let[e,n]of a)n.length||o.set(e,t[s++%t.length]);let c=[...o.keys()],l=new Map([...a].filter(([,e])=>e.length).map(([e,t])=>[e,t.length]));for(;c.length;){let e=c.shift();for(let t of i.filter(t=>t.from===e)){let e=(l.get(t.to)??0)-1;if(l.set(t.to,e),e>0)continue;let n=yq((a.get(t.to)??[]).reduce((e,t)=>e===null||t.value>e.value?t:e,null),`sankey inflow`);o.set(t.to,o.get(n.from)),c.push(t.to)}}return o}function nJ(e){let t=kq(e).key,n=new Map(Iq(e).map(e=>[e,0]));return e.data.forEach((r,i)=>{n.set(Nq(e,i),(n.get(Nq(e,i))??0)+(Q(e,t,i)??0))}),n}function rJ(e,t,n){let{palette:r,neutral:i,seq:a,rise:o,fall:s}=n,c=kq(e).key;switch(e.type){case`donut`:return oJ(e,t,n);case`funnel`:return Xq(e.data.length,yq(a,`sequential colours`))[t];case`heatmap`:case`calendar`:return Yq(Jq(Kq(e,c),yq(a,`sequential colours`)),Q(e,c,t));case`gauge`:return r[0];case`waterfall`:{let n=yq(eJ(e)[t],`waterfall bar ${t}`);return n.total?r[0]:n.value>=0?o:s}case`treemap`:return r[[...nJ(e).keys()].indexOf(Nq(e,t))%r.length];case`sankey`:return tJ(e,r).get(String(Aq(e,t)[e.x.key]));case`scatter`:case`bubble`:return r[Math.max(0,Iq(e).indexOf(Nq(e,t)))];default:return r[sJ(kq(e),0)]??i}}function iJ(e,t,n,r){let i=kq(e),a=Q(e,i.key,t),o=()=>rJ(e,t,r);switch(e.type){case`donut`:{let r=e.data.reduce((t,r,a)=>t+(n.has($(e,a))?0:Q(e,i.key,a)??0),0);return{title:$(e,t),rows:[{color:o(),label:i.label,value:X(a,i.format)},{label:Z().shareLabel,value:r&&a!=null?X(a/r,{style:`percent`}):QG()}],foot:``}}case`heatmap`:return{title:`${Nq(e,t)}, ${$(e,t)}`,rows:[{color:o(),label:i.label,value:X(a,i.format)}],foot:``};case`calendar`:return{title:Uq(Mq(e,t),e.timeZone),rows:[{color:o(),label:i.label,value:X(a,i.format)}],foot:``};case`funnel`:{let n=Q(e,i.key,0),r=t?Q(e,i.key,t-1):null,s=[{color:o(),label:i.label,value:X(a,i.format)}];return t&&s.push({label:Z().ofPreviousStepLabel,value:qq(a,r)}),s.push({label:NG(Z().ofFirstStepText,{first:$(e,0)}),value:qq(a,n)}),{title:$(e,t),rows:s,foot:``}}case`gauge`:{let{min:n,max:r}=$q(e),s=a==null?null:Zq(e,a),c=[{color:o(),label:i.label,value:X(a,i.format)}];return c.push({label:Z().scaleLabel,value:NG(Z().scaleRangeText,{min:X(n,i.format),max:X(r,i.format)})}),s&&c.push({label:Z().bandLabel,value:s.label}),{title:e.data[t]?.[e.x.key]==null?i.label:$(e,t),rows:c,foot:``}}case`waterfall`:{let n=eJ(e),r=yq(n[t],`waterfall bar ${t}`),a=yq(n[0],`waterfall opening bar`).value,s=r.total?[{color:o(),label:i.label,value:X(r.value,i.format)}]:[{color:o(),label:Z().changeLabel,value:aJ(r.value,i.format)},{label:Z().runningTotalLabel,value:X(r.level,i.format)}],c=!r.total&&a?NG(Z().openingShareText,{share:aJ(r.value/a*100,{style:`number`,decimals:2},`%`)}):``;return{title:$(e,t),rows:s,foot:c}}case`treemap`:{let n=Nq(e,t),r=nJ(e).get(n);return{title:`${n} / ${$(e,t)}`,rows:[{color:o(),label:i.label,value:X(a,i.format)},{label:NG(Z().shareOfParentText,{parent:n}),value:qq(a,r)}],foot:``}}case`sankey`:{let n=String(Aq(e,t)[e.x.key]),r=e.data.reduce((t,r,a)=>String(r[e.x.key])===n?t+(Q(e,i.key,a)??0):t,0);return{title:NG(Z().scaleRangeText,{min:n,max:Pq(e,t)}),rows:[{color:o(),label:i.label,value:X(a,i.format)},{label:NG(Z().shareOfParentText,{parent:n}),value:qq(a,r)}],foot:``}}case`scatter`:case`bubble`:{let n=[{color:o(),label:e.x.label||String(e.x.key),value:$(e,t)},{label:i.label,value:X(a,i.format)}];return e.size&&n.push({label:e.size.label||String(e.size.key),value:X(Aq(e,t)[e.size.key],e.size.format)}),{title:e.group?Nq(e,t):i.label,rows:n,foot:``}}}let s=e.stack===`percent`?Hq(e,n)[t]:null,c=e.series.map((e,t)=>({s:e,i:t})).filter(({s:e})=>!n.has(e.key)),l=c.map(({s:n,i})=>{let a=Q(e,n.key,t),o=X(a,n.format);return{color:e.type===`multiples`?r.palette[0]:r.palette[sJ(n,i)],line:e.type===`line`||e.type===`multiples`,label:n.label,value:s&&a!=null?`${o} (${X(s[n.key],{style:`percent`})})`:o}}),u=``,d=c[0];if(e.stack!==`none`&&d&&c.length>1){let n=c.reduce((n,{s:r})=>n+(Q(e,r.key,t)??0),0);u=NG(Z().totalText,{total:X(n,d.s.format)})}if(e.target&&d&&c.length===1){let n=Q(e,d.s.key,t);if(n!=null){let t=n-e.target.value,r=e.target.label||Z().targetLabel;u=NG(Z().targetGapText,{direction:t>=0?Z().aboveLabel:Z().belowLabel,label:r,gap:X(Math.abs(t),d.s.format)})}}return{title:$(e,t),rows:l,foot:u}}function aJ(e,t,n=``){let r=`${X(Math.abs(e),t)}${n}`;return e>0?`+${r}`:e<0?`−${r}`:r}function oJ(e,t,n){return t===e.otherIndex?n.neutral:n.palette[t%n.palette.length]}function sJ(e,t){return e.colour?Number(e.colour.slice(6))-1:t}function cJ(e){let t=CG(`div`,{class:`wui-chart-tooltip-body`});e.title&&t.append(CG(`div`,{class:`wui-chart-tooltip-title`},e.title));for(let n of e.rows){let e=CG(`div`,{class:`wui-chart-tooltip-row`});if(n.color){let t=document.createElement(`span`);t.className=n.line?`wui-chart-tooltip-swatch wui-chart-tooltip-swatch-line`:`wui-chart-tooltip-swatch`,t.style.background=n.color,e.append(t)}let r=document.createElement(`span`);r.className=`wui-chart-tooltip-label`,r.textContent=n.label;let i=document.createElement(`span`);i.className=`wui-chart-tooltip-value`,i.textContent=n.value,e.append(r,i),t.append(e)}return e.foot&&t.append(CG(`div`,{class:`wui-chart-tooltip-foot`},e.foot)),t}function lJ(e){let t=[e.title,...e.rows.map(e=>`${e.label} ${e.value}`)];return e.foot&&t.push(e.foot),t.filter(Boolean).join(`. `)}function uJ(e){return e.x.label?e.x.label:{gauge:Z().measureLabel,funnel:Z().stageLabel,waterfall:Z().stepLabel,sankey:Z().fromLabel,scatter:Z().columnXLabel,bubble:Z().columnXLabel}[e.type]??(e.x.kind===`time`?Z().dateLabel:Z().categoryLabel)}function dJ(e){let t=e.allData&&e.allData!==e.data?{...e,data:e.allData}:e,n=kq(t),r=(e,r=n)=>X(Q(t,r.key,e),r.format),i=(e,n,r=n.length)=>({caption:t.title,head:e,rows:n.slice(0,500),total:r,truncated:r>500}),a=t.data.map((e,t)=>t);switch(t.type){case`heatmap`:{let e=Fq(a.map(e=>$(t,e))),n=Iq(t),o=new Map(a.map(e=>[`${Nq(t,e)}\u0000${$(t,e)}`,r(e)]));return i([yq(t.group,`group column`).label||Z().rowLabel,...e],n.map(t=>({head:t,cells:e.map(e=>o.get(`${t}\u0000${e}`)??QG())})))}case`funnel`:{let e=Q(t,n.key,0);return i([uJ(t),n.label,Z().ofPreviousStepLabel,NG(Z().ofFirstStepText,{first:$(t,0)})],a.map(i=>({head:$(t,i),cells:[r(i),i?qq(Q(t,n.key,i),Q(t,n.key,i-1)):QG(),qq(Q(t,n.key,i),e)]})))}case`gauge`:return i([uJ(t),n.label,...t.bands.length?[Z().bandLabel]:[]],a.map(e=>({head:Aq(t,e)[t.x.key]==null?n.label:$(t,e),cells:[r(e),...t.bands.length?[Qq(t,Q(t,n.key,e))]:[]]})));case`waterfall`:return i([uJ(t),Z().changeLabel,Z().runningTotalLabel],eJ(t).map(e=>({head:$(t,e.index),cells:[e.total?QG():aJ(e.value,n.format),X(e.level,n.format)]})));case`treemap`:{let e=nJ(t);return i([yq(t.group,`group column`).label||Z().groupLabel,t.x.label||Z().itemLabel,n.label,Z().shareOfGroupLabel],a.map(i=>({head:Nq(t,i),cells:[$(t,i),r(i),qq(Q(t,n.key,i),e.get(Nq(t,i)))]})))}case`sankey`:return i([uJ(t),yq(t.to,`to column`).label||Z().toLabel,n.label],a.map(e=>({head:$(t,e),cells:[Pq(t,e),r(e)]})));case`scatter`:case`bubble`:return i([uJ(t),n.label,...t.size?[t.size.label||t.size.key]:[],...t.group?[t.group.label||Z().groupLabel]:[]],a.map(e=>({head:$(t,e),cells:[r(e),...t.size?[X(Aq(t,e)[t.size.key],t.size.format)]:[],...t.group?[Nq(t,e)]:[]]})))}let o=t.type===`donut`,s=o?t.data.reduce((e,r,i)=>e+(Q(t,n.key,i)??0),0):0,c=[uJ(t),...t.series.map(e=>e.label)];return o&&c.push(Z().shareLabel),i(c,a.slice(0,500).map(e=>{let i=t.series.map(t=>r(e,t));if(o){let r=Q(t,n.key,e);i.push(s&&r!=null?X(r/s,{style:`percent`}):QG())}return{head:$(t,e),cells:i}}),t.data.length)}function fJ(e){switch(e?.style){case`currency`:case`compact`:return e.currency?` (${e.currency})`:``;case`percent`:return` (%)`;case`duration`:return` (${e.unit??`s`})`;default:return``}}function pJ(e,t){return e==null?e:t?.unit===`paise`?Number(gK(e)):t?.style===`percent`?Number((e*100).toPrecision(12)):e}function mJ(e){let t=e.allData&&e.allData!==e.data?{...e,data:e.allData}:e,n=e=>{if(e==null)return``;let t=String(e);return typeof e==`string`&&/^[=+\-@\t\r]/.test(t)&&(t=`'${t}`),/[",\r\n]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t},r={head:t.x.label||t.x.key,value:e=>{let n=e[t.x.key];return t.x.kind===`time`?kK(n,{pattern:t.x.format?.pattern??`day`,timeZone:t.timeZone}):n}},i=t.series.map(e=>({head:`${e.label}${fJ(e.format)}`,value:t=>{let n=t[e.key];return pJ(mq(n)?n:null,e.format)}})),a=t.group,o=a?{head:a.label||a.key,value:e=>e[a.key]}:null,s;switch(t.type){case`heatmap`:s=[r,yq(o,`group column`),...i];break;case`treemap`:s=[yq(o,`group column`),r,...i];break;case`sankey`:{let e=yq(t.to,`to column`);s=[r,{head:e.label||e.key,value:t=>t[e.key]},...i];break}case`bubble`:{let e=yq(t.size,`size column`);s=[r,...i,{head:`${e.label||e.key}${fJ(e.format)}`,value:t=>{let n=t[e.key];return pJ(mq(n)?n:null,e.format)}},...o?[o]:[]];break}case`scatter`:s=[r,...i,...o?[o]:[]];break;case`gauge`:s=t.x.key===``?i:[r,...i];break;default:s=[r,...i]}let c=[s.map(e=>n(e.head)).join(`,`)];for(let e of t.data)c.push(s.map(t=>n(t.value(e))).join(`,`));return`${c.join(`\r
21
+ `)}`}function hJ(e){return(e?.title??``).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``)||`chart`}var gJ=(e,t,n)=>{if(!t.length)return null;let r=Wq(t),i=Gq(t);return r===i?NG(Z().constantSpanText,{label:e,lo:X(r,n)}):NG(Z().rangeSpanText,{label:e,lo:X(r,n),hi:X(i,n)})};function _J(e,t=new Set){let n=[];e.description&&n.push(e.description.replace(/\.?\s*$/,`.`));let r=zq(e);if(r.length&&r.every(e=>t.has(e)))return n.push(Z().everySeriesHiddenText),n.join(` `);let i=e.data.length,a=e.data.map((e,t)=>t).filter(n=>!Vq(e,n,t)),o=kq(e),s=Kq(e,o.key),c=s.reduce((e,t)=>e+t,0),l=()=>e.data.reduce((t,n,r)=>(Q(e,o.key,r)??-1/0)>(Q(e,o.key,t)??-1/0)?r:t,0),u=()=>e.data.reduce((t,n,r)=>(Q(e,o.key,r)??1/0)<(Q(e,o.key,t)??1/0)?r:t,0);switch(e.type){case`donut`:{let t=a.reduce((t,n)=>t+(Q(e,o.key,n)??0),0);if(n.push(PG(Z(),`donutSummaryText`,a.length,{rows:a.length,label:o.label,total:X(t,o.format)})),a.length&&t){let r=a.reduce((t,n)=>(Q(e,o.key,n)??-1/0)>(Q(e,o.key,t)??-1/0)?n:t,yq(a[0],`first slice`));n.push(NG(Z().donutLargestText,{top:$(e,r),share:X((Q(e,o.key,r)??0)/t,{style:`percent`})}))}return n.join(` `)}case`heatmap`:if(n.push(NG(Z().heatmapSummaryText,{label:o.label,group:yq(e.group,`group column`).label||Z().rowFallbackLabel,x:e.x.label||Z().columnFallbackLabel,n:i})),s.length){let t=l(),r=u();n.push(NG(Z().highestAtLowestAtText,{highValue:vJ(e,t),highGroup:Nq(e,t),high:$(e,t),lowValue:vJ(e,r),lowGroup:Nq(e,r),low:$(e,r)}))}return n.join(` `);case`calendar`:return n.push(i===1?NG(Z().calendarSummaryTextOne,{label:o.label,n:i}):NG(Z().calendarSummaryTextOther,{label:o.label,n:i,range:i>1?NG(Z().calendarRangeText,{first:$(e,0),last:$(e,i-1)}):``})),s.length&&n.push(NG(Z().highestLowestText,{maxValue:vJ(e,l()),max:$(e,l()),minValue:vJ(e,u()),min:$(e,u())})),n.join(` `);case`funnel`:return n.push(NG(Z().funnelSummaryText,{label:o.label,n:i})),i>1&&n.push(NG(Z().funnelStartText,{first:$(e,0),firstValue:vJ(e,0),last:$(e,i-1),lastValue:vJ(e,i-1),share:qq(Q(e,o.key,i-1),Q(e,o.key,0))})),n.join(` `);case`gauge`:{let t=Q(e,o.key,0),{min:r,max:i}=$q(e),a=t==null?null:Zq(e,t);return n.push(NG(Z().gaugeSummaryText,{type:UK(`gauge`),label:o.label,value:X(t,o.format),min:X(r,o.format),max:X(i,o.format),band:a?NG(Z().gaugeBandText,{band:a.label}):``})),n.join(` `)}case`waterfall`:{let t=eJ(e);if(n.push(NG(Z().waterfallSummaryText,{label:o.label})),i>1){let r=t.filter(e=>!e.total);n.push(NG(Z().opensAtClosesAtText,{opening:X(yq(t[0],`waterfall opening bar`).value,o.format),closing:X(yq(t[i-1],`waterfall closing bar`).value,o.format)}));let a=r.reduce((e,t)=>t.value>(e?.value??0)?t:e,null),s=r.reduce((e,t)=>t.value<(e?.value??0)?t:e,null);a&&n.push(NG(Z().largestRiseText,{xText:$(e,a.index),signed:aJ(a.value,o.format)})),s&&n.push(NG(Z().largestFallText,{xText:$(e,s.index),signed:aJ(s.value,o.format)}))}return n.join(` `)}case`treemap`:{let t=nJ(e);if(!t.size)return NG(Z().treemapEmptyText,{label:o.label});let[r,a]=[...t].reduce((e,t)=>t[1]>e[1]?t:e);return n.push(NG(Z().treemapSummaryText,{label:o.label,n:i,totals:t.size,total:X(c,o.format)})),n.push(NG(Z().treemapLargestGroupText,{name:r,share:qq(a,c)})),n.join(` `)}case`sankey`:{let t=yq(e.to,`to column`).key,r=Fq(e.data.flatMap(n=>[String(n[e.x.key]),String(n[t])])),a=l();return n.push(NG(Z().sankeySummaryText,{label:o.label,n:i,nodes:r.length})),n.push(NG(Z().largestFlowText,{xText:$(e,a),toText:Pq(e,a),fmtAt:vJ(e,a)})),n.join(` `)}case`scatter`:case`bubble`:{let r=Iq(e).filter(e=>!t.has(e));n.push(NG(Z().scatterSummaryText,{type:UK(e.type),label:o.label,xLabel:e.x.label||e.x.key,count:a.length,groups:r.length?PG(Z(),`groupsText`,r.length,{groups:r.join(`, `)}):``}));let i=a.map(t=>Aq(e,t)[e.x.key]).filter(mq),s=a.map(t=>Q(e,o.key,t)).filter(e=>e!=null);for(let t of[gJ(e.x.label||String(e.x.key),i,e.x.format),gJ(o.label,s,o.format)])t&&n.push(t);return n.join(` `)}}let d=e.stack===`percent`?Z().stackedPercentText:e.stack===`stacked`?Z().stackedText:``,f=e.series.filter(e=>!t.has(e.key));n.push(NG(Z().summaryText,{type:UK(e.type),series:f.map(e=>e.label).join(`, `),stacked:d,sharedAxis:e.type===`multiples`?Z().sharedAxisText:``})),i&&n.push(i===1?NG(Z().pointsSummaryTextOne,{n:i,first:$(e,0)}):NG(Z().pointsSummaryTextOther,{n:i,first:$(e,0),last:$(e,i-1)}));for(let t of f){let r=gJ(t.label,Kq(e,t.key),t.format);r&&n.push(r)}return n.join(` `)}var vJ=(e,t)=>{let n=kq(e);return X(Q(e,n.key,t),n.format)};function yJ(e){return e.stack===`percent`?{style:`percent`,decimals:0}:jK(e.y.format)}var bJ=864e5,xJ={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1},SJ=e=>xJ[e]??0,CJ=[`donut`,`funnel`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`];function wJ(e,t){let n=e.data.map((e,t)=>t).filter(n=>!Vq(e,n,t));if(e.type!==`scatter`&&e.type!==`bubble`)return n;let r=t=>Q(e,e.x.key,t)??0;return n.sort((e,t)=>r(e)-r(t)||e-t)}function TJ(e){let t=Fq(e.data.map((t,n)=>$(e,n))),n=Iq(e),r=new Map(e.data.map((r,i)=>[`${t.indexOf($(e,i))},${n.indexOf(Nq(e,i))}`,i]));return{columns:t.length,rows:n.length,at:r,position:r=>[t.indexOf($(e,r)),n.indexOf(Nq(e,r))]}}function EJ(e,t,n,r){if(n===`Escape`)return null;let i=e.data.length;if(!i)return t;if(e.type===`gauge`)return n in xJ||n===`Home`||n===`End`?{index:0,series:0}:t;if(e.type===`heatmap`||e.type===`calendar`)return DJ(e,t,n);let a=CJ.includes(e.type),o=e.series.map((e,t)=>r.has(e.key)?-1:t).filter(e=>e>=0),s=a?wJ(e,r):[];if(a?!s.length:!o.length)return t;let c=t??{index:a?yq(s[0],`first mark`):0,series:a?0:yq(o[0],`first visible series`)};if(t==null&&n in xJ)return c;if(a){let e=Math.max(0,s.indexOf(c.index));return n===`Home`?{index:yq(s[0],`first mark`),series:0}:n===`End`?{index:yq(s[s.length-1],`last mark`),series:0}:n in xJ?{index:yq(s[(e+SJ(n)+s.length)%s.length],`next mark`),series:0}:t}if(n===`Home`)return{...c,index:0};if(n===`End`)return{...c,index:i-1};if(!(n in xJ))return t;if(e.type===`bar`?n===`ArrowUp`||n===`ArrowDown`:n===`ArrowLeft`||n===`ArrowRight`)return{...c,index:Math.min(i-1,Math.max(0,c.index+SJ(n)))};let l=Math.max(0,o.indexOf(c.series)),u=e.type===`bar`?SJ(n):-SJ(n);return{...c,series:yq(o[Math.min(o.length-1,Math.max(0,l+u))],`series`)}}function DJ(e,t,n){let r=e.data.length,i=e.type===`calendar`,a=i?e.data.map((e,t)=>t).sort((t,n)=>Mq(e,t)-Mq(e,n)):[],o=i?null:TJ(e),s=t??{index:i?yq(a[0],`first day`):0,series:0};if(t==null&&n in xJ)return s;if(n===`Home`)return{index:i?yq(a[0],`first day`):0,series:0};if(n===`End`)return{index:i?yq(a[r-1],`last day`):r-1,series:0};if(!(n in xJ))return t;if(i){let t=n===`ArrowDown`||n===`ArrowUp`?SJ(n):SJ(n)*7,r=t=>{let n=Mq(e,t);return Math.floor((n+GG(n,e.timeZone))/bJ)},i=r(s.index),o=a.filter(e=>t>0?r(e)>i:r(e)<i);if(!o.length)return{index:s.index,series:0};let c=i+t;return{index:o.reduce((e,t)=>Math.abs(r(t)-c)<Math.abs(r(e)-c)?t:e),series:0}}if(!o)throw Error(`heat grid missing`);let[c,l]=o.position(s.index),[u,d]=n===`ArrowLeft`||n===`ArrowRight`?[SJ(n),0]:[0,SJ(n)];return{index:o.at.get(`${c+u},${l+d}`)??s.index,series:0}}var OJ=()=>jG(`chart`,MK);Bj([mx,iT,eE,kL,BI,kI,$F,SL,eN,YR,yB,EV,eV,bz,nz,AH,rH,DB,mU,VH,KW,gG]);function kJ(e){let t=e.series[0];if(!t)throw Error(`chart spec has no series`);return t}var AJ=e=>typeof e==`number`;function jJ(e,t){let n=e.data[t];if(!n)throw Error(`chart row ${t} missing`);return n}function MJ(e){if(!e.to)throw Error("chart spec has no `to` column");return e.to.key}function NJ(e){if(!e.size)throw Error("chart spec has no `size` column");return e.size.key}function PJ(e,t,n){let r=e[t];if(!r)throw Error(`percent shares for row ${t} missing`);return r[n]??null}function FJ(e,t,n){let r=e?.[t];if(!r)throw Error(`bar radii for row ${t} missing`);return r[n]}var IJ=e=>AJ(e)?e:null;function LJ(e){return typeof e==`object`&&e&&`row`in e?IJ(e.row):null}function RJ(e){if(typeof e!=`object`||!e||!(`dataZoom`in e)||!Array.isArray(e.dataZoom))return null;let t=e.dataZoom[0];if(typeof t!=`object`||!t||!(`start`in t)||!(`end`in t))return null;let{start:n,end:r}=t;return AJ(n)&&Number.isFinite(n)&&AJ(r)&&Number.isFinite(r)?{start:n,end:r}:null}function zJ(e){if(!e)throw Error(`chart has not been drawn`);return e}var BJ=[`series`,`graphic`,`grid`,`xAxis`,`yAxis`,`title`,`visualMap`,`calendar`,`dataZoom`],VJ=e=>String(e).replace(/[{}]/g,e=>e===`{`?`{`:`}`);function HJ(e){return e.wholeNumbers===!0||e.format?.style===`currency`&&e.format.unit===`paise`}function UJ(e,t,n,r,i=!1){let a=jK(e);if(i)return a.currency?{style:`currency`,currency:a.currency,unit:a.unit,decimals:0}:{style:`number`,decimals:0};if(a.style!==`compact`||!Number.isFinite(t)||!Number.isFinite(n))return a;let o=(n-t)/r;if(!(o>0)||o>=Math.max(Math.abs(t),Math.abs(n))*.02)return a;let s=Math.min(6,Math.max(0,Math.ceil(-Math.log10(o))));return a.currency?{style:`currency`,currency:a.currency,unit:a.unit,decimals:s}:{style:`number`,decimals:s}}var WJ=(e,t)=>{let n=e.filter(e=>typeof e==`number`&&Number.isFinite(e));return[Math.min(...t?[0,...n]:n),Math.max(...t?[0,...n]:n)]},GJ=24,KJ=4,qJ=.6,JJ=(e,t)=>String(e).length*t*qJ,YJ=(e,t)=>{let n=e[t];if(n===void 0)throw Error(`chart palette has no colour at slot ${t}`);return n};function XJ(e){let t=String(e??``).trim(),n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);if(n){let e=n[1]??``,t=e.length===3?[...e].map(e=>e+e).join(``):e;return[0,2,4].map(e=>Number.parseInt(t.slice(e,e+2),16))}let r=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(t);return r?r.slice(1,4).map(Number):null}function ZJ(e,t){let n=XJ(e);return n?`rgba(${n.join(`,`)},${t})`:String(e??``).trim()}function QJ(e,t,n){let r=XJ(e),i=XJ(t);return r&&i?`rgb(${r.map((e,t)=>Math.round(e+((i[t]??0)-e)*n)).join(`,`)})`:e}var $J=[.2126,.7152,.0722],eY=e=>e.map(e=>e/255).map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4).reduce((e,t,n)=>e+t*($J[n]??0),0),tY=(e,t)=>(Math.max(e,t)+.05)/(Math.min(e,t)+.05);function nY(e,t){let n=XJ(e),r=XJ(t.text),i=XJ(t.surface);return!n||!r||!i||tY(eY(n),eY(r))>=tY(eY(n),eY(i))?t.text:t.surface}var rY=(e,t)=>({type:`linear`,x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:ZJ(e,t)},{offset:1,color:ZJ(e,0)}]}),iY=(e,t)=>e+GG(e,t);function aY(e){let t=e.x.format?.pattern;return n=>{let r=KG(n,e.timeZone);if(t===`month`||t===`year`)return kK(r,{pattern:t,timeZone:e.timeZone});let i=WG(r,e.timeZone);return i.hour||i.minute?kK(r,{pattern:`time`,timeZone:e.timeZone}):AK(r,{timeZone:e.timeZone})}}function oY(e,t,n){let r=KJ,i=e=>n?e?[r,0,0,r]:[0,r,r,0]:e?[0,0,r,r]:[r,r,0,0];return e.data.map((n,r)=>{let a={};if(e.stack===`none`){for(let t of e.series)a[t.key]=i((Q(e,t.key,r)??0)<0);return a}let o=null,s=null;for(let n of e.series){let i=Q(e,n.key,r);t.has(n.key)||i==null||i===0||(i>0?o=n.key:s=n.key)}for(let t of e.series)a[t.key]=t.key===o?i(!1):t.key===s?i(!0):0;return a})}function sY(e,t,n,r){let i=n.width<576,a=r.animation!==!1&&!t.reducedMotion&&Lq(e)<=5e3,o=zq(e),s=Object.fromEntries(o.map(e=>[e,!r.hidden.has(e)])),c={palette:t.palette,neutral:t.neutral,rise:t.rise,fall:t.fall,seq:t.seq},l={backgroundColor:t.surface,borderColor:t.grid,borderWidth:1,padding:[10,12],confine:!0,className:`wui-chart-tooltip`,extraCssText:`box-shadow:${t.shadow};border-radius:10px;`,textStyle:{fontFamily:t.font,color:t.textBody,fontSize:12},transitionDuration:a?.25:0},u={backgroundColor:`transparent`,animation:a,animationDuration:1e3,animationEasing:`cubicOut`,animationDurationUpdate:650,animationEasingUpdate:`cubicInOut`,textStyle:{fontFamily:t.font,color:t.label},color:t.palette,legend:{show:!1,data:o,selected:s}},d={base:u,tooltipBase:l,colours:c,compact:i,animate:a},f=eX[e.type];if(f)return f(e,t,n,r,d);let p=e.type===`bar`,m=e.x.kind===`time`,h=e.stack===`percent`?Hq(e,r.hidden):null,g=p||e.type===`column`?oY(e,r.hidden,p):null,_=e.series.length===1,v=r.renderer===`canvas`,[y,b]=WJ(e.series.flatMap(t=>e.data.map((n,r)=>Q(e,t.key,r))),!0),x=e.stack===`percent`?yJ(e):UJ(e.y.format,e.y.min??y,e.y.max??b,i?3:4,e.y.wholeNumbers),S=h?.some(e=>Object.values(e).some(e=>e!=null&&e<0))?-1:0,C=e.series.findIndex(e=>!r.hidden.has(e.key)),w=e.series.filter(e=>!r.hidden.has(e.key)),T=m&&!e.valueLabels?[]:e.data.map((t,n)=>$(e,n)),E=()=>{let t=e.stack===`percent`?[1,S]:[e.y.max??b,e.y.min??y];return n.width-Math.max(...t.map(e=>JJ(X(e,x),12)))-20},D=!1;if(e.valueLabels){let t=e.data.length>MY?E():jY(T.length,E()),r=p?n.width-xY(T.map(e=>JJ(e,12)))-20:e.type===`line`?t:jY(T.length,E())/Math.max(1,w.length);D=w.flatMap(t=>e.type===`line`?[...NY(e,t.key)].map(n=>Q(e,t.key,n)):e.data.map((n,r)=>Q(e,t.key,r))).filter(e=>e!=null).every(e=>JJ(X(e,x),12)<=r)}let O={type:m?`time`:`category`,boundaryGap:!m&&(e.type===`column`||p),inverse:p,axisLine:{show:!0,lineStyle:{color:t.axis}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{color:t.label,fontSize:12,margin:12,...m||e.type!==`column`||e.x.labelFit===`auto`?{hideOverlap:!0}:FY(e.x.labelFit,T,E()),...m?{formatter:aY(e)}:{}},...m?{}:{data:T}},k={type:`value`,splitNumber:i?3:4,min:e.stack===`percent`?S:e.y.min,max:e.stack===`percent`?1:e.y.max,minInterval:HJ(e.y)?1:void 0,interval:e.stack===`percent`?.25:void 0,axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:t.grid,type:`solid`,width:1}},axisLabel:{color:t.label,fontSize:12,formatter:e=>X(e,x)},...e.y.label?{name:e.y.label,nameLocation:`end`,nameGap:12,nameTextStyle:{color:t.label,fontSize:12,align:p?`right`:`left`}}:{}},A=e.zoom,j=_&&e.type!==`column`&&!p&&!i&&!e.valueLabels,M=e.series.map((n,r)=>{let o=YJ(t.palette,sJ(n,r)%t.palette.length),s=e.data.some((t,r)=>Q(e,n.key,r)!=null&&Q(e,n.key,r-1)==null&&Q(e,n.key,r+1)==null),c=t=>{let r=Q(e,n.key,t),i=h?PJ(h,t,n.key):r;return m?[iY(Mq(e,t),e.timeZone),i]:i},l={id:n.key,name:n.key,stack:e.stack===`none`?void 0:`total`,emphasis:{focus:_?`none`:`series`,blurScope:`coordinateSystem`},blur:{itemStyle:{opacity:.22},lineStyle:{opacity:.22},areaStyle:{opacity:.08}}};if(e.type===`line`||e.type===`area`){let i=e.type===`area`?_||e.stack!==`none`?t.dark?.34:.22:.1:0,u=e.valueLabels?NY(e,n.key):null;return{...l,type:`line`,data:e.data.map((e,t)=>c(t)),smooth:.35,smoothMonotone:`x`,connectNulls:!1,symbol:`circle`,showSymbol:s||e.valueLabels,label:e.valueLabels?{show:D,position:`top`,distance:6,fontFamily:t.font,fontSize:12,fontWeight:600,color:t.text,formatter:e=>e.value==null||!u?.has(e.dataIndex)?``:X(Array.isArray(e.value)?e.value[1]:e.value,x)}:void 0,symbolSize:8,sampling:v?`lttb`:void 0,lineStyle:{width:2,color:o,..._&&!v?{shadowColor:ZJ(o,.35),shadowBlur:10,shadowOffsetY:6}:{}},itemStyle:{color:o,borderColor:t.surface,borderWidth:2},areaStyle:i?{color:rY(o,i)}:void 0,endLabel:j?{show:!0,formatter:e=>X(Array.isArray(e.value)?e.value[1]:e.value,x),color:o,fontWeight:600,fontSize:12,distance:8,fontFamily:t.font,valueAnimation:a}:void 0,markLine:r===C?cY(e,t,!1,a):void 0}}return{...l,type:`bar`,barMaxWidth:GJ,barCategoryGap:i?`28%`:`38%`,itemStyle:{color:o,borderColor:t.surface,borderWidth:e.stack===`none`?0:1},animationDelay:a?e=>e*45+r*110:0,data:e.data.map((e,t)=>({value:c(t),itemStyle:{borderRadius:FJ(g,t,n.key)}})),label:e.valueLabels?{show:D,position:p?`right`:`top`,distance:6,fontFamily:t.font,fontSize:12,fontWeight:600,color:t.text,formatter:e=>e.value==null?``:X(e.value,x)}:void 0,markLine:r===C?cY(e,t,p,a):void 0}});return{...u,useUTC:m,grid:{left:4,right:j?64:i?8:16,top:e.y.label?28:D&&(e.type===`column`||e.type===`line`)?24:12,bottom:A?44:4,outerBoundsMode:`same`},dataZoom:A?ZY(e,t,YJ(t.palette,0),r.zoom):void 0,tooltip:{...l,trigger:`axis`,axisPointer:e.type===`line`||e.type===`area`?{type:`line`,lineStyle:{color:t.axis}}:{type:`shadow`,shadowStyle:{color:ZJ(t.neutral,t.dark?.12:.1)}},formatter:t=>cJ(iJ(e,(Array.isArray(t)?t:[t])[0]?.dataIndex??0,r.hidden,c))},xAxis:p?k:O,yAxis:p?O:k,series:M}}function cY(e,t,n,r){if(!e.target)return;let i=kJ(e).format;return{silent:!0,symbol:`none`,animation:r,lineStyle:{color:t.label,type:[5,4],width:1},label:{position:`insideEndTop`,formatter:()=>[e.target?.label,X(e.target?.value,i)].filter(Boolean).join(` `),color:t.textMuted,fontSize:12,fontFamily:t.font,backgroundColor:t.surface,padding:[2,6],borderRadius:4},data:[n?{xAxis:e.target.value}:{yAxis:e.target.value}]}}function lY(e,t,n,r,i){let{base:a,tooltipBase:o,colours:s,compact:c}=i,l=kJ(e),u=e.data.map((t,n)=>$(e,n)),d=e.data.reduce((t,n,i)=>t+(r.hidden.has($(e,i))?0:Q(e,l.key,i)??0),0);return{...a,tooltip:{...o,trigger:`item`,formatter:t=>cJ(iJ(e,t.dataIndex,r.hidden,s))},graphic:[{type:`group`,left:`center`,top:`middle`,silent:!0,children:[{type:`text`,style:{text:X(d,jK(l.format)),x:0,y:-10,align:`center`,verticalAlign:`middle`,fill:t.text,fontSize:c?18:22,fontWeight:650,fontFamily:t.font}},{type:`text`,style:{text:e.centerLabel||OJ().centerLabel,x:0,y:14,align:`center`,verticalAlign:`middle`,fill:t.label,fontSize:12,fontFamily:t.font}}]}],series:[{id:l.key,name:l.key,type:`pie`,radius:c?[`50%`,`70%`]:[`54%`,`72%`],center:[`50%`,`50%`],padAngle:1.6,minAngle:3,startAngle:90,avoidLabelOverlap:!0,itemStyle:{borderRadius:6,borderColor:t.surface,borderWidth:2},animationType:`expansion`,animationDuration:1100,label:e.sliceValues?{show:!0,position:`outside`,color:t.label,fontFamily:t.font,fontSize:12,lineHeight:16,formatter:e=>`${e.name}\n${X(Number(e.value),l.format)} (${X(e.percent/100,{style:`percent`,decimals:0})})`}:c?{show:!1}:{show:!0,position:`outside`,color:t.label,fontFamily:t.font,fontSize:12,lineHeight:16,formatter:e=>`${e.name}\n${X(e.percent/100,{style:`percent`,decimals:0})}`},labelLine:{length:10,length2:8,smooth:.2,lineStyle:{color:t.axis}},labelLayout:{hideOverlap:!e.sliceValues},emphasis:{scale:!0,scaleSize:6,itemStyle:{shadowBlur:16,shadowColor:`rgba(0,0,0,0.18)`}},data:e.data.map((t,n)=>({name:u[n],value:Q(e,l.key,n)??0,itemStyle:{color:oJ(e,n,s)}}))}]}}var uY=e=>[...new Set(e)],dY=(e,t)=>e.data.map((n,r)=>Q(e,t,r));function fY(e,t){return{...e,trigger:`item`,formatter:e=>t(e)}}var pY=(e,t,n={})=>({type:`category`,data:t,axisLine:{lineStyle:{color:e.axis}},axisTick:{show:!1},axisLabel:{color:e.label,fontSize:12,margin:12,hideOverlap:!0},...n}),mY=(e,t,n={})=>({type:`value`,splitNumber:4,axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:e.grid,type:`solid`,width:1}},axisLabel:{color:e.label,fontSize:12,formatter:t},...n});function hY(e,t,n={}){return{type:`piecewise`,orient:`horizontal`,right:4,bottom:0,pieces:t.map((e,n)=>({gte:e.from,[n===t.length-1?`lte`:`lt`]:e.to,color:e.colour})),itemWidth:11,itemHeight:11,itemGap:3,itemSymbol:`roundRect`,showLabel:!1,text:[OJ().moreLabel,OJ().lessLabel],textGap:8,selectedMode:!1,textStyle:{color:e.label,fontSize:12,fontFamily:e.font},...n}}function gY(e,t,n,r,i){let a=kJ(e),o=uY(e.data.map((t,n)=>$(e,n))),s=Iq(e),c=Jq(dY(e,a.key),t.seq);return{...i.base,grid:{left:4,right:4,top:8,bottom:40,outerBoundsMode:`same`},tooltip:fY(i.tooltipBase,t=>cJ(iJ(e,t.dataIndex,r.hidden,i.colours))),xAxis:pY(t,o,{axisLine:{show:!1},splitArea:{show:!1}}),yAxis:pY(t,s,{inverse:!0,axisLine:{show:!1}}),visualMap:hY(t,c),series:[{type:`heatmap`,data:e.data.map((t,n)=>[o.indexOf($(e,n)),s.indexOf(Nq(e,n)),Q(e,a.key,n)??`-`]),itemStyle:{borderColor:t.surface,borderWidth:2,borderRadius:4},emphasis:{itemStyle:{borderColor:t.text,borderWidth:1.5}},progressive:0,animationDuration:800}]}}var _Y=6048e5,vY=(e,t)=>{let n=WG(e,t);return`${n.year}-${String(n.month+1).padStart(2,`0`)}-${String(n.day).padStart(2,`0`)}`};function yY(e,t){let n=e.data.map((t,n)=>Mq(e,n)).filter(Number.isFinite),r=bY(n),i=xY(n),a=Math.ceil((i-r)/_Y)+1,o=Math.floor((t.height-62)/7),s=Math.max(SY,Math.min(CY,o,Math.floor((t.width-44)/a))),c=Math.max(1,Math.floor((t.width-44)/s));return{cell:s,from:a>c?i-(c-1)*_Y:r,to:i}}var bY=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.min(t,e),1/0),xY=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.max(t,e),-1/0),SY=9,CY=24;function wY(e,t,n,r,i){let a=kJ(e),{cell:o,from:s,to:c}=yY(e,n),l=Jq(dY(e,a.key),t.seq);return{...i.base,tooltip:fY(i.tooltipBase,t=>cJ(iJ(e,t.dataIndex,r.hidden,i.colours))),visualMap:hY(t,l,{right:4}),calendar:{range:[vY(s,e.timeZone),vY(c,e.timeZone)],top:24,left:34,cellSize:[o,o],splitLine:{show:!1},itemStyle:{color:t.seq[0],borderColor:t.surface,borderWidth:o<16?2:3},dayLabel:{firstDay:1,nameMap:[``,iK(1,`short`),``,iK(3,`short`),``,iK(5,`short`),``],color:t.label,fontSize:12,fontFamily:t.font,margin:8},monthLabel:{color:t.label,fontSize:12,fontFamily:t.font,margin:8},yearLabel:{show:!1}},series:[{type:`heatmap`,coordinateSystem:`calendar`,data:e.data.map((t,n)=>[vY(Mq(e,n),e.timeZone),Q(e,a.key,n)??`-`]),itemStyle:{borderRadius:3,borderColor:t.surface,borderWidth:2},emphasis:{itemStyle:{borderColor:t.text,borderWidth:1.5}}}]}}function TY(e,t,n,r,i){let a=kJ(e),o=Xq(e.data.length,t.seq),s=Q(e,a.key,0);return{...i.base,tooltip:fY(i.tooltipBase,t=>cJ(iJ(e,t.dataIndex,r.hidden,i.colours))),series:[{type:`funnel`,sort:`none`,gap:3,left:0,right:0,top:4,bottom:4,minSize:`38%`,maxSize:`100%`,funnelAlign:`center`,animationDuration:900,itemStyle:{borderColor:t.surface,borderWidth:0,borderRadius:6},emphasis:{itemStyle:{shadowBlur:14,shadowColor:`rgba(0,0,0,0.18)`}},label:{show:!0,position:`inside`,fontFamily:t.font,lineHeight:17},data:e.data.map((n,r)=>{let i=nY(o[r],t),c=Q(e,a.key,r),l=r?NG(OJ().funnelPreviousStepText,{share:qq(c,Q(e,a.key,r-1))}):NG(OJ().shareOfStepText,{share:qq(c,s),first:VJ($(e,0))});return{name:$(e,r),value:c??0,itemStyle:{color:o[r]},label:{formatter:`{n|${VJ($(e,r))}} {v|${VJ(X(c,a.format))}}\n{p|${r?l:OJ().firstStageLabel}}`,rich:{n:{color:i,fontSize:12.5,fontWeight:500,fontFamily:t.font},v:{color:i,fontSize:13,fontWeight:700,fontFamily:t.font},p:{color:ZJ(i,.78),fontSize:12,fontFamily:t.font}}}}})}]}}function EY(e,t,n,r,i){let a=kJ(e),{min:o,max:s}=$q(e),c=Q(e,a.key,0),l=c??o,u=c==null?null:Zq(e,c),d=YJ(t.palette,0),f=s-o||1,p=e.bands.length?e.bands.map((e,n)=>[Math.min(1,Math.max(0,(e.upTo-o)/f)),t.seq[1+Math.min(n,3)]]):[[1,t.grid]];return e.bands.length&&(p[p.length-1]?.[0]??1)<1&&p.push([1,t.grid]),{...i.base,tooltip:fY(i.tooltipBase,()=>cJ(iJ(e,0,r.hidden,i.colours))),series:[{type:`gauge`,startAngle:215,endAngle:-35,min:o,max:s,radius:`96%`,center:[`50%`,`58%`],splitNumber:10,pointer:{show:!1},anchor:{show:!1},progress:{show:c!=null,width:14,roundCap:!0,itemStyle:{color:d,shadowBlur:i.animate?12:0,shadowColor:ZJ(d,.35)}},axisLine:{roundCap:!0,lineStyle:{width:14,color:p}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},title:{offsetCenter:[0,`30%`],color:t.label,fontSize:12.5,fontFamily:t.font},detail:{valueAnimation:i.animate,offsetCenter:[0,`-4%`],fontFamily:t.font,formatter:e=>`{v|${VJ(c==null?X(null):X(e,a.format))}}{u|/${VJ(X(s,a.format))}}${u?`\n{s|${VJ(u.label)}}`:``}`,rich:{v:{fontSize:36,fontWeight:650,color:t.text,fontFamily:t.font,padding:[0,2,0,0]},u:{fontSize:14,color:t.label,fontFamily:t.font,padding:[12,0,0,0]},s:{fontSize:12,color:t.label,fontFamily:t.font,padding:[8,0,0,0]}}},data:[{value:l,name:e.data[0]?.[e.x.key]==null?a.label:$(e,0)}]}]}}function DY(e){let t=xY(e.map(e=>e.level).concat(e.map(e=>e.from),e.map(e=>e.to))),n=bY(e.filter(e=>!e.total).map(e=>Math.min(e.from,e.to)).concat(e.filter(e=>e.total).map(e=>e.value))),r=xY(e.filter(e=>!e.total).map(e=>Math.abs(e.value)));if(!(t>0)||!(n>t*.4)||!(r<t*.15))return null;let i=10**Math.floor(Math.log10(t))/10,a=Math.round(t*.08/i)*i,o=Math.floor(n*.965/i)*i;return o>a?{start:a,end:o}:null}var OY=4,kY=72,AY=12,jY=(e,t)=>Math.floor(t/Math.max(1,e)-OY),MY=12;function NY(e,t){let n=e.data.map((e,t)=>t).filter(n=>Q(e,t,n)!=null);if(e.data.length<=MY||!n.length)return new Set(n);let r=n=>Q(e,t,n)??0,i=n.reduce((e,t)=>r(t)>r(e)?t:e),a=n.reduce((e,t)=>r(t)<r(e)?t:e);return new Set([n[0],n[n.length-1],i,a].filter(AJ))}function PY(e,t){return xY(e.flatMap(e=>String(e).split(/\s+/)).map(e=>JJ(e,AY)))<=t?{interval:0,width:t,overflow:`break`}:{interval:0,rotate:45,width:kY,overflow:`truncate`}}function FY(e,t,n){let r=jY(t.length,n);return e===`all`?{...PY(t,r),hideOverlap:!1}:e===`rotate`?{interval:0,rotate:45,width:kY,overflow:`truncate`,hideOverlap:!1}:e===`ellipsis`?{interval:0,rotate:0,width:Math.max(1,r),overflow:`truncate`,hideOverlap:!1}:{hideOverlap:!0}}function IY(e,t,n){let r=jY(e.length,n),i=PY(e,r);return{nameSize:AY,valueSize:12,category:`rotate`in i?{...i,hideOverlap:!0}:i,showValues:t.every(e=>JJ(e,12)<=r)}}function LY(e,t,n,r,i){let a=kJ(e),o=eJ(e),s=yJ(e),c=DY(o),l=t=>rJ(e,t.index,i.colours),u=o.map(t=>$(e,t.index)),d=o.map(e=>e.total?X(e.value,s):aJ(e.value,s)),f=o.flatMap(e=>[e.from,e.to]),p=Math.max(JJ(X(xY(f),s),11),JJ(X(bY(f),s),11))+8,m=IY(u,d,n.width-p-12);return{...i.base,grid:{left:4,right:8,top:28,bottom:4,outerBoundsMode:`same`},tooltip:{...i.tooltipBase,trigger:`axis`,axisPointer:{type:`shadow`,shadowStyle:{color:ZJ(t.neutral,.1)}},formatter:t=>cJ(iJ(e,(Array.isArray(t)?t:[t])[0]?.dataIndex??0,r.hidden,i.colours))},xAxis:pY(t,u,{axisLabel:{color:t.label,fontSize:m.nameSize,margin:12,...m.category}}),yAxis:mY(t,e=>X(e,s),{min:0,minInterval:HJ(e.y)?1:void 0,splitNumber:5,...c?{breaks:[{start:c.start,end:c.end,gap:`6%`}],breakArea:{show:!0,itemStyle:{color:t.surface,borderColor:t.axis,borderWidth:1,borderType:`solid`,opacity:1},zigzagAmplitude:3,zigzagZ:200}}:{}}),series:[{type:`line`,step:`end`,data:o.map(e=>e.level),symbol:`none`,silent:!0,z:1,lineStyle:{color:t.axis,width:1},tooltip:{show:!1},animation:!1,emphasis:{disabled:!0}},{type:`bar`,stack:`w`,data:o.map(e=>Math.min(e.from,e.to)),silent:!0,itemStyle:{color:`transparent`},emphasis:{disabled:!0},tooltip:{show:!1},barMaxWidth:48},{name:a.key,type:`bar`,stack:`w`,z:3,barMaxWidth:48,barCategoryGap:`34%`,itemStyle:{borderRadius:5},emphasis:{itemStyle:{shadowBlur:10,shadowColor:`rgba(0,0,0,0.15)`}},animationDelay:i.animate?e=>e*140:0,label:{show:m.showValues,position:`top`,distance:6,fontFamily:t.font,fontSize:m.valueSize,fontWeight:600,color:t.text,formatter:e=>d[e.dataIndex]},data:o.map(e=>({value:Math.abs(e.to-e.from),itemStyle:{color:l(e)}}))}]}}function RY(e){let t=kJ(e).key;return Iq(e).map(n=>({name:n,rows:e.data.map((e,t)=>t).filter(t=>Nq(e,t)===n).sort((n,r)=>(Q(e,t,r)??0)-(Q(e,t,n)??0)||n-r)}))}function zY(e,t,n,r,i){let a=kJ(e),o=nJ(e),s=[...o.values()].reduce((e,t)=>e+t,0),c=(e,t)=>{let r=(e??0)/s*n.width*n.height*.82;return r>5200&&Math.max(JJ(t[0],12),JJ(t[1],11.5))+20<=Math.sqrt(r)},l=RY(e).map(({name:n,rows:r},i)=>{let s=o.get(n),l=YJ(t.palette,i%t.palette.length),u=nY(l,t);return{name:n,value:s,itemStyle:{color:l,borderColor:l},upperLabel:{color:u,formatter:`{n|${VJ(n)}} {v|${VJ(X(s,a.format))}}`,rich:{n:{fontWeight:600,fontSize:12,color:u,fontFamily:t.font},v:{fontSize:12,color:ZJ(u,.8),fontFamily:t.font}}},children:r.map((n,r)=>{let i=QJ(l,t.surface,Math.min(.55,r*.14)),o=nY(i,t),s=Q(e,a.key,n);return{name:$(e,n),value:s,row:n,itemStyle:{color:i},label:{show:c(s,[$(e,n),X(s,a.format)]),formatter:`{n|${VJ($(e,n))}}\n{v|${VJ(X(s,a.format))}}`,rich:{n:{color:o,fontSize:12,fontWeight:500,fontFamily:t.font,lineHeight:16},v:{color:ZJ(o,.82),fontSize:12,fontFamily:t.font}}}}})}});return{...i.base,tooltip:fY(i.tooltipBase,t=>t.data?.row==null?cJ({title:t.name,rows:[{color:t.color,label:a.label,value:X(t.value,a.format)},{label:OJ().shareOfAllLabel,value:qq(IJ(t.value),s)}],foot:``}):cJ(iJ(e,t.data.row,r.hidden,i.colours))),series:[{type:`treemap`,roam:!1,nodeClick:!1,breadcrumb:{show:!1},left:0,right:0,top:0,bottom:0,animationDurationUpdate:700,label:{show:!0,position:`insideTopLeft`,padding:[8,10],overflow:`truncate`,fontFamily:t.font},upperLabel:{show:!0,height:28,padding:[0,10],fontFamily:t.font},levels:[{itemStyle:{borderWidth:0,gapWidth:4,borderColor:t.surface}},{itemStyle:{borderWidth:3,gapWidth:2,borderRadius:8}},{itemStyle:{borderWidth:0,gapWidth:0,borderRadius:5},emphasis:{itemStyle:{borderColor:t.text,borderWidth:0}}}],data:l}]}}function BY(e){let t=MJ(e),n=e.data.map(n=>[String(n[e.x.key]),String(n[t])]),r=new Map(n.flatMap(([e,t])=>[[e,0],[t,0]]));for(let e=0;e<r.size;e+=1)for(let[e,t]of n)r.set(t,Math.max(r.get(t)??0,(r.get(e)??0)+1));return r}function VY(e,t,n,r,i){let a=kJ(e),o=MJ(e),s=tJ(e,t.palette),c=BY(e),l=xY([...c.values()]),u=new Map,d=new Map;e.data.forEach((t,n)=>{let r=Q(e,a.key,n)??0;u.set(String(t[e.x.key]),(u.get(String(t[e.x.key]))??0)+r),d.set(String(t[o]),(d.get(String(t[o]))??0)+r)});let f=e=>d.get(e)??u.get(e)??0,p=e=>({position:e,color:t.text,fontFamily:t.font,fontSize:12,formatter:e=>`{n|${VJ(e.name)}}\n{v|${X(f(e.name),{style:`compact`})}}`,rich:{n:{color:t.textBody,fontSize:12,fontFamily:t.font,lineHeight:15},v:{color:t.label,fontSize:12,fontFamily:t.font}}});return{...i.base,tooltip:fY(i.tooltipBase,t=>cJ(t.dataType===`edge`?iJ(e,t.dataIndex,r.hidden,i.colours):{title:t.name,rows:[{color:t.color,label:a.label,value:X(f(t.name),a.format)}],foot:``})),series:[{type:`sankey`,left:0,right:0,top:6,bottom:6,nodeWidth:10,nodeGap:i.compact?10:14,nodeAlign:`justify`,draggable:!1,layoutIterations:64,animationDuration:1200,emphasis:{focus:`adjacency`,lineStyle:{opacity:.55}},itemStyle:{borderWidth:0,borderRadius:3},lineStyle:{curveness:.5},levels:Array.from({length:l+1},(e,t)=>({depth:t,label:p(t===l&&l>0?`left`:`right`)})),data:[...c.keys()].map(e=>({name:e,itemStyle:{color:s.get(e)}})),links:e.data.map(n=>({source:String(n[e.x.key]),target:String(n[o]),value:n[a.key],lineStyle:{color:s.get(String(n[e.x.key])),opacity:t.dark?.32:.26}}))}]}}function HY(e){let t=e.length,n=e.reduce((e,t)=>e+t[0],0)/t,r=e.reduce((e,t)=>e+t[1],0)/t,i=e.reduce((e,t)=>e+(t[0]-n)**2,0);if(!t||!i)return null;let a=e.reduce((e,t)=>e+(t[0]-n)*(t[1]-r),0)/i,o=bY(e.map(e=>e[1])),s=xY(e.map(e=>e[1])),c=e=>{let t=r+a*(e-n);return t<o?[e+(o-t)/a,o]:t>s?[e+(s-t)/a,s]:[e,t]};return[c(bY(e.map(e=>e[0]))),c(xY(e.map(e=>e[0])))]}var UY=44,WY=28,GY=8;function KY(e,t,n,r,i){let a=kJ(e),o=Iq(e),s=e.type===`bubble`,c=xY(s?e.data.map(t=>t[NJ(e)]).filter(AJ):[]),l=e=>Math.max(GY,(i.compact?WY:UY)*Math.sqrt(e/c)),u=t=>e.data.map((e,t)=>t).filter(n=>!e.group||Nq(e,n)===t),d=(e.group?o:[null]).filter(e=>e==null||!r.hidden.has(e)).flatMap(e=>u(e)),f=e.trend?HY(d.flatMap(t=>{let n=jJ(e,t)[e.x.key],r=Q(e,a.key,t);return AJ(n)&&r!=null?[[n,r]]:[]})):null,p=e.data.map(t=>t[e.x.key]),m=e.data.map((t,n)=>Q(e,a.key,n)),[h,g]=WJ(p,!1),[_,v]=WJ(m,!1),y=UJ(e.y.format,e.y.min??_,e.y.max??v,4),b=UJ(e.x.format,h,g,4),x=(e.group?o:[null]).map((n,r)=>({name:n??a.key,type:`scatter`,symbolSize:s?e=>l(e[2]??NaN):i.compact?8:10,itemStyle:{color:ZJ(t.palette[r],.85),borderColor:t.surface,borderWidth:1.5},emphasis:{focus:`series`,scale:1.5,itemStyle:{color:t.palette[r]}},blur:{itemStyle:{opacity:.15}},animationDelay:i.animate?e=>e*6+r*120:0,data:u(n).map(t=>({value:[jJ(e,t)[e.x.key],Q(e,a.key,t),...s?[jJ(e,t)[NJ(e)]]:[]],row:t}))}));return f&&x.push({name:OJ().trendLabel,type:`line`,data:f,symbol:`none`,silent:!0,z:1,tooltip:{show:!1},lineStyle:{color:t.label,width:1.5,type:[6,4]},emphasis:{disabled:!0},endLabel:{show:!0,formatter:OJ().trendLabel,color:t.label,fontSize:12,fontFamily:t.font,offset:[-30,-12]}}),{...i.base,grid:{left:4,right:16,top:e.y.label?28:12,bottom:e.x.label?24:4,outerBoundsMode:`same`},tooltip:fY(i.tooltipBase,t=>t.data?.row==null?``:cJ(iJ(e,t.data.row,r.hidden,i.colours))),xAxis:mY(t,e=>X(e,b),{scale:!0,minInterval:HJ(e.x)?1:void 0,splitLine:{show:!1},axisLine:{show:!0,lineStyle:{color:t.axis}},...e.x.label?{name:e.x.label,nameLocation:`middle`,nameGap:28,nameTextStyle:{color:t.label,fontSize:12,fontFamily:t.font}}:{}}),yAxis:mY(t,e=>X(e,y),{min:e.y.min,max:e.y.max,minInterval:HJ(e.y)?1:void 0,...e.y.label?{name:e.y.label,nameLocation:`end`,nameGap:12,nameTextStyle:{color:t.label,fontSize:12,fontFamily:t.font,align:`left`}}:{}}),series:x}}var qY=32,JY=8,YY=26;function XY(e,t,n,r,i){let a=e.x.kind===`time`,o=e.series.length,s=(n.height-6-YY)/o,c=s-qY-JY,l=YJ(t.palette,0),u=e.data.map((t,n)=>$(e,n)),d=e.series.flatMap((n,r)=>{let i=dY(e,n.key).filter(e=>e!=null).pop();return[{text:n.label,left:0,top:6+r*s,textStyle:{fontSize:12.5,fontWeight:600,color:t.text,fontFamily:t.font}},{text:NG(OJ().latestText,{latest:X(i,n.format)}),right:8,top:7+r*s,textStyle:{fontSize:12,fontWeight:500,color:t.label,fontFamily:t.font}}]}),f=(t,n)=>{let r=Q(e,t.key,n);return a?[iY(Mq(e,n),e.timeZone),r]:r};return{...i.base,useUTC:a,title:d,grid:e.series.map((e,t)=>({left:52,right:8,top:6+t*s+qY,height:c})),axisPointer:{link:[{xAxisIndex:`all`}],lineStyle:{color:t.axis},label:{show:!1}},tooltip:{...i.tooltipBase,trigger:`axis`,axisPointer:{type:`line`,lineStyle:{color:t.axis}},formatter:t=>cJ(iJ(e,(Array.isArray(t)?t:[t])[0]?.dataIndex??0,r.hidden,i.colours))},xAxis:e.series.map((n,r)=>({...a?{type:`time`}:pY(t,u,{boundaryGap:!1}),gridIndex:r,axisLine:{lineStyle:{color:r===o-1?t.axis:t.grid}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:r===o-1,color:t.label,fontSize:12,hideOverlap:!0,margin:10,...a?{formatter:aY(e)}:{}}})),yAxis:e.series.map((n,r)=>{let[i,a]=WJ(dY(e,n.key),!1),o=UJ(n.format,e.y.min??i,e.y.max??a,2);return mY(t,e=>X(e,o),{gridIndex:r,splitNumber:2,scale:e.y.min==null,min:e.y.min,max:e.y.max,minInterval:HJ(n)?1:void 0,axisLabel:{color:t.label,fontSize:12,formatter:e=>X(e,o)}})}),series:e.series.map((n,r)=>({id:n.key,name:n.key,type:`line`,xAxisIndex:r,yAxisIndex:r,data:e.data.map((e,t)=>f(n,t)),smooth:.3,symbol:`circle`,showSymbol:!1,symbolSize:7,lineStyle:{width:1.75,color:l},itemStyle:{color:l,borderColor:t.surface,borderWidth:2},areaStyle:{color:rY(l,t.dark?.26:.16)},animationDelay:i.animate?r*160:0,emphasis:{disabled:!0}}))}}function ZY(e,t,n,r){let i=r?.start??(e.data.length>5e3?70:0),a=r?.end??100;return[{type:`inside`,start:i,end:a},{type:`slider`,start:i,end:a,height:26,bottom:8,left:52,right:12,borderColor:`transparent`,backgroundColor:t.grid,borderRadius:6,fillerColor:ZJ(n,t.dark?.22:.12),handleStyle:{color:t.surface,borderColor:t.axis},moveHandleSize:0,brushSelect:!1,dataBackground:{lineStyle:{color:t.axis,width:.75},areaStyle:{color:ZJ(t.neutral,.15)}},selectedDataBackground:{lineStyle:{color:n,width:.75},areaStyle:{color:ZJ(n,.18)}},textStyle:{color:t.label,fontSize:12,fontFamily:t.font}}]}function QY(e,t,n){switch(e.type){case`scatter`:case`bubble`:{if(!e.group)return{seriesIndex:0,dataIndex:n};let t=Nq(e,n),r=e.data.map((e,t)=>t).filter(n=>Nq(e,n)===t);return{seriesIndex:Iq(e).indexOf(t),dataIndex:r.indexOf(n)}}case`waterfall`:return{seriesIndex:2,dataIndex:n};case`sankey`:return{seriesIndex:0,dataIndex:n,dataType:`edge`,tip:!1};case`treemap`:{let t=1;for(let r of RY(e)){let e=r.rows.indexOf(n);if(e>=0)return{seriesIndex:0,dataIndex:t+1+e};t+=1+r.rows.length}return{seriesIndex:0,dataIndex:n}}case`gauge`:case`donut`:case`heatmap`:case`calendar`:case`funnel`:return{seriesIndex:0,dataIndex:n};default:return{seriesIndex:t,dataIndex:n}}}function $Y(e,t){switch(e.type){case`scatter`:case`bubble`:case`treemap`:{let e=LJ(t.data);return e==null?null:{series:0,row:e}}case`sankey`:return t.dataType===`edge`?{series:0,row:t.dataIndex}:null;case`waterfall`:return t.seriesIndex===2?{series:0,row:t.dataIndex}:null;case`line`:case`area`:case`column`:case`bar`:case`multiples`:return t.seriesIndex==null?null:{series:t.seriesIndex,row:t.dataIndex};default:return{series:0,row:t.dataIndex}}}var eX={donut:lY,heatmap:gY,calendar:wY,funnel:TY,gauge:EY,waterfall:LY,treemap:zY,sankey:VY,scatter:KY,bubble:KY,multiples:XY};function tX(e,t,n,r,{pixelRatio:i=2}={}){let a=document.createElement(`div`);a.style.cssText=`position:fixed;left:-10000px;top:0;width:${n.width}px;height:${n.height}px;`,document.body.append(a);let o=bj(a,null,{renderer:`canvas`,devicePixelRatio:i,width:n.width,height:n.height});try{return o.setOption(sY(e,t,n,{...r,renderer:`canvas`,animation:!1})),o.getDataURL({type:`png`,pixelRatio:i,backgroundColor:t.surface})}finally{o.dispose(),a.remove()}}function nX(e,{renderer:t}){let n=bj(e,null,{renderer:t}),r=!1,i=null;return{renderer:t,render(e,t,a,o,{replace:s=!1}={}){let c=r&&!s?RJ(n.getOption()):null,l=sY(e,t,a,{...o,zoom:c});i=e,n.setOption(l,s||!r?{notMerge:!0}:{replaceMerge:BJ}),r=!0},focusPoint(e,t){let{tip:r=!0,...a}=QY(zJ(i),e,t);n.dispatchAction({type:`downplay`}),n.dispatchAction({type:`highlight`,...a}),r&&n.dispatchAction({type:`showTip`,...a})},clearFocus(){n.dispatchAction({type:`hideTip`}),n.dispatchAction({type:`downplay`})},resize(){n.resize()},flush(){n.getZr().flush()},onSelect(e){n.on(`click`,t=>{if(t.componentType!==`series`)return;let n=$Y(zJ(i),t);n&&e({seriesIndex:n.series,dataIndex:n.row})})},onFinished(e){n.on(`finished`,e)},dispose(){n.dispose()}}}var rX=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(rX);var iX=HTMLElement,aX=(e,t)=>Object.getOwnPropertyDescriptor(e,t)!==void 0;function oX(e){return e.key===`Enter`&&e.isComposing!==!0&&e.keyCode!==229}function sX(e){return getComputedStyle(e).direction===`rtl`}function cX(e,t){return t?e===`ArrowRight`?`ArrowLeft`:e===`ArrowLeft`?`ArrowRight`:e:e}var lX=()=>jG(`chart`,MK),uX=`wui-chart:select`,dX=`wui-chart:legend-change`,fX=`wui-chart:ready`,pX=[`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`,`Escape`],mX=`(prefers-color-scheme: dark)`,hX=`(prefers-reduced-motion: reduce)`,gX=`(forced-colors: active)`,_X=`(prefers-contrast: more)`,vX=`print`,yX=e=>typeof window.matchMedia==`function`?window.matchMedia(e):null,bX=!1,xX=new Map;function SX(e,t){let n=[...new Set(t)].filter(e=>e&&!xX.has(e));if(!n.length)return;let r=document.createElement(`span`);r.hidden=!0;let i=n.map(e=>{let t=document.createElement(`span`);return t.style.setProperty(`forced-color-adjust`,`none`),t.style.color=e,r.append(t),[e,t]});e.append(r);for(let[e,t]of i)xX.set(e,getComputedStyle(t).color);r.remove()}var CX=[...[1,2,3,4,5,6,7,8].map(e=>`--color-chart-${e}`),...[0,1,2,3,4,5,6].map(e=>`--color-chart-seq-${e}`),`--color-chart-neutral`,`--wui-chart-rise`,`--wui-chart-fall`,`--color-chart-grid`,`--color-chart-axis`,`--color-chart-label`,`--color-surface`,`--color-text`,`--color-text-body`,`--color-text-muted`];function wX(e){let t=getComputedStyle(e),n=!!yX(gX)?.matches,r=e=>t.getPropertyValue(e).trim();n&&SX(e,CX.map(r));let i=e=>n?xX.get(r(e))??r(e):r(e),a=e.closest(`[data-bs-theme], [data-theme]`)??document.documentElement,o=a.getAttribute(`data-bs-theme`)||a.getAttribute(`data-theme`),s={palette:[1,2,3,4,5,6,7,8].map(e=>i(`--color-chart-${e}`)),seq:[0,1,2,3,4,5,6].map(e=>i(`--color-chart-seq-${e}`)),neutral:i(`--color-chart-neutral`),rise:i(`--wui-chart-rise`),fall:i(`--wui-chart-fall`),grid:i(`--color-chart-grid`),axis:i(`--color-chart-axis`),label:i(`--color-chart-label`),surface:i(`--color-surface`),text:i(`--color-text`),textBody:i(`--color-text-body`),textMuted:i(`--color-text-muted`),shadow:r(`--wui-shadow-popover`),font:t.fontFamily,dark:o===`dark`||o===`auto`&&!!yX(mX)?.matches,reducedMotion:!!yX(hX)?.matches};return!s.palette[0]&&!bX&&(bX=!0,bG(`[@webority/ui-elements] <wui-chart> found no --color-chart-* colours: load @webority/theme on the page.`)),s}var TX=new Set,EX=null;function DX(e){if(TX.add(e),EX)return;let t=()=>{xX.clear();for(let e of TX)e._themeChanged()},n=()=>{xX.clear();for(let e of TX)e._themeChanged(!0)},r=new MutationObserver(t);r.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`,`data-bs-theme`,`class`]});let i=new MutationObserver(t);i.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:[`data-theme`,`data-bs-theme`]});let a=[[mX,t],[hX,t],[gX,t],[_X,t],[vX,n]],o=[];for(let[e,t]of a){let n=yX(e);n&&o.push([n,t])}for(let[e,t]of o)e.addEventListener?.(`change`,t);window.addEventListener(`beforeprint`,n),window.addEventListener(`afterprint`,t),EX=()=>{r.disconnect(),i.disconnect();for(let[e,t]of o)e.removeEventListener?.(`change`,t);window.removeEventListener(`beforeprint`,n),window.removeEventListener(`afterprint`,t),EX=null}}function OX(e){TX.delete(e),TX.size||EX?.()}function kX(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.append(n),n.click(),n.remove()}var AX=0,jX=class extends iX{uid;_spec;_normal;_hidden;_focus;_awaitingSpec=!1;_parts=null;_theme=null;_width=null;_visible=!1;_resizeObserver=null;_intersection=null;_engine=null;_drawn=!1;_drawnType=null;_announcedReady=!1;_legendSignature=null;_tableSpec=null;static get observedAttributes(){return[`view`]}constructor(){super(),AX+=1,this.uid=`wui-chart-${AX}`,this._spec=null,this._normal=null,this._hidden=new Set,this._focus=null}get spec(){return this._spec}set spec(e){this._spec=e??null,this._normal=null,this._clearFocus(),this._parts&&this._update()}get view(){return this.getAttribute(`view`)===`table`?`table`:`chart`}set view(e){this.setAttribute(`view`,String(e??`chart`))}connectedCallback(){if(aX(this,`spec`)){let e=this.spec;delete this.spec,this._spec=e??null}if(this._spec??=this._readScript(),this._spec==null&&!this.querySelector(`:scope > script[type='application/json']`)&&(this._awaitingSpec=!0,queueMicrotask(()=>{this._awaitingSpec=!1,this._parts&&this._update()})),this._build(),DX(this),this._theme=wX(this),this._width=this.clientWidth,this._resizeObserver=new ResizeObserver(()=>this._resized()),this._resizeObserver.observe(this),typeof IntersectionObserver==`function`){this._visible=!1;let e=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&(e.disconnect(),this._visible=!0,this._update())},{threshold:.05});this._intersection=e,e.observe(this)}else this._visible=!0;this._update()}disconnectedCallback(){OX(this),this._resizeObserver?.disconnect(),this._intersection?.disconnect(),this._engine?.dispose(),this._engine=null,this._drawn=!1,this._parts=null,this.removeAttribute(`data-ready`)}attributeChangedCallback(e,t,n){t!==n&&this._parts&&(xq(`view`,n,RK),this._update())}toCsv(){let{spec:e}=this._normalized();return e?mJ(e):``}toPng(){let{spec:e}=this._normalized();return e?tX(e,this._theme??wX(this),this._size(e),{hidden:this._hidden,renderer:Rq(e)}):``}exportCsv(e){let t=URL.createObjectURL(new Blob([this.toCsv()],{type:`text/csv;charset=utf-8`}));kX(t,e??`${hJ(this._normalized().spec)}.csv`),setTimeout(()=>URL.revokeObjectURL(t),2e3)}exportPng(e){let t=this.toPng();t&&kX(t,e??`${hJ(this._normalized().spec)}.png`)}_readScript(){let e=this.querySelector(`:scope > script[type="application/json"]`);if(!(e instanceof HTMLScriptElement))return null;try{return JSON.parse(String(e.textContent))}catch(e){return xG(`[@webority/ui-elements] <wui-chart> could not read its JSON spec:`,e instanceof Error?e.message:void 0),null}}_normalized(){return this._normal??=Tq(this._spec),this._normal}_build(){let e=CG(`div`,{class:`wui-chart-legend`});e.setAttribute(`role`,`group`),e.setAttribute(`aria-label`,lX().legendLabel),e.hidden=!0,e.addEventListener(`click`,e=>{let t=e.target instanceof Element?e.target.closest(`.wui-chart-legend-item`):null;t instanceof HTMLElement&&this._toggle(t.dataset.key)});let t=CG(`div`,{class:`wui-chart-surface`});t.tabIndex=0,t.setAttribute(`role`,`group`),t.setAttribute(`aria-roledescription`,lX().chartLabel),t.addEventListener(`keydown`,e=>this._onKey(e)),t.addEventListener(`blur`,()=>this._clearFocus());let n=CG(`div`,{class:`wui-chart-canvas`});n.setAttribute(`aria-hidden`,`true`),t.append(n);let r=CG(`div`,{class:`wui-chart-state`});r.setAttribute(`role`,`status`),r.hidden=!0;let i=CG(`div`,{class:`wui-chart-table-wrap visually-hidden`}),a=CG(`p`,{class:`visually-hidden`});a.id=`${this.uid}-summary`;let o=CG(`div`,{class:`visually-hidden`});o.setAttribute(`aria-live`,`polite`),this.replaceChildren(e,t,r,i,a,o),this.setAttribute(`role`,`figure`),this.setAttribute(`aria-describedby`,a.id),this._parts={legend:e,surface:t,canvas:n,state:r,tableWrap:i,summary:a,live:o},this._legendSignature=null,this._tableSpec=null}_size(e){return{width:this._parts?.surface.clientWidth||this.clientWidth||800,height:e.height}}_update(){if(!this._parts||this._awaitingSpec&&this._spec==null)return;let{spec:e,problem:t}=this._normalized(),n=this._parts,r=e===null?`error`:e.state===`ready`&&(!e.data.length||!jq(e))?`empty`:e.state,i=`${e?.height??320}px`,a=this.view===`table`,o=e!==null&&(r===`ready`||r===`loading`&&this._drawn),s=r===`loading`&&o;if(this.setAttribute(`aria-label`,e?.title||lX().untitledLabel),r===`loading`?this.setAttribute(`aria-busy`,`true`):this.removeAttribute(`aria-busy`),this.setAttribute(`data-state`,r),n.surface.setAttribute(`aria-label`,NG(lX().arrowKeysText,{title:e?.title||lX().untitledLabel})),n.summary.textContent=e?_J(e,this._hidden):``,e){if(!s){let t=new Set(zq(e));for(let e of this._hidden)t.has(e)||this._hidden.delete(e)}this._renderTable(e)}else n.tableWrap.replaceChildren();s||this._renderLegend(e,o&&!a),this._renderState(r,e===null?t:r===`error`?e.errorText:r===`loading`?e.loadingText??lX().loadingText:e.emptyText,i,o);let c=r===`ready`&&!a;s||this.toggleAttribute(`data-ready`,!c);let l=n.surface.hidden&&o&&!a;n.surface.hidden=!o||a,n.surface.style.height=i,n.tableWrap.className=a&&e?`wui-chart-table-wrap`:`wui-chart-table-wrap visually-hidden`,n.tableWrap.style.height=a&&e?i:``,a&&e?(n.tableWrap.tabIndex=0,n.tableWrap.setAttribute(`role`,`region`),n.tableWrap.setAttribute(`aria-label`,`${e.title||lX().untitledLabel} ${lX().dataSuffixLabel}`)):(n.tableWrap.removeAttribute(`tabindex`),n.tableWrap.removeAttribute(`role`),n.tableWrap.removeAttribute(`aria-label`)),l&&this._engine?.resize(),r===`ready`&&!a&&this._visible&&this._draw()}_renderState(e,t,n,r){let i=this._parts?.state;if(!i)return;let a=!r&&e!==`ready`;i.hidden=!a,a?(i.style.height=n,e===`loading`?i.replaceChildren(CG(`div`,{class:`skeleton wui-chart-skeleton`}),CG(`span`,{class:`visually-hidden`},t)):i.replaceChildren(CG(`p`,{class:`wui-chart-state-text`},t))):i.replaceChildren()}_colour(e,t){let n=this._theme;if(!n)return;if(e.type===`donut`)return rJ(e,t,n);let r=e.series[t],i=e.type===`line`||e.type===`area`||e.type===`column`||e.type===`bar`;return n.palette[r&&i?sJ(r,t):t]}_renderLegend(e,t){let n=this._parts?.legend;if(!n)return;let r=e?zq(e):[],i=!!e&&t&&r.length>=2;if(n.hidden=!i,!e||!i)return;let a=Bq(e),o=r.map((t,n)=>this._colour(e,n)),s=JSON.stringify([e.type,r,a,o]);s!==this._legendSignature&&(this._legendSignature=s,n.replaceChildren(...r.map((t,n)=>{let r=CG(`button`,{class:`wui-chart-legend-item`});r.type=`button`,r.dataset.key=t;let i=CG(`span`,{class:e.type===`line`?`wui-chart-legend-swatch wui-chart-legend-swatch-line`:`wui-chart-legend-swatch`}),s=o[n];return s!==void 0&&(i.style.background=s),r.append(i,CG(`span`,{class:`wui-chart-legend-label`},a[n])),r})));for(let e of n.children){if(!(e instanceof HTMLElement))throw Error(`Expected a legend item to be an HTMLElement.`);let t=e.dataset.key;e.setAttribute(`aria-pressed`,String(t===void 0||!this._hidden.has(t)))}}_renderTable(e){if(this._tableSpec===e||!this._parts)return;this._tableSpec=e;let t=dJ(e),n=CG(`table`,{class:`wui-chart-table`});n.append(CG(`caption`,{class:`visually-hidden`},t.caption));let r=CG(`tr`);t.head.forEach((e,t)=>{let n=CG(`th`,t?{class:`wui-chart-num`}:null,e);n.scope=`col`,r.append(n)});let i=CG(`thead`);i.append(r),n.append(i);let a=CG(`tbody`);for(let e of t.rows){let t=CG(`tr`),n=CG(`th`,null,e.head);n.scope=`row`,t.append(n,...e.cells.map(e=>CG(`td`,{class:`wui-chart-num`},e))),a.append(t)}n.append(a);let o=[n];t.truncated&&o.push(CG(`p`,{class:`wui-chart-table-note`},NG(lX().showingFirstRowsDownloadText,{rows:t.rows.length,total:t.total}))),this._parts.tableWrap.replaceChildren(...o)}_draw(){let{spec:e}=this._normalized();if(!e||!this._parts||!this._theme)return;let t=Rq(e),n=e.type!==this._drawnType;this._engine&&this._engine.renderer!==t&&(this._engine.dispose(),this._engine=null);let r=`${e.height}px`,i=this._parts.canvas.style.height!==r;this._parts.canvas.style.height=r,i&&this._engine?.resize(),this._engine||(this._engine=nX(this._parts.canvas,{renderer:t}),this._engine.onSelect(({seriesIndex:e,dataIndex:t})=>this._select(e,t)),this._engine.onFinished(()=>{this.setAttribute(`data-ready`,``),this._announcedReady||(this._announcedReady=!0,this.dispatchEvent(new CustomEvent(fX,{bubbles:!0,detail:{renderer:t}})))}),n=!0),this._engine.render(e,this._theme,this._size(e),{hidden:this._hidden,renderer:t},{replace:n}),this._drawnType=e.type,this._drawn=!0}_themeChanged(e=!1){if(!this._parts)return;let t=wX(this);JSON.stringify(t)!==JSON.stringify(this._theme)&&(this._theme=t,this._update(),e&&this._engine?.flush())}_resized(){let e=this.clientWidth;e!==this._width&&(this._width=e,this._engine&&this._drawn&&this._parts&&(this._parts.surface.hidden||this._engine.resize(),this._update()))}_toggle(e){let{spec:t}=this._normalized();if(!t||e==null)return;this._hidden.has(e)?this._hidden.delete(e):this._hidden.add(e),this._clearFocus(),this._update();let n=Object.fromEntries(zq(t).map(e=>[e,!this._hidden.has(e)]));this.dispatchEvent(new CustomEvent(dX,{bubbles:!0,detail:{visible:n}}))}_onKey(e){let{spec:t}=this._normalized();if(!t||!this._engine||!this._theme||this.view===`table`||e.altKey||e.ctrlKey||e.metaKey)return;if(oX(e)){if(!this._focus)return;e.preventDefault(),this._select(this._focus.series,this._focus.index);return}if(!pX.includes(e.key)||e.key===`Escape`&&!this._focus)return;e.preventDefault();let n=EJ(t,this._focus,cX(e.key,sX(this)),this._hidden);n?(this._focus=n,this._engine.focusPoint(n.series,n.index),this._announce(lJ(iJ(t,n.index,this._hidden,this._theme)))):this._clearFocus()}_announce(e){let t=this._parts?.live;t&&(t.textContent=e===t.textContent?`${e} `:e)}_clearFocus(){this._focus&&(this._focus=null,this._engine?.clearFocus(),this._parts&&(this._parts.live.textContent=``))}_select(e,t){let{spec:n}=this._normalized();if(!n)return;let r=n.series[GK(n.type)?0:e];if(!r)return;let i=n.data[t]??null;this.dispatchEvent(new CustomEvent(uX,{bubbles:!0,detail:{series:r.key,label:r.label,x:i?.[n.x.key]??null,value:Q(n,r.key,t),row:i,index:t}}))}};return r(`wui-chart`,jX),e.CHART_STATES=LK,e.CHART_TYPES=NK,e.CHART_VIEWS=RK,e.MAX_SERIES=BK,e.MAX_SLICES=VK,e.RENDERERS=IK,e.STACK_MODES=PK,e.WuiChart=jX,e.X_KINDS=FK,e.formatValue=X,e.normalizeSpec=Tq,e})({});