ably-ui 8.7.0.dev.6053fb4 → 8.7.0.dev.7072b07

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +6 -6
  3. data/README.md +7 -3
  4. data/lib/ably_ui/core/code/component.css +2 -0
  5. data/lib/ably_ui/core/code/component.js +739 -1
  6. data/lib/ably_ui/core/company_autocomplete/component.css +2 -0
  7. data/lib/ably_ui/core/company_autocomplete/component.js +1161 -1
  8. data/lib/ably_ui/core/connect_state_wrapper/component.js +22 -1
  9. data/lib/ably_ui/core/contact_footer/component.css +2 -0
  10. data/lib/ably_ui/core/contact_footer/component.js +211 -1
  11. data/lib/ably_ui/core/cookie_message/component.css +2 -0
  12. data/lib/ably_ui/core/cookie_message/component.js +82 -1
  13. data/lib/ably_ui/core/core.rb +8 -4
  14. data/lib/ably_ui/core/customer_logos/component.js +22 -1
  15. data/lib/ably_ui/core/dropdown_menu/component.js +22 -1
  16. data/lib/ably_ui/core/feature_footer/component.css +2 -0
  17. data/lib/ably_ui/core/feature_footer/component.js +211 -1
  18. data/lib/ably_ui/core/featured_link/component.css +2 -0
  19. data/lib/ably_ui/core/featured_link/component.js +82 -1
  20. data/lib/ably_ui/core/flash/component.css +2 -0
  21. data/lib/ably_ui/core/flash/component.js +82 -1
  22. data/lib/ably_ui/core/footer/component.css +3 -1
  23. data/lib/ably_ui/core/footer/component.js +82 -1
  24. data/lib/ably_ui/core/footer/footer.html.erb +18 -23
  25. data/lib/ably_ui/core/icon/component.js +22 -1
  26. data/lib/ably_ui/core/images/best-support-2023.svg +1 -0
  27. data/lib/ably_ui/core/images/fastest-implementation-2023.svg +1 -0
  28. data/lib/ably_ui/core/images/high-performer-2023.svg +1 -0
  29. data/lib/ably_ui/core/images/highest-user-adoption-2023.svg +1 -0
  30. data/lib/ably_ui/core/loader/component.js +22 -1
  31. data/lib/ably_ui/core/logo/component.js +22 -1
  32. data/lib/ably_ui/core/meganav/component.css +3 -3
  33. data/lib/ably_ui/core/meganav/component.js +992 -1
  34. data/lib/ably_ui/core/meganav/component.json +1 -1
  35. data/lib/ably_ui/core/meganav/meganav.rb +4 -4
  36. data/lib/ably_ui/core/meganav_blog_posts_list/component.js +1159 -1
  37. data/lib/ably_ui/core/meganav_content_company/component.js +22 -1
  38. data/lib/ably_ui/core/meganav_content_company/meganav_content_company.html.erb +9 -0
  39. data/lib/ably_ui/core/meganav_content_developers/component.js +22 -1
  40. data/lib/ably_ui/core/meganav_content_developers/meganav_content_developers.html.erb +18 -2
  41. data/lib/ably_ui/core/meganav_content_products/component.js +22 -0
  42. data/lib/ably_ui/core/{meganav_content_platform/meganav_content_platform.html.erb → meganav_content_products/meganav_content_products.html.erb} +15 -33
  43. data/lib/ably_ui/core/{meganav_content_platform/meganav_content_platform.rb → meganav_content_products/meganav_content_products.rb} +1 -1
  44. data/lib/ably_ui/core/meganav_content_use_cases/component.js +22 -1
  45. data/lib/ably_ui/core/meganav_content_use_cases/meganav_content_use_cases.html.erb +42 -38
  46. data/lib/ably_ui/core/meganav_control/component.js +241 -1
  47. data/lib/ably_ui/core/meganav_control_mobile_dropdown/component.js +180 -1
  48. data/lib/ably_ui/core/meganav_control_mobile_panel_close/component.js +142 -1
  49. data/lib/ably_ui/core/meganav_control_mobile_panel_open/component.js +170 -1
  50. data/lib/ably_ui/core/meganav_items_desktop/component.js +22 -1
  51. data/lib/ably_ui/core/meganav_items_desktop/meganav_items_desktop.rb +1 -1
  52. data/lib/ably_ui/core/meganav_items_mobile/component.js +22 -1
  53. data/lib/ably_ui/core/meganav_items_signed_in/component.js +22 -1
  54. data/lib/ably_ui/core/meganav_search/component.js +22 -1
  55. data/lib/ably_ui/core/meganav_search_autocomplete/component.js +295 -1
  56. data/lib/ably_ui/core/meganav_search_panel/component.js +22 -1
  57. data/lib/ably_ui/core/meganav_search_suggestions/component.js +258 -1
  58. data/lib/ably_ui/core/notice/component.css +2 -0
  59. data/lib/ably_ui/core/notice/component.js +872 -1
  60. data/lib/ably_ui/core/scripts.js +1465 -1
  61. data/lib/ably_ui/core/showcase/component.css +2 -0
  62. data/lib/ably_ui/core/showcase/component.js +343 -1
  63. data/lib/ably_ui/core/sign_out_link/component.js +22 -1
  64. data/lib/ably_ui/core/slider/component.css +2 -0
  65. data/lib/ably_ui/core/slider/component.js +255 -1
  66. data/lib/ably_ui/core/sprites.svg +93 -0
  67. data/lib/ably_ui/core/styles.css +3 -7
  68. data/lib/ably_ui/core/uptime/component.css +2 -0
  69. data/lib/ably_ui/core/uptime/component.js +82 -1
  70. data/lib/ably_ui/reset/scripts.js +1 -1
  71. data/lib/ably_ui/reset/styles.css +1 -11
  72. data/lib/ably_ui/version.rb +1 -1
  73. metadata +9 -5
  74. data/lib/ably_ui/core/meganav_content_platform/component.js +0 -1
