diff --git a/includes/js/index.js b/includes/js/index.js index 59250f42..4df3c2ea 100644 --- a/includes/js/index.js +++ b/includes/js/index.js @@ -1 +1 @@ -!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=3)}([function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(2);e.exports=function(e,t){if(null==e)return{};var n,o,a=r(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.r(t);var r=function(e){return Math.abs(parseInt(e,10))};const o=(e,t)=>{const n=new Map([["init","init"],["validation_failed","invalid"],["acceptance_missing","unaccepted"],["spam","spam"],["aborted","aborted"],["mail_sent","sent"],["mail_failed","failed"],["submitting","submitting"],["resetting","resetting"],["payment_required","payment-required"]]);n.has(t)&&(t=n.get(t)),Array.from(n.values()).includes(t)||(t="custom-"+(t=(t=t.replace(/[^0-9a-z]+/i," ").trim()).replace(/\s+/,"-")));const r=e.getAttribute("data-status");return e.wpcf7.status=t,e.setAttribute("data-status",t),e.classList.add(t),r&&r!==t&&e.classList.remove(r),t};var a=function(e,t,n){var r=new CustomEvent("wpcf7".concat(t),{bubbles:!0,detail:n});"string"==typeof e&&(e=document.querySelector(e)),e.dispatchEvent(r)},c=n(0),i=n.n(c),s=n(1),u=n.n(s);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t=200&&e.status<300)return e;throw e})).then((function(e){if(204===e.status)return null;if(e&&e.json)return e.json().catch((function(){throw b}));throw b}))}),(function(){throw v}))}))(e)},d=[];function v(e,t={}){const n=new FormData(e);t.submitter&&t.submitter.name&&n.append(t.submitter.name,t.submitter.value);const r={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(n,e=>{const t=e[0],n=e[1];return!t.match(/^_/)&&{name:t,value:n}}).filter(e=>!1!==e),formData:n},c=t=>{const n=document.createElement("li");n.setAttribute("id",t.error_id),t.idref?n.insertAdjacentHTML("beforeend",`${t.message}`):n.insertAdjacentText("beforeend",t.message),e.wpcf7.parent.querySelector(".screen-reader-response ul").appendChild(n)},i=t=>{const n=e.querySelector(t.into),r=n.querySelector(".wpcf7-form-control");r.classList.add("wpcf7-not-valid"),r.setAttribute("aria-describedby",t.error_id);const o=document.createElement("span");o.setAttribute("class","wpcf7-not-valid-tip"),o.setAttribute("aria-hidden","true"),o.insertAdjacentText("beforeend",t.message),n.appendChild(o),n.querySelectorAll("[aria-invalid]").forEach(e=>{e.setAttribute("aria-invalid","true")}),r.closest(".use-floating-validation-tip")&&(r.addEventListener("focus",e=>{o.setAttribute("style","display: none")}),o.addEventListener("mouseover",e=>{o.setAttribute("style","display: none")}))};p({endpoint:`contact-forms/${e.wpcf7.id}/feedback`,method:"POST",body:n,wpcf7:{endpoint:"feedback",form:e,detail:r}}).then(t=>{const n=o(e,t.status);return r.status=t.status,r.apiResponse=t,["invalid","unaccepted","spam","aborted"].includes(n)?a(e,n,r):["sent","failed"].includes(n)&&a(e,"mail"+n,r),a(e,"submit",r),t}).then(t=>{t.posted_data_hash&&(e.querySelector('input[name="_wpcf7_posted_data_hash"]').value=t.posted_data_hash),"mail_sent"===t.status&&(e.reset(),e.wpcf7.resetOnMailSent=!0),t.invalid_fields&&(t.invalid_fields.forEach(c),t.invalid_fields.forEach(i)),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').insertAdjacentText("beforeend",t.message),e.querySelectorAll(".wpcf7-response-output").forEach(e=>{e.innerText=t.message})}).catch(e=>console.error(e))}p.use=function(e){d.unshift(e)},p.use((e,t)=>{if(e.wpcf7&&"feedback"===e.wpcf7.endpoint){const{form:t,detail:n}=e.wpcf7;b(t),a(t,"beforesubmit",n),o(t,"submitting")}return t(e)});const b=e=>{e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').innerText="",e.wpcf7.parent.querySelector(".screen-reader-response ul").innerText="",e.querySelectorAll(".wpcf7-not-valid-tip").forEach(e=>{e.remove()}),e.querySelectorAll("[aria-invalid]").forEach(e=>{e.setAttribute("aria-invalid","false")}),e.querySelectorAll(".wpcf7-form-control").forEach(e=>{e.removeAttribute("aria-describedby"),e.classList.remove("wpcf7-not-valid")}),e.querySelectorAll(".wpcf7-response-output").forEach(e=>{e.innerText=""})};function w(e){var t=new FormData(e),n={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(t,(function(e){var t=e[0],n=e[1];return!t.match(/^_/)&&{name:t,value:n}})).filter((function(e){return!1!==e})),formData:t};p({endpoint:"contact-forms/".concat(e.wpcf7.id,"/refill"),method:"GET",wpcf7:{endpoint:"refill",form:e,detail:n}}).then((function(t){e.wpcf7.resetOnMailSent?(delete e.wpcf7.resetOnMailSent,o(e,"mail_sent")):o(e,"init"),n.apiResponse=t,a(e,"reset",n)})).catch((function(e){return console.error(e)}))}p.use((function(e,t){if(e.wpcf7&&"refill"===e.wpcf7.endpoint){var n=e.wpcf7,r=n.form;n.detail,b(r),o(r,"resetting")}return t(e)}));var m=function(e,t){var n=function(n){var r=t[n];e.querySelectorAll('input[name="'.concat(n,'"]')).forEach((function(e){e.value=""})),e.querySelectorAll("img.wpcf7-captcha-".concat(n)).forEach((function(e){e.setAttribute("src",r)}));var o=/([0-9]+)\.(png|gif|jpeg)$/.exec(r);o&&e.querySelectorAll('input[name="_wpcf7_captcha_challenge_'.concat(n,'"]')).forEach((function(e){e.value=o[1]}))};for(var r in t)n(r)},h=function(e,t){var n=function(n){var r=t[n][0],o=t[n][1];e.querySelectorAll(".wpcf7-form-control-wrap.".concat(n)).forEach((function(e){e.querySelector('input[name="'.concat(n,'"]')).value="",e.querySelector(".wpcf7-quiz-label").textContent=r,e.querySelector('input[name="_wpcf7_quiz_answer_'.concat(n,'"]')).value=o}))};for(var r in t)n(r)};function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){const t=new FormData(e);e.wpcf7={id:r(t.get("_wpcf7")),status:e.getAttribute("data-status"),pluginVersion:t.get("_wpcf7_version"),locale:t.get("_wpcf7_locale"),unitTag:t.get("_wpcf7_unit_tag"),containerPost:r(t.get("_wpcf7_container_post")),parent:e.closest(".wpcf7")},e.querySelectorAll(".has-spinner").forEach(e=>{e.insertAdjacentHTML("afterend",'')}),function(e){e.querySelectorAll(".wpcf7-exclusive-checkbox").forEach((function(t){t.addEventListener("change",(function(t){var n=t.target.getAttribute("name");e.querySelectorAll('input[type="checkbox"][name="'.concat(n,'"]')).forEach((function(e){e!==t.target&&(e.checked=!1)}))}))}))}(e),function(e){e.querySelectorAll(".has-free-text").forEach((function(t){var n=t.querySelector("input.wpcf7-free-text"),r=t.querySelector('input[type="checkbox"], input[type="radio"]');n.disabled=!r.checked,e.addEventListener("change",(function(e){n.disabled=!r.checked,e.target===r&&r.checked&&n.focus()}))}))}(e),function(e){e.querySelectorAll(".wpcf7-validates-as-url").forEach((function(e){e.addEventListener("change",(function(t){var n=e.value.trim();n&&!n.match(/^[a-z][a-z0-9.+-]*:/i)&&-1!==n.indexOf(".")&&(n="http://"+(n=n.replace(/^\/+/,""))),e.value=n}))}))}(e),function(e){if(e.querySelector(".wpcf7-acceptance")&&!e.classList.contains("wpcf7-acceptance-as-validation")){var t=function(){var t=!0;e.querySelectorAll(".wpcf7-acceptance").forEach((function(e){if(t&&!e.classList.contains("optional")){var n=e.querySelector('input[type="checkbox"]');(e.classList.contains("invert")&&n.checked||!e.classList.contains("invert")&&!n.checked)&&(t=!1)}})),e.querySelectorAll(".wpcf7-submit").forEach((function(e){e.disabled=!t}))};t(),e.addEventListener("change",(function(e){t()})),e.addEventListener("wpcf7reset",(function(e){t()}))}}(e),function(e){var t=function(e,t){var n=r(e.getAttribute("data-starting-value")),o=r(e.getAttribute("data-maximum-value")),a=r(e.getAttribute("data-minimum-value")),c=e.classList.contains("down")?n-t.value.length:t.value.length;e.setAttribute("data-current-value",c),e.innerText=c,o&&o{wpcf7.cached&&e.reset()}),e.addEventListener("reset",t=>{wpcf7.reset(e)}),e.addEventListener("submit",t=>{const n=t.submitter;wpcf7.submit(e,{submitter:n}),t.preventDefault()}),e.addEventListener("wpcf7submit",t=>{t.detail.apiResponse.captcha&&m(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&h(e,t.detail.apiResponse.quiz)}),e.addEventListener("wpcf7reset",t=>{t.detail.apiResponse.captcha&&m(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&h(e,t.detail.apiResponse.quiz)})}document.addEventListener("DOMContentLoaded",e=>{var t;if("undefined"==typeof wpcf7)return void console.error("wpcf7 is not defined.");if(void 0===wpcf7.api)return void console.error("wpcf7.api is not defined.");if("function"!=typeof window.fetch)return void console.error("Your browser doesn't support window.fetch().");if("function"!=typeof window.FormData)return void console.error("Your browser doesn't support window.FormData().");const n=document.querySelectorAll(".wpcf7 > form");"function"==typeof n.forEach?(wpcf7={init:g,submit:v,reset:w,...null!==(t=wpcf7)&&void 0!==t?t:{}},n.forEach(e=>wpcf7.init(e))):console.error("Your browser doesn't support NodeList.forEach().")})}]); \ No newline at end of file +!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=3)}([function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(2);e.exports=function(e,t){if(null==e)return{};var n,o,c=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.r(t);var r=function(e){return Math.abs(parseInt(e,10))};const o=(e,t)=>{const n=new Map([["init","init"],["validation_failed","invalid"],["acceptance_missing","unaccepted"],["spam","spam"],["aborted","aborted"],["mail_sent","sent"],["mail_failed","failed"],["submitting","submitting"],["resetting","resetting"],["payment_required","payment-required"]]);n.has(t)&&(t=n.get(t)),Array.from(n.values()).includes(t)||(t="custom-"+(t=(t=t.replace(/[^0-9a-z]+/i," ").trim()).replace(/\s+/,"-")));const r=e.getAttribute("data-status");return e.wpcf7.status=t,e.setAttribute("data-status",t),e.classList.add(t),r&&r!==t&&e.classList.remove(r),t};var c=function(e,t,n){var r=new CustomEvent("wpcf7".concat(t),{bubbles:!0,detail:n});"string"==typeof e&&(e=document.querySelector(e)),e.dispatchEvent(r)},a=n(0),i=n.n(a),s=n(1),u=n.n(s);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t=200&&e.status<300)return e;throw e})).then((function(e){if(204===e.status)return null;if(e&&e.json)return e.json().catch((function(){throw b}));throw b}))}),(function(){throw v}))}))(e)},d=[];function v(e,t={}){if(wpcf7.blocked)return b(e),void o(e,"submitting");const n=new FormData(e);t.submitter&&t.submitter.name&&n.append(t.submitter.name,t.submitter.value);const r={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(n,e=>{const t=e[0],n=e[1];return!t.match(/^_/)&&{name:t,value:n}}).filter(e=>!1!==e),formData:n},a=t=>{const n=document.createElement("li");n.setAttribute("id",t.error_id),t.idref?n.insertAdjacentHTML("beforeend",`${t.message}`):n.insertAdjacentText("beforeend",t.message),e.wpcf7.parent.querySelector(".screen-reader-response ul").appendChild(n)},i=t=>{const n=e.querySelector(t.into),r=n.querySelector(".wpcf7-form-control");r.classList.add("wpcf7-not-valid"),r.setAttribute("aria-describedby",t.error_id);const o=document.createElement("span");o.setAttribute("class","wpcf7-not-valid-tip"),o.setAttribute("aria-hidden","true"),o.insertAdjacentText("beforeend",t.message),n.appendChild(o),n.querySelectorAll("[aria-invalid]").forEach(e=>{e.setAttribute("aria-invalid","true")}),r.closest(".use-floating-validation-tip")&&(r.addEventListener("focus",e=>{o.setAttribute("style","display: none")}),o.addEventListener("mouseover",e=>{o.setAttribute("style","display: none")}))};p({endpoint:`contact-forms/${e.wpcf7.id}/feedback`,method:"POST",body:n,wpcf7:{endpoint:"feedback",form:e,detail:r}}).then(t=>{const n=o(e,t.status);return r.status=t.status,r.apiResponse=t,["invalid","unaccepted","spam","aborted"].includes(n)?c(e,n,r):["sent","failed"].includes(n)&&c(e,"mail"+n,r),c(e,"submit",r),t}).then(t=>{t.posted_data_hash&&(e.querySelector('input[name="_wpcf7_posted_data_hash"]').value=t.posted_data_hash),"mail_sent"===t.status&&(e.reset(),e.wpcf7.resetOnMailSent=!0),t.invalid_fields&&(t.invalid_fields.forEach(a),t.invalid_fields.forEach(i)),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').insertAdjacentText("beforeend",t.message),e.querySelectorAll(".wpcf7-response-output").forEach(e=>{e.innerText=t.message})}).catch(e=>console.error(e))}p.use=function(e){d.unshift(e)},p.use((e,t)=>{if(e.wpcf7&&"feedback"===e.wpcf7.endpoint){const{form:t,detail:n}=e.wpcf7;b(t),c(t,"beforesubmit",n),o(t,"submitting")}return t(e)});const b=e=>{e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').innerText="",e.wpcf7.parent.querySelector(".screen-reader-response ul").innerText="",e.querySelectorAll(".wpcf7-not-valid-tip").forEach(e=>{e.remove()}),e.querySelectorAll("[aria-invalid]").forEach(e=>{e.setAttribute("aria-invalid","false")}),e.querySelectorAll(".wpcf7-form-control").forEach(e=>{e.removeAttribute("aria-describedby"),e.classList.remove("wpcf7-not-valid")}),e.querySelectorAll(".wpcf7-response-output").forEach(e=>{e.innerText=""})};function w(e){var t=new FormData(e),n={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(t,(function(e){var t=e[0],n=e[1];return!t.match(/^_/)&&{name:t,value:n}})).filter((function(e){return!1!==e})),formData:t};p({endpoint:"contact-forms/".concat(e.wpcf7.id,"/refill"),method:"GET",wpcf7:{endpoint:"refill",form:e,detail:n}}).then((function(t){e.wpcf7.resetOnMailSent?(delete e.wpcf7.resetOnMailSent,o(e,"mail_sent")):o(e,"init"),n.apiResponse=t,c(e,"reset",n)})).catch((function(e){return console.error(e)}))}p.use((function(e,t){if(e.wpcf7&&"refill"===e.wpcf7.endpoint){var n=e.wpcf7,r=n.form;n.detail,b(r),o(r,"resetting")}return t(e)}));var m=function(e,t){var n=function(n){var r=t[n];e.querySelectorAll('input[name="'.concat(n,'"]')).forEach((function(e){e.value=""})),e.querySelectorAll("img.wpcf7-captcha-".concat(n)).forEach((function(e){e.setAttribute("src",r)}));var o=/([0-9]+)\.(png|gif|jpeg)$/.exec(r);o&&e.querySelectorAll('input[name="_wpcf7_captcha_challenge_'.concat(n,'"]')).forEach((function(e){e.value=o[1]}))};for(var r in t)n(r)},h=function(e,t){var n=function(n){var r=t[n][0],o=t[n][1];e.querySelectorAll(".wpcf7-form-control-wrap.".concat(n)).forEach((function(e){e.querySelector('input[name="'.concat(n,'"]')).value="",e.querySelector(".wpcf7-quiz-label").textContent=r,e.querySelector('input[name="_wpcf7_quiz_answer_'.concat(n,'"]')).value=o}))};for(var r in t)n(r)};function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){const t=new FormData(e);e.wpcf7={id:r(t.get("_wpcf7")),status:e.getAttribute("data-status"),pluginVersion:t.get("_wpcf7_version"),locale:t.get("_wpcf7_locale"),unitTag:t.get("_wpcf7_unit_tag"),containerPost:r(t.get("_wpcf7_container_post")),parent:e.closest(".wpcf7")},e.querySelectorAll(".has-spinner").forEach(e=>{e.insertAdjacentHTML("afterend",'')}),function(e){e.querySelectorAll(".wpcf7-exclusive-checkbox").forEach((function(t){t.addEventListener("change",(function(t){var n=t.target.getAttribute("name");e.querySelectorAll('input[type="checkbox"][name="'.concat(n,'"]')).forEach((function(e){e!==t.target&&(e.checked=!1)}))}))}))}(e),function(e){e.querySelectorAll(".has-free-text").forEach((function(t){var n=t.querySelector("input.wpcf7-free-text"),r=t.querySelector('input[type="checkbox"], input[type="radio"]');n.disabled=!r.checked,e.addEventListener("change",(function(e){n.disabled=!r.checked,e.target===r&&r.checked&&n.focus()}))}))}(e),function(e){e.querySelectorAll(".wpcf7-validates-as-url").forEach((function(e){e.addEventListener("change",(function(t){var n=e.value.trim();n&&!n.match(/^[a-z][a-z0-9.+-]*:/i)&&-1!==n.indexOf(".")&&(n="http://"+(n=n.replace(/^\/+/,""))),e.value=n}))}))}(e),function(e){if(e.querySelector(".wpcf7-acceptance")&&!e.classList.contains("wpcf7-acceptance-as-validation")){var t=function(){var t=!0;e.querySelectorAll(".wpcf7-acceptance").forEach((function(e){if(t&&!e.classList.contains("optional")){var n=e.querySelector('input[type="checkbox"]');(e.classList.contains("invert")&&n.checked||!e.classList.contains("invert")&&!n.checked)&&(t=!1)}})),e.querySelectorAll(".wpcf7-submit").forEach((function(e){e.disabled=!t}))};t(),e.addEventListener("change",(function(e){t()})),e.addEventListener("wpcf7reset",(function(e){t()}))}}(e),function(e){var t=function(e,t){var n=r(e.getAttribute("data-starting-value")),o=r(e.getAttribute("data-maximum-value")),c=r(e.getAttribute("data-minimum-value")),a=e.classList.contains("down")?n-t.value.length:t.value.length;e.setAttribute("data-current-value",a),e.innerText=a,o&&o{wpcf7.cached&&e.reset()}),e.addEventListener("reset",t=>{wpcf7.reset(e)}),e.addEventListener("submit",t=>{const n=t.submitter;wpcf7.submit(e,{submitter:n}),t.preventDefault()}),e.addEventListener("wpcf7submit",t=>{t.detail.apiResponse.captcha&&m(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&h(e,t.detail.apiResponse.quiz)}),e.addEventListener("wpcf7reset",t=>{t.detail.apiResponse.captcha&&m(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&h(e,t.detail.apiResponse.quiz)})}document.addEventListener("DOMContentLoaded",e=>{var t;if("undefined"==typeof wpcf7)return void console.error("wpcf7 is not defined.");if(void 0===wpcf7.api)return void console.error("wpcf7.api is not defined.");if("function"!=typeof window.fetch)return void console.error("Your browser doesn't support window.fetch().");if("function"!=typeof window.FormData)return void console.error("Your browser doesn't support window.FormData().");const n=document.querySelectorAll(".wpcf7 > form");"function"==typeof n.forEach?(wpcf7={init:g,submit:v,reset:w,...null!==(t=wpcf7)&&void 0!==t?t:{}},n.forEach(e=>wpcf7.init(e))):console.error("Your browser doesn't support NodeList.forEach().")})}]); \ No newline at end of file diff --git a/includes/js/src/submit.js b/includes/js/src/submit.js index 5ca9170a..e42db7cd 100644 --- a/includes/js/src/submit.js +++ b/includes/js/src/submit.js @@ -3,6 +3,13 @@ import { triggerEvent } from './event'; import { apiFetch } from './api-fetch'; export default function submit( form, options = {} ) { + + if ( wpcf7.blocked ) { + clearResponse( form ); + setStatus( form, 'submitting' ); + return; + } + const formData = new FormData( form ); if ( options.submitter && options.submitter.name ) {