@alisaitteke/seatmap-canvas 2.5.18 → 2.5.19

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 (191) hide show
  1. package/README.md +249 -4
  2. package/dist/cjs/seatmap.canvas.js +2 -16
  3. package/dist/cjs/seatmap.canvas.js.map +1 -1
  4. package/dist/cjs/types/canvas.index.d.ts +5 -0
  5. package/dist/cjs/types/converters/parser.base.d.ts +7 -0
  6. package/dist/cjs/types/converters/pretix/pretix.model.d.ts +75 -0
  7. package/dist/cjs/types/converters/pretix/pretix.parser.d.ts +7 -0
  8. package/dist/cjs/types/enums/parser.enum.d.ts +4 -0
  9. package/dist/cjs/types/examples/react/src/App.d.ts +3 -0
  10. package/dist/cjs/types/examples/react/src/main.d.ts +1 -0
  11. package/dist/cjs/types/examples/react/vite.config.d.ts +2 -0
  12. package/dist/cjs/types/examples/vue/main.d.ts +1 -0
  13. package/dist/cjs/types/examples/vue/vite.config.d.ts +2 -0
  14. package/dist/cjs/types/models/block.model.d.ts +1 -0
  15. package/dist/cjs/types/models/data.model.d.ts +3 -2
  16. package/dist/cjs/types/models/defaults.model.d.ts +2 -0
  17. package/dist/cjs/types/models/styles/seat.style.d.ts +1 -0
  18. package/dist/cjs/types/src/lib/canvas.index.browser.d.ts +2 -0
  19. package/dist/cjs/types/src/lib/canvas.index.d.ts +28 -0
  20. package/dist/cjs/types/src/lib/config.d.ts +3 -0
  21. package/dist/cjs/types/src/lib/converters/parser.base.d.ts +7 -0
  22. package/dist/cjs/types/src/lib/converters/pretix/pretix.model.d.ts +75 -0
  23. package/dist/cjs/types/src/lib/converters/pretix/pretix.parser.d.ts +7 -0
  24. package/dist/cjs/types/src/lib/decorators/dom.d.ts +8 -0
  25. package/dist/cjs/types/src/lib/decorators/index.d.ts +1 -0
  26. package/dist/cjs/types/src/lib/dev.tools.d.ts +6 -0
  27. package/dist/cjs/types/src/lib/enums/global.d.ts +46 -0
  28. package/dist/cjs/types/src/lib/enums/parser.enum.d.ts +4 -0
  29. package/dist/cjs/types/src/lib/models/block.model.d.ts +30 -0
  30. package/dist/cjs/types/src/lib/models/coordinate.model.d.ts +7 -0
  31. package/dist/cjs/types/src/lib/models/data.model.d.ts +27 -0
  32. package/dist/cjs/types/src/lib/models/defaults.model.d.ts +34 -0
  33. package/dist/cjs/types/src/lib/models/global.model.d.ts +18 -0
  34. package/dist/cjs/types/src/lib/models/label.model.d.ts +9 -0
  35. package/dist/cjs/types/src/lib/models/legend.model.d.ts +8 -0
  36. package/dist/cjs/types/src/lib/models/model.base.d.ts +5 -0
  37. package/dist/cjs/types/src/lib/models/seat.model.d.ts +40 -0
  38. package/dist/cjs/types/src/lib/models/styles/block.style.d.ts +7 -0
  39. package/dist/cjs/types/src/lib/models/styles/label.style.d.ts +6 -0
  40. package/dist/cjs/types/src/lib/models/styles/legend.style.d.ts +6 -0
  41. package/dist/cjs/types/src/lib/models/styles/seat.style.d.ts +13 -0
  42. package/dist/cjs/types/src/lib/models/styles/tooltip.style.d.ts +7 -0
  43. package/dist/cjs/types/src/lib/svg/event.manager.d.ts +12 -0
  44. package/dist/cjs/types/src/lib/svg/legend/legend.circle.d.ts +7 -0
  45. package/dist/cjs/types/src/lib/svg/legend/legend.item.d.ts +13 -0
  46. package/dist/cjs/types/src/lib/svg/legend/legend.title.d.ts +7 -0
  47. package/dist/cjs/types/src/lib/svg/legend.d.ts +8 -0
  48. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/block-item.bounds.d.ts +12 -0
  49. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/block-item.index.d.ts +23 -0
  50. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/block-item.info.index.d.ts +11 -0
  51. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/block-item.labels.index.d.ts +11 -0
  52. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/block-item.mask.d.ts +12 -0
  53. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/block-item.seats.index.d.ts +15 -0
  54. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/bound/bound-item.index.d.ts +12 -0
  55. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/info/title.d.ts +7 -0
  56. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/label/label-item.circle.d.ts +7 -0
  57. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/label/label-item.index.d.ts +13 -0
  58. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/label/label-item.title.d.ts +7 -0
  59. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.check.d.ts +10 -0
  60. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.circle.d.ts +7 -0
  61. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.custom-area.d.ts +7 -0
  62. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.custom-check.d.ts +10 -0
  63. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.custom.d.ts +9 -0
  64. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.index.d.ts +30 -0
  65. package/dist/cjs/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.title.d.ts +7 -0
  66. package/dist/cjs/types/src/lib/svg/stage/blocks/blocks.index.d.ts +15 -0
  67. package/dist/cjs/types/src/lib/svg/stage/blocks.search-circle.d.ts +12 -0
  68. package/dist/cjs/types/src/lib/svg/stage/multi-select/rect.d.ts +7 -0
  69. package/dist/cjs/types/src/lib/svg/stage/multi-select.d.ts +13 -0
  70. package/dist/cjs/types/src/lib/svg/stage/search-circle/circle.d.ts +7 -0
  71. package/dist/cjs/types/src/lib/svg/stage/stage.index.d.ts +11 -0
  72. package/dist/cjs/types/src/lib/svg/svg.base.d.ts +35 -0
  73. package/dist/cjs/types/src/lib/svg/svg.index.d.ts +16 -0
  74. package/dist/cjs/types/src/lib/svg/tooltip/rect.d.ts +8 -0
  75. package/dist/cjs/types/src/lib/svg/tooltip/title.d.ts +10 -0
  76. package/dist/cjs/types/src/lib/svg/tooltip.d.ts +15 -0
  77. package/dist/cjs/types/src/lib/svg/zoom-out.bg.d.ts +7 -0
  78. package/dist/cjs/types/src/lib/svg/zoom.manager.d.ts +41 -0
  79. package/dist/cjs/types/src/lib/window.manager.d.ts +9 -0
  80. package/dist/cjs/types/src/react/SeatmapCanvas.d.ts +7 -0
  81. package/dist/cjs/types/src/react/index.d.ts +4 -0
  82. package/dist/cjs/types/src/react/types.d.ts +65 -0
  83. package/dist/cjs/types/src/react/useSeatmap.d.ts +2 -0
  84. package/dist/cjs/types/src/vue/index.d.ts +12 -0
  85. package/dist/cjs/types/src/vue/types.d.ts +42 -0
  86. package/dist/cjs/types/src/vue/useSeatmap.d.ts +19 -0
  87. package/dist/cjs/types/svg/stage/blocks/block-item/block-item.seats.index.d.ts +1 -1
  88. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.custom-area.d.ts +7 -0
  89. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.custom-check.d.ts +10 -0
  90. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.custom.d.ts +9 -0
  91. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.index.d.ts +3 -1
  92. package/dist/cjs/types/svg/stage/blocks/blocks.index.d.ts +2 -0
  93. package/dist/cjs/types/svg/svg.base.d.ts +2 -2
  94. package/dist/cjs/types/svg/zoom.manager.d.ts +1 -0
  95. package/dist/dependencies.txt +176 -333
  96. package/dist/esm/seatmap.canvas.js +2 -16
  97. package/dist/esm/seatmap.canvas.js.map +1 -1
  98. package/dist/esm/types/canvas.index.d.ts +5 -0
  99. package/dist/esm/types/converters/parser.base.d.ts +7 -0
  100. package/dist/esm/types/converters/pretix/pretix.model.d.ts +75 -0
  101. package/dist/esm/types/converters/pretix/pretix.parser.d.ts +7 -0
  102. package/dist/esm/types/enums/parser.enum.d.ts +4 -0
  103. package/dist/esm/types/examples/react/src/App.d.ts +3 -0
  104. package/dist/esm/types/examples/react/src/main.d.ts +1 -0
  105. package/dist/esm/types/examples/react/vite.config.d.ts +2 -0
  106. package/dist/esm/types/examples/vue/main.d.ts +1 -0
  107. package/dist/esm/types/examples/vue/vite.config.d.ts +2 -0
  108. package/dist/esm/types/models/block.model.d.ts +1 -0
  109. package/dist/esm/types/models/data.model.d.ts +3 -2
  110. package/dist/esm/types/models/defaults.model.d.ts +2 -0
  111. package/dist/esm/types/models/styles/seat.style.d.ts +1 -0
  112. package/dist/esm/types/src/lib/canvas.index.browser.d.ts +2 -0
  113. package/dist/esm/types/src/lib/canvas.index.d.ts +28 -0
  114. package/dist/esm/types/src/lib/config.d.ts +3 -0
  115. package/dist/esm/types/src/lib/converters/parser.base.d.ts +7 -0
  116. package/dist/esm/types/src/lib/converters/pretix/pretix.model.d.ts +75 -0
  117. package/dist/esm/types/src/lib/converters/pretix/pretix.parser.d.ts +7 -0
  118. package/dist/esm/types/src/lib/decorators/dom.d.ts +8 -0
  119. package/dist/esm/types/src/lib/decorators/index.d.ts +1 -0
  120. package/dist/esm/types/src/lib/dev.tools.d.ts +6 -0
  121. package/dist/esm/types/src/lib/enums/global.d.ts +46 -0
  122. package/dist/esm/types/src/lib/enums/parser.enum.d.ts +4 -0
  123. package/dist/esm/types/src/lib/models/block.model.d.ts +30 -0
  124. package/dist/esm/types/src/lib/models/coordinate.model.d.ts +7 -0
  125. package/dist/esm/types/src/lib/models/data.model.d.ts +27 -0
  126. package/dist/esm/types/src/lib/models/defaults.model.d.ts +34 -0
  127. package/dist/esm/types/src/lib/models/global.model.d.ts +18 -0
  128. package/dist/esm/types/src/lib/models/label.model.d.ts +9 -0
  129. package/dist/esm/types/src/lib/models/legend.model.d.ts +8 -0
  130. package/dist/esm/types/src/lib/models/model.base.d.ts +5 -0
  131. package/dist/esm/types/src/lib/models/seat.model.d.ts +40 -0
  132. package/dist/esm/types/src/lib/models/styles/block.style.d.ts +7 -0
  133. package/dist/esm/types/src/lib/models/styles/label.style.d.ts +6 -0
  134. package/dist/esm/types/src/lib/models/styles/legend.style.d.ts +6 -0
  135. package/dist/esm/types/src/lib/models/styles/seat.style.d.ts +13 -0
  136. package/dist/esm/types/src/lib/models/styles/tooltip.style.d.ts +7 -0
  137. package/dist/esm/types/src/lib/svg/event.manager.d.ts +12 -0
  138. package/dist/esm/types/src/lib/svg/legend/legend.circle.d.ts +7 -0
  139. package/dist/esm/types/src/lib/svg/legend/legend.item.d.ts +13 -0
  140. package/dist/esm/types/src/lib/svg/legend/legend.title.d.ts +7 -0
  141. package/dist/esm/types/src/lib/svg/legend.d.ts +8 -0
  142. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/block-item.bounds.d.ts +12 -0
  143. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/block-item.index.d.ts +23 -0
  144. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/block-item.info.index.d.ts +11 -0
  145. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/block-item.labels.index.d.ts +11 -0
  146. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/block-item.mask.d.ts +12 -0
  147. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/block-item.seats.index.d.ts +15 -0
  148. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/bound/bound-item.index.d.ts +12 -0
  149. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/info/title.d.ts +7 -0
  150. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/label/label-item.circle.d.ts +7 -0
  151. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/label/label-item.index.d.ts +13 -0
  152. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/label/label-item.title.d.ts +7 -0
  153. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.check.d.ts +10 -0
  154. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.circle.d.ts +7 -0
  155. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.custom-area.d.ts +7 -0
  156. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.custom-check.d.ts +10 -0
  157. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.custom.d.ts +9 -0
  158. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.index.d.ts +30 -0
  159. package/dist/esm/types/src/lib/svg/stage/blocks/block-item/seat/seat-item.title.d.ts +7 -0
  160. package/dist/esm/types/src/lib/svg/stage/blocks/blocks.index.d.ts +15 -0
  161. package/dist/esm/types/src/lib/svg/stage/blocks.search-circle.d.ts +12 -0
  162. package/dist/esm/types/src/lib/svg/stage/multi-select/rect.d.ts +7 -0
  163. package/dist/esm/types/src/lib/svg/stage/multi-select.d.ts +13 -0
  164. package/dist/esm/types/src/lib/svg/stage/search-circle/circle.d.ts +7 -0
  165. package/dist/esm/types/src/lib/svg/stage/stage.index.d.ts +11 -0
  166. package/dist/esm/types/src/lib/svg/svg.base.d.ts +35 -0
  167. package/dist/esm/types/src/lib/svg/svg.index.d.ts +16 -0
  168. package/dist/esm/types/src/lib/svg/tooltip/rect.d.ts +8 -0
  169. package/dist/esm/types/src/lib/svg/tooltip/title.d.ts +10 -0
  170. package/dist/esm/types/src/lib/svg/tooltip.d.ts +15 -0
  171. package/dist/esm/types/src/lib/svg/zoom-out.bg.d.ts +7 -0
  172. package/dist/esm/types/src/lib/svg/zoom.manager.d.ts +41 -0
  173. package/dist/esm/types/src/lib/window.manager.d.ts +9 -0
  174. package/dist/esm/types/src/react/SeatmapCanvas.d.ts +7 -0
  175. package/dist/esm/types/src/react/index.d.ts +4 -0
  176. package/dist/esm/types/src/react/types.d.ts +65 -0
  177. package/dist/esm/types/src/react/useSeatmap.d.ts +2 -0
  178. package/dist/esm/types/src/vue/index.d.ts +12 -0
  179. package/dist/esm/types/src/vue/types.d.ts +42 -0
  180. package/dist/esm/types/src/vue/useSeatmap.d.ts +19 -0
  181. package/dist/esm/types/svg/stage/blocks/block-item/block-item.seats.index.d.ts +1 -1
  182. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.custom-area.d.ts +7 -0
  183. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.custom-check.d.ts +10 -0
  184. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.custom.d.ts +9 -0
  185. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.index.d.ts +3 -1
  186. package/dist/esm/types/svg/stage/blocks/blocks.index.d.ts +2 -0
  187. package/dist/esm/types/svg/svg.base.d.ts +2 -2
  188. package/dist/esm/types/svg/zoom.manager.d.ts +1 -0
  189. package/dist/types.d.ts +5 -0
  190. package/package.json +52 -7
  191. package/CHANGELOG.md +0 -78
