!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=n(require("jquery")):n(jQuery)}(function(n){n.extend(n.fn,{validate:function(t){if(!this.length)return void(t&&t.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var i=n.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new n.validator(t,this[0]),n.data(this[0],"validator",i),i.settings.onsubmit&&(this.on("click.validate",":submit",function(t){i.submitButton=t.currentTarget;n(this).hasClass("cancel")&&(i.cancelSubmit=!0);void 0!==n(this).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.on("submit.validate",function(t){function r(){var r,u;return i.submitButton&&(i.settings.submitHandler||i.formSubmitted)&&(r=n("<input type='hidden'/>").attr("name",i.submitButton.name).val(n(i.submitButton).val()).appendTo(i.currentForm)),!(i.settings.submitHandler&&!i.settings.debug)||(u=i.settings.submitHandler.call(i,i.currentForm,t),r&&r.remove(),void 0!==u&&u)}return i.settings.debug&&t.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,r()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):r():(i.focusInvalid(),!1)})),i)},valid:function(){var t,i,r;return n(this[0]).is("form")?t=this.validate().form():(r=[],t=!0,i=n(this[0].form).validate(),this.each(function(){t=i.element(this)&&t;t||(r=r.concat(i.errorList))}),i.errorList=r),t},rules:function(t,i){var e,s,f,u,o,h,r=this[0],c="undefined"!=typeof this.attr("contenteditable")&&"false"!==this.attr("contenteditable");if(null!=r&&(!r.form&&c&&(r.form=this.closest("form")[0],r.name=this.attr("name")),null!=r.form)){if(t)switch(e=n.data(r.form,"validator").settings,s=e.rules,f=n.validator.staticRules(r),t){case"add":n.extend(f,n.validator.normalizeRule(i));delete f.messages;s[r.name]=f;i.messages&&(e.messages[r.name]=n.extend(e.messages[r.name],i.messages));break;case"remove":return i?(h={},n.each(i.split(/\s/),function(n,t){h[t]=f[t];delete f[t]}),h):(delete s[r.name],f)}return u=n.validator.normalizeRules(n.extend({},n.validator.classRules(r),n.validator.attributeRules(r),n.validator.dataRules(r),n.validator.staticRules(r)),r),u.required&&(o=u.required,delete u.required,u=n.extend({required:o},u)),u.remote&&(o=u.remote,delete u.remote,u=n.extend(u,{remote:o})),u}}});n.extend(n.expr.pseudos||n.expr[":"],{blank:function(t){return!n.trim(""+n(t).val())},filled:function(t){var i=n(t).val();return null!==i&&!!n.trim(""+i)},unchecked:function(t){return!n(t).prop("checked")}});n.validator=function(t,i){this.settings=n.extend(!0,{},n.validator.defaults,t);this.currentForm=i;this.init()};n.validator.format=function(t,i){return 1===arguments.length?function(){var i=n.makeArray(arguments);return i.unshift(t),n.validator.format.apply(this,i)}:void 0===i?t:(arguments.length>2&&i.constructor!==Array&&(i=n.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),n.each(i,function(n,i){t=t.replace(new RegExp("\\{"+n+"\\}","g"),function(){return i})}),t)};n.extend(n.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:n([]),errorLabelContainer:n([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(n){this.lastActive=n;this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,n,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(n)))},onfocusout:function(n){!this.checkable(n)&&(n.name in this.submitted||!this.optional(n))&&this.element(n)},onkeyup:function(t,i){9===i.which&&""===this.elementValue(t)||n.inArray(i.keyCode,[16,17,18,20,35,36,37,38,39,40,45,144,225])!==-1||(t.name in this.submitted||t.name in this.invalid)&&this.element(t)},onclick:function(n){n.name in this.submitted?this.element(n):n.parentNode.name in this.submitted&&this.element(n.parentNode)},highlight:function(t,i,r){"radio"===t.type?this.findByName(t.name).addClass(i).removeClass(r):n(t).addClass(i).removeClass(r)},unhighlight:function(t,i,r){"radio"===t.type?this.findByName(t.name).removeClass(i).addClass(r):n(t).removeClass(i).addClass(r)}},setDefaults:function(t){n.extend(n.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:n.validator.format("Please enter no more than {0} characters."),minlength:n.validator.format("Please enter at least {0} characters."),rangelength:n.validator.format("Please enter a value between {0} and {1} characters long."),range:n.validator.format("Please enter a value between {0} and {1}."),max:n.validator.format("Please enter a value less than or equal to {0}."),min:n.validator.format("Please enter a value greater than or equal to {0}."),step:n.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function i(t){var e="undefined"!=typeof n(this).attr("contenteditable")&&"false"!==n(this).attr("contenteditable");if(!this.form&&e&&(this.form=n(this).closest("form")[0],this.name=n(this).attr("name")),r===this.form){var u=n.data(this.form,"validator"),f="on"+t.type.replace(/^validate/,""),i=u.settings;i[f]&&!n(this).is(i.ignore)&&i[f].call(u,this,t)}}this.labelContainer=n(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||n(this.currentForm);this.containers=n(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var t,r=this.currentForm,u=this.groups={};n.each(this.settings.groups,function(t,i){"string"==typeof i&&(i=i.split(/\s/));n.each(i,function(n,i){u[i]=t})});t=this.settings.rules;n.each(t,function(i,r){t[i]=n.validator.normalizeRule(r)});n(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']",i).on("click.validate","select, option, [type='radio'], [type='checkbox']",i);this.settings.invalidHandler&&n(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),n.extend(this.submitted,this.errorMap),this.invalid=n.extend({},this.errorMap),this.valid()||n(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var n=0,t=this.currentElements=this.elements();t[n];n++)this.check(t[n]);return this.valid()},element:function(t){var e,o,i=this.clean(t),r=this.validationTargetFor(i),u=this,f=!0;return void 0===r?delete this.invalid[i.name]:(this.prepareElement(r),this.currentElements=n(r),o=this.groups[r.name],o&&n.each(this.groups,function(n,t){t===o&&n!==r.name&&(i=u.validationTargetFor(u.clean(u.findByName(n))),i&&i.name in u.invalid&&(u.currentElements.push(i),f=u.check(i)&&f))}),e=this.check(r)!==!1,f=f&&e,this.invalid[r.name]=e?!1:!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),n(t).attr("aria-invalid",!e)),f},showErrors:function(t){if(t){var i=this;n.extend(this.errorMap,t);this.errorList=n.map(this.errorMap,function(n,t){return{message:n,element:i.findByName(t)[0]}});this.successList=n.grep(this.successList,function(n){return!(n.name in t)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){n.fn.resetForm&&n(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(n){var t;if(this.settings.unhighlight)for(t=0;n[t];t++)this.settings.unhighlight.call(this,n[t],this.settings.errorClass,""),this.findByName(n[t].name).removeClass(this.settings.validClass);else n.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(n){var t,i=0;for(t in n)void 0!==n[t]&&null!==n[t]&&n[t]!==!1&&i++;return i},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(n){n.not(this.containers).text("");this.addWrapper(n).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{n(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var t=this.lastActive;return t&&1===n.grep(this.errorList,function(n){return n.element.name===t.name}).length&&t},elements:function(){var t=this,i={};return n(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var r=this.name||n(this).attr("name"),u="undefined"!=typeof n(this).attr("contenteditable")&&"false"!==n(this).attr("contenteditable");return!r&&t.settings.debug&&window.console&&console.error("%o has no name assigned",this),u&&(this.form=n(this).closest("form")[0],this.name=r),this.form===t.currentForm&&!(r in i||!t.objectLength(n(this).rules()))&&(i[r]=!0,!0)})},clean:function(t){return n(t)[0]},errors:function(){var t=this.settings.errorClass.split(" ").join(".");return n(this.settings.errorElement+"."+t,this.errorContext)},resetInternals:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=n([]);this.toHide=n([])},reset:function(){this.resetInternals();this.currentElements=n([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(n){this.reset();this.toHide=this.errorsFor(n)},elementValue:function(t){var i,r,u=n(t),f=t.type,e="undefined"!=typeof u.attr("contenteditable")&&"false"!==u.attr("contenteditable");return"radio"===f||"checkbox"===f?this.findByName(t.name).filter(":checked").val():"number"===f&&"undefined"!=typeof t.validity?t.validity.badInput?"NaN":u.val():(i=e?u.text():u.val(),"file"===f?"C:\\fakepath\\"===i.substr(0,12)?i.substr(12):(r=i.lastIndexOf("/"),r>=0?i.substr(r+1):(r=i.lastIndexOf("\\"),r>=0?i.substr(r+1):i)):"string"==typeof i?i.replace(/\r/g,""):i)},check:function(t){t=this.validationTargetFor(this.clean(t));var u,f,r,e,i=n(t).rules(),c=n.map(i,function(n,t){return t}).length,s=!1,h=this.elementValue(t);"function"==typeof i.normalizer?e=i.normalizer:"function"==typeof this.settings.normalizer&&(e=this.settings.normalizer);e&&(h=e.call(t,h),delete i.normalizer);for(f in i){r={method:f,parameters:i[f]};try{if(u=n.validator.methods[f].call(this,h,t,r.parameters),"dependency-mismatch"===u&&1===c){s=!0;continue}if(s=!1,"pending"===u)return void(this.toHide=this.toHide.not(this.errorsFor(t)));if(!u)return this.formatAndAdd(t,r),!1}catch(o){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+t.id+", check the '"+r.method+"' method.",o),o instanceof TypeError&&(o.message+=".  Exception occurred when checking element "+t.id+", check the '"+r.method+"' method."),o;}}if(!s)return this.objectLength(i)&&this.successList.push(t),!0},customDataMessage:function(t,i){return n(t).data("msg"+i.charAt(0).toUpperCase()+i.substring(1).toLowerCase())||n(t).data("msg")},customMessage:function(n,t){var i=this.settings.messages[n];return i&&(i.constructor===String?i:i[t])},findDefined:function(){for(var n=0;n<arguments.length;n++)if(void 0!==arguments[n])return arguments[n]},defaultMessage:function(t,i){"string"==typeof i&&(i={method:i});var r=this.findDefined(this.customMessage(t.name,i.method),this.customDataMessage(t,i.method),!this.settings.ignoreTitle&&t.title||void 0,n.validator.messages[i.method],"<strong>Warning: No message defined for "+t.name+"<\/strong>"),u=/\$?\{(\d+)\}/g;return"function"==typeof r?r=r.call(this,i.parameters,t):u.test(r)&&(r=n.validator.format(r.replace(u,"{$1}"),i.parameters)),r},formatAndAdd:function(n,t){var i=this.defaultMessage(n,t);this.errorList.push({message:i,element:n,method:t.method});this.errorMap[n.name]=i;this.submitted[n.name]=i},addWrapper:function(n){return this.settings.wrapper&&(n=n.add(n.parent(this.settings.wrapper))),n},defaultShowErrors:function(){for(var i,t,n=0;this.errorList[n];n++)t=this.errorList[n],this.settings.highlight&&this.settings.highlight.call(this,t.element,this.settings.errorClass,this.settings.validClass),this.showLabel(t.element,t.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(n=0;this.successList[n];n++)this.showLabel(this.successList[n]);if(this.settings.unhighlight)for(n=0,i=this.validElements();i[n];n++)this.settings.unhighlight.call(this,i[n],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 n(this.errorList).map(function(){return this.element})},showLabel:function(t,i){var u,s,e,o,r=this.errorsFor(t),h=this.idOrName(t),f=n(t).attr("aria-describedby");r.length?(r.removeClass(this.settings.validClass).addClass(this.settings.errorClass),r.html(i)):(r=n("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(i||""),u=r,this.settings.wrapper&&(u=r.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(u):this.settings.errorPlacement?this.settings.errorPlacement.call(this,u,n(t)):u.insertAfter(t),r.is("label")?r.attr("for",h):0===r.parents("label[for='"+this.escapeCssMeta(h)+"']").length&&(e=r.attr("id"),f?f.match(new RegExp("\\b"+this.escapeCssMeta(e)+"\\b"))||(f+=" "+e):f=e,n(t).attr("aria-describedby",f),s=this.groups[t.name],s&&(o=this,n.each(o.groups,function(t,i){i===s&&n("[name='"+o.escapeCssMeta(t)+"']",o.currentForm).attr("aria-describedby",r.attr("id"))}))));!i&&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 r=this.escapeCssMeta(this.idOrName(t)),u=n(t).attr("aria-describedby"),i="label[for='"+r+"'], label[for='"+r+"'] *";return u&&(i=i+", #"+this.escapeCssMeta(u).replace(/\s+/g,", #")),this.errors().filter(i)},escapeCssMeta:function(n){return n.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(n){return this.groups[n.name]||(this.checkable(n)?n.name:n.id||n.name)},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name)),n(t).not(this.settings.ignore)[0]},checkable:function(n){return/radio|checkbox/i.test(n.type)},findByName:function(t){return n(this.currentForm).find("[name='"+this.escapeCssMeta(t)+"']")},getLength:function(t,i){switch(i.nodeName.toLowerCase()){case"select":return n("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return t.length},depend:function(n,t){return!this.dependTypes[typeof n]||this.dependTypes[typeof n](n,t)},dependTypes:{boolean:function(n){return n},string:function(t,i){return!!n(t,i.form).length},"function":function(n,t){return n(t)}},optional:function(t){var i=this.elementValue(t);return!n.validator.methods.required.call(this,i,t)&&"dependency-mismatch"},startRequest:function(t){this.pending[t.name]||(this.pendingRequest++,n(t).addClass(this.settings.pendingClass),this.pending[t.name]=!0)},stopRequest:function(t,i){this.pendingRequest--;this.pendingRequest<0&&(this.pendingRequest=0);delete this.pending[t.name];n(t).removeClass(this.settings.pendingClass);i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(n(this.currentForm).submit(),this.submitButton&&n("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(n(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t,i){return i="string"==typeof i&&i||"remote",n.data(t,"previousValue")||n.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,{method:i})})},destroy:function(){this.resetForm();n(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,i){t.constructor===String?this.classRuleSettings[t]=i:n.extend(this.classRuleSettings,t)},classRules:function(t){var i={},r=n(t).attr("class");return r&&n.each(r.split(" "),function(){this in n.validator.classRuleSettings&&n.extend(i,n.validator.classRuleSettings[this])}),i},normalizeAttributeRule:function(n,t,i,r){/min|max|step/.test(i)&&(null===t||/number|range|text/.test(t))&&(r=Number(r),isNaN(r)&&(r=void 0));r||0===r?n[i]=r:t===i&&"range"!==t&&(n[i]=!0)},attributeRules:function(t){var r,i,u={},f=n(t),e=t.getAttribute("type");for(r in n.validator.methods)"required"===r?(i=t.getAttribute(r),""===i&&(i=!0),i=!!i):i=f.attr(r),this.normalizeAttributeRule(u,e,r,i);return u.maxlength&&/-1|2147483647|524288/.test(u.maxlength)&&delete u.maxlength,u},dataRules:function(t){var i,r,u={},f=n(t),e=t.getAttribute("type");for(i in n.validator.methods)r=f.data("rule"+i.charAt(0).toUpperCase()+i.substring(1).toLowerCase()),""===r&&(r=!0),this.normalizeAttributeRule(u,e,i,r);return u},staticRules:function(t){var i={},r=n.data(t.form,"validator");return r.settings.rules&&(i=n.validator.normalizeRule(r.settings.rules[t.name])||{}),i},normalizeRules:function(t,i){return n.each(t,function(r,u){if(u===!1)return void delete t[r];if(u.param||u.depends){var f=!0;switch(typeof u.depends){case"string":f=!!n(u.depends,i.form).length;break;case"function":f=u.depends.call(i,i)}f?t[r]=void 0===u.param||u.param:(n.data(i.form,"validator").resetElements(n(i)),delete t[r])}}),n.each(t,function(r,u){t[r]=n.isFunction(u)&&"normalizer"!==r?u(i):u}),n.each(["minlength","maxlength"],function(){t[this]&&(t[this]=Number(t[this]))}),n.each(["rangelength","range"],function(){var i;t[this]&&(n.isArray(t[this])?t[this]=[Number(t[this][0]),Number(t[this][1])]:"string"==typeof t[this]&&(i=t[this].replace(/[\[\]]/g,"").split(/[\s,]+/),t[this]=[Number(i[0]),Number(i[1])]))}),n.validator.autoCreateRanges&&(null!=t.min&&null!=t.max&&(t.range=[t.min,t.max],delete t.min,delete t.max),null!=t.minlength&&null!=t.maxlength&&(t.rangelength=[t.minlength,t.maxlength],delete t.minlength,delete t.maxlength)),t},normalizeRule:function(t){if("string"==typeof t){var i={};n.each(t.split(/\s/),function(){i[this]=!0});t=i}return t},addMethod:function(t,i,r){n.validator.methods[t]=i;n.validator.messages[t]=void 0!==r?r:n.validator.messages[t];i.length<3&&n.validator.addClassRules(t,n.validator.normalizeRule(t))},methods:{required:function(t,i,r){if(!this.depend(r,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var u=n(i).val();return u&&u.length>0}return this.checkable(i)?this.getLength(t,i)>0:void 0!==t&&null!==t&&t.length>0},email:function(n,t){return this.optional(t)||/^[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(n)},url:function(n,t){return this.optional(t)||/^(?:(?:(?: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(n)},date:function(){var n=!1;return function(t,i){return n||(n=!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(i)||!/Invalid|NaN/.test(new Date(t).toString())}}(),dateISO:function(n,t){return this.optional(t)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(n)},number:function(n,t){return this.optional(t)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(n)},digits:function(n,t){return this.optional(t)||/^\d+$/.test(n)},minlength:function(t,i,r){var u=n.isArray(t)?t.length:this.getLength(t,i);return this.optional(i)||u>=r},maxlength:function(t,i,r){var u=n.isArray(t)?t.length:this.getLength(t,i);return this.optional(i)||u<=r},rangelength:function(t,i,r){var u=n.isArray(t)?t.length:this.getLength(t,i);return this.optional(i)||u>=r[0]&&u<=r[1]},min:function(n,t,i){return this.optional(t)||n>=i},max:function(n,t,i){return this.optional(t)||n<=i},range:function(n,t,i){return this.optional(t)||n>=i[0]&&n<=i[1]},step:function(t,i,r){var u,f=n(i).attr("type"),h="Step attribute on input type "+f+" is not supported.",c=new RegExp("\\b"+f+"\\b"),l=f&&!c.test("text,number,range"),e=function(n){var t=(""+n).match(/(?:\.(\d+))?$/);return t&&t[1]?t[1].length:0},o=function(n){return Math.round(n*Math.pow(10,u))},s=!0;if(l)throw new Error(h);return u=e(r),(e(t)>u||o(t)%o(r)!=0)&&(s=!1),this.optional(i)||s},equalTo:function(t,i,r){var u=n(r);return this.settings.onfocusout&&u.not(".validate-equalTo-blur").length&&u.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){n(i).valid()}),t===u.val()},remote:function(t,i,r,u){if(this.optional(i))return"dependency-mismatch";u="string"==typeof u&&u||"remote";var f,o,s,e=this.previousValue(i,u);return this.settings.messages[i.name]||(this.settings.messages[i.name]={}),e.originalMessage=e.originalMessage||this.settings.messages[i.name][u],this.settings.messages[i.name][u]=e.message,r="string"==typeof r&&{url:r}||r,s=n.param(n.extend({data:t},r.data)),e.old===s?e.valid:(e.old=s,f=this,this.startRequest(i),o={},o[i.name]=t,n.ajax(n.extend(!0,{mode:"abort",port:"validate"+i.name,dataType:"json",data:o,context:f.currentForm,success:function(n){var r,s,h,o=n===!0||"true"===n;f.settings.messages[i.name][u]=e.originalMessage;o?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(i),f.formSubmitted=h,f.successList.push(i),f.invalid[i.name]=!1,f.showErrors()):(r={},s=n||f.defaultMessage(i,{method:u,parameters:t}),r[i.name]=e.message=s,f.invalid[i.name]=!0,f.showErrors(r));e.valid=o;f.stopRequest(i,o)}},r)),"pending")}}});var i,t={};return n.ajaxPrefilter?n.ajaxPrefilter(function(n,i,r){var u=n.port;"abort"===n.mode&&(t[u]&&t[u].abort(),t[u]=r)}):(i=n.ajax,n.ajax=function(r){var f=("mode"in r?r:n.ajaxSettings).mode,u=("port"in r?r:n.ajaxSettings).port;return"abort"===f?(t[u]&&t[u].abort(),t[u]=i.apply(this,arguments),t[u]):i.apply(this,arguments)}),n});if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(void 0!==i.style[n])return{end:t[n]}}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one(n.support.transition.end,function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){n.support.transition=t()})}(jQuery);+function(n){"use strict";var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.prototype.close=function(t){function f(){i.trigger("closed.bs.alert").remove()}var u=n(this),r=u.attr("data-target"),i;r||(r=u.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));i=n(r);t&&t.preventDefault();i.length||(i=u.hasClass("alert")?u:u.parent());i.trigger(t=n.Event("close.bs.alert"));t.isDefaultPrevented()||(i.removeClass("in"),n.support.transition&&i.hasClass("fade")?i.one(n.support.transition.end,f).emulateTransitionEnd(150):f())};r=n.fn.alert;n.fn.alert=function(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));"string"==typeof i&&u[i].call(r)})};n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery);+function(n){"use strict";var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r)},i;t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(n){var i="disabled",t=this.$element,r=t.is("input")?"val":"html",u=t.data();n+="Text";u.resetText||t.data("resetText",t[r]());t[r](u[n]||this.options[n]);setTimeout(function(){"loadingText"==n?t.addClass(i).attr(i,i):t.removeClass(i).removeAttr(i)},0)};t.prototype.toggle=function(){var i=this.$element.closest('[data-toggle="buttons"]'),t=!0,n;i.length&&(n=this.$element.find("input"),"radio"===n.prop("type")&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:i.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change"));t&&this.$element.toggleClass("active")};i=n.fn.button;n.fn.button=function(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f="object"==typeof i&&i;r||u.data("bs.button",r=new t(this,f));"toggle"==i?r.toggle():i&&r.setState(i)})};n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=i,this};n(document).on("click.bs.button.data-api","[data-toggle^=button]",function(t){var i=n(t.target);i.hasClass("btn")||(i=i.closest(".btn"));i.button("toggle");t.preventDefault()})}(jQuery);+function(n){"use strict";var t=function(t,i){this.$element=n(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=this.sliding=this.interval=this.$active=this.$items=null;"hover"==this.options.pause&&this.$element.on("mouseenter",n.proxy(this.pause,this)).on("mouseleave",n.proxy(this.cycle,this))},i;t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)};t.prototype.to=function(t){var r=this,i=this.getActiveIndex();if(!(t>this.$items.length-1)&&!(0>t))return this.sliding?this.$element.one("slid.bs.carousel",function(){r.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",n(this.$items[t]))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition.end&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(t,i){var u=this.$element.find(".item.active"),r=i||u[t](),s=this.interval,f="next"==t?"left":"right",h="next"==t?"first":"last",o=this,e;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[h]()}if(this.sliding=!0,s&&this.pause(),e=n.Event("slide.bs.carousel",{relatedTarget:r[0],direction:f}),!r.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var t=n(o.$indicators.children()[o.getActiveIndex()]);t&&t.addClass("active")})),n.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;r.addClass(t);r[0].offsetWidth;u.addClass(f);r.addClass(f);u.one(n.support.transition.end,function(){r.removeClass([t,f].join(" ")).addClass("active");u.removeClass(["active",f].join(" "));o.sliding=!1;setTimeout(function(){o.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;u.removeClass("active");r.addClass("active");this.sliding=!1;this.$element.trigger("slid.bs.carousel")}return s&&this.cycle(),this}};i=n.fn.carousel;n.fn.carousel=function(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i),e="string"==typeof i?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));"number"==typeof i?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})};n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=i,this};n(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var f,i=n(this),r=n(i.attr("data-target")||(f=i.attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")),e=n.extend({},r.data(),i.data()),u=i.attr("data-slide-to");u&&(e.interval=!1);r.carousel(e);(u=i.attr("data-slide-to"))&&r.data("bs.carousel").to(u);t.preventDefault()});n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);t.carousel(t.data())})})}(jQuery);+function(n){"use strict";var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.transitioning=null;this.options.parent&&(this.$parent=n(this.options.parent));this.options.toggle&&this.toggle()},i;t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var u,t,r,i,f,e;if(!this.transitioning&&!this.$element.hasClass("in")&&(u=n.Event("show.bs.collapse"),this.$element.trigger(u),!u.isDefaultPrevented())){if(t=this.$parent&&this.$parent.find("> .panel > .in"),t&&t.length){if(r=t.data("bs.collapse"),r&&r.transitioning)return;t.collapse("hide");r||t.data("bs.collapse",null)}if(i=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[i](0),this.transitioning=1,f=function(){this.$element.removeClass("collapsing").addClass("in")[i]("auto");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return f.call(this);e=n.camelCase(["scroll",i].join("-"));this.$element.one(n.support.transition.end,n.proxy(f,this)).emulateTransitionEnd(350)[i](this.$element[0][e])}};t.prototype.hide=function(){var i,t,r;if(!this.transitioning&&this.$element.hasClass("in")&&(i=n.Event("hide.bs.collapse"),this.$element.trigger(i),!i.isDefaultPrevented()))return t=this.dimension(),this.$element[t](this.$element[t]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1,r=function(){this.transitioning=0;this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")},n.support.transition?(this.$element[t](0).one(n.support.transition.end,n.proxy(r,this)).emulateTransitionEnd(350),void 0):r.call(this)};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};i=n.fn.collapse;n.fn.collapse=function(i){return this.each(function(){var r=n(this),u=r.data("bs.collapse"),f=n.extend({},t.DEFAULTS,r.data(),"object"==typeof i&&i);u||r.data("bs.collapse",u=new t(this,f));"string"==typeof i&&u[i]()})};n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=i,this};n(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(t){var e,i=n(this),s=i.attr("data-target")||t.preventDefault()||(e=i.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,""),r=n(s),u=r.data("bs.collapse"),h=u?"toggle":i.data(),f=i.attr("data-parent"),o=f&&n(f);u&&u.transitioning||(o&&o.find('[data-toggle=collapse][data-parent="'+f+'"]').not(i).addClass("collapsed"),i[r.hasClass("in")?"addClass":"removeClass"]("collapsed"));r.collapse(h)})}(jQuery);+function(n){"use strict";function r(){n(e).remove();n(i).each(function(t){var i=u(n(this));i.hasClass("open")&&(i.trigger(t=n.Event("hide.bs.dropdown")),t.isDefaultPrevented()||i.removeClass("open").trigger("hidden.bs.dropdown"))})}function u(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}var e=".dropdown-backdrop",i="[data-toggle=dropdown]",t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.prototype.toggle=function(t){var f=n(this),i,e;if(!f.is(".disabled, :disabled")){if(i=u(f),e=i.hasClass("open"),r(),!e){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n('<div class="dropdown-backdrop"/>').insertAfter(n(this)).on("click",r),i.trigger(t=n.Event("show.bs.dropdown")),t.isDefaultPrevented())return;i.toggleClass("open").trigger("shown.bs.dropdown");f.focus()}return!1}};t.prototype.keydown=function(t){var e,o,s,f,r;if(/(38|40|27)/.test(t.keyCode)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=u(e),s=o.hasClass("open"),!s||s&&27==t.keyCode)return 27==t.which&&o.find(i).focus(),e.click();f=n("[role=menu] li:not(.divider):visible a",o);f.length&&(r=f.index(f.filter(":focus")),38==t.keyCode&&r>0&&r--,40==t.keyCode&&r<f.length-1&&r++,~r||(r=0),f.eq(r).focus())}};f=n.fn.dropdown;n.fn.dropdown=function(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));"string"==typeof i&&u[i].call(r)})};n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",r).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i+", [role=menu]",t.prototype.keydown)}(jQuery);+function(n){"use strict";var t=function(t,i){this.options=i;this.$element=n(t);this.$backdrop=this.isShown=null;this.options.remote&&this.$element.load(this.options.remote)},i;t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this[this.isShown?"hide":"show"](n)};t.prototype.show=function(t){var i=this,r=n.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r);this.isShown||r.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this)),this.backdrop(function(){var u=n.support.transition&&i.$element.hasClass("fade"),r;i.$element.parent().length||i.$element.appendTo(document.body);i.$element.show();u&&i.$element[0].offsetWidth;i.$element.addClass("in").attr("aria-hidden",!1);i.enforceFocus();r=n.Event("shown.bs.modal",{relatedTarget:t});u?i.$element.find(".modal-dialog").one(n.support.transition.end,function(){i.$element.focus().trigger(r)}).emulateTransitionEnd(300):i.$element.focus().trigger(r)}))};t.prototype.hide=function(t){t&&t.preventDefault();t=n.Event("hide.bs.modal");this.$element.trigger(t);this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one(n.support.transition.end,n.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.focus()},this))};t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",n.proxy(function(n){27==n.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.removeBackdrop();n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(t){var r=this.$element.hasClass("fade")?"fade":"",i;if(this.isShown&&this.options.backdrop){if(i=n.support.transition&&r,this.$backdrop=n('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",n.proxy(function(n){n.target===n.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;i?this.$backdrop.one(n.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(n.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};i=n.fn.modal;n.fn.modal=function(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),"object"==typeof i&&i);u||f.data("bs.modal",u=new t(this,e));"string"==typeof i?u[i](r):e.show&&u.show(r)})};n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=i,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var i=n(this),r=i.attr("href"),u=n(i.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),f=u.data("modal")?"toggle":n.extend({remote:!/#/.test(r)&&r},u.data(),i.data());t.preventDefault();u.modal(f,this).one("hide",function(){i.is(":visible")&&i.focus()})});n(document).on("show.bs.modal",".modal",function(){n(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){n(document.body).removeClass("modal-open")})}(jQuery);+function(n){"use strict";var t=function(n,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null;this.init("tooltip",n,t)},i;t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1};t.prototype.init=function(t,i,r){var f,e,u,o,s;for(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],"click"==u)this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else"manual"!=u&&(o="hover"==u?"mouseenter":"focus",s="hover"==u?"mouseleave":"blur",this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this)));this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show),void 0):i.show()};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide),void 0):i.hide()};t.prototype.show=function(){var o=n.Event("show.bs."+this.type),i,l;if(this.hasContent()&&this.enabled){if(this.$element.trigger(o),o.isDefaultPrevented())return;i=this.tip();this.setContent();this.options.animation&&i.addClass("fade");var t="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,s=/\s?auto?\s?/i,h=s.test(t);h&&(t=t.replace(s,"")||"top");i.detach().css({top:0,left:0,display:"block"}).addClass(t);this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var r=this.getPosition(),u=i[0].offsetWidth,f=i[0].offsetHeight;if(h){var e=this.$element.parent(),a=t,c=document.documentElement.scrollTop||document.body.scrollTop,v="body"==this.options.container?window.innerWidth:e.outerWidth(),y="body"==this.options.container?window.innerHeight:e.outerHeight(),p="body"==this.options.container?0:e.offset().left;t="bottom"==t&&r.top+r.height+f-c>y?"top":"top"==t&&r.top-c-f<0?"bottom":"right"==t&&r.right+u>v?"left":"left"==t&&r.left-u<p?"right":t;i.removeClass(a).addClass(t)}l=this.getCalculatedOffset(t,r,u,f);this.applyPlacement(l,t);this.$element.trigger("shown.bs."+this.type)}};t.prototype.applyPlacement=function(n,t){var h,i=this.tip(),c=i[0].offsetWidth,f=i[0].offsetHeight,e=parseInt(i.css("margin-top"),10),o=parseInt(i.css("margin-left"),10),u,r,s;isNaN(e)&&(e=0);isNaN(o)&&(o=0);n.top=n.top+e;n.left=n.left+o;i.offset(n).addClass("in");u=i[0].offsetWidth;r=i[0].offsetHeight;("top"==t&&r!=f&&(h=!0,n.top=n.top+f-r),/bottom|top/.test(t))?(s=0,n.left<0&&(s=-2*n.left,n.left=0,i.offset(n),u=i[0].offsetWidth,r=i[0].offsetHeight),this.replaceArrow(s-c+u,u,"left")):this.replaceArrow(r-f,r,"top");h&&i.offset(n)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i,n?50*(1-n/t)+"%":"")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(){function i(){"in"!=u.hoverState&&t.detach()}var u=this,t=this.tip(),r=n.Event("hide.bs."+this.type);return this.$element.trigger(r),r.isDefaultPrevented()?void 0:(t.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?t.one(n.support.transition.end,i).emulateTransitionEnd(150):i(),this.$element.trigger("hidden.bs."+this.type),this)};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||"string"!=typeof n.attr("data-original-title"))&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(){var t=this.$element[0];return n.extend({},"function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())};t.prototype.getCalculatedOffset=function(n,t,i,r){return"bottom"==n?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==n?{top:t.top-r,left:t.left+t.width/2-i/2}:"left"==n?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)};t.prototype.tip=function(){return this.$tip=this.$tip||n(this.options.template)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=t?n(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};i=n.fn.tooltip;n.fn.tooltip=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f="object"==typeof i&&i;r||u.data("bs.tooltip",r=new t(this,f));"string"==typeof i&&r[i]()})};n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);+function(n){"use strict";var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle(),i=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](t);n.find(".popover-content")[this.options.html?"html":"text"](i);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||("function"==typeof n.content?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};t.prototype.tip=function(){return this.$tip||(this.$tip=n(this.options.template)),this.$tip};i=n.fn.popover;n.fn.popover=function(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f="object"==typeof i&&i;r||u.data("bs.popover",r=new t(this,f));"string"==typeof i&&r[i]()})};n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery);+function(n){"use strict";function t(i,r){var u,f=n.proxy(this.process,this);this.$element=n(i).is("body")?n(window):n(i);this.$body=n("body");this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||(u=n(i).attr("href"))&&u.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a";this.offsets=n([]);this.targets=n([]);this.activeTarget=null;this.refresh();this.process()}t.DEFAULTS={offset:10};t.prototype.refresh=function(){var i=this.$element[0]==window?"offset":"position",t;this.offsets=n([]);this.targets=n([]);t=this;this.$body.find(this.selector).map(function(){var f=n(this),r=f.data("target")||f.attr("href"),u=/^#\w/.test(r)&&n(r);return u&&u.length&&[[u[i]().top+(!n.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var n,i=this.$scrollElement.scrollTop()+this.options.offset,f=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,e=f-this.$scrollElement.height(),t=this.offsets,r=this.targets,u=this.activeTarget;if(i>=e)return u!=(n=r.last()[0])&&this.activate(n);for(n=t.length;n--;)u!=r[n]&&i>=t[n]&&(!t[n+1]||i<=t[n+1])&&this.activate(r[n])};t.prototype.activate=function(t){this.activeTarget=t;n(this.selector).parents(".active").removeClass("active");var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};var i=n.fn.scrollspy;n.fn.scrollspy=function(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f="object"==typeof i&&i;r||u.data("bs.scrollspy",r=new t(this,f));"string"==typeof i&&r[i]()})};n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=i,this};n(window).on("load",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);t.scrollspy(t.data())})})}(jQuery);+function(n){"use strict";var t=function(t){this.element=n(t)},i;t.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),r,u,f;(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),t.parent("li").hasClass("active"))||(r=e.find(".active:last a")[0],u=n.Event("show.bs.tab",{relatedTarget:r}),(t.trigger(u),u.isDefaultPrevented())||(f=n(i),this.activate(t.parent("li"),e),this.activate(f,f.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:r})})))};t.prototype.activate=function(t,i,r){function f(){u.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");t.addClass("active");e?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade");t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active");r&&r()}var u=i.find("> .active"),e=r&&n.support.transition&&u.hasClass("fade");e?u.one(n.support.transition.end,f).emulateTransitionEnd(150):f();u.removeClass("in")};i=n.fn.tab;n.fn.tab=function(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));"string"==typeof i&&r[i]()})};n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=i,this};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault();n(this).tab("show")})}(jQuery);+function(n){"use strict";var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);this.$window=n(window).on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=this.unpin=null;this.checkPosition()},i;t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i;if(this.$element.is(":visible")){var s=n(document).height(),e=this.$window.scrollTop(),o=this.$element.offset(),r=this.options.offset,f=r.top,u=r.bottom;"object"!=typeof r&&(u=f=r);"function"==typeof f&&(f=r.top());"function"==typeof u&&(u=r.bottom());i=null!=this.unpin&&e+this.unpin<=o.top?!1:null!=u&&o.top+this.$element.height()>=s-u?"bottom":null!=f&&f>=e?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?o.top-e:null,this.$element.removeClass(t.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-u-this.$element.height()}))}};i=n.fn.affix;n.fn.affix=function(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f="object"==typeof i&&i;r||u.data("bs.affix",r=new t(this,f));"string"==typeof i&&r[i]()})};n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=i,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var i=n(this),t=i.data();t.offset=t.offset||{};t.offsetBottom&&(t.offset.bottom=t.offsetBottom);t.offsetTop&&(t.offset.top=t.offsetTop);i.affix(t)})})}(jQuery);window.matchMedia=window.matchMedia||function(n){"use strict";var u,i=n.documentElement,f=i.firstElementChild||i.firstChild,r=n.createElement("body"),t=n.createElement("div");return t.id="mq-test-1",t.style.cssText="position:absolute;top:-100em",r.style.background="none",r.appendChild(t),function(n){return t.innerHTML='&shy;<style media="'+n+'"> #mq-test-1 { width: 42px; }<\/style>',i.insertBefore(r,f),u=42===t.offsetWidth,i.removeChild(r),{matches:u,media:n}}}(document),function(n){"use strict";function y(){v(!0)}var r={};if(n.respond=r,r.update=function(){},r.mediaQueriesSupported=n.matchMedia&&n.matchMedia("only all").matches,!r.mediaQueriesSupported){var h,p,c,t=n.document,u=t.documentElement,f=[],e=[],i=[],l={},w=30,o=t.getElementsByTagName("head")[0]||u,nt=t.getElementsByTagName("base")[0],s=o.getElementsByTagName("link"),a=[],b=function(){for(var r=0;s.length>r;r++){var t=s[r],i=t.href,u=t.media,f=t.rel&&"stylesheet"===t.rel.toLowerCase();i&&f&&!l[i]&&(t.styleSheet&&t.styleSheet.rawCssText?(d(t.styleSheet.rawCssText,i,u),l[i]=!0):(!/^([a-zA-Z:]*\/\/)/.test(i)&&!nt||i.replace(RegExp.$1,"").split("/")[0]===n.location.host)&&a.push({href:i,media:u}))}k()},k=function(){if(a.length){var t=a.shift();tt(t.href,function(i){d(i,t.href,t.media);l[t.href]=!0;n.setTimeout(function(){k()},0)})}},d=function(n,t,i){var s=n.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),h=s&&s.length||0,c,l,u,a,r,y,p,o;for(t=t.substring(0,t.lastIndexOf("/")),c=function(n){return n.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+t+"$2$3")},l=!h&&i,t.length&&(t+="/"),l&&(h=1),u=0;h>u;u++)for(l?(a=i,e.push(c(n))):(a=s[u].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,e.push(RegExp.$2&&c(RegExp.$2))),y=a.split(","),p=y.length,o=0;p>o;o++)r=y[o],f.push({media:r.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:e.length-1,hasquery:r.indexOf("(")>-1,minw:r.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:r.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")});v()},g=function(){var r,i=t.createElement("div"),n=t.body,f=!1;return i.style.cssText="position:absolute;font-size:1em;width:1em",n||(n=f=t.createElement("body"),n.style.background="none"),n.appendChild(i),u.insertBefore(n,u.firstChild),r=i.offsetWidth,f?u.removeChild(n):n.removeChild(i),r=c=parseFloat(r)},v=function(r){var rt="clientWidth",ut=u[rt],ft="CSS1Compat"===t.compatMode&&ut||t.body[rt]||ut,y={},ct=s[s.length-1],et=(new Date).getTime(),tt,d,nt,l,it;if(r&&h&&w>et-h)return n.clearTimeout(p),p=n.setTimeout(v,w),void 0;h=et;for(tt in f)if(f.hasOwnProperty(tt)){var a=f[tt],b=a.minw,k=a.maxw,ot=null===b,st=null===k,ht="em";b&&(b=parseFloat(b)*(b.indexOf(ht)>-1?c||g():1));k&&(k=parseFloat(k)*(k.indexOf(ht)>-1?c||g():1));a.hasquery&&(ot&&st||!(ot||ft>=b)||!(st||k>=ft))||(y[a.media]||(y[a.media]=[]),y[a.media].push(e[a.rules]))}for(d in i)i.hasOwnProperty(d)&&i[d]&&i[d].parentNode===o&&o.removeChild(i[d]);for(nt in y)y.hasOwnProperty(nt)&&(l=t.createElement("style"),it=y[nt].join("\n"),l.type="text/css",l.media=nt,o.insertBefore(l,ct.nextSibling),l.styleSheet?l.styleSheet.cssText=it:l.appendChild(t.createTextNode(it)),i.push(l))},tt=function(n,t){var i=it();i&&(i.open("GET",n,!0),i.onreadystatechange=function(){4!==i.readyState||200!==i.status&&304!==i.status||t(i.responseText)},4!==i.readyState&&i.send(null))},it=function(){var t=!1;try{t=new n.XMLHttpRequest}catch(i){t=new n.ActiveXObject("Microsoft.XMLHTTP")}return function(){return t}}();b();r.update=b;n.addEventListener?n.addEventListener("resize",y,!1):n.attachEvent&&n.attachEvent("onresize",y)}}(this);$.fn.ajaxform=function(n,t,i){var r;if($.fn.ajaxform.increment=($.fn.ajaxform.increment||0)+1,r=$(this),r.size()>1)throw"ajaxform: don't call ajaxform on a jquery object with more than one element";var f="asyncForm"+$.fn.ajaxform.increment,u=$("<iframe id='"+f+"' name='"+f+"' src='' style='display:none'>"),o=$("[type='file']",r),s={target:r.attr("target"),enctype:r.attr("enctype"),encoding:r.attr("encoding"),method:r.attr("method")},e=!1;return u.bind("load",function(){setTimeout(function(){u.unbind("load").bind("load",function(){setTimeout(function(){var i,f,o;r.attr(s);e=!0;try{i=u[0];f=i.contentWindow?i.contentWindow.document:i.contentDocument||i.document;f?(o=f.getElementById("response"),o?n($.parseJSON(o.innerHTML)):t({success:!1,error:"No response tag"})):t({success:!1,error:"There was an invalid response from the server. Please try a reduced file size."})}catch(h){t({success:!1,error:h})}u.remove()},100)});r.attr("target",f);r.attr("method","POST");i&&r.attr(i);o.size()>0&&(r.attr("enctype","multipart/form-data"),r.attr("encoding","multipart/form-data"));r[0].submit()},100)}),u.appendTo("body"),{timeout:function(t,i){setTimeout(function(){var t,r,f;if(!e){try{if(t=u[0],r=t.contentWindow?t.contentWindow.document:t.contentDocument||t.document,r&&(f=r.getElementById("response"),f)){n($.parseJSON(f.innerHTML));return}}catch(o){}i&&i()}},t)}}};(function(n){var i='style="width:{width};height:{height};"',o='   <div class="text-center"><small>{caption}<\/small><\/div>\n',y='      <param name="controller" value="true" />\n      <param name="allowFullScreen" value="true" />\n      <param name="allowScriptAccess" value="always" />\n      <param name="autoPlay" value="false" />\n      <param name="autoStart" value="false" />\n      <param name="quality" value="high" />\n',e='<div class="file-preview-other" '+i+'>\n       <h2><i class="glyphicon glyphicon-file"><\/i><\/h2>\n   <\/div>',p={main1:'{preview}\n<div class="input-group {class}">\n   {caption}\n   <div class="input-group-btn valign-top">\n       {remove}\n       {upload}\n       {browse}\n   <\/div>\n<\/div><div class="kv-fileinput-error" role="alert"><\/div>\n',main2:"{preview}\n{remove}\n{upload}\n{browse}\n",preview:'<div class="file-preview {class}">\n   <div class="close fileinput-remove text-right">&times;<\/div>\n   <div class="file-preview-thumbnails"><\/div>\n   <div class="clearfix"><\/div>   <div class="file-preview-status text-center text-success"><\/div>\n<\/div>',icon:'<span class="glyphicon glyphicon-file kv-caption-icon"><\/span>',caption:'<div tabindex="-1" class="form-control file-caption {class}">\n   <div class="file-caption-name">&nbsp;<\/div>\n<\/div>',modal:'<div id="{id}" class="modal fade">\n  <div class="modal-dialog modal-lg">\n    <div class="modal-content">\n      <div class="modal-header">\n        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;<\/button>\n        <h3 class="modal-title">Detailed Preview <small>{title}<\/small><\/h3>\n      <\/div>\n      <div class="modal-body">\n        <textarea class="form-control" style="font-family:Monaco,Consolas,monospace; height: {height}px;" readonly>{body}<\/textarea>\n      <\/div>\n    <\/div>\n  <\/div>\n<\/div>\n'},h=["image","html","text","video","audio","flash","object"],c={generic:'<div class="file-preview-frame" id="{previewId}">\n   {content}\n<\/div>\n',html:'<div class="file-preview-frame" id="{previewId}">\n    <object data="{data}" type="{type}" width="{width}" height="{height}">\n       '+e+"\n    <\/object>\n"+o+"<\/div>",image:'<div class="file-preview-frame" id="{previewId}">\n   <img src="{data}" class="file-preview-image" title="{caption}" alt="{caption}" '+i+">\n<\/div>\n",text:'<div class="file-preview-frame" id="{previewId}">\n   <div class="file-preview-text" title="{caption}" '+i+">\n       {data}\n   <\/div>\n<\/div>\n",video:'<div class="file-preview-frame" id="{previewId}" title="{caption}" '+i+'>\n   <video width="{width}" height="{height}" controls>\n       <source src="{data}" type="{type}">\n       '+e+"\n   <\/video>\n"+o+"<\/div>\n",audio:'<div class="file-preview-frame" id="{previewId}" title="{caption}" '+i+'>\n   <audio controls>\n       <source src="{data}" type="{type}">\n       '+e+"\n   <\/audio>\n"+o+"<\/div>\n",flash:'<div class="file-preview-frame" id="{previewId}" title="{caption}" '+i+'>\n   <object type="application/x-shockwave-flash" width="{width}" height="{height}" data="{data}">\n'+y+"       "+e+"\n   <\/object>\n"+o+"<\/div>\n",object:'<div class="file-preview-frame" id="{previewId}" title="{caption}" '+i+'>\n    <object data="{data}" type="{type}" width="{width}" height="{height}">\n      <param name="movie" value="{caption}" />\n'+y+"           "+e+"\n   <\/object>\n"+o+"<\/div>",other:'<div class="file-preview-frame" id="{previewId}" title="{caption}" '+i+">\n   "+e+"\n<\/div>"},w={image:{width:"auto",height:"160px"},html:{width:"320px",height:"180px"},text:{width:"160px",height:"160px"},video:{width:"320px",height:"240px"},audio:{width:"320px",height:"80px"},flash:{width:"320px",height:"240px"},object:{width:"160px",height:"120px"},other:{width:"160px",height:"120px"}},a={image:function(n,t){return typeof n!="undefined"?n.match("image.*"):t.match(/\.(bmp|gif|png|jpe?g)$/i)},html:function(n,t){return typeof n!="undefined"?n=="text/html":t.match(/\.(htm|html)$/i)},text:function(n,t){return typeof n!="undefined"&&n.match("text.*")||t.match(/\.(txt|md|csv|nfo|php|ini)$/i)},video:function(n,t){return typeof n!="undefined"&&n.match(/\.video\/(ogg|mp4|webm)$/i)||t.match(/\.(og?|mp4|webm)$/i)},audio:function(n,t){return typeof n!="undefined"&&n.match(/\.audio\/(ogg|mp3|wav)$/i)||t.match(/\.(ogg|mp3|wav)$/i)},flash:function(n,t){return typeof n!="undefined"&&n=="application/x-shockwave-flash"||t.match(/\.(swf)$/i)},object:function(){return!0},other:function(){return!0}},t=function(t,i){return i?t===null||t===undefined||t==[]||t===""||n.trim(t)==="":t===null||t===undefined||t==[]||t===""},u=function(n){return Array.isArray(n)||Object.prototype.toString.call(n)==="[object Array]"},r=function(n,t){return typeof t=="object"&&n in t},d=function(n,i,r){return t(n)||t(n[i])?r:n[i]},f=function(i,r,u){return t(i)||t(i[r])?u:n(i[r])},l=function(){return Math.round((new Date).getTime()+Math.random()*100)},b=function(){return window.File&&window.FileReader&&window.FileList&&window.Blob},k=function(n){return String(n).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},s=window.URL||window.webkitURL,v=function(t,i){this.$element=n(t);b()?(this.init(i),this.listen()):this.$element.removeClass("file-loading")};v.prototype={constructor:v,init:function(n){var i=this,r;i.reader=null;i.showCaption=n.showCaption;i.showPreview=n.showPreview;i.autoFitCaption=n.autoFitCaption;i.maxFileSize=n.maxFileSize;i.maxFileCount=n.maxFileCount;i.msgSizeTooLarge=n.msgSizeTooLarge;i.msgFilesTooMany=n.msgFilesTooMany;i.msgFileNotFound=n.msgFileNotFound;i.msgFileNotReadable=n.msgFileNotReadable;i.msgFilePreviewAborted=n.msgFilePreviewAborted;i.msgFilePreviewError=n.msgFilePreviewError;i.msgValidationError=n.msgValidationError;i.msgErrorClass=n.msgErrorClass;i.initialDelimiter=n.initialDelimiter;i.initialPreview=n.initialPreview;i.initialCaption=n.initialCaption;i.initialPreviewCount=n.initialPreviewCount;i.initialPreviewContent=n.initialPreviewContent;i.overwriteInitial=n.overwriteInitial;i.layoutTemplates=n.layoutTemplates;i.previewTemplates=n.previewTemplates;i.allowedPreviewTypes=t(n.allowedPreviewTypes)?h:u(n.allowedPreviewTypes)?n.allowedPreviewTypes:n.allowedPreviewTypes.split(",");i.allowedPreviewMimeTypes=n.allowedPreviewMimeTypes;i.allowedFileTypes=t(n.allowedFileTypes)?"":u(n.allowedFileTypes)?n.allowedFileTypes:n.allowedFileTypes.split(",");i.allowedFileExtensions=t(n.allowedFileExtensions)?"":u(n.allowedFileExtensions)?n.allowedFileExtensions:n.allowedFileExtensions.split(",");i.previewSettings=n.previewSettings;i.fileTypeSettings=n.fileTypeSettings;i.showRemove=n.showRemove;i.showUpload=n.showUpload;i.captionClass=n.captionClass;i.previewClass=n.previewClass;i.mainClass=n.mainClass;i.mainTemplate=i.showCaption?i.getLayoutTemplate("main1"):i.getLayoutTemplate("main2");i.captionTemplate=i.getLayoutTemplate("caption");i.previewGenericTemplate=i.getPreviewTemplate("generic");i.browseLabel=n.browseLabel;i.browseIcon=n.browseIcon;i.browseClass=n.browseClass;i.removeLabel=n.removeLabel;i.removeIcon=n.removeIcon;i.removeClass=n.removeClass;i.uploadLabel=n.uploadLabel;i.uploadIcon=n.uploadIcon;i.uploadClass=n.uploadClass;i.uploadUrl=n.uploadUrl;i.msgLoading=n.msgLoading;i.msgProgress=n.msgProgress;i.msgSelected=n.msgSelected;i.msgInvalidFileType=n.msgInvalidFileType;i.msgInvalidFileExtension=n.msgInvalidFileExtension;i.previewFileType=n.previewFileType;i.wrapTextLength=n.wrapTextLength;i.wrapIndicator=n.wrapIndicator;i.isError=!1;i.isDisabled=i.$element.attr("disabled")||i.$element.attr("readonly");t(i.$element.attr("id"))&&i.$element.attr("id",l());typeof i.$container=="undefined"?i.$container=i.createContainer():i.refreshContainer();i.$captionContainer=f(n,"elCaptionContainer",i.$container.find(".file-caption"));i.$caption=f(n,"elCaptionText",i.$container.find(".file-caption-name"));i.$previewContainer=f(n,"elPreviewContainer",i.$container.find(".file-preview"));i.$preview=f(n,"elPreviewImage",i.$container.find(".file-preview-thumbnails"));i.$previewStatus=f(n,"elPreviewStatus",i.$container.find(".file-preview-status"));i.$errorContainer=f(n,"elErrorContainer",i.$container.find(".kv-fileinput-error"));i.$dataContainer=f(n,"elDataContainer",i.$container.find(".file-preview-image"));t(i.msgErrorClass)||i.$errorContainer.removeClass(i.msgErrorClass).addClass(i.msgErrorClass);i.$errorContainer.hide();r=i.initialPreview;i.initialPreviewCount=u(r)?r.length:r.length>0?r.split(i.initialDelimiter).length:0;i.initPreview();i.original={preview:i.$preview.html(),caption:i.$caption.html()};i.options=n;i.autoSizeCaption();i.$element.removeClass("file-loading")},getLayoutTemplate:function(n){var t=this;return r(n,t.layoutTemplates)?t.layoutTemplates[n]:p[n]},getPreviewTemplate:function(n){var t=this;return r(n,t.previewTemplates)?t.previewTemplates[n]:c[n]},listen:function(){var t=this,i=t.$element,r=t.$captionContainer,u=t.$btnFile;i.on("change",n.proxy(t.change,t));n(window).on("resize",function(){setTimeout(function(){t.autoSizeCaption()},100)});u.on("click",function(){t.$element.trigger("filebrowse");r.focus()});i.closest("form").on("reset",n.proxy(t.reset,t));t.$container.on("click",".fileinput-remove:not([disabled])",n.proxy(t.clear,t));i.on("focus",function(){i.parent(".btn-default").addClass("btn-focus")});i.on("blur",function(){i.parent(".btn-default").removeClass("btn-focus")})},refresh:function(t){var i=this,r=arguments.length?n.extend(i.options,t):i.options;i.$element.off();i.init(r)},initPreview:function(){var n=this,r="",s=n.initialPreview,i=n.initialPreviewCount,f=n.initialCaption.length,e="preview-"+l(),o=f>0?n.initialCaption:n.msgSelected.replace(/\{n\}/g,i),h,t;if(u(s)&&i>0){for(t=0;t<i;t++)e+="-"+t,r+=n.previewGenericTemplate.replace(/\{previewId\}/g,e).replace(/\{content\}/g,s[t]);i>1&&f==0&&(o=n.msgSelected.replace(/\{n\}/g,i))}else if(i>0){for(h=s.split(n.initialDelimiter),t=0;t<i;t++)e+="-"+t,r+=n.previewGenericTemplate.replace(/\{previewId\}/g,e).replace(/\{content\}/g,h[t]);i>1&&f==0&&(o=n.msgSelected.replace(/\{n\}/g,i))}else{if(f>0){n.setCaption(o);return}return}n.initialPreviewContent=r;n.$preview.html(r);n.setCaption(o);n.$container.removeClass("file-input-new")},clearObjects:function(){var i=this,t=i.$preview;t.find("video audio").each(function(){this.pause();delete this;n(this).remove()});t.find("img object div").each(function(){delete this;n(this).remove()})},clearFileInput:function(){var e=this,i=e.$element,r,f,u;t(i.val())||(/MSIE/.test(navigator.userAgent)?(r=i.closest("form"),r.length?(i.wrap("<form>"),f=i.closest("form"),u=n(document.createElement("div")),f.before(u).after(r).trigger("reset"),i.unwrap().appendTo(u).unwrap()):i.wrap("<form>").closest("form").trigger("reset").unwrap()):i.val(""))},clear:function(){var n=this,i=arguments.length&&arguments[0],r;i&&i.preventDefault();n.reader instanceof FileReader&&n.reader.abort();n.autoSizeCaption();n.clearFileInput();n.resetErrors(!0);i!==!1&&(n.$element.trigger("change"),n.$element.trigger("fileclear"));n.overwriteInitial&&(n.initialPreviewCount=0);n.overwriteInitial||t(n.initialPreviewContent)?(n.clearObjects(),n.$preview.html(""),r=!n.overwriteInitial&&n.initialCaption.length>0?n.original.caption:"",n.$caption.html(r),n.$caption.attr("title",""),n.$container.removeClass("file-input-new").addClass("file-input-new")):(n.showFileIcon(),n.$preview.html(n.original.preview),n.$caption.html(n.original.caption),n.$container.removeClass("file-input-new"));n.hideFileIcon();n.$element.trigger("filecleared");n.$captionContainer.focus()},reset:function(){var n=this;n.clear(!1);n.$preview.html(n.original.preview);n.$caption.html(n.original.caption);n.$container.find(".fileinput-filename").text("");n.$element.trigger("filereset");n.initialPreview.length>0&&n.$container.removeClass("file-input-new")},disable:function(){var n=this;n.isDisabled=!0;n.$element.attr("disabled","disabled");n.$container.find(".kv-fileinput-caption").addClass("file-caption-disabled");n.$container.find(".btn-file, .fileinput-remove, .kv-fileinput-upload").attr("disabled",!0)},enable:function(){var n=this;n.isDisabled=!1;n.$element.removeAttr("disabled");n.$container.find(".kv-fileinput-caption").removeClass("file-caption-disabled");n.$container.find(".btn-file, .fileinput-remove, .kv-fileinput-upload").removeAttr("disabled")},hideFileIcon:function(){this.overwriteInitial&&this.$captionContainer.find(".kv-caption-icon").hide()},showFileIcon:function(){this.$captionContainer.find(".kv-caption-icon").show()},resetErrors:function(n){var t=this,i=t.$errorContainer;t.isError=!1;t.$container.removeClass("has-error");n?i.fadeOut("slow"):i.hide()},showError:function(n,t,i,r){var u=this,f=u.$errorContainer,e=u.$element;return f.html(n),f.fadeIn(800),e.trigger("fileerror",[t,i,r]),u.clearFileInput(),u.$container.removeClass("has-error").addClass("has-error"),!0},errorHandler:function(n,t){var i=this;switch(n.target.error.code){case n.target.error.NOT_FOUND_ERR:i.addError(i.msgFileNotFound.replace(/\{name\}/g,t));break;case n.target.error.NOT_READABLE_ERR:i.addError(i.msgFileNotReadable.replace(/\{name\}/g,t));break;case n.target.error.ABORT_ERR:i.addError(i.msgFilePreviewAborted.replace(/\{name\}/g,t));break;default:i.addError(i.msgFilePreviewError.replace(/\{name\}/g,t))}},parseFileType:function(n){for(var u,i,t=0;t<h.length;t++)if(cat=h[t],u=r(cat,self.fileTypeSettings)?self.fileTypeSettings[cat]:a[cat],i=u(n.type,n.name)?cat:"",i!="")return i;return"other"},previewDefault:function(t,i){var u=this,f=s.createObjectURL(t),e=n("#"+i),o=r("other",u.previewTemplates)?u.previewTemplates.other:c.other;u.$preview.append("\n"+o.replace(/\{previewId\}/g,i).replace(/\{caption\}/g,u.slug(t.name)).replace(/\{type\}/g,t.type).replace(/\{data\}/g,f).replace(/\{height\}/g,"50px").replace(/\{width\}/g,"100px"));u.$preview.dblclick(function(){window.open(f)});e.on("load",function(){s.revokeObjectURL(e.attr("data"))})},previewFile:function(n,i,u,f){var e=this,o=e.parseFileType(n),a=e.slug(n.name),f,y,tt=e.allowedPreviewTypes,p=e.allowedPreviewMimeTypes,ot=n.type,d=r(o,e.previewTemplates)?e.previewTemplates[o]:c[o],v=r(o,e.previewSettings)?e.previewSettings[o]:w[o],g=parseInt(e.wrapTextLength),b=e.wrapIndicator,it=e.$preview,rt=tt.indexOf(o)>=0,ut=t(p)||!t(p)&&r(n.type,p),h;if(rt&&ut){if(o=="text"){if(h=k(i.target.result),s.revokeObjectURL(f),h.length>g){var nt="text-"+l(),ft=window.innerHeight*.75,et=e.getLayoutTemplate("modal").replace(/\{id\}/g,nt).replace(/\{title\}/g,a).replace(/\{height\}/g,ft).replace(/\{body\}/g,h);b=b.replace(/\{title\}/g,a).replace(/\{dialog\}/g,"$('#"+nt+"').modal('show')");h=h.substring(0,g-1)+b}y=d.replace(/\{previewId\}/g,u).replace(/\{caption\}/g,a).replace(/\{type\}/g,n.type).replace(/\{width\}/g,v.width).replace(/\{height\}/g,v.height).replace(/\{data\}/g,h)+et}else y=d.replace(/\{previewId\}/g,u).replace(/\{caption\}/g,a).replace(/\{type\}/g,n.type).replace(/\{data\}/g,f).replace(/\{width\}/g,v.width).replace(/\{height\}/g,v.height);it.append("\n"+y);e.autoSizeImage(u)}else e.previewDefault(n,u)},readFiles:function(n){function h(r){var nt,lt;if(r>=o){y.removeClass("loading");e.html("");return}var g=k+"-"+r,l=n[r],a=i.slug(l.name),ft=(l.size?l.size:0)/1e3,ot,st=s.createObjectURL(l),ut=0,et,tt,ht,it,rt=i.allowedFileExtensions,at=t(rt)?"":rt.join(", "),ct=t(rt)?"":new RegExp("\\.("+rt.join("|")+")$","i");if(ft=ft.toFixed(2),nt=i.allowedFileTypes,lt=t(nt)?"":nt.join(", "),i.maxFileSize>0&&ft>i.maxFileSize){tt=i.msgSizeTooLarge.replace(/\{name\}/g,a).replace(/\{size\}/g,ft).replace(/\{maxSize\}/g,i.maxFileSize);i.isError=i.showError(tt,l,g,r);return}if(!t(nt)&&u(nt)){for(et=0;et<nt.length;et++)ht=nt[et],ot=v[ht],it=ot!==undefined&&ot(l.type,a),ut+=t(it)?0:it.length;if(ut==0){tt=i.msgInvalidFileType.replace(/\{name\}/g,a).replace(/\{types\}/g,lt);i.isError=i.showError(tt,l,g,r);return}}if(ut==0&&!t(rt)&&u(rt)&&!t(ct)&&(it=a.match(ct),ut+=t(it)?0:it.length,ut==0)){tt=i.msgInvalidFileExtension.replace(/\{name\}/g,a).replace(/\{extensions\}/g,at);i.isError=i.showError(tt,l,g,r);return}if(!i.showPreview){c.trigger("fileloaded",[l,g,r]);setTimeout(h(r+1),1e3);return}w.length>0&&typeof FileReader!="undefined"?(e.html(b.replace(/\{index\}/g,r+1).replace(/\{files\}/g,o)),y.addClass("loading"),f.onerror=function(n){i.errorHandler(n,a)},f.onload=function(n){i.previewFile(l,n,g,st)},f.onloadend=function(){var n=p.replace(/\{index\}/g,r+1).replace(/\{files\}/g,o).replace(/\{percent\}/g,100).replace(/\{name\}/g,a);setTimeout(function(){e.html(n);s.revokeObjectURL(st)},1e3);setTimeout(function(){h(r+1)},1500);c.trigger("fileloaded",[l,g,r])},f.onprogress=function(n){if(n.lengthComputable){var t=parseInt(n.loaded/n.total*100,10),i=p.replace(/\{index\}/g,r+1).replace(/\{files\}/g,o).replace(/\{percent\}/g,t).replace(/\{name\}/g,a);setTimeout(function(){e.html(i)},1e3)}},d(l.type,a)?f.readAsText(l):f.readAsArrayBuffer(l)):(i.previewDefault(l,g),c.trigger("fileloaded",[l,g,r]),setTimeout(h(r+1),1e3))}this.reader=new FileReader;var i=this,c=i.$element,w=i.$preview,f=i.reader,y=i.$previewContainer,e=i.$previewStatus,b=i.msgLoading,p=i.msgProgress,g=i.msgSelected,nt=i.previewFileType,tt=parseInt(i.wrapTextLength),it=i.wrapIndicator,k="preview-"+l(),o=n.length,v=i.fileTypeSettings,d=r("text",v)?v.text:a.text;h(0)},slug:function(n){return t(n)?"":n.split(/(\\|\/)/g).pop().replace(/[^\w-.\\\/ ]+/g,"")},setCaption:function(t){var i=this,r=n("<div>"+t+"<\/div>").text(),u=i.layoutTemplates.icon,f=u+r;i.$caption.length!=0&&(i.$caption.html(f),i.$caption.attr("title",r),i.autoSizeCaption())},autoSizeImage:function(n){var r=this,u=r.$preview,t=u.find("#"+n),i=t.find("img");if(i.length)i.on("load",function(){var f=t.width(),e=u.width();f>e&&(i.css("width","100%"),t.css("width","97%"));r.$element.trigger("fileimageloaded",n)})},autoSizeCaption:function(){var n=this;n.$caption.length!=0&&n.autoFitCaption&&(n.$caption.css("width",0),setTimeout(function(){var t=n.$captionContainer.width();t<1&&(t=100);n.$caption.css("width",.98*t)},100))},change:function(n){var i=this,r=i.$element,h=i.slug(r.val()),u=0,c=i.$preview,e=r.get(0).files,a=i.msgSelected,o=t(e)?1:e.length+i.initialPreviewCount,f,l,s;if(i.hideFileIcon(),f=n.target.files===undefined?n.target&&n.target.value?[{name:n.target.value.replace(/^.+\\/,"")}]:[]:n.target.files,t(f)||f.length===0){i.clear(!1);r.trigger("fileselectnone");return}if(i.resetErrors(),c.html(""),i.overwriteInitial||c.html(i.initialPreviewContent),u=f.length,i.maxFileCount>0&&u>i.maxFileCount){l=i.msgFilesTooMany.replace(/\{m\}/g,i.maxFileCount).replace(/\{n\}/g,u);i.isError=i.showError(l,null,null,null);i.$captionContainer.find(".kv-caption-icon").hide();i.$caption.html(i.msgValidationError);i.$container.removeClass("file-input-new");return}i.readFiles(e);i.reader=null;s=o>1?a.replace(/\{n\}/g,o):h;i.isError?(i.$captionContainer.find(".kv-caption-icon").hide(),s=i.msgValidationError):i.showFileIcon();i.setCaption(s);i.isError===!1&&i.$container.removeClass("file-input-new");r.trigger("fileselect",[o,h])},initBrowse:function(n){var t=this;t.$btnFile=n.find(".btn-file");t.$btnFile.append(t.$element)},createContainer:function(){var t=this,i=n(document.createElement("span")).attr({"class":"file-input file-input-new"}).html(t.renderMain());return t.$element.before(i),t.initBrowse(i),i},refreshContainer:function(){var n=this,t=n.$container;t.before(n.$element);t.html(n.renderMain());n.initBrowse(t)},renderMain:function(){var n=this,t=n.showPreview?n.getLayoutTemplate("preview").replace(/\{class\}/g,n.previewClass):"",i=n.isDisabled?n.captionClass+" file-caption-disabled":n.captionClass,r=n.captionTemplate.replace(/\{class\}/g,i+" kv-fileinput-caption");return n.mainTemplate.replace(/\{class\}/g,n.mainClass).replace(/\{preview\}/g,t).replace(/\{caption\}/g,r).replace(/\{upload\}/g,n.renderUpload()).replace(/\{remove\}/g,n.renderRemove()).replace(/\{browse\}/g,n.renderBrowse())},renderBrowse:function(){var n=this,i=n.browseClass+" btn-file",t="";return n.isDisabled&&(t=" disabled "),'<div class="margin-bottom-10 '+i+'"'+t+"> "+n.browseIcon+n.browseLabel+" <\/div>"},renderRemove:function(){var n=this,i=n.removeClass+" fileinput-remove fileinput-remove-button",t="";return n.showRemove?(n.isDisabled&&(t=" disabled "),'<button type="button" class="'+i+'"'+t+">"+n.removeIcon+n.removeLabel+"<\/button>"):""},renderUpload:function(){var n=this,r=n.uploadClass+" kv-fileinput-upload",i="";return n.showUpload?(n.isDisabled&&(i=" disabled "),t(n.uploadUrl)?'<button type="submit" class="'+r+'"'+i+">"+n.uploadIcon+n.uploadLabel+"<\/button>":'<a href="'+n.uploadUrl+'" class="'+n.uploadClass+'"'+i+">"+n.uploadIcon+n.uploadLabel+"<\/a>"):""}};n.fn.fileinput=function(t){if(b()){var i=Array.apply(null,arguments);return i.shift(),this.each(function(){var u=n(this),r=u.data("fileinput"),f=typeof t=="object"&&t;r||u.data("fileinput",r=new v(this,n.extend({},n.fn.fileinput.defaults,f,n(this).data())));typeof t=="string"&&r[t].apply(r,i)})}};n.fn.fileinput.defaults={showCaption:!0,showPreview:!0,showRemove:!0,showUpload:!1,autoFitCaption:!0,mainClass:"",previewClass:"",captionClass:"",mainTemplate:null,initialDelimiter:"*$$*",initialPreview:"",initialCaption:"",initialPreviewCount:0,initialPreviewContent:"",overwriteInitial:!0,layoutTemplates:p,previewTemplates:c,allowedPreviewTypes:h,allowedPreviewMimeTypes:null,allowedFileTypes:null,allowedFileExtensions:null,previewSettings:w,fileTypeSettings:a,browseLabel:"Browse &hellip;",browseIcon:'<i class="fa fa-folder-open"><\/i> &nbsp;',browseClass:"btn btn-primary",removeLabel:"Remove",removeIcon:'<i class="fa fa-ban"><\/i> ',removeClass:"btn btn-default",uploadLabel:"Upload",uploadIcon:'<i class="fa fa-upload"><\/i> ',uploadClass:"btn btn-default",uploadUrl:null,maxFileSize:0,maxFileCount:0,msgSizeTooLarge:'File "{name}" (<b>{size} KB<\/b>) exceeds maximum allowed upload size of <b>{maxSize} KB<\/b>. Please retry your upload!',msgFilesTooMany:"Number of files selected for upload <b>({n})<\/b> exceeds maximum allowed limit of <b>{m}<\/b>. Please retry your upload!",msgFileNotFound:'File "{name}" not found!',msgFileNotReadable:'File "{name}" is not readable.',msgFilePreviewAborted:'File preview aborted for "{name}".',msgFilePreviewError:'An error occurred while reading the file "{name}".',msgInvalidFileType:'Invalid type for file "{name}". Only "{types}" files are supported.',msgInvalidFileExtension:'Invalid extension for file "{name}". Only "{extensions}" files are supported.',msgValidationError:"",msgErrorClass:"file-error-message",msgLoading:"Loading  file {index} of {files} &hellip;",msgProgress:"Loading file {index} of {files} - {name} - {percent}% completed.",msgSelected:"{n} files selected",previewFileType:"image",wrapTextLength:250,wrapIndicator:' <span class="wrap-indicator" title="{title}" onclick="{dialog}">[&hellip;]<\/span>',elCaptionContainer:null,elCaptionText:null,elPreviewContainer:null,elPreviewImage:null,elPreviewStatus:null,elErrorContainer:null}})(window.jQuery);(function(){"use strict";$(document).on("ajaxComplete",function(n,t){var r=t.getResponseHeader("X-Responded-JSON"),i;r&&(i=JSON.parse(r),i.status&&i.status===401&&i.headers&&i.headers.location&&(window.location=i.headers.location))})})();(function(){"use strict";function n(n){function s(s,h){var rt,ut,p=s==window,l=h&&h.message!==undefined?h.message:undefined,g,k,d,tt,nt,w,b,it,ft,et,at;if(h=n.extend({},n.blockUI.defaults,h||{}),!h.ignoreIfBlocked||!n(s).data("blockUI.isBlocked")){if(h.overlayCSS=n.extend({},n.blockUI.defaults.overlayCSS,h.overlayCSS||{}),rt=n.extend({},n.blockUI.defaults.css,h.css||{}),h.onOverlayClick&&(h.overlayCSS.cursor="pointer"),ut=n.extend({},n.blockUI.defaults.themedCSS,h.themedCSS||{}),l=l===undefined?h.message:l,p&&t&&e(window,{fadeOut:0}),l&&typeof l!="string"&&(l.parentNode||l.jquery)&&(g=l.jquery?l[0]:l,k={},n(s).data("blockUI.history",k),k.el=g,k.parent=g.parentNode,k.display=g.style.display,k.position=g.style.position,k.parent&&k.parent.removeChild(g)),n(s).data("blockUI.onUnblock",h.onUnblock),d=h.baseZ,tt=f||h.forceIframe?n('<iframe class="blockUI" style="z-index:'+d+++';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+h.iframeSrc+'"><\/iframe>'):n('<div class="blockUI" style="display:none"><\/div>'),nt=h.theme?n('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+d+++';display:none"><\/div>'):n('<div class="blockUI blockOverlay" style="z-index:'+d+++';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"><\/div>'),h.theme&&p?(b='<div class="blockUI '+h.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(d+10)+';display:none;position:fixed">',h.title&&(b+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(h.title||"&nbsp;")+"<\/div>"),b+='<div class="ui-widget-content ui-dialog-content"><\/div>',b+="<\/div>"):h.theme?(b='<div class="blockUI '+h.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(d+10)+';display:none;position:absolute">',h.title&&(b+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(h.title||"&nbsp;")+"<\/div>"),b+='<div class="ui-widget-content ui-dialog-content"><\/div>',b+="<\/div>"):b=p?'<div class="blockUI '+h.blockMsgClass+' blockPage" style="z-index:'+(d+10)+';display:none;position:fixed"><\/div>':'<div class="blockUI '+h.blockMsgClass+' blockElement" style="z-index:'+(d+10)+';display:none;position:absolute"><\/div>',w=n(b),l&&(h.theme?(w.css(ut),w.addClass("ui-widget-content")):w.css(rt)),h.theme||nt.css(h.overlayCSS),nt.css("position",p?"fixed":"absolute"),(f||h.forceIframe)&&tt.css("opacity",0),it=[tt,nt,w],ft=p?n("body"):n(s),n.each(it,function(){this.appendTo(ft)}),h.theme&&h.draggable&&n.fn.draggable&&w.draggable({handle:".ui-dialog-titlebar",cancel:"li"}),et=v&&(!n.support.boxModel||n("object,embed",p?null:s).length>0),o||et){if(p&&h.allowBodyStretch&&n.support.boxModel&&n("html,body").css("height","100%"),(o||!n.support.boxModel)&&!p)var ot=r(s,"borderTopWidth"),st=r(s,"borderLeftWidth"),ht=ot?"(0 - "+ot+")":0,ct=st?"(0 - "+st+")":0;n.each(it,function(n,t){var i=t[0].style,r,u;i.position="absolute";n<2?(p?i.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+h.quirksmodeOffsetHack+') + "px"'):i.setExpression("height",'this.parentNode.offsetHeight + "px"'),p?i.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):i.setExpression("width",'this.parentNode.offsetWidth + "px"'),ct&&i.setExpression("left",ct),ht&&i.setExpression("top",ht)):h.centerY?(p&&i.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),i.marginTop=0):!h.centerY&&p&&(r=h.css&&h.css.top?parseInt(h.css.top,10):0,u="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+r+') + "px"',i.setExpression("top",u))})}if(l&&(h.theme?w.find(".ui-widget-content").append(l):w.append(l),(l.jquery||l.nodeType)&&n(l).show()),(f||h.forceIframe)&&h.showOverlay&&tt.show(),h.fadeIn){var lt=h.onBlock?h.onBlock:u,vt=h.showOverlay&&!l?lt:u,yt=l?lt:u;h.showOverlay&&nt._fadeIn(h.fadeIn,vt);l&&w._fadeIn(h.fadeIn,yt)}else h.showOverlay&&nt.show(),l&&w.show(),h.onBlock&&h.onBlock();c(1,s,h);p?(t=w[0],i=n(h.focusableElements,t),h.focusInput&&setTimeout(a,20)):y(w[0],h.centerX,h.centerY);h.timeout&&(at=setTimeout(function(){p?n.unblockUI(h):n(s).unblock(h)},h.timeout),n(s).data("blockUI.timeout",at))}}function e(r,u){var o,s=r==window,e=n(r),l=e.data("blockUI.history"),a=e.data("blockUI.timeout"),f;a&&(clearTimeout(a),e.removeData("blockUI.timeout"));u=n.extend({},n.blockUI.defaults,u||{});c(0,r,u);u.onUnblock===null&&(u.onUnblock=e.data("blockUI.onUnblock"),e.removeData("blockUI.onUnblock"));f=s?n("body").children().filter(".blockUI").add("body > .blockUI"):e.find(">.blockUI");u.cursorReset&&(f.length>1&&(f[1].style.cursor=u.cursorReset),f.length>2&&(f[2].style.cursor=u.cursorReset));s&&(t=i=null);u.fadeOut?(o=f.length,f.stop().fadeOut(u.fadeOut,function(){--o==0&&h(f,l,u,r)})):h(f,l,u,r)}function h(t,i,r,u){var f=n(u);if(!f.data("blockUI.isBlocked")){if(t.each(function(){this.parentNode&&this.parentNode.removeChild(this)}),i&&i.el&&(i.el.style.display=i.display,i.el.style.position=i.position,i.parent&&i.parent.appendChild(i.el),f.removeData("blockUI.history")),f.data("blockUI.static")&&f.css("position","static"),typeof r.onUnblock=="function")r.onUnblock(u,r);var e=n(document.body),o=e.width(),s=e[0].style.width;e.width(o-1).width(o);e[0].style.width=s}}function c(i,r,u){var f=r==window,o=n(r),e;(i||(!f||t)&&(f||o.data("blockUI.isBlocked")))&&(o.data("blockUI.isBlocked",i),f&&u.bindEvents&&(!i||u.showOverlay))&&(e="mousedown mouseup keydown keypress keyup touchstart touchend touchmove",i?n(document).bind(e,u,l):n(document).unbind(e,l))}function l(r){var u,f;if(r.type==="keydown"&&r.keyCode&&r.keyCode==9&&t&&r.data.constrainTabKey){var e=i,s=!r.shiftKey&&r.target===e[e.length-1],o=r.shiftKey&&r.target===e[0];if(s||o)return setTimeout(function(){a(o)},10),!1}if(u=r.data,f=n(r.target),f.hasClass("blockOverlay")&&u.onOverlayClick)u.onOverlayClick(r);return f.parents("div."+u.blockMsgClass).length>0?!0:f.parents().children().filter("div.blockUI").length===0}function a(n){if(i){var t=i[n===!0?i.length-1:0];t&&t.focus()}}function y(n,t,i){var u=n.parentNode,f=n.style,e=(u.offsetWidth-n.offsetWidth)/2-r(u,"borderLeftWidth"),o=(u.offsetHeight-n.offsetHeight)/2-r(u,"borderTopWidth");t&&(f.left=e>0?e+"px":"0");i&&(f.top=o>0?o+"px":"0")}function r(t,i){return parseInt(n.css(t,i),10)||0}var t,i;n.fn._fadeIn=n.fn.fadeIn;var u=n.noop||function(){},f=/MSIE/.test(navigator.userAgent),o=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),p=document.documentMode||0,v=n.isFunction(document.createElement("div").style.setExpression);n.blockUI=function(n){s(window,n)};n.unblockUI=function(n){e(window,n)};n.growlUI=function(t,i,r,u){var f=n('<div class="growlUI"><\/div>'),e,o;t&&f.append("<h1>"+t+"<\/h1>");i&&f.append("<h2>"+i+"<\/h2>");r===undefined&&(r=3e3);e=function(t){t=t||{};n.blockUI({message:f,fadeIn:typeof t.fadeIn!="undefined"?t.fadeIn:700,fadeOut:typeof t.fadeOut!="undefined"?t.fadeOut:1e3,timeout:typeof t.timeout!="undefined"?t.timeout:r,centerY:!1,showOverlay:!1,onUnblock:u,css:n.blockUI.defaults.growlCSS})};e();o=f.css("opacity");f.mouseover(function(){e({fadeIn:0,timeout:3e4});var t=n(".blockMsg");t.stop();t.fadeTo(300,1)}).mouseout(function(){n(".blockMsg").fadeOut(1e3)})};n.fn.block=function(t){if(this[0]===window)return n.blockUI(t),this;var i=n.extend({},n.blockUI.defaults,t||{});return this.each(function(){var t=n(this);i.ignoreIfBlocked&&t.data("blockUI.isBlocked")||t.unblock({fadeOut:0})}),this.each(function(){n.css(this,"position")=="static"&&(this.style.position="relative",n(this).data("blockUI.static",!0));this.style.zoom=1;s(this,t)})};n.fn.unblock=function(t){return this[0]===window?(n.unblockUI(t),this):this.each(function(){e(this,t)})};n.blockUI.version=2.66;n.blockUI.defaults={message:"<h1>Please wait...<\/h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};t=null;i=[]}typeof define=="function"&&define.amd&&define.amd.jQuery?define(["jquery"],n):n(jQuery)})();(function(n,t,i){"use strict";var r=function(t,r){function e(n){return n==="notice"?"info":n==="error"?"danger":n}function o(t){return{errs:n.grep(t,function(n){return n.priority==="error"||n.priority==="danger"}),warns:n.grep(t,function(n){return n.priority==="warning"}),infos:n.grep(t,function(n){return n.priority==="notice"||n.priority==="info"}),succs:n.grep(t,function(n){return n.priority==="success"})}}var u=this,f;u.element=t;u.options=n.extend({},n.fn.bsAlerts.defaults,r);n(i).on("add-alerts",function(){var n=Array.prototype.slice.call(arguments,1);u.addAlerts(n)});n(i).on("clear-alerts",function(){u.clearAlerts()});n.each(this.options.ids.split(","),function(t,r){var f=r.trim(),e;if(f.length>0){e="set-alert-id-"+f;n(i).on(e,function(){var n=Array.prototype.slice.call(arguments,1);u.addAlerts(n)})}});u.clearAlerts=function(){n(this.element).html("")};u.addAlerts=function(n){var t=o([].concat(n)),i;u.addAlertsToContainer(t.errs);u.addAlertsToContainer(t.warns);u.addAlertsToContainer(t.infos);u.addAlertsToContainer(t.succs);i=parseInt(u.options.fade,10);!isNaN(i)&&i>0&&(clearTimeout(f),f=setTimeout(u.fade,i))};u.fade=function(){n("[data-alerts-container]").fadeOut("slow",function(){n(this).remove()})};u.buildNoticeContainer=function(t){var i,r;if(t.length>0){var f=e(t[0].priority),s=n("<button/>",{type:"button","class":"close","data-dismiss":"alert","aria-hidden":!0,"aria-label":"Close"}).html('<span aria-hidden="true">&times;<\/span>'),o=n("<div/>");return u.attachLIs(o,t),i=n("<div/>",{"data-alerts-container":f,"class":"alert alert-dismissable alert-"+f,role:"alert"}),i.append(s),r=this.options.titles[f],r&&r.length>0&&i.append(n("<strong/>").html(r)),i.append(o),i}return null};u.addAlertsToContainer=function(t){var f;if(t.length>0){var r=n(this.element),o=e(t[0].priority),i=n("[data-alerts-container='"+o+"']",r);i.length>0?(f=i.find("div"),u.attachLIs(f,t)):(i=u.buildNoticeContainer(t),r.append(i))}};u.attachLIs=function(t,i){n.each(i,function(i,r){t.append('<span">&#8226;&nbsp;<\/span>').append(n("<span>").html(r.message)).append("<br />")})}},u=n.fn.bsAlerts;n.fn.bsAlerts=function(t){return this.each(function(){var u=n(this),i=u.data("bsAlerts"),f=typeof t=="object"&&t;i||u.data("bsAlerts",i=new r(this,f));typeof t=="string"&&i[t]()})};n.fn.bsAlerts.Constructor=r;n.fn.bsAlerts.defaults={titles:{},ids:"",fade:"0"};n.fn.bsAlerts.noConflict=function(){return n.fn.bsAlerts=u,this};n(i).ready(function(){n('[data-alerts="alerts"]').each(function(){var t=n(this);t.bsAlerts(t.data())})})})(jQuery,window,document);(function(n,t,i){(function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):jQuery&&!jQuery.fn.qtip&&n(jQuery)})(function(r){"use strict";function oi(n,t,i,f){this.id=i;this.target=n;this.tooltip=s;this.elements={target:n};this._id=o+"-"+i;this.timers={img:{}};this.options=t;this.plugins={};this.cache={event:{},target:r(),disabled:u,attr:f,onTooltip:u,lastClass:""};this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=u}function et(n){return n===s||r.type(n)!=="object"}function pi(n){return!(r.isFunction(n)||n&&n.attr||n.length||r.type(n)==="object"&&(n.jquery||n.then))}function dt(n){var t,e,i,o;return et(n)?u:(et(n.metadata)&&(n.metadata={type:n.metadata}),"content"in n&&(t=n.content,et(t)||t.jquery||t.done?(e=pi(t)?u:t,t=n.content={text:e}):e=t.text,"ajax"in t&&(i=t.ajax,o=i&&i.once!==u,delete t.ajax,t.text=function(n,t){var u=e||r(this).attr(t.options.content.attr)||"Loading...",f=r.ajax(r.extend({},i,{context:t})).then(i.success,s,i.error).then(function(n){return n&&o&&t.set("content.text",n),n},function(n,i,r){t.destroyed||n.status===0||t.set("content.text",i+": "+r)});return o?u:(t.set("content.text",u),f)}),"title"in t&&(r.isPlainObject(t.title)&&(t.button=t.title.button,t.title=t.title.text),pi(t.title||u)&&(t.title=u))),"position"in n&&et(n.position)&&(n.position={my:n.position,at:n.position}),"show"in n&&et(n.show)&&(n.show=n.show.jquery?{target:n.show}:n.show===f?{ready:f}:{event:n.show}),"hide"in n&&et(n.hide)&&(n.hide=n.hide.jquery?{target:n.hide}:{event:n.hide}),"style"in n&&et(n.style)&&(n.style={classes:n.style}),r.each(h,function(){this.sanitize&&this.sanitize(n)}),n)}function wi(n,t){for(var u=0,f,i=n,r=t.split(".");i=i[r[u++]];)u<r.length&&(f=i);return[f||n,r.pop()]}function yr(n,t){var i,r,u;for(i in this.checks)if(this.checks.hasOwnProperty(i))for(r in this.checks[i])this.checks[i].hasOwnProperty(r)&&(u=new RegExp(r,"i").exec(n))&&(t.push(u),(i==="builtin"||this.plugins[i])&&this.checks[i][r].apply(this.plugins[i]||this,t))}function gt(n){return ar.concat("").join(n?"-"+n+" ":" ")}function ni(n,t){if(t>0)return setTimeout(r.proxy(n,this),t);n.call(this)}function pr(n){this.tooltip.hasClass(a)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=ni.call(this,function(){this.toggle(f,n)},this.options.show.delay))}function wr(n){if(!this.tooltip.hasClass(a)&&!this.destroyed){var t=r(n.relatedTarget),i=t.closest(rt)[0]===this.tooltip[0],f=t[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==t[0]&&this.options.position.target==="mouse"&&i||this.options.hide.fixed&&/mouse(out|leave|move)/.test(n.type)&&(i||f)){try{n.preventDefault();n.stopImmediatePropagation()}catch(e){}return}this.timers.hide=ni.call(this,function(){this.toggle(u,n)},this.options.hide.delay,this)}}function si(n){!this.tooltip.hasClass(a)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=ni.call(this,function(){this.hide(n)},this.options.hide.inactive))}function di(n){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(n)}function gi(n,i,u){r(t.body).on((i.split?i:i.join("."+o+" "))+"."+o,n,function(){var n=c.api[r.attr(this,bt)];n&&!n.disabled&&u.apply(n,arguments)})}function br(n,i,e){var y,l,v,h,b,k=r(t.body),p=n[0]===t?k:n,w=n.metadata?n.metadata(e.metadata):s,d=e.metadata.type==="html5"&&w?w[e.metadata.name]:s,a=n.data(e.metadata.name||"qtipopts");try{a=typeof a=="string"?r.parseJSON(a):a}catch(g){}if(h=r.extend(f,{},c.defaults,e,typeof a=="object"?dt(a):s,dt(d||w)),l=h.position,h.id=i,"boolean"==typeof h.content.text)if(v=n.attr(h.content.attr),h.content.attr!==u&&v)h.content.text=v;else return u;if(l.container.length||(l.container=k),l.target===u&&(l.target=p),h.show.target===u&&(h.show.target=p),h.show.solo===f&&(h.show.solo=l.container.closest("body")),h.hide.target===u&&(h.hide.target=p),h.position.viewport===f&&(h.position.viewport=l.container),l.container=l.container.eq(0),l.at=new it(l.at,f),l.my=new it(l.my),n.data(o))if(h.overwrite)n.qtip("destroy",!0);else if(h.overwrite===u)return u;return n.attr(fi,i),h.suppress&&(b=n.attr("title"))&&n.removeAttr("title").attr(ut,b).attr("title",""),y=new oi(n,h,i,!!v),n.data(o,y),y}function pt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function kr(n,t){var u=t.charAt(0).toUpperCase()+t.slice(1),e=(t+" "+fr.join(u+" ")+u).split(" "),r,f,o=0;if(ri[t])return n.css(ri[t]);while(r=e[o++])if((f=n.css(r))!==i)return ri[t]=r,f}function lt(n,t){return Math.ceil(parseFloat(kr(n,t)))}function er(n,t){this._ns="tip";this.options=t;this.offset=t.offset;this.size=[t.width,t.height];this.qtip=n;this.init(n)}function or(n,t){this.options=t;this._ns="-modal";this.qtip=n;this.init(n)}function cr(n){this._ns="ie6";this.qtip=n;this.init(n)}var f=!0,u=!1,s=null,w="x",y="y",d="width",at="height",b="top",p="left",tt="bottom",k="right",l="center",lr="flipinvert",ft="shift",c,e,it,wt,h={},o="qtip",fi="data-hasqtip",bt="data-qtip-id",ar=["ui-widget","ui-tooltip"],rt="."+o,vi="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),yi=o+"-fixed",ei=o+"-default",st=o+"-focus",vr=o+"-hover",a=o+"-disabled",ht="_replacedByqTip",ut="oldtitle",kt,v={ie:function(){for(var n=4,i=t.createElement("div");(i.innerHTML="<!--[if gt IE "+n+"]><i><\/i><![endif]-->")&&i.getElementsByTagName("i")[0];n+=1);return n>4?n:NaN}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||u},bi,ki,vt,ri,fr,ai,g,ui,nt,sr,hr;e=oi.prototype;e._when=function(n){return r.when.apply(r,n)};e.render=function(n){if(this.rendered||this.destroyed)return this;var i=this,t=this.options,s=this.cache,y=this.elements,p=t.content.text,l=t.content.title,w=t.content.button,e=t.position,v=[];return r.attr(this.target[0],"aria-describedby",this._id),s.posClass=this._createPosClass((this.position={my:e.my,at:e.at}).my),this.tooltip=y.tooltip=r("<div/>",{id:this._id,"class":[o,ei,t.style.classes,s.posClass].join(" "),width:t.style.width||"",height:t.style.height||"",tracking:e.target==="mouse"&&e.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":u,"aria-describedby":this._id+"-content","aria-hidden":f}).toggleClass(a,this.disabled).attr(bt,this.id).data(o,this).appendTo(e.container).append(y.content=r("<div />",{"class":o+"-content",id:this._id+"-content","aria-atomic":f})),this.rendered=-1,this.positioning=f,l&&(this._createTitle(),r.isFunction(l)||v.push(this._updateTitle(l,u))),w&&this._createButton(),r.isFunction(p)||v.push(this._updateContent(p,u)),this.rendered=f,this._setWidget(),r.each(h,function(n){var t;this.initialize==="render"&&(t=this(i))&&(i.plugins[n]=t)}),this._unassignEvents(),this._assignEvents(),this._when(v).then(function(){i._trigger("render");i.positioning=u;!i.hiddenDuringWait&&(t.show.ready||n)&&i.toggle(f,s.event,u);i.hiddenDuringWait=u}),c.api[this.id]=this,this};e.destroy=function(n){function t(){if(!this.destroyed){this.destroyed=f;var n=this.target,i=n.attr(ut),t;this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove();r.each(this.plugins,function(){this.destroy&&this.destroy()});for(t in this.timers)this.timers.hasOwnProperty(t)&&clearTimeout(this.timers[t]);n.removeData(o).removeAttr(bt).removeAttr(fi).removeAttr("aria-describedby");this.options.suppress&&i&&n.attr("title",i).removeAttr(ut);this._unassignEvents();this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=s;delete c.api[this.id]}}if(this.destroyed)return this.target;if((n!==f||this.triggering==="hide")&&this.rendered){this.tooltip.one("tooltiphidden",r.proxy(t,this));this.triggering||this.hide()}else t.call(this);return this.target};wt=e.checks={builtin:{"^id$":function(n,t,i,e){var s=i===f?c.nextid:i,h=o+"-"+s;s!==u&&s.length>0&&!r("#"+h).length?(this._id=h,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):n[t]=e},"^prerender":function(n,t,i){i&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(n,t,i){this._updateContent(i)},"^content.attr$":function(n,t,i,r){this.options.content.text===this.target.attr(r)&&this._updateContent(this.target.attr(i))},"^content.title$":function(n,t,i){if(!i)return this._removeTitle();i&&!this.elements.title&&this._createTitle();this._updateTitle(i)},"^content.button$":function(n,t,i){this._updateButton(i)},"^content.title.(text|button)$":function(n,t,i){this.set("content."+t,i)},"^position.(my|at)$":function(n,t,i){"string"==typeof i&&(this.position[t]=n[t]=new it(i,t==="at"))},"^position.container$":function(n,t,i){this.rendered&&this.tooltip.appendTo(i)},"^show.ready$":function(n,t,i){i&&(!this.rendered&&this.render(f)||this.toggle(f))},"^style.classes$":function(n,t,i,r){this.rendered&&this.tooltip.removeClass(r).addClass(i)},"^style.(width|height)":function(n,t,i){this.rendered&&this.tooltip.css(t,i)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(n,t,i){this.rendered&&this.tooltip.toggleClass(ei,!!i)},"^events.(render|show|move|hide|focus|blur)$":function(n,t,i){this.rendered&&this.tooltip[(r.isFunction(i)?"":"un")+"bind"]("tooltip"+t,i)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var n=this.options.position;this.tooltip.attr("tracking",n.target==="mouse"&&n.adjust.mouse);this._unassignEvents();this._assignEvents()}}}};e.get=function(n){if(this.destroyed)return this;var i=wi(this.options,n.toLowerCase()),t=i[0][i[1]];return t.precedance?t.string():t};bi=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i;ki=/^prerender|show\.ready/i;e.set=function(n,t){if(this.destroyed)return this;var h=this.rendered,i=u,e=this.options,o;return"string"==typeof n?(o=n,n={},n[o]=t):n=r.extend({},n),r.each(n,function(t,u){if(h&&ki.test(t)){delete n[t];return}var f=wi(e,t.toLowerCase()),o;o=f[0][f[1]];f[0][f[1]]=u&&u.nodeType?r(u):u;i=bi.test(t)||i;n[t]=[f[0],f[1],u,o]}),dt(e),this.positioning=f,r.each(n,r.proxy(yr,this)),this.positioning=u,this.rendered&&this.tooltip[0].offsetWidth>0&&i&&this.reposition(e.position.target==="mouse"?s:this.cache.event),this};e._update=function(n,t){var i=this,e=this.cache;return!this.rendered||!n?u:(r.isFunction(n)&&(n=n.call(this.elements.target,e.event,this)||""),r.isFunction(n.then))?(e.waiting=f,n.then(function(n){return e.waiting=u,i._update(n,t)},s,function(n){return i._update(n,t)})):n===u||!n&&n!==""?u:(n.jquery&&n.length>0?t.empty().append(n.css({display:"block",visibility:"visible"})):t.html(n),this._waitForContent(t).then(function(n){i.rendered&&i.tooltip[0].offsetWidth>0&&i.reposition(e.event,!n.length)}))};e._waitForContent=function(n){var t=this.cache;return t.waiting=f,(r.fn.imagesLoaded?n.imagesLoaded():(new r.Deferred).resolve([])).done(function(){t.waiting=u}).promise()};e._updateContent=function(n,t){this._update(n,this.elements.content,t)};e._updateTitle=function(n,t){this._update(n,this.elements.title,t)===u&&this._removeTitle(u)};e._createTitle=function(){var n=this.elements,t=this._id+"-title";n.titlebar&&this._removeTitle();n.titlebar=r("<div />",{"class":o+"-titlebar "+(this.options.style.widget?gt("header"):"")}).append(n.title=r("<div />",{id:t,"class":o+"-title","aria-atomic":f})).insertBefore(n.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(n){r(this).toggleClass("ui-state-active ui-state-focus",n.type.substr(-4)==="down")}).delegate(".qtip-close","mouseover mouseout",function(n){r(this).toggleClass("ui-state-hover",n.type==="mouseover")});this.options.content.button&&this._createButton()};e._removeTitle=function(n){var t=this.elements;t.title&&(t.titlebar.remove(),t.titlebar=t.title=t.button=s,n!==u&&this.reposition())};e._createPosClass=function(n){return o+"-pos-"+(n||this.options.position.my).abbrev()};e.reposition=function(i,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=f;var c=this.cache,d=this.tooltip,a=this.options.position,o=a.target,et=a.my,g=a.at,ot=a.viewport,ht=a.container,ut=a.adjust,vt=ut.method.split(" "),ct=d.outerWidth(u),lt=d.outerHeight(u),nt=0,it=0,yt=d.css("position"),s={left:0,top:0},wt=d[0].offsetWidth>0,bt=i&&i.type==="scroll",st=r(n),pt=ht[0].ownerDocument,rt=this.mouse,y,w,ft,at;if(r.isArray(o)&&o.length===2)g={x:p,y:b},s={left:o[0],top:o[1]};else if(o==="mouse")g={x:p,y:b},(!ut.mouse||this.options.hide.distance)&&c.origin&&c.origin.pageX?i=c.origin:!i||i&&(i.type==="resize"||i.type==="scroll")?i=c.event:rt&&rt.pageX&&(i=rt),yt!=="static"&&(s=ht.offset()),pt.body.offsetWidth!==(n.innerWidth||pt.documentElement.clientWidth)&&(w=r(t.body).offset()),s={left:i.pageX-s.left+(w&&w.left||0),top:i.pageY-s.top+(w&&w.top||0)},ut.mouse&&bt&&rt&&(s.left-=(rt.scrollX||0)-st.scrollLeft(),s.top-=(rt.scrollY||0)-st.scrollTop());else{if(o==="event"?i&&i.target&&i.type!=="scroll"&&i.type!=="resize"?c.target=r(i.target):i.target||(c.target=this.elements.target):o!=="event"&&(c.target=r(o.jquery?o:this.elements.target)),o=c.target,o=r(o).eq(0),o.length===0)return this;o[0]===t||o[0]===n?(nt=v.iOS?n.innerWidth:o.width(),it=v.iOS?n.innerHeight:o.height(),o[0]===n&&(s={top:(ot||o).scrollTop(),left:(ot||o).scrollLeft()})):h.imagemap&&o.is("area")?y=h.imagemap(this,o,g,h.viewport?vt:u):h.svg&&o&&o[0].ownerSVGElement?y=h.svg(this,o,g,h.viewport?vt:u):(nt=o.outerWidth(u),it=o.outerHeight(u),s=o.offset());y&&(nt=y.width,it=y.height,w=y.offset,s=y.position);s=this.reposition.offset(o,s,ht);(v.iOS>3.1&&v.iOS<4.1||v.iOS>=4.3&&v.iOS<4.33||!v.iOS&&yt==="fixed")&&(s.left-=st.scrollLeft(),s.top-=st.scrollTop());(!y||y&&y.adjustable!==u)&&(s.left+=g.x===k?nt:g.x===l?nt/2:0,s.top+=g.y===tt?it:g.y===l?it/2:0)}return(s.left+=ut.x+(et.x===k?-ct:et.x===l?-ct/2:0),s.top+=ut.y+(et.y===tt?-lt:et.y===l?-lt/2:0),h.viewport?(ft=s.adjusted=h.viewport(this,s,a,nt,it,ct,lt),w&&ft.left&&(s.left+=w.left),w&&ft.top&&(s.top+=w.top),ft.my&&(this.position.my=ft.my)):s.adjusted={left:0,top:0},c.posClass!==(at=this._createPosClass(this.position.my))&&(c.posClass=at,d.removeClass(c.posClass).addClass(at)),!this._trigger("move",[s,ot.elem||ot],i))?this:(delete s.adjusted,e===u||!wt||isNaN(s.left)||isNaN(s.top)||o==="mouse"||!r.isFunction(a.effect)?d.css(s):r.isFunction(a.effect)&&(a.effect.call(d,this,r.extend({},s)),d.queue(function(n){r(this).css({opacity:"",height:""});v.ie&&this.style.removeAttribute("filter");n()})),this.positioning=u,this)};e.reposition.offset=function(n,i,u){function l(n,t){i.left+=t*n.scrollLeft();i.top+=t*n.scrollTop()}if(!u[0])return i;var s=r(n[0].ownerDocument),a=!!v.ie&&t.compatMode!=="CSS1Compat",f=u[0],o,h,e,c;do(h=r.css(f,"position"))!=="static"&&(h==="fixed"?(e=f.getBoundingClientRect(),l(s,-1)):(e=r(f).position(),e.left+=parseFloat(r.css(f,"borderLeftWidth"))||0,e.top+=parseFloat(r.css(f,"borderTopWidth"))||0),i.left-=e.left+(parseFloat(r.css(f,"marginLeft"))||0),i.top-=e.top+(parseFloat(r.css(f,"marginTop"))||0),o||(c=r.css(f,"overflow"))==="hidden"||c==="visible"||(o=r(f)));while(f=f.offsetParent);return o&&(o[0]!==s[0]||a)&&l(o,1),i};vt=(it=e.reposition.Corner=function(n,t){n=(""+n).replace(/([A-Z])/," $1").replace(/middle/gi,l).toLowerCase();this.x=(n.match(/left|right/i)||n.match(/center/)||["inherit"])[0].toLowerCase();this.y=(n.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase();this.forceY=!!t;var i=n.charAt(0);this.precedance=i==="t"||i==="b"?y:w}).prototype;vt.invert=function(n,t){this[n]=this[n]===p?k:this[n]===k?p:t||this[n]};vt.string=function(n){var t=this.x,i=this.y,r=t!==i?t==="center"||i!=="center"&&(this.precedance===y||this.forceY)?[i,t]:[t,i]:[t];return n!==!1?r.join(" "):r};vt.abbrev=function(){var n=this.string(!1);return n[0].charAt(0)+(n[1]&&n[1].charAt(0)||"")};vt.clone=function(){return new it(this.string(),this.forceY)};e.toggle=function(n,i){var c=this.cache,b=this.options,e=this.tooltip;if(i){if(/over|enter/.test(i.type)&&c.event&&/out|leave/.test(c.event.type)&&b.show.target.add(i.target).length===b.show.target.length&&e.has(i.relatedTarget).length)return this;c.event=r.event.fix(i)}if(this.waiting&&!n&&(this.hiddenDuringWait=f),this.rendered){if(this.destroyed||this.disabled)return this}else return n?this.render(1):this;var y=n?"show":"hide",h=this.options[y],k=this.options.position,l=this.options.content,d=this.tooltip.css("width"),g=this.tooltip.is(":visible"),nt=n||h.target.length===1,tt=!i||h.target.length<2||c.target[0]===i.target,p,w,a;if(((typeof n).search("boolean|number")&&(n=!g),p=!e.is(":animated")&&g===n&&tt,w=p?s:!!this._trigger(y,[90]),this.destroyed)||(w!==u&&n&&this.focus(i),!w||p))return this;if(r.attr(e[0],"aria-hidden",!!!n),n){if(this.mouse&&(c.origin=r.event.fix(this.mouse)),r.isFunction(l.text)&&this._updateContent(l.text,u),r.isFunction(l.title)&&this._updateTitle(l.title,u),!kt&&k.target==="mouse"&&k.adjust.mouse){r(t).on("mousemove."+o,this._storeMouse);kt=f}d||e.css("width",e.outerWidth(u));this.reposition(i,arguments[2]);d||e.css("width","");!h.solo||(typeof h.solo=="string"?r(h.solo):r(rt,h.solo)).not(e).not(h.target).qtip("hide",new r.Event("tooltipsolo"))}else clearTimeout(this.timers.show),delete c.origin,kt&&!r(rt+'[tracking="true"]:visible',h.solo).not(e).length&&(r(t).off("mousemove."+o),kt=u),this.blur(i);return a=r.proxy(function(){n?(v.ie&&e[0].style.removeAttribute("filter"),e.css("overflow",""),"string"==typeof h.autofocus&&r(this.options.show.autofocus,e).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):e.css({display:"",visibility:"",opacity:"",left:"",top:""});this._trigger(n?"visible":"hidden")},this),h.effect===u||nt===u?(e[y](),a()):r.isFunction(h.effect)?(e.stop(1,1),h.effect.call(e,this),e.queue("fx",function(n){a();n()})):e.fadeTo(90,n?1:0,a),n&&h.target.trigger("qtip-"+this.id+"-inactive"),this};e.show=function(n){return this.toggle(f,n)};e.hide=function(n){return this.toggle(u,n)};e.focus=function(n){if(!this.rendered||this.destroyed)return this;var t=r(rt),i=this.tooltip,f=parseInt(i[0].style.zIndex,10),u=c.zindex+t.length;return i.hasClass(st)||this._trigger("focus",[u],n)&&(f!==u&&(t.each(function(){this.style.zIndex>f&&(this.style.zIndex=this.style.zIndex-1)}),t.filter("."+st).qtip("blur",n)),i.addClass(st)[0].style.zIndex=u),this};e.blur=function(n){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(st),this._trigger("blur",[this.tooltip.css("zIndex")],n),this)};e.disable=function(n){return this.destroyed?this:(n==="toggle"?n=!(this.rendered?this.tooltip.hasClass(a):this.disabled):"boolean"!=typeof n&&(n=f),this.rendered&&this.tooltip.toggleClass(a,n).attr("aria-disabled",n),this.disabled=!!n,this)};e.enable=function(){return this.disable(u)};e._createButton=function(){var e=this,n=this.elements,i=n.tooltip,t=this.options.content.button,s=typeof t=="string",f=s?t:"Close tooltip";n.button&&n.button.remove();n.button=t.jquery?t:r("<a />",{"class":"qtip-close "+(this.options.style.widget?"":o+"-icon"),title:f,"aria-label":f}).prepend(r("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"}));n.button.appendTo(n.titlebar||i).attr("role","button").click(function(n){return i.hasClass(a)||e.hide(n),u})};e._updateButton=function(n){if(!this.rendered)return u;var t=this.elements.button;n?this._createButton():t.remove()};e._setWidget=function(){var t=this.options.style.widget,n=this.elements,i=n.tooltip,r=i.hasClass(a);i.removeClass(a);a=t?"ui-state-disabled":"qtip-disabled";i.toggleClass(a,r);i.toggleClass("ui-helper-reset "+gt(),t).toggleClass(ei,this.options.style.def&&!t);n.content&&n.content.toggleClass(gt("content"),t);n.titlebar&&n.titlebar.toggleClass(gt("header"),t);n.button&&n.button.toggleClass(o+"-icon",!t)};e._storeMouse=function(n){return(this.mouse=r.event.fix(n)).type="mousemove",this};e._bind=function(n,t,i,u,f){if(n&&i&&t.length){var e="."+this._id+(u?"-"+u:"");r(n).on((t.split?t:t.join(e+" "))+e,r.proxy(i,f||this));return this}};e._unbind=function(n,t){return n&&r(n).off("."+this._id+(t?"-"+t:"")),this};e._trigger=function(n,t,i){var f=new r.Event("tooltip"+n);return f.originalEvent=i&&r.extend({},i)||this.cache.event||s,this.triggering=n,this.tooltip.trigger(f,[this].concat(t||[])),this.triggering=u,!f.isDefaultPrevented()};e._bindEvents=function(n,t,i,u,f,e){var o=i.filter(u).add(u.filter(i)),s=[];o.length&&(r.each(t,function(t,i){var u=r.inArray(i,n);u>-1&&s.push(n.splice(u,1)[0])}),s.length&&(this._bind(o,s,function(n){var t=this.rendered?this.tooltip[0].offsetWidth>0:!1;(t?e:f).call(this,n)}),i=i.not(o),u=u.not(o)));this._bind(i,n,f);this._bind(u,t,e)};e._assignInitialEvents=function(n){function o(n){if(this.disabled||this.destroyed)return u;this.cache.event=n&&r.event.fix(n);this.cache.target=n&&r(n.target);clearTimeout(this.timers.show);this.timers.show=ni.call(this,function(){this.render(typeof n=="object"||t.show.ready)},t.prerender?0:t.show.delay)}var t=this.options,i=t.show.target,s=t.hide.target,h=t.show.event?r.trim(""+t.show.event).split(" "):[],e=t.hide.event?r.trim(""+t.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(){this.destroy(!0)},"destroy");/mouse(over|enter)/i.test(t.show.event)&&!/mouse(out|leave)/i.test(t.hide.event)&&e.push("mouseleave");this._bind(i,"mousemove",function(n){this._storeMouse(n);this.cache.onTarget=f});this._bindEvents(h,e,i,s,o,function(){if(!this.timers)return u;clearTimeout(this.timers.show)});(t.show.ready||t.prerender)&&o.call(this,n)};e._assignEvents=function(){var y=this,i=this.options,f=i.position,e=this.tooltip,s=i.show.target,o=i.hide.target,p=f.container,h=f.viewport,l=r(t),v=r(n),w=i.show.event?r.trim(""+i.show.event).split(" "):[],b=i.hide.event?r.trim(""+i.hide.event).split(" "):[];r.each(i.events,function(n,t){y._bind(e,n==="toggle"?["tooltipshow","tooltiphide"]:["tooltip"+n],t,null,e)});/mouse(out|leave)/i.test(i.hide.event)&&i.hide.leave==="window"&&this._bind(l,["mouseout","blur"],function(n){/select|option/.test(n.target.nodeName)||n.relatedTarget||this.hide(n)});i.hide.fixed?o=o.add(e.addClass(yi)):/mouse(over|enter)/i.test(i.show.event)&&this._bind(o,"mouseleave",function(){clearTimeout(this.timers.show)});(""+i.hide.event).indexOf("unfocus")>-1&&this._bind(p.closest("html"),["mousedown","touchstart"],function(n){var t=r(n.target),i=this.rendered&&!this.tooltip.hasClass(a)&&this.tooltip[0].offsetWidth>0,u=t.parents(rt).filter(this.tooltip[0]).length>0;t[0]===this.target[0]||t[0]===this.tooltip[0]||u||this.target.has(t[0]).length||!i||this.hide(n)});"number"==typeof i.hide.inactive&&(this._bind(s,"qtip-"+this.id+"-inactive",si,"inactive"),this._bind(o.add(e),c.inactiveEvents,si));this._bindEvents(w,b,s,o,pr,wr);this._bind(s.add(e),"mousemove",function(n){if("number"==typeof i.hide.distance){var t=this.cache.origin||{},r=this.options.hide.distance,u=Math.abs;(u(n.pageX-t.pageX)>=r||u(n.pageY-t.pageY)>=r)&&this.hide(n)}this._storeMouse(n)});f.target==="mouse"&&f.adjust.mouse&&(i.hide.event&&this._bind(s,["mouseenter","mouseleave"],function(n){if(!this.cache)return u;this.cache.onTarget=n.type==="mouseenter"}),this._bind(l,"mousemove",function(n){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(a)&&this.tooltip[0].offsetWidth>0&&this.reposition(n)}));(f.adjust.resize||h.length)&&this._bind(r.event.special.resize?h:v,"resize",di);f.adjust.scroll&&this._bind(v.add(f.container),"scroll",di)};e._unassignEvents=function(){var u=this.options,f=u.show.target,e=u.hide.target,i=r.grep([this.elements.target[0],this.rendered&&this.tooltip[0],u.position.container[0],u.position.viewport[0],u.position.container.closest("html")[0],n,t],function(n){return typeof n=="object"});f&&f.toArray&&(i=i.concat(f.toArray()));e&&e.toArray&&(i=i.concat(e.toArray()));this._unbind(i)._unbind(i,"destroy")._unbind(i,"inactive")};r(function(){gi(rt,["mouseenter","mouseleave"],function(n){var u=n.type==="mouseenter",i=r(n.currentTarget),f=r(n.relatedTarget||n.target),t=this.options;u?(this.focus(n),i.hasClass(yi)&&!i.hasClass(a)&&clearTimeout(this.timers.hide)):t.position.target==="mouse"&&t.position.adjust.mouse&&t.hide.event&&t.show.target&&!f.closest(t.show.target[0]).length&&this.hide(n);i.toggleClass(vr,u)});gi("["+bt+"]",vi,si)});c=r.fn.qtip=function(n,t,e){var a=(""+n).toLowerCase(),y=s,p=r.makeArray(arguments).slice(1),v=p[p.length-1],l=this[0]?r.data(this[0],o):s;return!arguments.length&&l||a==="api"?l:"string"==typeof n?(this.each(function(){var n=r.data(this,o);if(!n)return f;if(v&&v.timeStamp&&(n.cache.event=v),t&&(a==="option"||a==="options"))if(e!==i||r.isPlainObject(t))n.set(t,e);else return y=n.get(t),u;else n[a]&&n[a].apply(n,p)}),y!==s?y:this):"object"==typeof n||!arguments.length?(l=dt(r.extend(f,{},n)),this.each(function(n){var i,t;if(t=r.isArray(l.id)?l.id[n]:l.id,t=!t||t===u||t.length<1||c.api[t]?c.nextid++:t,i=br(r(this),t,l),i===u)return f;c.api[t]=i;r.each(h,function(){this.initialize==="initialize"&&this(i)});i._assignInitialEvents(v)})):void 0};r.qtip=oi;c.api={};r.each({attr:function(n,t){if(this.length){var u=this[0],f="title",i=r.data(u,"qtip");if(n===f&&i&&i.options&&"object"==typeof i&&"object"==typeof i.options&&i.options.suppress)return arguments.length<2?r.attr(u,ut):(i&&i.options.content.attr===f&&i.cache.attr&&i.set("content.text",t),this.attr(ut,t))}return r.fn["attr"+ht].apply(this,arguments)},clone:function(n){var t=r.fn["clone"+ht].apply(this,arguments);return n||t.filter("["+ut+"]").attr("title",function(){return r.attr(this,ut)}).removeAttr(ut),t}},function(n,t){if(!t||r.fn[n+ht])return f;var i=r.fn[n+ht]=r.fn[n];r.fn[n]=function(){return t.apply(this,arguments)||i.apply(this,arguments)}});r.ui||(r["cleanData"+ht]=r.cleanData,r.cleanData=function(n){for(var i=0,t;(t=r(n[i])).length;i++)if(t.attr(fi))try{t.triggerHandler("removeqtip")}catch(u){}r["cleanData"+ht].apply(this,arguments)});c.version="3.0.3";c.nextid=0;c.inactiveEvents=vi;c.zindex=15e3;c.defaults={prerender:u,id:u,overwrite:f,suppress:f,content:{text:f,attr:"title",title:u,button:u},position:{my:"top left",at:"bottom right",target:u,container:u,viewport:u,adjust:{x:0,y:0,mouse:f,scroll:f,resize:f,method:"flipinvert flipinvert"},effect:function(n,t){r(this).animate(t,{duration:200,queue:u})}},show:{target:u,event:"mouseenter",effect:f,delay:90,solo:u,ready:u,autofocus:u},hide:{target:u,event:"mouseleave",effect:f,delay:0,fixed:u,inactive:u,leave:"window",distance:u},style:{classes:"",widget:u,width:u,height:u,def:f},events:{render:s,move:s,show:s,hide:s,toggle:s,visible:s,hidden:s,focus:s,blur:s}};var hi,ci,ot,nr,tr,li="margin",ti="border",yt="color",ct="background-color",ir="transparent",rr=" !important",ii=!!t.createElement("canvas").getContext,ur=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i;ri={};fr=["Webkit","O","Moz","ms"];ii?(nr=n.devicePixelRatio||1,tr=function(){var n=t.createElement("canvas").getContext("2d");return n.backingStorePixelRatio||n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||1}(),ot=nr/tr):ci=function(n,t,i){return"<qtipvml:"+n+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(t||"")+' style="behavior: url(#default#VML); '+(i||"")+'" />'};r.extend(er.prototype,{init:function(n){var t,i;i=this.element=n.elements.tip=r("<div />",{"class":o+"-tip"}).prependTo(n.tooltip);ii?(t=r("<canvas />").appendTo(this.element)[0].getContext("2d"),t.lineJoin="miter",t.miterLimit=1e5,t.save()):(t=ci("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(t+t),n._bind(r("*",i).add(i),["click","mousedown"],function(n){n.stopPropagation()},this._ns));n._bind(n.tooltip,"tooltipmove",this.reposition,this._ns,this);this.create()},_swapDimensions:function(){this.size[0]=this.options.height;this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width;this.size[1]=this.options.height},_useTitle:function(n){var t=this.qtip.elements.titlebar;return t&&(n.y===b||n.y===l&&this.element.position().top+this.size[1]/2+this.options.offset<t.outerHeight(f))},_parseCorner:function(n){var t=this.qtip.options.position.my;return n===u||t===u?n=u:n===f?n=new it(t.string()):n.string||(n=new it(n),n.fixed=f),n},_parseWidth:function(n,t,i){var r=this.qtip.elements,u=ti+pt(t)+"Width";return(i?lt(i,u):lt(r.content,u)||lt(this._useTitle(n)&&r.titlebar||r.content,u)||lt(r.tooltip,u))||0},_parseRadius:function(n){var t=this.qtip.elements,i=ti+pt(n.y)+pt(n.x)+"Radius";return v.ie<9?0:lt(this._useTitle(n)&&t.titlebar||t.content,i)||lt(t.tooltip,i)||0},_invalidColour:function(n,t,i){var r=n.css(t);return!r||i&&r===n.css(i)||ur.test(r)?u:r},_parseColours:function(n){var i=this.qtip.elements,u=this.element.css("cssText",""),f=ti+pt(n[n.precedance])+pt(yt),o=this._useTitle(n)&&i.titlebar||i.content,t=this._invalidColour,e=[];return e[0]=t(u,ct)||t(o,ct)||t(i.content,ct)||t(i.tooltip,ct)||u.css(ct),e[1]=t(u,f,yt)||t(o,f,yt)||t(i.content,f,yt)||t(i.tooltip,f,yt)||i.tooltip.css(f),r("*",u).add(u).css("cssText",ct+":"+ir+rr+";"+ti+":0"+rr+";"),e},_calculateSize:function(n){var o=n.precedance===y,s=this.options.width,r=this.options.height,h=n.abbrev()==="c",c=(o?s:r)*(h?.5:1),i=Math.pow,l=Math.round,a,f,e,u=Math.sqrt(i(c,2)+i(r,2)),t=[this.border/c*u,this.border/r*u];return t[2]=Math.sqrt(i(t[0],2)-i(this.border,2)),t[3]=Math.sqrt(i(t[1],2)-i(this.border,2)),a=u+t[2]+t[3]+(h?0:t[0]),f=a/u,e=[l(f*s),l(f*r)],o?e:e.reverse()},_calculateTip:function(n,t,i){i=i||1;t=t||this.size;var r=t[0]*i,u=t[1]*i,e=Math.ceil(r/2),o=Math.ceil(u/2),f={br:[0,0,r,u,r,0],bl:[0,0,r,0,0,u],tr:[0,u,r,0,r,u],tl:[0,0,0,u,r,u],tc:[0,u,e,0,r,u],bc:[0,0,r,0,e,u],rc:[0,0,r,o,0,u],lc:[r,0,r,u,0,o]};return f.lt=f.br,f.rt=f.bl,f.lb=f.tr,f.rb=f.tl,f[n.abbrev()]},_drawCoords:function(n,t){n.beginPath();n.moveTo(t[0],t[1]);n.lineTo(t[2],t[3]);n.lineTo(t[4],t[5]);n.closePath()},create:function(){var n=this.corner=(ii||v.ie)&&this._parseCorner(this.options.corner);return this.enabled=!!this.corner&&this.corner.abbrev()!=="c",this.enabled&&(this.qtip.cache.corner=n.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(t,i){if(!this.enabled)return this;var ct=this.qtip.elements,st=this.element,rt=st.children(),ut=this.options,nt=this.size,e=ut.mimic,ft=Math.round,a,et,h,c,ht,g,o,s;t||(t=this.qtip.cache.corner||this.corner);e===u?e=t:(e=new it(e),e.precedance=t.precedance,e.x==="inherit"?e.x=t.x:e.y==="inherit"?e.y=t.y:e.x===e.y&&(e[t.precedance]=t[t.precedance]));et=e.precedance;t.precedance===w?this._swapDimensions():this._resetDimensions();a=this.color=this._parseColours(t);a[1]!==ir?(s=this.border=this._parseWidth(t,t[t.precedance]),ut.border&&s<1&&!ur.test(a[1])&&(a[0]=a[1]),this.border=s=ut.border!==f?ut.border:s):this.border=s=0;o=this.size=this._calculateSize(t);st.css({width:o[0],height:o[1],lineHeight:o[1]+"px"});g=t.precedance===y?[ft(e.x===p?s:e.x===k?o[0]-nt[0]-s:(o[0]-nt[0])/2),ft(e.y===b?o[1]-nt[1]:0)]:[ft(e.x===p?o[0]-nt[0]:0),ft(e.y===b?s:e.y===tt?o[1]-nt[1]-s:(o[1]-nt[1])/2)];ii?(h=rt[0].getContext("2d"),h.restore(),h.save(),h.clearRect(0,0,6e3,6e3),c=this._calculateTip(e,nt,ot),ht=this._calculateTip(e,this.size,ot),rt.attr(d,o[0]*ot).attr(at,o[1]*ot),rt.css(d,o[0]).css(at,o[1]),this._drawCoords(h,ht),h.fillStyle=a[1],h.fill(),h.translate(g[0]*ot,g[1]*ot),this._drawCoords(h,c),h.fillStyle=a[0],h.fill()):(c=this._calculateTip(e),c="m"+c[0]+","+c[1]+" l"+c[2]+","+c[3]+" "+c[4]+","+c[5]+" xe",g[2]=s&&/^(r|b)/i.test(t.string())?v.ie===8?2:1:0,rt.css({coordsize:o[0]+s+" "+o[1]+s,antialias:""+(e.string().indexOf(l)>-1),left:g[0]-g[2]*Number(et===w),top:g[1]-g[2]*Number(et===y),width:o[0]+s,height:o[1]+s}).each(function(n){var t=r(this);t[t.prop?"prop":"attr"]({coordsize:o[0]+s+" "+o[1]+s,path:c,fillcolor:a[0],filled:!!n,stroked:!n}).toggle(!!(s||n));n||t.html(ci("stroke",'weight="'+s*2+'px" color="'+a[1]+'" miterlimit="1000" joinstyle="miter"'))}));n.opera&&setTimeout(function(){ct.tip.css({display:"inline-block",visibility:"visible"})},1);i!==u&&this.calculate(t,o)},calculate:function(n,t){if(!this.enabled)return u;var e=this,s=this.qtip.elements,c=this.element,h=this.options.offset,i={},f,o;return n=n||this.corner,f=n.precedance,t=t||this._calculateSize(n),o=[n.x,n.y],f===w&&o.reverse(),r.each(o,function(r,u){var o,a,c;u===l?(o=f===y?p:b,i[o]="50%",i[li+"-"+o]=-Math.round(t[f===y?0:1]/2)+h):(o=e._parseWidth(n,u,s.tooltip),a=e._parseWidth(n,u,s.content),c=e._parseRadius(n),i[u]=Math.max(-e.border,r?a:h+(c>o?c:-o)))}),i[n[f]]-=t[f===w?0:1],c.css({margin:"",top:"",bottom:"",left:"",right:""}).css(i),i},reposition:function(n,t,r){function it(n,t,i,r,u){n===ft&&s.precedance===t&&h[r]&&s[i]!==l?s.precedance=s.precedance===w?y:w:n!==ft&&h[r]&&(s[t]=s[t]===l?h[r]>0?r:u:s[t]===r?u:r)}function rt(n,t,f){s[n]===l?nt[li+"-"+t]=o[n]=e[li+"-"+t]-h[t]:(a=e[f]!==i?[h[t],-e[t]]:[-h[t],e[t]],(o[n]=Math.max(a[0],a[1]))>a[0]&&(r[t]-=h[t],o[t]=u),nt[e[f]!==i?f:t]=o[n])}if(this.enabled){var c=t.cache,s=this.corner.clone(),h=r.adjusted,v=t.options.position.adjust.method.split(" "),d=v[0],g=v[1]||v[0],o={left:u,top:u,x:0,y:0},e,nt={},a;this.corner.fixed!==f&&(it(d,w,y,p,k),it(g,y,w,b,tt),(s.string()!==c.corner.string()||c.cornerTop!==h.top||c.cornerLeft!==h.left)&&this.update(s,u));e=this.calculate(s);e.right!==i&&(e.left=-e.right);e.bottom!==i&&(e.top=-e.bottom);e.user=this.offset;o.left=d===ft&&!!h.left;o.left&&rt(w,p,k);o.top=g===ft&&!!h.top;o.top&&rt(y,b,tt);this.element.css(nt).toggle(!(o.x&&o.y||s.x===l&&o.y||s.y===l&&o.x));r.left-=e.left.charAt?e.user:d!==ft||o.top||!o.left&&!o.top?e.left+this.border:0;r.top-=e.top.charAt?e.user:g!==ft||o.left||!o.left&&!o.top?e.top+this.border:0;c.cornerLeft=h.left;c.cornerTop=h.top;c.corner=s.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns);this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}});hi=h.tip=function(n){return new er(n,n.options.style.tip)};hi.initialize="render";hi.sanitize=function(n){if(n.style&&"tip"in n.style){var t=n.style.tip;typeof t!="object"&&(t=n.style.tip={corner:t});/string|boolean/i.test(typeof t.corner)||(t.corner=f)}};wt.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create();this.qtip.reposition()},"^style.tip.(height|width)$":function(n){this.size=[n.width,n.height];this.update();this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}};r.extend(f,c.defaults,{style:{tip:{corner:f,mimic:u,width:6,height:6,border:f,offset:0}}});ui="qtip-modal";nt="."+ui;g=function(){function l(n){if(r.expr[":"].focusable)return r.expr[":"].focusable;var e=!isNaN(r.attr(n,"tabindex")),t=n.nodeName&&n.nodeName.toLowerCase(),i,u,f;return"area"===t?(i=n.parentNode,u=i.name,!n.href||!u||i.nodeName.toLowerCase()!=="map")?!1:(f=r("img[usemap=#"+u+"]")[0],!!f&&f.is(":visible")):/input|select|textarea|button|object/.test(t)?!n.disabled:"a"===t?n.href||e:e}function c(n){o.length<1&&n.length?n.not("body").blur():o.first().focus()}function a(t){if(n.is(":visible")){var f=r(t.target),e=i.tooltip,o=f.closest(rt),s;s=o.length<1?u:parseInt(o[0].style.zIndex,10)>parseInt(e[0].style.zIndex,10);s||f.closest(rt)[0]===e[0]||c(f)}}var e=this,o={},i,h,n;r.extend(e,{init:function(){n=e.elem=r("<div />",{id:"qtip-overlay",html:"<div><\/div>",mousedown:function(){return u}}).hide();r(t.body).on("focusin"+nt,a);r(t).on("keydown"+nt,function(n){i&&i.options.show.modal.escape&&n.keyCode===27&&i.hide(n)});n.on("click"+nt,function(n){i&&i.options.show.modal.blur&&i.hide(n)});return e},update:function(n){i=n;o=n.options.show.modal.stealfocus!==u?n.tooltip.find("*").filter(function(){return l(this)}):[]},toggle:function(o,l,a){var p=o.tooltip,v=o.options.show.modal,y=v.effect,w=l?"show":"hide",b=n.is(":visible"),k=r(nt).filter(":visible:not(:animated)").not(p);return(e.update(o),l&&v.stealfocus!==u&&c(r(":focus")),n.toggleClass("blurs",v.blur),l&&n.appendTo(t.body),n.is(":animated")&&b===l&&h!==u||!l&&k.length)?e:(n.stop(f,u),r.isFunction(y)?y.call(n,l):y===u?n[w]():n.fadeTo(parseInt(a,10)||90,l?1:0,function(){l||n.hide()}),l||n.queue(function(t){n.css({left:"",top:""});r(nt).length||n.detach();t()}),h=l,i.destroyed&&(i=s),e)}});e.init()};g=new g;r.extend(or.prototype,{init:function(n){var t=n.tooltip;if(!this.options.on)return this;n.elements.overlay=g.elem;t.addClass(ui).css("z-index",c.modal_zindex+r(nt).length);n._bind(t,["tooltipshow","tooltiphide"],function(n,i,u){var f=n.originalEvent;if(n.target===t[0])if(f&&n.type==="tooltiphide"&&/mouse(leave|enter)/.test(f.type)&&r(f.relatedTarget).closest(g.elem[0]).length)try{n.preventDefault()}catch(e){}else(!f||f&&f.type!=="tooltipsolo")&&this.toggle(n,n.type==="tooltipshow",u)},this._ns,this);n._bind(t,"tooltipfocus",function(n,i){if(!n.isDefaultPrevented()&&n.target===t[0]){var u=r(nt),f=c.modal_zindex+u.length,e=parseInt(t[0].style.zIndex,10);g.elem[0].style.zIndex=f-1;u.each(function(){this.style.zIndex>e&&(this.style.zIndex-=1)});u.filter("."+st).qtip("blur",n.originalEvent);t.addClass(st)[0].style.zIndex=f;g.update(i);try{n.preventDefault()}catch(o){}}},this._ns,this);n._bind(t,"tooltiphide",function(n){n.target===t[0]&&r(nt).filter(":visible").not(t).last().qtip("focus",n)},this._ns,this)},toggle:function(n,t,i){if(n&&n.isDefaultPrevented())return this;g.toggle(this.qtip,!!t,i)},destroy:function(){this.qtip.tooltip.removeClass(ui);this.qtip._unbind(this.qtip.tooltip,this._ns);g.toggle(this.qtip,u);delete this.qtip.elements.overlay}});ai=h.modal=function(n){return new or(n,n.options.show.modal)};ai.sanitize=function(n){n.show&&(typeof n.show.modal!="object"?n.show.modal={on:!!n.show.modal}:typeof n.show.modal.on=="undefined"&&(n.show.modal.on=f))};c.modal_zindex=c.zindex-200;ai.initialize="render";wt.modal={"^show.modal.(on|blur)$":function(){this.destroy();this.init();this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}};r.extend(f,c.defaults,{show:{modal:{on:u,effect:f,blur:f,stealfocus:f,escape:f}}});h.viewport=function(i,r,f,e,o,s,h){function wt(n,t,i,u,f,e,o,s,h){var y=r[f],c=a[n],k=kt[n],rt=i===ft,g=c===f?h:c===e?-h:-h/2,ut=k===f?s:k===e?-s:-s/2,tt=lt[f]+it[f]-(pt?0:nt[f]),b=tt-y,w=y+h-(o===d?ht:ct)-tt,p=g-(a.precedance===n||c===a[t]?ut:0)-(k===l?s/2:0);return rt?(p=(c===f?1:-1)*g,r[f]+=b>0?b:w>0?-w:0,r[f]=Math.max(-nt[f]+it[f],y-p,Math.min(Math.max(-nt[f]+it[f]+(o===d?ht:ct),y+p),r[f],c==="center"?y-g:1e9))):(u*=i===lr?2:0,b>0&&(c!==f||w>0)?(r[f]-=p+u,v.invert(n,f)):w>0&&(c!==e||b>0)&&(r[f]-=(c===l?-p:p)+u,v.invert(n,e)),r[f]<lt[f]&&-r[f]>w&&(r[f]=y,v=a.clone())),r[f]-y}var vt=f.target,bt=i.elements.tooltip,a=f.my,kt=f.at,g=f.adjust,rt=g.method.split(" "),ut=rt[0],et=rt[1]||rt[0],c=f.viewport,yt=f.container,ot={left:0,top:0},st,v,nt,pt,ht,ct,lt,it;return!c.jquery||vt[0]===n||vt[0]===t.body||g.method==="none"?ot:(nt=yt.offset()||ot,pt=yt.css("position")==="static",st=bt.css("position")==="fixed",ht=c[0]===n?c.width():c.outerWidth(u),ct=c[0]===n?c.height():c.outerHeight(u),lt={left:st?0:c.scrollLeft(),top:st?0:c.scrollTop()},it=c.offset()||ot,(ut!=="shift"||et!=="shift")&&(v=a.clone()),{left:ut!=="none"?wt(w,y,ut,g.x,p,k,d,e,s):0,top:et!=="none"?wt(y,w,et,g.y,b,tt,at,o,h):0,my:v})};h.polys={polygon:function(n,t){for(var i={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:u},f=0,r,e=[],o=1,s=1,a=0,v=0,h,c,f=n.length;f--;)r=[parseInt(n[--f],10),parseInt(n[f+1],10)],r[0]>i.position.right&&(i.position.right=r[0]),r[0]<i.position.left&&(i.position.left=r[0]),r[1]>i.position.bottom&&(i.position.bottom=r[1]),r[1]<i.position.top&&(i.position.top=r[1]),e.push(r);if(h=i.width=Math.abs(i.position.right-i.position.left),c=i.height=Math.abs(i.position.bottom-i.position.top),t.abbrev()==="c")i.position={left:i.position.left+i.width/2,top:i.position.top+i.height/2};else{while(h>0&&c>0&&o>0&&s>0)for(h=Math.floor(h/2),c=Math.floor(c/2),t.x===p?o=h:t.x===k?o=i.width-h:o+=Math.floor(h/2),t.y===b?s=c:t.y===tt?s=i.height-c:s+=Math.floor(c/2),f=e.length;f--;){if(e.length<2)break;a=e[f][0]-i.position.left;v=e[f][1]-i.position.top;(t.x===p&&a>=o||t.x===k&&a<=o||t.x===l&&(a<o||a>i.width-o)||t.y===b&&v>=s||t.y===tt&&v<=s||t.y===l&&(v<s||v>i.height-s))&&e.splice(f,1)}i.position={left:e[0][0],top:e[0][1]}}return i},rect:function(n,t,i,r){return{width:Math.abs(i-n),height:Math.abs(r-t),position:{left:Math.min(n,i),top:Math.min(t,r)}}},_angles:{tc:3/2,tr:7/4,tl:5/4,bc:1/2,br:1/4,bl:3/4,rc:2,lc:1,c:0},ellipse:function(n,t,i,r,f){var e=h.polys._angles[f.abbrev()],o=e===0?0:i*Math.cos(e*Math.PI),s=r*Math.sin(e*Math.PI);return{width:i*2-Math.abs(o),height:r*2-Math.abs(s),position:{left:n+o,top:t+s},adjustable:u}},circle:function(n,t,i,r){return h.polys.ellipse(n,t,i,i,r)}};h.svg=function(n,i,f){for(var e=i[0],a=r(e.ownerSVGElement),l=e.ownerDocument,b=(parseInt(i.css("stroke-width"),10)||0)/2,v,k,p,d,w,y,s,o,c;!e.getBBox;)e=e.parentNode;if(!e.getBBox||!e.parentNode)return u;switch(e.nodeName){case"ellipse":case"circle":o=h.polys.ellipse(e.cx.baseVal.value,e.cy.baseVal.value,(e.rx||e.r).baseVal.value+b,(e.ry||e.r).baseVal.value+b,f);break;case"line":case"polygon":case"polyline":for(s=e.points||[{x:e.x1.baseVal.value,y:e.y1.baseVal.value},{x:e.x2.baseVal.value,y:e.y2.baseVal.value}],o=[],y=-1,d=s.numberOfItems||s.length;++y<d;)w=s.getItem?s.getItem(y):s[y],o.push.apply(o,[w.x,w.y]);o=h.polys.polygon(o,f);break;default:o=e.getBBox();o={width:o.width,height:o.height,position:{left:o.x,top:o.y}}}return c=o.position,a=a[0],a.createSVGPoint&&(k=e.getScreenCTM(),s=a.createSVGPoint(),s.x=c.left,s.y=c.top,p=s.matrixTransform(k),c.left=p.x,c.top=p.y),l!==t&&n.position.target!=="mouse"&&(v=r((l.defaultView||l.parentWindow).frameElement).offset(),v&&(c.left+=v.left,c.top+=v.top)),l=r(l),c.left+=l.scrollLeft(),c.top+=l.scrollTop(),o};h.imagemap=function(n,t,i){t.jquery||(t=r(t));var s=(t.attr("shape")||"rect").toLowerCase().replace("poly","polygon"),f=r('img[usemap="#'+t.parent("map").attr("name")+'"]'),y=r.trim(t.attr("coords")),c=y.replace(/,$/,"").split(","),e,l,a,o,v;if(!f.length)return u;if(s==="polygon")o=h.polys.polygon(c,i);else if(h.polys[s]){for(a=-1,v=c.length,l=[];++a<v;)l.push(parseInt(c[a],10));o=h.polys[s].apply(this,l.concat(i))}else return u;return e=f.offset(),e.left+=Math.ceil((f.outerWidth(u)-f.width())/2),e.top+=Math.ceil((f.outerHeight(u)-f.height())/2),o.position.left+=e.left,o.position.top+=e.top,o};hr='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';"  style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"><\/iframe>';r.extend(cr.prototype,{_scroll:function(){var t=this.qtip.elements.overlay;t&&(t[0].style.top=r(n).scrollTop()+"px")},init:function(i){var u=i.tooltip;r("select, object").length<1&&(this.bgiframe=i.elements.bgiframe=r(hr).appendTo(u),i._bind(u,"tooltipmove",this.adjustBGIFrame,this._ns,this));this.redrawContainer=r("<div/>",{id:o+"-rcontainer"}).appendTo(t.body);i.elements.overlay&&i.elements.overlay.addClass("qtipmodal-ie6fix")&&(i._bind(n,["scroll","resize"],this._scroll,this._ns,this),i._bind(u,["tooltipshow"],this._scroll,this._ns,this));this.redraw()},adjustBGIFrame:function(){var t=this.qtip.tooltip,e={height:t.outerHeight(u),width:t.outerWidth(u)},r=this.qtip.plugins.tip,f=this.qtip.elements.tip,i,n;n=parseInt(t.css("borderLeftWidth"),10)||0;n={left:-n,top:-n};r&&f&&(i=r.corner.precedance==="x"?[d,p]:[at,b],n[i[1]]-=f[i[0]]());this.bgiframe.css(n).css(e)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var t=this.qtip.tooltip,u=this.qtip.options.style,e=this.qtip.options.position.container,f,n,i,r;return this.qtip.drawing=1,u.height&&t.css(at,u.height),u.width?t.css(d,u.width):(t.css(d,"").appendTo(this.redrawContainer),n=t.width(),n%2<1&&(n+=1),i=t.css("maxWidth")||"",r=t.css("minWidth")||"",f=(i+r).indexOf("%")>-1?e.width()/100:0,i=(i.indexOf("%")>-1?f:1*parseInt(i,10))||n,r=(r.indexOf("%")>-1?f:1*parseInt(r,10))||0,n=i+r?Math.min(Math.max(n,r),i):n,t.css(d,Math.round(n)).appendTo(e)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove();this.qtip._unbind([n,this.qtip.tooltip],this._ns)}});sr=h.ie6=function(n){return v.ie===6?new cr(n):u};sr.initialize="render";wt.ie6={"^content|style$":function(){this.redraw()}}})})(window,document);(function(n){"use strict";n(["jquery"],function(n){function i(t){return n.isFunction(t)||typeof t=="object"?t:{top:t,left:t}}var t=n.scrollTo=function(t,i,r){return n(window).scrollTo(t,i,r)};return t.defaults={axis:"xy",duration:parseFloat(n.fn.jquery)>=1.3?0:1,limit:!0},t.window=function(){return n(window)._scrollable()},n.fn._scrollable=function(){return this.map(function(){var t=this,r=!t.nodeName||n.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1,i;return r?(i=(t.contentWindow||t).document||t.ownerDocument||t,/webkit/i.test(navigator.userAgent)||i.compatMode=="BackCompat"?i.body:i.documentElement):t})},n.fn.scrollTo=function(r,u,f){return typeof u=="object"&&(f=u,u=0),typeof f=="function"&&(f={onAfter:f}),r=="max"&&(r=9e9),f=n.extend({},t.defaults,f),u=u||f.duration,f.queue=f.queue&&f.axis.length>1,f.queue&&(u/=2),f.offset=i(f.offset),f.over=i(f.over),this._scrollable().each(function(){function v(n){h.animate(o,u,f.easing,n&&function(){n.call(this,e,f)})}var a;if(r!=null){var s=this,h=n(s),e=r,c,o={},l=h.is("html,body");switch(typeof e){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(e)){e=i(e);break}if(e=l?n(e):n(e,this),!e.length)return;case"object":(e.is||e.style)&&(c=(e=n(e)).offset())}a=n.isFunction(f.offset)&&f.offset(s,e)||f.offset;n.each(f.axis.split(""),function(n,i){var p=i=="x"?"Left":"Top",u=p.toLowerCase(),r="scroll"+p,w=s[r],b=t.max(s,i),y;c?(o[r]=c[u]+(l?0:w-h.offset()[u]),f.margin&&(o[r]-=parseInt(e.css("margin"+p))||0,o[r]-=parseInt(e.css("border"+p+"Width"))||0),o[r]+=a[u]||0,f.over[u]&&(o[r]+=e[i=="x"?"width":"height"]()*f.over[u])):(y=e[u],o[r]=y.slice&&y.slice(-1)=="%"?parseFloat(y)/100*b:y);f.limit&&/^\d+$/.test(o[r])&&(o[r]=o[r]<=0?0:Math.min(o[r],b));!n&&f.queue&&(w!=o[r]&&v(f.onAfterFirst),delete o[r])});v(f.onAfter)}}).end()},t.max=function(t,i){var r=i=="x"?"Width":"Height",u="scroll"+r;if(!n(t).is("html,body"))return t[u]-n(t)[r.toLowerCase()]();var f="client"+r,e=t.ownerDocument.documentElement,o=t.ownerDocument.body;return Math.max(e[u],o[u])-Math.min(e[f],o[f])},t})})(typeof define=="function"&&define.amd?define:function(n,t){typeof module!="undefined"&&module.exports?module.exports=t(require("jquery")):t(jQuery)});function restArguments(n,t){return t=t==null?n.length-1:+t,function(){for(var f=Math.max(arguments.length-t,0),r=Array(f),i=0,u;i<f;i++)r[i]=arguments[i+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r);case 2:return n.call(this,arguments[0],arguments[1],r)}for(u=Array(t+1),i=0;i<t;i++)u[i]=arguments[i];return u[t]=r,n.apply(this,u)}}function isObject(n){var t=typeof n;return t==="function"||t==="object"&&!!n}function isNull(n){return n===null}function isUndefined(n){return n===void 0}function isBoolean(n){return n===!0||n===!1||toString.call(n)==="[object Boolean]"}function isElement(n){return!!(n&&n.nodeType===1)}function tagTester(n){var t="[object "+n+"]";return function(n){return toString.call(n)===t}}function ie10IsDataView(n){return n!=null&&isFunction$1(n.getInt8)&&isArrayBuffer(n.buffer)}function has$1(n,t){return n!=null&&hasOwnProperty.call(n,t)}function isFinite$1(n){return!isSymbol(n)&&_isFinite(n)&&!isNaN(parseFloat(n))}function isNaN$1(n){return isNumber(n)&&_isNaN(n)}function constant(n){return function(){return n}}function createSizePropertyCheck(n){return function(t){var i=n(t);return typeof i=="number"&&i>=0&&i<=MAX_ARRAY_INDEX}}function shallowProperty(n){return function(t){if(t!=null)return t[n]}}function isTypedArray(n){return nativeIsView?nativeIsView(n)&&!isDataView$1(n):isBufferLike(n)&&typedArrayPattern.test(toString.call(n))}function emulatedSet(n){for(var i={},r=n.length,t=0;t<r;++t)i[n[t]]=!0;return{contains:function(n){return i[n]===!0},push:function(t){return i[t]=!0,n.push(t)}}}function collectNonEnumProps(n,t){t=emulatedSet(t);var r=nonEnumerableProps.length,u=n.constructor,f=isFunction$1(u)&&u.prototype||ObjProto,i="constructor";for(has$1(n,i)&&!t.contains(i)&&t.push(i);r--;)i=nonEnumerableProps[r],i in n&&n[i]!==f[i]&&!t.contains(i)&&t.push(i)}function keys(n){var t,i;if(!isObject(n))return[];if(nativeKeys)return nativeKeys(n);t=[];for(i in n)has$1(n,i)&&t.push(i);return hasEnumBug&&collectNonEnumProps(n,t),t}function isEmpty(n){if(n==null)return!0;var t=getLength(n);return typeof t=="number"&&(isArray(n)||isString(n)||isArguments$1(n))?t===0:getLength(keys(n))===0}function isMatch(n,t){var f=keys(t),e=f.length,u,i,r;if(n==null)return!e;for(u=Object(n),i=0;i<e;i++)if(r=f[i],t[r]!==u[r]||!(r in u))return!1;return!0}function _$1(n){if(n instanceof _$1)return n;if(!(this instanceof _$1))return new _$1(n);this._wrapped=n}function toBufferView(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,getByteLength(n))}function eq(n,t,i,r){if(n===t)return n!==0||1/n==1/t;if(n==null||t==null)return!1;if(n!==n)return t!==t;var u=typeof n;return u!=="function"&&u!=="object"&&typeof t!="object"?!1:deepEq(n,t,i,r)}function deepEq(n,t,i,r){var f,e,l,o,s,u,c,h;if(n instanceof _$1&&(n=n._wrapped),t instanceof _$1&&(t=t._wrapped),f=toString.call(n),f!==toString.call(t))return!1;if(hasStringTagBug&&f=="[object Object]"&&isDataView$1(n)){if(!isDataView$1(t))return!1;f=tagDataView}switch(f){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!=+n?+t!=+t:+n==0?1/+n==1/t:+n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object Symbol]":return SymbolProto.valueOf.call(n)===SymbolProto.valueOf.call(t);case"[object ArrayBuffer]":case tagDataView:return deepEq(toBufferView(n),toBufferView(t),i,r)}if(e=f==="[object Array]",!e&&isTypedArray$1(n)){if(l=getByteLength(n),l!==getByteLength(t))return!1;if(n.buffer===t.buffer&&n.byteOffset===t.byteOffset)return!0;e=!0}if(!e&&(typeof n!="object"||typeof t!="object"||(o=n.constructor,s=t.constructor,o!==s&&!(isFunction$1(o)&&o instanceof o&&isFunction$1(s)&&s instanceof s)&&"constructor"in n&&"constructor"in t)))return!1;for(i=i||[],r=r||[],u=i.length;u--;)if(i[u]===n)return r[u]===t;if(i.push(n),r.push(t),e){if(u=n.length,u!==t.length)return!1;while(u--)if(!eq(n[u],t[u],i,r))return!1}else{if(c=keys(n),u=c.length,keys(t).length!==u)return!1;while(u--)if(h=c[u],!(has$1(t,h)&&eq(n[h],t[h],i,r)))return!1}return i.pop(),r.pop(),!0}function isEqual(n,t){return eq(n,t)}function allKeys(n){var t,i;if(!isObject(n))return[];t=[];for(i in n)t.push(i);return hasEnumBug&&collectNonEnumProps(n,t),t}function ie11fingerprint(n){var t=getLength(n);return function(i){var u,r;if(i==null||(u=allKeys(i),getLength(u)))return!1;for(r=0;r<t;r++)if(!isFunction$1(i[n[r]]))return!1;return n!==weakMapMethods||!isFunction$1(i[forEachName])}}function values(n){for(var i=keys(n),r=i.length,u=Array(r),t=0;t<r;t++)u[t]=n[i[t]];return u}function pairs(n){for(var i=keys(n),r=i.length,u=Array(r),t=0;t<r;t++)u[t]=[i[t],n[i[t]]];return u}function invert(n){for(var r={},i=keys(n),t=0,u=i.length;t<u;t++)r[n[i[t]]]=i[t];return r}function functions(n){var i=[],t;for(t in n)isFunction$1(n[t])&&i.push(t);return i.sort()}function createAssigner(n,t){return function(i){var e=arguments.length,r,u,f;if(t&&(i=Object(i)),e<2||i==null)return i;for(r=1;r<e;r++){var o=arguments[r],s=n(o),h=s.length;for(u=0;u<h;u++)f=s[u],t&&i[f]!==void 0||(i[f]=o[f])}return i}}function ctor(){return function(){}}function baseCreate(n){var t,i;return isObject(n)?nativeCreate?nativeCreate(n):(t=ctor(),t.prototype=n,i=new t,t.prototype=null,i):{}}function create(n,t){var i=baseCreate(n);return t&&extendOwn(i,t),i}function clone(n){return isObject(n)?isArray(n)?n.slice():extend({},n):n}function tap(n,t){return t(n),n}function toPath$1(n){return isArray(n)?n:[n]}function toPath(n){return _$1.toPath(n)}function deepGet(n,t){for(var r=t.length,i=0;i<r;i++){if(n==null)return void 0;n=n[t[i]]}if(r)return n}function get(n,t,i){var r=deepGet(n,toPath(t));return isUndefined(r)?i:r}function has(n,t){var r,i,u;for(t=toPath(t),r=t.length,i=0;i<r;i++){if(u=t[i],!has$1(n,u))return!1;n=n[u]}return!!r}function identity(n){return n}function matcher(n){return n=extendOwn({},n),function(t){return isMatch(t,n)}}function property(n){return n=toPath(n),function(t){return deepGet(t,n)}}function optimizeCb(n,t,i){if(t===void 0)return n;switch(i==null?3:i){case 1:return function(i){return n.call(t,i)};case 3:return function(i,r,u){return n.call(t,i,r,u)};case 4:return function(i,r,u,f){return n.call(t,i,r,u,f)}}return function(){return n.apply(t,arguments)}}function baseIteratee(n,t,i){return n==null?identity:isFunction$1(n)?optimizeCb(n,t,i):isObject(n)&&!isArray(n)?matcher(n):property(n)}function iteratee(n,t){return baseIteratee(n,t,Infinity)}function cb(n,t,i){return _$1.iteratee!==iteratee?_$1.iteratee(n,t):baseIteratee(n,t,i)}function mapObject(n,t,i){var r,u;t=cb(t,i);var f=keys(n),o=f.length,e={};for(r=0;r<o;r++)u=f[r],e[u]=t(n[u],u,n);return e}function noop(){}function propertyOf(n){return n==null?noop:function(t){return get(n,t)}}function times(n,t,i){var u=Array(Math.max(0,n)),r;for(t=optimizeCb(t,i,1),r=0;r<n;r++)u[r]=t(r);return u}function random(n,t){return t==null&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))}function createEscaper(n){var i=function(t){return n[t]},t="(?:"+keys(n).join("|")+")",r=RegExp(t),u=RegExp(t,"g");return function(n){return n=n==null?"":""+n,r.test(n)?n.replace(u,i):n}}function escapeChar(n){return"\\"+escapes[n]}function template(n,t,i){var u,o,f;!t&&i&&(t=i);t=defaults({},t,_$1.templateSettings);var h=RegExp([(t.escape||noMatch).source,(t.interpolate||noMatch).source,(t.evaluate||noMatch).source].join("|")+"|$","g"),e=0,r="__p+='";if(n.replace(h,function(t,i,u,f,o){return r+=n.slice(e,o).replace(escapeRegExp,escapeChar),e=o+t.length,i?r+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":u?r+="'+\n((__t=("+u+"))==null?'':__t)+\n'":f&&(r+="';\n"+f+"\n__p+='"),t}),r+="';\n",u=t.variable,u){if(!bareIdentifier.test(u))throw new Error("variable is not a bare identifier: "+u);}else r="with(obj||{}){\n"+r+"}\n",u="obj";r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+r+"return __p;\n";try{o=new Function(u,"_",r)}catch(s){s.source=r;throw s;}return f=function(n){return o.call(this,n,_$1)},f.source="function("+u+"){\n"+r+"}",f}function result(n,t,i){var f,u,r;if(t=toPath(t),f=t.length,!f)return isFunction$1(i)?i.call(n):i;for(u=0;u<f;u++)r=n==null?void 0:n[t[u]],r===void 0&&(r=i,u=f),n=isFunction$1(r)?r.call(n):r;return n}function uniqueId(n){var t=++idCounter+"";return n?n+t:t}function chain(n){var t=_$1(n);return t._chain=!0,t}function executeBound(n,t,i,r,u){if(!(r instanceof t))return n.apply(i,u);var f=baseCreate(n.prototype),e=n.apply(f,u);return isObject(e)?e:f}function flatten$1(n,t,i,r){var f,e,s,u,o,h;if(r=r||[],t||t===0){if(t<=0)return r.concat(n)}else t=Infinity;for(f=r.length,e=0,s=getLength(n);e<s;e++)if(u=n[e],isArrayLike(u)&&(isArray(u)||isArguments$1(u)))if(t>1)flatten$1(u,t-1,i,r),f=r.length;else for(o=0,h=u.length;o<h;)r[f++]=u[o++];else i||(r[f++]=u);return r}function memoize(n,t){var i=function(r){var u=i.cache,f=""+(t?t.apply(this,arguments):r);return has$1(u,f)||(u[f]=n.apply(this,arguments)),u[f]};return i.cache={},i}function throttle(n,t,i){var r,u,f,o,e=0,h,s;return i||(i={}),h=function(){e=i.leading===!1?0:now();r=null;o=n.apply(u,f);r||(u=f=null)},s=function(){var c=now(),s;return e||i.leading!==!1||(e=c),s=t-(c-e),u=this,f=arguments,s<=0||s>t?(r&&(clearTimeout(r),r=null),e=c,o=n.apply(u,f),r||(u=f=null)):r||i.trailing===!1||(r=setTimeout(h,s)),o},s.cancel=function(){clearTimeout(r);e=0;r=u=f=null},s}function debounce(n,t,i){var r,o,u,e,f,s=function(){var h=now()-o;t>h?r=setTimeout(s,t-h):(r=null,i||(e=n.apply(f,u)),r||(u=f=null))},h=restArguments(function(h){return f=this,u=h,o=now(),r||(r=setTimeout(s,t),i&&(e=n.apply(f,u))),e});return h.cancel=function(){clearTimeout(r);r=u=f=null},h}function wrap(n,t){return partial(t,n)}function negate(n){return function(){return!n.apply(this,arguments)}}function compose(){var n=arguments,t=n.length-1;return function(){for(var r=t,i=n[t].apply(this,arguments);r--;)i=n[r].call(this,i);return i}}function after(n,t){return function(){if(--n<1)return t.apply(this,arguments)}}function before(n,t){var i;return function(){return--n>0&&(i=t.apply(this,arguments)),n<=1&&(t=null),i}}function findKey(n,t,i){var f,r,u,e;for(t=cb(t,i),f=keys(n),u=0,e=f.length;u<e;u++)if(r=f[u],t(n[r],r,n))return r}function createPredicateIndexFinder(n){return function(t,i,r){i=cb(i,r);for(var f=getLength(t),u=n>0?0:f-1;u>=0&&u<f;u+=n)if(i(t[u],u,t))return u;return-1}}function sortedIndex(n,t,i,r){var f;i=cb(i,r,1);for(var o=i(t),u=0,e=getLength(n);u<e;)f=Math.floor((u+e)/2),i(n[f])<o?u=f+1:e=f;return u}function createIndexFinder(n,t,i){return function(r,u,f){var o=0,e=getLength(r);if(typeof f=="number")n>0?o=f>=0?f:Math.max(f+e,o):e=f>=0?Math.min(f+1,e):f+e+1;else if(i&&f&&e)return f=i(r,u),r[f]===u?f:-1;if(u!==u)return f=t(slice.call(r,o,e),isNaN$1),f>=0?f+o:-1;for(f=n>0?o:e-1;f>=0&&f<e;f+=n)if(r[f]===u)return f;return-1}}function find(n,t,i){var u=isArrayLike(n)?findIndex:findKey,r=u(n,t,i);if(r!==void 0&&r!==-1)return n[r]}function findWhere(n,t){return find(n,matcher(t))}function each(n,t,i){var r,u,f;if(t=optimizeCb(t,i),isArrayLike(n))for(r=0,u=n.length;r<u;r++)t(n[r],r,n);else for(f=keys(n),r=0,u=f.length;r<u;r++)t(n[f[r]],f[r],n);return n}function map(n,t,i){var r,f;t=cb(t,i);var u=!isArrayLike(n)&&keys(n),e=(u||n).length,o=Array(e);for(r=0;r<e;r++)f=u?u[r]:r,o[r]=t(n[f],f,n);return o}function createReduce(n){var t=function(t,i,r,u){var e=!isArrayLike(t)&&keys(t),s=(e||t).length,f=n>0?0:s-1,o;for(u||(r=t[e?e[f]:f],f+=n);f>=0&&f<s;f+=n)o=e?e[f]:f,r=i(r,t[o],o,t);return r};return function(n,i,r,u){var f=arguments.length>=3;return t(n,optimizeCb(i,u,4),r,f)}}function filter(n,t,i){var r=[];return t=cb(t,i),each(n,function(n,i,u){t(n,i,u)&&r.push(n)}),r}function reject(n,t,i){return filter(n,negate(cb(t)),i)}function every(n,t,i){var u,e,r,f;for(t=cb(t,i),u=!isArrayLike(n)&&keys(n),e=(u||n).length,r=0;r<e;r++)if(f=u?u[r]:r,!t(n[f],f,n))return!1;return!0}function some(n,t,i){var u,e,r,f;for(t=cb(t,i),u=!isArrayLike(n)&&keys(n),e=(u||n).length,r=0;r<e;r++)if(f=u?u[r]:r,t(n[f],f,n))return!0;return!1}function contains(n,t,i,r){return isArrayLike(n)||(n=values(n)),(typeof i!="number"||r)&&(i=0),indexOf(n,t,i)>=0}function pluck(n,t){return map(n,property(t))}function where(n,t){return filter(n,matcher(t))}function max(n,t,i){var r=-Infinity,o=-Infinity,u,f,e,s;if(t==null||typeof t=="number"&&typeof n[0]!="object"&&n!=null)for(n=isArrayLike(n)?n:values(n),e=0,s=n.length;e<s;e++)u=n[e],u!=null&&u>r&&(r=u);else t=cb(t,i),each(n,function(n,i,u){f=t(n,i,u);(f>o||f===-Infinity&&r===-Infinity)&&(r=n,o=f)});return r}function min(n,t,i){var r=Infinity,o=Infinity,u,f,e,s;if(t==null||typeof t=="number"&&typeof n[0]!="object"&&n!=null)for(n=isArrayLike(n)?n:values(n),e=0,s=n.length;e<s;e++)u=n[e],u!=null&&u<r&&(r=u);else t=cb(t,i),each(n,function(n,i,u){f=t(n,i,u);(f<o||f===Infinity&&r===Infinity)&&(r=n,o=f)});return r}function toArray(n){return n?isArray(n)?slice.call(n):isString(n)?n.match(reStrSymbol):isArrayLike(n)?map(n,identity):values(n):[]}function sample(n,t,i){var r,f,o,u,e,s;if(t==null||i)return isArrayLike(n)||(n=values(n)),n[random(n.length-1)];for(r=toArray(n),f=getLength(r),t=Math.max(Math.min(t,f),0),o=f-1,u=0;u<t;u++)e=random(u,o),s=r[u],r[u]=r[e],r[e]=s;return r.slice(0,t)}function shuffle(n){return sample(n,Infinity)}function sortBy(n,t,i){var r=0;return t=cb(t,i),pluck(map(n,function(n,i,u){return{value:n,index:r++,criteria:t(n,i,u)}}).sort(function(n,t){var i=n.criteria,r=t.criteria;if(i!==r){if(i>r||i===void 0)return 1;if(i<r||r===void 0)return-1}return n.index-t.index}),"value")}function group(n,t){return function(i,r,u){var f=t?[[],[]]:{};return r=cb(r,u),each(i,function(t,u){var e=r(t,u,i);n(f,t,e)}),f}}function size(n){return n==null?0:isArrayLike(n)?n.length:keys(n).length}function keyInObj(n,t,i){return t in i}function initial(n,t,i){return slice.call(n,0,Math.max(0,n.length-(t==null||i?1:t)))}function first(n,t,i){return n==null||n.length<1?t==null||i?void 0:[]:t==null||i?n[0]:initial(n,n.length-t)}function rest(n,t,i){return slice.call(n,t==null||i?1:t)}function last(n,t,i){return n==null||n.length<1?t==null||i?void 0:[]:t==null||i?n[n.length-1]:rest(n,Math.max(0,n.length-t))}function compact(n){return filter(n,Boolean)}function flatten(n,t){return flatten$1(n,t,!1)}function uniq(n,t,i,r){var f,o,e,h,u,s;for(isBoolean(t)||(r=i,i=t,t=!1),i!=null&&(i=cb(i,r)),f=[],o=[],e=0,h=getLength(n);e<h;e++)u=n[e],s=i?i(u,e,n):u,t&&!i?(e&&o===s||f.push(u),o=s):i?contains(o,s)||(o.push(s),f.push(u)):contains(f,u)||f.push(u);return f}function intersection(n){for(var u=[],f=arguments.length,r,t,i=0,e=getLength(n);i<e;i++)if(r=n[i],!contains(u,r)){for(t=1;t<f;t++)if(!contains(arguments[t],r))break;t===f&&u.push(r)}return u}function unzip(n){for(var i=n&&max(n,getLength).length||0,r=Array(i),t=0;t<i;t++)r[t]=pluck(n,t);return r}function object(n,t){for(var r={},i=0,u=getLength(n);i<u;i++)t?r[n[i]]=t[i]:r[n[i][0]]=n[i][1];return r}function range(n,t,i){var u,f,r;for(t==null&&(t=n||0,n=0),i||(i=t<n?-1:1),u=Math.max(Math.ceil((t-n)/i),0),f=Array(u),r=0;r<u;r++,n+=i)f[r]=n;return f}function chunk(n,t){if(t==null||t<1)return[];for(var r=[],i=0,u=n.length;i<u;)r.push(slice.call(n,i,i+=t));return r}function chainResult(n,t){return n._chain?_$1(t).chain():t}function mixin(n){return each(functions(n),function(t){var i=_$1[t]=n[t];_$1.prototype[t]=function(){var n=[this._wrapped];return push.apply(n,arguments),chainResult(this,i.apply(_$1,n))}}),_$1}var VERSION="1.13.4",root=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},ArrayProto=Array.prototype,ObjProto=Object.prototype,SymbolProto=typeof Symbol!="undefined"?Symbol.prototype:null,push=ArrayProto.push,slice=ArrayProto.slice,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty,supportsArrayBuffer=typeof ArrayBuffer!="undefined",supportsDataView=typeof DataView!="undefined",nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeCreate=Object.create,nativeIsView=supportsArrayBuffer&&ArrayBuffer.isView,_isNaN=isNaN,_isFinite=isFinite,hasEnumBug=!{toString:null}.propertyIsEnumerable("toString"),nonEnumerableProps=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],MAX_ARRAY_INDEX=Math.pow(2,53)-1,isString=tagTester("String"),isNumber=tagTester("Number"),isDate=tagTester("Date"),isRegExp=tagTester("RegExp"),isError=tagTester("Error"),isSymbol=tagTester("Symbol"),isArrayBuffer=tagTester("ArrayBuffer"),isFunction=tagTester("Function"),nodelist=root.document&&root.document.childNodes,isDataView$1,isArray,isArguments,isArguments$1,isTypedArray$1,getLength,tagDataView,now,bareIdentifier,idCounter,partial,bind,isArrayLike,bindAll,delay,defer,once,findIndex,findLastIndex,indexOf,lastIndexOf,reduce,reduceRight,invoke,reStrSymbol,pick,omit,difference,without,union,zip,allExports,_;typeof/./!="function"&&typeof Int8Array!="object"&&typeof nodelist!="function"&&(isFunction=function(n){return typeof n=="function"||!1});var isFunction$1=isFunction,hasObjectTag=tagTester("Object"),hasStringTagBug=supportsDataView&&hasObjectTag(new DataView(new ArrayBuffer(8))),isIE11=typeof Map!="undefined"&&hasObjectTag(new Map),isDataView=tagTester("DataView");isDataView$1=hasStringTagBug?ie10IsDataView:isDataView;isArray=nativeIsArray||tagTester("Array");isArguments=tagTester("Arguments"),function(){isArguments(arguments)||(isArguments=function(n){return has$1(n,"callee")})}();isArguments$1=isArguments;var getByteLength=shallowProperty("byteLength"),isBufferLike=createSizePropertyCheck(getByteLength),typedArrayPattern=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;isTypedArray$1=supportsArrayBuffer?isTypedArray:constant(!1);getLength=shallowProperty("length");_$1.VERSION=VERSION;_$1.prototype.value=function(){return this._wrapped};_$1.prototype.valueOf=_$1.prototype.toJSON=_$1.prototype.value;_$1.prototype.toString=function(){return String(this._wrapped)};tagDataView="[object DataView]";var forEachName="forEach",hasName="has",commonInit=["clear","delete"],mapTail=["get",hasName,"set"],mapMethods=commonInit.concat(forEachName,mapTail),weakMapMethods=commonInit.concat(mapTail),setMethods=["add"].concat(commonInit,forEachName,hasName),isMap=isIE11?ie11fingerprint(mapMethods):tagTester("Map"),isWeakMap=isIE11?ie11fingerprint(weakMapMethods):tagTester("WeakMap"),isSet=isIE11?ie11fingerprint(setMethods):tagTester("Set"),isWeakSet=tagTester("WeakSet");var extend=createAssigner(allKeys),extendOwn=createAssigner(keys),defaults=createAssigner(allKeys,!0);_$1.toPath=toPath$1;_$1.iteratee=iteratee;now=Date.now||function(){return(new Date).getTime()};var escapeMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},_escape=createEscaper(escapeMap),unescapeMap=invert(escapeMap),_unescape=createEscaper(unescapeMap),templateSettings=_$1.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},noMatch=/(.)^/,escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},escapeRegExp=/\\|'|\r|\n|\u2028|\u2029/g;bareIdentifier=/^\s*(\w|\$)+\s*$/;idCounter=0;partial=restArguments(function(n,t){var r=partial.placeholder,i=function(){for(var f=0,o=t.length,e=Array(o),u=0;u<o;u++)e[u]=t[u]===r?arguments[f++]:t[u];while(f<arguments.length)e.push(arguments[f++]);return executeBound(n,i,this,this,e)};return i});partial.placeholder=_$1;bind=restArguments(function(n,t,i){if(!isFunction$1(n))throw new TypeError("Bind must be called on a function");var r=restArguments(function(u){return executeBound(n,r,t,this,i.concat(u))});return r});isArrayLike=createSizePropertyCheck(getLength);bindAll=restArguments(function(n,t){var i,r;if(t=flatten$1(t,!1,!1),i=t.length,i<1)throw new Error("bindAll must be passed function names");while(i--)r=t[i],n[r]=bind(n[r],n);return n});delay=restArguments(function(n,t,i){return setTimeout(function(){return n.apply(null,i)},t)});defer=partial(delay,_$1,1);once=partial(before,2);findIndex=createPredicateIndexFinder(1);findLastIndex=createPredicateIndexFinder(-1);indexOf=createIndexFinder(1,findIndex,sortedIndex);lastIndexOf=createIndexFinder(-1,findLastIndex);reduce=createReduce(1);reduceRight=createReduce(-1);invoke=restArguments(function(n,t,i){var r,u;return isFunction$1(t)?u=t:(t=toPath(t),r=t.slice(0,-1),t=t[t.length-1]),map(n,function(n){var f=u;if(!f){if(r&&r.length&&(n=deepGet(n,r)),n==null)return void 0;f=n[t]}return f==null?f:f.apply(n,i)})});reStrSymbol=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;var groupBy=group(function(n,t,i){has$1(n,i)?n[i].push(t):n[i]=[t]}),indexBy=group(function(n,t,i){n[i]=t}),countBy=group(function(n,t,i){has$1(n,i)?n[i]++:n[i]=1}),partition=group(function(n,t,i){n[i?0:1].push(t)},!0);pick=restArguments(function(n,t){var f={},i=t[0],r,o,u,e;if(n==null)return f;for(isFunction$1(i)?(t.length>1&&(i=optimizeCb(i,t[1])),t=allKeys(n)):(i=keyInObj,t=flatten$1(t,!1,!1),n=Object(n)),r=0,o=t.length;r<o;r++)u=t[r],e=n[u],i(e,u,n)&&(f[u]=e);return f});omit=restArguments(function(n,t){var i=t[0],r;return isFunction$1(i)?(i=negate(i),t.length>1&&(r=t[1])):(t=map(flatten$1(t,!1,!1),String),i=function(n,i){return!contains(t,i)}),pick(n,i,r)});difference=restArguments(function(n,t){return t=flatten$1(t,!0,!0),filter(n,function(n){return!contains(t,n)})});without=restArguments(function(n,t){return difference(n,t)});union=restArguments(function(n){return uniq(flatten$1(n,!0,!0))});zip=restArguments(unzip);each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=ArrayProto[n];_$1.prototype[n]=function(){var i=this._wrapped;return i!=null&&(t.apply(i,arguments),(n==="shift"||n==="splice")&&i.length===0&&delete i[0]),chainResult(this,i)}});each(["concat","join","slice"],function(n){var t=ArrayProto[n];_$1.prototype[n]=function(){var n=this._wrapped;return n!=null&&(n=t.apply(n,arguments)),chainResult(this,n)}});allExports={__proto__:null,VERSION:VERSION,restArguments:restArguments,isObject:isObject,isNull:isNull,isUndefined:isUndefined,isBoolean:isBoolean,isElement:isElement,isString:isString,isNumber:isNumber,isDate:isDate,isRegExp:isRegExp,isError:isError,isSymbol:isSymbol,isArrayBuffer:isArrayBuffer,isDataView:isDataView$1,isArray:isArray,isFunction:isFunction$1,isArguments:isArguments$1,isFinite:isFinite$1,isNaN:isNaN$1,isTypedArray:isTypedArray$1,isEmpty:isEmpty,isMatch:isMatch,isEqual:isEqual,isMap:isMap,isWeakMap:isWeakMap,isSet:isSet,isWeakSet:isWeakSet,keys:keys,allKeys:allKeys,values:values,pairs:pairs,invert:invert,functions:functions,methods:functions,extend:extend,extendOwn:extendOwn,assign:extendOwn,defaults:defaults,create:create,clone:clone,tap:tap,get:get,has:has,mapObject:mapObject,identity:identity,constant:constant,noop:noop,toPath:toPath$1,property:property,propertyOf:propertyOf,matcher:matcher,matches:matcher,times:times,random:random,now:now,escape:_escape,unescape:_unescape,templateSettings:templateSettings,template:template,result:result,uniqueId:uniqueId,chain:chain,iteratee:iteratee,partial:partial,bind:bind,bindAll:bindAll,memoize:memoize,delay:delay,defer:defer,throttle:throttle,debounce:debounce,wrap:wrap,negate:negate,compose:compose,after:after,before:before,once:once,findKey:findKey,findIndex:findIndex,findLastIndex:findLastIndex,sortedIndex:sortedIndex,indexOf:indexOf,lastIndexOf:lastIndexOf,find:find,detect:find,findWhere:findWhere,each:each,forEach:each,map:map,collect:map,reduce:reduce,foldl:reduce,inject:reduce,reduceRight:reduceRight,foldr:reduceRight,filter:filter,select:filter,reject:reject,every:every,all:every,some:some,any:some,contains:contains,includes:contains,include:contains,invoke:invoke,pluck:pluck,where:where,max:max,min:min,shuffle:shuffle,sample:sample,sortBy:sortBy,groupBy:groupBy,indexBy:indexBy,countBy:countBy,partition:partition,toArray:toArray,size:size,pick:pick,omit:omit,first:first,head:first,take:first,initial:initial,last:last,rest:rest,tail:rest,drop:rest,compact:compact,flatten:flatten,without:without,uniq:uniq,unique:uniq,union:union,intersection:intersection,difference:difference,unzip:unzip,transpose:unzip,zip:zip,object:object,range:range,chunk:chunk,mixin:mixin,"default":_$1};_=mixin(allExports);_._=_;$.fn.uploadFile=function(n,t,i,r,u){var h,s,e=$(this),f,o,c=!1,l,a;if(e.size()>1)throw new Error("uploadFile: Not possible to call uploadFile on a jquery object with more than one element");if(!$(e[0]).is('[type="file"]'))throw new Error("uploadFile: Not possible to call uploadFile on a non-file input type");$.fn.uploadFile.increment=($.fn.uploadFile.increment||0)+1;h="asyncForm"+$.fn.uploadFile.increment;s="asyncFormIFrame"+$.fn.uploadFile.increment;o=$('<iframe id="'+s+'" name="'+s+'" src="" style="display:none">');f=$('<form id="'+h+'" class="file-shim" action="'+n+'"><\/form>');f.attr("target",s);f.attr("method","POST");f.attr("enctype","multipart/form-data");f.attr("encoding","multipart/form-data");a=NextGen.Logger.errorWrap(function(){var s=null,n,h,l;c=!0;try{if(n=o[0],h=n.contentWindow?n.contentWindow.document:n.contentDocument||n.document,!h)throw new Error("There was an invalid response from the server. Please try a reduced file size.");if(l=h.getElementById("response"),!l)throw new Error("No response tag.");s=$.parseJSON(l.innerHTML);e.data("sharedCacheKey",s.SharedCacheKey);i&&i(s,e)}catch(a){r?r(e,{success:!1,error:a}):NextGen.Logger.error(a)}finally{e.detach();t.before(e).remove();f.remove();u&&u(s,e)}});l=NextGen.Logger.errorWrap(function(){o.off("load").on("load",function(){setTimeout(a,100)});f[0].submit()});o.on("load",function(){setTimeout(l,100)});return $("body").append(f),e.before(t).detach().appendTo(f),o.appendTo(f),{timeout:function(n,t){setTimeout(function(){var n,r,u;if(!c){try{if(n=o[0],r=n.contentWindow?n.contentWindow.document:n.contentDocument||n.document,r&&(u=r.getElementById("response"),u)){i($.parseJSON(u.innerHTML));return}}catch(f){}t&&t()}},n)}}};window.eventsair_vendor=1;var Handlebars=function(){var r=function(){"use strict";function n(n){this.string=n}var t;return n.prototype.toString=function(){return""+this.string},t=n}(),t=function(n){"use strict";function f(n){return c[n]||"&amp;"}function e(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}function o(n){return n instanceof h?n.toString():n||0===n?(n=""+n,a.test(n)?n.replace(l,f):n):""}function s(n){return n||0===n?u(n)&&0===n.length?!0:!1:!0}var t={},h=n,c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},l=/[&<>"'`]/g,a=/[&<>"'`]/,i,r,u;return t.extend=e,i=Object.prototype.toString,t.toString=i,r=function(n){return"function"==typeof n},r(/x/)&&(r=function(n){return"function"==typeof n&&"[object Function]"===i.call(n)}),t.isFunction=r,u=Array.isArray||function(n){return n&&"object"==typeof n?"[object Array]"===i.call(n):!1},t.isArray=u,t.escapeExpression=o,t.isEmpty=s,t}(r),n=function(){"use strict";function t(t,i){var u,f,r;for(i&&i.firstLine&&(u=i.firstLine,t+=" - "+u+":"+i.firstColumn),f=Error.prototype.constructor.call(this,t),r=0;r<n.length;r++)this[n[r]]=f[n[r]];u&&(this.lineNumber=u,this.column=i.firstColumn)}var i,n=["description","fileName","lineNumber","message","name","number","stack"];return t.prototype=new Error,i=t}(),i=function(n,t){"use strict";function e(n,t){this.helpers=n||{};this.partials=t||{};p(this)}function p(n){n.registerHelper("helperMissing",function(n){if(2===arguments.length)return void 0;throw new h("Missing helper: '"+n+"'");});n.registerHelper("blockHelperMissing",function(t,i){var r=i.inverse||function(){},u=i.fn;return f(t)&&(t=t.call(this)),t===!0?u(this):t===!1||null==t?r(this):a(t)?t.length>0?n.helpers.each(t,i):r(this):u(t)});n.registerHelper("each",function(n,t){var i,s=t.fn,c=t.inverse,r=0,u="",h,e;if(f(n)&&(n=n.call(this)),t.data&&(i=o(t.data)),n&&"object"==typeof n)if(a(n))for(h=n.length;h>r;r++)i&&(i.index=r,i.first=0===r,i.last=r===n.length-1),u+=s(n[r],{data:i});else for(e in n)n.hasOwnProperty(e)&&(i&&(i.key=e,i.index=r,i.first=0===r),u+=s(n[e],{data:i}),r++);return 0===r&&(u=c(this)),u});n.registerHelper("if",function(n,t){return f(n)&&(n=n.call(this)),!t.hash.includeZero&&!n||r.isEmpty(n)?t.inverse(this):t.fn(this)});n.registerHelper("unless",function(t,i){return n.helpers["if"].call(this,t,{fn:i.inverse,inverse:i.fn,hash:i.hash})});n.registerHelper("with",function(n,t){return f(n)&&(n=n.call(this)),r.isEmpty(n)?void 0:t.fn(n)});n.registerHelper("log",function(t,i){var r=i.data&&null!=i.data.level?parseInt(i.data.level,10):1;n.log(r,t)})}function s(n,t){u.log(n,t)}var i={},r=n,h=t,c,l,u,o;i.VERSION="1.3.0";c=4;i.COMPILER_REVISION=c;l={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"};i.REVISION_CHANGES=l;var a=r.isArray,f=r.isFunction,v=r.toString,y="[object Object]";return i.HandlebarsEnvironment=e,e.prototype={constructor:e,logger:u,log:s,registerHelper:function(n,t,i){if(v.call(n)===y){if(i||t)throw new h("Arg not supported with multiple helpers");r.extend(this.helpers,n)}else i&&(t.not=i),this.helpers[n]=t},registerPartial:function(n,t){v.call(n)===y?r.extend(this.partials,n):this.partials[n]=t}},u={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(n,t){if(u.level<=n){var i=u.methodMap[n];"undefined"!=typeof console&&console[i]&&console[i].call(console,t)}}},i.logger=u,i.log=s,o=function(n){var t={};return r.extend(t,n),t},i.createFrame=o,i}(t,n),f=function(n,t,i){"use strict";function s(n){var t=n&&n[0]||1,i=v,r,f;if(t!==i){if(i>t){r=o[i];f=o[t];throw new u("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+f+").");}throw new u("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+n[1]+").");}}function h(n,t){if(!t)throw new u("No environment passed to template");var r=function(n,i,r,f,e,o){var s=t.VM.invokePartial.apply(this,arguments),h;if(null!=s)return s;if(t.compile)return h={helpers:f,partials:e,data:o},e[i]=t.compile(n,{data:void 0!==o},t),e[i](r,h);throw new u("The partial "+i+" could not be compiled when running in runtime-only mode");},i={escapeExpression:e.escapeExpression,invokePartial:r,programs:[],program:function(n,t,i){var r=this.programs[n];return i?r=f(n,t,i):r||(r=this.programs[n]=f(n,t)),r},merge:function(n,t){var i=n||t;return n&&t&&n!==t&&(i={},e.extend(i,t),e.extend(i,n)),i},programWithDepth:t.VM.programWithDepth,noop:t.VM.noop,compilerInfo:null};return function(r,u){var f,e,o,s;return u=u||{},o=u.partial?u:t,u.partial||(f=u.helpers,e=u.partials),s=n.call(i,o,r,f,e,u.data),u.partial||t.VM.checkRevision(i.compilerInfo),s}}function c(n,t,i){var u=Array.prototype.slice.call(arguments,3),r=function(n,r){return r=r||{},t.apply(this,[n,r.data||i].concat(u))};return r.program=n,r.depth=u.length,r}function f(n,t,i){var r=function(n,r){return r=r||{},t(n,r.data||i)};return r.program=n,r.depth=0,r}function l(n,t,i,r,f,e){var o={partial:!0,helpers:r,partials:f,data:e};if(void 0===n)throw new u("The partial "+t+" could not be found");if(n instanceof Function)return n(i,o)}function a(){return""}var r={},e=n,u=t,v=i.COMPILER_REVISION,o=i.REVISION_CHANGES;return r.checkRevision=s,r.template=h,r.programWithDepth=c,r.program=f,r.invokePartial=l,r.noop=a,r}(t,n,i),e=function(n,t,i,r,u){"use strict";var c,f=n,l=t,a=i,e=r,o=u,s=function(){var n=new f.HandlebarsEnvironment;return e.extend(n,f),n.SafeString=l,n.Exception=a,n.Utils=e,n.VM=o,n.template=function(t){return o.template(t,n)},n},h=s();return h.create=s,c=h}(i,r,n,t,f),u=function(n){"use strict";function t(n){n=n||{};this.firstLine=n.first_line;this.firstColumn=n.first_column;this.lastColumn=n.last_column;this.lastLine=n.last_line}var r=n,i={ProgramNode:function(n,r,u,f){var o,e;3===arguments.length?(f=u,u=null):2===arguments.length&&(f=r,r=null);t.call(this,f);this.type="program";this.statements=n;this.strip={};u?(e=u[0],e?(o={first_line:e.firstLine,last_line:e.lastLine,last_column:e.lastColumn,first_column:e.firstColumn},this.inverse=new i.ProgramNode(u,r,o)):this.inverse=new i.ProgramNode(u,r),this.strip.right=r.left):r&&(this.strip.left=r.right)},MustacheNode:function(n,r,u,f,e){if(t.call(this,e),this.type="mustache",this.strip=f,null!=u&&u.charAt){var o=u.charAt(3)||u.charAt(2);this.escaped="{"!==o&&"&"!==o}else this.escaped=!!u;this.sexpr=n instanceof i.SexprNode?n:new i.SexprNode(n,r);this.sexpr.isRoot=!0;this.id=this.sexpr.id;this.params=this.sexpr.params;this.hash=this.sexpr.hash;this.eligibleHelper=this.sexpr.eligibleHelper;this.isHelper=this.sexpr.isHelper},SexprNode:function(n,i,r){t.call(this,r);this.type="sexpr";this.hash=i;var u=this.id=n[0],f=this.params=n.slice(1),e=this.eligibleHelper=u.isSimple;this.isHelper=e&&(f.length||i)},PartialNode:function(n,i,r,u){t.call(this,u);this.type="partial";this.partialName=n;this.context=i;this.strip=r},BlockNode:function(n,i,u,f,e){if(t.call(this,e),n.sexpr.id.original!==f.path.original)throw new r(n.sexpr.id.original+" doesn't match "+f.path.original,this);this.type="block";this.mustache=n;this.program=i;this.inverse=u;this.strip={left:n.strip.left,right:f.strip.right};(i||u).strip.left=n.strip.right;(u||i).strip.right=f.strip.left;u&&!i&&(this.isInverse=!0)},ContentNode:function(n,i){t.call(this,i);this.type="content";this.string=n},HashNode:function(n,i){t.call(this,i);this.type="hash";this.pairs=n},IdNode:function(n,i){var u;t.call(this,i);this.type="ID";for(var o="",f=[],s=0,e=0,h=n.length;h>e;e++)if(u=n[e].part,o+=(n[e].separator||"")+u,".."===u||"."===u||"this"===u){if(f.length>0)throw new r("Invalid path: "+o,this);".."===u?s++:this.isScoped=!0}else f.push(u);this.original=o;this.parts=f;this.string=f.join(".");this.depth=s;this.isSimple=1===n.length&&!this.isScoped&&0===s;this.stringModeValue=this.string},PartialNameNode:function(n,i){t.call(this,i);this.type="PARTIAL_NAME";this.name=n.original},DataNode:function(n,i){t.call(this,i);this.type="DATA";this.id=n},StringNode:function(n,i){t.call(this,i);this.type="STRING";this.original=this.string=this.stringModeValue=n},IntegerNode:function(n,i){t.call(this,i);this.type="INTEGER";this.original=this.integer=n;this.stringModeValue=Number(n)},BooleanNode:function(n,i){t.call(this,i);this.type="BOOLEAN";this.bool=n;this.stringModeValue="true"===n},CommentNode:function(n,i){t.call(this,i);this.type="comment";this.comment=n}};return i}(n),o=function(){"use strict";return function(){function n(n,t){return{left:"~"===n.charAt(2),right:"~"===t.charAt(0)||"~"===t.charAt(1)}}function t(){this.yy={}}var i={trace:function(){},yy:{},symbols_:{error:2,root:3,statements:4,EOF:5,program:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,sexpr:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,partial_option0:27,sexpr_repetition0:28,sexpr_option0:29,dataName:30,param:31,STRING:32,INTEGER:33,BOOLEAN:34,OPEN_SEXPR:35,CLOSE_SEXPR:36,hash:37,hash_repetition_plus0:38,hashSegment:39,ID:40,EQUALS:41,DATA:42,pathSegments:43,SEP:44,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},productions_:[0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],performAction:function(t,i,r,u,f,e){var o=e.length-1;switch(f){case 1:return new u.ProgramNode(e[o-1],this._$);case 2:return new u.ProgramNode([],this._$);case 3:this.$=new u.ProgramNode([],e[o-1],e[o],this._$);break;case 4:this.$=new u.ProgramNode(e[o-2],e[o-1],e[o],this._$);break;case 5:this.$=new u.ProgramNode(e[o-1],e[o],[],this._$);break;case 6:this.$=new u.ProgramNode(e[o],this._$);break;case 7:this.$=new u.ProgramNode([],this._$);break;case 8:this.$=new u.ProgramNode([],this._$);break;case 9:this.$=[e[o]];break;case 10:e[o-1].push(e[o]);this.$=e[o-1];break;case 11:this.$=new u.BlockNode(e[o-2],e[o-1].inverse,e[o-1],e[o],this._$);break;case 12:this.$=new u.BlockNode(e[o-2],e[o-1],e[o-1].inverse,e[o],this._$);break;case 13:this.$=e[o];break;case 14:this.$=e[o];break;case 15:this.$=new u.ContentNode(e[o],this._$);break;case 16:this.$=new u.CommentNode(e[o],this._$);break;case 17:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 18:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 19:this.$={path:e[o-1],strip:n(e[o-2],e[o])};break;case 20:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 21:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 22:this.$=new u.PartialNode(e[o-2],e[o-1],n(e[o-3],e[o]),this._$);break;case 23:this.$=n(e[o-1],e[o]);break;case 24:this.$=new u.SexprNode([e[o-2]].concat(e[o-1]),e[o],this._$);break;case 25:this.$=new u.SexprNode([e[o]],null,this._$);break;case 26:this.$=e[o];break;case 27:this.$=new u.StringNode(e[o],this._$);break;case 28:this.$=new u.IntegerNode(e[o],this._$);break;case 29:this.$=new u.BooleanNode(e[o],this._$);break;case 30:this.$=e[o];break;case 31:e[o-1].isHelper=!0;this.$=e[o-1];break;case 32:this.$=new u.HashNode(e[o],this._$);break;case 33:this.$=[e[o-2],e[o]];break;case 34:this.$=new u.PartialNameNode(e[o],this._$);break;case 35:this.$=new u.PartialNameNode(new u.StringNode(e[o],this._$),this._$);break;case 36:this.$=new u.PartialNameNode(new u.IntegerNode(e[o],this._$));break;case 37:this.$=new u.DataNode(e[o],this._$);break;case 38:this.$=new u.IdNode(e[o],this._$);break;case 39:e[o-2].push({part:e[o],separator:e[o-1]});this.$=e[o-2];break;case 40:this.$=[{part:e[o]}];break;case 43:this.$=[];break;case 44:e[o-1].push(e[o]);break;case 47:this.$=[e[o]];break;case 48:e[o-1].push(e[o])}},table:[{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],defaultActions:{3:[2,2],16:[2,1],50:[2,42]},parseError:function(n){throw new Error(n);},parse:function(n){function it(){var n;return n=k.lexer.lex()||1,"number"!=typeof n&&(n=k.symbols_[n]||n),n}var k=this,r=[0],e=[null],t=[],h=this.table,d="",c=0,g=0,y=0,l,nt,i,p,o,u,w,a,f,tt,v,s,b;for(this.lexer.setInput(n),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={}),l=this.lexer.yylloc,t.push(l),nt=this.lexer.options&&this.lexer.options.ranges,"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError),s={};;){if((o=r[r.length-1],this.defaultActions[o]?u=this.defaultActions[o]:((null===i||"undefined"==typeof i)&&(i=it()),u=h[o]&&h[o][i]),"undefined"==typeof u||!u.length||!u[0])&&(b="",!y)){v=[];for(a in h[o])this.terminals_[a]&&a>2&&v.push("'"+this.terminals_[a]+"'");b=this.lexer.showPosition?"Parse error on line "+(c+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[i]||i)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==i?"end of input":"'"+(this.terminals_[i]||i)+"'");this.parseError(b,{text:this.lexer.match,token:this.terminals_[i]||i,line:this.lexer.yylineno,loc:l,expected:v})}if(u[0]instanceof Array&&u.length>1)throw new Error("Parse Error: multiple actions possible at state: "+o+", token: "+i);switch(u[0]){case 1:r.push(i);e.push(this.lexer.yytext);t.push(this.lexer.yylloc);r.push(u[1]);i=null;p?(i=p,p=null):(g=this.lexer.yyleng,d=this.lexer.yytext,c=this.lexer.yylineno,l=this.lexer.yylloc,y>0&&y--);break;case 2:if(f=this.productions_[u[1]][1],s.$=e[e.length-f],s._$={first_line:t[t.length-(f||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(f||1)].first_column,last_column:t[t.length-1].last_column},nt&&(s._$.range=[t[t.length-(f||1)].range[0],t[t.length-1].range[1]]),w=this.performAction.call(s,d,g,c,this.yy,u[1],e,t),"undefined"!=typeof w)return w;f&&(r=r.slice(0,-2*f),e=e.slice(0,-1*f),t=t.slice(0,-1*f));r.push(this.productions_[u[1]][0]);e.push(s.$);t.push(s._$);tt=h[r[r.length-2]][r[r.length-1]];r.push(tt);break;case 3:return!0}}return!0}},r=function(){var n={EOF:1,parseError:function(n,t){if(!this.yy.parser)throw new Error(n);this.yy.parser.parseError(n,t)},setInput:function(n){return this._input=n,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var n=this._input[0],t;return this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n,t=n.match(/(?:\r\n?|\n).*/g),t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var i=n.length,t=n.split(/(?:\r\n?|\n)/g),r,u;return this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i-1),this.offset-=i,r=this.match.split(/(?:\r\n?|\n)/g),this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1),u=this.yylloc.range,this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===r.length?this.yylloc.first_column:0)+r[r.length-t.length].length-t[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this},more:function(){return this._more=!0,this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput(),t=new Array(n.length+1).join("-");return n+this.upcomingInput()+"\n"+t+"^"},next:function(){var f,n,r,e,t,u,i;if(this.done)return this.EOF;for(this._input||(this.done=!0),this._more||(this.yytext="",this.match=""),u=this._currentRules(),i=0;i<u.length&&(r=this._input.match(this.rules[u[i]]),!r||n&&!(r[0].length>n[0].length)||(n=r,e=i,this.options.flex));i++);return n?(t=n[0].match(/(?:\r\n?|\n).*/g),t&&(this.yylineno+=t.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:t?t[t.length-1].length-t[t.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],f=this.performAction.call(this,this.yy,this,u[e],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f?f:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var n=this.next();return"undefined"!=typeof n?n:this.lex()},begin:function(n){this.conditionStack.push(n)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(n){this.begin(n)}};return n.options={},n.performAction=function(n,t,i){function r(n,i){return t.yytext=t.yytext.substr(n,t.yyleng-i)}switch(i){case 0:if("\\\\"===t.yytext.slice(-2)?(r(0,1),this.begin("mu")):"\\"===t.yytext.slice(-1)?(r(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return r(0,4),this.popState(),15;case 4:return 35;case 5:return 36;case 6:return 25;case 7:return 16;case 8:return 20;case 9:return 19;case 10:return 19;case 11:return 23;case 12:return 22;case 13:this.popState();this.begin("com");break;case 14:return r(3,5),this.popState(),15;case 15:return 22;case 16:return 41;case 17:return 40;case 18:return 40;case 19:return 44;case 21:return this.popState(),24;case 22:return this.popState(),18;case 23:return t.yytext=r(1,2).replace(/\\"/g,'"'),32;case 24:return t.yytext=r(1,2).replace(/\\'/g,"'"),32;case 25:return 42;case 26:return 34;case 27:return 34;case 28:return 33;case 29:return 40;case 30:return t.yytext=r(1,2),40;case 31:return"INVALID";case 32:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[3],inclusive:!1},INITIAL:{rules:[0,1,32],inclusive:!0}},n}();return i.lexer=r,t.prototype=i,i.Parser=t,new t}()}(),s=function(n,t){"use strict";function f(n){return n.constructor===u.ProgramNode?n:(r.yy=u,r.parse(n))}var i={},r=n,u=t;return i.parser=r,i.parse=f,i}(o,u),h=function(n){"use strict";function r(){}function u(n,t,r){if(null==n||"string"!=typeof n&&n.constructor!==r.AST.ProgramNode)throw new i("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+n);t=t||{};"data"in t||(t.data=!0);var u=r.parse(n),f=(new r.Compiler).compile(u,t);return(new r.JavaScriptCompiler).compile(f,t)}function f(n,t,r){function f(){var i=r.parse(n),u=(new r.Compiler).compile(i,t),f=(new r.JavaScriptCompiler).compile(u,t,void 0,!0);return r.template(f)}if(null==n||"string"!=typeof n&&n.constructor!==r.AST.ProgramNode)throw new i("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+n);t=t||{};"data"in t||(t.data=!0);var u;return function(n,t){return u||(u=f()),u.call(this,n,t)}}var t={},i=n;return t.Compiler=r,r.prototype={compiler:r,disassemble:function(){for(var i,n,r,t,e=this.opcodes,u=[],f=0,o=e.length;o>f;f++)if(n=e[f],"DECLARE"===n.opcode)u.push("DECLARE "+n.name+"="+n.value);else{for(r=[],i=0;i<n.args.length;i++)t=n.args[i],"string"==typeof t&&(t='"'+t.replace("\n","\\n")+'"'),r.push(t);u.push(n.opcode+" "+r.join(" "))}return u.join("\n")},equals:function(n){var i=this.opcodes.length,t,r,f,u;if(n.opcodes.length!==i)return!1;for(t=0;i>t;t++){if(r=this.opcodes[t],f=n.opcodes[t],r.opcode!==f.opcode||r.args.length!==f.args.length)return!1;for(u=0;u<r.args.length;u++)if(r.args[u]!==f.args[u])return!1}if(i=this.children.length,n.children.length!==i)return!1;for(t=0;i>t;t++)if(!this.children[t].equals(n.children[t]))return!1;return!0},guid:0,compile:function(n,t){var i,r;if(this.opcodes=[],this.children=[],this.depths={list:[]},this.options=t,i=this.options.knownHelpers,this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0},i)for(r in i)this.options.knownHelpers[r]=i[r];return this.accept(n)},accept:function(n){var t,i=n.strip||{};return i.left&&this.opcode("strip"),t=this[n.type](n),i.right&&this.opcode("strip"),t},program:function(n){for(var i=n.statements,t=0,r=i.length;r>t;t++)this.accept(i[t]);return this.isSimple=1===r,this.depths.list=this.depths.list.sort(function(n,t){return n-t}),this},compileProgram:function(n){var r,t=(new this.compiler).compile(n,this.options),u=this.guid++,i,f;for(this.usePartial=this.usePartial||t.usePartial,this.children[u]=t,i=0,f=t.depths.list.length;f>i;i++)r=t.depths.list[i],2>r||this.addDepth(r-1);return u},block:function(n){var f=n.mustache,t=n.program,i=n.inverse,r,u;t&&(t=this.compileProgram(t));i&&(i=this.compileProgram(i));r=f.sexpr;u=this.classifySexpr(r);"helper"===u?this.helperSexpr(r,t,i):"simple"===u?(this.simpleSexpr(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("blockValue")):(this.ambiguousSexpr(r,t,i),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue"));this.opcode("append")},hash:function(n){var r,t,u=n.pairs,i,f;for(this.opcode("pushHash"),i=0,f=u.length;f>i;i++)r=u[i],t=r[1],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type),"sexpr"===t.type&&this.sexpr(t)):this.accept(t),this.opcode("assignToHash",r[0]);this.opcode("popHash")},partial:function(n){var t=n.partialName;this.usePartial=!0;n.context?this.ID(n.context):this.opcode("push","depth0");this.opcode("invokePartial",t.name);this.opcode("append")},content:function(n){this.opcode("appendContent",n.string)},mustache:function(n){this.sexpr(n.sexpr);n.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(n,t,i){var r=n.id,u=r.parts[0],f=null!=t||null!=i;this.opcode("getContext",r.depth);this.opcode("pushProgram",t);this.opcode("pushProgram",i);this.opcode("invokeAmbiguous",u,f)},simpleSexpr:function(n){var t=n.id;"DATA"===t.type?this.DATA(t):t.parts.length?this.ID(t):(this.addDepth(t.depth),this.opcode("getContext",t.depth),this.opcode("pushContext"));this.opcode("resolvePossibleLambda")},helperSexpr:function(n,t,r){var f=this.setupFullMustacheParams(n,t,r),u=n.id.parts[0];if(this.options.knownHelpers[u])this.opcode("invokeKnownHelper",f.length,u);else{if(this.options.knownHelpersOnly)throw new i("You specified knownHelpersOnly, but used the unknown helper "+u,n);this.opcode("invokeHelper",f.length,u,n.isRoot)}},sexpr:function(n){var t=this.classifySexpr(n);"simple"===t?this.simpleSexpr(n):"helper"===t?this.helperSexpr(n):this.ambiguousSexpr(n)},ID:function(n){var i,t,r;for(this.addDepth(n.depth),this.opcode("getContext",n.depth),i=n.parts[0],i?this.opcode("lookupOnContext",n.parts[0]):this.opcode("pushContext"),t=1,r=n.parts.length;r>t;t++)this.opcode("lookup",n.parts[t])},DATA:function(n){if(this.options.data=!0,n.id.isScoped||n.id.depth)throw new i("Scoped data references are not supported: "+n.original,n);this.opcode("lookupData");for(var r=n.id.parts,t=0,u=r.length;u>t;t++)this.opcode("lookup",r[t])},STRING:function(n){this.opcode("pushString",n.string)},INTEGER:function(n){this.opcode("pushLiteral",n.integer)},BOOLEAN:function(n){this.opcode("pushLiteral",n.bool)},comment:function(){},opcode:function(n){this.opcodes.push({opcode:n,args:[].slice.call(arguments,1)})},declare:function(n,t){this.opcodes.push({opcode:"DECLARE",name:n,value:t})},addDepth:function(n){0!==n&&(this.depths[n]||(this.depths[n]=!0,this.depths.list.push(n)))},classifySexpr:function(n){var t=n.isHelper,i=n.eligibleHelper,r=this.options,u;return i&&!t&&(u=n.id.parts[0],r.knownHelpers[u]?t=!0:r.knownHelpersOnly&&(i=!1)),t?"helper":i?"ambiguous":"simple"},pushParams:function(n){for(var t,i=n.length;i--;)t=n[i],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type),"sexpr"===t.type&&this.sexpr(t)):this[t.type](t)},setupFullMustacheParams:function(n,t,i){var r=n.params;return this.pushParams(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),n.hash?this.hash(n.hash):this.opcode("emptyHash"),r}},t.precompile=u,t.compile=f,t}(n),c=function(n,t){"use strict";function r(n){this.value=n}function i(){}var s,h=n.COMPILER_REVISION,c=n.REVISION_CHANGES,f=n.log,e=t;i.prototype={nameLookup:function(n,t){var u,r;return 0===n.indexOf("depth")&&(u=!0),r=/^[0-9]+$/.test(t)?n+"["+t+"]":i.isValidJavaScriptVariableName(t)?n+"."+t:n+"['"+t+"']",u?"("+n+" && "+r+")":r},compilerInfo:function(){var n=h,t=c[n];return"this.compilerInfo = ["+n+",'"+t+"'];\n"},appendToBuffer:function(n){return this.environment.isSimple?"return "+n+";":{appendToBuffer:!0,content:n,toString:function(){return"buffer += "+n+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(n,t,i,r){var u,o,s;for(this.environment=n,this.options=t||{},f("debug",this.environment.disassemble()+"\n\n"),this.name=this.environment.name,this.isChild=!!i,this.context=i||{programs:[],environments:[],aliases:{}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(n,t),o=n.opcodes,this.i=0,s=o.length;this.i<s;this.i++)u=o[this.i],"DECLARE"===u.opcode?this[u.name]=u.value:this[u.opcode].apply(this,u.args),u.opcode!==this.stripNext&&(this.stripNext=!1);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new e("Compile completed with content left on stack");return this.createFunctionContext(r)},preamble:function(){var n=[],i,t;this.isChild?n.push(""):(i=this.namespace,t="helpers = this.merge(helpers, "+i+".helpers);",this.environment.usePartial&&(t=t+" partials = this.merge(partials, "+i+".partials);"),this.options.data&&(t+=" data = data || {};"),n.push(t));this.environment.isSimple?n.push(""):n.push(", buffer = "+this.initializeBuffer());this.lastContext=0;this.source=n},createFunctionContext:function(n){var o=this.stackVars.concat(this.registers.list),i,t,e;if(o.length>0&&(this.source[1]=this.source[1]+", "+o.join(", ")),!this.isChild)for(i in this.context.aliases)this.context.aliases.hasOwnProperty(i)&&(this.source[1]=this.source[1]+", "+i+"="+this.context.aliases[i]);this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";");this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n");this.environment.isSimple||this.pushSource("return buffer;");for(var r=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"],u=0,s=this.environment.depths.list.length;s>u;u++)r.push("depth"+this.environment.depths.list[u]);return(t=this.mergeSource(),this.isChild||(t=this.compilerInfo()+t),n)?(r.push(t),Function.apply(this,r)):(e="function "+(this.name||"")+"("+r.join(",")+") {\n  "+t+"}",f("debug",e+"\n\n"),e)},mergeSource:function(){for(var t,n,i="",r=0,u=this.source.length;u>r;r++)t=this.source[r],t.appendToBuffer?n=n?n+"\n    + "+t.content:t.content:(n&&(i+="buffer += "+n+";\n  ",n=void 0),i+=t+"\n  ");return i},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var n=["depth0"];this.setupParams(0,n);this.replaceStack(function(t){return n.splice(1,0,t),"blockHelperMissing.call("+n.join(", ")+")"})},ambiguousBlockValue:function(){var n,t;this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";n=["depth0"];this.setupParams(0,n);t=this.topStack();n.splice(1,0,t);this.pushSource("if (!"+this.lastHelper+") { "+t+" = blockHelperMissing.call("+n.join(", ")+"); }")},appendContent:function(n){this.pendingContent&&(n=this.pendingContent+n);this.stripNext&&(n=n.replace(/^\s+/,""));this.pendingContent=n},strip:function(){this.pendingContent&&(this.pendingContent=this.pendingContent.replace(/\s+$/,""));this.stripNext="strip"},append:function(){this.flushInline();var n=this.popStack();this.pushSource("if("+n+" || "+n+" === 0) { "+this.appendToBuffer(n)+" }");this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression";this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(n){this.lastContext!==n&&(this.lastContext=n)},lookupOnContext:function(n){this.push(this.nameLookup("depth"+this.lastContext,n,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"';this.replaceStack(function(n){return"typeof "+n+" === functionType ? "+n+".apply(depth0) : "+n})},lookup:function(n){this.replaceStack(function(t){return t+" == null || "+t+" === false ? "+t+" : "+this.nameLookup(t,n,"context")})},lookupData:function(){this.pushStackLiteral("data")},pushStringParam:function(n,t){this.pushStackLiteral("depth"+this.lastContext);this.pushString(t);"sexpr"!==t&&("string"==typeof n?this.pushString(n):this.pushStackLiteral(n))},emptyHash:function(){this.pushStackLiteral("{}");this.options.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash);this.hash={values:[],types:[],contexts:[]}},popHash:function(){var n=this.hash;this.hash=this.hashes.pop();this.options.stringParams&&(this.push("{"+n.contexts.join(",")+"}"),this.push("{"+n.types.join(",")+"}"));this.push("{\n    "+n.values.join(",\n    ")+"\n  }")},pushString:function(n){this.pushStackLiteral(this.quotedString(n))},push:function(n){return this.inlineStack.push(n),n},pushLiteral:function(n){this.pushStackLiteral(n)},pushProgram:function(n){null!=n?this.pushStackLiteral(this.programExpression(n)):this.pushStackLiteral(null)},invokeHelper:function(n,t,i){this.context.aliases.helperMissing="helpers.helperMissing";this.useRegister("helper");var r=this.lastHelper=this.setupHelper(n,t,!0),f=this.nameLookup("depth"+this.lastContext,t,"context"),u="helper = "+r.name+" || "+f;r.paramsInit&&(u+=","+r.paramsInit);this.push("("+u+",helper ? helper.call("+r.callParams+") : helperMissing.call("+r.helperMissingParams+"))");i||this.flushInline()},invokeKnownHelper:function(n,t){var i=this.setupHelper(n,t);this.push(i.name+".call("+i.callParams+")")},invokeAmbiguous:function(n,t){this.context.aliases.functionType='"function"';this.useRegister("helper");this.emptyHash();var i=this.setupHelper(0,n,t),u=this.lastHelper=this.nameLookup("helpers",n,"helper"),f=this.nameLookup("depth"+this.lastContext,n,"context"),r=this.nextStack();i.paramsInit&&this.pushSource(i.paramsInit);this.pushSource("if (helper = "+u+") { "+r+" = helper.call("+i.callParams+"); }");this.pushSource("else { helper = "+f+"; "+r+" = typeof helper === functionType ? helper.call("+i.callParams+") : helper; }")},invokePartial:function(n){var t=[this.nameLookup("partials",n,"partial"),"'"+n+"'",this.popStack(),"helpers","partials"];this.options.data&&t.push("data");this.context.aliases.self="this";this.push("self.invokePartial("+t.join(", ")+")")},assignToHash:function(n){var i,r,u=this.popStack(),t;this.options.stringParams&&(r=this.popStack(),i=this.popStack());t=this.hash;i&&t.contexts.push("'"+n+"': "+i);r&&t.types.push("'"+n+"': "+r);t.values.push("'"+n+"': ("+u+")")},compiler:i,compileChildren:function(n,t){for(var i,r,f,e=n.children,u=0,o=e.length;o>u;u++)r=e[u],f=new this.compiler,i=this.matchExistingProgram(r),null==i?(this.context.programs.push(""),i=this.context.programs.length,r.index=i,r.name="program"+i,this.context.programs[i]=f.compile(r,t,this.context),this.context.environments[i]=r):(r.index=i,r.name="program"+i)},matchExistingProgram:function(n){for(var i,t=0,r=this.context.environments.length;r>t;t++)if(i=this.context.environments[t],i&&i.equals(n))return t},programExpression:function(n){if(this.context.aliases.self="this",null==n)return"self.noop";for(var t,i=this.environment.children[n],r=i.depths.list,u=[i.index,i.name,"data"],f=0,e=r.length;e>f;f++)t=r[f],1===t?u.push("depth0"):u.push("depth"+(t-1));return(0===r.length?"self.program(":"self.programWithDepth(")+u.join(", ")+")"},register:function(n,t){this.useRegister(n);this.pushSource(n+" = "+t+";")},useRegister:function(n){this.registers[n]||(this.registers[n]=!0,this.registers.list.push(n))},pushStackLiteral:function(n){return this.push(new r(n))},pushSource:function(n){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0);n&&this.source.push(n)},pushStack:function(n){this.flushInline();var t=this.incrStack();return n&&this.pushSource(t+" = "+n+";"),this.compileStack.push(t),t},replaceStack:function(n){var t,u,o,f="",s=this.isInline(),i,h,e;return s?(i=this.popStack(!0),i instanceof r?(t=i.value,o=!0):(u=!this.stackSlot,h=u?this.incrStack():this.topStackName(),f="("+this.push(h)+" = "+i+"),",t=this.topStack())):t=this.topStack(),e=n.call(this,t),s?(o||this.popStack(),u&&this.stackSlot--,this.push("("+f+e+")")):(/^stack/.test(t)||(t=this.nextStack()),this.pushSource(t+" = ("+f+e+");")),t},nextStack:function(){return this.pushStack()},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var i=this.inlineStack,n,u,t;if(i.length)for(this.inlineStack=[],n=0,u=i.length;u>n;n++)t=i[n],t instanceof r?this.compileStack.push(t):this.pushStack(t)},isInline:function(){return this.inlineStack.length},popStack:function(n){var i=this.isInline(),t=(i?this.inlineStack:this.compileStack).pop();if(!n&&t instanceof r)return t.value;if(!i){if(!this.stackSlot)throw new e("Invalid stack pop");this.stackSlot--}return t},topStack:function(n){var i=this.isInline()?this.inlineStack:this.compileStack,t=i[i.length-1];return!n&&t instanceof r?t.value:t},quotedString:function(n){return'"'+n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(n,t,i){var r=[],u=this.setupParams(n,r,i),f=this.nameLookup("helpers",t,"helper");return{params:r,paramsInit:u,name:f,callParams:["depth0"].concat(r).join(", "),helperMissingParams:i&&["depth0",this.quotedString(t)].concat(r).join(", ")}},setupOptions:function(n,t){var e,r,u,i=[],o=[],s=[],f;for(i.push("hash:"+this.popStack()),this.options.stringParams&&(i.push("hashTypes:"+this.popStack()),i.push("hashContexts:"+this.popStack())),r=this.popStack(),u=this.popStack(),(u||r)&&(u||(this.context.aliases.self="this",u="self.noop"),r||(this.context.aliases.self="this",r="self.noop"),i.push("inverse:"+r),i.push("fn:"+u)),f=0;n>f;f++)e=this.popStack(),t.push(e),this.options.stringParams&&(s.push(this.popStack()),o.push(this.popStack()));return this.options.stringParams&&(i.push("contexts:["+o.join(",")+"]"),i.push("types:["+s.join(",")+"]")),this.options.data&&i.push("data:data"),i},setupParams:function(n,t,i){var r="{"+this.setupOptions(n,t).join(",")+"}";return i?(this.useRegister("options"),t.push("options"),"options="+r):(t.push(r),"")}};for(var o="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),l=i.RESERVED_WORDS={},u=0,a=o.length;a>u;u++)l[o[u]]=!0;return i.isValidJavaScriptVariableName=function(n){return!i.RESERVED_WORDS[n]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(n)?!0:!1},s=i}(i,n);return function(n,t,i,r,u){"use strict";var o,f=n,s=t,h=i.parser,c=i.parse,l=r.Compiler,a=r.compile,v=r.precompile,y=u,p=f.create,e=function(){var n=p();return n.compile=function(t,i){return a(t,i,n)},n.precompile=function(t,i){return v(t,i,n)},n.AST=s,n.Compiler=l,n.JavaScriptCompiler=y,n.Parser=h,n.parse=c,n};return f=e(),f.create=e,o=f}(e,u,s,h,c)}();var wysihtml5={version:"0.3.0",commands:{},dom:{},quirks:{},toolbar:{},lang:{},selection:{},views:{},INVISIBLE_SPACE:"﻿",EMPTY_FUNCTION:function(){},ELEMENT_NODE:1,TEXT_NODE:3,BACKSPACE_KEY:8,ENTER_KEY:13,ESCAPE_KEY:27,SPACE_KEY:32,DELETE_KEY:46},Base;window.rangy=function(){function t(n,t){var i=typeof n[t];return i==k||!!(i==b&&n[t])||"unknown"==i}function e(n,t){return!!(typeof n[t]==b&&n[t])}function p(n,t){return typeof n[t]!=f}function s(n){return function(t,i){for(var r=i.length;r--;)if(!n(t,i[r]))return!1;return!0}}function w(n){return n&&c(n,tt)&&l(n,nt)}function i(t){window.alert("Rangy not supported in your browser. Reason: "+t);n.initialized=!0;n.supported=!1}function h(){if(!n.initialized){var r,f=!1,u=!1;for(t(document,"createRange")&&(r=document.createRange(),c(r,g)&&l(r,d)&&(f=!0),r.detach()),(r=e(document,"body")?document.body:document.getElementsByTagName("body")[0])&&t(r,"createTextRange")&&(r=r.createTextRange(),w(r)&&(u=!0)),f||u||i("Neither Range nor TextRange are implemented"),n.initialized=!0,n.features={implementsDomRange:f,implementsTextRange:u},f=v.concat(a),u=0,r=f.length;u<r;++u)try{f[u](n)}catch(o){e(window,"console")&&t(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",o)}}}function u(n){this.name=n;this.supported=this.initialized=!1}var b="object",k="function",f="undefined",d="startContainer startOffset endContainer endOffset collapsed commonAncestorContainer START_TO_START START_TO_END END_TO_START END_TO_END".split(" "),g="setStart setStartBefore setStartAfter setEnd setEndBefore setEndAfter collapse selectNode selectNodeContents compareBoundaryPoints deleteContents extractContents cloneContents insertNode surroundContents cloneRange toString detach".split(" "),nt="boundingHeight boundingLeft boundingTop boundingWidth htmlText text".split(" "),tt="collapse compareEndPoints duplicate getBookmark moveToBookmark moveToElementText parentElement pasteHTML select setEndPoint getBoundingClientRect".split(" "),c=s(t),r=s(e),l=s(p),n={version:"1.2.2",initialized:!1,supported:!0,util:{isHostMethod:t,isHostObject:e,isHostProperty:p,areHostMethods:c,areHostObjects:r,areHostProperties:l,isTextRange:w},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}},a,v,o,y;if(n.fail=i,n.warn=function(t){t="Rangy warning: "+t;n.config.alertOnWarn?window.alert(t):typeof window.console!=f&&typeof window.console.log!=f&&window.console.log(t)},{}.hasOwnProperty?n.util.extend=function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])}:i("hasOwnProperty not supported"),a=[],v=[],n.init=h,n.addInitListener=function(t){n.initialized?t(n):a.push(t)},o=[],n.addCreateMissingNativeApiListener=function(n){o.push(n)},n.createMissingNativeApi=function(n){n=n||window;h();for(var t=0,i=o.length;t<i;++t)o[t](n)},u.prototype.fail=function(n){this.initialized=!0;this.supported=!1;throw Error("Module '"+this.name+"' failed to load: "+n);},u.prototype.warn=function(t){n.warn("Module "+this.name+": "+t)},u.prototype.createError=function(n){return Error("Error in Rangy "+this.name+" module: "+n)},n.createModule=function(t,i){var r=new u(t);n.modules[t]=r;v.push(function(n){i(n,r);r.initialized=!0;r.supported=!0})},n.requireModules=function(t){for(var f=0,e=t.length,i,r;f<e;++f){if(r=t[f],i=n.modules[r],!i||!(i instanceof u))throw Error("Module '"+r+"' not found");if(!i.supported)throw Error("Module '"+r+"' not supported");}},y=!1,r=function(){y||(y=!0,n.initialized||h())},typeof window==f)i("No window found");else if(typeof document==f)i("No document found");else return t(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",r,!1),t(window,"addEventListener")?window.addEventListener("load",r,!1):t(window,"attachEvent")?window.attachEvent("onload",r):i("Window does not have required addEventListener or attachEvent method"),n}();rangy.createModule("DomUtil",function(n,t){function o(n){for(var t=0;n=n.previousSibling;)t++;return t}function l(n,t){for(var r=[],i=n;i;i=i.parentNode)r.push(i);for(i=t;i;i=i.parentNode)if(c(r,i))return i;return null}function u(n,t,i){for(i=i?n:n.parentNode;i;){if(n=i.parentNode,n===t)return i;i=n}return null}function s(n){return n=n.nodeType,3==n||4==n||8==n}function a(n,t){var i=t.nextSibling,r=t.parentNode;return i?r.insertBefore(n,i):r.appendChild(n),n}function e(n){if(9==n.nodeType)return n;if(typeof n.ownerDocument!=i)return n.ownerDocument;if(typeof n.document!=i)return n.document;if(n.parentNode)return e(n.parentNode);throw Error("getDocument: no document found for node");}function v(n){return n?s(n)?'"'+n.data+'"':1==n.nodeType?"<"+n.nodeName+(n.id?' id="'+n.id+'"':"")+">["+n.childNodes.length+"]":n.nodeName:"[No node]"}function y(n){this._next=this.root=n}function p(n,t){this.node=n;this.offset=t}function h(n){this.code=this[n];this.codeName=n;this.message="DOMException: "+this.codeName}var i="undefined",r=n.util,f,c;r.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||t.fail("document missing a Node creation method");r.isHostMethod(document,"getElementsByTagName")||t.fail("document missing getElementsByTagName method");f=document.createElement("div");r.areHostMethods(f,["insertBefore","appendChild","cloneNode"])||t.fail("Incomplete Element implementation");r.isHostProperty(f,"innerHTML")||t.fail("Element is missing innerHTML property");f=document.createTextNode("test");r.areHostMethods(f,["splitText","deleteData","insertData","appendData","cloneNode"])||t.fail("Incomplete Text Node implementation");c=function(n,t){for(var i=n.length;i--;)if(n[i]===t)return!0;return!1};y.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var n=this._current=this._next,t;if(this._current){if(t=n.firstChild,!t)for(t=null;n!==this.root&&!(t=n.nextSibling);)n=n.parentNode;this._next=t}return this._current},detach:function(){this._current=this._next=this.root=null}};p.prototype={equals:function(n){return this.node===n.node&this.offset==n.offset},inspect:function(){return"[DomPosition("+v(this.node)+":"+this.offset+")]"}};h.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11};h.prototype.toString=function(){return this.message};n.dom={arrayContains:c,isHtmlNamespace:function(n){var t;return typeof n.namespaceURI==i||null===(t=n.namespaceURI)||"http://www.w3.org/1999/xhtml"==t},parentElement:function(n){return n=n.parentNode,1==n.nodeType?n:null},getNodeIndex:o,getNodeLength:function(n){var t;return s(n)?n.length:(t=n.childNodes)?t.length:0},getCommonAncestor:l,isAncestorOf:function(n,t,i){for(t=i?t:t.parentNode;t;){if(t===n)return!0;t=t.parentNode}return!1},getClosestAncestorIn:u,isCharacterDataNode:s,insertAfter:a,splitDataNode:function(n,t){var i=n.cloneNode(!1);return i.deleteData(0,t),n.deleteData(t,n.length-t),a(i,n),i},getDocument:e,getWindow:function(n){if(n=e(n),typeof n.defaultView!=i)return n.defaultView;if(typeof n.parentWindow!=i)return n.parentWindow;throw Error("Cannot get a window object for node");},getIframeWindow:function(n){if(typeof n.contentWindow!=i)return n.contentWindow;if(typeof n.contentDocument!=i)return n.contentDocument.defaultView;throw Error("getIframeWindow: No Window object found for iframe element");},getIframeDocument:function(n){if(typeof n.contentDocument!=i)return n.contentDocument;if(typeof n.contentWindow!=i)return n.contentWindow.document;throw Error("getIframeWindow: No Document object found for iframe element");},getBody:function(n){return r.isHostObject(n,"body")?n.body:n.getElementsByTagName("body")[0]},getRootContainer:function(n){for(var t;t=n.parentNode;)n=t;return n},comparePoints:function(n,t,i,r){var f;if(n==i)return t===r?0:t<r?-1:1;if(f=u(i,n,!0))return t<=o(f)?-1:1;if(f=u(n,i,!0))return o(f)<r?-1:1;if(t=l(n,i),n=n===t?t:u(n,t,!0),i=i===t?t:u(i,t,!0),n===i)throw Error("comparePoints got to case 4 and childA and childB are the same!");for(t=t.firstChild;t;){if(t===n)return-1;if(t===i)return 1;t=t.nextSibling}throw Error("Should not be here!");},inspectNode:v,fragmentFromNodeChildren:function(n){for(var t=e(n).createDocumentFragment(),i;i=n.firstChild;)t.appendChild(i);return t},createIterator:function(n){return new y(n)},DomPosition:p};n.DOMException=h});rangy.createModule("DomRange",function(n){function c(n,i){return 3!=n.nodeType&&(t.isAncestorOf(n,i.startContainer,!0)||t.isAncestorOf(n,i.endContainer,!0))}function r(n){return t.getDocument(n.startContainer)}function et(n,t,i){if(t=n._listeners[t])for(var r=0,u=t.length;r<u;++r)t[r].call(n,{target:n,args:i})}function ot(n){return new ni(n.parentNode,t.getNodeIndex(n))}function b(n){return new ni(n.parentNode,t.getNodeIndex(n)+1)}function st(n,i,r){var u=11==n.nodeType?n.firstChild:n;return t.isCharacterDataNode(i)?r==i.length?t.insertAfter(n,i):i.parentNode.insertBefore(n,0==r?i:t.splitDataNode(i,r)):r>=i.childNodes.length?i.appendChild(n):i.insertBefore(n,i.childNodes[r]),u}function ht(n){for(var t,i,u=r(n.range).createDocumentFragment();i=n.next();){if(t=n.isPartiallySelectedSubtree(),i=i.cloneNode(!t),t&&(t=n.getSubtreeIterator(),i.appendChild(ht(t)),t.detach(!0)),10==i.nodeType)throw new e("HIERARCHY_REQUEST_ERR");u.appendChild(i)}return u}function y(n,i,r){for(var u,f,r=r||{stop:!1};u=n.next();)if(n.isPartiallySelectedSubtree()){if(!1===i(u)){r.stop=!0;break}else if(u=n.getSubtreeIterator(),y(u,i,r),u.detach(!0),r.stop)break}else for(u=t.createIterator(u);f=u.next();)if(!1===i(f)){r.stop=!0;return}}function ct(n){for(var t;n.next();)n.isPartiallySelectedSubtree()?(t=n.getSubtreeIterator(),ct(t),t.detach(!0)):n.remove()}function lt(n){for(var t,u=r(n.range).createDocumentFragment(),i;t=n.next();){if(n.isPartiallySelectedSubtree()?(t=t.cloneNode(!1),i=n.getSubtreeIterator(),t.appendChild(lt(i)),i.detach(!0)):n.remove(),10==t.nodeType)throw new e("HIERARCHY_REQUEST_ERR");u.appendChild(t)}return u}function at(n,t,i){var u=!(!t||!t.length),f,e=!!i,r;return u&&(f=RegExp("^("+t.join("|")+")$")),r=[],y(new o(n,!1),function(n){(!u||f.test(n.nodeType))&&(!e||i(n))&&r.push(n)}),r}function vt(n){return"["+("undefined"==typeof n.getName?"Range":n.getName())+"("+t.inspectNode(n.startContainer)+":"+n.startOffset+", "+t.inspectNode(n.endContainer)+":"+n.endOffset+")]"}function o(n,i){if(this.range=n,this.clonePartiallySelectedTextNodes=i,!n.collapsed){this.sc=n.startContainer;this.so=n.startOffset;this.ec=n.endContainer;this.eo=n.endOffset;var r=n.commonAncestorContainer;this.sc===this.ec&&t.isCharacterDataNode(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===r&&!t.isCharacterDataNode(this.sc)?this.sc.childNodes[this.so]:t.getClosestAncestorIn(this.sc,r,!0),this._last=this.ec===r&&!t.isCharacterDataNode(this.ec)?this.ec.childNodes[this.eo-1]:t.getClosestAncestorIn(this.ec,r,!0))}}function s(n){this.code=this[n];this.codeName=n;this.message="RangeException: "+this.codeName}function yt(n,t,i){this.nodes=at(n,t,i);this._next=this.nodes[0];this._position=0}function k(n){return function(i,r){for(var f,u=r?i:i.parentNode;u;){if(f=u.nodeType,t.arrayContains(n,f))return u;u=u.parentNode}return null}}function l(n,t){if(li(n,t))throw new s("INVALID_NODE_TYPE_ERR");}function f(n){if(!n.startContainer)throw new e("INVALID_STATE_ERR");}function a(n,i){if(!t.arrayContains(i,n.nodeType))throw new s("INVALID_NODE_TYPE_ERR");}function d(n,i){if(0>i||i>(t.isCharacterDataNode(n)?n.length:n.childNodes.length))throw new e("INDEX_SIZE_ERR");}function g(n,t){if(w(n,!0)!==w(t,!0))throw new e("WRONG_DOCUMENT_ERR");}function h(n){if(ci(n,!0))throw new e("NO_MODIFICATION_ALLOWED_ERR");}function p(n,t){if(!n)throw new e(t);}function i(n){if(f(n),!t.arrayContains(tt,n.startContainer.nodeType)&&!w(n.startContainer,!0)||!t.arrayContains(tt,n.endContainer.nodeType)&&!w(n.endContainer,!0)||!(n.startOffset<=(t.isCharacterDataNode(n.startContainer)?n.startContainer.length:n.startContainer.childNodes.length))||!(n.endOffset<=(t.isCharacterDataNode(n.endContainer)?n.endContainer.length:n.endContainer.childNodes.length)))throw Error("Range error: Range is no longer valid after DOM mutation ("+n.inspect()+")");}function nt(){}function pt(n){n.START_TO_START=ut;n.START_TO_END=ri;n.END_TO_END=ai;n.END_TO_START=ui;n.NODE_BEFORE=fi;n.NODE_AFTER=ei;n.NODE_BEFORE_AND_AFTER=oi;n.NODE_INSIDE=ft}function wt(n){pt(n);pt(n.prototype)}function bt(n,r){return function(){i(this);var u=this.startContainer,f=this.startOffset,e=this.commonAncestorContainer,s=new o(this,!0);return u!==e&&(u=t.getClosestAncestorIn(u,e,!0),f=b(u),u=f.node,f=f.offset),y(s,h),s.reset(),e=n(s),s.detach(),r(this,u,f,u,f),e}}function kt(r,u,e){function s(n,t){return function(i){f(this);a(i,ti);a(v(i),tt);i=(n?ot:b)(i);(t?y:p)(this,i.node,i.offset)}}function y(n,i,r){var f=n.endContainer,e=n.endOffset;(i!==n.startContainer||r!==n.startOffset)&&((v(i)!=v(f)||1==t.comparePoints(i,r,f,e))&&(f=i,e=r),u(n,i,r,f,e))}function p(n,i,r){var f=n.startContainer,e=n.startOffset;(i!==n.endContainer||r!==n.endOffset)&&((v(i)!=v(f)||-1==t.comparePoints(i,r,f,e))&&(f=i,e=r),u(n,f,e,i,r))}r.prototype=new nt;n.util.extend(r.prototype,{setStart:function(n,t){f(this);l(n,!0);d(n,t);y(this,n,t)},setEnd:function(n,t){f(this);l(n,!0);d(n,t);p(this,n,t)},setStartBefore:s(!0,!0),setStartAfter:s(!1,!0),setEndBefore:s(!0,!1),setEndAfter:s(!1,!1),collapse:function(n){i(this);n?u(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):u(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(n){f(this);l(n,!0);u(this,n,0,n,t.getNodeLength(n))},selectNode:function(n){f(this);l(n,!1);a(n,ti);var t=ot(n),n=b(n);u(this,t.node,t.offset,n.node,n.offset)},extractContents:bt(lt,u),deleteContents:bt(ct,u),canSurroundContents:function(){i(this);h(this.startContainer);h(this.endContainer);var n=new o(this,!0),t=n._first&&c(n._first,this)||n._last&&c(n._last,this);return n.detach(),!t},detach:function(){e(this)},splitBoundaries:function(){i(this);var n=this.startContainer,e=this.startOffset,r=this.endContainer,f=this.endOffset,o=n===r;t.isCharacterDataNode(r)&&0<f&&f<r.length&&t.splitDataNode(r,f);t.isCharacterDataNode(n)&&0<e&&e<n.length&&(n=t.splitDataNode(n,e),o?(f-=e,r=n):r==n.parentNode&&f>=t.getNodeIndex(n)&&f++,e=0);u(this,n,e,r,f)},normalizeBoundaries:function(){i(this);var f=this.startContainer,e=this.startOffset,n=this.endContainer,r=this.endOffset,o=function(t){var i=t.nextSibling;i&&i.nodeType==t.nodeType&&(n=t,r=t.length,t.appendData(i.data),i.parentNode.removeChild(i))},h=function(i){var u=i.previousSibling,o;u&&u.nodeType==i.nodeType&&(f=i,o=i.length,e=u.length,i.insertData(0,u.data),u.parentNode.removeChild(u),f==n?(r+=e,n=f):n==i.parentNode&&(u=t.getNodeIndex(i),r==u?(n=i,r=o):r>u&&r--))},s=!0;t.isCharacterDataNode(n)?n.length==r&&o(n):(0<r&&(s=n.childNodes[r-1])&&t.isCharacterDataNode(s)&&o(s),s=!this.collapsed);s?t.isCharacterDataNode(f)?0==e&&h(f):e<f.childNodes.length&&(o=f.childNodes[e])&&t.isCharacterDataNode(o)&&h(o):(f=n,e=r);u(this,f,e,n,r)},collapseToPoint:function(n,t){f(this);l(n,!0);d(n,t);(n!==this.startContainer||t!==this.startOffset||n!==this.endContainer||t!==this.endOffset)&&u(this,n,t,n,t)}});wt(r)}function dt(n){n.collapsed=n.startContainer===n.endContainer&&n.startOffset===n.endOffset;n.commonAncestorContainer=n.collapsed?n.startContainer:t.getCommonAncestor(n.startContainer,n.endContainer)}function gt(n,t,i,r,u){var f=n.startContainer!==t||n.startOffset!==i,e=n.endContainer!==r||n.endOffset!==u;n.startContainer=t;n.startOffset=i;n.endContainer=r;n.endOffset=u;dt(n);et(n,"boundarychange",{startMoved:f,endMoved:e})}function u(n){this.startContainer=n;this.startOffset=0;this.endContainer=n;this.endOffset=0;this._listeners={boundarychange:[],detach:[]};dt(this)}n.requireModules(["DomUtil"]);var t=n.dom,ni=t.DomPosition,e=n.DOMException;o.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null;this._next=this._first},hasNext:function(){return!!this._next},next:function(){var n=this._current=this._next;return n&&(this._next=n!==this._last?n.nextSibling:null,t.isCharacterDataNode(n)&&this.clonePartiallySelectedTextNodes&&(n===this.ec&&(n=n.cloneNode(!0)).deleteData(this.eo,n.length-this.eo),this._current===this.sc&&(n=n.cloneNode(!0)).deleteData(0,this.so))),n},remove:function(){var n=this._current,i,r;t.isCharacterDataNode(n)&&(n===this.sc||n===this.ec)?(i=n===this.sc?this.so:0,r=n===this.ec?this.eo:n.length,i!=r&&n.deleteData(i,r-i)):n.parentNode&&n.parentNode.removeChild(n)},isPartiallySelectedSubtree:function(){return c(this._current,this.range)},getSubtreeIterator:function(){var n;if(this.isSingleCharacterDataNode)n=this.range.cloneRange(),n.collapse();else{n=new u(r(this.range));var i=this._current,f=i,e=0,s=i,h=t.getNodeLength(i);t.isAncestorOf(i,this.sc,!0)&&(f=this.sc,e=this.so);t.isAncestorOf(i,this.ec,!0)&&(s=this.ec,h=this.eo);gt(n,f,e,s,h)}return new o(n,this.clonePartiallySelectedTextNodes)},detach:function(n){n&&this.range.detach();this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};s.prototype={BAD_BOUNDARYPOINTS_ERR:1,INVALID_NODE_TYPE_ERR:2};s.prototype.toString=function(){return this.message};yt.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){return this._current=this._next,this._next=this.nodes[++this._position],this._current},detach:function(){this._current=this._next=this.nodes=null}};var ti=[1,3,4,5,7,8,10],tt=[2,9,11],si=[1,3,4,5,7,8,10,11],hi=[1,3,4,5,7,8],v=t.getRootContainer,w=k([9,11]),ci=k([5,6,10,12]),li=k([6,10,12]),ii=document.createElement("style"),it=!1;try{ii.innerHTML="<b>x<\/b>";it=3==ii.firstChild.nodeType}catch(vi){}n.features.htmlParsingConforms=it;var rt="startContainer startOffset endContainer endOffset collapsed commonAncestorContainer".split(" "),ut=0,ri=1,ai=2,ui=3,fi=0,ei=1,oi=2,ft=3;nt.prototype={attachListener:function(n,t){this._listeners[n].push(t)},compareBoundaryPoints:function(n,r){i(this);g(this.startContainer,r.startContainer);var u=n==ui||n==ut?"start":"end",f=n==ri||n==ut?"start":"end";return t.comparePoints(this[u+"Container"],this[u+"Offset"],r[f+"Container"],r[f+"Offset"])},insertNode:function(n){if(i(this),a(n,si),h(this.startContainer),t.isAncestorOf(n,this.startContainer,!0))throw new e("HIERARCHY_REQUEST_ERR");this.setStartBefore(st(n,this.startContainer,this.startOffset))},cloneContents:function(){i(this);var n,u;return this.collapsed?r(this).createDocumentFragment():this.startContainer===this.endContainer&&t.isCharacterDataNode(this.startContainer)?(n=this.startContainer.cloneNode(!0),n.data=n.data.slice(this.startOffset,this.endOffset),u=r(this).createDocumentFragment(),u.appendChild(n),u):(u=new o(this,!0),n=ht(u),u.detach(),n)},canSurroundContents:function(){i(this);h(this.startContainer);h(this.endContainer);var n=new o(this,!0),t=n._first&&c(n._first,this)||n._last&&c(n._last,this);return n.detach(),!t},surroundContents:function(n){if(a(n,hi),!this.canSurroundContents())throw new s("BAD_BOUNDARYPOINTS_ERR");var t=this.extractContents();if(n.hasChildNodes())for(;n.lastChild;)n.removeChild(n.lastChild);st(n,this.startContainer,this.startOffset);n.appendChild(t);this.selectNode(n)},cloneRange:function(){i(this);for(var t=new u(r(this)),f=rt.length,n;f--;)n=rt[f],t[n]=this[n];return t},toString:function(){var r,n;return(i(this),n=this.startContainer,n===this.endContainer&&t.isCharacterDataNode(n))?3==n.nodeType||4==n.nodeType?n.data.slice(this.startOffset,this.endOffset):"":(r=[],n=new o(this,!0),y(n,function(n){(3==n.nodeType||4==n.nodeType)&&r.push(n.data)}),n.detach(),r.join(""))},compareNode:function(n){i(this);var r=n.parentNode,u=t.getNodeIndex(n);if(!r)throw new e("NOT_FOUND_ERR");return n=this.comparePoint(r,u),r=this.comparePoint(r,u+1),0>n?0<r?oi:fi:0<r?ei:ft},comparePoint:function(n,r){return i(this),p(n,"HIERARCHY_REQUEST_ERR"),g(n,this.startContainer),0>t.comparePoints(n,r,this.startContainer,this.startOffset)?-1:0<t.comparePoints(n,r,this.endContainer,this.endOffset)?1:0},createContextualFragment:it?function(n){var r=this.startContainer,u=t.getDocument(r),i;if(!r)throw new e("INVALID_STATE_ERR");return i=null,1==r.nodeType?i=r:t.isCharacterDataNode(r)&&(i=t.parentElement(r)),i=null===i||"HTML"==i.nodeName&&t.isHtmlNamespace(t.getDocument(i).documentElement)&&t.isHtmlNamespace(i)?u.createElement("body"):i.cloneNode(!1),i.innerHTML=n,t.fragmentFromNodeChildren(i)}:function(n){f(this);var i=r(this).createElement("body");return i.innerHTML=n,t.fragmentFromNodeChildren(i)},toHtml:function(){i(this);var n=r(this).createElement("div");return n.appendChild(this.cloneContents()),n.innerHTML},intersectsNode:function(n,u){var e,o,f;return(i(this),p(n,"NOT_FOUND_ERR"),t.getDocument(n)!==r(this))?!1:(f=n.parentNode,e=t.getNodeIndex(n),p(f,"NOT_FOUND_ERR"),o=t.comparePoints(f,e,this.endContainer,this.endOffset),f=t.comparePoints(f,e+1,this.startContainer,this.startOffset),u?0>=o&&0<=f:0>o&&0<f)},isPointInRange:function(n,r){return i(this),p(n,"HIERARCHY_REQUEST_ERR"),g(n,this.startContainer),0<=t.comparePoints(n,r,this.startContainer,this.startOffset)&&0>=t.comparePoints(n,r,this.endContainer,this.endOffset)},intersectsRange:function(n,u){if(i(this),r(n)!=r(this))throw new e("WRONG_DOCUMENT_ERR");var f=t.comparePoints(this.startContainer,this.startOffset,n.endContainer,n.endOffset),o=t.comparePoints(this.endContainer,this.endOffset,n.startContainer,n.startOffset);return u?0>=f&&0<=o:0>f&&0<o},intersection:function(n){if(this.intersectsRange(n)){var r=t.comparePoints(this.startContainer,this.startOffset,n.startContainer,n.startOffset),u=t.comparePoints(this.endContainer,this.endOffset,n.endContainer,n.endOffset),i=this.cloneRange();return-1==r&&i.setStart(n.startContainer,n.startOffset),1==u&&i.setEnd(n.endContainer,n.endOffset),i}return null},union:function(n){if(this.intersectsRange(n,!0)){var i=this.cloneRange();return-1==t.comparePoints(n.startContainer,n.startOffset,this.startContainer,this.startOffset)&&i.setStart(n.startContainer,n.startOffset),1==t.comparePoints(n.endContainer,n.endOffset,this.endContainer,this.endOffset)&&i.setEnd(n.endContainer,n.endOffset),i}throw new s("Ranges do not intersect");},containsNode:function(n,t){return t?this.intersectsNode(n,!1):this.compareNode(n)==ft},containsNodeContents:function(n){return 0<=this.comparePoint(n,0)&&0>=this.comparePoint(n,t.getNodeLength(n))},containsRange:function(n){return this.intersection(n).equals(n)},containsNodeText:function(n){var t=this.cloneRange(),i;return t.selectNode(n),i=t.getNodes([3]),0<i.length?(t.setStart(i[0],0),n=i.pop(),t.setEnd(n,n.length),n=this.containsRange(t),t.detach(),n):this.containsNodeContents(n)},createNodeIterator:function(n,t){return i(this),new yt(this,n,t)},getNodes:function(n,t){return i(this),at(this,n,t)},getDocument:function(){return r(this)},collapseBefore:function(n){f(this);this.setEndBefore(n);this.collapse(!1)},collapseAfter:function(n){f(this);this.setStartAfter(n);this.collapse(!0)},getName:function(){return"DomRange"},equals:function(n){return u.rangesEqual(this,n)},inspect:function(){return vt(this)}};kt(u,gt,function(n){f(n);n.startContainer=n.startOffset=n.endContainer=n.endOffset=null;n.collapsed=n.commonAncestorContainer=null;et(n,"detach",null);n._listeners=null});n.rangePrototype=nt.prototype;u.rangeProperties=rt;u.RangeIterator=o;u.copyComparisonConstants=wt;u.createPrototypeRange=kt;u.inspect=vt;u.getRangeDocument=r;u.rangesEqual=function(n,t){return n.startContainer===t.startContainer&&n.startOffset===t.startOffset&&n.endContainer===t.endContainer&&n.endOffset===t.endOffset};n.DomRange=u;n.RangeException=s});rangy.createModule("WrappedRange",function(n){function f(n,i,u,f){var s=n.duplicate(),e,i,h,o;if(s.collapse(u),e=s.parentElement(),t.isAncestorOf(i,e,!0)||(e=i),!e.canHaveHTML)return new r(e.parentNode,t.getNodeIndex(e));i=t.getDocument(e).createElement("span");o=u?"StartToStart":"StartToEnd";do e.insertBefore(i,i.previousSibling),s.moveToElementText(i);while(0<(h=s.compareEndPoints(o,n))&&i.previousSibling);if(o=i.nextSibling,-1==h&&o&&t.isCharacterDataNode(o)){if(s.setEndPoint(u?"EndToStart":"EndToEnd",n),/[\r\n]/.test(o.data))for(e=s.duplicate(),u=e.text.replace(/\r\n/g,"\r").length,u=e.moveStart("character",u);-1==e.compareEndPoints("StartToEnd",e);)u++,e.moveStart("character",1);else u=s.text.length;e=new r(o,u)}else o=(f||!u)&&i.previousSibling,e=(u=(f||u)&&i.nextSibling)&&t.isCharacterDataNode(u)?new r(u,0):o&&t.isCharacterDataNode(o)?new r(o,o.length):new r(e,t.getNodeIndex(i));return i.parentNode.removeChild(i),e}function e(n,i){var r,f,o=n.offset,u=t.getDocument(n.node),e=u.body.createTextRange(),s=t.isCharacterDataNode(n.node);return s?(r=n.node,f=r.parentNode):(r=n.node.childNodes,r=o<r.length?r[o]:null,f=n.node),u=u.createElement("span"),u.innerHTML="&#feff;",r?f.insertBefore(u,r):f.appendChild(u),e.moveToElementText(u),e.collapse(!i),f.removeChild(u),s&&e[i?"moveStart":"moveEnd"]("character",o),e}var o;n.requireModules(["DomUtil","DomRange"]);var i,t=n.dom,r=t.DomPosition,u=n.DomRange;!n.features.implementsDomRange||n.features.implementsTextRange&&n.config.preferTextRange?n.features.implementsTextRange&&(i=function(n){this.textRange=n;this.refresh()},i.prototype=new u(document),i.prototype.refresh=function(){var i,n,r=this.textRange,u;i=r.parentElement();u=r.duplicate();u.collapse(!0);n=u.parentElement();u=r.duplicate();u.collapse(!1);r=u.parentElement();n=n==r?n:t.getCommonAncestor(n,r);n=n==i?n:t.getCommonAncestor(i,n);0==this.textRange.compareEndPoints("StartToEnd",this.textRange)?n=i=f(this.textRange,n,!0,!0):(i=f(this.textRange,n,!0,!1),n=f(this.textRange,n,!1,!1));this.setStart(i.node,i.offset);this.setEnd(n.node,n.offset)},u.copyComparisonConstants(i),o=function(){return this}(),"undefined"==typeof o.Range&&(o.Range=i),n.createNativeRange=function(n){return n=n||document,n.body.createTextRange()}):(function(){function o(n){for(var i=h.length,t;i--;)t=h[i],n[t]=n.nativeRange[t]}var r,h=u.rangeProperties,s,e,f;i=function(n){if(!n)throw Error("Range must be specified");this.nativeRange=n;o(this)};u.createPrototypeRange(i,function(n,t,i,r,u){var f=n.endContainer!==r||n.endOffset!=u;(n.startContainer!==t||n.startOffset!=i||f)&&(n.setEnd(r,u),n.setStart(t,i))},function(n){n.nativeRange.detach();n.detached=!0;for(var t=h.length,i;t--;)i=h[t],n[i]=null});r=i.prototype;r.selectNode=function(n){this.nativeRange.selectNode(n);o(this)};r.deleteContents=function(){this.nativeRange.deleteContents();o(this)};r.extractContents=function(){var n=this.nativeRange.extractContents();return o(this),n};r.cloneContents=function(){return this.nativeRange.cloneContents()};r.surroundContents=function(n){this.nativeRange.surroundContents(n);o(this)};r.collapse=function(n){this.nativeRange.collapse(n);o(this)};r.cloneRange=function(){return new i(this.nativeRange.cloneRange())};r.refresh=function(){o(this)};r.toString=function(){return this.nativeRange.toString()};e=document.createTextNode("test");t.getBody(document).appendChild(e);f=document.createRange();f.setStart(e,0);f.setEnd(e,0);try{f.setStart(e,1);r.setStart=function(n,t){this.nativeRange.setStart(n,t);o(this)};r.setEnd=function(n,t){this.nativeRange.setEnd(n,t);o(this)};s=function(n){return function(t){this.nativeRange[n](t);o(this)}}}catch(c){r.setStart=function(n,t){try{this.nativeRange.setStart(n,t)}catch(i){this.nativeRange.setEnd(n,t);this.nativeRange.setStart(n,t)}o(this)};r.setEnd=function(n,t){try{this.nativeRange.setEnd(n,t)}catch(i){this.nativeRange.setStart(n,t);this.nativeRange.setEnd(n,t)}o(this)};s=function(n,t){return function(i){try{this.nativeRange[n](i)}catch(r){this.nativeRange[t](i);this.nativeRange[n](i)}o(this)}}}r.setStartBefore=s("setStartBefore","setEndBefore");r.setStartAfter=s("setStartAfter","setEndAfter");r.setEndBefore=s("setEndBefore","setStartBefore");r.setEndAfter=s("setEndAfter","setStartAfter");f.selectNodeContents(e);r.selectNodeContents=f.startContainer==e&&f.endContainer==e&&0==f.startOffset&&f.endOffset==e.length?function(n){this.nativeRange.selectNodeContents(n);o(this)}:function(n){this.setStart(n,0);this.setEnd(n,u.getEndOffset(n))};f.selectNodeContents(e);f.setEnd(e,3);s=document.createRange();s.selectNodeContents(e);s.setEnd(e,4);s.setStart(e,2);r.compareBoundaryPoints=-1==f.compareBoundaryPoints(f.START_TO_END,s)&1==f.compareBoundaryPoints(f.END_TO_START,s)?function(n,t){return t=t.nativeRange||t,n==t.START_TO_END?n=t.END_TO_START:n==t.END_TO_START&&(n=t.START_TO_END),this.nativeRange.compareBoundaryPoints(n,t)}:function(n,t){return this.nativeRange.compareBoundaryPoints(n,t.nativeRange||t)};n.util.isHostMethod(f,"createContextualFragment")&&(r.createContextualFragment=function(n){return this.nativeRange.createContextualFragment(n)});t.getBody(document).removeChild(e);f.detach();s.detach()}(),n.createNativeRange=function(n){return n=n||document,n.createRange()});n.features.implementsTextRange&&(i.rangeToTextRange=function(n){if(n.collapsed)return e(new r(n.startContainer,n.startOffset),!0);var i=e(new r(n.startContainer,n.startOffset),!0),u=e(new r(n.endContainer,n.endOffset),!1),n=t.getDocument(n.startContainer).body.createTextRange();return n.setEndPoint("StartToStart",i),n.setEndPoint("EndToEnd",u),n});i.prototype.getName=function(){return"WrappedRange"};n.WrappedRange=i;n.createRange=function(t){return t=t||document,new i(n.createNativeRange(t))};n.createRangyRange=function(n){return n=n||document,new u(n)};n.createIframeRange=function(i){return n.createRange(t.getIframeDocument(i))};n.createIframeRangyRange=function(i){return n.createRangyRange(t.getIframeDocument(i))};n.addCreateMissingNativeApiListener(function(t){t=t.document;typeof t.createRange=="undefined"&&(t.createRange=function(){return n.createRange(this)});t=t=null})});rangy.createModule("WrappedSelection",function(n,t){function kt(n){return(n||window).getSelection()}function ct(n){return(n||window).document.selection}function c(n,t,i){var r=i?"end":"start",i=i?"start":"end";n.anchorNode=t[r+"Container"];n.anchorOffset=t[r+"Offset"];n.focusNode=t[i+"Container"];n.focusOffset=t[i+"Offset"]}function o(n){n.anchorNode=n.focusNode=null;n.anchorOffset=n.focusOffset=0;n.rangeCount=0;n.isCollapsed=!0;n._ranges.length=0}function ut(t){var i;return t instanceof s?(i=t._selectionNativeRange,i||(i=n.createNativeRange(r.getDocument(t.startContainer)),i.setEnd(t.endContainer,t.endOffset),i.setStart(t.startContainer,t.startOffset),t._selectionNativeRange=i,t.attachListener("detach",function(){this._selectionNativeRange=null}))):t instanceof k?i=t.nativeRange:n.features.implementsDomRange&&t instanceof r.getWindow(t.startContainer).Range&&(i=t),i}function ft(n){var i=n.getNodes(),t,u;n:if(i.length&&1==i[0].nodeType){for(t=1,u=i.length;t<u;++t)if(!r.isAncestorOf(i[0],i[t])){t=!1;break n}t=!0}else t=!1;if(!t)throw Error("getSingleElementFromRange: range "+n.inspect()+" did not consist of a single element");return i[0]}function lt(n,t){var i=new k(t);n._ranges=[i];c(n,i,!1);n.rangeCount=1;n.isCollapsed=i.collapsed}function l(t){var i,f,e,u;if(t._ranges.length=0,"None"==t.docSelection.type)o(t);else if(i=t.docSelection.createRange(),i&&"undefined"!=typeof i.text)lt(t,i);else{for(t.rangeCount=i.length,e=r.getDocument(i.item(0)),u=0;u<t.rangeCount;++u)f=n.createRange(e),f.selectNode(i.item(u)),t._ranges.push(f);t.isCollapsed=1==t.rangeCount&&t._ranges[0].collapsed;c(t,t._ranges[t.rangeCount-1],!1)}}function at(n,t){for(var u=n.docSelection.createRange(),e=ft(t),i=r.getDocument(u.item(0)),i=r.getBody(i).createControlRange(),f=0,o=u.length;f<o;++f)i.add(u.item(f));try{i.add(e)}catch(s){throw Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)");}i.select();l(n)}function b(n,t,i){this.nativeSelection=n;this.docSelection=t;this._ranges=[];this.win=i;this.refresh()}function vt(n,t){for(var i=r.getDocument(t[0].startContainer),i=r.getBody(i).createControlRange(),u=0,f;u<rangeCount;++u){f=ft(t[u]);try{i.add(f)}catch(e){throw Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)");}}i.select();l(n)}function yt(n,t){if(n.anchorNode&&r.getDocument(n.anchorNode)!==r.getDocument(t))throw new d("WRONG_DOCUMENT_ERR");}function pt(n){var i=[],u=new wt(n.anchorNode,n.anchorOffset),f=new wt(n.focusNode,n.focusOffset),e="function"==typeof n.getName?n.getName():"Selection",t,r;if("undefined"!=typeof n.rangeCount)for(t=0,r=n.rangeCount;t<r;++t)i[t]=s.inspect(n.getRangeAt(t));return"["+e+"(Ranges: "+i.join(", ")+")(anchor: "+u.inspect()+", focus: "+f.inspect()+"]"}var nt,et,tt,ot,e,i,it,st,rt,ht,w;n.requireModules(["DomUtil","DomRange","WrappedRange"]);n.config.checkSelectionRanges=!0;var r=n.dom,f=n.util,s=n.DomRange,k=n.WrappedRange,d=n.DOMException,wt=r.DomPosition,a,g,u=n.util.isHostMethod(window,"getSelection"),v=n.util.isHostObject(document,"selection"),y=v&&(!u||n.config.preferTextRange);y?(a=ct,n.isSelectionValid=function(n){var n=(n||window).document,t=n.selection;return"None"!=t.type||r.getDocument(t.createRange().parentElement())==n}):u?(a=kt,n.isSelectionValid=function(){return!0}):t.fail("Neither document.selection or window.getSelection() detected.");n.getNativeSelection=a;var u=a(),bt=n.createNativeRange(document),p=r.getBody(document),h=f.areHostObjects(u,f.areHostProperties(u,["anchorOffset","focusOffset"]));if(n.features.selectionHasAnchorAndFocus=h,nt=f.isHostMethod(u,"extend"),n.features.selectionHasExtend=nt,et="number"==typeof u.rangeCount,n.features.selectionHasRangeCount=et,tt=!1,ot=!0,f.areHostMethods(u,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof u.rangeCount&&n.features.implementsDomRange&&function(){var i=document.createElement("iframe"),n,u;p.appendChild(i);n=r.getIframeDocument(i);n.open();n.write("<html><head><\/head><body>12<\/body><\/html>");n.close();var t=r.getIframeWindow(i).getSelection(),f=n.documentElement.lastChild.firstChild,n=n.createRange();n.setStart(f,1);n.collapse(!0);t.addRange(n);ot=t.rangeCount==1;t.removeAllRanges();u=n.cloneRange();n.setStart(f,0);u.setEnd(f,2);t.addRange(n);t.addRange(u);tt=t.rangeCount==2;n.detach();u.detach();p.removeChild(i)}(),n.features.selectionSupportsMultipleRanges=tt,n.features.collapsedNonEditableSelectionsSupported=ot,e=!1,p&&f.isHostMethod(p,"createControlRange")&&(i=p.createControlRange(),f.areHostProperties(i,["item","add"])&&(e=!0)),n.features.implementsControlRange=e,g=h?function(n){return n.anchorNode===n.focusNode&&n.anchorOffset===n.focusOffset}:function(n){return n.rangeCount?n.getRangeAt(n.rangeCount-1).collapsed:!1},f.isHostMethod(u,"getRangeAt")?it=function(n,t){try{return n.getRangeAt(t)}catch(i){return null}}:h&&(it=function(t){var i=r.getDocument(t.anchorNode),i=n.createRange(i);return i.setStart(t.anchorNode,t.anchorOffset),i.setEnd(t.focusNode,t.focusOffset),i.collapsed!==this.isCollapsed&&(i.setStart(t.focusNode,t.focusOffset),i.setEnd(t.anchorNode,t.anchorOffset)),i}),n.getSelection=function(n){var n=n||window,t=n._rangySelection,i=a(n),r=v?ct(n):null;return t?(t.nativeSelection=i,t.docSelection=r,t.refresh(n)):(t=new b(i,r,n),n._rangySelection=t),t},n.getIframeSelection=function(t){return n.getSelection(r.getIframeWindow(t))},i=b.prototype,!y&&h&&f.areHostMethods(u,["removeAllRanges","addRange"]))i.removeAllRanges=function(){this.nativeSelection.removeAllRanges();o(this)},st=function(t,i){var r=s.getRangeDocument(i),r=n.createRange(r);r.collapseToPoint(i.endContainer,i.endOffset);t.nativeSelection.addRange(ut(r));t.nativeSelection.extend(i.startContainer,i.startOffset);t.refresh()},i.addRange=et?function(t,i){if(e&&v&&this.docSelection.type=="Control")at(this,t);else if(i&&nt)st(this,t);else{var r;tt?r=this.rangeCount:(this.removeAllRanges(),r=0);this.nativeSelection.addRange(ut(t));this.rangeCount=this.nativeSelection.rangeCount;this.rangeCount==r+1?(n.config.checkSelectionRanges&&(r=it(this.nativeSelection,this.rangeCount-1))&&!s.rangesEqual(r,t)&&(t=new k(r)),this._ranges[this.rangeCount-1]=t,c(this,t,w(this.nativeSelection)),this.isCollapsed=g(this)):this.refresh()}}:function(n,t){t&&nt?st(this,n):(this.nativeSelection.addRange(ut(n)),this.refresh())},i.setRanges=function(n){if(e&&n.length>1)vt(this,n);else{this.removeAllRanges();for(var t=0,i=n.length;t<i;++t)this.addRange(n[t])}};else if(f.isHostMethod(u,"empty")&&f.isHostMethod(bt,"select")&&e&&y)i.removeAllRanges=function(){var n,t;try{this.docSelection.empty();this.docSelection.type!="None"&&(this.anchorNode?n=r.getDocument(this.anchorNode):this.docSelection.type=="Control"&&(t=this.docSelection.createRange(),t.length&&(n=r.getDocument(t.item(0)).body.createTextRange())),n&&(n.body.createTextRange().select(),this.docSelection.empty()))}catch(i){}o(this)},i.addRange=function(n){this.docSelection.type=="Control"?at(this,n):(k.rangeToTextRange(n).select(),this._ranges[0]=n,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,c(this,n,!1))},i.setRanges=function(n){this.removeAllRanges();var t=n.length;t>1?vt(this,n):t&&this.addRange(n[0])};else return t.fail("No means of selecting a Range or TextRange was found"),!1;if(i.getRangeAt=function(n){if(n<0||n>=this.rangeCount)throw new d("INDEX_SIZE_ERR");return this._ranges[n]},y)rt=function(t){var i;n.isSelectionValid(t.win)?i=t.docSelection.createRange():(i=r.getBody(t.win.document).createTextRange(),i.collapse(!0));t.docSelection.type=="Control"?l(t):i&&typeof i.text!="undefined"?lt(t,i):o(t)};else if(f.isHostMethod(u,"getRangeAt")&&"number"==typeof u.rangeCount)rt=function(t){if(e&&v&&t.docSelection.type=="Control")l(t);else if(t._ranges.length=t.rangeCount=t.nativeSelection.rangeCount,t.rangeCount){for(var i=0,r=t.rangeCount;i<r;++i)t._ranges[i]=new n.WrappedRange(t.nativeSelection.getRangeAt(i));c(t,t._ranges[t.rangeCount-1],w(t.nativeSelection));t.isCollapsed=g(t)}else o(t)};else if(h&&"boolean"==typeof u.isCollapsed&&"boolean"==typeof bt.collapsed&&n.features.implementsDomRange)rt=function(n){var t;t=n.nativeSelection;t.anchorNode?(t=it(t,0),n._ranges=[t],n.rangeCount=1,t=n.nativeSelection,n.anchorNode=t.anchorNode,n.anchorOffset=t.anchorOffset,n.focusNode=t.focusNode,n.focusOffset=t.focusOffset,n.isCollapsed=g(n)):o(n)};else return t.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;i.refresh=function(n){var t=n?this._ranges.slice(0):null;if(rt(this),n){if(n=t.length,n!=this._ranges.length)return!1;for(;n--;)if(!s.rangesEqual(t[n],this._ranges[n]))return!1;return!0}};ht=function(n,t){var r=n.getAllRanges(),u=!1,i,f;for(n.removeAllRanges(),i=0,f=r.length;i<f;++i)u||t!==r[i]?n.addRange(r[i]):u=!0;n.rangeCount||o(n)};i.removeRange=e?function(n){if(this.docSelection.type=="Control"){for(var t=this.docSelection.createRange(),n=ft(n),i=r.getDocument(t.item(0)),i=r.getBody(i).createControlRange(),f,e=!1,u=0,o=t.length;u<o;++u)f=t.item(u),f!==n||e?i.add(t.item(u)):e=!0;i.select();l(this)}else ht(this,n)}:function(n){ht(this,n)};!y&&h&&n.features.implementsDomRange?(w=function(n){var t=!1;return n.anchorNode&&(t=r.comparePoints(n.anchorNode,n.anchorOffset,n.focusNode,n.focusOffset)==1),t},i.isBackwards=function(){return w(this)}):w=i.isBackwards=function(){return!1};i.toString=function(){for(var t=[],n=0,i=this.rangeCount;n<i;++n)t[n]=""+this._ranges[n];return t.join("")};i.collapse=function(t,i){yt(this,t);var u=n.createRange(r.getDocument(t));u.collapseToPoint(t,i);this.removeAllRanges();this.addRange(u);this.isCollapsed=!0};i.collapseToStart=function(){if(this.rangeCount){var n=this._ranges[0];this.collapse(n.startContainer,n.startOffset)}else throw new d("INVALID_STATE_ERR");};i.collapseToEnd=function(){if(this.rangeCount){var n=this._ranges[this.rangeCount-1];this.collapse(n.endContainer,n.endOffset)}else throw new d("INVALID_STATE_ERR");};i.selectAllChildren=function(t){yt(this,t);var i=n.createRange(r.getDocument(t));i.selectNodeContents(t);this.removeAllRanges();this.addRange(i)};i.deleteFromDocument=function(){var n,t,i;if(e&&v&&this.docSelection.type=="Control"){for(n=this.docSelection.createRange();n.length;)t=n.item(0),n.remove(t),t.parentNode.removeChild(t);this.refresh()}else if(this.rangeCount){for(n=this.getAllRanges(),this.removeAllRanges(),t=0,i=n.length;t<i;++t)n[t].deleteContents();this.addRange(n[i-1])}};i.getAllRanges=function(){return this._ranges.slice(0)};i.setSingleRange=function(n){this.setRanges([n])};i.containsNode=function(n,t){for(var i=0,r=this._ranges.length;i<r;++i)if(this._ranges[i].containsNode(n,t))return!0;return!1};i.toHtml=function(){var n="";if(this.rangeCount){for(var n=s.getRangeDocument(this._ranges[0]).createElement("div"),t=0,i=this._ranges.length;t<i;++t)n.appendChild(this._ranges[t].cloneContents());n=n.innerHTML}return n};i.getName=function(){return"WrappedSelection"};i.inspect=function(){return pt(this)};i.detach=function(){this.win=this.anchorNode=this.focusNode=this.win._rangySelection=null};b.inspect=pt;n.Selection=b;n.selectionPrototype=i;n.addCreateMissingNativeApiListener(function(t){typeof t.getSelection=="undefined"&&(t.getSelection=function(){return n.getSelection(this)});t=null})});Base=function(){};Base.extend=function(n,t){var u=Base.prototype.extend,r,f,i;return Base._prototyping=!0,r=new this,u.call(r,n),r.base=function(){},delete Base._prototyping,f=r.constructor,i=r.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==i)this._constructing=!0,f.apply(this,arguments),delete this._constructing;else if(null!=arguments[0])return(arguments[0].extend||u).call(arguments[0],r)},i.ancestor=this,i.extend=this.extend,i.forEach=this.forEach,i.implement=this.implement,i.prototype=r,i.toString=this.toString,i.valueOf=function(n){return"object"==n?i:f.valueOf()},u.call(i,t),"function"==typeof i.init&&i.init(),i};Base.prototype={extend:function(n,t){var r,f,t,u,i;if(1<arguments.length)r=this[n],r&&"function"==typeof t&&(!r.valueOf||r.valueOf()!=t.valueOf())&&/\bbase\b/.test(t)&&(f=t.valueOf(),t=function(){var t=this.base||Base.prototype.base,n;return this.base=r,n=f.apply(this,arguments),this.base=t,n},t.valueOf=function(n){return"object"==n?t:f},t.toString=Base.toString),this[n]=t;else if(n){u=Base.prototype.extend;Base._prototyping||"function"==typeof this||(u=this.extend||u);for(var e={toSource:null},o=["constructor","toString","valueOf"],s=Base._prototyping?0:1;i=o[s++];)n[i]!=e[i]&&u.call(this,i,n[i]);for(i in n)e[i]||u.call(this,i,n[i])}return this}};Base=Base.extend({constructor:function(n){this.extend(n)}},{ancestor:Object,version:"1.1",forEach:function(n,t,i){for(var r in n)void 0===this.prototype[r]&&t.call(i,n[r],r,n)},implement:function(){for(var n=0;n<arguments.length;n++)"function"==typeof arguments[n]?arguments[n](this.prototype):this.prototype.extend(arguments[n]);return this},toString:function(){return""+this.valueOf()}});wysihtml5.browser=function(){var t=navigator.userAgent,r=document.createElement("div"),n=-1!==t.indexOf("MSIE")&&-1===t.indexOf("Opera"),i=-1!==t.indexOf("Gecko")&&-1===t.indexOf("KHTML"),u=-1!==t.indexOf("AppleWebKit/"),e=-1!==t.indexOf("Chrome/"),f=-1!==t.indexOf("Opera/");return{USER_AGENT:t,supported:function(){var n=this.USER_AGENT.toLowerCase(),t="contentEditable"in r,i=document.execCommand&&document.queryCommandSupported&&document.queryCommandState,u=document.querySelector&&document.querySelectorAll,n=this.isIos()&&5>(/ipad|iphone|ipod/.test(n)&&n.match(/ os (\d+).+? like mac os x/)||[,0])[1]||-1!==n.indexOf("opera mobi")||-1!==n.indexOf("hpwos/");return t&&i&&u&&!n},isTouchDevice:function(){return this.supportsEvent("touchmove")},isIos:function(){var n=this.USER_AGENT.toLowerCase();return-1!==n.indexOf("webkit")&&-1!==n.indexOf("mobile")},supportsSandboxedIframes:function(){return n},throwsMixedContentWarningWhenIframeSrcIsEmpty:function(){return!("querySelector"in document)},displaysCaretInEmptyContentEditableCorrectly:function(){return!i},hasCurrentStyleProperty:function(){return"currentStyle"in r},insertsLineBreaksOnReturn:function(){return i},supportsPlaceholderAttributeOn:function(n){return"placeholder"in n},supportsEvent:function(n){var t;return(t="on"+n in r)||(r.setAttribute("on"+n,"return;"),t="function"==typeof r["on"+n]),t},supportsEventsInIframeCorrectly:function(){return!f},firesOnDropOnlyWhenOnDragOverIsCancelled:function(){return u||i},supportsDataTransfer:function(){try{return u&&(window.Clipboard||window.DataTransfer).prototype.getData}catch(n){return!1}},supportsHTML5Tags:function(n){return n=n.createElement("div"),n.innerHTML="<article>foo<\/article>","<article>foo<\/article>"===n.innerHTML.toLowerCase()},supportsCommand:function(){var t={formatBlock:n,insertUnorderedList:n||f||u,insertOrderedList:n||f||u},r={insertHTML:i};return function(n,i){if(!t[i]){try{return n.queryCommandSupported(i)}catch(u){}try{return n.queryCommandEnabled(i)}catch(f){return!!r[i]}}return!1}}(),doesAutoLinkingInContentEditable:function(){return n},canDisableAutoLinking:function(){return this.supportsCommand(document,"AutoUrlDetect")},clearsContentEditableCorrectly:function(){return i||f||u},supportsGetAttributeCorrectly:function(){return"1"!=document.createElement("td").getAttribute("rowspan")},canSelectImagesInContentEditable:function(){return i||n||f},clearsListsInContentEditableCorrectly:function(){return i||n||u},autoScrollsToCaret:function(){return!u},autoClosesUnclosedTags:function(){var n=r.cloneNode(!1),t;return n.innerHTML="<p><div><\/div>",n=n.innerHTML.toLowerCase(),t="<p><\/p><div><\/div>"===n||"<p><div><\/div><\/p>"===n,this.autoClosesUnclosedTags=function(){return t},t},supportsNativeGetElementsByClassName:function(){return-1!==(""+document.getElementsByClassName).indexOf("[native code]")},supportsSelectionModify:function(){return"getSelection"in window&&"modify"in window.getSelection()},supportsClassList:function(){return"classList"in r},needsSpaceAfterLineBreak:function(){return f},supportsSpeechApiOn:function(n){return 11<=(t.match(/Chrome\/(\d+)/)||[,0])[1]&&("onwebkitspeechchange"in n||"speech"in n)},crashesWhenDefineProperty:function(t){return n&&("XMLHttpRequest"===t||"XDomainRequest"===t)},doesAsyncFocus:function(){return n},hasProblemsSettingCaretAfterImg:function(){return n},hasUndoInContextMenu:function(){return i||e||f}}}();wysihtml5.lang.array=function(n){return{contains:function(t){if(n.indexOf)return-1!==n.indexOf(t);for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return!0;return!1},without:function(t){for(var t=wysihtml5.lang.array(t),r=[],i=0,u=n.length;i<u;i++)t.contains(n[i])||r.push(n[i]);return r},get:function(){for(var t=0,r=n.length,i=[];t<r;t++)i.push(n[t]);return i}}};wysihtml5.lang.Dispatcher=Base.extend({observe:function(n,t){return this.events=this.events||{},this.events[n]=this.events[n]||[],this.events[n].push(t),this},on:function(){return this.observe.apply(this,wysihtml5.lang.array(arguments).get())},fire:function(n,t){this.events=this.events||{};for(var r=this.events[n]||[],i=0;i<r.length;i++)r[i].call(this,t);return this},stopObserving:function(n,t){this.events=this.events||{};var i=0,r,u;if(n){for(r=this.events[n]||[],u=[];i<r.length;i++)r[i]!==t&&t&&u.push(r[i]);this.events[n]=u}else this.events={};return this}});wysihtml5.lang.object=function(n){return{merge:function(t){for(var i in t)n[i]=t[i];return this},get:function(){return n},clone:function(){var i={},t;for(t in n)i[t]=n[t];return i},isArray:function(){return"[object Array]"===Object.prototype.toString.call(n)}}},function(){var n=/^\s+/,t=/\s+$/;wysihtml5.lang.string=function(i){return i=""+i,{trim:function(){return i.replace(n,"").replace(t,"")},interpolate:function(n){for(var t in n)i=this.replace("#{"+t+"}").by(n[t]);return i},replace:function(n){return{by:function(t){return i.split(n).join(t)}}}}}}(),function(n){function e(n){return n.replace(t,function(n,t){var r=(t.match(u)||[])[1]||"",i=o[r],t=t.replace(u,""),e;return t.split(i).length>t.split(r).length&&(t+=r,r=""),e=i=t,t.length>f&&(e=e.substr(0,f)+"..."),"www."===i.substr(0,4)&&(i="http://"+i),'<a href="'+i+'">'+e+"<\/a>"+r})}function i(u){var s,f,o;if(!r.contains(u.nodeName))if(u.nodeType===n.TEXT_NODE&&u.data.match(t)){for(s=u.parentNode,f=s.ownerDocument,o=f._wysihtml5_tempElement,o||(o=f._wysihtml5_tempElement=f.createElement("div")),f=o,f.innerHTML="<span><\/span>"+e(u.data),f.removeChild(f.firstChild);f.firstChild;)s.insertBefore(f.firstChild,u);s.removeChild(u)}else{for(s=n.lang.array(u.childNodes).get(),f=s.length,o=0;o<f;o++)i(s[o]);return u}}var r=n.lang.array("CODE PRE A SCRIPT HEAD TITLE STYLE".split(" ")),t=/((https?:\/\/|www\.)[^\s<]{3,})/gi,u=/([^\w\/\-](,?))$/i,f=100,o={")":"(","]":"[","}":"{"};n.dom.autoLink=function(n){var t,u;n:{for(t=n;t.parentNode;){if(t=t.parentNode,u=t.nodeName,r.contains(u)){t=!0;break n}if("body"===u)break}t=!1}return t?n:(n===n.ownerDocument.documentElement&&(n=n.ownerDocument.body),i(n))};n.dom.autoLink.URL_REG_EXP=t}(wysihtml5),function(n){var i=n.browser.supportsClassList(),t=n.dom;t.addClass=function(n,r){if(i)return n.classList.add(r);t.hasClass(n,r)||(n.className+=" "+r)};t.removeClass=function(n,t){if(i)return n.classList.remove(t);n.className=n.className.replace(RegExp("(^|\\s+)"+t+"(\\s+|$)")," ")};t.hasClass=function(n,t){if(i)return n.classList.contains(t);var r=n.className;return 0<r.length&&(r==t||RegExp("(^|\\s)"+t+"(\\s|$)").test(r))}}(wysihtml5);wysihtml5.dom.contains=function(){var n=document.documentElement;return n.contains?function(n,t){return t.nodeType!==wysihtml5.ELEMENT_NODE&&(t=t.parentNode),n!==t&&n.contains(t)}:n.compareDocumentPosition?function(n,t){return!!(n.compareDocumentPosition(t)&16)}:void 0}();wysihtml5.dom.convertToList=function(){function n(n,t){var i=n.createElement("li");return t.appendChild(i),i}return function(t,i){if("UL"===t.nodeName||"OL"===t.nodeName||"MENU"===t.nodeName)return t;for(var h=t.ownerDocument,s=h.createElement(i),o=t.querySelectorAll("br"),c=o.length,r,e,l,u,f=0;f<c;f++)for(r=o[f];(e=r.parentNode)&&e!==t&&e.lastChild===r;){if("block"===wysihtml5.dom.getStyle("display").from(e)){e.removeChild(r);break}wysihtml5.dom.insert(r).after(r.parentNode)}for(o=wysihtml5.lang.array(t.childNodes).get(),c=o.length,f=0;f<c;f++)u=u||n(h,s),r=o[f],e="block"===wysihtml5.dom.getStyle("display").from(r),l="BR"===r.nodeName,e?(u=u.firstChild?n(h,s):u,u.appendChild(r),u=null):l?u=u.firstChild?null:u:u.appendChild(r);return t.parentNode.replaceChild(s,t),s}}();wysihtml5.dom.copyAttributes=function(n){return{from:function(t){return{to:function(i){for(var r,u=0,f=n.length;u<f;u++)r=n[u],"undefined"!=typeof t[r]&&""!==t[r]&&(i[r]=t[r]);return{andTo:arguments.callee}}}}}},function(n){var t=["-webkit-box-sizing","-moz-box-sizing","-ms-box-sizing","box-sizing"],i=function(i){var u,r,f;n:for(r=0,f=t.length;r<f;r++)if("border-box"===n.getStyle(t[r]).from(i)){u=t[r];break n}return u?parseInt(n.getStyle("width").from(i),10)<i.offsetWidth:!1};n.copyStyles=function(r){return{from:function(u){i(u)&&(r=wysihtml5.lang.array(r).without(t));for(var o="",s=r.length,f=0,e;f<s;f++)e=r[f],o+=e+":"+n.getStyle(e).from(u)+";";return{to:function(t){n.setStyles(o).on(t);return{andTo:arguments.callee}}}}}}}(wysihtml5.dom),function(n){n.dom.delegate=function(t,i,r,u){return n.dom.observe(t,r,function(r){for(var f=r.target,e=n.lang.array(t.querySelectorAll(i));f&&f!==t;){if(e.contains(f)){u.call(f,r);break}f=f.parentNode}})}}(wysihtml5);wysihtml5.dom.getAsDom=function(){var n="abbr article aside audio bdi canvas command datalist details figcaption figure footer header hgroup keygen mark meter nav output progress rp rt ruby svg section source summary time track video wbr".split(" ");return function(t,i){var i=i||document,r,u,f;if("object"==typeof t&&t.nodeType)r=i.createElement("div"),r.appendChild(t);else if(wysihtml5.browser.supportsHTML5Tags(i))r=i.createElement("div"),r.innerHTML=t;else{if(r=i,!r._wysihtml5_supportsHTML5Tags){for(u=0,f=n.length;u<f;u++)r.createElement(n[u]);r._wysihtml5_supportsHTML5Tags=!0}r=i;u=r.createElement("div");u.style.display="none";r.body.appendChild(u);try{u.innerHTML=t}catch(e){}r.body.removeChild(u);r=u}return r}}();wysihtml5.dom.getParentElement=function(){function n(n,t){return!t||!t.length?!0:"string"==typeof t?n===t:wysihtml5.lang.array(t).contains(n)}return function(t,i,r){var u,f;if(r=r||50,i.className||i.classRegExp){n:{for(var e=i.nodeName,o=i.className,i=i.classRegExp;r--&&t&&"BODY"!==t.nodeName;){if((u=t.nodeType===wysihtml5.ELEMENT_NODE)&&(u=n(t.nodeName,e))&&(u=o,f=(t.className||"").match(i)||[],u=u?f[f.length-1]===u:!!f.length),u)break n;t=t.parentNode}t=null}return t}n:{for(e=i.nodeName,o=r;o--&&t&&"BODY"!==t.nodeName;){if(n(t.nodeName,e))break n;t=t.parentNode}t=null}return t}}();wysihtml5.dom.getStyle=function(){function n(n){return n.replace(i,function(n){return n.charAt(1).toUpperCase()})}var t={float:"styleFloat"in document.createElement("div").style?"styleFloat":"cssFloat"},i=/\-[a-z]/g;return function(i){return{from:function(r){var f,u,h;if(r.nodeType===wysihtml5.ELEMENT_NODE){var u=r.ownerDocument,f=t[i]||n(i),e=r.style,o=r.currentStyle,s=e[f];if(s)return s;if(o)try{return o[f]}catch(c){}if(f=u.defaultView||u.parentWindow,u=("height"===i||"width"===i)&&"TEXTAREA"===r.nodeName,f.getComputedStyle)return u&&(h=e.overflow,e.overflow="hidden"),r=f.getComputedStyle(r,null).getPropertyValue(i),u&&(e.overflow=h||""),r}}}}}();wysihtml5.dom.hasElementWithTagName=function(){var n={},t=1;return function(i,r){var f=(i._wysihtml5_identifier||(i._wysihtml5_identifier=t++))+":"+r,u=n[f];return u||(u=n[f]=i.getElementsByTagName(r)),0<u.length}}(),function(n){var t={},i=1;n.dom.hasElementWithClassName=function(r,u){if(!n.browser.supportsNativeGetElementsByClassName())return!!r.querySelector("."+u);var e=(r._wysihtml5_identifier||(r._wysihtml5_identifier=i++))+":"+u,f=t[e];return f||(f=t[e]=r.getElementsByClassName(u)),0<f.length}}(wysihtml5);wysihtml5.dom.insert=function(n){return{after:function(t){t.parentNode.insertBefore(n,t.nextSibling)},before:function(t){t.parentNode.insertBefore(n,t)},into:function(t){t.appendChild(n)}}};wysihtml5.dom.insertCSS=function(n){return n=n.join("\n"),{into:function(t){var r=t.head||t.getElementsByTagName("head")[0],i=t.createElement("style");i.type="text/css";i.styleSheet?i.styleSheet.cssText=n:i.appendChild(t.createTextNode(n));r&&r.appendChild(i)}}};wysihtml5.dom.observe=function(n,t,i){for(var t="string"==typeof t?[t]:t,r,u,f=0,e=t.length;f<e;f++)u=t[f],n.addEventListener?n.addEventListener(u,i,!1):(r=function(t){"target"in t||(t.target=t.srcElement);t.preventDefault=t.preventDefault||function(){this.returnValue=!1};t.stopPropagation=t.stopPropagation||function(){this.cancelBubble=!0};i.call(n,t)},n.attachEvent("on"+u,r));return{stop:function(){for(var u,f=0,e=t.length;f<e;f++)u=t[f],n.removeEventListener?n.removeEventListener(u,i,!1):n.detachEvent("on"+u,r)}}};wysihtml5.dom.parse=function(){function t(n,i){var o=n.childNodes,s=o.length,f,e;if(f=u[n.nodeType],e=0,f=f&&f(n),!f)return null;for(e=0;e<s;e++)(newChild=t(o[e],i))&&f.appendChild(newChild);return i&&1>=f.childNodes.length&&f.nodeName.toLowerCase()===r&&!f.attributes.length?f.firstChild:f}function i(n,t){var t=t.toLowerCase(),i,r;if((i="IMG"==n.nodeName)&&(i="src"==t)){try{r=n.complete&&!n.mozMatchesSelector(":-moz-broken")}catch(u){n.complete&&"complete"===n.readyState&&(r=!0)}i=!0===r}return i?n.src:o&&"outerHTML"in n?-1!=n.outerHTML.toLowerCase().indexOf(" "+t+"=")?n.getAttribute(t):null:n.getAttribute(t)}var u={1:function(t){var u,o,e=n.tags,w,d,c;if((o=t.nodeName.toLowerCase(),u=t.scopeName,t._wysihtml5)||(t._wysihtml5=1,"wysihtml5-temp"===t.className))return null;if(u&&"HTML"!=u&&(o=u+":"+o),"outerHTML"in t&&!wysihtml5.browser.autoClosesUnclosedTags()&&"P"===t.nodeName&&"<\/p>"!==t.outerHTML.slice(-4).toLowerCase()&&(o="div"),o in e){if(u=e[o],!u||u.remove)return null;u="string"==typeof u?{rename_tag:u}:u}else if(t.firstChild)u={rename_tag:r};else return null;o=t.ownerDocument.createElement(u.rename_tag||o);var e={},v=u.set_class,y=u.add_class,l=u.set_attributes,b=u.check_attributes,p=n.classes,k=0,a=[];if(u=[],w=[],d=[],l&&(e=wysihtml5.lang.object(l).clone()),b)for(c in b)(l=s[b[c]])&&(l=l(i(t,c)),"string"==typeof l&&(e[c]=l));if(v&&a.push(v),y)for(c in y)(l=h[y[c]])&&(v=l(i(t,c)),"string"==typeof v&&a.push(v));for(p["_wysihtml5-temp-placeholder"]=1,(d=t.getAttribute("class"))&&(a=a.concat(d.split(f))),y=a.length;k<y;k++)t=a[k],p[t]&&u.push(t);for(p=u.length;p--;)t=u[p],wysihtml5.lang.array(w).contains(t)||w.unshift(t);w.length&&(e["class"]=w.join(" "));for(c in e)try{o.setAttribute(c,e[c])}catch(g){}return e.src&&("undefined"!=typeof e.width&&o.setAttribute("width",e.width),"undefined"!=typeof e.height&&o.setAttribute("height",e.height)),o},3:function(n){return n.ownerDocument.createTextNode(n.data)}},r="span",f=/\s+/,e={tags:{},classes:{}},n={},o=!wysihtml5.browser.supportsGetAttributeCorrectly(),s={url:function(){var n=/^https?:\/\//i;return function(t){return!t||!t.match(n)?null:t.replace(n,function(n){return n.toLowerCase()})}}(),alt:function(){var n=/[^ a-z0-9_\-]/gi;return function(t){return t?t.replace(n,""):""}}(),numbers:function(){var n=/\D/g;return function(t){return(t=(t||"").replace(n,""))||null}}()},h={align_img:function(){var n={left:"wysiwyg-float-left",right:"wysiwyg-float-right"};return function(t){return n[(""+t).toLowerCase()]}}(),align_text:function(){var n={left:"wysiwyg-text-align-left",right:"wysiwyg-text-align-right",center:"wysiwyg-text-align-center",justify:"wysiwyg-text-align-justify"};return function(t){return n[(""+t).toLowerCase()]}}(),clear_br:function(){var n={left:"wysiwyg-clear-left",right:"wysiwyg-clear-right",both:"wysiwyg-clear-both",all:"wysiwyg-clear-both"};return function(t){return n[(""+t).toLowerCase()]}}(),size_font:function(){var n={1:"wysiwyg-font-size-xx-small",2:"wysiwyg-font-size-small",3:"wysiwyg-font-size-medium",4:"wysiwyg-font-size-large",5:"wysiwyg-font-size-x-large",6:"wysiwyg-font-size-xx-large",7:"wysiwyg-font-size-xx-large","-":"wysiwyg-font-size-smaller","+":"wysiwyg-font-size-larger"};return function(t){return n[(""+t).charAt(0)]}}()};return function(i,r,u,f){wysihtml5.lang.object(n).merge(e).merge(r).get();for(var u=u||i.ownerDocument||document,r=u.createDocumentFragment(),o="string"==typeof i,i=o?wysihtml5.dom.getAsDom(i,u):i;i.firstChild;)u=i.firstChild,i.removeChild(u),(u=t(u,f))&&r.appendChild(u);return i.innerHTML="",i.appendChild(r),o?wysihtml5.quirks.getCorrectInnerHTML(i):i}}();wysihtml5.dom.removeEmptyTextNodes=function(n){for(var i=wysihtml5.lang.array(n.childNodes).get(),r=i.length,t=0;t<r;t++)n=i[t],n.nodeType===wysihtml5.TEXT_NODE&&""===n.data&&n.parentNode.removeChild(n)};wysihtml5.dom.renameElement=function(n,t){for(var i=n.ownerDocument.createElement(t),r;r=n.firstChild;)i.appendChild(r);return wysihtml5.dom.copyAttributes(["align","className"]).from(n).to(i),n.parentNode.replaceChild(i,n),i};wysihtml5.dom.replaceWithChildNodes=function(n){if(n.parentNode)if(n.firstChild){for(var t=n.ownerDocument.createDocumentFragment();n.firstChild;)t.appendChild(n.firstChild);n.parentNode.replaceChild(t,n)}else n.parentNode.removeChild(n)},function(n){function t(n){var t=n.ownerDocument.createElement("br");n.appendChild(t)}n.resolveList=function(i){if(!("MENU"!==i.nodeName&&"UL"!==i.nodeName&&"OL"!==i.nodeName)){var f=i.ownerDocument.createDocumentFragment(),r=i.previousElementSibling||i.previousSibling,o,e,u;for(r&&"block"!==n.getStyle("display").from(r)&&t(f);u=i.firstChild;){for(o=u.lastChild;r=u.firstChild;)e=(e=r===o)&&"block"!==n.getStyle("display").from(r)&&"BR"!==r.nodeName,f.appendChild(r),e&&t(f);u.parentNode.removeChild(u)}i.parentNode.replaceChild(f,i)}}}(wysihtml5.dom),function(n){var t=document,i="parent top opener frameElement frames localStorage globalStorage sessionStorage indexedDB".split(" "),r="open close openDialog showModalDialog alert confirm prompt openDatabase postMessage XMLHttpRequest XDomainRequest".split(" "),u=["referrer","write","open","close"];n.dom.Sandbox=Base.extend({constructor:function(t,i){this.callback=t||n.EMPTY_FUNCTION;this.config=n.lang.object({}).merge(i).get();this.iframe=this._createIframe()},insertInto:function(n){"string"==typeof n&&(n=t.getElementById(n));n.appendChild(this.iframe)},getIframe:function(){return this.iframe},getWindow:function(){this._readyError()},getDocument:function(){this._readyError()},destroy:function(){var n=this.getIframe();n.parentNode.removeChild(n)},_readyError:function(){throw Error("wysihtml5.Sandbox: Sandbox iframe isn't loaded yet");},_createIframe:function(){var r=this,i=t.createElement("iframe");i.className="wysihtml5-sandbox";n.dom.setAttributes({security:"restricted",allowtransparency:"true",frameborder:0,width:0,height:0,marginwidth:0,marginheight:0}).on(i);return n.browser.throwsMixedContentWarningWhenIframeSrcIsEmpty()&&(i.src="javascript:'<html><\/html>'"),i.onload=function(){i.onreadystatechange=i.onload=null;r._onLoadIframe(i)},i.onreadystatechange=function(){/loaded|complete/.test(i.readyState)&&(i.onreadystatechange=i.onload=null,r._onLoadIframe(i))},i},_onLoadIframe:function(f){var o,e;if(n.dom.contains(t.documentElement,f)){var c=this,h=f.contentWindow,s=f.contentWindow.document,e=this._getHtml({charset:t.characterSet||t.charset||"utf-8",stylesheets:this.config.stylesheets});if(s.open("text/html","replace"),s.write(e),s.close(),this.getWindow=function(){return f.contentWindow},this.getDocument=function(){return f.contentWindow.document},h.onerror=function(n,t,i){throw Error("wysihtml5.Sandbox: "+n,t,i);},!n.browser.supportsSandboxedIframes()){for(e=0,o=i.length;e<o;e++)this._unset(h,i[e]);for(e=0,o=r.length;e<o;e++)this._unset(h,r[e],n.EMPTY_FUNCTION);for(e=0,o=u.length;e<o;e++)this._unset(s,u[e]);this._unset(s,"cookie","",!0)}this.loaded=!0;setTimeout(function(){c.callback(c)},0)}},_getHtml:function(t){var i=t.stylesheets,u="",r=0,f;if(i="string"==typeof i?[i]:i)for(f=i.length;r<f;r++)u+='<link rel="stylesheet" href="'+i[r]+'">';return t.stylesheets=u,n.lang.string('<!DOCTYPE html><html><head><meta charset="#{charset}">#{stylesheets}<\/head><body><\/body><\/html>').interpolate(t)},_unset:function(t,i,r,u){try{t[i]=r}catch(e){}try{t.__defineGetter__(i,function(){return r})}catch(o){}if(u)try{t.__defineSetter__(i,function(){})}catch(s){}if(!n.browser.crashesWhenDefineProperty(i))try{var f={get:function(){return r}};u&&(f.set=function(){});Object.defineProperty(t,i,f)}catch(h){}}})}(wysihtml5),function(){var n={className:"class"};wysihtml5.dom.setAttributes=function(t){return{on:function(i){for(var r in t)i.setAttribute(n[r]||r,t[r])}}}}();wysihtml5.dom.setStyles=function(n){return{on:function(t){if(t=t.style,"string"==typeof n)t.cssText+=";"+n;else for(var i in n)"float"===i?(t.cssFloat=n[i],t.styleFloat=n[i]):t[i]=n[i]}}},function(n){n.simulatePlaceholder=function(t,i,r){var u=function(){i.hasPlaceholderSet()&&i.clear();n.removeClass(i.element,"placeholder")},f=function(){i.isEmpty()&&(i.setValue(r),n.addClass(i.element,"placeholder"))};t.observe("set_placeholder",f).observe("unset_placeholder",u).observe("focus:composer",u).observe("paste:composer",u).observe("blur:composer",f);f()}}(wysihtml5.dom),function(n){var t=document.documentElement;"textContent"in t?(n.setTextContent=function(n,t){n.textContent=t},n.getTextContent=function(n){return n.textContent}):"innerText"in t?(n.setTextContent=function(n,t){n.innerText=t},n.getTextContent=function(n){return n.innerText}):(n.setTextContent=function(n,t){n.nodeValue=t},n.getTextContent=function(n){return n.nodeValue})}(wysihtml5.dom);wysihtml5.quirks.cleanPastedHTML=function(){var n={"a u":wysihtml5.dom.replaceWithChildNodes};return function(t,i,r){var i=i||n,r=r||t.ownerDocument||document,o="string"==typeof t,u,s,f,e=0,t=o?wysihtml5.dom.getAsDom(t,r):t;for(f in i)for(u=t.querySelectorAll(f),r=i[f],s=u.length;e<s;e++)r(u[e]);return o?t.innerHTML:t}}(),function(n){var t=n.dom;n.quirks.ensureProperClearing=function(){var n=function(){var n=this;setTimeout(function(){var t=n.innerHTML.toLowerCase();("<p>&nbsp;<\/p>"==t||"<p>&nbsp;<\/p><p>&nbsp;<\/p>"==t)&&(n.innerHTML="")},0)};return function(i){t.observe(i.element,["cut","keydown"],n)}}();n.quirks.ensureProperClearingOfLists=function(){var i=["OL","UL","MENU"];return function(r){t.observe(r.element,"keydown",function(u){if(u.keyCode===n.BACKSPACE_KEY){var f=r.selection.getSelectedNode(),u=r.element;u.firstChild&&n.lang.array(i).contains(u.firstChild.nodeName)&&(f=t.getParentElement(f,{nodeName:i}))&&f==u.firstChild&&1>=f.childNodes.length&&(f.firstChild?""===f.firstChild.innerHTML:1)&&f.parentNode.removeChild(f)}})}}()}(wysihtml5),function(n){n.quirks.getCorrectInnerHTML=function(t){var i=t.innerHTML,t,u,f,e,r;if(-1===i.indexOf("%7E"))return i;for(t=t.querySelectorAll("[href*='~'], [src*='~']"),r=0,e=t.length;r<e;r++)u=t[r].href||t[r].src,f=n.lang.string(u).replace("~").by("%7E"),i=n.lang.string(i).replace(f).by(u);return i}}(wysihtml5),function(n){var t=n.dom,i="LI P H1 H2 H3 H4 H5 H6".split(" "),r=["UL","OL","MENU"];n.quirks.insertLineBreakOnReturn=function(u){function f(i){if(i=t.getParentElement(i,{nodeName:["P","DIV"]},2)){var r=document.createTextNode(n.INVISIBLE_SPACE);t.insert(r).before(i);t.replaceWithChildNodes(i);u.selection.selectNode(r)}}t.observe(u.element.ownerDocument,"keydown",function(e){var o=e.keyCode,s;e.shiftKey||o!==n.ENTER_KEY&&o!==n.BACKSPACE_KEY||(s=u.selection.getSelectedNode(),(s=t.getParentElement(s,{nodeName:i},4))?"LI"===s.nodeName&&(o===n.ENTER_KEY||o===n.BACKSPACE_KEY)?setTimeout(function(){var n=u.selection.getSelectedNode(),i;n&&((i=t.getParentElement(n,{nodeName:r},2))||f(n))},0):s.nodeName.match(/H[1-6]/)&&o===n.ENTER_KEY&&setTimeout(function(){f(u.selection.getSelectedNode())},0):o===n.ENTER_KEY&&!n.browser.insertsLineBreaksOnReturn()&&(u.commands.exec("insertLineBreak"),e.preventDefault()))})}}(wysihtml5),function(n){n.quirks.redraw=function(t){n.dom.addClass(t,"wysihtml5-quirks-redraw");n.dom.removeClass(t,"wysihtml5-quirks-redraw");try{var i=t.ownerDocument;i.execCommand("italic",!1,null);i.execCommand("italic",!1,null)}catch(r){}}}(wysihtml5),function(n){var t=n.dom;n.Selection=Base.extend({constructor:function(n){window.rangy.init();this.editor=n;this.composer=n.composer;this.doc=this.composer.doc},getBookmark:function(){var n=this.getRange();return n&&n.cloneRange()},setBookmark:function(n){n&&this.setSelection(n)},setBefore:function(n){var t=rangy.createRange(this.doc);return t.setStartBefore(n),t.setEndBefore(n),this.setSelection(t)},setAfter:function(n){var t=rangy.createRange(this.doc);return t.setStartAfter(n),t.setEndAfter(n),this.setSelection(t)},selectNode:function(i){var r=rangy.createRange(this.doc),o=i.nodeType===n.ELEMENT_NODE,f="canHaveHTML"in i?i.canHaveHTML:"IMG"!==i.nodeName,u=o?i.innerHTML:i.data,u=""===u||u===n.INVISIBLE_SPACE,e=t.getStyle("display").from(i),e="block"===e||"list-item"===e;if(u&&o&&f)try{i.innerHTML=n.INVISIBLE_SPACE}catch(s){}f?r.selectNodeContents(i):r.selectNode(i);f&&u&&o?r.collapse(e):f&&u&&(r.setStartAfter(i),r.setEndAfter(i));this.setSelection(r)},getSelectedNode:function(n){return n&&this.doc.selection&&"Control"===this.doc.selection.type&&(n=this.doc.selection.createRange())&&n.length?n.item(0):(n=this.getSelection(this.doc),n.focusNode===n.anchorNode?n.focusNode:(n=this.getRange(this.doc))?n.commonAncestorContainer:this.doc.body)},executeAndRestore:function(t,i){var u=this.doc.body,e=i&&u.scrollTop,o=i&&u.scrollLeft,f='<span class="_wysihtml5-temp-placeholder">'+n.INVISIBLE_SPACE+"<\/span>",r=this.getRange(this.doc);if(r){f=r.createContextualFragment(f);r.insertNode(f);try{t(r.startContainer,r.endContainer)}catch(s){setTimeout(function(){throw s;},0)}(caretPlaceholder=this.doc.querySelector("._wysihtml5-temp-placeholder"))?(r=rangy.createRange(this.doc),r.selectNode(caretPlaceholder),r.deleteContents(),this.setSelection(r)):u.focus();i&&(u.scrollTop=e,u.scrollLeft=o);try{caretPlaceholder.parentNode.removeChild(caretPlaceholder)}catch(h){}}else t(u,u)},executeAndRestoreSimple:function(n){var i,f,t=this.getRange(),r=this.doc.body,u;if(t){i=t.getNodes([3]);r=i[0]||t.startContainer;u=i[i.length-1]||t.endContainer;i=r===t.startContainer?t.startOffset:0;f=u===t.endContainer?t.endOffset:u.length;try{n(t.startContainer,t.endContainer)}catch(e){setTimeout(function(){throw e;},0)}n=rangy.createRange(this.doc);try{n.setStart(r,i)}catch(o){}try{n.setEnd(u,f)}catch(s){}try{this.setSelection(n)}catch(h){}}else n(r,r)},insertHTML:function(n){var n=rangy.createRange(this.doc).createContextualFragment(n),t=n.lastChild;this.insertNode(n);t&&this.setAfter(t)},insertNode:function(n){var t=this.getRange();t&&t.insertNode(n)},surround:function(n){var t=this.getRange();if(t)try{t.surroundContents(n);this.selectNode(n)}catch(i){n.appendChild(t.extractContents());t.insertNode(n)}},scrollIntoView:function(){var r=this.doc,t=r.documentElement.scrollHeight>r.documentElement.offsetHeight,i,u;if((i=r._wysihtml5ScrollIntoViewElement)||(i=r.createElement("span"),i.innerHTML=n.INVISIBLE_SPACE),i=r._wysihtml5ScrollIntoViewElement=i,t){if(this.insertNode(i),t=i,u=0,t.parentNode)do u+=t.offsetTop||0,t=t.offsetParent;while(t);t=u;i.parentNode.removeChild(i);t>r.body.scrollTop&&(r.body.scrollTop=t)}},selectLine:function(){n.browser.supportsSelectionModify()?this._selectLine_W3C():this.doc.selection&&this._selectLine_MSIE()},_selectLine_W3C:function(){var n=this.doc.defaultView.getSelection();n.modify("extend","left","lineboundary");n.modify("extend","right","lineboundary")},_selectLine_MSIE:function(){var t=this.doc.selection.createRange(),i=t.boundingTop,r=this.doc.body.scrollWidth,n;if(t.moveToPoint){for(0===i&&(n=this.doc.createElement("span"),this.insertNode(n),i=n.offsetTop,n.parentNode.removeChild(n)),i+=1,n=-10;n<r;n+=2)try{t.moveToPoint(n,i);break}catch(u){}for(n=this.doc.selection.createRange();0<=r;r--)try{n.moveToPoint(r,i);break}catch(f){}t.setEndPoint("EndToEnd",n);t.select()}},getText:function(){var n=this.getSelection();return n?n.toString():""},getNodes:function(n,t){var i=this.getRange();return i?i.getNodes([n],t):[]},getRange:function(){var n=this.getSelection();return n&&n.rangeCount&&n.getRangeAt(0)},getSelection:function(){return rangy.getSelection(this.doc.defaultView||this.doc.parentWindow)},setSelection:function(n){return rangy.getSelection(this.doc.defaultView||this.doc.parentWindow).setSingleRange(n)}})}(wysihtml5),function(n,t){function u(n,i){return t.dom.isCharacterDataNode(n)?0==i?!!n.previousSibling:i==n.length?!!n.nextSibling:!0:0<i&&i<n.childNodes.length}function i(n,r,u){var f,e;if(t.dom.isCharacterDataNode(r)&&(0==u?(u=t.dom.getNodeIndex(r),r=r.parentNode):u==r.length?(u=t.dom.getNodeIndex(r)+1,r=r.parentNode):f=t.dom.splitDataNode(r,u)),!f){for(f=r.cloneNode(!1),f.id&&f.removeAttribute("id");e=r.childNodes[u];)f.appendChild(e);t.dom.insertAfter(f,r)}return r==n?f:i(n,f.parentNode,t.dom.getNodeIndex(f))}function r(t){this.firstTextNode=(this.isElementMerge=t.nodeType==n.ELEMENT_NODE)?t.lastChild:t;this.textNodes=[this.firstTextNode]}function f(n,t,i,r){this.tagNames=n||[o];this.cssClass=t||"";this.similarClassRegExp=i;this.normalize=r;this.applyToAnyTagName=!1}var o="span",e=/\s+/g;r.prototype={doMerge:function(){for(var r=[],i,n,t=0,u=this.textNodes.length;t<u;++t)i=this.textNodes[t],n=i.parentNode,r[t]=i.data,t&&(n.removeChild(i),n.hasChildNodes()||n.parentNode.removeChild(n));return this.firstTextNode.data=r=r.join("")},getLength:function(){for(var n=this.textNodes.length,t=0;n--;)t+=this.textNodes[n].length;return t},toString:function(){for(var t=[],n=0,i=this.textNodes.length;n<i;++n)t[n]="'"+this.textNodes[n].data+"'";return"[Merge("+t.join(",")+")]"}};f.prototype={getAncestorWithClass:function(i){for(var r,u;i;){if(this.cssClass?(r=this.cssClass,i.className)?(u=i.className.match(this.similarClassRegExp)||[],r=u[u.length-1]===r):r=!1:r=!0,i.nodeType==n.ELEMENT_NODE&&t.dom.arrayContains(this.tagNames,i.tagName.toLowerCase())&&r)return i;i=i.parentNode}return!1},postApply:function(n,t){for(var s=n[0],f=n[n.length-1],e=[],i,h=s,l=f,a=0,v=f.length,o,y,u=0,c=n.length;u<c;++u)(o=n[u],y=this.getAdjacentMergeableTextNode(o.parentNode,!1))?(i||(i=new r(y),e.push(i)),i.textNodes.push(o),o===s&&(h=i.firstTextNode,a=h.length),o===f)&&(l=i.firstTextNode,v=i.getLength()):i=null;if((s=this.getAdjacentMergeableTextNode(f.parentNode,!0))&&(i||(i=new r(f),e.push(i)),i.textNodes.push(s)),e.length){for(u=0,c=e.length;u<c;++u)e[u].doMerge();t.setStart(h,a);t.setEnd(l,v)}},getAdjacentMergeableTextNode:function(t,i){var r=t.nodeType==n.TEXT_NODE,f=r?t.parentNode:t,u=i?"nextSibling":"previousSibling";if(r){if((r=t[u])&&r.nodeType==n.TEXT_NODE)return r}else if((r=f[u])&&this.areElementsMergeable(t,r))return r[i?"firstChild":"lastChild"];return null},areElementsMergeable:function(n,i){var r,o,f,u;if((r=t.dom.arrayContains(this.tagNames,(n.tagName||"").toLowerCase()))&&(r=t.dom.arrayContains(this.tagNames,(i.tagName||"").toLowerCase()))&&(r=n.className.replace(e," ")==i.className.replace(e," ")))n:if(n.attributes.length!=i.attributes.length)r=!1;else{for(r=0,o=n.attributes.length;r<o;++r)if(f=n.attributes[r],u=f.name,"class"!=u&&(u=i.attributes.getNamedItem(u),f.specified!=u.specified||f.specified&&f.nodeValue!==u.nodeValue)){r=!1;break n}r=!0}return r},createContainer:function(n){return n=n.createElement(this.tagNames[0]),this.cssClass&&(n.className=this.cssClass),n},applyToTextNode:function(n){var i=n.parentNode;1==i.childNodes.length&&t.dom.arrayContains(this.tagNames,i.tagName.toLowerCase())?this.cssClass&&(n=this.cssClass,i.className?(i.className&&(i.className=i.className.replace(this.similarClassRegExp,"")),i.className+=" "+n):i.className=n):(i=this.createContainer(t.dom.getDocument(n)),n.parentNode.insertBefore(i,n),i.appendChild(n))},isRemovable:function(i){return t.dom.arrayContains(this.tagNames,i.tagName.toLowerCase())&&n.lang.string(i.className).trim()==this.cssClass},undoToTextNode:function(n,t,r){if(t.containsNode(r)||(n=t.cloneRange(),n.selectNode(r),n.isPointInRange(t.endContainer,t.endOffset)&&u(t.endContainer,t.endOffset)&&(i(r,t.endContainer,t.endOffset),t.setEndAfter(r)),n.isPointInRange(t.startContainer,t.startOffset)&&u(t.startContainer,t.startOffset)&&(r=i(r,t.startContainer,t.startOffset))),this.similarClassRegExp&&r.className&&(r.className=r.className.replace(this.similarClassRegExp,"")),this.isRemovable(r)){for(t=r,r=t.parentNode;t.firstChild;)r.insertBefore(t.firstChild,t);r.removeChild(t)}},applyToRange:function(t){var i=t.getNodes([n.TEXT_NODE]),r,u,f;if(!i.length)try{r=this.createContainer(t.endContainer.ownerDocument);t.surroundContents(r);this.selectNode(t,r);return}catch(e){}if(t.splitBoundaries(),i=t.getNodes([n.TEXT_NODE]),i.length){for(u=0,f=i.length;u<f;++u)r=i[u],this.getAncestorWithClass(r)||this.applyToTextNode(r);t.setStart(i[0],0);r=i[i.length-1];t.setEnd(r,r.length);this.normalize&&this.postApply(i,t)}},undoToRange:function(t){var i=t.getNodes([n.TEXT_NODE]),r,e,u,f;for(i.length?(t.splitBoundaries(),i=t.getNodes([n.TEXT_NODE])):(i=t.endContainer.ownerDocument.createTextNode(n.INVISIBLE_SPACE),t.insertNode(i),t.selectNode(i),i=[i]),u=0,f=i.length;u<f;++u)r=i[u],(e=this.getAncestorWithClass(r))&&this.undoToTextNode(r,t,e);1==f?this.selectNode(t,i[0]):(t.setStart(i[0],0),r=i[i.length-1],t.setEnd(r,r.length),this.normalize&&this.postApply(i,t))},selectNode:function(t,i){var u=i.nodeType===n.ELEMENT_NODE,f="canHaveHTML"in i?i.canHaveHTML:!0,r=u?i.innerHTML:i.data;if((r=""===r||r===n.INVISIBLE_SPACE)&&u&&f)try{i.innerHTML=n.INVISIBLE_SPACE}catch(e){}t.selectNodeContents(i);r&&u?t.collapse(!1):r&&(t.setStartAfter(i),t.setEndAfter(i))},getTextSelectedByRange:function(n,t){var r=t.cloneRange(),i;return r.selectNodeContents(n),i=r.intersection(t),i=i?i.toString():"",r.detach(),i},isAppliedToRange:function(t){var f=[],i,u=t.getNodes([n.TEXT_NODE]),r,e,o;if(!u.length)return(i=this.getAncestorWithClass(t.startContainer))?[i]:!1;for(r=0,e=u.length;r<e;++r){if(o=this.getTextSelectedByRange(u[r],t),i=this.getAncestorWithClass(u[r]),""!=o&&!i)return!1;f.push(i)}return f},toggleRange:function(n){this.isAppliedToRange(n)?this.undoToRange(n):this.applyToRange(n)}};n.selection.HTMLApplier=f}(wysihtml5,rangy);wysihtml5.Commands=Base.extend({constructor:function(n){this.editor=n;this.composer=n.composer;this.doc=this.composer.doc},support:function(n){return wysihtml5.browser.supportsCommand(this.doc,n)},exec:function(n,t){var i=wysihtml5.commands[n],u=wysihtml5.lang.array(arguments).get(),f=i&&i.exec,r=null;if(this.editor.fire("beforecommand:composer"),f)u.unshift(this.composer),r=f.apply(i,u);else try{r=this.doc.execCommand(n,!1,t)}catch(e){}return this.editor.fire("aftercommand:composer"),r},state:function(n){var t=wysihtml5.commands[n],i=wysihtml5.lang.array(arguments).get(),r=t&&t.state;if(r)return i.unshift(this.composer),r.apply(t,i);try{return this.doc.queryCommandState(n)}catch(u){return!1}},value:function(n){var t=wysihtml5.commands[n],i=t&&t.value;if(i)return i.call(t,this.composer,n);try{return this.doc.queryCommandValue(n)}catch(r){return null}}}),function(n){n.commands.bold={exec:function(t,i){return n.commands.formatInline.exec(t,i,"b")},state:function(t,i){return n.commands.formatInline.state(t,i,"b")},value:function(){}}}(wysihtml5),function(n){function u(u,f){var c=u.doc,s="_wysihtml5-temp-"+ +new Date,h=0,l,e,o;for(n.commands.formatInline.exec(u,i,r,s,/non-matching-class/g),l=c.querySelectorAll(r+"."+s),s=l.length;h<s;h++)for(o in e=l[h],e.removeAttribute("class"),f)e.setAttribute(o,f[o]);h=e;1===s&&(o=t.getTextContent(e),s=!!e.querySelector("*"),o=""===o||o===n.INVISIBLE_SPACE,!s&&o&&(t.setTextContent(e,f.text||e.href),c=c.createTextNode(" "),u.selection.setAfter(e),u.selection.insertNode(c),h=c));u.selection.setAfter(h)}var i,r="A",t=n.dom;n.commands.createLink={exec:function(n,i,r){var f=this.state(n,i);f?n.selection.executeAndRestore(function(){for(var e=f.length,i=0,n,r,u;i<e;i++)n=f[i],r=t.getParentElement(n,{nodeName:"code"}),u=t.getTextContent(n),u.match(t.autoLink.URL_REG_EXP)&&!r?t.renameElement(n,"code"):t.replaceWithChildNodes(n)}):(r="object"==typeof r?r:{href:r},u(n,r))},state:function(t,i){return n.commands.formatInline.state(t,i,"A")},value:function(){return i}}}(wysihtml5),function(n){var t=/wysiwyg-font-size-[a-z\-]+/g;n.commands.fontSize={exec:function(i,r,u){return n.commands.formatInline.exec(i,r,"span","wysiwyg-font-size-"+u,t)},state:function(i,r,u){return n.commands.formatInline.state(i,r,"span","wysiwyg-font-size-"+u,t)},value:function(){}}}(wysihtml5),function(n){var t=/wysiwyg-color-[a-z]+/g;n.commands.foreColor={exec:function(i,r,u){return n.commands.formatInline.exec(i,r,"span","wysiwyg-color-"+u,t)},state:function(i,r,u){return n.commands.formatInline.state(i,r,"span","wysiwyg-color-"+u,t)},value:function(){}}}(wysihtml5),function(n){function i(t){for(t=t.previousSibling;t&&t.nodeType===n.TEXT_NODE&&!n.lang.string(t.data).trim();)t=t.previousSibling;return t}function r(t){for(t=t.nextSibling;t&&t.nodeType===n.TEXT_NODE&&!n.lang.string(t.data).trim();)t=t.nextSibling;return t}function u(n){return"BR"===n.nodeName||"block"===t.getStyle("display").from(n)?!0:!1}function e(i,r,u,f){if(f)var e=t.observe(i,"DOMNodeInserted",function(i){var i=i.target,r;i.nodeType===n.ELEMENT_NODE&&(r=t.getStyle("display").from(i),"inline"!==r.substr(0,6)&&(i.className+=" "+f))});i.execCommand(r,!1,u);e&&e.stop()}function o(n,t){n.selection.selectLine();n.selection.surround(t);var u=r(t),f=i(t);u&&"BR"===u.nodeName&&u.parentNode.removeChild(u);f&&"BR"===f.nodeName&&f.parentNode.removeChild(f);(u=t.lastChild)&&"BR"===u.nodeName&&u.parentNode.removeChild(u);n.selection.selectNode(t)}var t=n.dom,f="H1 H2 H3 H4 H5 H6 P BLOCKQUOTE DIV".split(" ");n.commands.formatBlock={exec:function(s,h,c,l,a){var y=s.doc,v=this.state(s,h,c,l,a),p,c="string"==typeof c?c.toUpperCase():c;if(v)s.selection.executeAndRestoreSimple(function(){var f;if(a&&(v.className=v.className.replace(a,"")),f=!!n.lang.string(v.className).trim(),f||v.nodeName!==(c||"DIV"))f&&t.renameElement(v,"DIV");else{var f=v,o=f.ownerDocument,e=r(f),s=i(f);e&&!u(e)&&f.parentNode.insertBefore(o.createElement("br"),e);s&&!u(s)&&f.parentNode.insertBefore(o.createElement("br"),f);t.replaceWithChildNodes(v)}});else{if((null===c||n.lang.array(f).contains(c))&&(p=s.selection.getSelectedNode(),v=t.getParentElement(p,{nodeName:f}))){s.selection.executeAndRestoreSimple(function(){if(c&&(v=t.renameElement(v,c)),l){var n=v;n.className?(n.className=n.className.replace(a,""),n.className+=" "+l):n.className=l}});return}s.commands.support(h)?e(y,h,c||"DIV",l):(v=y.createElement(c||"DIV"),l&&(v.className=l),o(s,v))}},state:function(n,i,r,u,f){return r="string"==typeof r?r.toUpperCase():r,n=n.selection.getSelectedNode(),t.getParentElement(n,{nodeName:r,className:u,classRegExp:f})},value:function(){}}}(wysihtml5),function(n){function i(i,u,f){var e=i+":"+u;if(!t[e]){var s=t,h=n.selection.HTMLApplier,o=r[i],i=o?[i.toLowerCase(),o.toLowerCase()]:[i.toLowerCase()];s[e]=new h(i,u,f,!0)}return t[e]}var r={strong:"b",em:"i",b:"strong",i:"em"},t={};n.commands.formatInline={exec:function(n,t,r,u,f){if(t=n.selection.getRange(),!t)return!1;i(r,u,f).toggleRange(t);n.selection.setSelection(t)},state:function(t,u,f,e,o){var u=t.doc,s=r[f]||f;return!n.dom.hasElementWithTagName(u,f)&&!n.dom.hasElementWithTagName(u,s)||e&&!n.dom.hasElementWithClassName(u,e)?!1:(t=t.selection.getRange(),t?i(f,e,o).isAppliedToRange(t):!1)},value:function(){}}}(wysihtml5),function(n){n.commands.insertHTML={exec:function(n,t,i){n.commands.support(t)?n.doc.execCommand(t,!1,i):n.selection.insertHTML(i)},state:function(){return!1},value:function(){}}}(wysihtml5),function(n){n.commands.insertImage={exec:function(t,i,r){var r="object"==typeof r?r:{src:r},f=t.doc,i=this.state(t),u;if(i)t.selection.setBefore(i),r=i.parentNode,r.removeChild(i),n.dom.removeEmptyTextNodes(r),"A"===r.nodeName&&!r.firstChild&&(t.selection.setAfter(r),r.parentNode.removeChild(r)),n.quirks.redraw(t.element);else{i=f.createElement("IMG");for(u in r)i[u]=r[u];t.selection.insertNode(i);n.browser.hasProblemsSettingCaretAfterImg()?(r=f.createTextNode(n.INVISIBLE_SPACE),t.selection.insertNode(r),t.selection.setAfter(r)):t.selection.setAfter(i)}},state:function(t){var i;return n.dom.hasElementWithTagName(t.doc,"IMG")?(i=t.selection.getSelectedNode(),!i)?!1:"IMG"===i.nodeName?i:i.nodeType!==n.ELEMENT_NODE?!1:(i=t.selection.getText(),i=n.lang.string(i).trim())?!1:(t=t.selection.getNodes(n.ELEMENT_NODE,function(n){return"IMG"===n.nodeName}),1!==t.length?!1:t[0]):!1},value:function(n){return(n=this.state(n))&&n.src}}}(wysihtml5),function(n){var t="<br>"+(n.browser.needsSpaceAfterLineBreak()?" ":"");n.commands.insertLineBreak={exec:function(i,r){i.commands.support(r)?(i.doc.execCommand(r,!1,null),n.browser.autoScrollsToCaret()||i.selection.scrollIntoView()):i.commands.exec("insertHTML",t)},state:function(){return!1},value:function(){}}}(wysihtml5),function(n){n.commands.insertOrderedList={exec:function(t,i){var u=t.doc,r=t.selection.getSelectedNode(),f=n.dom.getParentElement(r,{nodeName:"OL"}),o=n.dom.getParentElement(r,{nodeName:"UL"}),r="_wysihtml5-temp-"+(new Date).getTime(),e;t.commands.support(i)?u.execCommand(i,!1,null):f?t.selection.executeAndRestoreSimple(function(){n.dom.resolveList(f)}):o?t.selection.executeAndRestoreSimple(function(){n.dom.renameElement(o,"ol")}):(t.commands.exec("formatBlock","div",r),e=u.querySelector("."+r),u=""===e.innerHTML||e.innerHTML===n.INVISIBLE_SPACE,t.selection.executeAndRestoreSimple(function(){f=n.dom.convertToList(e,"ol")}),u&&t.selection.selectNode(f.querySelector("li")))},state:function(t){return t=t.selection.getSelectedNode(),n.dom.getParentElement(t,{nodeName:"OL"})},value:function(){}}}(wysihtml5),function(n){n.commands.insertUnorderedList={exec:function(t,i){var u=t.doc,r=t.selection.getSelectedNode(),f=n.dom.getParentElement(r,{nodeName:"UL"}),o=n.dom.getParentElement(r,{nodeName:"OL"}),r="_wysihtml5-temp-"+(new Date).getTime(),e;t.commands.support(i)?u.execCommand(i,!1,null):f?t.selection.executeAndRestoreSimple(function(){n.dom.resolveList(f)}):o?t.selection.executeAndRestoreSimple(function(){n.dom.renameElement(o,"ul")}):(t.commands.exec("formatBlock","div",r),e=u.querySelector("."+r),u=""===e.innerHTML||e.innerHTML===n.INVISIBLE_SPACE,t.selection.executeAndRestoreSimple(function(){f=n.dom.convertToList(e,"ul")}),u&&t.selection.selectNode(f.querySelector("li")))},state:function(t){return t=t.selection.getSelectedNode(),n.dom.getParentElement(t,{nodeName:"UL"})},value:function(){}}}(wysihtml5),function(n){n.commands.italic={exec:function(t,i){return n.commands.formatInline.exec(t,i,"i")},state:function(t,i){return n.commands.formatInline.state(t,i,"i")},value:function(){}}}(wysihtml5),function(n){var t=/wysiwyg-text-align-[a-z]+/g;n.commands.justifyCenter={exec:function(i){return n.commands.formatBlock.exec(i,"formatBlock",null,"wysiwyg-text-align-center",t)},state:function(i){return n.commands.formatBlock.state(i,"formatBlock",null,"wysiwyg-text-align-center",t)},value:function(){}}}(wysihtml5),function(n){var t=/wysiwyg-text-align-[a-z]+/g;n.commands.justifyLeft={exec:function(i){return n.commands.formatBlock.exec(i,"formatBlock",null,"wysiwyg-text-align-left",t)},state:function(i){return n.commands.formatBlock.state(i,"formatBlock",null,"wysiwyg-text-align-left",t)},value:function(){}}}(wysihtml5),function(n){var t=/wysiwyg-text-align-[a-z]+/g;n.commands.justifyRight={exec:function(i){return n.commands.formatBlock.exec(i,"formatBlock",null,"wysiwyg-text-align-right",t)},state:function(i){return n.commands.formatBlock.state(i,"formatBlock",null,"wysiwyg-text-align-right",t)},value:function(){}}}(wysihtml5),function(n){n.commands.underline={exec:function(t,i){return n.commands.formatInline.exec(t,i,"u")},state:function(t,i){return n.commands.formatInline.state(t,i,"u")},value:function(){}}}(wysihtml5),function(n){var i='<span id="_wysihtml5-undo" class="_wysihtml5-temp">'+n.INVISIBLE_SPACE+"<\/span>",r='<span id="_wysihtml5-redo" class="_wysihtml5-temp">'+n.INVISIBLE_SPACE+"<\/span>",t=n.dom;n.UndoManager=n.lang.Dispatcher.extend({constructor:function(n){this.editor=n;this.composer=n.composer;this.element=this.composer.element;this.history=[this.composer.getValue()];this.position=1;this.composer.commands.support("insertHTML")&&this._observe()},_observe:function(){var u=this,f=this.composer.sandbox.getDocument(),o,s,h,e;t.observe(this.element,"keydown",function(n){if(!(n.altKey||!n.ctrlKey&&!n.metaKey)){var t=n.keyCode,i=90===t&&n.shiftKey||89===t;90===t&&!n.shiftKey?(u.undo(),n.preventDefault()):i&&(u.redo(),n.preventDefault())}});t.observe(this.element,"keydown",function(n){n=n.keyCode;n!==o&&(o=n,(8===n||46===n)&&u.transact())});n.browser.hasUndoInContextMenu()&&(e=function(){for(var n;n=f.querySelector("._wysihtml5-temp");)n.parentNode.removeChild(n);clearInterval(s)},t.observe(this.element,"contextmenu",function(){e();u.composer.selection.executeAndRestoreSimple(function(){u.element.lastChild&&u.composer.selection.setAfter(u.element.lastChild);f.execCommand("insertHTML",!1,i);f.execCommand("insertHTML",!1,r);f.execCommand("undo",!1,null)});s=setInterval(function(){f.getElementById("_wysihtml5-redo")?(e(),u.redo()):f.getElementById("_wysihtml5-undo")||(e(),u.undo())},400);h||(h=!0,t.observe(document,"mousedown",e),t.observe(f,["mousedown","paste","cut","copy"],e))}));this.editor.observe("newword:composer",function(){u.transact()}).observe("beforecommand:composer",function(){u.transact()})},transact:function(){var t=this.history[this.position-1],n=this.composer.getValue();n!=t&&(40<(this.history.length=this.position)&&(this.history.shift(),this.position--),this.position++,this.history.push(n))},undo:function(){this.transact();1>=this.position||(this.set(this.history[--this.position-1]),this.editor.fire("undo:composer"))},redo:function(){this.position>=this.history.length||(this.set(this.history[++this.position-1]),this.editor.fire("redo:composer"))},set:function(n){this.composer.setValue(n);this.editor.focus(!0)}})}(wysihtml5);wysihtml5.views.View=Base.extend({constructor:function(n,t,i){this.parent=n;this.element=t;this.config=i;this._observeViewChange()},_observeViewChange:function(){var n=this;this.parent.observe("beforeload",function(){n.parent.observe("change_view",function(t){t===n.name?(n.parent.currentView=n,n.show(),setTimeout(function(){n.focus()},0)):n.hide()})})},focus:function(){if(this.element.ownerDocument.querySelector(":focus")!==this.element)try{this.element.focus()}catch(n){}},hide:function(){this.element.style.display="none"},show:function(){this.element.style.display=""},disable:function(){this.element.setAttribute("disabled","disabled")},enable:function(){this.element.removeAttribute("disabled")}}),function(n){var t=n.dom,i=n.browser;n.views.Composer=n.views.View.extend({name:"composer",CARET_HACK:"<br>",constructor:function(n,t,i){this.base(n,t,i);this.textarea=this.parent.textarea;this._initSandbox()},clear:function(){this.element.innerHTML=i.displaysCaretInEmptyContentEditableCorrectly()?"":this.CARET_HACK},getValue:function(t){var i=this.isEmpty()?"":n.quirks.getCorrectInnerHTML(this.element);return t&&(i=this.parent.parse(i)),n.lang.string(i).replace(n.INVISIBLE_SPACE).by("")},setValue:function(n,t){t&&(n=this.parent.parse(n));this.element.innerHTML=n},show:function(){this.iframe.style.display=this._displayStyle||"";this.disable();this.enable()},hide:function(){this._displayStyle=t.getStyle("display").from(this.iframe);"none"===this._displayStyle&&(this._displayStyle=null);this.iframe.style.display="none"},disable:function(){this.element.removeAttribute("contentEditable");this.base()},enable:function(){this.element.setAttribute("contentEditable","true");this.base()},focus:function(t){n.browser.doesAsyncFocus()&&this.hasPlaceholderSet()&&this.clear();this.base();var i=this.element.lastChild;t&&i&&("BR"===i.nodeName?this.selection.setBefore(this.element.lastChild):this.selection.setAfter(this.element.lastChild))},getTextContent:function(){return t.getTextContent(this.element)},hasPlaceholderSet:function(){return this.getTextContent()==this.textarea.element.getAttribute("placeholder")},isEmpty:function(){var n=this.element.innerHTML;return""===n||n===this.CARET_HACK||this.hasPlaceholderSet()||""===this.getTextContent()&&!this.element.querySelector("blockquote, ul, ol, img, embed, object, table, iframe, svg, video, audio, button, input, select, textarea")},_initSandbox:function(){var r=this,n,i;this.sandbox=new t.Sandbox(function(){r._create()},{stylesheets:this.config.stylesheets});this.iframe=this.sandbox.getIframe();n=document.createElement("input");n.type="hidden";n.name="_wysihtml5_mode";n.value=1;i=this.textarea.element;t.insert(this.iframe).after(i);t.insert(n).after(i)},_create:function(){var u=this,r;this.doc=this.sandbox.getDocument();this.element=this.doc.body;this.textarea=this.parent.textarea;this.element.innerHTML=this.textarea.getValue(!0);this.enable();this.selection=new n.Selection(this.parent);this.commands=new n.Commands(this.parent);t.copyAttributes("className spellcheck title lang dir accessKey".split(" ")).from(this.textarea.element).to(this.element);t.addClass(this.element,this.config.composerClassName);this.config.style&&this.style();this.observe();r=this.config.name;r&&(t.addClass(this.element,r),t.addClass(this.iframe,r));(r="string"==typeof this.config.placeholder?this.config.placeholder:this.textarea.element.getAttribute("placeholder"))&&t.simulatePlaceholder(this.parent,this,r);this.commands.exec("styleWithCSS",!1);this._initAutoLinking();this._initObjectResizing();this._initUndoManager();(this.textarea.element.hasAttribute("autofocus")||document.querySelector(":focus")==this.textarea.element)&&setTimeout(function(){u.focus()},100);n.quirks.insertLineBreakOnReturn(this);i.clearsContentEditableCorrectly()||n.quirks.ensureProperClearing(this);i.clearsListsInContentEditableCorrectly()||n.quirks.ensureProperClearingOfLists(this);this.initSync&&this.config.sync&&this.initSync();this.textarea.hide();this.parent.fire("beforeload").fire("load")},_initAutoLinking:function(){var r=this,u=i.canDisableAutoLinking(),f=i.doesAutoLinkingInContentEditable();if(u&&this.commands.exec("autoUrlDetect",!1),this.config.autoLink){(!f||f&&u)&&this.parent.observe("newword:composer",function(){r.selection.executeAndRestore(function(n,i){t.autoLink(i.parentNode)})});var o=this.sandbox.getDocument().getElementsByTagName("a"),s=t.autoLink.URL_REG_EXP,e=function(i){return i=n.lang.string(t.getTextContent(i)).trim(),"www."===i.substr(0,4)&&(i="http://"+i),i};t.observe(this.element,"keydown",function(n){if(o.length){var n=r.selection.getSelectedNode(n.target.ownerDocument),i=t.getParentElement(n,{nodeName:"A"},4),u;i&&(u=e(i),setTimeout(function(){var n=e(i);n!==u&&n.match(s)&&i.setAttribute("href",n)},0))}})}},_initObjectResizing:function(){var u=["width","height"],f=u.length,r=this.element;this.commands.exec("enableObjectResizing",this.config.allowObjectResizing);this.config.allowObjectResizing?i.supportsEvent("resizeend")&&t.observe(r,"resizeend",function(t){for(var t=t.target||t.srcElement,e=t.style,o=0,i;o<f;o++)i=u[o],e[i]&&(t.setAttribute(i,parseInt(e[i],10)),e[i]="");n.quirks.redraw(r)}):i.supportsEvent("resizestart")&&t.observe(r,"resizestart",function(n){n.preventDefault()})},_initUndoManager:function(){new n.UndoManager(this.parent)}})}(wysihtml5),function(n){var t=n.dom,i=document,u=window,e=i.createElement("div"),r="background-color color cursor font-family font-size font-style font-variant font-weight line-height letter-spacing text-align text-decoration text-indent text-rendering word-break word-wrap word-spacing".split(" "),f="background-color border-collapse border-bottom-color border-bottom-style border-bottom-width border-left-color border-left-style border-left-width border-right-color border-right-style border-right-width border-top-color border-top-style border-top-width clear display float margin-bottom margin-left margin-right margin-top outline-color outline-offset outline-width outline-style padding-left padding-right padding-top padding-bottom position top left right bottom z-index vertical-align text-align -webkit-box-sizing -moz-box-sizing -ms-box-sizing box-sizing -webkit-box-shadow -moz-box-shadow -ms-box-shadow box-shadow -webkit-border-top-right-radius -moz-border-radius-topright border-top-right-radius -webkit-border-bottom-right-radius -moz-border-radius-bottomright border-bottom-right-radius -webkit-border-bottom-left-radius -moz-border-radius-bottomleft border-bottom-left-radius -webkit-border-top-left-radius -moz-border-radius-topleft border-top-left-radius width height".split(" "),o="width height top left right bottom".split(" "),s=["html             { height: 100%; }","body             { min-height: 100%; padding: 0; margin: 0; margin-top: -1px; padding-top: 1px; }","._wysihtml5-temp { display: none; }",n.browser.isGecko?"body.placeholder { color: graytext !important; }":"body.placeholder { color: #a9a9a9 !important; }","body[disabled]   { background-color: #eee !important; color: #999 !important; cursor: default !important; }","img:-moz-broken  { -moz-force-broken-image-icon: 1; height: 24px; width: 24px; }"],h=function(n){if(n.setActive)try{n.setActive()}catch(o){}else{var r=n.style,f=i.documentElement.scrollTop||i.body.scrollTop,e=i.documentElement.scrollLeft||i.body.scrollLeft,r={position:r.position,top:r.top,left:r.left,WebkitUserSelect:r.WebkitUserSelect};t.setStyles({position:"absolute",top:"-99999px",left:"-99999px",WebkitUserSelect:"none"}).on(n);n.focus();t.setStyles(r).on(n);u.scrollTo&&u.scrollTo(e,f)}};n.views.Composer.prototype.style=function(){var l=this,a=i.querySelector(":focus"),c=this.textarea.element,v=c.hasAttribute("placeholder"),w=v&&c.getAttribute("placeholder"),y,p;return this.focusStylesHost=this.focusStylesHost||e.cloneNode(!1),this.blurStylesHost=this.blurStylesHost||e.cloneNode(!1),v&&c.removeAttribute("placeholder"),c===a&&c.blur(),t.copyStyles(f).from(c).to(this.iframe).andTo(this.blurStylesHost),t.copyStyles(r).from(c).to(this.element).andTo(this.blurStylesHost),t.insertCSS(s).into(this.element.ownerDocument),h(c),t.copyStyles(f).from(c).to(this.focusStylesHost),t.copyStyles(r).from(c).to(this.focusStylesHost),y=n.lang.array(f).without(["display"]),a?a.focus():c.blur(),v&&c.setAttribute("placeholder",w),n.browser.hasCurrentStyleProperty()||(p=t.observe(u,"resize",function(){if(t.contains(document.documentElement,l.iframe)){var n=t.getStyle("display").from(c),i=t.getStyle("display").from(l.iframe);c.style.display="";l.iframe.style.display="none";t.copyStyles(o).from(c).to(l.iframe).andTo(l.focusStylesHost).andTo(l.blurStylesHost);l.iframe.style.display=i;c.style.display=n}else p.stop()})),this.parent.observe("focus:composer",function(){t.copyStyles(y).from(l.focusStylesHost).to(l.iframe);t.copyStyles(r).from(l.focusStylesHost).to(l.element)}),this.parent.observe("blur:composer",function(){t.copyStyles(y).from(l.blurStylesHost).to(l.iframe);t.copyStyles(r).from(l.blurStylesHost).to(l.element)}),this}}(wysihtml5),function(n){var t=n.dom,i=n.browser,r={66:"bold",73:"italic",85:"underline"};n.views.Composer.prototype.observe=function(){var u=this,o=this.getValue(),s=this.sandbox.getIframe(),f=this.element,h=i.supportsEventsInIframeCorrectly()?f:this.sandbox.getWindow(),l=i.supportsEvent("drop")?["drop","paste"]:["dragdrop","paste"],e,c;t.observe(s,"DOMNodeRemoved",function(){clearInterval(e);u.parent.fire("destroy:composer")});e=setInterval(function(){t.contains(document.documentElement,s)||(clearInterval(e),u.parent.fire("destroy:composer"))},250);t.observe(h,"focus",function(){u.parent.fire("focus").fire("focus:composer");setTimeout(function(){o=u.getValue()},0)});t.observe(h,"blur",function(){o!==u.getValue()&&u.parent.fire("change").fire("change:composer");u.parent.fire("blur").fire("blur:composer")});n.browser.isIos()&&t.observe(f,"blur",function(){var n=f.ownerDocument.createElement("input"),t=document.documentElement.scrollTop||document.body.scrollTop,i=document.documentElement.scrollLeft||document.body.scrollLeft;try{u.selection.insertNode(n)}catch(r){f.appendChild(n)}n.focus();n.parentNode.removeChild(n);window.scrollTo(i,t)});t.observe(f,"dragenter",function(){u.parent.fire("unset_placeholder")});i.firesOnDropOnlyWhenOnDragOverIsCancelled()&&t.observe(f,["dragover","dragenter"],function(n){n.preventDefault()});t.observe(f,l,function(n){var t=n.dataTransfer,r;t&&i.supportsDataTransfer()&&(r=t.getData("text/html")||t.getData("text/plain"));r?(f.focus(),u.commands.exec("insertHTML",r),u.parent.fire("paste").fire("paste:composer"),n.stopPropagation(),n.preventDefault()):setTimeout(function(){u.parent.fire("paste").fire("paste:composer")},0)});t.observe(f,"keyup",function(t){t=t.keyCode;(t===n.SPACE_KEY||t===n.ENTER_KEY)&&u.parent.fire("newword:composer")});this.parent.observe("paste:composer",function(){setTimeout(function(){u.parent.fire("newword:composer")},0)});i.canSelectImagesInContentEditable()||t.observe(f,"mousedown",function(n){var t=n.target;"IMG"===t.nodeName&&(u.selection.selectNode(t),n.preventDefault())});t.observe(f,"keydown",function(n){var t=r[n.keyCode];(n.ctrlKey||n.metaKey)&&!n.altKey&&t&&(u.commands.exec(t),n.preventDefault())});t.observe(f,"keydown",function(t){var r=u.selection.getSelectedNode(!0),i=t.keyCode;r&&"IMG"===r.nodeName&&(i===n.BACKSPACE_KEY||i===n.DELETE_KEY)&&(i=r.parentNode,i.removeChild(r),"A"===i.nodeName&&!i.firstChild&&i.parentNode.removeChild(i),setTimeout(function(){n.quirks.redraw(f)},0),t.preventDefault())});c={IMG:"Image: ",A:"Link: "};t.observe(f,"mouseover",function(n){var n=n.target,t=n.nodeName;"A"!==t&&"IMG"!==t||n.hasAttribute("title")||(t=c[t]+(n.getAttribute("href")||n.getAttribute("src")),n.setAttribute("title",t))})}}(wysihtml5),function(n){n.views.Synchronizer=Base.extend({constructor:function(n,t,i){this.editor=n;this.textarea=t;this.composer=i;this._observe()},fromComposerToTextarea:function(t){this.textarea.setValue(n.lang.string(this.composer.getValue()).trim(),t)},fromTextareaToComposer:function(n){var t=this.textarea.getValue();t?this.composer.setValue(t,n):(this.composer.clear(),this.editor.fire("set_placeholder"))},sync:function(n){"textarea"===this.editor.currentView.name?this.fromTextareaToComposer(n):this.fromComposerToTextarea(n)},_observe:function(){var i,t=this,r=this.textarea.element.form,u=function(){i=setInterval(function(){t.fromComposerToTextarea()},400)},f=function(){clearInterval(i);i=null};u();r&&(n.dom.observe(r,"submit",function(){t.sync(!0)}),n.dom.observe(r,"reset",function(){setTimeout(function(){t.fromTextareaToComposer()},0)}));this.editor.observe("change_view",function(n){n!=="composer"||i?n==="textarea"&&(t.fromComposerToTextarea(!0),f()):(t.fromTextareaToComposer(!0),u())});this.editor.observe("destroy:composer",f)}})}(wysihtml5);wysihtml5.views.Textarea=wysihtml5.views.View.extend({name:"textarea",constructor:function(n,t,i){this.base(n,t,i);this._observe()},clear:function(){this.element.value=""},getValue:function(n){var t=this.isEmpty()?"":this.element.value;return n&&(t=this.parent.parse(t)),t},setValue:function(n,t){t&&(n=this.parent.parse(n));this.element.value=n},hasPlaceholderSet:function(){var t=wysihtml5.browser.supportsPlaceholderAttributeOn(this.element),i=this.element.getAttribute("placeholder")||null,n=this.element.value;return t&&!n||n===i},isEmpty:function(){return!wysihtml5.lang.string(this.element.value).trim()||this.hasPlaceholderSet()},_observe:function(){var t=this.element,n=this.parent,i={focusin:"focus",focusout:"blur"},r=wysihtml5.browser.supportsEvent("focusin")?["focusin","focusout","change"]:["focus","blur","change"];n.observe("beforeload",function(){wysihtml5.dom.observe(t,r,function(t){t=i[t.type]||t.type;n.fire(t).fire(t+":textarea")});wysihtml5.dom.observe(t,["paste","drop"],function(){setTimeout(function(){n.fire("paste").fire("paste:textarea")},0)})})}}),function(n){var t=n.dom;n.toolbar.Dialog=n.lang.Dispatcher.extend({constructor:function(n,t){this.link=n;this.container=t},_observe:function(){var i,r;if(!this._observed){i=this;r=function(n){var t=i._serialize();t==i.elementToChange?i.fire("edit",t):i.fire("save",t);i.hide();n.preventDefault();n.stopPropagation()};t.observe(i.link,"click",function(){t.hasClass(i.link,"wysihtml5-command-dialog-opened")&&setTimeout(function(){i.hide()},0)});t.observe(this.container,"keydown",function(t){var u=t.keyCode;u===n.ENTER_KEY&&r(t);u===n.ESCAPE_KEY&&i.hide()});t.delegate(this.container,"[data-wysihtml5-dialog-action=save]","click",r);t.delegate(this.container,"[data-wysihtml5-dialog-action=cancel]","click",function(n){i.fire("cancel");i.hide();n.preventDefault();n.stopPropagation()});for(var f=this.container.querySelectorAll("input, select, textarea"),u=0,e=f.length,o=function(){clearInterval(i.interval)};u<e;u++)t.observe(f[u],"change",o);this._observed=!0}},_serialize:function(){for(var i=this.elementToChange||{},t=this.container.querySelectorAll("[data-wysihtml5-dialog-field]"),r=t.length,n=0;n<r;n++)i[t[n].getAttribute("data-wysihtml5-dialog-field")]=t[n].value;return i},_interpolate:function(n){for(var t,i,f=document.querySelector(":focus"),u=this.container.querySelectorAll("[data-wysihtml5-dialog-field]"),e=u.length,r=0;r<e;r++)t=u[r],t===f||n&&"hidden"===t.type||(i=t.getAttribute("data-wysihtml5-dialog-field"),i=this.elementToChange?this.elementToChange[i]||"":t.defaultValue,t.value=i)},show:function(n){var r=this,i=this.container.querySelector("input, select, textarea");if(this.elementToChange=n,this._observe(),this._interpolate(),n&&(this.interval=setInterval(function(){r._interpolate(!0)},500)),t.addClass(this.link,"wysihtml5-command-dialog-opened"),this.container.style.display="",this.fire("show"),i&&!n)try{i.focus()}catch(u){}},hide:function(){clearInterval(this.interval);this.elementToChange=null;t.removeClass(this.link,"wysihtml5-command-dialog-opened");this.container.style.display="none";this.fire("hide")}})}(wysihtml5),function(n){var t=n.dom,r={position:"relative"},i={left:0,margin:0,opacity:0,overflow:"hidden",padding:0,position:"absolute",top:0,zIndex:1},u={cursor:"inherit",fontSize:"50px",height:"50px",marginTop:"-25px",outline:0,padding:0,position:"absolute",right:"-4px",top:"50%"},f={"x-webkit-speech":"",speech:""};n.toolbar.Speech=function(e,o){var s=document.createElement("input"),h;if(n.browser.supportsSpeechApiOn(s)){h=document.createElement("div");n.lang.object(i).merge({width:o.offsetWidth+"px",height:o.offsetHeight+"px"});t.insert(s).into(h);t.insert(h).into(o);t.setStyles(u).on(s);t.setAttributes(f).on(s);t.setStyles(i).on(h);t.setStyles(r).on(o);t.observe(s,"onwebkitspeechchange"in s?"webkitspeechchange":"speechchange",function(){e.execCommand("insertText",s.value);s.value=""});t.observe(s,"click",function(n){t.hasClass(o,"wysihtml5-command-disabled")&&n.preventDefault();n.stopPropagation()})}else o.style.display="none"}}(wysihtml5),function(n){var t=n.dom;n.toolbar.Toolbar=Base.extend({constructor:function(t,i){this.editor=t;this.container="string"==typeof i?document.getElementById(i):i;this.composer=t.composer;this._getLinks("command");this._getLinks("action");this._observe();this.show();for(var u=this.container.querySelectorAll("[data-wysihtml5-command=insertSpeech]"),f=u.length,r=0;r<f;r++)new n.toolbar.Speech(this,u[r])},_getLinks:function(t){for(var e=this[t+"Links"]=n.lang.array(this.container.querySelectorAll("[data-wysihtml5-"+t+"]")).get(),h=e.length,u=0,c=this[t+"Mapping"]={},i,o,r,f,s;u<h;u++)i=e[u],r=i.getAttribute("data-wysihtml5-"+t),f=i.getAttribute("data-wysihtml5-"+t+"-value"),o=this.container.querySelector("[data-wysihtml5-"+t+"-group='"+r+"']"),s=this._getDialog(i,r),c[r+":"+f]={link:i,group:o,name:r,value:f,dialog:s,state:!1}},_getDialog:function(t,i){var r=this,u=this.container.querySelector("[data-wysihtml5-dialog='"+i+"']"),f,e;return u&&(f=new n.toolbar.Dialog(t,u),f.observe("show",function(){e=r.composer.selection.getBookmark();r.editor.fire("show:dialog",{command:i,dialogContainer:u,commandLink:t})}),f.observe("save",function(n){e&&r.composer.selection.setBookmark(e);r._execCommand(i,n);r.editor.fire("save:dialog",{command:i,dialogContainer:u,commandLink:t})}),f.observe("cancel",function(){r.editor.focus(!1);r.editor.fire("cancel:dialog",{command:i,dialogContainer:u,commandLink:t})})),f},execCommand:function(n,t){if(!this.commandsDisabled){var i=this.commandMapping[n+":"+t];i&&i.dialog&&!i.state?i.dialog.show():this._execCommand(n,t)}},_execCommand:function(n,t){this.editor.focus(!1);this.composer.commands.exec(n,t);this._updateLinkStates()},execAction:function(n){var t=this.editor;switch(n){case"change_view":t.currentView===t.textarea?t.fire("change_view","composer"):t.fire("change_view","textarea")}},_observe:function(){for(var n=this,r=this.editor,i=this.container,f=this.commandLinks.concat(this.actionLinks),e=f.length,u=0;u<e;u++)t.setAttributes({href:"javascript:;",unselectable:"on"}).on(f[u]);t.delegate(i,"[data-wysihtml5-command]","mousedown",function(n){n.preventDefault()});t.delegate(i,"[data-wysihtml5-command]","click",function(t){var i=this.getAttribute("data-wysihtml5-command"),r=this.getAttribute("data-wysihtml5-command-value");n.execCommand(i,r);t.preventDefault()});t.delegate(i,"[data-wysihtml5-action]","click",function(t){var i=this.getAttribute("data-wysihtml5-action");n.execAction(i);t.preventDefault()});r.observe("focus:composer",function(){n.bookmark=null;clearInterval(n.interval);n.interval=setInterval(function(){n._updateLinkStates()},500)});r.observe("blur:composer",function(){clearInterval(n.interval)});r.observe("destroy:composer",function(){clearInterval(n.interval)});r.observe("change_view",function(r){setTimeout(function(){n.commandsDisabled="composer"!==r;n._updateLinkStates();n.commandsDisabled?t.addClass(i,"wysihtml5-commands-disabled"):t.removeClass(i,"wysihtml5-commands-disabled")},0)})},_updateLinkStates:function(){var u=this.commandMapping,e=this.actionMapping,f,r,i;for(f in u)(i=u[f],this.commandsDisabled?(r=!1,t.removeClass(i.link,"wysihtml5-command-active"),i.group&&t.removeClass(i.group,"wysihtml5-command-active"),i.dialog&&i.dialog.hide()):(r=this.composer.commands.state(i.name,i.value),n.lang.object(r).isArray()&&(r=1===r.length?r[0]:!0),t.removeClass(i.link,"wysihtml5-command-disabled"),i.group&&t.removeClass(i.group,"wysihtml5-command-disabled")),i.state!==r)&&((i.state=r)?(t.addClass(i.link,"wysihtml5-command-active"),i.group&&t.addClass(i.group,"wysihtml5-command-active"),i.dialog&&("object"==typeof r?i.dialog.show(r):i.dialog.hide())):(t.removeClass(i.link,"wysihtml5-command-active"),i.group&&t.removeClass(i.group,"wysihtml5-command-active"),i.dialog&&i.dialog.hide()));for(f in e)u=e[f],"change_view"===u.name&&(u.state=this.editor.currentView===this.editor.textarea,u.state?t.addClass(u.link,"wysihtml5-action-active"):t.removeClass(u.link,"wysihtml5-action-active"))},show:function(){this.container.style.display=""},hide:function(){this.container.style.display="none"}})}(wysihtml5),function(n){var t={name:void 0,style:!0,toolbar:void 0,autoLink:!0,parserRules:{tags:{br:{},span:{},div:{},p:{}},classes:{}},parser:n.dom.parse,composerClassName:"wysihtml5-editor",bodyClassName:"wysihtml5-supported",stylesheets:[],placeholderText:void 0,allowObjectResizing:!0,supportTouchDevices:!0};n.Editor=n.lang.Dispatcher.extend({constructor:function(i,r){if(this.textareaElement="string"==typeof i?document.getElementById(i):i,this.config=n.lang.object({}).merge(t).merge(r).get(),this.currentView=this.textarea=new n.views.Textarea(this,this.textareaElement,this.config),this._isCompatible=n.browser.supported(),this._isCompatible&&(this.config.supportTouchDevices||!n.browser.isTouchDevice())){n.dom.addClass(document.body,this.config.bodyClassName);this.currentView=this.composer=new n.views.Composer(this,this.textareaElement,this.config);"function"==typeof this.config.parser&&this._initParser();this.observe("beforeload",function(){this.synchronizer=new n.views.Synchronizer(this,this.textarea,this.composer);this.config.toolbar&&(this.toolbar=new n.toolbar.Toolbar(this,this.config.toolbar))});try{console.log("Heya! This page is using wysihtml5 for rich text editing. Check out https://github.com/xing/wysihtml5")}catch(f){}}else{var u=this;setTimeout(function(){u.fire("beforeload").fire("load")},0)}},isCompatible:function(){return this._isCompatible},clear:function(){return this.currentView.clear(),this},getValue:function(n){return this.currentView.getValue(n)},setValue:function(n,t){return n?(this.currentView.setValue(n,t),this):this.clear()},focus:function(n){return this.currentView.focus(n),this},disable:function(){return this.currentView.disable(),this},enable:function(){return this.currentView.enable(),this},isEmpty:function(){return this.currentView.isEmpty()},hasPlaceholderSet:function(){return this.currentView.hasPlaceholderSet()},parse:function(t){var i=this.config.parser(t,this.config.parserRules,this.composer.sandbox.getDocument(),!0);return"object"==typeof t&&n.quirks.redraw(t),i},_initParser:function(){this.observe("paste:composer",function(){var t=this;t.composer.selection.executeAndRestore(function(){n.quirks.cleanPastedHTML(t.composer.element);t.parse(t.composer.element)},!0)});this.observe("paste:textarea",function(){this.textarea.setValue(this.parse(this.textarea.getValue()))})}})}(wysihtml5);!function(n,t){"use strict";var f={"font-styles":function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li class='dropdown'><a class='btn dropdown-toggle "+i+" btn-default' data-toggle='dropdown' href='#'><i class='glyphicon glyphicon-font'><\/i>&nbsp;<span class='current-font'>"+n.font_styles.normal+"<\/span>&nbsp;<b class='caret'><\/b><\/a><ul class='dropdown-menu'><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='div' tabindex='-1'>"+n.font_styles.normal+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h1' tabindex='-1'>"+n.font_styles.h1+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h2' tabindex='-1'>"+n.font_styles.h2+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h3' tabindex='-1'>"+n.font_styles.h3+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h4'>"+n.font_styles.h4+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h5'>"+n.font_styles.h5+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h6'>"+n.font_styles.h6+"<\/a><\/li><\/ul><\/li>"},emphasis:function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li><div class='btn-group'><a class='btn "+i+" btn-default' data-wysihtml5-command='bold' title='CTRL+B' tabindex='-1'>"+n.emphasis.bold+"<\/a><a class='btn "+i+" btn-default' data-wysihtml5-command='italic' title='CTRL+I' tabindex='-1'>"+n.emphasis.italic+"<\/a><a class='btn "+i+" btn-default' data-wysihtml5-command='underline' title='CTRL+U' tabindex='-1'>"+n.emphasis.underline+"<\/a><\/div><\/li>"},lists:function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li><div class='btn-group'><a class='btn "+i+" btn-default' data-wysihtml5-command='insertUnorderedList' title='"+n.lists.unordered+"' tabindex='-1'><i class='glyphicon glyphicon-list'><\/i><\/a><a class='btn "+i+" btn-default' data-wysihtml5-command='insertOrderedList' title='"+n.lists.ordered+"' tabindex='-1'><i class='glyphicon glyphicon-th-list'><\/i><\/a><a class='btn "+i+" btn-default' data-wysihtml5-command='Outdent' title='"+n.lists.outdent+"' tabindex='-1'><i class='glyphicon glyphicon-indent-right'><\/i><\/a><a class='btn -"+i+" btn-default' data-wysihtml5-command='Indent' title='"+n.lists.indent+"' tabindex='-1'><i class='glyphicon glyphicon-indent-left'><\/i><\/a><\/div><\/li>"},link:function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li><div class='bootstrap-wysihtml5-insert-link-modal modal fade'><div class='modal-dialog'><div class='modal-content'><div class='modal-header'><a class='close' data-dismiss='modal'>&times;<\/a><h4>"+n.link.insert+"<\/h4><\/div><div class='modal-body'><input value='http://' class='bootstrap-wysihtml5-insert-link-url form-control'><label class='checkbox'> <input type='checkbox' class='bootstrap-wysihtml5-insert-link-target' checked>"+n.link.target+"<\/label><\/div><div class='modal-footer'><button class='btn btn-default' data-dismiss='modal'>"+n.link.cancel+"<\/button><button href='#' class='btn btn-primary' data-dismiss='modal'>"+n.link.insert+"<\/button><\/div><\/div><\/div><\/div><a class='btn "+i+" btn-default' data-wysihtml5-command='createLink' title='"+n.link.insert+"' tabindex='-1'><i class='glyphicon glyphicon-share'><\/i><\/a><\/li>"},image:function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li><div class='bootstrap-wysihtml5-insert-image-modal modal fade'><div class='modal-dialog'><div class='modal-content'><div class='modal-header'><a class='close' data-dismiss='modal'>&times;<\/a><h4>"+n.image.insert+"<\/h4><\/div><div class='modal-body'><input value='http://' class='bootstrap-wysihtml5-insert-image-url form-control'><\/div><div class='modal-footer'><button class='btn btn-default' data-dismiss='modal'>"+n.image.cancel+"<\/button><button class='btn btn-primary' data-dismiss='modal'>"+n.image.insert+"<\/button><\/div><\/div><\/div><\/div><a class='btn "+i+" btn-default' data-wysihtml5-command='insertImage' title='"+n.image.insert+"' tabindex='-1'><i class='glyphicon glyphicon-picture'><\/i><\/a><\/li>"},html:function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li><div class='btn-group'><a class='btn "+i+" btn-default' data-wysihtml5-action='change_view' title='"+n.html.edit+"' tabindex='-1'><i class='glyphicon glyphicon-pencil'><\/i><\/a><\/div><\/li>"},color:function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li class='dropdown'><a class='btn dropdown-toggle "+i+" btn-default' data-toggle='dropdown' href='#' tabindex='-1'><span class='current-color'>"+n.colours.black+"<\/span>&nbsp;<b class='caret'><\/b><\/a><ul class='dropdown-menu'><li><div class='wysihtml5-colors' data-wysihtml5-command-value='black'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='black'>"+n.colours.black+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='silver'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='silver'>"+n.colours.silver+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='gray'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='gray'>"+n.colours.gray+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='maroon'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='maroon'>"+n.colours.maroon+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='red'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='red'>"+n.colours.red+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='purple'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='purple'>"+n.colours.purple+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='green'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='green'>"+n.colours.green+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='olive'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='olive'>"+n.colours.olive+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='navy'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='navy'>"+n.colours.navy+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='blue'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='blue'>"+n.colours.blue+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='orange'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='orange'>"+n.colours.orange+"<\/a><\/li><\/ul><\/li>"}},o=function(n,t,i){return f[n](t,i)},u=function(t,i){var u,e;this.el=t;u=i||r;for(e in u.customTemplates)f[e]=u.customTemplates[e];this.toolbar=this.createToolbar(t,u);this.editor=this.createEditor(i);window.editor=this.editor;n("iframe.wysihtml5-sandbox").each(function(t,i){n(i.contentWindow).off("focus.wysihtml5").on({"focus.wysihtml5":function(){n("li.dropdown").removeClass("open")}})})},i,r,e;u.prototype={constructor:u,createEditor:function(i){var r,u;if(i=i||{},i=n.extend(!0,{},i),i.toolbar=this.toolbar[0],r=new t.Editor(this.el[0],i),i&&i.events)for(u in i.events)r.on(u,i.events[u]);return r},createToolbar:function(t,i){var h=this,f=n("<ul/>",{"class":"wysihtml5-toolbar",style:"display:none"}),c=i.locale||r.locale||"en",u,s;for(u in r)s=!1,i[u]!==undefined?i[u]===!0&&(s=!0):s=r[u],s===!0&&(f.append(o(u,e[c],i)),u==="html"&&this.initHtml(f),u==="link"&&this.initInsertLink(f),u==="image"&&this.initInsertImage(f));if(i.toolbar)for(u in i.toolbar)f.append(i.toolbar[u]);return f.find("a[data-wysihtml5-command='formatBlock']").click(function(t){var i=t.target||t.srcElement,r=n(i);h.toolbar.find(".current-font").text(r.html())}),f.find("a[data-wysihtml5-command='foreColor']").click(function(t){var i=t.target||t.srcElement,r=n(i);h.toolbar.find(".current-color").text(r.html())}),this.el.before(f),f},initHtml:function(n){var t="a[data-wysihtml5-action='change_view']";n.find(t).click(function(){n.find("a.btn").not(t).toggleClass("disabled")})},initInsertImage:function(t){var r=this,i=t.find(".bootstrap-wysihtml5-insert-image-modal"),u=i.find(".bootstrap-wysihtml5-insert-image-url"),o=i.find(".btn-primary"),s=u.val(),f,e=function(){var n=u.val();u.val(s);r.editor.currentView.element.focus();f&&(r.editor.composer.selection.setBookmark(f),f=null);r.editor.composer.commands.exec("insertImage",n)};u.keypress(function(n){n.which==13&&(e(),i.modal("hide"))});o.click(e);i.on("shown",function(){u.focus()});i.on("hide",function(){r.editor.currentView.element.focus()});t.find("a[data-wysihtml5-command=insertImage]").click(function(){var t=n(this).hasClass("wysihtml5-command-active");if(t)return!0;r.editor.currentView.element.focus(!1);f=r.editor.composer.selection.getBookmark();i.appendTo("body").modal("show");i.on("click.dismiss.modal",'[data-dismiss="modal"]',function(n){n.stopPropagation()});return!1})},initInsertLink:function(t){var r=this,i=t.find(".bootstrap-wysihtml5-insert-link-modal"),u=i.find(".bootstrap-wysihtml5-insert-link-url"),o=i.find(".bootstrap-wysihtml5-insert-link-target"),s=i.find(".btn-primary"),h=u.val(),f,e=function(){var t=u.val(),n;u.val(h);r.editor.currentView.element.focus();f&&(r.editor.composer.selection.setBookmark(f),f=null);n=o.prop("checked");r.editor.composer.commands.exec("createLink",{href:t,target:n?"_blank":"_self",rel:n?"nofollow":""})};u.keypress(function(n){n.which==13&&(e(),i.modal("hide"))});s.click(e);i.on("shown",function(){u.focus()});i.on("hide",function(){r.editor.currentView.element.focus()});t.find("a[data-wysihtml5-command=createLink]").click(function(){var t=n(this).hasClass("wysihtml5-command-active");if(t)return!0;r.editor.currentView.element.focus(!1);f=r.editor.composer.selection.getBookmark();i.appendTo("body").modal("show");i.on("click.dismiss.modal",'[data-dismiss="modal"]',function(n){n.stopPropagation()});return!1})}};i={resetDefaults:function(){n.fn.wysihtml5.defaultOptions=n.extend(!0,{},n.fn.wysihtml5.defaultOptionsCache)},bypassDefaults:function(t){return this.each(function(){var i=n(this);i.data("wysihtml5",new u(i,t))})},shallowExtend:function(t){var r=n.extend({},n.fn.wysihtml5.defaultOptions,t||{},n(this).data()),u=this;return i.bypassDefaults.apply(u,[r])},deepExtend:function(t){var r=n.extend(!0,{},n.fn.wysihtml5.defaultOptions,t||{}),u=this;return i.bypassDefaults.apply(u,[r])},init:function(n){var t=this;return i.shallowExtend.apply(t,[n])}};n.fn.wysihtml5=function(t){if(i[t])return i[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t!="object"&&t)n.error("Method "+t+" does not exist on jQuery.wysihtml5");else return i.init.apply(this,arguments)};n.fn.wysihtml5.Constructor=u;r=n.fn.wysihtml5.defaultOptions={"font-styles":!0,color:!1,emphasis:!0,lists:!0,html:!1,link:!0,image:!0,size:"sm",events:{},parserRules:{classes:{"wysiwyg-color-silver":1,"wysiwyg-color-gray":1,"wysiwyg-color-white":1,"wysiwyg-color-maroon":1,"wysiwyg-color-red":1,"wysiwyg-color-purple":1,"wysiwyg-color-fuchsia":1,"wysiwyg-color-green":1,"wysiwyg-color-lime":1,"wysiwyg-color-olive":1,"wysiwyg-color-yellow":1,"wysiwyg-color-navy":1,"wysiwyg-color-blue":1,"wysiwyg-color-teal":1,"wysiwyg-color-aqua":1,"wysiwyg-color-orange":1},tags:{b:{},i:{},br:{},ol:{},ul:{},li:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},blockquote:{},u:1,img:{check_attributes:{width:"numbers",alt:"alt",src:"url",height:"numbers"}},a:{check_attributes:{href:"url",target:"alt",rel:"alt"}},span:1,div:1,code:1,pre:1}},stylesheets:["/Content/bootstrap3-wysiwyg5-color.css"],locale:"en"};typeof n.fn.wysihtml5.defaultOptionsCache=="undefined"&&(n.fn.wysihtml5.defaultOptionsCache=n.extend(!0,{},n.fn.wysihtml5.defaultOptions));e=n.fn.wysihtml5.locale={en:{font_styles:{normal:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6"},emphasis:{bold:"Bold",italic:"Italic",underline:"Underline"},lists:{unordered:"Unordered list",ordered:"Ordered list",outdent:"Outdent",indent:"Indent"},link:{insert:"Insert link",cancel:"Cancel",target:"Open link in new window"},image:{insert:"Insert image",cancel:"Cancel"},html:{edit:"Edit HTML"},colours:{black:"Black",silver:"Silver",gray:"Grey",maroon:"Maroon",red:"Red",purple:"Purple",green:"Green",olive:"Olive",navy:"Navy",blue:"Blue",orange:"Orange"}}}}(window.jQuery,window.wysihtml5);!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):n("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(n){var t,it,f,p,o,pt,s="Close",wt="BeforeClose",ti="AfterClose",ii="BeforeAppend",rt="MarkupParse",ut="Open",bt="Change",ft="mfp",u="."+ft,w="mfp-ready",kt="mfp-removing",et="mfp-prevent-close",b=function(){},ot=!!window.jQuery,h=n(window),r=function(n,i){t.ev.on(ft+n+u,i)},l=function(t,i,r,u){var f=document.createElement("div");return f.className="mfp-"+t,r&&(f.innerHTML=r),u?i&&i.appendChild(f):(f=n(f),i&&f.appendTo(i)),f},i=function(i,r){t.ev.triggerHandler(ft+i,r);t.st.callbacks&&(i=i.charAt(0).toLowerCase()+i.slice(1),t.st.callbacks[i]&&t.st.callbacks[i].apply(t,n.isArray(r)?r:[r]))},st=function(i){return i===pt&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=n(t.st.closeMarkup.replace("%title%",t.st.tClose)),pt=i),t.currTemplate.closeBtn},ht=function(){n.magnificPopup.instance||(t=new b,t.init(),n.magnificPopup.instance=t)},ri=function(){var n=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==n.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in n)return!0;return!1},a,k,d,g,ct,e,gt,at,ni,nt,yt,tt;b.prototype={constructor:b,init:function(){var i=navigator.appVersion;t.isLowIE=t.isIE8=document.all&&!document.addEventListener;t.isAndroid=/android/gi.test(i);t.isIOS=/iphone|ipad|ipod/gi.test(i);t.supportsTransition=ri();t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent);f=n(document);t.popupsCache={}},open:function(e){var s,c,p,b,a,k,v,d,y;if(e.isObj===!1){for(t.items=e.items.toArray(),t.index=0,p=e.items,s=0;s<p.length;s++)if(c=p[s],c.parsed&&(c=c.el[0]),c===e.el[0]){t.index=s;break}}else t.items=n.isArray(e.items)?e.items:[e.items],t.index=e.index||0;if(t.isOpen)return void t.updateItemHTML();for(t.types=[],o="",t.ev=e.mainEl&&e.mainEl.length?e.mainEl.eq(0):f,e.key?(t.popupsCache[e.key]||(t.popupsCache[e.key]={}),t.currTemplate=t.popupsCache[e.key]):t.currTemplate={},t.st=n.extend(!0,{},n.magnificPopup.defaults,e),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=l("bg").on("click"+u,function(){t.close()}),t.wrap=l("wrap").attr("tabindex",-1).on("click"+u,function(n){t._checkIfClose(n.target)&&t.close()}),t.container=l("container",t.wrap)),t.contentContainer=l("content"),t.st.preloader&&(t.preloader=l("preloader",t.container,t.st.tLoading)),b=n.magnificPopup.modules,s=0;s<b.length;s++)a=b[s],a=a.charAt(0).toUpperCase()+a.slice(1),t["init"+a].call(t);return i("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(r(rt,function(n,t,i,r){i.close_replaceWith=st(r.type)}),o+=" mfp-close-btn-in"):t.wrap.append(st())),t.st.alignTop&&(o+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:h.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:f.height(),position:"absolute"}),t.st.enableEscapeKey&&f.on("keyup"+u,function(n){27===n.keyCode&&t.close()}),h.on("resize"+u,function(){t.updateSize()}),t.st.closeOnContentClick||(o+=" mfp-auto-cursor"),o&&t.wrap.addClass(o),k=t.wH=h.height(),v={},t.fixedContentPos&&t._hasScrollBar(k)&&(d=t._getScrollbarSize(),d&&(v.marginRight=d)),t.fixedContentPos&&(t.isIE7?n("body, html").css("overflow","hidden"):v.overflow="hidden"),y=t.st.mainClass,t.isIE7&&(y+=" mfp-ie7"),y&&t._addClassToMFP(y),t.updateItemHTML(),i("BuildControls"),n("html").css(v),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||n(document.body)),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(w),t._setFocus()):t.bgOverlay.addClass(w);f.on("focusin"+u,t._onFocusIn)},16),t.isOpen=!0,t.updateSize(k),i(ut),e},close:function(){t.isOpen&&(i(wt),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(kt),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){var r,e;i(s);r=kt+" "+w+" ";(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(r+=t.st.mainClass+" "),t._removeClassFromMFP(r),t.fixedContentPos)&&(e={marginRight:""},t.isIE7?n("body, html").css("overflow",""):e.overflow="",n("html").css(e));f.off("keyup"+u+" focusin"+u);t.ev.off(u);t.wrap.attr("class","mfp-wrap").removeAttr("style");t.bgOverlay.attr("class","mfp-bg");t.container.attr("class","mfp-container");!t.st.showCloseBtn||t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach();t.st.autoFocusLast&&t._lastFocusedEl&&n(t._lastFocusedEl).focus();t.currItem=null;t.content=null;t.currTemplate=null;t.prevHeight=0;i(ti)},updateSize:function(n){if(t.isIOS){var u=document.documentElement.clientWidth/window.innerWidth,r=window.innerHeight*u;t.wrap.css("height",r);t.wH=r}else t.wH=n||h.height();t.fixedContentPos||t.wrap.css("height",t.wH);i("Resize")},updateItemHTML:function(){var u=t.items[t.index],r,f,e;t.contentContainer.detach();t.content&&t.content.detach();u.parsed||(u=t.parseEl(t.index));r=u.type;(i("BeforeChange",[t.currItem?t.currItem.type:"",r]),t.currItem=u,t.currTemplate[r])||(f=t.st[r]?t.st[r].markup:!1,i("FirstMarkupParse",f),t.currTemplate[r]=f?n(f):!0);p&&p!==u.type&&t.container.removeClass("mfp-"+p+"-holder");e=t["get"+r.charAt(0).toUpperCase()+r.slice(1)](u,t.currTemplate[r]);t.appendContent(e,r);u.preloaded=!0;i(bt,u);p=u.type;t.container.prepend(t.contentContainer);i("AfterChange")},appendContent:function(n,r){t.content=n;n?t.st.showCloseBtn&&t.st.closeBtnInside&&t.currTemplate[r]===!0?t.content.find(".mfp-close").length||t.content.append(st()):t.content=n:t.content="";i(ii);t.container.addClass("mfp-"+r+"-holder");t.contentContainer.append(t.content)},parseEl:function(r){var o,u=t.items[r],e,f;if(u.tagName?u={el:n(u)}:(o=u.type,u={data:u,src:u.src}),u.el){for(e=t.types,f=0;f<e.length;f++)if(u.el.hasClass("mfp-"+e[f])){o=e[f];break}u.src=u.el.attr("data-mfp-src");u.src||(u.src=u.el.attr("href"))}return u.type=o||t.st.type||"inline",u.index=r,u.parsed=!0,t.items[r]=u,i("ElementParse",u),t.items[r]},addGroup:function(n,i){var u=function(r){r.mfpEl=this;t._openClick(r,n,i)},r;i||(i={});r="click.magnificPopup";i.mainEl=n;i.items?(i.isObj=!0,n.off(r).on(r,u)):(i.isObj=!1,i.delegate?n.off(r).on(r,i.delegate,u):(i.items=n,n.off(r).on(r,u)))},_openClick:function(i,r,u){var e=void 0!==u.midClick?u.midClick:n.magnificPopup.defaults.midClick,f;if(e||!(2===i.which||i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)){if(f=void 0!==u.disableOn?u.disableOn:n.magnificPopup.defaults.disableOn,f)if(n.isFunction(f)){if(!f.call(t))return!0}else if(h.width()<f)return!0;i.type&&(i.preventDefault(),t.isOpen&&i.stopPropagation());u.el=n(i.mfpEl);u.delegate&&(u.items=r.find(u.delegate));t.open(u)}},updateStatus:function(n,r){if(t.preloader){it!==n&&t.container.removeClass("mfp-s-"+it);r||"loading"!==n||(r=t.st.tLoading);var u={status:n,text:r};i("UpdateStatus",u);n=u.status;r=u.text;t.preloader.html(r);t.preloader.find("a").on("click",function(n){n.stopImmediatePropagation()});t.container.addClass("mfp-s-"+n);it=n}},_checkIfClose:function(i){if(!n(i).hasClass(et)){var r=t.st.closeOnContentClick,u=t.st.closeOnBgClick;if(r&&u||!t.content||n(i).hasClass("mfp-close")||t.preloader&&i===t.preloader[0])return!0;if(i===t.content[0]||n.contains(t.content[0],i)){if(r)return!0}else if(u&&n.contains(document,i))return!0;return!1}},_addClassToMFP:function(n){t.bgOverlay.addClass(n);t.wrap.addClass(n)},_removeClassFromMFP:function(n){this.bgOverlay.removeClass(n);t.wrap.removeClass(n)},_hasScrollBar:function(n){return(t.isIE7?f.height():document.body.scrollHeight)>(n||h.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(i){if(i.target!==t.wrap[0]&&!n.contains(t.wrap[0],i.target))return(t._setFocus(),!1)},_parseMarkup:function(t,r,f){var e;f.data&&(r=n.extend(f.data,r));i(rt,[t,r,f]);n.each(r,function(i,r){var f,o;if(void 0===r||r===!1)return!0;(e=i.split("_"),e.length>1)?(f=t.find(u+"-"+e[0]),f.length>0&&(o=e[1],"replaceWith"===o?f[0]!==r[0]&&f.replaceWith(r):"img"===o?f.is("img")?f.attr("src",r):f.replaceWith(n("<img>").attr("src",r).attr("class",f.attr("class"))):f.attr(e[1],r))):t.find(u+"-"+i).html(r)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var n=document.createElement("div");n.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;";document.body.appendChild(n);t.scrollbarSize=n.offsetWidth-n.clientWidth;document.body.removeChild(n)}return t.scrollbarSize}};n.magnificPopup={instance:null,proto:b.prototype,modules:[],open:function(t,i){return ht(),t=t?n.extend(!0,{},t):{},t.isObj=!0,t.index=i||0,this.instance.open(t)},close:function(){return n.magnificPopup.instance&&n.magnificPopup.instance.close()},registerModule:function(t,i){i.options&&(n.magnificPopup.defaults[t]=i.options);n.extend(this.proto,i.proto);this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&#215;<\/button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}};n.fn.magnificPopup=function(i){var r,u,f,e;return ht(),r=n(this),"string"==typeof i?"open"===i?(f=ot?r.data("magnificPopup"):r[0].magnificPopup,e=parseInt(arguments[1],10)||0,f.items?u=f.items[e]:(u=r,f.delegate&&(u=u.find(f.delegate)),u=u.eq(e)),t._openClick({mfpEl:u},r,f)):t.isOpen&&t[i].apply(t,Array.prototype.slice.call(arguments,1)):(i=n.extend(!0,{},i),ot?r.data("magnificPopup",i):r[0].magnificPopup=i,t.addGroup(r,i)),r};g="inline";ct=function(){d&&(k.after(d.addClass(a)).detach(),d=null)};n.magnificPopup.registerModule(g,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(g);r(s+"."+g,function(){ct()})},getInline:function(i,r){var f,u,e;return(ct(),i.src)?(f=t.st.inline,u=n(i.src),u.length?(e=u[0].parentNode,e&&e.tagName&&(k||(a=f.hiddenClass,k=l(a),a="mfp-"+a),d=u.after(k).detach().removeClass(a)),t.updateStatus("ready")):(t.updateStatus("error",f.tNotFound),u=n("<div>")),i.inlineElement=u,u):(t.updateStatus("ready"),t._parseMarkup(r,{},i),r)}}});var v,y="ajax",lt=function(){v&&n(document.body).removeClass(v)},dt=function(){lt();t.req&&t.req.abort()};n.magnificPopup.registerModule(y,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content<\/a> could not be loaded.'},proto:{initAjax:function(){t.types.push(y);v=t.st.ajax.cursor;r(s+"."+y,dt);r("BeforeChange."+y,dt)},getAjax:function(r){v&&n(document.body).addClass(v);t.updateStatus("loading");var u=n.extend({url:r.src,success:function(u,f,e){var o={data:u,xhr:e};i("ParseAjax",o);t.appendContent(n(o.data),y);r.finished=!0;lt();t._setFocus();setTimeout(function(){t.wrap.addClass(w)},16);t.updateStatus("ready");i("AjaxContentAdded")},error:function(){lt();r.finished=r.loadError=!0;t.updateStatus("error",t.st.ajax.tError.replace("%url%",r.src))}},t.st.ajax.settings);return t.req=n.ajax(u),""}}});gt=function(i){if(i.data&&void 0!==i.data.title)return i.data.title;var r=t.st.image.titleSrc;if(r){if(n.isFunction(r))return r.call(t,i);if(i.el)return i.el.attr(r)||""}return""};n.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"><\/div><figure><div class="mfp-img"><\/div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"><\/div><div class="mfp-counter"><\/div><\/div><\/figcaption><\/figure><\/div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image<\/a> could not be loaded.'},proto:{initImage:function(){var i=t.st.image,f=".image";t.types.push("image");r(ut+f,function(){"image"===t.currItem.type&&i.cursor&&n(document.body).addClass(i.cursor)});r(s+f,function(){i.cursor&&n(document.body).removeClass(i.cursor);h.off("resize"+u)});r("Resize"+f,t.resizeImage);t.isLowIE&&r("AfterChange",t.resizeImage)},resizeImage:function(){var n=t.currItem,i;n&&n.img&&t.st.image.verticalFit&&(i=0,t.isLowIE&&(i=parseInt(n.img.css("padding-top"),10)+parseInt(n.img.css("padding-bottom"),10)),n.img.css("max-height",t.wH-i))},_onImageHasSize:function(n){n.img&&(n.hasSize=!0,e&&clearInterval(e),n.isCheckingImgSize=!1,i("ImageHasSize",n),n.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),n.imgHidden=!1))},findImageSize:function(n){var i=0,u=n.img[0],r=function(f){e&&clearInterval(e);e=setInterval(function(){return u.naturalWidth>0?void t._onImageHasSize(n):(i>200&&clearInterval(e),i++,void(3===i?r(10):40===i?r(50):100===i&&r(500)))},f)};r(1)},getImage:function(r,u){var o=0,s=function(){r&&(r.img[0].complete?(r.img.off(".mfploader"),r===t.currItem&&(t._onImageHasSize(r),t.updateStatus("ready")),r.hasSize=!0,r.loaded=!0,i("ImageLoadComplete")):(o++,200>o?setTimeout(s,100):h()))},h=function(){r&&(r.img.off(".mfploader"),r===t.currItem&&(t._onImageHasSize(r),t.updateStatus("error",c.tError.replace("%url%",r.src))),r.hasSize=!0,r.loaded=!0,r.loadError=!0)},c=t.st.image,l=u.find(".mfp-img"),f;return l.length&&(f=document.createElement("img"),f.className="mfp-img",r.el&&r.el.find("img").length&&(f.alt=r.el.find("img").attr("alt")),r.img=n(f).on("load.mfploader",s).on("error.mfploader",h),f.src=r.src,l.is("img")&&(r.img=r.img.clone()),f=r.img[0],f.naturalWidth>0?r.hasSize=!0:f.width||(r.hasSize=!1)),t._parseMarkup(u,{title:gt(r),img_replaceWith:r.img},r),t.resizeImage(),r.hasSize?(e&&clearInterval(e),r.loadError?(u.addClass("mfp-loading"),t.updateStatus("error",c.tError.replace("%url%",r.src))):(u.removeClass("mfp-loading"),t.updateStatus("ready")),u):(t.updateStatus("loading"),r.loading=!0,r.hasSize||(r.imgHidden=!0,u.addClass("mfp-loading"),t.findImageSize(r)),u)}}});ni=function(){return void 0===at&&(at=void 0!==document.createElement("p").style.MozTransform),at};n.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(n){return n.is("img")?n:n.find("img")}},proto:{initZoom:function(){var u,f=t.st.zoom,o=".zoom";if(f.enabled&&t.supportsTransition){var e,n,c=f.duration,l=function(n){var r=n.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),u="all "+f.duration/1e3+"s "+f.easing,t={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},i="transition";return t["-webkit-"+i]=t["-moz-"+i]=t["-o-"+i]=t[i]=u,r.css(t),r},h=function(){t.content.css("visibility","visible")};r("BuildControls"+o,function(){if(t._allowZoom()){if(clearTimeout(e),t.content.css("visibility","hidden"),u=t._getItemToZoom(),!u)return void h();n=l(u);n.css(t._getOffset());t.wrap.append(n);e=setTimeout(function(){n.css(t._getOffset(!0));e=setTimeout(function(){h();setTimeout(function(){n.remove();u=n=null;i("ZoomAnimationEnded")},16)},c)},16)}});r(wt+o,function(){if(t._allowZoom()){if(clearTimeout(e),t.st.removalDelay=c,!u){if(u=t._getItemToZoom(),!u)return;n=l(u)}n.css(t._getOffset(!0));t.wrap.append(n);t.content.css("visibility","hidden");setTimeout(function(){n.css(t._getOffset())},16)}});r(s+o,function(){t._allowZoom()&&(h(),n&&n.remove(),u=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return t.currItem.hasSize?t.currItem.img:!1},_getOffset:function(i){var r,u;r=i?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var f=r.offset(),e=parseInt(r.css("padding-top"),10),o=parseInt(r.css("padding-bottom"),10);return f.top-=n(window).scrollTop()-e,u={width:r.width(),height:(ot?r.innerHeight():r[0].offsetHeight)-o-e},ni()?u["-moz-transform"]=u.transform="translate("+f.left+"px,"+f.top+"px)":(u.left=f.left,u.top=f.top),u}}});var c="iframe",ui="//about:blank",vt=function(n){if(t.currTemplate[c]){var i=t.currTemplate[c].find("iframe");i.length&&(n||(i[0].src=ui),t.isIE8&&i.css("display",n?"block":"none"))}};n.magnificPopup.registerModule(c,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"><\/div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen><\/iframe><\/div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(c);r("BeforeChange",function(n,t,i){t!==i&&(t===c?vt():i===c&&vt(!0))});r(s+"."+c,function(){vt()})},getIframe:function(i,r){var u=i.src,f=t.st.iframe,e;return n.each(f.patterns,function(){if(u.indexOf(this.index)>-1)return(this.id&&(u="string"==typeof this.id?u.substr(u.lastIndexOf(this.id)+this.id.length,u.length):this.id.call(this,u)),u=this.src.replace("%id%",u),!1)}),e={},f.srcAction&&(e[f.srcAction]=u),t._parseMarkup(r,e,i),t.updateStatus("ready"),r}}});nt=function(n){var i=t.items.length;return n>i-1?n-i:0>n?i+n:n};yt=function(n,t,i){return n.replace(/%curr%/gi,t+1).replace(/%total%/gi,i)};n.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"><\/button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var u=t.st.gallery,i=".mfp-gallery";return t.direction=!0,u&&u.enabled?(o+=" mfp-gallery",r(ut+i,function(){u.navigateByImgClick&&t.wrap.on("click"+i,".mfp-img",function(){if(t.items.length>1)return(t.next(),!1)});f.on("keydown"+i,function(n){37===n.keyCode?t.prev():39===n.keyCode&&t.next()})}),r("UpdateStatus"+i,function(n,i){i.text&&(i.text=yt(i.text,t.currItem.index,t.items.length))}),r(rt+i,function(n,i,r,f){var e=t.items.length;r.counter=e>1?yt(u.tCounter,f.index,e):""}),r("BuildControls"+i,function(){if(t.items.length>1&&u.arrows&&!t.arrowLeft){var i=u.arrowMarkup,r=t.arrowLeft=n(i.replace(/%title%/gi,u.tPrev).replace(/%dir%/gi,"left")).addClass(et),f=t.arrowRight=n(i.replace(/%title%/gi,u.tNext).replace(/%dir%/gi,"right")).addClass(et);r.click(function(){t.prev()});f.click(function(){t.next()});t.container.append(r.add(f))}}),r(bt+i,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout);t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages();t._preloadTimeout=null},16)}),void r(s+i,function(){f.off(i);t.wrap.off("click"+i);t.arrowRight=t.arrowLeft=null})):!1},next:function(){t.direction=!0;t.index=nt(t.index+1);t.updateItemHTML()},prev:function(){t.direction=!1;t.index=nt(t.index-1);t.updateItemHTML()},goTo:function(n){t.direction=n>=t.index;t.index=n;t.updateItemHTML()},preloadNearbyImages:function(){for(var i=t.st.gallery.preload,r=Math.min(i[0],t.items.length),u=Math.min(i[1],t.items.length),n=1;n<=(t.direction?u:r);n++)t._preloadItem(t.index+n);for(n=1;n<=(t.direction?r:u);n++)t._preloadItem(t.index-n)},_preloadItem:function(r){if(r=nt(r),!t.items[r].preloaded){var u=t.items[r];u.parsed||(u=t.parseEl(r));i("LazyLoad",u);"image"===u.type&&(u.img=n('<img class="mfp-img" />').on("load.mfploader",function(){u.hasSize=!0}).on("error.mfploader",function(){u.hasSize=!0;u.loadError=!0;i("LazyLoadError",u)}).attr("src",u.src));u.preloaded=!0}}}});tt="retina";n.magnificPopup.registerModule(tt,{options:{replaceSrc:function(n){return n.src.replace(/\.\w+$/,function(n){return"@2x"+n})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var i=t.st.retina,n=i.ratio;n=isNaN(n)?n():n;n>1&&(r("ImageHasSize."+tt,function(t,i){i.img.css({"max-width":i.img[0].naturalWidth/n,width:"100%"})}),r("ElementParse."+tt,function(t,r){r.src=i.replaceSrc(r,n)}))}}}});ht()});!function(n){var t=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(n){return!n||/^\s*$/.test(n)},escapeRegExChars:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(n){return"string"==typeof n},isNumber:function(n){return"number"==typeof n},isArray:n.isArray,isFunction:n.isFunction,isObject:n.isPlainObject,isUndefined:function(n){return"undefined"==typeof n},toStr:function(n){return t.isUndefined(n)||null===n?"":n+""},bind:n.proxy,each:function(t,i){function r(n,t){return i(t,n)}n.each(t,r)},map:n.map,filter:n.grep,every:function(t,i){var r=!0;return t?(n.each(t,function(n,u){if(!(r=i.call(null,u,n,t)))return!1}),!!r):r},some:function(t,i){var r=!1;return t?(n.each(t,function(n,u){if((r=i.call(null,u,n,t)))return!1}),!!r):r},mixin:n.extend,getUniqueId:function(){var n=0;return function(){return n++}}(),templatify:function(t){function i(){return String(t)}return n.isFunction(t)?t:i},defer:function(n){setTimeout(n,0)},debounce:function(n,t,i){var r,u;return function(){var f,e,o=this,s=arguments;return f=function(){r=null;i||(u=n.apply(o,s))},e=i&&!r,clearTimeout(r),r=setTimeout(f,t),e&&(u=n.apply(o,s)),u}},throttle:function(n,t){var u,f,i,e,r,o;return r=0,o=function(){r=new Date;i=null;e=n.apply(u,f)},function(){var s=new Date,h=t-(s-r);return u=this,f=arguments,0>=h?(clearTimeout(i),i=null,r=s,e=n.apply(u,f)):i||(i=setTimeout(o,h)),e}},noop:function(){}}}(),l="0.10.5",a=function(){"use strict";function n(n){return n=t.toStr(n),n?n.split(/\s+/):[]}function i(n){return n=t.toStr(n),n?n.split(/\W+/):[]}function r(n){return function(){var i=[].slice.call(arguments,0);return function(r){var u=[];return t.each(i,function(i){u=u.concat(n(t.toStr(r[i])))}),u}}}return{nonword:i,whitespace:n,obj:{nonword:r(i),whitespace:r(n)}}}(),o=function(){"use strict";function i(i){this.maxSize=t.isNumber(i)?i:100;this.reset();this.maxSize<=0&&(this.set=this.get=n.noop)}function r(){this.head=this.tail=null}function u(n,t){this.key=n;this.val=t;this.prev=this.next=null}return t.mixin(i.prototype,{set:function(n,t){var i,r=this.list.tail;this.size>=this.maxSize&&(this.list.remove(r),delete this.hash[r.key]);(i=this.hash[n])?(i.val=t,this.list.moveToFront(i)):(i=new u(n,t),this.list.add(i),this.hash[n]=i,this.size++)},get:function(n){var t=this.hash[n];if(t)return(this.list.moveToFront(t),t.val)},reset:function(){this.size=0;this.hash={};this.list=new r}}),t.mixin(r.prototype,{add:function(n){this.head&&(n.next=this.head,this.head.prev=n);this.head=n;this.tail=this.tail||n},remove:function(n){n.prev?n.prev.next=n.next:this.head=n.next;n.next?n.next.prev=n.prev:this.tail=n.prev},moveToFront:function(n){this.remove(n);this.add(n)}}),i}(),v=function(){"use strict";function i(n){this.prefix=["__",n,"__"].join("");this.ttlKey="__ttl__";this.keyMatcher=new RegExp("^"+t.escapeRegExChars(this.prefix))}function r(){return(new Date).getTime()}function u(n){return JSON.stringify(t.isUndefined(n)?null:n)}function f(n){return JSON.parse(n)}var n,e;try{n=window.localStorage;n.setItem("~~~","!");n.removeItem("~~~")}catch(o){n=null}return e=n&&window.JSON?{_prefix:function(n){return this.prefix+n},_ttlKey:function(n){return this._prefix(n)+this.ttlKey},get:function(t){return this.isExpired(t)&&this.remove(t),f(n.getItem(this._prefix(t)))},set:function(i,f,e){return t.isNumber(e)?n.setItem(this._ttlKey(i),u(r()+e)):n.removeItem(this._ttlKey(i)),n.setItem(this._prefix(i),u(f))},remove:function(t){return n.removeItem(this._ttlKey(t)),n.removeItem(this._prefix(t)),this},clear:function(){for(var r,i=[],u=n.length,t=0;u>t;t++)(r=n.key(t)).match(this.keyMatcher)&&i.push(r.replace(this.keyMatcher,""));for(t=i.length;t--;)this.remove(i[t]);return this},isExpired:function(i){var u=f(n.getItem(this._ttlKey(i)));return t.isNumber(u)&&r()>u?!0:!1}}:{get:t.noop,set:t.noop,remove:t.noop,clear:t.noop,isExpired:t.noop},t.mixin(i.prototype,e),i}(),s=function(){"use strict";function i(t){t=t||{};this.cancelled=!1;this.lastUrl=null;this._send=t.transport?s(t.transport):n.ajax;this._get=t.rateLimiter?t.rateLimiter(this._get):this._get;this._cache=t.cache===!1?new o(0):e}function s(i){return function(r,u){function e(n){t.defer(function(){f.resolve(n)})}function o(n){t.defer(function(){f.reject(n)})}var f=n.Deferred();return i(r,u,e,o),f}}var r=0,u={},f=6,e=new o(10);return i.setMaxPendingRequests=function(n){f=n},i.resetCache=function(){e.reset()},t.mixin(i.prototype,{_get:function(n,t,i){function o(t){i&&i(null,t);e._cache.set(n,t)}function s(){i&&i(!0)}function c(){r--;delete u[n];e.onDeckRequestArgs&&(e._get.apply(e,e.onDeckRequestArgs),e.onDeckRequestArgs=null)}var h,e=this;this.cancelled||n!==this.lastUrl||((h=u[n])?h.done(o).fail(s):f>r?(r++,u[n]=this._send(n,t).done(o).fail(s).always(c)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(n,i,r){var u;return t.isFunction(i)&&(r=i,i={}),this.cancelled=!1,this.lastUrl=n,(u=this._cache.get(n))?t.defer(function(){r&&r(null,u)}):this._get(n,i,r),!!u},cancel:function(){this.cancelled=!0}}),i}(),y=function(){"use strict";function i(t){t=t||{};t.datumTokenizer&&t.queryTokenizer||n.error("datumTokenizer and queryTokenizer are both required");this.datumTokenizer=t.datumTokenizer;this.queryTokenizer=t.queryTokenizer;this.reset()}function r(n){return n=t.filter(n,function(n){return!!n}),n=t.map(n,function(n){return n.toLowerCase()})}function u(){return{ids:[],children:{}}}function f(n){for(var i={},r=[],t=0,u=n.length;u>t;t++)i[n[t]]||(i[n[t]]=!0,r.push(n[t]));return r}function e(n,t){function u(n,t){return n-t}var i=0,r=0,f=[],e,o;for(n=n.sort(u),t=t.sort(u),e=n.length,o=t.length;e>i&&o>r;)n[i]<t[r]?i++:n[i]>t[r]?r++:(f.push(n[i]),i++,r++);return f}return t.mixin(i.prototype,{bootstrap:function(n){this.datums=n.datums;this.trie=n.trie},add:function(n){var i=this;n=t.isArray(n)?n:[n];t.each(n,function(n){var f,e;f=i.datums.push(n)-1;e=r(i.datumTokenizer(n));t.each(e,function(n){for(var r,t=i.trie,e=n.split("");r=e.shift();)t=t.children[r]||(t.children[r]=u()),t.ids.push(f)})})},get:function(n){var u,i,o=this;return u=r(this.queryTokenizer(n)),t.each(u,function(n){var t,r,f,u;if(i&&0===i.length)return!1;for(t=o.trie,r=n.split("");t&&(f=r.shift());)t=t.children[f];return t&&0===r.length?(u=t.ids.slice(0),void(i=i?e(i,u):u)):(i=[],!1)}),i?t.map(f(i),function(n){return o.datums[n]}):[]},reset:function(){this.datums=[];this.trie=u()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),i}(),f=function(){"use strict";function i(n){return n.local||null}function r(i){var r,u;return u={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}},(r=i.prefetch||null)&&(r=t.isString(r)?{url:r}:r,r=t.mixin(u,r),r.thumbprint=l+r.thumbprint,r.ajax.type=r.ajax.type||"GET",r.ajax.dataType=r.ajax.dataType||"json",!r.url&&n.error("prefetch requires url to be set")),r}function u(i){function f(n){return function(i){return t.debounce(i,n)}}function e(n){return function(i){return t.throttle(i,n)}}var r,u;return u={url:null,cache:!0,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}},(r=i.remote||null)&&(r=t.isString(r)?{url:r}:r,r=t.mixin(u,r),r.rateLimiter=/^throttle$/i.test(r.rateLimitBy)?e(r.rateLimitWait):f(r.rateLimitWait),r.ajax.type=r.ajax.type||"GET",r.ajax.dataType=r.ajax.dataType||"json",delete r.rateLimitBy,delete r.rateLimitWait,!r.url&&n.error("remote requires url to be set")),r}return{local:i,prefetch:r,remote:u}}();!function(i){"use strict";function u(t){t&&(t.local||t.prefetch||t.remote)||n.error("one of local, prefetch, or remote is required");this.limit=t.limit||5;this.sorter=o(t.sorter);this.dupDetector=t.dupDetector||h;this.local=f.local(t);this.prefetch=f.prefetch(t);this.remote=f.remote(t);this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null;this.index=new y({datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer});this.storage=this.cacheKey?new v(this.cacheKey):null}function o(n){function i(t){return t.sort(n)}function r(n){return n}return t.isFunction(n)?i:r}function h(){return!1}var e,r;return e=i.Bloodhound,r={data:"data",protocol:"protocol",thumbprint:"thumbprint"},i.Bloodhound=u,u.noConflict=function(){return i.Bloodhound=e,u},u.tokenizers=a,t.mixin(u.prototype,{_loadPrefetch:function(t){function f(n){i.clear();i.add(t.filter?t.filter(n):n);i._saveToStorage(i.index.serialize(),t.thumbprint,t.ttl)}var u,r,i=this;return(u=this._readFromStorage(t.thumbprint))?(this.index.bootstrap(u),r=n.Deferred().resolve()):r=n.ajax(t.url,t.ajax).done(f),r},_getFromRemote:function(n,t){function f(n,i){t(n?[]:u.remote.filter?u.remote.filter(i):i)}var i,r,u=this;if(this.transport)return n=n||"",r=encodeURIComponent(n),i=this.remote.replace?this.remote.replace(this.remote.url,n):this.remote.url.replace(this.remote.wildcard,r),this.transport.get(i,this.remote.ajax,f)},_cancelLastRemoteRequest:function(){this.transport&&this.transport.cancel()},_saveToStorage:function(n,t,i){this.storage&&(this.storage.set(r.data,n,i),this.storage.set(r.protocol,location.protocol,i),this.storage.set(r.thumbprint,t,i))},_readFromStorage:function(n){var i,t={};return this.storage&&(t.data=this.storage.get(r.data),t.protocol=this.storage.get(r.protocol),t.thumbprint=this.storage.get(r.thumbprint)),i=t.thumbprint!==n||t.protocol!==location.protocol,t.data&&!i?t.data:null},_initialize:function(){function u(){f.add(t.isFunction(i)?i():i)}var r,f=this,i=this.local;return r=this.prefetch?this._loadPrefetch(this.prefetch):n.Deferred().resolve(),i&&r.done(u),this.transport=this.remote?new s(this.remote):null,this.initPromise=r.promise()},initialize:function(n){return!this.initPromise||n?this._initialize():this.initPromise},add:function(n){this.index.add(n)},get:function(n,i){function e(n){var f=r.slice(0);t.each(n,function(n){var i;return i=t.some(f,function(t){return u.dupDetector(n,t)}),!i&&f.push(n),f.length<u.limit});i&&i(u.sorter(f))}var u=this,r=[],f=!1;r=this.index.get(n);r=this.sorter(r).slice(0,this.limit);r.length<this.limit?f=this._getFromRemote(n,e):this._cancelLastRemoteRequest();f||(r.length>0||!this.transport)&&i&&i(r)},clear:function(){this.index.reset()},clearPrefetchCache:function(){this.storage&&this.storage.clear()},clearRemoteCache:function(){this.transport&&s.resetCache()},ttAdapter:function(){return t.bind(this.get,this)}}),u}(this);var r=function(){return{wrapper:'<span class="twitter-typeahead"><\/span>',dropdown:'<span class="tt-dropdown-menu"><\/span>',dataset:'<div class="tt-dataset-%CLASS%"><\/div>',suggestions:'<span class="tt-suggestions"><\/span>',suggestion:'<div class="tt-suggestion"><\/div>'}}(),i=function(){"use strict";var n={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return t.isMsie()&&t.mixin(n.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t.isMsie()&&t.isMsie()<=7&&t.mixin(n.input,{marginTop:"-1px"}),n}(),h=function(){"use strict";function i(t){t&&t.el||n.error("EventBus initialized without el");this.$el=n(t.el)}var r="typeahead:";return t.mixin(i.prototype,{trigger:function(n){var t=[].slice.call(arguments,1);this.$el.trigger(r+n,t)}}),i}(),e=function(){"use strict";function t(t,i,r,u){var f;if(!r)return this;for(i=i.split(n),r=u?s(r,u):r,this._callbacks=this._callbacks||{};f=i.shift();)this._callbacks[f]=this._callbacks[f]||{sync:[],async:[]},this._callbacks[f][t].push(r);return this}function r(n,i,r){return t.call(this,"async",n,i,r)}function u(n,i,r){return t.call(this,"sync",n,i,r)}function f(t){var i;if(!this._callbacks)return this;for(t=t.split(n);i=t.shift();)delete this._callbacks[i];return this}function e(t){var r,u,f,e,o;if(!this._callbacks)return this;for(t=t.split(n),f=[].slice.call(arguments,1);(r=t.shift())&&(u=this._callbacks[r]);)e=i(u.sync,this,[r].concat(f)),o=i(u.async,this,[r].concat(f)),e()&&h(o);return this}function i(n,t,i){function r(){for(var r,u=0,f=n.length;!r&&f>u;u+=1)r=n[u].apply(t,i)===!1;return!r}return r}function o(){return window.setImmediate?function(n){setImmediate(function(){n()})}:function(n){setTimeout(function(){n()},0)}}function s(n,t){return n.bind?n.bind(t):function(){n.apply(t,[].slice.call(arguments,0))}}var n=/\s+/,h=o();return{onSync:u,onAsync:r,off:f,trigger:e}}(),p=function(n){"use strict";function i(n,i,r){for(var u,f=[],e=0,o=n.length;o>e;e++)f.push(t.escapeRegExChars(n[e]));return u=r?"\\b("+f.join("|")+")\\b":"("+f.join("|")+")",i?new RegExp(u):new RegExp(u,"i")}var r={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(u){function o(t){var i,r,f;return(i=e.exec(t.data))&&(f=n.createElement(u.tagName),u.className&&(f.className=u.className),r=t.splitText(i.index),r.splitText(i[0].length),f.appendChild(r.cloneNode(!0)),t.parentNode.replaceChild(f,r)),!!i}function f(n,t){for(var i,r=0;r<n.childNodes.length;r++)i=n.childNodes[r],i.nodeType===3?r+=t(i)?1:0:f(i,t)}var e;u=t.mixin({},r,u);u.node&&u.pattern&&(u.pattern=t.isArray(u.pattern)?u.pattern:[u.pattern],e=i(u.pattern,u.caseSensitive,u.wordsOnly),f(u.node,o))}}(window.document),c=function(){"use strict";function i(i){var r,e,o,s,h=this;i=i||{};i.input||n.error("input is missing");r=t.bind(this._onBlur,this);e=t.bind(this._onFocus,this);o=t.bind(this._onKeydown,this);s=t.bind(this._onInput,this);this.$hint=n(i.hint);this.$input=n(i.input).on("blur.tt",r).on("focus.tt",e).on("keydown.tt",o);0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=t.noop);t.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(n){u[n.which||n.keyCode]||t.defer(t.bind(h._onInput,h,n))}):this.$input.on("input.tt",s);this.query=this.$input.val();this.$overflowHelper=f(this.$input)}function f(t){return n('<pre aria-hidden="true"><\/pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function o(n,t){return i.normalizeQuery(n)===i.normalizeQuery(t)}function r(n){return n.altKey||n.ctrlKey||n.metaKey||n.shiftKey}var u;return u={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},i.normalizeQuery=function(n){return(n||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},t.mixin(i.prototype,e,{_onBlur:function(){this.resetInputValue();this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(n){var t=u[n.which||n.keyCode];this._managePreventDefault(t,n);t&&this._shouldTrigger(t,n)&&this.trigger(t+"Keyed",n)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(n,t){var i,u,f;switch(n){case"tab":u=this.getHint();f=this.getInputValue();i=u&&u!==f&&!r(t);break;case"up":case"down":i=!r(t);break;default:i=!1}i&&t.preventDefault()},_shouldTrigger:function(n,t){var i;switch(n){case"tab":i=!r(t);break;default:i=!0}return i},_checkInputValue:function(){var n,t,i;n=this.getInputValue();t=o(n,this.query);i=t?this.query.length!==n.length:!1;this.query=n;t?i&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(n){this.query=n},getInputValue:function(){return this.$input.val()},setInputValue:function(n,t){this.$input.val(n);t?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(n){this.$hint.val(n)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var n,t,i,r;n=this.getInputValue();t=this.getHint();i=n!==t&&0===t.indexOf(n);r=""!==n&&i&&!this.hasOverflow();!r&&this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var n=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=n},isCursorAtEnd:function(){var n,i,r;return n=this.$input.val().length,i=this.$input[0].selectionStart,t.isNumber(i)?i===n:document.selection?(r=document.selection.createRange(),r.moveStart("character",-n),n===r.text.length):!0},destroy:function(){this.$hint.off(".tt");this.$input.off(".tt");this.$hint=this.$input=this.$overflowHelper=null}}),i}(),u=function(){"use strict";function u(i){i=i||{};i.templates=i.templates||{};i.source||n.error("missing source");i.name&&!l(i.name)&&n.error("invalid dataset name: "+i.name);this.query=null;this.highlight=!!i.highlight;this.name=i.name||t.getUniqueId();this.source=i.source;this.displayFn=h(i.display||i.displayKey);this.templates=c(i.templates,this.displayFn);this.$el=n(r.dataset.replace("%CLASS%",this.name))}function h(n){function i(t){return t[n]}return n=n||"value",t.isFunction(n)?n:i}function c(n,i){function r(n){return"<p>"+i(n)+"<\/p>"}return{empty:n.empty&&t.templatify(n.empty),header:n.header&&t.templatify(n.header),footer:n.footer&&t.templatify(n.footer),suggestion:n.suggestion||r}}function l(n){return/^[_a-zA-Z0-9-]+$/.test(n)}var f="ttDataset",o="ttValue",s="ttDatum";return u.extractDatasetName=function(t){return n(t).data(f)},u.extractValue=function(t){return n(t).data(o)},u.extractDatum=function(t){return n(t).data(s)},t.mixin(u.prototype,e,{_render:function(u,e){function v(){return h.templates.empty({query:u,isEmpty:!0})}function y(){function a(t){var u;return u=n(r.suggestion).append(h.templates.suggestion(t)).data(f,h.name).data(o,h.displayFn(t)).data(s,t),u.children().each(function(){n(this).css(i.suggestionChild)}),u}var c,l;return c=n(r.suggestions).css(i.suggestions),l=t.map(e,a),c.append.apply(c,l),h.highlight&&p({className:"tt-highlight",node:c[0],pattern:u}),c}function l(){return h.templates.header({query:u,isEmpty:!c})}function a(){return h.templates.footer({query:u,isEmpty:!c})}if(this.$el){var c,h=this;this.$el.empty();c=e&&e.length;!c&&this.templates.empty?this.$el.html(v()).prepend(h.templates.header?l():null).append(h.templates.footer?a():null):c&&this.$el.html(y()).prepend(h.templates.header?l():null).append(h.templates.footer?a():null);this.trigger("rendered")}},getRoot:function(){return this.$el},update:function(n){function i(i){t.canceled||n!==t.query||t._render(n,i)}var t=this;this.query=n;this.canceled=!1;this.source(n,i)},cancel:function(){this.canceled=!0},clear:function(){this.cancel();this.$el.empty();this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),u}(),w=function(){"use strict";function r(i){var u,e,o,r=this;i=i||{};i.menu||n.error("menu is required");this.isOpen=!1;this.isEmpty=!0;this.datasets=t.map(i.datasets,f);u=t.bind(this._onSuggestionClick,this);e=t.bind(this._onSuggestionMouseEnter,this);o=t.bind(this._onSuggestionMouseLeave,this);this.$menu=n(i.menu).on("click.tt",".tt-suggestion",u).on("mouseenter.tt",".tt-suggestion",e).on("mouseleave.tt",".tt-suggestion",o);t.each(this.datasets,function(n){r.$menu.append(n.getRoot());n.onSync("rendered",r._onRendered,r)})}function f(n){return new u(n)}return t.mixin(r.prototype,e,{_onSuggestionClick:function(t){this.trigger("suggestionClicked",n(t.currentTarget))},_onSuggestionMouseEnter:function(t){this._removeCursor();this._setCursor(n(t.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){function n(n){return n.isEmpty()}this.isEmpty=t.every(this.datasets,n);this.isEmpty?this._hide():this.isOpen&&this._show();this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function(n,t){n.first().addClass("tt-cursor");t||this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(n){var i,r,t,u;if(this.isOpen){if(r=this._getCursor(),i=this._getSuggestions(),this._removeCursor(),t=i.index(r)+n,t=(t+1)%(i.length+1)-1,-1===t)return void this.trigger("cursorRemoved");-1>t&&(t=i.length-1);this._setCursor(u=i.eq(t));this._ensureVisible(u)}},_ensureVisible:function(n){var t,i,r,u;t=n.position().top;i=t+n.outerHeight(!0);r=this.$menu.scrollTop();u=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10);0>t?this.$menu.scrollTop(r+t):i>u&&this.$menu.scrollTop(r+(i-u))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(n){this.$menu.css("ltr"===n?i.ltr:i.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(n){var t=null;return n.length&&(t={raw:u.extractDatum(n),value:u.extractValue(n),datasetName:u.extractDatasetName(n)}),t},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(n){function i(t){t.update(n)}t.each(this.datasets,i)},empty:function(){function n(n){n.clear()}t.each(this.datasets,n);this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){function n(n){n.destroy()}this.$menu.off(".tt");this.$menu=null;t.each(this.datasets,n)}}),r}(),b=function(){"use strict";function f(i){var r,u,f;i=i||{};i.input||n.error("missing input");this.isActivated=!1;this.autoselect=!!i.autoselect;this.minLength=t.isNumber(i.minLength)?i.minLength:1;this.$node=e(i.input,i.withHint);r=this.$node.find(".tt-dropdown-menu");u=this.$node.find(".tt-input");f=this.$node.find(".tt-hint");u.on("blur.tt",function(n){var i,f,e;i=document.activeElement;f=r.is(i);e=r.has(i).length>0;t.isMsie()&&(f||e)&&(n.preventDefault(),n.stopImmediatePropagation(),t.defer(function(){u.focus()}))});r.on("mousedown.tt",function(n){n.preventDefault()});this.eventBus=i.eventBus||new h({el:u});this.dropdown=new w({menu:r,datasets:i.datasets}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this);this.input=new c({input:u,hint:f}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this);this._setLanguageDirection()}function e(t,f){var e,h,c,s;e=n(t);h=n(r.wrapper).css(i.wrapper);c=n(r.dropdown).css(i.dropdown);s=e.clone().css(i.hint).css(o(e));s.val("").removeData().addClass("tt-hint").removeAttr("id name placeholder required").prop("readonly",!0).attr({autocomplete:"off",spellcheck:"false",tabindex:-1});e.data(u,{dir:e.attr("dir"),autocomplete:e.attr("autocomplete"),spellcheck:e.attr("spellcheck"),style:e.attr("style")});e.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(f?i.input:i.inputWithNoHint);try{e.attr("dir")||e.attr("dir","auto")}catch(l){}return e.wrap(h).parent().prepend(f?s:null).append(c)}function o(n){return{backgroundAttachment:n.css("background-attachment"),backgroundClip:n.css("background-clip"),backgroundColor:n.css("background-color"),backgroundImage:n.css("background-image"),backgroundOrigin:n.css("background-origin"),backgroundPosition:n.css("background-position"),backgroundRepeat:n.css("background-repeat"),backgroundSize:n.css("background-size")}}function s(n){var i=n.find(".tt-input");t.each(i.data(u),function(n,r){t.isUndefined(n)?i.removeAttr(r):i.attr(r,n)});i.detach().removeData(u).removeClass("tt-input").insertAfter(n);n.remove()}var u="ttAttrs";return t.mixin(f.prototype,{_onSuggestionClicked:function(n,t){var i;(i=this.dropdown.getDatumForSuggestion(t))&&this._select(i)},_onCursorMoved:function(){var n=this.dropdown.getDatumForCursor();this.input.setInputValue(n.value,!0);this.eventBus.trigger("cursorchanged",n.raw,n.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue();this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint();this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint();this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0;this.dropdown.open()},_onBlurred:function(){this.isActivated=!1;this.dropdown.empty();this.dropdown.close()},_onEnterKeyed:function(n,t){var i,r;i=this.dropdown.getDatumForCursor();r=this.dropdown.getDatumForTopSuggestion();i?(this._select(i),t.preventDefault()):this.autoselect&&r&&(this._select(r),t.preventDefault())},_onTabKeyed:function(n,t){var i;(i=this.dropdown.getDatumForCursor())?(this._select(i),t.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close();this.input.resetInputValue()},_onUpKeyed:function(){var n=this.input.getQuery();this.dropdown.isEmpty&&n.length>=this.minLength?this.dropdown.update(n):this.dropdown.moveCursorUp();this.dropdown.open()},_onDownKeyed:function(){var n=this.input.getQuery();this.dropdown.isEmpty&&n.length>=this.minLength?this.dropdown.update(n):this.dropdown.moveCursorDown();this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(n,t){this.input.clearHintIfInvalid();t.length>=this.minLength?this.dropdown.update(t):this.dropdown.empty();this.dropdown.open();this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint();this.dropdown.open()},_setLanguageDirection:function(){var n;this.dir!==(n=this.input.getLanguageDirection())&&(this.dir=n,this.$node.css("direction",n),this.dropdown.setLanguageDirection(n))},_updateHint:function(){var n,i,u,f,e,r;n=this.dropdown.getDatumForTopSuggestion();n&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(i=this.input.getInputValue(),u=c.normalizeQuery(i),f=t.escapeRegExChars(u),e=new RegExp("^(?:"+f+")(.+$)","i"),r=e.exec(n.value),r?this.input.setHint(i+r[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(n){var i,r,u,t;i=this.input.getHint();r=this.input.getQuery();u=n||this.input.isCursorAtEnd();i&&r!==i&&u&&(t=this.dropdown.getDatumForTopSuggestion(),t&&this.input.setInputValue(t.value),this.eventBus.trigger("autocompleted",t.raw,t.datasetName))},_select:function(n){this.input.setQuery(n.value);this.input.setInputValue(n.value,!0);this._setLanguageDirection();this.eventBus.trigger("selected",n.raw,n.datasetName);this.dropdown.close();t.defer(t.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(n){n=t.toStr(n);this.isActivated?this.input.setInputValue(n):(this.input.setQuery(n),this.input.setInputValue(n,!0));this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy();this.dropdown.destroy();s(this.$node);this.$node=null}}),f}();!function(){"use strict";var u,i,r;u=n.fn.typeahead;i="ttTypeahead";r={initialize:function(r,u){function f(){var o,e,f=n(this);t.each(u,function(n){n.highlight=!!r.highlight});e=new b({input:f,eventBus:o=new h({el:f}),withHint:t.isUndefined(r.hint)?!0:!!r.hint,minLength:r.minLength,autoselect:r.autoselect,datasets:u});f.data(i,e)}return u=t.isArray(u)?u:[].slice.call(arguments,1),r=r||{},this.each(f)},open:function(){function t(){var t,r=n(this);(t=r.data(i))&&t.open()}return this.each(t)},close:function(){function t(){var t,r=n(this);(t=r.data(i))&&t.close()}return this.each(t)},val:function(t){function r(){var r,u=n(this);(r=u.data(i))&&r.setVal(t)}function u(n){var t,r;return(t=n.data(i))&&(r=t.getVal()),r}return arguments.length?this.each(r):u(this.first())},destroy:function(){function t(){var t,r=n(this);(t=r.data(i))&&(t.destroy(),r.removeData(i))}return this.each(t)}};n.fn.typeahead=function(t){var u;return r[t]&&"initialize"!==t?(u=this.filter(function(){return!!n(this).data(i)}),r[t].apply(u,[].slice.call(arguments,1))):r.initialize.apply(this,arguments)};n.fn.typeahead.noConflict=function(){return n.fn.typeahead=u,this}}()}(window.jQuery);(function(t){function i(){var n=Error.apply(this,arguments);n.name=this.name="FlashError";this.stack=n.stack;this.message=n.message}function r(){var n=Error.apply(this,arguments);n.name=this.name="WebcamError";this.stack=n.stack;this.message=n.message}var f,e=function(){},u;e.prototype=Error.prototype;i.prototype=new e;r.prototype=new e;u={version:"1.0.25",protocol:location.protocol.match(/https/i)?"https":"http",loaded:!1,live:!1,userMedia:!0,iOS:/iPad|iPhone|iPod/.test(navigator.userAgent)&&!t.MSStream,params:{width:0,height:0,dest_width:0,dest_height:0,image_format:"jpeg",jpeg_quality:90,enable_flash:!0,force_flash:!1,flip_horiz:!1,fps:30,upload_name:"webcam",constraints:null,swfURL:"",flashNotDetectedText:"ERROR: No Adobe Flash Player detected.  Webcam.js relies on Flash for browsers that do not support getUserMedia (like yours).",noInterfaceFoundText:"No supported webcam interface found.",unfreeze_snap:!0,iosPlaceholderText:"Click here to open camera.",user_callback:null,user_canvas:null},errors:{FlashError:i,WebcamError:r},hooks:{},init:function(){var n=this;this.mediaDevices=navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices:navigator.mozGetUserMedia||navigator.webkitGetUserMedia?{getUserMedia:function(n){return new Promise(function(t,i){(navigator.mozGetUserMedia||navigator.webkitGetUserMedia).call(navigator,n,t,i)})}}:null;t.URL=t.URL||t.webkitURL||t.mozURL||t.msURL;this.userMedia=this.userMedia&&!!this.mediaDevices&&!!t.URL;this.iOS&&(this.userMedia=null);navigator.userAgent.match(/Firefox\D+(\d+)/)&&parseInt(RegExp.$1,10)<21&&(this.userMedia=null);this.userMedia&&t.addEventListener("beforeunload",function(){n.reset()})},exifOrientation:function(t){var i=new DataView(t),r,s,h,u,c,l,y,o,f,a,v,e;if(i.getUint8(0)!=255||i.getUint8(1)!=216)return console.log("Not a valid JPEG file"),0;for(r=2,s=null;r<t.byteLength;){if(i.getUint8(r)!=255)return console.log("Not a valid marker at offset "+r+", found: "+i.getUint8(r)),0;if(s=i.getUint8(r+1),s==225){for(r+=4,h="",n=0;n<4;n++)h+=String.fromCharCode(i.getUint8(r+n));if(h!="Exif")return console.log("Not valid EXIF data found"),0;if(r+=6,u=null,i.getUint16(r)==18761)u=!1;else if(i.getUint16(r)==19789)u=!0;else return console.log("Not valid TIFF data! (no 0x4949 or 0x4D4D)"),0;if(i.getUint16(r+2,!u)!=42)return console.log("Not valid TIFF data! (no 0x002A)"),0;if(c=i.getUint32(r+4,!u),c<8)return console.log("Not valid TIFF data! (First offset less than 8)",i.getUint32(r+4,!u)),0;for(l=r+c,y=i.getUint16(l,!u),o=0;o<y;o++)if(f=l+o*12+2,i.getUint16(f,!u)==274)return(a=i.getUint16(f+2,!u),v=i.getUint32(f+4,!u),a!=3&&v!=1)?(console.log("Invalid EXIF orientation value type ("+a+") or count ("+v+")"),0):(e=i.getUint16(f+8,!u),e<1||e>8)?(console.log("Invalid EXIF orientation value ("+e+")"),0):e}else r+=2+i.getUint16(r+2)}return 0},fixOrientation:function(n,t,i){var r=new Image;r.addEventListener("load",function(){var u=document.createElement("canvas"),n=u.getContext("2d");t<5?(u.width=r.width,u.height=r.height):(u.width=r.height,u.height=r.width);switch(t){case 2:n.transform(-1,0,0,1,r.width,0);break;case 3:n.transform(-1,0,0,-1,r.width,r.height);break;case 4:n.transform(1,0,0,-1,0,r.height);break;case 5:n.transform(0,1,1,0,0,0);break;case 6:n.transform(0,1,-1,0,r.height,0);break;case 7:n.transform(0,-1,-1,0,r.height,r.width);break;case 8:n.transform(0,-1,1,0,0,r.width)}n.drawImage(r,0,0);i.src=u.toDataURL()},!1);r.src=n},attach:function(n){var y,c,l,i,v,a,s,o,h,e,p,w;if(typeof n=="string"&&(n=document.getElementById(n)||document.querySelector(n)),!n)return this.dispatch("error",new r("Could not locate DOM element to attach to."));if(this.container=n,n.innerHTML="",y=document.createElement("div"),n.appendChild(y),this.peg=y,this.params.width||(this.params.width=n.offsetWidth),this.params.height||(this.params.height=n.offsetHeight),!this.params.width||!this.params.height)return this.dispatch("error",new r("No width and/or height for webcam.  Please call set() first, or attach to a visible element."));this.params.dest_width||(this.params.dest_width=this.params.width);this.params.dest_height||(this.params.dest_height=this.params.height);this.userMedia=f===undefined?this.userMedia:f;this.params.force_flash&&(f=this.userMedia,this.userMedia=null);typeof this.params.fps!="number"&&(this.params.fps=30);c=this.params.width/this.params.dest_width;l=this.params.height/this.params.dest_height;this.userMedia?(i=document.createElement("video"),i.setAttribute("autoplay","autoplay"),i.style.width=""+this.params.dest_width+"px",i.style.height=""+this.params.dest_height+"px",(c!=1||l!=1)&&(n.style.overflow="hidden",i.style.webkitTransformOrigin="0px 0px",i.style.mozTransformOrigin="0px 0px",i.style.msTransformOrigin="0px 0px",i.style.oTransformOrigin="0px 0px",i.style.transformOrigin="0px 0px",i.style.webkitTransform="scaleX("+c+") scaleY("+l+")",i.style.mozTransform="scaleX("+c+") scaleY("+l+")",i.style.msTransform="scaleX("+c+") scaleY("+l+")",i.style.oTransform="scaleX("+c+") scaleY("+l+")",i.style.transform="scaleX("+c+") scaleY("+l+")"),n.appendChild(i),this.video=i,o=this,this.mediaDevices.getUserMedia({audio:!1,video:this.params.constraints||{mandatory:{minWidth:this.params.dest_width,minHeight:this.params.dest_height}}}).then(function(n){i.onloadedmetadata=function(){o.stream=n;o.loaded=!0;o.live=!0;o.dispatch("load");o.dispatch("live");o.flip()};"srcObject"in i?i.srcObject=n:i.src=t.URL.createObjectURL(n)}).catch(function(t){o.params.enable_flash&&o.detectFlash()?setTimeout(function(){o.params.force_flash=1;o.attach(n)},1):o.dispatch("error",t)})):this.iOS?(e=document.createElement("div"),e.id=this.container.id+"-ios_div",e.className="webcamjs-ios-placeholder",e.style.width=""+this.params.width+"px",e.style.height=""+this.params.height+"px",e.style.textAlign="center",e.style.display="table-cell",e.style.verticalAlign="middle",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="contain",e.style.backgroundPosition="center",v=document.createElement("span"),v.className="webcamjs-ios-text",v.innerHTML=this.params.iosPlaceholderText,e.appendChild(v),a=document.createElement("img"),a.id=this.container.id+"-ios_img",a.style.width=""+this.params.dest_width+"px",a.style.height=""+this.params.dest_height+"px",a.style.display="none",e.appendChild(a),s=document.createElement("input"),s.id=this.container.id+"-ios_input",s.setAttribute("type","file"),s.setAttribute("accept","image/*"),s.setAttribute("capture","camera"),o=this,h=this.params,s.addEventListener("change",function(n){var r,t,u,i;n.target.files.length>0&&n.target.files[0].type.indexOf("image/")==0&&(r=URL.createObjectURL(n.target.files[0]),t=new Image,t.addEventListener("load",function(){var n=document.createElement("canvas"),r,i;n.width=h.dest_width;n.height=h.dest_height;r=n.getContext("2d");ratio=Math.min(t.width/h.dest_width,t.height/h.dest_height);var u=h.dest_width*ratio,f=h.dest_height*ratio,o=(t.width-u)/2,s=(t.height-f)/2;r.drawImage(t,o,s,u,f,0,0,h.dest_width,h.dest_height);i=n.toDataURL();a.src=i;e.style.backgroundImage="url('"+i+"')"},!1),u=new FileReader,u.addEventListener("load",function(n){var i=o.exifOrientation(n.target.result);i>1?o.fixOrientation(r,i,t):t.src=r},!1),i=new XMLHttpRequest,i.open("GET",r,!0),i.responseType="blob",i.onload=function(){(this.status==200||this.status===0)&&u.readAsArrayBuffer(this.response)},i.send())},!1),s.style.display="none",n.appendChild(s),e.addEventListener("click",function(){h.user_callback?o.snap(h.user_callback,h.user_canvas):(s.style.display="block",s.focus(),s.click(),s.style.display="none")},!1),n.appendChild(e),this.loaded=!0,this.live=!0):this.params.enable_flash&&this.detectFlash()?(t.Webcam=u,e=document.createElement("div"),e.innerHTML=this.getSWFHTML(),n.appendChild(e)):this.dispatch("error",new r(this.params.noInterfaceFoundText));this.params.crop_width&&this.params.crop_height?(p=Math.floor(this.params.crop_width*c),w=Math.floor(this.params.crop_height*l),n.style.width=""+p+"px",n.style.height=""+w+"px",n.style.overflow="hidden",n.scrollLeft=Math.floor(this.params.width/2-p/2),n.scrollTop=Math.floor(this.params.height/2-w/2)):(n.style.width=""+this.params.width+"px",n.style.height=""+this.params.height+"px")},reset:function(){var n,t;this.preview_active&&this.unfreeze();this.unflip();this.userMedia&&(this.stream&&(this.stream.getVideoTracks?(n=this.stream.getVideoTracks(),n&&n[0]&&n[0].stop&&n[0].stop()):this.stream.stop&&this.stream.stop()),delete this.stream,delete this.video);this.userMedia!==!0&&this.loaded&&!this.iOS&&(t=this.getMovie(),t&&t._releaseCamera&&t._releaseCamera());this.container&&(this.container.innerHTML="",delete this.container);this.loaded=!1;this.live=!1},set:function(){if(arguments.length==1)for(var n in arguments[0])this.params[n]=arguments[0][n];else this.params[arguments[0]]=arguments[1]},on:function(n,t){n=n.replace(/^on/i,"").toLowerCase();this.hooks[n]||(this.hooks[n]=[]);this.hooks[n].push(t)},off:function(n,t){if(n=n.replace(/^on/i,"").toLowerCase(),this.hooks[n])if(t){var i=this.hooks[n].indexOf(t);i>-1&&this.hooks[n].splice(i,1)}else this.hooks[n]=[]},dispatch:function(){var f=arguments[0].replace(/^on/i,"").toLowerCase(),u=Array.prototype.slice.call(arguments,1),e,o,n,s;if(this.hooks[f]&&this.hooks[f].length){for(e=0,o=this.hooks[f].length;e<o;e++)n=this.hooks[f][e],typeof n=="function"?n.apply(this,u):typeof n=="object"&&n.length==2?n[0][n[1]].apply(n[0],u):t[n]&&t[n].apply(t,u);return!0}return f=="error"&&(s=u[0]instanceof i||u[0]instanceof r?u[0].message:"Could not access webcam: "+u[0].name+": "+u[0].message+" "+u[0].toString(),alert("Webcam.js Error: "+s)),!1},setSWFLocation:function(n){this.set("swfURL",n)},detectFlash:function(){var u="Shockwave Flash",f="application/x-shockwave-flash",s=t,n=navigator,i=!1,e,r,o;if(typeof n.plugins!="undefined"&&typeof n.plugins[u]=="object")e=n.plugins[u].description,e&&typeof n.mimeTypes!="undefined"&&n.mimeTypes[f]&&n.mimeTypes[f].enabledPlugin&&(i=!0);else if(typeof s.ActiveXObject!="undefined")try{r=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");r&&(o=r.GetVariable("$version"),o&&(i=!0))}catch(h){}return i},getSWFHTML:function(){var u=this.params.swfURL,f,o,r,s,e,n,h;if(location.protocol.match(/file/))return this.dispatch("error",new i("Flash does not work from local disk.  Please run from a web server.")),'<h3 style="color:red">ERROR: the Webcam.js Flash fallback does not work from local disk.  Please run it from a web server.<\/h3>';if(!this.detectFlash())return this.dispatch("error",new i("Adobe Flash Player not found.  Please install from get.adobe.com/flashplayer and try again.")),'<h3 style="color:red">'+this.params.flashNotDetectedText+"<\/h3>";if(!u){for(f="",o=document.getElementsByTagName("script"),r=0,s=o.length;r<s;r++)e=o[r].getAttribute("src"),e&&e.match(/\/webcam(\.min)?\.js/)&&(f=e.replace(/\/webcam(\.min)?\.js.*$/,""),r=s);u=f?f+"/webcam.swf":"webcam.swf"}t.localStorage&&!localStorage.getItem("visited")&&(this.params.new_user=1,localStorage.setItem("visited",1));n="";for(h in this.params)n&&(n+="&"),n+=h+"="+escape(this.params[h]);return""+('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" type="application/x-shockwave-flash" codebase="'+this.protocol+'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+this.params.width+'" height="'+this.params.height+'" id="webcam_movie_obj" align="middle"><param name="wmode" value="opaque" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+u+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+n+'"/><embed id="webcam_movie_embed" src="'+u+'" wmode="opaque" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+this.params.width+'" height="'+this.params.height+'" name="webcam_movie_embed" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+n+'"><\/embed><\/object>')},getMovie:function(){if(!this.loaded)return this.dispatch("error",new i("Flash Movie is not loaded yet"));var n=document.getElementById("webcam_movie_obj");return n&&n._snap||(n=document.getElementById("webcam_movie_embed")),n||this.dispatch("error",new i("Cannot locate Flash movie in DOM")),n},freeze:function(){var r=this,u=this.params,t,i,f;this.preview_active&&this.unfreeze();t=this.params.width/this.params.dest_width;i=this.params.height/this.params.dest_height;this.unflip();var e=u.crop_width||u.dest_width,o=u.crop_height||u.dest_height,n=document.createElement("canvas");n.width=e;n.height=o;f=n.getContext("2d");this.preview_canvas=n;this.preview_context=f;(t!=1||i!=1)&&(n.style.webkitTransformOrigin="0px 0px",n.style.mozTransformOrigin="0px 0px",n.style.msTransformOrigin="0px 0px",n.style.oTransformOrigin="0px 0px",n.style.transformOrigin="0px 0px",n.style.webkitTransform="scaleX("+t+") scaleY("+i+")",n.style.mozTransform="scaleX("+t+") scaleY("+i+")",n.style.msTransform="scaleX("+t+") scaleY("+i+")",n.style.oTransform="scaleX("+t+") scaleY("+i+")",n.style.transform="scaleX("+t+") scaleY("+i+")");this.snap(function(){n.style.position="relative";n.style.left=""+r.container.scrollLeft+"px";n.style.top=""+r.container.scrollTop+"px";r.container.insertBefore(n,r.peg);r.container.style.overflow="hidden";r.preview_active=!0},n)},unfreeze:function(){this.preview_active&&(this.container.removeChild(this.preview_canvas),delete this.preview_context,delete this.preview_canvas,this.preview_active=!1,this.flip())},flip:function(){if(this.params.flip_horiz){var n=this.container.style;n.webkitTransform="scaleX(-1)";n.mozTransform="scaleX(-1)";n.msTransform="scaleX(-1)";n.oTransform="scaleX(-1)";n.transform="scaleX(-1)";n.filter="FlipH";n.msFilter="FlipH"}},unflip:function(){if(this.params.flip_horiz){var n=this.container.style;n.webkitTransform="scaleX(1)";n.mozTransform="scaleX(1)";n.msTransform="scaleX(1)";n.oTransform="scaleX(1)";n.transform="scaleX(1)";n.filter="";n.msFilter=""}},savePreview:function(n,t){var r=this.params,i=this.preview_canvas,f=this.preview_context,u;t&&(u=t.getContext("2d"),u.drawImage(i,0,0));n(t?null:i.toDataURL("image/"+r.image_format,r.jpeg_quality/100),i,f);this.params.unfreeze_snap&&this.unfreeze()},snap:function(n,t){var c,i,u,e,s,h,f;if(n||(n=this.params.user_callback),t||(t=this.params.user_canvas),c=this,i=this.params,!this.loaded)return this.dispatch("error",new r("Webcam is not loaded yet"));if(!n)return this.dispatch("error",new r("Please provide a callback function or canvas to snap()"));if(this.preview_active)return this.savePreview(n,t),null;if(u=document.createElement("canvas"),u.width=this.params.dest_width,u.height=this.params.dest_height,e=u.getContext("2d"),this.params.flip_horiz&&(e.translate(i.dest_width,0),e.scale(-1,1)),s=function(){var r,f,o;this.src&&this.width&&this.height&&e.drawImage(this,0,0,i.dest_width,i.dest_height);i.crop_width&&i.crop_height&&(r=document.createElement("canvas"),r.width=i.crop_width,r.height=i.crop_height,f=r.getContext("2d"),f.drawImage(u,Math.floor(i.dest_width/2-i.crop_width/2),Math.floor(i.dest_height/2-i.crop_height/2),i.crop_width,i.crop_height,0,0,i.crop_width,i.crop_height),e=f,u=r);t&&(o=t.getContext("2d"),o.drawImage(u,0,0));n(t?null:u.toDataURL("image/"+i.image_format,i.jpeg_quality/100),u,e)},this.userMedia)e.drawImage(this.video,0,0,this.params.dest_width,this.params.dest_height),s();else if(this.iOS){var l=document.getElementById(this.container.id+"-ios_div"),f=document.getElementById(this.container.id+"-ios_img"),o=document.getElementById(this.container.id+"-ios_input");iFunc=function(){s.call(f);f.removeEventListener("load",iFunc);l.style.backgroundImage="none";f.removeAttribute("src");o.value=null};o.value?iFunc(null):(f.addEventListener("load",iFunc),o.style.display="block",o.focus(),o.click(),o.style.display="none")}else h=this.getMovie()._snap(),f=new Image,f.onload=s,f.src="data:image/"+this.params.image_format+";base64,"+h;return null},configure:function(n){n||(n="camera");this.getMovie()._configure(n)},flashNotify:function(n,t){switch(n){case"flashLoadComplete":this.loaded=!0;this.dispatch("load");break;case"cameraLive":this.live=!0;this.dispatch("live");break;case"error":this.dispatch("error",new i(t))}},b64ToUint6:function(n){return n>64&&n<91?n-65:n>96&&n<123?n-71:n>47&&n<58?n+4:n===43?62:n===47?63:0},base64DecToArr:function(n,t){for(var s=n.replace(/[^A-Za-z0-9\+\/]/g,""),r=s.length,h=t?Math.ceil((r*3+1>>2)/t)*t:r*3+1>>2,c=new Uint8Array(h),u,f,e=0,o=0,i=0;i<r;i++)if(f=i&3,e|=this.b64ToUint6(s.charCodeAt(i))<<18-6*f,f===3||r-i==1){for(u=0;u<3&&o<h;u++,o++)c[o]=e>>>(16>>>u&24)&255;e=0}return c},upload:function(n,t,i){var o=this.params.upload_name||"webcam",f="",s,r,h,c,e;if(n.match(/^data\:image\/(\w+)/))f=RegExp.$1;else throw"Cannot locate image format in Data URI";s=n.replace(/^data\:image\/\w+\;base64\,/,"");r=new XMLHttpRequest;r.open("POST",t,!0);r.upload&&r.upload.addEventListener&&r.upload.addEventListener("progress",function(n){if(n.lengthComputable){var t=n.loaded/n.total;u.dispatch("uploadProgress",t,n)}},!1);h=this;r.onload=function(){i&&i.apply(h,[r.status,r.responseText,r.statusText]);u.dispatch("uploadComplete",r.status,r.responseText,r.statusText)};c=new Blob([this.base64DecToArr(s)],{type:"image/"+f});e=new FormData;e.append(o,c,o+"."+f.replace(/e/,""));r.send(e)}};u.init();typeof define=="function"&&define.amd?define(function(){return u}):typeof module=="object"&&module.exports?module.exports=u:t.Webcam=u})(window);(function(){function u(n){return!!n.exifdata}function v(n,t){var i;t=t||n.match(/^data\:([^\;]+)\;base64,/mi)[1]||"";n=n.replace(/^data\:([^\;]+)\;base64,/gmi,"");var r=atob(n),u=r.length,f=new ArrayBuffer(u),e=new Uint8Array(f);for(i=0;i<u;i++)e[i]=r.charCodeAt(i);return f}function y(n,t){var i=new XMLHttpRequest;i.open("GET",n,!0);i.responseType="blob";i.onload=function(){(this.status==200||this.status===0)&&t(this.response)};i.send()}function p(n,t){function f(i){var r=s(i),u=w(i);n.exifdata=r||{};n.iptcdata=u||{};t&&t.call(n)}var e,u,r;n.src?/^data\:/i.test(n.src)?(e=v(n.src),f(e)):/^blob\:/i.test(n.src)?(r=new FileReader,r.onload=function(n){f(n.target.result)},y(n.src,function(n){r.readAsArrayBuffer(n)})):(u=new XMLHttpRequest,u.onload=function(){if(this.status==200||this.status===0)f(u.response);else throw"Could not load image";u=null},u.open("GET",n.src,!0),u.responseType="arraybuffer",u.send(null)):window.FileReader&&(n instanceof window.Blob||n instanceof window.File)&&(r=new FileReader,r.onload=function(n){i&&console.log("Got file of length "+n.target.result.byteLength);f(n.target.result)},r.readAsArrayBuffer(n))}function s(n){var r=new DataView(n),t,f,u;if(i&&console.log("Got file of length "+n.byteLength),r.getUint8(0)!=255||r.getUint8(1)!=216)return i&&console.log("Not a valid JPEG"),!1;for(t=2,f=n.byteLength;t<f;){if(r.getUint8(t)!=255)return i&&console.log("Not a valid marker at offset "+t+", found: "+r.getUint8(t)),!1;if(u=r.getUint8(t+1),i&&console.log(u),u==225)return i&&console.log("Found 0xFFE1 marker"),d(r,t+4,r.getUint16(t+2)-2);t+=2+r.getUint16(t+2)}}function w(n){var u=new DataView(n),t,f,e;if(i&&console.log("Got file of length "+n.byteLength),u.getUint8(0)!=255||u.getUint8(1)!=216)return i&&console.log("Not a valid JPEG"),!1;for(var r=2,o=n.byteLength,s=function(n,t){return n.getUint8(t)===56&&n.getUint8(t+1)===66&&n.getUint8(t+2)===73&&n.getUint8(t+3)===77&&n.getUint8(t+4)===4&&n.getUint8(t+5)===4};r<o;){if(s(u,r))return t=u.getUint8(r+7),t%2!=0&&(t+=1),t===0&&(t=4),f=r+8+t,e=u.getUint16(r+6+t),b(n,f,e);r++}}function b(n,t,i){for(var s=new DataView(n),r={},h,u,c,l,a,o=t;o<t+i;)s.getUint8(o)===28&&s.getUint8(o+1)===2&&(l=s.getUint8(o+2),l in e&&(c=s.getInt16(o+3),a=c+5,u=e[l],h=f(s,o+5,c),r.hasOwnProperty(u)?r[u]instanceof Array?r[u].push(h):r[u]=[r[u],h]:r[u]=h)),o++;return r}function o(n,t,r,u,f){for(var c=n.getUint16(r,!f),h={},e,s,o=0;o<c;o++)e=r+o*12+2,s=u[n.getUint16(e,!f)],!s&&i&&console.log("Unknown tag: "+n.getUint16(e,!f)),h[s]=k(n,e,t,r,f);return h}function k(n,t,i,r,u){var y=n.getUint16(t+2,!u),s=n.getUint32(t+4,!u),h=n.getUint32(t+8,!u)+i,c,o,v,e,l,a;switch(y){case 1:case 7:if(s==1)return n.getUint8(t+8,!u);for(c=s>4?h:t+8,o=[],e=0;e<s;e++)o[e]=n.getUint8(c+e);return o;case 2:return c=s>4?h:t+8,f(n,c,s-1);case 3:if(s==1)return n.getUint16(t+8,!u);for(c=s>2?h:t+8,o=[],e=0;e<s;e++)o[e]=n.getUint16(c+2*e,!u);return o;case 4:if(s==1)return n.getUint32(t+8,!u);for(o=[],e=0;e<s;e++)o[e]=n.getUint32(h+4*e,!u);return o;case 5:if(s==1)return l=n.getUint32(h,!u),a=n.getUint32(h+4,!u),v=new Number(l/a),v.numerator=l,v.denominator=a,v;for(o=[],e=0;e<s;e++)l=n.getUint32(h+8*e,!u),a=n.getUint32(h+4+8*e,!u),o[e]=new Number(l/a),o[e].numerator=l,o[e].denominator=a;return o;case 9:if(s==1)return n.getInt32(t+8,!u);for(o=[],e=0;e<s;e++)o[e]=n.getInt32(h+4*e,!u);return o;case 10:if(s==1)return n.getInt32(h,!u)/n.getInt32(h+4,!u);for(o=[],e=0;e<s;e++)o[e]=n.getInt32(h+8*e,!u)/n.getInt32(h+4+8*e,!u);return o}}function f(t,i,r){var u="";for(n=i;n<i+r;n++)u+=String.fromCharCode(t.getUint8(n));return u}function d(n,t){var h,v,u,e,y,s,p;if(f(n,t,4)!="Exif")return i&&console.log("Not valid EXIF data! "+f(n,t,4)),!1;if(s=t+6,n.getUint16(s)==18761)h=!1;else if(n.getUint16(s)==19789)h=!0;else return i&&console.log("Not valid TIFF data! (no 0x4949 or 0x4D4D)"),!1;if(n.getUint16(s+2,!h)!=42)return i&&console.log("Not valid TIFF data! (no 0x002A)"),!1;if(p=n.getUint32(s+4,!h),p<8)return i&&console.log("Not valid TIFF data! (First offset less than 8)",n.getUint32(s+4,!h)),!1;if(v=o(n,s,s+p,l,h),v.ExifIFDPointer){e=o(n,s,s+v.ExifIFDPointer,c,h);for(u in e){switch(u){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":e[u]=r[u][e[u]];break;case"ExifVersion":case"FlashpixVersion":e[u]=String.fromCharCode(e[u][0],e[u][1],e[u][2],e[u][3]);break;case"ComponentsConfiguration":e[u]=r.Components[e[u][0]]+r.Components[e[u][1]]+r.Components[e[u][2]]+r.Components[e[u][3]]}v[u]=e[u]}}if(v.GPSInfoIFDPointer){y=o(n,s,s+v.GPSInfoIFDPointer,a,h);for(u in y){switch(u){case"GPSVersionID":y[u]=y[u][0]+"."+y[u][1]+"."+y[u][2]+"."+y[u][3]}v[u]=y[u]}}return v}var i=!1,h=this,t=function(n){if(n instanceof t)return n;if(!(this instanceof t))return new t(n);this.EXIFwrapped=n},e;typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=t),exports.EXIF=t):h.EXIF=t;var c=t.Tags={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRation",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",40965:"InteroperabilityIFDPointer",42016:"ImageUniqueID"},l=t.TiffTags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"},a=t.GPSTags={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential"},r=t.StringValues={ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},Components:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}};e={120:"caption",110:"credit",25:"keywords",55:"dateCreated",80:"byline",85:"bylineTitle",122:"captionWriter",105:"headline",116:"copyright",15:"category"};t.getData=function(n,t){return(n instanceof Image||n instanceof HTMLImageElement)&&!n.complete?!1:(u(n)?t&&t.call(n):p(n,t),!0)};t.getTag=function(n,t){if(u(n))return n.exifdata[t]};t.getAllTags=function(n){if(!u(n))return{};var t,i=n.exifdata,r={};for(t in i)i.hasOwnProperty(t)&&(r[t]=i[t]);return r};t.pretty=function(n){if(!u(n))return"";var t,i=n.exifdata,r="";for(t in i)i.hasOwnProperty(t)&&(r+=typeof i[t]=="object"?i[t]instanceof Number?t+" : "+i[t]+" ["+i[t].numerator+"/"+i[t].denominator+"]\r\n":t+" : ["+i[t].length+" values]\r\n":t+" : "+i[t]+"\r\n");return r};t.readFromBinaryFile=function(n){return s(n)};typeof define=="function"&&define.amd&&define("exif-js",[],function(){return t})}).call(this);(function(n){n.Jcrop=function(t,i){function h(n){return Math.round(n)+"px"}function ft(n){return r.baseClass+"-"+n}function bi(){return n.fx.step.hasOwnProperty("backgroundColor")}function et(t){var i=n(t).offset();return[i.left,i.top]}function nt(n){return[n.pageX-b[0],n.pageY-b[1]]}function ri(t){typeof t!="object"&&(t={});r=n.extend(r,t);n.each(["onChange","onSelect","onRelease","onDblClick"],function(n,t){typeof r[t]!="function"&&(r[t]=function(){})})}function ui(n,t,i){if(b=et(e),p.setCursor(n==="move"?n:n+"-resize"),n==="move")return p.activateHandlers(di(t),pt,i);var u=s.getFixed(),r=fi(n),f=s.getCorner(fi(r));s.setPressed(s.getCorner(r));s.setCurrent(f);p.activateHandlers(ki(n,u),pt,i)}function ki(n,t){return function(i){if(r.aspectRatio)switch(n){case"e":i[1]=t.y+1;break;case"w":i[1]=t.y+1;break;case"n":i[0]=t.x+1;break;case"s":i[0]=t.x+1}else switch(n){case"e":i[1]=t.y2;break;case"w":i[1]=t.y2;break;case"n":i[0]=t.x2;break;case"s":i[0]=t.x2}s.setCurrent(i);u.update()}}function di(n){var t=n;return kt.watchKeys(),function(n){s.moveOffset([n[0]-t[0],n[1]-t[1]]);t=n;u.update()}}function fi(n){switch(n){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function ei(n){return function(t){return r.disabled?!1:n==="move"&&!r.allowMove?!1:(b=et(e),ut=!0,ui(n,nt(t)),t.stopPropagation(),t.preventDefault(),!1)}}function oi(n,t,i){var r=n.width(),u=n.height();r>t&&t>0&&(r=t,u=t/n.width()*n.height());u>i&&i>0&&(u=i,r=i/n.height()*n.width());l=n.width()/r;a=n.height()/u;n.width(r).height(u)}function ot(n){return{x:n.x*l,y:n.y*a,x2:n.x2*l,y2:n.y2*a,w:n.w*l,h:n.h*a}}function pt(){var n=s.getFixed();n.w>r.minSelect[0]&&n.h>r.minSelect[1]?(u.enableHandles(),u.done()):u.release();p.setCursor(r.allowSelect?"crosshair":"default")}function si(n){if(r.disabled||!r.allowSelect)return!1;ut=!0;b=et(e);u.disableHandles();p.setCursor("crosshair");var t=nt(n);return s.setPressed(t),u.update(),p.activateHandlers(gi,pt,n.type.substring(0,5)==="touch"),kt.watchKeys(),n.stopPropagation(),n.preventDefault(),!1}function gi(n){s.setCurrent(n);u.update()}function hi(){var t=n("<div><\/div>").addClass(ft("tracker"));return ti&&t.css({opacity:0,backgroundColor:"white"}),t}function nr(n){w.removeClass().addClass(ft("holder")).addClass(n)}function tr(n,t){function b(){window.setTimeout(k,d)}var c=n[0]/l,y=n[1]/a,p=n[2]/l,w=n[3]/a,k;if(!bt){var o=s.flipCoords(c,y,p,w),h=s.getFixed(),e=[h.x,h.y,h.x2,h.y2],i=e,d=r.animationDelay,g=o[0]-e[0],nt=o[1]-e[1],tt=o[2]-e[2],it=o[3]-e[3],f=0,rt=r.swingSpeed;c=i[0];y=i[1];p=i[2];w=i[3];u.animMode(!0);k=function(){return function(){f+=(100-f)/rt;i[0]=Math.round(c+f/100*g);i[1]=Math.round(y+f/100*nt);i[2]=Math.round(p+f/100*tt);i[3]=Math.round(w+f/100*it);f>=99.8&&(f=100);f<100?(yi(i),b()):(u.done(),u.animMode(!1),typeof t=="function"&&t.call(v))}}();b()}}function vi(n){yi([n[0]/l,n[1]/a,n[2]/l,n[3]/a]);r.onSelect.call(v,ot(s.getFixed()));u.enableHandles()}function yi(n){s.setPressed([n[0],n[1]]);s.setCurrent([n[2],n[3]]);u.update()}function ir(){return ot(s.getFixed())}function rr(){return s.getFixed()}function ur(n){ri(n);gt()}function pi(){r.disabled=!0;u.disableHandles();u.setCursor("default");p.setCursor("default")}function wi(){r.disabled=!1;gt()}function fr(){u.done();p.activateHandlers(null,null)}function er(){w.remove();c.show();c.css("visibility","visible");n(t).removeData("Jcrop")}function or(n,t){u.release();pi();var i=new Image;i.onload=function(){var u=i.width,s=i.height,h,c;typeof atob!="undefined"&&EXIF.getData(i,function(){myData=this;myData.exifdata.Orientation===8?(u=i.height,s=i.width):myData.exifdata.Orientation===6&&(u=i.height,s=i.width)});h=r.boxWidth;c=r.boxHeight;e.width(u).height(s);e.attr("src",n);k.attr("src",n);oi(e,h,c);o=e.width();f=e.height();k.width(o).height(f);d.width(o+rt*2).height(f+rt*2);w.width(o).height(f);g.resize(o,f);wi();typeof t=="function"&&t.call(v)};i.src=n}function dt(n,t,i){var u=t||r.bgColor;r.bgFade&&bi()&&r.fadeTime&&!i?n.animate({backgroundColor:u},{queue:!1,duration:r.fadeTime}):n.css("backgroundColor",u)}function gt(n){r.allowResize?n?u.enableOnly():u.enableHandles():u.disableHandles();p.setCursor(r.allowSelect?"crosshair":"default");u.setCursor(r.allowMove?"move":"default");r.hasOwnProperty("trueSize")&&(l=r.trueSize[0]/o,a=r.trueSize[1]/f);r.hasOwnProperty("setSelect")&&(vi(r.setSelect),u.done(),delete r.setSelect);g.refresh();r.bgColor!=li&&(dt(r.shade?g.getShades():w,r.shade?r.shadeColor||r.bgColor:r.bgColor),li=r.bgColor);st!=r.bgOpacity&&(st=r.bgOpacity,r.shade?g.refresh():u.setBgOpacity(st));ht=r.maxSize[0]||0;ct=r.maxSize[1]||0;lt=r.minSize[0]||0;at=r.minSize[1]||0;r.hasOwnProperty("outerImage")&&(e.attr("src",r.outerImage),delete r.outerImage);u.refresh()}var r=n.extend({},n.Jcrop.defaults),b,ni=navigator.userAgent.toLowerCase(),ti=/msie/.test(ni),ii=/msie [1-6]\./.test(ni),vt,e,v;typeof t!="object"&&(t=n(t)[0]);typeof i!="object"&&(i={});ri(i);var wt={border:"none",visibility:"visible",margin:0,padding:0,position:"absolute",top:0,left:0},c=n(t),ci=!0;t.tagName=="IMG"?(c[0].width!=0&&c[0].height!=0?(c.width(c[0].width),c.height(c[0].height)):(vt=new Image,vt.src=c[0].src,c.width(vt.width),c.height(vt.height)),e=c.clone().removeAttr("id").css(wt).show(),e.width(c.width()),e.height(c.height()),c.after(e).hide()):(e=c.css(wt).show(),ci=!1,r.shade===null&&(r.shade=!0));oi(e,r.boxWidth,r.boxHeight);var o=e.width(),f=e.height(),w=n("<div />").width(o).height(f).addClass(ft("holder")).css({position:"relative",backgroundColor:r.bgColor}).insertAfter(c).append(e);r.addClass&&w.addClass(r.addClass);var k=n("<div />"),yt=n("<div />").width("100%").height("100%").css({zIndex:310,position:"absolute",overflow:"hidden"}),tt=n("<div />").width("100%").height("100%").css("zIndex",320),it=n("<div />").css({position:"absolute",zIndex:600}).dblclick(function(){var n=s.getFixed();r.onDblClick.call(v,n)}).insertBefore(e).append(yt,tt);ci&&(k=n("<img />").attr("src",e.attr("src")).css(wt).width(o).height(f),yt.append(k));ii&&it.css({overflowY:"hidden"});var rt=r.boundary,d=hi().width(o+rt*2).height(f+rt*2).css({position:"absolute",top:h(-rt),left:h(-rt),zIndex:290}).mousedown(si),li=r.bgColor,st=r.bgOpacity,ht,ct,lt,at,l,a,ut,bt,ai;b=et(e);var y=function(){function n(){var i={},u=["touchstart","touchmove","touchend"],f=document.createElement("div"),t,n,r;try{for(t=0;t<u.length;t++)n=u[t],n="on"+n,r=n in f,r||(f.setAttribute(n,"return;"),r=typeof f[n]=="function"),i[u[t]]=r;return i.touchstart&&i.touchend&&i.touchmove}catch(e){return!1}}function t(){return r.touchSupport===!0||r.touchSupport===!1?r.touchSupport:n()}return{createDragger:function(n){return function(t){return r.disabled?!1:n==="move"&&!r.allowMove?!1:(b=et(e),ut=!0,ui(n,nt(y.cfilter(t)),!0),t.stopPropagation(),t.preventDefault(),!1)}},newSelection:function(n){return si(y.cfilter(n))},cfilter:function(n){return n.pageX=n.originalEvent.changedTouches[0].pageX,n.pageY=n.originalEvent.changedTouches[0].pageY,n},isSupported:n,support:t()}}(),s=function(){function p(r){r=v(r);u=n=r[0];i=t=r[1]}function w(n){n=v(n);s=n[0]-u;h=n[1]-i;u=n[0];i=n[1]}function b(){return[s,h]}function k(r){var e=r[0],s=r[1];0>n+e&&(e-=e+n);0>t+s&&(s-=s+t);f<i+s&&(s+=f-(i+s));o<u+e&&(e+=o-(u+e));n+=e;u+=e;t+=s;i+=s}function d(n){var t=c();switch(n){case"ne":return[t.x2,t.y];case"nw":return[t.x,t.y];case"se":return[t.x2,t.y2];case"sw":return[t.x,t.y2]}}function c(){if(!r.aspectRatio)return g();var c=r.aspectRatio,b=r.minSize[0]/l,w=r.maxSize[0]/l,nt=r.maxSize[1]/a,k=u-n,d=i-t,tt=Math.abs(k),it=Math.abs(d),rt=tt/it,s,h,v,p;return w===0&&(w=o*10),nt===0&&(nt=f*10),rt<c?(h=i,v=it*c,s=k<0?n-v:v+n,s<0?(s=0,p=Math.abs((s-n)/c),h=d<0?t-p:p+t):s>o&&(s=o,p=Math.abs((s-n)/c),h=d<0?t-p:p+t)):(s=u,p=tt/c,h=d<0?t-p:t+p,h<0?(h=0,v=Math.abs((h-t)*c),s=k<0?n-v:v+n):h>f&&(h=f,v=Math.abs(h-t)*c,s=k<0?n-v:v+n)),s>n?(s-n<b?s=n+b:s-n>w&&(s=n+w),h=h>t?t+(s-n)/c:t-(s-n)/c):s<n&&(n-s<b?s=n-b:n-s>w&&(s=n-w),h=h>t?t+(n-s)/c:t-(n-s)/c),s<0?(n-=s,s=0):s>o&&(n-=s-o,s=o),h<0?(t-=h,h=0):h>f&&(t-=h-f,h=f),y(e(n,t,s,h))}function v(n){return n[0]<0&&(n[0]=0),n[1]<0&&(n[1]=0),n[0]>o&&(n[0]=o),n[1]>f&&(n[1]=f),[Math.round(n[0]),Math.round(n[1])]}function e(n,t,i,r){var u=n,f=i,e=t,o=r;return i<n&&(u=i,f=n),r<t&&(e=r,o=t),[u,e,f,o]}function g(){var s=u-n,h=i-t,r;return ht&&Math.abs(s)>ht&&(u=s>0?n+ht:n-ht),ct&&Math.abs(h)>ct&&(i=h>0?t+ct:t-ct),at/a&&Math.abs(h)<at/a&&(i=h>0?t+at/a:t-at/a),lt/l&&Math.abs(s)<lt/l&&(u=s>0?n+lt/l:n-lt/l),n<0&&(u-=n,n-=n),t<0&&(i-=t,t-=t),u<0&&(n-=u,u-=u),i<0&&(t-=i,i-=i),u>o&&(r=u-o,n-=r,u-=r),i>f&&(r=i-f,t-=r,i-=r),n>o&&(r=n-f,i-=r,t-=r),t>f&&(r=t-f,i-=r,t-=r),y(e(n,t,u,i))}function y(n){return{x:n[0],y:n[1],x2:n[2],y2:n[3],w:n[2]-n[0],h:n[3]-n[1]}}var n=0,t=0,u=0,i=0,s,h;return{flipCoords:e,setPressed:p,setCurrent:w,getOffset:b,moveOffset:k,getCorner:d,getFixed:c}}(),g=function(){function nt(n,t){i.left.css({height:h(t)});i.right.css({height:h(t)})}function v(){return y(s.getFixed())}function y(n){i.top.css({left:h(n.x),width:h(n.w),height:h(n.y)});i.bottom.css({top:h(n.y2),left:h(n.x),width:h(n.w),height:h(f-n.y2)});i.right.css({left:h(n.x2),width:h(o-n.x2)});i.left.css({width:h(n.x)})}function l(){return n("<div />").css({position:"absolute",backgroundColor:r.shadeColor||r.bgColor}).appendTo(t)}function p(){c||(c=!0,t.insertBefore(e),v(),u.setBgOpacity(1,0,1),k.hide(),b(r.shadeColor||r.bgColor,1),u.isAwake()?a(r.bgOpacity,1):a(1,1))}function b(n,t){dt(g(),n,t)}function d(){c&&(t.remove(),k.show(),c=!1,u.isAwake()?u.setBgOpacity(r.bgOpacity,1,1):(u.setBgOpacity(1,1,1),u.disableHandles()),dt(w,0,1))}function a(n,i){c&&(r.bgFade&&!i?t.animate({opacity:1-n},{queue:!1,duration:r.fadeTime}):t.css({opacity:1-n}))}function tt(){r.shade?p():d();u.isAwake()&&a(r.bgOpacity)}function g(){return t.children()}var c=!1,t=n("<div />").css({position:"absolute",zIndex:240,opacity:0}),i={top:l(),left:l().height(f),right:l().height(f),bottom:l()};return{update:v,updateRaw:y,getShades:g,setBgColor:b,enable:p,disable:d,resize:nt,refresh:tt,opacity:a}}(),u=function(){function et(t){var i=n("<div />").css({position:"absolute",opacity:r.borderOpacity}).addClass(ft(t));return yt.append(i),i}function l(t,i){var r=n("<div />").mousedown(ei(t)).css({cursor:t+"-resize",position:"absolute",zIndex:i}).addClass("ord-"+t);return y.support&&r.bind("touchstart.jcrop",y.createDragger(t)),tt.append(r),r}function ht(n){var t=r.handleSize,i=l(n,c++).css({}).addClass(ft("handle"));return t&&i.width(t).height(t),i}function ct(n){return l(n,c++).addClass("jcrop-dragbar")}function lt(n){for(var t=0;t<n.length;t++)ut[n[t]]=ct(n[t])}function at(n){for(var t,i=0;i<n.length;i++){switch(n[i]){case"n":t="hline";break;case"s":t="hline bottom";break;case"e":t="vline right";break;case"w":t="vline"}nt[n[i]]=et(t)}}function vt(n){for(var t=0;t<n.length;t++)rt[n[t]]=ht(n[t])}function pt(n,t){r.shade||k.css({top:h(-t),left:h(-n)});it.css({top:h(t),left:h(n)})}function wt(n,t){it.width(Math.round(n)).height(Math.round(t))}function a(){var n=s.getFixed();s.setPressed([n.x,n.y]);s.setCurrent([n.x2,n.y2]);p()}function p(n){if(t)return w(n)}function w(n){var i=s.getFixed();wt(i.w,i.h);pt(i.x,i.y);r.shade&&g.updateRaw(i);t||kt();n?r.onSelect.call(v,ot(i)):r.onChange.call(v,ot(i))}function o(n,i,u){(t||i)&&(r.bgFade&&!u?e.animate({opacity:n},{queue:!1,duration:r.fadeTime}):e.css("opacity",n))}function kt(){it.show();r.shade?g.opacity(st):o(st,!0);t=!0}function dt(){u();it.hide();r.shade?g.opacity(1):o(1);t=!1;r.onRelease.call(v)}function gt(){i&&tt.show()}function b(){return i=!0,r.allowResize?(tt.show(),!0):void 0}function u(){i=!1;tt.hide()}function d(n){n?(bt=!0,u()):(bt=!1,b())}function ni(){d(!1);a()}var t,c=370,nt={},rt={},ut={},i=!1,f;return r.dragEdges&&n.isArray(r.createDragbars)&&lt(r.createDragbars),n.isArray(r.createHandles)&&vt(r.createHandles),r.drawBorders&&n.isArray(r.createBorders)&&at(r.createBorders),n(document).bind("touchstart.jcrop-ios",function(t){n(t.currentTarget).hasClass("jcrop-tracker")&&t.stopPropagation()}),f=hi().mousedown(ei("move")).css({cursor:"move",position:"absolute",zIndex:360}),y.support&&f.bind("touchstart.jcrop",y.createDragger("move")),yt.append(f),u(),{updateVisible:p,update:w,release:dt,refresh:a,isAwake:function(){return t},setCursor:function(n){f.css("cursor",n)},enableHandles:b,enableOnly:function(){i=!0},showHandles:gt,disableHandles:u,animMode:d,setBgOpacity:o,done:ni}}(),p=function(){function c(t){d.css({zIndex:450});t?n(document).bind("touchmove.jcrop",p).bind("touchend.jcrop",w):o&&n(document).bind("mousemove.jcrop",h).bind("mouseup.jcrop",i)}function l(){d.css({zIndex:290});n(document).unbind(".jcrop")}function h(n){return t(nt(n)),!1}function i(n){return n.preventDefault(),n.stopPropagation(),ut&&(ut=!1,f(nt(n)),u.isAwake()&&r.onSelect.call(v,ot(s.getFixed())),l(),t=function(){},f=function(){}),!1}function a(n,i,r){return ut=!0,t=n,f=i,c(r),!1}function p(n){return t(nt(y.cfilter(n))),!1}function w(n){return i(y.cfilter(n))}function b(n){d.css("cursor",n)}var t=function(){},f=function(){},o=r.trackDocument;return o||d.mousemove(h).mouseup(i).mouseout(i),e.before(d),{activateHandlers:a,setCursor:b}}(),kt=function(){function o(){r.keySupport&&(t.show(),t.focus())}function h(){t.hide()}function i(n,t,i){r.allowMove&&(s.moveOffset([t,i]),u.updateVisible(!0));n.preventDefault();n.stopPropagation()}function c(n){if(n.ctrlKey||n.metaKey)return!0;ai=n.shiftKey?!0:!1;var t=ai?10:1;switch(n.keyCode){case 37:i(n,-t,0);break;case 39:i(n,t,0);break;case 38:i(n,0,-t);break;case 40:i(n,0,t);break;case 27:r.allowSelect&&u.release();break;case 9:return!0}return!1}var t=n('<input type="radio" />').css({position:"fixed",left:"-120px",width:"12px"}).addClass("jcrop-keymgr"),f=n("<div />").css({position:"absolute",overflow:"hidden"}).append(t);return r.keySupport&&(t.keydown(c).blur(h),ii||!r.fixedSupport?(t.css({position:"absolute",left:"-20px"}),f.append(t).insertBefore(e)):t.insertBefore(e)),{watchKeys:o}}();return y.support&&d.bind("touchstart.jcrop",y.newSelection),tt.hide(),gt(!0),v={setImage:or,animateTo:tr,setSelect:vi,setOptions:ur,tellSelect:ir,tellScaled:rr,setClass:nr,disable:pi,enable:wi,cancel:fr,release:u.release,destroy:er,focus:kt.watchKeys,getBounds:function(){return[o*l,f*a]},getWidgetSize:function(){return[o,f]},getScaleFactor:function(){return[l,a]},getOptions:function(){return r},ui:{holder:w,selection:it}},ti&&w.bind("selectstart",function(){return!1}),c.data("Jcrop",v),v};n.fn.Jcrop=function(t,i){var r;return this.each(function(){if(n(this).data("Jcrop")){if(t==="api")return n(this).data("Jcrop");n(this).data("Jcrop").setOptions(t)}else this.tagName=="IMG"?n.Jcrop.Loader(this,function(){n(this).css({display:"block",visibility:"hidden"});r=n.Jcrop(this,t);n.isFunction(i)&&i.call(r)}):(n(this).css({display:"block",visibility:"hidden"}),r=n.Jcrop(this,t),n.isFunction(i)&&i.call(r))}),this};n.Jcrop.Loader=function(t,i,r){function e(){f.complete?(u.unbind(".jcloader"),n.isFunction(i)&&i.call(f)):window.setTimeout(e,50)}var u=n(t),f=u[0];u.bind("load.jcloader",e).bind("error.jcloader",function(){u.unbind(".jcloader");n.isFunction(r)&&r.call(f)});f.complete&&n.isFunction(i)&&(u.unbind(".jcloader"),i.call(f))};n.Jcrop.defaults={allowSelect:!0,allowMove:!0,allowResize:!0,trackDocument:!0,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:.6,bgFade:!1,borderOpacity:.4,handleOpacity:.5,handleSize:null,aspectRatio:0,keySupport:!0,createHandles:["n","s","e","w","nw","ne","se","sw"],createDragbars:["n","s","e","w"],createBorders:["n","s","e","w"],drawBorders:!0,dragEdges:!0,fixedSupport:!0,touchSupport:null,shade:null,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}}})(jQuery);(function(n){var u=/iPhone/i,s=/iPod/i,h=/iPad/i,f=/(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,c=/Android/i,i=/(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i,r=/(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i,l=/IEMobile/i,a=/(?=.*\bWindows\b)(?=.*\bARM\b)/i,v=/BlackBerry/i,y=/BB10/i,p=/Opera Mini/i,w=/(CriOS|Chrome)(?=.*\bMobile\b)/i,b=/(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,k=new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)","i"),t=function(n,t){return n.test(t)},e=function(n){var e=n||navigator.userAgent,o=e.split("[FBAN");return typeof o[1]!="undefined"&&(e=o[0]),o=e.split("Twitter"),typeof o[1]!="undefined"&&(e=o[0]),this.apple={phone:t(u,e),ipod:t(s,e),tablet:!t(u,e)&&t(h,e),device:t(u,e)||t(s,e)||t(h,e)},this.amazon={phone:t(i,e),tablet:!t(i,e)&&t(r,e),device:t(i,e)||t(r,e)},this.android={phone:t(i,e)||t(f,e),tablet:!t(i,e)&&!t(f,e)&&(t(r,e)||t(c,e)),device:t(i,e)||t(r,e)||t(f,e)||t(c,e)},this.windows={phone:t(l,e),tablet:t(a,e),device:t(l,e)||t(a,e)},this.other={blackberry:t(v,e),blackberry10:t(y,e),opera:t(p,e),firefox:t(b,e),chrome:t(w,e),device:t(v,e)||t(y,e)||t(p,e)||t(b,e)||t(w,e)},this.seven_inch=t(k,e),this.any=this.apple.device||this.android.device||this.windows.device||this.other.device||this.seven_inch,this.phone=this.apple.phone||this.android.phone||this.windows.phone,this.tablet=this.apple.tablet||this.android.tablet||this.windows.tablet,typeof window=="undefined"?this:void 0},o=function(){var n=new e;return n.Class=e,n};typeof module!="undefined"&&module.exports&&typeof window=="undefined"?module.exports=e:typeof module!="undefined"&&module.exports&&typeof window!="undefined"?module.exports=o():typeof define=="function"&&define.amd?define("isMobile",[],n.isMobile=o()):n.isMobile=o()})(this);
/*
//@ sourceMappingURL=https://atpi.eventsair.com/bundles/vendor_929b745b5dff42f2b37c8fab39e1a584.map
*/