@@ -1 +1,1465 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("array-flat-polyfill"),require("react"),require("react-dom"),require("redux")):"function"==typeof define&&define.amd?define([,,,],e):"object"==typeof exports?exports.AblyUi=e(require("array-flat-polyfill"),require("react"),require("react-dom"),require("redux")):(t.AblyUi=t.AblyUi||{},t.AblyUi.Core=e(t[void 0],t[void 0],t[void 0],t[void 0]))}(this,(function(t,e,r,n){return(()=>{var o={757:(t,e,r)=>{t.exports=r(666)},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===d)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=P(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?h:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=h,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f="suspendedStart",p="suspendedYield",d="executing",h="completed",v={};function y(){}function g(){}function b(){}var m={};m[i]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(A([])));x&&x!==r&&n.call(x,i)&&(m=x);var O=b.prototype=y.prototype=Object.create(m);function j(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,c){var u=l(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:_}}function _(){return{value:e,done:!0}}return g.prototype=O.constructor=b,b.constructor=g,g.displayName=u(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},t.awrap=function(t){return{__await:t}},j(S.prototype),S.prototype[a]=function(){return this},t.AsyncIterator=S,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new S(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(O),u(O,c,"Generator"),O[i]=function(){return this},O.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=A,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},806:e=>{"use strict";e.exports=t},281:t=>{"use strict";t.exports=e},645:t=>{"use strict";t.exports=r},44:t=>{"use strict";t.exports=n}},i={};function a(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return o[t](r,r.exports,a),r.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var c={};return(()=>{"use strict";a.r(c),a.d(c,{attachStoreToWindow:()=>y,connectState:()=>b,createRemoteDataStore:()=>m,fetchBlogPosts:()=>L,fetchSessionData:()=>U,getRemoteDataStore:()=>g,loadSprites:()=>u,queryId:()=>s,queryIdAll:()=>l,reactRenderer:()=>i,reducerBlogPosts:()=>A,reducerSessionData:()=>G,renderComponent:()=>o,selectRecentBlogPosts:()=>_,selectSessionData:()=>C,toggleChatWidget:()=>h}),a(806);var t=a(281),e=a.n(t),r=a(645),n=a.n(r),o=function(t,r,o){return n().render(e().createElement(t,r),o)};function i(t){var r=document.querySelectorAll("[data-react]");Array.from(r).forEach((function(r){var o=r.getAttribute("data-react"),i=t[o];if(i){var a=r.getAttribute("data-react-props"),c=a&&JSON.parse(a||{});n().render(e().createElement(i,c),r),r.removeAttribute("data-react"),r.removeAttribute("data-react-props")}}))}const u=function(t){fetch(t).then((function(t){return t.text()})).then((function(t){var e=document.createElement("div");e.style.display="none",e.innerHTML=t,document.body.appendChild(e)})).catch((function(t){return console.error(t)}))};var s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector("[data-id=".concat(t,"]"))},l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelectorAll("[data-id=".concat(t,"]"))};function f(t,e){t.disabled=!1,t.innerText=e}function p(t,e){t.disabled=!0,t.innerText=e}var d=30;function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.dataId,r=s(e),n=s("open-chat-widget",r),o=n.dataset.enabledLabel,i=n.dataset.disabledLabel;if(e&&r){var a,c=s("open-chat-widget",r),u=function t(e){var r,n,i=null===(r=window)||void 0===r||null===(n=r.HubSpotConversations)||void 0===n?void 0:n.widget,u=document.querySelector("#hubspot-messages-iframe-container");a=function(t){t.preventDefault(),i.open()},i&&u?(c.addEventListener("click",a),f(c,o)):--d&&setTimeout((function(){return t(100)}),e)};return p(c,i),u(0),function(){p(c,i),c.removeEventListener("click",a)}}}var v=a(44),y=function(t){window.AblyUi=window.AblyUi||{},window.AblyUi.RemoteDataStore=t},g=function(){if(!window.AblyUi.RemoteDataStore)throw new Error("Remote store was called before one was created");return window.AblyUi.RemoteDataStore},b=function(t,e){var r=g(),n=t(r);r.subscribe((function(){var o=t(r);o!==n&&(n=o,e(o))}))},m=function(t){return(0,v.createStore)((0,v.combineReducers)(t))},w=a(757),x=a.n(w),O=function(t){return t&&t.includes("application/json")};function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){P(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function P(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var L=function(){var t,e=(t=x().mark((function t(e,r){var n,o;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,r){t.next=4;break}return console.log('Skipping fetching blog posts, invalid blogUrl: "'.concat(r,'"')),t.abrupt("return");case 4:return t.next=6,fetch(r);case 6:if(n=t.sent,!O(n.headers.get("content-type"))){t.next=14;break}return t.next=10,n.json();case 10:o=t.sent,e.dispatch({type:"blog/loaded",payload:o}),t.next=15;break;case 14:throw new Error("Blog posts url is not serving json");case 15:t.next=20;break;case 17:t.prev=17,t.t0=t.catch(0),console.warn("Could not fetch blog posts due to error:",t.t0);case 20:case"end":return t.stop()}}),t,null,[[0,17]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){E(i,n,o,a,c,"next",t)}function c(t){E(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t,r){return e.apply(this,arguments)}}(),k={recent:null},A=P({},"blogPosts",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k,e=arguments.length>1?arguments[1]:void 0;return"blog/loaded"===e.type?S(S({},t),{},{recent:e.payload}):t})),_=function(t){var e;return null===(e=t.getState().blogPosts)||void 0===e?void 0:e.recent};function D(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function q(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?D(Object(r),!0).forEach((function(e){T(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function R(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var U=function(){var t,e=(t=x().mark((function t(e,r){var n,o,i;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.dispatch({type:"session/loaded",payload:t})},t.prev=1,r){t.next=6;break}return console.log('Skipping fetching session, invalid sessionUrl: "'.concat(r,'"')),n(),t.abrupt("return");case 6:return t.next=8,fetch(r,{cache:"no-cache"});case 8:if(o=t.sent,O(o.headers.get("content-type"))){t.next=12;break}throw new Error("Session endpoint is not serving json");case 12:return t.next=14,o.json();case 14:"not-found"===(i=t.sent).error?n():n(i),t.next=22;break;case 18:t.prev=18,t.t0=t.catch(1),n(),console.warn("Could not fetch session data due to error:",t.t0);case 22:case"end":return t.stop()}}),t,null,[[1,18]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){R(i,n,o,a,c,"next",t)}function c(t){R(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t,r){return e.apply(this,arguments)}}(),N={data:null},G=T({},"session",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N,e=arguments.length>1?arguments[1]:void 0;return"session/loaded"===e.type?q(q({},t),{},{data:e.payload}):t})),C=function(t){var e;return null===(e=t.getState().session)||void 0===e?void 0:e.data}})(),c})()}));
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("array-flat-polyfill"), require("react"), require("react-dom"), require("redux"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([, , , ], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["AblyUi"] = factory(require("array-flat-polyfill"), require("react"), require("react-dom"), require("redux"));
8
+ else
9
+ root["AblyUi"] = root["AblyUi"] || {}, root["AblyUi"]["Core"] = factory(root[undefined], root[undefined], root[undefined], root[undefined]);
10
+ })(this, (__WEBPACK_EXTERNAL_MODULE_array_flat_polyfill__, __WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_dom__, __WEBPACK_EXTERNAL_MODULE_redux__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ var __webpack_modules__ = ({
13
+
14
+ /***/ "./node_modules/@babel/runtime/regenerator/index.js":
15
+ /*!**********************************************************!*\
16
+ !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
17
+ \**********************************************************/
18
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
19
+
20
+ module.exports = __webpack_require__(/*! regenerator-runtime */ "./node_modules/regenerator-runtime/runtime.js");
21
+
22
+
23
+ /***/ }),
24
+
25
+ /***/ "./src/core/dom-query.js":
26
+ /*!*******************************!*\
27
+ !*** ./src/core/dom-query.js ***!
28
+ \*******************************/
29
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
30
+
31
+ "use strict";
32
+ __webpack_require__.r(__webpack_exports__);
33
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34
+ /* harmony export */ "queryId": () => (/* binding */ queryId),
35
+ /* harmony export */ "queryIdAll": () => (/* binding */ queryIdAll)
36
+ /* harmony export */ });
37
+ var queryId = function queryId(val) {
38
+ var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
39
+ return root.querySelector("[data-id=".concat(val, "]"));
40
+ };
41
+ var queryIdAll = function queryIdAll(val) {
42
+ var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
43
+ return root.querySelectorAll("[data-id=".concat(val, "]"));
44
+ };
45
+
46
+ /***/ }),
47
+
48
+ /***/ "./src/core/hubspot-chat-toggle.js":
49
+ /*!*****************************************!*\
50
+ !*** ./src/core/hubspot-chat-toggle.js ***!
51
+ \*****************************************/
52
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
53
+
54
+ "use strict";
55
+ __webpack_require__.r(__webpack_exports__);
56
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
57
+ /* harmony export */ "default": () => (/* binding */ toggleChatWidget)
58
+ /* harmony export */ });
59
+ /* harmony import */ var _dom_query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom-query */ "./src/core/dom-query.js");
60
+
61
+ /*
62
+ A method to enable/disable a CTA that
63
+ is used to open the HubSpot chat widget
64
+
65
+ If the Chat widget is unavailable this script
66
+ will apply a disabled property and change
67
+ the text on the button, to warn the user.
68
+
69
+ Params:
70
+ - dataId the parent container data-id
71
+
72
+ */
73
+
74
+ function enableBtn(el, text) {
75
+ el.disabled = false;
76
+ el.innerText = text;
77
+ }
78
+
79
+ function disableBtn(el, text) {
80
+ el.disabled = true;
81
+ el.innerText = text;
82
+ }
83
+
84
+ var WAIT_BETWEEN_RETRIES_MS = 100;
85
+ var MAX_RETRY_COUNT = 30;
86
+ function toggleChatWidget() {
87
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
88
+ var dataId = params.dataId;
89
+ var container = (0,_dom_query__WEBPACK_IMPORTED_MODULE_0__.queryId)(dataId);
90
+ var chatButton = (0,_dom_query__WEBPACK_IMPORTED_MODULE_0__.queryId)("open-chat-widget", container);
91
+ var textEnabled = chatButton.dataset.enabledLabel;
92
+ var textDisabled = chatButton.dataset.disabledLabel;
93
+ if (!dataId || !container) return;
94
+ var trigger = (0,_dom_query__WEBPACK_IMPORTED_MODULE_0__.queryId)("open-chat-widget", container);
95
+ var clickHandler;
96
+
97
+ var waitForScript = function waitForScript(delay) {
98
+ var _window, _window$HubSpotConver;
99
+
100
+ var widget = (_window = window) === null || _window === void 0 ? void 0 : (_window$HubSpotConver = _window.HubSpotConversations) === null || _window$HubSpotConver === void 0 ? void 0 : _window$HubSpotConver.widget; // If the chat is set to be hidden out of hours this will return null
101
+
102
+ var iframe = document.querySelector("#hubspot-messages-iframe-container");
103
+
104
+ clickHandler = function clickHandler(e) {
105
+ e.preventDefault();
106
+ widget.open();
107
+ };
108
+
109
+ if (widget && iframe) {
110
+ trigger.addEventListener("click", clickHandler);
111
+ enableBtn(trigger, textEnabled);
112
+ } else if (--MAX_RETRY_COUNT) {
113
+ setTimeout(function () {
114
+ return waitForScript(WAIT_BETWEEN_RETRIES_MS);
115
+ }, delay);
116
+ }
117
+ };
118
+
119
+ disableBtn(trigger, textDisabled);
120
+ waitForScript(0);
121
+ return function () {
122
+ disableBtn(trigger, textDisabled);
123
+ trigger.removeEventListener("click", clickHandler);
124
+ };
125
+ }
126
+
127
+ /***/ }),
128
+
129
+ /***/ "./src/core/load-sprites.js":
130
+ /*!**********************************!*\
131
+ !*** ./src/core/load-sprites.js ***!
132
+ \**********************************/
133
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
134
+
135
+ "use strict";
136
+ __webpack_require__.r(__webpack_exports__);
137
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
138
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
139
+ /* harmony export */ });
140
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (spritesUrl) {
141
+ fetch(spritesUrl).then(function (response) {
142
+ return response.text();
143
+ }).then(function (image) {
144
+ var container = document.createElement("div");
145
+ container.style.display = "none";
146
+ container.innerHTML = image;
147
+ document.body.appendChild(container);
148
+ })["catch"](function (err) {
149
+ return console.error(err);
150
+ });
151
+ });
152
+
153
+ /***/ }),
154
+
155
+ /***/ "./src/core/react-renderer.js":
156
+ /*!************************************!*\
157
+ !*** ./src/core/react-renderer.js ***!
158
+ \************************************/
159
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
160
+
161
+ "use strict";
162
+ __webpack_require__.r(__webpack_exports__);
163
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
164
+ /* harmony export */ "default": () => (/* binding */ reactRenderer),
165
+ /* harmony export */ "renderComponent": () => (/* binding */ renderComponent)
166
+ /* harmony export */ });
167
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
168
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
169
+ /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "react-dom");
170
+ /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
171
+
172
+
173
+
174
+ var renderComponent = function renderComponent(Component, props, node) {
175
+ return (// eslint-disable-next-line react/no-render-return-value
176
+ react_dom__WEBPACK_IMPORTED_MODULE_1___default().render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Component, props), node)
177
+ );
178
+ };
179
+
180
+
181
+ function reactRenderer(components) {
182
+ var reactComponents = document.querySelectorAll("[data-react]");
183
+ Array.from(reactComponents).forEach(function (node) {
184
+ var className = node.getAttribute("data-react");
185
+ var Constructor = components[className];
186
+ if (!Constructor) return;
187
+ var propsJson = node.getAttribute("data-react-props");
188
+ var props = propsJson && JSON.parse(propsJson || {});
189
+ react_dom__WEBPACK_IMPORTED_MODULE_1___default().render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Constructor, props), node);
190
+ node.removeAttribute("data-react");
191
+ node.removeAttribute("data-react-props");
192
+ });
193
+ }
194
+
195
+ /***/ }),
196
+
197
+ /***/ "./src/core/remote-blogs-posts.js":
198
+ /*!****************************************!*\
199
+ !*** ./src/core/remote-blogs-posts.js ***!
200
+ \****************************************/
201
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
202
+
203
+ "use strict";
204
+ __webpack_require__.r(__webpack_exports__);
205
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
206
+ /* harmony export */ "fetchBlogPosts": () => (/* binding */ fetchBlogPosts),
207
+ /* harmony export */ "reducerBlogPosts": () => (/* binding */ reducerBlogPosts),
208
+ /* harmony export */ "selectRecentBlogPosts": () => (/* binding */ selectRecentBlogPosts)
209
+ /* harmony export */ });
210
+ /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
211
+ /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
212
+ /* harmony import */ var _remote_data_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./remote-data-util */ "./src/core/remote-data-util.js");
213
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
214
+
215
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
216
+
217
+ function _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; }
218
+
219
+
220
+
221
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
222
+
223
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
224
+
225
+
226
+
227
+ var fetchBlogPosts = /*#__PURE__*/function () {
228
+ var _ref = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee(store, blogUrl) {
229
+ var res, payload;
230
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
231
+ while (1) {
232
+ switch (_context.prev = _context.next) {
233
+ case 0:
234
+ _context.prev = 0;
235
+
236
+ if (blogUrl) {
237
+ _context.next = 4;
238
+ break;
239
+ }
240
+
241
+ console.log("Skipping fetching blog posts, invalid blogUrl: \"".concat(blogUrl, "\""));
242
+ return _context.abrupt("return");
243
+
244
+ case 4:
245
+ _context.next = 6;
246
+ return fetch(blogUrl);
247
+
248
+ case 6:
249
+ res = _context.sent;
250
+
251
+ if (!(0,_remote_data_util__WEBPACK_IMPORTED_MODULE_1__.isJsonResponse)(res.headers.get("content-type"))) {
252
+ _context.next = 14;
253
+ break;
254
+ }
255
+
256
+ _context.next = 10;
257
+ return res.json();
258
+
259
+ case 10:
260
+ payload = _context.sent;
261
+ store.dispatch({
262
+ type: "blog/loaded",
263
+ payload: payload
264
+ });
265
+ _context.next = 15;
266
+ break;
267
+
268
+ case 14:
269
+ throw new Error("Blog posts url is not serving json");
270
+
271
+ case 15:
272
+ _context.next = 20;
273
+ break;
274
+
275
+ case 17:
276
+ _context.prev = 17;
277
+ _context.t0 = _context["catch"](0);
278
+ console.warn("Could not fetch blog posts due to error:", _context.t0);
279
+
280
+ case 20:
281
+ case "end":
282
+ return _context.stop();
283
+ }
284
+ }
285
+ }, _callee, null, [[0, 17]]);
286
+ }));
287
+
288
+ return function fetchBlogPosts(_x, _x2) {
289
+ return _ref.apply(this, arguments);
290
+ };
291
+ }();
292
+
293
+ var initialState = {
294
+ recent: null
295
+ };
296
+ var REDUCER_KEY = "blogPosts";
297
+
298
+ var reducerBlogPosts = _defineProperty({}, REDUCER_KEY, function () {
299
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
300
+ var action = arguments.length > 1 ? arguments[1] : undefined;
301
+
302
+ switch (action.type) {
303
+ case "blog/loaded":
304
+ return _objectSpread(_objectSpread({}, state), {}, {
305
+ recent: action.payload
306
+ });
307
+
308
+ default:
309
+ return state;
310
+ }
311
+ });
312
+
313
+ var selectRecentBlogPosts = function selectRecentBlogPosts(store) {
314
+ var _store$getState$REDUC;
315
+
316
+ return (_store$getState$REDUC = store.getState()[REDUCER_KEY]) === null || _store$getState$REDUC === void 0 ? void 0 : _store$getState$REDUC.recent;
317
+ };
318
+
319
+
320
+
321
+ /***/ }),
322
+
323
+ /***/ "./src/core/remote-data-store.js":
324
+ /*!***************************************!*\
325
+ !*** ./src/core/remote-data-store.js ***!
326
+ \***************************************/
327
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
328
+
329
+ "use strict";
330
+ __webpack_require__.r(__webpack_exports__);
331
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
332
+ /* harmony export */ "attachStoreToWindow": () => (/* binding */ attachStoreToWindow),
333
+ /* harmony export */ "connectState": () => (/* binding */ connectState),
334
+ /* harmony export */ "createRemoteDataStore": () => (/* binding */ createRemoteDataStore),
335
+ /* harmony export */ "getRemoteDataStore": () => (/* binding */ getRemoteDataStore)
336
+ /* harmony export */ });
337
+ /* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ "redux");
338
+ /* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(redux__WEBPACK_IMPORTED_MODULE_0__);
339
+
340
+ var attachStoreToWindow = function attachStoreToWindow(store) {
341
+ window.AblyUi = window.AblyUi || {};
342
+ window.AblyUi.RemoteDataStore = store;
343
+ };
344
+ var getRemoteDataStore = function getRemoteDataStore() {
345
+ if (!window.AblyUi.RemoteDataStore) {
346
+ throw new Error("Remote store was called before one was created");
347
+ }
348
+
349
+ return window.AblyUi.RemoteDataStore;
350
+ };
351
+ var connectState = function connectState(selector, setState) {
352
+ var store = getRemoteDataStore();
353
+ var cachedOldState = selector(store);
354
+ store.subscribe(function () {
355
+ var newState = selector(store); // Do nothing, state is the same
356
+
357
+ if (newState === cachedOldState) {
358
+ return;
359
+ }
360
+
361
+ cachedOldState = newState;
362
+ setState(newState);
363
+ });
364
+ };
365
+ var createRemoteDataStore = function createRemoteDataStore(reducers) {
366
+ return (0,redux__WEBPACK_IMPORTED_MODULE_0__.createStore)((0,redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers)(reducers));
367
+ };
368
+
369
+ /***/ }),
370
+
371
+ /***/ "./src/core/remote-data-util.js":
372
+ /*!**************************************!*\
373
+ !*** ./src/core/remote-data-util.js ***!
374
+ \**************************************/
375
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
376
+
377
+ "use strict";
378
+ __webpack_require__.r(__webpack_exports__);
379
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
380
+ /* harmony export */ "isJsonResponse": () => (/* binding */ isJsonResponse)
381
+ /* harmony export */ });
382
+ // isJsonResponse is useful for environments where hitting an endpoint
383
+ // would return an html page (eg. Gatsby local dev)
384
+ var isJsonResponse = function isJsonResponse(contentType) {
385
+ return contentType && contentType.includes("application/json");
386
+ };
387
+
388
+ /***/ }),
389
+
390
+ /***/ "./src/core/remote-session-data.js":
391
+ /*!*****************************************!*\
392
+ !*** ./src/core/remote-session-data.js ***!
393
+ \*****************************************/
394
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
395
+
396
+ "use strict";
397
+ __webpack_require__.r(__webpack_exports__);
398
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
399
+ /* harmony export */ "fetchSessionData": () => (/* binding */ fetchSessionData),
400
+ /* harmony export */ "reducerSessionData": () => (/* binding */ reducerSessionData),
401
+ /* harmony export */ "selectSessionData": () => (/* binding */ selectSessionData)
402
+ /* harmony export */ });
403
+ /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
404
+ /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
405
+ /* harmony import */ var _remote_data_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./remote-data-util */ "./src/core/remote-data-util.js");
406
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
407
+
408
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
409
+
410
+ function _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; }
411
+
412
+
413
+
414
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
415
+
416
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
417
+
418
+ // Fetches current users session data
419
+ // Assumes an authenticated session, so will only work when used on ably.com/ably.io
420
+
421
+ var NOT_FOUND_ERROR_CODE = "not-found";
422
+
423
+ var fetchSessionData = /*#__PURE__*/function () {
424
+ var _ref = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee(store, sessionUrl) {
425
+ var sessionLoaded, res, jsonResponse, payload;
426
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
427
+ while (1) {
428
+ switch (_context.prev = _context.next) {
429
+ case 0:
430
+ sessionLoaded = function sessionLoaded() {
431
+ var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
432
+ return store.dispatch({
433
+ type: "session/loaded",
434
+ payload: payload
435
+ });
436
+ };
437
+
438
+ _context.prev = 1;
439
+
440
+ if (sessionUrl) {
441
+ _context.next = 6;
442
+ break;
443
+ }
444
+
445
+ console.log("Skipping fetching session, invalid sessionUrl: \"".concat(sessionUrl, "\""));
446
+ sessionLoaded();
447
+ return _context.abrupt("return");
448
+
449
+ case 6:
450
+ _context.next = 8;
451
+ return fetch(sessionUrl, {
452
+ cache: "no-cache"
453
+ });
454
+
455
+ case 8:
456
+ res = _context.sent;
457
+ jsonResponse = (0,_remote_data_util__WEBPACK_IMPORTED_MODULE_1__.isJsonResponse)(res.headers.get("content-type"));
458
+
459
+ if (jsonResponse) {
460
+ _context.next = 12;
461
+ break;
462
+ }
463
+
464
+ throw new Error("Session endpoint is not serving json");
465
+
466
+ case 12:
467
+ _context.next = 14;
468
+ return res.json();
469
+
470
+ case 14:
471
+ payload = _context.sent;
472
+
473
+ if (payload.error === NOT_FOUND_ERROR_CODE) {
474
+ sessionLoaded();
475
+ } else {
476
+ sessionLoaded(payload);
477
+ }
478
+
479
+ _context.next = 22;
480
+ break;
481
+
482
+ case 18:
483
+ _context.prev = 18;
484
+ _context.t0 = _context["catch"](1);
485
+ sessionLoaded();
486
+ console.warn("Could not fetch session data due to error:", _context.t0);
487
+
488
+ case 22:
489
+ case "end":
490
+ return _context.stop();
491
+ }
492
+ }
493
+ }, _callee, null, [[1, 18]]);
494
+ }));
495
+
496
+ return function fetchSessionData(_x, _x2) {
497
+ return _ref.apply(this, arguments);
498
+ };
499
+ }();
500
+
501
+ var initialState = {
502
+ data: null
503
+ };
504
+ var REDUCER_KEY = "session";
505
+
506
+ var reducerSessionData = _defineProperty({}, REDUCER_KEY, function () {
507
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
508
+ var action = arguments.length > 1 ? arguments[1] : undefined;
509
+
510
+ switch (action.type) {
511
+ case "session/loaded":
512
+ return _objectSpread(_objectSpread({}, state), {}, {
513
+ data: action.payload
514
+ });
515
+
516
+ default:
517
+ return state;
518
+ }
519
+ });
520
+
521
+ var selectSessionData = function selectSessionData(store) {
522
+ var _store$getState$REDUC;
523
+
524
+ return (_store$getState$REDUC = store.getState()[REDUCER_KEY]) === null || _store$getState$REDUC === void 0 ? void 0 : _store$getState$REDUC.data;
525
+ };
526
+
527
+
528
+
529
+ /***/ }),
530
+
531
+ /***/ "./src/core/styles.css":
532
+ /*!*****************************!*\
533
+ !*** ./src/core/styles.css ***!
534
+ \*****************************/
535
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
536
+
537
+ "use strict";
538
+ __webpack_require__.r(__webpack_exports__);
539
+ // extracted by mini-css-extract-plugin
540
+
541
+
542
+ /***/ }),
543
+
544
+ /***/ "./node_modules/regenerator-runtime/runtime.js":
545
+ /*!*****************************************************!*\
546
+ !*** ./node_modules/regenerator-runtime/runtime.js ***!
547
+ \*****************************************************/
548
+ /***/ ((module) => {
549
+
550
+ /**
551
+ * Copyright (c) 2014-present, Facebook, Inc.
552
+ *
553
+ * This source code is licensed under the MIT license found in the
554
+ * LICENSE file in the root directory of this source tree.
555
+ */
556
+
557
+ var runtime = (function (exports) {
558
+ "use strict";
559
+
560
+ var Op = Object.prototype;
561
+ var hasOwn = Op.hasOwnProperty;
562
+ var undefined; // More compressible than void 0.
563
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
564
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
565
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
566
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
567
+
568
+ function define(obj, key, value) {
569
+ Object.defineProperty(obj, key, {
570
+ value: value,
571
+ enumerable: true,
572
+ configurable: true,
573
+ writable: true
574
+ });
575
+ return obj[key];
576
+ }
577
+ try {
578
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
579
+ define({}, "");
580
+ } catch (err) {
581
+ define = function(obj, key, value) {
582
+ return obj[key] = value;
583
+ };
584
+ }
585
+
586
+ function wrap(innerFn, outerFn, self, tryLocsList) {
587
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
588
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
589
+ var generator = Object.create(protoGenerator.prototype);
590
+ var context = new Context(tryLocsList || []);
591
+
592
+ // The ._invoke method unifies the implementations of the .next,
593
+ // .throw, and .return methods.
594
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
595
+
596
+ return generator;
597
+ }
598
+ exports.wrap = wrap;
599
+
600
+ // Try/catch helper to minimize deoptimizations. Returns a completion
601
+ // record like context.tryEntries[i].completion. This interface could
602
+ // have been (and was previously) designed to take a closure to be
603
+ // invoked without arguments, but in all the cases we care about we
604
+ // already have an existing method we want to call, so there's no need
605
+ // to create a new function object. We can even get away with assuming
606
+ // the method takes exactly one argument, since that happens to be true
607
+ // in every case, so we don't have to touch the arguments object. The
608
+ // only additional allocation required is the completion record, which
609
+ // has a stable shape and so hopefully should be cheap to allocate.
610
+ function tryCatch(fn, obj, arg) {
611
+ try {
612
+ return { type: "normal", arg: fn.call(obj, arg) };
613
+ } catch (err) {
614
+ return { type: "throw", arg: err };
615
+ }
616
+ }
617
+
618
+ var GenStateSuspendedStart = "suspendedStart";
619
+ var GenStateSuspendedYield = "suspendedYield";
620
+ var GenStateExecuting = "executing";
621
+ var GenStateCompleted = "completed";
622
+
623
+ // Returning this object from the innerFn has the same effect as
624
+ // breaking out of the dispatch switch statement.
625
+ var ContinueSentinel = {};
626
+
627
+ // Dummy constructor functions that we use as the .constructor and
628
+ // .constructor.prototype properties for functions that return Generator
629
+ // objects. For full spec compliance, you may wish to configure your
630
+ // minifier not to mangle the names of these two functions.
631
+ function Generator() {}
632
+ function GeneratorFunction() {}
633
+ function GeneratorFunctionPrototype() {}
634
+
635
+ // This is a polyfill for %IteratorPrototype% for environments that
636
+ // don't natively support it.
637
+ var IteratorPrototype = {};
638
+ IteratorPrototype[iteratorSymbol] = function () {
639
+ return this;
640
+ };
641
+
642
+ var getProto = Object.getPrototypeOf;
643
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
644
+ if (NativeIteratorPrototype &&
645
+ NativeIteratorPrototype !== Op &&
646
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
647
+ // This environment has a native %IteratorPrototype%; use it instead
648
+ // of the polyfill.
649
+ IteratorPrototype = NativeIteratorPrototype;
650
+ }
651
+
652
+ var Gp = GeneratorFunctionPrototype.prototype =
653
+ Generator.prototype = Object.create(IteratorPrototype);
654
+ GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
655
+ GeneratorFunctionPrototype.constructor = GeneratorFunction;
656
+ GeneratorFunction.displayName = define(
657
+ GeneratorFunctionPrototype,
658
+ toStringTagSymbol,
659
+ "GeneratorFunction"
660
+ );
661
+
662
+ // Helper for defining the .next, .throw, and .return methods of the
663
+ // Iterator interface in terms of a single ._invoke method.
664
+ function defineIteratorMethods(prototype) {
665
+ ["next", "throw", "return"].forEach(function(method) {
666
+ define(prototype, method, function(arg) {
667
+ return this._invoke(method, arg);
668
+ });
669
+ });
670
+ }
671
+
672
+ exports.isGeneratorFunction = function(genFun) {
673
+ var ctor = typeof genFun === "function" && genFun.constructor;
674
+ return ctor
675
+ ? ctor === GeneratorFunction ||
676
+ // For the native GeneratorFunction constructor, the best we can
677
+ // do is to check its .name property.
678
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
679
+ : false;
680
+ };
681
+
682
+ exports.mark = function(genFun) {
683
+ if (Object.setPrototypeOf) {
684
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
685
+ } else {
686
+ genFun.__proto__ = GeneratorFunctionPrototype;
687
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
688
+ }
689
+ genFun.prototype = Object.create(Gp);
690
+ return genFun;
691
+ };
692
+
693
+ // Within the body of any async function, `await x` is transformed to
694
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
695
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
696
+ // meant to be awaited.
697
+ exports.awrap = function(arg) {
698
+ return { __await: arg };
699
+ };
700
+
701
+ function AsyncIterator(generator, PromiseImpl) {
702
+ function invoke(method, arg, resolve, reject) {
703
+ var record = tryCatch(generator[method], generator, arg);
704
+ if (record.type === "throw") {
705
+ reject(record.arg);
706
+ } else {
707
+ var result = record.arg;
708
+ var value = result.value;
709
+ if (value &&
710
+ typeof value === "object" &&
711
+ hasOwn.call(value, "__await")) {
712
+ return PromiseImpl.resolve(value.__await).then(function(value) {
713
+ invoke("next", value, resolve, reject);
714
+ }, function(err) {
715
+ invoke("throw", err, resolve, reject);
716
+ });
717
+ }
718
+
719
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
720
+ // When a yielded Promise is resolved, its final value becomes
721
+ // the .value of the Promise<{value,done}> result for the
722
+ // current iteration.
723
+ result.value = unwrapped;
724
+ resolve(result);
725
+ }, function(error) {
726
+ // If a rejected Promise was yielded, throw the rejection back
727
+ // into the async generator function so it can be handled there.
728
+ return invoke("throw", error, resolve, reject);
729
+ });
730
+ }
731
+ }
732
+
733
+ var previousPromise;
734
+
735
+ function enqueue(method, arg) {
736
+ function callInvokeWithMethodAndArg() {
737
+ return new PromiseImpl(function(resolve, reject) {
738
+ invoke(method, arg, resolve, reject);
739
+ });
740
+ }
741
+
742
+ return previousPromise =
743
+ // If enqueue has been called before, then we want to wait until
744
+ // all previous Promises have been resolved before calling invoke,
745
+ // so that results are always delivered in the correct order. If
746
+ // enqueue has not been called before, then it is important to
747
+ // call invoke immediately, without waiting on a callback to fire,
748
+ // so that the async generator function has the opportunity to do
749
+ // any necessary setup in a predictable way. This predictability
750
+ // is why the Promise constructor synchronously invokes its
751
+ // executor callback, and why async functions synchronously
752
+ // execute code before the first await. Since we implement simple
753
+ // async functions in terms of async generators, it is especially
754
+ // important to get this right, even though it requires care.
755
+ previousPromise ? previousPromise.then(
756
+ callInvokeWithMethodAndArg,
757
+ // Avoid propagating failures to Promises returned by later
758
+ // invocations of the iterator.
759
+ callInvokeWithMethodAndArg
760
+ ) : callInvokeWithMethodAndArg();
761
+ }
762
+
763
+ // Define the unified helper method that is used to implement .next,
764
+ // .throw, and .return (see defineIteratorMethods).
765
+ this._invoke = enqueue;
766
+ }
767
+
768
+ defineIteratorMethods(AsyncIterator.prototype);
769
+ AsyncIterator.prototype[asyncIteratorSymbol] = function () {
770
+ return this;
771
+ };
772
+ exports.AsyncIterator = AsyncIterator;
773
+
774
+ // Note that simple async functions are implemented on top of
775
+ // AsyncIterator objects; they just return a Promise for the value of
776
+ // the final result produced by the iterator.
777
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
778
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
779
+
780
+ var iter = new AsyncIterator(
781
+ wrap(innerFn, outerFn, self, tryLocsList),
782
+ PromiseImpl
783
+ );
784
+
785
+ return exports.isGeneratorFunction(outerFn)
786
+ ? iter // If outerFn is a generator, return the full iterator.
787
+ : iter.next().then(function(result) {
788
+ return result.done ? result.value : iter.next();
789
+ });
790
+ };
791
+
792
+ function makeInvokeMethod(innerFn, self, context) {
793
+ var state = GenStateSuspendedStart;
794
+
795
+ return function invoke(method, arg) {
796
+ if (state === GenStateExecuting) {
797
+ throw new Error("Generator is already running");
798
+ }
799
+
800
+ if (state === GenStateCompleted) {
801
+ if (method === "throw") {
802
+ throw arg;
803
+ }
804
+
805
+ // Be forgiving, per 25.3.3.3.3 of the spec:
806
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
807
+ return doneResult();
808
+ }
809
+
810
+ context.method = method;
811
+ context.arg = arg;
812
+
813
+ while (true) {
814
+ var delegate = context.delegate;
815
+ if (delegate) {
816
+ var delegateResult = maybeInvokeDelegate(delegate, context);
817
+ if (delegateResult) {
818
+ if (delegateResult === ContinueSentinel) continue;
819
+ return delegateResult;
820
+ }
821
+ }
822
+
823
+ if (context.method === "next") {
824
+ // Setting context._sent for legacy support of Babel's
825
+ // function.sent implementation.
826
+ context.sent = context._sent = context.arg;
827
+
828
+ } else if (context.method === "throw") {
829
+ if (state === GenStateSuspendedStart) {
830
+ state = GenStateCompleted;
831
+ throw context.arg;
832
+ }
833
+
834
+ context.dispatchException(context.arg);
835
+
836
+ } else if (context.method === "return") {
837
+ context.abrupt("return", context.arg);
838
+ }
839
+
840
+ state = GenStateExecuting;
841
+
842
+ var record = tryCatch(innerFn, self, context);
843
+ if (record.type === "normal") {
844
+ // If an exception is thrown from innerFn, we leave state ===
845
+ // GenStateExecuting and loop back for another invocation.
846
+ state = context.done
847
+ ? GenStateCompleted
848
+ : GenStateSuspendedYield;
849
+
850
+ if (record.arg === ContinueSentinel) {
851
+ continue;
852
+ }
853
+
854
+ return {
855
+ value: record.arg,
856
+ done: context.done
857
+ };
858
+
859
+ } else if (record.type === "throw") {
860
+ state = GenStateCompleted;
861
+ // Dispatch the exception by looping back around to the
862
+ // context.dispatchException(context.arg) call above.
863
+ context.method = "throw";
864
+ context.arg = record.arg;
865
+ }
866
+ }
867
+ };
868
+ }
869
+
870
+ // Call delegate.iterator[context.method](context.arg) and handle the
871
+ // result, either by returning a { value, done } result from the
872
+ // delegate iterator, or by modifying context.method and context.arg,
873
+ // setting context.delegate to null, and returning the ContinueSentinel.
874
+ function maybeInvokeDelegate(delegate, context) {
875
+ var method = delegate.iterator[context.method];
876
+ if (method === undefined) {
877
+ // A .throw or .return when the delegate iterator has no .throw
878
+ // method always terminates the yield* loop.
879
+ context.delegate = null;
880
+
881
+ if (context.method === "throw") {
882
+ // Note: ["return"] must be used for ES3 parsing compatibility.
883
+ if (delegate.iterator["return"]) {
884
+ // If the delegate iterator has a return method, give it a
885
+ // chance to clean up.
886
+ context.method = "return";
887
+ context.arg = undefined;
888
+ maybeInvokeDelegate(delegate, context);
889
+
890
+ if (context.method === "throw") {
891
+ // If maybeInvokeDelegate(context) changed context.method from
892
+ // "return" to "throw", let that override the TypeError below.
893
+ return ContinueSentinel;
894
+ }
895
+ }
896
+
897
+ context.method = "throw";
898
+ context.arg = new TypeError(
899
+ "The iterator does not provide a 'throw' method");
900
+ }
901
+
902
+ return ContinueSentinel;
903
+ }
904
+
905
+ var record = tryCatch(method, delegate.iterator, context.arg);
906
+
907
+ if (record.type === "throw") {
908
+ context.method = "throw";
909
+ context.arg = record.arg;
910
+ context.delegate = null;
911
+ return ContinueSentinel;
912
+ }
913
+
914
+ var info = record.arg;
915
+
916
+ if (! info) {
917
+ context.method = "throw";
918
+ context.arg = new TypeError("iterator result is not an object");
919
+ context.delegate = null;
920
+ return ContinueSentinel;
921
+ }
922
+
923
+ if (info.done) {
924
+ // Assign the result of the finished delegate to the temporary
925
+ // variable specified by delegate.resultName (see delegateYield).
926
+ context[delegate.resultName] = info.value;
927
+
928
+ // Resume execution at the desired location (see delegateYield).
929
+ context.next = delegate.nextLoc;
930
+
931
+ // If context.method was "throw" but the delegate handled the
932
+ // exception, let the outer generator proceed normally. If
933
+ // context.method was "next", forget context.arg since it has been
934
+ // "consumed" by the delegate iterator. If context.method was
935
+ // "return", allow the original .return call to continue in the
936
+ // outer generator.
937
+ if (context.method !== "return") {
938
+ context.method = "next";
939
+ context.arg = undefined;
940
+ }
941
+
942
+ } else {
943
+ // Re-yield the result returned by the delegate method.
944
+ return info;
945
+ }
946
+
947
+ // The delegate iterator is finished, so forget it and continue with
948
+ // the outer generator.
949
+ context.delegate = null;
950
+ return ContinueSentinel;
951
+ }
952
+
953
+ // Define Generator.prototype.{next,throw,return} in terms of the
954
+ // unified ._invoke helper method.
955
+ defineIteratorMethods(Gp);
956
+
957
+ define(Gp, toStringTagSymbol, "Generator");
958
+
959
+ // A Generator should always return itself as the iterator object when the
960
+ // @@iterator function is called on it. Some browsers' implementations of the
961
+ // iterator prototype chain incorrectly implement this, causing the Generator
962
+ // object to not be returned from this call. This ensures that doesn't happen.
963
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
964
+ Gp[iteratorSymbol] = function() {
965
+ return this;
966
+ };
967
+
968
+ Gp.toString = function() {
969
+ return "[object Generator]";
970
+ };
971
+
972
+ function pushTryEntry(locs) {
973
+ var entry = { tryLoc: locs[0] };
974
+
975
+ if (1 in locs) {
976
+ entry.catchLoc = locs[1];
977
+ }
978
+
979
+ if (2 in locs) {
980
+ entry.finallyLoc = locs[2];
981
+ entry.afterLoc = locs[3];
982
+ }
983
+
984
+ this.tryEntries.push(entry);
985
+ }
986
+
987
+ function resetTryEntry(entry) {
988
+ var record = entry.completion || {};
989
+ record.type = "normal";
990
+ delete record.arg;
991
+ entry.completion = record;
992
+ }
993
+
994
+ function Context(tryLocsList) {
995
+ // The root entry object (effectively a try statement without a catch
996
+ // or a finally block) gives us a place to store values thrown from
997
+ // locations where there is no enclosing try statement.
998
+ this.tryEntries = [{ tryLoc: "root" }];
999
+ tryLocsList.forEach(pushTryEntry, this);
1000
+ this.reset(true);
1001
+ }
1002
+
1003
+ exports.keys = function(object) {
1004
+ var keys = [];
1005
+ for (var key in object) {
1006
+ keys.push(key);
1007
+ }
1008
+ keys.reverse();
1009
+
1010
+ // Rather than returning an object with a next method, we keep
1011
+ // things simple and return the next function itself.
1012
+ return function next() {
1013
+ while (keys.length) {
1014
+ var key = keys.pop();
1015
+ if (key in object) {
1016
+ next.value = key;
1017
+ next.done = false;
1018
+ return next;
1019
+ }
1020
+ }
1021
+
1022
+ // To avoid creating an additional object, we just hang the .value
1023
+ // and .done properties off the next function object itself. This
1024
+ // also ensures that the minifier will not anonymize the function.
1025
+ next.done = true;
1026
+ return next;
1027
+ };
1028
+ };
1029
+
1030
+ function values(iterable) {
1031
+ if (iterable) {
1032
+ var iteratorMethod = iterable[iteratorSymbol];
1033
+ if (iteratorMethod) {
1034
+ return iteratorMethod.call(iterable);
1035
+ }
1036
+
1037
+ if (typeof iterable.next === "function") {
1038
+ return iterable;
1039
+ }
1040
+
1041
+ if (!isNaN(iterable.length)) {
1042
+ var i = -1, next = function next() {
1043
+ while (++i < iterable.length) {
1044
+ if (hasOwn.call(iterable, i)) {
1045
+ next.value = iterable[i];
1046
+ next.done = false;
1047
+ return next;
1048
+ }
1049
+ }
1050
+
1051
+ next.value = undefined;
1052
+ next.done = true;
1053
+
1054
+ return next;
1055
+ };
1056
+
1057
+ return next.next = next;
1058
+ }
1059
+ }
1060
+
1061
+ // Return an iterator with no values.
1062
+ return { next: doneResult };
1063
+ }
1064
+ exports.values = values;
1065
+
1066
+ function doneResult() {
1067
+ return { value: undefined, done: true };
1068
+ }
1069
+
1070
+ Context.prototype = {
1071
+ constructor: Context,
1072
+
1073
+ reset: function(skipTempReset) {
1074
+ this.prev = 0;
1075
+ this.next = 0;
1076
+ // Resetting context._sent for legacy support of Babel's
1077
+ // function.sent implementation.
1078
+ this.sent = this._sent = undefined;
1079
+ this.done = false;
1080
+ this.delegate = null;
1081
+
1082
+ this.method = "next";
1083
+ this.arg = undefined;
1084
+
1085
+ this.tryEntries.forEach(resetTryEntry);
1086
+
1087
+ if (!skipTempReset) {
1088
+ for (var name in this) {
1089
+ // Not sure about the optimal order of these conditions:
1090
+ if (name.charAt(0) === "t" &&
1091
+ hasOwn.call(this, name) &&
1092
+ !isNaN(+name.slice(1))) {
1093
+ this[name] = undefined;
1094
+ }
1095
+ }
1096
+ }
1097
+ },
1098
+
1099
+ stop: function() {
1100
+ this.done = true;
1101
+
1102
+ var rootEntry = this.tryEntries[0];
1103
+ var rootRecord = rootEntry.completion;
1104
+ if (rootRecord.type === "throw") {
1105
+ throw rootRecord.arg;
1106
+ }
1107
+
1108
+ return this.rval;
1109
+ },
1110
+
1111
+ dispatchException: function(exception) {
1112
+ if (this.done) {
1113
+ throw exception;
1114
+ }
1115
+
1116
+ var context = this;
1117
+ function handle(loc, caught) {
1118
+ record.type = "throw";
1119
+ record.arg = exception;
1120
+ context.next = loc;
1121
+
1122
+ if (caught) {
1123
+ // If the dispatched exception was caught by a catch block,
1124
+ // then let that catch block handle the exception normally.
1125
+ context.method = "next";
1126
+ context.arg = undefined;
1127
+ }
1128
+
1129
+ return !! caught;
1130
+ }
1131
+
1132
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1133
+ var entry = this.tryEntries[i];
1134
+ var record = entry.completion;
1135
+
1136
+ if (entry.tryLoc === "root") {
1137
+ // Exception thrown outside of any try block that could handle
1138
+ // it, so set the completion value of the entire function to
1139
+ // throw the exception.
1140
+ return handle("end");
1141
+ }
1142
+
1143
+ if (entry.tryLoc <= this.prev) {
1144
+ var hasCatch = hasOwn.call(entry, "catchLoc");
1145
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
1146
+
1147
+ if (hasCatch && hasFinally) {
1148
+ if (this.prev < entry.catchLoc) {
1149
+ return handle(entry.catchLoc, true);
1150
+ } else if (this.prev < entry.finallyLoc) {
1151
+ return handle(entry.finallyLoc);
1152
+ }
1153
+
1154
+ } else if (hasCatch) {
1155
+ if (this.prev < entry.catchLoc) {
1156
+ return handle(entry.catchLoc, true);
1157
+ }
1158
+
1159
+ } else if (hasFinally) {
1160
+ if (this.prev < entry.finallyLoc) {
1161
+ return handle(entry.finallyLoc);
1162
+ }
1163
+
1164
+ } else {
1165
+ throw new Error("try statement without catch or finally");
1166
+ }
1167
+ }
1168
+ }
1169
+ },
1170
+
1171
+ abrupt: function(type, arg) {
1172
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1173
+ var entry = this.tryEntries[i];
1174
+ if (entry.tryLoc <= this.prev &&
1175
+ hasOwn.call(entry, "finallyLoc") &&
1176
+ this.prev < entry.finallyLoc) {
1177
+ var finallyEntry = entry;
1178
+ break;
1179
+ }
1180
+ }
1181
+
1182
+ if (finallyEntry &&
1183
+ (type === "break" ||
1184
+ type === "continue") &&
1185
+ finallyEntry.tryLoc <= arg &&
1186
+ arg <= finallyEntry.finallyLoc) {
1187
+ // Ignore the finally entry if control is not jumping to a
1188
+ // location outside the try/catch block.
1189
+ finallyEntry = null;
1190
+ }
1191
+
1192
+ var record = finallyEntry ? finallyEntry.completion : {};
1193
+ record.type = type;
1194
+ record.arg = arg;
1195
+
1196
+ if (finallyEntry) {
1197
+ this.method = "next";
1198
+ this.next = finallyEntry.finallyLoc;
1199
+ return ContinueSentinel;
1200
+ }
1201
+
1202
+ return this.complete(record);
1203
+ },
1204
+
1205
+ complete: function(record, afterLoc) {
1206
+ if (record.type === "throw") {
1207
+ throw record.arg;
1208
+ }
1209
+
1210
+ if (record.type === "break" ||
1211
+ record.type === "continue") {
1212
+ this.next = record.arg;
1213
+ } else if (record.type === "return") {
1214
+ this.rval = this.arg = record.arg;
1215
+ this.method = "return";
1216
+ this.next = "end";
1217
+ } else if (record.type === "normal" && afterLoc) {
1218
+ this.next = afterLoc;
1219
+ }
1220
+
1221
+ return ContinueSentinel;
1222
+ },
1223
+
1224
+ finish: function(finallyLoc) {
1225
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1226
+ var entry = this.tryEntries[i];
1227
+ if (entry.finallyLoc === finallyLoc) {
1228
+ this.complete(entry.completion, entry.afterLoc);
1229
+ resetTryEntry(entry);
1230
+ return ContinueSentinel;
1231
+ }
1232
+ }
1233
+ },
1234
+
1235
+ "catch": function(tryLoc) {
1236
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1237
+ var entry = this.tryEntries[i];
1238
+ if (entry.tryLoc === tryLoc) {
1239
+ var record = entry.completion;
1240
+ if (record.type === "throw") {
1241
+ var thrown = record.arg;
1242
+ resetTryEntry(entry);
1243
+ }
1244
+ return thrown;
1245
+ }
1246
+ }
1247
+
1248
+ // The context.catch method must only be called with a location
1249
+ // argument that corresponds to a known catch block.
1250
+ throw new Error("illegal catch attempt");
1251
+ },
1252
+
1253
+ delegateYield: function(iterable, resultName, nextLoc) {
1254
+ this.delegate = {
1255
+ iterator: values(iterable),
1256
+ resultName: resultName,
1257
+ nextLoc: nextLoc
1258
+ };
1259
+
1260
+ if (this.method === "next") {
1261
+ // Deliberately forget the last sent value so that we don't
1262
+ // accidentally pass it on to the delegate.
1263
+ this.arg = undefined;
1264
+ }
1265
+
1266
+ return ContinueSentinel;
1267
+ }
1268
+ };
1269
+
1270
+ // Regardless of whether this script is executing as a CommonJS module
1271
+ // or not, return the runtime object so that we can declare the variable
1272
+ // regeneratorRuntime in the outer scope, which allows this module to be
1273
+ // injected easily by `bin/regenerator --include-runtime script.js`.
1274
+ return exports;
1275
+
1276
+ }(
1277
+ // If this script is executing as a CommonJS module, use module.exports
1278
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
1279
+ // object. Either way, the resulting object will be used to initialize
1280
+ // the regeneratorRuntime variable at the top of this file.
1281
+ true ? module.exports : 0
1282
+ ));
1283
+
1284
+ try {
1285
+ regeneratorRuntime = runtime;
1286
+ } catch (accidentalStrictMode) {
1287
+ // This module should not be running in strict mode, so the above
1288
+ // assignment should always work unless something is misconfigured. Just
1289
+ // in case runtime.js accidentally runs in strict mode, we can escape
1290
+ // strict mode using a global Function call. This could conceivably fail
1291
+ // if a Content Security Policy forbids using Function, but in that case
1292
+ // the proper solution is to fix the accidental strict mode problem. If
1293
+ // you've misconfigured your bundler to force strict mode and applied a
1294
+ // CSP to forbid Function, and you're not willing to fix either of those
1295
+ // problems, please detail your unique predicament in a GitHub issue.
1296
+ Function("r", "regeneratorRuntime = r")(runtime);
1297
+ }
1298
+
1299
+
1300
+ /***/ }),
1301
+
1302
+ /***/ "array-flat-polyfill":
1303
+ /*!*************************************************************************************!*\
1304
+ !*** external {"commonjs":"array-flat-polyfill","commonjs2":"array-flat-polyfill"} ***!
1305
+ \*************************************************************************************/
1306
+ /***/ ((module) => {
1307
+
1308
+ "use strict";
1309
+ module.exports = __WEBPACK_EXTERNAL_MODULE_array_flat_polyfill__;
1310
+
1311
+ /***/ }),
1312
+
1313
+ /***/ "react":
1314
+ /*!*********************************************************!*\
1315
+ !*** external {"commonjs":"react","commonjs2":"react"} ***!
1316
+ \*********************************************************/
1317
+ /***/ ((module) => {
1318
+
1319
+ "use strict";
1320
+ module.exports = __WEBPACK_EXTERNAL_MODULE_react__;
1321
+
1322
+ /***/ }),
1323
+
1324
+ /***/ "react-dom":
1325
+ /*!*****************************************************************!*\
1326
+ !*** external {"commonjs":"react-dom","commonjs2":"react-dom"} ***!
1327
+ \*****************************************************************/
1328
+ /***/ ((module) => {
1329
+
1330
+ "use strict";
1331
+ module.exports = __WEBPACK_EXTERNAL_MODULE_react_dom__;
1332
+
1333
+ /***/ }),
1334
+
1335
+ /***/ "redux":
1336
+ /*!*********************************************************!*\
1337
+ !*** external {"commonjs":"redux","commonjs2":"redux"} ***!
1338
+ \*********************************************************/
1339
+ /***/ ((module) => {
1340
+
1341
+ "use strict";
1342
+ module.exports = __WEBPACK_EXTERNAL_MODULE_redux__;
1343
+
1344
+ /***/ })
1345
+
1346
+ /******/ });
1347
+ /************************************************************************/
1348
+ /******/ // The module cache
1349
+ /******/ var __webpack_module_cache__ = {};
1350
+ /******/
1351
+ /******/ // The require function
1352
+ /******/ function __webpack_require__(moduleId) {
1353
+ /******/ // Check if module is in cache
1354
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
1355
+ /******/ if (cachedModule !== undefined) {
1356
+ /******/ return cachedModule.exports;
1357
+ /******/ }
1358
+ /******/ // Create a new module (and put it into the cache)
1359
+ /******/ var module = __webpack_module_cache__[moduleId] = {
1360
+ /******/ // no module.id needed
1361
+ /******/ // no module.loaded needed
1362
+ /******/ exports: {}
1363
+ /******/ };
1364
+ /******/
1365
+ /******/ // Execute the module function
1366
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1367
+ /******/
1368
+ /******/ // Return the exports of the module
1369
+ /******/ return module.exports;
1370
+ /******/ }
1371
+ /******/
1372
+ /************************************************************************/
1373
+ /******/ /* webpack/runtime/compat get default export */
1374
+ /******/ (() => {
1375
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
1376
+ /******/ __webpack_require__.n = (module) => {
1377
+ /******/ var getter = module && module.__esModule ?
1378
+ /******/ () => (module['default']) :
1379
+ /******/ () => (module);
1380
+ /******/ __webpack_require__.d(getter, { a: getter });
1381
+ /******/ return getter;
1382
+ /******/ };
1383
+ /******/ })();
1384
+ /******/
1385
+ /******/ /* webpack/runtime/define property getters */
1386
+ /******/ (() => {
1387
+ /******/ // define getter functions for harmony exports
1388
+ /******/ __webpack_require__.d = (exports, definition) => {
1389
+ /******/ for(var key in definition) {
1390
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1391
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1392
+ /******/ }
1393
+ /******/ }
1394
+ /******/ };
1395
+ /******/ })();
1396
+ /******/
1397
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
1398
+ /******/ (() => {
1399
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1400
+ /******/ })();
1401
+ /******/
1402
+ /******/ /* webpack/runtime/make namespace object */
1403
+ /******/ (() => {
1404
+ /******/ // define __esModule on exports
1405
+ /******/ __webpack_require__.r = (exports) => {
1406
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1407
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1408
+ /******/ }
1409
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
1410
+ /******/ };
1411
+ /******/ })();
1412
+ /******/
1413
+ /************************************************************************/
1414
+ var __webpack_exports__ = {};
1415
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
1416
+ (() => {
1417
+ "use strict";
1418
+ /*!*****************************!*\
1419
+ !*** ./src/core/scripts.js ***!
1420
+ \*****************************/
1421
+ __webpack_require__.r(__webpack_exports__);
1422
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1423
+ /* harmony export */ "attachStoreToWindow": () => (/* reexport safe */ _remote_data_store__WEBPACK_IMPORTED_MODULE_5__.attachStoreToWindow),
1424
+ /* harmony export */ "connectState": () => (/* reexport safe */ _remote_data_store__WEBPACK_IMPORTED_MODULE_5__.connectState),
1425
+ /* harmony export */ "createRemoteDataStore": () => (/* reexport safe */ _remote_data_store__WEBPACK_IMPORTED_MODULE_5__.createRemoteDataStore),
1426
+ /* harmony export */ "fetchBlogPosts": () => (/* reexport safe */ _remote_blogs_posts__WEBPACK_IMPORTED_MODULE_6__.fetchBlogPosts),
1427
+ /* harmony export */ "fetchSessionData": () => (/* reexport safe */ _remote_session_data__WEBPACK_IMPORTED_MODULE_7__.fetchSessionData),
1428
+ /* harmony export */ "getRemoteDataStore": () => (/* reexport safe */ _remote_data_store__WEBPACK_IMPORTED_MODULE_5__.getRemoteDataStore),
1429
+ /* harmony export */ "loadSprites": () => (/* reexport safe */ _load_sprites__WEBPACK_IMPORTED_MODULE_3__["default"]),
1430
+ /* harmony export */ "queryId": () => (/* reexport safe */ _dom_query__WEBPACK_IMPORTED_MODULE_8__.queryId),
1431
+ /* harmony export */ "queryIdAll": () => (/* reexport safe */ _dom_query__WEBPACK_IMPORTED_MODULE_8__.queryIdAll),
1432
+ /* harmony export */ "reactRenderer": () => (/* reexport safe */ _react_renderer__WEBPACK_IMPORTED_MODULE_2__["default"]),
1433
+ /* harmony export */ "reducerBlogPosts": () => (/* reexport safe */ _remote_blogs_posts__WEBPACK_IMPORTED_MODULE_6__.reducerBlogPosts),
1434
+ /* harmony export */ "reducerSessionData": () => (/* reexport safe */ _remote_session_data__WEBPACK_IMPORTED_MODULE_7__.reducerSessionData),
1435
+ /* harmony export */ "renderComponent": () => (/* reexport safe */ _react_renderer__WEBPACK_IMPORTED_MODULE_2__.renderComponent),
1436
+ /* harmony export */ "selectRecentBlogPosts": () => (/* reexport safe */ _remote_blogs_posts__WEBPACK_IMPORTED_MODULE_6__.selectRecentBlogPosts),
1437
+ /* harmony export */ "selectSessionData": () => (/* reexport safe */ _remote_session_data__WEBPACK_IMPORTED_MODULE_7__.selectSessionData),
1438
+ /* harmony export */ "toggleChatWidget": () => (/* reexport safe */ _hubspot_chat_toggle__WEBPACK_IMPORTED_MODULE_4__["default"])
1439
+ /* harmony export */ });
1440
+ /* harmony import */ var array_flat_polyfill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! array-flat-polyfill */ "array-flat-polyfill");
1441
+ /* harmony import */ var array_flat_polyfill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(array_flat_polyfill__WEBPACK_IMPORTED_MODULE_0__);
1442
+ /* harmony import */ var _styles_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./styles.css */ "./src/core/styles.css");
1443
+ /* harmony import */ var _react_renderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./react-renderer */ "./src/core/react-renderer.js");
1444
+ /* harmony import */ var _load_sprites__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./load-sprites */ "./src/core/load-sprites.js");
1445
+ /* harmony import */ var _hubspot_chat_toggle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hubspot-chat-toggle */ "./src/core/hubspot-chat-toggle.js");
1446
+ /* harmony import */ var _remote_data_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./remote-data-store */ "./src/core/remote-data-store.js");
1447
+ /* harmony import */ var _remote_blogs_posts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./remote-blogs-posts */ "./src/core/remote-blogs-posts.js");
1448
+ /* harmony import */ var _remote_session_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./remote-session-data */ "./src/core/remote-session-data.js");
1449
+ /* harmony import */ var _dom_query__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dom-query */ "./src/core/dom-query.js");
1450
+
1451
+
1452
+
1453
+
1454
+
1455
+
1456
+
1457
+
1458
+
1459
+ })();
1460
+
1461
+ /******/ return __webpack_exports__;
1462
+ /******/ })()
1463
+ ;
1464
+ });
1465
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZS9zY3JpcHRzLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSx1Q0FBdUM7QUFDdkMsQ0FBQztBQUNELE87Ozs7Ozs7OztBQ1ZBLGdIQUErQzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNBeEMsSUFBTUEsT0FBTyxHQUFHLFNBQVZBLE9BQVUsQ0FBQ0MsR0FBRDtBQUFBLE1BQU1DLElBQU4sdUVBQWFDLFFBQWI7QUFBQSxTQUNyQkQsSUFBSSxDQUFDRSxhQUFMLG9CQUErQkgsR0FBL0IsT0FEcUI7QUFBQSxDQUFoQjtBQUdBLElBQU1JLFVBQVUsR0FBRyxTQUFiQSxVQUFhLENBQUNKLEdBQUQ7QUFBQSxNQUFNQyxJQUFOLHVFQUFhQyxRQUFiO0FBQUEsU0FDeEJELElBQUksQ0FBQ0ksZ0JBQUwsb0JBQWtDTCxHQUFsQyxPQUR3QjtBQUFBLENBQW5COzs7Ozs7Ozs7Ozs7Ozs7O0FDSFA7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEsU0FBU00sU0FBVCxDQUFtQkM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ICAgICAgICBjb250ZXh0LmRpc3BhdGNoRXhjZXB0aW9uKGNvbnRleHQuYXJnKTtcblxuICAgICAgICB9IGVsc2UgaWYgKGNvbnRleHQubWV0aG9kID09PSBcInJldHVyblwiKSB7XG4gICAgICAgICAgY29udGV4dC5hYnJ1cHQoXCJyZXR1cm5cIiwgY29udGV4dC5hcmcpO1xuICAgICAgICB9XG5cbiAgICAgICAgc3RhdGUgPSBHZW5TdGF0ZUV4ZWN1dGluZztcblxuICAgICAgICB2YXIgcmVjb3JkID0gdHJ5Q2F0Y2goaW5uZXJGbiwgc2VsZiwgY29udGV4dCk7XG4gICAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJub3JtYWxcIikge1xuICAgICAgICAgIC8vIElmIGFuIGV4Y2VwdGlvbiBpcyB0aHJvd24gZnJvbSBpbm5lckZuLCB3ZSBsZWF2ZSBzdGF0ZSA9PT1cbiAgICAgICAgICAvLyBHZW5TdGF0ZUV4ZWN1dGluZyBhbmQgbG9vcCBiYWNrIGZvciBhbm90aGVyIGludm9jYXRpb24uXG4gICAgICAgICAgc3RhdGUgPSBjb250ZXh0LmRvbmVcbiAgICAgICAgICAgID8gR2VuU3RhdGVDb21wbGV0ZWRcbiAgICAgICAgICAgIDogR2VuU3RhdGVTdXNwZW5kZWRZaWVsZDtcblxuICAgICAgICAgIGlmIChyZWNvcmQuYXJnID09PSBDb250aW51ZVNlbnRpbmVsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdmFsdWU6IHJlY29yZC5hcmcsXG4gICAgICAgICAgICBkb25lOiBjb250ZXh0LmRvbmVcbiAgICAgICAgICB9O1xuXG4gICAgICAgIH0gZWxzZSBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgIHN0YXRlID0gR2VuU3RhdGVDb21wbGV0ZWQ7XG4gICAgICAgICAgLy8gRGlzcGF0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ubWV0aG9kID09PSBcInRocm93XCIpIHtcbiAgICAgICAgLy8gTm90ZTogW1wicmV0dXJuXCJdIG11c3QgYmUgdXNlZCBmb3IgRVMzIHBhcnNpbmcgY29tcGF0aWJpbGl0eS5cbiAgICAgICAgaWYgKGRlbGVnYXRlLml0ZXJhdG9yW1wicmV0dXJuXCJdKSB7XG4gICAgICAgICAgLy8gSWYgdGhlIGRlbGVnYXRlIGl0ZXJhdG9yIGhhcyBhIHJldHVybiBtZXRob2QsIGdpdmUgaXQgYVxuICAgICAgICAgIC8vIGNoYW5jZSB0byBjbGVhbiB1cC5cbiAgICAgICAgICBjb250ZXh0Lm1ldGhvZCA9IFwicmV0dXJuXCI7XG4gICAgICAgICAgY29udGV4dC5hcmcgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgbWF5YmVJbnZva2VEZWxlZ2F0ZShkZWxlZ2F0ZSwgY29udGV4dCk7XG5cbiAgICAgICAgICBpZiAoY29udGV4dC5tZXRob2QgPT09IFwidGhyb3dcIikge1xuICAgICAgICAgICAgLy8gSWYgbWF5YmVJbnZva2VEZWxlZ2F0ZShjb250ZXh0KSBjaGFuZ2VkIGNvbnRleHQubWV0aG9kIGZyb21cbiAgICAgICAgICAgIC8vIFwicmV0dXJuXCIgdG8gXCJ0aHJvd1wiLCBsZXQgdGhhdCBvdmVycmlkZSB0aGUgVHlwZUVycm9yIGJlbG93LlxuICAgICAgICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29udGV4dC5tZXRob2QgPSBcInRocm93XCI7XG4gICAgICAgIGNvbnRleHQuYXJnID0gbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICBcIlRoZSBpdGVyYXRvciBkb2VzIG5vdCBwcm92aWRlIGEgJ3Rocm93JyBtZXRob2RcIik7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBDb250aW51ZVNlbnRpbmVsO1xuICAgIH1cblxuICAgIHZhci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AgICAgICAgaWYgKGVudHJ5LnRyeUxvYyA9PT0gXCJyb290XCIpIHtcbiAgICAgICAgICAvLyBFeGNlcHRpb24gdGhyb3duIG91dHNpZGUgb2YgYW55IHRyeSBibG9jayB0aGF0IGNvdWxkIGhhbmRsZVxuICAgICAgICAgIC8vIGl0LCBzbyBzZXQgdGhlIGNvbXBsZXRpb24gdmFsdWUgb2YgdGhlIGVudGlyZSBmdW5jdGlvbiB0b1xuICAgICAgICAgIC8vIHRocm93IHRoZSBleGNlcHRpb24uXG4gICAgICAgICAgcmV0dXJuIGhhbmRsZShcImVuZFwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPD0gdGhpcy5wcmV2KSB7XG4gICAgICAgICAgdmFyIGhhc0NhdGNoID0gaGFzT3duLmNhbGwoZW50cnksIFwiY2F0Y2hMb2NcIik7XG4gICAgICAgICAgdmFyIGhhc0ZpbmFsbHkgPSBoYXNPd24uY2FsbChlbnRyeSwgXCJmaW5hbGx5TG9jXCIpO1xuXG4gICAgICAgICAgaWYgKGhhc0NhdGNoICYmIGhhc0ZpbmFsbHkpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5jYXRjaExvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmNhdGNoTG9jLCB0cnVlKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmZpbmFsbHlMb2MpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIGlmIChoYXNDYXRjaCkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJldiA8IGVudHJ5LmNhdGNoTG9jKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoYW5kbGUoZW50cnkuY2F0Y2hMb2MsIHRydWUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIGlmIChoYXNGaW5hbGx5KSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmZpbmFsbHlMb2MpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcInRyeSBzdGF0ZW1lbnQgd2l0aG91dCBjYXRjaCBvciBmaW5hbGx5XCIpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG5cbiAgICBhYnJ1cHQ6IGZ1bmN0aW9uKHR5cGUsIGFyZykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPD0gdGhpcy5wcmV2ICYmXG4gICAgICAgICAgICBoYXNPd24uY2FsbChlbnRyeSwgXCJmaW5hbGx5TG9jXCIpICYmXG4gICAgICAgICAgICB0aGlzLnByZXYgPCBlbnRyeS5maW5hbGx5TG9jKSB7XG4gICAgICAgICAgdmFyIGZpbmFsbHlFbnRyeSA9IGVudHJ5O1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChmaW5hbGx5RW50cnkgJiZcbiAgICAgICAgICAodHlwZSA9PT0gXCJicmVha1wiIHx8XG4gICAgICAgICAgIHR5cGUgPT09IFwiY29udGludWVcIikgJiZcbiAgICAgICAgICBmaW5hbGx5RW50cnkudHJ5TG9jIDw9IGFyZyAmJlxuICAgICAgICAgIGFyZyA8PSBmaW5hbGx5RW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAvLyBJZ25vcmUgdGhlIGZpbmFsbHkgZW50cnkgaWYgY29udHJvbCBpcyBub3QganVtcGluZyB0byBhXG4gICAgICAgIC8vIGxvY2F0aW9uIG91dHNpZGUgdGhlIHRyeS9jYXRjaCBibG9jay5cbiAgICAgICAgZmluYWxseUVudHJ5ID0gbnVsbDtcbiAgICAgIH1cblxuICAgICAgdmFyIHJlY29yZCA9IGZpbmFsbHlFbnRyeSA/IGZpbmFsbHlFbnRyeS5jb21wbGV0aW9uIDoge307XG4gICAgICByZWNvcmQudHlwZSA9IHR5cGU7XG4gICAgICByZWNvcmQuYXJnID0gYXJnO1xuXG4gICAgICBpZiAoZmluYWxseUVudHJ5KSB7XG4gICAgICAgIHRoaXMubWV0aG9kID0gXCJuZXh0XCI7XG4gICAgICAgIHRoaXMubmV4dCA9IGZpbmFsbHlFbnRyeS5maW5hbGx5TG9jO1xuICAgICAgICByZXR1cm4gQ29udGludWVTZW50aW5lbDtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIHRoaXMuY29tcGxldGUocmVjb3JkKTtcbiAgICB9LFxuXG4gICAgY29tcGxldGU6IGZ1bmN0aW9uKHJlY29yZCwgYWZ0ZXJMb2MpIHtcbiAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJ0aHJvd1wiKSB7XG4gICAgICAgIHRocm93IHJlY29yZC5hcmc7XG4gICAgICB9XG5cbiAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJicmVha1wiIHx8XG4gICAgICAgICAgcmVjb3JkLnR5cGUgPT09IFwiY29udGludWVcIikge1xuICAgICAgICB0aGlzLm5leHQgPSByZWNvcmQuYXJnO1xuICAgICAgfSBlbHNlIGlmIChyZWNvcmQudHlwZSA9PT0gXCJyZXR1cm5cIikge1xuICAgICAgICB0aGlzLnJ2YWwgPSB0aGlzLmFyZyA9IHJlY29yZC5hcmc7XG4gICAgICAgIHRoaXMubWV0aG9kID0gXCJyZXR1cm5cIjtcbiAgICAgICAgdGhpcy5uZXh0ID0gXCJlbmRcIjtcbiAgICAgIH0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