Easy Forms for MailChimp - Version 6.6.1

Version Description

Download this release

Release Info

Developer fmixell
Plugin Icon 128x128 Easy Forms for MailChimp
Version 6.6.1
Comparing to
See all releases

Code changes from version 6.5.5 to 6.6.1

admin/partials/edit-form.php CHANGED
@@ -283,7 +283,7 @@ do_action( 'yikes-mailchimp-edit-form-notice' );
283
  <?php
284
  if ( isset( $tags ) && ! isset( $tags['error'] ) ) {
285
  echo '<p class="description">' . __( "Select a tag to add to the form builder. Selected tags will be added to all subscribers of this form.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
286
- echo '<p id="yikes-tags-error-message" class="hidden"><strong>' . __( 'Warning: due to limitations in Mailchimp\'s API, tags are not currently supported for double opt-in signups.', 'yikes-inc-easy-mailchimp-extender' ) . '</strong></p>';
287
  $this->build_available_tags( isset( $form['tags'] ) ? $form['tags'] : array(), $tags, $form['list_id'] );
288
  } else {
289
  echo '<p class="description">' . $interest_groupings['error'] . '</p>';
283
  <?php
284
  if ( isset( $tags ) && ! isset( $tags['error'] ) ) {
285
  echo '<p class="description">' . __( "Select a tag to add to the form builder. Selected tags will be added to all subscribers of this form.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
286
+ echo '<p id="yikes-tags-error-message" class="hidden"><strong>' . __( 'Double Opt-in Tagging Now Supported!', 'yikes-inc-easy-mailchimp-extender' ) . '</strong></p>';
287
  $this->build_available_tags( isset( $form['tags'] ) ? $form['tags'] : array(), $tags, $form['list_id'] );
288
  } else {
289
  echo '<p class="description">' . $interest_groupings['error'] . '</p>';
blocks/blocks.php CHANGED
@@ -12,6 +12,7 @@ abstract class YIKES_Easy_Forms_Blocks {
12
  public function __construct() {
13
  add_action( 'enqueue_block_editor_assets', array( $this, 'editor_scripts' ) );
14
  add_action( 'init', array( $this, 'register_blocks' ), 11 );
 
15
  }
16
 
17
  /**
@@ -39,4 +40,18 @@ abstract class YIKES_Easy_Forms_Blocks {
39
  * @return string Block output.
40
  */
41
  abstract public function render_block( $attributes, $content );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
12
  public function __construct() {
13
  add_action( 'enqueue_block_editor_assets', array( $this, 'editor_scripts' ) );
14
  add_action( 'init', array( $this, 'register_blocks' ), 11 );
15
+ add_filter( 'block_categories', array( $this, 'easy_forms_register_category' ), 10, 2);
16
  }
17
 
18
  /**
40
  * @return string Block output.
41
  */
42
  abstract public function render_block( $attributes, $content );
43
+
44
+ public function easy_forms_register_category( $categories ) {
45
+ return array_merge(
46
+ $categories,
47
+ array(
48
+ array(
49
+ 'slug' => 'easy-forms',
50
+ 'title' => __( 'Easy Forms', 'easy-forms' ),
51
+ 'icon' => 'email-alt2'
52
+ ),
53
+ )
54
+ );
55
+ }
56
+
57
  }
blocks/easy-forms-block/build/easy-forms-blocks.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('react', 'wp-element', 'wp-polyfill'), 'version' => 'a8faf52df605acb6ed260427dc38af80');
blocks/easy-forms-block/build/easy-forms-blocks.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function a(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,a),i.l=!0,i.exports}a.m=e,a.c=t,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)a.d(r,i,function(t){return e[t]}.bind(null,i));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=14)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){e.exports=function(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function a(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}},function(e,t,a){var r=a(7),i=a(8);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},function(e,t){function a(t){return e.exports=a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(t)}e.exports=a},function(e,t,a){var r=a(9);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(t){return"function"==typeof Symbol&&"symbol"===a(Symbol.iterator)?e.exports=r=function(e){return a(e)}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)},r(t)}e.exports=r},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){function a(t,r){return e.exports=a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(t,r)}e.exports=a},function(e,t,a){var r;e.exports=(r=a(11),function(e){function t(r){if(a[r])return a[r].exports;var i=a[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var a={};return t.m=e,t.c=a,t.p="",t(0)}([function(e,t,a){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),n=a(6),o=r(n),s=r(a(4)),l={className:s.default.string,onloadCallbackName:s.default.string,elementID:s.default.string,onloadCallback:s.default.func,verifyCallback:s.default.func,expiredCallback:s.default.func,render:s.default.oneOf(["onload","explicit"]),sitekey:s.default.string,theme:s.default.oneOf(["light","dark"]),type:s.default.string,verifyCallbackName:s.default.string,expiredCallbackName:s.default.string,size:s.default.oneOf(["invisible","compact","normal"]),tabindex:s.default.string,hl:s.default.string,badge:s.default.oneOf(["bottomright","bottomleft","inline"])},c=function(){return"undefined"!=typeof window&&void 0!==window.grecaptcha&&"function"==typeof window.grecaptcha.render},p=void 0,u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a._renderGrecaptcha=a._renderGrecaptcha.bind(a),a.reset=a.reset.bind(a),a.state={ready:c(),widget:null},a.state.ready||"undefined"==typeof window||(p=setInterval(a._updateReadyState.bind(a),1e3)),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.state.ready&&this._renderGrecaptcha()}},{key:"componentDidUpdate",value:function(e,t){var a=this.props,r=a.render,i=a.onloadCallback;"explicit"===r&&i&&this.state.ready&&!t.ready&&this._renderGrecaptcha()}},{key:"componentWillUnmount",value:function(){clearInterval(p)}},{key:"reset",value:function(){var e=this.state,t=e.ready,a=e.widget;t&&null!==a&&grecaptcha.reset(a)}},{key:"execute",value:function(){var e=this.state,t=e.ready,a=e.widget;t&&null!==a&&grecaptcha.execute(a)}},{key:"_updateReadyState",value:function(){c()&&(this.setState({ready:!0}),clearInterval(p))}},{key:"_renderGrecaptcha",value:function(){this.state.widget=grecaptcha.render(this.props.elementID,{sitekey:this.props.sitekey,callback:this.props.verifyCallback?this.props.verifyCallback:void 0,theme:this.props.theme,type:this.props.type,size:this.props.size,tabindex:this.props.tabindex,hl:this.props.hl,badge:this.props.badge,"expired-callback":this.props.expiredCallback?this.props.expiredCallback:void 0}),this.props.onloadCallback&&this.props.onloadCallback()}},{key:"render",value:function(){return"explicit"===this.props.render&&this.props.onloadCallback?o.default.createElement("div",{id:this.props.elementID,"data-onloadcallbackname":this.props.onloadCallbackName,"data-verifycallbackname":this.props.verifyCallbackName}):o.default.createElement("div",{id:this.props.elementID,className:this.props.className,"data-sitekey":this.props.sitekey,"data-theme":this.props.theme,"data-type":this.props.type,"data-size":this.props.size,"data-badge":this.props.badge,"data-tabindex":this.props.tabindex})}}]),t}(n.Component);t.default=u,u.propTypes=l,u.defaultProps={elementID:"g-recaptcha",className:"g-recaptcha",onloadCallback:void 0,onloadCallbackName:"onloadCallback",verifyCallback:void 0,verifyCallbackName:"verifyCallback",expiredCallback:void 0,expiredCallbackName:"expiredCallback",render:"onload",theme:"light",type:"image",size:"normal",tabindex:"0",hl:"en",badge:"bottomright"},e.exports=t.default},function(e,t){"use strict";function a(e){return function(){return e}}var r=function(){};r.thatReturns=a,r.thatReturnsFalse=a(!1),r.thatReturnsTrue=a(!0),r.thatReturnsNull=a(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,a){"use strict";var r=function(e){};e.exports=function(e,t,a,i,n,o,s,l){if(r(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var p=[a,i,n,o,s,l],u=0;(c=new Error(t.replace(/%s/g,(function(){return p[u++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,a){"use strict";var r=a(1),i=a(2),n=a(5);e.exports=function(){function e(e,t,a,r,o,s){s!==n&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var a={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return a.checkPropTypes=r,a.PropTypes=a,a}},function(e,t,a){e.exports=a(3)()},function(e,t){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){e.exports=r}]))},function(e,t){!function(){e.exports=this.React}()},function(e,t,a){},function(e,t){var a;(a=jQuery)(document).ready((function(){a("body").on("click",".yikes-easy-mc-submit-button",(function(e){e.preventDefault(),e.stopPropagation(),a(".yikes-mailchimp-submit-button-span-text").focus()})),a("body").on("click",".yikes-mailchimp-submit-button-span-text",(function(e){e.preventDefault(),e.stopPropagation()}))}))},function(e,t,a){"use strict";a.r(t);var r=a(0),i=a(2),n=a.n(i),o=a(3),s=a.n(o),l=function(){function e(){n()(this,e),this.ajaxurl=window.ajaxurl}return s()(e,[{key:"get_api_key_status",value:function(){var e={action:"yikes_get_api_key_status",nonce:ez_forms_gb_data.get_api_key_status};return jQuery.post(this.ajaxurl,e)}},{key:"get_recaptcha",value:function(){var e={action:"yikes_get_recaptcha",nonce:ez_forms_gb_data.fetch_recaptcha_nonce};return jQuery.post(this.ajaxurl,e)}},{key:"get_forms",value:function(){var e={action:"yikes_get_forms",nonce:ez_forms_gb_data.fetch_forms_nonce};return jQuery.post(this.ajaxurl,e)}},{key:"get_form",value:function(e){var t={action:"yikes_get_form",form_id:e,nonce:ez_forms_gb_data.fetch_form_nonce};return jQuery.post(this.ajaxurl,t)}}]),e}(),c=a(1),p=a.n(c),u=a(4),m=a.n(u),d=a(5),h=a.n(d),f=a(6),b=a.n(f);function y(e){var t={"à":"a","ä":"a","á":"a","â":"a","æ":"a","å":"a","ë":"e","è":"e","é":"e","ê":"e","î":"i","ï":"i","ì":"i","í":"i","ò":"o","ó":"o","ö":"o","ô":"o","ø":"o","ù":"o","ú":"u","ü":"u","û":"u","ñ":"n","ç":"c","ß":"s","ÿ":"y","œ":"o","ŕ":"r","ś":"s","ń":"n","ṕ":"p","ẃ":"w","ǵ":"g","ǹ":"n","ḿ":"m","ǘ":"u","ẍ":"x","ź":"z","ḧ":"h","·":"-","/":"-",_:"-",",":"-",":":"-",";":"-"};return e.toString().toLowerCase().replace(/\s+/g,"-").replace(/./g,(function(e,a,r){return t[e]||e})).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}var g={states:{"":"—",AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District Of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming",AB:"Alberta",BC:"British Columbia",MB:"Manitoba",NB:"New Brunswick",NL:"Newfoundland and Labrador",NS:"Nova Scotia",ON:"Ontario",PE:"Prince Edward Island",QC:"Quebec",SK:"Saskatchewan",NT:"Northwest Territories",NU:"Nunavut",YT:"Yukon"},countries:{US:"United States",GB:"United Kingdom",AF:"Afghanistan",AX:"Aland Islands",AL:"Albania",DZ:"Algeria",AS:"American Samoa",AD:"Andorra",AO:"Angola",AI:"Anguilla",AQ:"Antarctica",AG:"Antigua and Barbuda",AR:"Argentina",AM:"Armenia",AW:"Aruba",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesh",BB:"Barbados",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivia",BA:"Bosnia and Herzegovina",BW:"Botswana",BV:"Bouvet Island",BR:"Brazil",IO:"British Indian Ocean Territory",BN:"Brunei Darussalam",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CV:"Cape Verde",KY:"Cayman Islands",CF:"Central African Republic",TD:"Chad",CL:"Chile",CN:"China",CX:"Christmas Island",CC:"Cocos (Keeling) Islands",CO:"Colombia",KM:"Comoros",CG:"Congo",CD:"Congo, The Democratic Republic of The",CK:"Cook Islands",CR:"Costa Rica",CI:"Cote D’ivoire",HR:"Croatia",CU:"Cuba",CY:"Cyprus",CZ:"Czech Republic",DK:"Denmark",DJ:"Djibouti",DM:"Dominica",DO:"Dominican Republic",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",GQ:"Equatorial Guinea",ER:"Eritrea",EE:"Estonia",ET:"Ethiopia",FK:"Falkland Islands (Malvinas)",FO:"Faroe Islands",FJ:"Fiji",FI:"Finland",FR:"France",GF:"French Guiana",PF:"French Polynesia",TF:"French Southern Territories",GA:"Gabon",GM:"Gambia",GE:"Georgia",DE:"Germany",GH:"Ghana",GI:"Gibraltar",GR:"Greece",GL:"Greenland",GD:"Grenada",GP:"Guadeloupe",GU:"Guam",GT:"Guatemala",GG:"Guernsey",GN:"Guinea",GW:"Guinea-bissau",GY:"Guyana",HT:"Haiti",HM:"Heard Island and Mcdonald Islands",VA:"Holy See (Vatican City State)",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran, Islamic Republic of",IQ:"Iraq",IE:"Ireland",IM:"Isle of Man",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JE:"Jersey",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KI:"Kiribati",KP:"Korea, Democratic People’s Republic of",KR:"Korea, Republic of",KW:"Kuwait",KG:"Kyrgyzstan",LA:"Lao People’s Democratic Republic",LV:"Latvia",LB:"Lebanon",LS:"Lesotho",LR:"Liberia",LY:"Libyan Arab Jamahiriya",LI:"Liechtenstein",LT:"Lithuania",LU:"Luxembourg",MO:"Macao",MK:"Macedonia, The Former Yugoslav Republic of",MG:"Madagascar",MW:"Malawi",MY:"Malaysia",MV:"Maldives",ML:"Mali",MT:"Malta",MH:"Marshall Islands",MQ:"Martinique",MR:"Mauritania",MU:"Mauritius",YT:"Mayotte",MX:"Mexico",FM:"Micronesia, Federated States of",MD:"Moldova, Republic of",MC:"Monaco",MN:"Mongolia",ME:"Montenegro",MS:"Montserrat",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NL:"Netherlands",AN:"Netherlands Antilles",NC:"New Caledonia",NZ:"New Zealand",NI:"Nicaragua",NE:"Niger",NG:"Nigeria",NU:"Niue",NF:"Norfolk Island",MP:"Northern Mariana Islands",NO:"Norway",OM:"Oman",PK:"Pakistan",PW:"Palau",PS:"Palestinian Territory, Occupied",PA:"Panama",PG:"Papua New Guinea",PY:"Paraguay",PE:"Peru",PH:"Philippines",PN:"Pitcairn",PL:"Poland",PT:"Portugal",PR:"Puerto Rico",QA:"Qatar",RE:"Reunion",RO:"Romania",RU:"Russian Federation",RW:"Rwanda",SH:"Saint Helena",KN:"Saint Kitts and Nevis",LC:"Saint Lucia",PM:"Saint Pierre and Miquelon",VC:"Saint Vincent and The Grenadines",WS:"Samoa",SM:"San Marino",ST:"Sao Tome and Principe",SA:"Saudi Arabia",SN:"Senegal",RS:"Serbia",SC:"Seychelles",SL:"Sierra Leone",SG:"Singapore",SK:"Slovakia",SI:"Slovenia",SB:"Solomon Islands",SO:"Somalia",ZA:"South Africa",GS:"South Georgia and The South Sandwich Islands",ES:"Spain",LK:"Sri Lanka",SD:"Sudan",SR:"Suriname",SJ:"Svalbard and Jan Mayen",SZ:"Swaziland",SE:"Sweden",CH:"Switzerland",SY:"Syrian Arab Republic",TW:"Taiwan, Province of China",TJ:"Tajikistan",TZ:"Tanzania, United Republic of",TH:"Thailand",TL:"Timor-leste",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad and Tobago",TN:"Tunisia",TR:"Turkey",TM:"Turkmenistan",TC:"Turks and Caicos Islands",TV:"Tuvalu",UG:"Uganda",UA:"Ukraine",AE:"United Arab Emirates",UM:"United States Minor Outlying Islands",UY:"Uruguay",UZ:"Uzbekistan",VU:"Vanuatu",VE:"Venezuela",VN:"Viet Nam",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",WF:"Wallis and Futuna",EH:"Western Sahara",YE:"Yemen",ZM:"Zambia",ZW:"Zimbabwe"},locales:{ar:"Arabic",af:"Afrikaans",am:"Amharic",hy:"Armenian",az:"Azerbaijani",eu:"Basque",bn:"Bengali",bg:"Bulgarian",ca:"Catalan","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch","en-GB":"English (UK)",en:"English (US)",et:"Estonian",fil:"Filipino",fi:"Finnish",fr:"French","fr-CA":"French (Canadian)",gl:"Galician",ka:"Georgian",de:"German","de-AT":"German (Austria)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujarati",iw:"Hebrew",hi:"Hindi",hu:"Hungarain",is:"Icelandic",id:"Indonesian",it:"Italian",ja:"Japanese",kn:"Kannada",ko:"Korean",lo:"Laothian",lv:"Latvian",lt:"Lithuanian",ms:"Malay",ml:"Malayalam",mr:"Marathi",mn:"Mongolian",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)","pt-PT":"Portuguese (Portugal)",ro:"Romanian",ru:"Russian",sr:"Serbian",si:"Sinhalese",sk:"Slovak",sl:"Slovenian",es:"Spanish","es-419":"Spanish (Latin America)",sw:"Swahili",sv:"Swedish",ta:"Tamil",te:"Telugu",th:"Thai",tr:"Turkish",uk:"Ukrainian",ur:"Urdu",vi:"Vietnamese",zu:"Zulu"},settings_url:"wp-admin/admin.php?page=yikes-inc-easy-mailchimp-settings"},k=a(10),_=wp.i18n.__,v=(wp.blocks.registerBlockType,wp.editor),C=(v.RichText,v.InspectorControls),O=v.PlainText,S=wp.components,E=S.Spinner,N=S.TextControl,j=S.PanelBody,A=S.PanelRow,T=S.FormToggle,w=S.SelectControl,x=function(e){function t(e){var a;return n()(this,t),(a=m()(this,h()(t).apply(this,arguments))).state={api_key_status:"valid",forms:[],recaptcha_data:{data:{},success:!1},forms_loaded:!1},a.api=new l,a.address_fields={addr1:"Address 1",addr2:"Address 2",city:"City",state:"State",zip:"Zip",country:"Country"},a}return b()(t,e),s()(t,[{key:"componentDidMount",value:function(){var e=this;this.api.get_api_key_status().then((function(t){e.setState({api_key_status:t.data})})),this.api.get_forms().then((function(t){e.setState({forms:t.data,forms_loaded:!0})})),this.api.get_recaptcha().then((function(t){e.setState({recaptcha_data:t}),e.props.toggleRecaptchaAbstract(e.state.recaptcha_data.success)}))}},{key:"handleFormFieldChanges",value:function(e){}},{key:"inspector_controls",value:function(){var e=Object(r.createElement)(A,null,Object(r.createElement)("label",{htmlFor:"inline-form-toggle",className:"blocks-base-control__label"},_("Inline")),Object(r.createElement)(T,{id:"inline-form-toggle",label:_("Inline"),checked:!!this.props.inline,onChange:this.props.toggleInline})),t=Object(r.createElement)(A,null,Object(r.createElement)("label",{htmlFor:"show-title-form-toggle",className:"blocks-base-control__label"},_("Show Form Title")),Object(r.createElement)(T,{id:"show-title-form-toggle",label:_("Show Form Title"),checked:!!this.props.showTitle,onChange:this.props.toggleShowTitle})),a=Object(r.createElement)(A,null,Object(r.createElement)("label",{htmlFor:"show-description-form-toggle",className:"blocks-base-control__label"},_("Show Form Description")),Object(r.createElement)(T,{id:"show-description-form-toggle",label:_("Show Form Description"),checked:!!this.props.showDescription,onChange:this.props.toggleShowDescription})),i=Object(r.createElement)(A,null,Object(r.createElement)("label",{htmlFor:"is-ajax-form-toggle",className:"blocks-base-control__label"},_("AJAX Submissions")),Object(r.createElement)(T,{id:"is-ajax-form-toggle",label:_("AJAX"),checked:!!this.props.isAjax,onChange:this.props.toggleIsAjax})),n=Object(r.createElement)(A,null,Object(r.createElement)("label",{htmlFor:"recaptcha-form-toggle",className:"blocks-base-control__label"},_("reCAPTCHA")),Object(r.createElement)(T,{id:"recaptcha-form-toggle",label:_("reCAPTCHA"),checked:!!this.props.recaptcha,onChange:this.props.toggleRecaptcha})),o=this.props.recaptcha?Object(r.createElement)(A,null,Object(r.createElement)("label",{htmlFor:"recaptcha-type-form-toggle",className:"blocks-base-control__label"},_("reCAPTCHA Type")),Object(r.createElement)(w,{value:this.props.recaptchaType,options:[{value:"image",label:"Image"},{value:"audio",label:"Audio"}],onChange:this.props.toggleRecaptchaType})):"",s=this.props.recaptcha?Object(r.createElement)(A,null,Object(r.createElement)("label",{htmlFor:"recaptcha-theme-form-toggle",className:"blocks-base-control__label"},_("reCAPTCHA Theme")),Object(r.createElement)(w,{value:this.props.recaptchaTheme,options:[{value:"light",label:"Light"},{value:"dark",label:"Dark"}],onChange:this.props.toggleRecaptchaTheme})):"",l=this.props.recaptcha?Object(r.createElement)(A,null,Object(r.createElement)("label",{htmlFor:"recaptcha-language-form-toggle",className:"blocks-base-control__label",title:this.state.recaptcha_data.data?"The default language for your locale is "+g.locales[this.state.recaptcha_data.data.locale]:""},_("reCAPTCHA Language")),Object(r.createElement)(w,{id:"recaptcha-language-form-toggle",value:this.props.recaptchaLang.length>0?this.props.recaptchaLang:this.state.recaptcha_data.data?this.state.recaptcha_data.data.locale:"",onChange:this.props.toggleRecaptchaLang,title:this.state.recaptcha_data.data?"The default language for your locale is "+g.locales[this.state.recaptcha_data.data.locale]:"",options:Object.keys(g.locales).map((function(e){return{value:e,label:g.locales[e]}}))})):"",c=this.props.recaptcha?Object(r.createElement)(A,null,Object(r.createElement)("label",{htmlFor:"recaptcha-size-form-toggle",className:"blocks-base-control__label"},_("reCAPTCHA Size")),Object(r.createElement)(w,{id:"recaptcha-size-form-toggle",value:this.props.recaptchaSize,onChange:this.props.toggleRecaptchaSize,options:[{value:"normal",label:"Normal"},{value:"compact",label:"Compact"}]})):"",p=this.props.recaptcha?Object(r.createElement)(N,{id:"recaptcha-verify-callback-form-toggle",label:_("reCAPTCHA Verify Callback"),value:this.props.recaptchaVerifyCallback,onChange:this.props.toggleRecaptchaVerifyCallback}):"",u=this.props.recaptcha?Object(r.createElement)(N,{id:"recaptcha-expired-callback-form-toggle",label:_("reCAPTCHA Expired Callback"),value:this.props.recaptchaExpiredCallback,onChange:this.props.toggleRecaptchaExpiredCallback}):"",m=Object(r.createElement)(C,{key:"easy-forms-inspector"},Object(r.createElement)(j,{title:_("Settings")},e,t,a,i,n,o,s,l,c,p,u));return m}},{key:"forms_dropdown",value:function(){return this.state.forms.length>0?Object(r.createElement)("select",{value:this.props.formID,onChange:this.props.onChangeForm,className:"yikes-mailchimp-forms-dropdown",key:"yikes-mailchimp-forms-dropdown"},Object(r.createElement)("option",{key:"select",value:""},"Select Mailchimp Form..."),this.state.forms.map((function(e){return Object(r.createElement)("option",{key:"yikes-select-form-"+e.id,value:e.id},e.form_name)}))):""}},{key:"form_title",value:function(){return!0===this.props.showTitle?this.props.focus?Object(r.createElement)("h3",{className:"yikes-mailchimp-form-title yikes-mailchimp-form-title-"+this.props.formID,key:"yikes-mailchimp-form-title-wrapper"},Object(r.createElement)(O,{placeholder:this.props.formTitle,key:"yikes-mailchimp-form-title-editable",value:this.props.formTitle,onChange:this.props.toggleFormTitle})):Object(r.createElement)("h3",{className:"yikes-mailchimp-form-title yikes-mailchimp-form-title-"+this.props.formID,key:"yikes-mailchimp-form-title"},this.props.formTitle):""}},{key:"form_description",value:function(){return!0===this.props.showDescription?Object(r.createElement)("section",{className:"yikes-mailchimp-form-description yikes-mailchimp-form-description-"+this.props.formID,key:"yikes-mailchimp-form-description"},Object(r.createElement)(O,{className:"mailchimpDescription",placeholder:_("Enter your form's description here."),value:this.props.descriptionValue.length>0?this.props.descriptionValue:this.props.formData&&this.props.formData.form_description?this.props.formData.form_description:"",onChange:this.props.onChangeDescription,key:"mailchimpDescription"})):""}},{key:"get_address_field",value:function(e,t){switch(e){case"addr1":case"addr2":case"city":case"zip":return Object(r.createElement)(N,{id:"yikes-easy-mc-form-"+this.props.formID+"-"+t.merge+"-"+e,onChange:this.handleFormFieldChanges,type:"text",name:t.merge+"["+e+"]",className:"yikes-easy-mc-"+t.type+" "+t["additional-classes"],key:"yikes-mailchimp-field-"+t.merge+"-"+e,required:("EMAIL"===t.merge||"1"===t.require)&&"required",placeholder:"1"===t.placeholder?this.address_fields[e]:""});case"state":return Object(r.createElement)("select",{id:"yikes-easy-mc-form-"+this.props.formID+"-"+t.merge+"-"+e,name:t.merge+"["+e+"]",className:"yikes-easy-mc-"+t.type+" "+t["additional-classes"],onChange:this.handleFormFieldChanges,key:"yikes-mailchimp-field-"+t.merge+"-"+e,value:"",required:("EMAIL"===t.merge||"1"===t.require)&&"required"},Object.keys(g.states).map((function(e){var t=g.states[e];return Object(r.createElement)("option",{key:"state-"+e,value:e},t)})));case"country":return Object(r.createElement)("select",{id:"yikes-easy-mc-form-"+this.props.formID+"-"+t.merge+"-"+e,name:t.merge+"["+e+"]",className:"yikes-easy-mc-"+t.type+" "+t["additional-classes"],onChange:this.handleFormFieldChanges,key:"yikes-mailchimp-field-"+t.merge+"-"+e,value:"",required:("EMAIL"===t.merge||"1"===t.require)&&"required"},Object.keys(g.countries).map((function(e){var t=g.countries[e];return Object(r.createElement)("option",{key:"country-"+e,value:e},t)})))}}},{key:"get_dropdown_field",value:function(e){return Object(r.createElement)("select",{id:"yikes-easy-mc-form-"+this.props.formID+"-"+e.merge,name:e.merge,className:"yikes-easy-mc-"+e.type+" "+e["additional-classes"],onChange:this.handleFormFieldChanges,key:"yikes-mailchimp-field-"+e.merge,value:JSON.parse(e.choices)[e.default_choice],required:("EMAIL"===e.merge||"1"===e.require)&&"required"},Object.keys(JSON.parse(e.choices)).map((function(t){var a=JSON.parse(e.choices)[t];return Object(r.createElement)("option",{key:y(a),value:a},a)})))}},{key:"get_radio_field",value:function(e){var t=this,a=0;return JSON.parse(e.choices).map((function(i){return a++,Object(r.createElement)("label",{htmlFor:e.merge+"-"+a,className:"yikes-easy-mc-checkbox-label",key:e.merge+"-label-radio-key-"+a},Object(r.createElement)("input",{type:"radio",name:e.merge,id:e.merge+"-"+a,key:e.merge+"-"+a+"-input-key",value:i,onChange:t.handleFormFieldChanges,checked:parseInt(e.default_choice)===a-1}),Object(r.createElement)("span",{key:e.merge+"-span-radio-key-"+a,className:e.merge+"-label"},i))}))}},{key:"get_url_field",value:function(e){return Object(r.createElement)(N,{id:"yikes-easy-mc-form-"+this.props.formID+"-"+e.merge,placeholder:e.placeholder,onChange:this.handleFormFieldChanges,type:"url",value:e.default,name:e.merge,className:"yikes-easy-mc-"+e.type+" "+e["additional-classes"],key:"yikes-mailchimp-field-"+e.merge,required:("EMAIL"===e.merge||"1"===e.require)&&"required",title:"url"===e.type?_("Please enter a valid URL to the website."):_("Please enter a valid URL to the image.")})}},{key:"get_default_field",value:function(e){var t="zip"===e.type||"phone"===e.type?"text":e.type;return Object(r.createElement)(N,{id:"yikes-easy-mc-form-"+this.props.formID+"-"+e.merge,placeholder:e.placeholder,onChange:this.handleFormFieldChanges,type:t,value:e.default,name:e.merge,className:"yikes-easy-mc-"+e.type+" "+e["additional-classes"],key:"yikes-mailchimp-field-"+e.merge,required:("EMAIL"===e.merge||"1"===e.require)&&"required"})}},{key:"get_date_field",value:function(e){return Object(r.createElement)(N,{id:"yikes-easy-mc-form-"+this.props.formID+"-"+e.merge,placeholder:e.placeholder,onChange:this.handleFormFieldChanges,type:"text",value:e.default,name:e.merge,className:"yikes-easy-mc-"+e.type+" "+e["additional-classes"],key:"yikes-mailchimp-field-"+e.merge,required:("EMAIL"===e.merge||"1"===e.require)&&"required","data-attr-type":e.type,"data-date-format":e.date_format.toLowerCase()})}},{key:"get_radio_interest_group",value:function(e){var t=this,a=-1,i="yikes-easy-mc-checkbox-label "+e["additional-classes"];return Object.keys(JSON.parse(e.groups)).map((function(n){var o,s=JSON.parse(e.groups)[n];return a++,Object(r.createElement)("label",{htmlFor:e.group_id+"-"+a,className:(o={},p()(o,i,!0),p()(o,"field-no-label","1"===e["hide-label"]),o),key:e.group_id+"-"+a+"-label-key"},Object(r.createElement)("input",{type:"radio",name:"group-"+e.group_id+"[]",id:e.group_id+"-"+a,key:e.group_id+"-"+a+"-input-key",value:n,onChange:t.handleFormFieldChanges,checked:n===e.default_choice,className:{"yikes-interest-group-required":"1"===e.require}}),s)}))}},{key:"get_hidden_interest_group",value:function(e){var t=this,a=-1;return Object.keys(JSON.parse(e.groups)).map((function(i){var n=JSON.parse(e.groups)[i];return a++,Object(r.createElement)("label",{htmlFor:e.group_id+"-"+a,className:"yikes-easy-mc-checkbox-label "+e["additional-classes"],key:e.group_id+"-"+a+"-label-key"},Object(r.createElement)("input",{type:"checkbox",name:"group-"+e.group_id+"[]",id:e.group_id+"-"+a,key:e.group_id+"-"+a+"-input-key",value:i,onChange:t.handleFormFieldChanges,checked:e.default_choice&&-1!==e.default_choice.indexOf(i)}),n)}))}},{key:"get_checkboxes_interest_group",value:function(e){var t=this,a=-1,i="yikes-easy-mc-checkbox-label "+e["additional-classes"];return Object.keys(JSON.parse(e.groups)).map((function(n){var o,s=JSON.parse(e.groups)[n];return a++,Object(r.createElement)("label",{htmlFor:e.group_id+"-"+a,className:(o={},p()(o,i,!0),p()(o,"field-no-label","1"===e["hide-label"]),o),key:e.group_id+"-"+a+"-label-key"},Object(r.createElement)("input",{className:{"yikes-interest-group-required":"1"===e.require},type:"checkbox",name:"group-"+e.group_id+"[]",id:e.group_id+"-"+a,key:e.group_id+"-"+a+"-input-key",value:n,onChange:t.handleFormFieldChanges,checked:void 0!==e.default_choice&&-1!==e.default_choice.indexOf(n),required:"1"===e.require&&"required"}),s)}))}},{key:"get_dropdown_interest_group",value:function(e){var t=-1;return Object(r.createElement)("select",{id:"yikes-easy-mc-form-"+this.props.formID+"-"+e.group_id,name:"group-"+e.group_id,className:"yikes-easy-mc-dropdown "+e["additional-classes"],value:e.default_choice,onChange:this.handleFormFieldChanges,required:"1"===e.require&&"required"},Object.keys(JSON.parse(e.groups)).map((function(a){var i=JSON.parse(e.groups)[a];return t++,Object(r.createElement)("option",{key:e.group_id+"-"+t+"-input-key",value:a},i)})))}},{key:"form_fields",value:function(){var e=this;return this.props.formData&&this.props.formData.fields?Object.keys(this.props.formData.fields).map((function(t){var a=e.props.formData.fields[t];if(void 0!==a.merge){var i=a.description.length>0?Object(r.createElement)("p",{className:"form-field-description",id:"form-field-description-"+a.merge,key:"form-field-description-"+a.merge},a.description):"",n="1"!==a["hide-label"]?Object(r.createElement)("span",{className:a.merge+"-label",key:a.merge+"-label-span-key"},a.label):"";return(o={"yikes-mailchimp-field-required":"EMAIL"===a.merge||"1"===a.require})[a.merge+"-label"]=!0,"address"===a.type?["1"===a.description_above&&a.description.length>0&&i,Object.keys(e.address_fields).map((function(t){return n="1"!==a["hide-label"]?Object(r.createElement)("span",{className:a.merge+"-label",key:a.merge+"-label-span-key-"+t},e.address_fields[t]):"",Object(r.createElement)("label",{htmlFor:"yikes-easy-mc-form-"+e.props.formID+"-"+a.merge+"-"+t,className:o,key:a.merge+"-label-key-"+t,style:"1"===a.hide?{display:"none"}:{}},n,e.get_address_field(t,a))})),"1"!==a.description_above&&a.description.length>0&&i]:Object(r.createElement)("label",{htmlFor:"yikes-easy-mc-form-"+e.props.formID+"-"+a.merge,className:o,key:a.merge+"-label-key",style:"1"===a.hide?{display:"none"}:{}},n,"1"===a.description_above&&a.description.length>0&&i,"dropdown"===a.type?e.get_dropdown_field(a):"radio"===a.type?e.get_radio_field(a):"url"===a.type||"imageurl"===a.type?e.get_url_field(a):"date"===a.type||"birthday"===a.type?e.get_date_field(a):e.get_default_field(a),"1"!==a.description_above&&a.description.length>0&&i)}var o;i=a.description.length>0?Object(r.createElement)("p",{className:"form-field-description",id:"form-field-description-"+a.group_id,key:"form-field-description-"+a.group_id},a.description):"",n="1"!==a["hide-label"]?Object(r.createElement)("span",{key:a.group_id+"-label-span-key",className:a.group_id+"-label checkbox-parent-label"},a.label):"";return(o={"yikes-mailchimp-field-required":"1"===a.require})[a.group_id+"-label"]=!0,Object(r.createElement)("label",{htmlFor:a.group_id,className:o,key:a.group_id+"-label-span-key",style:"hidden"===a.type||"1"===a.hide?{display:"none"}:{}},n,"1"===a.description_above&&a.description.length>0&&i,"radio"===a.type?e.get_radio_interest_group(a):"hidden"===a.type?e.get_hidden_interest_group(a):"checkboxes"===a.type?e.get_checkboxes_interest_group(a):"dropdown"===a.type?e.get_dropdown_interest_group(a):"","1"!==a.description_above&&a.description.length>0&&i)})):""}},{key:"form_recaptcha",value:function(){return!0===this.state.recaptcha_data.success&&this.state.recaptcha_data.data.site_key&&!0===this.props.recaptcha?Object(r.createElement)(k,{sitekey:this.state.recaptcha_data.data.site_key,key:"easy-forms-recaptcha-1",elementID:"google-recaptcha-id-"+Math.random().toString(36).slice(-8),theme:this.props.recaptchaTheme,hl:this.props.recaptchaLang.length>0?this.props.recaptchaLang:this.state.recaptcha_data.data.locale,type:this.props.recaptchaType,size:this.props.recaptchaSize,verifyCallback:"",expiredCallback:""}):""}},{key:"submit_button",value:function(){return this.props.formData&&this.props.formData.fields?this.props.focus&&"text"===this.props.formData.form_settings["yikes-easy-mc-submit-button-type"]?Object(r.createElement)("button",{type:"submit",key:"mailchimpSubmitButton",className:"yikes-easy-mc-submit-button yikes-easy-mc-submit-button-"+this.props.formID+" btn btn-primary "+this.props.formData.form_settings["yikes-easy-mc-submit-button-classes"]},Object(r.createElement)(O,{className:"yikes-mailchimp-submit-button-span-text",key:"yikes-mailchimp-submit-button-span-text",value:this.props.submitButtonText?this.props.submitButtonText:"",onChange:this.props.toggleSubmitButtonText})):"text"===this.props.formData.form_settings["yikes-easy-mc-submit-button-type"]?Object(r.createElement)("button",{type:"submit",key:"mailchimpSubmitButton",className:"yikes-easy-mc-submit-button yikes-easy-mc-submit-button-"+this.props.formID+" btn btn-primary "+this.props.formData.form_settings["yikes-easy-mc-submit-button-classes"]},Object(r.createElement)("span",{className:"yikes-mailchimp-submit-button-span-text",key:"yikes-mailchimp-submit-button-span-text"},this.props.submitButtonText)):Object(r.createElement)("input",{type:"image",alt:this.props.submitButtonText,src:this.props.formData.form_settings["yikes-easy-mc-submit-button-image"],className:"yikes-easy-mc-submit-button yikes-easy-mc-submit-button-image yikes-easy-mc-submit-button-"+this.props.formID+" btn btn-primary "+this.props.formData.form_settings["yikes-easy-mc-submit-button-classes"]}):""}},{key:"get_form_section",value:function(){return Object(r.createElement)("section",{id:"yikes-mailchimp-container-"+this.props.formID,className:"yikes-mailchimp-container yikes-mailchimp-container-"+this.props.formID,key:"yikes-mailchimp-container-section"},[[this.form_title()],[this.form_description()],[this.get_form()]])}},{key:"get_form",value:function(){return Object(r.createElement)("form",{id:y(this.props.formTitle)+"-"+this.props.formID,className:"yikes-easy-mc-form yikes-easy-mc-form-"+this.props.formID+" "+this.props.formData.form_settings["yikes-easy-mc-form-class-names"],key:"yikes-mailchimp-container-form"},[[this.form_fields()],[this.form_recaptcha()],[this.submit_button()]])}},{key:"render",value:function(){return this.state.forms.length>0&&this.props.formData&&Object.keys(this.props.formData).length>0?Object(r.createElement)("div",{className:this.props.className},this.props.focus&&this.inspector_controls(),this.forms_dropdown(),Object(r.createElement)("hr",{key:"easy-forms-dropdown-divider"}),this.get_form_section()):this.state.forms.length>0?Object(r.createElement)("div",{className:this.props.className},this.forms_dropdown()):"valid"!==this.state.api_key_status?Object(r.createElement)("p",{className:"yikes-mailchimp-api-key-warning",key:"yikes-mailchimp-api-key-warning"},Object(r.createElement)("em",null,"empty"===this.state.api_key_status?Object(r.createElement)("a",{href:g.settings_url}," ",_("To use this block, please enter an API key on the Easy Forms' settings page.")," "):_("Your API key is invalid."))):!0===this.state.forms_loaded&&0===this.state.forms.length?Object(r.createElement)("p",{key:"no-forms-found",className:this.props.className},Object(r.createElement)("em",null,_("No forms were found."))):Object(r.createElement)("p",{key:"loading-easy-forms",className:this.props.className},Object(r.createElement)("span",{key:"yikes-easy-forms-loading-text"},_("Loading...")),Object(r.createElement)(E,{key:"yikes-easy-forms-loading-spinner"}))}}]),t}(wp.element.Component);a(12);a(13);var I=wp.i18n.__,M=wp.blocks.registerBlockType,D={title:I("Easy Forms for Mailchimp"),category:"easy-forms",icon:"email-alt",keywords:["mailchimp","easy forms for mailchimp","yikes"],attributes:{form_id:{type:"string",default:""},form:{type:"object"},form_description:{type:"string",default:""},show_description:{type:"boolean",default:!1},inline:{type:"boolean",default:!1},show_title:{type:"boolean",default:!1},form_title:{type:"string",default:""},is_ajax:{type:"boolean",default:!0},recaptcha:{type:"boolean",default:!1},recaptcha_theme:{type:"string",default:"light"},recaptcha_lang:{type:"string",default:""},recaptcha_type:{type:"string",default:"image"},recaptcha_size:{type:"string",default:"normal"},recaptcha_verify_callback:{type:"string",default:""},recaptcha_expired_callback:{type:"string",default:""},submit_button_text:{type:"string",default:""}},edit:function(e){var t=function(t){e.setAttributes({recaptcha:t})};return Object(r.createElement)(x,{className:e.className,onChangeForm:function(t){(e.setAttributes({form_id:t.target.value}),t.target.value.length>0)&&(new l).get_form(t.target.value).then((function(t){e.setAttributes({form:t.data}),e.setAttributes({form_description:t.data.form_description}),e.setAttributes({form_title:t.data.form_name}),e.setAttributes({is_ajax:"1"===t.data.submission_settings.ajax}),e.setAttributes({submit_button_text:t.data.form_settings["yikes-easy-mc-submit-button-text"]})}))},formID:e.attributes.form_id,formData:e.attributes.form,onChangeDescription:function(t){e.setAttributes({form_description:t})},descriptionValue:e.attributes.form_description,showDescription:e.attributes.show_description,toggleShowDescription:function(t){e.setAttributes({show_description:!!t.target.checked})},focus:!!e.isSelected,inline:e.attributes.inline,toggleInline:function(t){e.setAttributes({inline:!!t.target.checked})},formTitle:e.attributes.form_title,toggleFormTitle:function(t){e.setAttributes({form_title:t})},showTitle:e.attributes.show_title,toggleShowTitle:function(t){e.setAttributes({show_title:!!t.target.checked})},isAjax:e.attributes.is_ajax,toggleIsAjax:function(t){e.setAttributes({is_ajax:!!t.target.checked})},toggleRecaptchaAbstract:t,recaptcha:e.attributes.recaptcha,toggleRecaptcha:function(e){t(!!e.target.checked)},recaptchaTheme:e.attributes.recaptcha_theme,toggleRecaptchaTheme:function(t){e.setAttributes({recaptcha_theme:t})},recaptchaLang:e.attributes.recaptcha_lang,toggleRecaptchaLang:function(t){e.setAttributes({recaptcha_lang:t})},recaptchaType:e.attributes.recaptcha_type,toggleRecaptchaType:function(t){e.setAttributes({recaptcha_type:t})},recaptchaSize:e.attributes.recaptcha_size,toggleRecaptchaSize:function(t){e.setAttributes({recaptcha_size:t})},recaptchaVerifyCallback:e.attributes.recaptcha_verify_callback,toggleRecaptchaVerifyCallback:function(t){e.setAttributes({recaptcha_verify_callback:t})},recaptchaExpiredCallback:e.attributes.recaptcha_expired_callback,toggleRecaptchaExpiredCallback:function(t){e.setAttributes({recaptcha_expired_callback:t})},submitButtonText:e.attributes.submit_button_text,toggleSubmitButtonText:function(t){e.setAttributes({submit_button_text:t})}})},save:function(e){return null}};M(ez_forms_gb_data.block_namespace+ez_forms_gb_data.block_name,D,{category:"easy-forms"})}]);
blocks/easy-forms-block/build/easy-forms-blocks.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./blocks/easy-forms-block/css/easy-forms-block.scss?815c","webpack:///./blocks/easy-forms-block/src/components/api.js","webpack:///./blocks/easy-forms-block/src/components/class.MailchimpForms.js","webpack:///./blocks/easy-forms-block/src/components/constants.js","webpack:///./blocks/easy-forms-block/src/components/enable-submit-button-editing.js","webpack:///./blocks/easy-forms-block/src/components/slugify.js","webpack:///./blocks/easy-forms-block/src/easy-forms-block.js","webpack:///./blocks/easy-forms-block/src/index.js","webpack:///./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack:///./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack:///./node_modules/@babel/runtime/helpers/createClass.js","webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js","webpack:///./node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack:///./node_modules/@babel/runtime/helpers/inherits.js","webpack:///./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack:///./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack:///./node_modules/@babel/runtime/helpers/typeof.js","webpack:///./node_modules/react-recaptcha/dist/react-recaptcha.js","webpack:///external {\"this\":[\"wp\",\"element\"]}","webpack:///external {\"this\":\"React\"}"],"names":["EasyFormsAPI","ajaxurl","window","data","action","nonce","ez_forms_gb_data","get_api_key_status","status","jQuery","post","fetch_recaptcha_nonce","recaptcha_data","fetch_forms_nonce","forms","form_id","fetch_form_nonce","form","Recaptcha","require","__","wp","i18n","registerBlockType","blocks","editor","RichText","InspectorControls","PlainText","components","Spinner","TextControl","PanelBody","PanelRow","FormToggle","SelectControl","Component","element","MailchimpForms","props","arguments","state","api_key_status","success","api","address_fields","then","setState","get_forms","forms_loaded","get_recaptcha","toggleRecaptchaAbstract","event","inline","toggleInline","show_form_title","showTitle","toggleShowTitle","show_form_description","showDescription","toggleShowDescription","is_ajax","isAjax","toggleIsAjax","recaptcha","toggleRecaptcha","recaptcha_type","recaptchaType","value","label","toggleRecaptchaType","recaptcha_theme","recaptchaTheme","toggleRecaptchaTheme","recaptcha_lang","constants","locales","locale","recaptchaLang","length","toggleRecaptchaLang","Object","keys","map","key","recaptcha_size","recaptchaSize","toggleRecaptchaSize","recaptcha_verify_callback","recaptchaVerifyCallback","toggleRecaptchaVerifyCallback","recaptcha_expired_callback","recaptchaExpiredCallback","toggleRecaptchaExpiredCallback","inspector_controls","formID","onChangeForm","id","form_name","focus","formTitle","toggleFormTitle","descriptionValue","formData","form_description","onChangeDescription","addr_field","field","merge","handleFormFieldChanges","type","placeholder","states","choice","countries","JSON","parse","choices","default_choice","slugify","ii","parseInt","default","date_format","toLowerCase","cn","groups","group_id","indexOf","fields","desc","description","classes","description_above","hide","get_address_field","get_dropdown_field","get_radio_field","get_url_field","get_date_field","get_default_field","get_radio_interest_group","get_hidden_interest_group","get_checkboxes_interest_group","get_dropdown_interest_group","site_key","Math","random","toString","slice","form_settings","submitButtonText","toggleSubmitButtonText","form_title","get_form","form_fields","form_recaptcha","submit_button","className","forms_dropdown","get_form_section","settings_url","$","document","ready","on","preventDefault","stopPropagation","text","specialChars","replace","target","index","str","edit_easy_form","setAttributes","submission_settings","ajax","submit_button_text","show_description","checked","show_title","attributes","isSelected","save_easy_form","settings","title","category","icon","keywords","edit","save","EasyFormsBlock","block_namespace","block_name"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA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J,CAAC,kBAAkB,mBAAmB,cAAc,4BAA4B,YAAY,UAAU,iBAAiB,gEAAgE,SAAS,+BAA+B,kBAAkB,aAAa,cAAc,0BAA0B,WAAW,gBAAgB,8EAA8E,gBAAgB,4FAA4F,uDAAuD,gBAAgB,2HAA2H,0CAA0C,aAAa,mDAAmD,sEAAsE,sCAAsC,SAAS,EAAE,iBAAiB,gBAAgB,YAAY,WAAW,KAAK,WAAW,+GAA+G,uBAAuB,wCAAwC,kCAAkC,qiBAAqiB,IAAI,mUAAmU,cAAc,qHAAqH,wBAAwB,cAAc,UAAU,mEAAmE,wFAAwF,sBAAsB,+FAA+F,oBAAoB,yCAAyC,4CAA4C,EAAE,6CAA6C,+CAA+C,yEAAyE,EAAE,4CAA4C,kBAAkB,EAAE,6BAA6B,sCAAsC,kCAAkC,EAAE,+BAA+B,sCAAsC,oCAAoC,EAAE,yCAAyC,qBAAqB,SAAS,qBAAqB,EAAE,yCAAyC,0DAA0D,qTAAqT,0DAA0D,EAAE,8BAA8B,+FAA+F,wIAAwI,iCAAiC,iPAAiP,GAAG,KAAK,cAAc,+DAA+D,eAAe,aAAa,cAAc,kBAAkB,UAAU,mBAAmB,wHAAwH,YAAY,mCAAmC,SAAS,aAAa,iBAAiB,aAAa,4BAA4B,YAAY,MAAM,uDAAuD,oGAAoG,KAAK,wBAAwB,uCAAuC,cAAc,gCAAgC,yBAAyB,oBAAoB,YAAY,iBAAiB,aAAa,yBAAyB,qBAAqB,wBAAwB,+LAA+L,aAAa,SAAS,eAAe,OAAO,gJAAgJ,2CAA2C,iBAAiB,iBAAiB,eAAe,aAAa,qDAAqD,YAAY,eAAe,YAAY,GAAG,E;;;;;;;;;;;ACAnvL,aAAa,wCAAwC,EAAE,I;;;;;;;;;;;ACAvD,aAAa,gCAAgC,EAAE,I","file":"easy-forms-blocks.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./blocks/easy-forms-block/src/index.js\");\n","// extracted by mini-css-extract-plugin","export default class EasyFormsAPI {\n\n\tconstructor() {\n\t\tthis.ajaxurl = window.ajaxurl;\n\t}\n\n\tget_api_key_status() {\n\t\tlet data = {\n\t\t\taction: 'yikes_get_api_key_status',\n\t\t\tnonce: ez_forms_gb_data.get_api_key_status,\n\t\t}\n\n\t\tlet status = jQuery.post( this.ajaxurl, data );\n\n\t\treturn status;\n\t}\n\n\tget_recaptcha() {\n\t\tlet data = {\n\t\t\taction: 'yikes_get_recaptcha',\n\t\t\tnonce: ez_forms_gb_data.fetch_recaptcha_nonce\n\t\t}\n\n\t\tlet recaptcha_data = jQuery.post( this.ajaxurl, data );\n\n\t\treturn recaptcha_data;\n\t}\n\n\tget_forms() {\n\t\tlet data = {\n\t\t\taction: 'yikes_get_forms',\n\t\t\tnonce: ez_forms_gb_data.fetch_forms_nonce,\n\t\t}\n\n\t\tlet forms = jQuery.post( this.ajaxurl, data );\n\n\t\treturn forms;\n\t}\n\n\tget_form( form_id ) {\n\t\tlet data = {\n\t\t\taction: 'yikes_get_form',\n\t\t\tform_id: form_id,\n\t\t\tnonce: ez_forms_gb_data.fetch_form_nonce\n\t\t}\n\n\t\tlet form = jQuery.post( this.ajaxurl, data );\n\n\t\treturn form;\n\t}\n}\n","// Import dependencies\nimport slugify from './slugify.js';\nimport constants from './constants.js';\nimport EasyFormsAPI from './api.js';\n\n// Get functions / blocks / components\nconst Recaptcha = require( 'react-recaptcha' );\nconst { __ } = wp.i18n;\nconst { registerBlockType } = wp.blocks;\nconst { RichText, InspectorControls, PlainText } = wp.editor;\nconst { Spinner, TextControl, PanelBody, PanelRow, FormToggle, SelectControl } = wp.components;\nconst { Component } = wp.element;\n\nexport default class MailchimpForms extends Component {\n constructor( props ) {\n super( ...arguments );\n this.state = {\n api_key_status: 'valid',\n forms : [],\n recaptcha_data: {\n data : {},\n success: false\n },\n 'forms_loaded': false\n }\n \n this.api = new EasyFormsAPI();\n\n this.address_fields = {\n 'addr1' : 'Address 1', \n 'addr2' : 'Address 2', \n 'city' : 'City', \n 'state' : 'State', \n 'zip' : 'Zip',\n 'country': 'Country'\n }\n }\n\n /**\n * Run our API calls after the component has mounted. You can't use setState before a component is mounted.\n */\n componentDidMount() {\n this.api.get_api_key_status().then( status => {\n this.setState( { api_key_status: status.data } );\n });\n\n this.api.get_forms().then( forms => {\n this.setState( { forms: forms.data, forms_loaded: true } );\n });\n\n this.api.get_recaptcha().then( recaptcha_data => {\n this.setState( { recaptcha_data: recaptcha_data } );\n this.props.toggleRecaptchaAbstract( this.state.recaptcha_data.success );\n });\n }\n\n handleFormFieldChanges( event ) {\n \t// console.log( event );\n \t\n \t// console.log( value );\n \t// console.log( this );\n \t// console.log( typeof this.setState );\n\n \t// const target = event.target;\n // const value = target.type === 'checkbox' ? target.checked : target.value;\n // const name = target.name;\n\n // return this.setState( { [name]: value } );\n }\n\n inspector_controls() {\n\n const inline = (\n <PanelRow>\n <label\n htmlFor=\"inline-form-toggle\"\n className=\"blocks-base-control__label\"\n >\n { __( 'Inline' ) }\n </label>\n <FormToggle\n id=\"inline-form-toggle\"\n label={ __( 'Inline' ) }\n checked={ !! this.props.inline }\n onChange={ this.props.toggleInline }\n />\n </PanelRow>\n )\n\n const show_form_title = (\n <PanelRow>\n <label\n htmlFor=\"show-title-form-toggle\"\n className=\"blocks-base-control__label\"\n >\n { __( 'Show Form Title' ) }\n </label>\n <FormToggle\n id=\"show-title-form-toggle\"\n label={ __( 'Show Form Title' ) }\n checked={ !! this.props.showTitle }\n onChange={ this.props.toggleShowTitle }\n />\n </PanelRow>\n )\n\n const show_form_description = (\n <PanelRow>\n <label\n htmlFor=\"show-description-form-toggle\"\n className=\"blocks-base-control__label\"\n >\n { __( 'Show Form Description' ) }\n </label>\n <FormToggle\n id=\"show-description-form-toggle\"\n label={ __( 'Show Form Description' ) }\n checked={ !! this.props.showDescription }\n onChange={ this.props.toggleShowDescription }\n />\n </PanelRow>\n )\n\n const is_ajax = (\n <PanelRow>\n <label\n htmlFor=\"is-ajax-form-toggle\"\n className=\"blocks-base-control__label\"\n >\n { __( 'AJAX Submissions' ) }\n </label>\n <FormToggle\n id=\"is-ajax-form-toggle\"\n label={ __( 'AJAX' ) }\n checked={ !! this.props.isAjax }\n onChange={ this.props.toggleIsAjax }\n />\n </PanelRow>\n )\n\n const recaptcha = (\n <PanelRow>\n <label\n htmlFor=\"recaptcha-form-toggle\"\n className=\"blocks-base-control__label\"\n >\n { __( 'reCAPTCHA' ) }\n </label>\n <FormToggle\n id=\"recaptcha-form-toggle\"\n label={ __( 'reCAPTCHA' ) }\n checked={ !! this.props.recaptcha }\n onChange={ this.props.toggleRecaptcha }\n />\n </PanelRow>\n )\n\n const recaptcha_type = !! this.props.recaptcha ?\n (\n <PanelRow>\n <label\n htmlFor=\"recaptcha-type-form-toggle\"\n className=\"blocks-base-control__label\"\n >\n { __( 'reCAPTCHA Type' ) }\n </label>\n <SelectControl\n value={ this.props.recaptchaType }\n options={ [ { value: 'image', label: 'Image' }, { value: 'audio', 'label': 'Audio' } ] }\n onChange={ this.props.toggleRecaptchaType }\n />\n </PanelRow>\n )\n : '';\n\n const recaptcha_theme = !! this.props.recaptcha ?\n (\n <PanelRow>\n <label\n htmlFor=\"recaptcha-theme-form-toggle\"\n className=\"blocks-base-control__label\"\n >\n { __( 'reCAPTCHA Theme' ) }\n </label>\n <SelectControl\n value={ this.props.recaptchaTheme }\n options={ [ { value: 'light', label: 'Light' }, {value: 'dark', 'label': 'Dark' } ] }\n onChange={ this.props.toggleRecaptchaTheme }\n />\n </PanelRow>\n )\n : '';\n\n const recaptcha_lang = !! this.props.recaptcha ?\n (\n <PanelRow>\n <label\n htmlFor=\"recaptcha-language-form-toggle\"\n className=\"blocks-base-control__label\"\n title={ this.state.recaptcha_data.data ? 'The default language for your locale is ' + constants.locales[ this.state.recaptcha_data.data.locale ] : '' }\n >\n { __( 'reCAPTCHA Language' ) }\n </label>\n <SelectControl\n id=\"recaptcha-language-form-toggle\"\n value={ this.props.recaptchaLang.length > 0 ? this.props.recaptchaLang : ( this.state.recaptcha_data.data ? this.state.recaptcha_data.data.locale : '' ) }\n onChange={ this.props.toggleRecaptchaLang }\n title={ this.state.recaptcha_data.data ? 'The default language for your locale is ' + constants.locales[ this.state.recaptcha_data.data.locale ] : '' }\n options={ Object.keys( constants.locales ).map( ( key ) => { return { value: key, label: constants.locales[key] } }) }\n />\n </PanelRow>\n )\n : '';\n\n const recaptcha_size = !! this.props.recaptcha ?\n (\n <PanelRow>\n <label\n htmlFor=\"recaptcha-size-form-toggle\"\n className=\"blocks-base-control__label\"\n >\n { __( 'reCAPTCHA Size' ) }\n </label>\n <SelectControl\n id=\"recaptcha-size-form-toggle\"\n value={ this.props.recaptchaSize }\n onChange={ this.props.toggleRecaptchaSize }\n options={ [ { value: 'normal', label: 'Normal' }, { value: 'compact', label: 'Compact' } ] }\n />\n </PanelRow>\n )\n : '';\n\n const recaptcha_verify_callback = !! this.props.recaptcha ?\n (\n <TextControl\n id=\"recaptcha-verify-callback-form-toggle\"\n label={ __( 'reCAPTCHA Verify Callback' ) }\n value={ this.props.recaptchaVerifyCallback }\n onChange={ this.props.toggleRecaptchaVerifyCallback }\n />\n )\n : '';\n\n const recaptcha_expired_callback = !! this.props.recaptcha ?\n (\n <TextControl\n id=\"recaptcha-expired-callback-form-toggle\"\n label={ __( 'reCAPTCHA Expired Callback' ) }\n value={ this.props.recaptchaExpiredCallback }\n onChange={ this.props.toggleRecaptchaExpiredCallback }\n />\n )\n : '';\n\n const inspector_controls = \n <InspectorControls key=\"easy-forms-inspector\">\n\n <PanelBody title={ __( 'Settings' ) } >\n {inline}\n {show_form_title}\n {show_form_description}\n {is_ajax}\n {recaptcha}\n {recaptcha_type}\n {recaptcha_theme}\n {recaptcha_lang}\n {recaptcha_size}\n {recaptcha_verify_callback}\n {recaptcha_expired_callback}\n </PanelBody>\n\n </InspectorControls>\n\n return inspector_controls;\n }\n\n forms_dropdown() {\n return this.state.forms.length > 0 ? \n <select \n value={ this.props.formID } \n onChange={ this.props.onChangeForm } \n className=\"yikes-mailchimp-forms-dropdown\"\n key=\"yikes-mailchimp-forms-dropdown\"\n >\n <option key=\"select\" value=\"\">Select Mailchimp Form...</option>\n { this.state.forms.map( ( form ) => {\n return <option key={ 'yikes-select-form-' + form.id } value={ form.id }>{ form.form_name }</option>\n })}\n </select> \n : '';\n }\n\n form_title() {\n return this.props.showTitle === true ?\n ( this.props.focus ? \n <h3 \n className={ \"yikes-mailchimp-form-title yikes-mailchimp-form-title-\" + this.props.formID }\n key=\"yikes-mailchimp-form-title-wrapper\"\n >\n <PlainText\n placeholder={ this.props.formTitle }\n key=\"yikes-mailchimp-form-title-editable\"\n value={ this.props.formTitle }\n onChange={ this.props.toggleFormTitle }\n />\n </h3>\n :\n <h3 className={ \"yikes-mailchimp-form-title yikes-mailchimp-form-title-\" + this.props.formID } key=\"yikes-mailchimp-form-title\">\n { this.props.formTitle }\n </h3> \n ) : ''; \n }\n\n form_description() {\n return this.props.showDescription === true ?\n <section className={ \"yikes-mailchimp-form-description yikes-mailchimp-form-description-\" + this.props.formID } key=\"yikes-mailchimp-form-description\">\n <PlainText\n className=\"mailchimpDescription\"\n placeholder={ __( 'Enter your form\\'s description here.' ) /*( this.props.formData && this.props.formData.form_description && this.props.formData.form_description.length > 0 || this.props.descriptionValue && this.props.descriptionValue.length > 0 ) ? '' : __( 'Enter your form\\'s description here.' )*/ }\n value={ this.props.descriptionValue.length > 0 ? this.props.descriptionValue : ( this.props.formData && this.props.formData.form_description ? this.props.formData.form_description : '' ) }\n onChange={ this.props.onChangeDescription }\n key=\"mailchimpDescription\"\n />\n </section> \n : ''; \n }\n\n get_address_field( addr_field, field ) {\n switch( addr_field ) {\n\n case 'addr1':\n case 'addr2':\n case 'city':\n case 'zip':\n return (\n <TextControl\n id={ \"yikes-easy-mc-form-\" + this.props.formID + \"-\" + field.merge + '-' + addr_field }\n onChange={ this.handleFormFieldChanges }\n type=\"text\"\n name={ field.merge + '[' + addr_field + ']' }\n className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }\n key= { 'yikes-mailchimp-field-' + field.merge + '-' + addr_field }\n required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }\n placeholder={ field.placeholder === '1' ? this.address_fields[ addr_field ] : '' }\n />\n )\n break;\n\n case 'state':\n return (\n <select \n id={ \"yikes-easy-mc-form-\" + this.props.formID + \"-\" + field.merge + '-' + addr_field } \n name={ field.merge + '[' + addr_field + ']' }\n className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }\n onChange={ this.handleFormFieldChanges }\n key= { 'yikes-mailchimp-field-' + field.merge + '-' + addr_field }\n value=''\n required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }\n >\n { Object.keys( constants.states ).map( ( key ) => {\n var choice = constants.states[ key ];\n return <option key={ 'state-' + key } value={ key }>{ choice }</option>\n })}\n \n </select>\n )\n break;\n\n case 'country':\n return (\n <select \n id={ \"yikes-easy-mc-form-\" + this.props.formID + \"-\" + field.merge + '-' + addr_field } \n name={ field.merge + '[' + addr_field + ']' }\n className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }\n onChange={ this.handleFormFieldChanges }\n key= { 'yikes-mailchimp-field-' + field.merge + '-' + addr_field }\n value=''\n required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }\n >\n { Object.keys( constants.countries ).map( ( key ) => {\n var choice = constants.countries[ key ];\n return <option key={ 'country-' + key } value={ key }>{ choice }</option>\n })}\n \n </select>\n )\n break;\n }\n }\n\n get_dropdown_field( field ) {\n return (\n <select \n id={ \"yikes-easy-mc-form-\" + this.props.formID + \"-\" + field.merge }\n name={ field.merge }\n className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }\n onChange={ this.handleFormFieldChanges }\n key= { 'yikes-mailchimp-field-' + field.merge }\n value={ JSON.parse( field.choices )[ field.default_choice ] }\n required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }\n >\n { Object.keys( JSON.parse( field.choices ) ).map( ( key ) => {\n var choice = JSON.parse( field.choices )[ key ];\n return <option key={ slugify( choice ) } value={ choice }>{ choice }</option>\n })}\n </select>\n )\n }\n\n get_radio_field( field ) {\n var ii = 0;\n\n return (\n JSON.parse( field.choices ).map( ( key ) => {\n ii++;\n return (\n <label \n htmlFor={ field.merge + '-' + ii }\n className=\"yikes-easy-mc-checkbox-label\"\n key={ field.merge + '-label-radio-key-' + ii }\n >\n <input\n type=\"radio\"\n name={ field.merge }\n id={ field.merge + '-' + ii }\n key={ field.merge + '-' + ii + '-input-key' }\n value={ key }\n onChange={ this.handleFormFieldChanges }\n checked={ parseInt( field.default_choice ) === ( ii - 1 ) }\n />\n <span key={ field.merge + '-span-radio-key-' + ii } className={ field.merge + '-label' }>{ key }</span>\n </label>\n )\n })\n )\n }\n\n get_url_field( field ) {\n return (\n <TextControl\n id={ \"yikes-easy-mc-form-\" + this.props.formID + \"-\" + field.merge }\n placeholder={ field.placeholder }\n onChange={ this.handleFormFieldChanges }\n type='url'\n value={ field.default }\n name={ field.merge }\n className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }\n key= { 'yikes-mailchimp-field-' + field.merge }\n required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }\n title={ field.type === 'url' ? __( 'Please enter a valid URL to the website.' ) : __( 'Please enter a valid URL to the image.' ) }\n />\n )\n }\n\n get_default_field( field ) {\n\n var type = field.type === 'zip' || field.type === 'phone' ? 'text' : field.type;\n\n return (\n <TextControl\n id={ \"yikes-easy-mc-form-\" + this.props.formID + \"-\" + field.merge }\n placeholder={ field.placeholder }\n onChange={ this.handleFormFieldChanges }\n type={ type }\n value={ field.default }\n name={ field.merge }\n className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }\n key= { 'yikes-mailchimp-field-' + field.merge }\n required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }\n />\n )\n }\n\n get_date_field( field ) {\n return (\n <TextControl\n id={ \"yikes-easy-mc-form-\" + this.props.formID + \"-\" + field.merge }\n placeholder={ field.placeholder }\n onChange={ this.handleFormFieldChanges }\n type='text'\n value={ field.default }\n name={ field.merge }\n className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }\n key= { 'yikes-mailchimp-field-' + field.merge }\n required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }\n data-attr-type={ field.type }\n data-date-format={ field.date_format.toLowerCase() }\n />\n )\n }\n\n get_radio_interest_group( field ) {\n var ii = -1;\n var cn = \"yikes-easy-mc-checkbox-label \" + field['additional-classes'];\n\n return (\n Object.keys( JSON.parse( field.groups ) ).map( ( key ) => {\n var choice = JSON.parse( field.groups )[ key ];\n ii++;\n return (\n <label\n htmlFor={ field.group_id + '-' + ii }\n className={ { [cn]: true, 'field-no-label': field['hide-label'] === '1' } }\n key={ field.group_id + '-' + ii + '-label-key' }\n >\n <input\n type=\"radio\"\n name={\"group-\" + field.group_id + '[]' }\n id={ field.group_id + '-' + ii }\n key={ field.group_id + '-' + ii + '-input-key' }\n value={ key }\n onChange={ this.handleFormFieldChanges }\n checked={ key === field.default_choice }\n className={ { 'yikes-interest-group-required': field.require === '1' } }\n />\n { choice }\n </label>\n )\n })\n )\n }\n\n get_hidden_interest_group( field ) {\n var ii = -1;\n\n return (\n Object.keys( JSON.parse( field.groups ) ).map( ( key ) => {\n var choice = JSON.parse( field.groups )[ key ];\n ii++;\n return (\n <label\n htmlFor={ field.group_id + '-' + ii }\n className={ 'yikes-easy-mc-checkbox-label ' + field['additional-classes'] }\n key={ field.group_id + '-' + ii + '-label-key' }\n >\n <input\n type=\"checkbox\"\n name={\"group-\" + field.group_id + '[]' }\n id={ field.group_id + '-' + ii }\n key={ field.group_id + '-' + ii + '-input-key' }\n value={ key }\n onChange={ this.handleFormFieldChanges }\n checked={ field.default_choice && field.default_choice.indexOf( key ) !== -1 }\n />\n { choice }\n </label>\n )\n })\n )\n }\n\n get_checkboxes_interest_group( field ) {\n var ii = -1;\n var cn = 'yikes-easy-mc-checkbox-label ' + field['additional-classes'];\n\n return (\n Object.keys( JSON.parse( field.groups ) ).map( ( key ) => {\n var choice = JSON.parse( field.groups )[ key ];\n ii++;\n return (\n <label\n htmlFor={ field.group_id + '-' + ii }\n className={ { [cn]: true, 'field-no-label': field['hide-label'] === '1' } }\n key={ field.group_id + '-' + ii + '-label-key' }\n >\n <input\n className={ { 'yikes-interest-group-required': field.require === '1' } }\n type=\"checkbox\"\n name={ 'group-' + field.group_id + '[]' }\n id={ field.group_id + '-' + ii }\n key={ field.group_id + '-' + ii + '-input-key' }\n value={ key }\n onChange={ this.handleFormFieldChanges }\n checked={ typeof field.default_choice !== 'undefined' && field.default_choice.indexOf( key ) !== -1 }\n required={ field.require === '1' ? 'required' : false }\n />\n { choice }\n </label>\n )\n })\n )\n }\n\n get_dropdown_interest_group( field ) {\n var ii = -1;\n\n return (\n <select \n id={ \"yikes-easy-mc-form-\" + this.props.formID + \"-\" + field.group_id } \n name={ \"group-\" + field.group_id }\n className={ \"yikes-easy-mc-dropdown \" + field['additional-classes'] }\n value={ field.default_choice }\n onChange={ this.handleFormFieldChanges }\n required={ field.require === '1' ? 'required' : false }\n >\n\n { Object.keys( JSON.parse( field.groups ) ).map( ( key ) => {\n var choice = JSON.parse( field.groups )[ key ];\n ii++;\n return (\n <option key={ field.group_id + '-' + ii + '-input-key' } value={ key }>{ choice }</option>\n )\n })}\n </select>\n )\n }\n\n form_fields() {\n\n return this.props.formData && this.props.formData.fields ?\n Object.keys( this.props.formData.fields ).map( ( key ) => {\n\n var field = this.props.formData.fields[ key ];\n\n // Form Fields (aka merge variables)\n if ( typeof field.merge !== 'undefined' ) {\n\n var desc = field.description.length > 0 ? \n <p className=\"form-field-description\" id={ \"form-field-description-\" + field.merge } key={ \"form-field-description-\" + field.merge }>{ field.description }</p>\n : '';\n\n var label = field['hide-label'] !== '1' ? <span className={ field.merge + '-label' } key={ field.merge + '-label-span-key' }>{ field.label }</span> : '';\n\n var classes = {'yikes-mailchimp-field-required' : field.merge === 'EMAIL' || field.require === '1' }\n classes[ field.merge + '-label'] = true;\n\n if ( field.type === 'address' ) {\n\n return ([\n field.description_above === '1' && field.description.length > 0 && desc,\n Object.keys( this.address_fields ).map( ( addr_field ) => {\n label = field['hide-label'] !== '1' ? <span className={ field.merge + '-label' } key={ field.merge + '-label-span-key-' + addr_field }>{ this.address_fields[ addr_field ] }</span> : '';\n\n return (\n <label \n htmlFor={ \"yikes-easy-mc-form-\" + this.props.formID + \"-\" + field.merge + '-' + addr_field } \n className={ classes } \n key={ field.merge + '-label-key-' + addr_field }\n style={ field.hide === '1' ? { 'display': 'none' } : {} }\n >\n { label }\n { this.get_address_field( addr_field, field ) }\n </label> \n )\n }),\n field.description_above !== '1' && field.description.length > 0 && desc\n ])\n } else {\n return (\n <label \n htmlFor={ \"yikes-easy-mc-form-\" + this.props.formID + \"-\" + field.merge } \n className={ classes } \n key={ field.merge + '-label-key' }\n style={ field.hide === '1' ? { 'display': 'none' } : {} }\n >\n { label }\n\n { field.description_above === '1' && field.description.length > 0 && desc }\n\n { \n ( field.type === 'dropdown' ? this.get_dropdown_field( field ) :\n ( field.type === 'radio' ? this.get_radio_field( field ) : \n ( field.type === 'url' || field.type === 'imageurl' ? this.get_url_field( field ) :\n ( field.type === 'date' || field.type === 'birthday' ? this.get_date_field( field ) :\n this.get_default_field( field ) ) ) ) )\n }\n\n { field.description_above !== '1' && field.description.length > 0 && desc }\n\n </label>\n )\n }\n } else {\n\n var desc = field.description.length > 0 ? \n <p className=\"form-field-description\" id={ \"form-field-description-\" + field.group_id } key={ \"form-field-description-\" + field.group_id }>{ field.description }</p>\n : '';\n\n var label = field['hide-label'] !== '1' ?\n <span key={ field.group_id + \"-label-span-key\" } className={ field.group_id + \"-label checkbox-parent-label\" }>{ field.label }</span> \n : '';\n\n var classes = { 'yikes-mailchimp-field-required' : field.require === '1' }\n classes[ field.group_id + '-label'] = true;\n\n return ( \n <label \n htmlFor={ field.group_id }\n className= { classes }\n key={ field.group_id + \"-label-span-key\" }\n style={ field.type === 'hidden' || field.hide === '1' ? { 'display': 'none' } : {} }\n >\n\n { label }\n\n { field.description_above === '1' && field.description.length > 0 && desc }\n\n {\n ( field.type === 'radio' ? this.get_radio_interest_group( field ) :\n ( field.type === 'hidden' ? this.get_hidden_interest_group( field ) : \n ( field.type === 'checkboxes' ? this.get_checkboxes_interest_group( field ) :\n ( field.type === 'dropdown' ? this.get_dropdown_interest_group( field ) : '' ) ) ) )\n }\n\n { field.description_above !== '1' && field.description.length > 0 && desc }\n\n </label>\n )\n }\n })\n : '';\n }\n\n form_recaptcha() {\n\n return this.state.recaptcha_data.success === true && this.state.recaptcha_data.data.site_key && this.props.recaptcha === true ? \n <Recaptcha\n sitekey={ this.state.recaptcha_data.data.site_key }\n key={ 'easy-forms-recaptcha-1' }\n elementID={ 'google-recaptcha-id-' + Math.random().toString(36).slice(-8) } // Need to use a unique ID for multiple reCAPTCHAs to work on the same page.\n theme={ this.props.recaptchaTheme }\n hl={ this.props.recaptchaLang.length > 0 ? this.props.recaptchaLang : this.state.recaptcha_data.data.locale }\n type={ this.props.recaptchaType }\n size={ this.props.recaptchaSize }\n verifyCallback=''\n expiredCallback=''\n />\n : ''; \n }\n\n submit_button() {\n return this.props.formData && this.props.formData.fields ?\n ( this.props.focus && this.props.formData.form_settings['yikes-easy-mc-submit-button-type'] === 'text' ?\n <button\n type=\"submit\"\n key=\"mailchimpSubmitButton\"\n className={ \"yikes-easy-mc-submit-button yikes-easy-mc-submit-button-\" + this.props.formID + \" btn btn-primary\" + \" \" + this.props.formData.form_settings['yikes-easy-mc-submit-button-classes'] }\n >\n <PlainText\n className=\"yikes-mailchimp-submit-button-span-text\"\n key=\"yikes-mailchimp-submit-button-span-text\"\n value={ this.props.submitButtonText ? this.props.submitButtonText : '' }\n onChange={ this.props.toggleSubmitButtonText }\n />\n </button>\n :\n ( this.props.formData.form_settings['yikes-easy-mc-submit-button-type'] === 'text' ? \n <button\n type=\"submit\"\n key=\"mailchimpSubmitButton\"\n className={ \"yikes-easy-mc-submit-button yikes-easy-mc-submit-button-\" + this.props.formID + \" btn btn-primary\" + \" \" + this.props.formData.form_settings['yikes-easy-mc-submit-button-classes'] }\n >\n <span className=\"yikes-mailchimp-submit-button-span-text\" key=\"yikes-mailchimp-submit-button-span-text\">{ this.props.submitButtonText }</span>\n </button>\n :\n <input\n type=\"image\"\n alt={ this.props.submitButtonText }\n src={ this.props.formData.form_settings['yikes-easy-mc-submit-button-image'] }\n className={ \"yikes-easy-mc-submit-button yikes-easy-mc-submit-button-image yikes-easy-mc-submit-button-\" + this.props.formID + \" btn btn-primary\" + \" \" + this.props.formData.form_settings['yikes-easy-mc-submit-button-classes'] }\n />\n )\n )\n : '';\n }\n\n get_form_section() {\n return (\n <section \n id={ \"yikes-mailchimp-container-\" + this.props.formID } \n className={ \"yikes-mailchimp-container yikes-mailchimp-container-\" + this.props.formID }\n key=\"yikes-mailchimp-container-section\"\n >\n {[\n\n // Form title\n [this.form_title()],\n\n // Form Description\n [this.form_description()],\n\n // Get the form\n [this.get_form()] \n ]}\n </section>\n );\n }\n\n get_form() {\n return (\n // Form Wrapper\n <form\n id={ slugify( this.props.formTitle ) + '-' + this.props.formID }\n className={ \"yikes-easy-mc-form yikes-easy-mc-form-\" + this.props.formID + \" \" + this.props.formData.form_settings['yikes-easy-mc-form-class-names'] }\n key=\"yikes-mailchimp-container-form\"\n >\n {[\n\n // Form fields\n [this.form_fields()],\n\n // Recaptcha\n [this.form_recaptcha()],\n\n // Submit button\n [this.submit_button()]\n ]}\n </form>\n );\n }\n\n render() {\n\n if ( this.state.forms.length > 0 && this.props.formData && Object.keys( this.props.formData ).length > 0 ) {\n\n \t return (\n\n <div className={ this.props.className }>\n\n {// Show inspector controls when focused\n this.props.focus && this.inspector_controls()}\n\n {// Show the forms dropdown\n this.forms_dropdown()}\n\n <hr key=\"easy-forms-dropdown-divider\"/>\n\n {// Show the form\n this.get_form_section()}\n </div>\n \n \t );\n\n \t} else if ( this.state.forms.length > 0 ) {\n\n // If we don't have form data, show the forms dropdown\n \t\treturn ( \n <div className={ this.props.className }>\n {this.forms_dropdown()}\n </div>\n );\n\n \t} else if ( this.state.api_key_status !== 'valid' ) {\n\n // If the API key is invalid, show a message.\n return ( \n <p className=\"yikes-mailchimp-api-key-warning\" key=\"yikes-mailchimp-api-key-warning\">\n <em>{ this.state.api_key_status === 'empty' ? <a href={ constants.settings_url }> { __( 'To use this block, please enter an API key on the Easy Forms\\' settings page.' ) } </a> : __( 'Your API key is invalid.' ) }</em>\n </p>\n );\n } else if ( this.state.forms_loaded === true && this.state.forms.length === 0 ) {\n\n // No forms.\n return (\n <p key=\"no-forms-found\" className={ this.props.className }>\n <em>{ __( 'No forms were found.' ) }</em>\n </p>\n );\n } else {\n\n // Show loading... & spinner.\n \t\treturn (\n <p key=\"loading-easy-forms\" className={ this.props.className }>\n <span key=\"yikes-easy-forms-loading-text\">{ __( 'Loading...' ) }</span>\n <Spinner key=\"yikes-easy-forms-loading-spinner\" />\n </p>\n );\n \t}\n }\n}","const constants = {\n\tstates: {\n\t\t'': '—',\n\t\t'AL': 'Alabama',\n\t\t'AK': 'Alaska',\n\t\t'AZ': 'Arizona',\n\t\t'AR': 'Arkansas',\n\t\t'CA': 'California',\n\t\t'CO': 'Colorado',\n\t\t'CT': 'Connecticut',\n\t\t'DE': 'Delaware',\n\t\t'DC': 'District Of Columbia',\n\t\t'FL': 'Florida',\n\t\t'GA': 'Georgia',\n\t\t'HI': 'Hawaii',\n\t\t'ID': 'Idaho',\n\t\t'IL': 'Illinois',\n\t\t'IN': 'Indiana',\n\t\t'IA': 'Iowa',\n\t\t'KS': 'Kansas',\n\t\t'KY': 'Kentucky',\n\t\t'LA': 'Louisiana',\n\t\t'ME': 'Maine',\n\t\t'MD': 'Maryland',\n\t\t'MA': 'Massachusetts',\n\t\t'MI': 'Michigan',\n\t\t'MN': 'Minnesota',\n\t\t'MS': 'Mississippi',\n\t\t'MO': 'Missouri',\n\t\t'MT': 'Montana',\n\t\t'NE': 'Nebraska',\n\t\t'NV': 'Nevada',\n\t\t'NH': 'New Hampshire',\n\t\t'NJ': 'New Jersey',\n\t\t'NM': 'New Mexico',\n\t\t'NY': 'New York',\n\t\t'NC': 'North Carolina',\n\t\t'ND': 'North Dakota',\n\t\t'OH': 'Ohio',\n\t\t'OK': 'Oklahoma',\n\t\t'OR': 'Oregon',\n\t\t'PA': 'Pennsylvania',\n\t\t'RI': 'Rhode Island',\n\t\t'SC': 'South Carolina',\n\t\t'SD': 'South Dakota',\n\t\t'TN': 'Tennessee',\n\t\t'TX': 'Texas',\n\t\t'UT': 'Utah',\n\t\t'VT': 'Vermont',\n\t\t'VA': 'Virginia',\n\t\t'WA': 'Washington',\n\t\t'WV': 'West Virginia',\n\t\t'WI': 'Wisconsin',\n\t\t'WY': 'Wyoming',\n\t\t'AB': 'Alberta',\n\t\t'BC': 'British Columbia',\n\t\t'MB': 'Manitoba',\n\t\t'NB': 'New Brunswick',\n\t\t'NL': 'Newfoundland and Labrador',\n\t\t'NS': 'Nova Scotia',\n\t\t'ON': 'Ontario',\n\t\t'PE': 'Prince Edward Island',\n\t\t'QC': 'Quebec',\n\t\t'SK': 'Saskatchewan',\n\t\t'NT': 'Northwest Territories',\n\t\t'NU': 'Nunavut',\n\t\t'YT': 'Yukon',\n\t},\n\tcountries: {\n\t\t'US': 'United States',\n\t\t'GB': 'United Kingdom',\n\t\t'AF': 'Afghanistan',\n\t\t'AX': 'Aland Islands',\n\t\t'AL': 'Albania',\n\t\t'DZ': 'Algeria',\n\t\t'AS': 'American Samoa',\n\t\t'AD': 'Andorra',\n\t\t'AO': 'Angola',\n\t\t'AI': 'Anguilla',\n\t\t'AQ': 'Antarctica',\n\t\t'AG': 'Antigua and Barbuda',\n\t\t'AR': 'Argentina',\n\t\t'AM': 'Armenia',\n\t\t'AW': 'Aruba',\n\t\t'AU': 'Australia',\n\t\t'AT': 'Austria',\n\t\t'AZ': 'Azerbaijan',\n\t\t'BS': 'Bahamas',\n\t\t'BH': 'Bahrain',\n\t\t'BD': 'Bangladesh',\n\t\t'BB': 'Barbados',\n\t\t'BY': 'Belarus',\n\t\t'BE': 'Belgium',\n\t\t'BZ': 'Belize',\n\t\t'BJ': 'Benin',\n\t\t'BM': 'Bermuda',\n\t\t'BT': 'Bhutan',\n\t\t'BO': 'Bolivia',\n\t\t'BA': 'Bosnia and Herzegovina',\n\t\t'BW': 'Botswana',\n\t\t'BV': 'Bouvet Island',\n\t\t'BR': 'Brazil',\n\t\t'IO': 'British Indian Ocean Territory',\n\t\t'BN': 'Brunei Darussalam',\n\t\t'BG': 'Bulgaria',\n\t\t'BF': 'Burkina Faso',\n\t\t'BI': 'Burundi',\n\t\t'KH': 'Cambodia',\n\t\t'CM': 'Cameroon',\n\t\t'CA': 'Canada',\n\t\t'CV': 'Cape Verde',\n\t\t'KY': 'Cayman Islands',\n\t\t'CF': 'Central African Republic',\n\t\t'TD': 'Chad',\n\t\t'CL': 'Chile',\n\t\t'CN': 'China',\n\t\t'CX': 'Christmas Island',\n\t\t'CC': 'Cocos (Keeling) Islands',\n\t\t'CO': 'Colombia',\n\t\t'KM': 'Comoros',\n\t\t'CG': 'Congo',\n\t\t'CD': 'Congo, The Democratic Republic of The',\n\t\t'CK': 'Cook Islands',\n\t\t'CR': 'Costa Rica',\n\t\t'CI': 'Cote D’ivoire',\n\t\t'HR': 'Croatia',\n\t\t'CU': 'Cuba',\n\t\t'CY': 'Cyprus',\n\t\t'CZ': 'Czech Republic',\n\t\t'DK': 'Denmark',\n\t\t'DJ': 'Djibouti',\n\t\t'DM': 'Dominica',\n\t\t'DO': 'Dominican Republic',\n\t\t'EC': 'Ecuador',\n\t\t'EG': 'Egypt',\n\t\t'SV': 'El Salvador',\n\t\t'GQ': 'Equatorial Guinea',\n\t\t'ER': 'Eritrea',\n\t\t'EE': 'Estonia',\n\t\t'ET': 'Ethiopia',\n\t\t'FK': 'Falkland Islands (Malvinas)',\n\t\t'FO': 'Faroe Islands',\n\t\t'FJ': 'Fiji',\n\t\t'FI': 'Finland',\n\t\t'FR': 'France',\n\t\t'GF': 'French Guiana',\n\t\t'PF': 'French Polynesia',\n\t\t'TF': 'French Southern Territories',\n\t\t'GA': 'Gabon',\n\t\t'GM': 'Gambia',\n\t\t'GE': 'Georgia',\n\t\t'DE': 'Germany',\n\t\t'GH': 'Ghana',\n\t\t'GI': 'Gibraltar',\n\t\t'GR': 'Greece',\n\t\t'GL': 'Greenland',\n\t\t'GD': 'Grenada',\n\t\t'GP': 'Guadeloupe',\n\t\t'GU': 'Guam',\n\t\t'GT': 'Guatemala',\n\t\t'GG': 'Guernsey',\n\t\t'GN': 'Guinea',\n\t\t'GW': 'Guinea-bissau',\n\t\t'GY': 'Guyana',\n\t\t'HT': 'Haiti',\n\t\t'HM': 'Heard Island and Mcdonald Islands',\n\t\t'VA': 'Holy See (Vatican City State)',\n\t\t'HN': 'Honduras',\n\t\t'HK': 'Hong Kong',\n\t\t'HU': 'Hungary',\n\t\t'IS': 'Iceland',\n\t\t'IN': 'India',\n\t\t'ID': 'Indonesia',\n\t\t'IR': 'Iran, Islamic Republic of',\n\t\t'IQ': 'Iraq',\n\t\t'IE': 'Ireland',\n\t\t'IM': 'Isle of Man',\n\t\t'IL': 'Israel',\n\t\t'IT': 'Italy',\n\t\t'JM': 'Jamaica',\n\t\t'JP': 'Japan',\n\t\t'JE': 'Jersey',\n\t\t'JO': 'Jordan',\n\t\t'KZ': 'Kazakhstan',\n\t\t'KE': 'Kenya',\n\t\t'KI': 'Kiribati',\n\t\t'KP': 'Korea, Democratic People’s Republic of',\n\t\t'KR': 'Korea, Republic of',\n\t\t'KW': 'Kuwait',\n\t\t'KG': 'Kyrgyzstan',\n\t\t'LA': 'Lao People’s Democratic Republic',\n\t\t'LV': 'Latvia',\n\t\t'LB': 'Lebanon',\n\t\t'LS': 'Lesotho',\n\t\t'LR': 'Liberia',\n\t\t'LY': 'Libyan Arab Jamahiriya',\n\t\t'LI': 'Liechtenstein',\n\t\t'LT': 'Lithuania',\n\t\t'LU': 'Luxembourg',\n\t\t'MO': 'Macao',\n\t\t'MK': 'Macedonia, The Former Yugoslav Republic of',\n\t\t'MG': 'Madagascar',\n\t\t'MW': 'Malawi',\n\t\t'MY': 'Malaysia',\n\t\t'MV': 'Maldives',\n\t\t'ML': 'Mali',\n\t\t'MT': 'Malta',\n\t\t'MH': 'Marshall Islands',\n\t\t'MQ': 'Martinique',\n\t\t'MR': 'Mauritania',\n\t\t'MU': 'Mauritius',\n\t\t'YT': 'Mayotte',\n\t\t'MX': 'Mexico',\n\t\t'FM': 'Micronesia, Federated States of',\n\t\t'MD': 'Moldova, Republic of',\n\t\t'MC': 'Monaco',\n\t\t'MN': 'Mongolia',\n\t\t'ME': 'Montenegro',\n\t\t'MS': 'Montserrat',\n\t\t'MA': 'Morocco',\n\t\t'MZ': 'Mozambique',\n\t\t'MM': 'Myanmar',\n\t\t'NA': 'Namibia',\n\t\t'NR': 'Nauru',\n\t\t'NP': 'Nepal',\n\t\t'NL': 'Netherlands',\n\t\t'AN': 'Netherlands Antilles',\n\t\t'NC': 'New Caledonia',\n\t\t'NZ': 'New Zealand',\n\t\t'NI': 'Nicaragua',\n\t\t'NE': 'Niger',\n\t\t'NG': 'Nigeria',\n\t\t'NU': 'Niue',\n\t\t'NF': 'Norfolk Island',\n\t\t'MP': 'Northern Mariana Islands',\n\t\t'NO': 'Norway',\n\t\t'OM': 'Oman',\n\t\t'PK': 'Pakistan',\n\t\t'PW': 'Palau',\n\t\t'PS': 'Palestinian Territory, Occupied',\n\t\t'PA': 'Panama',\n\t\t'PG': 'Papua New Guinea',\n\t\t'PY': 'Paraguay',\n\t\t'PE': 'Peru',\n\t\t'PH': 'Philippines',\n\t\t'PN': 'Pitcairn',\n\t\t'PL': 'Poland',\n\t\t'PT': 'Portugal',\n\t\t'PR': 'Puerto Rico',\n\t\t'QA': 'Qatar',\n\t\t'RE': 'Reunion',\n\t\t'RO': 'Romania',\n\t\t'RU': 'Russian Federation',\n\t\t'RW': 'Rwanda',\n\t\t'SH': 'Saint Helena',\n\t\t'KN': 'Saint Kitts and Nevis',\n\t\t'LC': 'Saint Lucia',\n\t\t'PM': 'Saint Pierre and Miquelon',\n\t\t'VC': 'Saint Vincent and The Grenadines',\n\t\t'WS': 'Samoa',\n\t\t'SM': 'San Marino',\n\t\t'ST': 'Sao Tome and Principe',\n\t\t'SA': 'Saudi Arabia',\n\t\t'SN': 'Senegal',\n\t\t'RS': 'Serbia',\n\t\t'SC': 'Seychelles',\n\t\t'SL': 'Sierra Leone',\n\t\t'SG': 'Singapore',\n\t\t'SK': 'Slovakia',\n\t\t'SI': 'Slovenia',\n\t\t'SB': 'Solomon Islands',\n\t\t'SO': 'Somalia',\n\t\t'ZA': 'South Africa',\n\t\t'GS': 'South Georgia and The South Sandwich Islands',\n\t\t'ES': 'Spain',\n\t\t'LK': 'Sri Lanka',\n\t\t'SD': 'Sudan',\n\t\t'SR': 'Suriname',\n\t\t'SJ': 'Svalbard and Jan Mayen',\n\t\t'SZ': 'Swaziland',\n\t\t'SE': 'Sweden',\n\t\t'CH': 'Switzerland',\n\t\t'SY': 'Syrian Arab Republic',\n\t\t'TW': 'Taiwan, Province of China',\n\t\t'TJ': 'Tajikistan',\n\t\t'TZ': 'Tanzania, United Republic of',\n\t\t'TH': 'Thailand',\n\t\t'TL': 'Timor-leste',\n\t\t'TG': 'Togo',\n\t\t'TK': 'Tokelau',\n\t\t'TO': 'Tonga',\n\t\t'TT': 'Trinidad and Tobago',\n\t\t'TN': 'Tunisia',\n\t\t'TR': 'Turkey',\n\t\t'TM': 'Turkmenistan',\n\t\t'TC': 'Turks and Caicos Islands',\n\t\t'TV': 'Tuvalu',\n\t\t'UG': 'Uganda',\n\t\t'UA': 'Ukraine',\n\t\t'AE': 'United Arab Emirates',\n\t\t'UM': 'United States Minor Outlying Islands',\n\t\t'UY': 'Uruguay',\n\t\t'UZ': 'Uzbekistan',\n\t\t'VU': 'Vanuatu',\n\t\t'VE': 'Venezuela',\n\t\t'VN': 'Viet Nam',\n\t\t'VG': 'Virgin Islands, British',\n\t\t'VI': 'Virgin Islands, U.S.',\n\t\t'WF': 'Wallis and Futuna',\n\t\t'EH': 'Western Sahara',\n\t\t'YE': 'Yemen',\n\t\t'ZM': 'Zambia',\n\t\t'ZW': 'Zimbabwe',\n\t},\n\tlocales: {\n\t\t\"ar\" : \"Arabic\",\n\t\t\"af\" : \"Afrikaans\",\n\t\t\"am\" : \"Amharic\",\n\t\t\"hy\" : \"Armenian\",\n\t\t\"az\" : \"Azerbaijani\",\n\t\t\"eu\" : \"Basque\",\n\t\t\"bn\" : \"Bengali\",\n\t\t\"bg\" : \"Bulgarian\",\n\t\t\"ca\" : \"Catalan\",\n\t\t\"zh-HK\" : \"Chinese (Hong Kong)\",\n\t\t\"zh-CN\" : \"Chinese (Simplified)\",\n\t\t\"zh-TW\" : \"Chinese (Traditional)\",\n\t\t\"hr\" : \"Croatian\",\n\t\t\"cs\" : \"Czech\",\n\t\t\"da\" : \"Danish\",\n\t\t\"nl\" : \"Dutch\",\n\t\t\"en-GB\" : \"English (UK)\",\n\t\t\"en\" : \"English (US)\",\n\t\t\"et\" : \"Estonian\",\n\t\t\"fil\" : \"Filipino\",\n\t\t\"fi\" : \"Finnish\",\n\t\t\"fr\" : \"French\",\n\t\t\"fr-CA\" : \"French (Canadian)\",\n\t\t\"gl\" : \"Galician\",\n\t\t\"ka\" : \"Georgian\",\n\t\t\"de\" : \"German\",\n\t\t\"de-AT\" : \"German (Austria)\",\n\t\t\"de-CH\" : \"German (Switzerland)\",\n\t\t\"el\" : \"Greek\",\n\t\t\"gu\" : \"Gujarati\",\n\t\t\"iw\" : \"Hebrew\",\n\t\t\"hi\" : \"Hindi\",\n\t\t\"hu\" : \"Hungarain\",\n\t\t\"is\" : \"Icelandic\",\n\t\t\"id\" : \"Indonesian\",\n\t\t\"it\" : \"Italian\",\n\t\t\"ja\" : \"Japanese\",\n\t\t\"kn\" : \"Kannada\",\n\t\t\"ko\" : \"Korean\",\n\t\t\"lo\" : \"Laothian\",\n\t\t\"lv\" : \"Latvian\",\n\t\t\"lt\" : \"Lithuanian\",\n\t\t\"ms\" : \"Malay\",\n\t\t\"ml\" : \"Malayalam\",\n\t\t\"mr\" : \"Marathi\",\n\t\t\"mn\" : \"Mongolian\",\n\t\t\"no\" : \"Norwegian\",\n\t\t\"fa\" : \"Persian\",\n\t\t\"pl\" : \"Polish\",\n\t\t\"pt\" : \"Portuguese\",\n\t\t\"pt-BR\" : \"Portuguese (Brazil)\",\n\t\t\"pt-PT\" : \"Portuguese (Portugal)\",\n\t\t\"ro\" : \"Romanian\",\n\t\t\"ru\" : \"Russian\",\n\t\t\"sr\" : \"Serbian\",\n\t\t\"si\" : \"Sinhalese\",\n\t\t\"sk\" : \"Slovak\",\n\t\t\"sl\" : \"Slovenian\",\n\t\t\"es\" : \"Spanish\",\n\t\t\"es-419\" : \"Spanish (Latin America)\",\n\t\t\"sw\" : \"Swahili\",\n\t\t\"sv\" : \"Swedish\",\n\t\t\"ta\" : \"Tamil\",\n\t\t\"te\" : \"Telugu\",\n\t\t\"th\" : \"Thai\",\n\t\t\"tr\" : \"Turkish\",\n\t\t\"uk\" : \"Ukrainian\",\n\t\t\"ur\" : \"Urdu\",\n\t\t\"vi\" : \"Vietnamese\",\n\t\t\"zu\" : \"Zulu\"\n\t},\n\tsettings_url: 'wp-admin/admin.php?page=yikes-inc-easy-mailchimp-settings'\n}\n\nexport default constants;\n","( function( $ ) {\n\n\t$( document ).ready( function() {\n\t\t\n\t\t$( 'body' ).on( 'click', '.yikes-easy-mc-submit-button', function( event ) { \n\t\t event.preventDefault();\n\t\t event.stopPropagation();\n\t\t $( '.yikes-mailchimp-submit-button-span-text' ).focus();\n\t\t}); \n\n\t\t$( 'body' ).on( 'click', '.yikes-mailchimp-submit-button-span-text', function( event ) {\n\t\t event.preventDefault();\n\t\t event.stopPropagation();\n\t\t});\n\t});\n\n})( jQuery );","/*\n* This should have the same effect as WP/PHP's `sanitize_title()` function\n*\n* Source: https://gist.github.com/mathewbyrne/1280286\n*/\nexport default function slugify( text ) {\n\n // Use hash map for special characters \n let specialChars = {\"à\":'a',\"ä\":'a',\"á\":'a',\"â\":'a',\"æ\":'a',\"å\":'a',\"ë\":'e',\"è\":'e',\"é\":'e', \"ê\":'e',\"î\":'i',\"ï\":'i',\"ì\":'i',\"í\":'i',\"ò\":'o',\"ó\":'o',\"ö\":'o',\"ô\":'o',\"ø\":'o',\"ù\":'o',\"ú\":'u',\"ü\":'u',\"û\":'u',\"ñ\":'n',\"ç\":'c',\"ß\":'s',\"ÿ\":'y',\"œ\":'o',\"ŕ\":'r',\"ś\":'s',\"ń\":'n',\"ṕ\":'p',\"ẃ\":'w',\"ǵ\":'g',\"ǹ\":'n',\"ḿ\":'m',\"ǘ\":'u',\"ẍ\":'x',\"ź\":'z',\"ḧ\":'h',\"·\":'-',\"/\":'-',\"_\":'-',\",\":'-',\":\":'-',\";\":'-'};\n\n return text.toString().toLowerCase()\n .replace(/\\s+/g, '-') // Replace spaces with -\n .replace(/./g,(target, index, str) => specialChars[target] || target) // Replace special characters using the hash map\n .replace(/&/g, '-and-') // Replace & with 'and'\n .replace(/[^\\w\\-]+/g, '') // Remove all non-word chars\n .replace(/\\-\\-+/g, '-') // Replace multiple - with single -\n .replace(/^-+/, '') // Trim - from start of text\n .replace(/-+$/, ''); // Trim - from end of text\n};\n","import EasyFormsAPI from './components/api.js'\n\nimport MailchimpForms from './components/class.MailchimpForms.js';\n\nimport '../css/easy-forms-block.scss'\n\nrequire( './components/enable-submit-button-editing.js' );\n\n// Get just the __() localization function from wp.i18n\nconst { __ } = wp.i18n;\n\n// Get registerBlockType and other methods from wp.blocks\nconst { registerBlockType } = wp.blocks;\n\nconst edit_easy_form = function( props ) {\n\n const onChangeForm = ( event ) => {\n props.setAttributes( { form_id: event.target.value } );\n\n if ( event.target.value.length > 0 ) {\n const api = new EasyFormsAPI();\n api.get_form( event.target.value ).then( function( form ) {\n props.setAttributes( { form: form.data } );\n props.setAttributes( { form_description: form.data.form_description } );\n props.setAttributes( { form_title: form.data.form_name } );\n props.setAttributes( { is_ajax: form.data.submission_settings.ajax === '1' } );\n props.setAttributes( { submit_button_text: form.data.form_settings['yikes-easy-mc-submit-button-text'] } );\n });\n }\n };\n\n const onChangeDescription = ( value ) => {\n props.setAttributes( { form_description: value } );\n };\n\n const toggleShowDescription = ( event ) => {\n props.setAttributes( { show_description: !! event.target.checked } );\n }\n\n const toggleInline = ( event ) => {\n props.setAttributes( { inline: !! event.target.checked } );\n }\n\n const toggleShowTitle = ( event ) => {\n props.setAttributes( { show_title: !! event.target.checked } );\n }\n\n const toggleFormTitle = ( value ) => {\n props.setAttributes( { form_title: value } );\n }\n\n const toggleIsAjax = ( event ) => {\n props.setAttributes( { is_ajax: !! event.target.checked } );\n }\n\n /* Allow this function to be called via a checkbox handler or directly by passing in a boolean */\n const toggleRecaptchaAbstract = ( checked ) => {\n props.setAttributes( { recaptcha: checked } );\n }\n\n const toggleRecaptcha = ( event ) => {\n toggleRecaptchaAbstract( !! event.target.checked )\n }\n\n const toggleRecaptchaTheme = ( value ) => {\n props.setAttributes( { recaptcha_theme: value } );\n }\n\n const toggleRecaptchaLang = ( value ) => {\n props.setAttributes( { recaptcha_lang: value } );\n }\n\n const toggleRecaptchaType = ( value ) => {\n props.setAttributes( { recaptcha_type: value } );\n }\n\n const toggleRecaptchaSize = ( value ) => {\n props.setAttributes( { recaptcha_size: value } );\n }\n\n const toggleRecaptchaVerifyCallback = ( value ) => {\n props.setAttributes( { recaptcha_verify_callback: value } );\n }\n\n const toggleRecaptchaExpiredCallback = ( value ) => {\n props.setAttributes( { recaptcha_expired_callback: value } );\n }\n\n const toggleSubmitButtonText = ( value ) => {\n props.setAttributes( { submit_button_text: value })\n }\n\n return (\n <MailchimpForms\n className={ props.className }\n onChangeForm={ onChangeForm }\n formID={ props.attributes.form_id }\n formData={ props.attributes.form }\n onChangeDescription={ onChangeDescription }\n descriptionValue={ props.attributes.form_description }\n showDescription={ props.attributes.show_description }\n toggleShowDescription={ toggleShowDescription }\n focus={ !! props.isSelected }\n inline={ props.attributes.inline }\n toggleInline={ toggleInline }\n formTitle={ props.attributes.form_title }\n toggleFormTitle={ toggleFormTitle }\n showTitle={ props.attributes.show_title }\n toggleShowTitle={ toggleShowTitle }\n isAjax={ props.attributes.is_ajax }\n toggleIsAjax={ toggleIsAjax }\n toggleRecaptchaAbstract={ toggleRecaptchaAbstract }\n recaptcha={ props.attributes.recaptcha }\n toggleRecaptcha={ toggleRecaptcha }\n recaptchaTheme={ props.attributes.recaptcha_theme }\n toggleRecaptchaTheme={ toggleRecaptchaTheme }\n recaptchaLang={ props.attributes.recaptcha_lang }\n toggleRecaptchaLang={ toggleRecaptchaLang }\n recaptchaType={ props.attributes.recaptcha_type }\n toggleRecaptchaType={ toggleRecaptchaType }\n recaptchaSize={ props.attributes.recaptcha_size }\n toggleRecaptchaSize={ toggleRecaptchaSize }\n recaptchaVerifyCallback={ props.attributes.recaptcha_verify_callback }\n toggleRecaptchaVerifyCallback={ toggleRecaptchaVerifyCallback }\n recaptchaExpiredCallback={ props.attributes.recaptcha_expired_callback }\n toggleRecaptchaExpiredCallback={ toggleRecaptchaExpiredCallback }\n submitButtonText={ props.attributes.submit_button_text }\n toggleSubmitButtonText={ toggleSubmitButtonText }\n />\n );\n\n}\n\nconst save_easy_form = function( props ) {\n return null;\n}\n\nconst settings = {\n title : __( 'Easy Forms for Mailchimp' ),\n category : 'easy-forms', // Options include \"common\", \"formatting\", \"layout\", \"widgets\" and \"embed.\"\n icon : 'email-alt',\n keywords : ['mailchimp', 'easy forms for mailchimp', 'yikes'],\n attributes: {\n form_id: {\n type: 'string',\n default: ''\n },\n form: {\n type: 'object'\n },\n form_description: {\n type: 'string',\n default: ''\n },\n show_description: {\n type: 'boolean',\n default: false\n },\n inline: {\n type: 'boolean',\n default: false\n },\n show_title: {\n type: 'boolean',\n default: false\n },\n form_title: {\n type: 'string',\n default: ''\n },\n is_ajax: {\n type: 'boolean',\n default: true,\n },\n recaptcha: {\n type: 'boolean',\n default: false,\n },\n recaptcha_theme: {\n type: 'string',\n default: 'light'\n },\n recaptcha_lang: {\n type: 'string',\n default: ''\n },\n recaptcha_type: {\n type: 'string',\n default: 'image'\n },\n recaptcha_size: {\n type: 'string',\n default: 'normal'\n },\n recaptcha_verify_callback: {\n type: 'string',\n default: ''\n },\n recaptcha_expired_callback: {\n type: 'string',\n default: ''\n },\n submit_button_text: {\n type: 'string',\n default: ''\n }\n },\n edit: edit_easy_form,\n save: save_easy_form,\n}\n\nconst EasyFormsBlock = registerBlockType(\n\n // Name\n ez_forms_gb_data.block_namespace + ez_forms_gb_data.block_name,\n\n // Settings\n settings,\n\n // Block category\n {category: 'easy-forms'} \n);","import './easy-forms-block.js';","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t(require(\"react\")):\"function\"==typeof define&&define.amd?define([\"react\"],t):\"object\"==typeof exports?exports.ReactRecaptcha=t(require(\"react\")):e.ReactRecaptcha=t(e.React)}(this,function(e){return function(e){function t(r){if(a[r])return a[r].exports;var n=a[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var a={};return t.m=e,t.c=a,t.p=\"\",t(0)}([function(e,t,a){\"use strict\";function r(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function o(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}function i(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,\"__esModule\",{value:!0});var l=function(){function e(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,\"value\"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),s=a(6),c=r(s),p=a(4),u=r(p),d={className:u.default.string,onloadCallbackName:u.default.string,elementID:u.default.string,onloadCallback:u.default.func,verifyCallback:u.default.func,expiredCallback:u.default.func,render:u.default.oneOf([\"onload\",\"explicit\"]),sitekey:u.default.string,theme:u.default.oneOf([\"light\",\"dark\"]),type:u.default.string,verifyCallbackName:u.default.string,expiredCallbackName:u.default.string,size:u.default.oneOf([\"invisible\",\"compact\",\"normal\"]),tabindex:u.default.string,hl:u.default.string,badge:u.default.oneOf([\"bottomright\",\"bottomleft\",\"inline\"])},f={elementID:\"g-recaptcha\",className:\"g-recaptcha\",onloadCallback:void 0,onloadCallbackName:\"onloadCallback\",verifyCallback:void 0,verifyCallbackName:\"verifyCallback\",expiredCallback:void 0,expiredCallbackName:\"expiredCallback\",render:\"onload\",theme:\"light\",type:\"image\",size:\"normal\",tabindex:\"0\",hl:\"en\",badge:\"bottomright\"},h=function(){return\"undefined\"!=typeof window&&\"undefined\"!=typeof window.grecaptcha&&\"function\"==typeof window.grecaptcha.render},y=void 0,b=function(e){function t(e){n(this,t);var a=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return a._renderGrecaptcha=a._renderGrecaptcha.bind(a),a.reset=a.reset.bind(a),a.state={ready:h(),widget:null},a.state.ready||\"undefined\"==typeof window||(y=setInterval(a._updateReadyState.bind(a),1e3)),a}return i(t,e),l(t,[{key:\"componentDidMount\",value:function(){this.state.ready&&this._renderGrecaptcha()}},{key:\"componentDidUpdate\",value:function(e,t){var a=this.props,r=a.render,n=a.onloadCallback;\"explicit\"===r&&n&&this.state.ready&&!t.ready&&this._renderGrecaptcha()}},{key:\"componentWillUnmount\",value:function(){clearInterval(y)}},{key:\"reset\",value:function(){var e=this.state,t=e.ready,a=e.widget;t&&null!==a&&grecaptcha.reset(a)}},{key:\"execute\",value:function(){var e=this.state,t=e.ready,a=e.widget;t&&null!==a&&grecaptcha.execute(a)}},{key:\"_updateReadyState\",value:function(){h()&&(this.setState({ready:!0}),clearInterval(y))}},{key:\"_renderGrecaptcha\",value:function(){this.state.widget=grecaptcha.render(this.props.elementID,{sitekey:this.props.sitekey,callback:this.props.verifyCallback?this.props.verifyCallback:void 0,theme:this.props.theme,type:this.props.type,size:this.props.size,tabindex:this.props.tabindex,hl:this.props.hl,badge:this.props.badge,\"expired-callback\":this.props.expiredCallback?this.props.expiredCallback:void 0}),this.props.onloadCallback&&this.props.onloadCallback()}},{key:\"render\",value:function(){return\"explicit\"===this.props.render&&this.props.onloadCallback?c.default.createElement(\"div\",{id:this.props.elementID,\"data-onloadcallbackname\":this.props.onloadCallbackName,\"data-verifycallbackname\":this.props.verifyCallbackName}):c.default.createElement(\"div\",{id:this.props.elementID,className:this.props.className,\"data-sitekey\":this.props.sitekey,\"data-theme\":this.props.theme,\"data-type\":this.props.type,\"data-size\":this.props.size,\"data-badge\":this.props.badge,\"data-tabindex\":this.props.tabindex})}}]),t}(s.Component);t.default=b,b.propTypes=d,b.defaultProps=f,e.exports=t.default},function(e,t){\"use strict\";function a(e){return function(){return e}}var r=function(){};r.thatReturns=a,r.thatReturnsFalse=a(!1),r.thatReturnsTrue=a(!0),r.thatReturnsNull=a(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,a){\"use strict\";function r(e,t,a,r,o,i,l,s){if(n(t),!e){var c;if(void 0===t)c=new Error(\"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.\");else{var p=[a,r,o,i,l,s],u=0;c=new Error(t.replace(/%s/g,function(){return p[u++]})),c.name=\"Invariant Violation\"}throw c.framesToPop=1,c}}var n=function(e){};e.exports=r},function(e,t,a){\"use strict\";var r=a(1),n=a(2),o=a(5);e.exports=function(){function e(e,t,a,r,i,l){l!==o&&n(!1,\"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types\")}function t(){return e}e.isRequired=e;var a={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return a.checkPropTypes=r,a.PropTypes=a,a}},function(e,t,a){e.exports=a(3)()},function(e,t){\"use strict\";var a=\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\";e.exports=a},function(t,a){t.exports=e}])});","(function() { module.exports = this[\"wp\"][\"element\"]; }());","(function() { module.exports = this[\"React\"]; }());"],"sourceRoot":""}
blocks/easy-forms-block/build/style.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ .wp-block-yikes-inc-easy-forms-easy-forms-block textarea.yikes-mailchimp-submit-button-span-text{background:none;text-align:center}.wp-block-yikes-inc-easy-forms-easy-forms-block select{height:auto}
2
+
blocks/easy-forms-block/build/style.css.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack:///./blocks/easy-forms-block/css/easy-forms-block.scss"],"names":[],"mappings":"AAAA;AACA;AACA,qBAAqB;;AAErB;AACA,eAAe","file":"style.css","sourcesContent":[".wp-block-yikes-inc-easy-forms-easy-forms-block textarea.yikes-mailchimp-submit-button-span-text {\n background: none;\n text-align: center; }\n\n.wp-block-yikes-inc-easy-forms-easy-forms-block select {\n height: auto; }\n"],"sourceRoot":""}
blocks/easy-forms-block/css/easy-forms-block.scss ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ .wp-block-yikes-inc-easy-forms-easy-forms-block {
2
+
3
+ textarea.yikes-mailchimp-submit-button-span-text {
4
+ background: none;
5
+ text-align: center;
6
+ }
7
+
8
+ select {
9
+ height: auto;
10
+ }
11
+ }
blocks/easy-forms-block/easy-forms-block.php CHANGED
@@ -35,11 +35,14 @@ class YIKES_Easy_Form_Block extends YIKES_Easy_Forms_Blocks {
35
 
36
  wp_register_script( 'yikes-datepicker-scripts', YIKES_MC_URL . 'public/js/yikes-datepicker-scripts.min.js', array( 'jquery-ui-datepicker' ), YIKES_MC_VERSION, true );
37
  wp_localize_script( 'yikes-datepicker-scripts', 'datepicker_settings', $datepicker_options );
 
 
38
  wp_enqueue_script( 'yikes-datepicker-scripts' );
39
  wp_enqueue_style( 'jquery-datepicker-styles', YIKES_MC_URL . 'public/css/jquery-ui.min.css', array(), YIKES_MC_VERSION );
40
  wp_enqueue_style( 'yikes-datepicker-styles', YIKES_MC_URL . 'public/css/yikes-datepicker-styles.min.css', array(), YIKES_MC_VERSION );
 
41
 
42
- wp_register_script( 'yikes-easy-forms-blocks', YIKES_MC_URL . 'blocks/easy-forms-block/easy-forms-block.js', array( 'wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api' ), filemtime( YIKES_MC_PATH . 'blocks/easy-forms-block/easy-forms-block.js' ), true );
43
  wp_localize_script( 'yikes-easy-forms-blocks', 'ez_forms_gb_data', array(
44
  'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
45
  'fetch_form_nonce' => wp_create_nonce( 'fetch_form_nonce' ),
35
 
36
  wp_register_script( 'yikes-datepicker-scripts', YIKES_MC_URL . 'public/js/yikes-datepicker-scripts.min.js', array( 'jquery-ui-datepicker' ), YIKES_MC_VERSION, true );
37
  wp_localize_script( 'yikes-datepicker-scripts', 'datepicker_settings', $datepicker_options );
38
+
39
+ // Enqueueing styles.
40
  wp_enqueue_script( 'yikes-datepicker-scripts' );
41
  wp_enqueue_style( 'jquery-datepicker-styles', YIKES_MC_URL . 'public/css/jquery-ui.min.css', array(), YIKES_MC_VERSION );
42
  wp_enqueue_style( 'yikes-datepicker-styles', YIKES_MC_URL . 'public/css/yikes-datepicker-styles.min.css', array(), YIKES_MC_VERSION );
43
+ wp_enqueue_style( 'yikes-easy-forms-blocks-css', YIKES_MC_URL . 'blocks/easy-forms-block/build/style.css', array(), YIKES_MC_VERSION );
44
 
45
+ wp_register_script( 'yikes-easy-forms-blocks', YIKES_MC_URL . 'blocks/easy-forms-block/build/easy-forms-blocks.js', array( 'wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api' ), time(), true );
46
  wp_localize_script( 'yikes-easy-forms-blocks', 'ez_forms_gb_data', array(
47
  'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
48
  'fetch_form_nonce' => wp_create_nonce( 'fetch_form_nonce' ),
blocks/easy-forms-block/src/components/api.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export default class EasyFormsAPI {
2
+
3
+ constructor() {
4
+ this.ajaxurl = window.ajaxurl;
5
+ }
6
+
7
+ get_api_key_status() {
8
+ let data = {
9
+ action: 'yikes_get_api_key_status',
10
+ nonce: ez_forms_gb_data.get_api_key_status,
11
+ }
12
+
13
+ let status = jQuery.post( this.ajaxurl, data );
14
+
15
+ return status;
16
+ }
17
+
18
+ get_recaptcha() {
19
+ let data = {
20
+ action: 'yikes_get_recaptcha',
21
+ nonce: ez_forms_gb_data.fetch_recaptcha_nonce
22
+ }
23
+
24
+ let recaptcha_data = jQuery.post( this.ajaxurl, data );
25
+
26
+ return recaptcha_data;
27
+ }
28
+
29
+ get_forms() {
30
+ let data = {
31
+ action: 'yikes_get_forms',
32
+ nonce: ez_forms_gb_data.fetch_forms_nonce,
33
+ }
34
+
35
+ let forms = jQuery.post( this.ajaxurl, data );
36
+
37
+ return forms;
38
+ }
39
+
40
+ get_form( form_id ) {
41
+ let data = {
42
+ action: 'yikes_get_form',
43
+ form_id: form_id,
44
+ nonce: ez_forms_gb_data.fetch_form_nonce
45
+ }
46
+
47
+ let form = jQuery.post( this.ajaxurl, data );
48
+
49
+ return form;
50
+ }
51
+ }
blocks/easy-forms-block/src/components/class.MailChimpForms.js ADDED
@@ -0,0 +1,871 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Import dependencies
2
+ import slugify from './slugify.js';
3
+ import constants from './constants.js';
4
+ import EasyFormsAPI from './api.js';
5
+
6
+ // Get functions / blocks / components
7
+ const Recaptcha = require( 'react-recaptcha' );
8
+ const { __ } = wp.i18n;
9
+ const { registerBlockType } = wp.blocks;
10
+ const { RichText, InspectorControls, PlainText } = wp.editor;
11
+ const { Spinner, TextControl, PanelBody, PanelRow, FormToggle, SelectControl } = wp.components;
12
+ const { Component } = wp.element;
13
+
14
+ export default class MailchimpForms extends Component {
15
+ constructor( props ) {
16
+ super( ...arguments );
17
+ this.state = {
18
+ api_key_status: 'valid',
19
+ forms : [],
20
+ recaptcha_data: {
21
+ data : {},
22
+ success: false
23
+ },
24
+ 'forms_loaded': false
25
+ }
26
+
27
+ this.api = new EasyFormsAPI();
28
+
29
+ this.address_fields = {
30
+ 'addr1' : 'Address 1',
31
+ 'addr2' : 'Address 2',
32
+ 'city' : 'City',
33
+ 'state' : 'State',
34
+ 'zip' : 'Zip',
35
+ 'country': 'Country'
36
+ }
37
+ }
38
+
39
+ /**
40
+ * Run our API calls after the component has mounted. You can't use setState before a component is mounted.
41
+ */
42
+ componentDidMount() {
43
+ this.api.get_api_key_status().then( status => {
44
+ this.setState( { api_key_status: status.data } );
45
+ });
46
+
47
+ this.api.get_forms().then( forms => {
48
+ this.setState( { forms: forms.data, forms_loaded: true } );
49
+ });
50
+
51
+ this.api.get_recaptcha().then( recaptcha_data => {
52
+ this.setState( { recaptcha_data: recaptcha_data } );
53
+ this.props.toggleRecaptchaAbstract( this.state.recaptcha_data.success );
54
+ });
55
+ }
56
+
57
+ handleFormFieldChanges( event ) {
58
+ // console.log( event );
59
+
60
+ // console.log( value );
61
+ // console.log( this );
62
+ // console.log( typeof this.setState );
63
+
64
+ // const target = event.target;
65
+ // const value = target.type === 'checkbox' ? target.checked : target.value;
66
+ // const name = target.name;
67
+
68
+ // return this.setState( { [name]: value } );
69
+ }
70
+
71
+ inspector_controls() {
72
+
73
+ const inline = (
74
+ <PanelRow>
75
+ <label
76
+ htmlFor="inline-form-toggle"
77
+ className="blocks-base-control__label"
78
+ >
79
+ { __( 'Inline' ) }
80
+ </label>
81
+ <FormToggle
82
+ id="inline-form-toggle"
83
+ label={ __( 'Inline' ) }
84
+ checked={ !! this.props.inline }
85
+ onChange={ this.props.toggleInline }
86
+ />
87
+ </PanelRow>
88
+ )
89
+
90
+ const show_form_title = (
91
+ <PanelRow>
92
+ <label
93
+ htmlFor="show-title-form-toggle"
94
+ className="blocks-base-control__label"
95
+ >
96
+ { __( 'Show Form Title' ) }
97
+ </label>
98
+ <FormToggle
99
+ id="show-title-form-toggle"
100
+ label={ __( 'Show Form Title' ) }
101
+ checked={ !! this.props.showTitle }
102
+ onChange={ this.props.toggleShowTitle }
103
+ />
104
+ </PanelRow>
105
+ )
106
+
107
+ const show_form_description = (
108
+ <PanelRow>
109
+ <label
110
+ htmlFor="show-description-form-toggle"
111
+ className="blocks-base-control__label"
112
+ >
113
+ { __( 'Show Form Description' ) }
114
+ </label>
115
+ <FormToggle
116
+ id="show-description-form-toggle"
117
+ label={ __( 'Show Form Description' ) }
118
+ checked={ !! this.props.showDescription }
119
+ onChange={ this.props.toggleShowDescription }
120
+ />
121
+ </PanelRow>
122
+ )
123
+
124
+ const is_ajax = (
125
+ <PanelRow>
126
+ <label
127
+ htmlFor="is-ajax-form-toggle"
128
+ className="blocks-base-control__label"
129
+ >
130
+ { __( 'AJAX Submissions' ) }
131
+ </label>
132
+ <FormToggle
133
+ id="is-ajax-form-toggle"
134
+ label={ __( 'AJAX' ) }
135
+ checked={ !! this.props.isAjax }
136
+ onChange={ this.props.toggleIsAjax }
137
+ />
138
+ </PanelRow>
139
+ )
140
+
141
+ const recaptcha = (
142
+ <PanelRow>
143
+ <label
144
+ htmlFor="recaptcha-form-toggle"
145
+ className="blocks-base-control__label"
146
+ >
147
+ { __( 'reCAPTCHA' ) }
148
+ </label>
149
+ <FormToggle
150
+ id="recaptcha-form-toggle"
151
+ label={ __( 'reCAPTCHA' ) }
152
+ checked={ !! this.props.recaptcha }
153
+ onChange={ this.props.toggleRecaptcha }
154
+ />
155
+ </PanelRow>
156
+ )
157
+
158
+ const recaptcha_type = !! this.props.recaptcha ?
159
+ (
160
+ <PanelRow>
161
+ <label
162
+ htmlFor="recaptcha-type-form-toggle"
163
+ className="blocks-base-control__label"
164
+ >
165
+ { __( 'reCAPTCHA Type' ) }
166
+ </label>
167
+ <SelectControl
168
+ value={ this.props.recaptchaType }
169
+ options={ [ { value: 'image', label: 'Image' }, { value: 'audio', 'label': 'Audio' } ] }
170
+ onChange={ this.props.toggleRecaptchaType }
171
+ />
172
+ </PanelRow>
173
+ )
174
+ : '';
175
+
176
+ const recaptcha_theme = !! this.props.recaptcha ?
177
+ (
178
+ <PanelRow>
179
+ <label
180
+ htmlFor="recaptcha-theme-form-toggle"
181
+ className="blocks-base-control__label"
182
+ >
183
+ { __( 'reCAPTCHA Theme' ) }
184
+ </label>
185
+ <SelectControl
186
+ value={ this.props.recaptchaTheme }
187
+ options={ [ { value: 'light', label: 'Light' }, {value: 'dark', 'label': 'Dark' } ] }
188
+ onChange={ this.props.toggleRecaptchaTheme }
189
+ />
190
+ </PanelRow>
191
+ )
192
+ : '';
193
+
194
+ const recaptcha_lang = !! this.props.recaptcha ?
195
+ (
196
+ <PanelRow>
197
+ <label
198
+ htmlFor="recaptcha-language-form-toggle"
199
+ className="blocks-base-control__label"
200
+ title={ this.state.recaptcha_data.data ? 'The default language for your locale is ' + constants.locales[ this.state.recaptcha_data.data.locale ] : '' }
201
+ >
202
+ { __( 'reCAPTCHA Language' ) }
203
+ </label>
204
+ <SelectControl
205
+ id="recaptcha-language-form-toggle"
206
+ value={ this.props.recaptchaLang.length > 0 ? this.props.recaptchaLang : ( this.state.recaptcha_data.data ? this.state.recaptcha_data.data.locale : '' ) }
207
+ onChange={ this.props.toggleRecaptchaLang }
208
+ title={ this.state.recaptcha_data.data ? 'The default language for your locale is ' + constants.locales[ this.state.recaptcha_data.data.locale ] : '' }
209
+ options={ Object.keys( constants.locales ).map( ( key ) => { return { value: key, label: constants.locales[key] } }) }
210
+ />
211
+ </PanelRow>
212
+ )
213
+ : '';
214
+
215
+ const recaptcha_size = !! this.props.recaptcha ?
216
+ (
217
+ <PanelRow>
218
+ <label
219
+ htmlFor="recaptcha-size-form-toggle"
220
+ className="blocks-base-control__label"
221
+ >
222
+ { __( 'reCAPTCHA Size' ) }
223
+ </label>
224
+ <SelectControl
225
+ id="recaptcha-size-form-toggle"
226
+ value={ this.props.recaptchaSize }
227
+ onChange={ this.props.toggleRecaptchaSize }
228
+ options={ [ { value: 'normal', label: 'Normal' }, { value: 'compact', label: 'Compact' } ] }
229
+ />
230
+ </PanelRow>
231
+ )
232
+ : '';
233
+
234
+ const recaptcha_verify_callback = !! this.props.recaptcha ?
235
+ (
236
+ <TextControl
237
+ id="recaptcha-verify-callback-form-toggle"
238
+ label={ __( 'reCAPTCHA Verify Callback' ) }
239
+ value={ this.props.recaptchaVerifyCallback }
240
+ onChange={ this.props.toggleRecaptchaVerifyCallback }
241
+ />
242
+ )
243
+ : '';
244
+
245
+ const recaptcha_expired_callback = !! this.props.recaptcha ?
246
+ (
247
+ <TextControl
248
+ id="recaptcha-expired-callback-form-toggle"
249
+ label={ __( 'reCAPTCHA Expired Callback' ) }
250
+ value={ this.props.recaptchaExpiredCallback }
251
+ onChange={ this.props.toggleRecaptchaExpiredCallback }
252
+ />
253
+ )
254
+ : '';
255
+
256
+ const inspector_controls =
257
+ <InspectorControls key="easy-forms-inspector">
258
+
259
+ <PanelBody title={ __( 'Settings' ) } >
260
+ {inline}
261
+ {show_form_title}
262
+ {show_form_description}
263
+ {is_ajax}
264
+ {recaptcha}
265
+ {recaptcha_type}
266
+ {recaptcha_theme}
267
+ {recaptcha_lang}
268
+ {recaptcha_size}
269
+ {recaptcha_verify_callback}
270
+ {recaptcha_expired_callback}
271
+ </PanelBody>
272
+
273
+ </InspectorControls>
274
+
275
+ return inspector_controls;
276
+ }
277
+
278
+ forms_dropdown() {
279
+ return this.state.forms.length > 0 ?
280
+ <select
281
+ value={ this.props.formID }
282
+ onChange={ this.props.onChangeForm }
283
+ className="yikes-mailchimp-forms-dropdown"
284
+ key="yikes-mailchimp-forms-dropdown"
285
+ >
286
+ <option key="select" value="">Select Mailchimp Form...</option>
287
+ { this.state.forms.map( ( form ) => {
288
+ return <option key={ 'yikes-select-form-' + form.id } value={ form.id }>{ form.form_name }</option>
289
+ })}
290
+ </select>
291
+ : '';
292
+ }
293
+
294
+ form_title() {
295
+ return this.props.showTitle === true ?
296
+ ( this.props.focus ?
297
+ <h3
298
+ className={ "yikes-mailchimp-form-title yikes-mailchimp-form-title-" + this.props.formID }
299
+ key="yikes-mailchimp-form-title-wrapper"
300
+ >
301
+ <PlainText
302
+ placeholder={ this.props.formTitle }
303
+ key="yikes-mailchimp-form-title-editable"
304
+ value={ this.props.formTitle }
305
+ onChange={ this.props.toggleFormTitle }
306
+ />
307
+ </h3>
308
+ :
309
+ <h3 className={ "yikes-mailchimp-form-title yikes-mailchimp-form-title-" + this.props.formID } key="yikes-mailchimp-form-title">
310
+ { this.props.formTitle }
311
+ </h3>
312
+ ) : '';
313
+ }
314
+
315
+ form_description() {
316
+ return this.props.showDescription === true ?
317
+ <section className={ "yikes-mailchimp-form-description yikes-mailchimp-form-description-" + this.props.formID } key="yikes-mailchimp-form-description">
318
+ <PlainText
319
+ className="mailchimpDescription"
320
+ placeholder={ __( 'Enter your form\'s description here.' ) /*( this.props.formData && this.props.formData.form_description && this.props.formData.form_description.length > 0 || this.props.descriptionValue && this.props.descriptionValue.length > 0 ) ? '' : __( 'Enter your form\'s description here.' )*/ }
321
+ value={ this.props.descriptionValue.length > 0 ? this.props.descriptionValue : ( this.props.formData && this.props.formData.form_description ? this.props.formData.form_description : '' ) }
322
+ onChange={ this.props.onChangeDescription }
323
+ key="mailchimpDescription"
324
+ />
325
+ </section>
326
+ : '';
327
+ }
328
+
329
+ get_address_field( addr_field, field ) {
330
+ switch( addr_field ) {
331
+
332
+ case 'addr1':
333
+ case 'addr2':
334
+ case 'city':
335
+ case 'zip':
336
+ return (
337
+ <TextControl
338
+ id={ "yikes-easy-mc-form-" + this.props.formID + "-" + field.merge + '-' + addr_field }
339
+ onChange={ this.handleFormFieldChanges }
340
+ type="text"
341
+ name={ field.merge + '[' + addr_field + ']' }
342
+ className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }
343
+ key= { 'yikes-mailchimp-field-' + field.merge + '-' + addr_field }
344
+ required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }
345
+ placeholder={ field.placeholder === '1' ? this.address_fields[ addr_field ] : '' }
346
+ />
347
+ )
348
+ break;
349
+
350
+ case 'state':
351
+ return (
352
+ <select
353
+ id={ "yikes-easy-mc-form-" + this.props.formID + "-" + field.merge + '-' + addr_field }
354
+ name={ field.merge + '[' + addr_field + ']' }
355
+ className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }
356
+ onChange={ this.handleFormFieldChanges }
357
+ key= { 'yikes-mailchimp-field-' + field.merge + '-' + addr_field }
358
+ value=''
359
+ required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }
360
+ >
361
+ { Object.keys( constants.states ).map( ( key ) => {
362
+ var choice = constants.states[ key ];
363
+ return <option key={ 'state-' + key } value={ key }>{ choice }</option>
364
+ })}
365
+
366
+ </select>
367
+ )
368
+ break;
369
+
370
+ case 'country':
371
+ return (
372
+ <select
373
+ id={ "yikes-easy-mc-form-" + this.props.formID + "-" + field.merge + '-' + addr_field }
374
+ name={ field.merge + '[' + addr_field + ']' }
375
+ className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }
376
+ onChange={ this.handleFormFieldChanges }
377
+ key= { 'yikes-mailchimp-field-' + field.merge + '-' + addr_field }
378
+ value=''
379
+ required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }
380
+ >
381
+ { Object.keys( constants.countries ).map( ( key ) => {
382
+ var choice = constants.countries[ key ];
383
+ return <option key={ 'country-' + key } value={ key }>{ choice }</option>
384
+ })}
385
+
386
+ </select>
387
+ )
388
+ break;
389
+ }
390
+ }
391
+
392
+ get_dropdown_field( field ) {
393
+ return (
394
+ <select
395
+ id={ "yikes-easy-mc-form-" + this.props.formID + "-" + field.merge }
396
+ name={ field.merge }
397
+ className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }
398
+ onChange={ this.handleFormFieldChanges }
399
+ key= { 'yikes-mailchimp-field-' + field.merge }
400
+ value={ JSON.parse( field.choices )[ field.default_choice ] }
401
+ required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }
402
+ >
403
+ { Object.keys( JSON.parse( field.choices ) ).map( ( key ) => {
404
+ var choice = JSON.parse( field.choices )[ key ];
405
+ return <option key={ slugify( choice ) } value={ choice }>{ choice }</option>
406
+ })}
407
+ </select>
408
+ )
409
+ }
410
+
411
+ get_radio_field( field ) {
412
+ var ii = 0;
413
+
414
+ return (
415
+ JSON.parse( field.choices ).map( ( key ) => {
416
+ ii++;
417
+ return (
418
+ <label
419
+ htmlFor={ field.merge + '-' + ii }
420
+ className="yikes-easy-mc-checkbox-label"
421
+ key={ field.merge + '-label-radio-key-' + ii }
422
+ >
423
+ <input
424
+ type="radio"
425
+ name={ field.merge }
426
+ id={ field.merge + '-' + ii }
427
+ key={ field.merge + '-' + ii + '-input-key' }
428
+ value={ key }
429
+ onChange={ this.handleFormFieldChanges }
430
+ checked={ parseInt( field.default_choice ) === ( ii - 1 ) }
431
+ />
432
+ <span key={ field.merge + '-span-radio-key-' + ii } className={ field.merge + '-label' }>{ key }</span>
433
+ </label>
434
+ )
435
+ })
436
+ )
437
+ }
438
+
439
+ get_url_field( field ) {
440
+ return (
441
+ <TextControl
442
+ id={ "yikes-easy-mc-form-" + this.props.formID + "-" + field.merge }
443
+ placeholder={ field.placeholder }
444
+ onChange={ this.handleFormFieldChanges }
445
+ type='url'
446
+ value={ field.default }
447
+ name={ field.merge }
448
+ className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }
449
+ key= { 'yikes-mailchimp-field-' + field.merge }
450
+ required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }
451
+ title={ field.type === 'url' ? __( 'Please enter a valid URL to the website.' ) : __( 'Please enter a valid URL to the image.' ) }
452
+ />
453
+ )
454
+ }
455
+
456
+ get_default_field( field ) {
457
+
458
+ var type = field.type === 'zip' || field.type === 'phone' ? 'text' : field.type;
459
+
460
+ return (
461
+ <TextControl
462
+ id={ "yikes-easy-mc-form-" + this.props.formID + "-" + field.merge }
463
+ placeholder={ field.placeholder }
464
+ onChange={ this.handleFormFieldChanges }
465
+ type={ type }
466
+ value={ field.default }
467
+ name={ field.merge }
468
+ className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }
469
+ key= { 'yikes-mailchimp-field-' + field.merge }
470
+ required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }
471
+ />
472
+ )
473
+ }
474
+
475
+ get_date_field( field ) {
476
+ return (
477
+ <TextControl
478
+ id={ "yikes-easy-mc-form-" + this.props.formID + "-" + field.merge }
479
+ placeholder={ field.placeholder }
480
+ onChange={ this.handleFormFieldChanges }
481
+ type='text'
482
+ value={ field.default }
483
+ name={ field.merge }
484
+ className={ 'yikes-easy-mc-' + field.type + ' ' + field['additional-classes'] }
485
+ key= { 'yikes-mailchimp-field-' + field.merge }
486
+ required={ field.merge === 'EMAIL' || field.require === '1' ? 'required' : false }
487
+ data-attr-type={ field.type }
488
+ data-date-format={ field.date_format.toLowerCase() }
489
+ />
490
+ )
491
+ }
492
+
493
+ get_radio_interest_group( field ) {
494
+ var ii = -1;
495
+ var cn = "yikes-easy-mc-checkbox-label " + field['additional-classes'];
496
+
497
+ return (
498
+ Object.keys( JSON.parse( field.groups ) ).map( ( key ) => {
499
+ var choice = JSON.parse( field.groups )[ key ];
500
+ ii++;
501
+ return (
502
+ <label
503
+ htmlFor={ field.group_id + '-' + ii }
504
+ className={ { [cn]: true, 'field-no-label': field['hide-label'] === '1' } }
505
+ key={ field.group_id + '-' + ii + '-label-key' }
506
+ >
507
+ <input
508
+ type="radio"
509
+ name={"group-" + field.group_id + '[]' }
510
+ id={ field.group_id + '-' + ii }
511
+ key={ field.group_id + '-' + ii + '-input-key' }
512
+ value={ key }
513
+ onChange={ this.handleFormFieldChanges }
514
+ checked={ key === field.default_choice }
515
+ className={ { 'yikes-interest-group-required': field.require === '1' } }
516
+ />
517
+ { choice }
518
+ </label>
519
+ )
520
+ })
521
+ )
522
+ }
523
+
524
+ get_hidden_interest_group( field ) {
525
+ var ii = -1;
526
+
527
+ return (
528
+ Object.keys( JSON.parse( field.groups ) ).map( ( key ) => {
529
+ var choice = JSON.parse( field.groups )[ key ];
530
+ ii++;
531
+ return (
532
+ <label
533
+ htmlFor={ field.group_id + '-' + ii }
534
+ className={ 'yikes-easy-mc-checkbox-label ' + field['additional-classes'] }
535
+ key={ field.group_id + '-' + ii + '-label-key' }
536
+ >
537
+ <input
538
+ type="checkbox"
539
+ name={"group-" + field.group_id + '[]' }
540
+ id={ field.group_id + '-' + ii }
541
+ key={ field.group_id + '-' + ii + '-input-key' }
542
+ value={ key }
543
+ onChange={ this.handleFormFieldChanges }
544
+ checked={ field.default_choice && field.default_choice.indexOf( key ) !== -1 }
545
+ />
546
+ { choice }
547
+ </label>
548
+ )
549
+ })
550
+ )
551
+ }
552
+
553
+ get_checkboxes_interest_group( field ) {
554
+ var ii = -1;
555
+ var cn = 'yikes-easy-mc-checkbox-label ' + field['additional-classes'];
556
+
557
+ return (
558
+ Object.keys( JSON.parse( field.groups ) ).map( ( key ) => {
559
+ var choice = JSON.parse( field.groups )[ key ];
560
+ ii++;
561
+ return (
562
+ <label
563
+ htmlFor={ field.group_id + '-' + ii }
564
+ className={ { [cn]: true, 'field-no-label': field['hide-label'] === '1' } }
565
+ key={ field.group_id + '-' + ii + '-label-key' }
566
+ >
567
+ <input
568
+ className={ { 'yikes-interest-group-required': field.require === '1' } }
569
+ type="checkbox"
570
+ name={ 'group-' + field.group_id + '[]' }
571
+ id={ field.group_id + '-' + ii }
572
+ key={ field.group_id + '-' + ii + '-input-key' }
573
+ value={ key }
574
+ onChange={ this.handleFormFieldChanges }
575
+ checked={ typeof field.default_choice !== 'undefined' && field.default_choice.indexOf( key ) !== -1 }
576
+ required={ field.require === '1' ? 'required' : false }
577
+ />
578
+ { choice }
579
+ </label>
580
+ )
581
+ })
582
+ )
583
+ }
584
+
585
+ get_dropdown_interest_group( field ) {
586
+ var ii = -1;
587
+
588
+ return (
589
+ <select
590
+ id={ "yikes-easy-mc-form-" + this.props.formID + "-" + field.group_id }
591
+ name={ "group-" + field.group_id }
592
+ className={ "yikes-easy-mc-dropdown " + field['additional-classes'] }
593
+ value={ field.default_choice }
594
+ onChange={ this.handleFormFieldChanges }
595
+ required={ field.require === '1' ? 'required' : false }
596
+ >
597
+
598
+ { Object.keys( JSON.parse( field.groups ) ).map( ( key ) => {
599
+ var choice = JSON.parse( field.groups )[ key ];
600
+ ii++;
601
+ return (
602
+ <option key={ field.group_id + '-' + ii + '-input-key' } value={ key }>{ choice }</option>
603
+ )
604
+ })}
605
+ </select>
606
+ )
607
+ }
608
+
609
+ form_fields() {
610
+
611
+ return this.props.formData && this.props.formData.fields ?
612
+ Object.keys( this.props.formData.fields ).map( ( key ) => {
613
+
614
+ var field = this.props.formData.fields[ key ];
615
+
616
+ // Form Fields (aka merge variables)
617
+ if ( typeof field.merge !== 'undefined' ) {
618
+
619
+ var desc = field.description.length > 0 ?
620
+ <p className="form-field-description" id={ "form-field-description-" + field.merge } key={ "form-field-description-" + field.merge }>{ field.description }</p>
621
+ : '';
622
+
623
+ var label = field['hide-label'] !== '1' ? <span className={ field.merge + '-label' } key={ field.merge + '-label-span-key' }>{ field.label }</span> : '';
624
+
625
+ var classes = {'yikes-mailchimp-field-required' : field.merge === 'EMAIL' || field.require === '1' }
626
+ classes[ field.merge + '-label'] = true;
627
+
628
+ if ( field.type === 'address' ) {
629
+
630
+ return ([
631
+ field.description_above === '1' && field.description.length > 0 && desc,
632
+ Object.keys( this.address_fields ).map( ( addr_field ) => {
633
+ label = field['hide-label'] !== '1' ? <span className={ field.merge + '-label' } key={ field.merge + '-label-span-key-' + addr_field }>{ this.address_fields[ addr_field ] }</span> : '';
634
+
635
+ return (
636
+ <label
637
+ htmlFor={ "yikes-easy-mc-form-" + this.props.formID + "-" + field.merge + '-' + addr_field }
638
+ className={ classes }
639
+ key={ field.merge + '-label-key-' + addr_field }
640
+ style={ field.hide === '1' ? { 'display': 'none' } : {} }
641
+ >
642
+ { label }
643
+ { this.get_address_field( addr_field, field ) }
644
+ </label>
645
+ )
646
+ }),
647
+ field.description_above !== '1' && field.description.length > 0 && desc
648
+ ])
649
+ } else {
650
+ return (
651
+ <label
652
+ htmlFor={ "yikes-easy-mc-form-" + this.props.formID + "-" + field.merge }
653
+ className={ classes }
654
+ key={ field.merge + '-label-key' }
655
+ style={ field.hide === '1' ? { 'display': 'none' } : {} }
656
+ >
657
+ { label }
658
+
659
+ { field.description_above === '1' && field.description.length > 0 && desc }
660
+
661
+ {
662
+ ( field.type === 'dropdown' ? this.get_dropdown_field( field ) :
663
+ ( field.type === 'radio' ? this.get_radio_field( field ) :
664
+ ( field.type === 'url' || field.type === 'imageurl' ? this.get_url_field( field ) :
665
+ ( field.type === 'date' || field.type === 'birthday' ? this.get_date_field( field ) :
666
+ this.get_default_field( field ) ) ) ) )
667
+ }
668
+
669
+ { field.description_above !== '1' && field.description.length > 0 && desc }
670
+
671
+ </label>
672
+ )
673
+ }
674
+ } else {
675
+
676
+ var desc = field.description.length > 0 ?
677
+ <p className="form-field-description" id={ "form-field-description-" + field.group_id } key={ "form-field-description-" + field.group_id }>{ field.description }</p>
678
+ : '';
679
+
680
+ var label = field['hide-label'] !== '1' ?
681
+ <span key={ field.group_id + "-label-span-key" } className={ field.group_id + "-label checkbox-parent-label" }>{ field.label }</span>
682
+ : '';
683
+
684
+ var classes = { 'yikes-mailchimp-field-required' : field.require === '1' }
685
+ classes[ field.group_id + '-label'] = true;
686
+
687
+ return (
688
+ <label
689
+ htmlFor={ field.group_id }
690
+ className= { classes }
691
+ key={ field.group_id + "-label-span-key" }
692
+ style={ field.type === 'hidden' || field.hide === '1' ? { 'display': 'none' } : {} }
693
+ >
694
+
695
+ { label }
696
+
697
+ { field.description_above === '1' && field.description.length > 0 && desc }
698
+
699
+ {
700
+ ( field.type === 'radio' ? this.get_radio_interest_group( field ) :
701
+ ( field.type === 'hidden' ? this.get_hidden_interest_group( field ) :
702
+ ( field.type === 'checkboxes' ? this.get_checkboxes_interest_group( field ) :
703
+ ( field.type === 'dropdown' ? this.get_dropdown_interest_group( field ) : '' ) ) ) )
704
+ }
705
+
706
+ { field.description_above !== '1' && field.description.length > 0 && desc }
707
+
708
+ </label>
709
+ )
710
+ }
711
+ })
712
+ : '';
713
+ }
714
+
715
+ form_recaptcha() {
716
+
717
+ return this.state.recaptcha_data.success === true && this.state.recaptcha_data.data.site_key && this.props.recaptcha === true ?
718
+ <Recaptcha
719
+ sitekey={ this.state.recaptcha_data.data.site_key }
720
+ key={ 'easy-forms-recaptcha-1' }
721
+ elementID={ 'google-recaptcha-id-' + Math.random().toString(36).slice(-8) } // Need to use a unique ID for multiple reCAPTCHAs to work on the same page.
722
+ theme={ this.props.recaptchaTheme }
723
+ hl={ this.props.recaptchaLang.length > 0 ? this.props.recaptchaLang : this.state.recaptcha_data.data.locale }
724
+ type={ this.props.recaptchaType }
725
+ size={ this.props.recaptchaSize }
726
+ verifyCallback=''
727
+ expiredCallback=''
728
+ />
729
+ : '';
730
+ }
731
+
732
+ submit_button() {
733
+ return this.props.formData && this.props.formData.fields ?
734
+ ( this.props.focus && this.props.formData.form_settings['yikes-easy-mc-submit-button-type'] === 'text' ?
735
+ <button
736
+ type="submit"
737
+ key="mailchimpSubmitButton"
738
+ className={ "yikes-easy-mc-submit-button yikes-easy-mc-submit-button-" + this.props.formID + " btn btn-primary" + " " + this.props.formData.form_settings['yikes-easy-mc-submit-button-classes'] }
739
+ >
740
+ <PlainText
741
+ className="yikes-mailchimp-submit-button-span-text"
742
+ key="yikes-mailchimp-submit-button-span-text"
743
+ value={ this.props.submitButtonText ? this.props.submitButtonText : '' }
744
+ onChange={ this.props.toggleSubmitButtonText }
745
+ />
746
+ </button>
747
+ :
748
+ ( this.props.formData.form_settings['yikes-easy-mc-submit-button-type'] === 'text' ?
749
+ <button
750
+ type="submit"
751
+ key="mailchimpSubmitButton"
752
+ className={ "yikes-easy-mc-submit-button yikes-easy-mc-submit-button-" + this.props.formID + " btn btn-primary" + " " + this.props.formData.form_settings['yikes-easy-mc-submit-button-classes'] }
753
+ >
754
+ <span className="yikes-mailchimp-submit-button-span-text" key="yikes-mailchimp-submit-button-span-text">{ this.props.submitButtonText }</span>
755
+ </button>
756
+ :
757
+ <input
758
+ type="image"
759
+ alt={ this.props.submitButtonText }
760
+ src={ this.props.formData.form_settings['yikes-easy-mc-submit-button-image'] }
761
+ className={ "yikes-easy-mc-submit-button yikes-easy-mc-submit-button-image yikes-easy-mc-submit-button-" + this.props.formID + " btn btn-primary" + " " + this.props.formData.form_settings['yikes-easy-mc-submit-button-classes'] }
762
+ />
763
+ )
764
+ )
765
+ : '';
766
+ }
767
+
768
+ get_form_section() {
769
+ return (
770
+ <section
771
+ id={ "yikes-mailchimp-container-" + this.props.formID }
772
+ className={ "yikes-mailchimp-container yikes-mailchimp-container-" + this.props.formID }
773
+ key="yikes-mailchimp-container-section"
774
+ >
775
+ {[
776
+
777
+ // Form title
778
+ [this.form_title()],
779
+
780
+ // Form Description
781
+ [this.form_description()],
782
+
783
+ // Get the form
784
+ [this.get_form()]
785
+ ]}
786
+ </section>
787
+ );
788
+ }
789
+
790
+ get_form() {
791
+ return (
792
+ // Form Wrapper
793
+ <form
794
+ id={ slugify( this.props.formTitle ) + '-' + this.props.formID }
795
+ className={ "yikes-easy-mc-form yikes-easy-mc-form-" + this.props.formID + " " + this.props.formData.form_settings['yikes-easy-mc-form-class-names'] }
796
+ key="yikes-mailchimp-container-form"
797
+ >
798
+ {[
799
+
800
+ // Form fields
801
+ [this.form_fields()],
802
+
803
+ // Recaptcha
804
+ [this.form_recaptcha()],
805
+
806
+ // Submit button
807
+ [this.submit_button()]
808
+ ]}
809
+ </form>
810
+ );
811
+ }
812
+
813
+ render() {
814
+
815
+ if ( this.state.forms.length > 0 && this.props.formData && Object.keys( this.props.formData ).length > 0 ) {
816
+
817
+ return (
818
+
819
+ <div className={ this.props.className }>
820
+
821
+ {// Show inspector controls when focused
822
+ this.props.focus && this.inspector_controls()}
823
+
824
+ {// Show the forms dropdown
825
+ this.forms_dropdown()}
826
+
827
+ <hr key="easy-forms-dropdown-divider"/>
828
+
829
+ {// Show the form
830
+ this.get_form_section()}
831
+ </div>
832
+
833
+ );
834
+
835
+ } else if ( this.state.forms.length > 0 ) {
836
+
837
+ // If we don't have form data, show the forms dropdown
838
+ return (
839
+ <div className={ this.props.className }>
840
+ {this.forms_dropdown()}
841
+ </div>
842
+ );
843
+
844
+ } else if ( this.state.api_key_status !== 'valid' ) {
845
+
846
+ // If the API key is invalid, show a message.
847
+ return (
848
+ <p className="yikes-mailchimp-api-key-warning" key="yikes-mailchimp-api-key-warning">
849
+ <em>{ this.state.api_key_status === 'empty' ? <a href={ constants.settings_url }> { __( 'To use this block, please enter an API key on the Easy Forms\' settings page.' ) } </a> : __( 'Your API key is invalid.' ) }</em>
850
+ </p>
851
+ );
852
+ } else if ( this.state.forms_loaded === true && this.state.forms.length === 0 ) {
853
+
854
+ // No forms.
855
+ return (
856
+ <p key="no-forms-found" className={ this.props.className }>
857
+ <em>{ __( 'No forms were found.' ) }</em>
858
+ </p>
859
+ );
860
+ } else {
861
+
862
+ // Show loading... & spinner.
863
+ return (
864
+ <p key="loading-easy-forms" className={ this.props.className }>
865
+ <span key="yikes-easy-forms-loading-text">{ __( 'Loading...' ) }</span>
866
+ <Spinner key="yikes-easy-forms-loading-spinner" />
867
+ </p>
868
+ );
869
+ }
870
+ }
871
+ }
blocks/easy-forms-block/src/components/constants.js ADDED
@@ -0,0 +1,390 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const constants = {
2
+ states: {
3
+ '': '—',
4
+ 'AL': 'Alabama',
5
+ 'AK': 'Alaska',
6
+ 'AZ': 'Arizona',
7
+ 'AR': 'Arkansas',
8
+ 'CA': 'California',
9
+ 'CO': 'Colorado',
10
+ 'CT': 'Connecticut',
11
+ 'DE': 'Delaware',
12
+ 'DC': 'District Of Columbia',
13
+ 'FL': 'Florida',
14
+ 'GA': 'Georgia',
15
+ 'HI': 'Hawaii',
16
+ 'ID': 'Idaho',
17
+ 'IL': 'Illinois',
18
+ 'IN': 'Indiana',
19
+ 'IA': 'Iowa',
20
+ 'KS': 'Kansas',
21
+ 'KY': 'Kentucky',
22
+ 'LA': 'Louisiana',
23
+ 'ME': 'Maine',
24
+ 'MD': 'Maryland',
25
+ 'MA': 'Massachusetts',
26
+ 'MI': 'Michigan',
27
+ 'MN': 'Minnesota',
28
+ 'MS': 'Mississippi',
29
+ 'MO': 'Missouri',
30
+ 'MT': 'Montana',
31
+ 'NE': 'Nebraska',
32
+ 'NV': 'Nevada',
33
+ 'NH': 'New Hampshire',
34
+ 'NJ': 'New Jersey',
35
+ 'NM': 'New Mexico',
36
+ 'NY': 'New York',
37
+ 'NC': 'North Carolina',
38
+ 'ND': 'North Dakota',
39
+ 'OH': 'Ohio',
40
+ 'OK': 'Oklahoma',
41
+ 'OR': 'Oregon',
42
+ 'PA': 'Pennsylvania',
43
+ 'RI': 'Rhode Island',
44
+ 'SC': 'South Carolina',
45
+ 'SD': 'South Dakota',
46
+ 'TN': 'Tennessee',
47
+ 'TX': 'Texas',
48
+ 'UT': 'Utah',
49
+ 'VT': 'Vermont',
50
+ 'VA': 'Virginia',
51
+ 'WA': 'Washington',
52
+ 'WV': 'West Virginia',
53
+ 'WI': 'Wisconsin',
54
+ 'WY': 'Wyoming',
55
+ 'AB': 'Alberta',
56
+ 'BC': 'British Columbia',
57
+ 'MB': 'Manitoba',
58
+ 'NB': 'New Brunswick',
59
+ 'NL': 'Newfoundland and Labrador',
60
+ 'NS': 'Nova Scotia',
61
+ 'ON': 'Ontario',
62
+ 'PE': 'Prince Edward Island',
63
+ 'QC': 'Quebec',
64
+ 'SK': 'Saskatchewan',
65
+ 'NT': 'Northwest Territories',
66
+ 'NU': 'Nunavut',
67
+ 'YT': 'Yukon',
68
+ },
69
+ countries: {
70
+ 'US': 'United States',
71
+ 'GB': 'United Kingdom',
72
+ 'AF': 'Afghanistan',
73
+ 'AX': 'Aland Islands',
74
+ 'AL': 'Albania',
75
+ 'DZ': 'Algeria',
76
+ 'AS': 'American Samoa',
77
+ 'AD': 'Andorra',
78
+ 'AO': 'Angola',
79
+ 'AI': 'Anguilla',
80
+ 'AQ': 'Antarctica',
81
+ 'AG': 'Antigua and Barbuda',
82
+ 'AR': 'Argentina',
83
+ 'AM': 'Armenia',
84
+ 'AW': 'Aruba',
85
+ 'AU': 'Australia',
86
+ 'AT': 'Austria',
87
+ 'AZ': 'Azerbaijan',
88
+ 'BS': 'Bahamas',
89
+ 'BH': 'Bahrain',
90
+ 'BD': 'Bangladesh',
91
+ 'BB': 'Barbados',
92
+ 'BY': 'Belarus',
93
+ 'BE': 'Belgium',
94
+ 'BZ': 'Belize',
95
+ 'BJ': 'Benin',
96
+ 'BM': 'Bermuda',
97
+ 'BT': 'Bhutan',
98
+ 'BO': 'Bolivia',
99
+ 'BA': 'Bosnia and Herzegovina',
100
+ 'BW': 'Botswana',
101
+ 'BV': 'Bouvet Island',
102
+ 'BR': 'Brazil',
103
+ 'IO': 'British Indian Ocean Territory',
104
+ 'BN': 'Brunei Darussalam',
105
+ 'BG': 'Bulgaria',
106
+ 'BF': 'Burkina Faso',
107
+ 'BI': 'Burundi',
108
+ 'KH': 'Cambodia',
109
+ 'CM': 'Cameroon',
110
+ 'CA': 'Canada',
111
+ 'CV': 'Cape Verde',
112
+ 'KY': 'Cayman Islands',
113
+ 'CF': 'Central African Republic',
114
+ 'TD': 'Chad',
115
+ 'CL': 'Chile',
116
+ 'CN': 'China',
117
+ 'CX': 'Christmas Island',
118
+ 'CC': 'Cocos (Keeling) Islands',
119
+ 'CO': 'Colombia',
120
+ 'KM': 'Comoros',
121
+ 'CG': 'Congo',
122
+ 'CD': 'Congo, The Democratic Republic of The',
123
+ 'CK': 'Cook Islands',
124
+ 'CR': 'Costa Rica',
125
+ 'CI': 'Cote D’ivoire',
126
+ 'HR': 'Croatia',
127
+ 'CU': 'Cuba',
128
+ 'CY': 'Cyprus',
129
+ 'CZ': 'Czech Republic',
130
+ 'DK': 'Denmark',
131
+ 'DJ': 'Djibouti',
132
+ 'DM': 'Dominica',
133
+ 'DO': 'Dominican Republic',
134
+ 'EC': 'Ecuador',
135
+ 'EG': 'Egypt',
136
+ 'SV': 'El Salvador',
137
+ 'GQ': 'Equatorial Guinea',
138
+ 'ER': 'Eritrea',
139
+ 'EE': 'Estonia',
140
+ 'ET': 'Ethiopia',
141
+ 'FK': 'Falkland Islands (Malvinas)',
142
+ 'FO': 'Faroe Islands',
143
+ 'FJ': 'Fiji',
144
+ 'FI': 'Finland',
145
+ 'FR': 'France',
146
+ 'GF': 'French Guiana',
147
+ 'PF': 'French Polynesia',
148
+ 'TF': 'French Southern Territories',
149
+ 'GA': 'Gabon',
150
+ 'GM': 'Gambia',
151
+ 'GE': 'Georgia',
152
+ 'DE': 'Germany',
153
+ 'GH': 'Ghana',
154
+ 'GI': 'Gibraltar',
155
+ 'GR': 'Greece',
156
+ 'GL': 'Greenland',
157
+ 'GD': 'Grenada',
158
+ 'GP': 'Guadeloupe',
159
+ 'GU': 'Guam',
160
+ 'GT': 'Guatemala',
161
+ 'GG': 'Guernsey',
162
+ 'GN': 'Guinea',
163
+ 'GW': 'Guinea-bissau',
164
+ 'GY': 'Guyana',
165
+ 'HT': 'Haiti',
166
+ 'HM': 'Heard Island and Mcdonald Islands',
167
+ 'VA': 'Holy See (Vatican City State)',
168
+ 'HN': 'Honduras',
169
+ 'HK': 'Hong Kong',
170
+ 'HU': 'Hungary',
171
+ 'IS': 'Iceland',
172
+ 'IN': 'India',
173
+ 'ID': 'Indonesia',
174
+ 'IR': 'Iran, Islamic Republic of',
175
+ 'IQ': 'Iraq',
176
+ 'IE': 'Ireland',
177
+ 'IM': 'Isle of Man',
178
+ 'IL': 'Israel',
179
+ 'IT': 'Italy',
180
+ 'JM': 'Jamaica',
181
+ 'JP': 'Japan',
182
+ 'JE': 'Jersey',
183
+ 'JO': 'Jordan',
184
+ 'KZ': 'Kazakhstan',
185
+ 'KE': 'Kenya',
186
+ 'KI': 'Kiribati',
187
+ 'KP': 'Korea, Democratic People’s Republic of',
188
+ 'KR': 'Korea, Republic of',
189
+ 'KW': 'Kuwait',
190
+ 'KG': 'Kyrgyzstan',
191
+ 'LA': 'Lao People’s Democratic Republic',
192
+ 'LV': 'Latvia',
193
+ 'LB': 'Lebanon',
194
+ 'LS': 'Lesotho',
195
+ 'LR': 'Liberia',
196
+ 'LY': 'Libyan Arab Jamahiriya',
197
+ 'LI': 'Liechtenstein',
198
+ 'LT': 'Lithuania',
199
+ 'LU': 'Luxembourg',
200
+ 'MO': 'Macao',
201
+ 'MK': 'Macedonia, The Former Yugoslav Republic of',
202
+ 'MG': 'Madagascar',
203
+ 'MW': 'Malawi',
204
+ 'MY': 'Malaysia',
205
+ 'MV': 'Maldives',
206
+ 'ML': 'Mali',
207
+ 'MT': 'Malta',
208
+ 'MH': 'Marshall Islands',
209
+ 'MQ': 'Martinique',
210
+ 'MR': 'Mauritania',
211
+ 'MU': 'Mauritius',
212
+ 'YT': 'Mayotte',
213
+ 'MX': 'Mexico',
214
+ 'FM': 'Micronesia, Federated States of',
215
+ 'MD': 'Moldova, Republic of',
216
+ 'MC': 'Monaco',
217
+ 'MN': 'Mongolia',
218
+ 'ME': 'Montenegro',
219
+ 'MS': 'Montserrat',
220
+ 'MA': 'Morocco',
221
+ 'MZ': 'Mozambique',
222
+ 'MM': 'Myanmar',
223
+ 'NA': 'Namibia',
224
+ 'NR': 'Nauru',
225
+ 'NP': 'Nepal',
226
+ 'NL': 'Netherlands',
227
+ 'AN': 'Netherlands Antilles',
228
+ 'NC': 'New Caledonia',
229
+ 'NZ': 'New Zealand',
230
+ 'NI': 'Nicaragua',
231
+ 'NE': 'Niger',
232
+ 'NG': 'Nigeria',
233
+ 'NU': 'Niue',
234
+ 'NF': 'Norfolk Island',
235
+ 'MP': 'Northern Mariana Islands',
236
+ 'NO': 'Norway',
237
+ 'OM': 'Oman',
238
+ 'PK': 'Pakistan',
239
+ 'PW': 'Palau',
240
+ 'PS': 'Palestinian Territory, Occupied',
241
+ 'PA': 'Panama',
242
+ 'PG': 'Papua New Guinea',
243
+ 'PY': 'Paraguay',
244
+ 'PE': 'Peru',
245
+ 'PH': 'Philippines',
246
+ 'PN': 'Pitcairn',
247
+ 'PL': 'Poland',
248
+ 'PT': 'Portugal',
249
+ 'PR': 'Puerto Rico',
250
+ 'QA': 'Qatar',
251
+ 'RE': 'Reunion',
252
+ 'RO': 'Romania',
253
+ 'RU': 'Russian Federation',
254
+ 'RW': 'Rwanda',
255
+ 'SH': 'Saint Helena',
256
+ 'KN': 'Saint Kitts and Nevis',
257
+ 'LC': 'Saint Lucia',
258
+ 'PM': 'Saint Pierre and Miquelon',
259
+ 'VC': 'Saint Vincent and The Grenadines',
260
+ 'WS': 'Samoa',
261
+ 'SM': 'San Marino',
262
+ 'ST': 'Sao Tome and Principe',
263
+ 'SA': 'Saudi Arabia',
264
+ 'SN': 'Senegal',
265
+ 'RS': 'Serbia',
266
+ 'SC': 'Seychelles',
267
+ 'SL': 'Sierra Leone',
268
+ 'SG': 'Singapore',
269
+ 'SK': 'Slovakia',
270
+ 'SI': 'Slovenia',
271
+ 'SB': 'Solomon Islands',
272
+ 'SO': 'Somalia',
273
+ 'ZA': 'South Africa',
274
+ 'GS': 'South Georgia and The South Sandwich Islands',
275
+ 'ES': 'Spain',
276
+ 'LK': 'Sri Lanka',
277
+ 'SD': 'Sudan',
278
+ 'SR': 'Suriname',
279
+ 'SJ': 'Svalbard and Jan Mayen',
280
+ 'SZ': 'Swaziland',
281
+ 'SE': 'Sweden',
282
+ 'CH': 'Switzerland',
283
+ 'SY': 'Syrian Arab Republic',
284
+ 'TW': 'Taiwan, Province of China',
285
+ 'TJ': 'Tajikistan',
286
+ 'TZ': 'Tanzania, United Republic of',
287
+ 'TH': 'Thailand',
288
+ 'TL': 'Timor-leste',
289
+ 'TG': 'Togo',
290
+ 'TK': 'Tokelau',
291
+ 'TO': 'Tonga',
292
+ 'TT': 'Trinidad and Tobago',
293
+ 'TN': 'Tunisia',
294
+ 'TR': 'Turkey',
295
+ 'TM': 'Turkmenistan',
296
+ 'TC': 'Turks and Caicos Islands',
297
+ 'TV': 'Tuvalu',
298
+ 'UG': 'Uganda',
299
+ 'UA': 'Ukraine',
300
+ 'AE': 'United Arab Emirates',
301
+ 'UM': 'United States Minor Outlying Islands',
302
+ 'UY': 'Uruguay',
303
+ 'UZ': 'Uzbekistan',
304
+ 'VU': 'Vanuatu',
305
+ 'VE': 'Venezuela',
306
+ 'VN': 'Viet Nam',
307
+ 'VG': 'Virgin Islands, British',
308
+ 'VI': 'Virgin Islands, U.S.',
309
+ 'WF': 'Wallis and Futuna',
310
+ 'EH': 'Western Sahara',
311
+ 'YE': 'Yemen',
312
+ 'ZM': 'Zambia',
313
+ 'ZW': 'Zimbabwe',
314
+ },
315
+ locales: {
316
+ "ar" : "Arabic",
317
+ "af" : "Afrikaans",
318
+ "am" : "Amharic",
319
+ "hy" : "Armenian",
320
+ "az" : "Azerbaijani",
321
+ "eu" : "Basque",
322
+ "bn" : "Bengali",
323
+ "bg" : "Bulgarian",
324
+ "ca" : "Catalan",
325
+ "zh-HK" : "Chinese (Hong Kong)",
326
+ "zh-CN" : "Chinese (Simplified)",
327
+ "zh-TW" : "Chinese (Traditional)",
328
+ "hr" : "Croatian",
329
+ "cs" : "Czech",
330
+ "da" : "Danish",
331
+ "nl" : "Dutch",
332
+ "en-GB" : "English (UK)",
333
+ "en" : "English (US)",
334
+ "et" : "Estonian",
335
+ "fil" : "Filipino",
336
+ "fi" : "Finnish",
337
+ "fr" : "French",
338
+ "fr-CA" : "French (Canadian)",
339
+ "gl" : "Galician",
340
+ "ka" : "Georgian",
341
+ "de" : "German",
342
+ "de-AT" : "German (Austria)",
343
+ "de-CH" : "German (Switzerland)",
344
+ "el" : "Greek",
345
+ "gu" : "Gujarati",
346
+ "iw" : "Hebrew",
347
+ "hi" : "Hindi",
348
+ "hu" : "Hungarain",
349
+ "is" : "Icelandic",
350
+ "id" : "Indonesian",
351
+ "it" : "Italian",
352
+ "ja" : "Japanese",
353
+ "kn" : "Kannada",
354
+ "ko" : "Korean",
355
+ "lo" : "Laothian",
356
+ "lv" : "Latvian",
357
+ "lt" : "Lithuanian",
358
+ "ms" : "Malay",
359
+ "ml" : "Malayalam",
360
+ "mr" : "Marathi",
361
+ "mn" : "Mongolian",
362
+ "no" : "Norwegian",
363
+ "fa" : "Persian",
364
+ "pl" : "Polish",
365
+ "pt" : "Portuguese",
366
+ "pt-BR" : "Portuguese (Brazil)",
367
+ "pt-PT" : "Portuguese (Portugal)",
368
+ "ro" : "Romanian",
369
+ "ru" : "Russian",
370
+ "sr" : "Serbian",
371
+ "si" : "Sinhalese",
372
+ "sk" : "Slovak",
373
+ "sl" : "Slovenian",
374
+ "es" : "Spanish",
375
+ "es-419" : "Spanish (Latin America)",
376
+ "sw" : "Swahili",
377
+ "sv" : "Swedish",
378
+ "ta" : "Tamil",
379
+ "te" : "Telugu",
380
+ "th" : "Thai",
381
+ "tr" : "Turkish",
382
+ "uk" : "Ukrainian",
383
+ "ur" : "Urdu",
384
+ "vi" : "Vietnamese",
385
+ "zu" : "Zulu"
386
+ },
387
+ settings_url: 'wp-admin/admin.php?page=yikes-inc-easy-mailchimp-settings'
388
+ }
389
+
390
+ export default constants;
blocks/easy-forms-block/src/components/enable-submit-button-editing.js ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $ ) {
2
+
3
+ $( document ).ready( function() {
4
+
5
+ $( 'body' ).on( 'click', '.yikes-easy-mc-submit-button', function( event ) {
6
+ event.preventDefault();
7
+ event.stopPropagation();
8
+ $( '.yikes-mailchimp-submit-button-span-text' ).focus();
9
+ });
10
+
11
+ $( 'body' ).on( 'click', '.yikes-mailchimp-submit-button-span-text', function( event ) {
12
+ event.preventDefault();
13
+ event.stopPropagation();
14
+ });
15
+ });
16
+
17
+ })( jQuery );
blocks/easy-forms-block/src/components/slugify.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * This should have the same effect as WP/PHP's `sanitize_title()` function
3
+ *
4
+ * Source: https://gist.github.com/mathewbyrne/1280286
5
+ */
6
+ export default function slugify( text ) {
7
+
8
+ // Use hash map for special characters
9
+ let specialChars = {"à":'a',"ä":'a',"á":'a',"â":'a',"æ":'a',"å":'a',"ë":'e',"è":'e',"é":'e', "ê":'e',"î":'i',"ï":'i',"ì":'i',"í":'i',"ò":'o',"ó":'o',"ö":'o',"ô":'o',"ø":'o',"ù":'o',"ú":'u',"ü":'u',"û":'u',"ñ":'n',"ç":'c',"ß":'s',"ÿ":'y',"œ":'o',"ŕ":'r',"ś":'s',"ń":'n',"ṕ":'p',"ẃ":'w',"ǵ":'g',"ǹ":'n',"ḿ":'m',"ǘ":'u',"ẍ":'x',"ź":'z',"ḧ":'h',"·":'-',"/":'-',"_":'-',",":'-',":":'-',";":'-'};
10
+
11
+ return text.toString().toLowerCase()
12
+ .replace(/\s+/g, '-') // Replace spaces with -
13
+ .replace(/./g,(target, index, str) => specialChars[target] || target) // Replace special characters using the hash map
14
+ .replace(/&/g, '-and-') // Replace & with 'and'
15
+ .replace(/[^\w\-]+/g, '') // Remove all non-word chars
16
+ .replace(/\-\-+/g, '-') // Replace multiple - with single -
17
+ .replace(/^-+/, '') // Trim - from start of text
18
+ .replace(/-+$/, ''); // Trim - from end of text
19
+ };
blocks/easy-forms-block/src/easy-forms-block.js ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import EasyFormsAPI from './components/api.js'
2
+
3
+ import MailchimpForms from './components/class.MailchimpForms.js';
4
+
5
+ import '../css/easy-forms-block.scss'
6
+
7
+ require( './components/enable-submit-button-editing.js' );
8
+
9
+ // Get just the __() localization function from wp.i18n
10
+ const { __ } = wp.i18n;
11
+
12
+ // Get registerBlockType and other methods from wp.blocks
13
+ const { registerBlockType } = wp.blocks;
14
+
15
+ const edit_easy_form = function( props ) {
16
+
17
+ const onChangeForm = ( event ) => {
18
+ props.setAttributes( { form_id: event.target.value } );
19
+
20
+ if ( event.target.value.length > 0 ) {
21
+ const api = new EasyFormsAPI();
22
+ api.get_form( event.target.value ).then( function( form ) {
23
+ props.setAttributes( { form: form.data } );
24
+ props.setAttributes( { form_description: form.data.form_description } );
25
+ props.setAttributes( { form_title: form.data.form_name } );
26
+ props.setAttributes( { is_ajax: form.data.submission_settings.ajax === '1' } );
27
+ props.setAttributes( { submit_button_text: form.data.form_settings['yikes-easy-mc-submit-button-text'] } );
28
+ });
29
+ }
30
+ };
31
+
32
+ const onChangeDescription = ( value ) => {
33
+ props.setAttributes( { form_description: value } );
34
+ };
35
+
36
+ const toggleShowDescription = ( event ) => {
37
+ props.setAttributes( { show_description: !! event.target.checked } );
38
+ }
39
+
40
+ const toggleInline = ( event ) => {
41
+ props.setAttributes( { inline: !! event.target.checked } );
42
+ }
43
+
44
+ const toggleShowTitle = ( event ) => {
45
+ props.setAttributes( { show_title: !! event.target.checked } );
46
+ }
47
+
48
+ const toggleFormTitle = ( value ) => {
49
+ props.setAttributes( { form_title: value } );
50
+ }
51
+
52
+ const toggleIsAjax = ( event ) => {
53
+ props.setAttributes( { is_ajax: !! event.target.checked } );
54
+ }
55
+
56
+ /* Allow this function to be called via a checkbox handler or directly by passing in a boolean */
57
+ const toggleRecaptchaAbstract = ( checked ) => {
58
+ props.setAttributes( { recaptcha: checked } );
59
+ }
60
+
61
+ const toggleRecaptcha = ( event ) => {
62
+ toggleRecaptchaAbstract( !! event.target.checked )
63
+ }
64
+
65
+ const toggleRecaptchaTheme = ( value ) => {
66
+ props.setAttributes( { recaptcha_theme: value } );
67
+ }
68
+
69
+ const toggleRecaptchaLang = ( value ) => {
70
+ props.setAttributes( { recaptcha_lang: value } );
71
+ }
72
+
73
+ const toggleRecaptchaType = ( value ) => {
74
+ props.setAttributes( { recaptcha_type: value } );
75
+ }
76
+
77
+ const toggleRecaptchaSize = ( value ) => {
78
+ props.setAttributes( { recaptcha_size: value } );
79
+ }
80
+
81
+ const toggleRecaptchaVerifyCallback = ( value ) => {
82
+ props.setAttributes( { recaptcha_verify_callback: value } );
83
+ }
84
+
85
+ const toggleRecaptchaExpiredCallback = ( value ) => {
86
+ props.setAttributes( { recaptcha_expired_callback: value } );
87
+ }
88
+
89
+ const toggleSubmitButtonText = ( value ) => {
90
+ props.setAttributes( { submit_button_text: value })
91
+ }
92
+
93
+ return (
94
+ <MailchimpForms
95
+ className={ props.className }
96
+ onChangeForm={ onChangeForm }
97
+ formID={ props.attributes.form_id }
98
+ formData={ props.attributes.form }
99
+ onChangeDescription={ onChangeDescription }
100
+ descriptionValue={ props.attributes.form_description }
101
+ showDescription={ props.attributes.show_description }
102
+ toggleShowDescription={ toggleShowDescription }
103
+ focus={ !! props.isSelected }
104
+ inline={ props.attributes.inline }
105
+ toggleInline={ toggleInline }
106
+ formTitle={ props.attributes.form_title }
107
+ toggleFormTitle={ toggleFormTitle }
108
+ showTitle={ props.attributes.show_title }
109
+ toggleShowTitle={ toggleShowTitle }
110
+ isAjax={ props.attributes.is_ajax }
111
+ toggleIsAjax={ toggleIsAjax }
112
+ toggleRecaptchaAbstract={ toggleRecaptchaAbstract }
113
+ recaptcha={ props.attributes.recaptcha }
114
+ toggleRecaptcha={ toggleRecaptcha }
115
+ recaptchaTheme={ props.attributes.recaptcha_theme }
116
+ toggleRecaptchaTheme={ toggleRecaptchaTheme }
117
+ recaptchaLang={ props.attributes.recaptcha_lang }
118
+ toggleRecaptchaLang={ toggleRecaptchaLang }
119
+ recaptchaType={ props.attributes.recaptcha_type }
120
+ toggleRecaptchaType={ toggleRecaptchaType }
121
+ recaptchaSize={ props.attributes.recaptcha_size }
122
+ toggleRecaptchaSize={ toggleRecaptchaSize }
123
+ recaptchaVerifyCallback={ props.attributes.recaptcha_verify_callback }
124
+ toggleRecaptchaVerifyCallback={ toggleRecaptchaVerifyCallback }
125
+ recaptchaExpiredCallback={ props.attributes.recaptcha_expired_callback }
126
+ toggleRecaptchaExpiredCallback={ toggleRecaptchaExpiredCallback }
127
+ submitButtonText={ props.attributes.submit_button_text }
128
+ toggleSubmitButtonText={ toggleSubmitButtonText }
129
+ />
130
+ );
131
+
132
+ }
133
+
134
+ const save_easy_form = function( props ) {
135
+ return null;
136
+ }
137
+
138
+ const settings = {
139
+ title : __( 'Easy Forms for Mailchimp' ),
140
+ category : 'easy-forms', // Options include "common", "formatting", "layout", "widgets" and "embed."
141
+ icon : 'email-alt',
142
+ keywords : ['mailchimp', 'easy forms for mailchimp', 'yikes'],
143
+ attributes: {
144
+ form_id: {
145
+ type: 'string',
146
+ default: ''
147
+ },
148
+ form: {
149
+ type: 'object'
150
+ },
151
+ form_description: {
152
+ type: 'string',
153
+ default: ''
154
+ },
155
+ show_description: {
156
+ type: 'boolean',
157
+ default: false
158
+ },
159
+ inline: {
160
+ type: 'boolean',
161
+ default: false
162
+ },
163
+ show_title: {
164
+ type: 'boolean',
165
+ default: false
166
+ },
167
+ form_title: {
168
+ type: 'string',
169
+ default: ''
170
+ },
171
+ is_ajax: {
172
+ type: 'boolean',
173
+ default: true,
174
+ },
175
+ recaptcha: {
176
+ type: 'boolean',
177
+ default: false,
178
+ },
179
+ recaptcha_theme: {
180
+ type: 'string',
181
+ default: 'light'
182
+ },
183
+ recaptcha_lang: {
184
+ type: 'string',
185
+ default: ''
186
+ },
187
+ recaptcha_type: {
188
+ type: 'string',
189
+ default: 'image'
190
+ },
191
+ recaptcha_size: {
192
+ type: 'string',
193
+ default: 'normal'
194
+ },
195
+ recaptcha_verify_callback: {
196
+ type: 'string',
197
+ default: ''
198
+ },
199
+ recaptcha_expired_callback: {
200
+ type: 'string',
201
+ default: ''
202
+ },
203
+ submit_button_text: {
204
+ type: 'string',
205
+ default: ''
206
+ }
207
+ },
208
+ edit: edit_easy_form,
209
+ save: save_easy_form,
210
+ }
211
+
212
+ const EasyFormsBlock = registerBlockType(
213
+
214
+ // Name
215
+ ez_forms_gb_data.block_namespace + ez_forms_gb_data.block_name,
216
+
217
+ // Settings
218
+
219
+ settings
220
+ );
blocks/easy-forms-block/src/index.js ADDED
@@ -0,0 +1 @@
 
