/*!

 * jQuery Validation Plugin v1.19.0

 *

 * https://jqueryvalidation.org/

 *

 * Copyright (c) 2018 Jörn Zaefferer

 * Released under the MIT license

 */
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(d){d.extend(d.fn,{validate:function(t){var s;if(this.length)return(s=d.data(this[0],"validator"))||(this.attr("novalidate","novalidate"),s=new d.validator(t,this[0]),d.data(this[0],"validator",s),s.settings.onsubmit&&(this.on("click.validate",":submit",function(t){s.submitButton=t.currentTarget,d(this).hasClass("cancel")&&(s.cancelSubmit=!0),void 0!==d(this).attr("formnovalidate")&&(s.cancelSubmit=!0)}),this.on("submit.validate",function(i){function t(){var t,e;return s.submitButton&&(s.settings.submitHandler||s.formSubmitted)&&(t=d("<input type='hidden'/>").attr("name",s.submitButton.name).val(d(s.submitButton).val()).appendTo(s.currentForm)),!(s.settings.submitHandler&&!s.settings.debug)||(e=s.settings.submitHandler.call(s,s.currentForm,i),t&&t.remove(),void 0!==e&&e)}return s.settings.debug&&i.preventDefault(),s.cancelSubmit?(s.cancelSubmit=!1,t()):s.form()?s.pendingRequest?!(s.formSubmitted=!0):t():(s.focusInvalid(),!1)}))),s;t&&t.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing.")},valid:function(){var t,e,i;return d(this[0]).is("form")?t=this.validate().form():(i=[],t=!0,e=d(this[0].form).validate(),this.each(function(){(t=e.element(this)&&t)||(i=i.concat(e.errorList))}),e.errorList=i),t},rules:function(t,e){var i,s,n,r,a,o=this[0],l=void 0!==this.attr("contenteditable")&&"false"!==this.attr("contenteditable");if(null!=o&&(!o.form&&l&&(o.form=this.closest("form")[0],o.name=this.attr("name")),null!=o.form)){if(t)switch(s=(i=d.data(o.form,"validator").settings).rules,n=d.validator.staticRules(o),t){case"add":d.extend(n,d.validator.normalizeRule(e)),delete n.messages,s[o.name]=n,e.messages&&(i.messages[o.name]=d.extend(i.messages[o.name],e.messages));break;case"remove":return e?(a={},d.each(e.split(/\s/),function(t,e){a[e]=n[e],delete n[e]}),a):(delete s[o.name],n)}return(l=d.validator.normalizeRules(d.extend({},d.validator.classRules(o),d.validator.attributeRules(o),d.validator.dataRules(o),d.validator.staticRules(o)),o)).required&&(r=l.required,delete l.required,l=d.extend({required:r},l)),l.remote&&(r=l.remote,delete l.remote,l=d.extend(l,{remote:r})),l}}}),d.extend(d.expr.pseudos||d.expr[":"],{blank:function(t){return!d.trim(""+d(t).val())},filled:function(t){t=d(t).val();return null!==t&&!!d.trim(""+t)},unchecked:function(t){return!d(t).prop("checked")}}),d.validator=function(t,e){this.settings=d.extend(!0,{},d.validator.defaults,t),this.currentForm=e,this.init()},d.validator.format=function(i,t){return 1===arguments.length?function(){var t=d.makeArray(arguments);return t.unshift(i),d.validator.format.apply(this,t)}:(void 0!==t&&((t=2<arguments.length&&t.constructor!==Array?d.makeArray(arguments).slice(1):t).constructor!==Array&&(t=[t]),d.each(t,function(t,e){i=i.replace(new RegExp("\\{"+t+"\\}","g"),function(){return e})})),i)},d.extend(d.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:d([]),errorLabelContainer:d([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(t){this.lastActive=t,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,t,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(t)))},onfocusout:function(t){this.checkable(t)||!(t.name in this.submitted)&&this.optional(t)||this.element(t)},onkeyup:function(t,e){9===e.which&&""===this.elementValue(t)||-1!==d.inArray(e.keyCode,[16,17,18,20,35,36,37,38,39,40,45,144,225])||(t.name in this.submitted||t.name in this.invalid)&&this.element(t)},onclick:function(t){t.name in this.submitted?this.element(t):t.parentNode.name in this.submitted&&this.element(t.parentNode)},highlight:function(t,e,i){("radio"===t.type?this.findByName(t.name):d(t)).addClass(e).removeClass(i)},unhighlight:function(t,e,i){("radio"===t.type?this.findByName(t.name):d(t)).removeClass(e).addClass(i)}},setDefaults:function(t){d.extend(d.validator.defaults,t)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:d.validator.format("Please enter no more than {0} characters."),minlength:d.validator.format("Please enter at least {0} characters."),rangelength:d.validator.format("Please enter a value between {0} and {1} characters long."),range:d.validator.format("Please enter a value between {0} and {1}."),max:d.validator.format("Please enter a value less than or equal to {0}."),min:d.validator.format("Please enter a value greater than or equal to {0}."),step:d.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){this.labelContainer=d(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||d(this.currentForm),this.containers=d(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var i,n=this.currentForm,s=this.groups={};function t(t){var e,i,s=void 0!==d(this).attr("contenteditable")&&"false"!==d(this).attr("contenteditable");!this.form&&s&&(this.form=d(this).closest("form")[0],this.name=d(this).attr("name")),n===this.form&&(s=d.data(this.form,"validator"),e="on"+t.type.replace(/^validate/,""),(i=s.settings)[e])&&!d(this).is(i.ignore)&&i[e].call(s,this,t)}d.each(this.settings.groups,function(i,t){"string"==typeof t&&(t=t.split(/\s/)),d.each(t,function(t,e){s[e]=i})}),i=this.settings.rules,d.each(i,function(t,e){i[t]=d.validator.normalizeRule(e)}),d(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",t).on("click.validate","select, option, [type='radio'], [type='checkbox']",t),this.settings.invalidHandler&&d(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),d.extend(this.submitted,this.errorMap),this.invalid=d.extend({},this.errorMap),this.valid()||d(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var t=0,e=this.currentElements=this.elements();e[t];t++)this.check(e[t]);return this.valid()},element:function(t){var e,i,s=this.clean(t),n=this.validationTargetFor(s),r=this,a=!0;return void 0===n?delete this.invalid[s.name]:(this.prepareElement(n),this.currentElements=d(n),(i=this.groups[n.name])&&d.each(this.groups,function(t,e){e===i&&t!==n.name&&(s=r.validationTargetFor(r.clean(r.findByName(t))))&&s.name in r.invalid&&(r.currentElements.push(s),a=r.check(s)&&a)}),e=!1!==this.check(n),a=a&&e,this.invalid[n.name]=!e,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),d(t).attr("aria-invalid",!e)),a},showErrors:function(e){var i;e&&(d.extend((i=this).errorMap,e),this.errorList=d.map(this.errorMap,function(t,e){return{message:t,element:i.findByName(e)[0]}}),this.successList=d.grep(this.successList,function(t){return!(t.name in e)})),this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){d.fn.resetForm&&d(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var t=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(t)},resetElements:function(t){var e;if(this.settings.unhighlight)for(e=0;t[e];e++)this.settings.unhighlight.call(this,t[e],this.settings.errorClass,""),this.findByName(t[e].name).removeClass(this.settings.validClass);else t.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(t){var e,i=0;for(e in t)void 0!==t[e]&&null!==t[e]&&!1!==t[e]&&i++;return i},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(t){t.not(this.containers).text(""),this.addWrapper(t).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{d(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var e=this.lastActive;return e&&1===d.grep(this.errorList,function(t){return t.element.name===e.name}).length&&e},elements:function(){var i=this,s={};return d(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var t=this.name||d(this).attr("name"),e=void 0!==d(this).attr("contenteditable")&&"false"!==d(this).attr("contenteditable");return!t&&i.settings.debug&&window.console&&console.error("%o has no name assigned",this),e&&(this.form=d(this).closest("form")[0],this.name=t),this.form===i.currentForm&&!(t in s||!i.objectLength(d(this).rules()))&&(s[t]=!0)})},clean:function(t){return d(t)[0]},errors:function(){var t=this.settings.errorClass.split(" ").join(".");return d(this.settings.errorElement+"."+t,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=d([]),this.toHide=d([])},reset:function(){this.resetInternals(),this.currentElements=d([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(t){this.reset(),this.toHide=this.errorsFor(t)},elementValue:function(t){var e=d(t),i=t.type,s=void 0!==e.attr("contenteditable")&&"false"!==e.attr("contenteditable");return"radio"===i||"checkbox"===i?this.findByName(t.name).filter(":checked").val():"number"===i&&void 0!==t.validity?t.validity.badInput?"NaN":e.val():(t=s?e.text():e.val(),"file"===i?"C:\\fakepath\\"===t.substr(0,12)?t.substr(12):0<=(s=t.lastIndexOf("/"))||0<=(s=t.lastIndexOf("\\"))?t.substr(s+1):t:"string"==typeof t?t.replace(/\r/g,""):t)},check:function(e){e=this.validationTargetFor(this.clean(e));var t,i,s,n,r=d(e).rules(),a=d.map(r,function(t,e){return e}).length,o=!1,l=this.elementValue(e);for(i in"function"==typeof r.normalizer?n=r.normalizer:"function"==typeof this.settings.normalizer&&(n=this.settings.normalizer),n&&(l=n.call(e,l),delete r.normalizer),r){s={method:i,parameters:r[i]};try{if("dependency-mismatch"===(t=d.validator.methods[i].call(this,l,e,s.parameters))&&1===a)o=!0;else{if(o=!1,"pending"===t)return void(this.toHide=this.toHide.not(this.errorsFor(e)));if(!t)return this.formatAndAdd(e,s),!1}}catch(t){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+e.id+", check the '"+s.method+"' method.",t),t instanceof TypeError&&(t.message+=".  Exception occurred when checking element "+e.id+", check the '"+s.method+"' method."),t}}if(!o)return this.objectLength(r)&&this.successList.push(e),!0},customDataMessage:function(t,e){return d(t).data("msg"+e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())||d(t).data("msg")},customMessage:function(t,e){t=this.settings.messages[t];return t&&(t.constructor===String?t:t[e])},findDefined:function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]},defaultMessage:function(t,e){var i=this.findDefined(this.customMessage(t.name,(e="string"==typeof e?{method:e}:e).method),this.customDataMessage(t,e.method),!this.settings.ignoreTitle&&t.title||void 0,d.validator.messages[e.method],"<strong>Warning: No message defined for "+t.name+"</strong>"),s=/\$?\{(\d+)\}/g;return"function"==typeof i?i=i.call(this,e.parameters,t):s.test(i)&&(i=d.validator.format(i.replace(s,"{$1}"),e.parameters)),i},formatAndAdd:function(t,e){var i=this.defaultMessage(t,e);this.errorList.push({message:i,element:t,method:e.method}),this.errorMap[t.name]=i,this.submitted[t.name]=i},addWrapper:function(t){return t=this.settings.wrapper?t.add(t.parent(this.settings.wrapper)):t},defaultShowErrors:function(){for(var t,e,i=0;this.errorList[i];i++)e=this.errorList[i],this.settings.highlight&&this.settings.highlight.call(this,e.element,this.settings.errorClass,this.settings.validClass),this.showLabel(e.element,e.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(i=0;this.successList[i];i++)this.showLabel(this.successList[i]);if(this.settings.unhighlight)for(i=0,t=this.validElements();t[i];i++)this.settings.unhighlight.call(this,t[i],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return d(this.errorList).map(function(){return this.element})},showLabel:function(t,e){var i,s,n,r=this.errorsFor(t),a=this.idOrName(t),o=d(t).attr("aria-describedby");r.length?(r.removeClass(this.settings.validClass).addClass(this.settings.errorClass),r.html(e)):(s=r=d("<"+this.settings.errorElement+">").attr("id",a+"-error").addClass(this.settings.errorClass).html(e||""),this.settings.wrapper&&(s=r.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(s):this.settings.errorPlacement?this.settings.errorPlacement.call(this,s,d(t)):s.insertAfter(t),r.is("label")?r.attr("for",a):0===r.parents("label[for='"+this.escapeCssMeta(a)+"']").length&&(s=r.attr("id"),o?o.match(new RegExp("\\b"+this.escapeCssMeta(s)+"\\b"))||(o+=" "+s):o=s,d(t).attr("aria-describedby",o),i=this.groups[t.name])&&d.each((n=this).groups,function(t,e){e===i&&d("[name='"+n.escapeCssMeta(t)+"']",n.currentForm).attr("aria-describedby",r.attr("id"))})),!e&&this.settings.success&&(r.text(""),"string"==typeof this.settings.success?r.addClass(this.settings.success):this.settings.success(r,t)),this.toShow=this.toShow.add(r)},errorsFor:function(t){var e=this.escapeCssMeta(this.idOrName(t)),t=d(t).attr("aria-describedby"),e="label[for='"+e+"'], label[for='"+e+"'] *";return t&&(e=e+", #"+this.escapeCssMeta(t).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(t){return t.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(t){return this.groups[t.name]||!this.checkable(t)&&t.id||t.name},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name)),d(t).not(this.settings.ignore)[0]},checkable:function(t){return/radio|checkbox/i.test(t.type)},findByName:function(t){return d(this.currentForm).find("[name='"+this.escapeCssMeta(t)+"']")},getLength:function(t,e){switch(e.nodeName.toLowerCase()){case"select":return d("option:selected",e).length;case"input":if(this.checkable(e))return this.findByName(e.name).filter(":checked").length}return t.length},depend:function(t,e){return!this.dependTypes[typeof t]||this.dependTypes[typeof t](t,e)},dependTypes:{boolean:function(t){return t},string:function(t,e){return!!d(t,e.form).length},function:function(t,e){return t(e)}},optional:function(t){var e=this.elementValue(t);return!d.validator.methods.required.call(this,e,t)&&"dependency-mismatch"},startRequest:function(t){this.pending[t.name]||(this.pendingRequest++,d(t).addClass(this.settings.pendingClass),this.pending[t.name]=!0)},stopRequest:function(t,e){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[t.name],d(t).removeClass(this.settings.pendingClass),e&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(d(this.currentForm).submit(),this.submitButton&&d("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!e&&0===this.pendingRequest&&this.formSubmitted&&(d(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t,e){return e="string"==typeof e&&e||"remote",d.data(t,"previousValue")||d.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,{method:e})})},destroy:function(){this.resetForm(),d(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(t,e){t.constructor===String?this.classRuleSettings[t]=e:d.extend(this.classRuleSettings,t)},classRules:function(t){var e={},t=d(t).attr("class");return t&&d.each(t.split(" "),function(){this in d.validator.classRuleSettings&&d.extend(e,d.validator.classRuleSettings[this])}),e},normalizeAttributeRule:function(t,e,i,s){(s=/min|max|step/.test(i)&&(null===e||/number|range|text/.test(e))&&(s=Number(s),isNaN(s))?void 0:s)||0===s?t[i]=s:e===i&&"range"!==e&&(t[i]=!0)},attributeRules:function(t){var e,i,s={},n=d(t),r=t.getAttribute("type");for(e in d.validator.methods)i="required"===e?!!(i=""===(i=t.getAttribute(e))?!0:i):n.attr(e),this.normalizeAttributeRule(s,r,e,i);return s.maxlength&&/-1|2147483647|524288/.test(s.maxlength)&&delete s.maxlength,s},dataRules:function(t){var e,i,s={},n=d(t),r=t.getAttribute("type");for(e in d.validator.methods)""===(i=n.data("rule"+e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()))&&(i=!0),this.normalizeAttributeRule(s,r,e,i);return s},staticRules:function(t){var e={},i=d.data(t.form,"validator");return e=i.settings.rules?d.validator.normalizeRule(i.settings.rules[t.name])||{}:e},normalizeRules:function(s,n){return d.each(s,function(t,e){if(!1===e)delete s[t];else if(e.param||e.depends){var i=!0;switch(typeof e.depends){case"string":i=!!d(e.depends,n.form).length;break;case"function":i=e.depends.call(n,n)}i?s[t]=void 0===e.param||e.param:(d.data(n.form,"validator").resetElements(d(n)),delete s[t])}}),d.each(s,function(t,e){s[t]=d.isFunction(e)&&"normalizer"!==t?e(n):e}),d.each(["minlength","maxlength"],function(){s[this]&&(s[this]=Number(s[this]))}),d.each(["rangelength","range"],function(){var t;s[this]&&(d.isArray(s[this])?s[this]=[Number(s[this][0]),Number(s[this][1])]:"string"==typeof s[this]&&(t=s[this].replace(/[\[\]]/g,"").split(/[\s,]+/),s[this]=[Number(t[0]),Number(t[1])]))}),d.validator.autoCreateRanges&&(null!=s.min&&null!=s.max&&(s.range=[s.min,s.max],delete s.min,delete s.max),null!=s.minlength)&&null!=s.maxlength&&(s.rangelength=[s.minlength,s.maxlength],delete s.minlength,delete s.maxlength),s},normalizeRule:function(t){var e;return"string"==typeof t&&(e={},d.each(t.split(/\s/),function(){e[this]=!0}),t=e),t},addMethod:function(t,e,i){d.validator.methods[t]=e,d.validator.messages[t]=void 0!==i?i:d.validator.messages[t],e.length<3&&d.validator.addClassRules(t,d.validator.normalizeRule(t))},methods:{required:function(t,e,i){return this.depend(i,e)?"select"===e.nodeName.toLowerCase()?(i=d(e).val())&&0<i.length:this.checkable(e)?0<this.getLength(t,e):null!=t&&0<t.length:"dependency-mismatch"},email:function(t,e){return this.optional(e)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t)},url:function(t,e){return this.optional(e)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(t)},date:(i=!1,function(t,e){return i||(i=!0,this.settings.debug&&window.console&&console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`.")),this.optional(e)||!/Invalid|NaN/.test(new Date(t).toString())}),dateISO:function(t,e){return this.optional(e)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(t)},number:function(t,e){return this.optional(e)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)},digits:function(t,e){return this.optional(e)||/^\d+$/.test(t)},minlength:function(t,e,i){t=d.isArray(t)?t.length:this.getLength(t,e);return this.optional(e)||i<=t},maxlength:function(t,e,i){t=d.isArray(t)?t.length:this.getLength(t,e);return this.optional(e)||t<=i},rangelength:function(t,e,i){t=d.isArray(t)?t.length:this.getLength(t,e);return this.optional(e)||t>=i[0]&&t<=i[1]},min:function(t,e,i){return this.optional(e)||i<=t},max:function(t,e,i){return this.optional(e)||t<=i},range:function(t,e,i){return this.optional(e)||t>=i[0]&&t<=i[1]},step:function(t,e,i){function s(t){return(t=(""+t).match(/(?:\.(\d+))?$/))&&t[1]?t[1].length:0}function n(t){return Math.round(t*Math.pow(10,r))}var r,a=d(e).attr("type"),o="Step attribute on input type "+a+" is not supported.",l=new RegExp("\\b"+a+"\\b"),h=!0;if(a&&!l.test(["text","number","range"].join()))throw new Error(o);return r=s(i),(s(t)>r||n(t)%n(i)!=0)&&(h=!1),this.optional(e)||h},equalTo:function(t,e,i){i=d(i);return this.settings.onfocusout&&i.not(".validate-equalTo-blur").length&&i.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){d(e).valid()}),t===i.val()},remote:function(s,n,t,r){if(this.optional(n))return"dependency-mismatch";r="string"==typeof r&&r||"remote";var a,e,o=this.previousValue(n,r);return this.settings.messages[n.name]||(this.settings.messages[n.name]={}),o.originalMessage=o.originalMessage||this.settings.messages[n.name][r],this.settings.messages[n.name][r]=o.message,e=d.param(d.extend({data:s},(t="string"==typeof t?{url:t}:t).data)),o.old===e?o.valid:(o.old=e,(a=this).startRequest(n),(e={})[n.name]=s,d.ajax(d.extend(!0,{mode:"abort",port:"validate"+n.name,dataType:"json",data:e,context:a.currentForm,success:function(t){var e,i=!0===t||"true"===t;a.settings.messages[n.name][r]=o.originalMessage,i?(e=a.formSubmitted,a.resetInternals(),a.toHide=a.errorsFor(n),a.formSubmitted=e,a.successList.push(n),a.invalid[n.name]=!1,a.showErrors()):(e={},t=t||a.defaultMessage(n,{method:r,parameters:s}),e[n.name]=o.message=t,a.invalid[n.name]=!0,a.showErrors(e)),o.valid=i,a.stopRequest(n,i)}},t)),"pending")}}});var i,s,n={};return d.ajaxPrefilter?d.ajaxPrefilter(function(t,e,i){var s=t.port;"abort"===t.mode&&(n[s]&&n[s].abort(),n[s]=i)}):(s=d.ajax,d.ajax=function(t){var e=("mode"in t?t:d.ajaxSettings).mode,i=("port"in t?t:d.ajaxSettings).port;return"abort"===e?(n[i]&&n[i].abort(),n[i]=s.apply(this,arguments),n[i]):s.apply(this,arguments)}),d});
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(t){(e=t&&t.fn&&t.fn.select2&&t.fn.select2.amd?t.fn.select2.amd:e)&&e.requirejs||(e?l=e:e={},g={},m={},y={},v={},i=Object.prototype.hasOwnProperty,r=[].slice,_=/\.js$/,h=function(e,t){var n,i,r=u(e),o=r[0],t=t[1];return e=r[1],o&&(n=A(o=c(o,t))),o?e=n&&n.normalize?n.normalize(e,(i=t,function(e){return c(e,i)})):c(e,t):(o=(r=u(e=c(e,t)))[0],e=r[1],o&&(n=A(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},f={require:function(e){return w(e)},exports:function(e){var t=g[e];return void 0!==t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},o=function(e,t,n,i){var r,o,s,a,l,c=[],u=typeof n,d=x(i=i||e);if("undefined"==u||"function"==u){for(t=!t.length&&n.length?["require","exports","module"]:t,a=0;a<t.length;a+=1)if("require"===(o=(s=h(t[a],d)).f))c[a]=f.require(e);else if("exports"===o)c[a]=f.exports(e),l=!0;else if("module"===o)r=c[a]=f.module(e);else if(b(g,o)||b(m,o)||b(v,o))c[a]=A(o);else{if(!s.p)throw new Error(e+" missing "+o);s.p.load(s.n,w(i,!0),function(t){return function(e){g[t]=e}}(o),{}),c[a]=g[o]}u=n?n.apply(g[e],c):void 0,e&&(r&&r.exports!==p&&r.exports!==g[e]?g[e]=r.exports:u===p&&l||(g[e]=u))}else e&&(g[e]=n)},a=l=s=function(e,t,n,i,r){if("string"==typeof e)return f[e]?f[e](t):A(h(e,x(t)).f);if(!e.splice){if((y=e).deps&&s(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=p}return t=t||function(){},"function"==typeof n&&(n=i,i=r),i?o(p,e,t,n):setTimeout(function(){o(p,e,t,n)},4),s},s.config=function(e){return s(e)},a._defined=g,(n=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),b(g,e)||b(m,e)||(m[e]=[e,t,n])}).amd={jQuery:!0},e.requirejs=a,e.require=l,e.define=n),e.define("almond",function(){}),e.define("jquery",[],function(){var e=t||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),e.define("select2/utils",["jquery"],function(o){var i={};function c(e){var t,n=e.prototype,i=[];for(t in n)"function"==typeof n[t]&&"constructor"!==t&&i.push(t);return i}function e(){this.listeners={}}i.Extend=function(e,t){var n,i={}.hasOwnProperty;function r(){this.constructor=e}for(n in t)i.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},i.Decorate=function(i,r){var e=c(r),t=c(i);function o(){var e=Array.prototype.unshift,t=r.prototype.constructor.length,n=i.prototype.constructor;0<t&&(e.call(arguments,i.prototype.constructor),n=r.prototype.constructor),n.apply(this,arguments)}r.displayName=i.displayName,o.prototype=new function(){this.constructor=o};for(var n=0;n<t.length;n++){var s=t[n];o.prototype[s]=i.prototype[s]}for(var a=0;a<e.length;a++){var l=e[a];o.prototype[l]=function(e){var t=function(){},n=(e in o.prototype&&(t=o.prototype[e]),r.prototype[e]);return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}(l)}return o},e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},0===(n=null==n?[]:n).length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},i.Observable=e,i.generateChars=function(e){for(var t="",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},i.bind=function(e,t){return function(){e.apply(t,arguments)}},i._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var r=0;r<n.length;r++){var o=n[r];(o=o.substring(0,1).toLowerCase()+o.substring(1))in i||(i[o]={}),r==n.length-1&&(i[o]=e[t]),i=i[o]}delete e[t]}}return e},i.hasScroll=function(e,t){var n=o(t),i=t.style.overflowX,r=t.style.overflowY;return(i!==r||"hidden"!==r&&"visible"!==r)&&("scroll"===i||"scroll"===r||n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth)},i.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},i.appendMany=function(e,t){var n;"1.7"===o.fn.jquery.substr(0,3)&&(n=o(),o.map(t,function(e){n=n.add(e)}),t=n),e.append(t)},i.__cache={};var n=0;return i.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},i.StoreData=function(e,t,n){e=i.GetUniqueElementId(e);i.__cache[e]||(i.__cache[e]={}),i.__cache[e][t]=n},i.GetData=function(e,t){var n=i.GetUniqueElementId(e);return t?i.__cache[n]&&null!=i.__cache[n][t]?i.__cache[n][t]:o(e).data(t):i.__cache[n]},i.RemoveData=function(e){var t=i.GetUniqueElementId(e);null!=i.__cache[t]&&delete i.__cache[t],e.removeAttribute("data-select2-id")},i}),e.define("select2/results",["jquery","./utils"],function(u,d){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return d.Extend(i,d.Observable),i.prototype.render=function(){var e=u('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup"),n=(this.clear(),this.hideLoading(),u('<li role="alert" aria-live="assertive" class="select2-results__option"></li>')),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],i=this.option(i);t.push(i)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},i.prototype.position=function(e,t){t.find(".select2-results").append(e)},i.prototype.sort=function(e){return this.options.get("sorter")(e)},i.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");(0<t.length?t:e).first().trigger("mouseenter"),this.ensureHighlightVisible()},i.prototype.setClasses=function(){var t=this;this.data.current(function(e){var i=u.map(e,function(e){return e.id.toString()});t.$results.find(".select2-results__option[aria-selected]").each(function(){var e=u(this),t=d.GetData(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<u.inArray(n,i)?e.attr("aria-selected","true"):e.attr("aria-selected","false")})})},i.prototype.showLoading=function(e){this.hideLoading();e={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},e=this.option(e);e.className+=" loading-results",this.$results.prepend(e)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(e){var t,n=document.createElement("li"),i=(n.className="select2-results__option",{role:"option","aria-selected":"false"}),r=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(t in(null!=e.element&&r.call(e.element,":disabled")||null==e.element&&e.disabled)&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==e.id&&delete i["aria-selected"],null!=e._resultId&&(n.id=e._resultId),e.title&&(n.title=e.title),e.children&&(i.role="group",i["aria-label"]=e.text,delete i["aria-selected"]),i)n.setAttribute(t,i[t]);if(e.children){var r=u(n),o=document.createElement("strong");o.className="select2-results__group",u(o),this.template(e,o);for(var s=[],a=0;a<e.children.length;a++){var l=e.children[a],l=this.option(l);s.push(l)}var c=u("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});c.append(s),r.append(o),r.append(c)}else this.template(e,n);return d.StoreData(n,"data",e),n},i.prototype.bind=function(t,e){var r=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){r.clear(),r.append(e.data),t.isOpen()&&(r.setClasses(),r.highlightFirstItem())}),t.on("results:append",function(e){r.append(e.data),t.isOpen()&&r.setClasses()}),t.on("query",function(e){r.hideMessages(),r.showLoading(e)}),t.on("select",function(){t.isOpen()&&(r.setClasses(),r.options.get("scrollAfterSelect"))&&r.highlightFirstItem()}),t.on("unselect",function(){t.isOpen()&&(r.setClasses(),r.options.get("scrollAfterSelect"))&&r.highlightFirstItem()}),t.on("open",function(){r.$results.attr("aria-expanded","true"),r.$results.attr("aria-hidden","false"),r.setClasses(),r.ensureHighlightVisible()}),t.on("close",function(){r.$results.attr("aria-expanded","false"),r.$results.attr("aria-hidden","true"),r.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=r.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e,t=r.getHighlightedResults();0!==t.length&&(e=d.GetData(t[0],"data"),"true"==t.attr("aria-selected")?r.trigger("close",{}):r.trigger("select",{data:e}))}),t.on("results:previous",function(){var e,t=r.getHighlightedResults(),n=r.$results.find("[aria-selected]"),i=n.index(t);i<=0||(i=i-1,0===t.length&&(i=0),(t=n.eq(i)).trigger("mouseenter"),n=r.$results.offset().top,t=t.offset().top,e=r.$results.scrollTop()+(t-n),0===i?r.$results.scrollTop(0):t-n<0&&r.$results.scrollTop(e))}),t.on("results:next",function(){var e,t,n=r.getHighlightedResults(),i=r.$results.find("[aria-selected]"),n=i.index(n)+1;n>=i.length||((i=i.eq(n)).trigger("mouseenter"),e=r.$results.offset().top+r.$results.outerHeight(!1),i=i.offset().top+i.outerHeight(!1),t=r.$results.scrollTop()+i-e,0===n?r.$results.scrollTop(0):e<i&&r.$results.scrollTop(t))}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){r.displayMessage(e)}),u.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=r.$results.scrollTop(),n=r.$results.get(0).scrollHeight-t+e.deltaY,t=0<e.deltaY&&t-e.deltaY<=0,n=e.deltaY<0&&n<=r.$results.height();t?(r.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):n&&(r.$results.scrollTop(r.$results.get(0).scrollHeight-r.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(e){var t=u(this),n=d.GetData(this,"data");"true"!==t.attr("aria-selected")?r.trigger("select",{originalEvent:e,data:n}):r.options.get("multiple")?r.trigger("unselect",{originalEvent:e,data:n}):r.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(e){var t=d.GetData(this,"data");r.getHighlightedResults().removeClass("select2-results__option--highlighted"),r.trigger("results:focus",{data:t,element:u(this)})})},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var e,t,n,i,r=this.getHighlightedResults();0!==r.length&&(e=this.$results.find("[aria-selected]").index(r),t=this.$results.offset().top,i=r.offset().top,n=this.$results.scrollTop()+(i-t),i=i-t,n-=2*r.outerHeight(!1),e<=2?this.$results.scrollTop(0):(i>this.$results.outerHeight()||i<0)&&this.$results.scrollTop(n))},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),n=n(e,t);null==n?t.style.display="none":"string"==typeof n?t.innerHTML=i(n):u(t).append(n)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,i,r){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return i.Extend(o,i.Observable),o.prototype.render=function(){var e=n('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=i.GetData(this.$element[0],"old-tabindex")?this._tabindex=i.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,i=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&i.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},r.prototype.bind=function(t,e){var n=this,i=(r.__super__.bind.apply(this,arguments),t.id+"-container");this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("<span></span>")},r.prototype.update=function(e){var t,n;0!==e.length?(e=e[0],t=this.$selection.find(".select2-selection__rendered"),n=this.display(e,t),t.empty().append(n),(n=e.title||e.text)?t.attr("title",n):t.removeAttr("title")):this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,a){function r(e,t){r.__super__.constructor.apply(this,arguments)}return a.Extend(r,e),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},r.prototype.bind=function(e,t){var n=this;r.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){n.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){var t;n.isDisabled()||(t=i(this).parent(),t=a.GetData(t[0],"data"),n.trigger("unselect",{originalEvent:e,data:t}))})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return i('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=this.selectionContainer(),o=this.display(i,r),o=(r.append(o),i.title||i.text);o&&r.attr("title",o),a.StoreData(r[0],"data",i),t.push(r)}var s=this.$selection.find(".select2-selection__rendered");a.appendMany(s,t)}},r}),e.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return t="string"==typeof t?{id:"",text:t}:t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();n=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(n)},t}),e.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(n,i,a){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.isDisabled()){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();var i=a.GetData(n[0],"data"),r=this.$element.val(),o=(this.$element.val(this.placeholder.id),{data:i});if(this.trigger("clear",o),o.prevented)this.$element.val(r);else{for(var s=0;s<i.length;s++)if(o={data:i[s]},this.trigger("unselect",o),o.prevented)return void this.$element.val(r);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=i.DELETE&&t.which!=i.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){e.call(this,t),0<this.$selection.find(".select2-selection__placeholder").length||0===t.length||(e=this.options.get("translations").get("removeAllItems"),e=n('<span class="select2-selection__clear" title="'+e()+'">&times;</span>'),a.StoreData(e[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(e))},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(n,s,a){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=n('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>'),t=(this.$searchContainer=t,this.$search=t.find("input"),e.call(this));return this._transferTabIndex(),t},e.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results",e=(e.call(this,t,n),t.on("open",function(){i.$search.attr("aria-controls",r),i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){var t;e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented(),e.which===a.BACKSPACE&&""===i.$search.val()&&0<(t=i.$searchContainer.prev(".select2-selection__choice")).length&&(t=s.GetData(t[0],"data"),i.searchRemoveChoice(t),e.preventDefault())}),this.$selection.on("click",".select2-search--inline",function(e){i.$search.val()&&e.stopPropagation()}),document.documentMode),o=e&&e<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){o?i.$selection.off("input.search input.searchcheck"):i.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){var t;o&&"input"===e.type?i.$selection.off("input.search input.searchcheck"):(t=e.which)!=a.SHIFT&&t!=a.CTRL&&t!=a.ALT&&t!=a.TAB&&i.handleSearch(e)})},e.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},e.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.trigger("focus")},e.prototype.handleSearch=function(){var e;this.resizeSearch(),this._keyUpPrevented||(e=this.$search.val(),this.trigger("query",{term:e})),this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="",e=""!==this.$search.attr("placeholder")?this.$selection.find(".select2-selection__rendered").width():.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},e}),e.define("select2/selection/eventRelay",["jquery"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var i=this,r=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],o=["opening","closing","selecting","unselecting","clearing"];e.call(this,t,n),t.on("*",function(e,t){var n;-1!==s.inArray(e,r)&&(n=s.Event("select2:"+e,{params:t=t||{}}),i.$element.trigger(n),-1!==s.inArray(e,o))&&(t.prevented=n.isDefaultPrevented())})},e}),e.define("select2/translation",["jquery","require"],function(t,n){function i(e){this.dict=e||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(e){return this.dict[e]},i.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},i._cache={},i.loadPath=function(e){var t;return e in i._cache||(t=n(e),i._cache[e]=t),new i(i._cache[e])},i}),e.define("select2/diacritics",[],function(){return{"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),e.define("select2/data/base",["../utils"],function(n){function i(e,t){i.__super__.constructor.call(this)}return n.Extend(i,n.Observable),i.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},i.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},i.prototype.bind=function(e,t){},i.prototype.destroy=function(){},i.prototype.generateResultId=function(e,t){e=e.id+"-result-";return e+=n.generateChars(4),null!=t.id?e+="-"+t.id.toString():e+="-"+n.generateChars(4),e},i}),e.define("select2/data/select",["./base","../utils","jquery"],function(e,s,a){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return s.Extend(n,e),n.prototype.current=function(e){var t=[],n=this;this.$element.find(":selected").each(function(){var e=a(this),e=n.item(e);t.push(e)}),e(t)},n.prototype.select=function(r){var e,o=this;r.selected=!0,a(r.element).is("option")?(r.element.selected=!0,this.$element.trigger("input").trigger("change")):this.$element.prop("multiple")?this.current(function(e){var t=[];(r=[r]).push.apply(r,e);for(var n=0;n<r.length;n++){var i=r[n].id;-1===a.inArray(i,t)&&t.push(i)}o.$element.val(t),o.$element.trigger("input").trigger("change")}):(e=r.id,this.$element.val(e),this.$element.trigger("input").trigger("change"))},n.prototype.unselect=function(r){var o=this;this.$element.prop("multiple")&&(r.selected=!1,a(r.element).is("option")?(r.element.selected=!1,this.$element.trigger("input").trigger("change")):this.current(function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n].id;i!==r.id&&-1===a.inArray(i,t)&&t.push(i)}o.$element.val(t),o.$element.trigger("input").trigger("change")}))},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){s.RemoveData(this)})},n.prototype.query=function(t,e){var n=[],i=this;this.$element.children().each(function(){var e=a(this);(e.is("option")||e.is("optgroup"))&&(e=i.item(e),null!==(e=i.matches(t,e)))&&n.push(e)}),e({results:n})},n.prototype.addOptions=function(e){s.appendMany(this.$element,e)},n.prototype.option=function(e){e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var t,n=a(t),e=this._normalizeItem(e);return e.element=t,s.StoreData(t,"data",e),n},n.prototype.item=function(e){var t={};if(null==(t=s.GetData(e[0],"data"))){if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){for(var t={text:e.prop("label"),children:[],title:e.prop("title")},n=e.children("option"),i=[],r=0;r<n.length;r++){var o=a(n[r]),o=this.item(o);i.push(o)}t.children=i}(t=this._normalizeItem(t)).element=e[0],s.StoreData(e[0],"data",t)}return t},n.prototype._normalizeItem=function(e){return e!==Object(e)&&(e={id:e,text:e}),null!=(e=a.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),a.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),e.define("select2/data/array",["./select","../utils","jquery"],function(e,c,u){function i(e,t){this._dataToConvert=t.get("data")||[],i.__super__.constructor.call(this,e,t)}return c.Extend(i,e),i.prototype.bind=function(e,t){i.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},i.prototype.select=function(n){var e;0===this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()}).length&&(e=this.option(n),this.addOptions(e)),i.__super__.select.call(this,n)},i.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),i=n.map(function(){return t.item(u(this)).id}).get(),r=[];for(var o=0;o<e.length;o++){var s,a,l=this._normalizeItem(e[o]);0<=u.inArray(l.id,i)?(s=n.filter(function(e){return function(){return u(this).val()==e.id}}(l)),a=this.item(s),a=u.extend(!0,{},l,a),a=this.option(a),s.replaceWith(a)):(s=this.option(l),l.children&&(a=this.convertToOptions(l.children),c.appendMany(s,a)),r.push(s))}return r},i}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,o){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){return o.extend({},{data:function(e){return o.extend({},e,{q:e.term})},transport:function(e,t,n){e=o.ajax(e);return e.then(t),e.fail(n),e}},e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(t,n){var i=this,r=(null!=this._request&&(o.isFunction(this._request.abort)&&this._request.abort(),this._request=null),o.extend({type:"GET"},this.ajaxOptions));function e(){var e=r.transport(r,function(e){e=i.processResults(e,t);i.options.get("debug")&&window.console&&console.error&&(e&&e.results&&o.isArray(e.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),n(e)},function(){"status"in e&&(0===e.status||"0"===e.status)||i.trigger("results:message",{message:"errorLoading"})});i._request=e}"function"==typeof r.url&&(r.url=r.url.call(this.$element,t)),"function"==typeof r.data&&(r.data=r.data.call(this.$element,t)),this.ajaxOptions.delay&&null!=t.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),e.define("select2/data/tags",["jquery"],function(a){function e(e,t,n){var i=n.get("tags"),r=n.get("createTag"),r=(void 0!==r&&(this.createTag=r),n.get("insertTag"));if(void 0!==r&&(this.insertTag=r),e.call(this,t,n),a.isArray(i))for(var o=0;o<i.length;o++){var s=i[o],s=this._normalizeItem(s),s=this.option(s);this.$element.append(s)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null!=c.term&&null==c.page?e.call(this,c,function e(t,n){for(var i=t.results,r=0;r<i.length;r++){var o=i[r],s=null!=o.children&&!e({results:o.children},!0);if((o.text||"").toUpperCase()===(c.term||"").toUpperCase()||s)return!n&&(t.data=i,void u(t))}if(n)return!0;var a,l=d.createTag(c);null!=l&&((a=d.option(l)).attr("data-select2-tag",!0),d.addOptions([a]),d.insertTag(i,l)),t.results=i,u(t)}):e.call(this,c,u)},e.prototype.createTag=function(e,t){t=a.trim(t.term);return""===t?null:{id:t,text:t}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},e}),e.define("select2/data/tokenizer",["jquery"],function(c){function e(e,t,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var i=this,r=(t.term=t.term||"",this.tokenizer(t,this.options,function(e){var t=i._normalizeItem(e);i.$element.find("option").filter(function(){return c(this).val()===t.id}).length||((e=i.option(t)).attr("data-select2-tag",!0),i._removeOldTags(),i.addOptions([e])),i.trigger("select",{data:t})}));r.term!==t.term&&(this.$search.length&&(this.$search.val(r.term),this.$search.trigger("focus")),t.term=r.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,i){for(var r=n.get("tokenSeparators")||[],o=t.term,s=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};s<o.length;){var l=o[s];-1!==c.inArray(l,r)&&(l=o.substr(0,s),null!=(l=a(c.extend({},t,{term:l}))))?(i(l),o=o.substr(s+1)||"",s=0):s++}return{term:o}},e}),e.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(){i._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected(function(){e.call(i,t,n)})},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current(function(e){e=null!=e?e.length:0;0<n.maximumSelectionLength&&e>=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):t&&t()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var e=e.call(this),t=o('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=t,this.$search=t.find("input"),e.prepend(t),e},t.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",r),i.$search.trigger("focus"),window.setTimeout(function(){i.$search.trigger("focus")},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||i.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){var t;this._keyUpPrevented||(t=this.$search.val(),this.trigger("query",{term:t})),this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return t="string"==typeof t?{id:"",text:t}:t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&e&&(e=this.$results.offset().top+this.$results.outerHeight(!1),this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=e+50)&&this.loadMore()},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(u,s){function e(e,t,n){this.$dropdownParent=u(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=u("<span></span>"),e=e.call(this);return t.append(e),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){var n;this._containerResultsHandlersBound||(n=this,t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0)},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,r="resize.select2."+t.id,t="orientationchange.select2."+t.id,o=this.$container.parents().filter(s.hasScroll);o.each(function(){s.StoreData(this,"select2-scroll-position",{x:u(this).scrollLeft(),y:u(this).scrollTop()})}),o.on(i,function(e){var t=s.GetData(this,"select2-scroll-position");u(this).scrollTop(t.y)}),u(window).on(i+" "+r+" "+t,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,t="orientationchange.select2."+t.id;this.$container.parents().filter(s.hasScroll).off(n),u(window).off(n+" "+i+" "+t)},e.prototype._positionDropdown=function(){var e=u(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset(),o=(r.bottom=r.top+this.$container.outerHeight(!1),{height:this.$container.outerHeight(!1)}),s=(o.top=r.top,o.bottom=r.top+o.height,this.$dropdown.outerHeight(!1)),a=e.scrollTop(),e=e.scrollTop()+e.height(),a=a<r.top-s,e=e>r.bottom+s,r={left:r.left,top:o.bottom},l=this.$dropdownParent,c=("static"===l.css("position")&&(l=l.offsetParent()),{top:0,left:0});(u.contains(document.body,l[0])||l[0].isConnected)&&(c=l.offset()),r.top-=c.top,r.left-=c.left,t||n||(i="below"),e||!a||t?!a&&e&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(r.top=o.top-c.top-s),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(r)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i<t.length;i++){var r=t[i];r.children?n+=e(r.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),e.define("select2/dropdown/selectOnClose",["../utils"],function(n){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(e){i._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){t=t.originalSelect2Event;if("select"===t._type||"unselect"===t._type)return}var t=this.getHighlightedResults();t.length<1||null!=(t=n.GetData(t[0],"data")).element&&t.element.selected||null==t.element&&t.selected||this.trigger("select",{data:t})},e}),e.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var e=e.input.length-e.maximum,t="Please delete "+e+" character";return 1!=e&&(t+="s"),t},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(l,o,s,a,c,u,d,p,h,f,g,t,m,y,v,_,$,b,w,A,x,D,S,E,C,O,T,q,e){function n(){this.reset()}return n.prototype.apply=function(e){var t;null==(e=l.extend(!0,{},this.defaults,e)).dataAdapter&&(null!=e.ajax?e.dataAdapter=v:null!=e.data?e.dataAdapter=y:e.dataAdapter=m,0<e.minimumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,b)),0<e.maximumInputLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,w)),0<e.maximumSelectionLength&&(e.dataAdapter=f.Decorate(e.dataAdapter,A)),e.tags&&(e.dataAdapter=f.Decorate(e.dataAdapter,_)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=f.Decorate(e.dataAdapter,$)),null!=e.query&&(t=o(e.amdBase+"compat/query"),e.dataAdapter=f.Decorate(e.dataAdapter,t)),null!=e.initSelection)&&(t=o(e.amdBase+"compat/initSelection"),e.dataAdapter=f.Decorate(e.dataAdapter,t)),null==e.resultsAdapter&&(e.resultsAdapter=s,null!=e.ajax&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,E)),null!=e.placeholder&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,S)),e.selectOnClose)&&(e.resultsAdapter=f.Decorate(e.resultsAdapter,T)),null==e.dropdownAdapter&&(e.multiple?e.dropdownAdapter=x:(t=f.Decorate(x,D),e.dropdownAdapter=t),0!==e.minimumResultsForSearch&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,O)),e.closeOnSelect&&(e.dropdownAdapter=f.Decorate(e.dropdownAdapter,q)),null==e.dropdownCssClass&&null==e.dropdownCss&&null==e.adaptDropdownCssClass||(t=o(e.amdBase+"compat/dropdownCss"),e.dropdownAdapter=f.Decorate(e.dropdownAdapter,t)),e.dropdownAdapter=f.Decorate(e.dropdownAdapter,C)),null==e.selectionAdapter&&(e.multiple?e.selectionAdapter=c:e.selectionAdapter=a,null!=e.placeholder&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,u)),e.allowClear&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,d)),e.multiple&&(e.selectionAdapter=f.Decorate(e.selectionAdapter,p)),null==e.containerCssClass&&null==e.containerCss&&null==e.adaptContainerCssClass||(t=o(e.amdBase+"compat/containerCss"),e.selectionAdapter=f.Decorate(e.selectionAdapter,t)),e.selectionAdapter=f.Decorate(e.selectionAdapter,h)),e.language=this._resolveLanguage(e.language),e.language.push("en");for(var n=[],i=0;i<e.language.length;i++){var r=e.language[i];-1===n.indexOf(r)&&n.push(r)}return e.language=n,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return t[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:f.escapeMarkup,language:{},matcher:function e(t,n){if(""===l.trim(t.term))return n;if(n.children&&0<n.children.length){for(var i=l.extend(!0,{},n),r=n.children.length-1;0<=r;r--)null==e(t,n.children[r])&&i.children.splice(r,1);return 0<i.children.length?i:e(t,i)}var o=a(n.text).toUpperCase(),s=a(t.term).toUpperCase();return-1<o.indexOf(s)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},n.prototype.applyFromElement=function(e,t){var n=e.language,i=this.defaults.language,r=t.prop("lang"),t=t.closest("[lang]").prop("lang"),r=Array.prototype.concat.call(this._resolveLanguage(r),this._resolveLanguage(n),this._resolveLanguage(i),this._resolveLanguage(t));return e.language=r,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(l.isEmptyObject(e))return[];if(l.isPlainObject(e))return[e];for(var t,n=l.isArray(e)?e:[e],i=[],r=0;r<n.length;r++)i.push(n[r]),"string"==typeof n[r]&&0<n[r].indexOf("-")&&(t=n[r].split("-")[0],i.push(t));return i},n.prototype._processTranslations=function(e,t){for(var n=new g,i=0;i<e.length;i++){var r=new g,o=e[i];if("string"==typeof o)try{r=g.loadPath(o)}catch(e){try{o=this.defaults.amdLanguageBase+o,r=g.loadPath(o)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for "'+o+'" could not be automatically loaded. A fallback will be used instead.')}}else r=l.isPlainObject(o)?new g(o):o;n.extend(r)}return n},n.prototype.set=function(e,t){var n={},e=(n[l.camelCase(e)]=t,f._convertData(n));l.extend(!0,this.defaults,e)},new n}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(n,c,i,u){function e(e,t){this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=i.applyFromElement(this.options,t)),this.options=i.apply(this.options),t&&t.is("input")&&(e=n(this.get("amdBase")+"compat/inputData"),this.options.dataAdapter=u.Decorate(this.options.dataAdapter,e))}return e.prototype.fromElement=function(e){var t=["select2"],n=(null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),u.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),u.StoreData(e[0],"data",u.GetData(e[0],"select2Tags")),u.StoreData(e[0],"tags",!0)),u.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",u.GetData(e[0],"ajaxUrl")),u.StoreData(e[0],"ajax-Url",u.GetData(e[0],"ajaxUrl"))),{});function i(e,t){return t.toUpperCase()}for(var r=0;r<e[0].attributes.length;r++){var o=e[0].attributes[r].name,s="data-";o.substr(0,s.length)==s&&(o=o.substring(s.length),s=u.GetData(e[0],o),n[o.replace(/-([a-z])/g,i)]=s)}c.fn.jquery&&"1."==c.fn.jquery.substr(0,2)&&e[0].dataset&&(n=c.extend(!0,{},e[0].dataset,n));var a,l=c.extend(!0,{},u.GetData(e[0]),n);for(a in l=u._convertData(l))-1<c.inArray(a,t)||(c.isPlainObject(this.options[a])?c.extend(this.options[a],l[a]):this.options[a]=l[a]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(o,r,s,i){function a(e,t){null!=s.GetData(e[0],"select2")&&s.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),this.options=new r(t=t||{},e),a.__super__.constructor.call(this);var t=e.attr("tabindex")||0,t=(s.StoreData(e[0],"old-tabindex",t),e.attr("tabindex","-1"),this.options.get("dataAdapter")),t=(this.dataAdapter=new t(e,this.options),this.render()),n=(this._placeContainer(t),this.options.get("selectionAdapter")),n=(this.selection=new n(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,t),this.options.get("dropdownAdapter")),n=(this.dropdown=new n(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,t),this.options.get("resultsAdapter")),i=(this.results=new n(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown),this);this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){i.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),s.StoreData(e[0],"select2",this),e.data("select2",this)}return s.Extend(a,s.Observable),a.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+s.generateChars(2):s.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},a.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},a.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t)return null!=(i=this._resolveWidth(e,"style"))?i:this._resolveWidth(e,"element");if("element"==t)return(i=e.outerWidth(!1))<=0?"auto":i+"px";if("style"!=t)return"computedstyle"!=t?t:window.getComputedStyle(e[0]).width;var i=e.attr("style");if("string"==typeof i)for(var r=i.split(";"),o=0,s=r.length;o<s;o+=1){var a=r[o].replace(/\s/g,"").match(n);if(null!==a&&1<=a.length)return a[1]}return null},a.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},a.prototype._registerDomEvents=function(){var t=this,e=(this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=s.bind(this._syncAttributes,this),this._syncS=s.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA),window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver);null!=e?(this._observer=new e(function(e){t._syncA(),t._syncS(null,e)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},a.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},a.prototype._registerSelectionEvents=function(){var n=this,i=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===o.inArray(e,i)&&n.trigger(e,t)})},a.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},a.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},a.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container.addClass("select2-container--open")}),this.on("close",function(){n.$container.removeClass("select2-container--open")}),this.on("enable",function(){n.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){n.$container.addClass("select2-container--disabled")}),this.on("blur",function(){n.$container.removeClass("select2-container--focus")}),this.on("query",function(t){n.isOpen()||n.trigger("open",{}),this.dataAdapter.query(t,function(e){n.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){n.trigger("results:append",{data:e,query:t})})}),this.on("keypress",function(e){var t=e.which;n.isOpen()?t===i.ESC||t===i.TAB||t===i.UP&&e.altKey?(n.close(e),e.preventDefault()):t===i.ENTER?(n.trigger("results:select",{}),e.preventDefault()):t===i.SPACE&&e.ctrlKey?(n.trigger("results:toggle",{}),e.preventDefault()):t===i.UP?(n.trigger("results:previous",{}),e.preventDefault()):t===i.DOWN&&(n.trigger("results:next",{}),e.preventDefault()):(t===i.ENTER||t===i.SPACE||t===i.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},a.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},a.prototype._isChangeMutation=function(e,t){var n=!1,i=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&0<t.addedNodes.length)for(var r=0;r<t.addedNodes.length;r++)t.addedNodes[r].selected&&(n=!0);else t.removedNodes&&0<t.removedNodes.length?n=!0:o.isArray(t)&&o.each(t,function(e,t){if(i._isChangeMutation(e,t))return!(n=!0)});else n=!0;return n}},a.prototype._syncSubtree=function(e,t){var e=this._isChangeMutation(e,t),n=this;e&&this.dataAdapter.current(function(e){n.trigger("selection:update",{data:e})})},a.prototype.trigger=function(e,t){var n=a.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in i){var r={prevented:!1,name:e,args:t};if(n.call(this,i[e],r),r.prevented)return void(t.prevented=!0)}n.call(this,e,t)},a.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},a.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},a.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},a.prototype.isEnabled=function(){return!this.isDisabled()},a.prototype.isDisabled=function(){return this.options.get("disabled")},a.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},a.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},a.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},a.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.');e=!(e=null!=e&&0!==e.length?e:[!0])[0];this.$element.prop("disabled",e)},a.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},a.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();e=e[0];o.isArray(e)&&(e=o.map(e,function(e){return e.toString()})),this.$element.val(e).trigger("input").trigger("change")},a.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",s.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),s.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},a.prototype.render=function(){var e=o('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),s.StoreData(e[0],"element",this.$element),e},a}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(r,e,o,t,s){var a;return null==r.fn.select2&&(a=["open","close","destroy"],r.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=r.extend(!0,{},t);new o(r(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=s.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,i)}),-1<r.inArray(t,a)?this:n}),null==r.fn.select2.defaults&&(r.fn.select2.defaults=t),o});var e,n,p,o,s,h,f,g,m,y,v,i,r,_,a={define:e.define,require:e.require},l=a.require("jquery.select2");function b(e,t){return i.call(e,t)}function c(e,t){var n,i,r,o,s,a,l,c,u,d,p=t&&t.split("/"),h=y.map,f=h&&h["*"]||{};if(e){for(t=(e=e.split("/")).length-1,y.nodeIdCompat&&_.test(e[t])&&(e[t]=e[t].replace(_,"")),"."===e[0].charAt(0)&&p&&(e=p.slice(0,p.length-1).concat(e)),c=0;c<e.length;c++)if("."===(d=e[c]))e.splice(c,1),--c;else if(".."===d){if(0===c||1===c&&".."===e[2]||".."===e[c-1])continue;0<c&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((p||f)&&h){for(c=(n=e.split("/")).length;0<c;--c){if(i=n.slice(0,c).join("/"),p)for(u=p.length;0<u;--u)if(r=(r=h[p.slice(0,u).join("/")])&&r[i]){o=r,s=c;break}if(o)break;!a&&f&&f[i]&&(a=f[i],l=c)}!o&&a&&(o=a,s=l),o&&(n.splice(0,s,o),e=n.join("/"))}return e}function w(t,n){return function(){var e=r.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),s.apply(p,e.concat([t,n]))}}function A(e){var t;if(b(m,e)&&(t=m[e],delete m[e],v[e]=!0,o.apply(p,t)),b(g,e)||b(v,e))return g[e];throw new Error("No "+e)}function u(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function x(e){return e?u(e):[]}return t.fn.select2.amd=a,l});
function Wpcf7_admin_validations(s){this.rules={rules:{}},this.init=function(){this.addMethods(),s("#wpcf7-contact-form-editor form").validate({rules:this.rules,onfocusout:function(s){this.element(s)}})},this.addMethods=function(){this.nospaces(),this.englishAndNumbersOnly()},this.englishAndNumbersOnly=function(){s.validator.addMethod("validateenglishnumbers",function(s,i){return this.optional(i)||/^[a-z0-9_\-," "]+$/i.test(s)},"English and numbers only"),s.validator.addClassRules("validateenglishnumbers",{validateenglishnumbers:!0})},this.nospaces=function(){s.validator.addMethod("validatenospace",function(s,i){return s.indexOf(" ")<0&&""!=s},"No spaces please"),s.validator.addClassRules("validatenospace",{validatenospace:!0})},this.init()}
var wpcf7_redirect_admin;function wpcf_get_nonce(){return(jQuery("[name=actions-nonce]").val()?jQuery("[name=actions-nonce]"):jQuery("[name=_wpcf7nonce]")).val()}!function(c){function t(){this.init=function(){this.setparams(),this.admin_field_handlers(),this.register_action_hooks(),this.hide_select_options(),this.init_draggable(),this.renumber_rows(),this.admin_validations=new Wpcf7_admin_validations(c),this.init_select2(),this.init_media_field(),this.init_colorpickers(),this.mark_default_select_fields()},this.mark_default_select_fields=function(){c(".action-container select").each(function(){0!==c(this).val()&&c(this).val()||c(this).find("option:first-child").prop("selected","selected")})},this.init_editors=function(t){if("undefined"!=typeof tinymce&&"undefined"!=typeof tinyMCEPreInit&&(editor_id=t.find("textarea").prop("id")))try{tinymce.init(editor_id,{selector:"textarea"}),tinymce.execCommand("mceAddEditor",!1,editor_id),quicktags({id:editor_id})}catch(t){console.log(t)}},this.init_colorpickers=function(){c("input.colorpicker").addClass("rendered").wpColorPicker()},this.setparams=function(){this.banner_selector=".wpcfr-banner-holder",this.add_and_selector=".add-condition",this.row_template_selector=".row-template",this.remove_and_selector=".qs-condition-actions .dashicons-minus",this.add_group_button_selector=".wpcfr-add-group",this.rule_group_selector=".wpcfr-rule-group",this.edit_block_title_selector=".conditional-group-titles .dashicons-edit",this.cancel_block_title_selector=".conditional-group-titles .dashicons-no",this.save_block_title_edit_selector=".conditional-group-titles .dashicons-yes",this.tab_title_all_selector=".block-title",this.tab_title_selector=".block-title:not(.edit)",this.tab_title_active_selector=".block-title.active",this.active_tab_selector=".conditional-group-block.active",this.tab_inner_title=".conditional-group-block-title",this.new_block_counter=1,this.add_block_button_selector=".wpcf7r-add-block",this.blocks_container_selector=".conditional-group-blocks",this.remove_block_button_selector=".remove-block",this.group_row_value_select_selector=".group_row_value_select",this.group_select_field_selector=".wpcf7r-fields",this.open_tab_selector="#redirect-panel h3[data-tab-target]",this.show_action_selector=".actions-list .edit a",this.move_action_to_trash_selector=".actions-list .row-actions .trash a",this.dupicate_action_selector=".actions-list .row-actions .duplicate a",this.move_lead_to_trash_selector=".leads-list .trash a",this.add_new_action_selector=".wpcf7-add-new-action",this.custom_checkbox_selector=".wpcf7r-checkbox input",this.action_title_field=".wpcf7-redirect-post-title-fields",this.migrate_from_cf7_api_selector=".migrate-from-send-to-api",this.migrate_from_cf7_redirect_selector=".migrate-from-redirection",this.json_textarea_selector=".json-container",this.butify_button_selector=".wpcf7-redirect-butify",this.add_repeater_field_selector=".qs-repeater-action .dashicons-plus",this.remove_repeater_field_selector=".qs-repeater-action .dashicons-minus",this.api_test_button_selector=".wpcf7-redirect-test_button-fields",this.toggler_handler_selector=".actions-list [data-toggle] input",this.select_toggler_selector="[data-toggler-name]",this.select_action_selector='[name="new-action-selector"]',this.mailchimp_get_lists=".wpcf7-redirect-get_mailchimp_lists-fields",this.mailchimp_create_list=".wpcf7-redirect-create_list-fields",this.mailchimp_list_selector=".field-wrap-mailchimp_list_id select",this.tab_actions_selector='[href="#redirect-panel"]',this.pro_banner_submit_btn_selector=".btn-rp-submit",this.pro_banner_user_email_selecttor='[name="rp_user_email"]',this.new_group_counter=0,this.reset_all_button=".cf7-redirect-reset",this.new_row_counter=0,this.mail_tags_toggle=".mail-tags-title",this.validate_salesforce_app_details=".wpcf7-redirect-validate_connection-fields",this.debug_send_button_selector=".send-debug-info",this.close_popup_button_selector=".wpcfr-close-popup"},this.init_select2=function(t){c(".select2-field select:not(.rendered)").each(function(){c(".select2-field select:not(.rendered)").select2({width:"resolve"}).addClass("rendered")})},this.init_media_field=function(){var i,a="";void 0===wp.media?console.log("no media support"):((file_frame=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",multiple:!1})).on("insert",function(t){var e=file_frame.state().get("selection").first().toJSON();i.hasClass("file-container")?i.find(".file-url").val(e.url):(i.find(".popup-image").remove(),i.prepend('<img src="'+e.url+'" alt="" style="max-width:100px;" class="popup-image"/>')),a.val(e.url).change()}),c(document.body).on("click",".image-uploader-btn",function(){a=c(this).parent().find("input[type=hidden]"),i=c(this).parent(),file_frame.open()}),c(document.body).on("click",".image-remove-btn",function(){$imgIdInput=c(this).parent().find("input[type=hidden]"),(i=c(this).parent()).hasClass("file-container")?i.find(".file-url").val(""):i.find("img").remove(),$imgIdInput.val("")}))},this.beutify_json_and_css=function(e){e.preventDefault();var t,i,a,e=($clicked_button=c(e.currentTarget)).parents(".hidden-action"),o=e.find(".field-wrap-record_type select").val(),e=(this.remove_errors(),c("textarea",e)),n=e.val();try{"json"==o?(t=jQuery.parseJSON(n))&&(n=JSON.stringify(t,null,"\t"))&&e.val(n):"xml"==o&&(i=jQuery.parseXML(n))&&(a=(new XMLSerializer).serializeToString(i),e.val(a))}catch(t){this.add_error(e,t)}},this.init_draggable=function(){var a=this;c("#the_list").sortable({items:".drag",axis:"y",helper:void 0,update:function(t,e){params={order:c("#the_list").sortable("serialize")},a.make_ajax_call("wpcf7r_set_action_menu_order",params,"after_ajax_call");var i=c(e.item).data("actionid");c(e.item).after(c(".action-container[data-actionid="+i+"]")),a.renumber_rows()}})},this.replace_query_var=function(t,e,i){var a=new RegExp("([?&])"+e+"=.*?(&|$)","i"),o=-1!==t.indexOf("?")?"&":"?";return t.match(a)?t.replace(a,"$1"+e+"="+i+"$2"):t+o+e+"="+i},this.renumber_rows=function(){numbering=1,c("#the_list tr .num:visible").each(function(){c(this).html(numbering),numbering++})},this.register_action_hooks=function(){c(document.body).on("click",this.add_and_selector,this.add_and_row.bind(this)),c(document.body).on("click",this.remove_and_selector,this.remove_and_row.bind(this)),c(document.body).on("click",this.add_group_button_selector,this.add_new_group.bind(this)),c(document.body).on("click",this.edit_block_title_selector,this.edit_block_title.bind(this)),c(document.body).on("click",this.cancel_block_title_selector,this.cancel_block_title_edit.bind(this)),c(document.body).on("click",this.save_block_title_edit_selector,this.save_block_title_edit.bind(this)),c(document.body).on("click",this.tab_title_selector,this.switch_tab.bind(this)),c(document.body).on("click",this.add_block_button_selector,this.add_new_block.bind(this)),c(document.body).on("click",this.remove_block_button_selector,this.remove_block.bind(this)),c(document.body).on("change",this.group_row_value_select_selector,this.set_select_value.bind(this)),c(document.body).on("change",this.group_select_field_selector,this.show_field_options.bind(this)),c(document.body).on("click",this.open_tab_selector,this.show_hide_tab.bind(this)),c(document.body).on("click",this.show_action_selector,this.show_hide_action.bind(this)),c(document.body).on("click",this.move_action_to_trash_selector,this.move_post_to_trash.bind(this)),c(document.body).on("click",this.move_lead_to_trash_selector,this.move_post_to_trash.bind(this)),c(document.body).on("wpcf7r_after_ajax_call",this.after_ajax_call.bind(this)),c(document.body).on("click",this.add_new_action_selector,this.add_new_action.bind(this)),c(document.body).on("change",this.custom_checkbox_selector,this.checkbox_changed.bind(this)),c(document.body).on("keyup",this.action_title_field,this.action_title_field_changed.bind(this)),c(document.body).on("click",this.migrate_from_cf7_api_selector,this.migrate_from_cf7_api.bind(this)),c(document.body).on("click",this.migrate_from_cf7_redirect_selector,this.migrate_from_cf7_api.bind(this)),c(document.body).on("click",this.butify_button_selector,this.beutify_json_and_css.bind(this)),c(document.body).on("click",this.add_repeater_field_selector,this.add_repeating_field.bind(this)),c(document.body).on("click",this.remove_repeater_field_selector,this.remove_repeating_field.bind(this)),c(document.body).on("click",this.api_test_button_selector,this.make_api_test_call.bind(this)),c(document.body).on("change",this.toggler_handler_selector,this.data_toggler.bind(this)),c(document.body).on("change",this.select_toggler_selector,this.select_toggler.bind(this)),c(document.body).on("click",this.mailchimp_get_lists,this.mailchimp_get_lists_handler.bind(this)),c(document.body).on("click",this.mailchimp_create_list,this.mailchimp_create_list_handler.bind(this)),c(document.body).on("change",this.mailchimp_list_selector,this.mailchimp_list_select_handler.bind(this)),c(document.body).on("click",this.reset_all_button,this.reset_all_settings.bind(this)),c(document.body).on("click",this.mail_tags_toggle,this.toggle_mail_tags.bind(this)),c(document.body).on("click",this.dupicate_action_selector,this.duplicate_action.bind(this)),c(document.body).on("click",this.close_popup_button_selector,this.close_popup.bind(this)),c(document.body).on("change",this.select_action_selector,this.select_action.bind(this))},this.close_popup=function(t){c(".wpcfr-popup-wrap").remove()},this.toggle_mail_tags=function(t){c(t.currentTarget).next().slideToggle("fast")},this.mailchimp_create_list_handler=function(t){c(t.currentTarget).parents(".action-container").first();var e=prompt("Please enter list name");null!=e&&this.mailchimp_get_lists_handler(t,e)},this.mailchimp_list_select_handler=function(t){var t=c(t.currentTarget).parents(".action-container").first(),e=t.find(".field-wrap-mailchimp_settings").data("lists"),i=t.find(this.mailchimp_list_selector).val(),e=this.maybe_parse_json(e);list_fields=e[i].list_fields,merge_tags_selects=t.find(".field-wrap-mailchimp_key select"),c.each(merge_tags_selects,function(t,i){c(i).html("");c(i).append('<option value="">Select field</option>'),c.each(list_fields,function(t,e){t='<option value="'+t+'">'+e+"</option>";c(i).append(t)})})},this.maybe_parse_json=function(e){try{a=JSON.parse(e)}catch(t){a=e}return a},this.mailchimp_get_lists_handler=function(t,e){var t=c(t.currentTarget),i=t.parents(".action-container").first();if(this.remove_errors(),!c(".wpcf7-redirect-mailchimp_api_key-fields").val())return this.add_error(".wpcf7-redirect-mailchimp_api_key-fields","Add your key and save the form"),!1;this.show_action_loader(t),params={action_id:this.get_block_action_id(t),mailchimp_api_key:i.find(".wpcf7-redirect-mailchimp_api_key-fields").val(),list_name:e},this.make_ajax_call("wpcf7r_get_mailchimp_lists",params,"after_ajax_call")},this.show_action_loader=function(t){t.parents(".field-wrap-test_section").first();this.show_loader(t.parents(".hidden-action").first())},this.select_toggler=function(t){var t=c(t.currentTarget),e=t.data("toggler-name"),t=t.val();c("."+e).hide(),t&&c("."+e+"_"+t).show()},this.select_action=function(t){"purchase"===c(t.currentTarget).find(":selected").attr("data-action")?c("a.wpcf7-add-new-action").text("Get Addon"):c("a.wpcf7-add-new-action").text("Add Action")},this.data_toggler=function(t){var t=c(t.currentTarget),e=t.parents(".action-container").first(),t=t.parents("[data-toggle]").data("toggle");t&&e.find(t).slideToggle("fast")},this.make_api_test_call=function(t){t.preventDefault();var t=c(t.currentTarget),e=t.parents(".field-wrap-test_section").first();this.show_loader(t.parents(".hidden-action").first()),params={action_id:t.data("action_id"),cf7_id:t.data("cf7_id"),rule_id:t.data("ruleid"),data:e.find("input").serialize()},this.make_ajax_call("wpcf7r_make_api_test",params,"after_ajax_call")},this.remove_repeating_field=function(t){t.preventDefault(),c(t.currentTarget).parents(".qs-repeater-row").remove()},this.add_repeating_field=function(t){t.preventDefault();var t=c(t.currentTarget).parents("[data-repeater-template]"),e=t.find("[data-repeater-row-count]").last().data("repeater-row-count"),i=(e++,t.data("repeater-template"));template_html=this.replaceAll(i.template,"new_row",e),t.append(template_html),c(document.body).trigger("added-repeating-row",[t])},this.migrate_from_cf7_api=function(t){t.preventDefault(),$clicked_button=c(t.currentTarget),this.show_loader($clicked_button.parents(".actions-list")),params={post_id:$clicked_button.data("id"),rule_id:$clicked_button.data("ruleid"),action_type:$clicked_button.data("migration-type")},this.make_ajax_call("wpcf7r_add_action",params,"after_ajax_call"),$clicked_button.fadeOut(function(){c(this).remove()})},this.action_title_field_changed=function(t){t.preventDefault(),$changed_title=c(t.currentTarget),action_id=this.get_block_action_id($changed_title),c('.primary[data-actionid="'+action_id+'"] .column-post-title').html($changed_title.val())},this.checkbox_changed=function(t){t.preventDefault(),$clicked_button=c(t.currentTarget),checkbox_on=$clicked_button.is(":checked"),$parent_element=$clicked_button.parents(".hidden-action"),$field_wrap=$clicked_button.parents(".field-wrap").first(),$clicked_button.data("toggle-label")&&(toggle_data=$clicked_button.data("toggle-label"),jQuery.each(toggle_data,function(t,e){string=checkbox_on?e[0]:e[1],$parent_element.find(t).html(string)}))},this.add_new_action=function(t){t.preventDefault();var e=($clicked_button=c(t.currentTarget)).siblings(".new-action-selector"),i=e.val();if(this.remove_errors(),!i)return this.add_error(".new-action-selector","Please choose an action"),!1;"purchase"===e.find(":selected").data("action")?(t.preventDefault(),window.open(i,"_blank")):(this.show_loader($clicked_button.parents(".actions-list")),params={post_id:$clicked_button.data("id"),rule_id:$clicked_button.data("ruleid"),action_type:i},c(".hidden-action").slideUp("fast"),this.make_ajax_call("wpcf7r_add_action",params,"after_ajax_call"))},this.remove_errors=function(){c(".error-message").removeClass("error-message"),c(".error-label").remove()},this.add_error=function(t,e){c(t).addClass("error-message").after('<span class="error-label">'+e+"</span>")},this.show_loader=function(t){c(t).append('<div class="wpcf7r_loader"></div>'),c(".wpcf7r_loader").addClass("active")},this.hide_loader=function(){c(".wpcf7r_loader").fadeOut(function(){c(this).remove()})},this.after_ajax_call=function(t,e,i,a){var o,n=this;"wpcf7r_delete_action"===a&&c(e).each(function(t,e){c('[data-actionid="'+e.post_id+'"]').fadeOut(function(){c(this).remove(),n.renumber_rows()}),c('[data-postid="'+e.post_id+'"]').fadeOut(function(){c(this).remove()})}),"wpcf7r_add_action"!==a&&"wpcf7r_duplicate_action"!=a||(c("[data-wrapid="+e.rule_id+"] #the_list:visible").append(i.action_row),$new_action_wrap=c("[data-wrapid="+e.rule_id+"] #the_list > tr.action-container").last(),n.init_select2(),n.renumber_rows(),n.init_colorpickers(),n.init_editors($new_action_wrap)),"wpcf7r_reset_settings"===a&&window.location.reload(),"wpcf7r_make_api_test"===a&&(o=c("[data-actionid="+e.action_id+"] .field-wrap-test_section"),c("span.err").remove(),void 0!==i.status&&"failed"===i.status?c.each(i.invalid_fields,function(t,e){o.find("."+t).append('<span class="err">'+e.reason+"</span>")}):c("body").append(i.html)),"wpcf7r_get_mailchimp_lists"===a&&(o=c("[data-actionid="+e.action_id+"]"),$lists_select=o.find(".field-wrap-mailchimp_list_id select"),$api_key_input=o.find(".field-wrap-mailchimp_api_key"),$lists_select.html(""),void 0!==i.error&&i.error?this.add_error($api_key_input,i.error):(o.find(".field-wrap-mailchimp_settings").attr("data-lists",JSON.stringify(i.lists)).data("lists",JSON.stringify(i.lists)),c.each(i.lists,function(t,e){e='<option value="'+e.list_id+'">'+e.list_name+"</option>";$lists_select.append(e)}),$lists_select.change())),this.hide_loader()},this.duplicate_action=function(t){t.preventDefault(),$clicked_button=c(t.currentTarget),this.show_loader($clicked_button.parents("td")),params={post_id:$clicked_button.data("id"),form_id:c("#post_ID").val(),rule_id:$clicked_button.data("ruleid")},this.make_ajax_call("wpcf7r_duplicate_action",params,"after_ajax_call")},this.move_post_to_trash=function(t){t.preventDefault(),$clicked_button=c(t.currentTarget),this.show_loader($clicked_button.parents("td")),params=[{post_id:$clicked_button.data("id")}],this.make_ajax_call("wpcf7r_delete_action",params,"ater_ajax_delete")},this.show_hide_action=function(t){t.preventDefault(),$clicked_button=c(t.currentTarget),$hidden_action_to_show=$clicked_button.parents("tr").next().find(".hidden-action"),c(".hidden-action").not($hidden_action_to_show).slideUp("fast"),$hidden_action_to_show.slideToggle("fast")},this.show_hide_tab=function(t){t=($clicked_tab=c(t.currentTarget)).data("tab-target");$clicked_tab.toggleClass("active"),c("[data-tab="+t+"]").slideToggle("fast")},this.hide_select_options=function(t){c(".row-template .wpcf7r-fields").each(function(){c(this).trigger("change")})},this.show_field_options=function(t){$changed_select=c(t.currentTarget),$row=$changed_select.parents(".row-template"),$elem_to_show=$changed_select.val()?$row.find(".group_row_value[data-rel="+$changed_select.val()+"]"):"",$row.find(".group_row_value").hide(),($elem_to_show.length?($elem_to_show.show(),$row.find(".compare-options option").hide(),$row.find(".compare-options option[data-comparetype=select]")):($row.find(".compare-options option").show(),$row.find(".wpcf7-redirect-value"))).show()},this.set_select_value=function(t){($changed_select=c(t.currentTarget)).siblings(".wpcf7-redirect-value").val($changed_select.val())},this.remove_block=function(t){t.preventDefault(),$clicked_button=c(t.currentTarget);t=($clicked_button_parent=$clicked_button.parents(".block-title").first()).data("rel");$clicked_button_parent.prev().click(),c(".conditional-group-block[data-block-id="+t+"]").remove(),c(".block-title[data-rel="+t+"]").remove()},this.add_new_block=function(t){this.new_block_counter++,$clicked_button=c(t.currentTarget),action_id=this.get_block_action_id($clicked_button),html_block_template=wpcfr_template.block_html,block_title_html=wpcfr_template.block_title_html,html_block_template=this.replaceAll(html_block_template,"new_block","block_"+this.new_block_counter),html_block_template=this.replaceAll(html_block_template,"action_id",action_id),block_title_html=this.replaceAll(block_title_html,"new_block","block_"+this.new_block_counter),block_title_html=this.replaceAll(block_title_html,"action_id",action_id),c(this.tab_title_all_selector).last().after(block_title_html),c(this.blocks_container_selector).append(html_block_template),c(this.tab_title_all_selector).last().click()},this.switch_tab=function(t){t.preventDefault();t=($clicked_button=c(t.currentTarget)).data("rel"),t=c("[data-block-id="+t+"]");c(this.active_tab_selector).removeClass("active"),c(this.tab_title_active_selector).removeClass("active"),$clicked_button.addClass("active"),t.addClass("active")},this.save_block_title_edit=function(t){t.preventDefault();t=($clicked_button=c(t.currentTarget)).data("rel"),t=c("[data-block-id="+t+"]");$clicked_button.siblings("input").attr("readonly","readonly"),$clicked_button.parent().removeClass("edit"),t.find(this.tab_inner_title).html($clicked_button.siblings("input").val())},this.cancel_block_title_edit=function(t){t.preventDefault();t=($clicked_button=c(t.currentTarget)).data("rel"),t=c("[data-block-id="+t+"]");$clicked_button.siblings("input").val($clicked_button.siblings("input").data("original")).attr("readonly","readonly"),$clicked_button.parent().removeClass("edit"),t.find(this.tab_inner_title).html($clicked_button.siblings("input").val())},this.edit_block_title=function(t){t.preventDefault(),($clicked_button=c(t.currentTarget)).parent().addClass("edit"),$clicked_button.siblings("input").removeAttr("readonly")},this.add_new_group=function(t){t.preventDefault(),$clicked_button=c(t.currentTarget);var t=this.get_block_action_id($clicked_button),e=$clicked_button.parents(".conditional-group-blocks").find(".wpcfr-rule-groups");this.new_group_counter=e.find(".wpcfr-rule-group").length,this.new_group_counter++,group_html=wpcfr_template.group_html,group_html=this.replaceAll(group_html,"group-new_group","group-"+this.new_group_counter),group_html=this.replaceAll(group_html,"new_group","group-"+this.new_group_counter),group_html=this.replaceAll(group_html,"new_block","block_1"),group_html=this.replaceAll(group_html,"action_id",t),e.append(group_html)},this.remove_and_row=function(t){t.preventDefault(),(1==($clicked_button=c(t.currentTarget)).parents(this.rule_group_selector).find(".row-template").length?$clicked_button.parents(this.rule_group_selector):$clicked_button.parents(this.row_template_selector)).remove()},this.get_block_action_id=function(t){return t.parents("[data-actionid]").data("actionid")},this.add_and_row=function(t){t.preventDefault(),$clicked_button=c(t.currentTarget),action_id=this.get_block_action_id($clicked_button),block_id="block_1",group_id=$clicked_button.parents("[data-group-id]").first().data("group-id"),this.new_row_counter||($repeater_block=$clicked_button.parents(".repeater-table"),this.new_row_counter=$repeater_block.find(".row-template").length),this.new_row_counter++,c(wpcfr_template.row_html).find(this.add_and_selector).remove(),row_html=wpcfr_template.row_html,row_html=this.replaceAll(row_html,"new_block",block_id),row_html=this.replaceAll(row_html,"new_group",group_id),row_html=this.replaceAll(row_html,"new_row","row-"+this.new_row_counter),row_html=this.replaceAll(row_html,"action_id",action_id),$clicked_button.parents("table").first().find("tbody").append(row_html)},this.replaceAll=function(t,e,i){return t.replace(new RegExp(e,"g"),i)},this.admin_fields_init=function(){c(".field-wrap input[type=checkbox],.field-wrap select").each(function(){c(this).is(":checked")&&c(this).siblings(".field-notice-hidden").removeClass("field-notice-hidden").addClass("field-notice-show")}),c(".wpcf7-redirect-after-sent-script").each(function(){c(this).val()&&c(this).siblings(".field-warning-alert").removeClass("field-notice-hidden")})},this.admin_field_handlers=function(){this.admin_fields_init(),c(document.body).on("change",".field-wrap input[type=checkbox],.field-wrap select",function(){c(this).is(":checked")?c(this).siblings(".field-notice-hidden").removeClass("field-notice-hidden").addClass("field-notice-show"):c(this).siblings(".field-notice-show").addClass("field-notice-hidden").removeClass("field-notice-show")}),c(document.body).on("keyup",".wpcf7-redirect-after-sent-script",function(t){0!=c(this).val().length?c(this).siblings(".field-warning-alert").removeClass("field-notice-hidden"):c(this).siblings(".field-warning-alert").addClass("field-notice-hidden")}),c(document.body).on("change",".checkbox-radio-1",function(){var t=c(this).is(":checked");c(".checkbox-radio-1").prop("checked",!1),t&&c(this).prop("checked",!0)})},this.reset_all_settings=function(t){t.preventDefault();confirm("Are you sure? this process will delete all of your plugin settings. There is no way back from this process!")&&this.make_ajax_call("wpcf7r_reset_settings",[])},this.make_ajax_call=function(e,i){jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:{action:e,data:i,wpcf7r_nonce:wpcf_get_nonce()},success:function(t){c(document.body).trigger("wpcf7r_after_ajax_call",[i,t,e])}})},this.init()}c(document).ready(function(){wpcf7_redirect_admin=new t,c(document.body).trigger("wpcf7r-loaded",wpcf7_redirect_admin)})}(jQuery);
function disply_updates_marks(){var e=jQuery(".extensions-list .has-update").length;e&&jQuery("li#extensions-panel-tab a").append(' <span class="update-plugins wpcf7r-update-extensions"><span class="plugin-count">'+e+"</span></span>")}function set_event_listeneres(){activate_serial_handler(),close_promo_box(),serial_activation_handler(),extension_deactivate_handler(),extension_update_handler()}function extension_update_handler(){jQuery(".extensions").on("click",".promo-box .btn-update",function(e){e.preventDefault(),show_extension_loader($extension=jQuery(this).parents(".promo-box")),update_wpcf7r_extension($extension)})}function activate_serial_handler(){jQuery(".extensions").on("click",".promo-box .btn-activate",function(e){e.preventDefault(),jQuery(this).parents(".promo-box").find(".serial").addClass("open")})}function close_promo_box(){jQuery(".extensions").on("click",".promo-box .btn-close",function(e){e.preventDefault(),jQuery(this).parents(".promo-box").find(".serial").removeClass("open")})}function serial_activation_handler(){jQuery(".extensions").on("click",".promo-box .btn-activate-serial",function(e){e.preventDefault();e=($extension=jQuery(this).parents(".promo-box")).find(".serial-number").val();if(!e)return $extension.find(".serial-number").addClass("err"),!1;$extension.find(".serial-number").removeClass("err"),show_extension_loader($extension),activate_extension($extension,e)})}function extension_deactivate_handler(){jQuery(".extensions").on("click",".promo-box .btn-deactivate",function(e){e.preventDefault(),show_extension_loader($extension=jQuery(this).parents(".promo-box")),deactivate_plugin_license($extension)})}function show_extension_loader(e){e.append('<div class="wpcf7r_loader active"></div>')}function deactivate_plugin_license(n){var e=n.data("extension");jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:{action:"deactivate_wpcf7r_extension",extension_name:e,wpcf7r_nonce:wpcf_get_nonce()},success:function(e){console.log(e),void 0!==e.error?jQuery(".actions").after('<div class="err">'+e.error+"</div>"):void 0!==e.extension_html&&n.replaceWith(e.extension_html),remove_extension_loader()}})}function remove_extension_loader(){jQuery(".wpcf7r_loader").remove()}function update_wpcf7r_extension(n){var e=n.data("extension");jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:{action:"wpcf7r_extension_update",extension_name:e,wpcf7r_nonce:wpcf_get_nonce()},success:function(e){"undefined"!=e.extension_html&&e.extension_html?n.replaceWith(e.extension_html):void 0!==e.error&&e.error&&jQuery(".actions").after('<div class="err">'+e.error+"</div>"),remove_extension_loader()}})}function activate_extension(n,e){var t=n.data("extension");jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:{action:"activate_wpcf7r_extension",extension_name:t,serial:e,wpcf7r_nonce:wpcf_get_nonce()},success:function(e){"undefined"!=e.extension_html&&e.extension_html?(n.replaceWith(e.extension_html),window.location.reload()):void 0!==e.error&&e.error&&(n.find(".err").remove(),n.append('<div class="err">'+e.error+"</div>")),remove_extension_loader()}})}jQuery(document).ready(function(){set_event_listeneres(),disply_updates_marks()});