!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=39)}([function(e,t,n){"use strict";n.d(t,"f",function(){return o}),n.d(t,"b",function(){return a}),n.d(t,"e",function(){return i}),n.d(t,"c",function(){return u}),n.d(t,"a",function(){return s}),n.d(t,"d",function(){return c});var r=wp,o=r.i18n,a=r.blocks,i=r.editor,u=r.components,s=r.apiFetch,c=r.data},function(e,t,n){var r=n(25),o=n(26),a=36e5,i=6e4,u=2,s=/[T ]/,c=/:/,l=/^(\d{2})$/,f=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],p=/^(\d{4})/,d=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],m=/^-(\d{2})$/,h=/^-?(\d{3})$/,v=/^-?(\d{2})-?(\d{2})$/,b=/^-?W(\d{2})$/,y=/^-?W(\d{2})-?(\d{1})$/,w=/^(\d{2}([.,]\d*)?)$/,g=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,x=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,E=/([Z+-].*)$/,O=/^(Z)$/,T=/^([+-])(\d{2})$/,S=/^([+-])(\d{2}):?(\d{2})$/;function M(e,t,n){t=t||0,n=n||0;var r=new Date(0);r.setUTCFullYear(e,0,4);var o=7*t+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+o),r}e.exports=function(e,t){if(o(e))return new Date(e.getTime());if("string"!=typeof e)return new Date(e);var n=(t||{}).additionalDigits;n=null==n?u:Number(n);var j=function(e){var t,n={},r=e.split(s);if(c.test(r[0])?(n.date=null,t=r[0]):(n.date=r[0],t=r[1]),t){var o=E.exec(t);o?(n.time=t.replace(o[1],""),n.timezone=o[1]):n.time=t}return n}(e),C=function(e,t){var n,r=f[t],o=d[t];if(n=p.exec(e)||o.exec(e)){var a=n[1];return{year:parseInt(a,10),restDateString:e.slice(a.length)}}if(n=l.exec(e)||r.exec(e)){var i=n[1];return{year:100*parseInt(i,10),restDateString:e.slice(i.length)}}return{year:null}}(j.date,n),D=C.year,_=function(e,t){if(null===t)return null;var n,r,o,a;if(0===e.length)return(r=new Date(0)).setUTCFullYear(t),r;if(n=m.exec(e))return r=new Date(0),o=parseInt(n[1],10)-1,r.setUTCFullYear(t,o),r;if(n=h.exec(e)){r=new Date(0);var i=parseInt(n[1],10);return r.setUTCFullYear(t,0,i),r}if(n=v.exec(e)){r=new Date(0),o=parseInt(n[1],10)-1;var u=parseInt(n[2],10);return r.setUTCFullYear(t,o,u),r}if(n=b.exec(e))return a=parseInt(n[1],10)-1,M(t,a);if(n=y.exec(e)){a=parseInt(n[1],10)-1;var s=parseInt(n[2],10)-1;return M(t,a,s)}return null}(C.restDateString,D);if(_){var R,k=_.getTime(),A=0;if(j.time&&(A=function(e){var t,n,r;if(t=w.exec(e))return(n=parseFloat(t[1].replace(",",".")))%24*a;if(t=g.exec(e))return n=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),n%24*a+r*i;if(t=x.exec(e)){n=parseInt(t[1],10),r=parseInt(t[2],10);var o=parseFloat(t[3].replace(",","."));return n%24*a+r*i+1e3*o}return null}(j.time)),j.timezone)U=j.timezone,R=((L=O.exec(U))?0:(L=T.exec(U))?(V=60*parseInt(L[2],10),"+"===L[1]?-V:V):(L=S.exec(U))?(V=60*parseInt(L[2],10)+parseInt(L[3],10),"+"===L[1]?-V:V):0)*i;else{var P=k+A,I=new Date(P);R=r(I);var B=new Date(P);B.setDate(I.getDate()+1);var N=r(B)-r(I);N>0&&(R+=N)}return new Date(k+A+R)}var U,L,V;return new Date(e)}},function(e,t){e.exports=window.React},function(e,t,n){"use strict";var r,o,a,i=n(11),u="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";function s(){a=!1}function c(e){if(e){if(e!==r){if(e.length!==u.length)throw new Error("Custom alphabet for shortid must be "+u.length+" unique characters. You submitted "+e.length+" characters: "+e);var t=e.split("").filter(function(e,t,n){return t!==n.lastIndexOf(e)});if(t.length)throw new Error("Custom alphabet for shortid must be "+u.length+" unique characters. These characters were not unique: "+t.join(", "));r=e,s()}}else r!==u&&(r=u,s())}function l(){return a||(a=function(){r||c(u);for(var e,t=r.split(""),n=[],o=i.nextValue();t.length>0;)o=i.nextValue(),e=Math.floor(o*t.length),n.push(t.splice(e,1)[0]);return n.join("")}())}e.exports={get:function(){return r||u},characters:function(e){return c(e),r},seed:function(e){i.seed(e),o!==e&&(s(),o=e)},lookup:function(e){return l()[e]},shuffled:l}},function(e,t,n){"use strict";e.exports=n(10)},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(i=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),a=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(a).concat([o]).join("\n")}var i;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o=0&&l.splice(t,1)}function v(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return b(t,e.attrs),m(e,t),t}function b(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function y(e,t){var n,r,o,a;if(t.transform&&e.css){if(!(a="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=a}if(t.singleton){var i=c++;n=s||(s=v(t)),r=x.bind(null,n,i,!1),o=x.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",b(t,e.attrs),m(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||a)&&(r=f(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([r],{type:"text/css"}),u=e.href;e.href=URL.createObjectURL(i),u&&URL.revokeObjectURL(u)}.bind(null,n,t),o=function(){h(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),r=function(e,t){var n=t.css,r=t.media;r&&e.setAttribute("media",r);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){h(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=i()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return p(n,t),function(e){for(var r=[],o=0;o0&&(t+=a(r)),t+=a(n)}},function(e,t,n){"use strict";var r=n(3),o=n(14),a=n(15);e.exports=function(e){for(var t,n=0,i="";!t;)i+=a(o,r.get(),1),t=e0?(v=o(e),b=o(t)):(v=o(t),b=o(e));var w,g=a(b,v),x=b.getTimezoneOffset()-v.getTimezoneOffset(),E=Math.round(g/60)-x;if(E<2)return p.includeSeconds?g<5?h("lessThanXSeconds",5,y):g<10?h("lessThanXSeconds",10,y):g<20?h("lessThanXSeconds",20,y):g<40?h("halfAMinute",null,y):h(g<60?"lessThanXMinutes":"xMinutes",1,y):0===E?h("lessThanXMinutes",1,y):h("xMinutes",E,y);if(E<45)return h("xMinutes",E,y);if(E<90)return h("aboutXHours",1,y);if(Eo?-1:n0?Math.floor(n):Math.ceil(n)}},function(e,t,n){var r=n(1);e.exports=function(e,t){var n=r(e),o=r(t);return n.getTime()-o.getTime()}},function(e,t,n){var r=n(1),o=n(30),a=n(31);e.exports=function(e,t){var n=r(e),i=r(t),u=a(n,i),s=Math.abs(o(n,i));return n.setMonth(n.getMonth()-u*s),u*(s-(a(n,i)===-u))}},function(e,t,n){var r=n(1);e.exports=function(e,t){var n=r(e),o=r(t);return 12*(n.getFullYear()-o.getFullYear())+(n.getMonth()-o.getMonth())}},function(e,t,n){var r=n(1);e.exports=function(e,t){var n=r(e).getTime(),o=r(t).getTime();return no?1:0}},function(e,t,n){var r=n(33),o=n(34);e.exports={distanceInWords:r(),format:o()}},function(e,t){e.exports=function(){var e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};return{localize:function(t,n,r){var o;return r=r||{},o="string"==typeof e[t]?e[t]:1===n?e[t].one:e[t].other.replace("{{count}}",n),r.addSuffix?r.comparison>0?"in "+o:o+" ago":o}}}},function(e,t,n){var r=n(35);e.exports=function(){var e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Su","Mo","Tu","We","Th","Fr","Sa"],o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],i=["AM","PM"],u=["am","pm"],s=["a.m.","p.m."],c={MMM:function(t){return e[t.getMonth()]},MMMM:function(e){return t[e.getMonth()]},dd:function(e){return n[e.getDay()]},ddd:function(e){return o[e.getDay()]},dddd:function(e){return a[e.getDay()]},A:function(e){return e.getHours()/12>=1?i[1]:i[0]},a:function(e){return e.getHours()/12>=1?u[1]:u[0]},aa:function(e){return e.getHours()/12>=1?s[1]:s[0]}};return["M","D","DDD","d","Q","W"].forEach(function(e){c[e+"o"]=function(t,n){return function(e){var t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"}(n[e](t))}}),{formatters:c,formattingTokensRegExp:r(c)}}},function(e,t){var n=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];e.exports=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);var o=n.concat(t).sort().reverse();return new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+o.join("|")+"|.)","g")}},function(e,t,n){var r=n(37);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(6)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(5)(!1)).push([e.i,".TestResults {\n width: 100%;\n border-collapse: collapse;\n}\n\n.TestResultName {\n border-right: 1px solid #e2e4e7;\n}\n\n.TestResults td {\n vertical-align: middle;\n}\n\n.TestResults td.TestResultWinner {\n color: #46B450;\n}\n\n.TestResults td.TestResultLoser {\n color: #dc3232;\n}\n\n.TestResultValue {\n text-align: center;\n line-height: 1.8em;\n padding-left: 14px;\n white-space: nowrap;\n width: 1px;\n}\n",""])},,function(e,t,n){"use strict";n.r(t);var r=n(4),o=n.n(r),a=n(0),i=(n(18),a.c.ButtonGroup),u=a.c.IconButton;var s=function(e){var t=e.variants,n=e.onSelectVariant;return wp.element.createElement("div",{className:"ab-test-for-wp__VariantSelector"},wp.element.createElement(i,null,t.map(function(e){return wp.element.createElement(u,{isToggled:e.selected,onClick:function(){return n(e.id)}},e.name)}),wp.element.createElement(u,{icon:"admin-generic"})))};n(21);var c=function(){return wp.element.createElement("div",{className:"ab-test-for-wp__BoxShadow"})};function l(e){for(var t=1;t0;if(a||!t&&!i)return null;var u=o.map(function(e){return ee({},e,{rate:0===e.participants?0:Math.round(100/e.participants*e.conversions),winner:!o.every(function(t){return e.participants/e.conversions>=t.participants/t.conversions})})}).sort(function(e,t){return e.name>t.name?1:e.name>t.name?-1:0});return wp.element.createElement(ue,{title:ie("Results so far")},i?wp.element.createElement("div",null,wp.element.createElement("table",{className:"TestResults"},wp.element.createElement("tbody",null,wp.element.createElement("tr",null,wp.element.createElement("td",{className:"TestResultName"},ie("Variation")),u.map(function(e){return wp.element.createElement("td",{className:V()(e.winner?"TestResultWinner":"TestResultLoser","TestResultValue"),key:e.id},e.name)})),wp.element.createElement("tr",null,wp.element.createElement("td",{className:"TestResultName"},ie("Conversion Rate")),u.map(function(e){return wp.element.createElement("td",{className:V()(e.winner?"TestResultWinner":"TestResultLoser","TestResultValue"),key:e.id},e.rate,"%")})),wp.element.createElement("tr",null,wp.element.createElement("td",{className:"TestResultName"},ie("Conversions")),u.map(function(e){return wp.element.createElement("td",{className:"TestResultValue",key:e.id},e.conversions)})),wp.element.createElement("tr",null,wp.element.createElement("td",{className:"TestResultName"},ie("Participants")),u.map(function(e){return wp.element.createElement("td",{className:"TestResultValue",key:e.id},e.participants)}))))):wp.element.createElement("div",null,"No participants yet."),wp.element.createElement("br",null),wp.element.createElement(Q,{variants:u,onDeclareWinner:n}))}}])&&te(n.prototype,r),o&&te(n,o),t}();var ce=function(){return wp.element.createElement("svg",{version:"1.1",x:"0px",y:"0px",width:"101.2px",height:"101.2px",viewBox:"0 0 101.2 101.2"},wp.element.createElement("polygon",{points:"39.9,59.1 27.3,81.4 43.3,81.4 40,59.1"}),wp.element.createElement("polygon",{points:"15.9,101.2 46.2,101.2 44.2,88.4 23.4,88.4"}),wp.element.createElement("path",{d:"M89.2,0H12C5.4,0,0,5.4,0,12v77.2C0,94,2.8,98.1,6.8,100l30.1-50.2h9.7l5.1,29.6l6.1-29.6h22.6c3.5,0,6.2,0.5,8.3,1.4 c2,0.9,3.6,2,4.6,3.3c1.1,1.3,1.7,2.6,2,4c0.3,1.4,0.4,2.6,0.4,3.5c0,1.6-0.2,3-0.7,4.4c-0.5,1.4-1.1,2.7-2,3.8 c-0.9,1.1-1.9,2.1-3.2,2.8c-1.2,0.7-2.6,1.2-4.1,1.5v0.1c5.2,1.7,7.9,5.3,7.9,11c0,1.4-0.3,3-0.8,4.9c-0.5,1.9-1.5,3.7-3,5.4 c-1.4,1.7-3.5,3.2-6,4.4c-0.6,0.3-1.3,0.6-2.1,0.8h7.5c6.6,0,12-5.4,12-12V12C101.2,5.4,95.8,0,89.2,0z"}),wp.element.createElement("path",{d:"M81.6,70.9c1.4-0.6,2.4-1.3,3.2-2.2c0.7-0.9,1.2-1.8,1.5-2.7c0.2-1,0.4-1.8,0.4-2.5c0-0.5-0.1-1.2-0.2-1.9 c-0.1-0.7-0.5-1.4-1-2.1C84.8,59,84,58.4,82.9,58c-1.1-0.4-2.5-0.7-4.4-0.7H65.5l-3,14.5h13.7C78.4,71.8,80.2,71.5,81.6,70.9z"}),wp.element.createElement("path",{d:"M57.7,94.8h13.1c0.8,0,1.9,0,3.3-0.1c1.4,0,2.9-0.3,4.3-0.8c1.5-0.5,2.8-1.3,3.9-2.4c1.1-1.1,1.8-2.8,2-4.9 c0-0.6,0-1.4,0-2.3c-0.1-0.9-0.4-1.8-1-2.7c-0.6-0.9-1.6-1.6-2.9-2.2c-1.3-0.6-3.1-0.9-5.5-0.9H61.1L57.7,94.8z"}))};function le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var fe=a.f.__,pe=a.b.registerBlockType,de=a.b.createBlock,me=a.e.InnerBlocks,he=a.e.InspectorControls,ve=a.d.withDispatch,be=a.d.select,ye=["ab-testing-for-wp/ab-test-block-variant"],we=function(e){return["ab-testing-for-wp/ab-test-block-variant",e]};var ge=ve(function(e,t){var n=e("core/editor").removeBlock,r=be("core/editor").getBlock,o=t.clientId,a=t.insertBlocksAfter;return{onDeclareWinner:function(e){var t=r(o).innerBlocks.find(function(t){return t.attributes&&t.attributes.id===e});if(t){var i=t.innerBlocks.map(function(e){return de(e.name,e.attributes,e.innerBlocks)});a(i),n(o)}}}})(function(e){var t=e.attributes,n=e.setAttributes,r=e.onDeclareWinner,a=t.id,i=t.variants,u=t.postGoal,l=t.control,f=t.isEnabled,p=t.startedAt;if(!a){var d=[{id:o.a.generate(),name:"A",selected:!0,distribution:50},{id:o.a.generate(),name:"B",selected:!1,distribution:50}];n({id:o.a.generate(),variants:d,postGoal:0,control:d[0].id,isEnabled:!1})}var m=i.find(function(e){return!!e.selected}),h="\n .ABTest--".concat(a," .ABTestVariant { \n display: none;\n }\n \n .ABTest--").concat(a," .ABTestVariant--").concat(m&&m.id?m.id:""," { \n display: block!important; \n }\n ");return wp.element.createElement("div",{className:"ABTest--".concat(a)},wp.element.createElement("style",null,h),wp.element.createElement(he,null,wp.element.createElement(U,{value:f,onChange:function(e){return n({isEnabled:e,startedAt:e&&!p?new Date:p})},startedAt:p}),wp.element.createElement(se,{isEnabled:f,testId:a,onDeclareWinner:r}),wp.element.createElement(v,{variants:i,onUpdateVariants:function(e){return n({variants:e})}}),wp.element.createElement(j,{value:u,onChange:function(e){return n({postGoal:e})}}),wp.element.createElement(R,{value:l,variants:i,onChange:function(e){return n({control:e})}})),wp.element.createElement(me,{templateLock:"all",template:i.map(we),allowedBlocks:ye}),wp.element.createElement(s,{variants:i,onSelectVariant:function(e){n({variants:i.map(function(t){return function(e){for(var t=1;t