1
+ import './easy-forms-block.js';
blocks/easy-forms-block/webpack.config.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const path = require('path');
2
+ const defaultConfig = require('@wordpress/scripts/config/webpack.config');
3
+ const MiniCssExtractPlugin = require( 'mini-css-extract-plugin' );
4
+
5
+ const ENTRY = path.resolve( __dirname, 'src/index.js' );
6
+ const BUNDLE = path.resolve( __dirname, 'build' );
7
+
8
+ module.exports = {
9
+ ...defaultConfig,
10
+ entry: ENTRY,
11
+ output: {
12
+ filename: 'easy-forms-blocks.js',
13
+ path: BUNDLE,
14
+ },
15
+ module: {
16
+ ...defaultConfig.module,
17
+ rules: [
18
+ ...defaultConfig.module.rules,
19
+ {
20
+ test: /\.s[ac]ss$/i,
21
+ use: [
22
+ // Creates `style` nodes from JS strings
23
+ MiniCssExtractPlugin.loader,
24
+ // Translates CSS into CommonJS
25
+ 'css-loader',
26
+ // Compiles Sass to CSS
27
+ 'sass-loader',
28
+ ],
29
+ }
30
+ ]
31
+ },
32
+ plugins: [
33
+ ...defaultConfig.plugins,
34
+ new MiniCssExtractPlugin( {
35
+ filename: 'style.css',
36
+ } ),
37
+ ]
38
+ };
public/partials/shortcodes/process/process_form_submission.php CHANGED
@@ -248,6 +248,10 @@ if ( is_wp_error( $member_exists ) || $double_optin_resubscribe === true ) {
248
  $member_data = apply_filters( 'yikes-mailchimp-filter-subscribe-request', $member_data, $form_id );
249
  $member_data = apply_filters( "yikes-mailchimp-filter-subscribe-request-{$form_id}", $member_data, $form_id );
250
 
 
 
 
 
251
  // Send the API request to create a new subscriber! (Or update an existing one)
252
  $subscribe_response = $list_handler->member_subscribe( $list_id, md5( $sanitized_email ), $member_data );
253
 
@@ -258,9 +262,6 @@ if ( is_wp_error( $subscribe_response ) ) {
258
  $success_array = $submission_handler->handle_submission_response_error( $subscribe_response, $form_fields );
259
  } else {
260
 
261
- // Check if we have any tags to add.
262
- $tags_response = $submission_handler->maybe_add_tags( $form_data, $data );
263
-
264
  $submission_handler->handle_submission_response_success( $submission_settings, array(), $merge_variables, $notifications, $optin_settings, $new_subscriber );
265
  }
266
 
248
  $member_data = apply_filters( 'yikes-mailchimp-filter-subscribe-request', $member_data, $form_id );
249
  $member_data = apply_filters( "yikes-mailchimp-filter-subscribe-request-{$form_id}", $member_data, $form_id );
250
 
251
+ foreach( $form_data['tags'] as $tag ) {
252
+ $member_data['tags'][] = $tag['name'];
253
+ }
254
+
255
  // Send the API request to create a new subscriber! (Or update an existing one)
256
  $subscribe_response = $list_handler->member_subscribe( $list_id, md5( $sanitized_email ), $member_data );
257
 
262
  $success_array = $submission_handler->handle_submission_response_error( $subscribe_response, $form_fields );
263
  } else {
264
 
 
 
 
265
  $submission_handler->handle_submission_response_success( $submission_settings, array(), $merge_variables, $notifications, $optin_settings, $new_subscriber );
266
  }
