var Unsubscribe=function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};return t.m=n,t.c=i,t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,i){var r,u;if((1&i&&(n=t(n)),8&i)||4&i&&"object"==typeof n&&n&&n.__esModule)return n;if(r=Object.create(null),t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&i&&"string"!=typeof n)for(u in n)t.d(r,u,function(t){return n[t]}.bind(null,u));return r},t.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=3)}([function(n){n.exports=React},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(7);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return(n=r,n&&n.__esModule?n:{"default":n}).default;var n}});Object.defineProperty(t,"ALERT_STYLES",{enumerable:!0,get:function(){return r.ALERT_STYLES}})},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(16);Object.defineProperty(t,"createMarkup",{enumerable:!0,get:function(){return r.createMarkup}})},function(n,t,i){i(4);i(5);n.exports=i(6)},function(){"use strict";if("undefined"!=typeof window&&void 0===window.Promise){var n=document.createElement("script");n.setAttribute("src","https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.2.8/es6-promise.auto.min.js");n.setAttribute("type","text/javascript");document.getElementsByTagName("head")[0].appendChild(n)}},function(){"use strict";if("undefined"!=typeof window&&void 0===window.fetch){var n=document.createElement("script");n.setAttribute("src","https://cdn.jsdelivr.net/npm/whatwg-fetch@3.0.0/dist/fetch.umd.js");n.setAttribute("type","text/javascript");document.getElementsByTagName("head")[0].appendChild(n)}},function(n,t,i){"use strict";function u(n){return n&&n.__esModule?n:{"default":n}}function a(n){if(Array.isArray(n)){for(var t=0,i=Array(n.length);t<n.length;t++)i[t]=n[t];return i}return Array.from(n)}var e,o;Object.defineProperty(t,"__esModule",{value:!0});t.App=void 0;var s=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=u(i(0)),h=u(i(1)),c=u(i(8)),f=i(2),l=u(i(17));e={success:6e3,"detailed-success":3e4,error:null,"detailed-error":null};o=function(n){function t(n){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,t);var i,r=function(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n));return r.state={shortCode:(i=n.initialData).ShortCode,pageHeadlineHtml:i.PageHeadlineHtml,unsubscribeCheckbox:!i.EmailInterests||!i.EmailInterests.some(function(n){return n.IsOptedIn}),unsubscribeCheckboxLabel:i.UnsubscribeLanguageHtml,emailAddress:i.EmailAddress,buttonText:i.SubmitButtonText,emailInterestsEnabled:!0,emailInterests:i.EmailInterests,emailInterestsHtml:i.EmailInterestHtml,confirmed:!1,confirmInProgress:!1,messages:[],isPreview:i.IsPreview},r.showMessage=r.showMessage.bind(r),r.OaApiService=new l.default(n.initialData.BearerToken,n.initialData.ShortCode,r.showMessage),r.confirm=r.confirm.bind(r),r}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),s(t,[{key:"showMessage",value:function(n,t,i){var r={title:t,description:i,style:n,position:"top-right",notificationId:(new Date).getTime(),delay:e[n]};this.setState({messages:[].concat(a(this.state.messages),[r])})}},{key:"confirm",value:function(n){var t=this;this.state.confirmInProgress||this.state.isPreview||(this.setState({confirmInProgress:!0}),this.OaApiService.updateAndConfirm(n).then(function(n){t.setState({confirmed:!0,confirmationHtml:n,confirmInProgress:!1})},function(){t.setState({confirmInProgress:!1})}))}},{key:"render",value:function(){if(this.state.confirmed)return r.default.createElement("span",{id:"Confirmation",dangerouslySetInnerHTML:f.createMarkup(this.state.confirmationHtml)});var n=null;return this.state.messages&&this.state.messages.length&&(n=this.state.messages.map(function(n){return r.default.createElement(h.default,{key:n.notificationId,toast:n})})),r.default.createElement("div",{className:"oa-ssp-app-container oa-unsub-app-container"},r.default.createElement("div",{className:"unsub-header"},r.default.createElement("div",{className:"pageHeadline-html"},r.default.createElement("span",{id:"pageHeadline",dangerouslySetInnerHTML:f.createMarkup(this.state.pageHeadlineHtml)}))),r.default.createElement("div",{className:"unsub-contents"},r.default.createElement(c.default,{oaApiService:this.OaApiService,emailAddress:this.state.emailAddress,buttonText:this.state.buttonText,emailInterestsEnabled:this.state.emailInterestsEnabled,emailInterests:this.state.emailInterests,emailInterestsHtml:this.state.emailInterestsHtml,unsubscribeCheckbox:this.state.unsubscribeCheckbox,unsubscribeCheckboxLabel:this.state.unsubscribeCheckboxLabel,onSubmit:this.confirm})),n)}}]),t}(r.default.Component);t.App=o},function(n,t,i){"use strict";function f(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}Object.defineProperty(t,"__esModule",{value:!0});t.ALERT_STYLES=void 0;var u,o,s=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),h=i(0),r=(o=h)&&o.__esModule?o:{"default":o};var e=t.ALERT_STYLES={SUCCESS:"success",SUCCESS_ALWAYS_GREEN:"success-always-green",DETAILED_SUCCESS:"detailed-success",DETAILED_ERROR:"detailed-error",ERROR:"error"},c=(f(u={},e.SUCCESS,"ok-sign"),f(u,e.SUCCESS_ALWAYS_GREEN,"ok-sign"),f(u,e.DETAILED_SUCCESS,"ok-sign"),f(u,e.DETAILED_ERROR,"exclamation-sign"),f(u,e.ERROR,"exclamation-sign"),u),l=function(n){function t(n){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,t);var i=function(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n));return i.state={visible:!0,fadeOut:!1},i.dismissToast=i.dismissToast.bind(i),i.onAnimationEnd=i.onAnimationEnd.bind(i),i.renderAction=i.renderAction.bind(i),i}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),s(t,[{key:"componentDidMount",value:function(){this.props.toast.delay&&this.setTimer()}},{key:"componentWillUnmount",value:function(){this.props.toast.delay&&clearTimeout(this.timer)}},{key:"setTimer",value:function(){var n=this;null!==this.timer&&clearTimeout(this.timer);this.timer=setTimeout(function(){n.setState({fadeOut:!0});n.timer=null},this.props.toast.delay)}},{key:"dismissToast",value:function(){this.setState({visible:!1})}},{key:"onAnimationEnd",value:function(){this.state.fadeOut&&this.dismissToast()}},{key:"renderAction",value:function(n){var t=this;return r.default.createElement("a",{className:"open-toast-link",href:"javascript:void(0)",onClick:function(){n.action();t.dismissToast()}},n.text)}},{key:"render",value:function(){var t=this,n=this.props.toast;return this.state.visible?r.default.createElement("div",{className:"toast-notification-container toast-"+n.position+" "+(this.state.fadeOut?"toast-fade-out":""),onAnimationEnd:this.onAnimationEnd},r.default.createElement("div",{className:"toast-notification toast-"+n.position+" toast-"+n.style},r.default.createElement("div",{className:"toast-notification-icon"},r.default.createElement("span",{className:"glyphicons glyphicons-"+c[n.style],"aria-hidden":"true"})),r.default.createElement("div",{className:"toast-notification-title"},n.title),r.default.createElement("div",{className:"toast-notification-button"},r.default.createElement("span",{className:"glyphicons glyphicons-remove","aria-hidden":"true",onClick:this.dismissToast}),r.default.createElement("span",{className:"reader-only"},"Dismiss Toast")),r.default.createElement("div",{className:"toast-notification-description"},n.description),this.props.primaryAction&&r.default.createElement("div",null,t.props.primaryAction&&t.renderAction(t.props.primaryAction)))):r.default.createElement("span",null)}}]),t}(r.default.Component);t.default=l},function(n,t,i){"use strict";function u(n){return n&&n.__esModule?n:{"default":n}}var e,o;Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},h=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=u(i(0)),f=u(i(9)),c=u(i(11)),l=u(i(13)),a=u(i(14));e="Email address";o=function(n){function t(n){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,t);var i=function(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n));return i.state={unsubscribeAll:i.props.unsubscribeCheckbox,emailInterests:i.props.emailInterests},i.handleChange=i.handleChange.bind(i),i.onSubmit=i.onSubmit.bind(i),i.onInterestChange=i.onInterestChange.bind(i),i}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),h(t,[{key:"handleChange",value:function(n){this.setState({unsubscribeAll:n})}},{key:"onInterestChange",value:function(n,t){var i=[].concat(function(n){if(Array.isArray(n)){for(var t=0,i=Array(n.length);t<n.length;t++)i[t]=n[t];return i}return Array.from(n)}(this.state.emailInterests)),r=i.indexOf(n);i[r]=s({},n,{IsOptedIn:t});this.setState({emailInterests:i})}},{key:"onSubmit",value:function(){this.props.onSubmit&&this.props.onSubmit(this.state)}},{key:"render",value:function(){var n=this;return r.default.createElement("div",null,r.default.createElement(f.default,{cardTitle:e},r.default.createElement(l.default,{emailAddress:this.props.emailAddress})),r.default.createElement(f.default,null,r.default.createElement(a.default,{emailInterestsEnabled:this.props.emailInterestsEnabled,emailInterests:this.state.emailInterests,emailInterestsHtml:this.props.emailInterestsHtml,onInterestChange:this.onInterestChange,unsubscribeCheckbox:this.state.unsubscribeAll,unsubscribeCheckboxLabel:this.props.unsubscribeCheckboxLabel,onCheckboxChange:function(t){return n.handleChange(t)}})),r.default.createElement(c.default,{className:"unsubscribe-button",color:"blue",ref:function(t){return n.saveBtn=t},onClick:this.onSubmit,disabled:!1},this.props.buttonText))}}]),t}(r.default.Component);t.default=o},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(10);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return(n=r,n&&n.__esModule?n:{"default":n}).default;var n}})},function(n,t,i){"use strict";function s(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function h(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}var f;Object.defineProperty(t,"__esModule",{value:!0});var u,e=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),o=i(0),r=(u=o)&&u.__esModule?u:{"default":u};f=function(n){function t(){return s(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),e(t,[{key:"render",value:function(){return r.default.createElement("div",{className:"card "+this.props.cardName,id:this.props.cardKey},r.default.createElement("div",{className:"card-panel"},this.props.cardTitle&&r.default.createElement("div",{className:"card-title"},this.props.cardTitle),r.default.createElement("div",null,this.props.children)))}}]),t}(r.default.Component);t.default=f},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(12);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return(n=r,n&&n.__esModule?n:{"default":n}).default;var n}})},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,f=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),e=i(0),u=(r=e)&&r.__esModule?r:{"default":r},o=function(n){function t(n){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,t);var i=function(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n));return i.onClick=i.onClick.bind(i),i.onKeyDown=i.onKeyDown.bind(i),i}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),f(t,[{key:"onClick",value:function(n){n.preventDefault();this.props.onClick&&this.props.onClick()}},{key:"onKeyDown",value:function(n){this.props.onKeyDown&&this.props.onKeyDown(n)}},{key:"focus",value:function(){this.buttonElement&&this.buttonElement.focus()}},{key:"render",value:function(){var t=this,n="btn";return this.props.color&&(n+=" btn-"+this.props.color),this.props.className&&(n+=" "+this.props.className),u.default.createElement("button",{type:"button",ref:function(n){return t.buttonElement=n},className:n,onClick:this.onClick,onKeyDown:this.onKeyDown,disabled:this.props.disabled},this.props.children)}}]),t}(u.default.Component);t.default=o},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u,f=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),e=i(0),r=(u=e)&&u.__esModule?u:{"default":u},o="Not your email address?",s="This email message may have been forwarded to you from a friend or colleague. Please contact them directly to stop receiving forwarded emails.",h=function(n){function t(n){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,t);var i=function(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n));return i.state={openHint:!1},i.handleHintClick=i.handleHintClick.bind(i),i}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),f(t,[{key:"handleHintClick",value:function(n){n.preventDefault();this.setState(function(n){return{openHint:!n.openHint}})}},{key:"render",value:function(){return r.default.createElement("div",{className:"card-content"},r.default.createElement("div",{className:"email-address-label"},r.default.createElement("b",null,this.props.emailAddress)),r.default.createElement("div",{className:"card-description unsubscribe-preferences"},r.default.createElement("a",{href:"#",onClick:this.handleHintClick},o),this.state.openHint&&r.default.createElement("p",{className:"unsubscribe-hint"},s)))}}]),t}(r.default.Component);t.default=h},function(n,t,i){"use strict";function e(n){return n&&n.__esModule?n:{"default":n}}function h(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function c(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}var o;Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=e(i(0)),u=e(i(15)),f=i(2);o=function(n){function t(){return h(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),s(t,[{key:"render",value:function(){var t=this,n=this.props.emailInterestsEnabled&&this.props.emailInterests&&this.props.emailInterests.length>0,i=r.default.createElement("span",{id:"checkboxLabel",dangerouslySetInnerHTML:f.createMarkup(this.props.unsubscribeCheckboxLabel)}),e=r.default.createElement("span",{id:"interestsLabel",dangerouslySetInnerHTML:f.createMarkup(this.props.emailInterestsHtml)});return r.default.createElement("div",{className:"card-content"},n&&r.default.createElement("div",null,r.default.createElement("div",{className:"card-description unsubscribe-preferences"},e),r.default.createElement("div",{className:"interests-list unsubscribe-preferences"},this.props.emailInterestsEnabled&&this.props.emailInterests.map(function(n){return r.default.createElement(u.default,{key:n.Id,id:"interest"+n.Id+"checkbox",className:"unsubscribe-preferences interest",label:n.Name,defaultChecked:n.IsOptedIn,onChange:function(i){return t.props.onInterestChange(n,i)}})}))),n&&r.default.createElement("hr",{className:"unsubscribe-flex-hr"}),r.default.createElement("div",{className:"interests-list"},r.default.createElement(u.default,{className:"unsubscribe-preferences",label:i,id:"all-emails-checkbox",defaultChecked:this.props.unsubscribeCheckbox,onChange:this.props.onCheckboxChange})))}}]),t}(r.default.Component);t.default=o},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,f=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),e=i(0),u=(r=e)&&r.__esModule?r:{"default":r},o=function(n){function t(n){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,t);var i=function(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n));return i.state={defaultChecked:i.props.defaultChecked},i.onChange=i.onChange.bind(i),i}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),f(t,[{key:"onChange",value:function(n){this.props.onChange&&this.props.onChange(n.target.checked)}},{key:"render",value:function(){return u.default.createElement("label",{className:this.props.className,htmlFor:this.props.id},u.default.createElement("input",{type:"checkbox",defaultChecked:this.state.defaultChecked,onChange:this.onChange,ref:this.props.inputRef,id:this.props.id,name:this.props.id}),u.default.createElement("span",null,this.props.label))}}]),t}(u.default.Component);t.default=o},function(n,t){"use strict";function r(n){var t=1;try{t=parseFloat(i(document.documentElement).fontSize)}catch(n){}return n*t}Object.defineProperty(t,"__esModule",{value:!0});t.convertRemToPixels=r;t.parseQueryStrings=function(n){var u={},r,i,t;for("?"===(n=n||"")[0]&&(n=n.substring(1)),r=n.split("&"),i=0;i<r.length;i++)t=r[i],t.indexOf("=")>=0&&(t=t.split("="),u[t[0]]=t[1]);return u};t.flattenQueryString=function(n){var t=[],i;if(n)for(i in n)t.push(i+"="+n[i]);return t.length?"?"+t.join("&"):""};t.createMarkup=function(n){return{__html:n}};var i=function(){return{}};try{i=window.getComputedStyle}catch(n){}t.constants={mobileWidth:r(40.0625)-1}},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var f=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=i(1),u="Something went wrong. Please try again.",e="Error",o=function(){function n(t,i,r){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this.bearerToken=t;this.shortCode=i;this.showMessage=r;this.handleErrors=this.handleErrors.bind(this);this.updateAndConfirm=this.updateAndConfirm.bind(this)}return f(n,[{key:"handleErrors",value:function(n,t){var i=this;if(!n)throw this.showMessage(r.ALERT_STYLES.ERROR,u),"Invalid response";if(n.Alerts&&this.showMessage&&n.Alerts.forEach(function(n){return i.showMessage(r.ALERT_STYLES.DETAILED_ERROR,t||e,n.Message)}),n.Error)throw n.Error;}},{key:"updateAndConfirm",value:function(n){var t,i=this,f=(t={},window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(n,i,r){return t[i]=window.decodeURIComponent(r)}),t),e={doUnsubscribe:n.unsubscribeAll,emailInterests:n.emailInterests,encryptedUnsubData:f.unsubscribedata};return fetch("/p/"+window.encodeURIComponent(this.shortCode)+"/unsub/confirmation",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:"Bearer "+this.bearerToken},body:JSON.stringify(e)}).then(function(n){return n.json()}).catch(function(n){throw i.showMessage(r.ALERT_STYLES.ERROR,u),n;}).then(function(n){return i.handleErrors(n),n.ConfirmationHtml})}}]),n}();t.default=o}])