@gp-australia-pacific/gpap-frontend-functions
Version:
Supporting frontend library functions for GPAP web infra.
3 lines (2 loc) • 1.59 kB
JavaScript
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).donations={})}(this,(function(e){"use strict";function n(e){return(n="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(){var e=new window.URL(window.location.href);return{amount:e.searchParams.get("amount"),firstName:e.searchParams.get("firstName"),recurring:"true"===e.searchParams.get("recurring"),meta:JSON.parse(decodeURIComponent(e.searchParams.get("meta"))||null),transaction:{id:e.searchParams.get("transactionId")}}}document.donationInfo=o(),e.getInfo=o,e.getToggler=function(e,o){return e&&o?function(t){("function"===("undefined"==typeof ijQuery?"undefined":n(ijQuery))?ijQuery:"function"===("undefined"==typeof jQuery?"undefined":n(jQuery))?jQuery:function(e){e()})((function(){var n=document.getElementById(o),r=document.getElementById(e);console.log("new donation frequency: ",t),r&&n?"once"===t?(n.style.display="none",r.style.display="block"):"recurring"===t&&(r.style.display="none",n.style.display="block"):console.warn("Missing disclaimer(s) after frequency change")}))}:function(){}},e.getType=function(){return"true"===new window.URL(window.location.href).searchParams.get("recurring")?"regular donation":"donation"},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map