110 lines
86 KiB
Plaintext
110 lines
86 KiB
Plaintext
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3.0
|
||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=97)}({1:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function u(e){o(a,r,i,u,s,"next",e)}function s(e){o(a,r,i,u,s,"throw",e)}u(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function m(e,t,n){return(m=v()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&p(o,n.prototype),o}).apply(null,arguments)}function y(e){var t="function"==typeof Map?new Map:void 0;return(y=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return m(e,arguments,h(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,e)})(e)}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?b(e):t}function _(e){var t=v();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}function O(e,t,n){return(O="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function j(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}}(e,t)||S(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e){return function(e){if(Array.isArray(e))return C(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function A(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=S(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return A})),n.d(t,"e",(function(){return k})),n.d(t,"f",(function(){return f})),n.d(t,"g",(function(){return _})),n.d(t,"h",(function(){return O})),n.d(t,"i",(function(){return h})),n.d(t,"j",(function(){return y})),n.d(t,"k",(function(){return i})),n.d(t,"l",(function(){return j})),n.d(t,"m",(function(){return b})),n.d(t,"n",(function(){return w})),n.d(t,"o",(function(){return d}))},11:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return d})),n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return m})),n.d(t,"g",(function(){return s})),n.d(t,"h",(function(){return u})),n.d(t,"i",(function(){return r}));var r,o=n(1),i=function e(t){Object(o.b)(this,e),this.streetAddress=null==t?void 0:t.streetAddress,this.extendedAddress=null==t?void 0:t.extendedAddress,this.locality=null==t?void 0:t.locality,this.region=null==t?void 0:t.region,this.postalCode=null==t?void 0:t.postalCode,this.countryCodeAlpha2=null==t?void 0:t.countryCodeAlpha2},a=function e(t){Object(o.b)(this,e),this.email=null==t?void 0:t.email,this.firstName=null==t?void 0:t.firstName,this.lastName=null==t?void 0:t.lastName},u=function e(t){Object(o.b)(this,e),this.customer=t.customer,this.billing=t.billing};!function(e){e.CreditCard="Credit Card",e.PayPal="PayPal",e.GooglePay="Google Pay",e.Venmo="Venmo",e.ApplePay="Apple Pay"}(r||(r={}));var s,c=function(){function e(t){Object(o.b)(this,e),this.donationType=t.donationType,this.amount=t.amount,this.coverFees=t.coverFees}return Object(o.c)(e,[{key:"feeAmountCovered",get:function(){return this.coverFees?this.fee:0}},{key:"fee",get:function(){return e.calculateFeeAmount(this.amount)}},{key:"total",get:function(){return e.calculateTotal(this.amount,this.coverFees)}}],[{key:"calculateTotal",value:function(e,t){var n=e+(t?this.calculateFeeAmount(e):0);return isNaN(n)?0:this.roundAmount(n)}},{key:"calculateFeeAmount",value:function(e){var t=.022*e+.3;return isNaN(t)?0:this.roundAmount(t)}},{key:"roundAmount",value:function(e){return Math.round(100*e)/100}}]),e}();!function(e){e.OneTime="one-time",e.Monthly="monthly",e.Upsell="up_sell"}(s||(s={}));var l=function e(t){Object(o.b)(this,e),this.logged_in_user=null==t?void 0:t.logged_in_user,this.referrer=null==t?void 0:t.referrer,this.fee_amount_covered=null==t?void 0:t.fee_amount_covered,this.origin=null==t?void 0:t.origin},d=function e(t){Object(o.b)(this,e),this.customFields=new l,this.paymentProvider=t.paymentProvider,this.paymentMethodNonce=t.paymentMethodNonce,this.recaptchaToken=t.recaptchaToken,this.customerId=t.customerId,this.deviceData=t.deviceData,this.upsellOnetimeTransactionId=t.upsellOnetimeTransactionId,this.bin=t.bin,this.binName=t.binName,this.amount=t.amount,this.donationType=t.donationType,this.customer=t.customer,this.billing=t.billing,t.customFields&&(this.customFields=t.customFields)},f=function e(t){Object(o.b)(this,e),this.id=t.id},h=function e(t){Object(o.b)(this,e),this.paymentProvider=t.paymentProvider,this.paymentMethodNonce=t.paymentMethodNonce,this.amount=t.amount,this.donationType=t.donationType,this.transaction_id=t.transaction_id,this.customer_id=t.customer_id,this.customer=new a(t.customer),this.billing=new i(t.billing),t.subscription&&(this.subscription=new f(t.subscription))},p=function e(t){Object(o.b)(this,e),this.code=t.code,this.message=t.message},v=function e(t){Object(o.b)(this,e),this.message=t.message;var n=t.errors,r=void 0===n?[]:n;this.errors=r.map((function(e){return new p(e)}))},m=function e(t){Object(o.b)(this,e),this.success=t.success,this.success?this.value=new h(t.value):this.value=new v(t.value)}},16:function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.a=function(){var e=window.location.search.substring(1),t={};return e.length>0&&e.split("&").forEach((function(e){var n=r(e.split("="),2),o=n[0],i=n[1];t[o]=decodeURIComponent(i)})),t}},2:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r="localhost"===location.hostname||"www-"===location.host.substr(0,4)||"cat-"===location.host.substr(0,4)||"review-"===location.host.substr(0,7)||"webdev-"===location.host.substr(0,7)||"ia-petabox-"===location.host.substr(0,11)?console.log.bind(console):function(){}},20:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},3:function(e,t,n){"use strict";n.d(t,"a",(function(){return x})),n.d(t,"b",(function(){return C})),n.d(t,"c",(function(){return y})),n.d(t,"e",(function(){return b})),n.d(t,"f",(function(){return g}));var r=n(1),o=n(4);
|
||
/**
|
||
* @license
|
||
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
* This code may only be used under the BSD style license found at
|
||
* http://polymer.github.io/LICENSE.txt
|
||
* The complete set of authors may be found at
|
||
* http://polymer.github.io/AUTHORS.txt
|
||
* The complete set of contributors may be found at
|
||
* http://polymer.github.io/CONTRIBUTORS.txt
|
||
* Code distributed by Google as part of the polymer project is also
|
||
* subject to an additional IP rights grant found at
|
||
* http://polymer.github.io/PATENTS.txt
|
||
*/
|
||
function i(e,t){for(var n=e.element.content,r=e.parts,o=document.createTreeWalker(n,133,null,!1),i=u(r),a=r[i],s=-1,c=0,l=[],d=null;o.nextNode();){s++;var f=o.currentNode;for(f.previousSibling===d&&(d=null),t.has(f)&&(l.push(f),null===d&&(d=f)),null!==d&&c++;void 0!==a&&a.index===s;)a.index=null!==d?-1:a.index-c,a=r[i=u(r,i)]}l.forEach((function(e){return e.parentNode.removeChild(e)}))}n.d(t,"d",(function(){return o.h}));var a=function(e){for(var t=11===e.nodeType?0:1,n=document.createTreeWalker(e,133,null,!1);n.nextNode();)t++;return t},u=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=t+1;n<e.length;n++){var r=e[n];if(Object(o.m)(r))return n}return-1},s=function(e,t){return"".concat(e,"--").concat(t)},c=!0;void 0===window.ShadyCSS?c=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),c=!1);var l=function(e){return function(t){var n=s(t.type,e),r=o.o.get(n);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},o.o.set(n,r));var i=r.stringsArray.get(t.strings);if(void 0!==i)return i;var a=t.strings.join(o.q);if(void 0===(i=r.keyString.get(a))){var u=t.getTemplateElement();c&&window.ShadyCSS.prepareTemplateDom(u,e),i=new o.p(t,u),r.keyString.set(a,i)}return r.stringsArray.set(t.strings,i),i}},d=["html","svg"],f=new Set;window.JSCompiler_renameProperty=function(e,t){return e};var h={toAttribute:function(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute:function(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},p=function(e,t){return t!==e&&(t==t||e==e)},v={attribute:!0,type:String,converter:h,reflect:!1,hasChanged:p},m=function(e){Object(r.f)(o,e);var t,n=Object(r.g)(o);function o(){var e;return Object(r.b)(this,o),(e=n.call(this))._updateState=0,e._instanceProperties=void 0,e._updatePromise=new Promise((function(t){return e._enableUpdatingResolver=t})),e._changedProperties=new Map,e._reflectingProperties=void 0,e.initialize(),e}return Object(r.c)(o,[{key:"initialize",value:function(){this._saveInstanceProperties(),this._requestUpdate()}},{key:"_saveInstanceProperties",value:function(){var e=this;this.constructor._classProperties.forEach((function(t,n){if(e.hasOwnProperty(n)){var r=e[n];delete e[n],e._instanceProperties||(e._instanceProperties=new Map),e._instanceProperties.set(n,r)}}))}},{key:"_applyInstanceProperties",value:function(){var e=this;this._instanceProperties.forEach((function(t,n){return e[n]=t})),this._instanceProperties=void 0}},{key:"connectedCallback",value:function(){this.enableUpdating()}},{key:"enableUpdating",value:function(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}},{key:"disconnectedCallback",value:function(){}},{key:"attributeChangedCallback",value:function(e,t,n){t!==n&&this._attributeToProperty(e,n)}},{key:"_propertyToAttribute",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v,r=this.constructor,o=r._attributeNameForProperty(e,n);if(void 0!==o){var i=r._propertyValueToAttribute(t,n);if(void 0===i)return;this._updateState=8|this._updateState,null==i?this.removeAttribute(o):this.setAttribute(o,i),this._updateState=-9&this._updateState}}},{key:"_attributeToProperty",value:function(e,t){if(!(8&this._updateState)){var n=this.constructor,r=n._attributeToPropertyMap.get(e);if(void 0!==r){var o=n.getPropertyOptions(r);this._updateState=16|this._updateState,this[r]=n._propertyValueFromAttribute(t,o),this._updateState=-17&this._updateState}}}},{key:"_requestUpdate",value:function(e,t){var n=!0;if(void 0!==e){var r=this.constructor,o=r.getPropertyOptions(e);r._valueHasChanged(this[e],t,o.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==o.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,o))):n=!1}!this._hasRequestedUpdate&&n&&(this._updatePromise=this._enqueueUpdate())}},{key:"requestUpdate",value:function(e,t){return this._requestUpdate(e,t),this.updateComplete}},{key:"_enqueueUpdate",value:(t=Object(r.k)(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._updateState=4|this._updateState,e.prev=1,e.next=4,this._updatePromise;case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:if(null==(t=this.performUpdate())){e.next=12;break}return e.next=12,t;case 12:return e.abrupt("return",!this._hasRequestedUpdate);case 13:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return t.apply(this,arguments)})},{key:"performUpdate",value:function(){this._instanceProperties&&this._applyInstanceProperties();var e=!1,t=this._changedProperties;try{(e=this.shouldUpdate(t))?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}},{key:"_markUpdated",value:function(){this._changedProperties=new Map,this._updateState=-5&this._updateState}},{key:"_getUpdateComplete",value:function(){return this._updatePromise}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){var t=this;void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((function(e,n){return t._propertyToAttribute(n,t[n],e)})),this._reflectingProperties=void 0),this._markUpdated()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}},{key:"_hasRequestedUpdate",get:function(){return 4&this._updateState}},{key:"hasUpdated",get:function(){return 1&this._updateState}},{key:"updateComplete",get:function(){return this._getUpdateComplete()}}],[{key:"_ensureClassProperties",value:function(){var e=this;if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;var t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((function(t,n){return e._classProperties.set(n,t)}))}}},{key:"createProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;if(this._ensureClassProperties(),this._classProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){var n="symbol"===Object(r.a)(e)?Symbol():"__".concat(e),o=this.getPropertyDescriptor(e,n,t);void 0!==o&&Object.defineProperty(this.prototype,e,o)}}},{key:"getPropertyDescriptor",value:function(e,t,n){return{get:function(){return this[t]},set:function(n){var r=this[e];this[t]=n,this._requestUpdate(e,r)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){return this._classProperties&&this._classProperties.get(e)||v}},{key:"finalize",value:function(){var e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){var t,n=this.properties,o=[].concat(Object(r.e)(Object.getOwnPropertyNames(n)),Object(r.e)("function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(n):[])),i=Object(r.d)(o);try{for(i.s();!(t=i.n()).done;){var a=t.value;this.createProperty(a,n[a])}}catch(e){i.e(e)}finally{i.f()}}}},{key:"_attributeNameForProperty",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}},{key:"_valueHasChanged",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p;return n(e,t)}},{key:"_propertyValueFromAttribute",value:function(e,t){var n=t.type,r=t.converter||h,o="function"==typeof r?r:r.fromAttribute;return o?o(e,n):e}},{key:"_propertyValueToAttribute",value:function(e,t){if(void 0!==t.reflect){var n=t.type,r=t.converter;return(r&&r.toAttribute||h.toAttribute)(e,n)}}},{key:"observedAttributes",get:function(){var e=this;this.finalize();var t=[];return this._classProperties.forEach((function(n,r){var o=e._attributeNameForProperty(r,n);void 0!==o&&(e._attributeToPropertyMap.set(o,r),t.push(o))})),t}}]),o}(Object(r.j)(HTMLElement));m.finalized=!0;
|
||
/**
|
||
* @license
|
||
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
* This code may only be used under the BSD style license found at
|
||
* http://polymer.github.io/LICENSE.txt
|
||
* The complete set of authors may be found at
|
||
* http://polymer.github.io/AUTHORS.txt
|
||
* The complete set of contributors may be found at
|
||
* http://polymer.github.io/CONTRIBUTORS.txt
|
||
* Code distributed by Google as part of the polymer project is also
|
||
* subject to an additional IP rights grant found at
|
||
* http://polymer.github.io/PATENTS.txt
|
||
*/
|
||
var y=function(e){return function(t){return"function"==typeof t?function(e,t){return window.customElements.define(e,t),t}(e,t):function(e,t){return{kind:t.kind,elements:t.elements,finisher:function(t){window.customElements.define(e,t)}}}(e,t)}};function b(e){return function(t,n){return void 0!==n?function(e,t,n){t.constructor.createProperty(n,e)}(e,t,n):function(e,t){return"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?Object.assign(Object.assign({},t),{finisher:function(n){n.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer:function(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher:function(n){n.createProperty(t.key,e)}}}(e,t)}}function g(e){return function(t,n){var r={get:function(){return this.renderRoot.querySelector(e)},enumerable:!0,configurable:!0};return void 0!==n?_(r,t,n):O(r,t)}}var _=function(e,t,n){Object.defineProperty(t,n,e)},O=function(e,t){return{kind:"method",placement:"prototype",key:t.key,descriptor:e}};
|
||
/**
|
||
@license
|
||
Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
|
||
This code may only be used under the BSD style license found at
|
||
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
|
||
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
|
||
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
|
||
part of the polymer project is also subject to an additional IP rights grant
|
||
found at http://polymer.github.io/PATENTS.txt
|
||
*/
|
||
var j="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,w=Symbol(),k=function(){function e(t,n){if(Object(r.b)(this,e),n!==w)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}return Object(r.c)(e,[{key:"toString",value:function(){return this.cssText}},{key:"styleSheet",get:function(){return void 0===this._styleSheet&&(j?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}}]),e}(),S=function(e){if(e instanceof k)return e.cssText;if("number"==typeof e)return e;throw new Error("Value passed to 'css' function must be a 'css' function result: ".concat(e,". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security."))},C=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n.reduce((function(t,n,r){return t+S(n)+e[r+1]}),e[0]);return new k(o,w)};(window.litElementVersions||(window.litElementVersions=[])).push("2.3.1");var A={},x=function(e){Object(r.f)(n,m);var t=Object(r.g)(n);function n(){return Object(r.b)(this,n),t.apply(this,arguments)}return Object(r.c)(n,[{key:"initialize",value:function(){Object(r.h)(Object(r.i)(n.prototype),"initialize",this).call(this),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}},{key:"createRenderRoot",value:function(){return this.attachShadow({mode:"open"})}},{key:"adoptStyles",value:function(){var e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?j?this.renderRoot.adoptedStyleSheets=e.map((function(e){return e.styleSheet})):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map((function(e){return e.cssText})),this.localName))}},{key:"connectedCallback",value:function(){Object(r.h)(Object(r.i)(n.prototype),"connectedCallback",this).call(this),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}},{key:"update",value:function(e){var t=this,o=this.render();Object(r.h)(Object(r.i)(n.prototype),"update",this).call(this,e),o!==A&&this.constructor.render(o,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((function(e){var n=document.createElement("style");n.textContent=e.cssText,t.renderRoot.appendChild(n)})))}},{key:"render",value:function(){return A}}],[{key:"getStyles",value:function(){return this.styles}},{key:"_getUniqueStyles",value:function(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_styles",this))){var e=this.getStyles();if(void 0===e)this._styles=[];else if(Array.isArray(e)){var t=function e(t,n){return t.reduceRight((function(t,n){return Array.isArray(n)?e(n,t):(t.add(n),t)}),n)}(e,new Set),n=[];t.forEach((function(e){return n.unshift(e)})),this._styles=n}else this._styles=[e]}}}]),n}();x.finalized=!0,x.render=function(e,t,n){if(!n||"object"!==Object(r.a)(n)||!n.scopeName)throw new Error("The `scopeName` option is required.");var h=n.scopeName,p=o.l.has(t),v=c&&11===t.nodeType&&!!t.host,m=v&&!f.has(h),y=m?document.createDocumentFragment():t;if(Object(o.j)(e,y,Object.assign({templateFactory:l(h)},n)),m){var b=o.l.get(y);o.l.delete(y),function(e,t,n){f.add(e);var r=n?n.element:document.createElement("template"),c=t.querySelectorAll("style"),l=c.length;if(0!==l){for(var h=document.createElement("style"),p=0;p<l;p++){var v=c[p];v.parentNode.removeChild(v),h.textContent+=v.textContent}!function(e){d.forEach((function(t){var n=o.o.get(s(t,e));void 0!==n&&n.keyString.forEach((function(e){var t=e.element.content,n=new Set;Array.from(t.querySelectorAll("style")).forEach((function(e){n.add(e)})),i(e,n)}))}))}(e);var m=r.content;n?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e.element.content,o=e.parts;if(null!=n)for(var i=document.createTreeWalker(r,133,null,!1),s=u(o),c=0,l=-1;i.nextNode();){l++;var d=i.currentNode;for(d===n&&(c=a(t),n.parentNode.insertBefore(t,n));-1!==s&&o[s].index===l;){if(c>0){for(;-1!==s;)o[s].index+=c,s=u(o,s);return}s=u(o,s)}}else r.appendChild(t)}(n,h,m.firstChild):m.insertBefore(h,m.firstChild),window.ShadyCSS.prepareTemplateStyles(r,e);var y=m.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==y)t.insertBefore(y.cloneNode(!0),t.firstChild);else if(n){m.insertBefore(h,m.firstChild);var b=new Set;b.add(h),i(n,b)}}else window.ShadyCSS.prepareTemplateStyles(r,e)}(h,y,b.value instanceof o.b?b.value.template:void 0),Object(o.n)(t,t.firstChild),t.appendChild(y),o.l.set(t,b)}!p&&v&&window.ShadyCSS.styleElement(t.host)}},35:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return r}));"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;function r(e,t){return e(t={exports:{}},t.exports),t.exports}}).call(this,n(20))},38:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r,o=n(1),i=n(7),a=n(4),u=n(3),s=n(35),c=n(11),l=function(){function e(){Object(o.b)(this,e)}return Object(o.c)(e,[{key:"keydown",value:function(e){var t,n,r=e.key;if(!e.metaKey){switch(r){case"Tab":case"Delete":case"Backspace":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":return}var o=e.target,i=o.value,a=i.slice(0,null!==(t=o.selectionStart)&&void 0!==t?t:0),u=i.slice(null!==(n=o.selectionEnd)&&void 0!==n?n:0);"".concat(a).concat(r).concat(u).match(/^[0-9]+(\.[0-9]{0,2})?$/g)||e.preventDefault()}}}]),e}(),d=Object(s.a)((function(e,t){e.exports=function(){function e(i,a){if(!(this instanceof e))return new e(i,a);a=Object.assign({},n,a);var u=Math.pow(10,a.precision);this.intValue=i=t(i,a),this.value=i/u,a.increment=a.increment||1/u,a.groups=a.useVedic?o:r,this.s=a,this.p=u}function t(t,n){var r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],o=n.decimal,i=n.errorOnInvalid,a=n.fromCents,u=Math.pow(10,n.precision),s=t instanceof e;if(s&&a)return t.intValue;if("number"==typeof t||s)o=s?t.value:t;else if("string"==typeof t)i=new RegExp("[^-\\d"+o+"]","g"),o=new RegExp("\\"+o,"g"),o=(o=t.replace(/\((.*)\)/,"-$1").replace(i,"").replace(o,"."))||0;else{if(i)throw Error("Invalid Input");o=0}return a||(o=(o*u).toFixed(4)),r?Math.round(o):o}var n={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:function(e,t){var n=t.pattern,r=t.negativePattern,o=t.symbol,i=t.separator,a=t.decimal;t=t.groups;var u=(""+e).replace(/^-/,"").split("."),s=u[0];return u=u[1],(0<=e.value?n:r).replace("!",o).replace("#",s.replace(t,"$1"+i)+(u?a+u:""))},fromCents:!1},r=/(\d)(?=(\d{3})+\b)/g,o=/(\d)(?=(\d\d)+\d\b)/g;return e.prototype={add:function(n){var r=this.s,o=this.p;return e((this.intValue+t(n,r))/(r.fromCents?1:o),r)},subtract:function(n){var r=this.s,o=this.p;return e((this.intValue-t(n,r))/(r.fromCents?1:o),r)},multiply:function(t){var n=this.s;return e(this.intValue*t/(n.fromCents?1:Math.pow(10,n.precision)),n)},divide:function(n){var r=this.s;return e(this.intValue/t(n,r,!1),r)},distribute:function(t){var n=this.intValue,r=this.p,o=this.s,i=[],a=Math[0<=n?"floor":"ceil"](n/t),u=Math.abs(n-a*t);for(r=o.fromCents?1:r;0!==t;t--){var s=e(a/r,o);0<u--&&(s=s[0<=n?"add":"subtract"](1/r)),i.push(s)}return i},dollars:function(){return~~this.value},cents:function(){return~~(this.intValue%this.p)},format:function(e){var t=this.s;return"function"==typeof e?e(this,t):t.format(this,Object.assign({},t,e))},toString:function(){var e=this.s,t=e.increment;return(Math.round(this.intValue/this.p/t)*t).toFixed(e.precision)},toJSON:function(){return this.value}},e}()}));function f(){var e=Object(o.l)(["\n .container {\n position: relative;\n margin-bottom: 1rem;\n }\n\n .content-container {\n position: relative;\n left: calc("," + ",");\n width: calc(100% - ("," + ","));\n transition: ",";\n z-index: 1;\n background-color: ",";\n }\n\n .content-container.hidebadge {\n left: 0;\n width: 100%;\n }\n\n .badge-container {\n position: absolute;\n width: ",";\n }\n\n .badge {\n background-color: ",";\n color: ",";\n width: ",";\n height: ",";\n border-radius: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: ",";\n font-size: ",";\n }\n\n .title {\n line-height: ",";\n margin-bottom: 0.5rem;\n font-size: ",";\n font-weight: ",";\n }\n "]);return f=function(){return e},e}function h(){var e=Object(o.l)(["calc("," * 2)"]);return h=function(){return e},e}function p(){var e=Object(o.l)(["var(--formSectionContentBackgroundColor, white)"]);return p=function(){return e},e}function v(){var e=Object(o.l)(["var(--formSectionTitleFontWeight, bold)"]);return v=function(){return e},e}function m(){var e=Object(o.l)(["var(--formSectionTitleFontSize, 1.8rem)"]);return m=function(){return e},e}function y(){var e=Object(o.l)(["var(--formSectionBadgeFontColor, #fff)"]);return y=function(){return e},e}function b(){var e=Object(o.l)(["var(--formSectionBadgeFontWeight, bold)"]);return b=function(){return e},e}function g(){var e=Object(o.l)(["var(--formSectionBadgeFontSize, 1.8rem)"]);return g=function(){return e},e}function _(){var e=Object(o.l)(["calc("," * 2)"]);return _=function(){return e},e}function O(){var e=Object(o.l)(["var(--formSectionBadgeRadius, 1.2rem)"]);return O=function(){return e},e}function j(){var e=Object(o.l)(["var(--formSectionBadgeBackgroundColor, #333)"]);return j=function(){return e},e}function w(){var e=Object(o.l)(["var(--formSectionBadgeMargin, 1rem)"]);return w=function(){return e},e}function k(){var e=Object(o.l)(["var(--formSectionBadgeTransition, 0.25s ease-out)"]);return k=function(){return e},e}function S(){var e=Object(o.l)([' <div class="title">',"</div> "]);return S=function(){return e},e}function C(){var e=Object(o.l)(['\n <div class="container">\n <div class="badge-container">\n <div class="badge">','</div>\n </div>\n <div class="content-container ','">\n ','\n <div class="content">\n <slot></slot>\n </div>\n </div>\n </div>\n ']);return C=function(){return e},e}!function(e){e.HideBadge="hidebadge",e.ShowBadge="showbadge"}(r||(r={}));var A,x,T,P=function(e){Object(o.f)(n,u.a);var t=Object(o.g)(n);function n(){var e;return Object(o.b)(this,n),(e=t.apply(this,arguments)).sectionBadge="0",e.badgeMode=r.ShowBadge,e}return Object(o.c)(n,[{key:"render",value:function(){return Object(a.h)(C(),this.sectionBadge,this.badgeMode,this.headline?Object(a.h)(S(),this.headline):"")}}],[{key:"styles",get:function(){var e=Object(u.b)(k()),t=Object(u.b)(w()),n=Object(u.b)(j()),r=Object(u.b)(O()),o=Object(u.b)(_(),r),i=Object(u.b)(g()),a=Object(u.b)(b()),s=Object(u.b)(y()),c=Object(u.b)(m()),l=Object(u.b)(v()),d=Object(u.b)(p()),S=Object(u.b)(h(),r);return Object(u.b)(f(),o,t,o,t,e,d,o,n,s,o,o,r,a,i,S,c,l)}}]),n}();function E(){var e=Object(o.l)(["\n .errors {\n color: red;\n font-size: 1.4rem;\n margin-top: 0.5rem;\n }\n\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n display: grid;\n grid-gap: ",";\n }\n\n li {\n margin: 0;\n padding: 0;\n display: inline-block;\n }\n\n .selection-button {\n height: 3rem;\n }\n\n .selection-button label {\n padding: 0 0.3rem;\n display: flex;\n cursor: pointer;\n text-align: center;\n font-size: ",";\n font-weight: bold;\n border: 1px solid ",";\n border-radius: 5px;\n background-color: #ccc;\n height: 100%;\n justify-content: center;\n align-items: center;\n }\n\n label[for='custom-amount-button'] {\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .custom-amount-text {\n white-space: nowrap;\n margin-right: 0.5rem;\n }\n\n input[type='radio'] {\n opacity: 0;\n width: 0;\n height: 0;\n position: absolute;\n }\n\n input[type='radio'] + label {\n background-color: ",";\n }\n\n input[type='radio']:checked + label {\n background-color: ",";\n }\n\n input[type='radio']:focus + label {\n outline: 2px solid ",";\n }\n\n .cover-fees-container {\n margin-top: 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .cover-fees-container input {\n width: 2rem;\n }\n\n .cover-fees-container label {\n font-size: ",";\n font-weight: ",";\n flex: 1;\n }\n\n .amount-selector {\n grid-template-columns: 1fr 1fr 1fr 1fr 1fr;\n }\n\n .frequency-selector {\n grid-template-columns: 1fr 1fr;\n }\n\n .custom-amount {\n grid-column-start: 3;\n grid-column-end: 6;\n }\n\n #custom-amount-input {\n width: ",";\n font-size: 1.6rem;\n font-weight: bold;\n color: ",";\n padding: 0.1rem;\n border: ",";\n appearance: none;\n -moz-appearance: none;\n -webkit-appearance: none;\n }\n "]);return E=function(){return e},e}function N(){var e=Object(o.l)(["var(--inputBorder, 1px solid #d9d9d9)"]);return N=function(){return e},e}function D(){var e=Object(o.l)(["var(--inputFieldFontColor, #333)"]);return D=function(){return e},e}function M(){var e=Object(o.l)(["var(--customAmountWidth, 4rem)"]);return M=function(){return e},e}function I(){var e=Object(o.l)(["var(--coverFeesFontWeight, bold)"]);return I=function(){return e},e}function $(){var e=Object(o.l)(["var(--coverFeesFontSize, 1.2rem)"]);return $=function(){return e},e}function R(){var e=Object(o.l)(["var(--paymentButtonColor, #fff)"]);return R=function(){return e},e}function F(){var e=Object(o.l)(["var(--paymentButtonFocusedOutlineColor, #7fb3f9)"]);return F=function(){return e},e}function B(){var e=Object(o.l)(["var(--paymentButtonSelectedColor, #f9bf3b)"]);return B=function(){return e},e}function V(){var e=Object(o.l)(["var(--paymentButtonFontSize, 1.6rem)"]);return V=function(){return e},e}function U(){var e=Object(o.l)(["var(--paymentButtonGridGap, 1rem)"]);return U=function(){return e},e}function z(){var e=Object(o.l)(["var(--paymentButtonBorderColor, #333)"]);return z=function(){return e},e}function q(){var e=Object(o.l)(['\n <div class="selection-button">\n <input\n type="radio"\n name=','\n value="custom"\n id="custom-amount-button"\n tabindex="0"\n @change=','\n />\n\n <label for="custom-amount-button">\n <span class="custom-amount-text">Custom: $</span\n ><input\n type="text"\n id="custom-amount-input"\n tabindex="-1"\n value=',"\n @input=","\n @keydown=","\n @focus=","\n />\n </label>\n </div>\n "]);return q=function(){return e},e}function H(){var e=Object(o.l)(["\n <li>\n ","\n </li>\n "]);return H=function(){return e},e}function L(){var e=Object(o.l)(["\n ","\n "]);return L=function(){return e},e}function W(){var e=Object(o.l)(["\n <li>\n ","\n </li>\n\n <li>\n ","\n </li>\n "]);return W=function(){return e},e}function J(){var e=Object(o.l)(["\n I'll generously add\n "," to cover the\n transaction fees so you can keep 100% of my donation.\n "]);return J=function(){return e},e}function G(){var e=Object(o.l)([" Please enter a valid donation amount "]);return G=function(){return e},e}function Y(){var e=Object(o.l)([" Please select an amount (minimum $1) "]);return Y=function(){return e},e}function K(){var e=Object(o.l)(['\n To make a donation of $10,000 or more, please contact our philanthropy\n department at\n <a href="mailto:donations@archive.org">donations@archive.org</a>\n ']);return K=function(){return e},e}function Q(){var e=Object(o.l)(['\n <div class="selection-button">\n <input\n type="radio"\n name=',"\n value=","\n id=",'\n tabindex="0"\n .checked=',"\n @change=","\n />\n <label for=","> "," </label>\n </div>\n "]);return Q=function(){return e},e}function X(){var e=Object(o.l)(['\n <donation-form-section\n sectionBadge="1"\n headline="Choose a frequency"\n badgeMode=','\n >\n <ul class="frequency-selector">\n ','\n </ul>\n </donation-form-section>\n\n <donation-form-section\n sectionBadge="2"\n headline="Choose an amount (USD)"\n badgeMode=','\n >\n <ul class="amount-selector">\n ','\n <li class="custom-amount">','</li>\n </ul>\n\n <div class="errors">','</div>\n\n <div class="cover-fees-container">\n <input\n type="checkbox"\n id="cover-fees"\n @input=',"\n .checked=",'\n tabindex="0"\n />\n <label for="cover-fees"> '," </label>\n </div>\n </donation-form-section>\n "]);return X=function(){return e},e}Object(i.a)([Object(u.e)({type:String})],P.prototype,"sectionBadge",void 0),Object(i.a)([Object(u.e)({type:String})],P.prototype,"headline",void 0),Object(i.a)([Object(u.e)({type:String})],P.prototype,"badgeMode",void 0),P=Object(i.a)([Object(u.c)("donation-form-section")],P),function(e){e.HideNumbers="hidenumbers",e.ShowNumbers="shownumbers"}(A||(A={})),function(e){e.DonationType="donationType",e.Amount="amount"}(x||(x={})),function(e){e.ValidDonationAmount="valid_donation_amount",e.InvalidDonationAmount="invalid_donation_amount",e.DonationTooHigh="donation_too_high",e.DonationTooLow="donation_too_low"}(T||(T={}));var Z=function(e){Object(o.f)(n,u.a);var t=Object(o.g)(n);function n(){var e;return Object(o.b)(this,n),(e=t.apply(this,arguments)).donationInfo=new c.c({donationType:c.g.OneTime,amount:5,coverFees:!1}),e.stepNumberMode=A.ShowNumbers,e.amountOptions=[5,10,25,50,100,500,1e3],e.currencyValidator=new l,e}return Object(o.c)(n,[{key:"render",value:function(){return Object(a.h)(X(),this.formSectionNumberMode,this.frequencyTemplate,this.formSectionNumberMode,this.presetAmountsTemplate,this.customAmountTemplate,this.error,this.coverFeesChecked,this.donationInfo.coverFees,this.coverFeesTextTemplate)}},{key:"updated",value:function(e){e.has("donationInfo")&&this.updateSelectedDonationInfo()}},{key:"updateSelectedDonationInfo",value:function(){var e,t;if(this.customAmountButton&&this.customAmountInput)if(!this.customAmountButton.checked&&this.amountOptions.includes(this.donationInfo.amount))(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('input[type="radio"][name="'.concat(x.Amount,'"][value="').concat(this.donationInfo.amount,'"]'))).checked=!0,this.customAmountButton.checked=!1,this.customAmountInput.value="";else if(this.customAmountButton.checked=!0,(null===(t=this.shadowRoot)||void 0===t?void 0:t.activeElement)!==this.customAmountInput){this.customAmountInput.value="".concat(this.donationInfo.amount);var n=this.getDonationInfoStatus(this.donationInfo.amount);this.handleDonationInfoStatus(n)}}},{key:"getRadioButton",value:function(e){var t="".concat(e.group,"-").concat(e.value,"-option");return Object(a.h)(Q(),e.group,e.value,t,e.checked,this.radioSelected,t,e.displayText)}},{key:"customRadioSelected",value:function(){var e;null===(e=this.customAmountInput)||void 0===e||e.focus()}},{key:"customAmountFocused",value:function(e){var t=e.target;this.customAmountButton&&(this.customAmountButton.checked=!0),this.handleCustomAmountInput(t.value)}},{key:"coverFeesChecked",value:function(e){var t=e.target.checked;this.updateDonationInfo({coverFees:t})}},{key:"customAmountChanged",value:function(e){var t=e.target.value;this.customAmountButton&&(this.customAmountButton.checked=!0),this.handleCustomAmountInput(t)}},{key:"handleCustomAmountInput",value:function(e){var t=parseFloat(e);isNaN(t)?this.dispatchEditDonationError(T.InvalidDonationAmount):this.amountChanged(t)}},{key:"handleDonationInfoStatus",value:function(e){switch(e){case T.ValidDonationAmount:this.error=void 0;break;case T.DonationTooHigh:this.error=Object(a.h)(K()),this.dispatchEditDonationError(e);break;case T.DonationTooLow:this.customAmountInput&&this.customAmountInput.value.length>0&&(this.error=Object(a.h)(Y())),this.dispatchEditDonationError(e);break;case T.InvalidDonationAmount:this.error=Object(a.h)(G()),this.dispatchEditDonationError(e)}}},{key:"amountChanged",value:function(e){var t=this.getDonationInfoStatus(e);this.handleDonationInfoStatus(t),t===T.ValidDonationAmount&&this.updateDonationInfo({amount:e})}},{key:"getDonationInfoStatus",value:function(e){return isNaN(e)?T.InvalidDonationAmount:e>=1e4?T.DonationTooHigh:e<1?T.DonationTooLow:T.ValidDonationAmount}},{key:"radioSelected",value:function(e){var t=e.target,n=t.name,r=t.value;switch(n){case x.Amount:this.presetAmountChanged(parseFloat(r));break;case x.DonationType:this.updateDonationInfo({donationType:r})}}},{key:"dispatchEditDonationError",value:function(e){var t=new CustomEvent("editDonationError",{detail:{error:e}});this.dispatchEvent(t)}},{key:"presetAmountChanged",value:function(e){this.error=void 0,this.customAmountInput&&(this.customAmountInput.value=""),this.updateDonationInfo({amount:e})}},{key:"updateDonationInfo",value:function(e){var t,n,r,o=new c.c({donationType:null!==(t=e.donationType)&&void 0!==t?t:this.donationInfo.donationType,amount:null!==(n=e.amount)&&void 0!==n?n:this.donationInfo.amount,coverFees:null!==(r=e.coverFees)&&void 0!==r?r:this.donationInfo.coverFees});this.donationInfo=o;var i=new CustomEvent("donationInfoChanged",{detail:{donationInfo:o}});this.dispatchEvent(i)}},{key:"formSectionNumberMode",get:function(){switch(this.stepNumberMode){case A.ShowNumbers:return r.ShowBadge;case A.HideNumbers:return r.HideBadge}}},{key:"coverFeesTextTemplate",get:function(){return Object(a.h)(J(),d(this.donationInfo.fee,{symbol:"$"}).format())}},{key:"frequencyTemplate",get:function(){return Object(a.h)(W(),this.getRadioButton({group:x.DonationType,value:c.g.OneTime,displayText:"One time",checked:this.donationInfo.donationType===c.g.OneTime}),this.getRadioButton({group:x.DonationType,value:c.g.Monthly,displayText:"Monthly",checked:this.donationInfo.donationType===c.g.Monthly}))}},{key:"presetAmountsTemplate",get:function(){var e=this;return Object(a.h)(L(),this.amountOptions.map((function(t){var n,r=!(null===(n=e.customAmountButton)||void 0===n?void 0:n.checked)&&t===e.donationInfo.amount;return Object(a.h)(H(),e.getRadioButton({group:x.Amount,value:"".concat(t),displayText:"$".concat(t),checked:r}))})))}},{key:"customAmountTemplate",get:function(){var e=this.amountOptions.includes(this.donationInfo.amount)?"":this.donationInfo.amount;return Object(a.h)(q(),x.Amount,this.customRadioSelected,e,this.customAmountChanged,this.currencyValidator.keydown,this.customAmountFocused)}}],[{key:"styles",get:function(){var e=Object(u.b)(z()),t=Object(u.b)(U()),n=Object(u.b)(V()),r=Object(u.b)(B()),o=Object(u.b)(F()),i=Object(u.b)(R()),a=Object(u.b)($()),s=Object(u.b)(I()),c=Object(u.b)(M()),l=Object(u.b)(D()),d=Object(u.b)(N());return Object(u.b)(E(),t,n,e,i,r,o,a,s,c,l,d)}}]),n}();Object(i.a)([Object(u.e)({type:Object})],Z.prototype,"donationInfo",void 0),Object(i.a)([Object(u.e)({type:String})],Z.prototype,"stepNumberMode",void 0),Object(i.a)([Object(u.e)({type:Array})],Z.prototype,"amountOptions",void 0),Object(i.a)([Object(u.e)({type:Object})],Z.prototype,"error",void 0),Object(i.a)([Object(u.f)("#custom-amount-button")],Z.prototype,"customAmountButton",void 0),Object(i.a)([Object(u.f)("#custom-amount-input")],Z.prototype,"customAmountInput",void 0),Z=Object(i.a)([Object(u.c)("donation-form-edit-donation")],Z)},4:function(e,t,n){"use strict";n.d(t,"a",(function(){return A})),n.d(t,"b",(function(){return _})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return g})),n.d(t,"f",(function(){return C})),n.d(t,"g",(function(){return w})),n.d(t,"h",(function(){return B})),n.d(t,"i",(function(){return P})),n.d(t,"j",(function(){return R})),n.d(t,"k",(function(){return h})),n.d(t,"l",(function(){return $})),n.d(t,"m",(function(){return f})),n.d(t,"n",(function(){return a})),n.d(t,"o",(function(){return I})),n.d(t,"p",(function(){return l})),n.d(t,"q",(function(){return u}));var r=n(1),o="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,i=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;t!==n;){var o=t.nextSibling;e.insertBefore(t,r),t=o}},a=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t!==n;){var r=t.nextSibling;e.removeChild(t),t=r}},u="{{lit-".concat(String(Math.random()).slice(2),"}}"),s="\x3c!--".concat(u,"--\x3e"),c=new RegExp("".concat(u,"|").concat(s)),l=function e(t,n){Object(r.b)(this,e),this.parts=[],this.element=n;for(var o=[],i=[],a=document.createTreeWalker(n.content,133,null,!1),s=0,l=-1,f=0,v=t.strings,m=t.values.length;f<m;){var y=a.nextNode();if(null!==y){if(l++,1===y.nodeType){if(y.hasAttributes()){for(var b=y.attributes,g=b.length,_=0,O=0;O<g;O++)d(b[O].name,"$lit$")&&_++;for(;_-- >0;){var j=v[f],w=p.exec(j)[2],k=w.toLowerCase()+"$lit$",S=y.getAttribute(k);y.removeAttribute(k);var C=S.split(c);this.parts.push({type:"attribute",index:l,name:w,strings:C}),f+=C.length-1}}"TEMPLATE"===y.tagName&&(i.push(y),a.currentNode=y.content)}else if(3===y.nodeType){var A=y.data;if(A.indexOf(u)>=0){for(var x=y.parentNode,T=A.split(c),P=T.length-1,E=0;E<P;E++){var N=void 0,D=T[E];if(""===D)N=h();else{var M=p.exec(D);null!==M&&d(M[2],"$lit$")&&(D=D.slice(0,M.index)+M[1]+M[2].slice(0,-"$lit$".length)+M[3]),N=document.createTextNode(D)}x.insertBefore(N,y),this.parts.push({type:"node",index:++l})}""===T[P]?(x.insertBefore(h(),y),o.push(y)):y.data=T[P],f+=P}}else if(8===y.nodeType)if(y.data===u){var I=y.parentNode;null!==y.previousSibling&&l!==s||(l++,I.insertBefore(h(),y)),s=l,this.parts.push({type:"node",index:l}),null===y.nextSibling?y.data="":(o.push(y),l--),f++}else for(var $=-1;-1!==($=y.data.indexOf(u,$+1));)this.parts.push({type:"node",index:-1}),f++}else a.currentNode=i.pop()}for(var R=0,F=o;R<F.length;R++){var B=F[R];B.parentNode.removeChild(B)}},d=function(e,t){var n=e.length-t.length;return n>=0&&e.slice(n)===t},f=function(e){return-1!==e.index},h=function(){return document.createComment("")},p=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,v=new WeakMap,m=function(e){return function(){var t=e.apply(void 0,arguments);return v.set(t,!0),t}},y=function(e){return"function"==typeof e&&v.has(e)},b={},g={},_=function(){function e(t,n,o){Object(r.b)(this,e),this.__parts=[],this.template=t,this.processor=n,this.options=o}return Object(r.c)(e,[{key:"update",value:function(e){var t,n=0,o=Object(r.d)(this.__parts);try{for(o.s();!(t=o.n()).done;){var i=t.value;void 0!==i&&i.setValue(e[n]),n++}}catch(e){o.e(e)}finally{o.f()}var a,u=Object(r.d)(this.__parts);try{for(u.s();!(a=u.n()).done;){var s=a.value;void 0!==s&&s.commit()}}catch(e){u.e(e)}finally{u.f()}}},{key:"_clone",value:function(){for(var e,t=o?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),n=[],i=this.template.parts,a=document.createTreeWalker(t,133,null,!1),u=0,s=0,c=a.nextNode();u<i.length;)if(e=i[u],f(e)){for(;s<e.index;)s++,"TEMPLATE"===c.nodeName&&(n.push(c),a.currentNode=c.content),null===(c=a.nextNode())&&(a.currentNode=n.pop(),c=a.nextNode());if("node"===e.type){var l=this.processor.handleTextExpression(this.options);l.insertAfterNode(c.previousSibling),this.__parts.push(l)}else{var d;(d=this.__parts).push.apply(d,Object(r.e)(this.processor.handleAttributeExpressions(c,e.name,e.strings,this.options)))}u++}else this.__parts.push(void 0),u++;return o&&(document.adoptNode(t),customElements.upgrade(t)),t}}]),e}(),O=" ".concat(u," "),j=function(){function e(t,n,o,i){Object(r.b)(this,e),this.strings=t,this.values=n,this.type=o,this.processor=i}return Object(r.c)(e,[{key:"getHTML",value:function(){for(var e=this.strings.length-1,t="",n=!1,r=0;r<e;r++){var o=this.strings[r],i=o.lastIndexOf("\x3c!--");n=(i>-1||n)&&-1===o.indexOf("--\x3e",i+1);var a=p.exec(o);t+=null===a?o+(n?O:s):o.substr(0,a.index)+a[1]+a[2]+"$lit$"+a[3]+u}return t+this.strings[e]}},{key:"getTemplateElement",value:function(){var e=document.createElement("template");return e.innerHTML=this.getHTML(),e}}]),e}(),w=(function(e){Object(r.f)(n,j);var t=Object(r.g)(n);function n(){return Object(r.b)(this,n),t.apply(this,arguments)}Object(r.c)(n,[{key:"getHTML",value:function(){return"<svg>".concat(Object(r.h)(Object(r.i)(n.prototype),"getHTML",this).call(this),"</svg>")}},{key:"getTemplateElement",value:function(){var e=Object(r.h)(Object(r.i)(n.prototype),"getTemplateElement",this).call(this),t=e.content,o=t.firstChild;return t.removeChild(o),i(t,o.firstChild),e}}])}(),function(e){return null===e||!("object"===Object(r.a)(e)||"function"==typeof e)}),k=function(e){return Array.isArray(e)||!(!e||!e[Symbol.iterator])},S=function(){function e(t,n,o){Object(r.b)(this,e),this.dirty=!0,this.element=t,this.name=n,this.strings=o,this.parts=[];for(var i=0;i<o.length-1;i++)this.parts[i]=this._createPart()}return Object(r.c)(e,[{key:"_createPart",value:function(){return new C(this)}},{key:"_getValue",value:function(){for(var e=this.strings,t=e.length-1,n="",o=0;o<t;o++){n+=e[o];var i=this.parts[o];if(void 0!==i){var a=i.value;if(w(a)||!k(a))n+="string"==typeof a?a:String(a);else{var u,s=Object(r.d)(a);try{for(s.s();!(u=s.n()).done;){var c=u.value;n+="string"==typeof c?c:String(c)}}catch(e){s.e(e)}finally{s.f()}}}}return n+e[t]}},{key:"commit",value:function(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}]),e}(),C=function(){function e(t){Object(r.b)(this,e),this.value=void 0,this.committer=t}return Object(r.c)(e,[{key:"setValue",value:function(e){e===b||w(e)&&e===this.value||(this.value=e,y(e)||(this.committer.dirty=!0))}},{key:"commit",value:function(){for(;y(this.value);){var e=this.value;this.value=b,e(this)}this.value!==b&&this.committer.commit()}}]),e}(),A=function(){function e(t){Object(r.b)(this,e),this.value=void 0,this.__pendingValue=void 0,this.options=t}return Object(r.c)(e,[{key:"appendInto",value:function(e){this.startNode=e.appendChild(h()),this.endNode=e.appendChild(h())}},{key:"insertAfterNode",value:function(e){this.startNode=e,this.endNode=e.nextSibling}},{key:"appendIntoPart",value:function(e){e.__insert(this.startNode=h()),e.__insert(this.endNode=h())}},{key:"insertAfterPart",value:function(e){e.__insert(this.startNode=h()),this.endNode=e.endNode,e.endNode=this.startNode}},{key:"setValue",value:function(e){this.__pendingValue=e}},{key:"commit",value:function(){if(null!==this.startNode.parentNode){for(;y(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=b,e(this)}var t=this.__pendingValue;t!==b&&(w(t)?t!==this.value&&this.__commitText(t):t instanceof j?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):k(t)?this.__commitIterable(t):t===g?(this.value=g,this.clear()):this.__commitText(t))}}},{key:"__insert",value:function(e){this.endNode.parentNode.insertBefore(e,this.endNode)}},{key:"__commitNode",value:function(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}},{key:"__commitText",value:function(e){var t=this.startNode.nextSibling,n="string"==typeof(e=null==e?"":e)?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=n:this.__commitNode(document.createTextNode(n)),this.value=e}},{key:"__commitTemplateResult",value:function(e){var t=this.options.templateFactory(e);if(this.value instanceof _&&this.value.template===t)this.value.update(e.values);else{var n=new _(t,e.processor,this.options),r=n._clone();n.update(e.values),this.__commitNode(r),this.value=n}}},{key:"__commitIterable",value:function(t){Array.isArray(this.value)||(this.value=[],this.clear());var n,o,i=this.value,a=0,u=Object(r.d)(t);try{for(u.s();!(o=u.n()).done;){var s=o.value;void 0===(n=i[a])&&(n=new e(this.options),i.push(n),0===a?n.appendIntoPart(this):n.insertAfterPart(i[a-1])),n.setValue(s),n.commit(),a++}}catch(e){u.e(e)}finally{u.f()}a<i.length&&(i.length=a,this.clear(n&&n.endNode))}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.startNode;a(this.startNode.parentNode,e.nextSibling,this.endNode)}}]),e}(),x=function(){function e(t,n,o){if(Object(r.b)(this,e),this.value=void 0,this.__pendingValue=void 0,2!==o.length||""!==o[0]||""!==o[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=n,this.strings=o}return Object(r.c)(e,[{key:"setValue",value:function(e){this.__pendingValue=e}},{key:"commit",value:function(){for(;y(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=b,e(this)}if(this.__pendingValue!==b){var t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=b}}}]),e}(),T=function(e){Object(r.f)(n,S);var t=Object(r.g)(n);function n(e,o,i){var a;return Object(r.b)(this,n),(a=t.call(this,e,o,i)).single=2===i.length&&""===i[0]&&""===i[1],a}return Object(r.c)(n,[{key:"_createPart",value:function(){return new P(this)}},{key:"_getValue",value:function(){return this.single?this.parts[0].value:Object(r.h)(Object(r.i)(n.prototype),"_getValue",this).call(this)}},{key:"commit",value:function(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}]),n}(),P=function(e){Object(r.f)(n,C);var t=Object(r.g)(n);function n(){return Object(r.b)(this,n),t.apply(this,arguments)}return n}(),E=!1;
|
||
/**
|
||
* @license
|
||
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
* This code may only be used under the BSD style license found at
|
||
* http://polymer.github.io/LICENSE.txt
|
||
* The complete set of authors may be found at
|
||
* http://polymer.github.io/AUTHORS.txt
|
||
* The complete set of contributors may be found at
|
||
* http://polymer.github.io/CONTRIBUTORS.txt
|
||
* Code distributed by Google as part of the polymer project is also
|
||
* subject to an additional IP rights grant found at
|
||
* http://polymer.github.io/PATENTS.txt
|
||
*/!function(){try{var e={get capture(){return E=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}}();var N=function(){function e(t,n,o){var i=this;Object(r.b)(this,e),this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=n,this.eventContext=o,this.__boundHandleEvent=function(e){return i.handleEvent(e)}}return Object(r.c)(e,[{key:"setValue",value:function(e){this.__pendingValue=e}},{key:"commit",value:function(){for(;y(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=b,e(this)}if(this.__pendingValue!==b){var t=this.__pendingValue,n=this.value,r=null==t||null!=n&&(t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive),o=null!=t&&(null==n||r);r&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),o&&(this.__options=D(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=b}}},{key:"handleEvent",value:function(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}]),e}(),D=function(e){return e&&(E?{capture:e.capture,passive:e.passive,once:e.once}:e.capture)};
|
||
/**
|
||
* @license
|
||
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
* This code may only be used under the BSD style license found at
|
||
* http://polymer.github.io/LICENSE.txt
|
||
* The complete set of authors may be found at
|
||
* http://polymer.github.io/AUTHORS.txt
|
||
* The complete set of contributors may be found at
|
||
* http://polymer.github.io/CONTRIBUTORS.txt
|
||
* Code distributed by Google as part of the polymer project is also
|
||
* subject to an additional IP rights grant found at
|
||
* http://polymer.github.io/PATENTS.txt
|
||
*/function M(e){var t=I.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},I.set(e.type,t));var n=t.stringsArray.get(e.strings);if(void 0!==n)return n;var r=e.strings.join(u);return void 0===(n=t.keyString.get(r))&&(n=new l(e,e.getTemplateElement()),t.keyString.set(r,n)),t.stringsArray.set(e.strings,n),n}var I=new Map,$=new WeakMap,R=function(e,t,n){var r=$.get(t);void 0===r&&(a(t,t.firstChild),$.set(t,r=new A(Object.assign({templateFactory:M},n))),r.appendInto(t)),r.setValue(e),r.commit()},F=new(function(){function e(){Object(r.b)(this,e)}return Object(r.c)(e,[{key:"handleAttributeExpressions",value:function(e,t,n,r){var o=t[0];return"."===o?new T(e,t.slice(1),n).parts:"@"===o?[new N(e,t.slice(1),r.eventContext)]:"?"===o?[new x(e,t.slice(1),n)]:new S(e,t,n).parts}},{key:"handleTextExpression",value:function(e){return new A(e)}}]),e}());
|
||
/**
|
||
* @license
|
||
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
* This code may only be used under the BSD style license found at
|
||
* http://polymer.github.io/LICENSE.txt
|
||
* The complete set of authors may be found at
|
||
* http://polymer.github.io/AUTHORS.txt
|
||
* The complete set of contributors may be found at
|
||
* http://polymer.github.io/CONTRIBUTORS.txt
|
||
* Code distributed by Google as part of the polymer project is also
|
||
* subject to an additional IP rights grant found at
|
||
* http://polymer.github.io/PATENTS.txt
|
||
*/
|
||
/**
|
||
* @license
|
||
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
||
* This code may only be used under the BSD style license found at
|
||
* http://polymer.github.io/LICENSE.txt
|
||
* The complete set of authors may be found at
|
||
* http://polymer.github.io/AUTHORS.txt
|
||
* The complete set of contributors may be found at
|
||
* http://polymer.github.io/CONTRIBUTORS.txt
|
||
* Code distributed by Google as part of the polymer project is also
|
||
* subject to an additional IP rights grant found at
|
||
* http://polymer.github.io/PATENTS.txt
|
||
*/"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.2.1");var B=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new j(e,n,"html",F)}},40:function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,"a",(function(){return o}));var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.analyticsBackend=t||window.archive_analytics}var t,n,o;return t=e,(n=[{key:"send_event",value:function(e,t,n,r){this.analyticsBackend&&this.analyticsBackend.send_event(e,t,n,r)}},{key:"send_event_no_sampling",value:function(e,t,n,r){this.analyticsBackend&&this.analyticsBackend.send_event_no_sampling(e,t,n,r)}}])&&r(t.prototype,n),o&&r(t,o),e}()},51:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return s}));var r=n(16),o=n(2);var i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=document.getElementsByTagName("head")[0],o=document.createElement("script");o.src=e,o.type="text/javascript",Object.keys(n).forEach((function(e){return o.setAttribute(e,n[e])})),o.onload=t,o.onreadystatechange=function(){"complete"===o.readyState&&t()},r.appendChild(o)},a=function(e){return{charge_token:e.id,email:e.email,isbn:Object(r.a)().isbn,context:Object(r.a)().context,type:$('input[name="type"]:checked').val(),financial_type:"Book Sponsorship",amount:Donations.getDonationAmount(1),source:Donations.enhancedDonationSource($("#stripeOneTime").attr("data-source")),csrf_token:Donations.csrf_token,address_city:e.card.address_city,address_state:e.card.address_state,address_zip:e.card.address_zip,address_country:e.card.address_country,sponsor_msg:$("#sponsorshipMessage").val(),debug:Object(r.a)().debug,scan_only:Object(r.a)().scan_only,join_waitlist:$('[name="waitlist"]').is(":checked"),sponsor_publicly:$('[name="public"]').is(":checked")}};function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,s;return t=e,s=[{key:"setBaseURL",value:function(){e.baseURL=$("#stripeOneTime").attr("data-base-url")||""}},{key:"setCSRFToken",value:function(){e.csrf_token=$('meta[property="csrf-token"]').attr("content")}},{key:"getEnvironment",value:function(){return $("meta[property=environment]").attr("content")}},{key:"getReferer",value:function(){return e.enhancedDonationSource($(".js-donation-refs").first().attr("data-source"))}},{key:"renderModalBackdrop",value:function(){$(document.body).append('<div data-id="backdrop" class="backdrop hidden"></div>')}},{key:"init",value:function(){!function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;"undefined"==typeof jQuery&&setTimeout((function(){e(t,n)}),n),t()}((function(){e.setCSRFToken(),e.setBaseURL(),e.renderModalBackdrop();var t=Object(r.a)()||{};t.type&&"sponsorship"===t.type&&e.setupStripeHandler()}))}},{key:"getDonationAmount",value:function(){var t=e.minimumAmount();if($("#custamt").is(":checked"))return e.getSanitizedCustomAmount();var n,r,o=$("input[name=amount]:checked").val();return null!==(r=(n=/^\$?\s*(\d+\.?\d*)\s*$/).exec(o))&&(r.index===n.lastIndex&&(n.lastIndex+=1),parseFloat(r[1])>=t)?parseFloat(r[1]):null}},{key:"setupUpSellPopUp",value:function(e,t){var n=t;n<=10?n=5:n>10&&n<=25?n=10:n>25&&n<=100?n=25:n>100&&(n=50),$("#customer_id").val(e),$("#upsell_amount").val(n)}},{key:"getFrequency",value:function(){return $("[name=type]:checked").val()}},{key:"isFrequencyOptionSelected",value:function(){return $("[name=type]:checked").length>0}},{key:"isSubscriptionSelected",value:function(){return $("#type_subscription").is(":checked")}},{key:"minimumAmount",value:function(){return this.isSubscriptionSelected()?1:5}},{key:"maximumAmount",value:function(){return 9999}},{key:"showMinimumDonationAlert",value:function(){alert("To help prevent fraud, this page can only accept donations between $5 and $9,999.\n\nTo make a donation of $10,000 or more, please contact our philanthropy department at donations@archive.org")}},{key:"getDonationContext",value:function(){return/donatePage/.test($(document.body).attr("class"))?"page":"banner"}},{key:"getDonationPlatform",value:function(){var e=$(".js-donation-refs");return 0===e.count?"IA":e.first().attr("data-platform")||"IA"}},{key:"upSellYesEvent",value:function(){var t=$("#customer_id").val(),n=e.upsellAmount,r=e.csrf_token;if(t&&n&&!(n<1)){var o=$("#up_sell_yes").prop("disabled",!0),i={up_sell:"true",customer_id:t,amount:n,csrf_token:r,currency:"usd"};$.ajax({url:"".concat(e.baseURL,"/services/stripe-charge.php"),type:"post",data:i,success:function(e){var t=$.parseJSON(e);if(t.status){var r=t.data||{charge_id:"unknown"},i=$("#stripeComplete");i.find('input[name="donation-type"]').val("upsell"),i.find('input[name="upsell-amount"]').val(n),i.find('input[name="upsell-charge-id"]').val(r.charge_id),i.submit()}else alert("We apologize but something went wrong. Will you please try again?"),o.removeAttr("disabled")},error:e.stripeChargeError})}}},{key:"stripeChargeError",value:function(){AJS.modal_add("#stripe-charge-error",{title:"Processing Error",body:"<p>We're sorry, but we've encountered an error in processing your\n donation. You may try again or\n <a href=\"mailto:donations@archive.org?subject=[Donation Error]Unable to Donate via Stripe\">contact us</a>\n for assistance.</p>"}).modal("show"),e.closeUpSellModal(!0)}},{key:"closeUpSellModal",value:function(e){$("#upsell-popup").add("#upsell-popup + .modal-backdrop").removeClass("in").delay(150).hide(),e||$("#stripeComplete").submit()}},{key:"setDonationCookie",value:function(e){var t=parseInt(e,10);if(t){var n={path:"/",expires:t,domain:".archive.org"};"undefined"!=typeof Cookies&&(Cookies.set("donation","x",n),Cookies.set("donation","x",$.extend(n,{domain:".openlibrary.org"})))}}},{key:"enhancedDonationSource",value:function(e){var t=e;if(t)return e.match(/ctx=page/)?e.match(/;ref=/)||(t+=";ref=".concat(encodeURIComponent(document.referrer))):e.match(/;url=/)||(t+=";url=".concat(encodeURIComponent(location.href))),t}},{key:"sendStripeToken",value:function(t,n){var r=$(".upsell-popup"),i=r.find("#up_sell_yes, .later").hide(),a=r.find("#pending");$.ajax({url:"".concat(e.baseURL,"/services/stripe-charge.php"),type:"post",data:n,success:function(r){var u=$.parseJSON(r),s=t.email,c=n.amount,l=n.type,d=u.status,f=u.data,h=f.charge_id,p=f.customer_id;if(Object(o.a)(u),d)if(void 0!==h&&void 0!==p){var v=$("#stripeComplete");v.find('input[name="email"]').val(s),v.find('input[name="amount"]').val(c),v.find('input[name="charge-id"]').val(h),v.find('input[name="donation-type"]').val(l),e.setDonationCookie(45),"one-time"===l?(e.setupUpSellPopUp(p,c),i.show(),a.hide()):v.submit()}else e.stripeChargeError();else e.stripeChargeError()},error:e.stripeChargeError}),"one-time"===n.type&&e.showUpsellPopup()}},{key:"showUpsellPopup",value:function(){var e=$(".upsell-popup"),t=e.next(".modal-backdrop");e.add(t).removeClass("in").show().addClass("in")}},{key:"collectStripeData",value:function(t){return"sponsorship"===Object(r.a)().type?a(t):{charge_token:t.id,email:t.email,type:$('input[name="type"]:checked').val(),amount:e.getDonationAmount(1),source:e.enhancedDonationSource($("#stripeOneTime").attr("data-source")),csrf_token:e.csrf_token,address_city:t.card.address_city,address_state:t.card.address_state,address_zip:t.card.address_zip,address_country:t.card.address_country}}},{key:"configureStripe",value:function(t){var n=StripeCheckout.configure({key:t,image:"".concat(e.baseURL,"/images/logo_arches.png"),token:function(t){Object(o.a)(t);var n=e.collectStripeData(t);Object(o.a)(n),e.sendStripeToken(t,n)}});e.bindStripeClickEvents(n)}},{key:"bindStripeClickEvents",value:function(t){var n=function(n){var r=e.getDonationAmount(1);if(r){var o=100*r;"undefined"!=typeof archive_analytics&&archive_analytics.send_event_no_sampling("DonatePage","CreditCard".concat(n.data.frequency.replace(/\s/g,"")),window.location.pathname),t.open({image:"".concat(e.baseURL,"/images/logo_arches.png"),name:"Internet Archive",description:"".concat(n.data.frequency," Donation"),amount:o,panelLabel:"Donate {{amount}} ".concat(n.data.frequency),billingAddress:!0}),n.preventDefault()}};$("#stripeMonthly").on("click",{frequency:"Monthly"},n),$("#stripeOneTime").on("click",{frequency:"One Time"},n),$(window).on("popstate",(function(){return t.close()}))}},{key:"setupStripeHandler",value:function(){e.stripSetupStarted||(e.stripSetupStarted=!0,"undefined"!=typeof StripeCheckout?e.configureStripe($("#stripe_public_key").val()):i("https://checkout.stripe.com/checkout.js",(function(){e.configureStripe($("#stripe_public_key").val())})))}},{key:"amountIsValid",value:function(){var t=$("input[type=radio][name=amount]:checked").length>0,n=$("#custamt").is(":checked");if(t&&!n)return!0;var r=this.minimumAmount(),o=e.getSanitizedCustomAmount(),i=parseFloat(o),a=o.length>0&&!isNaN(i)&&i>=r&&i<1e4;return a}},{key:"upsellAmount",get:function(){return $("#upsell_amount").val()}},{key:"fakePaymentNonce",get:function(){return $("#fakePaymentNonce").val()}}],(n=null)&&u(t.prototype,n),s&&u(t,s),e}();window&&window.AJS&&(window.AJS.setDonateBannerSuppressionCookie=s.setDonationCookie),window.Donations=s,$((function(){$(".donate-form-section").length>0&&window.Donations.init()}))},7:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));var r=n(1);
|
||
/*! *****************************************************************************
|
||
Copyright (c) Microsoft Corporation.
|
||
|
||
Permission to use, copy, modify, and/or distribute this software for any
|
||
purpose with or without fee is hereby granted.
|
||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
PERFORMANCE OF THIS SOFTWARE.
|
||
***************************************************************************** */function o(e,t,n,o){var i,a=arguments.length,u=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"===("undefined"==typeof Reflect?"undefined":Object(r.a)(Reflect))&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(u=(a<3?i(u):a>3?i(t,n,u):i(t,n))||u);return a>3&&u&&Object.defineProperty(t,n,u),u}function i(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}},97:function(e,t,n){"use strict";n.r(t);var r=n(51),o=n(2);function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"get_banner_height",value:function(){return $("#donate_banner").outerHeight()}},{key:"postMessage",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(o.a)("postin",{event:t,incomingValue:n});var r=e.get_banner_height(),i=e.preventResizeEventResponse?e.calculateBannerWithReminderForm():0,a=Math.max(i,n);window.parent.postMessage(JSON.stringify({event:t,value:a,bannerHeight:r}),"*"),"close modal"===t&&e.adjust_height()}},{key:"openReminderForm",value:function(){e.preventResizeEventResponse=!0,e.postMessage("set height"),window.scrollTo(0,0)}},{key:"closeReminderForm",value:function(){e.preventResizeEventResponse=!1,e.postMessage("close modal"),window.scrollTo(0,0)}},{key:"calculateBannerWithReminderForm",value:function(){var e=document.querySelector(".js-donate-banner"),t=document.querySelector(".js-donate-form"),n=document.querySelector(".js-donate-later-dropdown"),r=e.offsetHeight,o=n.offsetHeight;return r-(r-(t.offsetHeight+t.offsetTop))+o+15}},{key:"adjust_height",value:function(t){var n=null!=t?t:e.get_banner_height();e.postMessage("set height",n),Object(o.a)({banner_height:n}),this.currentBannerHeight=n}},{key:"init",value:function(){Object(o.a)("donato tornado"),$(window).on("resize orientationchange",(function(){e.fixBannerHeightIfNeeded(),clearTimeout(e.adjust_height_throttler),e.adjust_height_throttler=setTimeout(e.adjust_height,100)})),this.currentWindowWidth=window.innerWidth,this.currentBannerHeight=e.get_banner_height(),e.adjust_height()}},{key:"fixBannerHeightIfNeeded",value:function(){if(window.innerWidth===this.currentWindowWidth){var t=e.get_banner_height();t!==this.currentBannerHeight&&(Object(o.a)("Performing banner height correction: current, new",this.currentBannerHeight,t),e.adjust_height(t))}else this.currentWindowWidth=window.innerWidth}}],(n=null)&&i(t.prototype,n),r&&i(t,r),e}();a.preventResizeEventResponse=!1;var u=a,s=n(40),c=n(11);function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var d,f=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$form=t,this.$trigger=n,this.setDonationCookie=r||$.noop}var t,n,r;return t=e,r=[{key:"validateDonorEmail",value:function(e){return/.+@.+\..+/.test(e)}},{key:"validateNameField",value:function(e){return!/[<>&:?'"]/.test(e)}}],(n=[{key:"setup",value:function(){var t=this,n=$("#donate_dropdown"),r=$("#close_donate_dropdown"),o=this.$form.attr("data-base-url")||"https://archive.org";this.$trigger.on("click.".concat("RemindForm"),(function(e){n.hasClass("is-open")||n.addClass("is-open"),t.$form.find("input").filter((function(e,t){return!t.value})).eq(0).focus(),u.openReminderForm(),e.preventDefault()})),r.on("click.".concat("RemindForm"),(function(){n.removeClass("is-open"),u.closeReminderForm(),t.$trigger.focus()})),$(window).on("keydown.".concat("RemindForm"),(function(e){n.hasClass("is-open")&&27===e.keyCode&&r.click()})),this.$form.on("submit.".concat("RemindForm"),(function(n){if(n.preventDefault(),e.validateDonorEmail(t.$form.find("[name=email]").val())){["first_name","last_name"].forEach((function(n){e.validateNameField(t.$form.find("[name='".concat(n,"']")).val())||t.$form.find("[name='".concat(n,"']")).val("")}));var r=t.$trigger.attr("data-source-context")||"";"undefined"!=typeof archive_analytics&&archive_analytics.send_event_no_sampling("DonateBanner".concat(r),"MaybeLaterFormSubmit",window.location.pathname),t.sendForm(o)}else t.$form.find(".error-email").show()}))}},{key:"sendForm",value:function(e){var t=this,n=$("#donate_reminder_success").addClass("hidden"),r=function(e,t){return"<h2>".concat(e,"</h2><p>").concat(t,"</p>")};$.ajax({type:"post",url:"".concat(e,"/donate/remindDonate.php"),data:this.$form.serialize(),success:function(){t.$form.addClass("hidden"),n.html(r("Thank You!","We'll be in touch in the next few days with a reminder to donate to the Internet Archive.")).removeClass("hidden"),t.setDonationCookie(45)},error:function(){n.html(r("Hmmm...","Something is amiss. Can you try again in a little while?")).removeClass("hidden")}})}}])&&l(t.prototype,n),r&&l(t,r),e}(),h=n(1),p=n(7),v=n(4),m=n(3),y=n(35),b=(n(38),Object(y.a)((function(e,t){e.exports=function(){function e(i,a){if(!(this instanceof e))return new e(i,a);a=Object.assign({},n,a);var u=Math.pow(10,a.precision);this.intValue=i=t(i,a),this.value=i/u,a.increment=a.increment||1/u,a.groups=a.useVedic?o:r,this.s=a,this.p=u}function t(t,n){var r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],o=n.decimal,i=n.errorOnInvalid,a=n.fromCents,u=Math.pow(10,n.precision),s=t instanceof e;if(s&&a)return t.intValue;if("number"==typeof t||s)o=s?t.value:t;else if("string"==typeof t)i=new RegExp("[^-\\d"+o+"]","g"),o=new RegExp("\\"+o,"g"),o=(o=t.replace(/\((.*)\)/,"-$1").replace(i,"").replace(o,"."))||0;else{if(i)throw Error("Invalid Input");o=0}return a||(o=(o*u).toFixed(4)),r?Math.round(o):o}var n={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:function(e,t){var n=t.pattern,r=t.negativePattern,o=t.symbol,i=t.separator,a=t.decimal;t=t.groups;var u=(""+e).replace(/^-/,"").split("."),s=u[0];return u=u[1],(0<=e.value?n:r).replace("!",o).replace("#",s.replace(t,"$1"+i)+(u?a+u:""))},fromCents:!1},r=/(\d)(?=(\d{3})+\b)/g,o=/(\d)(?=(\d\d)+\d\b)/g;return e.prototype={add:function(n){var r=this.s,o=this.p;return e((this.intValue+t(n,r))/(r.fromCents?1:o),r)},subtract:function(n){var r=this.s,o=this.p;return e((this.intValue-t(n,r))/(r.fromCents?1:o),r)},multiply:function(t){var n=this.s;return e(this.intValue*t/(n.fromCents?1:Math.pow(10,n.precision)),n)},divide:function(n){var r=this.s;return e(this.intValue/t(n,r,!1),r)},distribute:function(t){var n=this.intValue,r=this.p,o=this.s,i=[],a=Math[0<=n?"floor":"ceil"](n/t),u=Math.abs(n-a*t);for(r=o.fromCents?1:r;0!==t;t--){var s=e(a/r,o);0<u--&&(s=s[0<=n?"add":"subtract"](1/r)),i.push(s)}return i},dollars:function(){return~~this.value},cents:function(){return~~(this.intValue%this.p)},format:function(e){var t=this.s;return"function"==typeof e?e(this,t):t.format(this,Object.assign({},t,e))},toString:function(){var e=this.s,t=e.increment;return(Math.round(this.intValue/this.p/t)*t).toFixed(e.precision)},toJSON:function(){return this.value}},e}()})));function g(){var e=Object(h.l)(["\n :host {\n display: block;\n }\n\n .container {\n height: 100%;\n }\n\n .thermometer-message-container {\n height: ",";\n display: flex;\n align-items: center;\n }\n\n .thermometer-container {\n height: ",";\n flex: 1;\n position: relative;\n }\n\n .thermometer-background {\n background-color: ",";\n padding: 0;\n height: 100%;\n border-radius: ",";\n border: ",";\n overflow: hidden;\n }\n\n .thermometer-fill {\n background-color: ",";\n text-align: right;\n height: 100%;\n border-radius: ",";\n }\n\n .theremometer-value-container {\n position: absolute;\n height: ",";\n top: ",";\n }\n\n .thermometer-value-indicator {\n height: 100%;\n border-right: ",";\n }\n\n .thermometer-value {\n line-height: ",";\n text-align: right;\n }\n\n .donate-goal {\n text-align: left;\n padding: ",";\n text-transform: uppercase;\n line-height: ",";\n }\n "]);return g=function(){return e},e}function _(){var e=Object(h.l)(["var(--bannerThermometerGoalMessagePadding, 0 10px)"]);return _=function(){return e},e}function O(){var e=Object(h.l)(["var(--bannerThermometerGoalMessageLineHeight, 1)"]);return O=function(){return e},e}function j(){var e=Object(h.l)(["var(--bannerThermometerProgressValueLineHeight, 1)"]);return j=function(){return e},e}function w(){var e=Object(h.l)(["var(--bannerThermometerMarkerBorder, ",")"]);return w=function(){return e},e}function k(){var e=Object(h.l)(["var(--bannerThermometerMarkerHeight, 75%)"]);return k=function(){return e},e}function S(){var e=Object(h.l)(["var(--bannerThermometerMarkerTop, 50%)"]);return S=function(){return e},e}function C(){var e=Object(h.l)(["var(--bannerThermometerBorderRadius, 20px)"]);return C=function(){return e},e}function A(){var e=Object(h.l)(["var(--bannerThermometerProgressColor, #31A481)"]);return A=function(){return e},e}function x(){var e=Object(h.l)(["var(--bannerThermometerBackgroundColor, #D1FAED)"]);return x=function(){return e},e}function T(){var e=Object(h.l)(["var(--bannerThermometerBorder, 1px solid #31A481)"]);return T=function(){return e},e}function P(){var e=Object(h.l)(["var(--bannerThermometerHeight, 30px)"]);return P=function(){return e},e}function E(){var e=Object(h.l)(['\n <div\n class="container"\n role="progressbar"\n aria-valuemin="0"\n aria-valuemax="','"\n aria-valuenow="','"\n aria-valuetext="','"\n >\n <div class="thermometer-message-container">\n <div class="thermometer-container">\n <div class="thermometer-background">\n <div\n class="thermometer-fill"\n style="width: ','%"\n ></div>\n </div>\n <div\n class="theremometer-value-container"\n style="width: ','%"\n >\n <div class="thermometer-value-indicator"></div>\n <div class="thermometer-value">\n ','\n </div>\n </div>\n </div>\n <div class="donate-goal">',"</div>\n </div>\n </div>\n "]);return E=function(){return e},e}!function(e){e.ShowGoalAmount="showgoalamount",e.ShowGoalMessage="showgoalmessage"}(d||(d={}));var N=function(e){Object(h.f)(n,m.a);var t=Object(h.g)(n);function n(){var e;return Object(h.b)(this,n),(e=t.apply(this,arguments)).goalMessageMode=d.ShowGoalAmount,e.goalNearMessage="We’ve almost reached our goal!",e.goalReachedMessage="We've reached our goal!",e.goalAmount=75e5,e.currentAmount=0,e}return Object(h.c)(n,[{key:"render",value:function(){return Object(v.h)(E(),this.goalAmount,this.currentAmount,this.currentAmountDisplayValue,this.percentComplete,this.percentComplete,this.currentAmountDisplayValue,this.currentGoalMessage)}},{key:"currencyFormatted",value:function(e){return b(e,{symbol:"$",precision:0}).format()}},{key:"goalMessage",get:function(){return this.currentAmount>=this.goalAmount?this.goalReachedMessage:this.goalNearMessage}},{key:"currentAmountDisplayValue",get:function(){return this.currencyFormatted(this.currentAmount)}},{key:"goalAmountDisplayValue",get:function(){return this.currencyFormatted(this.goalAmount)}},{key:"currentGoalMessage",get:function(){switch(this.goalMessageMode){case d.ShowGoalAmount:return"".concat(this.goalAmountDisplayValue," goal");case d.ShowGoalMessage:return this.goalMessage}}},{key:"percentComplete",get:function(){return Math.min(this.currentAmount/this.goalAmount*100,100)}}],[{key:"styles",get:function(){var e=Object(m.b)(P()),t=Object(m.b)(T()),n=Object(m.b)(x()),r=Object(m.b)(A()),o=Object(m.b)(C()),i=Object(m.b)(S()),a=Object(m.b)(k()),u=Object(m.b)(w(),t),s=Object(m.b)(j()),c=Object(m.b)(O()),l=Object(m.b)(_());return Object(m.b)(g(),e,e,n,o,t,r,o,a,i,u,s,l,c)}}]),n}();function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object(p.a)([Object(m.e)({type:String})],N.prototype,"goalMessageMode",void 0),Object(p.a)([Object(m.e)({type:String})],N.prototype,"goalNearMessage",void 0),Object(p.a)([Object(m.e)({type:String})],N.prototype,"goalReachedMessage",void 0),Object(p.a)([Object(m.e)({type:Number})],N.prototype,"goalAmount",void 0),Object(p.a)([Object(m.e)({type:Number})],N.prototype,"currentAmount",void 0),N=Object(p.a)([Object(m.c)("donation-banner-thermometer")],N);var M=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,o;return t=e,(n=[{key:"addCloseSupport",value:function(){var e=this,t=function(){u.postMessage("hide banner",3),this.bannerElement.style.display="none",this.logEvent("CloseClicked"),this.setDonationCookie(3)};["donate_close_desktop","donate_close_mobile"].forEach((function(n){var r=document.getElementById(n);r&&r.addEventListener("click",t.bind(e))}))}},{key:"initialize",value:function(){this.bannerElement&&(this.donationInfoError=!1,this.addCloseSupport(),this.setupDonationForm(),u.init(),new f($("#donate_reminder_form"),$("#donate_later"),this.setDonationCookie).setup())}},{key:"setDonationCookie",value:function(e){r.default.setDonationCookie(e),u.postMessage("set cookie",e)}},{key:"setupDonationForm",value:function(){var e=this,t=document.querySelector("donation-form-edit-donation"),n=document.querySelector("#continue-button"),r=this.bannerElement,o=r.dataset.baseurl,i=r.dataset.donationsourcedata,a=new c.c({donationType:"one-time",amount:5,coverFees:!1});t.donationInfo=a,t.addEventListener("donationInfoChanged",(function(t){e.donationInfoError=!1,a=t.detail.donationInfo})),t.addEventListener("editDonationError",(function(t){e.donationInfoError=!0})),n.addEventListener("click",(function(){if(!e.donationInfoError){e.logEvent("ContinueClicked");var t=encodeURIComponent(e.donationOrigin),n="".concat(o,"/donate?amt=").concat(a.amount,"&contrib_type=").concat(a.donationType,"&coverFees=").concat(a.coverFees,"&origin=").concat(t,"&referer=").concat(i);u.postMessage("set cookie",30),window.top.location=n}})),this.logEvent("Viewed")}},{key:"logEvent",value:function(e){var t=new s.a,n="true"===this.bannerElement.dataset.debugmode?"DonateBannerDebug":"DonateBanner";t.send_event_no_sampling(n,e,this.donationOrigin)}},{key:"bannerElement",get:function(){return document.querySelector("#donate_banner")}},{key:"donationOrigin",get:function(){var e=this.bannerElement,t=e.dataset.exp,n=e.dataset.variant;return"DonateBanner-".concat(t,"-").concat(n)}}])&&D(t.prototype,n),o&&D(t,o),e}();document.addEventListener("DOMContentLoaded",(function(){(new M).initialize()}))}});
|
||
//# sourceMappingURL=donation-banner.min.js.map
|
||
// @license-end
|