← Back
Editing: form-save-progress.js
/*! For license information please see form-save-progress.js.LICENSE.txt */ (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,n(r.key),r)}}function n(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,n||"default");if("object"!=t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}var i=function(){return n=function t(e,n,i,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$=e,this.$theForm=n,this.fluentFormVars=i,this.formSelector=r,this.activeStep=0,this.isRtl=!!window.fluentFormVars.is_rtl,this.isPopulatingStepData=!1,this.isInitialLoad=!0,this.fluentFormVars.stepAnimationDuration=parseInt(this.fluentFormVars.stepAnimationDuration),this.stepPersistency="yes"===this.$theForm.find(".ff-step-container").attr("data-enable_step_data_persistency"),this.stepResume=!1,this.stepPersistency&&(this.stepResume="yes"===this.$theForm.find(".ff-step-container").attr("data-enable_step_page_resume"))},i=[{key:"getPublicAPI",value:function(){return{init:this.init.bind(this),updateSlider:this.updateSlider.bind(this),populateFormDataAndSetActiveStep:this.populateFormDataAndSetActiveStep.bind(this)}}},{key:"init",value:function(){this.initFormWithSavedState(),this.removePrevFromFirstStep(),this.initStepSlider(),this.maybeAutoSlider()}},{key:"removePrevFromFirstStep",value:function(){this.$theForm.find(".fluentform-step:first").find('.step-nav [data-action="prev"]').remove()}},{key:"getFormInstance",value:function(){return window.fluentFormApp(this.$theForm)}},{key:"syncStepTitleState",value:function(t,e){var n=this.$;t&&t.length&&(t.removeClass("ff_active ff_completed").removeAttr("aria-current"),n.each(t,function(t,i){var r=n(i);t<e?r.addClass("ff_completed"):t===e&&r.addClass("ff_active").attr("aria-current","step")}))}},{key:"enhanceClickableStepTitles",value:function(t){var e=this.$;e.each(t,function(t,n){e(n).attr("data-step-number",t),e(n).attr({role:"button",tabindex:"0","aria-label":"Go to step "+(t+1)})})}},{key:"syncTopTabOverflowState",value:function(){var t=this.$;this.$theForm.find(".ff-step-header--tabs-top .ff-step-titles").each(function(){var e=t(this),n=this.scrollWidth>this.clientWidth+1;e.toggleClass("ff-step-titles--overflowing",n)})}},{key:"isTabsIndicator",value:function(t){return"tabs"===t||"steps_with_nav"===t}},{key:"isClickableIndicator",value:function(t){return this.isTabsIndicator(t)||"steps"===t}},{key:"initFormWithSavedState",value:function(){var t=this;if(this.stepPersistency){var e=this.$,n=this;e(document).ready(function(i){var r,o;e.getJSON(t.fluentFormVars.ajaxUrl,{form_id:t.$theForm.data("form_id"),action:"fluentform_step_form_get_data",nonce:null===(r=t.fluentFormVars)||void 0===r?void 0:r.nonce,hash:null===(o=t.fluentFormVars)||void 0===o?void 0:o.hash}).then(function(t){t&&n.populateFormDataAndSetActiveStep(t)})})}}},{key:"populateFormDataAndSetActiveStep",value:function(t){var e=this,n=t.response,i=t.step_completed,r=this.$,o=[];if(this.$theForm.data("ff_restoring_draft_state",!0),this.$theForm.data("ff_restored_draft_state",!0),r.each(n,function(t,n){if(n){var i=Object.prototype.toString.call(n);if("[object Object]"===i){var a=e.$theForm.find("[data-name=".concat(t,"]"));if(a.length&&"tabular-element"===a.attr("data-type"))jQuery.each(n,function(n,i){var o=e.$theForm.find('[name="'.concat(t,"[").concat(n,']\\[\\]"]'));o.length||(o=e.$theForm.find('[name="'.concat(t,"[").concat(n,']"]'))),r.each(o,function(t,e){var n=r(e).val();-1===r.inArray(n,i)&&n!==i||r(e).prop("checked",!0).change()})});else if("chained-select"===a.attr("data-type")){var s={meta_key:a.find("select:first").attr("data-meta_key"),form_id:a.closest("form").attr("data-form_id"),action:"fluentform_get_chained_select_options",filter_options:"all",keys:n};r.getJSON(e.fluentFormVars.ajaxUrl,s).then(function(t){r.each(t,function(t,e){var i=a.find("select[data-key='".concat(t,"']"));0!=i.attr("data-index")&&r.each(e,function(t,e){i.append(r("<option />",{value:e,text:e}))}),i.attr("disabled",!1).val(n[t])})})}else r.each(n,function(n,i){e.$theForm.find('[name="'.concat(t,"[").concat(n,']"]')).val(i).change()})}else if("[object Array]"===i){var l=e.$theForm.find("[name=".concat(t,"]"));if("file"===(l=(l=l.length?l:e.$theForm.find("[data-name=".concat(t,"]"))).length?l:e.$theForm.find("[name=".concat(t,"\\[\\]]"))).attr("type"))e.addFilesToElement(l,n);else if(l.prop("multiple"))if(r.isFunction(window.Choices)){var f=l.data("choicesjs");f&&o.push({handler:f,values:n})}else l.val(n).change();else if("repeater_field"===l.attr("data-type")){var c=l.find("tbody"),u=l.attr("data-name");r.each(n,function(t,e){0!=t?c.find("tr:last").clone().appendTo(c).find(".ff-el-form-control").each(function(n,i){var o="ffrpt-"+(new Date).getTime()+n;r(i).val(e[n]),r(i).attr({id:o,name:"".concat(u,"[").concat(t,"][]"),value:e[n]}).change()}):c.find("tr:first .ff-el-form-control").each(function(t,n){r(n).val(e[t]).change()})})}else"repeater_container"===l.attr("data-type")?(r.each(n,function(t,e){if(0!==t){var n=l.find(".ff_repeater_cont_row:first").clone();n.find(".ff_repeater_cell").each(function(n,i){var o=r(this).find(".ff-el-form-control:last-child"),a="ffrpt-"+(new Date).getTime()+"_"+t+"_"+n,s={value:e[n]||"",id:a};o.prop(s),r(this).find("label").attr("for",a)}),n.insertAfter(l.find(".ff_repeater_cont_row:last"))}else l.find(".ff_repeater_cont_row:first .ff-el-form-control").each(function(t,n){r(n).val(e[t]).change()})}),e.$theForm.trigger("repeater-container-names-update",[l]),l.trigger("repeat_change")):l.each(function(t,e){-1!==r.inArray(r(e).val(),n)&&r(e).prop("checked",!0).change()})}else{var d=e.$theForm.find("[name=".concat(t,"]"));if(d.hasClass("fluentform-post-content")&&window.wp&&window.wp.editor){var p=d.attr("id");window.tinymce.get(p).setContent(n)}if("undefined"!=typeof flatpickr&&d.prop("_flatpickr")){var m=d.prop("_flatpickr");m&&(m.config.altInput?m.setDate(n,!0):d.val(n).trigger("change"))}if("radio"===d.prop("type")||"checkbox"===d.prop("type"))e.$theForm.find("[name=".concat(t,'][value="').concat(n,'"]')).prop("checked",!0).change(),d.closest(".ff-el-group").find(".ff-el-ratings").length&&e.$theForm.find("[name=".concat(t,'][value="').concat(n,'"]')).closest("label").trigger("mouseenter");else{d.hasClass("ff_has_multi_select")&&d.data("choicesjs")&&(d.data("choicesjs").removeActiveItems(n),d.data("choicesjs").setChoiceByValue(n));var h=d.closest(".ff-el-group").find(".fluentform-signature-pad");if(h.length){var v=h[0].getContext("2d"),g=new Image;g.src=n,g.onload=function(){v.drawImage(g,0,0)}}d.val(n).change()}}}}),o.length>0)for(var a=0;a<o.length;a++){var s,l=o[a].handler,f=o[a].values;l.removeActiveItems(f),l.setChoiceByValue(f);var c=null===(s=l.passedElement)||void 0===s?void 0:s.element;c&&r(c).trigger("change")}this.$theForm.data("ff_restoring_draft_state",!1),this.isPopulatingStepData=!0;var u=this.fluentFormVars.stepAnimationDuration;this.stepResume&&this.updateSlider(i,u,!0).then(function(){e.handleFocus(u)}).catch(function(t){console.error("An error occurred during the slider update:",t)}),this.isPopulatingStepData=!1}},{key:"initStepSlider",value:function(){var t=this.$,e=this.$theForm.find(".fluentform-step"),n=e.length,i=this.$theForm.find(".ff-step-titles li"),r=this.$theForm.find(".ff-step-container").first().data("progress_indicator"),o=this.isClickableIndicator(r)&&this.$theForm.find(".ff-step-titles").first().hasClass("ff-step-titles--clickable");if(!window.ff_disable_auto_step){for(var a=this.activeStep,s=0;a<n&&this.isStepAllFieldsHidden(t(e[a]))&&s<n;)a++,s++;a!==this.activeStep&&a<n&&(this.activeStep=a)}e.css("display","none"),t(e[this.activeStep]).css("display","block"),e.attr("role","group"),e.attr("aria-hidden","true"),t(e[this.activeStep]).attr("aria-hidden","false"),t(e[this.activeStep]).addClass("active"),this.syncStepTitleState(i,this.activeStep);var l=e.first();l.hasClass("active")&&l.find('button[data-action="next"]').css("visibility","visible"),e.length&&!e.last().hasClass("active")&&this.$theForm.find('button[type="submit"]').css("visibility","hidden"),this.stepProgressBarHandle({activeStep:this.activeStep,totalSteps:n}),this.registerStepNavigators(this.fluentFormVars.stepAnimationDuration),o&&this.registerClickableStepNav(i,e),this.isTabsIndicator(r)?(this.syncTopTabOverflowState(),t(window).off("resize.ff_step_tabs_"+this.$theForm.data("form_id")).on("resize.ff_step_tabs_"+this.$theForm.data("form_id"),this.syncTopTabOverflowState.bind(this))):t(window).off("resize.ff_step_tabs_"+this.$theForm.data("form_id"))}},{key:"registerClickableStepNav",value:function(t,e){var n=this.$,i=this;0!==t.length&&(this.enhanceClickableStepTitles(t),t.on("click keydown",function(t){if("keydown"!==t.type||"Enter"===t.key||" "===t.key||13===t.keyCode||32===t.keyCode){"keydown"===t.type&&t.preventDefault();var r=i.getFormInstance(),o=n(this),a=i.fluentFormVars.stepAnimationDuration,s=e.index(i.$theForm.find(".fluentform-step.active"));try{var l=parseInt(o.data("step-number"),10);if(isNaN(l))return;if(l===s)return;l>s&&n.each(e,function(t,e){if(t<l){var i=n(e).find(":input").not(":button").filter(function(t,e){return!n(e).closest(".has-conditions").hasClass("ff_excluded")});i.length&&r.validate(i)}}),i.updateSlider(l,a,!0).then(function(){i.handleFocus(a)}).catch(function(t){console.error("An error occurred during the slider update:",t)})}catch(t){if(!(t instanceof window.ffValidationError))throw t;i.updateSlider(s,a,!0).then(function(){i.handleFocus(a)}).catch(function(t){console.error("An error occurred during the slider update:",t)}),r.showErrorMessages(t.messages),r.scrollToFirstError(350)}}}))}},{key:"stepProgressBarHandle",value:function(t){var e=this.$;if(this.$theForm.find(".ff-el-progress").length){var n=t.totalSteps,i=t.activeStep,r=100/n*(i+1),o=this.$theForm.find(".ff-el-progress-title li"),a=this.$theForm.find(".ff-step-header .ff-el-progress-bar"),s=a.find("span"),l=this.$theForm.find(".ff-step-container").first(),f=this.isTabsIndicator(l.data("progress_indicator"));a.css({transition:"width 0.3s ease-in-out",width:r+"%"}),r?a.append(s.text(parseInt(r)+"%")):s.empty();var c=this.fluentFormVars.step_text,u=e(o[i]).text();c=f?parseInt(r)+"% "+this.fluentFormVars.step_completed_text:c.replace("%activeStep%",i+1).replace("%totalStep%",n).replace("%stepTitle%",u),this.$theForm.find(".ff-el-progress-status").text(c).attr("aria-live","polite"),o.css("display","none"),e(o[i]).css("display","inline")}}},{key:"isStepAllFieldsHidden",value:function(t){return this.$,t.find(".ff-el-group").not(".ff-custom_html").length,!1}},{key:"animateProgressToStep",value:function(t,e,n){this.$;var i=this.$theForm.find(".ff-step-header .ff-el-progress-bar");if(!i.length||!e)return Promise.resolve();var r=100/e*(t+1);return n&&n>0?i.css({transition:"width ".concat(n,"ms ease-in-out")}):i.css({transition:"none"}),i[0]&&i[0].offsetHeight,i.css("width",r+"%"),new Promise(function(t){var e=!1,r=setTimeout(function(){e||(e=!0,t())},(n||0)+120);i.one("transitionend webkitTransitionEnd oTransitionEnd",function(){e||(e=!0,clearTimeout(r),t())})})}},{key:"registerStepNavigators",value:function(t){var e=this.$,n=this;this.handleFocus(t),e(this.formSelector).on("click",".fluentform-step .step-nav button, .fluentform-step .step-nav img",function(i){var r=e(this).data("action"),o="next",a=e(this).closest(".fluentform-step"),s=n.getFormInstance();if("next"===r){try{var l=a.find(":input").not(":button").filter(function(t,n){return!e(n).closest(".has-conditions").hasClass("ff_excluded")});l.length&&s.validate(l),n.activeStep++}catch(i){if(!(i instanceof window.ffValidationError))throw i;return s.showErrorMessages(i.messages),void s.scrollToFirstError(350)}n.$theForm.trigger("ff_to_next_page",n.activeStep),e(document).trigger("ff_to_next_page",{step:n.activeStep,form:n.$theForm});var f=n.$theForm.find(".fluentform-step");n.$theForm.trigger("ff_render_dynamic_smartcodes",e(f[n.activeStep]))}else n.activeStep--,o="prev",n.$theForm.trigger("ff_to_prev_page",n.activeStep),e(document).trigger("ff_to_prev_page",{step:n.activeStep,form:n.$theForm});var c="yes"!=n.$theForm.find(".ff-step-container").attr("data-disable_auto_focus");n.updateSlider(n.activeStep,t,c,o).then(function(){n.handleFocus(t)}).catch(function(t){console.error("An error occurred during the slider update:",t)})})}},{key:"updateSlider",value:function(t,e){var n=this,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"next",o=this.$,a=this;return new Promise(function(s){o("div"+n.formSelector+"_errors").empty(),n.activeStep=t;var l=n.$theForm.find(".ff-step-titles li"),f=n.$theForm.find(".fluentform-step"),c=f.length;if(!window.ff_disable_auto_step&&c){var u=a.$theForm.find(".fluentform-step").index(a.$theForm.find(".fluentform-step.active"));if("prev"===r||u>-1&&n.activeStep<u)for(;n.activeStep>0&&n.isStepAllFieldsHidden(o(f[n.activeStep]));)n.activeStep--;else for(;n.activeStep<c-1&&n.isStepAllFieldsHidden(o(f[n.activeStep]));)n.activeStep++}f.css("display","none").removeClass("active").attr("aria-hidden","true"),o(f[n.activeStep]).css("display","block").addClass("active").attr("aria-hidden","false"),n.syncStepTitleState(l,n.activeStep);var d=o(f[n.activeStep]).closest(".ff-step-container").data("animation_type"),p=o(f[n.activeStep]).closest(".ff-step-container"),m=o(f[n.activeStep]).closest(".ff-step-body"),h=n.isTabsIndicator(p.data("progress_indicator"));h&&m.css("overflow","hidden");var v=o(f[n.activeStep]);v.find(".step-nav button, .step-nav img").css("visibility","hidden");var g,y=c;g="none"===d?0===e?0:e<50?50:e<200?e:window.ffTransitionTimeOut||500:e;var _,b=n.animateProgressToStep(n.activeStep,y,g);switch(d){case"slide":v.css({display:"block",position:"relative",left:n.isRtl?"-100%":"100%",opacity:0,transition:"all ".concat(e,"ms cubic-bezier(0.25, 0.1, 0.25, 1.0)")}),v[0].offsetHeight,v.css({left:"0%",opacity:1}),_=new Promise(function(t){return setTimeout(function(){v.css({position:"",left:"",transition:""}),t()},e+50)});break;case"fade":v.css({display:"block",opacity:0,transition:"opacity ".concat(e,"ms ease-in-out")}),v[0].offsetHeight,v.css("opacity",1),_=new Promise(function(t){return setTimeout(function(){v.css("transition",""),t()},e+50)});break;case"slide_down":v.css({display:"block",opacity:0,maxHeight:"0",overflow:"hidden",transition:"all ".concat(e,"ms cubic-bezier(0.25, 0.1, 0.25, 1.0)")}),v[0].offsetHeight;var S=v[0].scrollHeight;v.css({maxHeight:S+"px",opacity:1}),_=new Promise(function(t){return setTimeout(function(){v.css({maxHeight:"",overflow:"",transition:""}),t()},e+50)});break;default:var w,T=window.ffTransitionTimeOut||500;w=e<50&&e>0?50:e<T?e:T,_=new Promise(function(t){return setTimeout(t,w)})}Promise.all([_,b]).then(function(){i&&function(){if(!window.ff_disable_step_scroll){var t,e,n,i,r,s,l=a.$theForm.find(".ff_step_start");t=window.ff_scroll_top_offset?window.ff_scroll_top_offset:l.offset().top-100,i=(n=(e=l).offset().top)+e.outerHeight(),s=(r=o(window).scrollTop())+o(window).height(),i>r&&n<s&&!window.ff_force_scroll||o("html, body").animate({scrollTop:t},500,"swing")}}(),function(){h&&m.css("overflow","");var e=0===t&&!i,n=a.$theForm.hasClass("ff_submitting");!a.stepPersistency||a.isPopulatingStepData||e||n||a.saveStepData(a.$theForm,a.activeStep).then(function(t){}),a.stepProgressBarHandle({activeStep:a.activeStep,totalSteps:c});var l=a.$theForm.find('button[type="submit"]').not(".ff-btn-save-progress"),u=-1;if(l.length){var d=l[0];f.each(function(t){if(this.contains(d))return u=t,!1})}var p=f.index(a.$theForm.find(".fluentform-step.active")),v=u>=0&&p>=u;if(!v&&h){var g=a.$theForm.find(".ff-step-titles--clickable li").length;g>0&&p>=g-1&&(v=!0)}if(l.css("visibility",v?"visible":"hidden"),!window.ff_disable_auto_step){a.$theForm.find(".fluentform-step.active");var y=a.$theForm.find(".fluentform-step.active > .step-nav").length,_=a.$theForm.find(".fluentform-step.active > div").length-y,b=a.$theForm.find(".fluentform-step.active > .ff_excluded").length;if(a.$theForm.find(".fluentform-step.active > .ff-t-container").length&&(_-=a.$theForm.find(".fluentform-step.active > .ff-t-container").length,_+=a.$theForm.find(".fluentform-step.active > .ff-t-container > .ff-t-cell > div").length,b+=a.$theForm.find(".fluentform-step.active > .ff-t-container > .ff-t-cell > .ff_excluded").length,a.$theForm.find(".fluentform-step.active > .ff-t-container.ff_excluded").length&&(b-=a.$theForm.find(".fluentform-step.active > .ff-t-container.ff_excluded").length,b-=a.$theForm.find(".fluentform-step.active > .ff-t-container.ff_excluded > .ff-t-cell > .ff_excluded").length,b+=a.$theForm.find(".fluentform-step.active > .ff-t-container.ff_excluded > .ff-t-cell > div").length)),_===b){var S="prev"===r?a.activeStep-1:a.activeStep+1;if(S>=0&&S<c){var w="none"===o(f[S]).closest(".ff-step-container").data("animation_type")?50:100;return void a.updateSlider(S,w,i,r).then(function(){s()}).catch(function(t){console.error("An error occurred during step skip:",t),s()})}}}a.$theForm.find(".fluentform-step.active").find('.step-nav button[data-action="next"]').css("visibility","visible"),a.$theForm.find(".fluentform-step.active").find('.step-nav button[data-action="prev"]').css("visibility","visible"),a.$theForm.find(".fluentform-step.active").find('.step-nav img[data-action="next"]').css("visibility","visible"),a.$theForm.find(".fluentform-step.active").find('.step-nav img[data-action="prev"]').css("visibility","visible"),s()}()})})}},{key:"handleFocus",value:function(t){var e=this.$,n=this,i=!1,r=function(i){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o="yes"!=n.$theForm.find(".ff-step-container").attr("data-disable_auto_focus");if(!n.isInitialLoad){var a;if(o){if(!window.ff_disable_step_scroll){var s=i.find("input, .ff-custom_html, select, textarea, button, a").filter(":visible");s.length&&r&&setTimeout(function(){s.first().focus()},t+50)}}else null!==(a=window.fluentFormVars)&&void 0!==a&&a.step_change_focus&&!window.ff_disable_step_scroll&&setTimeout(function(){e("".concat(n.formSelector," .fluentform-step.active")).attr("tabindex","-1").focus().removeAttr("tabindex")},t);n.isInitialLoad=!1}};n.$theForm.off("keydown.stepNavigation").on("keydown.stepNavigation",function(t){if(!i&&(" "===t.key||32===t.keyCode)){var r=e("".concat(n.formSelector," .fluentform-step.active .ff-btn-next")),o=e("".concat(n.formSelector," .fluentform-step.active .ff-btn-prev"));return document.activeElement===r[0]?(t.preventDefault(),void r.click()):document.activeElement===o[0]?(t.preventDefault(),void o.click()):void 0}}),this.$theForm.on("ff_to_next_page ff_to_prev_page",function(){i=!0,setTimeout(function(){i=!1,r(n.$theForm.find(".fluentform-step.active"),!0)},t+50)}),"yes"!==this.$theForm.find(".ff-step-container").attr("data-disable_auto_focus")&&0!==n.$theForm.find(".fluentform-step").index(n.$theForm.find(".fluentform-step.active"))&&!this.isInitialLoad&&r(e("".concat(this.formSelector," .fluentform-step.active")),!0),this.isInitialLoad=!1}},{key:"saveStepData",value:function(t,e){var n,i=this.$,r=t.find(":input").filter(function(t,e){return!i(e).closest(".has-conditions").hasClass("ff_excluded")});r.filter(function(t,e){var n=i(e);return n.parents().hasClass("ff_repeater_table")&&"select"==n.attr("type")&&!n.val()}).prepend("<option selected disabled />");var o=r.serialize();i.each(t.find("[type=file]"),function(t,e){var n={},r=e.name+"[]";n[r]=[],i(e).closest("div").find(".ff-uploaded-list").find(".ff-upload-preview[data-src]").each(function(t,e){n[r][t]=i(this).data("src")}),i.each(n,function(t,e){if(e.length){var n={};n[t]=e,o+="&"+i.param(n)}})});var a={active_step:e,data:o,form_id:t.data("form_id"),action:"fluentform_step_form_save_data",nonce:null===(n=this.fluentFormVars)||void 0===n?void 0:n.nonce};return i.post(this.fluentFormVars.ajaxUrl,a)}},{key:"maybeAutoSlider",value:function(){var t=this.$;if("yes"==this.$theForm.find(".ff-step-container").attr("data-enable_auto_slider")){var e=function(t){if(1==t.closest(".fluentform-step.active").find(".ff-el-group:not(.ff_excluded):not(.ff-custom_html)").length)if(t.closest(".fluentform-step.active").find(".ff_excluded").length){var e=window.ffTransitionTimeOut||500;setTimeout(function(){t.closest(".fluentform-step.active").find(".ff-btn-next").trigger("click")},e)}else t.closest(".fluentform-step.active").find(".ff-btn-next").trigger("click")};this.$theForm.find(".ff-el-form-check-radio,.ff-el-net-label, .ff-el-ratings label").on("click",function(){e(t(this))}),this.$theForm.find("select").on("change",function(){e(t(this))})}}},{key:"addFilesToElement",value:function(e,n){var i=this.$,r=this,o=e.closest(".ff-el-input--content").find(".ff-uploaded-list");i.each(n,function(e,n){n="object"===t(n)?n:{url:n,data_src:n};var a=i("<div/>",{class:"ff-upload-preview","data-src":n.data_src,style:"border: 1px solid rgb(111, 117, 125)"}),s=i("<div/>",{class:"ff-upload-thumb"});s.append(i("<div/>",{class:"ff-upload-preview-img",style:"background-image: url('".concat(r.getThumbnail(n.url),"');")}));var l=i("<div/>",{class:"ff-upload-details"}),f=i("<span/>",{html:r.fluentFormVars.upload_completed_txt,class:"ff-upload-progress-inline-text ff-inline-block"}),c=n.url.substring(n.url.lastIndexOf("/")+1);c.includes("-ff-")&&(c=c.substring(c.lastIndexOf("-ff-")+4));var u=i("<div/>",{class:"ff-upload-filename",html:c}),d=i('\n <div class="ff-upload-progress-inline ff-el-progress">\n <div style="width: 100%;" class="ff-el-progress-bar"></div>\n </div>\n '),p=i("<span/>",{"data-href":"#",html:"×",class:"ff-upload-remove"}),m=i("<div>",{class:"ff-upload-filesize ff-inline-block",html:""}),h=i("<div>",{class:"ff-upload-error",style:"color:red;"});l.append(u,d,f,m,h,p),a.append(s,l),o.append(a)}),e.trigger("change_remaining",-n.length),e.trigger("change")}},{key:"getThumbnail",value:function(t){if(!t)return"";var e=t.split(/[#?]/)[0].split(".").pop().trim().toLowerCase();if(-1!=["jpg","jpeg","gif","png"].indexOf(e))return t;var n=document.createElement("canvas");n.width=60,n.height=60,n.style.zIndex=8,n.style.position="absolute",n.style.border="1px solid";var i=n.getContext("2d");return i.fillStyle="rgba(0, 0, 0, 0.2)",i.fillRect(0,0,60,60),i.font="13px Arial",i.fillStyle="white",i.textAlign="center",i.fillText(e,30,30,60),n.toDataURL()}}],i&&e(n.prototype,i),r&&e(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i,r}();function r(t,e){this.v=t,this.k=e}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,f=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){f=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(f)throw r}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t){var e,n;function i(e,n){try{var a=t[e](n),s=a.value,l=s instanceof r;Promise.resolve(l?s.v:s).then(function(n){if(l){var r="return"===e&&s.k?e:"next";if(!s.k||n.done)return i(r,n);n=t[r](n).value}o(!!a.done,n)},function(t){i("throw",t)})}catch(t){o(2,t)}}function o(t,r){2===t?e.reject(r):e.resolve({value:r,done:t}),(e=e.next)?i(e.key,e.arg):n=null}this._invoke=function(t,r){return new Promise(function(o,a){var s={key:t,arg:r,resolve:o,reject:a,next:null};n?n=n.next=s:(e=n=s,i(t,r))})},"function"!=typeof t.return&&(this.return=void 0)}s.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},s.prototype.next=function(t){return this._invoke("next",t)},s.prototype.throw=function(t){return this._invoke("throw",t)},s.prototype.return=function(t){return this._invoke("return",t)};const l=Object.entries,f=Object.setPrototypeOf,c=Object.isFrozen,u=Object.getPrototypeOf,d=Object.getOwnPropertyDescriptor;let p=Object.freeze,m=Object.seal,h=Object.create,v="undefined"!=typeof Reflect&&Reflect,g=v.apply,y=v.construct;p||(p=function(t){return t}),m||(m=function(t){return t}),g||(g=function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return t.apply(e,i)}),y||(y=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return new t(...n)});const _=B(Array.prototype.forEach);Array.prototype.indexOf;const b=B(Array.prototype.lastIndexOf),S=B(Array.prototype.pop),w=B(Array.prototype.push),T=B(Array.prototype.slice),A=B(Array.prototype.splice),k=Array.isArray,x=V(Set),F=B(Set.prototype.add),E=B(Set.prototype.has),C=B(String.prototype.toLowerCase),D=B(String.prototype.toString),O=B(String.prototype.match),N=B(String.prototype.replace),I=B(String.prototype.indexOf),$=B(String.prototype.trim),R=B(Number.prototype.toString),P=B(Boolean.prototype.toString),z="undefined"==typeof BigInt?null:B(BigInt.prototype.toString),L="undefined"==typeof Symbol?null:B(Symbol.prototype.toString),M=B(Object.prototype.hasOwnProperty),j=B(Object.prototype.toString),U=B(RegExp.prototype.test),H=V(TypeError);function B(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return g(t,e,i)}}function V(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return y(t,n)}}function W(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C;if(f&&f(t,null),!k(e))return t;let i=e.length;for(;i--;){let r=e[i];if("string"==typeof r){const t=n(r);t!==r&&(c(e)||(e[i]=t),r=t)}t[r]=!0}return t}function Y(t){for(let e=0;e<t.length;e++)M(t,e)||(t[e]=null);return t}function G(t){const e=h(null);for(const i of l(t)){var n=a(i,2);const r=n[0],o=n[1];M(t,r)&&(k(o)?e[r]=Y(o):o&&"object"==typeof o&&o.constructor===Object?e[r]=G(o):e[r]=o)}return e}function q(t,e){for(;null!==t;){const n=d(t,e);if(n){if(n.get)return B(n.get);if("function"==typeof n.value)return B(n.value)}t=u(t)}return function(){return null}}const K=p(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),X=p(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Z=p(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),J=p(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Q=p(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),tt=p(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),et=p(["#text"]),nt=p(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),it=p(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),rt=p(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ot=p(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),at=m(/{{[\w\W]*|^[\w\W]*}}/g),st=m(/<%[\w\W]*|^[\w\W]*%>/g),lt=m(/\${[\w\W]*/g),ft=m(/^data-[\-\w.\u00B7-\uFFFF]+$/),ct=m(/^aria-[\-\w]+$/),ut=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dt=m(/^(?:\w+script|data):/i),pt=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mt=m(/^html$/i),ht=m(/^[a-z][.\w]*(-[.\w]+)+$/i),vt=m(/<[/\w!]/g),gt=m(/<[/\w]/g),yt=m(/<\/no(script|embed|frames)/i),_t=m(/\/>/i),bt=1,St=3,wt=7,Tt=8,At=9,kt=11,xt=p(W({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Ft=function(){return"undefined"==typeof window?null:window},Et=function(t,e,n,i){return M(t,e)&&k(t[e])?W(i.base?G(i.base):{},t[e],i.transform):n},Ct=function(t,e,n){const i=M(t,e)?t[e]:void 0;return i&&"object"==typeof i?G(i):n()};var Dt=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ft();const n=e=>t(e);if(n.version="3.4.17",n.removed=[],!e||!e.document||e.document.nodeType!==At||!e.Element)return n.isSupported=!1,n;let i=e.document;const r=i,o=r.currentScript;e.DocumentFragment;const a=e.HTMLTemplateElement,s=e.Node,f=e.Element,c=e.NodeFilter;void 0===e.NamedNodeMap&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const v=e.DOMParser,g=e.trustedTypes,y=f.prototype,V=q(y,"cloneNode"),Y=q(y,"remove"),Dt=q(y,"removeAttributeNode"),Ot=q(y,"nextSibling"),Nt=q(y,"childNodes"),It=q(y,"parentNode"),$t=q(y,"shadowRoot"),Rt=q(y,"attributes"),Pt=s&&s.prototype?q(s.prototype,"nodeType"):null,zt=s&&s.prototype?q(s.prototype,"nodeName"):null,Lt=s&&s.prototype?q(s.prototype,"ownerDocument"):null,Mt=function(t){return Pt?Pt(t):t.nodeType},jt=function(t){return zt?zt(t):t.nodeName},Ut=function(t,e){for(;null!==t;){const n=d(t,e);if(n)return n.get?B(n.get):null;t=u(t)}return null}(y,"namespaceURI"),Ht=function(t){return Ut?Ut(t):t.namespaceURI};if("function"==typeof a){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let Bt,Vt,Wt="",Yt=!1,Gt=0;const qt=function(){if(Gt>0)throw H('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Kt=function(t){qt(),Gt++;try{return Bt.createHTML(t)}finally{Gt--}},Xt=function(){return Yt||(Vt=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(n=e.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(g,o),Yt=!0),Vt},Zt=i,Jt=Zt.implementation,Qt=Zt.createNodeIterator,te=Zt.createDocumentFragment,ee=Zt.getElementsByTagName,ne=r.importNode;let ie={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof l&&"function"==typeof It&&Jt&&void 0!==Jt.createHTMLDocument;const re=at,oe=st,ae=lt,se=ft,le=ct,fe=dt,ce=pt,ue=ht;let de=ut,pe=null;const me=W({},[...K,...X,...Z,...Q,...et]);let he=null;const ve=W({},[...nt,...it,...rt,...ot]);let ge=Object.seal(h(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ye=null,_e=null;const be=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Se=!0,we=!0,Te=!1,Ae=!0,ke=!1,xe=!0,Fe=!1,Ee=!1,Ce=null,De=null,Oe=!1,Ne=!1,Ie=!1,$e=!1,Re=!0,Pe=!1;const ze="user-content-";let Le=!0,Me=!1,je=null,Ue={},He=null;const Be=W({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ve=null;const We=W({},["audio","video","img","source","image","track"]);let Ye=null;const Ge=W({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qe="http://www.w3.org/1998/Math/MathML",Ke="http://www.w3.org/2000/svg",Xe="http://www.w3.org/1999/xhtml";let Ze=Xe,Je=!1,Qe=null;const tn=W({},[qe,Ke,Xe],D),en=p(["mi","mo","mn","ms","mtext"]);let nn=W({},en);const rn=p(["annotation-xml"]);let on=W({},rn);const an=W({},["title","style","font","a","script"]);let sn=null;const ln=["application/xhtml+xml","text/html"];let fn=null,cn=null;const un=i.createElement("form"),dn=function(t){return t instanceof RegExp||t instanceof Function},pn=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(cn&&cn===t)return;t&&"object"==typeof t||(t={}),t=G(t),sn=-1===ln.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,fn="application/xhtml+xml"===sn?D:C,pe=Et(t,"ALLOWED_TAGS",me,{transform:fn}),he=Et(t,"ALLOWED_ATTR",ve,{transform:fn}),Qe=Et(t,"ALLOWED_NAMESPACES",tn,{transform:D}),Ye=Et(t,"ADD_URI_SAFE_ATTR",Ge,{transform:fn,base:Ge}),Ve=Et(t,"ADD_DATA_URI_TAGS",We,{transform:fn,base:We}),He=Et(t,"FORBID_CONTENTS",Be,{transform:fn}),ye=Et(t,"FORBID_TAGS",G({}),{transform:fn}),_e=Et(t,"FORBID_ATTR",G({}),{transform:fn}),Ue=!!M(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?G(t.USE_PROFILES):t.USE_PROFILES),Se=!1!==t.ALLOW_ARIA_ATTR,we=!1!==t.ALLOW_DATA_ATTR,Te=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ke=t.SAFE_FOR_TEMPLATES||!1,xe=!1!==t.SAFE_FOR_XML,Fe=t.WHOLE_DOCUMENT||!1,Ne=t.RETURN_DOM||!1,Ie=t.RETURN_DOM_FRAGMENT||!1,$e=t.RETURN_TRUSTED_TYPE||!1,Oe=t.FORCE_BODY||!1,Re=!1!==t.SANITIZE_DOM,Pe=t.SANITIZE_NAMED_PROPS||!1,Le=!1!==t.KEEP_CONTENT,Me=t.IN_PLACE||!1,de=function(t){try{return U(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:ut,Ze="string"==typeof t.NAMESPACE?t.NAMESPACE:Xe,nn=Ct(t,"MATHML_TEXT_INTEGRATION_POINTS",()=>W({},en)),on=Ct(t,"HTML_INTEGRATION_POINTS",()=>W({},rn));const e=Ct(t,"CUSTOM_ELEMENT_HANDLING",()=>h(null));if(ge=h(null),M(e,"tagNameCheck")&&dn(e.tagNameCheck)&&(ge.tagNameCheck=e.tagNameCheck),M(e,"attributeNameCheck")&&dn(e.attributeNameCheck)&&(ge.attributeNameCheck=e.attributeNameCheck),M(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(ge.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),m(ge),ke&&(we=!1),Ie&&(Ne=!0),Ue&&(pe=W({},et),he=h(null),!0===Ue.html&&(W(pe,K),W(he,nt)),!0===Ue.svg&&(W(pe,X),W(he,it),W(he,ot)),!0===Ue.svgFilters&&(W(pe,Z),W(he,it),W(he,ot)),!0===Ue.mathMl&&(W(pe,Q),W(he,rt),W(he,ot))),be.tagCheck=null,be.attributeCheck=null,M(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?be.tagCheck=t.ADD_TAGS:k(t.ADD_TAGS)&&(pe===me&&(pe=G(pe)),W(pe,t.ADD_TAGS,fn))),M(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?be.attributeCheck=t.ADD_ATTR:k(t.ADD_ATTR)&&(he===ve&&(he=G(he)),W(he,t.ADD_ATTR,fn))),M(t,"ADD_FORBID_CONTENTS")&&k(t.ADD_FORBID_CONTENTS)&&(He===Be&&(He=G(He)),W(He,t.ADD_FORBID_CONTENTS,fn)),Le&&(pe["#text"]=!0),Fe&&W(pe,["html","head","body"]),pe.table&&(W(pe,["tbody"]),delete ye.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw H('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw H('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=Bt;Bt=t.TRUSTED_TYPES_POLICY;try{Wt=Kt("")}catch(t){throw Bt=e,t}}else null===t.TRUSTED_TYPES_POLICY?(Bt=void 0,Wt=""):(void 0===Bt&&(Bt=Xt()),Bt&&"string"==typeof Wt&&(Wt=Kt("")));p&&p(t),cn=t},mn=W({},[...X,...Z,...J]),hn=W({},[...Q,...tt]),vn=function(t){const e=Ht(t),n=C(jt(t)),i=It(t);let r,o;return i&&Mt(i)===bt?(r={namespaceURI:Ht(i)},o=C(jt(i))):(r={namespaceURI:Ze},o="template"),!!Qe[e]&&(e===Ke?function(t,e,n){return e.namespaceURI===Xe?"svg"===t:e.namespaceURI===qe?"svg"===t&&("annotation-xml"===n||nn[n]):Boolean(mn[t])}(n,r,o):e===qe?function(t,e,n){return e.namespaceURI===Xe?"math"===t:e.namespaceURI===Ke?"math"===t&&on[n]:Boolean(hn[t])}(n,r,o):e===Xe?function(t,e,n){return!(e.namespaceURI===Ke&&!on[n])&&!(e.namespaceURI===qe&&!nn[n])&&!hn[t]&&(an[t]||!mn[t])}(n,r,o):!("application/xhtml+xml"!==sn||!Qe[e]))},gn=function(t){w(n.removed,{element:t});try{It(t).removeChild(t)}catch(e){if(Y(t),!It(t))throw H("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},yn=function(t,e,n){try{Dt(t,e)}catch(e){try{t.removeAttribute(n)}catch(t){}}},_n=function(t){Tn(t);const e=Nt(t);e&&_(T(e),t=>{try{Y(t)}catch(t){}});const n=Mt(t)===bt?Rt(t):null;if(n)for(let e=n.length-1;e>=0;--e){const i=n[e],r=i&&i.name;"string"==typeof r&&yn(t,i,r)}},bn=function(t,e,i){if(!i)try{i=e.getAttributeNode(t)}catch(t){i=null}w(n.removed,{attribute:i||null,from:e});try{i?Dt(e,i):e.removeAttribute(t)}catch(n){try{e.removeAttribute(t)}catch(t){}}if("is"===t)if(Ne||Ie)try{gn(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},Sn=function(t){const e=Rt(t);if(e)for(let n=e.length-1;n>=0;--n){const i=e[n],r=i&&i.name;"string"!=typeof r||he[fn(r)]||yn(t,i,r)}},wn=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=[t];for(;i.length>0;){const t=i.pop();if(!1===e(t))continue;if(n&&Mt(t)===bt){const e=$t(t);$n(e)&&i.push(e)}const r=Nt(t);if(r)for(let t=r.length-1;t>=0;--t)i.push(r[t])}},Tn=function(t){wn(t,t=>{Mt(t)===bt&&Sn(t)})},An=function(t){const e=[];return wn(t,t=>{e.push(t)},!0),e},kn=function(t,e){let i=!1;return _(n.removed,e=>{e.element&&(i=i||e.element===t,Tn(e.element))}),function(t,e){const n=x();_(An(t),t=>{Mt(t)===bt&&F(n,t)}),_(e,t=>{Mt(t)!==bt||E(n,t)||Sn(t)})}(t,e),i},xn=function(t,e,n,i){const r=Cn(t);let o;for(;o=r.nextNode();)E(i,o)&&!E(je,o)&&(e&&Pn(ie.uponSanitizeShadowNode,o,null),jn(o,n),Gn(o,n),$n(o.content)&&qn(o.content))},Fn=function(t,e){return!!xe&&("patchsrc"===t||"for"===t&&"label"!==e&&"output"!==e)},En=function(t){let e=null,n=null;if(Oe)t="<remove></remove>"+t;else{const e=O(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===sn&&Ze===Xe&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=Bt?Kt(t):t;if(Ze===Xe)try{e=(new v).parseFromString(r,sn)}catch(t){}if(!e||!e.documentElement){e=Jt.createDocument(Ze,"template",null);try{e.documentElement.innerHTML=Je?Wt:r}catch(t){}}const o=e.body||e.documentElement;return t&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),Ze===Xe?ee.call(e,Fe?"html":"body")[0]:Fe?e.documentElement:o},Cn=function(t){const e=Lt?Lt(t):t.ownerDocument;return Qt.call(e||t,t,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Dn=function(t){return t=N(t,re," "),t=N(t,oe," "),t=N(t,ae," ")},On=function(t){var e;Nn(t);const n=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");n&&_(n,t=>{$n(t.content)&&On(t.content)})},Nn=function(t){t.normalize();const e=Lt?Lt(t):t.ownerDocument,n=Qt.call(e||t,t,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let i=n.nextNode();for(;i;)i.data=Dn(i.data),i=n.nextNode()},In=function(t){const e=zt?zt(t):null;return"string"==typeof e&&("form"===fn(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==Rt(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.removeAttributeNode||"function"!=typeof t.getAttributeNode||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==Pt(t)||t.childNodes!==Nt(t)))},$n=function(t){if(!Pt||"object"!=typeof t||null===t)return!1;try{return Pt(t)===kt}catch(t){return!1}},Rn=function(t){if(!Pt||"object"!=typeof t||null===t)return!1;try{return"number"==typeof Pt(t)}catch(t){return!1}};function Pn(t,e,i){0!==t.length&&_(t,t=>{t.call(n,e,i,cn)})}const zn=function(t,e){if(t instanceof RegExp)return U(t,e);if(t instanceof Function){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return Boolean(t(e,...i))}return!1},Ln=function(t,e,n,i){return 0===t.length?e:e===n||e===i?G(e):e},Mn=function(t,e){return t!==e&&null===It(t)&&(Me&&Tn(t),!0)},jn=function(t,e){var i;if(i=t,je&&F(je,i),Pn(ie.beforeSanitizeElements,t,null),Mn(t,e))return!0;if(In(t))return gn(t),!0;const r=fn(jt(t));if(pe=Ln(ie.uponSanitizeElement,pe,me,Ce),Pn(ie.uponSanitizeElement,t,{tagName:r,allowedTags:pe}),Mn(t,e))return!0;if(function(t,e){return!!(xe&&t.hasChildNodes()&&!Rn(t.firstElementChild)&&U(vt,t.textContent)&&U(vt,t.innerHTML))||!!(xe&&xt[e]&&Mt(t)===bt&&Ht(t)===Xe&&(Rn(t.firstElementChild)||"string"==typeof t.textContent&&U(vt,t.textContent)))||t.nodeType===wt||!(!xe||t.nodeType!==Tt||!U(gt,t.data))}(t,r))return gn(t),!0;if(ye[r]||!(be.tagCheck instanceof Function&&be.tagCheck(r))&&!pe[r]){const n=function(t,e,n){if(!ye[e]&&Bn(e)&&zn(ge.tagNameCheck,e))return!1;if(Le&&!He[e]&&!He[C(e)]){const e=It(t),i=Nt(t);if(i&&e)for(let r=i.length-1;r>=0;--r){const o=t===n?V(i[r],!0):i[r];e.insertBefore(o,Ot(t))}}return gn(t),!0}(t,r,e);return!(!1!==n||(Pn(ie.afterSanitizeElements,t,null),!Mn(t,e)))||n}if(Mt(t)===bt&&!vn(t))return gn(t),!0;if(("noscript"===r||"noembed"===r||"noframes"===r)&&U(yt,t.innerHTML))return gn(t),!0;if(ke&&t.nodeType===St){const e=Dn(t.textContent);t.textContent!==e&&(w(n.removed,{element:t.cloneNode()}),t.textContent=e)}return Pn(ie.afterSanitizeElements,t,null),Mn(t,e)},Un=function(t,e,n){if(_e[e])return!1;if(Fn(e,t))return!1;if(Re&&("id"===e||"name"===e)&&(n in i||n in un))return!1;const r=he[e]||be.attributeCheck instanceof Function&&be.attributeCheck(e,t);return!(!we||!U(se,e))||(!(!Se||!U(le,e))||(r?!!Ye[e]||(!!U(de,N(n,ce,""))||(!("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==I(n,"data:")||!Ve[t])||(!(!Te||U(fe,N(n,ce,"")))||!n))):Bn(t)&&zn(ge.tagNameCheck,t)&&zn(ge.attributeNameCheck,e,t)||"is"===e&&ge.allowCustomizedBuiltInElements&&zn(ge.tagNameCheck,n)))},Hn=W({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Bn=function(t){return!Hn[C(t)]&&U(ue,t)},Vn=function(t,e,n,i){if(Bt&&"object"==typeof g&&"function"==typeof g.getAttributeType&&!n)switch(g.getAttributeType(t,e)){case"TrustedHTML":return Kt(i);case"TrustedScriptURL":return function(t){qt(),Gt++;try{return Bt.createScriptURL(t)}finally{Gt--}}(i)}return i},Wn=function(t,e,n,i){try{return n?t.setAttributeNS(n,e,i):t.setAttribute(e,i),!In(t)||(gn(t),!1)}catch(n){return bn(e,t),!1}},Yn=function(t,e){return!(!xe||!U(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,e))||"attributename"===C(t)&&null!==O(e,"href")},Gn=function(t,e){if(Pn(ie.beforeSanitizeAttributes,t,null),Mn(t,e))return;const i=t.attributes;if(!i||In(t))return;he=Ln(ie.uponSanitizeAttribute,he,ve,De);const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:he,forceKeepAttr:void 0};let o=i.length;const a=fn(t.nodeName);for(;o--;){const e=i[o],s=e.name,l=e.namespaceURI,f=e.value,c=fn(s),u=f;let d="value"===s?u:$(u),p=!1;r.attrName=c,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,Pn(ie.uponSanitizeAttribute,t,r),d=r.attrValue,!Pe||"id"!==c&&"name"!==c||0===I(d,ze)||(bn(s,t,e),d=ze+d,p=!0),Yn(s,d)?bn(s,t,e):r.forceKeepAttr||(r.keepAttr&&(Ae||!U(_t,d))?(ke&&(d=Dn(d)),Un(a,c,d)?(d=Vn(a,c,l,d),d!==u&&Wn(t,s,l,d)&&p&&S(n.removed)):bn(s,t,e)):bn(s,t,e))}Pn(ie.afterSanitizeAttributes,t,null),Mn(t,e)},qn=function(t){let e=null;const n=Cn(t);for(Pn(ie.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(Pn(ie.uponSanitizeShadowNode,e,null),jn(e,t),Gn(e,t),$n(e.content)&&qn(e.content),Mt(e)===bt){const t=$t(e);$n(t)&&(Kn(t),qn(t))}ke&&Nn(t),Pn(ie.afterSanitizeShadowDOM,t,null)},Kn=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){qn(t.shadow);continue}const n=t.node,i=Mt(n)===bt,r=Nt(n);if(r)for(let t=r.length-1;t>=0;--t)e.push({node:r[t],shadow:null});if(i){const t=zt?zt(n):null;if("string"==typeof t&&"template"===fn(t)){const t=n.content;$n(t)&&e.push({node:t,shadow:null})}}if(i){const t=$t(n);$n(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,a=null,s=null;if(Je=!t,Je&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Rn(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return R(t);case"boolean":return P(t);case"bigint":return z?z(t):"0";case"symbol":return L?L(t):"Symbol()";case"undefined":default:return j(t);case"function":case"object":{if(null===t)return j(t);const e=t,n=q(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:j(t)}return j(t)}}}(t)))throw H("dirty is not a string, aborting");if(!n.isSupported)return t;Ee?(pe=Ce,he=De):pn(e),(ie.uponSanitizeElement.length>0||ie.uponSanitizeAttribute.length>0)&&(pe=G(pe)),ie.uponSanitizeAttribute.length>0&&(he=G(he)),n.removed=[];const l=Me&&"string"!=typeof t&&Rn(t);let f=[];const c=je;if(l){u=t,xe&&wn(u,t=>{const e=Mt(t);if(e===wt||e===Tt&&U(gt,t.data)){try{Y(t)}catch(t){}return!1}if(e===bt){const e=t,n=fn(jt(t));try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&Fn("for",n)&&e.removeAttribute("for")}catch(t){}}return!0});const e=jt(t);if("string"==typeof e){const n=fn(e);if(!pe[n]||ye[n])throw _n(t),H("root node is forbidden and cannot be sanitized in-place")}if(In(t))throw _n(t),H("root node is clobbered and cannot be sanitized in-place");f=An(t),je=x()}else if(Rn(t))i=En("\x3c!----\x3e"),o=i.ownerDocument.importNode(t,!0),o.nodeType===bt&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o),Kn(i);else{if(!Ne&&!ke&&!Fe&&-1===t.indexOf("<"))return Bt&&$e?Kt(t):t;if(i=En(t),!i)return Ne?null:$e?Wt:""}var u;i&&Oe&&gn(i.firstChild);const d=l?t:i;try{l&&Kn(t);const e=Cn(d);for(;a=e.nextNode();)jn(a,d),Gn(a,d),$n(a.content)&&qn(a.content);l&&function(t,e){const n=je;let i=null;const r=()=>(i||(i=x(),_(e,t=>{F(i,t)})),i);for(let e=0;;e++){const i=An(t),o=[t];let a=!1;if(_(i,t=>{Mt(t)===kt?w(o,t):a||E(n,t)||(a=E(r(),t))}),!a)return;if(e>=8)throw H("the tree kept changing during in-place sanitization; refusing to return it");_(o,(e,n)=>{xn(e,n>0,t,r())})}}(t,f)}catch(e){throw l&&(_n(t),kn(t,f)),e}finally{je=c}if(l){if(kn(t,f))throw H("a node selected for removal could not be safely returned; refusing to sanitize in place");return ke&&On(t),t}if(Ne){if(ke&&On(i),Ie)for(s=te.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(he.shadowroot||he.shadowrootmode)&&(s=ne.call(r,s,!0)),s}let p=Fe?i.outerHTML:i.innerHTML;return Fe&&pe["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&U(mt,i.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+p),ke&&(p=Dn(p)),Bt&&$e?Kt(p):p},n.setConfig=function(){pn(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ee=!0,Ce=pe,De=he},n.clearConfig=function(){cn=null,Ee=!1,Ce=null,De=null,Bt=Vt,Wt=""},n.isValidAttribute=function(t,e,n){cn||pn({});const i=fn(t),r=fn(e);return("string"!=typeof n||!(Yn(e,n)||!Ae&&U(_t,n)))&&Un(i,r,n)},n.addHook=function(t,e){"function"==typeof e&&M(ie,t)&&w(ie[t],e)},n.removeHook=function(t,e){if(M(ie,t)){if(void 0!==e){const n=b(ie[t],e);return-1===n?void 0:A(ie[t],n,1)[0]}return S(ie[t])}},n.removeHooks=function(t){M(ie,t)&&(ie[t]=[])},n.removeAllHooks=function(){ie={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Ot=["_blank","_self","_parent","_top"],Nt=["_self","_top","_parent"],It=/^[A-Za-z][A-Za-z0-9_.-]*$/,$t=/^[A-Za-z][A-Za-z-]*$/,Rt=["noopener"];function Pt(t){var e=t&&"string"==typeof t.tagName?t.tagName.toUpperCase():"";return"A"===e||"AREA"===e}var zt,Lt=Dt(window);function Mt(t){return null==t?"":Lt.sanitize(String(t))}Lt.addHook("uponSanitizeAttribute",function(t,e){var n,i;"target"===e.attrName&&Pt(t)&&(n=e.attrValue,i=String(n||"").trim(),(Ot.includes(i.toLowerCase())||It.test(i))&&(e.forceKeepAttr=!0))}),Lt.addHook("afterSanitizeAttributes",function(t){if(Pt(t)&&"function"==typeof t.getAttribute&&"function"==typeof t.setAttribute){var e=t.getAttribute("target");if(e&&!Nt.includes(e.trim().toLowerCase())){var n=(t.getAttribute("rel")||"").split(/\s+/).filter(function(t){return $t.test(t)});Rt.forEach(function(t){n.includes(t)||n.push(t)}),t.setAttribute("rel",n.join(" "))}}}),(zt=jQuery)(document.body).on("fluentform_init",function(t,e,n){var r="."+n.form_instance,o=-1,a="no";function s(t,e){var i="fluentform_save_progress_messages_"+n.id;return window[i]&&window[i][t]?window[i][t]:e}if(zt(r).hasClass("ff-form-has-save-progress")){zt(r).hasClass("ff-form-has-steps")&&(e.on("ff_to_next_page",function(t,e){a=e}),e.on("ff_to_prev_page",function(t,e){a=e})),zt(r).find(".ff-btn-save-progress").each(function(t,n){var i=zt(n);i.on("click",function(t){var n,r=this;t.preventDefault(),i.addClass("ff-working");var l=e.find(":input").filter(function(t,e){return!zt(e).closest(".has-conditions").hasClass("ff_excluded")});l.filter(function(t,e){var n=zt(e);return n.parents().hasClass("ff_repeater_table")&&"select"==n.attr("type")&&!n.val()}).prepend("<option selected disabled />");var f=l.serialize();zt.each(e.find("[type=file]"),function(t,e){var n={},i=e.name+"[]";n[i]=[],zt(e).closest("div").find(".ff-uploaded-list").find(".ff-upload-preview[data-src]").each(function(t,e){n[i][t]=zt(this).data("src")}),zt.each(n,function(t,e){if(e.length){var n={};n[t]=e,f+="&"+zt.param(n)}})}),o=null===(n=window.form_state_save_vars)||void 0===n?void 0:n.key;var c={source_url:window.form_state_save_vars.source_url,action:"fluentform_save_form_progress_with_link",data:f,form_id:e.data("form_id"),hash:o,active_step:a,nonce:window.form_state_save_vars.nonce,save_progress_btn_name:zt(i).attr("name")},u=c.form_id+"_save_progress_msg",d="#"+u;jQuery.post(fluentFormVars.ajaxUrl,c).then(function(t){if(t){var n;o=t.data.hash,e.find(".ff-saved-state-link"),""!=(null===(n=t.data)||void 0===n?void 0:n.message)&&(zt(d).length&&zt(d).slideUp("fast"),zt("<div/>",{id:u,class:"ff-message-success ff-el-group"}).html(Mt(t.data.message)).insertBefore(i.closest(".ff-el-group")));var a=s("copy_button",window.form_state_save_vars.copy_button||"Copy"),l='<div class="ff-el-input--content">\n <div class="ff_input-group">\n <input readonly class="ff-el-form-control" >\n <div class="ff_input-group-append">\n <button class="ff-btn ff-btn-md ff_btn_style ff_btn_copy_link ff_input-group-text">'.concat(a,"</button>\n </div>\n </div>\n </div>"),f=zt("<div/>",{class:"ff-el-group ff-saved-state-input ff-saved-state-link ff-hide-group",html:l});f.find("input").val(t.data.saved_url),zt(r).closest(".ff-el-group").after(f),f.fadeIn(),f.find("input.ff-el-form-control").on("keypress",function(t){13!==t.which&&13!==t.keyCode||(t.preventDefault(),zt(this).siblings(".ff_input-group-append").find(".ff_btn_copy_link").click())});var c=s("email_placeholder",window.form_state_save_vars.email_placeholder_str||"Your Email Here"),p=s("email_button",window.form_state_save_vars.email_button||"Email");if(zt(r).hasClass("ff_resume_email_enabled")){var m='<div class="ff-el-input--content">\n <div class="ff_input-group">\n <input type="email" class="ff-el-form-control" placeholder="'.concat(c,'">\n <div class="ff_input-group-append">\n <button class="ff-btn ff-btn-md ff_btn_style ff_btn_is_email ff_input-group-text">').concat(p,"</button>\n </div>\n </div>\n </div>"),h=zt("<div/>",{class:"ff-el-group ff-saved-state-input ff-email-address ff-hide-group",html:m});zt(f).after(h),h.fadeIn(),h.find("input.ff-el-form-control").on("keypress",function(t){13!==t.which&&13!==t.keyCode||(t.preventDefault(),zt(this).siblings(".ff_input-group-append").find(".ff_btn_is_email").click())})}}}).fail(function(t){zt(d).length&&zt(d).slideUp("fast"),zt("<div/>",{id:u,class:"ff-message-success ff-el-group text-danger"}).html(Mt(t.responseJSON.data.message)).insertBefore(i.closest(".ff-el-group"))}).always(function(){i.parent().hide()})})}),zt(r).on("click",".ff_btn_copy_link",function(t){t.preventDefault();var e=zt(this).closest(".ff-el-input--content").find(".ff-el-form-control").val();navigator.clipboard.writeText(e);var n=s("copy_success",window.form_state_save_vars.copy_success_button||"Copied");zt(this).html(Mt(n))}),zt(r).on("click",".ff_btn_is_email",function(t){t.preventDefault();var n=zt(this).closest(".ff-el-group"),i=zt(this).closest(".ff-email-address").find("input").val();zt(".ff-email-address").find("input").val("");var r=zt(".ff-saved-state-link").find("input").val(),a={source_url:window.form_state_save_vars.source_url,action:"fluentform_email_progress_link",form_id:e.data("form_id"),to_email:i,link:r,hash:o,nonce:window.form_state_save_vars.nonce},s=a.form_id+"_save_progress_email_response",l="#"+s;jQuery.post(fluentFormVars.ajaxUrl,a).then(function(t){t&&(n.removeClass("ff-el-is-error"),zt(l).length&&zt(l).slideUp("fast"),zt("<div/>",{id:s,class:"ff-message-success ff-el-group"}).html(Mt(t.data.response)).insertAfter(n))}).fail(function(t){t&&(n.addClass("ff-el-is-error"),zt(l).length&&zt(l).slideUp("fast"),zt("<div/>",{id:s,class:"ff-message-success ff-el-group text-danger"}).html(Mt(t.responseJSON.data.Error)).insertAfter(n))})});var l=!1;void 0!==window.form_state_save_vars&&(l=window.form_state_save_vars.key),l&&(e.append(zt("<input/>",{type:"hidden",name:"__fluent_state_hash",class:"__fluent_state_hash"}).val(l)),"yes"==e.find(".ff-step-container").attr("data-enable_step_data_persistency")||jQuery.getJSON(fluentFormVars.ajaxUrl,{form_id:e.data("form_id"),action:"fluentform_get_form_state",hash:l,nonce:window.form_state_save_vars.nonce}).then(function(t){if(t){var n=function(t,e,n,r){return new i(t,e,n,r).getPublicAPI()}(zt,e,window.fluentFormVars,r);n.populateFormDataAndSetActiveStep(t)}}))}})})();
Save File
Cancel