From 66c01c829e6d4de72ab92380c29fd0b5c3c20b35 Mon Sep 17 00:00:00 2001 From: Jon Waldstein Date: Mon, 12 Apr 2021 09:28:50 -0400 Subject: [PATCH] refactor: replace grey with gray, add active text states, adjust details link style, and add more css classnames to elements --- build/index.asset.php | 2 +- build/index.js | 2 +- build/index.js.map | 2 +- src/components/Event.js | 18 +++++++++++------- src/components/EventList.js | 17 +++++++++++++++-- tailwind.config.js | 10 +++++----- 6 files changed, 34 insertions(+), 17 deletions(-) diff --git a/build/index.asset.php b/build/index.asset.php index 3dd09f8..8352ba8 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '8fd717a59276874d7127b38319ea255f'); \ No newline at end of file + array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '563e7517e9360406fa4bff7cf1d8dc9f'); \ No newline at end of file diff --git a/build/index.js b/build/index.js index 6a7d841..f652f17 100644 --- a/build/index.js +++ b/build/index.js @@ -3,4 +3,4 @@ Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/!function(){"use strict";var t={}.hasOwnProperty;function a(){for(var o=[],r=0;r=0)return r.ownerDocument.body;if(Object(m.b)(r)){var t=Object(n.a)(r),i=t.overflow,l=t.overflowX,p=t.overflowY;if(/auto|scroll|overlay|hidden/.test(i+p+l))return r}return o(a(r))}(o),p="body"===Object(e.a)(t),c=p?Object(i.a)(t):t,s=r.concat(c);return p?s:s.concat(l(a(c)))}},function(o,r,t){"use strict";t.d(r,"a",(function(){return m}));var e=t(15),a=t(11),n=t(18);function m(o){return Object(e.a)(Object(a.a)(o)).left+Object(n.a)(o).scrollLeft}},function(o,r,t){"use strict";t.d(r,"a",(function(){return c}));var e=t(15),a=t(18),n=t(5),m=t(4);var i=t(8),l=t(23),p=t(11);function c(o,r,t){var c;void 0===t&&(t=!1);var s,d,_=Object(e.a)(o),f={scrollLeft:0,scrollTop:0},u={x:0,y:0};return t||("body"!==Object(i.a)(r)&&(f=(s=r)!==Object(n.a)(s)&&Object(m.b)(s)?{scrollLeft:(d=s).scrollLeft,scrollTop:d.scrollTop}:Object(a.a)(s)),Object(m.b)(r)?((u=Object(e.a)(r)).x+=r.clientLeft,u.y+=r.clientTop):(c=Object(p.a)(r))&&(u.x=Object(l.a)(c))),{x:_.left+f.scrollLeft-u.x,y:_.top+f.scrollTop-u.y,width:_.width,height:_.height}}},function(o,r){!function(){o.exports=this.wp.date}()},function(o,r,t){"use strict";t.d(r,"popperGenerator",(function(){return _}));var e=t(24),a=t(19),n=t(22),m=t(13),i=t(38),l=t(40),p=t(39),c=t(4),s={placement:"bottom",modifiers:[],strategy:"absolute"};function d(){for(var o=arguments.length,r=new Array(o),t=0;t=200&&o<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},e.forEach(["delete","get","head"],(function(o){l.headers[o]={}})),e.forEach(["post","put","patch"],(function(o){l.headers[o]=e.merge(n)})),o.exports=l}).call(this,t(59))},function(o,r,t){"use strict";var e=t(10),a=t(61),n=t(29),m=t(63),i=t(66),l=t(67),p=t(33);o.exports=function(o){return new Promise((function(r,c){var s=o.data,d=o.headers;e.isFormData(s)&&delete d["Content-Type"];var _=new XMLHttpRequest;if(o.auth){var f=o.auth.username||"",u=o.auth.password||"";d.Authorization="Basic "+btoa(f+":"+u)}var g=m(o.baseURL,o.url);if(_.open(o.method.toUpperCase(),n(g,o.params,o.paramsSerializer),!0),_.timeout=o.timeout,_.onreadystatechange=function(){if(_&&4===_.readyState&&(0!==_.status||_.responseURL&&0===_.responseURL.indexOf("file:"))){var t="getAllResponseHeaders"in _?i(_.getAllResponseHeaders()):null,e={data:o.responseType&&"text"!==o.responseType?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:t,config:o,request:_};a(r,c,e),_=null}},_.onabort=function(){_&&(c(p("Request aborted",o,"ECONNABORTED",_)),_=null)},_.onerror=function(){c(p("Network Error",o,null,_)),_=null},_.ontimeout=function(){var r="timeout of "+o.timeout+"ms exceeded";o.timeoutErrorMessage&&(r=o.timeoutErrorMessage),c(p(r,o,"ECONNABORTED",_)),_=null},e.isStandardBrowserEnv()){var b=t(68),h=(o.withCredentials||l(g))&&o.xsrfCookieName?b.read(o.xsrfCookieName):void 0;h&&(d[o.xsrfHeaderName]=h)}if("setRequestHeader"in _&&e.forEach(d,(function(o,r){void 0===s&&"content-type"===r.toLowerCase()?delete d[r]:_.setRequestHeader(r,o)})),e.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),o.responseType)try{_.responseType=o.responseType}catch(r){if("json"!==o.responseType)throw r}"function"==typeof o.onDownloadProgress&&_.addEventListener("progress",o.onDownloadProgress),"function"==typeof o.onUploadProgress&&_.upload&&_.upload.addEventListener("progress",o.onUploadProgress),o.cancelToken&&o.cancelToken.promise.then((function(o){_&&(_.abort(),c(o),_=null)})),void 0===s&&(s=null),_.send(s)}))}},function(o,r,t){"use strict";var e=t(62);o.exports=function(o,r,t,a,n){var m=new Error(o);return e(m,r,t,a,n)}},function(o,r,t){"use strict";var e=t(10);o.exports=function(o,r){r=r||{};var t={},a=["url","method","params","data"],n=["headers","auth","proxy"],m=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];e.forEach(a,(function(o){void 0!==r[o]&&(t[o]=r[o])})),e.forEach(n,(function(a){e.isObject(r[a])?t[a]=e.deepMerge(o[a],r[a]):void 0!==r[a]?t[a]=r[a]:e.isObject(o[a])?t[a]=e.deepMerge(o[a]):void 0!==o[a]&&(t[a]=o[a])})),e.forEach(m,(function(e){void 0!==r[e]?t[e]=r[e]:void 0!==o[e]&&(t[e]=o[e])}));var i=a.concat(n).concat(m),l=Object.keys(r).filter((function(o){return-1===i.indexOf(o)}));return e.forEach(l,(function(e){void 0!==r[e]?t[e]=r[e]:void 0!==o[e]&&(t[e]=o[e])})),t}},function(o,r,t){"use strict";function e(o){this.message=o}e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,o.exports=e},function(o,r){!function(){o.exports=this.wp.domReady}()},function(o,r){!function(){o.exports=this.ReactDOM}()},function(o,r,t){"use strict";t.d(r,"a",(function(){return n}));var e=t(1);function a(o){var r=new Map,t=new Set,e=[];return o.forEach((function(o){r.set(o.name,o)})),o.forEach((function(o){t.has(o.name)||function o(a){t.add(a.name),[].concat(a.requires||[],a.requiresIfExists||[]).forEach((function(e){if(!t.has(e)){var a=r.get(e);a&&o(a)}})),e.push(a)}(o)})),e}function n(o){var r=a(o);return e.g.reduce((function(o,t){return o.concat(r.filter((function(o){return o.phase===t})))}),[])}},function(o,r,t){"use strict";function e(o){var r=o.reduce((function(o,r){var t=o[r.name];return o[r.name]=t?Object.assign({},t,{},r,{options:Object.assign({},t.options,{},r.options),data:Object.assign({},t.data,{},r.data)}):r,o}),{});return Object.keys(r).map((function(o){return r[o]}))}t.d(r,"a",(function(){return e}))},function(o,r,t){"use strict";function e(o){var r;return function(){return r||(r=new Promise((function(t){Promise.resolve().then((function(){r=void 0,t(o())}))}))),r}}t.d(r,"a",(function(){return e}))},function(o,r){!function(){o.exports=this.wp.blocks}()},function(o,r){!function(){o.exports=this.wp.blockEditor}()},function(o,r,t){o.exports=t(54)},,function(o,r){o.exports=function(o){if(Array.isArray(o))return o},o.exports.default=o.exports,o.exports.__esModule=!0},function(o,r){o.exports=function(o,r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(o)){var t=[],e=!0,a=!1,n=void 0;try{for(var m,i=o[Symbol.iterator]();!(e=(m=i.next()).done)&&(t.push(m.value),!r||t.length!==r);e=!0);}catch(o){a=!0,n=o}finally{try{e||null==i.return||i.return()}finally{if(a)throw n}}return t}},o.exports.default=o.exports,o.exports.__esModule=!0},function(o,r,t){var e=t(48);o.exports=function(o,r){if(o){if("string"==typeof o)return e(o,r);var t=Object.prototype.toString.call(o).slice(8,-1);return"Object"===t&&o.constructor&&(t=o.constructor.name),"Map"===t||"Set"===t?Array.from(o):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?e(o,r):void 0}},o.exports.default=o.exports,o.exports.__esModule=!0},function(o,r){o.exports=function(o,r){(null==r||r>o.length)&&(r=o.length);for(var t=0,e=new Array(r);t 0) {\n // Gecko, Trident, Chrome 34+\n e.returnValue = confirmationMessage;\n // Gecko, WebKit, Chrome <34\n // return should be explicit to allow `beforeunload` to work\n /* eslint-disable consistent-return */\n return confirmationMessage;\n }\n\n return;\n });\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/utils/messages.js\n// module id = 3\n// module chunks = 0\n//# sourceURL=webpack:///./src/utils/messages.js?")},function(module,exports,__webpack_require__){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.handleWidgetMisconfigured = exports.handleWidgetNotEligible = exports.handleWidgetModalClose = exports.handleWidgetRenderComplete = exports._createEventbriteLink = exports.resizeIframe = exports._iframeAutoAdaptPixelsTransform = undefined;\n\nvar _constants = __webpack_require__(1);\n\nvar constants = _interopRequireWildcard(_constants);\n\nvar _logging = __webpack_require__(2);\n\nvar _state = __webpack_require__(5);\n\nvar _window = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n/**\n * Get and filter iframeAutoAdapt value\n *\n * @param {Number} iframeAutoAdaptValue Height percentage based on viewport height\n * @return {Number} Number from 75 to 100\n */\nvar _getIframeAutoAdaptValue = function _getIframeAutoAdaptValue() {\n var iframeAutoAdaptValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : constants.IFRAME_AUTOADAPT_CONFIG.minValue;\n\n var isBiggerValue = iframeAutoAdaptValue > constants.IFRAME_AUTOADAPT_CONFIG.maxValue;\n var isSmallerValue = iframeAutoAdaptValue < constants.IFRAME_AUTOADAPT_CONFIG.minValue;\n\n if (isBiggerValue) {\n return constants.IFRAME_AUTOADAPT_CONFIG.maxValue;\n }\n if (isSmallerValue) {\n return constants.IFRAME_AUTOADAPT_CONFIG.minValue;\n }\n\n return iframeAutoAdaptValue;\n};\n\n/**\n * Calculate iframe height in pixels based on viewport height percentage given on iframeAutoAdapt\n */\nvar _iframeAutoAdaptPixelsTransform = exports._iframeAutoAdaptPixelsTransform = function _iframeAutoAdaptPixelsTransform(viewportHeight, iframeAutoAdaptValue) {\n var iframeHeightPixels = Math.floor(viewportHeight * _getIframeAutoAdaptValue(iframeAutoAdaptValue) / 100);\n var isIframeHeightShorterThanMinimum = iframeHeightPixels < constants.MINIMUM_IFRAME_HEIGHT;\n\n if (isIframeHeightShorterThanMinimum) {\n iframeHeightPixels = constants.MINIMUM_IFRAME_HEIGHT;\n }\n\n return iframeHeightPixels;\n};\n\nvar _shouldAdaptIframe = function _shouldAdaptIframe(userConfiguredHeight, userConfiguredIframeAutoAdapt, viewportHeight) {\n var viewPortClass = (0, _window.getViewportClass)();\n var isIframeTallerThanViewport = userConfiguredHeight > viewportHeight;\n var isSmallViewport = viewPortClass === _window.SMALL;\n var isIframeAutoAdaptEnabled = userConfiguredIframeAutoAdapt !== constants.IFRAME_AUTOADAPT_CONFIG.disabled;\n\n return isIframeTallerThanViewport && isSmallViewport && isIframeAutoAdaptEnabled;\n};\n\n/**\n * Resize the specified iframe to the appropriate height when the iframe has rendered.\n *\n * @param {Object} widgetInstance The widgetInstance containing the iframe and container\n */\nvar resizeIframe = exports.resizeIframe = function resizeIframe(widgetInstance) {\n var iframeHeight = void 0;\n\n var viewportHeight = (0, _window.getViewPortHeight)();\n var userConfiguredHeight = widgetInstance.userConfig.iframeContainerHeight;\n var userConfiguredIframeAutoAdapt = widgetInstance.userConfig.iframeAutoAdapt;\n\n if (_shouldAdaptIframe(userConfiguredHeight, userConfiguredIframeAutoAdapt, viewportHeight)) {\n iframeHeight = _iframeAutoAdaptPixelsTransform(viewportHeight, userConfiguredIframeAutoAdapt);\n } else {\n iframeHeight = userConfiguredHeight > constants.MINIMUM_IFRAME_HEIGHT ? userConfiguredHeight : constants.MINIMUM_IFRAME_HEIGHT;\n }\n widgetInstance.iframeContainer.style.height = iframeHeight + 'px';\n};\n\nvar _isEventbriteLinkRendered = function _isEventbriteLinkRendered(widgetInstance, linkId) {\n return widgetInstance.iframeContainer.parentNode.innerHTML.indexOf(linkId) > -1;\n};\n\n/**\n * Display a View On Eventbrite link below the widget container\n *\n * @param {Object} widgetInstance The widgetInstance containing the iframe and container\n * @param {Number} id The event or user id, used for targeting container in automation\n * @param {String} canonicalEventUrl The full canonical event url include event name slug\n * @param {String} translatedLinkText The translated \"View On Eventbrite\" text\n */\nvar _createEventbriteLink = exports._createEventbriteLink = function _createEventbriteLink(widgetInstance, id, canonicalEventUrl, translatedLinkText) {\n var widgetType = widgetInstance.userConfig.widgetType;\n var linkId = widgetType + '-widget-link-' + id;\n\n // If we refresh the page within the iframe we don't want multiple \"View On Eventbrite\" links\n if (_isEventbriteLinkRendered(widgetInstance, linkId)) {\n return;\n }\n\n var eventbriteLink = document.createElement('a');\n\n eventbriteLink.href = canonicalEventUrl + '?ref=' + constants.WIDGET_REF_CODES[widgetType];\n eventbriteLink.innerHTML = translatedLinkText;\n eventbriteLink.target = '_blank';\n\n eventbriteLink.style.display = 'block';\n eventbriteLink.style.margin = '10px 0';\n eventbriteLink.style.textDecoration = 'none';\n eventbriteLink.style.color = '#00ACAF';\n eventbriteLink.style.fontFamily = 'Benton Sans, Helvetica, Arial, sans-serif';\n eventbriteLink.style.textAlign = 'center';\n\n eventbriteLink.setAttribute('data-automation', linkId);\n\n widgetInstance.iframeContainer.parentNode.insertBefore(eventbriteLink, widgetInstance.iframeContainer.nextSibling);\n};\n\n/**\n * When the iframe is done rendering, resize the iframe and generate the View On Eventbrite link (inline widgets only).\n *\n * @param {Object} widgetInstance The widgetInstance containing the iframe and container\n * @param {Object} messageData The message data containing the widget height and translated link text\n */\nvar handleWidgetRenderComplete = exports.handleWidgetRenderComplete = function handleWidgetRenderComplete(widgetInstance, messageData) {\n if (widgetInstance.iframeContainer) {\n resizeIframe(widgetInstance);\n\n // Save the original iframe height on render so we can return it to its original size later\n widgetInstance.computedHeight = messageData.widgetHeight + 'px';\n\n if (messageData.canonicalEventUrl && messageData.translatedLinkText) {\n _createEventbriteLink(widgetInstance, messageData.eventId, messageData.canonicalEventUrl, messageData.translatedLinkText);\n }\n }\n\n var overlay = document.getElementById('eventbrite-widget-modal-overlay');\n var loader = document.getElementById('eventbrite-widget-modal-loader');\n\n if (overlay && loader) {\n overlay.removeChild(loader);\n }\n};\n\n/**\n * Close the modal when triggered\n */\nvar handleWidgetModalClose = exports.handleWidgetModalClose = function handleWidgetModalClose(widgetInstance) {\n var body = document.getElementsByTagName('body')[0];\n var overlay = document.getElementById('eventbrite-widget-modal-overlay');\n var _widgetInstance$widge = widgetInstance.widgetIdentifier;\n _widgetInstance$widge = _widgetInstance$widge === undefined ? {} : _widgetInstance$widge;\n var id = _widgetInstance$widge.id;\n\n var iframe = document.getElementById('eventbrite-widget-modal-' + id);\n\n overlay.style.opacity = 0;\n overlay.style.background = 'rgba(0, 0, 0, 0)';\n overlay.style.width = 0;\n overlay.style.height = 0;\n\n body.style.overflow = widgetInstance.originalBodyOverflow;\n body.style.position = widgetInstance.originalBodyPosition;\n\n if (iframe) {\n iframe.parentNode.removeChild(iframe);\n }\n\n if (widgetInstance.userConfig && widgetInstance.userConfig.onWidgetModalClose) {\n widgetInstance.userConfig.onWidgetModalClose();\n }\n};\n\n/**\n * Tell the parent window to, if possible, open a new window/tab to or redirect to the event listing on Eventbrite for events not currently supported by the widget (modal widget only).\n *\n * @param {Object} widgetInstance The widgetInstance containing the iframe and container\n * @param {Object} messageData The message data containing, at a minimum the eventId, and, optionally, the canonicalEventUrl\n */\nvar handleWidgetNotEligible = exports.handleWidgetNotEligible = function handleWidgetNotEligible(widgetInstance, messageData) {\n if (messageData.canonicalEventUrl) {\n (0, _window.redirectToUrl)(messageData.canonicalEventUrl);\n } else {\n (0, _window.redirectToUrl)((0, _window.getEventListingUrl)(messageData.eventId));\n }\n\n // Close the modal in case we opened a new window or tab.\n handleWidgetModalClose(widgetInstance, messageData);\n};\n\n/**\n * Display a message indicating that the widget is misconfigured, log the misconfiguration, and close the modal.\n *\n * @param {Object} widgetInstance The widgetInstance containing the iframe and container\n * @param {Object} messageData The message data containing the configured value for eventId or userId. Note that, if this handler is triggered, eventId or userId will not reference a valid Eventbrite event or user.\n */\nvar handleWidgetMisconfigured = exports.handleWidgetMisconfigured = function handleWidgetMisconfigured(widgetInstance, messageData) {\n var userConfig = widgetInstance.userConfig,\n _widgetInstance$widge2 = widgetInstance.widgetIdentifier;\n _widgetInstance$widge2 = _widgetInstance$widge2 === undefined ? {} : _widgetInstance$widge2;\n var _widgetInstance$widge3 = _widgetInstance$widge2.id,\n widgetId = _widgetInstance$widge3 === undefined ? 'unknown' : _widgetInstance$widge3,\n _widgetInstance$widge4 = _widgetInstance$widge2.idKey,\n widgetIdKey = _widgetInstance$widge4 === undefined ? 'id' : _widgetInstance$widge4,\n _widgetInstance$widge5 = _widgetInstance$widge2.idDisplayName,\n widgetIdDisplayName = _widgetInstance$widge5 === undefined ? 'Id' : _widgetInstance$widge5;\n\n var domElementId = 'unknown';\n\n if (userConfig) {\n domElementId = userConfig.modalTriggerElementId || userConfig.iframeContainerId || 'unknown';\n }\n\n (0, _logging.logError)('Widget ' + widgetIdKey + ' ' + widgetId + ' with domElementId ' + domElementId + ' misconfigured', _state.widgetHostname);\n (0, _logging.logErrorForUser)('Widget for ' + widgetIdKey + ' ' + widgetId + ' with domElementId ' + domElementId + ' is misconfigured. Check that ' + widgetIdKey + ' is valid.');\n\n /* eslint-disable no-alert */\n (0, _window.windowAlert)(widgetIdDisplayName + ' ' + widgetId + ' cannot be found. Please contact the site owner to resolve this issue.');\n\n handleWidgetModalClose(widgetInstance, messageData);\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/message_handlers.js\n// module id = 4\n// module chunks = 0\n//# sourceURL=webpack:///./src/message_handlers.js?")},function(module,exports,__webpack_require__){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.updateWidgetInstancesInCheckout = exports.getNumberWidgetInstancesInCheckout = exports.parentSiteIsHttps = exports.widgetHostname = exports.updateWidgetInstance = exports.getWidgetInstance = exports.getWidgetInstanceIdentifier = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _constants = __webpack_require__(1);\n\nvar _window = __webpack_require__(6);\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/** \n * Hashtable of widget instances based on widget type and widgetTypeId.\n * This will initialize the instance lookup with the valid types.\n * @type {[type]: {}}\n */\nvar widgetInstances = _constants.VALID_WIDGET_TYPES.reduce(function (instances, type) {\n return _extends({}, instances, _defineProperty({}, type, {}));\n}, {});\n\nvar widgetInstancesInCheckout = 0;\n\n/**\n * Get a widget id based on the widget config\n * @param {widgetType, } widgetConfig \n */\nvar getWidgetInstanceIdentifier = exports.getWidgetInstanceIdentifier = function getWidgetInstanceIdentifier(widgetConfig) {\n // Get widgetType and default to checkout type\n // Eg. {widgetType: 'checkout', ...}\n var _widgetConfig$widgetT = widgetConfig.widgetType,\n widgetType = _widgetConfig$widgetT === undefined ? _constants.WIDGET_TYPE_CHECKOUT : _widgetConfig$widgetT;\n // Get the widget config id key based on widget type\n // Eg. {'checkout': {idKey: 'eventId'}}\n\n var _ref = _constants.WIDGET_TYPE_IDS[widgetType] || {},\n idKey = _ref.idKey,\n idDisplayName = _ref.idDisplayName;\n // Get the widget type id value from the widget config\n // Eg. {eventId: ':id'}\n\n\n var id = widgetConfig[idKey];\n\n\n return {\n id: id,\n type: widgetType,\n idKey: idKey,\n idDisplayName: idDisplayName\n };\n};\n\n/**\n * Get a widget instance based on the widget config\n * @param {widgetConfig: {widgetType, } widgetConfig \n */\nvar getWidgetInstance = exports.getWidgetInstance = function getWidgetInstance(widgetConfig) {\n var _getWidgetInstanceIde = getWidgetInstanceIdentifier(widgetConfig),\n type = _getWidgetInstanceIde.type,\n id = _getWidgetInstanceIde.id;\n\n var _widgetInstances$type = widgetInstances[type];\n _widgetInstances$type = _widgetInstances$type === undefined ? {} : _widgetInstances$type;\n var widgetInstance = _widgetInstances$type[id];\n\n\n return widgetInstance;\n};\n\n/**\n * \n * @param {widgetIdentifier: {id, type}} widgetConfig \n * @param {Object} instanceData \n * @param {Boolean} initialize If true the instance will be reset with the supplied instanceData\n */\nvar updateWidgetInstance = exports.updateWidgetInstance = function updateWidgetInstance(widgetConfig) {\n var instanceData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var initialize = arguments[2];\n var _widgetConfig$widgetI = widgetConfig.widgetIdentifier;\n _widgetConfig$widgetI = _widgetConfig$widgetI === undefined ? {} : _widgetConfig$widgetI;\n var type = _widgetConfig$widgetI.type,\n id = _widgetConfig$widgetI.id;\n\n // Validate widget type and id\n\n if (_constants.VALID_WIDGET_TYPES.indexOf(type) < 0 || !id) {\n return undefined;\n }\n\n var prevWidgetInstance = widgetInstances[type][id];\n\n // Reset widgetInstance if initialize is true\n if (initialize === true) {\n prevWidgetInstance = {};\n }\n\n widgetInstances[type][id] = _extends({}, prevWidgetInstance, instanceData);\n\n return widgetInstances[type][id];\n};\n\nvar widgetHostname = exports.widgetHostname = (0, _window.getWidgetHostFromScript)();\n\nvar parentSiteIsHttps = exports.parentSiteIsHttps = (0, _window.isHttps)();\n\nvar getNumberWidgetInstancesInCheckout = exports.getNumberWidgetInstancesInCheckout = function getNumberWidgetInstancesInCheckout() {\n return widgetInstancesInCheckout;\n};\n\n/**\n * Increments or decrements the counter of widgets that are on the checkout process\n *\n * @param {Object} method It is expected to receive 'set' or 'remove'\n */\nvar updateWidgetInstancesInCheckout = exports.updateWidgetInstancesInCheckout = function updateWidgetInstancesInCheckout(method) {\n if (method === 'set') {\n widgetInstancesInCheckout += 1;\n } else {\n widgetInstancesInCheckout -= 1;\n }\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/state.js\n// module id = 5\n// module chunks = 0\n//# sourceURL=webpack:///./src/state.js?")},function(module,exports){eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _VIEW_PORT_CLASSES;\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// The \"useless\" escapes escape periods in our hostname regex\n/* eslint-disable no-useless-escape */\n\n// This includes all TLDs listed in ebapps/i18n/locale_defaults.py in core.\n// Some of them are not yet enabled in prod.\nvar EVENTBRITE_TLDS = ['be', 'ca', 'ca', 'cl', 'co', 'co\\\\.nz', 'co\\\\.uk', 'com', 'com\\\\.ar', 'com\\\\.au', 'com\\\\.br', 'com\\\\.mx', 'de', 'es', 'fr', 'hk', 'ie', 'in', 'it', 'nl', 'pe', 'pt', 'se', 'sg'];\n\nvar EVENTBRITE_DOMAIN_NAMES = ['eventbrite', 'evbstage', 'evbdev',\n// This will match all qa servers (from 0 to 99... note that at the time of writing, we only go till 18...)\n// This includes evbqa 5-7,16 that we do NOT control outside of our VPN: you should not access these outside of the VPN, even at the office,\n// more info here: https://confluence.evbhome.com/display/QA/Reserving+QA+Servers+for+Testing\n'evbqa\\\\d{0,2}'];\n\nvar EVENTBRITE_HOSTNAME_REGEX = new RegExp(\n// The extra \\ in front of \\d* here and the \\. above is necessary to escape the\n// escape character so it can be read as regex, not a normal string escape\n'^(www\\\\.)?(' + EVENTBRITE_DOMAIN_NAMES.join('|') + ')\\\\.(' + EVENTBRITE_TLDS.join('|') + ')$');\n\nvar PROTOCOL_REGEX = /^http(s)?:\\/\\//;\n\n/**\n * Get the widget script tag, i.e. the script tag that we've given organizers to place on their page.\n * This ensures the tld of the script tag matches the tld of the event we load in the iframe.\n *\n * @return {Object} The widget script element\n */\nvar _getWidgetScript = function _getWidgetScript() {\n // document.currentScript will return the widget script tag even if the async attribute is added\n // to the