var wpf={cachedFields:{},savedState:!1,initialSave:!0,orders:{fields:[],choices:{}},init:function(){wpf.bindUIActions(),wpf.initRadioGroupForCheckboxes(),jQuery(wpf.ready)},ready:function(){wpf.savedState=wpf.getFormState("#wpforms-builder-form"),wpf.setFieldOrders(),wpf.setChoicesOrders()},bindUIActions:function(){jQuery(document).on("wpformsFieldAdd",wpf.setFieldOrders),jQuery(document).on("wpformsFieldDelete",wpf.setFieldOrders),jQuery(document).on("wpformsFieldMove",wpf.setFieldOrders),jQuery(document).on("wpformsFieldAdd",wpf.setChoicesOrders),jQuery(document).on("wpformsFieldChoiceAdd",wpf.setChoicesOrders),jQuery(document).on("wpformsFieldChoiceDelete",wpf.setChoicesOrders),jQuery(document).on("wpformsFieldChoiceMove",wpf.setChoicesOrders),jQuery(document).on("wpformsFieldAdd",wpf.fieldUpdate),jQuery(document).on("wpformsFieldDelete",wpf.fieldUpdate),jQuery(document).on("wpformsFieldMove",wpf.fieldUpdate),jQuery(document).on("focusout",".wpforms-field-option-row-label input",wpf.fieldUpdate),jQuery(document).on("wpformsFieldChoiceAdd",wpf.fieldUpdate),jQuery(document).on("wpformsFieldChoiceDelete",wpf.fieldUpdate),jQuery(document).on("wpformsFieldChoiceMove",wpf.fieldUpdate),jQuery(document).on("wpformsFieldDynamicChoiceToggle",wpf.fieldUpdate),jQuery(document).on("focusout",".wpforms-field-option-row-choices input.label",wpf.fieldUpdate)},setFieldOrders:function(){wpf.orders.fields=[],jQuery(".wpforms-field-option").each(function(){wpf.orders.fields.push(jQuery(this).data("field-id"))})},setChoicesOrders:function(){wpf.orders.choices={},jQuery(".choices-list").each(function(){var e=jQuery(this).data("field-id");wpf.orders.choices["field_"+e]=[],jQuery(this).find("li").each(function(){wpf.orders.choices["field_"+e].push(jQuery(this).data("key"))})})},getChoicesOrder:function(e){var r=[];return jQuery("#wpforms-field-option-"+e).find(".choices-list li").each(function(){r.push(jQuery(this).data("key"))}),r},initMultipleSelectWithSearch:function(e){const r=jQuery(e.passedElement.element),t=jQuery(e.input.element);r.prop("multiple")&&(t.data("placeholder",t.attr("placeholder")),e.getValue(!0).length&&t.removeAttr("placeholder"),r.on("change",function(){e.getValue(!0).length?t.removeAttr("placeholder"):t.attr("placeholder",t.data("placeholder"))}))},fieldUpdate:function(){var e=wpf.getFields();jQuery(document).trigger("wpformsFieldUpdate",[e]),wpf.debug("fieldUpdate triggered")},getFields:function(e,r){if((r=r||!1)&&!jQuery.isEmptyObject(wpf.cachedFields)){var t=jQuery.extend({},wpf.cachedFields);wpf.debug("getFields triggered (cached)")}else{var i=["captcha","content","divider","entry-preview","html","internal-information","layout","pagebreak"];if(!(t=wpf.formObject("#wpforms-field-options").fields))return!1;for(n in t)(!t[n].type||-1'),t.find(".wpforms-help-tooltip").hide(),e.find("input,select,textarea").prop("disabled",!0))},getFormState:function(e){return jQuery(e).serialize()},removeArrayItem:function(e,r){for(var t=0,i=0;i&]/gim,function(e){return"&#"+e.charCodeAt(0)+";"})},initRadioGroupForCheckboxes:function(){var i=jQuery;i(document).on("change",'input[type="checkbox"].wpforms-radio-group',function(){var e,r=i(this),t=r.attr("id");r.prop("checked")&&(r=r.data("radio-group"),i(".wpforms-radio-group-"+r).each(function(){(e=i(this)).attr("id")!==t&&e.prop("checked",!1)}))})},listPluck:function(e,r){return e.map(function(e){return void 0!==e?e[r]:e})},triggerEvent:function(e,r){return console.warn('WARNING! Function "wpf.triggerEvent( $element, eventName )" has been deprecated, please use the new "WPFormsUtils.triggerEvent( $element, eventName, args )" function instead!'),WPFormsUtils.triggerEvent(e,r)},wpautop:function(i,e=!0){let n=new Map;if("string"==typeof i||i instanceof String){if(""===i.trim())return"";-1<(i+="\n").indexOf("")).pop(),i="",r.forEach(function(e,r){var t=e.indexOf("",n[r]=e.substring(t)+"",i+=e.substring(0,t)+r)}),i+=t);var r="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)",t=(i=(i=-1<(i=-1<(i=-1<(i=0===(i=(i=(i=(i=i.replace(/
\s*
/,"\n\n")).replace(new RegExp("(<"+r+"[^>]*>)","gmi"),"\n$1")).replace(new RegExp("()","gmi"),"$1\n\n")).replace(/\r\n|\r/,"\n")).indexOf("\n")?i.substring(1):i).indexOf("\s*/gim,""):i).indexOf("")?(i=(i=i.replace(/(]*>)\s*/gim,"$1")).replace(/(?=(\s*))\2<\/object>/gim,"")).replace(/(?=(\s*))\2(<\/?(?:param|embed)[^>]*>)((?=(\s*))\2)/gim,"$1"):i).indexOf("\]]*[>\]])\s*/gim,"$1")).replace(/(?=(\s*))\2([<\[]\/(?:audio|video)[>\]])/gim,"$1")).replace(/(?=(\s*))\2(<(?:source|track)[^>]*>)(?=(\s*))\2/gim,"$1"):i).replace(/\n\n+/gim,"\n\n")).split(/\n\s*\n/);i="",t.forEach(function(e){i+="

"+e.replace(/^(?:\s+|\s+)$/g,"")+"

\n"}),i=(i=(i=(i=(i=(i=(i=(i=i.replace(/

\s*<\/p>/gim,"")).replace(/

([^<]+)<\/(div|address|form)>/gim,"

$1

")).replace(new RegExp("

s*(]*>)s*

","gmi"),"$1",i)).replace(/

(/gim,"$1")).replace(/

]*)>/gim,"

")).replace(/<\/blockquote><\/p>/gim,"

")).replace(new RegExp("

s*(]*>)","gmi"),"$1")).replace(new RegExp("(]*>)s*

","gmi"),"$1"),i=(i=(i=(i=e?(i=(i=i.replace(/<(script|style)(?:.|\n)*?<\/\\1>/gim,function(e){return e[0].replace("\n","")})).replace(/(
)?((?=(\s*))\2)\n/gim,"
\n")).replace("","\n"):i).replace(new RegExp("(]*>)s*
","gmi"),"$1")).replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/gim,"$1")).replace(/\n<\/p>$/gim,"

"),Object.keys(n).length&&(i=i.replace(new RegExp(Object.keys(n).join("|"),"gi"),function(e){return n[e]}))}return i}};wpf.init();