@alisaitteke/seatmap-canvas 2.5.19 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +148 -130
- package/dist/CLAUDE.md +11 -0
- package/dist/cjs/CLAUDE.md +11 -0
- package/dist/cjs/seatmap.canvas.css +4 -0
- package/dist/cjs/seatmap.canvas.js +2 -2
- package/dist/cjs/seatmap.canvas.js.map +1 -1
- package/dist/cjs/types/models/styles/seat.style.d.ts +5 -0
- package/dist/cjs/types/models/styles/tooltip.style.d.ts +8 -0
- package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.index.d.ts +7 -3
- package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.path-area.d.ts +7 -0
- package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.path.d.ts +13 -0
- package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.rect-area.d.ts +7 -0
- package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.rect.d.ts +11 -0
- package/dist/cjs/types/utils/svg-parser.d.ts +5 -0
- package/dist/dependencies.txt +0 -54
- package/dist/esm/CLAUDE.md +11 -0
- package/dist/esm/seatmap.canvas.css +4 -0
- package/dist/esm/seatmap.canvas.js +2 -2
- package/dist/esm/seatmap.canvas.js.map +1 -1
- package/dist/esm/types/models/styles/seat.style.d.ts +5 -0
- package/dist/esm/types/models/styles/tooltip.style.d.ts +8 -0
- package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.index.d.ts +7 -3
- package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.path-area.d.ts +7 -0
- package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.path.d.ts +13 -0
- package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.rect-area.d.ts +7 -0
- package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.rect.d.ts +11 -0
- package/dist/esm/types/utils/svg-parser.d.ts +5 -0
- package/package.json +2 -2
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
!function(t,e){t&&!t.getElementById("livereloadscript")&&((e=t.createElement("script")).async=1,e.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",e.id="livereloadscript",t.getElementsByTagName("head")[0].appendChild(e))}(self.document);var SeatmapCanvas=function(){"use strict";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 C(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function z(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?z:C: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:{};
|
|
25
|
+
!function(t,e){t&&!t.getElementById("livereloadscript")&&((e=t.createElement("script")).async=1,e.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",e.id="livereloadscript",t.getElementsByTagName("head")[0].appendChild(e))}(self.document);var SeatmapCanvas=function(){"use strict";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 null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}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 S(t,e){return function(){this.setAttribute(t,e)}}function T(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function L(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function z(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 C(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)||C(t).getComputedStyle(t,null).getPropertyValue(e)}function U(t){return function(){delete this[t]}}function V(t,e){return function(){this[t]=e}}function G(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 P(t)}function P(t){this._node=t,this._names=I(t.getAttribute("class")||"")}function D(t,e){for(var n=K(t),i=-1,o=e.length;++i<o;)n.add(e[i])}function j(t,e){for(var n=K(t),i=-1,o=e.length;++i<o;)n.remove(e[i])}function R(t){return function(){D(this,t)}}function $(t){return function(){j(this,t)}}function Z(t,e){return function(){(e.apply(this,arguments)?D:j)(this,t)}}function H(){this.textContent=""}function q(t){return function(){this.textContent=t}}function Y(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function F(){this.innerHTML=""}function X(t){return function(){this.innerHTML=t}}function W(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=C(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)}},P.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,i=e?b:_,o=this._parents,r=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var s=r.length,a=new Array(s),l=new Array(s),u=new Array(s),c=0;c<s;++c){var h=o[c],f=r[c],p=f.length,d=E(t.call(h,h&&h.__data__,c,o)),g=d.length,m=l[c]=new Array(g),v=a[c]=new Array(g);i(h,f,m,v,u[c]=new Array(p),d,e);for(var y,x,k=0,M=0;k<g;++k)if(y=m[k]){for(k>=M&&(M=k+1);!(x=v[M])&&++M<g;);y._next=x||null}}return(a=new ct(a,o))._enter=l,a._exit=u,a},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?z:L:i.local?T:S)(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?G: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?R:$)(n,e))},text:function(t){return arguments.length?this.each(null==t?H:("function"==typeof t?Y:q)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?F:("function"==typeof t?W:X)(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:{};
|
|
26
26
|
/*! *****************************************************************************
|
|
27
27
|
Copyright (C) Microsoft. All rights reserved.
|
|
28
28
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
|
|
37
37
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
38
38
|
and limitations under the License.
|
|
39
|
-
***************************************************************************** */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)),C(t,e,n)}function _(t,e,n){if(!I(e))throw new TypeError;return U(n)||(n=j(n)),z(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(C(t,e,n))return!0;var i=Q(e);return!$(i)&&L(t,i,n)}function C(t,e,n){var i=T(e,n,!1);return!U(i)&&P(i.has(t))}function z(t,e,n){if(C(t,e,n))return S(t,e,n);var i=Q(e);return $(i)?void 0:z(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 Ct(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}var zt,St,At,Ot,Bt=(zt="application/xml",(t,e)=>function(t,e){return fetch(t,e).then(Ct)}(t,e).then(t=>(new DOMParser).parseFromString(t,zt))),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",[Ce])],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",[Ce])],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",[Ce])],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",[Ce])],e)}(Tt),Ce=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),ze=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)?Cn: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 Cn(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 zn=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=Cn(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?zn:(n=cn(e))?(e=n,zn):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 Ci(t,e){return function(){hi(this,t).duration=+e.apply(this,arguments)}}function zi(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?Ci:zi)(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 ze(this),this.svg=new Ce(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}();return window.SeatMapCanvas=io,io}();
|
|
39
|
+
***************************************************************************** */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(!$(t))throw new TypeError;if(!H(e))throw new TypeError;return k(t,e)}if(!$(t))throw new TypeError;if(!I(e))throw new TypeError;if(!I(i)&&!U(i)&&!V(i))throw new TypeError;return V(i)&&(i=void 0),M(t,e,n=R(n),i)}function g(t,e){function n(n,i){if(!I(n))throw new TypeError;if(!U(i)&&!q(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=R(i)),A(t,e,n,i)}function v(t,e,n){if(!I(e))throw new TypeError;return U(n)||(n=R(n)),T(t,e,n)}function y(t,e,n){if(!I(e))throw new TypeError;return U(n)||(n=R(n)),L(t,e,n)}function _(t,e,n){if(!I(e))throw new TypeError;return U(n)||(n=R(n)),z(t,e,n)}function b(t,e,n){if(!I(e))throw new TypeError;return U(n)||(n=R(n)),C(t,e,n)}function w(t,e){if(!I(t))throw new TypeError;return U(e)||(e=R(e)),O(t,e)}function E(t,e){if(!I(t))throw new TypeError;return U(e)||(e=R(e)),B(t,e)}function x(t,e,n){if(!I(e))throw new TypeError;U(n)||(n=R(n));var i=S(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)&&!V(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)&&!V(r)){if(!I(r))throw new TypeError;i=r}}return i}function S(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 T(t,e,n){if(L(t,e,n))return!0;var i=Q(e);return!V(i)&&T(t,i,n)}function L(t,e,n){var i=S(e,n,!1);return!U(i)&&D(i.has(t))}function z(t,e,n){if(L(t,e,n))return C(t,e,n);var i=Q(e);return V(i)?void 0:z(t,i,n)}function C(t,e,n){var i=S(e,n,!1);if(!U(i))return i.get(t)}function A(t,e,n,i){S(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=S(t,e,!1);if(U(i))return n;for(var o=F(i.keys()),r=0;;){var s=W(o);if(!s)return n.length=r,n;var a=X(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 G(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=Y(t,i);if(void 0!==o){var r=o.call(t,n);if(I(r))throw new TypeError;return r}return P(t)}function P(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 D(t){return!!t}function j(t){return""+t}function R(t){var e=K(t);return G(e)?e:j(e)}function $(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 q(t){switch(N(t)){case 3:case 4:return!0;default:return!1}}function Y(t,e){var n=t[e];if(null!=n){if(!Z(n))throw new TypeError;return n}}function F(t){var e=Y(t,o);if(!Z(e))throw new TypeError;var n=e.call(t);if(!I(n))throw new TypeError;return n}function X(t){return t.value}function W(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 St=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 Tt(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 Lt(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function zt(t,e){return fetch(t,e).then(Lt)}var Ct,At,Ot,Bt=function(){this.child_index=null,this.item_type=null},Nt=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}(Bt),Ut=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}(Bt),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 Ut(t)})||[],n.seats=e.seats.map(function(t){return t.block=n,new Nt(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}(Bt),Gt=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([Tt({tag:"circle",class:"seat-circle",autoGenerate:!1}),vt("design:paramtypes",[qt])],e)}(St),It=function(t){function e(e){var n=t.call(this,e)||this;n.parent=e;var i=n.global.config.style.seat.size||2*n.global.config.style.seat.radius,o=n.global.config.style.seat.corner_radius||0;return n.attr("width",i),n.attr("height",i),n.attr("x",-i/2),n.attr("y",-i/2),n.attr("rx",o),n.attr("ry",o),n.attr("fill","transparent"),n.attr("opacity",0),n.attr("pointer-events","all"),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([Tt({tag:"rect",class:"rect-area",autoGenerate:!1}),vt("design:paramtypes",[Kt])],e)}(St),Kt=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}return gt(e,t),e.prototype.domGenerate=function(e,n){void 0===n&&(n=0),t.prototype.domGenerate.call(this,e,n);var i=this.getSize(),o=this.global.config.style.seat.corner_radius||0;return this.hitArea=new It(this),this.addChild(this.hitArea),this.rectElement=this.node.append("rect").attr("class","seat-rect").attr("width",i).attr("height",i).attr("x",-i/2).attr("y",-i/2).attr("rx",o).attr("ry",o).attr("fill",this.global.config.style.seat.color).attr("stroke","rgba(0,0,0,0.3)").attr("stroke-width",1).attr("pointer-events","none"),this.updateChilds(),this},e.prototype.getSize=function(){return this.global.config.style.seat.size||2*this.global.config.style.seat.radius},e.prototype.update=function(){return this},e=mt([Tt({tag:"g",class:"seat-rect-wrapper",autoGenerate:!1}),vt("design:paramtypes",[qt])],e)}(St),Pt=function(t){function e(e){var n=t.call(this,e)||this;n.parent=e;var i=n.global.config.style.seat.size||2*n.global.config.style.seat.radius;return n.attr("fill","transparent"),n.attr("opacity",0),n.attr("r",i/2),n.attr("pointer-events","all"),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([Tt({tag:"circle",class:"path-area",autoGenerate:!1}),vt("design:paramtypes",[Dt])],e)}(St),Dt=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}return gt(e,t),e.prototype.domGenerate=function(e,n){void 0===n&&(n=0),t.prototype.domGenerate.call(this,e,n);var i=this.global.config.style.seat.path||"M12 2L22 22H2Z",o=this.getSize(),r=this.parseViewBox(this.global.config.style.seat.path_box),s=this.getScale(o,r),a=r.x+r.width/2,l=r.y+r.height/2;return this.hitArea=new Pt(this),this.addChild(this.hitArea),this.pathElement=this.node.append("path").attr("class","seat-path").attr("d",i).attr("transform","scale(".concat(s,") translate(").concat(-a,",").concat(-l,")")).attr("fill",this.global.config.style.seat.color).attr("stroke","rgba(0,0,0,0.3)").attr("stroke-width",1/s).attr("pointer-events","none"),this.updateChilds(),this},e.prototype.getSize=function(){return this.global.config.style.seat.size||2*this.global.config.style.seat.radius},e.prototype.parseViewBox=function(t){var e={x:0,y:0,width:24,height:24};if(!t)return e;var n=t.split(/\s+/).map(function(t){return Number(t)});return 4!==n.length||n.some(function(t){return Number.isNaN(t)})?e:{x:n[0],y:n[1],width:n[2],height:n[3]}},e.prototype.getScale=function(t,e){var n=Math.max(e.width,e.height);return n?t/n:1},e.prototype.update=function(){return this},e=mt([Tt({tag:"g",class:"seat-path-wrapper",autoGenerate:!1}),vt("design:paramtypes",[qt])],e)}(St),jt=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"}(Ct||(Ct={})),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 Rt=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([Tt({tag:"path",class:"seat-check",autoGenerate:!1}),vt("design:paramtypes",[qt])],e)}(St),$t=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([Tt({tag:"circle",class:"circle-area",autoGenerate:!1}),vt("design:paramtypes",[Zt])],e)}(St),Zt=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.customSvg=n,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)),o=i.attr("viewBox"),r=[0,0,24,24];o?r=o.split(/\s+/).map(Number):r=[0,0,parseFloat(i.attr("width"))||24,parseFloat(i.attr("height"))||24];var s=r[0],a=r[1],l=r[2],u=r[3],c=this.global.config.style.seat.size||2*this.global.config.style.seat.radius,h=c/Math.max(l,u),f=-(s+l/2)*h,p=-(a+u/2)*h;return i.attr("width",c),i.attr("height",c),i.attr("viewBox","".concat(s," ").concat(a," ").concat(l," ").concat(u)),i.attr("x",f),i.attr("y",p),this.node.node().append(i.node()),this.addChild(new $t(this)),this},e=mt([Tt({tag:"g",class:"seat-circle",autoGenerate:!1}),vt("design:paramtypes",[qt,Object])],e)}(St),Ht=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([Tt({tag:"circle",class:"seat-check",autoGenerate:!1}),vt("design:paramtypes",[qt])],e)}(St),qt=function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.parent=e,o.item=n,o.coordinates=new jt(n),o.seatCustomSvg=i||null,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.circle||!this.circle.node)return this;var n=this.circle.node;if(this.circle.pathElement?n=this.circle.pathElement:this.circle.rectElement&&(n=this.circle.rectElement),this.seatCustomSvg)this.circle.node.attr("fill",t);else if(e)n.transition().duration(this.global.config.animation_speed).attr("fill",t);else try{n.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){if(!this.isSalable()||!this.circle||!this.circle.node)return this;this.item.selected=!0,this.node.classed("selected",!0);var e=this.circle.node;return this.circle.pathElement?e=this.circle.pathElement:this.circle.rectElement&&(e=this.circle.rectElement),this.seatCustomSvg?this.circle.node.attr("fill",this.global.config.style.seat.selected):e.attr("fill",this.global.config.style.seat.selected),this.check&&this.check.show(),this},e.prototype.unSelect=function(){if(!this.circle||!this.circle.node)return this;this.item.selected=!1,this.node.classed("selected",!1);var t=this.circle.node;return this.circle.pathElement?t=this.circle.pathElement:this.circle.rectElement&&(t=this.circle.rectElement),this.seatCustomSvg?this.circle.node.attr("fill",this.global.config.style.seat.color):t.attr("fill",this.global.config.style.seat.color),this.check&&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(){var t=this.getShapeType();return"svg"===t&&this.seatCustomSvg?(this.check=new Ht(this).addTo(this),this.circle=new Zt(this,this.seatCustomSvg),this.addChild(this.circle)):"rect"===t?(this.circle=new Kt(this),this.addChild(this.circle),this.check=new Rt(this).addTo(this)):"path"===t?(this.circle=new Dt(this),this.addChild(this.circle),this.check=new Rt(this).addTo(this)):(this.circle=new Gt(this),this.addChild(this.circle),this.check=new Rt(this).addTo(this)),this.updateChilds(),this},e.prototype.getShapeType=function(){var t=this.global.config.style.seat.shape||"auto";return"auto"===t?this.seatCustomSvg?"svg":"circle":"svg"!==t||this.seatCustomSvg?t:"circle"},e.prototype.afterGenerate=function(){this.setColor(this.getColor()),this.isSalable()||this.node.classed("not-salable",!0),this.item.selected?this.check.show():this.check.hide()},e=mt([Tt({tag:"g",class:"seat",autoGenerate:!1}),vt("design:paramtypes",[Ft,Nt,Object])],e)}(St);var Yt,Ft=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i.global.eventManager.addEventListener(Ct.MOUSEENTER_SEAT,function(t){i.global.multi_select||t.isSalable()&&t.setColor(t.getColor(Ot.HOVER))}),i.global.eventManager.addEventListener(Ct.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,o,r,s,a,l,u,c,h,f,p;return _t(this,function(d){switch(d.label){case 0:if(t=this.global.config.style.seat.shape||"auto",e=this.global.config.style.seat.svg,!(!!e&&("auto"===t||"svg"===t))||!e)return[3,18];d.label=1;case 1:return d.trys.push([1,12,,17]),[4,zt(e)];case 2:if(n=d.sent(),i=function(t){try{var e=(new DOMParser).parseFromString(t,"image/svg+xml");if(e.querySelector("parsererror"))return console.error("Invalid SVG file"),null;var n=e.querySelector("svg");if(!n)return console.error("No SVG element found"),null;var i=n.getAttribute("viewBox");if(!i){var o=n.getAttribute("width")||"24",r=n.getAttribute("height")||"24";i="0 0 ".concat(parseFloat(o)," ").concat(parseFloat(r))}var s="",a=n.querySelector("path");if(a&&(s=a.getAttribute("d")||""),!s){var l=n.querySelectorAll("path");l.length>0&&(s=Array.from(l).map(function(t){return t.getAttribute("d")}).filter(function(t){return t}).join(" "))}if(!s){var u=n.querySelector("polygon"),c=n.querySelector("polyline"),h=n.querySelector("rect"),f=n.querySelector("circle");if(u){var p=u.getAttribute("points");s="M".concat(p,"Z")}else if(c)p=c.getAttribute("points"),s="M".concat(p);else if(h){var d=parseFloat(h.getAttribute("x")||"0"),g=parseFloat(h.getAttribute("y")||"0"),m=parseFloat(h.getAttribute("width")||"0"),v=parseFloat(h.getAttribute("height")||"0");s="M".concat(d,",").concat(g,"h").concat(m,"v").concat(v,"h").concat(-m,"Z")}else if(f){var y=parseFloat(f.getAttribute("cx")||"0"),_=parseFloat(f.getAttribute("cy")||"0"),b=parseFloat(f.getAttribute("r")||"0");s="M".concat(y-b,",").concat(_,"a").concat(b,",").concat(b," 0 1,0 ").concat(2*b,",0a").concat(b,",").concat(b," 0 1,0 ").concat(2*-b,",0")}}return s?{path:s,viewBox:i}:(console.error("Could not extract path data from SVG"),null)}catch(t){return console.error("Error parsing SVG:",t),null}}(n),!i)return[3,7];this.global.config.style.seat.path=i.path,this.global.config.style.seat.path_box=i.viewBox,this.global.config.style.seat.shape="path",this.global.config.style.seat.svg=null,o=0,r=this.item.seats,d.label=3;case 3:return o<r.length?(p=r[o],[4,this.addChild(new qt(this,p,null),{id:p.id})]):[3,6];case 4:d.sent(),d.label=5;case 5:return o++,[3,3];case 6:return[3,11];case 7:console.warn("Could not extract path from SVG, using circle"),s=0,a=this.item.seats,d.label=8;case 8:return s<a.length?(p=a[s],[4,this.addChild(new qt(this,p,null),{id:p.id})]):[3,11];case 9:d.sent(),d.label=10;case 10:return s++,[3,8];case 11:return[3,17];case 12:l=d.sent(),console.error("Error loading SVG file:",l),u=0,c=this.item.seats,d.label=13;case 13:return u<c.length?(p=c[u],[4,this.addChild(new qt(this,p,null),{id:p.id})]):[3,16];case 14:d.sent(),d.label=15;case 15:return u++,[3,13];case 16:return[3,17];case 17:return[3,22];case 18:h=0,f=this.item.seats,d.label=19;case 19:return h<f.length?(p=f[h],[4,this.addChild(new qt(this,p,null),{id:p.id})]):[3,22];case 20:d.sent(),d.label=21;case 21:return h++,[3,19];case 22:return[4,this.updateChilds()];case 23:return d.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([Tt({tag:"g",class:"seats",autoGenerate:!1}),vt("design:paramtypes",[re,Vt])],e)}(St),Xt=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([Tt({tag:"text",class:"title",autoGenerate:!1}),vt("design:paramtypes",[Wt])],e)}(St),Wt=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 Xt(this),this.addChild(this.title),this.updateChilds(),this.title.node.text(this.parent.item.title),this},e=mt([Tt({tag:"g",class:"info",autoGenerate:!1}),vt("design:paramtypes",[re,Vt])],e)}(St),Jt=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([Tt({tag:"path",class:"bound",autoGenerate:!1}),vt("design:paramtypes",[Object,Vt])],e)}(St),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.update=function(){return this.bound1=new Jt(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 Jt(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([Tt({tag:"g",class:"bounds",autoGenerate:!1}),vt("design:paramtypes",[re,Vt])],e)}(St),te=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i.global.eventManager.addEventListener(Ct.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 Jt(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 Jt(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([Tt({tag:"g",class:"masks",autoGenerate:!1}),vt("design:paramtypes",[re,Vt])],e)}(St),ee=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([Tt({tag:"circle",class:"label-circle",autoGenerate:!1}),vt("design:paramtypes",[ie])],e)}(St),ne=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([Tt({tag:"text",class:"label-text",autoGenerate:!1}),vt("design:paramtypes",[ie])],e)}(St),ie=function(t){function e(e,n){var i=t.call(this,e)||this;return i.parent=e,i.item=n,i.coordinates=new jt(n),i.attr("transform","translate("+i.coordinates.toArray()+")"),i}return gt(e,t),e.prototype.update=function(){return this.circle=new ee(this),this.addChild(this.circle),this.circle=new ne(this),this.addChild(this.circle),this.updateChilds(),this.circle.node.text(this.item.title),this},e=mt([Tt({tag:"g",class:"label",autoGenerate:!1}),vt("design:paramtypes",[oe,Ut])],e)}(St),oe=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 ie(t,e))}),this.updateChilds(),this},e.prototype.getLabels=function(){return this.child_items},e=mt([Tt({tag:"g",class:"labels",autoGenerate:!1}),vt("design:paramtypes",[re,Vt])],e)}(St),re=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(Ct.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(Ct.MULTI_SELECT_ENABLE,function(){i.seats.resetSeatsColors(!1)}),i.global.eventManager.addEventListener(Ct.MULTI_SELECT_DISABLE,function(){i.seats.resetSeatsColors(!1)}),i.global.eventManager.addEventListener(Ct.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;if(s.isSalable()){var 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(Ct.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 Qt(this,this.item),this.addChild(this.bounds),this.seats=new Ft(this,this.item),this.addChild(this.seats),this.labels=new oe(this,this.item),this.addChild(this.labels),this.mask=new te(this,this.item),this.addChild(this.mask),this.info=new Wt(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([Tt({tag:"g",class:"block",autoGenerate:!1}),vt("design:paramtypes",[se,Vt])],e)}(St),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=this;return this.clear(),this.global.data.getBlocks().map(function(e){var n=new re(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(re.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([Tt({tag:"g",class:"blocks",autoGenerate:!1}),vt("design:paramtypes",[ue])],e)}(St),ae=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([Tt({tag:"circle",class:"circle",autoGenerate:!1}),vt("design:paramtypes",[le])],e)}(St),le=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.is_enable=!0,n.global.eventManager.addEventListener(Ct.MOUSE_MOVE,function(t){n.global.zoomManager.zoomLevel===At.BLOCK&&n.is_enable&&n.node.attr("transform","translate("+t+")")}),n.global.eventManager.addEventListener(Ct.ZOOM_LEVEL_CHANGE,function(t){t.level!==At.VENUE&&t.level!==At.SEAT||n.node.classed("show",!1)}),n.global.eventManager.addEventListener(Ct.MULTI_SELECT_ENABLE,function(){n.disable()}),n.global.eventManager.addEventListener(Ct.MULTI_SELECT_DISABLE,function(){n.enable()}),n}return gt(e,t),e.prototype.update=function(){var t=this;return this.clear(),this.circle=new ae(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([Tt({tag:"g",class:"search-circle",autoGenerate:!1}),vt("design:paramtypes",[ue])],e)}(St),ue=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 se(this),this.addChild(this.blocks),this.searchCircle=new le(this),this.addChild(this.searchCircle),this.updateChilds()},e=mt([Tt({tag:"g",class:"stage",autoGenerate:!1}),vt("design:paramtypes",[_e])],e)}(St),ce=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.global.eventManager.addEventListener(Ct.RESIZE_WINDOW,function(t){n.node.attr("width",t.width).attr("height",t.height).on("click.zoomout",function(){n.global.eventManager.dispatch(Ct.CLICK_ZOOM_OUT,n)})}),n}return gt(e,t),e.prototype.update=function(){},e=mt([Tt({tag:"rect",class:"zoom-out-bg",autoGenerate:!1}),vt("design:paramtypes",[_e])],e)}(St),he=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([Tt({tag:"circle",class:"legend-circle",autoGenerate:!1}),vt("design:paramtypes",[de])],e)}(St),fe=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([Tt({tag:"text",class:"legend-title dark:fill-white",autoGenerate:!1}),vt("design:paramtypes",[de])],e)}(St),pe=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}(Bt),de=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 he(this),this.addChild(this.circle),this.title=new fe(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([Tt({tag:"g",class:"legend-item",autoGenerate:!1}),vt("design:paramtypes",[ge,pe])],e)}(St),ge=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 de(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([Tt({tag:"g",class:"legend",autoGenerate:!1}),vt("design:paramtypes",[_e])],e)}(St),me=function(t){function e(e){var n=t.call(this,e)||this;n.parent=e;var i=n.global.config.style.tooltip.border_radius||8;return 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",i),n.attr("ry",i),n.attr("fill",n.global.config.style.tooltip.bg),n.attr("stroke",n.global.config.style.tooltip.border_color||"rgba(0,0,0,0.15)"),n.attr("stroke-width",n.global.config.style.tooltip.border_width||1),n}return gt(e,t),e.prototype.update=function(){return this.updateChilds(),this},e.prototype.afterGenerate=function(){this.node.style("pointer-events","none");var t=this.global.config.style.tooltip.shadow;t&&this.node.style("filter","drop-shadow(".concat(t,")"))},e=mt([Tt({tag:"rect",class:"tooltip-rect",autoGenerate:!1}),vt("design:paramtypes",[ye])],e)}(St),ve=function(t){function e(e){var n=t.call(this,e)||this;n.parent=e;var i=n.global.config.style.tooltip.text_align||"center",o=n.global.config.style.tooltip.width,r="center"===i?o/2:n.global.config.style.tooltip.padding||12;return n.attr("x",r),n.attr("y",0),n.attr("fill",n.global.config.style.tooltip.color),n.attr("text-anchor","center"===i?"middle":"start"),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",this.global.config.style.tooltip.font_size||"13px"),this.node.style("font-weight",this.global.config.style.tooltip.font_weight||"500")},e.prototype.generateTitle=function(){var t=this.global.config.style.tooltip.line_height||18,e=this.global.config.style.tooltip.padding||12,n=parseInt(this.global.config.style.tooltip.font_size)||13;this.title.length;var i=e+n;this.node.selectAll("tspan").remove().data(this.title).enter().append("tspan").text(function(t){return t}).attr("x",this.node.attr("x")).attr("y",function(e,n){return i+n*t})},e=mt([Tt({tag:"text",class:"tooltip-title",autoGenerate:!1}),vt("design:paramtypes",[ye])],e)}(St),ye=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([Ct.MOUSEMOVE_SEAT],function(t){if(!n.global.multi_select&&n.activeSeat!==t&&t.item.title){n.activeSeat=t;var e=t.item.title.split("\n");t.isSalable()||(e=function(t,e,n){if(n||2===arguments.length)for(var i,o=0,r=e.length;o<r;o++)!i&&o in e||(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))}(["🚫 "+e[0]],e.slice(1),!0)),n.setTitle(e),n.title.generateTitle()}}),n.global.eventManager.addEventListener([Ct.MOUSEOUT_SEAT],function(t){n.node.attr("opacity",0),n.activeSeat=null,n.title.title=[],n.title.generateTitle()}),n.global.eventManager.addEventListener([Ct.TOUCHSTART_BLOCK],function(t){n.node.attr("opacity",0)}),n}return gt(e,t),e.prototype.setTitle=function(t){this.title.title=t;var e=this.global.config.style.tooltip.line_height||18,n=this.global.config.style.tooltip.padding||12,i=t.length*e+2*n;return this.rect&&this.rect.node&&(this.rect.node.attr("height",i),this.activeSeat&&!this.activeSeat.isSalable()?this.rect.node.attr("stroke","#ef4444"):this.rect.node.attr("stroke",this.global.config.style.tooltip.border_color||"rgba(0,0,0,0.15)")),this},e.prototype.update=function(){return this.rect=new me(this).addTo(this),this.title=new ve(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=t.rect.node?parseFloat(t.rect.node.attr("height")):t.global.config.style.tooltip.height,o=n[0]-t.global.config.style.tooltip.width/2,r=n[1]-(i+t.global.config.style.seat.radius+8),s=t.activeSeat.isSalable()?1:.5;t.node.attr("transform","translate("+[o,r]+")").attr("opacity",s)}else t.node.attr("opacity",0)})},e=mt([Tt({tag:"g",class:"seatmap-tooltip",autoGenerate:!1}),vt("design:paramtypes",[_e])],e)}(St),_e=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.global.eventManager.addEventListener(Ct.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 ue(this).addToParent(),this.zoomOutBg=new ce(this).addToParent(),this.global.config.legend&&(this.legend=new ge(this).addToParent()),this.tooltip=new ye(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(Ct.MOUSE_MOVE,n)})},e=mt([Tt({tag:"svg",class:"seatmap-svg",autoGenerate:!1}),vt("design:paramtypes",[Yi])],e)}(St),be=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"}(Yt||(Yt={}));var we=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(Ct.ADD_BLOCK,[t]),this.eventManager.dispatch(Ct.UPDATE_BLOCK,this.blocks),this},t.prototype.addBulkBlock=function(t){var e=this;if(this._self.config.json_model!==Yt.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(Ct.ADD_BLOCK,[t]),this.eventManager.dispatch(Ct.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(Ct.REMOVE_BLOCK,t),this.eventManager.dispatch(Ct.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}(),Ee=function(){this.shape="auto",this.radius=12,this.size=null,this.corner_radius=0,this.path=null,this.path_box="0 0 24 24",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},xe=function(){this.fill="#ffffff",this.stroke="#ffffff",this.border_width=4,this.title_color="#000000",this.title_font_size=28},ke=function(){this.radius=12,this.padding=36,this.font_size=12,this.font_color="#000"},Me=function(){this.color="#000000",this.bg="#fff",this.font_size=12,this.radius=12},Se=function(){this.border_width=1,this.width=140,this.height=58,this.color="#000000",this.bg="#ffffff",this.border_color="rgba(0,0,0,0.15)",this.border_radius=8,this.padding=12,this.font_size="13px",this.font_weight="500",this.line_height=18,this.shadow="0 4px 12px rgba(0,0,0,0.15)",this.text_align="center"},Te=function(){},Le=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=Yt.SEATMAP,this.json_model=t.json_model?t.json_model:Yt.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 Te,this.style.seat=Object.assign(new Ee,t.style.seat),this.style.block=Object.assign(new xe,t.style.block),this.style.legend=Object.assign(new ke,t.style.legend),this.style.label=Object.assign(new Me,t.style.label),this.style.tooltip=Object.assign(new Se,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}(),ze={value:()=>{}};function Ce(){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 Ae(i)}function Ae(t){this._=t}function Oe(t,e){for(var n,i=0,o=t.length;i<o;++i)if((n=t[i]).name===e)return n.value}function Be(t,e,n){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=ze,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}Ae.prototype=Ce.prototype={constructor:Ae,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]=Be(o[n],t.name,e);else if(null==e)for(n in o)o[n]=Be(o[n],t.name,null);return this}for(;++s<a;)if((n=(t=r[s]).type)&&(n=Oe(o[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ae(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 Ne={capture:!0,passive:!1};function Ue(t){t.preventDefault(),t.stopImmediatePropagation()}function Ve(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ge(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Ie(){}var Ke=.7,Pe=1/Ke,De="\\s*([+-]?\\d+)\\s*",je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Re="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$e=/^#([0-9a-f]{3,8})$/,Ze=new RegExp(`^rgb\\(${De},${De},${De}\\)$`),He=new RegExp(`^rgb\\(${Re},${Re},${Re}\\)$`),qe=new RegExp(`^rgba\\(${De},${De},${De},${je}\\)$`),Ye=new RegExp(`^rgba\\(${Re},${Re},${Re},${je}\\)$`),Fe=new RegExp(`^hsl\\(${je},${Re},${Re}\\)$`),Xe=new RegExp(`^hsla\\(${je},${Re},${Re},${je}\\)$`),We={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 Je(){return this.rgb().formatHex()}function Qe(){return this.rgb().formatRgb()}function tn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=$e.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?en(e):3===n?new rn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?nn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?nn(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=Ze.exec(t))?new rn(e[1],e[2],e[3],1):(e=He.exec(t))?new rn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=qe.exec(t))?nn(e[1],e[2],e[3],e[4]):(e=Ye.exec(t))?nn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Fe.exec(t))?hn(e[1],e[2]/100,e[3]/100,1):(e=Xe.exec(t))?hn(e[1],e[2]/100,e[3]/100,e[4]):We.hasOwnProperty(t)?en(We[t]):"transparent"===t?new rn(NaN,NaN,NaN,0):null}function en(t){return new rn(t>>16&255,t>>8&255,255&t,1)}function nn(t,e,n,i){return i<=0&&(t=e=n=NaN),new rn(t,e,n,i)}function on(t,e,n,i){return 1===arguments.length?((o=t)instanceof Ie||(o=tn(o)),o?new rn((o=o.rgb()).r,o.g,o.b,o.opacity):new rn):new rn(t,e,n,null==i?1:i);var o}function rn(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function sn(){return`#${cn(this.r)}${cn(this.g)}${cn(this.b)}`}function an(){const t=ln(this.opacity);return`${1===t?"rgb(":"rgba("}${un(this.r)}, ${un(this.g)}, ${un(this.b)}${1===t?")":`, ${t})`}`}function ln(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function un(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function cn(t){return((t=un(t))<16?"0":"")+t.toString(16)}function hn(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 fn(t){if(t instanceof pn)return new pn(t.h,t.s,t.l,t.opacity);if(t instanceof Ie||(t=tn(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 dn(t){return(t=(t||0)%360)<0?t+360:t}function gn(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)}Ve(Ie,tn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Je,formatHex:Je,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return fn(this).formatHsl()},formatRgb:Qe,toString:Qe}),Ve(rn,on,Ge(Ie,{brighter(t){return t=null==t?Pe:Math.pow(Pe,t),new rn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ke:Math.pow(Ke,t),new rn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new rn(un(this.r),un(this.g),un(this.b),ln(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:sn,formatHex:sn,formatHex8:function(){return`#${cn(this.r)}${cn(this.g)}${cn(this.b)}${cn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:an,toString:an})),Ve(pn,function(t,e,n,i){return 1===arguments.length?fn(t):new pn(t,e,n,null==i?1:i)},Ge(Ie,{brighter(t){return t=null==t?Pe:Math.pow(Pe,t),new pn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ke:Math.pow(Ke,t),new pn(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 rn(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 pn(dn(this.h),gn(this.s),gn(this.l),ln(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=ln(this.opacity);return`${1===t?"hsl(":"hsla("}${dn(this.h)}, ${100*gn(this.s)}%, ${100*gn(this.l)}%${1===t?")":`, ${t})`}`}}));var vn=t=>()=>t;function yn(t){return 1===(t=+t)?_n: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):vn(isNaN(e)?n:e)}}function _n(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):vn(isNaN(t)?e:t)}var bn=function t(e){var n=yn(e);function i(t,e){var i=n((t=on(t)).r,(e=on(e)).r),o=n(t.g,e.g),r=n(t.b,e.b),s=_n(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 wn(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var En=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xn=new RegExp(En.source,"g");function kn(t,e){var n,i,o,r=En.lastIndex=xn.lastIndex=0,s=-1,a=[],l=[];for(t+="",e+="";(n=En.exec(t))&&(i=xn.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:wn(n,i)})),r=xn.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 Mn,Sn=180/Math.PI,Tn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ln(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)*Sn,skewX:Math.atan(l)*Sn,scaleX:s,scaleY:a}}function zn(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:wn(t,o)},{i:l-2,x:wn(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:wn(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:wn(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:wn(t,n)},{i:a-2,x:wn(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 Cn=zn(function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Tn:Ln(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),An=zn(function(t){return null==t?Tn:(Mn||(Mn=document.createElementNS("http://www.w3.org/2000/svg","g")),Mn.setAttribute("transform",t),(t=Mn.transform.baseVal.consolidate())?Ln((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Tn)},", ",")",")");function On(t){return((t=Math.exp(t))+1/t)/2}var Bn,Nn,Un=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,o=t*s,r=On(_),c=u/(n*m)*(r*(i=e*o+_,((i=Math.exp(2*i))-1)/(i+1))-function(t){return((t=Math.exp(t))-1/t)/2}(_));return[a+c*p,l+c*d,u*r/On(e*o+_)]}}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),Vn=0,Gn=0,In=0,Kn=0,Pn=0,Dn=0,jn="object"==typeof performance&&performance.now?performance:Date,Rn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function $n(){return Pn||(Rn(Zn),Pn=jn.now()+Dn)}function Zn(){Pn=0}function Hn(){this._call=this._time=this._next=null}function qn(t,e,n){var i=new Hn;return i.restart(t,e,n),i}function Yn(){Pn=(Kn=jn.now())+Dn,Vn=Gn=0;try{!function(){$n(),++Vn;for(var t,e=Bn;e;)(t=Pn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Vn}()}finally{Vn=0,function(){var t,e,n=Bn,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:Bn=e);Nn=t,Xn(i)}(),Pn=0}}function Fn(){var t=jn.now(),e=t-Kn;e>1e3&&(Dn-=e,Kn=t)}function Xn(t){Vn||(Gn&&(Gn=clearTimeout(Gn)),t-Pn>24?(t<1/0&&(Gn=setTimeout(Yn,t-jn.now()-Dn)),In&&(In=clearInterval(In))):(In||(Kn=jn.now(),In=setInterval(Fn,1e3)),Vn=1,Rn(Yn)))}function Wn(t,e,n){var i=new Hn;return e=null==e?0:+e,i.restart(n=>{i.stop(),t(n+e)},e,n),i}Hn.prototype=qn.prototype={constructor:Hn,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||Nn===this||(Nn?Nn._next=this:Bn=this,Nn=this),this._call=t,this._time=n,Xn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xn())}};var Jn=Ce("start","end","cancel","interrupt"),Qn=[];function ti(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 Wn(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(Wn(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=qn(r,0,n.time)}(t,n,{name:e,index:i,group:o,on:Jn,tween:Qn,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:0})}function ei(t,e){var n=ii(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function ni(t,e){var n=ii(t,e);if(n.state>3)throw new Error("too late; already running");return n}function ii(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function oi(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 ri(t,e){var n,i;return function(){var o=ni(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 si(t,e,n){var i,o;if("function"!=typeof n)throw new Error;return function(){var r=ni(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 ai(t,e,n){var i=t._id;return t.each(function(){var t=ni(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return ii(t,i).value[e]}}function li(t,e){var n;return("number"==typeof e?wn:e instanceof tn?bn:(n=tn(e))?(e=n,bn):kn)(t,e)}function ui(t){return function(){this.removeAttribute(t)}}function ci(t){return function(){this.removeAttributeNS(t.space,t.local)}}function hi(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 fi(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 pi(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 di(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 gi(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 vi(t,e){return function(){ei(this,t).delay=+e.apply(this,arguments)}}function yi(t,e){return e=+e,function(){ei(this,t).delay=e}}function _i(t,e){return function(){ni(this,t).duration=+e.apply(this,arguments)}}function bi(t,e){return e=+e,function(){ni(this,t).duration=e}}var wi=ht.prototype.constructor;function Ei(t){return function(){this.style.removeProperty(t)}}var xi=0;function ki(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Mi(){return++xi}var Si=ht.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,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,ti(f[p],e,n,p,f,ii(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,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=ii(l,n),m=0,v=d.length;m<v;++m)(p=d[m])&&ti(p,e,n,m,d,g);r.push(d),s.push(l)}return new ki(r,s,e,n)},selectChild:Si.selectChild,selectChildren:Si.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 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],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 ki(s,this._parents,this._name,this._id)},selection:function(){return new wi(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Mi(),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=ii(s,e);ti(s,t,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ki(i,this._parents,t,n)},call:Si.call,nodes:Si.nodes,node:Si.node,size:Si.size,empty:Si.empty,each:Si.each,on:function(t,e){var n=this._id;return arguments.length<2?ii(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)?ei:ni;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?An:li;return this.attrTween(t,"function"==typeof e?(i.local?di:pi)(i,o,ai(this,"attr."+t,e)):null==e?(i.local?ci:ui)(i):(i.local?fi:hi)(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?gi:mi)(o,e))},style:function(t,e,n){var i="transform"==(t+="")?Cn:li;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,Ei(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,ai(this,"style."+t,e))).each(function(t,e){var n,i,o,r,s="style."+e,a="end."+s;return function(){var l=ni(this,t),u=l.on,c=null==l.value[s]?r||(r=Ei(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}}(ai(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=ii(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?ri:si)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?vi:yi)(e,t)):ii(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?_i:bi)(e,t)):ii(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(){ni(this,t).ease=e}}(e,t)):ii(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;ni(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=ni(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]:Si[Symbol.iterator]};var Ti={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Li(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(){oi(this,t)})},ht.prototype.transition=function(t){var e,n;t instanceof ki?(e=t._id,t=t._name):(e=Mi(),(n=Ti).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])&&ti(s,t,e,u,a,n||Li(s,e));return new ki(i,this._parents,t,e)};var zi=t=>()=>t;function Ci(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 Ai(t,e,n){this.k=t,this.x=e,this.y=n}Ai.prototype={constructor:Ai,scale:function(t){return 1===t?this:new Ai(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Ai(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 Oi=new Ai(1,0,0);function Bi(t){t.stopImmediatePropagation()}function Ni(t){t.preventDefault(),t.stopImmediatePropagation()}function Ui(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Vi(){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 Gi(){return this.__zoom||Oi}function Ii(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Ki(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pi(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 Di(){var t,e,n,i=Ui,o=Vi,r=Pi,s=Ii,a=Ki,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,h=Un,f=Ce("start","zoom","end"),p=0,d=10;function g(t){t.property("__zoom",Gi).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",x).on("dblclick.zoom",k).filter(a).on("touchstart.zoom",M).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",T).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 Ai(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 Ai(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 Ai(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)],oi(this),n.start()}Ni(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(Ni(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",Ue,Ne),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),Ni(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",Ue,Ne);"onselectstart"in e?n.on("selectstart.drag",Ue,Ne):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),Bi(t),s.mouse=[l,this.__zoom.invert(l)],oi(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);Ni(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(Bi(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)),oi(this),h.start())}}function S(t,...e){if(this.__zooming){var n,i,o,s,a=b(this,e).event(t),l=t.changedTouches,c=l.length;for(Ni(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 T(t,...i){if(this.__zooming){var o,r,s=b(this,i).event(t),a=t.changedTouches,l=a.length;for(Bi(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",Gi),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(Oi.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 Ci(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:zi(+t),g):s},g.filter=function(t){return arguments.length?(i="function"==typeof t?t:zi(!!t),g):i},g.touchable=function(t){return arguments.length?(a="function"==typeof t?t:zi(!!t),g):a},g.extent=function(t){return arguments.length?(o="function"==typeof t?t:zi([[+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}Ai.prototype;var ji=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(Ct.MOUSE_MOVE,function(e){t.lastPointer=e}),this._self.eventManager.addEventListener(Ct.KEYDOWN_SVG,function(e){var n;17!=e.which&&91!==e.which||(t._self.eventManager.dispatch(Ct.MULTI_SELECT_ENABLE,e),null===(n=null==e?void 0:e.preventDefault)||void 0===n||n.call(e),t.zoomDisable())}),this._self.eventManager.addEventListener(Ct.KEYUP_SVG,function(e){var n;t._self.eventManager.dispatch(Ct.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=Di().scaleExtent([this._self.config.min_zoom,this._self.config.max_zoom]).on("end",this.zoomEnd(this)).on("zoom",this.zoomHand(this)),this.zoomTypes.animated=Di().scaleExtent([this._self.config.min_zoom,this._self.config.max_zoom]).on("end",this.animatedZoomEnd(this)).on("zoom",this.zoomHandAnimated(this)),this.zoomTypes.fastAnimated=Di().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(Ct.ZOOM_LEVEL_CHANGE,{level:this.zoomLevel,values:this.getZoomLevelValues(this.zoomLevel)})},t}(),Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});var $i=Ri.isArray=Array.isArray||function(t){return t&&"number"==typeof t.length},Zi=function(){function t(t){this._self=t,this.events=[]}return t.prototype.addEventListener=function(t,e){if($i(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}(),Hi=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(Ct.RESIZE_WINDOW,t),this},t}(),qi=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}()),Yi=function(){function t(t,e){var n=this;this.container_selector=t,this.node=null,this.parsers={};var i=this;this.config=new Le(e),this.eventManager=new Zi(this),this.addEventListener=this.eventManager.addEventListener,this.node=ft(t),this.windowManager=new Hi(this),this.zoomManager=new ji(this),this.data=new we(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(Ct.KEYDOWN_SVG,t)}),ft(window).on("keyup.dispatch",function(t){i.eventManager.dispatch(Ct.KEYUP_SVG,t)}),this.dev=new be(this),this.svg=new _e(this),this.svg.domGenerate(this.node),this.svg.update(),this.windowManager.resizeHandler(),this.zoomManager.init(),this.eventManager.addEventListener(Ct.CLICK_ZOOM_OUT,function(){return n.zoomManager.zoomToVenue()}),this.eventManager.addEventListener(Ct.MULTI_SELECT_ENABLE,function(){n.global.multi_select=!0,n.node.classed("multi-select-enable",!0)}),this.eventManager.addEventListener(Ct.MULTI_SELECT_DISABLE,function(){n.global.multi_select=!1,n.node.classed("multi-select-enable",!1)}),this.eventManager.addEventListener(Ct.BEST_AVAILABLE_ENABLE,function(){n.global.best_available=!0}),this.eventManager.addEventListener(Ct.MBEST_AVAILABLE_DISABLE,function(){n.global.best_available=!1}),this.eventManager.addEventListener(Ct.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(Ct.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(Ct.READY,this)}return t.prototype.registerConverters=function(){this.parsers.pretix=new qi},t}();return window.SeatMapCanvas=Yi,Yi}();
|
|
40
40
|
//# sourceMappingURL=seatmap.canvas.js.map
|