Give – Donation Plugin and Fundraising Platform - Version 1.8.10

Version Description

Give version 1.8 is a major update. Please make sure you make a backup of your database before updating.

Download this release

Release Info

Developer dlocc
Plugin Icon 128x128 Give – Donation Plugin and Fundraising Platform
Version 1.8.10
Comparing to
See all releases

Code changes from version 1.8.9 to 1.8.10

assets/js/frontend/give-ajax.js CHANGED
@@ -88,20 +88,25 @@ jQuery(document).ready(function ($) {
88
  give_user_pass: this_form.find('[name=give_user_pass]').val()
89
  };
90
 
91
- $.post(give_global_vars.ajaxurl, data, function (data) {
92
-
93
  //user is logged in
94
- if ($.trim(data) == 'success') {
 
95
  //remove errors
96
  this_form.find('.give_errors').remove();
97
- //reload the selected gateway so it contains their logged in information
 
 
 
 
 
98
  give_load_gateway(this_form, this_form.find('.give-gateway-option-selected input').val());
99
  } else {
100
  //Login failed, show errors
101
  this_form.find('[id^=give-login-fields] input[type=submit]').val(complete_purchase_val);
102
  this_form.find('.give-loading-animation').fadeOut();
103
  this_form.find('.give_errors').remove();
104
- this_form.find('[id^=give-user-login-submit]').before(data);
105
  }
106
  });
107
 
88
  give_user_pass: this_form.find('[name=give_user_pass]').val()
89
  };
90
 
91
+ $.post(give_global_vars.ajaxurl, data, function (response) {
 
92
  //user is logged in
93
+ if ( $.trim( typeof ( response.success ) ) != undefined && response.success == true && typeof ( response.data ) != undefined ) {
94
+
95
  //remove errors
96
  this_form.find('.give_errors').remove();
97
+
98
+ // Login successfully message.
99
+ this_form.find( '#give-payment-mode-select' ).after( response.data );
100
+ this_form.find( '.give_notices.give_errors' ).delay(5000).slideUp();
101
+
102
+ //reload the selected gateway so it contains their logged in information
103
  give_load_gateway(this_form, this_form.find('.give-gateway-option-selected input').val());
104
  } else {
105
  //Login failed, show errors
106
  this_form.find('[id^=give-login-fields] input[type=submit]').val(complete_purchase_val);
107
  this_form.find('.give-loading-animation').fadeOut();
108
  this_form.find('.give_errors').remove();
109
+ this_form.find('[id^=give-user-login-submit]').before( response.data );
110
  }
111
  });
112
 
assets/js/frontend/give-ajax.min.js CHANGED
@@ -1 +1 @@
1
- function give_load_gateway(e,i){var t=jQuery(e).find("#give-payment-mode-select .give-loading-text"),a=jQuery(e).find("#give-amount").val(),n=jQuery(e).find('input[name="give-form-id"]').val();t.fadeIn();var o=jQuery(e).data();1!=o["blockUI.isBlocked"]&&jQuery(e).find("#give_purchase_form_wrap").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),jQuery.post(give_scripts.ajaxurl+"?payment-mode="+i,{action:"give_load_gateway",give_total:a,give_form_id:n,give_payment_mode:i},function(i){jQuery(e).unblock(),jQuery(e).find("#give_purchase_form_wrap").html(i),jQuery(".give-no-js").hide(),jQuery(e).find("#give-payment-mode-select .give-loading-text").fadeOut(),setup_give_tooltips(),jQuery(document).trigger("give_gateway_loaded",[i,jQuery(e).attr("id")])})}function setup_give_tooltips(){jQuery('[data-tooltip!=""]').qtip({content:{attr:"data-tooltip"},style:{classes:"qtip-rounded qtip-tipsy"},position:{my:"bottom center",at:"top center"}}),jQuery.fn.qtip.zindex=2147483641}var give_scripts,give_global_vars;jQuery(document).ready(function(e){setup_give_tooltips(),e(".give-loading-text").hide(),e(document).on("click",".give-checkout-login",function(i){var t=e(this),a=e(this).parents("form"),n=e(a).find('[id^="give-checkout-login-register"] .give-loading-text'),o={action:t.data("action"),form_id:e(a).find('[name="give-form-id"]').val()};return n.show(),e.post(give_scripts.ajaxurl,o,function(i){e(a).find("[id^=give-checkout-login-register]").html(i),e(a).find(".give-submit-button-wrap").hide()}).done(function(){n.hide(),give_fl_trigger(),setup_give_tooltips()}),!1}),e(document).on("click",".give-checkout-register-cancel",function(i){i.preventDefault();var t=e(this),a=e(this).parents("form"),n={action:t.data("action"),form_id:e(a).find('[name="give-form-id"]').val()};e.post(give_scripts.ajaxurl,n,function(i){e(a).find("[id^=give-checkout-login-register]").html(e.parseJSON(i.fields)),e(a).find(".give-submit-button-wrap").show()}).done(function(){give_fl_trigger(),setup_give_tooltips()})}),e(document).on("click","[id^=give-login-fields] input[type=submit]",function(i){i.preventDefault();var t=e(this).val(),a=e(this).parents("form");e(this).val(give_global_vars.purchase_loading),a.find("[id^=give-login-fields] .give-loading-animation").fadeIn();var n={action:"give_process_donation_login",give_ajax:1,give_user_login:a.find("[name=give_user_login]").val(),give_user_pass:a.find("[name=give_user_pass]").val()};e.post(give_global_vars.ajaxurl,n,function(i){"success"==e.trim(i)?(a.find(".give_errors").remove(),give_load_gateway(a,a.find(".give-gateway-option-selected input").val())):(a.find("[id^=give-login-fields] input[type=submit]").val(t),a.find(".give-loading-animation").fadeOut(),a.find(".give_errors").remove(),a.find("[id^=give-user-login-submit]").before(i))})}),e("select#give-gateway, input.give-gateway").on("change",function(i){i.preventDefault();var t=e(this).val();return"0"==t?(console.log("There was a problem loading the selected gateway"),!1):(give_load_gateway(e(this).parents("form"),t),!1)}),e("body").on("click touchend",'form.give-form input[name="give-purchase"].give-submit',function(i){var t=e(this).parents("form.give-form"),a=t.find('input[type="submit"].give-submit + .give-loading-animation');a.fadeIn();var n=t.get(0);if("function"!=typeof n.checkValidity||n.checkValidity()!==!1||(a.fadeOut(),(navigator.userAgent.indexOf("Safari")!=-1&&navigator.userAgent.indexOf("Chrome")==-1)!=!1)){i.preventDefault();var o=e(this).val();e(this).val(give_global_vars.purchase_loading),e.post(give_global_vars.ajaxurl,t.serialize()+"&action=give_process_donation&give_ajax=true",function(i){"success"==e.trim(i)?(t.find(".give_errors").remove(),e(n).submit(),t.trigger("give_form_validation_passed")):(t.find('input[type="submit"].give-submit').val(o),a.fadeOut(),t.find(".give_errors").remove(),t.find('input[type="submit"].give-submit').before(i))})}})});
1
+ function give_load_gateway(e,i){var t=jQuery(e).find("#give-payment-mode-select .give-loading-text"),a=jQuery(e).find("#give-amount").val(),n=jQuery(e).find('input[name="give-form-id"]').val();t.fadeIn();var o=jQuery(e).data();1!=o["blockUI.isBlocked"]&&jQuery(e).find("#give_purchase_form_wrap").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),jQuery.post(give_scripts.ajaxurl+"?payment-mode="+i,{action:"give_load_gateway",give_total:a,give_form_id:n,give_payment_mode:i},function(i){jQuery(e).unblock(),jQuery(e).find("#give_purchase_form_wrap").html(i),jQuery(".give-no-js").hide(),jQuery(e).find("#give-payment-mode-select .give-loading-text").fadeOut(),setup_give_tooltips(),jQuery(document).trigger("give_gateway_loaded",[i,jQuery(e).attr("id")])})}function setup_give_tooltips(){jQuery('[data-tooltip!=""]').qtip({content:{attr:"data-tooltip"},style:{classes:"qtip-rounded qtip-tipsy"},position:{my:"bottom center",at:"top center"}}),jQuery.fn.qtip.zindex=2147483641}var give_scripts,give_global_vars;jQuery(document).ready(function(e){setup_give_tooltips(),e(".give-loading-text").hide(),e(document).on("click",".give-checkout-login",function(i){var t=e(this),a=e(this).parents("form"),n=e(a).find('[id^="give-checkout-login-register"] .give-loading-text'),o={action:t.data("action"),form_id:e(a).find('[name="give-form-id"]').val()};return n.show(),e.post(give_scripts.ajaxurl,o,function(i){e(a).find("[id^=give-checkout-login-register]").html(i),e(a).find(".give-submit-button-wrap").hide()}).done(function(){n.hide(),give_fl_trigger(),setup_give_tooltips()}),!1}),e(document).on("click",".give-checkout-register-cancel",function(i){i.preventDefault();var t=e(this),a=e(this).parents("form"),n={action:t.data("action"),form_id:e(a).find('[name="give-form-id"]').val()};e.post(give_scripts.ajaxurl,n,function(i){e(a).find("[id^=give-checkout-login-register]").html(e.parseJSON(i.fields)),e(a).find(".give-submit-button-wrap").show()}).done(function(){give_fl_trigger(),setup_give_tooltips()})}),e(document).on("click","[id^=give-login-fields] input[type=submit]",function(i){i.preventDefault();var t=e(this).val(),a=e(this).parents("form");e(this).val(give_global_vars.purchase_loading),a.find("[id^=give-login-fields] .give-loading-animation").fadeIn();var n={action:"give_process_donation_login",give_ajax:1,give_user_login:a.find("[name=give_user_login]").val(),give_user_pass:a.find("[name=give_user_pass]").val()};e.post(give_global_vars.ajaxurl,n,function(i){void 0!=e.trim(typeof i.success)&&1==i.success&&void 0!=typeof i.data?(a.find(".give_errors").remove(),a.find("#give-payment-mode-select").after(i.data),a.find(".give_notices.give_errors").delay(5e3).slideUp(),give_load_gateway(a,a.find(".give-gateway-option-selected input").val())):(a.find("[id^=give-login-fields] input[type=submit]").val(t),a.find(".give-loading-animation").fadeOut(),a.find(".give_errors").remove(),a.find("[id^=give-user-login-submit]").before(i.data))})}),e("select#give-gateway, input.give-gateway").on("change",function(i){i.preventDefault();var t=e(this).val();return"0"==t?(console.log("There was a problem loading the selected gateway"),!1):(give_load_gateway(e(this).parents("form"),t),!1)}),e("body").on("click touchend",'form.give-form input[name="give-purchase"].give-submit',function(i){var t=e(this).parents("form.give-form"),a=t.find('input[type="submit"].give-submit + .give-loading-animation');a.fadeIn();var n=t.get(0);if("function"!=typeof n.checkValidity||n.checkValidity()!==!1||(a.fadeOut(),(navigator.userAgent.indexOf("Safari")!=-1&&navigator.userAgent.indexOf("Chrome")==-1)!=!1)){i.preventDefault();var o=e(this).val();e(this).val(give_global_vars.purchase_loading),e.post(give_global_vars.ajaxurl,t.serialize()+"&action=give_process_donation&give_ajax=true",function(i){"success"==e.trim(i)?(t.find(".give_errors").remove(),e(n).submit(),t.trigger("give_form_validation_passed")):(t.find('input[type="submit"].give-submit').val(o),a.fadeOut(),t.find(".give_errors").remove(),t.find('input[type="submit"].give-submit').before(i))})}})});
assets/js/frontend/give.all.min.js CHANGED
@@ -5,6 +5,6 @@
5
  (function(){var t,e,n,r,a,i,o,l,u,s,c,h,p,f,g,v,d,m,y,C,T,w,$,D,S=[].slice,k=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};t=window.jQuery||window.Zepto||window.$,t.payment={},t.payment.fn={},t.fn.payment=function(){var e,n;return n=arguments[0],e=2<=arguments.length?S.call(arguments,1):[],t.payment.fn[n].apply(this,e)},a=/(\d{1,4})/g,t.payment.cards=r=[{type:"maestro",patterns:[5018,502,503,506,56,58,639,6220,67],format:a,length:[12,13,14,15,16,17,18,19],cvcLength:[3],luhn:!0},{type:"forbrugsforeningen",patterns:[600],format:a,length:[16],cvcLength:[3],luhn:!0},{type:"dankort",patterns:[5019],format:a,length:[16],cvcLength:[3],luhn:!0},{type:"visa",patterns:[4],format:a,length:[13,16],cvcLength:[3],luhn:!0},{type:"mastercard",patterns:[51,52,53,54,55,22,23,24,25,26,27],format:a,length:[16],cvcLength:[3],luhn:!0},{type:"amex",patterns:[34,37],format:/(\d{1,4})(\d{1,6})?(\d{1,5})?/,length:[15],cvcLength:[3,4],luhn:!0},{type:"dinersclub",patterns:[30,36,38,39],format:/(\d{1,4})(\d{1,6})?(\d{1,4})?/,length:[14],cvcLength:[3],luhn:!0},{type:"discover",patterns:[60,64,65,622],format:a,length:[16],cvcLength:[3],luhn:!0},{type:"unionpay",patterns:[62,88],format:a,length:[16,17,18,19],cvcLength:[3],luhn:!1},{type:"jcb",patterns:[35],format:a,length:[16],cvcLength:[3],luhn:!0}],e=function(t){var e,n,a,i,o,l,u,s;for(t=(t+"").replace(/\D/g,""),i=0,l=r.length;i<l;i++)for(e=r[i],s=e.patterns,o=0,u=s.length;o<u;o++)if(a=s[o],n=a+"",t.substr(0,n.length)===n)return e},n=function(t){var e,n,a;for(n=0,a=r.length;n<a;n++)if(e=r[n],e.type===t)return e},p=function(t){var e,n,r,a,i,o;for(r=!0,a=0,n=(t+"").split("").reverse(),i=0,o=n.length;i<o;i++)e=n[i],e=parseInt(e,10),(r=!r)&&(e*=2),e>9&&(e-=9),a+=e;return a%10===0},h=function(t){var e;return null!=t.prop("selectionStart")&&t.prop("selectionStart")!==t.prop("selectionEnd")||!(null==("undefined"!=typeof document&&null!==document&&null!=(e=document.selection)?e.createRange:void 0)||!document.selection.createRange().text)},$=function(t,e){var n,r,a,i,o,l;try{r=e.prop("selectionStart")}catch(u){i=u,r=null}if(o=e.val(),e.val(t),null!==r&&e.is(":focus"))return r===o.length&&(r=t.length),o!==t&&(l=o.slice(r-1,+r+1||9e9),n=t.slice(r-1,+r+1||9e9),a=t[r],/\d/.test(a)&&l===""+a+" "&&n===" "+a&&(r+=1)),e.prop("selectionStart",r),e.prop("selectionEnd",r)},m=function(t){var e,n,r,a,i,o,l,u;for(null==t&&(t=""),r="0123456789",a="0123456789",o="",e=t.split(""),l=0,u=e.length;l<u;l++)n=e[l],i=r.indexOf(n),i>-1&&(n=a[i]),o+=n;return o},d=function(e){var n;return n=t(e.currentTarget),setTimeout(function(){var t;return t=n.val(),t=m(t),t=t.replace(/\D/g,""),$(t,n)})},g=function(e){var n;return n=t(e.currentTarget),setTimeout(function(){var e;return e=n.val(),e=m(e),e=t.payment.formatCardNumber(e),$(e,n)})},l=function(n){var r,a,i,o,l,u,s;if(i=String.fromCharCode(n.which),/^\d+$/.test(i)&&(r=t(n.currentTarget),s=r.val(),a=e(s+i),o=(s.replace(/\D/g,"")+i).length,u=16,a&&(u=a.length[a.length.length-1]),!(o>=u||null!=r.prop("selectionStart")&&r.prop("selectionStart")!==s.length)))return l=a&&"amex"===a.type?/^(\d{4}|\d{4}\s\d{6})$/:/(?:^|\s)(\d{4})$/,l.test(s)?(n.preventDefault(),setTimeout(function(){return r.val(s+" "+i)})):l.test(s+i)?(n.preventDefault(),setTimeout(function(){return r.val(s+i+" ")})):void 0},i=function(e){var n,r;if(n=t(e.currentTarget),r=n.val(),8===e.which&&(null==n.prop("selectionStart")||n.prop("selectionStart")===r.length))return/\d\s$/.test(r)?(e.preventDefault(),setTimeout(function(){return n.val(r.replace(/\d\s$/,""))})):/\s\d?$/.test(r)?(e.preventDefault(),setTimeout(function(){return n.val(r.replace(/\d$/,""))})):void 0},v=function(e){var n;return n=t(e.currentTarget),setTimeout(function(){var e;return e=n.val(),e=m(e),e=t.payment.formatExpiry(e),$(e,n)})},u=function(e){var n,r,a;if(r=String.fromCharCode(e.which),/^\d+$/.test(r))return n=t(e.currentTarget),a=n.val()+r,/^\d$/.test(a)&&"0"!==a&&"1"!==a?(e.preventDefault(),setTimeout(function(){return n.val("0"+a+" / ")})):/^\d\d$/.test(a)?(e.preventDefault(),setTimeout(function(){var t,e;return t=parseInt(a[0],10),e=parseInt(a[1],10),e>2&&0!==t?n.val("0"+t+" / "+e):n.val(""+a+" / ")})):void 0},s=function(e){var n,r,a;if(r=String.fromCharCode(e.which),/^\d+$/.test(r))return n=t(e.currentTarget),a=n.val(),/^\d\d$/.test(a)?n.val(""+a+" / "):void 0},c=function(e){var n,r,a;if(a=String.fromCharCode(e.which),"/"===a||" "===a)return n=t(e.currentTarget),r=n.val(),/^\d$/.test(r)&&"0"!==r?n.val("0"+r+" / "):void 0},o=function(e){var n,r;if(n=t(e.currentTarget),r=n.val(),8===e.which&&(null==n.prop("selectionStart")||n.prop("selectionStart")===r.length))return/\d\s\/\s$/.test(r)?(e.preventDefault(),setTimeout(function(){return n.val(r.replace(/\d\s\/\s$/,""))})):void 0},f=function(e){var n;return n=t(e.currentTarget),setTimeout(function(){var t;return t=n.val(),t=m(t),t=t.replace(/\D/g,"").slice(0,4),$(t,n)})},w=function(t){var e;return!(!t.metaKey&&!t.ctrlKey)||32!==t.which&&(0===t.which||(t.which<33||(e=String.fromCharCode(t.which),!!/[\d\s]/.test(e))))},C=function(n){var r,a,i,o;if(r=t(n.currentTarget),i=String.fromCharCode(n.which),/^\d+$/.test(i)&&!h(r))return o=(r.val()+i).replace(/\D/g,""),a=e(o),a?o.length<=a.length[a.length.length-1]:o.length<=16},T=function(e){var n,r,a;if(n=t(e.currentTarget),r=String.fromCharCode(e.which),/^\d+$/.test(r)&&!h(n))return a=n.val()+r,a=a.replace(/\D/g,""),!(a.length>6)&&void 0},y=function(e){var n,r,a;if(n=t(e.currentTarget),r=String.fromCharCode(e.which),/^\d+$/.test(r)&&!h(n))return a=n.val()+r,a.length<=4},D=function(e){var n,a,i,o,l;if(n=t(e.currentTarget),l=n.val(),o=t.payment.cardType(l)||"unknown",!n.hasClass(o))return a=function(){var t,e,n;for(n=[],t=0,e=r.length;t<e;t++)i=r[t],n.push(i.type);return n}(),n.removeClass("unknown"),n.removeClass(a.join(" ")),n.addClass(o),n.toggleClass("identified","unknown"!==o),n.trigger("payment.cardType",o)},t.payment.fn.formatCardCVC=function(){return this.on("keypress",w),this.on("keypress",y),this.on("paste",f),this.on("change",f),this.on("input",f),this},t.payment.fn.formatCardExpiry=function(){return this.on("keypress",w),this.on("keypress",T),this.on("keypress",u),this.on("keypress",c),this.on("keypress",s),this.on("keydown",o),this.on("change",v),this.on("input",v),this},t.payment.fn.formatCardNumber=function(){return this.on("keypress",w),this.on("keypress",C),this.on("keypress",l),this.on("keydown",i),this.on("keyup",D),this.on("paste",g),this.on("change",g),this.on("input",g),this.on("input",D),this},t.payment.fn.restrictNumeric=function(){return this.on("keypress",w),this.on("paste",d),this.on("change",d),this.on("input",d),this},t.payment.fn.cardExpiryVal=function(){return t.payment.cardExpiryVal(t(this).val())},t.payment.cardExpiryVal=function(t){var e,n,r,a;return a=t.split(/[\s\/]+/,2),e=a[0],r=a[1],2===(null!=r?r.length:void 0)&&/^\d+$/.test(r)&&(n=(new Date).getFullYear(),n=n.toString().slice(0,2),r=n+r),e=parseInt(e,10),r=parseInt(r,10),{month:e,year:r}},t.payment.validateCardNumber=function(t){var n,r;return t=(t+"").replace(/\s+|-/g,""),!!/^\d+$/.test(t)&&(n=e(t),!!n&&(r=t.length,k.call(n.length,r)>=0&&(n.luhn===!1||p(t))))},t.payment.validateCardExpiry=function(e,n){var r,a,i;return"object"==typeof e&&"month"in e&&(i=e,e=i.month,n=i.year),!(!e||!n)&&(e=t.trim(e),n=t.trim(n),!!/^\d+$/.test(e)&&(!!/^\d+$/.test(n)&&(1<=e&&e<=12&&(2===n.length&&(n=n<70?"20"+n:"19"+n),4===n.length&&(a=new Date(n,e),r=new Date,a.setMonth(a.getMonth()-1),a.setMonth(a.getMonth()+1,1),a>r)))))},t.payment.validateCardCVC=function(e,r){var a,i;return e=t.trim(e),!!/^\d+$/.test(e)&&(a=n(r),null!=a?(i=e.length,k.call(a.cvcLength,i)>=0):e.length>=3&&e.length<=4)},t.payment.cardType=function(t){var n;return t?(null!=(n=e(t))?n.type:void 0)||null:null},t.payment.formatCardNumber=function(n){var r,a,i,o;return n=n.replace(/\D/g,""),(r=e(n))?(i=r.length[r.length.length-1],n=n.slice(0,i),r.format.global?null!=(o=n.match(r.format))?o.join(" "):void 0:(a=r.format.exec(n),null!=a?(a.shift(),a=t.grep(a,function(t){return t}),a.join(" ")):void 0)):n},t.payment.formatExpiry=function(t){var e,n,r,a;return(n=t.match(/^\D*(\d{1,2})(\D+)?(\d{1,4})?/))?(e=n[1]||"",r=n[2]||"",a=n[3]||"",a.length>0?r=" / ":" /"===r?(e=e.substring(0,1),r=""):2===e.length||r.length>0?r=" / ":1===e.length&&"0"!==e&&"1"!==e&&(e="0"+e,r=" / "),e+r+a):""}}).call(this);
