Version Description
- 2018-12-13 =
- Fixed: select all once again selects all;
- Fixed: Post Notification emails to include post images for posts created with WordPress 5.0;
- Fixed: restored correct button captions;
- Fixed: after a brief rebellion, post notification history now displays in an orderly fashion again;
Download this release
Release Info
Developer | wysija |
Plugin | MailPoet Newsletters (New) |
Version | 3.16.3 |
Comparing to | |
See all releases |
Code changes from version 3.16.2 to 3.16.3
assets/css/{admin.8988cd0e.css → admin.66bea786.css}
RENAMED
@@ -2586,9 +2586,16 @@ rgba(0,0,0,0.3)
|
|
2586 |
.mailpoet_listing_table th span {
|
2587 |
white-space: nowrap;
|
2588 |
}
|
2589 |
-
.mailpoet_listing_table thead .check-column,
|
2590 |
-
.mailpoet_listing_table tfoot .check-column {
|
2591 |
padding: 10px 0 0 3px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2592 |
}
|
2593 |
.mailpoet_listing_table thead th.column-primary,
|
2594 |
.mailpoet_listing_table tfoot th.column-primary {
|
2586 |
.mailpoet_listing_table th span {
|
2587 |
white-space: nowrap;
|
2588 |
}
|
2589 |
+
.mailpoet_listing_table thead .mailpoet-check-column,
|
2590 |
+
.mailpoet_listing_table tfoot .mailpoet-check-column {
|
2591 |
padding: 10px 0 0 3px;
|
2592 |
+
width: 2.2em;
|
2593 |
+
vertical-align: top;
|
2594 |
+
}
|
2595 |
+
.mailpoet_listing_table tbody .mailpoet-check-column {
|
2596 |
+
margin: 0 0 0 8px;
|
2597 |
+
vertical-align: text-top;
|
2598 |
+
padding: 11px 0 0 3px;
|
2599 |
}
|
2600 |
.mailpoet_listing_table thead th.column-primary,
|
2601 |
.mailpoet_listing_table tfoot th.column-primary {
|
assets/css/manifest.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
{
|
2 |
"admin-global.css": "admin-global.bcd24dab.css",
|
3 |
-
"admin.css": "admin.
|
4 |
"importExport.css": "importExport.b3745466.css",
|
5 |
"newsletter_editor.css": "newsletter_editor.2f6ce55a.css",
|
6 |
"public.css": "public.cae357df.css",
|
1 |
{
|
2 |
"admin-global.css": "admin-global.bcd24dab.css",
|
3 |
+
"admin.css": "admin.66bea786.css",
|
4 |
"importExport.css": "importExport.b3745466.css",
|
5 |
"newsletter_editor.css": "newsletter_editor.2f6ce55a.css",
|
6 |
"public.css": "public.cae357df.css",
|
assets/js/admin.3e28a2ac.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
webpackJsonp([2],{188:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function Tabs(props){var tabLinks=tabs.map(function(tab){var tabClasses=(0,_classnames2.default)("nav-tab",{"nav-tab-active":props.tab===tab.name});return _react2.default.createElement(_reactRouterDom.Link,{key:"tab-"+tab.name,className:tabClasses,to:tab.link},tab.label)});return _react2.default.createElement("h2",{className:"nav-tab-wrapper"},tabLinks)}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(7),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),tabs=[{name:"knowledgeBase",label:_mailpoet2.default.I18n.t("tabKnowledgeBaseTitle"),link:"/knowledgeBase"},{name:"systemStatus",label:_mailpoet2.default.I18n.t("tabSystemStatusTitle"),link:"/systemStatus"},{name:"systemInfo",label:_mailpoet2.default.I18n.t("tabSystemInfoTitle"),link:"/systemInfo"},{name:"yourPrivacy",label:_mailpoet2.default.I18n.t("tabYourPrivacyTitle"),link:"/yourPrivacy"}];Tabs.propTypes={tab:_propTypes2.default.string},Tabs.defaultProps={tab:"knowledgeBase"},module.exports=Tabs},292:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}function confirmAlert(props){_reactDom2.default.render(_react2.default.createElement(ConfirmAlert,props),document.getElementById("mailpoet_confirm_alert_holder"))}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}();exports.default=confirmAlert;var _mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),ConfirmAlert=function(_React$Component){function ConfirmAlert(props){_classCallCheck(this,ConfirmAlert);var _this=_possibleConstructorReturn(this,(ConfirmAlert.__proto__||Object.getPrototypeOf(ConfirmAlert)).call(this,props));return _this.componentWillUpdate=function(){_this.state.show||_this.setState({show:!0})},_this.onClose=function(){_this.setState({show:!1})},_this.onConfirm=function(){_this.onClose(),_this.props.onConfirm()},_this.state={show:!0},_this}return _inherits(ConfirmAlert,_React$Component),_createClass(ConfirmAlert,[{key:"render",value:function(){var _props=this.props,title=_props.title,message=_props.message,confirmLabel=_props.confirmLabel,cancelLabel=_props.cancelLabel;return this.state.show&&_react2.default.createElement("div",{className:"mailpoet_modal_overlay"},_react2.default.createElement("div",{className:"mailpoet_popup",tabIndex:"-1"},_react2.default.createElement("div",{className:"mailpoet_popup_wrapper"},_react2.default.createElement("button",{className:"mailpoet_modal_close",onClick:this.onClose}),title&&_react2.default.createElement("div",{className:"mailpoet_popup_title"},_react2.default.createElement("h2",null,title)),_react2.default.createElement("div",{className:"mailpoet_popup_body clearfix"},_react2.default.createElement("p",{className:"mailpoet_hp_email_label"},message),_react2.default.createElement("button",{className:"button button-secondary",onClick:this.onClose},cancelLabel),_react2.default.createElement("button",{className:"button button-primary",onClick:this.onConfirm},confirmLabel)))))}}]),ConfirmAlert}(_react2.default.Component);ConfirmAlert.propTypes={title:_propTypes2.default.string,message:_propTypes2.default.string.isRequired,cancelLabel:_propTypes2.default.string,confirmLabel:_propTypes2.default.string,onConfirm:_propTypes2.default.func.isRequired},ConfirmAlert.defaultProps={title:_mailpoet2.default.I18n.t("confirmTitle"),cancelLabel:_mailpoet2.default.I18n.t("cancelLabel"),confirmLabel:_mailpoet2.default.I18n.t("confirmLabel")}},293:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_select=__webpack_require__(263),_select2=_interopRequireDefault(_select),_common=__webpack_require__(269),intervalField={name:"intervalType",values:_common.intervalValues},timeOfDayField={name:"timeOfDay",values:_common.timeOfDayValues},weekDayField={name:"weekDay",values:_common.weekDayValues},monthDayField={name:"monthDay",values:_common.monthDayValues},nthWeekDayField={name:"nthWeekDay",values:_common.nthWeekDayValues},NotificationScheduling=function(_React$Component){function NotificationScheduling(){var _ref,_temp,_this,_ret;_classCallCheck(this,NotificationScheduling);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=NotificationScheduling.__proto__||Object.getPrototypeOf(NotificationScheduling)).call.apply(_ref,[this].concat(args))),_this.getCurrentValue=function(){return _this.props.item[_this.props.field.name]||{}},_this.handleValueChange=function(name,value){var oldValue=_this.getCurrentValue(),newValue={};return newValue[name]=value,_this.props.onValueChange({target:{name:_this.props.field.name,value:_underscore2.default.extend({},oldValue,newValue)}})},_this.handleIntervalChange=function(event){return _this.handleValueChange("intervalType",event.target.value)},_this.handleTimeOfDayChange=function(event){return _this.handleValueChange("timeOfDay",event.target.value)},_this.handleWeekDayChange=function(event){return _this.handleValueChange("weekDay",event.target.value)},_this.handleMonthDayChange=function(event){return _this.handleValueChange("monthDay",event.target.value)},_this.handleNthWeekDayChange=function(event){return _this.handleValueChange("nthWeekDay",event.target.value)},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(NotificationScheduling,_React$Component),_createClass(NotificationScheduling,[{key:"render",value:function(){var value=this.getCurrentValue(),timeOfDaySelection=void 0,weekDaySelection=void 0,monthDaySelection=void 0,nthWeekDaySelection=void 0;return"immediately"!==value.intervalType&&(timeOfDaySelection=_react2.default.createElement(_select2.default,{field:timeOfDayField,item:this.getCurrentValue(),onValueChange:this.handleTimeOfDayChange})),"weekly"!==value.intervalType&&"nthWeekDay"!==value.intervalType||(weekDaySelection=_react2.default.createElement(_select2.default,{field:weekDayField,item:this.getCurrentValue(),onValueChange:this.handleWeekDayChange})),"monthly"===value.intervalType&&(monthDaySelection=_react2.default.createElement(_select2.default,{field:monthDayField,item:this.getCurrentValue(),onValueChange:this.handleMonthDayChange})),"nthWeekDay"===value.intervalType&&(nthWeekDaySelection=_react2.default.createElement(_select2.default,{field:nthWeekDayField,item:this.getCurrentValue(),onValueChange:this.handleNthWeekDayChange})),_react2.default.createElement("div",null,_react2.default.createElement(_select2.default,{field:intervalField,item:this.getCurrentValue(),onValueChange:this.handleIntervalChange,automationId:"newsletter_interval_type"}),nthWeekDaySelection,monthDaySelection,weekDaySelection,timeOfDaySelection)}}]),NotificationScheduling}(_react2.default.Component);NotificationScheduling.propTypes={item:_propTypes2.default.object.isRequired,field:_propTypes2.default.shape({name:_propTypes2.default.string}).isRequired,onValueChange:_propTypes2.default.func.isRequired},module.exports=NotificationScheduling},295:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),KeyValueTable=function(props){return _react2.default.createElement("table",{className:"widefat fixed",style:{maxWidth:props.max_width}},_react2.default.createElement("tbody",null,props.rows.map(function(row){return _react2.default.createElement("tr",{key:"row_"+row.key},_react2.default.createElement("td",{className:"row-title"},row.key),_react2.default.createElement("td",null,row.value))})))};KeyValueTable.propTypes={max_width:_propTypes2.default.string,rows:_propTypes2.default.arrayOf(_propTypes2.default.shape({key:_propTypes2.default.string.isRequired,value:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number,_propTypes2.default.element]).isRequired})).isRequired},KeyValueTable.defaultProps={max_width:"auto"},module.exports=KeyValueTable},296:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),TasksListDataRow=function(props){return _react2.default.createElement("tr",null,_react2.default.createElement("td",{className:"column column-primary"},props.task.id),_react2.default.createElement("td",{className:"column"},props.task.type),_react2.default.createElement("td",{className:"column"},props.task.newsletter?_react2.default.createElement("a",{href:props.task.newsletter.preview_url,"data-newsletter-id":props.task.newsletter.newsletter_id,"data-queue-id":props.task.newsletter.queue_id,target:"_blank"},props.task.newsletter.subject||_mailpoet2.default.I18n.t("preview")):_mailpoet2.default.I18n.t("none")),_react2.default.createElement("td",{className:"column"},props.task.priority),props.show_scheduled_at?_react2.default.createElement("td",{className:"column-date"},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(1e3*props.task.scheduled_at))):null,_react2.default.createElement("td",{className:"column-date"},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(1e3*props.task.updated_at))))};TasksListDataRow.propTypes={show_scheduled_at:_propTypes2.default.bool,task:_propTypes2.default.shape({id:_propTypes2.default.number.isRequired,type:_propTypes2.default.string.isRequired,priority:_propTypes2.default.number.isRequired,updated_at:_propTypes2.default.number.isRequired,scheduled_at:_propTypes2.default.number,status:_propTypes2.default.string,newsletter:_propTypes2.default.shape({newsletter_id:_propTypes2.default.number.isRequired,queue_id:_propTypes2.default.number.isRequired,preview_url:_propTypes2.default.string.isRequired,subject:_propTypes2.default.string})}).isRequired},TasksListDataRow.defaultProps={show_scheduled_at:!1,task:{newsletter:null}},module.exports=TasksListDataRow},390:function(module,exports,__webpack_require__){"use strict";__webpack_require__(391),__webpack_require__(395),__webpack_require__(423),__webpack_require__(427),__webpack_require__(429),__webpack_require__(431),__webpack_require__(441),__webpack_require__(443),__webpack_require__(444),__webpack_require__(447),__webpack_require__(448),__webpack_require__(457),__webpack_require__(459)},391:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactRouterDom=__webpack_require__(7),_list=__webpack_require__(392),_list2=_interopRequireDefault(_list),_form=__webpack_require__(393),_form2=_interopRequireDefault(_form),container=document.getElementById("subscribers_container");container&&_reactDom2.default.render(_react2.default.createElement(_reactRouterDom.HashRouter,null,_react2.default.createElement(_reactRouterDom.Switch,null,_react2.default.createElement(_reactRouterDom.Route,{path:"/new",component:_form2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"/edit/:id",component:_form2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"*",component:_list2.default}))),container)},392:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(7),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),_selection=__webpack_require__(283),_selection2=_interopRequireDefault(_selection),columns=[{name:"email",label:_mailpoet2.default.I18n.t("subscriber"),sortable:!0},{name:"status",label:_mailpoet2.default.I18n.t("status"),sortable:!0},{name:"segments",label:_mailpoet2.default.I18n.t("lists")},{name:"created_at",label:_mailpoet2.default.I18n.t("subscribedOn"),sortable:!0},{name:"updated_at",label:_mailpoet2.default.I18n.t("lastModifiedOn"),sortable:!0}],messages={onTrash:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneSubscriberTrashed"):_mailpoet2.default.I18n.t("multipleSubscribersTrashed").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onDelete:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneSubscriberDeleted"):_mailpoet2.default.I18n.t("multipleSubscribersDeleted").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onRestore:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneSubscriberRestored"):_mailpoet2.default.I18n.t("multipleSubscribersRestored").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onNoItemsFound:function(group){return"bounced"===group&&!window.mailpoet_premium_active&&!window.mss_active&&_react2.default.createElement("div",null,_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("bouncedSubscribersHelp")),_react2.default.createElement("p",null,_react2.default.createElement("a",{href:"admin.php?page=mailpoet-premium",className:"button-primary"},_mailpoet2.default.I18n.t("bouncedSubscribersPremiumButtonText"))))}},bulkActions=[{name:"moveToList",label:_mailpoet2.default.I18n.t("moveToList"),onSelect:function(){var field={id:"move_to_segment",name:"move_to_segment",endpoint:"segments",filter:function(segment){return!(segment.deleted_at||"default"!==segment.type)}};return _react2.default.createElement(_selection2.default,{field:field})},getData:function(){return{segment_id:Number((0,_jquery2.default)("#move_to_segment").val())}},onSuccess:function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("multipleSubscribersMovedToList").replace("%$1d",Number(response.meta.count).toLocaleString()).replace("%$2s",response.meta.segment))}},{name:"addToList",label:_mailpoet2.default.I18n.t("addToList"),onSelect:function(){var field={id:"add_to_segment",name:"add_to_segment",endpoint:"segments",filter:function(segment){return!(segment.deleted_at||"default"!==segment.type)}};return _react2.default.createElement(_selection2.default,{field:field})},getData:function(){return{segment_id:Number((0,_jquery2.default)("#add_to_segment").val())}},onSuccess:function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("multipleSubscribersAddedToList").replace("%$1d",Number(response.meta.count).toLocaleString()).replace("%$2s",response.meta.segment))}},{name:"removeFromList",label:_mailpoet2.default.I18n.t("removeFromList"),onSelect:function(){var field={id:"remove_from_segment",name:"remove_from_segment",endpoint:"segments",filter:function(segment){return!("default"!==segment.type)}};return _react2.default.createElement(_selection2.default,{field:field})},getData:function(){return{segment_id:Number((0,_jquery2.default)("#remove_from_segment").val())}},onSuccess:function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("multipleSubscribersRemovedFromList").replace("%$1d",Number(response.meta.count).toLocaleString()).replace("%$2s",response.meta.segment))}},{name:"removeFromAllLists",label:_mailpoet2.default.I18n.t("removeFromAllLists"),onSuccess:function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("multipleSubscribersRemovedFromAllLists").replace("%$1d",Number(response.meta.count).toLocaleString()))}},{name:"sendConfirmationEmail",label:_mailpoet2.default.I18n.t("resendConfirmationEmail"),onSuccess:function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("multipleConfirmationEmailsSent").replace("%$1d",Number(response.meta.count).toLocaleString()))}},{name:"trash",label:_mailpoet2.default.I18n.t("moveToTrash"),onSuccess:messages.onTrash}],itemActions=[{name:"edit",label:_mailpoet2.default.I18n.t("edit"),link:function(subscriber){return _react2.default.createElement(_reactRouterDom.Link,{to:"/edit/"+subscriber.id},_mailpoet2.default.I18n.t("edit"))}},{name:"trash",display:function(subscriber){return 0===Number(subscriber.wp_user_id)}}],SubscriberList=function(_React$Component){function SubscriberList(){var _ref,_temp,_this,_ret;_classCallCheck(this,SubscriberList);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=SubscriberList.__proto__||Object.getPrototypeOf(SubscriberList)).call.apply(_ref,[this].concat(args))),_this.getSegmentFromId=function(segmentId){var result=!1;return window.mailpoet_segments.forEach(function(segment){segment.id===segmentId&&(result=segment)}),result},_this.renderItem=function(subscriber,actions){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions","column-username"),status="";switch(subscriber.status){case"subscribed":status=_mailpoet2.default.I18n.t("subscribed");break;case"unconfirmed":status=_mailpoet2.default.I18n.t("unconfirmed");break;case"unsubscribed":status=_mailpoet2.default.I18n.t("unsubscribed");break;case"bounced":status=_mailpoet2.default.I18n.t("bounced");break;default:status="Invalid"}var segments=!1;if(subscriber.subscriptions.length>0){var subscribedSegments=[];subscriber.subscriptions.forEach(function(subscription){var segment=_this.getSegmentFromId(subscription.segment_id);!1!==segment&&"subscribed"===subscription.status&&subscribedSegments.push(segment.name)}),segments=_react2.default.createElement("span",null,subscribedSegments.join(", "))}return _react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,_react2.default.createElement(_reactRouterDom.Link,{className:"row-title",to:"/edit/"+subscriber.id},subscriber.email)),_react2.default.createElement("p",{style:{margin:0}},subscriber.first_name," ",subscriber.last_name),actions),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("status")},status),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("lists")},segments),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("subscribedOn")},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(subscriber.created_at))),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("lastModifiedOn")},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(subscriber.updated_at))))},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(SubscriberList,_React$Component),_createClass(SubscriberList,[{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",{className:"title"},_mailpoet2.default.I18n.t("pageTitle")," ",_react2.default.createElement(_reactRouterDom.Link,{className:"page-title-action",to:"/new"},_mailpoet2.default.I18n.t("new")),_react2.default.createElement("a",{className:"page-title-action",href:"?page=mailpoet-import#step1"},_mailpoet2.default.I18n.t("import")),_react2.default.createElement("a",{id:"mailpoet_export_button",className:"page-title-action",href:"?page=mailpoet-export"},_mailpoet2.default.I18n.t("export"))),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"subscribers",onRenderItem:this.renderItem,columns:columns,bulk_actions:bulkActions,item_actions:itemActions,messages:messages,sort_by:"created_at",sort_order:"desc"}))}}]),SubscriberList}(_react2.default.Component);SubscriberList.propTypes={location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},module.exports=SubscriberList},393:function(module,exports,__webpack_require__){"use strict";(function(global){global.MailPoetLib||(global.MailPoetLib={}),module.exports=global.MailPoetLib.Form=__webpack_require__(394)}).call(exports,__webpack_require__(6))},394:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}function beforeFormContent(subscriber){if(Number(subscriber.wp_user_id)>0)return _react2.default.createElement("p",{className:"description"},(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("WPUserEditNotice"),/\[link\](.*?)\[\/link\]/g,function(match,i){return _react2.default.createElement("a",{key:i,href:"user-edit.php?user_id="+subscriber.wp_user_id},match)}))}function afterFormContent(){return _react2.default.createElement("p",{className:"description"},_react2.default.createElement("strong",null,_mailpoet2.default.I18n.t("tip"))," ",_mailpoet2.default.I18n.t("customFieldsTip"))}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(7),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_form=__webpack_require__(187),_form2=_interopRequireDefault(_form),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),fields=[{name:"email",label:_mailpoet2.default.I18n.t("email"),type:"text",disabled:function(subscriber){return Number(subscriber.wp_user_id>0)}},{name:"first_name",label:_mailpoet2.default.I18n.t("firstname"),type:"text",disabled:function(subscriber){return Number(subscriber.wp_user_id>0)}},{name:"last_name",label:_mailpoet2.default.I18n.t("lastname"),type:"text",disabled:function(subscriber){return Number(subscriber.wp_user_id>0)}},{name:"status",label:_mailpoet2.default.I18n.t("status"),type:"select",values:{subscribed:_mailpoet2.default.I18n.t("subscribed"),unconfirmed:_mailpoet2.default.I18n.t("unconfirmed"),unsubscribed:_mailpoet2.default.I18n.t("unsubscribed"),bounced:_mailpoet2.default.I18n.t("bounced")},filter:function(subscriber,value){return!(Number(subscriber.wp_user_id)>0&&"unconfirmed"===value)}},{name:"segments",label:_mailpoet2.default.I18n.t("lists"),type:"selection",placeholder:_mailpoet2.default.I18n.t("selectList"),tip:_mailpoet2.default.I18n.t("welcomeEmailTip"),api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,selected:function(subscriber){return!1===Array.isArray(subscriber.subscriptions)?null:subscriber.subscriptions.filter(function(subscription){return"subscribed"===subscription.status}).map(function(subscription){return subscription.segment_id})},filter:function(segment){return!segment.deleted_at&&"default"===segment.type},getLabel:function(segment){return segment.name+" ("+segment.subscribers+")"},getSearchLabel:function(segment,subscriber){var label="";return void 0!==subscriber.subscriptions&&subscriber.subscriptions.forEach(function(subscription){if(segment.id===subscription.segment_id&&(label=segment.name,"unsubscribed"===subscription.status)){var unsubscribedAt=_mailpoet2.default.Date.format(subscription.updated_at);label+=" (%$1s)".replace("%$1s",_mailpoet2.default.I18n.t("unsubscribedOn").replace("%$1s",unsubscribedAt))}}),label}}];(window.mailpoet_custom_fields||[]).forEach(function(customField){var field={name:"cf_"+customField.id,label:customField.name,type:customField.type};switch(customField.params&&(field.params=customField.params),customField.params.values&&(field.values=customField.params.values),customField.type){case"date":field.year_placeholder=_mailpoet2.default.I18n.t("year"),field.month_placeholder=_mailpoet2.default.I18n.t("month"),field.day_placeholder=_mailpoet2.default.I18n.t("day");break;case"select":field.placeholder="-";break;default:field.placeholder=""}fields.push(field)});var messages={onUpdate:function(){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("subscriberUpdated"))},onCreate:function(){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("subscriberAdded")),_mailpoet2.default.trackEvent("Subscribers > Add new",{"MailPoet Free version":window.mailpoet_version})}},SubscriberForm=function(_React$Component){function SubscriberForm(){return _classCallCheck(this,SubscriberForm),_possibleConstructorReturn(this,(SubscriberForm.__proto__||Object.getPrototypeOf(SubscriberForm)).apply(this,arguments))}return _inherits(SubscriberForm,_React$Component),_createClass(SubscriberForm,[{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",{className:"title"},_mailpoet2.default.I18n.t("subscriber"),_react2.default.createElement(_reactRouterDom.Link,{className:"page-title-action",to:"/"},_mailpoet2.default.I18n.t("backToList"))),_react2.default.createElement(_form2.default,{endpoint:"subscribers",fields:fields,params:this.props.match.params,messages:messages,beforeFormContent:beforeFormContent,afterFormContent:afterFormContent}))}}]),SubscriberForm}(_react2.default.Component);SubscriberForm.propTypes={match:_propTypes2.default.shape({params:_propTypes2.default.shape({id:_propTypes2.default.string}).isRequired}).isRequired},module.exports=SubscriberForm},395:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactRouterDom=__webpack_require__(7),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_types=__webpack_require__(396),_types2=_interopRequireDefault(_types),_templates=__webpack_require__(397),_templates2=_interopRequireDefault(_templates),_send=__webpack_require__(402),_send2=_interopRequireDefault(_send),_congratulate=__webpack_require__(411),_congratulate2=_interopRequireDefault(_congratulate),_standard=__webpack_require__(416),_standard2=_interopRequireDefault(_standard),_notification=__webpack_require__(417),_notification2=_interopRequireDefault(_notification),_welcome=__webpack_require__(418),_welcome2=_interopRequireDefault(_welcome),_events_list=__webpack_require__(290),_events_list2=_interopRequireDefault(_events_list),_standard3=__webpack_require__(419),_standard4=_interopRequireDefault(_standard3),_welcome3=__webpack_require__(420),_welcome4=_interopRequireDefault(_welcome3),_notification3=__webpack_require__(421),_notification4=_interopRequireDefault(_notification3),_notification_history=__webpack_require__(422),_notification_history2=_interopRequireDefault(_notification_history);((function(_React$Component){function App(){return _classCallCheck(this,App),_possibleConstructorReturn(this,(App.__proto__||Object.getPrototypeOf(App)).apply(this,arguments))}return _inherits(App,_React$Component),_createClass(App,[{key:"render",value:function(){return this.props.children}}]),App})(_react2.default.Component)).propTypes={children:_propTypes2.default.element.isRequired};var container=document.getElementById("newsletters_container");if(container){var routes=[{path:"/standard/(.*)?",component:_standard4.default},{path:"/welcome/(.*)?",component:_welcome4.default},{path:"/notification/history/:parent_id/(.*)?",component:_notification_history2.default},{path:"/notification/(.*)?",component:_notification4.default},{path:"/new/standard",component:_standard2.default},{path:"/new/notification",component:_notification2.default},{path:"/new/welcome",component:_welcome2.default},{path:"/new",component:_types2.default},{name:"template",path:"/template/:id",component:_templates2.default},{path:"/send/congratulate/:id",component:_congratulate2.default},{path:"/send/:id",component:_send2.default}];routes=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_before_router",[].concat(_toConsumableArray(routes),_toConsumableArray(function(){return window.mailpoet_automatic_emails?_underscore2.default.map(window.mailpoet_automatic_emails,function(automaticEmail){return{path:"new/"+automaticEmail.slug,name:automaticEmail.slug,component:_events_list2.default,data:{email:automaticEmail}}}):null}()))),window.mailpoet_listing=_reactDom2.default.render(_react2.default.createElement(_reactRouterDom.HashRouter,null,_react2.default.createElement(_reactRouterDom.Switch,null,_react2.default.createElement(_reactRouterDom.Route,{exact:!0,path:"/",render:function(){return _react2.default.createElement(_reactRouterDom.Redirect,{to:"/standard"})}}),routes.map(function(route){return _react2.default.createElement(_reactRouterDom.Route,{key:route.path,path:route.path,component:route.component,name:route.name||null,data:route.data||null,render:route.render})}))),container)}},396:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_reactRouterDom=__webpack_require__(7),NewsletterTypes=function(_React$Component){function NewsletterTypes(){var _ref,_temp,_this,_ret;_classCallCheck(this,NewsletterTypes);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=NewsletterTypes.__proto__||Object.getPrototypeOf(NewsletterTypes)).call.apply(_ref,[this].concat(args))),_this.setupNewsletter=function(type){void 0!==type&&(_this.props.history.push("/new/"+type),_mailpoet2.default.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":type}))},_this.getAutomaticEmails=function(){return window.mailpoet_automatic_emails?_underscore2.default.map(window.mailpoet_automatic_emails,function(automaticEmail){var email=automaticEmail,onClick=_underscore2.default.partial(_this.setupNewsletter,automaticEmail.slug);return email.action=function(){return _react2.default.createElement("div",null,_react2.default.createElement("a",{className:"button button-primary",onClick:onClick,role:"button",tabIndex:0},_mailpoet2.default.I18n.t("setUp")))}(),email}):[]},_this.createNewsletter=function(type){_mailpoet2.default.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":type}),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:type,subject:_mailpoet2.default.I18n.t("draftNewsletterTitle")}}).done(function(response){_this.props.history.push("/template/"+response.data.id)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(NewsletterTypes,_React$Component),_createClass(NewsletterTypes,[{key:"render",value:function(){var createStandardNewsletter=_underscore2.default.partial(this.createNewsletter,"standard"),createNotificationNewsletter=_underscore2.default.partial(this.setupNewsletter,"notification"),createWelcomeNewsletter=_underscore2.default.partial(this.setupNewsletter,"welcome"),defaultTypes=[{slug:"standard",title:_mailpoet2.default.I18n.t("regularNewsletterTypeTitle"),description:_mailpoet2.default.I18n.t("regularNewsletterTypeDescription"),action:function(){return _react2.default.createElement("a",{className:"button button-primary","data-automation-id":"create_standard",onClick:createStandardNewsletter,role:"button",tabIndex:0},_mailpoet2.default.I18n.t("create"))}()},{slug:"welcome",title:_mailpoet2.default.I18n.t("welcomeNewsletterTypeTitle"),description:_mailpoet2.default.I18n.t("welcomeNewsletterTypeDescription"),videoGuide:"https://beta.docs.mailpoet.com/article/254-video-guide-to-welcome-emails",action:function(){return _react2.default.createElement("a",{className:"button button-primary",onClick:createWelcomeNewsletter,"data-automation-id":"create_welcome",onKeyDown:function(event){["keydown","keypress"].includes(event.type)&&["Enter"," "].includes(event.key)&&(event.preventDefault(),createWelcomeNewsletter())},role:"button",tabIndex:0},_mailpoet2.default.I18n.t("setUp"))}()},{slug:"notification",title:_mailpoet2.default.I18n.t("postNotificationNewsletterTypeTitle"),description:_mailpoet2.default.I18n.t("postNotificationNewsletterTypeDescription"),videoGuide:"https://beta.docs.mailpoet.com/article/210-video-guide-to-post-notifications",action:function(){return _react2.default.createElement("a",{className:"button button-primary","data-automation-id":"create_notification",onClick:createNotificationNewsletter,role:"button",tabIndex:0},_mailpoet2.default.I18n.t("setUp"))}()}],types=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_types",[].concat(defaultTypes,_toConsumableArray(this.getAutomaticEmails())),this),badgeClassName=!0===window.mailpoet_is_new_user?"mailpoet_badge mailpoet_badge_video":"mailpoet_badge mailpoet_badge_video mailpoet_badge_video_grey";return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("pickCampaignType")),_react2.default.createElement(_breadcrumb2.default,{step:"type"}),_react2.default.createElement("ul",{className:"mailpoet_boxes clearfix"},types.map(function(type){return _react2.default.createElement("li",{key:type.slug,"data-type":type.slug,className:"mailpoet_newsletter_types"},_react2.default.createElement("div",null,_react2.default.createElement("div",{className:"mailpoet_thumbnail"},type.thumbnailImage?_react2.default.createElement("img",{src:type.thumbnailImage,alt:""}):null),_react2.default.createElement("div",{className:"mailpoet_description"},_react2.default.createElement("h3",null,type.title," ",type.beta?"("+_mailpoet2.default.I18n.t("beta")+")":""),_react2.default.createElement("p",null,type.description),type.videoGuide&&_react2.default.createElement("a",{className:badgeClassName,href:type.videoGuide,target:"_blank"},_react2.default.createElement("span",{className:"dashicons dashicons-format-video"}),_mailpoet2.default.I18n.t("seeVideoGuide"))),_react2.default.createElement("div",{className:"mailpoet_actions"},type.action)))},this)))}}]),NewsletterTypes}(_react2.default.Component);NewsletterTypes.propTypes={history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},module.exports=(0,_reactRouterDom.withRouter)(NewsletterTypes)},397:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_loading=__webpack_require__(398),_loading2=_interopRequireDefault(_loading),_tabs=__webpack_require__(399),_tabs2=_interopRequireDefault(_tabs),_template_box=__webpack_require__(400),_template_box2=_interopRequireDefault(_template_box),_import_template=__webpack_require__(401),_import_template2=_interopRequireDefault(_import_template),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),getEditorUrl=function(id){return"admin.php?page=mailpoet-newsletter-editor&id="+id},templatesCategories=[{name:"standard",label:_mailpoet2.default.I18n.t("tabStandardTitle")},{name:"welcome",label:_mailpoet2.default.I18n.t("tabWelcomeTitle")},{name:"notification",label:_mailpoet2.default.I18n.t("tabNotificationTitle")}];window.mailpoet_woocommerce_active&&templatesCategories.push({name:"woocommerce",label:_mailpoet2.default.I18n.t("tabWoocommerceTitle")}),templatesCategories.push.apply(templatesCategories,[{name:"all",label:_mailpoet2.default.I18n.t("allTemplates")},{name:"recent",label:_mailpoet2.default.I18n.t("recentlySent")},{name:"saved",label:_mailpoet2.default.I18n.t("savedTemplates")}]);var NewsletterTemplates=function(_React$Component){function NewsletterTemplates(props){_classCallCheck(this,NewsletterTemplates);var _this=_possibleConstructorReturn(this,(NewsletterTemplates.__proto__||Object.getPrototypeOf(NewsletterTemplates)).call(this,props));return _this.state={loading:!0,templates:{},emailType:null,selectedTab:""},_this.templates={},_this.addTemplate=_this.addTemplate.bind(_this),_this.afterTemplateDelete=_this.afterTemplateDelete.bind(_this),_this.afterTemplateSelect=_this.afterTemplateSelect.bind(_this),_this.afterTemplateImport=_this.afterTemplateImport.bind(_this),_this}return _inherits(NewsletterTemplates,_React$Component),_createClass(NewsletterTemplates,[{key:"componentWillMount",value:function(){var _this2=this;_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"getAll"}).done(function(response){0===response.data.length&&(response.data=[{name:_mailpoet2.default.I18n.t("mailpoetGuideTemplateTitle"),categories:'["welcome", "notification", "standard", "woocommerce"]',readonly:"1"}]),response.data.forEach(_this2.addTemplate),_this2.sortTemplates()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})}).always(function(){_this2.selectInitialTab()})}},{key:"addTemplate",value:function(template){var _this3=this,categoriesNames=templatesCategories.map(function(category){return category.name}),categories=void 0;try{categories=JSON.parse(template.categories).filter(function(name){return-1!==categoriesNames.indexOf(name)})}catch(err){categories=[]}0===categories.length&&categories.push("saved"),categories.forEach(function(category){void 0===_this3.templates[category]&&(_this3.templates[category]=[]),_this3.templates[category].unshift(template)})}},{key:"sortTemplates",value:function(){var _this4=this;Object.keys(this.templates).forEach(function(category){_this4.templates[category].sort(function(a,b){return parseInt(a.id,10)<parseInt(b.id,10)?1:-1})})}},{key:"selectInitialTab",value:function(){var _this5=this,emailType=void 0,selectedTab="standard";_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:this.props.match.params.id}}).done(function(response){emailType=response.data.type,_underscore2.default.findWhere(templatesCategories,{name:response.data.type})&&(selectedTab=response.data.type)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})}).always(function(){_this5.setState({templates:_this5.templates,emailType:emailType,selectedTab:selectedTab,loading:!1})})}},{key:"afterTemplateDelete",value:function(success,id){var _this6=this;success&&Object.keys(this.templates).forEach(function(category){_this6.templates[category]=_this6.templates[category].filter(function(template){return template.id!==id})}),this.setState({templates:this.templates,loading:!1})}},{key:"afterTemplateSelect",value:function(success,id){success?window.location=getEditorUrl(id):this.setState({loading:!1})}},{key:"afterTemplateImport",value:function(success,template){success&&this.addTemplate(template),this.setState({templates:this.templates,selectedTab:success?"saved":"import",loading:!1})}},{key:"render",value:function(){var _this7=this;if(this.state.loading)return _react2.default.createElement(_loading2.default,null);var tabs=templatesCategories.concat({name:"import",label:_mailpoet2.default.I18n.t("tabImportTitle")}),selectedTab=this.state.selectedTab,content=null;if("import"===selectedTab)content=_react2.default.createElement(_import_template2.default,{beforeImport:function(){return _this7.setState({loading:!0})},afterImport:this.afterTemplateImport});else{var templates=this.state.templates[this.state.selectedTab]||[];templates=0===templates.length?this.state.loading?null:_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("noTemplates")):templates.map(function(template,index){return _react2.default.createElement(_template_box2.default,_extends({key:template.id,index:index,newsletterId:_this7.props.match.params.id,beforeDelete:function(){return _this7.setState({loading:!0})},afterDelete:_this7.afterTemplateDelete,beforeSelect:function(){return _this7.setState({loading:!0})},afterSelect:_this7.afterTemplateSelect},template))}),content=_react2.default.createElement("ul",{className:"mailpoet_boxes clearfix"},templates)}var breadcrumb=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_template_breadcrumb",_react2.default.createElement(_breadcrumb2.default,{step:"template"}),this.state.emailType,"template");return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("selectTemplateTitle")),breadcrumb,_react2.default.createElement(_tabs2.default,{tabs:tabs,selected:this.state.selectedTab,select:function(name){return _this7.setState({selectedTab:name})}}),content)}}]),NewsletterTemplates}(_react2.default.Component);NewsletterTemplates.propTypes={match:_propTypes2.default.shape({params:_propTypes2.default.shape({id:_propTypes2.default.string}).isRequired}).isRequired},exports.default=NewsletterTemplates},398:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),Loading=function(_React$Component){function Loading(){return _classCallCheck(this,Loading),_possibleConstructorReturn(this,(Loading.__proto__||Object.getPrototypeOf(Loading)).apply(this,arguments))}return _inherits(Loading,_React$Component),_createClass(Loading,[{key:"componentWillMount",value:function(){_mailpoet2.default.Modal.loading(!0)}},{key:"componentWillUnmount",value:function(){_mailpoet2.default.Modal.loading(!1)}},{key:"render",value:function(){return null}}]),Loading}(_react2.default.Component);exports.default=Loading},399:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_reactTooltip=__webpack_require__(158),_reactTooltip2=_interopRequireDefault(_reactTooltip),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),tooltipText=(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("tooltipTemplateTabs"),/\[link\](.*?)\[\/link\]/g,function(match){return _react2.default.createElement("a",{href:"https://mailpoet.polldaddy.com/s/select-template-feedback",key:"feedback",target:"_blank",rel:"noopener noreferrer"},match)}),Tabs=function(_ref){var tabs=_ref.tabs,selected=_ref.selected,select=_ref.select;return _react2.default.createElement("div",{className:"wp-filter hide-if-no-js"},_react2.default.createElement("ul",{className:"filter-links"},tabs.map(function(_ref2){var name=_ref2.name,label=_ref2.label;return _react2.default.createElement("li",{key:name},_react2.default.createElement("a",{href:"javascript:",className:selected===name?"current":"",onClick:function(){return select(name)}}," ",label))})),_react2.default.createElement("span",{className:"feedback-tooltip newsletter-templates-feedback","data-event":"click","data-tip":!0,"data-for":"feedback-newsletter-templates-tabs"},_mailpoet2.default.I18n.t("feedback")),_react2.default.createElement(_reactTooltip2.default,{globalEventOff:"click",multiline:!0,id:"feedback-newsletter-templates-tabs",efect:"solid",place:"bottom"},_react2.default.createElement("span",{style:{pointerEvents:"all",display:"inline-block"}},tooltipText)))};Tabs.propTypes={selected:_propTypes2.default.string.isRequired,select:_propTypes2.default.func.isRequired,tabs:_propTypes2.default.arrayOf(_propTypes2.default.shape({label:_propTypes2.default.string.isRequired,name:_propTypes2.default.string.isRequired}).isRequired).isRequired},exports.default=Tabs},400:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_confirm_alert=__webpack_require__(292),_confirm_alert2=_interopRequireDefault(_confirm_alert),TemplateBox=function(_React$Component){function TemplateBox(props){_classCallCheck(this,TemplateBox);var _this=_possibleConstructorReturn(this,(TemplateBox.__proto__||Object.getPrototypeOf(TemplateBox)).call(this,props));return _this.onPreview=_this.onPreview.bind(_this),_this.onDelete=_this.onDelete.bind(_this),_this.onSelect=_this.onSelect.bind(_this),_this}return _inherits(TemplateBox,_React$Component),_createClass(TemplateBox,[{key:"onDelete",value:function(){var _props=this.props,id=_props.id,name=_props.name,beforeDelete=_props.beforeDelete,afterDelete=_props.afterDelete,onConfirm=function(){beforeDelete(),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"delete",data:{id:id}}).done(function(){afterDelete(!0,id)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0}),afterDelete(!1)})};(0,_confirm_alert2.default)({message:_mailpoet2.default.I18n.t("confirmTemplateDeletion").replace("%$1s",name),onConfirm:onConfirm})}},{key:"onPreview",value:function(){_mailpoet2.default.Modal.popup({title:this.props.name,template:'<div class="mailpoet_boxes_preview" style="background-color: {{ body.globalStyles.body.backgroundColor }}"><img src="{{ thumbnail }}" /></div>',data:this.props})}},{key:"onSelect",value:function(){var _props2=this.props,newsletterId=_props2.newsletterId,name=_props2.name,beforeSelect=_props2.beforeSelect,afterSelect=_props2.afterSelect;beforeSelect(),_mailpoet2.default.trackEvent("Emails > Template selected",{"MailPoet Free version":window.mailpoet_version,"Email name":name}),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"save",data:{id:newsletterId,template_id:this.props.id}}).done(function(response){afterSelect(!0,response.data.id)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0}),afterSelect(!1)})}},{key:"render",value:function(){var _props3=this.props,index=_props3.index,name=_props3.name,thumbnail=_props3.thumbnail,readonly=_props3.readonly,deleteLink=_react2.default.createElement("div",{className:"mailpoet_delete button button-secondary"},_react2.default.createElement("a",{href:"javascript:;",onClick:this.onDelete},_mailpoet2.default.I18n.t("delete"))),preview="";return"string"==typeof thumbnail&&thumbnail.length>0&&(preview=_react2.default.createElement("a",{href:"javascript:;",onClick:this.onPreview},_react2.default.createElement("img",{src:thumbnail,alt:_mailpoet2.default.I18n.t("templatePreview")}),_react2.default.createElement("div",{className:"mailpoet_overlay"},_react2.default.createElement("p",{className:"mailpoet_more_details"},_mailpoet2.default.I18n.t("zoom"))))),_react2.default.createElement("li",{className:"mailpoet_template_boxes","data-automation-id":"select_template_box"},_react2.default.createElement("div",{className:"mailpoet_thumbnail"},preview),_react2.default.createElement("div",{className:"mailpoet_description"},_react2.default.createElement("h3",null,name)),_react2.default.createElement("div",{className:"mailpoet_actions"},"1"!==readonly&&deleteLink,_react2.default.createElement("a",{className:"button button-primary","data-automation-id":"select_template_"+index,onClick:this.onSelect,role:"button",tabIndex:0}," ",_mailpoet2.default.I18n.t("select")," ")))}}]),TemplateBox}(_react2.default.Component);TemplateBox.propTypes={index:_propTypes2.default.number.isRequired,id:_propTypes2.default.string.isRequired,newsletterId:_propTypes2.default.string.isRequired,name:_propTypes2.default.string.isRequired,thumbnail:_propTypes2.default.string.isRequired,readonly:_propTypes2.default.string.isRequired,beforeDelete:_propTypes2.default.func.isRequired,afterDelete:_propTypes2.default.func.isRequired,beforeSelect:_propTypes2.default.func.isRequired,afterSelect:_propTypes2.default.func.isRequired},exports.default=TemplateBox},401:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_helpTooltip=__webpack_require__(157),_helpTooltip2=_interopRequireDefault(_helpTooltip),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),ImportTemplate=function(_React$Component){function ImportTemplate(props){_classCallCheck(this,ImportTemplate);var _this=_possibleConstructorReturn(this,(ImportTemplate.__proto__||Object.getPrototypeOf(ImportTemplate)).call(this,props));return _this.fileRef=_react2.default.createRef(),_this.handleSubmit=_this.handleSubmit.bind(_this),_this}return _inherits(ImportTemplate,_React$Component),_createClass(ImportTemplate,[{key:"saveTemplate",value:function(_saveTemplate){var template=_saveTemplate,_props=this.props,beforeImport=_props.beforeImport,afterImport=_props.afterImport;_underscore2.default.isUndefined(template.body)||(template.body=JSON.stringify(template.body));try{template.categories=JSON.parse(template.categories)}catch(err){template.categories=[]}-1===template.categories.indexOf("saved")&&template.categories.push("saved"),-1===template.categories.indexOf("standard")&&-1===template.categories.indexOf("welcome")&&-1===template.categories.indexOf("notification")&&template.categories.push("standard"),template.categories=JSON.stringify(template.categories),beforeImport(),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"save",data:template}).done(function(response){afterImport(!0,response.data)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0}),afterImport(!1)})}},{key:"handleSubmit",value:function(e){var _this2=this;if(e.preventDefault(),_underscore2.default.size(this.fileRef.current.files)<=0)return!1;var file=_underscore2.default.first(this.fileRef.current.files),reader=new FileReader;return reader.onload=function(evt){try{_this2.saveTemplate(JSON.parse(evt.target.result)),_mailpoet2.default.trackEvent("Emails > Template imported",{"MailPoet Free version":window.mailpoet_version})}catch(err){_mailpoet2.default.Notice.error(_mailpoet2.default.I18n.t("templateFileMalformedError"))}},reader.readAsText(file),!0}},{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h2",null,_mailpoet2.default.I18n.t("importTemplateTitle"),_react2.default.createElement(_helpTooltip2.default,{tooltip:_mailpoet2.default.I18n.t("helpTooltipTemplateUpload"),place:"right",className:"tooltip-help-import-template"})),_react2.default.createElement("form",{onSubmit:this.handleSubmit},_react2.default.createElement("input",{type:"file",placeholder:_mailpoet2.default.I18n.t("selectJsonFileToUpload"),ref:this.fileRef}),_react2.default.createElement("p",{className:"submit"},_react2.default.createElement("input",{className:"button button-primary",type:"submit",value:_mailpoet2.default.I18n.t("upload")}))))}}]),ImportTemplate}(_react2.default.Component);ImportTemplate.propTypes={beforeImport:_propTypes2.default.func.isRequired,afterImport:_propTypes2.default.func.isRequired},exports.default=ImportTemplate},402:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_createReactClass=__webpack_require__(32),_createReactClass2=_interopRequireDefault(_createReactClass),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_form=__webpack_require__(187),_form2=_interopRequireDefault(_form),_standard=__webpack_require__(403),_standard2=_interopRequireDefault(_standard),_notification=__webpack_require__(407),_notification2=_interopRequireDefault(_notification),_welcome=__webpack_require__(408),_welcome2=_interopRequireDefault(_welcome),_helpTooltip=__webpack_require__(157),_helpTooltip2=_interopRequireDefault(_helpTooltip),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_thumbnail=__webpack_require__(294),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_reactRouterDom=__webpack_require__(7),NewsletterSend=(0,_createReactClass2.default)({displayName:"NewsletterSend",propTypes:{match:_propTypes2.default.shape({params:_propTypes2.default.shape({id:_propTypes2.default.string}).isRequired}).isRequired,history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},getInitialState:function(){return{fields:[],item:{},loading:!0}},componentDidMount:function(){this.loadItem(this.props.match.params.id),(0,_jquery2.default)("#mailpoet_newsletter").parsley()},componentWillReceiveProps:function(props){this.loadItem(props.match.params.id)},getFieldsByNewsletter:function(newsletter){return this.getSubtype(newsletter).getFields(newsletter)},getSendButtonOptions:function(){return this.getSubtype(this.state.item).getSendButtonOptions(this.state.item)},getSubtype:function(newsletter){switch(newsletter.type){case"notification":return _notification2.default;case"welcome":return _welcome2.default;default:return _wpJsHooks2.default.applyFilters("mailpoet_newsletters_send_newsletter_fields",_standard2.default,newsletter)}},isValid:function(){return(0,_jquery2.default)("#mailpoet_newsletter").parsley().isValid()},loadItem:function(id){var _this=this;this.setState({loading:!0}),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:id}}).done(function(response){_this.setState({loading:!1,item:response.data,fields:_this.getFieldsByNewsletter(response.data)})}).fail(function(){_this.setState({loading:!1,item:{}},function(){_this.props.history.push("/new")})})},saveTemplate:function(response,done){var _this2=this;(0,_thumbnail.fromUrl)(response.meta.preview_url).then(function(thumbnail){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"save",data:{newsletter_id:response.data.id,name:response.data.subject,thumbnail:thumbnail,body:JSON.stringify(response.data.body),categories:'["recent"]'}}).then(done).fail(function(err){_this2.showError(err),_this2.setState({loading:!1}),_mailpoet2.default.Modal.loading(!1),done()})}).catch(function(err){_this2.showError({errors:[err]})})},handleSend:function(e){var _this3=this;return e.preventDefault(),this.isValid()?(_mailpoet2.default.Modal.loading(!0),this.saveNewsletter(e).done(function(){_this3.setState({loading:!0})}).done(function(response){switch(response.data.type){case"notification":case"welcome":return _this3.activateNewsletter(response);default:return _this3.sendNewsletter(response)}}).fail(function(err){_this3.showError(err),_this3.setState({loading:!1}),_mailpoet2.default.Modal.loading(!1)})):(0,_jquery2.default)("#mailpoet_newsletter").parsley().validate()},sendNewsletter:function(newsletter){var _this4=this;return _mailpoet2.default.Ajax.post(_wpJsHooks2.default.applyFilters("mailpoet_newsletters_send_server_request_parameters",{api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"add",data:{newsletter_id:this.state.item.id}},this.state.item)).done(function(response){_this4.saveTemplate(newsletter,function(){if(window.mailpoet_show_congratulate_after_first_newsletter)return _mailpoet2.default.Modal.loading(!1),void _this4.props.history.push("/send/congratulate/"+_this4.state.item.id);_this4.props.history.push(_wpJsHooks2.default.applyFilters("mailpoet_newsletters_send_server_request_response_redirect","/"+(_this4.state.item.type||""),_this4.state.item));var customResponse=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_send_server_request_response",_this4.state.item,response);_underscore2.default.isFunction(customResponse)?customResponse():"scheduled"===response.data.status?(_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterHasBeenScheduled")),_mailpoet2.default.trackEvent("Emails > Newsletter sent",{scheduled:!0,"MailPoet Free version":window.mailpoet_version})):(_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterBeingSent")),_mailpoet2.default.trackEvent("Emails > Newsletter sent",{scheduled:!1,"MailPoet Free version":window.mailpoet_version})),_mailpoet2.default.Modal.loading(!1)})}).fail(function(err){_this4.showError(err),_this4.setState({loading:!1}),_mailpoet2.default.Modal.loading(!1)})},activateNewsletter:function(newsletter){var _this5=this;return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:this.props.match.params.id,status:"active"}}).done(function(response){_this5.saveTemplate(newsletter,function(){if(window.mailpoet_show_congratulate_after_first_newsletter)return _mailpoet2.default.Modal.loading(!1),void _this5.props.history.push("/send/congratulate/"+_this5.state.item.id);_this5.props.history.push("/"+(_this5.state.item.type||""));var opts=_this5.state.item.options;"welcome"===response.data.type?(_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("welcomeEmailActivated")),_mailpoet2.default.trackEvent("Emails > Welcome email activated",{"MailPoet Free version":window.mailpoet_version,"List type":opts.event,Delay:opts.afterTimeNumber+" "+opts.afterTimeType})):"notification"===response.data.type&&(_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("postNotificationActivated")),_mailpoet2.default.trackEvent("Emails > Post notifications activated",{"MailPoet Free version":window.mailpoet_version,Frequency:opts.intervalType})),_mailpoet2.default.Modal.loading(!1)})}).fail(function(err){_this5.showError(err),_this5.setState({loading:!1}),_mailpoet2.default.Modal.loading(!1)})},handleResume:function(e){var _this6=this;return e.preventDefault(),this.isValid()?this.saveNewsletter(e).done(function(){_this6.setState({loading:!0})}).done(function(){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"resume",data:{newsletter_id:_this6.state.item.id}}).done(function(){_this6.props.history.push("/"+(_this6.state.item.type||"")),_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterSendingHasBeenResumed"))}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}).fail(function(err){_this6.showError(err)}).always(function(){_this6.setState({loading:!1})}):(0,_jquery2.default)("#mailpoet_newsletter").parsley().validate(),!1},handleSave:function(e){var _this7=this;e.preventDefault(),this.saveNewsletter(e).done(function(){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterUpdated"))}).done(function(){_this7.props.history.push("/"+(_this7.state.item.type||""))}).fail(function(err){_this7.showError(err)})},handleRedirectToDesign:function(e){var _this8=this;e.preventDefault();var redirectTo=e.target.href;this.saveNewsletter(e).done(function(){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterUpdated"))}).done(function(){window.location=redirectTo}).fail(function(err){_this8.showError(err)})},saveNewsletter:function(){var data=this.state.item;data.queue=void 0,this.setState({loading:!0});var IGNORED_NEWSLETTER_PROPERTIES=["preheader","body","created_at","deleted_at","hash","status","updated_at","type"],newsletterData=_underscore2.default.omit(data,IGNORED_NEWSLETTER_PROPERTIES);return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"save",data:newsletterData})},showError:function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})},handleFormChange:function(e){var item=this.state.item;return item[e.target.name]=e.target.value,this.setState({item:item}),!0},render:function(){var isPaused="sending"===this.state.item.status&&this.state.item.queue&&"paused"===this.state.item.queue.status,fields=this.state.fields.map(function(field){var newField=field;return"segments"!==field.name&&"options"!==field.name||(newField.disabled=isPaused),newField}),sendButtonOptions=this.getSendButtonOptions(),breadcrumb=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_send_breadcrumb",_react2.default.createElement(_breadcrumb2.default,{step:"send"}),this.state.item.type,"send");return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("finalNewsletterStep")),breadcrumb,_react2.default.createElement(_form2.default,{id:"mailpoet_newsletter",fields:fields,automationId:"newsletter_send_form",item:this.state.item,loading:this.state.loading,onChange:this.handleFormChange,onSubmit:this.handleSave},_react2.default.createElement("p",{className:"submit"},isPaused?_react2.default.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleResume,value:_mailpoet2.default.I18n.t("resume")}):_react2.default.createElement("input",_extends({className:"button button-primary",type:"button",onClick:this.handleSend,value:_mailpoet2.default.I18n.t("send")},sendButtonOptions))," ",_react2.default.createElement("input",{className:"button button-secondary",type:"submit",value:_mailpoet2.default.I18n.t("saveDraftAndClose")})," ",_mailpoet2.default.I18n.t("orSimply")," ",_react2.default.createElement("a",{href:"?page=mailpoet-newsletter-editor&id="+this.props.match.params.id,onClick:this.handleRedirectToDesign},_mailpoet2.default.I18n.t("goBackToDesign")),"."),!isPaused&&sendButtonOptions.disabled&&"disabled"===sendButtonOptions.disabled&&_react2.default.createElement(_helpTooltip2.default,{tooltip:_mailpoet2.default.I18n.t("helpTooltipSendEmail"),tooltipId:"helpTooltipSendEmail"})))}});module.exports=(0,_reactRouterDom.withRouter)(NewsletterSend)},403:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_date_time=__webpack_require__(404),_date_time2=_interopRequireDefault(_date_time),currentTime=window.mailpoet_current_time||"00:00",defaultDateTime=window.mailpoet_current_date+" 00:00:00",timeOfDayItems=window.mailpoet_schedule_time_of_day,dateDisplayFormat=window.mailpoet_date_display_format,dateStorageFormat=window.mailpoet_date_storage_format,StandardScheduling=function(_React$Component){function StandardScheduling(){var _ref,_temp,_this,_ret;_classCallCheck(this,StandardScheduling);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=StandardScheduling.__proto__||Object.getPrototypeOf(StandardScheduling)).call.apply(_ref,[this].concat(args))),_this.getCurrentValue=function(){var schedulingOptions={isScheduled:"0",scheduledAt:defaultDateTime};return _underscore2.default.defaults(_this.props.item[_this.props.field.name]||{},schedulingOptions)},_this.getDateValidation=function(){return{"data-parsley-required":!0,"data-parsley-required-message":_mailpoet2.default.I18n.t("noScheduledDateError"),"data-parsley-errors-container":"#mailpoet_scheduling"}},_this.isScheduled=function(){return"1"===_this.getCurrentValue().isScheduled},_this.handleCheckboxChange=function(event){var changeEvent=event;return changeEvent.target.value=event.target.checked?"1":"0",_this.handleValueChange(changeEvent)},_this.handleValueChange=function(event){var oldValue=_this.getCurrentValue(),newValue={};return newValue[event.target.name]=event.target.value,_this.props.onValueChange({target:{name:_this.props.field.name,value:_underscore2.default.extend({},oldValue,newValue)}})},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(StandardScheduling,_React$Component),_createClass(StandardScheduling,[{key:"render",value:function(){var schedulingOptions=void 0;return this.isScheduled()&&(schedulingOptions=_react2.default.createElement("span",{id:"mailpoet_scheduling"},_react2.default.createElement(_date_time2.default,{name:"scheduledAt",value:this.getCurrentValue().scheduledAt,onChange:this.handleValueChange,disabled:this.props.field.disabled,dateValidation:this.getDateValidation(),defaultDateTime:defaultDateTime,timeOfDayItems:timeOfDayItems,dateDisplayFormat:dateDisplayFormat,dateStorageFormat:dateStorageFormat})," ",_react2.default.createElement("span",null,_mailpoet2.default.I18n.t("websiteTimeIs")," ",_react2.default.createElement("code",null,currentTime)))),_react2.default.createElement("div",null,_react2.default.createElement("input",{type:"checkbox",value:"1",checked:this.isScheduled(),disabled:this.props.field.disabled,name:"isScheduled",onChange:this.handleCheckboxChange}),schedulingOptions)}}]),StandardScheduling}(_react2.default.Component);StandardScheduling.propTypes={item:_propTypes2.default.object,field:_propTypes2.default.shape({name:_propTypes2.default.string.isRequired,disabled:_propTypes2.default.bool}).isRequired,onValueChange:_propTypes2.default.func.isRequired},StandardScheduling.defaultProps={item:{}};var fields=[{name:"subject",label:_mailpoet2.default.I18n.t("subjectLine"),tip:_mailpoet2.default.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":_mailpoet2.default.I18n.t("emptySubjectLineError")}},{name:"segments",label:_mailpoet2.default.I18n.t("segments"),tip:_mailpoet2.default.I18n.t("segmentsTip"),type:"selection",placeholder:_mailpoet2.default.I18n.t("selectSegmentPlaceholder"),id:"mailpoet_segments",api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,filter:function(segment){return!segment.deleted_at},getLabel:function(segment){return segment.name+" ("+parseInt(segment.subscribers,10).toLocaleString()+")"},transformChangedValue:function(segmentIds){var allSegments=this.getItems();return _underscore2.default.map(segmentIds,function(id){return _underscore2.default.find(allSegments,function(segment){return segment.id===id})})},validation:{"data-parsley-required":!0,"data-parsley-required-message":_mailpoet2.default.I18n.t("noSegmentsSelectedError")}},{name:"sender",label:_mailpoet2.default.I18n.t("sender"),tip:_mailpoet2.default.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:_mailpoet2.default.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"text",placeholder:_mailpoet2.default.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:_mailpoet2.default.I18n.t("replyTo"),tip:_mailpoet2.default.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:_mailpoet2.default.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:_mailpoet2.default.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},{name:"options",label:_mailpoet2.default.I18n.t("scheduleIt"),type:"reactComponent",component:StandardScheduling}];fields=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_3rd_step_fields",fields),module.exports={getFields:function(){return fields},getSendButtonOptions:function(newsletter){var newsletterOptions=newsletter||{},isScheduled="object"===_typeof(newsletterOptions.options)&&"1"===newsletterOptions.options.isScheduled,options={value:isScheduled?_mailpoet2.default.I18n.t("schedule"):_mailpoet2.default.I18n.t("send")};return"sent"!==newsletterOptions.status&&"sending"!==newsletterOptions.status||(options.disabled="disabled"),options}}},404:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_date_text=__webpack_require__(405),_date_text2=_interopRequireDefault(_date_text),_time_select=__webpack_require__(406),_time_select2=_interopRequireDefault(_time_select),DateTime=function(_React$Component){function DateTime(props){_classCallCheck(this,DateTime);var _this=_possibleConstructorReturn(this,(DateTime.__proto__||Object.getPrototypeOf(DateTime)).call(this,props));return _initialiseProps.call(_this),_this.state=_this.buildStateFromProps(props),_this}return _inherits(DateTime,_React$Component),_createClass(DateTime,[{key:"componentWillReceiveProps",value:function(nextProps){this.setState(this.buildStateFromProps(nextProps))}},{key:"render",value:function(){return _react2.default.createElement("span",null,_react2.default.createElement(_date_text2.default,{name:"date",value:this.state.date,onChange:this.handleChange,displayFormat:this.props.dateDisplayFormat,storageFormat:this.props.dateStorageFormat,disabled:this.props.disabled,validation:this.props.dateValidation}),_react2.default.createElement(_time_select2.default,{name:"time",value:this.state.time,onChange:this.handleChange,disabled:this.props.disabled,validation:this.props.timeValidation,timeOfDayItems:this.props.timeOfDayItems}))}}]),DateTime}(_react2.default.Component),_initialiseProps=function(){var _this2=this;this.getDateTime=function(){return[_this2.state.date,_this2.state.time].join(_this2.DATE_TIME_SEPARATOR)},this.DATE_TIME_SEPARATOR=" ",this.buildStateFromProps=function(props){var value=props.value||_this2.props.defaultDateTime,_value$split=value.split(_this2.DATE_TIME_SEPARATOR),_value$split2=_slicedToArray(_value$split,2);return{date:_value$split2[0],time:_value$split2[1]}},this.handleChange=function(event){var newState={};newState[event.target.name]=event.target.value,_this2.setState(newState,_this2.propagateChange)},this.propagateChange=function(){_this2.props.onChange&&_this2.props.onChange({target:{name:_this2.props.name||"",value:_this2.getDateTime()}})}};DateTime.propTypes={defaultDateTime:_propTypes2.default.string.isRequired,dateDisplayFormat:_propTypes2.default.string.isRequired,dateStorageFormat:_propTypes2.default.string.isRequired,onChange:_propTypes2.default.func,name:_propTypes2.default.string,disabled:_propTypes2.default.bool,dateValidation:_propTypes2.default.object.isRequired,timeValidation:_propTypes2.default.any,timeOfDayItems:_propTypes2.default.objectOf(_propTypes2.default.string).isRequired},DateTime.defaultProps={onChange:void 0,name:"",disabled:!1,timeValidation:void 0},module.exports=DateTime},405:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),datepickerTranslations={closeText:_mailpoet2.default.I18n.t("close"),currentText:_mailpoet2.default.I18n.t("today"),nextText:_mailpoet2.default.I18n.t("next"),prevText:_mailpoet2.default.I18n.t("previous"),monthNames:[_mailpoet2.default.I18n.t("january"),_mailpoet2.default.I18n.t("february"),_mailpoet2.default.I18n.t("march"),_mailpoet2.default.I18n.t("april"),_mailpoet2.default.I18n.t("may"),_mailpoet2.default.I18n.t("june"),_mailpoet2.default.I18n.t("july"),_mailpoet2.default.I18n.t("august"),_mailpoet2.default.I18n.t("september"),_mailpoet2.default.I18n.t("october"),_mailpoet2.default.I18n.t("november"),_mailpoet2.default.I18n.t("december")],monthNamesShort:[_mailpoet2.default.I18n.t("januaryShort"),_mailpoet2.default.I18n.t("februaryShort"),_mailpoet2.default.I18n.t("marchShort"),_mailpoet2.default.I18n.t("aprilShort"),_mailpoet2.default.I18n.t("mayShort"),_mailpoet2.default.I18n.t("juneShort"),_mailpoet2.default.I18n.t("julyShort"),_mailpoet2.default.I18n.t("augustShort"),_mailpoet2.default.I18n.t("septemberShort"),_mailpoet2.default.I18n.t("octoberShort"),_mailpoet2.default.I18n.t("novemberShort"),_mailpoet2.default.I18n.t("decemberShort")],dayNames:[_mailpoet2.default.I18n.t("sunday"),_mailpoet2.default.I18n.t("monday"),_mailpoet2.default.I18n.t("tuesday"),_mailpoet2.default.I18n.t("wednesday"),_mailpoet2.default.I18n.t("thursday"),_mailpoet2.default.I18n.t("friday"),_mailpoet2.default.I18n.t("saturday")],dayNamesShort:[_mailpoet2.default.I18n.t("sundayShort"),_mailpoet2.default.I18n.t("mondayShort"),_mailpoet2.default.I18n.t("tuesdayShort"),_mailpoet2.default.I18n.t("wednesdayShort"),_mailpoet2.default.I18n.t("thursdayShort"),_mailpoet2.default.I18n.t("fridayShort"),_mailpoet2.default.I18n.t("saturdayShort")],dayNamesMin:[_mailpoet2.default.I18n.t("sundayMin"),_mailpoet2.default.I18n.t("mondayMin"),_mailpoet2.default.I18n.t("tuesdayMin"),_mailpoet2.default.I18n.t("wednesdayMin"),_mailpoet2.default.I18n.t("thursdayMin"),_mailpoet2.default.I18n.t("fridayMin"),_mailpoet2.default.I18n.t("saturdayMin")]},DateText=function(_React$Component){function DateText(props){_classCallCheck(this,DateText);var _this=_possibleConstructorReturn(this,(DateText.__proto__||Object.getPrototypeOf(DateText)).call(this,props));return _this.onChange=function(event){var changeEvent=event,displayDate=changeEvent.target.value,storageDate=_this.getStorageDate(displayDate);changeEvent.target.value=storageDate,_this.props.onChange(changeEvent)},_this.getFieldName=function(){return _this.props.name||"date"},_this.getDisplayDate=function(date){var formatting={parseFormat:_this.props.storageFormat,format:_this.props.displayFormat};return _mailpoet2.default.Date.format(date,formatting)},_this.getStorageDate=function(date){var formatting={parseFormat:_this.props.displayFormat,format:_this.props.storageFormat};return _mailpoet2.default.Date.format(date,formatting)},_this.dateInput=_react2.default.createRef(),_this}return _inherits(DateText,_React$Component),_createClass(DateText,[{key:"componentDidMount",value:function(){var $element=(0,_jquery2.default)(this.dateInput.current),that=this;$element.datepicker&&(_jquery2.default.datepicker.parseDate=function(format,value){return _mailpoet2.default.Date.toDate(value,{parseFormat:this.props.displayFormat,format:format})},_jquery2.default.datepicker.formatDate=function(format,value){return _mailpoet2.default.Date.format(value,{format:format})},$element.datepicker(_underscore2.default.extend({dateFormat:this.props.displayFormat,isRTL:!1,onSelect:function(value){that.onChange({target:{name:that.getFieldName(),value:value}})}},datepickerTranslations)),this.datepickerInitialized=!0)}},{key:"componentWillUnmount",value:function(){this.datepickerInitialized&&(0,_jquery2.default)(this.dateInput.current).datepicker("destroy")}},{key:"render",value:function(){return _react2.default.createElement("input",_extends({type:"text",size:"30",name:this.getFieldName(),value:this.getDisplayDate(this.props.value),readOnly:!0,disabled:this.props.disabled,onChange:this.onChange,ref:this.dateInput},this.props.validation))}}]),DateText}(_react2.default.Component);DateText.propTypes={displayFormat:_propTypes2.default.string.isRequired,onChange:_propTypes2.default.func.isRequired,name:_propTypes2.default.string,storageFormat:_propTypes2.default.string.isRequired,value:_propTypes2.default.string.isRequired,disabled:_propTypes2.default.bool.isRequired,validation:_propTypes2.default.object.isRequired},DateText.defaultProps={name:"date"},module.exports=DateText},406:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),TimeSelect=function(_React$Component){function TimeSelect(){return _classCallCheck(this,TimeSelect),_possibleConstructorReturn(this,(TimeSelect.__proto__||Object.getPrototypeOf(TimeSelect)).apply(this,arguments))}return _inherits(TimeSelect,_React$Component),_createClass(TimeSelect,[{key:"render",value:function(){var _this2=this,options=Object.keys(this.props.timeOfDayItems).map(function(value){return _react2.default.createElement("option",{key:"option-"+_this2.props.timeOfDayItems[value],value:value},_this2.props.timeOfDayItems[value])});return _react2.default.createElement("select",_extends({name:this.props.name||"time",value:this.props.value,disabled:this.props.disabled,onChange:this.props.onChange},this.props.validation),options)}}]),TimeSelect}(_react2.default.Component);TimeSelect.propTypes={timeOfDayItems:_propTypes2.default.objectOf(_propTypes2.default.string).isRequired,name:_propTypes2.default.string,value:_propTypes2.default.string.isRequired,disabled:_propTypes2.default.bool,onChange:_propTypes2.default.func.isRequired,validation:_propTypes2.default.object},TimeSelect.defaultProps={name:"time",disabled:!1,validation:{}},module.exports=TimeSelect},407:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_scheduling=__webpack_require__(293),_scheduling2=_interopRequireDefault(_scheduling),fields=[{name:"subject",label:_mailpoet2.default.I18n.t("subjectLine"),tip:_mailpoet2.default.I18n.t("postNotificationSubjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":_mailpoet2.default.I18n.t("emptySubjectLineError")}},{name:"options",label:_mailpoet2.default.I18n.t("selectFrequency"),type:"reactComponent",component:_scheduling2.default},{name:"segments",label:_mailpoet2.default.I18n.t("segments"),tip:_mailpoet2.default.I18n.t("segmentsTip"),type:"selection",placeholder:_mailpoet2.default.I18n.t("selectSegmentPlaceholder"),id:"mailpoet_segments",api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,filter:function(segment){return!segment.deleted_at},getLabel:function(segment){return segment.name+" ("+parseInt(segment.subscribers,10).toLocaleString()+")"},transformChangedValue:function(segmentIds){var allSegments=this.getItems();return _underscore2.default.map(segmentIds,function(id){return _underscore2.default.find(allSegments,function(segment){return segment.id===id})})},validation:{"data-parsley-required":!0,"data-parsley-required-message":_mailpoet2.default.I18n.t("noSegmentsSelectedError")}},{name:"sender",label:_mailpoet2.default.I18n.t("sender"),tip:_mailpoet2.default.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:_mailpoet2.default.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"text",placeholder:_mailpoet2.default.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:_mailpoet2.default.I18n.t("replyTo"),tip:_mailpoet2.default.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:_mailpoet2.default.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:_mailpoet2.default.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]}];fields=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_3rd_step_fields",fields),module.exports={getFields:function(){return fields},getSendButtonOptions:function(){return{value:_mailpoet2.default.I18n.t("activate")}}}},408:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_scheduling=__webpack_require__(268),_scheduling2=_interopRequireDefault(_scheduling),fields=[{name:"subject",label:_mailpoet2.default.I18n.t("subjectLine"),tip:_mailpoet2.default.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":_mailpoet2.default.I18n.t("emptySubjectLineError")}},{name:"options",label:_mailpoet2.default.I18n.t("sendWelcomeEmailWhen"),type:"reactComponent",component:_scheduling2.default},{name:"sender",label:_mailpoet2.default.I18n.t("sender"),tip:_mailpoet2.default.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:_mailpoet2.default.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"text",placeholder:_mailpoet2.default.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:_mailpoet2.default.I18n.t("replyTo"),tip:_mailpoet2.default.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:_mailpoet2.default.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:_mailpoet2.default.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]}];fields=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_3rd_step_fields",fields),module.exports={getFields:function(){return fields},getSendButtonOptions:function(){return{value:_mailpoet2.default.I18n.t("activate")}}}},411:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}function successPageClosed(){return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:{show_congratulate_after_first_newsletter:!1}}).always(function(){window.location=window.mailpoet_main_page})}function renderSuccess(newsletter,testingPassed){return testingPassed&&_mailpoet2.default.trackEvent("Cron testing done",{"Cron is working":"true"}),_react2.default.createElement(_success2.default,{illustrationImageUrl:window.mailpoet_congratulations_success_image,successClicked:successPageClosed,newsletter:newsletter})}function renderFail(){return _mailpoet2.default.trackEvent("Cron testing done",{"Cron is working":"false"}),_react2.default.createElement(_fail2.default,{failClicked:function(){window.location=window.mailpoet_main_page}})}function renderLoading(showRichLoadingScreen){return _react2.default.createElement(_loading2.default,{illustrationImageUrl:window.mailpoet_congratulations_loading_image,successClicked:successPageClosed,showRichLoadingScreen:showRichLoadingScreen})}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_moment=__webpack_require__(0),_moment2=_interopRequireDefault(_moment),_success=__webpack_require__(412),_success2=_interopRequireDefault(_success),_fail=__webpack_require__(413),_fail2=_interopRequireDefault(_fail),_loading=__webpack_require__(414),_loading2=_interopRequireDefault(_loading),Congratulate=function(_React$Component){function Congratulate(props){_classCallCheck(this,Congratulate);var _this=_possibleConstructorReturn(this,(Congratulate.__proto__||Object.getPrototypeOf(Congratulate)).call(this,props));return _this.state={loading:!0,fail:!1,newsletter:null,testingPassed:!1,timeStart:(0,_moment2.default)(),minimumLoadingTimePassed:!1},_this.tick=_this.tick.bind(_this),_this}return _inherits(Congratulate,_React$Component),_createClass(Congratulate,[{key:"componentDidMount",value:function(){this.loadNewsletter(this.props.match.params.id),this.tick()}},{key:"componentWillReceiveProps",value:function(props){this.loadNewsletter(props.match.params.id)}},{key:"tick",value:function(){(0,_moment2.default)().subtract(20,"second").isAfter(this.state.timeStart)&&this.setState({error:!0,loading:!1}),this.state.loading&&this.loadNewsletter(this.props.match.params.id),(0,_moment2.default)().subtract(6,"seconds").isAfter(this.state.timeStart)&&this.setState({minimumLoadingTimePassed:!0}),!this.state.loading&&this.state.minimumLoadingTimePassed||setTimeout(this.tick,2e3)}},{key:"loadNewsletter",value:function(id){var _this2=this;_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:id}}).done(function(response){return _this2.newsletterLoaded(response.data)})}},{key:"newsletterLoaded",value:function(newsletter){"standard"!==newsletter.type||"scheduled"===newsletter.status?this.setState({newsletter:newsletter,loading:!1,minimumLoadingTimePassed:!0}):"sent"===newsletter.status||"sending"===newsletter.status?this.setState({newsletter:newsletter,loading:!1,testingPassed:!0}):this.setState({newsletter:newsletter})}},{key:"renderContent",value:function(){return this.state.loading||!this.state.minimumLoadingTimePassed?renderLoading(!!this.state.newsletter):this.state.error?renderFail():renderSuccess(this.state.newsletter,this.state.testingPassed)}},{key:"render",value:function(){return _react2.default.createElement("div",{className:"newsletter_congratulate_page"},this.renderContent())}}]),Congratulate}(_react2.default.Component);Congratulate.propTypes={match:_propTypes2.default.shape({params:_propTypes2.default.shape({id:_propTypes2.default.string}).isRequired}).isRequired},module.exports=Congratulate},412:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function renderHeader(newsletter){return"welcome"===newsletter.type?_mailpoet2.default.I18n.t("congratulationsWelcomeEmailSuccessHeader"):"notification"===newsletter.type?_mailpoet2.default.I18n.t("congratulationsPostNotificationSuccessHeader"):"automatic"===newsletter.type?_mailpoet2.default.I18n.t("congratulationsWooSuccessHeader"):"scheduled"===newsletter.status?_mailpoet2.default.I18n.t("congratulationsScheduleSuccessHeader"):_mailpoet2.default.I18n.t("congratulationsSendSuccessHeader")}function Success(props){return _react2.default.createElement("div",{className:"mailpoet_congratulate_success"},_react2.default.createElement("h1",null,renderHeader(props.newsletter)),_react2.default.createElement("img",{src:props.illustrationImageUrl,alt:"",width:"750",height:"250"}),_react2.default.createElement("button",{className:"button",onClick:props.successClicked},_mailpoet2.default.I18n.t("close")))}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet);Success.propTypes={successClicked:_propTypes2.default.func.isRequired,illustrationImageUrl:_propTypes2.default.string.isRequired,newsletter:_propTypes2.default.shape({status:_propTypes2.default.string.isRequired,type:_propTypes2.default.string.isRequired}).isRequired},module.exports=Success},413:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function Fail(props){return _react2.default.createElement("div",{className:"mailpoet_centered"},_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("congratulationsSendFailHeader")),_react2.default.createElement("p",null,(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("congratulationsSendFailExplain"),/\[link\](.*?)\[\/link\]/g,function(match,i){return _react2.default.createElement("a",{key:i,target:"_blank",rel:"noopener noreferrer",href:"https://kb.mailpoet.com/article/231-sending-does-not-work"},match)})),_react2.default.createElement("button",{className:"button",onClick:props.failClicked},_mailpoet2.default.I18n.t("close")))}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet);Fail.propTypes={failClicked:_propTypes2.default.func.isRequired},module.exports=Fail},414:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function renderRichData(showRichData,illustrationImageUrl){return showRichData?_react2.default.createElement("div",null,_react2.default.createElement("h1",{className:"mailpoet_newsletter_loading_header"},_mailpoet2.default.I18n.t("congratulationsLoadingHeader")),_react2.default.createElement("img",{src:illustrationImageUrl,alt:"",width:"800px",height:"266px"})):_react2.default.createElement("div",null)}function Loading(props){return _react2.default.createElement("div",{className:"mailpoet_newsletter_loading"},_react2.default.createElement(_loading2.default,null),renderRichData(props.showRichLoadingScreen,props.illustrationImageUrl))}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_loading=__webpack_require__(415),_loading2=_interopRequireDefault(_loading);Loading.propTypes={illustrationImageUrl:_propTypes2.default.string.isRequired,showRichLoadingScreen:_propTypes2.default.bool.isRequired},module.exports=Loading},415:function(module,exports,__webpack_require__){"use strict";function Loading(){return _react2.default.createElement("div",{className:"mailpoet_loading"},_react2.default.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_1"}),_react2.default.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_2"}),_react2.default.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_3"}))}var _react=__webpack_require__(1),_react2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_react);module.exports=Loading},416:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_reactRouterDom=__webpack_require__(7),NewsletterStandard=function(_React$Component){function NewsletterStandard(){var _ref,_temp,_this,_ret;_classCallCheck(this,NewsletterStandard);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=NewsletterStandard.__proto__||Object.getPrototypeOf(NewsletterStandard)).call.apply(_ref,[this].concat(args))),_this.showTemplateSelection=function(newsletterId){_this.props.history.push("/template/"+newsletterId)},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(NewsletterStandard,_React$Component),_createClass(NewsletterStandard,[{key:"componentDidMount",value:function(){var _this2=this;_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:"standard"}}).done(function(response){_this2.showTemplateSelection(response.data.id)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("regularNewsletterTypeTitle")),_react2.default.createElement(_breadcrumb2.default,{step:"type"}))}}]),NewsletterStandard}(_react2.default.Component);NewsletterStandard.propTypes={history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},module.exports=(0,_reactRouterDom.withRouter)(NewsletterStandard)},417:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_scheduling=__webpack_require__(293),_scheduling2=_interopRequireDefault(_scheduling),_reactRouterDom=__webpack_require__(7),field={name:"options",type:"reactComponent",component:_scheduling2.default},NewsletterNotification=function(_React$Component){function NewsletterNotification(){var _ref,_temp,_this,_ret;_classCallCheck(this,NewsletterNotification);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=NewsletterNotification.__proto__||Object.getPrototypeOf(NewsletterNotification)).call.apply(_ref,[this].concat(args))),_this.state={options:{intervalType:"daily",timeOfDay:0,weekDay:1,monthDay:0,nthWeekDay:1}},_this.handleValueChange=function(event){var state=_this.state;state[event.target.name]=event.target.value,_this.setState(state)},_this.handleNext=function(){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:_underscore2.default.extend({},_this.state,{type:"notification",subject:_mailpoet2.default.I18n.t("draftPostNotificationTitle")})}).done(function(response){_this.showTemplateSelection(response.data.id)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},_this.showTemplateSelection=function(newsletterId){_this.props.history.push("/template/"+newsletterId)},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(NewsletterNotification,_React$Component),_createClass(NewsletterNotification,[{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("postNotificationNewsletterTypeTitle")),_react2.default.createElement(_breadcrumb2.default,{step:"type"}),_react2.default.createElement("h3",null,_mailpoet2.default.I18n.t("selectFrequency")),_react2.default.createElement(_scheduling2.default,{item:this.state,field:field,onValueChange:this.handleValueChange}),_react2.default.createElement("p",{className:"submit"},_react2.default.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNext,value:_mailpoet2.default.I18n.t("next")})))}}]),NewsletterNotification}(_react2.default.Component);NewsletterNotification.propTypes={history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},module.exports=(0,_reactRouterDom.withRouter)(NewsletterNotification)},418:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_scheduling=__webpack_require__(268),_scheduling2=_interopRequireDefault(_scheduling),field={name:"options",label:"Event",type:"reactComponent",component:_scheduling2.default},NewsletterWelcome=function(_React$Component){function NewsletterWelcome(props){_classCallCheck(this,NewsletterWelcome);var _this=_possibleConstructorReturn(this,(NewsletterWelcome.__proto__||Object.getPrototypeOf(NewsletterWelcome)).call(this,props)),availableSegments=window.mailpoet_segments||[],defaultSegment=1;return availableSegments=availableSegments.filter(function(segment){return"default"===segment.type}),_underscore2.default.size(availableSegments)>0&&(defaultSegment=_underscore2.default.first(availableSegments).id),_this.state={options:{event:"segment",segment:defaultSegment,role:"subscriber",afterTimeNumber:1,afterTimeType:"immediate"}},_this.handleValueChange=_this.handleValueChange.bind(_this),_this.handleNext=_this.handleNext.bind(_this),_this}return _inherits(NewsletterWelcome,_React$Component),_createClass(NewsletterWelcome,[{key:"handleValueChange",value:function(event){var state=this.state;state[event.target.name]=event.target.value,this.setState(state)}},{key:"handleNext",value:function(){var _this2=this;_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:_underscore2.default.extend({},this.state,{type:"welcome",subject:_mailpoet2.default.I18n.t("draftNewsletterTitle")})}).done(function(response){_this2.showTemplateSelection(response.data.id)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{key:"showTemplateSelection",value:function(newsletterId){this.props.history.push("/template/"+newsletterId)}},{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("welcomeNewsletterTypeTitle")),_react2.default.createElement(_breadcrumb2.default,{step:"type"}),_react2.default.createElement("h3",null,_mailpoet2.default.I18n.t("selectEventToSendWelcomeEmail")),_react2.default.createElement(_scheduling2.default,{item:this.state,field:field,onValueChange:this.handleValueChange}),_react2.default.createElement("p",{className:"submit"},_react2.default.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNext,value:_mailpoet2.default.I18n.t("next")})))}}]),NewsletterWelcome}(_react2.default.Component);NewsletterWelcome.propTypes={history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},exports.default=NewsletterWelcome},419:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_createReactClass=__webpack_require__(32),_createReactClass2=_interopRequireDefault(_createReactClass),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_confirm_alert=__webpack_require__(292),_confirm_alert2=_interopRequireDefault(_confirm_alert),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),_tabs=__webpack_require__(172),_tabs2=_interopRequireDefault(_tabs),_heading=__webpack_require__(174),_heading2=_interopRequireDefault(_heading),_mixins=__webpack_require__(173),mailpoetTrackingEnabled=!!window.mailpoet_tracking_enabled,messages={onTrash:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterTrashed"):_mailpoet2.default.I18n.t("multipleNewslettersTrashed").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onDelete:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterDeleted"):_mailpoet2.default.I18n.t("multipleNewslettersDeleted").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onRestore:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterRestored"):_mailpoet2.default.I18n.t("multipleNewslettersRestored").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)}},columns=[{name:"subject",label:_mailpoet2.default.I18n.t("subject"),sortable:!0},{name:"status",label:_mailpoet2.default.I18n.t("status")},{name:"segments",label:_mailpoet2.default.I18n.t("lists")},{name:"statistics",label:_mailpoet2.default.I18n.t("statistics"),display:mailpoetTrackingEnabled},{name:"sent_at",label:_mailpoet2.default.I18n.t("sentOn"),sortable:!0}],bulkActions=[{name:"trash",label:_mailpoet2.default.I18n.t("moveToTrash"),onSuccess:messages.onTrash}],confirmEdit=function(newsletter){var redirectToEditing=function(){window.location.href="?page=mailpoet-newsletter-editor&id="+newsletter.id};newsletter.queue&&"sending"===newsletter.status&&null===newsletter.queue.status?(0,_confirm_alert2.default)({message:_mailpoet2.default.I18n.t("confirmEdit"),onConfirm:redirectToEditing}):redirectToEditing()},newsletterActions=[{name:"view",link:function(newsletter){return _react2.default.createElement("a",{href:newsletter.preview_url,target:"_blank"},_mailpoet2.default.I18n.t("preview"))}},{name:"edit",label:_mailpoet2.default.I18n.t("edit"),onClick:confirmEdit},{name:"duplicate",label:_mailpoet2.default.I18n.t("duplicate"),onClick:function(newsletter,refresh){return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:newsletter.id}}).done(function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterDuplicated").replace("%$1s",response.data.subject)),refresh()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{name:"trash"}];_wpJsHooks2.default.addFilter("mailpoet_newsletters_listings_standard_actions",_mixins.StatisticsMixin.addStatsCTAAction),newsletterActions=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_listings_standard_actions",newsletterActions);var NewsletterListStandard=(0,_createReactClass2.default)({displayName:"NewsletterListStandard",propTypes:{location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},mixins:[_mixins.QueueMixin,_mixins.StatisticsMixin,_mixins.MailerMixin,_mixins.CronMixin],renderItem:function(newsletter,actions,meta){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions"),segments=newsletter.segments.map(function(segment){return segment.name}).join(", ");return _react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,_react2.default.createElement("a",{className:"row-title",href:"javascript:;",onClick:function(){return confirmEdit(newsletter)}},newsletter.queue.newsletter_rendered_subject||newsletter.subject)),actions),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("status")},this.renderQueueStatus(newsletter,meta.mta_log)),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("lists")},segments),!0===mailpoetTrackingEnabled?_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("statistics")},this.renderStatistics(newsletter,void 0,meta.current_time)):null,_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("sentOn")},_react2.default.createElement("abbr",null,newsletter.sent_at?_mailpoet2.default.Date.format(newsletter.sent_at):_mailpoet2.default.I18n.t("notSentYet"))))},render:function(){var _this=this;return _react2.default.createElement("div",null,_react2.default.createElement(_heading2.default,null),_react2.default.createElement(_tabs2.default,{tab:"standard"}),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"standard",base_url:"standard",onRenderItem:this.renderItem,columns:columns,bulk_actions:bulkActions,item_actions:newsletterActions,messages:messages,auto_refresh:!0,sort_by:"sent_at",sort_order:"desc",afterGetItems:function(state){_this.checkMailerStatus(state),_this.checkCronStatus(state)}}))}});module.exports=NewsletterListStandard},420:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_createReactClass=__webpack_require__(32),_createReactClass2=_interopRequireDefault(_createReactClass),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),_tabs=__webpack_require__(172),_tabs2=_interopRequireDefault(_tabs),_heading=__webpack_require__(174),_heading2=_interopRequireDefault(_heading),_mixins=__webpack_require__(173),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),mailpoetRoles=window.mailpoet_roles||{},mailpoetSegments=window.mailpoet_segments||{},mailpoetTrackingEnabled=!!window.mailpoet_tracking_enabled,messages={onTrash:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterTrashed"):_mailpoet2.default.I18n.t("multipleNewslettersTrashed").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onDelete:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterDeleted"):_mailpoet2.default.I18n.t("multipleNewslettersDeleted").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onRestore:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterRestored"):_mailpoet2.default.I18n.t("multipleNewslettersRestored").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)}},columns=[{name:"subject",label:_mailpoet2.default.I18n.t("subject"),sortable:!0},{name:"status",label:_mailpoet2.default.I18n.t("status"),width:145},{name:"settings",label:_mailpoet2.default.I18n.t("settings")},{name:"statistics",label:_mailpoet2.default.I18n.t("statistics"),display:mailpoetTrackingEnabled},{name:"updated_at",label:_mailpoet2.default.I18n.t("lastModifiedOn"),sortable:!0}],bulkActions=[{name:"trash",label:_mailpoet2.default.I18n.t("moveToTrash"),onSuccess:messages.onTrash}],newsletterActions=[{name:"view",link:function(newsletter){return _react2.default.createElement("a",{href:newsletter.preview_url,target:"_blank"},_mailpoet2.default.I18n.t("preview"))}},{name:"duplicate",label:_mailpoet2.default.I18n.t("duplicate"),onClick:function(newsletter,refresh){return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:newsletter.id}}).done(function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterDuplicated").replace("%$1s",response.data.subject)),refresh()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{name:"edit",link:function(newsletter){return _react2.default.createElement("a",{href:"?page=mailpoet-newsletter-editor&id="+newsletter.id},_mailpoet2.default.I18n.t("edit"))}},{name:"trash"}];_wpJsHooks2.default.addFilter("mailpoet_newsletters_listings_welcome_notification_actions",_mixins.StatisticsMixin.addStatsCTAAction),newsletterActions=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_listings_welcome_notification_actions",newsletterActions);var NewsletterListWelcome=(0,_createReactClass2.default)({displayName:"NewsletterListWelcome",propTypes:{location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},mixins:[_mixins.StatisticsMixin,_mixins.MailerMixin,_mixins.CronMixin],updateStatus:function(e){var _this=this;e.persist(),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done(function(response){"active"===response.data.status&&_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("welcomeEmailActivated")),_this.forceUpdate()}).fail(function(response){_mailpoet2.default.Notice.error(_mailpoet2.default.I18n.t("welcomeEmailActivationFailed")),e.target.value=response.status})},renderStatus:function(newsletter){var totalSentMessage=_mailpoet2.default.I18n.t("sentToXSubscribers").replace("%$1d",newsletter.total_sent.toLocaleString()),totalScheduledMessage=_mailpoet2.default.I18n.t("scheduledToXSubscribers").replace("%$1d",newsletter.total_scheduled.toLocaleString());return _react2.default.createElement("div",null,_react2.default.createElement("p",null,_react2.default.createElement("select",{"data-id":newsletter.id,defaultValue:newsletter.status,onChange:this.updateStatus},_react2.default.createElement("option",{value:"active"},_mailpoet2.default.I18n.t("active")),_react2.default.createElement("option",{value:"draft"},_mailpoet2.default.I18n.t("inactive")))),_react2.default.createElement("p",null,totalSentMessage," ",_react2.default.createElement("br",null),totalScheduledMessage))},renderSettings:function(newsletter){var sendingEvent=void 0,sendingDelay=void 0,segment=void 0;switch(newsletter.options.event){case"user":sendingEvent="mailpoet_all"===newsletter.options.role?_mailpoet2.default.I18n.t("welcomeEventWPUserAnyRole"):_mailpoet2.default.I18n.t("welcomeEventWPUserWithRole").replace("%$1s",mailpoetRoles[newsletter.options.role]);break;default:if(void 0===(segment=_underscore2.default.find(mailpoetSegments,function(seg){return Number(seg.id)===Number(newsletter.options.segment)})))return _react2.default.createElement("span",{className:"mailpoet_error"},_mailpoet2.default.I18n.t("sendingToSegmentsNotSpecified"));sendingEvent=_mailpoet2.default.I18n.t("welcomeEventSegment").replace("%$1s",segment.name)}if(sendingEvent&&"immediate"!==newsletter.options.afterTimeType){switch(newsletter.options.afterTimeType){case"hours":sendingDelay=_mailpoet2.default.I18n.t("sendingDelayHours").replace("%$1d",newsletter.options.afterTimeNumber);break;case"days":sendingDelay=_mailpoet2.default.I18n.t("sendingDelayDays").replace("%$1d",newsletter.options.afterTimeNumber);break;case"weeks":sendingDelay=_mailpoet2.default.I18n.t("sendingDelayWeeks").replace("%$1d",newsletter.options.afterTimeNumber);break;default:sendingDelay=_mailpoet2.default.I18n.t("sendingDelayInvalid")}sendingEvent+=" ["+sendingDelay+"]."}return _react2.default.createElement("span",null,sendingEvent)},renderItem:function(newsletter,actions){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions");return _react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,_react2.default.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id="+newsletter.id},newsletter.subject)),actions),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("status")},this.renderStatus(newsletter)),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("settings")},this.renderSettings(newsletter)),!0===mailpoetTrackingEnabled?_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("statistics")},this.renderStatistics(newsletter,newsletter.total_sent>0&&newsletter.statistics)):null,_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("lastModifiedOn")},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(newsletter.updated_at))))},render:function(){var _this2=this;return _react2.default.createElement("div",null,_react2.default.createElement(_heading2.default,null),_react2.default.createElement(_tabs2.default,{tab:"welcome"}),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"welcome",base_url:"welcome",onRenderItem:this.renderItem,columns:columns,bulk_actions:bulkActions,item_actions:newsletterActions,messages:messages,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(state){_this2.checkMailerStatus(state),_this2.checkCronStatus(state)}}))}});module.exports=NewsletterListWelcome},421:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_createReactClass=__webpack_require__(32),_createReactClass2=_interopRequireDefault(_createReactClass),_reactRouterDom=__webpack_require__(7),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),_tabs=__webpack_require__(172),_tabs2=_interopRequireDefault(_tabs),_heading=__webpack_require__(174),_heading2=_interopRequireDefault(_heading),_mixins=__webpack_require__(173),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_common=__webpack_require__(269),messages={onTrash:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterTrashed"):_mailpoet2.default.I18n.t("multipleNewslettersTrashed").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onDelete:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterDeleted"):_mailpoet2.default.I18n.t("multipleNewslettersDeleted").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onRestore:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterRestored"):_mailpoet2.default.I18n.t("multipleNewslettersRestored").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)}},columns=[{name:"subject",label:_mailpoet2.default.I18n.t("subject"),sortable:!0},{name:"status",label:_mailpoet2.default.I18n.t("status"),width:100},{name:"settings",label:_mailpoet2.default.I18n.t("settings")},{name:"history",label:_mailpoet2.default.I18n.t("history"),width:100},{name:"updated_at",label:_mailpoet2.default.I18n.t("lastModifiedOn"),sortable:!0}],bulkActions=[{name:"trash",label:_mailpoet2.default.I18n.t("moveToTrash"),onSuccess:messages.onTrash}],newsletterActions=[{name:"view",link:function(newsletter){return _react2.default.createElement("a",{href:newsletter.preview_url,target:"_blank"},_mailpoet2.default.I18n.t("preview"))}},{name:"edit",link:function(newsletter){return _react2.default.createElement("a",{href:"?page=mailpoet-newsletter-editor&id="+newsletter.id},_mailpoet2.default.I18n.t("edit"))}},{name:"duplicate",label:_mailpoet2.default.I18n.t("duplicate"),onClick:function(newsletter,refresh){return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:newsletter.id}}).done(function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterDuplicated").replace("%$1s",response.data.subject)),refresh()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{name:"trash"}],NewsletterListNotification=(0,_createReactClass2.default)({displayName:"NewsletterListNotification",propTypes:{location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},mixins:[_mixins.MailerMixin,_mixins.CronMixin],updateStatus:function(e){var _this=this;e.persist(),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done(function(response){"active"===response.data.status&&_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("postNotificationActivated")),_this.forceUpdate()}).fail(function(response){_mailpoet2.default.Notice.error(_mailpoet2.default.I18n.t("postNotificationActivationFailed")),e.target.value=response.status})},renderStatus:function(newsletter){return _react2.default.createElement("select",{"data-id":newsletter.id,defaultValue:newsletter.status,onChange:this.updateStatus},_react2.default.createElement("option",{value:"active"},_mailpoet2.default.I18n.t("active")),_react2.default.createElement("option",{value:"draft"},_mailpoet2.default.I18n.t("inactive")))},renderSettings:function(newsletter){var sendingFrequency=void 0,segments=newsletter.segments.map(function(segment){return segment.name}),sendingToSegments=_mailpoet2.default.I18n.t("ifNewContentToSegments").replace("%$1s",segments.join(", "));if(0===segments.length)return _react2.default.createElement("span",{className:"mailpoet_error"},_mailpoet2.default.I18n.t("sendingToSegmentsNotSpecified"));switch(newsletter.options.intervalType){case"daily":sendingFrequency=_mailpoet2.default.I18n.t("sendDaily").replace("%$1s",_common.timeOfDayValues[newsletter.options.timeOfDay]);break;case"weekly":sendingFrequency=_mailpoet2.default.I18n.t("sendWeekly").replace("%$1s",_common.weekDayValues[newsletter.options.weekDay]).replace("%$2s",_common.timeOfDayValues[newsletter.options.timeOfDay]);break;case"monthly":sendingFrequency=_mailpoet2.default.I18n.t("sendMonthly").replace("%$1s",_common.monthDayValues[newsletter.options.monthDay]).replace("%$2s",_common.timeOfDayValues[newsletter.options.timeOfDay]);break;case"nthWeekDay":sendingFrequency=_mailpoet2.default.I18n.t("sendNthWeekDay").replace("%$1s",_common.nthWeekDayValues[newsletter.options.nthWeekDay]).replace("%$2s",_common.weekDayValues[newsletter.options.weekDay]).replace("%$3s",_common.timeOfDayValues[newsletter.options.timeOfDay]);break;case"immediately":sendingFrequency=_mailpoet2.default.I18n.t("sendImmediately");break;default:sendingFrequency="Invalid sending frequency"}return _react2.default.createElement("span",null,sendingFrequency," ",sendingToSegments)},renderHistoryLink:function(newsletter){return 0===Number(newsletter.children_count)?_mailpoet2.default.I18n.t("notSentYet"):_react2.default.createElement(_reactRouterDom.Link,{"data-automation-id":"history-"+newsletter.id,to:"/notification/history/"+newsletter.id},_mailpoet2.default.I18n.t("viewHistory"))},renderItem:function(newsletter,actions){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions");return _react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,_react2.default.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id="+newsletter.id},newsletter.subject)),actions),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("status")},this.renderStatus(newsletter)),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("settings")},this.renderSettings(newsletter)),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("history")},this.renderHistoryLink(newsletter)),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("lastModifiedOn")},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(newsletter.updated_at))))},render:function(){var _this2=this;return _react2.default.createElement("div",null,_react2.default.createElement(_heading2.default,null),_react2.default.createElement(_tabs2.default,{tab:"notification"}),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"notification",base_url:"notification",onRenderItem:this.renderItem,columns:columns,bulk_actions:bulkActions,item_actions:newsletterActions,messages:messages,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(state){_this2.checkMailerStatus(state),_this2.checkCronStatus(state)}}))}});module.exports=NewsletterListNotification},422:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_createReactClass=__webpack_require__(32),_createReactClass2=_interopRequireDefault(_createReactClass),_reactRouterDom=__webpack_require__(7),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),_tabs=__webpack_require__(172),_tabs2=_interopRequireDefault(_tabs),_heading=__webpack_require__(174),_heading2=_interopRequireDefault(_heading),_mixins=__webpack_require__(173),mailpoetTrackingEnabled=!!window.mailpoet_tracking_enabled,columns=[{name:"subject",label:_mailpoet2.default.I18n.t("subject")},{name:"status",label:_mailpoet2.default.I18n.t("status")},{name:"segments",label:_mailpoet2.default.I18n.t("lists")},{name:"statistics",label:_mailpoet2.default.I18n.t("statistics"),display:mailpoetTrackingEnabled},{name:"sent_at",label:_mailpoet2.default.I18n.t("sentOn")}],newsletterActions=[{name:"view",link:function(newsletter){return _react2.default.createElement("a",{href:newsletter.preview_url,target:"_blank"},_mailpoet2.default.I18n.t("preview"))}}];_wpJsHooks2.default.addFilter("mailpoet_newsletters_listings_notification_history_actions",_mixins.StatisticsMixin.addStatsCTAAction),newsletterActions=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_listings_notification_history_actions",newsletterActions);var NewsletterListNotificationHistory=(0,_createReactClass2.default)({displayName:"NewsletterListNotificationHistory",propTypes:{location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},mixins:[_mixins.QueueMixin,_mixins.StatisticsMixin,_mixins.MailerMixin,_mixins.CronMixin],renderItem:function(newsletter,actions,meta){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions"),segments=newsletter.segments.map(function(segment){return segment.name}).join(", ");return _react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,_react2.default.createElement("a",{href:newsletter.preview_url,target:"_blank"},newsletter.queue.newsletter_rendered_subject||newsletter.subject)),actions),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("status")},this.renderQueueStatus(newsletter,meta.mta_log)),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("lists")},segments),!0===mailpoetTrackingEnabled?_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("statistics")},this.renderStatistics(newsletter,void 0,meta.current_time)):null,_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("sentOn")},newsletter.sent_at?_mailpoet2.default.Date.format(newsletter.sent_at):_mailpoet2.default.I18n.t("notSentYet")))},render:function(){var _this=this;return _react2.default.createElement("div",null,_react2.default.createElement(_heading2.default,null),_react2.default.createElement(_tabs2.default,{tab:"notification"}),_react2.default.createElement(_reactRouterDom.Link,{className:"page-title-action",to:"/notification"},_mailpoet2.default.I18n.t("backToPostNotifications")),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"notification_history",base_url:"notification/history/:parent_id",onRenderItem:this.renderItem,columns:columns,item_actions:newsletterActions,auto_refresh:!0,sort_by:"sent_at",sort_order:"desc",afterGetItems:function(state){_this.checkMailerStatus(state),_this.checkCronStatus(state)}}))}});module.exports=NewsletterListNotificationHistory},423:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactRouterDom=__webpack_require__(7),_list=__webpack_require__(424),_list2=_interopRequireDefault(_list),_form=__webpack_require__(425),_form2=_interopRequireDefault(_form),container=document.getElementById("segments_container");container&&_reactDom2.default.render(_react2.default.createElement(_reactRouterDom.HashRouter,null,_react2.default.createElement(_reactRouterDom.Switch,null,_react2.default.createElement(_reactRouterDom.Route,{path:"/new",component:_form2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"/edit/:id",component:_form2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"*",component:_list2.default}))),container)},424:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(7),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),columns=[{name:"name",label:_mailpoet2.default.I18n.t("name"),sortable:!0},{name:"description",label:_mailpoet2.default.I18n.t("description")},{name:"subscribed",label:_mailpoet2.default.I18n.t("subscribed")},{name:"unconfirmed",label:_mailpoet2.default.I18n.t("unconfirmed")},{name:"unsubscribed",label:_mailpoet2.default.I18n.t("unsubscribed")},{name:"bounced",label:_mailpoet2.default.I18n.t("bounced")},{name:"created_at",label:_mailpoet2.default.I18n.t("createdOn"),sortable:!0}],messages={onTrash:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneSegmentTrashed"):_mailpoet2.default.I18n.t("multipleSegmentsTrashed").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onDelete:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneSegmentDeleted"):_mailpoet2.default.I18n.t("multipleSegmentsDeleted").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onRestore:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneSegmentRestored"):_mailpoet2.default.I18n.t("multipleSegmentsRestored").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)}},bulkActions=[{name:"trash",label:_mailpoet2.default.I18n.t("moveToTrash"),onSuccess:messages.onTrash}],itemActions=[{name:"edit",link:function(item){return _react2.default.createElement(_reactRouterDom.Link,{to:"/edit/"+item.id},_mailpoet2.default.I18n.t("edit"))},display:function(segment){return"wp_users"!==segment.type}},{name:"duplicate_segment",label:_mailpoet2.default.I18n.t("duplicate"),onClick:function(item,refresh){return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"segments",action:"duplicate",data:{id:item.id}}).done(function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("listDuplicated").replace("%$1s",response.data.name)),refresh()}).fail(function(response){_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},display:function(segment){return"wp_users"!==segment.type}},{name:"read_more",link:function(){return _react2.default.createElement("a",{href:"http://docs.mailpoet.com/article/133-the-wordpress-users-list",target:"_blank",rel:"noopener noreferrer"},_mailpoet2.default.I18n.t("readMore"))},display:function(segment){return"wp_users"===segment.type}},{name:"synchronize_segment",label:_mailpoet2.default.I18n.t("forceSync"),onClick:function(item,refresh){_mailpoet2.default.Modal.loading(!0),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"segments",action:"synchronize"}).done(function(){_mailpoet2.default.Modal.loading(!1),_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("listSynchronized").replace("%$1s",item.name)),refresh()}).fail(function(response){_mailpoet2.default.Modal.loading(!1),response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},display:function(segment){return"wp_users"===segment.type}},{name:"view_subscribers",link:function(item){return _react2.default.createElement("a",{href:item.subscribers_url},_mailpoet2.default.I18n.t("viewSubscribers"))}},{name:"trash",display:function(segment){return"wp_users"!==segment.type}}],SegmentList=function(_React$Component){function SegmentList(){var _ref,_temp,_this,_ret;_classCallCheck(this,SegmentList);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=SegmentList.__proto__||Object.getPrototypeOf(SegmentList)).call.apply(_ref,[this].concat(args))),_this.renderItem=function(segment,actions){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions"),subscribed=Number(segment.subscribers_count.subscribed||0),unconfirmed=Number(segment.subscribers_count.unconfirmed||0),unsubscribed=Number(segment.subscribers_count.unsubscribed||0),bounced=Number(segment.subscribers_count.bounced||0),segmentName=void 0;return segmentName="wp_users"===segment.type?_react2.default.createElement("span",{className:"row-title"},segment.name):_react2.default.createElement(_reactRouterDom.Link,{className:"row-title",to:"/edit/"+segment.id},segment.name),_react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,segmentName),actions),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("description")},_react2.default.createElement("abbr",null,segment.description)),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("subscribed")},_react2.default.createElement("abbr",null,subscribed.toLocaleString())),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("unconfirmed")},_react2.default.createElement("abbr",null,unconfirmed.toLocaleString())),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("unsubscribed")},_react2.default.createElement("abbr",null,unsubscribed.toLocaleString())),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("bounced")},_react2.default.createElement("abbr",null,bounced.toLocaleString())),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("createdOn")},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(segment.created_at))))},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(SegmentList,_React$Component),_createClass(SegmentList,[{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",{className:"title"},_mailpoet2.default.I18n.t("pageTitle")," ",_react2.default.createElement(_reactRouterDom.Link,{className:"page-title-action",to:"/new"},_mailpoet2.default.I18n.t("new"))),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,messages:messages,search:!1,endpoint:"segments",onRenderItem:this.renderItem,columns:columns,bulk_actions:bulkActions,item_actions:itemActions,sort_by:"name",sort_order:"asc"}))}}]),SegmentList}(_react2.default.Component);SegmentList.propTypes={location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},module.exports=SegmentList},425:function(module,exports,__webpack_require__){"use strict";(function(global){global.MailPoetLib||(global.MailPoetLib={}),module.exports=global.MailPoetLib.Form=__webpack_require__(426)}).call(exports,__webpack_require__(6))},426:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(7),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_form=__webpack_require__(187),_form2=_interopRequireDefault(_form),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),fields=[{name:"name",label:_mailpoet2.default.I18n.t("name"),type:"text"},{name:"description",label:_mailpoet2.default.I18n.t("description"),type:"textarea",tip:_mailpoet2.default.I18n.t("segmentDescriptionTip")}],messages={onUpdate:function(){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("segmentUpdated"))},onCreate:function(){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("segmentAdded")),_mailpoet2.default.trackEvent("Lists > Add new",{"MailPoet Free version":window.mailpoet_version})}},SegmentForm=function(props){return _react2.default.createElement("div",null,_react2.default.createElement("h1",{className:"title"},_mailpoet2.default.I18n.t("segment"),_react2.default.createElement(_reactRouterDom.Link,{className:"page-title-action",to:"/"},_mailpoet2.default.I18n.t("backToList"))),_react2.default.createElement(_form2.default,{endpoint:"segments",fields:fields,params:props.match.params,messages:messages}))};SegmentForm.propTypes={match:_propTypes2.default.shape({params:_propTypes2.default.shape({id:_propTypes2.default.string}).isRequired}).isRequired},exports.default=SegmentForm},427:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactRouterDom=__webpack_require__(7),_list=__webpack_require__(428),_list2=_interopRequireDefault(_list),container=document.getElementById("forms_container");container&&_reactDom2.default.render(_react2.default.createElement(_reactRouterDom.HashRouter,null,_react2.default.createElement(_reactRouterDom.Route,{path:"*",component:_list2.default})),container)},428:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),columns=[{name:"name",label:_mailpoet2.default.I18n.t("formName"),sortable:!0},{name:"segments",label:_mailpoet2.default.I18n.t("segments")},{name:"signups",label:_mailpoet2.default.I18n.t("signups")},{name:"created_at",label:_mailpoet2.default.I18n.t("createdOn"),sortable:!0}],messages={onTrash:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneFormTrashed"):_mailpoet2.default.I18n.t("multipleFormsTrashed").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onDelete:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneFormDeleted"):_mailpoet2.default.I18n.t("multipleFormsDeleted").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onRestore:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneFormRestored"):_mailpoet2.default.I18n.t("multipleFormsRestored").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)}},bulkActions=[{name:"trash",label:_mailpoet2.default.I18n.t("moveToTrash"),onSuccess:messages.onTrash}],itemActions=[{name:"edit",label:_mailpoet2.default.I18n.t("edit"),link:function(item){return _react2.default.createElement("a",{href:"admin.php?page=mailpoet-form-editor&id="+item.id},_mailpoet2.default.I18n.t("edit"))}},{name:"duplicate",label:_mailpoet2.default.I18n.t("duplicate"),onClick:function(item,refresh){return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"duplicate",data:{id:item.id}}).done(function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("formDuplicated").replace("%$1s",response.data.name)),refresh()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{name:"trash"}],FormList=function(_React$Component){function FormList(){var _ref,_temp,_this,_ret;_classCallCheck(this,FormList);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=FormList.__proto__||Object.getPrototypeOf(FormList)).call.apply(_ref,[this].concat(args))),_this.createForm=function(){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"create"}).done(function(response){window.location=window.mailpoet_form_edit_url+response.data.id}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},_this.renderItem=function(form,actions){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions"),segments=window.mailpoet_segments.filter(function(segment){return-1!==_jquery2.default.inArray(segment.id,form.segments)}).map(function(segment){return segment.name}).join(", ");return"user"===form.settings.segments_selected_by&&(segments=_mailpoet2.default.I18n.t("userChoice")+" "+segments),_react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,_react2.default.createElement("a",{className:"row-title",href:"admin.php?page=mailpoet-form-editor&id="+form.id},form.name)),actions),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("segments")},segments),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("signups")},form.signups),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("createdOn")},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(form.created_at))))},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(FormList,_React$Component),_createClass(FormList,[{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",{className:"title"},_mailpoet2.default.I18n.t("pageTitle")," ",_react2.default.createElement("a",{className:"page-title-action",href:"javascript:;",onClick:this.createForm,"data-automation-id":"create_new_form"},_mailpoet2.default.I18n.t("new"))),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,messages:messages,search:!1,endpoint:"forms",onRenderItem:this.renderItem,columns:columns,bulk_actions:bulkActions,item_actions:itemActions}))}}]),FormList}(_react2.default.Component);FormList.propTypes={location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},module.exports=FormList},429:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(18),__webpack_require__(5),__webpack_require__(2)],void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(Backbone,jQuery,mp){var MailPoet=mp;0!==jQuery("#mailpoet_settings").length&&(MailPoet.Router=new(Backbone.Router.extend({routes:{"":"defaultRoute","mta(/:group)":"sendingMethodGroup","(:tab)":"tabs"},defaultRoute:function(){this.tabs("basics")},sendingMethodGroup:function(group){this.tabs("mta"),jQuery("#mailpoet_sending_method_setup, .mailpoet_sending_method").hide(),jQuery(".mailpoet_settings_submit").hide(),null===group?jQuery(".mailpoet_sending_methods, .mailpoet_sending_methods_help").fadeIn():(jQuery("#mailpoet_mta_spf")["mailpoet"===group?"hide":"show"](),jQuery(".mailpoet_sending_methods, .mailpoet_sending_methods_help").hide(),jQuery('.mailpoet_sending_method[data-group="'+group+'"]').show(),jQuery("#mailpoet_sending_method_setup").fadeIn())},tabs:function(tab){jQuery(".nav-tab-wrapper a").removeClass("nav-tab-active"),jQuery(".mailpoet_tab_panel, .mailpoet_section").hide(),jQuery('a.nav-tab[href="#'+tab+'"]').addClass("nav-tab-active").blur(),jQuery('.mailpoet_tab_panel[data-tab="'+tab+'"]').length>0&&jQuery('.mailpoet_tab_panel[data-tab="'+tab+'"]').show(),jQuery(".mailpoet_settings_submit").show(),MailPoet.trackEvent("User has clicked a tab in Settings",{"MailPoet Free version":window.mailpoet_version,"Tab ID":tab})}})),jQuery(document).ready(function(){Backbone.History.started||Backbone.history.start()}))}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},431:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactRouterDom=__webpack_require__(7),_knowledge_base=__webpack_require__(432),_knowledge_base2=_interopRequireDefault(_knowledge_base),_system_info=__webpack_require__(433),_system_info2=_interopRequireDefault(_system_info),_system_status=__webpack_require__(434),_system_status2=_interopRequireDefault(_system_status),_your_privacy=__webpack_require__(440),_your_privacy2=_interopRequireDefault(_your_privacy),container=document.getElementById("help_container");container&&_reactDom2.default.render(_react2.default.createElement(_reactRouterDom.HashRouter,null,_react2.default.createElement(_reactRouterDom.Switch,null,_react2.default.createElement(_reactRouterDom.Route,{exact:!0,path:"/",render:function(){return _react2.default.createElement(_reactRouterDom.Redirect,{to:"/knowledgeBase"})}}),_react2.default.createElement(_reactRouterDom.Route,{path:"/knowledgeBase",component:_knowledge_base2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"/systemStatus",component:_system_status2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"/systemInfo",component:_system_info2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"/yourPrivacy",component:_your_privacy2.default}))),container)},432:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function KnowledgeBase(){return _react2.default.createElement("div",null,_react2.default.createElement(_tabs2.default,{tab:"knowledgeBase"}),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("knowledgeBaseIntro")),_react2.default.createElement("ul",null,_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/116-common-problems"},"Common Problems")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/165-newsletters"},"Newsletters")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/156-migration-questions"},"Migration Questions")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/149-sending-methods"},"Sending Methods")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/139-subscription-forms"},"Subscription Forms")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/114-getting-started"},"Getting Started")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/123-newsletter-designer"},"Newsletter Designer")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/121-subscribers-and-lists"},"Subscribers and Lists"))),_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/",className:"button button-primary"},_mailpoet2.default.I18n.t("knowledgeBaseButton")))}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_tabs=__webpack_require__(188),_tabs2=_interopRequireDefault(_tabs);module.exports=KnowledgeBase},433:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function handleFocus(event){event.target.select()}function printData(data){if(_underscore2.default.isObject(data)){var printableData=Object.keys(data).map(function(key){return key+": "+data[key]});return _react2.default.createElement("textarea",{readOnly:!0,onFocus:handleFocus,value:printableData.join("\n"),style:{width:"100%",height:"400px"}})}return _react2.default.createElement("p",null,_mailpoet2.default.I18n.t("systemInfoDataError"))}function SystemInfo(){var systemInfoData=window.systemInfoData;return _react2.default.createElement("div",null,_react2.default.createElement(_tabs2.default,{tab:"systemInfo"}),_react2.default.createElement("div",{className:"mailpoet_notice notice inline",style:{marginTop:"1em"}},_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("systemInfoIntro"))),printData(systemInfoData))}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_tabs=__webpack_require__(188),_tabs2=_interopRequireDefault(_tabs);module.exports=SystemInfo},434:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function renderStatusMessage(status,error,link){var noticeType=status?"success":"error",noticeMessage=status?_mailpoet2.default.I18n.t("systemStatusConnectionSuccessful"):_mailpoet2.default.I18n.t("systemStatusConnectionUnsuccessful")+" "+error;return link&&(noticeMessage=(0,_reactStringReplace2.default)(noticeMessage,/\[link\](.*?)\[\/link\]/g,function(match){return _react2.default.createElement("a",{href:""+link,key:"kb-link"},match)})),_react2.default.createElement("div",{className:"mailpoet_notice notice inline notice-"+noticeType,style:{marginTop:"1em"}},_react2.default.createElement("p",null,noticeMessage))}function renderCronSection(data){var status=data.cron.isReachable,url=data.cron.url;return _react2.default.createElement("div",null,_react2.default.createElement("h2",null,_mailpoet2.default.I18n.t("systemStatusCronTitle")),_react2.default.createElement("p",null,_react2.default.createElement("a",{href:url,target:"_blank"},url)),renderStatusMessage(status,_mailpoet2.default.I18n.t("systemStatusCronConnectionUnsuccessfulInfo"),"//beta.docs.mailpoet.com/article/231-sending-does-not-work"))}function renderMSSSection(data){if(data.mss.enabled){var status=data.mss.enabled.isReachable;return _react2.default.createElement("div",null,_react2.default.createElement("h2",null,_mailpoet2.default.I18n.t("systemStatusMSSTitle")),renderStatusMessage(status,_mailpoet2.default.I18n.t("systemStatusMSSConnectionUnsuccessfulInfo"),!1))}}function SystemStatus(){var systemStatusData=window.systemStatusData;return _react2.default.createElement("div",null,_react2.default.createElement(_tabs2.default,{tab:"systemStatus"}),_react2.default.createElement("div",{className:"mailpoet_notice notice inline",style:{marginTop:"1em"}},_react2.default.createElement("p",null,systemStatusData.mss.enabled?_mailpoet2.default.I18n.t("systemStatusIntroCronMSS"):_mailpoet2.default.I18n.t("systemStatusIntroCron"))),renderCronSection(systemStatusData),renderMSSSection(systemStatusData),_react2.default.createElement(_cron_status2.default,{status_data:systemStatusData.cronStatus}),_react2.default.createElement(_queue_status2.default,{status_data:systemStatusData.queueStatus}))}var _mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),_cron_status=__webpack_require__(435),_cron_status2=_interopRequireDefault(_cron_status),_queue_status=__webpack_require__(437),_queue_status2=_interopRequireDefault(_queue_status),_tabs=__webpack_require__(188),_tabs2=_interopRequireDefault(_tabs);module.exports=SystemStatus},435:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_key_value_table=__webpack_require__(295),_key_value_table2=_interopRequireDefault(_key_value_table),_print_boolean=__webpack_require__(436),_print_boolean2=_interopRequireDefault(_print_boolean),CronStatus=function(props){var status=props.status_data,activeStatusMapping={active:_mailpoet2.default.I18n.t("running"),inactive:_mailpoet2.default.I18n.t("cronWaiting")};return _react2.default.createElement("div",null,_react2.default.createElement("h2",null,_mailpoet2.default.I18n.t("systemStatusCronStatusTitle")),_react2.default.createElement(_key_value_table2.default,{max_width:"400px",rows:[{key:_mailpoet2.default.I18n.t("accessible"),value:_react2.default.createElement(_print_boolean2.default,null,status.accessible)},{key:_mailpoet2.default.I18n.t("status"),value:activeStatusMapping[status.status]?activeStatusMapping[status.status]:_mailpoet2.default.I18n.t("unknown")},{key:_mailpoet2.default.I18n.t("lastUpdated"),value:status.updated_at?_mailpoet2.default.Date.full(1e3*status.updated_at):_mailpoet2.default.I18n.t("unknown")},{key:_mailpoet2.default.I18n.t("lastRunStarted"),value:status.run_accessed_at?_mailpoet2.default.Date.full(1e3*status.run_started_at):_mailpoet2.default.I18n.t("unknown")},{key:_mailpoet2.default.I18n.t("lastRunCompleted"),value:status.run_completed_at?_mailpoet2.default.Date.full(1e3*status.run_completed_at):_mailpoet2.default.I18n.t("unknown")},{key:_mailpoet2.default.I18n.t("lastSeenError"),value:status.last_error||_mailpoet2.default.I18n.t("none")}]}))};CronStatus.propTypes={status_data:_propTypes2.default.shape({accessible:_propTypes2.default.bool,status:_propTypes2.default.string,updated_at:_propTypes2.default.number,run_accessed_at:_propTypes2.default.number,run_completed_at:_propTypes2.default.number}).isRequired},CronStatus.defaultProps={status_data:{accessible:null,status:null,updated_at:null,run_accessed_at:null,run_completed_at:null}},module.exports=CronStatus},436:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),PrintBoolean=function(props){return _react2.default.createElement("span",null,!0===props.children&&props.truthy||!1===props.children&&props.falsy||props.unknown)};PrintBoolean.propTypes={truthy:_propTypes2.default.string,falsy:_propTypes2.default.string,unknown:_propTypes2.default.string,children:_propTypes2.default.bool},PrintBoolean.defaultProps={truthy:_mailpoet2.default.I18n.t("yes"),falsy:_mailpoet2.default.I18n.t("no"),unknown:_mailpoet2.default.I18n.t("unknown"),children:null},module.exports=PrintBoolean},437:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_key_value_table=__webpack_require__(295),_key_value_table2=_interopRequireDefault(_key_value_table),_tasks_list=__webpack_require__(438),_tasks_list2=_interopRequireDefault(_tasks_list),_tasks_list_data_row=__webpack_require__(296),_tasks_list_data_row2=_interopRequireDefault(_tasks_list_data_row),QueueStatus=function(props){var status=props.status_data;return _react2.default.createElement("div",null,_react2.default.createElement("h2",null,_mailpoet2.default.I18n.t("systemStatusQueueTitle")),_react2.default.createElement(_key_value_table2.default,{max_width:"400px",rows:[{key:_mailpoet2.default.I18n.t("status"),value:"paused"===status.status?_mailpoet2.default.I18n.t("paused"):_mailpoet2.default.I18n.t("running")},{key:_mailpoet2.default.I18n.t("startedAt"),value:status.started?_mailpoet2.default.Date.full(1e3*status.started):_mailpoet2.default.I18n.t("unknown")},{key:_mailpoet2.default.I18n.t("sentEmails"),value:status.sent||0},{key:_mailpoet2.default.I18n.t("retryAttempt"),value:status.retry_attempt||_mailpoet2.default.I18n.t("none")},{key:_mailpoet2.default.I18n.t("retryAt"),value:status.retry_at?_mailpoet2.default.Date.full(1e3*status.retry_at):_mailpoet2.default.I18n.t("none")},{key:_mailpoet2.default.I18n.t("error"),value:status.error?status.error.error_message:_mailpoet2.default.I18n.t("none")},{key:_mailpoet2.default.I18n.t("totalCompletedTasks"),value:status.tasksStatusCounts.completed},{key:_mailpoet2.default.I18n.t("totalRunningTasks"),value:status.tasksStatusCounts.running},{key:_mailpoet2.default.I18n.t("totalPausedTasks"),value:status.tasksStatusCounts.paused},{key:_mailpoet2.default.I18n.t("totalScheduledTasks"),value:status.tasksStatusCounts.scheduled}]}),_react2.default.createElement("h4",null,_mailpoet2.default.I18n.t("scheduledTasks")),_react2.default.createElement(_tasks_list2.default,{show_scheduled_at:!0,tasks:status.latestTasks.filter(function(task){return"scheduled"===task.status})}),_react2.default.createElement("h4",null,_mailpoet2.default.I18n.t("runningTasks")),_react2.default.createElement(_tasks_list2.default,{tasks:status.latestTasks.filter(function(task){return null===task.status})}),_react2.default.createElement("h4",null,_mailpoet2.default.I18n.t("completedTasks")),_react2.default.createElement(_tasks_list2.default,{tasks:status.latestTasks.filter(function(task){return"completed"===task.status})}))};QueueStatus.propTypes={status_data:_propTypes2.default.shape({status:_propTypes2.default.string,started:_propTypes2.default.number,sent:_propTypes2.default.number,retry_attempt:_propTypes2.default.number,retry_at:_propTypes2.default.number,error:_propTypes2.default.shape({operation:_propTypes2.default.string,error_message:_propTypes2.default.string}),tasksStatusCounts:_propTypes2.default.shape({completed:_propTypes2.default.number.isRequired,running:_propTypes2.default.number.isRequired,paused:_propTypes2.default.number.isRequired,scheduled:_propTypes2.default.number.isRequired}).isRequired,latestTasks:_propTypes2.default.arrayOf(_tasks_list_data_row2.default.propTypes.task).isRequired}).isRequired},QueueStatus.defaultProps={status_data:{status:null,started:null,sent:null,retry_attempt:null,retry_at:null,error:null}},module.exports=QueueStatus},438:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_tasks_list_data_row=__webpack_require__(296),_tasks_list_data_row2=_interopRequireDefault(_tasks_list_data_row),_tasks_list_labels_row=__webpack_require__(439),_tasks_list_labels_row2=_interopRequireDefault(_tasks_list_labels_row),TasksList=function(props){var colsCount=props.show_scheduled_at?6:5;return _react2.default.createElement("table",{className:"widefat fixed striped"},_react2.default.createElement("thead",null,_react2.default.createElement(_tasks_list_labels_row2.default,{show_scheduled_at:props.show_scheduled_at})),_react2.default.createElement("tbody",null,props.tasks.length?props.tasks.map(function(task){return _react2.default.createElement(_tasks_list_data_row2.default,{key:task.id,task:task,show_scheduled_at:props.show_scheduled_at})}):_react2.default.createElement("tr",{className:"no-items"},_react2.default.createElement("td",{colSpan:colsCount},_mailpoet2.default.I18n.t("nothingToShow")))),_react2.default.createElement("tfoot",null,_react2.default.createElement(_tasks_list_labels_row2.default,{show_scheduled_at:props.show_scheduled_at})))};TasksList.propTypes={show_scheduled_at:_propTypes2.default.bool,tasks:_propTypes2.default.arrayOf(_tasks_list_data_row2.default.propTypes.task).isRequired},TasksList.defaultProps={show_scheduled_at:!1},module.exports=TasksList},439:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),TasksListLabelsRow=function(props){return _react2.default.createElement("tr",null,_react2.default.createElement("th",{className:"row-title"},"Id"),_react2.default.createElement("th",{className:"row-title"},_mailpoet2.default.I18n.t("type")),_react2.default.createElement("th",{className:"row-title"},_mailpoet2.default.I18n.t("email")),_react2.default.createElement("th",{className:"row-title"},_mailpoet2.default.I18n.t("priority")),props.show_scheduled_at?_react2.default.createElement("th",{className:"row-title"},_mailpoet2.default.I18n.t("scheduledAt")):null,_react2.default.createElement("th",{className:"row-title"},_mailpoet2.default.I18n.t("updatedAt")))};TasksListLabelsRow.propTypes={show_scheduled_at:_propTypes2.default.bool},TasksListLabelsRow.defaultProps={show_scheduled_at:!1},module.exports=TasksListLabelsRow},440:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function YourPrivacy(){return _react2.default.createElement("div",null,_react2.default.createElement(_tabs2.default,{tab:"yourPrivacy"}),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("yourPrivacyContent1")),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("yourPrivacyContent2")),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("yourPrivacyContent3")),_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://www.mailpoet.com/privacy-notice/",className:"button button-primary"},_mailpoet2.default.I18n.t("yourPrivacyButton")))}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_tabs=__webpack_require__(188),_tabs2=_interopRequireDefault(_tabs);module.exports=YourPrivacy},441:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function Intro(){if(!(introActive||innerWidth<=960)){var intro=(0,_intro2.default)();intro.setOptions({steps:introSteps,nextLabel:_mailpoet2.default.I18n.t("introNext")+" →",prevLabel:"← "+_mailpoet2.default.I18n.t("introBack"),skipLabel:_mailpoet2.default.I18n.t("introSkip"),doneLabel:_mailpoet2.default.I18n.t("introDone"),positionPrecedence:["right","left","bottom","top"],buttonClass:"button",hidePrev:!0,hideNext:!0,helperElementPadding:12,scrollToElement:!1,showStepNumbers:!1,tooltipPosition:"auto"}),intro.onbeforechange(function(){var step=intro._currentStep,element=introSteps[step].element;intro._introItems[step].element="string"==typeof element?document.querySelector(element):element}),intro.onafterchange(function(targetElement){if("fixed"===getComputedStyle(targetElement).getPropertyValue("position")){var helperLayer=document.querySelector(".introjs-helperLayer"),referenceLayer=document.querySelector(".introjs-tooltipReferenceLayer");referenceLayer.style.top=parseInt(referenceLayer.style.top,10)-pageYOffset+"px",helperLayer.style.top=parseInt(helperLayer.style.top,10)-pageYOffset+"px"}}),intro.onexit(function(){introActive=!1,document.body.classList.remove("mailpoet-intro-active")}),intro.onskip(function(){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:{show_intro:0}})}),intro.start(),introActive=!0,document.body.classList.add("mailpoet-intro-active")}}var _intro=__webpack_require__(442),_intro2=_interopRequireDefault(_intro),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),introSteps=[{element:document.querySelector("#toplevel_page_mailpoet-newsletters > ul > li > a[href*=mailpoet-segments]").parentNode,intro:_mailpoet2.default.I18n.t("introLists")},{element:document.querySelector("#toplevel_page_mailpoet-newsletters > ul > li > a[href*=mailpoet-forms]").parentNode,intro:_mailpoet2.default.I18n.t("introForms")},{element:"#hs-beacon:not(.hs-beacon-hidden) iframe, .olark-launch-button",intro:_mailpoet2.default.I18n.t("introChat")},{element:"#mailpoet-new-email",intro:_mailpoet2.default.I18n.t("introEmails")}],introActive=!1;_mailpoet2.default.showIntro=Intro},442:function(module,exports,__webpack_require__){!function(f){module.exports=f(),module.exports.introJs=function(){return console.warn('Deprecated: please use require("intro.js") directly, instead of the introJs method of the function'),f().apply(this,arguments)}}(function(){function IntroJs(obj){this._targetElement=obj,this._introItems=[],this._options={nextLabel:"Next →",prevLabel:"← Back",skipLabel:"Skip",doneLabel:"Done",hidePrev:!1,hideNext:!1,tooltipPosition:"bottom",tooltipClass:"",highlightClass:"",exitOnEsc:!0,exitOnOverlayClick:!0,showStepNumbers:!0,keyboardNavigation:!0,showButtons:!0,showBullets:!0,showProgress:!1,scrollToElement:!0,scrollTo:"element",scrollPadding:30,overlayOpacity:.8,positionPrecedence:["bottom","top","right","left"],disableInteraction:!1,helperElementPadding:10,hintPosition:"top-middle",hintButtonLabel:"Got it",hintAnimation:!0,buttonClass:"introjs-button"}}function _introForElement(targetElm,group){var allIntroSteps=targetElm.querySelectorAll("*[data-intro]"),introItems=[];if(this._options.steps)_forEach(this._options.steps,function(step){var currentItem=_cloneObject(step);if(currentItem.step=introItems.length+1,"string"==typeof currentItem.element&&(currentItem.element=document.querySelector(currentItem.element)),void 0===currentItem.element||null===currentItem.element){var floatingElementQuery=document.querySelector(".introjsFloatingElement");null===floatingElementQuery&&(floatingElementQuery=document.createElement("div"),floatingElementQuery.className="introjsFloatingElement",document.body.appendChild(floatingElementQuery)),currentItem.element=floatingElementQuery,currentItem.position="floating"}currentItem.scrollTo=currentItem.scrollTo||this._options.scrollTo,void 0===currentItem.disableInteraction&&(currentItem.disableInteraction=this._options.disableInteraction),null!==currentItem.element&&introItems.push(currentItem)}.bind(this));else{var disableInteraction,elmsLength=allIntroSteps.length;if(elmsLength<1)return!1;_forEach(allIntroSteps,function(currentElement){if((!group||currentElement.getAttribute("data-intro-group")===group)&&"none"!==currentElement.style.display){var step=parseInt(currentElement.getAttribute("data-step"),10);disableInteraction=void 0!==currentElement.getAttribute("data-disable-interaction")?!!currentElement.getAttribute("data-disable-interaction"):this._options.disableInteraction,step>0&&(introItems[step-1]={element:currentElement,intro:currentElement.getAttribute("data-intro"),step:parseInt(currentElement.getAttribute("data-step"),10),tooltipClass:currentElement.getAttribute("data-tooltipclass"),highlightClass:currentElement.getAttribute("data-highlightclass"),position:currentElement.getAttribute("data-position")||this._options.tooltipPosition,scrollTo:currentElement.getAttribute("data-scrollto")||this._options.scrollTo,disableInteraction:disableInteraction})}}.bind(this));var nextStep=0;_forEach(allIntroSteps,function(currentElement){if((!group||currentElement.getAttribute("data-intro-group")===group)&&null===currentElement.getAttribute("data-step")){for(;;){if(void 0===introItems[nextStep])break;nextStep++}disableInteraction=void 0!==currentElement.getAttribute("data-disable-interaction")?!!currentElement.getAttribute("data-disable-interaction"):this._options.disableInteraction,introItems[nextStep]={element:currentElement,intro:currentElement.getAttribute("data-intro"),step:nextStep+1,tooltipClass:currentElement.getAttribute("data-tooltipclass"),highlightClass:currentElement.getAttribute("data-highlightclass"),position:currentElement.getAttribute("data-position")||this._options.tooltipPosition,scrollTo:currentElement.getAttribute("data-scrollto")||this._options.scrollTo,disableInteraction:disableInteraction}}}.bind(this))}for(var tempIntroItems=[],z=0;z<introItems.length;z++)introItems[z]&&tempIntroItems.push(introItems[z]);return introItems=tempIntroItems,introItems.sort(function(a,b){return a.step-b.step}),this._introItems=introItems,_addOverlayLayer.call(this,targetElm)&&(_nextStep.call(this),this._options.keyboardNavigation&&DOMEvent.on(window,"keydown",_onKeyDown,this,!0),DOMEvent.on(window,"resize",_onResize,this,!0)),!1}function _onResize(){this.refresh.call(this)}function _onKeyDown(e){var code=null===e.code?e.which:e.code;if(null===code&&(code=null===e.charCode?e.keyCode:e.charCode),"Escape"!==code&&27!==code||!0!==this._options.exitOnEsc){if("ArrowLeft"===code||37===code)_previousStep.call(this);else if("ArrowRight"===code||39===code)_nextStep.call(this);else if("Enter"===code||13===code){var target=e.target||e.srcElement;target&&target.className.match("introjs-prevbutton")?_previousStep.call(this):target&&target.className.match("introjs-skipbutton")?(this._introItems.length-1===this._currentStep&&"function"==typeof this._introCompleteCallback&&this._introCompleteCallback.call(this),_exitIntro.call(this,this._targetElement)):target&&target.getAttribute("data-stepnumber")?target.click():_nextStep.call(this),e.preventDefault?e.preventDefault():e.returnValue=!1}}else _exitIntro.call(this,this._targetElement)}function _cloneObject(object){if(null===object||"object"!=typeof object||void 0!==object.nodeType)return object;var temp={};for(var key in object)void 0!==window.jQuery&&object[key]instanceof window.jQuery?temp[key]=object[key]:temp[key]=_cloneObject(object[key]);return temp}function _goToStep(step){this._currentStep=step-2,void 0!==this._introItems&&_nextStep.call(this)}function _goToStepNumber(step){this._currentStepNumber=step,void 0!==this._introItems&&_nextStep.call(this)}function _nextStep(){this._direction="forward",void 0!==this._currentStepNumber&&_forEach(this._introItems,function(item,i){item.step===this._currentStepNumber&&(this._currentStep=i-1,this._currentStepNumber=void 0)}.bind(this)),void 0===this._currentStep?this._currentStep=0:++this._currentStep;var nextStep=this._introItems[this._currentStep],continueStep=!0;return void 0!==this._introBeforeChangeCallback&&(continueStep=this._introBeforeChangeCallback.call(this,nextStep.element)),!1===continueStep?(--this._currentStep,!1):this._introItems.length<=this._currentStep?("function"==typeof this._introCompleteCallback&&this._introCompleteCallback.call(this),void _exitIntro.call(this,this._targetElement)):void _showElement.call(this,nextStep)}function _previousStep(){if(this._direction="backward",0===this._currentStep)return!1;--this._currentStep;var nextStep=this._introItems[this._currentStep],continueStep=!0;if(void 0!==this._introBeforeChangeCallback&&(continueStep=this._introBeforeChangeCallback.call(this,nextStep.element)),!1===continueStep)return++this._currentStep,!1;_showElement.call(this,nextStep)}function _refresh(){if(_setHelperLayerPosition.call(this,document.querySelector(".introjs-helperLayer")),_setHelperLayerPosition.call(this,document.querySelector(".introjs-tooltipReferenceLayer")),_setHelperLayerPosition.call(this,document.querySelector(".introjs-disableInteraction")),void 0!==this._currentStep&&null!==this._currentStep){var oldHelperNumberLayer=document.querySelector(".introjs-helperNumberLayer"),oldArrowLayer=document.querySelector(".introjs-arrow"),oldtooltipContainer=document.querySelector(".introjs-tooltip");_placeTooltip.call(this,this._introItems[this._currentStep].element,oldtooltipContainer,oldArrowLayer,oldHelperNumberLayer)}return _reAlignHints.call(this),this}function _exitIntro(targetElement,force){var continueExit=!0;if(void 0!==this._introBeforeExitCallback&&(continueExit=this._introBeforeExitCallback.call(this)),force||!1!==continueExit){var overlayLayers=targetElement.querySelectorAll(".introjs-overlay");overlayLayers&&overlayLayers.length&&_forEach(overlayLayers,function(overlayLayer){overlayLayer.style.opacity=0,window.setTimeout(function(){this.parentNode&&this.parentNode.removeChild(this)}.bind(overlayLayer),500)}.bind(this));var helperLayer=targetElement.querySelector(".introjs-helperLayer");helperLayer&&helperLayer.parentNode.removeChild(helperLayer);var referenceLayer=targetElement.querySelector(".introjs-tooltipReferenceLayer");referenceLayer&&referenceLayer.parentNode.removeChild(referenceLayer);var disableInteractionLayer=targetElement.querySelector(".introjs-disableInteraction");disableInteractionLayer&&disableInteractionLayer.parentNode.removeChild(disableInteractionLayer);var floatingElement=document.querySelector(".introjsFloatingElement");floatingElement&&floatingElement.parentNode.removeChild(floatingElement),_removeShowElement();_forEach(document.querySelectorAll(".introjs-fixParent"),function(parent){_removeClass(parent,/introjs-fixParent/g)}),DOMEvent.off(window,"keydown",_onKeyDown,this,!0),DOMEvent.off(window,"resize",_onResize,this,!0),void 0!==this._introExitCallback&&this._introExitCallback.call(this),this._currentStep=void 0}}function _placeTooltip(targetElement,tooltipLayer,arrowLayer,helperNumberLayer,hintMode){var currentStepObj,tooltipOffset,targetOffset,windowSize,currentTooltipPosition,tooltipCssClass="";if(hintMode=hintMode||!1,tooltipLayer.style.top=null,tooltipLayer.style.right=null,tooltipLayer.style.bottom=null,tooltipLayer.style.left=null,tooltipLayer.style.marginLeft=null,tooltipLayer.style.marginTop=null,arrowLayer.style.display="inherit",void 0!==helperNumberLayer&&null!==helperNumberLayer&&(helperNumberLayer.style.top=null,helperNumberLayer.style.left=null),this._introItems[this._currentStep]){currentStepObj=this._introItems[this._currentStep],tooltipCssClass="string"==typeof currentStepObj.tooltipClass?currentStepObj.tooltipClass:this._options.tooltipClass,tooltipLayer.className=("introjs-tooltip "+tooltipCssClass).replace(/^\s+|\s+$/g,""),tooltipLayer.setAttribute("role","dialog"),currentTooltipPosition=this._introItems[this._currentStep].position,"floating"!==currentTooltipPosition&&(currentTooltipPosition=_determineAutoPosition.call(this,targetElement,tooltipLayer,currentTooltipPosition));var tooltipLayerStyleLeft;switch(targetOffset=_getOffset(targetElement),tooltipOffset=_getOffset(tooltipLayer),windowSize=_getWinSize(),_addClass(tooltipLayer,"introjs-"+currentTooltipPosition),currentTooltipPosition){case"top-right-aligned":arrowLayer.className="introjs-arrow bottom-right";var tooltipLayerStyleRight=0;_checkLeft(targetOffset,tooltipLayerStyleRight,tooltipOffset,tooltipLayer),tooltipLayer.style.bottom=targetOffset.height+20+"px";break;case"top-middle-aligned":arrowLayer.className="introjs-arrow bottom-middle";var tooltipLayerStyleLeftRight=targetOffset.width/2-tooltipOffset.width/2;hintMode&&(tooltipLayerStyleLeftRight+=5),_checkLeft(targetOffset,tooltipLayerStyleLeftRight,tooltipOffset,tooltipLayer)&&(tooltipLayer.style.right=null,_checkRight(targetOffset,tooltipLayerStyleLeftRight,tooltipOffset,windowSize,tooltipLayer)),tooltipLayer.style.bottom=targetOffset.height+20+"px";break;case"top-left-aligned":case"top":arrowLayer.className="introjs-arrow bottom",tooltipLayerStyleLeft=hintMode?0:15,_checkRight(targetOffset,tooltipLayerStyleLeft,tooltipOffset,windowSize,tooltipLayer),tooltipLayer.style.bottom=targetOffset.height+20+"px";break;case"right":tooltipLayer.style.left=targetOffset.width+20+"px",targetOffset.top+tooltipOffset.height>windowSize.height?(arrowLayer.className="introjs-arrow left-bottom",tooltipLayer.style.top="-"+(tooltipOffset.height-targetOffset.height-20)+"px"):arrowLayer.className="introjs-arrow left";break;case"left":hintMode||!0!==this._options.showStepNumbers||(tooltipLayer.style.top="15px"),targetOffset.top+tooltipOffset.height>windowSize.height?(tooltipLayer.style.top="-"+(tooltipOffset.height-targetOffset.height-20)+"px",arrowLayer.className="introjs-arrow right-bottom"):arrowLayer.className="introjs-arrow right",tooltipLayer.style.right=targetOffset.width+20+"px";break;case"floating":arrowLayer.style.display="none",tooltipLayer.style.left="50%",tooltipLayer.style.top="50%",tooltipLayer.style.marginLeft="-"+tooltipOffset.width/2+"px",tooltipLayer.style.marginTop="-"+tooltipOffset.height/2+"px",void 0!==helperNumberLayer&&null!==helperNumberLayer&&(helperNumberLayer.style.left="-"+(tooltipOffset.width/2+18)+"px",helperNumberLayer.style.top="-"+(tooltipOffset.height/2+18)+"px");break;case"bottom-right-aligned":arrowLayer.className="introjs-arrow top-right",tooltipLayerStyleRight=0,_checkLeft(targetOffset,tooltipLayerStyleRight,tooltipOffset,tooltipLayer),tooltipLayer.style.top=targetOffset.height+20+"px";break;case"bottom-middle-aligned":arrowLayer.className="introjs-arrow top-middle",tooltipLayerStyleLeftRight=targetOffset.width/2-tooltipOffset.width/2,hintMode&&(tooltipLayerStyleLeftRight+=5),_checkLeft(targetOffset,tooltipLayerStyleLeftRight,tooltipOffset,tooltipLayer)&&(tooltipLayer.style.right=null,_checkRight(targetOffset,tooltipLayerStyleLeftRight,tooltipOffset,windowSize,tooltipLayer)),tooltipLayer.style.top=targetOffset.height+20+"px";break;default:arrowLayer.className="introjs-arrow top",tooltipLayerStyleLeft=0,_checkRight(targetOffset,tooltipLayerStyleLeft,tooltipOffset,windowSize,tooltipLayer),tooltipLayer.style.top=targetOffset.height+20+"px"}}}function _checkRight(targetOffset,tooltipLayerStyleLeft,tooltipOffset,windowSize,tooltipLayer){return targetOffset.left+tooltipLayerStyleLeft+tooltipOffset.width>windowSize.width?(tooltipLayer.style.left=windowSize.width-tooltipOffset.width-targetOffset.left+"px",!1):(tooltipLayer.style.left=tooltipLayerStyleLeft+"px",!0)}function _checkLeft(targetOffset,tooltipLayerStyleRight,tooltipOffset,tooltipLayer){return targetOffset.left+targetOffset.width-tooltipLayerStyleRight-tooltipOffset.width<0?(tooltipLayer.style.left=-targetOffset.left+"px",!1):(tooltipLayer.style.right=tooltipLayerStyleRight+"px",!0)}function _determineAutoPosition(targetElement,tooltipLayer,desiredTooltipPosition){var possiblePositions=this._options.positionPrecedence.slice(),windowSize=_getWinSize(),tooltipHeight=_getOffset(tooltipLayer).height+10,tooltipWidth=_getOffset(tooltipLayer).width+20,targetElementRect=targetElement.getBoundingClientRect(),calculatedPosition="floating";targetElementRect.bottom+tooltipHeight+tooltipHeight>windowSize.height&&_removeEntry(possiblePositions,"bottom"),targetElementRect.top-tooltipHeight<0&&_removeEntry(possiblePositions,"top"),targetElementRect.right+tooltipWidth>windowSize.width&&_removeEntry(possiblePositions,"right"),targetElementRect.left-tooltipWidth<0&&_removeEntry(possiblePositions,"left");var desiredAlignment=function(pos){var hyphenIndex=pos.indexOf("-");return-1!==hyphenIndex?pos.substr(hyphenIndex):""}(desiredTooltipPosition||"");return desiredTooltipPosition&&(desiredTooltipPosition=desiredTooltipPosition.split("-")[0]),possiblePositions.length&&(calculatedPosition="auto"!==desiredTooltipPosition&&possiblePositions.indexOf(desiredTooltipPosition)>-1?desiredTooltipPosition:possiblePositions[0]),-1!==["top","bottom"].indexOf(calculatedPosition)&&(calculatedPosition+=_determineAutoAlignment(targetElementRect.left,tooltipWidth,windowSize,desiredAlignment)),calculatedPosition}function _determineAutoAlignment(offsetLeft,tooltipWidth,windowSize,desiredAlignment){var halfTooltipWidth=tooltipWidth/2,winWidth=Math.min(windowSize.width,window.screen.width),possibleAlignments=["-left-aligned","-middle-aligned","-right-aligned"];return winWidth-offsetLeft<tooltipWidth&&_removeEntry(possibleAlignments,"-left-aligned"),(offsetLeft<halfTooltipWidth||winWidth-offsetLeft<halfTooltipWidth)&&_removeEntry(possibleAlignments,"-middle-aligned"),offsetLeft<tooltipWidth&&_removeEntry(possibleAlignments,"-right-aligned"),possibleAlignments.length?-1!==possibleAlignments.indexOf(desiredAlignment)?desiredAlignment:possibleAlignments[0]:"-middle-aligned"}function _removeEntry(stringArray,stringToRemove){stringArray.indexOf(stringToRemove)>-1&&stringArray.splice(stringArray.indexOf(stringToRemove),1)}function _setHelperLayerPosition(helperLayer){if(helperLayer){if(!this._introItems[this._currentStep])return;var currentElement=this._introItems[this._currentStep],elementPosition=_getOffset(currentElement.element),widthHeightPadding=this._options.helperElementPadding;_isFixed(currentElement.element)?_addClass(helperLayer,"introjs-fixedTooltip"):_removeClass(helperLayer,"introjs-fixedTooltip"),"floating"===currentElement.position&&(widthHeightPadding=0),helperLayer.style.cssText="width: "+(elementPosition.width+widthHeightPadding)+"px; height:"+(elementPosition.height+widthHeightPadding)+"px; top:"+(elementPosition.top-widthHeightPadding/2)+"px;left: "+(elementPosition.left-widthHeightPadding/2)+"px;"}}function _disableInteraction(){var disableInteractionLayer=document.querySelector(".introjs-disableInteraction");null===disableInteractionLayer&&(disableInteractionLayer=document.createElement("div"),disableInteractionLayer.className="introjs-disableInteraction",this._targetElement.appendChild(disableInteractionLayer)),_setHelperLayerPosition.call(this,disableInteractionLayer)}function _setAnchorAsButton(anchor){anchor.setAttribute("role","button"),anchor.tabIndex=0}function _showElement(targetElement){void 0!==this._introChangeCallback&&this._introChangeCallback.call(this,targetElement.element);var nextTooltipButton,prevTooltipButton,skipTooltipButton,scrollParent,self=this,oldHelperLayer=document.querySelector(".introjs-helperLayer"),oldReferenceLayer=document.querySelector(".introjs-tooltipReferenceLayer"),highlightClass="introjs-helperLayer";if("string"==typeof targetElement.highlightClass&&(highlightClass+=" "+targetElement.highlightClass),"string"==typeof this._options.highlightClass&&(highlightClass+=" "+this._options.highlightClass),null!==oldHelperLayer){var oldHelperNumberLayer=oldReferenceLayer.querySelector(".introjs-helperNumberLayer"),oldtooltipLayer=oldReferenceLayer.querySelector(".introjs-tooltiptext"),oldArrowLayer=oldReferenceLayer.querySelector(".introjs-arrow"),oldtooltipContainer=oldReferenceLayer.querySelector(".introjs-tooltip");if(skipTooltipButton=oldReferenceLayer.querySelector(".introjs-skipbutton"),prevTooltipButton=oldReferenceLayer.querySelector(".introjs-prevbutton"),nextTooltipButton=oldReferenceLayer.querySelector(".introjs-nextbutton"),oldHelperLayer.className=highlightClass,oldtooltipContainer.style.opacity=0,oldtooltipContainer.style.display="none",null!==oldHelperNumberLayer){var lastIntroItem=this._introItems[targetElement.step-2>=0?targetElement.step-2:0];(null!==lastIntroItem&&"forward"===this._direction&&"floating"===lastIntroItem.position||"backward"===this._direction&&"floating"===targetElement.position)&&(oldHelperNumberLayer.style.opacity=0)}scrollParent=_getScrollParent(targetElement.element),scrollParent!==document.body&&_scrollParentToElement(scrollParent,targetElement.element),_setHelperLayerPosition.call(self,oldHelperLayer),_setHelperLayerPosition.call(self,oldReferenceLayer);_forEach(document.querySelectorAll(".introjs-fixParent"),function(parent){_removeClass(parent,/introjs-fixParent/g)}),_removeShowElement(),self._lastShowElementTimer&&window.clearTimeout(self._lastShowElementTimer),self._lastShowElementTimer=window.setTimeout(function(){null!==oldHelperNumberLayer&&(oldHelperNumberLayer.innerHTML=targetElement.step),oldtooltipLayer.innerHTML=targetElement.intro,oldtooltipContainer.style.display="block",_placeTooltip.call(self,targetElement.element,oldtooltipContainer,oldArrowLayer,oldHelperNumberLayer),self._options.showBullets&&(oldReferenceLayer.querySelector(".introjs-bullets li > a.active").className="",oldReferenceLayer.querySelector('.introjs-bullets li > a[data-stepnumber="'+targetElement.step+'"]').className="active"),oldReferenceLayer.querySelector(".introjs-progress .introjs-progressbar").style.cssText="width:"+_getProgress.call(self)+"%;",oldReferenceLayer.querySelector(".introjs-progress .introjs-progressbar").setAttribute("aria-valuenow",_getProgress.call(self)),oldtooltipContainer.style.opacity=1,oldHelperNumberLayer&&(oldHelperNumberLayer.style.opacity=1),void 0!==skipTooltipButton&&null!==skipTooltipButton&&/introjs-donebutton/gi.test(skipTooltipButton.className)?skipTooltipButton.focus():void 0!==nextTooltipButton&&null!==nextTooltipButton&&nextTooltipButton.focus(),_scrollTo.call(self,targetElement.scrollTo,targetElement,oldtooltipLayer)},350)}else{var helperLayer=document.createElement("div"),referenceLayer=document.createElement("div"),arrowLayer=document.createElement("div"),tooltipLayer=document.createElement("div"),tooltipTextLayer=document.createElement("div"),bulletsLayer=document.createElement("div"),progressLayer=document.createElement("div"),buttonsLayer=document.createElement("div");helperLayer.className=highlightClass,referenceLayer.className="introjs-tooltipReferenceLayer",scrollParent=_getScrollParent(targetElement.element),scrollParent!==document.body&&_scrollParentToElement(scrollParent,targetElement.element),_setHelperLayerPosition.call(self,helperLayer),_setHelperLayerPosition.call(self,referenceLayer),this._targetElement.appendChild(helperLayer),this._targetElement.appendChild(referenceLayer),arrowLayer.className="introjs-arrow",tooltipTextLayer.className="introjs-tooltiptext",tooltipTextLayer.innerHTML=targetElement.intro,bulletsLayer.className="introjs-bullets",!1===this._options.showBullets&&(bulletsLayer.style.display="none");var ulContainer=document.createElement("ul");ulContainer.setAttribute("role","tablist");var anchorClick=function(){self.goToStep(this.getAttribute("data-stepnumber"))};_forEach(this._introItems,function(item,i){var innerLi=document.createElement("li"),anchorLink=document.createElement("a");innerLi.setAttribute("role","presentation"),anchorLink.setAttribute("role","tab"),anchorLink.onclick=anchorClick,i===targetElement.step-1&&(anchorLink.className="active"),_setAnchorAsButton(anchorLink),anchorLink.innerHTML=" ",anchorLink.setAttribute("data-stepnumber",item.step),innerLi.appendChild(anchorLink),ulContainer.appendChild(innerLi)}),bulletsLayer.appendChild(ulContainer),progressLayer.className="introjs-progress",!1===this._options.showProgress&&(progressLayer.style.display="none");var progressBar=document.createElement("div");progressBar.className="introjs-progressbar",progressBar.setAttribute("role","progress"),progressBar.setAttribute("aria-valuemin",0),progressBar.setAttribute("aria-valuemax",100),progressBar.setAttribute("aria-valuenow",_getProgress.call(this)),progressBar.style.cssText="width:"+_getProgress.call(this)+"%;",progressLayer.appendChild(progressBar),buttonsLayer.className="introjs-tooltipbuttons",!1===this._options.showButtons&&(buttonsLayer.style.display="none"),tooltipLayer.className="introjs-tooltip",tooltipLayer.appendChild(tooltipTextLayer),tooltipLayer.appendChild(bulletsLayer),tooltipLayer.appendChild(progressLayer);var helperNumberLayer=document.createElement("span");!0===this._options.showStepNumbers&&(helperNumberLayer.className="introjs-helperNumberLayer",helperNumberLayer.innerHTML=targetElement.step,referenceLayer.appendChild(helperNumberLayer)),tooltipLayer.appendChild(arrowLayer),referenceLayer.appendChild(tooltipLayer),nextTooltipButton=document.createElement("a"),nextTooltipButton.onclick=function(){self._introItems.length-1!==self._currentStep&&_nextStep.call(self)},_setAnchorAsButton(nextTooltipButton),nextTooltipButton.innerHTML=this._options.nextLabel,prevTooltipButton=document.createElement("a"),prevTooltipButton.onclick=function(){0!==self._currentStep&&_previousStep.call(self)},_setAnchorAsButton(prevTooltipButton),prevTooltipButton.innerHTML=this._options.prevLabel,skipTooltipButton=document.createElement("a"),skipTooltipButton.className=this._options.buttonClass+" introjs-skipbutton ",_setAnchorAsButton(skipTooltipButton),skipTooltipButton.innerHTML=this._options.skipLabel,skipTooltipButton.onclick=function(){self._introItems.length-1===self._currentStep&&"function"==typeof self._introCompleteCallback&&self._introCompleteCallback.call(self),self._introItems.length-1!==self._currentStep&&"function"==typeof self._introExitCallback&&self._introExitCallback.call(self),self._introSkipCallback.call(self),_exitIntro.call(self,self._targetElement)},buttonsLayer.appendChild(skipTooltipButton),this._introItems.length>1&&(buttonsLayer.appendChild(prevTooltipButton),buttonsLayer.appendChild(nextTooltipButton)),tooltipLayer.appendChild(buttonsLayer),_placeTooltip.call(self,targetElement.element,tooltipLayer,arrowLayer,helperNumberLayer),_scrollTo.call(this,targetElement.scrollTo,targetElement,tooltipLayer)}var disableInteractionLayer=self._targetElement.querySelector(".introjs-disableInteraction");disableInteractionLayer&&disableInteractionLayer.parentNode.removeChild(disableInteractionLayer),targetElement.disableInteraction&&_disableInteraction.call(self),0===this._currentStep&&this._introItems.length>1?(void 0!==skipTooltipButton&&null!==skipTooltipButton&&(skipTooltipButton.className=this._options.buttonClass+" introjs-skipbutton"),void 0!==nextTooltipButton&&null!==nextTooltipButton&&(nextTooltipButton.className=this._options.buttonClass+" introjs-nextbutton"),!0===this._options.hidePrev?(void 0!==prevTooltipButton&&null!==prevTooltipButton&&(prevTooltipButton.className=this._options.buttonClass+" introjs-prevbutton introjs-hidden"),void 0!==nextTooltipButton&&null!==nextTooltipButton&&_addClass(nextTooltipButton,"introjs-fullbutton")):void 0!==prevTooltipButton&&null!==prevTooltipButton&&(prevTooltipButton.className=this._options.buttonClass+" introjs-prevbutton introjs-disabled"),void 0!==skipTooltipButton&&null!==skipTooltipButton&&(skipTooltipButton.innerHTML=this._options.skipLabel)):this._introItems.length-1===this._currentStep||1===this._introItems.length?(void 0!==skipTooltipButton&&null!==skipTooltipButton&&(skipTooltipButton.innerHTML=this._options.doneLabel,_addClass(skipTooltipButton,"introjs-donebutton")),void 0!==prevTooltipButton&&null!==prevTooltipButton&&(prevTooltipButton.className=this._options.buttonClass+" introjs-prevbutton"),!0===this._options.hideNext?(void 0!==nextTooltipButton&&null!==nextTooltipButton&&(nextTooltipButton.className=this._options.buttonClass+" introjs-nextbutton introjs-hidden"),void 0!==prevTooltipButton&&null!==prevTooltipButton&&_addClass(prevTooltipButton,"introjs-fullbutton")):void 0!==nextTooltipButton&&null!==nextTooltipButton&&(nextTooltipButton.className=this._options.buttonClass+" introjs-nextbutton introjs-disabled")):(void 0!==skipTooltipButton&&null!==skipTooltipButton&&(skipTooltipButton.className=this._options.buttonClass+" introjs-skipbutton"),void 0!==prevTooltipButton&&null!==prevTooltipButton&&(prevTooltipButton.className=this._options.buttonClass+" introjs-prevbutton"),void 0!==nextTooltipButton&&null!==nextTooltipButton&&(nextTooltipButton.className=this._options.buttonClass+" introjs-nextbutton"),void 0!==skipTooltipButton&&null!==skipTooltipButton&&(skipTooltipButton.innerHTML=this._options.skipLabel)),prevTooltipButton.setAttribute("role","button"),nextTooltipButton.setAttribute("role","button"),skipTooltipButton.setAttribute("role","button"),void 0!==nextTooltipButton&&null!==nextTooltipButton&&nextTooltipButton.focus(),_setShowElement(targetElement),void 0!==this._introAfterChangeCallback&&this._introAfterChangeCallback.call(this,targetElement.element)}function _scrollTo(scrollTo,targetElement,tooltipLayer){if("off"!==scrollTo){var rect;if(this._options.scrollToElement&&(rect="tooltip"===scrollTo?tooltipLayer.getBoundingClientRect():targetElement.element.getBoundingClientRect(),!_elementInViewport(targetElement.element))){var winHeight=_getWinSize().height;rect.bottom-(rect.bottom-rect.top)<0||targetElement.element.clientHeight>winHeight?window.scrollBy(0,rect.top-(winHeight/2-rect.height/2)-this._options.scrollPadding):window.scrollBy(0,rect.top-(winHeight/2-rect.height/2)+this._options.scrollPadding)}}}function _removeShowElement(){_forEach(document.querySelectorAll(".introjs-showElement"),function(elm){_removeClass(elm,/introjs-[a-zA-Z]+/g)})}function _setShowElement(targetElement){var parentElm;if(targetElement.element instanceof SVGElement)for(parentElm=targetElement.element.parentNode;null!==targetElement.element.parentNode&&parentElm.tagName&&"body"!==parentElm.tagName.toLowerCase();)"svg"===parentElm.tagName.toLowerCase()&&_addClass(parentElm,"introjs-showElement introjs-relativePosition"),parentElm=parentElm.parentNode;_addClass(targetElement.element,"introjs-showElement");var currentElementPosition=_getPropValue(targetElement.element,"position");for("absolute"!==currentElementPosition&&"relative"!==currentElementPosition&&"fixed"!==currentElementPosition&&_addClass(targetElement.element,"introjs-relativePosition"),parentElm=targetElement.element.parentNode;null!==parentElm&&parentElm.tagName&&"body"!==parentElm.tagName.toLowerCase();){var zIndex=_getPropValue(parentElm,"z-index"),opacity=parseFloat(_getPropValue(parentElm,"opacity")),transform=_getPropValue(parentElm,"transform")||_getPropValue(parentElm,"-webkit-transform")||_getPropValue(parentElm,"-moz-transform")||_getPropValue(parentElm,"-ms-transform")||_getPropValue(parentElm,"-o-transform");(/[0-9]+/.test(zIndex)||opacity<1||"none"!==transform&&void 0!==transform)&&_addClass(parentElm,"introjs-fixParent"),parentElm=parentElm.parentNode}}function _forEach(arr,forEachFnc,completeFnc){if(arr)for(var i=0,len=arr.length;i<len;i++)forEachFnc(arr[i],i);"function"==typeof completeFnc&&completeFnc()}function _addClass(element,className){if(element instanceof SVGElement){var pre=element.getAttribute("class")||"";element.setAttribute("class",pre+" "+className)}else if(void 0!==element.classList){var classes=className.split(" ");_forEach(classes,function(cls){element.classList.add(cls)})}else element.className.match(className)||(element.className+=" "+className)}function _removeClass(element,classNameRegex){if(element instanceof SVGElement){var pre=element.getAttribute("class")||"";element.setAttribute("class",pre.replace(classNameRegex,"").replace(/^\s+|\s+$/g,""))}else element.className=element.className.replace(classNameRegex,"").replace(/^\s+|\s+$/g,"")}function _getPropValue(element,propName){var propValue="";return element.currentStyle?propValue=element.currentStyle[propName]:document.defaultView&&document.defaultView.getComputedStyle&&(propValue=document.defaultView.getComputedStyle(element,null).getPropertyValue(propName)),propValue&&propValue.toLowerCase?propValue.toLowerCase():propValue}function _isFixed(element){var p=element.parentNode;return!(!p||"HTML"===p.nodeName)&&("fixed"===_getPropValue(element,"position")||_isFixed(p))}function _getWinSize(){if(void 0!==window.innerWidth)return{width:window.innerWidth,height:window.innerHeight};var D=document.documentElement;return{width:D.clientWidth,height:D.clientHeight}}function _elementInViewport(el){var rect=el.getBoundingClientRect();return rect.top>=0&&rect.left>=0&&rect.bottom+80<=window.innerHeight&&rect.right<=window.innerWidth}function _addOverlayLayer(targetElm){var overlayLayer=document.createElement("div"),styleText="",self=this;if(overlayLayer.className="introjs-overlay",targetElm.tagName&&"body"!==targetElm.tagName.toLowerCase()){var elementPosition=_getOffset(targetElm);elementPosition&&(styleText+="width: "+elementPosition.width+"px; height:"+elementPosition.height+"px; top:"+elementPosition.top+"px;left: "+elementPosition.left+"px;",overlayLayer.style.cssText=styleText)}else styleText+="top: 0;bottom: 0; left: 0;right: 0;position: fixed;",overlayLayer.style.cssText=styleText;return targetElm.appendChild(overlayLayer),overlayLayer.onclick=function(){!0===self._options.exitOnOverlayClick&&_exitIntro.call(self,targetElm)},window.setTimeout(function(){styleText+="opacity: "+self._options.overlayOpacity.toString()+";",overlayLayer.style.cssText=styleText},10),!0}function _removeHintTooltip(){var tooltip=document.querySelector(".introjs-hintReference");if(tooltip){var step=tooltip.getAttribute("data-step");return tooltip.parentNode.removeChild(tooltip),step}}function _populateHints(targetElm){if(this._introItems=[],this._options.hints)_forEach(this._options.hints,function(hint){var currentItem=_cloneObject(hint);"string"==typeof currentItem.element&&(currentItem.element=document.querySelector(currentItem.element)),currentItem.hintPosition=currentItem.hintPosition||this._options.hintPosition,currentItem.hintAnimation=currentItem.hintAnimation||this._options.hintAnimation,null!==currentItem.element&&this._introItems.push(currentItem)}.bind(this));else{var hints=targetElm.querySelectorAll("*[data-hint]");if(!hints||!hints.length)return!1;_forEach(hints,function(currentElement){var hintAnimation=currentElement.getAttribute("data-hintanimation");hintAnimation=hintAnimation?"true"===hintAnimation:this._options.hintAnimation,this._introItems.push({element:currentElement,hint:currentElement.getAttribute("data-hint"),hintPosition:currentElement.getAttribute("data-hintposition")||this._options.hintPosition,hintAnimation:hintAnimation,tooltipClass:currentElement.getAttribute("data-tooltipclass"),position:currentElement.getAttribute("data-position")||this._options.tooltipPosition})}.bind(this))}_addHints.call(this),DOMEvent.on(document,"click",_removeHintTooltip,this,!1),DOMEvent.on(window,"resize",_reAlignHints,this,!0)}function _reAlignHints(){_forEach(this._introItems,function(item){void 0!==item.targetElement&&_alignHintPosition.call(this,item.hintPosition,item.element,item.targetElement)}.bind(this))}function _hintQuerySelectorAll(selector){var hintsWrapper=document.querySelector(".introjs-hints");return hintsWrapper?hintsWrapper.querySelectorAll(selector):[]}function _hideHint(stepId){var hint=_hintQuerySelectorAll('.introjs-hint[data-step="'+stepId+'"]')[0];_removeHintTooltip.call(this),hint&&_addClass(hint,"introjs-hidehint"),void 0!==this._hintCloseCallback&&this._hintCloseCallback.call(this,stepId)}function _hideHints(){_forEach(_hintQuerySelectorAll(".introjs-hint"),function(hint){_hideHint.call(this,hint.getAttribute("data-step"))}.bind(this))}function _showHints(){var hints=_hintQuerySelectorAll(".introjs-hint");hints&&hints.length?_forEach(hints,function(hint){_showHint.call(this,hint.getAttribute("data-step"))}.bind(this)):_populateHints.call(this,this._targetElement)}function _showHint(stepId){var hint=_hintQuerySelectorAll('.introjs-hint[data-step="'+stepId+'"]')[0];hint&&_removeClass(hint,/introjs-hidehint/g)}function _removeHints(){_forEach(_hintQuerySelectorAll(".introjs-hint"),function(hint){_removeHint.call(this,hint.getAttribute("data-step"))}.bind(this))}function _removeHint(stepId){var hint=_hintQuerySelectorAll('.introjs-hint[data-step="'+stepId+'"]')[0];hint&&hint.parentNode.removeChild(hint)}function _addHints(){var self=this,hintsWrapper=document.querySelector(".introjs-hints");null===hintsWrapper&&(hintsWrapper=document.createElement("div"),hintsWrapper.className="introjs-hints");var getHintClick=function(i){return function(e){var evt=e||window.event;evt.stopPropagation&&evt.stopPropagation(),null!==evt.cancelBubble&&(evt.cancelBubble=!0),_showHintDialog.call(self,i)}};_forEach(this._introItems,function(item,i){if(!document.querySelector('.introjs-hint[data-step="'+i+'"]')){var hint=document.createElement("a");_setAnchorAsButton(hint),hint.onclick=getHintClick(i),hint.className="introjs-hint",item.hintAnimation||_addClass(hint,"introjs-hint-no-anim"),_isFixed(item.element)&&_addClass(hint,"introjs-fixedhint");var hintDot=document.createElement("div");hintDot.className="introjs-hint-dot";var hintPulse=document.createElement("div");hintPulse.className="introjs-hint-pulse",hint.appendChild(hintDot),hint.appendChild(hintPulse),hint.setAttribute("data-step",i),item.targetElement=item.element,item.element=hint,_alignHintPosition.call(this,item.hintPosition,hint,item.targetElement),hintsWrapper.appendChild(hint)}}.bind(this)),document.body.appendChild(hintsWrapper),void 0!==this._hintsAddedCallback&&this._hintsAddedCallback.call(this)}function _alignHintPosition(position,hint,element){var offset=_getOffset.call(this,element);switch(position){default:case"top-left":hint.style.left=offset.left+"px",hint.style.top=offset.top+"px";break;case"top-right":hint.style.left=offset.left+offset.width-20+"px",hint.style.top=offset.top+"px";break;case"bottom-left":hint.style.left=offset.left+"px",hint.style.top=offset.top+offset.height-20+"px";break;case"bottom-right":hint.style.left=offset.left+offset.width-20+"px",hint.style.top=offset.top+offset.height-20+"px";break;case"middle-left":hint.style.left=offset.left+"px",hint.style.top=offset.top+(offset.height-20)/2+"px";break;case"middle-right":hint.style.left=offset.left+offset.width-20+"px",hint.style.top=offset.top+(offset.height-20)/2+"px";break;case"middle-middle":hint.style.left=offset.left+(offset.width-20)/2+"px",hint.style.top=offset.top+(offset.height-20)/2+"px";break;case"bottom-middle":hint.style.left=offset.left+(offset.width-20)/2+"px",hint.style.top=offset.top+offset.height-20+"px";break;case"top-middle":hint.style.left=offset.left+(offset.width-20)/2+"px",hint.style.top=offset.top+"px"}}function _showHintDialog(stepId){var hintElement=document.querySelector('.introjs-hint[data-step="'+stepId+'"]'),item=this._introItems[stepId];void 0!==this._hintClickCallback&&this._hintClickCallback.call(this,hintElement,item,stepId);var removedStep=_removeHintTooltip.call(this);if(parseInt(removedStep,10)!==stepId){var tooltipLayer=document.createElement("div"),tooltipTextLayer=document.createElement("div"),arrowLayer=document.createElement("div"),referenceLayer=document.createElement("div");tooltipLayer.className="introjs-tooltip",tooltipLayer.onclick=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},tooltipTextLayer.className="introjs-tooltiptext";var tooltipWrapper=document.createElement("p");tooltipWrapper.innerHTML=item.hint;var closeButton=document.createElement("a");closeButton.className=this._options.buttonClass,closeButton.setAttribute("role","button"),closeButton.innerHTML=this._options.hintButtonLabel,closeButton.onclick=_hideHint.bind(this,stepId),tooltipTextLayer.appendChild(tooltipWrapper),tooltipTextLayer.appendChild(closeButton),arrowLayer.className="introjs-arrow",tooltipLayer.appendChild(arrowLayer),tooltipLayer.appendChild(tooltipTextLayer),this._currentStep=hintElement.getAttribute("data-step"),referenceLayer.className="introjs-tooltipReferenceLayer introjs-hintReference",referenceLayer.setAttribute("data-step",hintElement.getAttribute("data-step")),_setHelperLayerPosition.call(this,referenceLayer),referenceLayer.appendChild(tooltipLayer),document.body.appendChild(referenceLayer),_placeTooltip.call(this,hintElement,tooltipLayer,arrowLayer,null,!0)}}function _getOffset(element){var body=document.body,docEl=document.documentElement,scrollTop=window.pageYOffset||docEl.scrollTop||body.scrollTop,scrollLeft=window.pageXOffset||docEl.scrollLeft||body.scrollLeft,x=element.getBoundingClientRect();return{top:x.top+scrollTop,width:x.width,height:x.height,left:x.left+scrollLeft}}function _getScrollParent(element){var style=window.getComputedStyle(element),excludeStaticParent="absolute"===style.position,overflowRegex=/(auto|scroll)/;if("fixed"===style.position)return document.body;for(var parent=element;parent=parent.parentElement;)if(style=window.getComputedStyle(parent),(!excludeStaticParent||"static"!==style.position)&&overflowRegex.test(style.overflow+style.overflowY+style.overflowX))return parent;return document.body}function _scrollParentToElement(parent,element){parent.scrollTop=element.offsetTop-parent.offsetTop}function _getProgress(){return parseInt(this._currentStep+1,10)/this._introItems.length*100}function _mergeOptions(obj1,obj2){var attrname,obj3={};for(attrname in obj1)obj3[attrname]=obj1[attrname];for(attrname in obj2)obj3[attrname]=obj2[attrname];return obj3}var _stamp=function(){var keys={};return function(obj,key){return key=key||"introjs-stamp",keys[key]=keys[key]||0,void 0===obj[key]&&(obj[key]=keys[key]++),obj[key]}}(),DOMEvent=function(){function DOMEvent(){var events_key="introjs_event";this._id=function(obj,type,listener,context){return type+_stamp(listener)+(context?"_"+_stamp(context):"")},this.on=function(obj,type,listener,context,useCapture){var id=this._id.apply(this,arguments),handler=function(e){return listener.call(context||obj,e||window.event)};"addEventListener"in obj?obj.addEventListener(type,handler,useCapture):"attachEvent"in obj&&obj.attachEvent("on"+type,handler),obj[events_key]=obj[events_key]||{},obj[events_key][id]=handler},this.off=function(obj,type,listener,context,useCapture){var id=this._id.apply(this,arguments),handler=obj[events_key]&&obj[events_key][id];"removeEventListener"in obj?obj.removeEventListener(type,handler,useCapture):"detachEvent"in obj&&obj.detachEvent("on"+type,handler),obj[events_key][id]=null}}return new DOMEvent}(),introJs=function(targetElm){var instance;if("object"==typeof targetElm)instance=new IntroJs(targetElm);else if("string"==typeof targetElm){var targetElement=document.querySelector(targetElm);if(!targetElement)throw new Error("There is no element with given selector.");instance=new IntroJs(targetElement)}else instance=new IntroJs(document.body);return introJs.instances[_stamp(instance,"introjs-instance")]=instance,instance};return introJs.version="2.9.0",introJs.instances={},introJs.fn=IntroJs.prototype={clone:function(){return new IntroJs(this)},setOption:function(option,value){return this._options[option]=value,this},setOptions:function(options){return this._options=_mergeOptions(this._options,options),this},start:function(group){return _introForElement.call(this,this._targetElement,group),this},goToStep:function(step){return _goToStep.call(this,step),this},addStep:function(options){return this._options.steps||(this._options.steps=[]),this._options.steps.push(options),this},addSteps:function(steps){if(steps.length){for(var index=0;index<steps.length;index++)this.addStep(steps[index]);return this}},goToStepNumber:function(step){return _goToStepNumber.call(this,step),this},nextStep:function(){return _nextStep.call(this),this},previousStep:function(){return _previousStep.call(this),this},exit:function(force){return _exitIntro.call(this,this._targetElement,force),this},refresh:function(){return _refresh.call(this),this},onbeforechange:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onbeforechange was not a function");return this._introBeforeChangeCallback=providedCallback,this},onchange:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onchange was not a function.");return this._introChangeCallback=providedCallback,this},onafterchange:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onafterchange was not a function");return this._introAfterChangeCallback=providedCallback,this},oncomplete:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for oncomplete was not a function.");return this._introCompleteCallback=providedCallback,this},onhintsadded:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onhintsadded was not a function.");return this._hintsAddedCallback=providedCallback,this},onhintclick:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onhintclick was not a function.");return this._hintClickCallback=providedCallback,this},onhintclose:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onhintclose was not a function.");return this._hintCloseCallback=providedCallback,this},onexit:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onexit was not a function.");return this._introExitCallback=providedCallback,this},onskip:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onskip was not a function.");return this._introSkipCallback=providedCallback,this},onbeforeexit:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onbeforeexit was not a function.");return this._introBeforeExitCallback=providedCallback,this},addHints:function(){return _populateHints.call(this,this._targetElement),this},hideHint:function(stepId){return _hideHint.call(this,stepId),this},hideHints:function(){return _hideHints.call(this),this},showHint:function(stepId){return _showHint.call(this,stepId),this},showHints:function(){return _showHints.call(this),this},removeHints:function(){return _removeHints.call(this),this},removeHint:function(stepId){return _removeHint.call(this,stepId),this},showHintDialog:function(stepId){return _showHintDialog.call(this,stepId),this}},introJs})},443:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(2)],void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(MailPoet){function eventHandler(){return confirm(MailPoet.I18n.t("reinstallConfirmation"))&&(MailPoet.trackEvent("User has reinstalled MailPoet via Settings",{"MailPoet Free version":window.mailpoet_version}),MailPoet.Modal.loading(!0),MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"setup",action:"reset"}).always(function(){MailPoet.Modal.loading(!1)}).done(function(){window.location="admin.php?page=mailpoet-newsletters"}).fail(function(response){response.errors.length>0&&MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})),!1}var element;(element=document.getElementById("mailpoet_reinstall"))&&element.addEventListener("click",eventHandler,!1)}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},444:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(18),__webpack_require__(4),__webpack_require__(5),__webpack_require__(2),__webpack_require__(175),__webpack_require__(445),__webpack_require__(446),__webpack_require__(0)],void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(Backbone,_,jQuery,MailPoet,Handlebars,Papa,AsyncQueue,Moment){jQuery("#mailpoet_subscribers_import").length&&jQuery(document).ready(function(){function showCurrentStep(){MailPoet.Notice.hide(),MailPoet.Modal.loading(!1),jQuery('#mailpoet_subscribers_import > div[id^="step"]').hide(),jQuery(location.hash).show()}var router;jQuery('input[name="select_method"]').attr("checked",!1),router=new(Backbone.Router.extend({routes:{"":"home",step1:"step1",step2:"step2",step3:"step3"},home:function(){this.navigate("step1",{trigger:!0})}})),router.on("route:step1",function(){function toggleNextStepButton(element,condition){if("on"===condition)return void element.closest("table a").removeClass("button-disabled");element.closest("table a").addClass("button-disabled")}function parseCSV(isFile){var processedSubscribers=[],parsedEmails=[],duplicateEmails=[],invalidEmails=[],emailColumnPosition=null,columnCount=null,isHeaderFound=!1,detectAndCleanupEmail=function(emailString){var test,email=jQuery("<div />").html(emailString).text();return email=email.toLowerCase().replace(/^["';.,\s]+|[^\x20-\x7E]+$|["';.,_\s]+$/g,"").replace(/\s+|%\d+|,+/g,""),test=/<(.*?)>/.exec(email),test&&(email=test[1].trim()),test=/mailto:(?:\s+)?(.*)/.exec(email),test&&(email=test[1].trim()),!!window.mailpoet_email_regex.test(email)&&email};return{skipEmptyLines:!0,delimiter:"",newline:"",comments:!1,error:function(){MailPoet.Notice.hide(),MailPoet.Notice.error(MailPoet.I18n.t("dataProcessingError"))},complete:function(CSV){var email,emailAddress,rowData,rowColumnCount,errorNotice;Object.keys(CSV.data).forEach(function(rowCount){rowData=CSV.data[rowCount].map(function(el){return el.trim()}),rowColumnCount=rowData.length,null===columnCount&&(columnCount=rowColumnCount),rowColumnCount===columnCount&&(null===emailColumnPosition?(Object.keys(rowData).forEach(function(column){emailAddress=detectAndCleanupEmail(rowData[column]),null===emailColumnPosition&&window.mailpoet_email_regex.test(emailAddress)&&(emailColumnPosition=column,parsedEmails[emailAddress]=!0,rowData[column]=emailAddress,processedSubscribers[emailAddress]=rowData)}),null===emailColumnPosition&&0===parseInt(rowCount,10)&&(isHeaderFound=!0,processedSubscribers[0]=rowData)):""!==rowData[emailColumnPosition]&&(email=detectAndCleanupEmail(rowData[emailColumnPosition]),_.has(parsedEmails,email)?duplicateEmails.push(email):window.mailpoet_email_regex.test(email)?(parsedEmails[email]=!0,rowData[emailColumnPosition]=email,processedSubscribers[email]=rowData):invalidEmails.push(rowData[emailColumnPosition])))}),processedSubscribers=_.values(processedSubscribers),processedSubscribers&&(isHeaderFound&&processedSubscribers.length>=2||!isHeaderFound&&processedSubscribers.length>=1)?(window.importData.step1={header:window.mailpoet_email_regex.test(processedSubscribers[0][emailColumnPosition])?null:processedSubscribers.shift(),subscribers:processedSubscribers,subscribersCount:processedSubscribers.length,duplicate:duplicateEmails,invalid:invalidEmails},MailPoet.trackEvent("Subscribers import started",{source:isFile?"file upload":"pasted data","MailPoet Free version":window.mailpoet_version}),router.navigate("step2",{trigger:!0})):(MailPoet.Modal.loading(!1),errorNotice=MailPoet.I18n.t("noValidRecords"),errorNotice=errorNotice.replace("[link]",MailPoet.I18n.t("csvKBLink")),errorNotice=errorNotice.replace("[/link]","</a>"),MailPoet.Notice.error(errorNotice))}}}function displayMailChimpLists(data){var listSelectElement=mailChimpListsContainerElement.find("select");listSelectElement.data("select2")?(listSelectElement.select2("data",data),listSelectElement.trigger("change")):listSelectElement.select2({data:data,width:"20em",templateResult:function(item){return item.name},templateSelection:function(item){return item.name}}).change(function(){null!==jQuery(this).val()?toggleNextStepButton(mailChimpProcessButtonElement,"on"):toggleNextStepButton(mailChimpProcessButtonElement,"off")}).trigger("change"),mailChimpListsContainerElement.show()}var methodProcessContainerTemplate,currentStepE,methodSelectionElement,pasteInputElement,pasteInputPlaceholderElement,pasteProcessButtonElement,mailChimpKeyInputElement,mailChimpKeyVerifyButtonElement,mailChimpListsContainerElement,mailChimpProcessButtonElement,uploadElement,uploadProcessButtonElement;if(window.mailpoetColumns=jQuery.map(window.mailpoetColumns,function(column){var col=column;return col.validation_rule=!1,col}),void 0!==window.importData.step1)return void showCurrentStep();methodProcessContainerTemplate=Handlebars.compile(jQuery("#method_process_template").html()),jQuery(".mailpoet_method_process").html(methodProcessContainerTemplate()),currentStepE=jQuery(location.hash),methodSelectionElement=jQuery("#select_method"),pasteInputElement=jQuery("#paste_input"),pasteInputPlaceholderElement=pasteInputElement.data("placeholder").replace(/\\n/g,"\n"),pasteProcessButtonElement=jQuery("#method_paste > div.mailpoet_method_process").find("a.mailpoet_process"),mailChimpKeyInputElement=jQuery("#mailchimp_key"),mailChimpKeyVerifyButtonElement=jQuery("#mailchimp_key_verify"),mailChimpListsContainerElement=jQuery("#mailchimp_lists"),mailChimpProcessButtonElement=jQuery("#method_mailchimp > div.mailpoet_method_process").find("a.mailpoet_process"),uploadElement=jQuery("#file_local"),uploadProcessButtonElement=jQuery("#method_file > div.mailpoet_method_process").find("a.mailpoet_process"),methodSelectionElement.change(function(){var availableMethods=jQuery(':radio[name="select_method"]'),selectedMethod=availableMethods.index(availableMethods.filter(":checked"));MailPoet.Notice.hide(),currentStepE.find(".inside").children('div[id^="method_"]').hide(),currentStepE.find(".inside").children('div[id^="method_"]:eq('+selectedMethod+")").show().find("table").show()}),showCurrentStep(),pasteInputElement.attr("value",pasteInputPlaceholderElement).css("color","#999").focus(function(){jQuery(this).val()===pasteInputPlaceholderElement&&jQuery(this).attr("value","").css("color","#222")}).blur(function(){""===jQuery(this).val()&&jQuery(this).attr("value",pasteInputPlaceholderElement).css("color","#999")}).keyup(function(){toggleNextStepButton(pasteProcessButtonElement,""!==this.value.trim()?"on":"off")}),pasteProcessButtonElement.click(function(){var pasteSize=encodeURI(pasteInputElement.val()).split(/%..|./).length-1;if(MailPoet.Notice.hide(),pasteSize>window.maxPostSizeBytes)return void MailPoet.Notice.error(MailPoet.I18n.t("maxPostSizeNotice"));MailPoet.Modal.loading(!0),setTimeout(function(){Papa.parse(pasteInputElement.val(),parseCSV(!1))},10)}),uploadElement.change(function(){var ext=this.value.match(/[^.]+$/);MailPoet.Notice.hide(),null!==ext&&"csv"===ext[0].toLowerCase()||(this.value="",MailPoet.Notice.error(MailPoet.I18n.t("wrongFileFormat"))),toggleNextStepButton(uploadProcessButtonElement,""!==this.value.trim()?"on":"off")}),uploadProcessButtonElement.click(function(){""!==uploadElement.val().trim()&&(MailPoet.Modal.loading(!0),setTimeout(function(){uploadElement.parse({config:parseCSV(!0)})},10))}),mailChimpKeyInputElement.keyup(function(){""!==this.value.trim()&&/[a-zA-Z0-9]{32}-/.exec(this.value.trim())||(mailChimpListsContainerElement.hide(),jQuery(".mailpoet_mailchimp-key-status").html("").removeClass("mailpoet_mailchimp-ok mailpoet_mailchimp-error"),toggleNextStepButton(mailChimpProcessButtonElement,"off"))}),mailChimpKeyVerifyButtonElement.click(function(){MailPoet.Modal.loading(!0),MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"getMailChimpLists",data:{api_key:mailChimpKeyInputElement.val()}}).always(function(){MailPoet.Modal.loading(!1)}).done(function(response){jQuery(".mailpoet_mailchimp-key-status").html("").removeClass().addClass("mailpoet_mailchimp-key-status mailpoet_mailchimp-ok"),0===response.data.length?(jQuery(".mailpoet_mailchimp-key-status").html(MailPoet.I18n.t("noMailChimpLists")),mailChimpListsContainerElement.hide(),toggleNextStepButton(mailChimpProcessButtonElement,"off")):displayMailChimpLists(response.data)}).fail(function(response){response.errors.length>0&&MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}),mailChimpProcessButtonElement.click(function(){mailChimpProcessButtonElement.closest("table a").hasClass("button-disabled")||(MailPoet.Modal.loading(!0),MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"getMailChimpSubscribers",data:{api_key:mailChimpKeyInputElement.val(),lists:mailChimpListsContainerElement.find("select").val()}}).always(function(){MailPoet.Modal.loading(!1)}).done(function(response){window.importData.step1=response.data,MailPoet.trackEvent("Subscribers import started",{source:"MailChimp","MailPoet Free version":window.mailpoet_version}),router.navigate("step2",{trigger:!0})}).fail(function(response){response.errors.length>0&&MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})}))})}),router.on("route:step2",function(){function toggleNextStepButton(condition){if("on"===condition)return void nextStepButton.removeClass("button-disabled");nextStepButton.addClass("button-disabled")}function enableSegmentSelection(segments){segmentSelectElement.data("select2")&&(segmentSelectElement.html("").select2("destroy"),toggleNextStepButton("off")),segmentSelectElement.select2({data:segments,width:"20em",templateResult:function(item){var i=item;return i.subscriberCount=parseInt(i.subscriberCount,10),i.name+" ("+i.subscriberCount.toLocaleString()+")"},templateSelection:function(item){var i=item;return i.subscriberCount=parseInt(i.subscriberCount,10),i.name+" ("+i.subscriberCount.toLocaleString()+")"}}).change(function(){var segmentSelectionNotice=jQuery('[data-id="notice_segmentSelection"]');this.value?(jQuery('[data-id="notice_segmentSelection"]').remove(),jQuery(".mailpoet_notice.error:visible").length||toggleNextStepButton("on")):(segmentSelectionNotice.length||MailPoet.Notice.error(MailPoet.I18n.t("segmentSelectionRequired"),{static:!0,scroll:!0,id:"notice_segmentSelection",hideClose:!0}),toggleNextStepButton("off"))})}function filterSubscribers(){var displayedColumns,subscribersClone=jQuery.extend(!0,{},subscribers),preventNextStep=!1;jQuery('[data-id="notice_invalidEmail"], [data-id="notice_invalidDate"]').remove(),displayedColumns=jQuery.map(jQuery(".mailpoet_subscribers_column_data_match"),function(element,elementIndex){var columnId=jQuery(element).data("column-id"),validationRule=jQuery(element).data("validation-rule");return jQuery(element).val(columnId).trigger("change"),{id:columnId,index:elementIndex,validationRule:validationRule,element:element}}),jQuery.map(window.mailpoetColumns,function(column){var firstRowData,validationRule,testedFormat,allowedDateFormats,matchedColumn=_.find(displayedColumns,function(data){return data.id===column.id});"email"===column.id&&(window.mailpoet_email_regex.test(subscribersClone.subscribers[0][matchedColumn.index])?MailPoet.Notice.hide("invalidEmail"):(preventNextStep=!0,jQuery('[data-id="notice_invalidEmail"]').length||MailPoet.Notice.error(MailPoet.I18n.t("columnContainsInvalidElement"),{static:!0,scroll:!0,hideClose:!0,id:"invalidEmail"}))),"date"===column.type&&matchedColumn&&(allowedDateFormats=[Moment.ISO_8601,"YYYY/MM/DD","MM/DD/YYYY","DD/MM/YYYY","YYYY/MM/DD","YYYY/DD/MM","MM/YYYY","YYYY/MM","YYYY"],firstRowData=subscribersClone.subscribers[0][matchedColumn.index],validationRule=!1,""===firstRowData.trim()?(subscribersClone.subscribers[0][matchedColumn.index]='<span class="mailpoet_data_match mailpoet_import_error" title="'+MailPoet.I18n.t("noDateFieldMatch")+'">'+MailPoet.I18n.t("emptyFirstRowDate")+"</span> ",preventNextStep=!0):Object.keys(allowedDateFormats).forEach(function(format){if(testedFormat=allowedDateFormats[format],Moment(firstRowData,testedFormat,!0).isValid())return validationRule="function"==typeof testedFormat?"datetime":testedFormat,void jQuery(matchedColumn.element).data("validation-rule",validationRule);"datetime"===validationRule&&(validationRule=Moment.ISO_8601)}),jQuery.map(subscribersClone.subscribers,function(dataSubscribers,index){var data=dataSubscribers,rowData=data[matchedColumn.index],date=Moment(rowData,testedFormat,!0);index!==fillerPosition&&""!==rowData.trim()&&(date.isValid()?data[matchedColumn.index]=new Handlebars.SafeString(Handlebars.Utils.escapeExpression(data[matchedColumn.index])+'<span class="mailpoet_data_match" title="'+MailPoet.I18n.t("verifyDateMatch")+'">'+MailPoet.Date.format(date)+"</span> "):(data[matchedColumn.index]=new Handlebars.SafeString(Handlebars.Utils.escapeExpression(data[matchedColumn.index])+'<span class="mailpoet_data_match mailpoet_import_error" title="'+MailPoet.I18n.t("noDateFieldMatch")+'">'+new Handlebars.SafeString(MailPoet.I18n.t("dateMatchError"))+"</span> "),preventNextStep=!0))}),preventNextStep&&!jQuery(".mailpoet_invalidDate").length&&MailPoet.Notice.error(MailPoet.I18n.t("columnContainsInvalidDate"),{static:!0,scroll:!0,hideClose:!0,id:"invalidDate"}))}),jQuery("#subscribers_data > table > tbody").html(subscribersDataTemplatePartial(subscribersClone)),preventNextStep?toggleNextStepButton("off"):!jQuery(".mailpoet_notice.error:visible").length&&segmentSelectElement.val()&&toggleNextStepButton("on")}var nextStepButton,previousStepButton,subscribers,subscribersDataTemplate,subscribersDataTemplatePartial,subscribersDataParseResultsTemplate,segmentSelectElement,maxRowsToShow,filler,fillerArray,fillerPosition,importResults,duplicates;if(void 0===window.importData.step1)return void router.navigate("step1",{trigger:!0});nextStepButton=jQuery("#step2_process"),previousStepButton=jQuery("#return_to_step1"),subscribers=jQuery.extend(!0,{},window.importData.step1),subscribersDataTemplate=Handlebars.compile(jQuery("#subscribers_data_template").html()),subscribersDataTemplatePartial=Handlebars.compile(jQuery("#subscribers_data_template_partial").html()),subscribersDataParseResultsTemplate=Handlebars.compile(jQuery("#subscribers_data_parse_results_template").html()),segmentSelectElement=jQuery("#mailpoet_segments_select"),maxRowsToShow=10,filler=". . .",fillerArray=Array.apply(null,new Array(subscribers.subscribers[0].length)).map(String.prototype.valueOf,filler),showCurrentStep(),jQuery("#subscribers_data_parse_results:visible").html(""),jQuery("#subscribers_data_import_results:visible").hide(),(subscribers.invalid.length||subscribers.duplicate.length)&&(duplicates={},subscribers.duplicate.forEach(function(subscriberEmail){duplicates[subscriberEmail]=(duplicates[subscriberEmail]||0)+1}),subscribers.duplicate=[],Object.keys(duplicates).forEach(function(email){duplicates[email]>1?subscribers.duplicate.push(email+" (x"+duplicates[email]+")"):subscribers.duplicate.push(email)}),importResults={notice:MailPoet.I18n.t("importNoticeSkipped").replace("%1$s","<strong>"+(subscribers.invalid.length+subscribers.duplicate.length)+"</strong>"),invalid:subscribers.invalid.length?MailPoet.I18n.t("importNoticeInvalid").replace("%1$s","<strong>"+subscribers.invalid.length.toLocaleString()+"</strong>").replace("%2$s",subscribers.invalid.join(", ")):null,duplicate:subscribers.duplicate.length?MailPoet.I18n.t("importNoticeDuplicate").replace("%1$s","<strong>"+subscribers.duplicate.length+"</strong>").replace("%2$s",subscribers.duplicate.join(", ")):null},jQuery("#subscribers_data_parse_results").html(subscribersDataParseResultsTemplate(importResults))),jQuery(".mailpoet_subscribers_data_parse_results_details_show").click(function(){var details=jQuery(".mailpoet_subscribers_data_parse_results_details");jQuery(details).toggle(),this.text=jQuery(details).is(":visible")?MailPoet.I18n.t("hideDetails"):MailPoet.I18n.t("showDetails")}),window.mailpoetSegments.length?jQuery(".mailpoet_segments").show():jQuery(".mailpoet_no_segments").show(),jQuery(".mailpoet_create_segment").click(function(){MailPoet.Modal.popup({title:MailPoet.I18n.t("addNewList"),template:jQuery("#new_segment_template").html()}),jQuery("#new_segment_name").keypress(function(e){13===e.which&&jQuery("#new_segment_process").click()}),jQuery("#new_segment_process").click(function(){var segmentName=jQuery("#new_segment_name").val().trim(),segmentDescription=jQuery("#new_segment_description").val().trim();MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"addSegment",data:{name:segmentName,description:segmentDescription}}).done(function(response){var selectedValues;window.mailpoetSegments.push({id:response.data.id,name:response.data.name,subscriberCount:0}),selectedValues=segmentSelectElement.val(),null===selectedValues?selectedValues=[response.data.id]:selectedValues.push(response.data.id),enableSegmentSelection(window.mailpoetSegments),segmentSelectElement.val(selectedValues).trigger("change"),jQuery(".mailpoet_segments:hidden").show(),jQuery(".mailpoet_no_segments:visible").hide(),MailPoet.Modal.close()}).fail(function(response){response.errors.length>0&&(MailPoet.Notice.hide(),MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{positionAfter:"#new_segment_name"}))})}),jQuery("#new_segment_cancel").click(function(){MailPoet.Modal.close()})}),Handlebars.registerPartial("subscribers_data_template_partial",subscribersDataTemplatePartial),Handlebars.registerHelper("show_and_match_columns",function(helperSubscribers,options){var columnData,columnId,headerName,headerNameMatch,displayedColumns=[],displayedColumnsIds=[];return Object.keys(helperSubscribers.subscribers[0]).forEach(function(i){columnData=helperSubscribers.subscribers[0][i],columnId="ignore",columnData%1!=0&&window.mailpoet_email_regex.test(columnData)?columnId="email":helperSubscribers.header&&(headerName=helperSubscribers.header[i],headerNameMatch=window.mailpoetColumns.map(function(el){return el.name}).indexOf(headerName),-1!==headerNameMatch?columnId=window.mailpoetColumns[headerNameMatch].id:headerName&&(/first|first name|given name/i.test(headerName)?columnId="first_name":/last|last name/i.test(headerName)&&(columnId="last_name"))),columnId="ignore"!==columnId&&-1===displayedColumnsIds.indexOf(columnId)?columnId:"ignore",displayedColumns[i]={column_id:columnId},displayedColumnsIds.push(columnId)}),options.fn(displayedColumns)}),Handlebars.registerHelper("sanitize_data",function(data){return data instanceof Handlebars.SafeString?data:new Handlebars.SafeString(Handlebars.Utils.escapeExpression(data))}),Handlebars.registerHelper("calculate_index",function(rawIndex){var index=parseInt(rawIndex,10);return index===maxRowsToShow&&subscribers.subscribersCount>maxRowsToShow+1?(fillerPosition=index,filler):index===subscribers.subscribers.length-1?subscribers.subscribersCount.toLocaleString():index+1}),subscribers.subscribersCount>maxRowsToShow+1&&subscribers.subscribers.splice(maxRowsToShow,subscribers.subscribersCount-(maxRowsToShow+1),fillerArray),jQuery("#subscribers_data > table").html(subscribersDataTemplate(subscribers)),jQuery("select.mailpoet_subscribers_column_data_match").select2({data:window.mailpoetColumnsSelect2,width:"15em",templateResult:function(item){return item.name},templateSelection:function(item){return item.name}}).on("select2:selecting",function(selectEvent){var selectElement=this,selectedOptionId=selectEvent.params.args.data.id;"create"===selectedOptionId?(selectEvent.preventDefault(),jQuery(selectElement).select2("close"),MailPoet.Modal.popup({title:MailPoet.I18n.t("addNewField"),template:jQuery("#form_template_field_form").html()}),jQuery("#form_field_new").parsley().on("form:submit",function(){var data=jQuery(this.$element).mailpoetSerializeObject();return MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:data}).done(function(response){var newColumnData={id:response.data.id,name:response.data.name,type:response.data.type,params:response.data.params,custom:!0};2===window.mailpoetColumnsSelect2.length&&window.mailpoetColumnsSelect2.push({name:MailPoet.I18n.t("userColumns"),children:[]}),window.mailpoetColumnsSelect2[2].children.push(newColumnData),window.mailpoetColumns.push(newColumnData),jQuery("select.mailpoet_subscribers_column_data_match").each(function(){jQuery(this).html("").select2("destroy").select2({data:window.mailpoetColumnsSelect2,width:"15em",templateResult:function(item){return item.name},templateSelection:function(item){return item.name}})}),jQuery(selectElement).data("column-id",newColumnData.id),jQuery(selectElement).data("validation-rule",!1),filterSubscribers(),MailPoet.Modal.close()}).fail(function(response){response.errors.length>0&&MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{positionAfter:"#field_name"})}),!1})):jQuery("select.mailpoet_subscribers_column_data_match").each(function(){var element=this,elementId=jQuery(element).val();elementId===selectedOptionId&&"ignore"!==elementId&&(confirm(MailPoet.I18n.t("selectedValueAlreadyMatched")+" "+MailPoet.I18n.t("confirmCorrespondingColumn"))?jQuery(element).data("column-id","ignore"):(selectEvent.preventDefault(),jQuery(selectElement).select2("close")))})}).on("select2:select",function(selectEvent){var selectElement=this,selectedOptionId=selectEvent.params.data.id;jQuery(selectElement).data("column-id",selectedOptionId),filterSubscribers()}),previousStepButton.off().on("click",function(){router.navigate("step1",{trigger:!0})}),nextStepButton.off().on("click",function(){var clickSubscribers,splitSubscribers,columns={},queue=new jQuery.AsyncQueue,batchNumber=0,timestamp=Date.now()/1e3,clickImportResults={created:0,updated:0,errors:[],segments:[]};jQuery(this).hasClass("button-disabled")||(MailPoet.Modal.loading(!0),splitSubscribers=function(localSubscribers,size){return localSubscribers.reduce(function(res,item,index){return index%size==0&&res.push([]),res[res.length-1].push(item),res},[])},clickSubscribers=splitSubscribers(window.importData.step1.subscribers,2e3),_.each(jQuery("select.mailpoet_subscribers_column_data_match"),function(column,columnIndex){var columnId=jQuery(column).data("column-id"),validationRule=jQuery(column).data("validation-rule");"ignore"!==columnId&&(columns[columnId]={index:columnIndex,validation_rule:validationRule})}),_.each(clickSubscribers,function(){queue.add(function(addQueue){addQueue.pause(),MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"processImport",data:JSON.stringify({columns:columns,subscribers:clickSubscribers[batchNumber],timestamp:timestamp,segments:segmentSelectElement.val(),updateSubscribers:"yes"===jQuery(':radio[name="subscriber_update_option"]:checked').val()})}).done(function(response){clickImportResults.created+=response.data.created,clickImportResults.updated+=response.data.updated,clickImportResults.segments=response.data.segments,clickImportResults.added_to_segment_with_welcome_notification=response.data.added_to_segment_with_welcome_notification,addQueue.run()}).fail(function(response){MailPoet.Modal.loading(!1),response.errors.length>0&&MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})}),batchNumber+=1})}),queue.run(),queue.onComplete(function(){MailPoet.Modal.loading(!1),clickImportResults.errors.length>0&&!clickImportResults.updated&&!clickImportResults.created?MailPoet.Notice.error(_.flatten(clickImportResults.errors)):(window.mailpoetSegments=clickImportResults.segments,clickImportResults.segments=_.map(segmentSelectElement.select2("data"),function(data){return data.name}),window.importData.step2=clickImportResults,enableSegmentSelection(window.mailpoetSegments),router.navigate("step3",{trigger:!0}))}))}),filterSubscribers(),enableSegmentSelection(window.mailpoetSegments)}),router.on("route:step3",function(){var subscribersDataImportResultsTemplate,exportMenuElement,importResults;if(void 0===window.importData.step2)return void router.navigate("step2",{trigger:!0});showCurrentStep(),window.importData.step2.errors.length>0&&MailPoet.Notice.error(_.flatten(window.importData.step2.errors)),MailPoet.trackEvent("Subscribers import finished",{"Subscribers created":window.importData.step2.created,"Subscribers updated":window.importData.step2.updated,"MailPoet Free version":window.mailpoet_version}),subscribersDataImportResultsTemplate=Handlebars.compile(jQuery("#subscribers_data_import_results_template").html()),exportMenuElement=jQuery("span.mailpoet_export"),importResults={created:!!window.importData.step2.created&&MailPoet.I18n.t("subscribersCreated").replace("%1$s","<strong>"+window.importData.step2.created.toLocaleString()+"</strong>").replace("%2$s",'"'+window.importData.step2.segments.join('", "')+'"'),updated:!!window.importData.step2.updated&&MailPoet.I18n.t("subscribersUpdated").replace("%1$s","<strong>"+window.importData.step2.updated.toLocaleString()+"</strong>").replace("%2$s",'"'+window.importData.step2.segments.join('", "')+'"'),no_action:!window.importData.step2.created&&!window.importData.step2.updated,added_to_segment_with_welcome_notification:window.importData.step2.added_to_segment_with_welcome_notification},jQuery("#subscribers_data_import_results").html(subscribersDataImportResultsTemplate(importResults)).show(),jQuery("a.mailpoet_import_again").off().click(function(){jQuery("#subscribers_data_import_results").hide(),router.navigate("step1",{trigger:!0})}),jQuery("a.mailpoet_view_subscribers").off().click(function(){window.location.href="admin.php?page=mailpoet-subscribers"}),importResults.created&&exportMenuElement.not(":visible")&&exportMenuElement.show(),window.importData.step2=void 0}),Backbone.History.started||Backbone.history.start()})}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},445:function(module,exports){/*!
|
2 |
+
Papa Parse
|
3 |
+
v4.1.1
|
4 |
+
https://github.com/mholt/PapaParse
|
5 |
+
*/
|
6 |
+
!function(e){"use strict";function t(t,r){if(r=r||{},r.worker&&w.WORKERS_SUPPORTED){var n=h();return n.userStep=r.step,n.userChunk=r.chunk,n.userComplete=r.complete,n.userError=r.error,r.step=m(r.step),r.chunk=m(r.chunk),r.complete=m(r.complete),r.error=m(r.error),delete r.worker,void n.postMessage({input:t,config:r,workerId:n.id})}var o=null;return"string"==typeof t?o=r.download?new i(r):new a(r):(e.File&&t instanceof File||t instanceof Object)&&(o=new s(r)),o.stream(t)}function r(e,t){function n(e){if("object"!=typeof e)return[];var t=[];for(var r in e)t.push(r);return t}function i(e,t){var r="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var n=e instanceof Array&&e.length>0,i=!(t[0]instanceof Array);if(n){for(var a=0;a<e.length;a++)a>0&&(r+=u),r+=s(e[a],a);t.length>0&&(r+=f)}for(var o=0;o<t.length;o++){for(var h=n?e.length:t[o].length,d=0;h>d;d++){d>0&&(r+=u);var c=n&&i?e[d]:d;r+=s(t[o][c],d)}o<t.length-1&&(r+=f)}return r}function s(e,t){return void 0===e||null===e?"":(e=e.toString().replace(/"/g,'""'),"boolean"==typeof o&&o||o instanceof Array&&o[t]||a(e,w.BAD_DELIMITERS)||e.indexOf(u)>-1||" "==e.charAt(0)||" "==e.charAt(e.length-1)?'"'+e+'"':e)}function a(e,t){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>-1)return!0;return!1}var o=!1,u=",",f="\r\n";if(function(){"object"==typeof t&&("string"==typeof t.delimiter&&1==t.delimiter.length&&-1==w.BAD_DELIMITERS.indexOf(t.delimiter)&&(u=t.delimiter),("boolean"==typeof t.quotes||t.quotes instanceof Array)&&(o=t.quotes),"string"==typeof t.newline&&(f=t.newline))}(),"string"==typeof e&&(e=JSON.parse(e)),e instanceof Array){if(!e.length||e[0]instanceof Array)return i(null,e);if("object"==typeof e[0])return i(n(e[0]),e)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),e.data instanceof Array&&(e.fields||(e.fields=e.data[0]instanceof Array?e.fields:n(e.data[0])),e.data[0]instanceof Array||"object"==typeof e.data[0]||(e.data=[e.data])),i(e.fields||[],e.data||[]);throw"exception: Unable to serialize unrecognized input"}function n(t){function r(e){var t=_(e);t.chunkSize=parseInt(t.chunkSize),this._handle=new o(t),this._handle.streamer=this,this._config=t}this._handle=null,this._paused=!1,this._finished=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this._completeResults={data:[],errors:[],meta:{}},r.call(this,t),this.parseChunk=function(t){var r=this._partialLine+t;this._partialLine="";var n=this._handle.parse(r,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var i=n.meta.cursor;this._finished||(this._partialLine=r.substring(i-this._baseIndex),this._baseIndex=i),n&&n.data&&(this._rowCount+=n.data.length);var s=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(k)e.postMessage({results:n,workerId:w.WORKER_ID,finished:s});else if(m(this._config.chunk)){if(this._config.chunk(n,this._handle),this._paused)return;n=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(n.data),this._completeResults.errors=this._completeResults.errors.concat(n.errors),this._completeResults.meta=n.meta),!s||!m(this._config.complete)||n&&n.meta.aborted||this._config.complete(this._completeResults),s||n&&n.meta.paused||this._nextChunk(),n}},this._sendError=function(t){m(this._config.error)?this._config.error(t):k&&this._config.error&&e.postMessage({workerId:w.WORKER_ID,error:t,finished:!1})}}function i(e){function t(e){var t=e.getResponseHeader("Content-Range");return parseInt(t.substr(t.lastIndexOf("/")+1))}e=e||{},e.chunkSize||(e.chunkSize=w.RemoteChunkSize),n.call(this,e);var r;this._nextChunk=k?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)return void this._chunkLoaded();if(r=new XMLHttpRequest,k||(r.onload=g(this._chunkLoaded,this),r.onerror=g(this._chunkError,this)),r.open("GET",this._input,!k),this._config.chunkSize){var e=this._start+this._config.chunkSize-1;r.setRequestHeader("Range","bytes="+this._start+"-"+e),r.setRequestHeader("If-None-Match","webkit-no-cache")}try{r.send()}catch(t){this._chunkError(t.message)}k&&0==r.status?this._chunkError():this._start+=this._config.chunkSize},this._chunkLoaded=function(){if(4==r.readyState){if(r.status<200||r.status>=400)return void this._chunkError();this._finished=!this._config.chunkSize||this._start>t(r),this.parseChunk(r.responseText)}},this._chunkError=function(e){var t=r.statusText||e;this._sendError(t)}}function s(e){e=e||{},e.chunkSize||(e.chunkSize=w.LocalChunkSize),n.call(this,e);var t,r,i="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,r=e.slice||e.webkitSlice||e.mozSlice,i?(t=new FileReader,t.onload=g(this._chunkLoaded,this),t.onerror=g(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input;if(this._config.chunkSize){var n=Math.min(this._start+this._config.chunkSize,this._input.size);e=r.call(e,this._start,n)}var s=t.readAsText(e,this._config.encoding);i||this._chunkLoaded({target:{result:s}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function a(e){e=e||{},n.call(this,e);var t,r;this.stream=function(e){return t=e,r=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e=this._config.chunkSize,t=e?r.substr(0,e):r;return r=e?r.substr(e):"",this._finished=!r,this.parseChunk(t)}}}function o(e){function t(){if(b&&c&&(f("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+w.DefaultDelimiter+"'"),c=!1),e.skipEmptyLines)for(var t=0;t<b.data.length;t++)1==b.data[t].length&&""==b.data[t][0]&&b.data.splice(t--,1);return r()&&n(),i()}function r(){return e.header&&0==y.length}function n(){if(b){for(var e=0;r()&&e<b.data.length;e++)for(var t=0;t<b.data[e].length;t++)y.push(b.data[e][t]);b.data.splice(0,1)}}function i(){if(!b||!e.header&&!e.dynamicTyping)return b;for(var t=0;t<b.data.length;t++){for(var r={},n=0;n<b.data[t].length;n++){if(e.dynamicTyping){var i=b.data[t][n];b.data[t][n]="true"==i||"TRUE"==i||"false"!=i&&"FALSE"!=i&&o(i)}e.header&&(n>=y.length?(r.__parsed_extra||(r.__parsed_extra=[]),r.__parsed_extra.push(b.data[t][n])):r[y[n]]=b.data[t][n])}e.header&&(b.data[t]=r,n>y.length?f("FieldMismatch","TooManyFields","Too many fields: expected "+y.length+" fields but parsed "+n,t):n<y.length&&f("FieldMismatch","TooFewFields","Too few fields: expected "+y.length+" fields but parsed "+n,t))}return e.header&&b.meta&&(b.meta.fields=y),b}function s(t){for(var r,n,i,s=[",","\t","|",";",w.RECORD_SEP,w.UNIT_SEP],a=0;a<s.length;a++){var o=s[a],f=0,h=0;i=void 0;for(var d=new u({delimiter:o,preview:10}).parse(t),c=0;c<d.data.length;c++){var l=d.data[c].length;h+=l,void 0!==i?l>1&&(f+=Math.abs(l-i),i=l):i=l}h/=d.data.length,(void 0===n||n>f)&&h>1.99&&(n=f,r=o)}return e.delimiter=r,{successful:!!r,bestDelimiter:r}}function a(e){e=e.substr(0,1048576);var t=e.split("\r");if(1==t.length)return"\n";for(var r=0,n=0;n<t.length;n++)"\n"==t[n][0]&&r++;return r>=t.length/2?"\r\n":"\r"}function o(e){return l.test(e)?parseFloat(e):e}function f(e,t,r,n){b.errors.push({type:e,code:t,message:r,row:n})}var h,d,c,l=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,p=this,g=0,v=!1,k=!1,y=[],b={data:[],errors:[],meta:{}};if(m(e.step)){var R=e.step;e.step=function(n){if(b=n,r())t();else{if(t(),0==b.data.length)return;g+=n.data.length,e.preview&&g>e.preview?d.abort():R(b,p)}}}this.parse=function(r,n,i){if(e.newline||(e.newline=a(r)),c=!1,!e.delimiter){var o=s(r);o.successful?e.delimiter=o.bestDelimiter:(c=!0,e.delimiter=w.DefaultDelimiter),b.meta.delimiter=e.delimiter}var f=_(e);return e.preview&&e.header&&f.preview++,h=r,d=new u(f),b=d.parse(h,n,i),t(),v?{meta:{paused:!0}}:b||{meta:{paused:!1}}},this.paused=function(){return v},this.pause=function(){v=!0,d.abort(),h=h.substr(d.getCharIndex())},this.resume=function(){v=!1,p.streamer.parseChunk(h)},this.aborted=function(){return k},this.abort=function(){k=!0,d.abort(),b.meta.aborted=!0,m(e.complete)&&e.complete(b),h=""}}function u(e){e=e||{};var t=e.delimiter,r=e.newline,n=e.comments,i=e.step,s=e.preview,a=e.fastMode;if(("string"!=typeof t||w.BAD_DELIMITERS.indexOf(t)>-1)&&(t=","),n===t)throw"Comment character same as delimiter";!0===n?n="#":("string"!=typeof n||w.BAD_DELIMITERS.indexOf(n)>-1)&&(n=!1),"\n"!=r&&"\r"!=r&&"\r\n"!=r&&(r="\n");var o=0,u=!1;this.parse=function(e,f,h){function d(e){b.push(e),S=o}function c(t){return h?p():(t||(t=e.substr(o)),w.push(t),o=g,d(w),y&&_(),p())}function l(t){o=t,d(w),w=[],O=e.indexOf(r,o)}function p(e){return{data:b,errors:R,meta:{delimiter:t,linebreak:r,aborted:u,truncated:!!e,cursor:S+(f||0)}}}function _(){i(p()),b=[],R=[]}if("string"!=typeof e)throw"Input must be a string";var g=e.length,m=t.length,v=r.length,k=n.length,y="function"==typeof i;o=0;var b=[],R=[],w=[],S=0;if(!e)return p();if(a||!1!==a&&-1===e.indexOf('"')){for(var E=e.split(r),C=0;C<E.length;C++){var w=E[C];if(o+=w.length,C!==E.length-1)o+=r.length;else if(h)return p();if(!n||w.substr(0,k)!=n){if(y){if(b=[],d(w.split(t)),_(),u)return p()}else d(w.split(t));if(s&&C>=s)return b=b.slice(0,s),p(!0)}}return p()}for(var x=e.indexOf(t,o),O=e.indexOf(r,o);;)if('"'!=e[o])if(n&&0===w.length&&e.substr(o,k)===n){if(-1==O)return p();o=O+v,O=e.indexOf(r,o),x=e.indexOf(t,o)}else if(-1!==x&&(O>x||-1===O))w.push(e.substring(o,x)),o=x+m,x=e.indexOf(t,o);else{if(-1===O)break;if(w.push(e.substring(o,O)),l(O+v),y&&(_(),u))return p();if(s&&b.length>=s)return p(!0)}else{var I=o;for(o++;;){var I=e.indexOf('"',I+1);if(-1===I)return h||R.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:b.length,index:o}),c();if(I===g-1){var D=e.substring(o,I).replace(/""/g,'"');return c(D)}if('"'!=e[I+1]){if(e[I+1]==t){w.push(e.substring(o,I).replace(/""/g,'"')),o=I+1+m,x=e.indexOf(t,o),O=e.indexOf(r,o);break}if(e.substr(I+1,v)===r){if(w.push(e.substring(o,I).replace(/""/g,'"')),l(I+1+v),x=e.indexOf(t,o),y&&(_(),u))return p();if(s&&b.length>=s)return p(!0);break}}else I++}}return c()},this.abort=function(){u=!0},this.getCharIndex=function(){return o}}function h(){if(!w.WORKERS_SUPPORTED)return!1;if(!y&&null===w.SCRIPT_PATH)throw new Error("Script path cannot be determined automatically when Papa Parse is loaded asynchronously. You need to set Papa.SCRIPT_PATH manually.");var t=new e.Worker(w.SCRIPT_PATH||v);return t.onmessage=d,t.id=R++,b[t.id]=t,t}function d(e){var t=e.data,r=b[t.workerId],n=!1;if(t.error)r.userError(t.error,t.file);else if(t.results&&t.results.data){var i=function(){n=!0,c(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},s={abort:i,pause:l,resume:l};if(m(r.userStep)){for(var a=0;a<t.results.data.length&&(r.userStep({data:[t.results.data[a]],errors:t.results.errors,meta:t.results.meta},s),!n);a++);delete t.results}else m(r.userChunk)&&(r.userChunk(t.results,s,t.file),delete t.results)}t.finished&&!n&&c(t.workerId,t.results)}function c(e,t){var r=b[e];m(r.userComplete)&&r.userComplete(t),r.terminate(),delete b[e]}function l(){throw"Not implemented."}function p(t){var r=t.data;if(void 0===w.WORKER_ID&&r&&(w.WORKER_ID=r.workerId),"string"==typeof r.input)e.postMessage({workerId:w.WORKER_ID,results:w.parse(r.input,r.config),finished:!0});else if(e.File&&r.input instanceof File||r.input instanceof Object){var n=w.parse(r.input,r.config);n&&e.postMessage({workerId:w.WORKER_ID,results:n,finished:!0})}}function _(e){if("object"!=typeof e)return e;var t=e instanceof Array?[]:{};for(var r in e)t[r]=_(e[r]);return t}function g(e,t){return function(){e.apply(t,arguments)}}function m(e){return"function"==typeof e}var v,k=!e.document&&!!e.postMessage,y=!1,b={},R=0,w={};if(w.parse=t,w.unparse=r,w.RECORD_SEP=String.fromCharCode(30),w.UNIT_SEP=String.fromCharCode(31),w.BYTE_ORDER_MARK="\ufeff",w.BAD_DELIMITERS=["\r","\n",'"',w.BYTE_ORDER_MARK],w.WORKERS_SUPPORTED=!!e.Worker,w.SCRIPT_PATH=null,w.LocalChunkSize=10485760,w.RemoteChunkSize=5242880,w.DefaultDelimiter=",",w.Parser=u,w.ParserHandle=o,w.NetworkStreamer=i,w.FileStreamer=s,w.StringStreamer=a,void 0!==module&&module.exports?module.exports=w:m(e.define)&&e.define.amd?e.define(function(){return w}):e.Papa=w,e.jQuery){var S=e.jQuery;S.fn.parse=function(t){function r(){if(0==a.length)return void(m(t.complete)&&t.complete());var e=a[0];if(m(t.before)){var r=t.before(e.file,e.inputElem);if("object"==typeof r){if("abort"==r.action)return void n("AbortError",e.file,e.inputElem,r.reason);if("skip"==r.action)return void i();"object"==typeof r.config&&(e.instanceConfig=S.extend(e.instanceConfig,r.config))}else if("skip"==r)return void i()}var s=e.instanceConfig.complete;e.instanceConfig.complete=function(t){m(s)&&s(t,e.file,e.inputElem),i()},w.parse(e.file,e.instanceConfig)}function n(e,r,n,i){m(t.error)&&t.error({name:e},r,n,i)}function i(){a.splice(0,1),r()}var s=t.config||{},a=[];return this.each(function(){if("INPUT"!=S(this).prop("tagName").toUpperCase()||"file"!=S(this).attr("type").toLowerCase()||!e.FileReader||!this.files||0==this.files.length)return!0;for(var r=0;r<this.files.length;r++)a.push({file:this.files[r],inputElem:this,instanceConfig:S.extend({},s)})}),r(),this}}k?e.onmessage=p:w.WORKERS_SUPPORTED&&(v=function(){var e=document.getElementsByTagName("script");return e.length?e[e.length-1].src:""}(),document.body?document.addEventListener("DOMContentLoaded",function(){y=!0},!0):y=!0),i.prototype=Object.create(n.prototype),i.prototype.constructor=i,s.prototype=Object.create(n.prototype),s.prototype.constructor=s,a.prototype=Object.create(a.prototype),a.prototype.constructor=a}("undefined"!=typeof window?window:this)},446:function(module,exports){!function($){$.AsyncQueue=function(){var failureFunc,completeFunc,lastCallbackData,_run,that=this,queue=[],paused=!1;return _run=function(){var f=queue.shift();f?(f.apply(that,[that]),!1===paused&&_run()):completeFunc&&completeFunc.apply(that)},this.onFailure=function(func){failureFunc=func},this.onComplete=function(func){completeFunc=func},this.add=function(func){return queue.push(func),this},this.storeData=function(dataObject){return lastCallbackData=dataObject,this},this.lastCallbackData=function(){return lastCallbackData},this.run=function(){paused=!1,_run()},this.pause=function(){return paused=!0,this},this.failure=function(){if(paused=!0,failureFunc){var args=[that];for(i=0;i<arguments.length;i++)args.push(arguments[i]);failureFunc.apply(that,args)}},this}}(jQuery)},447:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(4),__webpack_require__(5),__webpack_require__(2),__webpack_require__(175)],void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(_,jQuery,MailPoet,Handlebars){jQuery("#mailpoet_subscribers_export").length&&jQuery(document).ready(function(){function toggleNextStepButton(condition){"on"===condition?nextStepButton.removeClass("button-disabled"):nextStepButton.addClass("button-disabled")}var segmentsContainerElement,subscriberFieldsContainerElement,nextStepButton,renderSegmentsAndFields,subscribersExportTemplate;window.exportData.segments&&(subscribersExportTemplate=Handlebars.compile(jQuery("#mailpoet_subscribers_export_template").html()),jQuery("#mailpoet_subscribers_export > div.inside").html(subscribersExportTemplate(window.exportData)),segmentsContainerElement=jQuery("#export_lists"),subscriberFieldsContainerElement=jQuery("#export_columns"),nextStepButton=jQuery("a.mailpoet_export_process"),renderSegmentsAndFields=function(container,data){container.data("select2")&&container.html("").select2("destroy"),container.select2({data:data,width:"20em",templateResult:function(item){return item.subscriberCount>0?item.name+" ("+parseInt(item.subscriberCount,10).toLocaleString()+")":item.name},templateSelection:function(item){return item.subscriberCount>0?item.name+" ("+parseInt(item.subscriberCount,10).toLocaleString()+")":item.name}}).on("select2:selecting",function(selectEvent){var allOptions,selectElement=this,selectedOptionId=selectEvent.params.args.data.id,fieldsToExclude=["select","deselect"];_.contains(fieldsToExclude,selectedOptionId)&&(selectEvent.preventDefault(),"deselect"===selectedOptionId?jQuery(selectElement).val("").trigger("change"):(allOptions=[],_.each(container.find("option"),function(field){_.contains(fieldsToExclude,field.value)||allOptions.push(field.value)}),jQuery(selectElement).val(allOptions).trigger("change")),jQuery(selectElement).select2("close"))}).on("change",function(){toggleNextStepButton(window.exportData.segments&&segmentsContainerElement.select2("data").length&&subscriberFieldsContainerElement.select2("data").length||!window.exportData.segments&&subscriberFieldsContainerElement.select2("data").length?"on":"off")})},window.segments.forEach(function(item){segmentsContainerElement.append(jQuery("<option></option>").attr("value",item.id).text(item.name))}),renderSegmentsAndFields(segmentsContainerElement,window.segments),renderSegmentsAndFields(subscriberFieldsContainerElement,window.subscriberFieldsSelect2),subscriberFieldsContainerElement.val(["email","first_name","last_name","list_status","global_status"]).trigger("change"),nextStepButton.click(function(){var exportFormat;jQuery(this).hasClass("button-disabled")||(MailPoet.Modal.loading(!0),exportFormat=jQuery(':radio[name="option_format"]:checked').val(),MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"processExport",data:JSON.stringify({export_format_option:exportFormat,segments:!!window.exportData.segments&&segmentsContainerElement.val(),subscriber_fields:subscriberFieldsContainerElement.val()})}).always(function(){MailPoet.Modal.loading(!1)}).done(function(response){var resultMessage=MailPoet.I18n.t("exportMessage").replace("%1$s","<strong>"+parseInt(response.data.totalExported,10).toLocaleString()+"</strong>").replace("[link]",'<a href="'+response.data.exportFileURL+'" target="_blank" >').replace("[/link]","</a>");jQuery("#export_result_notice").html("<p>"+resultMessage+"</p>").show(),window.location.href=response.data.exportFileURL,MailPoet.trackEvent("Subscribers export completed",{"Total exported":response.data.totalExported,"File Format":exportFormat,"MailPoet Free version":window.mailpoet_version})}).fail(function(response){response.errors.length>0&&MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})}))}))})}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},448:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactRouterDom=__webpack_require__(7),_steps_controller=__webpack_require__(449),_steps_controller2=_interopRequireDefault(_steps_controller),container=document.getElementById("welcome_wizard_container");container&&_reactDom2.default.render(_react2.default.createElement(_reactRouterDom.HashRouter,null,_react2.default.createElement("div",null,_react2.default.createElement(_reactRouterDom.Route,{exact:!0,path:"/",render:function(){return _react2.default.createElement(_reactRouterDom.Redirect,{to:"/steps/1"})}}),_react2.default.createElement(_reactRouterDom.Route,{path:"/steps/:step",component:_steps_controller2.default}))),container)},449:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_header=__webpack_require__(450),_header2=_interopRequireDefault(_header),_sender_step=__webpack_require__(452),_sender_step2=_interopRequireDefault(_sender_step),_migrated_user_step=__webpack_require__(453),_migrated_user_step2=_interopRequireDefault(_migrated_user_step),_help_info_step=__webpack_require__(454),_help_info_step2=_interopRequireDefault(_help_info_step),_usage_tracking_step=__webpack_require__(455),_usage_tracking_step2=_interopRequireDefault(_usage_tracking_step),_woo_commerce_step=__webpack_require__(456),_woo_commerce_step2=_interopRequireDefault(_woo_commerce_step),WelcomeWizardStepsController=function(_React$Component){function WelcomeWizardStepsController(props){_classCallCheck(this,WelcomeWizardStepsController);var _this=_possibleConstructorReturn(this,(WelcomeWizardStepsController.__proto__||Object.getPrototypeOf(WelcomeWizardStepsController)).call(this,props));return _this.state={stepsCount:window.is_woocommerce_active?4:3,shouldSetSender:!window.is_mp2_migration_complete,loading:!1,sender:window.sender_data},_this.finishWizard=_this.finishWizard.bind(_this),_this.updateSettings=_this.updateSettings.bind(_this),_this.activateTracking=_this.activateTracking.bind(_this),_this.updateSender=_this.updateSender.bind(_this),_this.submitSender=_this.submitSender.bind(_this),_this.showWooCommerceStepOrFinish=_this.showWooCommerceStepOrFinish.bind(_this),_this.componentDidUpdate(),_this}return _inherits(WelcomeWizardStepsController,_React$Component),_createClass(WelcomeWizardStepsController,[{key:"componentDidUpdate",value:function(){var step=parseInt(this.props.match.params.step,10);(step>this.state.stepsCount||step<1)&&this.props.history.push("/steps/1")}},{key:"finishWizard",value:function(){this.setState({loading:!0}),window.location=window.finish_wizard_url}},{key:"showWooCommerceStepOrFinish",value:function(){4===this.state.stepsCount?this.props.history.push("/steps/4"):this.finishWizard()}},{key:"updateSettings",value:function(data){var _this2=this;return this.setState({loading:!0}),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:data}).then(function(){return _this2.setState({loading:!1})}).fail(function(response){_this2.setState({loading:!1}),response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{key:"activateTracking",value:function(){var _this3=this;this.updateSettings({analytics:{enabled:!0}}).then(function(){return _this3.showWooCommerceStepOrFinish()})}},{key:"updateSender",value:function(data){this.setState({sender:Object.assign({},this.state.sender,data)})}},{key:"submitSender",value:function(){var _this4=this;this.updateSettings({sender:this.state.sender}).then(function(){return _this4.props.history.push("/steps/2")})}},{key:"render",value:function(){var _this5=this,step=parseInt(this.props.match.params.step,10);return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_steps mailpoet_welcome_wizard_centered_column"},_react2.default.createElement(_header2.default,{current_step:step,steps_count:this.state.stepsCount,logo_src:window.mailpoet_logo_url}),1===step&&this.state.shouldSetSender?_react2.default.createElement(_sender_step2.default,{update_sender:this.updateSender,submit_sender:this.submitSender,finish:this.finishWizard,loading:this.state.loading,sender:this.state.sender}):null,1!==step||this.state.shouldSetSender?null:_react2.default.createElement(_migrated_user_step2.default,{next:function(){return _this5.props.history.push("/steps/2")}}),2===step?_react2.default.createElement(_help_info_step2.default,{next:function(){return _this5.props.history.push("/steps/3")}}):null,3===step?_react2.default.createElement(_usage_tracking_step2.default,{skip_action:this.showWooCommerceStepOrFinish,allow_action:this.activateTracking,allow_text:4===this.state.stepsCount?_mailpoet2.default.I18n.t("allowAndContinue"):_mailpoet2.default.I18n.t("allowAndFinish"),loading:this.state.loading}):null,4===step?_react2.default.createElement(_woo_commerce_step2.default,{next:this.finishWizard,screenshot_src:window.woocommerce_screenshot_url,loading:this.state.loading}):null)}}]),WelcomeWizardStepsController}(_react2.default.Component);WelcomeWizardStepsController.propTypes={match:_propTypes2.default.shape({params:_propTypes2.default.shape({step:_propTypes2.default.string}).isRequired}).isRequired,history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},module.exports=WelcomeWizardStepsController},450:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_stepped_progess_bar=__webpack_require__(451),_stepped_progess_bar2=_interopRequireDefault(_stepped_progess_bar),WelcomeWizardHeader=function(props){return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_centered_column mailpoet_welcome_wizard_header"},_react2.default.createElement("img",{src:props.logo_src,width:"200",alt:"MailPoet logo"}),props.current_step<=props.steps_count?_react2.default.createElement(_stepped_progess_bar2.default,{steps_count:props.steps_count,step:props.current_step}):null)};WelcomeWizardHeader.propTypes={current_step:_propTypes2.default.number.isRequired,steps_count:_propTypes2.default.number.isRequired,logo_src:_propTypes2.default.string.isRequired},module.exports=WelcomeWizardHeader},451:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),SteppedProgressBar=function(props){return props.step>props.steps_count?null:_react2.default.createElement("div",{className:"mailpoet_stepped_progress_bar"},[].concat(_toConsumableArray(Array(props.steps_count).keys())).map(function(step){return _react2.default.createElement("div",{className:"mailpoet_stepped_progress_bar_step "+(step<props.step?"active":""),key:"step_"+step,style:{width:Math.floor(100/props.steps_count)+"%"}})}))};SteppedProgressBar.propTypes={steps_count:_propTypes2.default.number.isRequired,step:_propTypes2.default.number.isRequired},module.exports=SteppedProgressBar},452:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),WelcomeWizardSenderStep=function(props){return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("welcomeWizardLetsStartTitle")),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("welcomeWizardSenderText")),_react2.default.createElement("form",{id:"mailpoet_sender_form",className:"mailpoet_welcome_wizard_centered_column "+(props.loading?"mailpoet_sender_form_loading":""),onSubmit:function(e){e.preventDefault(),(0,_jquery2.default)("#mailpoet_sender_form").parsley().validate()&&props.submit_sender()}},_react2.default.createElement("label",{htmlFor:"senderName"},_mailpoet2.default.I18n.t("senderName"),":",_react2.default.createElement("input",{name:"senderName",type:"text",placeholder:"John Doe",value:props.sender?props.sender.name:"","data-parsley-required":!0,onChange:function(e){return props.update_sender({name:e.target.value})}})),_react2.default.createElement("label",{htmlFor:"senderAddress"},_mailpoet2.default.I18n.t("senderAddress"),":",_react2.default.createElement("input",{name:"senderAddress",type:"text",placeholder:"john@doe.com",value:props.sender?props.sender.address:"","data-parsley-required":!0,"data-parsley-type":"email",onChange:function(e){return props.update_sender({address:e.target.value})}})),_react2.default.createElement("input",{className:"button button-primary",type:"submit",value:_mailpoet2.default.I18n.t("next")}),_react2.default.createElement("a",{onClick:props.finish,href:"#finish"},_mailpoet2.default.I18n.t("noThanksSkip"))))};WelcomeWizardSenderStep.propTypes={finish:_propTypes2.default.func.isRequired,loading:_propTypes2.default.bool.isRequired,update_sender:_propTypes2.default.func.isRequired,submit_sender:_propTypes2.default.func.isRequired,sender:_propTypes2.default.shape({name:_propTypes2.default.string,address:_propTypes2.default.string})},WelcomeWizardSenderStep.defaultProps={sender:null},module.exports=WelcomeWizardSenderStep},453:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),WelcomeWizardMigratedUserStep=function(props){return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("welcomeWizardLetsStartTitle")),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("welcomeWizardSenderMigratedUserText")),_react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_controls"},_react2.default.createElement("button",{className:"button button-primary",onClick:props.next},_mailpoet2.default.I18n.t("next"))))};WelcomeWizardMigratedUserStep.propTypes={next:_propTypes2.default.func.isRequired},module.exports=WelcomeWizardMigratedUserStep},454:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),WelcomeWizardHelpInfoStep=function(props){return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},_react2.default.createElement("div",{className:"mailpoet_welcome_wizard_help_info_block"},_react2.default.createElement("span",{className:"mailpoet_welcome_wizard_support_button"}),_react2.default.createElement("p",null,(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("welcomeWizardYouCanContactText"),/\[strong\](.*?)\[\/strong\]/g,function(match){return _react2.default.createElement("strong",{key:match},match)}))),_react2.default.createElement("div",{className:"mailpoet_welcome_wizard_help_info_block"},_react2.default.createElement("span",{className:"mailpoet_badge mailpoet_badge_video mailpoet_welcome_wizard_video_badge"},_react2.default.createElement("span",{className:"dashicons dashicons-format-video"}),_mailpoet2.default.I18n.t("seeVideoGuide")),_react2.default.createElement("p",null,(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("welcomeWizardAboutVideosText"),/\[strong\](.*?)\[\/strong\]/g,function(match){return _react2.default.createElement("strong",{key:match},match)}))),_react2.default.createElement("div",{className:"mailpoet_welcome_wizard_help_info_block"},_react2.default.createElement("span",{className:"mailpoet_welcome_wizard_mail_icon"}),_react2.default.createElement("p",null,(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("welcomeWizardAboutCourseText"),/\[strong\](.*?)\[\/strong\]/g,function(match){return _react2.default.createElement("strong",{key:match},match)})),_react2.default.createElement("iframe",{id:"mailpoet_form_iframe",width:"100%",scrolling:"no",frameBorder:"0",title:"Apply to course",src:"https://newsletters.mailpoet.com?mailpoet_form_iframe=13",className:"mailpoet_form_iframe",marginWidth:"0",marginHeight:"0",allowtransparency:"true"})),_react2.default.createElement("button",{className:"button button-primary",onClick:props.next},_mailpoet2.default.I18n.t("next")))};module.exports=WelcomeWizardHelpInfoStep,WelcomeWizardHelpInfoStep.propTypes={next:_propTypes2.default.func.isRequired},module.exports=WelcomeWizardHelpInfoStep},455:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),WelcomeWizardUsageTrackingStep=function(props){return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("welcomeWizardUsageTrackingStepTitle")),_react2.default.createElement("p",null,(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("welcomeWizardTrackingText"),/\[link\](.*?)\[\/link\]/g,function(match){return _react2.default.createElement("a",{key:"docs_link",href:"https://beta.docs.mailpoet.com/article/130-sharing-your-data-with-us",target:"_blank",rel:"noopener noreferrer"},match)})),_react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_controls\n "+(props.loading?"mailpoet_welcome_wizard_step_controls_loading":"")},_react2.default.createElement("button",{className:"button",onClick:props.skip_action,disabled:props.loading},_mailpoet2.default.I18n.t("skip")),_react2.default.createElement("button",{className:"button button-primary",onClick:props.allow_action,disabled:props.loading},props.allow_text)))};module.exports=WelcomeWizardUsageTrackingStep,WelcomeWizardUsageTrackingStep.propTypes={allow_action:_propTypes2.default.func.isRequired,allow_text:_propTypes2.default.string.isRequired,skip_action:_propTypes2.default.func.isRequired,loading:_propTypes2.default.bool.isRequired}},456:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),WelcomeWizardWooCommerceStep=function(props){return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("welcomeWizardWooCommerceStepTitle")),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("welcomeWizardHelpingShopOwnersText")),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("welcomeWizardWooCommerceEmailsText")),_react2.default.createElement("img",{src:props.screenshot_src,className:"mailpoet_welcome_wizard_woo_screenshot",alt:"WooCommerce email"}),_react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_controls\n "+(props.loading?"mailpoet_welcome_wizard_step_controls_loading":"")},_react2.default.createElement("button",{className:"button button-primary",onClick:props.next,disabled:props.loading},_mailpoet2.default.I18n.t("gotIt"))))};module.exports=WelcomeWizardWooCommerceStep,WelcomeWizardWooCommerceStep.propTypes={next:_propTypes2.default.func.isRequired,screenshot_src:_propTypes2.default.string.isRequired,loading:_propTypes2.default.bool.isRequired}},457:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_new_subscriber_announcement=__webpack_require__(458),_new_subscriber_announcement2=_interopRequireDefault(_new_subscriber_announcement),container=document.getElementById("new_subscriber_announcement");container&&_reactDom2.default.render(_react2.default.createElement(_new_subscriber_announcement2.default,{installedAt:window.mailpoet_installed_at,imageUrl:window.mailpoet_new_subscriber_announcement_image}),container)},458:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_moment=__webpack_require__(0),_moment2=_interopRequireDefault(_moment),_in_app_announcement=__webpack_require__(267),_in_app_announcement2=_interopRequireDefault(_in_app_announcement),NewSubscriberNotificationAnnouncement=function(props){return _react2.default.createElement(_in_app_announcement2.default,{validUntil:(0,_moment2.default)(props.installedAt).add(3,"months").toDate(),height:"700px",showOnlyOnceSlug:"new_subscriber_notification",showToNewUser:!1},_react2.default.createElement("div",{className:"new_subscriber_notification_announcement"},_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("announcementHeader")),_react2.default.createElement("img",{src:props.imageUrl,width:"600px",height:"460px",alt:""}),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("announcementParagraph1"),_react2.default.createElement("br",null),_mailpoet2.default.I18n.t("announcementParagraph2"))))};NewSubscriberNotificationAnnouncement.propTypes={installedAt:_propTypes2.default.string.isRequired,imageUrl:_propTypes2.default.string.isRequired},module.exports=NewSubscriberNotificationAnnouncement},459:function(module,exports,__webpack_require__){"use strict";(function(setImmediate){function displayPoll(){window.mailpoet_display_nps_poll&&window.satismeter&&window.mailpoet_installed_at_isoFormat&&(window.satismeter({writeKey:"6L479eVPXk7pBn6S",userId:window.mailpoet_current_wp_user.ID+window.mailpoet_site_url,traits:{name:window.mailpoet_current_wp_user.user_nicename,email:window.mailpoet_current_wp_user.user_email,createdAt:window.mailpoet_installed_at_isoFormat}}),window.satismeter({writeKey:"k0aJAsQAWI2ERyGv",userId:window.mailpoet_current_wp_user.ID+window.mailpoet_site_url,traits:{name:window.mailpoet_current_wp_user.user_nicename,email:window.mailpoet_current_wp_user.user_email,createdAt:window.mailpoet_installed_at_isoFormat}}))}setImmediate(displayPoll)}).call(exports,__webpack_require__(281).setImmediate)}},[390]);
|
assets/js/admin.6e1f275b.js
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
webpackJsonp([2],{188:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function Tabs(props){var tabLinks=tabs.map(function(tab){var tabClasses=(0,_classnames2.default)("nav-tab",{"nav-tab-active":props.tab===tab.name});return _react2.default.createElement(_reactRouterDom.Link,{key:"tab-"+tab.name,className:tabClasses,to:tab.link},tab.label)});return _react2.default.createElement("h2",{className:"nav-tab-wrapper"},tabLinks)}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(7),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),tabs=[{name:"knowledgeBase",label:_mailpoet2.default.I18n.t("tabKnowledgeBaseTitle"),link:"/knowledgeBase"},{name:"systemStatus",label:_mailpoet2.default.I18n.t("tabSystemStatusTitle"),link:"/systemStatus"},{name:"systemInfo",label:_mailpoet2.default.I18n.t("tabSystemInfoTitle"),link:"/systemInfo"},{name:"yourPrivacy",label:_mailpoet2.default.I18n.t("tabYourPrivacyTitle"),link:"/yourPrivacy"}];Tabs.propTypes={tab:_propTypes2.default.string},Tabs.defaultProps={tab:"knowledgeBase"},module.exports=Tabs},292:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}function confirmAlert(props){_reactDom2.default.render(_react2.default.createElement(ConfirmAlert,props),document.getElementById("mailpoet_confirm_alert_holder"))}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}();exports.default=confirmAlert;var _mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),ConfirmAlert=function(_React$Component){function ConfirmAlert(props){_classCallCheck(this,ConfirmAlert);var _this=_possibleConstructorReturn(this,(ConfirmAlert.__proto__||Object.getPrototypeOf(ConfirmAlert)).call(this,props));return _this.componentWillUpdate=function(){_this.state.show||_this.setState({show:!0})},_this.onClose=function(){_this.setState({show:!1})},_this.onConfirm=function(){_this.onClose(),_this.props.onConfirm()},_this.state={show:!0},_this}return _inherits(ConfirmAlert,_React$Component),_createClass(ConfirmAlert,[{key:"render",value:function(){var _props=this.props,title=_props.title,message=_props.message,confirmLabel=_props.confirmLabel,cancelLabel=_props.cancelLabel;return this.state.show&&_react2.default.createElement("div",{className:"mailpoet_modal_overlay"},_react2.default.createElement("div",{className:"mailpoet_popup",tabIndex:"-1"},_react2.default.createElement("div",{className:"mailpoet_popup_wrapper"},_react2.default.createElement("button",{className:"mailpoet_modal_close",onClick:this.onClose}),title&&_react2.default.createElement("div",{className:"mailpoet_popup_title"},_react2.default.createElement("h2",null,title)),_react2.default.createElement("div",{className:"mailpoet_popup_body clearfix"},_react2.default.createElement("p",{className:"mailpoet_hp_email_label"},message),_react2.default.createElement("button",{className:"button button-secondary",onClick:this.onClose},cancelLabel),_react2.default.createElement("button",{className:"button button-primary",onClick:this.onConfirm},confirmLabel)))))}}]),ConfirmAlert}(_react2.default.Component);ConfirmAlert.propTypes={title:_propTypes2.default.string,message:_propTypes2.default.string.isRequired,cancelLabel:_propTypes2.default.string,confirmLabel:_propTypes2.default.string,onConfirm:_propTypes2.default.func.isRequired},ConfirmAlert.defaultProps={title:_mailpoet2.default.I18n.t("confirmTitle"),cancelLabel:_mailpoet2.default.I18n.t("cancelLabel"),confirmLabel:_mailpoet2.default.I18n.t("confirmLabel")}},293:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_select=__webpack_require__(263),_select2=_interopRequireDefault(_select),_common=__webpack_require__(269),intervalField={name:"intervalType",values:_common.intervalValues},timeOfDayField={name:"timeOfDay",values:_common.timeOfDayValues},weekDayField={name:"weekDay",values:_common.weekDayValues},monthDayField={name:"monthDay",values:_common.monthDayValues},nthWeekDayField={name:"nthWeekDay",values:_common.nthWeekDayValues},NotificationScheduling=function(_React$Component){function NotificationScheduling(){var _ref,_temp,_this,_ret;_classCallCheck(this,NotificationScheduling);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=NotificationScheduling.__proto__||Object.getPrototypeOf(NotificationScheduling)).call.apply(_ref,[this].concat(args))),_this.getCurrentValue=function(){return _this.props.item[_this.props.field.name]||{}},_this.handleValueChange=function(name,value){var oldValue=_this.getCurrentValue(),newValue={};return newValue[name]=value,_this.props.onValueChange({target:{name:_this.props.field.name,value:_underscore2.default.extend({},oldValue,newValue)}})},_this.handleIntervalChange=function(event){return _this.handleValueChange("intervalType",event.target.value)},_this.handleTimeOfDayChange=function(event){return _this.handleValueChange("timeOfDay",event.target.value)},_this.handleWeekDayChange=function(event){return _this.handleValueChange("weekDay",event.target.value)},_this.handleMonthDayChange=function(event){return _this.handleValueChange("monthDay",event.target.value)},_this.handleNthWeekDayChange=function(event){return _this.handleValueChange("nthWeekDay",event.target.value)},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(NotificationScheduling,_React$Component),_createClass(NotificationScheduling,[{key:"render",value:function(){var value=this.getCurrentValue(),timeOfDaySelection=void 0,weekDaySelection=void 0,monthDaySelection=void 0,nthWeekDaySelection=void 0;return"immediately"!==value.intervalType&&(timeOfDaySelection=_react2.default.createElement(_select2.default,{field:timeOfDayField,item:this.getCurrentValue(),onValueChange:this.handleTimeOfDayChange})),"weekly"!==value.intervalType&&"nthWeekDay"!==value.intervalType||(weekDaySelection=_react2.default.createElement(_select2.default,{field:weekDayField,item:this.getCurrentValue(),onValueChange:this.handleWeekDayChange})),"monthly"===value.intervalType&&(monthDaySelection=_react2.default.createElement(_select2.default,{field:monthDayField,item:this.getCurrentValue(),onValueChange:this.handleMonthDayChange})),"nthWeekDay"===value.intervalType&&(nthWeekDaySelection=_react2.default.createElement(_select2.default,{field:nthWeekDayField,item:this.getCurrentValue(),onValueChange:this.handleNthWeekDayChange})),_react2.default.createElement("div",null,_react2.default.createElement(_select2.default,{field:intervalField,item:this.getCurrentValue(),onValueChange:this.handleIntervalChange,automationId:"newsletter_interval_type"}),nthWeekDaySelection,monthDaySelection,weekDaySelection,timeOfDaySelection)}}]),NotificationScheduling}(_react2.default.Component);NotificationScheduling.propTypes={item:_propTypes2.default.object.isRequired,field:_propTypes2.default.shape({name:_propTypes2.default.string}).isRequired,onValueChange:_propTypes2.default.func.isRequired},module.exports=NotificationScheduling},295:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),KeyValueTable=function(props){return _react2.default.createElement("table",{className:"widefat fixed",style:{maxWidth:props.max_width}},_react2.default.createElement("tbody",null,props.rows.map(function(row){return _react2.default.createElement("tr",{key:"row_"+row.key},_react2.default.createElement("td",{className:"row-title"},row.key),_react2.default.createElement("td",null,row.value))})))};KeyValueTable.propTypes={max_width:_propTypes2.default.string,rows:_propTypes2.default.arrayOf(_propTypes2.default.shape({key:_propTypes2.default.string.isRequired,value:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number,_propTypes2.default.element]).isRequired})).isRequired},KeyValueTable.defaultProps={max_width:"auto"},module.exports=KeyValueTable},296:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),TasksListDataRow=function(props){return _react2.default.createElement("tr",null,_react2.default.createElement("td",{className:"column column-primary"},props.task.id),_react2.default.createElement("td",{className:"column"},props.task.type),_react2.default.createElement("td",{className:"column"},props.task.newsletter?_react2.default.createElement("a",{href:props.task.newsletter.preview_url,"data-newsletter-id":props.task.newsletter.newsletter_id,"data-queue-id":props.task.newsletter.queue_id,target:"_blank"},props.task.newsletter.subject||_mailpoet2.default.I18n.t("preview")):_mailpoet2.default.I18n.t("none")),_react2.default.createElement("td",{className:"column"},props.task.priority),props.show_scheduled_at?_react2.default.createElement("td",{className:"column-date"},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(1e3*props.task.scheduled_at))):null,_react2.default.createElement("td",{className:"column-date"},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(1e3*props.task.updated_at))))};TasksListDataRow.propTypes={show_scheduled_at:_propTypes2.default.bool,task:_propTypes2.default.shape({id:_propTypes2.default.number.isRequired,type:_propTypes2.default.string.isRequired,priority:_propTypes2.default.number.isRequired,updated_at:_propTypes2.default.number.isRequired,scheduled_at:_propTypes2.default.number,status:_propTypes2.default.string,newsletter:_propTypes2.default.shape({newsletter_id:_propTypes2.default.number.isRequired,queue_id:_propTypes2.default.number.isRequired,preview_url:_propTypes2.default.string.isRequired,subject:_propTypes2.default.string})}).isRequired},TasksListDataRow.defaultProps={show_scheduled_at:!1,task:{newsletter:null}},module.exports=TasksListDataRow},390:function(module,exports,__webpack_require__){"use strict";__webpack_require__(391),__webpack_require__(395),__webpack_require__(423),__webpack_require__(427),__webpack_require__(429),__webpack_require__(431),__webpack_require__(441),__webpack_require__(443),__webpack_require__(444),__webpack_require__(447),__webpack_require__(448),__webpack_require__(457),__webpack_require__(459)},391:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactRouterDom=__webpack_require__(7),_list=__webpack_require__(392),_list2=_interopRequireDefault(_list),_form=__webpack_require__(393),_form2=_interopRequireDefault(_form),container=document.getElementById("subscribers_container");container&&_reactDom2.default.render(_react2.default.createElement(_reactRouterDom.HashRouter,null,_react2.default.createElement(_reactRouterDom.Switch,null,_react2.default.createElement(_reactRouterDom.Route,{path:"/new",component:_form2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"/edit/:id",component:_form2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"*",component:_list2.default}))),container)},392:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(7),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),_selection=__webpack_require__(283),_selection2=_interopRequireDefault(_selection),columns=[{name:"email",label:_mailpoet2.default.I18n.t("subscriber"),sortable:!0},{name:"status",label:_mailpoet2.default.I18n.t("status"),sortable:!0},{name:"segments",label:_mailpoet2.default.I18n.t("lists")},{name:"created_at",label:_mailpoet2.default.I18n.t("subscribedOn"),sortable:!0},{name:"updated_at",label:_mailpoet2.default.I18n.t("lastModifiedOn"),sortable:!0}],messages={onTrash:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneSubscriberTrashed"):_mailpoet2.default.I18n.t("multipleSubscribersTrashed").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onDelete:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneSubscriberDeleted"):_mailpoet2.default.I18n.t("multipleSubscribersDeleted").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onRestore:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneSubscriberRestored"):_mailpoet2.default.I18n.t("multipleSubscribersRestored").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onNoItemsFound:function(group){return"bounced"===group&&!window.mailpoet_premium_active&&!window.mss_active&&_react2.default.createElement("div",null,_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("bouncedSubscribersHelp")),_react2.default.createElement("p",null,_react2.default.createElement("a",{href:"admin.php?page=mailpoet-premium",className:"button-primary"},_mailpoet2.default.I18n.t("bouncedSubscribersPremiumButtonText"))))}},bulkActions=[{name:"moveToList",label:_mailpoet2.default.I18n.t("moveToList"),onSelect:function(){var field={id:"move_to_segment",api_version:window.mailpoet_api_version,endpoint:"segments",filter:function(segment){return!(segment.deleted_at||"default"!==segment.type)}};return _react2.default.createElement(_selection2.default,{field:field})},getData:function(){return{segment_id:Number((0,_jquery2.default)("#move_to_segment").val())}},onSuccess:function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("multipleSubscribersMovedToList").replace("%$1d",Number(response.meta.count).toLocaleString()).replace("%$2s",response.meta.segment))}},{name:"addToList",label:_mailpoet2.default.I18n.t("addToList"),onSelect:function(){var field={id:"add_to_segment",api_version:window.mailpoet_api_version,endpoint:"segments",filter:function(segment){return!(segment.deleted_at||"default"!==segment.type)}};return _react2.default.createElement(_selection2.default,{field:field})},getData:function(){return{segment_id:Number((0,_jquery2.default)("#add_to_segment").val())}},onSuccess:function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("multipleSubscribersAddedToList").replace("%$1d",Number(response.meta.count).toLocaleString()).replace("%$2s",response.meta.segment))}},{name:"removeFromList",label:_mailpoet2.default.I18n.t("removeFromList"),onSelect:function(){var field={id:"remove_from_segment",api_version:window.mailpoet_api_version,endpoint:"segments",filter:function(segment){return!("default"!==segment.type)}};return _react2.default.createElement(_selection2.default,{field:field})},getData:function(){return{segment_id:Number((0,_jquery2.default)("#remove_from_segment").val())}},onSuccess:function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("multipleSubscribersRemovedFromList").replace("%$1d",Number(response.meta.count).toLocaleString()).replace("%$2s",response.meta.segment))}},{name:"removeFromAllLists",label:_mailpoet2.default.I18n.t("removeFromAllLists"),onSuccess:function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("multipleSubscribersRemovedFromAllLists").replace("%$1d",Number(response.meta.count).toLocaleString()))}},{name:"sendConfirmationEmail",label:_mailpoet2.default.I18n.t("resendConfirmationEmail"),onSuccess:function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("multipleConfirmationEmailsSent").replace("%$1d",Number(response.meta.count).toLocaleString()))}},{name:"trash",label:_mailpoet2.default.I18n.t("moveToTrash"),onSuccess:messages.onTrash}],itemActions=[{name:"edit",label:_mailpoet2.default.I18n.t("edit"),link:function(subscriber){return _react2.default.createElement(_reactRouterDom.Link,{to:"/edit/"+subscriber.id},_mailpoet2.default.I18n.t("edit"))}},{name:"trash",display:function(subscriber){return 0===Number(subscriber.wp_user_id)}}],SubscriberList=function(_React$Component){function SubscriberList(){var _ref,_temp,_this,_ret;_classCallCheck(this,SubscriberList);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=SubscriberList.__proto__||Object.getPrototypeOf(SubscriberList)).call.apply(_ref,[this].concat(args))),_this.getSegmentFromId=function(segmentId){var result=!1;return window.mailpoet_segments.forEach(function(segment){segment.id===segmentId&&(result=segment)}),result},_this.renderItem=function(subscriber,actions){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions","column-username"),status="";switch(subscriber.status){case"subscribed":status=_mailpoet2.default.I18n.t("subscribed");break;case"unconfirmed":status=_mailpoet2.default.I18n.t("unconfirmed");break;case"unsubscribed":status=_mailpoet2.default.I18n.t("unsubscribed");break;case"bounced":status=_mailpoet2.default.I18n.t("bounced");break;default:status="Invalid"}var segments=!1;if(subscriber.subscriptions.length>0){var subscribedSegments=[];subscriber.subscriptions.forEach(function(subscription){var segment=_this.getSegmentFromId(subscription.segment_id);!1!==segment&&"subscribed"===subscription.status&&subscribedSegments.push(segment.name)}),segments=_react2.default.createElement("span",null,subscribedSegments.join(", "))}return _react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,_react2.default.createElement(_reactRouterDom.Link,{className:"row-title",to:"/edit/"+subscriber.id},subscriber.email)),_react2.default.createElement("p",{style:{margin:0}},subscriber.first_name," ",subscriber.last_name),actions),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("status")},status),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("lists")},segments),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("subscribedOn")},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(subscriber.created_at))),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("lastModifiedOn")},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(subscriber.updated_at))))},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(SubscriberList,_React$Component),_createClass(SubscriberList,[{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",{className:"title"},_mailpoet2.default.I18n.t("pageTitle")," ",_react2.default.createElement(_reactRouterDom.Link,{className:"page-title-action",to:"/new"},_mailpoet2.default.I18n.t("new")),_react2.default.createElement("a",{className:"page-title-action",href:"?page=mailpoet-import#step1"},_mailpoet2.default.I18n.t("import")),_react2.default.createElement("a",{id:"mailpoet_export_button",className:"page-title-action",href:"?page=mailpoet-export"},_mailpoet2.default.I18n.t("export"))),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"subscribers",onRenderItem:this.renderItem,columns:columns,bulk_actions:bulkActions,item_actions:itemActions,messages:messages,sort_by:"created_at",sort_order:"desc"}))}}]),SubscriberList}(_react2.default.Component);SubscriberList.propTypes={location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},module.exports=SubscriberList},393:function(module,exports,__webpack_require__){"use strict";(function(global){global.MailPoetLib||(global.MailPoetLib={}),module.exports=global.MailPoetLib.Form=__webpack_require__(394)}).call(exports,__webpack_require__(6))},394:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}function beforeFormContent(subscriber){if(Number(subscriber.wp_user_id)>0)return _react2.default.createElement("p",{className:"description"},(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("WPUserEditNotice"),/\[link\](.*?)\[\/link\]/g,function(match,i){return _react2.default.createElement("a",{key:i,href:"user-edit.php?user_id="+subscriber.wp_user_id},match)}))}function afterFormContent(){return _react2.default.createElement("p",{className:"description"},_react2.default.createElement("strong",null,_mailpoet2.default.I18n.t("tip"))," ",_mailpoet2.default.I18n.t("customFieldsTip"))}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(7),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_form=__webpack_require__(187),_form2=_interopRequireDefault(_form),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),fields=[{name:"email",label:_mailpoet2.default.I18n.t("email"),type:"text",disabled:function(subscriber){return Number(subscriber.wp_user_id>0)}},{name:"first_name",label:_mailpoet2.default.I18n.t("firstname"),type:"text",disabled:function(subscriber){return Number(subscriber.wp_user_id>0)}},{name:"last_name",label:_mailpoet2.default.I18n.t("lastname"),type:"text",disabled:function(subscriber){return Number(subscriber.wp_user_id>0)}},{name:"status",label:_mailpoet2.default.I18n.t("status"),type:"select",values:{subscribed:_mailpoet2.default.I18n.t("subscribed"),unconfirmed:_mailpoet2.default.I18n.t("unconfirmed"),unsubscribed:_mailpoet2.default.I18n.t("unsubscribed"),bounced:_mailpoet2.default.I18n.t("bounced")},filter:function(subscriber,value){return!(Number(subscriber.wp_user_id)>0&&"unconfirmed"===value)}},{name:"segments",label:_mailpoet2.default.I18n.t("lists"),type:"selection",placeholder:_mailpoet2.default.I18n.t("selectList"),tip:_mailpoet2.default.I18n.t("welcomeEmailTip"),api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,selected:function(subscriber){return!1===Array.isArray(subscriber.subscriptions)?null:subscriber.subscriptions.filter(function(subscription){return"subscribed"===subscription.status}).map(function(subscription){return subscription.segment_id})},filter:function(segment){return!segment.deleted_at&&"default"===segment.type},getLabel:function(segment){return segment.name+" ("+segment.subscribers+")"},getSearchLabel:function(segment,subscriber){var label="";return void 0!==subscriber.subscriptions&&subscriber.subscriptions.forEach(function(subscription){if(segment.id===subscription.segment_id&&(label=segment.name,"unsubscribed"===subscription.status)){var unsubscribedAt=_mailpoet2.default.Date.format(subscription.updated_at);label+=" (%$1s)".replace("%$1s",_mailpoet2.default.I18n.t("unsubscribedOn").replace("%$1s",unsubscribedAt))}}),label}}];(window.mailpoet_custom_fields||[]).forEach(function(customField){var field={name:"cf_"+customField.id,label:customField.name,type:customField.type};switch(customField.params&&(field.params=customField.params),customField.params.values&&(field.values=customField.params.values),customField.type){case"date":field.year_placeholder=_mailpoet2.default.I18n.t("year"),field.month_placeholder=_mailpoet2.default.I18n.t("month"),field.day_placeholder=_mailpoet2.default.I18n.t("day");break;case"select":field.placeholder="-";break;default:field.placeholder=""}fields.push(field)});var messages={onUpdate:function(){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("subscriberUpdated"))},onCreate:function(){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("subscriberAdded")),_mailpoet2.default.trackEvent("Subscribers > Add new",{"MailPoet Free version":window.mailpoet_version})}},SubscriberForm=function(_React$Component){function SubscriberForm(){return _classCallCheck(this,SubscriberForm),_possibleConstructorReturn(this,(SubscriberForm.__proto__||Object.getPrototypeOf(SubscriberForm)).apply(this,arguments))}return _inherits(SubscriberForm,_React$Component),_createClass(SubscriberForm,[{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",{className:"title"},_mailpoet2.default.I18n.t("subscriber"),_react2.default.createElement(_reactRouterDom.Link,{className:"page-title-action",to:"/"},_mailpoet2.default.I18n.t("backToList"))),_react2.default.createElement(_form2.default,{endpoint:"subscribers",fields:fields,params:this.props.match.params,messages:messages,beforeFormContent:beforeFormContent,afterFormContent:afterFormContent}))}}]),SubscriberForm}(_react2.default.Component);SubscriberForm.propTypes={match:_propTypes2.default.shape({params:_propTypes2.default.shape({id:_propTypes2.default.string}).isRequired}).isRequired},module.exports=SubscriberForm},395:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactRouterDom=__webpack_require__(7),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_types=__webpack_require__(396),_types2=_interopRequireDefault(_types),_templates=__webpack_require__(397),_templates2=_interopRequireDefault(_templates),_send=__webpack_require__(402),_send2=_interopRequireDefault(_send),_congratulate=__webpack_require__(411),_congratulate2=_interopRequireDefault(_congratulate),_standard=__webpack_require__(416),_standard2=_interopRequireDefault(_standard),_notification=__webpack_require__(417),_notification2=_interopRequireDefault(_notification),_welcome=__webpack_require__(418),_welcome2=_interopRequireDefault(_welcome),_events_list=__webpack_require__(290),_events_list2=_interopRequireDefault(_events_list),_standard3=__webpack_require__(419),_standard4=_interopRequireDefault(_standard3),_welcome3=__webpack_require__(420),_welcome4=_interopRequireDefault(_welcome3),_notification3=__webpack_require__(421),_notification4=_interopRequireDefault(_notification3),_notification_history=__webpack_require__(422),_notification_history2=_interopRequireDefault(_notification_history);((function(_React$Component){function App(){return _classCallCheck(this,App),_possibleConstructorReturn(this,(App.__proto__||Object.getPrototypeOf(App)).apply(this,arguments))}return _inherits(App,_React$Component),_createClass(App,[{key:"render",value:function(){return this.props.children}}]),App})(_react2.default.Component)).propTypes={children:_propTypes2.default.element.isRequired};var container=document.getElementById("newsletters_container");if(container){var routes=[{path:"/standard(/)**",component:_standard4.default},{path:"/welcome(/)**",component:_welcome4.default},{path:"/notification/history/:parent_id(/)**",component:_notification_history2.default},{path:"/notification(/)**",component:_notification4.default},{path:"/new/standard",component:_standard2.default},{path:"/new/notification",component:_notification2.default},{path:"/new/welcome",component:_welcome2.default},{path:"/new",component:_types2.default},{name:"template",path:"/template/:id",component:_templates2.default},{path:"/send/congratulate/:id",component:_congratulate2.default},{path:"/send/:id",component:_send2.default}];routes=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_before_router",[].concat(_toConsumableArray(routes),_toConsumableArray(function(){return window.mailpoet_automatic_emails?_underscore2.default.map(window.mailpoet_automatic_emails,function(automaticEmail){return{path:"new/"+automaticEmail.slug,name:automaticEmail.slug,component:_events_list2.default,data:{email:automaticEmail}}}):null}()))),window.mailpoet_listing=_reactDom2.default.render(_react2.default.createElement(_reactRouterDom.HashRouter,null,_react2.default.createElement(_reactRouterDom.Switch,null,_react2.default.createElement(_reactRouterDom.Route,{exact:!0,path:"/",render:function(){return _react2.default.createElement(_reactRouterDom.Redirect,{to:"/standard"})}}),routes.map(function(route){return _react2.default.createElement(_reactRouterDom.Route,{key:route.path,path:route.path,component:route.component,name:route.name||null,data:route.data||null,render:route.render})}))),container)}},396:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_reactRouterDom=__webpack_require__(7),NewsletterTypes=function(_React$Component){function NewsletterTypes(){var _ref,_temp,_this,_ret;_classCallCheck(this,NewsletterTypes);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=NewsletterTypes.__proto__||Object.getPrototypeOf(NewsletterTypes)).call.apply(_ref,[this].concat(args))),_this.setupNewsletter=function(type){void 0!==type&&(_this.props.history.push("/new/"+type),_mailpoet2.default.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":type}))},_this.getAutomaticEmails=function(){return window.mailpoet_automatic_emails?_underscore2.default.map(window.mailpoet_automatic_emails,function(automaticEmail){var email=automaticEmail,onClick=_underscore2.default.partial(_this.setupNewsletter,automaticEmail.slug);return email.action=function(){return _react2.default.createElement("div",null,_react2.default.createElement("a",{className:"button button-primary",onClick:onClick,role:"button",tabIndex:0},_mailpoet2.default.I18n.t("setUp")))}(),email}):[]},_this.createNewsletter=function(type){_mailpoet2.default.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":type}),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:type,subject:_mailpoet2.default.I18n.t("draftNewsletterTitle")}}).done(function(response){_this.props.history.push("/template/"+response.data.id)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(NewsletterTypes,_React$Component),_createClass(NewsletterTypes,[{key:"render",value:function(){var createStandardNewsletter=_underscore2.default.partial(this.createNewsletter,"standard"),createNotificationNewsletter=_underscore2.default.partial(this.setupNewsletter,"notification"),createWelcomeNewsletter=_underscore2.default.partial(this.setupNewsletter,"welcome"),defaultTypes=[{slug:"standard",title:_mailpoet2.default.I18n.t("regularNewsletterTypeTitle"),description:_mailpoet2.default.I18n.t("regularNewsletterTypeDescription"),action:function(){return _react2.default.createElement("a",{className:"button button-primary","data-automation-id":"create_standard",onClick:createStandardNewsletter,role:"button",tabIndex:0},_mailpoet2.default.I18n.t("create"))}()},{slug:"welcome",title:_mailpoet2.default.I18n.t("welcomeNewsletterTypeTitle"),description:_mailpoet2.default.I18n.t("welcomeNewsletterTypeDescription"),videoGuide:"https://beta.docs.mailpoet.com/article/254-video-guide-to-welcome-emails",action:function(){return _react2.default.createElement("a",{className:"button button-primary",onClick:createWelcomeNewsletter,"data-automation-id":"create_welcome",onKeyDown:function(event){["keydown","keypress"].includes(event.type)&&["Enter"," "].includes(event.key)&&(event.preventDefault(),createWelcomeNewsletter())},role:"button",tabIndex:0},_mailpoet2.default.I18n.t("setUp"))}()},{slug:"notification",title:_mailpoet2.default.I18n.t("postNotificationNewsletterTypeTitle"),description:_mailpoet2.default.I18n.t("postNotificationNewsletterTypeDescription"),videoGuide:"https://beta.docs.mailpoet.com/article/210-video-guide-to-post-notifications",action:function(){return _react2.default.createElement("a",{className:"button button-primary","data-automation-id":"create_notification",onClick:createNotificationNewsletter,role:"button",tabIndex:0},_mailpoet2.default.I18n.t("setUp"))}()}],types=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_types",[].concat(defaultTypes,_toConsumableArray(this.getAutomaticEmails())),this),badgeClassName=!0===window.mailpoet_is_new_user?"mailpoet_badge mailpoet_badge_video":"mailpoet_badge mailpoet_badge_video mailpoet_badge_video_grey";return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("pickCampaignType")),_react2.default.createElement(_breadcrumb2.default,{step:"type"}),_react2.default.createElement("ul",{className:"mailpoet_boxes clearfix"},types.map(function(type){return _react2.default.createElement("li",{key:type.slug,"data-type":type.slug,className:"mailpoet_newsletter_types"},_react2.default.createElement("div",null,_react2.default.createElement("div",{className:"mailpoet_thumbnail"},type.thumbnailImage?_react2.default.createElement("img",{src:type.thumbnailImage,alt:""}):null),_react2.default.createElement("div",{className:"mailpoet_description"},_react2.default.createElement("h3",null,type.title," ",type.beta?"("+_mailpoet2.default.I18n.t("beta")+")":""),_react2.default.createElement("p",null,type.description),type.videoGuide&&_react2.default.createElement("a",{className:badgeClassName,href:type.videoGuide,target:"_blank"},_react2.default.createElement("span",{className:"dashicons dashicons-format-video"}),_mailpoet2.default.I18n.t("seeVideoGuide"))),_react2.default.createElement("div",{className:"mailpoet_actions"},type.action)))},this)))}}]),NewsletterTypes}(_react2.default.Component);NewsletterTypes.propTypes={history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},module.exports=(0,_reactRouterDom.withRouter)(NewsletterTypes)},397:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_loading=__webpack_require__(398),_loading2=_interopRequireDefault(_loading),_tabs=__webpack_require__(399),_tabs2=_interopRequireDefault(_tabs),_template_box=__webpack_require__(400),_template_box2=_interopRequireDefault(_template_box),_import_template=__webpack_require__(401),_import_template2=_interopRequireDefault(_import_template),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),getEditorUrl=function(id){return"admin.php?page=mailpoet-newsletter-editor&id="+id},templatesCategories=[{name:"standard",label:_mailpoet2.default.I18n.t("tabStandardTitle")},{name:"welcome",label:_mailpoet2.default.I18n.t("tabWelcomeTitle")},{name:"notification",label:_mailpoet2.default.I18n.t("tabNotificationTitle")}];window.mailpoet_woocommerce_active&&templatesCategories.push({name:"woocommerce",label:_mailpoet2.default.I18n.t("tabWoocommerceTitle")}),templatesCategories.push.apply(templatesCategories,[{name:"all",label:_mailpoet2.default.I18n.t("allTemplates")},{name:"recent",label:_mailpoet2.default.I18n.t("recentlySent")},{name:"saved",label:_mailpoet2.default.I18n.t("savedTemplates")}]);var NewsletterTemplates=function(_React$Component){function NewsletterTemplates(props){_classCallCheck(this,NewsletterTemplates);var _this=_possibleConstructorReturn(this,(NewsletterTemplates.__proto__||Object.getPrototypeOf(NewsletterTemplates)).call(this,props));return _this.state={loading:!0,templates:{},emailType:null,selectedTab:""},_this.templates={},_this.addTemplate=_this.addTemplate.bind(_this),_this.afterTemplateDelete=_this.afterTemplateDelete.bind(_this),_this.afterTemplateSelect=_this.afterTemplateSelect.bind(_this),_this.afterTemplateImport=_this.afterTemplateImport.bind(_this),_this}return _inherits(NewsletterTemplates,_React$Component),_createClass(NewsletterTemplates,[{key:"componentWillMount",value:function(){var _this2=this;_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"getAll"}).done(function(response){0===response.data.length&&(response.data=[{name:_mailpoet2.default.I18n.t("mailpoetGuideTemplateTitle"),categories:'["welcome", "notification", "standard", "woocommerce"]',readonly:"1"}]),response.data.forEach(_this2.addTemplate),_this2.sortTemplates()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})}).always(function(){_this2.selectInitialTab()})}},{key:"addTemplate",value:function(template){var _this3=this,categoriesNames=templatesCategories.map(function(category){return category.name}),categories=void 0;try{categories=JSON.parse(template.categories).filter(function(name){return-1!==categoriesNames.indexOf(name)})}catch(err){categories=[]}0===categories.length&&categories.push("saved"),categories.forEach(function(category){void 0===_this3.templates[category]&&(_this3.templates[category]=[]),_this3.templates[category].unshift(template)})}},{key:"sortTemplates",value:function(){var _this4=this;Object.keys(this.templates).forEach(function(category){_this4.templates[category].sort(function(a,b){return parseInt(a.id,10)<parseInt(b.id,10)?1:-1})})}},{key:"selectInitialTab",value:function(){var _this5=this,emailType=void 0,selectedTab="standard";_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:this.props.match.params.id}}).done(function(response){emailType=response.data.type,_underscore2.default.findWhere(templatesCategories,{name:response.data.type})&&(selectedTab=response.data.type)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})}).always(function(){_this5.setState({templates:_this5.templates,emailType:emailType,selectedTab:selectedTab,loading:!1})})}},{key:"afterTemplateDelete",value:function(success,id){var _this6=this;success&&Object.keys(this.templates).forEach(function(category){_this6.templates[category]=_this6.templates[category].filter(function(template){return template.id!==id})}),this.setState({templates:this.templates,loading:!1})}},{key:"afterTemplateSelect",value:function(success,id){success?window.location=getEditorUrl(id):this.setState({loading:!1})}},{key:"afterTemplateImport",value:function(success,template){success&&this.addTemplate(template),this.setState({templates:this.templates,selectedTab:success?"saved":"import",loading:!1})}},{key:"render",value:function(){var _this7=this;if(this.state.loading)return _react2.default.createElement(_loading2.default,null);var tabs=templatesCategories.concat({name:"import",label:_mailpoet2.default.I18n.t("tabImportTitle")}),selectedTab=this.state.selectedTab,content=null;if("import"===selectedTab)content=_react2.default.createElement(_import_template2.default,{beforeImport:function(){return _this7.setState({loading:!0})},afterImport:this.afterTemplateImport});else{var templates=this.state.templates[this.state.selectedTab]||[];templates=0===templates.length?this.state.loading?null:_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("noTemplates")):templates.map(function(template,index){return _react2.default.createElement(_template_box2.default,_extends({key:template.id,index:index,newsletterId:_this7.props.match.params.id,beforeDelete:function(){return _this7.setState({loading:!0})},afterDelete:_this7.afterTemplateDelete,beforeSelect:function(){return _this7.setState({loading:!0})},afterSelect:_this7.afterTemplateSelect},template))}),content=_react2.default.createElement("ul",{className:"mailpoet_boxes clearfix"},templates)}var breadcrumb=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_template_breadcrumb",_react2.default.createElement(_breadcrumb2.default,{step:"template"}),this.state.emailType,"template");return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("selectTemplateTitle")),breadcrumb,_react2.default.createElement(_tabs2.default,{tabs:tabs,selected:this.state.selectedTab,select:function(name){return _this7.setState({selectedTab:name})}}),content)}}]),NewsletterTemplates}(_react2.default.Component);NewsletterTemplates.propTypes={match:_propTypes2.default.shape({params:_propTypes2.default.shape({id:_propTypes2.default.string}).isRequired}).isRequired},exports.default=NewsletterTemplates},398:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),Loading=function(_React$Component){function Loading(){return _classCallCheck(this,Loading),_possibleConstructorReturn(this,(Loading.__proto__||Object.getPrototypeOf(Loading)).apply(this,arguments))}return _inherits(Loading,_React$Component),_createClass(Loading,[{key:"componentWillMount",value:function(){_mailpoet2.default.Modal.loading(!0)}},{key:"componentWillUnmount",value:function(){_mailpoet2.default.Modal.loading(!1)}},{key:"render",value:function(){return null}}]),Loading}(_react2.default.Component);exports.default=Loading},399:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_reactTooltip=__webpack_require__(158),_reactTooltip2=_interopRequireDefault(_reactTooltip),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),tooltipText=(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("tooltipTemplateTabs"),/\[link\](.*?)\[\/link\]/g,function(match){return _react2.default.createElement("a",{href:"https://mailpoet.polldaddy.com/s/select-template-feedback",key:"feedback",target:"_blank",rel:"noopener noreferrer"},match)}),Tabs=function(_ref){var tabs=_ref.tabs,selected=_ref.selected,select=_ref.select;return _react2.default.createElement("div",{className:"wp-filter hide-if-no-js"},_react2.default.createElement("ul",{className:"filter-links"},tabs.map(function(_ref2){var name=_ref2.name,label=_ref2.label;return _react2.default.createElement("li",{key:name},_react2.default.createElement("a",{href:"javascript:",className:selected===name?"current":"",onClick:function(){return select(name)}}," ",label))})),_react2.default.createElement("span",{className:"feedback-tooltip newsletter-templates-feedback","data-event":"click","data-tip":!0,"data-for":"feedback-newsletter-templates-tabs"},_mailpoet2.default.I18n.t("feedback")),_react2.default.createElement(_reactTooltip2.default,{globalEventOff:"click",multiline:!0,id:"feedback-newsletter-templates-tabs",efect:"solid",place:"bottom"},_react2.default.createElement("span",{style:{pointerEvents:"all",display:"inline-block"}},tooltipText)))};Tabs.propTypes={selected:_propTypes2.default.string.isRequired,select:_propTypes2.default.func.isRequired,tabs:_propTypes2.default.arrayOf(_propTypes2.default.shape({label:_propTypes2.default.string.isRequired,name:_propTypes2.default.string.isRequired}).isRequired).isRequired},exports.default=Tabs},400:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_confirm_alert=__webpack_require__(292),_confirm_alert2=_interopRequireDefault(_confirm_alert),TemplateBox=function(_React$Component){function TemplateBox(props){_classCallCheck(this,TemplateBox);var _this=_possibleConstructorReturn(this,(TemplateBox.__proto__||Object.getPrototypeOf(TemplateBox)).call(this,props));return _this.onPreview=_this.onPreview.bind(_this),_this.onDelete=_this.onDelete.bind(_this),_this.onSelect=_this.onSelect.bind(_this),_this}return _inherits(TemplateBox,_React$Component),_createClass(TemplateBox,[{key:"onDelete",value:function(){var _props=this.props,id=_props.id,name=_props.name,beforeDelete=_props.beforeDelete,afterDelete=_props.afterDelete,onConfirm=function(){beforeDelete(),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"delete",data:{id:id}}).done(function(){afterDelete(!0,id)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0}),afterDelete(!1)})};(0,_confirm_alert2.default)({message:_mailpoet2.default.I18n.t("confirmTemplateDeletion").replace("%$1s",name),onConfirm:onConfirm})}},{key:"onPreview",value:function(){_mailpoet2.default.Modal.popup({title:this.props.name,template:'<div class="mailpoet_boxes_preview" style="background-color: {{ body.globalStyles.body.backgroundColor }}"><img src="{{ thumbnail }}" /></div>',data:this.props})}},{key:"onSelect",value:function(){var _props2=this.props,newsletterId=_props2.newsletterId,name=_props2.name,beforeSelect=_props2.beforeSelect,afterSelect=_props2.afterSelect;beforeSelect(),_mailpoet2.default.trackEvent("Emails > Template selected",{"MailPoet Free version":window.mailpoet_version,"Email name":name}),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"save",data:{id:newsletterId,template_id:this.props.id}}).done(function(response){afterSelect(!0,response.data.id)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0}),afterSelect(!1)})}},{key:"render",value:function(){var _props3=this.props,index=_props3.index,name=_props3.name,thumbnail=_props3.thumbnail,readonly=_props3.readonly,deleteLink=_react2.default.createElement("div",{className:"mailpoet_delete button button-secondary"},_react2.default.createElement("a",{href:"javascript:;",onClick:this.onDelete},_mailpoet2.default.I18n.t("delete"))),preview="";return"string"==typeof thumbnail&&thumbnail.length>0&&(preview=_react2.default.createElement("a",{href:"javascript:;",onClick:this.onPreview},_react2.default.createElement("img",{src:thumbnail,alt:_mailpoet2.default.I18n.t("templatePreview")}),_react2.default.createElement("div",{className:"mailpoet_overlay"},_react2.default.createElement("p",{className:"mailpoet_more_details"},_mailpoet2.default.I18n.t("zoom"))))),_react2.default.createElement("li",{className:"mailpoet_template_boxes","data-automation-id":"select_template_box"},_react2.default.createElement("div",{className:"mailpoet_thumbnail"},preview),_react2.default.createElement("div",{className:"mailpoet_description"},_react2.default.createElement("h3",null,name)),_react2.default.createElement("div",{className:"mailpoet_actions"},"1"!==readonly&&deleteLink,_react2.default.createElement("a",{className:"button button-primary","data-automation-id":"select_template_"+index,onClick:this.onSelect,role:"button",tabIndex:0}," ",_mailpoet2.default.I18n.t("select")," ")))}}]),TemplateBox}(_react2.default.Component);TemplateBox.propTypes={index:_propTypes2.default.number.isRequired,id:_propTypes2.default.string.isRequired,newsletterId:_propTypes2.default.string.isRequired,name:_propTypes2.default.string.isRequired,thumbnail:_propTypes2.default.string.isRequired,readonly:_propTypes2.default.string.isRequired,beforeDelete:_propTypes2.default.func.isRequired,afterDelete:_propTypes2.default.func.isRequired,beforeSelect:_propTypes2.default.func.isRequired,afterSelect:_propTypes2.default.func.isRequired},exports.default=TemplateBox},401:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_helpTooltip=__webpack_require__(157),_helpTooltip2=_interopRequireDefault(_helpTooltip),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),ImportTemplate=function(_React$Component){function ImportTemplate(props){_classCallCheck(this,ImportTemplate);var _this=_possibleConstructorReturn(this,(ImportTemplate.__proto__||Object.getPrototypeOf(ImportTemplate)).call(this,props));return _this.fileRef=_react2.default.createRef(),_this.handleSubmit=_this.handleSubmit.bind(_this),_this}return _inherits(ImportTemplate,_React$Component),_createClass(ImportTemplate,[{key:"saveTemplate",value:function(_saveTemplate){var template=_saveTemplate,_props=this.props,beforeImport=_props.beforeImport,afterImport=_props.afterImport;_underscore2.default.isUndefined(template.body)||(template.body=JSON.stringify(template.body));try{template.categories=JSON.parse(template.categories)}catch(err){template.categories=[]}-1===template.categories.indexOf("saved")&&template.categories.push("saved"),-1===template.categories.indexOf("standard")&&-1===template.categories.indexOf("welcome")&&-1===template.categories.indexOf("notification")&&template.categories.push("standard"),template.categories=JSON.stringify(template.categories),beforeImport(),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"save",data:template}).done(function(response){afterImport(!0,response.data)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0}),afterImport(!1)})}},{key:"handleSubmit",value:function(e){var _this2=this;if(e.preventDefault(),_underscore2.default.size(this.fileRef.current.files)<=0)return!1;var file=_underscore2.default.first(this.fileRef.current.files),reader=new FileReader;return reader.onload=function(evt){try{_this2.saveTemplate(JSON.parse(evt.target.result)),_mailpoet2.default.trackEvent("Emails > Template imported",{"MailPoet Free version":window.mailpoet_version})}catch(err){_mailpoet2.default.Notice.error(_mailpoet2.default.I18n.t("templateFileMalformedError"))}},reader.readAsText(file),!0}},{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h2",null,_mailpoet2.default.I18n.t("importTemplateTitle"),_react2.default.createElement(_helpTooltip2.default,{tooltip:_mailpoet2.default.I18n.t("helpTooltipTemplateUpload"),place:"right",className:"tooltip-help-import-template"})),_react2.default.createElement("form",{onSubmit:this.handleSubmit},_react2.default.createElement("input",{type:"file",placeholder:_mailpoet2.default.I18n.t("selectJsonFileToUpload"),ref:this.fileRef}),_react2.default.createElement("p",{className:"submit"},_react2.default.createElement("input",{className:"button button-primary",type:"submit",value:_mailpoet2.default.I18n.t("upload")}))))}}]),ImportTemplate}(_react2.default.Component);ImportTemplate.propTypes={beforeImport:_propTypes2.default.func.isRequired,afterImport:_propTypes2.default.func.isRequired},exports.default=ImportTemplate},402:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_createReactClass=__webpack_require__(32),_createReactClass2=_interopRequireDefault(_createReactClass),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_form=__webpack_require__(187),_form2=_interopRequireDefault(_form),_standard=__webpack_require__(403),_standard2=_interopRequireDefault(_standard),_notification=__webpack_require__(407),_notification2=_interopRequireDefault(_notification),_welcome=__webpack_require__(408),_welcome2=_interopRequireDefault(_welcome),_helpTooltip=__webpack_require__(157),_helpTooltip2=_interopRequireDefault(_helpTooltip),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_thumbnail=__webpack_require__(294),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_reactRouterDom=__webpack_require__(7),NewsletterSend=(0,_createReactClass2.default)({displayName:"NewsletterSend",propTypes:{match:_propTypes2.default.shape({params:_propTypes2.default.shape({id:_propTypes2.default.string}).isRequired}).isRequired,history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},getInitialState:function(){return{fields:[],item:{},loading:!0}},componentDidMount:function(){this.loadItem(this.props.match.params.id),(0,_jquery2.default)("#mailpoet_newsletter").parsley()},componentWillReceiveProps:function(props){this.loadItem(props.match.params.id)},getFieldsByNewsletter:function(newsletter){return this.getSubtype(newsletter).getFields(newsletter)},getSendButtonOptions:function(){return this.getSubtype(this.state.item).getSendButtonOptions(this.state.item)},getSubtype:function(newsletter){switch(newsletter.type){case"notification":return _notification2.default;case"welcome":return _welcome2.default;default:return _wpJsHooks2.default.applyFilters("mailpoet_newsletters_send_newsletter_fields",_standard2.default,newsletter)}},isValid:function(){return(0,_jquery2.default)("#mailpoet_newsletter").parsley().isValid()},loadItem:function(id){var _this=this;this.setState({loading:!0}),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:id}}).done(function(response){_this.setState({loading:!1,item:response.data,fields:_this.getFieldsByNewsletter(response.data)})}).fail(function(){_this.setState({loading:!1,item:{}},function(){_this.props.history.push("/new")})})},saveTemplate:function(response,done){var _this2=this;(0,_thumbnail.fromUrl)(response.meta.preview_url).then(function(thumbnail){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"save",data:{newsletter_id:response.data.id,name:response.data.subject,thumbnail:thumbnail,body:JSON.stringify(response.data.body),categories:'["recent"]'}}).then(done).fail(function(err){_this2.showError(err),_this2.setState({loading:!1}),_mailpoet2.default.Modal.loading(!1),done()})}).catch(function(err){_this2.showError({errors:[err]})})},handleSend:function(e){var _this3=this;return e.preventDefault(),this.isValid()?(_mailpoet2.default.Modal.loading(!0),this.saveNewsletter(e).done(function(){_this3.setState({loading:!0})}).done(function(response){switch(response.data.type){case"notification":case"welcome":return _this3.activateNewsletter(response);default:return _this3.sendNewsletter(response)}}).fail(function(err){_this3.showError(err),_this3.setState({loading:!1}),_mailpoet2.default.Modal.loading(!1)})):(0,_jquery2.default)("#mailpoet_newsletter").parsley().validate()},sendNewsletter:function(newsletter){var _this4=this;return _mailpoet2.default.Ajax.post(_wpJsHooks2.default.applyFilters("mailpoet_newsletters_send_server_request_parameters",{api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"add",data:{newsletter_id:this.state.item.id}},this.state.item)).done(function(response){_this4.saveTemplate(newsletter,function(){if(window.mailpoet_show_congratulate_after_first_newsletter)return _mailpoet2.default.Modal.loading(!1),void _this4.props.history.push("/send/congratulate/"+_this4.state.item.id);_this4.props.history.push(_wpJsHooks2.default.applyFilters("mailpoet_newsletters_send_server_request_response_redirect","/"+(_this4.state.item.type||""),_this4.state.item));var customResponse=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_send_server_request_response",_this4.state.item,response);_underscore2.default.isFunction(customResponse)?customResponse():"scheduled"===response.data.status?(_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterHasBeenScheduled")),_mailpoet2.default.trackEvent("Emails > Newsletter sent",{scheduled:!0,"MailPoet Free version":window.mailpoet_version})):(_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterBeingSent")),_mailpoet2.default.trackEvent("Emails > Newsletter sent",{scheduled:!1,"MailPoet Free version":window.mailpoet_version})),_mailpoet2.default.Modal.loading(!1)})}).fail(function(err){_this4.showError(err),_this4.setState({loading:!1}),_mailpoet2.default.Modal.loading(!1)})},activateNewsletter:function(newsletter){var _this5=this;return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:this.props.match.params.id,status:"active"}}).done(function(response){_this5.saveTemplate(newsletter,function(){if(window.mailpoet_show_congratulate_after_first_newsletter)return _mailpoet2.default.Modal.loading(!1),void _this5.props.history.push("/send/congratulate/"+_this5.state.item.id);_this5.props.history.push("/"+(_this5.state.item.type||""));var opts=_this5.state.item.options;"welcome"===response.data.type?(_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("welcomeEmailActivated")),_mailpoet2.default.trackEvent("Emails > Welcome email activated",{"MailPoet Free version":window.mailpoet_version,"List type":opts.event,Delay:opts.afterTimeNumber+" "+opts.afterTimeType})):"notification"===response.data.type&&(_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("postNotificationActivated")),_mailpoet2.default.trackEvent("Emails > Post notifications activated",{"MailPoet Free version":window.mailpoet_version,Frequency:opts.intervalType})),_mailpoet2.default.Modal.loading(!1)})}).fail(function(err){_this5.showError(err),_this5.setState({loading:!1}),_mailpoet2.default.Modal.loading(!1)})},handleResume:function(e){var _this6=this;return e.preventDefault(),this.isValid()?this.saveNewsletter(e).done(function(){_this6.setState({loading:!0})}).done(function(){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"resume",data:{newsletter_id:_this6.state.item.id}}).done(function(){_this6.props.history.push("/"+(_this6.state.item.type||"")),_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterSendingHasBeenResumed"))}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}).fail(function(err){_this6.showError(err)}).always(function(){_this6.setState({loading:!1})}):(0,_jquery2.default)("#mailpoet_newsletter").parsley().validate(),!1},handleSave:function(e){var _this7=this;e.preventDefault(),this.saveNewsletter(e).done(function(){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterUpdated"))}).done(function(){_this7.props.history.push("/"+(_this7.state.item.type||""))}).fail(function(err){_this7.showError(err)})},handleRedirectToDesign:function(e){var _this8=this;e.preventDefault();var redirectTo=e.target.href;this.saveNewsletter(e).done(function(){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterUpdated"))}).done(function(){window.location=redirectTo}).fail(function(err){_this8.showError(err)})},saveNewsletter:function(){var data=this.state.item;data.queue=void 0,this.setState({loading:!0});var IGNORED_NEWSLETTER_PROPERTIES=["preheader","body","created_at","deleted_at","hash","status","updated_at","type"],newsletterData=_underscore2.default.omit(data,IGNORED_NEWSLETTER_PROPERTIES);return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"save",data:newsletterData})},showError:function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})},handleFormChange:function(e){var item=this.state.item;return item[e.target.name]=e.target.value,this.setState({item:item}),!0},render:function(){var isPaused="sending"===this.state.item.status&&this.state.item.queue&&"paused"===this.state.item.queue.status,fields=this.state.fields.map(function(field){var newField=field;return"segments"!==field.name&&"options"!==field.name||(newField.disabled=isPaused),newField}),sendButtonOptions=this.getSendButtonOptions(),breadcrumb=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_send_breadcrumb",_react2.default.createElement(_breadcrumb2.default,{step:"send"}),this.state.item.type,"send");return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("finalNewsletterStep")),breadcrumb,_react2.default.createElement(_form2.default,{id:"mailpoet_newsletter",fields:fields,automationId:"newsletter_send_form",item:this.state.item,loading:this.state.loading,onChange:this.handleFormChange,onSubmit:this.handleSave},_react2.default.createElement("p",{className:"submit"},isPaused?_react2.default.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleResume,value:_mailpoet2.default.I18n.t("resume")}):_react2.default.createElement("input",_extends({className:"button button-primary",type:"button",onClick:this.handleSend,value:_mailpoet2.default.I18n.t("send")},sendButtonOptions))," ",_react2.default.createElement("input",{className:"button button-secondary",type:"submit",value:_mailpoet2.default.I18n.t("saveDraftAndClose")})," ",_mailpoet2.default.I18n.t("orSimply")," ",_react2.default.createElement("a",{href:"?page=mailpoet-newsletter-editor&id="+this.props.match.params.id,onClick:this.handleRedirectToDesign},_mailpoet2.default.I18n.t("goBackToDesign")),"."),!isPaused&&sendButtonOptions.disabled&&"disabled"===sendButtonOptions.disabled&&_react2.default.createElement(_helpTooltip2.default,{tooltip:_mailpoet2.default.I18n.t("helpTooltipSendEmail"),tooltipId:"helpTooltipSendEmail"})))}});module.exports=(0,_reactRouterDom.withRouter)(NewsletterSend)},403:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_date_time=__webpack_require__(404),_date_time2=_interopRequireDefault(_date_time),currentTime=window.mailpoet_current_time||"00:00",defaultDateTime=window.mailpoet_current_date+" 00:00:00",timeOfDayItems=window.mailpoet_schedule_time_of_day,dateDisplayFormat=window.mailpoet_date_display_format,dateStorageFormat=window.mailpoet_date_storage_format,StandardScheduling=function(_React$Component){function StandardScheduling(){var _ref,_temp,_this,_ret;_classCallCheck(this,StandardScheduling);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=StandardScheduling.__proto__||Object.getPrototypeOf(StandardScheduling)).call.apply(_ref,[this].concat(args))),_this.getCurrentValue=function(){var schedulingOptions={isScheduled:"0",scheduledAt:defaultDateTime};return _underscore2.default.defaults(_this.props.item[_this.props.field.name]||{},schedulingOptions)},_this.getDateValidation=function(){return{"data-parsley-required":!0,"data-parsley-required-message":_mailpoet2.default.I18n.t("noScheduledDateError"),"data-parsley-errors-container":"#mailpoet_scheduling"}},_this.isScheduled=function(){return"1"===_this.getCurrentValue().isScheduled},_this.handleCheckboxChange=function(event){var changeEvent=event;return changeEvent.target.value=event.target.checked?"1":"0",_this.handleValueChange(changeEvent)},_this.handleValueChange=function(event){var oldValue=_this.getCurrentValue(),newValue={};return newValue[event.target.name]=event.target.value,_this.props.onValueChange({target:{name:_this.props.field.name,value:_underscore2.default.extend({},oldValue,newValue)}})},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(StandardScheduling,_React$Component),_createClass(StandardScheduling,[{key:"render",value:function(){var schedulingOptions=void 0;return this.isScheduled()&&(schedulingOptions=_react2.default.createElement("span",{id:"mailpoet_scheduling"},_react2.default.createElement(_date_time2.default,{name:"scheduledAt",value:this.getCurrentValue().scheduledAt,onChange:this.handleValueChange,disabled:this.props.field.disabled,dateValidation:this.getDateValidation(),defaultDateTime:defaultDateTime,timeOfDayItems:timeOfDayItems,dateDisplayFormat:dateDisplayFormat,dateStorageFormat:dateStorageFormat})," ",_react2.default.createElement("span",null,_mailpoet2.default.I18n.t("websiteTimeIs")," ",_react2.default.createElement("code",null,currentTime)))),_react2.default.createElement("div",null,_react2.default.createElement("input",{type:"checkbox",value:"1",checked:this.isScheduled(),disabled:this.props.field.disabled,name:"isScheduled",onChange:this.handleCheckboxChange}),schedulingOptions)}}]),StandardScheduling}(_react2.default.Component);StandardScheduling.propTypes={item:_propTypes2.default.object,field:_propTypes2.default.shape({name:_propTypes2.default.string.isRequired,disabled:_propTypes2.default.bool}).isRequired,onValueChange:_propTypes2.default.func.isRequired},StandardScheduling.defaultProps={item:{}};var fields=[{name:"subject",label:_mailpoet2.default.I18n.t("subjectLine"),tip:_mailpoet2.default.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":_mailpoet2.default.I18n.t("emptySubjectLineError")}},{name:"segments",label:_mailpoet2.default.I18n.t("segments"),tip:_mailpoet2.default.I18n.t("segmentsTip"),type:"selection",placeholder:_mailpoet2.default.I18n.t("selectSegmentPlaceholder"),id:"mailpoet_segments",api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,filter:function(segment){return!segment.deleted_at},getLabel:function(segment){return segment.name+" ("+parseInt(segment.subscribers,10).toLocaleString()+")"},transformChangedValue:function(segmentIds){var allSegments=this.getItems();return _underscore2.default.map(segmentIds,function(id){return _underscore2.default.find(allSegments,function(segment){return segment.id===id})})},validation:{"data-parsley-required":!0,"data-parsley-required-message":_mailpoet2.default.I18n.t("noSegmentsSelectedError")}},{name:"sender",label:_mailpoet2.default.I18n.t("sender"),tip:_mailpoet2.default.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:_mailpoet2.default.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"text",placeholder:_mailpoet2.default.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:_mailpoet2.default.I18n.t("replyTo"),tip:_mailpoet2.default.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:_mailpoet2.default.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:_mailpoet2.default.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},{name:"options",label:_mailpoet2.default.I18n.t("scheduleIt"),type:"reactComponent",component:StandardScheduling}];fields=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_3rd_step_fields",fields),module.exports={getFields:function(){return fields},getSendButtonOptions:function(newsletter){var newsletterOptions=newsletter||{},isScheduled="object"===_typeof(newsletterOptions.options)&&"1"===newsletterOptions.options.isScheduled,options={value:isScheduled?_mailpoet2.default.I18n.t("schedule"):_mailpoet2.default.I18n.t("send")};return"sent"!==newsletterOptions.status&&"sending"!==newsletterOptions.status||(options.disabled="disabled"),options}}},404:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_date_text=__webpack_require__(405),_date_text2=_interopRequireDefault(_date_text),_time_select=__webpack_require__(406),_time_select2=_interopRequireDefault(_time_select),DateTime=function(_React$Component){function DateTime(props){_classCallCheck(this,DateTime);var _this=_possibleConstructorReturn(this,(DateTime.__proto__||Object.getPrototypeOf(DateTime)).call(this,props));return _initialiseProps.call(_this),_this.state=_this.buildStateFromProps(props),_this}return _inherits(DateTime,_React$Component),_createClass(DateTime,[{key:"componentWillReceiveProps",value:function(nextProps){this.setState(this.buildStateFromProps(nextProps))}},{key:"render",value:function(){return _react2.default.createElement("span",null,_react2.default.createElement(_date_text2.default,{name:"date",value:this.state.date,onChange:this.handleChange,displayFormat:this.props.dateDisplayFormat,storageFormat:this.props.dateStorageFormat,disabled:this.props.disabled,validation:this.props.dateValidation}),_react2.default.createElement(_time_select2.default,{name:"time",value:this.state.time,onChange:this.handleChange,disabled:this.props.disabled,validation:this.props.timeValidation,timeOfDayItems:this.props.timeOfDayItems}))}}]),DateTime}(_react2.default.Component),_initialiseProps=function(){var _this2=this;this.getDateTime=function(){return[_this2.state.date,_this2.state.time].join(_this2.DATE_TIME_SEPARATOR)},this.DATE_TIME_SEPARATOR=" ",this.buildStateFromProps=function(props){var value=props.value||_this2.props.defaultDateTime,_value$split=value.split(_this2.DATE_TIME_SEPARATOR),_value$split2=_slicedToArray(_value$split,2);return{date:_value$split2[0],time:_value$split2[1]}},this.handleChange=function(event){var newState={};newState[event.target.name]=event.target.value,_this2.setState(newState,_this2.propagateChange)},this.propagateChange=function(){_this2.props.onChange&&_this2.props.onChange({target:{name:_this2.props.name||"",value:_this2.getDateTime()}})}};DateTime.propTypes={defaultDateTime:_propTypes2.default.string.isRequired,dateDisplayFormat:_propTypes2.default.string.isRequired,dateStorageFormat:_propTypes2.default.string.isRequired,onChange:_propTypes2.default.func,name:_propTypes2.default.string,disabled:_propTypes2.default.bool,dateValidation:_propTypes2.default.object.isRequired,timeValidation:_propTypes2.default.any,timeOfDayItems:_propTypes2.default.objectOf(_propTypes2.default.string).isRequired},DateTime.defaultProps={onChange:void 0,name:"",disabled:!1,timeValidation:void 0},module.exports=DateTime},405:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),datepickerTranslations={closeText:_mailpoet2.default.I18n.t("close"),currentText:_mailpoet2.default.I18n.t("today"),nextText:_mailpoet2.default.I18n.t("next"),prevText:_mailpoet2.default.I18n.t("previous"),monthNames:[_mailpoet2.default.I18n.t("january"),_mailpoet2.default.I18n.t("february"),_mailpoet2.default.I18n.t("march"),_mailpoet2.default.I18n.t("april"),_mailpoet2.default.I18n.t("may"),_mailpoet2.default.I18n.t("june"),_mailpoet2.default.I18n.t("july"),_mailpoet2.default.I18n.t("august"),_mailpoet2.default.I18n.t("september"),_mailpoet2.default.I18n.t("october"),_mailpoet2.default.I18n.t("november"),_mailpoet2.default.I18n.t("december")],monthNamesShort:[_mailpoet2.default.I18n.t("januaryShort"),_mailpoet2.default.I18n.t("februaryShort"),_mailpoet2.default.I18n.t("marchShort"),_mailpoet2.default.I18n.t("aprilShort"),_mailpoet2.default.I18n.t("mayShort"),_mailpoet2.default.I18n.t("juneShort"),_mailpoet2.default.I18n.t("julyShort"),_mailpoet2.default.I18n.t("augustShort"),_mailpoet2.default.I18n.t("septemberShort"),_mailpoet2.default.I18n.t("octoberShort"),_mailpoet2.default.I18n.t("novemberShort"),_mailpoet2.default.I18n.t("decemberShort")],dayNames:[_mailpoet2.default.I18n.t("sunday"),_mailpoet2.default.I18n.t("monday"),_mailpoet2.default.I18n.t("tuesday"),_mailpoet2.default.I18n.t("wednesday"),_mailpoet2.default.I18n.t("thursday"),_mailpoet2.default.I18n.t("friday"),_mailpoet2.default.I18n.t("saturday")],dayNamesShort:[_mailpoet2.default.I18n.t("sundayShort"),_mailpoet2.default.I18n.t("mondayShort"),_mailpoet2.default.I18n.t("tuesdayShort"),_mailpoet2.default.I18n.t("wednesdayShort"),_mailpoet2.default.I18n.t("thursdayShort"),_mailpoet2.default.I18n.t("fridayShort"),_mailpoet2.default.I18n.t("saturdayShort")],dayNamesMin:[_mailpoet2.default.I18n.t("sundayMin"),_mailpoet2.default.I18n.t("mondayMin"),_mailpoet2.default.I18n.t("tuesdayMin"),_mailpoet2.default.I18n.t("wednesdayMin"),_mailpoet2.default.I18n.t("thursdayMin"),_mailpoet2.default.I18n.t("fridayMin"),_mailpoet2.default.I18n.t("saturdayMin")]},DateText=function(_React$Component){function DateText(props){_classCallCheck(this,DateText);var _this=_possibleConstructorReturn(this,(DateText.__proto__||Object.getPrototypeOf(DateText)).call(this,props));return _this.onChange=function(event){var changeEvent=event,displayDate=changeEvent.target.value,storageDate=_this.getStorageDate(displayDate);changeEvent.target.value=storageDate,_this.props.onChange(changeEvent)},_this.getFieldName=function(){return _this.props.name||"date"},_this.getDisplayDate=function(date){var formatting={parseFormat:_this.props.storageFormat,format:_this.props.displayFormat};return _mailpoet2.default.Date.format(date,formatting)},_this.getStorageDate=function(date){var formatting={parseFormat:_this.props.displayFormat,format:_this.props.storageFormat};return _mailpoet2.default.Date.format(date,formatting)},_this.dateInput=_react2.default.createRef(),_this}return _inherits(DateText,_React$Component),_createClass(DateText,[{key:"componentDidMount",value:function(){var $element=(0,_jquery2.default)(this.dateInput.current),that=this;$element.datepicker&&(_jquery2.default.datepicker.parseDate=function(format,value){return _mailpoet2.default.Date.toDate(value,{parseFormat:this.props.displayFormat,format:format})},_jquery2.default.datepicker.formatDate=function(format,value){return _mailpoet2.default.Date.format(value,{format:format})},$element.datepicker(_underscore2.default.extend({dateFormat:this.props.displayFormat,isRTL:!1,onSelect:function(value){that.onChange({target:{name:that.getFieldName(),value:value}})}},datepickerTranslations)),this.datepickerInitialized=!0)}},{key:"componentWillUnmount",value:function(){this.datepickerInitialized&&(0,_jquery2.default)(this.dateInput.current).datepicker("destroy")}},{key:"render",value:function(){return _react2.default.createElement("input",_extends({type:"text",size:"30",name:this.getFieldName(),value:this.getDisplayDate(this.props.value),readOnly:!0,disabled:this.props.disabled,onChange:this.onChange,ref:this.dateInput},this.props.validation))}}]),DateText}(_react2.default.Component);DateText.propTypes={displayFormat:_propTypes2.default.string.isRequired,onChange:_propTypes2.default.func.isRequired,name:_propTypes2.default.string,storageFormat:_propTypes2.default.string.isRequired,value:_propTypes2.default.string.isRequired,disabled:_propTypes2.default.bool.isRequired,validation:_propTypes2.default.object.isRequired},DateText.defaultProps={name:"date"},module.exports=DateText},406:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),TimeSelect=function(_React$Component){function TimeSelect(){return _classCallCheck(this,TimeSelect),_possibleConstructorReturn(this,(TimeSelect.__proto__||Object.getPrototypeOf(TimeSelect)).apply(this,arguments))}return _inherits(TimeSelect,_React$Component),_createClass(TimeSelect,[{key:"render",value:function(){var _this2=this,options=Object.keys(this.props.timeOfDayItems).map(function(value){return _react2.default.createElement("option",{key:"option-"+_this2.props.timeOfDayItems[value],value:value},_this2.props.timeOfDayItems[value])});return _react2.default.createElement("select",_extends({name:this.props.name||"time",value:this.props.value,disabled:this.props.disabled,onChange:this.props.onChange},this.props.validation),options)}}]),TimeSelect}(_react2.default.Component);TimeSelect.propTypes={timeOfDayItems:_propTypes2.default.objectOf(_propTypes2.default.string).isRequired,name:_propTypes2.default.string,value:_propTypes2.default.string.isRequired,disabled:_propTypes2.default.bool,onChange:_propTypes2.default.func.isRequired,validation:_propTypes2.default.object},TimeSelect.defaultProps={name:"time",disabled:!1,validation:{}},module.exports=TimeSelect},407:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_scheduling=__webpack_require__(293),_scheduling2=_interopRequireDefault(_scheduling),fields=[{name:"subject",label:_mailpoet2.default.I18n.t("subjectLine"),tip:_mailpoet2.default.I18n.t("postNotificationSubjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":_mailpoet2.default.I18n.t("emptySubjectLineError")}},{name:"options",label:_mailpoet2.default.I18n.t("selectFrequency"),type:"reactComponent",component:_scheduling2.default},{name:"segments",label:_mailpoet2.default.I18n.t("segments"),tip:_mailpoet2.default.I18n.t("segmentsTip"),type:"selection",placeholder:_mailpoet2.default.I18n.t("selectSegmentPlaceholder"),id:"mailpoet_segments",api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,filter:function(segment){return!segment.deleted_at},getLabel:function(segment){return segment.name+" ("+parseInt(segment.subscribers,10).toLocaleString()+")"},transformChangedValue:function(segmentIds){var allSegments=this.getItems();return _underscore2.default.map(segmentIds,function(id){return _underscore2.default.find(allSegments,function(segment){return segment.id===id})})},validation:{"data-parsley-required":!0,"data-parsley-required-message":_mailpoet2.default.I18n.t("noSegmentsSelectedError")}},{name:"sender",label:_mailpoet2.default.I18n.t("sender"),tip:_mailpoet2.default.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:_mailpoet2.default.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"text",placeholder:_mailpoet2.default.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:_mailpoet2.default.I18n.t("replyTo"),tip:_mailpoet2.default.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:_mailpoet2.default.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:_mailpoet2.default.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]}];fields=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_3rd_step_fields",fields),module.exports={getFields:function(){return fields},getSendButtonOptions:function(){return{value:_mailpoet2.default.I18n.t("activate")}}}},408:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_scheduling=__webpack_require__(268),_scheduling2=_interopRequireDefault(_scheduling),fields=[{name:"subject",label:_mailpoet2.default.I18n.t("subjectLine"),tip:_mailpoet2.default.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":_mailpoet2.default.I18n.t("emptySubjectLineError")}},{name:"options",label:_mailpoet2.default.I18n.t("sendWelcomeEmailWhen"),type:"reactComponent",component:_scheduling2.default},{name:"sender",label:_mailpoet2.default.I18n.t("sender"),tip:_mailpoet2.default.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:_mailpoet2.default.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"text",placeholder:_mailpoet2.default.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:_mailpoet2.default.I18n.t("replyTo"),tip:_mailpoet2.default.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:_mailpoet2.default.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:_mailpoet2.default.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]}];fields=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_3rd_step_fields",fields),module.exports={getFields:function(){return fields},getSendButtonOptions:function(){return{value:_mailpoet2.default.I18n.t("activate")}}}},411:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}function successPageClosed(){return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:{show_congratulate_after_first_newsletter:!1}}).always(function(){window.location=window.mailpoet_main_page})}function renderSuccess(newsletter,testingPassed){return testingPassed&&_mailpoet2.default.trackEvent("Cron testing done",{"Cron is working":"true"}),_react2.default.createElement(_success2.default,{illustrationImageUrl:window.mailpoet_congratulations_success_image,successClicked:successPageClosed,newsletter:newsletter})}function renderFail(){return _mailpoet2.default.trackEvent("Cron testing done",{"Cron is working":"false"}),_react2.default.createElement(_fail2.default,{failClicked:function(){window.location=window.mailpoet_main_page}})}function renderLoading(showRichLoadingScreen){return _react2.default.createElement(_loading2.default,{illustrationImageUrl:window.mailpoet_congratulations_loading_image,successClicked:successPageClosed,showRichLoadingScreen:showRichLoadingScreen})}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_moment=__webpack_require__(0),_moment2=_interopRequireDefault(_moment),_success=__webpack_require__(412),_success2=_interopRequireDefault(_success),_fail=__webpack_require__(413),_fail2=_interopRequireDefault(_fail),_loading=__webpack_require__(414),_loading2=_interopRequireDefault(_loading),Congratulate=function(_React$Component){function Congratulate(props){_classCallCheck(this,Congratulate);var _this=_possibleConstructorReturn(this,(Congratulate.__proto__||Object.getPrototypeOf(Congratulate)).call(this,props));return _this.state={loading:!0,fail:!1,newsletter:null,testingPassed:!1,timeStart:(0,_moment2.default)(),minimumLoadingTimePassed:!1},_this.tick=_this.tick.bind(_this),_this}return _inherits(Congratulate,_React$Component),_createClass(Congratulate,[{key:"componentDidMount",value:function(){this.loadNewsletter(this.props.match.params.id),this.tick()}},{key:"componentWillReceiveProps",value:function(props){this.loadNewsletter(props.match.params.id)}},{key:"tick",value:function(){(0,_moment2.default)().subtract(20,"second").isAfter(this.state.timeStart)&&this.setState({error:!0,loading:!1}),this.state.loading&&this.loadNewsletter(this.props.match.params.id),(0,_moment2.default)().subtract(6,"seconds").isAfter(this.state.timeStart)&&this.setState({minimumLoadingTimePassed:!0}),!this.state.loading&&this.state.minimumLoadingTimePassed||setTimeout(this.tick,2e3)}},{key:"loadNewsletter",value:function(id){var _this2=this;_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:id}}).done(function(response){return _this2.newsletterLoaded(response.data)})}},{key:"newsletterLoaded",value:function(newsletter){"standard"!==newsletter.type||"scheduled"===newsletter.status?this.setState({newsletter:newsletter,loading:!1,minimumLoadingTimePassed:!0}):"sent"===newsletter.status||"sending"===newsletter.status?this.setState({newsletter:newsletter,loading:!1,testingPassed:!0}):this.setState({newsletter:newsletter})}},{key:"renderContent",value:function(){return this.state.loading||!this.state.minimumLoadingTimePassed?renderLoading(!!this.state.newsletter):this.state.error?renderFail():renderSuccess(this.state.newsletter,this.state.testingPassed)}},{key:"render",value:function(){return _react2.default.createElement("div",{className:"newsletter_congratulate_page"},this.renderContent())}}]),Congratulate}(_react2.default.Component);Congratulate.propTypes={match:_propTypes2.default.shape({params:_propTypes2.default.shape({id:_propTypes2.default.string}).isRequired}).isRequired},module.exports=Congratulate},412:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function renderHeader(newsletter){return"welcome"===newsletter.type?_mailpoet2.default.I18n.t("congratulationsWelcomeEmailSuccessHeader"):"notification"===newsletter.type?_mailpoet2.default.I18n.t("congratulationsPostNotificationSuccessHeader"):"automatic"===newsletter.type?_mailpoet2.default.I18n.t("congratulationsWooSuccessHeader"):"scheduled"===newsletter.status?_mailpoet2.default.I18n.t("congratulationsScheduleSuccessHeader"):_mailpoet2.default.I18n.t("congratulationsSendSuccessHeader")}function Success(props){return _react2.default.createElement("div",{className:"mailpoet_congratulate_success"},_react2.default.createElement("h1",null,renderHeader(props.newsletter)),_react2.default.createElement("img",{src:props.illustrationImageUrl,alt:"",width:"750",height:"250"}),_react2.default.createElement("button",{className:"button",onClick:props.successClicked},_mailpoet2.default.I18n.t("close")))}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet);Success.propTypes={successClicked:_propTypes2.default.func.isRequired,illustrationImageUrl:_propTypes2.default.string.isRequired,newsletter:_propTypes2.default.shape({status:_propTypes2.default.string.isRequired,type:_propTypes2.default.string.isRequired}).isRequired},module.exports=Success},413:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function Fail(props){return _react2.default.createElement("div",{className:"mailpoet_centered"},_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("congratulationsSendFailHeader")),_react2.default.createElement("p",null,(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("congratulationsSendFailExplain"),/\[link\](.*?)\[\/link\]/g,function(match,i){return _react2.default.createElement("a",{key:i,target:"_blank",rel:"noopener noreferrer",href:"https://kb.mailpoet.com/article/231-sending-does-not-work"},match)})),_react2.default.createElement("button",{className:"button",onClick:props.failClicked},_mailpoet2.default.I18n.t("close")))}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet);Fail.propTypes={failClicked:_propTypes2.default.func.isRequired},module.exports=Fail},414:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function renderRichData(showRichData,illustrationImageUrl){return showRichData?_react2.default.createElement("div",null,_react2.default.createElement("h1",{className:"mailpoet_newsletter_loading_header"},_mailpoet2.default.I18n.t("congratulationsLoadingHeader")),_react2.default.createElement("img",{src:illustrationImageUrl,alt:"",width:"800px",height:"266px"})):_react2.default.createElement("div",null)}function Loading(props){return _react2.default.createElement("div",{className:"mailpoet_newsletter_loading"},_react2.default.createElement(_loading2.default,null),renderRichData(props.showRichLoadingScreen,props.illustrationImageUrl))}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_loading=__webpack_require__(415),_loading2=_interopRequireDefault(_loading);Loading.propTypes={illustrationImageUrl:_propTypes2.default.string.isRequired,showRichLoadingScreen:_propTypes2.default.bool.isRequired},module.exports=Loading},415:function(module,exports,__webpack_require__){"use strict";function Loading(){return _react2.default.createElement("div",{className:"mailpoet_loading"},_react2.default.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_1"}),_react2.default.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_2"}),_react2.default.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_3"}))}var _react=__webpack_require__(1),_react2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_react);module.exports=Loading},416:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_reactRouterDom=__webpack_require__(7),NewsletterStandard=function(_React$Component){function NewsletterStandard(){var _ref,_temp,_this,_ret;_classCallCheck(this,NewsletterStandard);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=NewsletterStandard.__proto__||Object.getPrototypeOf(NewsletterStandard)).call.apply(_ref,[this].concat(args))),_this.showTemplateSelection=function(newsletterId){_this.props.history.push("/template/"+newsletterId)},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(NewsletterStandard,_React$Component),_createClass(NewsletterStandard,[{key:"componentDidMount",value:function(){var _this2=this;_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:"standard"}}).done(function(response){_this2.showTemplateSelection(response.data.id)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("regularNewsletterTypeTitle")),_react2.default.createElement(_breadcrumb2.default,{step:"type"}))}}]),NewsletterStandard}(_react2.default.Component);NewsletterStandard.propTypes={history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},module.exports=(0,_reactRouterDom.withRouter)(NewsletterStandard)},417:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_scheduling=__webpack_require__(293),_scheduling2=_interopRequireDefault(_scheduling),_reactRouterDom=__webpack_require__(7),field={name:"options",type:"reactComponent",component:_scheduling2.default},NewsletterNotification=function(_React$Component){function NewsletterNotification(){var _ref,_temp,_this,_ret;_classCallCheck(this,NewsletterNotification);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=NewsletterNotification.__proto__||Object.getPrototypeOf(NewsletterNotification)).call.apply(_ref,[this].concat(args))),_this.state={options:{intervalType:"daily",timeOfDay:0,weekDay:1,monthDay:0,nthWeekDay:1}},_this.handleValueChange=function(event){var state=_this.state;state[event.target.name]=event.target.value,_this.setState(state)},_this.handleNext=function(){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:_underscore2.default.extend({},_this.state,{type:"notification",subject:_mailpoet2.default.I18n.t("draftPostNotificationTitle")})}).done(function(response){_this.showTemplateSelection(response.data.id)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},_this.showTemplateSelection=function(newsletterId){_this.props.history.push("/template/"+newsletterId)},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(NewsletterNotification,_React$Component),_createClass(NewsletterNotification,[{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("postNotificationNewsletterTypeTitle")),_react2.default.createElement(_breadcrumb2.default,{step:"type"}),_react2.default.createElement("h3",null,_mailpoet2.default.I18n.t("selectFrequency")),_react2.default.createElement(_scheduling2.default,{item:this.state,field:field,onValueChange:this.handleValueChange}),_react2.default.createElement("p",{className:"submit"},_react2.default.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNext,value:_mailpoet2.default.I18n.t("next")})))}}]),NewsletterNotification}(_react2.default.Component);NewsletterNotification.propTypes={history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},module.exports=(0,_reactRouterDom.withRouter)(NewsletterNotification)},418:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_scheduling=__webpack_require__(268),_scheduling2=_interopRequireDefault(_scheduling),field={name:"options",label:"Event",type:"reactComponent",component:_scheduling2.default},NewsletterWelcome=function(_React$Component){function NewsletterWelcome(props){_classCallCheck(this,NewsletterWelcome);var _this=_possibleConstructorReturn(this,(NewsletterWelcome.__proto__||Object.getPrototypeOf(NewsletterWelcome)).call(this,props)),availableSegments=window.mailpoet_segments||[],defaultSegment=1;return availableSegments=availableSegments.filter(function(segment){return"default"===segment.type}),_underscore2.default.size(availableSegments)>0&&(defaultSegment=_underscore2.default.first(availableSegments).id),_this.state={options:{event:"segment",segment:defaultSegment,role:"subscriber",afterTimeNumber:1,afterTimeType:"immediate"}},_this.handleValueChange=_this.handleValueChange.bind(_this),_this.handleNext=_this.handleNext.bind(_this),_this}return _inherits(NewsletterWelcome,_React$Component),_createClass(NewsletterWelcome,[{key:"handleValueChange",value:function(event){var state=this.state;state[event.target.name]=event.target.value,this.setState(state)}},{key:"handleNext",value:function(){var _this2=this;_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:_underscore2.default.extend({},this.state,{type:"welcome",subject:_mailpoet2.default.I18n.t("draftNewsletterTitle")})}).done(function(response){_this2.showTemplateSelection(response.data.id)}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{key:"showTemplateSelection",value:function(newsletterId){this.props.history.push("/template/"+newsletterId)}},{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("welcomeNewsletterTypeTitle")),_react2.default.createElement(_breadcrumb2.default,{step:"type"}),_react2.default.createElement("h3",null,_mailpoet2.default.I18n.t("selectEventToSendWelcomeEmail")),_react2.default.createElement(_scheduling2.default,{item:this.state,field:field,onValueChange:this.handleValueChange}),_react2.default.createElement("p",{className:"submit"},_react2.default.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNext,value:_mailpoet2.default.I18n.t("next")})))}}]),NewsletterWelcome}(_react2.default.Component);NewsletterWelcome.propTypes={history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},exports.default=NewsletterWelcome},419:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_createReactClass=__webpack_require__(32),_createReactClass2=_interopRequireDefault(_createReactClass),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_confirm_alert=__webpack_require__(292),_confirm_alert2=_interopRequireDefault(_confirm_alert),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),_tabs=__webpack_require__(172),_tabs2=_interopRequireDefault(_tabs),_heading=__webpack_require__(174),_heading2=_interopRequireDefault(_heading),_mixins=__webpack_require__(173),mailpoetTrackingEnabled=!!window.mailpoet_tracking_enabled,messages={onTrash:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterTrashed"):_mailpoet2.default.I18n.t("multipleNewslettersTrashed").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onDelete:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterDeleted"):_mailpoet2.default.I18n.t("multipleNewslettersDeleted").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onRestore:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterRestored"):_mailpoet2.default.I18n.t("multipleNewslettersRestored").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)}},columns=[{name:"subject",label:_mailpoet2.default.I18n.t("subject"),sortable:!0},{name:"status",label:_mailpoet2.default.I18n.t("status")},{name:"segments",label:_mailpoet2.default.I18n.t("lists")},{name:"statistics",label:_mailpoet2.default.I18n.t("statistics"),display:mailpoetTrackingEnabled},{name:"sent_at",label:_mailpoet2.default.I18n.t("sentOn"),sortable:!0}],bulkActions=[{name:"trash",label:_mailpoet2.default.I18n.t("moveToTrash"),onSuccess:messages.onTrash}],confirmEdit=function(newsletter){var redirectToEditing=function(){window.location.href="?page=mailpoet-newsletter-editor&id="+newsletter.id};newsletter.queue&&"sending"===newsletter.status&&null===newsletter.queue.status?(0,_confirm_alert2.default)({message:_mailpoet2.default.I18n.t("confirmEdit"),onConfirm:redirectToEditing}):redirectToEditing()},newsletterActions=[{name:"view",link:function(newsletter){return _react2.default.createElement("a",{href:newsletter.preview_url,target:"_blank"},_mailpoet2.default.I18n.t("preview"))}},{name:"edit",label:_mailpoet2.default.I18n.t("edit"),onClick:confirmEdit},{name:"duplicate",label:_mailpoet2.default.I18n.t("duplicate"),onClick:function(newsletter,refresh){return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:newsletter.id}}).done(function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterDuplicated").replace("%$1s",response.data.subject)),refresh()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{name:"trash"}];_wpJsHooks2.default.addFilter("mailpoet_newsletters_listings_standard_actions",_mixins.StatisticsMixin.addStatsCTAAction),newsletterActions=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_listings_standard_actions",newsletterActions);var NewsletterListStandard=(0,_createReactClass2.default)({displayName:"NewsletterListStandard",propTypes:{location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},mixins:[_mixins.QueueMixin,_mixins.StatisticsMixin,_mixins.MailerMixin,_mixins.CronMixin],renderItem:function(newsletter,actions,meta){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions"),segments=newsletter.segments.map(function(segment){return segment.name}).join(", ");return _react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,_react2.default.createElement("a",{className:"row-title",href:"javascript:;",onClick:function(){return confirmEdit(newsletter)}},newsletter.queue.newsletter_rendered_subject||newsletter.subject)),actions),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("status")},this.renderQueueStatus(newsletter,meta.mta_log)),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("lists")},segments),!0===mailpoetTrackingEnabled?_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("statistics")},this.renderStatistics(newsletter,void 0,meta.current_time)):null,_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("sentOn")},_react2.default.createElement("abbr",null,newsletter.sent_at?_mailpoet2.default.Date.format(newsletter.sent_at):_mailpoet2.default.I18n.t("notSentYet"))))},render:function(){var _this=this;return _react2.default.createElement("div",null,_react2.default.createElement(_heading2.default,null),_react2.default.createElement(_tabs2.default,{tab:"standard"}),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"standard",base_url:"standard",onRenderItem:this.renderItem,columns:columns,bulk_actions:bulkActions,item_actions:newsletterActions,messages:messages,auto_refresh:!0,sort_by:"sent_at",sort_order:"desc",afterGetItems:function(state){_this.checkMailerStatus(state),_this.checkCronStatus(state)}}))}});module.exports=NewsletterListStandard},420:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_createReactClass=__webpack_require__(32),_createReactClass2=_interopRequireDefault(_createReactClass),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),_tabs=__webpack_require__(172),_tabs2=_interopRequireDefault(_tabs),_heading=__webpack_require__(174),_heading2=_interopRequireDefault(_heading),_mixins=__webpack_require__(173),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),mailpoetRoles=window.mailpoet_roles||{},mailpoetSegments=window.mailpoet_segments||{},mailpoetTrackingEnabled=!!window.mailpoet_tracking_enabled,messages={onTrash:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterTrashed"):_mailpoet2.default.I18n.t("multipleNewslettersTrashed").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onDelete:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterDeleted"):_mailpoet2.default.I18n.t("multipleNewslettersDeleted").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onRestore:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterRestored"):_mailpoet2.default.I18n.t("multipleNewslettersRestored").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)}},columns=[{name:"subject",label:_mailpoet2.default.I18n.t("subject"),sortable:!0},{name:"status",label:_mailpoet2.default.I18n.t("status"),width:145},{name:"settings",label:_mailpoet2.default.I18n.t("settings")},{name:"statistics",label:_mailpoet2.default.I18n.t("statistics"),display:mailpoetTrackingEnabled},{name:"updated_at",label:_mailpoet2.default.I18n.t("lastModifiedOn"),sortable:!0}],bulkActions=[{name:"trash",label:_mailpoet2.default.I18n.t("moveToTrash"),onSuccess:messages.onTrash}],newsletterActions=[{name:"view",link:function(newsletter){return _react2.default.createElement("a",{href:newsletter.preview_url,target:"_blank"},_mailpoet2.default.I18n.t("preview"))}},{name:"duplicate",label:_mailpoet2.default.I18n.t("duplicate"),onClick:function(newsletter,refresh){return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:newsletter.id}}).done(function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterDuplicated").replace("%$1s",response.data.subject)),refresh()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{name:"edit",link:function(newsletter){return _react2.default.createElement("a",{href:"?page=mailpoet-newsletter-editor&id="+newsletter.id},_mailpoet2.default.I18n.t("edit"))}},{name:"trash"}];_wpJsHooks2.default.addFilter("mailpoet_newsletters_listings_welcome_notification_actions",_mixins.StatisticsMixin.addStatsCTAAction),newsletterActions=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_listings_welcome_notification_actions",newsletterActions);var NewsletterListWelcome=(0,_createReactClass2.default)({displayName:"NewsletterListWelcome",propTypes:{location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},mixins:[_mixins.StatisticsMixin,_mixins.MailerMixin,_mixins.CronMixin],updateStatus:function(e){var _this=this;e.persist(),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done(function(response){"active"===response.data.status&&_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("welcomeEmailActivated")),_this.forceUpdate()}).fail(function(response){_mailpoet2.default.Notice.error(_mailpoet2.default.I18n.t("welcomeEmailActivationFailed")),e.target.value=response.status})},renderStatus:function(newsletter){var totalSentMessage=_mailpoet2.default.I18n.t("sentToXSubscribers").replace("%$1d",newsletter.total_sent.toLocaleString()),totalScheduledMessage=_mailpoet2.default.I18n.t("scheduledToXSubscribers").replace("%$1d",newsletter.total_scheduled.toLocaleString());return _react2.default.createElement("div",null,_react2.default.createElement("p",null,_react2.default.createElement("select",{"data-id":newsletter.id,defaultValue:newsletter.status,onChange:this.updateStatus},_react2.default.createElement("option",{value:"active"},_mailpoet2.default.I18n.t("active")),_react2.default.createElement("option",{value:"draft"},_mailpoet2.default.I18n.t("inactive")))),_react2.default.createElement("p",null,totalSentMessage," ",_react2.default.createElement("br",null),totalScheduledMessage))},renderSettings:function(newsletter){var sendingEvent=void 0,sendingDelay=void 0,segment=void 0;switch(newsletter.options.event){case"user":sendingEvent="mailpoet_all"===newsletter.options.role?_mailpoet2.default.I18n.t("welcomeEventWPUserAnyRole"):_mailpoet2.default.I18n.t("welcomeEventWPUserWithRole").replace("%$1s",mailpoetRoles[newsletter.options.role]);break;default:if(void 0===(segment=_underscore2.default.find(mailpoetSegments,function(seg){return Number(seg.id)===Number(newsletter.options.segment)})))return _react2.default.createElement("span",{className:"mailpoet_error"},_mailpoet2.default.I18n.t("sendingToSegmentsNotSpecified"));sendingEvent=_mailpoet2.default.I18n.t("welcomeEventSegment").replace("%$1s",segment.name)}if(sendingEvent&&"immediate"!==newsletter.options.afterTimeType){switch(newsletter.options.afterTimeType){case"hours":sendingDelay=_mailpoet2.default.I18n.t("sendingDelayHours").replace("%$1d",newsletter.options.afterTimeNumber);break;case"days":sendingDelay=_mailpoet2.default.I18n.t("sendingDelayDays").replace("%$1d",newsletter.options.afterTimeNumber);break;case"weeks":sendingDelay=_mailpoet2.default.I18n.t("sendingDelayWeeks").replace("%$1d",newsletter.options.afterTimeNumber);break;default:sendingDelay=_mailpoet2.default.I18n.t("sendingDelayInvalid")}sendingEvent+=" ["+sendingDelay+"]."}return _react2.default.createElement("span",null,sendingEvent)},renderItem:function(newsletter,actions){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions");return _react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,_react2.default.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id="+newsletter.id},newsletter.subject)),actions),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("status")},this.renderStatus(newsletter)),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("settings")},this.renderSettings(newsletter)),!0===mailpoetTrackingEnabled?_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("statistics")},this.renderStatistics(newsletter,newsletter.total_sent>0&&newsletter.statistics)):null,_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("lastModifiedOn")},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(newsletter.updated_at))))},render:function(){var _this2=this;return _react2.default.createElement("div",null,_react2.default.createElement(_heading2.default,null),_react2.default.createElement(_tabs2.default,{tab:"welcome"}),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"welcome",base_url:"welcome",onRenderItem:this.renderItem,columns:columns,bulk_actions:bulkActions,item_actions:newsletterActions,messages:messages,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(state){_this2.checkMailerStatus(state),_this2.checkCronStatus(state)}}))}});module.exports=NewsletterListWelcome},421:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_createReactClass=__webpack_require__(32),_createReactClass2=_interopRequireDefault(_createReactClass),_reactRouterDom=__webpack_require__(7),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),_tabs=__webpack_require__(172),_tabs2=_interopRequireDefault(_tabs),_heading=__webpack_require__(174),_heading2=_interopRequireDefault(_heading),_mixins=__webpack_require__(173),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_common=__webpack_require__(269),messages={onTrash:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterTrashed"):_mailpoet2.default.I18n.t("multipleNewslettersTrashed").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onDelete:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterDeleted"):_mailpoet2.default.I18n.t("multipleNewslettersDeleted").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onRestore:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneNewsletterRestored"):_mailpoet2.default.I18n.t("multipleNewslettersRestored").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)}},columns=[{name:"subject",label:_mailpoet2.default.I18n.t("subject"),sortable:!0},{name:"status",label:_mailpoet2.default.I18n.t("status"),width:100},{name:"settings",label:_mailpoet2.default.I18n.t("settings")},{name:"history",label:_mailpoet2.default.I18n.t("history"),width:100},{name:"updated_at",label:_mailpoet2.default.I18n.t("lastModifiedOn"),sortable:!0}],bulkActions=[{name:"trash",label:_mailpoet2.default.I18n.t("moveToTrash"),onSuccess:messages.onTrash}],newsletterActions=[{name:"view",link:function(newsletter){return _react2.default.createElement("a",{href:newsletter.preview_url,target:"_blank"},_mailpoet2.default.I18n.t("preview"))}},{name:"edit",link:function(newsletter){return _react2.default.createElement("a",{href:"?page=mailpoet-newsletter-editor&id="+newsletter.id},_mailpoet2.default.I18n.t("edit"))}},{name:"duplicate",label:_mailpoet2.default.I18n.t("duplicate"),onClick:function(newsletter,refresh){return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:newsletter.id}}).done(function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("newsletterDuplicated").replace("%$1s",response.data.subject)),refresh()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{name:"trash"}],NewsletterListNotification=(0,_createReactClass2.default)({displayName:"NewsletterListNotification",propTypes:{location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},mixins:[_mixins.MailerMixin,_mixins.CronMixin],updateStatus:function(e){var _this=this;e.persist(),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done(function(response){"active"===response.data.status&&_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("postNotificationActivated")),_this.forceUpdate()}).fail(function(response){_mailpoet2.default.Notice.error(_mailpoet2.default.I18n.t("postNotificationActivationFailed")),e.target.value=response.status})},renderStatus:function(newsletter){return _react2.default.createElement("select",{"data-id":newsletter.id,defaultValue:newsletter.status,onChange:this.updateStatus},_react2.default.createElement("option",{value:"active"},_mailpoet2.default.I18n.t("active")),_react2.default.createElement("option",{value:"draft"},_mailpoet2.default.I18n.t("inactive")))},renderSettings:function(newsletter){var sendingFrequency=void 0,segments=newsletter.segments.map(function(segment){return segment.name}),sendingToSegments=_mailpoet2.default.I18n.t("ifNewContentToSegments").replace("%$1s",segments.join(", "));if(0===segments.length)return _react2.default.createElement("span",{className:"mailpoet_error"},_mailpoet2.default.I18n.t("sendingToSegmentsNotSpecified"));switch(newsletter.options.intervalType){case"daily":sendingFrequency=_mailpoet2.default.I18n.t("sendDaily").replace("%$1s",_common.timeOfDayValues[newsletter.options.timeOfDay]);break;case"weekly":sendingFrequency=_mailpoet2.default.I18n.t("sendWeekly").replace("%$1s",_common.weekDayValues[newsletter.options.weekDay]).replace("%$2s",_common.timeOfDayValues[newsletter.options.timeOfDay]);break;case"monthly":sendingFrequency=_mailpoet2.default.I18n.t("sendMonthly").replace("%$1s",_common.monthDayValues[newsletter.options.monthDay]).replace("%$2s",_common.timeOfDayValues[newsletter.options.timeOfDay]);break;case"nthWeekDay":sendingFrequency=_mailpoet2.default.I18n.t("sendNthWeekDay").replace("%$1s",_common.nthWeekDayValues[newsletter.options.nthWeekDay]).replace("%$2s",_common.weekDayValues[newsletter.options.weekDay]).replace("%$3s",_common.timeOfDayValues[newsletter.options.timeOfDay]);break;case"immediately":sendingFrequency=_mailpoet2.default.I18n.t("sendImmediately");break;default:sendingFrequency="Invalid sending frequency"}return _react2.default.createElement("span",null,sendingFrequency," ",sendingToSegments)},renderHistoryLink:function(newsletter){return 0===Number(newsletter.children_count)?_mailpoet2.default.I18n.t("notSentYet"):_react2.default.createElement(_reactRouterDom.Link,{"data-automation-id":"history-"+newsletter.id,to:"/notification/history/"+newsletter.id},_mailpoet2.default.I18n.t("viewHistory"))},renderItem:function(newsletter,actions){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions");return _react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,_react2.default.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id="+newsletter.id},newsletter.subject)),actions),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("status")},this.renderStatus(newsletter)),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("settings")},this.renderSettings(newsletter)),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("history")},this.renderHistoryLink(newsletter)),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("lastModifiedOn")},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(newsletter.updated_at))))},render:function(){var _this2=this;return _react2.default.createElement("div",null,_react2.default.createElement(_heading2.default,null),_react2.default.createElement(_tabs2.default,{tab:"notification"}),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"notification",base_url:"notification",onRenderItem:this.renderItem,columns:columns,bulk_actions:bulkActions,item_actions:newsletterActions,messages:messages,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(state){_this2.checkMailerStatus(state),_this2.checkCronStatus(state)}}))}});module.exports=NewsletterListNotification},422:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_createReactClass=__webpack_require__(32),_createReactClass2=_interopRequireDefault(_createReactClass),_reactRouterDom=__webpack_require__(7),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),_tabs=__webpack_require__(172),_tabs2=_interopRequireDefault(_tabs),_heading=__webpack_require__(174),_heading2=_interopRequireDefault(_heading),_mixins=__webpack_require__(173),mailpoetTrackingEnabled=!!window.mailpoet_tracking_enabled,columns=[{name:"subject",label:_mailpoet2.default.I18n.t("subject")},{name:"status",label:_mailpoet2.default.I18n.t("status")},{name:"segments",label:_mailpoet2.default.I18n.t("lists")},{name:"statistics",label:_mailpoet2.default.I18n.t("statistics"),display:mailpoetTrackingEnabled},{name:"sent_at",label:_mailpoet2.default.I18n.t("sentOn")}],newsletterActions=[{name:"view",link:function(newsletter){return _react2.default.createElement("a",{href:newsletter.preview_url,target:"_blank"},_mailpoet2.default.I18n.t("preview"))}}];_wpJsHooks2.default.addFilter("mailpoet_newsletters_listings_notification_history_actions",_mixins.StatisticsMixin.addStatsCTAAction),newsletterActions=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_listings_notification_history_actions",newsletterActions);var NewsletterListNotificationHistory=(0,_createReactClass2.default)({displayName:"NewsletterListNotificationHistory",propTypes:{location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},mixins:[_mixins.QueueMixin,_mixins.StatisticsMixin,_mixins.MailerMixin,_mixins.CronMixin],renderItem:function(newsletter,actions,meta){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions"),segments=newsletter.segments.map(function(segment){return segment.name}).join(", ");return _react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,_react2.default.createElement("a",{href:newsletter.preview_url,target:"_blank"},newsletter.queue.newsletter_rendered_subject||newsletter.subject)),actions),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("status")},this.renderQueueStatus(newsletter,meta.mta_log)),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("lists")},segments),!0===mailpoetTrackingEnabled?_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("statistics")},this.renderStatistics(newsletter,void 0,meta.current_time)):null,_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("sentOn")},newsletter.sent_at?_mailpoet2.default.Date.format(newsletter.sent_at):_mailpoet2.default.I18n.t("notSentYet")))},render:function(){var _this=this;return _react2.default.createElement("div",null,_react2.default.createElement(_heading2.default,null),_react2.default.createElement(_tabs2.default,{tab:"notification"}),_react2.default.createElement(_reactRouterDom.Link,{className:"page-title-action",to:"/notification"},_mailpoet2.default.I18n.t("backToPostNotifications")),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"notification_history",base_url:"notification/history/:parent_id",onRenderItem:this.renderItem,columns:columns,item_actions:newsletterActions,auto_refresh:!0,sort_by:"sent_at",sort_order:"desc",afterGetItems:function(state){_this.checkMailerStatus(state),_this.checkCronStatus(state)}}))}});module.exports=NewsletterListNotificationHistory},423:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactRouterDom=__webpack_require__(7),_list=__webpack_require__(424),_list2=_interopRequireDefault(_list),_form=__webpack_require__(425),_form2=_interopRequireDefault(_form),container=document.getElementById("segments_container");container&&_reactDom2.default.render(_react2.default.createElement(_reactRouterDom.HashRouter,null,_react2.default.createElement(_reactRouterDom.Switch,null,_react2.default.createElement(_reactRouterDom.Route,{path:"/new",component:_form2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"/edit/:id",component:_form2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"*",component:_list2.default}))),container)},424:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(7),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),columns=[{name:"name",label:_mailpoet2.default.I18n.t("name"),sortable:!0},{name:"description",label:_mailpoet2.default.I18n.t("description")},{name:"subscribed",label:_mailpoet2.default.I18n.t("subscribed")},{name:"unconfirmed",label:_mailpoet2.default.I18n.t("unconfirmed")},{name:"unsubscribed",label:_mailpoet2.default.I18n.t("unsubscribed")},{name:"bounced",label:_mailpoet2.default.I18n.t("bounced")},{name:"created_at",label:_mailpoet2.default.I18n.t("createdOn"),sortable:!0}],messages={onTrash:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneSegmentTrashed"):_mailpoet2.default.I18n.t("multipleSegmentsTrashed").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onDelete:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneSegmentDeleted"):_mailpoet2.default.I18n.t("multipleSegmentsDeleted").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onRestore:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneSegmentRestored"):_mailpoet2.default.I18n.t("multipleSegmentsRestored").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)}},bulkActions=[{name:"trash",label:_mailpoet2.default.I18n.t("moveToTrash"),onSuccess:messages.onTrash}],itemActions=[{name:"edit",link:function(item){return _react2.default.createElement(_reactRouterDom.Link,{to:"/edit/"+item.id},_mailpoet2.default.I18n.t("edit"))},display:function(segment){return"wp_users"!==segment.type}},{name:"duplicate_segment",label:_mailpoet2.default.I18n.t("duplicate"),onClick:function(item,refresh){return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"segments",action:"duplicate",data:{id:item.id}}).done(function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("listDuplicated").replace("%$1s",response.data.name)),refresh()}).fail(function(response){_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},display:function(segment){return"wp_users"!==segment.type}},{name:"read_more",link:function(){return _react2.default.createElement("a",{href:"http://docs.mailpoet.com/article/133-the-wordpress-users-list",target:"_blank",rel:"noopener noreferrer"},_mailpoet2.default.I18n.t("readMore"))},display:function(segment){return"wp_users"===segment.type}},{name:"synchronize_segment",label:_mailpoet2.default.I18n.t("forceSync"),onClick:function(item,refresh){_mailpoet2.default.Modal.loading(!0),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"segments",action:"synchronize"}).done(function(){_mailpoet2.default.Modal.loading(!1),_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("listSynchronized").replace("%$1s",item.name)),refresh()}).fail(function(response){_mailpoet2.default.Modal.loading(!1),response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},display:function(segment){return"wp_users"===segment.type}},{name:"view_subscribers",link:function(item){return _react2.default.createElement("a",{href:item.subscribers_url},_mailpoet2.default.I18n.t("viewSubscribers"))}},{name:"trash",display:function(segment){return"wp_users"!==segment.type}}],SegmentList=function(_React$Component){function SegmentList(){var _ref,_temp,_this,_ret;_classCallCheck(this,SegmentList);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=SegmentList.__proto__||Object.getPrototypeOf(SegmentList)).call.apply(_ref,[this].concat(args))),_this.renderItem=function(segment,actions){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions"),subscribed=Number(segment.subscribers_count.subscribed||0),unconfirmed=Number(segment.subscribers_count.unconfirmed||0),unsubscribed=Number(segment.subscribers_count.unsubscribed||0),bounced=Number(segment.subscribers_count.bounced||0),segmentName=void 0;return segmentName="wp_users"===segment.type?_react2.default.createElement("span",{className:"row-title"},segment.name):_react2.default.createElement(_reactRouterDom.Link,{className:"row-title",to:"/edit/"+segment.id},segment.name),_react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,segmentName),actions),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("description")},_react2.default.createElement("abbr",null,segment.description)),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("subscribed")},_react2.default.createElement("abbr",null,subscribed.toLocaleString())),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("unconfirmed")},_react2.default.createElement("abbr",null,unconfirmed.toLocaleString())),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("unsubscribed")},_react2.default.createElement("abbr",null,unsubscribed.toLocaleString())),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("bounced")},_react2.default.createElement("abbr",null,bounced.toLocaleString())),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("createdOn")},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(segment.created_at))))},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(SegmentList,_React$Component),_createClass(SegmentList,[{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",{className:"title"},_mailpoet2.default.I18n.t("pageTitle")," ",_react2.default.createElement(_reactRouterDom.Link,{className:"page-title-action",to:"/new"},_mailpoet2.default.I18n.t("new"))),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,messages:messages,search:!1,endpoint:"segments",onRenderItem:this.renderItem,columns:columns,bulk_actions:bulkActions,item_actions:itemActions,sort_by:"name",sort_order:"asc"}))}}]),SegmentList}(_react2.default.Component);SegmentList.propTypes={location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},module.exports=SegmentList},425:function(module,exports,__webpack_require__){"use strict";(function(global){global.MailPoetLib||(global.MailPoetLib={}),module.exports=global.MailPoetLib.Form=__webpack_require__(426)}).call(exports,__webpack_require__(6))},426:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(7),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_form=__webpack_require__(187),_form2=_interopRequireDefault(_form),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),fields=[{name:"name",label:_mailpoet2.default.I18n.t("name"),type:"text"},{name:"description",label:_mailpoet2.default.I18n.t("description"),type:"textarea",tip:_mailpoet2.default.I18n.t("segmentDescriptionTip")}],messages={onUpdate:function(){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("segmentUpdated"))},onCreate:function(){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("segmentAdded")),_mailpoet2.default.trackEvent("Lists > Add new",{"MailPoet Free version":window.mailpoet_version})}},SegmentForm=function(props){return _react2.default.createElement("div",null,_react2.default.createElement("h1",{className:"title"},_mailpoet2.default.I18n.t("segment"),_react2.default.createElement(_reactRouterDom.Link,{className:"page-title-action",to:"/"},_mailpoet2.default.I18n.t("backToList"))),_react2.default.createElement(_form2.default,{endpoint:"segments",fields:fields,params:props.match.params,messages:messages}))};SegmentForm.propTypes={match:_propTypes2.default.shape({params:_propTypes2.default.shape({id:_propTypes2.default.string}).isRequired}).isRequired},exports.default=SegmentForm},427:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactRouterDom=__webpack_require__(7),_list=__webpack_require__(428),_list2=_interopRequireDefault(_list),container=document.getElementById("forms_container");container&&_reactDom2.default.render(_react2.default.createElement(_reactRouterDom.HashRouter,null,_react2.default.createElement(_reactRouterDom.Route,{path:"*",component:_list2.default})),container)},428:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing=__webpack_require__(23),_listing2=_interopRequireDefault(_listing),columns=[{name:"name",label:_mailpoet2.default.I18n.t("formName"),sortable:!0},{name:"segments",label:_mailpoet2.default.I18n.t("segments")},{name:"signups",label:_mailpoet2.default.I18n.t("signups")},{name:"created_at",label:_mailpoet2.default.I18n.t("createdOn"),sortable:!0}],messages={onTrash:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneFormTrashed"):_mailpoet2.default.I18n.t("multipleFormsTrashed").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onDelete:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneFormDeleted"):_mailpoet2.default.I18n.t("multipleFormsDeleted").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)},onRestore:function(response){var count=Number(response.meta.count),message=null;message=1===count?_mailpoet2.default.I18n.t("oneFormRestored"):_mailpoet2.default.I18n.t("multipleFormsRestored").replace("%$1d",count.toLocaleString()),_mailpoet2.default.Notice.success(message)}},bulkActions=[{name:"trash",label:_mailpoet2.default.I18n.t("moveToTrash"),onSuccess:messages.onTrash}],itemActions=[{name:"edit",label:_mailpoet2.default.I18n.t("edit"),link:function(item){return _react2.default.createElement("a",{href:"admin.php?page=mailpoet-form-editor&id="+item.id},_mailpoet2.default.I18n.t("edit"))}},{name:"duplicate",label:_mailpoet2.default.I18n.t("duplicate"),onClick:function(item,refresh){return _mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"duplicate",data:{id:item.id}}).done(function(response){_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("formDuplicated").replace("%$1s",response.data.name)),refresh()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{name:"trash"}],FormList=function(_React$Component){function FormList(){var _ref,_temp,_this,_ret;_classCallCheck(this,FormList);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=FormList.__proto__||Object.getPrototypeOf(FormList)).call.apply(_ref,[this].concat(args))),_this.createForm=function(){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"create"}).done(function(response){window.location=window.mailpoet_form_edit_url+response.data.id}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},_this.renderItem=function(form,actions){var rowClasses=(0,_classnames2.default)("manage-column","column-primary","has-row-actions"),segments=window.mailpoet_segments.filter(function(segment){return-1!==_jquery2.default.inArray(segment.id,form.segments)}).map(function(segment){return segment.name}).join(", ");return"user"===form.settings.segments_selected_by&&(segments=_mailpoet2.default.I18n.t("userChoice")+" "+segments),_react2.default.createElement("div",null,_react2.default.createElement("td",{className:rowClasses},_react2.default.createElement("strong",null,_react2.default.createElement("a",{className:"row-title",href:"admin.php?page=mailpoet-form-editor&id="+form.id},form.name)),actions),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("segments")},segments),_react2.default.createElement("td",{className:"column","data-colname":_mailpoet2.default.I18n.t("signups")},form.signups),_react2.default.createElement("td",{className:"column-date","data-colname":_mailpoet2.default.I18n.t("createdOn")},_react2.default.createElement("abbr",null,_mailpoet2.default.Date.format(form.created_at))))},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(FormList,_React$Component),_createClass(FormList,[{key:"render",value:function(){return _react2.default.createElement("div",null,_react2.default.createElement("h1",{className:"title"},_mailpoet2.default.I18n.t("pageTitle")," ",_react2.default.createElement("a",{className:"page-title-action",href:"javascript:;",onClick:this.createForm,"data-automation-id":"create_new_form"},_mailpoet2.default.I18n.t("new"))),_react2.default.createElement(_listing2.default,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,messages:messages,search:!1,endpoint:"forms",onRenderItem:this.renderItem,columns:columns,bulk_actions:bulkActions,item_actions:itemActions}))}}]),FormList}(_react2.default.Component);FormList.propTypes={location:_propTypes2.default.object.isRequired,match:_propTypes2.default.shape({params:_propTypes2.default.object}).isRequired},module.exports=FormList},429:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(18),__webpack_require__(5),__webpack_require__(2)],void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(Backbone,jQuery,mp){var MailPoet=mp;0!==jQuery("#mailpoet_settings").length&&(MailPoet.Router=new(Backbone.Router.extend({routes:{"":"defaultRoute","mta(/:group)":"sendingMethodGroup","(:tab)":"tabs"},defaultRoute:function(){this.tabs("basics")},sendingMethodGroup:function(group){this.tabs("mta"),jQuery("#mailpoet_sending_method_setup, .mailpoet_sending_method").hide(),jQuery(".mailpoet_settings_submit").hide(),null===group?jQuery(".mailpoet_sending_methods, .mailpoet_sending_methods_help").fadeIn():(jQuery("#mailpoet_mta_spf")["mailpoet"===group?"hide":"show"](),jQuery(".mailpoet_sending_methods, .mailpoet_sending_methods_help").hide(),jQuery('.mailpoet_sending_method[data-group="'+group+'"]').show(),jQuery("#mailpoet_sending_method_setup").fadeIn())},tabs:function(tab){jQuery(".nav-tab-wrapper a").removeClass("nav-tab-active"),jQuery(".mailpoet_tab_panel, .mailpoet_section").hide(),jQuery('a.nav-tab[href="#'+tab+'"]').addClass("nav-tab-active").blur(),jQuery('.mailpoet_tab_panel[data-tab="'+tab+'"]').length>0&&jQuery('.mailpoet_tab_panel[data-tab="'+tab+'"]').show(),jQuery(".mailpoet_settings_submit").show(),MailPoet.trackEvent("User has clicked a tab in Settings",{"MailPoet Free version":window.mailpoet_version,"Tab ID":tab})}})),jQuery(document).ready(function(){Backbone.History.started||Backbone.history.start()}))}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},431:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactRouterDom=__webpack_require__(7),_knowledge_base=__webpack_require__(432),_knowledge_base2=_interopRequireDefault(_knowledge_base),_system_info=__webpack_require__(433),_system_info2=_interopRequireDefault(_system_info),_system_status=__webpack_require__(434),_system_status2=_interopRequireDefault(_system_status),_your_privacy=__webpack_require__(440),_your_privacy2=_interopRequireDefault(_your_privacy),container=document.getElementById("help_container");container&&_reactDom2.default.render(_react2.default.createElement(_reactRouterDom.HashRouter,null,_react2.default.createElement(_reactRouterDom.Switch,null,_react2.default.createElement(_reactRouterDom.Route,{exact:!0,path:"/",render:function(){return _react2.default.createElement(_reactRouterDom.Redirect,{to:"/knowledgeBase"})}}),_react2.default.createElement(_reactRouterDom.Route,{path:"/knowledgeBase",component:_knowledge_base2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"/systemStatus",component:_system_status2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"/systemInfo",component:_system_info2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"/yourPrivacy",component:_your_privacy2.default}))),container)},432:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function KnowledgeBase(){return _react2.default.createElement("div",null,_react2.default.createElement(_tabs2.default,{tab:"knowledgeBase"}),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("knowledgeBaseIntro")),_react2.default.createElement("ul",null,_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/116-common-problems"},"Common Problems")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/165-newsletters"},"Newsletters")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/156-migration-questions"},"Migration Questions")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/149-sending-methods"},"Sending Methods")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/139-subscription-forms"},"Subscription Forms")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/114-getting-started"},"Getting Started")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/123-newsletter-designer"},"Newsletter Designer")),_react2.default.createElement("li",null,_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/category/121-subscribers-and-lists"},"Subscribers and Lists"))),_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"http://beta.docs.mailpoet.com/",className:"button button-primary"},_mailpoet2.default.I18n.t("knowledgeBaseButton")))}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_tabs=__webpack_require__(188),_tabs2=_interopRequireDefault(_tabs);module.exports=KnowledgeBase},433:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function handleFocus(event){event.target.select()}function printData(data){if(_underscore2.default.isObject(data)){var printableData=Object.keys(data).map(function(key){return key+": "+data[key]});return _react2.default.createElement("textarea",{readOnly:!0,onFocus:handleFocus,value:printableData.join("\n"),style:{width:"100%",height:"400px"}})}return _react2.default.createElement("p",null,_mailpoet2.default.I18n.t("systemInfoDataError"))}function SystemInfo(){var systemInfoData=window.systemInfoData;return _react2.default.createElement("div",null,_react2.default.createElement(_tabs2.default,{tab:"systemInfo"}),_react2.default.createElement("div",{className:"mailpoet_notice notice inline",style:{marginTop:"1em"}},_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("systemInfoIntro"))),printData(systemInfoData))}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_tabs=__webpack_require__(188),_tabs2=_interopRequireDefault(_tabs);module.exports=SystemInfo},434:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function renderStatusMessage(status,error,link){var noticeType=status?"success":"error",noticeMessage=status?_mailpoet2.default.I18n.t("systemStatusConnectionSuccessful"):_mailpoet2.default.I18n.t("systemStatusConnectionUnsuccessful")+" "+error;return link&&(noticeMessage=(0,_reactStringReplace2.default)(noticeMessage,/\[link\](.*?)\[\/link\]/g,function(match){return _react2.default.createElement("a",{href:""+link,key:"kb-link"},match)})),_react2.default.createElement("div",{className:"mailpoet_notice notice inline notice-"+noticeType,style:{marginTop:"1em"}},_react2.default.createElement("p",null,noticeMessage))}function renderCronSection(data){var status=data.cron.isReachable,url=data.cron.url;return _react2.default.createElement("div",null,_react2.default.createElement("h2",null,_mailpoet2.default.I18n.t("systemStatusCronTitle")),_react2.default.createElement("p",null,_react2.default.createElement("a",{href:url,target:"_blank"},url)),renderStatusMessage(status,_mailpoet2.default.I18n.t("systemStatusCronConnectionUnsuccessfulInfo"),"//beta.docs.mailpoet.com/article/231-sending-does-not-work"))}function renderMSSSection(data){if(data.mss.enabled){var status=data.mss.enabled.isReachable;return _react2.default.createElement("div",null,_react2.default.createElement("h2",null,_mailpoet2.default.I18n.t("systemStatusMSSTitle")),renderStatusMessage(status,_mailpoet2.default.I18n.t("systemStatusMSSConnectionUnsuccessfulInfo"),!1))}}function SystemStatus(){var systemStatusData=window.systemStatusData;return _react2.default.createElement("div",null,_react2.default.createElement(_tabs2.default,{tab:"systemStatus"}),_react2.default.createElement("div",{className:"mailpoet_notice notice inline",style:{marginTop:"1em"}},_react2.default.createElement("p",null,systemStatusData.mss.enabled?_mailpoet2.default.I18n.t("systemStatusIntroCronMSS"):_mailpoet2.default.I18n.t("systemStatusIntroCron"))),renderCronSection(systemStatusData),renderMSSSection(systemStatusData),_react2.default.createElement(_cron_status2.default,{status_data:systemStatusData.cronStatus}),_react2.default.createElement(_queue_status2.default,{status_data:systemStatusData.queueStatus}))}var _mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),_cron_status=__webpack_require__(435),_cron_status2=_interopRequireDefault(_cron_status),_queue_status=__webpack_require__(437),_queue_status2=_interopRequireDefault(_queue_status),_tabs=__webpack_require__(188),_tabs2=_interopRequireDefault(_tabs);module.exports=SystemStatus},435:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_key_value_table=__webpack_require__(295),_key_value_table2=_interopRequireDefault(_key_value_table),_print_boolean=__webpack_require__(436),_print_boolean2=_interopRequireDefault(_print_boolean),CronStatus=function(props){var status=props.status_data,activeStatusMapping={active:_mailpoet2.default.I18n.t("running"),inactive:_mailpoet2.default.I18n.t("cronWaiting")};return _react2.default.createElement("div",null,_react2.default.createElement("h2",null,_mailpoet2.default.I18n.t("systemStatusCronStatusTitle")),_react2.default.createElement(_key_value_table2.default,{max_width:"400px",rows:[{key:_mailpoet2.default.I18n.t("accessible"),value:_react2.default.createElement(_print_boolean2.default,null,status.accessible)},{key:_mailpoet2.default.I18n.t("status"),value:activeStatusMapping[status.status]?activeStatusMapping[status.status]:_mailpoet2.default.I18n.t("unknown")},{key:_mailpoet2.default.I18n.t("lastUpdated"),value:status.updated_at?_mailpoet2.default.Date.full(1e3*status.updated_at):_mailpoet2.default.I18n.t("unknown")},{key:_mailpoet2.default.I18n.t("lastRunStarted"),value:status.run_accessed_at?_mailpoet2.default.Date.full(1e3*status.run_started_at):_mailpoet2.default.I18n.t("unknown")},{key:_mailpoet2.default.I18n.t("lastRunCompleted"),value:status.run_completed_at?_mailpoet2.default.Date.full(1e3*status.run_completed_at):_mailpoet2.default.I18n.t("unknown")},{key:_mailpoet2.default.I18n.t("lastSeenError"),value:status.last_error||_mailpoet2.default.I18n.t("none")}]}))};CronStatus.propTypes={status_data:_propTypes2.default.shape({accessible:_propTypes2.default.bool,status:_propTypes2.default.string,updated_at:_propTypes2.default.number,run_accessed_at:_propTypes2.default.number,run_completed_at:_propTypes2.default.number}).isRequired},CronStatus.defaultProps={status_data:{accessible:null,status:null,updated_at:null,run_accessed_at:null,run_completed_at:null}},module.exports=CronStatus},436:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),PrintBoolean=function(props){return _react2.default.createElement("span",null,!0===props.children&&props.truthy||!1===props.children&&props.falsy||props.unknown)};PrintBoolean.propTypes={truthy:_propTypes2.default.string,falsy:_propTypes2.default.string,unknown:_propTypes2.default.string,children:_propTypes2.default.bool},PrintBoolean.defaultProps={truthy:_mailpoet2.default.I18n.t("yes"),falsy:_mailpoet2.default.I18n.t("no"),unknown:_mailpoet2.default.I18n.t("unknown"),children:null},module.exports=PrintBoolean},437:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_key_value_table=__webpack_require__(295),_key_value_table2=_interopRequireDefault(_key_value_table),_tasks_list=__webpack_require__(438),_tasks_list2=_interopRequireDefault(_tasks_list),_tasks_list_data_row=__webpack_require__(296),_tasks_list_data_row2=_interopRequireDefault(_tasks_list_data_row),QueueStatus=function(props){var status=props.status_data;return _react2.default.createElement("div",null,_react2.default.createElement("h2",null,_mailpoet2.default.I18n.t("systemStatusQueueTitle")),_react2.default.createElement(_key_value_table2.default,{max_width:"400px",rows:[{key:_mailpoet2.default.I18n.t("status"),value:"paused"===status.status?_mailpoet2.default.I18n.t("paused"):_mailpoet2.default.I18n.t("running")},{key:_mailpoet2.default.I18n.t("startedAt"),value:status.started?_mailpoet2.default.Date.full(1e3*status.started):_mailpoet2.default.I18n.t("unknown")},{key:_mailpoet2.default.I18n.t("sentEmails"),value:status.sent||0},{key:_mailpoet2.default.I18n.t("retryAttempt"),value:status.retry_attempt||_mailpoet2.default.I18n.t("none")},{key:_mailpoet2.default.I18n.t("retryAt"),value:status.retry_at?_mailpoet2.default.Date.full(1e3*status.retry_at):_mailpoet2.default.I18n.t("none")},{key:_mailpoet2.default.I18n.t("error"),value:status.error?status.error.error_message:_mailpoet2.default.I18n.t("none")},{key:_mailpoet2.default.I18n.t("totalCompletedTasks"),value:status.tasksStatusCounts.completed},{key:_mailpoet2.default.I18n.t("totalRunningTasks"),value:status.tasksStatusCounts.running},{key:_mailpoet2.default.I18n.t("totalPausedTasks"),value:status.tasksStatusCounts.paused},{key:_mailpoet2.default.I18n.t("totalScheduledTasks"),value:status.tasksStatusCounts.scheduled}]}),_react2.default.createElement("h4",null,_mailpoet2.default.I18n.t("scheduledTasks")),_react2.default.createElement(_tasks_list2.default,{show_scheduled_at:!0,tasks:status.latestTasks.filter(function(task){return"scheduled"===task.status})}),_react2.default.createElement("h4",null,_mailpoet2.default.I18n.t("runningTasks")),_react2.default.createElement(_tasks_list2.default,{tasks:status.latestTasks.filter(function(task){return null===task.status})}),_react2.default.createElement("h4",null,_mailpoet2.default.I18n.t("completedTasks")),_react2.default.createElement(_tasks_list2.default,{tasks:status.latestTasks.filter(function(task){return"completed"===task.status})}))};QueueStatus.propTypes={status_data:_propTypes2.default.shape({status:_propTypes2.default.string,started:_propTypes2.default.number,sent:_propTypes2.default.number,retry_attempt:_propTypes2.default.number,retry_at:_propTypes2.default.number,error:_propTypes2.default.shape({operation:_propTypes2.default.string,error_message:_propTypes2.default.string}),tasksStatusCounts:_propTypes2.default.shape({completed:_propTypes2.default.number.isRequired,running:_propTypes2.default.number.isRequired,paused:_propTypes2.default.number.isRequired,scheduled:_propTypes2.default.number.isRequired}).isRequired,latestTasks:_propTypes2.default.arrayOf(_tasks_list_data_row2.default.propTypes.task).isRequired}).isRequired},QueueStatus.defaultProps={status_data:{status:null,started:null,sent:null,retry_attempt:null,retry_at:null,error:null}},module.exports=QueueStatus},438:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_tasks_list_data_row=__webpack_require__(296),_tasks_list_data_row2=_interopRequireDefault(_tasks_list_data_row),_tasks_list_labels_row=__webpack_require__(439),_tasks_list_labels_row2=_interopRequireDefault(_tasks_list_labels_row),TasksList=function(props){var colsCount=props.show_scheduled_at?6:5;return _react2.default.createElement("table",{className:"widefat fixed striped"},_react2.default.createElement("thead",null,_react2.default.createElement(_tasks_list_labels_row2.default,{show_scheduled_at:props.show_scheduled_at})),_react2.default.createElement("tbody",null,props.tasks.length?props.tasks.map(function(task){return _react2.default.createElement(_tasks_list_data_row2.default,{key:task.id,task:task,show_scheduled_at:props.show_scheduled_at})}):_react2.default.createElement("tr",{className:"no-items"},_react2.default.createElement("td",{colSpan:colsCount},_mailpoet2.default.I18n.t("nothingToShow")))),_react2.default.createElement("tfoot",null,_react2.default.createElement(_tasks_list_labels_row2.default,{show_scheduled_at:props.show_scheduled_at})))};TasksList.propTypes={show_scheduled_at:_propTypes2.default.bool,tasks:_propTypes2.default.arrayOf(_tasks_list_data_row2.default.propTypes.task).isRequired},TasksList.defaultProps={show_scheduled_at:!1},module.exports=TasksList},439:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),TasksListLabelsRow=function(props){return _react2.default.createElement("tr",null,_react2.default.createElement("th",{className:"row-title"},"Id"),_react2.default.createElement("th",{className:"row-title"},_mailpoet2.default.I18n.t("type")),_react2.default.createElement("th",{className:"row-title"},_mailpoet2.default.I18n.t("email")),_react2.default.createElement("th",{className:"row-title"},_mailpoet2.default.I18n.t("priority")),props.show_scheduled_at?_react2.default.createElement("th",{className:"row-title"},_mailpoet2.default.I18n.t("scheduledAt")):null,_react2.default.createElement("th",{className:"row-title"},_mailpoet2.default.I18n.t("updatedAt")))};TasksListLabelsRow.propTypes={show_scheduled_at:_propTypes2.default.bool},TasksListLabelsRow.defaultProps={show_scheduled_at:!1},module.exports=TasksListLabelsRow},440:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function YourPrivacy(){return _react2.default.createElement("div",null,_react2.default.createElement(_tabs2.default,{tab:"yourPrivacy"}),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("yourPrivacyContent1")),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("yourPrivacyContent2")),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("yourPrivacyContent3")),_react2.default.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://www.mailpoet.com/privacy-notice/",className:"button button-primary"},_mailpoet2.default.I18n.t("yourPrivacyButton")))}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_tabs=__webpack_require__(188),_tabs2=_interopRequireDefault(_tabs);module.exports=YourPrivacy},441:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function Intro(){if(!(introActive||innerWidth<=960)){var intro=(0,_intro2.default)();intro.setOptions({steps:introSteps,nextLabel:_mailpoet2.default.I18n.t("introNext")+" →",prevLabel:"← "+_mailpoet2.default.I18n.t("introBack"),skipLabel:_mailpoet2.default.I18n.t("introSkip"),doneLabel:_mailpoet2.default.I18n.t("introDone"),positionPrecedence:["right","left","bottom","top"],buttonClass:"button",hidePrev:!0,hideNext:!0,helperElementPadding:12,scrollToElement:!1,showStepNumbers:!1,tooltipPosition:"auto"}),intro.onbeforechange(function(){var step=intro._currentStep,element=introSteps[step].element;intro._introItems[step].element="string"==typeof element?document.querySelector(element):element}),intro.onafterchange(function(targetElement){if("fixed"===getComputedStyle(targetElement).getPropertyValue("position")){var helperLayer=document.querySelector(".introjs-helperLayer"),referenceLayer=document.querySelector(".introjs-tooltipReferenceLayer");referenceLayer.style.top=parseInt(referenceLayer.style.top,10)-pageYOffset+"px",helperLayer.style.top=parseInt(helperLayer.style.top,10)-pageYOffset+"px"}}),intro.onexit(function(){introActive=!1,document.body.classList.remove("mailpoet-intro-active")}),intro.onskip(function(){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:{show_intro:0}})}),intro.start(),introActive=!0,document.body.classList.add("mailpoet-intro-active")}}var _intro=__webpack_require__(442),_intro2=_interopRequireDefault(_intro),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),introSteps=[{element:document.querySelector("#toplevel_page_mailpoet-newsletters > ul > li > a[href*=mailpoet-segments]").parentNode,intro:_mailpoet2.default.I18n.t("introLists")},{element:document.querySelector("#toplevel_page_mailpoet-newsletters > ul > li > a[href*=mailpoet-forms]").parentNode,intro:_mailpoet2.default.I18n.t("introForms")},{element:"#hs-beacon:not(.hs-beacon-hidden) iframe, .olark-launch-button",intro:_mailpoet2.default.I18n.t("introChat")},{element:"#mailpoet-new-email",intro:_mailpoet2.default.I18n.t("introEmails")}],introActive=!1;_mailpoet2.default.showIntro=Intro},442:function(module,exports,__webpack_require__){!function(f){module.exports=f(),module.exports.introJs=function(){return console.warn('Deprecated: please use require("intro.js") directly, instead of the introJs method of the function'),f().apply(this,arguments)}}(function(){function IntroJs(obj){this._targetElement=obj,this._introItems=[],this._options={nextLabel:"Next →",prevLabel:"← Back",skipLabel:"Skip",doneLabel:"Done",hidePrev:!1,hideNext:!1,tooltipPosition:"bottom",tooltipClass:"",highlightClass:"",exitOnEsc:!0,exitOnOverlayClick:!0,showStepNumbers:!0,keyboardNavigation:!0,showButtons:!0,showBullets:!0,showProgress:!1,scrollToElement:!0,scrollTo:"element",scrollPadding:30,overlayOpacity:.8,positionPrecedence:["bottom","top","right","left"],disableInteraction:!1,helperElementPadding:10,hintPosition:"top-middle",hintButtonLabel:"Got it",hintAnimation:!0,buttonClass:"introjs-button"}}function _introForElement(targetElm,group){var allIntroSteps=targetElm.querySelectorAll("*[data-intro]"),introItems=[];if(this._options.steps)_forEach(this._options.steps,function(step){var currentItem=_cloneObject(step);if(currentItem.step=introItems.length+1,"string"==typeof currentItem.element&&(currentItem.element=document.querySelector(currentItem.element)),void 0===currentItem.element||null===currentItem.element){var floatingElementQuery=document.querySelector(".introjsFloatingElement");null===floatingElementQuery&&(floatingElementQuery=document.createElement("div"),floatingElementQuery.className="introjsFloatingElement",document.body.appendChild(floatingElementQuery)),currentItem.element=floatingElementQuery,currentItem.position="floating"}currentItem.scrollTo=currentItem.scrollTo||this._options.scrollTo,void 0===currentItem.disableInteraction&&(currentItem.disableInteraction=this._options.disableInteraction),null!==currentItem.element&&introItems.push(currentItem)}.bind(this));else{var disableInteraction,elmsLength=allIntroSteps.length;if(elmsLength<1)return!1;_forEach(allIntroSteps,function(currentElement){if((!group||currentElement.getAttribute("data-intro-group")===group)&&"none"!==currentElement.style.display){var step=parseInt(currentElement.getAttribute("data-step"),10);disableInteraction=void 0!==currentElement.getAttribute("data-disable-interaction")?!!currentElement.getAttribute("data-disable-interaction"):this._options.disableInteraction,step>0&&(introItems[step-1]={element:currentElement,intro:currentElement.getAttribute("data-intro"),step:parseInt(currentElement.getAttribute("data-step"),10),tooltipClass:currentElement.getAttribute("data-tooltipclass"),highlightClass:currentElement.getAttribute("data-highlightclass"),position:currentElement.getAttribute("data-position")||this._options.tooltipPosition,scrollTo:currentElement.getAttribute("data-scrollto")||this._options.scrollTo,disableInteraction:disableInteraction})}}.bind(this));var nextStep=0;_forEach(allIntroSteps,function(currentElement){if((!group||currentElement.getAttribute("data-intro-group")===group)&&null===currentElement.getAttribute("data-step")){for(;;){if(void 0===introItems[nextStep])break;nextStep++}disableInteraction=void 0!==currentElement.getAttribute("data-disable-interaction")?!!currentElement.getAttribute("data-disable-interaction"):this._options.disableInteraction,introItems[nextStep]={element:currentElement,intro:currentElement.getAttribute("data-intro"),step:nextStep+1,tooltipClass:currentElement.getAttribute("data-tooltipclass"),highlightClass:currentElement.getAttribute("data-highlightclass"),position:currentElement.getAttribute("data-position")||this._options.tooltipPosition,scrollTo:currentElement.getAttribute("data-scrollto")||this._options.scrollTo,disableInteraction:disableInteraction}}}.bind(this))}for(var tempIntroItems=[],z=0;z<introItems.length;z++)introItems[z]&&tempIntroItems.push(introItems[z]);return introItems=tempIntroItems,introItems.sort(function(a,b){return a.step-b.step}),this._introItems=introItems,_addOverlayLayer.call(this,targetElm)&&(_nextStep.call(this),this._options.keyboardNavigation&&DOMEvent.on(window,"keydown",_onKeyDown,this,!0),DOMEvent.on(window,"resize",_onResize,this,!0)),!1}function _onResize(){this.refresh.call(this)}function _onKeyDown(e){var code=null===e.code?e.which:e.code;if(null===code&&(code=null===e.charCode?e.keyCode:e.charCode),"Escape"!==code&&27!==code||!0!==this._options.exitOnEsc){if("ArrowLeft"===code||37===code)_previousStep.call(this);else if("ArrowRight"===code||39===code)_nextStep.call(this);else if("Enter"===code||13===code){var target=e.target||e.srcElement;target&&target.className.match("introjs-prevbutton")?_previousStep.call(this):target&&target.className.match("introjs-skipbutton")?(this._introItems.length-1===this._currentStep&&"function"==typeof this._introCompleteCallback&&this._introCompleteCallback.call(this),_exitIntro.call(this,this._targetElement)):target&&target.getAttribute("data-stepnumber")?target.click():_nextStep.call(this),e.preventDefault?e.preventDefault():e.returnValue=!1}}else _exitIntro.call(this,this._targetElement)}function _cloneObject(object){if(null===object||"object"!=typeof object||void 0!==object.nodeType)return object;var temp={};for(var key in object)void 0!==window.jQuery&&object[key]instanceof window.jQuery?temp[key]=object[key]:temp[key]=_cloneObject(object[key]);return temp}function _goToStep(step){this._currentStep=step-2,void 0!==this._introItems&&_nextStep.call(this)}function _goToStepNumber(step){this._currentStepNumber=step,void 0!==this._introItems&&_nextStep.call(this)}function _nextStep(){this._direction="forward",void 0!==this._currentStepNumber&&_forEach(this._introItems,function(item,i){item.step===this._currentStepNumber&&(this._currentStep=i-1,this._currentStepNumber=void 0)}.bind(this)),void 0===this._currentStep?this._currentStep=0:++this._currentStep;var nextStep=this._introItems[this._currentStep],continueStep=!0;return void 0!==this._introBeforeChangeCallback&&(continueStep=this._introBeforeChangeCallback.call(this,nextStep.element)),!1===continueStep?(--this._currentStep,!1):this._introItems.length<=this._currentStep?("function"==typeof this._introCompleteCallback&&this._introCompleteCallback.call(this),void _exitIntro.call(this,this._targetElement)):void _showElement.call(this,nextStep)}function _previousStep(){if(this._direction="backward",0===this._currentStep)return!1;--this._currentStep;var nextStep=this._introItems[this._currentStep],continueStep=!0;if(void 0!==this._introBeforeChangeCallback&&(continueStep=this._introBeforeChangeCallback.call(this,nextStep.element)),!1===continueStep)return++this._currentStep,!1;_showElement.call(this,nextStep)}function _refresh(){if(_setHelperLayerPosition.call(this,document.querySelector(".introjs-helperLayer")),_setHelperLayerPosition.call(this,document.querySelector(".introjs-tooltipReferenceLayer")),_setHelperLayerPosition.call(this,document.querySelector(".introjs-disableInteraction")),void 0!==this._currentStep&&null!==this._currentStep){var oldHelperNumberLayer=document.querySelector(".introjs-helperNumberLayer"),oldArrowLayer=document.querySelector(".introjs-arrow"),oldtooltipContainer=document.querySelector(".introjs-tooltip");_placeTooltip.call(this,this._introItems[this._currentStep].element,oldtooltipContainer,oldArrowLayer,oldHelperNumberLayer)}return _reAlignHints.call(this),this}function _exitIntro(targetElement,force){var continueExit=!0;if(void 0!==this._introBeforeExitCallback&&(continueExit=this._introBeforeExitCallback.call(this)),force||!1!==continueExit){var overlayLayers=targetElement.querySelectorAll(".introjs-overlay");overlayLayers&&overlayLayers.length&&_forEach(overlayLayers,function(overlayLayer){overlayLayer.style.opacity=0,window.setTimeout(function(){this.parentNode&&this.parentNode.removeChild(this)}.bind(overlayLayer),500)}.bind(this));var helperLayer=targetElement.querySelector(".introjs-helperLayer");helperLayer&&helperLayer.parentNode.removeChild(helperLayer);var referenceLayer=targetElement.querySelector(".introjs-tooltipReferenceLayer");referenceLayer&&referenceLayer.parentNode.removeChild(referenceLayer);var disableInteractionLayer=targetElement.querySelector(".introjs-disableInteraction");disableInteractionLayer&&disableInteractionLayer.parentNode.removeChild(disableInteractionLayer);var floatingElement=document.querySelector(".introjsFloatingElement");floatingElement&&floatingElement.parentNode.removeChild(floatingElement),_removeShowElement();_forEach(document.querySelectorAll(".introjs-fixParent"),function(parent){_removeClass(parent,/introjs-fixParent/g)}),DOMEvent.off(window,"keydown",_onKeyDown,this,!0),DOMEvent.off(window,"resize",_onResize,this,!0),void 0!==this._introExitCallback&&this._introExitCallback.call(this),this._currentStep=void 0}}function _placeTooltip(targetElement,tooltipLayer,arrowLayer,helperNumberLayer,hintMode){var currentStepObj,tooltipOffset,targetOffset,windowSize,currentTooltipPosition,tooltipCssClass="";if(hintMode=hintMode||!1,tooltipLayer.style.top=null,tooltipLayer.style.right=null,tooltipLayer.style.bottom=null,tooltipLayer.style.left=null,tooltipLayer.style.marginLeft=null,tooltipLayer.style.marginTop=null,arrowLayer.style.display="inherit",void 0!==helperNumberLayer&&null!==helperNumberLayer&&(helperNumberLayer.style.top=null,helperNumberLayer.style.left=null),this._introItems[this._currentStep]){currentStepObj=this._introItems[this._currentStep],tooltipCssClass="string"==typeof currentStepObj.tooltipClass?currentStepObj.tooltipClass:this._options.tooltipClass,tooltipLayer.className=("introjs-tooltip "+tooltipCssClass).replace(/^\s+|\s+$/g,""),tooltipLayer.setAttribute("role","dialog"),currentTooltipPosition=this._introItems[this._currentStep].position,"floating"!==currentTooltipPosition&&(currentTooltipPosition=_determineAutoPosition.call(this,targetElement,tooltipLayer,currentTooltipPosition));var tooltipLayerStyleLeft;switch(targetOffset=_getOffset(targetElement),tooltipOffset=_getOffset(tooltipLayer),windowSize=_getWinSize(),_addClass(tooltipLayer,"introjs-"+currentTooltipPosition),currentTooltipPosition){case"top-right-aligned":arrowLayer.className="introjs-arrow bottom-right";var tooltipLayerStyleRight=0;_checkLeft(targetOffset,tooltipLayerStyleRight,tooltipOffset,tooltipLayer),tooltipLayer.style.bottom=targetOffset.height+20+"px";break;case"top-middle-aligned":arrowLayer.className="introjs-arrow bottom-middle";var tooltipLayerStyleLeftRight=targetOffset.width/2-tooltipOffset.width/2;hintMode&&(tooltipLayerStyleLeftRight+=5),_checkLeft(targetOffset,tooltipLayerStyleLeftRight,tooltipOffset,tooltipLayer)&&(tooltipLayer.style.right=null,_checkRight(targetOffset,tooltipLayerStyleLeftRight,tooltipOffset,windowSize,tooltipLayer)),tooltipLayer.style.bottom=targetOffset.height+20+"px";break;case"top-left-aligned":case"top":arrowLayer.className="introjs-arrow bottom",tooltipLayerStyleLeft=hintMode?0:15,_checkRight(targetOffset,tooltipLayerStyleLeft,tooltipOffset,windowSize,tooltipLayer),tooltipLayer.style.bottom=targetOffset.height+20+"px";break;case"right":tooltipLayer.style.left=targetOffset.width+20+"px",targetOffset.top+tooltipOffset.height>windowSize.height?(arrowLayer.className="introjs-arrow left-bottom",tooltipLayer.style.top="-"+(tooltipOffset.height-targetOffset.height-20)+"px"):arrowLayer.className="introjs-arrow left";break;case"left":hintMode||!0!==this._options.showStepNumbers||(tooltipLayer.style.top="15px"),targetOffset.top+tooltipOffset.height>windowSize.height?(tooltipLayer.style.top="-"+(tooltipOffset.height-targetOffset.height-20)+"px",arrowLayer.className="introjs-arrow right-bottom"):arrowLayer.className="introjs-arrow right",tooltipLayer.style.right=targetOffset.width+20+"px";break;case"floating":arrowLayer.style.display="none",tooltipLayer.style.left="50%",tooltipLayer.style.top="50%",tooltipLayer.style.marginLeft="-"+tooltipOffset.width/2+"px",tooltipLayer.style.marginTop="-"+tooltipOffset.height/2+"px",void 0!==helperNumberLayer&&null!==helperNumberLayer&&(helperNumberLayer.style.left="-"+(tooltipOffset.width/2+18)+"px",helperNumberLayer.style.top="-"+(tooltipOffset.height/2+18)+"px");break;case"bottom-right-aligned":arrowLayer.className="introjs-arrow top-right",tooltipLayerStyleRight=0,_checkLeft(targetOffset,tooltipLayerStyleRight,tooltipOffset,tooltipLayer),tooltipLayer.style.top=targetOffset.height+20+"px";break;case"bottom-middle-aligned":arrowLayer.className="introjs-arrow top-middle",tooltipLayerStyleLeftRight=targetOffset.width/2-tooltipOffset.width/2,hintMode&&(tooltipLayerStyleLeftRight+=5),_checkLeft(targetOffset,tooltipLayerStyleLeftRight,tooltipOffset,tooltipLayer)&&(tooltipLayer.style.right=null,_checkRight(targetOffset,tooltipLayerStyleLeftRight,tooltipOffset,windowSize,tooltipLayer)),tooltipLayer.style.top=targetOffset.height+20+"px";break;default:arrowLayer.className="introjs-arrow top",tooltipLayerStyleLeft=0,_checkRight(targetOffset,tooltipLayerStyleLeft,tooltipOffset,windowSize,tooltipLayer),tooltipLayer.style.top=targetOffset.height+20+"px"}}}function _checkRight(targetOffset,tooltipLayerStyleLeft,tooltipOffset,windowSize,tooltipLayer){return targetOffset.left+tooltipLayerStyleLeft+tooltipOffset.width>windowSize.width?(tooltipLayer.style.left=windowSize.width-tooltipOffset.width-targetOffset.left+"px",!1):(tooltipLayer.style.left=tooltipLayerStyleLeft+"px",!0)}function _checkLeft(targetOffset,tooltipLayerStyleRight,tooltipOffset,tooltipLayer){return targetOffset.left+targetOffset.width-tooltipLayerStyleRight-tooltipOffset.width<0?(tooltipLayer.style.left=-targetOffset.left+"px",!1):(tooltipLayer.style.right=tooltipLayerStyleRight+"px",!0)}function _determineAutoPosition(targetElement,tooltipLayer,desiredTooltipPosition){var possiblePositions=this._options.positionPrecedence.slice(),windowSize=_getWinSize(),tooltipHeight=_getOffset(tooltipLayer).height+10,tooltipWidth=_getOffset(tooltipLayer).width+20,targetElementRect=targetElement.getBoundingClientRect(),calculatedPosition="floating";targetElementRect.bottom+tooltipHeight+tooltipHeight>windowSize.height&&_removeEntry(possiblePositions,"bottom"),targetElementRect.top-tooltipHeight<0&&_removeEntry(possiblePositions,"top"),targetElementRect.right+tooltipWidth>windowSize.width&&_removeEntry(possiblePositions,"right"),targetElementRect.left-tooltipWidth<0&&_removeEntry(possiblePositions,"left");var desiredAlignment=function(pos){var hyphenIndex=pos.indexOf("-");return-1!==hyphenIndex?pos.substr(hyphenIndex):""}(desiredTooltipPosition||"");return desiredTooltipPosition&&(desiredTooltipPosition=desiredTooltipPosition.split("-")[0]),possiblePositions.length&&(calculatedPosition="auto"!==desiredTooltipPosition&&possiblePositions.indexOf(desiredTooltipPosition)>-1?desiredTooltipPosition:possiblePositions[0]),-1!==["top","bottom"].indexOf(calculatedPosition)&&(calculatedPosition+=_determineAutoAlignment(targetElementRect.left,tooltipWidth,windowSize,desiredAlignment)),calculatedPosition}function _determineAutoAlignment(offsetLeft,tooltipWidth,windowSize,desiredAlignment){var halfTooltipWidth=tooltipWidth/2,winWidth=Math.min(windowSize.width,window.screen.width),possibleAlignments=["-left-aligned","-middle-aligned","-right-aligned"];return winWidth-offsetLeft<tooltipWidth&&_removeEntry(possibleAlignments,"-left-aligned"),(offsetLeft<halfTooltipWidth||winWidth-offsetLeft<halfTooltipWidth)&&_removeEntry(possibleAlignments,"-middle-aligned"),offsetLeft<tooltipWidth&&_removeEntry(possibleAlignments,"-right-aligned"),possibleAlignments.length?-1!==possibleAlignments.indexOf(desiredAlignment)?desiredAlignment:possibleAlignments[0]:"-middle-aligned"}function _removeEntry(stringArray,stringToRemove){stringArray.indexOf(stringToRemove)>-1&&stringArray.splice(stringArray.indexOf(stringToRemove),1)}function _setHelperLayerPosition(helperLayer){if(helperLayer){if(!this._introItems[this._currentStep])return;var currentElement=this._introItems[this._currentStep],elementPosition=_getOffset(currentElement.element),widthHeightPadding=this._options.helperElementPadding;_isFixed(currentElement.element)?_addClass(helperLayer,"introjs-fixedTooltip"):_removeClass(helperLayer,"introjs-fixedTooltip"),"floating"===currentElement.position&&(widthHeightPadding=0),helperLayer.style.cssText="width: "+(elementPosition.width+widthHeightPadding)+"px; height:"+(elementPosition.height+widthHeightPadding)+"px; top:"+(elementPosition.top-widthHeightPadding/2)+"px;left: "+(elementPosition.left-widthHeightPadding/2)+"px;"}}function _disableInteraction(){var disableInteractionLayer=document.querySelector(".introjs-disableInteraction");null===disableInteractionLayer&&(disableInteractionLayer=document.createElement("div"),disableInteractionLayer.className="introjs-disableInteraction",this._targetElement.appendChild(disableInteractionLayer)),_setHelperLayerPosition.call(this,disableInteractionLayer)}function _setAnchorAsButton(anchor){anchor.setAttribute("role","button"),anchor.tabIndex=0}function _showElement(targetElement){void 0!==this._introChangeCallback&&this._introChangeCallback.call(this,targetElement.element);var nextTooltipButton,prevTooltipButton,skipTooltipButton,scrollParent,self=this,oldHelperLayer=document.querySelector(".introjs-helperLayer"),oldReferenceLayer=document.querySelector(".introjs-tooltipReferenceLayer"),highlightClass="introjs-helperLayer";if("string"==typeof targetElement.highlightClass&&(highlightClass+=" "+targetElement.highlightClass),"string"==typeof this._options.highlightClass&&(highlightClass+=" "+this._options.highlightClass),null!==oldHelperLayer){var oldHelperNumberLayer=oldReferenceLayer.querySelector(".introjs-helperNumberLayer"),oldtooltipLayer=oldReferenceLayer.querySelector(".introjs-tooltiptext"),oldArrowLayer=oldReferenceLayer.querySelector(".introjs-arrow"),oldtooltipContainer=oldReferenceLayer.querySelector(".introjs-tooltip");if(skipTooltipButton=oldReferenceLayer.querySelector(".introjs-skipbutton"),prevTooltipButton=oldReferenceLayer.querySelector(".introjs-prevbutton"),nextTooltipButton=oldReferenceLayer.querySelector(".introjs-nextbutton"),oldHelperLayer.className=highlightClass,oldtooltipContainer.style.opacity=0,oldtooltipContainer.style.display="none",null!==oldHelperNumberLayer){var lastIntroItem=this._introItems[targetElement.step-2>=0?targetElement.step-2:0];(null!==lastIntroItem&&"forward"===this._direction&&"floating"===lastIntroItem.position||"backward"===this._direction&&"floating"===targetElement.position)&&(oldHelperNumberLayer.style.opacity=0)}scrollParent=_getScrollParent(targetElement.element),scrollParent!==document.body&&_scrollParentToElement(scrollParent,targetElement.element),_setHelperLayerPosition.call(self,oldHelperLayer),_setHelperLayerPosition.call(self,oldReferenceLayer);_forEach(document.querySelectorAll(".introjs-fixParent"),function(parent){_removeClass(parent,/introjs-fixParent/g)}),_removeShowElement(),self._lastShowElementTimer&&window.clearTimeout(self._lastShowElementTimer),self._lastShowElementTimer=window.setTimeout(function(){null!==oldHelperNumberLayer&&(oldHelperNumberLayer.innerHTML=targetElement.step),oldtooltipLayer.innerHTML=targetElement.intro,oldtooltipContainer.style.display="block",_placeTooltip.call(self,targetElement.element,oldtooltipContainer,oldArrowLayer,oldHelperNumberLayer),self._options.showBullets&&(oldReferenceLayer.querySelector(".introjs-bullets li > a.active").className="",oldReferenceLayer.querySelector('.introjs-bullets li > a[data-stepnumber="'+targetElement.step+'"]').className="active"),oldReferenceLayer.querySelector(".introjs-progress .introjs-progressbar").style.cssText="width:"+_getProgress.call(self)+"%;",oldReferenceLayer.querySelector(".introjs-progress .introjs-progressbar").setAttribute("aria-valuenow",_getProgress.call(self)),oldtooltipContainer.style.opacity=1,oldHelperNumberLayer&&(oldHelperNumberLayer.style.opacity=1),void 0!==skipTooltipButton&&null!==skipTooltipButton&&/introjs-donebutton/gi.test(skipTooltipButton.className)?skipTooltipButton.focus():void 0!==nextTooltipButton&&null!==nextTooltipButton&&nextTooltipButton.focus(),_scrollTo.call(self,targetElement.scrollTo,targetElement,oldtooltipLayer)},350)}else{var helperLayer=document.createElement("div"),referenceLayer=document.createElement("div"),arrowLayer=document.createElement("div"),tooltipLayer=document.createElement("div"),tooltipTextLayer=document.createElement("div"),bulletsLayer=document.createElement("div"),progressLayer=document.createElement("div"),buttonsLayer=document.createElement("div");helperLayer.className=highlightClass,referenceLayer.className="introjs-tooltipReferenceLayer",scrollParent=_getScrollParent(targetElement.element),scrollParent!==document.body&&_scrollParentToElement(scrollParent,targetElement.element),_setHelperLayerPosition.call(self,helperLayer),_setHelperLayerPosition.call(self,referenceLayer),this._targetElement.appendChild(helperLayer),this._targetElement.appendChild(referenceLayer),arrowLayer.className="introjs-arrow",tooltipTextLayer.className="introjs-tooltiptext",tooltipTextLayer.innerHTML=targetElement.intro,bulletsLayer.className="introjs-bullets",!1===this._options.showBullets&&(bulletsLayer.style.display="none");var ulContainer=document.createElement("ul");ulContainer.setAttribute("role","tablist");var anchorClick=function(){self.goToStep(this.getAttribute("data-stepnumber"))};_forEach(this._introItems,function(item,i){var innerLi=document.createElement("li"),anchorLink=document.createElement("a");innerLi.setAttribute("role","presentation"),anchorLink.setAttribute("role","tab"),anchorLink.onclick=anchorClick,i===targetElement.step-1&&(anchorLink.className="active"),_setAnchorAsButton(anchorLink),anchorLink.innerHTML=" ",anchorLink.setAttribute("data-stepnumber",item.step),innerLi.appendChild(anchorLink),ulContainer.appendChild(innerLi)}),bulletsLayer.appendChild(ulContainer),progressLayer.className="introjs-progress",!1===this._options.showProgress&&(progressLayer.style.display="none");var progressBar=document.createElement("div");progressBar.className="introjs-progressbar",progressBar.setAttribute("role","progress"),progressBar.setAttribute("aria-valuemin",0),progressBar.setAttribute("aria-valuemax",100),progressBar.setAttribute("aria-valuenow",_getProgress.call(this)),progressBar.style.cssText="width:"+_getProgress.call(this)+"%;",progressLayer.appendChild(progressBar),buttonsLayer.className="introjs-tooltipbuttons",!1===this._options.showButtons&&(buttonsLayer.style.display="none"),tooltipLayer.className="introjs-tooltip",tooltipLayer.appendChild(tooltipTextLayer),tooltipLayer.appendChild(bulletsLayer),tooltipLayer.appendChild(progressLayer);var helperNumberLayer=document.createElement("span");!0===this._options.showStepNumbers&&(helperNumberLayer.className="introjs-helperNumberLayer",helperNumberLayer.innerHTML=targetElement.step,referenceLayer.appendChild(helperNumberLayer)),tooltipLayer.appendChild(arrowLayer),referenceLayer.appendChild(tooltipLayer),nextTooltipButton=document.createElement("a"),nextTooltipButton.onclick=function(){self._introItems.length-1!==self._currentStep&&_nextStep.call(self)},_setAnchorAsButton(nextTooltipButton),nextTooltipButton.innerHTML=this._options.nextLabel,prevTooltipButton=document.createElement("a"),prevTooltipButton.onclick=function(){0!==self._currentStep&&_previousStep.call(self)},_setAnchorAsButton(prevTooltipButton),prevTooltipButton.innerHTML=this._options.prevLabel,skipTooltipButton=document.createElement("a"),skipTooltipButton.className=this._options.buttonClass+" introjs-skipbutton ",_setAnchorAsButton(skipTooltipButton),skipTooltipButton.innerHTML=this._options.skipLabel,skipTooltipButton.onclick=function(){self._introItems.length-1===self._currentStep&&"function"==typeof self._introCompleteCallback&&self._introCompleteCallback.call(self),self._introItems.length-1!==self._currentStep&&"function"==typeof self._introExitCallback&&self._introExitCallback.call(self),self._introSkipCallback.call(self),_exitIntro.call(self,self._targetElement)},buttonsLayer.appendChild(skipTooltipButton),this._introItems.length>1&&(buttonsLayer.appendChild(prevTooltipButton),buttonsLayer.appendChild(nextTooltipButton)),tooltipLayer.appendChild(buttonsLayer),_placeTooltip.call(self,targetElement.element,tooltipLayer,arrowLayer,helperNumberLayer),_scrollTo.call(this,targetElement.scrollTo,targetElement,tooltipLayer)}var disableInteractionLayer=self._targetElement.querySelector(".introjs-disableInteraction");disableInteractionLayer&&disableInteractionLayer.parentNode.removeChild(disableInteractionLayer),targetElement.disableInteraction&&_disableInteraction.call(self),0===this._currentStep&&this._introItems.length>1?(void 0!==skipTooltipButton&&null!==skipTooltipButton&&(skipTooltipButton.className=this._options.buttonClass+" introjs-skipbutton"),void 0!==nextTooltipButton&&null!==nextTooltipButton&&(nextTooltipButton.className=this._options.buttonClass+" introjs-nextbutton"),!0===this._options.hidePrev?(void 0!==prevTooltipButton&&null!==prevTooltipButton&&(prevTooltipButton.className=this._options.buttonClass+" introjs-prevbutton introjs-hidden"),void 0!==nextTooltipButton&&null!==nextTooltipButton&&_addClass(nextTooltipButton,"introjs-fullbutton")):void 0!==prevTooltipButton&&null!==prevTooltipButton&&(prevTooltipButton.className=this._options.buttonClass+" introjs-prevbutton introjs-disabled"),void 0!==skipTooltipButton&&null!==skipTooltipButton&&(skipTooltipButton.innerHTML=this._options.skipLabel)):this._introItems.length-1===this._currentStep||1===this._introItems.length?(void 0!==skipTooltipButton&&null!==skipTooltipButton&&(skipTooltipButton.innerHTML=this._options.doneLabel,_addClass(skipTooltipButton,"introjs-donebutton")),void 0!==prevTooltipButton&&null!==prevTooltipButton&&(prevTooltipButton.className=this._options.buttonClass+" introjs-prevbutton"),!0===this._options.hideNext?(void 0!==nextTooltipButton&&null!==nextTooltipButton&&(nextTooltipButton.className=this._options.buttonClass+" introjs-nextbutton introjs-hidden"),void 0!==prevTooltipButton&&null!==prevTooltipButton&&_addClass(prevTooltipButton,"introjs-fullbutton")):void 0!==nextTooltipButton&&null!==nextTooltipButton&&(nextTooltipButton.className=this._options.buttonClass+" introjs-nextbutton introjs-disabled")):(void 0!==skipTooltipButton&&null!==skipTooltipButton&&(skipTooltipButton.className=this._options.buttonClass+" introjs-skipbutton"),void 0!==prevTooltipButton&&null!==prevTooltipButton&&(prevTooltipButton.className=this._options.buttonClass+" introjs-prevbutton"),void 0!==nextTooltipButton&&null!==nextTooltipButton&&(nextTooltipButton.className=this._options.buttonClass+" introjs-nextbutton"),void 0!==skipTooltipButton&&null!==skipTooltipButton&&(skipTooltipButton.innerHTML=this._options.skipLabel)),prevTooltipButton.setAttribute("role","button"),nextTooltipButton.setAttribute("role","button"),skipTooltipButton.setAttribute("role","button"),void 0!==nextTooltipButton&&null!==nextTooltipButton&&nextTooltipButton.focus(),_setShowElement(targetElement),void 0!==this._introAfterChangeCallback&&this._introAfterChangeCallback.call(this,targetElement.element)}function _scrollTo(scrollTo,targetElement,tooltipLayer){if("off"!==scrollTo){var rect;if(this._options.scrollToElement&&(rect="tooltip"===scrollTo?tooltipLayer.getBoundingClientRect():targetElement.element.getBoundingClientRect(),!_elementInViewport(targetElement.element))){var winHeight=_getWinSize().height;rect.bottom-(rect.bottom-rect.top)<0||targetElement.element.clientHeight>winHeight?window.scrollBy(0,rect.top-(winHeight/2-rect.height/2)-this._options.scrollPadding):window.scrollBy(0,rect.top-(winHeight/2-rect.height/2)+this._options.scrollPadding)}}}function _removeShowElement(){_forEach(document.querySelectorAll(".introjs-showElement"),function(elm){_removeClass(elm,/introjs-[a-zA-Z]+/g)})}function _setShowElement(targetElement){var parentElm;if(targetElement.element instanceof SVGElement)for(parentElm=targetElement.element.parentNode;null!==targetElement.element.parentNode&&parentElm.tagName&&"body"!==parentElm.tagName.toLowerCase();)"svg"===parentElm.tagName.toLowerCase()&&_addClass(parentElm,"introjs-showElement introjs-relativePosition"),parentElm=parentElm.parentNode;_addClass(targetElement.element,"introjs-showElement");var currentElementPosition=_getPropValue(targetElement.element,"position");for("absolute"!==currentElementPosition&&"relative"!==currentElementPosition&&"fixed"!==currentElementPosition&&_addClass(targetElement.element,"introjs-relativePosition"),parentElm=targetElement.element.parentNode;null!==parentElm&&parentElm.tagName&&"body"!==parentElm.tagName.toLowerCase();){var zIndex=_getPropValue(parentElm,"z-index"),opacity=parseFloat(_getPropValue(parentElm,"opacity")),transform=_getPropValue(parentElm,"transform")||_getPropValue(parentElm,"-webkit-transform")||_getPropValue(parentElm,"-moz-transform")||_getPropValue(parentElm,"-ms-transform")||_getPropValue(parentElm,"-o-transform");(/[0-9]+/.test(zIndex)||opacity<1||"none"!==transform&&void 0!==transform)&&_addClass(parentElm,"introjs-fixParent"),parentElm=parentElm.parentNode}}function _forEach(arr,forEachFnc,completeFnc){if(arr)for(var i=0,len=arr.length;i<len;i++)forEachFnc(arr[i],i);"function"==typeof completeFnc&&completeFnc()}function _addClass(element,className){if(element instanceof SVGElement){var pre=element.getAttribute("class")||"";element.setAttribute("class",pre+" "+className)}else if(void 0!==element.classList){var classes=className.split(" ");_forEach(classes,function(cls){element.classList.add(cls)})}else element.className.match(className)||(element.className+=" "+className)}function _removeClass(element,classNameRegex){if(element instanceof SVGElement){var pre=element.getAttribute("class")||"";element.setAttribute("class",pre.replace(classNameRegex,"").replace(/^\s+|\s+$/g,""))}else element.className=element.className.replace(classNameRegex,"").replace(/^\s+|\s+$/g,"")}function _getPropValue(element,propName){var propValue="";return element.currentStyle?propValue=element.currentStyle[propName]:document.defaultView&&document.defaultView.getComputedStyle&&(propValue=document.defaultView.getComputedStyle(element,null).getPropertyValue(propName)),propValue&&propValue.toLowerCase?propValue.toLowerCase():propValue}function _isFixed(element){var p=element.parentNode;return!(!p||"HTML"===p.nodeName)&&("fixed"===_getPropValue(element,"position")||_isFixed(p))}function _getWinSize(){if(void 0!==window.innerWidth)return{width:window.innerWidth,height:window.innerHeight};var D=document.documentElement;return{width:D.clientWidth,height:D.clientHeight}}function _elementInViewport(el){var rect=el.getBoundingClientRect();return rect.top>=0&&rect.left>=0&&rect.bottom+80<=window.innerHeight&&rect.right<=window.innerWidth}function _addOverlayLayer(targetElm){var overlayLayer=document.createElement("div"),styleText="",self=this;if(overlayLayer.className="introjs-overlay",targetElm.tagName&&"body"!==targetElm.tagName.toLowerCase()){var elementPosition=_getOffset(targetElm);elementPosition&&(styleText+="width: "+elementPosition.width+"px; height:"+elementPosition.height+"px; top:"+elementPosition.top+"px;left: "+elementPosition.left+"px;",overlayLayer.style.cssText=styleText)}else styleText+="top: 0;bottom: 0; left: 0;right: 0;position: fixed;",overlayLayer.style.cssText=styleText;return targetElm.appendChild(overlayLayer),overlayLayer.onclick=function(){!0===self._options.exitOnOverlayClick&&_exitIntro.call(self,targetElm)},window.setTimeout(function(){styleText+="opacity: "+self._options.overlayOpacity.toString()+";",overlayLayer.style.cssText=styleText},10),!0}function _removeHintTooltip(){var tooltip=document.querySelector(".introjs-hintReference");if(tooltip){var step=tooltip.getAttribute("data-step");return tooltip.parentNode.removeChild(tooltip),step}}function _populateHints(targetElm){if(this._introItems=[],this._options.hints)_forEach(this._options.hints,function(hint){var currentItem=_cloneObject(hint);"string"==typeof currentItem.element&&(currentItem.element=document.querySelector(currentItem.element)),currentItem.hintPosition=currentItem.hintPosition||this._options.hintPosition,currentItem.hintAnimation=currentItem.hintAnimation||this._options.hintAnimation,null!==currentItem.element&&this._introItems.push(currentItem)}.bind(this));else{var hints=targetElm.querySelectorAll("*[data-hint]");if(!hints||!hints.length)return!1;_forEach(hints,function(currentElement){var hintAnimation=currentElement.getAttribute("data-hintanimation");hintAnimation=hintAnimation?"true"===hintAnimation:this._options.hintAnimation,this._introItems.push({element:currentElement,hint:currentElement.getAttribute("data-hint"),hintPosition:currentElement.getAttribute("data-hintposition")||this._options.hintPosition,hintAnimation:hintAnimation,tooltipClass:currentElement.getAttribute("data-tooltipclass"),position:currentElement.getAttribute("data-position")||this._options.tooltipPosition})}.bind(this))}_addHints.call(this),DOMEvent.on(document,"click",_removeHintTooltip,this,!1),DOMEvent.on(window,"resize",_reAlignHints,this,!0)}function _reAlignHints(){_forEach(this._introItems,function(item){void 0!==item.targetElement&&_alignHintPosition.call(this,item.hintPosition,item.element,item.targetElement)}.bind(this))}function _hintQuerySelectorAll(selector){var hintsWrapper=document.querySelector(".introjs-hints");return hintsWrapper?hintsWrapper.querySelectorAll(selector):[]}function _hideHint(stepId){var hint=_hintQuerySelectorAll('.introjs-hint[data-step="'+stepId+'"]')[0];_removeHintTooltip.call(this),hint&&_addClass(hint,"introjs-hidehint"),void 0!==this._hintCloseCallback&&this._hintCloseCallback.call(this,stepId)}function _hideHints(){_forEach(_hintQuerySelectorAll(".introjs-hint"),function(hint){_hideHint.call(this,hint.getAttribute("data-step"))}.bind(this))}function _showHints(){var hints=_hintQuerySelectorAll(".introjs-hint");hints&&hints.length?_forEach(hints,function(hint){_showHint.call(this,hint.getAttribute("data-step"))}.bind(this)):_populateHints.call(this,this._targetElement)}function _showHint(stepId){var hint=_hintQuerySelectorAll('.introjs-hint[data-step="'+stepId+'"]')[0];hint&&_removeClass(hint,/introjs-hidehint/g)}function _removeHints(){_forEach(_hintQuerySelectorAll(".introjs-hint"),function(hint){_removeHint.call(this,hint.getAttribute("data-step"))}.bind(this))}function _removeHint(stepId){var hint=_hintQuerySelectorAll('.introjs-hint[data-step="'+stepId+'"]')[0];hint&&hint.parentNode.removeChild(hint)}function _addHints(){var self=this,hintsWrapper=document.querySelector(".introjs-hints");null===hintsWrapper&&(hintsWrapper=document.createElement("div"),hintsWrapper.className="introjs-hints");var getHintClick=function(i){return function(e){var evt=e||window.event;evt.stopPropagation&&evt.stopPropagation(),null!==evt.cancelBubble&&(evt.cancelBubble=!0),_showHintDialog.call(self,i)}};_forEach(this._introItems,function(item,i){if(!document.querySelector('.introjs-hint[data-step="'+i+'"]')){var hint=document.createElement("a");_setAnchorAsButton(hint),hint.onclick=getHintClick(i),hint.className="introjs-hint",item.hintAnimation||_addClass(hint,"introjs-hint-no-anim"),_isFixed(item.element)&&_addClass(hint,"introjs-fixedhint");var hintDot=document.createElement("div");hintDot.className="introjs-hint-dot";var hintPulse=document.createElement("div");hintPulse.className="introjs-hint-pulse",hint.appendChild(hintDot),hint.appendChild(hintPulse),hint.setAttribute("data-step",i),item.targetElement=item.element,item.element=hint,_alignHintPosition.call(this,item.hintPosition,hint,item.targetElement),hintsWrapper.appendChild(hint)}}.bind(this)),document.body.appendChild(hintsWrapper),void 0!==this._hintsAddedCallback&&this._hintsAddedCallback.call(this)}function _alignHintPosition(position,hint,element){var offset=_getOffset.call(this,element);switch(position){default:case"top-left":hint.style.left=offset.left+"px",hint.style.top=offset.top+"px";break;case"top-right":hint.style.left=offset.left+offset.width-20+"px",hint.style.top=offset.top+"px";break;case"bottom-left":hint.style.left=offset.left+"px",hint.style.top=offset.top+offset.height-20+"px";break;case"bottom-right":hint.style.left=offset.left+offset.width-20+"px",hint.style.top=offset.top+offset.height-20+"px";break;case"middle-left":hint.style.left=offset.left+"px",hint.style.top=offset.top+(offset.height-20)/2+"px";break;case"middle-right":hint.style.left=offset.left+offset.width-20+"px",hint.style.top=offset.top+(offset.height-20)/2+"px";break;case"middle-middle":hint.style.left=offset.left+(offset.width-20)/2+"px",hint.style.top=offset.top+(offset.height-20)/2+"px";break;case"bottom-middle":hint.style.left=offset.left+(offset.width-20)/2+"px",hint.style.top=offset.top+offset.height-20+"px";break;case"top-middle":hint.style.left=offset.left+(offset.width-20)/2+"px",hint.style.top=offset.top+"px"}}function _showHintDialog(stepId){var hintElement=document.querySelector('.introjs-hint[data-step="'+stepId+'"]'),item=this._introItems[stepId];void 0!==this._hintClickCallback&&this._hintClickCallback.call(this,hintElement,item,stepId);var removedStep=_removeHintTooltip.call(this);if(parseInt(removedStep,10)!==stepId){var tooltipLayer=document.createElement("div"),tooltipTextLayer=document.createElement("div"),arrowLayer=document.createElement("div"),referenceLayer=document.createElement("div");tooltipLayer.className="introjs-tooltip",tooltipLayer.onclick=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},tooltipTextLayer.className="introjs-tooltiptext";var tooltipWrapper=document.createElement("p");tooltipWrapper.innerHTML=item.hint;var closeButton=document.createElement("a");closeButton.className=this._options.buttonClass,closeButton.setAttribute("role","button"),closeButton.innerHTML=this._options.hintButtonLabel,closeButton.onclick=_hideHint.bind(this,stepId),tooltipTextLayer.appendChild(tooltipWrapper),tooltipTextLayer.appendChild(closeButton),arrowLayer.className="introjs-arrow",tooltipLayer.appendChild(arrowLayer),tooltipLayer.appendChild(tooltipTextLayer),this._currentStep=hintElement.getAttribute("data-step"),referenceLayer.className="introjs-tooltipReferenceLayer introjs-hintReference",referenceLayer.setAttribute("data-step",hintElement.getAttribute("data-step")),_setHelperLayerPosition.call(this,referenceLayer),referenceLayer.appendChild(tooltipLayer),document.body.appendChild(referenceLayer),_placeTooltip.call(this,hintElement,tooltipLayer,arrowLayer,null,!0)}}function _getOffset(element){var body=document.body,docEl=document.documentElement,scrollTop=window.pageYOffset||docEl.scrollTop||body.scrollTop,scrollLeft=window.pageXOffset||docEl.scrollLeft||body.scrollLeft,x=element.getBoundingClientRect();return{top:x.top+scrollTop,width:x.width,height:x.height,left:x.left+scrollLeft}}function _getScrollParent(element){var style=window.getComputedStyle(element),excludeStaticParent="absolute"===style.position,overflowRegex=/(auto|scroll)/;if("fixed"===style.position)return document.body;for(var parent=element;parent=parent.parentElement;)if(style=window.getComputedStyle(parent),(!excludeStaticParent||"static"!==style.position)&&overflowRegex.test(style.overflow+style.overflowY+style.overflowX))return parent;return document.body}function _scrollParentToElement(parent,element){parent.scrollTop=element.offsetTop-parent.offsetTop}function _getProgress(){return parseInt(this._currentStep+1,10)/this._introItems.length*100}function _mergeOptions(obj1,obj2){var attrname,obj3={};for(attrname in obj1)obj3[attrname]=obj1[attrname];for(attrname in obj2)obj3[attrname]=obj2[attrname];return obj3}var _stamp=function(){var keys={};return function(obj,key){return key=key||"introjs-stamp",keys[key]=keys[key]||0,void 0===obj[key]&&(obj[key]=keys[key]++),obj[key]}}(),DOMEvent=function(){function DOMEvent(){var events_key="introjs_event";this._id=function(obj,type,listener,context){return type+_stamp(listener)+(context?"_"+_stamp(context):"")},this.on=function(obj,type,listener,context,useCapture){var id=this._id.apply(this,arguments),handler=function(e){return listener.call(context||obj,e||window.event)};"addEventListener"in obj?obj.addEventListener(type,handler,useCapture):"attachEvent"in obj&&obj.attachEvent("on"+type,handler),obj[events_key]=obj[events_key]||{},obj[events_key][id]=handler},this.off=function(obj,type,listener,context,useCapture){var id=this._id.apply(this,arguments),handler=obj[events_key]&&obj[events_key][id];"removeEventListener"in obj?obj.removeEventListener(type,handler,useCapture):"detachEvent"in obj&&obj.detachEvent("on"+type,handler),obj[events_key][id]=null}}return new DOMEvent}(),introJs=function(targetElm){var instance;if("object"==typeof targetElm)instance=new IntroJs(targetElm);else if("string"==typeof targetElm){var targetElement=document.querySelector(targetElm);if(!targetElement)throw new Error("There is no element with given selector.");instance=new IntroJs(targetElement)}else instance=new IntroJs(document.body);return introJs.instances[_stamp(instance,"introjs-instance")]=instance,instance};return introJs.version="2.9.0",introJs.instances={},introJs.fn=IntroJs.prototype={clone:function(){return new IntroJs(this)},setOption:function(option,value){return this._options[option]=value,this},setOptions:function(options){return this._options=_mergeOptions(this._options,options),this},start:function(group){return _introForElement.call(this,this._targetElement,group),this},goToStep:function(step){return _goToStep.call(this,step),this},addStep:function(options){return this._options.steps||(this._options.steps=[]),this._options.steps.push(options),this},addSteps:function(steps){if(steps.length){for(var index=0;index<steps.length;index++)this.addStep(steps[index]);return this}},goToStepNumber:function(step){return _goToStepNumber.call(this,step),this},nextStep:function(){return _nextStep.call(this),this},previousStep:function(){return _previousStep.call(this),this},exit:function(force){return _exitIntro.call(this,this._targetElement,force),this},refresh:function(){return _refresh.call(this),this},onbeforechange:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onbeforechange was not a function");return this._introBeforeChangeCallback=providedCallback,this},onchange:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onchange was not a function.");return this._introChangeCallback=providedCallback,this},onafterchange:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onafterchange was not a function");return this._introAfterChangeCallback=providedCallback,this},oncomplete:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for oncomplete was not a function.");return this._introCompleteCallback=providedCallback,this},onhintsadded:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onhintsadded was not a function.");return this._hintsAddedCallback=providedCallback,this},onhintclick:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onhintclick was not a function.");return this._hintClickCallback=providedCallback,this},onhintclose:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onhintclose was not a function.");return this._hintCloseCallback=providedCallback,this},onexit:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onexit was not a function.");return this._introExitCallback=providedCallback,this},onskip:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onskip was not a function.");return this._introSkipCallback=providedCallback,this},onbeforeexit:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onbeforeexit was not a function.");return this._introBeforeExitCallback=providedCallback,this},addHints:function(){return _populateHints.call(this,this._targetElement),this},hideHint:function(stepId){return _hideHint.call(this,stepId),this},hideHints:function(){return _hideHints.call(this),this},showHint:function(stepId){return _showHint.call(this,stepId),this},showHints:function(){return _showHints.call(this),this},removeHints:function(){return _removeHints.call(this),this},removeHint:function(stepId){return _removeHint.call(this,stepId),this},showHintDialog:function(stepId){return _showHintDialog.call(this,stepId),this}},introJs})},443:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(2)],void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(MailPoet){function eventHandler(){return confirm(MailPoet.I18n.t("reinstallConfirmation"))&&(MailPoet.trackEvent("User has reinstalled MailPoet via Settings",{"MailPoet Free version":window.mailpoet_version}),MailPoet.Modal.loading(!0),MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"setup",action:"reset"}).always(function(){MailPoet.Modal.loading(!1)}).done(function(){window.location="admin.php?page=mailpoet-newsletters"}).fail(function(response){response.errors.length>0&&MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})),!1}var element;(element=document.getElementById("mailpoet_reinstall"))&&element.addEventListener("click",eventHandler,!1)}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},444:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(18),__webpack_require__(4),__webpack_require__(5),__webpack_require__(2),__webpack_require__(175),__webpack_require__(445),__webpack_require__(446),__webpack_require__(0)],void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(Backbone,_,jQuery,MailPoet,Handlebars,Papa,AsyncQueue,Moment){jQuery("#mailpoet_subscribers_import").length&&jQuery(document).ready(function(){function showCurrentStep(){MailPoet.Notice.hide(),MailPoet.Modal.loading(!1),jQuery('#mailpoet_subscribers_import > div[id^="step"]').hide(),jQuery(location.hash).show()}var router;jQuery('input[name="select_method"]').attr("checked",!1),router=new(Backbone.Router.extend({routes:{"":"home",step1:"step1",step2:"step2",step3:"step3"},home:function(){this.navigate("step1",{trigger:!0})}})),router.on("route:step1",function(){function toggleNextStepButton(element,condition){if("on"===condition)return void element.closest("table a").removeClass("button-disabled");element.closest("table a").addClass("button-disabled")}function parseCSV(isFile){var processedSubscribers=[],parsedEmails=[],duplicateEmails=[],invalidEmails=[],emailColumnPosition=null,columnCount=null,isHeaderFound=!1,detectAndCleanupEmail=function(emailString){var test,email=jQuery("<div />").html(emailString).text();return email=email.toLowerCase().replace(/^["';.,\s]+|[^\x20-\x7E]+$|["';.,_\s]+$/g,"").replace(/\s+|%\d+|,+/g,""),test=/<(.*?)>/.exec(email),test&&(email=test[1].trim()),test=/mailto:(?:\s+)?(.*)/.exec(email),test&&(email=test[1].trim()),!!window.mailpoet_email_regex.test(email)&&email};return{skipEmptyLines:!0,delimiter:"",newline:"",comments:!1,error:function(){MailPoet.Notice.hide(),MailPoet.Notice.error(MailPoet.I18n.t("dataProcessingError"))},complete:function(CSV){var email,emailAddress,rowData,rowColumnCount,errorNotice;Object.keys(CSV.data).forEach(function(rowCount){rowData=CSV.data[rowCount].map(function(el){return el.trim()}),rowColumnCount=rowData.length,null===columnCount&&(columnCount=rowColumnCount),rowColumnCount===columnCount&&(null===emailColumnPosition?(Object.keys(rowData).forEach(function(column){emailAddress=detectAndCleanupEmail(rowData[column]),null===emailColumnPosition&&window.mailpoet_email_regex.test(emailAddress)&&(emailColumnPosition=column,parsedEmails[emailAddress]=!0,rowData[column]=emailAddress,processedSubscribers[emailAddress]=rowData)}),null===emailColumnPosition&&0===parseInt(rowCount,10)&&(isHeaderFound=!0,processedSubscribers[0]=rowData)):""!==rowData[emailColumnPosition]&&(email=detectAndCleanupEmail(rowData[emailColumnPosition]),_.has(parsedEmails,email)?duplicateEmails.push(email):window.mailpoet_email_regex.test(email)?(parsedEmails[email]=!0,rowData[emailColumnPosition]=email,processedSubscribers[email]=rowData):invalidEmails.push(rowData[emailColumnPosition])))}),processedSubscribers=_.values(processedSubscribers),processedSubscribers&&(isHeaderFound&&processedSubscribers.length>=2||!isHeaderFound&&processedSubscribers.length>=1)?(window.importData.step1={header:window.mailpoet_email_regex.test(processedSubscribers[0][emailColumnPosition])?null:processedSubscribers.shift(),subscribers:processedSubscribers,subscribersCount:processedSubscribers.length,duplicate:duplicateEmails,invalid:invalidEmails},MailPoet.trackEvent("Subscribers import started",{source:isFile?"file upload":"pasted data","MailPoet Free version":window.mailpoet_version}),router.navigate("step2",{trigger:!0})):(MailPoet.Modal.loading(!1),errorNotice=MailPoet.I18n.t("noValidRecords"),errorNotice=errorNotice.replace("[link]",MailPoet.I18n.t("csvKBLink")),errorNotice=errorNotice.replace("[/link]","</a>"),MailPoet.Notice.error(errorNotice))}}}function displayMailChimpLists(data){var listSelectElement=mailChimpListsContainerElement.find("select");listSelectElement.data("select2")?(listSelectElement.select2("data",data),listSelectElement.trigger("change")):listSelectElement.select2({data:data,width:"20em",templateResult:function(item){return item.name},templateSelection:function(item){return item.name}}).change(function(){null!==jQuery(this).val()?toggleNextStepButton(mailChimpProcessButtonElement,"on"):toggleNextStepButton(mailChimpProcessButtonElement,"off")}).trigger("change"),mailChimpListsContainerElement.show()}var methodProcessContainerTemplate,currentStepE,methodSelectionElement,pasteInputElement,pasteInputPlaceholderElement,pasteProcessButtonElement,mailChimpKeyInputElement,mailChimpKeyVerifyButtonElement,mailChimpListsContainerElement,mailChimpProcessButtonElement,uploadElement,uploadProcessButtonElement;if(window.mailpoetColumns=jQuery.map(window.mailpoetColumns,function(column){var col=column;return col.validation_rule=!1,col}),void 0!==window.importData.step1)return void showCurrentStep();methodProcessContainerTemplate=Handlebars.compile(jQuery("#method_process_template").html()),jQuery(".mailpoet_method_process").html(methodProcessContainerTemplate()),currentStepE=jQuery(location.hash),methodSelectionElement=jQuery("#select_method"),pasteInputElement=jQuery("#paste_input"),pasteInputPlaceholderElement=pasteInputElement.data("placeholder").replace(/\\n/g,"\n"),pasteProcessButtonElement=jQuery("#method_paste > div.mailpoet_method_process").find("a.mailpoet_process"),mailChimpKeyInputElement=jQuery("#mailchimp_key"),mailChimpKeyVerifyButtonElement=jQuery("#mailchimp_key_verify"),mailChimpListsContainerElement=jQuery("#mailchimp_lists"),mailChimpProcessButtonElement=jQuery("#method_mailchimp > div.mailpoet_method_process").find("a.mailpoet_process"),uploadElement=jQuery("#file_local"),uploadProcessButtonElement=jQuery("#method_file > div.mailpoet_method_process").find("a.mailpoet_process"),methodSelectionElement.change(function(){var availableMethods=jQuery(':radio[name="select_method"]'),selectedMethod=availableMethods.index(availableMethods.filter(":checked"));MailPoet.Notice.hide(),currentStepE.find(".inside").children('div[id^="method_"]').hide(),currentStepE.find(".inside").children('div[id^="method_"]:eq('+selectedMethod+")").show().find("table").show()}),showCurrentStep(),pasteInputElement.attr("value",pasteInputPlaceholderElement).css("color","#999").focus(function(){jQuery(this).val()===pasteInputPlaceholderElement&&jQuery(this).attr("value","").css("color","#222")}).blur(function(){""===jQuery(this).val()&&jQuery(this).attr("value",pasteInputPlaceholderElement).css("color","#999")}).keyup(function(){toggleNextStepButton(pasteProcessButtonElement,""!==this.value.trim()?"on":"off")}),pasteProcessButtonElement.click(function(){var pasteSize=encodeURI(pasteInputElement.val()).split(/%..|./).length-1;if(MailPoet.Notice.hide(),pasteSize>window.maxPostSizeBytes)return void MailPoet.Notice.error(MailPoet.I18n.t("maxPostSizeNotice"));MailPoet.Modal.loading(!0),setTimeout(function(){Papa.parse(pasteInputElement.val(),parseCSV(!1))},10)}),uploadElement.change(function(){var ext=this.value.match(/[^.]+$/);MailPoet.Notice.hide(),null!==ext&&"csv"===ext[0].toLowerCase()||(this.value="",MailPoet.Notice.error(MailPoet.I18n.t("wrongFileFormat"))),toggleNextStepButton(uploadProcessButtonElement,""!==this.value.trim()?"on":"off")}),uploadProcessButtonElement.click(function(){""!==uploadElement.val().trim()&&(MailPoet.Modal.loading(!0),setTimeout(function(){uploadElement.parse({config:parseCSV(!0)})},10))}),mailChimpKeyInputElement.keyup(function(){""!==this.value.trim()&&/[a-zA-Z0-9]{32}-/.exec(this.value.trim())||(mailChimpListsContainerElement.hide(),jQuery(".mailpoet_mailchimp-key-status").html("").removeClass("mailpoet_mailchimp-ok mailpoet_mailchimp-error"),toggleNextStepButton(mailChimpProcessButtonElement,"off"))}),mailChimpKeyVerifyButtonElement.click(function(){MailPoet.Modal.loading(!0),MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"getMailChimpLists",data:{api_key:mailChimpKeyInputElement.val()}}).always(function(){MailPoet.Modal.loading(!1)}).done(function(response){jQuery(".mailpoet_mailchimp-key-status").html("").removeClass().addClass("mailpoet_mailchimp-key-status mailpoet_mailchimp-ok"),0===response.data.length?(jQuery(".mailpoet_mailchimp-key-status").html(MailPoet.I18n.t("noMailChimpLists")),mailChimpListsContainerElement.hide(),toggleNextStepButton(mailChimpProcessButtonElement,"off")):displayMailChimpLists(response.data)}).fail(function(response){response.errors.length>0&&MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}),mailChimpProcessButtonElement.click(function(){mailChimpProcessButtonElement.closest("table a").hasClass("button-disabled")||(MailPoet.Modal.loading(!0),MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"getMailChimpSubscribers",data:{api_key:mailChimpKeyInputElement.val(),lists:mailChimpListsContainerElement.find("select").val()}}).always(function(){MailPoet.Modal.loading(!1)}).done(function(response){window.importData.step1=response.data,MailPoet.trackEvent("Subscribers import started",{source:"MailChimp","MailPoet Free version":window.mailpoet_version}),router.navigate("step2",{trigger:!0})}).fail(function(response){response.errors.length>0&&MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})}))})}),router.on("route:step2",function(){function toggleNextStepButton(condition){if("on"===condition)return void nextStepButton.removeClass("button-disabled");nextStepButton.addClass("button-disabled")}function enableSegmentSelection(segments){segmentSelectElement.data("select2")&&(segmentSelectElement.html("").select2("destroy"),toggleNextStepButton("off")),segmentSelectElement.select2({data:segments,width:"20em",templateResult:function(item){var i=item;return i.subscriberCount=parseInt(i.subscriberCount,10),i.name+" ("+i.subscriberCount.toLocaleString()+")"},templateSelection:function(item){var i=item;return i.subscriberCount=parseInt(i.subscriberCount,10),i.name+" ("+i.subscriberCount.toLocaleString()+")"}}).change(function(){var segmentSelectionNotice=jQuery('[data-id="notice_segmentSelection"]');this.value?(jQuery('[data-id="notice_segmentSelection"]').remove(),jQuery(".mailpoet_notice.error:visible").length||toggleNextStepButton("on")):(segmentSelectionNotice.length||MailPoet.Notice.error(MailPoet.I18n.t("segmentSelectionRequired"),{static:!0,scroll:!0,id:"notice_segmentSelection",hideClose:!0}),toggleNextStepButton("off"))})}function filterSubscribers(){var displayedColumns,subscribersClone=jQuery.extend(!0,{},subscribers),preventNextStep=!1;jQuery('[data-id="notice_invalidEmail"], [data-id="notice_invalidDate"]').remove(),displayedColumns=jQuery.map(jQuery(".mailpoet_subscribers_column_data_match"),function(element,elementIndex){var columnId=jQuery(element).data("column-id"),validationRule=jQuery(element).data("validation-rule");return jQuery(element).val(columnId).trigger("change"),{id:columnId,index:elementIndex,validationRule:validationRule,element:element}}),jQuery.map(window.mailpoetColumns,function(column){var firstRowData,validationRule,testedFormat,allowedDateFormats,matchedColumn=_.find(displayedColumns,function(data){return data.id===column.id});"email"===column.id&&(window.mailpoet_email_regex.test(subscribersClone.subscribers[0][matchedColumn.index])?MailPoet.Notice.hide("invalidEmail"):(preventNextStep=!0,jQuery('[data-id="notice_invalidEmail"]').length||MailPoet.Notice.error(MailPoet.I18n.t("columnContainsInvalidElement"),{static:!0,scroll:!0,hideClose:!0,id:"invalidEmail"}))),"date"===column.type&&matchedColumn&&(allowedDateFormats=[Moment.ISO_8601,"YYYY/MM/DD","MM/DD/YYYY","DD/MM/YYYY","YYYY/MM/DD","YYYY/DD/MM","MM/YYYY","YYYY/MM","YYYY"],firstRowData=subscribersClone.subscribers[0][matchedColumn.index],validationRule=!1,""===firstRowData.trim()?(subscribersClone.subscribers[0][matchedColumn.index]='<span class="mailpoet_data_match mailpoet_import_error" title="'+MailPoet.I18n.t("noDateFieldMatch")+'">'+MailPoet.I18n.t("emptyFirstRowDate")+"</span> ",preventNextStep=!0):Object.keys(allowedDateFormats).forEach(function(format){if(testedFormat=allowedDateFormats[format],Moment(firstRowData,testedFormat,!0).isValid())return validationRule="function"==typeof testedFormat?"datetime":testedFormat,void jQuery(matchedColumn.element).data("validation-rule",validationRule);"datetime"===validationRule&&(validationRule=Moment.ISO_8601)}),jQuery.map(subscribersClone.subscribers,function(dataSubscribers,index){var data=dataSubscribers,rowData=data[matchedColumn.index],date=Moment(rowData,testedFormat,!0);index!==fillerPosition&&""!==rowData.trim()&&(date.isValid()?data[matchedColumn.index]=new Handlebars.SafeString(Handlebars.Utils.escapeExpression(data[matchedColumn.index])+'<span class="mailpoet_data_match" title="'+MailPoet.I18n.t("verifyDateMatch")+'">'+MailPoet.Date.format(date)+"</span> "):(data[matchedColumn.index]=new Handlebars.SafeString(Handlebars.Utils.escapeExpression(data[matchedColumn.index])+'<span class="mailpoet_data_match mailpoet_import_error" title="'+MailPoet.I18n.t("noDateFieldMatch")+'">'+new Handlebars.SafeString(MailPoet.I18n.t("dateMatchError"))+"</span> "),preventNextStep=!0))}),preventNextStep&&!jQuery(".mailpoet_invalidDate").length&&MailPoet.Notice.error(MailPoet.I18n.t("columnContainsInvalidDate"),{static:!0,scroll:!0,hideClose:!0,id:"invalidDate"}))}),jQuery("#subscribers_data > table > tbody").html(subscribersDataTemplatePartial(subscribersClone)),preventNextStep?toggleNextStepButton("off"):!jQuery(".mailpoet_notice.error:visible").length&&segmentSelectElement.val()&&toggleNextStepButton("on")}var nextStepButton,previousStepButton,subscribers,subscribersDataTemplate,subscribersDataTemplatePartial,subscribersDataParseResultsTemplate,segmentSelectElement,maxRowsToShow,filler,fillerArray,fillerPosition,importResults,duplicates;if(void 0===window.importData.step1)return void router.navigate("step1",{trigger:!0});nextStepButton=jQuery("#step2_process"),previousStepButton=jQuery("#return_to_step1"),subscribers=jQuery.extend(!0,{},window.importData.step1),subscribersDataTemplate=Handlebars.compile(jQuery("#subscribers_data_template").html()),subscribersDataTemplatePartial=Handlebars.compile(jQuery("#subscribers_data_template_partial").html()),subscribersDataParseResultsTemplate=Handlebars.compile(jQuery("#subscribers_data_parse_results_template").html()),segmentSelectElement=jQuery("#mailpoet_segments_select"),maxRowsToShow=10,filler=". . .",fillerArray=Array.apply(null,new Array(subscribers.subscribers[0].length)).map(String.prototype.valueOf,filler),showCurrentStep(),jQuery("#subscribers_data_parse_results:visible").html(""),jQuery("#subscribers_data_import_results:visible").hide(),(subscribers.invalid.length||subscribers.duplicate.length)&&(duplicates={},subscribers.duplicate.forEach(function(subscriberEmail){duplicates[subscriberEmail]=(duplicates[subscriberEmail]||0)+1}),subscribers.duplicate=[],Object.keys(duplicates).forEach(function(email){duplicates[email]>1?subscribers.duplicate.push(email+" (x"+duplicates[email]+")"):subscribers.duplicate.push(email)}),importResults={notice:MailPoet.I18n.t("importNoticeSkipped").replace("%1$s","<strong>"+(subscribers.invalid.length+subscribers.duplicate.length)+"</strong>"),invalid:subscribers.invalid.length?MailPoet.I18n.t("importNoticeInvalid").replace("%1$s","<strong>"+subscribers.invalid.length.toLocaleString()+"</strong>").replace("%2$s",subscribers.invalid.join(", ")):null,duplicate:subscribers.duplicate.length?MailPoet.I18n.t("importNoticeDuplicate").replace("%1$s","<strong>"+subscribers.duplicate.length+"</strong>").replace("%2$s",subscribers.duplicate.join(", ")):null},jQuery("#subscribers_data_parse_results").html(subscribersDataParseResultsTemplate(importResults))),jQuery(".mailpoet_subscribers_data_parse_results_details_show").click(function(){var details=jQuery(".mailpoet_subscribers_data_parse_results_details");jQuery(details).toggle(),this.text=jQuery(details).is(":visible")?MailPoet.I18n.t("hideDetails"):MailPoet.I18n.t("showDetails")}),window.mailpoetSegments.length?jQuery(".mailpoet_segments").show():jQuery(".mailpoet_no_segments").show(),jQuery(".mailpoet_create_segment").click(function(){MailPoet.Modal.popup({title:MailPoet.I18n.t("addNewList"),template:jQuery("#new_segment_template").html()}),jQuery("#new_segment_name").keypress(function(e){13===e.which&&jQuery("#new_segment_process").click()}),jQuery("#new_segment_process").click(function(){var segmentName=jQuery("#new_segment_name").val().trim(),segmentDescription=jQuery("#new_segment_description").val().trim();MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"addSegment",data:{name:segmentName,description:segmentDescription}}).done(function(response){var selectedValues;window.mailpoetSegments.push({id:response.data.id,name:response.data.name,subscriberCount:0}),selectedValues=segmentSelectElement.val(),null===selectedValues?selectedValues=[response.data.id]:selectedValues.push(response.data.id),enableSegmentSelection(window.mailpoetSegments),segmentSelectElement.val(selectedValues).trigger("change"),jQuery(".mailpoet_segments:hidden").show(),jQuery(".mailpoet_no_segments:visible").hide(),MailPoet.Modal.close()}).fail(function(response){response.errors.length>0&&(MailPoet.Notice.hide(),MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{positionAfter:"#new_segment_name"}))})}),jQuery("#new_segment_cancel").click(function(){MailPoet.Modal.close()})}),Handlebars.registerPartial("subscribers_data_template_partial",subscribersDataTemplatePartial),Handlebars.registerHelper("show_and_match_columns",function(helperSubscribers,options){var columnData,columnId,headerName,headerNameMatch,displayedColumns=[],displayedColumnsIds=[];return Object.keys(helperSubscribers.subscribers[0]).forEach(function(i){columnData=helperSubscribers.subscribers[0][i],columnId="ignore",columnData%1!=0&&window.mailpoet_email_regex.test(columnData)?columnId="email":helperSubscribers.header&&(headerName=helperSubscribers.header[i],headerNameMatch=window.mailpoetColumns.map(function(el){return el.name}).indexOf(headerName),-1!==headerNameMatch?columnId=window.mailpoetColumns[headerNameMatch].id:headerName&&(/first|first name|given name/i.test(headerName)?columnId="first_name":/last|last name/i.test(headerName)&&(columnId="last_name"))),columnId="ignore"!==columnId&&-1===displayedColumnsIds.indexOf(columnId)?columnId:"ignore",displayedColumns[i]={column_id:columnId},displayedColumnsIds.push(columnId)}),options.fn(displayedColumns)}),Handlebars.registerHelper("sanitize_data",function(data){return data instanceof Handlebars.SafeString?data:new Handlebars.SafeString(Handlebars.Utils.escapeExpression(data))}),Handlebars.registerHelper("calculate_index",function(rawIndex){var index=parseInt(rawIndex,10);return index===maxRowsToShow&&subscribers.subscribersCount>maxRowsToShow+1?(fillerPosition=index,filler):index===subscribers.subscribers.length-1?subscribers.subscribersCount.toLocaleString():index+1}),subscribers.subscribersCount>maxRowsToShow+1&&subscribers.subscribers.splice(maxRowsToShow,subscribers.subscribersCount-(maxRowsToShow+1),fillerArray),jQuery("#subscribers_data > table").html(subscribersDataTemplate(subscribers)),jQuery("select.mailpoet_subscribers_column_data_match").select2({data:window.mailpoetColumnsSelect2,width:"15em",templateResult:function(item){return item.name},templateSelection:function(item){return item.name}}).on("select2:selecting",function(selectEvent){var selectElement=this,selectedOptionId=selectEvent.params.args.data.id;"create"===selectedOptionId?(selectEvent.preventDefault(),jQuery(selectElement).select2("close"),MailPoet.Modal.popup({title:MailPoet.I18n.t("addNewField"),template:jQuery("#form_template_field_form").html()}),jQuery("#form_field_new").parsley().on("form:submit",function(){var data=jQuery(this.$element).mailpoetSerializeObject();return MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:data}).done(function(response){var newColumnData={id:response.data.id,name:response.data.name,type:response.data.type,params:response.data.params,custom:!0};2===window.mailpoetColumnsSelect2.length&&window.mailpoetColumnsSelect2.push({name:MailPoet.I18n.t("userColumns"),children:[]}),window.mailpoetColumnsSelect2[2].children.push(newColumnData),window.mailpoetColumns.push(newColumnData),jQuery("select.mailpoet_subscribers_column_data_match").each(function(){jQuery(this).html("").select2("destroy").select2({data:window.mailpoetColumnsSelect2,width:"15em",templateResult:function(item){return item.name},templateSelection:function(item){return item.name}})}),jQuery(selectElement).data("column-id",newColumnData.id),jQuery(selectElement).data("validation-rule",!1),filterSubscribers(),MailPoet.Modal.close()}).fail(function(response){response.errors.length>0&&MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{positionAfter:"#field_name"})}),!1})):jQuery("select.mailpoet_subscribers_column_data_match").each(function(){var element=this,elementId=jQuery(element).val();elementId===selectedOptionId&&"ignore"!==elementId&&(confirm(MailPoet.I18n.t("selectedValueAlreadyMatched")+" "+MailPoet.I18n.t("confirmCorrespondingColumn"))?jQuery(element).data("column-id","ignore"):(selectEvent.preventDefault(),jQuery(selectElement).select2("close")))})}).on("select2:select",function(selectEvent){var selectElement=this,selectedOptionId=selectEvent.params.data.id;jQuery(selectElement).data("column-id",selectedOptionId),filterSubscribers()}),previousStepButton.off().on("click",function(){router.navigate("step1",{trigger:!0})}),nextStepButton.off().on("click",function(){var clickSubscribers,splitSubscribers,columns={},queue=new jQuery.AsyncQueue,batchNumber=0,timestamp=Date.now()/1e3,clickImportResults={created:0,updated:0,errors:[],segments:[]};jQuery(this).hasClass("button-disabled")||(MailPoet.Modal.loading(!0),splitSubscribers=function(localSubscribers,size){return localSubscribers.reduce(function(res,item,index){return index%size==0&&res.push([]),res[res.length-1].push(item),res},[])},clickSubscribers=splitSubscribers(window.importData.step1.subscribers,2e3),_.each(jQuery("select.mailpoet_subscribers_column_data_match"),function(column,columnIndex){var columnId=jQuery(column).data("column-id"),validationRule=jQuery(column).data("validation-rule");"ignore"!==columnId&&(columns[columnId]={index:columnIndex,validation_rule:validationRule})}),_.each(clickSubscribers,function(){queue.add(function(addQueue){addQueue.pause(),MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"processImport",data:JSON.stringify({columns:columns,subscribers:clickSubscribers[batchNumber],timestamp:timestamp,segments:segmentSelectElement.val(),updateSubscribers:"yes"===jQuery(':radio[name="subscriber_update_option"]:checked').val()})}).done(function(response){clickImportResults.created+=response.data.created,clickImportResults.updated+=response.data.updated,clickImportResults.segments=response.data.segments,clickImportResults.added_to_segment_with_welcome_notification=response.data.added_to_segment_with_welcome_notification,addQueue.run()}).fail(function(response){MailPoet.Modal.loading(!1),response.errors.length>0&&MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})}),batchNumber+=1})}),queue.run(),queue.onComplete(function(){MailPoet.Modal.loading(!1),clickImportResults.errors.length>0&&!clickImportResults.updated&&!clickImportResults.created?MailPoet.Notice.error(_.flatten(clickImportResults.errors)):(window.mailpoetSegments=clickImportResults.segments,clickImportResults.segments=_.map(segmentSelectElement.select2("data"),function(data){return data.name}),window.importData.step2=clickImportResults,enableSegmentSelection(window.mailpoetSegments),router.navigate("step3",{trigger:!0}))}))}),filterSubscribers(),enableSegmentSelection(window.mailpoetSegments)}),router.on("route:step3",function(){var subscribersDataImportResultsTemplate,exportMenuElement,importResults;if(void 0===window.importData.step2)return void router.navigate("step2",{trigger:!0});showCurrentStep(),window.importData.step2.errors.length>0&&MailPoet.Notice.error(_.flatten(window.importData.step2.errors)),MailPoet.trackEvent("Subscribers import finished",{"Subscribers created":window.importData.step2.created,"Subscribers updated":window.importData.step2.updated,"MailPoet Free version":window.mailpoet_version}),subscribersDataImportResultsTemplate=Handlebars.compile(jQuery("#subscribers_data_import_results_template").html()),exportMenuElement=jQuery("span.mailpoet_export"),importResults={created:!!window.importData.step2.created&&MailPoet.I18n.t("subscribersCreated").replace("%1$s","<strong>"+window.importData.step2.created.toLocaleString()+"</strong>").replace("%2$s",'"'+window.importData.step2.segments.join('", "')+'"'),updated:!!window.importData.step2.updated&&MailPoet.I18n.t("subscribersUpdated").replace("%1$s","<strong>"+window.importData.step2.updated.toLocaleString()+"</strong>").replace("%2$s",'"'+window.importData.step2.segments.join('", "')+'"'),no_action:!window.importData.step2.created&&!window.importData.step2.updated,added_to_segment_with_welcome_notification:window.importData.step2.added_to_segment_with_welcome_notification},jQuery("#subscribers_data_import_results").html(subscribersDataImportResultsTemplate(importResults)).show(),jQuery("a.mailpoet_import_again").off().click(function(){jQuery("#subscribers_data_import_results").hide(),router.navigate("step1",{trigger:!0})}),jQuery("a.mailpoet_view_subscribers").off().click(function(){window.location.href="admin.php?page=mailpoet-subscribers"}),importResults.created&&exportMenuElement.not(":visible")&&exportMenuElement.show(),window.importData.step2=void 0}),Backbone.History.started||Backbone.history.start()})}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},445:function(module,exports){/*!
|
2 |
-
Papa Parse
|
3 |
-
v4.1.1
|
4 |
-
https://github.com/mholt/PapaParse
|
5 |
-
*/
|
6 |
-
!function(e){"use strict";function t(t,r){if(r=r||{},r.worker&&w.WORKERS_SUPPORTED){var n=h();return n.userStep=r.step,n.userChunk=r.chunk,n.userComplete=r.complete,n.userError=r.error,r.step=m(r.step),r.chunk=m(r.chunk),r.complete=m(r.complete),r.error=m(r.error),delete r.worker,void n.postMessage({input:t,config:r,workerId:n.id})}var o=null;return"string"==typeof t?o=r.download?new i(r):new a(r):(e.File&&t instanceof File||t instanceof Object)&&(o=new s(r)),o.stream(t)}function r(e,t){function n(e){if("object"!=typeof e)return[];var t=[];for(var r in e)t.push(r);return t}function i(e,t){var r="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var n=e instanceof Array&&e.length>0,i=!(t[0]instanceof Array);if(n){for(var a=0;a<e.length;a++)a>0&&(r+=u),r+=s(e[a],a);t.length>0&&(r+=f)}for(var o=0;o<t.length;o++){for(var h=n?e.length:t[o].length,d=0;h>d;d++){d>0&&(r+=u);var c=n&&i?e[d]:d;r+=s(t[o][c],d)}o<t.length-1&&(r+=f)}return r}function s(e,t){return void 0===e||null===e?"":(e=e.toString().replace(/"/g,'""'),"boolean"==typeof o&&o||o instanceof Array&&o[t]||a(e,w.BAD_DELIMITERS)||e.indexOf(u)>-1||" "==e.charAt(0)||" "==e.charAt(e.length-1)?'"'+e+'"':e)}function a(e,t){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>-1)return!0;return!1}var o=!1,u=",",f="\r\n";if(function(){"object"==typeof t&&("string"==typeof t.delimiter&&1==t.delimiter.length&&-1==w.BAD_DELIMITERS.indexOf(t.delimiter)&&(u=t.delimiter),("boolean"==typeof t.quotes||t.quotes instanceof Array)&&(o=t.quotes),"string"==typeof t.newline&&(f=t.newline))}(),"string"==typeof e&&(e=JSON.parse(e)),e instanceof Array){if(!e.length||e[0]instanceof Array)return i(null,e);if("object"==typeof e[0])return i(n(e[0]),e)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),e.data instanceof Array&&(e.fields||(e.fields=e.data[0]instanceof Array?e.fields:n(e.data[0])),e.data[0]instanceof Array||"object"==typeof e.data[0]||(e.data=[e.data])),i(e.fields||[],e.data||[]);throw"exception: Unable to serialize unrecognized input"}function n(t){function r(e){var t=_(e);t.chunkSize=parseInt(t.chunkSize),this._handle=new o(t),this._handle.streamer=this,this._config=t}this._handle=null,this._paused=!1,this._finished=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this._completeResults={data:[],errors:[],meta:{}},r.call(this,t),this.parseChunk=function(t){var r=this._partialLine+t;this._partialLine="";var n=this._handle.parse(r,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var i=n.meta.cursor;this._finished||(this._partialLine=r.substring(i-this._baseIndex),this._baseIndex=i),n&&n.data&&(this._rowCount+=n.data.length);var s=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(k)e.postMessage({results:n,workerId:w.WORKER_ID,finished:s});else if(m(this._config.chunk)){if(this._config.chunk(n,this._handle),this._paused)return;n=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(n.data),this._completeResults.errors=this._completeResults.errors.concat(n.errors),this._completeResults.meta=n.meta),!s||!m(this._config.complete)||n&&n.meta.aborted||this._config.complete(this._completeResults),s||n&&n.meta.paused||this._nextChunk(),n}},this._sendError=function(t){m(this._config.error)?this._config.error(t):k&&this._config.error&&e.postMessage({workerId:w.WORKER_ID,error:t,finished:!1})}}function i(e){function t(e){var t=e.getResponseHeader("Content-Range");return parseInt(t.substr(t.lastIndexOf("/")+1))}e=e||{},e.chunkSize||(e.chunkSize=w.RemoteChunkSize),n.call(this,e);var r;this._nextChunk=k?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)return void this._chunkLoaded();if(r=new XMLHttpRequest,k||(r.onload=g(this._chunkLoaded,this),r.onerror=g(this._chunkError,this)),r.open("GET",this._input,!k),this._config.chunkSize){var e=this._start+this._config.chunkSize-1;r.setRequestHeader("Range","bytes="+this._start+"-"+e),r.setRequestHeader("If-None-Match","webkit-no-cache")}try{r.send()}catch(t){this._chunkError(t.message)}k&&0==r.status?this._chunkError():this._start+=this._config.chunkSize},this._chunkLoaded=function(){if(4==r.readyState){if(r.status<200||r.status>=400)return void this._chunkError();this._finished=!this._config.chunkSize||this._start>t(r),this.parseChunk(r.responseText)}},this._chunkError=function(e){var t=r.statusText||e;this._sendError(t)}}function s(e){e=e||{},e.chunkSize||(e.chunkSize=w.LocalChunkSize),n.call(this,e);var t,r,i="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,r=e.slice||e.webkitSlice||e.mozSlice,i?(t=new FileReader,t.onload=g(this._chunkLoaded,this),t.onerror=g(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input;if(this._config.chunkSize){var n=Math.min(this._start+this._config.chunkSize,this._input.size);e=r.call(e,this._start,n)}var s=t.readAsText(e,this._config.encoding);i||this._chunkLoaded({target:{result:s}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function a(e){e=e||{},n.call(this,e);var t,r;this.stream=function(e){return t=e,r=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e=this._config.chunkSize,t=e?r.substr(0,e):r;return r=e?r.substr(e):"",this._finished=!r,this.parseChunk(t)}}}function o(e){function t(){if(b&&c&&(f("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+w.DefaultDelimiter+"'"),c=!1),e.skipEmptyLines)for(var t=0;t<b.data.length;t++)1==b.data[t].length&&""==b.data[t][0]&&b.data.splice(t--,1);return r()&&n(),i()}function r(){return e.header&&0==y.length}function n(){if(b){for(var e=0;r()&&e<b.data.length;e++)for(var t=0;t<b.data[e].length;t++)y.push(b.data[e][t]);b.data.splice(0,1)}}function i(){if(!b||!e.header&&!e.dynamicTyping)return b;for(var t=0;t<b.data.length;t++){for(var r={},n=0;n<b.data[t].length;n++){if(e.dynamicTyping){var i=b.data[t][n];b.data[t][n]="true"==i||"TRUE"==i||"false"!=i&&"FALSE"!=i&&o(i)}e.header&&(n>=y.length?(r.__parsed_extra||(r.__parsed_extra=[]),r.__parsed_extra.push(b.data[t][n])):r[y[n]]=b.data[t][n])}e.header&&(b.data[t]=r,n>y.length?f("FieldMismatch","TooManyFields","Too many fields: expected "+y.length+" fields but parsed "+n,t):n<y.length&&f("FieldMismatch","TooFewFields","Too few fields: expected "+y.length+" fields but parsed "+n,t))}return e.header&&b.meta&&(b.meta.fields=y),b}function s(t){for(var r,n,i,s=[",","\t","|",";",w.RECORD_SEP,w.UNIT_SEP],a=0;a<s.length;a++){var o=s[a],f=0,h=0;i=void 0;for(var d=new u({delimiter:o,preview:10}).parse(t),c=0;c<d.data.length;c++){var l=d.data[c].length;h+=l,void 0!==i?l>1&&(f+=Math.abs(l-i),i=l):i=l}h/=d.data.length,(void 0===n||n>f)&&h>1.99&&(n=f,r=o)}return e.delimiter=r,{successful:!!r,bestDelimiter:r}}function a(e){e=e.substr(0,1048576);var t=e.split("\r");if(1==t.length)return"\n";for(var r=0,n=0;n<t.length;n++)"\n"==t[n][0]&&r++;return r>=t.length/2?"\r\n":"\r"}function o(e){return l.test(e)?parseFloat(e):e}function f(e,t,r,n){b.errors.push({type:e,code:t,message:r,row:n})}var h,d,c,l=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,p=this,g=0,v=!1,k=!1,y=[],b={data:[],errors:[],meta:{}};if(m(e.step)){var R=e.step;e.step=function(n){if(b=n,r())t();else{if(t(),0==b.data.length)return;g+=n.data.length,e.preview&&g>e.preview?d.abort():R(b,p)}}}this.parse=function(r,n,i){if(e.newline||(e.newline=a(r)),c=!1,!e.delimiter){var o=s(r);o.successful?e.delimiter=o.bestDelimiter:(c=!0,e.delimiter=w.DefaultDelimiter),b.meta.delimiter=e.delimiter}var f=_(e);return e.preview&&e.header&&f.preview++,h=r,d=new u(f),b=d.parse(h,n,i),t(),v?{meta:{paused:!0}}:b||{meta:{paused:!1}}},this.paused=function(){return v},this.pause=function(){v=!0,d.abort(),h=h.substr(d.getCharIndex())},this.resume=function(){v=!1,p.streamer.parseChunk(h)},this.aborted=function(){return k},this.abort=function(){k=!0,d.abort(),b.meta.aborted=!0,m(e.complete)&&e.complete(b),h=""}}function u(e){e=e||{};var t=e.delimiter,r=e.newline,n=e.comments,i=e.step,s=e.preview,a=e.fastMode;if(("string"!=typeof t||w.BAD_DELIMITERS.indexOf(t)>-1)&&(t=","),n===t)throw"Comment character same as delimiter";!0===n?n="#":("string"!=typeof n||w.BAD_DELIMITERS.indexOf(n)>-1)&&(n=!1),"\n"!=r&&"\r"!=r&&"\r\n"!=r&&(r="\n");var o=0,u=!1;this.parse=function(e,f,h){function d(e){b.push(e),S=o}function c(t){return h?p():(t||(t=e.substr(o)),w.push(t),o=g,d(w),y&&_(),p())}function l(t){o=t,d(w),w=[],O=e.indexOf(r,o)}function p(e){return{data:b,errors:R,meta:{delimiter:t,linebreak:r,aborted:u,truncated:!!e,cursor:S+(f||0)}}}function _(){i(p()),b=[],R=[]}if("string"!=typeof e)throw"Input must be a string";var g=e.length,m=t.length,v=r.length,k=n.length,y="function"==typeof i;o=0;var b=[],R=[],w=[],S=0;if(!e)return p();if(a||!1!==a&&-1===e.indexOf('"')){for(var E=e.split(r),C=0;C<E.length;C++){var w=E[C];if(o+=w.length,C!==E.length-1)o+=r.length;else if(h)return p();if(!n||w.substr(0,k)!=n){if(y){if(b=[],d(w.split(t)),_(),u)return p()}else d(w.split(t));if(s&&C>=s)return b=b.slice(0,s),p(!0)}}return p()}for(var x=e.indexOf(t,o),O=e.indexOf(r,o);;)if('"'!=e[o])if(n&&0===w.length&&e.substr(o,k)===n){if(-1==O)return p();o=O+v,O=e.indexOf(r,o),x=e.indexOf(t,o)}else if(-1!==x&&(O>x||-1===O))w.push(e.substring(o,x)),o=x+m,x=e.indexOf(t,o);else{if(-1===O)break;if(w.push(e.substring(o,O)),l(O+v),y&&(_(),u))return p();if(s&&b.length>=s)return p(!0)}else{var I=o;for(o++;;){var I=e.indexOf('"',I+1);if(-1===I)return h||R.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:b.length,index:o}),c();if(I===g-1){var D=e.substring(o,I).replace(/""/g,'"');return c(D)}if('"'!=e[I+1]){if(e[I+1]==t){w.push(e.substring(o,I).replace(/""/g,'"')),o=I+1+m,x=e.indexOf(t,o),O=e.indexOf(r,o);break}if(e.substr(I+1,v)===r){if(w.push(e.substring(o,I).replace(/""/g,'"')),l(I+1+v),x=e.indexOf(t,o),y&&(_(),u))return p();if(s&&b.length>=s)return p(!0);break}}else I++}}return c()},this.abort=function(){u=!0},this.getCharIndex=function(){return o}}function h(){if(!w.WORKERS_SUPPORTED)return!1;if(!y&&null===w.SCRIPT_PATH)throw new Error("Script path cannot be determined automatically when Papa Parse is loaded asynchronously. You need to set Papa.SCRIPT_PATH manually.");var t=new e.Worker(w.SCRIPT_PATH||v);return t.onmessage=d,t.id=R++,b[t.id]=t,t}function d(e){var t=e.data,r=b[t.workerId],n=!1;if(t.error)r.userError(t.error,t.file);else if(t.results&&t.results.data){var i=function(){n=!0,c(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},s={abort:i,pause:l,resume:l};if(m(r.userStep)){for(var a=0;a<t.results.data.length&&(r.userStep({data:[t.results.data[a]],errors:t.results.errors,meta:t.results.meta},s),!n);a++);delete t.results}else m(r.userChunk)&&(r.userChunk(t.results,s,t.file),delete t.results)}t.finished&&!n&&c(t.workerId,t.results)}function c(e,t){var r=b[e];m(r.userComplete)&&r.userComplete(t),r.terminate(),delete b[e]}function l(){throw"Not implemented."}function p(t){var r=t.data;if(void 0===w.WORKER_ID&&r&&(w.WORKER_ID=r.workerId),"string"==typeof r.input)e.postMessage({workerId:w.WORKER_ID,results:w.parse(r.input,r.config),finished:!0});else if(e.File&&r.input instanceof File||r.input instanceof Object){var n=w.parse(r.input,r.config);n&&e.postMessage({workerId:w.WORKER_ID,results:n,finished:!0})}}function _(e){if("object"!=typeof e)return e;var t=e instanceof Array?[]:{};for(var r in e)t[r]=_(e[r]);return t}function g(e,t){return function(){e.apply(t,arguments)}}function m(e){return"function"==typeof e}var v,k=!e.document&&!!e.postMessage,y=!1,b={},R=0,w={};if(w.parse=t,w.unparse=r,w.RECORD_SEP=String.fromCharCode(30),w.UNIT_SEP=String.fromCharCode(31),w.BYTE_ORDER_MARK="\ufeff",w.BAD_DELIMITERS=["\r","\n",'"',w.BYTE_ORDER_MARK],w.WORKERS_SUPPORTED=!!e.Worker,w.SCRIPT_PATH=null,w.LocalChunkSize=10485760,w.RemoteChunkSize=5242880,w.DefaultDelimiter=",",w.Parser=u,w.ParserHandle=o,w.NetworkStreamer=i,w.FileStreamer=s,w.StringStreamer=a,void 0!==module&&module.exports?module.exports=w:m(e.define)&&e.define.amd?e.define(function(){return w}):e.Papa=w,e.jQuery){var S=e.jQuery;S.fn.parse=function(t){function r(){if(0==a.length)return void(m(t.complete)&&t.complete());var e=a[0];if(m(t.before)){var r=t.before(e.file,e.inputElem);if("object"==typeof r){if("abort"==r.action)return void n("AbortError",e.file,e.inputElem,r.reason);if("skip"==r.action)return void i();"object"==typeof r.config&&(e.instanceConfig=S.extend(e.instanceConfig,r.config))}else if("skip"==r)return void i()}var s=e.instanceConfig.complete;e.instanceConfig.complete=function(t){m(s)&&s(t,e.file,e.inputElem),i()},w.parse(e.file,e.instanceConfig)}function n(e,r,n,i){m(t.error)&&t.error({name:e},r,n,i)}function i(){a.splice(0,1),r()}var s=t.config||{},a=[];return this.each(function(){if("INPUT"!=S(this).prop("tagName").toUpperCase()||"file"!=S(this).attr("type").toLowerCase()||!e.FileReader||!this.files||0==this.files.length)return!0;for(var r=0;r<this.files.length;r++)a.push({file:this.files[r],inputElem:this,instanceConfig:S.extend({},s)})}),r(),this}}k?e.onmessage=p:w.WORKERS_SUPPORTED&&(v=function(){var e=document.getElementsByTagName("script");return e.length?e[e.length-1].src:""}(),document.body?document.addEventListener("DOMContentLoaded",function(){y=!0},!0):y=!0),i.prototype=Object.create(n.prototype),i.prototype.constructor=i,s.prototype=Object.create(n.prototype),s.prototype.constructor=s,a.prototype=Object.create(a.prototype),a.prototype.constructor=a}("undefined"!=typeof window?window:this)},446:function(module,exports){!function($){$.AsyncQueue=function(){var failureFunc,completeFunc,lastCallbackData,_run,that=this,queue=[],paused=!1;return _run=function(){var f=queue.shift();f?(f.apply(that,[that]),!1===paused&&_run()):completeFunc&&completeFunc.apply(that)},this.onFailure=function(func){failureFunc=func},this.onComplete=function(func){completeFunc=func},this.add=function(func){return queue.push(func),this},this.storeData=function(dataObject){return lastCallbackData=dataObject,this},this.lastCallbackData=function(){return lastCallbackData},this.run=function(){paused=!1,_run()},this.pause=function(){return paused=!0,this},this.failure=function(){if(paused=!0,failureFunc){var args=[that];for(i=0;i<arguments.length;i++)args.push(arguments[i]);failureFunc.apply(that,args)}},this}}(jQuery)},447:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(4),__webpack_require__(5),__webpack_require__(2),__webpack_require__(175)],void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(_,jQuery,MailPoet,Handlebars){jQuery("#mailpoet_subscribers_export").length&&jQuery(document).ready(function(){function toggleNextStepButton(condition){"on"===condition?nextStepButton.removeClass("button-disabled"):nextStepButton.addClass("button-disabled")}var segmentsContainerElement,subscriberFieldsContainerElement,nextStepButton,renderSegmentsAndFields,subscribersExportTemplate;window.exportData.segments&&(subscribersExportTemplate=Handlebars.compile(jQuery("#mailpoet_subscribers_export_template").html()),jQuery("#mailpoet_subscribers_export > div.inside").html(subscribersExportTemplate(window.exportData)),segmentsContainerElement=jQuery("#export_lists"),subscriberFieldsContainerElement=jQuery("#export_columns"),nextStepButton=jQuery("a.mailpoet_export_process"),renderSegmentsAndFields=function(container,data){container.data("select2")&&container.html("").select2("destroy"),container.select2({data:data,width:"20em",templateResult:function(item){return item.subscriberCount>0?item.name+" ("+parseInt(item.subscriberCount,10).toLocaleString()+")":item.name},templateSelection:function(item){return item.subscriberCount>0?item.name+" ("+parseInt(item.subscriberCount,10).toLocaleString()+")":item.name}}).on("select2:selecting",function(selectEvent){var allOptions,selectElement=this,selectedOptionId=selectEvent.params.args.data.id,fieldsToExclude=["select","deselect"];_.contains(fieldsToExclude,selectedOptionId)&&(selectEvent.preventDefault(),"deselect"===selectedOptionId?jQuery(selectElement).val("").trigger("change"):(allOptions=[],_.each(container.find("option"),function(field){_.contains(fieldsToExclude,field.value)||allOptions.push(field.value)}),jQuery(selectElement).val(allOptions).trigger("change")),jQuery(selectElement).select2("close"))}).on("change",function(){toggleNextStepButton(window.exportData.segments&&segmentsContainerElement.select2("data").length&&subscriberFieldsContainerElement.select2("data").length||!window.exportData.segments&&subscriberFieldsContainerElement.select2("data").length?"on":"off")})},window.segments.forEach(function(item){segmentsContainerElement.append(jQuery("<option></option>").attr("value",item.id).text(item.name))}),renderSegmentsAndFields(segmentsContainerElement,window.segments),renderSegmentsAndFields(subscriberFieldsContainerElement,window.subscriberFieldsSelect2),subscriberFieldsContainerElement.val(["email","first_name","last_name","list_status","global_status"]).trigger("change"),nextStepButton.click(function(){var exportFormat;jQuery(this).hasClass("button-disabled")||(MailPoet.Modal.loading(!0),exportFormat=jQuery(':radio[name="option_format"]:checked').val(),MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"processExport",data:JSON.stringify({export_format_option:exportFormat,segments:!!window.exportData.segments&&segmentsContainerElement.val(),subscriber_fields:subscriberFieldsContainerElement.val()})}).always(function(){MailPoet.Modal.loading(!1)}).done(function(response){var resultMessage=MailPoet.I18n.t("exportMessage").replace("%1$s","<strong>"+parseInt(response.data.totalExported,10).toLocaleString()+"</strong>").replace("[link]",'<a href="'+response.data.exportFileURL+'" target="_blank" >').replace("[/link]","</a>");jQuery("#export_result_notice").html("<p>"+resultMessage+"</p>").show(),window.location.href=response.data.exportFileURL,MailPoet.trackEvent("Subscribers export completed",{"Total exported":response.data.totalExported,"File Format":exportFormat,"MailPoet Free version":window.mailpoet_version})}).fail(function(response){response.errors.length>0&&MailPoet.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})}))}))})}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},448:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactRouterDom=__webpack_require__(7),_steps_controller=__webpack_require__(449),_steps_controller2=_interopRequireDefault(_steps_controller),container=document.getElementById("welcome_wizard_container");container&&_reactDom2.default.render(_react2.default.createElement(_reactRouterDom.HashRouter,null,_react2.default.createElement("div",null,_react2.default.createElement(_reactRouterDom.Route,{exact:!0,path:"/",render:function(){return _react2.default.createElement(_reactRouterDom.Redirect,{to:"/steps/1"})}}),_react2.default.createElement(_reactRouterDom.Route,{path:"/steps/:step",component:_steps_controller2.default}))),container)},449:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_header=__webpack_require__(450),_header2=_interopRequireDefault(_header),_sender_step=__webpack_require__(452),_sender_step2=_interopRequireDefault(_sender_step),_migrated_user_step=__webpack_require__(453),_migrated_user_step2=_interopRequireDefault(_migrated_user_step),_help_info_step=__webpack_require__(454),_help_info_step2=_interopRequireDefault(_help_info_step),_usage_tracking_step=__webpack_require__(455),_usage_tracking_step2=_interopRequireDefault(_usage_tracking_step),_woo_commerce_step=__webpack_require__(456),_woo_commerce_step2=_interopRequireDefault(_woo_commerce_step),WelcomeWizardStepsController=function(_React$Component){function WelcomeWizardStepsController(props){_classCallCheck(this,WelcomeWizardStepsController);var _this=_possibleConstructorReturn(this,(WelcomeWizardStepsController.__proto__||Object.getPrototypeOf(WelcomeWizardStepsController)).call(this,props));return _this.state={stepsCount:window.is_woocommerce_active?4:3,shouldSetSender:!window.is_mp2_migration_complete,loading:!1,sender:window.sender_data},_this.finishWizard=_this.finishWizard.bind(_this),_this.updateSettings=_this.updateSettings.bind(_this),_this.activateTracking=_this.activateTracking.bind(_this),_this.updateSender=_this.updateSender.bind(_this),_this.submitSender=_this.submitSender.bind(_this),_this.showWooCommerceStepOrFinish=_this.showWooCommerceStepOrFinish.bind(_this),_this.componentDidUpdate(),_this}return _inherits(WelcomeWizardStepsController,_React$Component),_createClass(WelcomeWizardStepsController,[{key:"componentDidUpdate",value:function(){var step=parseInt(this.props.match.params.step,10);(step>this.state.stepsCount||step<1)&&this.props.history.push("/steps/1")}},{key:"finishWizard",value:function(){this.setState({loading:!0}),window.location=window.finish_wizard_url}},{key:"showWooCommerceStepOrFinish",value:function(){4===this.state.stepsCount?this.props.history.push("/steps/4"):this.finishWizard()}},{key:"updateSettings",value:function(data){var _this2=this;return this.setState({loading:!0}),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:data}).then(function(){return _this2.setState({loading:!1})}).fail(function(response){_this2.setState({loading:!1}),response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},{key:"activateTracking",value:function(){var _this3=this;this.updateSettings({analytics:{enabled:!0}}).then(function(){return _this3.showWooCommerceStepOrFinish()})}},{key:"updateSender",value:function(data){this.setState({sender:Object.assign({},this.state.sender,data)})}},{key:"submitSender",value:function(){var _this4=this;this.updateSettings({sender:this.state.sender}).then(function(){return _this4.props.history.push("/steps/2")})}},{key:"render",value:function(){var _this5=this,step=parseInt(this.props.match.params.step,10);return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_steps mailpoet_welcome_wizard_centered_column"},_react2.default.createElement(_header2.default,{current_step:step,steps_count:this.state.stepsCount,logo_src:window.mailpoet_logo_url}),1===step&&this.state.shouldSetSender?_react2.default.createElement(_sender_step2.default,{update_sender:this.updateSender,submit_sender:this.submitSender,finish:this.finishWizard,loading:this.state.loading,sender:this.state.sender}):null,1!==step||this.state.shouldSetSender?null:_react2.default.createElement(_migrated_user_step2.default,{next:function(){return _this5.props.history.push("/steps/2")}}),2===step?_react2.default.createElement(_help_info_step2.default,{next:function(){return _this5.props.history.push("/steps/3")}}):null,3===step?_react2.default.createElement(_usage_tracking_step2.default,{skip_action:this.showWooCommerceStepOrFinish,allow_action:this.activateTracking,allow_text:4===this.state.stepsCount?_mailpoet2.default.I18n.t("allowAndContinue"):_mailpoet2.default.I18n.t("allowAndFinish"),loading:this.state.loading}):null,4===step?_react2.default.createElement(_woo_commerce_step2.default,{next:this.finishWizard,screenshot_src:window.woocommerce_screenshot_url,loading:this.state.loading}):null)}}]),WelcomeWizardStepsController}(_react2.default.Component);WelcomeWizardStepsController.propTypes={match:_propTypes2.default.shape({params:_propTypes2.default.shape({step:_propTypes2.default.string}).isRequired}).isRequired,history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},module.exports=WelcomeWizardStepsController},450:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_stepped_progess_bar=__webpack_require__(451),_stepped_progess_bar2=_interopRequireDefault(_stepped_progess_bar),WelcomeWizardHeader=function(props){return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_centered_column mailpoet_welcome_wizard_header"},_react2.default.createElement("img",{src:props.logo_src,width:"200",alt:"MailPoet logo"}),props.current_step<=props.steps_count?_react2.default.createElement(_stepped_progess_bar2.default,{steps_count:props.steps_count,step:props.current_step}):null)};WelcomeWizardHeader.propTypes={current_step:_propTypes2.default.number.isRequired,steps_count:_propTypes2.default.number.isRequired,logo_src:_propTypes2.default.string.isRequired},module.exports=WelcomeWizardHeader},451:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),SteppedProgressBar=function(props){return props.step>props.steps_count?null:_react2.default.createElement("div",{className:"mailpoet_stepped_progress_bar"},[].concat(_toConsumableArray(Array(props.steps_count).keys())).map(function(step){return _react2.default.createElement("div",{className:"mailpoet_stepped_progress_bar_step "+(step<props.step?"active":""),key:"step_"+step,style:{width:Math.floor(100/props.steps_count)+"%"}})}))};SteppedProgressBar.propTypes={steps_count:_propTypes2.default.number.isRequired,step:_propTypes2.default.number.isRequired},module.exports=SteppedProgressBar},452:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),WelcomeWizardSenderStep=function(props){return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("welcomeWizardLetsStartTitle")),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("welcomeWizardSenderText")),_react2.default.createElement("form",{id:"mailpoet_sender_form",className:"mailpoet_welcome_wizard_centered_column "+(props.loading?"mailpoet_sender_form_loading":""),onSubmit:function(e){e.preventDefault(),(0,_jquery2.default)("#mailpoet_sender_form").parsley().validate()&&props.submit_sender()}},_react2.default.createElement("label",{htmlFor:"senderName"},_mailpoet2.default.I18n.t("senderName"),":",_react2.default.createElement("input",{name:"senderName",type:"text",placeholder:"John Doe",value:props.sender?props.sender.name:"","data-parsley-required":!0,onChange:function(e){return props.update_sender({name:e.target.value})}})),_react2.default.createElement("label",{htmlFor:"senderAddress"},_mailpoet2.default.I18n.t("senderAddress"),":",_react2.default.createElement("input",{name:"senderAddress",type:"text",placeholder:"john@doe.com",value:props.sender?props.sender.address:"","data-parsley-required":!0,"data-parsley-type":"email",onChange:function(e){return props.update_sender({address:e.target.value})}})),_react2.default.createElement("input",{className:"button button-primary",type:"submit",value:_mailpoet2.default.I18n.t("next")}),_react2.default.createElement("a",{onClick:props.finish,href:"#finish"},_mailpoet2.default.I18n.t("noThanksSkip"))))};WelcomeWizardSenderStep.propTypes={finish:_propTypes2.default.func.isRequired,loading:_propTypes2.default.bool.isRequired,update_sender:_propTypes2.default.func.isRequired,submit_sender:_propTypes2.default.func.isRequired,sender:_propTypes2.default.shape({name:_propTypes2.default.string,address:_propTypes2.default.string})},WelcomeWizardSenderStep.defaultProps={sender:null},module.exports=WelcomeWizardSenderStep},453:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),WelcomeWizardMigratedUserStep=function(props){return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("welcomeWizardLetsStartTitle")),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("welcomeWizardSenderMigratedUserText")),_react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_controls"},_react2.default.createElement("button",{className:"button button-primary",onClick:props.next},_mailpoet2.default.I18n.t("next"))))};WelcomeWizardMigratedUserStep.propTypes={next:_propTypes2.default.func.isRequired},module.exports=WelcomeWizardMigratedUserStep},454:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),WelcomeWizardHelpInfoStep=function(props){return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},_react2.default.createElement("div",{className:"mailpoet_welcome_wizard_help_info_block"},_react2.default.createElement("span",{className:"mailpoet_welcome_wizard_support_button"}),_react2.default.createElement("p",null,(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("welcomeWizardYouCanContactText"),/\[strong\](.*?)\[\/strong\]/g,function(match){return _react2.default.createElement("strong",{key:match},match)}))),_react2.default.createElement("div",{className:"mailpoet_welcome_wizard_help_info_block"},_react2.default.createElement("span",{className:"mailpoet_badge mailpoet_badge_video mailpoet_welcome_wizard_video_badge"},_react2.default.createElement("span",{className:"dashicons dashicons-format-video"}),_mailpoet2.default.I18n.t("seeVideoGuide")),_react2.default.createElement("p",null,(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("welcomeWizardAboutVideosText"),/\[strong\](.*?)\[\/strong\]/g,function(match){return _react2.default.createElement("strong",{key:match},match)}))),_react2.default.createElement("div",{className:"mailpoet_welcome_wizard_help_info_block"},_react2.default.createElement("span",{className:"mailpoet_welcome_wizard_mail_icon"}),_react2.default.createElement("p",null,(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("welcomeWizardAboutCourseText"),/\[strong\](.*?)\[\/strong\]/g,function(match){return _react2.default.createElement("strong",{key:match},match)})),_react2.default.createElement("iframe",{id:"mailpoet_form_iframe",width:"100%",scrolling:"no",frameBorder:"0",title:"Apply to course",src:"https://newsletters.mailpoet.com?mailpoet_form_iframe=13",className:"mailpoet_form_iframe",marginWidth:"0",marginHeight:"0",allowtransparency:"true"})),_react2.default.createElement("button",{className:"button button-primary",onClick:props.next},_mailpoet2.default.I18n.t("next")))};module.exports=WelcomeWizardHelpInfoStep,WelcomeWizardHelpInfoStep.propTypes={next:_propTypes2.default.func.isRequired},module.exports=WelcomeWizardHelpInfoStep},455:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),WelcomeWizardUsageTrackingStep=function(props){return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("welcomeWizardUsageTrackingStepTitle")),_react2.default.createElement("p",null,(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("welcomeWizardTrackingText"),/\[link\](.*?)\[\/link\]/g,function(match){return _react2.default.createElement("a",{key:"docs_link",href:"https://beta.docs.mailpoet.com/article/130-sharing-your-data-with-us",target:"_blank",rel:"noopener noreferrer"},match)})),_react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_controls\n "+(props.loading?"mailpoet_welcome_wizard_step_controls_loading":"")},_react2.default.createElement("button",{className:"button",onClick:props.skip_action,disabled:props.loading},_mailpoet2.default.I18n.t("skip")),_react2.default.createElement("button",{className:"button button-primary",onClick:props.allow_action,disabled:props.loading},props.allow_text)))};module.exports=WelcomeWizardUsageTrackingStep,WelcomeWizardUsageTrackingStep.propTypes={allow_action:_propTypes2.default.func.isRequired,allow_text:_propTypes2.default.string.isRequired,skip_action:_propTypes2.default.func.isRequired,loading:_propTypes2.default.bool.isRequired}},456:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),WelcomeWizardWooCommerceStep=function(props){return _react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("welcomeWizardWooCommerceStepTitle")),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("welcomeWizardHelpingShopOwnersText")),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("welcomeWizardWooCommerceEmailsText")),_react2.default.createElement("img",{src:props.screenshot_src,className:"mailpoet_welcome_wizard_woo_screenshot",alt:"WooCommerce email"}),_react2.default.createElement("div",{className:"mailpoet_welcome_wizard_step_controls\n "+(props.loading?"mailpoet_welcome_wizard_step_controls_loading":"")},_react2.default.createElement("button",{className:"button button-primary",onClick:props.next,disabled:props.loading},_mailpoet2.default.I18n.t("gotIt"))))};module.exports=WelcomeWizardWooCommerceStep,WelcomeWizardWooCommerceStep.propTypes={next:_propTypes2.default.func.isRequired,screenshot_src:_propTypes2.default.string.isRequired,loading:_propTypes2.default.bool.isRequired}},457:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_new_subscriber_announcement=__webpack_require__(458),_new_subscriber_announcement2=_interopRequireDefault(_new_subscriber_announcement),container=document.getElementById("new_subscriber_announcement");container&&_reactDom2.default.render(_react2.default.createElement(_new_subscriber_announcement2.default,{installedAt:window.mailpoet_installed_at,imageUrl:window.mailpoet_new_subscriber_announcement_image}),container)},458:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_moment=__webpack_require__(0),_moment2=_interopRequireDefault(_moment),_in_app_announcement=__webpack_require__(267),_in_app_announcement2=_interopRequireDefault(_in_app_announcement),NewSubscriberNotificationAnnouncement=function(props){return _react2.default.createElement(_in_app_announcement2.default,{validUntil:(0,_moment2.default)(props.installedAt).add(3,"months").toDate(),height:"700px",showOnlyOnceSlug:"new_subscriber_notification",showToNewUser:!1},_react2.default.createElement("div",{className:"new_subscriber_notification_announcement"},_react2.default.createElement("h1",null,_mailpoet2.default.I18n.t("announcementHeader")),_react2.default.createElement("img",{src:props.imageUrl,width:"600px",height:"460px",alt:""}),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("announcementParagraph1"),_react2.default.createElement("br",null),_mailpoet2.default.I18n.t("announcementParagraph2"))))};NewSubscriberNotificationAnnouncement.propTypes={installedAt:_propTypes2.default.string.isRequired,imageUrl:_propTypes2.default.string.isRequired},module.exports=NewSubscriberNotificationAnnouncement},459:function(module,exports,__webpack_require__){"use strict";(function(setImmediate){function displayPoll(){window.mailpoet_display_nps_poll&&window.satismeter&&window.mailpoet_installed_at_isoFormat&&(window.satismeter({writeKey:"6L479eVPXk7pBn6S",userId:window.mailpoet_current_wp_user.ID+window.mailpoet_site_url,traits:{name:window.mailpoet_current_wp_user.user_nicename,email:window.mailpoet_current_wp_user.user_email,createdAt:window.mailpoet_installed_at_isoFormat}}),window.satismeter({writeKey:"k0aJAsQAWI2ERyGv",userId:window.mailpoet_current_wp_user.ID+window.mailpoet_site_url,traits:{name:window.mailpoet_current_wp_user.user_nicename,email:window.mailpoet_current_wp_user.user_email,createdAt:window.mailpoet_installed_at_isoFormat}}))}setImmediate(displayPoll)}).call(exports,__webpack_require__(281).setImmediate)}},[390]);
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/{admin_vendor.6e1f275b.js → admin_vendor.3e28a2ac.js}
RENAMED
@@ -49,7 +49,7 @@ Object.defineProperty(exports,"__esModule",{value:!0});var C,D,d=null,f=!1,h=3,k
|
|
49 |
* @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
|
50 |
* Released under MIT license, http://github.com/requirejs/almond/LICENSE
|
51 |
*/
|
52 |
-
var requirejs,require,define;!function(undef){function hasProp(obj,prop){return hasOwn.call(obj,prop)}function normalize(name,baseName){var nameParts,nameSegment,mapValue,foundMap,lastIndex,foundI,foundStarMap,starI,i,j,part,normalizedBaseParts,baseParts=baseName&&baseName.split("/"),map=config.map,starMap=map&&map["*"]||{};if(name){for(name=name.split("/"),lastIndex=name.length-1,config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])&&(name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")),"."===name[0].charAt(0)&&baseParts&&(normalizedBaseParts=baseParts.slice(0,baseParts.length-1),name=normalizedBaseParts.concat(name)),i=0;i<name.length;i++)if("."===(part=name[i]))name.splice(i,1),i-=1;else if(".."===part){if(0===i||1===i&&".."===name[2]||".."===name[i-1])continue;i>0&&(name.splice(i-1,2),i-=2)}name=name.join("/")}if((baseParts||starMap)&&map){for(nameParts=name.split("/"),i=nameParts.length;i>0;i-=1){if(nameSegment=nameParts.slice(0,i).join("/"),baseParts)for(j=baseParts.length;j>0;j-=1)if((mapValue=map[baseParts.slice(0,j).join("/")])&&(mapValue=mapValue[nameSegment])){foundMap=mapValue,foundI=i;break}if(foundMap)break;!foundStarMap&&starMap&&starMap[nameSegment]&&(foundStarMap=starMap[nameSegment],starI=i)}!foundMap&&foundStarMap&&(foundMap=foundStarMap,foundI=starI),foundMap&&(nameParts.splice(0,foundI,foundMap),name=nameParts.join("/"))}return name}function makeRequire(relName,forceSync){return function(){var args=aps.call(arguments,0);return"string"!=typeof args[0]&&1===args.length&&args.push(null),req.apply(undef,args.concat([relName,forceSync]))}}function makeNormalize(relName){return function(name){return normalize(name,relName)}}function makeLoad(depName){return function(value){defined[depName]=value}}function callDep(name){if(hasProp(waiting,name)){var args=waiting[name];delete waiting[name],defining[name]=!0,main.apply(undef,args)}if(!hasProp(defined,name)&&!hasProp(defining,name))throw new Error("No "+name);return defined[name]}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;return index>-1&&(prefix=name.substring(0,index),name=name.substring(index+1,name.length)),[prefix,name]}function makeRelParts(relName){return relName?splitPrefix(relName):[]}function makeConfig(name){return function(){return config&&config.config&&config.config[name]||{}}}var main,req,makeMap,handlers,defined={},waiting={},config={},defining={},hasOwn=Object.prototype.hasOwnProperty,aps=[].slice,jsSuffixRegExp=/\.js$/;makeMap=function(name,relParts){var plugin,parts=splitPrefix(name),prefix=parts[0],relResourceName=relParts[1];return name=parts[1],prefix&&(prefix=normalize(prefix,relResourceName),plugin=callDep(prefix)),prefix?name=plugin&&plugin.normalize?plugin.normalize(name,makeNormalize(relResourceName)):normalize(name,relResourceName):(name=normalize(name,relResourceName),parts=splitPrefix(name),prefix=parts[0],name=parts[1],prefix&&(plugin=callDep(prefix))),{f:prefix?prefix+"!"+name:name,n:name,pr:prefix,p:plugin}},handlers={require:function(name){return makeRequire(name)},exports:function(name){var e=defined[name];return void 0!==e?e:defined[name]={}},module:function(name){return{id:name,uri:"",exports:defined[name],config:makeConfig(name)}}},main=function(name,deps,callback,relName){var cjsModule,depName,ret,map,i,relParts,usingExports,args=[],callbackType=typeof callback;if(relName=relName||name,relParts=makeRelParts(relName),"undefined"===callbackType||"function"===callbackType){for(deps=!deps.length&&callback.length?["require","exports","module"]:deps,i=0;i<deps.length;i+=1)if(map=makeMap(deps[i],relParts),"require"===(depName=map.f))args[i]=handlers.require(name);else if("exports"===depName)args[i]=handlers.exports(name),usingExports=!0;else if("module"===depName)cjsModule=args[i]=handlers.module(name);else if(hasProp(defined,depName)||hasProp(waiting,depName)||hasProp(defining,depName))args[i]=callDep(depName);else{if(!map.p)throw new Error(name+" missing "+depName);map.p.load(map.n,makeRequire(relName,!0),makeLoad(depName),{}),args[i]=defined[depName]}ret=callback?callback.apply(defined[name],args):void 0,name&&(cjsModule&&cjsModule.exports!==undef&&cjsModule.exports!==defined[name]?defined[name]=cjsModule.exports:ret===undef&&usingExports||(defined[name]=ret))}else name&&(defined[name]=callback)},requirejs=require=req=function(deps,callback,relName,forceSync,alt){if("string"==typeof deps)return handlers[deps]?handlers[deps](callback):callDep(makeMap(deps,makeRelParts(callback)).f);if(!deps.splice){if(config=deps,config.deps&&req(config.deps,config.callback),!callback)return;callback.splice?(deps=callback,callback=relName,relName=null):deps=undef}return callback=callback||function(){},"function"==typeof relName&&(relName=forceSync,forceSync=alt),forceSync?main(undef,deps,callback,relName):setTimeout(function(){main(undef,deps,callback,relName)},4),req},req.config=function(cfg){return req(cfg)},requirejs._defined=defined,define=function(name,deps,callback){if("string"!=typeof name)throw new Error("See almond README: incorrect module build, no module name");deps.splice||(callback=deps,deps=[]),hasProp(defined,name)||hasProp(waiting,name)||(waiting[name]=[name,deps,callback])},define.amd={jQuery:!0}}(),S2.requirejs=requirejs,S2.require=require,S2.define=define}}(),S2.define("almond",function(){}),S2.define("jquery",[],function(){var _$=jQuery||$;return null==_$&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),_$}),S2.define("select2/utils",["jquery"],function($){function getMethods(theClass){var proto=theClass.prototype,methods=[];for(var methodName in proto){"function"==typeof proto[methodName]&&("constructor"!==methodName&&methods.push(methodName))}return methods}var Utils={};Utils.Extend=function(ChildClass,SuperClass){function BaseConstructor(){this.constructor=ChildClass}var __hasProp={}.hasOwnProperty;for(var key in SuperClass)__hasProp.call(SuperClass,key)&&(ChildClass[key]=SuperClass[key]);return BaseConstructor.prototype=SuperClass.prototype,ChildClass.prototype=new BaseConstructor,ChildClass.__super__=SuperClass.prototype,ChildClass},Utils.Decorate=function(SuperClass,DecoratorClass){function DecoratedClass(){var unshift=Array.prototype.unshift,argCount=DecoratorClass.prototype.constructor.length,calledConstructor=SuperClass.prototype.constructor;argCount>0&&(unshift.call(arguments,SuperClass.prototype.constructor),calledConstructor=DecoratorClass.prototype.constructor),calledConstructor.apply(this,arguments)}function ctr(){this.constructor=DecoratedClass}var decoratedMethods=getMethods(DecoratorClass),superMethods=getMethods(SuperClass);DecoratorClass.displayName=SuperClass.displayName,DecoratedClass.prototype=new ctr;for(var m=0;m<superMethods.length;m++){var superMethod=superMethods[m];DecoratedClass.prototype[superMethod]=SuperClass.prototype[superMethod]}for(var d=0;d<decoratedMethods.length;d++){var decoratedMethod=decoratedMethods[d];DecoratedClass.prototype[decoratedMethod]=function(methodName){var originalMethod=function(){};methodName in DecoratedClass.prototype&&(originalMethod=DecoratedClass.prototype[methodName]);var decoratedMethod=DecoratorClass.prototype[methodName];return function(){return Array.prototype.unshift.call(arguments,originalMethod),decoratedMethod.apply(this,arguments)}}(decoratedMethod)}return DecoratedClass};var Observable=function(){this.listeners={}};return Observable.prototype.on=function(event,callback){this.listeners=this.listeners||{},event in this.listeners?this.listeners[event].push(callback):this.listeners[event]=[callback]},Observable.prototype.trigger=function(event){var slice=Array.prototype.slice,params=slice.call(arguments,1);this.listeners=this.listeners||{},null==params&&(params=[]),0===params.length&¶ms.push({}),params[0]._type=event,event in this.listeners&&this.invoke(this.listeners[event],slice.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},Observable.prototype.invoke=function(listeners,params){for(var i=0,len=listeners.length;i<len;i++)listeners[i].apply(this,params)},Utils.Observable=Observable,Utils.generateChars=function(length){for(var chars="",i=0;i<length;i++){chars+=Math.floor(36*Math.random()).toString(36)}return chars},Utils.bind=function(func,context){return function(){func.apply(context,arguments)}},Utils._convertData=function(data){for(var originalKey in data){var keys=originalKey.split("-"),dataLevel=data;if(1!==keys.length){for(var k=0;k<keys.length;k++){var key=keys[k];key=key.substring(0,1).toLowerCase()+key.substring(1),key in dataLevel||(dataLevel[key]={}),k==keys.length-1&&(dataLevel[key]=data[originalKey]),dataLevel=dataLevel[key]}delete data[originalKey]}}return data},Utils.hasScroll=function(index,el){var $el=$(el),overflowX=el.style.overflowX,overflowY=el.style.overflowY;return(overflowX!==overflowY||"hidden"!==overflowY&&"visible"!==overflowY)&&("scroll"===overflowX||"scroll"===overflowY||($el.innerHeight()<el.scrollHeight||$el.innerWidth()<el.scrollWidth))},Utils.escapeMarkup=function(markup){var replaceMap={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof markup?markup:String(markup).replace(/[&<>"'\/\\]/g,function(match){return replaceMap[match]})},Utils.appendMany=function($element,$nodes){if("1.7"===$.fn.jquery.substr(0,3)){var $jqNodes=$();$.map($nodes,function(node){$jqNodes=$jqNodes.add(node)}),$nodes=$jqNodes}$element.append($nodes)},Utils}),S2.define("select2/results",["jquery","./utils"],function($,Utils){function Results($element,options,dataAdapter){this.$element=$element,this.data=dataAdapter,this.options=options,Results.__super__.constructor.call(this)}return Utils.Extend(Results,Utils.Observable),Results.prototype.render=function(){var $results=$('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&$results.attr("aria-multiselectable","true"),this.$results=$results,$results},Results.prototype.clear=function(){this.$results.empty()},Results.prototype.displayMessage=function(params){var escapeMarkup=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var $message=$('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),message=this.options.get("translations").get(params.message);$message.append(escapeMarkup(message(params.args))),$message[0].className+=" select2-results__message",this.$results.append($message)},Results.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},Results.prototype.append=function(data){this.hideLoading();var $options=[];if(null==data.results||0===data.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));data.results=this.sort(data.results);for(var d=0;d<data.results.length;d++){var item=data.results[d],$option=this.option(item);$options.push($option)}this.$results.append($options)},Results.prototype.position=function($results,$dropdown){$dropdown.find(".select2-results").append($results)},Results.prototype.sort=function(data){return this.options.get("sorter")(data)},Results.prototype.highlightFirstItem=function(){var $options=this.$results.find(".select2-results__option[aria-selected]"),$selected=$options.filter("[aria-selected=true]");$selected.length>0?$selected.first().trigger("mouseenter"):$options.first().trigger("mouseenter"),this.ensureHighlightVisible()},Results.prototype.setClasses=function(){var self=this;this.data.current(function(selected){var selectedIds=$.map(selected,function(s){return s.id.toString()});self.$results.find(".select2-results__option[aria-selected]").each(function(){var $option=$(this),item=$.data(this,"data"),id=""+item.id;null!=item.element&&item.element.selected||null==item.element&&$.inArray(id,selectedIds)>-1?$option.attr("aria-selected","true"):$option.attr("aria-selected","false")})})},Results.prototype.showLoading=function(params){this.hideLoading();var loadingMore=this.options.get("translations").get("searching"),loading={disabled:!0,loading:!0,text:loadingMore(params)},$loading=this.option(loading);$loading.className+=" loading-results",this.$results.prepend($loading)},Results.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},Results.prototype.option=function(data){var option=document.createElement("li");option.className="select2-results__option";var attrs={role:"treeitem","aria-selected":"false"};data.disabled&&(delete attrs["aria-selected"],attrs["aria-disabled"]="true"),null==data.id&&delete attrs["aria-selected"],null!=data._resultId&&(option.id=data._resultId),data.title&&(option.title=data.title),data.children&&(attrs.role="group",attrs["aria-label"]=data.text,delete attrs["aria-selected"]);for(var attr in attrs){var val=attrs[attr];option.setAttribute(attr,val)}if(data.children){var $option=$(option),label=document.createElement("strong");label.className="select2-results__group";$(label);this.template(data,label);for(var $children=[],c=0;c<data.children.length;c++){var child=data.children[c],$child=this.option(child);$children.push($child)}var $childrenContainer=$("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});$childrenContainer.append($children),$option.append(label),$option.append($childrenContainer)}else this.template(data,option);return $.data(option,"data",data),option},Results.prototype.bind=function(container,$container){var self=this,id=container.id+"-results";this.$results.attr("id",id),container.on("results:all",function(params){self.clear(),self.append(params.data),container.isOpen()&&(self.setClasses(),self.highlightFirstItem())}),container.on("results:append",function(params){self.append(params.data),container.isOpen()&&self.setClasses()}),container.on("query",function(params){self.hideMessages(),self.showLoading(params)}),container.on("select",function(){container.isOpen()&&(self.setClasses(),self.highlightFirstItem())}),container.on("unselect",function(){container.isOpen()&&(self.setClasses(),self.highlightFirstItem())}),container.on("open",function(){self.$results.attr("aria-expanded","true"),self.$results.attr("aria-hidden","false"),self.setClasses(),self.ensureHighlightVisible()}),container.on("close",function(){self.$results.attr("aria-expanded","false"),self.$results.attr("aria-hidden","true"),self.$results.removeAttr("aria-activedescendant")}),container.on("results:toggle",function(){var $highlighted=self.getHighlightedResults();0!==$highlighted.length&&$highlighted.trigger("mouseup")}),container.on("results:select",function(){var $highlighted=self.getHighlightedResults();if(0!==$highlighted.length){var data=$highlighted.data("data");"true"==$highlighted.attr("aria-selected")?self.trigger("close",{}):self.trigger("select",{data:data})}}),container.on("results:previous",function(){var $highlighted=self.getHighlightedResults(),$options=self.$results.find("[aria-selected]"),currentIndex=$options.index($highlighted);if(0!==currentIndex){var nextIndex=currentIndex-1;0===$highlighted.length&&(nextIndex=0);var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top,nextTop=$next.offset().top,nextOffset=self.$results.scrollTop()+(nextTop-currentOffset);0===nextIndex?self.$results.scrollTop(0):nextTop-currentOffset<0&&self.$results.scrollTop(nextOffset)}}),container.on("results:next",function(){var $highlighted=self.getHighlightedResults(),$options=self.$results.find("[aria-selected]"),currentIndex=$options.index($highlighted),nextIndex=currentIndex+1;if(!(nextIndex>=$options.length)){var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top+self.$results.outerHeight(!1),nextBottom=$next.offset().top+$next.outerHeight(!1),nextOffset=self.$results.scrollTop()+nextBottom-currentOffset;0===nextIndex?self.$results.scrollTop(0):nextBottom>currentOffset&&self.$results.scrollTop(nextOffset)}}),container.on("results:focus",function(params){params.element.addClass("select2-results__option--highlighted")}),container.on("results:message",function(params){self.displayMessage(params)}),$.fn.mousewheel&&this.$results.on("mousewheel",function(e){var top=self.$results.scrollTop(),bottom=self.$results.get(0).scrollHeight-top+e.deltaY,isAtTop=e.deltaY>0&&top-e.deltaY<=0,isAtBottom=e.deltaY<0&&bottom<=self.$results.height();isAtTop?(self.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):isAtBottom&&(self.$results.scrollTop(self.$results.get(0).scrollHeight-self.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(evt){var $this=$(this),data=$this.data("data");if("true"===$this.attr("aria-selected"))return void(self.options.get("multiple")?self.trigger("unselect",{originalEvent:evt,data:data}):self.trigger("close",{}));self.trigger("select",{originalEvent:evt,data:data})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(evt){var data=$(this).data("data");self.getHighlightedResults().removeClass("select2-results__option--highlighted"),self.trigger("results:focus",{data:data,element:$(this)})})},Results.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},Results.prototype.destroy=function(){this.$results.remove()},Results.prototype.ensureHighlightVisible=function(){var $highlighted=this.getHighlightedResults();if(0!==$highlighted.length){var $options=this.$results.find("[aria-selected]"),currentIndex=$options.index($highlighted),currentOffset=this.$results.offset().top,nextTop=$highlighted.offset().top,nextOffset=this.$results.scrollTop()+(nextTop-currentOffset),offsetDelta=nextTop-currentOffset;nextOffset-=2*$highlighted.outerHeight(!1),currentIndex<=2?this.$results.scrollTop(0):(offsetDelta>this.$results.outerHeight()||offsetDelta<0)&&this.$results.scrollTop(nextOffset)}},Results.prototype.template=function(result,container){var template=this.options.get("templateResult"),escapeMarkup=this.options.get("escapeMarkup"),content=template(result,container);null==content?container.style.display="none":"string"==typeof content?container.innerHTML=escapeMarkup(content):$(container).append(content)},Results}),S2.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),S2.define("select2/selection/base",["jquery","../utils","../keys"],function($,Utils,KEYS){function BaseSelection($element,options){this.$element=$element,this.options=options,BaseSelection.__super__.constructor.call(this)}return Utils.Extend(BaseSelection,Utils.Observable),BaseSelection.prototype.render=function(){var $selection=$('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),$selection.attr("title",this.$element.attr("title")),$selection.attr("tabindex",this._tabindex),this.$selection=$selection,$selection},BaseSelection.prototype.bind=function(container,$container){var self=this,resultsId=(container.id,container.id+"-results");this.container=container,this.$selection.on("focus",function(evt){self.trigger("focus",evt)}),this.$selection.on("blur",function(evt){self._handleBlur(evt)}),this.$selection.on("keydown",function(evt){self.trigger("keypress",evt),evt.which===KEYS.SPACE&&evt.preventDefault()}),container.on("results:focus",function(params){self.$selection.attr("aria-activedescendant",params.data._resultId)}),container.on("selection:update",function(params){self.update(params.data)}),container.on("open",function(){self.$selection.attr("aria-expanded","true"),self.$selection.attr("aria-owns",resultsId),self._attachCloseHandler(container)}),container.on("close",function(){self.$selection.attr("aria-expanded","false"),self.$selection.removeAttr("aria-activedescendant"),self.$selection.removeAttr("aria-owns"),self.$selection.focus(),self._detachCloseHandler(container)}),container.on("enable",function(){self.$selection.attr("tabindex",self._tabindex)}),container.on("disable",function(){self.$selection.attr("tabindex","-1")})},BaseSelection.prototype._handleBlur=function(evt){var self=this;window.setTimeout(function(){document.activeElement==self.$selection[0]||$.contains(self.$selection[0],document.activeElement)||self.trigger("blur",evt)},1)},BaseSelection.prototype._attachCloseHandler=function(container){$(document.body).on("mousedown.select2."+container.id,function(e){var $target=$(e.target),$select=$target.closest(".select2");$(".select2.select2-container--open").each(function(){var $this=$(this);this!=$select[0]&&$this.data("element").select2("close")})})},BaseSelection.prototype._detachCloseHandler=function(container){$(document.body).off("mousedown.select2."+container.id)},BaseSelection.prototype.position=function($selection,$container){$container.find(".selection").append($selection)},BaseSelection.prototype.destroy=function(){this._detachCloseHandler(this.container)},BaseSelection.prototype.update=function(data){throw new Error("The `update` method must be defined in child classes.")},BaseSelection}),S2.define("select2/selection/single",["jquery","./base","../utils","../keys"],function($,BaseSelection,Utils,KEYS){function SingleSelection(){SingleSelection.__super__.constructor.apply(this,arguments)}return Utils.Extend(SingleSelection,BaseSelection),SingleSelection.prototype.render=function(){var $selection=SingleSelection.__super__.render.call(this);return $selection.addClass("select2-selection--single"),$selection.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),$selection},SingleSelection.prototype.bind=function(container,$container){var self=this;SingleSelection.__super__.bind.apply(this,arguments);var id=container.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",id),this.$selection.attr("aria-labelledby",id),this.$selection.on("mousedown",function(evt){1===evt.which&&self.trigger("toggle",{originalEvent:evt})}),this.$selection.on("focus",function(evt){}),this.$selection.on("blur",function(evt){}),container.on("focus",function(evt){container.isOpen()||self.$selection.focus()}),container.on("selection:update",function(params){self.update(params.data)})},SingleSelection.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},SingleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection");return this.options.get("escapeMarkup")(template(data,container))},SingleSelection.prototype.selectionContainer=function(){return $("<span></span>")},SingleSelection.prototype.update=function(data){if(0===data.length)return void this.clear();var selection=data[0],$rendered=this.$selection.find(".select2-selection__rendered"),formatted=this.display(selection,$rendered);$rendered.empty().append(formatted),$rendered.prop("title",selection.title||selection.text)},SingleSelection}),S2.define("select2/selection/multiple",["jquery","./base","../utils"],function($,BaseSelection,Utils){function MultipleSelection($element,options){MultipleSelection.__super__.constructor.apply(this,arguments)}return Utils.Extend(MultipleSelection,BaseSelection),MultipleSelection.prototype.render=function(){var $selection=MultipleSelection.__super__.render.call(this);return $selection.addClass("select2-selection--multiple"),$selection.html('<ul class="select2-selection__rendered"></ul>'),$selection},MultipleSelection.prototype.bind=function(container,$container){var self=this;MultipleSelection.__super__.bind.apply(this,arguments),this.$selection.on("click",function(evt){self.trigger("toggle",{originalEvent:evt})}),this.$selection.on("click",".select2-selection__choice__remove",function(evt){if(!self.options.get("disabled")){var $remove=$(this),$selection=$remove.parent(),data=$selection.data("data");self.trigger("unselect",{originalEvent:evt,data:data})}})},MultipleSelection.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},MultipleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection");return this.options.get("escapeMarkup")(template(data,container))},MultipleSelection.prototype.selectionContainer=function(){return $('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},MultipleSelection.prototype.update=function(data){if(this.clear(),0!==data.length){for(var $selections=[],d=0;d<data.length;d++){var selection=data[d],$selection=this.selectionContainer(),formatted=this.display(selection,$selection);$selection.append(formatted),$selection.prop("title",selection.title||selection.text),$selection.data("data",selection),$selections.push($selection)}var $rendered=this.$selection.find(".select2-selection__rendered");Utils.appendMany($rendered,$selections)}},MultipleSelection}),S2.define("select2/selection/placeholder",["../utils"],function(Utils){function Placeholder(decorated,$element,options){this.placeholder=this.normalizePlaceholder(options.get("placeholder")),decorated.call(this,$element,options)}return Placeholder.prototype.normalizePlaceholder=function(_,placeholder){return"string"==typeof placeholder&&(placeholder={id:"",text:placeholder}),placeholder},Placeholder.prototype.createPlaceholder=function(decorated,placeholder){var $placeholder=this.selectionContainer();return $placeholder.html(this.display(placeholder)),$placeholder.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),$placeholder},Placeholder.prototype.update=function(decorated,data){var singlePlaceholder=1==data.length&&data[0].id!=this.placeholder.id;if(data.length>1||singlePlaceholder)return decorated.call(this,data);this.clear();var $placeholder=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append($placeholder)},Placeholder}),S2.define("select2/selection/allowClear",["jquery","../keys"],function($,KEYS){function AllowClear(){}return AllowClear.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(evt){self._handleClear(evt)}),container.on("keypress",function(evt){self._handleKeyboardClear(evt,container)})},AllowClear.prototype._handleClear=function(_,evt){if(!this.options.get("disabled")){var $clear=this.$selection.find(".select2-selection__clear");if(0!==$clear.length){evt.stopPropagation();for(var data=$clear.data("data"),d=0;d<data.length;d++){var unselectData={data:data[d]};if(this.trigger("unselect",unselectData),unselectData.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},AllowClear.prototype._handleKeyboardClear=function(_,evt,container){container.isOpen()||evt.which!=KEYS.DELETE&&evt.which!=KEYS.BACKSPACE||this._handleClear(evt)},AllowClear.prototype.update=function(decorated,data){if(decorated.call(this,data),!(this.$selection.find(".select2-selection__placeholder").length>0||0===data.length)){var $remove=$('<span class="select2-selection__clear">×</span>');$remove.data("data",data),this.$selection.find(".select2-selection__rendered").prepend($remove)}},AllowClear}),S2.define("select2/selection/search",["jquery","../utils","../keys"],function($,Utils,KEYS){function Search(decorated,$element,options){decorated.call(this,$element,options)}return Search.prototype.render=function(decorated){var $search=$('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=$search,this.$search=$search.find("input");var $rendered=decorated.call(this);return this._transferTabIndex(),$rendered},Search.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("open",function(){self.$search.trigger("focus")}),container.on("close",function(){self.$search.val(""),self.$search.removeAttr("aria-activedescendant"),self.$search.trigger("focus")}),container.on("enable",function(){self.$search.prop("disabled",!1),self._transferTabIndex()}),container.on("disable",function(){self.$search.prop("disabled",!0)}),container.on("focus",function(evt){self.$search.trigger("focus")}),container.on("results:focus",function(params){self.$search.attr("aria-activedescendant",params.id)}),this.$selection.on("focusin",".select2-search--inline",function(evt){self.trigger("focus",evt)}),this.$selection.on("focusout",".select2-search--inline",function(evt){self._handleBlur(evt)}),this.$selection.on("keydown",".select2-search--inline",function(evt){if(evt.stopPropagation(),self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented(),evt.which===KEYS.BACKSPACE&&""===self.$search.val()){var $previousChoice=self.$searchContainer.prev(".select2-selection__choice");if($previousChoice.length>0){var item=$previousChoice.data("data");self.searchRemoveChoice(item),evt.preventDefault()}}});var msie=document.documentMode,disableInputEvents=msie&&msie<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(evt){if(disableInputEvents)return void self.$selection.off("input.search input.searchcheck");self.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(evt){if(disableInputEvents&&"input"===evt.type)return void self.$selection.off("input.search input.searchcheck");var key=evt.which;key!=KEYS.SHIFT&&key!=KEYS.CTRL&&key!=KEYS.ALT&&key!=KEYS.TAB&&self.handleSearch(evt)})},Search.prototype._transferTabIndex=function(decorated){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},Search.prototype.createPlaceholder=function(decorated,placeholder){this.$search.attr("placeholder",placeholder.text)},Search.prototype.update=function(decorated,data){var searchHadFocus=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),decorated.call(this,data),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),searchHadFocus&&this.$search.focus()},Search.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=!1},Search.prototype.searchRemoveChoice=function(decorated,item){this.trigger("unselect",{data:item}),this.$search.val(item.text),this.handleSearch()},Search.prototype.resizeSearch=function(){this.$search.css("width","25px");var width="";if(""!==this.$search.attr("placeholder"))width=this.$selection.find(".select2-selection__rendered").innerWidth();else{width=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",width)},Search}),S2.define("select2/selection/eventRelay",["jquery"],function($){function EventRelay(){}return EventRelay.prototype.bind=function(decorated,container,$container){var self=this,relayEvents=["open","opening","close","closing","select","selecting","unselect","unselecting"],preventableEvents=["opening","closing","selecting","unselecting"];decorated.call(this,container,$container),container.on("*",function(name,params){if(-1!==$.inArray(name,relayEvents)){params=params||{};var evt=$.Event("select2:"+name,{params:params});self.$element.trigger(evt),-1!==$.inArray(name,preventableEvents)&&(params.prevented=evt.isDefaultPrevented())}})},EventRelay}),S2.define("select2/translation",["jquery","require"],function($,require){function Translation(dict){this.dict=dict||{}}return Translation.prototype.all=function(){return this.dict},Translation.prototype.get=function(key){return this.dict[key]},Translation.prototype.extend=function(translation){this.dict=$.extend({},translation.all(),this.dict)},Translation._cache={},Translation.loadPath=function(path){if(!(path in Translation._cache)){var translations=require(path);Translation._cache[path]=translations}return new Translation(Translation._cache[path])},Translation}),S2.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),S2.define("select2/data/base",["../utils"],function(Utils){function BaseAdapter($element,options){BaseAdapter.__super__.constructor.call(this)}return Utils.Extend(BaseAdapter,Utils.Observable),BaseAdapter.prototype.current=function(callback){throw new Error("The `current` method must be defined in child classes.")},BaseAdapter.prototype.query=function(params,callback){throw new Error("The `query` method must be defined in child classes.")},BaseAdapter.prototype.bind=function(container,$container){},BaseAdapter.prototype.destroy=function(){},BaseAdapter.prototype.generateResultId=function(container,data){var id=container.id+"-result-";return id+=Utils.generateChars(4),null!=data.id?id+="-"+data.id.toString():id+="-"+Utils.generateChars(4),id},BaseAdapter}),S2.define("select2/data/select",["./base","../utils","jquery"],function(BaseAdapter,Utils,$){function SelectAdapter($element,options){this.$element=$element,this.options=options,SelectAdapter.__super__.constructor.call(this)}return Utils.Extend(SelectAdapter,BaseAdapter),SelectAdapter.prototype.current=function(callback){var data=[],self=this;this.$element.find(":selected").each(function(){var $option=$(this),option=self.item($option);data.push(option)}),callback(data)},SelectAdapter.prototype.select=function(data){var self=this;if(data.selected=!0,$(data.element).is("option"))return data.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(currentData){var val=[];data=[data],data.push.apply(data,currentData);for(var d=0;d<data.length;d++){var id=data[d].id;-1===$.inArray(id,val)&&val.push(id)}self.$element.val(val),self.$element.trigger("change")});else{var val=data.id;this.$element.val(val),this.$element.trigger("change")}},SelectAdapter.prototype.unselect=function(data){var self=this;if(this.$element.prop("multiple")){if(data.selected=!1,$(data.element).is("option"))return data.element.selected=!1,void this.$element.trigger("change");this.current(function(currentData){for(var val=[],d=0;d<currentData.length;d++){var id=currentData[d].id;id!==data.id&&-1===$.inArray(id,val)&&val.push(id)}self.$element.val(val),self.$element.trigger("change")})}},SelectAdapter.prototype.bind=function(container,$container){var self=this;this.container=container,container.on("select",function(params){self.select(params.data)}),container.on("unselect",function(params){self.unselect(params.data)})},SelectAdapter.prototype.destroy=function(){this.$element.find("*").each(function(){$.removeData(this,"data")})},SelectAdapter.prototype.query=function(params,callback){var data=[],self=this;this.$element.children().each(function(){var $option=$(this);if($option.is("option")||$option.is("optgroup")){var option=self.item($option),matches=self.matches(params,option);null!==matches&&data.push(matches)}}),callback({results:data})},SelectAdapter.prototype.addOptions=function($options){Utils.appendMany(this.$element,$options)},SelectAdapter.prototype.option=function(data){var option;data.children?(option=document.createElement("optgroup"),option.label=data.text):(option=document.createElement("option"),void 0!==option.textContent?option.textContent=data.text:option.innerText=data.text),void 0!==data.id&&(option.value=data.id),data.disabled&&(option.disabled=!0),data.selected&&(option.selected=!0),data.title&&(option.title=data.title);var $option=$(option),normalizedData=this._normalizeItem(data);return normalizedData.element=option,$.data(option,"data",normalizedData),$option},SelectAdapter.prototype.item=function($option){var data={};if(null!=(data=$.data($option[0],"data")))return data;if($option.is("option"))data={id:$option.val(),text:$option.text(),disabled:$option.prop("disabled"),selected:$option.prop("selected"),title:$option.prop("title")};else if($option.is("optgroup")){data={text:$option.prop("label"),children:[],title:$option.prop("title")};for(var $children=$option.children("option"),children=[],c=0;c<$children.length;c++){var $child=$($children[c]),child=this.item($child);children.push(child)}data.children=children}return data=this._normalizeItem(data),data.element=$option[0],$.data($option[0],"data",data),data},SelectAdapter.prototype._normalizeItem=function(item){$.isPlainObject(item)||(item={id:item,text:item}),item=$.extend({},{text:""},item);var defaults={selected:!1,disabled:!1};return null!=item.id&&(item.id=item.id.toString()),null!=item.text&&(item.text=item.text.toString()),null==item._resultId&&item.id&&null!=this.container&&(item._resultId=this.generateResultId(this.container,item)),$.extend({},defaults,item)},SelectAdapter.prototype.matches=function(params,data){return this.options.get("matcher")(params,data)},SelectAdapter}),S2.define("select2/data/array",["./select","../utils","jquery"],function(SelectAdapter,Utils,$){function ArrayAdapter($element,options){var data=options.get("data")||[];ArrayAdapter.__super__.constructor.call(this,$element,options),this.addOptions(this.convertToOptions(data))}return Utils.Extend(ArrayAdapter,SelectAdapter),ArrayAdapter.prototype.select=function(data){var $option=this.$element.find("option").filter(function(i,elm){return elm.value==data.id.toString()});0===$option.length&&($option=this.option(data),this.addOptions($option)),ArrayAdapter.__super__.select.call(this,data)},ArrayAdapter.prototype.convertToOptions=function(data){for(var self=this,$existing=this.$element.find("option"),existingIds=$existing.map(function(){return self.item($(this)).id}).get(),$options=[],d=0;d<data.length;d++){var item=this._normalizeItem(data[d]);if($.inArray(item.id,existingIds)>=0){var $existingOption=$existing.filter(function(item){return function(){return $(this).val()==item.id}}(item)),existingData=this.item($existingOption),newData=$.extend(!0,{},item,existingData),$newOption=this.option(newData);$existingOption.replaceWith($newOption)}else{var $option=this.option(item);if(item.children){var $children=this.convertToOptions(item.children);Utils.appendMany($option,$children)}$options.push($option)}}return $options},ArrayAdapter}),S2.define("select2/data/ajax",["./array","../utils","jquery"],function(ArrayAdapter,Utils,$){function AjaxAdapter($element,options){this.ajaxOptions=this._applyDefaults(options.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),AjaxAdapter.__super__.constructor.call(this,$element,options)}return Utils.Extend(AjaxAdapter,ArrayAdapter),AjaxAdapter.prototype._applyDefaults=function(options){var defaults={data:function(params){return $.extend({},params,{q:params.term})},transport:function(params,success,failure){var $request=$.ajax(params);return $request.then(success),$request.fail(failure),$request}};return $.extend({},defaults,options,!0)},AjaxAdapter.prototype.processResults=function(results){return results},AjaxAdapter.prototype.query=function(params,callback){function request(){var $request=options.transport(options,function(data){var results=self.processResults(data,params);self.options.get("debug")&&window.console&&console.error&&(results&&results.results&&$.isArray(results.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),callback(results)},function(){$request.status&&"0"===$request.status||self.trigger("results:message",{message:"errorLoading"})});self._request=$request}var self=this;null!=this._request&&($.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var options=$.extend({type:"GET"},this.ajaxOptions);"function"==typeof options.url&&(options.url=options.url.call(this.$element,params)),"function"==typeof options.data&&(options.data=options.data.call(this.$element,params)),this.ajaxOptions.delay&&null!=params.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(request,this.ajaxOptions.delay)):request()},AjaxAdapter}),S2.define("select2/data/tags",["jquery"],function($){function Tags(decorated,$element,options){var tags=options.get("tags"),createTag=options.get("createTag");void 0!==createTag&&(this.createTag=createTag);var insertTag=options.get("insertTag");if(void 0!==insertTag&&(this.insertTag=insertTag),decorated.call(this,$element,options),$.isArray(tags))for(var t=0;t<tags.length;t++){var tag=tags[t],item=this._normalizeItem(tag),$option=this.option(item);this.$element.append($option)}}return Tags.prototype.query=function(decorated,params,callback){function wrapper(obj,child){for(var data=obj.results,i=0;i<data.length;i++){var option=data[i],checkChildren=null!=option.children&&!wrapper({results:option.children},!0);if((option.text||"").toUpperCase()===(params.term||"").toUpperCase()||checkChildren)return!child&&(obj.data=data,void callback(obj))}if(child)return!0;var tag=self.createTag(params);if(null!=tag){var $option=self.option(tag);$option.attr("data-select2-tag",!0),self.addOptions([$option]),self.insertTag(data,tag)}obj.results=data,callback(obj)}var self=this;if(this._removeOldTags(),null==params.term||null!=params.page)return void decorated.call(this,params,callback);decorated.call(this,params,wrapper)},Tags.prototype.createTag=function(decorated,params){var term=$.trim(params.term);return""===term?null:{id:term,text:term}},Tags.prototype.insertTag=function(_,data,tag){data.unshift(tag)},Tags.prototype._removeOldTags=function(_){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||$(this).remove()})},Tags}),S2.define("select2/data/tokenizer",["jquery"],function($){function Tokenizer(decorated,$element,options){var tokenizer=options.get("tokenizer");void 0!==tokenizer&&(this.tokenizer=tokenizer),decorated.call(this,$element,options)}return Tokenizer.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container),this.$search=container.dropdown.$search||container.selection.$search||$container.find(".select2-search__field")},Tokenizer.prototype.query=function(decorated,params,callback){function createAndSelect(data){var item=self._normalizeItem(data);if(!self.$element.find("option").filter(function(){return $(this).val()===item.id}).length){var $option=self.option(item);$option.attr("data-select2-tag",!0),self._removeOldTags(),self.addOptions([$option])}select(item)}function select(data){self.trigger("select",{data:data})}var self=this;params.term=params.term||"";var tokenData=this.tokenizer(params,this.options,createAndSelect);tokenData.term!==params.term&&(this.$search.length&&(this.$search.val(tokenData.term),this.$search.focus()),params.term=tokenData.term),decorated.call(this,params,callback)},Tokenizer.prototype.tokenizer=function(_,params,options,callback){for(var separators=options.get("tokenSeparators")||[],term=params.term,i=0,createTag=this.createTag||function(params){return{id:params.term,text:params.term}};i<term.length;){var termChar=term[i];if(-1!==$.inArray(termChar,separators)){var part=term.substr(0,i),partParams=$.extend({},params,{term:part}),data=createTag(partParams);null!=data?(callback(data),term=term.substr(i+1)||"",i=0):i++}else i++}return{term:term}},Tokenizer}),S2.define("select2/data/minimumInputLength",[],function(){function MinimumInputLength(decorated,$e,options){this.minimumInputLength=options.get("minimumInputLength"),decorated.call(this,$e,options)}return MinimumInputLength.prototype.query=function(decorated,params,callback){if(params.term=params.term||"",params.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:params.term,params:params}});decorated.call(this,params,callback)},MinimumInputLength}),S2.define("select2/data/maximumInputLength",[],function(){function MaximumInputLength(decorated,$e,options){this.maximumInputLength=options.get("maximumInputLength"),decorated.call(this,$e,options)}return MaximumInputLength.prototype.query=function(decorated,params,callback){if(params.term=params.term||"",this.maximumInputLength>0&¶ms.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:params.term,params:params}});decorated.call(this,params,callback)},MaximumInputLength}),S2.define("select2/data/maximumSelectionLength",[],function(){function MaximumSelectionLength(decorated,$e,options){this.maximumSelectionLength=options.get("maximumSelectionLength"),decorated.call(this,$e,options)}return MaximumSelectionLength.prototype.query=function(decorated,params,callback){var self=this;this.current(function(currentData){var count=null!=currentData?currentData.length:0;if(self.maximumSelectionLength>0&&count>=self.maximumSelectionLength)return void self.trigger("results:message",{message:"maximumSelected",args:{maximum:self.maximumSelectionLength}});decorated.call(self,params,callback)})},MaximumSelectionLength}),S2.define("select2/dropdown",["jquery","./utils"],function($,Utils){function Dropdown($element,options){this.$element=$element,this.options=options,Dropdown.__super__.constructor.call(this)}return Utils.Extend(Dropdown,Utils.Observable),Dropdown.prototype.render=function(){var $dropdown=$('<span class="select2-dropdown"><span class="select2-results"></span></span>');return $dropdown.attr("dir",this.options.get("dir")),this.$dropdown=$dropdown,$dropdown},Dropdown.prototype.bind=function(){},Dropdown.prototype.position=function($dropdown,$container){},Dropdown.prototype.destroy=function(){this.$dropdown.remove()},Dropdown}),S2.define("select2/dropdown/search",["jquery","../utils"],function($,Utils){function Search(){}return Search.prototype.render=function(decorated){var $rendered=decorated.call(this),$search=$('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=$search,this.$search=$search.find("input"),$rendered.prepend($search),$rendered},Search.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),this.$search.on("keydown",function(evt){self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented()}),this.$search.on("input",function(evt){$(this).off("keyup")}),this.$search.on("keyup input",function(evt){self.handleSearch(evt)}),container.on("open",function(){self.$search.attr("tabindex",0),self.$search.focus(),window.setTimeout(function(){self.$search.focus()},0)}),container.on("close",function(){self.$search.attr("tabindex",-1),self.$search.val("")}),container.on("focus",function(){container.isOpen()||self.$search.focus()}),container.on("results:all",function(params){if(null==params.query.term||""===params.query.term){self.showSearch(params)?self.$searchContainer.removeClass("select2-search--hide"):self.$searchContainer.addClass("select2-search--hide")}})},Search.prototype.handleSearch=function(evt){if(!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=!1},Search.prototype.showSearch=function(_,params){return!0},Search}),S2.define("select2/dropdown/hidePlaceholder",[],function(){function HidePlaceholder(decorated,$element,options,dataAdapter){this.placeholder=this.normalizePlaceholder(options.get("placeholder")),decorated.call(this,$element,options,dataAdapter)}return HidePlaceholder.prototype.append=function(decorated,data){data.results=this.removePlaceholder(data.results),decorated.call(this,data)},HidePlaceholder.prototype.normalizePlaceholder=function(_,placeholder){return"string"==typeof placeholder&&(placeholder={id:"",text:placeholder}),placeholder},HidePlaceholder.prototype.removePlaceholder=function(_,data){for(var modifiedData=data.slice(0),d=data.length-1;d>=0;d--){var item=data[d];this.placeholder.id===item.id&&modifiedData.splice(d,1)}return modifiedData},HidePlaceholder}),S2.define("select2/dropdown/infiniteScroll",["jquery"],function($){function InfiniteScroll(decorated,$element,options,dataAdapter){this.lastParams={},decorated.call(this,$element,options,dataAdapter),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return InfiniteScroll.prototype.append=function(decorated,data){this.$loadingMore.remove(),this.loading=!1,decorated.call(this,data),this.showLoadingMore(data)&&this.$results.append(this.$loadingMore)},InfiniteScroll.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("query",function(params){self.lastParams=params,self.loading=!0}),container.on("query:append",function(params){self.lastParams=params,self.loading=!0}),this.$results.on("scroll",function(){var isLoadMoreVisible=$.contains(document.documentElement,self.$loadingMore[0]);if(!self.loading&&isLoadMoreVisible){self.$results.offset().top+self.$results.outerHeight(!1)+50>=self.$loadingMore.offset().top+self.$loadingMore.outerHeight(!1)&&self.loadMore()}})},InfiniteScroll.prototype.loadMore=function(){this.loading=!0;var params=$.extend({},{page:1},this.lastParams);params.page++,this.trigger("query:append",params)},InfiniteScroll.prototype.showLoadingMore=function(_,data){return data.pagination&&data.pagination.more},InfiniteScroll.prototype.createLoadingMore=function(){var $option=$('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),message=this.options.get("translations").get("loadingMore");return $option.html(message(this.lastParams)),$option},InfiniteScroll}),S2.define("select2/dropdown/attachBody",["jquery","../utils"],function($,Utils){function AttachBody(decorated,$element,options){this.$dropdownParent=options.get("dropdownParent")||$(document.body),decorated.call(this,$element,options)}return AttachBody.prototype.bind=function(decorated,container,$container){var self=this,setupResultsEvents=!1;decorated.call(this,container,$container),container.on("open",function(){self._showDropdown(),self._attachPositioningHandler(container),setupResultsEvents||(setupResultsEvents=!0,container.on("results:all",function(){self._positionDropdown(),self._resizeDropdown()}),container.on("results:append",function(){self._positionDropdown(),self._resizeDropdown()}))}),container.on("close",function(){self._hideDropdown(),self._detachPositioningHandler(container)}),this.$dropdownContainer.on("mousedown",function(evt){evt.stopPropagation()})},AttachBody.prototype.destroy=function(decorated){decorated.call(this),this.$dropdownContainer.remove()},AttachBody.prototype.position=function(decorated,$dropdown,$container){$dropdown.attr("class",$container.attr("class")),$dropdown.removeClass("select2"),$dropdown.addClass("select2-container--open"),$dropdown.css({position:"absolute",top:-999999}),this.$container=$container},AttachBody.prototype.render=function(decorated){var $container=$("<span></span>"),$dropdown=decorated.call(this);return $container.append($dropdown),this.$dropdownContainer=$container,$container},AttachBody.prototype._hideDropdown=function(decorated){this.$dropdownContainer.detach()},AttachBody.prototype._attachPositioningHandler=function(decorated,container){var self=this,scrollEvent="scroll.select2."+container.id,resizeEvent="resize.select2."+container.id,orientationEvent="orientationchange.select2."+container.id,$watchers=this.$container.parents().filter(Utils.hasScroll);$watchers.each(function(){$(this).data("select2-scroll-position",{x:$(this).scrollLeft(),y:$(this).scrollTop()})}),$watchers.on(scrollEvent,function(ev){var position=$(this).data("select2-scroll-position");$(this).scrollTop(position.y)}),$(window).on(scrollEvent+" "+resizeEvent+" "+orientationEvent,function(e){self._positionDropdown(),self._resizeDropdown()})},AttachBody.prototype._detachPositioningHandler=function(decorated,container){var scrollEvent="scroll.select2."+container.id,resizeEvent="resize.select2."+container.id,orientationEvent="orientationchange.select2."+container.id;this.$container.parents().filter(Utils.hasScroll).off(scrollEvent),$(window).off(scrollEvent+" "+resizeEvent+" "+orientationEvent)},AttachBody.prototype._positionDropdown=function(){var $window=$(window),isCurrentlyAbove=this.$dropdown.hasClass("select2-dropdown--above"),isCurrentlyBelow=this.$dropdown.hasClass("select2-dropdown--below"),newDirection=null,offset=this.$container.offset();offset.bottom=offset.top+this.$container.outerHeight(!1);var container={height:this.$container.outerHeight(!1)};container.top=offset.top,container.bottom=offset.top+container.height;var dropdown={height:this.$dropdown.outerHeight(!1)},viewport={top:$window.scrollTop(),bottom:$window.scrollTop()+$window.height()},enoughRoomAbove=viewport.top<offset.top-dropdown.height,enoughRoomBelow=viewport.bottom>offset.bottom+dropdown.height,css={left:offset.left,top:container.bottom},$offsetParent=this.$dropdownParent;"static"===$offsetParent.css("position")&&($offsetParent=$offsetParent.offsetParent());var parentOffset=$offsetParent.offset();css.top-=parentOffset.top,css.left-=parentOffset.left,isCurrentlyAbove||isCurrentlyBelow||(newDirection="below"),enoughRoomBelow||!enoughRoomAbove||isCurrentlyAbove?!enoughRoomAbove&&enoughRoomBelow&&isCurrentlyAbove&&(newDirection="below"):newDirection="above",("above"==newDirection||isCurrentlyAbove&&"below"!==newDirection)&&(css.top=container.top-parentOffset.top-dropdown.height),null!=newDirection&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+newDirection),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+newDirection)),this.$dropdownContainer.css(css)},AttachBody.prototype._resizeDropdown=function(){var css={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(css.minWidth=css.width,css.position="relative",css.width="auto"),this.$dropdown.css(css)},AttachBody.prototype._showDropdown=function(decorated){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},AttachBody}),S2.define("select2/dropdown/minimumResultsForSearch",[],function(){function countResults(data){for(var count=0,d=0;d<data.length;d++){var item=data[d];item.children?count+=countResults(item.children):count++}return count}function MinimumResultsForSearch(decorated,$element,options,dataAdapter){this.minimumResultsForSearch=options.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),decorated.call(this,$element,options,dataAdapter)}return MinimumResultsForSearch.prototype.showSearch=function(decorated,params){return!(countResults(params.data.results)<this.minimumResultsForSearch)&&decorated.call(this,params)},MinimumResultsForSearch}),S2.define("select2/dropdown/selectOnClose",[],function(){function SelectOnClose(){}return SelectOnClose.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("close",function(params){self._handleSelectOnClose(params)})},SelectOnClose.prototype._handleSelectOnClose=function(_,params){if(params&&null!=params.originalSelect2Event){var event=params.originalSelect2Event;if("select"===event._type||"unselect"===event._type)return}var $highlightedResults=this.getHighlightedResults();if(!($highlightedResults.length<1)){var data=$highlightedResults.data("data");null!=data.element&&data.element.selected||null==data.element&&data.selected||this.trigger("select",{data:data})}},SelectOnClose}),S2.define("select2/dropdown/closeOnSelect",[],function(){function CloseOnSelect(){}return CloseOnSelect.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("select",function(evt){self._selectTriggered(evt)}),container.on("unselect",function(evt){self._selectTriggered(evt)})},CloseOnSelect.prototype._selectTriggered=function(_,evt){var originalEvent=evt.originalEvent;originalEvent&&originalEvent.ctrlKey||this.trigger("close",{originalEvent:originalEvent,originalSelect2Event:evt})},CloseOnSelect}),S2.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(args){var overChars=args.input.length-args.maximum,message="Please delete "+overChars+" character";return 1!=overChars&&(message+="s"),message},inputTooShort:function(args){return"Please enter "+(args.minimum-args.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(args){var message="You can only select "+args.maximum+" item";return 1!=args.maximum&&(message+="s"),message},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),S2.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function($,require,ResultsList,SingleSelection,MultipleSelection,Placeholder,AllowClear,SelectionSearch,EventRelay,Utils,Translation,DIACRITICS,SelectData,ArrayData,AjaxData,Tags,Tokenizer,MinimumInputLength,MaximumInputLength,MaximumSelectionLength,Dropdown,DropdownSearch,HidePlaceholder,InfiniteScroll,AttachBody,MinimumResultsForSearch,SelectOnClose,CloseOnSelect,EnglishTranslation){function Defaults(){this.reset()}return Defaults.prototype.apply=function(options){if(options=$.extend(!0,{},this.defaults,options),null==options.dataAdapter){if(null!=options.ajax?options.dataAdapter=AjaxData:null!=options.data?options.dataAdapter=ArrayData:options.dataAdapter=SelectData,options.minimumInputLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MinimumInputLength)),options.maximumInputLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumInputLength)),options.maximumSelectionLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumSelectionLength)),options.tags&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,Tags)),null==options.tokenSeparators&&null==options.tokenizer||(options.dataAdapter=Utils.Decorate(options.dataAdapter,Tokenizer)),null!=options.query){var Query=require(options.amdBase+"compat/query");options.dataAdapter=Utils.Decorate(options.dataAdapter,Query)}if(null!=options.initSelection){var InitSelection=require(options.amdBase+"compat/initSelection");options.dataAdapter=Utils.Decorate(options.dataAdapter,InitSelection)}}if(null==options.resultsAdapter&&(options.resultsAdapter=ResultsList,null!=options.ajax&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,InfiniteScroll)),null!=options.placeholder&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,HidePlaceholder)),options.selectOnClose&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,SelectOnClose))),null==options.dropdownAdapter){if(options.multiple)options.dropdownAdapter=Dropdown;else{var SearchableDropdown=Utils.Decorate(Dropdown,DropdownSearch);options.dropdownAdapter=SearchableDropdown}if(0!==options.minimumResultsForSearch&&(options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,MinimumResultsForSearch)),options.closeOnSelect&&(options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,CloseOnSelect)),null!=options.dropdownCssClass||null!=options.dropdownCss||null!=options.adaptDropdownCssClass){var DropdownCSS=require(options.amdBase+"compat/dropdownCss");options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,DropdownCSS)}options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,AttachBody)}if(null==options.selectionAdapter){if(options.multiple?options.selectionAdapter=MultipleSelection:options.selectionAdapter=SingleSelection,null!=options.placeholder&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,Placeholder)),options.allowClear&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,AllowClear)),options.multiple&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,SelectionSearch)),null!=options.containerCssClass||null!=options.containerCss||null!=options.adaptContainerCssClass){var ContainerCSS=require(options.amdBase+"compat/containerCss");options.selectionAdapter=Utils.Decorate(options.selectionAdapter,ContainerCSS)}options.selectionAdapter=Utils.Decorate(options.selectionAdapter,EventRelay)}if("string"==typeof options.language)if(options.language.indexOf("-")>0){var languageParts=options.language.split("-"),baseLanguage=languageParts[0];options.language=[options.language,baseLanguage]}else options.language=[options.language];if($.isArray(options.language)){var languages=new Translation;options.language.push("en");for(var languageNames=options.language,l=0;l<languageNames.length;l++){var name=languageNames[l],language={};try{language=Translation.loadPath(name)}catch(e){try{name=this.defaults.amdLanguageBase+name,language=Translation.loadPath(name)}catch(ex){options.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+name+'" could not be automatically loaded. A fallback will be used instead.');continue}}languages.extend(language)}options.translations=languages}else{var baseTranslation=Translation.loadPath(this.defaults.amdLanguageBase+"en"),customTranslation=new Translation(options.language);customTranslation.extend(baseTranslation),options.translations=customTranslation}return options},Defaults.prototype.reset=function(){function stripDiacritics(text){function match(a){return DIACRITICS[a]||a}return text.replace(/[^\u0000-\u007E]/g,match)}function matcher(params,data){if(""===$.trim(params.term))return data;if(data.children&&data.children.length>0){for(var match=$.extend(!0,{},data),c=data.children.length-1;c>=0;c--){null==matcher(params,data.children[c])&&match.children.splice(c,1)}return match.children.length>0?match:matcher(params,match)}var original=stripDiacritics(data.text).toUpperCase(),term=stripDiacritics(params.term).toUpperCase();return original.indexOf(term)>-1?data:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:Utils.escapeMarkup,language:EnglishTranslation,matcher:matcher,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(data){return data},templateResult:function(result){return result.text},templateSelection:function(selection){return selection.text},theme:"default",width:"resolve"}},Defaults.prototype.set=function(key,value){var camelKey=$.camelCase(key),data={};data[camelKey]=value;var convertedData=Utils._convertData(data);$.extend(this.defaults,convertedData)},new Defaults}),S2.define("select2/options",["require","jquery","./defaults","./utils"],function(require,$,Defaults,Utils){function Options(options,$element){if(this.options=options,null!=$element&&this.fromElement($element),this.options=Defaults.apply(this.options),$element&&$element.is("input")){var InputCompat=require(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=Utils.Decorate(this.options.dataAdapter,InputCompat)}}return Options.prototype.fromElement=function($e){var excludedData=["select2"];null==this.options.multiple&&(this.options.multiple=$e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=$e.prop("disabled")),null==this.options.language&&($e.prop("lang")?this.options.language=$e.prop("lang").toLowerCase():$e.closest("[lang]").prop("lang")&&(this.options.language=$e.closest("[lang]").prop("lang"))),null==this.options.dir&&($e.prop("dir")?this.options.dir=$e.prop("dir"):$e.closest("[dir]").prop("dir")?this.options.dir=$e.closest("[dir]").prop("dir"):this.options.dir="ltr"),$e.prop("disabled",this.options.disabled),$e.prop("multiple",this.options.multiple),$e.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),$e.data("data",$e.data("select2Tags")),$e.data("tags",!0)),$e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),$e.attr("ajax--url",$e.data("ajaxUrl")),$e.data("ajax--url",$e.data("ajaxUrl")));var dataset={};dataset=$.fn.jquery&&"1."==$.fn.jquery.substr(0,2)&&$e[0].dataset?$.extend(!0,{},$e[0].dataset,$e.data()):$e.data();var data=$.extend(!0,{},dataset);data=Utils._convertData(data);for(var key in data)$.inArray(key,excludedData)>-1||($.isPlainObject(this.options[key])?$.extend(this.options[key],data[key]):this.options[key]=data[key]);return this},Options.prototype.get=function(key){return this.options[key]},Options.prototype.set=function(key,val){this.options[key]=val},Options}),S2.define("select2/core",["jquery","./options","./utils","./keys"],function($,Options,Utils,KEYS){var Select2=function($element,options){null!=$element.data("select2")&&$element.data("select2").destroy(),this.$element=$element,this.id=this._generateId($element),options=options||{},this.options=new Options(options,$element),Select2.__super__.constructor.call(this);var tabindex=$element.attr("tabindex")||0;$element.data("old-tabindex",tabindex),$element.attr("tabindex","-1");var DataAdapter=this.options.get("dataAdapter");this.dataAdapter=new DataAdapter($element,this.options);var $container=this.render();this._placeContainer($container);var SelectionAdapter=this.options.get("selectionAdapter");this.selection=new SelectionAdapter($element,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,$container);var DropdownAdapter=this.options.get("dropdownAdapter");this.dropdown=new DropdownAdapter($element,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,$container);var ResultsAdapter=this.options.get("resultsAdapter");this.results=new ResultsAdapter($element,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var self=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(initialData){self.trigger("selection:update",{data:initialData})}),$element.addClass("select2-hidden-accessible"),$element.attr("aria-hidden","true"),this._syncAttributes(),$element.data("select2",this)};return Utils.Extend(Select2,Utils.Observable),Select2.prototype._generateId=function($element){var id="";return id=null!=$element.attr("id")?$element.attr("id"):null!=$element.attr("name")?$element.attr("name")+"-"+Utils.generateChars(2):Utils.generateChars(4),id=id.replace(/(:|\.|\[|\]|,)/g,""),id="select2-"+id},Select2.prototype._placeContainer=function($container){$container.insertAfter(this.$element);var width=this._resolveWidth(this.$element,this.options.get("width"));null!=width&&$container.css("width",width)},Select2.prototype._resolveWidth=function($element,method){var WIDTH=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==method){var styleWidth=this._resolveWidth($element,"style");return null!=styleWidth?styleWidth:this._resolveWidth($element,"element")}if("element"==method){var elementWidth=$element.outerWidth(!1);return elementWidth<=0?"auto":elementWidth+"px"}if("style"==method){var style=$element.attr("style");if("string"!=typeof style)return null;for(var attrs=style.split(";"),i=0,l=attrs.length;i<l;i+=1){var attr=attrs[i].replace(/\s/g,""),matches=attr.match(WIDTH);if(null!==matches&&matches.length>=1)return matches[1]}return null}return method},Select2.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},Select2.prototype._registerDomEvents=function(){var self=this;this.$element.on("change.select2",function(){self.dataAdapter.current(function(data){self.trigger("selection:update",{data:data})})}),this.$element.on("focus.select2",function(evt){self.trigger("focus",evt)}),this._syncA=Utils.bind(this._syncAttributes,this),this._syncS=Utils.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=observer?(this._observer=new observer(function(mutations){$.each(mutations,self._syncA),$.each(mutations,self._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",self._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",self._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",self._syncS,!1))},Select2.prototype._registerDataEvents=function(){var self=this;this.dataAdapter.on("*",function(name,params){self.trigger(name,params)})},Select2.prototype._registerSelectionEvents=function(){var self=this,nonRelayEvents=["toggle","focus"];this.selection.on("toggle",function(){self.toggleDropdown()}),this.selection.on("focus",function(params){self.focus(params)}),this.selection.on("*",function(name,params){-1===$.inArray(name,nonRelayEvents)&&self.trigger(name,params)})},Select2.prototype._registerDropdownEvents=function(){var self=this;this.dropdown.on("*",function(name,params){self.trigger(name,params)})},Select2.prototype._registerResultsEvents=function(){var self=this;this.results.on("*",function(name,params){self.trigger(name,params)})},Select2.prototype._registerEvents=function(){var self=this;this.on("open",function(){self.$container.addClass("select2-container--open")}),this.on("close",function(){self.$container.removeClass("select2-container--open")}),this.on("enable",function(){self.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){self.$container.addClass("select2-container--disabled")}),this.on("blur",function(){self.$container.removeClass("select2-container--focus")}),this.on("query",function(params){self.isOpen()||self.trigger("open",{}),this.dataAdapter.query(params,function(data){self.trigger("results:all",{data:data,query:params})})}),this.on("query:append",function(params){this.dataAdapter.query(params,function(data){self.trigger("results:append",{data:data,query:params})})}),this.on("keypress",function(evt){var key=evt.which;self.isOpen()?key===KEYS.ESC||key===KEYS.TAB||key===KEYS.UP&&evt.altKey?(self.close(),evt.preventDefault()):key===KEYS.ENTER?(self.trigger("results:select",{}),evt.preventDefault()):key===KEYS.SPACE&&evt.ctrlKey?(self.trigger("results:toggle",{}),evt.preventDefault()):key===KEYS.UP?(self.trigger("results:previous",{}),evt.preventDefault()):key===KEYS.DOWN&&(self.trigger("results:next",{}),evt.preventDefault()):(key===KEYS.ENTER||key===KEYS.SPACE||key===KEYS.DOWN&&evt.altKey)&&(self.open(),evt.preventDefault())})},Select2.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},Select2.prototype._syncSubtree=function(evt,mutations){var changed=!1,self=this;if(!evt||!evt.target||"OPTION"===evt.target.nodeName||"OPTGROUP"===evt.target.nodeName){if(mutations)if(mutations.addedNodes&&mutations.addedNodes.length>0)for(var n=0;n<mutations.addedNodes.length;n++){var node=mutations.addedNodes[n];node.selected&&(changed=!0)}else mutations.removedNodes&&mutations.removedNodes.length>0&&(changed=!0);else changed=!0;changed&&this.dataAdapter.current(function(currentData){self.trigger("selection:update",{data:currentData})})}},Select2.prototype.trigger=function(name,args){var actualTrigger=Select2.__super__.trigger,preTriggerMap={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===args&&(args={}),name in preTriggerMap){var preTriggerName=preTriggerMap[name],preTriggerArgs={prevented:!1,name:name,args:args};if(actualTrigger.call(this,preTriggerName,preTriggerArgs),preTriggerArgs.prevented)return void(args.prevented=!0)}actualTrigger.call(this,name,args)},Select2.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},Select2.prototype.open=function(){this.isOpen()||this.trigger("query",{})},Select2.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},Select2.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},Select2.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},Select2.prototype.focus=function(data){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},Select2.prototype.enable=function(args){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=args&&0!==args.length||(args=[!0]);var disabled=!args[0];this.$element.prop("disabled",disabled)},Select2.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var data=[];return this.dataAdapter.current(function(currentData){data=currentData}),data},Select2.prototype.val=function(args){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==args||0===args.length)return this.$element.val();var newVal=args[0];$.isArray(newVal)&&(newVal=$.map(newVal,function(obj){return obj.toString()})),this.$element.val(newVal).trigger("change")},Select2.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},Select2.prototype.render=function(){var $container=$('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return $container.attr("dir",this.options.get("dir")),this.$container=$container,this.$container.addClass("select2-container--"+this.options.get("theme")),$container.data("element",this.$element),$container},Select2}),S2.define("jquery-mousewheel",["jquery"],function($){return $}),S2.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function($,_,Select2,Defaults){if(null==$.fn.select2){var thisMethods=["open","close","destroy"];$.fn.select2=function(options){if("object"==typeof(options=options||{}))return this.each(function(){var instanceOptions=$.extend(!0,{},options);new Select2($(this),instanceOptions)}),this;if("string"==typeof options){var ret,args=Array.prototype.slice.call(arguments,1);return this.each(function(){var instance=$(this).data("select2");null==instance&&window.console&&console.error&&console.error("The select2('"+options+"') method was called on an element that is not using Select2."),ret=instance[options].apply(instance,args)}),$.inArray(options,thisMethods)>-1?this:ret}throw new Error("Invalid arguments for Select2: "+options)}}return null==$.fn.select2.defaults&&($.fn.select2.defaults=Defaults),Select2}),{define:S2.define,require:S2.require}}(),select2=S2.require("jquery.select2");return jQuery.fn.select2.amd=S2,select2})},function(module,__webpack_exports__,__webpack_require__){"use strict";function _objectWithoutProperties(obj,keys){var target={};for(var i in obj)keys.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var __WEBPACK_IMPORTED_MODULE_0_react__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_react___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__),__WEBPACK_IMPORTED_MODULE_1_prop_types__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_1_prop_types___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__),__WEBPACK_IMPORTED_MODULE_2_invariant__=__webpack_require__(182),__WEBPACK_IMPORTED_MODULE_2_invariant___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_invariant__),__WEBPACK_IMPORTED_MODULE_3_history__=__webpack_require__(30),_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},isModifiedEvent=function(event){return!!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)},Link=function(_React$Component){function Link(){var _temp,_this,_ret;_classCallCheck(this,Link);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,_React$Component.call.apply(_React$Component,[this].concat(args))),_this.handleClick=function(event){if(_this.props.onClick&&_this.props.onClick(event),!event.defaultPrevented&&0===event.button&&!_this.props.target&&!isModifiedEvent(event)){event.preventDefault();var history=_this.context.router.history,_this$props=_this.props,replace=_this$props.replace,to=_this$props.to;replace?history.replace(to):history.push(to)}},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(Link,_React$Component),Link.prototype.render=function(){var _props=this.props,to=(_props.replace,_props.to),innerRef=_props.innerRef,props=_objectWithoutProperties(_props,["replace","to","innerRef"]);__WEBPACK_IMPORTED_MODULE_2_invariant___default()(this.context.router,"You should not use <Link> outside a <Router>"),__WEBPACK_IMPORTED_MODULE_2_invariant___default()(void 0!==to,'You must specify the "to" property');var history=this.context.router.history,location="string"==typeof to?Object(__WEBPACK_IMPORTED_MODULE_3_history__.createLocation)(to,null,null,history.location):to,href=history.createHref(location);return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a",_extends({},props,{onClick:this.handleClick,href:href,ref:innerRef}))},Link}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);Link.propTypes={onClick:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,target:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,replace:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,to:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired,innerRef:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func])},Link.defaultProps={replace:!1},Link.contextTypes={router:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({history:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({push:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,replace:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,createHref:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired}).isRequired}).isRequired},__webpack_exports__.a=Link},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Route__=__webpack_require__(287);__webpack_exports__.a=__WEBPACK_IMPORTED_MODULE_0_react_router_es_Route__.a},function(module,__webpack_exports__,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var __WEBPACK_IMPORTED_MODULE_0_warning__=__webpack_require__(15),__WEBPACK_IMPORTED_MODULE_0_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__),__WEBPACK_IMPORTED_MODULE_1_invariant__=__webpack_require__(14),__WEBPACK_IMPORTED_MODULE_1_invariant___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__),__WEBPACK_IMPORTED_MODULE_2_react__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_2_react___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__),__WEBPACK_IMPORTED_MODULE_3_prop_types__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_3_prop_types___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__),__WEBPACK_IMPORTED_MODULE_4__matchPath__=__webpack_require__(266),_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},isEmptyChildren=function(children){return 0===__WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children)},Route=function(_React$Component){function Route(){var _temp,_this,_ret;_classCallCheck(this,Route);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,_React$Component.call.apply(_React$Component,[this].concat(args))),_this.state={match:_this.computeMatch(_this.props,_this.context.router)},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(Route,_React$Component),Route.prototype.getChildContext=function(){return{router:_extends({},this.context.router,{route:{location:this.props.location||this.context.router.route.location,match:this.state.match}})}},Route.prototype.computeMatch=function(_ref,router){var computedMatch=_ref.computedMatch,location=_ref.location,path=_ref.path,strict=_ref.strict,exact=_ref.exact,sensitive=_ref.sensitive;if(computedMatch)return computedMatch;__WEBPACK_IMPORTED_MODULE_1_invariant___default()(router,"You should not use <Route> or withRouter() outside a <Router>");var route=router.route,pathname=(location||route.location).pathname;return Object(__WEBPACK_IMPORTED_MODULE_4__matchPath__.a)(pathname,{path:path,strict:strict,exact:exact,sensitive:sensitive},route.match)},Route.prototype.componentWillMount=function(){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.component&&this.props.render),"You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored"),__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.component&&this.props.children&&!isEmptyChildren(this.props.children)),"You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored"),__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.render&&this.props.children&&!isEmptyChildren(this.props.children)),"You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored")},Route.prototype.componentWillReceiveProps=function(nextProps,nextContext){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(nextProps.location&&!this.props.location),'<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(!nextProps.location&&this.props.location),'<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'),this.setState({match:this.computeMatch(nextProps,nextContext.router)})},Route.prototype.render=function(){var match=this.state.match,_props=this.props,children=_props.children,component=_props.component,render=_props.render,_context$router=this.context.router,history=_context$router.history,route=_context$router.route,staticContext=_context$router.staticContext,location=this.props.location||route.location,props={match:match,location:location,history:history,staticContext:staticContext};return component?match?__WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(component,props):null:render?match?render(props):null:"function"==typeof children?children(props):children&&!isEmptyChildren(children)?__WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(children):null},Route}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);Route.propTypes={computedMatch:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object,path:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,exact:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,strict:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,sensitive:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,component:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,render:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,children:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node]),location:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object},Route.contextTypes={router:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.shape({history:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,route:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,staticContext:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object})},Route.childContextTypes={router:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired},__webpack_exports__.a=Route},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__=__webpack_require__(186),__WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__),patternCache={},cacheCount=0,compileGenerator=function(pattern){var cacheKey=pattern,cache=patternCache[cacheKey]||(patternCache[cacheKey]={});if(cache[pattern])return cache[pattern];var compiledGenerator=__WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default.a.compile(pattern);return cacheCount<1e4&&(cache[pattern]=compiledGenerator,cacheCount++),compiledGenerator},generatePath=function(){var pattern=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",params=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"/"===pattern?pattern:compileGenerator(pattern)(params,{pretty:!0})};__webpack_exports__.a=generatePath},function(module,exports,__webpack_require__){"use strict";(function(global){global.MailPoetLib||(global.MailPoetLib={}),module.exports=global.MailPoetLib.StatsBadge=__webpack_require__(377)}).call(exports,__webpack_require__(6))},function(module,exports,__webpack_require__){"use strict";(function(global){global.MailPoetLib||(global.MailPoetLib={}),module.exports=global.MailPoetLib.AutomaticEmailEventsList=__webpack_require__(386)}).call(exports,__webpack_require__(6))},function(module,exports,__webpack_require__){"use strict";(function(global){global.MailPoetLib||(global.MailPoetLib={}),module.exports=global.MailPoetLib.AutomaticEmailsBreadcrumb=__webpack_require__(387)}).call(exports,__webpack_require__(6))},,,function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.fromNewsletter=exports.fromUrl=exports.fromDom=void 0;var _underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_html2canvas=__webpack_require__(409),_html2canvas2=_interopRequireDefault(_html2canvas),fromDom=exports.fromDom=function(element){return(0,_html2canvas2.default)(element,{logging:!1}).then(function(canvas){return canvas.toDataURL("image/jpeg")})},fromUrl=exports.fromUrl=function(url){return new Promise(function(resolve,reject){var iframe=document.createElement("iframe"),protocol=location.href.startsWith("https://")?"https:":"http:";iframe.src=protocol+url.replace(/^https?:/,""),iframe.style.opacity=0,iframe.scrolling="no",iframe.onload=function(){fromDom(iframe.contentDocument.documentElement).then(function(image){document.body.removeChild(iframe),resolve(image)}).catch(function(){document.body.removeChild(iframe),reject(_mailpoet2.default.I18n.t("errorWhileTakingScreenshot"))})};var onError=function(){document.body.removeChild(iframe),reject(_mailpoet2.default.I18n.t("errorWhileTakingScreenshot"))};iframe.onerror=onError,iframe.onError=onError,iframe.className="mailpoet_template_iframe";try{document.body.appendChild(iframe)}catch(err){onError()}})};exports.fromNewsletter=function(data){return new Promise(function(resolve,reject){var json=data;_underscore2.default.isUndefined(json.body)||(json.body=JSON.stringify(json.body)),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"showPreview",data:json}).done(function(response){return fromUrl(response.meta.preview_url).then(resolve).catch(reject)}).fail(function(response){return reject(response.errors)})})}},,,,,,,,,,,function(module,exports,__webpack_require__){__webpack_require__(1),__webpack_require__(11),__webpack_require__(306),__webpack_require__(22),__webpack_require__(3),__webpack_require__(8),__webpack_require__(187),__webpack_require__(23),__webpack_require__(289),__webpack_require__(21),__webpack_require__(172),__webpack_require__(173),__webpack_require__(174),__webpack_require__(290),__webpack_require__(291),module.exports=__webpack_require__(268)},function(module,exports,__webpack_require__){(function(global){global.MailPoetLib||(global.MailPoetLib={}),module.exports=global.MailPoetLib.ReactRouter=__webpack_require__(307)}).call(exports,__webpack_require__(6))},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.__esModule=!0,exports.withRouter=exports.matchPath=exports.generatePath=exports.Switch=exports.StaticRouter=exports.Router=exports.Route=exports.Redirect=exports.Prompt=exports.NavLink=exports.MemoryRouter=exports.Link=exports.HashRouter=exports.BrowserRouter=void 0;var _BrowserRouter2=__webpack_require__(308),_BrowserRouter3=_interopRequireDefault(_BrowserRouter2),_HashRouter2=__webpack_require__(312),_HashRouter3=_interopRequireDefault(_HashRouter2),_Link2=__webpack_require__(275),_Link3=_interopRequireDefault(_Link2),_MemoryRouter2=__webpack_require__(313),_MemoryRouter3=_interopRequireDefault(_MemoryRouter2),_NavLink2=__webpack_require__(318),_NavLink3=_interopRequireDefault(_NavLink2),_Prompt2=__webpack_require__(320),_Prompt3=_interopRequireDefault(_Prompt2),_Redirect2=__webpack_require__(322),_Redirect3=_interopRequireDefault(_Redirect2),_Route2=__webpack_require__(277),_Route3=_interopRequireDefault(_Route2),_Router2=__webpack_require__(259),_Router3=_interopRequireDefault(_Router2),_StaticRouter2=__webpack_require__(324),_StaticRouter3=_interopRequireDefault(_StaticRouter2),_Switch2=__webpack_require__(326),_Switch3=_interopRequireDefault(_Switch2),_generatePath2=__webpack_require__(328),_generatePath3=_interopRequireDefault(_generatePath2),_matchPath2=__webpack_require__(329),_matchPath3=_interopRequireDefault(_matchPath2),_withRouter2=__webpack_require__(330),_withRouter3=_interopRequireDefault(_withRouter2);exports.BrowserRouter=_BrowserRouter3.default,exports.HashRouter=_HashRouter3.default,exports.Link=_Link3.default,exports.MemoryRouter=_MemoryRouter3.default,exports.NavLink=_NavLink3.default,exports.Prompt=_Prompt3.default,exports.Redirect=_Redirect3.default,exports.Route=_Route3.default,exports.Router=_Router3.default,exports.StaticRouter=_StaticRouter3.default,exports.Switch=_Switch3.default,exports.generatePath=_generatePath3.default,exports.matchPath=_matchPath3.default,exports.withRouter=_withRouter3.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _warning=__webpack_require__(180),_warning2=_interopRequireDefault(_warning),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_history=__webpack_require__(30),_Router=__webpack_require__(259),_Router2=_interopRequireDefault(_Router),BrowserRouter=function(_React$Component){function BrowserRouter(){var _temp,_this,_ret;_classCallCheck(this,BrowserRouter);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,_React$Component.call.apply(_React$Component,[this].concat(args))),_this.history=(0,_history.createBrowserHistory)(_this.props),_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(BrowserRouter,_React$Component),BrowserRouter.prototype.componentWillMount=function(){(0,_warning2.default)(!this.props.history,"<BrowserRouter> ignores the history prop. To use a custom history, use `import { Router }` instead of `import { BrowserRouter as Router }`.")},BrowserRouter.prototype.render=function(){return _react2.default.createElement(_Router2.default,{history:this.history,children:this.props.children})},BrowserRouter}(_react2.default.Component);BrowserRouter.propTypes={basename:_propTypes2.default.string,forceRefresh:_propTypes2.default.bool,getUserConfirmation:_propTypes2.default.func,keyLength:_propTypes2.default.number,children:_propTypes2.default.node},exports.default=BrowserRouter},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_warning__=__webpack_require__(181),__WEBPACK_IMPORTED_MODULE_0_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__),__WEBPACK_IMPORTED_MODULE_1_invariant__=__webpack_require__(182),__WEBPACK_IMPORTED_MODULE_1_invariant___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__),__WEBPACK_IMPORTED_MODULE_2__LocationUtils__=__webpack_require__(183),__WEBPACK_IMPORTED_MODULE_3__PathUtils__=__webpack_require__(170),__WEBPACK_IMPORTED_MODULE_4__createTransitionManager__=__webpack_require__(258),__WEBPACK_IMPORTED_MODULE_5__DOMUtils__=__webpack_require__(274),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},getHistoryState=function(){try{return window.history.state||{}}catch(e){return{}}},createBrowserHistory=function(){var props=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};__WEBPACK_IMPORTED_MODULE_1_invariant___default()(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.b,"Browser history needs a DOM");var globalHistory=window.history,canUseHistory=Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.g)(),needsHashChangeListener=!Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.h)(),_props$forceRefresh=props.forceRefresh,forceRefresh=void 0!==_props$forceRefresh&&_props$forceRefresh,_props$getUserConfirm=props.getUserConfirmation,getUserConfirmation=void 0===_props$getUserConfirm?__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.c:_props$getUserConfirm,_props$keyLength=props.keyLength,keyLength=void 0===_props$keyLength?6:_props$keyLength,basename=props.basename?Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.g)(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.a)(props.basename)):"",getDOMLocation=function(historyState){var _ref=historyState||{},key=_ref.key,state=_ref.state,_window$location=window.location,pathname=_window$location.pathname,search=_window$location.search,hash=_window$location.hash,path=pathname+search+hash;return __WEBPACK_IMPORTED_MODULE_0_warning___default()(!basename||Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.c)(path,basename),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+path+'" to begin with "'+basename+'".'),basename&&(path=Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.e)(path,basename)),Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,state,key)},createKey=function(){return Math.random().toString(36).substr(2,keyLength)},transitionManager=Object(__WEBPACK_IMPORTED_MODULE_4__createTransitionManager__.a)(),setState=function(nextState){_extends(history,nextState),history.length=globalHistory.length,transitionManager.notifyListeners(history.location,history.action)},handlePopState=function(event){Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.d)(event)||handlePop(getDOMLocation(event.state))},handleHashChange=function(){handlePop(getDOMLocation(getHistoryState()))},forceNextPop=!1,handlePop=function(location){if(forceNextPop)forceNextPop=!1,setState();else{transitionManager.confirmTransitionTo(location,"POP",getUserConfirmation,function(ok){ok?setState({action:"POP",location:location}):revertPop(location)})}},revertPop=function(fromLocation){var toLocation=history.location,toIndex=allKeys.indexOf(toLocation.key);-1===toIndex&&(toIndex=0);var fromIndex=allKeys.indexOf(fromLocation.key);-1===fromIndex&&(fromIndex=0);var delta=toIndex-fromIndex;delta&&(forceNextPop=!0,go(delta))},initialLocation=getDOMLocation(getHistoryState()),allKeys=[initialLocation.key],createHref=function(location){return basename+Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(location)},push=function(path,state){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!("object"===(void 0===path?"undefined":_typeof(path))&&void 0!==path.state&&void 0!==state),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var location=Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,"PUSH",getUserConfirmation,function(ok){if(ok){var href=createHref(location),key=location.key,state=location.state;if(canUseHistory)if(globalHistory.pushState({key:key,state:state},null,href),forceRefresh)window.location.href=href;else{var prevIndex=allKeys.indexOf(history.location.key),nextKeys=allKeys.slice(0,-1===prevIndex?0:prevIndex+1);nextKeys.push(location.key),allKeys=nextKeys,setState({action:"PUSH",location:location})}else __WEBPACK_IMPORTED_MODULE_0_warning___default()(void 0===state,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=href}})},replace=function(path,state){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!("object"===(void 0===path?"undefined":_typeof(path))&&void 0!==path.state&&void 0!==state),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var location=Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,"REPLACE",getUserConfirmation,function(ok){if(ok){var href=createHref(location),key=location.key,state=location.state;if(canUseHistory)if(globalHistory.replaceState({key:key,state:state},null,href),forceRefresh)window.location.replace(href);else{var prevIndex=allKeys.indexOf(history.location.key);-1!==prevIndex&&(allKeys[prevIndex]=location.key),setState({action:"REPLACE",location:location})}else __WEBPACK_IMPORTED_MODULE_0_warning___default()(void 0===state,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(href)}})},go=function(n){globalHistory.go(n)},goBack=function(){return go(-1)},goForward=function(){return go(1)},listenerCount=0,checkDOMListeners=function(delta){listenerCount+=delta,1===listenerCount?(Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.a)(window,"popstate",handlePopState),needsHashChangeListener&&Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.a)(window,"hashchange",handleHashChange)):0===listenerCount&&(Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.e)(window,"popstate",handlePopState),needsHashChangeListener&&Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.e)(window,"hashchange",handleHashChange))},isBlocked=!1,block=function(){var prompt=arguments.length>0&&void 0!==arguments[0]&&arguments[0],unblock=transitionManager.setPrompt(prompt);return isBlocked||(checkDOMListeners(1),isBlocked=!0),function(){return isBlocked&&(isBlocked=!1,checkDOMListeners(-1)),unblock()}},listen=function(listener){var unlisten=transitionManager.appendListener(listener);return checkDOMListeners(1),function(){checkDOMListeners(-1),unlisten()}},history={length:globalHistory.length,action:"POP",location:initialLocation,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,block:block,listen:listen};return history};__webpack_exports__.a=createBrowserHistory},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_warning__=__webpack_require__(181),__WEBPACK_IMPORTED_MODULE_0_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__),__WEBPACK_IMPORTED_MODULE_1_invariant__=__webpack_require__(182),__WEBPACK_IMPORTED_MODULE_1_invariant___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__),__WEBPACK_IMPORTED_MODULE_2__LocationUtils__=__webpack_require__(183),__WEBPACK_IMPORTED_MODULE_3__PathUtils__=__webpack_require__(170),__WEBPACK_IMPORTED_MODULE_4__createTransitionManager__=__webpack_require__(258),__WEBPACK_IMPORTED_MODULE_5__DOMUtils__=__webpack_require__(274),_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},HashPathCoders={hashbang:{encodePath:function(path){return"!"===path.charAt(0)?path:"!/"+Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.f)(path)},decodePath:function(path){return"!"===path.charAt(0)?path.substr(1):path}},noslash:{encodePath:__WEBPACK_IMPORTED_MODULE_3__PathUtils__.f,decodePath:__WEBPACK_IMPORTED_MODULE_3__PathUtils__.a},slash:{encodePath:__WEBPACK_IMPORTED_MODULE_3__PathUtils__.a,decodePath:__WEBPACK_IMPORTED_MODULE_3__PathUtils__.a}},getHashPath=function(){var href=window.location.href,hashIndex=href.indexOf("#");return-1===hashIndex?"":href.substring(hashIndex+1)},pushHashPath=function(path){return window.location.hash=path},replaceHashPath=function(path){var hashIndex=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,hashIndex>=0?hashIndex:0)+"#"+path)},createHashHistory=function(){var props=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};__WEBPACK_IMPORTED_MODULE_1_invariant___default()(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.b,"Hash history needs a DOM");var globalHistory=window.history,canGoWithoutReload=Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.f)(),_props$getUserConfirm=props.getUserConfirmation,getUserConfirmation=void 0===_props$getUserConfirm?__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.c:_props$getUserConfirm,_props$hashType=props.hashType,hashType=void 0===_props$hashType?"slash":_props$hashType,basename=props.basename?Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.g)(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.a)(props.basename)):"",_HashPathCoders$hashT=HashPathCoders[hashType],encodePath=_HashPathCoders$hashT.encodePath,decodePath=_HashPathCoders$hashT.decodePath,getDOMLocation=function(){var path=decodePath(getHashPath());return __WEBPACK_IMPORTED_MODULE_0_warning___default()(!basename||Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.c)(path,basename),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+path+'" to begin with "'+basename+'".'),basename&&(path=Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.e)(path,basename)),Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path)},transitionManager=Object(__WEBPACK_IMPORTED_MODULE_4__createTransitionManager__.a)(),setState=function(nextState){_extends(history,nextState),history.length=globalHistory.length,transitionManager.notifyListeners(history.location,history.action)},forceNextPop=!1,ignorePath=null,handleHashChange=function(){var path=getHashPath(),encodedPath=encodePath(path);if(path!==encodedPath)replaceHashPath(encodedPath);else{var location=getDOMLocation(),prevLocation=history.location;if(!forceNextPop&&Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.b)(prevLocation,location))return;if(ignorePath===Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(location))return;ignorePath=null,handlePop(location)}},handlePop=function(location){if(forceNextPop)forceNextPop=!1,setState();else{transitionManager.confirmTransitionTo(location,"POP",getUserConfirmation,function(ok){ok?setState({action:"POP",location:location}):revertPop(location)})}},revertPop=function(fromLocation){var toLocation=history.location,toIndex=allPaths.lastIndexOf(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(toLocation));-1===toIndex&&(toIndex=0);var fromIndex=allPaths.lastIndexOf(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(fromLocation));-1===fromIndex&&(fromIndex=0);var delta=toIndex-fromIndex;delta&&(forceNextPop=!0,go(delta))},path=getHashPath(),encodedPath=encodePath(path);path!==encodedPath&&replaceHashPath(encodedPath);var initialLocation=getDOMLocation(),allPaths=[Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(initialLocation)],createHref=function(location){return"#"+encodePath(basename+Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(location))},push=function(path,state){__WEBPACK_IMPORTED_MODULE_0_warning___default()(void 0===state,"Hash history cannot push state; it is ignored");var location=Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,void 0,void 0,history.location);transitionManager.confirmTransitionTo(location,"PUSH",getUserConfirmation,function(ok){if(ok){var path=Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(location),encodedPath=encodePath(basename+path);if(getHashPath()!==encodedPath){ignorePath=path,pushHashPath(encodedPath);var prevIndex=allPaths.lastIndexOf(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(history.location)),nextPaths=allPaths.slice(0,-1===prevIndex?0:prevIndex+1);nextPaths.push(path),allPaths=nextPaths,setState({action:"PUSH",location:location})}else __WEBPACK_IMPORTED_MODULE_0_warning___default()(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),setState()}})},replace=function(path,state){__WEBPACK_IMPORTED_MODULE_0_warning___default()(void 0===state,"Hash history cannot replace state; it is ignored");var location=Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,void 0,void 0,history.location);transitionManager.confirmTransitionTo(location,"REPLACE",getUserConfirmation,function(ok){if(ok){var path=Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(location),encodedPath=encodePath(basename+path);getHashPath()!==encodedPath&&(ignorePath=path,replaceHashPath(encodedPath));var prevIndex=allPaths.indexOf(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(history.location));-1!==prevIndex&&(allPaths[prevIndex]=path),setState({action:"REPLACE",location:location})}})},go=function(n){__WEBPACK_IMPORTED_MODULE_0_warning___default()(canGoWithoutReload,"Hash history go(n) causes a full page reload in this browser"),globalHistory.go(n)},goBack=function(){return go(-1)},goForward=function(){return go(1)},listenerCount=0,checkDOMListeners=function(delta){listenerCount+=delta,1===listenerCount?Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.a)(window,"hashchange",handleHashChange):0===listenerCount&&Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.e)(window,"hashchange",handleHashChange)},isBlocked=!1,block=function(){var prompt=arguments.length>0&&void 0!==arguments[0]&&arguments[0],unblock=transitionManager.setPrompt(prompt);return isBlocked||(checkDOMListeners(1),isBlocked=!0),function(){return isBlocked&&(isBlocked=!1,checkDOMListeners(-1)),unblock()}},listen=function(listener){var unlisten=transitionManager.appendListener(listener);return checkDOMListeners(1),function(){checkDOMListeners(-1),unlisten()}},history={length:globalHistory.length,action:"POP",location:initialLocation,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,block:block,listen:listen};return history};__webpack_exports__.a=createHashHistory},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_warning__=__webpack_require__(181),__WEBPACK_IMPORTED_MODULE_0_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__),__WEBPACK_IMPORTED_MODULE_1__PathUtils__=__webpack_require__(170),__WEBPACK_IMPORTED_MODULE_2__LocationUtils__=__webpack_require__(183),__WEBPACK_IMPORTED_MODULE_3__createTransitionManager__=__webpack_require__(258),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},clamp=function(n,lowerBound,upperBound){return Math.min(Math.max(n,lowerBound),upperBound)},createMemoryHistory=function(){var props=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},getUserConfirmation=props.getUserConfirmation,_props$initialEntries=props.initialEntries,initialEntries=void 0===_props$initialEntries?["/"]:_props$initialEntries,_props$initialIndex=props.initialIndex,initialIndex=void 0===_props$initialIndex?0:_props$initialIndex,_props$keyLength=props.keyLength,keyLength=void 0===_props$keyLength?6:_props$keyLength,transitionManager=Object(__WEBPACK_IMPORTED_MODULE_3__createTransitionManager__.a)(),setState=function(nextState){_extends(history,nextState),history.length=history.entries.length,transitionManager.notifyListeners(history.location,history.action)},createKey=function(){return Math.random().toString(36).substr(2,keyLength)},index=clamp(initialIndex,0,initialEntries.length-1),entries=initialEntries.map(function(entry){return"string"==typeof entry?Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(entry,void 0,createKey()):Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(entry,void 0,entry.key||createKey())}),createHref=__WEBPACK_IMPORTED_MODULE_1__PathUtils__.b,push=function(path,state){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!("object"===(void 0===path?"undefined":_typeof(path))&&void 0!==path.state&&void 0!==state),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var location=Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,"PUSH",getUserConfirmation,function(ok){if(ok){var prevIndex=history.index,nextIndex=prevIndex+1,nextEntries=history.entries.slice(0);nextEntries.length>nextIndex?nextEntries.splice(nextIndex,nextEntries.length-nextIndex,location):nextEntries.push(location),setState({action:"PUSH",location:location,index:nextIndex,entries:nextEntries})}})},replace=function(path,state){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!("object"===(void 0===path?"undefined":_typeof(path))&&void 0!==path.state&&void 0!==state),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var location=Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,"REPLACE",getUserConfirmation,function(ok){ok&&(history.entries[history.index]=location,setState({action:"REPLACE",location:location}))})},go=function(n){var nextIndex=clamp(history.index+n,0,history.entries.length-1),location=history.entries[nextIndex];transitionManager.confirmTransitionTo(location,"POP",getUserConfirmation,function(ok){ok?setState({action:"POP",location:location,index:nextIndex}):setState()})},goBack=function(){return go(-1)},goForward=function(){return go(1)},canGo=function(n){var nextIndex=history.index+n;return nextIndex>=0&&nextIndex<history.entries.length},block=function(){var prompt=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return transitionManager.setPrompt(prompt)},listen=function(listener){return transitionManager.appendListener(listener)},history={length:entries.length,action:"POP",location:entries[index],index:index,entries:entries,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,canGo:canGo,block:block,listen:listen};return history};__webpack_exports__.a=createMemoryHistory},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _warning=__webpack_require__(180),_warning2=_interopRequireDefault(_warning),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_history=__webpack_require__(30),_Router=__webpack_require__(259),_Router2=_interopRequireDefault(_Router),HashRouter=function(_React$Component){function HashRouter(){var _temp,_this,_ret;_classCallCheck(this,HashRouter);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,_React$Component.call.apply(_React$Component,[this].concat(args))),_this.history=(0,_history.createHashHistory)(_this.props),_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(HashRouter,_React$Component),HashRouter.prototype.componentWillMount=function(){(0,_warning2.default)(!this.props.history,"<HashRouter> ignores the history prop. To use a custom history, use `import { Router }` instead of `import { HashRouter as Router }`.")},HashRouter.prototype.render=function(){return _react2.default.createElement(_Router2.default,{history:this.history,children:this.props.children})},HashRouter}(_react2.default.Component);HashRouter.propTypes={basename:_propTypes2.default.string,getUserConfirmation:_propTypes2.default.func,hashType:_propTypes2.default.oneOf(["hashbang","noslash","slash"]),children:_propTypes2.default.node},exports.default=HashRouter},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _MemoryRouter=__webpack_require__(314),_MemoryRouter2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_MemoryRouter);exports.default=_MemoryRouter2.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _warning=__webpack_require__(15),_warning2=_interopRequireDefault(_warning),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_history=__webpack_require__(31),_Router=__webpack_require__(260),_Router2=_interopRequireDefault(_Router),MemoryRouter=function(_React$Component){function MemoryRouter(){var _temp,_this,_ret;_classCallCheck(this,MemoryRouter);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,_React$Component.call.apply(_React$Component,[this].concat(args))),_this.history=(0,_history.createMemoryHistory)(_this.props),_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(MemoryRouter,_React$Component),MemoryRouter.prototype.componentWillMount=function(){(0,_warning2.default)(!this.props.history,"<MemoryRouter> ignores the history prop. To use a custom history, use `import { Router }` instead of `import { MemoryRouter as Router }`.")},MemoryRouter.prototype.render=function(){return _react2.default.createElement(_Router2.default,{history:this.history,children:this.props.children})},MemoryRouter}(_react2.default.Component);MemoryRouter.propTypes={initialEntries:_propTypes2.default.array,initialIndex:_propTypes2.default.number,getUserConfirmation:_propTypes2.default.func,keyLength:_propTypes2.default.number,children:_propTypes2.default.node},exports.default=MemoryRouter},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_warning__=__webpack_require__(184),__WEBPACK_IMPORTED_MODULE_0_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__),__WEBPACK_IMPORTED_MODULE_1_invariant__=__webpack_require__(14),__WEBPACK_IMPORTED_MODULE_1_invariant___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__),__WEBPACK_IMPORTED_MODULE_2__LocationUtils__=__webpack_require__(185),__WEBPACK_IMPORTED_MODULE_3__PathUtils__=__webpack_require__(171),__WEBPACK_IMPORTED_MODULE_4__createTransitionManager__=__webpack_require__(261),__WEBPACK_IMPORTED_MODULE_5__DOMUtils__=__webpack_require__(276),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},getHistoryState=function(){try{return window.history.state||{}}catch(e){return{}}},createBrowserHistory=function(){var props=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};__WEBPACK_IMPORTED_MODULE_1_invariant___default()(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.b,"Browser history needs a DOM");var globalHistory=window.history,canUseHistory=Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.g)(),needsHashChangeListener=!Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.h)(),_props$forceRefresh=props.forceRefresh,forceRefresh=void 0!==_props$forceRefresh&&_props$forceRefresh,_props$getUserConfirm=props.getUserConfirmation,getUserConfirmation=void 0===_props$getUserConfirm?__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.c:_props$getUserConfirm,_props$keyLength=props.keyLength,keyLength=void 0===_props$keyLength?6:_props$keyLength,basename=props.basename?Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.g)(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.a)(props.basename)):"",getDOMLocation=function(historyState){var _ref=historyState||{},key=_ref.key,state=_ref.state,_window$location=window.location,pathname=_window$location.pathname,search=_window$location.search,hash=_window$location.hash,path=pathname+search+hash;return __WEBPACK_IMPORTED_MODULE_0_warning___default()(!basename||Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.c)(path,basename),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+path+'" to begin with "'+basename+'".'),basename&&(path=Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.e)(path,basename)),Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,state,key)},createKey=function(){return Math.random().toString(36).substr(2,keyLength)},transitionManager=Object(__WEBPACK_IMPORTED_MODULE_4__createTransitionManager__.a)(),setState=function(nextState){_extends(history,nextState),history.length=globalHistory.length,transitionManager.notifyListeners(history.location,history.action)},handlePopState=function(event){Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.d)(event)||handlePop(getDOMLocation(event.state))},handleHashChange=function(){handlePop(getDOMLocation(getHistoryState()))},forceNextPop=!1,handlePop=function(location){if(forceNextPop)forceNextPop=!1,setState();else{transitionManager.confirmTransitionTo(location,"POP",getUserConfirmation,function(ok){ok?setState({action:"POP",location:location}):revertPop(location)})}},revertPop=function(fromLocation){var toLocation=history.location,toIndex=allKeys.indexOf(toLocation.key);-1===toIndex&&(toIndex=0);var fromIndex=allKeys.indexOf(fromLocation.key);-1===fromIndex&&(fromIndex=0);var delta=toIndex-fromIndex;delta&&(forceNextPop=!0,go(delta))},initialLocation=getDOMLocation(getHistoryState()),allKeys=[initialLocation.key],createHref=function(location){return basename+Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(location)},push=function(path,state){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!("object"===(void 0===path?"undefined":_typeof(path))&&void 0!==path.state&&void 0!==state),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var location=Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,"PUSH",getUserConfirmation,function(ok){if(ok){var href=createHref(location),key=location.key,state=location.state;if(canUseHistory)if(globalHistory.pushState({key:key,state:state},null,href),forceRefresh)window.location.href=href;else{var prevIndex=allKeys.indexOf(history.location.key),nextKeys=allKeys.slice(0,-1===prevIndex?0:prevIndex+1);nextKeys.push(location.key),allKeys=nextKeys,setState({action:"PUSH",location:location})}else __WEBPACK_IMPORTED_MODULE_0_warning___default()(void 0===state,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=href}})},replace=function(path,state){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!("object"===(void 0===path?"undefined":_typeof(path))&&void 0!==path.state&&void 0!==state),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var location=Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,"REPLACE",getUserConfirmation,function(ok){if(ok){var href=createHref(location),key=location.key,state=location.state;if(canUseHistory)if(globalHistory.replaceState({key:key,state:state},null,href),forceRefresh)window.location.replace(href);else{var prevIndex=allKeys.indexOf(history.location.key);-1!==prevIndex&&(allKeys[prevIndex]=location.key),setState({action:"REPLACE",location:location})}else __WEBPACK_IMPORTED_MODULE_0_warning___default()(void 0===state,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(href)}})},go=function(n){globalHistory.go(n)},goBack=function(){return go(-1)},goForward=function(){return go(1)},listenerCount=0,checkDOMListeners=function(delta){listenerCount+=delta,1===listenerCount?(Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.a)(window,"popstate",handlePopState),needsHashChangeListener&&Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.a)(window,"hashchange",handleHashChange)):0===listenerCount&&(Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.e)(window,"popstate",handlePopState),needsHashChangeListener&&Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.e)(window,"hashchange",handleHashChange))},isBlocked=!1,block=function(){var prompt=arguments.length>0&&void 0!==arguments[0]&&arguments[0],unblock=transitionManager.setPrompt(prompt);return isBlocked||(checkDOMListeners(1),isBlocked=!0),function(){return isBlocked&&(isBlocked=!1,checkDOMListeners(-1)),unblock()}},listen=function(listener){var unlisten=transitionManager.appendListener(listener);return checkDOMListeners(1),function(){checkDOMListeners(-1),unlisten()}},history={length:globalHistory.length,action:"POP",location:initialLocation,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,block:block,listen:listen};return history};__webpack_exports__.a=createBrowserHistory},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_warning__=__webpack_require__(184),__WEBPACK_IMPORTED_MODULE_0_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__),__WEBPACK_IMPORTED_MODULE_1_invariant__=__webpack_require__(14),__WEBPACK_IMPORTED_MODULE_1_invariant___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__),__WEBPACK_IMPORTED_MODULE_2__LocationUtils__=__webpack_require__(185),__WEBPACK_IMPORTED_MODULE_3__PathUtils__=__webpack_require__(171),__WEBPACK_IMPORTED_MODULE_4__createTransitionManager__=__webpack_require__(261),__WEBPACK_IMPORTED_MODULE_5__DOMUtils__=__webpack_require__(276),_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},HashPathCoders={hashbang:{encodePath:function(path){return"!"===path.charAt(0)?path:"!/"+Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.f)(path)},decodePath:function(path){return"!"===path.charAt(0)?path.substr(1):path}},noslash:{encodePath:__WEBPACK_IMPORTED_MODULE_3__PathUtils__.f,decodePath:__WEBPACK_IMPORTED_MODULE_3__PathUtils__.a},slash:{encodePath:__WEBPACK_IMPORTED_MODULE_3__PathUtils__.a,decodePath:__WEBPACK_IMPORTED_MODULE_3__PathUtils__.a}},getHashPath=function(){var href=window.location.href,hashIndex=href.indexOf("#");return-1===hashIndex?"":href.substring(hashIndex+1)},pushHashPath=function(path){return window.location.hash=path},replaceHashPath=function(path){var hashIndex=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,hashIndex>=0?hashIndex:0)+"#"+path)},createHashHistory=function(){var props=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};__WEBPACK_IMPORTED_MODULE_1_invariant___default()(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.b,"Hash history needs a DOM");var globalHistory=window.history,canGoWithoutReload=Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.f)(),_props$getUserConfirm=props.getUserConfirmation,getUserConfirmation=void 0===_props$getUserConfirm?__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.c:_props$getUserConfirm,_props$hashType=props.hashType,hashType=void 0===_props$hashType?"slash":_props$hashType,basename=props.basename?Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.g)(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.a)(props.basename)):"",_HashPathCoders$hashT=HashPathCoders[hashType],encodePath=_HashPathCoders$hashT.encodePath,decodePath=_HashPathCoders$hashT.decodePath,getDOMLocation=function(){var path=decodePath(getHashPath());return __WEBPACK_IMPORTED_MODULE_0_warning___default()(!basename||Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.c)(path,basename),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+path+'" to begin with "'+basename+'".'),basename&&(path=Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.e)(path,basename)),Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path)},transitionManager=Object(__WEBPACK_IMPORTED_MODULE_4__createTransitionManager__.a)(),setState=function(nextState){_extends(history,nextState),history.length=globalHistory.length,transitionManager.notifyListeners(history.location,history.action)},forceNextPop=!1,ignorePath=null,handleHashChange=function(){var path=getHashPath(),encodedPath=encodePath(path);if(path!==encodedPath)replaceHashPath(encodedPath);else{var location=getDOMLocation(),prevLocation=history.location;if(!forceNextPop&&Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.b)(prevLocation,location))return;if(ignorePath===Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(location))return;ignorePath=null,handlePop(location)}},handlePop=function(location){if(forceNextPop)forceNextPop=!1,setState();else{transitionManager.confirmTransitionTo(location,"POP",getUserConfirmation,function(ok){ok?setState({action:"POP",location:location}):revertPop(location)})}},revertPop=function(fromLocation){var toLocation=history.location,toIndex=allPaths.lastIndexOf(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(toLocation));-1===toIndex&&(toIndex=0);var fromIndex=allPaths.lastIndexOf(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(fromLocation));-1===fromIndex&&(fromIndex=0);var delta=toIndex-fromIndex;delta&&(forceNextPop=!0,go(delta))},path=getHashPath(),encodedPath=encodePath(path);path!==encodedPath&&replaceHashPath(encodedPath);var initialLocation=getDOMLocation(),allPaths=[Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(initialLocation)],createHref=function(location){return"#"+encodePath(basename+Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(location))},push=function(path,state){__WEBPACK_IMPORTED_MODULE_0_warning___default()(void 0===state,"Hash history cannot push state; it is ignored");var location=Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,void 0,void 0,history.location);transitionManager.confirmTransitionTo(location,"PUSH",getUserConfirmation,function(ok){if(ok){var path=Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(location),encodedPath=encodePath(basename+path);if(getHashPath()!==encodedPath){ignorePath=path,pushHashPath(encodedPath);var prevIndex=allPaths.lastIndexOf(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(history.location)),nextPaths=allPaths.slice(0,-1===prevIndex?0:prevIndex+1);nextPaths.push(path),allPaths=nextPaths,setState({action:"PUSH",location:location})}else __WEBPACK_IMPORTED_MODULE_0_warning___default()(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),setState()}})},replace=function(path,state){__WEBPACK_IMPORTED_MODULE_0_warning___default()(void 0===state,"Hash history cannot replace state; it is ignored");var location=Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,void 0,void 0,history.location);transitionManager.confirmTransitionTo(location,"REPLACE",getUserConfirmation,function(ok){if(ok){var path=Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(location),encodedPath=encodePath(basename+path);getHashPath()!==encodedPath&&(ignorePath=path,replaceHashPath(encodedPath));var prevIndex=allPaths.indexOf(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__.b)(history.location));-1!==prevIndex&&(allPaths[prevIndex]=path),setState({action:"REPLACE",location:location})}})},go=function(n){__WEBPACK_IMPORTED_MODULE_0_warning___default()(canGoWithoutReload,"Hash history go(n) causes a full page reload in this browser"),globalHistory.go(n)},goBack=function(){return go(-1)},goForward=function(){return go(1)},listenerCount=0,checkDOMListeners=function(delta){listenerCount+=delta,1===listenerCount?Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.a)(window,"hashchange",handleHashChange):0===listenerCount&&Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__.e)(window,"hashchange",handleHashChange)},isBlocked=!1,block=function(){var prompt=arguments.length>0&&void 0!==arguments[0]&&arguments[0],unblock=transitionManager.setPrompt(prompt);return isBlocked||(checkDOMListeners(1),isBlocked=!0),function(){return isBlocked&&(isBlocked=!1,checkDOMListeners(-1)),unblock()}},listen=function(listener){var unlisten=transitionManager.appendListener(listener);return checkDOMListeners(1),function(){checkDOMListeners(-1),unlisten()}},history={length:globalHistory.length,action:"POP",location:initialLocation,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,block:block,listen:listen};return history};__webpack_exports__.a=createHashHistory},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_warning__=__webpack_require__(184),__WEBPACK_IMPORTED_MODULE_0_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__),__WEBPACK_IMPORTED_MODULE_1__PathUtils__=__webpack_require__(171),__WEBPACK_IMPORTED_MODULE_2__LocationUtils__=__webpack_require__(185),__WEBPACK_IMPORTED_MODULE_3__createTransitionManager__=__webpack_require__(261),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},clamp=function(n,lowerBound,upperBound){return Math.min(Math.max(n,lowerBound),upperBound)},createMemoryHistory=function(){var props=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},getUserConfirmation=props.getUserConfirmation,_props$initialEntries=props.initialEntries,initialEntries=void 0===_props$initialEntries?["/"]:_props$initialEntries,_props$initialIndex=props.initialIndex,initialIndex=void 0===_props$initialIndex?0:_props$initialIndex,_props$keyLength=props.keyLength,keyLength=void 0===_props$keyLength?6:_props$keyLength,transitionManager=Object(__WEBPACK_IMPORTED_MODULE_3__createTransitionManager__.a)(),setState=function(nextState){_extends(history,nextState),history.length=history.entries.length,transitionManager.notifyListeners(history.location,history.action)},createKey=function(){return Math.random().toString(36).substr(2,keyLength)},index=clamp(initialIndex,0,initialEntries.length-1),entries=initialEntries.map(function(entry){return"string"==typeof entry?Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(entry,void 0,createKey()):Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(entry,void 0,entry.key||createKey())}),createHref=__WEBPACK_IMPORTED_MODULE_1__PathUtils__.b,push=function(path,state){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!("object"===(void 0===path?"undefined":_typeof(path))&&void 0!==path.state&&void 0!==state),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var location=Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,"PUSH",getUserConfirmation,function(ok){if(ok){var prevIndex=history.index,nextIndex=prevIndex+1,nextEntries=history.entries.slice(0);nextEntries.length>nextIndex?nextEntries.splice(nextIndex,nextEntries.length-nextIndex,location):nextEntries.push(location),setState({action:"PUSH",location:location,index:nextIndex,entries:nextEntries})}})},replace=function(path,state){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!("object"===(void 0===path?"undefined":_typeof(path))&&void 0!==path.state&&void 0!==state),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var location=Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__.a)(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,"REPLACE",getUserConfirmation,function(ok){ok&&(history.entries[history.index]=location,setState({action:"REPLACE",location:location}))})},go=function(n){var nextIndex=clamp(history.index+n,0,history.entries.length-1),location=history.entries[nextIndex];transitionManager.confirmTransitionTo(location,"POP",getUserConfirmation,function(ok){ok?setState({action:"POP",location:location,index:nextIndex}):setState()})},goBack=function(){return go(-1)},goForward=function(){return go(1)},canGo=function(n){var nextIndex=history.index+n;return nextIndex>=0&&nextIndex<history.entries.length},block=function(){var prompt=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return transitionManager.setPrompt(prompt)},listen=function(listener){return transitionManager.appendListener(listener)},history={length:entries.length,action:"POP",location:entries[index],index:index,entries:entries,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,canGo:canGo,block:block,listen:listen};return history};__webpack_exports__.a=createMemoryHistory},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj)keys.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_Route=__webpack_require__(277),_Route2=_interopRequireDefault(_Route),_Link=__webpack_require__(275),_Link2=_interopRequireDefault(_Link),NavLink=function(_ref){var to=_ref.to,exact=_ref.exact,strict=_ref.strict,location=_ref.location,activeClassName=_ref.activeClassName,className=_ref.className,activeStyle=_ref.activeStyle,style=_ref.style,getIsActive=_ref.isActive,ariaCurrent=_ref["aria-current"],rest=_objectWithoutProperties(_ref,["to","exact","strict","location","activeClassName","className","activeStyle","style","isActive","aria-current"]),path="object"===(void 0===to?"undefined":_typeof(to))?to.pathname:to,escapedPath=path&&path.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1");return _react2.default.createElement(_Route2.default,{path:escapedPath,exact:exact,strict:strict,location:location,children:function(_ref2){var location=_ref2.location,match=_ref2.match,isActive=!!(getIsActive?getIsActive(match,location):match);return _react2.default.createElement(_Link2.default,_extends({to:to,className:isActive?[className,activeClassName].filter(function(i){return i}).join(" "):className,style:isActive?_extends({},style,activeStyle):style,"aria-current":isActive&&ariaCurrent||null},rest))}})};NavLink.propTypes={to:_Link2.default.propTypes.to,exact:_propTypes2.default.bool,strict:_propTypes2.default.bool,location:_propTypes2.default.object,activeClassName:_propTypes2.default.string,className:_propTypes2.default.string,activeStyle:_propTypes2.default.object,style:_propTypes2.default.object,isActive:_propTypes2.default.func,"aria-current":_propTypes2.default.oneOf(["page","step","location","date","time","true"])},NavLink.defaultProps={activeClassName:"active","aria-current":"page"},exports.default=NavLink},function(module,exports){module.exports=Array.isArray||function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _Prompt=__webpack_require__(321),_Prompt2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_Prompt);exports.default=_Prompt2.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_invariant=__webpack_require__(14),_invariant2=_interopRequireDefault(_invariant),Prompt=function(_React$Component){function Prompt(){return _classCallCheck(this,Prompt),_possibleConstructorReturn(this,_React$Component.apply(this,arguments))}return _inherits(Prompt,_React$Component),Prompt.prototype.enable=function(message){this.unblock&&this.unblock(),this.unblock=this.context.router.history.block(message)},Prompt.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},Prompt.prototype.componentWillMount=function(){(0,_invariant2.default)(this.context.router,"You should not use <Prompt> outside a <Router>"),this.props.when&&this.enable(this.props.message)},Prompt.prototype.componentWillReceiveProps=function(nextProps){nextProps.when?this.props.when&&this.props.message===nextProps.message||this.enable(nextProps.message):this.disable()},Prompt.prototype.componentWillUnmount=function(){this.disable()},Prompt.prototype.render=function(){return null},Prompt}(_react2.default.Component);Prompt.propTypes={when:_propTypes2.default.bool,message:_propTypes2.default.oneOfType([_propTypes2.default.func,_propTypes2.default.string]).isRequired},Prompt.defaultProps={when:!0},Prompt.contextTypes={router:_propTypes2.default.shape({history:_propTypes2.default.shape({block:_propTypes2.default.func.isRequired}).isRequired}).isRequired},exports.default=Prompt},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _Redirect=__webpack_require__(323),_Redirect2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_Redirect);exports.default=_Redirect2.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_warning=__webpack_require__(15),_warning2=_interopRequireDefault(_warning),_invariant=__webpack_require__(14),_invariant2=_interopRequireDefault(_invariant),_history=__webpack_require__(31),_generatePath=__webpack_require__(279),_generatePath2=_interopRequireDefault(_generatePath),Redirect=function(_React$Component){function Redirect(){return _classCallCheck(this,Redirect),_possibleConstructorReturn(this,_React$Component.apply(this,arguments))}return _inherits(Redirect,_React$Component),Redirect.prototype.isStatic=function(){return this.context.router&&this.context.router.staticContext},Redirect.prototype.componentWillMount=function(){(0,_invariant2.default)(this.context.router,"You should not use <Redirect> outside a <Router>"),this.isStatic()&&this.perform()},Redirect.prototype.componentDidMount=function(){this.isStatic()||this.perform()},Redirect.prototype.componentDidUpdate=function(prevProps){var prevTo=(0,_history.createLocation)(prevProps.to),nextTo=(0,_history.createLocation)(this.props.to);if((0,_history.locationsAreEqual)(prevTo,nextTo))return void(0,_warning2.default)(!1,"You tried to redirect to the same route you're currently on: \""+nextTo.pathname+nextTo.search+'"');this.perform()},Redirect.prototype.computeTo=function(_ref){var computedMatch=_ref.computedMatch,to=_ref.to;return computedMatch?"string"==typeof to?(0,_generatePath2.default)(to,computedMatch.params):_extends({},to,{pathname:(0,_generatePath2.default)(to.pathname,computedMatch.params)}):to},Redirect.prototype.perform=function(){var history=this.context.router.history,push=this.props.push,to=this.computeTo(this.props);push?history.push(to):history.replace(to)},Redirect.prototype.render=function(){return null},Redirect}(_react2.default.Component);Redirect.propTypes={computedMatch:_propTypes2.default.object,push:_propTypes2.default.bool,from:_propTypes2.default.string,to:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.object]).isRequired},Redirect.defaultProps={push:!1},Redirect.contextTypes={router:_propTypes2.default.shape({history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired,replace:_propTypes2.default.func.isRequired}).isRequired,staticContext:_propTypes2.default.object}).isRequired},exports.default=Redirect},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _StaticRouter=__webpack_require__(325),_StaticRouter2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_StaticRouter);exports.default=_StaticRouter2.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj)keys.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_warning=__webpack_require__(15),_warning2=_interopRequireDefault(_warning),_invariant=__webpack_require__(14),_invariant2=_interopRequireDefault(_invariant),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_history=__webpack_require__(31),_Router=__webpack_require__(260),_Router2=_interopRequireDefault(_Router),addLeadingSlash=function(path){return"/"===path.charAt(0)?path:"/"+path},addBasename=function(basename,location){return basename?_extends({},location,{pathname:addLeadingSlash(basename)+location.pathname}):location},stripBasename=function(basename,location){if(!basename)return location;var base=addLeadingSlash(basename);return 0!==location.pathname.indexOf(base)?location:_extends({},location,{pathname:location.pathname.substr(base.length)})},createURL=function(location){return"string"==typeof location?location:(0,_history.createPath)(location)},staticHandler=function(methodName){return function(){(0,_invariant2.default)(!1,"You cannot %s with <StaticRouter>",methodName)}},noop=function(){},StaticRouter=function(_React$Component){function StaticRouter(){var _temp,_this,_ret;_classCallCheck(this,StaticRouter);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,_React$Component.call.apply(_React$Component,[this].concat(args))),_this.createHref=function(path){return addLeadingSlash(_this.props.basename+createURL(path))},_this.handlePush=function(location){var _this$props=_this.props,basename=_this$props.basename,context=_this$props.context;context.action="PUSH",context.location=addBasename(basename,(0,_history.createLocation)(location)),context.url=createURL(context.location)},_this.handleReplace=function(location){var _this$props2=_this.props,basename=_this$props2.basename,context=_this$props2.context;context.action="REPLACE",context.location=addBasename(basename,(0,_history.createLocation)(location)),context.url=createURL(context.location)},_this.handleListen=function(){return noop},_this.handleBlock=function(){return noop},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(StaticRouter,_React$Component),StaticRouter.prototype.getChildContext=function(){return{router:{staticContext:this.props.context}}},StaticRouter.prototype.componentWillMount=function(){(0,_warning2.default)(!this.props.history,"<StaticRouter> ignores the history prop. To use a custom history, use `import { Router }` instead of `import { StaticRouter as Router }`.")},StaticRouter.prototype.render=function(){var _props=this.props,basename=_props.basename,location=(_props.context,_props.location),props=_objectWithoutProperties(_props,["basename","context","location"]),history={createHref:this.createHref,action:"POP",location:stripBasename(basename,(0,_history.createLocation)(location)),push:this.handlePush,replace:this.handleReplace,go:staticHandler("go"),goBack:staticHandler("goBack"),goForward:staticHandler("goForward"),listen:this.handleListen,block:this.handleBlock};return _react2.default.createElement(_Router2.default,_extends({},props,{history:history}))},StaticRouter}(_react2.default.Component);StaticRouter.propTypes={basename:_propTypes2.default.string,context:_propTypes2.default.object.isRequired,location:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.object])},StaticRouter.defaultProps={basename:"",location:"/"},StaticRouter.childContextTypes={router:_propTypes2.default.object.isRequired},exports.default=StaticRouter},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _Switch=__webpack_require__(327),_Switch2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_Switch);exports.default=_Switch2.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}exports.__esModule=!0;var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_warning=__webpack_require__(15),_warning2=_interopRequireDefault(_warning),_invariant=__webpack_require__(14),_invariant2=_interopRequireDefault(_invariant),_matchPath=__webpack_require__(262),_matchPath2=_interopRequireDefault(_matchPath),Switch=function(_React$Component){function Switch(){return _classCallCheck(this,Switch),_possibleConstructorReturn(this,_React$Component.apply(this,arguments))}return _inherits(Switch,_React$Component),Switch.prototype.componentWillMount=function(){(0,_invariant2.default)(this.context.router,"You should not use <Switch> outside a <Router>")},Switch.prototype.componentWillReceiveProps=function(nextProps){(0,_warning2.default)(!(nextProps.location&&!this.props.location),'<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),(0,_warning2.default)(!(!nextProps.location&&this.props.location),'<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.')},Switch.prototype.render=function(){var route=this.context.router.route,children=this.props.children,location=this.props.location||route.location,match=void 0,child=void 0;return _react2.default.Children.forEach(children,function(element){if(null==match&&_react2.default.isValidElement(element)){var _element$props=element.props,pathProp=_element$props.path,exact=_element$props.exact,strict=_element$props.strict,sensitive=_element$props.sensitive,from=_element$props.from,path=pathProp||from;child=element,match=(0,_matchPath2.default)(location.pathname,{path:path,exact:exact,strict:strict,sensitive:sensitive},route.match)}}),match?_react2.default.cloneElement(child,{location:location,computedMatch:match}):null},Switch}(_react2.default.Component);Switch.contextTypes={router:_propTypes2.default.shape({route:_propTypes2.default.object.isRequired}).isRequired},Switch.propTypes={children:_propTypes2.default.node,location:_propTypes2.default.object},exports.default=Switch},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _generatePath=__webpack_require__(279),_generatePath2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_generatePath);exports.default=_generatePath2.default},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _matchPath=__webpack_require__(262),_matchPath2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_matchPath);exports.default=_matchPath2.default},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _withRouter=__webpack_require__(331),_withRouter2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_withRouter);exports.default=_withRouter2.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj)keys.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target}exports.__esModule=!0;var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_hoistNonReactStatics=__webpack_require__(280),_hoistNonReactStatics2=_interopRequireDefault(_hoistNonReactStatics),_Route=__webpack_require__(278),_Route2=_interopRequireDefault(_Route),withRouter=function(Component){var C=function(props){var wrappedComponentRef=props.wrappedComponentRef,remainingProps=_objectWithoutProperties(props,["wrappedComponentRef"]);return _react2.default.createElement(_Route2.default,{children:function(routeComponentProps){return _react2.default.createElement(Component,_extends({},remainingProps,routeComponentProps,{ref:wrappedComponentRef}))}})};return C.displayName="withRouter("+(Component.displayName||Component.name)+")",C.WrappedComponent=Component,C.propTypes={wrappedComponentRef:_propTypes2.default.func},(0,_hoistNonReactStatics2.default)(C,Component)};exports.default=withRouter},function(module,exports,__webpack_require__){function replaceString(str,match,fn){if(""===str)return str;if(!str||!isString(str))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var re=match;isRegExp(re)||(re=new RegExp("("+escapeRegExp(re)+")","gi"));for(var result=str.split(re),i=1,length=result.length;i<length;i+=2)result[i]=fn(result[i],i);return result}var isRegExp=__webpack_require__(333),escapeRegExp=__webpack_require__(334),isString=__webpack_require__(335),flatten=__webpack_require__(336);module.exports=function(source,match,fn){return Array.isArray(source)||(source=[source]),flatten(source.map(function(x){return isString(x)?replaceString(x,match,fn):x}))}},function(module,exports,__webpack_require__){(function(global,module){function baseIsRegExp(value){return isObject(value)&&objectToString.call(value)==regexpTag}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}var regexpTag="[object RegExp]",freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,objectProto=Object.prototype,objectToString=objectProto.toString,isRegExp=nodeIsRegExp?function(func){return function(value){return func(value)}}(nodeIsRegExp):baseIsRegExp;module.exports=isRegExp}).call(exports,__webpack_require__(6),__webpack_require__(177)(module))},function(module,exports,__webpack_require__){(function(global){function baseToString(value){if("string"==typeof value)return value;if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-INFINITY?"-0":result}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function escapeRegExp(string){return string=toString(string),string&&reHasRegExpChar.test(string)?string.replace(reRegExpChar,"\\$&"):string}var INFINITY=1/0,symbolTag="[object Symbol]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reHasRegExpChar=RegExp(reRegExpChar.source),freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,Symbol=root.Symbol,symbolProto=Symbol?Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;module.exports=escapeRegExp}).call(exports,__webpack_require__(6))},function(module,exports){function isObjectLike(value){return!!value&&"object"==typeof value}function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&objectToString.call(value)==stringTag}var stringTag="[object String]",objectProto=Object.prototype,objectToString=objectProto.toString,isArray=Array.isArray;module.exports=isString},function(module,exports,__webpack_require__){(function(global){function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];depth>0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function flatten(array){return(array?array.length:0)?baseFlatten(array,1):[]}function isArguments(value){return isArrayLikeObject(value)&&hasOwnProperty.call(value,"callee")&&(!propertyIsEnumerable.call(value,"callee")||objectToString.call(value)==argsTag)}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isFunction(value){var tag=isObject(value)?objectToString.call(value):"";return tag==funcTag||tag==genTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}var MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,Symbol=root.Symbol,propertyIsEnumerable=objectProto.propertyIsEnumerable,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0,isArray=Array.isArray;module.exports=flatten}).call(exports,__webpack_require__(6))},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_field=__webpack_require__(340),_field2=_interopRequireDefault(_field),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_reactRouterDom=__webpack_require__(7),Form=function(_React$Component){function Form(props){_classCallCheck(this,Form);var _this=_possibleConstructorReturn(this,(Form.__proto__||Object.getPrototypeOf(Form)).call(this,props));return _this.getValues=function(){return _this.props.item||_this.state.item},_this.getErrors=function(){return _this.props.errors||_this.state.errors},_this.loadItem=function(id){_this.setState({loading:!0}),_this.props.endpoint&&_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:_this.props.endpoint,action:"get",data:{id:id}}).done(function(response){_this.setState({loading:!1,item:response.data}),"function"==typeof _this.props.onItemLoad&&_this.props.onItemLoad(response.data)}).fail(function(){_this.setState({loading:!1,item:{}},function(){this.props.history.push("/new")})})},_this.handleSubmit=function(e){if(e.preventDefault(),void 0===_this.props.isValid||!1!==_this.props.isValid()){_this.setState({loading:!0});var item={};_this.props.fields.forEach(function(field){void 0!==field.fields?field.fields.forEach(function(subfield){item[subfield.name]=_this.state.item[subfield.name]}):item[field.name]=_this.state.item[field.name]}),void 0!==_this.props.params.id&&(item.id=_this.props.params.id),_this.props.endpoint&&_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:_this.props.endpoint,action:"save",data:item}).always(function(){_this.setState({loading:!1})}).done(function(){void 0!==_this.props.onSuccess?_this.props.onSuccess():_this.props.history.push("/"),void 0!==_this.props.params.id?_this.props.messages.onUpdate():_this.props.messages.onCreate()}).fail(function(response){response.errors.length>0&&_this.setState({errors:response.errors})})}},_this.handleValueChange=function(e){if(_this.props.onChange)return _this.props.onChange(e);var item=_this.state.item;return item[e.target.name]=e.target.value,_this.setState({item:item}),!0},_this.formRef=_react2.default.createRef(),_this.state={loading:!1,errors:[],item:{}},_this}return _inherits(Form,_React$Component),_createClass(Form,[{key:"componentDidMount",value:function(){var _this2=this;void 0!==this.props.params.id?this.loadItem(this.props.params.id):setImmediate(function(){_this2.setState({item:(0,_jquery2.default)(".mailpoet_form").mailpoetSerializeObject()})})}},{key:"componentWillReceiveProps",value:function(props){var _this3=this;void 0===props.params.id&&(setImmediate(function(){_this3.setState({loading:!1,item:{}})}),void 0===props.item&&this.formRef.current.reset())}},{key:"render",value:function(){var _this4=this,errors=void 0;void 0!==this.getErrors()&&(errors=this.getErrors().map(function(error){return _react2.default.createElement("div",{className:"mailpoet_notice notice inline error is-dismissible",key:"error-"+error.message},_react2.default.createElement("p",null,error.message))}));var formClasses=(0,_classnames2.default)("mailpoet_form",{mailpoet_form_loading:this.state.loading||this.props.loading}),beforeFormContent=!1,afterFormContent=!1;void 0!==this.props.beforeFormContent&&(beforeFormContent=this.props.beforeFormContent(this.getValues())),void 0!==this.props.afterFormContent&&(afterFormContent=this.props.afterFormContent(this.getValues()));var fields=this.props.fields.map(function(field){var onValueChange=_this4.handleValueChange;return field.onBeforeChange&&(onValueChange=function(e){return field.onBeforeChange(e),_this4.handleValueChange(e)}),_react2.default.createElement(_field2.default,{field:field,item:_this4.getValues(),onValueChange:onValueChange,key:"field-"+field.name})}),actions=!1;return actions=this.props.children?this.props.children:_react2.default.createElement("input",{className:"button button-primary",type:"submit",value:_mailpoet2.default.I18n.t("save"),disabled:this.state.loading}),_react2.default.createElement("div",null,beforeFormContent,_react2.default.createElement("form",{id:this.props.id,ref:this.formRef,className:formClasses,onSubmit:void 0!==this.props.onSubmit?this.props.onSubmit:this.handleSubmit,"data-automation-id":this.props.automationId},errors,_react2.default.createElement("table",{className:"form-table"},_react2.default.createElement("tbody",null,fields)),actions),afterFormContent)}}]),Form}(_react2.default.Component);Form.defaultProps={params:{},errors:void 0,fields:void 0,item:void 0,onItemLoad:void 0,isValid:void 0,onSuccess:void 0,onChange:void 0,loading:!1,beforeFormContent:void 0,afterFormContent:void 0,children:void 0,id:"",onSubmit:void 0,automationId:"",messages:{onUpdate:function(){},onCreate:function(){}},endpoint:void 0},Form.propTypes={params:_propTypes2.default.shape({id:_propTypes2.default.string}).isRequired,item:_propTypes2.default.object,errors:_propTypes2.default.arrayOf(_propTypes2.default.object),endpoint:_propTypes2.default.string,fields:_propTypes2.default.arrayOf(_propTypes2.default.object),messages:_propTypes2.default.shape({onUpdate:_propTypes2.default.func,onCreate:_propTypes2.default.func}).isRequired,loading:_propTypes2.default.bool,children:_propTypes2.default.array,id:_propTypes2.default.string,automationId:_propTypes2.default.string,beforeFormContent:_propTypes2.default.func,afterFormContent:_propTypes2.default.func,onItemLoad:_propTypes2.default.func,isValid:_propTypes2.default.func,onChange:_propTypes2.default.func,onSubmit:_propTypes2.default.func,onSuccess:_propTypes2.default.func,history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},exports.default=(0,_reactRouterDom.withRouter)(Form)}).call(exports,__webpack_require__(281).setImmediate)},function(module,exports,__webpack_require__){(function(global,process){!function(global,undefined){"use strict";function setImmediate(callback){"function"!=typeof callback&&(callback=new Function(""+callback));for(var args=new Array(arguments.length-1),i=0;i<args.length;i++)args[i]=arguments[i+1];var task={callback:callback,args:args};return tasksByHandle[nextHandle]=task,registerImmediate(nextHandle),nextHandle++}function clearImmediate(handle){delete tasksByHandle[handle]}function run(task){var callback=task.callback,args=task.args;switch(args.length){case 0:callback();break;case 1:callback(args[0]);break;case 2:callback(args[0],args[1]);break;case 3:callback(args[0],args[1],args[2]);break;default:callback.apply(undefined,args)}}function runIfPresent(handle){if(currentlyRunningATask)setTimeout(runIfPresent,0,handle);else{var task=tasksByHandle[handle];if(task){currentlyRunningATask=!0;try{run(task)}finally{clearImmediate(handle),currentlyRunningATask=!1}}}}if(!global.setImmediate){var registerImmediate,nextHandle=1,tasksByHandle={},currentlyRunningATask=!1,doc=global.document,attachTo=Object.getPrototypeOf&&Object.getPrototypeOf(global);attachTo=attachTo&&attachTo.setTimeout?attachTo:global,"[object process]"==={}.toString.call(global.process)?function(){registerImmediate=function(handle){process.nextTick(function(){runIfPresent(handle)})}}():function(){if(global.postMessage&&!global.importScripts){var postMessageIsAsynchronous=!0,oldOnMessage=global.onmessage;return global.onmessage=function(){postMessageIsAsynchronous=!1},global.postMessage("","*"),global.onmessage=oldOnMessage,postMessageIsAsynchronous}}()?function(){var messagePrefix="setImmediate$"+Math.random()+"$",onGlobalMessage=function(event){event.source===global&&"string"==typeof event.data&&0===event.data.indexOf(messagePrefix)&&runIfPresent(+event.data.slice(messagePrefix.length))};global.addEventListener?global.addEventListener("message",onGlobalMessage,!1):global.attachEvent("onmessage",onGlobalMessage),registerImmediate=function(handle){global.postMessage(messagePrefix+handle,"*")}}():global.MessageChannel?function(){var channel=new MessageChannel;channel.port1.onmessage=function(event){runIfPresent(event.data)},registerImmediate=function(handle){channel.port2.postMessage(handle)}}():doc&&"onreadystatechange"in doc.createElement("script")?function(){var html=doc.documentElement;registerImmediate=function(handle){var script=doc.createElement("script");script.onreadystatechange=function(){runIfPresent(handle),script.onreadystatechange=null,html.removeChild(script),script=null},html.appendChild(script)}}():function(){registerImmediate=function(handle){setTimeout(runIfPresent,0,handle)}}(),attachTo.setImmediate=setImmediate,attachTo.clearImmediate=clearImmediate}}("undefined"==typeof self?void 0===global?this:global:self)}).call(exports,__webpack_require__(6),__webpack_require__(339))},function(module,exports){function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,runClearTimeout(timeout)}}function Item(fun,array){this.fun=fun,this.array=array}function noop(){}var cachedSetTimeout,cachedClearTimeout,process=module.exports={};!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(name){return[]},process.binding=function(name){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(dir){throw new Error("process.chdir is not supported")},process.umask=function(){return 0}},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_text=__webpack_require__(282),_text2=_interopRequireDefault(_text),_textarea=__webpack_require__(342),_textarea2=_interopRequireDefault(_textarea),_select=__webpack_require__(263),_select2=_interopRequireDefault(_select),_radio=__webpack_require__(343),_radio2=_interopRequireDefault(_radio),_checkbox=__webpack_require__(344),_checkbox2=_interopRequireDefault(_checkbox),_selection=__webpack_require__(283),_selection2=_interopRequireDefault(_selection),_date=__webpack_require__(346),_date2=_interopRequireDefault(_date),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),FormField=function(_React$Component){function FormField(){var _ref,_temp,_this,_ret;_classCallCheck(this,FormField);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=FormField.__proto__||Object.getPrototypeOf(FormField)).call.apply(_ref,[this].concat(args))),_this.renderField=function(data){var inline=arguments.length>1&&void 0!==arguments[1]&&arguments[1],description=!1;data.field.description&&(description=_react2.default.createElement("p",{className:"description"},data.field.description));var field=!1,dataField=data.field;switch(void 0!==data.field.field&&(dataField=_jquery2.default.merge(dataField,data.field.field)),dataField.type){case"text":field=_react2.default.createElement(_text2.default,data);break;case"textarea":field=_react2.default.createElement(_textarea2.default,data);break;case"select":field=_react2.default.createElement(_select2.default,data);break;case"radio":field=_react2.default.createElement(_radio2.default,data);break;case"checkbox":field=_react2.default.createElement(_checkbox2.default,data);break;case"selection":field=_react2.default.createElement(_selection2.default,data);break;case"date":field=_react2.default.createElement(_date2.default,data);break;case"reactComponent":field=_react2.default.createElement(data.field.component,data);break;default:field="invalid"}return!0===inline?_react2.default.createElement("span",{key:"field-"+(data.index||0)},field,description):_react2.default.createElement("div",{key:"field-"+(data.index||0)},field,description)},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(FormField,_React$Component),_createClass(FormField,[{key:"render",value:function(){var _this2=this,field=!1;field=void 0!==this.props.field.fields?this.props.field.fields.map(function(subfield,index){return _this2.renderField({index:index,field:subfield,item:_this2.props.item,onValueChange:_this2.props.onValueChange||!1})}):this.renderField(this.props);var tip=!1;return this.props.field.tip&&(tip=_react2.default.createElement("p",{className:"description"},this.props.field.tip)),_react2.default.createElement("tr",{className:"form-field-row-"+this.props.field.name},_react2.default.createElement("th",{scope:"row"},_react2.default.createElement("label",{htmlFor:"field_"+this.props.field.name},this.props.field.label,tip)),_react2.default.createElement("td",null,field))}}]),FormField}(_react2.default.Component);FormField.propTypes={onValueChange:_propTypes2.default.func,field:_propTypes2.default.shape({name:_propTypes2.default.string.isRequired,values:_propTypes2.default.object,tip:_propTypes2.default.oneOfType([_propTypes2.default.array,_propTypes2.default.string]),label:_propTypes2.default.string,fields:_propTypes2.default.array,description:_propTypes2.default.string}).isRequired,item:_propTypes2.default.object.isRequired},FormField.defaultProps={onValueChange:function(){}},exports.default=FormField},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),FormFieldText=function(_React$Component){function FormFieldText(){return _classCallCheck(this,FormFieldText),_possibleConstructorReturn(this,(FormFieldText.__proto__||Object.getPrototypeOf(FormFieldText)).apply(this,arguments))}return _inherits(FormFieldText,_React$Component),_createClass(FormFieldText,[{key:"render",value:function(){var name=this.props.field.name||null,item=this.props.item||{},value=void 0,defaultValue=void 0;this.props.onValueChange instanceof Function&&(value=item[this.props.field.name],value=void 0===value?this.props.field.defaultValue||"":value),!value&&this.props.field.defaultValue&&(defaultValue=this.props.field.defaultValue);var id=this.props.field.id||null;!id&&this.props.field.name&&(id="field_"+this.props.field.name);var className=this.props.field.class||null;return className||this.props.field.size||(className="regular-text"),_react2.default.createElement("input",_extends({type:"text",disabled:void 0!==this.props.field.disabled&&this.props.field.disabled(this.props.item),className:className,size:"auto"!==this.props.field.size&&this.props.field.size>0?this.props.field.size:null,name:name,id:id,value:value,defaultValue:defaultValue,placeholder:this.props.field.placeholder,onChange:this.props.onValueChange},this.props.field.validation))}}]),FormFieldText}(_react2.default.Component);FormFieldText.propTypes={onValueChange:_propTypes2.default.func,field:_propTypes2.default.shape({name:_propTypes2.default.string.isRequired,defaultValue:_propTypes2.default.string,id:_propTypes2.default.string,class:_propTypes2.default.string,size:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number]),disabled:_propTypes2.default.func,placeholder:_propTypes2.default.string,validation:_propTypes2.default.object}).isRequired,item:_propTypes2.default.object.isRequired},FormFieldText.defaultProps={onValueChange:function(){}},module.exports=FormFieldText},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),FormFieldTextarea=function(props){return _react2.default.createElement("textarea",_extends({type:"text",className:"regular-text",name:props.field.name,id:"field_"+props.field.name,value:props.item[props.field.name],placeholder:props.field.placeholder,defaultValue:props.field.defaultValue,onChange:props.onValueChange},props.field.validation))};FormFieldTextarea.propTypes={item:_propTypes2.default.object.isRequired,field:_propTypes2.default.shape({name:_propTypes2.default.string,placeholder:_propTypes2.default.string,defaultValue:_propTypes2.default.string,validation:_propTypes2.default.object}).isRequired,onValueChange:_propTypes2.default.func.isRequired},exports.default=FormFieldTextarea},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),FormFieldRadio=function(_React$Component){function FormFieldRadio(){return _classCallCheck(this,FormFieldRadio),_possibleConstructorReturn(this,(FormFieldRadio.__proto__||Object.getPrototypeOf(FormFieldRadio)).apply(this,arguments))}return _inherits(FormFieldRadio,_React$Component),_createClass(FormFieldRadio,[{key:"render",value:function(){var _this2=this;if(void 0===this.props.field.values)return!1;var selectedValue=this.props.item[this.props.field.name],options=Object.keys(this.props.field.values).map(function(value){return _react2.default.createElement("p",{key:"radio-"+value},_react2.default.createElement("label",{htmlFor:_this2.props.field.name},_react2.default.createElement("input",{type:"radio",checked:selectedValue===value,value:value,onChange:_this2.props.onValueChange,name:_this2.props.field.name,id:_this2.props.field.name}),_this2.props.field.values[value]))});return _react2.default.createElement("div",null,options)}}]),FormFieldRadio}(_react2.default.Component);FormFieldRadio.propTypes={onValueChange:_propTypes2.default.func,field:_propTypes2.default.shape({name:_propTypes2.default.string.isRequired,values:_propTypes2.default.object}).isRequired,item:_propTypes2.default.object.isRequired},FormFieldRadio.defaultProps={onValueChange:function(){}},exports.default=FormFieldRadio},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),FormFieldCheckbox=function(_React$Component){function FormFieldCheckbox(props){_classCallCheck(this,FormFieldCheckbox);var _this=_possibleConstructorReturn(this,(FormFieldCheckbox.__proto__||Object.getPrototypeOf(FormFieldCheckbox)).call(this,props));return _this.onValueChange=function(e){return e.target.value=_this.checkboxRef.current.checked?"1":"0",_this.props.onValueChange(e)},_this.checkboxRef=_react2.default.createRef(),_this.onValueChange=_this.onValueChange.bind(_this),_this}return _inherits(FormFieldCheckbox,_React$Component),_createClass(FormFieldCheckbox,[{key:"render",value:function(){var _this2=this;if(void 0===this.props.field.values)return!1;var isChecked=!!Number(this.props.item[this.props.field.name]),options=Object.keys(this.props.field.values).map(function(value){return _react2.default.createElement("p",{key:"checkbox-"+value},_react2.default.createElement("label",{htmlFor:_this2.props.field.name},_react2.default.createElement("input",{ref:_this2.checkboxRef,type:"checkbox",value:"1",checked:isChecked,onChange:_this2.onValueChange,name:_this2.props.field.name,id:_this2.props.field.name}),_this2.props.field.values[value]))});return _react2.default.createElement("div",null,options)}}]),FormFieldCheckbox}(_react2.default.Component);FormFieldCheckbox.propTypes={onValueChange:_propTypes2.default.func.isRequired,field:_propTypes2.default.shape({name:_propTypes2.default.string.isRequired,values:_propTypes2.default.object.isRequired}).isRequired,item:_propTypes2.default.object.isRequired},exports.default=FormFieldCheckbox},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore);__webpack_require__(11),__webpack_require__(284);var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),Selection=function(_React$Component){function Selection(props){_classCallCheck(this,Selection);var _this=_possibleConstructorReturn(this,(Selection.__proto__||Object.getPrototypeOf(Selection)).call(this,props));return _initialiseProps.call(_this),_this.selectRef=_react2.default.createRef(),_this}return _inherits(Selection,_React$Component),_createClass(Selection,[{key:"componentDidMount",value:function(){this.isSelect2Component()&&this.setupSelect2()}},{key:"componentDidUpdate",value:function(prevProps){void 0!==this.props.item&&void 0!==prevProps.item&&this.props.item.id!==prevProps.item.id&&(0,_jquery2.default)("#"+this.selectRef.current.id).val(this.getSelectedValues()).trigger("change"),this.isSelect2Initialized()&&this.getFieldId(this.props)!==this.getFieldId(prevProps)&&void 0!==this.props.field.resetSelect2OnUpdate&&this.resetSelect2()}},{key:"componentWillUnmount",value:function(){this.isSelect2Component()&&this.destroySelect2()}},{key:"render",value:function(){var _this2=this,items=this.getItems(this.props.field),selectedValues=this.getSelectedValues(),options=items.map(function(item){var label=_this2.getLabel(item),searchLabel=_this2.getSearchLabel(item),value=_this2.getValue(item);return _react2.default.createElement("option",{key:"option-"+item.id,className:"default",value:value,title:searchLabel},label)});return _react2.default.createElement("select",_extends({id:this.getFieldId(),ref:this.selectRef,disabled:this.props.field.disabled,"data-placeholder":this.props.field.placeholder,multiple:this.props.field.multiple,defaultValue:selectedValues},this.props.field.validation),this.insertEmptyOption(),options)}}]),Selection}(_react2.default.Component),_initialiseProps=function(){var _this3=this;this.getFieldId=function(data){var props=data||_this3.props;return props.field.id||props.field.name},this.getSelectedValues=function(){if(void 0!==_this3.props.field.selected)return _this3.props.field.selected(_this3.props.item);if(void 0!==_this3.props.item&&void 0!==_this3.props.field.name){if(!_this3.allowMultipleValues())return _this3.props.item[_this3.props.field.name];if(_underscore2.default.isArray(_this3.props.item[_this3.props.field.name]))return _this3.props.item[_this3.props.field.name].map(function(item){return item.id})}return null},this.getItems=function(){var items=void 0;return void 0!==window["mailpoet_"+_this3.props.field.endpoint]?items=window["mailpoet_"+_this3.props.field.endpoint]:void 0!==_this3.props.field.values&&(items=_this3.props.field.values),_underscore2.default.isArray(items)&&void 0!==_this3.props.field.filter&&(items=items.filter(_this3.props.field.filter)),items},this.getLabel=function(item){return void 0!==_this3.props.field.getLabel?_this3.props.field.getLabel(item,_this3.props.item):item.name},this.getSearchLabel=function(item){return void 0!==_this3.props.field.getSearchLabel?_this3.props.field.getSearchLabel(item,_this3.props.item):null},this.getValue=function(item){return void 0!==_this3.props.field.getValue?_this3.props.field.getValue(item,_this3.props.item):item.id},this.setupSelect2=function(){if(!_this3.isSelect2Initialized()){var select2Options={disabled:_this3.props.disabled||!1,width:_this3.props.width||"",placeholder:{id:"",text:_this3.props.field.placeholder},templateResult:function(item){return item.element&&item.element.selected?null:item.title?item.title:item.text}},remoteQuery=_this3.props.field.remoteQuery||null;remoteQuery&&(select2Options=Object.assign(select2Options,{ajax:{url:window.ajaxurl,type:"POST",dataType:"json",data:function(params){return{action:"mailpoet",api_version:window.mailpoet_api_version,token:window.mailpoet_token,endpoint:remoteQuery.endpoint,method:remoteQuery.method,data:Object.assign(remoteQuery.data,{query:params.term})}},processResults:function(response){return{results:_underscore2.default.has(response,"data")?response.data.map(function(item){return{id:item.id||item.value,text:item.name||item.text}}):[]}}},minimumInputLength:remoteQuery.minimumInputLength||2})),void 0!==_this3.props.field.extendSelect2Options&&(select2Options=Object.assign(select2Options,_this3.props.field.extendSelect2Options));var select2=(0,_jquery2.default)("#"+_this3.selectRef.current.id).select2(select2Options),hasRemoved=!1;select2.on("select2:unselecting",function(){hasRemoved=!0}),select2.on("select2:opening",function(e){!0===hasRemoved&&(hasRemoved=!1,e.preventDefault())}),select2.on("change",_this3.handleChange)}},this.resetSelect2=function(){_this3.destroySelect2(),_this3.setupSelect2()},this.destroySelect2=function(){_this3.isSelect2Initialized()&&((0,_jquery2.default)("#"+_this3.selectRef.current.id).select2("destroy"),_this3.cleanupAfterSelect2())},this.cleanupAfterSelect2=function(){(0,_jquery2.default)("#"+_this3.selectRef.current.id).find("option:not(.default)").remove(),(0,_jquery2.default)("#"+_this3.selectRef.current.id).off("select2:unselecting").off("select2:opening")},this.allowMultipleValues=function(){return!0===_this3.props.field.multiple},this.isSelect2Initialized=function(){return!0===(0,_jquery2.default)("#"+_this3.selectRef.current.id).hasClass("select2-hidden-accessible")},this.isSelect2Component=function(){return _this3.allowMultipleValues()||_this3.props.field.forceSelect2},this.handleChange=function(e){if(void 0!==_this3.props.onValueChange){var valueTextPair=(0,_jquery2.default)("#"+_this3.selectRef.current.id).children(":selected").map(function(){return{id:(0,_jquery2.default)(this).val(),text:(0,_jquery2.default)(this).text()}}),value=_this3.props.field.multiple?_underscore2.default.pluck(valueTextPair,"id"):_underscore2.default.pluck(valueTextPair,"id").toString(),transformedValue=_this3.transformChangedValue(value,valueTextPair);_this3.props.onValueChange({target:{value:transformedValue,name:_this3.props.field.name,id:e.target.id}})}},this.transformChangedValue=function(value,textValuePair){return"function"==typeof _this3.props.field.transformChangedValue?_this3.props.field.transformChangedValue.call(_this3,value,textValuePair):value},this.insertEmptyOption=function(){if(!_this3.allowMultipleValues())return _this3.props.field.placeholder?_react2.default.createElement("option",{className:"default"}):void 0}};Selection.propTypes={onValueChange:_propTypes2.default.func,field:_propTypes2.default.shape({name:_propTypes2.default.string.isRequired,values:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.array]),getLabel:_propTypes2.default.func,resetSelect2OnUpdate:_propTypes2.default.bool,selected:_propTypes2.default.func,endpoint:_propTypes2.default.string,filter:_propTypes2.default.func,getSearchLabel:_propTypes2.default.func,getValue:_propTypes2.default.func,placeholder:_propTypes2.default.string,remoteQuery:_propTypes2.default.object,extendSelect2Options:_propTypes2.default.object,multiple:_propTypes2.default.bool,forceSelect2:_propTypes2.default.bool,transformChangedValue:_propTypes2.default.func,disabled:_propTypes2.default.bool,validation:_propTypes2.default.object}).isRequired,item:_propTypes2.default.object,disabled:_propTypes2.default.bool,width:_propTypes2.default.string},Selection.defaultProps={onValueChange:function(){},disabled:!1,width:"",item:void 0},exports.default=Selection},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}function FormFieldDateYear(props){var years=[];void 0!==props.placeholder&&years.push(_react2.default.createElement("option",{value:"",key:0},props.placeholder));for(var currentYear=(0,_moment2.default)().year(),i=currentYear;i>=currentYear-100;i-=1)years.push(_react2.default.createElement("option",{key:i,value:i},i));return _react2.default.createElement("select",{name:props.name+"[year]",value:props.year,onChange:props.onValueChange},years)}function FormFieldDateMonth(props){var months=[];void 0!==props.placeholder&&months.push(_react2.default.createElement("option",{value:"",key:0},props.placeholder));for(var i=1;i<=12;i+=1)months.push(_react2.default.createElement("option",{key:i,value:i},props.monthNames[i-1]));return _react2.default.createElement("select",{name:props.name+"[month]",value:props.month,onChange:props.onValueChange},months)}function FormFieldDateDay(props){var days=[];void 0!==props.placeholder&&days.push(_react2.default.createElement("option",{value:"",key:0},props.placeholder));for(var i=1;i<=31;i+=1)days.push(_react2.default.createElement("option",{key:i,value:i},i));return _react2.default.createElement("select",{name:props.name+"[day]",value:props.day,onChange:props.onValueChange},days)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_moment=__webpack_require__(0),_moment2=_interopRequireDefault(_moment),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes);FormFieldDateYear.propTypes={name:_propTypes2.default.string.isRequired,placeholder:_propTypes2.default.string.isRequired,onValueChange:_propTypes2.default.func.isRequired,year:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number]).isRequired},FormFieldDateMonth.propTypes={name:_propTypes2.default.string.isRequired,placeholder:_propTypes2.default.string.isRequired,onValueChange:_propTypes2.default.func.isRequired,month:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number]).isRequired,monthNames:_propTypes2.default.arrayOf(_propTypes2.default.string).isRequired},FormFieldDateDay.propTypes={name:_propTypes2.default.string.isRequired,placeholder:_propTypes2.default.string.isRequired,onValueChange:_propTypes2.default.func.isRequired,day:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number]).isRequired};var FormFieldDate=function(_React$Component){function FormFieldDate(props){_classCallCheck(this,FormFieldDate);var _this=_possibleConstructorReturn(this,(FormFieldDate.__proto__||Object.getPrototypeOf(FormFieldDate)).call(this,props));return _this.state={year:"",month:"",day:""},_this.onValueChange=_this.onValueChange.bind(_this),_this}return _inherits(FormFieldDate,_React$Component),_createClass(FormFieldDate,[{key:"componentDidMount",value:function(){this.extractDateParts()}},{key:"componentDidUpdate",value:function(prevProps){void 0!==this.props.item&&void 0!==prevProps.item&&this.props.item.id!==prevProps.item.id&&this.extractDateParts()}},{key:"onValueChange",value:function(e){var _this2=this,matches=e.target.name.match(/(.*?)\[(.*?)\]/),field=null,property=null;if(null!==matches&&3===matches.length){field=matches[1],property=matches[2];var value=Number(e.target.value);this.setState(_defineProperty({},""+property,value),function(){_this2.props.onValueChange({target:{name:field,value:_this2.formatValue()}})})}}},{key:"formatValue",value:function(){var dateType=this.props.field.params.date_type,value=void 0;switch(dateType){case"year_month_day":value={year:this.state.year,month:this.state.month,day:this.state.day};break;case"year_month":value={year:this.state.year,month:this.state.month};break;case"month":value={month:this.state.month};break;case"year":value={year:this.state.year};break;default:value={value:"invalid type"}}return value}},{key:"extractDateParts",value:function(){var value=void 0!==this.props.item[this.props.field.name]?this.props.item[this.props.field.name].trim():"";if(""!==value){var dateTime=(0,_moment2.default)(value);this.setState({year:dateTime.format("YYYY"),month:dateTime.format("M"),day:dateTime.format("D")})}}},{key:"render",value:function(){var _this3=this,monthNames=window.mailpoet_month_names||[],dateFormats=window.mailpoet_date_formats||{},dateType=this.props.field.params.date_type,dateSelects=dateFormats[dateType][0].split("/"),fields=dateSelects.map(function(type){switch(type){case"YYYY":return _react2.default.createElement(FormFieldDateYear,{onValueChange:_this3.onValueChange,key:"year",name:_this3.props.field.name,year:_this3.state.year,placeholder:_this3.props.field.year_placeholder});case"MM":return _react2.default.createElement(FormFieldDateMonth,{onValueChange:_this3.onValueChange,key:"month",name:_this3.props.field.name,month:_this3.state.month,monthNames:monthNames,placeholder:_this3.props.field.month_placeholder});case"DD":return _react2.default.createElement(FormFieldDateDay,{onValueChange:_this3.onValueChange,key:"day",name:_this3.props.field.name,day:_this3.state.day,placeholder:_this3.props.field.day_placeholder});default:return _react2.default.createElement("div",null,"Invalid date type")}});return _react2.default.createElement("div",null,fields)}}]),FormFieldDate}(_react2.default.Component);FormFieldDate.propTypes={item:_propTypes2.default.object.isRequired,field:_propTypes2.default.shape({name:_propTypes2.default.string,day_placeholder:_propTypes2.default.string,month_placeholder:_propTypes2.default.string,year_placeholder:_propTypes2.default.string,params:_propTypes2.default.object}).isRequired,onValueChange:_propTypes2.default.func.isRequired},exports.default=FormFieldDate},function(module,__webpack_exports__,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var __WEBPACK_IMPORTED_MODULE_0_warning__=__webpack_require__(180),__WEBPACK_IMPORTED_MODULE_0_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__),__WEBPACK_IMPORTED_MODULE_1_react__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_1_react___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__),__WEBPACK_IMPORTED_MODULE_2_prop_types__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_2_prop_types___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__),__WEBPACK_IMPORTED_MODULE_3_history__=__webpack_require__(30),__WEBPACK_IMPORTED_MODULE_4__Router__=__webpack_require__(264),BrowserRouter=function(_React$Component){function BrowserRouter(){var _temp,_this,_ret;_classCallCheck(this,BrowserRouter);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,_React$Component.call.apply(_React$Component,[this].concat(args))),_this.history=Object(__WEBPACK_IMPORTED_MODULE_3_history__.createBrowserHistory)(_this.props),_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(BrowserRouter,_React$Component),BrowserRouter.prototype.componentWillMount=function(){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!this.props.history,"<BrowserRouter> ignores the history prop. To use a custom history, use `import { Router }` instead of `import { BrowserRouter as Router }`.")},BrowserRouter.prototype.render=function(){return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__Router__.a,{history:this.history,children:this.props.children})},BrowserRouter}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);BrowserRouter.propTypes={basename:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string,forceRefresh:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,getUserConfirmation:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func,keyLength:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.number,children:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node},__webpack_exports__.a=BrowserRouter},function(module,__webpack_exports__,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var __WEBPACK_IMPORTED_MODULE_0_warning__=__webpack_require__(180),__WEBPACK_IMPORTED_MODULE_0_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__),__WEBPACK_IMPORTED_MODULE_1_react__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_1_react___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__),__WEBPACK_IMPORTED_MODULE_2_prop_types__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_2_prop_types___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__),__WEBPACK_IMPORTED_MODULE_3_history__=__webpack_require__(30),__WEBPACK_IMPORTED_MODULE_4__Router__=__webpack_require__(264),HashRouter=function(_React$Component){function HashRouter(){var _temp,_this,_ret;_classCallCheck(this,HashRouter);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,_React$Component.call.apply(_React$Component,[this].concat(args))),_this.history=Object(__WEBPACK_IMPORTED_MODULE_3_history__.createHashHistory)(_this.props),_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(HashRouter,_React$Component),HashRouter.prototype.componentWillMount=function(){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!this.props.history,"<HashRouter> ignores the history prop. To use a custom history, use `import { Router }` instead of `import { HashRouter as Router }`.")},HashRouter.prototype.render=function(){return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__Router__.a,{history:this.history,children:this.props.children})},HashRouter}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);HashRouter.propTypes={basename:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string,getUserConfirmation:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func,hashType:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.oneOf(["hashbang","noslash","slash"]),children:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node},__webpack_exports__.a=HashRouter},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_react_router_es_MemoryRouter__=__webpack_require__(350);__webpack_exports__.a=__WEBPACK_IMPORTED_MODULE_0_react_router_es_MemoryRouter__.a},function(module,__webpack_exports__,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var __WEBPACK_IMPORTED_MODULE_0_warning__=__webpack_require__(15),__WEBPACK_IMPORTED_MODULE_0_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__),__WEBPACK_IMPORTED_MODULE_1_react__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_1_react___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__),__WEBPACK_IMPORTED_MODULE_2_prop_types__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_2_prop_types___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__),__WEBPACK_IMPORTED_MODULE_3_history__=__webpack_require__(31),__WEBPACK_IMPORTED_MODULE_4__Router__=__webpack_require__(265),MemoryRouter=function(_React$Component){function MemoryRouter(){var _temp,_this,_ret;_classCallCheck(this,MemoryRouter);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,_React$Component.call.apply(_React$Component,[this].concat(args))),_this.history=Object(__WEBPACK_IMPORTED_MODULE_3_history__.createMemoryHistory)(_this.props),_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(MemoryRouter,_React$Component),MemoryRouter.prototype.componentWillMount=function(){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!this.props.history,"<MemoryRouter> ignores the history prop. To use a custom history, use `import { Router }` instead of `import { MemoryRouter as Router }`.")},MemoryRouter.prototype.render=function(){return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__Router__.a,{history:this.history,children:this.props.children})},MemoryRouter}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);MemoryRouter.propTypes={initialEntries:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.array,initialIndex:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.number,getUserConfirmation:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func,keyLength:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.number,children:__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node},__webpack_exports__.a=MemoryRouter},function(module,__webpack_exports__,__webpack_require__){"use strict";function _objectWithoutProperties(obj,keys){var target={};for(var i in obj)keys.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target}var __WEBPACK_IMPORTED_MODULE_0_react__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_react___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__),__WEBPACK_IMPORTED_MODULE_1_prop_types__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_1_prop_types___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__),__WEBPACK_IMPORTED_MODULE_2__Route__=__webpack_require__(286),__WEBPACK_IMPORTED_MODULE_3__Link__=__webpack_require__(285),_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},NavLink=function(_ref){var to=_ref.to,exact=_ref.exact,strict=_ref.strict,location=_ref.location,activeClassName=_ref.activeClassName,className=_ref.className,activeStyle=_ref.activeStyle,style=_ref.style,getIsActive=_ref.isActive,ariaCurrent=_ref["aria-current"],rest=_objectWithoutProperties(_ref,["to","exact","strict","location","activeClassName","className","activeStyle","style","isActive","aria-current"]),path="object"===(void 0===to?"undefined":_typeof(to))?to.pathname:to,escapedPath=path&&path.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1");return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__Route__.a,{path:escapedPath,exact:exact,strict:strict,location:location,children:function(_ref2){var location=_ref2.location,match=_ref2.match,isActive=!!(getIsActive?getIsActive(match,location):match);return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__Link__.a,_extends({to:to,className:isActive?[className,activeClassName].filter(function(i){return i}).join(" "):className,style:isActive?_extends({},style,activeStyle):style,"aria-current":isActive&&ariaCurrent||null},rest))}})};NavLink.propTypes={to:__WEBPACK_IMPORTED_MODULE_3__Link__.a.propTypes.to,exact:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,strict:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,location:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,activeClassName:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,className:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,activeStyle:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,style:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,isActive:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,"aria-current":__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(["page","step","location","date","time","true"])},NavLink.defaultProps={activeClassName:"active","aria-current":"page"},__webpack_exports__.a=NavLink},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Prompt__=__webpack_require__(353);__webpack_exports__.a=__WEBPACK_IMPORTED_MODULE_0_react_router_es_Prompt__.a},function(module,__webpack_exports__,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var __WEBPACK_IMPORTED_MODULE_0_react__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_react___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__),__WEBPACK_IMPORTED_MODULE_1_prop_types__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_1_prop_types___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__),__WEBPACK_IMPORTED_MODULE_2_invariant__=__webpack_require__(14),__WEBPACK_IMPORTED_MODULE_2_invariant___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_invariant__),Prompt=function(_React$Component){function Prompt(){return _classCallCheck(this,Prompt),_possibleConstructorReturn(this,_React$Component.apply(this,arguments))}return _inherits(Prompt,_React$Component),Prompt.prototype.enable=function(message){this.unblock&&this.unblock(),this.unblock=this.context.router.history.block(message)},Prompt.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},Prompt.prototype.componentWillMount=function(){__WEBPACK_IMPORTED_MODULE_2_invariant___default()(this.context.router,"You should not use <Prompt> outside a <Router>"),this.props.when&&this.enable(this.props.message)},Prompt.prototype.componentWillReceiveProps=function(nextProps){nextProps.when?this.props.when&&this.props.message===nextProps.message||this.enable(nextProps.message):this.disable()},Prompt.prototype.componentWillUnmount=function(){this.disable()},Prompt.prototype.render=function(){return null},Prompt}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);Prompt.propTypes={when:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,message:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]).isRequired},Prompt.defaultProps={when:!0},Prompt.contextTypes={router:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({history:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({block:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired}).isRequired}).isRequired},__webpack_exports__.a=Prompt},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Redirect__=__webpack_require__(355);__webpack_exports__.a=__WEBPACK_IMPORTED_MODULE_0_react_router_es_Redirect__.a},function(module,__webpack_exports__,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var __WEBPACK_IMPORTED_MODULE_0_react__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_react___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__),__WEBPACK_IMPORTED_MODULE_1_prop_types__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_1_prop_types___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__),__WEBPACK_IMPORTED_MODULE_2_warning__=__webpack_require__(15),__WEBPACK_IMPORTED_MODULE_2_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__),__WEBPACK_IMPORTED_MODULE_3_invariant__=__webpack_require__(14),__WEBPACK_IMPORTED_MODULE_3_invariant___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_invariant__),__WEBPACK_IMPORTED_MODULE_4_history__=__webpack_require__(31),__WEBPACK_IMPORTED_MODULE_5__generatePath__=__webpack_require__(288),_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},Redirect=function(_React$Component){function Redirect(){return _classCallCheck(this,Redirect),_possibleConstructorReturn(this,_React$Component.apply(this,arguments))}return _inherits(Redirect,_React$Component),Redirect.prototype.isStatic=function(){return this.context.router&&this.context.router.staticContext},Redirect.prototype.componentWillMount=function(){__WEBPACK_IMPORTED_MODULE_3_invariant___default()(this.context.router,"You should not use <Redirect> outside a <Router>"),this.isStatic()&&this.perform()},Redirect.prototype.componentDidMount=function(){this.isStatic()||this.perform()},Redirect.prototype.componentDidUpdate=function(prevProps){var prevTo=Object(__WEBPACK_IMPORTED_MODULE_4_history__.createLocation)(prevProps.to),nextTo=Object(__WEBPACK_IMPORTED_MODULE_4_history__.createLocation)(this.props.to);if(Object(__WEBPACK_IMPORTED_MODULE_4_history__.locationsAreEqual)(prevTo,nextTo))return void __WEBPACK_IMPORTED_MODULE_2_warning___default()(!1,"You tried to redirect to the same route you're currently on: \""+nextTo.pathname+nextTo.search+'"');this.perform()},Redirect.prototype.computeTo=function(_ref){var computedMatch=_ref.computedMatch,to=_ref.to;return computedMatch?"string"==typeof to?Object(__WEBPACK_IMPORTED_MODULE_5__generatePath__.a)(to,computedMatch.params):_extends({},to,{pathname:Object(__WEBPACK_IMPORTED_MODULE_5__generatePath__.a)(to.pathname,computedMatch.params)}):to},Redirect.prototype.perform=function(){var history=this.context.router.history,push=this.props.push,to=this.computeTo(this.props);push?history.push(to):history.replace(to)},Redirect.prototype.render=function(){return null},Redirect}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);Redirect.propTypes={computedMatch:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,push:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,from:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,to:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired},Redirect.defaultProps={push:!1},Redirect.contextTypes={router:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({history:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({push:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,replace:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired}).isRequired,staticContext:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object}).isRequired},__webpack_exports__.a=Redirect},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_react_router_es_StaticRouter__=__webpack_require__(357);__webpack_exports__.a=__WEBPACK_IMPORTED_MODULE_0_react_router_es_StaticRouter__.a},function(module,__webpack_exports__,__webpack_require__){"use strict";function _objectWithoutProperties(obj,keys){var target={};for(var i in obj)keys.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var __WEBPACK_IMPORTED_MODULE_0_warning__=__webpack_require__(15),__WEBPACK_IMPORTED_MODULE_0_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__),__WEBPACK_IMPORTED_MODULE_1_invariant__=__webpack_require__(14),__WEBPACK_IMPORTED_MODULE_1_invariant___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__),__WEBPACK_IMPORTED_MODULE_2_react__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_2_react___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__),__WEBPACK_IMPORTED_MODULE_3_prop_types__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_3_prop_types___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__),__WEBPACK_IMPORTED_MODULE_4_history__=__webpack_require__(31),__WEBPACK_IMPORTED_MODULE_5__Router__=__webpack_require__(265),_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},addLeadingSlash=function(path){return"/"===path.charAt(0)?path:"/"+path},addBasename=function(basename,location){return basename?_extends({},location,{pathname:addLeadingSlash(basename)+location.pathname}):location},stripBasename=function(basename,location){if(!basename)return location;var base=addLeadingSlash(basename);return 0!==location.pathname.indexOf(base)?location:_extends({},location,{pathname:location.pathname.substr(base.length)})},createURL=function(location){return"string"==typeof location?location:Object(__WEBPACK_IMPORTED_MODULE_4_history__.createPath)(location)},staticHandler=function(methodName){return function(){__WEBPACK_IMPORTED_MODULE_1_invariant___default()(!1,"You cannot %s with <StaticRouter>",methodName)}},noop=function(){},StaticRouter=function(_React$Component){function StaticRouter(){var _temp,_this,_ret;_classCallCheck(this,StaticRouter);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,_React$Component.call.apply(_React$Component,[this].concat(args))),_this.createHref=function(path){return addLeadingSlash(_this.props.basename+createURL(path))},_this.handlePush=function(location){var _this$props=_this.props,basename=_this$props.basename,context=_this$props.context;context.action="PUSH",context.location=addBasename(basename,Object(__WEBPACK_IMPORTED_MODULE_4_history__.createLocation)(location)),context.url=createURL(context.location)},_this.handleReplace=function(location){var _this$props2=_this.props,basename=_this$props2.basename,context=_this$props2.context;context.action="REPLACE",context.location=addBasename(basename,Object(__WEBPACK_IMPORTED_MODULE_4_history__.createLocation)(location)),context.url=createURL(context.location)},_this.handleListen=function(){return noop},_this.handleBlock=function(){return noop},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(StaticRouter,_React$Component),StaticRouter.prototype.getChildContext=function(){return{router:{staticContext:this.props.context}}},StaticRouter.prototype.componentWillMount=function(){__WEBPACK_IMPORTED_MODULE_0_warning___default()(!this.props.history,"<StaticRouter> ignores the history prop. To use a custom history, use `import { Router }` instead of `import { StaticRouter as Router }`.")},StaticRouter.prototype.render=function(){var _props=this.props,basename=_props.basename,location=(_props.context,_props.location),props=_objectWithoutProperties(_props,["basename","context","location"]),history={createHref:this.createHref,action:"POP",location:stripBasename(basename,Object(__WEBPACK_IMPORTED_MODULE_4_history__.createLocation)(location)),push:this.handlePush,replace:this.handleReplace,go:staticHandler("go"),goBack:staticHandler("goBack"),goForward:staticHandler("goForward"),listen:this.handleListen,block:this.handleBlock};return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5__Router__.a,_extends({},props,{history:history}))},StaticRouter}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);StaticRouter.propTypes={basename:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,context:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,location:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object])},StaticRouter.defaultProps={basename:"",location:"/"},StaticRouter.childContextTypes={router:__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired},__webpack_exports__.a=StaticRouter},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Switch__=__webpack_require__(359);__webpack_exports__.a=__WEBPACK_IMPORTED_MODULE_0_react_router_es_Switch__.a},function(module,__webpack_exports__,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var __WEBPACK_IMPORTED_MODULE_0_react__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_react___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__),__WEBPACK_IMPORTED_MODULE_1_prop_types__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_1_prop_types___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__),__WEBPACK_IMPORTED_MODULE_2_warning__=__webpack_require__(15),__WEBPACK_IMPORTED_MODULE_2_warning___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__),__WEBPACK_IMPORTED_MODULE_3_invariant__=__webpack_require__(14),__WEBPACK_IMPORTED_MODULE_3_invariant___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_invariant__),__WEBPACK_IMPORTED_MODULE_4__matchPath__=__webpack_require__(266),Switch=function(_React$Component){function Switch(){return _classCallCheck(this,Switch),_possibleConstructorReturn(this,_React$Component.apply(this,arguments))}return _inherits(Switch,_React$Component),Switch.prototype.componentWillMount=function(){__WEBPACK_IMPORTED_MODULE_3_invariant___default()(this.context.router,"You should not use <Switch> outside a <Router>")},Switch.prototype.componentWillReceiveProps=function(nextProps){__WEBPACK_IMPORTED_MODULE_2_warning___default()(!(nextProps.location&&!this.props.location),'<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),__WEBPACK_IMPORTED_MODULE_2_warning___default()(!(!nextProps.location&&this.props.location),'<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.')},Switch.prototype.render=function(){var route=this.context.router.route,children=this.props.children,location=this.props.location||route.location,match=void 0,child=void 0;return __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.forEach(children,function(element){if(null==match&&__WEBPACK_IMPORTED_MODULE_0_react___default.a.isValidElement(element)){var _element$props=element.props,pathProp=_element$props.path,exact=_element$props.exact,strict=_element$props.strict,sensitive=_element$props.sensitive,from=_element$props.from,path=pathProp||from;child=element,match=Object(__WEBPACK_IMPORTED_MODULE_4__matchPath__.a)(location.pathname,{path:path,exact:exact,strict:strict,sensitive:sensitive},route.match)}}),match?__WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(child,{location:location,computedMatch:match}):null},Switch}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);Switch.contextTypes={router:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({route:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired}).isRequired},Switch.propTypes={children:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node,location:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object},__webpack_exports__.a=Switch},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_react_router_es_generatePath__=__webpack_require__(288);__webpack_exports__.a=__WEBPACK_IMPORTED_MODULE_0_react_router_es_generatePath__.a},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_react_router_es_matchPath__=__webpack_require__(266);__webpack_exports__.a=__WEBPACK_IMPORTED_MODULE_0_react_router_es_matchPath__.a},function(module,__webpack_exports__,__webpack_require__){"use strict";var __WEBPACK_IMPORTED_MODULE_0_react_router_es_withRouter__=__webpack_require__(363);__webpack_exports__.a=__WEBPACK_IMPORTED_MODULE_0_react_router_es_withRouter__.a},function(module,__webpack_exports__,__webpack_require__){"use strict";function _objectWithoutProperties(obj,keys){var target={};for(var i in obj)keys.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target}var __WEBPACK_IMPORTED_MODULE_0_react__=__webpack_require__(1),__WEBPACK_IMPORTED_MODULE_0_react___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__),__WEBPACK_IMPORTED_MODULE_1_prop_types__=__webpack_require__(3),__WEBPACK_IMPORTED_MODULE_1_prop_types___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__),__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__=__webpack_require__(280),__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__),__WEBPACK_IMPORTED_MODULE_3__Route__=__webpack_require__(287),_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},withRouter=function(Component){var C=function(props){var wrappedComponentRef=props.wrappedComponentRef,remainingProps=_objectWithoutProperties(props,["wrappedComponentRef"]);return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__Route__.a,{children:function(routeComponentProps){return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Component,_extends({},remainingProps,routeComponentProps,{ref:wrappedComponentRef}))}})};return C.displayName="withRouter("+(Component.displayName||Component.name)+")",C.WrappedComponent=Component,C.propTypes={wrappedComponentRef:__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func},__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default()(C,Component)};__webpack_exports__.a=withRouter},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_createReactClass=__webpack_require__(32),_createReactClass2=_interopRequireDefault(_createReactClass),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_bulk_actions=__webpack_require__(368),_bulk_actions2=_interopRequireDefault(_bulk_actions),_header=__webpack_require__(369),_header2=_interopRequireDefault(_header),_pages=__webpack_require__(371),_pages2=_interopRequireDefault(_pages),_search=__webpack_require__(372),_search2=_interopRequireDefault(_search),_groups=__webpack_require__(373),_groups2=_interopRequireDefault(_groups),_filters=__webpack_require__(374),_filters2=_interopRequireDefault(_filters),_listing_items=__webpack_require__(375),_listing_items2=_interopRequireDefault(_listing_items),_reactRouterDom=__webpack_require__(7),Listing=(0,_createReactClass2.default)({displayName:"Listing",propTypes:{limit:_propTypes2.default.number,sort_by:_propTypes2.default.string,sort_order:_propTypes2.default.string,params:_propTypes2.default.object.isRequired,auto_refresh:_propTypes2.default.bool,location:_propTypes2.default.shape({pathname:_propTypes2.default.string}),base_url:_propTypes2.default.string,type:_propTypes2.default.string,endpoint:_propTypes2.default.string.isRequired,afterGetItems:_propTypes2.default.func,messages:_propTypes2.default.shape({onRestore:_propTypes2.default.func,onTrash:_propTypes2.default.func,onDelete:_propTypes2.default.func}),onRenderItem:_propTypes2.default.func.isRequired,columns:_propTypes2.default.arrayOf(_propTypes2.default.object),bulk_actions:_propTypes2.default.arrayOf(_propTypes2.default.object),item_actions:_propTypes2.default.arrayOf(_propTypes2.default.object),search:_propTypes2.default.bool,groups:_propTypes2.default.bool,renderExtraActions:_propTypes2.default.func,onBeforeSelectFilter:_propTypes2.default.func,getListingItemKey:_propTypes2.default.func,history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},getDefaultProps:function(){return{limit:10,sort_by:null,sort_order:void 0,auto_refresh:!0,location:void 0,base_url:"",type:void 0,afterGetItems:void 0,messages:void 0,columns:[],bulk_actions:[],item_actions:[],search:!0,groups:!0,renderExtraActions:void 0,onBeforeSelectFilter:void 0,getListingItemKey:void 0}},getInitialState:function(){return{loading:!1,search:"",page:1,count:0,limit:10,sort_by:null,sort_order:null,items:[],groups:[],group:"all",filters:{},filter:{},selected_ids:[],selection:!1,meta:{}}},componentDidMount:function(){var _this=this;this.isComponentMounted=!0;var params=this.props.params||{};this.initWithParams(params),this.props.auto_refresh&&(0,_jquery2.default)(document).on("heartbeat-tick.mailpoet",function(){_this.getItems()})},componentWillReceiveProps:function(nextProps){var params=nextProps.params||{};this.initWithParams(params)},componentWillUnmount:function(){this.isComponentMounted=!1},setParams:function(){var _this2=this;if(this.props.location){var params=Object.keys(this.state).filter(function(key){return-1!==["group","filter","search","page","sort_by","sort_order"].indexOf(key)}).map(function(key){var value=_this2.state[key];return value===Object(value)?value=_jquery2.default.param(value):value===Boolean(value)&&(value=value.toString()),{key:key,value:value}}).filter(function(_ref){var value=_ref.value;return""!==value&&null!==value}).map(function(_ref2){return _ref2.key+"["+_ref2.value+"]"}).join("/"),url=this.getUrlWithParams(params);this.props.location.pathname!==url&&this.props.history.push(""+url)}},getUrlWithParams:function(params){var baseUrl=void 0!==this.props.base_url?this.props.base_url:null;return baseUrl?"/"+(baseUrl=this.setBaseUrlParams(baseUrl))+"/"+params:"/"+params},setBaseUrlParams:function(baseUrl){var ret=baseUrl;if(-1!==ret.indexOf(":")){var params=this.getParams();Object.keys(params).forEach(function(key){-1!==ret.indexOf(":"+key)&&(ret=ret.replace(":"+key,params[key]))})}return ret},getParams:function(){var params=_underscore2.default.omit(this.props.params,"splat");return this.props.type&&(params.type=this.props.type),params},getParam:function(param){var regex=/(.*)\[(.*)\]/,matches=regex.exec(param);return matches?[matches[1],matches[2]]:null},getItems:function(){var _this3=this;this.isComponentMounted&&(this.setState({loading:!0}),this.clearSelection(),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:this.props.endpoint,action:"listing",data:{params:this.getParams(),offset:(this.state.page-1)*this.state.limit,limit:this.state.limit,group:this.state.group,filter:this.state.filter,search:this.state.search,sort_by:this.state.sort_by,sort_order:this.state.sort_order}}).always(function(){_this3.isComponentMounted&&_this3.setState({loading:!1})}).done(function(response){_this3.isComponentMounted&&_this3.setState({items:response.data||[],filters:response.meta.filters||{},groups:response.meta.groups||[],count:response.meta.count||0,meta:_underscore2.default.omit(response.meta,["filters","groups","count"])},function(){"trash"===_this3.state.group&&0===response.meta.count&&_this3.handleGroup("all"),void 0!==_this3.props.afterGetItems&&_this3.props.afterGetItems(_this3.state)})}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})}))},initWithParams:function(params){var _this4=this,state=this.getInitialState();_underscore2.default.mapObject(params,function(param){param&¶m.split("/").forEach(function(item){if(item){var parsedParam=_this4.getParam(item);if(parsedParam){var _parsedParam=_slicedToArray(parsedParam,2),key=_parsedParam[0],value=_parsedParam[1],filters={};switch(key){case"filter":value.split("&").forEach(function(pair){var _pair$split=pair.split("="),_pair$split2=_slicedToArray(_pair$split,2),k=_pair$split2[0],v=_pair$split2[1];filters[k]=v}),state.filter=filters;break;default:state[key]=value}}}})}),void 0!==this.props.limit&&(state.limit=Math.abs(Number(this.props.limit))),null===state.sort_by&&void 0!==this.props.sort_by&&(state.sort_by=this.props.sort_by),null===state.sort_order&&void 0!==this.props.sort_order&&(state.sort_order=this.props.sort_order),this.setState(state,function(){_this4.getItems()})},handleRestoreItem:function(id){var _this5=this;this.setState({loading:!0,page:1}),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:this.props.endpoint,action:"restore",data:{id:id}}).done(function(response){void 0!==_this5.props.messages&&void 0!==_this5.props.messages.onRestore&&_this5.props.messages.onRestore(response),_this5.getItems()}).fail(function(response){_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},handleTrashItem:function(id){var _this6=this;this.setState({loading:!0,page:1}),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:this.props.endpoint,action:"trash",data:{id:id}}).done(function(response){void 0!==_this6.props.messages&&void 0!==_this6.props.messages.onTrash&&_this6.props.messages.onTrash(response),_this6.getItems()}).fail(function(response){_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},handleDeleteItem:function(id){var _this7=this;this.setState({loading:!0,page:1}),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:this.props.endpoint,action:"delete",data:{id:id}}).done(function(response){void 0!==_this7.props.messages&&void 0!==_this7.props.messages.onDelete&&_this7.props.messages.onDelete(response),_this7.getItems()}).fail(function(response){_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},handleEmptyTrash:function(){var _this8=this;return this.handleBulkAction("all",{action:"delete",group:"trash"}).done(function(response){void 0!==_this8.props.messages&&void 0!==_this8.props.messages.onDelete&&_this8.props.messages.onDelete(response),_this8.handleGroup("all")}).fail(function(response){_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},handleBulkAction:function(selectedIds,params){var _this9=this;if(!1===this.state.selection&&0===this.state.selected_ids.length&&"all"!==selectedIds)return!1;this.setState({loading:!0});var data=params||{};return data.listing={params:this.getParams(),offset:0,limit:0,filter:this.state.filter,group:this.state.group,search:this.state.search},"all"!==selectedIds&&(data.listing.selection=selectedIds),_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:this.props.endpoint,action:"bulkAction",data:data}).done(function(){_this9.getItems()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},handleSearch:function(search){var _this10=this;this.setState({search:search,page:1,selection:!1,selected_ids:[]},function(){_this10.setParams()})},handleSort:function(sortBy){var _this11=this,sortOrder=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc";this.setState({sort_by:sortBy,sort_order:"asc"===sortOrder?"asc":"desc"},function(){_this11.setParams()})},handleSelectItem:function(id,isChecked){var selectedIds=this.state.selected_ids,selection=!1;isChecked?(selectedIds=_jquery2.default.merge(selectedIds,[id]),0===(0,_jquery2.default)("tbody .check-column :checkbox:not(:checked)").length&&(selection="page")):selectedIds.splice(selectedIds.indexOf(id),1),this.setState({selection:selection,selected_ids:selectedIds})},handleSelectItems:function(isChecked){if(!1===isChecked)this.clearSelection();else{var selectedIds=this.state.items.map(function(item){return Number(item.id)});this.setState({selected_ids:selectedIds,selection:"page"})}},handleSelectAll:function(){"all"===this.state.selection?this.clearSelection():this.setState({selection:"all",selected_ids:[]})},clearSelection:function(){this.setState({selection:!1,selected_ids:[]})},handleFilter:function(filters){var _this12=this;this.setState({filter:filters,page:1},function(){_this12.setParams()})},handleGroup:function(group){var _this13=this;(0,_jquery2.default)("#search_input").val(""),this.setState({group:group,filter:{},search:"",page:1},function(){_this13.setParams()})},handleSetPage:function(page){var _this14=this;this.setState({page:page,selection:!1,selected_ids:[]},function(){_this14.setParams()})},handleRenderItem:function(item,actions){return this.props.onRenderItem(item,actions,this.state.meta).props.children},handleRefreshItems:function(){this.getItems()},render:function(){var items=this.state.items,sortBy=this.state.sort_by,sortOrder=this.state.sort_order,columns=this.props.columns||[];columns=columns.filter(function(column){return void 0===column.display||!0==!!column.display});var bulkActions=this.props.bulk_actions||[];"trash"===this.state.group&&bulkActions.length>0&&(bulkActions=[{name:"restore",label:_mailpoet2.default.I18n.t("restore"),onSuccess:this.props.messages.onRestore},{name:"delete",label:_mailpoet2.default.I18n.t("deletePermanently"),onSuccess:this.props.messages.onDelete}]);var itemActions=this.props.item_actions||[],tableClasses=(0,_classnames2.default)("mailpoet_listing_table","wp-list-table","widefat","fixed","striped",{mailpoet_listing_loading:this.state.loading}),search=_react2.default.createElement(_search2.default,{onSearch:this.handleSearch,search:this.state.search});!1===this.props.search&&(search=!1);var groups=_react2.default.createElement(_groups2.default,{groups:this.state.groups,group:this.state.group,onSelectGroup:this.handleGroup});!1===this.props.groups&&(groups=!1);var messages={};void 0!==this.props.messages&&(messages=this.props.messages);var extraActions=void 0;return"function"==typeof this.props.renderExtraActions&&(extraActions=this.props.renderExtraActions(this.state)),_react2.default.createElement("div",null,groups,search,_react2.default.createElement("div",{className:"tablenav top clearfix"},_react2.default.createElement(_bulk_actions2.default,{count:this.state.count,bulk_actions:bulkActions,selection:this.state.selection,selected_ids:this.state.selected_ids,onBulkAction:this.handleBulkAction}),_react2.default.createElement(_filters2.default,{filters:this.state.filters,filter:this.state.filter,group:this.state.group,onBeforeSelectFilter:this.props.onBeforeSelectFilter||null,onSelectFilter:this.handleFilter,onEmptyTrash:this.handleEmptyTrash}),extraActions,_react2.default.createElement(_pages2.default,{count:this.state.count,page:this.state.page,limit:this.state.limit,onSetPage:this.handleSetPage})),_react2.default.createElement("table",{className:tableClasses},_react2.default.createElement("thead",null,_react2.default.createElement(_header2.default,{onSort:this.handleSort,onSelectItems:this.handleSelectItems,selection:this.state.selection,sort_by:sortBy,sort_order:sortOrder,columns:columns,is_selectable:bulkActions.length>0})),_react2.default.createElement(_listing_items2.default,{onRenderItem:this.handleRenderItem,getListingItemKey:this.props.getListingItemKey,onDeleteItem:this.handleDeleteItem,onRestoreItem:this.handleRestoreItem,onTrashItem:this.handleTrashItem,onRefreshItems:this.handleRefreshItems,columns:columns,is_selectable:bulkActions.length>0,onSelectItem:this.handleSelectItem,onSelectAll:this.handleSelectAll,selection:this.state.selection,selected_ids:this.state.selected_ids,loading:this.state.loading,group:this.state.group,count:this.state.count,limit:this.state.limit,item_actions:itemActions,messages:messages,items:items}),_react2.default.createElement("tfoot",null,_react2.default.createElement(_header2.default,{onSort:this.handleSort,onSelectItems:this.handleSelectItems,selection:this.state.selection,sort_by:sortBy,sort_order:sortOrder,columns:columns,is_selectable:bulkActions.length>0}))),_react2.default.createElement("div",{className:"tablenav bottom"},_react2.default.createElement(_bulk_actions2.default,{count:this.state.count,bulk_actions:bulkActions,selection:this.state.selection,selected_ids:this.state.selected_ids,onBulkAction:this.handleBulkAction}),_react2.default.createElement(_pages2.default,{count:this.state.count,page:this.state.page,limit:this.state.limit,onSetPage:this.handleSetPage})))}});module.exports=(0,_reactRouterDom.withRouter)(Listing)},function(module,exports,__webpack_require__){"use strict";function identity(fn){return fn}function factory(ReactComponent,isValidElement,ReactNoopUpdateQueue){function validateMethodOverride(isAlreadyDefined,name){var specPolicy=ReactClassInterface.hasOwnProperty(name)?ReactClassInterface[name]:null;ReactClassMixin.hasOwnProperty(name)&&_invariant("OVERRIDE_BASE"===specPolicy,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",name),isAlreadyDefined&&_invariant("DEFINE_MANY"===specPolicy||"DEFINE_MANY_MERGED"===specPolicy,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",name)}function mixSpecIntoComponent(Constructor,spec){if(spec){_invariant("function"!=typeof spec,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),_invariant(!isValidElement(spec),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var proto=Constructor.prototype,autoBindPairs=proto.__reactAutoBindPairs;spec.hasOwnProperty(MIXINS_KEY)&&RESERVED_SPEC_KEYS.mixins(Constructor,spec.mixins);for(var name in spec)if(spec.hasOwnProperty(name)&&name!==MIXINS_KEY){var property=spec[name],isAlreadyDefined=proto.hasOwnProperty(name);if(validateMethodOverride(isAlreadyDefined,name),RESERVED_SPEC_KEYS.hasOwnProperty(name))RESERVED_SPEC_KEYS[name](Constructor,property);else{var isReactClassMethod=ReactClassInterface.hasOwnProperty(name),isFunction="function"==typeof property,shouldAutoBind=isFunction&&!isReactClassMethod&&!isAlreadyDefined&&!1!==spec.autobind;if(shouldAutoBind)autoBindPairs.push(name,property),proto[name]=property;else if(isAlreadyDefined){var specPolicy=ReactClassInterface[name];_invariant(isReactClassMethod&&("DEFINE_MANY_MERGED"===specPolicy||"DEFINE_MANY"===specPolicy),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",specPolicy,name),"DEFINE_MANY_MERGED"===specPolicy?proto[name]=createMergedResultFunction(proto[name],property):"DEFINE_MANY"===specPolicy&&(proto[name]=createChainedFunction(proto[name],property))}else proto[name]=property}}}else;}function mixStaticSpecIntoComponent(Constructor,statics){if(statics)for(var name in statics){var property=statics[name];if(statics.hasOwnProperty(name)){var isReserved=name in RESERVED_SPEC_KEYS;_invariant(!isReserved,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',name);var isAlreadyDefined=name in Constructor;if(isAlreadyDefined){var specPolicy=ReactClassStaticInterface.hasOwnProperty(name)?ReactClassStaticInterface[name]:null;return _invariant("DEFINE_MANY_MERGED"===specPolicy,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",name),void(Constructor[name]=createMergedResultFunction(Constructor[name],property))}Constructor[name]=property}}}function mergeIntoWithNoDuplicateKeys(one,two){_invariant(one&&two&&"object"==typeof one&&"object"==typeof two,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var key in two)two.hasOwnProperty(key)&&(_invariant(void 0===one[key],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",key),one[key]=two[key]);return one}function createMergedResultFunction(one,two){return function(){var a=one.apply(this,arguments),b=two.apply(this,arguments);if(null==a)return b;if(null==b)return a;var c={};return mergeIntoWithNoDuplicateKeys(c,a),mergeIntoWithNoDuplicateKeys(c,b),c}}function createChainedFunction(one,two){return function(){one.apply(this,arguments),two.apply(this,arguments)}}function bindAutoBindMethod(component,method){var boundMethod=method.bind(component);return boundMethod}function bindAutoBindMethods(component){for(var pairs=component.__reactAutoBindPairs,i=0;i<pairs.length;i+=2){var autoBindKey=pairs[i],method=pairs[i+1];component[autoBindKey]=bindAutoBindMethod(component,method)}}function createClass(spec){var Constructor=identity(function(props,context,updater){this.__reactAutoBindPairs.length&&bindAutoBindMethods(this),this.props=props,this.context=context,this.refs=emptyObject,this.updater=updater||ReactNoopUpdateQueue,this.state=null;var initialState=this.getInitialState?this.getInitialState():null;_invariant("object"==typeof initialState&&!Array.isArray(initialState),"%s.getInitialState(): must return an object or null",Constructor.displayName||"ReactCompositeComponent"),this.state=initialState});Constructor.prototype=new ReactClassComponent,Constructor.prototype.constructor=Constructor,Constructor.prototype.__reactAutoBindPairs=[],injectedMixins.forEach(mixSpecIntoComponent.bind(null,Constructor)),mixSpecIntoComponent(Constructor,IsMountedPreMixin),mixSpecIntoComponent(Constructor,spec),mixSpecIntoComponent(Constructor,IsMountedPostMixin),Constructor.getDefaultProps&&(Constructor.defaultProps=Constructor.getDefaultProps()),_invariant(Constructor.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var methodName in ReactClassInterface)Constructor.prototype[methodName]||(Constructor.prototype[methodName]=null);return Constructor}var injectedMixins=[],ReactClassInterface={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},ReactClassStaticInterface={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},RESERVED_SPEC_KEYS={displayName:function(Constructor,displayName){Constructor.displayName=displayName},mixins:function(Constructor,mixins){if(mixins)for(var i=0;i<mixins.length;i++)mixSpecIntoComponent(Constructor,mixins[i])},childContextTypes:function(Constructor,childContextTypes){Constructor.childContextTypes=_assign({},Constructor.childContextTypes,childContextTypes)},contextTypes:function(Constructor,contextTypes){Constructor.contextTypes=_assign({},Constructor.contextTypes,contextTypes)},getDefaultProps:function(Constructor,getDefaultProps){Constructor.getDefaultProps?Constructor.getDefaultProps=createMergedResultFunction(Constructor.getDefaultProps,getDefaultProps):Constructor.getDefaultProps=getDefaultProps},propTypes:function(Constructor,propTypes){Constructor.propTypes=_assign({},Constructor.propTypes,propTypes)},statics:function(Constructor,statics){mixStaticSpecIntoComponent(Constructor,statics)},autobind:function(){}},IsMountedPreMixin={componentDidMount:function(){this.__isMounted=!0}},IsMountedPostMixin={componentWillUnmount:function(){this.__isMounted=!1}},ReactClassMixin={replaceState:function(newState,callback){this.updater.enqueueReplaceState(this,newState,callback)},isMounted:function(){return!!this.__isMounted}},ReactClassComponent=function(){};return _assign(ReactClassComponent.prototype,ReactComponent.prototype,ReactClassMixin),createClass}var _assign=__webpack_require__(25),emptyObject=__webpack_require__(366),_invariant=__webpack_require__(367),MIXINS_KEY="mixins";module.exports=factory},function(module,exports,__webpack_require__){"use strict";var emptyObject={};module.exports=emptyObject},function(module,exports,__webpack_require__){"use strict";function invariant(condition,format,a,b,c,d,e,f){if(validateFormat(format),!condition){var error;if(void 0===format)error=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var args=[a,b,c,d,e,f],argIndex=0;error=new Error(format.replace(/%s/g,function(){return args[argIndex++]})),error.name="Invariant Violation"}throw error.framesToPop=1,error}}var validateFormat=function(format){};module.exports=invariant},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),ListingBulkActions=function(_React$Component){function ListingBulkActions(props){_classCallCheck(this,ListingBulkActions);var _this=_possibleConstructorReturn(this,(ListingBulkActions.__proto__||Object.getPrototypeOf(ListingBulkActions)).call(this,props));return _this.myRef=_react2.default.createRef(),_this.state={action:!1,extra:!1},_this.handleApplyAction=_this.handleApplyAction.bind(_this),_this.handleChangeAction=_this.handleChangeAction.bind(_this),_this}return _inherits(ListingBulkActions,_React$Component),_createClass(ListingBulkActions,[{key:"getSelectedAction",value:function(){var selectedAction=this.myRef.current.value;if(selectedAction.length>0){var action=this.props.bulk_actions.filter(function(act){return act.name===selectedAction});if(action.length>0)return action[0]}return null}},{key:"handleApplyAction",value:function(e){e.preventDefault();var action=this.getSelectedAction();if(null!==action){var selectedIds="all"!==this.props.selection?this.props.selected_ids:[],data=void 0!==action.getData?action.getData():{};data.action=this.state.action;var onSuccess=function(){};if(void 0!==action.onSuccess&&(onSuccess=action.onSuccess),data.action){var promise=this.props.onBulkAction(selectedIds,data);!1!==promise&&promise.then(onSuccess)}this.setState({action:!1,extra:!1})}}},{key:"handleChangeAction",value:function(e){var _this2=this;this.setState({action:e.target.value,extra:!1},function(){var action=_this2.getSelectedAction();null!==action&&void 0!==action.onSelect&&_this2.setState({extra:action.onSelect(e)})})}},{key:"render",value:function(){return 0===this.props.bulk_actions.length?null:_react2.default.createElement("div",{className:"alignleft actions bulkactions"},_react2.default.createElement("label",{className:"screen-reader-text",htmlFor:"bulk-action-selector-top"},_mailpoet2.default.I18n.t("selectBulkAction")),_react2.default.createElement("select",{name:"bulk_actions",ref:this.myRef,value:this.state.action,onChange:this.handleChangeAction},_react2.default.createElement("option",{value:""},_mailpoet2.default.I18n.t("bulkActions")),this.props.bulk_actions.map(function(action){return _react2.default.createElement("option",{value:action.name,key:"action-"+action.name},action.label)})),_react2.default.createElement("input",{onClick:this.handleApplyAction,type:"submit",defaultValue:_mailpoet2.default.I18n.t("apply"),className:"button action"}),this.state.extra)}}]),ListingBulkActions}(_react2.default.Component);ListingBulkActions.propTypes={bulk_actions:_propTypes2.default.arrayOf(_propTypes2.default.object).isRequired,selection:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.bool]).isRequired,selected_ids:_propTypes2.default.arrayOf(_propTypes2.default.number).isRequired,onBulkAction:_propTypes2.default.func.isRequired},exports.default=ListingBulkActions},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_listing_column=__webpack_require__(370),_listing_column2=_interopRequireDefault(_listing_column),ListingHeader=function(_React$Component){function ListingHeader(){var _ref,_temp,_this,_ret;_classCallCheck(this,ListingHeader);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=ListingHeader.__proto__||Object.getPrototypeOf(ListingHeader)).call.apply(_ref,[this].concat(args))),_this.handleSelectItems=function(evt){return _this.props.onSelectItems(evt.target.checked)},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(ListingHeader,_React$Component),_createClass(ListingHeader,[{key:"render",value:function(){var _this2=this,columns=this.props.columns.map(function(column,index){var renderColumn=column;return renderColumn.is_primary=0===index,renderColumn.sorted=_this2.props.sort_by===column.name?_this2.props.sort_order:"desc",_react2.default.createElement(_listing_column2.default,{onSort:_this2.props.onSort,sort_by:_this2.props.sort_by,key:"column-"+column.name,column:renderColumn})}),checkbox=void 0;return!0===this.props.is_selectable&&(checkbox=_react2.default.createElement("th",{className:"manage-column column-cb check-column"},_react2.default.createElement("label",{className:"screen-reader-text",htmlFor:"select_all"},_mailpoet2.default.I18n.t("selectAll")),_react2.default.createElement("input",{type:"checkbox",name:"select_all",id:"select_all",checked:this.props.selection,onChange:this.handleSelectItems}))),_react2.default.createElement("tr",null,checkbox,columns)}}]),ListingHeader}(_react2.default.Component);ListingHeader.propTypes={onSelectItems:_propTypes2.default.func.isRequired,onSort:_propTypes2.default.func.isRequired,columns:_propTypes2.default.arrayOf(_propTypes2.default.object),sort_by:_propTypes2.default.string,sort_order:_propTypes2.default.string,is_selectable:_propTypes2.default.bool.isRequired,selection:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.bool]).isRequired},ListingHeader.defaultProps={columns:[],sort_by:void 0,sort_order:"desc"},module.exports=ListingHeader},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),ListingColumn=function(_React$Component){function ListingColumn(){var _ref,_temp,_this,_ret;_classCallCheck(this,ListingColumn);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=ListingColumn.__proto__||Object.getPrototypeOf(ListingColumn)).call.apply(_ref,[this].concat(args))),_this.handleSort=function(){var sortBy=_this.props.column.name,sortOrder="asc"===_this.props.column.sorted?"desc":"asc";_this.props.onSort(sortBy,sortOrder)},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(ListingColumn,_React$Component),_createClass(ListingColumn,[{key:"render",value:function(){var classes=(0,_classnames2.default)("manage-column",{"column-primary":this.props.column.is_primary},{sortable:this.props.column.sortable},this.props.column.sorted,{sorted:this.props.sort_by===this.props.column.name}),label=void 0;return label=!0===this.props.column.sortable?_react2.default.createElement("a",{onClick:this.handleSort,role:"button",tabIndex:0},_react2.default.createElement("span",null,this.props.column.label),_react2.default.createElement("span",{className:"sorting-indicator"})):this.props.column.label,_react2.default.createElement("th",{role:"columnheader",className:classes,id:this.props.column.name,scope:"col",width:this.props.column.width||null},label)}}]),ListingColumn}(_react2.default.Component);ListingColumn.propTypes={column:_propTypes2.default.shape({name:_propTypes2.default.string,sorted:_propTypes2.default.string,is_primary:_propTypes2.default.bool,sortable:_propTypes2.default.bool,label:_propTypes2.default.string,width:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number])}).isRequired,sort_by:_propTypes2.default.string,onSort:_propTypes2.default.func.isRequired},ListingColumn.defaultProps={sort_by:void 0},module.exports=ListingColumn},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),ListingPages=function(_React$Component){function ListingPages(){var _ref,_temp,_this,_ret;_classCallCheck(this,ListingPages);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=ListingPages.__proto__||Object.getPrototypeOf(ListingPages)).call.apply(_ref,[this].concat(args))),_this.state={page:null},_this.setPage=function(page){_this.setState({page:null},function(){_this.props.onSetPage(_this.constrainPage(page))})},_this.setFirstPage=function(){_this.setPage(1)},_this.setLastPage=function(){_this.setPage(_this.getLastPage())},_this.setPreviousPage=function(){_this.setPage(_this.constrainPage(parseInt(_this.props.page,10)-1))},_this.setNextPage=function(){_this.setPage(_this.constrainPage(parseInt(_this.props.page,10)+1))},_this.getLastPage=function(){return Math.ceil(_this.props.count/_this.props.limit)},_this.handleSetManualPage=function(e){13===e.which&&_this.setPage(_this.state.page)},_this.handleChangeManualPage=function(e){_this.setState({page:e.target.value})},_this.handleBlurManualPage=function(e){_this.setPage(e.target.value)},_this.constrainPage=function(page){return Math.min(Math.max(1,Math.abs(Number(page))),_this.getLastPage())},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(ListingPages,_React$Component),_createClass(ListingPages,[{key:"render",value:function(){if(0===this.props.count)return!1;var pagination=!1,firstPage=_react2.default.createElement("span",{"aria-hidden":"true",className:"tablenav-pages-navspan"},"«"),previousPage=_react2.default.createElement("span",{"aria-hidden":"true",className:"tablenav-pages-navspan"},"‹"),nextPage=_react2.default.createElement("span",{"aria-hidden":"true",className:"tablenav-pages-navspan"},"›"),lastPage=_react2.default.createElement("span",{"aria-hidden":"true",className:"tablenav-pages-navspan"},"»");if(this.props.limit>0&&this.props.count>this.props.limit){this.props.page>1&&(previousPage=_react2.default.createElement("a",{href:"javascript:;",onClick:this.setPreviousPage,className:"prev-page"},_react2.default.createElement("span",{className:"screen-reader-text"},_mailpoet2.default.I18n.t("previousPage")),_react2.default.createElement("span",{"aria-hidden":"true"},"‹"))),this.props.page>2&&(firstPage=_react2.default.createElement("a",{href:"javascript:;",onClick:this.setFirstPage,className:"first-page"},_react2.default.createElement("span",{className:"screen-reader-text"},_mailpoet2.default.I18n.t("firstPage")),_react2.default.createElement("span",{"aria-hidden":"true"},"«"))),this.props.page<this.getLastPage()&&(nextPage=_react2.default.createElement("a",{href:"javascript:;",onClick:this.setNextPage,className:"next-page"},_react2.default.createElement("span",{className:"screen-reader-text"},_mailpoet2.default.I18n.t("nextPage")),_react2.default.createElement("span",{"aria-hidden":"true"},"›"))),this.props.page<this.getLastPage()-1&&(lastPage=_react2.default.createElement("a",{href:"javascript:;",onClick:this.setLastPage,className:"last-page"},_react2.default.createElement("span",{className:"screen-reader-text"},_mailpoet2.default.I18n.t("lastPage")),_react2.default.createElement("span",{"aria-hidden":"true"},"»")));var pageValue=this.props.page;null!==this.state.page&&(pageValue=this.state.page),pagination=_react2.default.createElement("span",{className:"pagination-links"},firstPage," ",previousPage," ",_react2.default.createElement("span",{className:"paging-input"},_react2.default.createElement("label",{className:"screen-reader-text",htmlFor:"current-page-selector"},_mailpoet2.default.I18n.t("currentPage")),_react2.default.createElement("input",{type:"text",onChange:this.handleChangeManualPage,onKeyUp:this.handleSetManualPage,onBlur:this.handleBlurManualPage,"aria-describedby":"table-paging",size:"2",value:pageValue,name:"paged",id:"current-page-selector",className:"current-page"}),_mailpoet2.default.I18n.t("pageOutOf")," ",_react2.default.createElement("span",{className:"total-pages"},Math.ceil(this.props.count/this.props.limit).toLocaleString()))," ",nextPage," ",lastPage)}var classes=(0,_classnames2.default)("tablenav-pages",{"one-page":this.props.count<=this.props.limit}),numberOfItemsLabel=void 0;return numberOfItemsLabel=1===Number(this.props.count)?_mailpoet2.default.I18n.t("numberOfItemsSingular"):_mailpoet2.default.I18n.t("numberOfItemsMultiple").replace("%$1d",parseInt(this.props.count,10).toLocaleString()),_react2.default.createElement("div",{className:classes},_react2.default.createElement("span",{className:"displaying-num"},numberOfItemsLabel),pagination)}}]),ListingPages}(_react2.default.Component);ListingPages.propTypes={onSetPage:_propTypes2.default.func.isRequired,page:_propTypes2.default.oneOfType([_propTypes2.default.number,_propTypes2.default.string]).isRequired,count:_propTypes2.default.number.isRequired,limit:_propTypes2.default.number.isRequired},module.exports=ListingPages},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),ListingSearch=function(_React$Component){function ListingSearch(props){_classCallCheck(this,ListingSearch);var _this=_possibleConstructorReturn(this,(ListingSearch.__proto__||Object.getPrototypeOf(ListingSearch)).call(this,props));return _this.state={search:""},_this.handleSearch=_this.handleSearch.bind(_this),_this.onChange=_this.onChange.bind(_this),_this}return _inherits(ListingSearch,_React$Component),_createClass(ListingSearch,[{key:"componentWillReceiveProps",value:function(nextProps){this.setState({search:nextProps.search})}},{key:"onChange",value:function(e){this.setState({search:e.target.value})}},{key:"handleSearch",value:function(e){e.preventDefault(),this.props.onSearch(this.state.search.trim())}},{key:"render",value:function(){return!1!==this.props.search&&_react2.default.createElement("form",{name:"search",onSubmit:this.handleSearch},_react2.default.createElement("p",{className:"search-box"},_react2.default.createElement("label",{htmlFor:"search_input",className:"screen-reader-text"},_mailpoet2.default.I18n.t("searchLabel")),_react2.default.createElement("input",{type:"search",id:"search_input",name:"s",onChange:this.onChange,value:this.state.search}),_react2.default.createElement("input",{type:"submit",value:_mailpoet2.default.I18n.t("searchLabel"),className:"button"})))}}]),ListingSearch}(_react2.default.Component);ListingSearch.propTypes={search:_propTypes2.default.string.isRequired,onSearch:_propTypes2.default.func.isRequired},exports.default=ListingSearch},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),ListingGroups=function(_React$Component){function ListingGroups(props){_classCallCheck(this,ListingGroups);var _this=_possibleConstructorReturn(this,(ListingGroups.__proto__||Object.getPrototypeOf(ListingGroups)).call(this,props));return _this.handleSelect=_this.handleSelect.bind(_this),_this}return _inherits(ListingGroups,_React$Component),_createClass(ListingGroups,[{key:"handleSelect",value:function(group){return this.props.onSelectGroup(group)}},{key:"render",value:function(){var _this2=this,groups=this.props.groups.map(function(group,index){if("trash"===group.name&&0===group.count)return!1;var classes=(0,_classnames2.default)({current:group.name===_this2.props.group});return _react2.default.createElement("li",{key:group.name},index>0?" |":"",_react2.default.createElement("a",{href:"javascript:;",className:classes,onClick:function(){return _this2.handleSelect(group.name)},"data-automation-id":"filters_"+group.label.replace(" ","_").toLowerCase()},group.label," ",_react2.default.createElement("span",{className:"count"},"(",parseInt(group.count,10).toLocaleString(),")")))});return _react2.default.createElement("ul",{className:"subsubsub"},groups)}}]),ListingGroups}(_react2.default.Component);ListingGroups.propTypes={onSelectGroup:_propTypes2.default.func.isRequired,groups:_propTypes2.default.arrayOf(_propTypes2.default.shape({name:_propTypes2.default.string,count:_propTypes2.default.number})).isRequired,group:_propTypes2.default.any.isRequired},exports.default=ListingGroups},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),ListingFilters=function(_React$Component){function ListingFilters(){var _ref,_temp,_this,_ret;_classCallCheck(this,ListingFilters);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=ListingFilters.__proto__||Object.getPrototypeOf(ListingFilters)).call.apply(_ref,[this].concat(args))),_this.getAvailableFilters=function(){var filters=_this.props.filters;return Object.keys(filters).filter(function(filter){return!(0===filters[filter].length||1===filters[filter].length&&!filters[filter][0].value)})},_this.handleEmptyTrash=function(){return _this.props.onEmptyTrash()},_this.handleFilterAction=function(){var filters={};return _this.getAvailableFilters().forEach(function(filter,i){filters[_this["filter-"+i].name]=_this["filter-"+i].value}),_this.props.onBeforeSelectFilter&&_this.props.onBeforeSelectFilter(filters),_this.props.onSelectFilter(filters)},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(ListingFilters,_React$Component),_createClass(ListingFilters,[{key:"componentDidUpdate",value:function(){var _this2=this,selectedFilters=this.props.filter;this.getAvailableFilters().forEach(function(filter,i){void 0!==selectedFilters[filter]&&selectedFilters[filter]&&(0,_jquery2.default)(_this2["filter-"+i]).val(selectedFilters[filter]).trigger("change")})}},{key:"render",value:function(){var _this3=this,filters=this.props.filters,availableFilters=this.getAvailableFilters().map(function(filter,i){return _react2.default.createElement("select",{ref:function(c){_this3["filter-"+i]=c},key:"filter-"+filter,name:filter},filters[filter].map(function(option){return _react2.default.createElement("option",{value:option.value,key:"filter-option-"+option.value},option.label)}))}),button=void 0;availableFilters.length>0&&(button=_react2.default.createElement("input",{id:"post-query-submit",onClick:this.handleFilterAction,type:"submit",defaultValue:_mailpoet2.default.I18n.t("filter"),className:"button"}));var emptyTrash=void 0;return"trash"===this.props.group&&(emptyTrash=_react2.default.createElement("input",{onClick:this.handleEmptyTrash,type:"submit",value:_mailpoet2.default.I18n.t("emptyTrash"),className:"button"})),_react2.default.createElement("div",{className:"alignleft actions actions"},availableFilters,button,emptyTrash)}}]),ListingFilters}(_react2.default.Component);ListingFilters.propTypes={filters:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.array]).isRequired,onEmptyTrash:_propTypes2.default.func.isRequired,onBeforeSelectFilter:_propTypes2.default.func,onSelectFilter:_propTypes2.default.func.isRequired,filter:_propTypes2.default.objectOf(_propTypes2.default.string).isRequired,group:_propTypes2.default.string.isRequired},ListingFilters.defaultProps={onBeforeSelectFilter:void 0},exports.default=ListingFilters},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_listing_item=__webpack_require__(376),_listing_item2=_interopRequireDefault(_listing_item),ListingItems=function(_React$Component){function ListingItems(){return _classCallCheck(this,ListingItems),_possibleConstructorReturn(this,(ListingItems.__proto__||Object.getPrototypeOf(ListingItems)).apply(this,arguments))}return _inherits(ListingItems,_React$Component),_createClass(ListingItems,[{key:"render",value:function(){var _this2=this;if(0===this.props.items.length){var message=void 0;return message=!0===this.props.loading?this.props.messages.onLoadingItems&&this.props.messages.onLoadingItems(this.props.group)||_mailpoet2.default.I18n.t("loadingItems"):this.props.messages.onNoItemsFound&&this.props.messages.onNoItemsFound(this.props.group)||_mailpoet2.default.I18n.t("noItemsFound"),_react2.default.createElement("tbody",null,_react2.default.createElement("tr",{className:"no-items"},_react2.default.createElement("td",{colSpan:this.props.columns.length+(this.props.is_selectable?1:0),className:"colspanchange"},message)))}var selectAllClasses=(0,_classnames2.default)("mailpoet_select_all",{mailpoet_hidden:!1===this.props.selection||this.props.count<=this.props.limit});return _react2.default.createElement("tbody",null,_react2.default.createElement("tr",{className:selectAllClasses},_react2.default.createElement("td",{colSpan:this.props.columns.length+(this.props.is_selectable?1:0)},"all"!==this.props.selection?_mailpoet2.default.I18n.t("selectAllLabel"):_mailpoet2.default.I18n.t("selectedAllLabel").replace("%d",this.props.count.toLocaleString())," ",_react2.default.createElement("a",{onClick:this.props.onSelectAll,href:"javascript:;"},"all"!==this.props.selection?_mailpoet2.default.I18n.t("selectAllLink"):_mailpoet2.default.I18n.t("clearSelection")))),this.props.items.map(function(item){var renderItem=item;renderItem.id=parseInt(item.id,10),renderItem.selected=-1!==_this2.props.selected_ids.indexOf(renderItem.id);var key="item-"+renderItem.id+"-"+item.id;return"function"==typeof _this2.props.getListingItemKey&&(key=_this2.props.getListingItemKey(item)),_react2.default.createElement(_listing_item2.default,{columns:_this2.props.columns,onSelectItem:_this2.props.onSelectItem,onRenderItem:_this2.props.onRenderItem,onDeleteItem:_this2.props.onDeleteItem,onRestoreItem:_this2.props.onRestoreItem,onTrashItem:_this2.props.onTrashItem,onRefreshItems:_this2.props.onRefreshItems,selection:_this2.props.selection,is_selectable:_this2.props.is_selectable,item_actions:_this2.props.item_actions,group:_this2.props.group,key:key,item:renderItem})}))}}]),ListingItems}(_react2.default.Component);ListingItems.propTypes={items:_propTypes2.default.arrayOf(_propTypes2.default.object).isRequired,loading:_propTypes2.default.bool.isRequired,messages:_propTypes2.default.shape({onLoadingItems:_propTypes2.default.func,onNoItemsFound:_propTypes2.default.func}).isRequired,group:_propTypes2.default.string.isRequired,columns:_propTypes2.default.arrayOf(_propTypes2.default.object).isRequired,is_selectable:_propTypes2.default.bool.isRequired,selection:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number,_propTypes2.default.bool]).isRequired,count:_propTypes2.default.number.isRequired,limit:_propTypes2.default.number.isRequired,onSelectAll:_propTypes2.default.func.isRequired,selected_ids:_propTypes2.default.arrayOf(_propTypes2.default.number).isRequired,getListingItemKey:_propTypes2.default.func,onSelectItem:_propTypes2.default.func.isRequired,onRenderItem:_propTypes2.default.func.isRequired,onDeleteItem:_propTypes2.default.func.isRequired,onRestoreItem:_propTypes2.default.func.isRequired,onTrashItem:_propTypes2.default.func.isRequired,onRefreshItems:_propTypes2.default.func.isRequired,item_actions:_propTypes2.default.arrayOf(_propTypes2.default.object).isRequired},ListingItems.defaultProps={getListingItemKey:void 0},module.exports=ListingItems},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_reactRouterDom=__webpack_require__(7),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),ListingItem=function(_React$Component){function ListingItem(){var _ref,_temp,_this,_ret;_classCallCheck(this,ListingItem);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=ListingItem.__proto__||Object.getPrototypeOf(ListingItem)).call.apply(_ref,[this].concat(args))),_this.state={expanded:!1},_this.handleSelectItem=function(e){return _this.props.onSelectItem(parseInt(e.target.value,10),e.target.checked),!e.target.checked},_this.handleRestoreItem=function(id){_this.props.onRestoreItem(id)},_this.handleTrashItem=function(id){_this.props.onTrashItem(id)},_this.handleDeleteItem=function(id){_this.props.onDeleteItem(id)},_this.handleToggleItem=function(){_this.setState({expanded:!_this.state.expanded})},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(ListingItem,_React$Component),_createClass(ListingItem,[{key:"render",value:function(){var _this2=this,checkbox=!1;!0===this.props.is_selectable&&(checkbox=_react2.default.createElement("th",{className:"check-column",scope:"row"},_react2.default.createElement("label",{className:"screen-reader-text",htmlFor:"listing-row-checkbox-"+this.props.item.id},"Select "+this.props.item[this.props.columns[0].name]),_react2.default.createElement("input",{type:"checkbox",value:this.props.item.id,checked:this.props.item.selected||"all"===this.props.selection,onChange:this.handleSelectItem,disabled:"all"===this.props.selection,id:"listing-row-checkbox-"+this.props.item.id})));var customActions=this.props.item_actions,itemActions=!1;if(customActions.length>0){var isFirst=!0;itemActions=customActions.filter(function(action){return void 0===action.display||action.display(_this2.props.item)}).map(function(action,index){var customAction=null;return customAction="trash"===action.name?_react2.default.createElement("span",{key:"action-"+action.name,className:"trash"},isFirst?"":" | ",_react2.default.createElement("a",{href:"javascript:;",onClick:function(){return _this2.handleTrashItem(_this2.props.item.id)}},_mailpoet2.default.I18n.t("moveToTrash"))):action.refresh?_react2.default.createElement("span",{onClick:_this2.props.onRefreshItems,key:"action-"+action.name,className:action.name,role:"button",tabIndex:index},isFirst?"":" | ",action.link(_this2.props.item)):action.link?_react2.default.createElement("span",{key:"action-"+action.name,className:action.name},isFirst?"":" | ",action.link(_this2.props.item)):_react2.default.createElement("span",{key:"action-"+action.name,className:action.name},isFirst?"":" | ",_react2.default.createElement("a",{href:"javascript:;",onClick:void 0!==action.onClick&&function(){return action.onClick(_this2.props.item,_this2.props.onRefreshItems)}},action.label)),null!==customAction&&!0===isFirst&&(isFirst=!1),customAction})}else itemActions=_react2.default.createElement("span",{className:"edit"},_react2.default.createElement(_reactRouterDom.Link,{to:"/edit/"+this.props.item.id},_mailpoet2.default.I18n.t("edit")));var actions=void 0;actions="trash"===this.props.group?_react2.default.createElement("div",null,_react2.default.createElement("div",{className:"row-actions"},_react2.default.createElement("span",null,_react2.default.createElement("a",{href:"javascript:;",onClick:function(){return _this2.handleRestoreItem(_this2.props.item.id)}},_mailpoet2.default.I18n.t("restore")))," | ",_react2.default.createElement("span",{className:"delete"},_react2.default.createElement("a",{className:"submitdelete",href:"javascript:;",onClick:function(){return _this2.handleDeleteItem(_this2.props.item.id)}},_mailpoet2.default.I18n.t("deletePermanently")))),_react2.default.createElement("button",{onClick:function(){return _this2.handleToggleItem(_this2.props.item.id)},className:"toggle-row",type:"button"},_react2.default.createElement("span",{className:"screen-reader-text"},_mailpoet2.default.I18n.t("showMoreDetails")))):_react2.default.createElement("div",null,_react2.default.createElement("div",{className:"row-actions"},itemActions),_react2.default.createElement("button",{onClick:function(){return _this2.handleToggleItem(_this2.props.item.id)},className:"toggle-row",type:"button"},_react2.default.createElement("span",{className:"screen-reader-text"},_mailpoet2.default.I18n.t("showMoreDetails"))));var rowClasses=(0,_classnames2.default)({"is-expanded":this.state.expanded});return _react2.default.createElement("tr",{className:rowClasses,"data-automation-id":"listing_item_"+this.props.item.id},checkbox,this.props.onRenderItem(this.props.item,actions))}}]),ListingItem}(_react2.default.Component);ListingItem.propTypes={onSelectItem:_propTypes2.default.func.isRequired,onRestoreItem:_propTypes2.default.func.isRequired,onTrashItem:_propTypes2.default.func.isRequired,onDeleteItem:_propTypes2.default.func.isRequired,is_selectable:_propTypes2.default.bool.isRequired,item:_propTypes2.default.object.isRequired,columns:_propTypes2.default.arrayOf(_propTypes2.default.object).isRequired,selection:_propTypes2.default.oneOfType([_propTypes2.default.string,_propTypes2.default.number,_propTypes2.default.bool]).isRequired,item_actions:_propTypes2.default.arrayOf(_propTypes2.default.object).isRequired,onRefreshItems:_propTypes2.default.func.isRequired,onRenderItem:_propTypes2.default.func.isRequired,group:_propTypes2.default.string.isRequired},module.exports=ListingItem},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_badge=__webpack_require__(378),_badge2=_interopRequireDefault(_badge),badges={excellent:{name:_mailpoet2.default.I18n.t("excellentBadgeName"),tooltipTitle:_mailpoet2.default.I18n.t("excellentBadgeTooltip")},good:{name:_mailpoet2.default.I18n.t("goodBadgeName"),tooltipTitle:_mailpoet2.default.I18n.t("goodBadgeTooltip")},bad:{name:_mailpoet2.default.I18n.t("badBadgeName"),tooltipTitle:_mailpoet2.default.I18n.t("badBadgeTooltip")}},stats={opened:{badgeRanges:[30,10,0],badgeTypes:["excellent","good","bad"],tooltipText:_mailpoet2.default.I18n.t("openedStatTooltip")},clicked:{badgeRanges:[3,1,0],badgeTypes:["excellent","good","bad"],tooltipText:_mailpoet2.default.I18n.t("clickedStatTooltip")},unsubscribed:{badgeRanges:[3,1,0],badgeTypes:["bad","good","excellent"],tooltipText:_mailpoet2.default.I18n.t("unsubscribedStatTooltip")}},StatsBadge=function(_React$Component){function StatsBadge(){return _classCallCheck(this,StatsBadge),_possibleConstructorReturn(this,(StatsBadge.__proto__||Object.getPrototypeOf(StatsBadge)).apply(this,arguments))}return _inherits(StatsBadge,_React$Component),_createClass(StatsBadge,[{key:"render",value:function(){var stat=stats[this.props.stat]||null;if(!stat)return null;var rate=this.props.rate;if(rate<0||rate>100)return null;var badgeType=StatsBadge.getBadgeType(stat,rate),badge=badges[badgeType]||null;if(!badge)return null;var tooltipText=badge.tooltipTitle+"\n\n"+stat.tooltipText,tooltipId=this.props.tooltipId||null,content=_react2.default.createElement(_badge2.default,{type:badgeType,name:badge.name,tooltip:tooltipText,tooltipId:tooltipId});return this.props.headline?_react2.default.createElement("div",null,_react2.default.createElement("span",{className:"mailpoet_stat_"+badgeType},this.props.headline)," ",content):content}}],[{key:"getBadgeType",value:function(stat,rate){for(var len=stat.badgeRanges.length,i=0;i<len;i+=1)if(rate>stat.badgeRanges[i])return stat.badgeTypes[i];return stat.badgeTypes[len-1]}}]),StatsBadge}(_react2.default.Component);StatsBadge.propTypes={stat:_propTypes2.default.string.isRequired,rate:_propTypes2.default.number.isRequired,tooltipId:_propTypes2.default.string,headline:_propTypes2.default.string},StatsBadge.defaultProps={headline:"",tooltipId:void 0},exports.default=StatsBadge},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function Badge(props){var badgeClasses=(0,_classnames2.default)("mailpoet_badge",props.type?"mailpoet_badge_"+props.type:""),tooltip=!!props.tooltip&&props.tooltip.replace(/\n/g,"<br />"),tooltipId=props.tooltipId||tooltip;return _react2.default.createElement("span",null,_react2.default.createElement("span",{className:badgeClasses,"data-tip":tooltip,"data-for":tooltipId},props.name),tooltip&&_react2.default.createElement(_reactTooltip2.default,{place:"right",multiline:!0,id:tooltipId}))}Object.defineProperty(exports,"__esModule",{value:!0});var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_reactTooltip=__webpack_require__(158),_reactTooltip2=_interopRequireDefault(_reactTooltip),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes);Badge.propTypes={name:_propTypes2.default.string.isRequired,tooltip:_propTypes2.default.string,tooltipId:_propTypes2.default.string,type:_propTypes2.default.string},Badge.defaultProps={type:void 0,tooltipId:void 0,tooltip:void 0},exports.default=Badge},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),Breadcrumb=function(_React$Component){function Breadcrumb(props){_classCallCheck(this,Breadcrumb);var _this=_possibleConstructorReturn(this,(Breadcrumb.__proto__||Object.getPrototypeOf(Breadcrumb)).call(this,props)),steps=props.steps||[{name:"type",label:_mailpoet2.default.I18n.t("selectType")},{name:"template",label:_mailpoet2.default.I18n.t("template")},{name:"editor",label:_mailpoet2.default.I18n.t("designer")},{name:"send",label:_mailpoet2.default.I18n.t("send")}];return _this.state={step:null,steps:steps},_this}return _inherits(Breadcrumb,_React$Component),_createClass(Breadcrumb,[{key:"render",value:function(){var _this2=this,steps=this.state.steps.map(function(step,index){var stepClasses=(0,_classnames2.default)({mailpoet_current:_this2.props.step===step.name});return _react2.default.createElement("span",{key:"step-"+step.label},_react2.default.createElement("span",{className:stepClasses},step.label),index<_this2.state.steps.length-1?" > ":"")});return _react2.default.createElement("p",{className:"mailpoet_breadcrumb"},steps)}}]),Breadcrumb}(_react2.default.Component);Breadcrumb.propTypes={steps:_propTypes2.default.arrayOf(_propTypes2.default.object),step:_propTypes2.default.string},Breadcrumb.defaultProps={steps:void 0,step:null},module.exports=Breadcrumb},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(7),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),ListingTabs=function(_React$Component){function ListingTabs(){var _ref,_temp,_this,_ret;_classCallCheck(this,ListingTabs);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return _temp=_this=_possibleConstructorReturn(this,(_ref=ListingTabs.__proto__||Object.getPrototypeOf(ListingTabs)).call.apply(_ref,[this].concat(args))),_this.state={tab:null,tabs:_wpJsHooks2.default.applyFilters("mailpoet_newsletters_listings_tabs",[{name:"standard",label:_mailpoet2.default.I18n.t("tabStandardTitle"),link:"/standard"},{name:"welcome",label:_mailpoet2.default.I18n.t("tabWelcomeTitle"),link:"/welcome"},{name:"notification",label:_mailpoet2.default.I18n.t("tabNotificationTitle"),link:"/notification"}])},_ret=_temp,_possibleConstructorReturn(_this,_ret)}return _inherits(ListingTabs,_React$Component),_createClass(ListingTabs,[{key:"render",value:function(){var _this2=this,tabs=this.state.tabs.map(function(tab){var tabClasses=(0,_classnames2.default)("nav-tab",{"nav-tab-active":_this2.props.tab===tab.name});return _react2.default.createElement(_reactRouterDom.Link,{key:"tab-"+tab.label,className:tabClasses,"data-automation-id":"tab-"+tab.label,to:tab.link,onClick:function(){return _mailpoet2.default.trackEvent("Tab Emails > "+tab.name+" clicked",{"MailPoet Free version":window.mailpoet_version})}},tab.label)});return _react2.default.createElement("h2",{className:"nav-tab-wrapper","data-automation-id":"newsletters_listing_tabs"},tabs)}}]),ListingTabs}(_react2.default.Component);ListingTabs.propTypes={tab:_propTypes2.default.string.isRequired},module.exports=ListingTabs},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function trackStatsCTAClicked(){_mailpoet2.default.trackEvent("User has clicked a CTA to view detailed stats",{"MailPoet Free version":window.mailpoet_version})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.CronMixin=exports.MailerMixin=exports.StatisticsMixin=exports.QueueMixin=void 0;var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactDom=__webpack_require__(11),_reactDom2=_interopRequireDefault(_reactDom),_reactStringReplace=__webpack_require__(22),_reactStringReplace2=_interopRequireDefault(_reactStringReplace),_reactRouterDom=__webpack_require__(7),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_moment=__webpack_require__(0),_moment2=_interopRequireDefault(_moment),_jquery=__webpack_require__(5),_jquery2=_interopRequireDefault(_jquery),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_wpJsHooks=__webpack_require__(13),_wpJsHooks2=_interopRequireDefault(_wpJsHooks),_stats=__webpack_require__(289),_stats2=_interopRequireDefault(_stats),QueueMixin={pauseSending:function(newsletter){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"pause",data:{newsletter_id:newsletter.id}}).done(function(){(0,_jquery2.default)("#resume_"+newsletter.id).show(),(0,_jquery2.default)("#pause_"+newsletter.id).hide()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},resumeSending:function(newsletter){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"resume",data:{newsletter_id:newsletter.id}}).done(function(){(0,_jquery2.default)("#pause_"+newsletter.id).show(),(0,_jquery2.default)("#resume_"+newsletter.id).hide()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})},renderQueueStatus:function(newsletter,mailerLog){if(!newsletter.queue)return _react2.default.createElement("span",null,_mailpoet2.default.I18n.t("notSentYet"));if("paused"===mailerLog.status&&"completed"!==newsletter.queue.status)return _react2.default.createElement("span",null,_mailpoet2.default.I18n.t("paused"));if("scheduled"===newsletter.queue.status)return _react2.default.createElement("span",null,_mailpoet2.default.I18n.t("scheduledFor")," ",_mailpoet2.default.Date.format(newsletter.queue.scheduled_at));var progressClasses=(0,_classnames2.default)("mailpoet_progress",{mailpoet_progress_complete:"completed"===newsletter.queue.status}),percentage=Math.round(100*newsletter.queue.count_processed/newsletter.queue.count_total),label=void 0;if("completed"===newsletter.queue.status)label=_react2.default.createElement("span",null,_mailpoet2.default.I18n.t("newsletterQueueCompleted").replace("%$1d",parseInt(newsletter.queue.count_processed,10).toLocaleString()).replace("%$2d",parseInt(newsletter.queue.count_total,10).toLocaleString()));else{var resumeSendingClick=_underscore2.default.partial(this.resumeSending,newsletter),pauseSendingClick=_underscore2.default.partial(this.pauseSending,newsletter);label=_react2.default.createElement("span",null,parseInt(newsletter.queue.count_processed,10).toLocaleString(),"/",parseInt(newsletter.queue.count_total,10).toLocaleString()," ",_react2.default.createElement("a",{id:"resume_"+newsletter.id,className:"button",style:{display:"paused"===newsletter.queue.status?"inline-block":"none"},href:"javascript:;",onClick:resumeSendingClick},_mailpoet2.default.I18n.t("resume")),_react2.default.createElement("a",{id:"pause_"+newsletter.id,className:"button mailpoet_pause",style:{display:null===newsletter.queue.status?"inline-block":"none"},href:"javascript:;",onClick:pauseSendingClick},_mailpoet2.default.I18n.t("pause")))}var progressBarWidth=0;return isNaN(percentage)?percentage=_mailpoet2.default.I18n.t("noSubscribers"):(progressBarWidth=percentage,percentage+="%"),_react2.default.createElement("div",null,_react2.default.createElement("div",{className:progressClasses},_react2.default.createElement("span",{className:"mailpoet_progress_bar",style:{width:progressBarWidth+"%"}}),_react2.default.createElement("span",{className:"mailpoet_progress_label"},percentage)),_react2.default.createElement("p",{style:{textAlign:"center"}},label))}},StatisticsMixin={renderStatistics:function(newsletter,isSent,currentTime){var sent=isSent;if(void 0===sent&&(sent=newsletter.statistics&&newsletter.queue&&"scheduled"!==newsletter.queue.status),!sent)return _react2.default.createElement("span",null,_mailpoet2.default.I18n.t("notSentYet"));var params={};_wpJsHooks2.default.addFilter("mailpoet_newsletters_listing_stats_before",this.addStatsCTALink),params=_wpJsHooks2.default.applyFilters("mailpoet_newsletters_listing_stats_before",params,newsletter);var totalSent=Number(newsletter.total_sent||newsletter.queue.count_processed),percentageClicked=0,percentageOpened=0,percentageUnsubscribed=0;totalSent>0&&(percentageClicked=100*newsletter.statistics.clicked/totalSent,percentageOpened=100*newsletter.statistics.opened/totalSent,percentageUnsubscribed=100*newsletter.statistics.unsubscribed/totalSent);var percentageClickedDisplay=_mailpoet2.default.Num.toLocaleFixed(percentageClicked,1),percentageOpenedDisplay=_mailpoet2.default.Num.toLocaleFixed(percentageOpened,1),percentageUnsubscribedDisplay=_mailpoet2.default.Num.toLocaleFixed(percentageUnsubscribed,1),showStatsTimeout=void 0,newsletterDate=void 0,sentHoursAgo=void 0,tooEarlyForStats=void 0,showKbLink=void 0;void 0!==currentTime?(showStatsTimeout=6,newsletterDate=newsletter.queue.scheduled_at||newsletter.queue.created_at,sentHoursAgo=(0,_moment2.default)(currentTime).diff((0,_moment2.default)(newsletterDate),"hours"),tooEarlyForStats=sentHoursAgo<showStatsTimeout,showKbLink=!0):(tooEarlyForStats=!1,showKbLink=!1);var content=void 0;content=totalSent>=20&&newsletter.statistics.opened>=5&&!tooEarlyForStats?_react2.default.createElement("div",{className:"mailpoet_stats_text"},_react2.default.createElement("div",null,_react2.default.createElement("span",null,percentageOpenedDisplay,"% "),_react2.default.createElement(_stats2.default,{stat:"opened",rate:percentageOpened,tooltipId:"opened-"+newsletter.id})),_react2.default.createElement("div",null,_react2.default.createElement("span",null,percentageClickedDisplay,"% "),_react2.default.createElement(_stats2.default,{stat:"clicked",rate:percentageClicked,tooltipId:"clicked-"+newsletter.id})),_react2.default.createElement("div",null,_react2.default.createElement("span",{className:"mailpoet_stat_hidden"},percentageUnsubscribedDisplay,"%"))):_react2.default.createElement("div",null,_react2.default.createElement("span",{className:"mailpoet_stats_text"},percentageOpenedDisplay,"%,"," ",percentageClickedDisplay,"%",_react2.default.createElement("span",{className:"mailpoet_stat_hidden"},", ",percentageUnsubscribedDisplay,"%")),tooEarlyForStats&&_react2.default.createElement("div",{className:"mailpoet_badge mailpoet_badge_green"},_mailpoet2.default.I18n.t("checkBackInHours").replace("%$1d",showStatsTimeout-sentHoursAgo)));var afterContent=void 0;return showKbLink&&percentageOpened<5&&sentHoursAgo>=24&&totalSent>=10&&(afterContent=_react2.default.createElement("div",null,_react2.default.createElement("a",{href:"http://beta.docs.mailpoet.com/article/191-how-to-improve-my-open-and-click-rates",target:"_blank",className:"mailpoet_stat_link_small"},_mailpoet2.default.I18n.t("improveThisLinkText")))),totalSent>0&¶ms.link?params.externalLink?_react2.default.createElement("div",null,_react2.default.createElement("a",{key:"stats-"+newsletter.id,href:params.link,onClick:params.onClick||null},content),afterContent):_react2.default.createElement("div",null,_react2.default.createElement(_reactRouterDom.Link,{key:"stats-"+newsletter.id,to:params.link,onClick:params.onClick||null},content),afterContent):_react2.default.createElement("div",null,content,afterContent)},addStatsCTAAction:function(actions){return window.mailpoet_premium_active?actions:(actions.unshift({name:"stats",link:function(){return _react2.default.createElement("a",{href:"admin.php?page=mailpoet-premium",onClick:trackStatsCTAClicked},_mailpoet2.default.I18n.t("statsListingActionTitle"))},display:function(newsletter){var countProcessed=newsletter.queue&&newsletter.queue.count_processed;return Number(newsletter.total_sent||countProcessed)>0}}),actions)},addStatsCTALink:function(params){if(window.mailpoet_premium_active)return params;var newParams=params;return newParams.link="admin.php?page=mailpoet-premium",newParams.externalLink=!0,newParams.onClick=trackStatsCTAClicked,newParams}},MailerMixin={checkMailerStatus:function(state){if(state.meta.mta_log.error&&"paused"===state.meta.mta_log.status){var errorType=this.getMailerErrorType(state);_mailpoet2.default.Notice[errorType]("",{static:!0,id:"mailpoet_mailer_error"}),_reactDom2.default.render(this.getMailerError(state),(0,_jquery2.default)('[data-id="mailpoet_mailer_error"]')[0])}else _mailpoet2.default.Notice.hide("mailpoet_mailer_error")},getMailerError:function(state){var mailerErrorNotice=void 0;if("migration"===state.meta.mta_log.error.operation)return mailerErrorNotice=state.meta.mta_log.error.error_message,_react2.default.createElement("div",null,_react2.default.createElement("p",null,mailerErrorNotice));var mailerCheckSettingsNotice=(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("mailerCheckSettingsNotice"),/\[link\](.*?)\[\/link\]/g,function(match){return _react2.default.createElement("a",{href:"?page=mailpoet-settings#mta",key:"check-sending"},match)});return mailerErrorNotice="send"===state.meta.mta_log.error.operation?_mailpoet2.default.I18n.t("mailerSendErrorNotice").replace("%$1s",state.meta.mta_method).replace("%$2s",state.meta.mta_log.error.error_message):_mailpoet2.default.I18n.t("mailerConnectionErrorNotice").replace("%$1s",state.meta.mta_log.error.error_message),state.meta.mta_log.error.error_code&&(mailerErrorNotice+=" "+_mailpoet2.default.I18n.t("mailerErrorCode").replace("%$1s",state.meta.mta_log.error.error_code)),mailerErrorNotice=_react2.default.createElement("p",{dangerouslySetInnerHTML:{__html:mailerErrorNotice}}),_react2.default.createElement("div",null,mailerErrorNotice,_react2.default.createElement("p",null,mailerCheckSettingsNotice),_react2.default.createElement("p",null,_react2.default.createElement("a",{href:"javascript:;",className:"button",onClick:this.resumeMailerSending},_mailpoet2.default.I18n.t("mailerResumeSendingButton"))))},getMailerErrorType:function(state){return"migration"===state.meta.mta_log.error.operation?"system":"error"},resumeMailerSending:function(){_mailpoet2.default.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"mailer",action:"resumeSending"}).done(function(){_mailpoet2.default.Notice.hide("mailpoet_mailer_error"),_mailpoet2.default.Notice.success(_mailpoet2.default.I18n.t("mailerSendingResumedNotice")),window.mailpoet_listing.forceUpdate()}).fail(function(response){response.errors.length>0&&_mailpoet2.default.Notice.error(response.errors.map(function(error){return error.message}),{scroll:!0})})}},CronMixin={checkCronStatus:function(state){if(!1!==state.meta.cron_accessible)return void _mailpoet2.default.Notice.hide("mailpoet_cron_error");var cronPingCheckNotice=(0,_reactStringReplace2.default)(_mailpoet2.default.I18n.t("cronNotAccessibleNotice"),/\[link\](.*?)\[\/link\]/g,function(match){return _react2.default.createElement("a",{href:"https://beta.docs.mailpoet.com/article/231-sending-does-not-work",target:"_blank",rel:"noopener noreferrer",key:"check-cron"},match)});_mailpoet2.default.Notice.error("",{static:!0,id:"mailpoet_cron_error"}),_reactDom2.default.render(_react2.default.createElement("div",null,_react2.default.createElement("p",null,cronPingCheckNotice)),(0,_jquery2.default)('[data-id="mailpoet_cron_error"]')[0])}};exports.QueueMixin=QueueMixin,exports.StatisticsMixin=StatisticsMixin,exports.MailerMixin=MailerMixin,exports.CronMixin=CronMixin},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(7),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_in_app_announcement=__webpack_require__(267),_in_app_announcement2=_interopRequireDefault(_in_app_announcement),ListingHeading=function(){return _react2.default.createElement("h1",{className:"title"},_mailpoet2.default.I18n.t("pageTitle"),_react2.default.createElement(_reactRouterDom.Link,{id:"mailpoet-new-email",className:"page-title-action",to:"/new",onClick:function(){return _mailpoet2.default.trackEvent("Emails > Add New",{"MailPoet Free version":window.mailpoet_version})},"data-automation-id":"new_email"},_mailpoet2.default.I18n.t("new")),_react2.default.createElement(_in_app_announcement2.default,{className:"mailpoet_in_app_announcement_free_welcome_emails_dot",showToNewUser:!1,showToPremiumUser:!1,showOnlyOnceSlug:"free_welcome_emails",height:"650px",validUntil:new Date("2018-10-31")},_react2.default.createElement("div",{className:"mailpoet_in_app_announcement_free_welcome_emails"},_react2.default.createElement("h2",null,_mailpoet2.default.I18n.t("freeWelcomeEmailsHeading")),_react2.default.createElement("img",{src:window.mailpoet_free_welcome_emails_image,alt:_mailpoet2.default.I18n.t("freeWelcomeEmailsHeading")}),_react2.default.createElement("p",null,_mailpoet2.default.I18n.t("freeWelcomeEmailsParagraph")))))};module.exports=ListingHeading},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_server=__webpack_require__(384),_server2=_interopRequireDefault(_server),_classnames=__webpack_require__(8),_classnames2=_interopRequireDefault(_classnames),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),InAppAnnouncementDot=function(props){return _react2.default.createElement("span",{role:"button",tabIndex:"-1",className:(0,_classnames2.default)("mailpoet_in_app_announcement_pulsing_dot",props.className),onClick:function(){_mailpoet2.default.Modal.popup({template:_server2.default.renderToString(props.children),width:props.width,height:props.height}),props.onUserTrigger&&props.onUserTrigger()}})};InAppAnnouncementDot.propTypes={children:_propTypes2.default.element.isRequired,width:_propTypes2.default.string,height:_propTypes2.default.string,className:_propTypes2.default.string,onUserTrigger:_propTypes2.default.func},InAppAnnouncementDot.defaultProps={width:"auto",height:"auto",className:null,onUserTrigger:null},module.exports=InAppAnnouncementDot},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(385)},function(module,exports,__webpack_require__){"use strict";function aa(a,b,e,c,g,d,h,f){if(!a){if(a=void 0,void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var B=[e,c,g,d,h,f],A=0;a=Error(b.replace(/%s/g,function(){return B[A++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}}function u(a){for(var b=arguments.length-1,e="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c<b;c++)e+="&args[]="+encodeURIComponent(arguments[c+1]);aa(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",e)}function M(a){if(null==a)return null;if("function"==typeof a)return a.displayName||a.name||null;if("string"==typeof a)return a;switch(a){case G:return"ConcurrentMode";case z:return"Fragment";case y:return"Portal";case D:return"Profiler";case C:return"StrictMode";case I:return"Suspense"}if("object"==typeof a)switch(a.$$typeof){case F:return"Context.Consumer";case E:return"Context.Provider";case H:var b=a.render;return b=b.displayName||b.name||"",a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");case J:return M(a.type);case L:if(a=1===a._status?a._result:null)return M(a)}return null}function N(a,b){for(var e=a._threadCount;e<=b;e++)a[e]=a._currentValue2,a._threadCount=e+1}function da(a,b,e){var c=a.contextType;if("object"==typeof c&&null!==c)return N(c,e),c[e];if(a=a.contextTypes){e={};for(var g in a)e[g]=b[g];b=e}else b=ca;return b}function ja(a){return!!fa.call(ia,a)||!fa.call(ha,a)&&(ea.test(a)?ia[a]=!0:(ha[a]=!0,!1))}function ka(a,b,e,c){if(null!==e&&0===e.type)return!1;switch(typeof b){case"function":case"symbol":return!0;case"boolean":return!c&&(null!==e?!e.acceptsBooleans:"data-"!==(a=a.toLowerCase().slice(0,5))&&"aria-"!==a);default:return!1}}function la(a,b,e,c){if(null===b||void 0===b||ka(a,b,e,c))return!0;if(c)return!1;if(null!==e)switch(e.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function Q(a,b,e,c,g){this.acceptsBooleans=2===b||3===b||4===b,this.attributeName=c,this.attributeNamespace=g,this.mustUseProperty=e,this.propertyName=a,this.type=b}function T(a){return a[1].toUpperCase()}function U(a){if("boolean"==typeof a||"number"==typeof a)return""+a;a=""+a;var b=ma.exec(a);if(b){var c,e="",g=0;for(c=b.index;c<a.length;c++){switch(a.charCodeAt(c)){case 34:b=""";break;case 38:b="&";break;case 39:b="'";break;case 60:b="<";break;case 62:b=">";break;default:continue}g!==c&&(e+=a.substring(g,c)),g=c+1,e+=b}a=g!==c?e+a.substring(g,c):e}return a}function oa(a,b,e,c){for(;na;)na=!1,e=a(b,c);return e}function ra(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Aa(a){if(void 0===a||null===a)return a;var b="";return q.Children.forEach(a,function(a){null!=a&&(b+=a)}),b}function Da(a,b){void 0===a&&u("152",M(b)||"Component")}function Ea(a,b,e){for(;q.isValidElement(a);){var g=a,d=g.type;if("function"!=typeof d)break;!function(g,c){var d=da(c,b,e),f=[],h=!1,l={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===f)return null},enqueueReplaceState:function(a,b){h=!0,f=[b]},enqueueSetState:function(a,b){if(null===f)return null;f.push(b)}},k=void 0;if(c.prototype&&c.prototype.isReactComponent){if(k=new c(g.props,d,l),"function"==typeof c.getDerivedStateFromProps){var r=c.getDerivedStateFromProps.call(null,g.props,k.state);null!=r&&(k.state=p({},k.state,r))}}else if(k=c(g.props,d,l),null==(k=oa(c,g.props,k,d))||null==k.render)return a=k,void Da(a,c);if(k.props=g.props,k.context=d,k.updater=l,l=k.state,void 0===l&&(k.state=l=null),"function"==typeof k.UNSAFE_componentWillMount||"function"==typeof k.componentWillMount)if("function"==typeof k.componentWillMount&&"function"!=typeof c.getDerivedStateFromProps&&k.componentWillMount(),"function"==typeof k.UNSAFE_componentWillMount&&"function"!=typeof c.getDerivedStateFromProps&&k.UNSAFE_componentWillMount(),f.length){l=f;var m=h;if(f=null,h=!1,m&&1===l.length)k.state=l[0];else{r=m?l[0]:k.state;var t=!0;for(m=m?1:0;m<l.length;m++){var v=l[m];null!=(v="function"==typeof v?v.call(k,r,g.props,d):v)&&(t?(t=!1,r=p({},r,v)):p(r,v))}k.state=r}}else f=null;if(a=k.render(),Da(a,c),g=void 0,"function"==typeof k.getChildContext&&"object"==typeof(d=c.childContextTypes)){g=k.getChildContext();for(var K in g)K in d||u("108",M(c)||"Unknown",K)}g&&(b=p({},b,g))}(g,d)}return{child:a,context:b}}for(var p=__webpack_require__(25),q=__webpack_require__(1),w="function"==typeof Symbol&&Symbol.for,y=w?Symbol.for("react.portal"):60106,z=w?Symbol.for("react.fragment"):60107,C=w?Symbol.for("react.strict_mode"):60108,D=w?Symbol.for("react.profiler"):60114,E=w?Symbol.for("react.provider"):60109,F=w?Symbol.for("react.context"):60110,G=w?Symbol.for("react.concurrent_mode"):60111,H=w?Symbol.for("react.forward_ref"):60112,I=w?Symbol.for("react.suspense"):60113,J=w?Symbol.for("react.memo"):60115,L=w?Symbol.for("react.lazy"):60116,ba=q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ca={},O=new Uint16Array(16),P=0;15>P;P++)O[P]=P+1;O[15]=0;var ea=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,fa=Object.prototype.hasOwnProperty,ha={},ia={},R={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){R[a]=new Q(a,0,!1,a,null)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];R[b]=new Q(b,1,!1,a[1],null)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){R[a]=new Q(a,2,!1,a.toLowerCase(),null)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){R[a]=new Q(a,2,!1,a,null)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){R[a]=new Q(a,3,!1,a.toLowerCase(),null)}),["checked","multiple","muted","selected"].forEach(function(a){R[a]=new Q(a,3,!0,a,null)}),["capture","download"].forEach(function(a){R[a]=new Q(a,4,!1,a,null)}),["cols","rows","size","span"].forEach(function(a){R[a]=new Q(a,6,!1,a,null)}),["rowSpan","start"].forEach(function(a){R[a]=new Q(a,5,!1,a.toLowerCase(),null)});var S=/[\-:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(S,T);R[b]=new Q(b,1,!1,a,null)}),"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(S,T);R[b]=new Q(b,1,!1,a,"http://www.w3.org/1999/xlink")}),["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(S,T);R[b]=new Q(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")}),R.tabIndex=new Q("tabIndex",1,!1,"tabindex",null);var ma=/["'&<>]/,na=!1,V=0,pa={readContext:function(a){var b=V;return N(a,b),a[b]}},qa={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"},sa={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ta=p({menuitem:!0},sa),W={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ua=["Webkit","ms","Moz","O"];Object.keys(W).forEach(function(a){ua.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1),W[b]=W[a]})});var va=/([A-Z])/g,wa=/^ms-/,X=q.Children.toArray,Y=ba.ReactCurrentOwner,xa={listing:!0,pre:!0,textarea:!0},ya=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,za={},Z={},Ba=Object.prototype.hasOwnProperty,Ca={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null},Fa=function(){function a(b,e){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");q.isValidElement(b)?b.type!==z?b=[b]:(b=b.props.children,b=q.isValidElement(b)?[b]:X(b)):b=X(b),b={type:null,domNamespace:qa.html,children:b,childIndex:0,context:ca,footer:""};var c=O[0];if(0===c){var g=O;c=g.length;var d=2*c;65536>=d||u("304");var h=new Uint16Array(d);for(h.set(g),O=h,O[0]=c+1,g=c;g<d-1;g++)O[g]=g+1;O[d-1]=0}else O[0]=O[c];this.threadID=c,this.stack=[b],this.exhausted=!1,this.currentSelectValue=null,this.previousWasTextNode=!1,this.makeStaticMarkup=e,this.suspenseDepth=0,this.contextIndex=-1,this.contextStack=[],this.contextValueStack=[]}return a.prototype.destroy=function(){if(!this.exhausted){this.exhausted=!0;var a=this.threadID;O[a]=O[0],O[0]=a}},a.prototype.pushProvider=function(a){var b=++this.contextIndex,c=a.type._context,g=this.threadID;N(c,g);var d=c[g];this.contextStack[b]=c,this.contextValueStack[b]=d,c[g]=a.props.value},a.prototype.popProvider=function(){var a=this.contextIndex,e=this.contextStack[a],c=this.contextValueStack[a];this.contextStack[a]=null,this.contextValueStack[a]=null,this.contextIndex--,e[this.threadID]=c},a.prototype.read=function(a){if(this.exhausted)return null;var b=V;V=this.threadID;var c=Y.currentDispatcher;Y.currentDispatcher=pa;try{for(var g=[""],d=!1;g[0].length<a;){if(0===this.stack.length){this.exhausted=!0;var h=this.threadID;O[h]=O[0],O[0]=h;break}var f=this.stack[this.stack.length-1];if(d||f.childIndex>=f.children.length){var B=f.footer;if(""!==B&&(this.previousWasTextNode=!1),this.stack.pop(),"select"===f.type)this.currentSelectValue=null;else if(null!=f.type&&null!=f.type.type&&f.type.type.$$typeof===E)this.popProvider(f.type);else if(f.type===I){this.suspenseDepth--;var A=g.pop();if(d){d=!1;var n=f.fallbackFrame;n||u("303"),this.stack.push(n);continue}g[this.suspenseDepth]+=A}g[this.suspenseDepth]+=B}else{var l=f.children[f.childIndex++],k="";try{k+=this.render(l,f.context,f.domNamespace)}catch(r){throw r}g.length<=this.suspenseDepth&&g.push(""),g[this.suspenseDepth]+=k}}return g[0]}finally{Y.currentDispatcher=c,V=b}},a.prototype.render=function(a,e,c){if("string"==typeof a||"number"==typeof a)return""===(c=""+a)?"":this.makeStaticMarkup?U(c):this.previousWasTextNode?"\x3c!-- --\x3e"+U(c):(this.previousWasTextNode=!0,U(c));if(e=Ea(a,e,this.threadID),a=e.child,e=e.context,null===a||!1===a)return"";if(!q.isValidElement(a)){if(null!=a&&null!=a.$$typeof){var b=a.$$typeof;b===y&&u("257"),u("258",b.toString())}return a=X(a),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:e,footer:""}),""}if("string"==typeof(b=a.type))return this.renderDOM(a,e,c);switch(b){case C:case G:case D:case z:return a=X(a.props.children),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:e,footer:""}),"";case I:u("294")}if("object"==typeof b&&null!==b)switch(b.$$typeof){case H:var d=b.render(a.props,a.ref);return d=oa(b.render,a.props,d,a.ref),d=X(d),this.stack.push({type:null,domNamespace:c,children:d,childIndex:0,context:e,footer:""}),"";case J:return a=[q.createElement(b.type,p({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:e,footer:""}),"";case E:return b=X(a.props.children),c={type:a,domNamespace:c,children:b,childIndex:0,context:e,footer:""},this.pushProvider(a),this.stack.push(c),"";case F:b=a.type,d=a.props;var h=this.threadID;return N(b,h),b=X(d.children(b[h])),this.stack.push({type:a,domNamespace:c,children:b,childIndex:0,context:e,footer:""}),"";case L:u("295")}u("130",null==b?b:typeof b,"")},a.prototype.renderDOM=function(a,e,c){var b=a.type.toLowerCase();c===qa.html&&ra(b),za.hasOwnProperty(b)||(ya.test(b)||u("65",b),za[b]=!0);var d=a.props;if("input"===b)d=p({type:void 0},d,{defaultChecked:void 0,defaultValue:void 0,value:null!=d.value?d.value:d.defaultValue,checked:null!=d.checked?d.checked:d.defaultChecked});else if("textarea"===b){var h=d.value;if(null==h){h=d.defaultValue;var f=d.children;null!=f&&(null!=h&&u("92"),Array.isArray(f)&&(1>=f.length||u("93"),f=f[0]),h=""+f),null==h&&(h="")}d=p({},d,{value:void 0,children:""+h})}else if("select"===b)this.currentSelectValue=null!=d.value?d.value:d.defaultValue,d=p({},d,{value:void 0});else if("option"===b){f=this.currentSelectValue;var B=Aa(d.children);if(null!=f){var A=null!=d.value?d.value+"":B;if(h=!1,Array.isArray(f)){for(var n=0;n<f.length;n++)if(""+f[n]===A){h=!0;break}}else h=""+f===A;d=p({selected:void 0,children:void 0},d,{selected:h,children:B})}}(h=d)&&(ta[b]&&(null!=h.children||null!=h.dangerouslySetInnerHTML)&&u("137",b,""),null!=h.dangerouslySetInnerHTML&&(null!=h.children&&u("60"),"object"==typeof h.dangerouslySetInnerHTML&&"__html"in h.dangerouslySetInnerHTML||u("61")),null!=h.style&&"object"!=typeof h.style&&u("62","")),h=d,f=this.makeStaticMarkup,B=1===this.stack.length,A="<"+a.type;for(x in h)if(Ba.call(h,x)){var l=h[x];if(null!=l){if("style"===x){n=void 0;var k="",r="";for(n in l)if(l.hasOwnProperty(n)){var m=0===n.indexOf("--"),t=l[n];if(null!=t){var v=n;if(Z.hasOwnProperty(v))v=Z[v];else{var K=v.replace(va,"-$1").toLowerCase().replace(wa,"-ms-");v=Z[v]=K}k+=r+v+":",r=n,m=null==t||"boolean"==typeof t||""===t?"":m||"number"!=typeof t||0===t||W.hasOwnProperty(r)&&W[r]?(""+t).trim():t+"px",k+=m,r=";"}}l=k||null}n=null;b:if(m=b,t=h,-1===m.indexOf("-"))m="string"==typeof t.is;else switch(m){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":m=!1;break b;default:m=!0}m?Ca.hasOwnProperty(x)||(n=x,n=ja(n)&&null!=l?n+'="'+U(l)+'"':""):(m=x,n=l,l=R.hasOwnProperty(m)?R[m]:null,(t="style"!==m)&&(t=null!==l?0===l.type:2<m.length&&("o"===m[0]||"O"===m[0])&&("n"===m[1]||"N"===m[1])),t||la(m,n,l,!1)?n="":null!==l?(m=l.attributeName,l=l.type,n=3===l||4===l&&!0===n?m+'=""':m+'="'+U(n)+'"'):n=ja(m)?m+'="'+U(n)+'"':""),n&&(A+=" "+n)}}f||B&&(A+=' data-reactroot=""');var x=A;h="",sa.hasOwnProperty(b)?x+="/>":(x+=">",h="</"+a.type+">");a:{if(null!=(f=d.dangerouslySetInnerHTML)){if(null!=f.__html){f=f.__html;break a}}else if("string"==typeof(f=d.children)||"number"==typeof f){f=U(f);break a}f=null}return null!=f?(d=[],xa[b]&&"\n"===f.charAt(0)&&(x+="\n"),x+=f):d=X(d.children),a=a.type,c=null==c||"http://www.w3.org/1999/xhtml"===c?ra(a):"http://www.w3.org/2000/svg"===c&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":c,this.stack.push({domNamespace:c,type:b,children:d,childIndex:0,context:e,footer:h}),this.previousWasTextNode=!1,x},a}(),Ga={renderToString:function(a){a=new Fa(a,!1);try{return a.read(1/0)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new Fa(a,!0);try{return a.read(1/0)}finally{a.destroy()}},renderToNodeStream:function(){u("207")},renderToStaticNodeStream:function(){u("208")},version:"16.6.3"},Ha={default:Ga},Ia=Ha&&Ga||Ha;module.exports=Ia.default||Ia},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_breadcrumb=__webpack_require__(291),_breadcrumb2=_interopRequireDefault(_breadcrumb),_event=__webpack_require__(388),_event2=_interopRequireDefault(_event),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),_reactRouterDom=__webpack_require__(7),AutomaticEmailEventsList=function(_React$Component){function AutomaticEmailEventsList(props){_classCallCheck(this,AutomaticEmailEventsList);var _this=_possibleConstructorReturn(this,(AutomaticEmailEventsList.__proto__||Object.getPrototypeOf(AutomaticEmailEventsList)).call(this,props));return _this.email=_this.props.email,_this.emailEvents=_this.email.events,_this.eventsConfigurator=_this.eventsConfigurator.bind(_this),_this}return _inherits(AutomaticEmailEventsList,_React$Component),_createClass(AutomaticEmailEventsList,[{key:"eventsConfigurator",value:function(eventSlug){_mailpoet2.default.trackEvent("Emails > Automatic Type selected",{"MailPoet Free version":window.mailpoet_version,"MailPoet Premium version":window.mailpoet_premium_version,"Email type":eventSlug}),this.props.history.push("/new/"+this.email.slug+"/"+eventSlug+"/conditions")}},{key:"displayEvents",value:function(){var _this2=this,events=_underscore2.default.map(this.emailEvents,function(event,index){return _react2.default.createElement(_event2.default,{premium:_this2.email.premium,event:event,key:index,eventsConfigurator:_this2.eventsConfigurator})});return _react2.default.createElement("ul",{className:"mailpoet_boxes woocommerce clearfix"},events)}},{key:"render",value:function(){var heading=_mailpoet2.default.I18n.t("selectAutomaticEmailsEventsHeading").replace("%$1s",this.email.title);return _react2.default.createElement("div",null,_react2.default.createElement("h1",null,heading),_react2.default.createElement(_breadcrumb2.default,{step:"events"}),this.displayEvents())}}]),AutomaticEmailEventsList}(_react2.default.Component);AutomaticEmailEventsList.propTypes={email:_propTypes2.default.shape({title:_propTypes2.default.string.isRequired,slug:_propTypes2.default.string.isRequired,premium:_propTypes2.default.bool}).isRequired,history:_propTypes2.default.shape({push:_propTypes2.default.func.isRequired}).isRequired},module.exports=(0,_reactRouterDom.withRouter)(AutomaticEmailEventsList)},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function AutomaticEmailsBreadcrumb(props){var steps=[{name:"type",label:_mailpoet2.default.I18n.t("selectType")},{name:"events",label:_mailpoet2.default.I18n.t("events")},{name:"conditions",label:_mailpoet2.default.I18n.t("conditions")},{name:"template",label:_mailpoet2.default.I18n.t("template")},{name:"editor",label:_mailpoet2.default.I18n.t("designer")},{name:"send",label:_mailpoet2.default.I18n.t("send")}];return _react2.default.createElement(_breadcrumb2.default,{step:props.step,steps:steps})}var _breadcrumb=__webpack_require__(21),_breadcrumb2=_interopRequireDefault(_breadcrumb),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes);AutomaticEmailsBreadcrumb.propTypes={step:_propTypes2.default.string.isRequired},module.exports=AutomaticEmailsBreadcrumb},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),_underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_propTypes=__webpack_require__(3),_propTypes2=_interopRequireDefault(_propTypes),AutomaticEmailEvent=function(_React$PureComponent){function AutomaticEmailEvent(){return _classCallCheck(this,AutomaticEmailEvent),_possibleConstructorReturn(this,(AutomaticEmailEvent.__proto__||Object.getPrototypeOf(AutomaticEmailEvent)).apply(this,arguments))}return _inherits(AutomaticEmailEvent,_React$PureComponent),_createClass(AutomaticEmailEvent,[{key:"render",value:function(){var event=this.props.event,disabled=event.soon,action=void 0;return action=this.props.premium?_react2.default.createElement("a",{href:"?page=mailpoet-premium",target:"_blank"},_mailpoet2.default.I18n.t("premiumFeatureLink")):event.actionButtonLink&&event.actionButtonTitle?_react2.default.createElement("a",{href:event.actionButtonLink,target:"_blank"},event.actionButtonTitle):_react2.default.createElement("a",{className:"button button-primary",disabled:disabled,onClick:disabled?null:_underscore2.default.partial(this.props.eventsConfigurator,event.slug)},event.actionButtonTitle||_mailpoet2.default.I18n.t("setUp")),_react2.default.createElement("li",{"data-type":event.slug},_react2.default.createElement("div",null,_react2.default.createElement("div",{className:"mailpoet_thumbnail"},event.thumbnailImage?_react2.default.createElement("img",{src:event.thumbnailImage,alt:""}):null),_react2.default.createElement("div",{className:"mailpoet_description"},_react2.default.createElement("div",{className:"title_and_badge"},_react2.default.createElement("h3",null,event.title," ",event.soon?"("+_mailpoet2.default.I18n.t("soon")+")":""),event.badge?_react2.default.createElement("span",{className:"mailpoet_badge mailpoet_badge_"+event.badge.style},event.badge.text):""),_react2.default.createElement("p",null,event.description)),_react2.default.createElement("div",{className:"mailpoet_actions"},action)))}}]),AutomaticEmailEvent}(_react2.default.PureComponent);AutomaticEmailEvent.defaultProps={premium:!1},AutomaticEmailEvent.propTypes={premium:_propTypes2.default.bool,eventsConfigurator:_propTypes2.default.func.isRequired,event:_propTypes2.default.shape({slug:_propTypes2.default.string.isRequired,thumbnailImage:_propTypes2.default.string,title:_propTypes2.default.string.isRequired,soon:_propTypes2.default.bool,badge:_propTypes2.default.shape({style:_propTypes2.default.string,text:_propTypes2.default.string}),description:_propTypes2.default.string.isRequired,actionButtonTitle:_propTypes2.default.string}).isRequired},module.exports=AutomaticEmailEvent},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.nthWeekDayValues=exports.monthDayValues=exports.weekDayValues=exports.timeOfDayValues=exports.intervalValues=exports.timeDelayValues=void 0;var _underscore=__webpack_require__(4),_underscore2=_interopRequireDefault(_underscore),_mailpoet=__webpack_require__(2),_mailpoet2=_interopRequireDefault(_mailpoet),timeFormat=window.mailpoet_time_format||"H:i",timeDelayValues={immediate:_mailpoet2.default.I18n.t("delayImmediately"),hours:_mailpoet2.default.I18n.t("delayHoursAfter"),days:_mailpoet2.default.I18n.t("delayDaysAfter"),weeks:_mailpoet2.default.I18n.t("delayWeeksAfter")},intervalValues={daily:_mailpoet2.default.I18n.t("daily"),weekly:_mailpoet2.default.I18n.t("weekly"),monthly:_mailpoet2.default.I18n.t("monthly"),nthWeekDay:_mailpoet2.default.I18n.t("monthlyEvery"),immediately:_mailpoet2.default.I18n.t("immediately")},timeOfDayValues=_underscore2.default.object(_underscore2.default.map(_underscore2.default.times(24,function(step){return 3600*step}),function(seconds){var date=new Date(null);return date.setSeconds(seconds),[seconds,_mailpoet2.default.Date.format(date,{format:timeFormat,offset:0})]})),weekDayValues={0:_mailpoet2.default.I18n.t("sunday"),1:_mailpoet2.default.I18n.t("monday"),2:_mailpoet2.default.I18n.t("tuesday"),3:_mailpoet2.default.I18n.t("wednesday"),4:_mailpoet2.default.I18n.t("thursday"),5:_mailpoet2.default.I18n.t("friday"),6:_mailpoet2.default.I18n.t("saturday")},monthDayValues=_underscore2.default.object(_underscore2.default.map(_underscore2.default.times(28,function(day){return day}),function(day){var labels={0:_mailpoet2.default.I18n.t("first"),1:_mailpoet2.default.I18n.t("second"),2:_mailpoet2.default.I18n.t("third")},label=void 0;return label=void 0!==labels[day]?labels[day]:_mailpoet2.default.I18n.t("nth").replace("%$1d",day+1),[day+1,label]})),nthWeekDayValues={1:_mailpoet2.default.I18n.t("first"),2:_mailpoet2.default.I18n.t("second"),3:_mailpoet2.default.I18n.t("third"),L:_mailpoet2.default.I18n.t("last")};exports.timeDelayValues=timeDelayValues,exports.intervalValues=intervalValues,exports.timeOfDayValues=timeOfDayValues,exports.weekDayValues=weekDayValues,exports.monthDayValues=monthDayValues,exports.nthWeekDayValues=nthWeekDayValues},,,,,,,,,,,,,,,,,,,,function(module,exports,__webpack_require__){(function(global){module.exports=global.html2canvas=__webpack_require__(410)}).call(exports,__webpack_require__(6))},function(module,exports,__webpack_require__){/*!
|
49 |
* @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
|
50 |
* Released under MIT license, http://github.com/requirejs/almond/LICENSE
|
51 |
*/
|
52 |
+
var requirejs,require,define;!function(undef){function hasProp(obj,prop){return hasOwn.call(obj,prop)}function normalize(name,baseName){var nameParts,nameSegment,mapValue,foundMap,lastIndex,foundI,foundStarMap,starI,i,j,part,normalizedBaseParts,baseParts=baseName&&baseName.split("/"),map=config.map,starMap=map&&map["*"]||{};if(name){for(name=name.split("/"),lastIndex=name.length-1,config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])&&(name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")),"."===name[0].charAt(0)&&baseParts&&(normalizedBaseParts=baseParts.slice(0,baseParts.length-1),name=normalizedBaseParts.concat(name)),i=0;i<name.length;i++)if("."===(part=name[i]))name.splice(i,1),i-=1;else if(".."===part){if(0===i||1===i&&".."===name[2]||".."===name[i-1])continue;i>0&&(name.splice(i-1,2),i-=2)}name=name.join("/")}if((baseParts||starMap)&&map){for(nameParts=name.split("/"),i=nameParts.length;i>0;i-=1){if(nameSegment=nameParts.slice(0,i).join("/"),baseParts)for(j=baseParts.length;j>0;j-=1)if((mapValue=map[baseParts.slice(0,j).join("/")])&&(mapValue=mapValue[nameSegment])){foundMap=mapValue,foundI=i;break}if(foundMap)break;!foundStarMap&&starMap&&starMap[nameSegment]&&(foundStarMap=starMap[nameSegment],starI=i)}!foundMap&&foundStarMap&&(foundMap=foundStarMap,foundI=starI),foundMap&&(nameParts.splice(0,foundI,foundMap),name=nameParts.join("/"))}return name}function makeRequire(relName,forceSync){return function(){var args=aps.call(arguments,0);return"string"!=typeof args[0]&&1===args.length&&args.push(null),req.apply(undef,args.concat([relName,forceSync]))}}function makeNormalize(relName){return function(name){return normalize(name,relName)}}function makeLoad(depName){return function(value){defined[depName]=value}}function callDep(name){if(hasProp(waiting,name)){var args=waiting[name];delete waiting[name],defining[name]=!0,main.apply(undef,args)}if(!hasProp(defined,name)&&!hasProp(defining,name))throw new Error("No "+name);return defined[name]}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;return index>-1&&(prefix=name.substring(0,index),name=name.substring(index+1,name.length)),[prefix,name]}function makeRelParts(relName){return relName?splitPrefix(relName):[]}function makeConfig(name){return function(){return config&&config.config&&config.config[name]||{}}}var main,req,makeMap,handlers,defined={},waiting={},config={},defining={},hasOwn=Object.prototype.hasOwnProperty,aps=[].slice,jsSuffixRegExp=/\.js$/;makeMap=function(name,relParts){var plugin,parts=splitPrefix(name),prefix=parts[0],relResourceName=relParts[1];return name=parts[1],prefix&&(prefix=normalize(prefix,relResourceName),plugin=callDep(prefix)),prefix?name=plugin&&plugin.normalize?plugin.normalize(name,makeNormalize(relResourceName)):normalize(name,relResourceName):(name=normalize(name,relResourceName),parts=splitPrefix(name),prefix=parts[0],name=parts[1],prefix&&(plugin=callDep(prefix))),{f:prefix?prefix+"!"+name:name,n:name,pr:prefix,p:plugin}},handlers={require:function(name){return makeRequire(name)},exports:function(name){var e=defined[name];return void 0!==e?e:defined[name]={}},module:function(name){return{id:name,uri:"",exports:defined[name],config:makeConfig(name)}}},main=function(name,deps,callback,relName){var cjsModule,depName,ret,map,i,relParts,usingExports,args=[],callbackType=typeof callback;if(relName=relName||name,relParts=makeRelParts(relName),"undefined"===callbackType||"function"===callbackType){for(deps=!deps.length&&callback.length?["require","exports","module"]:deps,i=0;i<deps.length;i+=1)if(map=makeMap(deps[i],relParts),"require"===(depName=map.f))args[i]=handlers.require(name);else if("exports"===depName)args[i]=handlers.exports(name),usingExports=!0;else if("module"===depName)cjsModule=args[i]=handlers.module(name);else if(hasProp(defined,depName)||hasProp(waiting,depName)||hasProp(defining,depName))args[i]=callDep(depName);else{if(!map.p)throw new Error(name+" missing "+depName);map.p.load(map.n,makeRequire(relName,!0),makeLoad(depName),{}),args[i]=defined[depName]}ret=callback?callback.apply(defined[name],args):void 0,name&&(cjsModule&&cjsModule.exports!==undef&&cjsModule.exports!==defined[name]?defined[name]=cjsModule.exports:ret===undef&&usingExports||(defined[name]=ret))}else name&&(defined[name]=callback)},requirejs=require=req=function(deps,callback,relName,forceSync,alt){if("string"==typeof deps)return handlers[deps]?handlers[deps](callback):callDep(makeMap(deps,makeRelParts(callback)).f);if(!deps.splice){if(config=deps,config.deps&&req(config.deps,config.callback),!callback)return;callback.splice?(deps=callback,callback=relName,relName=null):deps=undef}return callback=callback||function(){},"function"==typeof relName&&(relName=forceSync,forceSync=alt),forceSync?main(undef,deps,callback,relName):setTimeout(function(){main(undef,deps,callback,relName)},4),req},req.config=function(cfg){return req(cfg)},requirejs._defined=defined,define=function(name,deps,callback){if("string"!=typeof name)throw new Error("See almond README: incorrect module build, no module name");deps.splice||(callback=deps,deps=[]),hasProp(defined,name)||hasProp(waiting,name)||(waiting[name]=[name,deps,callback])},define.amd={jQuery:!0}}(),S2.requirejs=requirejs,S2.require=require,S2.define=define}}(),S2.define("almond",function(){}),S2.define("jquery",[],function(){var _$=jQuery||$;return null==_$&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),_$}),S2.define("select2/utils",["jquery"],function($){function getMethods(theClass){var proto=theClass.prototype,methods=[];for(var methodName in proto){"function"==typeof proto[methodName]&&("constructor"!==methodName&&methods.push(methodName))}return methods}var Utils={};Utils.Extend=function(ChildClass,SuperClass){function BaseConstructor(){this.constructor=ChildClass}var __hasProp={}.hasOwnProperty;for(var key in SuperClass)__hasProp.call(SuperClass,key)&&(ChildClass[key]=SuperClass[key]);return BaseConstructor.prototype=SuperClass.prototype,ChildClass.prototype=new BaseConstructor,ChildClass.__super__=SuperClass.prototype,ChildClass},Utils.Decorate=function(SuperClass,DecoratorClass){function DecoratedClass(){var unshift=Array.prototype.unshift,argCount=DecoratorClass.prototype.constructor.length,calledConstructor=SuperClass.prototype.constructor;argCount>0&&(unshift.call(arguments,SuperClass.prototype.constructor),calledConstructor=DecoratorClass.prototype.constructor),calledConstructor.apply(this,arguments)}function ctr(){this.constructor=DecoratedClass}var decoratedMethods=getMethods(DecoratorClass),superMethods=getMethods(SuperClass);DecoratorClass.displayName=SuperClass.displayName,DecoratedClass.prototype=new ctr;for(var m=0;m<superMethods.length;m++){var superMethod=superMethods[m];DecoratedClass.prototype[superMethod]=SuperClass.prototype[superMethod]}for(var d=0;d<decoratedMethods.length;d++){var decoratedMethod=decoratedMethods[d];DecoratedClass.prototype[decoratedMethod]=function(methodName){var originalMethod=function(){};methodName in DecoratedClass.prototype&&(originalMethod=DecoratedClass.prototype[methodName]);var decoratedMethod=DecoratorClass.prototype[methodName];return function(){return Array.prototype.unshift.call(arguments,originalMethod),decoratedMethod.apply(this,arguments)}}(decoratedMethod)}return DecoratedClass};var Observable=function(){this.listeners={}};return Observable.prototype.on=function(event,callback){this.listeners=this.listeners||{},event in this.listeners?this.listeners[event].push(callback):this.listeners[event]=[callback]},Observable.prototype.trigger=function(event){var slice=Array.prototype.slice,params=slice.call(arguments,1);this.listeners=this.listeners||{},null==params&&(params=[]),0===params.length&¶ms.push({}),params[0]._type=event,event in this.listeners&&this.invoke(this.listeners[event],slice.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},Observable.prototype.invoke=function(listeners,params){for(var i=0,len=listeners.length;i<len;i++)listeners[i].apply(this,params)},Utils.Observable=Observable,Utils.generateChars=function(length){for(var chars="",i=0;i<length;i++){chars+=Math.floor(36*Math.random()).toString(36)}return chars},Utils.bind=function(func,context){return function(){func.apply(context,arguments)}},Utils._convertData=function(data){for(var originalKey in data){var keys=originalKey.split("-"),dataLevel=data;if(1!==keys.length){for(var k=0;k<keys.length;k++){var key=keys[k];key=key.substring(0,1).toLowerCase()+key.substring(1),key in dataLevel||(dataLevel[key]={}),k==keys.length-1&&(dataLevel[key]=data[originalKey]),dataLevel=dataLevel[key]}delete data[originalKey]}}return data},Utils.hasScroll=function(index,el){var $el=$(el),overflowX=el.style.overflowX,overflowY=el.style.overflowY;return(overflowX!==overflowY||"hidden"!==overflowY&&"visible"!==overflowY)&&("scroll"===overflowX||"scroll"===overflowY||($el.innerHeight()<el.scrollHeight||$el.innerWidth()<el.scrollWidth))},Utils.escapeMarkup=function(markup){var replaceMap={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof markup?markup:String(markup).replace(/[&<>"'\/\\]/g,function(match){return replaceMap[match]})},Utils.appendMany=function($element,$nodes){if("1.7"===$.fn.jquery.substr(0,3)){var $jqNodes=$();$.map($nodes,function(node){$jqNodes=$jqNodes.add(node)}),$nodes=$jqNodes}$element.append($nodes)},Utils}),S2.define("select2/results",["jquery","./utils"],function($,Utils){function Results($element,options,dataAdapter){this.$element=$element,this.data=dataAdapter,this.options=options,Results.__super__.constructor.call(this)}return Utils.Extend(Results,Utils.Observable),Results.prototype.render=function(){var $results=$('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&$results.attr("aria-multiselectable","true"),this.$results=$results,$results},Results.prototype.clear=function(){this.$results.empty()},Results.prototype.displayMessage=function(params){var escapeMarkup=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var $message=$('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),message=this.options.get("translations").get(params.message);$message.append(escapeMarkup(message(params.args))),$message[0].className+=" select2-results__message",this.$results.append($message)},Results.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},Results.prototype.append=function(data){this.hideLoading();var $options=[];if(null==data.results||0===data.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));data.results=this.sort(data.results);for(var d=0;d<data.results.length;d++){var item=data.results[d],$option=this.option(item);$options.push($option)}this.$results.append($options)},Results.prototype.position=function($results,$dropdown){$dropdown.find(".select2-results").append($results)},Results.prototype.sort=function(data){return this.options.get("sorter")(data)},Results.prototype.highlightFirstItem=function(){var $options=this.$results.find(".select2-results__option[aria-selected]"),$selected=$options.filter("[aria-selected=true]");$selected.length>0?$selected.first().trigger("mouseenter"):$options.first().trigger("mouseenter"),this.ensureHighlightVisible()},Results.prototype.setClasses=function(){var self=this;this.data.current(function(selected){var selectedIds=$.map(selected,function(s){return s.id.toString()});self.$results.find(".select2-results__option[aria-selected]").each(function(){var $option=$(this),item=$.data(this,"data"),id=""+item.id;null!=item.element&&item.element.selected||null==item.element&&$.inArray(id,selectedIds)>-1?$option.attr("aria-selected","true"):$option.attr("aria-selected","false")})})},Results.prototype.showLoading=function(params){this.hideLoading();var loadingMore=this.options.get("translations").get("searching"),loading={disabled:!0,loading:!0,text:loadingMore(params)},$loading=this.option(loading);$loading.className+=" loading-results",this.$results.prepend($loading)},Results.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},Results.prototype.option=function(data){var option=document.createElement("li");option.className="select2-results__option";var attrs={role:"treeitem","aria-selected":"false"};data.disabled&&(delete attrs["aria-selected"],attrs["aria-disabled"]="true"),null==data.id&&delete attrs["aria-selected"],null!=data._resultId&&(option.id=data._resultId),data.title&&(option.title=data.title),data.children&&(attrs.role="group",attrs["aria-label"]=data.text,delete attrs["aria-selected"]);for(var attr in attrs){var val=attrs[attr];option.setAttribute(attr,val)}if(data.children){var $option=$(option),label=document.createElement("strong");label.className="select2-results__group";$(label);this.template(data,label);for(var $children=[],c=0;c<data.children.length;c++){var child=data.children[c],$child=this.option(child);$children.push($child)}var $childrenContainer=$("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});$childrenContainer.append($children),$option.append(label),$option.append($childrenContainer)}else this.template(data,option);return $.data(option,"data",data),option},Results.prototype.bind=function(container,$container){var self=this,id=container.id+"-results";this.$results.attr("id",id),container.on("results:all",function(params){self.clear(),self.append(params.data),container.isOpen()&&(self.setClasses(),self.highlightFirstItem())}),container.on("results:append",function(params){self.append(params.data),container.isOpen()&&self.setClasses()}),container.on("query",function(params){self.hideMessages(),self.showLoading(params)}),container.on("select",function(){container.isOpen()&&(self.setClasses(),self.highlightFirstItem())}),container.on("unselect",function(){container.isOpen()&&(self.setClasses(),self.highlightFirstItem())}),container.on("open",function(){self.$results.attr("aria-expanded","true"),self.$results.attr("aria-hidden","false"),self.setClasses(),self.ensureHighlightVisible()}),container.on("close",function(){self.$results.attr("aria-expanded","false"),self.$results.attr("aria-hidden","true"),self.$results.removeAttr("aria-activedescendant")}),container.on("results:toggle",function(){var $highlighted=self.getHighlightedResults();0!==$highlighted.length&&$highlighted.trigger("mouseup")}),container.on("results:select",function(){var $highlighted=self.getHighlightedResults();if(0!==$highlighted.length){var data=$highlighted.data("data");"true"==$highlighted.attr("aria-selected")?self.trigger("close",{}):self.trigger("select",{data:data})}}),container.on("results:previous",function(){var $highlighted=self.getHighlightedResults(),$options=self.$results.find("[aria-selected]"),currentIndex=$options.index($highlighted);if(0!==currentIndex){var nextIndex=currentIndex-1;0===$highlighted.length&&(nextIndex=0);var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top,nextTop=$next.offset().top,nextOffset=self.$results.scrollTop()+(nextTop-currentOffset);0===nextIndex?self.$results.scrollTop(0):nextTop-currentOffset<0&&self.$results.scrollTop(nextOffset)}}),container.on("results:next",function(){var $highlighted=self.getHighlightedResults(),$options=self.$results.find("[aria-selected]"),currentIndex=$options.index($highlighted),nextIndex=currentIndex+1;if(!(nextIndex>=$options.length)){var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top+self.$results.outerHeight(!1),nextBottom=$next.offset().top+$next.outerHeight(!1),nextOffset=self.$results.scrollTop()+nextBottom-currentOffset;0===nextIndex?self.$results.scrollTop(0):nextBottom>currentOffset&&self.$results.scrollTop(nextOffset)}}),container.on("results:focus",function(params){params.element.addClass("select2-results__option--highlighted")}),container.on("results:message",function(params){self.displayMessage(params)}),$.fn.mousewheel&&this.$results.on("mousewheel",function(e){var top=self.$results.scrollTop(),bottom=self.$results.get(0).scrollHeight-top+e.deltaY,isAtTop=e.deltaY>0&&top-e.deltaY<=0,isAtBottom=e.deltaY<0&&bottom<=self.$results.height();isAtTop?(self.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):isAtBottom&&(self.$results.scrollTop(self.$results.get(0).scrollHeight-self.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(evt){var $this=$(this),data=$this.data("data");if("true"===$this.attr("aria-selected"))return void(self.options.get("multiple")?self.trigger("unselect",{originalEvent:evt,data:data}):self.trigger("close",{}));self.trigger("select",{originalEvent:evt,data:data})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(evt){var data=$(this).data("data");self.getHighlightedResults().removeClass("select2-results__option--highlighted"),self.trigger("results:focus",{data:data,element:$(this)})})},Results.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},Results.prototype.destroy=function(){this.$results.remove()},Results.prototype.ensureHighlightVisible=function(){var $highlighted=this.getHighlightedResults();if(0!==$highlighted.length){var $options=this.$results.find("[aria-selected]"),currentIndex=$options.index($highlighted),currentOffset=this.$results.offset().top,nextTop=$highlighted.offset().top,nextOffset=this.$results.scrollTop()+(nextTop-currentOffset),offsetDelta=nextTop-currentOffset;nextOffset-=2*$highlighted.outerHeight(!1),currentIndex<=2?this.$results.scrollTop(0):(offsetDelta>this.$results.outerHeight()||offsetDelta<0)&&this.$results.scrollTop(nextOffset)}},Results.prototype.template=function(result,container){var template=this.options.get("templateResult"),escapeMarkup=this.options.get("escapeMarkup"),content=template(result,container);null==content?container.style.display="none":"string"==typeof content?container.innerHTML=escapeMarkup(content):$(container).append(content)},Results}),S2.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),S2.define("select2/selection/base",["jquery","../utils","../keys"],function($,Utils,KEYS){function BaseSelection($element,options){this.$element=$element,this.options=options,BaseSelection.__super__.constructor.call(this)}return Utils.Extend(BaseSelection,Utils.Observable),BaseSelection.prototype.render=function(){var $selection=$('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),$selection.attr("title",this.$element.attr("title")),$selection.attr("tabindex",this._tabindex),this.$selection=$selection,$selection},BaseSelection.prototype.bind=function(container,$container){var self=this,resultsId=(container.id,container.id+"-results");this.container=container,this.$selection.on("focus",function(evt){self.trigger("focus",evt)}),this.$selection.on("blur",function(evt){self._handleBlur(evt)}),this.$selection.on("keydown",function(evt){self.trigger("keypress",evt),evt.which===KEYS.SPACE&&evt.preventDefault()}),container.on("results:focus",function(params){self.$selection.attr("aria-activedescendant",params.data._resultId)}),container.on("selection:update",function(params){self.update(params.data)}),container.on("open",function(){self.$selection.attr("aria-expanded","true"),self.$selection.attr("aria-owns",resultsId),self._attachCloseHandler(container)}),container.on("close",function(){self.$selection.attr("aria-expanded","false"),self.$selection.removeAttr("aria-activedescendant"),self.$selection.removeAttr("aria-owns"),self.$selection.focus(),self._detachCloseHandler(container)}),container.on("enable",function(){self.$selection.attr("tabindex",self._tabindex)}),container.on("disable",function(){self.$selection.attr("tabindex","-1")})},BaseSelection.prototype._handleBlur=function(evt){var self=this;window.setTimeout(function(){document.activeElement==self.$selection[0]||$.contains(self.$selection[0],document.activeElement)||self.trigger("blur",evt)},1)},BaseSelection.prototype._attachCloseHandler=function(container){$(document.body).on("mousedown.select2."+container.id,function(e){var $target=$(e.target),$select=$target.closest(".select2");$(".select2.select2-container--open").each(function(){var $this=$(this);this!=$select[0]&&$this.data("element").select2("close")})})},BaseSelection.prototype._detachCloseHandler=function(container){$(document.body).off("mousedown.select2."+container.id)},BaseSelection.prototype.position=function($selection,$container){$container.find(".selection").append($selection)},BaseSelection.prototype.destroy=function(){this._detachCloseHandler(this.container)},BaseSelection.prototype.update=function(data){throw new Error("The `update` method must be defined in child classes.")},BaseSelection}),S2.define("select2/selection/single",["jquery","./base","../utils","../keys"],function($,BaseSelection,Utils,KEYS){function SingleSelection(){SingleSelection.__super__.constructor.apply(this,arguments)}return Utils.Extend(SingleSelection,BaseSelection),SingleSelection.prototype.render=function(){var $selection=SingleSelection.__super__.render.call(this);return $selection.addClass("select2-selection--single"),$selection.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),$selection},SingleSelection.prototype.bind=function(container,$container){var self=this;SingleSelection.__super__.bind.apply(this,arguments);var id=container.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",id),this.$selection.attr("aria-labelledby",id),this.$selection.on("mousedown",function(evt){1===evt.which&&self.trigger("toggle",{originalEvent:evt})}),this.$selection.on("focus",function(evt){}),this.$selection.on("blur",function(evt){}),container.on("focus",function(evt){container.isOpen()||self.$selection.focus()}),container.on("selection:update",function(params){self.update(params.data)})},SingleSelection.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},SingleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection");return this.options.get("escapeMarkup")(template(data,container))},SingleSelection.prototype.selectionContainer=function(){return $("<span></span>")},SingleSelection.prototype.update=function(data){if(0===data.length)return void this.clear();var selection=data[0],$rendered=this.$selection.find(".select2-selection__rendered"),formatted=this.display(selection,$rendered);$rendered.empty().append(formatted),$rendered.prop("title",selection.title||selection.text)},SingleSelection}),S2.define("select2/selection/multiple",["jquery","./base","../utils"],function($,BaseSelection,Utils){function MultipleSelection($element,options){MultipleSelection.__super__.constructor.apply(this,arguments)}return Utils.Extend(MultipleSelection,BaseSelection),MultipleSelection.prototype.render=function(){var $selection=MultipleSelection.__super__.render.call(this);return $selection.addClass("select2-selection--multiple"),$selection.html('<ul class="select2-selection__rendered"></ul>'),$selection},MultipleSelection.prototype.bind=function(container,$container){var self=this;MultipleSelection.__super__.bind.apply(this,arguments),this.$selection.on("click",function(evt){self.trigger("toggle",{originalEvent:evt})}),this.$selection.on("click",".select2-selection__choice__remove",function(evt){if(!self.options.get("disabled")){var $remove=$(this),$selection=$remove.parent(),data=$selection.data("data");self.trigger("unselect",{originalEvent:evt,data:data})}})},MultipleSelection.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},MultipleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection");return this.options.get("escapeMarkup")(template(data,container))},MultipleSelection.prototype.selectionContainer=function(){return $('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},MultipleSelection.prototype.update=function(data){if(this.clear(),0!==data.length){for(var $selections=[],d=0;d<data.length;d++){var selection=data[d],$selection=this.selectionContainer(),formatted=this.display(selection,$selection);$selection.append(formatted),$selection.prop("title",selection.title||selection.text),$selection.data("data",selection),$selections.push($selection)}var $rendered=this.$selection.find(".select2-selection__rendered");Utils.appendMany($rendered,$selections)}},MultipleSelection}),S2.define("select2/selection/placeholder",["../utils"],function(Utils){function Placeholder(decorated,$element,options){this.placeholder=this.normalizePlaceholder(options.get("placeholder")),decorated.call(this,$element,options)}return Placeholder.prototype.normalizePlaceholder=function(_,placeholder){return"string"==typeof placeholder&&(placeholder={id:"",text:placeholder}),placeholder},Placeholder.prototype.createPlaceholder=function(decorated,placeholder){var $placeholder=this.selectionContainer();return $placeholder.html(this.display(placeholder)),$placeholder.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),$placeholder},Placeholder.prototype.update=function(decorated,data){var singlePlaceholder=1==data.length&&data[0].id!=this.placeholder.id;if(data.length>1||singlePlaceholder)return decorated.call(this,data);this.clear();var $placeholder=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append($placeholder)},Placeholder}),S2.define("select2/selection/allowClear",["jquery","../keys"],function($,KEYS){function AllowClear(){}return AllowClear.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(evt){self._handleClear(evt)}),container.on("keypress",function(evt){self._handleKeyboardClear(evt,container)})},AllowClear.prototype._handleClear=function(_,evt){if(!this.options.get("disabled")){var $clear=this.$selection.find(".select2-selection__clear");if(0!==$clear.length){evt.stopPropagation();for(var data=$clear.data("data"),d=0;d<data.length;d++){var unselectData={data:data[d]};if(this.trigger("unselect",unselectData),unselectData.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},AllowClear.prototype._handleKeyboardClear=function(_,evt,container){container.isOpen()||evt.which!=KEYS.DELETE&&evt.which!=KEYS.BACKSPACE||this._handleClear(evt)},AllowClear.prototype.update=function(decorated,data){if(decorated.call(this,data),!(this.$selection.find(".select2-selection__placeholder").length>0||0===data.length)){var $remove=$('<span class="select2-selection__clear">×</span>');$remove.data("data",data),this.$selection.find(".select2-selection__rendered").prepend($remove)}},AllowClear}),S2.define("select2/selection/search",["jquery","../utils","../keys"],function($,Utils,KEYS){function Search(decorated,$element,options){decorated.call(this,$element,options)}return Search.prototype.render=function(decorated){var $search=$('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=$search,this.$search=$search.find("input");var $rendered=decorated.call(this);return this._transferTabIndex(),$rendered},Search.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("open",function(){self.$search.trigger("focus")}),container.on("close",function(){self.$search.val(""),self.$search.removeAttr("aria-activedescendant"),self.$search.trigger("focus")}),container.on("enable",function(){self.$search.prop("disabled",!1),self._transferTabIndex()}),container.on("disable",function(){self.$search.prop("disabled",!0)}),container.on("focus",function(evt){self.$search.trigger("focus")}),container.on("results:focus",function(params){self.$search.attr("aria-activedescendant",params.id)}),this.$selection.on("focusin",".select2-search--inline",function(evt){self.trigger("focus",evt)}),this.$selection.on("focusout",".select2-search--inline",function(evt){self._handleBlur(evt)}),this.$selection.on("keydown",".select2-search--inline",function(evt){if(evt.stopPropagation(),self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented(),evt.which===KEYS.BACKSPACE&&""===self.$search.val()){var $previousChoice=self.$searchContainer.prev(".select2-selection__choice");if($previousChoice.length>0){var item=$previousChoice.data("data");self.searchRemoveChoice(item),evt.preventDefault()}}});var msie=document.documentMode,disableInputEvents=msie&&msie<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(evt){if(disableInputEvents)return void self.$selection.off("input.search input.searchcheck");self.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(evt){if(disableInputEvents&&"input"===evt.type)return void self.$selection.off("input.search input.searchcheck");var key=evt.which;key!=KEYS.SHIFT&&key!=KEYS.CTRL&&key!=KEYS.ALT&&key!=KEYS.TAB&&self.handleSearch(evt)})},Search.prototype._transferTabIndex=function(decorated){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},Search.prototype.createPlaceholder=function(decorated,placeholder){this.$search.attr("placeholder",placeholder.text)},Search.prototype.update=function(decorated,data){var searchHadFocus=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),decorated.call(this,data),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),searchHadFocus&&this.$search.focus()},Search.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=!1},Search.prototype.searchRemoveChoice=function(decorated,item){this.trigger("unselect",{data:item}),this.$search.val(item.text),this.handleSearch()},Search.prototype.resizeSearch=function(){this.$search.css("width","25px");var width="";if(""!==this.$search.attr("placeholder"))width=this.$selection.find(".select2-selection__rendered").innerWidth();else{width=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",width)},Search}),S2.define("select2/selection/eventRelay",["jquery"],function($){function EventRelay(){}return EventRelay.prototype.bind=function(decorated,container,$container){var self=this,relayEvents=["open","opening","close","closing","select","selecting","unselect","unselecting"],preventableEvents=["opening","closing","selecting","unselecting"];decorated.call(this,container,$container),container.on("*",function(name,params){if(-1!==$.inArray(name,relayEvents)){params=params||{};var evt=$.Event("select2:"+name,{params:params});self.$element.trigger(evt),-1!==$.inArray(name,preventableEvents)&&(params.prevented=evt.isDefaultPrevented())}})},EventRelay}),S2.define("select2/translation",["jquery","require"],function($,require){function Translation(dict){this.dict=dict||{}}return Translation.prototype.all=function(){return this.dict},Translation.prototype.get=function(key){return this.dict[key]},Translation.prototype.extend=function(translation){this.dict=$.extend({},translation.all(),this.dict)},Translation._cache={},Translation.loadPath=function(path){if(!(path in Translation._cache)){var translations=require(path);Translation._cache[path]=translations}return new Translation(Translation._cache[path])},Translation}),S2.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),S2.define("select2/data/base",["../utils"],function(Utils){function BaseAdapter($element,options){BaseAdapter.__super__.constructor.call(this)}return Utils.Extend(BaseAdapter,Utils.Observable),BaseAdapter.prototype.current=function(callback){throw new Error("The `current` method must be defined in child classes.")},BaseAdapter.prototype.query=function(params,callback){throw new Error("The `query` method must be defined in child classes.")},BaseAdapter.prototype.bind=function(container,$container){},BaseAdapter.prototype.destroy=function(){},BaseAdapter.prototype.generateResultId=function(container,data){var id=container.id+"-result-";return id+=Utils.generateChars(4),null!=data.id?id+="-"+data.id.toString():id+="-"+Utils.generateChars(4),id},BaseAdapter}),S2.define("select2/data/select",["./base","../utils","jquery"],function(BaseAdapter,Utils,$){function SelectAdapter($element,options){this.$element=$element,this.options=options,SelectAdapter.__super__.constructor.call(this)}return Utils.Extend(SelectAdapter,BaseAdapter),SelectAdapter.prototype.current=function(callback){var data=[],self=this;this.$element.find(":selected").each(function(){var $option=$(this),option=self.item($option);data.push(option)}),callback(data)},SelectAdapter.prototype.select=function(data){var self=this;if(data.selected=!0,$(data.element).is("option"))return data.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(currentData){var val=[];data=[data],data.push.apply(data,currentData);for(var d=0;d<data.length;d++){var id=data[d].id;-1===$.inArray(id,val)&&val.push(id)}self.$element.val(val),self.$element.trigger("change")});else{var val=data.id;this.$element.val(val),this.$element.trigger("change")}},SelectAdapter.prototype.unselect=function(data){var self=this;if(this.$element.prop("multiple")){if(data.selected=!1,$(data.element).is("option"))return data.element.selected=!1,void this.$element.trigger("change");this.current(function(currentData){for(var val=[],d=0;d<currentData.length;d++){var id=currentData[d].id;id!==data.id&&-1===$.inArray(id,val)&&val.push(id)}self.$element.val(val),self.$element.trigger("change")})}},SelectAdapter.prototype.bind=function(container,$container){var self=this;this.container=container,container.on("select",function(params){self.select(params.data)}),container.on("unselect",function(params){self.unselect(params.data)})},SelectAdapter.prototype.destroy=function(){this.$element.find("*").each(function(){$.removeData(this,"data")})},SelectAdapter.prototype.query=function(params,callback){var data=[],self=this;this.$element.children().each(function(){var $option=$(this);if($option.is("option")||$option.is("optgroup")){var option=self.item($option),matches=self.matches(params,option);null!==matches&&data.push(matches)}}),callback({results:data})},SelectAdapter.prototype.addOptions=function($options){Utils.appendMany(this.$element,$options)},SelectAdapter.prototype.option=function(data){var option;data.children?(option=document.createElement("optgroup"),option.label=data.text):(option=document.createElement("option"),void 0!==option.textContent?option.textContent=data.text:option.innerText=data.text),void 0!==data.id&&(option.value=data.id),data.disabled&&(option.disabled=!0),data.selected&&(option.selected=!0),data.title&&(option.title=data.title);var $option=$(option),normalizedData=this._normalizeItem(data);return normalizedData.element=option,$.data(option,"data",normalizedData),$option},SelectAdapter.prototype.item=function($option){var data={};if(null!=(data=$.data($option[0],"data")))return data;if($option.is("option"))data={id:$option.val(),text:$option.text(),disabled:$option.prop("disabled"),selected:$option.prop("selected"),title:$option.prop("title")};else if($option.is("optgroup")){data={text:$option.prop("label"),children:[],title:$option.prop("title")};for(var $children=$option.children("option"),children=[],c=0;c<$children.length;c++){var $child=$($children[c]),child=this.item($child);children.push(child)}data.children=children}return data=this._normalizeItem(data),data.element=$option[0],$.data($option[0],"data",data),data},SelectAdapter.prototype._normalizeItem=function(item){$.isPlainObject(item)||(item={id:item,text:item}),item=$.extend({},{text:""},item);var defaults={selected:!1,disabled:!1};return null!=item.id&&(item.id=item.id.toString()),null!=item.text&&(item.text=item.text.toString()),null==item._resultId&&item.id&&null!=this.container&&(item._resultId=this.generateResultId(this.container,item)),$.extend({},defaults,item)},SelectAdapter.prototype.matches=function(params,data){return this.options.get("matcher")(params,data)},SelectAdapter}),S2.define("select2/data/array",["./select","../utils","jquery"],function(SelectAdapter,Utils,$){function ArrayAdapter($element,options){var data=options.get("data")||[];ArrayAdapter.__super__.constructor.call(this,$element,options),this.addOptions(this.convertToOptions(data))}return Utils.Extend(ArrayAdapter,SelectAdapter),ArrayAdapter.prototype.select=function(data){var $option=this.$element.find("option").filter(function(i,elm){return elm.value==data.id.toString()});0===$option.length&&($option=this.option(data),this.addOptions($option)),ArrayAdapter.__super__.select.call(this,data)},ArrayAdapter.prototype.convertToOptions=function(data){for(var self=this,$existing=this.$element.find("option"),existingIds=$existing.map(function(){return self.item($(this)).id}).get(),$options=[],d=0;d<data.length;d++){var item=this._normalizeItem(data[d]);if($.inArray(item.id,existingIds)>=0){var $existingOption=$existing.filter(function(item){return function(){return $(this).val()==item.id}}(item)),existingData=this.item($existingOption),newData=$.extend(!0,{},item,existingData),$newOption=this.option(newData);$existingOption.replaceWith($newOption)}else{var $option=this.option(item);if(item.children){var $children=this.convertToOptions(item.children);Utils.appendMany($option,$children)}$options.push($option)}}return $options},ArrayAdapter}),S2.define("select2/data/ajax",["./array","../utils","jquery"],function(ArrayAdapter,Utils,$){function AjaxAdapter($element,options){this.ajaxOptions=this._applyDefaults(options.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),AjaxAdapter.__super__.constructor.call(this,$element,options)}return Utils.Extend(AjaxAdapter,ArrayAdapter),AjaxAdapter.prototype._applyDefaults=function(options){var defaults={data:function(params){return $.extend({},params,{q:params.term})},transport:function(params,success,failure){var $request=$.ajax(params);return $request.then(success),$request.fail(failure),$request}};return $.extend({},defaults,options,!0)},AjaxAdapter.prototype.processResults=function(results){return results},AjaxAdapter.prototype.query=function(params,callback){function request(){var $request=options.transport(options,function(data){var results=self.processResults(data,params);self.options.get("debug")&&window.console&&console.error&&(results&&results.results&&$.isArray(results.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),callback(results)},function(){$request.status&&"0"===$request.status||self.trigger("results:message",{message:"errorLoading"})});self._request=$request}var self=this;null!=this._request&&($.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var options=$.extend({type:"GET"},this.ajaxOptions);"function"==typeof options.url&&(options.url=options.url.call(this.$element,params)),"function"==typeof options.data&&(options.data=options.data.call(this.$element,params)),this.ajaxOptions.delay&&null!=params.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(request,this.ajaxOptions.delay)):request()},AjaxAdapter}),S2.define("select2/data/tags",["jquery"],function($){function Tags(decorated,$element,options){var tags=options.get("tags"),createTag=options.get("createTag");void 0!==createTag&&(this.createTag=createTag);var insertTag=options.get("insertTag");if(void 0!==insertTag&&(this.insertTag=insertTag),decorated.call(this,$element,options),$.isArray(tags))for(var t=0;t<tags.length;t++){var tag=tags[t],item=this._normalizeItem(tag),$option=this.option(item);this.$element.append($option)}}return Tags.prototype.query=function(decorated,params,callback){function wrapper(obj,child){for(var data=obj.results,i=0;i<data.length;i++){var option=data[i],checkChildren=null!=option.children&&!wrapper({results:option.children},!0);if((option.text||"").toUpperCase()===(params.term||"").toUpperCase()||checkChildren)return!child&&(obj.data=data,void callback(obj))}if(child)return!0;var tag=self.createTag(params);if(null!=tag){var $option=self.option(tag);$option.attr("data-select2-tag",!0),self.addOptions([$option]),self.insertTag(data,tag)}obj.results=data,callback(obj)}var self=this;if(this._removeOldTags(),null==params.term||null!=params.page)return void decorated.call(this,params,callback);decorated.call(this,params,wrapper)},Tags.prototype.createTag=function(decorated,params){var term=$.trim(params.term);return""===term?null:{id:term,text:term}},Tags.prototype.insertTag=function(_,data,tag){data.unshift(tag)},Tags.prototype._removeOldTags=function(_){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||$(this).remove()})},Tags}),S2.define("select2/data/tokenizer",["jquery"],function($){function Tokenizer(decorated,$element,options){var tokenizer=options.get("tokenizer");void 0!==tokenizer&&(this.tokenizer=tokenizer),decorated.call(this,$element,options)}return Tokenizer.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container),this.$search=container.dropdown.$search||container.selection.$search||$container.find(".select2-search__field")},Tokenizer.prototype.query=function(decorated,params,callback){function createAndSelect(data){var item=self._normalizeItem(data);if(!self.$element.find("option").filter(function(){return $(this).val()===item.id}).length){var $option=self.option(item);$option.attr("data-select2-tag",!0),self._removeOldTags(),self.addOptions([$option])}select(item)}function select(data){self.trigger("select",{data:data})}var self=this;params.term=params.term||"";var tokenData=this.tokenizer(params,this.options,createAndSelect);tokenData.term!==params.term&&(this.$search.length&&(this.$search.val(tokenData.term),this.$search.focus()),params.term=tokenData.term),decorated.call(this,params,callback)},Tokenizer.prototype.tokenizer=function(_,params,options,callback){for(var separators=options.get("tokenSeparators")||[],term=params.term,i=0,createTag=this.createTag||function(params){return{id:params.term,text:params.term}};i<term.length;){var termChar=term[i];if(-1!==$.inArray(termChar,separators)){var part=term.substr(0,i),partParams=$.extend({},params,{term:part}),data=createTag(partParams);null!=data?(callback(data),term=term.substr(i+1)||"",i=0):i++}else i++}return{term:term}},Tokenizer}),S2.define("select2/data/minimumInputLength",[],function(){function MinimumInputLength(decorated,$e,options){this.minimumInputLength=options.get("minimumInputLength"),decorated.call(this,$e,options)}return MinimumInputLength.prototype.query=function(decorated,params,callback){if(params.term=params.term||"",params.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:params.term,params:params}});decorated.call(this,params,callback)},MinimumInputLength}),S2.define("select2/data/maximumInputLength",[],function(){function MaximumInputLength(decorated,$e,options){this.maximumInputLength=options.get("maximumInputLength"),decorated.call(this,$e,options)}return MaximumInputLength.prototype.query=function(decorated,params,callback){if(params.term=params.term||"",this.maximumInputLength>0&¶ms.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:params.term,params:params}});decorated.call(this,params,callback)},MaximumInputLength}),S2.define("select2/data/maximumSelectionLength",[],function(){function MaximumSelectionLength(decorated,$e,options){this.maximumSelectionLength=options.get("maximumSelectionLength"),decorated.call(this,$e,options)}return MaximumSelectionLength.prototype.query=function(decorated,params,callback){var self=this;this.current(function(currentData){var count=null!=currentData?currentData.length:0;if(self.maximumSelectionLength>0&&count>=self.maximumSelectionLength)return void self.trigger("results:message",{message:"maximumSelected",args:{maximum:self.maximumSelectionLength}});decorated.call(self,params,callback)})},MaximumSelectionLength}),S2.define("select2/dropdown",["jquery","./utils"],function($,Utils){function Dropdown($element,options){this.$element=$element,this.options=options,Dropdown.__super__.constructor.call(this)}return Utils.Extend(Dropdown,Utils.Observable),Dropdown.prototype.render=function(){var $dropdown=$('<span class="select2-dropdown"><span class="select2-results"></span></span>');return $dropdown.attr("dir",this.options.get("dir")),this.$dropdown=$dropdown,$dropdown},Dropdown.prototype.bind=function(){},Dropdown.prototype.position=function($dropdown,$container){},Dropdown.prototype.destroy=function(){this.$dropdown.remove()},Dropdown}),S2.define("select2/dropdown/search",["jquery","../utils"],function($,Utils){function Search(){}return Search.prototype.render=function(decorated){var $rendered=decorated.call(this),$search=$('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=$search,this.$search=$search.find("input"),$rendered.prepend($search),$rendered},Search.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),this.$search.on("keydown",function(evt){self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented()}),this.$search.on("input",function(evt){$(this).off("keyup")}),this.$search.on("keyup input",function(evt){self.handleSearch(evt)}),container.on("open",function(){self.$search.attr("tabindex",0),self.$search.focus(),window.setTimeout(function(){self.$search.focus()},0)}),container.on("close",function(){self.$search.attr("tabindex",-1),self.$search.val("")}),container.on("focus",function(){container.isOpen()||self.$search.focus()}),container.on("results:all",function(params){if(null==params.query.term||""===params.query.term){self.showSearch(params)?self.$searchContainer.removeClass("select2-search--hide"):self.$searchContainer.addClass("select2-search--hide")}})},Search.prototype.handleSearch=function(evt){if(!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=!1},Search.prototype.showSearch=function(_,params){return!0},Search}),S2.define("select2/dropdown/hidePlaceholder",[],function(){function HidePlaceholder(decorated,$element,options,dataAdapter){this.placeholder=this.normalizePlaceholder(options.get("placeholder")),decorated.call(this,$element,options,dataAdapter)}return HidePlaceholder.prototype.append=function(decorated,data){data.results=this.removePlaceholder(data.results),decorated.call(this,data)},HidePlaceholder.prototype.normalizePlaceholder=function(_,placeholder){return"string"==typeof placeholder&&(placeholder={id:"",text:placeholder}),placeholder},HidePlaceholder.prototype.removePlaceholder=function(_,data){for(var modifiedData=data.slice(0),d=data.length-1;d>=0;d--){var item=data[d];this.placeholder.id===item.id&&modifiedData.splice(d,1)}return modifiedData},HidePlaceholder}),S2.define("select2/dropdown/infiniteScroll",["jquery"],function($){function InfiniteScroll(decorated,$element,options,dataAdapter){this.lastParams={},decorated.call(this,$element,options,dataAdapter),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return InfiniteScroll.prototype.append=function(decorated,data){this.$loadingMore.remove(),this.loading=!1,decorated.call(this,data),this.showLoadingMore(data)&&this.$results.append(this.$loadingMore)},InfiniteScroll.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("query",function(params){self.lastParams=params,self.loading=!0}),container.on("query:append",function(params){self.lastParams=params,self.loading=!0}),this.$results.on("scroll",function(){var isLoadMoreVisible=$.contains(document.documentElement,self.$loadingMore[0]);if(!self.loading&&isLoadMoreVisible){self.$results.offset().top+self.$results.outerHeight(!1)+50>=self.$loadingMore.offset().top+self.$loadingMore.outerHeight(!1)&&self.loadMore()}})},InfiniteScroll.prototype.loadMore=function(){this.loading=!0;var params=$.extend({},{page:1},this.lastParams);params.page++,this.trigger("query:append",params)},InfiniteScroll.prototype.showLoadingMore=function(_,data){return data.pagination&&data.pagination.more},InfiniteScroll.prototype.createLoadingMore=function(){var $option=$('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),message=this.options.get("translations").get("loadingMore");return $option.html(message(this.lastParams)),$option},InfiniteScroll}),S2.define("select2/dropdown/attachBody",["jquery","../utils"],function($,Utils){function AttachBody(decorated,$element,options){this.$dropdownParent=options.get("dropdownParent")||$(document.body),decorated.call(this,$element,options)}return AttachBody.prototype.bind=function(decorated,container,$container){var self=this,setupResultsEvents=!1;decorated.call(this,container,$container),container.on("open",function(){self._showDropdown(),self._attachPositioningHandler(container),setupResultsEvents||(setupResultsEvents=!0,container.on("results:all",function(){self._positionDropdown(),self._resizeDropdown()}),container.on("results:append",function(){self._positionDropdown(),self._resizeDropdown()}))}),container.on("close",function(){self._hideDropdown(),self._detachPositioningHandler(container)}),this.$dropdownContainer.on("mousedown",function(evt){evt.stopPropagation()})},AttachBody.prototype.destroy=function(decorated){decorated.call(this),this.$dropdownContainer.remove()},AttachBody.prototype.position=function(decorated,$dropdown,$container){$dropdown.attr("class",$container.attr("class")),$dropdown.removeClass("select2"),$dropdown.addClass("select2-container--open"),$dropdown.css({position:"absolute",top:-999999}),this.$container=$container},AttachBody.prototype.render=function(decorated){var $container=$("<span></span>"),$dropdown=decorated.call(this);return $container.append($dropdown),this.$dropdownContainer=$container,$container},AttachBody.prototype._hideDropdown=function(decorated){this.$dropdownContainer.detach()},AttachBody.prototype._attachPositioningHandler=function(decorated,container){var self=this,scrollEvent="scroll.select2."+container.id,resizeEvent="resize.select2."+container.id,orientationEvent="orientationchange.select2."+container.id,$watchers=this.$container.parents().filter(Utils.hasScroll);$watchers.each(function(){$(this).data("select2-scroll-position",{x:$(this).scrollLeft(),y:$(this).scrollTop()})}),$watchers.on(scrollEvent,function(ev){var position=$(this).data("select2-scroll-position");$(this).scrollTop(position.y)}),$(window).on(scrollEvent+" "+resizeEvent+" "+orientationEvent,function(e){self._positionDropdown(),self._resizeDropdown()})},AttachBody.prototype._detachPositioningHandler=function(decorated,container){var scrollEvent="scroll.select2."+container.id,resizeEvent="resize.select2."+container.id,orientationEvent="orientationchange.select2."+container.id;this.$container.parents().filter(Utils.hasScroll).off(scrollEvent),$(window).off(scrollEvent+" "+resizeEvent+" "+orientationEvent)},AttachBody.prototype._positionDropdown=function(){var $window=$(window),isCurrentlyAbove=this.$dropdown.hasClass("select2-dropdown--above"),isCurrentlyBelow=this.$dropdown.hasClass("select2-dropdown--below"),newDirection=null,offset=this.$container.offset();offset.bottom=offset.top+this.$container.outerHeight(!1);var container={height:this.$container.outerHeight(!1)};container.top=offset.top,container.bottom=offset.top+container.height;var dropdown={height:this.$dropdown.outerHeight(!1)},viewport={top:$window.scrollTop(),bottom:$window.scrollTop()+$window.height()},enoughRoomAbove=viewport.top<offset.top-dropdown.height,enoughRoomBelow=viewport.bottom>offset.bottom+dropdown.height,css={left:offset.left,top:container.bottom},$offsetParent=this.$dropdownParent;"static"===$offsetParent.css("position")&&($offsetParent=$offsetParent.offsetParent());var parentOffset=$offsetParent.offset();css.top-=parentOffset.top,css.left-=parentOffset.left,isCurrentlyAbove||isCurrentlyBelow||(newDirection="below"),enoughRoomBelow||!enoughRoomAbove||isCurrentlyAbove?!enoughRoomAbove&&enoughRoomBelow&&isCurrentlyAbove&&(newDirection="below"):newDirection="above",("above"==newDirection||isCurrentlyAbove&&"below"!==newDirection)&&(css.top=container.top-parentOffset.top-dropdown.height),null!=newDirection&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+newDirection),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+newDirection)),this.$dropdownContainer.css(css)},AttachBody.prototype._resizeDropdown=function(){var css={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(css.minWidth=css.width,css.position="relative",css.width="auto"),this.$dropdown.css(css)},AttachBody.prototype._showDropdown=function(decorated){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},AttachBody}),S2.define("select2/dropdown/minimumResultsForSearch",[],function(){function countResults(data){for(var count=0,d=0;d<data.length;d++){var item=data[d];item.children?count+=countResults(item.children):count++}return count}function MinimumResultsForSearch(decorated,$element,options,dataAdapter){this.minimumResultsForSearch=options.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),decorated.call(this,$element,options,dataAdapter)}return MinimumResultsForSearch.prototype.showSearch=function(decorated,params){return!(countResults(params.data.results)<this.minimumResultsForSearch)&&decorated.call(this,params)},MinimumResultsForSearch}),S2.define("select2/dropdown/selectOnClose",[],function(){function SelectOnClose(){}return SelectOnClose.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("close",function(params){self._handleSelectOnClose(params)})},SelectOnClose.prototype._handleSelectOnClose=function(_,params){if(params&&null!=params.originalSelect2Event){var event=params.originalSelect2Event;if("select"===event._type||"unselect"===event._type)return}var $highlightedResults=this.getHighlightedResults();if(!($highlightedResults.length<1)){var data=$highlightedResults.data("data");null!=data.element&&data.element.selected||null==data.element&&data.selected||this.trigger("select",{data:data})}},SelectOnClose}),S2.define("select2/dropdown/closeOnSelect",[],function(){function CloseOnSelect(){}return CloseOnSelect.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("select",function(evt){self._selectTriggered(evt)}),container.on("unselect",function(evt){self._selectTriggered(evt)})},CloseOnSelect.prototype._selectTriggered=function(_,evt){var originalEvent=evt.originalEvent;originalEvent&&originalEvent.ctrlKey||this.trigger("close",{originalEvent:originalEvent,originalSelect2Event:evt})},CloseOnSelect}),S2.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(args){var overChars=args.input.length-args.maximum,message="Please delete "+overChars+" character";return 1!=overChars&&(message+="s"),message},inputTooShort:function(args){return"Please enter "+(args.minimum-args.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(args){var message="You can only select "+args.maximum+" item";return 1!=args.maximum&&(message+="s"),message},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),S2.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function($,require,ResultsList,SingleSelection,MultipleSelection,Placeholder,AllowClear,SelectionSearch,EventRelay,Utils,Translation,DIACRITICS,SelectData,ArrayData,AjaxData,Tags,Tokenizer,MinimumInputLength,MaximumInputLength,MaximumSelectionLength,Dropdown,DropdownSearch,HidePlaceholder,InfiniteScroll,AttachBody,MinimumResultsForSearch,SelectOnClose,CloseOnSelect,EnglishTranslation){function Defaults(){this.reset()}return Defaults.prototype.apply=function(options){if(options=$.extend(!0,{},this.defaults,options),null==options.dataAdapter){if(null!=options.ajax?options.dataAdapter=AjaxData:null!=options.data?options.dataAdapter=ArrayData:options.dataAdapter=SelectData,options.minimumInputLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MinimumInputLength)),options.maximumInputLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumInputLength)),options.maximumSelectionLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumSelectionLength)),options.tags&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,Tags)),null==options.tokenSeparators&&null==options.tokenizer||(options.dataAdapter=Utils.Decorate(options.dataAdapter,Tokenizer)),null!=options.query){var Query=require(options.amdBase+"compat/query");options.dataAdapter=Utils.Decorate(options.dataAdapter,Query)}if(null!=options.initSelection){var InitSelection=require(options.amdBase+"compat/initSelection");options.dataAdapter=Utils.Decorate(options.dataAdapter,InitSelection)}}if(null==options.resultsAdapter&&(options.resultsAdapter=ResultsList,null!=options.ajax&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,InfiniteScroll)),null!=options.placeholder&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,HidePlaceholder)),options.selectOnClose&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,SelectOnClose))),null==options.dropdownAdapter){if(options.multiple)options.dropdownAdapter=Dropdown;else{var SearchableDropdown=Utils.Decorate(Dropdown,DropdownSearch);options.dropdownAdapter=SearchableDropdown}if(0!==options.minimumResultsForSearch&&(options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,MinimumResultsForSearch)),options.closeOnSelect&&(options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,CloseOnSelect)),null!=options.dropdownCssClass||null!=options.dropdownCss||null!=options.adaptDropdownCssClass){var DropdownCSS=require(options.amdBase+"compat/dropdownCss");options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,DropdownCSS)}options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,AttachBody)}if(null==options.selectionAdapter){if(options.multiple?options.selectionAdapter=MultipleSelection:options.selectionAdapter=SingleSelection,null!=options.placeholder&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,Placeholder)),options.allowClear&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,AllowClear)),options.multiple&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,SelectionSearch)),null!=options.containerCssClass||null!=options.containerCss||null!=options.adaptContainerCssClass){var ContainerCSS=require(options.amdBase+"compat/containerCss");options.selectionAdapter=Utils.Decorate(options.selectionAdapter,ContainerCSS)}options.selectionAdapter=Utils.Decorate(options.selectionAdapter,EventRelay)}if("string"==typeof options.language)if(options.language.indexOf("-")>0){var languageParts=options.language.split("-"),baseLanguage=languageParts[0];options.language=[options.language,baseLanguage]}else options.language=[options.language];if($.isArray(options.language)){var languages=new Translation;options.language.push("en");for(var languageNames=options.language,l=0;l<languageNames.length;l++){var name=languageNames[l],language={};try{language=Translation.loadPath(name)}catch(e){try{name=this.defaults.amdLanguageBase+name,language=Translation.loadPath(name)}catch(ex){options.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+name+'" could not be automatically loaded. A fallback will be used instead.');continue}}languages.extend(language)}options.translations=languages}else{var baseTranslation=Translation.loadPath(this.defaults.amdLanguageBase+"en"),customTranslation=new Translation(options.language);customTranslation.extend(baseTranslation),options.translations=customTranslation}return options},Defaults.prototype.reset=function(){function stripDiacritics(text){function match(a){return DIACRITICS[a]||a}return text.replace(/[^\u0000-\u007E]/g,match)}function matcher(params,data){if(""===$.trim(params.term))return data;if(data.children&&data.children.length>0){for(var match=$.extend(!0,{},data),c=data.children.length-1;c>=0;c--){null==matcher(params,data.children[c])&&match.children.splice(c,1)}return match.children.length>0?match:matcher(params,match)}var original=stripDiacritics(data.text).toUpperCase(),term=stripDiacritics(params.term).toUpperCase();return original.indexOf(term)>-1?data:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:Utils.escapeMarkup,language:EnglishTranslation,matcher:matcher,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(data){return data},templateResult:function(result){return result.text},templateSelection:function(selection){return selection.text},theme:"default",width:"resolve"}},Defaults.prototype.set=function(key,value){var camelKey=$.camelCase(key),data={};data[camelKey]=value;var convertedData=Utils._convertData(data);$.extend(this.defaults,convertedData)},new Defaults}),S2.define("select2/options",["require","jquery","./defaults","./utils"],function(require,$,Defaults,Utils){function Options(options,$element){if(this.options=options,null!=$element&&this.fromElement($element),this.options=Defaults.apply(this.options),$element&&$element.is("input")){var InputCompat=require(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=Utils.Decorate(this.options.dataAdapter,InputCompat)}}return Options.prototype.fromElement=function($e){var excludedData=["select2"];null==this.options.multiple&&(this.options.multiple=$e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=$e.prop("disabled")),null==this.options.language&&($e.prop("lang")?this.options.language=$e.prop("lang").toLowerCase():$e.closest("[lang]").prop("lang")&&(this.options.language=$e.closest("[lang]").prop("lang"))),null==this.options.dir&&($e.prop("dir")?this.options.dir=$e.prop("dir"):$e.closest("[dir]").prop("dir")?this.options.dir=$e.closest("[dir]").prop("dir"):this.options.dir="ltr"),$e.prop("disabled",this.options.disabled),$e.prop("mult
|