@@ -1,18 +1,4 @@
1
- var t="http://www.w3.org/1999/xhtml",e={svg:"http://www.w3.org/2000/svg",xhtml:t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function n(t){var n=t+="",i=n.indexOf(":");return i>=0&&"xmlns"!==(n=t.slice(0,i))&&(t=t.slice(i+1)),e.hasOwnProperty(n)?{space:e[n],local:t}:t}function i(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===t&&n.documentElement.namespaceURI===t?n.createElement(e):n.createElementNS(i,e)}}function o(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function r(t){var e=n(t);return(e.local?o:i)(e)}function s(){}function a(t){return null==t?s:function(){return this.querySelector(t)}}function l(){return[]}function u(t){return null==t?l:function(){return this.querySelectorAll(t)}}function h(t){return function(){return this.matches(t)}}function c(t){return new Array(t.length)}function f(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}f.prototype={constructor:f,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var d="$";function p(t,e,n,i,o,r){for(var s,a=0,l=e.length,u=r.length;a<u;++a)(s=e[a])?(s.__data__=r[a],i[a]=s):n[a]=new f(t,r[a]);for(;a<l;++a)(s=e[a])&&(o[a]=s)}function g(t,e,n,i,o,r,s){var a,l,u,h={},c=e.length,p=r.length,g=new Array(c);for(a=0;a<c;++a)(l=e[a])&&(g[a]=u=d+s.call(l,l.__data__,a,e),u in h?o[a]=l:h[u]=l);for(a=0;a<p;++a)(l=h[u=d+s.call(t,r[a],a,r)])?(i[a]=l,l.__data__=r[a],h[u]=null):n[a]=new f(t,r[a]);for(a=0;a<c;++a)(l=e[a])&&h[g[a]]===l&&(o[a]=l)}function m(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function _(t){return function(){this.removeAttribute(t)}}function v(t){return function(){this.removeAttributeNS(t.space,t.local)}}function y(t,e){return function(){this.setAttribute(t,e)}}function b(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function w(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function E(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function x(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function k(t){return function(){this.style.removeProperty(t)}}function M(t,e,n){return function(){this.style.setProperty(t,e,n)}}function L(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function T(t,e){return t.style.getPropertyValue(e)||x(t).getComputedStyle(t,null).getPropertyValue(e)}function z(t){return function(){delete this[t]}}function C(t,e){return function(){this[t]=e}}function O(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function S(t){return t.trim().split(/^|\s+/)}function A(t){return t.classList||new B(t)}function B(t){this._node=t,this._names=S(t.getAttribute("class")||"")}function N(t,e){for(var n=A(t),i=-1,o=e.length;++i<o;)n.add(e[i])}function U(t,e){for(var n=A(t),i=-1,o=e.length;++i<o;)n.remove(e[i])}function V(t){return function(){N(this,t)}}function I(t){return function(){U(this,t)}}function K(t,e){return function(){(e.apply(this,arguments)?N:U)(this,t)}}function G(){this.textContent=""}function D(t){return function(){this.textContent=t}}function P(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function R(){this.innerHTML=""}function j(t){return function(){this.innerHTML=t}}function Z(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function H(){this.nextSibling&&this.parentNode.appendChild(this)}function Y(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function q(){return null}function X(){var t=this.parentNode;t&&t.removeChild(this)}function W(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function F(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}B.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var $={},J=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||($={mouseenter:"mouseover",mouseleave:"mouseout"}));function Q(t,e,n){return t=tt(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function tt(t,e,n){return function(i){var o=J;J=i;try{t.call(this,this.__data__,e,n)}finally{J=o}}}function et(t){return function(){var e=this.__on;if(e){for(var n,i=0,o=-1,r=e.length;i<r;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++o]=n:this.removeEventListener(n.type,n.listener,n.capture);++o?e.length=o:delete this.__on}}}function nt(t,e,n){var i=$.hasOwnProperty(t.type)?Q:tt;return function(o,r,s){var a,l=this.__on,u=i(e,r,s);if(l)for(var h=0,c=l.length;h<c;++h)if((a=l[h]).type===t.type&&a.name===t.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=u,a.capture=n),void(a.value=e);this.addEventListener(t.type,u,n),a={type:t.type,name:t.name,value:e,listener:u,capture:n},l?l.push(a):this.__on=[a]}}function it(t,e,n){var i=x(t),o=i.CustomEvent;"function"==typeof o?o=new o(e,n):(o=i.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function ot(t,e){return function(){return it(this,t,e)}}function rt(t,e){return function(){return it(this,t,e.apply(this,arguments))}}var st=[null];function at(t,e){this._groups=t,this._parents=e}function lt(){return new at([[document.documentElement]],st)}function ut(t){return"string"==typeof t?new at([[document.querySelector(t)]],[document.documentElement]):new at([[t]],st)}function ht(){for(var t,e=J;t=e.sourceEvent;)e=t;return e}function ct(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,[(i=i.matrixTransform(t.getScreenCTM().inverse())).x,i.y]}var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}function ft(t){var e=ht();return e.changedTouches&&(e=e.changedTouches[0]),ct(t,e)}function dt(t,e,n){arguments.length<3&&(n=e,e=ht().changedTouches);for(var i,o=0,r=e?e.length:0;o<r;++o)if((i=e[o]).identifier===n)return ct(t,i);return null}
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */at.prototype=lt.prototype={constructor:at,select:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,i=new Array(n),o=0;o<n;++o)for(var r,s,l=e[o],u=l.length,h=i[o]=new Array(u),c=0;c<u;++c)(r=l[c])&&(s=t.call(r,r.__data__,c,l))&&("__data__"in r&&(s.__data__=r.__data__),h[c]=s);return new at(i,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=u(t));for(var e=this._groups,n=e.length,i=[],o=[],r=0;r<n;++r)for(var s,a=e[r],l=a.length,h=0;h<l;++h)(s=a[h])&&(i.push(t.call(s,s.__data__,h,a)),o.push(s));return new at(i,o)},filter:function(t){"function"!=typeof t&&(t=h(t));for(var e=this._groups,n=e.length,i=new Array(n),o=0;o<n;++o)for(var r,s=e[o],a=s.length,l=i[o]=[],u=0;u<a;++u)(r=s[u])&&t.call(r,r.__data__,u,s)&&l.push(r);return new at(i,this._parents)},data:function(t,e){if(!t)return d=new Array(this.size()),u=-1,this.each((function(t){d[++u]=t})),d;var n=e?g:p,i=this._parents,o=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var r=o.length,s=new Array(r),a=new Array(r),l=new Array(r),u=0;u<r;++u){var h=i[u],c=o[u],f=c.length,d=t.call(h,h&&h.__data__,u,i),m=d.length,_=a[u]=new Array(m),v=s[u]=new Array(m);n(h,c,_,v,l[u]=new Array(f),d,e);for(var y,b,w=0,E=0;w<m;++w)if(y=_[w]){for(w>=E&&(E=w+1);!(b=v[E])&&++E<m;);y._next=b||null}}return(s=new at(s,i))._enter=a,s._exit=l,s},enter:function(){return new at(this._enter||this._groups.map(c),this._parents)},exit:function(){return new at(this._exit||this._groups.map(c),this._parents)},join:function(t,e,n){var i=this.enter(),o=this,r=this.exit();return i="function"==typeof t?t(i):i.append(t+""),null!=e&&(o=e(o)),null==n?r.remove():n(r),i&&o?i.merge(o).order():o},merge:function(t){for(var e=this._groups,n=t._groups,i=e.length,o=n.length,r=Math.min(i,o),s=new Array(i),a=0;a<r;++a)for(var l,u=e[a],h=n[a],c=u.length,f=s[a]=new Array(c),d=0;d<c;++d)(l=u[d]||h[d])&&(f[d]=l);for(;a<i;++a)s[a]=e[a];return new at(s,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,o=t[e],r=o.length-1,s=o[r];--r>=0;)(i=o[r])&&(s&&4^i.compareDocumentPosition(s)&&s.parentNode.insertBefore(i,s),s=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=m);for(var n=this._groups,i=n.length,o=new Array(i),r=0;r<i;++r){for(var s,a=n[r],l=a.length,u=o[r]=new Array(l),h=0;h<l;++h)(s=a[h])&&(u[h]=s);u.sort(e)}return new at(o,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],o=0,r=i.length;o<r;++o){var s=i[o];if(s)return s}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var o,r=e[n],s=0,a=r.length;s<a;++s)(o=r[s])&&t.call(o,o.__data__,s,r);return this},attr:function(t,e){var i=n(t);if(arguments.length<2){var o=this.node();return i.local?o.getAttributeNS(i.space,i.local):o.getAttribute(i)}return this.each((null==e?i.local?v:_:"function"==typeof e?i.local?E:w:i.local?b:y)(i,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?k:"function"==typeof e?L:M)(t,e,null==n?"":n)):T(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?z:"function"==typeof e?O:C)(t,e)):this.node()[t]},classed:function(t,e){var n=S(t+"");if(arguments.length<2){for(var i=A(this.node()),o=-1,r=n.length;++o<r;)if(!i.contains(n[o]))return!1;return!0}return this.each(("function"==typeof e?K:e?V:I)(n,e))},text:function(t){return arguments.length?this.each(null==t?G:("function"==typeof t?P:D)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?R:("function"==typeof t?Z:j)(t)):this.node().innerHTML},raise:function(){return this.each(H)},lower:function(){return this.each(Y)},append:function(t){var e="function"==typeof t?t:r(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:r(t),i=null==e?q:"function"==typeof e?e:a(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each(X)},clone:function(t){return this.select(t?F:W)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,o,r=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),s=r.length;if(!(arguments.length<2)){for(a=e?nt:et,null==n&&(n=!1),i=0;i<s;++i)this.each(a(r[i],e,n));return this}var a=this.node().__on;if(a)for(var l,u=0,h=a.length;u<h;++u)for(i=0,l=a[u];i<s;++i)if((o=r[i]).type===l.type&&o.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?rt:ot)(t,e))}};var pt=function(t,e){return pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},pt(t,e)};function gt(t,e){function n(){this.constructor=t}pt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function mt(t,e,n,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(r<3?o(s):r>3?o(e,n,s):o(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s}function _t(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}var vt,yt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};
1
+ var t="http://www.w3.org/1999/xhtml",e={svg:"http://www.w3.org/2000/svg",xhtml:t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function n(t){var n=t+="",i=n.indexOf(":");return i>=0&&"xmlns"!==(n=t.slice(0,i))&&(t=t.slice(i+1)),e.hasOwnProperty(n)?{space:e[n],local:t}:t}function i(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===t&&n.documentElement.namespaceURI===t?n.createElement(e):n.createElementNS(i,e)}}function o(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function r(t){var e=n(t);return(e.local?o:i)(e)}function s(){}function a(t){return null==t?s:function(){return this.querySelector(t)}}function l(){return[]}function u(t){return null==t?l:function(){return this.querySelectorAll(t)}}function c(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}function h(t){return function(){return this.matches(t)}}function f(t){return function(e){return e.matches(t)}}var p=Array.prototype.find;function d(){return this.firstElementChild}var g=Array.prototype.filter;function m(){return Array.from(this.children)}function v(t){return new Array(t.length)}function y(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function _(t,e,n,i,o,r){for(var s,a=0,l=e.length,u=r.length;a<u;++a)(s=e[a])?(s.__data__=r[a],i[a]=s):n[a]=new y(t,r[a]);for(;a<l;++a)(s=e[a])&&(o[a]=s)}function b(t,e,n,i,o,r,s){var a,l,u,c=new Map,h=e.length,f=r.length,p=new Array(h);for(a=0;a<h;++a)(l=e[a])&&(p[a]=u=s.call(l,l.__data__,a,e)+"",c.has(u)?o[a]=l:c.set(u,l));for(a=0;a<f;++a)u=s.call(t,r[a],a,r)+"",(l=c.get(u))?(i[a]=l,l.__data__=r[a],c.delete(u)):n[a]=new y(t,r[a]);for(a=0;a<h;++a)(l=e[a])&&c.get(p[a])===l&&(o[a]=l)}function w(t){return t.__data__}function E(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function x(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function k(t){return function(){this.removeAttribute(t)}}function M(t){return function(){this.removeAttributeNS(t.space,t.local)}}function T(t,e){return function(){this.setAttribute(t,e)}}function L(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function z(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function C(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function S(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function A(t){return function(){this.style.removeProperty(t)}}function O(t,e,n){return function(){this.style.setProperty(t,e,n)}}function B(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function N(t,e){return t.style.getPropertyValue(e)||S(t).getComputedStyle(t,null).getPropertyValue(e)}function U(t){return function(){delete this[t]}}function $(t,e){return function(){this[t]=e}}function V(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function I(t){return t.trim().split(/^|\s+/)}function K(t){return t.classList||new G(t)}function G(t){this._node=t,this._names=I(t.getAttribute("class")||"")}function P(t,e){for(var n=K(t),i=-1,o=e.length;++i<o;)n.add(e[i])}function D(t,e){for(var n=K(t),i=-1,o=e.length;++i<o;)n.remove(e[i])}function j(t){return function(){P(this,t)}}function R(t){return function(){D(this,t)}}function Z(t,e){return function(){(e.apply(this,arguments)?P:D)(this,t)}}function H(){this.textContent=""}function Y(t){return function(){this.textContent=t}}function q(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function X(){this.innerHTML=""}function W(t){return function(){this.innerHTML=t}}function F(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function J(){this.nextSibling&&this.parentNode.appendChild(this)}function Q(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function tt(){return null}function et(){var t=this.parentNode;t&&t.removeChild(this)}function nt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function it(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ot(t){return function(){var e=this.__on;if(e){for(var n,i=0,o=-1,r=e.length;i<r;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?e.length=o:delete this.__on}}}function rt(t,e,n){return function(){var i,o=this.__on,r=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(o)for(var s=0,a=o.length;s<a;++s)if((i=o[s]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),void(i.value=e);this.addEventListener(t.type,r,n),i={type:t.type,name:t.name,value:e,listener:r,options:n},o?o.push(i):this.__on=[i]}}function st(t,e,n){var i=S(t),o=i.CustomEvent;"function"==typeof o?o=new o(e,n):(o=i.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function at(t,e){return function(){return st(this,t,e)}}function lt(t,e){return function(){return st(this,t,e.apply(this,arguments))}}y.prototype={constructor:y,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},G.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ut=[null];function ct(t,e){this._groups=t,this._parents=e}function ht(){return new ct([[document.documentElement]],ut)}function ft(t){return"string"==typeof t?new ct([[document.querySelector(t)]],[document.documentElement]):new ct([[t]],ut)}function pt(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}ct.prototype=ht.prototype={constructor:ct,select:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,i=new Array(n),o=0;o<n;++o)for(var r,s,l=e[o],u=l.length,c=i[o]=new Array(u),h=0;h<u;++h)(r=l[h])&&(s=t.call(r,r.__data__,h,l))&&("__data__"in r&&(s.__data__=r.__data__),c[h]=s);return new ct(i,this._parents)},selectAll:function(t){t="function"==typeof t?c(t):u(t);for(var e=this._groups,n=e.length,i=[],o=[],r=0;r<n;++r)for(var s,a=e[r],l=a.length,h=0;h<l;++h)(s=a[h])&&(i.push(t.call(s,s.__data__,h,a)),o.push(s));return new ct(i,o)},selectChild:function(t){return this.select(null==t?d:function(t){return function(){return p.call(this.children,t)}}("function"==typeof t?t:f(t)))},selectChildren:function(t){return this.selectAll(null==t?m:function(t){return function(){return g.call(this.children,t)}}("function"==typeof t?t:f(t)))},filter:function(t){"function"!=typeof t&&(t=h(t));for(var e=this._groups,n=e.length,i=new Array(n),o=0;o<n;++o)for(var r,s=e[o],a=s.length,l=i[o]=[],u=0;u<a;++u)(r=s[u])&&t.call(r,r.__data__,u,s)&&l.push(r);return new ct(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,w);var n=e?b:_,i=this._parents,o=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var r=o.length,s=new Array(r),a=new Array(r),l=new Array(r),u=0;u<r;++u){var c=i[u],h=o[u],f=h.length,p=E(t.call(c,c&&c.__data__,u,i)),d=p.length,g=a[u]=new Array(d),m=s[u]=new Array(d);n(c,h,g,m,l[u]=new Array(f),p,e);for(var v,y,x=0,k=0;x<d;++x)if(v=g[x]){for(x>=k&&(k=x+1);!(y=m[k])&&++k<d;);v._next=y||null}}return(s=new ct(s,i))._enter=a,s._exit=l,s},enter:function(){return new ct(this._enter||this._groups.map(v),this._parents)},exit:function(){return new ct(this._exit||this._groups.map(v),this._parents)},join:function(t,e,n){var i=this.enter(),o=this,r=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(o=e(o))&&(o=o.selection()),null==n?r.remove():n(r),i&&o?i.merge(o).order():o},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,o=n.length,r=i.length,s=Math.min(o,r),a=new Array(o),l=0;l<s;++l)for(var u,c=n[l],h=i[l],f=c.length,p=a[l]=new Array(f),d=0;d<f;++d)(u=c[d]||h[d])&&(p[d]=u);for(;l<o;++l)a[l]=n[l];return new ct(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,o=t[e],r=o.length-1,s=o[r];--r>=0;)(i=o[r])&&(s&&4^i.compareDocumentPosition(s)&&s.parentNode.insertBefore(i,s),s=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=x);for(var n=this._groups,i=n.length,o=new Array(i),r=0;r<i;++r){for(var s,a=n[r],l=a.length,u=o[r]=new Array(l),c=0;c<l;++c)(s=a[c])&&(u[c]=s);u.sort(e)}return new ct(o,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],o=0,r=i.length;o<r;++o){var s=i[o];if(s)return s}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var o,r=e[n],s=0,a=r.length;s<a;++s)(o=r[s])&&t.call(o,o.__data__,s,r);return this},attr:function(t,e){var i=n(t);if(arguments.length<2){var o=this.node();return i.local?o.getAttributeNS(i.space,i.local):o.getAttribute(i)}return this.each((null==e?i.local?M:k:"function"==typeof e?i.local?C:z:i.local?L:T)(i,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?A:"function"==typeof e?B:O)(t,e,null==n?"":n)):N(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?U:"function"==typeof e?V:$)(t,e)):this.node()[t]},classed:function(t,e){var n=I(t+"");if(arguments.length<2){for(var i=K(this.node()),o=-1,r=n.length;++o<r;)if(!i.contains(n[o]))return!1;return!0}return this.each(("function"==typeof e?Z:e?j:R)(n,e))},text:function(t){return arguments.length?this.each(null==t?H:("function"==typeof t?q:Y)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?X:("function"==typeof t?F:W)(t)):this.node().innerHTML},raise:function(){return this.each(J)},lower:function(){return this.each(Q)},append:function(t){var e="function"==typeof t?t:r(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:r(t),i=null==e?tt:"function"==typeof e?e:a(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(et)},clone:function(t){return this.select(t?it:nt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,o,r=function(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),s=r.length;if(!(arguments.length<2)){for(a=e?rt:ot,i=0;i<s;++i)this.each(a(r[i],e,n));return this}var a=this.node().__on;if(a)for(var l,u=0,c=a.length;u<c;++u)for(i=0,l=a[u];i<s;++i)if((o=r[i]).type===l.type&&o.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?lt:at)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,o=t[e],r=0,s=o.length;r<s;++r)(i=o[r])&&(yield i)}};var dt=function(t,e){return dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},dt(t,e)};function gt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}dt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function mt(t,e,n,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(r<3?o(s):r>3?o(e,n,s):o(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s}function vt(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function yt(t,e,n,i){return new(n||(n=Promise))(function(o,r){function s(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}l((i=i.apply(t,e||[])).next())})}function _t(t,e){var n,i,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(r=0)),r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}"function"==typeof SuppressedError&&SuppressedError;var bt,wt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};
16
2
  /*! *****************************************************************************
17
3
  Copyright (C) Microsoft. All rights reserved.
18
4
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -26,5 +12,5 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
26
12
 
27
13
  See the Apache Version 2.0 License for specific language governing permissions
28
14
  and limitations under the License.
29
- ***************************************************************************** */function bt(t,e){return t[0]-e[0]||t[1]-e[1]}function wt(t){for(var e,n,i,o=t.length,r=[0,1],s=2,a=2;a<o;++a){for(;s>1&&(e=t[r[s-2]],n=t[r[s-1]],i=t[a],(n[0]-e[0])*(i[1]-e[1])-(n[1]-e[1])*(i[0]-e[0])<=0);)--s;r[s++]=a}return r.slice(0,s)}!function(t){!function(e){var n="object"==typeof yt?yt:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(t);function o(t,e){return function(n,i){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:i}),e&&e(n,i)}}void 0===n.Reflect?n.Reflect=t:i=o(n.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",r="function"==typeof Object.create,s={__proto__:[]}instanceof Array,a=!r&&!s,l={create:r?function(){return it(Object.create(null))}:s?function(){return it({__proto__:null})}:function(){return it({})},has:a?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:a?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},u=Object.getPrototypeOf(Function),h="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,c=h||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,f=h||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,d=new(h||"function"!=typeof WeakMap?nt():WeakMap);function p(t,e,n,i){if(U(n)){if(!Z(t))throw new TypeError;if(!Y(e))throw new TypeError;return k(t,e)}if(!Z(t))throw new TypeError;if(!K(e))throw new TypeError;if(!K(i)&&!U(i)&&!V(i))throw new TypeError;return V(i)&&(i=void 0),M(t,e,n=j(n),i)}function g(t,e){function n(n,i){if(!K(n))throw new TypeError;if(!U(i)&&!q(i))throw new TypeError;S(t,e,n,i)}return n}function m(t,e,n,i){if(!K(n))throw new TypeError;return U(i)||(i=j(i)),S(t,e,n,i)}function _(t,e,n){if(!K(e))throw new TypeError;return U(n)||(n=j(n)),T(t,e,n)}function v(t,e,n){if(!K(e))throw new TypeError;return U(n)||(n=j(n)),z(t,e,n)}function y(t,e,n){if(!K(e))throw new TypeError;return U(n)||(n=j(n)),C(t,e,n)}function b(t,e,n){if(!K(e))throw new TypeError;return U(n)||(n=j(n)),O(t,e,n)}function w(t,e){if(!K(t))throw new TypeError;return U(e)||(e=j(e)),A(t,e)}function E(t,e){if(!K(t))throw new TypeError;return U(e)||(e=j(e)),B(t,e)}function x(t,e,n){if(!K(e))throw new TypeError;U(n)||(n=j(n));var i=L(e,n,!1);if(U(i))return!1;if(!i.delete(t))return!1;if(i.size>0)return!0;var o=d.get(e);return o.delete(n),o.size>0||d.delete(e),!0}function k(t,e){for(var n=t.length-1;n>=0;--n){var i=(0,t[n])(e);if(!U(i)&&!V(i)){if(!Y(i))throw new TypeError;e=i}}return e}function M(t,e,n,i){for(var o=t.length-1;o>=0;--o){var r=(0,t[o])(e,n,i);if(!U(r)&&!V(r)){if(!K(r))throw new TypeError;i=r}}return i}function L(t,e,n){var i=d.get(t);if(U(i)){if(!n)return;i=new c,d.set(t,i)}var o=i.get(e);if(U(o)){if(!n)return;o=new c,i.set(e,o)}return o}function T(t,e,n){if(z(t,e,n))return!0;var i=Q(e);return!V(i)&&T(t,i,n)}function z(t,e,n){var i=L(e,n,!1);return!U(i)&&P(i.has(t))}function C(t,e,n){if(z(t,e,n))return O(t,e,n);var i=Q(e);return V(i)?void 0:C(t,i,n)}function O(t,e,n){var i=L(e,n,!1);if(!U(i))return i.get(t)}function S(t,e,n,i){L(n,i,!0).set(t,e)}function A(t,e){var n=B(t,e),i=Q(t);if(null===i)return n;var o=A(i,e);if(o.length<=0)return n;if(n.length<=0)return o;for(var r=new f,s=[],a=0,l=n;a<l.length;a++){var u=l[a];r.has(u)||(r.add(u),s.push(u))}for(var h=0,c=o;h<c.length;h++){u=c[h];r.has(u)||(r.add(u),s.push(u))}return s}function B(t,e){var n=[],i=L(t,e,!1);if(U(i))return n;for(var o=W(i.keys()),r=0;;){var s=$(o);if(!s)return n.length=r,n;var a=F(s);try{n[r]=a}catch(t){try{J(o)}finally{throw t}}r++}}function N(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function U(t){return void 0===t}function V(t){return null===t}function I(t){return"symbol"==typeof t}function K(t){return"object"==typeof t?null!==t:"function"==typeof t}function G(t,e){switch(N(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n="string",o=X(t,i);if(void 0!==o){var r=o.call(t,n);if(K(r))throw new TypeError;return r}return D(t)}function D(t,e){var n,i,o=t.toString;if(H(o)&&!K(i=o.call(t)))return i;if(H(n=t.valueOf)&&!K(i=n.call(t)))return i;throw new TypeError}function P(t){return!!t}function R(t){return""+t}function j(t){var e=G(t);return I(e)?e:R(e)}function Z(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function H(t){return"function"==typeof t}function Y(t){return"function"==typeof t}function q(t){switch(N(t)){case 3:case 4:return!0;default:return!1}}function X(t,e){var n=t[e];if(null!=n){if(!H(n))throw new TypeError;return n}}function W(t){var e=X(t,o);if(!H(e))throw new TypeError;var n=e.call(t);if(!K(n))throw new TypeError;return n}function F(t){return t.value}function $(t){var e=t.next();return!e.done&&e}function J(t){var e=t.return;e&&e.call(t)}function Q(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===u)return e;if(e!==u)return e;var n=t.prototype,i=n&&Object.getPrototypeOf(n);if(null==i||i===Object.prototype)return e;var o=i.constructor;return"function"!=typeof o||o===t?e:o}function tt(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[o]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var i=this._keys.length,o=n+1;o<i;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,i)},e.prototype.values=function(){return new n(this._keys,this._values,r)},e.prototype.entries=function(){return new n(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[o]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function i(t,e){return t}function r(t,e){return e}function s(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new c}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[o]=function(){return this.keys()},t}()}function nt(){var t=16,n=l.create(),i=o();return function(){function t(){this._key=o()}return t.prototype.has=function(t){var e=r(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){var e=r(t,!1);return void 0!==e?l.get(e,this._key):void 0},t.prototype.set=function(t,e){return r(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=r(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=o()},t}();function o(){var t;do{t="@@WeakMap@@"+u()}while(l.has(n,t));return n[t]=!0,t}function r(t,n){if(!e.call(t,i)){if(!n)return;Object.defineProperty(t,i,{value:l.create()})}return t[i]}function s(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function a(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):s(new Uint8Array(t),t):s(new Array(t),t)}function u(){var e=a(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",i=0;i<t;++i){var o=e[i];4!==i&&6!==i&&8!==i||(n+="-"),o<16&&(n+="0"),n+=o.toString(16).toLowerCase()}return n}}function it(t){return t.__=void 0,delete t.__,t}t("decorate",p),t("metadata",g),t("defineMetadata",m),t("hasMetadata",_),t("hasOwnMetadata",v),t("getMetadata",y),t("getOwnMetadata",b),t("getMetadataKeys",w),t("getOwnMetadataKeys",E),t("deleteMetadata",x)}(i)}()}(vt||(vt={}));var Et=function(){function t(t){return this.parent=t,this.node=null,this.autoGenerate=!1,this.child_index=null,this.domText=null,this.child_items=[],this.dom_attrs=[],this.dom_classes=[],this.tags=[],this.eventCode=null,void 0!==t.global&&(this.global=t.global),Object(this).dom_params&&(Object(this).dom_params.tag&&(this.domTag=Object(this).dom_params.tag),Object(this).dom_params.class&&(this.domClass=Object(this).dom_params.class),Object(this).dom_params.event_code&&(this.eventCode=Object(this).dom_params.event_code)),void 0!==Object(this).dom_params.autoGenerate&&!0===Object(this).dom_params.autoGenerate&&(this.autoGenerate=!0),this.generateThisDom(),this}return t.prototype.generateThisDom=function(){return this.autoGenerate&&(this.domGenerate(this.parent.node),this.afterGenerate()),this},t.prototype.domGenerate=function(t,e){void 0===e&&(e=0);var n=this.domTag?this.domTag:"g";this.child_index=e,this.node=t.datum(this.parent).append(n);for(var i=0;i<this.dom_attrs.length;i++){var o=this.dom_attrs[i];this.node.attr(o.name,o.value)}this.domText&&this.node.text(this.domText),this.domClass&&this.node.classed(this.domClass,!0);for(var r=0;r<this.dom_classes.length;r++){var s=this.dom_classes[r];this.node.classed(s.name,s.value)}return this},t.prototype.attr=function(t,e){return this.dom_attrs.push({name:t,value:e}),this},t.prototype.text=function(t){return this.domText=t,this},t.prototype.addChild=function(t,e,n){for(var i in e){var o=e[i];t.dom_attrs.push({name:i,value:o})}return this.child_items.push(t),this},t.prototype.classed=function(t,e){return void 0===e&&(e=!0),this.dom_classes.push({name:t,value:e}),this},t.prototype.clear=function(){return this.child_items.map((function(t){t.node.remove()})),this.child_items=[],this},t.prototype.updateChilds=function(){var t=this;return this.child_items.map((function(e,n){e.domGenerate(t.node,n),e.update()})),this.afterGenerate(),this.updateEvents(!1),this},t.prototype.updateEvents=function(t){void 0===t&&(t=!1);var e=this,n=["click","mousever","mouseleave","mouseout","mouseenter","mousemove","keydown","keypress","mousedown","mouseup","touchstart"];if(this.eventCode){for(var i=function(t){var i=o.global.eventManager.events[t],r=i.type.toString().split(".");r[0].toLowerCase()===o.eventCode.toLowerCase()&&-1!==n.indexOf(r[1].toLowerCase())&&void 0!==r[1]&&o.node.on(r[1].toLowerCase()+".globalevent",(function(t){var n=ft(e.parent.node.node());i.fn(e,t,n)}))},o=this,r=0;r<this.global.eventManager.events.length;r++)i(r);t&&this.child_items.length>0&&this.child_items.map((function(t){"function"==typeof t.updateEvents&&t.updateEvents(!0)}))}return this},t.prototype.addEventListener=function(t,e){return this.global.eventManager.addEventListener(t,e),this.updateEvents(!1),this},t.prototype.addTag=function(t){return this.tags.push(t),this},t.prototype.hasTag=function(t){return-1!==this.tags.indexOf(t)},t.prototype.getChilds=function(t){return void 0===t&&(t=null),null===t?this.child_items.filter((function(e){return e.constructor.name===t})):this.child_items},t.prototype.getChildCount=function(){return this.child_items.length},t.prototype.beforeGenerate=function(){},t.prototype.afterGenerate=function(){},t.prototype.addToParent=function(){return this.parent.addChild(this),this},t.prototype.addTo=function(t){return t.addChild(this),this},t}();function xt(t){return function(e){e.prototype.dom_params={},t.tag&&(e.prototype.dom_params.tag=t.tag),t.class&&(e.prototype.dom_params.class=t.class),t.event_code?e.prototype.dom_params.event_code=t.event_code:t.class&&(e.prototype.dom_params.event_code=t.class),void 0!==t.autoGenerate?e.prototype.dom_params.autoGenerate=t.autoGenerate:e.prototype.dom_params.autoGenerate=!0}}var kt,Mt,Lt,Tt=function(){this.child_index=null,this.item_type=null},zt=function(t){function e(e){var n=t.call(this)||this;return n.tags=[],n.tag_index={},n.id=e.id,n.x=e.x,n.y=e.y,n.title=e.title||null,n.color=e.color||null,n.block=e.block,n.note=e.note||null,n.salable=!1!==e.salable||e.salable,n.selected=e.selected||!1,n.tags=e.tags||[],n.custom_data=e.custom_data||{},n.tag_index={},n.svg=null,n.icon=null,n}return gt(e,t),e.prototype.selectedToggle=function(){return this.selected=!0!==this.selected,this.selected},e.prototype.addTag=function(t){this.tag_index[t]||(this.tag_index[t]=!0,this.tags.push(t))},e.prototype.removeTags=function(t){},e.prototype.toJson=function(){return{id:this.id,x:this.x,y:this.y,salable:this.salable,note:this.note,color:this.color,block:this.block.toJson()}},e}(Tt),Ct=function(t){function e(e){var n=t.call(this)||this;return n.x=e.x,n.y=e.y,n.title=e.title,n.block=e.block,n}return gt(e,t),e}(Tt),Ot=function(t){function e(e){var n=t.call(this)||this;return n.id=e.id?e.id:(1e3*Math.random()).toString(),n.width=e.width||null,n.height=e.height||null,n.x=e.x||null,n.y=e.y||null,n.bounds=e._bounds||[],n.color=e.color||"#f1f1f1",n.border_color=e.border_color||"#f1f1f1",n.title=e.title,n.rotate=e.rotate||0,n.labels=e.labels.map((function(t){return t.block=n,new Ct(t)}))||[],n.seats=e.seats.map((function(t){return t.block=n,new zt(t)}))||[],n}return gt(e,t),e.prototype.toJson=function(){return{id:this.id,title:this.title,x:this.x,y:this.y,color:this.color,width:this.width,height:this.height}},e}(Tt),St=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("block-id",e.item.block.id),n.attr("r",n.global.config.style.seat.radius),n.attr("fill",n.global.config.style.seat.color),n.attr("stroke","rgba(0,0,0,0.3)"),n.attr("stroke-width",1),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([xt({tag:"circle",class:"seat-circle",autoGenerate:!1}),_t("design:paramtypes",[Nt])],e)}(Et),At=function(){function t(t){this.x=t.x||0,this.y=t.y||0}return t.prototype.toArray=function(){return[this.x,this.y]},t.prototype.toJson=function(){return{}},t}();!function(t){t.ADD_BLOCK="BLOCK.ADD",t.REMOVE_BLOCK="BLOCK.REMOVE",t.CLICK_BLOCK="BLOCK.CLICK",t.MOUSEENTER_BLOCK="BLOCK.MOUSEENTER",t.TOUCHSTART_BLOCK="BLOCK.TOUCHSTART",t.MOUSEDOWN_BLOCK="BLOCK.MOUSEDOWN",t.MOUSEUP_BLOCK="BLOCK.MOUSEUP",t.MOUSEMOVE_BLOCK="BLOCK.MOUSEMOVE",t.MOUSELEAVE_BLOCK="BLOCK.MOUSELEAVE",t.UPDATE_BLOCK="BLOCK.UPDATE",t.CLICK_SEAT="SEAT.CLICK",t.TOUCHSTART_SEAT="SEAT.TOUCHSTART",t.MOUSEMOVE_SEAT="SEAT.MOUSEMOVE",t.MOUSEDOWN_SEAT="SEAT.MOUSEDOWN",t.MOUSEENTER_SEAT="SEAT.MOUSEENTER",t.MOUSELEAVE_SEAT="SEAT.MOUSELEAVE",t.MOUSEOUT_SEAT="SEAT.MOUSEOUT",t.ADD_SEAT="SEAT.ADD",t.REMOVE_SEAT="SEAT.REMOVE",t.ZOOM_LEVEL_CHANGE="ZOOM_LEVEL_CHANGE",t.BOUND_CLICK="BOUND.CLICK",t.MOUSE_MOVE="MOUSE.MOVE",t.RESIZE_WINDOW="WINDOW.RESIZE",t.CLICK_ZOOM_OUT="ZOOM-OUT-BG.CLICK",t.MOUSEMOVE_ZOOM_OUT="ZOOM-OUT-BG.MOUSEMOVE",t.KEYDOWN_SVG="KEYDOWN.SEATMAP-SVG",t.KEYUP_SVG="KEYUP.SEATMAP-SVG",t.MULTI_SELECT_ENABLE="MULTI_SELECT_ENABLE",t.MULTI_SELECT_DISABLE="MULTI_SELECT_DISABLE",t.BEST_AVAILABLE_ENABLE="BEST_AVAILABLE_ENABLE",t.MBEST_AVAILABLE_DISABLE="MBEST_AVAILABLE_DISABLE",t.READY="READY"}(kt||(kt={})),function(t){t.VENUE="VENUE",t.BLOCK="BLOCK",t.SEAT="SEAT"}(Mt||(Mt={})),function(t){t.HOVER="hover",t.FOCUS="focus",t.LEAVE="leave",t.SELECT="select",t.NORMAL="normal"}(Lt||(Lt={}));var Bt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("d","M12.9,953.7l-6.3,6.5l-2.9-2.5l-2.1,2.4l4.1,3.5l1.1,1l1.1-1.1l7.3-7.6L12.9,953.7L12.9,953.7z"),n.attr("fill",n.global.config.style.seat.check_color),n.attr("transform","translate(-8,-959.36218)"),n.attr("pointer-events","none"),n.attr("display","none"),n}return gt(e,t),e.prototype.update=function(){return this},e.prototype.afterGenerate=function(){this.node.style("pointer-events","none")},e.prototype.show=function(){return this.node.attr("display","block"),this},e.prototype.hide=function(){return this.node.attr("display","none"),this},e=mt([xt({tag:"path",class:"seat-check",autoGenerate:!1}),_t("design:paramtypes",[Nt])],e)}(Et),Nt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i.coordinates=new At(n),i.attr("transform","translate("+i.coordinates.toArray()+")"),i.item.svg=i,i}return gt(e,t),e.prototype.setColor=function(t,e){return void 0===e&&(e=!1),e?this.circle.node.transition().duration(this.global.config.animation_speed).attr("fill",t):this.circle.node.attr("fill",t),this},e.prototype.updateColor=function(t){return this.setColor(this.getColor()),this},e.prototype.select=function(t){return this.item.selected=!0,this.node.classed("selected",!0),this.circle.node.attr("fill",this.global.config.style.seat.selected),this.check.show(),this},e.prototype.unSelect=function(){return this.item.selected=!1,this.node.classed("selected",!1),this.circle.node.attr("fill",this.global.config.style.seat.color),this.check.hide(),this},e.prototype.isSelected=function(){return this.item.selected},e.prototype.isSalable=function(){return this.item.salable},e.prototype.hover=function(){this.setColor(this.global.config.style.seat.hover)},e.prototype.blur=function(){this.setColor(this.getColor())},e.prototype.getColor=function(t){return void 0===t&&(t=null),this.isSalable()?t==Lt.FOCUS?this.isSelected()?this.global.config.style.seat.focus_out:this.global.config.style.seat.focus:t==Lt.HOVER?this.isSelected()?this.global.config.style.seat.selected:this.global.config.style.seat.hover:t==Lt.LEAVE?this.isSelected()?this.global.config.style.seat.selected:this.global.config.style.seat.color:t==Lt.SELECT?(this.isSelected(),this.global.config.style.seat.selected):this.isSelected()?this.global.config.style.seat.selected:this.global.config.style.seat.color:this.global.config.style.seat.not_salable},e.prototype.update=function(){return this.circle=new St(this),this.addChild(this.circle),this.check=new Bt(this).addTo(this),this.updateChilds(),this},e.prototype.afterGenerate=function(){this.setColor(this.getColor()),this.item.selected?this.check.show():this.check.hide()},e=mt([xt({tag:"g",class:"seat",autoGenerate:!1}),_t("design:paramtypes",[Vt,zt])],e)}(Et),Ut=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i.global.eventManager.addEventListener(kt.MOUSEENTER_SEAT,(function(t){i.global.multi_select||t.setColor(t.getColor(Lt.HOVER))})),i.global.eventManager.addEventListener(kt.MOUSELEAVE_SEAT,(function(t){t.setColor(t.getColor())})),i}return gt(e,t),e.prototype.update=function(){var t=this;return this.item.seats.forEach((function(e){t.addChild(new Nt(t,e),{id:e.id})})),this.updateChilds(),this},e.prototype.getSeat=function(t){return this.child_items.find((function(e){return e.item.id==t}))},e.prototype.getSeats=function(){return this.child_items},e.prototype.getSeatsCount=function(){return this.child_items.length},e.prototype.getSeatByIndex=function(t){return this.child_items[t]},e.prototype.resetSeatsColors=function(t){void 0===t&&(t=!1);for(var e=0;e<this.getSeatsCount();e++){var n=this.getSeatByIndex(e);n.item;var i=n.getColor();!n.isSelected()&&n.isSalable()&&(i=n.getColor(Lt.LEAVE),n.setColor(i,t))}},e=mt([xt({tag:"g",class:"seats",autoGenerate:!1}),_t("design:paramtypes",[Xt,Ot])],e)}(Et),Vt=Ut,It=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("fill",n.global.config.style.block.title_color),n.attr("font-size",48),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([xt({tag:"text",class:"title",autoGenerate:!1}),_t("design:paramtypes",[Gt])],e)}(Et),Kt=function(t){function e(e,n){var i=t.call(this,e)||this;i.parent=e,i.item=n,console.log("item",n),i.attr("opacity",0);var o=(i.item.bounds[1][0]-i.item.bounds[2][0])/2+i.item.bounds[2][0],r=(i.item.bounds[0][1]-i.item.bounds[1][1])/2+i.item.bounds[1][1];return i.attr("transform","translate("+[o,r]+")"),i}return gt(e,t),e.prototype.update=function(){return this.title=new It(this),this.addChild(this.title),this.updateChilds(),this.title.node.text(this.parent.item.title),this},e=mt([xt({tag:"g",class:"info",autoGenerate:!1}),_t("design:paramtypes",[Xt,Ot])],e)}(Et),Gt=Kt,Dt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i}return gt(e,t),e.prototype.show=function(){this.node.classed("bound-hide",!1)},e.prototype.hide=function(){this.node.classed("bound-hide",!0)},e.prototype.update=function(){return this.updateChilds(),this.node.datum(this.item.bounds).attr("d",(function(t){return"M"+t.join("L")+"Z"})),this},e=mt([xt({tag:"path",class:"bound",autoGenerate:!1}),_t("design:paramtypes",[Object,Ot])],e)}(Et),Pt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i}return gt(e,t),e.prototype.update=function(){return this.bound1=new Dt(this,this.item),this.bound1.attr("fill",this.parent.item.border_color),this.bound1.attr("stroke-width",70),this.bound1.attr("stroke",this.parent.item.border_color),this.bound1.classed("block-hull-border"),this.bound2=new Dt(this,this.item),this.bound2.attr("fill",this.item.color),this.bound2.attr("stroke-width",60),this.bound2.attr("stroke",this.item.color),this.bound2.classed("block-hull"),this.addChild(this.bound1),this.addChild(this.bound2),this.updateChilds(),this},e=mt([xt({tag:"g",class:"bounds",autoGenerate:!1}),_t("design:paramtypes",[Xt,Ot])],e)}(Et),Rt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i.global.eventManager.addEventListener(kt.BOUND_CLICK,(function(t){if(!i.global.multi_select){var n=t.parent.parent.item;t.hasTag("block-level")?e.global.zoomManager.zoomToBlock(n.id):t.hasTag("seat-level")&&e.global.zoomManager.zoomToSelection()}})),i}return gt(e,t),e.prototype.update=function(){return this.seatLevelMask=new Dt(this,this.item),this.seatLevelMask.attr("fill",this.item.color),this.seatLevelMask.attr("stroke-width",59),this.seatLevelMask.attr("stroke",this.item.color),this.seatLevelMask.tags.push("seat-level"),this.seatLevelMask.classed("seat-level-mask"),this.blockLevelMask=new Dt(this,this.item),this.blockLevelMask.attr("fill",this.item.color),this.blockLevelMask.attr("stroke-width",59),this.blockLevelMask.attr("stroke",this.item.color),this.blockLevelMask.tags.push("block-level"),this.blockLevelMask.classed("block-level-mask"),this.addChild(this.seatLevelMask),this.addChild(this.blockLevelMask),this.updateChilds(),this},e=mt([xt({tag:"g",class:"masks",autoGenerate:!1}),_t("design:paramtypes",[Xt,Ot])],e)}(Et),jt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("r",n.global.config.style.label.radius),n.attr("fill",n.global.config.style.label.bg),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([xt({tag:"circle",class:"label-circle",autoGenerate:!1}),_t("design:paramtypes",[Ht])],e)}(Et),Zt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("fill",n.global.config.style.label.color),n.attr("font-size",n.global.config.style.label.font_size),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([xt({tag:"text",class:"label-text",autoGenerate:!1}),_t("design:paramtypes",[Ht])],e)}(Et),Ht=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i.coordinates=new At(n),i.attr("transform","translate("+i.coordinates.toArray()+")"),i}return gt(e,t),e.prototype.update=function(){return this.circle=new jt(this),this.addChild(this.circle),this.circle=new Zt(this),this.addChild(this.circle),this.updateChilds(),this.circle.node.text(this.item.title),this},e=mt([xt({tag:"g",class:"label",autoGenerate:!1}),_t("design:paramtypes",[Yt,Ct])],e)}(Et),Yt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i}return gt(e,t),e.prototype.update=function(){var t=this;return this.item.labels.map((function(e){t.addChild(new Ht(t,e))})),this.updateChilds(),this},e.prototype.getLabels=function(){return this.child_items},e=mt([xt({tag:"g",class:"labels",autoGenerate:!1}),_t("design:paramtypes",[Xt,Ot])],e)}(Et),qt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i.center_position={x:null,y:null},i.top_position={x:null,y:null},i.attr("id",n.id),i.attr("opacity",0),i.global.eventManager.addEventListener(kt.ZOOM_LEVEL_CHANGE,(function(t){t.level===Mt.VENUE?(i.mask.blockLevelMask.show(),i.mask.seatLevelMask.show(),i.seats.resetSeatsColors(!1),i.infosToCenter()):t.level===Mt.BLOCK?(i.mask.blockLevelMask.hide(),i.mask.seatLevelMask.show(),i.infosToTop()):t.level===Mt.SEAT&&(i.mask.blockLevelMask.hide(),i.mask.seatLevelMask.hide(),i.seats.resetSeatsColors(!1),i.infosToTop())})),i.global.eventManager.addEventListener(kt.MULTI_SELECT_ENABLE,(function(){i.seats.resetSeatsColors(!1)})),i.global.eventManager.addEventListener(kt.MULTI_SELECT_DISABLE,(function(){i.seats.resetSeatsColors(!1)})),i.global.eventManager.addEventListener(kt.MOUSEMOVE_BLOCK,(function(t){if(i.parent.parent.searchCircle.is_enable&&!i.global.multi_select){var e=ft(i.parent.parent.blocks.node.node()),n=i.global.config.zoom_focus_circle_radius;if(i.global.zoomManager.zoomLevel===Mt.BLOCK)for(var o=0;o<t.seats.getSeatsCount();o++){var r=t.seats.getSeatByIndex(o),s=r.item,a=r.getColor();r.isSelected()?a=r.getColor(Lt.SELECT):(s.x-n<e[0]&&s.x+n>e[0]&&s.y-n<e[1]&&s.y+n>e[1]&&(a=r.getColor(Lt.FOCUS)),r.setColor(a))}}})),i.global.eventManager.addEventListener(kt.MOUSELEAVE_BLOCK,(function(t){console.log(t),i.seats.resetSeatsColors()})),i.parent.node.on("mouseleave.seats",(function(){i.seats.resetSeatsColors(!1)})),i}return gt(e,t),e.prototype.update=function(){return this.bounds=new Pt(this,this.item),this.addChild(this.bounds),this.seats=new Vt(this,this.item),this.addChild(this.seats),this.labels=new Yt(this,this.item),this.addChild(this.labels),this.mask=new Rt(this,this.item),this.addChild(this.mask),this.info=new Gt(this,this.item),this.addChild(this.info),this.center_position.x=(this.item.bounds[1][0]-this.item.bounds[2][0])/2+this.item.bounds[2][0],this.center_position.y=(this.item.bounds[0][1]-this.item.bounds[1][1])/2+this.item.bounds[1][1],this.top_position.x=this.center_position.x,this.top_position.y=this.item.bounds[1][1]-60,this.updateChilds(),this.infosToCenter(),this.node.interrupt().transition().duration(this.global.config.animation_speed).attr("opacity",1),this.node.attr("transform-origin","".concat(this.center_position.x," ").concat(this.center_position.y)),this.item.rotate&&this.node.attr("transform","rotate("+this.item.rotate+")"),this},e.prototype.infosToTop=function(){this.info.node&&this.top_position.x&&(this.info.node.interrupt().transition().duration(this.global.config.animation_speed).attr("transform","translate("+this.top_position.x+","+this.top_position.y+")").attr("opacity",.8).attr("font-size",14),this.info.title.node.transition().duration(this.global.config.animation_speed).attr("fill",this.item.color))},e.prototype.infosToCenter=function(){this.info.node&&this.center_position.x&&(this.info.node.interrupt().transition().duration(this.global.config.animation_speed).attr("transform","translate("+this.center_position.x+","+this.center_position.y+")").attr("opacity",1).attr("font-size",32),this.info.title.node.transition().duration(this.global.config.animation_speed).attr("fill",this.global.config.style.block.title_color))},e=mt([xt({tag:"g",class:"block",autoGenerate:!1}),_t("design:paramtypes",[Ft,Ot])],e)}(Et),Xt=qt,Wt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n}return gt(e,t),e.prototype.update=function(){var t=this;return this.clear(),this.global.data.getBlocks().map((function(e){var n=new Xt(t,e),i=e.seats;i&&i.length&&(i[0].y+=1e-4,i[0].x+=1e-4);var o=i.map((function(t){return[t.x,t.y]})).concat(e.labels.map((function(t){return[t.x,t.y]})));e.bounds=function(t){if((n=t.length)<3)return null;var e,n,i=new Array(n),o=new Array(n);for(e=0;e<n;++e)i[e]=[+t[e][0],+t[e][1],e];for(i.sort(bt),e=0;e<n;++e)o[e]=[i[e][0],-i[e][1]];var r=wt(i),s=wt(o),a=s[0]===r[0],l=s[s.length-1]===r[r.length-1],u=[];for(e=r.length-1;e>=0;--e)u.push(t[i[r[e]][2]]);for(e=+a;e<s.length-l;++e)u.push(t[i[s[e]][2]]);return u}(o),t.addChild(n)})),this.updateChilds(),this.seats=this.node.selectAll(".seat"),this},e.prototype.getBlock=function(t){var e=this.getBlocks().find((function(e){return e.item.id==t}));return e||null},e.prototype.getBlocks=function(){return this.getChilds(Xt.name)},e.prototype.center=function(){},e=mt([xt({tag:"g",class:"blocks",autoGenerate:!1}),_t("design:paramtypes",[Qt])],e)}(Et),Ft=Wt,$t=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("r",n.parent.global.config.zoom_focus_circle_radius),n}return gt(e,t),e.prototype.update=function(){return this.updateChilds(),this},e=mt([xt({tag:"circle",class:"circle",autoGenerate:!1}),_t("design:paramtypes",[Jt])],e)}(Et),Jt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.is_enable=!0,n.global.eventManager.addEventListener(kt.MOUSE_MOVE,(function(t){n.global.zoomManager.zoomLevel===Mt.BLOCK&&n.is_enable&&n.node.attr("transform","translate("+t+")")})),n.global.eventManager.addEventListener(kt.ZOOM_LEVEL_CHANGE,(function(t){t.level!==Mt.VENUE&&t.level!==Mt.SEAT||n.node.classed("show",!1)})),n.global.eventManager.addEventListener(kt.MULTI_SELECT_ENABLE,(function(){n.disable()})),n.global.eventManager.addEventListener(kt.MULTI_SELECT_DISABLE,(function(){n.enable()})),n}return gt(e,t),e.prototype.update=function(){var t=this;return this.clear(),this.circle=new $t(this),this.addChild(this.circle),this.updateChilds(),this.parent.blocks.node.on("mouseleave.search",(function(){t.node.classed("show",!1)})),this.parent.blocks.node.on("mousemove.search",(function(){t.global.zoomManager.zoomLevel===Mt.VENUE?t.node.classed("show",!1):t.global.zoomManager.zoomLevel===Mt.BLOCK?t.node.classed("show",!0):t.global.zoomManager.zoomLevel===Mt.SEAT&&t.node.classed("show",!1)})),this},e.prototype.enable=function(){return this.is_enable=!0,this.node.style("display","block"),this},e.prototype.disable=function(){return this.is_enable=!1,this.node.style("display","none"),this},e=mt([xt({tag:"g",class:"search-circle",autoGenerate:!1}),_t("design:paramtypes",[Qt])],e)}(Et),Qt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n}return gt(e,t),e.prototype.update=function(){this.blocks=new Ft(this),this.addChild(this.blocks),this.searchCircle=new Jt(this),this.addChild(this.searchCircle),this.updateChilds()},e=mt([xt({tag:"g",class:"stage",autoGenerate:!1}),_t("design:paramtypes",[xe])],e)}(Et),te=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.global.eventManager.addEventListener(kt.RESIZE_WINDOW,(function(t){n.node.attr("width",t.width).attr("height",t.height).on("click.zoomout",(function(){n.global.eventManager.dispatch(kt.CLICK_ZOOM_OUT,n)}))})),n}return gt(e,t),e.prototype.update=function(){},e=mt([xt({tag:"rect",class:"zoom-out-bg",autoGenerate:!1}),_t("design:paramtypes",[xe])],e)}(Et),ee=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("r",n.global.config.style.legend.radius),n.attr("fill",n.parent.legend_data.color),n}return gt(e,t),e.prototype.update=function(){},e=mt([xt({tag:"circle",class:"legend-circle",autoGenerate:!1}),_t("design:paramtypes",[re])],e)}(Et),ne=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("x",1.5*n.global.config.style.legend.radius),n.attr("fill",n.global.config.style.legend.font_color),n.attr("font-size",n.global.config.style.legend.font_size),n}return gt(e,t),e.prototype.update=function(){},e=mt([xt({tag:"text",class:"legend-title dark:fill-white",autoGenerate:!1}),_t("design:paramtypes",[re])],e)}(Et),ie=function(t){function e(e){var n=t.call(this)||this;return n.x=e.x,n.y=e.y,n.title=e.title,n.color=e.color,n}return gt(e,t),e}(Tt),oe=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.legend_data=n,i}return gt(e,t),e.prototype.update=function(){if(this.circle=new ee(this),this.addChild(this.circle),this.title=new ne(this),this.addChild(this.title),this.updateChilds(),this.title.node.text(this.legend_data.title),this.child_index){var t=this.child_index*this.global.config.style.legend.padding;this.node.attr("transform","translate("+[0,t]+")")}},e=mt([xt({tag:"g",class:"legend-item",autoGenerate:!1}),_t("design:paramtypes",[ae,ie])],e)}(Et),re=oe,se=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n}return gt(e,t),e.prototype.update=function(){var t=[];t.push({title:this.global.config.lang.non_selectable,color:this.global.config.style.seat.not_salable}),t.push({title:this.global.config.lang.selectable,color:this.global.config.style.seat.color}),t.push({title:this.global.config.lang.your_selection,color:this.global.config.style.seat.selected});for(var e=0;e<t.length;e++){var n=new re(this,t[e]);this.addChild(n)}this.updateChilds()},e.prototype.afterGenerate=function(){var t=2*this.global.config.style.legend.radius,e=150-this.global.config.style.legend.padding*this.getChildCount();this.node.attr("transform","translate("+[t,e]+")")},e=mt([xt({tag:"g",class:"legend",autoGenerate:!1}),_t("design:paramtypes",[xe])],e)}(Et),ae=se,le=Math.PI,ue=2*le,he=1e-6,ce=ue-he;function fe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function de(){return new fe}function pe(t){return function(){return t}}function ge(t){this._context=t}function me(t){return new ge(t)}function _e(t){return t[0]}function ve(t){return t[1]}fe.prototype=de.prototype={constructor:fe,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,o,r){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+o)+","+(this._y1=+r)},arcTo:function(t,e,n,i,o){t=+t,e=+e,n=+n,i=+i,o=+o;var r=this._x1,s=this._y1,a=n-t,l=i-e,u=r-t,h=s-e,c=u*u+h*h;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(c>he)if(Math.abs(h*a-l*u)>he&&o){var f=n-r,d=i-s,p=a*a+l*l,g=f*f+d*d,m=Math.sqrt(p),_=Math.sqrt(c),v=o*Math.tan((le-Math.acos((p+c-g)/(2*m*_)))/2),y=v/_,b=v/m;Math.abs(y-1)>he&&(this._+="L"+(t+y*u)+","+(e+y*h)),this._+="A"+o+","+o+",0,0,"+ +(h*f>u*d)+","+(this._x1=t+b*a)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,o,r){t=+t,e=+e,r=!!r;var s=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+s,u=e+a,h=1^r,c=r?i-o:o-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>he||Math.abs(this._y1-u)>he)&&(this._+="L"+l+","+u),n&&(c<0&&(c=c%ue+ue),c>ce?this._+="A"+n+","+n+",0,1,"+h+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):c>he&&(this._+="A"+n+","+n+",0,"+ +(c>=le)+","+h+","+(this._x1=t+n*Math.cos(o))+","+(this._y1=e+n*Math.sin(o))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}},ge.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var ye=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("width",n.global.config.style.tooltip.width),n.attr("height",n.global.config.style.tooltip.height),n.attr("x",0),n.attr("y",0),n.attr("rx",3),n.attr("ry",3),function(){var t=_e,e=ve,n=pe(!0),i=null,o=me,r=null;function s(s){var a,l,u,h=s.length,c=!1;for(null==i&&(r=o(u=de())),a=0;a<=h;++a)!(a<h&&n(l=s[a],a,s))===c&&((c=!c)?r.lineStart():r.lineEnd()),c&&r.point(+t(l,a,s),+e(l,a,s));if(u)return r=null,u+""||null}return s.x=function(e){return arguments.length?(t="function"==typeof e?e:pe(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:pe(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:pe(!!t),s):n},s.curve=function(t){return arguments.length?(o=t,null!=i&&(r=o(i)),s):o},s.context=function(t){return arguments.length?(null==t?i=r=null:r=o(i=t),s):i},s}().x((function(t){return t.x})).y((function(t){return t.y})),n.attr("fill",n.global.config.style.tooltip.bg),n.attr("stroke","rgba(0,0,0,0.3)"),n.attr("stroke-width","1px"),n.attr("opacity",.8),n}return gt(e,t),e.prototype.update=function(){return this.updateChilds(),this},e.prototype.afterGenerate=function(){this.node.style("pointer-events","none")},e=mt([xt({tag:"rect",class:"tooltip-rect",autoGenerate:!1}),_t("design:paramtypes",[Ee])],e)}(Et),be=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("x",6),n.attr("y",21),n.attr("fill",n.global.config.style.tooltip.color),n}return gt(e,t),e.prototype.update=function(){return this.updateChilds(),this},e.prototype.afterGenerate=function(){this.node.style("pointer-events","none"),this.node.style("font-size","12px")},e.prototype.generateTitle=function(){this.node.selectAll("tspan").remove().data(this.title).enter().append("tspan").text((function(t){return t})).attr("x",6).attr("y",(function(t,e){return 16*e+16}))},e=mt([xt({tag:"text",class:"tooltip-title",autoGenerate:!1}),_t("design:paramtypes",[Ee])],e)}(Et),we=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("transform","translate(0,0)"),n.attr("opacity",0),n.activeSeat=null,n.global.eventManager.addEventListener([kt.MOUSEMOVE_SEAT],(function(t){n.global.multi_select||n.activeSeat!==t&&t.item.title&&(n.activeSeat=t,n.setTitle(t.item.title.split("\n")),n.title.generateTitle())})),n.global.eventManager.addEventListener([kt.MOUSEOUT_SEAT],(function(t){n.node.attr("opacity",0),n.activeSeat=null,n.title.title=[],n.title.generateTitle()})),n.global.eventManager.addEventListener([kt.TOUCHSTART_BLOCK],(function(t){n.node.attr("opacity",0)})),n}return gt(e,t),e.prototype.setTitle=function(t){return this.title.title=t,this},e.prototype.update=function(){return this.rect=new ye(this).addTo(this),this.title=new be(this).addTo(this),this.updateChilds(),this},e.prototype.afterGenerate=function(){var t=this;this.parent.node.on("mousemove.seat",(function(){if(!t.global.multi_select)if(t.global.zoomManager.zoomLevel===Mt.SEAT&&null!==t.activeSeat){var e=ft(this),n=e[0]-t.global.config.style.tooltip.width/2,i=e[1]-(t.global.config.style.tooltip.height+t.global.config.style.seat.radius+2);t.node.attr("transform","translate("+[n,i]+")").attr("opacity",1)}else t.node.attr("opacity",0)}))},e=mt([xt({tag:"g",class:"seatmap-tooltip",autoGenerate:!1}),_t("design:paramtypes",[xe])],e)}(Et),Ee=we,xe=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.global.eventManager.addEventListener(kt.ZOOM_LEVEL_CHANGE,(function(t){n.node.classed("zoom-level-"+Mt.SEAT,!1),n.node.classed("zoom-level-"+Mt.BLOCK,!1),n.node.classed("zoom-level-"+Mt.VENUE,!1),n.node.classed("zoom-level-"+t.level,!0)})),n}return gt(e,t),e.prototype.update=function(){var t=this;this.stage=new Qt(this).addToParent(),this.zoomOutBg=new te(this).addToParent(),this.global.config.legend&&(this.legend=new ae(this).addToParent()),this.tooltip=new Ee(this).addToParent(),this.updateChilds(),this.stage.node.raise(),this.global.config.legend&&this.legend.node.raise(),this.tooltip.node.raise(),this.node.on("mousemove",(function(){var e=ft(t.stage.node.node());t.parent.eventManager.dispatch(kt.MOUSE_MOVE,e)}))},e=mt([xt({tag:"svg",class:"seatmap-svg",autoGenerate:!1}),_t("design:paramtypes",[ao])],e)}(Et),ke=function(){function t(t){this.context=t}return t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.log(t),this},t}(),Me=function(){function t(t){this._self=t,this.blocks=[],this.eventManager=t.eventManager,this.addEventListener=t.eventManager.addEventListener}return t.prototype.addBlock=function(t){return this.blocks.push(new Ot(t)),this.eventManager.dispatch(kt.ADD_BLOCK,[t]),this.eventManager.dispatch(kt.UPDATE_BLOCK,this.blocks),this},t.prototype.addBulkBlock=function(t){var e=this;return t.map((function(t){e.blocks.push(new Ot(t))})),this.eventManager.dispatch(kt.ADD_BLOCK,[t]),this.eventManager.dispatch(kt.UPDATE_BLOCK,this.blocks),this},t.prototype.replaceData=function(t){return this.blocks=[],this.addBulkBlock(t),this},t.prototype.getBlock=function(t){var e=this.blocks.find((function(e){return e.id===t}));return e||null},t.prototype.getBlocks=function(t){if(t){var e=this.getBlock(t);return e?[e]:[]}return this.blocks},t.prototype.removeBlock=function(t){var e=this;return this.filterBlock({id:t}).map((function(t,n){e.blocks.splice(n,1)})),this.eventManager.dispatch(kt.REMOVE_BLOCK,t),this.eventManager.dispatch(kt.UPDATE_BLOCK,this.blocks),this},t.prototype.getSeat=function(t,e){var n=this.getBlock(e);if(n){var i=n.seats.find((function(e){return e.id==t}));return i||null}return console.error(new Error("Block not found!")),null},t.prototype.getSelectedSeats=function(t){var e=this.getBlocks(t),n=[];return e.forEach((function(t){t.seats.forEach((function(t){t.selected&&n.push(t)}))})),n},t.prototype.filterBlock=function(t){return this.blocks.filter((function(e){return e.id===t.id}))},t.prototype.toJson=function(){return{blocks:this.blocks}},t}(),Le=function(){this.radius=12,this.color="#77b2ff",this.not_salable="#6293d2",this.selected="#4770ff",this.hover="#4770ff",this.focus="#6293d2",this.focus_out="#ff001c",this.check_color="#ffffff",this.check_icon="",this.check_icon_color="#ffffff"},Te=function(){this.fill="#ffffff",this.stroke="#ffffff",this.border_width=4,this.title_color="#000000",this.title_font_size=28},ze=function(){this.radius=12,this.padding=36,this.font_size=12,this.font_color="#000"},Ce=function(){this.color="#000000",this.bg="#fff",this.font_size=12,this.radius=12},Oe=function(){this.border_width=1,this.width=140,this.height=58,this.color="#000000",this.bg="#ffffff"},Se=function(){},Ae=function(){function t(t){this.min_zoom=.1,this.max_zoom=1.9,this.animation_speed=600,this.resizable=!1,this.container=null,this.zoom_focus_circle_radius=60,this.click_enable_sold_seats=!1,this.legend=!1,this.canvas_stageout_control=!0,this.zoom_focus_circle_radius=t.zoom_focus_circle_radius?t.zoom_focus_circle_radius:this.zoom_focus_circle_radius,this.click_enable_sold_seats=t.click_enable_sold_seats?t.click_enable_sold_seats:this.click_enable_sold_seats,this.max_zoom=t.max_zoom?t.max_zoom:this.max_zoom,this.resizable=t.resizable?t.resizable:this.resizable,this.zoom_out_button=t.zoom_out_button?t.zoom_out_button:".zoom-out-button",this.legend=0!=t.legend||t.legend,this.canvas_stageout_control=0!=t.canvas_stageout_control||t.canvas_stageout_control,this.style=new Se,this.style.seat=Object.assign(new Le,t.style.seat),this.style.block=Object.assign(new Te,t.style.block),this.style.legend=Object.assign(new ze,t.style.legend),this.style.label=Object.assign(new Ce,t.style.label),this.style.tooltip=Object.assign(new Oe,t.style.tooltip),t.style,this.lang={selectable:t.lang&&t.lang.selectable||"Selectable",non_selectable:t.lang&&t.lang.non_selectable||"Non Selectable or Rezerved",your_selection:t.lang&&t.lang.your_selection||"Your Selection"}}return t.prototype.getAll=function(){return this},t}(),Be={value:function(){}};function Ne(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new Ue(i)}function Ue(t){this._=t}function Ve(t,e){for(var n,i=0,o=t.length;i<o;++i)if((n=t[i]).name===e)return n.value}function Ie(t,e,n){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=Be,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}function Ke(){J.preventDefault(),J.stopImmediatePropagation()}function Ge(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function De(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Pe(){}Ue.prototype=Ne.prototype={constructor:Ue,on:function(t,e){var n,i,o=this._,r=(i=o,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),s=-1,a=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s<a;)if(n=(t=r[s]).type)o[n]=Ie(o[n],t.name,e);else if(null==e)for(n in o)o[n]=Ie(o[n],t.name,null);return this}for(;++s<a;)if((n=(t=r[s]).type)&&(n=Ve(o[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ue(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,o=new Array(n),r=0;r<n;++r)o[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=0,n=(i=this._[t]).length;r<n;++r)i[r].value.apply(e,o)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],o=0,r=i.length;o<r;++o)i[o].value.apply(e,n)}};var Re=.7,je=1/Re,Ze="\\s*([+-]?\\d+)\\s*",He="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ye="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qe=/^#([0-9a-f]{3,8})$/,Xe=new RegExp("^rgb\\("+[Ze,Ze,Ze]+"\\)$"),We=new RegExp("^rgb\\("+[Ye,Ye,Ye]+"\\)$"),Fe=new RegExp("^rgba\\("+[Ze,Ze,Ze,He]+"\\)$"),$e=new RegExp("^rgba\\("+[Ye,Ye,Ye,He]+"\\)$"),Je=new RegExp("^hsl\\("+[He,Ye,Ye]+"\\)$"),Qe=new RegExp("^hsla\\("+[He,Ye,Ye,He]+"\\)$"),tn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function en(){return this.rgb().formatHex()}function nn(){return this.rgb().formatRgb()}function on(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=qe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?rn(e):3===n?new ln(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?sn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?sn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Xe.exec(t))?new ln(e[1],e[2],e[3],1):(e=We.exec(t))?new ln(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Fe.exec(t))?sn(e[1],e[2],e[3],e[4]):(e=$e.exec(t))?sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Je.exec(t))?fn(e[1],e[2]/100,e[3]/100,1):(e=Qe.exec(t))?fn(e[1],e[2]/100,e[3]/100,e[4]):tn.hasOwnProperty(t)?rn(tn[t]):"transparent"===t?new ln(NaN,NaN,NaN,0):null}function rn(t){return new ln(t>>16&255,t>>8&255,255&t,1)}function sn(t,e,n,i){return i<=0&&(t=e=n=NaN),new ln(t,e,n,i)}function an(t,e,n,i){return 1===arguments.length?((o=t)instanceof Pe||(o=on(o)),o?new ln((o=o.rgb()).r,o.g,o.b,o.opacity):new ln):new ln(t,e,n,null==i?1:i);var o}function ln(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function un(){return"#"+cn(this.r)+cn(this.g)+cn(this.b)}function hn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function cn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function fn(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new pn(t,e,n,i)}function dn(t){if(t instanceof pn)return new pn(t.h,t.s,t.l,t.opacity);if(t instanceof Pe||(t=on(t)),!t)return new pn;if(t instanceof pn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,o=Math.min(e,n,i),r=Math.max(e,n,i),s=NaN,a=r-o,l=(r+o)/2;return a?(s=e===r?(n-i)/a+6*(n<i):n===r?(i-e)/a+2:(e-n)/a+4,a/=l<.5?r+o:2-r-o,s*=60):a=l>0&&l<1?0:s,new pn(s,a,l,t.opacity)}function pn(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function gn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function mn(t){return function(){return t}}function _n(t){return 1==(t=+t)?vn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):mn(isNaN(e)?n:e)}}function vn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):mn(isNaN(t)?e:t)}Ge(Pe,on,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:en,formatHex:en,formatHsl:function(){return dn(this).formatHsl()},formatRgb:nn,toString:nn}),Ge(ln,an,De(Pe,{brighter:function(t){return t=null==t?je:Math.pow(je,t),new ln(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Re:Math.pow(Re,t),new ln(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:un,formatHex:un,formatRgb:hn,toString:hn})),Ge(pn,(function(t,e,n,i){return 1===arguments.length?dn(t):new pn(t,e,n,null==i?1:i)}),De(Pe,{brighter:function(t){return t=null==t?je:Math.pow(je,t),new pn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Re:Math.pow(Re,t),new pn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,o=2*n-i;return new ln(gn(t>=240?t-240:t+120,o,i),gn(t,o,i),gn(t<120?t+240:t-120,o,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var yn=function t(e){var n=_n(e);function i(t,e){var i=n((t=an(t)).r,(e=an(e)).r),o=n(t.g,e.g),r=n(t.b,e.b),s=vn(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=o(e),t.b=r(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function bn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var wn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,En=new RegExp(wn.source,"g");function xn(t,e){var n,i,o,r=wn.lastIndex=En.lastIndex=0,s=-1,a=[],l=[];for(t+="",e+="";(n=wn.exec(t))&&(i=En.exec(e));)(o=i.index)>r&&(o=e.slice(r,o),a[s]?a[s]+=o:a[++s]=o),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:bn(n,i)})),r=En.lastIndex;return r<e.length&&(o=e.slice(r),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)a[(n=l[i]).i]=n.x(t);return a.join("")})}var kn,Mn,Ln,Tn,zn=180/Math.PI,Cn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function On(t,e,n,i,o,r){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:o,translateY:r,rotate:Math.atan2(e,t)*zn,skewX:Math.atan(l)*zn,scaleX:s,scaleY:a}}function Sn(t,e,n,i){function o(t){return t.length?t.pop()+" ":""}return function(r,s){var a=[],l=[];return r=t(r),s=t(s),function(t,i,o,r,s,a){if(t!==o||i!==r){var l=s.push("translate(",null,e,null,n);a.push({i:l-4,x:bn(t,o)},{i:l-2,x:bn(i,r)})}else(o||r)&&s.push("translate("+o+e+r+n)}(r.translateX,r.translateY,s.translateX,s.translateY,a,l),function(t,e,n,r){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),r.push({i:n.push(o(n)+"rotate(",null,i)-2,x:bn(t,e)})):e&&n.push(o(n)+"rotate("+e+i)}(r.rotate,s.rotate,a,l),function(t,e,n,r){t!==e?r.push({i:n.push(o(n)+"skewX(",null,i)-2,x:bn(t,e)}):e&&n.push(o(n)+"skewX("+e+i)}(r.skewX,s.skewX,a,l),function(t,e,n,i,r,s){if(t!==n||e!==i){var a=r.push(o(r)+"scale(",null,",",null,")");s.push({i:a-4,x:bn(t,n)},{i:a-2,x:bn(e,i)})}else 1===n&&1===i||r.push(o(r)+"scale("+n+","+i+")")}(r.scaleX,r.scaleY,s.scaleX,s.scaleY,a,l),r=s=null,function(t){for(var e,n=-1,i=l.length;++n<i;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var An=Sn((function(t){return"none"===t?Cn:(kn||(kn=document.createElement("DIV"),Mn=document.documentElement,Ln=document.defaultView),kn.style.transform=t,t=Ln.getComputedStyle(Mn.appendChild(kn),null).getPropertyValue("transform"),Mn.removeChild(kn),On(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),Bn=Sn((function(t){return null==t?Cn:(Tn||(Tn=document.createElementNS("http://www.w3.org/2000/svg","g")),Tn.setAttribute("transform",t),(t=Tn.transform.baseVal.consolidate())?On((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Cn)}),", ",")",")"),Nn=Math.SQRT2,Un=2,Vn=4,In=1e-12;function Kn(t){return((t=Math.exp(t))+1/t)/2}function Gn(t,e){var n,i,o=t[0],r=t[1],s=t[2],a=e[0],l=e[1],u=e[2],h=a-o,c=l-r,f=h*h+c*c;if(f<In)i=Math.log(u/s)/Nn,n=function(t){return[o+t*h,r+t*c,s*Math.exp(Nn*t*i)]};else{var d=Math.sqrt(f),p=(u*u-s*s+Vn*f)/(2*s*Un*d),g=(u*u-s*s-Vn*f)/(2*u*Un*d),m=Math.log(Math.sqrt(p*p+1)-p),_=Math.log(Math.sqrt(g*g+1)-g);i=(_-m)/Nn,n=function(t){var e=t*i,n=Kn(m),a=s/(Un*d)*(n*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(Nn*e+m)-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[o+a*h,r+a*c,s*n/Kn(Nn*e+m)]}}return n.duration=1e3*i,n}var Dn,Pn,Rn=0,jn=0,Zn=0,Hn=1e3,Yn=0,qn=0,Xn=0,Wn="object"==typeof performance&&performance.now?performance:Date,Fn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function $n(){return qn||(Fn(Jn),qn=Wn.now()+Xn)}function Jn(){qn=0}function Qn(){this._call=this._time=this._next=null}function ti(t,e,n){var i=new Qn;return i.restart(t,e,n),i}function ei(){qn=(Yn=Wn.now())+Xn,Rn=jn=0;try{!function(){$n(),++Rn;for(var t,e=Dn;e;)(t=qn-e._time)>=0&&e._call.call(null,t),e=e._next;--Rn}()}finally{Rn=0,function(){var t,e,n=Dn,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Dn=e);Pn=t,ii(i)}(),qn=0}}function ni(){var t=Wn.now(),e=t-Yn;e>Hn&&(Xn-=e,Yn=t)}function ii(t){Rn||(jn&&(jn=clearTimeout(jn)),t-qn>24?(t<1/0&&(jn=setTimeout(ei,t-Wn.now()-Xn)),Zn&&(Zn=clearInterval(Zn))):(Zn||(Yn=Wn.now(),Zn=setInterval(ni,Hn)),Rn=1,Fn(ei)))}function oi(t,e,n){var i=new Qn;return e=null==e?0:+e,i.restart((function(n){i.stop(),t(n+e)}),e,n),i}Qn.prototype=ti.prototype={constructor:Qn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?$n():+n)+(null==e?0:+e),this._next||Pn===this||(Pn?Pn._next=this:Dn=this,Pn=this),this._call=t,this._time=n,ii()},stop:function(){this._call&&(this._call=null,this._time=1/0,ii())}};var ri=Ne("start","end","cancel","interrupt"),si=[],ai=0,li=1,ui=2,hi=3,ci=4,fi=5,di=6;function pi(t,e,n,i,o,r){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var i,o=t.__transition;function r(t){n.state=li,n.timer.restart(s,n.delay,n.time),n.delay<=t&&s(t-n.delay)}function s(r){var u,h,c,f;if(n.state!==li)return l();for(u in o)if((f=o[u]).name===n.name){if(f.state===hi)return oi(s);f.state===ci?(f.state=di,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete o[u]):+u<e&&(f.state=di,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete o[u])}if(oi((function(){n.state===hi&&(n.state=ci,n.timer.restart(a,n.delay,n.time),a(r))})),n.state=ui,n.on.call("start",t,t.__data__,n.index,n.group),n.state===ui){for(n.state=hi,i=new Array(c=n.tween.length),u=0,h=-1;u<c;++u)(f=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=f);i.length=h+1}}function a(e){for(var o=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(l),n.state=fi,1),r=-1,s=i.length;++r<s;)i[r].call(t,o);n.state===fi&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){for(var i in n.state=di,n.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=n,n.timer=ti(r,0,n.time)}(t,n,{name:e,index:i,group:o,on:ri,tween:si,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:ai})}function gi(t,e){var n=_i(t,e);if(n.state>ai)throw new Error("too late; already scheduled");return n}function mi(t,e){var n=_i(t,e);if(n.state>hi)throw new Error("too late; already running");return n}function _i(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function vi(t,e){var n,i,o,r=t.__transition,s=!0;if(r){for(o in e=null==e?null:e+"",r)(n=r[o]).name===e?(i=n.state>ui&&n.state<fi,n.state=di,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[o]):s=!1;s&&delete t.__transition}}function yi(t,e){var n,i;return function(){var o=mi(this,t),r=o.tween;if(r!==n)for(var s=0,a=(i=n=r).length;s<a;++s)if(i[s].name===e){(i=i.slice()).splice(s,1);break}o.tween=i}}function bi(t,e,n){var i,o;if("function"!=typeof n)throw new Error;return function(){var r=mi(this,t),s=r.tween;if(s!==i){o=(i=s).slice();for(var a={name:e,value:n},l=0,u=o.length;l<u;++l)if(o[l].name===e){o[l]=a;break}l===u&&o.push(a)}r.tween=o}}function wi(t,e,n){var i=t._id;return t.each((function(){var t=mi(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return _i(t,i).value[e]}}function Ei(t,e){var n;return("number"==typeof e?bn:e instanceof on?yn:(n=on(e))?(e=n,yn):xn)(t,e)}function xi(t){return function(){this.removeAttribute(t)}}function ki(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Mi(t,e,n){var i,o,r=n+"";return function(){var s=this.getAttribute(t);return s===r?null:s===i?o:o=e(i=s,n)}}function Li(t,e,n){var i,o,r=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===r?null:s===i?o:o=e(i=s,n)}}function Ti(t,e,n){var i,o,r;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttribute(t))===(a=l+"")?null:s===i&&a===o?r:(o=a,r=e(i=s,l));this.removeAttribute(t)}}function zi(t,e,n){var i,o,r;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:s===i&&a===o?r:(o=a,r=e(i=s,l));this.removeAttributeNS(t.space,t.local)}}function Ci(t,e){var n,i;function o(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,o)),n}return o._value=e,o}function Oi(t,e){var n,i;function o(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,o)),n}return o._value=e,o}function Si(t,e){return function(){gi(this,t).delay=+e.apply(this,arguments)}}function Ai(t,e){return e=+e,function(){gi(this,t).delay=e}}function Bi(t,e){return function(){mi(this,t).duration=+e.apply(this,arguments)}}function Ni(t,e){return e=+e,function(){mi(this,t).duration=e}}var Ui=lt.prototype.constructor;function Vi(t){return function(){this.style.removeProperty(t)}}var Ii=0;function Ki(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Gi(){return++Ii}var Di=lt.prototype;Ki.prototype={constructor:Ki,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=a(t));for(var i=this._groups,o=i.length,r=new Array(o),s=0;s<o;++s)for(var l,u,h=i[s],c=h.length,f=r[s]=new Array(c),d=0;d<c;++d)(l=h[d])&&(u=t.call(l,l.__data__,d,h))&&("__data__"in l&&(u.__data__=l.__data__),f[d]=u,pi(f[d],e,n,d,f,_i(l,n)));return new Ki(r,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=u(t));for(var i=this._groups,o=i.length,r=[],s=[],a=0;a<o;++a)for(var l,h=i[a],c=h.length,f=0;f<c;++f)if(l=h[f]){for(var d,p=t.call(l,l.__data__,f,h),g=_i(l,n),m=0,_=p.length;m<_;++m)(d=p[m])&&pi(d,e,n,m,p,g);r.push(p),s.push(l)}return new Ki(r,s,e,n)},filter:function(t){"function"!=typeof t&&(t=h(t));for(var e=this._groups,n=e.length,i=new Array(n),o=0;o<n;++o)for(var r,s=e[o],a=s.length,l=i[o]=[],u=0;u<a;++u)(r=s[u])&&t.call(r,r.__data__,u,s)&&l.push(r);return new Ki(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,o=n.length,r=Math.min(i,o),s=new Array(i),a=0;a<r;++a)for(var l,u=e[a],h=n[a],c=u.length,f=s[a]=new Array(c),d=0;d<c;++d)(l=u[d]||h[d])&&(f[d]=l);for(;a<i;++a)s[a]=e[a];return new Ki(s,this._parents,this._name,this._id)},selection:function(){return new Ui(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Gi(),i=this._groups,o=i.length,r=0;r<o;++r)for(var s,a=i[r],l=a.length,u=0;u<l;++u)if(s=a[u]){var h=_i(s,e);pi(s,t,n,u,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Ki(i,this._parents,t,n)},call:Di.call,nodes:Di.nodes,node:Di.node,size:Di.size,empty:Di.empty,each:Di.each,on:function(t,e){var n=this._id;return arguments.length<2?_i(this.node(),n).on.on(t):this.each(function(t,e,n){var i,o,r=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?gi:mi;return function(){var s=r(this,t),a=s.on;a!==i&&(o=(i=a).copy()).on(e,n),s.on=o}}(n,t,e))},attr:function(t,e){var i=n(t),o="transform"===i?Bn:Ei;return this.attrTween(t,"function"==typeof e?(i.local?zi:Ti)(i,o,wi(this,"attr."+t,e)):null==e?(i.local?ki:xi)(i):(i.local?Li:Mi)(i,o,e))},attrTween:function(t,e){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;var o=n(t);return this.tween(i,(o.local?Ci:Oi)(o,e))},style:function(t,e,n){var i="transform"==(t+="")?An:Ei;return null==e?this.styleTween(t,function(t,e){var n,i,o;return function(){var r=T(this,t),s=(this.style.removeProperty(t),T(this,t));return r===s?null:r===n&&s===i?o:o=e(n=r,i=s)}}(t,i)).on("end.style."+t,Vi(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,o,r;return function(){var s=T(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=T(this,t)),s===l?null:s===i&&l===o?r:(o=l,r=e(i=s,a))}}(t,i,wi(this,"style."+t,e))).each(function(t,e){var n,i,o,r,s="style."+e,a="end."+s;return function(){var l=mi(this,t),u=l.on,h=null==l.value[s]?r||(r=Vi(e)):void 0;u===n&&o===h||(i=(n=u).copy()).on(a,o=h),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,o,r=n+"";return function(){var s=T(this,t);return s===r?null:s===i?o:o=e(i=s,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){var i,o;function r(){var r=e.apply(this,arguments);return r!==o&&(i=(o=r)&&function(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,r,n)),i}return r._value=e,r}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(wi(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,o=_i(this.node(),n).tween,r=0,s=o.length;r<s;++r)if((i=o[r]).name===t)return i.value;return null}return this.each((null==e?yi:bi)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Si:Ai)(e,t)):_i(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Bi:Ni)(e,t)):_i(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){mi(this,t).ease=e}}(e,t)):_i(this.node(),e).ease},end:function(){var t,e,n=this,i=n._id,o=n.size();return new Promise((function(r,s){var a={value:s},l={value:function(){0==--o&&r()}};n.each((function(){var n=mi(this,i),o=n.on;o!==t&&((e=(t=o).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),n.on=e}))}))}};var Pi={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Ri(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return Pi.time=$n(),Pi;return n}function ji(t){return function(){return t}}function Zi(t,e,n){this.target=t,this.type=e,this.transform=n}function Hi(t,e,n){this.k=t,this.x=e,this.y=n}lt.prototype.interrupt=function(t){return this.each((function(){vi(this,t)}))},lt.prototype.transition=function(t){var e,n;t instanceof Ki?(e=t._id,t=t._name):(e=Gi(),(n=Pi).time=$n(),t=null==t?null:t+"");for(var i=this._groups,o=i.length,r=0;r<o;++r)for(var s,a=i[r],l=a.length,u=0;u<l;++u)(s=a[u])&&pi(s,t,e,u,a,n||Ri(s,e));return new Ki(i,this._parents,t,e)},Hi.prototype={constructor:Hi,scale:function(t){return 1===t?this:new Hi(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Hi(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Yi=new Hi(1,0,0);function qi(){J.stopImmediatePropagation()}function Xi(){J.preventDefault(),J.stopImmediatePropagation()}function Wi(){return!J.ctrlKey&&!J.button}function Fi(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function $i(){return this.__zoom||Yi}function Ji(){return-J.deltaY*(1===J.deltaMode?.05:J.deltaMode?1:.002)}function Qi(){return navigator.maxTouchPoints||"ontouchstart"in this}function to(t,e,n){var i=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],r=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function eo(){var t,e,n=Wi,i=Fi,o=to,r=Ji,s=Qi,a=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,h=Gn,c=Ne("start","zoom","end"),f=500,d=150,p=0;function g(t){t.property("__zoom",$i).on("wheel.zoom",E).on("mousedown.zoom",x).on("dblclick.zoom",k).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",T).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(t,e){return(e=Math.max(a[0],Math.min(a[1],e)))===t.k?t:new Hi(e,t.x,t.y)}function _(t,e,n){var i=e[0]-n[0]*t.k,o=e[1]-n[1]*t.k;return i===t.x&&o===t.y?t:new Hi(t.k,i,o)}function v(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function y(t,e,n){t.on("start.zoom",(function(){b(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).end()})).tween("zoom",(function(){var t=this,o=arguments,r=b(t,o),s=i.apply(t,o),a=null==n?v(s):"function"==typeof n?n.apply(t,o):n,l=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=t.__zoom,c="function"==typeof e?e.apply(t,o):e,f=h(u.invert(a).concat(l/u.k),c.invert(a).concat(l/c.k));return function(t){if(1===t)t=c;else{var e=f(t),n=l/e[2];t=new Hi(n,a[0]-e[0]*n,a[1]-e[1]*n)}r.zoom(null,t)}}))}function b(t,e,n){return!n&&t.__zooming||new w(t,e)}function w(t,e){this.that=t,this.args=e,this.active=0,this.extent=i.apply(t,e),this.taps=0}function E(){if(n.apply(this,arguments)){var t=b(this,arguments),e=this.__zoom,i=Math.max(a[0],Math.min(a[1],e.k*Math.pow(2,r.apply(this,arguments)))),s=ft(this);if(t.wheel)t.mouse[0][0]===s[0]&&t.mouse[0][1]===s[1]||(t.mouse[1]=e.invert(t.mouse[0]=s)),clearTimeout(t.wheel);else{if(e.k===i)return;t.mouse=[s,e.invert(s)],vi(this),t.start()}Xi(),t.wheel=setTimeout((function(){t.wheel=null,t.end()}),d),t.zoom("mouse",o(_(m(e,i),t.mouse[0],t.mouse[1]),t.extent,l))}}function x(){if(!e&&n.apply(this,arguments)){var t=b(this,arguments,!0),i=ut(J.view).on("mousemove.zoom",(function(){if(Xi(),!t.moved){var e=J.clientX-s,n=J.clientY-a;t.moved=e*e+n*n>p}t.zoom("mouse",o(_(t.that.__zoom,t.mouse[0]=ft(t.that),t.mouse[1]),t.extent,l))}),!0).on("mouseup.zoom",(function(){i.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,i=ut(t).on("dragstart.drag",null);e&&(i.on("click.drag",Ke,!0),setTimeout((function(){i.on("click.drag",null)}),0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(J.view,t.moved),Xi(),t.end()}),!0),r=ft(this),s=J.clientX,a=J.clientY;!function(t){var e=t.document.documentElement,n=ut(t).on("dragstart.drag",Ke,!0);"onselectstart"in e?n.on("selectstart.drag",Ke,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(J.view),qi(),t.mouse=[r,this.__zoom.invert(r)],vi(this),t.start()}}function k(){if(n.apply(this,arguments)){var t=this.__zoom,e=ft(this),r=t.invert(e),s=t.k*(J.shiftKey?.5:2),a=o(_(m(t,s),e,r),i.apply(this,arguments),l);Xi(),u>0?ut(this).transition().duration(u).call(y,a,e):ut(this).call(g.transform,a)}}function M(){if(n.apply(this,arguments)){var e,i,o,r,s=J.touches,a=s.length,l=b(this,arguments,J.changedTouches.length===a);for(qi(),i=0;i<a;++i)r=[r=dt(this,s,(o=s[i]).identifier),this.__zoom.invert(r),o.identifier],l.touch0?l.touch1||l.touch0[2]===r[2]||(l.touch1=r,l.taps=0):(l.touch0=r,e=!0,l.taps=1+!!t);t&&(t=clearTimeout(t)),e&&(l.taps<2&&(t=setTimeout((function(){t=null}),f)),vi(this),l.start())}}function L(){if(this.__zooming){var e,n,i,r,s=b(this,arguments),a=J.changedTouches,u=a.length;for(Xi(),t&&(t=clearTimeout(t)),s.taps=0,e=0;e<u;++e)i=dt(this,a,(n=a[e]).identifier),s.touch0&&s.touch0[2]===n.identifier?s.touch0[0]=i:s.touch1&&s.touch1[2]===n.identifier&&(s.touch1[0]=i);if(n=s.that.__zoom,s.touch1){var h=s.touch0[0],c=s.touch0[1],f=s.touch1[0],d=s.touch1[1],p=(p=f[0]-h[0])*p+(p=f[1]-h[1])*p,g=(g=d[0]-c[0])*g+(g=d[1]-c[1])*g;n=m(n,Math.sqrt(p/g)),i=[(h[0]+f[0])/2,(h[1]+f[1])/2],r=[(c[0]+d[0])/2,(c[1]+d[1])/2]}else{if(!s.touch0)return;i=s.touch0[0],r=s.touch0[1]}s.zoom("touch",o(_(n,i,r),s.extent,l))}}function T(){if(this.__zooming){var t,n,i=b(this,arguments),o=J.changedTouches,r=o.length;for(qi(),e&&clearTimeout(e),e=setTimeout((function(){e=null}),f),t=0;t<r;++t)n=o[t],i.touch0&&i.touch0[2]===n.identifier?delete i.touch0:i.touch1&&i.touch1[2]===n.identifier&&delete i.touch1;if(i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0)i.touch0[1]=this.__zoom.invert(i.touch0[0]);else if(i.end(),2===i.taps){var s=ut(this).on("dblclick.zoom");s&&s.apply(this,arguments)}}}return g.transform=function(t,e,n){var i=t.selection?t.selection():t;i.property("__zoom",$i),t!==i?y(t,e,n):i.interrupt().each((function(){b(this,arguments).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},g.scaleBy=function(t,e,n){g.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),n)},g.scaleTo=function(t,e,n){g.transform(t,(function(){var t=i.apply(this,arguments),r=this.__zoom,s=null==n?v(t):"function"==typeof n?n.apply(this,arguments):n,a=r.invert(s),u="function"==typeof e?e.apply(this,arguments):e;return o(_(m(r,u),s,a),t,l)}),n)},g.translateBy=function(t,e,n){g.transform(t,(function(){return o(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),i.apply(this,arguments),l)}))},g.translateTo=function(t,e,n,r){g.transform(t,(function(){var t=i.apply(this,arguments),s=this.__zoom,a=null==r?v(t):"function"==typeof r?r.apply(this,arguments):r;return o(Yi.translate(a[0],a[1]).scale(s.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,l)}),r)},w.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){!function(t,e,n,i){var o=J;t.sourceEvent=J,J=t;try{return e.apply(n,i)}finally{J=o}}(new Zi(g,t,this.that.__zoom),c.apply,c,[t,this.that,this.args])}},g.wheelDelta=function(t){return arguments.length?(r="function"==typeof t?t:ji(+t),g):r},g.filter=function(t){return arguments.length?(n="function"==typeof t?t:ji(!!t),g):n},g.touchable=function(t){return arguments.length?(s="function"==typeof t?t:ji(!!t),g):s},g.extent=function(t){return arguments.length?(i="function"==typeof t?t:ji([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):i},g.scaleExtent=function(t){return arguments.length?(a[0]=+t[0],a[1]=+t[1],g):[a[0],a[1]]},g.translateExtent=function(t){return arguments.length?(l[0][0]=+t[0][0],l[1][0]=+t[1][0],l[0][1]=+t[0][1],l[1][1]=+t[1][1],g):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},g.constrain=function(t){return arguments.length?(o=t,g):o},g.duration=function(t){return arguments.length?(u=+t,g):u},g.interpolate=function(t){return arguments.length?(h=t,g):h},g.on=function(){var t=c.on.apply(c,arguments);return t===c?g:t},g.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,g):Math.sqrt(p)},g}Hi.prototype;var no=function(){function t(t){this._self=t,this.zoomTypes={normal:null,animated:null,fastAnimated:null},this.scale={x:null,y:null,k:null},this.zoomLevels={VENUE:null,BLOCK:null,SEAT:null},this.minZoom=null,this.activeBlocks=[],this.zoomLevel=Mt.VENUE,this.dispatchZoomEvent()}return t.prototype.init=function(){var t=this;console.log("zoom init"),this.calculateZoomLevels(),this.zoomInit(),this._self.eventManager.addEventListener(kt.KEYDOWN_SVG,(function(e){17!=e.which&&91!==e.which||(t._self.eventManager.dispatch(kt.MULTI_SELECT_ENABLE,e),J.preventDefault(),t.zoomDisable())})),this._self.eventManager.addEventListener(kt.KEYUP_SVG,(function(e){t._self.eventManager.dispatch(kt.MULTI_SELECT_DISABLE,e),J.preventDefault(),t.zoomEnable()}))},t.prototype.zoomInit=function(){console.info("zoomInit"),this.zoomTypes.normal=eo().scaleExtent([this._self.config.min_zoom,this._self.config.max_zoom]).on("end",this.zoomEnd(this)).on("zoom",this.zoomHand(this)),this.zoomTypes.animated=eo().scaleExtent([this._self.config.min_zoom,this._self.config.max_zoom]).on("end",this.animatedZoomEnd(this)).on("zoom",this.zoomHandAnimated(this)),this.zoomTypes.fastAnimated=eo().scaleExtent([this._self.config.min_zoom,this._self.config.max_zoom]).on("end",this.animatedFastZoomEnd(this)).on("zoom",this.zoomHandFastAnimated(this)),this._self.svg.node.call(this.zoomTypes.normal),this._self.svg.node.on("dblclick.zoom",null)},t.prototype.zoomEnd=function(t){return console.info("zoomEnd"),function(){var e=J.transform.x,n=J.transform.y,i=J.transform.k;t._self.svg.stage.node.interrupt().attr("transform","translate("+e+","+n+")scale("+i+")"),t.calculateActiveBlocks(),t.calculateZoomLevel(i)}},t.prototype.animatedZoomEnd=function(t){return console.info("animatedZoomEnd"),function(){var e=J.transform.x,n=J.transform.y,i=J.transform.k;t._self.svg.stage.node.interrupt().transition().duration(t._self.config.animation_speed).attr("transform","translate("+e+","+n+")scale("+i+")"),t.calculateActiveBlocks(),t.calculateZoomLevel(i)}},t.prototype.animatedFastZoomEnd=function(t){return console.info("animatedFastZoomEnd"),function(){var e=J.transform.x,n=J.transform.y,i=J.transform.k;t._self.svg.stage.node.interrupt().transition().duration(t._self.config.animation_speed/2).attr("transform","translate("+e+","+n+")scale("+i+")"),t.calculateActiveBlocks(),t.calculateZoomLevel(i)}},t.prototype.zoomHand=function(t){return console.info("zoomHand"),function(){var e=J.transform.x,n=J.transform.y,i=J.transform.k;t._self.svg.stage.node.interrupt().attr("transform","translate("+e+","+n+")scale("+i+")"),t.calculateZoomLevel(i)}},t.prototype.zoomHandAnimated=function(t){return console.info("zoomHandAnimated"),function(){var e=J.transform.x,n=J.transform.y,i=J.transform.k;t._self.svg.stage.node.interrupt().transition().duration(t._self.config.animation_speed).attr("transform","translate("+e+","+n+")scale("+i+")")}},t.prototype.zoomHandFastAnimated=function(t){return console.info("zoomHandFastAnimated"),function(){var e=J.transform.x,n=J.transform.y,i=J.transform.k;t._self.svg.stage.node.interrupt().transition().duration(t._self.config.animation_speed/2).attr("transform","translate("+e+","+n+")scale("+i+")")}},t.prototype.calculateZoomLevel=function(t){var e=this._self.config.max_zoom-.2,n=this.zoomLevels.BLOCK.k,i=this.zoomLevels.VENUE.k,o=null,r=this._self.data.getBlocks().length;t>=e?o=Mt.SEAT:t>=n?o=Mt.BLOCK:t>=i&&r>1&&(o=Mt.VENUE),o!==this.zoomLevel&&(this.zoomLevel=o,this.dispatchZoomEvent())},t.prototype.canvasScopeHandler=function(){if(!1!==this._self.config.canvas_stageout_control){var t=this._self.svg.stage.blocks.node.node().getBoundingClientRect(),e=this._self.svg.node.node().getBoundingClientRect();(this.zoomLevel===Mt.VENUE||this.zoomLevel===Mt.BLOCK&&1===this._self.data.getBlocks().length||this.zoomLevel==Mt.SEAT&&this.zoomLevels.BLOCK&&this.zoomLevels.BLOCK.k===this._self.config.max_zoom)&&(t.left<e.left||t.top<e.top||t.right>e.right||t.bottom>e.bottom)&&this.zoomToVenue(!0,!0)}},t.prototype.calculateZoomLevels=function(t){void 0===t&&(t=this._self.data.getBlocks());var e=this._self.windowManager,n=e.stage;t.map((function(t){t.seats.map((function(e){e.x<t.x&&(t.x=e.x),e.y<t.y&&(t.y=e.y),e.x>n.width&&(n.width=e.x),e.y>n.height&&(n.height=e.y)})),t.labels.map((function(e){e.x<t.x&&(t.x=e.x),e.y<t.y&&(t.y=e.y),e.x>n.width&&(n.width=e.x),e.y>n.height&&(n.height=e.y)}))})),e.width&&e.height&&(this.scale.x=e.width/n.width-e.width/n.width/5,this.scale.y=e.height/n.height-e.height/n.height/5),this.scale.k=this.scale.x<this.scale.y?this.scale.x:this.scale.y,this.minZoom=this.scale.k<1?this.scale.k:1,this.scale.k=this.scale.k>this._self.config.max_zoom?this._self.config.max_zoom:this.scale.k;var i=n.width/2,o=n.height/2;return this.zoomLevels.VENUE={x:i,y:o,k:this.scale.k-.01},1===this._self.data.getBlocks().length&&this.zoomLevels.BLOCK&&(this.zoomLevels.VENUE=this.zoomLevels.BLOCK),this},t.prototype.calculateActiveBlocks=function(t){var e=this;if(void 0===t&&(t=this._self.data.getBlocks()),this.activeBlocks=[],t.map((function(t){var n=e._self.svg.stage.blocks.getBlock(t.id);if(n){var i=n.node.node().getBoundingClientRect(),o=n.node.node().getBBox();if(t.bbox=o,e._self.windowManager.width&&e._self.windowManager.height){var r=e._self.windowManager.width/o.width-e._self.windowManager.width/o.width/3,s=e._self.windowManager.height/o.height-e._self.windowManager.height/o.height/3,a=r<s?r:s;r+=o.x+o.width/2,s+=o.y+o.height/2,a=a>e._self.config.max_zoom?e._self.config.max_zoom:a,t.zoom_bbox={x:r,y:s,k:a};var l=Math.max(0,Math.min(e._self.windowManager.width,i.right)-Math.max(0,i.left))*Math.max(0,Math.min(e._self.windowManager.height,i.bottom)-Math.max(0,i.top)),u=100*l/(e._self.windowManager.width*e._self.windowManager.height);l>0&&e.activeBlocks.push({block:n,ratio:Number(u.toFixed(2))})}}})),this.activeBlocks=this.activeBlocks.sort((function(t,e){return e.ratio-t.ratio})),this.activeBlocks.length){var n=this.activeBlocks[0].block.item;this.zoomLevels.BLOCK=n.zoom_bbox}return this.activeBlocks},t.prototype.zoomToSelection=function(t){void 0===t&&(t=!0);var e=ft(this._self.svg.stage.blocks.node.node()),n=e[0],i=e[1],o=this._self.config.max_zoom;this.zoomLevels.SEAT={x:n,y:i,k:o},t?this._self.svg.node.interrupt().call(this.zoomTypes.animated.translateTo,n,i).call(this.zoomTypes.animated.scaleTo,o):this._self.svg.node.interrupt().call(this.zoomTypes.normal.translateTo,n,i).call(this.zoomTypes.normal.scaleTo,o),this.zoomLevel=Mt.SEAT,this.dispatchZoomEvent()},t.prototype.zoomToBlock=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n=!1);var i=this._self.data.getBlocks().find((function(e){return e.id.toString()===t.toString()}));i&&(e?n?this._self.svg.node.interrupt().call(this.zoomTypes.fastAnimated.translateTo,i.zoom_bbox.x,i.zoom_bbox.y).call(this.zoomTypes.fastAnimated.scaleTo,i.zoom_bbox.k):this._self.svg.node.interrupt().call(this.zoomTypes.animated.translateTo,i.zoom_bbox.x,i.zoom_bbox.y).call(this.zoomTypes.animated.scaleTo,i.zoom_bbox.k):this._self.svg.node.interrupt().call(this.zoomTypes.normal.translateTo,i.zoom_bbox.x,i.zoom_bbox.y).call(this.zoomTypes.normal.scaleTo,i.zoom_bbox.k),i.zoom_bbox.k===this._self.config.max_zoom?this.zoomLevel=Mt.SEAT:this.zoomLevel=Mt.BLOCK,this.dispatchZoomEvent())},t.prototype.zoomToVenue=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1),console.info("zoomToVenue");var n=this.zoomLevels.VENUE.x,i=this.zoomLevels.VENUE.y,o=this.zoomLevels.VENUE.k;if(this._self.config.min_zoom=o,this.zoomInit(),1!==this._self.data.getBlocks().length)n&&i&&o&&(t?e?this._self.svg.node.interrupt().call(this.zoomTypes.fastAnimated.translateTo,n,i).call(this.zoomTypes.fastAnimated.scaleTo,o):this._self.svg.node.interrupt().call(this.zoomTypes.animated.translateTo,n,i).call(this.zoomTypes.animated.scaleTo,o):this._self.svg.node.interrupt().call(this.zoomTypes.normal.translateTo,n,i).call(this.zoomTypes.normal.scaleTo,o),this.zoomLevel=Mt.VENUE,this.dispatchZoomEvent());else{var r=this._self.data.getBlocks()[0];this.zoomToBlock(r.id,t,e)}},t.prototype.zoomEnable=function(){return this._self.svg.node.call(this.zoomTypes.normal),this},t.prototype.zoomDisable=function(){return this._self.svg.node.on(".zoom",null),this},t.prototype.getZoomLevelValues=function(t){return this.zoomLevels[t]},t.prototype.getActiveZoom=function(){return this.zoomLevels[this.zoomLevel]},t.prototype.dispatchZoomEvent=function(){this._self.eventManager.dispatch(kt.ZOOM_LEVEL_CHANGE,{level:this.zoomLevel,values:this.getZoomLevelValues(this.zoomLevel)})},t}(),io={};Object.defineProperty(io,"__esModule",{value:!0});var oo=io.isArray=Array.isArray||function(t){return t&&"number"==typeof t.length},ro=function(){function t(t){this._self=t,this.events=[]}return t.prototype.addEventListener=function(t,e){if(oo(t))for(var n=0;n<t.length;n++)this.events.push({type:t[n],fn:e});else this.events.push({type:t,fn:e});return this},t.prototype.dispatch=function(t,e){return this.events.filter((function(e){return e.type===t})).map((function(t){return t.fn(e)})),this},t}(),so=function(){function t(t){var e=this;this.parent=t,this.width=null,this.height=null,this.stage={width:null,height:null},ut(window).on("resize.svg",(function(){e.resizeHandler()}))}return t.prototype.resizeHandler=function(){var t=ut(this.parent.container_selector).node().getBoundingClientRect();return this.width=t.width,this.height=t.height,this.parent.svg.node.attr("width",t.width),this.parent.svg.node.attr("height",t.height),this.parent.global.eventManager.dispatch(kt.RESIZE_WINDOW,t),this},t}(),ao=function(t,e){var n=this;this.container_selector=t,this.node=null;var i=this;this.config=new Ae(e),this.eventManager=new ro(this),this.addEventListener=this.eventManager.addEventListener,this.node=ut(t),this.windowManager=new so(this),this.zoomManager=new no(this),this.data=new Me(this),this.global={eventManager:this.eventManager,windowManager:this.windowManager,config:this.config,data:this.data,zoomManager:this.zoomManager,root:this,svg:this.svg,multi_select:!1,best_available:!1},ut(window).on("keydown.dispatch",(function(t,e,n){i.eventManager.dispatch(kt.KEYDOWN_SVG,J)})),ut(window).on("keyup.dispatch",(function(t,e,n){i.eventManager.dispatch(kt.KEYUP_SVG,J)})),this.dev=new ke(this),this.svg=new xe(this),this.svg.domGenerate(this.node),this.svg.update(),this.windowManager.resizeHandler(),this.zoomManager.init(),this.eventManager.addEventListener(kt.CLICK_ZOOM_OUT,(function(){return n.zoomManager.zoomToVenue()})),this.eventManager.addEventListener(kt.MULTI_SELECT_ENABLE,(function(){n.global.multi_select=!0,n.node.classed("multi-select-enable",!0)})),this.eventManager.addEventListener(kt.MULTI_SELECT_DISABLE,(function(){n.global.multi_select=!1,n.node.classed("multi-select-enable",!1)})),this.eventManager.addEventListener(kt.BEST_AVAILABLE_ENABLE,(function(){n.global.best_available=!0})),this.eventManager.addEventListener(kt.MBEST_AVAILABLE_DISABLE,(function(){n.global.best_available=!1})),this.eventManager.addEventListener(kt.ZOOM_LEVEL_CHANGE,(function(t){t.level===Mt.VENUE||t.level===Mt.BLOCK?ut(n.config.zoom_out_button).style("display","none"):t.level===Mt.SEAT&&ut(n.config.zoom_out_button).style("display","block")})),ut(this.config.zoom_out_button).on("click",(function(){n.zoomManager.zoomToVenue(!0)})),this.eventManager.addEventListener(kt.ADD_BLOCK,(function(t){n.svg.stage.blocks.update(),n.windowManager.resizeHandler(),n.zoomManager.calculateZoomLevels(n.data.getBlocks()),n.zoomManager.calculateActiveBlocks(n.data.getBlocks()),n.windowManager.resizeHandler(),n.zoomManager.zoomToVenue(!1)})),this.eventManager.dispatch(kt.READY,this)};export{ao as SeatMapCanvas};
15
+ ***************************************************************************** */function Et(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function xt(t,e){return t[0]-e[0]||t[1]-e[1]}function kt(t){const e=t.length,n=[0,1];let i,o=2;for(i=2;i<e;++i){for(;o>1&&Et(t[n[o-2]],t[n[o-1]],t[i])<=0;)--o;n[o++]=i}return n.slice(0,o)}function Mt(t){if((n=t.length)<3)return null;var e,n,i=new Array(n),o=new Array(n);for(e=0;e<n;++e)i[e]=[+t[e][0],+t[e][1],e];for(i.sort(xt),e=0;e<n;++e)o[e]=[i[e][0],-i[e][1]];var r=kt(i),s=kt(o),a=s[0]===r[0],l=s[s.length-1]===r[r.length-1],u=[];for(e=r.length-1;e>=0;--e)u.push(t[i[r[e]][2]]);for(e=+a;e<s.length-l;++e)u.push(t[i[s[e]][2]]);return u}!function(t){!function(){var e="object"==typeof wt?wt:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),n=i(t);function i(t,e){return function(n,i){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:i}),e&&e(n,i)}}void 0===e.Reflect?e.Reflect=t:n=i(e.Reflect,n),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",r="function"==typeof Object.create,s={__proto__:[]}instanceof Array,a=!r&&!s,l={create:r?function(){return it(Object.create(null))}:s?function(){return it({__proto__:null})}:function(){return it({})},has:a?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:a?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},u=Object.getPrototypeOf(Function),c="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=c||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,f=c||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,p=new(c||"function"!=typeof WeakMap?nt():WeakMap);function d(t,e,n,i){if(U(n)){if(!R(t))throw new TypeError;if(!H(e))throw new TypeError;return k(t,e)}if(!R(t))throw new TypeError;if(!I(e))throw new TypeError;if(!I(i)&&!U(i)&&!$(i))throw new TypeError;return $(i)&&(i=void 0),M(t,e,n=j(n),i)}function g(t,e){function n(n,i){if(!I(n))throw new TypeError;if(!U(i)&&!Y(i))throw new TypeError;A(t,e,n,i)}return n}function m(t,e,n,i){if(!I(n))throw new TypeError;return U(i)||(i=j(i)),A(t,e,n,i)}function v(t,e,n){if(!I(e))throw new TypeError;return U(n)||(n=j(n)),L(t,e,n)}function y(t,e,n){if(!I(e))throw new TypeError;return U(n)||(n=j(n)),z(t,e,n)}function _(t,e,n){if(!I(e))throw new TypeError;return U(n)||(n=j(n)),C(t,e,n)}function b(t,e,n){if(!I(e))throw new TypeError;return U(n)||(n=j(n)),S(t,e,n)}function w(t,e){if(!I(t))throw new TypeError;return U(e)||(e=j(e)),O(t,e)}function E(t,e){if(!I(t))throw new TypeError;return U(e)||(e=j(e)),B(t,e)}function x(t,e,n){if(!I(e))throw new TypeError;U(n)||(n=j(n));var i=T(e,n,!1);if(U(i))return!1;if(!i.delete(t))return!1;if(i.size>0)return!0;var o=p.get(e);return o.delete(n),o.size>0||p.delete(e),!0}function k(t,e){for(var n=t.length-1;n>=0;--n){var i=(0,t[n])(e);if(!U(i)&&!$(i)){if(!H(i))throw new TypeError;e=i}}return e}function M(t,e,n,i){for(var o=t.length-1;o>=0;--o){var r=(0,t[o])(e,n,i);if(!U(r)&&!$(r)){if(!I(r))throw new TypeError;i=r}}return i}function T(t,e,n){var i=p.get(t);if(U(i)){if(!n)return;i=new h,p.set(t,i)}var o=i.get(e);if(U(o)){if(!n)return;o=new h,i.set(e,o)}return o}function L(t,e,n){if(z(t,e,n))return!0;var i=Q(e);return!$(i)&&L(t,i,n)}function z(t,e,n){var i=T(e,n,!1);return!U(i)&&P(i.has(t))}function C(t,e,n){if(z(t,e,n))return S(t,e,n);var i=Q(e);return $(i)?void 0:C(t,i,n)}function S(t,e,n){var i=T(e,n,!1);if(!U(i))return i.get(t)}function A(t,e,n,i){T(n,i,!0).set(t,e)}function O(t,e){var n=B(t,e),i=Q(t);if(null===i)return n;var o=O(i,e);if(o.length<=0)return n;if(n.length<=0)return o;for(var r=new f,s=[],a=0,l=n;a<l.length;a++){var u=l[a];r.has(u)||(r.add(u),s.push(u))}for(var c=0,h=o;c<h.length;c++){u=h[c];r.has(u)||(r.add(u),s.push(u))}return s}function B(t,e){var n=[],i=T(t,e,!1);if(U(i))return n;for(var o=X(i.keys()),r=0;;){var s=F(o);if(!s)return n.length=r,n;var a=W(s);try{n[r]=a}catch(t){try{J(o)}finally{throw t}}r++}}function N(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function U(t){return void 0===t}function $(t){return null===t}function V(t){return"symbol"==typeof t}function I(t){return"object"==typeof t?null!==t:"function"==typeof t}function K(t,e){switch(N(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n="string",o=q(t,i);if(void 0!==o){var r=o.call(t,n);if(I(r))throw new TypeError;return r}return G(t)}function G(t,e){var n,i,o=t.toString;if(Z(o)&&!I(i=o.call(t)))return i;if(Z(n=t.valueOf)&&!I(i=n.call(t)))return i;throw new TypeError}function P(t){return!!t}function D(t){return""+t}function j(t){var e=K(t);return V(e)?e:D(e)}function R(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function Z(t){return"function"==typeof t}function H(t){return"function"==typeof t}function Y(t){switch(N(t)){case 3:case 4:return!0;default:return!1}}function q(t,e){var n=t[e];if(null!=n){if(!Z(n))throw new TypeError;return n}}function X(t){var e=q(t,o);if(!Z(e))throw new TypeError;var n=e.call(t);if(!I(n))throw new TypeError;return n}function W(t){return t.value}function F(t){var e=t.next();return!e.done&&e}function J(t){var e=t.return;e&&e.call(t)}function Q(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===u)return e;if(e!==u)return e;var n=t.prototype,i=n&&Object.getPrototypeOf(n);if(null==i||i===Object.prototype)return e;var o=i.constructor;return"function"!=typeof o||o===t?e:o}function tt(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[o]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var i=this._keys.length,o=n+1;o<i;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,i)},e.prototype.values=function(){return new n(this._keys,this._values,r)},e.prototype.entries=function(){return new n(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[o]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function i(t,e){return t}function r(t,e){return e}function s(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new h}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[o]=function(){return this.keys()},t}()}function nt(){var t=16,n=l.create(),i=o();return function(){function t(){this._key=o()}return t.prototype.has=function(t){var e=r(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){var e=r(t,!1);return void 0!==e?l.get(e,this._key):void 0},t.prototype.set=function(t,e){return r(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=r(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=o()},t}();function o(){var t;do{t="@@WeakMap@@"+u()}while(l.has(n,t));return n[t]=!0,t}function r(t,n){if(!e.call(t,i)){if(!n)return;Object.defineProperty(t,i,{value:l.create()})}return t[i]}function s(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function a(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):s(new Uint8Array(t),t):s(new Array(t),t)}function u(){var e=a(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",i=0;i<t;++i){var o=e[i];4!==i&&6!==i&&8!==i||(n+="-"),o<16&&(n+="0"),n+=o.toString(16).toLowerCase()}return n}}function it(t){return t.__=void 0,delete t.__,t}t("decorate",d),t("metadata",g),t("defineMetadata",m),t("hasMetadata",v),t("hasOwnMetadata",y),t("getMetadata",_),t("getOwnMetadata",b),t("getMetadataKeys",w),t("getOwnMetadataKeys",E),t("deleteMetadata",x)}(n)}()}(bt||(bt={}));var Tt=function(){function t(t){return this.parent=t,this.node=null,this.autoGenerate=!1,this.child_index=null,this.domText=null,this.child_items=[],this.dom_attrs=[],this.dom_classes=[],this.tags=[],this.eventCode=null,void 0!==t.global&&(this.global=t.global),Object(this).dom_params&&(Object(this).dom_params.tag&&(this.domTag=Object(this).dom_params.tag),Object(this).dom_params.class&&(this.domClass=Object(this).dom_params.class),Object(this).dom_params.event_code&&(this.eventCode=Object(this).dom_params.event_code)),void 0!==Object(this).dom_params.autoGenerate&&!0===Object(this).dom_params.autoGenerate&&(this.autoGenerate=!0),this.generateThisDom(),this}return t.prototype.generateThisDom=function(){return this.autoGenerate&&(this.domGenerate(this.parent.node),this.afterGenerate()),this},t.prototype.domGenerate=function(t,e){void 0===e&&(e=0);var n=this.domTag?this.domTag:"g";this.child_index=e,this.node=t.datum(this.parent).append(n);for(var i=0;i<this.dom_attrs.length;i++){var o=this.dom_attrs[i];this.node.attr(o.name,o.value)}this.domText&&this.node.text(this.domText),this.domClass&&this.node.classed(this.domClass,!0);for(var r=0;r<this.dom_classes.length;r++){var s=this.dom_classes[r];this.node.classed(s.name,s.value)}return this},t.prototype.attr=function(t,e){return this.dom_attrs.push({name:t,value:e}),this},t.prototype.text=function(t){return this.domText=t,this},t.prototype.addChild=function(t,e,n){return yt(this,void 0,void 0,function(){var n,i;return _t(this,function(o){for(n in e)i=e[n],t.dom_attrs.push({name:n,value:i});return this.child_items.push(t),[2,this]})})},t.prototype.classed=function(t,e){return void 0===e&&(e=!0),this.dom_classes.push({name:t,value:e}),this},t.prototype.clear=function(){return this.child_items.map(function(t){t.node.remove()}),this.child_items=[],this},t.prototype.updateChilds=function(){return yt(this,void 0,void 0,function(){var t=this;return _t(this,function(e){return this.child_items.map(function(e,n){e.domGenerate(t.node,n),e.update()}),this.afterGenerate(),this.updateEvents(!1),[2,this]})})},t.prototype.updateEvents=function(t){void 0===t&&(t=!1);var e=this,n=["click","mousever","mouseleave","mouseout","mouseenter","mousemove","keydown","keypress","mousedown","mouseup","touchstart"];if(this.eventCode){for(var i=function(t){var i=o.global.eventManager.events[t],r=i.type.toString().split(".");r[0].toLowerCase()===o.eventCode.toLowerCase()&&-1!==n.indexOf(r[1].toLowerCase())&&void 0!==r[1]&&o.node.on(r[1].toLowerCase()+".globalevent",function(t,n){var o=pt(t,e.parent.node.node());i.fn(e,n,o)})},o=this,r=0;r<this.global.eventManager.events.length;r++)i(r);t&&this.child_items.length>0&&this.child_items.map(function(t){"function"==typeof t.updateEvents&&t.updateEvents(!0)})}return this},t.prototype.addEventListener=function(t,e){return this.global.eventManager.addEventListener(t,e),this.updateEvents(!1),this},t.prototype.addTag=function(t){return this.tags.push(t),this},t.prototype.hasTag=function(t){return-1!==this.tags.indexOf(t)},t.prototype.getChilds=function(t){return void 0===t&&(t=null),null===t?this.child_items.filter(function(e){return e.constructor.name===t}):this.child_items},t.prototype.getChildCount=function(){return this.child_items.length},t.prototype.beforeGenerate=function(){},t.prototype.afterGenerate=function(){},t.prototype.addToParent=function(){return this.parent.addChild(this),this},t.prototype.addTo=function(t){return t.addChild(this),this},t}();function Lt(t){return function(e){e.prototype.dom_params={},t.tag&&(e.prototype.dom_params.tag=t.tag),t.class&&(e.prototype.dom_params.class=t.class),t.event_code?e.prototype.dom_params.event_code=t.event_code:t.class&&(e.prototype.dom_params.event_code=t.class),void 0!==t.autoGenerate?e.prototype.dom_params.autoGenerate=t.autoGenerate:e.prototype.dom_params.autoGenerate=!0}}function zt(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}var Ct,St,At,Ot,Bt=(Ct="application/xml",(t,e)=>function(t,e){return fetch(t,e).then(zt)}(t,e).then(t=>(new DOMParser).parseFromString(t,Ct))),Nt=function(){this.child_index=null,this.item_type=null},Ut=function(t){function e(e){var n=t.call(this)||this;return n.tags=[],n.tag_index={},n.id=e.id,n.x=e.x,n.y=e.y,n.title=e.title||null,n.color=e.color||null,n.block=e.block,n.note=e.note||null,n.salable=!1!==e.salable||e.salable,n.selected=e.selected||!1,n.tags=e.tags||[],n.custom_data=e.custom_data||{},n.tag_index={},n.svg=null,n.icon=null,n}return gt(e,t),e.prototype.selectedToggle=function(){return this.selected=!0!==this.selected,this.selected},e.prototype.addTag=function(t){this.tag_index[t]||(this.tag_index[t]=!0,this.tags.push(t))},e.prototype.removeTags=function(t){},e.prototype.toJson=function(){return{id:this.id,x:this.x,y:this.y,salable:this.salable,note:this.note,color:this.color,block:this.block.toJson()}},e}(Nt),$t=function(t){function e(e){var n=t.call(this)||this;return n.x=e.x,n.y=e.y,n.title=e.title,n.block=e.block,n}return gt(e,t),e}(Nt),Vt=function(t){function e(e){var n=t.call(this)||this;return n.id=e.id?e.id:(1e3*Math.random()).toString(),n.width=e.width||null,n.height=e.height||null,n.x=e.x||null,n.y=e.y||null,n.bounds=e._bounds||[],n.color=e.color||"#f1f1f1",n.border_color=e.border_color||"#f1f1f1",n.title=e.title,n.rotate=e.rotate||0,n.gap=e.gap||12,n.labels=e.labels.map(function(t){return t.block=n,new $t(t)})||[],n.seats=e.seats.map(function(t){return t.block=n,new Ut(t)})||[],n}return gt(e,t),e.prototype.toJson=function(){return{id:this.id,title:this.title,x:this.x,y:this.y,color:this.color,width:this.width,height:this.height}},e}(Nt),It=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("block-id",e.item.block.id),n.attr("r",n.global.config.style.seat.radius),n.attr("fill",n.global.config.style.seat.color),n.attr("stroke","rgba(0,0,0,0.3)"),n.attr("stroke-width",1),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([Lt({tag:"circle",class:"seat-circle",autoGenerate:!1}),vt("design:paramtypes",[Rt])],e)}(Tt),Kt=function(){function t(t){this.x=t.x||0,this.y=t.y||0}return t.prototype.toArray=function(){return[this.x,this.y]},t.prototype.toJson=function(){return{}},t}();!function(t){t.ADD_BLOCK="BLOCK.ADD",t.REMOVE_BLOCK="BLOCK.REMOVE",t.CLICK_BLOCK="BLOCK.CLICK",t.MOUSEENTER_BLOCK="BLOCK.MOUSEENTER",t.TOUCHSTART_BLOCK="BLOCK.TOUCHSTART",t.MOUSEDOWN_BLOCK="BLOCK.MOUSEDOWN",t.MOUSEUP_BLOCK="BLOCK.MOUSEUP",t.MOUSEMOVE_BLOCK="BLOCK.MOUSEMOVE",t.MOUSELEAVE_BLOCK="BLOCK.MOUSELEAVE",t.UPDATE_BLOCK="BLOCK.UPDATE",t.CLICK_SEAT="SEAT.CLICK",t.TOUCHSTART_SEAT="SEAT.TOUCHSTART",t.MOUSEMOVE_SEAT="SEAT.MOUSEMOVE",t.MOUSEDOWN_SEAT="SEAT.MOUSEDOWN",t.MOUSEENTER_SEAT="SEAT.MOUSEENTER",t.MOUSELEAVE_SEAT="SEAT.MOUSELEAVE",t.MOUSEOUT_SEAT="SEAT.MOUSEOUT",t.ADD_SEAT="SEAT.ADD",t.REMOVE_SEAT="SEAT.REMOVE",t.ZOOM_LEVEL_CHANGE="ZOOM_LEVEL_CHANGE",t.BOUND_CLICK="BOUND.CLICK",t.MOUSE_MOVE="MOUSE.MOVE",t.RESIZE_WINDOW="WINDOW.RESIZE",t.CLICK_ZOOM_OUT="ZOOM-OUT-BG.CLICK",t.MOUSEMOVE_ZOOM_OUT="ZOOM-OUT-BG.MOUSEMOVE",t.KEYDOWN_SVG="KEYDOWN.SEATMAP-SVG",t.KEYUP_SVG="KEYUP.SEATMAP-SVG",t.MULTI_SELECT_ENABLE="MULTI_SELECT_ENABLE",t.MULTI_SELECT_DISABLE="MULTI_SELECT_DISABLE",t.BEST_AVAILABLE_ENABLE="BEST_AVAILABLE_ENABLE",t.MBEST_AVAILABLE_DISABLE="MBEST_AVAILABLE_DISABLE",t.READY="READY"}(St||(St={})),function(t){t.VENUE="VENUE",t.BLOCK="BLOCK",t.SEAT="SEAT"}(At||(At={})),function(t){t.HOVER="hover",t.FOCUS="focus",t.LEAVE="leave",t.SELECT="select",t.NORMAL="normal"}(Ot||(Ot={}));var Gt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("d","M12.9,953.7l-6.3,6.5l-2.9-2.5l-2.1,2.4l4.1,3.5l1.1,1l1.1-1.1l7.3-7.6L12.9,953.7L12.9,953.7z"),n.attr("fill",n.global.config.style.seat.check_color),n.attr("transform","translate(-8,-959.36218)"),n.attr("pointer-events","none"),n.attr("display","none"),n}return gt(e,t),e.prototype.update=function(){return this},e.prototype.afterGenerate=function(){this.node.style("pointer-events","none")},e.prototype.show=function(){return this.node.attr("display","block"),this},e.prototype.hide=function(){return this.node.attr("display","none"),this},e=mt([Lt({tag:"path",class:"seat-check",autoGenerate:!1}),vt("design:paramtypes",[Rt])],e)}(Tt),Pt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("fill",n.global.config.style.label.color),n.attr("opacity",0),n.attr("r",n.global.config.style.seat.radius/1.5),n.attr("transform","translate(".concat(n.global.config.style.seat.radius/2,",560)")),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([Lt({tag:"circle",class:"circle-area",autoGenerate:!1}),vt("design:paramtypes",[Dt])],e)}(Tt),Dt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.customSvg=n,i.attr("transform","translate(".concat(i.global.config.style.seat.radius/2*-1,",-560)")),i}return gt(e,t),e.prototype.update=function(){return this.updateChilds(),this},e.prototype.domGenerate=function(e,n){void 0===n&&(n=0),t.prototype.domGenerate.call(this,e,n);var i=ft(this.customSvg.documentElement.cloneNode(!0));return i.attr("width",this.global.config.style.seat.radius),i.attr("viewBox","0 0 ".concat(this.global.config.style.seat.radius," ").concat(this.global.config.style.seat.radius)),this.node.node().append(i.node()),this.addChild(new Pt(this)),this},e=mt([Lt({tag:"g",class:"seat-circle",autoGenerate:!1}),vt("design:paramtypes",[Rt,Object])],e)}(Tt),jt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("r",n.global.config.style.seat.radius/2),n.attr("fill",n.global.config.style.seat.check_color),n.attr("transform","translate(0,0)"),n.attr("pointer-events","none"),n.attr("opacity",0),n.attr("stroke","rgba(0,0,0,0.3)"),n.attr("stroke-width",1),n}return gt(e,t),e.prototype.update=function(){return this},e.prototype.afterGenerate=function(){this.node.style("pointer-events","none")},e.prototype.show=function(){return this.node.transition().duration(150).attr("r",this.global.config.style.seat.radius/1.3).attr("opacity",1),this},e.prototype.hide=function(){return this.node.attr("r",this.global.config.style.seat.radius/4),this.node.attr("opacity",0),this},e=mt([Lt({tag:"circle",class:"seat-check",autoGenerate:!1}),vt("design:paramtypes",[Rt])],e)}(Tt),Rt=function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.parent=e,o.item=n,o.coordinates=new Kt(n),o.seatCustomSvg=i,o.attr("transform","translate("+o.coordinates.toArray()+")"),o.item.svg=o,o}return gt(e,t),e.prototype.setColor=function(t,e){if(void 0===e&&(e=!1),this.seatCustomSvg)this.circle.node.attr("fill",t);else if(e)this.circle.node.transition().duration(this.global.config.animation_speed).attr("fill",t);else try{this.circle.node.attr("fill",t)}catch(t){console.log("err",t)}return this},e.prototype.updateColor=function(t){return this.setColor(this.getColor()),this},e.prototype.select=function(t){return this.isSalable()?(this.item.selected=!0,this.node.classed("selected",!0),this.seatCustomSvg,this.circle.node.attr("fill",this.global.config.style.seat.selected),this.check.show(),this):this},e.prototype.unSelect=function(){return this.item.selected=!1,this.node.classed("selected",!1),this.seatCustomSvg,this.circle.node.attr("fill",this.global.config.style.seat.color),this.check.hide(),this},e.prototype.isSelected=function(){return this.item.selected},e.prototype.isSalable=function(){return this.item.salable},e.prototype.hover=function(){this.setColor(this.global.config.style.seat.hover)},e.prototype.blur=function(){this.setColor(this.getColor())},e.prototype.getColor=function(t){return void 0===t&&(t=null),this.isSalable()?t==Ot.FOCUS?this.isSelected()?this.global.config.style.seat.focus_out:this.global.config.style.seat.focus:t==Ot.HOVER?this.isSelected()?this.global.config.style.seat.selected:this.global.config.style.seat.hover:t==Ot.LEAVE?this.isSelected()?this.global.config.style.seat.selected:this.global.config.style.seat.color:t==Ot.SELECT?(this.isSelected(),this.global.config.style.seat.selected):this.isSelected()?this.global.config.style.seat.selected:this.global.config.style.seat.color:this.global.config.style.seat.not_salable},e.prototype.update=function(){return this.seatCustomSvg?(this.check=new jt(this).addTo(this),this.circle=new Dt(this,this.seatCustomSvg),this.addChild(this.circle)):(this.circle=new It(this),this.addChild(this.circle),this.check=new Gt(this).addTo(this)),this.updateChilds(),this},e.prototype.afterGenerate=function(){this.setColor(this.getColor()),this.item.selected?this.check.show():this.check.hide()},e=mt([Lt({tag:"g",class:"seat",autoGenerate:!1}),vt("design:paramtypes",[Zt,Ut,Object])],e)}(Tt),Zt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i.global.eventManager.addEventListener(St.MOUSEENTER_SEAT,function(t){i.global.multi_select||t.setColor(t.getColor(Ot.HOVER))}),i.global.eventManager.addEventListener(St.MOUSELEAVE_SEAT,function(t){t.setColor(t.getColor())}),i}return gt(e,t),e.prototype.update=function(){return yt(this,void 0,void 0,function(){var t,e,n,i;return _t(this,function(o){switch(o.label){case 0:return this.global.config.style.seat.svg?[4,Bt(this.global.config.style.seat.svg)]:[3,2];case 1:t=o.sent(),o.label=2;case 2:e=0,n=this.item.seats,o.label=3;case 3:return e<n.length?(i=n[e],[4,this.addChild(new Rt(this,i,t),{id:i.id})]):[3,6];case 4:o.sent(),o.label=5;case 5:return e++,[3,3];case 6:return[4,this.updateChilds()];case 7:return o.sent(),[2,this]}})})},e.prototype.getSeat=function(t){return this.child_items.find(function(e){return e.item.id==t})},e.prototype.getSeats=function(){return this.child_items},e.prototype.getSeatsCount=function(){return this.child_items.length},e.prototype.getSeatByIndex=function(t){return this.child_items[t]},e.prototype.resetSeatsColors=function(t){void 0===t&&(t=!1);for(var e=0;e<this.getSeatsCount();e++){var n=this.getSeatByIndex(e);n.item;var i=n.getColor();!n.isSelected()&&n.isSalable()&&(i=n.getColor(Ot.LEAVE),n.setColor(i,t))}},e=mt([Lt({tag:"g",class:"seats",autoGenerate:!1}),vt("design:paramtypes",[ee,Vt])],e)}(Tt),Ht=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("fill",n.global.config.style.block.title_color),n.attr("font-size",48),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([Lt({tag:"text",class:"title",autoGenerate:!1}),vt("design:paramtypes",[Yt])],e)}(Tt),Yt=function(t){function e(e,n){var i=t.call(this,e)||this;i.parent=e,i.item=n,i.attr("opacity",0);var o=(i.item.bounds[1][0]-i.item.bounds[2][0])/2+i.item.bounds[2][0],r=(i.item.bounds[0][1]-i.item.bounds[1][1])/2+i.item.bounds[1][1];return i.attr("transform","translate("+[o,r]+")"),i}return gt(e,t),e.prototype.update=function(){return this.title=new Ht(this),this.addChild(this.title),this.updateChilds(),this.title.node.text(this.parent.item.title),this},e=mt([Lt({tag:"g",class:"info",autoGenerate:!1}),vt("design:paramtypes",[ee,Vt])],e)}(Tt),qt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i}return gt(e,t),e.prototype.show=function(){this.node.classed("bound-hide",!1)},e.prototype.hide=function(){this.node.classed("bound-hide",!0)},e.prototype.update=function(){return this.updateChilds(),this.node.datum(this.item.bounds).attr("d",function(t){return"M"+t.join("L")+"Z"}),this},e=mt([Lt({tag:"path",class:"bound",autoGenerate:!1}),vt("design:paramtypes",[Object,Vt])],e)}(Tt),Xt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i}return gt(e,t),e.prototype.update=function(){return this.bound1=new qt(this,this.item),this.bound1.attr("fill",this.parent.item.border_color),this.bound1.attr("stroke-width",70),this.bound1.attr("stroke",this.parent.item.border_color),this.bound1.classed("block-hull-border"),this.bound2=new qt(this,this.item),this.bound2.attr("fill",this.item.color),this.bound2.attr("stroke-width",60),this.bound2.attr("stroke",this.item.color),this.bound2.classed("block-hull"),this.addChild(this.bound1),this.addChild(this.bound2),this.updateChilds(),this},e=mt([Lt({tag:"g",class:"bounds",autoGenerate:!1}),vt("design:paramtypes",[ee,Vt])],e)}(Tt),Wt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i.global.eventManager.addEventListener(St.BOUND_CLICK,function(t){if(!i.global.multi_select){var n=t.parent.parent.item;t.hasTag("block-level")?e.global.zoomManager.zoomToBlock(n.id):t.hasTag("seat-level")&&e.global.zoomManager.zoomToSelection()}}),i}return gt(e,t),e.prototype.update=function(){return this.seatLevelMask=new qt(this,this.item),this.seatLevelMask.attr("fill",this.item.color),this.seatLevelMask.attr("stroke-width",59),this.seatLevelMask.attr("stroke",this.item.color),this.seatLevelMask.tags.push("seat-level"),this.seatLevelMask.classed("seat-level-mask"),this.blockLevelMask=new qt(this,this.item),this.blockLevelMask.attr("fill",this.item.color),this.blockLevelMask.attr("stroke-width",59),this.blockLevelMask.attr("stroke",this.item.color),this.blockLevelMask.tags.push("block-level"),this.blockLevelMask.classed("block-level-mask"),this.addChild(this.seatLevelMask),this.addChild(this.blockLevelMask),this.updateChilds(),this},e=mt([Lt({tag:"g",class:"masks",autoGenerate:!1}),vt("design:paramtypes",[ee,Vt])],e)}(Tt),Ft=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("r",n.global.config.style.label.radius),n.attr("fill",n.global.config.style.label.bg),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([Lt({tag:"circle",class:"label-circle",autoGenerate:!1}),vt("design:paramtypes",[Qt])],e)}(Tt),Jt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("fill",n.global.config.style.label.color),n.attr("font-size",n.global.config.style.label.font_size),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([Lt({tag:"text",class:"label-text",autoGenerate:!1}),vt("design:paramtypes",[Qt])],e)}(Tt),Qt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i.coordinates=new Kt(n),i.attr("transform","translate("+i.coordinates.toArray()+")"),i}return gt(e,t),e.prototype.update=function(){return this.circle=new Ft(this),this.addChild(this.circle),this.circle=new Jt(this),this.addChild(this.circle),this.updateChilds(),this.circle.node.text(this.item.title),this},e=mt([Lt({tag:"g",class:"label",autoGenerate:!1}),vt("design:paramtypes",[te,$t])],e)}(Tt),te=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i}return gt(e,t),e.prototype.update=function(){var t=this;return this.item.labels.map(function(e){t.addChild(new Qt(t,e))}),this.updateChilds(),this},e.prototype.getLabels=function(){return this.child_items},e=mt([Lt({tag:"g",class:"labels",autoGenerate:!1}),vt("design:paramtypes",[ee,Vt])],e)}(Tt),ee=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i.center_position={x:null,y:null},i.top_position={x:null,y:null},i.attr("id",n.id),i.attr("opacity",0),i.global.eventManager.addEventListener(St.ZOOM_LEVEL_CHANGE,function(t){t.level===At.VENUE?(i.mask.blockLevelMask.show(),i.mask.seatLevelMask.show(),i.seats.resetSeatsColors(!1),i.infosToCenter()):t.level===At.BLOCK?(i.mask.blockLevelMask.hide(),i.mask.seatLevelMask.show(),i.infosToTop()):t.level===At.SEAT&&(i.mask.blockLevelMask.hide(),i.mask.seatLevelMask.hide(),i.seats.resetSeatsColors(!1),i.infosToTop())}),i.global.eventManager.addEventListener(St.MULTI_SELECT_ENABLE,function(){i.seats.resetSeatsColors(!1)}),i.global.eventManager.addEventListener(St.MULTI_SELECT_DISABLE,function(){i.seats.resetSeatsColors(!1)}),i.global.eventManager.addEventListener(St.MOUSEMOVE_BLOCK,function(t,e,n){if(i.parent.parent.searchCircle.is_enable&&!i.global.multi_select){var o=i.global.config.zoom_focus_circle_radius;if(i.global.zoomManager.zoomLevel===At.BLOCK)for(var r=0;r<t.seats.getSeatsCount();r++){var s=t.seats.getSeatByIndex(r),a=s.item,l=s.getColor();s.isSelected()?l=s.getColor(Ot.SELECT):(a.x-o<n[0]&&a.x+o>n[0]&&a.y-o<n[1]&&a.y+o>n[1]&&(l=s.getColor(Ot.FOCUS)),s.setColor(l))}}}),i.global.eventManager.addEventListener(St.MOUSELEAVE_BLOCK,function(t){i.seats.resetSeatsColors()}),i.parent.node.on("mouseleave.seats",function(){i.seats.resetSeatsColors(!1)}),i}return gt(e,t),e.prototype.update=function(){return this.bounds=new Xt(this,this.item),this.addChild(this.bounds),this.seats=new Zt(this,this.item),this.addChild(this.seats),this.labels=new te(this,this.item),this.addChild(this.labels),this.mask=new Wt(this,this.item),this.addChild(this.mask),this.info=new Yt(this,this.item),this.addChild(this.info),this.center_position.x=(this.item.bounds[1][0]-this.item.bounds[2][0])/2+this.item.bounds[2][0],this.center_position.y=(this.item.bounds[0][1]-this.item.bounds[1][1])/2+this.item.bounds[1][1],this.top_position.x=this.center_position.x,this.top_position.y=this.item.bounds[1][1]-60,this.updateChilds(),this.infosToCenter(),this.node.interrupt().transition().duration(this.global.config.animation_speed).attr("opacity",1),this.node.attr("transform-origin","".concat(this.center_position.x," ").concat(this.center_position.y)),this.item.rotate&&this.node.attr("transform","rotate("+this.item.rotate+")"),this},e.prototype.infosToTop=function(){this.info.node&&this.top_position.x&&(this.info.node.interrupt().transition().duration(this.global.config.animation_speed).attr("transform","translate("+this.top_position.x+","+this.top_position.y+")").attr("opacity",.8).attr("font-size",14),this.info.title.node.transition().duration(this.global.config.animation_speed).attr("fill",this.item.color))},e.prototype.infosToCenter=function(){this.info.node&&this.center_position.x&&(this.info.node.interrupt().transition().duration(this.global.config.animation_speed).attr("transform","translate("+this.center_position.x+","+this.center_position.y+")").attr("opacity",1).attr("font-size",32),this.info.title.node.transition().duration(this.global.config.animation_speed).attr("fill",this.global.config.style.block.title_color))},e=mt([Lt({tag:"g",class:"block",autoGenerate:!1}),vt("design:paramtypes",[ne,Vt])],e)}(Tt),ne=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n}return gt(e,t),e.prototype.update=function(){var t=this;return this.clear(),this.global.data.getBlocks().map(function(e){var n=new ee(t,e),i=e.seats;i&&i.length&&(i[0].y+=1e-4,i[0].x+=1e-4);var o=i.map(function(t){return[t.x,t.y]}).concat(e.labels.map(function(t){return[t.x,t.y]}));e.bounds=Mt(o);var r=function(t){for(var e,n,i=-1,o=t.length,r=0,s=0,a=t[o-1],l=0;++i<o;)e=a,a=t[i],l+=n=e[0]*a[1]-a[0]*e[1],r+=(e[0]+a[0])*n,s+=(e[1]+a[1])*n;return[r/(l*=3),s/l]}(e.bounds);t.scalePolygon(e.bounds,1.4,r);var s=t.expandPolygon(e.bounds,e.gap,r);e.bounds=Mt(s),t.addChild(n)}),this.updateChilds(),this.seats=this.node.selectAll(".seat"),this},e.prototype.getBlock=function(t){var e=this.getBlocks().find(function(e){return e.item.id==t});return e||null},e.prototype.getBlocks=function(){return this.getChilds(ee.name)},e.prototype.center=function(){},e.prototype.scalePolygon=function(t,e,n){return t.map(function(t){var i=t[0],o=t[1];return[n[0]+(i-n[0])*e,n[1]+(o-n[1])*e]})},e.prototype.expandPolygon=function(t,e,n){return t.map(function(t){var i=t[0],o=t[1],r=i-n[0],s=o-n[1],a=Math.sqrt(r*r+s*s);return[i+r/a*e,o+s/a*e]})},e=mt([Lt({tag:"g",class:"blocks",autoGenerate:!1}),vt("design:paramtypes",[re])],e)}(Tt),ie=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("r",n.parent.global.config.zoom_focus_circle_radius),n}return gt(e,t),e.prototype.update=function(){return this.updateChilds(),this},e=mt([Lt({tag:"circle",class:"circle",autoGenerate:!1}),vt("design:paramtypes",[oe])],e)}(Tt),oe=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.is_enable=!0,n.global.eventManager.addEventListener(St.MOUSE_MOVE,function(t){n.global.zoomManager.zoomLevel===At.BLOCK&&n.is_enable&&n.node.attr("transform","translate("+t+")")}),n.global.eventManager.addEventListener(St.ZOOM_LEVEL_CHANGE,function(t){t.level!==At.VENUE&&t.level!==At.SEAT||n.node.classed("show",!1)}),n.global.eventManager.addEventListener(St.MULTI_SELECT_ENABLE,function(){n.disable()}),n.global.eventManager.addEventListener(St.MULTI_SELECT_DISABLE,function(){n.enable()}),n}return gt(e,t),e.prototype.update=function(){var t=this;return this.clear(),this.circle=new ie(this),this.addChild(this.circle),this.updateChilds(),this.parent.blocks.node.on("mouseleave.search",function(){t.node.classed("show",!1)}),this.parent.blocks.node.on("mousemove.search",function(){t.global.zoomManager.zoomLevel===At.VENUE?t.node.classed("show",!1):t.global.zoomManager.zoomLevel===At.BLOCK?t.node.classed("show",!0):t.global.zoomManager.zoomLevel===At.SEAT&&t.node.classed("show",!1)}),this},e.prototype.enable=function(){return this.is_enable=!0,this.node.style("display","block"),this},e.prototype.disable=function(){return this.is_enable=!1,this.node.style("display","none"),this},e=mt([Lt({tag:"g",class:"search-circle",autoGenerate:!1}),vt("design:paramtypes",[re])],e)}(Tt),re=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n}return gt(e,t),e.prototype.update=function(){this.blocks=new ne(this),this.addChild(this.blocks),this.searchCircle=new oe(this),this.addChild(this.searchCircle),this.updateChilds()},e=mt([Lt({tag:"g",class:"stage",autoGenerate:!1}),vt("design:paramtypes",[ze])],e)}(Tt),se=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.global.eventManager.addEventListener(St.RESIZE_WINDOW,function(t){n.node.attr("width",t.width).attr("height",t.height).on("click.zoomout",function(){n.global.eventManager.dispatch(St.CLICK_ZOOM_OUT,n)})}),n}return gt(e,t),e.prototype.update=function(){},e=mt([Lt({tag:"rect",class:"zoom-out-bg",autoGenerate:!1}),vt("design:paramtypes",[ze])],e)}(Tt),ae=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("r",n.global.config.style.legend.radius),n.attr("fill",n.parent.legend_data.color),n}return gt(e,t),e.prototype.update=function(){},e=mt([Lt({tag:"circle",class:"legend-circle",autoGenerate:!1}),vt("design:paramtypes",[ce])],e)}(Tt),le=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("x",1.5*n.global.config.style.legend.radius),n.attr("fill",n.global.config.style.legend.font_color),n.attr("font-size",n.global.config.style.legend.font_size),n}return gt(e,t),e.prototype.update=function(){},e=mt([Lt({tag:"text",class:"legend-title dark:fill-white",autoGenerate:!1}),vt("design:paramtypes",[ce])],e)}(Tt),ue=function(t){function e(e){var n=t.call(this)||this;return n.x=e.x,n.y=e.y,n.title=e.title,n.color=e.color,n}return gt(e,t),e}(Nt),ce=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.legend_data=n,i}return gt(e,t),e.prototype.update=function(){if(this.circle=new ae(this),this.addChild(this.circle),this.title=new le(this),this.addChild(this.title),this.updateChilds(),this.title.node.text(this.legend_data.title),this.child_index){var t=this.child_index*this.global.config.style.legend.padding;this.node.attr("transform","translate("+[0,t]+")")}},e=mt([Lt({tag:"g",class:"legend-item",autoGenerate:!1}),vt("design:paramtypes",[he,ue])],e)}(Tt),he=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n}return gt(e,t),e.prototype.update=function(){var t=[];t.push({title:this.global.config.lang.non_selectable,color:this.global.config.style.seat.not_salable}),t.push({title:this.global.config.lang.selectable,color:this.global.config.style.seat.color}),t.push({title:this.global.config.lang.your_selection,color:this.global.config.style.seat.selected});for(var e=0;e<t.length;e++){var n=new ce(this,t[e]);this.addChild(n)}this.updateChilds()},e.prototype.afterGenerate=function(){var t=2*this.global.config.style.legend.radius,e=150-this.global.config.style.legend.padding*this.getChildCount();this.node.attr("transform","translate("+[t,e]+")")},e=mt([Lt({tag:"g",class:"legend",autoGenerate:!1}),vt("design:paramtypes",[ze])],e)}(Tt);function fe(t){return function(){return t}}const pe=Math.PI,de=2*pe,ge=1e-6,me=de-ge;function ve(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class ye{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?ve:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return ve;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,i){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,e,n,i,o,r){this._append`C${+t},${+e},${+n},${+i},${this._x1=+o},${this._y1=+r}`}arcTo(t,e,n,i,o){if(t=+t,e=+e,n=+n,i=+i,(o=+o)<0)throw new Error(`negative radius: ${o}`);let r=this._x1,s=this._y1,a=n-t,l=i-e,u=r-t,c=s-e,h=u*u+c*c;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(h>ge)if(Math.abs(c*a-l*u)>ge&&o){let f=n-r,p=i-s,d=a*a+l*l,g=f*f+p*p,m=Math.sqrt(d),v=Math.sqrt(h),y=o*Math.tan((pe-Math.acos((d+h-g)/(2*m*v)))/2),_=y/v,b=y/m;Math.abs(_-1)>ge&&this._append`L${t+_*u},${e+_*c}`,this._append`A${o},${o},0,0,${+(c*f>u*p)},${this._x1=t+b*a},${this._y1=e+b*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,i,o,r){if(t=+t,e=+e,r=!!r,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),a=n*Math.sin(i),l=t+s,u=e+a,c=1^r,h=r?i-o:o-i;null===this._x1?this._append`M${l},${u}`:(Math.abs(this._x1-l)>ge||Math.abs(this._y1-u)>ge)&&this._append`L${l},${u}`,n&&(h<0&&(h=h%de+de),h>me?this._append`A${n},${n},0,1,${c},${t-s},${e-a}A${n},${n},0,1,${c},${this._x1=l},${this._y1=u}`:h>ge&&this._append`A${n},${n},0,${+(h>=pe)},${c},${this._x1=t+n*Math.cos(o)},${this._y1=e+n*Math.sin(o)}`)}rect(t,e,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function _e(t){this._context=t}function be(t){return new _e(t)}function we(t){return t[0]}function Ee(t){return t[1]}function xe(t,e){var n=fe(!0),i=null,o=be,r=null,s=function(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new ye(e)}(a);function a(a){var l,u,c,h=(a=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(a)).length,f=!1;for(null==i&&(r=o(c=s())),l=0;l<=h;++l)!(l<h&&n(u=a[l],l,a))===f&&((f=!f)?r.lineStart():r.lineEnd()),f&&r.point(+t(u,l,a),+e(u,l,a));if(c)return r=null,c+""||null}return t="function"==typeof t?t:void 0===t?we:fe(t),e="function"==typeof e?e:void 0===e?Ee:fe(e),a.x=function(e){return arguments.length?(t="function"==typeof e?e:fe(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:fe(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:fe(!!t),a):n},a.curve=function(t){return arguments.length?(o=t,null!=i&&(r=o(i)),a):o},a.context=function(t){return arguments.length?(null==t?i=r=null:r=o(i=t),a):i},a}_e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var ke,Me=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("width",n.global.config.style.tooltip.width),n.attr("height",n.global.config.style.tooltip.height),n.attr("x",0),n.attr("y",0),n.attr("rx",3),n.attr("ry",3),xe().x(function(t){return t.x}).y(function(t){return t.y}),n.attr("fill",n.global.config.style.tooltip.bg),n.attr("stroke","rgba(0,0,0,0.3)"),n.attr("stroke-width","1px"),n.attr("opacity",.8),n}return gt(e,t),e.prototype.update=function(){return this.updateChilds(),this},e.prototype.afterGenerate=function(){this.node.style("pointer-events","none")},e=mt([Lt({tag:"rect",class:"tooltip-rect",autoGenerate:!1}),vt("design:paramtypes",[Le])],e)}(Tt),Te=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("x",6),n.attr("y",21),n.attr("fill",n.global.config.style.tooltip.color),n}return gt(e,t),e.prototype.update=function(){return this.updateChilds(),this},e.prototype.afterGenerate=function(){this.node.style("pointer-events","none"),this.node.style("font-size","12px")},e.prototype.generateTitle=function(){this.node.selectAll("tspan").remove().data(this.title).enter().append("tspan").text(function(t){return t}).attr("x",6).attr("y",function(t,e){return 16*e+16})},e=mt([Lt({tag:"text",class:"tooltip-title",autoGenerate:!1}),vt("design:paramtypes",[Le])],e)}(Tt),Le=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("transform","translate(0,0)"),n.attr("opacity",0),n.activeSeat=null,n.global.eventManager.addEventListener([St.MOUSEMOVE_SEAT],function(t){n.global.multi_select||n.activeSeat!==t&&t.item.title&&(n.activeSeat=t,n.setTitle(t.item.title.split("\n")),n.title.generateTitle())}),n.global.eventManager.addEventListener([St.MOUSEOUT_SEAT],function(t){n.node.attr("opacity",0),n.activeSeat=null,n.title.title=[],n.title.generateTitle()}),n.global.eventManager.addEventListener([St.TOUCHSTART_BLOCK],function(t){n.node.attr("opacity",0)}),n}return gt(e,t),e.prototype.setTitle=function(t){return this.title.title=t,this},e.prototype.update=function(){return this.rect=new Me(this).addTo(this),this.title=new Te(this).addTo(this),this.updateChilds(),this},e.prototype.afterGenerate=function(){var t=this;this.parent.node.on("mousemove.seat",function(e){if(!t.global.multi_select)if(t.global.zoomManager.zoomLevel===At.SEAT&&null!==t.activeSeat){var n=pt(e,this),i=n[0]-t.global.config.style.tooltip.width/2,o=n[1]-(t.global.config.style.tooltip.height+t.global.config.style.seat.radius+2);t.node.attr("transform","translate("+[i,o]+")").attr("opacity",1)}else t.node.attr("opacity",0)})},e=mt([Lt({tag:"g",class:"seatmap-tooltip",autoGenerate:!1}),vt("design:paramtypes",[ze])],e)}(Tt),ze=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.global.eventManager.addEventListener(St.ZOOM_LEVEL_CHANGE,function(t){n.node.classed("zoom-level-"+At.SEAT,!1),n.node.classed("zoom-level-"+At.BLOCK,!1),n.node.classed("zoom-level-"+At.VENUE,!1),n.node.classed("zoom-level-"+t.level,!0)}),n}return gt(e,t),e.prototype.update=function(){var t=this;this.stage=new re(this).addToParent(),this.zoomOutBg=new se(this).addToParent(),this.global.config.legend&&(this.legend=new he(this).addToParent()),this.tooltip=new Le(this).addToParent(),this.updateChilds(),this.stage.node.raise(),this.global.config.legend&&this.legend.node.raise(),this.tooltip.node.raise(),this.node.on("mousemove",function(e){var n=pt(e,t.stage.node.node());t.parent.eventManager.dispatch(St.MOUSE_MOVE,n)})},e=mt([Lt({tag:"svg",class:"seatmap-svg",autoGenerate:!1}),vt("design:paramtypes",[io])],e)}(Tt),Ce=function(){function t(t){this.context=t}return t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.log(t),this},t}();!function(t){t.SEATMAP="seatmap",t.PRETIX="pretix"}(ke||(ke={}));var Se=function(){function t(t){this._self=t,this.blocks=[],this.eventManager=t.eventManager,this.addEventListener=t.eventManager.addEventListener}return t.prototype.addBlock=function(t){return this.blocks.push(new Vt(t)),this.eventManager.dispatch(St.ADD_BLOCK,[t]),this.eventManager.dispatch(St.UPDATE_BLOCK,this.blocks),this},t.prototype.addBulkBlock=function(t){var e=this;if(this._self.config.json_model!==ke.SEATMAP){var n=this._self.config.json_model;t=this._self.parsers[n].parse(t)}return t.map(function(t){e.blocks.push(new Vt(t))}),this.eventManager.dispatch(St.ADD_BLOCK,[t]),this.eventManager.dispatch(St.UPDATE_BLOCK,this.blocks),this},t.prototype.replaceData=function(t){return this.blocks=[],this.addBulkBlock(t),this},t.prototype.getBlock=function(t){var e=this.blocks.find(function(e){return e.id===t});return e||null},t.prototype.getBlocks=function(t){if(t){var e=this.getBlock(t);return e?[e]:[]}return this.blocks},t.prototype.removeBlock=function(t){var e=this;return this.filterBlock({id:t}).map(function(t,n){e.blocks.splice(n,1)}),this.eventManager.dispatch(St.REMOVE_BLOCK,t),this.eventManager.dispatch(St.UPDATE_BLOCK,this.blocks),this},t.prototype.getSeat=function(t,e){var n=this.getBlock(e);if(n){var i=n.seats.find(function(e){return e.id==t});return i||null}return console.error(new Error("Block not found!")),null},t.prototype.getSelectedSeats=function(t){var e=this.getBlocks(t),n=[];return e.forEach(function(t){t.seats.forEach(function(t){t.selected&&n.push(t)})}),n},t.prototype.filterBlock=function(t){return this.blocks.filter(function(e){return e.id===t.id})},t.prototype.toJson=function(){return{blocks:this.blocks}},t}(),Ae=function(){this.radius=12,this.color="#77b2ff",this.not_salable="#6293d2",this.selected="#4770ff",this.hover="#4770ff",this.focus="#6293d2",this.focus_out="#ff001c",this.check_color="#ffffff",this.check_icon="",this.check_icon_color="#ffffff",this.svg=null},Oe=function(){this.fill="#ffffff",this.stroke="#ffffff",this.border_width=4,this.title_color="#000000",this.title_font_size=28},Be=function(){this.radius=12,this.padding=36,this.font_size=12,this.font_color="#000"},Ne=function(){this.color="#000000",this.bg="#fff",this.font_size=12,this.radius=12},Ue=function(){this.border_width=1,this.width=140,this.height=58,this.color="#000000",this.bg="#ffffff"},$e=function(){},Ve=function(){function t(t){this.min_zoom=.1,this.max_zoom=1.9,this.animation_speed=600,this.resizable=!1,this.container=null,this.zoom_focus_circle_radius=60,this.click_enable_sold_seats=!1,this.legend=!1,this.canvas_stageout_control=!0,this.json_model=ke.SEATMAP,this.json_model=t.json_model?t.json_model:ke.SEATMAP,this.zoom_focus_circle_radius=t.zoom_focus_circle_radius?t.zoom_focus_circle_radius:this.zoom_focus_circle_radius,this.click_enable_sold_seats=t.click_enable_sold_seats?t.click_enable_sold_seats:this.click_enable_sold_seats,this.max_zoom=t.max_zoom?t.max_zoom:this.max_zoom,this.resizable=t.resizable?t.resizable:this.resizable,this.zoom_out_button=t.zoom_out_button?t.zoom_out_button:".zoom-out-button",this.legend=0!=t.legend||t.legend,this.canvas_stageout_control=0!=t.canvas_stageout_control||t.canvas_stageout_control,this.style=new $e,this.style.seat=Object.assign(new Ae,t.style.seat),this.style.block=Object.assign(new Oe,t.style.block),this.style.legend=Object.assign(new Be,t.style.legend),this.style.label=Object.assign(new Ne,t.style.label),this.style.tooltip=Object.assign(new Ue,t.style.tooltip),t.style,this.lang={selectable:t.lang&&t.lang.selectable||"Selectable",non_selectable:t.lang&&t.lang.non_selectable||"Non Selectable or Rezerved",your_selection:t.lang&&t.lang.your_selection||"Your Selection"}}return t.prototype.getAll=function(){return this},t}(),Ie={value:()=>{}};function Ke(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new Ge(i)}function Ge(t){this._=t}function Pe(t,e){for(var n,i=0,o=t.length;i<o;++i)if((n=t[i]).name===e)return n.value}function De(t,e,n){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=Ie,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}Ge.prototype=Ke.prototype={constructor:Ge,on:function(t,e){var n,i,o=this._,r=(i=o,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),s=-1,a=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s<a;)if(n=(t=r[s]).type)o[n]=De(o[n],t.name,e);else if(null==e)for(n in o)o[n]=De(o[n],t.name,null);return this}for(;++s<a;)if((n=(t=r[s]).type)&&(n=Pe(o[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ge(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,o=new Array(n),r=0;r<n;++r)o[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=0,n=(i=this._[t]).length;r<n;++r)i[r].value.apply(e,o)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],o=0,r=i.length;o<r;++o)i[o].value.apply(e,n)}};const je={capture:!0,passive:!1};function Re(t){t.preventDefault(),t.stopImmediatePropagation()}function Ze(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function He(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Ye(){}var qe=.7,Xe=1/qe,We="\\s*([+-]?\\d+)\\s*",Fe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qe=/^#([0-9a-f]{3,8})$/,tn=new RegExp(`^rgb\\(${We},${We},${We}\\)$`),en=new RegExp(`^rgb\\(${Je},${Je},${Je}\\)$`),nn=new RegExp(`^rgba\\(${We},${We},${We},${Fe}\\)$`),on=new RegExp(`^rgba\\(${Je},${Je},${Je},${Fe}\\)$`),rn=new RegExp(`^hsl\\(${Fe},${Je},${Je}\\)$`),sn=new RegExp(`^hsla\\(${Fe},${Je},${Je},${Fe}\\)$`),an={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ln(){return this.rgb().formatHex()}function un(){return this.rgb().formatRgb()}function cn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Qe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?hn(e):3===n?new dn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?fn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?fn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=tn.exec(t))?new dn(e[1],e[2],e[3],1):(e=en.exec(t))?new dn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=nn.exec(t))?fn(e[1],e[2],e[3],e[4]):(e=on.exec(t))?fn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=rn.exec(t))?bn(e[1],e[2]/100,e[3]/100,1):(e=sn.exec(t))?bn(e[1],e[2]/100,e[3]/100,e[4]):an.hasOwnProperty(t)?hn(an[t]):"transparent"===t?new dn(NaN,NaN,NaN,0):null}function hn(t){return new dn(t>>16&255,t>>8&255,255&t,1)}function fn(t,e,n,i){return i<=0&&(t=e=n=NaN),new dn(t,e,n,i)}function pn(t,e,n,i){return 1===arguments.length?((o=t)instanceof Ye||(o=cn(o)),o?new dn((o=o.rgb()).r,o.g,o.b,o.opacity):new dn):new dn(t,e,n,null==i?1:i);var o}function dn(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function gn(){return`#${_n(this.r)}${_n(this.g)}${_n(this.b)}`}function mn(){const t=vn(this.opacity);return`${1===t?"rgb(":"rgba("}${yn(this.r)}, ${yn(this.g)}, ${yn(this.b)}${1===t?")":`, ${t})`}`}function vn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function yn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _n(t){return((t=yn(t))<16?"0":"")+t.toString(16)}function bn(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new En(t,e,n,i)}function wn(t){if(t instanceof En)return new En(t.h,t.s,t.l,t.opacity);if(t instanceof Ye||(t=cn(t)),!t)return new En;if(t instanceof En)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,o=Math.min(e,n,i),r=Math.max(e,n,i),s=NaN,a=r-o,l=(r+o)/2;return a?(s=e===r?(n-i)/a+6*(n<i):n===r?(i-e)/a+2:(e-n)/a+4,a/=l<.5?r+o:2-r-o,s*=60):a=l>0&&l<1?0:s,new En(s,a,l,t.opacity)}function En(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function xn(t){return(t=(t||0)%360)<0?t+360:t}function kn(t){return Math.max(0,Math.min(1,t||0))}function Mn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Ze(Ye,cn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ln,formatHex:ln,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return wn(this).formatHsl()},formatRgb:un,toString:un}),Ze(dn,pn,He(Ye,{brighter(t){return t=null==t?Xe:Math.pow(Xe,t),new dn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?qe:Math.pow(qe,t),new dn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new dn(yn(this.r),yn(this.g),yn(this.b),vn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gn,formatHex:gn,formatHex8:function(){return`#${_n(this.r)}${_n(this.g)}${_n(this.b)}${_n(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:mn,toString:mn})),Ze(En,function(t,e,n,i){return 1===arguments.length?wn(t):new En(t,e,n,null==i?1:i)},He(Ye,{brighter(t){return t=null==t?Xe:Math.pow(Xe,t),new En(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?qe:Math.pow(qe,t),new En(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,o=2*n-i;return new dn(Mn(t>=240?t-240:t+120,o,i),Mn(t,o,i),Mn(t<120?t+240:t-120,o,i),this.opacity)},clamp(){return new En(xn(this.h),kn(this.s),kn(this.l),vn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=vn(this.opacity);return`${1===t?"hsl(":"hsla("}${xn(this.h)}, ${100*kn(this.s)}%, ${100*kn(this.l)}%${1===t?")":`, ${t})`}`}}));var Tn=t=>()=>t;function Ln(t){return 1===(t=+t)?zn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Tn(isNaN(e)?n:e)}}function zn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Tn(isNaN(t)?e:t)}var Cn=function t(e){var n=Ln(e);function i(t,e){var i=n((t=pn(t)).r,(e=pn(e)).r),o=n(t.g,e.g),r=n(t.b,e.b),s=zn(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=o(e),t.b=r(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function Sn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var An=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,On=new RegExp(An.source,"g");function Bn(t,e){var n,i,o,r=An.lastIndex=On.lastIndex=0,s=-1,a=[],l=[];for(t+="",e+="";(n=An.exec(t))&&(i=On.exec(e));)(o=i.index)>r&&(o=e.slice(r,o),a[s]?a[s]+=o:a[++s]=o),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Sn(n,i)})),r=On.lastIndex;return r<e.length&&(o=e.slice(r),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)a[(n=l[i]).i]=n.x(t);return a.join("")})}var Nn,Un=180/Math.PI,$n={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Vn(t,e,n,i,o,r){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:o,translateY:r,rotate:Math.atan2(e,t)*Un,skewX:Math.atan(l)*Un,scaleX:s,scaleY:a}}function In(t,e,n,i){function o(t){return t.length?t.pop()+" ":""}return function(r,s){var a=[],l=[];return r=t(r),s=t(s),function(t,i,o,r,s,a){if(t!==o||i!==r){var l=s.push("translate(",null,e,null,n);a.push({i:l-4,x:Sn(t,o)},{i:l-2,x:Sn(i,r)})}else(o||r)&&s.push("translate("+o+e+r+n)}(r.translateX,r.translateY,s.translateX,s.translateY,a,l),function(t,e,n,r){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),r.push({i:n.push(o(n)+"rotate(",null,i)-2,x:Sn(t,e)})):e&&n.push(o(n)+"rotate("+e+i)}(r.rotate,s.rotate,a,l),function(t,e,n,r){t!==e?r.push({i:n.push(o(n)+"skewX(",null,i)-2,x:Sn(t,e)}):e&&n.push(o(n)+"skewX("+e+i)}(r.skewX,s.skewX,a,l),function(t,e,n,i,r,s){if(t!==n||e!==i){var a=r.push(o(r)+"scale(",null,",",null,")");s.push({i:a-4,x:Sn(t,n)},{i:a-2,x:Sn(e,i)})}else 1===n&&1===i||r.push(o(r)+"scale("+n+","+i+")")}(r.scaleX,r.scaleY,s.scaleX,s.scaleY,a,l),r=s=null,function(t){for(var e,n=-1,i=l.length;++n<i;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var Kn=In(function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?$n:Vn(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),Gn=In(function(t){return null==t?$n:(Nn||(Nn=document.createElementNS("http://www.w3.org/2000/svg","g")),Nn.setAttribute("transform",t),(t=Nn.transform.baseVal.consolidate())?Vn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):$n)},", ",")",")");function Pn(t){return((t=Math.exp(t))+1/t)/2}var Dn,jn,Rn=function t(e,n,i){function o(t,o){var r,s,a=t[0],l=t[1],u=t[2],c=o[0],h=o[1],f=o[2],p=c-a,d=h-l,g=p*p+d*d;if(g<1e-12)s=Math.log(f/u)/e,r=function(t){return[a+t*p,l+t*d,u*Math.exp(e*t*s)]};else{var m=Math.sqrt(g),v=(f*f-u*u+i*g)/(2*u*n*m),y=(f*f-u*u-i*g)/(2*f*n*m),_=Math.log(Math.sqrt(v*v+1)-v),b=Math.log(Math.sqrt(y*y+1)-y);s=(b-_)/e,r=function(t){var i=t*s,o=Pn(_),r=u/(n*m)*(o*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(e*i+_)-function(t){return((t=Math.exp(t))-1/t)/2}(_));return[a+r*p,l+r*d,u*o/Pn(e*i+_)]}}return r.duration=1e3*s*e/Math.SQRT2,r}return o.rho=function(e){var n=Math.max(.001,+e),i=n*n;return t(n,i,i*i)},o}(Math.SQRT2,2,4),Zn=0,Hn=0,Yn=0,qn=0,Xn=0,Wn=0,Fn="object"==typeof performance&&performance.now?performance:Date,Jn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Qn(){return Xn||(Jn(ti),Xn=Fn.now()+Wn)}function ti(){Xn=0}function ei(){this._call=this._time=this._next=null}function ni(t,e,n){var i=new ei;return i.restart(t,e,n),i}function ii(){Xn=(qn=Fn.now())+Wn,Zn=Hn=0;try{!function(){Qn(),++Zn;for(var t,e=Dn;e;)(t=Xn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Zn}()}finally{Zn=0,function(){var t,e,n=Dn,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Dn=e);jn=t,ri(i)}(),Xn=0}}function oi(){var t=Fn.now(),e=t-qn;e>1e3&&(Wn-=e,qn=t)}function ri(t){Zn||(Hn&&(Hn=clearTimeout(Hn)),t-Xn>24?(t<1/0&&(Hn=setTimeout(ii,t-Fn.now()-Wn)),Yn&&(Yn=clearInterval(Yn))):(Yn||(qn=Fn.now(),Yn=setInterval(oi,1e3)),Zn=1,Jn(ii)))}function si(t,e,n){var i=new ei;return e=null==e?0:+e,i.restart(n=>{i.stop(),t(n+e)},e,n),i}ei.prototype=ni.prototype={constructor:ei,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Qn():+n)+(null==e?0:+e),this._next||jn===this||(jn?jn._next=this:Dn=this,jn=this),this._call=t,this._time=n,ri()},stop:function(){this._call&&(this._call=null,this._time=1/0,ri())}};var ai=Ke("start","end","cancel","interrupt"),li=[];function ui(t,e,n,i,o,r){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var i,o=t.__transition;function r(t){n.state=1,n.timer.restart(s,n.delay,n.time),n.delay<=t&&s(t-n.delay)}function s(r){var u,c,h,f;if(1!==n.state)return l();for(u in o)if((f=o[u]).name===n.name){if(3===f.state)return si(s);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete o[u]):+u<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete o[u])}if(si(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(r))}),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(h=n.tween.length),u=0,c=-1;u<h;++u)(f=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=f);i.length=c+1}}function a(e){for(var o=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(l),n.state=5,1),r=-1,s=i.length;++r<s;)i[r].call(t,o);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){for(var i in n.state=6,n.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=n,n.timer=ni(r,0,n.time)}(t,n,{name:e,index:i,group:o,on:ai,tween:li,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:0})}function ci(t,e){var n=fi(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function hi(t,e){var n=fi(t,e);if(n.state>3)throw new Error("too late; already running");return n}function fi(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function pi(t,e){var n,i,o,r=t.__transition,s=!0;if(r){for(o in e=null==e?null:e+"",r)(n=r[o]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[o]):s=!1;s&&delete t.__transition}}function di(t,e){var n,i;return function(){var o=hi(this,t),r=o.tween;if(r!==n)for(var s=0,a=(i=n=r).length;s<a;++s)if(i[s].name===e){(i=i.slice()).splice(s,1);break}o.tween=i}}function gi(t,e,n){var i,o;if("function"!=typeof n)throw new Error;return function(){var r=hi(this,t),s=r.tween;if(s!==i){o=(i=s).slice();for(var a={name:e,value:n},l=0,u=o.length;l<u;++l)if(o[l].name===e){o[l]=a;break}l===u&&o.push(a)}r.tween=o}}function mi(t,e,n){var i=t._id;return t.each(function(){var t=hi(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return fi(t,i).value[e]}}function vi(t,e){var n;return("number"==typeof e?Sn:e instanceof cn?Cn:(n=cn(e))?(e=n,Cn):Bn)(t,e)}function yi(t){return function(){this.removeAttribute(t)}}function _i(t){return function(){this.removeAttributeNS(t.space,t.local)}}function bi(t,e,n){var i,o,r=n+"";return function(){var s=this.getAttribute(t);return s===r?null:s===i?o:o=e(i=s,n)}}function wi(t,e,n){var i,o,r=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===r?null:s===i?o:o=e(i=s,n)}}function Ei(t,e,n){var i,o,r;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttribute(t))===(a=l+"")?null:s===i&&a===o?r:(o=a,r=e(i=s,l));this.removeAttribute(t)}}function xi(t,e,n){var i,o,r;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:s===i&&a===o?r:(o=a,r=e(i=s,l));this.removeAttributeNS(t.space,t.local)}}function ki(t,e){var n,i;function o(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,o)),n}return o._value=e,o}function Mi(t,e){var n,i;function o(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,o)),n}return o._value=e,o}function Ti(t,e){return function(){ci(this,t).delay=+e.apply(this,arguments)}}function Li(t,e){return e=+e,function(){ci(this,t).delay=e}}function zi(t,e){return function(){hi(this,t).duration=+e.apply(this,arguments)}}function Ci(t,e){return e=+e,function(){hi(this,t).duration=e}}var Si=ht.prototype.constructor;function Ai(t){return function(){this.style.removeProperty(t)}}var Oi=0;function Bi(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Ni(){return++Oi}var Ui=ht.prototype;Bi.prototype={constructor:Bi,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=a(t));for(var i=this._groups,o=i.length,r=new Array(o),s=0;s<o;++s)for(var l,u,c=i[s],h=c.length,f=r[s]=new Array(h),p=0;p<h;++p)(l=c[p])&&(u=t.call(l,l.__data__,p,c))&&("__data__"in l&&(u.__data__=l.__data__),f[p]=u,ui(f[p],e,n,p,f,fi(l,n)));return new Bi(r,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=u(t));for(var i=this._groups,o=i.length,r=[],s=[],a=0;a<o;++a)for(var l,c=i[a],h=c.length,f=0;f<h;++f)if(l=c[f]){for(var p,d=t.call(l,l.__data__,f,c),g=fi(l,n),m=0,v=d.length;m<v;++m)(p=d[m])&&ui(p,e,n,m,d,g);r.push(d),s.push(l)}return new Bi(r,s,e,n)},selectChild:Ui.selectChild,selectChildren:Ui.selectChildren,filter:function(t){"function"!=typeof t&&(t=h(t));for(var e=this._groups,n=e.length,i=new Array(n),o=0;o<n;++o)for(var r,s=e[o],a=s.length,l=i[o]=[],u=0;u<a;++u)(r=s[u])&&t.call(r,r.__data__,u,s)&&l.push(r);return new Bi(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,o=n.length,r=Math.min(i,o),s=new Array(i),a=0;a<r;++a)for(var l,u=e[a],c=n[a],h=u.length,f=s[a]=new Array(h),p=0;p<h;++p)(l=u[p]||c[p])&&(f[p]=l);for(;a<i;++a)s[a]=e[a];return new Bi(s,this._parents,this._name,this._id)},selection:function(){return new Si(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Ni(),i=this._groups,o=i.length,r=0;r<o;++r)for(var s,a=i[r],l=a.length,u=0;u<l;++u)if(s=a[u]){var c=fi(s,e);ui(s,t,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Bi(i,this._parents,t,n)},call:Ui.call,nodes:Ui.nodes,node:Ui.node,size:Ui.size,empty:Ui.empty,each:Ui.each,on:function(t,e){var n=this._id;return arguments.length<2?fi(this.node(),n).on.on(t):this.each(function(t,e,n){var i,o,r=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?ci:hi;return function(){var s=r(this,t),a=s.on;a!==i&&(o=(i=a).copy()).on(e,n),s.on=o}}(n,t,e))},attr:function(t,e){var i=n(t),o="transform"===i?Gn:vi;return this.attrTween(t,"function"==typeof e?(i.local?xi:Ei)(i,o,mi(this,"attr."+t,e)):null==e?(i.local?_i:yi)(i):(i.local?wi:bi)(i,o,e))},attrTween:function(t,e){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;var o=n(t);return this.tween(i,(o.local?ki:Mi)(o,e))},style:function(t,e,n){var i="transform"==(t+="")?Kn:vi;return null==e?this.styleTween(t,function(t,e){var n,i,o;return function(){var r=N(this,t),s=(this.style.removeProperty(t),N(this,t));return r===s?null:r===n&&s===i?o:o=e(n=r,i=s)}}(t,i)).on("end.style."+t,Ai(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,o,r;return function(){var s=N(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=N(this,t)),s===l?null:s===i&&l===o?r:(o=l,r=e(i=s,a))}}(t,i,mi(this,"style."+t,e))).each(function(t,e){var n,i,o,r,s="style."+e,a="end."+s;return function(){var l=hi(this,t),u=l.on,c=null==l.value[s]?r||(r=Ai(e)):void 0;u===n&&o===c||(i=(n=u).copy()).on(a,o=c),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,o,r=n+"";return function(){var s=N(this,t);return s===r?null:s===i?o:o=e(i=s,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){var i,o;function r(){var r=e.apply(this,arguments);return r!==o&&(i=(o=r)&&function(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,r,n)),i}return r._value=e,r}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(mi(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,o=fi(this.node(),n).tween,r=0,s=o.length;r<s;++r)if((i=o[r]).name===t)return i.value;return null}return this.each((null==e?di:gi)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Ti:Li)(e,t)):fi(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?zi:Ci)(e,t)):fi(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){hi(this,t).ease=e}}(e,t)):fi(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;hi(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,o=n.size();return new Promise(function(r,s){var a={value:s},l={value:function(){0===--o&&r()}};n.each(function(){var n=hi(this,i),o=n.on;o!==t&&((e=(t=o).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),n.on=e}),0===o&&r()})},[Symbol.iterator]:Ui[Symbol.iterator]};var $i={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Vi(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}ht.prototype.interrupt=function(t){return this.each(function(){pi(this,t)})},ht.prototype.transition=function(t){var e,n;t instanceof Bi?(e=t._id,t=t._name):(e=Ni(),(n=$i).time=Qn(),t=null==t?null:t+"");for(var i=this._groups,o=i.length,r=0;r<o;++r)for(var s,a=i[r],l=a.length,u=0;u<l;++u)(s=a[u])&&ui(s,t,e,u,a,n||Vi(s,e));return new Bi(i,this._parents,t,e)};var Ii=t=>()=>t;function Ki(t,{sourceEvent:e,target:n,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Gi(t,e,n){this.k=t,this.x=e,this.y=n}Gi.prototype={constructor:Gi,scale:function(t){return 1===t?this:new Gi(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Gi(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Pi=new Gi(1,0,0);function Di(t){t.stopImmediatePropagation()}function ji(t){t.preventDefault(),t.stopImmediatePropagation()}function Ri(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Zi(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Hi(){return this.__zoom||Pi}function Yi(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function qi(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xi(t,e,n){var i=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],r=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function Wi(){var t,e,n,i=Ri,o=Zi,r=Xi,s=Yi,a=qi,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,h=Rn,f=Ke("start","zoom","end"),p=0,d=10;function g(t){t.property("__zoom",Hi).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",x).on("dblclick.zoom",k).filter(a).on("touchstart.zoom",M).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new Gi(e,t.x,t.y)}function v(t,e,n){var i=e[0]-n[0]*t.k,o=e[1]-n[1]*t.k;return i===t.x&&o===t.y?t:new Gi(t.k,i,o)}function y(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function _(t,e,n,i){t.on("start.zoom",function(){b(this,arguments).event(i).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).event(i).end()}).tween("zoom",function(){var t=this,r=arguments,s=b(t,r).event(i),a=o.apply(t,r),l=null==n?y(a):"function"==typeof n?n.apply(t,r):n,u=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),c=t.__zoom,f="function"==typeof e?e.apply(t,r):e,p=h(c.invert(l).concat(u/c.k),f.invert(l).concat(u/f.k));return function(t){if(1===t)t=f;else{var e=p(t),n=u/e[2];t=new Gi(n,l[0]-e[0]*n,l[1]-e[1]*n)}s.zoom(null,t)}})}function b(t,e,n){return!n&&t.__zooming||new w(t,e)}function w(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(t,e),this.taps=0}function E(t,...e){if(i.apply(this,arguments)){var n=b(this,e).event(t),o=this.__zoom,a=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,s.apply(this,arguments)))),c=pt(t);if(n.wheel)n.mouse[0][0]===c[0]&&n.mouse[0][1]===c[1]||(n.mouse[1]=o.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(o.k===a)return;n.mouse=[c,o.invert(c)],pi(this),n.start()}ji(t),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",r(v(m(o,a),n.mouse[0],n.mouse[1]),n.extent,u))}}function x(t,...e){if(!n&&i.apply(this,arguments)){var o=t.currentTarget,s=b(this,e,!0).event(t),a=ft(t.view).on("mousemove.zoom",function(t){if(ji(t),!s.moved){var e=t.clientX-c,n=t.clientY-h;s.moved=e*e+n*n>p}s.event(t).zoom("mouse",r(v(s.that.__zoom,s.mouse[0]=pt(t,o),s.mouse[1]),s.extent,u))},!0).on("mouseup.zoom",function(t){a.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,i=ft(t).on("dragstart.drag",null);e&&(i.on("click.drag",Re,je),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(t.view,s.moved),ji(t),s.event(t).end()},!0),l=pt(t,o),c=t.clientX,h=t.clientY;!function(t){var e=t.document.documentElement,n=ft(t).on("dragstart.drag",Re,je);"onselectstart"in e?n.on("selectstart.drag",Re,je):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),Di(t),s.mouse=[l,this.__zoom.invert(l)],pi(this),s.start()}}function k(t,...e){if(i.apply(this,arguments)){var n=this.__zoom,s=pt(t.changedTouches?t.changedTouches[0]:t,this),a=n.invert(s),l=n.k*(t.shiftKey?.5:2),h=r(v(m(n,l),s,a),o.apply(this,e),u);ji(t),c>0?ft(this).transition().duration(c).call(_,h,s,t):ft(this).call(g.transform,h,s,t)}}function M(n,...o){if(i.apply(this,arguments)){var r,s,a,l,u=n.touches,c=u.length,h=b(this,o,n.changedTouches.length===c).event(n);for(Di(n),s=0;s<c;++s)l=[l=pt(a=u[s],this),this.__zoom.invert(l),a.identifier],h.touch0?h.touch1||h.touch0[2]===l[2]||(h.touch1=l,h.taps=0):(h.touch0=l,r=!0,h.taps=1+!!t);t&&(t=clearTimeout(t)),r&&(h.taps<2&&(e=l[0],t=setTimeout(function(){t=null},500)),pi(this),h.start())}}function T(t,...e){if(this.__zooming){var n,i,o,s,a=b(this,e).event(t),l=t.changedTouches,c=l.length;for(ji(t),n=0;n<c;++n)o=pt(i=l[n],this),a.touch0&&a.touch0[2]===i.identifier?a.touch0[0]=o:a.touch1&&a.touch1[2]===i.identifier&&(a.touch1[0]=o);if(i=a.that.__zoom,a.touch1){var h=a.touch0[0],f=a.touch0[1],p=a.touch1[0],d=a.touch1[1],g=(g=p[0]-h[0])*g+(g=p[1]-h[1])*g,y=(y=d[0]-f[0])*y+(y=d[1]-f[1])*y;i=m(i,Math.sqrt(g/y)),o=[(h[0]+p[0])/2,(h[1]+p[1])/2],s=[(f[0]+d[0])/2,(f[1]+d[1])/2]}else{if(!a.touch0)return;o=a.touch0[0],s=a.touch0[1]}a.zoom("touch",r(v(i,o,s),a.extent,u))}}function L(t,...i){if(this.__zooming){var o,r,s=b(this,i).event(t),a=t.changedTouches,l=a.length;for(Di(t),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<l;++o)r=a[o],s.touch0&&s.touch0[2]===r.identifier?delete s.touch0:s.touch1&&s.touch1[2]===r.identifier&&delete s.touch1;if(s.touch1&&!s.touch0&&(s.touch0=s.touch1,delete s.touch1),s.touch0)s.touch0[1]=this.__zoom.invert(s.touch0[0]);else if(s.end(),2===s.taps&&(r=pt(r,this),Math.hypot(e[0]-r[0],e[1]-r[1])<d)){var u=ft(this).on("dblclick.zoom");u&&u.apply(this,arguments)}}}return g.transform=function(t,e,n,i){var o=t.selection?t.selection():t;o.property("__zoom",Hi),t!==o?_(t,e,n,i):o.interrupt().each(function(){b(this,arguments).event(i).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()})},g.scaleBy=function(t,e,n,i){g.scaleTo(t,function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)},n,i)},g.scaleTo=function(t,e,n,i){g.transform(t,function(){var t=o.apply(this,arguments),i=this.__zoom,s=null==n?y(t):"function"==typeof n?n.apply(this,arguments):n,a=i.invert(s),l="function"==typeof e?e.apply(this,arguments):e;return r(v(m(i,l),s,a),t,u)},n,i)},g.translateBy=function(t,e,n,i){g.transform(t,function(){return r(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),u)},null,i)},g.translateTo=function(t,e,n,i,s){g.transform(t,function(){var t=o.apply(this,arguments),s=this.__zoom,a=null==i?y(t):"function"==typeof i?i.apply(this,arguments):i;return r(Pi.translate(a[0],a[1]).scale(s.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,u)},i,s)},w.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=ft(this.that).datum();f.call(t,this.that,new Ki(t,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:f}),e)}},g.wheelDelta=function(t){return arguments.length?(s="function"==typeof t?t:Ii(+t),g):s},g.filter=function(t){return arguments.length?(i="function"==typeof t?t:Ii(!!t),g):i},g.touchable=function(t){return arguments.length?(a="function"==typeof t?t:Ii(!!t),g):a},g.extent=function(t){return arguments.length?(o="function"==typeof t?t:Ii([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):o},g.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],g):[l[0],l[1]]},g.translateExtent=function(t){return arguments.length?(u[0][0]=+t[0][0],u[1][0]=+t[1][0],u[0][1]=+t[0][1],u[1][1]=+t[1][1],g):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},g.constrain=function(t){return arguments.length?(r=t,g):r},g.duration=function(t){return arguments.length?(c=+t,g):c},g.interpolate=function(t){return arguments.length?(h=t,g):h},g.on=function(){var t=f.on.apply(f,arguments);return t===f?g:t},g.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,g):Math.sqrt(p)},g.tapDistance=function(t){return arguments.length?(d=+t,g):d},g}Gi.prototype;var Fi=function(){function t(t){this._self=t,this.zoomTypes={normal:null,animated:null,fastAnimated:null},this.scale={x:null,y:null,k:null},this.zoomLevels={VENUE:null,BLOCK:null,SEAT:null},this.minZoom=null,this.lastPointer=null,this.activeBlocks=[],this.zoomLevel=At.VENUE,this.dispatchZoomEvent()}return t.prototype.init=function(){var t=this;console.log("zoom init"),this.calculateZoomLevels(),this.zoomInit(),this._self.eventManager.addEventListener(St.MOUSE_MOVE,function(e){t.lastPointer=e}),this._self.eventManager.addEventListener(St.KEYDOWN_SVG,function(e){var n;17!=e.which&&91!==e.which||(t._self.eventManager.dispatch(St.MULTI_SELECT_ENABLE,e),null===(n=null==e?void 0:e.preventDefault)||void 0===n||n.call(e),t.zoomDisable())}),this._self.eventManager.addEventListener(St.KEYUP_SVG,function(e){var n;t._self.eventManager.dispatch(St.MULTI_SELECT_DISABLE,e),null===(n=null==e?void 0:e.preventDefault)||void 0===n||n.call(e),t.zoomEnable()})},t.prototype.zoomInit=function(){console.info("zoomInit"),this.zoomTypes.normal=Wi().scaleExtent([this._self.config.min_zoom,this._self.config.max_zoom]).on("end",this.zoomEnd(this)).on("zoom",this.zoomHand(this)),this.zoomTypes.animated=Wi().scaleExtent([this._self.config.min_zoom,this._self.config.max_zoom]).on("end",this.animatedZoomEnd(this)).on("zoom",this.zoomHandAnimated(this)),this.zoomTypes.fastAnimated=Wi().scaleExtent([this._self.config.min_zoom,this._self.config.max_zoom]).on("end",this.animatedFastZoomEnd(this)).on("zoom",this.zoomHandFastAnimated(this)),this._self.svg.node.call(this.zoomTypes.normal),this._self.svg.node.on("dblclick.zoom",null)},t.prototype.zoomEnd=function(t){return console.info("zoomEnd"),function(e){var n=e.transform.x,i=e.transform.y,o=e.transform.k;t._self.svg.stage.node.interrupt().attr("transform","translate("+n+","+i+")scale("+o+")"),t.calculateActiveBlocks(),t.calculateZoomLevel(o)}},t.prototype.animatedZoomEnd=function(t){return console.info("animatedZoomEnd"),function(e){var n=e.transform.x,i=e.transform.y,o=e.transform.k;t._self.svg.stage.node.interrupt().transition().duration(t._self.config.animation_speed).attr("transform","translate("+n+","+i+")scale("+o+")"),t.calculateActiveBlocks(),t.calculateZoomLevel(o)}},t.prototype.animatedFastZoomEnd=function(t){return console.info("animatedFastZoomEnd"),function(e){var n=e.transform.x,i=e.transform.y,o=e.transform.k;t._self.svg.stage.node.interrupt().transition().duration(t._self.config.animation_speed/2).attr("transform","translate("+n+","+i+")scale("+o+")"),t.calculateActiveBlocks(),t.calculateZoomLevel(o)}},t.prototype.zoomHand=function(t){return console.info("zoomHand"),function(e){var n=e.transform.x,i=e.transform.y,o=e.transform.k;t._self.svg.stage.node.interrupt().attr("transform","translate("+n+","+i+")scale("+o+")"),t.calculateZoomLevel(o)}},t.prototype.zoomHandAnimated=function(t){return console.info("zoomHandAnimated"),function(e){var n=e.transform.x,i=e.transform.y,o=e.transform.k;t._self.svg.stage.node.interrupt().transition().duration(t._self.config.animation_speed).attr("transform","translate("+n+","+i+")scale("+o+")")}},t.prototype.zoomHandFastAnimated=function(t){return console.info("zoomHandFastAnimated"),function(e){var n=e.transform.x,i=e.transform.y,o=e.transform.k;t._self.svg.stage.node.interrupt().transition().duration(t._self.config.animation_speed/2).attr("transform","translate("+n+","+i+")scale("+o+")")}},t.prototype.calculateZoomLevel=function(t){var e,n;if((null===(e=this.zoomLevels.BLOCK)||void 0===e?void 0:e.k)&&(null===(n=this.zoomLevels.VENUE)||void 0===n?void 0:n.k)){var i=this._self.config.max_zoom-.2,o=this.zoomLevels.BLOCK.k,r=this.zoomLevels.VENUE.k,s=null,a=this._self.data.getBlocks().length;t>=i?s=At.SEAT:t>=o?s=At.BLOCK:t>=r&&a>1&&(s=At.VENUE),s!==this.zoomLevel&&(this.zoomLevel=s,this.dispatchZoomEvent())}},t.prototype.canvasScopeHandler=function(){if(!1!==this._self.config.canvas_stageout_control){var t=this._self.svg.stage.blocks.node.node().getBoundingClientRect(),e=this._self.svg.node.node().getBoundingClientRect();(this.zoomLevel===At.VENUE||this.zoomLevel===At.BLOCK&&1===this._self.data.getBlocks().length||this.zoomLevel==At.SEAT&&this.zoomLevels.BLOCK&&this.zoomLevels.BLOCK.k===this._self.config.max_zoom)&&(t.left<e.left||t.top<e.top||t.right>e.right||t.bottom>e.bottom)&&this.zoomToVenue(!0,!0)}},t.prototype.calculateZoomLevels=function(t){void 0===t&&(t=this._self.data.getBlocks());var e=this._self.windowManager,n=e.stage;t.map(function(t){t.seats.map(function(e){e.x<t.x&&(t.x=e.x),e.y<t.y&&(t.y=e.y),e.x>n.width&&(n.width=e.x),e.y>n.height&&(n.height=e.y)}),t.labels.map(function(e){e.x<t.x&&(t.x=e.x),e.y<t.y&&(t.y=e.y),e.x>n.width&&(n.width=e.x),e.y>n.height&&(n.height=e.y)})}),e.width&&e.height&&(this.scale.x=e.width/n.width-e.width/n.width/5,this.scale.y=e.height/n.height-e.height/n.height/5),this.scale.k=this.scale.x<this.scale.y?this.scale.x:this.scale.y,this.minZoom=this.scale.k<1?this.scale.k:1,this.scale.k=this.scale.k>this._self.config.max_zoom?this._self.config.max_zoom:this.scale.k;var i=n.width/2,o=n.height/2;return this.zoomLevels.VENUE={x:i,y:o,k:this.scale.k-.01},1===this._self.data.getBlocks().length&&this.zoomLevels.BLOCK&&(this.zoomLevels.VENUE=this.zoomLevels.BLOCK),this},t.prototype.calculateActiveBlocks=function(t){var e=this;if(void 0===t&&(t=this._self.data.getBlocks()),this.activeBlocks=[],t.map(function(t){var n=e._self.svg.stage.blocks.getBlock(t.id);if(n){var i=n.node.node().getBoundingClientRect(),o=n.node.node().getBBox();if(t.bbox=o,e._self.windowManager.width&&e._self.windowManager.height){var r=e._self.windowManager.width/o.width-e._self.windowManager.width/o.width/3,s=e._self.windowManager.height/o.height-e._self.windowManager.height/o.height/3,a=r<s?r:s;r+=o.x+o.width/2,s+=o.y+o.height/2,a=a>e._self.config.max_zoom?e._self.config.max_zoom:a,t.zoom_bbox={x:r,y:s,k:a};var l=Math.max(0,Math.min(e._self.windowManager.width,i.right)-Math.max(0,i.left))*Math.max(0,Math.min(e._self.windowManager.height,i.bottom)-Math.max(0,i.top)),u=100*l/(e._self.windowManager.width*e._self.windowManager.height);l>0&&e.activeBlocks.push({block:n,ratio:Number(u.toFixed(2))})}}}),this.activeBlocks=this.activeBlocks.sort(function(t,e){return e.ratio-t.ratio}),this.activeBlocks.length){var n=this.activeBlocks[0].block.item;this.zoomLevels.BLOCK=n.zoom_bbox}return this.activeBlocks},t.prototype.zoomToSelection=function(t){void 0===t&&(t=!0);var e=this.lastPointer;if(e){var n=e[0],i=e[1],o=this._self.config.max_zoom;this.zoomLevels.SEAT={x:n,y:i,k:o},t?this._self.svg.node.interrupt().call(this.zoomTypes.animated.translateTo,n,i).call(this.zoomTypes.animated.scaleTo,o):this._self.svg.node.interrupt().call(this.zoomTypes.normal.translateTo,n,i).call(this.zoomTypes.normal.scaleTo,o),this.zoomLevel=At.SEAT,this.dispatchZoomEvent()}},t.prototype.zoomToBlock=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n=!1);var i=this._self.data.getBlocks().find(function(e){return e.id.toString()===t.toString()});i&&(e?n?this._self.svg.node.interrupt().call(this.zoomTypes.fastAnimated.translateTo,i.zoom_bbox.x,i.zoom_bbox.y).call(this.zoomTypes.fastAnimated.scaleTo,i.zoom_bbox.k):this._self.svg.node.interrupt().call(this.zoomTypes.animated.translateTo,i.zoom_bbox.x,i.zoom_bbox.y).call(this.zoomTypes.animated.scaleTo,i.zoom_bbox.k):this._self.svg.node.interrupt().call(this.zoomTypes.normal.translateTo,i.zoom_bbox.x,i.zoom_bbox.y).call(this.zoomTypes.normal.scaleTo,i.zoom_bbox.k),i.zoom_bbox.k===this._self.config.max_zoom?this.zoomLevel=At.SEAT:this.zoomLevel=At.BLOCK,this.dispatchZoomEvent())},t.prototype.zoomToVenue=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1),console.info("zoomToVenue");var n=this.zoomLevels.VENUE.x,i=this.zoomLevels.VENUE.y,o=this.zoomLevels.VENUE.k;if(this._self.config.min_zoom=o,this.zoomInit(),1!==this._self.data.getBlocks().length)n&&i&&o&&(t?e?this._self.svg.node.interrupt().call(this.zoomTypes.fastAnimated.translateTo,n,i).call(this.zoomTypes.fastAnimated.scaleTo,o):this._self.svg.node.interrupt().call(this.zoomTypes.animated.translateTo,n,i).call(this.zoomTypes.animated.scaleTo,o):this._self.svg.node.interrupt().call(this.zoomTypes.normal.translateTo,n,i).call(this.zoomTypes.normal.scaleTo,o),this.zoomLevel=At.VENUE,this.dispatchZoomEvent());else{var r=this._self.data.getBlocks()[0];this.zoomToBlock(r.id,t,e)}},t.prototype.zoomEnable=function(){return this._self.svg.node.call(this.zoomTypes.normal),this},t.prototype.zoomDisable=function(){return this._self.svg.node.on(".zoom",null),this},t.prototype.getZoomLevelValues=function(t){return this.zoomLevels[t]},t.prototype.getActiveZoom=function(){return this.zoomLevels[this.zoomLevel]},t.prototype.dispatchZoomEvent=function(){this._self.eventManager.dispatch(St.ZOOM_LEVEL_CHANGE,{level:this.zoomLevel,values:this.getZoomLevelValues(this.zoomLevel)})},t}(),Ji={};Object.defineProperty(Ji,"__esModule",{value:!0});var Qi=Ji.isArray=Array.isArray||function(t){return t&&"number"==typeof t.length},to=function(){function t(t){this._self=t,this.events=[]}return t.prototype.addEventListener=function(t,e){if(Qi(t))for(var n=0;n<t.length;n++)this.events.push({type:t[n],fn:e});else this.events.push({type:t,fn:e});return this},t.prototype.dispatch=function(t,e){return this.events.filter(function(e){return e.type===t}).map(function(t){return t.fn(e)}),this},t}(),eo=function(){function t(t){var e=this;this.parent=t,this.width=null,this.height=null,this.stage={width:null,height:null},ft(window).on("resize.svg",function(){e.resizeHandler()})}return t.prototype.resizeHandler=function(){var t=ft(this.parent.container_selector).node().getBoundingClientRect();return this.width=t.width,this.height=t.height,this.parent.svg.node.attr("width",t.width),this.parent.svg.node.attr("height",t.height),this.parent.global.eventManager.dispatch(St.RESIZE_WINDOW,t),this},t}(),no=function(t){function e(){var e=t.call(this)||this;return e.name="pretix",e}return gt(e,t),e.prototype.parse=function(t){t.categories;for(var e=t.zones,n=[],i=0;i<e.length;i++)for(var o=e[i],r=o.position.x,s=o.position.y,a=o.rows,l=0;l<a.length;l++){var u=a[l];r+=u.position.x,s+=u.position.y;for(var c=u.seats,h=function(t){var e=c[t],i=r+e.position.x,o=s+e.position.y,a="".concat(e.category,"-").concat(u.row_number,"-").concat(u.row_number_position),l=n.find(function(t){return t.id===a});if(void 0===l){var h={id:a,title:e.category,color:"#2c2828",seats:[],labels:[]};n.push(h),l=h}var f={id:e.seat_guid,x:i,y:o,title:e.seat_guid,salable:!0,note:"",tags:{category:e.category}};l.seats.push(f)},f=0;f<c.length;f++)h(f)}for(i=0;i<n.length;i++){var p=n[i];p.seats=p.seats.sort(function(t,e){return t.x===e.x?t.y-e.y:t.x-e.x})}return n},e}(function(){function t(){}return t.prototype.parse=function(t){return[]},t}()),io=function(){function t(t,e){var n=this;this.container_selector=t,this.node=null,this.parsers={};var i=this;this.config=new Ve(e),this.eventManager=new to(this),this.addEventListener=this.eventManager.addEventListener,this.node=ft(t),this.windowManager=new eo(this),this.zoomManager=new Fi(this),this.data=new Se(this),this.registerConverters(),this.global={eventManager:this.eventManager,windowManager:this.windowManager,config:this.config,data:this.data,zoomManager:this.zoomManager,root:this,svg:this.svg,multi_select:!1,best_available:!1},ft(window).on("keydown.dispatch",function(t){i.eventManager.dispatch(St.KEYDOWN_SVG,t)}),ft(window).on("keyup.dispatch",function(t){i.eventManager.dispatch(St.KEYUP_SVG,t)}),this.dev=new Ce(this),this.svg=new ze(this),this.svg.domGenerate(this.node),this.svg.update(),this.windowManager.resizeHandler(),this.zoomManager.init(),this.eventManager.addEventListener(St.CLICK_ZOOM_OUT,function(){return n.zoomManager.zoomToVenue()}),this.eventManager.addEventListener(St.MULTI_SELECT_ENABLE,function(){n.global.multi_select=!0,n.node.classed("multi-select-enable",!0)}),this.eventManager.addEventListener(St.MULTI_SELECT_DISABLE,function(){n.global.multi_select=!1,n.node.classed("multi-select-enable",!1)}),this.eventManager.addEventListener(St.BEST_AVAILABLE_ENABLE,function(){n.global.best_available=!0}),this.eventManager.addEventListener(St.MBEST_AVAILABLE_DISABLE,function(){n.global.best_available=!1}),this.eventManager.addEventListener(St.ZOOM_LEVEL_CHANGE,function(t){t.level===At.VENUE||t.level===At.BLOCK?ft(n.config.zoom_out_button).style("display","none"):t.level===At.SEAT&&ft(n.config.zoom_out_button).style("display","block")}),ft(this.config.zoom_out_button).on("click",function(){n.zoomManager.zoomToVenue(!0)}),this.eventManager.addEventListener(St.ADD_BLOCK,function(t){n.svg.stage.blocks.update(),n.windowManager.resizeHandler(),n.zoomManager.calculateZoomLevels(n.data.getBlocks()),n.zoomManager.calculateActiveBlocks(n.data.getBlocks()),n.windowManager.resizeHandler(),n.zoomManager.zoomToVenue(!1)}),this.eventManager.dispatch(St.READY,this)}return t.prototype.registerConverters=function(){this.parsers.pretix=new no},t}();export{io as SeatMapCanvas};
30
16
  //# sourceMappingURL=seatmap.canvas.js.map