').appendTo(L);const R=b("div",d.controls,{id:`${s.formID}-cb-wrap`,className:`cb-wrap ${s.layout.controls}`});e.showActionButtons&&R.appendChild(d.formActions);const M=b("div","",{id:`${s.formID}-gridModeHelp`,className:"grid-mode-help"});R.appendChild(M),L.append(d.stage,R),"textarea"!==t.type?o(t).append(L):o(t).replaceWith(L),o(d.controls).on("click","li",(t=>{let{target:r}=t;if(pt)return;Me()||x.find(ct).eq(0).remove();const n=o(r).closest("li");p.stopIndex=e.append?x.children("li").length-1:void 0,T(n),p.save.call(p)}));const P=function(t,r){void 0===r&&(r=!1);let n={};if(t instanceof jQuery)if(n.type=t[0].dataset.type,n.type){const e=g.custom.lookup(n.type);if(e)n=Object.assign({},e);else{const e=g.getClass(n.type);n.label=e.label(n.type)}}else{const e=t[0].attributes;r||(n.values=t.children().map(((e,t)=>({label:o(t).text(),value:o(t).attr("value"),selected:Boolean(o(t).attr("selected"))}))));for(let t=e.length-1;t>=0;t--)n[e[t].name]=e[t].value}else n=Object.assign({},t);n.name||(n.name=B(n)),r&&["text","number","file","date","select","textarea","autocomplete"].includes(n.type)&&(n.className=n.className||"form-control");const i=/(?:^|\s)btn-(.*?)(?:\s|$)/g.exec(n.className);if(i&&(n.style=i[1]),r){const e=setTimeout((()=>{document.dispatchEvent(v.fieldAdded),clearTimeout(e)}),10)}e.onAddField(s.lastID,n),ce(n,r),e.onAddFieldAfter(s.lastID,n),d.stage.classList.remove("empty")};n.prepFieldVars=P;const z=function(t){(t=p.getData(t))&&t.length?(t.forEach((e=>{U(e)})),t.forEach((e=>P(N(e)))),d.stage.classList.remove("empty")):e.defaultFields&&e.defaultFields.length?(ve.opts.defaultFields.forEach((e=>U(e))),p.addDefaultFields()):e.prepend||e.append||(d.stage.classList.add("empty"),d.stage.dataset.content=h().get("getStarted")),(()=>{const t=[],r=t=>b("li",e[t],{className:`disabled-field form-${t}`});return e.prepend&&!o(".disabled-field.form-prepend",d.stage).length&&(t.push(!0),x.prepend(r("prepend"))),e.append&&!o(".disabled-field.form-append",d.stage).length&&(t.push(!0),x.append(r("append"))),p.disabledTT(d.stage),t.some((e=>!0===e))})()&&d.stage.classList.remove("empty"),p.save()};function U(e){const t=p.getRowValue(e.className);t&&!c.includes(t)&&c.push(t)}const W=t=>{const{type:r}=t,o=[],n=g.getClass(r),i=(e=>{const t=["required","label","description","placeholder","className","name","access","value"],r=!["header","paragraph","file","autocomplete"].concat(d.optionFields).includes(e),o={autocomplete:t.concat(["options","requireValidOption"]),button:["label","subtype","style","className","name","value","access"],checkbox:["required","label","description","toggle","inline","className","name","access","other","options"],text:t.concat(["subtype","maxlength"]),date:t,file:t.concat(["subtype","multiple"]),header:["label","subtype","className","access"],hidden:["name","value","access"],paragraph:["label","subtype","className","access"],number:t.concat(["min","max","step"]),select:t.concat(["multiple","options"]),textarea:t.concat(["subtype","maxlength","rows"])};e in g.registeredSubtypes&&!(e in o)&&(o[e]=t.concat(["subtype"])),o["checkbox-group"]=o.checkbox,o["radio-group"]=o.checkbox;const n=o[e];return"radio-group"===e&&Z("toggle",n),["header","paragraph","button"].includes(e)&&Z("description",n),r||Z("value",n),n||t})(r),l={required:()=>de(t),toggle:()=>K("toggle",t,{first:h().get("toggle")}),inline:()=>{const e={first:h().get("inline"),second:h().get("inlineDesc",r.replace("-group",""))};return K("inline",t,e)},label:()=>se("label",t),description:()=>se("description",t),subtype:()=>ne("subtype",t,w[r]),style:()=>_(t.style),placeholder:()=>se("placeholder",t),rows:()=>te("rows",t),className:e=>se("className",t,e),name:e=>se("name",t,e),value:()=>se("value",t),maxlength:()=>te("maxlength",t),access:()=>{const r=[`
`];for(a in e.roles)if(e.roles.hasOwnProperty(a)){const t=`fld-${s.lastID}-roles-${a}`,o={type:"checkbox",name:"roles[]",value:a,id:t,className:"roles-field"};c.includes(a)&&(o.checked="checked"),r.push(``)}r.push("
");const o={first:h().get("roles"),second:h().get("limitRole"),content:r.join("")};return K("access",t,o)},other:()=>K("other",t,{first:h().get("enableOther"),second:h().get("enableOtherMsg")}),options:()=>function(e){const{type:t,values:r}=e;let o;const n=[b("a",h().get("addOption"),{className:"add add-opt"})],i=[b("label",h().get("selectOptions"),{className:"false-label"})],l=e.multiple||"checkbox-group"===t,a=e=>{const t=h().get("optionCount",e);return{selected:!1,label:t,value:I(t)}};if(r&&r.length)o=r.map((e=>Object.assign({},{selected:!1},e)));else{let e=[1,2,3];["checkbox-group","checkbox"].includes(t)&&(e=[1]),o=e.map(a);const r=o[0];r.hasOwnProperty("selected")&&"radio-group"!==t&&(r.selected=!0)}const s=b("div",n,{className:"option-actions"}),d=b("ol",o.map((function(r,o,n,i){void 0===i&&(i=e.name);const a=ve.opts.onAddOption(r,{type:t,index:o,isMultiple:l});return Oe(i+"-options",a,l)})),{className:"sortable-options"}),c=b("div",[d,s],{className:"sortable-options-wrap"});return i.push(c),b("div",i,{className:"form-group field-options"}).outerHTML}(t),requireValidOption:()=>K("requireValidOption",t,{first:" ",second:h().get("requireValidOption")}),multiple:()=>{const e={default:{first:"Multiple",second:"set multiple attribute"},file:{first:h().get("multipleFiles"),second:h().get("allowMultipleFiles")},select:{first:" ",second:h().get("selectionsMessage")}};return K("multiple",t,e[r]||e.default)}};let a;const c=void 0!==t.role?t.role.split(","):[];["min","max","step"].forEach((e=>{l[e]=()=>te(e,t)}));const f=["name","className"];if(Object.keys(i).forEach((t=>{const a=i[t],s=[!0],d=e.disabledAttrs.includes(a);if(e.typeUserDisabledAttrs[r]){const t=e.typeUserDisabledAttrs[r];s.push(!t.includes(a))}if(n.definition.hasOwnProperty("defaultAttrs")){const e=Object.keys(n.definition.defaultAttrs);s.push(!e.includes(a))}if(e.typeUserAttrs[r]){const t=Object.keys(e.typeUserAttrs[r]);s.push(!t.includes(a))}d&&!f.includes(a)&&s.push(!1),s.every(Boolean)&&o.push(l[a](d))})),n.definition.hasOwnProperty("defaultAttrs")){const e=G(n.definition.defaultAttrs,t);o.push(e)}if(e.typeUserAttrs[r]){const n=G(e.typeUserAttrs[r],t);o.push(n)}return o.join("")};function $(e){return[["array",e=>{let{options:t}=e;return!!t}],["boolean",e=>{let{type:t}=e;return"checkbox"===t}],[typeof e.value,()=>!0]].find((t=>t[1](e)))[0]}function V(e,t){return e.subtype&&e.subtype===t}function G(t,r){const o=[],n={array:Y,string:Q,number:te,boolean:(e,t)=>{let o=!1;return"checkbox"===e.type?o=Boolean(!!t.hasOwnProperty("value")&&t.value):r.hasOwnProperty(e)?o=r[e]:(t.hasOwnProperty("value")||t.hasOwnProperty("checked"))&&(o=t.value||t.checked||!1),K(e,et(et({},t),{},{[e]:o}),{first:i[e]})}};for(const l in t)if(t.hasOwnProperty(l)){const a=$(t[l]);if("undefined"!==a){const e=h().get(l),s=t[l],d="boolean"===a?s.value:s.value||"";s.value=r[l]||d,s.label&&(i[l]=Array.isArray(s.label)?h().get(...s.label)||s.label[0]:s.label),n[a]&&o.push(n[a](l,s)),i[l]=e,s.value=d}else if("undefined"===a&&V(r,l))o.push(G(t[l],r));else{const r={};r[l]=t[l],e.notify.warning("Warning: unable to process typeUserAttr definition : "+JSON.stringify(r))}}return o.join("")}function Q(e,t){const{class:r,className:o}=t,n=Ke(t,Ge);let l={id:e+"-"+s.lastID,title:n.description||n.label||e.toUpperCase(),name:e,type:n.type||"text",className:[`fld-${e}`,(r||o||"").trim()],value:n.value||""};const a=`
`;return["checkbox","checkbox-group","radio-group"].includes(l.type)||l.className.push("form-control"),l=Object.assign({},n,l),`
`}function Y(e,t){const{multiple:r,options:o,label:n,value:l,class:a,className:d}=t,c=Ke(t,Xe),f=Object.keys(o).map((e=>{const t={value:e},r=o[e],n=Array.isArray(r)?h().get(...r)||r[0]:r;return(Array.isArray(l)?l.includes(e):e===l)&&(t.selected=null),b("option",n,t)})),u={id:`${e}-${s.lastID}`,title:c.description||n||e.toUpperCase(),name:e,className:`fld-${e} form-control ${a||d||""}`.trim()};r&&(u.multiple=!0);const p=`
`;return Object.keys(c).forEach((function(e){u[e]=c[e]})),`
`}const K=function(e,t,r){void 0===r&&(r={});const o=t=>b("label",t,{for:`${e}-${s.lastID}`}).outerHTML,n={type:"checkbox",className:`fld-${e}`,name:e,id:`${e}-${s.lastID}`};t[e]&&(n.checked=!0);const i=[];let l=[b("input",null,n).outerHTML];return r.first&&i.push(o(r.first)),r.second&&l.push(" ",o(r.second)),r.content&&l.push(r.content),l=b("div",l,{className:"input-wrap"}).outerHTML,b("div",i.concat(l),{className:`form-group ${e}-wrap`}).outerHTML},_=e=>{let t="";"undefined"===e&&(e="default");const r=`
`;return t+=p.input({value:e||"default",type:"hidden",className:"btn-style"}).outerHTML,t+='
',he.btn.forEach((r=>{const o=["btn-xs","btn",`btn-${r}`];e===r&&o.push("selected");const n=b("button",h().get(`styles.btn.${r}`),{value:r,type:"button",className:o.join(" ")}).outerHTML;t+=n})),t+="
",t=b("div",[r,t],{className:"form-group style-wrap"}),t.outerHTML},te=(e,t)=>{const{class:r,className:o}=t,n=Ke(t,Qe),i=isNaN(n[e])?void 0:n[e],l=h().get(e)||e,a={type:"number",value:i,name:e,placeholder:h().get(`placeholder.${e}`),className:`fld-${e} form-control ${r||o||""}`.trim(),id:`${e}-${s.lastID}`},d=p.input(N(a)).outerHTML;return b("div",[`
`,`
${d}
`],{className:`form-group ${e}-wrap`}).outerHTML},ne=(e,t,r)=>{const o=r.map(((r,o)=>{let n=Object.assign({label:`${i.option} ${o}`,value:void 0},r);return r.value===t[e]&&(n.selected=!0),n=N(n),b("option",n.label,n)})),n={id:e+"-"+s.lastID,name:e,className:`fld-${e} form-control`},l=h().get(e)||ee(e)||"",a=b("label",l,{for:n.id}),d=b("select",o,n),c=b("div",d,{className:"input-wrap"});return b("div",[a,c],{className:`form-group ${n.name}-wrap`}).outerHTML},se=function(t,r,o){void 0===o&&(o=!1);let n=r[t]||"",i=h().get(t);"label"===t&&(["paragraph"].includes(r.type)?i=h().get("content"):n=J(n));const l=h().get(`placeholders.${t}`)||"";let a="";if(![].some((e=>!0===e))){const d={name:t,placeholder:l,className:`fld-${t} form-control`,id:`${t}-${s.lastID}`},c=b("label",i,{for:d.id}).outerHTML;"label"!==t||e.disableHTMLLabels?(d.value=n,d.type="text",a+=`
`):(d.contenteditable=!0,a+=b("div",n,d).outerHTML);const f=`
${a}
`;let u=o?"none":"block";"value"===t&&(u=r.subtype&&"quill"===r.subtype&&"none"),a=b("div",[c,f],{className:`form-group ${t}-wrap`,style:`display: ${u}`})}return a.outerHTML},de=e=>{const{type:t}=e,r=[];let o="";return["header","paragraph","button"].includes(t)&&r.push(!0),r.some((e=>!0===e))||(o=K("required",e,{first:h().get("required")})),o},ce=function(t,r){void 0===r&&(r=!0);const l=Ce(t);s.lastID=p.incrementId(s.lastID);const a=t.type||"text";let c=t.label||(r?i[a]||h().get("label"):"");"hidden"===a&&(c=`${h().get(a)}: ${t.name}`);const f=e.disabledFieldButtons[a]||t.disabledFieldButtons;let u=[b("a",null,{type:"remove",id:"del_"+s.lastID,className:`del-button btn ${tt}cancel delete-confirm`,title:h().get("removeMessage")}),b("a",null,{type:"edit",id:s.lastID+"-edit",className:`toggle-form btn ${tt}pencil`,title:h().get("hide")}),b("a",null,{type:"copy",id:s.lastID+"-copy",className:`copy-button btn ${tt}copy`,title:h().get("copyButtonTooltip")})];S()?u.push(b("a",null,{type:"grid",id:s.lastID+"-grid",className:`grid-button btn ${tt}grid`,title:"Grid Mode"})):u.push(b("a",null,{type:"sort",id:s.lastID+"-sort-higher",className:`sort-button sort-button-higher btn ${tt}sort-higher`,title:"Move Higher"}),b("a",null,{type:"sort",id:s.lastID+"-sort-lower",className:`sort-button sort-button-lower btn ${tt}sort-lower`,title:"Move Lower"})),f&&Array.isArray(f)&&(u=u.filter((e=>!f.includes(e.type))));const m=[b("div",u,{className:"field-actions"})],g=e.disableHTMLLabels?document.createTextNode(c):J(c);m.push(b("label",g,{className:"field-label"})),m.push(b("span"," *",{className:"required-asterisk",style:t.required?"display:inline":""}));const v={className:"tooltip-element",tooltip:t.description,style:t.description?"display:inline-block":"display:none"};m.push(b("span","?",v));const y=b("div","",{className:"prev-holder",dataFieldId:s.lastID});m.push(y);const w=b("div",[W(t),b("a",h().get("close"),{className:"close-field"})],{className:"form-elements"}),A=b("div",w,{id:`${s.lastID}-holder`,className:"frm-holder",dataFieldId:s.lastID});n.currentEditPanel=A,m.push(A);const O=b("li",m,{class:`${a}-field form-field`,type:a,id:s.lastID}),k=o(O);let N;if(fe(k),k.data("fieldData",{attrs:t}),void 0!==p.stopIndex?o("> li",d.stage).eq(p.stopIndex).before(k):x.append(k),o(".sortable-options",k).sortable({update:()=>p.updatePreview(k)}),p.updatePreview(k),S()){const e=`div.row-${l.rowNumber}`;N=x.children(e).length?x.children(e):b("div",null,{id:`${O.id}-row`,className:`row row-${l.rowNumber} ${rt}`}),j&&E&&(C.attr("id",N.id),C.attr("class",N.className),C.attr("style",""),N=C);const t=b("div",null,{id:`${O.id}-cont`,className:`${l.columnSize} ${ot}`});j&&q&&("true"==C.attr("prepend")?o(t).prependTo(N):o(t).insertAfter(`#${C.attr("appendAfter")}`)),q||o(t).appendTo(N),j||k.after(N),k.appendTo(t),ge(N),me(N),l.addedDefaultColumnClass&&k.attr("addedDefaultColumnClass",!0),p.tmpCleanPrevHolder(o(y))}e.typeUserEvents[a]&&e.typeUserEvents[a].onadd&&e.typeUserEvents[a].onadd(O),r&&(e.editOnAdd&&(p.closeAllEdit(),p.toggleEdit(s.lastID,!1)),O.scrollIntoView&&e.scrollToFieldOnAdd&&O.scrollIntoView({behavior:"smooth"})),S()&&(j&&q&&De(N,!0),xe()),j=!1,E=!1,q=!1};function fe(e){S()&&e.mouseenter((function(e){Ne||(je=o(this),Ee=e.pageX,qe=e.pageY)}))}function ue(){x.find(ct).css("height","1px").addClass(lt)}function me(e){const t=o(e).clone();if(t.addClass(lt).addClass(it).html(""),t.css("height","1px"),t.attr("class",t.attr("class").replace("row-","")),t.removeAttr("id"),0==o(e).index()){const e=o(t).clone();x.prepend(e),ge(e)}t.insertAfter(o(e)),ge(t)}function be(){x.children(ct).remove(),x.children(at).each(((e,t)=>{me(o(t))}))}function ge(t){S()&&(o(t).sortable({connectWith:[at],cursor:"move",opacity:.9,revert:150,tolerance:"pointer",helper:function(e,t){const r=t.clone();return r.find(".field-actions").remove(),r.css({width:"20%",height:"100px",minHeight:"60px",overflow:"hidden"}),r},over:function(e){const t=o(e.target),r=t.hasClass(it);r||Ae(t),t.addClass("hoverDropStyleInverse"),r||(ue(),t.prev(ct).removeClass(lt).css("height","40px"),t.next(ct).removeClass(lt).css("height","40px"))},out:function(e){x.children(ct).removeClass("hoverDropStyleInverse"),o(e.target).removeClass("hoverDropStyleInverse")},placeholder:"hoverDropStyleInverse",receive:function(e,t){const r=o(t.sender).attr("id")==A.attr("id"),n=o(t.item).parent().hasClass(it),i=o(t.item).parent().hasClass(it),l=o(t.item).parent().hasClass(rt)&&!o(t.item).parent().hasClass(it);if(n&&!r){const e=o(t.item),r=Ce({}),n=b("div",null,{id:`${e.find("li").attr("id")}-row`,className:`row row-${r.rowNumber} ${rt}`});o(t.item).parent().replaceWith(n),fe(o(t.item)),e.appendTo(n),ge(n),Le(e.attr("id")),Re()}if(i&&r&&(E=!0,j=!0,C=o(t.item).parent()),l&&r){C=o(t.item).prev().hasClass("btnAddControl")?o(t.item).prev():o(t.item).next().hasClass("btnAddControl")?o(t.item).next():o(t.item).attr("prepend","true");const e=p.getRowClass(o(t.item).parent().attr("class"));C.addClass(e),q=!0,j=!0,p.stopIndex=void 0}xe(),j&&(p.doCancel=!0,T(t.item),p.save.call(p)),be();const a=o(t.item).find("li");a.length&&(ye(a),we(a),p.tmpCleanPrevHolder(o(t.item).find(".prev-holder")))},start:function(){xe()},stop:function(e,t){x.children(ct).removeClass("hoverDropStyleInverse"),De(t.item.closest(at),!0)},update:function(e,t){Le(t.item.attr("id"))}}),o(t).off("mouseenter"),o(t).on("mouseenter",(function(t){var r;r=o(t.currentTarget),e.enableColumnInsertMenu&&o(r).children(st).each(((e,t)=>{const r=o(t);r.addClass("colHoverTempStyle"),0==r.index()&&o(`
`).insertBefore(r),o(`
`).insertAfter(r)}))})),o(t).off("mouseleave"),o(t).on("mouseleave",(function(e){Ae(o(e.currentTarget))})))}function ye(e){const t=e.find('textarea[type="tinymce"]');t.length&&(window.lastFormBuilderCopiedTinyMCE=window.tinymce.get(t.attr("id")).save())}function we(e){p.updatePreview(e),p.save.call(p)}function xe(){x.find(st).removeClass("colHoverTempStyle"),x.find(dt).remove()}function Ae(e){e.find(dt).remove(),e.find(st).removeClass("colHoverTempStyle")}function Ce(t){let r={};return S()?(r=p.tryParseColumnInfo(t),function(){if(!r.rowNumber){let o;o=0==c.length?1:Math.max(...c)+1,r.rowNumber=o,j&&q&&(r.rowNumber=p.getRowValue(C.attr("class"))),r.columnSize=e.defaultGridColumnClass,t.className||(t.className=""),t.className+=` row-${r.rowNumber} ${r.columnSize}`,r.addedDefaultColumnClass=!0}}(),c.includes(r.rowNumber)||c.push(r.rowNumber),r):r}const Oe=function(e,t,r){const o={selected:r?"checkbox":"radio"},n={boolean:(t,r)=>{const n={value:t,type:o[r]||"checkbox"};return t&&(n.checked=!!t),n.name=e,["input",null,n]},number:e=>["input",null,{value:e,type:"number"}],string:(e,t)=>["input",null,{value:e,type:"text",placeholder:h().get(`placeholder.${t}`)||""}],array:e=>["select",e.map((e=>{let{label:t,value:r}=e;return b("option",t,{value:r})}))],object:e=>{let{tag:t,content:r}=e;return[t,r,Ke(e,Ze)]}};t=et(et({},{selected:!1,label:"",value:""}),t);const i=Object.entries(t).map((e=>{let[t,r]=e;const o=F(r),[i,l,a]=n[o](r,t),s=`option-${t} option-attr`;return a["data-attr"]=t,a.className=a.className?`${a.className} ${s}`:s,b(i,l,a)})),l={className:`remove btn ${tt}cancel`,title:h().get("removeMessage")};return i.push(b("a",null,l)),b("li",i).outerHTML},ke=[".form-elements input",".form-elements select",".form-elements textarea"].join(", ");x.on("change blur keyup click",ke,r()((e=>{if(e){if([e=>{let{type:t,target:r}=e;return"keyup"===t&&"className"===r.name}].some((t=>t(e))))return!1;we(o(e.target).closest(".form-field"))}}),333,{leading:!1})),x.on("click touchstart",".remove",(t=>{const r=o(t.target).parents(".form-field:eq(0)"),n=r[0],i=n.getAttribute("type"),l=o(t.target.parentElement);t.preventDefault(),n.querySelector(".sortable-options").childNodes.length<=2&&!i.includes("checkbox")?e.notify.error("Error: "+h().get("minOptionMessage")):l.slideUp("250",(()=>{l.remove(),we(r)}))})),x.on("touchstart","input",(e=>{const t=o(e.target);if(!0===e.handled)return!1;if("checkbox"===t.attr("type"))t.trigger("click");else{t.focus();const e=t.val();t.val(e)}})),x.on("click touchstart",".toggle-form, .close-field",(function(e){if(e.stopPropagation(),e.preventDefault(),!0===e.handled)return!1;{const t=o(e.target).parents(".form-field:eq(0)").attr("id");p.toggleEdit(t),e.handled=!0}})),x.on("dblclick","li.form-field",(e=>{if(!["select","input","label"].includes(e.target.tagName.toLowerCase())&&"true"!==e.target.contentEditable&&(e.stopPropagation(),e.preventDefault(),!0!==e.handled)){const t=o(e.target).closest("li.form-field").attr("id");p.toggleEdit(t),e.handled=!0}})),x.on("change",'[name="subtype"]',(e=>{const t=o(e.target).closest("li.form-field");o(".value-wrap",t).toggle("quill"!==e.target.value)})),x.on("change",'[name="name"]',(t=>{const r=t.target.value;(e=>{const t=document,r=document.createElement("form");return e in t||e in r})(r)&&e.notify.error("Potential for Dom Clobbering with field name "+r)})),x.on("change",[".prev-holder input",".prev-holder select",".prev-holder textarea"].join(", "),(e=>{let t;if(e.target.classList.contains("other-option"))return;const r=oe(e.target,".form-field");if(["select","checkbox-group","radio-group"].includes(r.type)){const o=r.getElementsByClassName("option-value");"select"===r.type?X(o,(t=>{o[t].parentElement.childNodes[0].checked=e.target.value===o[t].value})):(t=document.getElementsByName(e.target.name),X(t,(e=>{t[e].classList.contains("other-option")||(o[e].parentElement.childNodes[0].checked=t[e].checked)})))}else{const t=document.getElementById("value-"+r.id);t&&(t.value=e.target.value)}p.save.call(p)})),re(d.stage,"keyup change",(e=>{let{target:t}=e;if(!t.classList.contains("fld-label"))return;const r=t.value||t.innerHTML,o=oe(t,".form-field").querySelector(".field-label");O(o,J(r),ve.opts.disableHTMLLabels)})),x.on("keyup","input.error",(e=>{let{target:t}=e;return o(t).removeClass("error")})),x.on("keyup",'input[name="description"]',(function(e){const t=o(e.target).parents(".form-field:eq(0)"),r=o(".tooltip-element",t),n=o(e.target).val();if(""!==n)if(r.length)r.attr("tooltip",n).css("display","inline-block");else{const e=`
?`;o(".field-label",t).after(e)}else r.length&&r.css("display","none")})),x.on("change",".fld-multiple",(e=>{const t=e.target.checked?"checkbox":"radio",r=o(".option-selected",o(e.target).closest(".form-elements"));return r.each((e=>r[e].type=t)),t})),x.on("blur","input.fld-name",(function(e){e.target.value=ie(e.target.value),""===e.target.value?o(e.target).addClass("field-error").attr("placeholder",h().get("cannotBeEmpty")):o(e.target).removeClass("field-error")})),x.on("blur","input.fld-maxlength",(e=>{e.target.value=le(e.target.value)})),x.on("click touchstart",".btnAddControl",(function(e){const t=o(e.currentTarget);k=A.clone(),k.hover((function(){}),(function(){k.remove()})),k.on("click","li",(e=>{let{target:r}=e;q=!0,j=!0,C=t;const n=o(r).closest("li");p.stopIndex=void 0,T(n),p.save.call(p),k.remove()})),x.append(k),0==t.index()?k.css({position:"fixed",left:t.offset().left,top:t.offset().top-o(window).scrollTop()}):k.css({position:"fixed",left:t.offset().left-80,top:t.offset().top-o(window).scrollTop()});const r=k.offset().top+k.outerHeight(),n=o(window).scrollTop()+o(window).innerHeight();r>n&&k.css({top:parseInt(k.css("top"))-(r-n)})})),x.on("click",`.${tt}copy`,(function(t){t.preventDefault();const r=o(t.target).parent().parent("li"),n=function(t){s.lastID=p.incrementId(s.lastID),ye(t);const r=t.attr("id"),n=t.attr("type"),i=n+"-"+(new Date).getTime(),l=t.clone();return o(".fld-name",l).val(i),l.find("[id]").each(((e,t)=>{t.id=t.id.replace(r,s.lastID)})),l.find("[for]").each(((e,t)=>{const o=t.getAttribute("for").replace(r,s.lastID);t.setAttribute("for",o)})),t.find("select").each((function(e){l.find("select").eq(e).val(o(this).val())})),l.attr("id",s.lastID),l.attr("name",i),l.addClass("cloned"),o(".sortable-options",l).sortable(),e.typeUserEvents[n]&&e.typeUserEvents[n].onclone&&e.typeUserEvents[n].onclone(l[0]),l}(r);!function(e,t){if(!S())return void e.insertAfter(t);const r=o(`#className-${t.attr("id")}`),n=Ce({}),i=b("div",null,{id:`${e.attr("id")}-row`,className:`row row-${n.rowNumber} ${rt}`}),l=b("div",null,{id:`${e.attr("id")}-cont`,className:`${p.getBootstrapColumnClass(r.val())} ${ot}`});let a;o(l).appendTo(i),t.parent().is("div")?a=t.closest(at):t.parent().is("ul")&&(a=t),o(i).insertAfter(a),e.appendTo(l),ge(i),be(),Le(e.attr("id"))}(n,r),we(n),p.tmpCleanPrevHolder(n.find(".prev-holder")),e.editOnAdd&&p.closeField(s.lastID,!1)})),x.on("click",".delete-confirm",(t=>{t.preventDefault();const r=t.target.getBoundingClientRect(),n=document.body.getBoundingClientRect(),i={pageX:r.left+r.width/2,pageY:r.top-n.top-12},l=o(t.target).parents(".form-field:eq(0)").attr("id"),a=o(document.getElementById(l));if(document.addEventListener("modalClosed",(function(){a.removeClass("deleting")}),!1),e.fieldRemoveWarn){const e=b("h3",h().get("warning")),t=b("p",h().get("fieldRemoveWarning"));p.confirm([e,t],(()=>p.removeField(l)),i),a.addClass("deleting")}else p.removeField(l)}));let je,Ee,qe,Ne=!1,Te=0;function De(e,t){void 0===t&&(t=!1);const r=e.children(`div${st}`).length,n=Math.floor(12/r);e.children(`div${st}`).each(((e,r)=>{const i=o(`#${r.id}`);t||"true"!=i.find("li").attr("manuallyChangedDefaultColumnClass")?p.syncBootstrapColumnWrapperAndClassProperty(r.id.replace("-cont",""),n):p.showToast(`Preserving column size of field ${e+1} because you had personally adjusted it`,4e3)}))}function Le(e){if(e){const t=o(`#className-${e.replace("-cont","")}`);if(t.val()){const e=p.getRowClass(t.val()),r=p.getRowClass(t.closest(at).attr("class"));t.val(t.val().replace(e,r)),Re()}}}function Re(){x.find(st).each(((e,t)=>{const r=o(t);r.is(":empty")&&!n.preserveTempContainers.includes(r.attr("id"))&&r.remove()})),x.children(at).not(ct).each(((e,t)=>{if(0==o(t).children(st).length){const e=p.getRowValue(o(t).attr("class"));c=c.filter((t=>t!=e)),o(t).remove()}else Ae(o(t))}))}function Me(){return x.find("li").length>0}function Ie(){if(Me()||!S())return;const e=Ce({}),t=b("div",null,{id:`${p.incrementId(s.lastID)}-row`,className:`row row-${e.rowNumber} ${rt}`});x.append(t),ge(t),be(),x.find(ct).eq(0).removeClass(lt).css({height:x.css("height"),backgroundColor:"transparent"})}function Pe(e){if(void 0===e&&(e=!0),e)Ne=!0,p.showToast("Starting Grid Mode - Use the mousewheel to resize.",1500),A.css("display","none"),o(d.formActions).css("display","none"),xe(),o(M).html("\n
\n
Grid Mode
\n \n
\n \n \n Action | \n Result | \n
\n \n \n \n MOUSEWHEEL | \n Adjust the field column size | \n
\n \n W or ↑ | \n Move entire row up | \n
\n \n S or ↓ | \n Move entire row down | \n
\n \n A or ← | \n Move field left within the row | \n
\n \n D or → | \n Move field right within the row | \n
\n \n R | \n Resize all fields within the row to be maximally equal | \n
\n \n
\n
\n\n
Current Row Fields
\n \n
\n \n \n \n \n \n \n \n Field | \n Size | \n
\n \n\n \n \n
\n \n
\n "),Be(),p.closeAllEdit(),p.toggleHighlight(je),ue();else{p.showToast("Grid Mode Finished",1500);const e=je.closest(at);let t=0;e.children(`div${st}`).each(((e,r)=>{const n=o(`#${r.id}`).find("li").attr("id");t+=p.getBootstrapColumnValue(o(`#${n}-cont`).attr("class"))})),t>12&&De(e,!0),Ne=!1,je=null,o(M).empty(),A.css("display","unset"),o(d.formActions).css("display","unset")}}function Be(){o(M).find(".gridHelpCurrentRow tbody").empty(),je.closest(at).children(`div${st}`).each(((e,t)=>{const r=o(`#${t.id}`).find("li").attr("id"),n=o(`#${r}`),i=n.attr("type");let l=n.html();"hidden"!==i&&"paragraph"!==i||(l=n.val()),l||(l=n.attr("id"));let a="";je.attr("id")==r&&(a="currentGridModeFieldHighlight"),o(M).find(".gridHelpCurrentRow tbody").append(`\n
\n ${l} | \n \n ${p.getBootstrapColumnValue(o(`#${r}-cont`).attr("class"))}\n | \n
\n `)}))}if(x.on("click touchstart",".grid-button",(e=>{e.preventDefault();const t=o(e.target).parents(".form-field:eq(0)").attr("id");je=o(document.getElementById(t)),Ee=e.pageX,qe=e.pageY,Te=0,Pe()})),x.on("wheel",(function(e){if(0!==e.originalEvent.deltaY&&Ne){e.preventDefault(),Te+=e.originalEvent.deltaY;const t=120;if(Te>0&&Te-t)return;const r=je.closest("div"),n=p.getBootstrapColumnValue(r.attr("class")),i=Math.round(Te/t);Te%=t;const l=n+i;if(l>12)return void p.showToast('Column Size cannot exceed 12');if(l<1)return void p.showToast('Column Size cannot be less than 1');const a=je.closest(at);let s=l;if(a.children(`div${st}`).each(((e,t)=>{const r=o(`#${t.id}`).find("li").attr("id");r!=je.attr("id")&&(s+=p.getBootstrapColumnValue(o(`#${r}-cont`).attr("class")))})),s>12)return void p.showToast('There is a maximum of 12 columns per row');p.syncBootstrapColumnWrapperAndClassProperty(je.attr("id"),l),je.attr("manuallyChangedDefaultColumnClass",!0),Be(),p.toggleHighlight(je)}})),o(document).keydown((e=>{if(Ne){e.preventDefault();const t=je.closest(at);87!=e.keyCode&&38!=e.keyCode||function(e){const t=e.prevAll().not(ct).not(".form-prepend").first();t.length&&(o(je.parent().parent()).swapWith(t),p.toggleHighlight(je))}(t),83!=e.keyCode&&40!=e.keyCode||function(e){const t=e.nextAll().not(ft).not(".form-append").first();t.length&&(o(je.parent().parent()).swapWith(t),p.toggleHighlight(je))}(t),65!=e.keyCode&&37!=e.keyCode||function(){const e=je.parent().prev();e.length&&je.parent().after(e),p.toggleHighlight(je)}(),68!=e.keyCode&&39!=e.keyCode||function(){const e=je.parent().next();e.length&&je.parent().before(e),p.toggleHighlight(je)}(),82==e.keyCode&&De(t,!0),Be(),Ae(t)}})),o(document).mousemove((e=>{Ne&&p.getDistanceBetweenPoints(Ee,qe,e.pageX,e.pageY)>ve.opts.cancelGridModeDistance&&Pe(!1)})),o(document).on("checkRowCleanup",((e,t)=>{Re();const r=o(`#${t.rowWrapperID}`);r.length&&De(r,!0),Ie()})),o(document).on("fieldOpened",((e,t)=>{const r=o(`#${t.rowWrapperID}`);r.length&&Ae(r)})),x.on("click",".field-actions .sort-button",(function(e){e.preventDefault();const t=o(e.target).parent().parent("li");let r;o(e.target).hasClass("sort-button-higher")?(r=t.prev("li"),r.length&&!r.hasClass("form-prepend")&&t.insertBefore(r)):(r=t.next("li"),r.length&&!r.hasClass("form-append")&&t.insertAfter(r)),p.toggleHighlight(t)})),x.on("click",".style-wrap button",(e=>{const t=o(e.target),r=t.closest(".form-elements"),n=t.val(),i=o(".btn-style",r);i.val(n),t.siblings(".btn").removeClass("selected"),t.addClass("selected"),we(i.closest(".form-field"))})),x.on("click",".fld-required",(e=>{o(e.target).closest(".form-field").find(".required-asterisk").toggle()})),x.on("click","input.fld-access",(function(e){const t=o(e.target).closest(".form-field").find(".available-roles"),r=o(e.target);t.slideToggle(250,(function(){r.is(":checked")||o("input[type=checkbox]",t).removeAttr("checked")}))})),x.on("click",".add-opt",(function(e){e.preventDefault();const t=o(e.target).closest(".form-field").attr("type"),r=o(e.target).closest(".field-options"),n=o('[name="multiple"]',r),i=o(".option-selected:eq(0)",r),l=n.length?n.prop("checked"):"checkbox"===i.attr("type"),a=o(".sortable-options",r),s=ve.opts.onAddOption({selected:!1,label:"",value:""},{type:t,index:a.children().length,isMultiple:l});a.append(Oe(i.attr("name"),s,l))})),x.on("mouseover mouseout",".remove, .del-button",(e=>o(e.target).closest("li").toggleClass("delete"))),z(),!0===e.disableInjectedStyle){const e=document.getElementsByClassName("formBuilder-injected-style");X(e,(t=>a(e[t])))}else"bootstrap"===e.disableInjectedStyle&&d.editorWrap.classList.remove("formbuilder-embedded-bootstrap");return document.dispatchEvent(v.loaded),n.actions={getFieldTypes:t=>t?ae(g.getRegistered(),e.disableFields):g.getRegistered(),clearFields:()=>p.removeAllFields(d.stage),showData:p.showData.bind(p),save:e=>{const t=p.save(e),r=window.JSON.parse(t);return ve.opts.onSave(r),r},addField:(e,t)=>{p.stopIndex=s.formData.length?t:void 0,P(e)},removeField:p.removeField.bind(p),getData:p.getFormData.bind(p),setData:e=>{p.stopIndex=void 0,p.removeAllFields(d.stage),z(e)},setLang:e=>{h().setCurrent.call(h(),e).then((()=>{d.stage.dataset.content=h().get("getStarted"),g.init(),d.empty(d.formActions),p.formActionButtons().forEach((e=>d.formActions.appendChild(e)))}))},showDialog:p.dialog.bind(p),toggleFieldEdit:e=>{(Array.isArray(e)?e:[e]).forEach((e=>{["number","string"].includes(typeof e)&&("number"==typeof e?e=d.stage.children[e].id:/^frmb-/.test(e)||(e=d.stage.querySelector(e).id),p.toggleEdit(e))}))},toggleAllFieldEdit:()=>{X(d.stage.children,(e=>{p.toggleEdit(d.stage.children[e].id)}))},closeAllFieldEdit:p.closeAllEdit.bind(p),getCurrentFieldId:()=>s.lastID},d.onRender(d.controls,(()=>{const t=setTimeout((()=>{d.stage.style.minHeight=`${d.controls.clientHeight}px`,e.stickyControls.enable&&p.stickyControls(x),Ie(),clearTimeout(t)}),0)})),n}const bt={init:(e,t)=>{const r=jQuery.extend({},be,e,!0),{i18n:o}=r,n=Ke(r,Ye);ve.opts=n;const i=jQuery.extend({},ge,o,!0);return bt.instance={actions:{getFieldTypes:null,addField:null,clearFields:null,closeAllFieldEdit:null,getData:null,removeField:null,save:null,setData:null,setLang:null,showData:null,showDialog:null,toggleAllFieldEdit:null,toggleFieldEdit:null,getCurrentFieldId:null},markup:H,get formData(){return bt.instance.actions.getData&&bt.instance.actions.getData("json")},promise:new Promise((function(e,r){h().init(i).then((()=>{t.each((e=>{const r=new mt(n,t[e],jQuery);jQuery(t[e]).data("formBuilder",r),Object.assign(bt,r.actions,{markup:H}),bt.instance.actions=r.actions})),delete bt.instance.promise,e(bt.instance)})).catch((e=>{r(e),n.notify.error(e)}))}))},bt.instance}};jQuery.fn.formBuilder=function(e){if(void 0===e&&(e={}),"string"!=typeof e){const t=bt.init(e,this);return Object.assign(bt,t),t}if(bt[e]){if("function"==typeof bt[e]){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o.btn{position:relative;float:left}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.rendered-form.formbuilder-embedded-bootstrap .btn-group .btn+.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .btn+.btn-group,.rendered-form.formbuilder-embedded-bootstrap .btn-group .btn-group+.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .btn-group+.btn-group{margin-left:-1px}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:last-child:not(:first-child),.rendered-form.formbuilder-embedded-bootstrap .btn-group>.dropdown-toggle:not(:first-child),.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group .form-control:last-child,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-addon:last-child,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:first-child>.btn:not(:first-child),.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:last-child>.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:last-child>.btn-group>.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn.active,.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:active,.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:focus,.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:hover{z-index:2}.rendered-form.formbuilder-embedded-bootstrap .btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-image:none;border-radius:4px}.rendered-form.formbuilder-embedded-bootstrap .btn.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.rendered-form.formbuilder-embedded-bootstrap .btn.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.rendered-form.formbuilder-embedded-bootstrap .btn.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.rendered-form.formbuilder-embedded-bootstrap .btn.active,.rendered-form.formbuilder-embedded-bootstrap .btn.btn-active,.rendered-form.formbuilder-embedded-bootstrap .btn:active{background-image:none}.rendered-form.formbuilder-embedded-bootstrap .input-group .form-control:last-child,.rendered-form.formbuilder-embedded-bootstrap .input-group-addon:last-child,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:first-child>.btn:not(:first-child),.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:last-child>.btn,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:last-child>.btn-group>.btn,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.rendered-form.formbuilder-embedded-bootstrap .input-group .form-control,.rendered-form.formbuilder-embedded-bootstrap .input-group-addon,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn{display:table-cell}.rendered-form.formbuilder-embedded-bootstrap .input-group-lg>.form-control,.rendered-form.formbuilder-embedded-bootstrap .input-group-lg>.input-group-addon,.rendered-form.formbuilder-embedded-bootstrap .input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333}.rendered-form.formbuilder-embedded-bootstrap .input-group{position:relative;display:table;border-collapse:separate}.rendered-form.formbuilder-embedded-bootstrap .input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.rendered-form.formbuilder-embedded-bootstrap .form-control,.rendered-form.formbuilder-embedded-bootstrap output{font-size:14px;line-height:1.42857143;display:block}.rendered-form.formbuilder-embedded-bootstrap textarea.form-control{height:auto}.rendered-form.formbuilder-embedded-bootstrap .form-control{height:34px;display:block;width:100%;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px}.rendered-form.formbuilder-embedded-bootstrap .form-control:focus{outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.rendered-form.formbuilder-embedded-bootstrap .form-group{margin-left:0px;margin-bottom:15px}.rendered-form.formbuilder-embedded-bootstrap .btn,.rendered-form.formbuilder-embedded-bootstrap .form-control{background-image:none}.rendered-form.formbuilder-embedded-bootstrap .pull-right{float:right}.rendered-form.formbuilder-embedded-bootstrap .pull-left{float:left}.rendered-form .formbuilder-required,.rendered-form .required-asterisk{color:#c10000}.rendered-form .formbuilder-checkbox-group input[type=checkbox],.rendered-form .formbuilder-checkbox-group input[type=radio],.rendered-form .formbuilder-radio-group input[type=checkbox],.rendered-form .formbuilder-radio-group input[type=radio]{margin:0 4px 0 0}.rendered-form .formbuilder-checkbox-inline,.rendered-form .formbuilder-radio-inline{margin-right:8px;display:inline-block;vertical-align:middle;padding-left:0}.rendered-form .formbuilder-checkbox-inline label input[type=text],.rendered-form .formbuilder-radio-inline label input[type=text]{margin-top:0}.rendered-form .formbuilder-checkbox-inline:first-child,.rendered-form .formbuilder-radio-inline:first-child{padding-left:0}.rendered-form .formbuilder-autocomplete-list{background-color:#fff;display:none;list-style:none;padding:0;border:1px solid #ccc;border-width:0 1px 1px;position:absolute;z-index:20;max-height:200px;overflow-y:auto}.rendered-form .formbuilder-autocomplete-list li{display:none;cursor:default;padding:5px;margin:0;transition:background-color 200ms ease-in-out}.rendered-form .formbuilder-autocomplete-list li:hover,.rendered-form .formbuilder-autocomplete-list li.active-option{background-color:rgba(0,0,0,.075)}.rendered-form *[tooltip]{position:relative}.rendered-form *[tooltip]:hover::after{background:rgba(0,0,0,.9);border-radius:5px 5px 5px 0;bottom:23px;color:#fff;content:attr(tooltip);padding:10px 5px;position:absolute;z-index:98;left:2px;width:230px;text-shadow:none;font-size:12px;line-height:1.5em;cursor:default}.rendered-form *[tooltip]:hover::before{border:solid;border-color:#222 rgba(0,0,0,0);border-width:6px 6px 0;bottom:17px;content:"";left:2px;position:absolute;z-index:99;cursor:default}.rendered-form .tooltip-element{visibility:visible;color:#fff;background:#000;width:16px;height:16px;border-radius:8px;display:inline-block;text-align:center;line-height:16px;margin:0 5px;font-size:12px;cursor:default}.rendered-form .kc-toggle{padding-left:0 !important}.rendered-form .kc-toggle span{position:relative;width:48px;height:24px;background:#e6e6e6;display:inline-block;border-radius:4px;border:1px solid #ccc;padding:2px;overflow:hidden;float:left;margin-right:5px;will-change:transform}.rendered-form .kc-toggle span::after,.rendered-form .kc-toggle span::before{position:absolute;display:inline-block;top:0}.rendered-form .kc-toggle span::after{position:relative;content:"";width:50%;height:100%;left:0;border-radius:3px;background:linear-gradient(to bottom, white 0%, #ccc 100%);border:1px solid #999;transition:transform 100ms;transform:translateX(0)}.rendered-form .kc-toggle span::before{border-radius:4px;top:2px;left:2px;content:"";width:calc(100% - 4px);height:18px;box-shadow:0 0 1px 1px #b3b3b3 inset;background-color:rgba(0,0,0,0)}.rendered-form .kc-toggle input{height:0;overflow:hidden;width:0;opacity:0;pointer-events:none;margin:0}.rendered-form .kc-toggle input:checked+span::after{transform:translateX(100%)}.rendered-form .kc-toggle input:checked+span::before{background-color:#6fc665}.rendered-form label{font-weight:normal}.rendered-form .form-group .formbuilder-required{color:#c10000}.rendered-form .other-option:checked+label input{display:inline-block}.rendered-form .other-val{margin-left:5px;display:none}.rendered-form .form-control.number{width:auto}.rendered-form .form-control[type=color]{width:60px;padding:2px;display:inline-block}.rendered-form .form-control[multiple]{height:auto}',""]),t.default=o},476:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r,n,o,i=e[1]||"",s=e[3];if(!s)return i;if(t&&"function"==typeof btoa){var a=(r=s,n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),"/*# ".concat(o," */")),l=s.sources.map((function(e){return"/*# sourceURL=".concat(s.sourceRoot||"").concat(e," */")}));return[i].concat(l).concat([a]).join("\n")}return[i].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var i=0;i=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){a.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){a.headers[e]=n.merge(i)})),e.exports=a}).call(this,r(12))},function(e,t,r){e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n0&&void 0!==arguments[0]?arguments[0]:s;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.langs=Object.create(null),this.loaded=[],this.processConfig(t)}return e.prototype.processConfig=function(e){var t=this,r=Object.assign({},s,e),n=r.location,o=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(r,["location"]),i=n.replace(/\/?$/,"/");this.config=Object.assign({},{location:i},o);var a=this.config,l=a.override,d=a.preloaded,c=void 0===d?{}:d,u=Object.entries(this.langs).concat(Object.entries(l||c));this.langs=u.reduce((function(e,r){var n=r[0],o=r[1];return e[n]=t.applyLanguage.call(t,n,o),e}),{}),this.locale=this.config.locale||this.config.langs[0]},e.prototype.init=function(e){return this.processConfig.call(this,Object.assign({},this.config,e)),this.setCurrent(this.locale)},e.prototype.addLanguage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t="string"==typeof t?this.processFile.call(this,t):t,this.applyLanguage.call(this,e,t),this.config.langs.push("locale")},e.prototype.getValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.locale;return this.langs[t]&&this.langs[t][e]||this.getFallbackValue(e)},e.prototype.getFallbackValue=function(e){var t=Object.values(this.langs).find((function(t){return t[e]}));return t&&t[e]},e.prototype.makeSafe=function(e){var t={"{":"\\{","}":"\\}","|":"\\|"};return e=e.replace(/\{|\}|\|/g,(function(e){return t[e]})),new RegExp(e,"g")},e.prototype.put=function(e,t){return this.current[e]=t},e.prototype.get=function(e,t){var r=this.getValue(e);if(r){var o=r.match(/\{[^}]+?\}/g),i=void 0;if(t&&o)if("object"===(void 0===t?"undefined":n(t)))for(var s=0;s1&&void 0!==arguments[1])||arguments[1],r=this;return new Promise((function(n,o){if(-1!==r.loaded.indexOf(e)&&t)return r.applyLanguage.call(r,r.langs[e]),n(r.langs[e]);var s=[r.config.location,e,r.config.extension].join("");return(0,i.get)(s).then((function(t){var o=t.data,i=r.processFile(o);return r.applyLanguage.call(r,e,i),r.loaded.push(e),n(r.langs[e])})).catch((function(){var t=r.applyLanguage.call(r,e);n(t)}))}))},e.prototype.applyLanguage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.config.override[e]||{},n=this.langs[e]||{};return this.langs[e]=Object.assign({},n,t,r),this.langs[e]},e.prototype.setCurrent=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US";return this.loadLang(t).then((function(){return e.locale=t,e.current=e.langs[t],e.current}))},o(e,[{key:"getLangs",get:function(){return this.config.langs}}]),e}();t.default=new a},function(e,t,r){e.exports=r(9)},function(e,t,r){var n=r(0),o=r(2),i=r(11),s=r(1);function a(e){var t=new i(e),r=o(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var l=a(s);l.Axios=i,l.create=function(e){return a(n.merge(s,e))},l.Cancel=r(6),l.CancelToken=r(26),l.isCancel=r(5),l.all=function(e){return Promise.all(e)},l.spread=r(27),e.exports=l,e.exports.default=l},function(e,t,r){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){var n=r(1),o=r(0),i=r(21),s=r(22);function a(e){this.defaults=e,this.interceptors={request:new i,response:new i}}a.prototype.request=function(e){"string"==typeof e&&(e=o.merge({url:arguments[0]},arguments[1])),(e=o.merge(n,{method:"get"},this.defaults,e)).method=e.method.toLowerCase();var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},o.forEach(["delete","get","head","options"],(function(e){a.prototype[e]=function(t,r){return this.request(o.merge(r||{},{method:e,url:t}))}})),o.forEach(["post","put","patch"],(function(e){a.prototype[e]=function(t,r,n){return this.request(o.merge(n||{},{method:e,url:t,data:r}))}})),e.exports=a},function(e,t,r){var n,o,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var d,c=[],u=!1,p=-1;function f(){u&&d&&(u=!1,d.length?c=d.concat(c):p=-1,c.length&&m())}function m(){if(!u){var e=l(f);u=!0;for(var t=c.length;t;){for(d=c,c=[];++p1)for(var r=1;r=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},function(e,t,r){var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){function n(){this.message="String contains an invalid character"}n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,r,o=String(e),i="",s=0,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.charAt(0|s)||(a="=",s%1);i+=a.charAt(63&t>>8-s%1*8)){if((r=o.charCodeAt(s+=.75))>255)throw new n;t=t<<8|r}return i}},function(e,t,r){var n=r(0);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){var n=r(0);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,r){var n=r(0),o=r(23),i=r(5),s=r(1),a=r(24),l=r(25);function d(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return d(e),e.baseURL&&!a(e.url)&&(e.url=l(e.baseURL,e.url)),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return d(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(d(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){var n=r(0);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},function(e,t,r){e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){var n=r(6);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){e.exports=function(e){return function(t){return e.apply(null,t)}}}])},34:function(e,t,r){var n=r(892),o=r(44);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);n(o,{attributes:{class:"formBuilder-injected-style"},insert:"head",singleton:!1}),e.exports=o.locals||{}},892:function(e,t,r){var n,o=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),i=[];function s(e){for(var t=-1,r=0;re}};var i;const s=(e,t)=>{if(0===o.backendOrder.length)return!1;const r=e.toLowerCase();return t=t?t+"":"",r.startsWith("on")||["form","formaction"].includes(r)||t.trim().toLowerCase().startsWith("javascript:")};o.backends.fallback=function(t){const r=document.implementation.createHTMLDocument(""),n=r.createElement("base");n.href=document.location.href,r.head.appendChild(n);const o=["applet","comment","embed","iframe","link","listing","meta","noscript","object","plaintext","script","style","xmp"],i=e.parseHTML(t,r,!1);e(i).find("*").addBack().each(((t,r)=>{"#text"!==r.nodeName&&(r.tagName&&o.includes(r.tagName.toLowerCase())?r.parentElement?r.parentElement.removeChild(r):i.includes(r)&&i.splice(i.indexOf(r),1):r.attributes&&Array.from(r.attributes).forEach((t=>{s(t.name,t.value)&&e(r).removeAttr(t.name)})))}));const a=r.createElement("div");return e(a).html(i),a.innerHTML};const a=e=>{const t=!!o.clobberingProtection.document&&document,r=!!o.clobberingProtection.form&&document.createElement("form");return t&&e in t||r&&e in r?o.clobberingProtection.namespaceAttributes?"user-content-"+e:void 0:e},l={fallback:(e,t)=>{const r=o.backends.fallback,n="function"==typeof r;return n&&(t=r(t)),e.innerHTML=t,n},dompurify:(e,t)=>{const r=o.backends.dompurify;return!(!1===r||!r.isSupported||(e.innerHTML=r.sanitize(t),0))},sanitizer:(e,t)=>{const r=o.backends.sanitizer;return!!r&&(e.setHTML(t,{sanitizer:r}),!0)}},d=["events"],c=["tag","content"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}window.fbLoaded={js:[],css:[]},window.fbEditors={quill:{},tinymce:{}};const m=function(e,t){if(void 0===t&&(t=!1),null==e||"object"!=typeof e)return e;const r="function"==typeof window.structuredClone?window.structuredClone(e):Object.assign({},e),n=[null,void 0,""];t&&n.push(!1);for(const e in r)n.includes(r[e])?delete r[e]:Array.isArray(r[e])&&(r[e].length||delete r[e]);return r},b=function(e){return!["values","enableOther","other","label","subtype"].includes(e)},h=(e,t)=>{let r;return e=g(e),t&&(Array.isArray(t)?r=S(t.join(" ")):("boolean"==typeof t&&(t=t.toString()),r=S(t.trim()))),{name:e,value:t=t?`="${r}"`:""}},g=e=>({className:"class"}[e]||y(e)),y=e=>(e=(e=e.replace(/[^\w\s\-]/gi,"")).replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))).replace(/\s/g,"-").replace(/^-+/g,""),v=e=>e.replace(/-([a-z])/g,((e,t)=>t.toUpperCase())),w=function(){let e,t=0;return function(r){const n=(new Date).getTime();return n===e?++t:(t=0,e=n),(r.type||y(r.label))+"-"+n+"-"+t}}(),x=e=>void 0===e?e:[["array",e=>Array.isArray(e)],["node",e=>e instanceof window.Node||e instanceof window.HTMLElement],["component",()=>e&&e.dom],[typeof e,()=>!0]].find((t=>t[1](e)))[0],O=function(t,r,n){void 0===r&&(r=""),void 0===n&&(n={});let i=x(r);const{events:u}=n,p=f(n,d),m=document.createElement(t),b={string:t=>{!function(t,r,n){if(void 0===n&&(n=!1),!n){const n=document.createElement(t.tagName);return void 0!==o.backendOrder.find((e=>l[e](n,r)))?((t=>{e(t).find("*").each(((e,t)=>{["embed","form","iframe","image","img","object"].includes(t.tagName.toLowerCase())&&t.removeAttribute("name"),["id","name"].forEach((e=>{if(t.hasAttribute(e)){const r=a(t.getAttribute(e));void 0===r?t.removeAttribute(e):t.setAttribute(e,r)}}))}))})(n),t.innerHTML=n.innerHTML,t):(t.innerHTML=r,t)}t.textContent=r}(m,m.innerHTML+t)},object:e=>{const{tag:t,content:r}=e,n=f(e,c);return m.appendChild(O(t,r,n))},node:e=>m.appendChild(e),array:e=>{for(let t=0;t{e=e(),i=x(e),b[i](e)},undefined:()=>{}};for(const e in p)if(p.hasOwnProperty(e)){const t=g(e);let r=Array.isArray(p[e])?T(p[e].join(" ").split(" ")).join(" "):p[e];if(s(t,r))continue;if("boolean"==typeof r){if(!0===r){const e="contenteditable"===t||t;m.setAttribute(t,e)}}else"id"!==t&&"name"!==t||(r=a(r)),void 0!==r&&m.setAttribute(t,r)}return r&&b[i](r),((e,t)=>{if(t)for(const r in t)t.hasOwnProperty(r)&&e.addEventListener(r,(e=>t[r](e)))})(m,u),m},q=e=>{const t=e.attributes,r={};return A(t,(e=>{let n=t[e].value||"";n.match(/false|true/g)?n="true"===n:n.match(/undefined/g)&&(n=void 0),n&&(r[v(t[e].name)]=n)})),r},j=e=>{const t=[];for(let r=0;r{const t=[];if(e.length){const r=e[0].getElementsByTagName("value");for(let e=0;e{const t=(new window.DOMParser).parseFromString(e,"text/xml"),r=[];if(t){const e=t.getElementsByTagName("field");for(let t=0;t{const t=document.createElement("textarea");return t.innerHTML=e,t.textContent},S=e=>{const t={'"':""","&":"&","<":"<",">":">"};return"string"==typeof e?e.replace(/["&<>]/g,(e=>t[e]||e)):e},A=function(e,t,r){for(let n=0;ne.filter(((e,t,r)=>r.indexOf(e)===t)),L=(e,t)=>{const r=jQuery;let n=[];return Array.isArray(e)||(e=[e]),R(e)||(n=jQuery.map(e,(e=>{const r={dataType:"script",cache:!0,url:(t||"")+e};return jQuery.ajax(r).done((()=>window.fbLoaded.js.push(e)))}))),n.push(jQuery.Deferred((e=>r(e.resolve)))),jQuery.when(...n)},R=function(e,t){void 0===t&&(t="js");let r=!1;const n=window.fbLoaded[t];return r=Array.isArray(e)?e.every((e=>n.includes(e))):n.includes(e),r},P=(t,r)=>{Array.isArray(t)||(t=[t]),t.forEach((t=>{let n="href",o=t,i="";if("object"==typeof t&&(n=t.type||(t.style?"inline":"href"),i=t.id,o=i||t.href||t.style,t="inline"===n?t.style:t.href),!R(o,"css")){if("href"===n){const e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=(r||"")+t,document.head.appendChild(e)}else e(``).attr("id",i).appendTo(e(document.head));window.fbLoaded.css.push(o)}}))},N=(e,t)=>{const r=Object.assign({},e,t);for(const n in t)r.hasOwnProperty(n)&&(Array.isArray(t[n])?r[n]=Array.isArray(e[n])?T(e[n].concat(t[n])):t[n]:"object"==typeof t[n]?r[n]=N(e[n],t[n]):r[n]=t[n]);return r},D=/^col-(xs|sm|md|lg)-([^\s]+)/,M={addEventListeners:(e,t,r)=>t.split(" ").forEach((t=>e.addEventListener(t,r,!1))),attrString:e=>Object.entries(e).map((e=>{let[t,r]=e;return b(t)&&Object.values(h(t,r)).join("")})).filter(Boolean).join(" "),camelCase:v,capitalize:e=>e.replace(/\b\w/g,(function(e){return e.toUpperCase()})),closest:(e,t)=>{const r=t.replace(".","");for(;(e=e.parentElement)&&!e.classList.contains(r););return e},getContentType:x,escapeAttr:S,escapeAttrs:e=>{for(const t in e)e.hasOwnProperty(t)&&(e[t]=S(e[t]));return e},escapeHtml:e=>{const t=document.createElement("textarea");return t.textContent=e,t.innerHTML},forceNumber:e=>e.replace(/[^0-9]/g,""),forEach:A,getScripts:L,getStyles:P,hyphenCase:y,isCached:R,markup:O,merge:N,mobileClass:()=>{let e="";var t;return t=navigator.userAgent||navigator.vendor||window.opera,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)&&(e="formbuilder-mobile"),e},nameAttr:w,parsedHtml:E,parseXML:C,removeFromArray:(e,t)=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)},safeAttr:h,safeAttrName:g,safename:e=>e.replace(/\s/g,"-").replace(/[^a-zA-Z0-9[\]_-]/g,""),subtract:(e,t)=>t.filter((function(e){return!~this.indexOf(e)}),e),trimObj:m,unique:T,validAttr:b,titleCase:function(e){const t=["a","an","and","as","at","but","by","for","for","from","in","into","near","nor","of","on","onto","or","the","to","with"].map((e=>`\\s${e}\\s`)),r=new RegExp(`(?!${t.join("|")})\\w\\S*`,"g");return`${e}`.replace(r,(e=>e.charAt(0).toUpperCase()+e.slice(1).replace(/[A-Z]/g,(e=>` ${e}`))))},splitObject:(e,t)=>{const r=e=>(t,r)=>(t[r]=e[r],t);return[Object.keys(e).filter((e=>t.includes(e))).reduce(r(e),{}),Object.keys(e).filter((e=>!t.includes(e))).reduce(r(e),{})]}};e.fn.swapWith=function(t){const r=this,n=e(t),o=e("");return r.before(o),n.before(r),o.before(n).remove(),r};var F=M;const z=function(e,t,r){void 0===r&&(r=!0);const n=[];let o=["none","block"];r&&(o=o.reverse());for(let r=e.length-1;r>=0;r--)-1!==e[r].textContent.toLowerCase().indexOf(t.toLowerCase())?(e[r].style.display=o[0],n.push(e[r])):e[r].style.display=o[1];return n};function B(e){let t;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event"),t.initEvent(e,!0,!0)),t}new RegExp(`(${["select","checkbox-group","checkbox","radio-group","autocomplete"].join("|")})`);var H={loaded:B("loaded"),viewData:B("viewData"),userDeclined:B("userDeclined"),modalClosed:B("modalClosed"),modalOpened:B("modalOpened"),formSaved:B("formSaved"),fieldAdded:B("fieldAdded"),fieldRemoved:B("fieldRemoved"),fieldRendered:B("fieldRendered"),fieldEditOpened:B("fieldEditOpened"),fieldEditClosed:B("fieldEditClosed")};const U=(e,t)=>{let r=e.id?`formbuilder-${e.type} form-group field-${e.id}`:"";if(e.className){const n=(e=>e.split(" ").filter((e=>D.test(e)||e.startsWith("row-"))))(e.className);n&&n.length>0&&(r+=` ${n.join(" ")}`),t.classList&&t.classList.remove(...n),Array.isArray(t)||(t=[t]),t.forEach((e=>e.querySelectorAll("[class*=row-],[class*=col-]").forEach((e=>{e.classList&&e.classList.remove(...n)}))))}return r};class ${constructor(e,t,r){var n,o;void 0===t&&(t=!1),void 0===r&&(r=!1),this.preview=null!==(n=t)&&void 0!==n&&n,this.disableHTMLLabels=null!==(o=r)&&void 0!==o&&o,this.templates={label:null,help:null,default:(e,t,r,n)=>(r&&t.appendChild(r),this.markup("div",[t,e],{className:U(n,e)})),noLabel:(e,t,r,n)=>this.markup("div",e,{className:U(n,e)}),hidden:e=>e},e&&(this.templates=jQuery.extend(this.templates,e)),this.configure()}configure(){}build(e,t,r){this.preview&&(t.name?t.name=t.name+"-preview":t.name=F.nameAttr(t)+"-preview"),t.id=t.name,this.data=jQuery.extend({},t);const n=new e(t,this.preview);let o=n.build();"object"==typeof o&&o.field||(o={field:o});const i=this.label(),s=this.help();let a;a=r&&this.isTemplate(r)?r:this.isTemplate(o.layout)?o.layout:"default";const l=this.processTemplate(a,o.field,i,s);return n.on("prerender")(l),l.addEventListener("fieldRendered",n.on("render")),l}label(){const e=this.data.label||"",t=[this.disableHTMLLabels?document.createTextNode(e):F.parsedHtml(e)];return this.data.required&&t.push(this.markup("span","*",{className:"formbuilder-required"})),this.isTemplate("label")?this.processTemplate("label",t):this.markup("label",t,{for:this.data.id,className:`formbuilder-${this.data.type}-label`})}help(){return this.data.description?this.isTemplate("help")?this.processTemplate("help",this.data.description):this.markup("span","?",{className:"tooltip-element",tooltip:this.data.description}):null}isTemplate(e){return"function"==typeof this.templates[e]}processTemplate(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n
e?t.indexOf(e+".")>-1:-1===t.indexOf("."))):t}static getRegisteredSubtypes(){const e={};for(const t in _.classRegister)if(_.classRegister.hasOwnProperty(t)){const[r,n]=t.split(".");if(!n)continue;e[r]||(e[r]=[]),e[r].push(n)}return e}static getClass(e,t){const r=t?e+"."+t:e;return _.classRegister[r]||_.classRegister[e]||_.error("Invalid control type. (Type: "+e+", Subtype: "+t+"). Please ensure you have registered it, and imported it correctly.")}static loadCustom(e){let t=[];if(e&&(t=t.concat(e)),window.fbControls&&(t=t.concat(window.fbControls)),!this.fbControlsLoaded){for(const e of t)e(_,_.classRegister);this.fbControlsLoaded=!0}}static mi18n(e,t){const n=this.definition;let o=n.i18n||{};o=o[r().locale]||o.default||o;const i=this.camelCase(e),s="object"==typeof o?o[i]||o[e]:o;if(s)return s;let a=n.mi18n;return"object"==typeof a&&(a=a[i]||a[e]),a||(a=i),r().get(a,t)}static active(e){return!Array.isArray(this.definition.inactive)||-1===this.definition.inactive.indexOf(e)}static label(e){return this.mi18n(e)}static icon(e){const t=this.definition;return t&&"object"==typeof t.icon?t.icon[e]:t.icon}configure(){}build(){const e=this.config,{label:t,type:r}=e,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,I);return this.markup(r,E(t),n)}on(e){const t={prerender:e=>e,render:e=>{const t=()=>{this.onRender&&this.onRender(e)};this.css&&P(this.css),this.js&&!R(this.js)?L(this.js).done(t):t()}};return e?t[e]:t}static error(e){throw new Error(e)}markup(e,t,r){return void 0===t&&(t=""),void 0===r&&(r={}),this.element=O(e,t,r),this.element}parsedHtml(e){return E(e)}static camelCase(e){return v(e)}}const V=["values","type"];_.register("autocomplete",class extends _{static get definition(){return{mi18n:{requireValidOption:"requireValidOption"}}}build(){const e=this.config,{values:t,type:r}=e,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,V),o=e=>{const t=e.target.nextSibling.nextSibling,r=e.target.nextSibling,n=this.getActiveOption(t);let o=new Map([[38,()=>{const e=this.getPreviousOption(n);e&&this.selectOption(t,e)}],[40,()=>{const e=this.getNextOption(n);e&&this.selectOption(t,e)}],[13,()=>{n?(e.target.value=n.innerHTML,r.value=n.getAttribute("value"),"none"===t.style.display?this.showList(t,n):this.hideList(t)):this.config.requireValidOption&&(this.isOptionValid(t,e.target.value)||(e.target.value="",e.target.nextSibling.value="")),e.preventDefault()}],[27,()=>{this.hideList(t)}]]).get(e.keyCode);return o||(o=()=>!1),o()},i={focus:e=>{const t=e.target.nextSibling.nextSibling,r=z(t.querySelectorAll("li"),e.target.value);if(e.target.addEventListener("keydown",o),e.target.value.length>0){const e=r.length>0?r[r.length-1]:null;this.showList(t,e)}},blur:e=>{e.target.removeEventListener("keydown",o);const t=setTimeout((()=>{e.target.nextSibling.nextSibling.style.display="none",clearTimeout(t)}),200);if(this.config.requireValidOption){const t=e.target.nextSibling.nextSibling;this.isOptionValid(t,e.target.value)||(e.target.value="",e.target.nextSibling.value="")}},input:e=>{const t=e.target.nextSibling.nextSibling;e.target.nextSibling.value=e.target.value;const r=z(t.querySelectorAll("li"),e.target.value);if(0==r.length)this.hideList(t);else{let e=this.getActiveOption(t);e||(e=r[r.length-1]),this.showList(t,e)}}},s=Object.assign({},n,{id:`${n.id}-input`,autocomplete:"off",events:i}),a=Object.assign({},n,{type:"hidden"});delete s.name;const l=[this.markup("input",null,s),this.markup("input",null,a)],d=t.map((e=>{const t=e.label,r={events:{click:t=>{const r=t.target.parentElement,n=r.previousSibling.previousSibling;n.value=e.label,n.nextSibling.value=e.value,this.hideList(r)}},value:e.value};return this.markup("li",t,r)}));return l.push(this.markup("ul",d,{id:`${n.id}-list`,className:`formbuilder-${r}-list`})),l}hideList(e){this.selectOption(e,null),e.style.display="none"}showList(e,t){this.selectOption(e,t),e.style.display="block",e.style.width=e.parentElement.offsetWidth+"px"}getActiveOption(e){const t=e.getElementsByClassName("active-option")[0];return t&&"none"!==t.style.display?t:null}getPreviousOption(e){let t=e;do{t=t?t.previousSibling:null}while(null!=t&&"none"===t.style.display);return t}getNextOption(e){let t=e;do{t=t?t.nextSibling:null}while(null!=t&&"none"===t.style.display);return t}selectOption(e,t){const r=e.querySelectorAll("li");for(let e=0;e=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,W);let n=t;const o={paragraph:"p",header:this.subtype};return o[t]&&(n=o[t]),{field:this.markup(n,F.parsedHtml(this.label),r),layout:"noLabel"}}}_.register(["paragraph","header"],J),_.register(["p","address","blockquote","canvas","output"],J,"paragraph"),_.register(["h1","h2","h3","h4","h5","h6"],J,"header");const G=["values","value","placeholder","type","inline","other","toggle"],Z=["label"];function K(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}_.register(["select","checkbox-group","radio-group","checkbox"],class extends _{static get definition(){return{inactive:["checkbox"],mi18n:{minSelectionRequired:"minSelectionRequired"}}}build(){const e=[],t=this.config,{values:r,value:n,placeholder:o,type:i,inline:s,other:a,toggle:l}=t,d=K(t,G),c=i.replace("-group",""),u="select"===i;if((d.multiple||"checkbox-group"===i)&&(d.name=d.name+"[]"),"checkbox-group"===i&&d.required){const e=this,t=this.onRender.bind(this);this.onRender=function(){t(),e.groupRequired()}}if(delete d.title,r){o&&u&&e.push(this.markup("option",o,{disabled:null,selected:null}));for(let t=0;t{const t=e.target;t.parentElement.previousElementSibling.value=t.value}},id:`${t.id}-value`,className:"other-val"},i=this.markup("input",null,n),a=[document.createTextNode(_.mi18n("other")),this.markup("input",null,o)],l=this.markup("label",a,{for:n.id}),u=this.markup("div",[i,l],{className:r});e.push(u)}}return this.dom="select"==i?this.markup(c,e,m(d,!0)):this.markup("div",e,{className:i}),this.dom}groupRequired(){const e=this.element.getElementsByTagName("input"),t=()=>{const t=[].some.call(e,(e=>e.checked));((e,t)=>{[].forEach.call(e,(e=>{t?e.removeAttribute("required"):e.setAttribute("required","required"),((e,t)=>{const r=_.mi18n("minSelectionRequired",1);t?e.setCustomValidity(""):e.setCustomValidity(r)})(e,t)}))})(e,t)};for(let r=e.length-1;r>=0;r--)e[r].addEventListener("change",t);t()}onRender(){if(this.config.userData){const t=this.config.userData.slice();"select"===this.config.type?e(this.dom).val(t).prop("selected",!0):this.config.type.endsWith("-group")&&("checkbox-group"===this.config.type&&this.dom.querySelectorAll("input[type=checkbox]").forEach((e=>{e.removeAttribute("checked")})),this.dom.querySelectorAll("input").forEach((e=>{if(!e.classList.contains("other-val")){for(let r=0;rdelete this.classConfig[e]));const t=this.classConfig.template||'\n \n
\n
\n \n
\n
\n
\n Processing dropped files...\n \n \n
\n - \n \n \n \n
\n
\n
\n \n \n \n
\n \n \n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
';this.fineTemplate=e("").attr("id","qq-template").html(t)}build(){return this.input=this.markup("input",null,{type:"hidden",name:this.config.name,id:this.config.name}),this.wrapper=this.markup("div","",{id:this.config.name+"-wrapper"}),[this.input,this.wrapper]}onRender(){const t=e(this.wrapper),r=e(this.input),n=jQuery.extend(!0,{request:{endpoint:this.handler},deleteFile:{enabled:!0,endpoint:this.handler},chunking:{enabled:!0,concurrent:{enabled:!0},success:{endpoint:this.handler+(-1==this.handler.indexOf("?")?"?":"&")+"done"}},resume:{enabled:!0},retry:{enableAuto:!0,showButton:!0},callbacks:{onError:(r,n,o)=>{"."!=o.slice(-1)&&(o+=".");const i=e("").addClass("qq-error-message").html(`Error processing upload: ${n}.
Reason: ${o}`).prependTo(t.find(".qq-uploader")),s=window.setTimeout((()=>{i.fadeOut((()=>{i.remove(),window.clearTimeout(s)}))}),6e3);return r},onStatusChange:(e,n,o)=>{const i=t.fineUploader("getUploads"),s=[];for(const e of i)"upload successful"==e.status&&s.push(e.name);return r.val(s.join(", ")),{id:e,oldStatus:n,newStatus:o}}},template:this.fineTemplate},this.classConfig);t.fineUploader(n)}},"file");const ee=["value"];class te extends _{static get definition(){return{mi18n:{textarea:"textArea"}}}build(){const e=this.config,{value:t=""}=e,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,ee);return delete r.type,this.field=this.markup("textarea",this.parsedHtml(t),r),this.field}onRender(){this.config.userData&&e(this.field).val(this.config.userData[0])}on(t){return"prerender"==t&&this.preview?t=>{this.field&&(t=this.field),e(t).on("mousedown",(e=>{e.stopPropagation()}))}:super.on(t)}}_.register("textarea",te),_.register("textarea",te,"textarea");const re=["value"];te.register("tinymce",class extends te{configure(){if(this.js=[],window.tinymce||this.js.push("https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js"),this.classConfig.js){let e=this.classConfig.js;Array.isArray(e)||(e=new Array(e)),this.js=this.js.concat(e),delete this.classConfig.js}this.classConfig.css&&(this.css=this.classConfig.css),this.editorOptions={height:250,paste_data_images:!0,plugins:["advlist","autolink","lists","link","image","charmap","print","preview","anchor","searchreplace","visualblocks","code","fullscreen","insertdatetime","media","table","contextmenu","paste","code"],toolbar:"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | table"}}build(){const e=this.config,{value:t=""}=e,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,re);return delete r.type,this.field=this.markup("textarea",this.parsedHtml(t),r),r.disabled&&(this.editorOptions.readonly=!0),this.field}onRender(){const e=window.tinymce.get(this.id);e&&window.tinymce.remove(e);const t=jQuery.extend(this.editorOptions,this.classConfig);t.target=this.field;const r=[];Number(window.tinymce.majorVersion)>=5&&r.push("contextmenu"),Number(window.tinymce.majorVersion)>=6&&r.push("paste","print"),t.plugins=t.plugins.filter((e=>-1===r.indexOf(e)));const n=this.config.userData?this.parsedHtml(this.config.userData[0]):void 0,o=window.lastFormBuilderCopiedTinyMCE?this.parsedHtml(window.lastFormBuilderCopiedTinyMCE):void 0;window.lastFormBuilderCopiedTinyMCE=null;const i=function(e){o?e.setContent(o):n&&e.setContent(n)};setTimeout((()=>{window.tinymce.init(t).then(i)}),0)}},"textarea");const ne=["value"];function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ie(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,ne);return delete r.type,this.field=this.markup("div",null,r),this.field}onRender(e){const t=this.config.value||"",r=window.Quill.import("delta");window.fbEditors.quill[this.id]={};const n=window.fbEditors.quill[this.id];return n.instance=new window.Quill(this.field,this.editorConfig),n.data=new r,t&&n.instance.setContents(window.JSON.parse(this.parsedHtml(t))),n.instance.on("text-change",(function(e){n.data=n.data.compose(e)})),e}},"textarea"),r().addLanguage("en-US",{NATIVE_NAME:"English (US)",ENGLISH_NAME:"English",addOption:"Add Option +",allFieldsRemoved:"All fields were removed.",allowMultipleFiles:"Allow users to upload multiple files",autocomplete:"Autocomplete",button:"Button",cannotBeEmpty:"This field cannot be empty",checkboxGroup:"Checkbox Group",checkbox:"Checkbox",checkboxes:"Checkboxes",className:"Class",clearAllMessage:"Are you sure you want to clear all fields?",clear:"Clear",close:"Close",content:"Content",copy:"Copy To Clipboard",copyButton:"+",copyButtonTooltip:"Copy",dateField:"Date Field",description:"Help Text",descriptionField:"Description",devMode:"Developer Mode",editNames:"Edit Names",editorTitle:"Form Elements",editXML:"Edit XML",enableOther:"Enable "Other"",enableOtherMsg:"Let users enter an unlisted option",fieldDeleteWarning:"false",fieldVars:"Field Variables",fieldNonEditable:"This field cannot be edited.",fieldRemoveWarning:"Are you sure you want to remove this field?",fileUpload:"File Upload",formUpdated:"Form Updated",getStarted:"Drag a field from the right to this area",header:"Header",hide:"Edit",hidden:"Hidden Input",inline:"Inline",inlineDesc:"Display {type} inline",label:"Label",labelEmpty:"Field Label cannot be empty",limitRole:"Limit access to one or more of the following roles:",mandatory:"Mandatory",maxlength:"Max Length",minOptionMessage:"This field requires a minimum of 2 options",minSelectionRequired:"Minimum {min} selections required",multipleFiles:"Multiple Files",name:"Name",no:"No",noFieldsToClear:"There are no fields to clear",number:"Number",off:"Off",on:"On",option:"Option",optionCount:"Option {count}",options:"Options",optional:"optional",optionLabelPlaceholder:"Label",optionValuePlaceholder:"Value",optionEmpty:"Option value required",other:"Other",paragraph:"Paragraph",placeholder:"Placeholder","placeholders.value":"Value","placeholders.label":"Label","placeholders.email":"Enter your email","placeholders.className":"space separated classes","placeholders.password":"Enter your password",preview:"Preview",radioGroup:"Radio Group",radio:"Radio",removeMessage:"Remove Element",removeOption:"Remove Option",remove:"×",required:"Required",requireValidOption:"Only accept a pre-defined Option",richText:"Rich Text Editor",roles:"Access",rows:"Rows",save:"Save",selectOptions:"Options",select:"Select",selectColor:"Select Color",selectionsMessage:"Allow Multiple Selections",size:"Size","size.xs":"Extra Small","size.sm":"Small","size.m":"Default","size.lg":"Large",style:"Style","styles.btn.default":"Default","styles.btn.danger":"Danger","styles.btn.info":"Info","styles.btn.primary":"Primary","styles.btn.success":"Success","styles.btn.warning":"Warning",subtype:"Type",text:"Text Field",textArea:"Text Area",toggle:"Toggle",warning:"Warning!",value:"Value",viewJSON:"[{…}]",viewXML:"</>",yes:"Yes"});const se={location:"assets/lang/"};n(34);class ae{constructor(e){void 0===e&&(e={});const t={layout:$,layoutTemplates:{},controls:{},controlConfig:{},container:!1,dataType:"json",disableHTMLLabels:!1,formData:!1,i18n:Object.assign({},se),messages:{formRendered:"Form Rendered",noFormData:"No form data.",other:"Other",selectColor:"Select Color",invalidControl:"Invalid control"},onRender:()=>{},render:!0,sanitizerOptions:{clobberingProtection:{document:!0,form:!1,namespaceAttributes:!0},backendOrder:["dompurify","sanitizer","fallback"]},templates:{},notify:{error:e=>{console.log(e)},success:e=>{console.log(e)},warning:e=>{console.warn(e)}}};if(this.options=jQuery.extend(!0,t,e),this.instanceContainers=[],(e=>{if("object"!=typeof e)throw"Invalid value given to setSanitizerConfig, expected config object";if(e.hasOwnProperty("clobberingProtection")&&["document","form","namespaceAttributes"].forEach((t=>{e.clobberingProtection.hasOwnProperty(t)&&"boolean"==typeof e.clobberingProtection[t]&&(o.clobberingProtection[t]=e.clobberingProtection[t])})),e.hasOwnProperty("backends")){if("object"!=typeof e.backends)throw"backends config expected to be an Object";Object.keys(e.backends).forEach((t=>o.backends[t]=e.backends[t]))}if(e.hasOwnProperty("backendOrder")){if(o.backendOrder=[],!Array.isArray(e.backendOrder))throw"backendOrder config expected to be an Array of backend keys as strings";e.backendOrder.forEach((e=>{if(!o.backends.hasOwnProperty(e))throw"unknown sanitizer backend "+e;o.backendOrder.push(e)}))}})(this.options.sanitizerOptions),r().current||r().init(this.options.i18n),!this.options.formData)return!1;this.options.formData=this.parseFormData(this.options.formData),_.controlConfig=e.controlConfig||{},_.loadCustom(e.controls),Object.keys(this.options.templates).length&&X.register(this.options.templates),"function"!=typeof Element.prototype.appendFormFields&&(Element.prototype.appendFormFields=function(e){Array.isArray(e)||(e=[e]);const t=F.markup("div",e,{className:"rendered-form formbuilder-embedded-bootstrap"});this.appendChild(t),e.forEach((e=>{const[r]=e.className.match(/row-([^\s]+)/)||[];if(r){const n=this.id?`${this.id}-row-${r}`:`row-${r}`;let o=document.getElementById(n);o||(o=F.markup("div",null,{id:n,className:"row"}),t.appendChild(o)),o.appendChild(e)}else t.appendChild(e);e.dispatchEvent(H.fieldRendered)}))}),"function"!=typeof Element.prototype.emptyContainer&&(Element.prototype.emptyContainer=function(){const e=this;for(;e.lastChild;)e.removeChild(e.lastChild)})}sanitizeField(e,t){const r=Object.assign({},e);return t&&(r.id=e.id&&`${e.id}-${t}`,r.name=e.name&&`${e.name}-${t}`),r.className=Array.isArray(e.className)?F.unique(e.className.join(" ").split(" ")).join(" "):e.className||e.class||null,delete r.class,e.values&&(e.values=e.values.map((e=>F.trimObj(e)))),F.trimObj(r)}getElement(e){return(e=this.options.container||e)instanceof jQuery?e=e[0]:"string"==typeof e&&(e=document.querySelector(e)),e}render(e,t){void 0===e&&(e=null),void 0===t&&(t=0);const r=this,n=this.options;e=this.getElement(e);const o=[];if(n.formData){const i=new n.layout(n.layoutTemplates,!1,n.disableHTMLLabels);for(let e=0;ee.map((e=>e.innerHTML)).join("");r.markup=e(o)}}else{const e=F.markup("div",n.messages.noFormData,{className:"no-form-data"});o.push(e),n.notify.error(n.messages.noFormData)}if(!0===n.disableInjectedStyle){const e=document.getElementsByClassName("formBuilder-injected-style");A(e,(t=>(e=>{e.parentNode&&e.parentNode.removeChild(e)})(e[t])))}else"bootstrap"===n.disableInjectedStyle&&n.render&&e&&e.getElementsByClassName("formbuilder-embedded-bootstrap").item(0)?.classList.remove("formbuilder-embedded-bootstrap");return r}renderControl(e){void 0===e&&(e=null);const t=this.options,r=t.formData;if(!r||Array.isArray(r))throw new Error("To render a single element, please specify a single object of formData for the field in question");const n=this.sanitizeField(r),o=new t.layout,i=_.getClass(r.type,r.subtype),s=t.forceTemplate||"hidden",a=o.build(i,n,s);return e.appendFormFields(a),t.notify.success(t.messages.formRendered),this}get userData(){const t=this.options.formData.slice();return t.filter((e=>"tinymce"===e.subtype)).forEach((e=>window.tinymce.get(e.name).save())),this.instanceContainers.forEach((r=>{const n=e("select, input, textarea",r).serializeArray().reduce(((e,t)=>{let{name:r,value:n}=t;return r=r.replace("[]",""),e[r]?e[r].push(n):e[r]=[n],e}),{}),o=t.length;for(let e=0;e{this.options.formData.slice().filter((e=>"tinymce"===e.subtype)).forEach((e=>window.tinymce.get(e.name).setContent(""))),e.querySelectorAll("input, select, textarea").forEach((e=>{["checkbox","radio"].includes(e.type)?e.checked=!1:e.value=""}))}))}parseFormData(e){const t={xml:e=>C(e),json:e=>window.JSON.parse(e)};return"object"!=typeof e&&(e=t[this.options.dataType](e)||!1),e}}!function(e){let t;const r={init:function(e,n){return void 0===n&&(n={}),t=e,r.instance=new ae(n),e.each((t=>r.instance.render(e[t],t))),r.instance},userData:()=>r.instance&&r.instance.userData,clear:()=>r.instance&&r.instance.clear(),setData:e=>{if(r.instance){const t=r.instance;t.options.formData=t.parseFormData(e)}},render:function(e,n){if(void 0===n&&(n={}),r.instance){const o=r.instance;e||(e=o.options.formData),o.options=Object.assign({},o.options,n,{formData:o.parseFormData(e)}),t.each((e=>r.instance.render(t[e],e)))}},html:()=>t.map((e=>t[e])).html()};e.fn.formRender=function(e){if(void 0===e&&(e={}),r[e]){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;or.renderControl(n[e]))),n}}(jQuery)}()}()}(jQuery);
\ No newline at end of file
+!function(e){"use strict";!function(){var t={44:function(e,t,r){r.r(t);var n=r(476),o=r.n(n)()(!1);o.push([e.id,'.rendered-form *{box-sizing:border-box}.rendered-form.formbuilder-embedded-bootstrap button,.rendered-form.formbuilder-embedded-bootstrap input,.rendered-form.formbuilder-embedded-bootstrap select,.rendered-form.formbuilder-embedded-bootstrap textarea{font-family:inherit;font-size:inherit;line-height:inherit}.rendered-form.formbuilder-embedded-bootstrap input{line-height:normal}.rendered-form.formbuilder-embedded-bootstrap textarea{overflow:auto}.rendered-form.formbuilder-embedded-bootstrap button,.rendered-form.formbuilder-embedded-bootstrap input,.rendered-form.formbuilder-embedded-bootstrap select,.rendered-form.formbuilder-embedded-bootstrap textarea{font-family:inherit;font-size:inherit;line-height:inherit}.rendered-form.formbuilder-embedded-bootstrap .btn-group{position:relative;display:inline-block;vertical-align:middle}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn{position:relative;float:left}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.rendered-form.formbuilder-embedded-bootstrap .btn-group .btn+.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .btn+.btn-group,.rendered-form.formbuilder-embedded-bootstrap .btn-group .btn-group+.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .btn-group+.btn-group{margin-left:-1px}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:last-child:not(:first-child),.rendered-form.formbuilder-embedded-bootstrap .btn-group>.dropdown-toggle:not(:first-child),.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group .form-control:last-child,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-addon:last-child,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:first-child>.btn:not(:first-child),.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:last-child>.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:last-child>.btn-group>.btn,.rendered-form.formbuilder-embedded-bootstrap .btn-group .input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn.active,.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:active,.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:focus,.rendered-form.formbuilder-embedded-bootstrap .btn-group>.btn:hover{z-index:2}.rendered-form.formbuilder-embedded-bootstrap .btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-image:none;border-radius:4px}.rendered-form.formbuilder-embedded-bootstrap .btn.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.rendered-form.formbuilder-embedded-bootstrap .btn.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.rendered-form.formbuilder-embedded-bootstrap .btn.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.rendered-form.formbuilder-embedded-bootstrap .btn.active,.rendered-form.formbuilder-embedded-bootstrap .btn.btn-active,.rendered-form.formbuilder-embedded-bootstrap .btn:active{background-image:none}.rendered-form.formbuilder-embedded-bootstrap .input-group .form-control:last-child,.rendered-form.formbuilder-embedded-bootstrap .input-group-addon:last-child,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:first-child>.btn:not(:first-child),.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:last-child>.btn,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:last-child>.btn-group>.btn,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.rendered-form.formbuilder-embedded-bootstrap .input-group .form-control,.rendered-form.formbuilder-embedded-bootstrap .input-group-addon,.rendered-form.formbuilder-embedded-bootstrap .input-group-btn{display:table-cell}.rendered-form.formbuilder-embedded-bootstrap .input-group-lg>.form-control,.rendered-form.formbuilder-embedded-bootstrap .input-group-lg>.input-group-addon,.rendered-form.formbuilder-embedded-bootstrap .input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333}.rendered-form.formbuilder-embedded-bootstrap .input-group{position:relative;display:table;border-collapse:separate}.rendered-form.formbuilder-embedded-bootstrap .input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.rendered-form.formbuilder-embedded-bootstrap .form-control,.rendered-form.formbuilder-embedded-bootstrap output{font-size:14px;line-height:1.42857143;display:block}.rendered-form.formbuilder-embedded-bootstrap textarea.form-control{height:auto}.rendered-form.formbuilder-embedded-bootstrap .form-control{height:34px;display:block;width:100%;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px}.rendered-form.formbuilder-embedded-bootstrap .form-control:focus{outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.rendered-form.formbuilder-embedded-bootstrap .form-group{margin-left:0px;margin-bottom:15px}.rendered-form.formbuilder-embedded-bootstrap .btn,.rendered-form.formbuilder-embedded-bootstrap .form-control{background-image:none}.rendered-form.formbuilder-embedded-bootstrap .pull-right{float:right}.rendered-form.formbuilder-embedded-bootstrap .pull-left{float:left}.rendered-form .formbuilder-required,.rendered-form .required-asterisk{color:#c10000}.rendered-form .formbuilder-checkbox-group input[type=checkbox],.rendered-form .formbuilder-checkbox-group input[type=radio],.rendered-form .formbuilder-radio-group input[type=checkbox],.rendered-form .formbuilder-radio-group input[type=radio]{margin:0 4px 0 0}.rendered-form .formbuilder-checkbox-inline,.rendered-form .formbuilder-radio-inline{margin-right:8px;display:inline-block;vertical-align:middle;padding-left:0}.rendered-form .formbuilder-checkbox-inline label input[type=text],.rendered-form .formbuilder-radio-inline label input[type=text]{margin-top:0}.rendered-form .formbuilder-checkbox-inline:first-child,.rendered-form .formbuilder-radio-inline:first-child{padding-left:0}.rendered-form .formbuilder-autocomplete-list{background-color:#fff;display:none;list-style:none;padding:0;border:1px solid #ccc;border-width:0 1px 1px;position:absolute;z-index:20;max-height:200px;overflow-y:auto}.rendered-form .formbuilder-autocomplete-list li{display:none;cursor:default;padding:5px;margin:0;transition:background-color 200ms ease-in-out}.rendered-form .formbuilder-autocomplete-list li:hover,.rendered-form .formbuilder-autocomplete-list li.active-option{background-color:rgba(0,0,0,.075)}.rendered-form *[tooltip]{position:relative}.rendered-form *[tooltip]:hover::after{background:rgba(0,0,0,.9);border-radius:5px 5px 5px 0;bottom:23px;color:#fff;content:attr(tooltip);padding:10px 5px;position:absolute;z-index:98;left:2px;width:230px;text-shadow:none;font-size:12px;line-height:1.5em;cursor:default}.rendered-form *[tooltip]:hover::before{border:solid;border-color:#222 rgba(0,0,0,0);border-width:6px 6px 0;bottom:17px;content:"";left:2px;position:absolute;z-index:99;cursor:default}.rendered-form .tooltip-element{visibility:visible;color:#fff;background:#000;width:16px;height:16px;border-radius:8px;display:inline-block;text-align:center;line-height:16px;margin:0 5px;font-size:12px;cursor:default}.rendered-form .kc-toggle{padding-left:0 !important}.rendered-form .kc-toggle span{position:relative;width:48px;height:24px;background:#e6e6e6;display:inline-block;border-radius:4px;border:1px solid #ccc;padding:2px;overflow:hidden;float:left;margin-right:5px;will-change:transform}.rendered-form .kc-toggle span::after,.rendered-form .kc-toggle span::before{position:absolute;display:inline-block;top:0}.rendered-form .kc-toggle span::after{position:relative;content:"";width:50%;height:100%;left:0;border-radius:3px;background:linear-gradient(to bottom, white 0%, #ccc 100%);border:1px solid #999;transition:transform 100ms;transform:translateX(0)}.rendered-form .kc-toggle span::before{border-radius:4px;top:2px;left:2px;content:"";width:calc(100% - 4px);height:18px;box-shadow:0 0 1px 1px #b3b3b3 inset;background-color:rgba(0,0,0,0)}.rendered-form .kc-toggle input{height:0;overflow:hidden;width:0;opacity:0;pointer-events:none;margin:0}.rendered-form .kc-toggle input:checked+span::after{transform:translateX(100%)}.rendered-form .kc-toggle input:checked+span::before{background-color:#6fc665}.rendered-form label{font-weight:normal}.rendered-form .form-group .formbuilder-required{color:#c10000}.rendered-form .other-option:checked+label input{display:inline-block}.rendered-form .other-val{margin-left:5px;display:none}.rendered-form .form-control.number{width:auto}.rendered-form .form-control[type=color]{width:60px;padding:2px;display:inline-block}.rendered-form .form-control[multiple]{height:auto}',""]),t.default=o},476:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r,n,o,i=e[1]||"",s=e[3];if(!s)return i;if(t&&"function"==typeof btoa){var a=(r=s,n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),"/*# ".concat(o," */")),l=s.sources.map((function(e){return"/*# sourceURL=".concat(s.sourceRoot||"").concat(e," */")}));return[i].concat(l).concat([a]).join("\n")}return[i].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var i=0;i=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){a.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){a.headers[e]=n.merge(i)})),e.exports=a}).call(this,r(12))},function(e,t,r){e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n0&&void 0!==arguments[0]?arguments[0]:s;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.langs=Object.create(null),this.loaded=[],this.processConfig(t)}return e.prototype.processConfig=function(e){var t=this,r=Object.assign({},s,e),n=r.location,o=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(r,["location"]),i=n.replace(/\/?$/,"/");this.config=Object.assign({},{location:i},o);var a=this.config,l=a.override,d=a.preloaded,c=void 0===d?{}:d,u=Object.entries(this.langs).concat(Object.entries(l||c));this.langs=u.reduce((function(e,r){var n=r[0],o=r[1];return e[n]=t.applyLanguage.call(t,n,o),e}),{}),this.locale=this.config.locale||this.config.langs[0]},e.prototype.init=function(e){return this.processConfig.call(this,Object.assign({},this.config,e)),this.setCurrent(this.locale)},e.prototype.addLanguage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t="string"==typeof t?this.processFile.call(this,t):t,this.applyLanguage.call(this,e,t),this.config.langs.push("locale")},e.prototype.getValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.locale;return this.langs[t]&&this.langs[t][e]||this.getFallbackValue(e)},e.prototype.getFallbackValue=function(e){var t=Object.values(this.langs).find((function(t){return t[e]}));return t&&t[e]},e.prototype.makeSafe=function(e){var t={"{":"\\{","}":"\\}","|":"\\|"};return e=e.replace(/\{|\}|\|/g,(function(e){return t[e]})),new RegExp(e,"g")},e.prototype.put=function(e,t){return this.current[e]=t},e.prototype.get=function(e,t){var r=this.getValue(e);if(r){var o=r.match(/\{[^}]+?\}/g),i=void 0;if(t&&o)if("object"===(void 0===t?"undefined":n(t)))for(var s=0;s1&&void 0!==arguments[1])||arguments[1],r=this;return new Promise((function(n,o){if(-1!==r.loaded.indexOf(e)&&t)return r.applyLanguage.call(r,r.langs[e]),n(r.langs[e]);var s=[r.config.location,e,r.config.extension].join("");return(0,i.get)(s).then((function(t){var o=t.data,i=r.processFile(o);return r.applyLanguage.call(r,e,i),r.loaded.push(e),n(r.langs[e])})).catch((function(){var t=r.applyLanguage.call(r,e);n(t)}))}))},e.prototype.applyLanguage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.config.override[e]||{},n=this.langs[e]||{};return this.langs[e]=Object.assign({},n,t,r),this.langs[e]},e.prototype.setCurrent=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US";return this.loadLang(t).then((function(){return e.locale=t,e.current=e.langs[t],e.current}))},o(e,[{key:"getLangs",get:function(){return this.config.langs}}]),e}();t.default=new a},function(e,t,r){e.exports=r(9)},function(e,t,r){var n=r(0),o=r(2),i=r(11),s=r(1);function a(e){var t=new i(e),r=o(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var l=a(s);l.Axios=i,l.create=function(e){return a(n.merge(s,e))},l.Cancel=r(6),l.CancelToken=r(26),l.isCancel=r(5),l.all=function(e){return Promise.all(e)},l.spread=r(27),e.exports=l,e.exports.default=l},function(e,t,r){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){var n=r(1),o=r(0),i=r(21),s=r(22);function a(e){this.defaults=e,this.interceptors={request:new i,response:new i}}a.prototype.request=function(e){"string"==typeof e&&(e=o.merge({url:arguments[0]},arguments[1])),(e=o.merge(n,{method:"get"},this.defaults,e)).method=e.method.toLowerCase();var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},o.forEach(["delete","get","head","options"],(function(e){a.prototype[e]=function(t,r){return this.request(o.merge(r||{},{method:e,url:t}))}})),o.forEach(["post","put","patch"],(function(e){a.prototype[e]=function(t,r,n){return this.request(o.merge(n||{},{method:e,url:t,data:r}))}})),e.exports=a},function(e,t,r){var n,o,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var d,c=[],u=!1,p=-1;function f(){u&&d&&(u=!1,d.length?c=d.concat(c):p=-1,c.length&&m())}function m(){if(!u){var e=l(f);u=!0;for(var t=c.length;t;){for(d=c,c=[];++p1)for(var r=1;r=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},function(e,t,r){var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){function n(){this.message="String contains an invalid character"}n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,r,o=String(e),i="",s=0,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.charAt(0|s)||(a="=",s%1);i+=a.charAt(63&t>>8-s%1*8)){if((r=o.charCodeAt(s+=.75))>255)throw new n;t=t<<8|r}return i}},function(e,t,r){var n=r(0);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){var n=r(0);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,r){var n=r(0),o=r(23),i=r(5),s=r(1),a=r(24),l=r(25);function d(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return d(e),e.baseURL&&!a(e.url)&&(e.url=l(e.baseURL,e.url)),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return d(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(d(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){var n=r(0);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},function(e,t,r){e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){var n=r(6);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){e.exports=function(e){return function(t){return e.apply(null,t)}}}])},34:function(e,t,r){var n=r(892),o=r(44);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);n(o,{attributes:{class:"formBuilder-injected-style"},insert:"head",singleton:!1}),e.exports=o.locals||{}},892:function(e,t,r){var n,o=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),i=[];function s(e){for(var t=-1,r=0;re}};var i;const s=(e,t)=>{if(0===o.backendOrder.length)return!1;const r=e.toLowerCase();return t=t?t+"":"",r.startsWith("on")||["form","formaction"].includes(r)||t.trim().toLowerCase().startsWith("javascript:")};o.backends.fallback=function(t){const r=document.implementation.createHTMLDocument(""),n=r.createElement("base");n.href=document.location.href,r.head.appendChild(n);const o=["applet","comment","embed","iframe","link","listing","meta","noscript","object","plaintext","script","style","xmp"],i=e.parseHTML(t,r,!1);e(i).find("*").addBack().each(((t,r)=>{"#text"!==r.nodeName&&(r.tagName&&o.includes(r.tagName.toLowerCase())?r.parentElement?r.parentElement.removeChild(r):i.includes(r)&&i.splice(i.indexOf(r),1):r.attributes&&Array.from(r.attributes).forEach((t=>{s(t.name,t.value)&&e(r).removeAttr(t.name)})))}));const a=r.createElement("div");return e(a).html(i),a.innerHTML};const a=e=>{const t=!!o.clobberingProtection.document&&document,r=!!o.clobberingProtection.form&&document.createElement("form");return t&&e in t||r&&e in r?o.clobberingProtection.namespaceAttributes?"user-content-"+e:void 0:e},l={fallback:(e,t)=>{const r=o.backends.fallback,n="function"==typeof r;return n&&(t=r(t)),e.innerHTML=t,n},dompurify:(e,t)=>{const r=o.backends.dompurify;return!(!1===r||!r.isSupported||(e.innerHTML=r.sanitize(t),0))},sanitizer:(e,t)=>{const r=o.backends.sanitizer;return!!r&&(e.setHTML(t,{sanitizer:r}),!0)}},d=["events"],c=["tag","content"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}window.fbLoaded={js:[],css:[]},window.fbEditors={quill:{},tinymce:{}};const m=function(e,t){if(void 0===t&&(t=!1),null==e||"object"!=typeof e)return e;const r="function"==typeof window.structuredClone?window.structuredClone(e):Object.assign({},e),n=[null,void 0,""];t&&n.push(!1);for(const e in r)n.includes(r[e])?delete r[e]:Array.isArray(r[e])&&(r[e].length||delete r[e]);return r},b=function(e){return!["values","enableOther","other","label","subtype"].includes(e)},h=(e,t)=>{let r;return e=g(e),t&&(Array.isArray(t)?r=S(t.join(" ")):("boolean"==typeof t&&(t=t.toString()),r=S(t.trim()))),{name:e,value:t=t?`="${r}"`:""}},g=e=>({className:"class"}[e]||y(e)),y=e=>(e=(e=e.replace(/[^\w\s\-]/gi,"")).replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))).replace(/\s/g,"-").replace(/^-+/g,""),v=e=>e.replace(/-([a-z])/g,((e,t)=>t.toUpperCase())),w=function(){let e,t=0;return function(r){const n=Date.now();return n===e?++t:(t=0,e=n),(r.type||y(r.label))+"-"+n+"-"+t}}(),x=e=>void 0===e?e:[["array",e=>Array.isArray(e)],["node",e=>e instanceof window.Node||e instanceof window.HTMLElement],["component",()=>e&&e.dom],[typeof e,()=>!0]].find((t=>t[1](e)))[0],O=function(t,r,n){void 0===r&&(r=""),void 0===n&&(n={});let i=x(r);const{events:u}=n,p=f(n,d),m=document.createElement(t),b={string:t=>{!function(t,r,n){if(void 0===n&&(n=!1),!n){const n=document.createElement(t.tagName);return void 0!==o.backendOrder.find((e=>l[e](n,r)))?((t=>{e(t).find("*").each(((e,t)=>{["embed","form","iframe","image","img","object"].includes(t.tagName.toLowerCase())&&t.removeAttribute("name"),["id","name"].forEach((e=>{if(t.hasAttribute(e)){const r=a(t.getAttribute(e));void 0===r?t.removeAttribute(e):t.setAttribute(e,r)}}))}))})(n),t.innerHTML=n.innerHTML,t):(t.innerHTML=r,t)}t.textContent=r}(m,m.innerHTML+t)},object:e=>{const{tag:t,content:r}=e,n=f(e,c);return m.appendChild(O(t,r,n))},node:e=>m.appendChild(e),array:e=>{for(let t=0;t{e=e(),i=x(e),b[i](e)},undefined:()=>{}};for(const e in p)if(p.hasOwnProperty(e)){const t=g(e);let r=Array.isArray(p[e])?T(p[e].join(" ").split(" ")).join(" "):p[e];if(s(t,r))continue;if("boolean"==typeof r){if(!0===r){const e="contenteditable"===t||t;m.setAttribute(t,e)}}else"id"!==t&&"name"!==t||(r=a(r)),void 0!==r&&m.setAttribute(t,r)}return r&&b[i](r),((e,t)=>{if(t)for(const r in t)t.hasOwnProperty(r)&&e.addEventListener(r,(e=>t[r](e)))})(m,u),m},q=e=>{const t=e.attributes,r={};return A(t,(e=>{let n=t[e].value||"";n.match(/false|true/g)?n="true"===n:n.match(/undefined/g)&&(n=void 0),n&&(r[v(t[e].name)]=n)})),r},j=e=>{const t=[];for(let r=0;r{const t=[];if(e.length){const r=e[0].getElementsByTagName("value");for(let e=0;e{const t=(new window.DOMParser).parseFromString(e,"text/xml"),r=[];if(t){const e=t.getElementsByTagName("field");for(let t=0;t{const t=document.createElement("textarea");return t.innerHTML=e,t.textContent},S=e=>{const t={'"':""","&":"&","<":"<",">":">"};return"string"==typeof e?e.replace(/["&<>]/g,(e=>t[e]||e)):e},A=function(e,t,r){for(let n=0;ne.filter(((e,t,r)=>r.indexOf(e)===t)),L=function(e,t){void 0===t&&(t="");const r=jQuery;let n=[];return Array.isArray(e)||(e=[e]),R(e)||(n=jQuery.map(e,(e=>{const r={dataType:"script",cache:!0,url:(t||"")+e};return jQuery.ajax(r).done((()=>window.fbLoaded.js.push(e)))}))),n.push(jQuery.Deferred((e=>r(e.resolve)))),jQuery.when(...n)},R=function(e,t){void 0===t&&(t="js");const r=window.fbLoaded[t];return Array.isArray(e)?e.every((e=>r.includes(e))):r.includes(e)},P=function(t,r){void 0===r&&(r=""),Array.isArray(t)||(t=[t]),t.forEach((t=>{let n="href",o=t,i="";if("object"==typeof t&&(n=t.type||(t.style?"inline":"href"),i=t.id,o=i||t.href||t.style,t="inline"===n?t.style:t.href),!R(o,"css")){if("href"===n){const e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=(r||"")+t,document.head.appendChild(e)}else e(``).attr("id",i).appendTo(e(document.head));window.fbLoaded.css.push(o)}}))},N=(e,t)=>{const r=Object.assign({},e,t);for(const n in t)r.hasOwnProperty(n)&&(Array.isArray(t[n])?r[n]=Array.isArray(e[n])?T(e[n].concat(t[n])):t[n]:"object"==typeof t[n]?r[n]=N(e[n],t[n]):r[n]=t[n]);return r},D=/^col-(xs|sm|md|lg)-([^\s]+)/,M={addEventListeners:(e,t,r)=>t.split(" ").forEach((t=>e.addEventListener(t,r,!1))),attrString:e=>Object.entries(e).map((e=>{let[t,r]=e;return b(t)&&Object.values(h(t,r)).join("")})).filter(Boolean).join(" "),camelCase:v,capitalize:e=>e.replace(/\b\w/g,(function(e){return e.toUpperCase()})),closest:(e,t)=>{const r=t.replace(".","");for(;(e=e.parentElement)&&!e.classList.contains(r););return e},getContentType:x,escapeAttr:S,escapeAttrs:e=>{for(const t in e)e.hasOwnProperty(t)&&(e[t]=S(e[t]));return e},escapeHtml:e=>{const t=document.createElement("textarea");return t.textContent=e,t.innerHTML},forceNumber:e=>e.replace(/[^0-9]/g,""),forEach:A,getScripts:L,getStyles:P,hyphenCase:y,isCached:R,markup:O,merge:N,mobileClass:()=>{let e="";var t;return t=navigator.userAgent||navigator.vendor||window.opera,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)&&(e="formbuilder-mobile"),e},nameAttr:w,parsedHtml:E,parseXML:C,removeFromArray:(e,t)=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)},safeAttr:h,safeAttrName:g,safename:e=>e.replace(/\s/g,"-").replace(/[^a-zA-Z0-9[\]_-]/g,""),subtract:(e,t)=>t.filter((function(e){return!~this.indexOf(e)}),e),trimObj:m,unique:T,validAttr:b,titleCase:function(e){const t=["a","an","and","as","at","but","by","for","for","from","in","into","near","nor","of","on","onto","or","the","to","with"].map((e=>`\\s${e}\\s`)),r=new RegExp(`(?!${t.join("|")})\\w\\S*`,"g");return`${e}`.replace(r,(e=>e.charAt(0).toUpperCase()+e.slice(1).replace(/[A-Z]/g,(e=>` ${e}`))))},splitObject:(e,t)=>{const r=e=>(t,r)=>(t[r]=e[r],t);return[Object.keys(e).filter((e=>t.includes(e))).reduce(r(e),{}),Object.keys(e).filter((e=>!t.includes(e))).reduce(r(e),{})]}};e.fn.swapWith=function(t){const r=this,n=e(t),o=e("");return r.before(o),n.before(r),o.before(n).remove(),r};var F=M;const z=function(e,t,r){void 0===r&&(r=!0);const n=[];let o=["none","block"];r&&(o=o.reverse());for(let r=e.length-1;r>=0;r--)-1!==e[r].textContent.toLowerCase().indexOf(t.toLowerCase())?(e[r].style.display=o[0],n.push(e[r])):e[r].style.display=o[1];return n};function B(e){let t;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event"),t.initEvent(e,!0,!0)),t}new RegExp(`(${["select","checkbox-group","checkbox","radio-group","autocomplete"].join("|")})`);var H={loaded:B("loaded"),viewData:B("viewData"),userDeclined:B("userDeclined"),modalClosed:B("modalClosed"),modalOpened:B("modalOpened"),formSaved:B("formSaved"),fieldAdded:B("fieldAdded"),fieldRemoved:B("fieldRemoved"),fieldRendered:B("fieldRendered"),fieldEditOpened:B("fieldEditOpened"),fieldEditClosed:B("fieldEditClosed")};const U=(e,t)=>{let r=e.id?`formbuilder-${e.type} form-group field-${e.id}`:"";if(e.className){const n=(e=>e.split(" ").filter((e=>D.test(e)||e.startsWith("row-"))))(e.className);n&&n.length>0&&(r+=` ${n.join(" ")}`),t.classList&&t.classList.remove(...n),Array.isArray(t)||(t=[t]),t.forEach((e=>e.querySelectorAll("[class*=row-],[class*=col-]").forEach((e=>{e.classList&&e.classList.remove(...n)}))))}return r};class ${constructor(e,t,r){var n,o;void 0===t&&(t=!1),void 0===r&&(r=!1),this.preview=null!==(n=t)&&void 0!==n&&n,this.disableHTMLLabels=null!==(o=r)&&void 0!==o&&o,this.templates={label:null,help:null,default:(e,t,r,n)=>(r&&t.appendChild(r),this.markup("div",[t,e],{className:U(n,e)})),noLabel:(e,t,r,n)=>this.markup("div",e,{className:U(n,e)}),hidden:e=>e},e&&(this.templates=jQuery.extend(this.templates,e)),this.configure()}configure(){}build(e,t,r){this.preview&&(t.name?t.name=t.name+"-preview":t.name=F.nameAttr(t)+"-preview"),t.id=t.name,this.data=jQuery.extend({},t);const n=new e(t,this.preview);let o=n.build();"object"==typeof o&&o.field||(o={field:o});const i=this.label(),s=this.help();let a;a=r&&this.isTemplate(r)?r:this.isTemplate(o.layout)?o.layout:"default";const l=this.processTemplate(a,o.field,i,s);return n.on("prerender")(l),l.addEventListener("fieldRendered",n.on("render")),l}label(){const e=this.data.label||"",t=[this.disableHTMLLabels?document.createTextNode(e):F.parsedHtml(e)];return this.data.required&&t.push(this.markup("span","*",{className:"formbuilder-required"})),this.isTemplate("label")?this.processTemplate("label",t):this.markup("label",t,{for:this.data.id,className:`formbuilder-${this.data.type}-label`})}help(){return this.data.description?this.isTemplate("help")?this.processTemplate("help",this.data.description):this.markup("span","?",{className:"tooltip-element",tooltip:this.data.description}):null}isTemplate(e){return"function"==typeof this.templates[e]}processTemplate(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n
e?t.indexOf(e+".")>-1:-1===t.indexOf("."))):t}static getRegisteredSubtypes(){const e={};for(const t in _.classRegister)if(_.classRegister.hasOwnProperty(t)){const[r,n]=t.split(".");if(!n)continue;e[r]||(e[r]=[]),e[r].push(n)}return e}static getClass(e,t){const r=t?e+"."+t:e;return _.classRegister[r]||_.classRegister[e]||_.error("Invalid control type. (Type: "+e+", Subtype: "+t+"). Please ensure you have registered it, and imported it correctly.")}static loadCustom(e){let t=[];if(e&&(t=t.concat(e)),window.fbControls&&(t=t.concat(window.fbControls)),!this.fbControlsLoaded){for(const e of t)e(_,_.classRegister);this.fbControlsLoaded=!0}}static mi18n(e,t){const n=this.definition;let o=n.i18n||{};o=o[r().locale]||o.default||o;const i=this.camelCase(e),s="object"==typeof o?o[i]||o[e]:o;if(s)return s;let a=n.mi18n;return"object"==typeof a&&(a=a[i]||a[e]),a||(a=i),r().get(a,t)}static active(e){return!Array.isArray(this.definition.inactive)||-1===this.definition.inactive.indexOf(e)}static label(e){return this.mi18n(e)}static icon(e){const t=this.definition;return t&&"object"==typeof t.icon?t.icon[e]:t.icon}configure(){}build(){const e=this.config,{label:t,type:r}=e,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,I);return this.markup(r,E(t),n)}on(e){const t={prerender:e=>e,render:e=>{const t=()=>{this.onRender&&this.onRender(e)};this.css&&P(this.css),this.js&&!R(this.js)?L(this.js).done(t):t()}};return e?t[e]:t}static error(e){throw new Error(e)}markup(e,t,r){return void 0===t&&(t=""),void 0===r&&(r={}),this.element=O(e,t,r),this.element}parsedHtml(e){return E(e)}static camelCase(e){return v(e)}}const V=["values","type"];_.register("autocomplete",class extends _{static get definition(){return{mi18n:{requireValidOption:"requireValidOption"}}}build(){const e=this.config,{values:t,type:r}=e,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,V),o=e=>{const t=e.target.nextSibling.nextSibling,r=e.target.nextSibling,n=this.getActiveOption(t);let o=new Map([[38,()=>{const e=this.getPreviousOption(n);e&&this.selectOption(t,e)}],[40,()=>{const e=this.getNextOption(n);e&&this.selectOption(t,e)}],[13,()=>{n?(e.target.value=n.innerHTML,r.value=n.getAttribute("value"),"none"===t.style.display?this.showList(t,n):this.hideList(t)):this.config.requireValidOption&&(this.isOptionValid(t,e.target.value)||(e.target.value="",e.target.nextSibling.value="")),e.preventDefault()}],[27,()=>{this.hideList(t)}]]).get(e.keyCode);return o||(o=()=>!1),o()},i={focus:e=>{const t=e.target.nextSibling.nextSibling,r=z(t.querySelectorAll("li"),e.target.value);if(e.target.addEventListener("keydown",o),e.target.value.length>0){const e=r.length>0?r[r.length-1]:null;this.showList(t,e)}},blur:e=>{e.target.removeEventListener("keydown",o);const t=setTimeout((()=>{e.target.nextSibling.nextSibling.style.display="none",clearTimeout(t)}),200);if(this.config.requireValidOption){const t=e.target.nextSibling.nextSibling;this.isOptionValid(t,e.target.value)||(e.target.value="",e.target.nextSibling.value="")}},input:e=>{const t=e.target.nextSibling.nextSibling;e.target.nextSibling.value=e.target.value;const r=z(t.querySelectorAll("li"),e.target.value);if(0==r.length)this.hideList(t);else{let e=this.getActiveOption(t);e||(e=r[r.length-1]),this.showList(t,e)}}},s=Object.assign({},n,{id:`${n.id}-input`,autocomplete:"off",events:i}),a=Object.assign({},n,{type:"hidden"});delete s.name;const l=[this.markup("input",null,s),this.markup("input",null,a)],d=t.map((e=>{const t=e.label,r={events:{click:t=>{const r=t.target.parentElement,n=r.previousSibling.previousSibling;n.value=e.label,n.nextSibling.value=e.value,this.hideList(r)}},value:e.value};return this.markup("li",t,r)}));return l.push(this.markup("ul",d,{id:`${n.id}-list`,className:`formbuilder-${r}-list`})),l}hideList(e){this.selectOption(e,null),e.style.display="none"}showList(e,t){this.selectOption(e,t),e.style.display="block",e.style.width=e.parentElement.offsetWidth+"px"}getActiveOption(e){const t=e.getElementsByClassName("active-option")[0];return t&&"none"!==t.style.display?t:null}getPreviousOption(e){let t=e;do{t=t?t.previousSibling:null}while(null!=t&&"none"===t.style.display);return t}getNextOption(e){let t=e;do{t=t?t.nextSibling:null}while(null!=t&&"none"===t.style.display);return t}selectOption(e,t){const r=e.querySelectorAll("li");for(let e=0;e=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,W);let n=t;const o={paragraph:"p",header:this.subtype};return o[t]&&(n=o[t]),{field:this.markup(n,F.parsedHtml(this.label),r),layout:"noLabel"}}}_.register(["paragraph","header"],J),_.register(["p","address","blockquote","canvas","output"],J,"paragraph"),_.register(["h1","h2","h3","h4","h5","h6"],J,"header");const G=["values","value","placeholder","type","inline","other","toggle"],Z=["label"];function K(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}_.register(["select","checkbox-group","radio-group","checkbox"],class extends _{static get definition(){return{inactive:["checkbox"],mi18n:{minSelectionRequired:"minSelectionRequired"}}}build(){const e=[],t=this.config,{values:r,value:n,placeholder:o,type:i,inline:s,other:a,toggle:l}=t,d=K(t,G),c=i.replace("-group",""),u="select"===i;if((d.multiple||"checkbox-group"===i)&&(d.name=d.name+"[]"),"checkbox-group"===i&&d.required){const e=this,t=this.onRender.bind(this);this.onRender=function(){t(),e.groupRequired()}}if(delete d.title,r){o&&u&&e.push(this.markup("option",o,{disabled:null,selected:null}));for(let t=0;t{const t=e.target;t.parentElement.previousElementSibling.value=t.value}},id:`${t.id}-value`,className:"other-val"},i=this.markup("input",null,n),a=[document.createTextNode(_.mi18n("other")),this.markup("input",null,o)],l=this.markup("label",a,{for:n.id}),u=this.markup("div",[i,l],{className:r});e.push(u)}}return this.dom="select"==i?this.markup(c,e,m(d,!0)):this.markup("div",e,{className:i}),this.dom}groupRequired(){const e=this.element.getElementsByTagName("input"),t=()=>{const t=[].some.call(e,(e=>e.checked));((e,t)=>{[].forEach.call(e,(e=>{t?e.removeAttribute("required"):e.setAttribute("required","required"),((e,t)=>{const r=_.mi18n("minSelectionRequired",1);t?e.setCustomValidity(""):e.setCustomValidity(r)})(e,t)}))})(e,t)};for(let r=e.length-1;r>=0;r--)e[r].addEventListener("change",t);t()}onRender(){if(this.config.userData){const t=this.config.userData.slice();"select"===this.config.type?e(this.dom).val(t).prop("selected",!0):this.config.type.endsWith("-group")&&("checkbox-group"===this.config.type&&this.dom.querySelectorAll("input[type=checkbox]").forEach((e=>{e.removeAttribute("checked")})),this.dom.querySelectorAll("input").forEach((e=>{if(!e.classList.contains("other-val")){for(let r=0;rdelete this.classConfig[e]));const t=this.classConfig.template||'\n \n
\n
\n \n
\n
\n
\n Processing dropped files...\n \n \n
\n - \n \n \n \n
\n
\n
\n \n \n \n
\n \n \n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
';this.fineTemplate=e("").attr("id","qq-template").html(t)}build(){return this.input=this.markup("input",null,{type:"hidden",name:this.config.name,id:this.config.name}),this.wrapper=this.markup("div","",{id:this.config.name+"-wrapper"}),[this.input,this.wrapper]}onRender(){const t=e(this.wrapper),r=e(this.input),n=jQuery.extend(!0,{request:{endpoint:this.handler},deleteFile:{enabled:!0,endpoint:this.handler},chunking:{enabled:!0,concurrent:{enabled:!0},success:{endpoint:this.handler+(-1==this.handler.indexOf("?")?"?":"&")+"done"}},resume:{enabled:!0},retry:{enableAuto:!0,showButton:!0},callbacks:{onError:(r,n,o)=>{"."!=o.slice(-1)&&(o+=".");const i=e("").addClass("qq-error-message").html(`Error processing upload: ${n}.
Reason: ${o}`).prependTo(t.find(".qq-uploader")),s=window.setTimeout((()=>{i.fadeOut((()=>{i.remove(),window.clearTimeout(s)}))}),6e3);return r},onStatusChange:(e,n,o)=>{const i=t.fineUploader("getUploads"),s=[];for(const e of i)"upload successful"==e.status&&s.push(e.name);return r.val(s.join(", ")),{id:e,oldStatus:n,newStatus:o}}},template:this.fineTemplate},this.classConfig);t.fineUploader(n)}},"file");const ee=["value"];class te extends _{static get definition(){return{mi18n:{textarea:"textArea"}}}build(){const e=this.config,{value:t=""}=e,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,ee);return delete r.type,this.field=this.markup("textarea",this.parsedHtml(t),r),this.field}onRender(){this.config.userData&&e(this.field).val(this.config.userData[0])}on(t){return"prerender"==t&&this.preview?t=>{this.field&&(t=this.field),e(t).on("mousedown",(e=>{e.stopPropagation()}))}:super.on(t)}}_.register("textarea",te),_.register("textarea",te,"textarea");const re=["value"];te.register("tinymce",class extends te{configure(){if(this.js=[],window.tinymce||this.js.push("https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js"),this.classConfig.js){let e=this.classConfig.js;Array.isArray(e)||(e=new Array(e)),this.js=this.js.concat(e),delete this.classConfig.js}this.classConfig.css&&(this.css=this.classConfig.css),this.editorOptions={height:250,paste_data_images:!0,plugins:["advlist","autolink","lists","link","image","charmap","print","preview","anchor","searchreplace","visualblocks","code","fullscreen","insertdatetime","media","table","contextmenu","paste","code"],toolbar:"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | table"}}build(){const e=this.config,{value:t=""}=e,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,re);return delete r.type,this.field=this.markup("textarea",this.parsedHtml(t),r),r.disabled&&(this.editorOptions.readonly=!0),this.field}onRender(){const e=window.tinymce.get(this.id);e&&window.tinymce.remove(e);const t=jQuery.extend(this.editorOptions,this.classConfig);t.target=this.field;const r=[];Number(window.tinymce.majorVersion)>=5&&r.push("contextmenu"),Number(window.tinymce.majorVersion)>=6&&r.push("paste","print"),t.plugins=t.plugins.filter((e=>-1===r.indexOf(e)));const n=this.config.userData?this.parsedHtml(this.config.userData[0]):void 0,o=window.lastFormBuilderCopiedTinyMCE?this.parsedHtml(window.lastFormBuilderCopiedTinyMCE):void 0;window.lastFormBuilderCopiedTinyMCE=null;const i=function(e){o?e.setContent(o):n&&e.setContent(n)};setTimeout((()=>{window.tinymce.init(t).then(i)}),0)}},"textarea");const ne=["value"];function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ie(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,ne);return delete r.type,this.field=this.markup("div",null,r),this.field}onRender(e){const t=this.config.value||"",r=window.Quill.import("delta");window.fbEditors.quill[this.id]={};const n=window.fbEditors.quill[this.id];return n.instance=new window.Quill(this.field,this.editorConfig),n.data=new r,t&&n.instance.setContents(window.JSON.parse(this.parsedHtml(t))),n.instance.on("text-change",(function(e){n.data=n.data.compose(e)})),e}},"textarea"),r().addLanguage("en-US",{NATIVE_NAME:"English (US)",ENGLISH_NAME:"English",addOption:"Add Option +",allFieldsRemoved:"All fields were removed.",allowMultipleFiles:"Allow users to upload multiple files",autocomplete:"Autocomplete",button:"Button",cannotBeEmpty:"This field cannot be empty",checkboxGroup:"Checkbox Group",checkbox:"Checkbox",checkboxes:"Checkboxes",className:"Class",clearAllMessage:"Are you sure you want to clear all fields?",clear:"Clear",close:"Close",content:"Content",copy:"Copy To Clipboard",copyButton:"+",copyButtonTooltip:"Copy",dateField:"Date Field",description:"Help Text",descriptionField:"Description",devMode:"Developer Mode",editNames:"Edit Names",editorTitle:"Form Elements",editXML:"Edit XML",enableOther:"Enable "Other"",enableOtherMsg:"Let users enter an unlisted option",fieldDeleteWarning:"false",fieldVars:"Field Variables",fieldNonEditable:"This field cannot be edited.",fieldRemoveWarning:"Are you sure you want to remove this field?",fileUpload:"File Upload",formUpdated:"Form Updated",getStarted:"Drag a field from the right to this area",header:"Header",hide:"Edit",hidden:"Hidden Input",inline:"Inline",inlineDesc:"Display {type} inline",label:"Label",labelEmpty:"Field Label cannot be empty",limitRole:"Limit access to one or more of the following roles:",mandatory:"Mandatory",maxlength:"Max Length",minOptionMessage:"This field requires a minimum of 2 options",minSelectionRequired:"Minimum {min} selections required",multipleFiles:"Multiple Files",name:"Name",no:"No",noFieldsToClear:"There are no fields to clear",number:"Number",off:"Off",on:"On",option:"Option",optionCount:"Option {count}",options:"Options",optional:"optional",optionLabelPlaceholder:"Label",optionValuePlaceholder:"Value",optionEmpty:"Option value required",other:"Other",paragraph:"Paragraph",placeholder:"Placeholder","placeholders.value":"Value","placeholders.label":"Label","placeholders.email":"Enter your email","placeholders.className":"space separated classes","placeholders.password":"Enter your password",preview:"Preview",radioGroup:"Radio Group",radio:"Radio",removeMessage:"Remove Element",removeOption:"Remove Option",remove:"×",required:"Required",requireValidOption:"Only accept a pre-defined Option",richText:"Rich Text Editor",roles:"Access",rows:"Rows",save:"Save",selectOptions:"Options",select:"Select",selectColor:"Select Color",selectionsMessage:"Allow Multiple Selections",size:"Size","size.xs":"Extra Small","size.sm":"Small","size.m":"Default","size.lg":"Large",style:"Style","styles.btn.default":"Default","styles.btn.danger":"Danger","styles.btn.info":"Info","styles.btn.primary":"Primary","styles.btn.success":"Success","styles.btn.warning":"Warning",subtype:"Type",text:"Text Field",textArea:"Text Area",toggle:"Toggle",warning:"Warning!",value:"Value",viewJSON:"[{…}]",viewXML:"</>",yes:"Yes"});const se={location:"assets/lang/"};n(34);class ae{constructor(e){void 0===e&&(e={});const t={layout:$,layoutTemplates:{},controls:{},controlConfig:{},container:!1,dataType:"json",disableHTMLLabels:!1,formData:!1,i18n:Object.assign({},se),messages:{formRendered:"Form Rendered",noFormData:"No form data.",other:"Other",selectColor:"Select Color",invalidControl:"Invalid control"},onRender:()=>{},render:!0,sanitizerOptions:{clobberingProtection:{document:!0,form:!1,namespaceAttributes:!0},backendOrder:["dompurify","sanitizer","fallback"]},templates:{},notify:{error:e=>{console.log(e)},success:e=>{console.log(e)},warning:e=>{console.warn(e)}}};if(this.options=jQuery.extend(!0,t,e),this.instanceContainers=[],(e=>{if("object"!=typeof e)throw"Invalid value given to setSanitizerConfig, expected config object";if(e.hasOwnProperty("clobberingProtection")&&["document","form","namespaceAttributes"].forEach((t=>{e.clobberingProtection.hasOwnProperty(t)&&"boolean"==typeof e.clobberingProtection[t]&&(o.clobberingProtection[t]=e.clobberingProtection[t])})),e.hasOwnProperty("backends")){if("object"!=typeof e.backends)throw"backends config expected to be an Object";Object.keys(e.backends).forEach((t=>o.backends[t]=e.backends[t]))}if(e.hasOwnProperty("backendOrder")){if(o.backendOrder=[],!Array.isArray(e.backendOrder))throw"backendOrder config expected to be an Array of backend keys as strings";e.backendOrder.forEach((e=>{if(!o.backends.hasOwnProperty(e))throw"unknown sanitizer backend "+e;o.backendOrder.push(e)}))}})(this.options.sanitizerOptions),r().current||r().init(this.options.i18n),!this.options.formData)return!1;this.options.formData=this.parseFormData(this.options.formData),_.controlConfig=e.controlConfig||{},_.loadCustom(e.controls),Object.keys(this.options.templates).length&&X.register(this.options.templates),"function"!=typeof Element.prototype.appendFormFields&&(Element.prototype.appendFormFields=function(e){Array.isArray(e)||(e=[e]);const t=F.markup("div",e,{className:"rendered-form formbuilder-embedded-bootstrap"});this.appendChild(t),e.forEach((e=>{const[r]=e.className.match(/row-([^\s]+)/)||[];if(r){const n=this.id?`${this.id}-row-${r}`:`row-${r}`;let o=document.getElementById(n);o||(o=F.markup("div",null,{id:n,className:"row"}),t.appendChild(o)),o.appendChild(e)}else t.appendChild(e);e.dispatchEvent(H.fieldRendered)}))}),"function"!=typeof Element.prototype.emptyContainer&&(Element.prototype.emptyContainer=function(){const e=this;for(;e.lastChild;)e.removeChild(e.lastChild)})}sanitizeField(e,t){const r=Object.assign({},e);return t&&(r.id=e.id&&`${e.id}-${t}`,r.name=e.name&&`${e.name}-${t}`),r.className=Array.isArray(e.className)?F.unique(e.className.join(" ").split(" ")).join(" "):e.className||e.class||null,delete r.class,e.values&&(e.values=e.values.map((e=>F.trimObj(e)))),F.trimObj(r)}getElement(e){return(e=this.options.container||e)instanceof jQuery?e=e[0]:"string"==typeof e&&(e=document.querySelector(e)),e}render(e,t){void 0===e&&(e=null),void 0===t&&(t=0);const r=this,n=this.options;e=this.getElement(e);const o=[];if(n.formData){const i=new n.layout(n.layoutTemplates,!1,n.disableHTMLLabels);for(let e=0;ee.map((e=>e.innerHTML)).join("");r.markup=e(o)}}else{const e=F.markup("div",n.messages.noFormData,{className:"no-form-data"});o.push(e),n.notify.error(n.messages.noFormData)}if(!0===n.disableInjectedStyle){const e=document.getElementsByClassName("formBuilder-injected-style");A(e,(t=>(e=>{e.parentNode&&e.parentNode.removeChild(e)})(e[t])))}else"bootstrap"===n.disableInjectedStyle&&n.render&&e&&e.getElementsByClassName("formbuilder-embedded-bootstrap").item(0)?.classList.remove("formbuilder-embedded-bootstrap");return r}renderControl(e){void 0===e&&(e=null);const t=this.options,r=t.formData;if(!r||Array.isArray(r))throw new Error("To render a single element, please specify a single object of formData for the field in question");const n=this.sanitizeField(r),o=new t.layout,i=_.getClass(r.type,r.subtype),s=t.forceTemplate||"hidden",a=o.build(i,n,s);return e.appendFormFields(a),t.notify.success(t.messages.formRendered),this}get userData(){const t=this.options.formData.slice();return t.filter((e=>"tinymce"===e.subtype)).forEach((e=>window.tinymce.get(e.name).save())),this.instanceContainers.forEach((r=>{const n=e("select, input, textarea",r).serializeArray().reduce(((e,t)=>{let{name:r,value:n}=t;return r=r.replace("[]",""),e[r]?e[r].push(n):e[r]=[n],e}),{}),o=t.length;for(let e=0;e{this.options.formData.slice().filter((e=>"tinymce"===e.subtype)).forEach((e=>window.tinymce.get(e.name).setContent(""))),e.querySelectorAll("input, select, textarea").forEach((e=>{["checkbox","radio"].includes(e.type)?e.checked=!1:e.value=""}))}))}parseFormData(e){const t={xml:e=>C(e),json:e=>window.JSON.parse(e)};return"object"!=typeof e&&(e=t[this.options.dataType](e)||!1),e}}!function(e){let t;const r={init:function(e,n){return void 0===n&&(n={}),t=e,r.instance=new ae(n),e.each((t=>r.instance.render(e[t],t))),r.instance},userData:()=>r.instance&&r.instance.userData,clear:()=>r.instance&&r.instance.clear(),setData:e=>{if(r.instance){const t=r.instance;t.options.formData=t.parseFormData(e)}},render:function(e,n){if(void 0===n&&(n={}),r.instance){const o=r.instance;e||(e=o.options.formData),o.options=Object.assign({},o.options,n,{formData:o.parseFormData(e)}),t.each((e=>r.instance.render(t[e],e)))}},html:()=>t.map((e=>t[e])).html()};e.fn.formRender=function(e){if(void 0===e&&(e={}),r[e]){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;or.renderControl(n[e]))),n}}(jQuery)}()}()}(jQuery);
\ No newline at end of file
diff --git a/assets/js/form-render.min.js.gz b/assets/js/form-render.min.js.gz
index 7529c096b..cfe0773fb 100644
Binary files a/assets/js/form-render.min.js.gz and b/assets/js/form-render.min.js.gz differ