267
 
public/partials/shortcodes/process/process_form_submission_ajax.php CHANGED
@@ -208,6 +208,10 @@ if ( is_wp_error( $member_exists ) || $double_optin_resubscribe === true ) {
208
  $member_data = apply_filters( 'yikes-mailchimp-filter-subscribe-request', $member_data, $form_id );
209
  $member_data = apply_filters( "yikes-mailchimp-filter-subscribe-request-{$form_id}", $member_data, $form_id );
210
 
 
 
 
 
211
  // Send the API request to create a new subscriber! (Or update an existing one)
212
  $subscribe_response = $list_handler->member_subscribe( $list_id, md5( $sanitized_email ), $member_data );
213
 
@@ -217,10 +221,6 @@ $subscribe_response = $list_handler->member_subscribe( $list_id, md5( $sanitized
217
  if ( is_wp_error( $subscribe_response ) ) {
218
  $submission_handler->handle_submission_response_error( $subscribe_response, $form_fields );
219
  } else {
220
-
221
- // Check if we have any tags to add.
222
- $tags_response = $submission_handler->maybe_add_tags( $form_data, $data );
223
-
224
  $submission_handler->handle_submission_response_success( $submission_settings, $page_data, $merge_variables, $notifications, $optin_settings, $new_subscriber );
225
  }
226
 
208
  $member_data = apply_filters( 'yikes-mailchimp-filter-subscribe-request', $member_data, $form_id );
209
  $member_data = apply_filters( "yikes-mailchimp-filter-subscribe-request-{$form_id}", $member_data, $form_id );
210
 
211
+ foreach( $form_data['tags'] as $tag ) {
212
+ $member_data['tags'][] = $tag['name'];
213
+ }
214
+
215
  // Send the API request to create a new subscriber! (Or update an existing one)
216
  $subscribe_response = $list_handler->member_subscribe( $list_id, md5( $sanitized_email ), $member_data );
217
 
221
  if ( is_wp_error( $subscribe_response ) ) {
222
  $submission_handler->handle_submission_response_error( $subscribe_response, $form_fields );
223
  } else {
 
 
 
 
224
  $submission_handler->handle_submission_response_success( $submission_settings, $page_data, $merge_variables, $notifications, $optin_settings, $new_subscriber );
225
  }
226
 
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === Easy Forms for Mailchimp ===
2
- Contributors: yikesinc, eherman24, liljimmi, JPry, yikesitskevin
3
  Donate link: https://yikesplugins.com/?utm_source=wp_plugin_repo&utm_medium=donate_link&utm_campaign=easy_forms_for_mailchimp
4
  Tags: Mailchimp, Mailchimp forms, Mailchimp lists, opt-in forms, sign up form, Mailchimp, email, forms, mailing lists, marketing, newsletter, sign up
5
  Requires at least: 4.0
6
  Tested up to: 5.3
7
  Requires PHP: 5.2.13
8
- Stable tag: 6.5.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -76,7 +76,7 @@ If you experience any problems, please submit a New Issue on our [Github Issue T
76
  == Installation ==
77
 
78
  1. Download the plugin .zip file and make note of where on your computer you downloaded it to.
79
- 2. In the WordPress admin (yourdomain.com/wp-admin) go to Plugins > Add New or click the "Add New" button on the main plugins screen.
80
  3. On the following screen, click the "Upload Plugin" button.
81
  4. Browse your computer to where you downloaded the plugin .zip file, select it and click the "Install Now" button.
82
  5. After the plugin has successfully installed, click "Activate Plugin" and enjoy!
@@ -113,7 +113,7 @@ The submit button text can be customized to use any text you like. This is done
113
  = How do I add new fields to my form? =
114
  The fields that are assigned to a list are managed on the Mailchimp site. To add or remove fields you need to log in to your account and manage them there.
115
 
116
- Please read the article [Manage List and Signup Form Fields](http://kb.mailchimp.com/lists/managing-subscribers/manage-list-and-signup-form-fields) to learn how to add and edit the fields for your lists.
117
 
118
  After you’ve added fields, they may not show up immediately in our plugin’s Form Builder. Our plugin pulls the information from your lists and stores it for a period of time before pulling it again. To get the new information immediately you will need to clear the Mailchimp API cache. Please read our article [API Cache Settings](https://yikesplugins.com/support/knowledge-base/api-cache-settings/) for instructions on how to clear the Mailchimp API cache.
119
 
@@ -172,6 +172,13 @@ For information and code examples on how to implement the hooks and filters prov
172
 
173
  == Changelog ==
174
 
 
 
 
 
 
 
 
175
  = 6.5.4 - August 28th, 2019 =
176
  * Patched security vulnerability found in on of our dependencies.
177
 
1
  === Easy Forms for Mailchimp ===
2
+ Contributors: yikesinc, eherman24, liljimmi, JPry, yikesitskevin, fmixell
3
  Donate link: https://yikesplugins.com/?utm_source=wp_plugin_repo&utm_medium=donate_link&utm_campaign=easy_forms_for_mailchimp
4
  Tags: Mailchimp, Mailchimp forms, Mailchimp lists, opt-in forms, sign up form, Mailchimp, email, forms, mailing lists, marketing, newsletter, sign up
5
  Requires at least: 4.0
6
  Tested up to: 5.3
7
  Requires PHP: 5.2.13
8
+ Stable tag: 6.6.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
76
  == Installation ==
77
 
78
  1. Download the plugin .zip file and make note of where on your computer you downloaded it to.
79
+ 2. In the WordPress admin (example.com/wp-admin) go to Plugins > Add New or click the "Add New" button on the main plugins screen.
80
  3. On the following screen, click the "Upload Plugin" button.
81
  4. Browse your computer to where you downloaded the plugin .zip file, select it and click the "Install Now" button.
82
  5. After the plugin has successfully installed, click "Activate Plugin" and enjoy!
113
  = How do I add new fields to my form? =
114
  The fields that are assigned to a list are managed on the Mailchimp site. To add or remove fields you need to log in to your account and manage them there.
115
 
116
+ Please read the article [Manage List and Sign Up Form Fields](http://kb.mailchimp.com/lists/managing-subscribers/manage-list-and-signup-form-fields) to learn how to add and edit the fields for your lists.
117
 
118
  After you’ve added fields, they may not show up immediately in our plugin’s Form Builder. Our plugin pulls the information from your lists and stores it for a period of time before pulling it again. To get the new information immediately you will need to clear the Mailchimp API cache. Please read our article [API Cache Settings](https://yikesplugins.com/support/knowledge-base/api-cache-settings/) for instructions on how to clear the Mailchimp API cache.
119
 
172
 
173
  == Changelog ==
174
 
175
+ = 6.6.0 - October 25, 2019 =
176
+ * Adding Double Opt-in Subscribe.
177
+ * Easy Forms Gutenberg Category - Thanks to @Ajwerth.
178
+
179
+ = 6.5.6 - October 24, 2019 =
180
+ * Fixing bug with WordPress 5.3 ahead of release.
181
+
182
  = 6.5.4 - August 28th, 2019 =
183
  * Patched security vulnerability found in on of our dependencies.
184
 
yikes-inc-easy-mailchimp-extender.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Easy Forms for Mailchimp
4
  * Plugin URI: https://yikesplugins.com/plugin/easy-forms-for-mailchimp/
5
  * Description: The ultimate Mailchimp WordPress plugin. Easily build <strong>unlimited forms for your Mailchimp lists</strong>, add them to your site and track subscriber activity. To get started, go to the settings page and enter your <a href="https://yikesplugins.com/support/knowledge-base/finding-your-mailchimp-api-key/" target="_blank">Mailchimp API key</a>.
6
- * Version: 6.5.5
7
  * Author: YIKES, Inc.
8
  * Author URI: https://www.yikesplugins.com/
9
  * License: GPL-3.0+
@@ -43,7 +43,7 @@ if ( ! defined( 'WPINC' ) ) {
43
  * @since 6.1.3
44
  */
45
  if ( ! defined( 'YIKES_MC_VERSION' ) ) {
46
- define( 'YIKES_MC_VERSION', '6.5.5' );
47
  }
48
 
49
  /**
3
  * Plugin Name: Easy Forms for Mailchimp
4
  * Plugin URI: https://yikesplugins.com/plugin/easy-forms-for-mailchimp/
5
  * Description: The ultimate Mailchimp WordPress plugin. Easily build <strong>unlimited forms for your Mailchimp lists</strong>, add them to your site and track subscriber activity. To get started, go to the settings page and enter your <a href="https://yikesplugins.com/support/knowledge-base/finding-your-mailchimp-api-key/" target="_blank">Mailchimp API key</a>.
6
+ * Version: 6.6.1
7
  * Author: YIKES, Inc.
8
  * Author URI: https://www.yikesplugins.com/
9
  * License: GPL-3.0+
43
  * @since 6.1.3
44
  */
45
  if ( ! defined( 'YIKES_MC_VERSION' ) ) {
46
+ define( 'YIKES_MC_VERSION', '6.6.1' );
47
  }
48
 
49
  /**