diff --git a/build/tevomaps.js b/build/tevomaps.js index cee508b..f9f3cca 100644 --- a/build/tevomaps.js +++ b/build/tevomaps.js @@ -3,7 +3,7 @@ object-assign (c) Sindre Sorhus @license MIT -*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,u,l=a(e),c=1;c1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!y(h(this,t),e)}}),p&&r(s.prototype,"size",{get:function(){return h(this,t)[v]}}),s},def:function(e,t,n){var r,o,i=y(e,t);return i?i.v=n:(e._l=i={i:o=d(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[v]++,"F"!==o&&(e._i[o]=i)),e},getEntry:y,setStrong:function(e,t,n){c(e,t,(function(e,n){this._t=h(e,t),this._k=n,this._l=void 0}),(function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?s(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,s(1))}),n?"entries":"values",!n,!0),f(t)}}},function(e,t,n){"use strict";var r=n(4),o=n(7),i=n(18),a=n(73),u=n(77),l=n(72),c=n(71),s=n(10),f=n(14),p=n(74),d=n(50),h=n(160);e.exports=function(e,t,n,v,y,m){var g=r[e],b=g,w=y?"set":"add",x=b&&b.prototype,M={},k=function(e){var t=x[e];i(x,e,"delete"==e?function(e){return!(m&&!s(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(m&&!s(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return m&&!s(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof b&&(m||x.forEach&&!f((function(){(new b).entries().next()})))){var j=new b,E=j[w](m?{}:-0,1)!=j,S=f((function(){j.has(1)})),T=p((function(e){new b(e)})),O=!m&&f((function(){for(var e=new b,t=5;t--;)e[w](t,t);return!e.has(-0)}));T||((b=t((function(t,n){c(t,b,e);var r=h(new g,t,b);return null!=n&&l(n,y,r[w],r),r}))).prototype=x,x.constructor=b),(S||O)&&(k("delete"),k("has"),y&&k("get")),(O||E)&&k(w),m&&x.clear&&delete x.clear}else b=v.getConstructor(t,e,y,w),a(b.prototype,n),u.NEED=!0;return d(b,e),M[e]=b,o(o.G+o.W+o.F*(b!=g),M),m||v.setStrong(b,e,y),b}},function(e,t,n){var r=n(10),o=n(9),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(31)(Function.call,n(79).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},function(e,t,n){"use strict";var r=n(31),o=n(7),i=n(28),a=n(90),u=n(91),l=n(54),c=n(106),s=n(92);o(o.S+o.F*!n(74)((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,o,f,p=i(e),d="function"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,y=void 0!==v,m=0,g=s(p);if(y&&(v=r(v,h>2?arguments[2]:void 0,2)),null==g||d==Array&&u(g))for(n=new d(t=l(p.length));t>m;m++)c(n,m,y?v(p[m],m):p[m]);else for(f=g.call(p),n=new d;!(o=f.next()).done;m++)c(n,m,y?a(f,v,[o.value,m],!0):o.value);return n.length=m,n}})},function(e,t,n){var r=n(7),o=n(161)(!0);r(r.S,"Object",{entries:function(e){return o(e)}})},function(e,t,n){"use strict";var r=n(87)(!0);n(80)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t){},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(147)},function(e,t,n){"use strict";n.d(t,"default",(function(){return S}));n(38),n(81),n(58),n(39),n(107),n(153),n(154),n(155),n(159),n(111),n(112),n(23),n(16),n(24),n(34),n(113),n(162),n(163),n(83),n(21),n(52);var r=n(0),o=n.n(r),i=n(173),a=n(123),u=n(118),l=n(119),c=n(124),s=n(6);n(115);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"This map is not currently available.";return y(this,t),j(g(e=m(this,k(t).call(this,n))),"name","MapNotFoundError"),e}return b(t,e),t}(w(Error)),S=function(e){function t(e){var n;return y(this,t),j(g(n=m(this,k(t).call(this,e))),"publicApi",void 0),j(g(n),"mapRoot",o.a.createRef()),j(g(n),"container",o.a.createRef()),j(g(n),"zoom",void 0),j(g(n),"isTouchDevice",(function(){return"ontouchstart"in document.documentElement})),j(g(n),"getMapRootElement",(function(){return n.mapRoot.current})),j(g(n),"highlightSection",(function(e){return n.toggleSectionHighlight(e,!0)})),j(g(n),"unhighlightSection",(function(e){return e?n.toggleSectionHighlight(e,!1):n.setState({currentHoveredSection:void 0})})),j(g(n),"selectSection",(function(e){return n.toggleSectionSelect(e,!0)})),j(g(n),"deselectSection",(function(e){return e?n.toggleSectionSelect(e,!1):n.clearSelection()})),j(g(n),"updateTicketGroups",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.props.ticketGroups;return n.setState({ticketGroups:e})})),j(g(n),"setUnavailableColors",(function(){return n.fillPathsForSection((function(e){return{"data-unavailable-color":e.getAttribute("fill")}}))})),j(g(n),"fillUnavailableColors",(function(){return n.fillPathsForSection((function(e){return{fill:e.getAttribute("data-unavailable-color"),opacity:"1","stroke-width":"1",stroke:"#FFFFFF"}}))})),j(g(n),"fillPathsForSection",(function(e,t){return n.getAllPaths(t).forEach((function(t){return Object.entries(e(t)).forEach((function(e){var n=d(e,2),r=n[0],o=n[1];return t.setAttribute(r,o)}))}))})),j(g(n),"getAllPaths",(function(e){var t=n.getMapRootElement();return t?Array.from(t.querySelectorAll("[data-section-id".concat(e?'="'.concat(e,'"'):"","]"))).reduce((function(e,t){var n=t.querySelectorAll("path");return e.concat(n.length?Array.from(n):[t])}),[]):[]})),j(g(n),"clearSelection",(function(){n.setState({selectedSections:new Set})})),j(g(n),"toggleSectionHighlight",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e){var r=e.toLowerCase(),o=!t&&n.state.selectedSections.has(r);if(!o)return n.fillSection(r,t)}})),j(g(n),"toggleSectionSelect",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e){var r=e.toLowerCase();if(Object(s.e)(n.state).includes(r)){var o=new Set(n.state.selectedSections);t?o.add(r):o.delete(r),n.setState({selectedSections:o})}}})),j(g(n),"onMouseOver",(function(e){var t=e.clientX,r=e.clientY,o=e.target;return n.doHover(o,t,r)})),j(g(n),"onMouseOut",(function(e){var t=e.relatedTarget;return n.doHoverCleanup(t)})),j(g(n),"onMouseMove",(function(e){var t=e.nativeEvent;return n.setState({tooltipX:t.clientX,tooltipY:t.clientY})})),j(g(n),"onClick",(function(){return n.doSelect()})),j(g(n),"onTouchMove",(function(e){n.setState({dragging:!0})})),j(g(n),"onTouchEnd",(function(e){n.state.dragging&&e.preventDefault(),n.setState({dragging:!1})})),j(g(n),"handleZoomIn",(function(){n.zoom&&n.zoom.zoomIn(.1)})),j(g(n),"handleZoomOut",(function(){n.zoom&&n.zoom.zoomOut(.1)})),j(g(n),"handleResetZoom",(function(){n.zoom&&n.zoom.reset()})),n.state={sectionMapping:{},selectedSections:new Set(n.props.selectedSections.filter((function(e){return!!e}))),tooltipActive:!1,tooltipSectionName:"",tooltipX:0,tooltipY:0,ticketGroups:n.props.ticketGroups,mapNotFound:!1,touchStarts:{},dragging:!1,isTouchDevice:!1},n.publicApi={updateTicketGroups:n.updateTicketGroups,highlightSection:n.highlightSection,unhighlightSection:n.unhighlightSection,selectSection:n.selectSection,deselectSection:n.deselectSection},n}var n,r,f;return b(t,e),n=t,(r=[{key:"componentDidMount",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isTouchDevice:this.isTouchDevice()}),e.prev=1,e.next=4,regeneratorRuntime.awrap(this.fetchMap());case 4:return this.setupMap(),e.next=7,regeneratorRuntime.awrap(this.fetchManifest());case 7:e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),console.error(e.t0),"MapNotFoundError"===e.t0.name&&this.setState({mapNotFound:!0});case 13:case"end":return e.stop()}}),null,this,[[1,9]])}},{key:"componentWillUnmount",value:function(){this.zoom&&this.zoom.teardown()}},{key:"componentDidUpdate",value:function(e,t){var n=Object(s.a)(t)!==Object(s.a)(this.state),r=void 0!==t.currentHoveredSection&&void 0===this.state.currentHoveredSection,o=!Object(i.a)(this.state.selectedSections,t.selectedSections);this.mapRoot.current&&(r||n||o)&&this.updateMap(),o&&this.props.onSelection(Array.from(this.state.selectedSections)),Object(s.c)(t)!==Object(s.c)(this.state)&&Object(s.c)(this.state).length>0&&console.warn("Unknown section names found in ticket groups: %o",Object(s.c)(this.state)),e.mouseControlEnabled!==this.props.mouseControlEnabled&&this.zoom&&(this.props.mouseControlEnabled?this.zoom.enable():this.zoom.disable())}},{key:"fetchMap",value:function(){var e,t,n;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,regeneratorRuntime.awrap(fetch("".concat(this.configFilePath,"/map.svg")));case 2:if((e=r.sent).ok){r.next=5;break}throw new E;case 5:return r.next=7,regeneratorRuntime.awrap(e.text());case 7:t=r.sent,this.mapRoot.current&&(this.mapRoot.current.innerHTML=t,(n=this.mapRoot.current.querySelector("svg"))&&this.props.mouseControlEnabled&&(this.zoom=Object(c.a)(n)));case 9:case"end":return r.stop()}}),null,this)}},{key:"fetchManifest",value:function(){var e,t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(fetch("".concat(this.configFilePath,"/manifest.json")));case 2:if((e=n.sent).ok){n.next=5;break}throw Error("There was an error fetching the venue map data, please try again");case 5:return n.next=7,regeneratorRuntime.awrap(e.json());case 7:t=n.sent,this.setState({sectionMapping:Object.keys(t.sections).reduce((function(e,t){return p({},e,j({},t.toLowerCase(),{sectionName:t}))}),{})});case 9:case"end":return n.stop()}}),null,this)}},{key:"setupMap",value:function(){var e=this.getMapRootElement();if(e){var t=e.querySelector("svg");t&&(Object.assign(t.style,{position:"absolute",zIndex:0,top:0,left:0,height:"100%",width:"100%"}),this.setUnavailableColors(),t.querySelectorAll("*[data-section-id]").forEach((function(e){var t=e.getAttribute("data-section-id");t&&e.setAttribute("data-section-id",t.toLowerCase())})),t.querySelectorAll("text").forEach((function(e){e.style.pointerEvents="none"})),this.setState({mapSvg:t}))}}},{key:"updateMap",value:function(){var e=this;this.fillUnavailableColors(),Object(s.e)(this.state).forEach((function(t){e.fillSection(t.toLowerCase(),e.state.selectedSections.has(t))}))}},{key:"fillSection",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Object(s.e)(this.state).includes(e);r&&this.fillPathsForSection((function(){return{fill:t.getDefaultColor(Object(s.d)(t.state)[e]),opacity:n?"1":"0.6","stroke-width":"1",stroke:n?"#4a4a4a":"#FFFFFF",cursor:"pointer"}}),e)}},{key:"getSectionFromTarget",value:function(e){var t=e.closest("[data-section-id]");if(t){var n=t.getAttribute("data-section-id");if(n)return n.toLowerCase()}}},{key:"getDefaultColor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((function(e){return e.price})).sort((function(e,t){return e-t}))[0],n=Object(s.b)(this.state,this.props),r=!0,o=!1,i=void 0;try{for(var a,u=n[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var l=a.value;if(l.max>t)return l.color}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n[n.length-1].color}},{key:"doHover",value:function(e,t,n){var r=this.getSectionFromTarget(e);r&&Object(s.e)(this.state).includes(r)&&(this.highlightSection(r),this.setState({tooltipActive:void 0!==t&&void 0!==n,tooltipX:void 0!==t?t:0,tooltipY:void 0!==n?n:0,tooltipSectionName:this.state.sectionMapping[r].sectionName,currentHoveredSection:r}))}},{key:"doHoverCleanup",value:function(e){if(!e||"text"!==e.nodeName.toLowerCase()){var t=this.getSectionFromTarget(e);t&&t===this.state.currentHoveredSection||this.setState({tooltipActive:!1,currentHoveredSection:void 0})}}},{key:"doSelect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.currentHoveredSection;e&&this.toggleSectionSelect(e,!this.state.selectedSections.has(e))}},{key:"render",value:function(){var e=this;return this.state.mapNotFound?o.a.createElement("div",{style:{left:0,position:"relative",textAlign:"left"}},o.a.createElement("div",{style:{color:"white",fontFamily:"Nunito Sans",padding:"50px 30px",position:"absolute",textAlign:"left"}},o.a.createElement("div",{style:{fontWeight:600,fontSize:"1.375em"}},"Seating chart not available."),o.a.createElement("div",{style:{fontWeight:300}},"(It was abducted by aliens)")),o.a.createElement("img",{src:"https://maps.ticketevolution.com/maps/not_available.jpg",style:{width:"100%",textAlign:"left"}})):o.a.createElement("div",{ref:this.container,onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut,onMouseMove:this.onMouseMove,onClick:this.onClick,onTouchEnd:this.onTouchEnd,onTouchMove:this.onTouchMove,style:{position:"relative",fontFamily:this.props.mapFontFamily,height:"100%",width:"100%",pointerEvents:this.props.mouseControlEnabled?"initial":"none"}},!this.state.isTouchDevice&&o.a.createElement(u.a,{isActive:this.state.tooltipActive,x:this.state.tooltipX,y:this.state.tooltipY,name:this.state.tooltipSectionName,color:this.state.currentHoveredSection?this.getDefaultColor(Object(s.d)(this.state)[this.state.currentHoveredSection]):"",ticketGroups:Object(s.a)(this.state).filter((function(t){return t.section===e.state.currentHoveredSection}))}),o.a.createElement("div",{ref:this.mapRoot,style:{cursor:"-webkit-grab",opacity:this.state.mapSvg?1:0}}),this.state.mapSvg&&o.a.createElement(a.a,{onClearSelection:this.clearSelection,ranges:Object(s.b)(this.state,this.props),showLegend:this.props.showLegend,showControls:this.props.showControls,onZoomIn:this.handleZoomIn,onZoomOut:this.handleZoomOut,onResetZoom:this.handleResetZoom}),this.state.isTouchDevice&&this.props.mouseControlEnabled&&o.a.createElement(l.a,null))}},{key:"configFilePath",get:function(){return"".concat(this.props.mapsDomain,"/").concat(this.props.venueId,"/").concat(this.props.configurationId)}}])&&h(n.prototype,r),f&&h(n,f),t}(r.Component);j(S,"defaultProps",{mapsDomain:"https://maps.ticketevolution.com",onSelection:function(){},selectedSections:[],sectionPercentiles:{.2:"#FFC515",.4:"#f2711c",.6:"#D6226A",.8:"#a333c8",1:"#2A6EBB"},ticketGroups:[],showLegend:!0,showControls:!0,mouseControlEnabled:!0,mapFontFamily:"inherit"})},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));n(23),n(16),n(52),n(107),n(81);var r=n(0),o=n.n(r);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;ne.parentElement.clientWidth&&(o[1]="left"),r0&&e.left<=window.innerWidth&&e.left+e.width>0})),v(d(n),"handleViewportChange",(function(){if(!n.state.discovered){var e=n.getCurrentContainer();if(e){var t=e.getBoundingClientRect();n.shouldHide(t)&&setTimeout(n.hide,4e3)}}})),n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){window.addEventListener("wheel",e.handleViewportChange),window.addEventListener("resize",e.handleViewportChange),e.handleViewportChange()}),500)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("wheel",this.handleViewportChange),window.removeEventListener("resize",this.handleViewportChange)}},{key:"render",value:function(){var e=function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function g(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0||!Array.isArray(t)&&t?v({},e,t):{}}function k(e){var t=e.icon,n=e.mask,r=e.symbol,o=e.className,i=e.title,a=x(t),u=M("classes",[].concat(g(function(e){var t,n=e.spin,r=e.pulse,o=e.fixedWidth,i=e.inverse,a=e.border,u=e.listItem,l=e.flip,c=e.size,s=e.rotation,f=e.pull,p=(v(t={"fa-spin":n,"fa-pulse":r,"fa-fw":o,"fa-inverse":i,"fa-border":a,"fa-li":u,"fa-flip-horizontal":"horizontal"===l||"both"===l,"fa-flip-vertical":"vertical"===l||"both"===l},"fa-".concat(c),null!=c),v(t,"fa-rotate-".concat(s),null!=s),v(t,"fa-pull-".concat(f),null!=f),v(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(p).map((function(e){return p[e]?e:null})).filter((function(e){return e}))}(e)),g(o.split(" ")))),l=M("transform","string"==typeof e.transform?f.b.transform(e.transform):e.transform),c=M("mask",x(n)),s=Object(f.a)(a,y({},u,l,c,{symbol:r,title:i}));if(!s)return function(){var e;!w&&console&&"function"==typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find icon",a),null;var p=s.abstract,d={};return Object.keys(e).forEach((function(t){k.defaultProps.hasOwnProperty(t)||(d[t]=e[t])})),j(p[0],d)}k.displayName="FontAwesomeIcon",k.propTypes={border:d.a.bool,className:d.a.string,mask:d.a.oneOfType([d.a.object,d.a.array,d.a.string]),fixedWidth:d.a.bool,inverse:d.a.bool,flip:d.a.oneOf(["horizontal","vertical","both"]),icon:d.a.oneOfType([d.a.object,d.a.array,d.a.string]),listItem:d.a.bool,pull:d.a.oneOf(["right","left"]),pulse:d.a.bool,rotation:d.a.oneOf([90,180,270]),size:d.a.oneOf(["lg","xs","sm","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:d.a.bool,symbol:d.a.oneOfType([d.a.bool,d.a.string]),title:d.a.string,transform:d.a.oneOfType([d.a.string,d.a.object]),swapOpacity:d.a.bool},k.defaultProps={border:!1,className:"",mask:null,fixedWidth:!1,inverse:!1,flip:null,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,symbol:!1,title:"",transform:null,swapOpacity:!1};var j=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof n)return n;var o=(n.children||[]).map((function(n){return e(t,n)})),i=Object.keys(n.attributes||{}).reduce((function(e,t){var r=n.attributes[t];switch(t){case"class":e.attrs.className=r,delete n.attributes.class;break;case"style":e.attrs.style=r.split(";").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var n,r=t.indexOf(":"),o=b(t.slice(0,r)),i=t.slice(r+1).trim();return o.startsWith("webkit")?e[(n=o,n.charAt(0).toUpperCase()+n.slice(1))]=i:e[o]=i,e}),{});break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?e.attrs[t.toLowerCase()]=r:e.attrs[b(t)]=r}return e}),{attrs:{}}),a=r.style,u=void 0===a?{}:a,l=m(r,["style"]);return i.attrs.style=y({},i.attrs.style,u),t.apply(void 0,[n.tag,y({},i.attrs,l)].concat(g(o)))}.bind(null,o.a.createElement);function E(){return(E=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function C(e){var t=e.icon,n=e.text,r=e.style,i=e.isMobile,a=L(e,["icon","text","style","isMobile"]);return o.a.createElement("div",E({},a,{style:T({backgroundColor:"transparent",borderRadius:0,padding:i?"0.25em 0.5em":"0.5em 1em",outline:"none",cursor:"pointer",border:"none",display:"flex",alignItems:"center",justifyContent:"center"},r||{})}),t&&o.a.createElement(k,{icon:t,style:n?{marginRight:i?4:8}:{}}),n)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;t0&&t&&o.a.createElement("div",{style:{position:"absolute",backgroundColor:"white",right:-2,border:"2px solid lightgray",borderRadius:"0 0 5px 5px"}},r.map((function(e){return o.a.createElement("div",{key:e.color,style:{padding:8,textAlign:"left"}},o.a.createElement(z,{color:e.color,style:{marginRight:8}}),o.a.createElement("span",null,W(Math.floor(e.min))," - ",W(Math.ceil(e.max))))}))))}}])&&A(n.prototype,r),u&&A(n,u),t}(r.Component);function H(){return(H=Object.assign||function(e){for(var t=1;ta&&e.stopPropagation()}function z(e){if(_){var t=r(y(e.clientX,e.clientY),2),n=t[0],o=t[1],i=r(y(E,S),2),a=i[0],u=i[1];m.x=f-n+a,m.y=p-o+u}}function I(){_=!1}var A=function(){var e=document.createElement("iframe");if(e.src="#",document.body.appendChild(e),!e.contentDocument)throw new Error("unable to create an iframe to test for line height");e.contentDocument.open(),e.contentDocument.write("a"),e.contentDocument.close();var t=e.contentDocument.querySelector("span");if(!t)throw new Error("unable to find test element for line height test");var n=t.offsetHeight;return document.body.removeChild(e),n}();function D(e){var t,n;if(e.deltaMode===WheelEvent.DOM_DELTA_PIXEL)t=e.deltaX,n=e.deltaY;else{if(e.deltaMode!==WheelEvent.DOM_DELTA_LINE)return;t=e.deltaX*A,n=e.deltaY*A}if(e.preventDefault(),g(),e.ctrlKey){var r=n;m.height=m.height*(1+r/window.innerHeight*o),m.width=m.width*(1+r/window.innerWidth*o),k(0-(m.width-h)/2,0-(m.height-d)/2)}else k(t*i,n*i)}function R(e){T||(g(),m.width=1*x/e.scale,m.height=1*M/e.scale,m.x-=(m.width-h)/2,m.y-=(m.height-d)/2)}function U(){e.addEventListener("touchstart",O,{passive:!1}),e.addEventListener("touchmove",L,{passive:!1}),e.addEventListener("touchend",C,{passive:!1}),e.addEventListener("mousedown",N),e.addEventListener("click",P),e.addEventListener("mousemove",z),e.addEventListener("mouseup",I),e.addEventListener("mouseleave",I),e.addEventListener("wheel",D),e.addEventListener("gesturestart",l,{passive:!1}),e.addEventListener("gesturechange",l,{passive:!1}),e.addEventListener("gesturechange",R),e.addEventListener("gestureend",l,{passive:!1})}function F(){e.removeEventListener("touchstart",O),e.removeEventListener("touchmove",L),e.removeEventListener("touchend",C),e.removeEventListener("mousedown",N),e.removeEventListener("click",P),e.removeEventListener("mousemove",z),e.removeEventListener("mouseup",I),e.removeEventListener("mouseleave",I),e.removeEventListener("wheel",D),e.removeEventListener("gesturestart",l),e.removeEventListener("gesturechange",l),e.removeEventListener("gesturechange",R),e.removeEventListener("gestureend",l)}return U(),{zoomIn:function(e){j(1-e)},zoomOut:function(e){j(1+e)},reset:function(){m.x=b,m.y=w,m.width=x,m.height=M},teardown:F,enable:U,disable:F}}},function(e,t,n){n(172),e.exports=n(171)},function(e,t,n){"use strict";var r=n(9),o=n(28),i=n(54),a=n(55),u=n(127),l=n(128),c=Math.max,s=Math.min,f=Math.floor,p=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g;n(129)("replace",2,(function(e,t,n,h){return[function(r,o){var i=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},function(e,t){var o=h(n,e,this,t);if(o.done)return o.value;var f=r(e),p=String(this),d="function"==typeof t;d||(t=String(t));var y=f.global;if(y){var m=f.unicode;f.lastIndex=0}for(var g=[];;){var b=l(f,p);if(null===b)break;if(g.push(b),!y)break;""===String(b[0])&&(f.lastIndex=u(p,i(f.lastIndex),m))}for(var w,x="",M=0,k=0;k=M&&(x+=p.slice(M,E)+C,M=E+j.length)}return x+p.slice(M)}];function v(e,t,r,i,a,u){var l=r+e.length,c=i.length,s=d;return void 0!==a&&(a=o(a),s=p),n.call(u,s,(function(n,o){var u;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(l);case"<":u=a[o.slice(1,-1)];break;default:var s=+o;if(0===s)return n;if(s>c){var p=f(s/10);return 0===p?n:p<=c?void 0===i[p-1]?o.charAt(1):i[p-1]+o.charAt(1):n}u=i[s-1]}return void 0===u?"":u}))}}))},function(e,t,n){"use strict";var r=n(87)(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},function(e,t,n){"use strict";var r=n(56),o=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(e,t)}},function(e,t,n){"use strict";n(130);var r=n(18),o=n(20),i=n(14),a=n(45),u=n(2),l=n(88),c=u("species"),s=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})),f=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var p=u(e),d=!i((function(){var t={};return t[p]=function(){return 7},7!=""[e](t)})),h=d?!i((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[c]=function(){return n}),n[p](""),!t})):void 0;if(!d||!h||"replace"===e&&!s||"split"===e&&!f){var v=/./[p],y=n(a,p,""[e],(function(e,t,n,r,o){return t.exec===l?d&&!o?{done:!0,value:v.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),m=y[0],g=y[1];r(String.prototype,e,m),o(RegExp.prototype,p,2==t?function(e,t){return g.call(e,this,t)}:function(e){return g.call(e,this)})}}},function(e,t,n){"use strict";var r=n(88);n(7)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(e,t,n){e.exports=n(57)("native-function-to-string",Function.toString)},function(e,t,n){"use strict";var r,o,i,a,u=n(46),l=n(4),c=n(31),s=n(56),f=n(7),p=n(10),d=n(32),h=n(71),v=n(72),y=n(133),m=n(93).set,g=n(134)(),b=n(96),w=n(135),x=n(136),M=n(137),k=l.TypeError,j=l.process,E=j&&j.versions,S=E&&E.v8||"",T=l.Promise,O="process"==s(j),L=function(){},C=o=b.f,_=!!function(){try{var e=T.resolve(1),t=(e.constructor={})[n(2)("species")]=function(e){e(L,L)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(L)instanceof t&&0!==S.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(e){}}(),N=function(e){var t;return!(!p(e)||"function"!=typeof(t=e.then))&&t},P=function(e,t){if(!e._n){e._n=!0;var n=e._c;g((function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,u=o?t.ok:t.fail,l=t.resolve,c=t.reject,s=t.domain;try{u?(o||(2==e._h&&A(e),e._h=1),!0===u?n=r:(s&&s.enter(),n=u(r),s&&(s.exit(),a=!0)),n===t.promise?c(k("Promise-chain cycle")):(i=N(n))?i.call(n,l,c):l(n)):c(r)}catch(e){s&&!a&&s.exit(),c(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&z(e)}))}},z=function(e){m.call(l,(function(){var t,n,r,o=e._v,i=I(e);if(i&&(t=w((function(){O?j.emit("unhandledRejection",o,e):(n=l.onunhandledrejection)?n({promise:e,reason:o}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",o)})),e._h=O||I(e)?2:1),e._a=void 0,i&&t.e)throw t.v}))},I=function(e){return 1!==e._h&&0===(e._a||e._c).length},A=function(e){m.call(l,(function(){var t;O?j.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},D=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),P(t,!0))},R=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw k("Promise can't be resolved itself");(t=N(e))?g((function(){var r={_w:n,_d:!1};try{t.call(e,c(R,r,1),c(D,r,1))}catch(e){D.call(r,e)}})):(n._v=e,n._s=1,P(n,!1))}catch(e){D.call({_w:n,_d:!1},e)}}};_||(T=function(e){h(this,T,"Promise","_h"),d(e),r.call(this);try{e(c(R,this,1),c(D,this,1))}catch(e){D.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(73)(T.prototype,{then:function(e,t){var n=C(y(this,T));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?j.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&P(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=c(R,e,1),this.reject=c(D,e,1)},b.f=C=function(e){return e===T||e===a?new i(e):o(e)}),f(f.G+f.W+f.F*!_,{Promise:T}),n(50)(T,"Promise"),n(97)("Promise"),a=n(29).Promise,f(f.S+f.F*!_,"Promise",{reject:function(e){var t=C(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(u||!_),"Promise",{resolve:function(e){return M(u&&this===a?T:this,e)}}),f(f.S+f.F*!(_&&n(74)((function(e){T.all(e).catch(L)}))),"Promise",{all:function(e){var t=this,n=C(t),r=n.resolve,o=n.reject,i=w((function(){var n=[],i=0,a=1;v(e,!1,(function(e){var u=i++,l=!1;n.push(void 0),a++,t.resolve(e).then((function(e){l||(l=!0,n[u]=e,--a||r(n))}),o)})),--a||r(n)}));return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=C(t),r=n.reject,o=w((function(){v(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return o.e&&r(o.v),n.promise}})},function(e,t,n){var r=n(9),o=n(32),i=n(2)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[i])?t:o(n)}},function(e,t,n){var r=n(4),o=n(93).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,l="process"==n(37)(a);e.exports=function(){var e,t,n,c=function(){var r,o;for(l&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(l)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var s=u.resolve(void 0);n=function(){s.then(c)}}else n=function(){o.call(r,c)};else{var f=!0,p=document.createTextNode("");new i(c).observe(p,{characterData:!0}),n=function(){p.data=f=!f}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(4).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){var r=n(9),o=n(10),i=n(96);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(12),o=n(33),i=n(59),a=n(51),u=n(28),l=n(99),c=Object.assign;e.exports=!c||n(14)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=c({},e)[n]||Object.keys(c({},t)).join("")!=r}))?function(e,t){for(var n=u(e),c=arguments.length,s=1,f=i.f,p=a.f;c>s;)for(var d,h=l(arguments[s++]),v=f?o(h).concat(f(h)):o(h),y=v.length,m=0;y>m;)d=v[m++],r&&!p.call(h,d)||(n[d]=h[d]);return n}:c},function(e,t,n){var r=n(55),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(33),o=n(59),i=n(51);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var a,u=n(e),l=i.f,c=0;u.length>c;)l.call(e,a=u[c++])&&t.push(a);return t}},function(e,t,n){var r=n(37);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(15),o=n(9),i=n(33);e.exports=n(12)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),u=a.length,l=0;u>l;)r.f(e,n=a[l++],t[n]);return e}},function(e,t,n){var r=n(22),o=n(78).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(r(e))}},function(e,t,n){"use strict";var r=n(60),o=n(48),i=n(50),a={};n(20)(a,n(2)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(30),o=n(28),i=n(75)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){"use strict"; +*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,u,l=a(e),c=1;c1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!y(h(this,t),e)}}),p&&r(s.prototype,"size",{get:function(){return h(this,t)[v]}}),s},def:function(e,t,n){var r,o,i=y(e,t);return i?i.v=n:(e._l=i={i:o=d(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[v]++,"F"!==o&&(e._i[o]=i)),e},getEntry:y,setStrong:function(e,t,n){c(e,t,(function(e,n){this._t=h(e,t),this._k=n,this._l=void 0}),(function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?s(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,s(1))}),n?"entries":"values",!n,!0),f(t)}}},function(e,t,n){"use strict";var r=n(4),o=n(7),i=n(18),a=n(73),u=n(77),l=n(72),c=n(71),s=n(10),f=n(14),p=n(74),d=n(50),h=n(160);e.exports=function(e,t,n,v,y,m){var g=r[e],b=g,w=y?"set":"add",x=b&&b.prototype,M={},k=function(e){var t=x[e];i(x,e,"delete"==e?function(e){return!(m&&!s(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(m&&!s(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return m&&!s(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof b&&(m||x.forEach&&!f((function(){(new b).entries().next()})))){var j=new b,E=j[w](m?{}:-0,1)!=j,S=f((function(){j.has(1)})),T=p((function(e){new b(e)})),O=!m&&f((function(){for(var e=new b,t=5;t--;)e[w](t,t);return!e.has(-0)}));T||((b=t((function(t,n){c(t,b,e);var r=h(new g,t,b);return null!=n&&l(n,y,r[w],r),r}))).prototype=x,x.constructor=b),(S||O)&&(k("delete"),k("has"),y&&k("get")),(O||E)&&k(w),m&&x.clear&&delete x.clear}else b=v.getConstructor(t,e,y,w),a(b.prototype,n),u.NEED=!0;return d(b,e),M[e]=b,o(o.G+o.W+o.F*(b!=g),M),m||v.setStrong(b,e,y),b}},function(e,t,n){var r=n(10),o=n(9),i=function(e,t){if(o(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(31)(Function.call,n(79).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return i(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:i}},function(e,t,n){"use strict";var r=n(31),o=n(7),i=n(28),a=n(90),u=n(91),l=n(54),c=n(106),s=n(92);o(o.S+o.F*!n(74)((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,o,f,p=i(e),d="function"==typeof this?this:Array,h=arguments.length,v=h>1?arguments[1]:void 0,y=void 0!==v,m=0,g=s(p);if(y&&(v=r(v,h>2?arguments[2]:void 0,2)),null==g||d==Array&&u(g))for(n=new d(t=l(p.length));t>m;m++)c(n,m,y?v(p[m],m):p[m]);else for(f=g.call(p),n=new d;!(o=f.next()).done;m++)c(n,m,y?a(f,v,[o.value,m],!0):o.value);return n.length=m,n}})},function(e,t,n){var r=n(7),o=n(161)(!0);r(r.S,"Object",{entries:function(e){return o(e)}})},function(e,t,n){"use strict";var r=n(87)(!0);n(80)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t){},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(147)},function(e,t,n){"use strict";n.d(t,"default",(function(){return S}));n(38),n(81),n(58),n(39),n(107),n(153),n(154),n(155),n(159),n(111),n(112),n(23),n(16),n(24),n(34),n(113),n(162),n(163),n(83),n(21),n(52);var r=n(0),o=n.n(r),i=n(173),a=n(123),u=n(118),l=n(119),c=n(124),s=n(6);n(115);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"This map is not currently available.";return y(this,t),j(g(e=m(this,k(t).call(this,n))),"name","MapNotFoundError"),e}return b(t,e),t}(w(Error)),S=function(e){function t(e){var n;return y(this,t),j(g(n=m(this,k(t).call(this,e))),"publicApi",void 0),j(g(n),"mapRoot",o.a.createRef()),j(g(n),"container",o.a.createRef()),j(g(n),"zoom",void 0),j(g(n),"isTouchDevice",(function(){return"ontouchstart"in document.documentElement})),j(g(n),"getMapRootElement",(function(){return n.mapRoot.current})),j(g(n),"highlightSection",(function(e){return n.toggleSectionHighlight(e,!0)})),j(g(n),"unhighlightSection",(function(e){return e?n.toggleSectionHighlight(e,!1):n.setState({currentHoveredSection:void 0})})),j(g(n),"selectSection",(function(e){return n.toggleSectionSelect(e,!0)})),j(g(n),"deselectSection",(function(e){return e?n.toggleSectionSelect(e,!1):n.clearSelection()})),j(g(n),"updateTicketGroups",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.props.ticketGroups;return n.setState({ticketGroups:e})})),j(g(n),"setUnavailableColors",(function(){return n.fillPathsForSection((function(e){return{"data-unavailable-color":e.getAttribute("fill")}}))})),j(g(n),"fillUnavailableColors",(function(){return n.fillPathsForSection((function(e){return{fill:e.getAttribute("data-unavailable-color"),opacity:"1","stroke-width":"1",stroke:"#FFFFFF"}}))})),j(g(n),"fillPathsForSection",(function(e,t){return n.getAllPaths(t).forEach((function(t){return Object.entries(e(t)).forEach((function(e){var n=d(e,2),r=n[0],o=n[1];return t.setAttribute(r,o)}))}))})),j(g(n),"getAllPaths",(function(e){var t=n.getMapRootElement();return t?Array.from(t.querySelectorAll("[data-section-id".concat(e?'="'.concat(e,'"'):"","]"))).reduce((function(e,t){var n=t.querySelectorAll("path");return e.concat(n.length?Array.from(n):[t])}),[]):[]})),j(g(n),"clearSelection",(function(){n.setState({selectedSections:new Set})})),j(g(n),"toggleSectionHighlight",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e){var r=e.toLowerCase(),o=!t&&n.state.selectedSections.has(r);if(!o)return n.fillSection(r,t)}})),j(g(n),"toggleSectionSelect",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e){var r=e.toLowerCase();if(Object(s.e)(n.state).includes(r)){var o=new Set(n.state.selectedSections);t?o.add(r):o.delete(r),n.setState({selectedSections:o})}}})),j(g(n),"onMouseOver",(function(e){var t=e.clientX,r=e.clientY,o=e.target;return n.doHover(o,t,r)})),j(g(n),"onMouseOut",(function(e){var t=e.relatedTarget;return n.doHoverCleanup(t)})),j(g(n),"onMouseMove",(function(e){var t=e.nativeEvent;return n.setState({tooltipX:t.clientX,tooltipY:t.clientY})})),j(g(n),"onClick",(function(){return n.doSelect()})),j(g(n),"onTouchMove",(function(e){n.setState({dragging:!0})})),j(g(n),"onTouchEnd",(function(e){n.state.dragging&&e.preventDefault(),n.setState({dragging:!1})})),j(g(n),"handleZoomIn",(function(){n.zoom&&n.zoom.zoomIn(.1)})),j(g(n),"handleZoomOut",(function(){n.zoom&&n.zoom.zoomOut(.1)})),j(g(n),"handleResetZoom",(function(){n.zoom&&n.zoom.reset()})),n.state={sectionMapping:{},selectedSections:new Set(n.props.selectedSections.filter((function(e){return!!e}))),tooltipActive:!1,tooltipSectionName:"",tooltipX:0,tooltipY:0,ticketGroups:n.props.ticketGroups,mapNotFound:!1,touchStarts:{},dragging:!1,isTouchDevice:!1},n.publicApi={updateTicketGroups:n.updateTicketGroups,highlightSection:n.highlightSection,unhighlightSection:n.unhighlightSection,selectSection:n.selectSection,deselectSection:n.deselectSection},n}var n,r,f;return b(t,e),n=t,(r=[{key:"componentDidMount",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isTouchDevice:this.isTouchDevice()}),e.prev=1,e.next=4,regeneratorRuntime.awrap(this.fetchMap());case 4:return this.setupMap(),e.next=7,regeneratorRuntime.awrap(this.fetchManifest());case 7:e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),console.error(e.t0),"MapNotFoundError"===e.t0.name&&this.setState({mapNotFound:!0});case 13:case"end":return e.stop()}}),null,this,[[1,9]])}},{key:"componentWillUnmount",value:function(){this.zoom&&this.zoom.teardown()}},{key:"componentDidUpdate",value:function(e,t){var n=Object(s.a)(t)!==Object(s.a)(this.state),r=void 0!==t.currentHoveredSection&&void 0===this.state.currentHoveredSection,o=!Object(i.a)(this.state.selectedSections,t.selectedSections);this.mapRoot.current&&(r||n||o)&&this.updateMap(),o&&this.props.onSelection(Array.from(this.state.selectedSections)),Object(s.c)(t)!==Object(s.c)(this.state)&&Object(s.c)(this.state).length>0&&console.warn("Unknown section names found in ticket groups: %o",Object(s.c)(this.state)),e.mouseControlEnabled!==this.props.mouseControlEnabled&&this.zoom&&(this.props.mouseControlEnabled?this.zoom.enable():this.zoom.disable())}},{key:"fetchMap",value:function(){var e,t,n;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,regeneratorRuntime.awrap(fetch("".concat(this.configFilePath,"/map.svg")));case 2:if((e=r.sent).ok){r.next=5;break}throw new E;case 5:return r.next=7,regeneratorRuntime.awrap(e.text());case 7:t=r.sent,this.mapRoot.current&&(this.mapRoot.current.innerHTML=t,(n=this.mapRoot.current.querySelector("svg"))&&this.props.mouseControlEnabled&&(this.zoom=Object(c.a)(n)));case 9:case"end":return r.stop()}}),null,this)}},{key:"fetchManifest",value:function(){var e,t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(fetch("".concat(this.configFilePath,"/manifest.json")));case 2:if((e=n.sent).ok){n.next=5;break}throw Error("There was an error fetching the venue map data, please try again");case 5:return n.next=7,regeneratorRuntime.awrap(e.json());case 7:t=n.sent,this.setState({sectionMapping:Object.keys(t.sections).reduce((function(e,t){return p({},e,j({},t.toLowerCase(),{sectionName:t}))}),{})});case 9:case"end":return n.stop()}}),null,this)}},{key:"setupMap",value:function(){var e=this.getMapRootElement();if(e){var t=e.querySelector("svg");t&&(Object.assign(t.style,{position:"absolute",zIndex:0,top:0,left:0,height:"100%",width:"100%"}),this.setUnavailableColors(),t.querySelectorAll("*[data-section-id]").forEach((function(e){var t=e.getAttribute("data-section-id");t&&e.setAttribute("data-section-id",t.toLowerCase())})),t.querySelectorAll("text").forEach((function(e){e.style.pointerEvents="none"})),this.setState({mapSvg:t}))}}},{key:"updateMap",value:function(){var e=this;this.fillUnavailableColors(),Object(s.e)(this.state).forEach((function(t){e.fillSection(t.toLowerCase(),e.state.selectedSections.has(t))}))}},{key:"fillSection",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Object(s.e)(this.state).includes(e);r&&this.fillPathsForSection((function(){return{fill:t.getDefaultColor(Object(s.d)(t.state)[e]),opacity:n?"1":"0.6","stroke-width":"1",stroke:n?"#4a4a4a":"#FFFFFF",cursor:"pointer"}}),e)}},{key:"getSectionFromTarget",value:function(e){if(e){var t=e.closest("[data-section-id]");if(t){var n=t.getAttribute("data-section-id");if(n)return n.toLowerCase()}}}},{key:"getDefaultColor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((function(e){return e.price})).sort((function(e,t){return e-t}))[0],n=Object(s.b)(this.state,this.props),r=!0,o=!1,i=void 0;try{for(var a,u=n[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var l=a.value;if(l.max>t)return l.color}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n[n.length-1].color}},{key:"doHover",value:function(e,t,n){var r=this.getSectionFromTarget(e);r&&Object(s.e)(this.state).includes(r)&&(this.highlightSection(r),this.setState({tooltipActive:void 0!==t&&void 0!==n,tooltipX:void 0!==t?t:0,tooltipY:void 0!==n?n:0,tooltipSectionName:this.state.sectionMapping[r].sectionName,currentHoveredSection:r}))}},{key:"doHoverCleanup",value:function(e){if(!e||"text"!==e.nodeName.toLowerCase()){var t=this.getSectionFromTarget(e);t&&t===this.state.currentHoveredSection||this.setState({tooltipActive:!1,currentHoveredSection:void 0})}}},{key:"doSelect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.currentHoveredSection;e&&this.toggleSectionSelect(e,!this.state.selectedSections.has(e))}},{key:"render",value:function(){var e=this;return this.state.mapNotFound?o.a.createElement("div",{style:{left:0,position:"relative",textAlign:"left"}},o.a.createElement("div",{style:{color:"white",fontFamily:"Nunito Sans",padding:"50px 30px",position:"absolute",textAlign:"left"}},o.a.createElement("div",{style:{fontWeight:600,fontSize:"1.375em"}},"Seating chart not available."),o.a.createElement("div",{style:{fontWeight:300}},"(It was abducted by aliens)")),o.a.createElement("img",{src:"https://maps.ticketevolution.com/maps/not_available.jpg",style:{width:"100%",textAlign:"left"}})):o.a.createElement("div",{ref:this.container,onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut,onMouseMove:this.onMouseMove,onClick:this.onClick,onTouchEnd:this.onTouchEnd,onTouchMove:this.onTouchMove,style:{position:"relative",fontFamily:this.props.mapFontFamily,height:"100%",width:"100%",pointerEvents:this.props.mouseControlEnabled?"initial":"none"}},!this.state.isTouchDevice&&o.a.createElement(u.a,{isActive:this.state.tooltipActive,x:this.state.tooltipX,y:this.state.tooltipY,name:this.state.tooltipSectionName,color:this.state.currentHoveredSection?this.getDefaultColor(Object(s.d)(this.state)[this.state.currentHoveredSection]):"",ticketGroups:Object(s.a)(this.state).filter((function(t){return t.section===e.state.currentHoveredSection}))}),o.a.createElement("div",{ref:this.mapRoot,style:{cursor:"-webkit-grab",opacity:this.state.mapSvg?1:0}}),this.state.mapSvg&&o.a.createElement(a.a,{onClearSelection:this.clearSelection,ranges:Object(s.b)(this.state,this.props),showLegend:this.props.showLegend,showControls:this.props.showControls,onZoomIn:this.handleZoomIn,onZoomOut:this.handleZoomOut,onResetZoom:this.handleResetZoom}),this.state.isTouchDevice&&this.props.mouseControlEnabled&&o.a.createElement(l.a,null))}},{key:"configFilePath",get:function(){return"".concat(this.props.mapsDomain,"/").concat(this.props.venueId,"/").concat(this.props.configurationId)}}])&&h(n.prototype,r),f&&h(n,f),t}(r.Component);j(S,"defaultProps",{mapsDomain:"https://maps.ticketevolution.com",onSelection:function(){},selectedSections:[],sectionPercentiles:{.2:"#FFC515",.4:"#f2711c",.6:"#D6226A",.8:"#a333c8",1:"#2A6EBB"},ticketGroups:[],showLegend:!0,showControls:!0,mouseControlEnabled:!0,mapFontFamily:"inherit"})},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));n(23),n(16),n(52),n(107),n(81);var r=n(0),o=n.n(r);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;ne.parentElement.clientWidth&&(o[1]="left"),r0&&e.left<=window.innerWidth&&e.left+e.width>0})),v(d(n),"handleViewportChange",(function(){if(!n.state.discovered){var e=n.getCurrentContainer();if(e){var t=e.getBoundingClientRect();n.shouldHide(t)&&setTimeout(n.hide,4e3)}}})),n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){window.addEventListener("wheel",e.handleViewportChange),window.addEventListener("resize",e.handleViewportChange),e.handleViewportChange()}),500)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("wheel",this.handleViewportChange),window.removeEventListener("resize",this.handleViewportChange)}},{key:"render",value:function(){var e=function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function g(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0||!Array.isArray(t)&&t?v({},e,t):{}}function k(e){var t=e.icon,n=e.mask,r=e.symbol,o=e.className,i=e.title,a=x(t),u=M("classes",[].concat(g(function(e){var t,n=e.spin,r=e.pulse,o=e.fixedWidth,i=e.inverse,a=e.border,u=e.listItem,l=e.flip,c=e.size,s=e.rotation,f=e.pull,p=(v(t={"fa-spin":n,"fa-pulse":r,"fa-fw":o,"fa-inverse":i,"fa-border":a,"fa-li":u,"fa-flip-horizontal":"horizontal"===l||"both"===l,"fa-flip-vertical":"vertical"===l||"both"===l},"fa-".concat(c),null!=c),v(t,"fa-rotate-".concat(s),null!=s),v(t,"fa-pull-".concat(f),null!=f),v(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(p).map((function(e){return p[e]?e:null})).filter((function(e){return e}))}(e)),g(o.split(" ")))),l=M("transform","string"==typeof e.transform?f.b.transform(e.transform):e.transform),c=M("mask",x(n)),s=Object(f.a)(a,y({},u,l,c,{symbol:r,title:i}));if(!s)return function(){var e;!w&&console&&"function"==typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find icon",a),null;var p=s.abstract,d={};return Object.keys(e).forEach((function(t){k.defaultProps.hasOwnProperty(t)||(d[t]=e[t])})),j(p[0],d)}k.displayName="FontAwesomeIcon",k.propTypes={border:d.a.bool,className:d.a.string,mask:d.a.oneOfType([d.a.object,d.a.array,d.a.string]),fixedWidth:d.a.bool,inverse:d.a.bool,flip:d.a.oneOf(["horizontal","vertical","both"]),icon:d.a.oneOfType([d.a.object,d.a.array,d.a.string]),listItem:d.a.bool,pull:d.a.oneOf(["right","left"]),pulse:d.a.bool,rotation:d.a.oneOf([90,180,270]),size:d.a.oneOf(["lg","xs","sm","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:d.a.bool,symbol:d.a.oneOfType([d.a.bool,d.a.string]),title:d.a.string,transform:d.a.oneOfType([d.a.string,d.a.object]),swapOpacity:d.a.bool},k.defaultProps={border:!1,className:"",mask:null,fixedWidth:!1,inverse:!1,flip:null,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,symbol:!1,title:"",transform:null,swapOpacity:!1};var j=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof n)return n;var o=(n.children||[]).map((function(n){return e(t,n)})),i=Object.keys(n.attributes||{}).reduce((function(e,t){var r=n.attributes[t];switch(t){case"class":e.attrs.className=r,delete n.attributes.class;break;case"style":e.attrs.style=r.split(";").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var n,r=t.indexOf(":"),o=b(t.slice(0,r)),i=t.slice(r+1).trim();return o.startsWith("webkit")?e[(n=o,n.charAt(0).toUpperCase()+n.slice(1))]=i:e[o]=i,e}),{});break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?e.attrs[t.toLowerCase()]=r:e.attrs[b(t)]=r}return e}),{attrs:{}}),a=r.style,u=void 0===a?{}:a,l=m(r,["style"]);return i.attrs.style=y({},i.attrs.style,u),t.apply(void 0,[n.tag,y({},i.attrs,l)].concat(g(o)))}.bind(null,o.a.createElement);function E(){return(E=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function C(e){var t=e.icon,n=e.text,r=e.style,i=e.isMobile,a=L(e,["icon","text","style","isMobile"]);return o.a.createElement("div",E({},a,{style:T({backgroundColor:"transparent",borderRadius:0,padding:i?"0.25em 0.5em":"0.5em 1em",outline:"none",cursor:"pointer",border:"none",display:"flex",alignItems:"center",justifyContent:"center"},r||{})}),t&&o.a.createElement(k,{icon:t,style:n?{marginRight:i?4:8}:{}}),n)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;t0&&t&&o.a.createElement("div",{style:{position:"absolute",backgroundColor:"white",right:-2,border:"2px solid lightgray",borderRadius:"0 0 5px 5px"}},r.map((function(e){return o.a.createElement("div",{key:e.color,style:{padding:8,textAlign:"left"}},o.a.createElement(z,{color:e.color,style:{marginRight:8}}),o.a.createElement("span",null,W(Math.floor(e.min))," - ",W(Math.ceil(e.max))))}))))}}])&&A(n.prototype,r),u&&A(n,u),t}(r.Component);function H(){return(H=Object.assign||function(e){for(var t=1;ta&&e.stopPropagation()}function z(e){if(_){var t=r(y(e.clientX,e.clientY),2),n=t[0],o=t[1],i=r(y(E,S),2),a=i[0],u=i[1];m.x=f-n+a,m.y=p-o+u}}function I(){_=!1}var A=function(){var e=document.createElement("iframe");if(e.src="#",document.body.appendChild(e),!e.contentDocument)throw new Error("unable to create an iframe to test for line height");e.contentDocument.open(),e.contentDocument.write("a"),e.contentDocument.close();var t=e.contentDocument.querySelector("span");if(!t)throw new Error("unable to find test element for line height test");var n=t.offsetHeight;return document.body.removeChild(e),n}();function D(e){var t,n;if(e.deltaMode===WheelEvent.DOM_DELTA_PIXEL)t=e.deltaX,n=e.deltaY;else{if(e.deltaMode!==WheelEvent.DOM_DELTA_LINE)return;t=e.deltaX*A,n=e.deltaY*A}if(e.preventDefault(),g(),e.ctrlKey){var r=n;m.height=m.height*(1+r/window.innerHeight*o),m.width=m.width*(1+r/window.innerWidth*o),k(0-(m.width-h)/2,0-(m.height-d)/2)}else k(t*i,n*i)}function R(e){T||(g(),m.width=1*x/e.scale,m.height=1*M/e.scale,m.x-=(m.width-h)/2,m.y-=(m.height-d)/2)}function U(){e.addEventListener("touchstart",O,{passive:!1}),e.addEventListener("touchmove",L,{passive:!1}),e.addEventListener("touchend",C,{passive:!1}),e.addEventListener("mousedown",N),e.addEventListener("click",P),e.addEventListener("mousemove",z),e.addEventListener("mouseup",I),e.addEventListener("mouseleave",I),e.addEventListener("wheel",D),e.addEventListener("gesturestart",l,{passive:!1}),e.addEventListener("gesturechange",l,{passive:!1}),e.addEventListener("gesturechange",R),e.addEventListener("gestureend",l,{passive:!1})}function F(){e.removeEventListener("touchstart",O),e.removeEventListener("touchmove",L),e.removeEventListener("touchend",C),e.removeEventListener("mousedown",N),e.removeEventListener("click",P),e.removeEventListener("mousemove",z),e.removeEventListener("mouseup",I),e.removeEventListener("mouseleave",I),e.removeEventListener("wheel",D),e.removeEventListener("gesturestart",l),e.removeEventListener("gesturechange",l),e.removeEventListener("gesturechange",R),e.removeEventListener("gestureend",l)}return U(),{zoomIn:function(e){j(1-e)},zoomOut:function(e){j(1+e)},reset:function(){m.x=b,m.y=w,m.width=x,m.height=M},teardown:F,enable:U,disable:F}}},function(e,t,n){n(172),e.exports=n(171)},function(e,t,n){"use strict";var r=n(9),o=n(28),i=n(54),a=n(55),u=n(127),l=n(128),c=Math.max,s=Math.min,f=Math.floor,p=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g;n(129)("replace",2,(function(e,t,n,h){return[function(r,o){var i=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},function(e,t){var o=h(n,e,this,t);if(o.done)return o.value;var f=r(e),p=String(this),d="function"==typeof t;d||(t=String(t));var y=f.global;if(y){var m=f.unicode;f.lastIndex=0}for(var g=[];;){var b=l(f,p);if(null===b)break;if(g.push(b),!y)break;""===String(b[0])&&(f.lastIndex=u(p,i(f.lastIndex),m))}for(var w,x="",M=0,k=0;k=M&&(x+=p.slice(M,E)+C,M=E+j.length)}return x+p.slice(M)}];function v(e,t,r,i,a,u){var l=r+e.length,c=i.length,s=d;return void 0!==a&&(a=o(a),s=p),n.call(u,s,(function(n,o){var u;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(l);case"<":u=a[o.slice(1,-1)];break;default:var s=+o;if(0===s)return n;if(s>c){var p=f(s/10);return 0===p?n:p<=c?void 0===i[p-1]?o.charAt(1):i[p-1]+o.charAt(1):n}u=i[s-1]}return void 0===u?"":u}))}}))},function(e,t,n){"use strict";var r=n(87)(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},function(e,t,n){"use strict";var r=n(56),o=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw new TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(e,t)}},function(e,t,n){"use strict";n(130);var r=n(18),o=n(20),i=n(14),a=n(45),u=n(2),l=n(88),c=u("species"),s=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})),f=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var p=u(e),d=!i((function(){var t={};return t[p]=function(){return 7},7!=""[e](t)})),h=d?!i((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[c]=function(){return n}),n[p](""),!t})):void 0;if(!d||!h||"replace"===e&&!s||"split"===e&&!f){var v=/./[p],y=n(a,p,""[e],(function(e,t,n,r,o){return t.exec===l?d&&!o?{done:!0,value:v.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),m=y[0],g=y[1];r(String.prototype,e,m),o(RegExp.prototype,p,2==t?function(e,t){return g.call(e,this,t)}:function(e){return g.call(e,this)})}}},function(e,t,n){"use strict";var r=n(88);n(7)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(e,t,n){e.exports=n(57)("native-function-to-string",Function.toString)},function(e,t,n){"use strict";var r,o,i,a,u=n(46),l=n(4),c=n(31),s=n(56),f=n(7),p=n(10),d=n(32),h=n(71),v=n(72),y=n(133),m=n(93).set,g=n(134)(),b=n(96),w=n(135),x=n(136),M=n(137),k=l.TypeError,j=l.process,E=j&&j.versions,S=E&&E.v8||"",T=l.Promise,O="process"==s(j),L=function(){},C=o=b.f,_=!!function(){try{var e=T.resolve(1),t=(e.constructor={})[n(2)("species")]=function(e){e(L,L)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(L)instanceof t&&0!==S.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(e){}}(),N=function(e){var t;return!(!p(e)||"function"!=typeof(t=e.then))&&t},P=function(e,t){if(!e._n){e._n=!0;var n=e._c;g((function(){for(var r=e._v,o=1==e._s,i=0,a=function(t){var n,i,a,u=o?t.ok:t.fail,l=t.resolve,c=t.reject,s=t.domain;try{u?(o||(2==e._h&&A(e),e._h=1),!0===u?n=r:(s&&s.enter(),n=u(r),s&&(s.exit(),a=!0)),n===t.promise?c(k("Promise-chain cycle")):(i=N(n))?i.call(n,l,c):l(n)):c(r)}catch(e){s&&!a&&s.exit(),c(e)}};n.length>i;)a(n[i++]);e._c=[],e._n=!1,t&&!e._h&&z(e)}))}},z=function(e){m.call(l,(function(){var t,n,r,o=e._v,i=I(e);if(i&&(t=w((function(){O?j.emit("unhandledRejection",o,e):(n=l.onunhandledrejection)?n({promise:e,reason:o}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",o)})),e._h=O||I(e)?2:1),e._a=void 0,i&&t.e)throw t.v}))},I=function(e){return 1!==e._h&&0===(e._a||e._c).length},A=function(e){m.call(l,(function(){var t;O?j.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},D=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),P(t,!0))},R=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw k("Promise can't be resolved itself");(t=N(e))?g((function(){var r={_w:n,_d:!1};try{t.call(e,c(R,r,1),c(D,r,1))}catch(e){D.call(r,e)}})):(n._v=e,n._s=1,P(n,!1))}catch(e){D.call({_w:n,_d:!1},e)}}};_||(T=function(e){h(this,T,"Promise","_h"),d(e),r.call(this);try{e(c(R,this,1),c(D,this,1))}catch(e){D.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(73)(T.prototype,{then:function(e,t){var n=C(y(this,T));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?j.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&P(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r;this.promise=e,this.resolve=c(R,e,1),this.reject=c(D,e,1)},b.f=C=function(e){return e===T||e===a?new i(e):o(e)}),f(f.G+f.W+f.F*!_,{Promise:T}),n(50)(T,"Promise"),n(97)("Promise"),a=n(29).Promise,f(f.S+f.F*!_,"Promise",{reject:function(e){var t=C(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(u||!_),"Promise",{resolve:function(e){return M(u&&this===a?T:this,e)}}),f(f.S+f.F*!(_&&n(74)((function(e){T.all(e).catch(L)}))),"Promise",{all:function(e){var t=this,n=C(t),r=n.resolve,o=n.reject,i=w((function(){var n=[],i=0,a=1;v(e,!1,(function(e){var u=i++,l=!1;n.push(void 0),a++,t.resolve(e).then((function(e){l||(l=!0,n[u]=e,--a||r(n))}),o)})),--a||r(n)}));return i.e&&o(i.v),n.promise},race:function(e){var t=this,n=C(t),r=n.reject,o=w((function(){v(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return o.e&&r(o.v),n.promise}})},function(e,t,n){var r=n(9),o=n(32),i=n(2)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[i])?t:o(n)}},function(e,t,n){var r=n(4),o=n(93).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,l="process"==n(37)(a);e.exports=function(){var e,t,n,c=function(){var r,o;for(l&&(r=a.domain)&&r.exit();e;){o=e.fn,e=e.next;try{o()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(l)n=function(){a.nextTick(c)};else if(!i||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var s=u.resolve(void 0);n=function(){s.then(c)}}else n=function(){o.call(r,c)};else{var f=!0,p=document.createTextNode("");new i(c).observe(p,{characterData:!0}),n=function(){p.data=f=!f}}return function(r){var o={fn:r,next:void 0};t&&(t.next=o),e||(e=o,n()),t=o}}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(4).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){var r=n(9),o=n(10),i=n(96);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(12),o=n(33),i=n(59),a=n(51),u=n(28),l=n(99),c=Object.assign;e.exports=!c||n(14)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=c({},e)[n]||Object.keys(c({},t)).join("")!=r}))?function(e,t){for(var n=u(e),c=arguments.length,s=1,f=i.f,p=a.f;c>s;)for(var d,h=l(arguments[s++]),v=f?o(h).concat(f(h)):o(h),y=v.length,m=0;y>m;)d=v[m++],r&&!p.call(h,d)||(n[d]=h[d]);return n}:c},function(e,t,n){var r=n(55),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(33),o=n(59),i=n(51);e.exports=function(e){var t=r(e),n=o.f;if(n)for(var a,u=n(e),l=i.f,c=0;u.length>c;)l.call(e,a=u[c++])&&t.push(a);return t}},function(e,t,n){var r=n(37);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(15),o=n(9),i=n(33);e.exports=n(12)?Object.defineProperties:function(e,t){o(e);for(var n,a=i(t),u=a.length,l=0;u>l;)r.f(e,n=a[l++],t[n]);return e}},function(e,t,n){var r=n(22),o=n(78).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(r(e))}},function(e,t,n){"use strict";var r=n(60),o=n(48),i=n(50),a={};n(20)(a,n(2)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(a,{next:o(1,n)}),i(e,t+" Iterator")}},function(e,t,n){var r=n(30),o=n(28),i=n(75)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){"use strict"; /** @license React v16.12.0 * react.production.min.js * diff --git a/build/tevomaps.js.gz b/build/tevomaps.js.gz index 86dc1b9..9f61d23 100644 Binary files a/build/tevomaps.js.gz and b/build/tevomaps.js.gz differ diff --git a/package-lock.json b/package-lock.json index 0481962..c26d883 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ticketevolution/seatmaps-client", - "version": "1.3.2", + "version": "1.3.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 340819a..550c81f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ticketevolution/seatmaps-client", - "version": "1.3.2", + "version": "1.3.4", "description": "A client side JavaScript library that enables users to view interactive seating charts for tickets available via the Ticket Evolution API.", "keywords": [ "Ticket Evolution", diff --git a/src/TicketMap/index.tsx b/src/TicketMap/index.tsx index b4735af..0fda81f 100644 --- a/src/TicketMap/index.tsx +++ b/src/TicketMap/index.tsx @@ -405,6 +405,9 @@ export default class TicketMap extends Component { } getSectionFromTarget(target: HTMLElement) { + if (!target) { + return; + } const element = target.closest("[data-section-id]"); if (!element) { return; diff --git a/src/__tests__/TicketMap/index.test.tsx b/src/__tests__/TicketMap/index.test.tsx index 4fc2cf5..b3b0ec8 100644 --- a/src/__tests__/TicketMap/index.test.tsx +++ b/src/__tests__/TicketMap/index.test.tsx @@ -680,12 +680,18 @@ describe("TicketMap", () => { describe("getSectionFromTarget", () => { let target: HTMLElement; - it("should return undefined if section has empty id", async () => { + it("returns undefined if section has empty id", async () => { target = document.createElement("path"); target.setAttribute("data-section-id", ""); expect(wrapper.instance().getSectionFromTarget(target)).toBeUndefined(); }); + + it("returns undefined if passed target is undefined", async () => { + expect( + wrapper.instance().getSectionFromTarget(null as any) + ).toBeUndefined(); + }); }); describe("getDefaultColor", () => {