@automattic/newspack-blocks 1.60.1 → 1.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/.cache/babel/3a66da0fe7ab175effa6a338812e46cb.json.gz +0 -0
  2. package/.cache/babel/9ed09b96b5f2df9daa6ce37304a7440e.json.gz +0 -0
  3. package/.cache/babel/dd70bbfe108da5e2fc7bd73bc688a05a.json.gz +0 -0
  4. package/CHANGELOG.md +30 -0
  5. package/composer.lock +6 -6
  6. package/dist/author-profile/view.asset.php +1 -1
  7. package/dist/author-profile/view.css +1 -1
  8. package/dist/author-profile/view.rtl.css +1 -1
  9. package/dist/donateStreamlined.asset.php +1 -1
  10. package/dist/donateStreamlined.js +1 -1
  11. package/dist/editor.asset.php +1 -1
  12. package/dist/editor.css +1 -1
  13. package/dist/editor.js +1 -1
  14. package/dist/editor.rtl.css +1 -1
  15. package/includes/class-newspack-blocks-api.php +3 -13
  16. package/includes/class-newspack-blocks.php +48 -39
  17. package/newspack-blocks.php +2 -2
  18. package/package.json +3 -3
  19. package/src/blocks/author-profile/editor.scss +5 -1
  20. package/src/blocks/author-profile/view.scss +4 -2
  21. package/src/blocks/donate/streamlined/index.ts +7 -1
  22. package/src/blocks/homepage-articles/class-wp-rest-newspack-articles-controller.php +1 -2
  23. package/src/blocks/homepage-articles/edit.js +10 -18
  24. package/src/blocks/homepage-articles/templates/article.php +8 -1
  25. package/src/blocks/homepage-articles/view.php +65 -0
  26. package/src/blocks/iframe/class-wp-rest-newspack-iframe-controller.php +0 -1
  27. package/src/components/query-controls.js +90 -94
  28. package/vendor/autoload.php +19 -1
  29. package/vendor/composer/ClassLoader.php +24 -15
  30. package/vendor/composer/InstalledVersions.php +9 -7
  31. package/vendor/composer/autoload_classmap.php +1 -1
  32. package/vendor/composer/autoload_namespaces.php +1 -1
  33. package/vendor/composer/autoload_psr4.php +1 -1
  34. package/vendor/composer/autoload_real.php +7 -26
  35. package/vendor/composer/autoload_static.php +2 -2
  36. package/vendor/composer/installed.php +3 -3
  37. package/.cache/babel/62b5d63d437188c9504804ced0783c31.json.gz +0 -0
  38. package/.cache/babel/9b4ddedacf987769a9fe17e8aa8aa4cd.json.gz +0 -0
  39. package/.cache/babel/de3c26fe430ad8ad5100705a33cb0cc3.json.gz +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,33 @@
