geno/wp-content/plugins/mailpoet/assets/dist/js/mailpoet.js
2024-02-01 11:54:18 +00:00

2 lines
No EOL
1.8 KiB
JavaScript

/*! For license information please see mailpoet.js.LICENSE.txt */
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[740],{30834:function(e,t,s){s(69177);var i=s(65311),n=s.n(i);n()((e=>{e(document).on("click",".mailpoet-dismissible-notice .notice-dismiss",(function(){const t=e(this).closest(".mailpoet-dismissible-notice").data("notice");e.ajax(window.ajaxurl,{type:"POST",data:{action:"dismissed_notice_handler",type:t}})}))}));var r=n();r.fn.mailpoetSerializeObject=function(e){var t={},s={true:!0,false:!1,null:null};return r.each(this.serializeArray(),(function(i,n){var r=n.name,a=n.value,l=t,c=0,o=r.split("]["),u=o.length-1;if(/\[/.test(o[0])&&/\]$/.test(o[u])?(o[u]=o[u].replace(/\]$/,""),u=(o=o.shift().split("[").concat(o)).length-1):u=0,e&&(a&&!Number.isNaN(a)?a=+a:"undefined"===a?a=void 0:void 0!==s[a]&&(a=s[a])),u)for(;c<=u;c+=1)l[r=""===o[c]?l.length:o[c]]=c<u?l[r]||(o[c+1]&&isNaN(o[c+1])?{}:[]):a,l=l[r];else Array.isArray(t[r])?t[r].push(a):void 0!==t[r]?t[r]=[t[r],a]:t[r]=a})),t};var a=s(55014),l=s.n(a);n()((e=>{l().addValidator("scheduledAt",{requirementType:"string",validateString:(t,s)=>{const i=e('select[name="afterTimeType"],select#scheduling_time_interval').val();let n=!0;return"hours"===i&&43800<t&&(n=!1),"days"===i&&1825<t&&(n=!1),"weeks"===i&&260<t&&(n=!1),!!n||e.Deferred().reject(s)},messages:{en:"An email can only be scheduled up to 5 years in the future. Please choose a shorter period."}}),l().addValidator("segmentsWithSubscribers",{requirementType:"string",validateMultiple:(t,s)=>{const i=window.mailpoet_segments||[];let n=!1;return t.forEach((e=>{const t=i.find((t=>t.id===e));t&&t.subscribers>0&&(n=!0)})),!!n||e.Deferred().reject(s)},messages:{en:"Please select a list with subscribers."}})}))},65311:function(e){e.exports=jQuery}},function(e){e.O(0,[351],(function(){return 30834,e(e.s=30834)})),e.O()}]);