6
  !function(t,e,i){!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.qtip&&t(jQuery)}(function(s){"use strict";function o(t,e,i,o){this.id=i,this.target=t,this.tooltip=k,this.elements={target:t},this._id=R+"-"+i,this.timers={img:{}},this.options=e,this.plugins={},this.cache={event:{},target:s(),disabled:I,attr:o,onTooltip:I,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=I}function n(t){return t===k||"object"!==s.type(t)}function r(t){return!(s.isFunction(t)||t&&t.attr||t.length||"object"===s.type(t)&&(t.jquery||t.then))}function a(t){var e,i,o,a;return n(t)?I:(n(t.metadata)&&(t.metadata={type:t.metadata}),"content"in t&&(e=t.content,n(e)||e.jquery||e.done?e=t.content={text:i=r(e)?I:e}:i=e.text,"ajax"in e&&(o=e.ajax,a=o&&o.once!==I,delete e.ajax,e.text=function(t,e){var n=i||s(this).attr(e.options.content.attr)||"Loading...",r=s.ajax(s.extend({},o,{context:e})).then(o.success,k,o.error).then(function(t){return t&&a&&e.set("content.text",t),t},function(t,i,s){e.destroyed||0===t.status||e.set("content.text",i+": "+s)});return a?n:(e.set("content.text",n),r)}),"title"in e&&(s.isPlainObject(e.title)&&(e.button=e.title.button,e.title=e.title.text),r(e.title||I)&&(e.title=I))),"position"in t&&n(t.position)&&(t.position={my:t.position,at:t.position}),"show"in t&&n(t.show)&&(t.show=t.show.jquery?{target:t.show}:t.show===W?{ready:W}:{event:t.show}),"hide"in t&&n(t.hide)&&(t.hide=t.hide.jquery?{target:t.hide}:{event:t.hide}),"style"in t&&n(t.style)&&(t.style={classes:t.style}),s.each(V,function(){this.sanitize&&this.sanitize(t)}),t)}function h(t,e){for(var i,s=0,o=t,n=e.split(".");o=o[n[s++]];)s<n.length&&(i=o);return[i||t,n.pop()]}function l(t,e){var i,s,o;for(i in this.checks)for(s in this.checks[i])(o=new RegExp(s,"i").exec(t))&&(e.push(o),("builtin"===i||this.plugins[i])&&this.checks[i][s].apply(this.plugins[i]||this,e))}function c(t){return Y.concat("").join(t?"-"+t+" ":" ")}function d(t,e){return e>0?setTimeout(s.proxy(t,this),e):void t.call(this)}function p(t){this.tooltip.hasClass(tt)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=d.call(this,function(){this.toggle(W,t)},this.options.show.delay))}function u(t){if(!this.tooltip.hasClass(tt)&&!this.destroyed){var e=s(t.relatedTarget),i=e.closest(G)[0]===this.tooltip[0],o=e[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==e[0]&&"mouse"===this.options.position.target&&i||this.options.hide.fixed&&/mouse(out|leave|move)/.test(t.type)&&(i||o))try{t.preventDefault(),t.stopImmediatePropagation()}catch(n){}else this.timers.hide=d.call(this,function(){this.toggle(I,t)},this.options.hide.delay,this)}}function f(t){!this.tooltip.hasClass(tt)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=d.call(this,function(){this.hide(t)},this.options.hide.inactive))}function g(t){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(t)}function m(t,i,o){s(e.body).delegate(t,(i.split?i:i.join("."+R+" "))+"."+R,function(){var t=q.api[s.attr(this,X)];t&&!t.disabled&&o.apply(t,arguments)})}function v(t,i,n){var r,h,l,c,d,p=s(e.body),u=t[0]===e?p:t,f=t.metadata?t.metadata(n.metadata):k,g="html5"===n.metadata.type&&f?f[n.metadata.name]:k,m=t.data(n.metadata.name||"qtipopts");try{m="string"==typeof m?s.parseJSON(m):m}catch(v){}if(c=s.extend(W,{},q.defaults,n,"object"==typeof m?a(m):k,a(g||f)),h=c.position,c.id=i,"boolean"==typeof c.content.text){if(l=t.attr(c.content.attr),c.content.attr===I||!l)return I;c.content.text=l}if(h.container.length||(h.container=p),h.target===I&&(h.target=u),c.show.target===I&&(c.show.target=u),c.show.solo===W&&(c.show.solo=h.container.closest("body")),c.hide.target===I&&(c.hide.target=u),c.position.viewport===W&&(c.position.viewport=h.container),h.container=h.container.eq(0),h.at=new j(h.at,W),h.my=new j(h.my),t.data(R))if(c.overwrite)t.qtip("destroy",!0);else if(c.overwrite===I)return I;return t.attr(H,i),c.suppress&&(d=t.attr("title"))&&t.removeAttr("title").attr(it,d).attr("title",""),r=new o(t,c,i,(!!l)),t.data(R,r),r}function y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function b(t,e){var s,o,n=e.charAt(0).toUpperCase()+e.slice(1),r=(e+" "+vt.join(n+" ")+n).split(" "),a=0;if(mt[e])return t.css(mt[e]);for(;s=r[a++];)if((o=t.css(s))!==i)return mt[e]=s,o}function w(t,e){return Math.ceil(parseFloat(b(t,e)))}function _(t,e){this._ns="tip",this.options=e,this.offset=e.offset,this.size=[e.width,e.height],this.init(this.qtip=t)}function x(t,e){this.options=e,this._ns="-modal",this.init(this.qtip=t)}function C(t,e){this._ns="ie6",this.init(this.qtip=t)}var q,T,j,z,M,W=!0,I=!1,k=null,E="x",S="y",A="width",L="height",P="top",D="left",B="bottom",F="right",N="center",O="flipinvert",$="shift",V={},R="qtip",H="data-hasqtip",X="data-qtip-id",Y=["ui-widget","ui-tooltip"],G="."+R,U="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Q=R+"-fixed",J=R+"-default",K=R+"-focus",Z=R+"-hover",tt=R+"-disabled",et="_replacedByqTip",it="oldtitle",st={ie:function(){for(var t=4,i=e.createElement("div");(i.innerHTML="<!--[if gt IE "+t+"]><i></i><![endif]-->")&&i.getElementsByTagName("i")[0];t+=1);return t>4?t: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("_",""))||I};T=o.prototype,T._when=function(t){return s.when.apply(s,t)},T.render=function(t){if(this.rendered||this.destroyed)return this;var e,i=this,o=this.options,n=this.cache,r=this.elements,a=o.content.text,h=o.content.title,l=o.content.button,c=o.position,d=("."+this._id+" ",[]);return s.attr(this.target[0],"aria-describedby",this._id),n.posClass=this._createPosClass((this.position={my:c.my,at:c.at}).my),this.tooltip=r.tooltip=e=s("<div/>",{id:this._id,"class":[R,J,o.style.classes,n.posClass].join(" "),width:o.style.width||"",height:o.style.height||"",tracking:"mouse"===c.target&&c.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":I,"aria-describedby":this._id+"-content","aria-hidden":W}).toggleClass(tt,this.disabled).attr(X,this.id).data(R,this).appendTo(c.container).append(r.content=s("<div />",{"class":R+"-content",id:this._id+"-content","aria-atomic":W})),this.rendered=-1,this.positioning=W,h&&(this._createTitle(),s.isFunction(h)||d.push(this._updateTitle(h,I))),l&&this._createButton(),s.isFunction(a)||d.push(this._updateContent(a,I)),this.rendered=W,this._setWidget(),s.each(V,function(t){var e;"render"===this.initialize&&(e=this(i))&&(i.plugins[t]=e)}),this._unassignEvents(),this._assignEvents(),this._when(d).then(function(){i._trigger("render"),i.positioning=I,i.hiddenDuringWait||!o.show.ready&&!t||i.toggle(W,n.event,I),i.hiddenDuringWait=I}),q.api[this.id]=this,this},T.destroy=function(t){function e(){if(!this.destroyed){this.destroyed=W;var t,e=this.target,i=e.attr(it);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),s.each(this.plugins,function(t){this.destroy&&this.destroy()});for(t in this.timers)clearTimeout(this.timers[t]);e.removeData(R).removeAttr(X).removeAttr(H).removeAttr("aria-describedby"),this.options.suppress&&i&&e.attr("title",i).removeAttr(it),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=k,delete q.api[this.id]}}return this.destroyed?this.target:(t===W&&"hide"!==this.triggering||!this.rendered?e.call(this):(this.tooltip.one("tooltiphidden",s.proxy(e,this)),!this.triggering&&this.hide()),this.target)},z=T.checks={builtin:{"^id$":function(t,e,i,o){var n=i===W?q.nextid:i,r=R+"-"+n;n!==I&&n.length>0&&!s("#"+r).length?(this._id=r,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):t[e]=o},"^prerender":function(t,e,i){i&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(t,e,i){this._updateContent(i)},"^content.attr$":function(t,e,i,s){this.options.content.text===this.target.attr(s)&&this._updateContent(this.target.attr(i))},"^content.title$":function(t,e,i){return i?(i&&!this.elements.title&&this._createTitle(),void this._updateTitle(i)):this._removeTitle()},"^content.button$":function(t,e,i){this._updateButton(i)},"^content.title.(text|button)$":function(t,e,i){this.set("content."+e,i)},"^position.(my|at)$":function(t,e,i){"string"==typeof i&&(this.position[e]=t[e]=new j(i,"at"===e))},"^position.container$":function(t,e,i){this.rendered&&this.tooltip.appendTo(i)},"^show.ready$":function(t,e,i){i&&(!this.rendered&&this.render(W)||this.toggle(W))},"^style.classes$":function(t,e,i,s){this.rendered&&this.tooltip.removeClass(s).addClass(i)},"^style.(width|height)":function(t,e,i){this.rendered&&this.tooltip.css(e,i)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(t,e,i){this.rendered&&this.tooltip.toggleClass(J,!!i)},"^events.(render|show|move|hide|focus|blur)$":function(t,e,i){this.rendered&&this.tooltip[(s.isFunction(i)?"":"un")+"bind"]("tooltip"+e,i)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var t=this.options.position;this.tooltip.attr("tracking","mouse"===t.target&&t.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},T.get=function(t){if(this.destroyed)return this;var e=h(this.options,t.toLowerCase()),i=e[0][e[1]];return i.precedance?i.string():i};var ot=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,nt=/^prerender|show\.ready/i;T.set=function(t,e){if(this.destroyed)return this;var i,o=this.rendered,n=I,r=this.options;this.checks;return"string"==typeof t?(i=t,t={},t[i]=e):t=s.extend({},t),s.each(t,function(e,i){if(o&&nt.test(e))return void delete t[e];var a,l=h(r,e.toLowerCase());a=l[0][l[1]],l[0][l[1]]=i&&i.nodeType?s(i):i,n=ot.test(e)||n,t[e]=[l[0],l[1],i,a]}),a(r),this.positioning=W,s.each(t,s.proxy(l,this)),this.positioning=I,this.rendered&&this.tooltip[0].offsetWidth>0&&n&&this.reposition("mouse"===r.position.target?k:this.cache.event),this},T._update=function(t,e,i){var o=this,n=this.cache;return this.rendered&&t?(s.isFunction(t)&&(t=t.call(this.elements.target,n.event,this)||""),s.isFunction(t.then)?(n.waiting=W,t.then(function(t){return n.waiting=I,o._update(t,e)},k,function(t){return o._update(t,e)})):t===I||!t&&""!==t?I:(t.jquery&&t.length>0?e.empty().append(t.css({display:"block",visibility:"visible"})):e.html(t),this._waitForContent(e).then(function(t){o.rendered&&o.tooltip[0].offsetWidth>0&&o.reposition(n.event,!t.length)}))):I},T._waitForContent=function(t){var e=this.cache;return e.waiting=W,(s.fn.imagesLoaded?t.imagesLoaded():s.Deferred().resolve([])).done(function(){e.waiting=I}).promise()},T._updateContent=function(t,e){this._update(t,this.elements.content,e)},T._updateTitle=function(t,e){this._update(t,this.elements.title,e)===I&&this._removeTitle(I)},T._createTitle=function(){var t=this.elements,e=this._id+"-title";t.titlebar&&this._removeTitle(),t.titlebar=s("<div />",{"class":R+"-titlebar "+(this.options.style.widget?c("header"):"")}).append(t.title=s("<div />",{id:e,"class":R+"-title","aria-atomic":W})).insertBefore(t.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(t){s(this).toggleClass("ui-state-active ui-state-focus","down"===t.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(t){s(this).toggleClass("ui-state-hover","mouseover"===t.type)}),this.options.content.button&&this._createButton()},T._removeTitle=function(t){var e=this.elements;e.title&&(e.titlebar.remove(),e.titlebar=e.title=e.button=k,t!==I&&this.reposition())},T._createPosClass=function(t){return R+"-pos-"+(t||this.options.position.my).abbrev()},T.reposition=function(i,o){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=W;var n,r,a,h,l=this.cache,c=this.tooltip,d=this.options.position,p=d.target,u=d.my,f=d.at,g=d.viewport,m=d.container,v=d.adjust,y=v.method.split(" "),b=c.outerWidth(I),w=c.outerHeight(I),_=0,x=0,C=c.css("position"),q={left:0,top:0},T=c[0].offsetWidth>0,j=i&&"scroll"===i.type,z=s(t),M=m[0].ownerDocument,k=this.mouse;if(s.isArray(p)&&2===p.length)f={x:D,y:P},q={left:p[0],top:p[1]};else if("mouse"===p)f={x:D,y:P},(!v.mouse||this.options.hide.distance)&&l.origin&&l.origin.pageX?i=l.origin:!i||i&&("resize"===i.type||"scroll"===i.type)?i=l.event:k&&k.pageX&&(i=k),"static"!==C&&(q=m.offset()),M.body.offsetWidth!==(t.innerWidth||M.documentElement.clientWidth)&&(r=s(e.body).offset()),q={left:i.pageX-q.left+(r&&r.left||0),top:i.pageY-q.top+(r&&r.top||0)},v.mouse&&j&&k&&(q.left-=(k.scrollX||0)-z.scrollLeft(),q.top-=(k.scrollY||0)-z.scrollTop());else{if("event"===p?i&&i.target&&"scroll"!==i.type&&"resize"!==i.type?l.target=s(i.target):i.target||(l.target=this.elements.target):"event"!==p&&(l.target=s(p.jquery?p:this.elements.target)),p=l.target,p=s(p).eq(0),0===p.length)return this;p[0]===e||p[0]===t?(_=st.iOS?t.innerWidth:p.width(),x=st.iOS?t.innerHeight:p.height(),p[0]===t&&(q={top:(g||p).scrollTop(),left:(g||p).scrollLeft()})):V.imagemap&&p.is("area")?n=V.imagemap(this,p,f,V.viewport?y:I):V.svg&&p&&p[0].ownerSVGElement?n=V.svg(this,p,f,V.viewport?y:I):(_=p.outerWidth(I),x=p.outerHeight(I),q=p.offset()),n&&(_=n.width,x=n.height,r=n.offset,q=n.position),q=this.reposition.offset(p,q,m),(st.iOS>3.1&&st.iOS<4.1||st.iOS>=4.3&&st.iOS<4.33||!st.iOS&&"fixed"===C)&&(q.left-=z.scrollLeft(),q.top-=z.scrollTop()),(!n||n&&n.adjustable!==I)&&(q.left+=f.x===F?_:f.x===N?_/2:0,q.top+=f.y===B?x:f.y===N?x/2:0)}return q.left+=v.x+(u.x===F?-b:u.x===N?-b/2:0),q.top+=v.y+(u.y===B?-w:u.y===N?-w/2:0),V.viewport?(a=q.adjusted=V.viewport(this,q,d,_,x,b,w),r&&a.left&&(q.left+=r.left),r&&a.top&&(q.top+=r.top),a.my&&(this.position.my=a.my)):q.adjusted={left:0,top:0},l.posClass!==(h=this._createPosClass(this.position.my))&&c.removeClass(l.posClass).addClass(l.posClass=h),this._trigger("move",[q,g.elem||g],i)?(delete q.adjusted,o===I||!T||isNaN(q.left)||isNaN(q.top)||"mouse"===p||!s.isFunction(d.effect)?c.css(q):s.isFunction(d.effect)&&(d.effect.call(c,this,s.extend({},q)),c.queue(function(t){s(this).css({opacity:"",height:""}),st.ie&&this.style.removeAttribute("filter"),t()})),this.positioning=I,this):this},T.reposition.offset=function(t,i,o){function n(t,e){i.left+=e*t.scrollLeft(),i.top+=e*t.scrollTop()}if(!o[0])return i;var r,a,h,l,c=s(t[0].ownerDocument),d=!!st.ie&&"CSS1Compat"!==e.compatMode,p=o[0];do"static"!==(a=s.css(p,"position"))&&("fixed"===a?(h=p.getBoundingClientRect(),n(c,-1)):(h=s(p).position(),h.left+=parseFloat(s.css(p,"borderLeftWidth"))||0,h.top+=parseFloat(s.css(p,"borderTopWidth"))||0),i.left-=h.left+(parseFloat(s.css(p,"marginLeft"))||0),i.top-=h.top+(parseFloat(s.css(p,"marginTop"))||0),r||"hidden"===(l=s.css(p,"overflow"))||"visible"===l||(r=s(p)));while(p=p.offsetParent);return r&&(r[0]!==c[0]||d)&&n(r,1),i};var rt=(j=T.reposition.Corner=function(t,e){t=(""+t).replace(/([A-Z])/," $1").replace(/middle/gi,N).toLowerCase(),this.x=(t.match(/left|right/i)||t.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(t.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!e;var i=t.charAt(0);this.precedance="t"===i||"b"===i?S:E}).prototype;rt.invert=function(t,e){this[t]=this[t]===D?F:this[t]===F?D:e||this[t]},rt.string=function(t){var e=this.x,i=this.y,s=e!==i?"center"===e||"center"!==i&&(this.precedance===S||this.forceY)?[i,e]:[e,i]:[e];return t!==!1?s.join(" "):s},rt.abbrev=function(){var t=this.string(!1);return t[0].charAt(0)+(t[1]&&t[1].charAt(0)||"")},rt.clone=function(){return new j(this.string(),this.forceY)},T.toggle=function(t,i){var o=this.cache,n=this.options,r=this.tooltip;if(i){if(/over|enter/.test(i.type)&&o.event&&/out|leave/.test(o.event.type)&&n.show.target.add(i.target).length===n.show.target.length&&r.has(i.relatedTarget).length)return this;o.event=s.event.fix(i)}if(this.waiting&&!t&&(this.hiddenDuringWait=W),!this.rendered)return t?this.render(1):this;if(this.destroyed||this.disabled)return this;var a,h,l,c=t?"show":"hide",d=this.options[c],p=(this.options[t?"hide":"show"],this.options.position),u=this.options.content,f=this.tooltip.css("width"),g=this.tooltip.is(":visible"),m=t||1===d.target.length,v=!i||d.target.length<2||o.target[0]===i.target;return(typeof t).search("boolean|number")&&(t=!g),a=!r.is(":animated")&&g===t&&v,h=a?k:!!this._trigger(c,[90]),this.destroyed?this:(h!==I&&t&&this.focus(i),!h||a?this:(s.attr(r[0],"aria-hidden",!t),t?(this.mouse&&(o.origin=s.event.fix(this.mouse)),s.isFunction(u.text)&&this._updateContent(u.text,I),s.isFunction(u.title)&&this._updateTitle(u.title,I),!M&&"mouse"===p.target&&p.adjust.mouse&&(s(e).bind("mousemove."+R,this._storeMouse),M=W),f||r.css("width",r.outerWidth(I)),this.reposition(i,arguments[2]),f||r.css("width",""),d.solo&&("string"==typeof d.solo?s(d.solo):s(G,d.solo)).not(r).not(d.target).qtip("hide",s.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete o.origin,M&&!s(G+'[tracking="true"]:visible',d.solo).not(r).length&&(s(e).unbind("mousemove."+R),M=I),this.blur(i)),l=s.proxy(function(){t?(st.ie&&r[0].style.removeAttribute("filter"),r.css("overflow",""),"string"==typeof d.autofocus&&s(this.options.show.autofocus,r).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):r.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(t?"visible":"hidden")},this),d.effect===I||m===I?(r[c](),l()):s.isFunction(d.effect)?(r.stop(1,1),d.effect.call(r,this),r.queue("fx",function(t){l(),t()})):r.fadeTo(90,t?1:0,l),t&&d.target.trigger("qtip-"+this.id+"-inactive"),this))},T.show=function(t){return this.toggle(W,t)},T.hide=function(t){return this.toggle(I,t)},T.focus=function(t){if(!this.rendered||this.destroyed)return this;var e=s(G),i=this.tooltip,o=parseInt(i[0].style.zIndex,10),n=q.zindex+e.length;return i.hasClass(K)||this._trigger("focus",[n],t)&&(o!==n&&(e.each(function(){this.style.zIndex>o&&(this.style.zIndex=this.style.zIndex-1)}),e.filter("."+K).qtip("blur",t)),i.addClass(K)[0].style.zIndex=n),this},T.blur=function(t){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(K),this._trigger("blur",[this.tooltip.css("zIndex")],t),this)},T.disable=function(t){return this.destroyed?this:("toggle"===t?t=!(this.rendered?this.tooltip.hasClass(tt):this.disabled):"boolean"!=typeof t&&(t=W),this.rendered&&this.tooltip.toggleClass(tt,t).attr("aria-disabled",t),this.disabled=!!t,this)},T.enable=function(){return this.disable(I)},T._createButton=function(){var t=this,e=this.elements,i=e.tooltip,o=this.options.content.button,n="string"==typeof o,r=n?o:"Close tooltip";e.button&&e.button.remove(),o.jquery?e.button=o:e.button=s("<a />",{"class":"qtip-close "+(this.options.style.widget?"":R+"-icon"),title:r,"aria-label":r}).prepend(s("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"})),e.button.appendTo(e.titlebar||i).attr("role","button").click(function(e){return i.hasClass(tt)||t.hide(e),I})},T._updateButton=function(t){if(!this.rendered)return I;var e=this.elements.button;t?this._createButton():e.remove()},T._setWidget=function(){var t=this.options.style.widget,e=this.elements,i=e.tooltip,s=i.hasClass(tt);i.removeClass(tt),tt=t?"ui-state-disabled":"qtip-disabled",i.toggleClass(tt,s),i.toggleClass("ui-helper-reset "+c(),t).toggleClass(J,this.options.style.def&&!t),e.content&&e.content.toggleClass(c("content"),t),e.titlebar&&e.titlebar.toggleClass(c("header"),t),e.button&&e.button.toggleClass(R+"-icon",!t)},T._storeMouse=function(t){return(this.mouse=s.event.fix(t)).type="mousemove",this},T._bind=function(t,e,i,o,n){if(t&&i&&e.length){var r="."+this._id+(o?"-"+o:"");return s(t).bind((e.split?e:e.join(r+" "))+r,s.proxy(i,n||this)),this}},T._unbind=function(t,e){return t&&s(t).unbind("."+this._id+(e?"-"+e:"")),this},T._trigger=function(t,e,i){var o=s.Event("tooltip"+t);return o.originalEvent=i&&s.extend({},i)||this.cache.event||k,this.triggering=t,this.tooltip.trigger(o,[this].concat(e||[])),this.triggering=I,!o.isDefaultPrevented()},T._bindEvents=function(t,e,i,o,n,r){var a=i.filter(o).add(o.filter(i)),h=[];a.length&&(s.each(e,function(e,i){var o=s.inArray(i,t);o>-1&&h.push(t.splice(o,1)[0])}),h.length&&(this._bind(a,h,function(t){var e=!!this.rendered&&this.tooltip[0].offsetWidth>0;(e?r:n).call(this,t)}),i=i.not(a),o=o.not(a))),this._bind(i,t,n),this._bind(o,e,r)},T._assignInitialEvents=function(t){function e(t){return this.disabled||this.destroyed?I:(this.cache.event=t&&s.event.fix(t),this.cache.target=t&&s(t.target),clearTimeout(this.timers.show),void(this.timers.show=d.call(this,function(){this.render("object"==typeof t||i.show.ready)},i.prerender?0:i.show.delay)))}var i=this.options,o=i.show.target,n=i.hide.target,r=i.show.event?s.trim(""+i.show.event).split(" "):[],a=i.hide.event?s.trim(""+i.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(t){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(i.show.event)&&!/mouse(out|leave)/i.test(i.hide.event)&&a.push("mouseleave"),this._bind(o,"mousemove",function(t){this._storeMouse(t),this.cache.onTarget=W}),this._bindEvents(r,a,o,n,e,function(){return this.timers?void clearTimeout(this.timers.show):I}),(i.show.ready||i.prerender)&&e.call(this,t)},T._assignEvents=function(){var i=this,o=this.options,n=o.position,r=this.tooltip,a=o.show.target,h=o.hide.target,l=n.container,c=n.viewport,d=s(e),m=(s(e.body),s(t)),v=o.show.event?s.trim(""+o.show.event).split(" "):[],y=o.hide.event?s.trim(""+o.hide.event).split(" "):[];s.each(o.events,function(t,e){i._bind(r,"toggle"===t?["tooltipshow","tooltiphide"]:["tooltip"+t],e,null,r)}),/mouse(out|leave)/i.test(o.hide.event)&&"window"===o.hide.leave&&this._bind(d,["mouseout","blur"],function(t){/select|option/.test(t.target.nodeName)||t.relatedTarget||this.hide(t)}),o.hide.fixed?h=h.add(r.addClass(Q)):/mouse(over|enter)/i.test(o.show.event)&&this._bind(h,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+o.hide.event).indexOf("unfocus")>-1&&this._bind(l.closest("html"),["mousedown","touchstart"],function(t){var e=s(t.target),i=this.rendered&&!this.tooltip.hasClass(tt)&&this.tooltip[0].offsetWidth>0,o=e.parents(G).filter(this.tooltip[0]).length>0;e[0]===this.target[0]||e[0]===this.tooltip[0]||o||this.target.has(e[0]).length||!i||this.hide(t)}),"number"==typeof o.hide.inactive&&(this._bind(a,"qtip-"+this.id+"-inactive",f,"inactive"),this._bind(h.add(r),q.inactiveEvents,f)),this._bindEvents(v,y,a,h,p,u),this._bind(a.add(r),"mousemove",function(t){if("number"==typeof o.hide.distance){var e=this.cache.origin||{},i=this.options.hide.distance,s=Math.abs;(s(t.pageX-e.pageX)>=i||s(t.pageY-e.pageY)>=i)&&this.hide(t)}this._storeMouse(t)}),"mouse"===n.target&&n.adjust.mouse&&(o.hide.event&&this._bind(a,["mouseenter","mouseleave"],function(t){return this.cache?void(this.cache.onTarget="mouseenter"===t.type):I}),this._bind(d,"mousemove",function(t){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(tt)&&this.tooltip[0].offsetWidth>0&&this.reposition(t)})),(n.adjust.resize||c.length)&&this._bind(s.event.special.resize?c:m,"resize",g),n.adjust.scroll&&this._bind(m.add(n.container),"scroll",g)},T._unassignEvents=function(){var i=this.options,o=i.show.target,n=i.hide.target,r=s.grep([this.elements.target[0],this.rendered&&this.tooltip[0],i.position.container[0],i.position.viewport[0],i.position.container.closest("html")[0],t,e],function(t){return"object"==typeof t});o&&o.toArray&&(r=r.concat(o.toArray())),n&&n.toArray&&(r=r.concat(n.toArray())),this._unbind(r)._unbind(r,"destroy")._unbind(r,"inactive")},s(function(){m(G,["mouseenter","mouseleave"],function(t){var e="mouseenter"===t.type,i=s(t.currentTarget),o=s(t.relatedTarget||t.target),n=this.options;e?(this.focus(t),i.hasClass(Q)&&!i.hasClass(tt)&&clearTimeout(this.timers.hide)):"mouse"===n.position.target&&n.position.adjust.mouse&&n.hide.event&&n.show.target&&!o.closest(n.show.target[0]).length&&this.hide(t),i.toggleClass(Z,e)}),m("["+X+"]",U,f)}),q=s.fn.qtip=function(t,e,o){var n=(""+t).toLowerCase(),r=k,h=s.makeArray(arguments).slice(1),l=h[h.length-1],c=this[0]?s.data(this[0],R):k;return!arguments.length&&c||"api"===n?c:"string"==typeof t?(this.each(function(){var t=s.data(this,R);if(!t)return W;if(l&&l.timeStamp&&(t.cache.event=l),!e||"option"!==n&&"options"!==n)t[n]&&t[n].apply(t,h);else{if(o===i&&!s.isPlainObject(e))return r=t.get(e),I;t.set(e,o)}}),r!==k?r:this):"object"!=typeof t&&arguments.length?void 0:(c=a(s.extend(W,{},t)),this.each(function(t){var e,i;return i=s.isArray(c.id)?c.id[t]:c.id,i=!i||i===I||i.length<1||q.api[i]?q.nextid++:i,e=v(s(this),i,c),e===I?W:(q.api[i]=e,s.each(V,function(){"initialize"===this.initialize&&this(e)}),void e._assignInitialEvents(l))}))},s.qtip=o,q.api={},s.each({attr:function(t,e){if(this.length){var i=this[0],o="title",n=s.data(i,"qtip");if(t===o&&n&&"object"==typeof n&&n.options.suppress)return arguments.length<2?s.attr(i,it):(n&&n.options.content.attr===o&&n.cache.attr&&n.set("content.text",e),this.attr(it,e))}return s.fn["attr"+et].apply(this,arguments)},clone:function(t){var e=(s([]),s.fn["clone"+et].apply(this,arguments));return t||e.filter("["+it+"]").attr("title",function(){return s.attr(this,it)}).removeAttr(it),e}},function(t,e){if(!e||s.fn[t+et])return W;var i=s.fn[t+et]=s.fn[t];s.fn[t]=function(){return e.apply(this,arguments)||i.apply(this,arguments)}}),s.ui||(s["cleanData"+et]=s.cleanData,s.cleanData=function(t){for(var e,i=0;(e=s(t[i])).length;i++)if(e.attr(H))try{e.triggerHandler("removeqtip")}catch(o){}s["cleanData"+et].apply(this,arguments)}),q.version="2.2.1",q.nextid=0,q.inactiveEvents=U,q.zindex=15e3,q.defaults={prerender:I,id:I,overwrite:W,suppress:W,content:{text:W,attr:"title",title:I,button:I},position:{my:"top left",at:"bottom right",target:I,container:I,viewport:I,adjust:{x:0,y:0,mouse:W,scroll:W,resize:W,method:"flipinvert flipinvert"},effect:function(t,e,i){s(this).animate(e,{duration:200,queue:I})}},show:{target:I,event:"mouseenter",effect:W,delay:90,solo:I,ready:I,autofocus:I},hide:{target:I,event:"mouseleave",effect:W,delay:0,fixed:I,inactive:I,leave:"window",distance:I},style:{classes:"",widget:I,width:I,height:I,def:W},events:{render:k,move:k,show:k,hide:k,toggle:k,visible:k,hidden:k,focus:k,blur:k}};var at,ht="margin",lt="border",ct="color",dt="background-color",pt="transparent",ut=" !important",ft=!!e.createElement("canvas").getContext,gt=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,mt={},vt=["Webkit","O","Moz","ms"];if(ft)var yt=t.devicePixelRatio||1,bt=function(){var t=e.createElement("canvas").getContext("2d");return t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||1}(),wt=yt/bt;else var _t=function(t,e,i){return"<qtipvml:"+t+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(e||"")+' style="behavior: url(#default#VML); '+(i||"")+'" />'};s.extend(_.prototype,{init:function(t){var e,i;i=this.element=t.elements.tip=s("<div />",{"class":R+"-tip"}).prependTo(t.tooltip),ft?(e=s("<canvas />").appendTo(this.element)[0].getContext("2d"),e.lineJoin="miter",e.miterLimit=1e5,e.save()):(e=_t("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(e+e),t._bind(s("*",i).add(i),["click","mousedown"],function(t){t.stopPropagation()},this._ns)),t._bind(t.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(t){var e=this.qtip.elements.titlebar;return e&&(t.y===P||t.y===N&&this.element.position().top+this.size[1]/2+this.options.offset<e.outerHeight(W))},_parseCorner:function(t){var e=this.qtip.options.position.my;return t===I||e===I?t=I:t===W?t=new j(e.string()):t.string||(t=new j(t),t.fixed=W),t},_parseWidth:function(t,e,i){var s=this.qtip.elements,o=lt+y(e)+"Width";return(i?w(i,o):w(s.content,o)||w(this._useTitle(t)&&s.titlebar||s.content,o)||w(s.tooltip,o))||0},_parseRadius:function(t){var e=this.qtip.elements,i=lt+y(t.y)+y(t.x)+"Radius";return st.ie<9?0:w(this._useTitle(t)&&e.titlebar||e.content,i)||w(e.tooltip,i)||0},_invalidColour:function(t,e,i){var s=t.css(e);return!s||i&&s===t.css(i)||gt.test(s)?I:s},_parseColours:function(t){var e=this.qtip.elements,i=this.element.css("cssText",""),o=lt+y(t[t.precedance])+y(ct),n=this._useTitle(t)&&e.titlebar||e.content,r=this._invalidColour,a=[];return a[0]=r(i,dt)||r(n,dt)||r(e.content,dt)||r(e.tooltip,dt)||i.css(dt),a[1]=r(i,o,ct)||r(n,o,ct)||r(e.content,o,ct)||r(e.tooltip,o,ct)||e.tooltip.css(o),s("*",i).add(i).css("cssText",dt+":"+pt+ut+";"+lt+":0"+ut+";"),a},_calculateSize:function(t){var e,i,s,o=t.precedance===S,n=this.options.width,r=this.options.height,a="c"===t.abbrev(),h=(o?n:r)*(a?.5:1),l=Math.pow,c=Math.round,d=Math.sqrt(l(h,2)+l(r,2)),p=[this.border/h*d,this.border/r*d];return p[2]=Math.sqrt(l(p[0],2)-l(this.border,2)),p[3]=Math.sqrt(l(p[1],2)-l(this.border,2)),e=d+p[2]+p[3]+(a?0:p[0]),i=e/d,s=[c(i*n),c(i*r)],o?s:s.reverse()},_calculateTip:function(t,e,i){i=i||1,e=e||this.size;var s=e[0]*i,o=e[1]*i,n=Math.ceil(s/2),r=Math.ceil(o/2),a={br:[0,0,s,o,s,0],bl:[0,0,s,0,0,o],tr:[0,o,s,0,s,o],tl:[0,0,0,o,s,o],tc:[0,o,n,0,s,o],bc:[0,0,s,0,n,o],rc:[0,0,s,r,0,o],lc:[s,0,s,o,0,r]};return a.lt=a.br,a.rt=a.bl,a.lb=a.tr,a.rb=a.tl,a[t.abbrev()]},_drawCoords:function(t,e){t.beginPath(),t.moveTo(e[0],e[1]),t.lineTo(e[2],e[3]),t.lineTo(e[4],e[5]),t.closePath()},create:function(){var t=this.corner=(ft||st.ie)&&this._parseCorner(this.options.corner);return(this.enabled=!!this.corner&&"c"!==this.corner.abbrev())&&(this.qtip.cache.corner=t.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(e,i){if(!this.enabled)return this;var o,n,r,a,h,l,c,d,p=this.qtip.elements,u=this.element,f=u.children(),g=this.options,m=this.size,v=g.mimic,y=Math.round;e||(e=this.qtip.cache.corner||this.corner),v===I?v=e:(v=new j(v),v.precedance=e.precedance,"inherit"===v.x?v.x=e.x:"inherit"===v.y?v.y=e.y:v.x===v.y&&(v[e.precedance]=e[e.precedance])),n=v.precedance,e.precedance===E?this._swapDimensions():this._resetDimensions(),o=this.color=this._parseColours(e),o[1]!==pt?(d=this.border=this._parseWidth(e,e[e.precedance]),g.border&&d<1&&!gt.test(o[1])&&(o[0]=o[1]),this.border=d=g.border!==W?g.border:d):this.border=d=0,c=this.size=this._calculateSize(e),u.css({width:c[0],height:c[1],lineHeight:c[1]+"px"}),l=e.precedance===S?[y(v.x===D?d:v.x===F?c[0]-m[0]-d:(c[0]-m[0])/2),y(v.y===P?c[1]-m[1]:0)]:[y(v.x===D?c[0]-m[0]:0),y(v.y===P?d:v.y===B?c[1]-m[1]-d:(c[1]-m[1])/2)],ft?(r=f[0].getContext("2d"),r.restore(),r.save(),r.clearRect(0,0,6e3,6e3),a=this._calculateTip(v,m,wt),h=this._calculateTip(v,this.size,wt),f.attr(A,c[0]*wt).attr(L,c[1]*wt),f.css(A,c[0]).css(L,c[1]),this._drawCoords(r,h),r.fillStyle=o[1],r.fill(),r.translate(l[0]*wt,l[1]*wt),this._drawCoords(r,a),r.fillStyle=o[0],r.fill()):(a=this._calculateTip(v),a="m"+a[0]+","+a[1]+" l"+a[2]+","+a[3]+" "+a[4]+","+a[5]+" xe",l[2]=d&&/^(r|b)/i.test(e.string())?8===st.ie?2:1:0,f.css({coordsize:c[0]+d+" "+(c[1]+d),antialias:""+(v.string().indexOf(N)>-1),left:l[0]-l[2]*Number(n===E),top:l[1]-l[2]*Number(n===S),width:c[0]+d,height:c[1]+d}).each(function(t){var e=s(this);e[e.prop?"prop":"attr"]({coordsize:c[0]+d+" "+(c[1]+d),path:a,fillcolor:o[0],filled:!!t,stroked:!t}).toggle(!(!d&&!t)),!t&&e.html(_t("stroke",'weight="'+2*d+'px" color="'+o[1]+'" miterlimit="1000" joinstyle="miter"'))})),t.opera&&setTimeout(function(){p.tip.css({display:"inline-block",visibility:"visible"})},1),i!==I&&this.calculate(e,c)},calculate:function(t,e){if(!this.enabled)return I;var i,o,n=this,r=this.qtip.elements,a=this.element,h=this.options.offset,l=(r.tooltip.hasClass("ui-widget"),
7
  {});return t=t||this.corner,i=t.precedance,e=e||this._calculateSize(t),o=[t.x,t.y],i===E&&o.reverse(),s.each(o,function(s,o){var a,c,d;o===N?(a=i===S?D:P,l[a]="50%",l[ht+"-"+a]=-Math.round(e[i===S?0:1]/2)+h):(a=n._parseWidth(t,o,r.tooltip),c=n._parseWidth(t,o,r.content),d=n._parseRadius(t),l[o]=Math.max(-n.border,s?c:h+(d>a?d:-a)))}),l[t[i]]-=e[i===E?0:1],a.css({margin:"",top:"",bottom:"",left:"",right:""}).css(l),l},reposition:function(t,e,s,o){function n(t,e,i,s,o){t===$&&c.precedance===e&&d[s]&&c[i]!==N?c.precedance=c.precedance===E?S:E:t!==$&&d[s]&&(c[e]=c[e]===N?d[s]>0?s:o:c[e]===s?o:s)}function r(t,e,o){c[t]===N?m[ht+"-"+e]=g[t]=a[ht+"-"+e]-d[e]:(h=a[o]!==i?[d[e],-a[e]]:[-d[e],a[e]],(g[t]=Math.max(h[0],h[1]))>h[0]&&(s[e]-=d[e],g[e]=I),m[a[o]!==i?o:e]=g[t])}if(this.enabled){var a,h,l=e.cache,c=this.corner.clone(),d=s.adjusted,p=e.options.position.adjust.method.split(" "),u=p[0],f=p[1]||p[0],g={left:I,top:I,x:0,y:0},m={};this.corner.fixed!==W&&(n(u,E,S,D,F),n(f,S,E,P,B),c.string()===l.corner.string()&&l.cornerTop===d.top&&l.cornerLeft===d.left||this.update(c,I)),a=this.calculate(c),a.right!==i&&(a.left=-a.right),a.bottom!==i&&(a.top=-a.bottom),a.user=this.offset,(g.left=u===$&&!!d.left)&&r(E,D,F),(g.top=f===$&&!!d.top)&&r(S,P,B),this.element.css(m).toggle(!(g.x&&g.y||c.x===N&&g.y||c.y===N&&g.x)),s.left-=a.left.charAt?a.user:u!==$||g.top||!g.left&&!g.top?a.left+this.border:0,s.top-=a.top.charAt?a.user:f!==$||g.left||!g.left&&!g.top?a.top+this.border:0,l.cornerLeft=d.left,l.cornerTop=d.top,l.corner=c.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),at=V.tip=function(t){return new _(t,t.options.style.tip)},at.initialize="render",at.sanitize=function(t){if(t.style&&"tip"in t.style){var e=t.style.tip;"object"!=typeof e&&(e=t.style.tip={corner:e}),/string|boolean/i.test(typeof e.corner)||(e.corner=W)}},z.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(t){this.size=[t.width,t.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},s.extend(W,q.defaults,{style:{tip:{corner:W,mimic:I,width:6,height:6,border:W,offset:0}}});var xt,Ct,qt="qtip-modal",Tt="."+qt;Ct=function(){function t(t){if(s.expr[":"].focusable)return s.expr[":"].focusable;var e,i,o,n=!isNaN(s.attr(t,"tabindex")),r=t.nodeName&&t.nodeName.toLowerCase();return"area"===r?(e=t.parentNode,i=e.name,!(!t.href||!i||"map"!==e.nodeName.toLowerCase())&&(o=s("img[usemap=#"+i+"]")[0],!!o&&o.is(":visible"))):/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||n:n}function i(t){c.length<1&&t.length?t.not("body").blur():c.first().focus()}function o(t){if(h.is(":visible")){var e,o=s(t.target),a=n.tooltip,l=o.closest(G);e=l.length<1?I:parseInt(l[0].style.zIndex,10)>parseInt(a[0].style.zIndex,10),e||o.closest(G)[0]===a[0]||i(o),r=t.target===c[c.length-1]}}var n,r,a,h,l=this,c={};s.extend(l,{init:function(){return h=l.elem=s("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return I}}).hide(),s(e.body).bind("focusin"+Tt,o),s(e).bind("keydown"+Tt,function(t){n&&n.options.show.modal.escape&&27===t.keyCode&&n.hide(t)}),h.bind("click"+Tt,function(t){n&&n.options.show.modal.blur&&n.hide(t)}),l},update:function(e){n=e,c=e.options.show.modal.stealfocus!==I?e.tooltip.find("*").filter(function(){return t(this)}):[]},toggle:function(t,o,r){var c=(s(e.body),t.tooltip),d=t.options.show.modal,p=d.effect,u=o?"show":"hide",f=h.is(":visible"),g=s(Tt).filter(":visible:not(:animated)").not(c);return l.update(t),o&&d.stealfocus!==I&&i(s(":focus")),h.toggleClass("blurs",d.blur),o&&h.appendTo(e.body),h.is(":animated")&&f===o&&a!==I||!o&&g.length?l:(h.stop(W,I),s.isFunction(p)?p.call(h,o):p===I?h[u]():h.fadeTo(parseInt(r,10)||90,o?1:0,function(){o||h.hide()}),o||h.queue(function(t){h.css({left:"",top:""}),s(Tt).length||h.detach(),t()}),a=o,n.destroyed&&(n=k),l)}}),l.init()},Ct=new Ct,s.extend(x.prototype,{init:function(t){var e=t.tooltip;return this.options.on?(t.elements.overlay=Ct.elem,e.addClass(qt).css("z-index",q.modal_zindex+s(Tt).length),t._bind(e,["tooltipshow","tooltiphide"],function(t,i,o){var n=t.originalEvent;if(t.target===e[0])if(n&&"tooltiphide"===t.type&&/mouse(leave|enter)/.test(n.type)&&s(n.relatedTarget).closest(Ct.elem[0]).length)try{t.preventDefault()}catch(r){}else(!n||n&&"tooltipsolo"!==n.type)&&this.toggle(t,"tooltipshow"===t.type,o)},this._ns,this),t._bind(e,"tooltipfocus",function(t,i){if(!t.isDefaultPrevented()&&t.target===e[0]){var o=s(Tt),n=q.modal_zindex+o.length,r=parseInt(e[0].style.zIndex,10);Ct.elem[0].style.zIndex=n-1,o.each(function(){this.style.zIndex>r&&(this.style.zIndex-=1)}),o.filter("."+K).qtip("blur",t.originalEvent),e.addClass(K)[0].style.zIndex=n,Ct.update(i);try{t.preventDefault()}catch(a){}}},this._ns,this),void t._bind(e,"tooltiphide",function(t){t.target===e[0]&&s(Tt).filter(":visible").not(e).last().qtip("focus",t)},this._ns,this)):this},toggle:function(t,e,i){return t&&t.isDefaultPrevented()?this:void Ct.toggle(this.qtip,!!e,i)},destroy:function(){this.qtip.tooltip.removeClass(qt),this.qtip._unbind(this.qtip.tooltip,this._ns),Ct.toggle(this.qtip,I),delete this.qtip.elements.overlay}}),xt=V.modal=function(t){return new x(t,t.options.show.modal)},xt.sanitize=function(t){t.show&&("object"!=typeof t.show.modal?t.show.modal={on:!!t.show.modal}:"undefined"==typeof t.show.modal.on&&(t.show.modal.on=W))},q.modal_zindex=q.zindex-200,xt.initialize="render",z.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},s.extend(W,q.defaults,{show:{modal:{on:I,effect:W,blur:W,stealfocus:W,escape:W}}}),V.viewport=function(i,s,o,n,r,a,h){function l(t,e,i,o,n,r,a,h,l){var c=s[n],y=w[t],b=_[t],x=i===$,C=y===n?l:y===r?-l:-l/2,q=b===n?h:b===r?-h:-h/2,T=m[n]+v[n]-(u?0:p[n]),j=T-c,z=c+l-(a===A?f:g)-T,M=C-(w.precedance===t||y===w[e]?q:0)-(b===N?h/2:0);return x?(M=(y===n?1:-1)*C,s[n]+=j>0?j:z>0?-z:0,s[n]=Math.max(-p[n]+v[n],c-M,Math.min(Math.max(-p[n]+v[n]+(a===A?f:g),c+M),s[n],"center"===y?c-C:1e9))):(o*=i===O?2:0,j>0&&(y!==n||z>0)?(s[n]-=M+o,d.invert(t,n)):z>0&&(y!==r||j>0)&&(s[n]-=(y===N?-M:M)+o,d.invert(t,r)),s[n]<m&&-s[n]>z&&(s[n]=c,d=w.clone())),s[n]-c}var c,d,p,u,f,g,m,v,y=o.target,b=i.elements.tooltip,w=o.my,_=o.at,x=o.adjust,C=x.method.split(" "),q=C[0],T=C[1]||C[0],j=o.viewport,z=o.container,M=(i.cache,{left:0,top:0});return j.jquery&&y[0]!==t&&y[0]!==e.body&&"none"!==x.method?(p=z.offset()||M,u="static"===z.css("position"),c="fixed"===b.css("position"),f=j[0]===t?j.width():j.outerWidth(I),g=j[0]===t?j.height():j.outerHeight(I),m={left:c?0:j.scrollLeft(),top:c?0:j.scrollTop()},v=j.offset()||M,"shift"===q&&"shift"===T||(d=w.clone()),M={left:"none"!==q?l(E,S,q,x.x,D,F,A,n,a):0,top:"none"!==T?l(S,E,T,x.y,P,B,L,r,h):0,my:d}):M},V.polys={polygon:function(t,e){var i,s,o,n={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:I},r=0,a=[],h=1,l=1,c=0,d=0;for(r=t.length;r--;)i=[parseInt(t[--r],10),parseInt(t[r+1],10)],i[0]>n.position.right&&(n.position.right=i[0]),i[0]<n.position.left&&(n.position.left=i[0]),i[1]>n.position.bottom&&(n.position.bottom=i[1]),i[1]<n.position.top&&(n.position.top=i[1]),a.push(i);if(s=n.width=Math.abs(n.position.right-n.position.left),o=n.height=Math.abs(n.position.bottom-n.position.top),"c"===e.abbrev())n.position={left:n.position.left+n.width/2,top:n.position.top+n.height/2};else{for(;s>0&&o>0&&h>0&&l>0;)for(s=Math.floor(s/2),o=Math.floor(o/2),e.x===D?h=s:e.x===F?h=n.width-s:h+=Math.floor(s/2),e.y===P?l=o:e.y===B?l=n.height-o:l+=Math.floor(o/2),r=a.length;r--&&!(a.length<2);)c=a[r][0]-n.position.left,d=a[r][1]-n.position.top,(e.x===D&&c>=h||e.x===F&&c<=h||e.x===N&&(c<h||c>n.width-h)||e.y===P&&d>=l||e.y===B&&d<=l||e.y===N&&(d<l||d>n.height-l))&&a.splice(r,1);n.position={left:a[0][0],top:a[0][1]}}return n},rect:function(t,e,i,s){return{width:Math.abs(i-t),height:Math.abs(s-e),position:{left:Math.min(t,i),top:Math.min(e,s)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(t,e,i,s,o){var n=V.polys._angles[o.abbrev()],r=0===n?0:i*Math.cos(n*Math.PI),a=s*Math.sin(n*Math.PI);return{width:2*i-Math.abs(r),height:2*s-Math.abs(a),position:{left:t+r,top:e+a},adjustable:I}},circle:function(t,e,i,s){return V.polys.ellipse(t,e,i,i,s)}},V.svg=function(t,i,o){for(var n,r,a,h,l,c,d,p,u,f=(s(e),i[0]),g=s(f.ownerSVGElement),m=f.ownerDocument,v=(parseInt(i.css("stroke-width"),10)||0)/2;!f.getBBox;)f=f.parentNode;if(!f.getBBox||!f.parentNode)return I;switch(f.nodeName){case"ellipse":case"circle":p=V.polys.ellipse(f.cx.baseVal.value,f.cy.baseVal.value,(f.rx||f.r).baseVal.value+v,(f.ry||f.r).baseVal.value+v,o);break;case"line":case"polygon":case"polyline":for(d=f.points||[{x:f.x1.baseVal.value,y:f.y1.baseVal.value},{x:f.x2.baseVal.value,y:f.y2.baseVal.value}],p=[],c=-1,h=d.numberOfItems||d.length;++c<h;)l=d.getItem?d.getItem(c):d[c],p.push.apply(p,[l.x,l.y]);p=V.polys.polygon(p,o);break;default:p=f.getBBox(),p={width:p.width,height:p.height,position:{left:p.x,top:p.y}}}return u=p.position,g=g[0],g.createSVGPoint&&(r=f.getScreenCTM(),d=g.createSVGPoint(),d.x=u.left,d.y=u.top,a=d.matrixTransform(r),u.left=a.x,u.top=a.y),m!==e&&"mouse"!==t.position.target&&(n=s((m.defaultView||m.parentWindow).frameElement).offset(),n&&(u.left+=n.left,u.top+=n.top)),m=s(m),u.left+=m.scrollLeft(),u.top+=m.scrollTop(),p},V.imagemap=function(t,e,i,o){e.jquery||(e=s(e));var n,r,a,h,l,c=(e.attr("shape")||"rect").toLowerCase().replace("poly","polygon"),d=s('img[usemap="#'+e.parent("map").attr("name")+'"]'),p=s.trim(e.attr("coords")),u=p.replace(/,$/,"").split(",");if(!d.length)return I;if("polygon"===c)h=V.polys.polygon(u,i);else{if(!V.polys[c])return I;for(a=-1,l=u.length,r=[];++a<l;)r.push(parseInt(u[a],10));h=V.polys[c].apply(this,r.concat(i))}return n=d.offset(),n.left+=Math.ceil((d.outerWidth(I)-d.width())/2),n.top+=Math.ceil((d.outerHeight(I)-d.height())/2),h.position.left+=n.left,h.position.top+=n.top,h};var jt,zt='<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>';s.extend(C.prototype,{_scroll:function(){var e=this.qtip.elements.overlay;e&&(e[0].style.top=s(t).scrollTop()+"px")},init:function(i){var o=i.tooltip;s("select, object").length<1&&(this.bgiframe=i.elements.bgiframe=s(zt).appendTo(o),i._bind(o,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=s("<div/>",{id:R+"-rcontainer"}).appendTo(e.body),i.elements.overlay&&i.elements.overlay.addClass("qtipmodal-ie6fix")&&(i._bind(t,["scroll","resize"],this._scroll,this._ns,this),i._bind(o,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var t,e,i=this.qtip.tooltip,s={height:i.outerHeight(I),width:i.outerWidth(I)},o=this.qtip.plugins.tip,n=this.qtip.elements.tip;e=parseInt(i.css("borderLeftWidth"),10)||0,e={left:-e,top:-e},o&&n&&(t="x"===o.corner.precedance?[A,D]:[L,P],e[t[1]]-=n[t[0]]()),this.bgiframe.css(e).css(s)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var t,e,i,s,o=this.qtip.tooltip,n=this.qtip.options.style,r=this.qtip.options.position.container;return this.qtip.drawing=1,n.height&&o.css(L,n.height),n.width?o.css(A,n.width):(o.css(A,"").appendTo(this.redrawContainer),e=o.width(),e%2<1&&(e+=1),i=o.css("maxWidth")||"",s=o.css("minWidth")||"",t=(i+s).indexOf("%")>-1?r.width()/100:0,i=(i.indexOf("%")>-1?t:1)*parseInt(i,10)||e,s=(s.indexOf("%")>-1?t:1)*parseInt(s,10)||0,e=i+s?Math.min(Math.max(e,s),i):e,o.css(A,Math.round(e)).appendTo(r)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([t,this.qtip.tooltip],this._ns)}}),jt=V.ie6=function(t){return 6===st.ie?new C(t):I},jt.initialize="render",z.ie6={"^content|style$":function(){this.redraw()}}})}(window,document);
8
- function give_load_gateway(e,i){var t=jQuery(e).find("#give-payment-mode-select .give-loading-text"),a=jQuery(e).find("#give-amount").val(),n=jQuery(e).find('input[name="give-form-id"]').val();t.fadeIn();var o=jQuery(e).data();1!=o["blockUI.isBlocked"]&&jQuery(e).find("#give_purchase_form_wrap").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),jQuery.post(give_scripts.ajaxurl+"?payment-mode="+i,{action:"give_load_gateway",give_total:a,give_form_id:n,give_payment_mode:i},function(i){jQuery(e).unblock(),jQuery(e).find("#give_purchase_form_wrap").html(i),jQuery(".give-no-js").hide(),jQuery(e).find("#give-payment-mode-select .give-loading-text").fadeOut(),setup_give_tooltips(),jQuery(document).trigger("give_gateway_loaded",[i,jQuery(e).attr("id")])})}function setup_give_tooltips(){jQuery('[data-tooltip!=""]').qtip({content:{attr:"data-tooltip"},style:{classes:"qtip-rounded qtip-tipsy"},position:{my:"bottom center",at:"top center"}}),jQuery.fn.qtip.zindex=2147483641}var give_scripts,give_global_vars;jQuery(document).ready(function(e){setup_give_tooltips(),e(".give-loading-text").hide(),e(document).on("click",".give-checkout-login",function(i){var t=e(this),a=e(this).parents("form"),n=e(a).find('[id^="give-checkout-login-register"] .give-loading-text'),o={action:t.data("action"),form_id:e(a).find('[name="give-form-id"]').val()};return n.show(),e.post(give_scripts.ajaxurl,o,function(i){e(a).find("[id^=give-checkout-login-register]").html(i),e(a).find(".give-submit-button-wrap").hide()}).done(function(){n.hide(),give_fl_trigger(),setup_give_tooltips()}),!1}),e(document).on("click",".give-checkout-register-cancel",function(i){i.preventDefault();var t=e(this),a=e(this).parents("form"),n={action:t.data("action"),form_id:e(a).find('[name="give-form-id"]').val()};e.post(give_scripts.ajaxurl,n,function(i){e(a).find("[id^=give-checkout-login-register]").html(e.parseJSON(i.fields)),e(a).find(".give-submit-button-wrap").show()}).done(function(){give_fl_trigger(),setup_give_tooltips()})}),e(document).on("click","[id^=give-login-fields] input[type=submit]",function(i){i.preventDefault();var t=e(this).val(),a=e(this).parents("form");e(this).val(give_global_vars.purchase_loading),a.find("[id^=give-login-fields] .give-loading-animation").fadeIn();var n={action:"give_process_donation_login",give_ajax:1,give_user_login:a.find("[name=give_user_login]").val(),give_user_pass:a.find("[name=give_user_pass]").val()};e.post(give_global_vars.ajaxurl,n,function(i){"success"==e.trim(i)?(a.find(".give_errors").remove(),give_load_gateway(a,a.find(".give-gateway-option-selected input").val())):(a.find("[id^=give-login-fields] input[type=submit]").val(t),a.find(".give-loading-animation").fadeOut(),a.find(".give_errors").remove(),a.find("[id^=give-user-login-submit]").before(i))})}),e("select#give-gateway, input.give-gateway").on("change",function(i){i.preventDefault();var t=e(this).val();return"0"==t?(console.log("There was a problem loading the selected gateway"),!1):(give_load_gateway(e(this).parents("form"),t),!1)}),e("body").on("click touchend",'form.give-form input[name="give-purchase"].give-submit',function(i){var t=e(this).parents("form.give-form"),a=t.find('input[type="submit"].give-submit + .give-loading-animation');a.fadeIn();var n=t.get(0);if("function"!=typeof n.checkValidity||n.checkValidity()!==!1||(a.fadeOut(),(navigator.userAgent.indexOf("Safari")!=-1&&navigator.userAgent.indexOf("Chrome")==-1)!=!1)){i.preventDefault();var o=e(this).val();e(this).val(give_global_vars.purchase_loading),e.post(give_global_vars.ajaxurl,t.serialize()+"&action=give_process_donation&give_ajax=true",function(i){"success"==e.trim(i)?(t.find(".give_errors").remove(),e(n).submit(),t.trigger("give_form_validation_passed")):(t.find('input[type="submit"].give-submit').val(o),a.fadeOut(),t.find(".give_errors").remove(),t.find('input[type="submit"].give-submit').before(i))})}})});
9
  var give_scripts,give_global_vars;jQuery(function(e){function a(){var a=e(this),i=a.parents("form");if("card_state"!=a.attr("id")){i.find("#card_state").empty().append('<option value="1">'+give_global_vars.general_loading+"</option>").prop("disabled",!0);var t={action:"give_get_states",country:a.val(),field_name:"card_state"};e.ajax({type:"POST",data:t,url:give_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(e){if("nostates"==e){var a='<input type="text" id="card_state" name="card_state" class="cart-state give-input required" value=""/>';i.find('input[name="card_state"], select[name="card_state"]').replaceWith(a)}else i.find('input[name="card_state"], select[name="card_state"]').replaceWith(e);v.trigger("give_checkout_billing_address_updated",[e,i.attr("id")])}}).fail(function(e){window.console&&window.console.log&&console.log(e)})}return!1}function i(){var a=e("form.give-form");a.each(function(a,i){i=e(i);var t=i.find(".card-number"),n=i.find(".card-cvc"),o=i.find(".card-expiry");t.length&&(t.payment("formatCardNumber"),n.payment("formatCardCVC"),o.payment("formatCardExpiry"))})}function t(e,a){return"after"==give_global_vars.currency_pos&&(a.format="%v%s"),accounting.formatMoney(e,a).trim()}function n(e){return Math.abs(parseFloat(accounting.unformat(e,give_global_vars.decimal_separator)))}function o(e){var a={symbol:"",decimal:give_global_vars.decimal_separator,thousand:give_global_vars.thousands_separator,precision:give_global_vars.number_decimals};return accounting.formatMoney(e,a)}function r(a){var i=[];return a.hasClass("give-form-type-multi")?(e.each(a.find(".give-donation-levels-wrap [data-price-id] "),function(e,a){a=a instanceof jQuery?a:jQuery(a),i.push({price_id:a.data("price-id"),amount:n(a.val())})}),i):i}function d(a){var i=a.parents("form"),t=a.val(),o=a.data("price-id");return void 0==o&&(o=a.find("option:selected").data("price-id")),"custom"===t?(i.find(".give-amount-top").val("").focus(),!1):(i.find(".give-amount-top").val(t),i.find("span.give-amount-top").text(t),e(".give-donation-amount .give-text-input",i).data("amount",n(i.find(".give-final-total-amount").data("total"))),i.find(".give-donation-amount .give-text-input").trigger("blur",[i,t,o]),void e(document).trigger("give_donation_value_updated",[i,t,o]))}function l(){var a=s("form-id"),i=s("payment-mode");if(!a||!i)return!1;var t=e("body").find("#give-form-"+a+"-wrap"),n=t.find("form.give-form"),o=t.hasClass("give-display-modal"),r=t.hasClass("give-display-reveal");n.find("#give-gateway-radio-list label").removeClass("give-gateway-option-selected"),n.find("input[name=payment-mode][value="+i+"]").prop("checked",!0).parent().addClass("give-gateway-option-selected");var l=s("level-id"),v=n.find('*[data-price-id="'+l+'"]');v.length>0&&d(v),o?give_open_form_modal(t,n):r&&(n.find(".give-btn-reveal").hide(),n.find("#give-payment-mode-select, #give_purchase_form_wrap").slideDown())}function s(e,a){a||(a=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),t=i.exec(a);return t?t[2]?decodeURIComponent(t[2].replace(/\+/g," ")):"":null}var v=e(document);v.on("change","#give_cc_address input.card_state, #give_cc_address select",a),i(),v.on("give_gateway_loaded",function(e){i()}),e.fn.toggleError=function(e){return this.toggleClass("error",e),this.toggleClass("valid",!e),this},v.on("keyup change focusout",".give-form .card-number, .give-form .card-cvc, .give-form .card-expiry",function(a){var i=e(this),t=i.parents("form.give-form"),n=i.attr("id"),o=t.find(".card-number"),r=t.find(".card-cvc"),d=t.find(".card-expiry"),l=e.payment.cardType(o.val()),s=!1;switch(a.type){case"focusout":n.indexOf("card_number")>-1?(s=!e.payment.validateCardNumber(o.val()),o.toggleError(s)):n.indexOf("card_cvc")>-1?(s=!e.payment.validateCardCVC(r.val(),l),r.toggleError(s)):n.indexOf("card_expiry")>-1&&(s=!e.payment.validateCardExpiry(d.payment("cardExpiryVal")),d.toggleError(s)),i.parents("form").find(".give-submit").prop("disabled",s);break;default:if(i.hasClass("error")&&i.removeClass("error"),n.indexOf("card_number")>-1){var v=t.find(".card-type");null===l?(v.removeClass().addClass("off card-type"),i.removeClass("valid").addClass("error")):v.removeClass().addClass("card-type "+l)}else if(n.indexOf("card_expiry")>-1){var c=d.payment("cardExpiryVal");t.find(".card-expiry-month").val(c.month),t.find(".card-expiry-year").val(c.year)}}}),v.on("submit","#give_payment_mode",function(){var a=e("#give-gateway option:selected").val();if(0==a)return alert(give_global_vars.no_gateway),!1}),v.on("click","#give-payment-mode-select input",function(){var a=e(this).parents("form"),i=e("#give-payment-mode-select li"),t=e('#give-payment-mode-select li.give-gateway-option-selected input[name="payment-mode"]').val(),n="";i.removeClass("give-gateway-option-selected"),i.prop("checked",!1),e(this).prop("checked",!0),e(this).parent().addClass("give-gateway-option-selected"),n=e('#give-payment-mode-select li.give-gateway-option-selected input[name="payment-mode"]').val(),a.attr("action",a.attr("action").replace("payment-mode="+t,"payment-mode="+n))}),v.on("focus",".give-donation-amount .give-text-input",function(a){var i=e(this).parents("form");e(this).removeClass("invalid-amount");var t=i.find(".give-final-total-amount").data("total");e(this).data("amount",n(t)),e(this).parent(".give-donation-amount").addClass("give-custom-amount-focus-in"),i.find(".give-default-level, .give-radio-input").removeClass("give-default-level"),i.find(".give-btn-level-custom").addClass("give-default-level"),i.find(".give-radio-input").prop("checked",!1),i.find(".give-radio-input.give-radio-level-custom").prop("checked",!0),i.find(".give-select-level").prop("selected",!1),i.find(".give-select-level .give-donation-level-custom").prop("selected",!0)}),v.on("blur",".give-donation-amount .give-text-input",function(a,i,d,l){var s=void 0!=i?i:e(this).closest("form"),v=e(this).data("amount"),c=void 0!=d?d:e(this).val(),g=s.find('input[name="give-form-minimum"]'),u=n(g.val()),m=0==c?u:n(c),p=r(e(this).parents("form")),f="";l=void 0!=l?l:-1;var _={symbol:"",decimal:give_global_vars.decimal_separator,thousand:give_global_vars.thousands_separator,precision:give_global_vars.number_decimals},h=t(m,_);if(e(this).val(h),!p.length||-1<l||(e.each(p,function(e,a){if(a.amount===m)return l=a.price_id,!1}),!(-1<l)&&u<=m&&(l="custom")),(m<u||m<1)&&-1===l){e(this).addClass("give-invalid-amount"),_.symbol=give_global_vars.currency_sign,f=give_global_vars.bad_minimum+" "+t(u,_),s.find(".give-submit").prop("disabled",!0);var y=s.find(".give-invalid-minimum");if(0===y.length){var b=e('<div class="give_error give-invalid-minimum">'+f+"</div>").hide();b.insertBefore(s.find(".give-total-wrap")).show()}}else e(this).removeClass("give-invalid-amount"),s.find(".give-invalid-minimum").slideUp(300,function(){e(this).remove()}),s.find(".give-submit").prop("disabled",!1);if(v!==m&&(_.symbol=give_global_vars.currency_sign,s.find(".give-final-total-amount").data("total",m).text(t(m,_))),-1!==l)switch(e('input[name="give-price-id"]',s).val(l),s.find(".give-amount-hidden").val(o(m)),s.find(".give-default-level").removeClass("give-default-level"),!0){case!!s.find(".give-radio-input").length:s.find(".give-radio-input").prop("checked",!1),s.find('.give-radio-input[data-price-id="'+l+'"]').prop("checked",!0).addClass("give-default-level");break;case!!s.find("button.give-donation-level-btn").length:s.find("button.give-donation-level-btn").blur(),s.find('button.give-donation-level-btn[data-price-id="'+l+'"]').focus().addClass("give-default-level");break;case!!s.find("select.give-select-level").length:s.find("select.give-select-level option").prop("selected",!1),s.find('select.give-select-level option[data-price-id="'+l+'"]').prop("selected",!0).addClass("give-default-level")}e(this).parent(".give-donation-amount").removeClass("give-custom-amount-focus-in")}),v.on("click touchend",".give-donation-level-btn",function(a){a.preventDefault(),d(e(this))}),v.on("click touchend",".give-radio-input-level",function(a){d(e(this))}),v.on("change",".give-select-level",function(a){d(e(this))}),l(),v.on("click",".give_terms_links",function(a){a.preventDefault();var i=e(this).closest("fieldset");return e("[class^=give_terms-]",i).slideToggle(),e("a.give_terms_links",i).toggle(),!1})});
10
  function give_open_form_modal(e,t){var n="#give_purchase_form_wrap, #give-payment-mode-select, .mfp-close, .give-hidden";jQuery.magnificPopup.open({mainClass:give_global_vars.magnific_options.main_class,closeOnBgClick:give_global_vars.magnific_options.close_on_bg_click,fixedContentPos:!0,fixedBgPos:!0,items:{src:t,type:"inline"},callbacks:{beforeOpen:function(){if(e.hasClass("give-display-button-only")&&!t.data("content")){var n=jQuery(".give-form-content-wrap",e),i=jQuery(".give-form-title",e),r=jQuery(".give-goal-progress",e),a=jQuery(">.give_error",e),o=jQuery(".give_errors",e);n.length&&!jQuery(".give-form-content-wrap",t).length&&(n.hasClass("give_post_form-content")?t.append(n):t.prepend(n)),o.length&&!jQuery(".give_errors",t).length&&o.each(function(e,n){t.prepend(jQuery(n))}),a.length&&!jQuery(">.give_error",t).length&&a.each(function(e,n){t.prepend(jQuery(n))}),r.length&&!jQuery(".give-goal-progress",t).length&&t.prepend(r),i.length&&!jQuery(".give-form-title",t).length&&t.prepend(i),t.data("content","loaded")}},open:function(){var i=jQuery(".mfp-content");i.outerWidth()>=500&&i.addClass("give-responsive-mfp-content"),e.hasClass("give-display-button-only")&&(n=t.children().not(".give-hidden, .give-btn-modal")),t.children().not(n).hide()},close:function(){t.removeClass("mfp-hide"),t.children().not(n).show()}}})}function give_fl_trigger(){var e={exclude:['#give-amount, .give-select-level, .multiselect, .give-repeater-table input, input[type="url"]'],customEvent:give_fl_custom_events};jQuery(".float-labels-enabled").floatlabels(e)}function give_fl_custom_events(e){e.hasClass("card-number")&&e.after('<span class="off card-type"/>')}function give_change_html5_form_field_validation_message(){var e,t=jQuery(".give-form");t.length&&jQuery.each(t,function(t,n){e=jQuery("input",n),e.length&&jQuery.each(e,function(e,t){t=jQuery(t).get(0),give_global_vars.form_translation.hasOwnProperty(t.name)&&(t.oninvalid=function(e){e.target.setCustomValidity(""),e.target.validity.valid||e.target.setCustomValidity(give_global_vars.form_translation[t.name])})})})}var give_scripts;jQuery(function(e){var t=e(document);give_fl_trigger(),give_change_html5_form_field_validation_message(),t.on("give_gateway_loaded",function(e,t,n){give_fl_trigger()}),t.on("give_checkout_billing_address_updated",function(t,n,i){var r=e("form#"+i);if(r.hasClass("float-labels-enabled")){var a=r.find("#give-card-state-wrap"),o=a.find("#card_state"),l=a.find('label[for="card_state"]');l=l.length?l.text().replace(/[*:]/g,"").trim():"","nostates"===n?o.attr("placeholder",l).parent().removeClass("styled select"):(o.children().first().text(l),o.parent().addClass("styled select")),o.parent().removeClass("is-active"),give_fl_trigger()}}),t.on("click",".give-btn-reveal",function(t){t.preventDefault();var n=e(this),i=e(this).parents("form"),r="#give-payment-mode-select",a=e(r),o="";return n.hide(),e("li",a).length>1&&(o=r+", "),i.find(o+"#give_purchase_form_wrap").slideDown(),!1}),t.on("click",".give-btn-modal",function(t){t.preventDefault();var n=e(this).parents("div.give-form-wrap"),i=n.find("form.give-form"),r=i.find("#give-amount"),a=r.val();return!a||a<=0?(r.focus(),!1):void give_open_form_modal(n,i)})});
5
  (function(){var t,e,n,r,a,i,o,l,u,s,c,h,p,f,g,v,d,m,y,C,T,w,$,D,S=[].slice,k=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};t=window.jQuery||window.Zepto||window.$,t.payment={},t.payment.fn={},t.fn.payment=function(){var e,n;return n=arguments[0],e=2<=arguments.length?S.call(arguments,1):[],t.payment.fn[n].apply(this,e)},a=/(\d{1,4})/g,t.payment.cards=r=[{type:"maestro",patterns:[5018,502,503,506,56,58,639,6220,67],format:a,length:[12,13,14,15,16,17,18,19],cvcLength:[3],luhn:!0},{type:"forbrugsforeningen",patterns:[600],format:a,length:[16],cvcLength:[3],luhn:!0},{type:"dankort",patterns:[5019],format:a,length:[16],cvcLength:[3],luhn:!0},{type:"visa",patterns:[4],format:a,length:[13,16],cvcLength:[3],luhn:!0},{type:"mastercard",patterns:[51,52,53,54,55,22,23,24,25,26,27],format:a,length:[16],cvcLength:[3],luhn:!0},{type:"amex",patterns:[34,37],format:/(\d{1,4})(\d{1,6})?(\d{1,5})?/,length:[15],cvcLength:[3,4],luhn:!0},{type:"dinersclub",patterns:[30,36,38,39],format:/(\d{1,4})(\d{1,6})?(\d{1,4})?/,length:[14],cvcLength:[3],luhn:!0},{type:"discover",patterns:[60,64,65,622],format:a,length:[16],cvcLength:[3],luhn:!0},{type:"unionpay",patterns:[62,88],format:a,length:[16,17,18,19],cvcLength:[3],luhn:!1},{type:"jcb",patterns:[35],format:a,length:[16],cvcLength:[3],luhn:!0}],e=function(t){var e,n,a,i,o,l,u,s;for(t=(t+"").replace(/\D/g,""),i=0,l=r.length;i<l;i++)for(e=r[i],s=e.patterns,o=0,u=s.length;o<u;o++)if(a=s[o],n=a+"",t.substr(0,n.length)===n)return e},n=function(t){var e,n,a;for(n=0,a=r.length;n<a;n++)if(e=r[n],e.type===t)return e},p=function(t){var e,n,r,a,i,o;for(r=!0,a=0,n=(t+"").split("").reverse(),i=0,o=n.length;i<o;i++)e=n[i],e=parseInt(e,10),(r=!r)&&(e*=2),e>9&&(e-=9),a+=e;return a%10===0},h=function(t){var e;return null!=t.prop("selectionStart")&&t.prop("selectionStart")!==t.prop("selectionEnd")||!(null==("undefined"!=typeof document&&null!==document&&null!=(e=document.selection)?e.createRange:void 0)||!document.selection.createRange().text)},$=function(t,e){var n,r,a,i,o,l;try{r=e.prop("selectionStart")}catch(u){i=u,r=null}if(o=e.val(),e.val(t),null!==r&&e.is(":focus"))return r===o.length&&(r=t.length),o!==t&&(l=o.slice(r-1,+r+1||9e9),n=t.slice(r-1,+r+1||9e9),a=t[r],/\d/.test(a)&&l===""+a+" "&&n===" "+a&&(r+=1)),e.prop("selectionStart",r),e.prop("selectionEnd",r)},m=function(t){var e,n,r,a,i,o,l,u;for(null==t&&(t=""),r="0123456789",a="0123456789",o="",e=t.split(""),l=0,u=e.length;l<u;l++)n=e[l],i=r.indexOf(n),i>-1&&(n=a[i]),o+=n;return o},d=function(e){var n;return n=t(e.currentTarget),setTimeout(function(){var t;return t=n.val(),t=m(t),t=t.replace(/\D/g,""),$(t,n)})},g=function(e){var n;return n=t(e.currentTarget),setTimeout(function(){var e;return e=n.val(),e=m(e),e=t.payment.formatCardNumber(e),$(e,n)})},l=function(n){var r,a,i,o,l,u,s;if(i=String.fromCharCode(n.which),/^\d+$/.test(i)&&(r=t(n.currentTarget),s=r.val(),a=e(s+i),o=(s.replace(/\D/g,"")+i).length,u=16,a&&(u=a.length[a.length.length-1]),!(o>=u||null!=r.prop("selectionStart")&&r.prop("selectionStart")!==s.length)))return l=a&&"amex"===a.type?/^(\d{4}|\d{4}\s\d{6})$/:/(?:^|\s)(\d{4})$/,l.test(s)?(n.preventDefault(),setTimeout(function(){return r.val(s+" "+i)})):l.test(s+i)?(n.preventDefault(),setTimeout(function(){return r.val(s+i+" ")})):void 0},i=function(e){var n,r;if(n=t(e.currentTarget),r=n.val(),8===e.which&&(null==n.prop("selectionStart")||n.prop("selectionStart")===r.length))return/\d\s$/.test(r)?(e.preventDefault(),setTimeout(function(){return n.val(r.replace(/\d\s$/,""))})):/\s\d?$/.test(r)?(e.preventDefault(),setTimeout(function(){return n.val(r.replace(/\d$/,""))})):void 0},v=function(e){var n;return n=t(e.currentTarget),setTimeout(function(){var e;return e=n.val(),e=m(e),e=t.payment.formatExpiry(e),$(e,n)})},u=function(e){var n,r,a;if(r=String.fromCharCode(e.which),/^\d+$/.test(r))return n=t(e.currentTarget),a=n.val()+r,/^\d$/.test(a)&&"0"!==a&&"1"!==a?(e.preventDefault(),setTimeout(function(){return n.val("0"+a+" / ")})):/^\d\d$/.test(a)?(e.preventDefault(),setTimeout(function(){var t,e;return t=parseInt(a[0],10),e=parseInt(a[1],10),e>2&&0!==t?n.val("0"+t+" / "+e):n.val(""+a+" / ")})):void 0},s=function(e){var n,r,a;if(r=String.fromCharCode(e.which),/^\d+$/.test(r))return n=t(e.currentTarget),a=n.val(),/^\d\d$/.test(a)?n.val(""+a+" / "):void 0},c=function(e){var n,r,a;if(a=String.fromCharCode(e.which),"/"===a||" "===a)return n=t(e.currentTarget),r=n.val(),/^\d$/.test(r)&&"0"!==r?n.val("0"+r+" / "):void 0},o=function(e){var n,r;if(n=t(e.currentTarget),r=n.val(),8===e.which&&(null==n.prop("selectionStart")||n.prop("selectionStart")===r.length))return/\d\s\/\s$/.test(r)?(e.preventDefault(),setTimeout(function(){return n.val(r.replace(/\d\s\/\s$/,""))})):void 0},f=function(e){var n;return n=t(e.currentTarget),setTimeout(function(){var t;return t=n.val(),t=m(t),t=t.replace(/\D/g,"").slice(0,4),$(t,n)})},w=function(t){var e;return!(!t.metaKey&&!t.ctrlKey)||32!==t.which&&(0===t.which||(t.which<33||(e=String.fromCharCode(t.which),!!/[\d\s]/.test(e))))},C=function(n){var r,a,i,o;if(r=t(n.currentTarget),i=String.fromCharCode(n.which),/^\d+$/.test(i)&&!h(r))return o=(r.val()+i).replace(/\D/g,""),a=e(o),a?o.length<=a.length[a.length.length-1]:o.length<=16},T=function(e){var n,r,a;if(n=t(e.currentTarget),r=String.fromCharCode(e.which),/^\d+$/.test(r)&&!h(n))return a=n.val()+r,a=a.replace(/\D/g,""),!(a.length>6)&&void 0},y=function(e){var n,r,a;if(n=t(e.currentTarget),r=String.fromCharCode(e.which),/^\d+$/.test(r)&&!h(n))return a=n.val()+r,a.length<=4},D=function(e){var n,a,i,o,l;if(n=t(e.currentTarget),l=n.val(),o=t.payment.cardType(l)||"unknown",!n.hasClass(o))return a=function(){var t,e,n;for(n=[],t=0,e=r.length;t<e;t++)i=r[t],n.push(i.type);return n}(),n.removeClass("unknown"),n.removeClass(a.join(" ")),n.addClass(o),n.toggleClass("identified","unknown"!==o),n.trigger("payment.cardType",o)},t.payment.fn.formatCardCVC=function(){return this.on("keypress",w),this.on("keypress",y),this.on("paste",f),this.on("change",f),this.on("input",f),this},t.payment.fn.formatCardExpiry=function(){return this.on("keypress",w),this.on("keypress",T),this.on("keypress",u),this.on("keypress",c),this.on("keypress",s),this.on("keydown",o),this.on("change",v),this.on("input",v),this},t.payment.fn.formatCardNumber=function(){return this.on("keypress",w),this.on("keypress",C),this.on("keypress",l),this.on("keydown",i),this.on("keyup",D),this.on("paste",g),this.on("change",g),this.on("input",g),this.on("input",D),this},t.payment.fn.restrictNumeric=function(){return this.on("keypress",w),this.on("paste",d),this.on("change",d),this.on("input",d),this},t.payment.fn.cardExpiryVal=function(){return t.payment.cardExpiryVal(t(this).val())},t.payment.cardExpiryVal=function(t){var e,n,r,a;return a=t.split(/[\s\/]+/,2),e=a[0],r=a[1],2===(null!=r?r.length:void 0)&&/^\d+$/.test(r)&&(n=(new Date).getFullYear(),n=n.toString().slice(0,2),r=n+r),e=parseInt(e,10),r=parseInt(r,10),{month:e,year:r}},t.payment.validateCardNumber=function(t){var n,r;return t=(t+"").replace(/\s+|-/g,""),!!/^\d+$/.test(t)&&(n=e(t),!!n&&(r=t.length,k.call(n.length,r)>=0&&(n.luhn===!1||p(t))))},t.payment.validateCardExpiry=function(e,n){var r,a,i;return"object"==typeof e&&"month"in e&&(i=e,e=i.month,n=i.year),!(!e||!n)&&(e=t.trim(e),n=t.trim(n),!!/^\d+$/.test(e)&&(!!/^\d+$/.test(n)&&(1<=e&&e<=12&&(2===n.length&&(n=n<70?"20"+n:"19"+n),4===n.length&&(a=new Date(n,e),r=new Date,a.setMonth(a.getMonth()-1),a.setMonth(a.getMonth()+1,1),a>r)))))},t.payment.validateCardCVC=function(e,r){var a,i;return e=t.trim(e),!!/^\d+$/.test(e)&&(a=n(r),null!=a?(i=e.length,k.call(a.cvcLength,i)>=0):e.length>=3&&e.length<=4)},t.payment.cardType=function(t){var n;return t?(null!=(n=e(t))?n.type:void 0)||null:null},t.payment.formatCardNumber=function(n){var r,a,i,o;return n=n.replace(/\D/g,""),(r=e(n))?(i=r.length[r.length.length-1],n=n.slice(0,i),r.format.global?null!=(o=n.match(r.format))?o.join(" "):void 0:(a=r.format.exec(n),null!=a?(a.shift(),a=t.grep(a,function(t){return t}),a.join(" ")):void 0)):n},t.payment.formatExpiry=function(t){var e,n,r,a;return(n=t.match(/^\D*(\d{1,2})(\D+)?(\d{1,4})?/))?(e=n[1]||"",r=n[2]||"",a=n[3]||"",a.length>0?r=" / ":" /"===r?(e=e.substring(0,1),r=""):2===e.length||r.length>0?r=" / ":1===e.length&&"0"!==e&&"1"!==e&&(e="0"+e,r=" / "),e+r+a):""}}).call(this);
6
  !function(t,e,i){!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.qtip&&t(jQuery)}(function(s){"use strict";function o(t,e,i,o){this.id=i,this.target=t,this.tooltip=k,this.elements={target:t},this._id=R+"-"+i,this.timers={img:{}},this.options=e,this.plugins={},this.cache={event:{},target:s(),disabled:I,attr:o,onTooltip:I,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=I}function n(t){return t===k||"object"!==s.type(t)}function r(t){return!(s.isFunction(t)||t&&t.attr||t.length||"object"===s.type(t)&&(t.jquery||t.then))}function a(t){var e,i,o,a;return n(t)?I:(n(t.metadata)&&(t.metadata={type:t.metadata}),"content"in t&&(e=t.content,n(e)||e.jquery||e.done?e=t.content={text:i=r(e)?I:e}:i=e.text,"ajax"in e&&(o=e.ajax,a=o&&o.once!==I,delete e.ajax,e.text=function(t,e){var n=i||s(this).attr(e.options.content.attr)||"Loading...",r=s.ajax(s.extend({},o,{context:e})).then(o.success,k,o.error).then(function(t){return t&&a&&e.set("content.text",t),t},function(t,i,s){e.destroyed||0===t.status||e.set("content.text",i+": "+s)});return a?n:(e.set("content.text",n),r)}),"title"in e&&(s.isPlainObject(e.title)&&(e.button=e.title.button,e.title=e.title.text),r(e.title||I)&&(e.title=I))),"position"in t&&n(t.position)&&(t.position={my:t.position,at:t.position}),"show"in t&&n(t.show)&&(t.show=t.show.jquery?{target:t.show}:t.show===W?{ready:W}:{event:t.show}),"hide"in t&&n(t.hide)&&(t.hide=t.hide.jquery?{target:t.hide}:{event:t.hide}),"style"in t&&n(t.style)&&(t.style={classes:t.style}),s.each(V,function(){this.sanitize&&this.sanitize(t)}),t)}function h(t,e){for(var i,s=0,o=t,n=e.split(".");o=o[n[s++]];)s<n.length&&(i=o);return[i||t,n.pop()]}function l(t,e){var i,s,o;for(i in this.checks)for(s in this.checks[i])(o=new RegExp(s,"i").exec(t))&&(e.push(o),("builtin"===i||this.plugins[i])&&this.checks[i][s].apply(this.plugins[i]||this,e))}function c(t){return Y.concat("").join(t?"-"+t+" ":" ")}function d(t,e){return e>0?setTimeout(s.proxy(t,this),e):void t.call(this)}function p(t){this.tooltip.hasClass(tt)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=d.call(this,function(){this.toggle(W,t)},this.options.show.delay))}function u(t){if(!this.tooltip.hasClass(tt)&&!this.destroyed){var e=s(t.relatedTarget),i=e.closest(G)[0]===this.tooltip[0],o=e[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==e[0]&&"mouse"===this.options.position.target&&i||this.options.hide.fixed&&/mouse(out|leave|move)/.test(t.type)&&(i||o))try{t.preventDefault(),t.stopImmediatePropagation()}catch(n){}else this.timers.hide=d.call(this,function(){this.toggle(I,t)},this.options.hide.delay,this)}}function f(t){!this.tooltip.hasClass(tt)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=d.call(this,function(){this.hide(t)},this.options.hide.inactive))}function g(t){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(t)}function m(t,i,o){s(e.body).delegate(t,(i.split?i:i.join("."+R+" "))+"."+R,function(){var t=q.api[s.attr(this,X)];t&&!t.disabled&&o.apply(t,arguments)})}function v(t,i,n){var r,h,l,c,d,p=s(e.body),u=t[0]===e?p:t,f=t.metadata?t.metadata(n.metadata):k,g="html5"===n.metadata.type&&f?f[n.metadata.name]:k,m=t.data(n.metadata.name||"qtipopts");try{m="string"==typeof m?s.parseJSON(m):m}catch(v){}if(c=s.extend(W,{},q.defaults,n,"object"==typeof m?a(m):k,a(g||f)),h=c.position,c.id=i,"boolean"==typeof c.content.text){if(l=t.attr(c.content.attr),c.content.attr===I||!l)return I;c.content.text=l}if(h.container.length||(h.container=p),h.target===I&&(h.target=u),c.show.target===I&&(c.show.target=u),c.show.solo===W&&(c.show.solo=h.container.closest("body")),c.hide.target===I&&(c.hide.target=u),c.position.viewport===W&&(c.position.viewport=h.container),h.container=h.container.eq(0),h.at=new j(h.at,W),h.my=new j(h.my),t.data(R))if(c.overwrite)t.qtip("destroy",!0);else if(c.overwrite===I)return I;return t.attr(H,i),c.suppress&&(d=t.attr("title"))&&t.removeAttr("title").attr(it,d).attr("title",""),r=new o(t,c,i,(!!l)),t.data(R,r),r}function y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function b(t,e){var s,o,n=e.charAt(0).toUpperCase()+e.slice(1),r=(e+" "+vt.join(n+" ")+n).split(" "),a=0;if(mt[e])return t.css(mt[e]);for(;s=r[a++];)if((o=t.css(s))!==i)return mt[e]=s,o}function w(t,e){return Math.ceil(parseFloat(b(t,e)))}function _(t,e){this._ns="tip",this.options=e,this.offset=e.offset,this.size=[e.width,e.height],this.init(this.qtip=t)}function x(t,e){this.options=e,this._ns="-modal",this.init(this.qtip=t)}function C(t,e){this._ns="ie6",this.init(this.qtip=t)}var q,T,j,z,M,W=!0,I=!1,k=null,E="x",S="y",A="width",L="height",P="top",D="left",B="bottom",F="right",N="center",O="flipinvert",$="shift",V={},R="qtip",H="data-hasqtip",X="data-qtip-id",Y=["ui-widget","ui-tooltip"],G="."+R,U="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Q=R+"-fixed",J=R+"-default",K=R+"-focus",Z=R+"-hover",tt=R+"-disabled",et="_replacedByqTip",it="oldtitle",st={ie:function(){for(var t=4,i=e.createElement("div");(i.innerHTML="<!--[if gt IE "+t+"]><i></i><![endif]-->")&&i.getElementsByTagName("i")[0];t+=1);return t>4?t: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("_",""))||I};T=o.prototype,T._when=function(t){return s.when.apply(s,t)},T.render=function(t){if(this.rendered||this.destroyed)return this;var e,i=this,o=this.options,n=this.cache,r=this.elements,a=o.content.text,h=o.content.title,l=o.content.button,c=o.position,d=("."+this._id+" ",[]);return s.attr(this.target[0],"aria-describedby",this._id),n.posClass=this._createPosClass((this.position={my:c.my,at:c.at}).my),this.tooltip=r.tooltip=e=s("<div/>",{id:this._id,"class":[R,J,o.style.classes,n.posClass].join(" "),width:o.style.width||"",height:o.style.height||"",tracking:"mouse"===c.target&&c.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":I,"aria-describedby":this._id+"-content","aria-hidden":W}).toggleClass(tt,this.disabled).attr(X,this.id).data(R,this).appendTo(c.container).append(r.content=s("<div />",{"class":R+"-content",id:this._id+"-content","aria-atomic":W})),this.rendered=-1,this.positioning=W,h&&(this._createTitle(),s.isFunction(h)||d.push(this._updateTitle(h,I))),l&&this._createButton(),s.isFunction(a)||d.push(this._updateContent(a,I)),this.rendered=W,this._setWidget(),s.each(V,function(t){var e;"render"===this.initialize&&(e=this(i))&&(i.plugins[t]=e)}),this._unassignEvents(),this._assignEvents(),this._when(d).then(function(){i._trigger("render"),i.positioning=I,i.hiddenDuringWait||!o.show.ready&&!t||i.toggle(W,n.event,I),i.hiddenDuringWait=I}),q.api[this.id]=this,this},T.destroy=function(t){function e(){if(!this.destroyed){this.destroyed=W;var t,e=this.target,i=e.attr(it);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),s.each(this.plugins,function(t){this.destroy&&this.destroy()});for(t in this.timers)clearTimeout(this.timers[t]);e.removeData(R).removeAttr(X).removeAttr(H).removeAttr("aria-describedby"),this.options.suppress&&i&&e.attr("title",i).removeAttr(it),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=k,delete q.api[this.id]}}return this.destroyed?this.target:(t===W&&"hide"!==this.triggering||!this.rendered?e.call(this):(this.tooltip.one("tooltiphidden",s.proxy(e,this)),!this.triggering&&this.hide()),this.target)},z=T.checks={builtin:{"^id$":function(t,e,i,o){var n=i===W?q.nextid:i,r=R+"-"+n;n!==I&&n.length>0&&!s("#"+r).length?(this._id=r,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):t[e]=o},"^prerender":function(t,e,i){i&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(t,e,i){this._updateContent(i)},"^content.attr$":function(t,e,i,s){this.options.content.text===this.target.attr(s)&&this._updateContent(this.target.attr(i))},"^content.title$":function(t,e,i){return i?(i&&!this.elements.title&&this._createTitle(),void this._updateTitle(i)):this._removeTitle()},"^content.button$":function(t,e,i){this._updateButton(i)},"^content.title.(text|button)$":function(t,e,i){this.set("content."+e,i)},"^position.(my|at)$":function(t,e,i){"string"==typeof i&&(this.position[e]=t[e]=new j(i,"at"===e))},"^position.container$":function(t,e,i){this.rendered&&this.tooltip.appendTo(i)},"^show.ready$":function(t,e,i){i&&(!this.rendered&&this.render(W)||this.toggle(W))},"^style.classes$":function(t,e,i,s){this.rendered&&this.tooltip.removeClass(s).addClass(i)},"^style.(width|height)":function(t,e,i){this.rendered&&this.tooltip.css(e,i)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(t,e,i){this.rendered&&this.tooltip.toggleClass(J,!!i)},"^events.(render|show|move|hide|focus|blur)$":function(t,e,i){this.rendered&&this.tooltip[(s.isFunction(i)?"":"un")+"bind"]("tooltip"+e,i)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var t=this.options.position;this.tooltip.attr("tracking","mouse"===t.target&&t.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},T.get=function(t){if(this.destroyed)return this;var e=h(this.options,t.toLowerCase()),i=e[0][e[1]];return i.precedance?i.string():i};var ot=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,nt=/^prerender|show\.ready/i;T.set=function(t,e){if(this.destroyed)return this;var i,o=this.rendered,n=I,r=this.options;this.checks;return"string"==typeof t?(i=t,t={},t[i]=e):t=s.extend({},t),s.each(t,function(e,i){if(o&&nt.test(e))return void delete t[e];var a,l=h(r,e.toLowerCase());a=l[0][l[1]],l[0][l[1]]=i&&i.nodeType?s(i):i,n=ot.test(e)||n,t[e]=[l[0],l[1],i,a]}),a(r),this.positioning=W,s.each(t,s.proxy(l,this)),this.positioning=I,this.rendered&&this.tooltip[0].offsetWidth>0&&n&&this.reposition("mouse"===r.position.target?k:this.cache.event),this},T._update=function(t,e,i){var o=this,n=this.cache;return this.rendered&&t?(s.isFunction(t)&&(t=t.call(this.elements.target,n.event,this)||""),s.isFunction(t.then)?(n.waiting=W,t.then(function(t){return n.waiting=I,o._update(t,e)},k,function(t){return o._update(t,e)})):t===I||!t&&""!==t?I:(t.jquery&&t.length>0?e.empty().append(t.css({display:"block",visibility:"visible"})):e.html(t),this._waitForContent(e).then(function(t){o.rendered&&o.tooltip[0].offsetWidth>0&&o.reposition(n.event,!t.length)}))):I},T._waitForContent=function(t){var e=this.cache;return e.waiting=W,(s.fn.imagesLoaded?t.imagesLoaded():s.Deferred().resolve([])).done(function(){e.waiting=I}).promise()},T._updateContent=function(t,e){this._update(t,this.elements.content,e)},T._updateTitle=function(t,e){this._update(t,this.elements.title,e)===I&&this._removeTitle(I)},T._createTitle=function(){var t=this.elements,e=this._id+"-title";t.titlebar&&this._removeTitle(),t.titlebar=s("<div />",{"class":R+"-titlebar "+(this.options.style.widget?c("header"):"")}).append(t.title=s("<div />",{id:e,"class":R+"-title","aria-atomic":W})).insertBefore(t.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(t){s(this).toggleClass("ui-state-active ui-state-focus","down"===t.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(t){s(this).toggleClass("ui-state-hover","mouseover"===t.type)}),this.options.content.button&&this._createButton()},T._removeTitle=function(t){var e=this.elements;e.title&&(e.titlebar.remove(),e.titlebar=e.title=e.button=k,t!==I&&this.reposition())},T._createPosClass=function(t){return R+"-pos-"+(t||this.options.position.my).abbrev()},T.reposition=function(i,o){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=W;var n,r,a,h,l=this.cache,c=this.tooltip,d=this.options.position,p=d.target,u=d.my,f=d.at,g=d.viewport,m=d.container,v=d.adjust,y=v.method.split(" "),b=c.outerWidth(I),w=c.outerHeight(I),_=0,x=0,C=c.css("position"),q={left:0,top:0},T=c[0].offsetWidth>0,j=i&&"scroll"===i.type,z=s(t),M=m[0].ownerDocument,k=this.mouse;if(s.isArray(p)&&2===p.length)f={x:D,y:P},q={left:p[0],top:p[1]};else if("mouse"===p)f={x:D,y:P},(!v.mouse||this.options.hide.distance)&&l.origin&&l.origin.pageX?i=l.origin:!i||i&&("resize"===i.type||"scroll"===i.type)?i=l.event:k&&k.pageX&&(i=k),"static"!==C&&(q=m.offset()),M.body.offsetWidth!==(t.innerWidth||M.documentElement.clientWidth)&&(r=s(e.body).offset()),q={left:i.pageX-q.left+(r&&r.left||0),top:i.pageY-q.top+(r&&r.top||0)},v.mouse&&j&&k&&(q.left-=(k.scrollX||0)-z.scrollLeft(),q.top-=(k.scrollY||0)-z.scrollTop());else{if("event"===p?i&&i.target&&"scroll"!==i.type&&"resize"!==i.type?l.target=s(i.target):i.target||(l.target=this.elements.target):"event"!==p&&(l.target=s(p.jquery?p:this.elements.target)),p=l.target,p=s(p).eq(0),0===p.length)return this;p[0]===e||p[0]===t?(_=st.iOS?t.innerWidth:p.width(),x=st.iOS?t.innerHeight:p.height(),p[0]===t&&(q={top:(g||p).scrollTop(),left:(g||p).scrollLeft()})):V.imagemap&&p.is("area")?n=V.imagemap(this,p,f,V.viewport?y:I):V.svg&&p&&p[0].ownerSVGElement?n=V.svg(this,p,f,V.viewport?y:I):(_=p.outerWidth(I),x=p.outerHeight(I),q=p.offset()),n&&(_=n.width,x=n.height,r=n.offset,q=n.position),q=this.reposition.offset(p,q,m),(st.iOS>3.1&&st.iOS<4.1||st.iOS>=4.3&&st.iOS<4.33||!st.iOS&&"fixed"===C)&&(q.left-=z.scrollLeft(),q.top-=z.scrollTop()),(!n||n&&n.adjustable!==I)&&(q.left+=f.x===F?_:f.x===N?_/2:0,q.top+=f.y===B?x:f.y===N?x/2:0)}return q.left+=v.x+(u.x===F?-b:u.x===N?-b/2:0),q.top+=v.y+(u.y===B?-w:u.y===N?-w/2:0),V.viewport?(a=q.adjusted=V.viewport(this,q,d,_,x,b,w),r&&a.left&&(q.left+=r.left),r&&a.top&&(q.top+=r.top),a.my&&(this.position.my=a.my)):q.adjusted={left:0,top:0},l.posClass!==(h=this._createPosClass(this.position.my))&&c.removeClass(l.posClass).addClass(l.posClass=h),this._trigger("move",[q,g.elem||g],i)?(delete q.adjusted,o===I||!T||isNaN(q.left)||isNaN(q.top)||"mouse"===p||!s.isFunction(d.effect)?c.css(q):s.isFunction(d.effect)&&(d.effect.call(c,this,s.extend({},q)),c.queue(function(t){s(this).css({opacity:"",height:""}),st.ie&&this.style.removeAttribute("filter"),t()})),this.positioning=I,this):this},T.reposition.offset=function(t,i,o){function n(t,e){i.left+=e*t.scrollLeft(),i.top+=e*t.scrollTop()}if(!o[0])return i;var r,a,h,l,c=s(t[0].ownerDocument),d=!!st.ie&&"CSS1Compat"!==e.compatMode,p=o[0];do"static"!==(a=s.css(p,"position"))&&("fixed"===a?(h=p.getBoundingClientRect(),n(c,-1)):(h=s(p).position(),h.left+=parseFloat(s.css(p,"borderLeftWidth"))||0,h.top+=parseFloat(s.css(p,"borderTopWidth"))||0),i.left-=h.left+(parseFloat(s.css(p,"marginLeft"))||0),i.top-=h.top+(parseFloat(s.css(p,"marginTop"))||0),r||"hidden"===(l=s.css(p,"overflow"))||"visible"===l||(r=s(p)));while(p=p.offsetParent);return r&&(r[0]!==c[0]||d)&&n(r,1),i};var rt=(j=T.reposition.Corner=function(t,e){t=(""+t).replace(/([A-Z])/," $1").replace(/middle/gi,N).toLowerCase(),this.x=(t.match(/left|right/i)||t.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(t.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!e;var i=t.charAt(0);this.precedance="t"===i||"b"===i?S:E}).prototype;rt.invert=function(t,e){this[t]=this[t]===D?F:this[t]===F?D:e||this[t]},rt.string=function(t){var e=this.x,i=this.y,s=e!==i?"center"===e||"center"!==i&&(this.precedance===S||this.forceY)?[i,e]:[e,i]:[e];return t!==!1?s.join(" "):s},rt.abbrev=function(){var t=this.string(!1);return t[0].charAt(0)+(t[1]&&t[1].charAt(0)||"")},rt.clone=function(){return new j(this.string(),this.forceY)},T.toggle=function(t,i){var o=this.cache,n=this.options,r=this.tooltip;if(i){if(/over|enter/.test(i.type)&&o.event&&/out|leave/.test(o.event.type)&&n.show.target.add(i.target).length===n.show.target.length&&r.has(i.relatedTarget).length)return this;o.event=s.event.fix(i)}if(this.waiting&&!t&&(this.hiddenDuringWait=W),!this.rendered)return t?this.render(1):this;if(this.destroyed||this.disabled)return this;var a,h,l,c=t?"show":"hide",d=this.options[c],p=(this.options[t?"hide":"show"],this.options.position),u=this.options.content,f=this.tooltip.css("width"),g=this.tooltip.is(":visible"),m=t||1===d.target.length,v=!i||d.target.length<2||o.target[0]===i.target;return(typeof t).search("boolean|number")&&(t=!g),a=!r.is(":animated")&&g===t&&v,h=a?k:!!this._trigger(c,[90]),this.destroyed?this:(h!==I&&t&&this.focus(i),!h||a?this:(s.attr(r[0],"aria-hidden",!t),t?(this.mouse&&(o.origin=s.event.fix(this.mouse)),s.isFunction(u.text)&&this._updateContent(u.text,I),s.isFunction(u.title)&&this._updateTitle(u.title,I),!M&&"mouse"===p.target&&p.adjust.mouse&&(s(e).bind("mousemove."+R,this._storeMouse),M=W),f||r.css("width",r.outerWidth(I)),this.reposition(i,arguments[2]),f||r.css("width",""),d.solo&&("string"==typeof d.solo?s(d.solo):s(G,d.solo)).not(r).not(d.target).qtip("hide",s.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete o.origin,M&&!s(G+'[tracking="true"]:visible',d.solo).not(r).length&&(s(e).unbind("mousemove."+R),M=I),this.blur(i)),l=s.proxy(function(){t?(st.ie&&r[0].style.removeAttribute("filter"),r.css("overflow",""),"string"==typeof d.autofocus&&s(this.options.show.autofocus,r).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):r.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(t?"visible":"hidden")},this),d.effect===I||m===I?(r[c](),l()):s.isFunction(d.effect)?(r.stop(1,1),d.effect.call(r,this),r.queue("fx",function(t){l(),t()})):r.fadeTo(90,t?1:0,l),t&&d.target.trigger("qtip-"+this.id+"-inactive"),this))},T.show=function(t){return this.toggle(W,t)},T.hide=function(t){return this.toggle(I,t)},T.focus=function(t){if(!this.rendered||this.destroyed)return this;var e=s(G),i=this.tooltip,o=parseInt(i[0].style.zIndex,10),n=q.zindex+e.length;return i.hasClass(K)||this._trigger("focus",[n],t)&&(o!==n&&(e.each(function(){this.style.zIndex>o&&(this.style.zIndex=this.style.zIndex-1)}),e.filter("."+K).qtip("blur",t)),i.addClass(K)[0].style.zIndex=n),this},T.blur=function(t){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(K),this._trigger("blur",[this.tooltip.css("zIndex")],t),this)},T.disable=function(t){return this.destroyed?this:("toggle"===t?t=!(this.rendered?this.tooltip.hasClass(tt):this.disabled):"boolean"!=typeof t&&(t=W),this.rendered&&this.tooltip.toggleClass(tt,t).attr("aria-disabled",t),this.disabled=!!t,this)},T.enable=function(){return this.disable(I)},T._createButton=function(){var t=this,e=this.elements,i=e.tooltip,o=this.options.content.button,n="string"==typeof o,r=n?o:"Close tooltip";e.button&&e.button.remove(),o.jquery?e.button=o:e.button=s("<a />",{"class":"qtip-close "+(this.options.style.widget?"":R+"-icon"),title:r,"aria-label":r}).prepend(s("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"})),e.button.appendTo(e.titlebar||i).attr("role","button").click(function(e){return i.hasClass(tt)||t.hide(e),I})},T._updateButton=function(t){if(!this.rendered)return I;var e=this.elements.button;t?this._createButton():e.remove()},T._setWidget=function(){var t=this.options.style.widget,e=this.elements,i=e.tooltip,s=i.hasClass(tt);i.removeClass(tt),tt=t?"ui-state-disabled":"qtip-disabled",i.toggleClass(tt,s),i.toggleClass("ui-helper-reset "+c(),t).toggleClass(J,this.options.style.def&&!t),e.content&&e.content.toggleClass(c("content"),t),e.titlebar&&e.titlebar.toggleClass(c("header"),t),e.button&&e.button.toggleClass(R+"-icon",!t)},T._storeMouse=function(t){return(this.mouse=s.event.fix(t)).type="mousemove",this},T._bind=function(t,e,i,o,n){if(t&&i&&e.length){var r="."+this._id+(o?"-"+o:"");return s(t).bind((e.split?e:e.join(r+" "))+r,s.proxy(i,n||this)),this}},T._unbind=function(t,e){return t&&s(t).unbind("."+this._id+(e?"-"+e:"")),this},T._trigger=function(t,e,i){var o=s.Event("tooltip"+t);return o.originalEvent=i&&s.extend({},i)||this.cache.event||k,this.triggering=t,this.tooltip.trigger(o,[this].concat(e||[])),this.triggering=I,!o.isDefaultPrevented()},T._bindEvents=function(t,e,i,o,n,r){var a=i.filter(o).add(o.filter(i)),h=[];a.length&&(s.each(e,function(e,i){var o=s.inArray(i,t);o>-1&&h.push(t.splice(o,1)[0])}),h.length&&(this._bind(a,h,function(t){var e=!!this.rendered&&this.tooltip[0].offsetWidth>0;(e?r:n).call(this,t)}),i=i.not(a),o=o.not(a))),this._bind(i,t,n),this._bind(o,e,r)},T._assignInitialEvents=function(t){function e(t){return this.disabled||this.destroyed?I:(this.cache.event=t&&s.event.fix(t),this.cache.target=t&&s(t.target),clearTimeout(this.timers.show),void(this.timers.show=d.call(this,function(){this.render("object"==typeof t||i.show.ready)},i.prerender?0:i.show.delay)))}var i=this.options,o=i.show.target,n=i.hide.target,r=i.show.event?s.trim(""+i.show.event).split(" "):[],a=i.hide.event?s.trim(""+i.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(t){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(i.show.event)&&!/mouse(out|leave)/i.test(i.hide.event)&&a.push("mouseleave"),this._bind(o,"mousemove",function(t){this._storeMouse(t),this.cache.onTarget=W}),this._bindEvents(r,a,o,n,e,function(){return this.timers?void clearTimeout(this.timers.show):I}),(i.show.ready||i.prerender)&&e.call(this,t)},T._assignEvents=function(){var i=this,o=this.options,n=o.position,r=this.tooltip,a=o.show.target,h=o.hide.target,l=n.container,c=n.viewport,d=s(e),m=(s(e.body),s(t)),v=o.show.event?s.trim(""+o.show.event).split(" "):[],y=o.hide.event?s.trim(""+o.hide.event).split(" "):[];s.each(o.events,function(t,e){i._bind(r,"toggle"===t?["tooltipshow","tooltiphide"]:["tooltip"+t],e,null,r)}),/mouse(out|leave)/i.test(o.hide.event)&&"window"===o.hide.leave&&this._bind(d,["mouseout","blur"],function(t){/select|option/.test(t.target.nodeName)||t.relatedTarget||this.hide(t)}),o.hide.fixed?h=h.add(r.addClass(Q)):/mouse(over|enter)/i.test(o.show.event)&&this._bind(h,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+o.hide.event).indexOf("unfocus")>-1&&this._bind(l.closest("html"),["mousedown","touchstart"],function(t){var e=s(t.target),i=this.rendered&&!this.tooltip.hasClass(tt)&&this.tooltip[0].offsetWidth>0,o=e.parents(G).filter(this.tooltip[0]).length>0;e[0]===this.target[0]||e[0]===this.tooltip[0]||o||this.target.has(e[0]).length||!i||this.hide(t)}),"number"==typeof o.hide.inactive&&(this._bind(a,"qtip-"+this.id+"-inactive",f,"inactive"),this._bind(h.add(r),q.inactiveEvents,f)),this._bindEvents(v,y,a,h,p,u),this._bind(a.add(r),"mousemove",function(t){if("number"==typeof o.hide.distance){var e=this.cache.origin||{},i=this.options.hide.distance,s=Math.abs;(s(t.pageX-e.pageX)>=i||s(t.pageY-e.pageY)>=i)&&this.hide(t)}this._storeMouse(t)}),"mouse"===n.target&&n.adjust.mouse&&(o.hide.event&&this._bind(a,["mouseenter","mouseleave"],function(t){return this.cache?void(this.cache.onTarget="mouseenter"===t.type):I}),this._bind(d,"mousemove",function(t){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(tt)&&this.tooltip[0].offsetWidth>0&&this.reposition(t)})),(n.adjust.resize||c.length)&&this._bind(s.event.special.resize?c:m,"resize",g),n.adjust.scroll&&this._bind(m.add(n.container),"scroll",g)},T._unassignEvents=function(){var i=this.options,o=i.show.target,n=i.hide.target,r=s.grep([this.elements.target[0],this.rendered&&this.tooltip[0],i.position.container[0],i.position.viewport[0],i.position.container.closest("html")[0],t,e],function(t){return"object"==typeof t});o&&o.toArray&&(r=r.concat(o.toArray())),n&&n.toArray&&(r=r.concat(n.toArray())),this._unbind(r)._unbind(r,"destroy")._unbind(r,"inactive")},s(function(){m(G,["mouseenter","mouseleave"],function(t){var e="mouseenter"===t.type,i=s(t.currentTarget),o=s(t.relatedTarget||t.target),n=this.options;e?(this.focus(t),i.hasClass(Q)&&!i.hasClass(tt)&&clearTimeout(this.timers.hide)):"mouse"===n.position.target&&n.position.adjust.mouse&&n.hide.event&&n.show.target&&!o.closest(n.show.target[0]).length&&this.hide(t),i.toggleClass(Z,e)}),m("["+X+"]",U,f)}),q=s.fn.qtip=function(t,e,o){var n=(""+t).toLowerCase(),r=k,h=s.makeArray(arguments).slice(1),l=h[h.length-1],c=this[0]?s.data(this[0],R):k;return!arguments.length&&c||"api"===n?c:"string"==typeof t?(this.each(function(){var t=s.data(this,R);if(!t)return W;if(l&&l.timeStamp&&(t.cache.event=l),!e||"option"!==n&&"options"!==n)t[n]&&t[n].apply(t,h);else{if(o===i&&!s.isPlainObject(e))return r=t.get(e),I;t.set(e,o)}}),r!==k?r:this):"object"!=typeof t&&arguments.length?void 0:(c=a(s.extend(W,{},t)),this.each(function(t){var e,i;return i=s.isArray(c.id)?c.id[t]:c.id,i=!i||i===I||i.length<1||q.api[i]?q.nextid++:i,e=v(s(this),i,c),e===I?W:(q.api[i]=e,s.each(V,function(){"initialize"===this.initialize&&this(e)}),void e._assignInitialEvents(l))}))},s.qtip=o,q.api={},s.each({attr:function(t,e){if(this.length){var i=this[0],o="title",n=s.data(i,"qtip");if(t===o&&n&&"object"==typeof n&&n.options.suppress)return arguments.length<2?s.attr(i,it):(n&&n.options.content.attr===o&&n.cache.attr&&n.set("content.text",e),this.attr(it,e))}return s.fn["attr"+et].apply(this,arguments)},clone:function(t){var e=(s([]),s.fn["clone"+et].apply(this,arguments));return t||e.filter("["+it+"]").attr("title",function(){return s.attr(this,it)}).removeAttr(it),e}},function(t,e){if(!e||s.fn[t+et])return W;var i=s.fn[t+et]=s.fn[t];s.fn[t]=function(){return e.apply(this,arguments)||i.apply(this,arguments)}}),s.ui||(s["cleanData"+et]=s.cleanData,s.cleanData=function(t){for(var e,i=0;(e=s(t[i])).length;i++)if(e.attr(H))try{e.triggerHandler("removeqtip")}catch(o){}s["cleanData"+et].apply(this,arguments)}),q.version="2.2.1",q.nextid=0,q.inactiveEvents=U,q.zindex=15e3,q.defaults={prerender:I,id:I,overwrite:W,suppress:W,content:{text:W,attr:"title",title:I,button:I},position:{my:"top left",at:"bottom right",target:I,container:I,viewport:I,adjust:{x:0,y:0,mouse:W,scroll:W,resize:W,method:"flipinvert flipinvert"},effect:function(t,e,i){s(this).animate(e,{duration:200,queue:I})}},show:{target:I,event:"mouseenter",effect:W,delay:90,solo:I,ready:I,autofocus:I},hide:{target:I,event:"mouseleave",effect:W,delay:0,fixed:I,inactive:I,leave:"window",distance:I},style:{classes:"",widget:I,width:I,height:I,def:W},events:{render:k,move:k,show:k,hide:k,toggle:k,visible:k,hidden:k,focus:k,blur:k}};var at,ht="margin",lt="border",ct="color",dt="background-color",pt="transparent",ut=" !important",ft=!!e.createElement("canvas").getContext,gt=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,mt={},vt=["Webkit","O","Moz","ms"];if(ft)var yt=t.devicePixelRatio||1,bt=function(){var t=e.createElement("canvas").getContext("2d");return t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||1}(),wt=yt/bt;else var _t=function(t,e,i){return"<qtipvml:"+t+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(e||"")+' style="behavior: url(#default#VML); '+(i||"")+'" />'};s.extend(_.prototype,{init:function(t){var e,i;i=this.element=t.elements.tip=s("<div />",{"class":R+"-tip"}).prependTo(t.tooltip),ft?(e=s("<canvas />").appendTo(this.element)[0].getContext("2d"),e.lineJoin="miter",e.miterLimit=1e5,e.save()):(e=_t("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(e+e),t._bind(s("*",i).add(i),["click","mousedown"],function(t){t.stopPropagation()},this._ns)),t._bind(t.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(t){var e=this.qtip.elements.titlebar;return e&&(t.y===P||t.y===N&&this.element.position().top+this.size[1]/2+this.options.offset<e.outerHeight(W))},_parseCorner:function(t){var e=this.qtip.options.position.my;return t===I||e===I?t=I:t===W?t=new j(e.string()):t.string||(t=new j(t),t.fixed=W),t},_parseWidth:function(t,e,i){var s=this.qtip.elements,o=lt+y(e)+"Width";return(i?w(i,o):w(s.content,o)||w(this._useTitle(t)&&s.titlebar||s.content,o)||w(s.tooltip,o))||0},_parseRadius:function(t){var e=this.qtip.elements,i=lt+y(t.y)+y(t.x)+"Radius";return st.ie<9?0:w(this._useTitle(t)&&e.titlebar||e.content,i)||w(e.tooltip,i)||0},_invalidColour:function(t,e,i){var s=t.css(e);return!s||i&&s===t.css(i)||gt.test(s)?I:s},_parseColours:function(t){var e=this.qtip.elements,i=this.element.css("cssText",""),o=lt+y(t[t.precedance])+y(ct),n=this._useTitle(t)&&e.titlebar||e.content,r=this._invalidColour,a=[];return a[0]=r(i,dt)||r(n,dt)||r(e.content,dt)||r(e.tooltip,dt)||i.css(dt),a[1]=r(i,o,ct)||r(n,o,ct)||r(e.content,o,ct)||r(e.tooltip,o,ct)||e.tooltip.css(o),s("*",i).add(i).css("cssText",dt+":"+pt+ut+";"+lt+":0"+ut+";"),a},_calculateSize:function(t){var e,i,s,o=t.precedance===S,n=this.options.width,r=this.options.height,a="c"===t.abbrev(),h=(o?n:r)*(a?.5:1),l=Math.pow,c=Math.round,d=Math.sqrt(l(h,2)+l(r,2)),p=[this.border/h*d,this.border/r*d];return p[2]=Math.sqrt(l(p[0],2)-l(this.border,2)),p[3]=Math.sqrt(l(p[1],2)-l(this.border,2)),e=d+p[2]+p[3]+(a?0:p[0]),i=e/d,s=[c(i*n),c(i*r)],o?s:s.reverse()},_calculateTip:function(t,e,i){i=i||1,e=e||this.size;var s=e[0]*i,o=e[1]*i,n=Math.ceil(s/2),r=Math.ceil(o/2),a={br:[0,0,s,o,s,0],bl:[0,0,s,0,0,o],tr:[0,o,s,0,s,o],tl:[0,0,0,o,s,o],tc:[0,o,n,0,s,o],bc:[0,0,s,0,n,o],rc:[0,0,s,r,0,o],lc:[s,0,s,o,0,r]};return a.lt=a.br,a.rt=a.bl,a.lb=a.tr,a.rb=a.tl,a[t.abbrev()]},_drawCoords:function(t,e){t.beginPath(),t.moveTo(e[0],e[1]),t.lineTo(e[2],e[3]),t.lineTo(e[4],e[5]),t.closePath()},create:function(){var t=this.corner=(ft||st.ie)&&this._parseCorner(this.options.corner);return(this.enabled=!!this.corner&&"c"!==this.corner.abbrev())&&(this.qtip.cache.corner=t.clone(),this.update()),this.element.toggle(this.enabled),this.corner},update:function(e,i){if(!this.enabled)return this;var o,n,r,a,h,l,c,d,p=this.qtip.elements,u=this.element,f=u.children(),g=this.options,m=this.size,v=g.mimic,y=Math.round;e||(e=this.qtip.cache.corner||this.corner),v===I?v=e:(v=new j(v),v.precedance=e.precedance,"inherit"===v.x?v.x=e.x:"inherit"===v.y?v.y=e.y:v.x===v.y&&(v[e.precedance]=e[e.precedance])),n=v.precedance,e.precedance===E?this._swapDimensions():this._resetDimensions(),o=this.color=this._parseColours(e),o[1]!==pt?(d=this.border=this._parseWidth(e,e[e.precedance]),g.border&&d<1&&!gt.test(o[1])&&(o[0]=o[1]),this.border=d=g.border!==W?g.border:d):this.border=d=0,c=this.size=this._calculateSize(e),u.css({width:c[0],height:c[1],lineHeight:c[1]+"px"}),l=e.precedance===S?[y(v.x===D?d:v.x===F?c[0]-m[0]-d:(c[0]-m[0])/2),y(v.y===P?c[1]-m[1]:0)]:[y(v.x===D?c[0]-m[0]:0),y(v.y===P?d:v.y===B?c[1]-m[1]-d:(c[1]-m[1])/2)],ft?(r=f[0].getContext("2d"),r.restore(),r.save(),r.clearRect(0,0,6e3,6e3),a=this._calculateTip(v,m,wt),h=this._calculateTip(v,this.size,wt),f.attr(A,c[0]*wt).attr(L,c[1]*wt),f.css(A,c[0]).css(L,c[1]),this._drawCoords(r,h),r.fillStyle=o[1],r.fill(),r.translate(l[0]*wt,l[1]*wt),this._drawCoords(r,a),r.fillStyle=o[0],r.fill()):(a=this._calculateTip(v),a="m"+a[0]+","+a[1]+" l"+a[2]+","+a[3]+" "+a[4]+","+a[5]+" xe",l[2]=d&&/^(r|b)/i.test(e.string())?8===st.ie?2:1:0,f.css({coordsize:c[0]+d+" "+(c[1]+d),antialias:""+(v.string().indexOf(N)>-1),left:l[0]-l[2]*Number(n===E),top:l[1]-l[2]*Number(n===S),width:c[0]+d,height:c[1]+d}).each(function(t){var e=s(this);e[e.prop?"prop":"attr"]({coordsize:c[0]+d+" "+(c[1]+d),path:a,fillcolor:o[0],filled:!!t,stroked:!t}).toggle(!(!d&&!t)),!t&&e.html(_t("stroke",'weight="'+2*d+'px" color="'+o[1]+'" miterlimit="1000" joinstyle="miter"'))})),t.opera&&setTimeout(function(){p.tip.css({display:"inline-block",visibility:"visible"})},1),i!==I&&this.calculate(e,c)},calculate:function(t,e){if(!this.enabled)return I;var i,o,n=this,r=this.qtip.elements,a=this.element,h=this.options.offset,l=(r.tooltip.hasClass("ui-widget"),
7
  {});return t=t||this.corner,i=t.precedance,e=e||this._calculateSize(t),o=[t.x,t.y],i===E&&o.reverse(),s.each(o,function(s,o){var a,c,d;o===N?(a=i===S?D:P,l[a]="50%",l[ht+"-"+a]=-Math.round(e[i===S?0:1]/2)+h):(a=n._parseWidth(t,o,r.tooltip),c=n._parseWidth(t,o,r.content),d=n._parseRadius(t),l[o]=Math.max(-n.border,s?c:h+(d>a?d:-a)))}),l[t[i]]-=e[i===E?0:1],a.css({margin:"",top:"",bottom:"",left:"",right:""}).css(l),l},reposition:function(t,e,s,o){function n(t,e,i,s,o){t===$&&c.precedance===e&&d[s]&&c[i]!==N?c.precedance=c.precedance===E?S:E:t!==$&&d[s]&&(c[e]=c[e]===N?d[s]>0?s:o:c[e]===s?o:s)}function r(t,e,o){c[t]===N?m[ht+"-"+e]=g[t]=a[ht+"-"+e]-d[e]:(h=a[o]!==i?[d[e],-a[e]]:[-d[e],a[e]],(g[t]=Math.max(h[0],h[1]))>h[0]&&(s[e]-=d[e],g[e]=I),m[a[o]!==i?o:e]=g[t])}if(this.enabled){var a,h,l=e.cache,c=this.corner.clone(),d=s.adjusted,p=e.options.position.adjust.method.split(" "),u=p[0],f=p[1]||p[0],g={left:I,top:I,x:0,y:0},m={};this.corner.fixed!==W&&(n(u,E,S,D,F),n(f,S,E,P,B),c.string()===l.corner.string()&&l.cornerTop===d.top&&l.cornerLeft===d.left||this.update(c,I)),a=this.calculate(c),a.right!==i&&(a.left=-a.right),a.bottom!==i&&(a.top=-a.bottom),a.user=this.offset,(g.left=u===$&&!!d.left)&&r(E,D,F),(g.top=f===$&&!!d.top)&&r(S,P,B),this.element.css(m).toggle(!(g.x&&g.y||c.x===N&&g.y||c.y===N&&g.x)),s.left-=a.left.charAt?a.user:u!==$||g.top||!g.left&&!g.top?a.left+this.border:0,s.top-=a.top.charAt?a.user:f!==$||g.left||!g.left&&!g.top?a.top+this.border:0,l.cornerLeft=d.left,l.cornerTop=d.top,l.corner=c.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),at=V.tip=function(t){return new _(t,t.options.style.tip)},at.initialize="render",at.sanitize=function(t){if(t.style&&"tip"in t.style){var e=t.style.tip;"object"!=typeof e&&(e=t.style.tip={corner:e}),/string|boolean/i.test(typeof e.corner)||(e.corner=W)}},z.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(t){this.size=[t.width,t.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},s.extend(W,q.defaults,{style:{tip:{corner:W,mimic:I,width:6,height:6,border:W,offset:0}}});var xt,Ct,qt="qtip-modal",Tt="."+qt;Ct=function(){function t(t){if(s.expr[":"].focusable)return s.expr[":"].focusable;var e,i,o,n=!isNaN(s.attr(t,"tabindex")),r=t.nodeName&&t.nodeName.toLowerCase();return"area"===r?(e=t.parentNode,i=e.name,!(!t.href||!i||"map"!==e.nodeName.toLowerCase())&&(o=s("img[usemap=#"+i+"]")[0],!!o&&o.is(":visible"))):/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||n:n}function i(t){c.length<1&&t.length?t.not("body").blur():c.first().focus()}function o(t){if(h.is(":visible")){var e,o=s(t.target),a=n.tooltip,l=o.closest(G);e=l.length<1?I:parseInt(l[0].style.zIndex,10)>parseInt(a[0].style.zIndex,10),e||o.closest(G)[0]===a[0]||i(o),r=t.target===c[c.length-1]}}var n,r,a,h,l=this,c={};s.extend(l,{init:function(){return h=l.elem=s("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return I}}).hide(),s(e.body).bind("focusin"+Tt,o),s(e).bind("keydown"+Tt,function(t){n&&n.options.show.modal.escape&&27===t.keyCode&&n.hide(t)}),h.bind("click"+Tt,function(t){n&&n.options.show.modal.blur&&n.hide(t)}),l},update:function(e){n=e,c=e.options.show.modal.stealfocus!==I?e.tooltip.find("*").filter(function(){return t(this)}):[]},toggle:function(t,o,r){var c=(s(e.body),t.tooltip),d=t.options.show.modal,p=d.effect,u=o?"show":"hide",f=h.is(":visible"),g=s(Tt).filter(":visible:not(:animated)").not(c);return l.update(t),o&&d.stealfocus!==I&&i(s(":focus")),h.toggleClass("blurs",d.blur),o&&h.appendTo(e.body),h.is(":animated")&&f===o&&a!==I||!o&&g.length?l:(h.stop(W,I),s.isFunction(p)?p.call(h,o):p===I?h[u]():h.fadeTo(parseInt(r,10)||90,o?1:0,function(){o||h.hide()}),o||h.queue(function(t){h.css({left:"",top:""}),s(Tt).length||h.detach(),t()}),a=o,n.destroyed&&(n=k),l)}}),l.init()},Ct=new Ct,s.extend(x.prototype,{init:function(t){var e=t.tooltip;return this.options.on?(t.elements.overlay=Ct.elem,e.addClass(qt).css("z-index",q.modal_zindex+s(Tt).length),t._bind(e,["tooltipshow","tooltiphide"],function(t,i,o){var n=t.originalEvent;if(t.target===e[0])if(n&&"tooltiphide"===t.type&&/mouse(leave|enter)/.test(n.type)&&s(n.relatedTarget).closest(Ct.elem[0]).length)try{t.preventDefault()}catch(r){}else(!n||n&&"tooltipsolo"!==n.type)&&this.toggle(t,"tooltipshow"===t.type,o)},this._ns,this),t._bind(e,"tooltipfocus",function(t,i){if(!t.isDefaultPrevented()&&t.target===e[0]){var o=s(Tt),n=q.modal_zindex+o.length,r=parseInt(e[0].style.zIndex,10);Ct.elem[0].style.zIndex=n-1,o.each(function(){this.style.zIndex>r&&(this.style.zIndex-=1)}),o.filter("."+K).qtip("blur",t.originalEvent),e.addClass(K)[0].style.zIndex=n,Ct.update(i);try{t.preventDefault()}catch(a){}}},this._ns,this),void t._bind(e,"tooltiphide",function(t){t.target===e[0]&&s(Tt).filter(":visible").not(e).last().qtip("focus",t)},this._ns,this)):this},toggle:function(t,e,i){return t&&t.isDefaultPrevented()?this:void Ct.toggle(this.qtip,!!e,i)},destroy:function(){this.qtip.tooltip.removeClass(qt),this.qtip._unbind(this.qtip.tooltip,this._ns),Ct.toggle(this.qtip,I),delete this.qtip.elements.overlay}}),xt=V.modal=function(t){return new x(t,t.options.show.modal)},xt.sanitize=function(t){t.show&&("object"!=typeof t.show.modal?t.show.modal={on:!!t.show.modal}:"undefined"==typeof t.show.modal.on&&(t.show.modal.on=W))},q.modal_zindex=q.zindex-200,xt.initialize="render",z.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},s.extend(W,q.defaults,{show:{modal:{on:I,effect:W,blur:W,stealfocus:W,escape:W}}}),V.viewport=function(i,s,o,n,r,a,h){function l(t,e,i,o,n,r,a,h,l){var c=s[n],y=w[t],b=_[t],x=i===$,C=y===n?l:y===r?-l:-l/2,q=b===n?h:b===r?-h:-h/2,T=m[n]+v[n]-(u?0:p[n]),j=T-c,z=c+l-(a===A?f:g)-T,M=C-(w.precedance===t||y===w[e]?q:0)-(b===N?h/2:0);return x?(M=(y===n?1:-1)*C,s[n]+=j>0?j:z>0?-z:0,s[n]=Math.max(-p[n]+v[n],c-M,Math.min(Math.max(-p[n]+v[n]+(a===A?f:g),c+M),s[n],"center"===y?c-C:1e9))):(o*=i===O?2:0,j>0&&(y!==n||z>0)?(s[n]-=M+o,d.invert(t,n)):z>0&&(y!==r||j>0)&&(s[n]-=(y===N?-M:M)+o,d.invert(t,r)),s[n]<m&&-s[n]>z&&(s[n]=c,d=w.clone())),s[n]-c}var c,d,p,u,f,g,m,v,y=o.target,b=i.elements.tooltip,w=o.my,_=o.at,x=o.adjust,C=x.method.split(" "),q=C[0],T=C[1]||C[0],j=o.viewport,z=o.container,M=(i.cache,{left:0,top:0});return j.jquery&&y[0]!==t&&y[0]!==e.body&&"none"!==x.method?(p=z.offset()||M,u="static"===z.css("position"),c="fixed"===b.css("position"),f=j[0]===t?j.width():j.outerWidth(I),g=j[0]===t?j.height():j.outerHeight(I),m={left:c?0:j.scrollLeft(),top:c?0:j.scrollTop()},v=j.offset()||M,"shift"===q&&"shift"===T||(d=w.clone()),M={left:"none"!==q?l(E,S,q,x.x,D,F,A,n,a):0,top:"none"!==T?l(S,E,T,x.y,P,B,L,r,h):0,my:d}):M},V.polys={polygon:function(t,e){var i,s,o,n={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:I},r=0,a=[],h=1,l=1,c=0,d=0;for(r=t.length;r--;)i=[parseInt(t[--r],10),parseInt(t[r+1],10)],i[0]>n.position.right&&(n.position.right=i[0]),i[0]<n.position.left&&(n.position.left=i[0]),i[1]>n.position.bottom&&(n.position.bottom=i[1]),i[1]<n.position.top&&(n.position.top=i[1]),a.push(i);if(s=n.width=Math.abs(n.position.right-n.position.left),o=n.height=Math.abs(n.position.bottom-n.position.top),"c"===e.abbrev())n.position={left:n.position.left+n.width/2,top:n.position.top+n.height/2};else{for(;s>0&&o>0&&h>0&&l>0;)for(s=Math.floor(s/2),o=Math.floor(o/2),e.x===D?h=s:e.x===F?h=n.width-s:h+=Math.floor(s/2),e.y===P?l=o:e.y===B?l=n.height-o:l+=Math.floor(o/2),r=a.length;r--&&!(a.length<2);)c=a[r][0]-n.position.left,d=a[r][1]-n.position.top,(e.x===D&&c>=h||e.x===F&&c<=h||e.x===N&&(c<h||c>n.width-h)||e.y===P&&d>=l||e.y===B&&d<=l||e.y===N&&(d<l||d>n.height-l))&&a.splice(r,1);n.position={left:a[0][0],top:a[0][1]}}return n},rect:function(t,e,i,s){return{width:Math.abs(i-t),height:Math.abs(s-e),position:{left:Math.min(t,i),top:Math.min(e,s)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(t,e,i,s,o){var n=V.polys._angles[o.abbrev()],r=0===n?0:i*Math.cos(n*Math.PI),a=s*Math.sin(n*Math.PI);return{width:2*i-Math.abs(r),height:2*s-Math.abs(a),position:{left:t+r,top:e+a},adjustable:I}},circle:function(t,e,i,s){return V.polys.ellipse(t,e,i,i,s)}},V.svg=function(t,i,o){for(var n,r,a,h,l,c,d,p,u,f=(s(e),i[0]),g=s(f.ownerSVGElement),m=f.ownerDocument,v=(parseInt(i.css("stroke-width"),10)||0)/2;!f.getBBox;)f=f.parentNode;if(!f.getBBox||!f.parentNode)return I;switch(f.nodeName){case"ellipse":case"circle":p=V.polys.ellipse(f.cx.baseVal.value,f.cy.baseVal.value,(f.rx||f.r).baseVal.value+v,(f.ry||f.r).baseVal.value+v,o);break;case"line":case"polygon":case"polyline":for(d=f.points||[{x:f.x1.baseVal.value,y:f.y1.baseVal.value},{x:f.x2.baseVal.value,y:f.y2.baseVal.value}],p=[],c=-1,h=d.numberOfItems||d.length;++c<h;)l=d.getItem?d.getItem(c):d[c],p.push.apply(p,[l.x,l.y]);p=V.polys.polygon(p,o);break;default:p=f.getBBox(),p={width:p.width,height:p.height,position:{left:p.x,top:p.y}}}return u=p.position,g=g[0],g.createSVGPoint&&(r=f.getScreenCTM(),d=g.createSVGPoint(),d.x=u.left,d.y=u.top,a=d.matrixTransform(r),u.left=a.x,u.top=a.y),m!==e&&"mouse"!==t.position.target&&(n=s((m.defaultView||m.parentWindow).frameElement).offset(),n&&(u.left+=n.left,u.top+=n.top)),m=s(m),u.left+=m.scrollLeft(),u.top+=m.scrollTop(),p},V.imagemap=function(t,e,i,o){e.jquery||(e=s(e));var n,r,a,h,l,c=(e.attr("shape")||"rect").toLowerCase().replace("poly","polygon"),d=s('img[usemap="#'+e.parent("map").attr("name")+'"]'),p=s.trim(e.attr("coords")),u=p.replace(/,$/,"").split(",");if(!d.length)return I;if("polygon"===c)h=V.polys.polygon(u,i);else{if(!V.polys[c])return I;for(a=-1,l=u.length,r=[];++a<l;)r.push(parseInt(u[a],10));h=V.polys[c].apply(this,r.concat(i))}return n=d.offset(),n.left+=Math.ceil((d.outerWidth(I)-d.width())/2),n.top+=Math.ceil((d.outerHeight(I)-d.height())/2),h.position.left+=n.left,h.position.top+=n.top,h};var jt,zt='<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>';s.extend(C.prototype,{_scroll:function(){var e=this.qtip.elements.overlay;e&&(e[0].style.top=s(t).scrollTop()+"px")},init:function(i){var o=i.tooltip;s("select, object").length<1&&(this.bgiframe=i.elements.bgiframe=s(zt).appendTo(o),i._bind(o,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=s("<div/>",{id:R+"-rcontainer"}).appendTo(e.body),i.elements.overlay&&i.elements.overlay.addClass("qtipmodal-ie6fix")&&(i._bind(t,["scroll","resize"],this._scroll,this._ns,this),i._bind(o,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var t,e,i=this.qtip.tooltip,s={height:i.outerHeight(I),width:i.outerWidth(I)},o=this.qtip.plugins.tip,n=this.qtip.elements.tip;e=parseInt(i.css("borderLeftWidth"),10)||0,e={left:-e,top:-e},o&&n&&(t="x"===o.corner.precedance?[A,D]:[L,P],e[t[1]]-=n[t[0]]()),this.bgiframe.css(e).css(s)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var t,e,i,s,o=this.qtip.tooltip,n=this.qtip.options.style,r=this.qtip.options.position.container;return this.qtip.drawing=1,n.height&&o.css(L,n.height),n.width?o.css(A,n.width):(o.css(A,"").appendTo(this.redrawContainer),e=o.width(),e%2<1&&(e+=1),i=o.css("maxWidth")||"",s=o.css("minWidth")||"",t=(i+s).indexOf("%")>-1?r.width()/100:0,i=(i.indexOf("%")>-1?t:1)*parseInt(i,10)||e,s=(s.indexOf("%")>-1?t:1)*parseInt(s,10)||0,e=i+s?Math.min(Math.max(e,s),i):e,o.css(A,Math.round(e)).appendTo(r)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([t,this.qtip.tooltip],this._ns)}}),jt=V.ie6=function(t){return 6===st.ie?new C(t):I},jt.initialize="render",z.ie6={"^content|style$":function(){this.redraw()}}})}(window,document);
8
+ function give_load_gateway(e,i){var t=jQuery(e).find("#give-payment-mode-select .give-loading-text"),a=jQuery(e).find("#give-amount").val(),n=jQuery(e).find('input[name="give-form-id"]').val();t.fadeIn();var o=jQuery(e).data();1!=o["blockUI.isBlocked"]&&jQuery(e).find("#give_purchase_form_wrap").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),jQuery.post(give_scripts.ajaxurl+"?payment-mode="+i,{action:"give_load_gateway",give_total:a,give_form_id:n,give_payment_mode:i},function(i){jQuery(e).unblock(),jQuery(e).find("#give_purchase_form_wrap").html(i),jQuery(".give-no-js").hide(),jQuery(e).find("#give-payment-mode-select .give-loading-text").fadeOut(),setup_give_tooltips(),jQuery(document).trigger("give_gateway_loaded",[i,jQuery(e).attr("id")])})}function setup_give_tooltips(){jQuery('[data-tooltip!=""]').qtip({content:{attr:"data-tooltip"},style:{classes:"qtip-rounded qtip-tipsy"},position:{my:"bottom center",at:"top center"}}),jQuery.fn.qtip.zindex=2147483641}var give_scripts,give_global_vars;jQuery(document).ready(function(e){setup_give_tooltips(),e(".give-loading-text").hide(),e(document).on("click",".give-checkout-login",function(i){var t=e(this),a=e(this).parents("form"),n=e(a).find('[id^="give-checkout-login-register"] .give-loading-text'),o={action:t.data("action"),form_id:e(a).find('[name="give-form-id"]').val()};return n.show(),e.post(give_scripts.ajaxurl,o,function(i){e(a).find("[id^=give-checkout-login-register]").html(i),e(a).find(".give-submit-button-wrap").hide()}).done(function(){n.hide(),give_fl_trigger(),setup_give_tooltips()}),!1}),e(document).on("click",".give-checkout-register-cancel",function(i){i.preventDefault();var t=e(this),a=e(this).parents("form"),n={action:t.data("action"),form_id:e(a).find('[name="give-form-id"]').val()};e.post(give_scripts.ajaxurl,n,function(i){e(a).find("[id^=give-checkout-login-register]").html(e.parseJSON(i.fields)),e(a).find(".give-submit-button-wrap").show()}).done(function(){give_fl_trigger(),setup_give_tooltips()})}),e(document).on("click","[id^=give-login-fields] input[type=submit]",function(i){i.preventDefault();var t=e(this).val(),a=e(this).parents("form");e(this).val(give_global_vars.purchase_loading),a.find("[id^=give-login-fields] .give-loading-animation").fadeIn();var n={action:"give_process_donation_login",give_ajax:1,give_user_login:a.find("[name=give_user_login]").val(),give_user_pass:a.find("[name=give_user_pass]").val()};e.post(give_global_vars.ajaxurl,n,function(i){void 0!=e.trim(typeof i.success)&&1==i.success&&void 0!=typeof i.data?(a.find(".give_errors").remove(),a.find("#give-payment-mode-select").after(i.data),a.find(".give_notices.give_errors").delay(5e3).slideUp(),give_load_gateway(a,a.find(".give-gateway-option-selected input").val())):(a.find("[id^=give-login-fields] input[type=submit]").val(t),a.find(".give-loading-animation").fadeOut(),a.find(".give_errors").remove(),a.find("[id^=give-user-login-submit]").before(i.data))})}),e("select#give-gateway, input.give-gateway").on("change",function(i){i.preventDefault();var t=e(this).val();return"0"==t?(console.log("There was a problem loading the selected gateway"),!1):(give_load_gateway(e(this).parents("form"),t),!1)}),e("body").on("click touchend",'form.give-form input[name="give-purchase"].give-submit',function(i){var t=e(this).parents("form.give-form"),a=t.find('input[type="submit"].give-submit + .give-loading-animation');a.fadeIn();var n=t.get(0);if("function"!=typeof n.checkValidity||n.checkValidity()!==!1||(a.fadeOut(),(navigator.userAgent.indexOf("Safari")!=-1&&navigator.userAgent.indexOf("Chrome")==-1)!=!1)){i.preventDefault();var o=e(this).val();e(this).val(give_global_vars.purchase_loading),e.post(give_global_vars.ajaxurl,t.serialize()+"&action=give_process_donation&give_ajax=true",function(i){"success"==e.trim(i)?(t.find(".give_errors").remove(),e(n).submit(),t.trigger("give_form_validation_passed")):(t.find('input[type="submit"].give-submit').val(o),a.fadeOut(),t.find(".give_errors").remove(),t.find('input[type="submit"].give-submit').before(i))})}})});
9
  var give_scripts,give_global_vars;jQuery(function(e){function a(){var a=e(this),i=a.parents("form");if("card_state"!=a.attr("id")){i.find("#card_state").empty().append('<option value="1">'+give_global_vars.general_loading+"</option>").prop("disabled",!0);var t={action:"give_get_states",country:a.val(),field_name:"card_state"};e.ajax({type:"POST",data:t,url:give_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(e){if("nostates"==e){var a='<input type="text" id="card_state" name="card_state" class="cart-state give-input required" value=""/>';i.find('input[name="card_state"], select[name="card_state"]').replaceWith(a)}else i.find('input[name="card_state"], select[name="card_state"]').replaceWith(e);v.trigger("give_checkout_billing_address_updated",[e,i.attr("id")])}}).fail(function(e){window.console&&window.console.log&&console.log(e)})}return!1}function i(){var a=e("form.give-form");a.each(function(a,i){i=e(i);var t=i.find(".card-number"),n=i.find(".card-cvc"),o=i.find(".card-expiry");t.length&&(t.payment("formatCardNumber"),n.payment("formatCardCVC"),o.payment("formatCardExpiry"))})}function t(e,a){return"after"==give_global_vars.currency_pos&&(a.format="%v%s"),accounting.formatMoney(e,a).trim()}function n(e){return Math.abs(parseFloat(accounting.unformat(e,give_global_vars.decimal_separator)))}function o(e){var a={symbol:"",decimal:give_global_vars.decimal_separator,thousand:give_global_vars.thousands_separator,precision:give_global_vars.number_decimals};return accounting.formatMoney(e,a)}function r(a){var i=[];return a.hasClass("give-form-type-multi")?(e.each(a.find(".give-donation-levels-wrap [data-price-id] "),function(e,a){a=a instanceof jQuery?a:jQuery(a),i.push({price_id:a.data("price-id"),amount:n(a.val())})}),i):i}function d(a){var i=a.parents("form"),t=a.val(),o=a.data("price-id");return void 0==o&&(o=a.find("option:selected").data("price-id")),"custom"===t?(i.find(".give-amount-top").val("").focus(),!1):(i.find(".give-amount-top").val(t),i.find("span.give-amount-top").text(t),e(".give-donation-amount .give-text-input",i).data("amount",n(i.find(".give-final-total-amount").data("total"))),i.find(".give-donation-amount .give-text-input").trigger("blur",[i,t,o]),void e(document).trigger("give_donation_value_updated",[i,t,o]))}function l(){var a=s("form-id"),i=s("payment-mode");if(!a||!i)return!1;var t=e("body").find("#give-form-"+a+"-wrap"),n=t.find("form.give-form"),o=t.hasClass("give-display-modal"),r=t.hasClass("give-display-reveal");n.find("#give-gateway-radio-list label").removeClass("give-gateway-option-selected"),n.find("input[name=payment-mode][value="+i+"]").prop("checked",!0).parent().addClass("give-gateway-option-selected");var l=s("level-id"),v=n.find('*[data-price-id="'+l+'"]');v.length>0&&d(v),o?give_open_form_modal(t,n):r&&(n.find(".give-btn-reveal").hide(),n.find("#give-payment-mode-select, #give_purchase_form_wrap").slideDown())}function s(e,a){a||(a=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),t=i.exec(a);return t?t[2]?decodeURIComponent(t[2].replace(/\+/g," ")):"":null}var v=e(document);v.on("change","#give_cc_address input.card_state, #give_cc_address select",a),i(),v.on("give_gateway_loaded",function(e){i()}),e.fn.toggleError=function(e){return this.toggleClass("error",e),this.toggleClass("valid",!e),this},v.on("keyup change focusout",".give-form .card-number, .give-form .card-cvc, .give-form .card-expiry",function(a){var i=e(this),t=i.parents("form.give-form"),n=i.attr("id"),o=t.find(".card-number"),r=t.find(".card-cvc"),d=t.find(".card-expiry"),l=e.payment.cardType(o.val()),s=!1;switch(a.type){case"focusout":n.indexOf("card_number")>-1?(s=!e.payment.validateCardNumber(o.val()),o.toggleError(s)):n.indexOf("card_cvc")>-1?(s=!e.payment.validateCardCVC(r.val(),l),r.toggleError(s)):n.indexOf("card_expiry")>-1&&(s=!e.payment.validateCardExpiry(d.payment("cardExpiryVal")),d.toggleError(s)),i.parents("form").find(".give-submit").prop("disabled",s);break;default:if(i.hasClass("error")&&i.removeClass("error"),n.indexOf("card_number")>-1){var v=t.find(".card-type");null===l?(v.removeClass().addClass("off card-type"),i.removeClass("valid").addClass("error")):v.removeClass().addClass("card-type "+l)}else if(n.indexOf("card_expiry")>-1){var c=d.payment("cardExpiryVal");t.find(".card-expiry-month").val(c.month),t.find(".card-expiry-year").val(c.year)}}}),v.on("submit","#give_payment_mode",function(){var a=e("#give-gateway option:selected").val();if(0==a)return alert(give_global_vars.no_gateway),!1}),v.on("click","#give-payment-mode-select input",function(){var a=e(this).parents("form"),i=e("#give-payment-mode-select li"),t=e('#give-payment-mode-select li.give-gateway-option-selected input[name="payment-mode"]').val(),n="";i.removeClass("give-gateway-option-selected"),i.prop("checked",!1),e(this).prop("checked",!0),e(this).parent().addClass("give-gateway-option-selected"),n=e('#give-payment-mode-select li.give-gateway-option-selected input[name="payment-mode"]').val(),a.attr("action",a.attr("action").replace("payment-mode="+t,"payment-mode="+n))}),v.on("focus",".give-donation-amount .give-text-input",function(a){var i=e(this).parents("form");e(this).removeClass("invalid-amount");var t=i.find(".give-final-total-amount").data("total");e(this).data("amount",n(t)),e(this).parent(".give-donation-amount").addClass("give-custom-amount-focus-in"),i.find(".give-default-level, .give-radio-input").removeClass("give-default-level"),i.find(".give-btn-level-custom").addClass("give-default-level"),i.find(".give-radio-input").prop("checked",!1),i.find(".give-radio-input.give-radio-level-custom").prop("checked",!0),i.find(".give-select-level").prop("selected",!1),i.find(".give-select-level .give-donation-level-custom").prop("selected",!0)}),v.on("blur",".give-donation-amount .give-text-input",function(a,i,d,l){var s=void 0!=i?i:e(this).closest("form"),v=e(this).data("amount"),c=void 0!=d?d:e(this).val(),g=s.find('input[name="give-form-minimum"]'),u=n(g.val()),m=0==c?u:n(c),p=r(e(this).parents("form")),f="";l=void 0!=l?l:-1;var _={symbol:"",decimal:give_global_vars.decimal_separator,thousand:give_global_vars.thousands_separator,precision:give_global_vars.number_decimals},h=t(m,_);if(e(this).val(h),!p.length||-1<l||(e.each(p,function(e,a){if(a.amount===m)return l=a.price_id,!1}),!(-1<l)&&u<=m&&(l="custom")),(m<u||m<1)&&-1===l){e(this).addClass("give-invalid-amount"),_.symbol=give_global_vars.currency_sign,f=give_global_vars.bad_minimum+" "+t(u,_),s.find(".give-submit").prop("disabled",!0);var y=s.find(".give-invalid-minimum");if(0===y.length){var b=e('<div class="give_error give-invalid-minimum">'+f+"</div>").hide();b.insertBefore(s.find(".give-total-wrap")).show()}}else e(this).removeClass("give-invalid-amount"),s.find(".give-invalid-minimum").slideUp(300,function(){e(this).remove()}),s.find(".give-submit").prop("disabled",!1);if(v!==m&&(_.symbol=give_global_vars.currency_sign,s.find(".give-final-total-amount").data("total",m).text(t(m,_))),-1!==l)switch(e('input[name="give-price-id"]',s).val(l),s.find(".give-amount-hidden").val(o(m)),s.find(".give-default-level").removeClass("give-default-level"),!0){case!!s.find(".give-radio-input").length:s.find(".give-radio-input").prop("checked",!1),s.find('.give-radio-input[data-price-id="'+l+'"]').prop("checked",!0).addClass("give-default-level");break;case!!s.find("button.give-donation-level-btn").length:s.find("button.give-donation-level-btn").blur(),s.find('button.give-donation-level-btn[data-price-id="'+l+'"]').focus().addClass("give-default-level");break;case!!s.find("select.give-select-level").length:s.find("select.give-select-level option").prop("selected",!1),s.find('select.give-select-level option[data-price-id="'+l+'"]').prop("selected",!0).addClass("give-default-level")}e(this).parent(".give-donation-amount").removeClass("give-custom-amount-focus-in")}),v.on("click touchend",".give-donation-level-btn",function(a){a.preventDefault(),d(e(this))}),v.on("click touchend",".give-radio-input-level",function(a){d(e(this))}),v.on("change",".give-select-level",function(a){d(e(this))}),l(),v.on("click",".give_terms_links",function(a){a.preventDefault();var i=e(this).closest("fieldset");return e("[class^=give_terms-]",i).slideToggle(),e("a.give_terms_links",i).toggle(),!1})});
10
  function give_open_form_modal(e,t){var n="#give_purchase_form_wrap, #give-payment-mode-select, .mfp-close, .give-hidden";jQuery.magnificPopup.open({mainClass:give_global_vars.magnific_options.main_class,closeOnBgClick:give_global_vars.magnific_options.close_on_bg_click,fixedContentPos:!0,fixedBgPos:!0,items:{src:t,type:"inline"},callbacks:{beforeOpen:function(){if(e.hasClass("give-display-button-only")&&!t.data("content")){var n=jQuery(".give-form-content-wrap",e),i=jQuery(".give-form-title",e),r=jQuery(".give-goal-progress",e),a=jQuery(">.give_error",e),o=jQuery(".give_errors",e);n.length&&!jQuery(".give-form-content-wrap",t).length&&(n.hasClass("give_post_form-content")?t.append(n):t.prepend(n)),o.length&&!jQuery(".give_errors",t).length&&o.each(function(e,n){t.prepend(jQuery(n))}),a.length&&!jQuery(">.give_error",t).length&&a.each(function(e,n){t.prepend(jQuery(n))}),r.length&&!jQuery(".give-goal-progress",t).length&&t.prepend(r),i.length&&!jQuery(".give-form-title",t).length&&t.prepend(i),t.data("content","loaded")}},open:function(){var i=jQuery(".mfp-content");i.outerWidth()>=500&&i.addClass("give-responsive-mfp-content"),e.hasClass("give-display-button-only")&&(n=t.children().not(".give-hidden, .give-btn-modal")),t.children().not(n).hide()},close:function(){t.removeClass("mfp-hide"),t.children().not(n).show()}}})}function give_fl_trigger(){var e={exclude:['#give-amount, .give-select-level, .multiselect, .give-repeater-table input, input[type="url"]'],customEvent:give_fl_custom_events};jQuery(".float-labels-enabled").floatlabels(e)}function give_fl_custom_events(e){e.hasClass("card-number")&&e.after('<span class="off card-type"/>')}function give_change_html5_form_field_validation_message(){var e,t=jQuery(".give-form");t.length&&jQuery.each(t,function(t,n){e=jQuery("input",n),e.length&&jQuery.each(e,function(e,t){t=jQuery(t).get(0),give_global_vars.form_translation.hasOwnProperty(t.name)&&(t.oninvalid=function(e){e.target.setCustomValidity(""),e.target.validity.valid||e.target.setCustomValidity(give_global_vars.form_translation[t.name])})})})}var give_scripts;jQuery(function(e){var t=e(document);give_fl_trigger(),give_change_html5_form_field_validation_message(),t.on("give_gateway_loaded",function(e,t,n){give_fl_trigger()}),t.on("give_checkout_billing_address_updated",function(t,n,i){var r=e("form#"+i);if(r.hasClass("float-labels-enabled")){var a=r.find("#give-card-state-wrap"),o=a.find("#card_state"),l=a.find('label[for="card_state"]');l=l.length?l.text().replace(/[*:]/g,"").trim():"","nostates"===n?o.attr("placeholder",l).parent().removeClass("styled select"):(o.children().first().text(l),o.parent().addClass("styled select")),o.parent().removeClass("is-active"),give_fl_trigger()}}),t.on("click",".give-btn-reveal",function(t){t.preventDefault();var n=e(this),i=e(this).parents("form"),r="#give-payment-mode-select",a=e(r),o="";return n.hide(),e("li",a).length>1&&(o=r+", "),i.find(o+"#give_purchase_form_wrap").slideDown(),!1}),t.on("click",".give-btn-modal",function(t){t.preventDefault();var n=e(this).parents("div.give-form-wrap"),i=n.find("form.give-form"),r=i.find("#give-amount"),a=r.val();return!a||a<=0?(r.focus(),!1):void give_open_form_modal(n,i)})});
give.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
6
  * Author: WordImpress
7
  * Author URI: https://wordimpress.com
8
- * Version: 1.8.9
9
  * Text Domain: give
10
  * Domain Path: /languages
11
  * GitHub Plugin URI: https://github.com/WordImpress/Give
@@ -311,7 +311,7 @@ if ( ! class_exists( 'Give' ) ) :
311
 
312
  // Plugin version
313
  if ( ! defined( 'GIVE_VERSION' ) ) {
314
- define( 'GIVE_VERSION', '1.8.9' );
315
  }
316
 
317
  // Plugin Folder Path
5
  * Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
6
  * Author: WordImpress
7
  * Author URI: https://wordimpress.com
8
+ * Version: 1.8.10
9
  * Text Domain: give
10
  * Domain Path: /languages
11
  * GitHub Plugin URI: https://github.com/WordImpress/Give
311
 
312
  // Plugin version
313
  if ( ! defined( 'GIVE_VERSION' ) ) {
314
+ define( 'GIVE_VERSION', '1.8.10' );
315
  }
316
 
317
  // Plugin Folder Path
includes/admin/tools/logs/class-api-requests-logs-list-table.php CHANGED
@@ -288,9 +288,10 @@ class Give_API_Request_Log_Table extends WP_List_Table {
288
  $logs_data = array();
289
  $paged = $this->get_paged();
290
  $log_query = array(
291
- 'log_type' => 'api_request',
292
- 'paged' => $paged,
293
- 'meta_query' => $this->get_meta_query(),
 
294
  );
295
 
296
  $logs = $give_logs->get_connected_logs( $log_query );
288
  $logs_data = array();
289
  $paged = $this->get_paged();
290
  $log_query = array(
291
+ 'log_type' => 'api_request',
292
+ 'paged' => $paged,
293
+ 'meta_query' => $this->get_meta_query(),
294
+ 'posts_per_page' => $this->per_page,
295
  );
296
 
297
  $logs = $give_logs->get_connected_logs( $log_query );
includes/admin/tools/logs/class-gateway-error-logs-list-table.php CHANGED
@@ -176,8 +176,9 @@ class Give_Gateway_Error_Log_Table extends WP_List_Table {
176
  $logs_data = array();
177
  $paged = $this->get_paged();
178
  $log_query = array(
179
- 'log_type' => 'gateway_error',
180
- 'paged' => $paged
 
181
  );
182
 
183
  $logs = $give_logs->get_connected_logs( $log_query );
@@ -258,7 +259,7 @@ class Give_Gateway_Error_Log_Table extends WP_List_Table {
258
  $this->set_pagination_args( array(
259
  'total_items' => $total_items,
260
  'per_page' => $this->per_page,
261
- 'total_pages' => ceil( $total_items / $this->per_page )
262
  )
263
  );
264
  }
176
  $logs_data = array();
177
  $paged = $this->get_paged();
178
  $log_query = array(
179
+ 'log_type' => 'gateway_error',
180
+ 'paged' => $paged,
181
+ 'posts_per_page' => $this->per_page,
182
  );
183
 
184
  $logs = $give_logs->get_connected_logs( $log_query );
259
  $this->set_pagination_args( array(
260
  'total_items' => $total_items,
261
  'per_page' => $this->per_page,
262
+ 'total_pages' => ceil( $total_items / $this->per_page ),
263
  )
264
  );
265
  }
includes/admin/tools/logs/class-sales-logs-list-table.php CHANGED
@@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
13
  exit;
14
  }
15
 
16
- // Load WP_List_Table if not loaded
17
  if ( ! class_exists( 'WP_List_Table' ) ) {
18
  require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
19
  }
@@ -205,8 +205,9 @@ class Give_Sales_Log_Table extends WP_List_Table {
205
  *
206
  * This is used to return log entries that match our search query, user query, or form query
207
  *
208
- * @access public
209
  * @since 1.0
 
 
210
  * @return array $meta_query
211
  */
212
  public function get_meta_query() {
@@ -215,7 +216,7 @@ class Give_Sales_Log_Table extends WP_List_Table {
215
  $meta_query = array();
216
 
217
  if ( $user ) {
218
- // Show only logs from a specific user
219
  $meta_query[] = array(
220
  'key' => '_give_log_user_id',
221
  'value' => $user,
@@ -225,7 +226,7 @@ class Give_Sales_Log_Table extends WP_List_Table {
225
  $search = $this->get_search();
226
  if ( $search ) {
227
  if ( is_email( $search ) ) {
228
- // This is an email search. We use this to ensure it works for guest users and logged-in users
229
  $key = '_give_log_user_info';
230
  $compare = 'LIKE';
231
  } else {
@@ -238,10 +239,10 @@ class Give_Sales_Log_Table extends WP_List_Table {
238
  $user = get_user_by( 'login', $search );
239
 
240
  if ( $user ) {
241
- // Found one, set meta value to user's ID
242
  $search = $user->ID;
243
  } else {
244
- // No user found so let's do a real search query
245
  $users = new WP_User_Query( array(
246
  'search' => $search,
247
  'search_columns' => array( 'user_url', 'user_nicename' ),
@@ -259,7 +260,7 @@ class Give_Sales_Log_Table extends WP_List_Table {
259
  }
260
 
261
  if ( ! $this->file_search ) {
262
- // Meta query only works for non file name searche
263
  $meta_query[] = array(
264
  'key' => $key,
265
  'value' => $search,
@@ -332,10 +333,11 @@ class Give_Sales_Log_Table extends WP_List_Table {
332
  $user = $this->get_filtered_user();
333
 
334
  $log_query = array(
335
- 'post_parent' => $give_form,
336
- 'log_type' => 'sale',
337
- 'paged' => $paged,
338
- 'meta_query' => $this->get_meta_query(),
 
339
  );
340
 
341
  $cache_key = Give_Cache::get_key( 'get_logs', $log_query );
@@ -348,7 +350,7 @@ class Give_Sales_Log_Table extends WP_List_Table {
348
  foreach ( $logs as $log ) {
349
  $payment_id = give_get_meta( $log->ID, '_give_log_payment_id', true );
350
 
351
- // Make sure this payment hasn't been deleted
352
  if ( get_post( $payment_id ) ) :
353
  $user_info = give_get_payment_meta_user_info( $payment_id );
354
  $payment_meta = give_get_payment_meta( $payment_id );
13
  exit;
14
  }
15
 
16
+ // Load WP_List_Table if not loaded.
17
  if ( ! class_exists( 'WP_List_Table' ) ) {
18
  require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
19
  }
205
  *
206
  * This is used to return log entries that match our search query, user query, or form query
207
  *
 
208
  * @since 1.0
209
+ * @access public
210
+ *
211
  * @return array $meta_query
212
  */
213
  public function get_meta_query() {
216
  $meta_query = array();
217
 
218
  if ( $user ) {
219
+ // Show only logs from a specific user.
220
  $meta_query[] = array(
221
  'key' => '_give_log_user_id',
222
  'value' => $user,
226
  $search = $this->get_search();
227
  if ( $search ) {
228
  if ( is_email( $search ) ) {
229
+ // This is an email search. We use this to ensure it works for guest users and logged-in users.
230
  $key = '_give_log_user_info';
231
  $compare = 'LIKE';
232
  } else {
239
  $user = get_user_by( 'login', $search );
240
 
241
  if ( $user ) {
242
+ // Found one, set meta value to user's ID.
243
  $search = $user->ID;
244
  } else {
245
+ // No user found so let's do a real search query.
246
  $users = new WP_User_Query( array(
247
  'search' => $search,
248
  'search_columns' => array( 'user_url', 'user_nicename' ),
260
  }
261
 
262
  if ( ! $this->file_search ) {
263
+ // Meta query only works for non file name search.
264
  $meta_query[] = array(
265
  'key' => $key,
266
  'value' => $search,
333
  $user = $this->get_filtered_user();
334
 
335
  $log_query = array(
336
+ 'post_parent' => $give_form,
337
+ 'log_type' => 'sale',
338
+ 'paged' => $paged,
339
+ 'meta_query' => $this->get_meta_query(),
340
+ 'posts_per_page' => $this->per_page,
341
  );
342
 
343
  $cache_key = Give_Cache::get_key( 'get_logs', $log_query );
350
  foreach ( $logs as $log ) {
351
  $payment_id = give_get_meta( $log->ID, '_give_log_payment_id', true );
352
 
353
+ // Make sure this payment hasn't been deleted.
354
  if ( get_post( $payment_id ) ) :
355
  $user_info = give_get_payment_meta_user_info( $payment_id );
356
  $payment_meta = give_get_payment_meta( $payment_id );
includes/emails/class-give-email-tags.php CHANGED
@@ -261,8 +261,8 @@ function give_load_email_tags() {
261
  */
262
  do_action( 'give_add_email_tags' );
263
  }
 
264
 
265
- add_action( 'give_init', 'give_load_email_tags' );
266
 
267
  /**
268
  * Add default Give email template tags.
@@ -275,82 +275,82 @@ function give_setup_email_tags() {
275
  $email_tags = array(
276
  array(
277
  'tag' => 'donation',
278
- 'description' => esc_html__( 'The donation form name, and the donation level (if applicable).', 'give' ),
279
  'function' => 'give_email_tag_donation'
280
  ),
281
  array(
282
  'tag' => 'form_title',
283
- 'description' => esc_html__( 'The donation form name.', 'give' ),
284
  'function' => 'give_email_tag_form_title'
285
  ),
286
  array(
287
  'tag' => 'amount',
288
- 'description' => esc_html__( 'The total donation amount with currency sign.', 'give' ),
289
  'function' => 'give_email_tag_amount'
290
  ),
291
  array(
292
  'tag' => 'price',
293
- 'description' => esc_html__( 'The total donation amount with currency sign.', 'give' ),
294
  'function' => 'give_email_tag_price'
295
  ),
296
  array(
297
  'tag' => 'name',
298
- 'description' => esc_html__( 'The donor\'s first name.', 'give' ),
299
  'function' => 'give_email_tag_first_name'
300
  ),
301
  array(
302
  'tag' => 'fullname',
303
- 'description' => esc_html__( 'The donor\'s full name, first and last.', 'give' ),
304
  'function' => 'give_email_tag_fullname'
305
  ),
306
  array(
307
  'tag' => 'username',
308
- 'description' => esc_html__( 'The donor\'s user name on the site, if they registered an account.', 'give' ),
309
  'function' => 'give_email_tag_username'
310
  ),
311
  array(
312
  'tag' => 'user_email',
313
- 'description' => esc_html__( 'The donor\'s email address.', 'give' ),
314
  'function' => 'give_email_tag_user_email'
315
  ),
316
  array(
317
  'tag' => 'billing_address',
318
- 'description' => esc_html__( 'The donor\'s billing address.', 'give' ),
319
  'function' => 'give_email_tag_billing_address'
320
  ),
321
  array(
322
  'tag' => 'date',
323
- 'description' => esc_html__( 'The date of the donation.', 'give' ),
324
  'function' => 'give_email_tag_date'
325
  ),
326
  array(
327
  'tag' => 'payment_id',
328
- 'description' => esc_html__( 'The unique ID number for this donation.', 'give' ),
329
  'function' => 'give_email_tag_payment_id'
330
  ),
331
  array(
332
  'tag' => 'receipt_id',
333
- 'description' => esc_html__( 'The unique ID number for this donation receipt.', 'give' ),
334
  'function' => 'give_email_tag_receipt_id'
335
  ),
336
  array(
337
  'tag' => 'payment_method',
338
- 'description' => esc_html__( 'The method of payment used for this donation.', 'give' ),
339
  'function' => 'give_email_tag_payment_method'
340
  ),
341
  array(
342
  'tag' => 'sitename',
343
- 'description' => esc_html__( 'The name of your site.', 'give' ),
344
  'function' => 'give_email_tag_sitename'
345
  ),
346
  array(
347
  'tag' => 'receipt_link',
348
- 'description' => esc_html__( 'The donation receipt direct link, to view the receipt on the website.', 'give' ),
349
  'function' => 'give_email_tag_receipt_link'
350
  ),
351
  array(
352
  'tag' => 'receipt_link_url',
353
- 'description' => esc_html__( 'The donation receipt direct URL, to view the receipt on the website.', 'give' ),
354
  'function' => 'give_email_tag_receipt_link_url'
355
  ),
356
  );
261
  */
262
  do_action( 'give_add_email_tags' );
263
  }
264
+ add_action( 'init', 'give_load_email_tags', - 999 );
265
 
 
266
 
267
  /**
268
  * Add default Give email template tags.
275
  $email_tags = array(
276
  array(
277
  'tag' => 'donation',
278
+ 'description' => __( 'The donation form name, and the donation level (if applicable).', 'give' ),
279
  'function' => 'give_email_tag_donation'
280
  ),
281
  array(
282
  'tag' => 'form_title',
283
+ 'description' => __( 'The donation form name.', 'give' ),
284
  'function' => 'give_email_tag_form_title'
285
  ),
286
  array(
287
  'tag' => 'amount',
288
+ 'description' => __( 'The total donation amount with currency sign.', 'give' ),
289
  'function' => 'give_email_tag_amount'
290
  ),
291
  array(
292
  'tag' => 'price',
293
+ 'description' => __( 'The total donation amount with currency sign.', 'give' ),
294
  'function' => 'give_email_tag_price'
295
  ),
296
  array(
297
  'tag' => 'name',
298
+ 'description' => __( 'The donor\'s first name.', 'give' ),
299
  'function' => 'give_email_tag_first_name'
300
  ),
301
  array(
302
  'tag' => 'fullname',
303
+ 'description' => __( 'The donor\'s full name, first and last.', 'give' ),
304
  'function' => 'give_email_tag_fullname'
305
  ),
306
  array(
307
  'tag' => 'username',
308
+ 'description' => __( 'The donor\'s user name on the site, if they registered an account.', 'give' ),
309
  'function' => 'give_email_tag_username'
310
  ),
311
  array(
312
  'tag' => 'user_email',
313
+ 'description' => __( 'The donor\'s email address.', 'give' ),
314
  'function' => 'give_email_tag_user_email'
315
  ),
316
  array(
317
  'tag' => 'billing_address',
318
+ 'description' => __( 'The donor\'s billing address.', 'give' ),
319
  'function' => 'give_email_tag_billing_address'
320
  ),
321
  array(
322
  'tag' => 'date',
323
+ 'description' => __( 'The date of the donation.', 'give' ),
324
  'function' => 'give_email_tag_date'
325
  ),
326
  array(
327
  'tag' => 'payment_id',
328
+ 'description' => __( 'The unique ID number for this donation.', 'give' ),
329
  'function' => 'give_email_tag_payment_id'
330
  ),
331
  array(
332
  'tag' => 'receipt_id',
333
+ 'description' => __( 'The unique ID number for this donation receipt.', 'give' ),
334
  'function' => 'give_email_tag_receipt_id'
335
  ),
336
  array(
337
  'tag' => 'payment_method',
338
+ 'description' => __( 'The method of payment used for this donation.', 'give' ),
339
  'function' => 'give_email_tag_payment_method'
340
  ),
341
  array(
342
  'tag' => 'sitename',
343
+ 'description' => __( 'The name of your site.', 'give' ),
344
  'function' => 'give_email_tag_sitename'
345
  ),
346
  array(
347
  'tag' => 'receipt_link',
348
+ 'description' => __( 'The donation receipt direct link, to view the receipt on the website.', 'give' ),
349
  'function' => 'give_email_tag_receipt_link'
350
  ),
351
  array(
352
  'tag' => 'receipt_link_url',
353
+ 'description' => __( 'The donation receipt direct URL, to view the receipt on the website.', 'give' ),
354
  'function' => 'give_email_tag_receipt_link_url'
355
  ),
356
  );
includes/process-donation.php CHANGED
@@ -207,7 +207,6 @@ add_action( 'give_checkout_error_checks', 'give_check_logged_in_user_for_existin
207
  * @return void
208
  */
209
  function give_process_form_login() {
210
-
211
  $is_ajax = isset( $_POST['give_ajax'] );
212
 
213
  $user_data = give_donation_form_validate_user_login();
@@ -219,8 +218,11 @@ function give_process_form_login() {
219
  *
220
  * @since 1.0
221
  */
222
- do_action( 'give_ajax_donation_errors' );
223
- give_die();
 
 
 
224
  } else {
225
  wp_redirect( $_SERVER['HTTP_REFERER'] );
226
  exit;
@@ -230,8 +232,17 @@ function give_process_form_login() {
230
  give_log_user_in( $user_data['user_id'], $user_data['user_login'], $user_data['user_pass'] );
231
 
232
  if ( $is_ajax ) {
233
- echo 'success';
234
- give_die();
 
 
 
 
 
 
 
 
 
235
  } else {
236
  wp_redirect( $_SERVER['HTTP_REFERER'] );
237
  }
207
  * @return void
208
  */
209
  function give_process_form_login() {
 
210
  $is_ajax = isset( $_POST['give_ajax'] );
211
 
212
  $user_data = give_donation_form_validate_user_login();
218
  *
219
  * @since 1.0
220
  */
221
+ ob_start();
222
+ do_action( 'give_ajax_donation_errors' );
223
+ $message = ob_get_contents();
224
+ ob_end_clean();
225
+ wp_send_json_error( $message );
226
  } else {
227
  wp_redirect( $_SERVER['HTTP_REFERER'] );
228
  exit;
232
  give_log_user_in( $user_data['user_id'], $user_data['user_login'], $user_data['user_pass'] );
233
 
234
  if ( $is_ajax ) {
235
+ $message = Give()->notices->print_frontend_notice(
236
+ sprintf(
237
+ /* translators: %s: user first name */
238
+ esc_html__( 'Welcome %s! You have successfully logged into your account.', 'give' ),
239
+ ( ! empty( $user_data['user_first'] ) ) ? $user_data['user_first'] : $user_data['user_login']
240
+ ),
241
+ false,
242
+ 'success'
243
+ );
244
+
245
+ wp_send_json_success( $message );
246
  } else {
247
  wp_redirect( $_SERVER['HTTP_REFERER'] );
248
  }
languages/give.pot CHANGED
@@ -1087,7 +1087,7 @@ msgstr ""
1087
  msgid "Nonce verification failed."
1088
  msgstr ""
1089
 
1090
- #: includes/admin/donors/donor-actions.php:492, includes/login-register.php:254, includes/process-donation.php:538, includes/process-donation.php:712, includes/user-functions.php:359
1091
  msgid "Invalid email."
1092
  msgstr ""
1093
 
@@ -1705,7 +1705,7 @@ msgstr ""
1705
  msgid "Search"
1706
  msgstr ""
1707
 
1708
- #: includes/admin/payments/class-payments-table.php:245, includes/admin/tools/logs/class-sales-logs-list-table.php:307, includes/class-give-html-elements.php:398
1709
  msgid "All"
1710
  msgstr ""
1711
 
@@ -1761,7 +1761,7 @@ msgstr ""
1761
  msgid "via"
1762
  msgstr ""
1763
 
1764
- #: includes/admin/payments/class-payments-table.php:365, includes/admin/shortcodes/abstract-shortcode-generator.php:296, includes/admin/tools/logs/class-sales-logs-list-table.php:74, includes/admin/tools/logs/class-sales-logs-list-table.php:310, includes/class-give-html-elements.php:137, includes/forms/widget.php:155
1765
  msgid "Untitled (#%s)"
1766
  msgstr ""
1767
 
@@ -5910,7 +5910,7 @@ msgstr ""
5910
  msgid "Your password"
5911
  msgstr ""
5912
 
5913
- #: includes/forms/template.php:1297, includes/process-donation.php:655, templates/shortcode-login.php:40
5914
  msgid "Reset Password"
5915
  msgstr ""
5916
 
@@ -6222,11 +6222,11 @@ msgstr ""
6222
  msgid "We're sorry, your donation failed to process. Please try again or contact site support."
6223
  msgstr ""
6224
 
6225
- #: includes/login-register.php:111, includes/process-donation.php:653
6226
  msgid "The password you entered is incorrect."
6227
  msgstr ""
6228
 
6229
- #: includes/login-register.php:114, includes/process-donation.php:676
6230
  msgid "The username you entered does not exist."
6231
  msgstr ""
6232
 
@@ -6658,75 +6658,79 @@ msgstr ""
6658
  msgid "You are logged in as %1$s, and are submitting a donation as %2$s, which is an existing donor. To ensure that the email address is tied to the correct donor, please submit this donation from a logged-out browser, or choose another email address."
6659
  msgstr ""
6660
 
6661
- #: includes/process-donation.php:273
 
 
 
 
6662
  msgid "Honeypot field detected. Go away bad bot!"
6663
  msgstr ""
6664
 
6665
- #: includes/process-donation.php:338
6666
  msgid "Please insert a valid donation amount."
6667
  msgstr ""
6668
 
6669
- #: includes/process-donation.php:347
6670
  msgid "This form has a minimum donation amount of %s."
6671
  msgstr ""
6672
 
6673
- #: includes/process-donation.php:360
6674
  msgid "The selected payment gateway is not enabled."
6675
  msgstr ""
6676
 
6677
- #: includes/process-donation.php:410, includes/scripts.php:66
6678
  msgid "You must agree to the terms and conditions."
6679
  msgstr ""
6680
 
6681
- #: includes/process-donation.php:431, includes/scripts.php:62
6682
  msgid "Please enter a valid email address."
6683
  msgstr ""
6684
 
6685
- #: includes/process-donation.php:435, includes/scripts.php:61
6686
  msgid "Please enter your first name."
6687
  msgstr ""
6688
 
6689
- #: includes/process-donation.php:444
6690
  msgid "Please enter your primary billing address."
6691
  msgstr ""
6692
 
6693
- #: includes/process-donation.php:448
6694
  msgid "Please enter your zip / postal code."
6695
  msgstr ""
6696
 
6697
- #: includes/process-donation.php:452
6698
  msgid "Please enter your billing city."
6699
  msgstr ""
6700
 
6701
- #: includes/process-donation.php:456
6702
  msgid "Please select your billing country."
6703
  msgstr ""
6704
 
6705
- #: includes/process-donation.php:460
6706
  msgid "Please enter billing state / province."
6707
  msgstr ""
6708
 
6709
- #: includes/process-donation.php:542
6710
  msgid "The user information is invalid."
6711
  msgstr ""
6712
 
6713
- #: includes/process-donation.php:631, includes/user-functions.php:319
6714
  msgid "You must register or login to complete your donation."
6715
  msgstr ""
6716
 
6717
- #: includes/process-donation.php:672, includes/scripts.php:64, includes/user-functions.php:401
6718
  msgid "Enter a password."
6719
  msgstr ""
6720
 
6721
- #: includes/process-donation.php:701
6722
  msgid "You must be logged in to donate."
6723
  msgstr ""
6724
 
6725
- #: includes/process-donation.php:725, includes/user-functions.php:354
6726
  msgid "Enter an email."
6727
  msgstr ""
6728
 
6729
- #: includes/process-donation.php:898
6730
  msgid "The zip / postal code you entered for your billing address is invalid."
6731
  msgstr ""
6732
 
1087
  msgid "Nonce verification failed."
1088
  msgstr ""
1089
 
1090
+ #: includes/admin/donors/donor-actions.php:492, includes/login-register.php:254, includes/process-donation.php:549, includes/process-donation.php:723, includes/user-functions.php:359
1091
  msgid "Invalid email."
1092
  msgstr ""
1093
 
1705
  msgid "Search"
1706
  msgstr ""
1707
 
1708
+ #: includes/admin/payments/class-payments-table.php:245, includes/admin/tools/logs/class-sales-logs-list-table.php:308, includes/class-give-html-elements.php:398
1709
  msgid "All"
1710
  msgstr ""
1711
 
1761
  msgid "via"
1762
  msgstr ""
1763
 
1764
+ #: includes/admin/payments/class-payments-table.php:365, includes/admin/shortcodes/abstract-shortcode-generator.php:296, includes/admin/tools/logs/class-sales-logs-list-table.php:74, includes/admin/tools/logs/class-sales-logs-list-table.php:311, includes/class-give-html-elements.php:137, includes/forms/widget.php:155
1765
  msgid "Untitled (#%s)"
1766
  msgstr ""
1767
 
5910
  msgid "Your password"
5911
  msgstr ""
5912
 
5913
+ #: includes/forms/template.php:1297, includes/process-donation.php:666, templates/shortcode-login.php:40
5914
  msgid "Reset Password"
5915
  msgstr ""
5916
 
6222
  msgid "We're sorry, your donation failed to process. Please try again or contact site support."
6223
  msgstr ""
6224
 
6225
+ #: includes/login-register.php:111, includes/process-donation.php:664
6226
  msgid "The password you entered is incorrect."
6227
  msgstr ""
6228
 
6229
+ #: includes/login-register.php:114, includes/process-donation.php:687
6230
  msgid "The username you entered does not exist."
6231
  msgstr ""
6232
 
6658
  msgid "You are logged in as %1$s, and are submitting a donation as %2$s, which is an existing donor. To ensure that the email address is tied to the correct donor, please submit this donation from a logged-out browser, or choose another email address."
6659
  msgstr ""
6660
 
6661
+ #: includes/process-donation.php:238
6662
+ msgid "Welcome %s! You have successfully logged into your account."
6663
+ msgstr ""
6664
+
6665
+ #: includes/process-donation.php:284
6666
  msgid "Honeypot field detected. Go away bad bot!"
6667
  msgstr ""
6668
 
6669
+ #: includes/process-donation.php:349
6670
  msgid "Please insert a valid donation amount."
6671
  msgstr ""
6672
 
6673
+ #: includes/process-donation.php:358
6674
  msgid "This form has a minimum donation amount of %s."
6675
  msgstr ""
6676
 
6677
+ #: includes/process-donation.php:371
6678
  msgid "The selected payment gateway is not enabled."
6679
  msgstr ""
6680
 
6681
+ #: includes/process-donation.php:421, includes/scripts.php:66
6682
  msgid "You must agree to the terms and conditions."
6683
  msgstr ""
6684
 
6685
+ #: includes/process-donation.php:442, includes/scripts.php:62
6686
  msgid "Please enter a valid email address."
6687
  msgstr ""
6688
 
6689
+ #: includes/process-donation.php:446, includes/scripts.php:61
6690
  msgid "Please enter your first name."
6691
  msgstr ""
6692
 
6693
+ #: includes/process-donation.php:455
6694
  msgid "Please enter your primary billing address."
6695
  msgstr ""
6696
 
6697
+ #: includes/process-donation.php:459
6698
  msgid "Please enter your zip / postal code."
6699
  msgstr ""
6700
 
6701
+ #: includes/process-donation.php:463
6702
  msgid "Please enter your billing city."
6703
  msgstr ""
6704
 
6705
+ #: includes/process-donation.php:467
6706
  msgid "Please select your billing country."
6707
  msgstr ""
6708
 
6709
+ #: includes/process-donation.php:471
6710
  msgid "Please enter billing state / province."
6711
  msgstr ""
6712
 
6713
+ #: includes/process-donation.php:553
6714
  msgid "The user information is invalid."
6715
  msgstr ""
6716
 
6717
+ #: includes/process-donation.php:642, includes/user-functions.php:319
6718
  msgid "You must register or login to complete your donation."
6719
  msgstr ""
6720
 
6721
+ #: includes/process-donation.php:683, includes/scripts.php:64, includes/user-functions.php:401
6722
  msgid "Enter a password."
6723
  msgstr ""
6724
 
6725
+ #: includes/process-donation.php:712
6726
  msgid "You must be logged in to donate."
6727
  msgstr ""
6728
 
6729
+ #: includes/process-donation.php:736, includes/user-functions.php:354
6730
  msgid "Enter an email."
6731
  msgstr ""
6732
 
6733
+ #: includes/process-donation.php:909
6734
  msgid "The zip / postal code you entered for your billing address is invalid."
6735
  msgstr ""
6736
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://givewp.com/
4
  Tags: donation, donations, donation plugin, wordpress donation plugin, wp donation, ecommerce, e-commerce, fundraising, fundraiser, crowdfunding, wordpress donations, commerce, wordpress ecommerce, giving, charity, donate, gifts, non-profit, paypal, stripe, churches, nonprofit, paypal donations, paypal donate, stripe donations, stripe donate, authorize.net, authorize.net donations
5
  Requires at least: 4.2
6
  Tested up to: 4.8
7
- Stable tag: 1.8.9
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -207,6 +207,11 @@ Use Give for donations, and let WooCommerce or WP eCommerce or the like handle y
207
 
208
  == Changelog ==
209
 
 
 
 
 
 
210
  = 1.8.9: July 5th, 2017 =
211
  * New: Improved the new user notification email that gets sent to admins and also improved the account information email that gets sent to donors when a donor creates an account while donating. [#1821](https://github.com/WordImpress/Give/issues/1821)
212
  * New: Added an update confirm prompt when an admin attempts to resend the donation receipt to a donor. [#1802](https://github.com/WordImpress/Give/issues/1802)
4
  Tags: donation, donations, donation plugin, wordpress donation plugin, wp donation, ecommerce, e-commerce, fundraising, fundraiser, crowdfunding, wordpress donations, commerce, wordpress ecommerce, giving, charity, donate, gifts, non-profit, paypal, stripe, churches, nonprofit, paypal donations, paypal donate, stripe donations, stripe donate, authorize.net, authorize.net donations
5
  Requires at least: 4.2
6
  Tested up to: 4.8
7
+ Stable tag: 1.8.10
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
207
 
208
  == Changelog ==
209
 
210
+ = 1.8.10: July 10th, 2017 =
211
+ * New: A login notification now displays upon successful login within a donation form. [#1384](https://github.com/WordImpress/Give/issues/1384)
212
+ * Fix: Non-core email tags were not rendering properly for some add-ons due to a change made in the way the plugin loads in the last version release. [#1839](https://github.com/WordImpress/Give/issues/1839)
213
+ * Fix: Incorrect admin pagination numbering is now fixed for logs and donations [#1378](https://github.com/WordImpress/Give/issues/1378)
214
+
215
  = 1.8.9: July 5th, 2017 =
216
  * New: Improved the new user notification email that gets sent to admins and also improved the account information email that gets sent to donors when a donor creates an account while donating. [#1821](https://github.com/WordImpress/Give/issues/1821)
217
  * New: Added an update confirm prompt when an admin attempts to resend the donation receipt to a donor. [#1802](https://github.com/WordImpress/Give/issues/1802)