1
+ # [1.61.0](https://github.com/Automattic/newspack-blocks/compare/v1.60.1...v1.61.0) (2023-01-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **donate-stripe:** initialize Stripe only if element is visible ([#1344](https://github.com/Automattic/newspack-blocks/issues/1344)) ([207bff7](https://github.com/Automattic/newspack-blocks/commit/207bff7cadca0102e02f152875425ca608149cfe))
7
+ * **HPB:** author query if CAP is unavailable ([#1336](https://github.com/Automattic/newspack-blocks/issues/1336)) ([b3ad96f](https://github.com/Automattic/newspack-blocks/commit/b3ad96f0112e05c8f7530c2e632e7a1754d760cc))
8
+ * make author block font sizing more specific ([#1343](https://github.com/Automattic/newspack-blocks/issues/1343)) ([a84034f](https://github.com/Automattic/newspack-blocks/commit/a84034f81c0d04ddbfe4eeb52fbcaac33d2ef158))
9
+ * make sure correct avatar is loaded when guests and users share IDs ([#1339](https://github.com/Automattic/newspack-blocks/issues/1339)) ([ebab2eb](https://github.com/Automattic/newspack-blocks/commit/ebab2eb9a3695336c394f01dd6835b46b248732c))
10
+
11
+
12
+ ### Features
13
+
14
+ * **homepage-posts-block:** filter image sizes based on the maximum image width ([#1322](https://github.com/Automattic/newspack-blocks/issues/1322)) ([6bed199](https://github.com/Automattic/newspack-blocks/commit/6bed1993216c31705e1ff59b55b1119aee13c4fc))
15
+
16
+ # [1.61.0-alpha.1](https://github.com/Automattic/newspack-blocks/compare/v1.60.1...v1.61.0-alpha.1) (2023-01-25)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **donate-stripe:** initialize Stripe only if element is visible ([#1344](https://github.com/Automattic/newspack-blocks/issues/1344)) ([207bff7](https://github.com/Automattic/newspack-blocks/commit/207bff7cadca0102e02f152875425ca608149cfe))
22
+ * **HPB:** author query if CAP is unavailable ([#1336](https://github.com/Automattic/newspack-blocks/issues/1336)) ([b3ad96f](https://github.com/Automattic/newspack-blocks/commit/b3ad96f0112e05c8f7530c2e632e7a1754d760cc))
23
+ * make author block font sizing more specific ([#1343](https://github.com/Automattic/newspack-blocks/issues/1343)) ([a84034f](https://github.com/Automattic/newspack-blocks/commit/a84034f81c0d04ddbfe4eeb52fbcaac33d2ef158))
24
+ * make sure correct avatar is loaded when guests and users share IDs ([#1339](https://github.com/Automattic/newspack-blocks/issues/1339)) ([ebab2eb](https://github.com/Automattic/newspack-blocks/commit/ebab2eb9a3695336c394f01dd6835b46b248732c))
25
+
26
+
27
+ ### Features
28
+
29
+ * **homepage-posts-block:** filter image sizes based on the maximum image width ([#1322](https://github.com/Automattic/newspack-blocks/issues/1322)) ([6bed199](https://github.com/Automattic/newspack-blocks/commit/6bed1993216c31705e1ff59b55b1119aee13c4fc))
30
+
1
31
  ## [1.60.1](https://github.com/Automattic/newspack-blocks/compare/v1.60.0...v1.60.1) (2023-01-12)
2
32
 
3
33
 
package/composer.lock CHANGED
@@ -2255,16 +2255,16 @@
2255
2255
  },
2256
2256
  {
2257
2257
  "name": "sirbrillig/phpcs-variable-analysis",
2258
- "version": "v2.11.9",
2258
+ "version": "v2.11.10",
2259
2259
  "source": {
2260
2260
  "type": "git",
2261
2261
  "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git",
2262
- "reference": "62730888d225d55a613854b6a76fb1f9f57d1618"
2262
+ "reference": "0f25a3766f26df91d6bdda0c8931303fc85499d7"
2263
2263
  },
2264
2264
  "dist": {
2265
2265
  "type": "zip",
2266
- "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/62730888d225d55a613854b6a76fb1f9f57d1618",
2267
- "reference": "62730888d225d55a613854b6a76fb1f9f57d1618",
2266
+ "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/0f25a3766f26df91d6bdda0c8931303fc85499d7",
2267
+ "reference": "0f25a3766f26df91d6bdda0c8931303fc85499d7",
2268
2268
  "shasum": ""
2269
2269
  },
2270
2270
  "require": {
@@ -2272,7 +2272,7 @@
2272
2272
  "squizlabs/php_codesniffer": "^3.5.6"
2273
2273
  },
2274
2274
  "require-dev": {
2275
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
2275
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0",
2276
2276
  "phpcsstandards/phpcsdevcs": "^1.1",
2277
2277
  "phpstan/phpstan": "^1.7",
2278
2278
  "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0",
@@ -2309,7 +2309,7 @@
2309
2309
  "source": "https://github.com/sirbrillig/phpcs-variable-analysis",
2310
2310
  "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki"
2311
2311
  },
2312
- "time": "2022-10-05T23:31:46+00:00"
2312
+ "time": "2023-01-05T18:45:16+00:00"
2313
2313
  },
2314
2314
  {
2315
2315
  "name": "squizlabs/php_codesniffer",
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-polyfill'), 'version' => '145fd34c0b472e48bfe88f0e15c0b210');
1
+ <?php return array('dependencies' => array('wp-polyfill'), 'version' => '1bbec22dcdccf4b554efdfc0ee875a28');
@@ -1 +1 @@
1
- @media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile{display:flex}}.wp-block-newspack-blocks-author-profile+.wp-block-newspack-blocks-author-profile{margin-top:2.5rem}.wp-block-newspack-blocks-author-profile h3{margin-bottom:.5em}p:not(.wp-block-newspack-blocks-author-profile__employment){font-size:1em!important}.wp-block-newspack-blocks-author-profile.text-size-small{font-size:.75em}.wp-block-newspack-blocks-author-profile.text-size-large{font-size:1.25em}.wp-block-newspack-blocks-author-profile.text-size-extra-large{font-size:1.5em}@media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile__avatar{flex:0 1 auto;margin-right:1.5em}}.wp-block-newspack-blocks-author-profile__avatar figure{margin:0;overflow:hidden}.wp-block-newspack-blocks-author-profile__avatar .avatar{border-radius:0;display:block;height:100%;max-width:none;-o-object-fit:cover;object-fit:cover;width:100%}@media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile__bio{flex:4}.wp-block-newspack-blocks-author-profile__bio h3{margin-top:0}}.wp-block-newspack-blocks-author-profile__employment,.wp-block-newspack-blocks-author-profile__job-title{margin-top:0;margin-bottom:0}.wp-block-newspack-blocks-author-profile__employment{font-size:.8em!important}.wp-block-newspack-blocks-author-profile__social-links{display:flex;flex-wrap:wrap;list-style:none;margin:-8px;padding:0}.wp-block-newspack-blocks-author-profile__social-links li{margin:8px}.wp-block-newspack-blocks-author-profile__social-links a,.wp-block-newspack-blocks-author-profile__social-links svg{display:block}.wp-block-newspack-blocks-author-profile__social-links svg{fill:currentcolor}.wp-block-newspack-blocks-author-profile .hidden{display:none}@media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile.avatar-right .wp-block-newspack-blocks-author-profile__avatar{margin-left:1.5em;margin-right:0;order:2}}.wp-block-newspack-blocks-author-profile.is-style-center{display:block}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__avatar{margin:0 0 1.5em}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__avatar figure{margin:0 auto}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__bio{text-align:center}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__social-links{justify-content:center}
1
+ @media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile{display:flex}}.wp-block-newspack-blocks-author-profile+.wp-block-newspack-blocks-author-profile{margin-top:2.5rem}.wp-block-newspack-blocks-author-profile h3{margin-bottom:.5em}.wp-block-newspack-blocks-author-profile p{font-size:1em}.wp-block-newspack-blocks-author-profile.text-size-small{font-size:.75em}.wp-block-newspack-blocks-author-profile.text-size-large{font-size:1.25em}.wp-block-newspack-blocks-author-profile.text-size-extra-large{font-size:1.5em}@media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile__avatar{flex:0 1 auto;margin-right:1.5em}}.wp-block-newspack-blocks-author-profile__avatar figure{margin:0;overflow:hidden}.wp-block-newspack-blocks-author-profile__avatar .avatar{border-radius:0;display:block;height:100%;max-width:none;-o-object-fit:cover;object-fit:cover;width:100%}@media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile__bio{flex:4}.wp-block-newspack-blocks-author-profile__bio h3{margin-top:0}}.wp-block-newspack-blocks-author-profile__employment,.wp-block-newspack-blocks-author-profile__job-title{margin-top:0;margin-bottom:0}.wp-block-newspack-blocks-author-profile__employment{font-size:.8em!important}.wp-block-newspack-blocks-author-profile__social-links{display:flex;flex-wrap:wrap;list-style:none;margin:-8px;padding:0}.wp-block-newspack-blocks-author-profile__social-links li{margin:8px}.wp-block-newspack-blocks-author-profile__social-links a,.wp-block-newspack-blocks-author-profile__social-links svg{display:block}.wp-block-newspack-blocks-author-profile__social-links svg{fill:currentcolor}.wp-block-newspack-blocks-author-profile .hidden{display:none}@media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile.avatar-right .wp-block-newspack-blocks-author-profile__avatar{margin-left:1.5em;margin-right:0;order:2}}.wp-block-newspack-blocks-author-profile.is-style-center{display:block}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__avatar{margin:0 0 1.5em}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__avatar figure{margin:0 auto}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__bio{text-align:center}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__social-links{justify-content:center}
@@ -1 +1 @@
1
- @media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile{display:flex}}.wp-block-newspack-blocks-author-profile+.wp-block-newspack-blocks-author-profile{margin-top:2.5rem}.wp-block-newspack-blocks-author-profile h3{margin-bottom:.5em}p:not(.wp-block-newspack-blocks-author-profile__employment){font-size:1em!important}.wp-block-newspack-blocks-author-profile.text-size-small{font-size:.75em}.wp-block-newspack-blocks-author-profile.text-size-large{font-size:1.25em}.wp-block-newspack-blocks-author-profile.text-size-extra-large{font-size:1.5em}@media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile__avatar{flex:0 1 auto;margin-left:1.5em}}.wp-block-newspack-blocks-author-profile__avatar figure{margin:0;overflow:hidden}.wp-block-newspack-blocks-author-profile__avatar .avatar{border-radius:0;display:block;height:100%;max-width:none;-o-object-fit:cover;object-fit:cover;width:100%}@media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile__bio{flex:4}.wp-block-newspack-blocks-author-profile__bio h3{margin-top:0}}.wp-block-newspack-blocks-author-profile__employment,.wp-block-newspack-blocks-author-profile__job-title{margin-top:0;margin-bottom:0}.wp-block-newspack-blocks-author-profile__employment{font-size:.8em!important}.wp-block-newspack-blocks-author-profile__social-links{display:flex;flex-wrap:wrap;list-style:none;margin:-8px;padding:0}.wp-block-newspack-blocks-author-profile__social-links li{margin:8px}.wp-block-newspack-blocks-author-profile__social-links a,.wp-block-newspack-blocks-author-profile__social-links svg{display:block}.wp-block-newspack-blocks-author-profile__social-links svg{fill:currentcolor}.wp-block-newspack-blocks-author-profile .hidden{display:none}@media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile.avatar-right .wp-block-newspack-blocks-author-profile__avatar{margin-right:1.5em;margin-left:0;order:2}}.wp-block-newspack-blocks-author-profile.is-style-center{display:block}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__avatar{margin:0 0 1.5em}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__avatar figure{margin:0 auto}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__bio{text-align:center}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__social-links{justify-content:center}
1
+ @media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile{display:flex}}.wp-block-newspack-blocks-author-profile+.wp-block-newspack-blocks-author-profile{margin-top:2.5rem}.wp-block-newspack-blocks-author-profile h3{margin-bottom:.5em}.wp-block-newspack-blocks-author-profile p{font-size:1em}.wp-block-newspack-blocks-author-profile.text-size-small{font-size:.75em}.wp-block-newspack-blocks-author-profile.text-size-large{font-size:1.25em}.wp-block-newspack-blocks-author-profile.text-size-extra-large{font-size:1.5em}@media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile__avatar{flex:0 1 auto;margin-left:1.5em}}.wp-block-newspack-blocks-author-profile__avatar figure{margin:0;overflow:hidden}.wp-block-newspack-blocks-author-profile__avatar .avatar{border-radius:0;display:block;height:100%;max-width:none;-o-object-fit:cover;object-fit:cover;width:100%}@media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile__bio{flex:4}.wp-block-newspack-blocks-author-profile__bio h3{margin-top:0}}.wp-block-newspack-blocks-author-profile__employment,.wp-block-newspack-blocks-author-profile__job-title{margin-top:0;margin-bottom:0}.wp-block-newspack-blocks-author-profile__employment{font-size:.8em!important}.wp-block-newspack-blocks-author-profile__social-links{display:flex;flex-wrap:wrap;list-style:none;margin:-8px;padding:0}.wp-block-newspack-blocks-author-profile__social-links li{margin:8px}.wp-block-newspack-blocks-author-profile__social-links a,.wp-block-newspack-blocks-author-profile__social-links svg{display:block}.wp-block-newspack-blocks-author-profile__social-links svg{fill:currentcolor}.wp-block-newspack-blocks-author-profile .hidden{display:none}@media only screen and (min-width:600px){.wp-block-newspack-blocks-author-profile.avatar-right .wp-block-newspack-blocks-author-profile__avatar{margin-right:1.5em;margin-left:0;order:2}}.wp-block-newspack-blocks-author-profile.is-style-center{display:block}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__avatar{margin:0 0 1.5em}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__avatar figure{margin:0 auto}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__bio{text-align:center}.wp-block-newspack-blocks-author-profile.is-style-center .wp-block-newspack-blocks-author-profile__social-links{justify-content:center}
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => '08d75e93ed497121542370f8b96ad60d');
1
+ <?php return array('dependencies' => array('wp-i18n', 'wp-polyfill'), 'version' => 'dc4732eeb0f4ed34003bc2a7099d3a6b');
@@ -1 +1 @@
1
- (()=>{var e={7597:(e,t)=>{"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},r(e)}var n,o="https://js.stripe.com/v3",a=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,i="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",u=null,c=function(e){return null!==u||(u=new Promise((function(t,r){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(i),window.Stripe)t(window.Stripe);else try{var n=function(){for(var e=document.querySelectorAll('script[src^="'.concat(o,'"]')),t=0;t<e.length;t++){var r=e[t];if(a.test(r.src))return r}return null}();n&&e?console.warn(i):n||(n=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(o).concat(t);var n=document.head||document.body;if(!n)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r}(e)),n.addEventListener("load",(function(){window.Stripe?t(window.Stripe):r(new Error("Stripe.js not available"))})),n.addEventListener("error",(function(){r(new Error("Failed to load Stripe.js"))}))}catch(u){return void r(u)}else t(null)}))),u},s=function(e,t,r){if(null===e)return null;var n=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.46.0",startTime:t})}(n,r),n},l=!1,p=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l=!0;var o=Date.now();return c(n).then((function(e){return s(e,t,o)}))};p.setLoadParameters=function(e){if(l)throw new Error("You cannot change load parameters after calling loadStripe");n=function(e){var t="invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(e),"\n");if(null===e||"object"!==r(e))throw new Error(t);if(1===Object.keys(e).length&&"boolean"==typeof e.advancedFraudSignals)return e;throw new Error(t)}(e)},t.loadStripe=p},7894:(e,t,r)=>{e.exports=r(7597)},5666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(T){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),u=new P(n||[]);return o(i,"_invoke",{value:E(e,r,u)}),i}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(T){return{type:"throw",arg:T}}}e.wrap=l;var f="suspendedStart",d="executing",m="completed",y={};function h(){}function v(){}function b(){}var g={};s(g,i,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(q([])));x&&x!==r&&n.call(x,i)&&(g=x);var k=b.prototype=h.prototype=Object.create(g);function S(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(o,a,i,u){var c=p(e[o],e,a);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,u)}),(function(e){r("throw",e,i,u)})):t.resolve(l).then((function(e){s.value=e,i(s)}),(function(e){return r("throw",e,i,u)}))}u(c.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function E(e,t,r){var n=f;return function(o,a){if(n===d)throw new Error("Generator is already running");if(n===m){if("throw"===o)throw a;return R()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=j(i,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var c=p(e,t,r);if("normal"===c.type){if(n=r.done?m:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=m,r.method="throw",r.arg=c.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=p(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function q(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:R}}function R(){return{value:t,done:!0}}return v.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},S(_.prototype),s(_.prototype,u,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},S(k),s(k,c,"Generator"),s(k,i,(function(){return this})),s(k,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=q,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],u=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:q(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function a(e,t,r,n,o,a,i){try{var u=e[a](i),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){a(i,n,o,u,c,"next",e)}function c(e){a(i,n,o,u,c,"throw",e)}u(void 0)}))}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function s(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(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.")}()}r.r(n),r.d(n,{processStreamlinedElements:()=>_});const l=window.wp.i18n;var p=r(7894);r(5666);function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);_n=!0);}catch(u){i=!0,o=u}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return a}}(e,t)||c(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.")}()}var __=l.__,d=function(e,t){var r,n={};r=e.email,/\S+@\S+/.test(r)||(n.email=__("Email address is invalid.","newspack-blocks"));var o=t.minimumDonation;return o&&parseFloat(e.amount)<o&&(n.amount=(0,l.sprintf)(__("Amount must be at least %d.","newspack-blocks"),o)),0===e.full_name.length&&(n.amount=__("Full name should be provided.","newspack-blocks")),n},m=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"error";t.innerHTML="",e.forEach((function(e){if(e){var n=document.createElement("div");n.classList.add("type-".concat(r)),n.innerHTML=e,t.appendChild(n)}})),"success"===r&&t.parentElement&&t.parentElement.replaceWith(t)},y=function(e){var t=e.closest("[data-streamlined-config]"),r=null==t?void 0:t.getAttribute("data-streamlined-config");if(!r)return{};var n=f(JSON.parse(r),12),o=n[0],a=n[1],i=n[2],u=n[3],c=n[4],s=n[5],l=n[6],p=n[7],d=n[8],m=n[9],y=n[10],h=n[11];return{currency:o.toLowerCase(),currencySymbol:a,siteName:i,isCurrencyZeroDecimal:u,countryCode:c,frequencies:s,feeMultiplier:parseFloat(l),feeStatic:parseFloat(p),stripePublishableKey:d,paymentRequestType:m,captchaSiteKey:y,minimumDonation:parseFloat(h)}},h=function(e){var t=Object.fromEntries(new FormData(e)),r="donation_value_".concat(t.donation_frequency);return t.amount=t[r],"other"===t.amount&&(t.amount=t["".concat(r,"_other")]),t.amount||(t.amount=t["".concat(r,"_untiered")]),t.cid&&"string"==typeof t.cid&&0===t.cid.indexOf("CLIENT_ID")&&(t.cid=document.cookie.split("; ").reduce((function(e,t){var r=t.split("=");return e[r[0]]=r[1],e}),{})["newspack-cid"]),t},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{convertToSubunit:!1},r=t.convertToSubunit,n=y(e),o=h(e),a=o.amount,i=void 0===a?"0":a,u=o.agree_to_pay_fees,c=function(e){return r?e*(n.isCurrencyZeroDecimal?1:100):e},s=0;return u&&(s=c(g(e)||0)),c(parseFloat(i))+s},b=function(e){var t=y(e),r=h(e).donation_frequency,n=t.frequencies[r];return{label:"".concat(t.siteName," (").concat(n,")"),amount:v(e,{convertToSubunit:!0})}},g=function(e){var t=y(e),r=t.feeMultiplier,n=t.feeStatic;if(void 0===r||void 0===n||isNaN(r)||isNaN(n))return 0;var o=h(e).amount;return function(e,t,r){return parseFloat(((e+r)/(100-t)*100-e).toFixed(2))}(parseFloat(o),r,n)},w=function(){var e=i(regeneratorRuntime.mark((function e(t,r){var n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:"POST",e.abrupt("return",fetch("/wp-json/newspack-blocks/v1".concat(t),{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(function(){var e=i(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:if(r=e.sent,!t.ok){e.next=5;break}return e.abrupt("return",r);case 5:return e.abrupt("return",{error:r});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e)})));return function(_x,t){return e.apply(this,arguments)}}(),x=function(e,t){var r=(0,l.sprintf)(__("Your payment has been processed. Thank you for your contribution! You will receive a confirmation email at %s.","newspack-blocks"),e);m([r],t,"success")},k=l.__,S=function(e){return s(e.querySelectorAll("input[data-is-additional-field]")).map((function(e){return{name:e.name,value:e.value}}))},_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return s(e.querySelectorAll(".stripe-payment")).forEach(function(){var e=i(regeneratorRuntime.mark((function e(t){var r,n,a,u,c,s,l,f,_,E,j,O,L,P,q,R,T,F,A;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=!1,l=t.closest("form"),f=t.querySelector(".stripe-payment__messages"),l&&f){e.next=5;break}return e.abrupt("return");case 5:_=t.closest(".wpbnbd"),E="newspackPaymentFlowComplete-".concat((null==_?void 0:_.id)||""),j=y(l),O=function(){return t.classList.add("stripe-payment--disabled")},(L=function(){return t.classList.remove("stripe-payment--disabled")})(),P=function(){if(!s){var e=t.querySelector(".stripe-payment__inputs.stripe-payment--hidden");e&&(e.classList.remove("stripe-payment--hidden"),s=!0)}},q=function(){var e=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var n=window.grecaptcha;if(!n)return e("");null!=n&&n.ready&&t||r(k("Error loading the reCaptcha library.","newspack-blocks")),n.ready(i(regeneratorRuntime.mark((function o(){var a;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,n.execute(t,{action:"submit"});case 3:return a=o.sent,o.abrupt("return",e(a));case 7:o.prev=7,o.t0=o.catch(0),r(o.t0);case 10:case"end":return o.stop()}}),o,null,[[0,7]])}))))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),R=function(){var e=i(regeneratorRuntime.mark((function e(t){var n,a,i,c,s,p,d,y,b,g,_,O,P,R,T,F=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=F.length>1&&void 0!==F[1]?F[1]:{},r){e.next=3;break}return e.abrupt("return");case 3:if(!(i=null==j?void 0:j.captchaSiteKey)){e.next=16;break}return e.prev=5,e.next=8,q(i);case 8:c=e.sent,e.next=16;break;case 11:return e.prev=11,e.t0=e.catch(5),s=e.t0 instanceof Error?e.t0.message:k("Error processing captcha request.","newspack-blocks"),m([s],f),e.abrupt("return",{error:!0});case 16:return p=h(l),d=l.closest("amp-layout.newspack-popup"),y=d&&d.hasAttribute("amp-access")?d.getAttribute("amp-access"):null,b=S(l),g=o({captchaToken:c,tokenData:t,amount:v(l),email:p.email,full_name:p.full_name,frequency:p.donation_frequency,newsletter_opt_in:Boolean(p.newsletter_opt_in),clientId:p.cid,origin:y,additional_fields:b},a),e.next=23,w("/donate",g);case 23:if(_=e.sent,200===(null===(n=_.data)||void 0===n?void 0:n.status)||!_.message){e.next=27;break}return m([_.message],f),e.abrupt("return",{error:!0});case 27:if(!_.error){e.next=30;break}return m([_.error],f),e.abrupt("return",{error:!0});case 30:if(O=function(e){return m([e],f),L(),window.dispatchEvent(new Event(E)),{error:!0}},!_.client_secret||!u){e.next=54;break}return e.next=34,r.confirmCardPayment(_.client_secret,{payment_method:u});case 34:if(!(P=e.sent).error){e.next=39;break}return e.abrupt("return",O(P.error.message));case 39:if("succeeded"!==P.paymentIntent.status){e.next=43;break}x(g.email,f),e.next=54;break;case 43:if("requires_action"!==P.paymentIntent.status){e.next=53;break}return e.next=46,r.confirmCardPayment(_.client_secret);case 46:if(R=e.sent,!(T=R.error)){e.next=50;break}return e.abrupt("return",O(T.message));case 50:x(g.email,f),e.next=54;break;case 53:return e.abrupt("return",O(k("Something went wrong with the payment. Please try again later.","newspack-blocks")));case 54:return"success"===_.status&&x(g.email,f),window.dispatchEvent(new Event(E)),e.abrupt("return",{});case 57:case"end":return e.stop()}}),e,null,[[5,11]])})));return function(t){return e.apply(this,arguments)}}(),T=function(){var e=i(regeneratorRuntime.mark((function e(){var o,s,f,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,p.loadStripe)(j.stripePublishableKey);case 2:if(r=e.sent){e.next=5;break}return e.abrupt("return");case 5:if(o=t.querySelector(".stripe-payment__card")){e.next=8;break}return e.abrupt("return");case 8:return s=r.elements(),(n=s.create("card")).mount(o),a=r.paymentRequest({country:j.countryCode,currency:j.currency,total:b(l),requestPayerName:!0,requestPayerEmail:!0}),e.next=14,a.canMakePayment();case 14:if(!e.sent){e.next=28;break}if(a.on("token",function(){var e=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=t.token;case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),a.on("paymentmethod",function(){var e=i(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=t.paymentMethod.id,e.next=3,R(c,{email:t.payerEmail,full_name:t.payerName,payment_method_id:u});case 3:r=e.sent,t.complete(null!=r&&r.error?"fail":"success");case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),l.addEventListener("change",(function(){a.update({total:b(l)})})),f=s.create("paymentRequestButton",{paymentRequest:a,style:{paymentRequestButton:{type:j.paymentRequestType,height:"46px"}}}),d=t.querySelector(".stripe-payment__request-button")){e.next=23;break}return e.abrupt("return");case 23:f.mount(d),d.classList.remove("stripe-payment--hidden"),setTimeout((function(){d.classList.remove("stripe-payment__request-button--invisible")}),0),e.next=29;break;case 28:P();case 29:t.classList.remove("stripe-payment--invisible");case 30:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),T(),(F=t.querySelector('button[type="submit"]'))&&(F.onclick=function(e){s||(e.preventDefault(),P())}),(A=function(){var e=t.querySelector("#stripe-fees-amount");if(e){var r=Object.fromEntries(new FormData(l)),n=g(l);if(0===n){var o=t.querySelector("#stripe-fees-amount-container");o&&(o.style.display="none")}"string"==typeof r.donation_frequency&&(e.innerHTML="(".concat(j.currencySymbol).concat(n.toFixed(2)," ").concat(j.frequencies[r.donation_frequency].toLowerCase(),")"))}})(),l.addEventListener("change",A),l.addEventListener("submit",function(){var e=i(regeneratorRuntime.mark((function e(t){var o,a,i,c,s,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return");case 2:if(t.preventDefault(),O(),m([k("Processing payment…","newspack-blocks")],f,"info"),a=h(l),!((i=Object.values(d(a,j))).length>0)){e.next=11;break}return m(i,f),L(),e.abrupt("return");case 11:return c=function(e){e.message&&i.push(e.message),m(i,f),L()},e.next=14,r.createToken(n);case 14:if(!(s=e.sent).error){e.next=18;break}return c(s.error),e.abrupt("return");case 18:return e.next=20,r.createPaymentMethod({type:"card",card:n,billing_details:{name:a.full_name,email:a.email}});case 20:if(!(p=e.sent).error){e.next=24;break}return c(p.error),e.abrupt("return");case 24:return u={card:n},e.next=27,R(s.token,{payment_method_id:p.paymentMethod.id});case 27:null!==(o=window.newspackReaderActivation)&&void 0!==o&&o.refreshAuthentication&&window.newspackReaderActivation.refreshAuthentication();case 28:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 22:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}())};_()})();var o=window;for(var a in n)o[a]=n[a];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
1
+ (()=>{var e={7597:(e,t)=>{"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},r(e)}var n,o="https://js.stripe.com/v3",a=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,i="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",u=null,c=function(e){return null!==u||(u=new Promise((function(t,r){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(i),window.Stripe)t(window.Stripe);else try{var n=function(){for(var e=document.querySelectorAll('script[src^="'.concat(o,'"]')),t=0;t<e.length;t++){var r=e[t];if(a.test(r.src))return r}return null}();n&&e?console.warn(i):n||(n=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(o).concat(t);var n=document.head||document.body;if(!n)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r}(e)),n.addEventListener("load",(function(){window.Stripe?t(window.Stripe):r(new Error("Stripe.js not available"))})),n.addEventListener("error",(function(){r(new Error("Failed to load Stripe.js"))}))}catch(u){return void r(u)}else t(null)}))),u},s=function(e,t,r){if(null===e)return null;var n=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.46.0",startTime:t})}(n,r),n},l=!1,f=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l=!0;var o=Date.now();return c(n).then((function(e){return s(e,t,o)}))};f.setLoadParameters=function(e){if(l)throw new Error("You cannot change load parameters after calling loadStripe");n=function(e){var t="invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(e),"\n");if(null===e||"object"!==r(e))throw new Error(t);if(1===Object.keys(e).length&&"boolean"==typeof e.advancedFraudSignals)return e;throw new Error(t)}(e)},t.loadStripe=f},7894:(e,t,r)=>{e.exports=r(7597)},5666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(T){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),u=new P(n||[]);return o(i,"_invoke",{value:E(e,r,u)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(T){return{type:"throw",arg:T}}}e.wrap=l;var p="suspendedStart",d="executing",m="completed",y={};function h(){}function v(){}function b(){}var g={};s(g,i,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(q([])));x&&x!==r&&n.call(x,i)&&(g=x);var k=b.prototype=h.prototype=Object.create(g);function S(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(o,a,i,u){var c=f(e[o],e,a);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,u)}),(function(e){r("throw",e,i,u)})):t.resolve(l).then((function(e){s.value=e,i(s)}),(function(e){return r("throw",e,i,u)}))}u(c.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function E(e,t,r){var n=p;return function(o,a){if(n===d)throw new Error("Generator is already running");if(n===m){if("throw"===o)throw a;return R()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=j(i,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var c=f(e,t,r);if("normal"===c.type){if(n=r.done?m:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=m,r.method="throw",r.arg=c.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function q(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:R}}function R(){return{value:t,done:!0}}return v.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},S(_.prototype),s(_.prototype,u,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},S(k),s(k,c,"Generator"),s(k,i,(function(){return this})),s(k,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=q,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],u=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:q(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function a(e,t,r,n,o,a,i){try{var u=e[a](i),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){a(i,n,o,u,c,"next",e)}function c(e){a(i,n,o,u,c,"throw",e)}u(void 0)}))}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function s(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(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.")}()}r.r(n),r.d(n,{processStreamlinedElements:()=>_});const l=window.wp.i18n;var f=r(7894);r(5666);function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],_n=!0,i=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);_n=!0);}catch(u){i=!0,o=u}finally{try{_n||null==r.return||r.return()}finally{if(i)throw o}}return a}}(e,t)||c(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.")}()}var __=l.__,d=function(e,t){var r,n={};r=e.email,/\S+@\S+/.test(r)||(n.email=__("Email address is invalid.","newspack-blocks"));var o=t.minimumDonation;return o&&parseFloat(e.amount)<o&&(n.amount=(0,l.sprintf)(__("Amount must be at least %d.","newspack-blocks"),o)),0===e.full_name.length&&(n.amount=__("Full name should be provided.","newspack-blocks")),n},m=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"error";t.innerHTML="",e.forEach((function(e){if(e){var n=document.createElement("div");n.classList.add("type-".concat(r)),n.innerHTML=e,t.appendChild(n)}})),"success"===r&&t.parentElement&&t.parentElement.replaceWith(t)},y=function(e){var t=e.closest("[data-streamlined-config]"),r=null==t?void 0:t.getAttribute("data-streamlined-config");if(!r)return{};var n=p(JSON.parse(r),12),o=n[0],a=n[1],i=n[2],u=n[3],c=n[4],s=n[5],l=n[6],f=n[7],d=n[8],m=n[9],y=n[10],h=n[11];return{currency:o.toLowerCase(),currencySymbol:a,siteName:i,isCurrencyZeroDecimal:u,countryCode:c,frequencies:s,feeMultiplier:parseFloat(l),feeStatic:parseFloat(f),stripePublishableKey:d,paymentRequestType:m,captchaSiteKey:y,minimumDonation:parseFloat(h)}},h=function(e){var t=Object.fromEntries(new FormData(e)),r="donation_value_".concat(t.donation_frequency);return t.amount=t[r],"other"===t.amount&&(t.amount=t["".concat(r,"_other")]),t.amount||(t.amount=t["".concat(r,"_untiered")]),t.cid&&"string"==typeof t.cid&&0===t.cid.indexOf("CLIENT_ID")&&(t.cid=document.cookie.split("; ").reduce((function(e,t){var r=t.split("=");return e[r[0]]=r[1],e}),{})["newspack-cid"]),t},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{convertToSubunit:!1},r=t.convertToSubunit,n=y(e),o=h(e),a=o.amount,i=void 0===a?"0":a,u=o.agree_to_pay_fees,c=function(e){return r?e*(n.isCurrencyZeroDecimal?1:100):e},s=0;return u&&(s=c(g(e)||0)),c(parseFloat(i))+s},b=function(e){var t=y(e),r=h(e).donation_frequency,n=t.frequencies[r];return{label:"".concat(t.siteName," (").concat(n,")"),amount:v(e,{convertToSubunit:!0})}},g=function(e){var t=y(e),r=t.feeMultiplier,n=t.feeStatic;if(void 0===r||void 0===n||isNaN(r)||isNaN(n))return 0;var o=h(e).amount;return function(e,t,r){return parseFloat(((e+r)/(100-t)*100-e).toFixed(2))}(parseFloat(o),r,n)},w=function(){var e=i(regeneratorRuntime.mark((function e(t,r){var n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:"POST",e.abrupt("return",fetch("/wp-json/newspack-blocks/v1".concat(t),{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(function(){var e=i(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:if(r=e.sent,!t.ok){e.next=5;break}return e.abrupt("return",r);case 5:return e.abrupt("return",{error:r});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e)})));return function(_x,t){return e.apply(this,arguments)}}(),x=function(e,t){var r=(0,l.sprintf)(__("Your payment has been processed. Thank you for your contribution! You will receive a confirmation email at %s.","newspack-blocks"),e);m([r],t,"success")},k=l.__,S=function(e){return s(e.querySelectorAll("input[data-is-additional-field]")).map((function(e){return{name:e.name,value:e.value}}))},_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return s(e.querySelectorAll(".stripe-payment")).forEach(function(){var e=i(regeneratorRuntime.mark((function e(t){var r,n,a,u,c,s,l,p,_,E,j,O,L,P,q,R,T,F,A;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=!1,l=t.closest("form"),p=t.querySelector(".stripe-payment__messages"),l&&p){e.next=5;break}return e.abrupt("return");case 5:_=t.closest(".wpbnbd"),E="newspackPaymentFlowComplete-".concat((null==_?void 0:_.id)||""),j=y(l),O=function(){return t.classList.add("stripe-payment--disabled")},(L=function(){return t.classList.remove("stripe-payment--disabled")})(),P=function(){if(!s){var e=t.querySelector(".stripe-payment__inputs.stripe-payment--hidden");e&&(e.classList.remove("stripe-payment--hidden"),s=!0)}},q=function(){var e=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var n=window.grecaptcha;if(!n)return e("");null!=n&&n.ready&&t||r(k("Error loading the reCaptcha library.","newspack-blocks")),n.ready(i(regeneratorRuntime.mark((function o(){var a;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,n.execute(t,{action:"submit"});case 3:return a=o.sent,o.abrupt("return",e(a));case 7:o.prev=7,o.t0=o.catch(0),r(o.t0);case 10:case"end":return o.stop()}}),o,null,[[0,7]])}))))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),R=function(){var e=i(regeneratorRuntime.mark((function e(t){var n,a,i,c,s,f,d,y,b,g,_,O,P,R,T,F=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=F.length>1&&void 0!==F[1]?F[1]:{},r){e.next=3;break}return e.abrupt("return");case 3:if(!(i=null==j?void 0:j.captchaSiteKey)){e.next=16;break}return e.prev=5,e.next=8,q(i);case 8:c=e.sent,e.next=16;break;case 11:return e.prev=11,e.t0=e.catch(5),s=e.t0 instanceof Error?e.t0.message:k("Error processing captcha request.","newspack-blocks"),m([s],p),e.abrupt("return",{error:!0});case 16:return f=h(l),d=l.closest("amp-layout.newspack-popup"),y=d&&d.hasAttribute("amp-access")?d.getAttribute("amp-access"):null,b=S(l),g=o({captchaToken:c,tokenData:t,amount:v(l),email:f.email,full_name:f.full_name,frequency:f.donation_frequency,newsletter_opt_in:Boolean(f.newsletter_opt_in),clientId:f.cid,origin:y,additional_fields:b},a),e.next=23,w("/donate",g);case 23:if(_=e.sent,200===(null===(n=_.data)||void 0===n?void 0:n.status)||!_.message){e.next=27;break}return m([_.message],p),e.abrupt("return",{error:!0});case 27:if(!_.error){e.next=30;break}return m([_.error],p),e.abrupt("return",{error:!0});case 30:if(O=function(e){return m([e],p),L(),window.dispatchEvent(new Event(E)),{error:!0}},!_.client_secret||!u){e.next=54;break}return e.next=34,r.confirmCardPayment(_.client_secret,{payment_method:u});case 34:if(!(P=e.sent).error){e.next=39;break}return e.abrupt("return",O(P.error.message));case 39:if("succeeded"!==P.paymentIntent.status){e.next=43;break}x(g.email,p),e.next=54;break;case 43:if("requires_action"!==P.paymentIntent.status){e.next=53;break}return e.next=46,r.confirmCardPayment(_.client_secret);case 46:if(R=e.sent,!(T=R.error)){e.next=50;break}return e.abrupt("return",O(T.message));case 50:x(g.email,p),e.next=54;break;case 53:return e.abrupt("return",O(k("Something went wrong with the payment. Please try again later.","newspack-blocks")));case 54:return"success"===_.status&&x(g.email,p),window.dispatchEvent(new Event(E)),e.abrupt("return",{});case 57:case"end":return e.stop()}}),e,null,[[5,11]])})));return function(t){return e.apply(this,arguments)}}(),T=function(){var e=i(regeneratorRuntime.mark((function e(){var o,s,p,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.loadStripe)(j.stripePublishableKey);case 2:if(r=e.sent){e.next=5;break}return e.abrupt("return");case 5:if(o=t.querySelector(".stripe-payment__card")){e.next=8;break}return e.abrupt("return");case 8:return s=r.elements(),(n=s.create("card")).mount(o),a=r.paymentRequest({country:j.countryCode,currency:j.currency,total:b(l),requestPayerName:!0,requestPayerEmail:!0}),e.next=14,a.canMakePayment();case 14:if(!e.sent){e.next=28;break}if(a.on("token",function(){var e=i(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=t.token;case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),a.on("paymentmethod",function(){var e=i(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=t.paymentMethod.id,e.next=3,R(c,{email:t.payerEmail,full_name:t.payerName,payment_method_id:u});case 3:r=e.sent,t.complete(null!=r&&r.error?"fail":"success");case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),l.addEventListener("change",(function(){a.update({total:b(l)})})),p=s.create("paymentRequestButton",{paymentRequest:a,style:{paymentRequestButton:{type:j.paymentRequestType,height:"46px"}}}),d=t.querySelector(".stripe-payment__request-button")){e.next=23;break}return e.abrupt("return");case 23:p.mount(d),d.classList.remove("stripe-payment--hidden"),setTimeout((function(){d.classList.remove("stripe-payment__request-button--invisible")}),0),e.next=29;break;case 28:P();case 29:t.classList.remove("stripe-payment--invisible");case 30:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),new IntersectionObserver((function(e){e[0].isIntersecting&&T()})).observe(t),(F=t.querySelector('button[type="submit"]'))&&(F.onclick=function(e){s||(e.preventDefault(),P())}),(A=function(){var e=t.querySelector("#stripe-fees-amount");if(e){var r=Object.fromEntries(new FormData(l)),n=g(l);if(0===n){var o=t.querySelector("#stripe-fees-amount-container");o&&(o.style.display="none")}"string"==typeof r.donation_frequency&&(e.innerHTML="(".concat(j.currencySymbol).concat(n.toFixed(2)," ").concat(j.frequencies[r.donation_frequency].toLowerCase(),")"))}})(),l.addEventListener("change",A),l.addEventListener("submit",function(){var e=i(regeneratorRuntime.mark((function e(t){var o,a,i,c,s,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return");case 2:if(t.preventDefault(),O(),m([k("Processing payment…","newspack-blocks")],p,"info"),a=h(l),!((i=Object.values(d(a,j))).length>0)){e.next=11;break}return m(i,p),L(),e.abrupt("return");case 11:return c=function(e){e.message&&i.push(e.message),m(i,p),L()},e.next=14,r.createToken(n);case 14:if(!(s=e.sent).error){e.next=18;break}return c(s.error),e.abrupt("return");case 18:return e.next=20,r.createPaymentMethod({type:"card",card:n,billing_details:{name:a.full_name,email:a.email}});case 20:if(!(f=e.sent).error){e.next=24;break}return c(f.error),e.abrupt("return");case 24:return u={card:n},e.next=27,R(s.token,{payment_method_id:f.paymentMethod.id});case 27:null!==(o=window.newspackReaderActivation)&&void 0!==o&&o.refreshAuthentication&&window.newspackReaderActivation.refreshAuthentication();case 28:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 23:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}())};_()})();var o=window;for(var a in n)o[a]=n[a];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'f9eca00e8a0662200bb19835e23cb290');
1
+ <?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '459f62b36ebd3a3da609a97589657f16');