q2-tecton-elements 1.23.0 → 1.24.0

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 (201) hide show
  1. package/dist/cjs/action-sheet-4b366e9a.js +84 -0
  2. package/dist/cjs/{index-0648c2ec.js → index-e00b4210.js} +28 -5
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/q2-action-sheet.cjs.entry.js +218 -0
  5. package/dist/cjs/q2-badge_2.cjs.entry.js +1 -1
  6. package/dist/cjs/q2-btn_2.cjs.entry.js +1 -1
  7. package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
  8. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
  10. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  11. package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
  12. package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
  13. package/dist/cjs/q2-chart-donut.cjs.entry.js +1 -1
  14. package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
  15. package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
  16. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  17. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  18. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  19. package/dist/cjs/q2-icon.cjs.entry.js +1 -1
  20. package/dist/cjs/q2-loc.cjs.entry.js +1 -1
  21. package/dist/cjs/q2-message.cjs.entry.js +1 -1
  22. package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
  23. package/dist/cjs/q2-optgroup_2.cjs.entry.js +93 -0
  24. package/dist/cjs/q2-option-list_2.cjs.entry.js +226 -86
  25. package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
  26. package/dist/cjs/q2-pill.cjs.entry.js +57 -18
  27. package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
  28. package/dist/cjs/q2-radio.cjs.entry.js +1 -1
  29. package/dist/cjs/q2-section.cjs.entry.js +1 -1
  30. package/dist/cjs/q2-select.cjs.entry.js +148 -409
  31. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  32. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +1 -1
  33. package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
  34. package/dist/cjs/q2-tab-container.cjs.entry.js +1 -1
  35. package/dist/cjs/q2-tag.cjs.entry.js +21 -6
  36. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  37. package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
  38. package/dist/collection/collection-manifest.json +1 -0
  39. package/dist/collection/components/q2-action-sheet/index.js +345 -0
  40. package/dist/collection/components/q2-action-sheet/styles.css +215 -0
  41. package/dist/collection/components/q2-checkbox/index.js +2 -2
  42. package/dist/collection/components/q2-dropdown/index.js +1 -1
  43. package/dist/collection/components/q2-loading/index.js +1 -1
  44. package/dist/collection/components/q2-optgroup/styles.css +2 -2
  45. package/dist/collection/components/q2-option/index.js +1 -56
  46. package/dist/collection/components/q2-option/styles.css +7 -0
  47. package/dist/collection/components/q2-option-list/index.js +290 -102
  48. package/dist/collection/components/q2-pill/index.js +79 -18
  49. package/dist/collection/components/q2-pill/styles.css +1 -2
  50. package/dist/collection/components/q2-popover/index.js +17 -3
  51. package/dist/collection/components/q2-popover/styles.css +10 -67
  52. package/dist/collection/components/q2-radio/index.js +2 -2
  53. package/dist/collection/components/q2-select/index.js +179 -427
  54. package/dist/collection/components/q2-select/styles.css +5 -11
  55. package/dist/collection/components/q2-tag/index.js +38 -5
  56. package/dist/collection/utils/action-sheet.js +79 -0
  57. package/dist/collection/utils/index.js +26 -5
  58. package/dist/components/action-sheet.js +81 -0
  59. package/dist/components/index.d.ts +1 -0
  60. package/dist/components/index.js +1 -0
  61. package/dist/components/index10.js +1 -1
  62. package/dist/components/index11.js +42 -353
  63. package/dist/components/index12.js +44 -99
  64. package/dist/components/index13.js +495 -583
  65. package/dist/components/index14.js +137 -0
  66. package/dist/components/index15.js +626 -0
  67. package/dist/components/index5.js +1 -1
  68. package/dist/components/index6.js +1 -1
  69. package/dist/components/index7.js +1 -1
  70. package/dist/components/index8.js +1 -1
  71. package/dist/components/index9.js +2 -2
  72. package/dist/components/q2-action-sheet.d.ts +11 -0
  73. package/dist/components/q2-action-sheet.js +282 -0
  74. package/dist/components/q2-calendar.js +1 -1
  75. package/dist/components/q2-card.js +1 -1
  76. package/dist/components/q2-carousel-pane.js +1 -1
  77. package/dist/components/q2-carousel.js +1 -1
  78. package/dist/components/q2-chart-area.js +1 -1
  79. package/dist/components/q2-chart-bar.js +1 -1
  80. package/dist/components/q2-chart-donut.js +1 -1
  81. package/dist/components/q2-checkbox-group.js +1 -1
  82. package/dist/components/q2-checkbox.js +1 -1
  83. package/dist/components/q2-dropdown.js +2 -2
  84. package/dist/components/q2-editable-field.js +1 -1
  85. package/dist/components/q2-loc.js +1 -1
  86. package/dist/components/q2-month-picker.js +1 -1
  87. package/dist/components/q2-optgroup.js +1 -70
  88. package/dist/components/q2-option-list.js +1 -1
  89. package/dist/components/q2-option.js +1 -76
  90. package/dist/components/q2-pagination.js +1 -1
  91. package/dist/components/q2-pill.js +62 -21
  92. package/dist/components/q2-popover.js +1 -1
  93. package/dist/components/q2-radio-group.js +1 -1
  94. package/dist/components/q2-radio.js +3 -3
  95. package/dist/components/q2-section.js +1 -1
  96. package/dist/components/q2-select.js +179 -427
  97. package/dist/components/q2-stepper-pane.js +1 -1
  98. package/dist/components/q2-stepper-vertical.js +1 -1
  99. package/dist/components/q2-stepper.js +1 -1
  100. package/dist/components/q2-tab-container.js +1 -1
  101. package/dist/components/q2-tag.js +24 -8
  102. package/dist/components/q2-textarea.js +1 -1
  103. package/dist/esm/action-sheet-a9597b32.js +81 -0
  104. package/dist/esm/{index-501fd22e.js → index-ca21e539.js} +27 -6
  105. package/dist/esm/loader.js +1 -1
  106. package/dist/esm/q2-action-sheet.entry.js +214 -0
  107. package/dist/esm/q2-badge_2.entry.js +1 -1
  108. package/dist/esm/q2-btn_2.entry.js +1 -1
  109. package/dist/esm/q2-calendar.entry.js +1 -1
  110. package/dist/esm/q2-card.entry.js +1 -1
  111. package/dist/esm/q2-carousel-pane.entry.js +1 -1
  112. package/dist/esm/q2-carousel.entry.js +1 -1
  113. package/dist/esm/q2-chart-area.entry.js +1 -1
  114. package/dist/esm/q2-chart-bar.entry.js +1 -1
  115. package/dist/esm/q2-chart-donut.entry.js +1 -1
  116. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  117. package/dist/esm/q2-checkbox.entry.js +1 -1
  118. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  119. package/dist/esm/q2-dropdown.entry.js +1 -1
  120. package/dist/esm/q2-editable-field.entry.js +1 -1
  121. package/dist/esm/q2-icon.entry.js +1 -1
  122. package/dist/esm/q2-loc.entry.js +1 -1
  123. package/dist/esm/q2-message.entry.js +1 -1
  124. package/dist/esm/q2-month-picker.entry.js +1 -1
  125. package/dist/esm/q2-optgroup_2.entry.js +88 -0
  126. package/dist/esm/q2-option-list_2.entry.js +226 -86
  127. package/dist/esm/q2-pagination.entry.js +1 -1
  128. package/dist/esm/q2-pill.entry.js +57 -18
  129. package/dist/esm/q2-radio-group.entry.js +1 -1
  130. package/dist/esm/q2-radio.entry.js +1 -1
  131. package/dist/esm/q2-section.entry.js +1 -1
  132. package/dist/esm/q2-select.entry.js +148 -409
  133. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  134. package/dist/esm/q2-stepper-vertical.entry.js +1 -1
  135. package/dist/esm/q2-stepper.entry.js +1 -1
  136. package/dist/esm/q2-tab-container.entry.js +1 -1
  137. package/dist/esm/q2-tag.entry.js +21 -6
  138. package/dist/esm/q2-tecton-elements.js +1 -1
  139. package/dist/esm/q2-textarea.entry.js +1 -1
  140. package/dist/q2-tecton-elements/{p-3e9a30c4.entry.js → p-0473f4f7.entry.js} +1 -1
  141. package/dist/q2-tecton-elements/{p-5b1aba1a.entry.js → p-13a1390b.entry.js} +1 -1
  142. package/dist/q2-tecton-elements/{p-ebd7efa5.entry.js → p-13deb3ed.entry.js} +1 -1
  143. package/dist/q2-tecton-elements/{p-45d61789.entry.js → p-1d854203.entry.js} +1 -1
  144. package/dist/q2-tecton-elements/p-1f71774f.entry.js +1 -0
  145. package/dist/q2-tecton-elements/{p-6b7e1ebd.entry.js → p-256d3fe6.entry.js} +1 -1
  146. package/dist/q2-tecton-elements/{p-8dea9a0c.entry.js → p-282f0f8c.entry.js} +1 -1
  147. package/dist/q2-tecton-elements/{p-3603fcdc.entry.js → p-30969629.entry.js} +1 -1
  148. package/dist/q2-tecton-elements/p-30cd888b.entry.js +1 -0
  149. package/dist/q2-tecton-elements/{p-3fd5d010.entry.js → p-37cf9c97.entry.js} +1 -1
  150. package/dist/q2-tecton-elements/{p-53be87c8.entry.js → p-388349b5.entry.js} +1 -1
  151. package/dist/q2-tecton-elements/p-5589ae0f.entry.js +1 -0
  152. package/dist/q2-tecton-elements/{p-604b22a8.entry.js → p-619aed74.entry.js} +1 -1
  153. package/dist/q2-tecton-elements/{p-d68b5eb3.entry.js → p-63b67260.entry.js} +1 -1
  154. package/dist/q2-tecton-elements/{p-ba73ee1f.entry.js → p-63e363ad.entry.js} +1 -1
  155. package/dist/q2-tecton-elements/{p-d7b27803.entry.js → p-6736df05.entry.js} +1 -1
  156. package/dist/q2-tecton-elements/p-72fe10cc.entry.js +1 -0
  157. package/dist/q2-tecton-elements/{p-68ef0786.entry.js → p-75b817c6.entry.js} +1 -1
  158. package/dist/q2-tecton-elements/{p-a2add94e.entry.js → p-7a116095.entry.js} +1 -1
  159. package/dist/q2-tecton-elements/{p-d88e4383.entry.js → p-7c94119b.entry.js} +1 -1
  160. package/dist/q2-tecton-elements/{p-24f4571d.entry.js → p-90572e43.entry.js} +1 -1
  161. package/dist/q2-tecton-elements/p-91153c61.entry.js +1 -0
  162. package/dist/q2-tecton-elements/{p-70b01387.entry.js → p-9792de8a.entry.js} +1 -1
  163. package/dist/q2-tecton-elements/p-9acfa94e.js +1 -0
  164. package/dist/q2-tecton-elements/p-a1926e65.js +1 -0
  165. package/dist/q2-tecton-elements/{p-d27b2caa.entry.js → p-b3a8cdc5.entry.js} +1 -1
  166. package/dist/q2-tecton-elements/{p-9b101e22.entry.js → p-ce3f203c.entry.js} +1 -1
  167. package/dist/q2-tecton-elements/{p-bf41e71b.entry.js → p-ce91cd9b.entry.js} +1 -1
  168. package/dist/q2-tecton-elements/{p-18629cbf.entry.js → p-cefc9d0b.entry.js} +1 -1
  169. package/dist/q2-tecton-elements/p-d05beeb7.entry.js +1 -0
  170. package/dist/q2-tecton-elements/{p-6be86940.entry.js → p-dc7c8371.entry.js} +1 -1
  171. package/dist/q2-tecton-elements/{p-acc77332.entry.js → p-e58581fc.entry.js} +1 -1
  172. package/dist/q2-tecton-elements/{p-38a33baa.entry.js → p-e886c55b.entry.js} +1 -1
  173. package/dist/q2-tecton-elements/{p-7aa80653.entry.js → p-f94e7043.entry.js} +1 -1
  174. package/dist/q2-tecton-elements/{p-78fac0fa.entry.js → p-fcb7d191.entry.js} +1 -1
  175. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  176. package/dist/test/helpers.js +3 -2
  177. package/dist/types/components/q2-action-sheet/index.d.ts +52 -0
  178. package/dist/types/components/q2-checkbox/index.d.ts +4 -1
  179. package/dist/types/components/q2-option/index.d.ts +0 -3
  180. package/dist/types/components/q2-option-list/index.d.ts +16 -8
  181. package/dist/types/components/q2-pill/index.d.ts +10 -1
  182. package/dist/types/components/q2-popover/index.d.ts +2 -0
  183. package/dist/types/components/q2-select/index.d.ts +45 -47
  184. package/dist/types/components/q2-tag/index.d.ts +3 -2
  185. package/dist/types/components.d.ts +42 -13
  186. package/dist/types/global.d.ts +9 -2
  187. package/dist/types/utils/action-sheet.d.ts +12 -0
  188. package/dist/types/utils/index.d.ts +3 -1
  189. package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
  190. package/package.json +3 -2
  191. package/dist/cjs/q2-optgroup.cjs.entry.js +0 -56
  192. package/dist/cjs/q2-option.cjs.entry.js +0 -46
  193. package/dist/esm/q2-optgroup.entry.js +0 -52
  194. package/dist/esm/q2-option.entry.js +0 -42
  195. package/dist/q2-tecton-elements/p-2c20fc43.entry.js +0 -1
  196. package/dist/q2-tecton-elements/p-3813f51d.entry.js +0 -1
  197. package/dist/q2-tecton-elements/p-a510290a.js +0 -1
  198. package/dist/q2-tecton-elements/p-ba76ecfd.entry.js +0 -1
  199. package/dist/q2-tecton-elements/p-bbdae095.entry.js +0 -1
  200. package/dist/q2-tecton-elements/p-f1d06917.entry.js +0 -1
  201. package/dist/q2-tecton-elements/p-f6e868c1.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as e,h as i,g as n}from"./p-926a3e80.js";import{o,l as r,i as a}from"./p-a510290a.js";import{bn as s,V as l,_ as c,av as h,bo as u,bp as d,bq as f,x as v,b2 as p,a0 as m,br as b,I as g,bs as y,aJ as x,bt as w,bu as S,j as T,bv as M,E as C,bw as I,bx as k,by as z,bz as A,d as D,bA as N,bB as O,bC as L,bD as U,bE as B,bF as R,bG as P,bH as W,bI as F,bJ as Y,bK as j,D as G,bg as H,aH as X,bL as E,aY as _,bM as K,bN as q,bO as J,bP as Z,a as $,a9 as V,aZ as Q,bQ as tt,ax as et,bR as it,a6 as nt,m as ot,a5 as rt,o as at,y as st,bS as lt,bT as ct,b as ht,bU as ut,a$ as dt,bV as ft,bW as vt,bX as pt,c as mt,af as bt,G as gt,ay as yt,b3 as xt,az as wt,bY as St,a_ as Tt,u as Mt,at as Ct,W as It,bj as kt,bZ as zt,i as At,s as Dt,z as Nt,t as Ot,g as Lt,bb as Ut,b_ as Bt,U as Rt,b5 as Pt,C as Wt,ah as Ft,aj as Yt,a3 as jt,b$ as Gt,c0 as Ht,c1 as Xt,S as Et,c2 as _t,aa as Kt,ac as qt,ab as Jt}from"./p-52063431.js";import{l as Zt,a as $t,s as Vt,g as Qt,i as te}from"./p-833398d1.js";var ee=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return c(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(h);function ie(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function ne(t){if(d.domSupported)for(var e=document.documentElement.style,i=0,n=t.length;i<n;i++)if(t[i]in e)return t[i]}var oe=ne(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function re(t,e){if(!t)return e;e=u(e,!0);var i=t.indexOf(e);return(t=-1===i?e:"-"+t.slice(0,i)+"-"+e).toLowerCase()}var ae=re(ne(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),se=re(oe,"transform"),le="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(d.transform3dSupported?"will-change:transform;":"");function ce(t,e,i){var n=t.toFixed(0)+"px",o=e.toFixed(0)+"px";if(!d.transformSupported)return i?"top:"+o+";left:"+n+";":[["top",o],["left",n]];var r=d.transform3dSupported,a="translate"+(r?"3d":"")+"("+n+","+o+(r?",0":"")+")";return i?"top:0;left:0;"+se+":"+a+";":[["top",0],["left",0],[oe,a]]}function he(t,e,i,n,o){var r=e&&e.painter;if(i){var a=r&&r.getViewportRoot();a&&S(t,a,document.body,n,o)}else{t[0]=n,t[1]=o;var s=r&&r.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var ue=function(){function t(t,e,i){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._firstShow=!0,this._longHide=!0,d.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var o=this._zr=e.getZr(),r=this._appendToBody=i&&i.appendToBody;he(this._styleCoord,o,r,e.getWidth()/2,e.getHeight()/2),r?document.body.appendChild(n):t.appendChild(n),this._container=t;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=o.handler,i=o.painter.getViewportRoot();f(i,t,!0),e.dispatch("mousemove",t)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return t.prototype.update=function(t){var e,i,n,o=this._container,r=(i="position",(n=(e=o).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(e))?n[i]:null),a=o.style;"absolute"!==a.position&&"absolute"!==r&&(a.position="relative"),t.get("alwaysShowContent")&&this._moveIfResized(),this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,o=this._styleCoord;i.innerHTML?n.cssText=le+function(t,e,i){var n=[],o=t.get("transitionDuration"),r=t.get("backgroundColor"),a=t.get("shadowBlur"),l=t.get("shadowColor"),c=t.get("shadowOffsetX"),h=t.get("shadowOffsetY"),f=t.getModel("textStyle"),v=w(t,"html");return n.push("box-shadow:"+c+"px "+h+"px "+a+"px "+l),e&&o&&n.push(function(t,e){var i="cubic-bezier(0.23,1,0.32,1)",n=" "+t/2+"s "+i,o="opacity"+n+",visibility"+n;return e||(n=" "+t+"s "+i,o+=d.transformSupported?","+se+n:",left"+n+",top"+n),ae+":"+o}(o,i)),r&&n.push("background-color:"+r),g(["width","color","radius"],(function(e){var i="border-"+e,o=u(i),r=t.get(o);null!=r&&n.push(i+":"+r+("color"===e?"":"px"))})),n.push(function(t){var e=[],i=t.get("fontSize"),n=t.getTextColor();n&&e.push("color:"+n),e.push("font:"+t.getFont()),i&&e.push("line-height:"+Math.round(3*i/2)+"px");var o=t.get("textShadowColor"),r=t.get("textShadowBlur")||0,a=t.get("textShadowOffsetX")||0,s=t.get("textShadowOffsetY")||0;return o&&r&&e.push("text-shadow:"+a+"px "+s+"px "+r+"px "+o),g(["decoration","align"],(function(i){var n=t.get(i);n&&e.push("text-"+i+":"+n)})),e.join(";")}(f)),null!=v&&n.push("padding:"+s(v).join("px ")+"px"),n.join(";")+";"}(t,!this._firstShow,this._longHide)+ce(o[0],o[1],!0)+"border-color:"+v(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,i,n,o){var r=this.el;if(null!=t){var a="";if(p(o)&&"item"===i.get("trigger")&&!ie(i)&&(a=function(t,e,i){if(!p(i)||"inside"===i)return"";var n=t.get("backgroundColor"),o=t.get("borderWidth");e=v(e);var r,a,s="left"===(r=i)?"right":"right"===r?"left":"top"===r?"bottom":"top",l=Math.max(1.5*Math.round(o),6),c="",h=se+":";x(["left","right"],s)>-1?(c+="top:50%",h+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(c+="left:50%",h+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var u=a*Math.PI/180,d=l+o,f=d*Math.abs(Math.cos(u))+d*Math.abs(Math.sin(u)),m=e+" solid "+o+"px;";return'<div style="'+["position:absolute;width:"+l+"px;height:"+l+"px;z-index:-1;",(c+=";"+s+":-"+Math.round(100*((f-Math.SQRT2*o)/2+Math.SQRT2*o-(f-d)/2))/100+"px")+";"+h+";","border-bottom:"+m,"border-right:"+m,"background-color:"+n+";"].join("")+'"></div>'}(i,n,o)),p(t))r.innerHTML=t+a;else if(t){r.innerHTML="",m(t)||(t=[t]);for(var s=0;s<t.length;s++)b(t[s])&&t[s].parentNode!==r&&r.appendChild(t[s]);if(a&&r.childNodes.length){var l=document.createElement("div");l.innerHTML=a,r.appendChild(l)}}}else r.innerHTML=""},t.prototype.setEnterable=function(t){this._enterable=t},t.prototype.getSize=function(){var t=this.el;return[t.offsetWidth,t.offsetHeight]},t.prototype.moveTo=function(t,e){var i=this._styleCoord;if(he(i,this._zr,this._appendToBody,t,e),null!=i[0]&&null!=i[1]){var n=this.el.style,o=ce(i[0],i[1]);g(o,(function(t){n[t[0]]=t[1]}))}},t.prototype._moveIfResized=function(){var t=this._styleCoord[3];this.moveTo(this._styleCoord[2]*this._zr.getWidth(),t*this._zr.getHeight())},t.prototype.hide=function(){var t=this,e=this.el.style;e.visibility="hidden",e.opacity="0",d.transform3dSupported&&(e.willChange=""),this._show=!1,this._longHideTimeout=setTimeout((function(){return t._longHide=!0}),500)},t.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(y(this.hide,this),t)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this.el.parentNode.removeChild(this.el)},t}(),de=function(){function t(t){this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._zr=t.getZr(),pe(this._styleCoord,this._zr,t.getWidth()/2,t.getHeight()/2)}return t.prototype.update=function(t){t.get("alwaysShowContent")&&this._moveIfResized()},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},t.prototype.setContent=function(t,e,i,n){var o=this;T(t)&&M(""),this.el&&this._zr.remove(this.el);var r=i.getModel("textStyle");this.el=new C({style:{rich:e.richTextStyles,text:t,lineHeight:22,borderWidth:1,borderColor:n,textShadowColor:r.get("textShadowColor"),fill:i.get(["textStyle","color"]),padding:w(i,"richText"),verticalAlign:"top",align:"left"},z:i.get("z")}),g(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],(function(t){o.el.style[t]=i.get(t)})),g(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],(function(t){o.el.style[t]=r.get(t)||0})),this._zr.add(this.el);var a=this;this.el.on("mouseover",(function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0})),this.el.on("mouseout",(function(){a._enterable&&a._show&&a.hideLater(a._hideDelay),a._inContent=!1}))},t.prototype.setEnterable=function(t){this._enterable=t},t.prototype.getSize=function(){var t=this.el,e=this.el.getBoundingRect(),i=ve(t.style);return[e.width+i.left+i.right,e.height+i.top+i.bottom]},t.prototype.moveTo=function(t,e){var i=this.el;if(i){var n=this._styleCoord;pe(n,this._zr,t,e),t=n[0],e=n[1];var o=i.style,r=fe(o.borderWidth||0),a=ve(o);i.x=t+r+a.left,i.y=e+r+a.top,i.markRedraw()}},t.prototype._moveIfResized=function(){var t=this._styleCoord[3];this.moveTo(this._styleCoord[2]*this._zr.getWidth(),t*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(y(this.hide,this),t)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t}();function fe(t){return Math.max(0,t)}function ve(t){var e=fe(t.shadowBlur||0),i=fe(t.shadowOffsetX||0),n=fe(t.shadowOffsetY||0);return{left:fe(e-i),right:fe(e+i),top:fe(e-n),bottom:fe(e+n)}}function pe(t,e,i,n){t[0]=i,t[1]=n,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var me=new l({shape:{x:-1,y:-1,width:2,height:2}}),be=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return c(e,t),e.prototype.init=function(t,e){if(!d.node&&e.getDom()){var i=t.getComponent("tooltip"),n=this._renderMode=I(i.get("renderMode"));this._tooltipContent="richText"===n?new de(e):new ue(e.getDom(),e,{appendToBody:i.get("appendToBody",!0)})}},e.prototype.render=function(t,e,i){if(!d.node&&i.getDom()){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=i,this._alwaysShowContent=t.get("alwaysShowContent");var n=this._tooltipContent;n.update(t),n.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow(),"richText"!==this._renderMode&&t.get("transitionDuration")?k(this,"_updatePosition",50,"fixRate"):z(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var t=this._tooltipModel.get("triggerOn");A("itemTooltip",this._api,y((function(e,i,n){"none"!==t&&(t.indexOf(e)>=0?this._tryShow(i,n):"leave"===e&&this._hide(n))}),this))},e.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,i=this._api,n=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==n&&"click"!==n){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!i.isDisposed()&&o.manuallyShowTip(t,e,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})}))}},e.prototype.manuallyShowTip=function(t,e,i,n){if(n.from!==this.uid&&!d.node&&i.getDom()){var o=ye(n,i);this._ticket="";var r=n.dataByCoordSys,a=function(t,e,i){var n=q(t).queryOptionMap,o=n.keys()[0];if(o&&"series"!==o){var r,a=J(e,o,n.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a)return i.getViewOfComponentModel(a).group.traverse((function(e){var i=D(e).tooltipConfig;if(i&&i.name===t.name)return r=e,!0})),r?{componentMainType:o,componentIndex:a.componentIndex,el:r}:void 0}}(n,e,i);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:n.position,positionDefault:"bottom"},o)}else if(n.tooltip&&null!=n.x&&null!=n.y){var l=me;l.x=n.x,l.y=n.y,l.update(),D(l).tooltipConfig={name:null,option:n.tooltip},this._tryShow({offsetX:n.x,offsetY:n.y,target:l},o)}else if(r)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,dataByCoordSys:r,tooltipOption:n.tooltipOption},o);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(t,e,i,n))return;var c=N(n,e),h=c.point[0],u=c.point[1];null!=h&&null!=u&&this._tryShow({offsetX:h,offsetY:u,target:c.el,position:n.position,positionDefault:"bottom"},o)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target},o))}},e.prototype.manuallyHideTip=function(t,e,i,n){!this._alwaysShowContent&&this._tooltipModel&&this._tooltipContent.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,n.from!==this.uid&&this._hide(ye(n,i))},e.prototype._manuallyAxisShowTip=function(t,e,i,n){var o=n.seriesIndex,r=n.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=r&&null!=a){var s=e.getSeriesByIndex(o);if(s&&"axis"===ge([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:r,position:n.position}),!0}},e.prototype._tryShow=function(t,e){var i=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var n=t.dataByCoordSys;if(n&&n.length)this._showAxisTooltip(n,t);else if(i){var o,r;this._lastDataByCoordSys=null,O(i,(function(t){return null!=D(t).dataIndex?(o=t,!0):null!=D(t).tooltipConfig?(r=t,!0):void 0}),!0),o?this._showSeriesItemTooltip(t,o,e):r?this._showComponentItemTooltip(t,r,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},e.prototype._showOrMove=function(t,e){var i=t.get("showDelay");e=y(e,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(e,i):e()},e.prototype._showAxisTooltip=function(t,e){var i=this._ecModel,n=this._tooltipModel,o=[e.offsetX,e.offsetY],r=ge([e.tooltipOption],n),a=this._renderMode,s=[],l=L("section",{blocks:[],noHeader:!0}),c=[],h=new Z;g(t,(function(t){g(t.dataByAxis,(function(t){var e=i.getComponent(t.axisDim+"Axis",t.axisIndex),o=t.value;if(e&&null!=o){var r=U(o,e.axis,i,t.seriesDataIndices,t.valueLabelOpt),u=L("section",{header:r,noHeader:!B(r),sortBlocks:!0,blocks:[]});l.blocks.push(u),g(t.seriesDataIndices,(function(l){var d=i.getSeriesByIndex(l.seriesIndex),f=l.dataIndexInside,p=d.getDataParams(f);if(!(p.dataIndex<0)){p.axisDim=t.axisDim,p.axisIndex=t.axisIndex,p.axisType=t.axisType,p.axisId=t.axisId,p.axisValue=R(e.axis,{value:o}),p.axisValueLabel=r,p.marker=h.makeTooltipMarker("item",v(p.color),a);var m=P(d.formatTooltip(f,!0,null)),b=m.frag;if(b){var g=ge([d],n).get("valueFormatter");u.blocks.push(g?$({valueFormatter:g},b):b)}m.text&&c.push(m.text),s.push(p)}}))}}))})),l.blocks.reverse(),c.reverse();var u=e.position,d=r.get("order"),f=W(l,h,a,d,i.get("useUTC"),r.get("textStyle"));f&&c.unshift(f);var p=c.join("richText"===a?"\n\n":"<br/>");this._showOrMove(r,(function(){this._updateContentNotChangedOnAxis(t,s)?this._updatePosition(r,u,o[0],o[1],this._tooltipContent,s):this._showTooltipContent(r,p,s,Math.random()+"",o[0],o[1],u,null,h)}))},e.prototype._showSeriesItemTooltip=function(t,e,i){var n=this._ecModel,o=D(e),r=o.seriesIndex,a=n.getSeriesByIndex(r),s=o.dataModel||a,l=o.dataIndex,c=o.dataType,h=s.getData(c),u=this._renderMode,d=t.positionDefault,f=ge([h.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),p=f.get("trigger");if(null==p||"item"===p){var m=s.getDataParams(l,c),b=new Z;m.marker=b.makeTooltipMarker("item",v(m.color),u);var g=P(s.formatTooltip(l,!1,c)),y=f.get("order"),x=f.get("valueFormatter"),w=g.frag,S=w?W(x?$({valueFormatter:x},w):w,b,u,y,n.get("useUTC"),f.get("textStyle")):g.text,T="item_"+s.name+"_"+l;this._showOrMove(f,(function(){this._showTooltipContent(f,S,m,T,t.offsetX,t.offsetY,t.position,t.target,b)})),i({type:"showTip",dataIndexInside:l,dataIndex:h.getRawIndex(l),seriesIndex:r,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,e,i){var n=D(e),o=n.tooltipConfig.option||{};p(o)&&(o={content:o,formatter:o});var r=[o],a=this._ecModel.getComponent(n.componentMainType,n.componentIndex);a&&r.push(a),r.push({formatter:o.content});var s=t.positionDefault,l=ge(r,this._tooltipModel,s?{position:s}:null),c=l.get("content"),h=Math.random()+"",u=new Z;this._showOrMove(l,(function(){var i=F(l.get("formatterParams")||{});this._showTooltipContent(l,c,i,h,t.offsetX,t.offsetY,t.position,e,u)})),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,e,i,n,o,r,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var c=this._tooltipContent;c.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var u=e,d=this._getNearestPoint([o,r],i,t.get("trigger"),t.get("borderColor")).color;if(h)if(p(h)){var f=t.ecModel.get("useUTC"),v=m(i)?i[0]:i;u=h,v&&v.axisType&&v.axisType.indexOf("time")>=0&&(u=Y(v.axisValue,u,f)),u=j(u,i,!0)}else if(G(h)){var b=y((function(e,n){e===this._ticket&&(c.setContent(n,l,t,d,a),this._updatePosition(t,a,o,r,c,i,s))}),this);this._ticket=n,u=h(i,n,b)}else u=h;c.setContent(u,l,t,d,a),c.show(t,d),this._updatePosition(t,a,o,r,c,i,s)}},e.prototype._getNearestPoint=function(t,e,i,n){return"axis"===i||m(e)?{color:n||("html"===this._renderMode?"#fff":"none")}:m(e)?void 0:{color:n||e.color||e.borderColor}},e.prototype._updatePosition=function(t,e,i,n,o,r,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var c=o.getSize(),h=t.get("align"),u=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),G(e)&&(e=e([i,n],r,o.el,d,{viewSize:[s,l],contentSize:c.slice()})),m(e))i=H(e[0],s),n=H(e[1],l);else if(T(e)){var f=e;f.width=c[0],f.height=c[1];var v=X(f,{width:s,height:l});i=v.x,n=v.y,h=null,u=null}else if(p(e)&&a){var b=function(t,e,i,n){var o=i[0],r=i[1],a=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,c=e.width,h=e.height;switch(t){case"inside":s=e.x+c/2-o/2,l=e.y+h/2-r/2;break;case"top":s=e.x+c/2-o/2,l=e.y-r-a;break;case"bottom":s=e.x+c/2-o/2,l=e.y+h+a;break;case"left":s=e.x-o-a,l=e.y+h/2-r/2;break;case"right":s=e.x+c+a,l=e.y+h/2-r/2}return[s,l]}(e,d,c,t.get("borderWidth"));i=b[0],n=b[1]}else b=function(t,e,i,n,o,r,a){var s=i.getSize(),l=s[0],c=s[1];return null!=r&&(t+l+r+2>n?t-=l+r:t+=r),null!=a&&(e+c+a>o?e-=c+a:e+=a),[t,e]}(i,n,o,s,l,h?null:20,u?null:20),i=b[0],n=b[1];h&&(i-=xe(h)?c[0]/2:"right"===h?c[0]:0),u&&(n-=xe(u)?c[1]/2:"bottom"===u?c[1]:0),ie(t)&&(b=function(t,e,i,n,o){var r=i.getSize(),a=r[0],s=r[1];return t=Math.min(t+a,n)-a,e=Math.min(e+s,o)-s,[t=Math.max(t,0),e=Math.max(e,0)]}(i,n,o,s,l),i=b[0],n=b[1]),o.moveTo(i,n)},e.prototype._updateContentNotChangedOnAxis=function(t,e){var i=this._lastDataByCoordSys,n=this._cbParamsList,o=!!i&&i.length===t.length;return o&&g(i,(function(i,r){var a=i.dataByAxis||[],s=(t[r]||{}).dataByAxis||[];(o=o&&a.length===s.length)&&g(a,(function(t,i){var r=s[i]||{},a=t.seriesDataIndices||[],l=r.seriesDataIndices||[];(o=o&&t.value===r.value&&t.axisType===r.axisType&&t.axisId===r.axisId&&a.length===l.length)&&g(a,(function(t,e){var i=l[e];o=o&&t.seriesIndex===i.seriesIndex&&t.dataIndex===i.dataIndex})),n&&g(t.seriesDataIndices,(function(t){var i=t.seriesIndex,r=e[i],a=n[i];r&&a&&a.data!==r.data&&(o=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!o},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,e){!d.node&&e.getDom()&&(z(this,"_updatePosition"),this._tooltipContent.dispose(),E("itemTooltip",e))},e.type="tooltip",e}(_);function ge(t,e,i){var n,o=e.ecModel;i?(n=new K(i,o,o),n=new K(e.option,n,o)):n=e;for(var r=t.length-1;r>=0;r--){var a=t[r];a&&(a instanceof K&&(a=a.get("tooltip",!0)),p(a)&&(a={formatter:a}),a&&(n=new K(a,n,o)))}return n}function ye(t,e){return t.dispatchAction||y(e.dispatchAction,e)}function xe(t){return"center"===t||"middle"===t}var we=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.layoutMode={type:"box",ignoreSize:!0},i}return c(e,t),e.prototype.init=function(t,e,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(e,i){t.prototype.mergeOption.call(this,e,i),this._updateSelector(e)},e.prototype._updateSelector=function(t){var e=t.selector,i=this.ecModel;!0===e&&(e=t.selector=["all","inverse"]),m(e)&&g(e,(function(t,n){p(t)&&(t={type:t}),e[n]=et(t,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(i,t.type))}))},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,i=0;i<t.length;i++){var n=t[i].get("name");if(this.isSelected(n)){this.select(n),e=!0;break}}!e&&this.select(t[0].get("name"))}},e.prototype._updateData=function(t){var e=[],i=[];t.eachRawSeries((function(n){var o;if(i.push(n.name),n.legendVisualProvider){var r=n.legendVisualProvider.getAllNames();t.isSeriesFiltered(n)||(i=i.concat(r)),r.length?e=e.concat(r):o=!0}else o=!0;o&&it(n)&&e.push(n.name)})),this._availableNames=i;var n=this.get("data")||e,o=nt(),r=ot(n,(function(t){return(p(t)||at(t))&&(t={name:t}),o.get(t.name)?null:(o.set(t.name,!0),new K(t,this,this.ecModel))}),this);this._data=rt(r,(function(t){return!!t}))},e.prototype.getData=function(){return this._data},e.prototype.select=function(t){var e=this.option.selected;"single"===this.get("selectedMode")&&g(this._data,(function(t){e[t.get("name")]=!1})),e[t]=!0},e.prototype.unSelect=function(t){"single"!==this.get("selectedMode")&&(this.option.selected[t]=!1)},e.prototype.toggleSelected=function(t){var e=this.option.selected;e.hasOwnProperty(t)||(e[t]=!0),this[e[t]?"unSelect":"select"](t)},e.prototype.allSelect=function(){var t=this.option.selected;g(this._data,(function(e){t[e.get("name",!0)]=!0}))},e.prototype.inverseSelect=function(){var t=this.option.selected;g(this._data,(function(e){var i=e.get("name",!0);t.hasOwnProperty(i)||(t[i]=!0),t[i]=!t[i]}))},e.prototype.isSelected=function(t){var e=this.option.selected;return!(e.hasOwnProperty(t)&&!e[t])&&x(this._availableNames,t)>=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(h),Se=bt,Te=g,Me=gt,Ce=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.newlineDisabled=!1,i}return c(e,t),e.prototype.init=function(){this.group.add(this._contentGroup=new Me),this.group.add(this._selectorGroup=new Me),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,e,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var o=t.get("align"),r=t.get("orient");o&&"auto"!==o||(o="right"===t.get("left")&&"vertical"===r?"right":"left");var a=t.get("selector",!0),c=t.get("selectorPosition",!0);!a||c&&"auto"!==c||(c="horizontal"===r?"end":"start"),this.renderInner(o,t,e,i,a,r,c);var h=t.getBoxLayoutParams(),u={width:i.getWidth(),height:i.getHeight()},d=t.get("padding"),f=X(h,u,d),v=this.layoutInner(t,o,f,n,a,c),p=X(st({width:v.width,height:v.height},h),u,d);this.group.x=p.x-v.x,this.group.y=p.y-v.y,this.group.markRedraw(),this.group.add(this._backgroundEl=function(t,e){var i=s(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),new l({shape:{x:t.x-i[3],y:t.y-i[0],width:t.width+i[1]+i[3],height:t.height+i[0]+i[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1})}(v,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,e,i,n,o,r,a){var s=this.getContentGroup(),l=nt(),c=e.get("selectedMode"),h=[];i.eachRawSeries((function(t){!t.get("legendHoverLink")&&h.push(t.id)})),Te(e.getData(),(function(o,r){var a=o.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var u=new Me;return u.newline=!0,void s.add(u)}var d=i.getSeriesByName(a)[0];if(!l.get(a))if(d){var f=d.getData(),v=f.getVisual("legendLineStyle")||{},p=f.getVisual("legendIcon"),m=f.getVisual("style");this._createItem(d,a,r,o,e,t,v,m,p,c,n).on("click",Se(Ie,a,null,n,h)).on("mouseover",Se(ze,d.name,null,n,h)).on("mouseout",Se(Ae,d.name,null,n,h)),l.set(a,!0)}else i.eachRawSeries((function(i){if(!l.get(a)&&i.legendVisualProvider){var s=i.legendVisualProvider;if(!s.containName(a))return;var u=s.indexOfName(a),d=s.getItemVisual(u,"style"),f=s.getItemVisual(u,"legendIcon"),v=lt(d.fill);v&&0===v[3]&&(v[3]=.2,d=$($({},d),{fill:ct(v,"rgba")})),this._createItem(i,a,r,o,e,t,{},d,f,c,n).on("click",Se(Ie,null,a,n,h)).on("mouseover",Se(ze,null,a,n,h)).on("mouseout",Se(Ae,null,a,n,h)),l.set(a,!0)}}),this)}),this),o&&this._createSelector(o,e,n,r,a)},e.prototype._createSelector=function(t,e,i){var n=this.getSelectorGroup();Te(t,(function(t){var o=t.type,r=new C({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:"all"===o?"legendAllSelect":"legendInverseSelect"})}});n.add(r);var a=e.getModel("selectorLabel"),s=e.getModel(["emphasis","selectorLabel"]);ht(r,{normal:a,emphasis:s},{defaultText:t.title}),ut(r)}))},e.prototype._createItem=function(t,e,i,n,o,r,a,s,c,h,u){var d,f,v,m=t.visualDrawType,b=o.get("itemWidth"),g=o.get("itemHeight"),y=o.isSelected(e),x=n.get("symbolRotate"),w=n.get("symbolKeepAspect"),S=n.get("icon"),T=function(t,e,i,n,o,r,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),Te(t,(function(i,n){"inherit"===t[n]&&(t[n]=e[n])}))}var l=e.getModel("itemStyle"),c=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",u=l.getShallow("decal");c.decal=u&&"inherit"!==u?pt(u,a):n.decal,"inherit"===c.fill&&(c.fill=n[o]),"inherit"===c.stroke&&(c.stroke=n[h]),"inherit"===c.opacity&&(c.opacity=("fill"===o?n:i).opacity),s(c,n);var d=e.getModel("lineStyle"),f=d.getLineStyle();if(s(f,i),"auto"===c.fill&&(c.fill=n.fill),"auto"===c.stroke&&(c.stroke=n.fill),"auto"===f.stroke&&(f.stroke=n.fill),!r){var v=e.get("inactiveBorderWidth");c.lineWidth="auto"===v?n.lineWidth>0&&c[h]?2:0:c.lineWidth,c.fill=e.get("inactiveColor"),c.stroke=e.get("inactiveBorderColor"),f.stroke=d.get("inactiveColor"),f.lineWidth=d.get("inactiveWidth")}return{itemStyle:c,lineStyle:f}}(c=S||c||"roundRect",n,a,s,m,y,u),M=new Me,I=n.getModel("textStyle");if(!G(t.getLegendIcon)||S&&"inherit"!==S){var k="inherit"===S&&t.getData().getVisual("symbol")?"inherit"===x?t.getData().getVisual("symbolRotate"):x:0;M.add(((v=mt(f=(d={itemWidth:b,itemHeight:g,icon:c,iconRotate:k,itemStyle:T.itemStyle,lineStyle:T.lineStyle,symbolKeepAspect:w}).icon||"roundRect",0,0,d.itemWidth,d.itemHeight,d.itemStyle.fill,d.symbolKeepAspect)).setStyle(d.itemStyle),v.rotation=(d.iconRotate||0)*Math.PI/180,v.setOrigin([d.itemWidth/2,d.itemHeight/2]),f.indexOf("empty")>-1&&(v.style.stroke=v.style.fill,v.style.fill="#fff",v.style.lineWidth=2),v))}else M.add(t.getLegendIcon({itemWidth:b,itemHeight:g,icon:c,iconRotate:x,itemStyle:T.itemStyle,lineStyle:T.lineStyle,symbolKeepAspect:w}));var z="left"===r?b+5:-5,A=r,D=o.get("formatter"),N=e;p(D)&&D?N=D.replace("{name}",null!=e?e:""):G(D)&&(N=D(e));var O=n.get("inactiveColor");M.add(new C({style:dt(I,{text:N,x:z,y:g/2,fill:y?I.getTextColor():O,align:A,verticalAlign:"middle"})}));var L=new l({shape:M.getBoundingRect(),invisible:!0}),U=n.getModel("tooltip");return U.get("show")&&ft({el:L,componentModel:o,itemName:e,itemTooltipOption:U.option}),M.add(L),M.eachChild((function(t){t.silent=!0})),L.silent=!h,this.getContentGroup().add(M),ut(M),M.__legendDataIndex=i,M},e.prototype.layoutInner=function(t,e,i,n,o,r){var a=this.getContentGroup(),s=this.getSelectorGroup();vt(t.get("orient"),a,t.get("itemGap"),i.width,i.height);var l=a.getBoundingRect(),c=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),o){vt("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),u=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),f=t.getOrient().index,v=0===f?"width":"height",p=0===f?"height":"width",m=0===f?"y":"x";"end"===r?u[f]+=l[v]+d:c[f]+=h[v]+d,u[1-f]+=l[p]/2-h[p]/2,s.x=u[0],s.y=u[1],a.x=c[0],a.y=c[1];var b={x:0,y:0};return b[v]=l[v]+d+h[v],b[p]=Math.max(l[p],h[p]),b[m]=Math.min(0,h[m]+u[1-f]),b}return a.x=c[0],a.y=c[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(_);function Ie(t,e,i,n){Ae(t,e,i,n),i.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),ze(t,e,i,n)}function ke(t){for(var e,i=t.getZr().storage.getDisplayList(),n=0,o=i.length;n<o&&!(e=i[n].states.emphasis);)n++;return e&&e.hoverLayer}function ze(t,e,i,n){ke(i)||i.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function Ae(t,e,i,n){ke(i)||i.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}function De(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries((function(t){for(var i=0;i<e.length;i++)if(!e[i].isSelected(t.name))return!1;return!0}))}function Ne(t,e,i){var n,o={},r="toggleSelected"===t;return i.eachComponent("legend",(function(i){r&&null!=n?i[n?"select":"unSelect"](e.name):"allSelect"===t||"inverseSelect"===t?i[t]():(i[t](e.name),n=i.isSelected(e.name));var a=i.getData();g(a,(function(t){var e=t.get("name");if("\n"!==e&&""!==e){var n=i.isSelected(e);o[e]=o.hasOwnProperty(e)?o[e]&&n:n}}))})),"allSelect"===t||"inverseSelect"===t?{selected:o}:{name:e.name,selected:o}}function Oe(t){t.registerComponentModel(we),t.registerComponentView(Ce),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,De),t.registerSubTypeDefaulter("legend",(function(){return"plain"})),function(t){t.registerAction("legendToggleSelect","legendselectchanged",bt(Ne,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",bt(Ne,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",bt(Ne,"inverseSelect")),t.registerAction("legendSelect","legendselected",bt(Ne,"select")),t.registerAction("legendUnSelect","legendunselected",bt(Ne,"unSelect"))}(t)}var Le=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return c(e,t),e.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},e.prototype.init=function(e,i,n){var o=yt(e);t.prototype.init.call(this,e,i,n),Ue(this,e,o)},e.prototype.mergeOption=function(e,i){t.prototype.mergeOption.call(this,e,i),Ue(this,this.option,e)},e.type="legend.scroll",e.defaultOption=xt(we.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:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e}(we);function Ue(t,e,i){var n=[1,1];n[t.getOrient().index]=0,wt(e,i,{type:"box",ignoreSize:!!n})}var Be=gt,Re=["width","height"],Pe=["x","y"],We=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.newlineDisabled=!0,i._currentIndex=0,i}return c(e,t),e.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new Be),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Be)},e.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(e,i,n,o,r,a,s){var l=this;t.prototype.renderInner.call(this,e,i,n,o,r,a,s);var c=this._controllerGroup,h=i.get("pageIconSize",!0),u=m(h)?h:[h,h];f("pagePrev",0);var d=i.getModel("pageTextStyle");function f(t,e){var n=t+"DataIndex",r=St(i.get("pageIcons",!0)[i.getOrient().name][e],{onclick:y(l._pageGo,l,n,i,o)},{x:-u[0]/2,y:-u[1]/2,width:u[0],height:u[1]});r.name=t,c.add(r)}c.add(new C({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),f("pageNext",1)},e.prototype.layoutInner=function(t,e,i,n,o,r){var a=this.getSelectorGroup(),s=t.getOrient().index,l=Re[s],c=Pe[s],h=Re[1-s],u=Pe[1-s];o&&vt("horizontal",a,t.get("selectorItemGap",!0));var d=t.get("selectorButtonGap",!0),f=a.getBoundingRect(),v=[-f.x,-f.y],p=F(i);o&&(p[l]=i[l]-f[l]-d);var m=this._layoutContentAndController(t,n,p,s,l,h,u,c);if(o){if("end"===r)v[s]+=m[l]+d;else{var b=f[l]+d;v[s]-=b,m[c]-=b}m[l]+=f[l]+d,v[1-s]+=m[u]+m[h]/2-f[h]/2,m[h]=Math.max(m[h],f[h]),m[u]=Math.min(m[u],f[u]+v[1-s]),a.x=v[0],a.y=v[1],a.markRedraw()}return m},e.prototype._layoutContentAndController=function(t,e,i,n,o,r,a,s){var c=this.getContentGroup(),h=this._containerGroup,u=this._controllerGroup;vt(t.get("orient"),c,t.get("itemGap"),n?i.width:null,n?null:i.height),vt("horizontal",u,t.get("pageButtonItemGap",!0));var d=c.getBoundingRect(),f=u.getBoundingRect(),v=this._showController=d[o]>i[o],p=[-d.x,-d.y];e||(p[n]=c[s]);var m=[0,0],b=[-f.x,-f.y],g=Tt(t.get("pageButtonGap",!0),t.get("itemGap",!0));v&&("end"===t.get("pageButtonPosition",!0)?b[n]+=i[o]-f[o]:m[n]+=f[o]+g),b[1-n]+=d[r]/2-f[r]/2,c.setPosition(p),h.setPosition(m),u.setPosition(b);var y={x:0,y:0};if(y[o]=v?i[o]:d[o],y[r]=Math.max(d[r],f[r]),y[a]=Math.min(0,f[a]+b[1-n]),h.__rectSize=i[o],v){var x={x:0,y:0};x[o]=Math.max(i[o]-f[o]-g,0),x[r]=y[r],h.setClipPath(new l({shape:x})),h.__rectSize=x[o]}else u.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));var w=this._getPageInfo(t);return null!=w.pageIndex&&Mt(c,{x:w.contentPosition[0],y:w.contentPosition[1]},v?t:null),this._updatePageInfoView(t,w),y},e.prototype._pageGo=function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var i=this._controllerGroup;g(["pagePrev","pageNext"],(function(n){var o=null!=e[n+"DataIndex"],r=i.childOfName(n);r&&(r.setStyle("fill",t.get(o?"pageIconColor":"pageIconInactiveColor",!0)),r.cursor=o?"pointer":"default")}));var n=i.childOfName("pageText"),o=t.get("pageFormatter"),r=e.pageIndex,a=null!=r?r+1:0,s=e.pageCount;n&&o&&n.setStyle("text",p(o)?o.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):o({current:a,total:s}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,o=t.getOrient().index,r=Re[o],a=Pe[o],s=this._findTargetItemIndex(e),l=i.children(),c=l[s],h=l.length,u=h?1:0,d={contentPosition:[i.x,i.y],pageCount:u,pageIndex:u-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return d;var f=g(c);d.contentPosition[o]=-f.s;for(var v=s+1,p=f,m=f,b=null;v<=h;++v)(!(b=g(l[v]))&&m.e>p.s+n||b&&!y(b,p.s))&&(p=m.i>p.i?m:b)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=p.i),++d.pageCount),m=b;for(v=s-1,p=f,m=f,b=null;v>=-1;--v)(b=g(l[v]))&&y(m,b.s)||!(p.i<m.i)||(m=p,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=p.i),++d.pageCount,++d.pageIndex),p=b;return d;function g(t){if(t){var e=t.getBoundingRect(),i=e[a]+t[a];return{s:i,e:i+e[r],i:t.__legendDataIndex}}}function y(t,e){return t.e>=e&&t.s<=e+n}},e.prototype._findTargetItemIndex=function(t){return this._showController?(this.getContentGroup().eachChild((function(n,o){var r=n.__legendDataIndex;null==i&&null!=r&&(i=o),r===t&&(e=o)})),null!=e?e:i):0;var e,i},e.type="legend.scroll",e}(Ce);function Fe(t){V(Oe),t.registerComponentModel(Le),t.registerComponentView(We),function(t){t.registerAction("legendScroll","legendscroll",(function(t,e){var i=t.scrollDataIndex;null!=i&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(i)}))}))}(t)}var Ye=2*Math.PI,je=Math.PI/180;function Ge(t,e){return X(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function He(t,e){var i=Ge(t,e),n=t.get("center"),o=t.get("radius");m(o)||(o=[0,o]);var r,a,s=H(i.width,e.getWidth()),l=H(i.height,e.getHeight()),c=Math.min(s,l),h=H(o[0],c/2),u=H(o[1],c/2),d=t.coordinateSystem;if(d){var f=d.dataToPoint(n);r=f[0]||0,a=f[1]||0}else m(n)||(n=[n,n]),r=H(n[0],s)+i.x,a=H(n[1],l)+i.y;return{cx:r,cy:a,r0:h,r:u}}function Xe(t,e,i){e.eachSeriesByType(t,(function(t){var e=t.getData(),n=e.mapDimension("value"),o=Ge(t,i),r=He(t,i),a=r.cx,s=r.cy,l=r.r,c=r.r0,h=-t.get("startAngle")*je,u=t.get("minAngle")*je,d=0;e.each(n,(function(t){!isNaN(t)&&d++}));var f=e.getSum(n),v=Math.PI/(f||d)*2,p=t.get("clockwise"),m=t.get("roseType"),b=t.get("stillShowZeroSum"),g=e.getDataExtent(n);g[0]=0;var y=Ye,x=0,w=h,S=p?1:-1;if(e.setLayout({viewRect:o,r:l}),e.each(n,(function(t,i){var n;if(isNaN(t))e.setItemLayout(i,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:p,cx:a,cy:s,r0:c,r:m?NaN:l});else{(n="area"!==m?0===f&&b?v:t*v:Ye/d)<u?(n=u,y-=u):x+=t;var o=w+S*n;e.setItemLayout(i,{angle:n,startAngle:w,endAngle:o,clockwise:p,cx:a,cy:s,r0:c,r:m?Ct(t,g,[c,l]):l}),w=o}})),y<Ye&&d)if(y<=.001){var T=Ye/d;e.each(n,(function(t,i){if(!isNaN(t)){var n=e.getItemLayout(i);n.angle=T,n.startAngle=h+S*i*T,n.endAngle=h+S*(i+1)*T}}))}else v=y/x,w=h,e.each(n,(function(t,i){if(!isNaN(t)){var n=e.getItemLayout(i),o=n.angle===u?u:t*v;n.startAngle=w,n.endAngle=w+S*o,w+=S*o}}))}))}var Ee=Math.PI/180;function _e(t,e,i,n,o,r,a,s,l,c){if(!(t.length<2)){for(var h=t.length,u=0;u<h;u++)"outer"===t[u].position&&"labelLine"===t[u].labelAlignTo&&(t[u].linePoints[1][0]+=t[u].label.x-c,t[u].label.x=c);kt(t,l,l+a)&&function(t){for(var r={list:[],maxY:0},a={list:[],maxY:0},s=0;s<t.length;s++)if("none"===t[s].labelAlignTo){var l=t[s],c=l.label.y>i?a:r,h=Math.abs(l.label.y-i);if(h>=c.maxY){var u=l.label.x-e-l.len2*o,f=n+l.len,v=Math.abs(u)<f?Math.sqrt(h*h/(1-u*u/f/f)):f;c.rB=v,c.maxY=h}c.list.push(l)}d(r),d(a)}(t)}function d(t){for(var r=t.rB,a=r*r,s=0;s<t.list.length;s++){var l=t.list[s],c=Math.abs(l.label.y-i),h=n+l.len,u=h*h,d=Math.sqrt((1-Math.abs(c*c/a))*u),f=e+(d+l.len2)*o;Ke(l,l.targetTextWidth-(f-l.label.x)*o,!0),l.label.x=f}}}function Ke(t,e,i){if(void 0===i&&(i=!1),null==t.labelStyleWidth){var n=t.label,o=n.style,r=t.rect,a=o.backgroundColor,s=o.padding,l=s?s[1]+s[3]:0,c=o.overflow,h=r.width+(a?0:l);if(e<h||i){var u=r.height;if(c&&c.match("break")){n.setStyle("backgroundColor",null),n.setStyle("width",e-l);var d=n.getBoundingRect();n.setStyle("width",Math.ceil(d.width)),n.setStyle("backgroundColor",a)}else{var f=e-l;n.setStyle("width",e<h?f:i?f>t.unconstrainedWidth?null:f:null)}var v=n.getBoundingRect();r.width=v.width,r.height=v.height+((n.style.margin||0)+2.1),r.y-=(r.height-u)/2}}}function qe(t){return"center"===t.position}function Je(t,e,i){var n=t.get("borderRadius");if(null==n)return i?{cornerRadius:0}:null;m(n)||(n=[n,n,n,n]);var o=Math.abs(e.r||0-e.r0||0);return{cornerRadius:ot(n,(function(t){return zt(t,o)}))}}var Ze=function(t){function e(e,i,n){var o=t.call(this)||this;o.z2=2;var r=new C;return o.setTextContent(r),o.updateData(e,i,n,!0),o}return c(e,t),e.prototype.updateData=function(t,e,i,n){var o=this,r=t.hostModel,a=t.getItemModel(e),s=a.getModel("emphasis"),l=t.getItemLayout(e),c=$(Je(a.getModel("itemStyle"),l,!0),l);if(isNaN(c.startAngle))o.setShape(c);else{if(n){o.setShape(c);var h=r.getShallow("animationType");r.ecModel.ssr?(At(o,{scaleX:0,scaleY:0},r,{dataIndex:e,isFrom:!0}),o.originX=c.cx,o.originY=c.cy):"scale"===h?(o.shape.r=l.r0,At(o,{shape:{r:l.r}},r,e)):null!=i?(o.setShape({startAngle:i,endAngle:i}),At(o,{shape:{startAngle:l.startAngle,endAngle:l.endAngle}},r,e)):(o.shape.endAngle=l.startAngle,Mt(o,{shape:{endAngle:l.endAngle}},r,e))}else Dt(o),Mt(o,{shape:c},r,e);o.useStyle(t.getItemVisual(e,"style")),Nt(o,a);var u=(l.startAngle+l.endAngle)/2,d=r.get("selectedOffset"),f=Math.cos(u)*d,v=Math.sin(u)*d,p=a.getShallow("cursor");p&&o.attr("cursor",p),this._updateLabel(r,t,e),o.ensureState("emphasis").shape=$({r:l.r+(s.get("scale")&&s.get("scaleSize")||0)},Je(s.getModel("itemStyle"),l)),$(o.ensureState("select"),{x:f,y:v,shape:Je(a.getModel(["select","itemStyle"]),l)}),$(o.ensureState("blur"),{shape:Je(a.getModel(["blur","itemStyle"]),l)});var m=o.getTextGuideLine(),b=o.getTextContent();m&&$(m.ensureState("select"),{x:f,y:v}),$(b.ensureState("select"),{x:f,y:v}),Ot(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))}},e.prototype._updateLabel=function(t,e,i){var n=this,o=e.getItemModel(i),r=o.getModel("labelLine"),a=e.getItemVisual(i,"style"),s=a&&a.fill,l=a&&a.opacity;ht(n,Lt(o),{labelFetcher:e.hostModel,labelDataIndex:i,inheritColor:s,defaultOpacity:l,defaultText:t.getFormattedLabel(i,"normal")||e.getName(i)});var c=n.getTextContent();n.setTextConfig({position:null,rotation:null}),c.attr({z2:10});var h=t.get(["label","position"]);if("outside"!==h&&"outer"!==h)n.removeTextGuideLine();else{var u=this.getTextGuideLine();u||(u=new Ut,this.setTextGuideLine(u)),Vt(this,Qt(o),{stroke:s,opacity:Bt(r.get(["lineStyle","opacity"]),l,1)})}},e}(Rt),$e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ignoreLabelLineUpdate=!0,e}return c(e,t),e.prototype.render=function(t,e,i){var n,o=t.getData(),r=this._data,a=this.group;if(!r&&o.count()>0){for(var s=o.getItemLayout(0),l=1;isNaN(s&&s.startAngle)&&l<o.count();++l)s=o.getItemLayout(l);s&&(n=s.startAngle)}if(this._emptyCircleSector&&a.remove(this._emptyCircleSector),0===o.count()&&t.get("showEmptyCircle")){var c=new Rt({shape:He(t,i)});c.useStyle(t.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=c,a.add(c)}o.diff(r).add((function(t){var e=new Ze(o,t,n);o.setItemGraphicEl(t,e),a.add(e)})).update((function(t,e){var i=r.getItemGraphicEl(e);i.updateData(o,t,n),i.off("click"),a.add(i),o.setItemGraphicEl(t,i)})).remove((function(e){var i=r.getItemGraphicEl(e);Pt(i,t,e)})).execute(),function(t){var e,i,n=t.getData(),o=[],r=!1,a=(t.get("minShowLabelAngle")||0)*Ee,s=n.getLayout("viewRect"),l=n.getLayout("r"),c=s.width,h=s.x,u=s.y,d=s.height;function f(t){t.ignore=!0}n.each((function(t){var s=n.getItemGraphicEl(t),u=s.shape,d=s.getTextContent(),v=s.getTextGuideLine(),p=n.getItemModel(t),m=p.getModel("label"),b=m.get("position")||p.get(["emphasis","label","position"]),y=m.get("distanceToLabelLine"),x=m.get("alignTo"),w=H(m.get("edgeDistance"),c),S=m.get("bleedMargin"),T=p.getModel("labelLine"),M=T.get("length");M=H(M,c);var C=T.get("length2");if(C=H(C,c),Math.abs(u.endAngle-u.startAngle)<a)return g(d.states,f),d.ignore=!0,void(v&&(g(v.states,f),v.ignore=!0));if(function(t){if(!t.ignore)return!0;for(var e in t.states)if(!1===t.states[e].ignore)return!0;return!1}(d)){var I,k,z,A,D=(u.startAngle+u.endAngle)/2,N=Math.cos(D),O=Math.sin(D);e=u.cx,i=u.cy;var L="inside"===b||"inner"===b;if("center"===b)I=u.cx,k=u.cy,A="center";else{var U=(L?(u.r+u.r0)/2*N:u.r*N)+e,B=(L?(u.r+u.r0)/2*O:u.r*O)+i;if(I=U+3*N,k=B+3*O,!L){var R=U+N*(M+l-u.r),P=B+O*(M+l-u.r),W=R+(N<0?-1:1)*C;I="edge"===x?N<0?h+w:h+c-w:W+(N<0?-y:y),k=P,z=[[U,B],[R,P],[W,P]]}A=L?"center":"edge"===x?N>0?"right":"left":N>0?"left":"right"}var F=Math.PI,Y=0,j=m.get("rotate");if(at(j))Y=j*(F/180);else if("center"===b)Y=0;else if("radial"===j||!0===j)Y=N<0?-D+F:-D;else if("tangential"===j&&"outside"!==b&&"outer"!==b){var G=Math.atan2(N,O);G<0&&(G=2*F+G),O>0&&(G=F+G),Y=G-F}if(r=!!Y,d.x=I,d.y=k,d.rotation=Y,d.setStyle({verticalAlign:"middle"}),L){d.setStyle({align:A});var X=d.states.select;X&&(X.x+=d.x,X.y+=d.y)}else{var E=d.getBoundingRect().clone();E.applyTransform(d.getComputedTransform());var _=(d.style.margin||0)+2.1;E.y-=_/2,E.height+=_,o.push({label:d,labelLine:v,position:b,len:M,len2:C,minTurnAngle:T.get("minTurnAngle"),maxSurfaceAngle:T.get("maxSurfaceAngle"),surfaceNormal:new It(N,O),linePoints:z,textAlign:A,labelDistance:y,labelAlignTo:x,edgeDistance:w,bleedMargin:S,rect:E,unconstrainedWidth:E.width,labelStyleWidth:d.style.width})}s.setTextConfig({inside:L})}})),!r&&t.get("avoidLabelOverlap")&&function(t,e,i,n,o,r,a,s){for(var l=[],c=[],h=Number.MAX_VALUE,u=-Number.MAX_VALUE,d=0;d<t.length;d++){var f=t[d].label;qe(t[d])||(f.x<e?(h=Math.min(h,f.x),l.push(t[d])):(u=Math.max(u,f.x),c.push(t[d])))}for(d=0;d<t.length;d++)if(!qe(m=t[d])&&m.linePoints){if(null!=m.labelStyleWidth)continue;f=m.label;var v,p=m.linePoints;m.targetTextWidth=v="edge"===m.labelAlignTo?f.x<e?p[2][0]-m.labelDistance-a-m.edgeDistance:a+o-m.edgeDistance-p[2][0]-m.labelDistance:"labelLine"===m.labelAlignTo?f.x<e?h-a-m.bleedMargin:a+o-u-m.bleedMargin:f.x<e?f.x-a-m.bleedMargin:a+o-f.x-m.bleedMargin,Ke(m,v)}for(_e(c,e,i,n,1,0,r,0,s,u),_e(l,e,i,n,-1,0,r,0,s,h),d=0;d<t.length;d++){var m;if(!qe(m=t[d])&&m.linePoints){var b=(f=m.label).style.padding,g=m.rect.width+(f.style.backgroundColor?0:b?b[1]+b[3]:0),y=(p=m.linePoints)[1][0]-p[2][0];"edge"===m.labelAlignTo?p[2][0]=f.x<e?a+m.edgeDistance+g+m.labelDistance:a+o-m.edgeDistance-g-m.labelDistance:(p[2][0]=f.x<e?f.x+m.labelDistance:f.x-m.labelDistance,p[1][0]=p[2][0]+y),p[1][1]=p[2][1]=f.y}}}(o,e,i,l,c,d,h,u);for(var v=0;v<o.length;v++){var p=o[v],m=p.label,b=p.labelLine,y=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:p.textAlign}),y&&(g(m.states,f),m.ignore=!0);var x=m.states.select;x&&(x.x+=m.x,x.y+=m.y)}if(b){var w=p.linePoints;y||!w?(g(b.states,f),b.ignore=!0):(Zt(w,p.minTurnAngle),$t(w,p.surfaceNormal,p.maxSurfaceAngle),b.setShape({points:w}),m.__hostTarget.textGuideLineConfig={anchor:new It(w[0][0],w[0][1])})}}}(t),"expansion"!==t.get("animationTypeUpdate")&&(this._data=o)},e.prototype.dispose=function(){},e.prototype.containPoint=function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,o=t[1]-i.cy,r=Math.sqrt(n*n+o*o);return r<=i.r&&r>=i.r0}},e.type="pie",e}(Wt),Ve=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){return this._getRawData().indexOfName(t)>=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}(),Qe=jt(),ti=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new Ve(y(this.getData,this),y(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return function(t,e){e=m(e)&&{coordDimensions:e}||$({encodeDefine:t.getEncode()},e);var i=t.getSource(),n=Ft(i,e).dimensions,o=new Yt(n,t);return o.initData(i,void 0),o}(this,{coordDimensions:["value"],encodeDefaulter:bt(Gt,this)})},e.prototype.getDataParams=function(e){var i=this.getData(),n=Qe(i),o=n.seats;if(!o){var r=[];i.each(i.mapDimension("value"),(function(t){r.push(t)})),o=n.seats=Ht(r,i.hostModel.get("percentPrecision"))}var a=t.prototype.getDataParams.call(this,e);return a.percent=o[e]||0,a.$vars.push("percent"),a},e.prototype._defaultLabelLine=function(t){Xt(t,"labelLine",["show"]);var e=t.labelLine,i=t.emphasis.labelLine;e.show=e.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Et);V([function(t){V(Q),t.registerComponentModel(ee),t.registerComponentView(be),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},tt),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},tt)},function(){V(Oe),V(Fe)},function(t){t.registerChartView($e),t.registerSeriesModel(ti),_t("pie",t.registerAction),t.registerLayout(bt(Xe,"pie")),t.registerProcessor({seriesType:"pie",reset:function(t,e){var i=e.findComponents({mainType:"legend"});if(i&&i.length){var n=t.getData();n.filterSelf((function(t){for(var e=n.getName(t),o=0;o<i.length;o++)if(!i[o].isSelected(e))return!1;return!0}))}}}),t.registerProcessor({seriesType:"pie",reset:function(t){var e=t.getData();e.filterSelf((function(t){var i=e.mapDimension("value"),n=e.get(i,t);return!(at(n)&&!isNaN(n)&&n<0)}))}})},qt,Jt,te]);const ei=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.click=e(this,"click",7),this.defaultRecord={id:null,value:null,name:null},this.onClickElsewhere=t=>{t.stopPropagation(),this.clearSelection()},this.onButtonKeyUp=t=>{const{selectedId:e,data:i}=this;let n=this.getIndexById(e)||0;switch(t.key){case"ArrowLeft":case"ArrowUp":n--,n<0&&(n=i.length-1),this.chart.dispatchAction({type:"select",seriesId:"pie",dataIndex:n});break;case"ArrowRight":case"ArrowDown":n++,n>i.length-1&&(n=0),this.chart.dispatchAction({type:"select",seriesId:"pie",dataIndex:n});break;case"Escape":this.clearSelection();break;default:return}},this.onButtonClick=t=>{t.stopPropagation();const{selectedId:e}=this,i=e?this.getDataById(e):Object.assign({},this.defaultRecord);this.click.emit(i)},this.onContainerClick=t=>{this.isInChangeEvent||t.target instanceof HTMLElement&&(this.clearSelection(),t.stopPropagation())},this.chartName=void 0,this.summaryIcon=void 0,this.summaryName=void 0,this.innerRadius="70%",this.outerRadius="85%",this.minSliceSize="2.5%",this.selectedOffset=10,this.hoverScaleSize=5,this.format=void 0,this.isClickable=void 0,this.data=[],this.selectedId=void 0,this.hoveredId=void 0}componentDidLoad(){const t=Kt(this.chartContainer);this.cacheComputedStyles(),this.colors=this.getColors(),this.resizeObserver=new ResizeObserver((()=>this.resizeChart())),this.resizeObserver.observe(this.hostElement),this.updateChart(t),this.setupChartEvents(t),this.chart=t,o(this.hostElement)}disconnectedCallback(){this.resizeObserver=null}get centerData(){const{selectedId:t,hoveredId:e,data:i}=this,n=e||t,o=this.getIndexById(n);return n?Object.assign(Object.assign({},this.getDataById(n)),{color:this.colors[o]}):{name:r(this.summaryName||"tecton.element.chartDonut.button.summaryName"),icon:this.summaryIcon,value:i.reduce(((t,e)=>t+e.value),0),color:null}}cacheComputedStyles(){this.chartContainerStyles=getComputedStyle(this.chartContainer),this.hostElementStyles=getComputedStyle(this.hostElement)}displayValue(t){const e=parseFloat(t.toString());if(!isNaN(e))return"currency"===this.format?Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e):Intl.NumberFormat("en-US").format(e)}getCSSProperty(t){let e;if(t.startsWith("var(")&&t.endsWith(")")){const i=/var\((.*)\)/g.exec(t),n=i.length>=2?i[1].split(","):[];t=n[0],e=n[1]}let i=this.chartContainerStyles.getPropertyValue(t).trim();return i||(i=this.hostElementStyles.getPropertyValue(t).trim()),i||e}getIndexById(t){return this.data.findIndex((e=>e.id===t))}getDataByIndex(t){if("number"==typeof t)return this.data[t]}getDataById(t){if(t)return this.data.find((e=>e.id===t))}getColors(){const t=["--comp-color-1","--comp-color-2","--comp-color-3","--comp-color-4","--comp-color-5","--comp-color-6","--comp-color-7","--comp-color-8","--comp-color-9","--comp-color-10","--comp-color-11","--comp-color-12"];return this.data.reduce(((e,i)=>{let n=t.shift();return i.color&&(n=i.color),e.push(this.getCSSProperty(n)||n),e}),[])}setupChartEvents(t){t.on("mouseover",(t=>{this.hoveredId=t.data.id})),t.on("click",(t=>{t.event.event.stopPropagation()})),t.on("mouseout",(()=>{this.hoveredId=null})),t.on("selectchanged",(t=>{var e,i,n,o;const r=null!==(o=null===(n=null===(i=null===(e=t.selected)||void 0===e?void 0:e[0])||void 0===i?void 0:i.dataIndex)||void 0===n?void 0:n[0])&&void 0!==o?o:null,a="number"==typeof r?this.getDataByIndex(r):Object.assign({},this.defaultRecord);this.selectedId=a.id,this.isInChangeEvent=!0,this.change.emit(a),setTimeout((()=>{this.isInChangeEvent=!1}),0)}))}cleanData(t){const{minSliceSize:e}=this,i=parseFloat(e||"2.5%")/100,n=t.reduce(((t,e)=>t+e.value),0)*i;return t.map((t=>t.value<n?Object.assign(Object.assign({},t),{value:n}):t))}updateChart(t){return t.setOption({tooltip:{show:!1},legend:{show:!1},aria:{enabled:!0},series:[{name:this.chartName,animationType:"scale",color:this.colors,id:"pie",type:"pie",selectedOffset:this.selectedOffset,selectedMode:"single",radius:[this.innerRadius,this.outerRadius],label:{show:!1},labelLine:{show:!1},itemStyle:{borderWidth:5,borderColor:this.getCSSProperty("--comp-background-color")},emphasis:{scaleSize:this.hoverScaleSize,itemStyle:{color:"inherit"}},data:this.cleanData(this.data)}]})}resizeChart(){this.chart.resize()}propsUpdates(){this.updateChart(this.chart)}dataUpdated(){this.colors=this.getColors()}innerRadiusUpdated(){const{innerRadius:t,outerRadius:e}=this,i=parseFloat(t),n=parseFloat(e);i>=n&&(this.innerRadius=n-15+"%")}outerRadiusUpdated(){const{innerRadius:t,outerRadius:e}=this,i=parseFloat(t);parseFloat(e)<=i&&(this.outerRadius=`${i+15}%`)}delegateFocus(t){var e;a(t,this.hostElement)&&this.isClickable&&(null===(e=this.centerButtonElement)||void 0===e||e.focus())}async selectById(t){const e=this.getIndexById(t);-1!==e&&this.chart.dispatchAction({type:"select",seriesId:"pie",dataIndex:e})}async selectByIndex(t){const e=this.data[t]?t:null;e&&this.chart.dispatchAction({type:"select",seriesId:"pie",dataIndex:e})}async clearSelection(){const{selectedId:t}=this;t&&this.chart.dispatchAction({type:"unselect",seriesId:"pie",dataIndex:this.getIndexById(t)})}renderCenterBlock(){const{icon:t,name:e,value:n,color:o}=this.centerData,{isClickable:a}=this,s=a?"button":"div",l=this.displayValue(n),c=a?{onKeyUp:this.onButtonKeyUp,onClick:this.onButtonClick,ref:t=>this.centerButtonElement=t,"aria-description":r("tecton.element.chartDonut.button.description"),"aria-roledescription":r("tecton.element.chartDonut.button.roleDescription")}:null;return i("div",{class:"center-card-container",style:{width:`calc(${this.innerRadius} - 10%)`}},i(s,Object.assign({class:"center-card","test-id":"centerCard"},c),t&&i("q2-icon",{type:t,style:o&&{"--tct-icon-stroke-primary":o,"--tct-icon-stroke-secondary":o,color:o}}),e&&i("div",{class:"name"},e),n&&i("div",{class:"value"},l)))}render(){return i("click-elsewhere",{onChange:this.onClickElsewhere},i("div",{class:"container"},i("div",{ref:t=>this.chartContainer=t,class:"chart-container","test-id":"chartContainer",onClick:this.onContainerClick}),this.renderCenterBlock()))}get hostElement(){return n(this)}static get watchers(){return{chartName:["propsUpdates"],innerRadius:["propsUpdates","innerRadiusUpdated"],outerRadius:["propsUpdates","outerRadiusUpdated"],minSliceSize:["propsUpdates"],hoverScaleSize:["propsUpdates"],selectedOffset:["propsUpdates"],data:["propsUpdates","dataUpdated"]}}};ei.style="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{position:relative;width:100%;display:block}.container{aspect-ratio:1/1;width:100%;display:flex;justify-content:center;align-items:center}.chart-container{width:100%;height:100%;--comp-color-1:var(--tct-chart-donut-color-1, var(--t-chart-donut-color-1, var(--t-accent-1, #e05252)));--comp-color-2:var(--tct-chart-donut-color-2, var(--t-chart-donut-color-2, var(--t-accent-2, #e09952)));--comp-color-3:var(--tct-chart-donut-color-3, var(--t-chart-donut-color-3, var(--t-accent-3, #e0e052)));--comp-color-4:var(--tct-chart-donut-color-4, var(--t-chart-donut-color-4, var(--t-accent-4, #99e052)));--comp-color-5:var(--tct-chart-donut-color-5, var(--t-chart-donut-color-5, var(--t-accent-5, #52e052)));--comp-color-6:var(--tct-chart-donut-color-6, var(--t-chart-donut-color-6, var(--t-accent-6, #52e099)));--comp-color-7:var(--tct-chart-donut-color-7, var(--t-chart-donut-color-7, var(--t-accent-7, #52e0e0)));--comp-color-8:var(--tct-chart-donut-color-8, var(--t-chart-donut-color-8, var(--t-accent-8, #5299e0)));--comp-color-9:var(--tct-chart-donut-color-9, var(--t-chart-donut-color-9, var(--t-accent-9, #5252e0)));--comp-color-10:var(--tct-chart-donut-color-10, var(--t-chart-donut-color-10, var(--t-accent-10, #9952e0)));--comp-color-11:var(--tct-chart-donut-color-11, var(--t-chart-donut-color-11, var(--t-accent-11, #e052e0)));--comp-color-12:var(--tct-chart-donut-color-12, var(--t-chart-donut-color-12, var(--t-accent-12, #e05299)))}.chart-container,.center-card{--comp-background-color:var(--tct-chart-donut-border-color, var(--t-chart-donut-border-color, var(--t-base, #ffffff)))}button{--comp-button-vertical-padding:var(--tct-chart-donut-button-vertical-padding, var(--t-chart-donut-button-vertical-padding, var(--app-scale-1x, 5px)));transition:box-shadow var(--tct-chart-donut-button-tween, var(--t-chart-donut-button-tween, var(--app-tween-1, 0.2s ease)));padding:var(--comp-button-vertical-padding) 0}button:active{box-shadow:var(--const-double-focus-ring), var(--tct-chart-donut-button-hover-box-shadow, var(--t-chart-donut-button-hover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))))}button:hover{box-shadow:var(--tct-chart-donut-button-hover-box-shadow, var(--t-chart-donut-button-hover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))))}button:focus{box-shadow:var(--const-double-focus-ring), var(--tct-chart-donut-button-hover-box-shadow, var(--t-chart-donut-button-hover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))))}.center-card-container{position:absolute;top:50%;transform:translateY(-50%);padding:var(--tct-chart-donut-button-container-padding, var(--t-chart-donut-button-container-padding, var(--app-scale-1x, 5px)))}.center-card{width:100%;text-align:center;color:var(--tct-chart-donut-text-color, var(--t-chart-donut-text-color, var(--t-text, #4d4d4d)));margin-inline:auto;display:block}.center-card:is(button){cursor:pointer;background:var(--comp-background-color);border:0;border-radius:var(--tct-chart-donut-button-border-radius, var(--t-chart-donut-button-border-radius, var(--app-border-radius-1, 3px)))}q2-icon{--tct-icon-size:var(--tct-chart-donut-icon-size, var(--t-chart-donut-icon-size, 26px));margin-bottom:var(--tct-chart-donut-icon-margin-bottom, var(--t-chart-donut-icon-margin-bottom, var(--app-scale-1x, 5px)))}.name{font-size:var(--tct-chart-donut-name-font-size, var(--t-chart-donut-name-font-size, 14px))}.value{font-size:var(--tct-chart-donut-value-font-size, var(--t-chart-donut-value-font-size, 21px))}";export{ei as q2_chart_donut}
1
+ import{r as t,c as e,h as i,g as n}from"./p-926a3e80.js";import{o,l as r,i as a}from"./p-9acfa94e.js";import{bn as s,V as l,_ as c,av as h,bo as u,bp as d,bq as f,x as v,b2 as p,a0 as m,br as b,I as g,bs as y,aJ as x,bt as w,bu as S,j as T,bv as M,E as C,bw as I,bx as k,by as z,bz as A,d as D,bA as N,bB as O,bC as L,bD as U,bE as B,bF as R,bG as P,bH as W,bI as F,bJ as Y,bK as j,D as G,bg as H,aH as X,bL as E,aY as _,bM as K,bN as q,bO as J,bP as Z,a as $,a9 as V,aZ as Q,bQ as tt,ax as et,bR as it,a6 as nt,m as ot,a5 as rt,o as at,y as st,bS as lt,bT as ct,b as ht,bU as ut,a$ as dt,bV as ft,bW as vt,bX as pt,c as mt,af as bt,G as gt,ay as yt,b3 as xt,az as wt,bY as St,a_ as Tt,u as Mt,at as Ct,W as It,bj as kt,bZ as zt,i as At,s as Dt,z as Nt,t as Ot,g as Lt,bb as Ut,b_ as Bt,U as Rt,b5 as Pt,C as Wt,ah as Ft,aj as Yt,a3 as jt,b$ as Gt,c0 as Ht,c1 as Xt,S as Et,c2 as _t,aa as Kt,ac as qt,ab as Jt}from"./p-52063431.js";import{l as Zt,a as $t,s as Vt,g as Qt,i as te}from"./p-833398d1.js";var ee=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return c(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(h);function ie(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function ne(t){if(d.domSupported)for(var e=document.documentElement.style,i=0,n=t.length;i<n;i++)if(t[i]in e)return t[i]}var oe=ne(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function re(t,e){if(!t)return e;e=u(e,!0);var i=t.indexOf(e);return(t=-1===i?e:"-"+t.slice(0,i)+"-"+e).toLowerCase()}var ae=re(ne(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),se=re(oe,"transform"),le="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(d.transform3dSupported?"will-change:transform;":"");function ce(t,e,i){var n=t.toFixed(0)+"px",o=e.toFixed(0)+"px";if(!d.transformSupported)return i?"top:"+o+";left:"+n+";":[["top",o],["left",n]];var r=d.transform3dSupported,a="translate"+(r?"3d":"")+"("+n+","+o+(r?",0":"")+")";return i?"top:0;left:0;"+se+":"+a+";":[["top",0],["left",0],[oe,a]]}function he(t,e,i,n,o){var r=e&&e.painter;if(i){var a=r&&r.getViewportRoot();a&&S(t,a,document.body,n,o)}else{t[0]=n,t[1]=o;var s=r&&r.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var ue=function(){function t(t,e,i){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._firstShow=!0,this._longHide=!0,d.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var o=this._zr=e.getZr(),r=this._appendToBody=i&&i.appendToBody;he(this._styleCoord,o,r,e.getWidth()/2,e.getHeight()/2),r?document.body.appendChild(n):t.appendChild(n),this._container=t;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=o.handler,i=o.painter.getViewportRoot();f(i,t,!0),e.dispatch("mousemove",t)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return t.prototype.update=function(t){var e,i,n,o=this._container,r=(i="position",(n=(e=o).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(e))?n[i]:null),a=o.style;"absolute"!==a.position&&"absolute"!==r&&(a.position="relative"),t.get("alwaysShowContent")&&this._moveIfResized(),this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,o=this._styleCoord;i.innerHTML?n.cssText=le+function(t,e,i){var n=[],o=t.get("transitionDuration"),r=t.get("backgroundColor"),a=t.get("shadowBlur"),l=t.get("shadowColor"),c=t.get("shadowOffsetX"),h=t.get("shadowOffsetY"),f=t.getModel("textStyle"),v=w(t,"html");return n.push("box-shadow:"+c+"px "+h+"px "+a+"px "+l),e&&o&&n.push(function(t,e){var i="cubic-bezier(0.23,1,0.32,1)",n=" "+t/2+"s "+i,o="opacity"+n+",visibility"+n;return e||(n=" "+t+"s "+i,o+=d.transformSupported?","+se+n:",left"+n+",top"+n),ae+":"+o}(o,i)),r&&n.push("background-color:"+r),g(["width","color","radius"],(function(e){var i="border-"+e,o=u(i),r=t.get(o);null!=r&&n.push(i+":"+r+("color"===e?"":"px"))})),n.push(function(t){var e=[],i=t.get("fontSize"),n=t.getTextColor();n&&e.push("color:"+n),e.push("font:"+t.getFont()),i&&e.push("line-height:"+Math.round(3*i/2)+"px");var o=t.get("textShadowColor"),r=t.get("textShadowBlur")||0,a=t.get("textShadowOffsetX")||0,s=t.get("textShadowOffsetY")||0;return o&&r&&e.push("text-shadow:"+a+"px "+s+"px "+r+"px "+o),g(["decoration","align"],(function(i){var n=t.get(i);n&&e.push("text-"+i+":"+n)})),e.join(";")}(f)),null!=v&&n.push("padding:"+s(v).join("px ")+"px"),n.join(";")+";"}(t,!this._firstShow,this._longHide)+ce(o[0],o[1],!0)+"border-color:"+v(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,i,n,o){var r=this.el;if(null!=t){var a="";if(p(o)&&"item"===i.get("trigger")&&!ie(i)&&(a=function(t,e,i){if(!p(i)||"inside"===i)return"";var n=t.get("backgroundColor"),o=t.get("borderWidth");e=v(e);var r,a,s="left"===(r=i)?"right":"right"===r?"left":"top"===r?"bottom":"top",l=Math.max(1.5*Math.round(o),6),c="",h=se+":";x(["left","right"],s)>-1?(c+="top:50%",h+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(c+="left:50%",h+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var u=a*Math.PI/180,d=l+o,f=d*Math.abs(Math.cos(u))+d*Math.abs(Math.sin(u)),m=e+" solid "+o+"px;";return'<div style="'+["position:absolute;width:"+l+"px;height:"+l+"px;z-index:-1;",(c+=";"+s+":-"+Math.round(100*((f-Math.SQRT2*o)/2+Math.SQRT2*o-(f-d)/2))/100+"px")+";"+h+";","border-bottom:"+m,"border-right:"+m,"background-color:"+n+";"].join("")+'"></div>'}(i,n,o)),p(t))r.innerHTML=t+a;else if(t){r.innerHTML="",m(t)||(t=[t]);for(var s=0;s<t.length;s++)b(t[s])&&t[s].parentNode!==r&&r.appendChild(t[s]);if(a&&r.childNodes.length){var l=document.createElement("div");l.innerHTML=a,r.appendChild(l)}}}else r.innerHTML=""},t.prototype.setEnterable=function(t){this._enterable=t},t.prototype.getSize=function(){var t=this.el;return[t.offsetWidth,t.offsetHeight]},t.prototype.moveTo=function(t,e){var i=this._styleCoord;if(he(i,this._zr,this._appendToBody,t,e),null!=i[0]&&null!=i[1]){var n=this.el.style,o=ce(i[0],i[1]);g(o,(function(t){n[t[0]]=t[1]}))}},t.prototype._moveIfResized=function(){var t=this._styleCoord[3];this.moveTo(this._styleCoord[2]*this._zr.getWidth(),t*this._zr.getHeight())},t.prototype.hide=function(){var t=this,e=this.el.style;e.visibility="hidden",e.opacity="0",d.transform3dSupported&&(e.willChange=""),this._show=!1,this._longHideTimeout=setTimeout((function(){return t._longHide=!0}),500)},t.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(y(this.hide,this),t)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this.el.parentNode.removeChild(this.el)},t}(),de=function(){function t(t){this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._zr=t.getZr(),pe(this._styleCoord,this._zr,t.getWidth()/2,t.getHeight()/2)}return t.prototype.update=function(t){t.get("alwaysShowContent")&&this._moveIfResized()},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},t.prototype.setContent=function(t,e,i,n){var o=this;T(t)&&M(""),this.el&&this._zr.remove(this.el);var r=i.getModel("textStyle");this.el=new C({style:{rich:e.richTextStyles,text:t,lineHeight:22,borderWidth:1,borderColor:n,textShadowColor:r.get("textShadowColor"),fill:i.get(["textStyle","color"]),padding:w(i,"richText"),verticalAlign:"top",align:"left"},z:i.get("z")}),g(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],(function(t){o.el.style[t]=i.get(t)})),g(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],(function(t){o.el.style[t]=r.get(t)||0})),this._zr.add(this.el);var a=this;this.el.on("mouseover",(function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0})),this.el.on("mouseout",(function(){a._enterable&&a._show&&a.hideLater(a._hideDelay),a._inContent=!1}))},t.prototype.setEnterable=function(t){this._enterable=t},t.prototype.getSize=function(){var t=this.el,e=this.el.getBoundingRect(),i=ve(t.style);return[e.width+i.left+i.right,e.height+i.top+i.bottom]},t.prototype.moveTo=function(t,e){var i=this.el;if(i){var n=this._styleCoord;pe(n,this._zr,t,e),t=n[0],e=n[1];var o=i.style,r=fe(o.borderWidth||0),a=ve(o);i.x=t+r+a.left,i.y=e+r+a.top,i.markRedraw()}},t.prototype._moveIfResized=function(){var t=this._styleCoord[3];this.moveTo(this._styleCoord[2]*this._zr.getWidth(),t*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(y(this.hide,this),t)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t}();function fe(t){return Math.max(0,t)}function ve(t){var e=fe(t.shadowBlur||0),i=fe(t.shadowOffsetX||0),n=fe(t.shadowOffsetY||0);return{left:fe(e-i),right:fe(e+i),top:fe(e-n),bottom:fe(e+n)}}function pe(t,e,i,n){t[0]=i,t[1]=n,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var me=new l({shape:{x:-1,y:-1,width:2,height:2}}),be=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return c(e,t),e.prototype.init=function(t,e){if(!d.node&&e.getDom()){var i=t.getComponent("tooltip"),n=this._renderMode=I(i.get("renderMode"));this._tooltipContent="richText"===n?new de(e):new ue(e.getDom(),e,{appendToBody:i.get("appendToBody",!0)})}},e.prototype.render=function(t,e,i){if(!d.node&&i.getDom()){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=i,this._alwaysShowContent=t.get("alwaysShowContent");var n=this._tooltipContent;n.update(t),n.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow(),"richText"!==this._renderMode&&t.get("transitionDuration")?k(this,"_updatePosition",50,"fixRate"):z(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var t=this._tooltipModel.get("triggerOn");A("itemTooltip",this._api,y((function(e,i,n){"none"!==t&&(t.indexOf(e)>=0?this._tryShow(i,n):"leave"===e&&this._hide(n))}),this))},e.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,i=this._api,n=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==n&&"click"!==n){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!i.isDisposed()&&o.manuallyShowTip(t,e,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})}))}},e.prototype.manuallyShowTip=function(t,e,i,n){if(n.from!==this.uid&&!d.node&&i.getDom()){var o=ye(n,i);this._ticket="";var r=n.dataByCoordSys,a=function(t,e,i){var n=q(t).queryOptionMap,o=n.keys()[0];if(o&&"series"!==o){var r,a=J(e,o,n.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a)return i.getViewOfComponentModel(a).group.traverse((function(e){var i=D(e).tooltipConfig;if(i&&i.name===t.name)return r=e,!0})),r?{componentMainType:o,componentIndex:a.componentIndex,el:r}:void 0}}(n,e,i);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:n.position,positionDefault:"bottom"},o)}else if(n.tooltip&&null!=n.x&&null!=n.y){var l=me;l.x=n.x,l.y=n.y,l.update(),D(l).tooltipConfig={name:null,option:n.tooltip},this._tryShow({offsetX:n.x,offsetY:n.y,target:l},o)}else if(r)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,dataByCoordSys:r,tooltipOption:n.tooltipOption},o);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(t,e,i,n))return;var c=N(n,e),h=c.point[0],u=c.point[1];null!=h&&null!=u&&this._tryShow({offsetX:h,offsetY:u,target:c.el,position:n.position,positionDefault:"bottom"},o)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target},o))}},e.prototype.manuallyHideTip=function(t,e,i,n){!this._alwaysShowContent&&this._tooltipModel&&this._tooltipContent.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,n.from!==this.uid&&this._hide(ye(n,i))},e.prototype._manuallyAxisShowTip=function(t,e,i,n){var o=n.seriesIndex,r=n.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=r&&null!=a){var s=e.getSeriesByIndex(o);if(s&&"axis"===ge([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:r,position:n.position}),!0}},e.prototype._tryShow=function(t,e){var i=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var n=t.dataByCoordSys;if(n&&n.length)this._showAxisTooltip(n,t);else if(i){var o,r;this._lastDataByCoordSys=null,O(i,(function(t){return null!=D(t).dataIndex?(o=t,!0):null!=D(t).tooltipConfig?(r=t,!0):void 0}),!0),o?this._showSeriesItemTooltip(t,o,e):r?this._showComponentItemTooltip(t,r,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},e.prototype._showOrMove=function(t,e){var i=t.get("showDelay");e=y(e,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(e,i):e()},e.prototype._showAxisTooltip=function(t,e){var i=this._ecModel,n=this._tooltipModel,o=[e.offsetX,e.offsetY],r=ge([e.tooltipOption],n),a=this._renderMode,s=[],l=L("section",{blocks:[],noHeader:!0}),c=[],h=new Z;g(t,(function(t){g(t.dataByAxis,(function(t){var e=i.getComponent(t.axisDim+"Axis",t.axisIndex),o=t.value;if(e&&null!=o){var r=U(o,e.axis,i,t.seriesDataIndices,t.valueLabelOpt),u=L("section",{header:r,noHeader:!B(r),sortBlocks:!0,blocks:[]});l.blocks.push(u),g(t.seriesDataIndices,(function(l){var d=i.getSeriesByIndex(l.seriesIndex),f=l.dataIndexInside,p=d.getDataParams(f);if(!(p.dataIndex<0)){p.axisDim=t.axisDim,p.axisIndex=t.axisIndex,p.axisType=t.axisType,p.axisId=t.axisId,p.axisValue=R(e.axis,{value:o}),p.axisValueLabel=r,p.marker=h.makeTooltipMarker("item",v(p.color),a);var m=P(d.formatTooltip(f,!0,null)),b=m.frag;if(b){var g=ge([d],n).get("valueFormatter");u.blocks.push(g?$({valueFormatter:g},b):b)}m.text&&c.push(m.text),s.push(p)}}))}}))})),l.blocks.reverse(),c.reverse();var u=e.position,d=r.get("order"),f=W(l,h,a,d,i.get("useUTC"),r.get("textStyle"));f&&c.unshift(f);var p=c.join("richText"===a?"\n\n":"<br/>");this._showOrMove(r,(function(){this._updateContentNotChangedOnAxis(t,s)?this._updatePosition(r,u,o[0],o[1],this._tooltipContent,s):this._showTooltipContent(r,p,s,Math.random()+"",o[0],o[1],u,null,h)}))},e.prototype._showSeriesItemTooltip=function(t,e,i){var n=this._ecModel,o=D(e),r=o.seriesIndex,a=n.getSeriesByIndex(r),s=o.dataModel||a,l=o.dataIndex,c=o.dataType,h=s.getData(c),u=this._renderMode,d=t.positionDefault,f=ge([h.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),p=f.get("trigger");if(null==p||"item"===p){var m=s.getDataParams(l,c),b=new Z;m.marker=b.makeTooltipMarker("item",v(m.color),u);var g=P(s.formatTooltip(l,!1,c)),y=f.get("order"),x=f.get("valueFormatter"),w=g.frag,S=w?W(x?$({valueFormatter:x},w):w,b,u,y,n.get("useUTC"),f.get("textStyle")):g.text,T="item_"+s.name+"_"+l;this._showOrMove(f,(function(){this._showTooltipContent(f,S,m,T,t.offsetX,t.offsetY,t.position,t.target,b)})),i({type:"showTip",dataIndexInside:l,dataIndex:h.getRawIndex(l),seriesIndex:r,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,e,i){var n=D(e),o=n.tooltipConfig.option||{};p(o)&&(o={content:o,formatter:o});var r=[o],a=this._ecModel.getComponent(n.componentMainType,n.componentIndex);a&&r.push(a),r.push({formatter:o.content});var s=t.positionDefault,l=ge(r,this._tooltipModel,s?{position:s}:null),c=l.get("content"),h=Math.random()+"",u=new Z;this._showOrMove(l,(function(){var i=F(l.get("formatterParams")||{});this._showTooltipContent(l,c,i,h,t.offsetX,t.offsetY,t.position,e,u)})),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,e,i,n,o,r,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var c=this._tooltipContent;c.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var u=e,d=this._getNearestPoint([o,r],i,t.get("trigger"),t.get("borderColor")).color;if(h)if(p(h)){var f=t.ecModel.get("useUTC"),v=m(i)?i[0]:i;u=h,v&&v.axisType&&v.axisType.indexOf("time")>=0&&(u=Y(v.axisValue,u,f)),u=j(u,i,!0)}else if(G(h)){var b=y((function(e,n){e===this._ticket&&(c.setContent(n,l,t,d,a),this._updatePosition(t,a,o,r,c,i,s))}),this);this._ticket=n,u=h(i,n,b)}else u=h;c.setContent(u,l,t,d,a),c.show(t,d),this._updatePosition(t,a,o,r,c,i,s)}},e.prototype._getNearestPoint=function(t,e,i,n){return"axis"===i||m(e)?{color:n||("html"===this._renderMode?"#fff":"none")}:m(e)?void 0:{color:n||e.color||e.borderColor}},e.prototype._updatePosition=function(t,e,i,n,o,r,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var c=o.getSize(),h=t.get("align"),u=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),G(e)&&(e=e([i,n],r,o.el,d,{viewSize:[s,l],contentSize:c.slice()})),m(e))i=H(e[0],s),n=H(e[1],l);else if(T(e)){var f=e;f.width=c[0],f.height=c[1];var v=X(f,{width:s,height:l});i=v.x,n=v.y,h=null,u=null}else if(p(e)&&a){var b=function(t,e,i,n){var o=i[0],r=i[1],a=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,c=e.width,h=e.height;switch(t){case"inside":s=e.x+c/2-o/2,l=e.y+h/2-r/2;break;case"top":s=e.x+c/2-o/2,l=e.y-r-a;break;case"bottom":s=e.x+c/2-o/2,l=e.y+h+a;break;case"left":s=e.x-o-a,l=e.y+h/2-r/2;break;case"right":s=e.x+c+a,l=e.y+h/2-r/2}return[s,l]}(e,d,c,t.get("borderWidth"));i=b[0],n=b[1]}else b=function(t,e,i,n,o,r,a){var s=i.getSize(),l=s[0],c=s[1];return null!=r&&(t+l+r+2>n?t-=l+r:t+=r),null!=a&&(e+c+a>o?e-=c+a:e+=a),[t,e]}(i,n,o,s,l,h?null:20,u?null:20),i=b[0],n=b[1];h&&(i-=xe(h)?c[0]/2:"right"===h?c[0]:0),u&&(n-=xe(u)?c[1]/2:"bottom"===u?c[1]:0),ie(t)&&(b=function(t,e,i,n,o){var r=i.getSize(),a=r[0],s=r[1];return t=Math.min(t+a,n)-a,e=Math.min(e+s,o)-s,[t=Math.max(t,0),e=Math.max(e,0)]}(i,n,o,s,l),i=b[0],n=b[1]),o.moveTo(i,n)},e.prototype._updateContentNotChangedOnAxis=function(t,e){var i=this._lastDataByCoordSys,n=this._cbParamsList,o=!!i&&i.length===t.length;return o&&g(i,(function(i,r){var a=i.dataByAxis||[],s=(t[r]||{}).dataByAxis||[];(o=o&&a.length===s.length)&&g(a,(function(t,i){var r=s[i]||{},a=t.seriesDataIndices||[],l=r.seriesDataIndices||[];(o=o&&t.value===r.value&&t.axisType===r.axisType&&t.axisId===r.axisId&&a.length===l.length)&&g(a,(function(t,e){var i=l[e];o=o&&t.seriesIndex===i.seriesIndex&&t.dataIndex===i.dataIndex})),n&&g(t.seriesDataIndices,(function(t){var i=t.seriesIndex,r=e[i],a=n[i];r&&a&&a.data!==r.data&&(o=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!o},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,e){!d.node&&e.getDom()&&(z(this,"_updatePosition"),this._tooltipContent.dispose(),E("itemTooltip",e))},e.type="tooltip",e}(_);function ge(t,e,i){var n,o=e.ecModel;i?(n=new K(i,o,o),n=new K(e.option,n,o)):n=e;for(var r=t.length-1;r>=0;r--){var a=t[r];a&&(a instanceof K&&(a=a.get("tooltip",!0)),p(a)&&(a={formatter:a}),a&&(n=new K(a,n,o)))}return n}function ye(t,e){return t.dispatchAction||y(e.dispatchAction,e)}function xe(t){return"center"===t||"middle"===t}var we=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.layoutMode={type:"box",ignoreSize:!0},i}return c(e,t),e.prototype.init=function(t,e,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(e,i){t.prototype.mergeOption.call(this,e,i),this._updateSelector(e)},e.prototype._updateSelector=function(t){var e=t.selector,i=this.ecModel;!0===e&&(e=t.selector=["all","inverse"]),m(e)&&g(e,(function(t,n){p(t)&&(t={type:t}),e[n]=et(t,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(i,t.type))}))},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,i=0;i<t.length;i++){var n=t[i].get("name");if(this.isSelected(n)){this.select(n),e=!0;break}}!e&&this.select(t[0].get("name"))}},e.prototype._updateData=function(t){var e=[],i=[];t.eachRawSeries((function(n){var o;if(i.push(n.name),n.legendVisualProvider){var r=n.legendVisualProvider.getAllNames();t.isSeriesFiltered(n)||(i=i.concat(r)),r.length?e=e.concat(r):o=!0}else o=!0;o&&it(n)&&e.push(n.name)})),this._availableNames=i;var n=this.get("data")||e,o=nt(),r=ot(n,(function(t){return(p(t)||at(t))&&(t={name:t}),o.get(t.name)?null:(o.set(t.name,!0),new K(t,this,this.ecModel))}),this);this._data=rt(r,(function(t){return!!t}))},e.prototype.getData=function(){return this._data},e.prototype.select=function(t){var e=this.option.selected;"single"===this.get("selectedMode")&&g(this._data,(function(t){e[t.get("name")]=!1})),e[t]=!0},e.prototype.unSelect=function(t){"single"!==this.get("selectedMode")&&(this.option.selected[t]=!1)},e.prototype.toggleSelected=function(t){var e=this.option.selected;e.hasOwnProperty(t)||(e[t]=!0),this[e[t]?"unSelect":"select"](t)},e.prototype.allSelect=function(){var t=this.option.selected;g(this._data,(function(e){t[e.get("name",!0)]=!0}))},e.prototype.inverseSelect=function(){var t=this.option.selected;g(this._data,(function(e){var i=e.get("name",!0);t.hasOwnProperty(i)||(t[i]=!0),t[i]=!t[i]}))},e.prototype.isSelected=function(t){var e=this.option.selected;return!(e.hasOwnProperty(t)&&!e[t])&&x(this._availableNames,t)>=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(h),Se=bt,Te=g,Me=gt,Ce=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.newlineDisabled=!1,i}return c(e,t),e.prototype.init=function(){this.group.add(this._contentGroup=new Me),this.group.add(this._selectorGroup=new Me),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,e,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var o=t.get("align"),r=t.get("orient");o&&"auto"!==o||(o="right"===t.get("left")&&"vertical"===r?"right":"left");var a=t.get("selector",!0),c=t.get("selectorPosition",!0);!a||c&&"auto"!==c||(c="horizontal"===r?"end":"start"),this.renderInner(o,t,e,i,a,r,c);var h=t.getBoxLayoutParams(),u={width:i.getWidth(),height:i.getHeight()},d=t.get("padding"),f=X(h,u,d),v=this.layoutInner(t,o,f,n,a,c),p=X(st({width:v.width,height:v.height},h),u,d);this.group.x=p.x-v.x,this.group.y=p.y-v.y,this.group.markRedraw(),this.group.add(this._backgroundEl=function(t,e){var i=s(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),new l({shape:{x:t.x-i[3],y:t.y-i[0],width:t.width+i[1]+i[3],height:t.height+i[0]+i[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1})}(v,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,e,i,n,o,r,a){var s=this.getContentGroup(),l=nt(),c=e.get("selectedMode"),h=[];i.eachRawSeries((function(t){!t.get("legendHoverLink")&&h.push(t.id)})),Te(e.getData(),(function(o,r){var a=o.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var u=new Me;return u.newline=!0,void s.add(u)}var d=i.getSeriesByName(a)[0];if(!l.get(a))if(d){var f=d.getData(),v=f.getVisual("legendLineStyle")||{},p=f.getVisual("legendIcon"),m=f.getVisual("style");this._createItem(d,a,r,o,e,t,v,m,p,c,n).on("click",Se(Ie,a,null,n,h)).on("mouseover",Se(ze,d.name,null,n,h)).on("mouseout",Se(Ae,d.name,null,n,h)),l.set(a,!0)}else i.eachRawSeries((function(i){if(!l.get(a)&&i.legendVisualProvider){var s=i.legendVisualProvider;if(!s.containName(a))return;var u=s.indexOfName(a),d=s.getItemVisual(u,"style"),f=s.getItemVisual(u,"legendIcon"),v=lt(d.fill);v&&0===v[3]&&(v[3]=.2,d=$($({},d),{fill:ct(v,"rgba")})),this._createItem(i,a,r,o,e,t,{},d,f,c,n).on("click",Se(Ie,null,a,n,h)).on("mouseover",Se(ze,null,a,n,h)).on("mouseout",Se(Ae,null,a,n,h)),l.set(a,!0)}}),this)}),this),o&&this._createSelector(o,e,n,r,a)},e.prototype._createSelector=function(t,e,i){var n=this.getSelectorGroup();Te(t,(function(t){var o=t.type,r=new C({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:"all"===o?"legendAllSelect":"legendInverseSelect"})}});n.add(r);var a=e.getModel("selectorLabel"),s=e.getModel(["emphasis","selectorLabel"]);ht(r,{normal:a,emphasis:s},{defaultText:t.title}),ut(r)}))},e.prototype._createItem=function(t,e,i,n,o,r,a,s,c,h,u){var d,f,v,m=t.visualDrawType,b=o.get("itemWidth"),g=o.get("itemHeight"),y=o.isSelected(e),x=n.get("symbolRotate"),w=n.get("symbolKeepAspect"),S=n.get("icon"),T=function(t,e,i,n,o,r,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),Te(t,(function(i,n){"inherit"===t[n]&&(t[n]=e[n])}))}var l=e.getModel("itemStyle"),c=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",u=l.getShallow("decal");c.decal=u&&"inherit"!==u?pt(u,a):n.decal,"inherit"===c.fill&&(c.fill=n[o]),"inherit"===c.stroke&&(c.stroke=n[h]),"inherit"===c.opacity&&(c.opacity=("fill"===o?n:i).opacity),s(c,n);var d=e.getModel("lineStyle"),f=d.getLineStyle();if(s(f,i),"auto"===c.fill&&(c.fill=n.fill),"auto"===c.stroke&&(c.stroke=n.fill),"auto"===f.stroke&&(f.stroke=n.fill),!r){var v=e.get("inactiveBorderWidth");c.lineWidth="auto"===v?n.lineWidth>0&&c[h]?2:0:c.lineWidth,c.fill=e.get("inactiveColor"),c.stroke=e.get("inactiveBorderColor"),f.stroke=d.get("inactiveColor"),f.lineWidth=d.get("inactiveWidth")}return{itemStyle:c,lineStyle:f}}(c=S||c||"roundRect",n,a,s,m,y,u),M=new Me,I=n.getModel("textStyle");if(!G(t.getLegendIcon)||S&&"inherit"!==S){var k="inherit"===S&&t.getData().getVisual("symbol")?"inherit"===x?t.getData().getVisual("symbolRotate"):x:0;M.add(((v=mt(f=(d={itemWidth:b,itemHeight:g,icon:c,iconRotate:k,itemStyle:T.itemStyle,lineStyle:T.lineStyle,symbolKeepAspect:w}).icon||"roundRect",0,0,d.itemWidth,d.itemHeight,d.itemStyle.fill,d.symbolKeepAspect)).setStyle(d.itemStyle),v.rotation=(d.iconRotate||0)*Math.PI/180,v.setOrigin([d.itemWidth/2,d.itemHeight/2]),f.indexOf("empty")>-1&&(v.style.stroke=v.style.fill,v.style.fill="#fff",v.style.lineWidth=2),v))}else M.add(t.getLegendIcon({itemWidth:b,itemHeight:g,icon:c,iconRotate:x,itemStyle:T.itemStyle,lineStyle:T.lineStyle,symbolKeepAspect:w}));var z="left"===r?b+5:-5,A=r,D=o.get("formatter"),N=e;p(D)&&D?N=D.replace("{name}",null!=e?e:""):G(D)&&(N=D(e));var O=n.get("inactiveColor");M.add(new C({style:dt(I,{text:N,x:z,y:g/2,fill:y?I.getTextColor():O,align:A,verticalAlign:"middle"})}));var L=new l({shape:M.getBoundingRect(),invisible:!0}),U=n.getModel("tooltip");return U.get("show")&&ft({el:L,componentModel:o,itemName:e,itemTooltipOption:U.option}),M.add(L),M.eachChild((function(t){t.silent=!0})),L.silent=!h,this.getContentGroup().add(M),ut(M),M.__legendDataIndex=i,M},e.prototype.layoutInner=function(t,e,i,n,o,r){var a=this.getContentGroup(),s=this.getSelectorGroup();vt(t.get("orient"),a,t.get("itemGap"),i.width,i.height);var l=a.getBoundingRect(),c=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),o){vt("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),u=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),f=t.getOrient().index,v=0===f?"width":"height",p=0===f?"height":"width",m=0===f?"y":"x";"end"===r?u[f]+=l[v]+d:c[f]+=h[v]+d,u[1-f]+=l[p]/2-h[p]/2,s.x=u[0],s.y=u[1],a.x=c[0],a.y=c[1];var b={x:0,y:0};return b[v]=l[v]+d+h[v],b[p]=Math.max(l[p],h[p]),b[m]=Math.min(0,h[m]+u[1-f]),b}return a.x=c[0],a.y=c[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(_);function Ie(t,e,i,n){Ae(t,e,i,n),i.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),ze(t,e,i,n)}function ke(t){for(var e,i=t.getZr().storage.getDisplayList(),n=0,o=i.length;n<o&&!(e=i[n].states.emphasis);)n++;return e&&e.hoverLayer}function ze(t,e,i,n){ke(i)||i.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function Ae(t,e,i,n){ke(i)||i.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}function De(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries((function(t){for(var i=0;i<e.length;i++)if(!e[i].isSelected(t.name))return!1;return!0}))}function Ne(t,e,i){var n,o={},r="toggleSelected"===t;return i.eachComponent("legend",(function(i){r&&null!=n?i[n?"select":"unSelect"](e.name):"allSelect"===t||"inverseSelect"===t?i[t]():(i[t](e.name),n=i.isSelected(e.name));var a=i.getData();g(a,(function(t){var e=t.get("name");if("\n"!==e&&""!==e){var n=i.isSelected(e);o[e]=o.hasOwnProperty(e)?o[e]&&n:n}}))})),"allSelect"===t||"inverseSelect"===t?{selected:o}:{name:e.name,selected:o}}function Oe(t){t.registerComponentModel(we),t.registerComponentView(Ce),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,De),t.registerSubTypeDefaulter("legend",(function(){return"plain"})),function(t){t.registerAction("legendToggleSelect","legendselectchanged",bt(Ne,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",bt(Ne,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",bt(Ne,"inverseSelect")),t.registerAction("legendSelect","legendselected",bt(Ne,"select")),t.registerAction("legendUnSelect","legendunselected",bt(Ne,"unSelect"))}(t)}var Le=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return c(e,t),e.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},e.prototype.init=function(e,i,n){var o=yt(e);t.prototype.init.call(this,e,i,n),Ue(this,e,o)},e.prototype.mergeOption=function(e,i){t.prototype.mergeOption.call(this,e,i),Ue(this,this.option,e)},e.type="legend.scroll",e.defaultOption=xt(we.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:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e}(we);function Ue(t,e,i){var n=[1,1];n[t.getOrient().index]=0,wt(e,i,{type:"box",ignoreSize:!!n})}var Be=gt,Re=["width","height"],Pe=["x","y"],We=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.newlineDisabled=!0,i._currentIndex=0,i}return c(e,t),e.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new Be),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Be)},e.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(e,i,n,o,r,a,s){var l=this;t.prototype.renderInner.call(this,e,i,n,o,r,a,s);var c=this._controllerGroup,h=i.get("pageIconSize",!0),u=m(h)?h:[h,h];f("pagePrev",0);var d=i.getModel("pageTextStyle");function f(t,e){var n=t+"DataIndex",r=St(i.get("pageIcons",!0)[i.getOrient().name][e],{onclick:y(l._pageGo,l,n,i,o)},{x:-u[0]/2,y:-u[1]/2,width:u[0],height:u[1]});r.name=t,c.add(r)}c.add(new C({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),f("pageNext",1)},e.prototype.layoutInner=function(t,e,i,n,o,r){var a=this.getSelectorGroup(),s=t.getOrient().index,l=Re[s],c=Pe[s],h=Re[1-s],u=Pe[1-s];o&&vt("horizontal",a,t.get("selectorItemGap",!0));var d=t.get("selectorButtonGap",!0),f=a.getBoundingRect(),v=[-f.x,-f.y],p=F(i);o&&(p[l]=i[l]-f[l]-d);var m=this._layoutContentAndController(t,n,p,s,l,h,u,c);if(o){if("end"===r)v[s]+=m[l]+d;else{var b=f[l]+d;v[s]-=b,m[c]-=b}m[l]+=f[l]+d,v[1-s]+=m[u]+m[h]/2-f[h]/2,m[h]=Math.max(m[h],f[h]),m[u]=Math.min(m[u],f[u]+v[1-s]),a.x=v[0],a.y=v[1],a.markRedraw()}return m},e.prototype._layoutContentAndController=function(t,e,i,n,o,r,a,s){var c=this.getContentGroup(),h=this._containerGroup,u=this._controllerGroup;vt(t.get("orient"),c,t.get("itemGap"),n?i.width:null,n?null:i.height),vt("horizontal",u,t.get("pageButtonItemGap",!0));var d=c.getBoundingRect(),f=u.getBoundingRect(),v=this._showController=d[o]>i[o],p=[-d.x,-d.y];e||(p[n]=c[s]);var m=[0,0],b=[-f.x,-f.y],g=Tt(t.get("pageButtonGap",!0),t.get("itemGap",!0));v&&("end"===t.get("pageButtonPosition",!0)?b[n]+=i[o]-f[o]:m[n]+=f[o]+g),b[1-n]+=d[r]/2-f[r]/2,c.setPosition(p),h.setPosition(m),u.setPosition(b);var y={x:0,y:0};if(y[o]=v?i[o]:d[o],y[r]=Math.max(d[r],f[r]),y[a]=Math.min(0,f[a]+b[1-n]),h.__rectSize=i[o],v){var x={x:0,y:0};x[o]=Math.max(i[o]-f[o]-g,0),x[r]=y[r],h.setClipPath(new l({shape:x})),h.__rectSize=x[o]}else u.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));var w=this._getPageInfo(t);return null!=w.pageIndex&&Mt(c,{x:w.contentPosition[0],y:w.contentPosition[1]},v?t:null),this._updatePageInfoView(t,w),y},e.prototype._pageGo=function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var i=this._controllerGroup;g(["pagePrev","pageNext"],(function(n){var o=null!=e[n+"DataIndex"],r=i.childOfName(n);r&&(r.setStyle("fill",t.get(o?"pageIconColor":"pageIconInactiveColor",!0)),r.cursor=o?"pointer":"default")}));var n=i.childOfName("pageText"),o=t.get("pageFormatter"),r=e.pageIndex,a=null!=r?r+1:0,s=e.pageCount;n&&o&&n.setStyle("text",p(o)?o.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):o({current:a,total:s}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,o=t.getOrient().index,r=Re[o],a=Pe[o],s=this._findTargetItemIndex(e),l=i.children(),c=l[s],h=l.length,u=h?1:0,d={contentPosition:[i.x,i.y],pageCount:u,pageIndex:u-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return d;var f=g(c);d.contentPosition[o]=-f.s;for(var v=s+1,p=f,m=f,b=null;v<=h;++v)(!(b=g(l[v]))&&m.e>p.s+n||b&&!y(b,p.s))&&(p=m.i>p.i?m:b)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=p.i),++d.pageCount),m=b;for(v=s-1,p=f,m=f,b=null;v>=-1;--v)(b=g(l[v]))&&y(m,b.s)||!(p.i<m.i)||(m=p,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=p.i),++d.pageCount,++d.pageIndex),p=b;return d;function g(t){if(t){var e=t.getBoundingRect(),i=e[a]+t[a];return{s:i,e:i+e[r],i:t.__legendDataIndex}}}function y(t,e){return t.e>=e&&t.s<=e+n}},e.prototype._findTargetItemIndex=function(t){return this._showController?(this.getContentGroup().eachChild((function(n,o){var r=n.__legendDataIndex;null==i&&null!=r&&(i=o),r===t&&(e=o)})),null!=e?e:i):0;var e,i},e.type="legend.scroll",e}(Ce);function Fe(t){V(Oe),t.registerComponentModel(Le),t.registerComponentView(We),function(t){t.registerAction("legendScroll","legendscroll",(function(t,e){var i=t.scrollDataIndex;null!=i&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(i)}))}))}(t)}var Ye=2*Math.PI,je=Math.PI/180;function Ge(t,e){return X(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function He(t,e){var i=Ge(t,e),n=t.get("center"),o=t.get("radius");m(o)||(o=[0,o]);var r,a,s=H(i.width,e.getWidth()),l=H(i.height,e.getHeight()),c=Math.min(s,l),h=H(o[0],c/2),u=H(o[1],c/2),d=t.coordinateSystem;if(d){var f=d.dataToPoint(n);r=f[0]||0,a=f[1]||0}else m(n)||(n=[n,n]),r=H(n[0],s)+i.x,a=H(n[1],l)+i.y;return{cx:r,cy:a,r0:h,r:u}}function Xe(t,e,i){e.eachSeriesByType(t,(function(t){var e=t.getData(),n=e.mapDimension("value"),o=Ge(t,i),r=He(t,i),a=r.cx,s=r.cy,l=r.r,c=r.r0,h=-t.get("startAngle")*je,u=t.get("minAngle")*je,d=0;e.each(n,(function(t){!isNaN(t)&&d++}));var f=e.getSum(n),v=Math.PI/(f||d)*2,p=t.get("clockwise"),m=t.get("roseType"),b=t.get("stillShowZeroSum"),g=e.getDataExtent(n);g[0]=0;var y=Ye,x=0,w=h,S=p?1:-1;if(e.setLayout({viewRect:o,r:l}),e.each(n,(function(t,i){var n;if(isNaN(t))e.setItemLayout(i,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:p,cx:a,cy:s,r0:c,r:m?NaN:l});else{(n="area"!==m?0===f&&b?v:t*v:Ye/d)<u?(n=u,y-=u):x+=t;var o=w+S*n;e.setItemLayout(i,{angle:n,startAngle:w,endAngle:o,clockwise:p,cx:a,cy:s,r0:c,r:m?Ct(t,g,[c,l]):l}),w=o}})),y<Ye&&d)if(y<=.001){var T=Ye/d;e.each(n,(function(t,i){if(!isNaN(t)){var n=e.getItemLayout(i);n.angle=T,n.startAngle=h+S*i*T,n.endAngle=h+S*(i+1)*T}}))}else v=y/x,w=h,e.each(n,(function(t,i){if(!isNaN(t)){var n=e.getItemLayout(i),o=n.angle===u?u:t*v;n.startAngle=w,n.endAngle=w+S*o,w+=S*o}}))}))}var Ee=Math.PI/180;function _e(t,e,i,n,o,r,a,s,l,c){if(!(t.length<2)){for(var h=t.length,u=0;u<h;u++)"outer"===t[u].position&&"labelLine"===t[u].labelAlignTo&&(t[u].linePoints[1][0]+=t[u].label.x-c,t[u].label.x=c);kt(t,l,l+a)&&function(t){for(var r={list:[],maxY:0},a={list:[],maxY:0},s=0;s<t.length;s++)if("none"===t[s].labelAlignTo){var l=t[s],c=l.label.y>i?a:r,h=Math.abs(l.label.y-i);if(h>=c.maxY){var u=l.label.x-e-l.len2*o,f=n+l.len,v=Math.abs(u)<f?Math.sqrt(h*h/(1-u*u/f/f)):f;c.rB=v,c.maxY=h}c.list.push(l)}d(r),d(a)}(t)}function d(t){for(var r=t.rB,a=r*r,s=0;s<t.list.length;s++){var l=t.list[s],c=Math.abs(l.label.y-i),h=n+l.len,u=h*h,d=Math.sqrt((1-Math.abs(c*c/a))*u),f=e+(d+l.len2)*o;Ke(l,l.targetTextWidth-(f-l.label.x)*o,!0),l.label.x=f}}}function Ke(t,e,i){if(void 0===i&&(i=!1),null==t.labelStyleWidth){var n=t.label,o=n.style,r=t.rect,a=o.backgroundColor,s=o.padding,l=s?s[1]+s[3]:0,c=o.overflow,h=r.width+(a?0:l);if(e<h||i){var u=r.height;if(c&&c.match("break")){n.setStyle("backgroundColor",null),n.setStyle("width",e-l);var d=n.getBoundingRect();n.setStyle("width",Math.ceil(d.width)),n.setStyle("backgroundColor",a)}else{var f=e-l;n.setStyle("width",e<h?f:i?f>t.unconstrainedWidth?null:f:null)}var v=n.getBoundingRect();r.width=v.width,r.height=v.height+((n.style.margin||0)+2.1),r.y-=(r.height-u)/2}}}function qe(t){return"center"===t.position}function Je(t,e,i){var n=t.get("borderRadius");if(null==n)return i?{cornerRadius:0}:null;m(n)||(n=[n,n,n,n]);var o=Math.abs(e.r||0-e.r0||0);return{cornerRadius:ot(n,(function(t){return zt(t,o)}))}}var Ze=function(t){function e(e,i,n){var o=t.call(this)||this;o.z2=2;var r=new C;return o.setTextContent(r),o.updateData(e,i,n,!0),o}return c(e,t),e.prototype.updateData=function(t,e,i,n){var o=this,r=t.hostModel,a=t.getItemModel(e),s=a.getModel("emphasis"),l=t.getItemLayout(e),c=$(Je(a.getModel("itemStyle"),l,!0),l);if(isNaN(c.startAngle))o.setShape(c);else{if(n){o.setShape(c);var h=r.getShallow("animationType");r.ecModel.ssr?(At(o,{scaleX:0,scaleY:0},r,{dataIndex:e,isFrom:!0}),o.originX=c.cx,o.originY=c.cy):"scale"===h?(o.shape.r=l.r0,At(o,{shape:{r:l.r}},r,e)):null!=i?(o.setShape({startAngle:i,endAngle:i}),At(o,{shape:{startAngle:l.startAngle,endAngle:l.endAngle}},r,e)):(o.shape.endAngle=l.startAngle,Mt(o,{shape:{endAngle:l.endAngle}},r,e))}else Dt(o),Mt(o,{shape:c},r,e);o.useStyle(t.getItemVisual(e,"style")),Nt(o,a);var u=(l.startAngle+l.endAngle)/2,d=r.get("selectedOffset"),f=Math.cos(u)*d,v=Math.sin(u)*d,p=a.getShallow("cursor");p&&o.attr("cursor",p),this._updateLabel(r,t,e),o.ensureState("emphasis").shape=$({r:l.r+(s.get("scale")&&s.get("scaleSize")||0)},Je(s.getModel("itemStyle"),l)),$(o.ensureState("select"),{x:f,y:v,shape:Je(a.getModel(["select","itemStyle"]),l)}),$(o.ensureState("blur"),{shape:Je(a.getModel(["blur","itemStyle"]),l)});var m=o.getTextGuideLine(),b=o.getTextContent();m&&$(m.ensureState("select"),{x:f,y:v}),$(b.ensureState("select"),{x:f,y:v}),Ot(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))}},e.prototype._updateLabel=function(t,e,i){var n=this,o=e.getItemModel(i),r=o.getModel("labelLine"),a=e.getItemVisual(i,"style"),s=a&&a.fill,l=a&&a.opacity;ht(n,Lt(o),{labelFetcher:e.hostModel,labelDataIndex:i,inheritColor:s,defaultOpacity:l,defaultText:t.getFormattedLabel(i,"normal")||e.getName(i)});var c=n.getTextContent();n.setTextConfig({position:null,rotation:null}),c.attr({z2:10});var h=t.get(["label","position"]);if("outside"!==h&&"outer"!==h)n.removeTextGuideLine();else{var u=this.getTextGuideLine();u||(u=new Ut,this.setTextGuideLine(u)),Vt(this,Qt(o),{stroke:s,opacity:Bt(r.get(["lineStyle","opacity"]),l,1)})}},e}(Rt),$e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ignoreLabelLineUpdate=!0,e}return c(e,t),e.prototype.render=function(t,e,i){var n,o=t.getData(),r=this._data,a=this.group;if(!r&&o.count()>0){for(var s=o.getItemLayout(0),l=1;isNaN(s&&s.startAngle)&&l<o.count();++l)s=o.getItemLayout(l);s&&(n=s.startAngle)}if(this._emptyCircleSector&&a.remove(this._emptyCircleSector),0===o.count()&&t.get("showEmptyCircle")){var c=new Rt({shape:He(t,i)});c.useStyle(t.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=c,a.add(c)}o.diff(r).add((function(t){var e=new Ze(o,t,n);o.setItemGraphicEl(t,e),a.add(e)})).update((function(t,e){var i=r.getItemGraphicEl(e);i.updateData(o,t,n),i.off("click"),a.add(i),o.setItemGraphicEl(t,i)})).remove((function(e){var i=r.getItemGraphicEl(e);Pt(i,t,e)})).execute(),function(t){var e,i,n=t.getData(),o=[],r=!1,a=(t.get("minShowLabelAngle")||0)*Ee,s=n.getLayout("viewRect"),l=n.getLayout("r"),c=s.width,h=s.x,u=s.y,d=s.height;function f(t){t.ignore=!0}n.each((function(t){var s=n.getItemGraphicEl(t),u=s.shape,d=s.getTextContent(),v=s.getTextGuideLine(),p=n.getItemModel(t),m=p.getModel("label"),b=m.get("position")||p.get(["emphasis","label","position"]),y=m.get("distanceToLabelLine"),x=m.get("alignTo"),w=H(m.get("edgeDistance"),c),S=m.get("bleedMargin"),T=p.getModel("labelLine"),M=T.get("length");M=H(M,c);var C=T.get("length2");if(C=H(C,c),Math.abs(u.endAngle-u.startAngle)<a)return g(d.states,f),d.ignore=!0,void(v&&(g(v.states,f),v.ignore=!0));if(function(t){if(!t.ignore)return!0;for(var e in t.states)if(!1===t.states[e].ignore)return!0;return!1}(d)){var I,k,z,A,D=(u.startAngle+u.endAngle)/2,N=Math.cos(D),O=Math.sin(D);e=u.cx,i=u.cy;var L="inside"===b||"inner"===b;if("center"===b)I=u.cx,k=u.cy,A="center";else{var U=(L?(u.r+u.r0)/2*N:u.r*N)+e,B=(L?(u.r+u.r0)/2*O:u.r*O)+i;if(I=U+3*N,k=B+3*O,!L){var R=U+N*(M+l-u.r),P=B+O*(M+l-u.r),W=R+(N<0?-1:1)*C;I="edge"===x?N<0?h+w:h+c-w:W+(N<0?-y:y),k=P,z=[[U,B],[R,P],[W,P]]}A=L?"center":"edge"===x?N>0?"right":"left":N>0?"left":"right"}var F=Math.PI,Y=0,j=m.get("rotate");if(at(j))Y=j*(F/180);else if("center"===b)Y=0;else if("radial"===j||!0===j)Y=N<0?-D+F:-D;else if("tangential"===j&&"outside"!==b&&"outer"!==b){var G=Math.atan2(N,O);G<0&&(G=2*F+G),O>0&&(G=F+G),Y=G-F}if(r=!!Y,d.x=I,d.y=k,d.rotation=Y,d.setStyle({verticalAlign:"middle"}),L){d.setStyle({align:A});var X=d.states.select;X&&(X.x+=d.x,X.y+=d.y)}else{var E=d.getBoundingRect().clone();E.applyTransform(d.getComputedTransform());var _=(d.style.margin||0)+2.1;E.y-=_/2,E.height+=_,o.push({label:d,labelLine:v,position:b,len:M,len2:C,minTurnAngle:T.get("minTurnAngle"),maxSurfaceAngle:T.get("maxSurfaceAngle"),surfaceNormal:new It(N,O),linePoints:z,textAlign:A,labelDistance:y,labelAlignTo:x,edgeDistance:w,bleedMargin:S,rect:E,unconstrainedWidth:E.width,labelStyleWidth:d.style.width})}s.setTextConfig({inside:L})}})),!r&&t.get("avoidLabelOverlap")&&function(t,e,i,n,o,r,a,s){for(var l=[],c=[],h=Number.MAX_VALUE,u=-Number.MAX_VALUE,d=0;d<t.length;d++){var f=t[d].label;qe(t[d])||(f.x<e?(h=Math.min(h,f.x),l.push(t[d])):(u=Math.max(u,f.x),c.push(t[d])))}for(d=0;d<t.length;d++)if(!qe(m=t[d])&&m.linePoints){if(null!=m.labelStyleWidth)continue;f=m.label;var v,p=m.linePoints;m.targetTextWidth=v="edge"===m.labelAlignTo?f.x<e?p[2][0]-m.labelDistance-a-m.edgeDistance:a+o-m.edgeDistance-p[2][0]-m.labelDistance:"labelLine"===m.labelAlignTo?f.x<e?h-a-m.bleedMargin:a+o-u-m.bleedMargin:f.x<e?f.x-a-m.bleedMargin:a+o-f.x-m.bleedMargin,Ke(m,v)}for(_e(c,e,i,n,1,0,r,0,s,u),_e(l,e,i,n,-1,0,r,0,s,h),d=0;d<t.length;d++){var m;if(!qe(m=t[d])&&m.linePoints){var b=(f=m.label).style.padding,g=m.rect.width+(f.style.backgroundColor?0:b?b[1]+b[3]:0),y=(p=m.linePoints)[1][0]-p[2][0];"edge"===m.labelAlignTo?p[2][0]=f.x<e?a+m.edgeDistance+g+m.labelDistance:a+o-m.edgeDistance-g-m.labelDistance:(p[2][0]=f.x<e?f.x+m.labelDistance:f.x-m.labelDistance,p[1][0]=p[2][0]+y),p[1][1]=p[2][1]=f.y}}}(o,e,i,l,c,d,h,u);for(var v=0;v<o.length;v++){var p=o[v],m=p.label,b=p.labelLine,y=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:p.textAlign}),y&&(g(m.states,f),m.ignore=!0);var x=m.states.select;x&&(x.x+=m.x,x.y+=m.y)}if(b){var w=p.linePoints;y||!w?(g(b.states,f),b.ignore=!0):(Zt(w,p.minTurnAngle),$t(w,p.surfaceNormal,p.maxSurfaceAngle),b.setShape({points:w}),m.__hostTarget.textGuideLineConfig={anchor:new It(w[0][0],w[0][1])})}}}(t),"expansion"!==t.get("animationTypeUpdate")&&(this._data=o)},e.prototype.dispose=function(){},e.prototype.containPoint=function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,o=t[1]-i.cy,r=Math.sqrt(n*n+o*o);return r<=i.r&&r>=i.r0}},e.type="pie",e}(Wt),Ve=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){return this._getRawData().indexOfName(t)>=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}(),Qe=jt(),ti=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new Ve(y(this.getData,this),y(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return function(t,e){e=m(e)&&{coordDimensions:e}||$({encodeDefine:t.getEncode()},e);var i=t.getSource(),n=Ft(i,e).dimensions,o=new Yt(n,t);return o.initData(i,void 0),o}(this,{coordDimensions:["value"],encodeDefaulter:bt(Gt,this)})},e.prototype.getDataParams=function(e){var i=this.getData(),n=Qe(i),o=n.seats;if(!o){var r=[];i.each(i.mapDimension("value"),(function(t){r.push(t)})),o=n.seats=Ht(r,i.hostModel.get("percentPrecision"))}var a=t.prototype.getDataParams.call(this,e);return a.percent=o[e]||0,a.$vars.push("percent"),a},e.prototype._defaultLabelLine=function(t){Xt(t,"labelLine",["show"]);var e=t.labelLine,i=t.emphasis.labelLine;e.show=e.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Et);V([function(t){V(Q),t.registerComponentModel(ee),t.registerComponentView(be),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},tt),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},tt)},function(){V(Oe),V(Fe)},function(t){t.registerChartView($e),t.registerSeriesModel(ti),_t("pie",t.registerAction),t.registerLayout(bt(Xe,"pie")),t.registerProcessor({seriesType:"pie",reset:function(t,e){var i=e.findComponents({mainType:"legend"});if(i&&i.length){var n=t.getData();n.filterSelf((function(t){for(var e=n.getName(t),o=0;o<i.length;o++)if(!i[o].isSelected(e))return!1;return!0}))}}}),t.registerProcessor({seriesType:"pie",reset:function(t){var e=t.getData();e.filterSelf((function(t){var i=e.mapDimension("value"),n=e.get(i,t);return!(at(n)&&!isNaN(n)&&n<0)}))}})},qt,Jt,te]);const ei=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.click=e(this,"click",7),this.defaultRecord={id:null,value:null,name:null},this.onClickElsewhere=t=>{t.stopPropagation(),this.clearSelection()},this.onButtonKeyUp=t=>{const{selectedId:e,data:i}=this;let n=this.getIndexById(e)||0;switch(t.key){case"ArrowLeft":case"ArrowUp":n--,n<0&&(n=i.length-1),this.chart.dispatchAction({type:"select",seriesId:"pie",dataIndex:n});break;case"ArrowRight":case"ArrowDown":n++,n>i.length-1&&(n=0),this.chart.dispatchAction({type:"select",seriesId:"pie",dataIndex:n});break;case"Escape":this.clearSelection();break;default:return}},this.onButtonClick=t=>{t.stopPropagation();const{selectedId:e}=this,i=e?this.getDataById(e):Object.assign({},this.defaultRecord);this.click.emit(i)},this.onContainerClick=t=>{this.isInChangeEvent||t.target instanceof HTMLElement&&(this.clearSelection(),t.stopPropagation())},this.chartName=void 0,this.summaryIcon=void 0,this.summaryName=void 0,this.innerRadius="70%",this.outerRadius="85%",this.minSliceSize="2.5%",this.selectedOffset=10,this.hoverScaleSize=5,this.format=void 0,this.isClickable=void 0,this.data=[],this.selectedId=void 0,this.hoveredId=void 0}componentDidLoad(){const t=Kt(this.chartContainer);this.cacheComputedStyles(),this.colors=this.getColors(),this.resizeObserver=new ResizeObserver((()=>this.resizeChart())),this.resizeObserver.observe(this.hostElement),this.updateChart(t),this.setupChartEvents(t),this.chart=t,o(this.hostElement)}disconnectedCallback(){this.resizeObserver=null}get centerData(){const{selectedId:t,hoveredId:e,data:i}=this,n=e||t,o=this.getIndexById(n);return n?Object.assign(Object.assign({},this.getDataById(n)),{color:this.colors[o]}):{name:r(this.summaryName||"tecton.element.chartDonut.button.summaryName"),icon:this.summaryIcon,value:i.reduce(((t,e)=>t+e.value),0),color:null}}cacheComputedStyles(){this.chartContainerStyles=getComputedStyle(this.chartContainer),this.hostElementStyles=getComputedStyle(this.hostElement)}displayValue(t){const e=parseFloat(t.toString());if(!isNaN(e))return"currency"===this.format?Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e):Intl.NumberFormat("en-US").format(e)}getCSSProperty(t){let e;if(t.startsWith("var(")&&t.endsWith(")")){const i=/var\((.*)\)/g.exec(t),n=i.length>=2?i[1].split(","):[];t=n[0],e=n[1]}let i=this.chartContainerStyles.getPropertyValue(t).trim();return i||(i=this.hostElementStyles.getPropertyValue(t).trim()),i||e}getIndexById(t){return this.data.findIndex((e=>e.id===t))}getDataByIndex(t){if("number"==typeof t)return this.data[t]}getDataById(t){if(t)return this.data.find((e=>e.id===t))}getColors(){const t=["--comp-color-1","--comp-color-2","--comp-color-3","--comp-color-4","--comp-color-5","--comp-color-6","--comp-color-7","--comp-color-8","--comp-color-9","--comp-color-10","--comp-color-11","--comp-color-12"];return this.data.reduce(((e,i)=>{let n=t.shift();return i.color&&(n=i.color),e.push(this.getCSSProperty(n)||n),e}),[])}setupChartEvents(t){t.on("mouseover",(t=>{this.hoveredId=t.data.id})),t.on("click",(t=>{t.event.event.stopPropagation()})),t.on("mouseout",(()=>{this.hoveredId=null})),t.on("selectchanged",(t=>{var e,i,n,o;const r=null!==(o=null===(n=null===(i=null===(e=t.selected)||void 0===e?void 0:e[0])||void 0===i?void 0:i.dataIndex)||void 0===n?void 0:n[0])&&void 0!==o?o:null,a="number"==typeof r?this.getDataByIndex(r):Object.assign({},this.defaultRecord);this.selectedId=a.id,this.isInChangeEvent=!0,this.change.emit(a),setTimeout((()=>{this.isInChangeEvent=!1}),0)}))}cleanData(t){const{minSliceSize:e}=this,i=parseFloat(e||"2.5%")/100,n=t.reduce(((t,e)=>t+e.value),0)*i;return t.map((t=>t.value<n?Object.assign(Object.assign({},t),{value:n}):t))}updateChart(t){return t.setOption({tooltip:{show:!1},legend:{show:!1},aria:{enabled:!0},series:[{name:this.chartName,animationType:"scale",color:this.colors,id:"pie",type:"pie",selectedOffset:this.selectedOffset,selectedMode:"single",radius:[this.innerRadius,this.outerRadius],label:{show:!1},labelLine:{show:!1},itemStyle:{borderWidth:5,borderColor:this.getCSSProperty("--comp-background-color")},emphasis:{scaleSize:this.hoverScaleSize,itemStyle:{color:"inherit"}},data:this.cleanData(this.data)}]})}resizeChart(){this.chart.resize()}propsUpdates(){this.updateChart(this.chart)}dataUpdated(){this.colors=this.getColors()}innerRadiusUpdated(){const{innerRadius:t,outerRadius:e}=this,i=parseFloat(t),n=parseFloat(e);i>=n&&(this.innerRadius=n-15+"%")}outerRadiusUpdated(){const{innerRadius:t,outerRadius:e}=this,i=parseFloat(t);parseFloat(e)<=i&&(this.outerRadius=`${i+15}%`)}delegateFocus(t){var e;a(t,this.hostElement)&&this.isClickable&&(null===(e=this.centerButtonElement)||void 0===e||e.focus())}async selectById(t){const e=this.getIndexById(t);-1!==e&&this.chart.dispatchAction({type:"select",seriesId:"pie",dataIndex:e})}async selectByIndex(t){const e=this.data[t]?t:null;e&&this.chart.dispatchAction({type:"select",seriesId:"pie",dataIndex:e})}async clearSelection(){const{selectedId:t}=this;t&&this.chart.dispatchAction({type:"unselect",seriesId:"pie",dataIndex:this.getIndexById(t)})}renderCenterBlock(){const{icon:t,name:e,value:n,color:o}=this.centerData,{isClickable:a}=this,s=a?"button":"div",l=this.displayValue(n),c=a?{onKeyUp:this.onButtonKeyUp,onClick:this.onButtonClick,ref:t=>this.centerButtonElement=t,"aria-description":r("tecton.element.chartDonut.button.description"),"aria-roledescription":r("tecton.element.chartDonut.button.roleDescription")}:null;return i("div",{class:"center-card-container",style:{width:`calc(${this.innerRadius} - 10%)`}},i(s,Object.assign({class:"center-card","test-id":"centerCard"},c),t&&i("q2-icon",{type:t,style:o&&{"--tct-icon-stroke-primary":o,"--tct-icon-stroke-secondary":o,color:o}}),e&&i("div",{class:"name"},e),n&&i("div",{class:"value"},l)))}render(){return i("click-elsewhere",{onChange:this.onClickElsewhere},i("div",{class:"container"},i("div",{ref:t=>this.chartContainer=t,class:"chart-container","test-id":"chartContainer",onClick:this.onContainerClick}),this.renderCenterBlock()))}get hostElement(){return n(this)}static get watchers(){return{chartName:["propsUpdates"],innerRadius:["propsUpdates","innerRadiusUpdated"],outerRadius:["propsUpdates","outerRadiusUpdated"],minSliceSize:["propsUpdates"],hoverScaleSize:["propsUpdates"],selectedOffset:["propsUpdates"],data:["propsUpdates","dataUpdated"]}}};ei.style="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{position:relative;width:100%;display:block}.container{aspect-ratio:1/1;width:100%;display:flex;justify-content:center;align-items:center}.chart-container{width:100%;height:100%;--comp-color-1:var(--tct-chart-donut-color-1, var(--t-chart-donut-color-1, var(--t-accent-1, #e05252)));--comp-color-2:var(--tct-chart-donut-color-2, var(--t-chart-donut-color-2, var(--t-accent-2, #e09952)));--comp-color-3:var(--tct-chart-donut-color-3, var(--t-chart-donut-color-3, var(--t-accent-3, #e0e052)));--comp-color-4:var(--tct-chart-donut-color-4, var(--t-chart-donut-color-4, var(--t-accent-4, #99e052)));--comp-color-5:var(--tct-chart-donut-color-5, var(--t-chart-donut-color-5, var(--t-accent-5, #52e052)));--comp-color-6:var(--tct-chart-donut-color-6, var(--t-chart-donut-color-6, var(--t-accent-6, #52e099)));--comp-color-7:var(--tct-chart-donut-color-7, var(--t-chart-donut-color-7, var(--t-accent-7, #52e0e0)));--comp-color-8:var(--tct-chart-donut-color-8, var(--t-chart-donut-color-8, var(--t-accent-8, #5299e0)));--comp-color-9:var(--tct-chart-donut-color-9, var(--t-chart-donut-color-9, var(--t-accent-9, #5252e0)));--comp-color-10:var(--tct-chart-donut-color-10, var(--t-chart-donut-color-10, var(--t-accent-10, #9952e0)));--comp-color-11:var(--tct-chart-donut-color-11, var(--t-chart-donut-color-11, var(--t-accent-11, #e052e0)));--comp-color-12:var(--tct-chart-donut-color-12, var(--t-chart-donut-color-12, var(--t-accent-12, #e05299)))}.chart-container,.center-card{--comp-background-color:var(--tct-chart-donut-border-color, var(--t-chart-donut-border-color, var(--t-base, #ffffff)))}button{--comp-button-vertical-padding:var(--tct-chart-donut-button-vertical-padding, var(--t-chart-donut-button-vertical-padding, var(--app-scale-1x, 5px)));transition:box-shadow var(--tct-chart-donut-button-tween, var(--t-chart-donut-button-tween, var(--app-tween-1, 0.2s ease)));padding:var(--comp-button-vertical-padding) 0}button:active{box-shadow:var(--const-double-focus-ring), var(--tct-chart-donut-button-hover-box-shadow, var(--t-chart-donut-button-hover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))))}button:hover{box-shadow:var(--tct-chart-donut-button-hover-box-shadow, var(--t-chart-donut-button-hover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))))}button:focus{box-shadow:var(--const-double-focus-ring), var(--tct-chart-donut-button-hover-box-shadow, var(--t-chart-donut-button-hover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))))}.center-card-container{position:absolute;top:50%;transform:translateY(-50%);padding:var(--tct-chart-donut-button-container-padding, var(--t-chart-donut-button-container-padding, var(--app-scale-1x, 5px)))}.center-card{width:100%;text-align:center;color:var(--tct-chart-donut-text-color, var(--t-chart-donut-text-color, var(--t-text, #4d4d4d)));margin-inline:auto;display:block}.center-card:is(button){cursor:pointer;background:var(--comp-background-color);border:0;border-radius:var(--tct-chart-donut-button-border-radius, var(--t-chart-donut-button-border-radius, var(--app-border-radius-1, 3px)))}q2-icon{--tct-icon-size:var(--tct-chart-donut-icon-size, var(--t-chart-donut-icon-size, 26px));margin-bottom:var(--tct-chart-donut-icon-margin-bottom, var(--t-chart-donut-icon-margin-bottom, var(--app-scale-1x, 5px)))}.name{font-size:var(--tct-chart-donut-name-font-size, var(--t-chart-donut-name-font-size, 14px))}.value{font-size:var(--tct-chart-donut-value-font-size, var(--t-chart-donut-value-font-size, 21px))}";export{ei as q2_chart_donut}
@@ -1 +1 @@
1
- import{r as t,c as i,h as o,F as a,g as e}from"./p-926a3e80.js";import{c as r,o as n,i as s,l}from"./p-a510290a.js";const p=class{constructor(o){t(this,o),this.change=i(this,"change",7),this.id=`radio-group-${r()}`,this.onMutationObserved=()=>{this.valueUpdated(this.value),this.nameUpdated(),this.disabledUpdated(),this.readonlyUpdated(),this.tileLayoutUpdated(this.tileLayout)},this.onInnerRadioChange=t=>{t.stopImmediatePropagation(),this.readonly||this.change.emit({value:t.detail.value})},this.label=void 0,this.value=void 0,this.disabled=!1,this.name=void 0,this.optional=void 0,this.readonly=void 0,this.tileLayout=void 0,this.tileAlignment="center",this.hasError=!1,this.tilelayout=void 0}get radioElements(){return Array.from(this.hostElement.querySelectorAll("q2-radio"))}componentWillLoad(){this.onMutationObserved(),this.tilelayout&&(this.tileLayout=this.tilelayout)}componentDidLoad(){const t=new MutationObserver(this.onMutationObserved);t.observe(this.hostElement,{childList:!0}),this.mutationObserver=t,n(this.hostElement)}valueUpdated(t){this.radioElements.forEach((i=>{i.checked=t===i.value}))}nameUpdated(){this.radioElements.forEach((t=>{t.name=this.name||this.id}))}disabledUpdated(){this.radioElements.forEach((t=>{t.groupDisabled=this.disabled}))}readonlyUpdated(){const t=this.readonly;this.radioElements.forEach((i=>i.groupReadonly=t))}tilelayoutUpdated(t){this.tileLayout=t}tileLayoutUpdated(t){this.radioElements.forEach((i=>{i.groupTileLayout=t}))}onHostElementChange(t){t.target===this.hostElement&&(this.hostElement.onchange||(this.value=t.detail.value))}delegateFocus(t){if(!s(t,this.hostElement))return;const i=this.hostElement.querySelector("q2-radio[checked]")||this.hostElement.querySelector("q2-radio");null==i||i.dispatchEvent(new FocusEvent("focus"))}keydownHandler(t){const i=t.target.getAttribute("value")||this.value;let o=this.radioElements.findIndex((o=>o===t.target||o.getAttribute("value")===i)),a=0;switch(t.key){case"ArrowLeft":case"ArrowUp":a=-1;break;case"ArrowRight":case"ArrowDown":a=1}-1!==o&&0!==a&&(o+=a,o=a<0?Math.max(0,o):Math.min(this.radioElements.length-1,o),t.preventDefault(),this.readonly||(this.value=this.radioElements[o].value),this.radioElements[o].dispatchEvent(new FocusEvent("focus")))}labelDOM(){const{label:t,optional:i,readonly:e}=this;let r="";return e?r=o("span",{class:"optional-tag"},l("tecton.element.input.readonly")):i&&(r=o("span",{class:"optional-tag"},l("tecton.element.input.optional"))),o(a,null,t&&l(t),!!r&&o("span",{class:"optional-tag"},r))}render(){const t=this.label||this.optional||this.readonly,{hasError:i}=this;return o(a,null,(t||i)&&o("div",{class:"label-row"},t&&o("div",{class:"group-legend"},this.labelDOM()),i&&o("q2-icon",{type:"error","test-id":"iconError"})),o("fieldset",{onChange:this.onInnerRadioChange,"aria-required":`${!this.optional}`,"aria-readonly":`${this.readonly}`,"aria-invalid":`${this.hasError}`},t&&o("legend",{class:"sr"},this.labelDOM()),this.inputDom()))}inputDom(){if(this.tileLayout){const{tileAlignment:t}=this,i=["left","center","right"].includes(t)?t:"center";return o("div",{class:`tile-container ${i}`},o("div",{class:"options-container"},o("slot",null)))}return o("div",{class:"options-container"},o("slot",null))}get hostElement(){return e(this)}static get watchers(){return{value:["valueUpdated"],name:["nameUpdated"],disabled:["disabledUpdated"],readonly:["readonlyUpdated"],tilelayout:["tilelayoutUpdated"],tileLayout:["tileLayoutUpdated"]}}};p.style='*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{margin-top:var(--tct-scale-2, var(--app-scale-2x, 10px))}fieldset{padding:0;margin:0;border:0;position:relative}.label-row{display:grid;grid-template-columns:1fr 24px;grid-template-areas:"label icon";gap:var(--app-scale-1x, 5px)}.label-row q2-icon{grid-area:icon;margin-top:-2px;margin-bottom:-2px}.group-legend{font-weight:600}.optional-tag{margin-left:var(--tct-input-label-optional-margin-left, var(--t-input-label-optional-margin-left, var(--tct-scale-1, var(--app-scale-1x, 5px))));color:var(--tct-input-label-optional-font-color, var(--t-input-label-optional-font-color, var(--t-textA, var(--t-a11y-gray-color, rgba(77, 77, 77, 0.77)))));font-size:var(--tct-input-label-optional-font-size, var(--t-input-label-optional-font-size, 12px));font-weight:var(--tct-input-label-optional-font-weight, var(--t-input-label-optional-font-weight, 400))}.tile-container,.tile-container .options-container{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;flex-grow:1}.options-container{--comp-default-margin:var(--app-scale-1x, 5px) 0;--comp-options-margin:var(--tct-radio-group-options-margin, var(--t-radio-group-options-margin, var(--comp-default-margin, 5px 0)));margin:var(--comp-options-margin);padding:var(--tct-radio-group-options-padding, var(--t-radio-group-options-padding, var(--app-scale-1x, 5px)));border-width:1px;border-color:transparent;border-style:solid;border-radius:var(--tct-border-radius-1, var(--app-border-radius-1, 2px))}:host([has-error]) .options-container{border-color:var(--tct-input-error-border-color, var(--const-stoplight-alert, #c30000))}:host([has-error=false]) .options-container{border-color:transparent}.tile-container.left{justify-content:start}.tile-container.right{justify-content:end}.tile-container .options-container{gap:var(--tct-radio-group-tile-gap, var(--t-radio-group-tile-gap, var(--app-scale-2x, 10px)));justify-content:inherit}';export{p as q2_radio_group}
1
+ import{r as t,c as i,h as o,F as a,g as e}from"./p-926a3e80.js";import{c as r,o as n,i as s,l}from"./p-9acfa94e.js";const p=class{constructor(o){t(this,o),this.change=i(this,"change",7),this.id=`radio-group-${r()}`,this.onMutationObserved=()=>{this.valueUpdated(this.value),this.nameUpdated(),this.disabledUpdated(),this.readonlyUpdated(),this.tileLayoutUpdated(this.tileLayout)},this.onInnerRadioChange=t=>{t.stopImmediatePropagation(),this.readonly||this.change.emit({value:t.detail.value})},this.label=void 0,this.value=void 0,this.disabled=!1,this.name=void 0,this.optional=void 0,this.readonly=void 0,this.tileLayout=void 0,this.tileAlignment="center",this.hasError=!1,this.tilelayout=void 0}get radioElements(){return Array.from(this.hostElement.querySelectorAll("q2-radio"))}componentWillLoad(){this.onMutationObserved(),this.tilelayout&&(this.tileLayout=this.tilelayout)}componentDidLoad(){const t=new MutationObserver(this.onMutationObserved);t.observe(this.hostElement,{childList:!0}),this.mutationObserver=t,n(this.hostElement)}valueUpdated(t){this.radioElements.forEach((i=>{i.checked=t===i.value}))}nameUpdated(){this.radioElements.forEach((t=>{t.name=this.name||this.id}))}disabledUpdated(){this.radioElements.forEach((t=>{t.groupDisabled=this.disabled}))}readonlyUpdated(){const t=this.readonly;this.radioElements.forEach((i=>i.groupReadonly=t))}tilelayoutUpdated(t){this.tileLayout=t}tileLayoutUpdated(t){this.radioElements.forEach((i=>{i.groupTileLayout=t}))}onHostElementChange(t){t.target===this.hostElement&&(this.hostElement.onchange||(this.value=t.detail.value))}delegateFocus(t){if(!s(t,this.hostElement))return;const i=this.hostElement.querySelector("q2-radio[checked]")||this.hostElement.querySelector("q2-radio");null==i||i.dispatchEvent(new FocusEvent("focus"))}keydownHandler(t){const i=t.target.getAttribute("value")||this.value;let o=this.radioElements.findIndex((o=>o===t.target||o.getAttribute("value")===i)),a=0;switch(t.key){case"ArrowLeft":case"ArrowUp":a=-1;break;case"ArrowRight":case"ArrowDown":a=1}-1!==o&&0!==a&&(o+=a,o=a<0?Math.max(0,o):Math.min(this.radioElements.length-1,o),t.preventDefault(),this.readonly||(this.value=this.radioElements[o].value),this.radioElements[o].dispatchEvent(new FocusEvent("focus")))}labelDOM(){const{label:t,optional:i,readonly:e}=this;let r="";return e?r=o("span",{class:"optional-tag"},l("tecton.element.input.readonly")):i&&(r=o("span",{class:"optional-tag"},l("tecton.element.input.optional"))),o(a,null,t&&l(t),!!r&&o("span",{class:"optional-tag"},r))}render(){const t=this.label||this.optional||this.readonly,{hasError:i}=this;return o(a,null,(t||i)&&o("div",{class:"label-row"},t&&o("div",{class:"group-legend"},this.labelDOM()),i&&o("q2-icon",{type:"error","test-id":"iconError"})),o("fieldset",{onChange:this.onInnerRadioChange,"aria-required":`${!this.optional}`,"aria-readonly":`${this.readonly}`,"aria-invalid":`${this.hasError}`},t&&o("legend",{class:"sr"},this.labelDOM()),this.inputDom()))}inputDom(){if(this.tileLayout){const{tileAlignment:t}=this,i=["left","center","right"].includes(t)?t:"center";return o("div",{class:`tile-container ${i}`},o("div",{class:"options-container"},o("slot",null)))}return o("div",{class:"options-container"},o("slot",null))}get hostElement(){return e(this)}static get watchers(){return{value:["valueUpdated"],name:["nameUpdated"],disabled:["disabledUpdated"],readonly:["readonlyUpdated"],tilelayout:["tilelayoutUpdated"],tileLayout:["tileLayoutUpdated"]}}};p.style='*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{margin-top:var(--tct-scale-2, var(--app-scale-2x, 10px))}fieldset{padding:0;margin:0;border:0;position:relative}.label-row{display:grid;grid-template-columns:1fr 24px;grid-template-areas:"label icon";gap:var(--app-scale-1x, 5px)}.label-row q2-icon{grid-area:icon;margin-top:-2px;margin-bottom:-2px}.group-legend{font-weight:600}.optional-tag{margin-left:var(--tct-input-label-optional-margin-left, var(--t-input-label-optional-margin-left, var(--tct-scale-1, var(--app-scale-1x, 5px))));color:var(--tct-input-label-optional-font-color, var(--t-input-label-optional-font-color, var(--t-textA, var(--t-a11y-gray-color, rgba(77, 77, 77, 0.77)))));font-size:var(--tct-input-label-optional-font-size, var(--t-input-label-optional-font-size, 12px));font-weight:var(--tct-input-label-optional-font-weight, var(--t-input-label-optional-font-weight, 400))}.tile-container,.tile-container .options-container{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;flex-grow:1}.options-container{--comp-default-margin:var(--app-scale-1x, 5px) 0;--comp-options-margin:var(--tct-radio-group-options-margin, var(--t-radio-group-options-margin, var(--comp-default-margin, 5px 0)));margin:var(--comp-options-margin);padding:var(--tct-radio-group-options-padding, var(--t-radio-group-options-padding, var(--app-scale-1x, 5px)));border-width:1px;border-color:transparent;border-style:solid;border-radius:var(--tct-border-radius-1, var(--app-border-radius-1, 2px))}:host([has-error]) .options-container{border-color:var(--tct-input-error-border-color, var(--const-stoplight-alert, #c30000))}:host([has-error=false]) .options-container{border-color:transparent}.tile-container.left{justify-content:start}.tile-container.right{justify-content:end}.tile-container .options-container{gap:var(--tct-radio-group-tile-gap, var(--t-radio-group-tile-gap, var(--app-scale-2x, 10px)));justify-content:inherit}';export{p as q2_radio_group}
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as e,H as o,g as s}from"./p-926a3e80.js";import{o as n,n as r,i as a,r as h}from"./p-9acfa94e.js";const l=class{constructor(e){t(this,e),this.change=i(this,"change",7),this.popoverState=i(this,"popoverState",7),this.ready=i(this,"ready",3),this.scheduledAfterRender=[],this.externalKeydownHandler=t=>{t.stopPropagation();const{activeIndex:i,customSearch:e,allOptions:o}=this,{key:s}=t;let n;switch(s){case" ":if(this.searchString){if(e)break;this.searchOptions(s,!0);break}this.setDefaultActiveElement();break;case"Enter":this.setDefaultActiveElement();break;case"ArrowUp":if(t.preventDefault(),this.activeIndex=0,n=this.selectedOptions.length?this.getDefaultActiveIndex():this.getNextVisibleIndex(-1),-1===n)break;this.openDropdownWithActiveElement(n);break;case"ArrowDown":if(t.preventDefault(),this.activeIndex=0,n=this.selectedOptions.length?this.getDefaultActiveIndex():this.getNextVisibleIndex(0),-1===n)break;this.openDropdownWithActiveElement(n);break;case"Home":t.preventDefault(),this.openDropdownWithActiveElement(0);break;case"End":t.preventDefault(),this.openDropdownWithActiveElement(o.length-1);break;case"PageUp":t.preventDefault(),this.openDropdownWithActiveElement(Math.max((i||0)-10,0));break;case"PageDown":t.preventDefault(),this.openDropdownWithActiveElement(Math.min((i||0)+10,o.length-1));break;case"Tab":this.popoverState.emit({open:!1,action:"close"});break;case"Esc":case"Escape":this.noSelect&&this.setActiveElement(null),this.popoverState.emit({open:!1,action:"close"});break;default:if(e)break;if(!s.match(/^[\w]$/))break;this.searchOptions(s,!0)}},this.internalKeydownHandler=t=>{t.stopPropagation();const{activeIndex:i,customSearch:e,allOptions:o}=this,{key:s,shiftKey:n}=t;let r;switch(s){case" ":if(this.searchString){if(e)break;this.searchOptions(s,!1);break}if(t.preventDefault(),r=o.find((t=>t.active)),!r||r.disabled)break;this.selectOption(r);break;case"Enter":if(t.preventDefault(),r=o.find((t=>t.active)),!r||r.disabled)break;this.selectOption(r);break;case"ArrowUp":if(t.preventDefault(),0===i)break;if(void 0===i){this.setDefaultActiveElement();break}{const t=this.getNextVisibleIndex(-1);if(-1===t)break;this.adjustActiveOptionAndScroll(t-i);break}case"ArrowDown":if(t.preventDefault(),i===o.length-1)break;if(void 0===i){this.setDefaultActiveElement();break}{const t=this.getNextVisibleIndex(1);if(-1===t)break;this.adjustActiveOptionAndScroll(t-i);break}case"Home":t.preventDefault(),this.openDropdownWithActiveElement(0);break;case"End":t.preventDefault(),this.openDropdownWithActiveElement(o.length-1);break;case"PageUp":t.preventDefault(),this.openDropdownWithActiveElement(Math.max(i-10,0));break;case"PageDown":t.preventDefault(),this.openDropdownWithActiveElement(Math.min(i+10,o.length-1));break;case"Tab":if(n)break;if(r=o.find((t=>t.active)),!r||r.disabled)return;this.selectOption(r);break;case"Esc":case"Escape":this.noSelect&&this.setActiveElement(null),this.popoverState.emit({open:!1,action:"close"});break;default:if(e)break;if(!s.match(/^[\w]$/))break;this.searchOptions(s,!1)}},this.focusoutHandler=t=>{const{relatedTarget:i}=t,e=this.allOptions.includes(i),o=!e&&this.hostElement.contains(i);(e||o)&&t.stopPropagation()},this.clickHandler=t=>{const i=t.target.closest("q2-option");this.selectOption(i)},this.role="listbox",this.customSearch=void 0,this.noSelect=void 0,this.align=void 0,this.selectedOptions=[],this.multiple=void 0,this.disabled=void 0,this.showSelected=void 0,this.type=void 0,this.hasOptions=void 0}componentWillLoad(){this.hasOptions=!!this.hostElement.querySelectorAll("q2-option").length}componentDidLoad(){n(this.hostElement),this.checkOptions(),this.selectedOptionsUpdated(),this.ready.emit()}componentDidRender(){this.scheduledAfterRender.forEach((t=>t())),this.scheduledAfterRender=[]}get allContents(){const t=this.getRootSlot(this.hostElement),i=["Q2-OPTGROUP","Q2-OPTION"];return t.filter((t=>i.includes(t.tagName)))}get allOptions(){const t=i=>i.reduce(((i,e)=>"Q2-OPTGROUP"===e.tagName?[...i,...t(Array.from(e.children))]:"Q2-OPTION"===e.tagName?[...i,e]:i),[]);return t(this.allContents)}get allVisibleOptions(){return this.allOptions.filter((t=>!(t.hidden||t._multiSelectHidden||t.disabled||t.disabledGroup)))}async checkOptions(){const{type:t}=this,i=await this.getOptions();if(!t)return;const e="menu"===t?"menuitem":"option";i.forEach((t=>{t.role=e}))}getRootSlot(t){var i;const e=t.querySelector("slot"),o=null!==(i=null==e?void 0:e.assignedElements())&&void 0!==i?i:Array.from(t.children);return o.length&&"SLOT"===o[0].tagName?this.getRootSlot(o[0]):o}scrollToActiveOption(){const t=this.allOptions[this.activeIndex];null==t||t.scrollIntoView({block:"nearest"})}openDropdownWithActiveElement(t){this.disabled||(this.activeIndex=t,this.popoverState.emit({open:!0,action:"open"}),this.setActiveOption(),this.setFocusedOption(),r((()=>{this.scrollToActiveOption()})))}getDefaultActiveIndex(){const{allOptions:t}=this,i=t.findIndex((t=>t.selected));if(i>-1)return i;const e=t.findIndex((t=>!t.hidden));return e>-1?e:0}updateSingleOptionAttrs(){var t;const{allOptions:i,selectedOptions:e}=this,o=(null===(t=e[0])||void 0===t?void 0:t.value)||void 0;i.forEach((t=>{t.selected=t.value===o}))}updateMultipleOptionAttrs(){const{allOptions:t,selectedOptions:i}=this,e=i.map((({value:t})=>t));t.forEach((t=>{t.selected=e.includes(t.value)}))}setActiveOption(){const t=this.activeIndex;this.allOptions.forEach(((i,e)=>{i.active=t===e}))}setFocusedOption(){const t=this.allOptions[this.activeIndex];t&&(this.hostElement.offsetParent?t.focus():r((()=>t.focus())))}getNextVisibleIndex(t){const{allVisibleOptions:i,allOptions:e,activeIndex:o}=this;let s=i.indexOf(e[o])+t;return s<0?s=i.length-1:s>i.length-1&&(s=0),e.indexOf(i[s])}focusSelectedSibling(t){const{allVisibleOptions:i,allOptions:e}=this;if(i.length<2)return void(this.showSelected=!1);const o=i.indexOf(t),s=e.indexOf(i[o?o-1:o+1]);this.activeIndex=s,this.setFocusedOption(),this.scheduledAfterRender.push((()=>{t._multiSelectHidden=!t.selected}))}selectOption(t){const{multiple:i,noSelect:e,showSelected:o}=this;if(!t||t.disabled||t.disabledGroup)return;const s=t.value,n={value:s,display:t.display||t.innerText.trim()};let r=[];if(i){const{selectedOptions:i}=this;r=i.find((t=>t.value===s))?i.filter((({value:t})=>t!==s)):[...i,n],o&&this.focusSelectedSibling(t)}else r=[n];e?this.setActiveElement(null):this.selectedOptions=r,this.change.emit({value:s,values:r}),i||this.popoverState.emit({open:!1,action:"select"})}adjustActiveOptionAndScroll(t){this.activeIndex+=t,this.setActiveOption(),this.setFocusedOption(),this.scrollToActiveOption()}resetTimer(){this.searchStringTimer&&clearTimeout(this.searchStringTimer),this.searchStringTimer=window.setTimeout((()=>{this.searchString=null}),2e3)}searchOptions(t,i){this.resetTimer();let e=this.searchString?`${this.searchString}${t}`:t;e=e.replace(/[^\w\s]/gi,""),this.searchString=e;const o=new RegExp(`^${e}`,"i"),{allOptions:s}=this,n=s.findIndex((t=>t.value===e||t.textContent.trim().match(o)));-1!==n&&(i?this.selectOption(this.allOptions[n]):this.setActiveElement(n))}showSelectedUpdated(t){t&&0===this.selectedOptions.length?this.showSelected=!1:this.allOptions.forEach((i=>i._multiSelectHidden=!!t&&!i.selected))}selectedOptionsUpdated(){this.multiple?this.updateMultipleOptionAttrs():this.updateSingleOptionAttrs()}delegateFocus(t){if(!a(t,this.hostElement))return;this.popoverState.emit({open:!0,action:"open"});const{activeIndex:i}=this;"number"==typeof i&&i>-1?(this.setActiveOption(),this.setFocusedOption()):this.setDefaultActiveElement()}handleClick(t){t.stopPropagation()}async setDefaultActiveElement(){this.activeIndex=this.getDefaultActiveIndex(),this.setActiveOption(),this.setFocusedOption()}async setActiveElement(t){this.activeIndex=t,this.setActiveOption(),this.setFocusedOption()}async handleExternalKeydown(t){this.externalKeydownHandler(t)}async getContents(){return this.allContents}async getOptions(){return this.allOptions}render(){return e(o,null,e("div",{class:"content",ref:t=>this.contentElement=t,onFocusout:this.focusoutHandler},e("div",{class:"options",role:this.type||"listbox",onKeyDown:this.internalKeydownHandler,onClick:this.clickHandler},e("slot",null))))}get hostElement(){return s(this)}static get watchers(){return{showSelected:["showSelectedUpdated"],selectedOptions:["selectedOptionsUpdated"]}}};l.style="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{position:relative;width:100%;display:block;line-height:var(--tct-option-list-line-height, var(--t-option-list-line-height, var(--app-line-height, 1.428571429em)))}.content{text-align:start}:host([is-sizeable]) .content{display:block;height:auto}";const c=class{constructor(e){t(this,e),this.popoverStateChanged=i(this,"popoverStateChanged",7),this.scheduledAfterRender=[],this.direction=void 0,this.align=void 0,this.open=void 0,this.block=void 0,this.minHeight=void 0,this.controlElement=void 0,this.privateDirection="down"}componentDidLoad(){this.open&&this.determinePopDirection()}componentWillRender(){this.containerElement&&this.open&&r((()=>this.determinePopDirection()))}componentDidRender(){setTimeout((()=>{this.scheduledAfterRender.forEach((t=>t())),this.scheduledAfterRender=[]}),25)}async toggle(){this.open=!this.open}openChanged(t){this.popoverStateChanged.emit({open:t}),this.scheduledAfterRender.push(h)}popoverStateHandler(t){const{detail:{open:i}}=t;i!==this.open&&(this.open=i,t.stopPropagation())}determinePopDirection(){var t,i,e,o,s;const{containerElement:n,contentElement:r,direction:a,controlElement:h}=this;if(n&&(n.style.maxHeight=null),a)return this.privateDirection=a;const l=r.clientHeight,{top:c,height:p}=null!==(t=null==h?void 0:h.getBoundingClientRect())&&void 0!==t?t:{top:0,height:0},d=((null===(e=null===(i=window.Tecton)||void 0===i?void 0:i.platformDimensions)||void 0===e?void 0:e.scrollY)||0)+((null===(s=null===(o=window.Tecton)||void 0===o?void 0:o.platformDimensions)||void 0===s?void 0:s.innerHeight)||window.innerHeight)-c-p,b=l<=c;if(d>l)return this.privateDirection="down";if(b||!this.minHeight)return this.determinePopOffset(),this.privateDirection="up";const{minHeight:v=150}=this;if(d>=v+5){const t=Math.max(d-5,v);return n.style.setProperty("--comp-pop-max-height",`${t}px`),this.privateDirection="down"}{const t=Math.max(c,v);return n.style.setProperty("--comp-pop-max-height",`${t}px`),this.determinePopOffset(),this.privateDirection="up"}}determinePopOffset(){var t;const{controlElement:i,containerElement:e}=this,o=null!==(t=null==i?void 0:i.getBoundingClientRect().height)&&void 0!==t?t:0;e.style.setProperty("--comp-pop-offset",`${o}px`)}render(){return e("div",{ref:t=>this.containerElement=t,class:["container",this.privateDirection].join(" "),role:"menu"},e("div",{ref:t=>this.contentElement=t,class:"content"},e("slot",null)))}get hostElement(){return s(this)}static get watchers(){return{open:["openChanged"]}}};c.style="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block;width:100%}:host([align=right]){display:block;position:absolute;right:0;text-align:end;left:unset}.container{display:none;overflow:hidden;opacity:0;height:0;position:absolute;top:var(--tct-popover-top, var(--t-popover-top, initial));visibility:hidden;background-color:var(--tct-popover-background-color, var(--t-popover-background-color, var(--app-white, #ffffff)));color:var(--tct-popover-text-color, var(--t-popover-text-color, var(--t-text, #4d4d4d)));z-index:var(--tct-popover-z-index, var(--t-popover-z-index, 100));width:max-content;min-width:var(--tct-popover-min-width, var(--t-popover-min-width, 135px));box-shadow:var(--tct-popover-box-shadow, var(--t-popover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))));text-align:start;left:0;transition:opacity var(--app-tween-1, 0.2s ease);border-radius:var(--tct-popover-border-radius, var(--t-popover-border-radius, 0));max-height:var(--comp-pop-max-height);--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}.container::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}.container::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}.container::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}:host([block]) .container{left:unset;right:unset;width:100%;min-width:unset}:host([align=right]) .container{right:0;text-align:end;left:unset}:host([open]) .container{display:block;height:auto;overflow:auto;opacity:1;visibility:visible}.container.up{bottom:var(--comp-pop-offset)}click-elsewhere{position:relative;display:block}.content{height:auto}";export{l as q2_option_list,c as q2_popover}
@@ -1 +1 @@
1
- import{r as t,h as r,g as i}from"./p-926a3e80.js";import{o as e,l as a}from"./p-a510290a.js";import{c as n,m as s,g as o,i as h,a as u,e as c,f as d,h as l,j as f,k as p,l as v}from"./p-458b1987.js";import{_ as b,I as g,S as m,b3 as y,P as w,b4 as x,o as A,a0 as M,h as k,i as S,u as C,s as N,H as z,b5 as U,G as I,m as O,d as T,C as E,V as L,a as _,g as D,b as j,b6 as B,t as P,z as W,b7 as H,U as R,af as V,b8 as q,b9 as F,a9 as G,aa as X,ab as Y,ac as J}from"./p-52063431.js";import{i as K}from"./p-833398d1.js";var Q=function(t){function r(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=r.type,i}return b(r,t),r.prototype.getInitialData=function(){return n(null,this,{useEncodeDefaulter:!0})},r.prototype.getMarkerPosition=function(t,r,i){var e=this.coordinateSystem;if(e&&e.clampData){var a=e.dataToPoint(e.clampData(t));if(i)g(e.getAxes(),(function(i,n){if("category"===i.type){var s=i.getTicksCoords(),o=e.clampData(t)[n];!r||"x1"!==r[n]&&"y1"!==r[n]||(o+=1),o>s.length-1&&(o=s.length-1),o<0&&(o=0),s[o]&&(a[n]=i.toGlobalCoord(s[o].coord))}}));else{var n=this.getData(),s=n.getLayout("offset"),o=n.getLayout("size"),h=e.getBaseAxis().isHorizontal()?0:1;a[h]+=s+o/2}return a}return[NaN,NaN]},r.type="series.__base_bar__",r.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},r}(m);m.registerClass(Q);var Z=function(t){function r(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=r.type,i}return b(r,t),r.prototype.getInitialData=function(){return n(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},r.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},r.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),r=this.get("largeThreshold");return r>t&&(t=r),t},r.prototype.brushSelector=function(t,r,i){return i.rect(r.getItemLayout(t))},r.type="series.bar",r.dependencies=["grid","polar"],r.defaultOption=y(Q.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),r}(Q),$=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},tt=function(t){function r(r){var i=t.call(this,r)||this;return i.type="sausage",i}return b(r,t),r.prototype.getDefaultShape=function(){return new $},r.prototype.buildPath=function(t,r){var i=r.cx,e=r.cy,a=Math.max(r.r0||0,0),n=Math.max(r.r,0),s=.5*(n-a),o=a+s,h=r.startAngle,u=r.endAngle,c=r.clockwise,d=2*Math.PI,l=c?u-h<d:h-u<d;l||(h=u-(c?d:-d));var f=Math.cos(h),p=Math.sin(h),v=Math.cos(u),b=Math.sin(u);l?(t.moveTo(f*a+i,p*a+e),t.arc(f*o+i,p*o+e,s,-Math.PI+h,h,!c)):t.moveTo(f*n+i,p*n+e),t.arc(i,e,n,h,u,!c),t.arc(v*o+i,b*o+e,s,u-2*Math.PI,u-Math.PI,!c),0!==a&&t.arc(i,e,a,u,h,c)},r}(w);function rt(t,r,i){return r*Math.sin(t)*(i?-1:1)}function it(t,r,i){return r*Math.cos(t)*(i?1:-1)}var et=Math.max,at=Math.min,nt=function(t){function r(){var i=t.call(this)||this;return i.type=r.type,i._isFirstFrame=!0,i}return b(r,t),r.prototype.render=function(t,r,i,e){this._model=t,this._removeOnRenderedListener(i),this._updateDrawMode(t);var a=t.get("coordinateSystem");"cartesian2d"!==a&&"polar"!==a||(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,r,i):this._renderNormal(t,r,i,e))},r.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},r.prototype.incrementalRender=function(t,r){this._progressiveEls=[],this._incrementalRenderLarge(t,r)},r.prototype.eachRendered=function(t){k(this._progressiveEls||this.group,t)},r.prototype._updateDrawMode=function(t){var r=t.pipelineContext.large;null!=this._isLargeDraw&&r===this._isLargeDraw||(this._isLargeDraw=r,this._clear())},r.prototype._renderNormal=function(t,r,i,e){var a,n=this.group,s=t.getData(),o=this._data,u=t.coordinateSystem,c=u.getBaseAxis();"cartesian2d"===u.type?a=c.isHorizontal():"polar"===u.type&&(a="angle"===c.dim);var d=t.isAnimationEnabled()?t:null,l=function(t,r){var i=t.get("realtimeSort",!0),e=r.getBaseAxis();if(i&&"category"===e.type&&"cartesian2d"===r.type)return{baseAxis:e,otherAxis:r.getOtherAxis(e)}}(t,u);l&&this._enableRealtimeSort(l,s,i);var f=t.get("clip",!0)||l,p=function(t,r){var i=t.getArea&&t.getArea();if(h(t,"cartesian2d")){var e=t.getBaseAxis();if("category"!==e.type||!e.onBand){var a=r.getLayout("bandWidth");e.isHorizontal()?(i.x-=a,i.width+=2*a):(i.y-=a,i.height+=2*a)}}return i}(u,s);n.removeClipPath();var v=t.get("roundCap",!0),b=t.get("showBackground",!0),g=t.getModel("backgroundStyle"),m=g.get("borderRadius")||0,y=[],w=this._backgroundEls,x=e&&e.isInitSort,A=e&&"changeAxisOrder"===e.type;function M(t){var r=ft[u.type](s,t),i=function(t,r,i){return new("polar"===t.type?R:L)({shape:wt(r,i,t),silent:!0,z2:0})}(u,a,r);return i.useStyle(g.getItemStyle()),"cartesian2d"===u.type&&i.setShape("r",m),y[t]=i,i}s.diff(o).add((function(r){var i=s.getItemModel(r),e=ft[u.type](s,r,i);if(b&&M(r),s.hasValue(r)&&lt[u.type](e)){var o=!1;f&&(o=st[u.type](p,e));var h=ot[u.type](t,s,r,e,a,d,c.model,!1,v);l&&(h.forceLabelAnimation=!0),vt(h,s,r,i,e,t,a,"polar"===u.type),x?h.attr({shape:e}):l?ht(l,d,h,e,r,a,!1,!1):S(h,{shape:e},t,r),s.setItemGraphicEl(r,h),n.add(h),h.ignore=o}})).update((function(r,i){var e=s.getItemModel(r),h=ft[u.type](s,r,e);if(b){var k=void 0;0===w.length?k=M(i):((k=w[i]).useStyle(g.getItemStyle()),"cartesian2d"===u.type&&k.setShape("r",m),y[r]=k);var S=ft[u.type](s,r),U=wt(a,S,u);C(k,{shape:U},d,r)}var I=o.getItemGraphicEl(i);if(s.hasValue(r)&&lt[u.type](h)){var O=!1;if(f&&(O=st[u.type](p,h))&&n.remove(I),I?N(I):I=ot[u.type](t,s,r,h,a,d,c.model,!!I,v),l&&(I.forceLabelAnimation=!0),A){var T=I.getTextContent();if(T){var E=z(T);null!=E.prevValue&&(E.prevValue=E.value)}}else vt(I,s,r,e,h,t,a,"polar"===u.type);x?I.attr({shape:h}):l?ht(l,d,I,h,r,a,!0,A):C(I,{shape:h},t,r,null),s.setItemGraphicEl(r,I),I.ignore=O,n.add(I)}else n.remove(I)})).remove((function(r){var i=o.getItemGraphicEl(r);i&&U(i,t,r)})).execute();var k=this._backgroundGroup||(this._backgroundGroup=new I);k.removeAll();for(var O=0;O<y.length;++O)k.add(y[O]);n.add(k),this._backgroundEls=y,this._data=s},r.prototype._renderLarge=function(t){this._clear(),mt(t,this.group),this._updateLargeClip(t)},r.prototype._incrementalRenderLarge=function(t,r){this._removeBackground(),mt(r,this.group,this._progressiveEls,!0)},r.prototype._updateLargeClip=function(t){var r=t.get("clip",!0)&&s(t.coordinateSystem,!1,t),i=this.group;r?i.setClipPath(r):i.removeClipPath()},r.prototype._enableRealtimeSort=function(t,r,i){var e=this;if(r.count()){var a=t.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(r,t,i),this._isFirstFrame=!1;else{var n=function(t){var i=r.getItemGraphicEl(t),e=i&&i.shape;return e&&Math.abs(a.isHorizontal()?e.height:e.width)||0};this._onRendered=function(){e._updateSortWithinSameData(r,n,a,i)},i.getZr().on("rendered",this._onRendered)}}},r.prototype._dataSort=function(t,r,i){var e=[];return t.each(t.mapDimension(r.dim),(function(t,r){var a=i(r);e.push({dataIndex:r,mappedValue:a=null==a?NaN:a,ordinalNumber:t})})),e.sort((function(t,r){return r.mappedValue-t.mappedValue})),{ordinalNumbers:O(e,(function(t){return t.ordinalNumber}))}},r.prototype._isOrderChangedWithinSameData=function(t,r,i){for(var e=i.scale,a=t.mapDimension(i.dim),n=Number.MAX_VALUE,s=0,o=e.getOrdinalMeta().categories.length;s<o;++s){var h=t.rawIndexOf(a,e.getRawOrdinalNumber(s)),u=h<0?Number.MIN_VALUE:r(t.indexOfRawIndex(h));if(u>n)return!0;n=u}return!1},r.prototype._isOrderDifferentInView=function(t,r){for(var i=r.scale,e=i.getExtent(),a=Math.max(0,e[0]),n=Math.min(e[1],i.getOrdinalMeta().categories.length-1);a<=n;++a)if(t.ordinalNumbers[a]!==i.getRawOrdinalNumber(a))return!0},r.prototype._updateSortWithinSameData=function(t,r,i,e){if(this._isOrderChangedWithinSameData(t,r,i)){var a=this._dataSort(t,i,r);this._isOrderDifferentInView(a,i)&&(this._removeOnRenderedListener(e),e.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:a}))}},r.prototype._dispatchInitSort=function(t,r,i){var e=r.baseAxis,a=this._dataSort(t,e,(function(i){return t.get(t.mapDimension(r.otherAxis.dim),i)}));i.dispatchAction({type:"changeAxisOrder",componentType:e.dim+"Axis",isInitSort:!0,axisId:e.index,sortInfo:a})},r.prototype.remove=function(t,r){this._clear(this._model),this._removeOnRenderedListener(r)},r.prototype.dispose=function(t,r){this._removeOnRenderedListener(r)},r.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},r.prototype._clear=function(t){var r=this.group,i=this._data;t&&t.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl((function(r){U(r,t,T(r).dataIndex)}))):r.removeAll(),this._data=null,this._isFirstFrame=!0},r.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},r.type="bar",r}(E),st={cartesian2d:function(t,r){var i=r.width<0?-1:1,e=r.height<0?-1:1;i<0&&(r.x+=r.width,r.width=-r.width),e<0&&(r.y+=r.height,r.height=-r.height);var a=t.x+t.width,n=t.y+t.height,s=et(r.x,t.x),o=at(r.x+r.width,a),h=et(r.y,t.y),u=at(r.y+r.height,n),c=o<s,d=u<h;return r.x=c&&s>a?o:s,r.y=d&&h>n?u:h,r.width=c?0:o-s,r.height=d?0:u-h,i<0&&(r.x+=r.width,r.width=-r.width),e<0&&(r.y+=r.height,r.height=-r.height),c||d},polar:function(t,r){var i=r.r0<=r.r?1:-1;if(i<0){var e=r.r;r.r=r.r0,r.r0=e}var a=at(r.r,t.r),n=et(r.r0,t.r0);r.r=a,r.r0=n;var s=a-n<0;return i<0&&(e=r.r,r.r=r.r0,r.r0=e),s}},ot={cartesian2d:function(t,r,i,e,a,n){var s=new L({shape:_({},e),z2:1});return s.__dataIndex=i,s.name="item",n&&(s.shape[a?"height":"width"]=0),s},polar:function(t,r,i,e,a,n,s,o,h){var u=!a&&h?tt:R,c=new u({shape:e,z2:1});c.name="item";var d,l,f=pt(a);if(c.calculateTextPosition=(d=f,l=({isRoundCap:u===tt}||{}).isRoundCap,function(t,r,i){var e=r.position;if(!e||e instanceof Array)return x(t,r,i);var a=d(e),n=null!=r.distance?r.distance:5,s=this.shape,o=s.cx,h=s.cy,u=s.r,c=s.r0,f=(u+c)/2,p=s.startAngle,v=s.endAngle,b=(p+v)/2,g=l?Math.abs(u-c)/2:0,m=Math.cos,y=Math.sin,w=o+u*m(p),A=h+u*y(p),M="left",k="top";switch(a){case"startArc":w=o+(c-n)*m(b),A=h+(c-n)*y(b),M="center",k="top";break;case"insideStartArc":w=o+(c+n)*m(b),A=h+(c+n)*y(b),M="center",k="bottom";break;case"startAngle":w=o+f*m(p)+rt(p,n+g,!1),A=h+f*y(p)+it(p,n+g,!1),M="right",k="middle";break;case"insideStartAngle":w=o+f*m(p)+rt(p,-n+g,!1),A=h+f*y(p)+it(p,-n+g,!1),M="left",k="middle";break;case"middle":w=o+f*m(b),A=h+f*y(b),M="center",k="middle";break;case"endArc":w=o+(u+n)*m(b),A=h+(u+n)*y(b),M="center",k="bottom";break;case"insideEndArc":w=o+(u-n)*m(b),A=h+(u-n)*y(b),M="center",k="top";break;case"endAngle":w=o+f*m(v)+rt(v,n+g,!0),A=h+f*y(v)+it(v,n+g,!0),M="left",k="middle";break;case"insideEndAngle":w=o+f*m(v)+rt(v,-n+g,!0),A=h+f*y(v)+it(v,-n+g,!0),M="right",k="middle";break;default:return x(t,r,i)}return(t=t||{}).x=w,t.y=A,t.align=M,t.verticalAlign=k,t}),n){var p=a?"r":"endAngle",v={};c.shape[p]=a?0:e.startAngle,v[p]=e[p],(o?C:S)(c,{shape:v},n)}return c}};function ht(t,r,i,e,a,n,s,o){var h,u;n?(u={x:e.x,width:e.width},h={y:e.y,height:e.height}):(u={y:e.y,height:e.height},h={x:e.x,width:e.width}),o||(s?C:S)(i,{shape:h},r,a,null),(s?C:S)(i,{shape:u},r?t.baseAxis.model:null,a)}function ut(t,r){for(var i=0;i<r.length;i++)if(!isFinite(t[r[i]]))return!0;return!1}var ct=["x","y","width","height"],dt=["cx","cy","r","startAngle","endAngle"],lt={cartesian2d:function(t){return!ut(t,ct)},polar:function(t){return!ut(t,dt)}},ft={cartesian2d:function(t,r,i){var e=t.getItemLayout(r),a=i?function(t,r){var i=t.get(["itemStyle","borderColor"]);if(!i||"none"===i)return 0;var e=t.get(["itemStyle","borderWidth"])||0,a=isNaN(r.width)?Number.MAX_VALUE:Math.abs(r.width),n=isNaN(r.height)?Number.MAX_VALUE:Math.abs(r.height);return Math.min(e,a,n)}(i,e):0,n=e.width>0?1:-1,s=e.height>0?1:-1;return{x:e.x+n*a/2,y:e.y+s*a/2,width:e.width-n*a,height:e.height-s*a}},polar:function(t,r){var i=t.getItemLayout(r);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function pt(t){return function(t){var r=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+r;default:return t}}}(t)}function vt(t,r,i,e,a,n,s,h){var c=r.getItemVisual(i,"style");h||t.setShape("r",e.get(["itemStyle","borderRadius"])||0),t.useStyle(c);var d=e.getShallow("cursor");d&&t.attr("cursor",d);var l=h?s?a.r>=a.r0?"endArc":"startArc":a.endAngle>=a.startAngle?"endAngle":"startAngle":s?a.height>=0?"bottom":"top":a.width>=0?"right":"left",f=D(e);j(t,f,{labelFetcher:n,labelDataIndex:i,defaultText:o(n.getData(),i),inheritColor:c.fill,defaultOpacity:c.opacity,defaultOutsidePosition:l});var p=t.getTextContent();if(h&&p){var v=e.get(["label","position"]);t.textConfig.inside="middle"===v||null,function(t,r,i,e){if(A(e))t.setTextConfig({rotation:e});else if(M(r))t.setTextConfig({rotation:0});else{var a,n=t.shape,s=n.clockwise?n.startAngle:n.endAngle,o=n.clockwise?n.endAngle:n.startAngle,h=(s+o)/2,u=i(r);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":a=h;break;case"startAngle":case"insideStartAngle":a=s;break;case"endAngle":case"insideEndAngle":a=o;break;default:return void t.setTextConfig({rotation:0})}var c=1.5*Math.PI-a;"middle"===u&&c>Math.PI/2&&c<1.5*Math.PI&&(c-=Math.PI),t.setTextConfig({rotation:c})}}(t,"outside"===v?l:v,pt(s),e.get(["label","rotate"]))}B(p,f,n.getRawValue(i),(function(t){return u(r,t)}));var b=e.getModel(["emphasis"]);P(t,b.get("focus"),b.get("blurScope"),b.get("disabled")),W(t,e),function(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}(a)&&(t.style.fill="none",t.style.stroke="none",g(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}var bt=function(){},gt=function(t){function r(r){var i=t.call(this,r)||this;return i.type="largeBar",i}return b(r,t),r.prototype.getDefaultShape=function(){return new bt},r.prototype.buildPath=function(t,r){for(var i=r.points,e=this.baseDimIdx,a=1-this.baseDimIdx,n=[],s=[],o=this.barWidth,h=0;h<i.length;h+=3)s[e]=o,s[a]=i[h+2],n[e]=i[h+e],n[a]=i[h+a],t.rect(n[0],n[1],s[0],s[1])},r}(w);function mt(t,r,i,e){var a=t.getData(),n=a.getLayout("valueAxisHorizontal")?1:0,s=a.getLayout("largeDataIndices"),o=a.getLayout("size"),h=t.getModel("backgroundStyle"),u=a.getLayout("largeBackgroundPoints");if(u){var c=new gt({shape:{points:u},incremental:!!e,silent:!0,z2:0});c.baseDimIdx=n,c.largeDataIndices=s,c.barWidth=o,c.useStyle(h.getItemStyle()),r.add(c),i&&i.push(c)}var d=new gt({shape:{points:a.getLayout("largePoints")},incremental:!!e,ignoreCoarsePointer:!0,z2:1});d.baseDimIdx=n,d.largeDataIndices=s,d.barWidth=o,r.add(d),d.useStyle(a.getVisual("style")),T(d).seriesIndex=t.seriesIndex,t.get("silent")||(d.on("mousedown",yt),d.on("mousemove",yt)),i&&i.push(d)}var yt=H((function(t){var r=function(t,r,i){for(var e=t.baseDimIdx,a=1-e,n=t.shape.points,s=t.largeDataIndices,o=[],h=[],u=t.barWidth,c=0,d=n.length/3;c<d;c++){var l=3*c;if(h[e]=u,h[a]=n[l+2],o[e]=n[l+e],o[a]=n[l+a],h[a]<0&&(o[a]+=h[a],h[a]=-h[a]),r>=o[0]&&r<=o[0]+h[0]&&i>=o[1]&&i<=o[1]+h[1])return s[c]}return-1}(this,t.offsetX,t.offsetY);T(this).dataIndex=r>=0?r:null}),30,!1);function wt(t,r,i){if(h(i,"cartesian2d")){var e=r,a=i.getArea();return{x:t?e.x:a.x,y:t?a.y:e.y,width:t?e.width:a.width,height:t?a.height:e.height}}return{cx:(a=i.getArea()).cx,cy:a.cy,r0:t?a.r0:r.r0,r:t?a.r:r.r,startAngle:t?r.startAngle:0,endAngle:t?r.endAngle:2*Math.PI}}G([Y,function(t){t.registerChartView(nt),t.registerSeriesModel(Z),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,V(F,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,q("bar")),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,c("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(t,r){r.eachComponent({mainType:t.componentType||"series",query:t},(function(r){t.sortInfo&&r.axis.setCategorySortInfo(t.sortInfo)}))}))},J,K,p,v]);const xt=class{constructor(r){t(this,r),this.data=[],this.alignChartName=void 0,this.chartName=void 0,this.color=void 0,this.dataNamesOverflow=void 0,this.dataNamesWidth=void 0,this.format=void 0,this.formatModifier=void 0,this.hideBarLabels=!1,this.hideValueAxisLabels=!1,this.offsetDataNames=!1,this.offsetDataValues=!1,this.orientation=void 0,this.showChartName=!1,this.sort=!1}componentDidLoad(){const t=X(this.chartContainer);this.chart=t,this.resizeEventListener=()=>this.resizeChart(),window.addEventListener("resize",this.resizeEventListener),this.cacheComputedStyles(),this.updateChart(t),e(this.hostElement)}disconnectedCallback(){window.removeEventListener("resize",this.resizeEventListener)}cacheComputedStyles(){this.chartContainerStyles=getComputedStyle(this.chartContainer),this.hostElementStyles=getComputedStyle(this.hostElement)}getColor(t){const r=d("var(--t-primary)",this.chartContainerStyles,this.hostElementStyles),i=d(this.color,this.chartContainerStyles,this.hostElementStyles);return d(t,this.chartContainerStyles,this.hostElementStyles)||(l(t)?t:i||(l(this.color)?this.color:r))}processData(t){return t.map((t=>({value:t.value||0,itemStyle:{color:this.getColor(t.color)}})))}updateChart(t){var r;const i=(null===(r=this.formatModifier)||void 0===r?void 0:r.includes("dec"))?this.formatModifier.replace("dec",""):0,e={type:"value",axisLabel:{formatter:t=>f(t,{type:this.format,decimals:i}),rotate:this.offsetDataValues?45:0,margin:this.offsetDataValues?15:8,show:!this.hideValueAxisLabels}},n={type:"category",data:this.data.map((t=>a(t.name)||"")),axisLabel:{rotate:this.offsetDataNames?45:0,margin:this.offsetDataNames?15:8,interval:0,width:this.dataNamesWidth||50,overflow:this.dataNamesOverflow||"none",truncate:"ellipsis"},axisTick:{alignWithLabel:this.offsetDataNames}};return t.setOption({aria:{enabled:!0},title:{text:this.chartName,show:this.showChartName,left:this.alignChartName},grid:{containLabel:!0},xAxis:"horizontal"===this.orientation?e:n,yAxis:"horizontal"===this.orientation?n:e,series:[{data:this.processData(this.data),id:"bar",type:"bar",label:{show:!this.hideBarLabels,position:"top",fontWeight:"bold",formatter:t=>f(t.value,{type:this.format,decimals:i})},realtimeSort:this.sort}]})}resizeChart(){this.chart.resize()}propsUpdates(){this.updateChart(this.chart)}render(){return r("div",{class:"container"},r("div",{ref:t=>this.chartContainer=t,class:"chart-container","test-id":"barChartContainer"}))}get hostElement(){return i(this)}static get watchers(){return{chartName:["propsUpdates"],color:["propsUpdates"],hideBarLabels:["propsUpdates"],showChartName:["propsUpdates"],alignChartName:["propsUpdates"],orientation:["propsUpdates"],format:["propsUpdates"],sort:["propsUpdates"],data:["propsUpdates"],offsetDataNames:["propsUpdates"],hideValueAxisLabels:["propsUpdates"],formatModifier:["propsUpdates"],dataNamesOverflow:["propsUpdates"]}}};xt.style="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{width:var(--tct-bar-chart-width, 100%);height:var(--tct-bar-chart-height, 100%);display:block}.container{width:100%;height:100%}.chart-container{width:100%;height:100%}";export{xt as q2_chart_bar}
1
+ import{r as t,h as r,g as i}from"./p-926a3e80.js";import{o as e,l as a}from"./p-9acfa94e.js";import{c as n,m as s,g as o,i as h,a as c,e as u,f as d,h as l,j as f,k as p,l as v}from"./p-458b1987.js";import{_ as b,I as g,S as m,b3 as y,P as w,b4 as x,o as A,a0 as M,h as k,i as S,u as C,s as N,H as z,b5 as U,G as I,m as O,d as T,C as E,V as L,a as _,g as D,b as j,b6 as B,t as P,z as W,b7 as H,U as R,af as V,b8 as q,b9 as F,a9 as G,aa as X,ab as Y,ac as J}from"./p-52063431.js";import{i as K}from"./p-833398d1.js";var Q=function(t){function r(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=r.type,i}return b(r,t),r.prototype.getInitialData=function(){return n(null,this,{useEncodeDefaulter:!0})},r.prototype.getMarkerPosition=function(t,r,i){var e=this.coordinateSystem;if(e&&e.clampData){var a=e.dataToPoint(e.clampData(t));if(i)g(e.getAxes(),(function(i,n){if("category"===i.type){var s=i.getTicksCoords(),o=e.clampData(t)[n];!r||"x1"!==r[n]&&"y1"!==r[n]||(o+=1),o>s.length-1&&(o=s.length-1),o<0&&(o=0),s[o]&&(a[n]=i.toGlobalCoord(s[o].coord))}}));else{var n=this.getData(),s=n.getLayout("offset"),o=n.getLayout("size"),h=e.getBaseAxis().isHorizontal()?0:1;a[h]+=s+o/2}return a}return[NaN,NaN]},r.type="series.__base_bar__",r.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},r}(m);m.registerClass(Q);var Z=function(t){function r(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=r.type,i}return b(r,t),r.prototype.getInitialData=function(){return n(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},r.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},r.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),r=this.get("largeThreshold");return r>t&&(t=r),t},r.prototype.brushSelector=function(t,r,i){return i.rect(r.getItemLayout(t))},r.type="series.bar",r.dependencies=["grid","polar"],r.defaultOption=y(Q.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),r}(Q),$=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},tt=function(t){function r(r){var i=t.call(this,r)||this;return i.type="sausage",i}return b(r,t),r.prototype.getDefaultShape=function(){return new $},r.prototype.buildPath=function(t,r){var i=r.cx,e=r.cy,a=Math.max(r.r0||0,0),n=Math.max(r.r,0),s=.5*(n-a),o=a+s,h=r.startAngle,c=r.endAngle,u=r.clockwise,d=2*Math.PI,l=u?c-h<d:h-c<d;l||(h=c-(u?d:-d));var f=Math.cos(h),p=Math.sin(h),v=Math.cos(c),b=Math.sin(c);l?(t.moveTo(f*a+i,p*a+e),t.arc(f*o+i,p*o+e,s,-Math.PI+h,h,!u)):t.moveTo(f*n+i,p*n+e),t.arc(i,e,n,h,c,!u),t.arc(v*o+i,b*o+e,s,c-2*Math.PI,c-Math.PI,!u),0!==a&&t.arc(i,e,a,c,h,u)},r}(w);function rt(t,r,i){return r*Math.sin(t)*(i?-1:1)}function it(t,r,i){return r*Math.cos(t)*(i?1:-1)}var et=Math.max,at=Math.min,nt=function(t){function r(){var i=t.call(this)||this;return i.type=r.type,i._isFirstFrame=!0,i}return b(r,t),r.prototype.render=function(t,r,i,e){this._model=t,this._removeOnRenderedListener(i),this._updateDrawMode(t);var a=t.get("coordinateSystem");"cartesian2d"!==a&&"polar"!==a||(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,r,i):this._renderNormal(t,r,i,e))},r.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},r.prototype.incrementalRender=function(t,r){this._progressiveEls=[],this._incrementalRenderLarge(t,r)},r.prototype.eachRendered=function(t){k(this._progressiveEls||this.group,t)},r.prototype._updateDrawMode=function(t){var r=t.pipelineContext.large;null!=this._isLargeDraw&&r===this._isLargeDraw||(this._isLargeDraw=r,this._clear())},r.prototype._renderNormal=function(t,r,i,e){var a,n=this.group,s=t.getData(),o=this._data,c=t.coordinateSystem,u=c.getBaseAxis();"cartesian2d"===c.type?a=u.isHorizontal():"polar"===c.type&&(a="angle"===u.dim);var d=t.isAnimationEnabled()?t:null,l=function(t,r){var i=t.get("realtimeSort",!0),e=r.getBaseAxis();if(i&&"category"===e.type&&"cartesian2d"===r.type)return{baseAxis:e,otherAxis:r.getOtherAxis(e)}}(t,c);l&&this._enableRealtimeSort(l,s,i);var f=t.get("clip",!0)||l,p=function(t,r){var i=t.getArea&&t.getArea();if(h(t,"cartesian2d")){var e=t.getBaseAxis();if("category"!==e.type||!e.onBand){var a=r.getLayout("bandWidth");e.isHorizontal()?(i.x-=a,i.width+=2*a):(i.y-=a,i.height+=2*a)}}return i}(c,s);n.removeClipPath();var v=t.get("roundCap",!0),b=t.get("showBackground",!0),g=t.getModel("backgroundStyle"),m=g.get("borderRadius")||0,y=[],w=this._backgroundEls,x=e&&e.isInitSort,A=e&&"changeAxisOrder"===e.type;function M(t){var r=ft[c.type](s,t),i=function(t,r,i){return new("polar"===t.type?R:L)({shape:wt(r,i,t),silent:!0,z2:0})}(c,a,r);return i.useStyle(g.getItemStyle()),"cartesian2d"===c.type&&i.setShape("r",m),y[t]=i,i}s.diff(o).add((function(r){var i=s.getItemModel(r),e=ft[c.type](s,r,i);if(b&&M(r),s.hasValue(r)&&lt[c.type](e)){var o=!1;f&&(o=st[c.type](p,e));var h=ot[c.type](t,s,r,e,a,d,u.model,!1,v);l&&(h.forceLabelAnimation=!0),vt(h,s,r,i,e,t,a,"polar"===c.type),x?h.attr({shape:e}):l?ht(l,d,h,e,r,a,!1,!1):S(h,{shape:e},t,r),s.setItemGraphicEl(r,h),n.add(h),h.ignore=o}})).update((function(r,i){var e=s.getItemModel(r),h=ft[c.type](s,r,e);if(b){var k=void 0;0===w.length?k=M(i):((k=w[i]).useStyle(g.getItemStyle()),"cartesian2d"===c.type&&k.setShape("r",m),y[r]=k);var S=ft[c.type](s,r),U=wt(a,S,c);C(k,{shape:U},d,r)}var I=o.getItemGraphicEl(i);if(s.hasValue(r)&&lt[c.type](h)){var O=!1;if(f&&(O=st[c.type](p,h))&&n.remove(I),I?N(I):I=ot[c.type](t,s,r,h,a,d,u.model,!!I,v),l&&(I.forceLabelAnimation=!0),A){var T=I.getTextContent();if(T){var E=z(T);null!=E.prevValue&&(E.prevValue=E.value)}}else vt(I,s,r,e,h,t,a,"polar"===c.type);x?I.attr({shape:h}):l?ht(l,d,I,h,r,a,!0,A):C(I,{shape:h},t,r,null),s.setItemGraphicEl(r,I),I.ignore=O,n.add(I)}else n.remove(I)})).remove((function(r){var i=o.getItemGraphicEl(r);i&&U(i,t,r)})).execute();var k=this._backgroundGroup||(this._backgroundGroup=new I);k.removeAll();for(var O=0;O<y.length;++O)k.add(y[O]);n.add(k),this._backgroundEls=y,this._data=s},r.prototype._renderLarge=function(t){this._clear(),mt(t,this.group),this._updateLargeClip(t)},r.prototype._incrementalRenderLarge=function(t,r){this._removeBackground(),mt(r,this.group,this._progressiveEls,!0)},r.prototype._updateLargeClip=function(t){var r=t.get("clip",!0)&&s(t.coordinateSystem,!1,t),i=this.group;r?i.setClipPath(r):i.removeClipPath()},r.prototype._enableRealtimeSort=function(t,r,i){var e=this;if(r.count()){var a=t.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(r,t,i),this._isFirstFrame=!1;else{var n=function(t){var i=r.getItemGraphicEl(t),e=i&&i.shape;return e&&Math.abs(a.isHorizontal()?e.height:e.width)||0};this._onRendered=function(){e._updateSortWithinSameData(r,n,a,i)},i.getZr().on("rendered",this._onRendered)}}},r.prototype._dataSort=function(t,r,i){var e=[];return t.each(t.mapDimension(r.dim),(function(t,r){var a=i(r);e.push({dataIndex:r,mappedValue:a=null==a?NaN:a,ordinalNumber:t})})),e.sort((function(t,r){return r.mappedValue-t.mappedValue})),{ordinalNumbers:O(e,(function(t){return t.ordinalNumber}))}},r.prototype._isOrderChangedWithinSameData=function(t,r,i){for(var e=i.scale,a=t.mapDimension(i.dim),n=Number.MAX_VALUE,s=0,o=e.getOrdinalMeta().categories.length;s<o;++s){var h=t.rawIndexOf(a,e.getRawOrdinalNumber(s)),c=h<0?Number.MIN_VALUE:r(t.indexOfRawIndex(h));if(c>n)return!0;n=c}return!1},r.prototype._isOrderDifferentInView=function(t,r){for(var i=r.scale,e=i.getExtent(),a=Math.max(0,e[0]),n=Math.min(e[1],i.getOrdinalMeta().categories.length-1);a<=n;++a)if(t.ordinalNumbers[a]!==i.getRawOrdinalNumber(a))return!0},r.prototype._updateSortWithinSameData=function(t,r,i,e){if(this._isOrderChangedWithinSameData(t,r,i)){var a=this._dataSort(t,i,r);this._isOrderDifferentInView(a,i)&&(this._removeOnRenderedListener(e),e.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:a}))}},r.prototype._dispatchInitSort=function(t,r,i){var e=r.baseAxis,a=this._dataSort(t,e,(function(i){return t.get(t.mapDimension(r.otherAxis.dim),i)}));i.dispatchAction({type:"changeAxisOrder",componentType:e.dim+"Axis",isInitSort:!0,axisId:e.index,sortInfo:a})},r.prototype.remove=function(t,r){this._clear(this._model),this._removeOnRenderedListener(r)},r.prototype.dispose=function(t,r){this._removeOnRenderedListener(r)},r.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},r.prototype._clear=function(t){var r=this.group,i=this._data;t&&t.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl((function(r){U(r,t,T(r).dataIndex)}))):r.removeAll(),this._data=null,this._isFirstFrame=!0},r.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},r.type="bar",r}(E),st={cartesian2d:function(t,r){var i=r.width<0?-1:1,e=r.height<0?-1:1;i<0&&(r.x+=r.width,r.width=-r.width),e<0&&(r.y+=r.height,r.height=-r.height);var a=t.x+t.width,n=t.y+t.height,s=et(r.x,t.x),o=at(r.x+r.width,a),h=et(r.y,t.y),c=at(r.y+r.height,n),u=o<s,d=c<h;return r.x=u&&s>a?o:s,r.y=d&&h>n?c:h,r.width=u?0:o-s,r.height=d?0:c-h,i<0&&(r.x+=r.width,r.width=-r.width),e<0&&(r.y+=r.height,r.height=-r.height),u||d},polar:function(t,r){var i=r.r0<=r.r?1:-1;if(i<0){var e=r.r;r.r=r.r0,r.r0=e}var a=at(r.r,t.r),n=et(r.r0,t.r0);r.r=a,r.r0=n;var s=a-n<0;return i<0&&(e=r.r,r.r=r.r0,r.r0=e),s}},ot={cartesian2d:function(t,r,i,e,a,n){var s=new L({shape:_({},e),z2:1});return s.__dataIndex=i,s.name="item",n&&(s.shape[a?"height":"width"]=0),s},polar:function(t,r,i,e,a,n,s,o,h){var c=!a&&h?tt:R,u=new c({shape:e,z2:1});u.name="item";var d,l,f=pt(a);if(u.calculateTextPosition=(d=f,l=({isRoundCap:c===tt}||{}).isRoundCap,function(t,r,i){var e=r.position;if(!e||e instanceof Array)return x(t,r,i);var a=d(e),n=null!=r.distance?r.distance:5,s=this.shape,o=s.cx,h=s.cy,c=s.r,u=s.r0,f=(c+u)/2,p=s.startAngle,v=s.endAngle,b=(p+v)/2,g=l?Math.abs(c-u)/2:0,m=Math.cos,y=Math.sin,w=o+c*m(p),A=h+c*y(p),M="left",k="top";switch(a){case"startArc":w=o+(u-n)*m(b),A=h+(u-n)*y(b),M="center",k="top";break;case"insideStartArc":w=o+(u+n)*m(b),A=h+(u+n)*y(b),M="center",k="bottom";break;case"startAngle":w=o+f*m(p)+rt(p,n+g,!1),A=h+f*y(p)+it(p,n+g,!1),M="right",k="middle";break;case"insideStartAngle":w=o+f*m(p)+rt(p,-n+g,!1),A=h+f*y(p)+it(p,-n+g,!1),M="left",k="middle";break;case"middle":w=o+f*m(b),A=h+f*y(b),M="center",k="middle";break;case"endArc":w=o+(c+n)*m(b),A=h+(c+n)*y(b),M="center",k="bottom";break;case"insideEndArc":w=o+(c-n)*m(b),A=h+(c-n)*y(b),M="center",k="top";break;case"endAngle":w=o+f*m(v)+rt(v,n+g,!0),A=h+f*y(v)+it(v,n+g,!0),M="left",k="middle";break;case"insideEndAngle":w=o+f*m(v)+rt(v,-n+g,!0),A=h+f*y(v)+it(v,-n+g,!0),M="right",k="middle";break;default:return x(t,r,i)}return(t=t||{}).x=w,t.y=A,t.align=M,t.verticalAlign=k,t}),n){var p=a?"r":"endAngle",v={};u.shape[p]=a?0:e.startAngle,v[p]=e[p],(o?C:S)(u,{shape:v},n)}return u}};function ht(t,r,i,e,a,n,s,o){var h,c;n?(c={x:e.x,width:e.width},h={y:e.y,height:e.height}):(c={y:e.y,height:e.height},h={x:e.x,width:e.width}),o||(s?C:S)(i,{shape:h},r,a,null),(s?C:S)(i,{shape:c},r?t.baseAxis.model:null,a)}function ct(t,r){for(var i=0;i<r.length;i++)if(!isFinite(t[r[i]]))return!0;return!1}var ut=["x","y","width","height"],dt=["cx","cy","r","startAngle","endAngle"],lt={cartesian2d:function(t){return!ct(t,ut)},polar:function(t){return!ct(t,dt)}},ft={cartesian2d:function(t,r,i){var e=t.getItemLayout(r),a=i?function(t,r){var i=t.get(["itemStyle","borderColor"]);if(!i||"none"===i)return 0;var e=t.get(["itemStyle","borderWidth"])||0,a=isNaN(r.width)?Number.MAX_VALUE:Math.abs(r.width),n=isNaN(r.height)?Number.MAX_VALUE:Math.abs(r.height);return Math.min(e,a,n)}(i,e):0,n=e.width>0?1:-1,s=e.height>0?1:-1;return{x:e.x+n*a/2,y:e.y+s*a/2,width:e.width-n*a,height:e.height-s*a}},polar:function(t,r){var i=t.getItemLayout(r);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function pt(t){return function(t){var r=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+r;default:return t}}}(t)}function vt(t,r,i,e,a,n,s,h){var u=r.getItemVisual(i,"style");h||t.setShape("r",e.get(["itemStyle","borderRadius"])||0),t.useStyle(u);var d=e.getShallow("cursor");d&&t.attr("cursor",d);var l=h?s?a.r>=a.r0?"endArc":"startArc":a.endAngle>=a.startAngle?"endAngle":"startAngle":s?a.height>=0?"bottom":"top":a.width>=0?"right":"left",f=D(e);j(t,f,{labelFetcher:n,labelDataIndex:i,defaultText:o(n.getData(),i),inheritColor:u.fill,defaultOpacity:u.opacity,defaultOutsidePosition:l});var p=t.getTextContent();if(h&&p){var v=e.get(["label","position"]);t.textConfig.inside="middle"===v||null,function(t,r,i,e){if(A(e))t.setTextConfig({rotation:e});else if(M(r))t.setTextConfig({rotation:0});else{var a,n=t.shape,s=n.clockwise?n.startAngle:n.endAngle,o=n.clockwise?n.endAngle:n.startAngle,h=(s+o)/2,c=i(r);switch(c){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":a=h;break;case"startAngle":case"insideStartAngle":a=s;break;case"endAngle":case"insideEndAngle":a=o;break;default:return void t.setTextConfig({rotation:0})}var u=1.5*Math.PI-a;"middle"===c&&u>Math.PI/2&&u<1.5*Math.PI&&(u-=Math.PI),t.setTextConfig({rotation:u})}}(t,"outside"===v?l:v,pt(s),e.get(["label","rotate"]))}B(p,f,n.getRawValue(i),(function(t){return c(r,t)}));var b=e.getModel(["emphasis"]);P(t,b.get("focus"),b.get("blurScope"),b.get("disabled")),W(t,e),function(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}(a)&&(t.style.fill="none",t.style.stroke="none",g(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}var bt=function(){},gt=function(t){function r(r){var i=t.call(this,r)||this;return i.type="largeBar",i}return b(r,t),r.prototype.getDefaultShape=function(){return new bt},r.prototype.buildPath=function(t,r){for(var i=r.points,e=this.baseDimIdx,a=1-this.baseDimIdx,n=[],s=[],o=this.barWidth,h=0;h<i.length;h+=3)s[e]=o,s[a]=i[h+2],n[e]=i[h+e],n[a]=i[h+a],t.rect(n[0],n[1],s[0],s[1])},r}(w);function mt(t,r,i,e){var a=t.getData(),n=a.getLayout("valueAxisHorizontal")?1:0,s=a.getLayout("largeDataIndices"),o=a.getLayout("size"),h=t.getModel("backgroundStyle"),c=a.getLayout("largeBackgroundPoints");if(c){var u=new gt({shape:{points:c},incremental:!!e,silent:!0,z2:0});u.baseDimIdx=n,u.largeDataIndices=s,u.barWidth=o,u.useStyle(h.getItemStyle()),r.add(u),i&&i.push(u)}var d=new gt({shape:{points:a.getLayout("largePoints")},incremental:!!e,ignoreCoarsePointer:!0,z2:1});d.baseDimIdx=n,d.largeDataIndices=s,d.barWidth=o,r.add(d),d.useStyle(a.getVisual("style")),T(d).seriesIndex=t.seriesIndex,t.get("silent")||(d.on("mousedown",yt),d.on("mousemove",yt)),i&&i.push(d)}var yt=H((function(t){var r=function(t,r,i){for(var e=t.baseDimIdx,a=1-e,n=t.shape.points,s=t.largeDataIndices,o=[],h=[],c=t.barWidth,u=0,d=n.length/3;u<d;u++){var l=3*u;if(h[e]=c,h[a]=n[l+2],o[e]=n[l+e],o[a]=n[l+a],h[a]<0&&(o[a]+=h[a],h[a]=-h[a]),r>=o[0]&&r<=o[0]+h[0]&&i>=o[1]&&i<=o[1]+h[1])return s[u]}return-1}(this,t.offsetX,t.offsetY);T(this).dataIndex=r>=0?r:null}),30,!1);function wt(t,r,i){if(h(i,"cartesian2d")){var e=r,a=i.getArea();return{x:t?e.x:a.x,y:t?a.y:e.y,width:t?e.width:a.width,height:t?a.height:e.height}}return{cx:(a=i.getArea()).cx,cy:a.cy,r0:t?a.r0:r.r0,r:t?a.r:r.r,startAngle:t?r.startAngle:0,endAngle:t?r.endAngle:2*Math.PI}}G([Y,function(t){t.registerChartView(nt),t.registerSeriesModel(Z),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,V(F,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,q("bar")),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,u("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(t,r){r.eachComponent({mainType:t.componentType||"series",query:t},(function(r){t.sortInfo&&r.axis.setCategorySortInfo(t.sortInfo)}))}))},J,K,p,v]);const xt=class{constructor(r){t(this,r),this.data=[],this.alignChartName=void 0,this.chartName=void 0,this.color=void 0,this.dataNamesOverflow=void 0,this.dataNamesWidth=void 0,this.format=void 0,this.formatModifier=void 0,this.hideBarLabels=!1,this.hideValueAxisLabels=!1,this.offsetDataNames=!1,this.offsetDataValues=!1,this.orientation=void 0,this.showChartName=!1,this.sort=!1}componentDidLoad(){const t=X(this.chartContainer);this.chart=t,this.resizeEventListener=()=>this.resizeChart(),window.addEventListener("resize",this.resizeEventListener),this.cacheComputedStyles(),this.updateChart(t),e(this.hostElement)}disconnectedCallback(){window.removeEventListener("resize",this.resizeEventListener)}cacheComputedStyles(){this.chartContainerStyles=getComputedStyle(this.chartContainer),this.hostElementStyles=getComputedStyle(this.hostElement)}getColor(t){const r=d("var(--t-primary)",this.chartContainerStyles,this.hostElementStyles),i=d(this.color,this.chartContainerStyles,this.hostElementStyles);return d(t,this.chartContainerStyles,this.hostElementStyles)||(l(t)?t:i||(l(this.color)?this.color:r))}processData(t){return t.map((t=>({value:t.value||0,itemStyle:{color:this.getColor(t.color)}})))}updateChart(t){var r;const i=(null===(r=this.formatModifier)||void 0===r?void 0:r.includes("dec"))?this.formatModifier.replace("dec",""):0,e={type:"value",axisLabel:{formatter:t=>f(t,{type:this.format,decimals:i}),rotate:this.offsetDataValues?45:0,margin:this.offsetDataValues?15:8,show:!this.hideValueAxisLabels}},n={type:"category",data:this.data.map((t=>a(t.name)||"")),axisLabel:{rotate:this.offsetDataNames?45:0,margin:this.offsetDataNames?15:8,interval:0,width:this.dataNamesWidth||50,overflow:this.dataNamesOverflow||"none",truncate:"ellipsis"},axisTick:{alignWithLabel:this.offsetDataNames}};return t.setOption({aria:{enabled:!0},title:{text:this.chartName,show:this.showChartName,left:this.alignChartName},grid:{containLabel:!0},xAxis:"horizontal"===this.orientation?e:n,yAxis:"horizontal"===this.orientation?n:e,series:[{data:this.processData(this.data),id:"bar",type:"bar",label:{show:!this.hideBarLabels,position:"top",fontWeight:"bold",formatter:t=>f(t.value,{type:this.format,decimals:i})},realtimeSort:this.sort}]})}resizeChart(){this.chart.resize()}propsUpdates(){this.updateChart(this.chart)}render(){return r("div",{class:"container"},r("div",{ref:t=>this.chartContainer=t,class:"chart-container","test-id":"barChartContainer"}))}get hostElement(){return i(this)}static get watchers(){return{chartName:["propsUpdates"],color:["propsUpdates"],hideBarLabels:["propsUpdates"],showChartName:["propsUpdates"],alignChartName:["propsUpdates"],orientation:["propsUpdates"],format:["propsUpdates"],sort:["propsUpdates"],data:["propsUpdates"],offsetDataNames:["propsUpdates"],hideValueAxisLabels:["propsUpdates"],formatModifier:["propsUpdates"],dataNamesOverflow:["propsUpdates"]}}};xt.style="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{width:var(--tct-bar-chart-width, 100%);height:var(--tct-bar-chart-height, 100%);display:block}.container{width:100%;height:100%}.chart-container{width:100%;height:100%}";export{xt as q2_chart_bar}
@@ -0,0 +1 @@
1
+ import{h as o}from"./p-926a3e80.js";var n,i=(function(o){o.exports={polyfill:function(){var o=window,n=document;if(!("scrollBehavior"in n.documentElement.style)||!0===o.__forceSmoothScrollPolyfill__){var i,t=o.HTMLElement||o.Element,e={scroll:o.scroll||o.scrollTo,scrollBy:o.scrollBy,elementScroll:t.prototype.scroll||a,scrollIntoView:t.prototype.scrollIntoView},r=o.performance&&o.performance.now?o.performance.now.bind(o.performance):Date.now,s=(i=o.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(i)?1:0);o.scroll=o.scrollTo=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?h.call(o,n.body,void 0!==arguments[0].left?~~arguments[0].left:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:o.scrollY||o.pageYOffset):e.scroll.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:o.scrollY||o.pageYOffset))},o.scrollBy=function(){void 0!==arguments[0]&&(u(arguments[0])?e.scrollBy.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(o,n.body,~~arguments[0].left+(o.scrollX||o.pageXOffset),~~arguments[0].top+(o.scrollY||o.pageYOffset)))},t.prototype.scroll=t.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==u(arguments[0])){var o=arguments[0].left,n=arguments[0].top;h.call(this,this,void 0===o?this.scrollLeft:~~o,void 0===n?this.scrollTop:~~n)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");e.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},t.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):e.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},t.prototype.scrollIntoView=function(){if(!0!==u(arguments[0])){var i=v(this),t=i.getBoundingClientRect(),r=this.getBoundingClientRect();i!==n.body?(h.call(this,i,i.scrollLeft+r.left-t.left,i.scrollTop+r.top-t.top),"fixed"!==o.getComputedStyle(i).position&&o.scrollBy({left:t.left,top:t.top,behavior:"smooth"})):o.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else e.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function a(o,n){this.scrollLeft=o,this.scrollTop=n}function u(o){if(null===o||"object"!=typeof o||void 0===o.behavior||"auto"===o.behavior||"instant"===o.behavior)return!0;if("object"==typeof o&&"smooth"===o.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+o.behavior+" is not a valid value for enumeration ScrollBehavior.")}function l(o,n){return"Y"===n?o.clientHeight+s<o.scrollHeight:"X"===n?o.clientWidth+s<o.scrollWidth:void 0}function d(n,i){var t=o.getComputedStyle(n,null)["overflow"+i];return"auto"===t||"scroll"===t}function c(o){var n=l(o,"Y")&&d(o,"Y"),i=l(o,"X")&&d(o,"X");return n||i}function v(o){for(;o!==n.body&&!1===c(o);)o=o.parentNode||o.host;return o}function f(n){var i,t,e,s=(r()-n.startTime)/468;s=s>1?1:s,i=.5*(1-Math.cos(Math.PI*s)),n.method.call(n.scrollable,t=n.startX+(n.x-n.startX)*i,e=n.startY+(n.y-n.startY)*i),t===n.x&&e===n.y||o.requestAnimationFrame(f.bind(o,n))}function h(i,t,s){var u,l,d,c,v=r();i===n.body?(u=o,l=o.scrollX||o.pageXOffset,d=o.scrollY||o.pageYOffset,c=e.scroll):(u=i,l=i.scrollLeft,d=i.scrollTop,c=a),f({scrollable:u,method:c,startTime:v,startX:l,startY:d,x:t,y:s})}}}}(n={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),n.exports);function t(o,n){const i=["focusin","focus"].includes(o.type)?o.target:o.relatedTarget,t=o=>o===n||!!o.parentElement&&t(o.parentElement);return i instanceof HTMLElement&&!t(i)}function e(o,n){return o.relatedTarget!==n&&!n.contains(o.relatedTarget)}function r(o,n){var i;return(null===(i=o.composedPath)||void 0===i?void 0:i.call(o)[0])===n}function s(o){o.focus=()=>null==o?void 0:o.dispatchEvent(new FocusEvent("focus",{bubbles:!1}))}function a(){return!!function(){const o=navigator.userAgent.toLowerCase();return o.includes("safari")&&!o.includes("chrome")}()&&(i.polyfill(),window.__forceSmoothScrollPolyfill__=!0)}function u(){return navigator.userAgent.toLowerCase().includes("firefox")}function l(){return"ontouchstart"in window||navigator.maxTouchPoints>0}let d=1e3;function c(){return d++}function v(o){requestAnimationFrame((()=>{requestAnimationFrame(o)}))}function f(){return new Promise((o=>v(o)))}function h(o,n){var i,t,e;return o?!0===(null===(i=window.Tecton)||void 0===i?void 0:i.noStrings)?o:null!==(e=null===(t=null===window||void 0===window?void 0:window.TectonElements)||void 0===t?void 0:t.loc(o,n))&&void 0!==e?e:o:""}function p(n){const{label:i,hideLabel:t}=n;if(!i||t)return;let e="";return n.optional&&(e=o("span",{class:"optional-tag"},h("tecton.element.input.optional"))),n.readonly&&(e=o("span",{class:"optional-tag"},h("tecton.element.input.readonly"))),o("label",{htmlFor:n.inputId,class:n.readonly?"readonly-field":""},h(n.label),e)}function w(o){const{ariaLabel:n}=o;n&&("hideLabel"in o&&(o.hideLabel=!0),o.label=h(n),o.ariaLabel=void 0)}function m(n){return o("div",{class:"messages-container"},o("q2-message",{appearance:"minimal",description:!0,type:n.hasError?"danger":"info"},o("ul",{id:n.inputDescribedBy},n.messages.map((n=>o("li",null,h(n)))))))}function b(o){const n=o.hostElement.shadowRoot.querySelector(".messages-container"),i=n.querySelector("q2-message");v((()=>{const t=o.showMessages&&o.hasFocus?i.getBoundingClientRect().height:0;n.style.getPropertyValue("height")!==`${t}px`&&(0===t?(i.classList.add("invisible"),n.style.removeProperty("height")):(i.classList.remove("invisible"),n.style.setProperty("height",`${t}px`)))}))}function y(o){var n,i,t,e;const{dropdownContainer:r,popDirection:s}=o;if(r&&(r.style.maxHeight=null),s)return o.privatePopDirection=s;const a=o.inputField||o.controlElement,u=o.minPopHeight||null;r.classList.add("sizable");const l=r.getBoundingClientRect().height;r.classList.remove("sizable");const{top:d,height:c}=a.getBoundingClientRect(),v=((null===(i=null===(n=window.Tecton)||void 0===n?void 0:n.platformDimensions)||void 0===i?void 0:i.scrollY)||0)+((null===(e=null===(t=window.Tecton)||void 0===t?void 0:t.platformDimensions)||void 0===e?void 0:e.innerHeight)||window.innerHeight)-d-c,f=l<=d;if(v>l)return o.privatePopDirection="down";if(f||!u)return g(o),o.privatePopDirection="up";if(v>=u+5){const n=Math.max(v-5,u);return r.style.maxHeight=`${n}px`,o.privatePopDirection="down"}{const n=Math.max(d,u);return r.style.maxHeight=`${n}px`,g(o),o.privatePopDirection="up"}}const g=({dropdownContainer:o,inputField:n})=>{var i,t;if(!n)return;const e=null===(t=null===(i=n.shadowRoot)||void 0===i?void 0:i.querySelector(".input-field"))||void 0===t?void 0:t.getBoundingClientRect().height;o.style.setProperty("--comp-dropup-offset",`${e}px`)},x=()=>{var o,n;return null===(n=null===(o=window.TectonElements)||void 0===o?void 0:o.resizeIframe)||void 0===n?void 0:n.call(o)},j=o=>{!o.intent&&["primary","secondary"].includes(o.color)&&(o.intent=`workflow-${o.color}`,o.color=void 0)};export{l as a,e as b,c,t as d,a as e,b as f,p as g,w as h,r as i,u as j,j as k,h as l,m,v as n,s as o,x as r,y as s,f as w}
@@ -0,0 +1 @@
1
+ const e=(e,n)=>{var t;if(!("open"in document.createElement("dialog")))return!1;if(!(null===(t=window.TectonElements)||void 0===t?void 0:t.showActionSheet))return!1;if(n){const e=n instanceof KeyboardEvent,t=n instanceof MouseEvent,i=e&&["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"].includes(n.key);if(!(t&&"click"===n.type||i))return!1}return!!e.hoist},n=e=>{const t={disabled:!1,display:"",hidden:!1,multiline:!1,value:"",innerHTML:""},i=Object.keys(t),o={disabled:!1,label:"",options:[]},r=Object.keys(o);return e.map((e=>{if("Q2-OPTGROUP"===e.tagName){const t=e;return r.reduce(((i,o)=>{if("options"===o){const t=Array.from(e.children).filter((e=>"Q2-OPTION"===e.tagName||"Q2-OPTGROUP"===e.tagName));i[o]=n(t)}else i[o]=t[o];return i}),Object.assign({},o))}if("Q2-OPTION"===e.tagName)return i.reduce(((n,t)=>(n[t]=e[t],n)),Object.assign({},t))}))},t=async(e,t)=>{var i;const o=await(async(e,t)=>({appearance:"list",title:e.label||"",description:"",event:t,listProps:{multiple:!!e.optionList.multiple,selectedOptions:e.optionList.selectedOptions||[],noSelect:!!e.optionList.noSelect},options:n(await e.optionList.getContents())}))(e,t);return null===(i=window.TectonElements)||void 0===i?void 0:i.showActionSheet(o)};export{t as a,e as s}