var WPFormsUtils=window.WPFormsUtils||(o=>{let a={triggerEvent(r,t,e=[]){t=new o.Event(t);return r.trigger(t,e),t},debounce(o,s,l){let a;return function(){let r=this,t=arguments;var e=l&&!a;clearTimeout(a),a=setTimeout(function(){a=null,l||o.apply(r,t)},s),e&&o.apply(r,t)}},cssColorsUtils:{isTransparentColor(r,t=.33){r=a.cssColorsUtils.getColorAsRGBArray(r);return Number(r?.[3])<=t},getColorAsRGBArray(r){if(!a.cssColorsUtils.isValidColor(r))return!1;r="transparent"===(r=r.replace(/^#/,"").replaceAll(" ",""))?"rgba(0,0,0,0)":r;let t;return r.match(/[0-9a-f]{6,8}$/gi)?(t=r.match(/\w\w/g).map(r=>parseInt(r,16)))[3]=t[3]||0===t[3]?(t[3]/255).toFixed(2):1:t=r.split("(")[1].split(")")[0].split(","),t},isValidColor(r){var t=(new Option).style;return t.color=r,""!==t.color},getContrastColor(r){var r=a.cssColorsUtils.getColorAsRGBArray(r),t=r.reduce((r,t)=>r+t,0);return Math.round(t/3*(r[3]??1))<128?"#ffffff":"#000000"},getColorWithOpacity(r,t){r=r.trim();var e=a.cssColorsUtils.getColorAsRGBArray(r);if(!e)return r;t=t&&0!==t.length?t.toString():"1";r=4===e.length?parseFloat(e[3]):1,t=parseFloat(t)*r;return`rgba(${e[0]},${e[1]},${e[2]},${t})`.replace(/\s+/g,"")},rgbaToHex(r){var t,e,o,s,l;return/^rgb/.test(r)?!!(s=a.cssColorsUtils.getColorAsRGBArray(r))&&(t=Number(s[0]),e=Number(s[1]),o=Number(s[2]),s=s[3]?Math.round(255*Number(s[3])):255,("#"+[(l=r=>r.toString(16).padStart(2,"0"))(t),l(e),l(o),s<255?l(s):""].join("")).toLowerCase()):r}}};return a})((document,window,jQuery));; ((e,s)=>{let o={noStateCountries:[],init(){s(e).on("load",o.onLoad),s(document).on("wpformsRepeaterFieldCloneCreated",o.setChangeHandlers)},onLoad(){o.noStateCountries=wpforms_settings?.address_field?.list_countries_without_states||[],o.noStateCountries.length&&o.setChangeHandlers()},setChangeHandlers(){s(".wpforms-field-address").each(function(){var e=s(this).find("select.wpforms-field-address-country");e.length&&(o.handleCountryChange(e),e.off("change").on("change",function(){o.handleCountryChange(this)}))})},handleCountryChange(e){var e=s(e),t=e.closest(".wpforms-field").find(".wpforms-field-address-state"),n=t.closest(".wpforms-field-row");n.length&&(e=e.val(),o.handleStateInput(t,n,e))},handleStateInput(e,t,n){o.noStateCountries.includes(n)?(e.val("").prop("disabled",!0).prop("required",!1).on("change",function(){s(this).val("")}),t.addClass("wpforms-without-state")):(e.prop("disabled",!1).prop("required",t.find(".wpforms-first input").prop("required")).off("change"),t.removeClass("wpforms-without-state"))}};o.init(),o})(window,jQuery);;